PageSourceSearch

https://www.tuneparams.ai/static/js/main.3c5d8f99.js

js tuneparams.ai collected 2026-10-05 13:08:17 UTC 1,017,633 bytes, 3 lines download raw bytes

1/*! For license information please see main.3c5d8f99.js.LICENSE.txt */
2(()=>{"use strict";var e={342:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(5043),s=n(5187);const a=()=>{const e=(0,r.useContext)(s.cy);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}},346:()=>{},443:(e,t,n)=>{n.d(t,{$b:()=>s,Vy:()=>c});const r=[];var s;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(s||(s={}));const a={debug:s.DEBUG,verbose:s.VERBOSE,info:s.INFO,warn:s.WARN,error:s.ERROR,silent:s.SILENT},i=s.INFO,o={[s.DEBUG]:"log",[s.VERBOSE]:"log",[s.INFO]:"info",[s.WARN]:"warn",[s.ERROR]:"error"},l=function(e,t){if(t<e.logLevel)return;const n=(new Date).toISOString(),r=o[t];if(!r)throw new Error("Attempted to log a message with an invalid logType (value: ".concat(t,")"));for(var s=arguments.length,a=new Array(s>2?s-2:0),i=2;i<s;i++)a[i-2]=arguments[i];console[r]("[".concat(n,"]  ").concat(e.name,":"),...a)};class c{constructor(e){this.name=e,this._logLevel=i,this._logHandler=l,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in s))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e}setLogLevel(e){this._logLevel="string"===typeof e?a[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!==typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.DEBUG,...t),this._logHandler(this,s.DEBUG,...t)}log(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.VERBOSE,...t),this._logHandler(this,s.VERBOSE,...t)}info(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.INFO,...t),this._logHandler(this,s.INFO,...t)}warn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.WARN,...t),this._logHandler(this,s.WARN,...t)}error(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];this._userLogHandler&&this._userLogHandler(this,s.ERROR,...t),this._logHandler(this,s.ERROR,...t)}}},575:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(2555),s=n(5043),a=n(5472),i=n(8426);const o=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!i.db)throw new Error("Firestore not initialized");let t=(0,a.rJ)(i.db,"audit_logs");const n=[];e.userId&&n.push((0,a._M)("userId","==",e.userId)),e.action&&n.push((0,a._M)("action","==",e.action)),e.resource&&n.push((0,a._M)("resource","==",e.resource)),e.startDate&&n.push((0,a._M)("createdAt",">=",e.startDate)),e.endDate&&n.push((0,a._M)("createdAt","<=",e.endDate)),n.length>0&&(t=(0,a.P)(t,...n)),t=(0,a.P)(t,(0,a.My)("createdAt","desc"),(0,a.AB)(e.limit||100));const s=await(0,a.GG)(t),o=[];return s.forEach(e=>{o.push((0,r.A)({id:e.id},e.data()))}),{success:!0,logs:o}}catch(t){return console.error("Failed to get audit logs:",t),{success:!1,error:t.message,logs:[]}}};var l=n(579);const c=()=>{const[e,t]=(0,s.useState)([]),[n,a]=(0,s.useState)(null),[i,c]=(0,s.useState)(!1),[u,d]=(0,s.use
2State)(""),[h,m]=(0,s.useState)({action:"",resource:"",userId:"",startDate:"",endDate:"",limit:50}),p=(0,s.useCallback)(async()=>{c(!0),d("");try{const e=await o(h);e.success?t(e.logs):d(e.error)}catch(e){d("Failed to load audit logs")}finally{c(!1)}},[h]);(0,s.useEffect)(()=>{p(),f()},[p]);const f=async()=>{try{const e=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t=await o((0,r.A)((0,r.A)({},e),{},{limit:1e4}));if(!t.success)throw new Error(t.error);const n={totalEvents:t.logs.length,actionCounts:{},resourceCounts:{},userCounts:{},dailyActivity:{}};return t.logs.forEach(e=>{if(n.actionCounts[e.action]=(n.actionCounts[e.action]||0)+1,n.resourceCounts[e.resource]=(n.resourceCounts[e.resource]||0)+1,e.userId&&(n.userCounts[e.userId]=(n.userCounts[e.userId]||0)+1),e.createdAt){const t=new Date(e.createdAt).toISOString().split("T")[0];n.dailyActivity[t]=(n.dailyActivity[t]||0)+1}}),{success:!0,stats:n}}catch(u){return console.error("Failed to get audit stats:",u),{success:!1,error:u.message}}}();e.success&&a(e.stats)}catch(e){console.error("Failed to load audit stats:",e)}},g=(e,t)=>{m(n=>(0,r.A)((0,r.A)({},n),{},{[e]:t}))},v=e=>{if(!e)return"N/A";try{return(e.toDate?e.toDate():new Date(e)).toLocaleString()}catch(t){return"Invalid Date"}},y=e=>{switch(e){case"create":case"payment_success":return"#10b981";case"update":return"#f59e0b";case"delete":case"login_failure":case"payment_failure":return"#ef4444";case"login_success":return"#3b82f6";default:return"#6b7280"}};return(0,l.jsxs)("div",{className:"admin-audit-logs",children:[(0,l.jsxs)("div",{className:"audit-header",children:[(0,l.jsx)("h2",{children:"\ud83d\udd0d Audit Logs"}),(0,l.jsx)("button",{className:"export-btn",onClick:async()=>{try{c(!0);const e=await async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const t=await o((0,r.A)((0,r.A)({},e),{},{limit:1e4}));if(!t.success)throw new Error(t.error);const n={exportedAt:(new Date).toISOString(),filters:e,totalRecords:t.logs.length,logs:t.logs};return JSON.stringify(n,null,2)}catch(u){throw console.error("Failed to export audit logs:",u),u}}(h),t=new Blob([e],{type:"application/json"}),n=URL.createObjectURL(t),s=document.createElement("a");s.href=n,s.download="audit-logs-".concat((new Date).toISOString().split("T")[0],".json"),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(n)}catch(e){d("Failed to export audit logs")}finally{c(!1)}},disabled:i||0===e.length,children:"\ud83d\udce5 Export Logs"})]}),n&&(0,l.jsxs)("div",{className:"audit-stats",children:[(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("h4",{children:"Total Events"}),(0,l.jsx)("span",{className:"stat-number",children:n.totalEvents})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("h4",{children:"Top Actions"}),(0,l.jsx)("div",{className:"stat-list",children:Object.entries(n.actionCounts).sort((e,t)=>{let[,n]=e,[,r]=t;return r-n}).slice(0,3).map(e=>{let[t,n]=e;return(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)("span",{children:n})]},t)})})]}),(0,l.jsxs)("div",{className:"stat-card",children:[(0,l.jsx)("h4",{children:"Top Resources"}),(0,l.jsx)("div",{className:"stat-list",children:Object.entries(n.resourceCounts).sort((e,t)=>{let[,n]=e,[,r]=t;return r-n}).slice(0,3).map(e=>{let[t,n]=e;return(0,l.jsxs)("div",{className:"stat-item",children:[(0,l.jsx)("span",{children:t}),(0,l.jsx)("span",{children:n})]},t)})})]})]}),(0,l.jsxs)("div",{className:"audit-filters",children:[(0,l.jsxs)("div",{className:"filter-row",children:[(0,l.jsxs)("select",{value:h.action,onChange:e=>g("action",e.target.value),children:[(0,l.jsx)("option",{value:"",children:"All Actions"}),(0,l.jsx)("option",{value:"create",children:"Create"}),(0,l.jsx)("option",{value:"update",children:"Update"}),(0,l.jsx)("option",{value:"delete",children:"Delete"}),(0,l.jsx)("option",{value:"login_success",children:"Login Success"}),(0,l.jsx)("option",{value:"login_failure",children:"Login Failure"}),(0,l.jsx)("option",{value:"payment_success",children:"Payment Success"}),(0,l.jsx)("option",{value:"payment_failure",children:"Payment Failure"})]}
2),(0,l.jsxs)("select",{value:h.resource,onChange:e=>g("resource",e.target.value),children:[(0,l.jsx)("option",{value:"",children:"All Resources"}),(0,l.jsx)("option",{value:"user",children:"User"}),(0,l.jsx)("option",{value:"enrollment",children:"Enrollment"}),(0,l.jsx)("option",{value:"payment",children:"Payment"}),(0,l.jsx)("option",{value:"coupon",children:"Coupon"}),(0,l.jsx)("option",{value:"review",children:"Review"}),(0,l.jsx)("option",{value:"auth",children:"Authentication"})]}),(0,l.jsx)("input",{type:"text",placeholder:"User ID",value:h.userId,onChange:e=>g("userId",e.target.value)}),(0,l.jsx)("input",{type:"date",placeholder:"Start Date",value:h.startDate,onChange:e=>g("startDate",e.target.value)}),(0,l.jsx)("input",{type:"date",placeholder:"End Date",value:h.endDate,onChange:e=>g("endDate",e.target.value)})]}),(0,l.jsxs)("div",{className:"filter-actions",children:[(0,l.jsx)("button",{onClick:()=>{p()},disabled:i,children:"\ud83d\udd0d Apply Filters"}),(0,l.jsx)("button",{onClick:()=>{m({action:"",resource:"",userId:"",startDate:"",endDate:"",limit:50})},children:"\ud83d\uddd1\ufe0f Clear"})]})]}),u&&(0,l.jsx)("div",{className:"audit-error",children:u}),i&&(0,l.jsx)("div",{className:"audit-loading",children:"Loading audit logs..."}),!i&&e.length>0&&(0,l.jsx)("div",{className:"audit-logs-table",children:(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{children:"Timestamp"}),(0,l.jsx)("th",{children:"Action"}),(0,l.jsx)("th",{children:"Resource"}),(0,l.jsx)("th",{children:"User"}),(0,l.jsx)("th",{children:"Description"}),(0,l.jsx)("th",{children:"Details"})]})}),(0,l.jsx)("tbody",{children:e.map(e=>(0,l.jsxs)("tr",{children:[(0,l.jsx)("td",{className:"timestamp",children:v(e.timestamp||e.createdAt)}),(0,l.jsx)("td",{children:(0,l.jsx)("span",{className:"action-badge",style:{backgroundColor:y(e.action)},children:e.action})}),(0,l.jsxs)("td",{className:"resource",children:[e.resource,e.resourceId&&(0,l.jsxs)("small",{children:["(",e.resourceId,")"]})]}),(0,l.jsxs)("td",{className:"user-info",children:[(0,l.jsx)("div",{children:e.userId||"System"}),e.userEmail&&(0,l.jsx)("small",{children:e.userEmail}),e.userRole&&(0,l.jsx)("span",{className:"role-badge",children:e.userRole})]}),(0,l.jsx)("td",{className:"description",children:e.description}),(0,l.jsx)("td",{className:"details",children:(e.newData||e.previousData||e.metadata)&&(0,l.jsx)("button",{className:"details-btn",onClick:()=>{console.log("Audit Log Details:",{previous:e.previousData,new:e.newData,metadata:e.metadata}),alert("Check console for detailed information")},children:"\ud83d\udccb View"})})]},e.id))})]})}),!i&&0===e.length&&!u&&(0,l.jsx)("div",{className:"no-logs",children:"No audit logs found matching your criteria."})]})}},579:(e,t,n)=>{e.exports=n(2799)},628:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{DB:()=>p,Fo:()=>m,OS:()=>f,SJ:()=>h,W_:()=>v,XW:()=>g,Xp:()=>b,rS:()=>d});var s=n(2555),a=n(5472),i=n(8426),o=n(3387),l=n(5491),c=e([l]);l=(c.then?(await c)():c)[0];const u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const t=Math.random().toString(36).substring(2,10).toUpperCase(),n=Date.now().toString(36).toUpperCase();return e?"".concat(e).concat(t).concat(n):"".concat(t).concat(n)},d=async(e,t)=>{try{var n,r,s,c,d;if(!i.db)throw new Error("Firestore not initialized");const h=await(0,o.VM)(t);if(!h.success)throw new Error("Admin user not found");const m=e.code||u(e.prefix||""),p=(0,a.P)((0,a.rJ)(i.db,"coupons"),(0,a._M)("code","==",m),(0,a.AB)(1));if(!(await(0,a.GG)(p)).empty)throw new Error("Coupon code already exists");if(e.courseId){if(!(0,l.BZ)(e.courseId))throw new Error("Course not found: ".concat(e.courseId))}if(e.targetUserId){if(!(await(0,o.VM)(e.targetUserId)).success)throw new Error("Target user not found: ".concat(e.targetUserId))}if("percentage"===e.discountType&&(e.discountValue<=0||e.discountValue>100))throw new Error("Percentage discount must be between 1 and 100");if("fixed"===e.discountType&&e.discountValue<=0)throw new Error("Fixed discount amount must be greater than 0");const f={code:m,name:e.name||"Coupon ".concat(m),description:e.description||"",discountType:e.discountType,discountValue:parseFloat(e.discountValue),maxDiscountAmount:e.maxDiscountAmount?parseFloat(e.maxDiscountAmount):null,minOrderAmount:e.minOrderAmount?parseFloat(e.minOrderAmount):null,targetType:e.targetType,targetUserId:e.targetUserId||null,targetUserEmail:e.targetUserEmail||null,courseId:e.courseId||null,courseTitle:e.courseTitle||null,usageLimit:e.usageLimit?parseInt(e.usageLimit):null,usageLimitPerUser:e.usageLimitPerUser?parseInt(e.usageLimitPerUser):1,usageCount:0,validFrom:e.validFrom?new Date(e.validFrom):new Date,validUntil:e.validUntil?new Date(e.validUntil):null,status:"active",createdBy:t,createdByEmail
2:(null===(n=h.userData)||void 0===n?void 0:n.email)||null,createdByName:(null===(r=h.userData)||void 0===r?void 0:r.displayName)||(null===(s=h.userData)||void 0===s?void 0:s.name)||(null===(c=h.userData)||void 0===c||null===(d=c.email)||void 0===d?void 0:d.split("@")[0])||"Unknown Admin",createdAt:(0,a.O5)(),updatedAt:(0,a.O5)(),usageHistory:[]};return{success:!0,couponId:(await(0,a.gS)((0,a.rJ)(i.db,"coupons"),f)).id,couponCode:m,couponData:f}}catch(h){return{success:!1,error:h.message}}},h=async(e,t,n,r)=>{try{if(!i.db)throw new Error("Firestore not initialized");const s=(0,a.P)((0,a.rJ)(i.db,"coupons"),(0,a._M)("code","==",e.toUpperCase()),(0,a.AB)(1)),o=await(0,a.GG)(s);if(o.empty)return{valid:!1,error:"Invalid coupon code"};const l=o.docs[0],c=l.data();if("active"!==c.status)return{valid:!1,error:"Coupon is not active"};const u=new Date;if(c.validFrom&&c.validFrom.toDate()>u)return{valid:!1,error:"Coupon is not yet valid"};if(c.validUntil&&c.validUntil.toDate()<u)return{valid:!1,error:"Coupon has expired"};if("user_specific"===c.targetType&&c.targetUserId!==t)return{valid:!1,error:"This coupon is not valid for your account"};if("course_specific"===c.targetType&&c.courseId!==n)return{valid:!1,error:"This coupon is not valid for this course"};if(c.minOrderAmount&&r<c.minOrderAmount)return{valid:!1,error:"Minimum order amount of $".concat(c.minOrderAmount," required")};if(c.usageLimit&&c.usageCount>=c.usageLimit)return{valid:!1,error:"Coupon usage limit exceeded"};const d=c.usageHistory.filter(e=>e.userId===t).length;if(c.usageLimitPerUser&&d>=c.usageLimitPerUser)return{valid:!1,error:"You have already used this coupon the maximum number of times"};let h=0;"percentage"===c.discountType?(h=r*c.discountValue/100,c.maxDiscountAmount&&h>c.maxDiscountAmount&&(h=c.maxDiscountAmount)):"fixed"===c.discountType&&(h=Math.min(c.discountValue,r));const m=Math.max(0,r-h);return{valid:!0,couponId:l.id,couponCode:c.code,discountType:c.discountType,discountValue:c.discountValue,discountAmount:h,originalAmount:r,finalAmount:m,savings:h,couponData:c}}catch(s){return{valid:!1,error:s.message}}},m=async(e,t,n,r)=>{try{var l;if(!i.db)throw new Error("Firestore not initialized");const c=await(0,o.VM)(t),u=c.success?null===(l=c.data)||void 0===l?void 0:l.email:null,d=(0,a.H9)(i.db,"coupons",e),h=await(0,a.x7)(d);if(!h.exists())throw new Error("Coupon not found");const m=h.data(),p={userId:t,userEmail:u,courseId:n,usedAt:new Date,orderAmount:r.orderAmount,discountAmount:r.discountAmount,finalAmount:r.finalAmount,paymentId:r.paymentId||null,orderId:r.orderId||null,enrollmentType:r.enrollmentType||"payment"},f=[...m.usageHistory||[],p],g=(m.usageCount||0)+1,v={usageCount:g,usageHistory:f,updatedAt:new Date};m.usageLimit&&g>=m.usageLimit&&(v.status="inactive"),Object.keys(v).forEach(e=>{void 0===v[e]&&delete v[e]}),await(0,a.mZ)(d,v);return{success:!0,usageLogId:(await(0,a.gS)((0,a.rJ)(i.db,"coupon_usage"),(0,s.A)((0,s.A)({couponId:e,couponCode:m.code},p),{},{createdAt:new Date}))).id}}catch(c){return{success:!1,error:c.message,errorCode:c.code}}},p=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!i.db)throw new Error("Firestore not initialized");let t=(0,a.rJ)(i.db,"coupons");e.status&&(t=(0,a.P)(t,(0,a._M)("status","==",e.status))),e.targetType&&(t=(0,a.P)(t,(0,a._M)("targetType","==",e.targetType))),e.courseId&&(t=(0,a.P)(t,(0,a._M)("courseId","==",e.courseId))),t=(0,a.P)(t,(0,a.My)("createdAt","desc"));const n=await(0,a.GG)(t),r=[];return n.forEach(e=>{r.push((0,s.A)({id:e.id},e.data()))}),{success:!0,coupons:r}}catch(t){return{success:!1,error:t.message,coupons:[]}}},f=async(e,t,n)=>{try{if(!i.db)throw new Error("Firestore not initialized");const r=(0,a.H9)(i.db,"coupons",e);return await(0,a.mZ)(r,{status:t,updatedAt:(0,a.O5)(),lastModifiedBy:n}),{success:!0}}catch(r){return{success:!1,error:r.message}}},g=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{if(!i.db)throw new Error("Firestore not initialized");let t=(0,a.rJ)(i.db,"coupon_usage");e&&(t=(0,a.P)(t,(0,a._M)("couponId","==",e))),t=(0,a.P)(t,(0,a.My)("createdAt","desc"));const n=await(0,a.GG)(t),r=[];let o=0,l=0;
2return n.forEach(e=>{const t=(0,s.A)({id:e.id},e.data());r.push(t),o+=t.discountAmount||0,l+=t.orderAmount||0}),{success:!0,stats:{totalUsage:r.length,totalDiscount:o,totalOrders:l,averageDiscount:r.length>0?o/r.length:0,usageRecords:r}}}catch(t){return{success:!1,error:t.message}}},v=async(e,t)=>{try{if(!i.db)throw new Error("Firestore not initialized");const n=(0,a.H9)(i.db,"coupons",e),r=await(0,a.x7)(n);if(!r.exists())throw new Error("Coupon not found");return r.data().usageCount>0?(await(0,a.mZ)(n,{status:"inactive",deletedAt:(0,a.O5)(),deletedBy:t,updatedAt:(0,a.O5)()}),{success:!0,message:"Coupon marked as inactive (cannot delete used coupons)"}):(await(0,a.kd)(n),{success:!0,message:"Coupon deleted successfully"})}catch(n){return{success:!1,error:n.message}}},y=async e=>{try{if(!i.db)throw new Error("Firestore not initialized");const t=(0,a.P)((0,a.rJ)(i.db,"coupons"),(0,a._M)("code","==",e.toUpperCase()),(0,a.AB)(1)),n=await(0,a.GG)(t);if(n.empty)return{success:!1,error:"Coupon not found"};const r=n.docs[0];return{success:!0,coupon:(0,s.A)({id:r.id},r.data())}}catch(t){return{success:!1,error:t.message}}},b=async(e,t)=>{try{const s=await y(e);if(!s.success)return{success:!1,error:"Coupon not found: ".concat(e)};const a=s.coupon,i={orderAmount:100,discountAmount:25,finalAmount:75,paymentId:"TEST_".concat(Date.now()),orderId:"TEST_ORDER_".concat(Date.now()),enrollmentType:"test"},o=await m(a.id,t,"test-course",i);if(o.success){const t=await y(e);if(t.success){var n,r;const e=t.coupon;return{success:!0,message:"Test coupon usage recorded successfully",before:{usageCount:a.usageCount,historyLength:(null===(n=a.usageHistory)||void 0===n?void 0:n.length)||0},after:{usageCount:e.usageCount,historyLength:(null===(r=e.usageHistory)||void 0===r?void 0:r.length)||0},usageLogId:o.usageLogId}}}return{success:!1,error:"Failed to record test usage",details:o}}catch(s){return{success:!1,error:s.message}}};r()}catch(u){r(u)}})},655:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>g});var s=n(2555),a=n(5043),i=n(9412),o=n(4879),l=n(4366),c=n(7324),u=n(6073),d=n(8108),h=n(5293),m=n(5401),p=(n(1209),n(579)),f=e([i]);i=(f.then?(await f)():f)[0];const g=()=>{var e,t,r,f;const{isAdmin:g,loading:v}=(0,o.h)(),{courses:y,loading:b,error:x,refetch:w}=(0,i.A8)(),[N,j]=(0,a.useState)("overview"),[E,S]=(0,a.useState)(null),[C,k]=(0,a.useState)(!1),[_,A]=(0,a.useState)(!1),[T,I]=(0,a.useState)(!1),[P,R]=(0,a.useState)(!1),[D,O]=(0,a.useState)(!1),[L,M]=(0,a.useState)(null),[F,U]=(0,a.useState)({section:null,index:null}),[V,z]=(0,a.useState)({}),[B,q]=(0,a.useState)(!1),[H,W]=(0,a.useState)({message:"",type:"",show:!1});if(!v&&!g)return(0,p.jsx)(l.C5,{to:"/dashboard",replace:!0});if(v||b)return(0,p.jsxs)("div",{className:"course-management-loading",children:[(0,p.jsx)("div",{className:"spinner"}),(0,p.jsx)("p",{children:"Loading course management..."})]});if(x)return(0,p.jsxs)("div",{className:"course-management-error",children:[(0,p.jsx)("h2",{children:"Error Loading Courses"}),(0,p.jsx)("p",{children:x}),(0,p.jsx)("button",{onClick:w,className:"retry-btn",children:"Retry"})]});const G=async()=>{w(),E&&await J(E.id)},K=function(e){W({message:e,type:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",show:!0}),setTimeout(()=>{W(e=>(0,s.A)((0,s.A)({},e),{},{show:!1}))},4e3)},J=async e=>{try{k(!0),console.log("\ud83d\udd04 Loading complete course data for:",e);const t=await(0,c.HR)(e);console.log("\u2705 Complete course loaded:",t),console.log("\ud83d\udce6 Batches:",null===t||void 0===t?void 0:t.batches),console.log("\ud83d\udcd6 Curriculum:",null===t||void 0===t?void 0:t.curriculum),t.batches&&0!==t.batches.length||console.warn("\u26a0\ufe0f No batches found in course data!"),S(t)}catch(t){console.error("\u274c Error loading course details:",t),console.error("Error details:",{message:t.message,code:t.code,stack:t.stack});const n=y.find(t=>t.id===e);console.warn("\u26a0\ufe0f Using fallback basic course data:",n),S(n)}finally{k(!1)}},Y=e=>{const{name:t,value:n,type:r,checked:a}=e.target;z(e=>(0,s.A)((0,s.A)({},e),{},{[t]:"checkbox"===r?a:n}))};return(0,p.jsxs)("div",{className:"course-management",children:[H.show&&(0,p.jsxs)("div",{className:"notification notification-".concat(H.type),children:[(0,p.jsx)("span",{children:H.message}),(0,p.jsx)("button",{className:"notification-close",onClick:()=>{W(e=>(0,s.A)((0,s.A)({},e),{},{show:!1}))},children:"\xd7"})]}),(0,p.jsxs)("div",{className:"course-management-header",children:[(0,p.jsx)("h1",{children:"\ud83d\udcda Course Management"}),(0,p.jsx)("p",{children:"Manage all course content, batches, videos, and schedules"})]}),(0,p.jsxs)("div",{className:"course-management-content",children:[(0,p.jsxs)("div",{className:"course-management-sidebar",children:[(0,p.jsxs)("div",{className:"sidebar-header",children:[(0,p.jsxs)("h3",{children:["Courses (",y.length,")"]}),(0,p.jsx)("button",{className:"btn-primary",children:"+ New Course"})]}),(0,p.jsx)("div",{className:"course-list",children:y.map(e=>(0,p.jsxs)("div",{className:"course-item ".concat((null===E||void 0===E?void 0:E.id)===e.id?"active":""),onClick:()=>(async e=>{await J(e.id),z({comingSoon:e.comingSoon||!1,nextBatchDate:e.nextBatchDate||"",category:e.category||""})})(e),children:[(0,p.jsx)("div",{className:"course-icon",children:e.icon}),(0,p.jsxs)("div",{className:"course-info",children:[(0,p.jsx)("h4",{children:e.title}),(0,p.jsx)("span",{className:"course-id",children:e.id})]})]},e.id))})]}),(0,p.jsx)("div",{className:"course-main-content",children:E?C?(0,p.jsxs)("div",{className:"course-loading",children:[(0,p.jsx)("div",{className:"spinner"}),(0,p.jsx)("p",{children:"Loading course details..."})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"selected-course-header",children:[(0,p.jsxs)("div",{className:"course-title-section",children:[(0,p.jsxs)("h2",{children:[E.icon," ",E.title]}),(0,p.jsx)("span",{className:"course-status",children:E.comingSoon?"\ud83d\udd1c Coming Soon":"\u2705 Active"})]}),(0,p.jsxs)("div",{className:"course-actions",children:[(0,p.jsx)("button",{className:"btn-secondary",onClick:()=>A(!0),children:"Edit Course Info"}),(0,p.jsx)("button",{className:"btn-danger",children:"Delete Course"})]})]}),(0,p.jsxs)("div",{className:"course-tabs",children:[(0,p.jsx)("button",{className:"tab ".concat("overview"===N?"active":""),onClick:()=>j("overview"),children:"\ud83d\udccb Overview"}),(0,p.jsxs)("button",{className:"tab ".concat("batches"===N?"active":""),onClick:()=>j("batches"),children:["\ud83d\udce6 Batches (",(null===(e=E.batches)||void 0===e?void 0:e.length)||0,")"]}),(0,p.jsxs)("button",{className:"tab ".concat("curriculum"===N?"active":""),onClick:()=>j("curriculum"),children:["\ud83d\udcd6 Curriculum (",(null===(t=E.curriculum)||void 0===t?void 0:t.length)||0,")"]}),(0,p.jsx)("button",{className:"tab ".concat("settings"===N?"active":""),onClick:()=>j("settings"),children:"\u2699\ufe0f Settings"})]}),(0,p.jsxs)("div",{className:"tab-content",children:["overview"===N&&(0,p.jsxs)("div",{className:"overview-tab",children:[(0,p.jsxs)("div",{className:"info-grid",children:[(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Course ID"}),(0,p.jsx)("p",{children:E.id})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Level"}),(0,p.jsx)("p",{children:E.level})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Duration"}),(0,p.jsx)("p",{children:E.duration})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Total Lessons"}),(0,p.jsx)("p",{children:E.lessons}
2)]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Max Capacity"}),(0,p.jsxs)("p",{children:[E.maxCapacity," students"]})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("label",{children:"Price"}),(0,p.jsxs)("p",{children:["$",E.price," ",(0,p.jsxs)("span",{className:"original-price",children:["$",E.originalPrice]})]})]})]}),(0,p.jsxs)("div",{className:"description-section",children:[(0,p.jsx)("h3",{children:"Description"}),(0,p.jsx)("p",{children:E.description})]})]}),"batches"===N&&(0,p.jsxs)("div",{className:"batches-tab",children:[(0,p.jsxs)("div",{className:"tab-header",children:[(0,p.jsx)("h3",{children:"Manage Batches"}),(0,p.jsx)("button",{className:"btn-primary",onClick:()=>{M(null),I(!0)},children:"+ Add Batch"})]}),(0,p.jsxs)("div",{className:"batches-list",children:[null===(r=E.batches)||void 0===r?void 0:r.map(e=>{var t,r,s,a,i,o,l;return(0,p.jsxs)("div",{className:"batch-card",children:[(0,p.jsxs)("div",{className:"batch-header",children:[(0,p.jsxs)("h4",{children:["Batch ",e.batchNumber,": ",e.batchName]}),(0,p.jsx)("span",{className:"status-badge status-".concat(e.status),children:e.status})]}),(0,p.jsxs)("div",{className:"batch-details",children:[(0,p.jsxs)("p",{children:[(0,p.jsx)("strong",{children:"Dates:"})," ",e.startDate," to ",e.endDate]}),(0,p.jsxs)("p",{children:[(0,p.jsx)("strong",{children:"Capacity:"})," ",e.enrollmentCount,"/",e.maxCapacity]}),(0,p.jsxs)("p",{children:[(0,p.jsx)("strong",{children:"Drive Folders:"}),null!==(t=e.driveLinks)&&void 0!==t&&t.videosFolder?"\ud83c\udfa5 Videos":"",null!==(r=e.driveLinks)&&void 0!==r&&r.videosFolder&&null!==(s=e.driveLinks)&&void 0!==s&&s.materialsFolder?" \u2022 ":"",null!==(a=e.driveLinks)&&void 0!==a&&a.materialsFolder?"\ud83d\udcda Materials":"",null!==(i=e.driveLinks)&&void 0!==i&&i.videosFolder||null!==(o=e.driveLinks)&&void 0!==o&&o.materialsFolder?"":"Not configured"]}),(0,p.jsxs)("p",{children:[(0,p.jsx)("strong",{children:"Schedule:"})," ",(null===(l=e.schedule)||void 0===l?void 0:l.length)||0," sessions"]})]}),(0,p.jsxs)("div",{className:"batch-actions",children:[(0,p.jsx)("button",{className:"btn-sm btn-secondary",onClick:()=>(e=>{M(e),I(!0)})(e),children:"\u270f\ufe0f Edit"}),(0,p.jsx)("button",{className:"btn-sm btn-info",onClick:()=>(e=>{M(e),O(!0)})(e),children:"\ud83d\udcc5 Manage Schedule"}),(0,p.jsx)("button",{className:"btn-sm btn-danger",onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete ".concat(e.batchName,"? This action cannot be undone.")))try{const{deleteBatch:t}=await Promise.resolve().then(n.bind(n,7324));await t(E.id,e.id),await G(),K("Batch deleted successfully!","success")}catch(x){console.error("Error deleting batch:",x),K("Failed to delete batch. Please try again.","error")}})(e),children:"\ud83d\uddd1\ufe0f Delete"})]})]},e.id||e.batchNumber)}),(!E.batches||0===E.batches.length)&&(0,p.jsx)("div",{className:"empty-state",children:(0,p.jsx)("p",{children:'No batches yet. Click "+ Add Batch" to create one.'})})]})]}),"curriculum"===N&&(0,p.jsxs)("div",{className:"curriculum-tab",children:[(0,p.jsxs)("div",{className:"tab-header",children:[(0,p.jsx)("h3",{children:"Course Curriculum"}),(0,p.jsx)("button",{className:"btn-primary",onClick:()=>{U({section:null,index:null}),R(!0)},children:"+ Add Section"})]}),(0,p.jsxs)("div",{className:"curriculum-sections",children:[null===(f=E.curriculum)||void 0===f?void 0:f.map((e,t)=>(0,p.jsxs)("div",{className:"curriculum-section",children:[(0,p.jsxs)("div",{className:"section-header",children:[(0,p.jsx)("h4",{children:e.section}),(0,p.jsx)("button",{className:"btn-sm btn-secondary",onClick:()=>((e,t)=>{U({section:e,index:t}),R(!0)})(e,t),children:"\u270f\ufe0f Edit"})]}),e.description&&(0,p.jsx)("p",{className:"section-description",children:e.description}),(0,p.jsxs)("div",{className:"topics-list",children:[(0,p.jsxs)("strong",{children:["Topics (",Array.isArray(e.topics)?e.topics.length:0,"):"]}),(0,p.jsx)("ul",{children:Array.isArray(e.topics)?e.topics.map((e,t)=>(0,p.jsx)("li",{children:"string"===typeof e?e:e.title},t)):null})]})]},t)),(!E.curriculum||0===E.curriculum.length)&&(0,p.jsx)("div",{className:"empty-state",children:(0,p.jsx)("p",{children:'No curriculum sections yet. Click "+ Add Section" to create one.'})})]})]}),"settings"===N&&(0,p.jsxs)("div",{className:"settings-tab",children:[(0,p.jsx)("h3",{children:"Course Settings"}),(0,p.jsxs)("div",{className:"settings-form",children:[(0,p.jsxs)("div",{className:"form-group",children:[(0,p.jsx)("label",{children:"Coming Soon Status"}),(0,p.jsxs)("select",{name:"comingSoon",value:V.comingSoon?"true":"false",onChange:e=>Y({target:{name:"comingSoon",value:"true"===e.target.value,type:"checkbox",checked:"true"===e.target.value}}),children:[(0,p.jsx)("option",{value:"false",children:"Active (Available for enrollment)"}),(0,p.jsx)("option",{value:"true",children:"Coming Soon"})]})]}),(0,p.jsxs)("div",{className:"form-group",children:[(0,p.jsx)("label",{children:"Next Batch Date"}),(0,p.jsx)("input",{type:"date",name:"nextBatchDate",value:V.nextBatchDate||"",onChange:Y})]}),(0,p.jsxs)("div",{className:"form-group",children:[(0,p.jsx)("label",{children:"Category"}),(0,p.jsx)("input",{type:"text",name:"category",value:V.category||"",onChange:Y,placeholder:"e.g., AI, Machine Learning, Web Development"})]}),(0,p.jsx)("button",{className:"btn-primary",onClick:async()=>
2{if(E){q(!0);try{await(0,c.J4)(E.id,V),S(e=>(0,s.A)((0,s.A)({},e),V)),await w(),K("Settings saved successfully!","success")}catch(x){console.error("Error saving settings:",x),K("Failed to save settings. Please try again.","error")}finally{q(!1)}}},disabled:B,children:B?"Saving...":"Save Settings"})]})]})]})]}):(0,p.jsx)("div",{className:"no-selection",children:(0,p.jsxs)("div",{className:"empty-state",children:[(0,p.jsx)("h2",{children:"No Course Selected"}),(0,p.jsx)("p",{children:"Select a course from the sidebar to manage its content"})]})})})]}),_&&E&&(0,p.jsx)(u.A,{course:E,onClose:()=>A(!1),onSave:G}),T&&E&&(0,p.jsx)(d.A,{course:E,batch:L,onClose:()=>{I(!1),M(null)},onSave:G,showNotification:K}),P&&E&&(0,p.jsx)(h.A,{course:E,section:F.section,sectionIndex:F.index,onClose:()=>{R(!1),U({section:null,index:null})},onSave:G,showNotification:K}),D&&E&&L&&(0,p.jsx)(m.A,{course:E,batch:L,onClose:()=>{O(!1),M(null)},onSave:G,showNotification:K})]})};r()}catch(g){r(g)}})},762:(e,t,n)=>{n.d(t,{N6:()=>f,ZD:()=>h,ZU:()=>p,iK:()=>a,uG:()=>m,zQ:()=>g});var r=n(5472),s=n(8426);const a={ADMIN:"admin",INSTRUCTOR:"instructor",STUDENT:"student"},i="view_admin_panel",o="manage_users",l="view_payments",c="manage_courses",u="view_analytics",d={[a.ADMIN]:[i,o,l,c,u],[a.INSTRUCTOR]:[c,u],[a.STUDENT]:[]},h=async function(e,t,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{if(!s.db)throw new Error("Firestore not initialized");if(!Object.values(a).includes(t))throw new Error("Invalid role: ".concat(t));const o={userId:e,userEmail:i,role:t,permissions:d[t]||[],assignedBy:n,assignedAt:(0,r.O5)(),updatedAt:(0,r.O5)(),isActive:!0},l=(0,r.H9)(s.db,"user_roles",e);await(0,r.BN)(l,o);const c=(0,r.H9)(s.db,"users",e);return await(0,r.BN)(c,{role:t,email:i,updatedAt:(0,r.O5)()},{merge:!0}),{success:!0,role:o}}catch(o){return{success:!1,error:o.message}}},m=async e=>{try{if(!s.db)return{role:a.STUDENT,permissions:[],userEmail:null};const t=(0,r.H9)(s.db,"user_roles",e),n=await(0,r.x7)(t);if(n.exists()){return n.data()}return{role:a.STUDENT,permissions:d[a.STUDENT],isActive:!0,userEmail:null}}catch(t){return{role:a.STUDENT,permissions:[],userEmail:null}}},p=async(e,t)=>{try{var n;return(null===(n=(await m(e)).permissions)||void 0===n?void 0:n.includes(t))||!1}catch(r){return!1}},f=async e=>{try{const t=await m(e);return t.role===a.ADMIN&&t.isActive}catch(t){return!1}},g=async function(e,t,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};try{const i={action:e,targetUserId:t,performedBy:n,details:a,timestamp:(0,r.O5)(),ipAddress:null};await(0,r.gS)((0,r.rJ)(s.db,"role_audit_log"),i)}catch(i){}}},886:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>p});var s=n(2555),a=n(5043),i=n(5472),o=n(8426),l=n(5491),c=n(7324),u=n(7096),d=n(342),h=(n(2075),n(579)),m=e([l,u]);[l,u]=m.then?(await m)():m;const p=e=>{let{isOpen:t,onClose:n,onSuccess:r}=e;const{user:m}=(0,d.A)(),[p,f]=(0,a.useState)([]),[g,v]=(0,a.useState)(""),[y,b]=(0,a.useState)([]),[x,w]=(0,a.useState)(null),[N,j]=(0,a.useState)(""),[E,S]=(0,a.useState)(""),[C,k]=(0,a.useState)(""),[_,A]=(0,a.useState)(""),[T,I]=(0,a.useState)(!1),[P,R]=(0,a.useState)(null),[D,O]=(0,a.useState)(!1),[L,M]=(0,a.useState)([]),[F,U]=(0,a.useState)(!1),[V,z]=(0,a.useState)(!1),[B,q]=(0,a.useState)(null),[H,W]=(0,a.useState)([]),[G,K]=(0,a.useState)([]);(0,a.useEffect)(()=>{t&&(Y(),J())},[t]);const J=async()=>{try{const e=await(0,l.BG)();K(e)}catch(P){console.error("Error loading courses:",P),K([])}},Y=async()=>{O(!0);try{const e=(0,i.P)((0,i.rJ)(o.db,"users")),t=(await(0,i.GG)(e)).docs.map(e=>(0,s.A)({id:e.id},e.data()));f(t),b(t)}catch(e){R("Failed to load users")}finally{O(!1)}};(0,a.useEffect)(()=>{if(!g.trim())return void b(p);const e=p.filter(e=>{const t=e.displayName||"",n=e.email||"",r=g.toLowerCase();return t.toLowerCase().includes(r)||n.toLowerCase().includes(r)});b(e)},[g,p]),(0,a.useEffect)(()=>{(async()=>{if(!E)return W([]),q(null),void k("");try{console.log("Loading batch info for course:",E);const e=await(0,l.BZ)(E);if(console.log("Found course:",e),e){const e=await(0,c.getCourseBatches)(E);console.log("Course batches from Firestore:",e),W(e);const t=await(0,l.hJ)(E);if(console.log("Next available batch:",t),q(t),t)k(t.batchNumber.toString());else if(e.length>0){const t=e[e.length-1];k(t.batchNumber.toString())}else k("")}}catch(P){console.error("Error loading batch info:",P),W([]),q(null),k("")}})()},[E]);const Q=e=>
2{w(e),j(e.id),v(e.displayName||e.email),z(!1),(async e=>{U(!0);try{const t=(0,i.P)((0,i.rJ)(o.db,"enrollments")),n=(await(0,i.GG)(t)).docs.map(e=>(0,s.A)({id:e.id},e.data())).filter(t=>t.userId===e||t.uid===e||t.userID===e||t.user_id===e);M(n)}catch(t){console.error("Failed to load user enrollments:",t),M([])}finally{U(!1)}})(e.id)},$=()=>{v(""),w(null),j(""),S(""),k(""),A(""),R(null),M([]),z(!1)},X=()=>{$(),n()},Z=G.find(e=>e.id===E);return t?(0,h.jsx)("div",{className:"modal-overlay",children:(0,h.jsxs)("div",{className:"modal-content manual-enrollment-modal",children:[(0,h.jsxs)("div",{className:"modal-header",children:[(0,h.jsx)("h2",{children:"Manual User Enrollment"}),(0,h.jsx)("button",{className:"modal-close-btn",onClick:X,children:"\xd7"})]}),(0,h.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),N&&E){I(!0),R(null);try{const e=C?parseInt(C):null,t=await(0,u.cV)(N,E,m.uid,e,_);t.success?(null===r||void 0===r||r(t),$(),n()):R(t.error)}catch(t){R(t.message)}finally{I(!1)}}else R("Please select both user and course")},children:[(0,h.jsxs)("div",{className:"modal-body",children:[P&&(0,h.jsx)("div",{className:"error-message",children:P}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{htmlFor:"user-search",children:"Search User *"}),D?(0,h.jsx)("div",{className:"loading-indicator",children:"Loading users..."}):(0,h.jsxs)("div",{className:"user-search-container",children:[(0,h.jsx)("input",{type:"text",id:"user-search",value:g,onChange:e=>{v(e.target.value),z(!0),e.target.value.trim()||(w(null),j(""),M([]))},onFocus:()=>z(!0),placeholder:"Search by name or email...",required:!0}),V&&y.length>0&&(0,h.jsx)("div",{className:"user-dropdown",children:y.slice(0,10).map(e=>(0,h.jsxs)("div",{className:"user-option",onClick:()=>Q(e),children:[(0,h.jsx)("div",{className:"user-name",children:e.displayName||"No Name"}),(0,h.jsx)("div",{className:"user-email",children:e.email})]},e.id))})]}),x&&(0,h.jsxs)("div",{className:"selected-user-info",children:[(0,h.jsx)("p",{children:(0,h.jsx)("strong",{children:"Selected User:"})}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Name:"})," ",x.displayName||"No Name"]}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Email:"})," ",x.email]})]})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{htmlFor:"course-select",children:"Select Course *"}),(0,h.jsxs)("select",{id:"course-select",value:E,onChange:e=>{S(e.target.value),k("")},required:!0,children:[(0,h.jsx)("option",{value:"",children:"-- Select Course --"}),G.map(e=>(0,h.jsx)("option",{value:e.id,children:e.title},e.id))]})]}),Z&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{htmlFor:"batch-select",children:"Select Batch"}),H.length>0?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("select",{id:"batch-select",value:C,onChange:e=>k(e.target.value),children:H.map(e=>(0,h.jsxs)("option",{value:e.batchNumber,children:[(0,l.up)(e)," - ",e.status,B&&e.batchNumber===B.batchNumber&&" (Current)"]},e.batchNumber))}),(0,h.jsx)("small",{className:"field-help",children:B&&C===B.batchNumber.toString()?"This is the current active/upcoming batch":"Select which batch to enroll the user in"})]}):(0,h.jsxs)("div",{className:"loading-message",children:[(0,h.jsxs)("p",{children:["Loading batches for ",Z.title,"..."]}),(0,h.jsx)("small",{children:"If this persists, the course might not have any batches configured."})]})]}),x&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("h4",{children:"Current Enrollments"}),F?(0,h.jsx)("div",{className:"loading-indicator",children:"Loading enrollments..."}):L.length>0?(0,h.jsx)("div",{className:"user-enrollments",children:L.map(e=>{var t,n,r;const s=G.find(t=>t.id===e.courseId);return(0,h.jsxs)("div",{className:"enrollment-item",children:[(0,h.jsx)("div",{className:"enrollment-course",children:(0,h.jsx)("strong",{children:e.courseTitle||(null===s||void 0===s?void 0:s.title)||e.courseId})}),(0,h.jsxs)("div",{className:"enrollment-details",children:[(0,h.jsx)("span",{className:"enrollment-status",children:e.status||"ENROLLED"}),e.batchNumber&&(0,h.jsxs)("span",{className:"enrollment-batch",children:["Batch ",e.batchNumber]}
2),(0,h.jsx)("span",{className:"enrollment-date",children:(null===(t=e.enrolledAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"N/A"})]})]},e.id)})}):(0,h.jsx)("p",{className:"no-enrollments",children:"No previous enrollments found."})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{htmlFor:"notes",children:"Notes (Optional)"}),(0,h.jsx)("textarea",{id:"notes",value:_,onChange:e=>A(e.target.value),placeholder:"Add any notes about this manual enrollment...",rows:3})]}),Z&&(0,h.jsxs)("div",{className:"course-info",children:[(0,h.jsx)("h4",{children:"Course Information"}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Title:"})," ",Z.title]}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Duration:"})," ",Z.duration]}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Level:"})," ",Z.level]}),(0,h.jsx)("div",{className:"batch-selection-summary",children:C?(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Selected Batch:"})," ",(0,l.up)(H.find(e=>e.batchNumber.toString()===C))]}):(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Batch:"})," ",(0,h.jsx)("em",{children:"No batch selected"})]})})]})]}),(0,h.jsxs)("div",{className:"modal-footer",children:[(0,h.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:X,disabled:T,children:"Cancel"}),(0,h.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:T||!N||!E,children:T?"Enrolling...":"Enroll User"})]})]})]})}):null};r()}catch(p){r(p)}})},1105:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>c});var s=n(5043),a=n(628),i=n(8185),o=(n(1387),n(579)),l=e([a]);a=(l.then?(await l)():l)[0];const c=e=>{let{userId:t,courseId:n,originalAmount:r,onCouponApplied:l,onCouponRemoved:c,disabled:u=!1}=e;const d=(0,i.F_)(),[h,m]=(0,s.useState)(""),[p,f]=(0,s.useState)(!1),[g,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(null),[x,w]=(0,s.useState)(!1);if(!d)return null;const N=async()=>{if(h.trim()){f(!0),v("");try{const e=await(0,a.SJ)(h.trim(),t,n,r);e.valid?(b(e),v(""),m(""),l&&l(e)):(v(e.error),b(null))}catch(e){v("Failed to validate coupon code"),b(null)}finally{f(!1)}}else v("Please enter a coupon code")},j=e=>{if("percentage"===e.discountType){var t;let n="".concat(e.discountValue,"% off");return null!==(t=e.couponData)&&void 0!==t&&t.maxDiscountAmount&&e.discountAmount>=e.couponData.maxDiscountAmount&&(n+=" (max $".concat(e.couponData.maxDiscountAmount,")")),n}return"$".concat(e.discountValue," off")};return(0,o.jsx)("div",{className:"coupon-input-container",children:y?(0,o.jsxs)("div",{className:"applied-coupon-section",children:[(0,o.jsxs)("div",{className:"applied-coupon-info",children:[(0,o.jsxs)("div",{className:"coupon-success",children:[(0,o.jsx)("span",{className:"success-icon",children:"\u2705"}),(0,o.jsxs)("div",{className:"coupon-details",children:[(0,o.jsxs)("div",{className:"coupon-code-applied",children:["Code: ",(0,o.jsx)("strong",{children:y.couponCode})]}),(0,o.jsx)("div",{className:"coupon-discount",children:j(y)})]})]}),(0,o.jsx)("button",{onClick:()=>{b(null),v(""),m(""),w(!1),c&&c()},className:"remove-coupon-btn",disabled:u,title:"Remove coupon",children:"\u2715"})]}),(0,o.jsxs)("div",{className:"price-breakdown",children:[(0,o.jsxs)("div",{className:"price-row",children:[(0,o.jsx)("span",{children:"Original Price:"}),(0,o.jsxs)("span",{children:["$",y.originalAmount.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"price-row discount-row",children:[(0,o.jsxs)("span",{children:["Discount (",j(y),"):"]}),(0,o.jsxs)("span",{children:["-$",y.discountAmount.toFixed(2)]})]}),(0,o.jsxs)("div",{className:"price-row total-row",children:[(0,o.jsx)("span",{children:(0,o.jsx)("strong",{children:"Final Price:"})}),(0,o.jsx)("span",{children:(0,o.jsxs)("strong",{children:["$",y.finalAmount.toFixed(2)]})})]}),y.savings>0&&(0,o.jsxs)("div",{className:"savings-badge",children:["You save $",y.savings.toFixed(2),"!"]})]})]}):(0,o.jsx)(o.Fragment,{children:x?(0,o.jsxs)("div",{className:"coupon-input-section",children:[(0,o.jsxs)("div",{className:"coupon-input-header",children:[(0,o.jsx)("h4",{children:"Enter your coupon code"}),(0,o.jsx)("button",{type:"button",className:"coupon-close-btn",onClick:()=>w(!1),disabled:u||p,children:"\u2715"})]}),(0,o.jsxs)("div",{className:"coupon-input-group",children:[(0,o.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value.toUpperCase()),onKeyPress:e=>{"Enter"===e.key&&N()},placeholder:"Enter coupon code",className:"coupon-input",disabled:u||p,maxLength:20}),(0,o.jsx)("button",{onClick:N,disabled:u||p||!h.trim(),className:"apply-coupon-btn",children:p?"Applying...":"Apply"})]}),g&&(0,o.jsx)("div",{className:"coupon-error",children:g})]}):(0,o.jsx)("div",{className:"coupon-toggle-section",children:(0,o.jsx)("button",{type:"button",className:"coupon-toggle-btn",onClick:()=>w(!0),disabled:u,children:"Have a coupon code?"})})})})};r()}catch(c){r(c)}})},1176:(e,t,n)=>{n.d(t,{A:()=>s});n(5043),n(7106);var r=n(579);const s=e=>{let{isOpen:t,onClose:n,paymentData:s,onGoToDashboard:a,enrollmentResult:i}=e;if(!t)return null;return(0,r.jsx)("div",{className:"modal-overlay",onClick:e=>{e.target===e.currentTarget&&n()},children:(0,r.jsxs)("div",{className:"payment-success-modal",children:[(0,r.jsxs)("div",{className:"success-header",children:[(0,r.jsx)("div",{className:"success-icon",children:null!==s&&void 0!==s&&s.manualSubmission||null!==i&&void 0!==i&&i.pendingManual?"\u23f3":"\u2705"}),(0,r.jsx)("h2",{children:null!==s&&void 0!==s&&s.manualSubmission||null!==i&&void 0!==i&&i.pendingManual?"Submission Received":"Payment Successful!"}),(0,r.jsx)("p",{children:null!==s&&void 0!==s&&s.manualSubmission||null!==i&&void 0!==i&&i.pendingManual?"Your payment will be reviewed by an admin shortly.":"Welcome to your new course"})]}),(0,r.jsxs)("div",{className:"payment-details",children:[(0,r.jsx)("h3",{children:"Payment Details"}),(0,r.jsxs)("div",{className:"detail-grid",children:[(0,r.jsxs)("div",{className:"detail-item",children:[(0,r.jsx)("span",{className:"label",children:"Course:"}),(0,r.jsx)("span",{className:"value",children:null===s||void 0===s?void 0:s.courseTitle})]}),(0,r.jsxs)("div",{className:"detail-item",children:[(0,r.jsx)("span",{className:"label",children:"Amount Paid:"}),(0,r.jsxs)("span",{className:"value",children:["$",null===s||void 0===s?void 0:s.amount]})]}),(0,r.jsxs)("div",{className:"detail-item",children:[(0,r.jsx)("span",{className:"label",children:"Transaction ID:"}),(0,r.jsx)("span",{className:"value",children:null===s||void 0===s?void 0:s.paymentID})]}),(0,r.jsxs)("div",{className:"detail-item",children:[(0,r.jsx)("span",{className:"label",children:"Order ID:"}),(0,r.jsx)("span",{className:"value",children:null===s||void 0===s?void 0:s.orderID})]}),(0,r.jsxs)("div",{className:"detail-item",children:[(0,r.jsx)("span",{className:"label",children:"Date:"}),(0,r.jsx)("span",{className:"value",children:new Date(null===s||void 0===s?void 0:s.timestamp).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})})]})]})]}),(0,r.jsxs)("div",{className:"next-steps",children:[(0,r.jsx)("h3",{children:"What's Next?"}),(0,r.jsx)("ul",{children:null!==s&&void 0!==s&&s.manualSubmission||null!==i&&void 0!==i&&i.pendingManual?
2(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("li",{children:"\ud83d\udce7 We'll notify you by email after an admin verifies your transaction."}),(0,r.jsx)("li",{children:"\ufffd Your access will be granted once verification is complete."})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("li",{children:["\ufffd\ud83d\udce7 A confirmation email has been sent to ",null===s||void 0===s?void 0:s.payerEmail,!1===(null===i||void 0===i?void 0:i.emailSent)&&(0,r.jsx)("span",{style:{color:"#f57c00",marginLeft:"8px"},children:"(Email service unavailable)"})]}),(0,r.jsx)("li",{children:"\ud83d\udcda You now have access to all course materials"}),(0,r.jsx)("li",{children:"\ud83c\udfaf You can start learning immediately"}),(0,r.jsx)("li",{children:"\ud83d\udcac Join our course community for support"})]})})]}),(0,r.jsx)("div",{className:"modal-actions",children:(0,r.jsx)("button",{className:"btn",onClick:a,children:"\ud83d\ude80 Go to Dashboard"})}),(0,r.jsx)("button",{className:"close-modal",onClick:n,"aria-label":"Close modal",children:"\xd7"})]})})}},1209:()=>{},1291:(e,t,n)=>{n.d(t,{Ry:()=>r});const r=e=>{if(!e)return{display:"Unknown",tooltip:"Unknown"};const t=(e=>{if(!e)return"Unknown";const t=new Date-e,n=Math.floor(t/1e3),r=Math.floor(n/60),s=Math.floor(r/60),a=Math.floor(s/24),i=Math.floor(a/7),o=Math.floor(a/30),l=Math.floor(a/365);return n<60?n<=1?"Just now":"".concat(n," seconds ago"):r<60?1===r?"1 minute ago":"".concat(r," minutes ago"):s<24?1===s?"1 hour ago":"".concat(s," hours ago"):a<7?1===a?"1 day ago":"".concat(a," days ago"):i<4?1===i?"1 week ago":"".concat(i," weeks ago"):o<12?1===o?"1 month ago":"".concat(o," months ago"):1===l?"1 year ago":"".concat(l," years ago")})(e);return{display:t,tooltip:e.toLocaleString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}}},1387:()=>{},1422:(e,t,n)=>{n.d(t,{A:()=>i});n(5043);var r=n(4366),s=n(342),a=n(579);const i=e=>{let{children:t,requiredRole:n=null}=e;const{user:i,loading:o}=(0,s.A)(),l=(0,r.zy)();if(o)return(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"calc(100vh - 80px)",color:"var(--text-color)"},children:(0,a.jsx)("div",{children:"Loading..."})});if(!i)return(0,a.jsx)(r.C5,{to:"/login",state:{from:l},replace:!0});if(n)if("admin"===i.role);else{if("instructor"===n&&"instructor"!==i.role)return(0,a.jsx)(r.C5,{to:"/dashboard",replace:!0});if("admin"===n&&"admin"!==i.role)return(0,a.jsx)(r.C5,{to:"/dashboard",replace:!0});if("instructor"!==n&&"admin"!==n&&i.role!==n)return(0,a.jsx)(r.C5,{to:"/dashboard",replace:!0})}return t}},1487:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>m});var s=n(2555),a=n(5043),i=n(5472),o=n(8426),l=n(5491),c=n(8185),u=n(886),d=n(579),h=e([l,u]);[l,u]=h.then?(await h)():h;const m=()=>{var e,t,n;const[r,h]=(0,a.useState)([]),[m,p]=(0,a.useState)({}),[f,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(null),[b,x]=(0,a.useState)("all"),[w,N]=(0,a.useState)("all"),[j,E]=(0,a.useState)(!1),[S,C]=(0,a.useState)(null),[k,_]=(0,a.useState)(!1),A=(0,c.Qz)(),T=async()=>{g(!0),y(null);try{const e=(0,i.P)((0,i.rJ)(o.db,"enrollments"),(0,i.My)("enrolledAt","desc")),t=(await(0,i.GG)(e)).docs.map(e=>(0,s.A)({id:e.id},e.data())),n=[...new Set(t.map(e=>e.userId))],r={};if(n.length>0){(await(0,i.GG)((0,i.rJ)(o.db,"users"))).docs.forEach(e=>{const t=e.data();n.includes(e.id)&&(r[e.id]={name:t.name||t.displayName||"Unknown User",email:t.email||"No email"})})}h(t),p(r)}catch(e){y(e.message)}finally{g(!1)}};(0,a.useEffect)(()=>{T()},[]);const I=r.filter(e=>{var t;const n="all"===b||(null===(t=e.batchNumber)||void 0===t?void 0:t.toString())===b,r="all"===w||e.courseId===w;return n&&r}),P=[...new Set(r.map(e=>e.courseId))].filter(Boolean),R=[...new Set(r.map(e=>e.batchNumber))].filter(Boolean).sort((e,t)=>e-t),D={};return I.forEach(e=>{const t="".concat(e.courseId,"_batch").concat(e.batchNumber||"legacy");if(!D[t]){let n=e.batchNumber||"Legacy";if(e.batchNumber){const t=(0,l.BZ)(e.courseId);if(t){const r=(0,l.N_)(t,e.batchNumber);n=r?(0,l.kU)(r):"Batch ".concat(e.batchNumber)}}D[t]={courseId:e.courseId,courseTitle:e.courseTitle,batchNumber:e.batchNumber||"Legacy",batchDisplayName:n,count:0,totalRevenue:0}}D[t].count++,D[t].totalRevenue+=e.amountPaid||0}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"admin-section-header",children:[(0,d.jsxs)("h2",{children:["Course Enrollments (",I.length,")"]}),(0,d.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,d.jsx)("button",{onClick:()=>E(!0),className:"admin-add-button",style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"white",border:"none",padding:"8px 16px",borderRadius:"6px",cursor:"pointer",fontSize:"14px",fontWeight:"600"},children:"\u2795 Manual Enroll"}),(0,d.jsx)("button",{onClick:T,className:"admin-refresh-button",disabled:f,children:f?"Loading...":"\ud83d\udd04 Refresh"})]})]}),v&&(0,d.jsxs)("p",{className:"admin-error",children:["Error: ",v]}),!f&&(0,d.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"15p
2x",margin:"20px 0",padding:"15px",background:"rgba(29, 126, 153, 0.05)",border:"1px solid rgba(29, 126, 153, 0.2)",borderRadius:"8px"},children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"var(--text-color)"},children:I.length}),(0,d.jsx)("div",{style:{fontSize:"12px",color:"var(--secondary-text-color)"},children:"Total Enrollments"})]}),(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"var(--text-color)"},children:["$",I.reduce((e,t)=>e+(t.amountPaid||0),0)]}),(0,d.jsx)("div",{style:{fontSize:"12px",color:"var(--secondary-text-color)"},children:"Total Revenue"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"var(--text-color)"},children:new Set(I.map(e=>e.userId)).size}),(0,d.jsx)("div",{style:{fontSize:"12px",color:"var(--secondary-text-color)"},children:"Unique Users"})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontSize:"24px",fontWeight:"bold",color:"var(--text-color)"},children:I.filter(e=>"paypal"===e.paymentMethod).length}),(0,d.jsx)("div",{style:{fontSize:"12px",color:"var(--secondary-text-color)"},children:"PayPal Payments"})]})]}),(0,d.jsx)("div",{className:"admin-filters",children:(0,d.jsxs)("div",{style:{display:"flex",gap:"15px",flexWrap:"wrap"},children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"course-filter",children:"Filter by Course:"}),(0,d.jsxs)("select",{id:"course-filter",value:w,onChange:e=>N(e.target.value),children:[(0,d.jsx)("option",{value:"all",children:"All Courses"}),P.map(e=>(0,d.jsx)("option",{value:e,children:e},e))]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("label",{htmlFor:"batch-filter",children:"Filter by Batch:"}),(0,d.jsxs)("select",{id:"batch-filter",value:b,onChange:e=>x(e.target.value),children:[(0,d.jsx)("option",{value:"all",children:"All Batches"}),R.map(e=>(0,d.jsxs)("option",{value:e.toString(),children:["Batch ",e]},e))]})]})]})}),Object.keys(D).length>0&&(0,d.jsxs)("div",{className:"batch-summary",style:{marginBottom:"30px"},children:[(0,d.jsx)("h3",{children:"Batch Summary"}),(0,d.jsx)("div",{className:"admin-table-container",children:(0,d.jsxs)("table",{className:"admin-table",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:"Course"}),(0,d.jsx)("th",{children:"Batch"}),(0,d.jsx)("th",{children:"Enrollments"}),(0,d.jsx)("th",{children:"Total Revenue"})]})}),(0,d.jsx)("tbody",{children:Object.values(D).map((e,t)=>(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:e.courseTitle||e.courseId}),(0,d.jsx)("td",{children:(0,d.jsx)("span",{className:"batch-badge batch-".concat(e.batchNumber),title:"Batch ".concat(e.batchNumber),children:e.batchDisplayName})}),(0,d.jsx)("td",{children:e.count}),(0,d.jsxs)("td",{children:["$",e.totalRevenue.toFixed(2)]})]},t))})]})})]}),(0,d.jsx)("h3",{children:"Detailed Enrollments"}),(0,d.jsx)("div",{className:"admin-table-container",children:(0,d.jsxs)("table",{className:"admin-table",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:"Enrolled Date"}),(0,d.jsx)("th",{children:"Course"}),(0,d.jsx)("th",{children:"Batch"}),(0,d.jsx)("th",{children:"User"}),A&&(0,d.jsx)("th",{children:"Progress"}),(0,d.jsx)("th",{children:"Status"}),(0,d.jsx)("th",{children:"Amount Paid"}),(0,d.jsx)("th",{children:"Payment Method"}),(0,d.jsx)("th",{children:"Notes"}),(0,d.jsx)("th",{children:"Enrollment ID"}),(0,d.jsx)("th",{children:"Actions"})]})}),(0,d.jsx)("tbody",{children:I.map(e=>{var t,n,r,s,a,i,o,c;return(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontWeight:"600",color:"var(--text-color)"},children:(null===(t=e.enrolledAt)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"N/A"}),(0,d.jsx)("div",{style:{fontSize:"11px",color:"var(--secondary-text-color)"},children:(null===(s=e.enrolledAt)||void 0===s||null===(a=s.toDate)||void 0===a||null===(i=a.call(s))||void 0===i?void 0:i.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}))||""})]})}),(0,d.jsx)("td",{children:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontWeight:"600",color:"var(--text-color)",marginBottom:"2px"},children:e.courseTitle}),(0,d.jsxs)("div",{style:{fontSize:"11px",color:"var(--secondary-text-color)"},children:["ID: ",e.courseId]}),e.couponCode&&(0,d.jsxs)("div",{style:{fontSize:"10px",color:"#10b981",background:"rgba(16, 185, 129, 0.1)",padding:"1px 4px",borderRadius:"3px",marginTop:"2px",display:"inline-block"},children:["Coupon: ",e.couponCode]})]})}),(0,d.jsx)("td",{children:(0,d.jsx)("span",{className:"batch-badge batch-".concat(e.batchNumber||"legacy"),children:(()=>
2{if(!e.batchNumber)return"Legacy";const t=(0,l.BZ)(e.courseId);if(t){const n=(0,l.N_)(t,e.batchNumber);if(n)return(0,l.kU)(n)}return"Batch ".concat(e.batchNumber)})()})}),(0,d.jsx)("td",{className:"user-info",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{style:{fontWeight:"600",color:"var(--text-color)"},children:(null===(o=m[e.userId])||void 0===o?void 0:o.name)||"Unknown User"}),(0,d.jsx)("div",{style:{fontSize:"12px",color:"var(--secondary-text-color)"},children:(null===(c=m[e.userId])||void 0===c?void 0:c.email)||e.userId})]})}),A&&(0,d.jsx)("td",{children:(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,d.jsx)("div",{style:{width:"60px",height:"8px",backgroundColor:"rgba(29, 126, 153, 0.2)",borderRadius:"4px",overflow:"hidden"},children:(0,d.jsx)("div",{style:{width:"".concat(e.progress||0,"%"),height:"100%",backgroundColor:e.progress>=100?"#4caf50":e.progress>=50?"#ff9800":"#2196f3",transition:"width 0.3s ease"}})}),(0,d.jsxs)("span",{children:[e.progress||0,"%"]})]})}),(0,d.jsx)("td",{children:(0,d.jsx)("span",{className:"status-".concat(e.status),children:e.status})}),(0,d.jsxs)("td",{children:["$",e.amountPaid||0]}),(0,d.jsx)("td",{children:(0,d.jsx)("span",{style:{fontSize:"12px",color:"var(--secondary-text-color)",textTransform:"capitalize"},children:e.paymentMethod||"Manual"})}),(0,d.jsx)("td",{children:(0,d.jsx)("div",{style:{fontSize:"11px",color:"var(--secondary-text-color)",maxWidth:"150px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},title:e.notes,children:e.notes||e.adminNotes||"-"})}),(0,d.jsx)("td",{children:(0,d.jsx)("span",{style:{fontSize:"11px",fontFamily:"monospace",color:"var(--secondary-text-color)",background:"rgba(29, 126, 153, 0.1)",padding:"2px 6px",borderRadius:"4px"},children:e.id})}),(0,d.jsx)("td",{children:(0,d.jsx)("button",{onClick:()=>(e=>{C(e),_(!0)})(e),style:{background:"rgba(220, 38, 38, 0.2)",border:"1px solid rgba(220, 38, 38, 0.3)",color:"#dc2626",padding:"4px 8px",borderRadius:"4px",fontSize:"12px",cursor:"pointer",transition:"all 0.2s ease"},onMouseEnter:e=>{e.target.style.background="rgba(220, 38, 38, 0.3)"},onMouseLeave:e=>{e.target.style.background="rgba(220, 38, 38, 0.2)"},disabled:f,children:"Delete"})})]},e.id)})})]})}),0===I.length&&!f&&(0,d.jsx)("div",{className:"admin-empty-state",children:(0,d.jsx)("p",{children:"No enrollment records found for the selected filters."})}),(0,d.jsx)("style",{jsx:!0,children:"\n                .batch-badge {\n                    display: inline-block;\n                    padding: 4px 8px;\n                    border-radius: 12px;\n                    font-size: 12px;\n                    font-weight: bold;\n                    text-align: center;\n                    min-width: 60px;\n                }\n\n                .batch-1 {\n                    background-color: rgba(59, 130, 246, 0.2);\n                    color: #60a5fa;\n                    border: 1px solid rgba(59, 130, 246, 0.3);\n                }\n\n                .batch-2 {\n                    background-color: rgba(168, 85, 247, 0.2);\n                    color: #c084fc;\n                    border: 1px solid rgba(168, 85, 247, 0.3);\n                }\n\n                .batch-3 {\n                    background-color: rgba(34, 197, 94, 0.2);\n                    color: #4ade80;\n                    border: 1px solid rgba(34, 197, 94, 0.3);\n                }\n\n                .batch-legacy {\n                    background-color: rgba(107, 114, 128, 0.2);\n                    color: var(--secondary-text-color);\n                    border: 1px solid rgba(107, 114, 128, 0.3);\n                }\n\n                .admin-filters {\n                    border: 1px solid rgba(29, 126, 153, 0.2);\n                }\n\n                .batch-summary {\n                    border-top: 2px solid var(--primary-color);\n                    padding-top: 20px;\n                }\n\n                .batch-summary h3 {\n                    margin-bottom: 15px;\n                    color: #333;\n                }\n\n                /* Responsive table styles */\n                @media (max-width: 1200px) {\n                    .admin-table-container {\n                        overflow-x: auto;\n                    }\n                    \n                    .admin-table th:nth-child(8),\n                    .admin-table td:nth-child(8) {\n                        display: none; /* Hide Payment Method on smaller screens */\n                    }\n                }\n\n                @media (max-width: 968px) {\n                    .admin-table th:nth-child(9),\n                    .admin-table td:nth-child(9) {\n                        display: none; /* Hide Notes on smaller screens */\n                    }\n                    \n                    .admin-table th:nth-child(10),\n                    .admin-table td:nth-child(10) {\n                        display: none; /* Hide Enrollment ID on smaller screens */\n                    }\n                }\n\n                @media (max-width: 768px) {\n                    .admin-table {\n                        font-size: 12px;\n                    }\n                    \n                    .admin-table th,\n                    .admin-table td {\n                        padding: 6px;\n                    }\n                }\n            "}),(0,d.jsx)(u.A,{isOpen:j,onClose:()=>E(!1),onSuccess:e=>{T()}}),k&&S&&(0,d.jsx)("div",{className:"modal-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e3,backdropFilter:"blur(4px)"},children:(0,d.jsxs)("div",{style:{background:"var(--background-color)",border:"1px solid rgba(220, 38, 38, 0.3)",borderRadius:"12px",width:"90%",maxWidth:"500px",boxShadow:"0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(220, 38, 38, 0.2)"},children:[(0,d.jsx)("div",{style:{padding:"20px 25px",borderBottom:"1px solid rgba(220, 38, 38, 0.3)",background:"linear-gradient(135deg, rgba(220, 38, 38, 0.8), rgba(185, 28, 28, 0.8))",color:"white",borderRadius:"12px 12px 0 0"},children:(0,d.jsx)("h2",{style:{margin:0,fontSize:"18px",fontWeight:"600"},children:"Confirm Delete Enrollment"})}),(0,d.jsxs)("div",{style:{padding:"25px"},children:[(0,d.jsx)("p",{style:{margin:"0 0 20px 0",color:"var(--text-color)"},children:"Are you sure you want to delete this enrollment?"}),(0,d.jsxs)("div",{style:{background:"rgba(220, 38, 38, 0.1)",border:"1px solid rgba(220, 38, 38, 0.2)",borderRadius:"8px",padding:"15px",marginBottom:"20px"},children:[(0,d.jsxs)("p",{style:{margin:"0 0 8px 0",fontWeight:"600",color:"var(--text-color)"},children:[(0,d.jsx)("strong",{children:"User:"})," ",(null===(e=m[S.userId])||void 0===e?void 0:e.name)||"Unknown User"]}
2),(0,d.jsxs)("p",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"var(--secondary-text-color)"},children:[(0,d.jsx)("strong",{children:"Email:"})," ",(null===(t=m[S.userId])||void 0===t?void 0:t.email)||S.userId]}),(0,d.jsxs)("p",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"var(--secondary-text-color)"},children:[(0,d.jsx)("strong",{children:"Course:"})," ",S.courseTitle||(null===(n=(0,l.BZ)(S.courseId))||void 0===n?void 0:n.title)]}),(0,d.jsxs)("p",{style:{margin:"0 0 8px 0",fontSize:"14px",color:"var(--secondary-text-color)"},children:[(0,d.jsx)("strong",{children:"Batch:"})," ",(()=>{if(!S.batchNumber)return"Legacy";const e=(0,l.BZ)(S.courseId);if(e){const t=(0,l.N_)(e,S.batchNumber);if(t)return(0,l.kU)(t)}return"Batch ".concat(S.batchNumber)})()]}),(0,d.jsxs)("p",{style:{margin:"0",fontSize:"14px",color:"var(--secondary-text-color)"},children:[(0,d.jsx)("strong",{children:"Amount Paid:"})," $",S.amountPaid||0]})]}),(0,d.jsx)("p",{style:{margin:"0 0 20px 0",color:"#dc2626",fontSize:"14px",fontWeight:"500"},children:"\u26a0\ufe0f This action cannot be undone."}),(0,d.jsxs)("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[(0,d.jsx)("button",{onClick:()=>{_(!1),C(null)},disabled:f,style:{padding:"10px 20px",border:"1px solid rgba(29, 126, 153, 0.3)",background:"transparent",color:"var(--text-color)",borderRadius:"6px",cursor:"pointer",fontSize:"14px"},children:"Cancel"}),(0,d.jsx)("button",{onClick:async()=>{if(S)try{g(!0),await(0,i.kd)((0,i.H9)(o.db,"enrollments",S.id)),h(e=>e.filter(e=>e.id!==S.id)),_(!1),C(null)}catch(e){y("Failed to delete enrollment: "+e.message)}finally{g(!1)}},disabled:f,style:{padding:"10px 20px",border:"1px solid #dc2626",background:"#dc2626",color:"white",borderRadius:"6px",cursor:f?"not-allowed":"pointer",fontSize:"14px",opacity:f?.7:1},children:f?"Deleting...":"Delete Enrollment"})]})]})]})})]})};r()}catch(m){r(m)}})},1529:(e,t,n)=>{n.d(t,{cY:()=>p,FA:()=>R,g:()=>P,u:()=>o,Uj:()=>i,Fy:()=>v,tD:()=>z,bD:()=>L,hp:()=>V,T9:()=>h,Tj:()=>u,yU:()=>d,XA:()=>m,mS:()=>l,Ku:()=>H,ZQ:()=>w,sr:()=>S,zJ:()=>f,c1:()=>E,Im:()=>O,lT:()=>k,zW:()=>T,jZ:()=>N,lV:()=>C,nr:()=>_,Ov:()=>A,gE:()=>g,Am:()=>F,I9:()=>U,P1:()=>x,eX:()=>I});const r=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=63&s|128):55296===(64512&s)&&r+1<e.length&&56320===(64512&e.charCodeAt(r+1))?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++r)),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=63&s|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=63&s|128)}return t},s={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"===typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const t=e[s],a=s+1<e.length,i=a?e[s+1]:0,o=s+2<e.length,l=o?e[s+2]:0,c=t>>2,u=(3&t)<<4|i>>4;let d=(15&i)<<2|l>>6,h=63&l;o||(h=64,a||(d=64)),r.push(n[c],n[u],n[d],n[h])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(r(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const a=e[n++];t[r++]=String.fromCharCode((31&s)<<6|63&a)}else if(s>239&&s<365){const a=((7&s)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(a>>10)),t[r++]=String.fromCharCode(56320+(1023&a))}else{const a=e[n++],i=e[n++];t[r++]=String.fromCharCode((15&s)<<12|(63&a)<<6|63&i)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const t=n[e.charAt(s++)],i=s<e.length?n[e.charAt(s)]:0;++s;const o=s<e.length?n[e.charAt(s)]:64;++s;const l=s<e.length?n[e.charAt(s)]:64;if(++s,null==t||null==i||null==o||null==l)throw new a;const c=t<<2|i>>4;if(r.push(c),64!==o){const e=i<<4&240|o>>2;if(r.push(e),64!==l){const e=o<<6&192|l;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};
2class a extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const i=function(e){return function(e){const t=r(e);return s.encodeByteArray(t,!0)}(e).replace(/\./g,"")},o=function(e){try{return s.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function l(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof n.g)return n.g;throw new Error("Unable to locate global object.")}const c=()=>{try{return l().__FIREBASE_DEFAULTS__||(()=>{if("undefined"===typeof process)return;const e={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMPANY_EMAIL:"[email protected]",REACT_APP_COMPANY_NAME:"TuneParams AI Learning Platform",REACT_APP_COMPANY_PHONE:"+1 (469) 702-1086",REACT_APP_EMAILJS_PUBLIC_KEY:"g2ZIKXu5CMAtlW-yr",REACT_APP_EMAILJS_SERVICE_ID:"service_6nnlhkw",REACT_APP_EMAILJS_TEMPLATE_ID:"template_660cmfs",REACT_APP_ENABLE_COUPONS:"true",REACT_APP_ENABLE_PAYPAL:"false",REACT_APP_FIREBASE_API_KEY:"AIzaSyCn55V2y3cXp4Ln0NWjlauU8rgZgMgwDyc",REACT_APP_FIREBASE_APP_ID:"1:995918337622:web:505babbabe198e3f0d0df7",REACT_APP_FIREBASE_AUTH_DOMAIN:"tuneparams.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"995918337622",REACT_APP_FIREBASE_PROJECT_ID:"tuneparams",REACT_APP_FIREBASE_STORAGE_BUCKET:"tuneparams.firebasestorage.app",REACT_APP_FORMSPREE_FORM_ID:"xkgbylng",REACT_APP_FROM_EMAIL:"[email protected]",REACT_APP_GITHUB_URL:"https://github.com/TuneParams-ai",REACT_APP_HERO_IMAGE_URL:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=500&h=400&fit=crop&auto=format",REACT_APP_LINKEDIN_URL:"https://www.linkedin.com/in/tuneparams/",REACT_APP_PAYPAL_CLIENT_ID:"Acpw6Y9AC_WmjeowDefzez5UraQz8Is2eli9_B1EiyTmkiilTremv-JSsTzcT65epfBO3BHiBmn7X-OF",REACT_APP_PAYPAL_ENVIRONMENT:"live",REACT_APP_SUPPORT_EMAIL:"[email protected]",REACT_APP_TWITTER_URL:"https://twitter.com/tuneparams",REACT_APP_WEBSITE_URL:"https://www.tuneparams.ai"}.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"===typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}const t=e&&o(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info("Unable to get __FIREBASE_DEFAULTS__ due to: ".concat(e))}},u=e=>{var t,n;return null===(n=null===(t=c())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]},d=e=>{const t=u(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error("Invalid host ".concat(t," with no separate hostname and port!"));const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},h=()=>{var e;return null===(e=c())||void 0===e?void 0:e.config},m=e=>{var t;return null===(t=c())||void 0===t?void 0:t["_".concat(e)]};class p{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"===typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function f(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch(t){return!1}}async function g(e){return(await fetch(e,{credentials:"include"})).ok}function v(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,s=e.sub||e.user_id;if(!s)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const a=Object.assign({iss:"https://securetoken.google.com/".concat(n),aud:n,iat:r,exp:r+3600,auth_time:r,sub:s,user_id:s,firebase:{sign_in_provider:"custom",identities:{}}},e);return[i(JSON.stringify({alg:"none",type:"JWT"})),i(JSON.stringify(a)),""].join(".")}const y={};let b=!1;function x(e,t){if("undefined"===typeof window||"undefined"===typeof document||!f(window.location.host)||y[e]===t||y[e]||b)return;function n(e){return"__firebase__banner__".concat(e)}y[e]=t;const r="__firebase__banner",s=function(){const e={prod:[],emulator:[]};for(const t of Object.keys(y))y[t]?e.emulator.push(t):e.prod.push(t);return e}().prod.length>0;function a(){const e=document.createElement("span");
2return e.style.cursor="pointer",e.style.marginLeft="16px",e.style.fontSize="24px",e.innerHTML=" &times;",e.onclick=()=>{b=!0,function(){const e=document.getElementById(r);e&&e.remove()}()},e}function i(){const e=function(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}(r),t=n("text"),i=document.getElementById(t)||document.createElement("span"),o=n("learnmore"),l=document.getElementById(o)||document.createElement("a"),c=n("preprendIcon"),u=document.getElementById(c)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(e.created){const t=e.element;!function(e){e.style.display="flex",e.style.background="#7faaf0",e.style.position="fixed",e.style.bottom="5px",e.style.left="5px",e.style.padding=".5em",e.style.borderRadius="5px",e.style.alignItems="center"}(t),function(e,t){e.setAttribute("id",t),e.innerText="Learn more",e.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",e.setAttribute("target","__blank"),e.style.paddingLeft="5px",e.style.textDecoration="underline"}(l,o);const n=a();!function(e,t){e.setAttribute("width","24"),e.setAttribute("id",t),e.setAttribute("height","24"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.style.marginLeft="-6px"}(u,c),t.append(u,i,l,n),document.body.appendChild(t)}s?(i.innerText="Preview backend disconnected.",u.innerHTML='<g clip-path="url(#clip0_6013_33858)">\n<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>\n</g>\n<defs>\n<clipPath id="clip0_6013_33858">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>'):(u.innerHTML='<g clip-path="url(#clip0_6083_34804)">\n<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>\n</g>\n<defs>\n<clipPath id="clip0_6083_34804">\n<rect width="24" height="24" fill="white"/>\n</clipPath>\n</defs>',i.innerText="Preview backend running in this workspace."),i.setAttribute("id",t)}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",i):i()}function w(){return"undefined"!==typeof navigator&&"string"===typeof navigator.userAgent?navigator.userAgent:""}function N(){return"undefined"!==typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(w())}function j(){var e;const t=null===(e=c())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;
2if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(r){return!1}}function E(){return"undefined"!==typeof navigator&&"Cloudflare-Workers"===navigator.userAgent}function S(){const e="object"===typeof chrome?chrome.runtime:"object"===typeof browser?browser.runtime:void 0;return"object"===typeof e&&void 0!==e.id}function C(){return"object"===typeof navigator&&"ReactNative"===navigator.product}function k(){const e=w();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function _(){return!j()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function A(){return!j()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function T(){try{return"object"===typeof indexedDB}catch(e){return!1}}function I(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var e;t((null===(e=s.error)||void 0===e?void 0:e.message)||"")}}catch(n){t(n)}})}class P extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,P.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,R.prototype.create)}}class R{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e){const t=(arguments.length<=1?void 0:arguments[1])||{},n="".concat(this.service,"/").concat(e),r=this.errors[e],s=r?function(e,t){return e.replace(D,(e,n)=>{const r=t[n];return null!=r?String(r):"<".concat(n,"?>")})}(r,t):"Error",a="".concat(this.serviceName,": ").concat(s," (").concat(n,").");return new P(n,a,t)}}const D=/\{\$([^}]+)}/g;function O(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function L(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const n=e[s],a=t[s];if(M(n)&&M(a)){if(!L(n,a))return!1}else if(n!==a)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function M(e){return null!==e&&"object"===typeof e}function F(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function U(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");
2t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function V(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function z(e,t){const n=new B(e,t);return n.subscribe.bind(n)}class B{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e,t){if("object"!==typeof e||null===e)return!1;for(const n of t)if(n in e&&"function"===typeof e[n])return!0;return!1}(e,["next","error","complete"])?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=q),void 0===r.error&&(r.error=q),void 0===r.complete&&(r.complete=q);const s=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),s}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(n){"undefined"!==typeof console&&console.error&&console.error(n)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function q(){}function H(e){return e&&e._delegate?e._delegate:e}},1641:()=>{},1756:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>c});n(5043);var s=n(4366),a=n(342),i=(n(1641),n(7943)),o=n(579),l=e([i]);i=(l.then?(await l)():l)[0];const c=()=>{const e=(0,s.Zp)(),{user:t}=(0,a.A)(),n=()=>{e("/register")},r=()=>{e("/dashboard")};return(0,o.jsxs)("div",{className:"landing-page-container",children:[(0,o.jsx)("section",{className:"hero-section",children:(0,o.jsxs)("div",{className:"hero-content",children:[(0,o.jsxs)("div",{className:"hero-text",children:[(0,o.jsx)("h1",{className:"hero-title",children:"Master the World of AI"}),(0,o.jsx)("p",{className:"hero-subtitle",children:"No prior experience? No problem. Learn from the foundations of AI and build real-world applications in this beginner-friendly course."}),(0,o.jsx)("p",{className:"hero-description",children:"Start your journey in AI with a hands-on course designed for beginners - from high-school students to experienced professionals and curious learners of all backgrounds."}),(0,o.jsxs)("div",{className:"hero-buttons",children:[(0,o.jsx)("button",{className:"cta-primary",onClick:()=>{e("/courses")},children:"Browse Courses"}),t?(0,o.jsx)("button",{className:"cta-secondary",onClick:r,children:"Go to Dashboard"}):(0,o.jsx)("button",{className:"cta-secondary",onClick:n,children:"Register Now"})]})]}),(0,o.jsx)("div",{className:"hero-image",children:(0,o.jsx)("img",{src:"/logo1024.png",alt:"TuneParams.ai Logo"})})]})}),(0,o.jsx)("section",{className:"merged-info-section",children:(0,o.jsxs)("div",{className:"merged-info-container",children:[(0,o.jsxs)("div",{className:"about-content-merged",children:[(0,o.jsx)("h2",{children:"Why TuneParams.ai?"}),(0,o.jsx)("p",{children:"At TuneParams.ai, we believe that anyone can become master of Artificial Intelligence with the right guidance. Our Courses simplifies complex topics and helps you build an intuitive and practical understanding of core AI concepts, with no math background required."})]}),(0,o.jsxs)("div",{className:"audience-content-merged",children:[(0,o.jsx)("h2",{children:"Who Should Take This Course?"}),(0,o.jsxs)("div",{className:"audience-grid-compact",children:[(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83c\udf93"}),(0,o.jsx)("h4",{children:"Beginners"}),(0,o.jsx)("p",{children:"Looking to enter the field of AI"})]}),(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83d\udcda"}),(0,o.jsx)("h4",{children:"Students"}),(0,o.jsx)("p",{children:"High school students seeking an applied introduction to AI"})]}),(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83d\udcbc"}),(0,o.jsx)("h4",{children:"Professionals"}),(0,o.jsx)("p",{children:"Experienced IT professionals wanting to upskill"})]}),(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83d\udc68\u200d\ud83d\udcbb"}),(0,o.jsx)("h4",{children:"Developers"}),(0,o.jsx)("p",{children:"Software developers looking to integrate AI into their applications"})]}),(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83d\udcca"}),(0,o.jsx)("h4",{children:"Data Analysts"}),(0,o.jsx)("p",{children:"Data professionals wanting to advance to machine learning roles"})]}),(0,o.jsxs)("div",{className:"audience-item-compact",children:[(0,o.jsx)("div",{className:"audience-icon",children:"\ud83d\udd0d"}),(0,o.jsx)("h4",{children:"Curious Minds"}),(0,o.jsx)("p",{children:"Anyone curious about how AI works behind the scenes"})]})]})]})]})}),(0,o.jsx)(i.A,{}),(0,o.jsxs)("section",{className:"curriculum-section",children:[(0,o.jsx)("h2",{children:"What You'll Learn"}),(0,o.jsxs)("div",{className:"curriculum-grid",children:[(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"Introduction to AI"}),(0,o.jsx)("p",{children:"Understand what AI is, types of AI, and why it's transforming the world."})]}),(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"Math Foundations for AI"}),(0,o.jsx)("p",{children:"Learn essential linear algebra concepts. No prior knowledge required."})]}),(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"Python for AI"}),(0,o.jsx)("p",{children:"A crash course on Python to build practical AI applications."})]}),(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"Neural Networks"}),(0,o.jsx)("p",{children:"Understand foundations of today's AI applications using Neural Networks."})]}),(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"Computer Vision & CNNs"}),(0,o.jsx)("p",{children:"Learn CNNs that power breakthroughs in image recognition and autonomous driving."})]}),(0,o.jsxs)("div",{className:"curriculum-item",children:[(0,o.jsx)("h3",{children:"NLP and LLMs"}),(0,o.jsx)("p",{children:"Explore the world of Natural Language Processing and Large Language Models."})]})]})]}),(0,o.jsxs)("section",{className:"format-section",children:[(0,o.jsxs)("div",{className:"format-content",children:[(0,o.jsx)("h2",{children:"Course Format"}),(0,o.jsxs)("div",{className:"format-grid",children:[(0,o.jsxs)("div",{className:"format-item",children:[(0,o.jsx)("span",{className:"format-icon",children:"\ud83c\udfa5"}),(0,o.jsx)("span",{children:"Live Classes - 4 hours per week"})]}),(0,o.jsxs)("div",{className:"format-item",children:[(0,o.jsx)("span",{className:"format-icon",children:"\ud83d\udcbb"}),(0,o.jsx)("span",{children:"Coding labs for assignments"})]}),(0,o.jsxs)("div",{className:"format-item",children:[(0,o.jsx)("span",{className:"format-icon",children:"\ud83d\udccb"}),(0,o.jsx)("span",{children:"Downloadable slides"})]}),(0,o.jsxs)("div",{className:"format-item",children:[(0,o.jsx)("span",{className:"format-icon",children:"\ufffd"}),(0,o.jsx)("span",{children:"Two projects: mid-term and final"})]})]})]}),(0,o.jsx)("div",{className:"format-image",children:(0,o.jsx)("img",{src:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=500&h=400&fit=crop&auto=format",alt:"Online Learning"})})]}),(0,o.jsxs)("section",{className:"cta-section",children:[(0,o.jsx)("h2",{children:t?"Continue Your Learning Journey":"Ready to Level Up Your Skills?"}),t?(0,o.jsx)("button",{className:"cta-final",onClick:r,children:"Go to Dashboard"}):(0,o.jsx)("button",{className:"cta-final",onClick:n,children:"Register Here"})]})]})};r()}catch(c){r(c)}})}
2,1798:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{I1:()=>o});var s=n(5043),a=n(3842),i=e([a]);a=(i.then?(await i)():i)[0];const o=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const[n,r]=(0,s.useState)({enrollmentCount:0,averageRating:0,reviewCount:0,hasReviews:!1}),[i,o]=(0,s.useState)(!0),[l,c]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(e){if(t){return(0,a.Ot)(e,e=>{var t,n;r({enrollmentCount:e.enrollmentCount,averageRating:e.averageRating,reviewCount:e.reviewCount,hasReviews:e.hasReviews}),null!==(t=e.errors)&&void 0!==t&&t.enrollment||null!==(n=e.errors)&&void 0!==n&&n.rating?c(e.errors.enrollment||e.errors.rating):c(null),o(!1)})}(async()=>{o(!0);try{const t=await(0,a.pg)(e);t.success?(r(t.stats),c(null)):c(t.error)}catch(t){c(t.message)}finally{o(!1)}})()}else o(!1)},[e,t]),{stats:n,loading:i,error:l}};r()}catch(o){r(o)}})},1905:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>g});var s=n(2555),a=n(5043),i=n(5472),o=n(8426),l=n(4879),c=n(342),u=n(7096),d=n(9540),h=n(3387),m=(n(9864),n(579)),p=e([u]);u=(p.then?(await p)():p)[0];const f={PENDING:"pending_manual_verification",VERIFIED:"verified_and_enrolled",ARCHIVED:"archived",REJECTED:"rejected"},g=()=>{const{isAdminUser:e}=(0,l.h)(),{user:t}=(0,c.A)(),[n,r]=(0,a.useState)(f.PENDING),[p,g]=(0,a.useState)([]),[v,y]=(0,a.useState)(!0),[b,x]=(0,a.useState)(null),[w,N]=(0,a.useState)({totalVerified:0,totalAmount:0,count:0});(0,a.useEffect)(()=>{e&&(j(n),E())},[e,n]);const j=async e=>{y(!0);try{const t=(0,i.P)((0,i.rJ)(o.db,"manual_payments"),(0,i._M)("status","==",e),(0,i.My)("createdAt","desc")),n=(await(0,i.GG)(t)).docs.map(e=>(0,s.A)({id:e.id},e.data()));g(n)}catch(t){console.error("Error loading payments:",t);const n=(0,i.P)((0,i.rJ)(o.db,"manual_payments"),(0,i._M)("status","==",e)),r=(await(0,i.GG)(n)).docs.map(e=>(0,s.A)({id:e.id},e.data()));g(r)}y(!1)},E=async()=>{try{const e=(0,i.P)((0,i.rJ)(o.db,"manual_payments"),(0,i._M)("status","==",f.VERIFIED)),t=(await(0,i.GG)(e)).docs.map(e=>e.data()),n=t.reduce((e,t)=>e+(parseFloat(t.amount)||0),0);N({totalVerified:t.length,totalAmount:n,count:t.length})}catch(e){console.error("Error loading statistics:",e)}},S=()=>{x(null)},C=async e=>{try{var r;if(!e.userId)return void alert("No userId present on payment; please ensure the payer has an account before verifying.");const s=(null===t||void 0===t?void 0:t.uid)||"admin",a=await(0,u.cV)(e.userId,e.courseId,s,null,"Verified manual payment ".concat(e.transactionId||""),e.amount);if(!a.success)return void alert("Enrollment failed: ".concat(a.error));const l=await(async(e,n,r)=>{try{var s;const a=await(0,h.VM)(e.userId),l=a.success?a.userData:null,c={paymentId:e.transactionId||"manual_".concat(Date.now()),orderId:n,payerId:e.userId,courseId:e.courseId,courseTitle:e.courseTitle,amount:parseFloat(e.amount)||0,originalAmount:parseFloat(e.amount)||0,appliedCoupon:null,discountAmount:0,couponCode:null,userId:e.userId,userEmail:(null===l||void 0===l?void 0:l.email)||e.payerEmail,userName:(null===l||void 0===l?void 0:l.displayName)||e.payerName,payerEmail:e.payerEmail,payerName:e.payerName,status:"completed",transactionStatus:"Completed",paymentMethod:"manual",manualPaymentId:e.id,manualTransactionId:e.transactionId,verifiedBy:(null===t||void 0===t?void 0:t.uid)||"admin",termsAccepted:e.termsAccepted||!1,termsAcceptedAt:e.termsAcceptedAt||null,enrollmentId:n,batchNumber:r,paymentDate:null!==(s=e.createdAt)&&void 0!==s&&s.toDate?e.createdAt.toDate():new Date,createdAt:(0,i.O5)(),updatedAt:(0,i.O5)()};return{success:!0,paymentRecordId:(await(0,i.gS)((0,i.rJ)(o.db,"payments"),c)).id}}catch(a){return console.error("Error recording payment:",a),{success:!1,error:a.message}}})(e,a.enrollmentId,a.batchNumber);l.success||console.error("Failed to record payment in payments collection:",l.error);const c={userName:e.payerName||(null===(r=e.payerEmail)||void 0===r?void 0:r.split("@")[0])||"Student",userEmail:e.payerEmail,courseTitle:e.courseTitle,courseId:e.courseId,amount:e.amount||0,paymentId:e.transactionId||null,orderId:a.enrollmentId,enrollmentId:a.enrollmentId,enrollmentDate:(new Date).toLocaleStr
2ing(),batchNumber:a.batchNumber,paymentMethod:"manual",payerName:e.payerName,payerEmail:e.payerEmail,transactionStatus:"Completed"},m=await(0,d.cK)(c),p=(0,i.H9)(o.db,"manual_payments",e.id);await(0,i.mZ)(p,{status:f.VERIFIED,enrollmentId:a.enrollmentId,enrollmentBatch:a.batchNumber,paymentRecordId:l.success?l.paymentRecordId:null,emailSent:m.success||!1,verifiedBy:s,verifiedAt:new Date}),alert("\u2705 Enrollment completed, payment recorded, and email sent successfully!"),x(null),j(n),E()}catch(s){console.error("Verify error",s),alert("Verification failed: "+(s.message||s))}},k=async function(e,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{const a=(0,i.H9)(o.db,"manual_payments",e.id),l={status:r,lastModifiedBy:(null===t||void 0===t?void 0:t.uid)||"admin",lastModifiedAt:new Date};s&&(l.adminNotes=s),await(0,i.mZ)(a,l),alert("Payment status updated."),j(n)}catch(a){console.error("Update error",a),alert("Update failed: "+(a.message||a))}},_=e=>{const t=prompt("Archive notes (optional):");null!==t&&k(e,f.ARCHIVED,t)},A=e=>{if(!e)return"N/A";try{return(e.toDate?e.toDate():new Date(e)).toLocaleString()}catch(t){return"Invalid date"}};return e?(0,m.jsxs)("div",{className:"admin-manual-payments",children:[(0,m.jsx)("h3",{children:"Manual Payments Management"}),(0,m.jsxs)("div",{className:"payment-statistics",children:[(0,m.jsxs)("div",{className:"stat-card",children:[(0,m.jsx)("div",{className:"stat-label",children:"Total Verified Payments"}),(0,m.jsx)("div",{className:"stat-value",children:w.count})]}),(0,m.jsxs)("div",{className:"stat-card",children:[(0,m.jsx)("div",{className:"stat-label",children:"Total Amount Received"}),(0,m.jsxs)("div",{className:"stat-value",children:["$",w.totalAmount.toFixed(2)]})]})]}),(0,m.jsxs)("div",{className:"payment-status-tabs",children:[(0,m.jsx)("button",{className:"status-tab ".concat(n===f.PENDING?"active":""),onClick:()=>r(f.PENDING),children:"\u23f3 Pending"}),(0,m.jsx)("button",{className:"status-tab ".concat(n===f.VERIFIED?"active":""),onClick:()=>r(f.VERIFIED),children:"\u2705 Verified & Enrolled"}),(0,m.jsx)("button",{className:"status-tab ".concat(n===f.ARCHIVED?"active":""),onClick:()=>r(f.ARCHIVED),children:"\ud83d\udce6 Archived"}),(0,m.jsx)("button",{className:"status-tab ".concat(n===f.REJECTED?"active":""),onClick:()=>r(f.REJECTED),children:"\u274c Rejected"})]}),v?(0,m.jsx)("div",{className:"loading-state",children:"Loading payments..."}):(0,m.jsx)("div",{className:"payments-list",children:0===p.length?(0,m.jsxs)("p",{className:"no-payments",children:["No ",n.replace("_"," ")," payments."]}):(0,m.jsx)("div",{className:"payment-cards",children:p.map(e=>(0,m.jsxs)("div",{className:"payment-card",children:[(0,m.jsxs)("div",{className:"payment-header",children:[(0,m.jsx)("strong",{children:e.courseTitle}),(0,m.jsx)("span",{className:"payment-amount",children:e.amount?"$".concat(e.amount):"N/A"})]}),(0,m.jsxs)("div",{className:"payment-details",children:[(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Transaction ID:"}),(0,m.jsx)("span",{className:"value",children:e.transactionId||"N/A"})]}),(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Payer:"}),(0,m.jsx)("span",{className:"value",children:e.payerName})]}),(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Email:"}),(0,m.jsx)("span",{className:"value",children:e.payerEmail})]}),(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Submitted:"}),(0,m.jsx)("span",{className:"value",children:A(e.createdAt)})]}),e.notes&&(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"User Notes:"}),(0,m.jsx)("span",{className:"value",children:e.notes})]}),e.adminNotes&&(0,m.jsxs)("div",{className:"detail-row admin-notes",children:[(0,m.jsx)("span",{className:"label",children:"Admin Notes:"}),(0,m.jsx)("span",{className:"value",children:e.adminNotes})]}),e.enrollmentId&&(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Enrollment ID:"}),(0,m.jsx)("span",{className:"value",children:e.enrollmentId})]}),e.verifiedAt&&(0,m.jsxs)("div",{className:"detail-row",children:[(0,m.jsx)("span",{className:"label",children:"Verified:"}),(0,m.jsx)("span",{className:"value",children:A(e.verifiedAt)})]})]}),(0,m.jsxs)("div",{className:"payment-actions",children:[n===f.PENDING&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("button",{className:"btn btn-primary",onClick:()=>{x(e)},disabled:!e.userId,title:e.userId?"":"No user ID - cannot auto-enroll",children:"\u2713 Verify & Enroll"}),(0,m.jsx)("button",{className:"btn btn-secondary",onClick:()=>_(e),children:"\ud83d\udce6 Archive"}),(0,m.jsx)("button",{className:"btn btn-danger",onClick:()=>(e=>{const t=prompt("Rejection reason (required):");t&&t.trim()?k(e,f.REJECTED,t):null!==t&&alert("Please provide a rejection reason.")})(e),children:"\u2717 Reject"})]}),n===f.VERIFIED&&(0,m.jsx)("button",{className:"btn btn-secondary",onClick:()=>_(e),children:"\ud83d\udce6 Archive"}),n===f.ARCHIVED&&(0,m.jsx)("button",{className:"btn btn-secondary",onClick:()=>{k(e,f.PENDING,"Unarchived")},children:"\u21a9\ufe0f Restore to Pending"}),n===f.REJECTED&&(0,m.jsx)("button",{className:"btn btn-secondary",onClick:()=>{k(e,f.PENDING,"Unreject - moved back to pending")},children:"\u21a9\ufe0f Move to Pending"})]})]},e.id))})}),b&&(0,m.jsx)("div",{className:"confirmation-modal-overlay",onClick:S,children:(0,m.jsxs)("div",{className:"confirmation-modal",onClick:e=>e.stopPropagation(),children:[(0,m.jsx)("h4",{children:"\u26a0\ufe0f Confirm Payment Verification"}),(0,m.jsx)("p",{children:"Please review the payment details carefully before approving:"}
2),(0,m.jsxs)("div",{className:"confirmation-details",children:[(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Course:"}),(0,m.jsx)("span",{children:b.courseTitle})]}),(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Amount:"}),(0,m.jsxs)("span",{className:"amount-highlight",children:["$",b.amount||0]})]}),(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Transaction ID:"}),(0,m.jsx)("span",{children:b.transactionId||"N/A"})]}),(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Payer:"}),(0,m.jsx)("span",{children:b.payerName})]}),(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Email:"}),(0,m.jsx)("span",{children:b.payerEmail})]}),(0,m.jsxs)("div",{className:"confirm-row",children:[(0,m.jsx)("strong",{children:"Submitted:"}),(0,m.jsx)("span",{children:A(b.createdAt)})]}),b.notes&&(0,m.jsxs)("div",{className:"confirm-row notes-row",children:[(0,m.jsx)("strong",{children:"User Notes:"}),(0,m.jsx)("span",{children:b.notes})]})]}),(0,m.jsxs)("div",{className:"confirmation-checklist",children:[(0,m.jsx)("h5",{children:"\u2705 Pre-approval Checklist:"}),(0,m.jsxs)("ul",{children:[(0,m.jsx)("li",{children:"\u2713 Transaction ID matches bank/Zelle records"}),(0,m.jsx)("li",{children:"\u2713 Amount received matches the listed amount"}),(0,m.jsx)("li",{children:"\u2713 Payer information is correct"}),(0,m.jsx)("li",{children:"\u2713 No duplicate payment for same course/user"})]})]}),(0,m.jsxs)("div",{className:"modal-actions",children:[(0,m.jsx)("button",{className:"btn btn-cancel",onClick:S,children:"Cancel"}),(0,m.jsx)("button",{className:"btn btn-confirm",onClick:()=>
2C(b),children:"\u2713 Confirm & Process"})]})]})})]}):(0,m.jsx)("div",{children:"You do not have permission to view this page."})};r()}catch(f){r(f)}})},1977:(e,t,n)=>{n.d(t,{A:()=>m});var r=n(2555),s=n(5043),a=n(4366),i=n(342),o=n(4879),l=n(2099),c=n(1291),u=n(579);const d=e=>{var t,n,r,a;let{reply:d,onDelete:h,onLike:m}=e;const{user:p}=(0,i.A)(),{userRole:f}=(0,o.h)(),[g,v]=(0,s.useState)(!1),[y,b]=(0,s.useState)((null===(t=d.likedBy)||void 0===t?void 0:t.length)||0),[x,w]=(0,s.useState)(!!p&&(null===(n=d.likedBy)||void 0===n?void 0:n.includes(p.uid))),N=(0,c.Ry)(d.createdAt),j=p&&(p.uid===d.authorId||"admin"===(null===f||void 0===f?void 0:f.role));return(0,u.jsxs)("div",{className:"reply-card",children:[(0,u.jsxs)("div",{className:"reply-author",children:[(0,u.jsxs)("div",{className:"author-avatar-reply",children:[d.authorAvatar?(0,u.jsx)("img",{src:d.authorAvatar,alt:d.authorName,onError:e=>{e.target.style.display="none",e.target.nextElementSibling.style.display="flex"}}):null,(0,u.jsx)("div",{className:"default-avatar-reply",style:{display:d.authorAvatar?"none":"flex"},children:(null===(r=d.authorName)||void 0===r||null===(a=r.charAt(0))||void 0===a?void 0:a.toUpperCase())||"A"})]}),(0,u.jsxs)("div",{className:"author-info-reply",children:[(0,u.jsx)("span",{className:"author-name-reply",children:d.authorName||"Anonymous"}),(0,u.jsx)("span",{className:"post-date-reply",title:N.tooltip,children:N.display})]})]}),(0,u.jsxs)("div",{className:"reply-content-wrapper",children:[(0,u.jsx)("div",{className:"reply-content",dangerouslySetInnerHTML:{__html:d.content}}),(0,u.jsxs)("div",{className:"reply-footer",children:[(0,u.jsxs)("button",{className:"like-btn reply-like-btn ".concat(x?"liked":""),onClick:async e=>{if(e.stopPropagation(),p){if(!g){v(!0);try{const e=await(0,l.cI)(d.id,p.uid);e.success&&(w(e.liked),b(e.likeCount),m&&m(d.id,e.liked,e.likeCount))}catch(t){}finally{v(!1)}}}else alert("Please log in to like replies")},disabled:g,title:x?"Unlike":"Like",children:[(0,u.jsx)("span",{className:"like-icon",children:"\ud83d\udc4d"}),(0,u.jsx)("span",{className:"like-count",children:y})]}),j&&(0,u.jsx)("button",{className:"delete-btn reply-delete-btn",onClick:async e=>{e.stopPropagation(),window.confirm("Are you sure you want to delete this reply? This action cannot be undone.")&&h&&await h(d.id)},title:"Delete reply",children:"\ud83d\uddd1\ufe0f"})]})]})]})},h=e=>{let{threadId:t,onReplyPosted:n}=e;const{user:r}=(0,i.A)(),[a,o]=(0,s.useState)(""),[c,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null);return(0,u.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),a.trim()){d(!0),m(null);try{const e={threadId:t,content:a,authorId:r.uid,authorEmail:r.email,authorName:r.name||r.displayName||"Anonymous",authorAvatar:r.photoURL||null},s=await(0,l.fC)(e);s.success?(o(""),n()):m(s.error)}catch(s){m("Failed to post reply.")}finally{d(!1)}}else m("Reply cannot be empty.")},className:"reply-form",children:[(0,u.jsx)("h3",{children:"Leave a Reply"}),(0,u.jsx)("textarea",{value:a,onChange:e=>o(e.target.value),placeholder:"Write your reply... You can use basic HTML for formatting.",rows:"5",required:!0}),h&&(0,u.jsx)("p",{className:"error-text",children:h}),(0,u.jsx)("button",{type:"submit",className:"btn-primary",disabled:c,children:c?"Posting...":"Post Reply"})]})},m=()=>{var e,t,n,m,p;const{threadId:f}=(0,a.g)(),{user:g}=(0,i.A)(),{userRole:v}
2=(0,o.h)(),y=(0,a.Zp)(),[b,x]=(0,s.useState)(null),[w,N]=(0,s.useState)([]),[j,E]=(0,s.useState)(!0),[S,C]=(0,s.useState)(null),k=(0,s.useCallback)(async()=>{E(!0),C(null);try{const e=await(0,l.fG)(f);if(e.success){x(e.thread);const t=await(0,l.HH)(f);t.success?N(t.replies):(C("Failed to load replies: ".concat(t.error)),N([]))}else C("Failed to load thread: ".concat(e.error))}catch(e){C("Failed to load thread data.")}finally{E(!1)}},[f]);(0,s.useEffect)(()=>{k()},[k]);const _=async e=>{try{(await(0,l.eL)(e,f)).success?(N(t=>t.filter(t=>t.id!==e)),x(e=>(0,r.A)((0,r.A)({},e),{},{replyCount:Math.max(0,e.replyCount-1)}))):alert("Failed to delete reply. Please try again.")}catch(S){alert("An error occurred while deleting the reply.")}},A=(e,t,n)=>{N(n=>n.map(n=>n.id===e?(0,r.A)((0,r.A)({},n),{},{likedBy:t?[...n.likedBy||[],g.uid]:(n.likedBy||[]).filter(e=>e!==g.uid)}):n))};if(j)return(0,u.jsxs)("div",{className:"loading-state-detail",children:[(0,u.jsx)("div",{className:"loading-spinner"}),(0,u.jsx)("p",{children:"Loading discussion..."})]});if(S)return(0,u.jsxs)("div",{className:"error-state-detail",children:[(0,u.jsx)("h3",{children:"Error"}),(0,u.jsx)("p",{children:S}),(0,u.jsx)(a.N_,{to:"/forums",className:"btn-primary",children:"Back to Forums"})]});if(!b)return null;const T=(0,c.Ry)(b.createdAt),I=g&&(g.uid===b.authorId||"admin"===(null===v||void 0===v?void 0:v.role));return(0,u.jsxs)("div",{className:"thread-detail-container",children:[(0,u.jsxs)("div",{className:"thread-detail-header",children:[(0,u.jsxs)("div",{className:"thread-header-top",children:[(0,u.jsx)(a.N_,{to:"/forums",className:"back-link",children:"\u2190 Back to Forums"}),I&&(0,u.jsx)("button",{className:"delete-btn thread-delete-btn",onClick:async()=>{if(window.confirm("Are you sure you want to delete this thread? This action cannot be undone."))try{(await(0,l.KX)(f)).success?y("/forums"):alert("Failed to delete thread. Please try again.")}catch(S){alert("An error occurred while deleting the thread.")}},title:"Delete thread",children:"\ud83d\uddd1\ufe0f Delete Thread"})]}),(0,u.jsx)("h1",{children:b.title}),(0,u.jsxs)("div",{className:"thread-meta",children:[(0,u.jsxs)("div",{className:"author-info-detail",children:[(0,u.jsxs)("div",{className:"author-avatar-detail",children:[b.authorAvatar?(0,u.jsx)("img",{src:b.authorAvatar,alt:b.authorName,onError:e=>{e.target.style.display="none",e.target.nextSibling.style.display="flex"}}):null,(0,u.jsx)("div",{className:"default-avatar-detail",style:{display:b.authorAvatar?"none":"flex"},children:(null===(e=b.authorName)||void 0===e||null===(t=e.charAt(0))||void 0===t?void 0:t.toUpperCase())||"A"})]}),(0,u.jsxs)("span",{children:["By ",b.authorName]})]}),(0,u.jsx)("span",{children:"\u2022"}),(0,u.jsx)("span",{title:T.tooltip,children:T.display})]})]}),(0,u.jsx)("div",{className:"thread-content-detail",dangerouslySetInnerHTML:{__html:b.content}}),(0,u.jsx)("div",{className:"thread-actions",children:(0,u.jsxs)("button",{className:"like-btn thread-like-btn ".concat(null!==(n=b.likedBy)&&void 0!==n&&n.includes(null===g||void 0===g?void 0:g.uid)?"liked":""),onClick:async()=>{if(g)try{const e=await(0,l.Mq)(f,g.uid);e.success&&x(t=>(0,r.A)((0,r.A)({},t),{},{likedBy:e.liked?[...t.likedBy||[],g.uid]:(t.likedBy||[]).filter(e=>e!==g.uid)}))}catch(S){}else alert("Please log in to like threads")},title:null!==(m=b.likedBy)&&void 0!==m&&m.includes(null===g||void 0===g?void 0:g.uid)?"Unlike":"Like",children:[(0,u.jsx)("span",{className:"like-icon",children:"\ud83d\udc4d"}),(0,u.jsx)("span",{className:"like-count",children:(null===(p=b.likedBy)||void 0===p?void 0:p.length)||0})]})}),(0,u.jsxs)("div",{className:"replies-section",children:[(0,u.jsxs)("h2",{children:[w.length," ",1===w.length?"Reply":"Replies"]}),(0,u.jsx)("div",{className:"replies-list",children:w.map(e=>(0,u.jsx)(d,{reply:e,onDelete:_,onLike:A},e.id))})]}),(0,u.jsx)("div",{className:"reply-form-section",children:g?(0,u.jsx)(h,{threadId:f,onReplyPosted:()=>{k()}}):(0,u.jsxs)("div",{className:"login-prompt",children:[(0,u.jsx)("p",{children:"You must be logged in to reply."}),(0,u.jsx)(a.N_,{to:"/login",className:"btn-primary",children:"Login to Reply"})]})})]})}},2075:()=>{}
2,2099:(e,t,n)=>{n.d(t,{A3:()=>u,Bi:()=>l,HH:()=>h,KX:()=>f,Ld:()=>o,Mq:()=>v,Nw:()=>c,U:()=>p,cI:()=>y,eL:()=>g,fC:()=>m,fG:()=>d,js:()=>i});var r=n(2555),s=n(5472),a=n(8426);const i={GENERAL:"general",COURSES:"courses",AI_ML:"ai_ml",CAREERS:"careers",PROJECTS:"projects",HELP:"help"},o=e=>Math.round(e||0),l={[i.GENERAL]:"General Discussion",[i.COURSES]:"Course Discussions",[i.AI_ML]:"AI & Machine Learning",[i.CAREERS]:"Career Advice",[i.PROJECTS]:"Project Showcase",[i.HELP]:"Help & Support"},c=async e=>{try{return{success:!0,id:(await(0,s.gS)((0,s.rJ)(a.db,"forum_threads"),(0,r.A)((0,r.A)({},e),{},{createdAt:(0,s.O5)(),updatedAt:(0,s.O5)(),viewCount:0,replyCount:0,isPinned:!1,isLocked:!1,likedBy:[],reportedBy:[],lastReplyAt:(0,s.O5)()}))).id}}catch(t){return{success:!1,error:t.message}}},u=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;try{let n;n=e?(0,s.P)((0,s.rJ)(a.db,"forum_threads"),(0,s._M)("category","==",e),(0,s.AB)(t)):(0,s.P)((0,s.rJ)(a.db,"forum_threads"),(0,s.AB)(t));const i=await(0,s.GG)(n),o=[];return i.forEach(e=>{var t,n,s;o.push((0,r.A)((0,r.A)({id:e.id},e.data()),{},{createdAt:null===(t=e.data().createdAt)||void 0===t?void 0:t.toDate(),updatedAt:null===(n=e.data().updatedAt)||void 0===n?void 0:n.toDate(),lastReplyAt:null===(s=e.data().lastReplyAt)||void 0===s?void 0:s.toDate()}))}),o.sort((e,t)=>e.createdAt?t.createdAt?t.createdAt.getTime()-e.createdAt.getTime():-1:1),{success:!0,threads:o,lastDoc:i.docs[i.docs.length-1],hasMore:i.docs.length===t}}catch(n){return{success:!1,error:n.message}}},d=async e=>{try{const l=(0,s.H9)(a.db,"forum_threads",e),c=await(0,s.x7)(l);if(c.exists()){var t,n,i;try{await(0,s.mZ)(l,{viewCount:(0,s.GV)(.5)})}catch(o){}return{success:!0,thread:(0,r.A)((0,r.A)({id:c.id},c.data()),{},{createdAt:null===(t=c.data().createdAt)||void 0===t?void 0:t.toDate(),updatedAt:null===(n=c.data().updatedAt)||void 0===n?void 0:n.toDate(),lastReplyAt:null===(i=c.data().lastReplyAt)||void 0===i?void 0:i.toDate()})}}return{success:!1,error:"Thread not found"}}catch(l){return{success:!1,error:l.message}}},h=async e=>{try{const t=(0,s.P)((0,s.rJ)(a.db,"forum_replies"),(0,s._M)("threadId","==",e)),n=await(0,s.GG)(t),i=[];return n.forEach(e=>{var t,n;i.push((0,r.A)((0,r.A)({id:e.id},e.data()),{},{createdAt:null===(t=e.data().createdAt)||void 0===t?void 0:t.toDate(),updatedAt:null===(n=e.data().updatedAt)||void 0===n?void 0:n.toDate()}))}),i.sort((e,t)=>e.createdAt?t.createdAt?e.createdAt.getTime()-t.createdAt.getTime():-1:1),{success:!0,replies:i}}catch(t){return{success:!1,error:t.message}}},m=async e=>{try{const t=await(0,s.gS)((0,s.rJ)(a.db,"forum_replies"),(0,r.A)((0,r.A)({},e),{},{createdAt:(0,s.O5)(),updatedAt:(0,s.O5)(),likedBy:[],reportedBy:[]})),n=(0,s.H9)(a.db,"forum_threads",e.threadId);return await(0,s.mZ)(n,{replyCount:(0,s.GV)(1),lastReplyAt:(0,s.O5)(),lastReplyBy:e.authorName}),{success:!0,id:t.id}}catch(t){return{success:!1,error:t.message}}},p=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{let n;n=t?(0,s.P)((0,s.rJ)(a.db,"forum_threads"),(0,s._M)("category","==",t)):(0,s.P)((0,s.rJ)(a.db,"forum_threads"));const i=await(0,s.GG)(n),o=[],l=e.toLowerCase();return i.forEach(e=>{const t=e.data();var n,s,a;(t.title.toLowerCase().includes(l)||t.content.toLowerCase().includes(l))&&o.push((0,r.A)((0,r.A)({id:e.id},t),{},{createdAt:null===(n=t.createdAt)||void 0===n?void 0:n.toDate(),updatedAt:null===(s=t.updatedAt)||void 0===s?void 0:s.toDate(),lastReplyAt:null===(a=t.lastReplyAt)||void 0===a?void 0:a.toDate()}))}),o.sort((e,t)=>e.createdAt?t.createdAt?t.createdAt.getTime()-e.createdAt.getTime():-1:1),{success:!0,threads:o.slice(0,20)}}catch(n){return{success:!1,error:n.message}}},f=async e=>{try{const t=(0,s.P)((0,s.rJ)(a.db,"forum_replies"),(0,s._M)("threadId","==",e)),n=(await(0,s.GG)(t)).docs.map(e=>(0,s.kd)(e.ref));return await Promise.all(n),await(0,s.kd)((0,s.H9)(a.db,"forum_threads",e)),{success:!0}}catch(t){return{success:!1,error:t.message}}},g=async(e,t)=>{try{await(0,s.kd)((0,s.H9)(a.db,"forum_replies",e));const n=(0,s.H9)(a.db,"forum_threads",t);return await(0,s.mZ)(n,{replyCount:(0,s.GV)(-1)}),{success:!0}}catch(n){return{success:!1,error:n.message}}},v=async(e,t)=>{try{const n=(0,s.H9)(a.db,"forum_threads",e),r=await(0,s.x7)(n);if(!r.exists())return{success:!1,error:"Thread not found"};const i=r.data().likedBy||[];if(i.includes(t)){const e=i.filter(e=>e!==t);return await(0,s.mZ)(n,{likedBy:e}),{success:!0,liked:!1,likeCount:e.length}}{const e=[...i,t];return await(0,s.mZ)(n,{likedBy:e}),{success:!0,liked:!0,likeCount:e.length}}}catch(n){return{success:!1,error:n.message}}},y=async(e,t)=>{try{const n=(0,s.H9)(a.db,"forum_replies",e),r=await(0,s.x7)(n);if(!r.exists())return{success:!1,error:"Reply not found"};const i=r.data().likedBy||[];if(i.includes(t)){const e=i.filter(e=>e!==t);return await(0,s.mZ)(n,{likedBy:e}),{success:!0,liked:!1,likeCount:e.length}}{const e=[...i,t];return await(0,s.mZ)(n,{likedBy:e}),{success:!0,liked:!0,likeCount:e.length}}}catch(n){return{success:!1,error:n.message}}}},2105:()=>{},2165:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>d});var s=n(5043),a=n(5114),i=n(342),o=n(3387),l=n(579),c=e([a]);
2a=(c.then?(await c)():c)[0];const u=e=>{let{value:t=0,onChange:n}=e;return(0,l.jsx)("div",{className:"star-input",role:"radiogroup","aria-label":"Rating",children:[1,2,3,4,5].map(e=>(0,l.jsx)("button",{type:"button",className:"star ".concat(e<=t?"active":""),onClick:()=>n(e),"aria-checked":t===e,role:"radio",children:e<=t?"\u2605":"\u2606"},e))})},d=e=>{let{courseId:t,courseTitle:n,onSubmitted:r}=e;const{user:c}=(0,i.A)(),d=null===c||void 0===c?void 0:c.uid,[h,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(0),[g,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(null),[x,w]=(0,s.useState)(!1),[N,j]=(0,s.useState)(""),[E,S]=(0,s.useState)(!1);(0,s.useEffect)(()=>{(async()=>{if(d)if(null!==c&&void 0!==c&&c.displayName)j(c.displayName);else try{var e;const n=await(0,o.VM)(d);var t;if(n.success&&null!==(e=n.userData)&&void 0!==e&&e.displayName)j(n.userData.displayName);else j((null===c||void 0===c||null===(t=c.email)||void 0===t?void 0:t.split("@")[0])||"User")}catch(y){var n;j((null===c||void 0===c||null===(n=c.email)||void 0===n?void 0:n.split("@")[0])||"User")}})()},[c,d]),(0,s.useEffect)(()=>{let e=!0;return(async()=>{if(!d||!t)return;const n=await(0,a.ou)(d,t);e&&(n.success&&n.review?(f(n.review.rating||0),v(n.review.comment||""),w(!0)):(f(0),v(""),w(!1)))})(),()=>{e=!1}},[d,t]);if(!d)return(0,l.jsx)("div",{className:"review-form-login",children:"Log in to write a review."});const C=()=>{S(!E),E||b(null)};return(0,l.jsxs)("div",{className:"review-form-container",children:[(0,l.jsx)("div",{className:"review-form-toggle",children:(0,l.jsx)("button",{className:"btn ".concat(x?"btn-secondary":"btn-primary"," review-toggle-btn"),onClick:C,type:"button",children:E?"\u2715 Cancel":x?"Edit Review":"Write a Review"})}),E&&(0,l.jsxs)("form",{className:"review-form",onSubmit:async e=>{e.preventDefault();const s=await(async e=>{if(e.preventDefault(),!d)return void b("Please log in to leave a review.");m(!0),b(null);let r=(null===c||void 0===c?void 0:c.photoURL)||(null===c||void 0===c?void 0:c.photoUrl)||"";if(!r&&d)try{var s;const e=await(0,o.VM)(d);e.success&&null!==(s=e.userData)&&void 0!==s&&s.photoURL&&(r=e.userData.photoURL)}catch(y){}const i=await(0,a.sZ)({userId:d,userName:N,userEmail:null===c||void 0===c?void 0:c.email,userPhotoURL:r,courseId:t,courseTitle:n,rating:p,comment:g});return m(!1),i.success?(w(!0),!0):(b(i.error||"Failed to submit review"),!1)})(e);s&&(S(!1),r&&r())},children:[(0,l.jsx)("div",{className:"review-form-header",children:(0,l.jsx)("h4",{children:x?"Edit your review":"Write a review"})}),(0,l.jsx)(u,{value:p,onChange:f}),(0,l.jsxs)("div",{className:"review-textarea-container",children:[(0,l.jsx)("textarea",{className:"review-textarea",value:g,maxLength:3e3,onChange:e=>v(e.target.value),placeholder:"Share your experience...",rows:4,required:!0}),(0,l.jsx)("div",{className:"character-counter",children:(0,l.jsxs)("span",{className:g.length>2700?"character-counter-warning":"",children:[g.length,"/3000 characters"]})})]}),y&&(0,l.jsx)("div",{className:"review-error",children:y}),(0,l.jsxs)("div",{className:"review-form-actions",children:[(0,l.jsx)("button",{className:"btn",type:"submit",disabled:h||p<1,children:h?"Saving...":x?"Update Review":"Submit Review"}),x&&(0,l.jsx)("button",{className:"btn btn-secondary",type:"button",onClick:async()=>{await(async()=>{if(!d)return!1;if(!window.confirm("Delete your review?"))return!1;m(!0),b(null);const e=await(0,a.Wr)(t,d);return m(!1),e.success?(f(0),v(""),w(!1),!0):(b(e.error||"Failed to delete review"),!1)})()&&(S(!1),r&&r())},disabled:h,children:"Delete"}),(0,l.jsx)("button",{className:"btn btn-tertiary",type:"button",onClick:C,children:"Cancel"})]})]})]})};r()}catch(u){r(u)}})},2555:(e,t,n)=>{function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function s(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var s=n.call(e,t||"default");if("object"!=r(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:t+""}function a(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?i(Object(n),!0).forEach(function(t){a(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n.d(t,{A:()=>o})},2738:()=>{},2743:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>m});var s=n(5043),a=n(3783),i=n(342),o=n(4879),l=n(5278),c=n(2165),u=n(5114),d=n(579),h=e([a,c,u]);[a,c,u]=h.then?(await h)():h;const m=e=>{let{courseId:t,courseTitle:n}=e;const{user:r,loading:h}=(0,i.A)(),{isAdminUser:m}=(0,o.h)(),[p,f]=s.useState(10),{reviews:g,loading:v,error:y}=(0,a.v)(t,{limit:p}),b=s.useMemo(()=>{if(null===g||void 0===g||!g.length)return null;const e=g.reduce((e,t)=>e+(Number(t.rating)||0),0);return Math.round(e/g.length*10)/10},[g]),x=s.useCallback(async e=>{if(m){if(window.confirm("Are you sure you want to delete ".concat(e.userName,"'s review? This action cannot be undone.")))try{const t=await(0,u.hk)(e.id);t.success?alert("Review deleted successfully"):alert("Failed to delete review: ".concat(t.error))}catch(t){alert("Failed to delete review. Please try again.")}}else alert("You do not have permission to delete reviews.")},[m]);return(0,d.jsxs)("section",{className:"course-section",id:"reviews-section",children:[(0,d.jsx)("h3",{children:"Student Reviews"}),(0,d.jsx)("div",{className:"course-reviews-summary",children:v?(0,d.jsx)("p",{children:"Loading reviews..."}):y?(0,d.jsxs)("div",{children:[(0,d.jsxs)("p",{className:"course-detail-error-text",children:["Error loading reviews: ",y]}),(0,d.jsx)("p",{style:{fontSize:"12px",color:"#666"},children:"Reviews should be visible to all users. If you're seeing this error, there might be a Firebase configuration issue."})]}):(0,d.jsxs)("p",{children:[b?"\u2b50 ".concat(b," / 5"):"No ratings yet",null!==g&&void 0!==g&&g.length?" \xb7 ".concat(g.length," review").concat(g.length>1?"s":""):""]})}),!h&&(0,d.jsx)(c.A,{courseId:t,courseTitle:n,onSubmitted:()=>{}}),(0,d.jsxs)("div",{className:"course-reviews-list",id:"reviews-list",children:[(0,d.jsx)(l.A,{reviews:g,loading:v,error:y,currentUserId:null===r||void 0===r?void 0:r.uid,isCurrentUserAdmin:m,onAdminDelete:x}),!v&&!y&&g.length>0&&g.length%10===0&&(0,d.jsx)("div",{style:{textAlign:"center",marginTop:"1rem"},children:(0,d.jsx)("button",{onClick:()=>{f(e=>e+10)},className:"btn btn-secondary",style:{padding:"0.75rem 1.5rem"},children:"Load More Reviews"})})]})]})};r()}catch(m){r(m)}})},2799:(e,t)=>{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function s(e,t,r){var s=null;if(void 0!==r&&(s=""+r),void 0!==t.key&&(s=""+t.key),"key"in t)for(var a in r={},t)"key"!==a&&(r[a]=t[a]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:s,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=s,t.jsxs=s},2812:(e,t,n)=>{n.a(e,async(e,t)=>{try{var r=n(5043),s=n(4391),a=n(4111),i=n(5187),o=n(579),l=e([a]);a=(l.then?(await l)():l)[0];s.createRoot(document.getElementById("root")).render((0,o.jsx)(r.StrictMode,{children:(0,o.jsx)(i.Ay,{children:(0,o.jsx)(a.A,{})})})),t()}catch(c){t(c)}})},3150:()=>{},3387:(e,t,n)=>{n.d(t,{CF:()=>l,VM:()=>o,Vr:()=>i});var r=n(2555),s=n(5472),a=n(8426);const i=async e=>{try{if(!e||!e.uid)throw new Error("Invalid user object provided");const t=(0,s.H9)(a.db,"users",e.uid),n=await(0,s.x7)(t),i=(0,r.A)({uid:e.uid,email:e.email,displayName:e.displayName||e.name||"",photoURL:e.photoURL||"",emailVerified:e.emailVerified||!1,lastLoginAt:(0,s.O5)()},n.exists()?{}:{createdAt:(0,s.O5)(),role:"student"});return await(0,s.BN)(t,i,{merge:!0}),{success:!0,message:"User profile updated successfully",userData:i}}catch(t){return{success:!1,error:t.message}}},o=async e=>{try{if(!e)throw new Error("User ID is required");const t=(0,s.H9)(a.db,"users",e),n=await(0,s.x7)(t);return n.exists()?{success:!0,userData:(0,r.A)({id:n.id},n.data())}:{success:!1,error:"User profile not found"}}catch(t){return{success:!1,error:t.message}}},l=async()=>{try{const e=(0,s.P)((0,s.rJ)(a.db,"users"),(0,s.My)("createdAt","desc")),t=await(0,s.GG)(e);return{success:!0,users:t.docs.map(e=>(0,r.A)({id:e.id},e.data()))}}catch(e){return{success:!1,error:e.message,users:[]}}}},3400:()=>{},3663:(e,t,n)=>{n.d(t,{A:()=>
2o});var r=n(5043),s=n(5472),a=n(8426),i=n(579);const o=()=>{const[e,t]=(0,r.useState)({totalPayments:0,totalEnrollments:0,totalUsers:0,totalRevenue:0}),[n,o]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),u=async()=>{o(!0),c(null);try{const[e,n,r]=await Promise.all([(0,s.GG)((0,s.P)((0,s.rJ)(a.db,"payments"))),(0,s.GG)((0,s.P)((0,s.rJ)(a.db,"enrollments"))),(0,s.GG)((0,s.P)((0,s.rJ)(a.db,"users")))]);let i=0;e.docs.forEach(e=>{const t=e.data();t.amount&&"number"===typeof t.amount&&(i+=t.amount)}),t({totalPayments:e.size,totalEnrollments:n.size,totalUsers:r.size,totalRevenue:i})}catch(e){c(e.message)}finally{o(!1)}};return(0,r.useEffect)(()=>{u()},[]),(0,i.jsxs)("div",{children:[(0,i.jsxs)("div",{className:"admin-section-header",children:[(0,i.jsx)("h2",{children:"\ud83d\udcca Dashboard Overview"}),(0,i.jsx)("button",{onClick:u,className:"admin-refresh-button",disabled:n,children:n?"Loading...":"\ud83d\udd04 Refresh"})]}),l&&(0,i.jsxs)("p",{className:"admin-error",children:["Error: ",l]}),(0,i.jsxs)("div",{className:"admin-stats-grid",children:[(0,i.jsxs)("div",{className:"admin-stat-card",children:[(0,i.jsx)("div",{className:"admin-stat-icon",children:"\ud83d\udcb3"}),(0,i.jsxs)("div",{className:"admin-stat-content",children:[(0,i.jsx)("h3",{children:"Total Payments"}),(0,i.jsx)("p",{className:"admin-stat-number",children:e.totalPayments})]})]}),(0,i.jsxs)("div",{className:"admin-stat-card",children:[(0,i.jsx)("div",{className:"admin-stat-icon",children:"\ud83d\udcda"}),(0,i.jsxs)("div",{className:"admin-stat-content",children:[(0,i.jsx)("h3",{children:"Total Enrollments"}),(0,i.jsx)("p",{className:"admin-stat-number",children:e.totalEnrollments})]})]}),(0,i.jsxs)("div",{className:"admin-stat-card",children:[(0,i.jsx)("div",{className:"admin-stat-icon",children:"\ud83d\udc65"}),(0,i.jsxs)("div",{className:"admin-stat-content",children:[(0,i.jsx)("h3",{children:"Total Users"}),(0,i.jsx)("p",{className:"admin-stat-number",children:e.totalUsers})]})]}),(0,i.jsxs)("div",{className:"admin-stat-card",children:[(0,i.jsx)("div",{className:"admin-stat-icon",children:"\ud83d\udcb0"}),(0,i.jsxs)("div",{className:"admin-stat-content",children:[(0,i.jsx)("h3",{children:"Total Revenue"}),(0,i.jsxs)("p",{className:"admin-stat-number",children:["$",e.totalRevenue]})]})]})]}),(0,i.jsx)("div",{className:"admin-overview-actions",children:(0,i.jsxs)("div",{className:"admin-action-card",children:[(0,i.jsx)("h3",{children:"\ud83c\udfaf Quick Actions"}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:"View detailed payment records in the Payments tab"}),(0,i.jsx)("li",{children:"Manage user enrollments in the Enrollments tab"}),(0,i.jsx)("li",{children:"Track and update student progress in the Progress Tracking tab"}),(0,i.jsx)("li",{children:"Configure coupon discounts in the Coupons tab"}),(0,i.jsx)("li",{children:"Assign user roles in the Role Management section"}),(0,i.jsx)("li",{children:"Test system functionality using admin tools"})]})]})})]})}},3783:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{v:()=>o});var s=n(5043),a=n(5114),i=e([a]);a=(i.then?(await i)():i)[0];const o=function(e){let{limit:t=20}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,r]=(0,s.useState)([]),[i,o]=(0,s.useState)(!0),[l,c]=(0,s.useState)(null);return(0,s.useEffect)(()=>{if(!e)return;o(!0);const n=(0,a.Y5)(e,e=>{let{reviews:t,error:n}=e;n?c(n):r(t),o(!1)},{limit:t});return()=>n&&n()},[e,t]),{reviews:n,loading:i,error:l}};r()}catch(o){r(o)}})},3842:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{Ot:()=>m,pg:()=>u});var s=n(5472),a=n(8426),i=n(5491),o=e([i]);i=(o.then?(await o)():o)[0];const l=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{if(!a.db)throw new Error("Firestore not initialized");let n;n=t?(0,s.P)((0,s.rJ)(a.db,"enrollments"),(0,s._M)("courseId","==",e),(0,s._M)("batchNumber","==",t),(0,s._M)("status","==","enrolled")):(0,s.P)((0,s.rJ)(a.db,"enrollments"),(0,s._M)("courseId","==",e),(0,s._M)("status","==","enrolled"));const r=await(0,s.GG)(n);return{success:!0,count:r.size}}catch(n){return{success:!1,error:n.message,count:0}}},c=async e=>{try{if(!a.db)throw new Error("Firestore not initialized");const t=(0,s.P)((0,s.rJ)(a.db,"course_reviews"),(0,s._M)("courseId","==",e)),n=await(0,s.GG)(t),r=[];
2n.forEach(e=>{const t=e.data();t.rating&&"number"===typeof t.rating&&r.push(t.rating)});const i=r.length;let o=0;if(i>0){o=r.reduce((e,t)=>e+t,0)/i}return{success:!0,averageRating:parseFloat(o.toFixed(1)),reviewCount:i,hasReviews:i>0}}catch(t){return{success:!1,error:t.message,averageRating:0,reviewCount:0,hasReviews:!1}}},u=async e=>{try{const[t,n]=await Promise.all([l(e),c(e)]);return{success:!0,stats:{enrollmentCount:t.success?t.count:0,averageRating:n.success?n.averageRating:0,reviewCount:n.success?n.reviewCount:0,hasReviews:!!n.success&&n.hasReviews},errors:{enrollment:t.success?null:t.error,rating:n.success?null:n.error}}}catch(t){return{success:!1,error:t.message,stats:{enrollmentCount:0,averageRating:0,reviewCount:0,hasReviews:!1}}}},d=(e,t)=>{if(!a.db)return t({count:0,error:"Firestore not initialized"}),()=>{};try{const n=(0,s.P)((0,s.rJ)(a.db,"enrollments"),(0,s._M)("courseId","==",e),(0,s._M)("status","==","enrolled"));return(0,s.aQ)(n,e=>{const n=e.size;t({count:n,error:null})},e=>{t({count:0,error:e.message})})}catch(n){return t({count:0,error:n.message}),()=>{}}},h=(e,t)=>{if(!a.db)return t({averageRating:0,reviewCount:0,hasReviews:!1,error:"Firestore not initialized"}),()=>{};try{const n=(0,s.P)((0,s.rJ)(a.db,"course_reviews"),(0,s._M)("courseId","==",e));return(0,s.aQ)(n,e=>{const n=[];e.forEach(e=>{const t=e.data();t.rating&&"number"===typeof t.rating&&n.push(t.rating)});const r=n.length;let s=0;if(r>0){const e=n.reduce((e,t)=>e+t,0);s=parseFloat((e/r).toFixed(1))}t({averageRating:s,reviewCount:r,hasReviews:r>0,error:null})},e=>{t({averageRating:0,reviewCount:0,hasReviews:!1,error:e.message})})}catch(n){return t({averageRating:0,reviewCount:0,hasReviews:!1,error:n.message}),()=>{}}},m=(e,t)=>{let n=()=>{},r=()=>{},s={count:0,error:null},a={averageRating:0,reviewCount:0,hasReviews:!1,error:null};const i=()=>{t({enrollmentCount:s.count,averageRating:a.averageRating,reviewCount:a.reviewCount,hasReviews:a.hasReviews,errors:{enrollment:s.error,rating:a.error}})};return n=d(e,e=>{s=e,i()}),r=h(e,e=>{a=e,i()}),()=>{n(),r()}};r()}catch(l){r(l)}})},3893:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(2555),s=n(5043),a=n(5472),i=n(8426);const o=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{if(!i.db)throw new Error("Firestore not initialized");const{searchTerm:s="",searchFields:o=[],filters:c={},orderByField:u="createdAt",orderDirection:d="desc",limitCount:h=100,exactMatch:m=!1,caseSensitive:p=!1}=t;let f=(0,a.rJ)(i.db,e);if(s&&s.trim())f=(0,a.P)(f,(0,a.AB)(1e3));else{const t=[];if(Object.entries(c).forEach(e=>{let[n,r]=e;null!==r&&void 0!==r&&""!==r&&t.push((0,a._M)(n,"==",r))}),u)try{t.push((0,a.My)(u,d))}catch(n){}if(t.push((0,a.AB)(h)),t.length>0)try{f=(0,a.P)(f,...t)}catch(n){f=(0,a.P)((0,a.rJ)(i.db,e),(0,a.AB)(h))}}const g=await(0,a.GG)(f),v=[];g.forEach(e=>{v.push((0,r.A)({id:e.id},e.data()))});let y=v;if(s&&s.trim()&&o.length>0){const e=p?s.trim():s.trim().toLowerCase();y=v.filter(t=>o.some(n=>{const r=l(t,n);if(!r)return!1;const s=p?r.toString():r.toString().toLowerCase();return m?s===e:s.includes(e)}))}return{success:!0,results:y,totalCount:y.length,hasMore:g.docs.length===(s?1e3:h)}}catch(s){return{success:!1,error:s.message,results:[],totalCount:0}}},l=(e,t)=>t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:null,e),c=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["users","coupons","emails_sent","forum_threads","enrollments","payments","coupon_usage","course_reviews"];try{const n=t.map(async t=>{let n=[];switch(t){case"users":n=["email","displayName","firstName","lastName"];break;case"coupons":n=["code","name","description","targetUserEmail"];break;case"emails_sent":n=["recipientEmail","recipientName","subject","courseTitle"];break;case"forum_threads":n=["title","content","authorName"];break;case"enrollments":n=["userEmail","userName","courseId","courseTitle"];break;case"payments":n=["userEmail","courseId","courseTitle","paymentId"];break;case"coupon_usage":n=["couponCode","userEmail","courseId","paymentId"];break;case"course_reviews":n=["userName","userEmail","courseId","courseTitle","comment"];break;default:n=["name","title","email"]}const s=await o(t,{searchTerm:e,searchFields:n,limitCount:20});return(0,r.A)({collection:t},s)}),s=await Promise.all(n);return{success:!0,results:s.filter(e=>e.success),errors:s.filter(e=>!e.success)}}catch(n){return{success:!1,error:n.message,results:[]}}};var u=n(579);const d=()=>
2{const[e,t]=(0,s.useState)(""),[n,o]=(0,s.useState)([]),[l,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(""),p=async()=>{try{const e=await(0,a.GG)((0,a.rJ)(i.db,"coupons")),t=[];return e.forEach(e=>{const n=e.data();t.push((0,r.A)({id:e.id},n)),n.code}),t}catch(h){throw h}},f=async()=>{if(e.trim()){d(!0),m("");try{await p();const t=await c(e);t.success?o(t.results):m(t.error)}catch(t){m("Search failed: "+t.message)}finally{d(!1)}}else o([])},g=(e,t)=>{return null===t||void 0===t?"null":"object"===typeof t&&t.toDate?(n=t)?n.toDate?n.toDate().toLocaleString():new Date(n).toLocaleString():"N/A":"object"===typeof t?JSON.stringify(t,null,2):String(t);var n};return(0,u.jsxs)("div",{style:{padding:"20px",maxWidth:"1400px",margin:"0 auto"},children:[(0,u.jsx)("h2",{children:"\ud83d\udd0d Search All Collections"}),(0,u.jsx)("p",{style:{color:"#666",marginBottom:"20px"},children:"Search across: users, coupons, emails_sent, forum_threads, enrollments, payments, coupon_usage, course_reviews"}),(0,u.jsxs)("div",{style:{marginBottom:"20px",display:"flex",gap:"10px"},children:[(0,u.jsx)("input",{type:"text",value:e,onChange:e=>t(e.target.value),onKeyPress:e=>{"Enter"===e.key&&f()},placeholder:"Search across all collections... (try: C4GHPCLDMF8PH9P6)",style:{flex:1,padding:"10px",border:"1px solid #ccc",borderRadius:"4px",fontSize:"16px"}}),(0,u.jsx)("button",{onClick:f,disabled:l,style:{padding:"10px 20px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"4px",cursor:l?"not-allowed":"pointer",fontSize:"16px"},children:l?"Searching...":"Search"}),(0,u.jsx)("button",{onClick:p,style:{padding:"10px 20px",backgroundColor:"#28a745",color:"white",border:"none",borderRadius:"4px",cursor:"pointer",fontSize:"16px"},children:"Test Coupons"})]}),(0,u.jsxs)("div",{style:{marginBottom:"20px",color:"#666",fontSize:"14px"},children:["\ud83d\udca1 ",(0,u.jsx)("strong",{children:"Debug tip:"})," Open browser console (F12) to see detailed search logs"]}),h&&(0,u.jsxs)("div",{style:{color:"red",backgroundColor:"#ffebee",padding:"10px",borderRadius:"4px",marginBottom:"20px"},children:["Error: ",h]}),0===n.length&&e.trim()&&!l&&(0,u.jsxs)("div",{style:{color:"#666",backgroundColor:"#f5f5f5",padding:"20px",borderRadius:"4px",textAlign:"center"},children:['No results found for "',e,'"']}),n.map((e,t)=>(0,u.jsxs)("div",{style:{marginBottom:"30px"},children:[(0,u.jsxs)("h3",{style:{color:"#333",borderBottom:"2px solid #007bff",paddingBottom:"10px",marginBottom:"15px"},children:["Collection: ",e.collection," (",e.totalCount," results)"]}),e.results.map((e,t)=>(0,u.jsxs)("div",{style:{border:"1px solid #ddd",borderRadius:"4px",marginBottom:"15px",backgroundColor:"#fafafa"},children:[(0,u.jsxs)("div",{style:{backgroundColor:"#007bff",color:"white",padding:"8px 12px",fontWeight:"bold",borderRadius:"4px 4px 0 0"},children:["Document ID: ",e.id]}),(0,u.jsx)("div",{style:{padding:"12px"},children:(0,u.jsx)("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:"14px"},children:(0,u.jsx)("tbody",{children:Object.entries(e).filter(e=>{let[t]=e;return"id"!==t}).map(e=>{let[t,n]=e;return(0,u.jsxs)("tr",{style:{borderBottom:"1px solid #eee"},children:[(0,u.jsx)("td",{style:{padding:"8px",fontWeight:"bold",backgroundColor:"#f8f9fa",width:"200px",verticalAlign:"top"},children:t}),(0,u.jsx)("td",{style:{padding:"8px",wordBreak:"break-word",maxWidth:"400px"},children:(0,u.jsx)("pre",{style:{margin:0,whiteSpace:"pre-wrap",fontFamily:"monospace",fontSize:"12px",maxHeight:"200px",overflow:"auto"},children:g(0,n)})})]},t)})})})})]},e.id||t))]},t))]})}},4027:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>d});var s=n(5043),a=n(342),i=n(7010),o=n(9412),l=n(5511),c=(n(7210),n(579)),u=e([i,o,l]);[i,o,l]=u.then?(await u)():u;const d=()=>{const{user:e}=(0,a.A)(),[t,n]=(0,s.useState)("All"),[r,u]=(0,s.useState)(["All"]),{courses:d,loading:h,error:m}=(0,o.A8)(),{allEnrollments:p}=(0,l.x)();(0,s.useEffect)(()=>{if(d&&d.length>0){const e=["All",...new Set(d.map(e=>e.category).filter(Boolean))];u(e)}},[d]);const f="All"===t?d:d.filter(e=>e.category===t);return h?(0,c.jsx)("div",{className:"courses-page-container",children:(0,c.jsxs)("div",{className:"courses-loading",children:[(0,c.jsx)("div",{className:"spinner"}),(0,c.jsx)("p",{children:"Loading courses..."})]})}):m?(0,c.jsx)("div",{className:"courses-page-container",children:(0,c.jsxs)("div",{className:"courses-error",children:[(0,c.jsx)("h2",{children:"Error Loading Courses"}),(0,c.jsx)("p",{children:m})]})}):(0,c.jsxs)("div",{className:"courses-page-container",children:[(0,c.jsxs)("div",{className:"courses-header",children:[(0,c.jsx)("h1",{className:"courses-title",children:"Available Courses"}),(0,c.jsxs)("p",{className:"courses-subtitle",children:["Discover our comprehensive collection of AI courses designed to take you from beginner to expert.",!e&&" Login to enroll and track y
2our progress!"]})]}),(0,c.jsx)("div",{className:"courses-filters",children:r.map(e=>(0,c.jsx)("button",{className:"filter-btn ".concat(t===e?"active":""),onClick:()=>n(e),children:e},e))}),(0,c.jsx)("div",{className:"courses-grid",children:f.map(t=>{return(0,c.jsx)(i.A,{course:t,isEnrolled:(n=t.id,!(!e||!p)&&p.some(e=>e.courseId===n))},t.id);var n})})]})};r()}catch(d){r(d)}})},4050:()=>{},4058:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(2555),s=n(5043),a=n(4366),i=n(342),o=n(579);const l=()=>{const[e,t]=(0,s.useState)({email:"",password:""}),[n,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[d,h]=(0,s.useState)(""),[m,p]=(0,s.useState)(""),[f,g]=(0,s.useState)(!1),{signInWithEmail:v,signInWithGoogle:y,resendVerificationEmail:b}=(0,i.A)(),x=(0,a.Zp)(),w=(0,a.zy)(),[N]=(0,a.ok)();(0,s.useEffect)(()=>{var e;const t=N.get("message"),n=N.get("verified"),r=N.get("emailVerified"),s=null===(e=w.state)||void 0===e?void 0:e.from;s&&"/login"!==s.pathname?p("Please log in to access this page."):"verify-email"===t?p("Registration successful! Please check your email and click the verification link before signing in. If you don't see the email, please check your **SPAM**/junk folder."):"true"!==n&&"true"!==r||p("Email verified successfully! You can now sign in.")},[N,w]);const j=e=>{const{name:n,value:s}=e.target;t(e=>(0,r.A)((0,r.A)({},e),{},{[n]:s})),d&&h(""),f&&g(!1)};return(0,o.jsx)("div",{className:"login-page-container",children:(0,o.jsxs)("div",{className:"login-card",children:[(0,o.jsxs)("div",{className:"login-header",children:[(0,o.jsx)("h1",{className:"login-title",children:"Welcome Back"}),(0,o.jsx)("p",{className:"login-subtitle",children:"Sign in to your account"})]}),d&&(0,o.jsx)("div",{className:"login-error-message",children:d}),m&&(0,o.jsx)("div",{className:"login-success-message",children:m}),(0,o.jsxs)("button",{type:"button",onClick:async()=>{u(!0),h(""),p("");const e=await y();if(e.success){var t,n;const e=(null===(t=w.state)||void 0===t||null===(n=t.from)||void 0===n?void 0:n.pathname)||"/dashboard";x(e)}else h(e.error);u(!1)},disabled:c,className:"google-sign-in-button",children:[(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:[(0,o.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,o.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,o.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,o.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),c?"Signing in...":"Continue with Google"]}),(0,o.jsxs)("div",{className:"divider-container",children:[(0,o.jsx)("hr",{className:"divider-line"}),(0,o.jsx)("span",{className:"divider-text",children:"or"}),(0,o.jsx)("hr",{className:"divider-line"})]}),(0,o.jsxs)("form",{onSubmit:async t=>{t.preventDefault(),u(!0),h(""),p("");const n=await v(e.email,e.password);if(n.success){var r,s;const e=(null===(r=w.state)||void 0===r||null===(s=r.from)||void 0===s?void 0:s.pathname)||"/dashboard";x(e)}else h(n.error),n.requiresVerification?(g(!0),p("Need to resend verification email? Use the 'Resend Verification' button below. Please check your **SPAM**/junk folder if you don't see the email.")):g(!1);u(!1)},className:"login-form",children:[(0,o.jsxs)("div",{className:"form-field",children:[(0,o.jsx)("label",{className:"form-label",children:"Email Address"}),(0,o.jsx)("input",{type:"email",name:"email",value:e.email,onChange:j,placeholder:"Enter your email",required:!0,className:"form-input"})]}),(0,o.jsxs)("div",{className:"form-field",children:[(0,o.jsx)("label",{className:"form-label",children:"Password"}),(0,o.jsxs)("div",{className:"password-field-container",children:[(0,o.jsx)("input",{type:n?"text":"password",name:"password",value:e.password,onChange:j,placeholder:"Enter your password",required:!0,className:"form-input"}),(0,o.jsx)("button",{type:"button",onClick:()=>l(!n),className:"password-toggle-button",children:n?"\ud83d\udc41\ufe0f":"\ud83d\udc41\ufe0f\u200d\ud83d\udde8\ufe0f"})]})]}),(0,o.jsx)("div",{className:"forgot-password-container",children:(0,o.jsx)(a.N_,{to:"/forgot-password",className:"forgot-password-link",children:"Forgot your password?"})}
2),(0,o.jsx)("button",{type:"submit",className:"btn",disabled:c,children:c?"Signing in...":"Sign In"}),f&&(0,o.jsx)("button",{type:"button",onClick:async()=>{if(!e.email||!e.password)return void h("Please enter both email and password to resend verification.");u(!0),h(""),p("Sending verification email...");const t=await b(e.email,e.password);t.success?(p(t.message),g(!1)):(h(t.error),p("")),u(!1)},disabled:c,className:"btn btn-secondary",style:{marginTop:"15px",backgroundColor:"#6c757d",border:"none"},children:c?"Sending...":"Resend Verification Email"})]}),(0,o.jsx)("div",{className:"login-footer",children:(0,o.jsxs)("p",{className:"footer-text",children:["Don't have an account?"," ",(0,o.jsx)(a.N_,{to:"/register",className:"footer-link",children:"Sign up"})]})})]})})}},4111:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>_});n(5043);var s=n(4366),a=n(5187),i=n(8114),o=n(6990),l=n(1422),c=n(1756),u=n(4027),d=n(9277),h=n(9772),m=n(4941),p=n(6263),f=n(7116),g=n(4058),v=n(7677),y=n(8996),b=n(5426),x=n(6682),w=n(6798),N=n(1977),j=n(655),E=(n(5866),n(7106),n(4050),n(579)),S=e([c,u,d,h,m,x,j]);function k(){return(0,E.jsx)(a.OJ,{children:(0,E.jsx)(s.Kd,{children:(0,E.jsxs)("div",{className:"app-container",children:[(0,E.jsx)(i.A,{}),(0,E.jsx)("main",{children:(0,E.jsxs)(s.BV,{children:[(0,E.jsx)(s.qh,{path:"/",element:(0,E.jsx)(c.A,{})}),(0,E.jsx)(s.qh,{path:"/courses",element:(0,E.jsx)(u.A,{})}),(0,E.jsx)(s.qh,{path:"/courses/:courseId",element:(0,E.jsx)(d.A,{})}),(0,E.jsx)(s.qh,{path:"/course/:courseId/dashboard",element:(0,E.jsx)(l.A,{children:(0,E.jsx)(h.A,{})})}),(0,E.jsx)(s.qh,{path:"/dashboard",element:(0,E.jsx)(l.A,{children:(0,E.jsx)(m.A,{})})}),(0,E.jsx)(s.qh,{path:"/contact",element:(0,E.jsx)(p.A,{})}),(0,E.jsx)(s.qh,{path:"/about",element:(0,E.jsx)(f.A,{})}),(0,E.jsx)(s.qh,{path:"/about-us",element:(0,E.jsx)(f.A,{})}),(0,E.jsx)(s.qh,{path:"/forums",element:(0,E.jsx)(w.A,{})}),(0,E.jsx)(s.qh,{path:"/forums/thread/:threadId",element:(0,E.jsx)(N.A,{})}),(0,E.jsx)(s.qh,{path:"/login",element:(0,E.jsx)(g.A,{})}),(0,E.jsx)(s.qh,{path:"/register",element:(0,E.jsx)(v.A,{})}),(0,E.jsx)(s.qh,{path:"/verify-email",element:(0,E.jsx)(y.A,{})}),(0,E.jsx)(s.qh,{path:"/forgot-password",element:(0,E.jsx)(b.A,{})}),(0,E.jsx)(s.qh,{path:"/admin/dashboard",element:(0,E.jsx)(l.A,{children:(0,E.jsx)(x.A,{})})}),(0,E.jsx)(s.qh,{path:"/admin/courses",element:(0,E.jsx)(l.A,{children:(0,E.jsx)(j.A,{})})}),(0,E.jsx)(s.qh,{path:"*",element:(0,E.jsx)(s.C5,{to:"/",replace:!0})})]})}),(0,E.jsx)(o.A,{})]})})})}[c,u,d,h,m,x,j]=S.then?(await S)():S;const _=k;r()}catch(C){r(C)}})},4241:(e,t,n)=>{n.d(t,{A:()=>d});var r=n(2555),s=n(5043),a=n(5472),i=n(8426),o=n(762),l=n(3387),c=n(342),u=n(579);const d=()=>{const{user:e}
2=(0,c.A)(),[t,n]=(0,s.useState)([]),[d,h]=(0,s.useState)(new Map),[m,p]=(0,s.useState)(!1),[f,g]=(0,s.useState)(null),[v,y]=(0,s.useState)(""),[b,x]=(0,s.useState)(o.iK.STUDENT),[w,N]=(0,s.useState)(""),[j,E]=(0,s.useState)(""),[S,C]=(0,s.useState)([]),[k,_]=(0,s.useState)(null),[A,T]=(0,s.useState)(!1);(0,s.useEffect)(()=>{I()},[]),(0,s.useEffect)(()=>{if(!j.trim())return void C(t);const e=t.filter(e=>{const t=e.displayName||"",n=e.email||"",r=j.toLowerCase();return t.toLowerCase().includes(r)||n.toLowerCase().includes(r)});C(e)},[j,t]);const I=async()=>{p(!0),g(null);try{const e=await(0,l.CF)();if(e.success){n(e.users);const t=e.users.map(async e=>{const t=await(0,o.uG)(e.id);return[e.id,t.role]}),r=await Promise.all(t),s=new Map(r);h(s)}else g(e.error),await P()}catch(e){g(e.message),await P()}finally{p(!1)}},P=async()=>{try{const[e,t]=await Promise.all([(0,a.GG)((0,a.P)((0,a.rJ)(i.db,"enrollments"))),(0,a.GG)((0,a.P)((0,a.rJ)(i.db,"payments")))]),r=new Map;e.docs.forEach(e=>{const t=e.data();t.userId&&r.set(t.userId,{id:t.userId,uid:t.userId,displayName:t.userId,email:null,source:"enrollment"})}),t.docs.forEach(e=>{const t=e.data();if(t.userId){const e=r.get(t.userId);r.set(t.userId,{id:t.userId,uid:t.userId,displayName:t.payerEmail||(null===e||void 0===e?void 0:e.displayName)||t.userId,email:t.payerEmail,source:e?"both":"payment"})}});const s=Array.from(r.values());n(s);const l=s.map(async e=>{const t=await(0,o.uG)(e.id);return[e.id,t.role]}),c=await Promise.all(l),u=new Map(c);h(u)}catch(e){g(e.message)}};return(0,u.jsxs)("div",{className:"admin-role-manager",children:[(0,u.jsx)("h3",{children:"\ud83d\udc51 Role Management"}),m&&(0,u.jsx)("p",{children:"Loading users..."}),f&&(0,u.jsxs)("p",{className:"admin-role-error",children:["\u274c ",f]}),w&&(0,u.jsxs)("p",{className:"admin-role-success",children:["\u2705 ",w]}),(0,u.jsxs)("div",{className:"admin-role-form",children:[(0,u.jsxs)("div",{className:"form-group",children:[(0,u.jsx)("label",{htmlFor:"user-search",children:"Search User *"}),(0,u.jsxs)("div",{className:"user-search-container",children:[(0,u.jsx)("input",{type:"text",id:"user-search",value:j,onChange:e=>{E(e.target.value),T(!0),e.target.value.trim()||(_(null),y(""))},onFocus:()=>T(!0),placeholder:"Search by name or email...",className:"admin-role-input",required:!0}),A&&S.length>0&&(0,u.jsx)("div",{className:"user-dropdown",children:S.slice(0,10).map(e=>(0,u.jsxs)("div",{className:"user-option",onClick:()=>(e=>{_(e),y(e.id||e.uid),E(e.displayName||e.email),T(!1)})(e),children:[(0,u.jsx)("div",{className:"user-name",children:e.displayName||"No Name"}),(0,u.jsx)("div",{className:"user-email",children:e.email}),d.get(e.id||e.uid)&&(0,u.jsxs)("div",{className:"user-current-role",children:["Current: ",d.get(e.id||e.uid)]})]},e.id||e.uid))})]}),k&&(0,u.jsxs)("div",{className:"selected-user-info",children:[(0,u.jsx)("p",{children:(0,u.jsx)("strong",{children:"Selected User:"})}),(0,u.jsxs)("p",{children:[(0,u.jsx)("strong",{children:"Name:"})," ",k.displayName||"No Name"]}),(0,u.jsxs)("p",{children:[(0,u.jsx)("strong",{children:"Email:"})," ",k.email]}),d.get(k.id||k.uid)&&(0,u.jsxs)("p",{children:[(0,u.jsx)("strong",{children:"Current Role:"})," ",d.get(k.id||k.uid)]})]})]}),(0,u.jsxs)("select",{value:b,onChange:e=>x(e.target.value),className:"admin-role-select",children:[(0,u.jsx)("option",{value:o.iK.STUDENT,children:"Student"}),(0,u.jsx)("option",{value:o.iK.INSTRUCTOR,children:"Instructor"}),(0,u.jsx)("option",{value:o.iK.ADMIN,children:"Admin"})]}),(0,u.jsx)("button",{onClick:async()=>{if(v&&b)if(k){p(!0),g(null),N(null);try{const t=k.email||k.displayName||"No email available",n=await(0,o.ZD)(v,b,e.uid,t);if(n.success){const n=await(0,o.uG)(v);h(e=>new Map(e).set(v,n.role)),await(0,o.zQ)("assign_role",v,e.uid,{newRole:b,userEmail:t,timestamp:(new Date).toISOString()}),N("Successfully assigned ".concat(b," role to ").concat(t)),y(""),_(null),E(""),x(o.iK.STUDENT)}else g("Error: ".concat(n.error))}catch(t){g("Error assigning role: ".concat(t.message))}finally{p(!1)}}else g("Please select a valid user from the dropdown");else g("Please select both a user and a role")},disabled:!v||!b||m,className:"admin-role-button ".concat(v&&b&&!m?"":"loading"),children:m?"Assigning...":"Assign Role"}),(0,u.jsx)("button",{onClick:async()=>{p(!0),g(null),N(null);try{const e=await(0,a.GG)((0,a.rJ)(i.db,"user_roles"));let n=0;const s=e.docs.map(async e=>{const s=e.data(),o=e.id,l=t.find(e=>(e.id||e.uid)===o),c=(null===l||void 0===l?void 0:l.email)||s.userEmail||"Email not available";if(!s.userEmail&&"Email not available"!==c){const e=(0,a.H9)(i.db,"user_roles",o);await(0,a.BN)(e,(0,r.A)((0,r.A)({},s),{},{userEmail:c,updatedAt:(0,a.O5)()}))}const u=(0,a.H9)(i.db,"users",o);return await(0,a.BN)(u,{role:s.role,email:c,updatedAt:(0,a.O5)()},{merge:!0}),n++,{userId:o,role:s.role,email:c}});await Promise.all(s),N("Successfully synced ".concat(n," user roles with email information")),await I()}catch(e){g("Error syncing user roles: ".concat(e.message))}finally{p(!1)}},disabled:m,className:"admin-role-button sync-button ".concat(m?"loading":""),title:"Sync roles from user_roles collection to users collection and update email information",children:m?"Syncing...":"\ud83d\udd04 Sync All Roles"})]}),"            ",t.length>0&&(0,u.jsxs)("div",{className:"admin-current-roles",children:[(0,u.jsx)("h4",{children:"Current User Roles:"}),(0,u.jsx)("div",{className:"admin-roles-list",children:t.map(e=>(0,u.jsxs)("div",{className:"admin-role-user-item",children:[(0,u.jsxs)("div",{className:"admin-role-user-info",children:[(0,u.jsx)("div",{className:"admin-role-user-name",children:e.displayName||e.email}),e.email&&(0,u.jsxs)("div",{className:"admin-role-user-email",children:["(",e.email,")"]}),(0,u.jsxs)("div",{className:"admin-role-user-id",children:["ID: ",e.id||e.uid]})]}),(0,u.jsx)("div",{className:"admin-role-badge ".concat((d.get(e.id||e.uid)||"student").toLowerCase()),children:d.get(e.id||e.uid)||"student"})]},e.id||e.uid))})]}),(0,u.jsxs)("div",{className:"admin-setup-note",children:[(0,u.jsx)("strong",{children:"\u26a0\ufe0f Quick Setup:"}),(0,u.jsx)("br",{}),"To make yourself an admin immediately:",(0,u.jsx)("br",{}),"1. Ensure you have an account and have logged in at least once",(0,u.jsx)("br",{}),"2. Use the Firestore console to manually add your role",(0,u.jsx)("br",{}),"3. Or run the setup script below to create your admin role"]})]})}},4288:(e,t)=>
2{var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,g={};function v(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}function y(){}function b(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||p}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},y.prototype=v.prototype;var x=b.prototype=new y;x.constructor=b,f(x,v.prototype),x.isPureReactComponent=!0;var w=Array.isArray,N={H:null,A:null,T:null,S:null,V:null},j=Object.prototype.hasOwnProperty;function E(e,t,r,s,a,i){return r=i.ref,{$$typeof:n,type:e,key:t,ref:void 0!==r?r:null,props:i}}function S(e){return"object"===typeof e&&null!==e&&e.$$typeof===n}var C=/\/+/g;function k(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function _(){}function A(e,t,s,a,i){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var l,c,u=!1;if(null===e)u=!0;else switch(o){case"bigint":case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case n:case r:u=!0;break;case h:return A((u=e._init)(e._payload),t,s,a,i)}}if(u)return i=i(e),u=""===a?"."+k(e,0):a,w(i)?(s="",null!=u&&(s=u.replace(C,"$&/")+"/"),A(i,t,s,"",function(e){return e})):null!=i&&(S(i)&&(l=i,c=s+(null==i.key||e&&e.key===i.key?"":(""+i.key).replace(C,"$&/")+"/")+u,i=E(l.type,c,void 0,0,0,l.props)),t.push(i)),1;u=0;var d,p=""===a?".":a+":";if(w(e))for(var f=0;f<e.length;f++)u+=A(a=e[f],t,s,o=p+k(a,f),i);else if("function"===typeof(f=null===(d=e)||"object"!==typeof d?null:"function"===typeof(d=m&&d[m]||d["@@iterator"])?d:null))for(e=f.call(e),f=0;!(a=e.next()).done;)u+=A(a=a.value,t,s,o=p+k(a,f++),i);else if("object"===o){if("function"===typeof e.then)return A(function(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch("string"===typeof e.status?e.then(_,_):(e.status="pending",e.then(function(t){"pending"===e.status&&(e.status="fulfilled",e.value=t)},function(t){"pending"===e.status&&(e.status="rejected",e.reason=t)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}(e),t,s,a,i);throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.")}return u}function T(e,t,n){if(null==e)return e;var r=[],s=0;return A(e,r,"","",function(e){return t.call(n,e,s++)}),r}function I(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var P="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function R(){}t.Children={map:T,forEach:function(e,t,n){T(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return T(e,function(){t++}),t},toArray:function(e){return T(e,function(e){return e})||[]},only:function(e){if(!S(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=v,t.Fragment=s,t.Profiler=i,t.PureComponent=b,t.StrictMode=a,t.Suspense=u,t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,t.__COMPILER_RUNTIME={__proto__:null,c:function(e){return N.H.useMemoCache(e)}}
2,t.cache=function(e){return function(){return e.apply(null,arguments)}},t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("The argument must be a React element, but you passed "+e+".");var r=f({},e.props),s=e.key;if(null!=t)for(a in void 0!==t.ref&&void 0,void 0!==t.key&&(s=""+t.key),t)!j.call(t,a)||"key"===a||"__self"===a||"__source"===a||"ref"===a&&void 0===t.ref||(r[a]=t[a]);var a=arguments.length-2;if(1===a)r.children=n;else if(1<a){for(var i=Array(a),o=0;o<a;o++)i[o]=arguments[o+2];r.children=i}return E(e.type,s,void 0,0,0,r)},t.createContext=function(e){return(e={$$typeof:l,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider=e,e.Consumer={$$typeof:o,_context:e},e},t.createElement=function(e,t,n){var r,s={},a=null;if(null!=t)for(r in void 0!==t.key&&(a=""+t.key),t)j.call(t,r)&&"key"!==r&&"__self"!==r&&"__source"!==r&&(s[r]=t[r]);var i=arguments.length-2;if(1===i)s.children=n;else if(1<i){for(var o=Array(i),l=0;l<i;l++)o[l]=arguments[l+2];s.children=o}if(e&&e.defaultProps)for(r in i=e.defaultProps)void 0===s[r]&&(s[r]=i[r]);return E(e,a,void 0,0,0,s)},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=S,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:I}},t.memo=function(e,t){return{$$typeof:d,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=N.T,n={};N.T=n;try{var r=e(),s=N.S;null!==s&&s(n,r),"object"===typeof r&&null!==r&&"function"===typeof r.then&&r.then(R,P)}catch(a){P(a)}finally{N.T=t}},t.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},t.use=function(e){return N.H.use(e)},t.useActionState=function(e,t,n){return N.H.useActionState(e,t,n)},t.useCallback=function(e,t){return N.H.useCallback(e,t)},t.useContext=function(e){return N.H.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e,t){return N.H.useDeferredValue(e,t)},t.useEffect=function(e,t,n){var r=N.H;if("function"===typeof n)throw Error("useEffect CRUD overload is not enabled in this build of React.");return r.useEffect(e,t)},t.useId=function(){return N.H.useId()},t.useImperativeHandle=function(e,t,n){return N.H.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return N.H.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return N.H.useLayoutEffect(e,t)},t.useMemo=function(e,t){return N.H.useMemo(e,t)},t.useOptimistic=function(e,t){return N.H.useOptimistic(e,t)},t.useReducer=function(e,t,n){return N.H.useReducer(e,t,n)},t.useRef=function(e){return N.H.useRef(e)},t.useState=function(e){return N.H.useState(e)},t.useSyncExternalStore=function(e,t,n){return N.H.useSyncExternalStore(e,t,n)},t.useTransition=function(){return N.H.useTransition()},t.version="19.1.0"},4358:(e,t)=>{const n=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,r=/^[\u0021-\u003A\u003C-\u007E]*$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,o=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function l(e,t,n){do{const n=e.charCodeAt(t);if(32!==n&&9!==n)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){const n=e.charCodeAt(--t);if(32!==n&&9!==n)return t+1}return n}function u(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},4366:(e,t,n)=>{function r(e,t){if(null==e)return{};var n,r,s=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}n.d(t,{Kd:()=>dt,N_:()=>mt,C5:()=>Ce,qh:()=>ke,BV:()=>Ae,zy:()=>oe,Zp:()=>ue,g:()=>de,ok:()=>vt});var s=n(2555),a=n(5043);n(4358);const i=["sri"],o=["page"],l=["page","matches"],c=["onClick","discover","prefetch","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],u=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],d=["discover","fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","viewTransition"];var h="popstate";function m(){return x(function(e,t){let{pathname:n,search:r,hash:s}=e.location;return v("",{pathname:n,search:r,hash:s},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"===typeof t?t:y(t)},null,arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}function p(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function f(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function g(e,t){return{usr:e.state,key:e.key,idx:t}}function v(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3?arguments[3]:void 0;return(0,s.A)((0,s.A)({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?b(t):t),{},{state:n,key:t&&t.key||r||Math.random().toString(36).substring(2,10)})}function y(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function b(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function x(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l="POP",c=null,u=d();function d(){return(o.state||{idx:null}).idx}function m(){l="POP";let e=d(),t=null==e?null:e-u;u=e,c&&c({action:l,location:f.location,delta:t})}function p(e){return w(e)}null==u&&(u=0,o.replaceState((0,s.A)((0,s.A)({},o.state),{},{idx:u}),""));let f={get action(){return l},get location(){return e(a,o)},listen(e){if(c)throw new Error("A history only accepts one active listener");
2return a.addEventListener(h,m),c=e,()=>{a.removeEventListener(h,m),c=null}},createHref:e=>t(a,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l="PUSH";let r=v(f.location,e,t);n&&n(r,e),u=d()+1;let s=g(r,u),h=f.createHref(r);try{o.pushState(s,"",h)}catch(m){if(m instanceof DOMException&&"DataCloneError"===m.name)throw m;a.location.assign(h)}i&&c&&c({action:l,location:f.location,delta:1})},replace:function(e,t){l="REPLACE";let r=v(f.location,e,t);n&&n(r,e),u=d();let s=g(r,u),a=f.createHref(r);o.replaceState(s,"",a),i&&c&&c({action:l,location:f.location,delta:0})},go:e=>o.go(e)};return f}function w(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n="http://localhost";"undefined"!==typeof window&&(n="null"!==window.location.origin?window.location.origin:window.location.href),p(n,"No window.location.(origin|href) available to create URL");let r="string"===typeof e?e:y(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}new WeakMap;function N(e,t){return j(e,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/",!1)}function j(e,t,n,r){let s=F(("string"===typeof t?b(t):t).pathname||"/",n);if(null==s)return null;let a=E(e);!function(e){e.sort((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n]);return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(a);let i=null;for(let o=0;null==i&&o<a.length;++o){let e=M(s);i=D(a[o],e,r)}return i}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=(e,s,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:s,route:e};i.relativePath.startsWith("/")&&(p(i.relativePath.startsWith(r),'Absolute route path "'.concat(i.relativePath,'" nested under path "').concat(r,'" is not valid. An absolute child route path must start with the combined path of all its parent routes.')),i.relativePath=i.relativePath.slice(r.length));let o=q([r,i.relativePath]),l=n.concat(i);e.children&&e.children.length>0&&(p(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'.concat(o,'".')),E(e.children,t,l,o)),(null!=e.path||e.index)&&t.push({path:o,score:R(o,e.index),routesMeta:l})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!==(n=e.path)&&void 0!==n&&n.includes("?"))for(let r of S(e.path))s(e,t,r);else s(e,t)}),t}function S(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return s?[a,""]:[a];let i=S(r.join("/")),o=[];return o.push(...i.map(e=>""===e?a:[a,e].join("/"))),s&&o.push(...i),o.map(t=>e.startsWith("/")&&""===t?"/":t)}var C=/^:[\w-]+$/,k=3,_=2,A=1,T=10,I=-2,P=e=>"*"===e;function R(e,t){let n=e.split("/"),r=n.length;return n.some(P)&&(r+=I),t&&(r+=_),n.filter(e=>!P(e)).reduce((e,t)=>e+(C.test(t)?k:""===t?A:T),r)}function D(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],{routesMeta:r}=e,s={},a="/",i=[];for(let o=0;o<r.length;++o){let e=r[o],l=o===r.length-1,c="/"===a?t:t.slice(a.length)||"/",u=O({path:e.relativePath,caseSensitive:e.caseSensitive,end:l},c),d=e.route;if(!u&&l&&n&&!r[r.length-1].route.index&&(u=O({path:e.relativePath,caseSensitive:e.caseSensitive,end:!1},c)),!u)return null;
2Object.assign(s,u.params),i.push({params:s,pathname:q([a,u.pathname]),pathnameBase:H(q([a,u.pathnameBase])),route:d}),"/"!==u.pathnameBase&&(a=q([a,u.pathnameBase]))}return i}function O(e,t){"string"===typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=L(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let a=s[0],i=a.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:r.reduce((e,t,n)=>{let{paramName:r,isOptional:s}=t;if("*"===r){let e=o[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const l=o[n];return e[r]=s&&!l?void 0:(l||"").replace(/%2F/g,"/"),e},{}),pathname:a,pathnameBase:i,pattern:e}}function L(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];f("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'.concat(e,'" will be treated as if it were "').concat(e.replace(/\*$/,"/*"),'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "').concat(e.replace(/\*$/,"/*"),'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":""!==e&&"/"!==e&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function M(e){try{return e.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(t){return f(!1,'The URL path "'.concat(e,'" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (').concat(t,").")),e}}function F(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function U(e,t,n,r){return"Cannot include a '".concat(e,"' character in a manually specified `to.").concat(t,"` field [").concat(JSON.stringify(r),"].  Please separate it out to the `to.").concat(n,'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.')}function V(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function z(e){let t=V(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function B(e,t,n){let r,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"string"===typeof e?r=b(e):(r=(0,s.A)({},e),p(!r.pathname||!r.pathname.includes("?"),U("?","pathname","search",r)),p(!r.pathname||!r.pathname.includes("#"),U("#","pathname","hash",r)),p(!r.search||!r.search.includes("#"),U("#","search","hash",r)));let i,o=""===e||""===r.pathname,l=o?"/":r.pathname;if(null==l)i=n;else{let e=t.length-1;if(!a&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}i=e>=0?t[e]:"/"}let c=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"/",{pathname:n,search:r="",hash:s=""}="string"===typeof e?b(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:W(r),hash:G(s)}}(r,i),u=l&&"/"!==l&&l.endsWith("/"),d=(o||"."===l)&&n.endsWith("/");return c.pathname.endsWith("/")||!u&&!d||(c.pathname+="/"),c}var q=e=>e.join("/").replace(/\/\/+/g,"/"),H=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),W=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",G=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";function K(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}var J=["POST","PUT","PATCH","DELETE"],Y=(new Set(J),["GET",...J]);new Set(Y),Symbol("ResetLoaderData");var Q=a.createContext(null);Q.displayName="DataRouter";var $=a.createContext(null);$.displayName="DataRouterState";var X=a.createContext({isTransitioning:!1});X.displayName="ViewTransition";var Z=a.createContext(new Map);Z.displayName="Fetchers";var ee=a.createContext(null);ee.displayName="Await";var te=a.createContext(null);te.displayName="Navigation";var ne=a.createContext(null);ne.displayName="Location";var re=a.createContext({outlet:null,matches:[],isDataRoute:!1});re.displayName="Route";var se=a.createContext(null);se.displayName="RouteError";var ae=!0;function ie(){return null!=a.useContext(ne)}function oe(){return p(ie(),"useLocation() may be used only in the context of a <Router> component."),a.useContext(ne).location}var le="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ce(e){a.useContext(te).static||a.useLayoutEffect(e)}function ue(){let{isDataRoute:e}=a.useContext(re);return e?function(){let{router:e}=xe("useNavigate"),t=Ne("useNavigate"),n=a.useRef(!1);ce(()=>{n.current=!0});let r=a.useCallback(async function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};f(n.current,le),n.current&&("number"===typeof r?e.navigate(r):await e.navigate(r,(0,s.A)({fromRouteId:t},a)))},[e,t]);return r}():function(){p(ie(),"useNavigate() may be used only in the context of a <Router> component.");let e=a.useContext(Q),{basename:t,navigator:n}=a.useContext(te),{matches:r}=a.useContext(re),{pathname:s}=oe(),i=JSON.stringify(z(r)),o=a.useRef(!1);ce(()=>{o.current=!0});let l=a.useCallback(function(r){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(f(o.current,le),!o.current)return;if("number"===typeof r)return void n.go(r);let l=B(r,JSON.parse(i),s,"path"===a.relative);null==e&&"/"!==t&&(l.pathname="/"===l.pathname?t:q([t,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)},[t,n,i,s,e]);return l}()}a.createContext(null);function de(){let{matches:e}=a.useContext(re),t=e[e.length-1];return t?t.params:{}}function he(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{matches:n}=a.useContext(re),{pathname:r}=oe(),s=JSON.stringify(z(n));return a.useMemo(()=>B(e,JSON.parse(s),r,"path"===t),[e,s,r,t])}function me(e,t,n,r){p(ie(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=a.useContext(te),{matches:o}=a.useContext(re),l=o[o.length-1],c=l?l.params:{},u=l?l.pathname:"/",d=l?l.pathnameBase:"/",h=l&&l.route;if(ae){let e=h&&h.path||"";Se(u,!h||e.endsWith("*")||e.endsWith("*?"),'You rendered descendant <Routes> (or called `useRoutes()`) at "'.concat(u,'" (under <Route path="').concat(e,'">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won\'t match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="').concat(e,'"> to <Route path="').concat("/"===e?"*":"".concat(e,"/*"),'">.'))}let m,g=oe();if(t){var v;let e="string"===typeof t?b(t):t;p("/"===d||(null===(v=e.pathname)||void 0===v?void 0:v.startsWith(d)),'When overriding the location using `<Routes location>` or `useRoutes(routes, location)`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "'.concat(d,'" but pathname "').concat(e.pathname,'" was given in the `location` prop.')),m=e}else m=g;let y=m.pathname||"/",x=y;if("/"!==d){let e=d.replace(/^\//,"").split("/");x="/"+y.replace(/^\//,"").split("/").slice(e.length).join("/")}let w=N(e,{pathname:x});ae&&(f(h||null!=w,'No routes matched location "'.concat(m.pathname).concat(m.search).concat(m.hash,'" ')),f(null==w||void 0!==w[w.length-1].route.element||void 0!==w[w.length-1].route.Component||void 0!==w[w.length-1].route.lazy,'Matched leaf route at location "'.concat(m.pathname).concat(m.search).concat(m.hash,'" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.')));let j=ye(w&&w.map(e=>Object.assign({},e,{params:Object.assign({},c,e.params),pathname:q([d,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?d:q([d,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])})),o,n,r);return t&&j?a.createElement(ne.Provider,{value:{location:(0,s.A)({pathname:"/",search:"",hash:"",state:null,key:"default"},m),navigationType:"POP"}},j):j}function pe(){let e=je(),t=K(e)?"".concat(e.status," ").concat(e.statusText):e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},o=null;return ae&&(console.error("Error handled by React Router default ErrorBoundary:",e),o=a.createElement(a.Fragment,null,a.createElement("p",null,"\ud83d\udcbf Hey developer \ud83d\udc4b"),a.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",a.createElement("code",{style:i},"ErrorBoundary")," or"," ",a.createElement("code",{style:i},"errorElement")," prop on your route."))),a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application 
2Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:s},n):null,o)}var fe=a.createElement(pe,null),ge=class extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?a.createElement(re.Provider,{value:this.props.routeContext},a.createElement(se.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ve(e){let{routeContext:t,match:n,children:r}=e,s=a.useContext(Q);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),a.createElement(re.Provider,{value:t},r)}function ye(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(null==e){if(!n)return null;if(n.errors)e=n.matches;else{if(0!==t.length||n.initialized||!(n.matches.length>0))return null;e=n.matches}}let r=e,s=null===n||void 0===n?void 0:n.errors;if(null!=s){let e=r.findIndex(e=>e.route.id&&void 0!==(null===s||void 0===s?void 0:s[e.route.id]));p(e>=0,"Could not find a matching route for errors on route IDs: ".concat(Object.keys(s).join(","))),r=r.slice(0,Math.min(r.length,e+1))}let i=!1,o=-1;if(n)for(let a=0;a<r.length;a++){let e=r[a];if((e.route.HydrateFallback||e.route.hydrateFallbackElement)&&(o=a),e.route.id){let{loaderData:t,errors:s}=n,a=e.route.loader&&!t.hasOwnProperty(e.route.id)&&(!s||void 0===s[e.route.id]);if(e.route.lazy||a){i=!0,r=o>=0?r.slice(0,o+1):[r[0]];break}}}return r.reduceRight((e,l,c)=>{let u,d=!1,h=null,m=null;n&&(u=s&&l.route.id?s[l.route.id]:void 0,h=l.route.errorElement||fe,i&&(o<0&&0===c?(Se("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):o===c&&(d=!0,m=l.route.hydrateFallbackElement||null)));let p=t.concat(r.slice(0,c+1)),f=()=>{let t;return t=u?h:d?m:l.route.Component?a.createElement(l.route.Component,null):l.route.element?l.route.element:e,a.createElement(ve,{match:l,routeContext:{outlet:e,matches:p,isDataRoute:null!=n},children:t})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===c)?a.createElement(ge,{location:n.location,revalidation:n.revalidation,component:h,error:u,children:f(),routeContext:{outlet:null,matches:p,isDataRoute:!0}}):f()},null)}function be(e){return"".concat(e," must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.")}function xe(e){let t=a.useContext(Q);return p(t,be(e)),t}function we(e){let t=a.useContext($);return p(t,be(e)),t}function Ne(e){let t=function(e){let t=a.useContext(re);return p(t,be(e)),t}(e),n=t.matches[t.matches.length-1];return p(n.route.id,"".concat(e,' can only be used on routes that contain a unique "id"')),n.route.id}function je(){var e;let t=a.useContext(se),n=we("useRouteError"),r=Ne("useRouteError");return void 0!==t?t:null===(e=n.errors)||void 0===e?void 0:e[r]}var Ee={};function Se(e,t,n){t||Ee[e]||(Ee[e]=!0,f(!1,n))}a.memo(function(e){let{routes:t,future:n,state:r}=e;return me(t,void 0,r,n)});function Ce(e){let{to:t,replace:n,state:r,relative:s}=e;p(ie(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=a.useContext(te);f(!i,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=a.useContext(re),{pathname:l}=oe(),c=ue(),u=B(t,z(o),l,"path"===s),d=JSON.stringify(u);return a.useEffect(()=>{c(JSON.parse(d),{replace:n,state:r,relative:s})},[c,d,s,n,r]),null}function ke(e){p(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _e(e){let{basename:t="/",children:n=null,location:r,navigationType:s="POP",navigator:i,static:o=!1}=e;p(!ie(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=t.replace(/^\/*/,"/"),c=a.useMemo(()=>({basename:l,navigator:i,static:o,future:{}}),[l,i,o]);"string"===typeof r&&(r=b(r));
2let{pathname:u="/",search:d="",hash:h="",state:m=null,key:g="default"}=r,v=a.useMemo(()=>{let e=F(u,l);return null==e?null:{location:{pathname:e,search:d,hash:h,state:m,key:g},navigationType:s}},[l,u,d,h,m,g,s]);return f(null!=v,'<Router basename="'.concat(l,'"> is not able to match the URL "').concat(u).concat(d).concat(h,"\" because it does not start with the basename, so the <Router> won't render anything.")),null==v?null:a.createElement(te.Provider,{value:c},a.createElement(ne.Provider,{children:n,value:v}))}function Ae(e){let{children:t,location:n}=e;return me(Te(t),n)}a.Component;function Te(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[];return a.Children.forEach(e,(e,r)=>{if(!a.isValidElement(e))return;let s=[...t,r];if(e.type===a.Fragment)return void n.push.apply(n,Te(e.props.children,s));p(e.type===ke,"[".concat("string"===typeof e.type?e.type:e.type.name,"] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>")),p(!e.props.index||!e.props.children,"An index route cannot have child routes.");let i={id:e.props.id||s.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:!0===e.props.hasErrorBoundary||null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=Te(e.props.children,s)),n.push(i)}),n}var Ie="get",Pe="application/x-www-form-urlencoded";function Re(e){return null!=e&&"string"===typeof e.tagName}function De(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return new URLSearchParams("string"===typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}var Oe=null;var Le=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Me(e){return null==e||Le.has(e)?e:(f(!1,'"'.concat(e,'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` and will default to "').concat(Pe,'"')),null)}function Fe(e,t){let n,r,s,a,i;if(Re(o=e)&&"form"===o.tagName.toLowerCase()){let i=e.getAttribute("action");r=i?F(i,t):null,n=e.getAttribute("method")||Ie,s=Me(e.getAttribute("enctype"))||Pe,a=new FormData(e)}else if(function(e){return Re(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return Re(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let i=e.form;if(null==i)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let o=e.getAttribute("formaction")||i.getAttribute("action");if(r=o?F(o,t):null,n=e.getAttribute("formmethod")||i.getAttribute("method")||Ie,s=Me(e.getAttribute("formenctype"))||Me(i.getAttribute("enctype"))||Pe,a=new FormData(i,e),!function(){if(null===Oe)try{new FormData(document.createElement("form"),0),Oe=!1}catch(e){Oe=!0}return Oe}()){let{name:t,type:n,value:r}=e;if("image"===n){let e=t?"".concat(t,"."):"";a.append("".concat(e,"x"),"0"),a.append("".concat(e,"y"),"0")}else t&&a.append(t,r)}}else{if(Re(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Ie,r=null,s=Pe,i=e}var o;return a&&"text/plain"===s&&(i=a,a=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:a,body:i}}function Ue(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}async function Ve(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error("Error loading route module `".concat(e.module,"`, reloading page...")),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function ze(e){return null!=e&&"string"===typeof e.page}function Be(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"===typeof e.imageSrcSet&&"string"===typeof e.imageSizes:"string"===typeof e.rel&&"string"===typeof e.href)}function qe(e,t,n,r,s,a){let i=(e,t)=>!n[t]||e.route.id!==n[t].route.id,o=(e,t)=>{var r;return n[t].pathname!==e.pathname||(null===(r=n[t].route.path)||void 0===r?void 0:r.endsWith("*"))&&n[t].params["*"]!==e.params["*"]};return"assets"===a?t.filter((e,t)=>
2i(e,t)||o(e,t)):"data"===a?t.filter((t,a)=>{let l=r.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(i(t,a)||o(t,a))return!0;if(t.route.shouldRevalidate){var c;let r=t.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:(null===(c=n[0])||void 0===c?void 0:c.params)||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"===typeof r)return r}return!0}):[]}function He(e,t){let{includeHydrateFallback:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r=e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1),[...new Set(r)];var r}function We(e,t){let n=new Set,r=new Set(t);return e.reduce((e,s)=>{if(t&&!ze(s)&&"script"===s.as&&s.href&&r.has(s.href))return e;let a=JSON.stringify(function(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}(s));return n.has(a)||(n.add(a),e.push({key:a,link:s})),e},[])}function Ge(e){return{__html:e}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");"undefined"!==typeof window?window:"undefined"!==typeof globalThis&&globalThis;Symbol("SingleFetchRedirect");var Ke=new Set([100,101,204,205]);function Je(e,t){let n="string"===typeof e?new URL(e,"undefined"===typeof window?"server://singlefetch/":window.location.origin):e;return"/"===n.pathname?n.pathname="_root.data":t&&"/"===F(n.pathname,t)?n.pathname="".concat(t.replace(/\/$/,""),"/_root.data"):n.pathname="".concat(n.pathname.replace(/\/$/,""),".data"),n}a.Component;function Ye(e){let{error:t,isOutsideRemixApp:n}=e;console.error(t);let r,s=a.createElement("script",{dangerouslySetInnerHTML:{__html:'\n        console.log(\n          "\ud83d\udcbf Hey developer \ud83d\udc4b. You can provide a way better UX than this when your app throws errors. Check out https://reactrouter.com/how-to/error-boundary for more information."\n        );\n      '}});if(K(t))return a.createElement(Qe,{title:"Unhandled Thrown Response!"},a.createElement("h1",{style:{fontSize:"24px"}},t.status," ",t.statusText),ae?s:null);if(t instanceof Error)r=t;else{let e=null==t?"Unknown Error":"object"===typeof t&&"toString"in t?t.toString():JSON.stringify(t);r=new Error(e)}return a.createElement(Qe,{title:"Application Error!",isOutsideRemixApp:n},a.createElement("h1",{style:{fontSize:"24px"}},"Application Error"),a.createElement("pre",{style:{padding:"2rem",background:"hsla(10, 50%, 50%, 0.1)",color:"red",overflow:"auto"}},r.stack),s)}function Qe(e){var t;let{title:n,renderScripts:r,isOutsideRemixApp:s,children:i}=e,{routeModules:o}=tt();return null!==(t=o.root)&&void 0!==t&&t.Layout&&!s?i:a.createElement("html",{lang:"en"},a.createElement("head",null,a.createElement("meta",{charSet:"utf-8"}),a.createElement("meta",{name:"viewport",content:"width=device-width,initial-scale=1,viewport-fit=cover"}),a.createElement("title",null,n)),a.createElement("body",null,a.createElement("main",{style:{fontFamily:"system-ui, sans-serif",padding:"2rem"}},i,r?a.createElement(lt,null):null)))}function $e(e,t){return"lazy"===e.mode&&!0===t}function Xe(){let e=a.useContext(Q);return Ue(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function Ze(){let e=a.useContext($);return Ue(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var et=a.createContext(void 0);function tt(){let e=a.useContext(et);return Ue(e,"You must render this element inside a <HydratedRouter> element"),e}function nt(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function rt(e,t,n){if(n&&!ot)return[e[0]];if(t){let n=e.findIndex(e=>void 0!==t[e.route.id]);return e.slice(0,n+1)}return e}function st(e){let{page:t}=e,n=r(e,o),{router:i}=Xe(),l=a.useMemo(()=>N(i.routes,t,i.basename),[i.routes,t,i.basename]);return l?a.createElement(it,(0,s.A)({page:t,matches:l},n)):null}function at(e){let{manifest:t,routeModules:n}=tt(),[r,i]=a.useState([]);return a.useEffect(()=>{let r=!1;return async function(e,t,n){return We((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ve(r,n);return e.links?e.links():[]}return[]}
2))).flat(1).filter(Be).filter(e=>"stylesheet"===e.rel||"preload"===e.rel).map(e=>"stylesheet"===e.rel?(0,s.A)((0,s.A)({},e),{},{rel:"prefetch",as:"style"}):(0,s.A)((0,s.A)({},e),{},{rel:"prefetch"})))}(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function it(e){let{page:t,matches:n}=e,i=r(e,l),o=oe(),{manifest:c,routeModules:u}=tt(),{basename:d}=Xe(),{loaderData:h,matches:m}=Ze(),p=a.useMemo(()=>qe(t,n,m,c,o,"data"),[t,n,m,c,o]),f=a.useMemo(()=>qe(t,n,m,c,o,"assets"),[t,n,m,c,o]),g=a.useMemo(()=>{if(t===o.pathname+o.search+o.hash)return[];let e=new Set,r=!1;if(n.forEach(t=>{var n;let s=c.routes[t.route.id];s&&s.hasLoader&&(!p.some(e=>e.route.id===t.route.id)&&t.route.id in h&&null!==(n=u[t.route.id])&&void 0!==n&&n.shouldRevalidate||s.hasClientLoader?r=!0:e.add(t.route.id))}),0===e.size)return[];let s=Je(t,d);return r&&e.size>0&&s.searchParams.set("_routes",n.filter(t=>e.has(t.route.id)).map(e=>e.route.id).join(",")),[s.pathname+s.search]},[d,h,o,c,p,n,t,u]),v=a.useMemo(()=>He(f,c),[f,c]),y=at(f);return a.createElement(a.Fragment,null,g.map(e=>a.createElement("link",(0,s.A)({key:e,rel:"prefetch",as:"fetch",href:e},i))),v.map(e=>a.createElement("link",(0,s.A)({key:e,rel:"modulepreload",href:e},i))),y.map(e=>{let{key:t,link:n}=e;return a.createElement("link",(0,s.A)({key:t},n))}))}et.displayName="FrameworkContext";var ot=!1;function lt(e){let{manifest:t,serverHandoffString:n,isSpaMode:o,renderMeta:l,routeDiscovery:c,ssr:u}=tt(),{router:d,static:h,staticContext:m}=Xe(),{matches:p}=Ze(),f=$e(c,u);l&&(l.didRenderScripts=!0);let g=rt(p,null,o);a.useEffect(()=>{ot=!0},[]);let v=a.useMemo(()=>{var o;let l=m?"window.__reactRouterContext = ".concat(n,";").concat("window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());"):" ",c=h?"".concat(null!==(o=t.hmr)&&void 0!==o&&o.runtime?"import ".concat(JSON.stringify(t.hmr.runtime),";"):"").concat(f?"":"import ".concat(JSON.stringify(t.url)),";\n").concat(g.map((e,n)=>{let r="route".concat(n),s=t.routes[e.route.id];Ue(s,"Route ".concat(e.route.id," not found in manifest"));let{clientActionModule:a,clientLoaderModule:i,clientMiddlewareModule:o,hydrateFallbackModule:l,module:c}=s,u=[...a?[{module:a,varName:"".concat(r,"_clientAction")}]:[],...i?[{module:i,varName:"".concat(r,"_clientLoader")}]:[],...o?[{module:o,varName:"".concat(r,"_clientMiddleware")}]:[],...l?[{module:l,varName:"".concat(r,"_HydrateFallback")}]:[],{module:c,varName:"".concat(r,"_main")}];return 1===u.length?"import * as ".concat(r," from ").concat(JSON.stringify(c),";"):[u.map(e=>"import * as ".concat(e.varName,' from "').concat(e.module,'";')).join("\n"),"const ".concat(r," = {").concat(u.map(e=>"...".concat(e.varName)).join(","),"};")].join("\n")}).join("\n"),"\n  ").concat(f?"window.__reactRouterManifest = ".concat(JSON.stringify(function(e,t){let{sri:n}=e,a=r(e,i),o=new Set(t.state.matches.map(e=>e.route.id)),l=t.state.location.pathname.split("/").filter(Boolean),c=["/"];for(l.pop();l.length>0;)c.push("/".concat(l.join("/"))),l.pop();c.forEach(e=>{let n=N(t.routes,e,t.basename);n&&n.forEach(e=>o.add(e.route.id))});let u=[...o].reduce((e,t)=>Object.assign(e,{[t]:a.routes[t]}),{});return(0,s.A)((0,s.A)({},a),{},{routes:u,sri:!!n||void 0})}(t,d),null,2),";"):"","\n  window.__reactRouterRouteModules = {").concat(g.map((e,t)=>"".concat(JSON.stringify(e.route.id),":route").concat(t)).join(","),"};\n\nimport(").concat(JSON.stringify(t.entry.module),");"):" ";return a.createElement(a.Fragment,null,a.createElement("script",(0,s.A)((0,s.A)({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ge(l),type:void 0})),a.createElement("script",(0,s.A)((0,s.A)({},e),{},{suppressHydrationWarning:!0,dangerouslySetInnerHTML:Ge(c),type:"module",async:!0})))},[]),y=ot?[]:(b=t.entry.imports.concat(He(g,t,{includeHydrateFallback:!0})),[...new Set(b)]);var b;let x="object"===typeof t.sri?t.sri:{};return ot?null:a.createElement(a.Fragment,null,"object"===typeof t.sri?a.createElement("script",{"rr-importmap":"",type:"importmap",suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:JSON.stringify({integrity:x})}}):null,f?null:a.createElement("link",{rel:"modulepreload",href:t.url,crossOrigin:e.crossOrigin,integrity:x[t.url],suppressHydrationWarning:!0}),a.createElement("link",{rel:"modulepreload",href:t.entry.module,crossOrigin:e.crossOrigin,integrity:x[t.entry.module],suppressHydrationWarning:!0}),y.map(t=>a.createElement("link",{key:t,rel:"modulepreload",href:t,crossOrigin:e.crossOrigin,integrity:x[t],suppressHydrationWarning:!0})),v)}function ct(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return e=>{t.forEach(t=>{"function"===typeof t?t(e):null!=t&&(t.current=e)})}}var ut="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;try{ut&&(window.__reactRouterVersion="7.6.2")}catch(wt){}function dt(e){let{basename:t,children:n,window:r}=e,s=a.useRef();null==s.current&&(s.current=m({window:r,v5Compat:!0}));let i=s.current,[o,l]=a.useState({action:i.action,location:i.location}),c=a.useCallback(e=>{a.startTransition(()=>l(e))},[l]);return a.useLayoutEffect(()=>i.listen(c),[i,c]),a.createElement(_e,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:i})}var ht=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,mt=a.forwardRef(function(e,t){let n,{onClick:i,discover:o="render",prefetch:l="none",relative:u,reloadDocument:d,replace:h,state:m,target:g,to:v,preventScrollReset:b,viewTransition:x}=e,w=r(e,c),{basename:N}=a.useContext(te),j="string"===typeof v&&ht.test(v),E=!1;if("string"===typeof v&&j&&(n=v,ut))try{let e=new URL(window.location.href),t=v.startsWith("//")?new URL(e.protocol+v):new URL(v),n=F(t.pathname,N);t.origin===e.origin&&null!=n?v=n+t.search+t.hash:E=!0}catch(wt){f(!1,'<Link to="'.concat(v,'">
2 contains an invalid URL which will probably break when clicked - please update to a valid URL path.'))}let S=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};p(ie(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=a.useContext(te),{hash:s,pathname:i,search:o}=he(e,{relative:t}),l=i;return"/"!==n&&(l="/"===i?n:q([n,i])),r.createHref({pathname:l,search:o,hash:s})}(v,{relative:u}),[C,k,_]=function(e,t){let n=a.useContext(et),[r,s]=a.useState(!1),[i,o]=a.useState(!1),{onFocus:l,onBlur:c,onMouseEnter:u,onMouseLeave:d,onTouchStart:h}=t,m=a.useRef(null);a.useEffect(()=>{if("render"===e&&o(!0),"viewport"===e){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return m.current&&e.observe(m.current),()=>{e.disconnect()}}},[e]),a.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{s(!0)},f=()=>{s(!1),o(!1)};return n?"intent"!==e?[i,m,{}]:[i,m,{onFocus:nt(l,p),onBlur:nt(c,f),onMouseEnter:nt(u,p),onMouseLeave:nt(d,f),onTouchStart:nt(h,p)}]:[!1,m,{}]}(l,w),A=function(e){let{target:t,replace:n,state:r,preventScrollReset:s,relative:i,viewTransition:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=ue(),c=oe(),u=he(e,{relative:i});return a.useCallback(a=>
2{if(function(e,t){return 0===e.button&&(!t||"_self"===t)&&!function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)}(a,t)){a.preventDefault();let t=void 0!==n?n:y(c)===y(u);l(e,{replace:t,state:r,preventScrollReset:s,relative:i,viewTransition:o})}},[c,l,u,n,r,t,e,s,i,o])}(v,{replace:h,state:m,target:g,preventScrollReset:b,relative:u,viewTransition:x});let T=a.createElement("a",(0,s.A)((0,s.A)((0,s.A)({},w),_),{},{href:n||S,onClick:E||d?i:function(e){i&&i(e),e.defaultPrevented||A(e)},ref:ct(t,k),target:g,"data-discover":j||"render"!==o?void 0:"true"}));return C&&!j?a.createElement(a.Fragment,null,T,a.createElement(st,{page:S})):T});mt.displayName="Link",a.forwardRef(function(e,t){let{"aria-current":n="page",caseSensitive:i=!1,className:o="",end:l=!1,style:c,to:d,viewTransition:h,children:m}=e,f=r(e,u),g=he(d,{relative:f.relative}),v=oe(),y=a.useContext($),{navigator:b,basename:x}=a.useContext(te),w=null!=y&&function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=a.useContext(X);p(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=gt("useViewTransitionState"),s=he(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=F(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=F(n.nextLocation.pathname,r)||n.nextLocation.pathname;return null!=O(s.pathname,o)||null!=O(s.pathname,i)}(g)&&!0===h,N=b.encodeLocation?b.encodeLocation(g).pathname:g.pathname,j=v.pathname,E=y&&y.navigation&&y.navigation.location?y.navigation.location.pathname:null;i||(j=j.toLowerCase(),E=E?E.toLowerCase():null,N=N.toLowerCase()),E&&x&&(E=F(E,x)||E);const S="/"!==N&&N.endsWith("/")?N.length-1:N.length;let C,k=j===N||!l&&j.startsWith(N)&&"/"===j.charAt(S),_=null!=E&&(E===N||!l&&E.startsWith(N)&&"/"===E.charAt(N.length)),A={isActive:k,isPending:_,isTransitioning:w},T=k?n:void 0;C="function"===typeof o?o(A):[o,k?"active":null,_?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let I="function"===typeof c?c(A):c;return a.createElement(mt,(0,s.A)((0,s.A)({},f),{},{"aria-current":T,className:C,ref:t,style:I,to:d,viewTransition:h}),"function"===typeof m?m(A):m)}).displayName="NavLink";var pt=a.forwardRef((e,t)=>{let{discover:n="render",fetcherKey:i,navigate:o,reloadDocument:l,replace:c,state:u,method:h=Ie,action:m,onSubmit:f,relative:g,preventScrollReset:v,viewTransition:b}=e,x=r(e,d),w=xt(),N=function(e){let{relative:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{basename:n}=a.useContext(te),r=a.useContext(re);p(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),o=(0,s.A)({},he(e||".",{relative:t})),l=oe();if(null==e){o.search=l.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some(e=>""===e)){e.delete("index"),t.filter(e=>e).forEach(t=>e.append("index",t));let n=e.toString();o.search=n?"?".concat(n):""}}e&&"."!==e||!i.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(o.pathname="/"===o.pathname?n:q([n,o.pathname]));return y(o)}(m,{relative:g}),j="get"===h.toLowerCase()?"get":"post",E="string"===typeof m&&ht.test(m);return a.createElement("form",(0,s.A)((0,s.A)({ref:t,method:j,action:N,onSubmit:l?f:e=>{if(f&&f(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,n=(null===t||void 0===t?void 0:t.getAttribute("formmethod"))||h;w(t||e.currentTarget,{fetcherKey:i,method:n,navigate:o,replace:c,state:u,relative:g,preventScrollReset:v,viewTransition:b})}},x),{},{"data-discover":E||"render"!==n?void 0:"true"}))});function ft(e){return"".concat(e," must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.")}function gt(e){let t=a.useContext(Q);return p(t,ft(e)),t}function vt(e){f("undefined"!==typeof URLSearchParams,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=a.useRef(De(e)),n=a.useRef(!1),r=oe(),s=a.useMemo(()=>function(e,t){let n=De(e);return t&&t.forEach((e,r)=>
2{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}(r.search,n.current?null:t.current),[r.search]),i=ue(),o=a.useCallback((e,t)=>{const r=De("function"===typeof e?e(s):e);n.current=!0,i("?"+r,t)},[i,s]);return[s,o]}pt.displayName="Form";var yt=0,bt=()=>"__".concat(String(++yt),"__");function xt(){let{router:e}=gt("useSubmit"),{basename:t}=a.useContext(te),n=Ne("useRouteId");return a.useCallback(async function(r){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{action:a,method:i,encType:o,formData:l,body:c}=Fe(r,t);if(!1===s.navigate){let t=s.fetcherKey||bt();await e.fetch(t,n,s.action||a,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||o,flushSync:s.flushSync})}else await e.navigate(s.action||a,{preventScrollReset:s.preventScrollReset,formData:l,body:c,formMethod:s.method||i,formEncType:s.encType||o,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}},4391:(e,t,n)=>{!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(7004)},4532:(e,t,n)=>{n.d(t,{A:()=>a});var r=n(2555),s=(n(5043),n(7106),n(579));const a=e=>{let{rating:t,maxRating:n=5,showNumeric:a=!0,reviewCount:i=0,showReviewCount:o=!0,size:l="medium",readonly:c=!0,onClick:u=null,clickable:d=!1}=e;const h=parseFloat(t)||0,m=h>0,p=[];for(let r=1;r<=n;r++){const e=r<=Math.floor(h),t=r===Math.ceil(h)&&h%1!==0;p.push((0,s.jsx)("span",{className:"star ".concat(e?"filled":""," ").concat(t?"half":""," ").concat(l),children:e?"\u2605":t?"\u2b50":"\u2606"},r))}if(!m)return(0,s.jsx)("div",{className:"star-rating no-rating",children:(0,s.jsx)("span",{className:"no-rating-text",children:"No ratings yet"})});const f=d?"button":"div",g=d?{onClick:e=>{d&&u&&(e.preventDefault(),e.stopPropagation(),u())},type:"button","aria-label":"".concat(h.toFixed(1)," out of ").concat(n," stars. Click to view reviews."),title:"Click to view reviews",style:{cursor:"pointer"}}:{};return(0,s.jsxs)(f,(0,r.A)((0,r.A)({className:"star-rating ".concat(l," ").concat(c?"readonly":""," ").concat(d?"clickable":"")},g),{},{children:[(0,s.jsx)("div",{className:"stars-container",children:p}),a&&(0,s.jsx)("span",{className:"rating-numeric",children:h.toFixed(1)}),o&&i>0&&(0,s.jsxs)("span",{className:"review-count",children:["(",i," review",1!==i?"s":"",")"]})]}))}},4628:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>u});var s=n(5043),a=n(4879),i=n(6982),o=(n(2105),n(5491)),l=n(579),c=e([i,o]);[i,o]=c.then?(await c)():c;const u=e=>{let{course:t,className:n=""}=e;const{isAdminUser:r,loading:c}
2=(0,a.h)(),[u,d]=(0,s.useState)({}),[h,m]=(0,s.useState)(null),[p,f]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null);if((0,s.useEffect)(()=>{(async()=>{if(t&&t.batches&&r){f(!0),v(null);try{const e=await(0,i.Y_)(t.id);e.success?d(e.batchStats):v("Failed to load batch stats: ".concat(e.error));const n=await(0,i.sY)(t.id);n.success&&m(n.batch)}catch(e){v("Error loading batch information: ".concat(e.message))}finally{f(!1)}}})()},[t,r]),c||!r||null===t||void 0===t||!t.batches)return null;const y=(0,o.vE)(t),b=(0,o.rU)(t);return(0,l.jsxs)("div",{className:"admin-batch-info ".concat(n),children:[(0,l.jsxs)("div",{className:"admin-batch-header",children:[(0,l.jsx)("h3",{children:"\ud83d\udcca Batch Management (Admin Only)"}),(0,l.jsxs)("div",{className:"batch-summary",children:[(0,l.jsxs)("span",{className:"batch-count",children:["Total: ",t.batches.length]}),(0,l.jsxs)("span",{className:"batch-count",children:["Active: ",b.length]}),(0,l.jsxs)("span",{className:"batch-count",children:["Upcoming: ",y.length]})]})]}),g&&(0,l.jsx)("div",{className:"admin-batch-error",children:(0,l.jsxs)("p",{children:["\u26a0\ufe0f ",g]})}),p&&(0,l.jsx)("div",{className:"admin-batch-loading",children:(0,l.jsx)("p",{children:"Loading batch information..."})}),h&&(0,l.jsxs)("div",{className:"next-enrollment-batch",children:[(0,l.jsx)("h4",{children:"\ud83c\udfaf Auto-Enrollment Target"}),(0,l.jsxs)("div",{className:"batch-card highlight",children:[(0,l.jsxs)("div",{className:"batch-card-header",children:[(0,l.jsx)("span",{className:"batch-number",title:"Batch ".concat(h.batchNumber),children:(0,o.up)(h)}),(0,l.jsx)("span",{className:"batch-status batch-status-".concat(h.status),children:(0,o.YR)(h)})]}),(0,l.jsxs)("div",{className:"batch-card-details",children:[(0,l.jsxs)("div",{className:"batch-dates",children:["\ud83d\udcc5 ",(0,o.hT)(h)]}),(0,l.jsxs)("div",{className:"batch-enrollment-info",children:["\ud83d\udc65 ",h.enrollmentCount||0," / ",h.maxCapacity," enrolled"]}),(0,l.jsx)("div",{className:"capacity-bar",children:(0,l.jsx)("div",{className:"capacity-fill",style:{width:"".concat((h.enrollmentCount||0)/h.maxCapacity*100,"%")}})}),(0,l.jsx)("div",{className:"auto-assign-note",children:"\u2139\ufe0f New enrollments will be automatically assigned to this batch"})]})]})]}),(0,l.jsxs)("div",{className:"all-batches",children:[(0,l.jsx)("h4",{children:"\ud83d\udccb All Batches"}),(0,l.jsx)("div",{className:"batches-grid",children:t.batches.map(e=>{const t=(u[e.batchNumber]||e).enrollmentCount||0,n=t/e.maxCapacity*100;return(0,l.jsxs)("div",{className:"batch-card",children:[(0,l.jsxs)("div",{className:"batch-card-header",children:[(0,l.jsx)("span",{className:"batch-number",title:"Batch ".concat(e.batchNumber),children:(0,o.kU)(e)}),(0,l.jsx)("span",{className:"batch-status batch-status-".concat(e.status),children:(0,o.YR)(e)})]}),(0,l.jsxs)("div",{className:"batch-card-details",children:[(0,l.jsxs)("div",{className:"batch-dates",children:["\ud83d\udcc5 ",(0,o.hT)(e)]}),(0,l.jsxs)("div",{className:"batch-enrollment-info",children:["\ud83d\udc65 ",t," / ",e.maxCapacity," enrolled",(0,l.jsxs)("span",{className:"enrollment-percentage",children:["(",Math.round(n),"%)"]})]}),(0,l.jsx)("div",{className:"capacity-bar",children:(0,l.jsx)("div",{className:"capacity-fill",style:{width:"".concat(n,"%")}})}),e.classLinks&&(0,l.jsxs)("div",{className:"batch-links",children:["\ud83d\udd17 Links:",e.classLinks.zoom&&(0,l.jsx)("span",{className:"link-indicator",children:"Zoom"}),e.classLinks.discord&&(0,l.jsx)("span",{className:"link-indicator",children:"Discord"})]})]})]},e.batchNumber)})})]})]})};r()}catch(u){r(u)}})},4640:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(5043),s=n(5472),a=n(8426),i=n(579);const o=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),u=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";const r=(new Date).toLocaleTimeString();t(t=>[...t,{timestamp:r,message:e,type:n}]),console.log("[".concat(r,"] ").concat(e))},d=async e=>{u("\ud83d\udce6 Backing up collection: ".concat(e),"info");try{const t=await(0,s.GG)((0,s.rJ)(a.db,e)),n=[];
2return t.docs.forEach(e=>{n.push({id:e.id,data:e.data()})}),u("\u2705 ".concat(e,": ").concat(n.length," documents backed up"),"success"),n}catch(t){return u("\u274c Error backing up ".concat(e,": ").concat(t.message),"error"),[]}},h=async(e,t)=>{const n="".concat(e,"/").concat(t);u("\ud83d\udce6 Backing up subcollection: ".concat(n),"info");try{const[r,i]=e.split("/"),o=(0,s.H9)(a.db,r,i),l=await(0,s.GG)((0,s.rJ)(o,t)),c=[];return l.docs.forEach(e=>{c.push({id:e.id,data:e.data()})}),u("\u2705 ".concat(n,": ").concat(c.length," documents backed up"),"success"),c}catch(r){return u("\u274c Error backing up ".concat(n,": ").concat(r.message),"error"),[]}};return(0,i.jsxs)("div",{style:{maxWidth:"1200px",margin:"0 auto",padding:"24px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',backgroundColor:"#f8f9fa",minHeight:"100vh"},children:[(0,i.jsxs)("div",{style:{background:"linear-gradient(135deg, #667eea 0%, #764ba2 100%)",color:"white",padding:"32px",borderRadius:"12px",marginBottom:"24px",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},children:[(0,i.jsx)("h1",{style:{fontSize:"2.25rem",fontWeight:"700",margin:"0 0 8px 0",display:"flex",alignItems:"center",gap:"12px"},children:"\ud83d\udee1\ufe0f Database Backup Tool"}),(0,i.jsx)("p",{style:{fontSize:"1.1rem",margin:"0",opacity:"0.9",fontWeight:"400"},children:"Create comprehensive backups of your Firestore database"})]}),(0,i.jsxs)("div",{style:{background:"linear-gradient(135deg, #e3f2fd 0%, #f1f8e9 100%)",border:"1px solid #81c784",borderRadius:"12px",padding:"24px",marginBottom:"24px"},children:[(0,i.jsx)("h3",{style:{margin:"0 0 16px 0",color:"#2e7d32",fontSize:"1.3rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udccb Comprehensive Backup Coverage"}),(0,i.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(280px, 1fr))",gap:"16px"},children:[(0,i.jsx)("div",{children:(0,i.jsxs)("ul",{style:{margin:"0",paddingLeft:"20px",color:"#2e7d32",lineHeight:"1.8"},children:[(0,i.jsxs)("li",{children:["\ud83d\udcda ",(0,i.jsx)("strong",{children:"Core Data:"})," Enrollments, Courses, Batches"]}),(0,i.jsxs)("li",{children:["\ud83d\udcb3 ",(0,i.jsx)("strong",{children:"Financial:"})," Payments, Manual Payments"]}),(0,i.jsxs)("li",{children:["\ud83d\udc64 ",(0,i.jsx)("strong",{children:"User Data:"})," Users, Roles, Permissions"]}),(0,i.jsxs)("li",{children:["\u2b50 ",(0,i.jsx)("strong",{children:"Reviews:"})," Course Reviews and Ratings"]})]})}),(0,i.jsx)("div",{children:(0,i.jsxs)("ul",{style:{margin:"0",paddingLeft:"20px",color:"#2e7d32",lineHeight:"1.8"},children:[(0,i.jsxs)("li",{children:["\ud83c\udfab ",(0,i.jsx)("strong",{children:"Marketing:"})," Coupons, Email Tracking"]}),(0,i.jsxs)("li",{children:["\ud83d\udcac ",(0,i.jsx)("strong",{children:"Community:"})," Forum Threads, Replies"]}),(0,i.jsxs)("li",{children:["\ud83d\udce7 ",(0,i.jsx)("strong",{children:"Communications:"})," Email Records"]}),(0,i.jsxs)("li",{children:["\ud83d\udd0d ",(0,i.jsx)("strong",{children:"Auto-Discovery:"})," All collections detected"]})]})})]})]}),(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:"\u2699\ufe0f Backup Controls"}),(0,i.jsxs)("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap",alignItems:"center"},children:[(0,i.jsx)("button",{onClick:async()=>{o(!0),u("\ud83d\udee1\ufe0f Starting comprehensive Firestore backup...","info");try{const e=await(async()=>{u("\ud83d\udd0d Discovering all collections in database...","info");try{const t=["enrollments","courses","payments","users","user_roles","course_reviews","coupons","manual_payments","emails_sent","forum_threads","forum_replies","role_audit_log","roles","audit_logs","email_tracking","progress_tracking","batches","videos","schedule","notifications"],n=[];for(const r of t)try{const e=await(0,s.GG)((0,s.rJ)(a.db,r));n.push(r),u("\u2705 Found collection: ".concat(r," (").concat(e.size," documents)"),"info")}catch(e){u("\u26a0\ufe0f Collection not accessible: ".concat(r),"warning")}
2return u("\ud83d\udcca Total collections found: ".concat(n.length),"success"),n}catch(e){return u("\u274c Error discovering collections: ".concat(e.message),"error"),["enrollments","courses","payments","users","user_roles","course_reviews"]}})(),t=await(async()=>{u("\ud83d\uddc2\ufe0f Backing up course-specific batch subcollections...","info");const e={},t=["FAAI","RLAI"];for(const r of t)try{const t=await h("courses/".concat(r),"batches");t.length>0&&(e["courses/".concat(r,"/batches")]=t)}catch(n){u("\u26a0\ufe0f Could not backup batches for course ".concat(r,": ").concat(n.message),"warning")}return e})(),n={timestamp:(new Date).toISOString(),version:"3.0",description:"Comprehensive backup including all collections and course-specific subcollections",totalCollections:e.length+Object.keys(t).length,collections:{},subcollections:t};let r=0;for(const s of e){const e=await d(s);n.collections[s]=e,r+=e.length}for(const[,s]of Object.entries(t))r+=s.length;c(n),u("\ud83c\udf89 Backup completed successfully!","success"),u("\ud83d\udcca Total documents backed up: ".concat(r),"success");for(const[s,a]of Object.entries(n.collections))u("  - ".concat(s,": ").concat(a.length," documents"),"info");for(const[s,a]of Object.entries(t))u("  - ".concat(s,": ").concat(a.length," documents"),"info")}catch(e){u("\u274c Error during backup: ".concat(e.message),"error")}finally{o(!1)}},disabled:n,style:{padding:"16px 32px",backgroundColor:n?"#6c757d":"#28a745",color:"white",border:"none",borderRadius:"10px",fontSize:"1.1rem",fontWeight:"600",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"10px",boxShadow:n?"none":"0 4px 12px rgba(40,167,69,0.2)",transform:n?"none":"translateY(0)",minWidth:"200px",justifyContent:"center"},onMouseOver:e=>{n||(e.target.style.backgroundColor="#218838",e.target.style.transform="translateY(-2px)",e.target.style.boxShadow="0 6px 20px rgba(40,167,69,0.3)")},onMouseOut:e=>{n||(e.target.style.backgroundColor="#28a745",e.target.style.transform="translateY(0)",e.target.style.boxShadow="0 4px 12px rgba(40,167,69,0.2)")},children:n?(0,i.jsx)(i.Fragment,{children:"\u23f3 Creating Backup..."}):(0,i.jsx)(i.Fragment,{children:"\ud83d\ude80 Start Full Backup"})}),l&&(0,i.jsx)("button",{onClick:()=>{if(l)try{const e=(new Date).toISOString().replace(/[:.]/g,"-").split("T")[0]+"_"+(new Date).toISOString().replace(/[:.]/g,"-").split("T")[1].split(".")[0],t=JSON.stringify(l,null,2),n=new Blob([t],{type:"application/json"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download="firestore-backup-".concat(e,".json"),document.body.appendChild(s),s.click(),document.body.removeChild(s),URL.revokeObjectURL(r),u("\u2705 Backup file downloaded successfully","success")}catch(e){u("\u274c Error downloading backup: ".concat(e.message),"error")}else u("\u274c No backup data available to download","error")},style:{padding:"16px 24px",backgroundColor:"#007bff",color:"white",border:"none",borderRadius:"10px",fontSize:"1rem",fontWeight:"600",cursor:"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px",boxShadow:"0 4px 12px rgba(0,123,255,0.2)"},onMouseOver:e=>{e.target.style.backgroundColor="#0056b3",e.target.style.transform="translateY(-1px)",e.target.style.boxShadow="0 6px 16px rgba(0,123,255,0.3)"},onMouseOut:e=>{e.target.style.backgroundColor="#007bff",e.target.style.transform="translateY(0)",e.target.style.boxShadow="0 4px 12px rgba(0,123,255,0.2)"},children:"\ud83d\udce5 Download Complete Backup"}),(0,i.jsx)("button",{onClick:()=>{t([]),c(null)},disabled:n,style:{padding:"16px 20px",backgroundColor:"#6c757d",color:"white",border:"none",borderRadius:"10px",fontSize:"1rem",fontWeight:"500",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px"},onMouseOver:e=>{n||(e.target.style.backgroundColor="#5a6268")},onMouseOut:e=>{n||(e.target.style.backgroundColor="#6c757d")},children:"\ud83d\uddd1\ufe0f Clear Logs"})]}),n&&(0,i.jsxs)("div",{style:{marginTop:"20px",padding:"16px",backgroundColor:"#d1ecf1",borderRadius:"8px",border:"1px solid #bee5eb",display:"flex",alignItems:"center",gap:"12px",fontSize:"1rem",color:"#0c5460"},children:[(0,i.jsx)("div",{style:{width:"20px",height:"20px",border:"3px solid #17a2b8",borderTop:"3px solid transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}),(0,i.jsx)("strong",{children:"Backup in progress... Please wait while we download your data."})]})]}),l&&(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udcca Backup Summary"}),(0,i.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",marginBottom:"24px"},children:[(0,i.jsxs)("div",{style:{background:"#f8f9fa",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"2rem",fontWeight:"700",color:"#007bff"},children:new Date(l.timestamp).toLocaleDateString()}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Created Date"})]}),(0,i.jsxs)("div",{style:{background:"#f8f9fa",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"2rem",fontWeight:"700",color:"#28a745"},children:Object.keys(l.collections).length}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Collections"})]}),(0,i.jsxs)("div",{style:{background:"#f8f9fa",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"2rem",fontWeight:"700",color:"#ffc107"},children:Object.values(l.collections).reduce((e,t)=>
2e+t.length,0)}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Total Documents"})]})]}),(0,i.jsx)("h3",{style:{margin:"0 0 16px 0",color:"#495057",fontSize:"1.2rem"},children:"\ud83d\udcc1 Individual Collection Downloads"}),(0,i.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"12px"},children:Object.entries(l.collections).map(e=>{let[t,n]=e;return(0,i.jsxs)("button",{onClick:()=>(e=>{if(l&&l.collections[e])try{const t=(new Date).toISOString().replace(/[:.]/g,"-").split("T")[0]+"_"+(new Date).toISOString().replace(/[:.]/g,"-").split("T")[1].split(".")[0],n=JSON.stringify(l.collections[e],null,2),r=new Blob([n],{type:"application/json"}),s=URL.createObjectURL(r),a=document.createElement("a");a.href=s,a.download="".concat(e,"-backup-").concat(t,".json"),document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(s),u("\u2705 ".concat(e," backup downloaded"),"success")}catch(t){u("\u274c Error downloading ".concat(e,": ").concat(t.message),"error")}else u("\u274c No backup data available for ".concat(e),"error")})(t),style:{padding:"12px 16px",backgroundColor:"#fff3cd",color:"#856404",border:"1px solid #ffeaa7",borderRadius:"8px",cursor:"pointer",fontSize:"0.95rem",fontWeight:"500",transition:"all 0.2s ease",display:"flex",alignItems:"center",justifyContent:"space-between"},onMouseOver:e=>{e.target.style.backgroundColor="#ffc107",e.target.style.color="#000",e.target.style.transform="translateY(-1px)",e.target.style.boxShadow="0 2px 8px rgba(255,193,7,0.3)"},onMouseOut:e=>{e.target.style.backgroundColor="#fff3cd",e.target.style.color="#856404",e.target.style.transform="translateY(0)",e.target.style.boxShadow="none"},children:[(0,i.jsxs)("span",{children:["\ud83d\udcc4 ",t]}),(0,i.jsx)("span",{style:{background:"#ffc107",color:"#000",padding:"2px 8px",borderRadius:"12px",fontSize:"0.8rem",fontWeight:"600"},children:n.length})]},t)})})]}),(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsxs)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:["\ud83d\udccb Activity Log",(0,i.jsxs)("span",{style:{backgroundColor:"#6c757d",color:"white",padding:"4px 8px",borderRadius:"12px",fontSize:"0.8rem",fontWeight:"500"},children:[e.length," entries"]})]}),(0,i.jsx)("div",{style:{backgroundColor:"#1e1e1e",borderRadius:"8px",padding:"20px",maxHeight:"400px",overflowY:"auto",border:"1px solid #333",fontFamily:'Monaco, Menlo, "Ubuntu Mono", monospace'},children:0===e.length?(0,i.jsx)("div",{style:{color:"#6c757d",fontStyle:"italic",textAlign:"center",padding:"40px 20px",fontSize:"1rem"},children:'\ud83d\udcad No activity yet. Click "Start Full Backup" to begin the backup process.'}):e.map((e,t)=>(0,i.jsxs)("div",{style:{marginBottom:"8px",color:"error"===e.type?"#ff6b6b":"success"===e.type?"#51cf66":"warning"===e.type?"#ffd43b":"#74c0fc",fontSize:"0.95rem",lineHeight:"1.5",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[(0,i.jsxs)("span",{style:{opacity:"0.7",fontSize:"0.85rem"},children:["[",e.timestamp,"]"]})," ",e.message]},t))})]}),(0,i.jsxs)("div",{style:{background:"linear-gradient(135deg, #e8f5e8 0%, #f0f8ff 100%)",border:"1px solid #81c784",borderRadius:"12px",padding:"24px"},children:[(0,i.jsx)("h3",{style:{margin:"0 0 16px 0",color:"#2e7d32",fontSize:"1.3rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udca1 How to Use This Tool"}),(0,i.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"20px"},children:[(0,i.jsx)("div",{children:(0,i.jsxs)("ol",{style:{margin:"0",paddingLeft:"20px",color:"#2e7d32",lineHeight:"1.8"},children:[(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Start Backup:"}),' Click "Start Full Backup" to begin']}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Monitor Progress:"})," Watch the activity log for updates"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Download Complete:"})," Get the full backup as JSON"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Individual Downloads:"})," Download specific collections"]})]})}),(0,i.jsxs)("div",{style:{backgroundColor:"#e3f2fd",padding:"16px",borderRadius:"8px",border:"1px solid #81c784"},children:[(0,i.jsx)("h4",{style:{margin:"0 0 8px 0",color:"#1565c0",fontSize:"1rem"},children:"\ud83d\udcbe Backup Security"}),(0,i.jsx)("p",{style:{margin:"0",fontSize:"0.95rem",color:"#1565c0",lineHeight:"1.6"},children:"All backups are downloaded as JSON files with timestamp information. Store them securely and use the Restore Tool to recover data when needed. Consider testing restores in a development environment first."})]})]})]}),(0,i.jsx)("style",{children:"\n                @keyframes spin {\n                    0% { transform: rotate(0deg); }\n                    100% { transform: rotate(360deg); }\n                }\n                \n                /* Scrollbar styling for logs */\n                div::-webkit-scrollbar {\n                    width: 8px;\n                }\n                div::-webkit-scrollbar-track {\n                    background: #2d2d2d;\n                    border-radius: 4px;\n                }\n                div::-webkit-scrollbar-thumb {\n                    background: #555;\n                    border-radius: 4px;\n                }\n                div::-webkit-scrollbar-thumb:hover {\n                    background: #777;\n                }\n            "})]})}},4685:()=>{},4758:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{m:()=>
2o});var s=n(5043),a=n(5114),i=e([a]);a=(i.then?(await i)():i)[0];const o=function(){let{limit:e=6}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)([]),[r,i]=(0,s.useState)(!0),[o,l]=(0,s.useState)(null);return(0,s.useEffect)(()=>{const t=(0,a.Ew)(e=>{let{reviews:t,error:r}=e;r?l(r):n(t),i(!1)},{limit:e});return()=>t&&t()},[e]),{reviews:t,loading:r,error:o}};r()}catch(o){r(o)}})},4879:(e,t,n)=>{n.d(t,{h:()=>i});var r=n(5043),s=n(342),a=n(762);const i=()=>{const{user:e}=(0,s.A)(),[t,n]=(0,r.useState)(null),[i,o]=(0,r.useState)(!0),[l,c]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{if(!e)return n(null),void o(!1);o(!0),c(null);try{const t=await(0,a.uG)(e.uid);n(t)}catch(t){c(t.message)}finally{o(!1)}})()},[e]);return{userRole:t,loading:i,error:l,hasPermission:async t=>!!e&&await(0,a.ZU)(e.uid,t),hasRole:e=>(null===t||void 0===t?void 0:t.role)===e,isAdminUser:(null===t||void 0===t?void 0:t.role)===a.iK.ADMIN,isInstructorUser:(null===t||void 0===t?void 0:t.role)===a.iK.INSTRUCTOR,isStudentUser:(null===t||void 0===t?void 0:t.role)===a.iK.STUDENT,isInstructor:(null===t||void 0===t?void 0:t.role)===a.iK.INSTRUCTOR||(null===t||void 0===t?void 0:t.role)===a.iK.ADMIN,isAdmin:(null===t||void 0===t?void 0:t.role)===a.iK.ADMIN,permissions:(null===t||void 0===t?void 0:t.permissions)||[]}}},4941:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>d});var s=n(2555),a=(n(5043),n(4366)),i=n(5511),o=n(9412),l=n(8185),c=(n(9588),n(579)),u=e([i,o]);[i,o]=u.then?(await u)():u;const d=()=>{const e=(0,a.Zp)(),{courses:t}=(0,o.A8)(),{allEnrollments:n,loading:r,error:u}=(0,i.x)(),d=(0,l.Qz)(),h=n.map(e=>{var n,r;const a=t.find(t=>t.id===e.courseId);return(0,s.A)({id:e.courseId,title:e.courseTitle||(null===a||void 0===a?void 0:a.title)||"Unknown Course",progress:e.progress||0,status:e.status||"enrolled",enrolledDate:(null===(n=e.enrolledAt)||void 0===n||null===(r=n.toDate)||void 0===r?void 0:r.call(n))||new Date(e.enrolledAt)||new Date},a)});return(0,c.jsxs)("div",{className:"dashboard-container",children:[(0,c.jsxs)("div",{className:"dashboard-header",children:[(0,c.jsx)("h1",{children:"My Dashboard"}),(0,c.jsx)("p",{children:"Welcome! Here are your enrolled courses."})]}),(0,c.jsxs)("div",{className:"dashboard-content",children:[(0,c.jsxs)("section",{className:"enrolled-courses",children:[(0,c.jsx)("h2",{children:"My Courses"}),r&&(0,c.jsx)("div",{className:"dashboard-loading-state",children:(0,c.jsx)("p",{children:"Loading your courses..."})}),u&&(0,c.jsx)("div",{className:"dashboard-error-state",children:(0,c.jsxs)("p",{className:"dashboard-error-text",children:["Error loading courses: ",u]})}),!r&&!u&&h.length>0?(0,c.jsx)("div",{className:"courses-grid",children:h.map(t=>(0,c.jsxs)("div",{className:"course-dashboard-card",children:[(0,c.jsxs)("div",{className:"course-header",children:[(0,c.jsx)("h3",{children:t.title}),(0,c.jsx)("span",{className:"course-status",children:t.status})]}),d&&(0,c.jsxs)("div",{className:"course-progress",children:[(0,c.jsx)("div",{className:"progress-bar",children:(0,c.jsx)("div",{className:"progress-fill",style:{width:"".concat(t.progress,"%")}})}),(0,c.jsxs)("span",{className:"progress-text",children:[t.progress,"% Complete"]})]}),(0,c.jsx)("div",{className:"course-actions",children:(0,c.jsx)("button",{className:"btn",onClick:()=>e("/course/".concat(t.id,"/dashboard")),children:"Course Dashboard"})}),(0,c.jsx)("div",{className:"enrollment-info",children:(0,c.jsxs)("small",{children:["Enrolled: ",t.enrolledDate.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})]})})]},t.id))}):!r&&!u&&(0,c.jsxs)("div",{className:"no-courses",children:[(0,c.jsx)("div",{className:"no-courses-icon",children:"\ud83d\udcda"}),(0,c.jsx)("h3",{children:"No courses enrolled yet"}),(0,c.jsx)("p",{children:"Start your learning journey by enrolling in one of our courses!"}),(0,c.jsx)("button",{className:"btn",onClick:()=>e("/courses"),children:"Browse Courses"})]})]}),(0,c.jsxs)("section",{className:"quick-actions",children:[(0,c.jsx)("h2",{children:"Quick Actions"}),(0,c.jsxs)("div",{className:"actions-grid",children:[(0,c.jsxs)("div",{className:"action-card",children:[(0,c.jsxs)("div",{className:"action-content",children:[(0,c.jsx)("div",{className:"action-icon",children:"\ud83d\udcd6"}),(0,c.jsx)("h4",{children:"Browse Courses"}),(0,c.jsx)("p",{children:"Discover new courses to expand your skills"})]}),(0,c.jsx)("button",{className:"btn btn-secondary",onClick:()=>e("/courses"),children:"View All Courses"})]}),(0,c.jsxs)("div",{className:"action-card",children:[(0,c.jsxs)("div",{className:"action-content",children:[(0,c.jsx)("div",{className:"action-icon",children:"\ud83d\udcac"}),(0,c.jsx)("h4",{children:"Get Support"}),(0,c.jsx)("p",{children:"Need help? Contact our support team"})]}),(0,c.jsx)("button",{className:"btn btn-secondary",onClick:()=>e("/contact"),children:"Contact Support"})]})]})]})]})]})};r()}catch(d){r(d)}})},4987:()=>{}
2,4999:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>p});var s=n(2555),a=n(5043),i=n(342),o=n(628),l=n(3387),c=n(9540),u=n(5491),d=n(8185),h=(n(3400),n(579)),m=e([o,u]);[o,u]=m.then?(await m)():m;const p=()=>{const{user:e}=(0,i.A)(),[t,n]=(0,a.useState)("create"),[r,m]=(0,a.useState)([]),[p,f]=(0,a.useState)([]),[g,v]=(0,a.useState)(!1),[y,b]=(0,a.useState)(""),[x,w]=(0,a.useState)(""),[N,j]=(0,a.useState)(null),[E,S]=(0,a.useState)(""),[C,k]=(0,a.useState)([]),[_,A]=(0,a.useState)(null),[T,I]=(0,a.useState)(!1),P=(0,d.F_)(),[R,D]=(0,a.useState)({name:"",description:"",discountType:"percentage",discountValue:"",maxDiscountAmount:"",minOrderAmount:"",targetType:"general",targetUserId:"",targetUserEmail:"",courseId:"",usageLimit:"",usageLimitPerUser:"1",validFrom:"",validUntil:"",customCode:"",prefix:"",sendEmail:!1,emailMessage:""});(0,a.useEffect)(()=>{O(),L(),M()},[]),(0,a.useEffect)(()=>{if(!E.trim())return void k(p);const e=p.filter(e=>{const t=e.displayName||"",n=e.email||"",r=E.toLowerCase();return t.toLowerCase().includes(r)||n.toLowerCase().includes(r)});k(e)},[E,p]);const O=async()=>{v(!0);try{const e=await(0,o.DB)();e.success?m(e.coupons):b(e.error)}catch(e){b("Failed to load coupons")}finally{v(!1)}},L=async()=>{try{const e=await(0,l.CF)();e.success&&f(e.users)}catch(e){}},M=async()=>{try{const e=await(0,o.XW)();e.success&&j(e.stats)}catch(e){}},F=(e,t)=>{if(D(n=>(0,s.A)((0,s.A)({},n),{},{[e]:t})),"customCode"===e&&t&&t.trim()&&D(e=>(0,s.A)((0,s.A)({},e),{},{prefix:""})),"prefix"===e&&t&&t.trim()&&D(e=>(0,s.A)((0,s.A)({},e),{},{customCode:""})),"targetUserId"===e&&t){const e=p.find(e=>e.id===t);e&&D(t=>(0,s.A)((0,s.A)({},t),{},{targetUserEmail:e.email}))}if("courseId"===e&&t){const e=u.pU.find(e=>e.id===t);e&&D(t=>(0,s.A)((0,s.A)({},t),{},{courseTitle:e.title}))}},U=e=>{S(e.target.value),I(!0),e.target.value.trim()||(A(null),D(e=>(0,s.A)((0,s.A)({},e),{},{targetUserId:"",targetUserEmail:""})))},V=async t=>{t.preventDefault(),v(!0),b(""),w("");try{if(!R.discountValue||parseFloat(R.discountValue)<=0)throw new Error("Please enter a valid discount value");if("user_specific"===R.targetType&&!R.targetUserId)throw new Error("Please select a target user for user-specific coupons");if("course_specific"===R.targetType&&!R.courseId)throw new Error("Please select a target course for course-specific coupons");if(R.customCode&&R.customCode.trim()){const e=R.customCode.trim().toUpperCase();if(e.length<3)throw new Error("Custom coupon code must be at least 3 characters long");if(e.length>20)throw new Error("Custom coupon code must be 20 characters or less");if(!/^[A-Z0-9]+$/.test(e))throw new Error("Custom coupon code can only contain letters and numbers")}let t=(0,s.A)({},R);if(t.courseId){const e=u.pU.find(e=>e.id===t.courseId);e&&(t.courseTitle=e.title)}t.customCode&&t.customCode.trim()&&(t.code=t.customCode.trim().toUpperCase());const a=await(0,o.rS)(t,e.uid);if(a.success){let s="\ud83c\udf89 Coupon Generated Successfully!\n\n";if(s+="\ud83d\udccb Coupon Details:\n",s+="\u2022 Code: ".concat(a.couponCode,"\n"),s+="\u2022 Name: ".concat(t.name,"\n"),s+="\u2022 Discount: ".concat("percentage"===t.discountType?t.discountValue+"%":"$"+t.discountValue," off\n"),s+="\u2022 Type: ".concat("general"===t.targetType?"General (Available to all)":"user_specific"===t.targetType?"User-specific":"Course-specific","\n"),"user_specific"===t.targetType&&t.targetUserEmail&&(s+="\u2022 Target User: ".concat(t.targetUserEmail,"\n")),t.courseId){const e=u.pU.find(e=>e.id===t.courseId);s+="\u2022 Course: ".concat((null===e||void 0===e?void 0:e.title)||"Unknown Course","\n")}if(t.validUntil&&(s+="\u2022 Valid Until: ".concat(new Date(t.validUntil).toLocaleDateString(),"\n")),t.usageLimit&&(s+="\u2022 Usage Limit: ".concat(t.usageLimit," uses\n")),t.minOrderAmount&&(s+="\u2022 Minimum Order: $".concat(t.minOrderAmount,"\n")),s+="\u2022 Created by: ".concat((null===e||void 0===e?void 0:e.displayName)||(null===e||void 0===e?void 0:e.email)||"Admin","\n"),s+="\n\u2705 The coupon is now active and ready to use!",w(s),t.sendEmail&&"user_specific"===t.targetType&&t.targetUserEmail)try{var n;const r=p.find(e=>e.id===t.targetUserId),s=u.pU.find(e=>e.id===t.courseId),i={recipientName:(null===r||void 0===r?void 0:r.displayName)||(null===r||void 0===r||null===(n=r.email)||void 0===n?void 0:n.split("@")[0])||"Student",recipientEmail:t.targetUserEmail,couponCode:
2a.couponCode,couponName:t.name,discountType:t.discountType,discountValue:t.discountValue,courseTitle:(null===s||void 0===s?void 0:s.title)||null,courseId:t.courseId||null,validUntil:t.validUntil||null,minOrderAmount:t.minOrderAmount||null,adminMessage:t.emailMessage||null,senderName:(null===e||void 0===e?void 0:e.displayName)||"Admin"},o=await(0,c.vS)(i,t.targetUserId);o.success?w(e=>e+" Email sent successfully!"):o.skipped?w(e=>e+" (Email service not configured)"):b("Coupon created but failed to send email: "+o.error)}catch(r){b("Coupon created but failed to send email")}D({name:"",description:"",discountType:"percentage",discountValue:"",maxDiscountAmount:"",minOrderAmount:"",targetType:"general",targetUserId:"",targetUserEmail:"",courseId:"",usageLimit:"",usageLimitPerUser:"1",validFrom:"",validUntil:"",customCode:"",prefix:"",sendEmail:!1,emailMessage:""}),O(),M()}else b(a.error)}catch(a){b(a.message)}finally{v(!1)}},z=async(t,n)=>{try{const r=await(0,o.OS)(t,n,e.uid);r.success?(w("Coupon status updated to ".concat(n)),O()):b(r.error)}catch(r){b("Failed to update coupon status")}},B=async e=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select(),document.execCommand("copy"),t.remove()}w('Coupon code "'.concat(e,'" copied to clipboard!'))}catch(t){b("Failed to copy coupon code to clipboard")}},q=e=>"percentage"===e.discountType?"".concat(e.discountValue,"% off"):"$".concat(e.discountValue," off"),H=e=>e?e.toDate?e.toDate().toLocaleDateString():new Date(e).toLocaleDateString():"No expiry",W=e=>{switch(e.targetType){case"user_specific":return"User: ".concat(e.targetUserEmail||"Unknown user");case"course_specific":return"Course: ".concat(e.courseTitle||e.courseId);case"general":return"All users";default:return e.targetType}};return(0,h.jsxs)("div",{className:"admin-coupon-manager",children:[(0,h.jsx)("h2",{children:"Coupon Management"}),!P&&(0,h.jsx)("div",{className:"warning-banner",children:(0,h.jsxs)("div",{className:"warning-content",children:[(0,h.jsx)("span",{className:"warning-icon",children:"\u26a0\ufe0f"}),(0,h.jsxs)("div",{className:"warning-text",children:[(0,h.jsx)("strong",{children:"Coupon System Disabled"}),(0,h.jsxs)("p",{children:["The coupon system is currently disabled in the environment configuration. Coupons created here will not be visible to users during checkout. To enable coupons, set ",(0,h.jsx)("code",{children:"REACT_APP_ENABLE_COUPONS=true"})," in your .env file."]})]})]})}),y&&(0,h.jsx)("div",{className:"error-message",children:y}),x&&(0,h.jsx)("div",{className:"success-message",children:x}),(0,h.jsxs)("div",{className:"coupon-tabs",children:[(0,h.jsx)("button",{onClick:()=>n("create"),className:"tab-button ".concat("create"===t?"active":""),children:"\ud83c\udfab Create Coupon"}),(0,h.jsx)("button",{onClick:()=>n("manage"),className:"tab-button ".concat("manage"===t?"active":""),children:"\ud83d\udccb Manage Coupons"}),(0,h.jsx)("button",{onClick:()=>n("stats"),className:"tab-button ".concat("stats"===t?"active":""),children:"\ud83d\udcca Usage Statistics"})]}),(0,h.jsxs)("div",{className:"coupon-content",children:["create"===t&&(0,h.jsxs)("div",{className:"coupon-form-container",children:[(0,h.jsx)("h3",{children:"Create New Coupon"}),(0,h.jsxs)("form",{onSubmit:V,className:"coupon-form",children:[(0,h.jsx)("div",{className:"form-row",children:(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Coupon Name *"}),(0,h.jsx)("input",{type:"text",value:R.name,onChange:e=>F("name",e.target.value),placeholder:"e.g., Summer Sale 2025",required:!0})]})}),(0,h.jsxs)("div",{className:"coupon-code-section",children:[(0,h.jsx)("h4",{children:"\ud83c\udfab Coupon Code Configuration"}),(0,h.jsxs)("div",{className:"form-row",children:[(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Custom Code (Optional)"}),(0,h.jsx)("input",{type:"text",value:R.customCode,onChange:e=>F("customCode",e.target.value.toUpperCase()),placeholder:"e.g., SAVE25, EARLY10, WELCOME50",maxLength:20}),(0,h.jsx)("small",{children:"Set an exact coupon code (recommended for general use coupons like SAVE25, EARLY10)"})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"OR Random Code Prefix (Optional)"}),(0,h.jsx)("input",{type:"text",value:R.prefix,onChange:e=>F("prefix",e.target.value.toUpperCase()),placeholder:"e.g., SUMMER",maxLength:10,disabled:R.customCode&&R.customCode.trim()}),(0,h.jsx)("small",{children:"Prefix for auto-generated code (will add random suffix
2)"})]})]}),R.customCode&&R.customCode.trim()&&(0,h.jsxs)("div",{className:"code-preview",children:[(0,h.jsx)("strong",{children:"Preview Code: "}),(0,h.jsx)("span",{className:"preview-code",children:R.customCode.toUpperCase()})]}),!R.customCode&&R.prefix&&(0,h.jsxs)("div",{className:"code-preview",children:[(0,h.jsx)("strong",{children:"Preview Code: "}),(0,h.jsxs)("span",{className:"preview-code",children:[R.prefix,"XXXXXX"]}),(0,h.jsx)("small",{children:" (X's will be replaced with random characters)"})]})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Description"}),(0,h.jsx)("textarea",{value:R.description,onChange:e=>F("description",e.target.value),placeholder:"Brief description of the coupon",rows:3})]}),(0,h.jsxs)("div",{className:"form-row",children:[(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Discount Type *"}),(0,h.jsxs)("select",{value:R.discountType,onChange:e=>F("discountType",e.target.value),required:!0,children:[(0,h.jsx)("option",{value:"percentage",children:"Percentage (%)"}),(0,h.jsx)("option",{value:"fixed",children:"Fixed Amount ($)"})]})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsxs)("label",{children:["Discount Value *","percentage"===R.discountType?" (1-100)":" ($)"]}),(0,h.jsx)("input",{type:"number",value:R.discountValue,onChange:e=>F("discountValue",e.target.value),placeholder:"percentage"===R.discountType?"50":"300",min:"1",max:"percentage"===R.discountType?"100":void 0,step:"percentage"===R.discountType?"1":"0.01",required:!0})]})]}),"percentage"===R.discountType&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Maximum Discount Amount ($) (Optional)"}),(0,h.jsx)("input",{type:"number",value:R.maxDiscountAmount,onChange:e=>F("maxDiscountAmount",e.target.value),placeholder:"e.g., 500",min:"0",step:"0.01"}),(0,h.jsx)("small",{children:"Maximum dollar amount that can be discounted"})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Minimum Order Amount ($) (Optional)"}),(0,h.jsx)("input",{type:"number",value:R.minOrderAmount,onChange:e=>F("minOrderAmount",e.target.value),placeholder:"e.g., 100",min:"0",step:"0.01"})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Target Type *"}),(0,h.jsxs)("select",{value:R.targetType,onChange:e=>F("targetType",e.target.value),required:!0,children:[(0,h.jsx)("option",{value:"general",children:"General (All Users)"}),(0,h.jsx)("option",{value:"user_specific",children:"User Specific"}),(0,h.jsx)("option",{value:"course_specific",children:"Course Specific"})]})]}),"user_specific"===R.targetType&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Target User *"}),(0,h.jsxs)("div",{className:"user-search-container",children:[(0,h.jsx)("input",{type:"text",value:E,onChange:U,onFocus:()=>I(!0),placeholder:"Search by name or email...",required:!0}),T&&C.length>0&&(0,h.jsx)("div",{className:"user-dropdown",children:C.slice(0,10).map(e=>(0,h.jsxs)("div",{className:"user-option",onClick:()=>(e=>{A(e),S(e.displayName||e.email),I(!1),D(t=>(0,s.A)((0,s.A)({},t),{},{targetUserId:e.id,targetUserEmail:e.email}))})(e),children:[(0,h.jsx)("div",{className:"user-name",children:e.displayName||"No Name"}),(0,h.jsx)("div",{className:"user-email",children:e.email})]},e.id))})]}),_&&(0,h.jsxs)("div",{className:"selected-user-info",children:[(0,h.jsx)("p",{children:(0,h.jsx)("strong",{children:"Selected User:"})}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Name:"})," ",_.displayName||"No Name"]}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:"Email:"})," ",_.email]})]})]}),"course_specific"===R.targetType&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Target Course *"}),(0,h.jsxs)("select",{value:R.courseId,onChange:e=>F("courseId",e.target.value),required:!0,children:[(0,h.jsx)("option",{value:"",children:"Select a course..."}),u.pU.map(e=>(0,h.jsx)("option",{value:e.id,children:e.title},e.id))]})]}),(0,h.jsxs)("div",{className:"form-row",children:[(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Total Usage Limit (Optional)"}),(0,h.jsx)("input",{type:"number",value:R.usageLimit,onChange:e=>F("usageLimit",e.target.value),placeholder:"e.g., 100",min:"1"}),(0,h.jsx)("small",{children:"Maximum number of times this coupon can be used"})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Usage Limit Per User"}),(0,h.jsx)("input",{type:"number",value:R.usageLimitPerUser,onChange:e=>F("usageLimitPerUser",e.target.value),min:"1",required:!0})]})]}),(0,h.jsxs)("div",{className:"form-row",children:[(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Valid From (Optional)"}),(0,h.jsx)("input",{type:"datetime-local",value:R.validFrom,onChange:e=>F("validFrom",e.target.value)})]}),(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Valid Until (Optional)"}),(0,h.jsx)("input",{type:"datetime-local",value:R.validUntil,onCh
2ange:e=>F("validUntil",e.target.value)})]})]}),"user_specific"===R.targetType&&R.targetUserEmail&&(0,h.jsxs)("div",{className:"email-options-section",children:[(0,h.jsx)("h4",{children:"\ud83d\udce7 Email Options"}),(0,h.jsx)("div",{className:"form-group",children:(0,h.jsxs)("label",{className:"checkbox-label",children:[(0,h.jsx)("input",{type:"checkbox",checked:R.sendEmail,onChange:e=>F("sendEmail",e.target.checked)}),(0,h.jsx)("span",{className:"checkmark"}),"Send coupon code to user via email"]})}),R.sendEmail&&(0,h.jsxs)("div",{className:"form-group",children:[(0,h.jsx)("label",{children:"Personal Message (Optional)"}),(0,h.jsx)("textarea",{value:R.emailMessage,onChange:e=>F("emailMessage",e.target.value),placeholder:"Add a personal message to include with the coupon email...",rows:3}),(0,h.jsx)("small",{children:"This message will be included in the email along with the coupon details."})]})]}),(0,h.jsx)("button",{type:"submit",disabled:g,className:"create-coupon-btn",children:g?"Creating...":"Create Coupon"})]})]}),"manage"===t&&(0,h.jsxs)("div",{className:"coupons-list-container",children:[(0,h.jsx)("h3",{children:"Manage Coupons"}),0===r.length?(0,h.jsx)("p",{children:"No coupons found."}):(0,h.jsx)("div",{className:"coupons-table",children:(0,h.jsxs)("table",{children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:"Code"}),(0,h.jsx)("th",{children:"Name"}),(0,h.jsx)("th",{children:"Discount"}),(0,h.jsx)("th",{children:"Target"}),(0,h.jsx)("th",{children:"Usage"}),(0,h.jsx)("th",{children:"Valid Until"}),(0,h.jsx)("th",{children:"Created By"}),(0,h.jsx)("th",{children:"Status"}),(0,h.jsx)("th",{children:"Actions"})]})}),(0,h.jsx)("tbody",{children:r.map(t=>(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{className:"coupon-code",children:(0,h.jsxs)("span",{className:"coupon-code-text",onClick:()=>B(t.code),title:"Click to copy coupon code",children:[t.code," \ud83d\udccb"]})}),(0,h.jsx)("td",{children:t.name}),(0,h.jsx)("td",{children:q(t)}),(0,h.jsx)("td",{children:W(t)}),(0,h.jsxs)("td",{children:[t.usageCount||0,t.usageLimit&&" / ".concat(t.usageLimit)]}),(0,h.jsx)("td",{children:H(t.validUntil)}),(0,h.jsx)("td",{title:t.createdByEmail||"Unknown",children:t.createdByName||t.createdByEmail||"Unknown"}),(0,h.jsx)("td",{children:(0,h.jsx)("span",{className:"status-badge status-".concat(t.status),children:t.status})}),(0,h.jsx)("td",{children:(0,h.jsxs)("div",{className:"action-buttons",children:["active"===t.status?(0,h.jsx)("button",{onClick:()=>z(t.id,"inactive"),className:"btn-deactivate",title:"Deactivate",children:"\ud83d\udd34"}):(0,h.jsx)("button",{onClick:()=>z(t.id,"active"),className:"btn-activate",title:"Activate",children:"\ud83d\udfe2"}),"user_specific"===t.targetType&&t.targetUserEmail&&(0,h.jsx)("button",{onClick:()=>(async t=>{if("user_specific"===t.targetType&&t.targetUserEmail)try{var n;v(!0);const r=p.find(e=>e.id===t.targetUserId),s=u.pU.find(e=>e.id===t.courseId),a={recipientName:(null===r||void 0===r?void 0:r.displayName)||(null===r||void 0===r||null===(n=r.email)||void 0===n?void 0:n.split("@")[0])||"Student",recipientEmail:t.targetUserEmail,couponCode:t.code,couponName:t.name,discountType:t.discountType,discountValue:t.discountValue,courseTitle:(null===s||void 0===s?void 0:s.title)||null,courseId:t.courseId||null,validUntil:t.validUntil||null,minOrderAmount:t.minOrderAmount||null,adminMessage:"Your exclusive coupon code is ready to use! This coupon ".concat(t.usageCount>0?"has been used "+t.usageCount+" time(s)":"has not been used yet","."),senderName:(null===e||void 0===e?void 0:e.displayName)||"Admin"},i=await(0,c.vS)(a,t.targetUserId);i.success?w("Coupon email sent successfully!"):i.skipped?b("Email service not configured"):b("Failed to send coupon email: "+i.error)}catch(r){b("Failed to send coupon email")}finally{v(!1)}else b("Can only send emails for user-specific coupons")})(t),className:"btn-email",title:"Send Email",disabled:g,children:"\ud83d\udce7"}),(0,h.jsx)("button",{onClick:()=>B(t.code),className:"btn-copy",title:"Copy Coupon Code",children:"\ud83d\udccb"}),(0,h.jsx)("button",{onClick:()=>(async t=>{v(!0),b(""),w("");try{const n=(null===e||void 0===e?void 0:e.uid)||"test_user_".concat(Date.now()),r=await(0,o.Xp)(t,n);if(r.success)w("\u2705 Test successful for ".concat(t,"!\n\nBefore: ").concat(r.before.usageCount," uses, ").concat(r.before.historyLength," history records\nAfter: ").concat(r.after.usageCount," uses, ").concat(r.after.historyLength," history records\n\nUsage Log ID: ").concat(r.usageLogId,"\n\nTest User ID: ").concat(n)),O(),M();else{const e=r.details?"\n\nDetails: ".concat(JSON.stringify(r.details,null,2)):"";b("\u274c Test failed: ".concat(r.error).concat(e))}}catch(n){b("\u274c Test error: ".concat(n.message,"\n\nStack: ").concat(n.stack))}finally{v(!1)}})(t.code),className:"btn-test",title:"Test Usage Recording",disabled:g,children:"\ud83e\uddea"}),(0,h.jsx)("button",{onClick:()=>(async t=>{if(window.confirm("Are you sure you want to delete this coupon?"))try{const n=await(0,o.W_)(t,e.uid);n.success?(w(n.message),O(),M()):b(n.error)}catch(n){b("Failed to delete coupon")}})(t.id),className:"btn-delete",title:"Delete",children:"\ud83d\uddd1\ufe0f"})]})})]},t.id))})]})})]}),"stats"===t&&(0,h.jsxs)("div",{className:"usage-stats-container",children:[(0,h.jsx)("h3",{children:"Coupon Usage Statistics"}),N?(0,h.jsxs)("div",{className:"stats-grid",children:[(0,h.jsxs)("div",{className:"stat-card",children:[(0,h.jsx)("h4",{children:"Total Usage"}),(0,h.jsx)("p",{className:"stat-value",children:N.totalUsage})]}),(0,h.jsxs)("div",{className:"stat-card",children:[(0,h.jsx)("h4",{children:"Total Discount Given"}),(0,h.jsxs)("p",{className:"stat-value",children:["$",N.totalDiscount.toFixed(2)]})]}),(0,h.jsxs)("div",{className:"stat-card",children:[(0,h.jsx)("h4",{children:"Total Order Value"}),(0,h.jsxs)("p",{className:"stat-value",children:["$",N.totalOrders.toFixed(2)]})]}),(0,h.jsxs)("div",{className:"stat-card",children:[(0,h.jsx)("h4",{children:"Average Discount"}),(0,h.jsxs)("p",{className:"stat-value",children:["$",N.averageDiscount.toFixed(2)]})]})]}):(0,h.jsx)("p",{children:"Loading statistics..."}),N&&N.usageRecords.length>0&&(0,h.jsxs)("div",{className:"recent-usage",children:[(0,h.jsx)("h4",{children:"Recent Usage"}),(0,h.jsx)("div",{className:"usage-table",children:(0,h.jsxs)("table",{children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:"Date"}),(0,h.jsx)("th",{children:"Coupon Code"}),(0,h.jsx)("th",{children:"User"}),(0,h.jsx)("th",{children:"Course"}),(0,h.jsx)("th",{children:"Discount"}),(0,h.jsx)("th",{children:"Order Total"})]})}),(0,h.jsx)("tbody",{children:N.usageRecords.slice(0,10).map(e=>{var t,n;return(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{children:H(e.usedAt)}),(0,h.jsx)("td",{className:"coupon-code",children:(0,h.jsxs)("span",{className:"coupon-code-text",onClick:()=>B(e.couponCode),title:"Click to copy coupon code",children:[e.couponCode," \ud83d\udccb"]})}),(0,h.jsx)("td",{children:e.userId}),(0,h.jsx)("td",{children:e.courseId}),(0,h.jsxs)("td",{children:["$",null===(t=e.discountAmount)||void 0===t?void 0:t.toFixed(2)]}),(0,h.jsxs)("td",{children:["$",null===(n=e.orderAmount)||void 0===n?void 0:n.toFixed(2)]})]},e.id)})})]})})]})]})]})]})};r()}catch(p){r(p)}})}
2,5043:(e,t,n)=>{e.exports=n(4288)},5082:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(5043),s=n(5472),a=n(8426);const i=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;try{if(!a.db)throw new Error("Firestore not initialized");const n={courseId:e.courseId,courseTitle:e.courseTitle,amount:parseFloat(e.amount)||0,payerName:e.payerName||null,payerEmail:e.payerEmail||null,transactionId:e.transactionId||null,notes:e.notes||null,userId:t,paymentMethod:"manual",status:"pending_manual_verification",submittedAt:e.timestamp?new Date(e.timestamp):new Date,createdAt:(0,s.O5)(),updatedAt:(0,s.O5)()};return{success:!0,manualPaymentId:(await(0,s.gS)((0,s.rJ)(a.db,"manual_payments"),n)).id}}catch(n){return{success:!1,error:n.message}}},o=n.p+"static/media/zelle-qr.14d3f3593f241d7497a9.jpg";var l=n(579);const c=e=>{let{courseId:t,courseTitle:n,coursePrice:s,user:a,onSuccess:c,onError:u,disabled:d=!1}=e;const[h,m]=(0,r.useState)((null===a||void 0===a?void 0:a.displayName)||""),[p,f]=(0,r.useState)((null===a||void 0===a?void 0:a.email)||""),[g,v]=(0,r.useState)(""),[y,b]=(0,r.useState)(""),[x,w]=(0,r.useState)(!1),[N,j]=(0,r.useState)(null),E=o,S="[email protected]";return(0,l.jsxs)("div",{className:"manual-payment-panel",children:[(0,l.jsx)("h4",{children:"\ud83d\udcb3 Secure Payment via Zelle"}),(0,l.jsxs)("div",{className:"zelle-info",children:[(0,l.jsxs)("div",{className:"zelle-qr",children:[(0,l.jsx)("img",{src:E,alt:"Zelle QR Code for HA Talent Tech"}),(0,l.jsx)("div",{className:"zelle-payee",children:"HA Talent Tech"}),(0,l.jsx)("div",{className:"zelle-email",children:S})]}),(0,l.jsx)("div",{className:"zelle-details",children:(0,l.jsxs)("div",{className:"payment-instructions",children:[(0,l.jsx)("h5",{children:"\ud83d\udccb Payment Instructions"}),(0,l.jsxs)("div",{className:"instruction-steps",children:[(0,l.jsxs)("div",{className:"step",children:[(0,l.jsx)("span",{className:"step-number",children:"1"}),(0,l.jsxs)("span",{className:"step-text",children:["Open your ",(0,l.jsx)("strong",{children:"bank's mobile app"})," (do not use your phone's camera directly)"]})]}),(0,l.jsxs)("div",{className:"step",children:[(0,l.jsx)("span",{className:"step-number",children:"2"}),(0,l.jsxs)("span",{className:"step-text",children:["Navigate to the ",(0,l.jsx)("strong",{children:"Zelle section"})," within your banking app"]})]}),(0,l.jsxs)("div",{className:"step",children:[(0,l.jsx)("span",{className:"step-number",children:"3"}),(0,l.jsxs)("span",{className:"step-text",children:["Either ",(0,l.jsx)("strong",{children:"scan the QR code"})," above or send to: ",(0,l.jsx)("strong",{children:S})]})]}),(0,l.jsxs)("div",{className:"step",children:[(0,l.jsx)("span",{className:"step-number",children:"4"}),(0,l.jsxs)("span",{className:"step-text",children:["Enter the exact amount: ",(0,l.jsxs)("strong",{children:["$",Number(s).toFixed(2)]})]})]}),(0,l.jsxs)("div",{className:"step",children:[(0,l.jsx)("span",{className:"step-number",children:"5"}),(0,l.jsxs)("span",{className:"step-text",children:["Complete the payment and note your ",(0,l.jsx)("strong",{children:"transaction ID"})]})]})]}),(0,l.jsxs)("div",{className:"important-note",children:[(0,l.jsx)("strong",{children:"\ud83d\udccc Important:"})," Your transaction ID will appear in your bank app's payment history immediately after sending. Please enter it below to verify your payment."]})]})})]}),(0,l.jsxs)("form",{className:"manual-payment-form",onSubmit:async e=>{if(e.preventDefault(),j(null),g&&p){w(!0);try{const e={courseId:t,courseTitle:n,amount:s,payerName:h||null,payerEmail:p,transactionId:g,notes:y,timestamp:(new Date).toISOString()},r=await i(e,(null===a||void 0===a?void 0:a.uid)||null);r.success?(j({type:"success",text:"Thank you \u2014 we received your manual payment details. We will verify and enroll you shortly."}),c&&c({manualSubmission:!0,manualPaymentId:r.manualPaymentId,transactionId:g,courseId:t,courseTitle:n,amount:s,payerEmail:p,payerName:h,timestamp:e.timestamp})):(j({type:"error",text:r.error||"Failed to record manual payment."}),u&&u(new Error(r.error||"Failed to record manual payment")))}catch(r){j({type:"error",text:r.message||"Failed to submit manual payment."}),u&&u(r)}finally{w(!1)}}else j({type:"error",text:"Please provide your payer email and transaction ID."})},children:[(0,l.jsxs)("div",{className:"form-section",children:[(0,l.jsx)("h5",{children:"\ud83d\udcdd Payment Verification Details"}),(0,l.jsxs)("label",{children:["Your Name (optional)",(0,l.jsx)("input",{type:"text",value:h,onChange:e=>m(e.target.value),placeholder:"Enter your full name"})]}),(0,l.jsxs)("label",{children:["Your Email (required) ",(0,l.jsx)("span",{className:"required",children:"*"}),(0,l.jsx)("input",{type:"email",value:p,onChange:e=>f(e.target.value),required:!0,placeholder:"Enter your email address"})]}),(0,l.jsxs)("label",{children:["Transaction ID (required) ",(0,l.jsx)("span",{className:"required",children:"*"}),(0,l.jsx)("input",{type:"text",value:g,onChange:e=>v(e.target.value),required:!0,placeholder:"Enter Zelle transaction ID"}),(0,l.jsx)("small",{className:"field-help",children:"Find this in your bank app's payment history after sending"})]}),(0,l.jsxs)("label",{children:["Notes (optional)",(0,l.jsx)("textarea",{value:y,onChange:e=>b(e.target.value),placeholder:"Any additional notes or comments",rows:"3"})]})]}),(0,l.jsxs)("div",{className:"manual-submit-row",children:[(0,l.jsxs)("div",{className:"payment-summary",children:[(0,l.jsx)("span",{className:"amount-label",children:"Total Amount:"}),(0,l.jsxs)("span",{className:"amount-value",children:["$",Number(s).toFixed(2)]})]}),(0,l.jsx)("button",{type:"submit",className:"btn btn-primary payment-submit-btn",disabled:x||d,children:x?"\u23f3 Verifying Payment...":"\u2705 Verify Zelle Payment"})]}),N&&(0,l.jsx)("div",{className:"manual-message ".concat(N.type),children:N.text})]})]})}}
2,5114:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{Ew:()=>g,Wr:()=>m,Y5:()=>f,hk:()=>p,ou:()=>h,sZ:()=>d});var s=n(2555),a=n(5472),i=n(8426),o=n(7096),l=n(3387),c=e([o]);o=(c.then?(await c)():c)[0];const u="course_reviews",d=async e=>{let{userId:t,userName:n,userEmail:r,userPhotoURL:c,courseId:d,courseTitle:h,rating:m,comment:p}=e;try{if(!i.db)throw new Error("Firestore not initialized");if(!t)throw new Error("User not authenticated");if(!d)throw new Error("Course ID required");const e=Number(m);if(!Number.isFinite(e)||e<1||e>5)throw new Error("Rating must be between 1 and 5");const g=(p||"").trim();if(0===g.length)throw new Error("Comment is required");if(g.length>3e3)throw new Error("Comment too long (max 3000 characters)");let v=r;if(!v){var f;const e=await(0,l.VM)(t);v=e.success?null===(f=e.userData)||void 0===f?void 0:f.email:null}if(!v)throw new Error("Unable to determine user email. Please ensure you are logged in properly.");const y=await(0,o.WA)(t,d),b=!(null===y||void 0===y||!y.hasAccess),x="".concat(d,"_").concat(t),w=(0,a.H9)(i.db,u,x),N=(await(0,a.x7)(w)).exists()?{updatedAt:(0,a.O5)()}:{createdAt:(0,a.O5)(),updatedAt:(0,a.O5)()};return await(0,a.BN)(w,(0,s.A)({userId:t,userEmail:v,userName:n,userPhotoURL:c||"",courseId:d,courseTitle:h,rating:e,comment:g,verified:b},N),{merge:!0}),{success:!0,reviewId:x}}catch(g){return{success:!1,error:g.message}}},h=async(e,t)=>{try{if(!i.db)throw new Error("Firestore not initialized");const n=(0,a.H9)(i.db,u,"".concat(t,"_").concat(e)),r=await(0,a.x7)(n);return r.exists()?{success:!0,review:(0,s.A)({id:r.id},r.data())}:{success:!0,review:null}}catch(n){return{success:!1,error:n.message,review:null}}},m=async(e,t)=>{try{if(!i.db)throw new Error("Firestore not initialized");const n=(0,a.H9)(i.db,u,"".concat(e,"_").concat(t));return await(0,a.kd)(n),{success:!0}}catch(n){return{success:!1,error:n.message}}},p=async e=>{try{if(!i.db)throw new Error("Firestore not initialized");const t=(0,a.H9)(i.db,u,e);return await(0,a.kd)(t),{success:!0}}catch(t){return{success:!1,error:t.message}}},f=function(e,t){let{limit:n=20}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!i.db)return t({reviews:[],error:"Firestore not initialized"}),()=>{};try{const r=(0,a.P)((0,a.rJ)(i.db,u),(0,a._M)("courseId","==",e),(0,a.My)("createdAt","desc"),(0,a.AB)(n));return(0,a.aQ)(r,e=>{const n=e.docs.map(e=>(0,s.A)({id:e.id},e.data()));t({reviews:n,error:null})},e=>{let n=e.message;"permission-denied"===e.code?n="Permission denied accessing reviews. This might be a Firebase configuration issue.":"unavailable"===e.code&&(n="Firebase service temporarily unavailable. Please try again."),t({reviews:[],error:n})})}catch(r){return t({reviews:[],error:r.message}),()=>{}}},g=function(e){let{limit:t=6}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!i.db)return e({reviews:[],error:"Firestore not initialized"}),()=>{};try{const n=(0,a.P)((0,a.rJ)(i.db,u),(0,a.My)("createdAt","desc"),(0,a.AB)(t));return(0,a.aQ)(n,t=>{const n=t.docs.map(e=>(0,s.A)({id:e.id},e.data()));e({reviews:n,error:null})},t=>{let n=t.message;"permission-denied"===t.code?n="Permission denied accessing reviews. This might be a Firebase configuration issue.":"unavailable"===t.code&&(n="Firebase service temporarily unavailable. Please try again."),e({reviews:[],error:n})})}catch(n){return e({reviews:[],error:n.message}),()=>{}}};r()}catch(u){r(u)}})},5187:(e,t,n)=>{n.d(t,{Ay:()=>d,OJ:()=>u,cy:()=>c});var r=n(2555),s=n(5043),a=n(8426),i=n(3387),o=n(7898),l=n(579);const c=(0,s.createContext)({user:null,loading:!0,signInWithGoogle:async()=>({success:!1,error:"Firebase not configured"}),signInWithEmail:async()=>({success:!1,error:"Firebase not configured"}),registerWithEmail:async()=>({success:!1,error:"Firebase not configured"}),sendVerificationEmail:async()=>({success:!1,error:"Firebase not configured"}),resendVerificationEmail:async()=>({success:!1,error:"Firebase not configured"}),sendPasswordReset:async()=>({success:!1,error:"Firebase not configured"}),verifyEmail:async()=>({success:!1,error:"Firebase not configured"}),logout:async()=>({success:!1,error:"Firebase not configured"})}),u=e=>{let{children:t}=e;
2const[n,u]=(0,s.useState)(null),[d,h]=(0,s.useState)(!0);(0,s.useEffect)(()=>{if(!a.Gg)return void h(!1);const e=(0,o.hg)(a.j2,e=>{if(e){var t;if(e.emailVerified||"google.com"===(null===(t=e.providerData[0])||void 0===t?void 0:t.providerId)){var n;const t={uid:e.uid,name:e.displayName||(null===(n=e.email)||void 0===n?void 0:n.split("@")[0]),email:e.email,photoURL:e.photoURL,emailVerified:e.emailVerified,role:"student"};u(t),localStorage.setItem("user",JSON.stringify(t))}else u(null),localStorage.removeItem("user")}else{const e=localStorage.getItem("user");u(e?JSON.parse(e):null)}h(!1)});return()=>e()},[]);const m={user:n,loading:d,signInWithGoogle:async()=>{if(!a.Gg)return{success:!1,error:"Firebase not configured. Please check your environment variables."};try{const e=(await(0,o.df)(a.j2,a.hJ)).user;await(0,i.Vr)(e);const t={uid:e.uid,name:e.displayName,email:e.email,photoURL:e.photoURL,role:"student"};return localStorage.setItem("user",JSON.stringify(t)),{success:!0,user:t}}catch(e){return{success:!1,error:e.message}}},signInWithEmail:async(e,t)=>{try{const n=(await(0,o.x9)(a.j2,e,t)).user;if(!n.emailVerified)return await(0,o.CI)(a.j2),{success:!1,error:"Please verify your email before signing in. Check your inbox for the verification link.",requiresVerification:!0};await(0,i.Vr)(n);const r={uid:n.uid,name:n.displayName||e.split("@")[0],email:n.email,photoURL:n.photoURL,emailVerified:n.emailVerified,role:"student"};return localStorage.setItem("user",JSON.stringify(r)),{success:!0,user:r}}catch(n){let e="Sign-in failed";switch(n.code){case"auth/user-not-found":e="No account found with this email address.";break;case"auth/wrong-password":e="Incorrect password. Please try again.";break;case"auth/invalid-email":e="Please enter a valid email address.";break;case"auth/too-many-requests":e="Too many failed attempts. Please try again later.";break;default:e=n.message||"Sign-in failed. Please try again."}return{success:!1,error:e}}},registerWithEmail:async(e,t,n,s)=>{try{const l=(await(0,o.eJ)(a.j2,e,t)).user;return await(0,o.r7)(l,{displayName:"".concat(n," ").concat(s)}),await(0,i.Vr)((0,r.A)((0,r.A)({},l),{},{displayName:"".concat(n," ").concat(s)})),await(0,o.gA)(l,{url:"".concat(window.location.origin,"/login?emailVerified=true"),handleCodeInApp:!1}),await(0,o.CI)(a.j2),{success:!0,requiresVerification:!0,message:"Registration successful! Please check your email and click the verification link before signing in.",user:{uid:l.uid,name:"".concat(n," ").concat(s),email:l.email,emailVerified:l.emailVerified}}}catch(l){let e="Registration failed";switch(l.code){case"auth/email-already-in-use":e="An account with this email already exists. Please try signing in instead.";break;case"auth/weak-password":e="Password is too weak. Please choose a stronger password.";break;case"auth/invalid-email":e="Please enter a valid email address.";break;default:e=l.message||"Registration failed. Please try again."}return{success:!1,error:e}}},logout:async()=>{try{return await(0,o.CI)(a.j2),localStorage.removeItem("user"),u(null),{success:!0}}catch(e){return{success:!1,error:e.message}}},sendVerificationEmail:async()=>{try{return a.j2.currentUser?a.j2.currentUser.emailVerified?{success:!1,error:"Email is already verified."}:(await(0,o.gA)(a.j2.currentUser,{url:"".concat(window.location.origin,"/login?emailVerified=true"),handleCodeInApp:!1}),{success:!0,message:"Verification email sent! Please check your inbox and **SPAM** folder."}):{success:!1,error:"No user is currently signed in."}}catch(e){return{success:!1,error:e.message||"Failed to send verification email."}}},resendVerificationEmail:async(e,t)=>{try{const n=(await(0,o.x9)(a.j2,e,t)).user;return n.emailVerified?(await(0,o.CI)(a.j2),{success:!1,error:"Email is already verified. You can sign in normally."}):(await(0,o.gA)(n,{url:"".concat(window.location.origin,"/login?emailVerified=true"),handleCodeInApp:!1}),await(0,o.CI)(a.j2),{success:!0,message:"Verification email sent! Please check your inbox and **SPAM** folder."})}catch(n){let e="Failed to resend verification email";switch(n.code){case"auth/user-not-found":e="No account found with this email address.";break;case"auth/wrong-password":e="Incorrect password. Please enter the correct password.";break;case"auth/invalid-email":e="Please enter a valid email address.";break;case"auth/too-many-requests":e="Too many attempts. Please try again later.";break;default:e=n.message||"Failed to resend verification email. Please try again."}return{success:!1,error:e}}},sendPasswordReset:async e=>{try{return await(0,o.J1)(a.j2,e,{url:"".concat(window.location.origin,"/login?passwordReset=true"),handleCodeInApp:!1}),{success:!0,message:"If an account with this email exists, password reset instructions will be sent. Please check your inbox and **SPAM** folder."}}catch(t){let e="Failed to send password reset email";switch(t.code){case"auth/user-not-found":e="No account found with this email address. Please check your email or sign up first.";break;case"auth/invalid-email":e="Please enter a valid email address.";break;case"auth/too-many-requests":e="Too many password reset attempts. Please try again later.";break;default:e=t.message||"Failed to send password reset email. Please try again."}return{success:!1,error:e}}},verifyEmail:async e=>{try{return await(0,o.sv)(a.j2,e),{success:!0,message:"Email verified successfully! You can now sign in."}}catch(t){let e="Email verification failed";switch(t.code){case"auth/expired-action-code":e="The verification link has expired. Please request a new one.";break;case"auth/invalid-action-code":e="The verification link is invali
2d. Please request a new one.";break;case"auth/user-disabled":e="This account has been disabled.";break;default:e=t.message||"Email verification failed."}return{success:!1,error:e}}}};return(0,l.jsx)(c.Provider,{value:m,children:t})},d=u},5278:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(5043),s=n(579);const a=e=>{let{value:t=0}=e;const n=Math.max(0,Math.min(5,Number(t)));return(0,s.jsx)("span",{className:"review-stars","aria-label":"".concat(n," out of 5"),children:"\u2605".repeat(Math.round(n)).padEnd(5,"\u2606")})},i=e=>{var t;let{review:n,showCourseTitle:i=!1,isOwner:o=!1,isAdmin:l=!1,onEdit:c,onDelete:u,onAdminDelete:d}=e;const[h,m]=(0,r.useState)(!1),[p,f]=(0,r.useState)(!1);if(!n)return null;const{userName:g,userPhotoURL:v,rating:y,comment:b,verified:x,courseTitle:w}=n,N=(j=g)?j!==j.toLowerCase()||j.includes(" ")?j:j.replace(/([a-z])([A-Z])/g,"$1 $2").split(/[._-]/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ").trim()||j:"User";var j;const E=(b||"").length>300,S=E&&!h?b.slice(0,300)+"...":b,C=v&&!p;return(0,s.jsxs)("div",{className:"review-card",id:"review-".concat(n.id),children:[l&&!o&&d&&(0,s.jsx)("button",{className:"review-admin-delete-corner",onClick:d,title:"Admin: Delete this review",children:"\ud83d\uddd1\ufe0f"}),(0,s.jsxs)("div",{className:"review-card-header",children:[(0,s.jsxs)("div",{className:"review-user",children:[(0,s.jsx)("div",{className:"review-avatar","aria-hidden":!0,children:C?(0,s.jsx)("img",{src:v,alt:N||"User",onError:()=>{f(!0)}}):(0,s.jsx)("div",{className:"default-avatar",children:null===(t=(N||"User").charAt(0))||void 0===t?void 0:t.toUpperCase()})}),(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"review-username",children:[(0,s.jsx)("span",{children:N||"User"}),x&&(0,s.jsx)("span",{className:"review-verified",title:"Verified User",children:"\u2713"})]})})]}),(0,s.jsx)(a,{value:y})]}),i&&w&&(0,s.jsx)("div",{className:"review-course-chip",children:w}),(0,s.jsxs)("div",{className:"review-comment-section",children:[(0,s.jsx)("p",{className:"review-comment ".concat(h?"expanded":""),children:S}),E&&(0,s.jsx)("button",{className:"review-expand-btn",onClick:()=>m(!h),children:h?"Show less":"Read more"})]}),o&&(0,s.jsxs)("div",{className:"review-actions",children:[c&&(0,s.jsx)("button",{className:"btn btn-secondary btn-small",onClick:c,children:"Edit"}),u&&(0,s.jsx)("button",{className:"btn btn-secondary btn-small",onClick:u,children:"Delete"})]})]})},o=e=>{if(!e)return null;const t="string"===typeof e?e:String(e);if(t.toLowerCase().includes("requires an index")){const e=t.match(/https?:\/\/\S+/),n=e?e[0]:"https://console.firebase.google.com/";return(0,s.jsxs)("div",{children:["This query needs a Firestore composite index."," ",(0,s.jsx)("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"Create index"}),(0,s.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:4},children:"Fields: courseId Asc, createdAt Desc (Collection: course_reviews)"})]})}return t},l=e=>{let{reviews:t=[],loading:n=!1,error:r=null,showCourseTitle:a=!1,currentUserId:l,isCurrentUserAdmin:c=!1,onEdit:u,onDelete:d,onAdminDelete:h}=e;return n?(0,s.jsx)("div",{className:"reviews-loading",children:"Loading reviews..."}):r?(0,s.jsx)("div",{className:"reviews-error",children:o(r)}):t.length?(0,s.jsx)("div",{className:"reviews-list",children:t.map(e=>(0,s.jsx)(i,{review:e,showCourseTitle:a,isOwner:l&&e.userId===l,isAdmin:c,onEdit:u?()=>u(e):void 0,onDelete:d?()=>d(e):void 0,onAdminDelete:h?()=>h(e):void 0},e.id))}):(0,s.jsx)("div",{className:"reviews-empty",children:"No reviews yet."})}},5293:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2555),s=n(5043),a=n(7324),i=n(579);const o=e=>{let{course:t,section:n,sectionIndex:o,onClose:l,onSave:c,showNotification:u}=e;const d=null!==n&&void 0!==n,[h,m]=(0,s.useState)({section:"",description:"",topics:[""]}),[p,f]=(0,s.useState)(!1),[g,v]=(0,s.useState)(null);(0,s.useEffect)(()=>{n&&m({section:n.section||"",description:n.description||"",topics:Array.isArray(n.topics)?n.topics.map(e=>"string"===typeof e?e:e.title||""):[""]})},[n]);const y=e=>{const{name:t,value:n}=e.target;m(e=>(0,r.A)((0,r.A)({},e),{},{[t]:n}))};return(0,i.jsx)("div",{className:"modal-overlay",onClick:l,children:(0,i.jsxs)("div",{className:"modal-content curriculum-manager-modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h2",{children:d?"\u270f\ufe0f Edit Section":"\u2795 Add Curriculum Section"}),(0,i.jsx)("button",{className:"modal-close",onClick:l,children:"\xd7"})]}),g&&(0,i.jsx)("div",{className:"error-message",children:g}),(0,i.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),f(!0),v(null);const n=h.topics.filter(e=>""!==e.trim());if(0===n.length){const e="Please add at least one topic";return v(e),u&&u(e,"error"),void f(!1)}try{const e=(0,r.A)((0,r.A)({},h),{},{topics:n});d?(await(0,a.YY)(t.id,o,e),u&&u("Section updated successfully","success")):(await(0,a.kU)(t.id,e),u&&u("Section created successfully","success")),c(),l()}catch(s){const e=s.message||"Failed to ".concat(d?"update":"create"," section");v(e),u&&u(e,"error")}finally{f(!1)}},className:"curriculum-manager-form",children:[(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"section",children:"Section Title *"}),(0,i.jsx)("input",{type:"text",id:"section",name:"section",value:h.section,onChange:y,placeholder:"e.g., Foundation, Neural Networks",required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"description",children:"Description"}),(0,i.jsx)("textarea",{id:"description",name:"description",value:h.description,onChange:y,rows:"3",placeholder:"Brief description of this section"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{children:"Topics *"}),(0,i.jsx)("div",{className:"topics-list",children:h.topics.map((e,t)=>(0,i.jsxs)("div",{className:"topic-item",children:[(0,i.jsx)("input",{type:"text",value:e,onCh
2ange:e=>((e,t)=>{m(n=>(0,r.A)((0,r.A)({},n),{},{topics:n.topics.map((n,r)=>r===e?t:n)}))})(t,e.target.value),placeholder:"Topic ".concat(t+1)}),h.topics.length>1&&(0,i.jsx)("button",{type:"button",className:"btn-icon btn-danger",onClick:()=>(e=>{if(1===h.topics.length){const e="A section must have at least one topic";return alert(e),void(u&&u(e,"error"))}m(t=>(0,r.A)((0,r.A)({},t),{},{topics:t.topics.filter((t,n)=>n!==e)}))})(t),title:"Remove topic",children:"\ud83d\uddd1\ufe0f"})]},t))}),(0,i.jsx)("button",{type:"button",className:"btn-secondary btn-sm",onClick:()=>{m(e=>(0,r.A)((0,r.A)({},e),{},{topics:[...e.topics,""]}))},children:"+ Add Topic"})]}),(0,i.jsxs)("div",{className:"modal-actions",children:[d&&(0,i.jsx)("button",{type:"button",className:"btn-danger",onClick:async()=>{if(window.confirm("Are you sure you want to delete this section? This action cannot be undone.")){f(!0),v(null);try{await(0,a.GE)(t.id,o),u&&u("Section deleted successfully","success"),c(),l()}catch(e){const t=e.message||"Failed to delete section";v(t),u&&u(t,"error"),f(!1)}}},disabled:p,children:"Delete Section"}),(0,i.jsx)("div",{style:{flex:1}}),(0,i.jsx)("button",{type:"button",className:"btn-secondary",onClick:l,disabled:p,children:"Cancel"}),(0,i.jsx)("button",{type:"submit",className:"btn-primary",disabled:p,children:p?"Saving...":d?"Update Section":"Create Section"})]})]})]})})}},5401:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(2555),s=n(5043),a=n(579);const i=e=>{let{course:t,batch:n,onClose:i,onSave:o,showNotification:l}=e;
2const[c,u]=(0,s.useState)([]),[d,h]=(0,s.useState)(!1),[m,p]=(0,s.useState)(null),[f,g]=(0,s.useState)({date:"",time:"",topic:"",meetingLink:"",duration:"90"}),[v,y]=(0,s.useState)(null),[b,x]=(0,s.useState)(!1);(0,s.useEffect)(()=>{null!==n&&void 0!==n&&n.schedule&&u(n.schedule||[])},[n]);const w=e=>{const{name:t,value:n}=e.target;g(e=>(0,r.A)((0,r.A)({},e),{},{[t]:n}))},N=()=>{g({date:"",time:"",topic:"",meetingLink:"",duration:"90"}),p(null),h(!1)},j=(e,t)=>{if(!e)return"No date set";return new Date(e+"T"+(t||"00:00")).toLocaleString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})},E=(e,t)=>{if(!e)return!1;return new Date(e+"T"+(t||"00:00"))<new Date};return(0,a.jsx)("div",{className:"modal-overlay",onClick:i,children:(0,a.jsxs)("div",{className:"modal-content schedule-manager-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsxs)("h2",{children:["\ud83d\udcc5 Manage Schedule - ",(null===n||void 0===n?void 0:n.batchName)||"Batch"]}),(0,a.jsx)("button",{className:"btn-close",onClick:i,children:"\xd7"})]}),v&&(0,a.jsx)("div",{className:"error-message",children:v}),(0,a.jsxs)("div",{className:"modal-body",children:[(0,a.jsxs)("div",{className:"schedule-list",children:[(0,a.jsxs)("div",{className:"schedule-list-header",children:[(0,a.jsxs)("h3",{children:["Sessions (",c.length,")"]}),(0,a.jsx)("button",{className:"btn btn-primary",onClick:()=>h(!0),disabled:d,children:"+ Add Session"})]}),0===c.length&&!d&&(0,a.jsx)("div",{className:"empty-state",children:(0,a.jsx)("p",{children:'No sessions scheduled yet. Click "Add Session" to create one.'})}),c.map((e,t)=>(0,a.jsxs)("div",{className:"schedule-item ".concat(E(e.date,e.time)?"past":"upcoming"),children:[(0,a.jsx)("div",{className:"schedule-icon",children:E(e.date,e.time)?"\u2713":"\ud83d\udcc6"}),(0,a.jsxs)("div",{className:"schedule-info",children:[(0,a.jsx)("h4",{children:e.topic}),(0,a.jsxs)("div",{className:"schedule-meta",children:[(0,a.jsx)("span",{className:"schedule-datetime",children:j(e.date,e.time)}),(0,a.jsxs)("span",{className:"schedule-duration",children:[e.duration," minutes"]})]}),e.meetingLink&&(0,a.jsx)("a",{href:e.meetingLink,target:"_blank",rel:"noopener noreferrer",className:"meeting-link",children:"Join Meeting \u2192"})]}),(0,a.jsxs)("div",{className:"schedule-actions",children:[(0,a.jsx)("button",{className:"btn-icon",onClick:()=>(e=>{const t=c[e];g({date:t.date||"",time:t.time||"",topic:t.topic||"",meetingLink:t.meetingLink||"",duration:t.duration||"90"}),p(e),h(!0)})(t),title:"Edit",children:"\u270f\ufe0f"}),(0,a.jsx)("button",{className:"btn-icon btn-danger",onClick:()=>(async e=>{if(window.confirm("Are you sure you want to delete this session?")){x(!0),y(null);
2try{const t=c.filter((t,n)=>n!==e);u(t),l&&l("Session deleted successfully","success"),o()}catch(t){const e=t.message||"Failed to delete session";y(e),l&&l(e,"error")}finally{x(!1)}}})(t),title:"Delete",children:"\ud83d\uddd1\ufe0f"})]})]},t))]}),d&&(0,a.jsxs)("div",{className:"schedule-form",children:[(0,a.jsx)("h3",{children:null!==m?"Edit Session":"Add New Session"}),(0,a.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),x(!0),y(null);try{const e=(0,r.A)((0,r.A)({},f),{},{createdAt:(new Date).toISOString()});if(null!==m){const t=[...c];t[m]=e,u(t),l&&l("Session updated successfully","success")}else u([...c,e]),l&&l("Session added successfully","success");o(),N()}catch(t){const e=t.message||"Failed to ".concat(null!==m?"update":"add"," session");y(e),l&&l(e,"error")}finally{x(!1)}},children:[(0,a.jsxs)("div",{className:"form-grid",children:[(0,a.jsxs)("div",{className:"form-group full-width",children:[(0,a.jsx)("label",{htmlFor:"topic",children:"Session Topic *"}),(0,a.jsx)("input",{type:"text",id:"topic",name:"topic",value:f.topic,onChange:w,required:!0,placeholder:"e.g., Introduction to Neural Networks"})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"date",children:"Date *"}),(0,a.jsx)("input",{type:"date",id:"date",name:"date",value:f.date,onChange:w,required:!0})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"time",children:"Time *"}),(0,a.jsx)("input",{type:"time",id:"time",name:"time",value:f.time,onChange:w,required:!0})]}),(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{htmlFor:"duration",children:"Duration (minutes)"}),(0,a.jsx)("input",{type:"number",id:"duration",name:"duration",value:f.duration,onChange:w,min:"15",max:"480",step:"15",placeholder:"90"})]}),(0,a.jsxs)("div",{className:"form-group full-width",children:[(0,a.jsx)("label",{htmlFor:"meetingLink",children:"Meeting Link (Zoom/Google Meet)"}),(0,a.jsx)("input",{type:"url",id:"meetingLink",name:"meetingLink",value:f.meetingLink,onChange:w,placeholder:"https://zoom.us/j/..."})]})]}),(0,a.jsxs)("div",{className:"form-actions",children:[(0,a.jsx)("button",{type:"button",className:"btn btn-secondary",onClick:N,disabled:b,children:"Cancel"}),(0,a.jsx)("button",{type:"submit",className:"btn btn-primary",disabled:b,children:b?"Saving...":null!==m?"Update Session":"Add Session"})]})]})]})]})]})})}},5426:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(5043),s=n(4366),a=n(342),i=n(579);const o=()=>{const[e,t]=(0,r.useState)(""),[n,o]=(0,r.useState)(!1),[l,c]=(0,r.useState)(""),[u,d]=(0,r.useState)(""),[h,m]=(0,r.useState)(!1),{sendPasswordReset:p}=(0,a.A)(),[f]=(0,s.ok)();(0,r.useEffect)(()=>{"true"===f.get("passwordReset")&&d("Password reset successful! You can now sign in with your new password.")},[f]);return(0,i.jsx)("div",{className:"forgot-password-page-container",children:(0,i.jsxs)("div",{className:"forgot-password-card",children:[(0,i.jsxs)("div",{className:"forgot-password-header",children:[(0,i.jsx)("h1",{className:"forgot-password-title",children:"Reset Your Password"}),(0,i.jsx)("p",{className:"forgot-password-subtitle",children:h?"Check your email for reset instructions. If you don't see the email, please check your **SPAM**/junk folder.":"Enter your email address and we'll send you instructions to reset your password"})]}),l&&(0,i.jsx)("div",{className:"forgot-password-error-message",children:l}),u&&(0,i.jsx)("div",{className:"forgot-password-success-message",children:u}),h?(0,i.jsxs)("div",{className:"email-sent-container",children:[(0,i.jsxs)("div",{className:"forgot-password-success-container",children:[(0,i.jsx)("div",{className:"forgot-password-success-icon",children:"\ud83d\udce7"}),(0,i.jsx)("h3",{className:"forgot-password-success-title",children:"Email Sent!"}),(0,i.jsxs)("p",{className:"forgot-password-success-text",children:["We've sent password reset instructions to ",(0,i.jsx)("strong",{children:e})]}),(0,i.jsx)("p",{className:"forgot-password-success-note",children:"Don't see the email? Check your spam folder or try again."})]}),(0,i.jsx)("button",{onClick:()=>{m(!1),d(""),c("")},className:"btn btn-secondary forgot-password-back-button",children:"Send Another Email"})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),!e.trim())return void c("Please enter your email address.");o(!0),c(""),d("");const n=await p(e);n.success?(d(n.message),m(!0)):c(n.error),o(!1)},className:"forgot-password-form",children:[(0,i.jsxs)("div",{className:"form-field",children:[(0,i.jsx)("label",{className:"form-label",children:"Email Address"}
2),(0,i.jsx)("input",{type:"email",value:e,onChange:e=>{t(e.target.value),l&&c("")},placeholder:"Enter your email address",required:!0,className:"form-input"})]}),(0,i.jsx)("button",{type:"submit",className:"btn",disabled:n,children:n?"Sending...":"Send Reset Email"})]}),(0,i.jsxs)("div",{style:{background:"rgba(59, 130, 246, 0.1)",border:"1px solid rgba(59, 130, 246, 0.3)",borderRadius:"8px",padding:"15px",marginTop:"20px",fontSize:"0.9rem",color:"var(--text-color)"},children:[(0,i.jsx)("strong",{children:"\ud83d\udcdd Note:"})," Password reset works even if your email is not verified. After resetting your password, you'll also be able to verify your email if needed."]})]}),(0,i.jsxs)("div",{className:"forgot-password-footer",children:[(0,i.jsxs)("p",{className:"footer-text",children:["Remember your password?"," ",(0,i.jsx)(s.N_,{to:"/login",className:"footer-link",children:"Back to Sign In"})]}),(0,i.jsxs)("p",{className:"footer-text",children:["Don't have an account?"," ",(0,i.jsx)(s.N_,{to:"/register",className:"footer-link",children:"Sign up"})]})]})]})})}},5472:(e,t,n)=>{n.d(t,{gS:()=>bc,rJ:()=>el,kd:()=>yc,H9:()=>tl,FD:()=>tc,x7:()=>mc,GG:()=>fc,aU:()=>ol,GV:()=>Cc,AB:()=>$l,aQ:()=>xc,My:()=>Yl,P:()=>Hl,O5:()=>Sc,BN:()=>gc,EO:()=>Zl,mZ:()=>vc,_M:()=>Gl,wP:()=>kc});var r,s,a=n(7150),i=n(8812),o=n(443),l=n(1529),c="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},u={};(function(){var e;function t(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}function n(e,t,n){n||(n=0);var r=Array(16);if("string"===typeof t)for(var s=0;16>s;++s)r[s]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(s=0;16>s;++s)r[s]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],s=e.g[2];var a=e.g[3],i=t+(a^n&(s^a))+r[0]+3614090360&4294967295;i=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=(n=(s=(a=(t=n+(i<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[1]+3905402710&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[3]+3250441966&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[4]+4118548399&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[5]+1200080426&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[7]+4249261313&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[8]+1770035416&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[9]+2336552879&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[11]+2304563134&4294967295)<<22&4294967295|i>>>10))+((i=t+(a^n&(s^a))+r[12]+1804603682&4294967295)<<7&4294967295|i>>>25))+((i=a+(s^t&(n^s))+r[13]+4254626195&4294967295)<<12&4294967295|i>>>20))+((i=s+(n^a&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|i>>>15))+((i=n+(t^s&(a^t))+r[15]+1236535329&4294967295)<<22&4294967295|i>>>10))+((i=t+(s^a&(n^s))+r[1]+4129170786&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[11]+643717713&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[0]+3921069994&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[5]+3593408605&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[15]+3634488961&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[4]+3889429448&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[9]+568446438&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[3]+4107603335&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[8]+1163531501&4294967295)<<20&4294967295|i>>>12))+((i=t+(s^a&(n^s))+r[13]+2850285829&4294967295)<<5&4294967295|i>>>27))+((i=a+(n^s&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|i>>>23))+((i=s+(t^n&(a^t))+r[7]+1735328473&4294967295)<<14&4294967295|i>>>18))+((i=n+(a^t&(s^a))+r[12]+2368359562&4294967295)<<20&4294967295|i>>>12))+((i=t+(n^s^a)+r[5]+4294588738&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[8]+2272392833&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[14]+4259657740&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[1]+2763975236&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[4]+1272893353&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[10]+3200236656&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[13]+681279174&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[0]+3936430074&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[6]+76029189&4294967295)<<23&4294967295|i>>>9))+((i=t+(n^s^a)+r[9]+3654602809&4294967295)<<4&4294967295|i>>>28))+((i=a+(t^n^s)+r[12]+3873151461&4294967295)<<11&4294967295|i>>>21))+((i=s+(a^t^n)+r[15]+530742520&4294967295)<<16&4294967295|i>>>16))+((i=n+(s^a^t)+r[2]+3299628645&4294967295)<<23&4294967295|i>>>9))+((i=t+(s^(n|~a))+r[0]+4096336452&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[7]+1126891415&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[14]+2878612391&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[5]+4237533241&4294967295)<<21&4294967295|i>>>11))+((i=t+(s^(n|~a))+r[12]+1700485571&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[3]+2399980690&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[10]+4293915773&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[1]+2240044497&4294967295)<<21&4294967295|i>>>11))+((i=t+(s^(n|~a))+r[8]+1873313359&4294967295)<<6&4294967295|i>>>26))+((i=a+(n^(t|~s))+r[15]+4264355552&4294967295)<<10&4294967295|i>>>22))+((i=s+(t^(a|~n))+r[6]+2734768916&4294967295)<<15&4294967295|i>>>17))+((i=n+(a^(s|~t))+r[13]+1309151649&4294967295)<<21&4294967295|i>>>11))+((a=(t=n+((i=t+(s^(n|~a))+r[4]+4149444226&4294967295)<<6&4294967295|i>>>
226))+((i=a+(n^(t|~s))+r[11]+3174756917&4294967295)<<10&4294967295|i>>>22))^((s=a+((i=s+(t^(a|~n))+r[2]+718787259&4294967295)<<15&4294967295|i>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(s+(i<<21&4294967295|i>>>11))&4294967295,e.g[2]=e.g[2]+s&4294967295,e.g[3]=e.g[3]+a&4294967295}function a(e,t){this.h=t;for(var n=[],r=!0,s=e.length-1;0<=s;s--){var a=0|e[s];r&&a==t||(n[s]=a,r=!1)}this.g=n}!function(e,t){function n(){}n.prototype=t.prototype,e.D=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.C=function(e,n,r){for(var s=Array(arguments.length-2),a=2;a<arguments.length;a++)s[a-2]=arguments[a];return t.prototype[n].apply(e,s)}}(t,function(){this.blockSize=-1}),t.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0},t.prototype.u=function(e,t){void 0===t&&(t=e.length);for(var r=t-this.blockSize,s=this.B,a=this.h,i=0;i<t;){if(0==a)for(;i<=r;)n(this,e,i),i+=this.blockSize;if("string"===typeof e){for(;i<t;)if(s[a++]=e.charCodeAt(i++),a==this.blockSize){n(this,s),a=0;break}}else for(;i<t;)if(s[a++]=e[i++],a==this.blockSize){n(this,s),a=0;break}}this.h=a,this.o+=t},t.prototype.v=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.o;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.u(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var i={};function o(e){return-128<=e&&128>e?function(e,t){var n=i;return Object.prototype.hasOwnProperty.call(n,e)?n[e]:n[e]=t(e)}(e,function(e){return new a([0|e],0>e?-1:0)}):new a([0|e],0>e?-1:0)}function l(e){if(isNaN(e)||!isFinite(e))return c;if(0>e)return f(l(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=4294967296;return new a(t,0)}var c=o(0),d=o(1),h=o(16777216);function m(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function p(e){return-1==e.h}function f(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new a(n,~e.h).add(d)}function g(e,t){return e.add(f(t))}function v(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function y(e,t){this.g=e,this.h=t}function b(e,t){if(m(t))throw Error("division by zero");if(m(e))return new y(c,c);if(p(e))return t=b(f(e),t),new y(f(t.g),f(t.h));if(p(t))return t=b(e,f(t)),new y(f(t.g),t.h);if(30<e.g.length){if(p(e)||p(t))throw Error("slowDivide_ only works with positive integers.");for(var n=d,r=t;0>=r.l(e);)n=x(n),r=x(r);var s=w(n,1),a=w(r,1);for(r=w(r,2),n=w(n,2);!m(r);){var i=a.add(r);0>=i.l(e)&&(s=s.add(n),a=i),r=w(r,1),n=w(n,1)}return t=g(e,s.j(t)),new y(s,t)}for(s=c;0<=e.l(t);){for(n=Math.max(1,Math.floor(e.m()/t.m())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),i=(a=l(n)).j(t);p(i)||0<i.l(e);)i=(a=l(n-=r)).j(t);m(a)&&(a=d),s=s.add(a),e=g(e,i)}return new y(s,e)}function x(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.i(r)<<1|e.i(r-1)>>>31;return new a(n,e.h)}function w(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,s=[],i=0;i<r;i++)s[i]=0<t?e.i(i+n)>>>t|e.i(i+n+1)<<32-t:e.i(i+n);return new a(s,e.h)}(e=a.prototype).m=function(){if(p(this))return-f(this).m();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.i(n);e+=(0<=r?r:4294967296+r)*t,t*=4294967296}return e},e.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(m(this))return"0";if(p(this))return"-"+f(this).toString(e);for(var t=l(Math.pow(e,6)),n=this,r="";;){var s=b(n,t).g,a=((0<(n=g(n,s.j(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(m(n=s))return a+r;for(;6>a.length;)a="0"+a;r=a+r}},e.i=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},e.l=function(e){return p(e=g(this,e))?-1:m(e)?0:1},e.abs=function(){return p(this)?f(this):this},e.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,s=0;s<=t;s++){var i=r+(65535&this.i(s))+(65535&e.i(s)),o=(i>>>16)+(this.i(s)>>>16)+(e.i(s)>>>16);r=o>>>16,i&=65535,o&=65535,n[s]=o<<16|i}return new a(n,-2147483648&n[n.length-1]?-1:0)},e.j=function(e){if(m(this)||m(e))return c;if(p(this))return p(e)?f(this).j(f(e)):f(f(this).j(e));if(p(e))return f(this.j(f(e)));if(0>this.l(h)&&0>e.l(h))return l(this.m()*e.m());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var s=0;s<e.g.length;s++){var i=this.i(r)>>>16,o=65535&this.i(r),u=e.i(s)>>>16,d=65535&e.i(s);n[2*r+2*s]+=o*d,v(n,2*r+2*s),n[2*r+2*s+1]+=i*d,v(n,2*r+2*s+1),n[2*r+2*s+1]+=o*u,v(n,2*r+2*s+1),n[2*r+2*s+2]+=i*u,v(n,2*r+2*s+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new a(n,0)},e.A=function(e){return b(this,e).h},e.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)&e.i(r);return new a(n,this.h&e.h)},e.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)|e.i(r);return new a(n,this.h|e.h)},e.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.i(r)^e.i(r);return new a(n,this.h^e.h)},t.prototype.digest=t.prototype.v,t.prototype.reset=t.prototype.s,t.prototype.update=t.prototype.u,s=u.Md5=t,a.prototype.add=a.prototype.add,a.prototype.multiply=a.prototype.j,a.prototype.modulo=a.prototype.A,a.prototype.compare=a.prototype.l,a.prototype.toNumber=a.prototype.m,a.prototype.toString=a.prototype.toString,a.prototype.getBits=a.prototype.i,a.fromNumber=l,a.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);
2if("-"==t.charAt(0))return f(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=l(Math.pow(n,8)),s=c,a=0;a<t.length;a+=8){var i=Math.min(8,t.length-a),o=parseInt(t.substring(a,a+i),n);8>i?(i=l(Math.pow(n,i)),s=s.j(i).add(l(o))):s=(s=s.j(r)).add(l(o))}return s},r=u.Integer=a}).apply("undefined"!==typeof c?c:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});var d,h,m,p,f,g,v,y,b="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:{},x={};(function(){var e,t="function"==typeof Object.defineProperties?Object.defineProperty:function(e,t,n){return e==Array.prototype||e==Object.prototype||(e[t]=n.value),e};var n=function(e){e=["object"==typeof globalThis&&globalThis,e,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof b&&b];for(var t=0;t<e.length;++t){var n=e[t];if(n&&n.Math==Math)return n}throw Error("Cannot find global object")}(this);!function(e,r){if(r)e:{var s=n;e=e.split(".");for(var a=0;a<e.length-1;a++){var i=e[a];if(!(i in s))break e;s=s[i]}(r=r(a=s[e=e[e.length-1]]))!=a&&null!=r&&t(s,e,{configurable:!0,writable:!0,value:r})}}("Array.prototype.values",function(e){return e||function(){return function(e,t){e instanceof String&&(e+="");var n=0,r=!1,s={next:function(){if(!r&&n<e.length){var s=n++;return{value:t(s,e[s]),done:!1}}return r=!0,{done:!0,value:void 0}}};return s[Symbol.iterator]=function(){return s},s}(this,function(e,t){return t})}});var r=r||{},s=this||self;function a(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function i(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}function o(e,t,n){return e.call.apply(e.bind,arguments)}function l(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function c(e,t,n){return(c=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?o:l).apply(null,arguments)}function u(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function w(e,t){function n(){}n.prototype=t.prototype,e.aa=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.Qb=function(e,n,r){for(var s=Array(arguments.length-2),a=2;a<arguments.length;a++)s[a-2]=arguments[a];return t.prototype[n].apply(e,s)}}function N(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function j(e,t){for(let n=1;n<arguments.length;n++){const t=arguments[n];if(a(t)){const n=e.length||0,r=t.length||0;e.length=n+r;for(let s=0;s<r;s++)e[n+s]=t[s]}else e.push(t)}}function E(e){return/^[\s\xa0]*$/.test(e)}function S(){var e=s.navigator;return e&&(e=e.userAgent)?e:""}function C(e){return C[" "](e),e}C[" "]=function(){};var k=-1!=S().indexOf("Gecko")&&!(-1!=S().toLowerCase().indexOf("webkit")&&-1==S().indexOf("Edge"))&&!(-1!=S().indexOf("Trident")||-1!=S().indexOf("MSIE"))&&-1==S().indexOf("Edge");function _(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function A(e){const t={};for(const n in e)t[n]=e[n];return t}const T="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function I(e,t){let n,r;for(let s=1;s<arguments.length;s++){for(n in r=arguments[s],r)e[n]=r[n];for(let t=0;t<T.length;t++)n=T[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function P(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function R(e){s.setTimeout(()=>{throw e},0)}function D(){var e=U;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var O=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new L,e=>e.reset());class L{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}let M,F=!1,U=new class{constructor(){this.h=this.g=null}add(e,t){const n=O.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},V=()=>{const e=s.Promise.resolve(void 0);M=()=>{e.then(z)}};var z=()=>{for(var e;e=D();){try{e.h.call(e.g)}catch(n){R(n)}var t=O;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}F=!1};function B(){this.s=this.s,this.C=this.C}function q(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}B.prototype.s=!1,B.prototype.ma=function(){this.s||(this.s=!0,this.N())},B.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()},q.prototype.h=function(){this.defaultPrevented=!0};var H=function(){if(!s.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{const e=()=>{};s.addEventListener("test",e,t),s.removeEventListener("test",e,t)}catch(n){}return e}();function W(e,t){if(q.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(k){e:{try{C(t.nodeName);var s=!0;break e}catch(a){}s=!1}s||(t=null)}}
2else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"===typeof e.pointerType?e.pointerType:G[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&W.aa.h.call(this)}}w(W,q);var G={2:"touch",3:"pen",4:"mouse"};W.prototype.h=function(){W.aa.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var K="closure_listenable_"+(1e6*Math.random()|0),J=0;function Y(e,t,n,r,s){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.ha=s,this.key=++J,this.da=this.fa=!1}function Q(e){e.da=!0,e.listener=null,e.proxy=null,e.src=null,e.ha=null}function $(e){this.src=e,this.g={},this.h=0}function X(e,t){var n=t.type;if(n in e.g){var r,s=e.g[n],a=Array.prototype.indexOf.call(s,t,void 0);(r=0<=a)&&Array.prototype.splice.call(s,a,1),r&&(Q(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function Z(e,t,n,r){for(var s=0;s<e.length;++s){var a=e[s];if(!a.da&&a.listener==t&&a.capture==!!n&&a.ha==r)return s}return-1}$.prototype.add=function(e,t,n,r,s){var a=e.toString();(e=this.g[a])||(e=this.g[a]=[],this.h++);var i=Z(e,t,r,s);return-1<i?(t=e[i],n||(t.fa=!1)):((t=new Y(t,this.src,a,!!r,s)).fa=n,e.push(t)),t};var ee="closure_lm_"+(1e6*Math.random()|0),te={};function ne(e,t,n,r,s){if(r&&r.once)return se(e,t,n,r,s);if(Array.isArray(t)){for(var a=0;a<t.length;a++)ne(e,t[a],n,r,s);return null}return n=de(n),e&&e[K]?e.K(t,n,i(r)?!!r.capture:!!r,s):re(e,t,n,!1,r,s)}function re(e,t,n,r,s,a){if(!t)throw Error("Invalid event type");var o=i(s)?!!s.capture:!!s,l=ce(e);if(l||(e[ee]=l=new $(e)),(n=l.add(t,n,r,o,a)).proxy)return n;if(r=function(){function e(n){return t.call(e.src,e.listener,n)}const t=le;return e}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)H||(s=o),void 0===s&&(s=!1),e.addEventListener(t.toString(),r,s);else if(e.attachEvent)e.attachEvent(oe(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function se(e,t,n,r,s){if(Array.isArray(t)){for(var a=0;a<t.length;a++)se(e,t[a],n,r,s);return null}return n=de(n),e&&e[K]?e.L(t,n,i(r)?!!r.capture:!!r,s):re(e,t,n,!0,r,s)}function ae(e,t,n,r,s){if(Array.isArray(t))for(var a=0;a<t.length;a++)ae(e,t[a],n,r,s);else r=i(r)?!!r.capture:!!r,n=de(n),e&&e[K]?(e=e.i,(t=String(t).toString())in e.g&&(-1<(n=Z(a=e.g[t],n,r,s))&&(Q(a[n]),Array.prototype.splice.call(a,n,1),0==a.length&&(delete e.g[t],e.h--)))):e&&(e=ce(e))&&(t=e.g[t.toString()],e=-1,t&&(e=Z(t,n,r,s)),(n=-1<e?t[e]:null)&&ie(n))}function ie(e){if("number"!==typeof e&&e&&!e.da){var t=e.src;if(t&&t[K])X(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(oe(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=ce(t))?(X(n,e),0==n.h&&(n.src=null,t[ee]=null)):Q(e)}}}function oe(e){return e in te?te[e]:te[e]="on"+e}function le(e,t){if(e.da)e=!0;else{t=new W(t,this);var n=e.listener,r=e.ha||e.src;e.fa&&ie(e),e=n.call(r,t)}return e}function ce(e){return(e=e[ee])instanceof $?e:null}var ue="__closure_events_fn_"+(1e9*Math.random()>>>0);function de(e){return"function"===typeof e?e:(e[ue]||(e[ue]=function(t){return e.handleEvent(t)}),e[ue])}function he(){B.call(this),this.i=new $(this),this.M=this,this.F=null}function me(e,t){var n,r=e.F;if(r)for(n=[];r;r=r.F)n.push(r);if(e=e.M,r=t.type||t,"string"===typeof t)t=new q(t,e);else if(t instanceof q)t.target=t.target||e;else{var s=t;I(t=new q(r,e),s)}if(s=!0,n)for(var a=n.length-1;0<=a;a--){var i=t.g=n[a];s=pe(i,r,!0,t)&&s}if(s=pe(i=t.g=e,r,!0,t)&&s,s=pe(i,r,!1,t)&&s,n)for(a=0;a<n.length;a++)s=pe(i=t.g=n[a],r,!1,t)&&s}function pe(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var s=!0,a=0;a<t.length;++a){var i=t[a];if(i&&!i.da&&i.capture==n){var o=i.listener,l=i.ha||i.src;i.fa&&X(e.i,i),s=!1!==o.call(l,r)&&s}}return s&&!r.defaultPrevented}function fe(e,t,n){if("function"===typeof e)n&&(e=c(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=c(e.handleEvent,e)}return 2147483647<Number(t)?-1:s.setTimeout(e,t||0)}function ge(e){e.g=fe(()=>{e.g=null,e.i&&(e.i=!1,ge(e))},e.l);const t=e.h;e.h=null,e.m.apply(null,t)}w(he,B),he.prototype[K]=!0,he.prototype.removeEventListener=function(e,t,n,r){ae(this,e,t,n,r)},he.prototype.N=function(){if(he.aa.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)Q(n[r]);delete t.g[e],t.h--}}this.F=null},he.prototype.K=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},he.prototype.L=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};class ve extends B{constructor(e,t){super(),this.m=e,this.l=t,this.h=null,this.i=!1,this.g=null}j(e){this.h=arguments,this.g?this.i=!0:ge(this)}N(){super.N(),this.g&&(s.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ye(e){B.call(this),this.h=e,this.g={}}w(ye,B);var be=[];function xe(e){_(e.g,function(e,t){this.g.hasOwnProperty(t)&&ie(e)},e),e.g={}}ye.prototype.N=function(){ye.aa.N.call(this),xe(this)},ye.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var we=s.JSON.stringify,Ne=s.JSON.parse,je=class{stringify(e){return s.JSON.stringify(e,void 0)}parse(e){return s.JSON.parse(e,void 0)}};function Ee(){}function Se(e){return e.h||(e.h=e.i())}function Ce(){}Ee.prototype.h=null;var ke={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function _e(){q.call(this,"d")}function Ae(){q.call(this,"c")}w(_e,q),w(Ae,q);var Te={},Ie=null;function Pe(){return Ie=Ie||new he}function Re(e){q.call(this,Te.La,e)}function De(e){const t=Pe();me(t,new Re(t))}function Oe(e,t){q.call(this,Te.STAT_EVENT,e),this.stat=t}function Le(e){const t=Pe();me(t,new Oe(t,e))}function Me(e,t){q.call(this,Te.Ma,e),this.size=t}function Fe(e,t){if("function"!==typeof e)throw Error("Fn must not be null and must be a function");return s.setTimeout(function(){e()},t)}function Ue(){this.g=!0}function Ve(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var s=r[1];if(Array.isArray(s)&&!(1>s.length)){var a=s[0];if("noop"!=a&&"stop"!=a&&"close"!=a)for(var i=1;i<s.length;i++)s[i]=""}}}return we(n)}catch(o){return t}}(e,n)+(r?" "+r:"")})}Te.La="serverreachability",w(Re,q),Te.STAT_EVENT="statevent",w(Oe,q),Te.Ma="timingevent",w(Me,q),Ue.prototype.xa=function(){this.g=!1},Ue.prototype.info=function(){};var ze,Be={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},qe={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"};function He(){}function We(e,t,n,r){this.j=e,this.i=t,this.l=n,this.R=r||1,this.U=new ye(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Ge}function Ge(){this.i=null,this.g="",this.h=!1}w(He,Ee),He.prototype.g=function(){return new XMLHttpRequest},He.prototype.i=function(){return{}},ze=new He;var Ke={},Je={};function Ye(e,t,n){e.L=1,e.v=wt(gt(t)),e.m=n,e.P=!0,Qe(e,null)}function Qe(e,t){e.F=Date.now(),Ze(e),e.A=gt(e.v);var n=e.A,r=e.R;Array.isArray(r)||(r=[String(r)]),Ot(n.i,"t",r),e.C=0,n=e.j.J,e.h=new Ge,e.g=jn(e.j,n?t:null,!e.m),
20<e.O&&(e.M=new ve(c(e.Y,e,e.g),e.O)),t=e.U,n=e.g,r=e.ca;var s="readystatechange";Array.isArray(s)||(s&&(be[0]=s.toString()),s=be);for(var a=0;a<s.length;a++){var i=ne(n,s[a],r||t.handleEvent,!1,t.h||t);if(!i)break;t.g[i.key]=i}t=e.H?A(e.H):{},e.m?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ea(e.A,e.u,e.m,t)):(e.u="GET",e.g.ea(e.A,e.u,null,t)),De(),function(e,t,n,r,s,a){e.info(function(){if(e.g)if(a)for(var i="",o=a.split("&"),l=0;l<o.length;l++){var c=o[l].split("=");if(1<c.length){var u=c[0];c=c[1];var d=u.split("_");i=2<=d.length&&"type"==d[1]?i+(u+"=")+c+"&":i+(u+"=redacted&")}}else i=null;else i=a;return"XMLHTTP REQ ("+r+") [attempt "+s+"]: "+t+"\n"+n+"\n"+i})}(e.i,e.u,e.A,e.l,e.R,e.m)}function $e(e){return!!e.g&&("GET"==e.u&&2!=e.L&&e.j.Ca)}function Xe(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?Je:(n=Number(t.substring(n,r)),isNaN(n)?Ke:(r+=1)+n>t.length?Je:(t=t.slice(r,r+n),e.C=r+n,t))}function Ze(e){e.S=Date.now()+e.I,et(e,e.I)}function et(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Fe(c(e.ba,e),t)}function tt(e){e.B&&(s.clearTimeout(e.B),e.B=null)}function nt(e){0==e.j.G||e.J||yn(e.j,e)}function rt(e){tt(e);var t=e.M;t&&"function"==typeof t.ma&&t.ma(),e.M=null,xe(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.ma())}function st(e,t){try{var n=e.j;if(0!=n.G&&(n.g==e||ct(n.h,e)))if(!e.K&&ct(n.h,e)&&3==n.G){try{var r=n.Da.g.parse(t)}catch(u){r=null}if(Array.isArray(r)&&3==r.length){var s=r;if(0==s[0]){e:if(!n.u){if(n.g){if(!(n.g.F+3e3<e.F))break e;vn(n),on(n)}pn(n),Le(18)}}else n.za=s[1],0<n.za-n.T&&37500>s[2]&&n.F&&0==n.v&&!n.C&&(n.C=Fe(c(n.Za,n),6e3));if(1>=lt(n.h)&&n.ca){try{n.ca()}catch(u){}n.ca=void 0}}else xn(n,11)}else if((e.K||n.g==e)&&vn(n),!E(t))for(s=n.Da.g.parse(t),t=0;t<s.length;t++){let c=s[t];if(n.T=c[0],c=c[1],2==n.G)if("c"==c[0]){n.K=c[1],n.ia=c[2];const t=c[3];null!=t&&(n.la=t,n.j.info("VER="+n.la));const s=c[4];null!=s&&(n.Aa=s,n.j.info("SVER="+n.Aa));const u=c[5];null!=u&&"number"===typeof u&&0<u&&(r=1.5*u,n.L=r,n.j.info("backChannelRequestTimeoutMs_="+r)),r=n;const d=e.g;if(d){const e=d.g?d.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var a=r.h;a.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(a.j=a.l,a.g=new Set,a.h&&(ut(a,a.h),a.h=null))}if(r.D){const e=d.g?d.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.ya=e,xt(r.I,r.D,e))}}n.G=3,n.l&&n.l.ua(),n.ba&&(n.R=Date.now()-e.F,n.j.info("Handshake RTT: "+n.R+"ms"));var i=e;if((r=n).qa=Nn(r,r.J?r.ia:null,r.W),i.K){dt(r.h,i);var o=i,l=r.L;l&&(o.I=l),o.B&&(tt(o),Ze(o)),r.g=i}else mn(r);0<n.i.length&&cn(n)}else"stop"!=c[0]&&"close"!=c[0]||xn(n,7);else 3==n.G&&("stop"==c[0]||"close"==c[0]?"stop"==c[0]?xn(n,7):an(n):"noop"!=c[0]&&n.l&&n.l.ta(c),n.v=0)}De()}catch(u){}}We.prototype.ca=function(e){e=e.target;const t=this.M;t&&3==tn(e)?t.j():this.Y(e)},We.prototype.Y=function(e){try{if(e==this.g)e:{const h=tn(this.g);var t=this.g.Ba();this.g.Z();if(!(3>h)&&(3!=h||this.g&&(this.h.h||this.g.oa()||nn(this.g)))){this.J||4!=h||7==t||De(),tt(this);var n=this.g.Z();this.X=n;t:if($e(this)){var r=nn(this.g);e="";var a=r.length,i=4==tn(this.g);if(!this.h.i){if("undefined"===typeof TextDecoder){rt(this),nt(this);var o="";break t}this.h.i=new s.TextDecoder}for(t=0;t<a;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:!(i&&t==a-1)});r.length=0,this.h.g+=e,this.C=0,o=this.h.g}else o=this.g.oa();if(this.o=200==n,function(e,t,n,r,s,a,i){e.info(function(){return"XMLHTTP RESP ("+r+") [ attempt "+s+"]: "+t+"\n"+n+"\n"+a+" "+i})}(this.i,this.u,this.A,this.l,this.R,h,n),this.o){if(this.T&&!this.K){t:{if(this.g){var l,c=this.g;if((l=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!E(l)){var u=l;break t}}u=null}if(!(n=u)){this.o=!1,this.s=3,Le(12),rt(this),nt(this);break e}Ve(this.i,this.l,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,st(this,n)}if(this.P){let e;for(n=!0;!this.J&&this.C<o.length;){if(e=Xe(this,o),e==Je){4==h&&(this.s=4,Le(14),n=!1),Ve(this.i,this.l,null,"[Incomplete Response]");break}if(e==Ke){this.s=4,Le(15),Ve(this.i,this.l,o,"[Invalid Chunk]"),n=!1;break}Ve(this.i,this.l,e,null),st(this,e)}if($e(this)&&0!=this.C&&(this.h.g=this.h.g.slice(this.C),this.C=0),4!=h||0!=o.length||this.h.h||(this.s=1,Le(16),n=!1),this.o=this.o&&n,n){if(0<o.length&&!this.W){this.W=!0;var d=this.j;d.g==this&&d.ba&&!d.M&&(d.j.info("Great, no buffering proxy detected. Bytes received: "+o.length),fn(d),d.M=!0,Le(11))}}else Ve(this.i,this.l,o,"[Invalid Chunked Response]"),rt(this),nt(this)}else Ve(this.i,this.l,o,null),st(this,o);4==h&&rt(this),this.o&&!this.J&&(4==h?yn(this.j,this):(this.o=!1,Ze(this)))}else(function(e){const t={};e=(e.g&&2<=tn(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(E(e[r]))continue;var n=P(e[r]);const s=n[0];if("string"!==typeof(n=n[1]))continue;n=n.trim();const a=t[s]||[];t[s]=a,a.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==n&&0<o.indexOf("Unknown SID")?(this.s=3,Le(12)):(this.s=0,Le(13)),rt(this),nt(this)}}}catch(h){}},We.prototype.cancel=function(){this.J=!0,rt(this)},We.prototype.ba=function(){this.B=null;const e=Date.now();0<=e-this.S?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.i,this.A),2!=this.L&&(De(),Le(17)),rt(this),this.s=2,nt(this)):et(this,this.S-e)};var at=class{constructor(e,t){this.g=e,this.map=t}};function it(e){this.l=e||10,s.PerformanceNavigationTiming?e=0<(e=s.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):e=!!(s.chrome&&s.chrome.loadTimes&&s.chrome.loadTimes()&&s.chrome.loadTimes().wasFetchedViaSpdy),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function ot(e){return!!e.h||!!e.g&&e.g.size>=e.j}function lt(e){return e.h?1:e.g?e.g.size:0}function ct(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function ut(e,t){e.g?e.g.add(t):e.h=t}function dt(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function ht(e){if(null!=e.h)return e.i.concat(e.h.D);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.D);return t}return N(e.i)}function mt(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(a(e)||"string"===typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.na&&"function"==typeof e.na)return e.na();if(!e.V||"function"!=typeof e.V){if("undefined"!==typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!==typeof Set&&e instanceof Set)){if(a(e)||"string"===typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.V&&"function"==typeof e.V)return e.V();if("undefined"!==typeof Map&&e instanceof Map||"undefined"!==typeof Set&&e instanceof Set)return Array.from(e.values());if("string"===typeof e)return e.split("");
2if(a(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),s=r.length,i=0;i<s;i++)t.call(void 0,r[i],n&&n[i],e)}it.prototype.cancel=function(){if(this.i=ht(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var pt=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function ft(e){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,e instanceof ft){this.h=e.h,vt(this,e.j),this.o=e.o,this.g=e.g,yt(this,e.s),this.l=e.l;var t=e.i,n=new It;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),bt(this,n),this.m=e.m}else e&&(t=String(e).match(pt))?(this.h=!1,vt(this,t[1]||"",!0),this.o=Nt(t[2]||""),this.g=Nt(t[3]||"",!0),yt(this,t[4]),this.l=Nt(t[5]||"",!0),bt(this,t[6]||"",!0),this.m=Nt(t[7]||"")):(this.h=!1,this.i=new It(null,this.h))}function gt(e){return new ft(e)}function vt(e,t,n){e.j=n?Nt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function yt(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.s=t}else e.s=null}function bt(e,t,n){t instanceof It?(e.i=t,function(e,t){t&&!e.j&&(Pt(e),e.i=null,e.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(Rt(this,t),Ot(this,n,e))},e)),e.j=t}(e.i,e.h)):(n||(t=jt(t,At)),e.i=new It(t,e.h))}function xt(e,t,n){e.i.set(t,n)}function wt(e){return xt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function Nt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function jt(e,t,n){return"string"===typeof e?(e=encodeURI(e).replace(t,Et),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Et(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}ft.prototype.toString=function(){var e=[],t=this.j;t&&e.push(jt(t,Ct,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.o)&&e.push(jt(t,Ct,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.s)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(jt(n,"/"==n.charAt(0)?_t:kt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.m)&&e.push("#",jt(n,Tt)),e.join("")};var St,Ct=/[#\/\?@]/g,kt=/[#\?:]/g,_t=/[#\?]/g,At=/[#\?@]/g,Tt=/#/g;function It(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Pt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),s=null;if(0<=r){var a=e[n].substring(0,r);s=e[n].substring(r+1)}else a=e[n];t(a,s?decodeURIComponent(s.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Rt(e,t){Pt(e),t=Lt(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function Dt(e,t){return Pt(e),t=Lt(e,t),e.g.has(t)}function Ot(e,t,n){Rt(e,t),0<n.length&&(e.i=null,e.g.set(Lt(e,t),N(n)),e.h+=n.length)}function Lt(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}function Mt(e,t,n,r,s){try{s&&(s.onload=null,s.onerror=null,s.onabort=null,s.ontimeout=null),r(n)}catch(a){}}function Ft(){this.g=new je}function Ut(e,t,n){const r=n||"";try{mt(e,function(e,n){let s=e;i(e)&&(s=we(e)),t.push(r+n+"="+encodeURIComponent(s))})}catch(s){throw t.push(r+"type="+encodeURIComponent("_badmap")),s}}function Vt(e){this.l=e.Ub||null,this.j=e.eb||!1}function zt(e,t){he.call(this),this.D=e,this.o=t,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}function Bt(e){e.j.read().then(e.Pa.bind(e)).catch(e.ga.bind(e))}function qt(e){e.readyState=4,e.l=null,e.j=null,e.v=null,Ht(e)}function Ht(e){e.onreadystatechange&&e.onreadystatechange.call(e)}function Wt(e){let t="";return _(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Gt(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=Wt(n),"string"===typeof e?null!=n&&encodeURIComponent(String(n)):xt(e,t,n))}function Kt(e){he.call(this),this.headers=new Map,this.o=e||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}(e=It.prototype).add=function(e,t){Pt(this),this.i=null,e=Lt(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},e.forEach=function(e,t){Pt(this),this.g.forEach(function(n,r){n.forEac
2h(function(n){e.call(t,n,r,this)},this)},this)},e.na=function(){Pt(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const s=e[r];for(let e=0;e<s.length;e++)n.push(t[r])}return n},e.V=function(e){Pt(this);let t=[];if("string"===typeof e)Dt(this,e)&&(t=t.concat(this.g.get(Lt(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},e.set=function(e,t){return Pt(this),this.i=null,Dt(this,e=Lt(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},e.get=function(e,t){return e&&0<(e=this.V(e)).length?String(e[0]):t},e.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const a=encodeURIComponent(String(r)),i=this.V(r);for(r=0;r<i.length;r++){var s=a;""!==i[r]&&(s+="="+encodeURIComponent(String(i[r]))),e.push(s)}}return this.i=e.join("&")},w(Vt,Ee),Vt.prototype.g=function(){return new zt(this.l,this.j)},Vt.prototype.i=(St={},function(){return St}),w(zt,he),(e=zt.prototype).open=function(e,t){if(0!=this.readyState)throw this.abort(),Error("Error reopening a connection");this.B=e,this.A=t,this.readyState=1,Ht(this)},e.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.u,method:this.B,credentials:this.m,cache:void 0};e&&(t.body=e),(this.D||s).fetch(new Request(this.A,t)).then(this.Sa.bind(this),this.ga.bind(this))},e.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,qt(this)),this.readyState=0},e.Sa=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,Ht(this)),this.g&&(this.readyState=3,Ht(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if("undefined"!==typeof s.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Bt(this)}else e.text().then(this.Ra.bind(this),this.ga.bind(this))},e.Pa=function(e){if(this.g){if(this.o&&e.value)this.response.push(e.value);else if(!this.o){var t=e.value?e.value:new Uint8Array(0);(t=this.v.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?qt(this):Ht(this),3==this.readyState&&Bt(this)}},e.Ra=function(e){this.g&&(this.response=this.responseText=e,qt(this))},e.Qa=function(e){this.g&&(this.response=e,qt(this))},e.ga=function(){this.g&&qt(this)},e.setRequestHeader=function(e,t){this.u.append(e,t)},e.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},e.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(zt.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}}),w(Kt,he);var Jt=/^https?$/i,Yt=["POST","PUT"];function Qt(e,t){e.h=!1,e.g&&(e.j=!0,e.g.abort(),e.j=!1),e.l=t,e.m=5,$t(e),Zt(e)}function $t(e){e.A||(e.A=!0,me(e,"complete"),me(e,"error"))}function Xt(e){if(e.h&&"undefined"!=typeof r&&(!e.v[1]||4!=tn(e)||2!=e.Z()))if(e.u&&4==tn(e))fe(e.Ea,0,e);else if(me(e,"readystatechange"),4==tn(e)){e.h=!1;try{const r=e.Z();e:switch(r){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var a;if(a=0===r){var i=String(e.D).match(pt)[1]||null;!i&&s.self&&s.self.location&&(i=s.self.location.protocol.slice(0,-1)),a=!Jt.test(i?i.toLowerCase():"")}n=a}if(n)me(e,"complete"),me(e,"success");else{e.m=6;try{var o=2<tn(e)?e.g.statusText:""}catch(l){o=""}e.l=o+" ["+e.Z()+"]",$t(e)}}finally{Zt(e)}}}function Zt(e,t){if(e.g){en(e);const r=e.g,s=e.v[0]?()=>{}:null;e.g=null,e.v=null,t||me(e,"ready");try{r.onreadystatechange=s}catch(n){}}}function en(e){e.I&&(s.clearTimeout(e.I),e.I=null)}function tn(e){return e.g?e.g.readyState:0}function nn(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.H){case"":case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(t){return null}}
2function rn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function sn(e){this.Aa=0,this.i=[],this.j=new Ue,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=rn("failFast",!1,e),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=rn("baseRetryDelayMs",5e3,e),this.cb=rn("retryDelaySeedMs",1e4,e),this.Wa=rn("forwardChannelMaxRetries",2,e),this.wa=rn("forwardChannelRequestTimeoutMs",2e4,e),this.pa=e&&e.xmlHttpFactory||void 0,this.Xa=e&&e.Tb||void 0,this.Ca=e&&e.useFetchStreams||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.h=new it(e&&e.concurrentRequestLimit),this.Da=new Ft,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=e&&e.Rb||!1,e&&e.xa&&this.j.xa(),e&&e.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&e&&e.detectBufferingProxy||!1,this.ja=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.ja=e.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}function an(e){if(ln(e),3==e.G){var t=e.U++,n=gt(e.I);if(xt(n,"SID",e.K),xt(n,"RID",t),xt(n,"TYPE","terminate"),dn(e,n),(t=new We(e,e.j,t)).L=2,t.v=wt(gt(n)),n=!1,s.navigator&&s.navigator.sendBeacon)try{n=s.navigator.sendBeacon(t.v.toString(),"")}catch(r){}!n&&s.Image&&((new Image).src=t.v,n=!0),n||(t.g=jn(t.j,null),t.g.ea(t.v)),t.F=Date.now(),Ze(t)}wn(e)}function on(e){e.g&&(fn(e),e.g.cancel(),e.g=null)}function ln(e){on(e),e.u&&(s.clearTimeout(e.u),e.u=null),vn(e),e.h.cancel(),e.s&&("number"===typeof e.s&&s.clearTimeout(e.s),e.s=null)}function cn(e){if(!ot(e.h)&&!e.s){e.s=!0;var t=e.Ga;M||V(),F||(M(),F=!0),U.add(t,e),e.B=0}}function un(e,t){var n;n=t?t.l:e.U++;const r=gt(e.I);xt(r,"SID",e.K),xt(r,"RID",n),xt(r,"AID",e.T),dn(e,r),e.m&&e.o&&Gt(r,e.m,e.o),n=new We(e,e.j,n,e.B+1),null===e.m&&(n.H=e.o),t&&(e.i=t.D.concat(e.i)),t=hn(e,n,1e3),n.I=Math.round(.5*e.wa)+Math.round(.5*e.wa*Math.random()),ut(e.h,n),Ye(n,r,t)}function dn(e,t){e.H&&_(e.H,function(e,n){xt(t,n,e)}),e.l&&mt({},function(e,n){xt(t,n,e)})}function hn(e,t,n){n=Math.min(e.i.length,n);var r=e.l?c(e.l.Na,e.l,e):null;e:{var s=e.i;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=s[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let i=!0;for(let o=0;o<n;o++){let n=s[o].g;const l=s[o].map;if(n-=t,0>n)t=Math.max(0,s[o].g-100),i=!1;else try{Ut(l,e,"req"+n+"_")}catch(a){r&&r(l)}}if(i){r=e.join("&");break e}}}return e=e.i.splice(0,n),t.D=e,r}function mn(e){if(!e.g&&!e.u){e.Y=1;var t=e.Fa;M||V(),F||(M(),F=!0),U.add(t,e),e.v=0}}function pn(e){return!(e.g||e.u||3<=e.v)&&(e.Y++,e.u=Fe(c(e.Fa,e),bn(e,e.v)),e.v++,!0)}function fn(e){null!=e.A&&(s.clearTimeout(e.A),e.A=null)}function gn(e){e.g=new We(e,e.j,"rpc",e.Y),null===e.m&&(e.g.H=e.o),e.g.O=0;var t=gt(e.qa);xt(t,"RID","rpc"),xt(t,"SID",e.K),xt(t,"AID",e.T),xt(t,"CI",e.F?"0":"1"),!e.F&&e.ja&&xt(t,"TO",e.ja),xt(t,"TYPE","xmlhttp"),dn(e,t),e.m&&e.o&&Gt(t,e.m,e.o),e.L&&(e.g.I=e.L);var n=e.g;e=e.ia,n.L=1,n.v=wt(gt(t)),n.m=null,n.P=!0,Qe(n,e)}function vn(e){null!=e.C&&(s.clearTimeout(e.C),e.C=null)}function yn(e,t){var n=null;if(e.g==t){vn(e),fn(e),e.g=null;var r=2}else{if(!ct(e.h,t))return;n=t.D,dt(e.h,t),r=1}if(0!=e.G)if(t.o)if(1==r){n=t.m?t.m.length:0,t=Date.now()-t.F;var s=e.B;me(r=Pe(),new Me(r,n)),cn(e)}else mn(e);else if(3==(s=t.s)||0==s&&0<t.X||!(1==r&&function(e,t){return!(lt(e.h)>=e.h.j-(e.s?1:0))&&(e.s?(e.i=t.D.concat(e.i),!0):!(1==e.G||2==e.G||e.B>=(e.Va?0:e.Wa))&&(e.s=Fe(c(e.Ga,e,t),bn(e,e.B)),e.B++,!0))}(e,t)||2==r&&pn(e)))switch(n&&0<n.length&&(t=e.h,t.i=t.i.concat(n)),s){case 1:xn(e,5);break;case 4:xn(e,10);break;case 3:xn(e,6);break;default:xn(e,2)}}function bn(e,t){let n=e.Ta+Math.floor(Math.random()*e.cb);return e.isActive()||(n*=2),n*t}function xn(e,t){if(e.j.info("Error code "+t),2==t){var n=c(e.fb,e),r=e.Xa;const t=!r;r=new ft(r||"//www.google.com/images/cleardot.gif"),s.location&&"http"==s.location.protocol||vt(r,"https"),wt(r),t?function(e,t){const n=new Ue;if(s.Image){const r=new Image;r.onload=u(Mt,n,"TestLoadImage: loaded",!0,t,r),r.onerror=u(Mt,n,"TestLoadImage: error",!1,t,r),r.onabort=u(Mt,n,"TestLoadImage: abort",!1,t,r),r.ontimeout=u(Mt,n,"TestLoadImage: timeout",!1,t,r),s.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(r.toString(),n):function(e,t){new Ue;const n=new AbortController,r=setTimeout(()=>{n.abort(),Mt(0,0,!1,t)},1e4);fetch(e,{signal:n.signal}).then(e=>{clearTimeout(r),e.ok?Mt(0,0,!0,t):Mt(0,0,!1,t)}).catch(()=>{clearTimeout(r),Mt(0,0,!1,t)})}(r.toString(),n)}else Le(2);e.G=0,e.l&&e.l.sa(t),wn(e),ln(e)}function wn(e){if(e.G=0,e.ka=[],e.l){const t=ht(e.h);
20==t.length&&0==e.i.length||(j(e.ka,t),j(e.ka,e.i),e.h.i.length=0,N(e.i),e.i.length=0),e.l.ra()}}function Nn(e,t,n){var r=n instanceof ft?gt(n):new ft(n);if(""!=r.g)t&&(r.g=t+"."+r.g),yt(r,r.s);else{var a=s.location;r=a.protocol,t=t?t+"."+a.hostname:a.hostname,a=+a.port;var i=new ft(null);r&&vt(i,r),t&&(i.g=t),a&&yt(i,a),n&&(i.l=n),r=i}return n=e.D,t=e.ya,n&&t&&xt(r,n,t),xt(r,"VER",e.la),dn(e,r),r}function jn(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=e.Ca&&!e.pa?new Kt(new Vt({eb:n})):new Kt(e.pa)).Ha(e.J),t}function En(){}function Sn(){}function Cn(e,t){he.call(this),this.g=new sn(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.o=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.va&&(e?e["X-WebChannel-Client-Profile"]=t.va:e={"X-WebChannel-Client-Profile":t.va}),this.g.S=e,(e=t&&t.Sb)&&!E(e)&&(this.g.m=e),this.v=t&&t.supportsCrossDomainXhr||!1,this.u=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!E(t)&&(this.g.D=t,null!==(e=this.h)&&t in e&&(t in(e=this.h)&&delete e[t])),this.j=new An(this)}function kn(e){_e.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function _n(){Ae.call(this),this.status=1}function An(e){this.g=e}(e=Kt.prototype).Ha=function(e){this.J=e},e.ea=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+e);t=t?t.toUpperCase():"GET",this.D=e,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():ze.g(),this.v=this.o?Se(this.o):Se(ze),this.g.onreadystatechange=c(this.Ea,this);try{this.B=!0,this.g.open(t,String(e),!0),this.B=!1}catch(i){return void Qt(this,i)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var a in r)n.set(a,r[a]);else{if("function"!==typeof r.keys||"function"!==typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),a=s.FormData&&e instanceof s.FormData,!(0<=Array.prototype.indexOf.call(Yt,t,void 0))||r||a||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[s,o]of n)this.g.setRequestHeader(s,o);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{en(this),this.u=!0,this.g.send(e),this.u=!1}catch(i){Qt(this,i)}},e.abort=function(e){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=e||7,me(this,"complete"),me(this,"abort"),Zt(this))},e.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Zt(this,!0)),Kt.aa.N.call(this)},e.Ea=function(){this.s||(this.B||this.u||this.j?Xt(this):this.bb())},e.bb=function(){Xt(this)},e.isActive=function(){return!!this.g},e.Z=function(){try{return 2<tn(this)?this.g.status:-1}catch(St){return-1}},e.oa=function(){try{return this.g?this.g.responseText:""}catch(St){return""}},e.Oa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),Ne(t)}},e.Ba=function(){return this.m},e.Ka=function(){return"string"===typeof this.l?this.l:String(this.l)},(e=sn.prototype).la=8,e.G=1,e.connect=function(e,t,n,r){Le(0),this.W=e,this.H=t||{},n&&void 0!==r&&(this.H.OSID=n,this.H.OAID=r),this.F=this.X,this.I=Nn(this,null,this.W),cn(this)},e.Ga=function(e){if(this.s)if(this.s=null,1==this.G){if(!e){this.U=Math.floor(1e5*Math.random()),e=this.U++;const s=new We(this,this.j,e);let a=this.o;if(this.S&&(a?(a=A(a),I(a,this.S)):a=this.S),null!==this.m||this.O||(s.H=a,a=null),this.P)e:{for(var t=0,n=0;n<this.i.length;n++){var r=this.i[n];if(void 0===(r="__data__"in r.map&&"string"===typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.i.length-1){t=n+1;break e}}t=1e3}else t=1e3;
2t=hn(this,s,t),xt(n=gt(this.I),"RID",e),xt(n,"CVER",22),this.D&&xt(n,"X-HTTP-Session-Id",this.D),dn(this,n),a&&(this.O?t="headers="+encodeURIComponent(String(Wt(a)))+"&"+t:this.m&&Gt(n,this.m,a)),ut(this.h,s),this.Ua&&xt(n,"TYPE","init"),this.P?(xt(n,"$req",t),xt(n,"SID","null"),s.T=!0,Ye(s,n,null)):Ye(s,n,t),this.G=2}}else 3==this.G&&(e?un(this,e):0==this.i.length||ot(this.h)||un(this))},e.Fa=function(){if(this.u=null,gn(this),this.ba&&!(this.M||null==this.g||0>=this.R)){var e=2*this.R;this.j.info("BP detection timer enabled: "+e),this.A=Fe(c(this.ab,this),e)}},e.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,Le(10),on(this),gn(this))},e.Za=function(){null!=this.C&&(this.C=null,on(this),pn(this),Le(19))},e.fb=function(e){e?(this.j.info("Successfully pinged google.com"),Le(2)):(this.j.info("Failed to ping google.com"),Le(1))},e.isActive=function(){return!!this.l&&this.l.isActive(this)},(e=En.prototype).ua=function(){},e.ta=function(){},e.sa=function(){},e.ra=function(){},e.isActive=function(){return!0},e.Na=function(){},Sn.prototype.g=function(e,t){return new Cn(e,t)},w(Cn,he),Cn.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},Cn.prototype.close=function(){an(this.g)},Cn.prototype.o=function(e){var t=this.g;if("string"===typeof e){var n={};n.__data__=e,e=n}else this.u&&((n={}).__data__=we(e),e=n);t.i.push(new at(t.Ya++,e)),3==t.G&&cn(t)},Cn.prototype.N=function(){this.g.l=null,delete this.j,an(this.g),delete this.g,Cn.aa.N.call(this)},w(kn,_e),w(_n,Ae),w(An,En),An.prototype.ua=function(){me(this.g,"a")},An.prototype.ta=function(e){me(this.g,new kn(e))},An.prototype.sa=function(e){me(this.g,new _n)},An.prototype.ra=function(){me(this.g,"b")},Sn.prototype.createWebChannel=Sn.prototype.g,Cn.prototype.send=Cn.prototype.o,Cn.prototype.open=Cn.prototype.m,Cn.prototype.close=Cn.prototype.close,y=x.createWebChannelTransport=function(){return new Sn},v=x.getStatEventTarget=function(){return Pe()},g=x.Event=Te,f=x.Stat={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},Be.NO_ERROR=0,Be.TIMEOUT=8,Be.HTTP_ERROR=6,p=x.ErrorCode=Be,qe.COMPLETE="complete",m=x.EventType=qe,Ce.EventType=ke,ke.OPEN="a",ke.CLOSE="b",ke.ERROR="c",ke.MESSAGE="d",he.prototype.listen=he.prototype.K,h=x.WebChannel=Ce,x.FetchXmlHttpFactory=Vt,Kt.prototype.listenOnce=Kt.prototype.L,Kt.prototype.getLastError=Kt.prototype.Ka,Kt.prototype.getLastErrorCode=Kt.prototype.Ba,Kt.prototype.getStatus=Kt.prototype.Z,Kt.prototype.getResponseJson=Kt.prototype.Oa,Kt.prototype.getResponseText=Kt.prototype.oa,Kt.prototype.send=Kt.prototype.ea,Kt.prototype.setWithCredentials=Kt.prototype.Ha,d=x.XhrIo=Kt}).apply("undefined"!==typeof b?b:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{});const w="@firebase/firestore",N="4.8.0";class j{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}j.UNAUTHENTICATED=new j(null),j.GOOGLE_CREDENTIALS=new j("google-credentials-uid"),j.FIRST_PARTY=new j("first-party-uid"),j.MOCK_USER=new j("mock-user");let E="11.10.0";const S=new o.Vy("@firebase/firestore");function C(){return S.logLevel}function k(e){if(S.logLevel<=o.$b.DEBUG){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(T);S.debug("Firestore (".concat(E,"): ").concat(e),...s)}}function _(e){if(S.logLevel<=o.$b.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(T);S.error("Firestore (".concat(E,"): ").concat(e),...s)}}function A(e){if(S.logLevel<=o.$b.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=n.map(T);S.warn("Firestore (".concat(E,"): ").concat(e),...s)}}function T(e){if("string"==typeof e)return e;try{return function(e){return JSON.stringify(e)}(e)}catch(t){return e}}function I(e,t,n){let r="Unexpected state";"string"==typeof t?r=t:n=t,P(e,r,n)}function P(e,t,n){let r="FIRESTORE (".concat(E,") INTERNAL ASSERTION FAILED: ").concat(t," (ID: ").concat(e.toString(16),")");
2if(void 0!==n)try{r+=" CONTEXT: "+JSON.stringify(n)}catch(e){r+=" CONTEXT: "+n}throw _(r),new Error(r)}function R(e,t,n,r){let s="Unexpected state";"string"==typeof n?s=n:r=n,e||P(t,s,r)}function D(e,t){return e}const O={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class L extends l.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>"".concat(this.name,": [code=").concat(this.code,"]: ").concat(this.message)}}class M{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class F{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization","Bearer ".concat(e))}}class U{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(j.UNAUTHENTICATED))}shutdown(){}}class V{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class z{constructor(e){this.t=e,this.currentUser=j.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){R(void 0===this.o,42304);let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let s=new M;this.o=()=>{this.i++,this.currentUser=this.u(),s.resolve(),s=new M,e.enqueueRetryable(()=>r(this.currentUser))};const a=()=>{const t=s;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},i=e=>{k("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.o&&(this.auth.addAuthTokenListener(this.o),a())};this.t.onInit(e=>i(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?i(e):(k("FirebaseAuthCredentialsProvider","Auth not yet detected"),s.resolve(),s=new M)}},0),a()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(k("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(R("string"==typeof t.accessToken,31837,{l:t}),new F(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return R(null===e||"string"==typeof e,2055,{h:e}),new j(e)}}class B{constructor(e,t,n){this.P=e,this.T=t,this.I=n,this.type="FirstParty",this.user=j.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class q{constructor(e,t,n){this.P=e,this.T=t,this.I=n}getToken(){return Promise.resolve(new B(this.P,this.T,this.I))}start(e,t){e.enqueueRetryable(()=>t(j.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class H{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class W{constructor(e,t){this.V=t,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,(0,a.xZ)(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,t){R(void 0===this.o,3512);const n=e=>{null!=e.error&&k("FirebaseAppCheckTokenProvider","Error getting App Check token; using placeholder token instead. Error: ".concat(e.error.message));const n=e.token!==this.m;return this.m=e.token,k("FirebaseAppCheckTokenProvider","Received ".concat(n?"new":"existing"," token.")),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const r=e=>{k("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){const e=this.V.getImmediate({optional:!0});e?r(e):k("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new H(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(R("string"==typeof e.token,44558,{tokenResult:e}),this.m=e.token,new H(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function G(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let r=0;r<e;
2r++)n[r]=Math.floor(256*Math.random());return n}function K(){return new TextEncoder}class J{static newId(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=G(40);for(let r=0;r<n.length;++r)t.length<20&&n[r]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[r]%62))}return t}}function Y(e,t){return e<t?-1:e>t?1:0}function Q(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=e.codePointAt(n),s=t.codePointAt(n);if(r!==s){if(r<128&&s<128)return Y(r,s);{const a=K(),i=X(a.encode($(e,n)),a.encode($(t,n)));return 0!==i?i:Y(r,s)}}n+=r>65535?2:1}return Y(e.length,t.length)}function $(e,t){return e.codePointAt(t)>65535?e.substring(t,t+2):e.substring(t,t+1)}function X(e,t){for(let n=0;n<e.length&&n<t.length;++n)if(e[n]!==t[n])return Y(e[n],t[n]);return Y(e.length,t.length)}function Z(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}const ee="__name__";class te{constructor(e,t,n){void 0===t?t=0:t>e.length&&I(637,{offset:t,range:e.length}),void 0===n?n=e.length-t:n>e.length-t&&I(1746,{length:n,range:e.length-t}),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===te.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof te?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=te.compareSegments(e.get(r),t.get(r));if(0!==n)return n}return Y(e.length,t.length)}static compareSegments(e,t){const n=te.isNumericId(e),r=te.isNumericId(t);return n&&!r?-1:!n&&r?1:n&&r?te.extractNumericId(e).compare(te.extractNumericId(t)):Q(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return r.fromString(e.substring(4,e.length-2))}}class ne extends te{construct(e,t,n){return new ne(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(){const e=[];for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n){if(s.indexOf("//")>=0)throw new L(O.INVALID_ARGUMENT,"Invalid segment (".concat(s,"). Paths must not contain // in them."));e.push(...s.split("/").filter(e=>e.length>0))}return new ne(e)}static emptyPath(){return new ne([])}}const re=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class se extends te{construct(e,t,n){return new se(e,t,n)}static isValidIdentifier(e){return re.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),se.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&this.get(0)===ee}static keyField(){return new se([ee])}static fromServerFormat(e){const t=[];let n="",r=0;const s=()=>
2{if(0===n.length)throw new L(O.INVALID_ARGUMENT,"Invalid field path (".concat(e,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"));t.push(n),n=""};let a=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new L(O.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new L(O.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(a=!a,r++):"."!==t||a?(n+=t,r++):(s(),r++)}if(s(),a)throw new L(O.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new se(t)}static emptyPath(){return new se([])}}class ae{constructor(e){this.path=e}static fromPath(e){return new ae(ne.fromString(e))}static fromName(e){return new ae(ne.fromString(e).popFirst(5))}static empty(){return new ae(ne.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===ne.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return ne.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ae(new ne(e.slice()))}}function ie(e,t,n){if(!n)throw new L(O.INVALID_ARGUMENT,"Function ".concat(e,"() cannot be called with an empty ").concat(t,"."))}function oe(e){if(!ae.isDocumentKey(e))throw new L(O.INVALID_ARGUMENT,"Invalid document reference. Document references must have an even number of segments, but ".concat(e," has ").concat(e.length,"."))}function le(e){if(ae.isDocumentKey(e))throw new L(O.INVALID_ARGUMENT,"Invalid collection reference. Collection references must have an odd number of segments, but ".concat(e," has ").concat(e.length,"."))}function ce(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}function ue(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e="".concat(e.substring(0,20),"...")),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?"a custom ".concat(t," object"):"an object"}}return"function"==typeof e?"a function":I(12329,{type:typeof e})}function de(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new L(O.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=ue(e);throw new L(O.INVALID_ARGUMENT,"Expected type '".concat(t.name,"', but it was: ").concat(n))}}return e}function he(e,t){if(t<=0)throw new L(O.INVALID_ARGUMENT,"Function ".concat(e,"() requires a positive number, but it was: ").concat(t,"."))}function me(e,t){const n={typeString:e};return t&&(n.value=t),n}function pe(e,t){if(!ce(e))throw new L(O.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in t)if(t[r]){const s=t[r].typeString,a="value"in t[r]?{value:t[r].value}:void 0;if(!(r in e)){n="JSON missing required field: '".concat(r,"'");break}const i=e[r];if(s&&typeof i!==s){n="JSON field '".concat(r,"' must be a ").concat(s,".");break}if(void 0!==a&&i!==a.value){n="Expected '".concat(r,"' field to equal '").concat(a.value,"'");break}}if(n)throw new L(O.INVALID_ARGUMENT,n);return!0}const fe=-62135596800,ge=1e6;class ve{static now(){return ve.fromMillis(Date.now())}static fromDate(e){return ve.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor((e-1e3*t)*ge);return new ve(t,n)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new L(O.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new L(O.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<fe)throw new L(O.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new L(O.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/ge}_compareTo(e){return this.seconds===e.seconds?Y(this.nanoseconds,e.nanoseconds):Y(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:ve._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(pe(e,ve._jsonSchema))return new ve(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-fe;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
2}ve._jsonSchemaVersion="firestore/timestamp/1.0",ve._jsonSchema={type:me("string",ve._jsonSchemaVersion),seconds:me("number"),nanoseconds:me("number")};class ye{static fromTimestamp(e){return new ye(e)}static min(){return new ye(new ve(0,0))}static max(){return new ye(new ve(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const be=-1;class xe{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}xe.UNKNOWN_ID=-1;function we(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,s=ye.fromTimestamp(1e9===r?new ve(n+1,0):new ve(n,r));return new je(s,ae.empty(),t)}function Ne(e){return new je(e.readTime,e.key,be)}class je{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new je(ye.min(),ae.empty(),be)}static max(){return new je(ye.max(),ae.empty(),be)}}function Ee(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=ae.comparator(e.documentKey,t.documentKey),0!==n?n:Y(e.largestBatchId,t.largestBatchId))}const Se="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Ce{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function ke(e){if(e.code!==O.FAILED_PRECONDITION||e.message!==Se)throw e;k("LocalStore","Unexpectedly lost primary lease")}class _e{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&I(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new _e((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof _e?t:_e.resolve(t)}catch(e){return _e.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):_e.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):_e.reject(t)}static resolve(e){return new _e((t,n)=>{t(e)})}static reject(e){return new _e((t,n)=>{n(e)})}static waitFor(e){return new _e((t,n)=>{let r=0,s=0,a=!1;e.forEach(e=>{++r,e.next(()=>{++s,a&&s===r&&t()},e=>n(e))}),a=!0,s===r&&t()})}static or(e){let t=_e.resolve(!1);for(const n of e)t=t.next(e=>e?_e.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new _e((n,r)=>{const s=e.length,a=new Array(s);let i=0;for(let o=0;o<s;o++){const l=o;t(e[l]).next(e=>{a[l]=e,++i,i===s&&n(a)},e=>r(e))}})}static doWhile(e,t){return new _e((n,r)=>{const s=()=>{!0===e()?t().next(()=>{s()},r):n()};s()})}}function Ae(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function Te(e){return"IndexedDbTransactionError"===e.name}class Ie{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this._e(e),this.ae=e=>t.writeSequenceNumber(e))}_e(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ae&&this.ae(e),e}}Ie.ue=-1;const Pe=-1;function Re(e){return null==e}function De(e){return 0===e&&1/e==-1/0}function Oe(e){return"number"==typeof e&&Number.isInteger(e)&&!De(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}const Le="\x01";function Me(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=Ue(t)),t=Fe(e.get(n),t);return Ue(t)}function Fe(e,t){let n=t;const r=e.length;for(let s=0;s<r;s++){const t=e.charAt(s);switch(t){case"\0":n+="\x01\x10";break;case Le:n+="\x01\x11";break;default:n+=t}}return n}function Ue(e){return e+Le+"\x01"}
vendor: 5,526 bytes, line 2
2const Ve="remoteDocuments",ze="owner",Be="mutationQueues",qe="mutations";const He="documentMutations",We="remoteDocumentsV14",Ge="remoteDocumentGlobal",Ke="targets",Je="targetDocuments",Ye="targetGlobal",Qe="collectionParents",$e="clientMetadata",Xe="bundles",Ze="namedQueries",et="indexConfiguration",tt="indexState",nt="indexEntries",rt="documentOverlays",st="globals",at=[Be,qe,He,Ve,Ke,ze,Ye,Je,$e,Ge,Qe,Xe,Ze],it=[Be,qe,He,We,Ke,ze,Ye,Je,$e,Ge,Qe,Xe,Ze,rt],ot=it,lt=[...ot,et,tt,nt];function ct(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ut(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function dt(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class ht{constructor(e,t){this.comparator=e,this.root=t||pt.EMPTY}insert(e,t){return new ht(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,pt.BLACK,null,null))}remove(e){return new ht(this.comparator,this.root.remove(e,this.comparator).copy(null,null,pt.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push("".concat(t,":").concat(n)),!1)),"{".concat(e.join(", "),"}")}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new mt(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new mt(this.root,e,this.comparator,!1)}getReverseIterator(){return new mt(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new mt(this.root,e,this.comparator,!0)}}class mt{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let s=1;for(;!e.isEmpty();)if(s=t?n(e.key,t):1,t&&r&&(s*=-1),s<0)e=this.isReverse?e.left:e.right;else{if(0===s){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class pt{constructor(e,t,n,r,s){this.key=e,this.value=t,this.color=null!=n?n:pt.RED,this.left=null!=r?r:pt.EMPTY,this.right=null!=s?s:pt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,s){return new pt(null!=e?e:this.key,null!=t?t:this.value,null!=n?n:this.color,null!=r?r:this.left,null!=s?s:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const s=n(e,r.key);return r=s<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===s?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return pt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return pt.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,pt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,pt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw I(43730,{key:this.key,value:this.value});if(this.right.isRed())throw I(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw I(27949);return e+(this.isRed()?0:1)}}
2pt.EMPTY=null,pt.RED=!0,pt.BLACK=!1,pt.EMPTY=new class{constructor(){this.size=0}get key(){throw I(57766)}get value(){throw I(16141)}get color(){throw I(16727)}get left(){throw I(29726)}get right(){throw I(36894)}copy(e,t,n,r,s){return this}insert(e,t,n){return new pt(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ft{constructor(e){this.comparator=e,this.data=new ht(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new gt(this.data.getIterator())}getIteratorFrom(e){return new gt(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ft))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new ft(this.comparator);return t.data=e,t}}class gt{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}class vt{constructor(e){this.fields=e,e.sort(se.comparator)}static empty(){return new vt([])}unionWith(e){let t=new ft(se.comparator);for(const n of this.fields)t=t.add(n);for(const n of e)t=t.add(n);return new vt(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return Z(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class yt extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class bt{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new yt("Invalid base64 string: "+e):e}}(e);return new bt(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new bt(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Y(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}bt.EMPTY_BYTE_STRING=new bt("");const xt=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function wt(e){if(R(!!e,39018),"string"==typeof e){let t=0;const n=xt.exec(e);if(R(!!n,46558,{timestamp:e}),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:Nt(e.seconds),nanos:Nt(e.nanos)}}function Nt(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function jt(e){return"string"==typeof e?bt.fromBase64String(e):bt.fromUint8Array(e)}const Et="server_timestamp",St="__type__",Ct="__previous_value__",kt="__local_write_time__";function _t(e){var t,n;return(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{})[St])||void 0===n?void 0:n.stringValue)===Et}function At(e){const t=e.mapValue.fields[Ct];return _t(t)?At(t):t}function Tt(e){const t=wt(e.mapValue.fields[kt].timestampValue);return new ve(t.seconds,t.nanos)}class It{constructor(e,t,n,r,s,a,i,o,l,c){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=s,this.forceLongPolling=a,this.autoDetectLongPolling=i,this.longPollingOptions=o,this.useFetchStreams=l,this.isUsingEmulator=c}}const Pt="(default)";class Rt{constructor(e,t){this.projectId=e,this.database=t||Pt}static empty(){return new Rt("","")}get isDefaultDatabase(){return this.database===Pt}isEqual(e){return e instanceof Rt&&e.projectId===this.projectId&&e.database===this.database}}const Dt="__type__",Ot="__max__",Lt={mapValue:{fields:{__type__:{stringValue:Ot}}}},Mt="__vector__",Ft="value";function Ut(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?_t(e)?4:nn(e)?9007199254740991:en(e)?10:11:I(28295,{value:e})}function Vt(e,t){if(e===t)return!0;const n=Ut(e);if(n!==Ut(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Tt(e).isEqual(Tt(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=wt(e.timestampValue),r=wt(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return jt(e.bytesValue).isEqual(jt(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Nt(e.geoPointValue.latitude)===Nt(t.geoPointValue.latitude)&&Nt(e.geoPointValue.longitude)===Nt(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Nt(e.integerValue)===Nt(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Nt(e.doubleValue),r=Nt(t.doubleValue);return n===r?De(n)===De(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return Z(e.arrayValue.values||[],t.arrayValue.values||[],Vt);case 10:case 11:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(ct(n)!==ct(r))return!1;for(const s in n)if(n.hasOwnProperty(s)&&(void 0===r[s]||!Vt(n[s],r[s])))return!1;return!0}(e,t);default:return I(52216,{left:e})}}function zt(e,t){return void 0!==(e.values||[]).find(e=>Vt(e,t))}function Bt(e,t){if(e===t)return 0;const n=Ut(e),r=Ut(t);if(n!==r)return Y(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Y(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Nt(e.integerValue||e.doubleValue),r=Nt(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return qt(e.timestampValue,t.timestampValue);case 4:return qt(Tt(e),Tt(t));case 5:return Q(e.stringValue,t.stringValue);case 6:return function(e,t){const n=jt(e),r=jt(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let s=0;s<n.length&&s<r.length;s++){const e=Y(n[s],r[s]);if(0!==e)return e}return Y(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=Y(Nt(e.latitude),Nt(t.latitude));return 0!==n?n:Y(Nt(e.longitude),Nt(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return Ht(e.arrayValue,t.arrayValue);case 10:return function(e,t){var n,r,s,a;const i=e.fields||{},o=t.fields||{},l=null===(n=i[Ft])||void 0===n?void 0:n.arrayValue,c=null===(r=o[Ft])||void 0===r?void 0:r.arrayValue,u=Y((null===(s=null==l?void 0:l.values)||void 0===s?void 0:s.length)||0,(null===(a=null==c?void 0:c.values)||void 0===a?void 0:a.length)||0);return 0!==u?u:Ht(l,c)}(e.mapValue,t.mapValue);case 11:return function(e,t){if(e===Lt.mapValue&&t===Lt.mapValue)return 0;if(e===Lt.mapValue)return 1;if(t===Lt.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),s=t.fields||{},a=Object.keys(s);r.sort(),a.sort();for(let i=0;i<r.length&&i<a.length;++i){const e=Q(r[i],a[i]);if(0!==e)return e;const t=Bt(n[r[i]],s[a[i]]);if(0!==t)return t}return Y(r.length,a.length)}(e.mapValue,t.mapValue);default:throw I(23264,{le:n})}}function qt(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return Y(e,t);const n=wt(e),r=wt(t),s=Y(n.seconds,r.seconds);return 0!==s?s:Y(n.nanos,r.nanos)}function Ht(e,t){const n=e.values||[],r=t.values||[];for(let s=0;s<n.length&&s<r.length;++s){const e=Bt(n[s],r[s]);if(e)return e}return Y(n.length,r.length)}function Wt(e){return Gt(e)}function Gt(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=wt(e);return"time(".concat(t.seconds,",").concat(t.nanos,")")}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?function(e){return jt(e).toBase64()}(e.bytesValue):"referenceValue"in e?function(e){return ae.fromName(e).toString()}(e.referenceValue):"geoPointValue"in e?function(e){return"geo(".concat(e.latitude,",").concat(e.longitude,")")}(e.geoPointValue):"arrayValue"in e?function(e){let t="[",n=!0;for(const r of e.values||[])n?n=!1:t+=",",t+=Gt(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",r=!0;for(const s of t)r?r=!1:n+=",",n+="".concat(s,":").concat(Gt(e.fields[s]));return n+"}"}(e.mapValue):I(61005,{value:e})}function Kt(e){switch(Ut(e)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const t=At(e);return t?16+Kt(t):16;case 5:return 2*e.stringValue.length;case 6:return jt(e.bytesValue).approximateByteSize();case 7:return e.referenceValue.length;case 9:return function(e){return(e.values||[]).reduce((e,t)=>
2e+Kt(t),0)}(e.arrayValue);case 10:case 11:return function(e){let t=0;return ut(e.fields,(e,n)=>{t+=e.length+Kt(n)}),t}(e.mapValue);default:throw I(13486,{value:e})}}function Jt(e,t){return{referenceValue:"projects/".concat(e.projectId,"/databases/").concat(e.database,"/documents/").concat(t.path.canonicalString())}}function Yt(e){return!!e&&"integerValue"in e}function Qt(e){return!!e&&"arrayValue"in e}function $t(e){return!!e&&"nullValue"in e}function Xt(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Zt(e){return!!e&&"mapValue"in e}function en(e){var t,n;return(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{})[Dt])||void 0===n?void 0:n.stringValue)===Mt}function tn(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return ut(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=tn(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=tn(e.arrayValue.values[n]);return t}return Object.assign({},e)}function nn(e){return(((e.mapValue||{}).fields||{}).__type__||{}).stringValue===Ot}class rn{constructor(e){this.value=e}static empty(){return new rn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!Zt(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=tn(t)}setAll(e){let t=se.emptyPath(),n={},r=[];e.forEach((e,s)=>{if(!t.isImmediateParentOf(s)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=s.popLast()}e?n[s.lastSegment()]=tn(e):r.push(s.lastSegment())});const s=this.getFieldsMap(t);this.applyChanges(s,n,r)}delete(e){const t=this.field(e.popLast());Zt(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return Vt(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];Zt(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){ut(t,(t,n)=>e[t]=n);for(const r of n)delete e[r]}clone(){return new rn(tn(this.value))}}function sn(e){const t=[];return ut(e.fields,(e,n)=>{const r=new se([e]);if(Zt(n)){const e=sn(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)}),new vt(t)}class an{constructor(e,t,n,r,s,a,i){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=s,this.data=a,this.documentState=i}static newInvalidDocument(e){return new an(e,0,ye.min(),ye.min(),ye.min(),rn.empty(),0)}static newFoundDocument(e,t,n,r){return new an(e,1,t,ye.min(),n,r,0)}static newNoDocument(e,t){return new an(e,2,t,ye.min(),ye.min(),rn.empty(),0)}static newUnknownDocument(e,t){return new an(e,3,t,ye.min(),ye.min(),rn.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(ye.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=rn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=rn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ye.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof an&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new an(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return"Document(".concat(this.key,", ").concat(this.version,", ").concat(JSON.stringify(this.data.value),", {createTime: ").concat(this.createTime,"}), {documentType: ").concat(this.documentType,"}), {documentState: ").concat(this.documentState,"})")}}class on{constructor(e,t){this.position=e,this.inclusive=t}}
2function ln(e,t,n){let r=0;for(let s=0;s<e.position.length;s++){const a=t[s],i=e.position[s];if(r=a.field.isKeyField()?ae.comparator(ae.fromName(i.referenceValue),n.key):Bt(i,n.data.field(a.field)),"desc"===a.dir&&(r*=-1),0!==r)break}return r}function cn(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!Vt(e.position[n],t.position[n]))return!1;return!0}class un{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";this.field=e,this.dir=t}}function dn(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class hn{}class mn extends hn{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new wn(e,t,n):"array-contains"===t?new Sn(e,n):"in"===t?new Cn(e,n):"not-in"===t?new kn(e,n):"array-contains-any"===t?new _n(e,n):new mn(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new Nn(e,n):new jn(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&void 0===t.nullValue&&this.matchesComparison(Bt(t,this.value)):null!==t&&Ut(this.value)===Ut(t)&&this.matchesComparison(Bt(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return I(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class pn extends hn{constructor(e,t){super(),this.filters=e,this.op=t,this.he=null}static create(e,t){return new pn(e,t)}matches(e){return fn(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.he||(this.he=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.he}getFilters(){return Object.assign([],this.filters)}}function fn(e){return"and"===e.op}function gn(e){return vn(e)&&fn(e)}function vn(e){for(const t of e.filters)if(t instanceof pn)return!1;return!0}function yn(e){if(e instanceof mn)return e.field.canonicalString()+e.op.toString()+Wt(e.value);if(gn(e))return e.filters.map(e=>yn(e)).join(",");{const t=e.filters.map(e=>yn(e)).join(",");return"".concat(e.op,"(").concat(t,")")}}function bn(e,t){return e instanceof mn?function(e,t){return t instanceof mn&&e.op===t.op&&e.field.isEqual(t.field)&&Vt(e.value,t.value)}(e,t):e instanceof pn?function(e,t){return t instanceof pn&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,r)=>e&&bn(n,t.filters[r]),!0)}(e,t):void I(19439)}function xn(e){return e instanceof mn?function(e){return"".concat(e.field.canonicalString()," ").concat(e.op," ").concat(Wt(e.value))}(e):e instanceof pn?function(e){return e.op.toString()+" {"+e.getFilters().map(xn).join(" ,")+"}"}(e):"Filter"}class wn extends mn{constructor(e,t,n){super(e,t,n),this.key=ae.fromName(n.referenceValue)}matches(e){const t=ae.comparator(e.key,this.key);return this.matchesComparison(t)}}class Nn extends mn{constructor(e,t){super(e,"in",t),this.keys=En("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class jn extends mn{constructor(e,t){super(e,"not-in",t),this.keys=En("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function En(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>ae.fromName(e.referenceValue))}class Sn extends mn{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Qt(t)&&zt(t.arrayValue,this.value)}}class Cn extends mn{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&zt(this.value.arrayValue,t)}}class kn extends mn{constructor(e,t){super(e,"not-in",t)}matches(e){if(zt(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&void 0===t.nullValue&&!zt(this.value.arrayValue,t)}}class _n extends mn{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);
2return!(!Qt(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>zt(this.value.arrayValue,e))}}class An{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null;this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=s,this.startAt=a,this.endAt=i,this.Pe=null}}function Tn(e){return new An(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,arguments.length>6&&void 0!==arguments[6]?arguments[6]:null)}function In(e){const t=D(e);if(null===t.Pe){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>yn(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),Re(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>Wt(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>Wt(e)).join(",")),t.Pe=e}return t.Pe}function Pn(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!dn(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!bn(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!cn(e.startAt,t.startAt)&&cn(e.endAt,t.endAt)}function Rn(e){return ae.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}class Dn{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"F",i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:null,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=s,this.limitType=a,this.startAt=i,this.endAt=o,this.Te=null,this.Ie=null,this.de=null,this.startAt,this.endAt}}function On(e,t,n,r,s,a,i,o){return new Dn(e,t,n,r,s,a,i,o)}function Ln(e){return new Dn(e)}function Mn(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function Fn(e){return null!==e.collectionGroup}function Un(e){const t=D(e);if(null===t.Te){t.Te=[];const e=new Set;for(const s of t.explicitOrderBy)t.Te.push(s),e.add(s.field.canonicalString());const n=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc",r=function(e){let t=new ft(se.comparator);return e.filters.forEach(e=>{e.getFlattenedFilters().forEach(e=>{e.isInequality()&&(t=t.add(e.field))})}),t}(t);r.forEach(r=>{e.has(r.canonicalString())||r.isKeyField()||t.Te.push(new un(r,n))}),e.has(se.keyField().canonicalString())||t.Te.push(new un(se.keyField(),n))}return t.Te}function Vn(e){const t=D(e);return t.Ie||(t.Ie=zn(t,Un(e))),t.Ie}function zn(e,t){if("F"===e.limitType)return Tn(e.path,e.collectionGroup,t,e.filters,e.limit,e.startAt,e.endAt);{t=t.map(e=>{const t="desc"===e.dir?"asc":"desc";return new un(e.field,t)});const n=e.endAt?new on(e.endAt.position,e.endAt.inclusive):null,r=e.startAt?new on(e.startAt.position,e.startAt.inclusive):null;return Tn(e.path,e.collectionGroup,t,e.filters,e.limit,n,r)}}function Bn(e,t){const n=e.filters.concat([t]);return new Dn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}
2function qn(e,t,n){return new Dn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Hn(e,t){return Pn(Vn(e),Vn(t))&&e.limitType===t.limitType}function Wn(e){return"".concat(In(Vn(e)),"|lt:").concat(e.limitType)}function Gn(e){return"Query(target=".concat(function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=", filters: [".concat(e.filters.map(e=>xn(e)).join(", "),"]")),Re(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=", orderBy: [".concat(e.orderBy.map(e=>function(e){return"".concat(e.field.canonicalString()," (").concat(e.dir,")")}(e)).join(", "),"]")),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>Wt(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>Wt(e)).join(",")),"Target(".concat(t,")")}(Vn(e)),"; limitType=").concat(e.limitType,")")}function Kn(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):ae.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Un(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=ln(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Un(e),t))&&!(e.endAt&&!function(e,t,n){const r=ln(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Un(e),t))}(e,t)}function Jn(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function Yn(e){return(t,n)=>{let r=!1;for(const s of Un(e)){const e=Qn(s,t,n);if(0!==e)return e;r=r||s.field.isKeyField()}return 0}}function Qn(e,t,n){const r=e.field.isKeyField()?ae.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),s=n.data.field(e);return null!==r&&null!==s?Bt(r,s):I(42886)}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return I(19790,{direction:e.dir})}}class $n{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[r,s]of n)if(this.equalsFn(r,e))return s}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return void(r[s]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){ut(this.inner,(t,n)=>{for(const[r,s]of n)e(r,s)})}isEmpty(){return dt(this.inner)}size(){return this.innerSize}}const Xn=new ht(ae.comparator);function Zn(){return Xn}const er=new ht(ae.comparator);function tr(){let e=er;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)e=e.insert(s.key,s);return e}function nr(e){let t=er;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function rr(){return ar()}function sr(){return ar()}function ar(){return new $n(e=>e.toString(),(e,t)=>e.isEqual(t))}const ir=new ht(ae.comparator),or=new ft(ae.comparator);function lr(){let e=or;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];for(const s of n)e=e.add(s);return e}const cr=new ft(Y);function ur(){return cr}function dr(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:De(t)?"-0":t}}function hr(e){return{integerValue:""+e}}function mr(e,t){return Oe(t)?hr(t):dr(e,t)}class pr{constructor(){this._=void 0}}function fr(e,t,n){return e instanceof yr?function(e,t){const n={fields:{[St]:{stringValue:Et},[kt]:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&_t(t)&&(t=At(t)),t&&(n.fields[Ct]=t),{mapValue:n}}(n,t):e instanceof br?xr(e,t):e instanceof wr?Nr(e,t):function(e,t){const n=vr(e,t),r=Er(n)+Er(e.Ee);return Yt(n)&&Yt(e.Ee)?hr(r):dr(e.serializer,r)}(e,t)}function gr(e,t,n){return e instanceof br?xr(e,t):e instanceof wr?Nr(e,t):n}function vr(e,t){return e instanceof jr?function(e){return Yt(e)||function(e){return!!e&&"doubleValue"in e}(e)}(t)?t:{integerValue:0}:null}class yr extends pr{}class br extends pr{constructor(e){super(),this.elements=e}}function xr(e,t){const n=Sr(t);for(const r of e.elements)n.some(e=>Vt(e,r))||n.push(r);return{arrayValue:{values:n}}}class wr extends pr{constructor(e){super(),this.elements=e}}function Nr(e,t){let n=Sr(t);for(const r of e.elements)n=n.filter(e=>!Vt(e,r));return{arrayValue:{values:n}}}
2class jr extends pr{constructor(e,t){super(),this.serializer=e,this.Ee=t}}function Er(e){return Nt(e.integerValue||e.doubleValue)}function Sr(e){return Qt(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Cr{constructor(e,t){this.field=e,this.transform=t}}class kr{constructor(e,t){this.version=e,this.transformResults=t}}class _r{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new _r}static exists(e){return new _r(void 0,e)}static updateTime(e){return new _r(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Ar(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class Tr{}function Ir(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new zr(e.key,_r.none()):new Lr(e.key,e.data,_r.none());{const n=e.data,r=rn.empty();let s=new ft(se.comparator);for(let e of t.fields)if(!s.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),s=s.add(e)}return new Mr(e.key,r,new vt(s.toArray()),_r.none())}}function Pr(e,t,n){e instanceof Lr?function(e,t,n){const r=e.value.clone(),s=Ur(e.fieldTransforms,t,n.transformResults);r.setAll(s),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof Mr?function(e,t,n){if(!Ar(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=Ur(e.fieldTransforms,t,n.transformResults),s=t.data;s.setAll(Fr(e)),s.setAll(r),t.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function Rr(e,t,n,r){return e instanceof Lr?function(e,t,n,r){if(!Ar(e.precondition,t))return n;const s=e.value.clone(),a=Vr(e.fieldTransforms,r,t);return s.setAll(a),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null}(e,t,n,r):e instanceof Mr?function(e,t,n,r){if(!Ar(e.precondition,t))return n;const s=Vr(e.fieldTransforms,r,t),a=t.data;return a.setAll(Fr(e)),a.setAll(s),t.convertToFoundDocument(t.version,a).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):function(e,t,n){return Ar(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Dr(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),s=vr(r.transform,e||null);null!=s&&(null===n&&(n=rn.empty()),n.set(r.field,s))}return n||null}function Or(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&Z(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof br&&t instanceof br||e instanceof wr&&t instanceof wr?Z(e.elements,t.elements,Vt):e instanceof jr&&t instanceof jr?Vt(e.Ee,t.Ee):e instanceof yr&&t instanceof yr}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class Lr extends Tr{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];super(),this.key=e,this.value=t,this.precondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class Mr extends Tr{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=s,this.type=1}getFieldMask(){return this.fieldMask}}function Fr(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function Ur(e,t,n){const r=new Map;R(e.length===n.length,32656,{Ae:n.length,Re:e.length});for(let s=0;s<n.length;s++){const a=e[s],i=a.transform,o=t.data.field(a.field);r.set(a.field,gr(i,o,n[s]))}return r}function Vr(e,t,n){const r=new Map;for(const s of e){const e=s.transform,a=n.data.field(s.field);r.set(s.field,fr(e,a,t))}return r}class zr extends Tr{constructor(e,t){super(),this.key=e,this.prec
2ondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Br extends Tr{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class qr{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let r=0;r<this.mutations.length;r++){const t=this.mutations[r];t.key.isEqual(e.key)&&Pr(t,e,n[r])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=Rr(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=Rr(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=sr();return this.mutations.forEach(r=>{const s=e.get(r.key),a=s.overlayedDocument;let i=this.applyToLocalView(a,s.mutatedFields);i=t.has(r.key)?null:i;const o=Ir(a,i);null!==o&&n.set(r.key,o),a.isValidDocument()||a.convertToNoDocument(ye.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),lr())}isEqual(e){return this.batchId===e.batchId&&Z(this.mutations,e.mutations,(e,t)=>Or(e,t))&&Z(this.baseMutations,e.baseMutations,(e,t)=>Or(e,t))}}class Hr{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){R(e.mutations.length===n.length,58842,{Ve:e.mutations.length,me:n.length});let r=ir;const s=e.mutations;for(let a=0;a<s.length;a++)r=r.insert(s[a].key,n[a].version);return new Hr(e,t,n,r)}}class Wr{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return"Overlay{\n      largestBatchId: ".concat(this.largestBatchId,",\n      mutation: ").concat(this.mutation.toString(),"\n    }")}}class Gr{constructor(e,t){this.count=e,this.unchangedNames=t}}var Kr,Jr;function Yr(e){switch(e){case O.OK:return I(64938);case O.CANCELLED:case O.UNKNOWN:case O.DEADLINE_EXCEEDED:case O.RESOURCE_EXHAUSTED:case O.INTERNAL:case O.UNAVAILABLE:case O.UNAUTHENTICATED:return!1;case O.INVALID_ARGUMENT:case O.NOT_FOUND:case O.ALREADY_EXISTS:case O.PERMISSION_DENIED:case O.FAILED_PRECONDITION:case O.ABORTED:case O.OUT_OF_RANGE:case O.UNIMPLEMENTED:case O.DATA_LOSS:return!0;default:return I(15467,{code:e})}}function Qr(e){if(void 0===e)return _("GRPC error has no .code"),O.UNKNOWN;switch(e){case Kr.OK:return O.OK;case Kr.CANCELLED:return O.CANCELLED;case Kr.UNKNOWN:return O.UNKNOWN;case Kr.DEADLINE_EXCEEDED:return O.DEADLINE_EXCEEDED;case Kr.RESOURCE_EXHAUSTED:return O.RESOURCE_EXHAUSTED;case Kr.INTERNAL:return O.INTERNAL;case Kr.UNAVAILABLE:return O.UNAVAILABLE;case Kr.UNAUTHENTICATED:return O.UNAUTHENTICATED;case Kr.INVALID_ARGUMENT:return O.INVALID_ARGUMENT;case Kr.NOT_FOUND:return O.NOT_FOUND;case Kr.ALREADY_EXISTS:return O.ALREADY_EXISTS;case Kr.PERMISSION_DENIED:return O.PERMISSION_DENIED;case Kr.FAILED_PRECONDITION:return O.FAILED_PRECONDITION;case Kr.ABORTED:return O.ABORTED;case Kr.OUT_OF_RANGE:return O.OUT_OF_RANGE;case Kr.UNIMPLEMENTED:return O.UNIMPLEMENTED;case Kr.DATA_LOSS:return O.DATA_LOSS;default:return I(39323,{code:e})}}(Jr=Kr||(Kr={}))[Jr.OK=0]="OK",Jr[Jr.CANCELLED=1]="CANCELLED",Jr[Jr.UNKNOWN=2]="UNKNOWN",Jr[Jr.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Jr[Jr.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Jr[Jr.NOT_FOUND=5]="NOT_FOUND",Jr[Jr.ALREADY_EXISTS=6]="ALREADY_EXISTS",Jr[Jr.PERMISSION_DENIED=7]="PERMISSION_DENIED",Jr[Jr.UNAUTHENTICATED=16]="UNAUTHENTICATED",Jr[Jr.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Jr[Jr.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Jr[Jr.ABORTED=10]="ABORTED",Jr[Jr.OUT_OF_RANGE=11]="OUT_OF_RANGE",Jr[Jr.UNIMPLEMENTED=12]="UNIMPLEMENTED",Jr[Jr.INTERNAL=13]="INTERNAL",Jr[Jr.UNAVAILABLE=14]="UNAVAILABLE",Jr[Jr.DATA_LOSS=15]="DATA_LOSS";let $r=null;const Xr=new r([4294967295,4294967295],0);function Zr(e){const t=K().encode(e),n=new s;return n.update(t),new Uint8Array(n.digest())}function es(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),s=t.getUint32(4,!0),a=t.getUint32(8,!0),i=t.getUint32(12,!0);return[new r([n,s],0),new r([a,i],0)]}class ts{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new ns("Invalid padding: ".concat(t));if(n<0)throw new ns("Invalid hash count: ".concat(n));if(e.length>0&&0===this.hashCount)throw new ns("Invalid hash count: ".concat(n));if(0===e.length&&0!==t)throw new ns("Invalid padding when bitmap length is 0: ".concat(t));this.fe=8*e.length-t,this.ge=r.fromNumber(this.fe)}pe(e,t,n){let s=e.add(t.multiply(r.fromNumber(n)));return 1===s.compare(Xr)&&(s=new r([s.getBits(0),s.getBits(1)],0)),s.modulo(this.ge).toNumber()}ye(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(0===this.fe)return!1;const t=Zr(e),[n,r]=es(t);for(let s=0;s<this.hashCount;s++){const e=this.pe(n,r,s);if(!this.ye(e))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,s=new Uint8Array(Math.ceil(e/8)),a=new ts(s,r,t);
2return n.forEach(e=>a.insert(e)),a}insert(e){if(0===this.fe)return;const t=Zr(e),[n,r]=es(t);for(let s=0;s<this.hashCount;s++){const e=this.pe(n,r,s);this.we(e)}}we(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class ns extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class rs{constructor(e,t,n,r,s){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=s}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,ss.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new rs(ye.min(),r,new ht(Y),Zn(),lr())}}class ss{constructor(e,t,n,r,s){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=s}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new ss(n,t,lr(),lr(),lr())}}class as{constructor(e,t,n,r){this.Se=e,this.removedTargetIds=t,this.key=n,this.be=r}}class is{constructor(e,t){this.targetId=e,this.De=t}}class os{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:bt.EMPTY_BYTE_STRING,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class ls{constructor(){this.ve=0,this.Ce=ds(),this.Fe=bt.EMPTY_BYTE_STRING,this.Me=!1,this.xe=!0}get current(){return this.Me}get resumeToken(){return this.Fe}get Oe(){return 0!==this.ve}get Ne(){return this.xe}Be(e){e.approximateByteSize()>0&&(this.xe=!0,this.Fe=e)}Le(){let e=lr(),t=lr(),n=lr();return this.Ce.forEach((r,s)=>{switch(s){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:I(38017,{changeType:s})}}),new ss(this.Fe,this.Me,e,t,n)}ke(){this.xe=!1,this.Ce=ds()}qe(e,t){this.xe=!0,this.Ce=this.Ce.insert(e,t)}Qe(e){this.xe=!0,this.Ce=this.Ce.remove(e)}$e(){this.ve+=1}Ue(){this.ve-=1,R(this.ve>=0,3241,{ve:this.ve})}Ke(){this.xe=!0,this.Me=!0}}class cs{constructor(e){this.We=e,this.Ge=new Map,this.ze=Zn(),this.je=us(),this.Je=us(),this.He=new ht(Y)}Ye(e){for(const t of e.Se)e.be&&e.be.isFoundDocument()?this.Ze(t,e.be):this.Xe(t,e.key,e.be);for(const t of e.removedTargetIds)this.Xe(t,e.key,e.be)}et(e){this.forEachTarget(e,t=>{const n=this.tt(t);switch(e.state){case 0:this.nt(t)&&n.Be(e.resumeToken);break;case 1:n.Ue(),n.Oe||n.ke(),n.Be(e.resumeToken);break;case 2:n.Ue(),n.Oe||this.removeTarget(t);break;case 3:this.nt(t)&&(n.Ke(),n.Be(e.resumeToken));break;case 4:this.nt(t)&&(this.rt(t),n.Be(e.resumeToken));break;default:I(56790,{state:e.state})}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Ge.forEach((e,n)=>{this.nt(n)&&t(n)})}it(e){const t=e.targetId,n=e.De.count,r=this.st(t);if(r){const s=r.target;if(Rn(s))if(0===n){const e=new ae(s.path);this.Xe(t,e,an.newNoDocument(e,ye.min()))}else R(1===n,20013,{expectedCount:n});else{const r=this.ot(t);if(r!==n){const n=this._t(e),s=n?this.ut(n,e,r):1;if(0!==s){this.rt(t);const e=2===s?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.He=this.He.insert(t,e)}null==$r||$r.ct(function(e,t,n,r,s){var a,i,o,l,c,u;const d={localCacheCount:e,existenceFilterCount:t.count,databaseId:n.database,projectId:n.projectId},h=t.unchangedNames;return h&&(d.bloomFilter={applied:0===s,hashCount:null!==(a=null==h?void 0:h.hashCount)&&void 0!==a?a:0,bitmapLength:null!==(l=null===(o=null===(i=null==h?void 0:h.bits)||void 0===i?void 0:i.bitmap)||void 0===o?void 0:o.length)&&void 0!==l?l:0,padding:null!==(u=null===(c=null==h?void 0:h.bits)||void 0===c?void 0:c.padding)&&void 0!==u?u:0,mightContain:e=>{var t;return null!==(t=null==r?void 0:r.mightContain(e))&&void 0!==t&&t}}),d}(r,e.De,this.We.lt(),n,s))}}}}_t(e){const t=e.De.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:n="",padding:r=0},hashCount:s=0}=t;let a,i;try{a=jt(n).toUint8Array()}catch(e){if(e instanceof yt)return A("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw e}try{i=new ts(a,r,s)}catch(e){return A(e instanceof ns?"BloomFilter error: ":"Applying bloom filter failed: ",e),null}return 0===i.fe?null:i}ut(e,t,n){return t.De.count===n-this.ht(e,t.targetId)?0:2}ht(e,t){const n=this.We.getRemoteKeysForTarget(t);let r=0;
2return n.forEach(n=>{const s=this.We.lt(),a="projects/".concat(s.projectId,"/databases/").concat(s.database,"/documents/").concat(n.path.canonicalString());e.mightContain(a)||(this.Xe(t,n,null),r++)}),r}Pt(e){const t=new Map;this.Ge.forEach((n,r)=>{const s=this.st(r);if(s){if(n.current&&Rn(s.target)){const t=new ae(s.target.path);this.Tt(t).has(r)||this.It(r,t)||this.Xe(r,t,an.newNoDocument(t,e))}n.Ne&&(t.set(r,n.Le()),n.ke())}});let n=lr();this.Je.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{const t=this.st(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.ze.forEach((t,n)=>n.setReadTime(e));const r=new rs(e,t,this.He,this.ze,n);return this.ze=Zn(),this.je=us(),this.Je=us(),this.He=new ht(Y),r}Ze(e,t){if(!this.nt(e))return;const n=this.It(e,t.key)?2:0;this.tt(e).qe(t.key,n),this.ze=this.ze.insert(t.key,t),this.je=this.je.insert(t.key,this.Tt(t.key).add(e)),this.Je=this.Je.insert(t.key,this.dt(t.key).add(e))}Xe(e,t,n){if(!this.nt(e))return;const r=this.tt(e);this.It(e,t)?r.qe(t,1):r.Qe(t),this.Je=this.Je.insert(t,this.dt(t).delete(e)),this.Je=this.Je.insert(t,this.dt(t).add(e)),n&&(this.ze=this.ze.insert(t,n))}removeTarget(e){this.Ge.delete(e)}ot(e){const t=this.tt(e).Le();return this.We.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}$e(e){this.tt(e).$e()}tt(e){let t=this.Ge.get(e);return t||(t=new ls,this.Ge.set(e,t)),t}dt(e){let t=this.Je.get(e);return t||(t=new ft(Y),this.Je=this.Je.insert(e,t)),t}Tt(e){let t=this.je.get(e);return t||(t=new ft(Y),this.je=this.je.insert(e,t)),t}nt(e){const t=null!==this.st(e);return t||k("WatchChangeAggregator","Detected inactive target",e),t}st(e){const t=this.Ge.get(e);return t&&t.Oe?null:this.We.Et(e)}rt(e){this.Ge.set(e,new ls),this.We.getRemoteKeysForTarget(e).forEach(t=>{this.Xe(e,t,null)})}It(e,t){return this.We.getRemoteKeysForTarget(e).has(t)}}function us(){return new ht(ae.comparator)}function ds(){return new ht(ae.comparator)}const hs={asc:"ASCENDING",desc:"DESCENDING"},ms={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ps={and:"AND",or:"OR"};class fs{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function gs(e,t){return e.useProto3Json||Re(t)?t:{value:t}}function vs(e,t){return e.useProto3Json?"".concat(new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z",""),".").concat(("000000000"+t.nanoseconds).slice(-9),"Z"):{seconds:""+t.seconds,nanos:t.nanoseconds}}function ys(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function bs(e,t){return vs(e,t.toTimestamp())}function xs(e){return R(!!e,49232),ye.fromTimestamp(function(e){const t=wt(e);return new ve(t.seconds,t.nanos)}(e))}function ws(e,t){return Ns(e,t).canonicalString()}function Ns(e,t){const n=function(e){return new ne(["projects",e.projectId,"databases",e.database])}(e).child("documents");return void 0===t?n:n.child(t)}function js(e){const t=ne.fromString(e);return R(qs(t),10190,{key:t.toString()}),t}function Es(e,t){return ws(e.databaseId,t.path)}function Ss(e,t){const n=js(t);if(n.get(1)!==e.databaseId.projectId)throw new L(O.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new L(O.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new ae(As(n))}function Cs(e,t){return ws(e.databaseId,t)}function ks(e){const t=js(e);return 4===t.length?ne.emptyPath():As(t)}function _s(e){return new ne(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function As(e){return R(e.length>4&&"documents"===e.get(4),29091,{key:e.toString()}),e.popFirst(5)}function Ts(e,t,n){return{name:Es(e,t),fields:n.value.mapValue.fields}}function Is(e,t){let n;if(t instanceof Lr)n={update:Ts(e,t.key,t.value)};else if(t instanceof zr)n={delete:Es(e,t.key)};else if(t instanceof Mr)n={update:Ts(e,t.key,t.data),updateMask:Bs(t.fieldMask)};else{if(!(t instanceof Br))return I(16599,{Rt:t.type});n={verify:Es(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof yr)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof br)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof wr)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof jr)return{fieldPath:t.field.canonicalString(),increment:n.Ee};throw I(20930,{transform:t.transform})}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:bs(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:I(27497)}(e,t.precondition)),n}function Ps(e,t){return{documents:[Cs(e,t.path)]}}function Rs(e,t){const n={structuredQuery:{}},r=t.path;let s;null!==t.collectionGroup?(s=r,n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(s=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=Cs(e,s);const a=function(e){if(0!==e.length)return zs(pn.create(e,"and"))}(t.filters);a&&(n.structuredQuery.where=a);const i=function(e){if(0!==e.length)return e.map(e=>function(e){return{field:Us(e.field),direction:Ls(e.dir)}}(e))}(t.orderBy);i&&(n.structuredQuery.orderBy=i);const o=gs(e,t.limit);return null!==o&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt=function(e){return{before:e.inclusive,values:e.position}}(t.startAt)),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),{Vt:n,parent:s}}function Ds(e){let t=ks(e.parent);
2const n=e.structuredQuery,r=n.from?n.from.length:0;let s=null;if(r>0){R(1===r,65062);const e=n.from[0];e.allDescendants?s=e.collectionId:t=t.child(e.collectionId)}let a=[];n.where&&(a=function(e){const t=Os(e);return t instanceof pn&&gn(t)?t.getFilters():[t]}(n.where));let i=[];n.orderBy&&(i=function(e){return e.map(e=>function(e){return new un(Vs(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e))}(n.orderBy));let o=null;n.limit&&(o=function(e){let t;return t="object"==typeof e?e.value:e,Re(t)?null:t}(n.limit));let l=null;n.startAt&&(l=function(e){const t=!!e.before,n=e.values||[];return new on(n,t)}(n.startAt));let c=null;return n.endAt&&(c=function(e){const t=!e.before,n=e.values||[];return new on(n,t)}(n.endAt)),On(t,s,i,a,o,"F",l,c)}function Os(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Vs(e.unaryFilter.field);return mn.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Vs(e.unaryFilter.field);return mn.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=Vs(e.unaryFilter.field);return mn.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const s=Vs(e.unaryFilter.field);return mn.create(s,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return I(61313);default:return I(60726)}}(e):void 0!==e.fieldFilter?function(e){return mn.create(Vs(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return I(58110);default:return I(50506)}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return pn.create(e.compositeFilter.filters.map(e=>Os(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return I(1026)}}(e.compositeFilter.op))}(e):I(30097,{filter:e})}function Ls(e){return hs[e]}function Ms(e){return ms[e]}function Fs(e){return ps[e]}function Us(e){return{fieldPath:e.canonicalString()}}function Vs(e){return se.fromServerFormat(e.fieldPath)}function zs(e){return e instanceof mn?function(e){if("=="===e.op){if(Xt(e.value))return{unaryFilter:{field:Us(e.field),op:"IS_NAN"}};if($t(e.value))return{unaryFilter:{field:Us(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(Xt(e.value))return{unaryFilter:{field:Us(e.field),op:"IS_NOT_NAN"}};if($t(e.value))return{unaryFilter:{field:Us(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Us(e.field),op:Ms(e.op),value:e.value}}}(e):e instanceof pn?function(e){const t=e.getFilters().map(e=>zs(e));return 1===t.length?t[0]:{compositeFilter:{op:Fs(e.op),filters:t}}}(e):I(54877,{filter:e})}function Bs(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function qs(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Hs{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:ye.min(),a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:ye.min(),i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:bt.EMPTY_BYTE_STRING,o=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null;this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=s,this.lastLimboFreeSnapshotVersion=a,this.resumeToken=i,this.expectedCount=o}withSequenceNumber(e){return new Hs(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Hs(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Hs(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Hs(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Ws{constructor(e){this.gt=e}}function Gs(e){const t=Ds({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?qn(t,t.limit,"L"):t}class Ks{constructor(){}bt(e,t){this.Dt(e,t),t.vt()}Dt(e,t){if("nullValue"in e)this.Ct(t,5);else if("booleanValue"in e)this.Ct(t,10),t.Ft(e.booleanValue?1:0);else if("integerValue"in e)this.Ct(t,15),t.Ft(Nt(e.integerValue));else if("doubleValue"in e){const n=Nt(e.doubleValue);isNaN(n)?this.Ct(t,13):(this.Ct(t,15),De(n)?t.Ft(0):t.Ft(n))}else if("timestampValue"in e){let n=e.timestampValue;this.Ct(t,20),"string"==typeof n&&(n=wt(n)),t.Mt("".concat(n.seconds||"")),t.Ft(n.nanos||0)}else if("stringValue"in e)this.xt(e.stringValue,t),this.Ot(t);else if("bytesValue"in e)this.Ct(t,30),t.Nt(jt(e.bytesValue)),this.Ot(t);else if("referenceValue"in e)this.Bt(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.Ct(t,45),t.Ft(n.latitude||0),t.Ft(n.longitude||0)}else"mapValue"in e?nn(e)?this.Ct(t,Number.MAX_SAFE_INTEGER):en(e)?this.Lt(e.mapValue,t):(this.kt(e.mapValue,t),this.Ot(t)):"arrayValue"in e?(this.qt(e.arrayValue,t),this.Ot(t)):I(19022,{Qt:e})}xt(e,t){this.Ct(t,25),this.$t(e,t)}$t(e,t){t.Mt(e)}kt(e,t){const n=e.fields||{};this.Ct(t,55);for(const r of Object.keys(n))this.xt(r,t),this.Dt(n[r],t)}Lt(e,t){var n,r;const s=e.fields||{};this.Ct(t,53);const a=Ft,i=(null===(r=null===(n=s[a].arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.length)||0;this.Ct(t,15),t.Ft(Nt(i)),this.xt(a,t),this.Dt(s[a],t)}qt(e,t){const n=e.values||[];this.Ct(t,50);for(const r of n)this.Dt(r,t)}
2Bt(e,t){this.Ct(t,37),ae.fromName(e).path.forEach(e=>{this.Ct(t,60),this.$t(e,t)})}Ct(e,t){e.Ft(t)}Ot(e){e.Ft(2)}}Ks.Ut=new Ks;class Js{constructor(){this.Dn=new Ys}addToCollectionParentIndex(e,t){return this.Dn.add(t),_e.resolve()}getCollectionParents(e,t){return _e.resolve(this.Dn.getEntries(t))}addFieldIndex(e,t){return _e.resolve()}deleteFieldIndex(e,t){return _e.resolve()}deleteAllFieldIndexes(e){return _e.resolve()}createTargetIndexes(e,t){return _e.resolve()}getDocumentsMatchingTarget(e,t){return _e.resolve(null)}getIndexType(e,t){return _e.resolve(0)}getFieldIndexes(e,t){return _e.resolve([])}getNextCollectionGroupToUpdate(e){return _e.resolve(null)}getMinOffset(e,t){return _e.resolve(je.min())}getMinOffsetFromCollectionGroup(e,t){return _e.resolve(je.min())}updateCollectionGroup(e,t,n){return _e.resolve()}updateIndexEntries(e,t){return _e.resolve()}}class Ys{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new ft(ne.comparator),s=!r.has(n);return this.index[t]=r.add(n),s}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new ft(ne.comparator)).toArray()}}new Uint8Array(0);const Qs={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},$s=41943040;class Xs{static withCacheSize(e){return new Xs(e,Xs.DEFAULT_COLLECTION_PERCENTILE,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}}Xs.DEFAULT_COLLECTION_PERCENTILE=10,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Xs.DEFAULT=new Xs($s,Xs.DEFAULT_COLLECTION_PERCENTILE,Xs.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Xs.DISABLED=new Xs(-1,0,0);class Zs{constructor(e){this._r=e}next(){return this._r+=2,this._r}static ar(){return new Zs(0)}static ur(){return new Zs(-1)}}const ea="LruGarbageCollector",ta=1048576;function na(e,t){let[n,r]=e,[s,a]=t;const i=Y(n,s);return 0===i?Y(r,a):i}class ra{constructor(e){this.Tr=e,this.buffer=new ft(na),this.Ir=0}dr(){return++this.Ir}Er(e){const t=[e,this.dr()];if(this.buffer.size<this.Tr)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();na(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class sa{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Ar=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Rr(6e4)}stop(){this.Ar&&(this.Ar.cancel(),this.Ar=null)}get started(){return null!==this.Ar}Rr(e){k(ea,"Garbage collection scheduled in ".concat(e,"ms")),this.Ar=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Ar=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){Te(e)?k(ea,"Ignoring IndexedDB error during garbage collection: ",e):await ke(e)}await this.Rr(3e5)})}}class aa{constructor(e,t){this.Vr=e,this.params=t}calculateTargetCount(e,t){return this.Vr.mr(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return _e.resolve(Ie.ue);const n=new ra(t);return this.Vr.forEachTarget(e,e=>n.Er(e.sequenceNumber)).next(()=>this.Vr.gr(e,e=>n.Er(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.Vr.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.Vr.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(k("LruGarbageCollector","Garbage collection skipped; disabled"),_e.resolve(Qs)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(k("LruGarbageCollector","Garbage collection skipped; Cache size ".concat(n," is lower than threshold ").concat(this.params.cacheSizeCollectionThreshold)),Qs):this.pr(e,t))}getCacheSize(e){return this.Vr.getCacheSize(e)}pr(e,t){let n,r,s,a,i,l,c;const u=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(k("LruGarbageCollector","Capping sequence numbers to collect down to the maximum of ".concat(this.params.maximumSequenceNumbersToCollect," from ").concat(t)),r=this.params.maximumSequenceNumbersToCollect):r=t,a=Date.now(),this.nthSequenceNumber(e,r))).next(r=>(n=r,i=Date.now(),this.removeTargets(e,n,t))).next(t=>(s=t,l=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(c=Date.now(),C()<=o.$b.DEBUG&&k("LruGarbageCollector","LRU Garbage Collection\n\tCounted targets in ".concat(a-u,"ms\n\tDetermined least recently used ").concat(r," in ")+(i-a)+"ms\n"+"\tRemoved ".concat(s," targets in ")+(l-i)+"ms\n"+"\tRemoved ".concat(e," documents in ")+(c-l)+"ms\n"+"Total Duration: ".concat(c-u,"ms")),_e.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:s,documentsRemoved:e})))}}function ia(e,t){return new aa(e,t)}class oa{constructor(){this.changes=new $n(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,an.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?_e.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}
2assertNotApplied(){}}class la{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class ca{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&Rr(n.mutation,e,vt.empty(),ve.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,lr()).next(()=>t))}getLocalViewOfDocuments(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:lr();const r=rr();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=tr();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=rr();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,lr()))}populateOverlays(e,t,n){const r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let s=Zn();const a=ar(),i=ar();return t.forEach((e,t)=>{const i=n.get(t.key);r.has(t.key)&&(void 0===i||i.mutation instanceof Mr)?s=s.insert(t.key,t):void 0!==i?(a.set(t.key,i.mutation.getFieldMask()),Rr(i.mutation,t,i.mutation.getFieldMask(),ve.now())):a.set(t.key,vt.empty())}),this.recalculateAndSaveOverlays(e,s).next(e=>(e.forEach((e,t)=>a.set(e,t)),t.forEach((e,t)=>{var n;return i.set(e,new la(t,null!==(n=a.get(e))&&void 0!==n?n:null))}),i))}recalculateAndSaveOverlays(e,t){const n=ar();let r=new ht((e,t)=>e-t),s=lr();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const s of e)s.keys().forEach(e=>{const a=t.get(e);if(null===a)return;let i=n.get(e)||vt.empty();i=s.applyToLocalView(a,i),n.set(e,i);const o=(r.get(s.batchId)||lr()).add(e);r=r.insert(s.batchId,o)})}).next(()=>{const a=[],i=r.getReverseIterator();for(;i.hasNext();){const r=i.getNext(),o=r.key,l=r.value,c=sr();l.forEach(e=>{if(!s.has(e)){const r=Ir(t.get(e),n.get(e));null!==r&&c.set(e,r),s=s.add(e)}}),a.push(this.documentOverlayCache.saveOverlays(e,o,c))}return _e.waitFor(a)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n,r){return function(e){return ae.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):Fn(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n,r):this.getDocumentsMatchingCollectionQuery(e,t,n,r)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(s=>{const a=r-s.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-s.size):_e.resolve(rr());let i=be,o=s;return a.next(t=>_e.forEach(t,(t,n)=>(i<n.largestBatchId&&(i=n.largestBatchId),s.get(t)?_e.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{o=o.insert(t,e)}))).next(()=>this.populateOverlays(e,t,s)).next(()=>this.computeViews(e,o,t,lr())).next(e=>({batchId:i,changes:nr(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ae(t)).next(e=>{let t=tr();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n,r){const s=t.collectionGroup;let a=tr();return this.indexManager.getCollectionParents(e,s).next(i=>_e.forEach(i,i=>{const o=function(e,t){return new Dn(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,i.child(s));return this.getDocumentsMatchingCollectionQuery(e,o,n,r).next(e=>{e.forEach((e,t)=>{a=a.insert(e,t)})})}).next(()=>a))}getDocumentsMatchingCollectionQuery(e,t,n,r){let s;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(a=>(s=a,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,s,r))).next(e=>{s.forEach((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,an.newInvalidDocument(r)))});let n=tr();return e.forEach((e,r)=>{const a=s.get(e);void 0!==a&&Rr(a.mutation,r,vt.empty(),ve.now()),Kn(t,r)&&(n=n.insert(e,r))}),n})}}
2class ua{constructor(e){this.serializer=e,this.Br=new Map,this.Lr=new Map}getBundleMetadata(e,t){return _e.resolve(this.Br.get(t))}saveBundleMetadata(e,t){return this.Br.set(t.id,function(e){return{id:e.id,version:e.version,createTime:xs(e.createTime)}}(t)),_e.resolve()}getNamedQuery(e,t){return _e.resolve(this.Lr.get(t))}saveNamedQuery(e,t){return this.Lr.set(t.name,function(e){return{name:e.name,query:Gs(e.bundledQuery),readTime:xs(e.readTime)}}(t)),_e.resolve()}}class da{constructor(){this.overlays=new ht(ae.comparator),this.kr=new Map}getOverlay(e,t){return _e.resolve(this.overlays.get(t))}getOverlays(e,t){const n=rr();return _e.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.wt(e,t,r)}),_e.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.kr.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.kr.delete(n)),_e.resolve()}getOverlaysForCollection(e,t,n){const r=rr(),s=t.length+1,a=new ae(t.child("")),i=this.overlays.getIteratorFrom(a);for(;i.hasNext();){const e=i.getNext().value,a=e.getKey();if(!t.isPrefixOf(a.path))break;a.path.length===s&&e.largestBatchId>n&&r.set(e.getKey(),e)}return _e.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let s=new ht((e,t)=>e-t);const a=this.overlays.getIterator();for(;a.hasNext();){const e=a.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=s.get(e.largestBatchId);null===t&&(t=rr(),s=s.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const i=rr(),o=s.getIterator();for(;o.hasNext()&&(o.getNext().value.forEach((e,t)=>i.set(e,t)),!(i.size()>=r)););return _e.resolve(i)}wt(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.kr.get(r.largestBatchId).delete(n.key);this.kr.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Wr(t,n));let s=this.kr.get(t);void 0===s&&(s=lr(),this.kr.set(t,s)),this.kr.set(t,s.add(n.key))}}class ha{constructor(){this.sessionToken=bt.EMPTY_BYTE_STRING}getSessionToken(e){return _e.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,_e.resolve()}}class ma{constructor(){this.qr=new ft(pa.Qr),this.$r=new ft(pa.Ur)}isEmpty(){return this.qr.isEmpty()}addReference(e,t){const n=new pa(e,t);this.qr=this.qr.add(n),this.$r=this.$r.add(n)}Kr(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.Wr(new pa(e,t))}Gr(e,t){e.forEach(e=>this.removeReference(e,t))}zr(e){const t=new ae(new ne([])),n=new pa(t,e),r=new pa(t,e+1),s=[];return this.$r.forEachInRange([n,r],e=>{this.Wr(e),s.push(e.key)}),s}jr(){this.qr.forEach(e=>this.Wr(e))}Wr(e){this.qr=this.qr.delete(e),this.$r=this.$r.delete(e)}Jr(e){const t=new ae(new ne([])),n=new pa(t,e),r=new pa(t,e+1);let s=lr();return this.$r.forEachInRange([n,r],e=>{s=s.add(e.key)}),s}containsKey(e){const t=new pa(e,0),n=this.qr.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class pa{constructor(e,t){this.key=e,this.Hr=t}static Qr(e,t){return ae.comparator(e.key,t.key)||Y(e.Hr,t.Hr)}static Ur(e,t){return Y(e.Hr,t.Hr)||ae.comparator(e.key,t.key)}}class fa{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.er=1,this.Yr=new ft(pa.Qr)}checkEmpty(e){return _e.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const s=this.er;this.er++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const a=new qr(s,t,n,r);this.mutationQueue.push(a);for(const i of r)this.Yr=this.Yr.add(new pa(i.key,s)),this.indexManager.addToCollectionParentIndex(e,i.key.path.popLast());return _e.resolve(a)}lookupMutationBatch(e,t){return _e.resolve(this.Zr(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.Xr(n),s=r<0?0:r;return _e.resolve(this.mutationQueue.length>s?this.mutationQueue[s]:null)}getHighestUnacknowledgedBatchId(){return _e.resolve(0===this.mutationQueue.length?Pe:this.er-1)}getAllMutationBatches(e){return _e.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new pa(t,0),r=new pa(t,Number.POSITIVE_INFINITY),s=[];return this.Yr.forEachInRange([n,r],e=>{const t=this.Zr(e.Hr);s.push(t)}),_e.resolve(s)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ft(Y);
2return t.forEach(e=>{const t=new pa(e,0),r=new pa(e,Number.POSITIVE_INFINITY);this.Yr.forEachInRange([t,r],e=>{n=n.add(e.Hr)})}),_e.resolve(this.ei(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let s=n;ae.isDocumentKey(s)||(s=s.child(""));const a=new pa(new ae(s),0);let i=new ft(Y);return this.Yr.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(i=i.add(e.Hr)),!0)},a),_e.resolve(this.ei(i))}ei(e){const t=[];return e.forEach(e=>{const n=this.Zr(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){R(0===this.ti(t.batchId,"removed"),55003),this.mutationQueue.shift();let n=this.Yr;return _e.forEach(t.mutations,r=>{const s=new pa(r.key,t.batchId);return n=n.delete(s),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.Yr=n})}rr(e){}containsKey(e,t){const n=new pa(t,0),r=this.Yr.firstAfterOrEqual(n);return _e.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,_e.resolve()}ti(e,t){return this.Xr(e)}Xr(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Zr(e){const t=this.Xr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class ga{constructor(e){this.ni=e,this.docs=new ht(ae.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),s=r?r.size:0,a=this.ni(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:a}),this.size+=a-s,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return _e.resolve(n?n.document.mutableCopy():an.newInvalidDocument(t))}getEntries(e,t){let n=Zn();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():an.newInvalidDocument(e))}),_e.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let s=Zn();const a=t.path,i=new ae(a.child("__id-9223372036854775808__")),o=this.docs.getIteratorFrom(i);for(;o.hasNext();){const{key:e,value:{document:i}}=o.getNext();if(!a.isPrefixOf(e.path))break;e.path.length>a.length+1||Ee(Ne(i),n)<=0||(r.has(i.key)||Kn(t,i))&&(s=s.insert(i.key,i.mutableCopy()))}return _e.resolve(s)}getAllFromCollectionGroup(e,t,n,r){I(9500)}ri(e,t){return _e.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new va(this)}getSize(e){return _e.resolve(this.size)}}class va extends oa{constructor(e){super(),this.Or=e}applyChanges(e){const t=[];
vendor: 4,776 bytes, line 2
2return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.Or.addEntry(e,r)):this.Or.removeEntry(n)}),_e.waitFor(t)}getFromCache(e,t){return this.Or.getEntry(e,t)}getAllFromCache(e,t){return this.Or.getEntries(e,t)}}class ya{constructor(e){this.persistence=e,this.ii=new $n(e=>In(e),Pn),this.lastRemoteSnapshotVersion=ye.min(),this.highestTargetId=0,this.si=0,this.oi=new ma,this.targetCount=0,this._i=Zs.ar()}forEachTarget(e,t){return this.ii.forEach((e,n)=>t(n)),_e.resolve()}getLastRemoteSnapshotVersion(e){return _e.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return _e.resolve(this.si)}allocateTargetId(e){return this.highestTargetId=this._i.next(),_e.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.si&&(this.si=t),_e.resolve()}hr(e){this.ii.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this._i=new Zs(t),this.highestTargetId=t),e.sequenceNumber>this.si&&(this.si=e.sequenceNumber)}addTargetData(e,t){return this.hr(t),this.targetCount+=1,_e.resolve()}updateTargetData(e,t){return this.hr(t),_e.resolve()}removeTargetData(e,t){return this.ii.delete(t.target),this.oi.zr(t.targetId),this.targetCount-=1,_e.resolve()}removeTargets(e,t,n){let r=0;const s=[];return this.ii.forEach((a,i)=>{i.sequenceNumber<=t&&null===n.get(i.targetId)&&(this.ii.delete(a),s.push(this.removeMatchingKeysForTargetId(e,i.targetId)),r++)}),_e.waitFor(s).next(()=>r)}getTargetCount(e){return _e.resolve(this.targetCount)}getTargetData(e,t){const n=this.ii.get(t)||null;return _e.resolve(n)}addMatchingKeys(e,t,n){return this.oi.Kr(t,n),_e.resolve()}removeMatchingKeys(e,t,n){this.oi.Gr(t,n);const r=this.persistence.referenceDelegate,s=[];return r&&t.forEach(t=>{s.push(r.markPotentiallyOrphaned(e,t))}),_e.waitFor(s)}removeMatchingKeysForTargetId(e,t){return this.oi.zr(t),_e.resolve()}getMatchingKeysForTargetId(e,t){const n=this.oi.Jr(t);return _e.resolve(n)}containsKey(e,t){return _e.resolve(this.oi.containsKey(t))}}class ba{constructor(e,t){this.ai={},this.overlays={},this.ui=new Ie(0),this.ci=!1,this.ci=!0,this.li=new ha,this.referenceDelegate=e(this),this.hi=new ya(this),this.indexManager=new Js,this.remoteDocumentCache=function(e){return new ga(e)}(e=>this.referenceDelegate.Pi(e)),this.serializer=new Ws(t),this.Ti=new ua(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.ci=!1,Promise.resolve()}get started(){return this.ci}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new da,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.ai[e.toKey()];return n||(n=new fa(t,this.referenceDelegate),this.ai[e.toKey()]=n),n}getGlobalsCache(){return this.li}getTargetCache(){return this.hi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ti}runTransaction(e,t,n){k("MemoryPersistence","Starting transaction:",e);const r=new xa(this.ui.next());return this.referenceDelegate.Ii(),n(r).next(e=>this.referenceDelegate.di(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Ei(e,t){return _e.or(Object.values(this.ai).map(n=>()=>n.containsKey(e,t)))}}class xa extends Ce{constructor(e){super(),this.currentSequenceNumber=e}}class wa{constructor(e){this.persistence=e,this.Ai=new ma,this.Ri=null}static Vi(e){return new wa(e)}get mi(){if(this.Ri)return this.Ri;throw I(60996)}addReference(e,t,n){return this.Ai.addReference(n,t),this.mi.delete(n.toString()),_e.resolve()}removeReference(e,t,n){return this.Ai.removeReference(n,t),this.mi.add(n.toString()),_e.resolve()}markPotentiallyOrphaned(e,t){return this.mi.add(t.toString()),_e.resolve()}removeTarget(e,t){this.Ai.zr(t.targetId).forEach(e=>this.mi.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.mi.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Ii(){this.Ri=new Set}di(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return _e.forEach(this.mi,n=>{const r=ae.fromPath(n);return this.fi(e,r).next(e=>{e||t.removeEntry(r,ye.min())})}).next(()=>(this.Ri=null,t.apply(e)))}updateLimboDocument(e,t){return this.fi(e,t).next(e=>{e?this.mi.delete(t.toString()):this.mi.add(t.toString())})}Pi(e){return 0}fi(e,t){return _e.or([()=>_e.resolve(this.Ai.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Ei(e,t)])}}class Na{constructor(e,t){this.persistence=e,this.gi=new $n(e=>Me(e.path),(e,t)=>e.isEqual(t)),this.garbageCollector=ia(this,t)}static Vi(e,t){return new Na(e,t)}Ii(){}di(e){return _e.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEac
2hTarget(e,t)}mr(e){const t=this.yr(e);return this.persistence.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}yr(e){let t=0;return this.gr(e,e=>{t++}).next(()=>t)}gr(e,t){return _e.forEach(this.gi,(n,r)=>this.Sr(e,n,r).next(e=>e?_e.resolve():t(r)))}removeTargets(e,t,n){return this.persistence.getTargetCache().removeTargets(e,t,n)}removeOrphanedDocuments(e,t){let n=0;const r=this.persistence.getRemoteDocumentCache(),s=r.newChangeBuffer();return r.ri(e,r=>this.Sr(e,r,t).next(e=>{e||(n++,s.removeEntry(r,ye.min()))})).next(()=>s.apply(e)).next(()=>n)}markPotentiallyOrphaned(e,t){return this.gi.set(t,e.currentSequenceNumber),_e.resolve()}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,n)}addReference(e,t,n){return this.gi.set(n,e.currentSequenceNumber),_e.resolve()}removeReference(e,t,n){return this.gi.set(n,e.currentSequenceNumber),_e.resolve()}updateLimboDocument(e,t){return this.gi.set(t,e.currentSequenceNumber),_e.resolve()}Pi(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=Kt(e.data.value)),t}Sr(e,t,n){return _e.or([()=>this.persistence.Ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const e=this.gi.get(t);return _e.resolve(void 0!==e&&e>n)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class ja{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.Is=n,this.ds=r}static Es(e,t){let n=lr(),r=lr();for(const s of t.docChanges)switch(s.type){case 0:n=n.add(s.doc.key);break;case 1:r=r.add(s.doc.key)}return new ja(e,t.fromCache,n,r)}}class Ea{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class Sa{constructor(){this.As=!1,this.Rs=!1,this.Vs=100,this.fs=(0,l.nr)()?8:Ae((0,l.ZQ)())>0?6:4}initialize(e,t){this.gs=e,this.indexManager=t,this.As=!0}getDocumentsMatchingQuery(e,t,n,r){const s={result:null};return this.ps(e,t).next(e=>{s.result=e}).next(()=>{if(!s.result)return this.ys(e,t,r,n).next(e=>{s.result=e})}).next(()=>{if(s.result)return;const n=new Ea;return this.ws(e,t,n).next(r=>{if(s.result=r,this.Rs)return this.Ss(e,t,n,r.size)})}).next(()=>s.result)}Ss(e,t,n,r){return n.documentReadCount<this.Vs?(C()<=o.$b.DEBUG&&k("QueryEngine","SDK will not create cache indexes for query:",Gn(t),"since it only creates cache indexes for collection contains","more than or equal to",this.Vs,"documents"),_e.resolve()):(C()<=o.$b.DEBUG&&k("QueryEngine","Query:",Gn(t),"scans",n.documentReadCount,"local documents and returns",r,"documents as results."),n.documentReadCount>this.fs*r?(C()<=o.$b.DEBUG&&k("QueryEngine","The SDK decides to create cache indexes for query:",Gn(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Vn(t))):_e.resolve())}ps(e,t){if(Mn(t))return _e.resolve(null);let n=Vn(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(t=qn(t,null,"F"),n=Vn(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{const s=lr(...r);return this.gs.getDocuments(e,s).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{const a=this.bs(t,r);return this.Ds(t,a,s,n.readTime)?this.ps(e,qn(t,null,"F")):this.vs(e,a,t,n)}))})))}ys(e,t,n,r){return Mn(t)||r.isEqual(ye.min())?_e.resolve(null):this.gs.getDocuments(e,n).next(s=>{const a=this.bs(t,s);return this.Ds(t,a,n,r)?_e.resolve(null):(C()<=o.$b.DEBUG&&k("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),Gn(t)),this.vs(e,a,t,we(r,be)).next(e=>e))})}bs(e,t){let n=new ft(Yn(e));return t.forEach((t,r)=>{Kn(e,r)&&(n=n.add(r))}),n}Ds(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const s="F"===e.limitType?t.last():t.first();return!!s&&(s.hasPendingWrites||s.version.compareTo(r)>0)}ws(e,t,n){return C()<=o.$b.DEBUG&&k("QueryEngine","Using full collection scan to execute query:",Gn(t)),this.gs.getDocumentsMatchingQuery(e,t,je.min(),n)}vs(e,t,n,r){return this.gs.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}const Ca="LocalStore",ka=3e8;class _a{constructor(e,t,n,r){this.persistence=e,this.Cs=t,this.serializer
2=r,this.Fs=new ht(Y),this.Ms=new $n(e=>In(e),Pn),this.xs=new Map,this.Os=e.getRemoteDocumentCache(),this.hi=e.getTargetCache(),this.Ti=e.getBundleCache(),this.Ns(n)}Ns(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new ca(this.Os,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Os.setIndexManager(this.indexManager),this.Cs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Fs))}}function Aa(e,t,n,r){return new _a(e,t,n,r)}async function Ta(e,t){const n=D(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let r;return n.mutationQueue.getAllMutationBatches(e).next(s=>(r=s,n.Ns(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const s=[],a=[];let i=lr();for(const e of r){s.push(e.batchId);for(const t of e.mutations)i=i.add(t.key)}for(const e of t){a.push(e.batchId);for(const t of e.mutations)i=i.add(t.key)}return n.localDocuments.getDocuments(e,i).next(e=>({Bs:e,removedBatchIds:s,addedBatchIds:a}))})})}function Ia(e){const t=D(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.hi.getLastRemoteSnapshotVersion(e))}function Pa(e,t,n){let r=lr(),s=lr();return n.forEach(e=>r=r.add(e)),t.getEntries(e,r).next(e=>{let r=Zn();return n.forEach((n,a)=>{const i=e.get(n);a.isFoundDocument()!==i.isFoundDocument()&&(s=s.add(n)),a.isNoDocument()&&a.version.isEqual(ye.min())?(t.removeEntry(n,a.readTime),r=r.insert(n,a)):!i.isValidDocument()||a.version.compareTo(i.version)>0||0===a.version.compareTo(i.version)&&i.hasPendingWrites?(t.addEntry(a),r=r.insert(n,a)):k(Ca,"Ignoring outdated watch update for ",n,". Current version:",i.version," Watch version:",a.version)}),{Ls:r,ks:s}})}function Ra(e,t){const n=D(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=Pe),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}function Da(e,t){const n=D(e);return n.persistence.runTransaction("Allocate target","readwrite",e=>{let r;return n.hi.getTargetData(e,t).next(s=>s?(r=s,_e.resolve(r)):n.hi.allocateTargetId(e).next(s=>(r=new Hs(t,s,"TargetPurposeListen",e.currentSequenceNumber),n.hi.addTargetData(e,r).next(()=>r))))}).then(e=>{const r=n.Fs.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Fs=n.Fs.insert(e.targetId,e),n.Ms.set(t,e.targetId)),e})}async function Oa(e,t,n){const r=D(e),s=r.Fs.get(t),a=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",a,e=>r.persistence.referenceDelegate.removeTarget(e,s))}catch(e){if(!Te(e))throw e;k(Ca,"Failed to update sequence numbers for target ".concat(t,": ").concat(e))}r.Fs=r.Fs.remove(t),r.Ms.delete(s.target)}function La(e,t,n){const r=D(e);let s=ye.min(),a=lr();return r.persistence.runTransaction("Execute query","readwrite",e=>function(e,t,n){const r=D(e),s=r.Ms.get(n);return void 0!==s?_e.resolve(r.Fs.get(s)):r.hi.getTargetData(t,n)}(r,e,Vn(t)).next(t=>{if(t)return s=t.lastLimboFreeSnapshotVersion,r.hi.getMatchingKeysForTargetId(e,t.targetId).next(e=>{a=e})}).next(()=>r.Cs.getDocumentsMatchingQuery(e,t,n?s:ye.min(),n?a:lr())).next(e=>(Ma(r,Jn(t),e),{documents:e,qs:a})))}function Ma(e,t,n){let r=e.xs.get(t)||ye.min();n.forEach((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)}),e.xs.set(t,r)}class Fa{constructor(){this.activeTargetIds=ur()}Gs(e){this.activeTargetIds=this.activeTargetIds.add(e)}zs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Ws(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Ua{constructor(){this.Fo=new Fa,this.Mo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])&&this.Fo.Gs(e),this.Mo[e]||"not-current"}updateQueryState(e,t,n){this.Mo[e]=t}removeLocalQueryTarget(e){this.Fo.zs(e)}isLocalQueryTarget(e){return this.Fo.activeTargetIds.has(e)}clearQueryState(e){delete this.Mo[e]}getAllActiveQueryTargets(){return this.Fo.activeTargetIds}isActiveQueryTarget(e){return this.Fo.activeTargetIds.has(e)}start(){return this.Fo=new Fa,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class Va{xo(e){}shutdown(){}}const za="ConnectivityMonitor";class Ba{constructor(){this.Oo=()=>this.No(),this.Bo=()=>this.Lo(),this.ko=[],this.qo()}xo(e){this.ko.push(e)}shutdown(){window.removeEventListener("online",this.Oo),window.removeEventListener("offline",this.Bo)}qo(){window.addEventListener("online",this.Oo),window.addEventListener("offline",this.Bo)}No(){k(za,"Network connectivity changed: AVAILABLE");for(const e of this.ko)e(0)}Lo(){k(za,"Network connectivity changed: UNAVAILABLE");for(const e of this.ko)e(1)}static C(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let qa=null;function Ha(){return null===qa?qa=268435456+Math.round(2147483648*Math.random()):qa++,"0x"+qa.toString(16)}const Wa="RestConnection",Ga={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
2Query:"runAggregationQuery"};class Ka{get Qo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",n=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.$o=t+"://"+e.host,this.Uo="projects/".concat(n,"/databases/").concat(r),this.Ko=this.databaseId.database===Pt?"project_id=".concat(n):"project_id=".concat(n,"&database_id=").concat(r)}Wo(e,t,n,r,s){const a=Ha(),i=this.Go(e,t.toUriEncodedString());k(Wa,"Sending RPC '".concat(e,"' ").concat(a,":"),i,n);const o={"google-cloud-resource-prefix":this.Uo,"x-goog-request-params":this.Ko};this.zo(o,r,s);const{host:c}=new URL(i),u=(0,l.zJ)(c);return this.jo(e,i,o,n,u).then(t=>(k(Wa,"Received RPC '".concat(e,"' ").concat(a,": "),t),t),t=>{throw A(Wa,"RPC '".concat(e,"' ").concat(a," failed with error: "),t,"url: ",i,"request:",n),t})}Jo(e,t,n,r,s,a){return this.Wo(e,t,n,r,s)}zo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+E,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}Go(e,t){const n=Ga[e];return"".concat(this.$o,"/v1/").concat(t,":").concat(n)}terminate(){}}class Ja{constructor(e){this.Ho=e.Ho,this.Yo=e.Yo}Zo(e){this.Xo=e}e_(e){this.t_=e}n_(e){this.r_=e}onMessage(e){this.i_=e}close(){this.Yo()}send(e){this.Ho(e)}s_(){this.Xo()}o_(){this.t_()}__(e){this.r_(e)}a_(e){this.i_(e)}}const Ya="WebChannelConnection";class Qa extends Ka{constructor(e){super(e),this.u_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}jo(e,t,n,r,s){const a=Ha();return new Promise((s,i)=>{const o=new d;o.setWithCredentials(!0),o.listenOnce(m.COMPLETE,()=>{try{switch(o.getLastErrorCode()){case p.NO_ERROR:const t=o.getResponseJson();k(Ya,"XHR for RPC '".concat(e,"' ").concat(a," received:"),JSON.stringify(t)),s(t);break;case p.TIMEOUT:k(Ya,"RPC '".concat(e,"' ").concat(a," timed out")),i(new L(O.DEADLINE_EXCEEDED,"Request time out"));break;case p.HTTP_ERROR:const n=o.getStatus();if(k(Ya,"RPC '".concat(e,"' ").concat(a," failed with status:"),n,"response text:",o.getResponseText()),n>0){let e=o.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(O).indexOf(t)>=0?t:O.UNKNOWN}(t.status);i(new L(e,t.message))}else i(new L(O.UNKNOWN,"Server responded with status "+o.getStatus()))}else i(new L(O.UNAVAILABLE,"Connection failed."));break;default:I(9055,{c_:e,streamId:a,l_:o.getLastErrorCode(),h_:o.getLastError()})}}finally{k(Ya,"RPC '".concat(e,"' ").concat(a," completed."))}});const l=JSON.stringify(r);k(Ya,"RPC '".concat(e,"' ").concat(a," sending request:"),r),o.send(t,"POST",l,n,15)})}P_(e,t,n){const r=Ha(),s=[this.$o,"/","google.firestore.v1.Firestore","/",e,"/channel"],a=y(),i=v(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:"projects/".concat(this.databaseId.projectId,"/databases/").concat(this.databaseId.database)},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;void 0!==l&&(o.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(o.useFetchStreams=!0),this.zo(o.initMessageHeaders,t,n),o.encodeInitMessageHeaders=!0;const c=s.join("");k(Ya,"Creating RPC '".concat(e,"' stream ").concat(r,": ").concat(c),o);const u=a.createWebChannel(c,o);this.T_(u);let d=!1,m=!1;const p=new Ja({Ho:t=>{m?k(Ya,"Not sending because RPC '".concat(e,"' stream ").concat(r," is closed:"),t):(d||(k(Ya,"Opening RPC '".concat(e,"' stream ").concat(r," transport.")),u.open(),d=!0),k(Ya,"RPC '".concat(e,"' stream ").concat(r," sending:"),t),u.send(t))},Yo:()=>u.close()}),b=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return b(u,h.EventType.OPEN,()=>{m||(k(Ya,"RPC '".concat(e,"' stream ").concat(r," transport opened.")),p.s_())}),b(u,h.EventType.CLOSE,()=>{m||(m=!0,k(Ya,"RPC '".concat(e,"' stream ").concat(r," transport closed")),p.__(),this.I_(u))}
2),b(u,h.EventType.ERROR,t=>{m||(m=!0,A(Ya,"RPC '".concat(e,"' stream ").concat(r," transport errored. Name:"),t.name,"Message:",t.message),p.__(new L(O.UNAVAILABLE,"The operation could not be completed")))}),b(u,h.EventType.MESSAGE,t=>{var n;if(!m){const s=t.data[0];R(!!s,16349);const a=s,i=(null==a?void 0:a.error)||(null===(n=a[0])||void 0===n?void 0:n.error);if(i){k(Ya,"RPC '".concat(e,"' stream ").concat(r," received error:"),i);const t=i.status;let n=function(e){const t=Kr[e];if(void 0!==t)return Qr(t)}(t),s=i.message;void 0===n&&(n=O.INTERNAL,s="Unknown error status: "+t+" with message "+i.message),m=!0,p.__(new L(n,s)),u.close()}else k(Ya,"RPC '".concat(e,"' stream ").concat(r," received:"),s),p.a_(s)}}),b(i,g.STAT_EVENT,t=>{t.stat===f.PROXY?k(Ya,"RPC '".concat(e,"' stream ").concat(r," detected buffering proxy")):t.stat===f.NOPROXY&&k(Ya,"RPC '".concat(e,"' stream ").concat(r," detected no buffering proxy"))}),setTimeout(()=>{p.o_()},0),p}terminate(){this.u_.forEach(e=>e.close()),this.u_=[]}T_(e){this.u_.push(e)}I_(e){this.u_=this.u_.filter(t=>t===e)}}function $a(){return"undefined"!=typeof document?document:null}function Xa(e){return new fs(e,!0)}class Za{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1.5,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:6e4;this.Fi=e,this.timerId=t,this.d_=n,this.E_=r,this.A_=s,this.R_=0,this.V_=null,this.m_=Date.now(),this.reset()}reset(){this.R_=0}f_(){this.R_=this.A_}g_(e){this.cancel();const t=Math.floor(this.R_+this.p_()),n=Math.max(0,Date.now()-this.m_),r=Math.max(0,t-n);r>0&&k("ExponentialBackoff","Backing off for ".concat(r," ms (base delay: ").concat(this.R_," ms, delay with jitter: ").concat(t," ms, last attempt: ").concat(n," ms ago)")),this.V_=this.Fi.enqueueAfterDelay(this.timerId,r,()=>(this.m_=Date.now(),e())),this.R_*=this.E_,this.R_<this.d_&&(this.R_=this.d_),this.R_>this.A_&&(this.R_=this.A_)}y_(){null!==this.V_&&(this.V_.skipDelay(),this.V_=null)}cancel(){null!==this.V_&&(this.V_.cancel(),this.V_=null)}p_(){return(Math.random()-.5)*this.R_}}const ei="PersistentStream";class ti{constructor(e,t,n,r,s,a,i,o){this.Fi=e,this.w_=n,this.S_=r,this.connection=s,this.authCredentialsProvider=a,this.appCheckCredentialsProvider=i,this.listener=o,this.state=0,this.b_=0,this.D_=null,this.v_=null,this.stream=null,this.C_=0,this.F_=new Za(e,t)}M_(){return 1===this.state||5===this.state||this.x_()}x_(){return 2===this.state||3===this.state}start(){this.C_=0,4!==this.state?this.auth():this.O_()}async stop(){this.M_()&&await this.close(0)}N_(){this.state=0,this.F_.reset()}B_(){this.x_()&&null===this.D_&&(this.D_=this.Fi.enqueueAfterDelay(this.w_,6e4,()=>this.L_()))}k_(e){this.q_(),this.stream.send(e)}async L_(){if(this.x_())return this.close(0)}q_(){this.D_&&(this.D_.cancel(),this.D_=null)}Q_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,t){this.q_(),this.Q_(),this.F_.cancel(),this.b_++,4!==e?this.F_.reset():t&&t.code===O.RESOURCE_EXHAUSTED?(_(t.toString()),_("Using maximum backoff delay to prevent overloading the backend."),this.F_.f_()):t&&t.code===O.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.U_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.n_(t)}U_(){}auth(){this.state=1;const e=this.K_(this.b_),t=this.b_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(e=>{let[n,r]=e;this.b_===t&&this.W_(n,r)},t=>{e(()=>{const e=new L(O.UNKNOWN,"Fetching auth token failed: "+t.message);return this.G_(e)})})}W_(e,t){const n=this.K_(this.b_);this.stream=this.z_(e,t),this.stream.Zo(()=>{n(()=>this.listener.Zo())}),this.stream.e_(()=>{n(()=>(this.state=2,this.v_=this.Fi.enqueueAfterDelay(this.S_,1e4,()=>(this.x_()&&(this.state=3),Promise.resolve())),this.listener.e_()))}),this.stream.n_(e=>{n(()=>this.G_(e))}),this.stream.onMessage(e=>{n(()=>1==++this.C_?this.j_(e):this.onNext(e))})}O_(){this.state=5,this.F_.g_(async()=>{this.state=0,this.start()})}G_(e){return k(ei,"close with error: ".concat(e)),this.stream=null,this.close(4,e)}K_(e){return t=>{this.Fi.enqueueAndForget(()=>this.b_===e?t():(k(ei,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class ni extends ti{constructor(e,t,n,r,s,a){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,a),this.serializer
2=s}z_(e,t){return this.connection.P_("Listen",e,t)}j_(e){return this.onNext(e)}onNext(e){this.F_.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:I(39313,{state:e})}(t.targetChange.targetChangeType||"NO_CHANGE"),s=t.targetChange.targetIds||[],a=function(e,t){return e.useProto3Json?(R(void 0===t||"string"==typeof t,58123),bt.fromBase64String(t||"")):(R(void 0===t||t instanceof Buffer||t instanceof Uint8Array,16193),bt.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),i=t.targetChange.cause,o=i&&function(e){const t=void 0===e.code?O.UNKNOWN:Qr(e.code);return new L(t,e.message||"")}(i);n=new os(r,s,a,o||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const s=Ss(e,r.document.name),a=xs(r.document.updateTime),i=r.document.createTime?xs(r.document.createTime):ye.min(),o=new rn({mapValue:{fields:r.document.fields}}),l=an.newFoundDocument(s,a,i,o),c=r.targetIds||[],u=r.removedTargetIds||[];n=new as(c,u,l.key,l)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const s=Ss(e,r.document),a=r.readTime?xs(r.readTime):ye.min(),i=an.newNoDocument(s,a),o=r.removedTargetIds||[];n=new as([],o,i.key,i)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const s=Ss(e,r.document),a=r.removedTargetIds||[];n=new as([],a,s,null)}else{if(!("filter"in t))return I(11601,{At:t});{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:s}=e,a=new Gr(r,s),i=e.targetId;n=new is(i,a)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return ye.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?ye.min():t.readTime?xs(t.readTime):ye.min()}(e);return this.listener.J_(t,n)}H_(e){const t={};t.database=_s(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=Rn(r)?{documents:Ps(e,r)}:{query:Rs(e,r).Vt},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=ys(e,t.resumeToken);const r=gs(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(ye.min())>0){n.readTime=vs(e,t.snapshotVersion.toTimestamp());const r=gs(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return I(28987,{purpose:e})}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.k_(t)}Y_(e){const t={};t.database=_s(this.serializer),t.removeTarget=e,this.k_(t)}}class ri extends ti{constructor(e,t,n,r,s,a){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,a),this.serializer=s}get Z_(){return this.C_>0}start(){this.lastStreamToken=void 0,super.start()}U_(){this.Z_&&this.X_([])}z_(e,t){return this.connection.P_("Write",e,t)}j_(e){return R(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,R(!e.writeResults||0===e.writeResults.length,55816),this.listener.ea()}onNext(e){R(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.F_.reset();const t=function(e,t){return e&&e.length>0?(R(void 0!==t,14353),e.map(e=>function(e,t){let n=e.updateTime?xs(e.updateTime):xs(t);return n.isEqual(ye.min())&&(n=xs(t)),new kr(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=xs(e.commitTime);return this.listener.ta(n,t)}na(){const e={};e.database=_s(this.serializer),this.k_(e)}X_(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>Is(this.serializer,e))};this.k_(t)}}class si{}class ai extends si{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.ra=!1}ia(){if(this.ra)throw new L(O.FAILED_PRECONDITION,"The client has already been terminated.")}Wo(e,t,n,r){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(s=>{let[a,i]=s;return this.connection.Wo(e,Ns(t,n),r,a,i)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===O.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new L(O.UNKNOWN,e.toString())})}
2Jo(e,t,n,r,s){return this.ia(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(a=>{let[i,o]=a;return this.connection.Jo(e,Ns(t,n),r,i,o,s)}).catch(e=>{throw"FirebaseError"===e.name?(e.code===O.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new L(O.UNKNOWN,e.toString())})}terminate(){this.ra=!0,this.connection.terminate()}}class ii{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.sa=0,this.oa=null,this._a=!0}aa(){0===this.sa&&(this.ua("Unknown"),this.oa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.oa=null,this.ca("Backend didn't respond within 10 seconds."),this.ua("Offline"),Promise.resolve())))}la(e){"Online"===this.state?this.ua("Unknown"):(this.sa++,this.sa>=1&&(this.ha(),this.ca("Connection failed 1 times. Most recent error: ".concat(e.toString())),this.ua("Offline")))}set(e){this.ha(),this.sa=0,"Online"===e&&(this._a=!1),this.ua(e)}ua(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ca(e){const t="Could not reach Cloud Firestore backend. ".concat(e,"\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.");this._a?(_(t),this._a=!1):k("OnlineStateTracker",t)}ha(){null!==this.oa&&(this.oa.cancel(),this.oa=null)}}const oi="RemoteStore";class li{constructor(e,t,n,r,s){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Pa=[],this.Ta=new Map,this.Ia=new Set,this.da=[],this.Ea=s,this.Ea.xo(e=>{n.enqueueAndForget(async()=>{vi(this)&&(k(oi,"Restarting streams for network reachability change."),await async function(e){const t=D(e);t.Ia.add(4),await ui(t),t.Aa.set("Unknown"),t.Ia.delete(4),await ci(t)}(this))})}),this.Aa=new ii(n,r)}}async function ci(e){if(vi(e))for(const t of e.da)await t(!0)}async function ui(e){for(const t of e.da)await t(!1)}function di(e,t){const n=D(e);n.Ta.has(t.targetId)||(n.Ta.set(t.targetId,t),gi(n)?fi(n):Li(n).x_()&&mi(n,t))}function hi(e,t){const n=D(e),r=Li(n);n.Ta.delete(t),r.x_()&&pi(n,t),0===n.Ta.size&&(r.x_()?r.B_():vi(n)&&n.Aa.set("Unknown"))}function mi(e,t){if(e.Ra.$e(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(ye.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}Li(e).H_(t)}function pi(e,t){e.Ra.$e(t),Li(e).Y_(t)}function fi(e){e.Ra=new cs({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),Et:t=>e.Ta.get(t)||null,lt:()=>e.datastore.serializer.databaseId}),Li(e).start(),e.Aa.aa()}function gi(e){return vi(e)&&!Li(e).M_()&&e.Ta.size>0}function vi(e){return 0===D(e).Ia.size}function yi(e){e.Ra=void 0}async function bi(e){e.Aa.set("Online")}async function xi(e){e.Ta.forEach((t,n)=>{mi(e,t)})}async function wi(e,t){yi(e),gi(e)?(e.Aa.la(t),fi(e)):e.Aa.set("Unknown")}async function Ni(e,t,n){if(e.Aa.set("Online"),t instanceof os&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.Ta.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.Ta.delete(r),e.Ra.removeTarget(r))}(e,t)}catch(n){k(oi,"Failed to remove targets %s: %s ",t.targetIds.join(","),n),await ji(e,n)}else if(t instanceof as?e.Ra.Ye(t):t instanceof is?e.Ra.it(t):e.Ra.et(t),!n.isEqual(ye.min()))try{const t=await Ia(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.Ra.Pt(t);
2return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const s=e.Ta.get(r);s&&e.Ta.set(r,s.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{const r=e.Ta.get(t);if(!r)return;e.Ta.set(t,r.withResumeToken(bt.EMPTY_BYTE_STRING,r.snapshotVersion)),pi(e,t);const s=new Hs(r.target,t,n,r.sequenceNumber);mi(e,s)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){k(oi,"Failed to raise snapshot:",t),await ji(e,t)}}async function ji(e,t,n){if(!Te(t))throw t;e.Ia.add(1),await ui(e),e.Aa.set("Offline"),n||(n=()=>Ia(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{k(oi,"Retrying IndexedDB access"),await n(),e.Ia.delete(1),await ci(e)})}function Ei(e,t){return t().catch(n=>ji(e,n,t))}async function Si(e){const t=D(e),n=Mi(t);let r=t.Pa.length>0?t.Pa[t.Pa.length-1].batchId:Pe;for(;Ci(t);)try{const e=await Ra(t.localStore,r);if(null===e){0===t.Pa.length&&n.B_();break}r=e.batchId,ki(t,e)}catch(e){await ji(t,e)}_i(t)&&Ai(t)}function Ci(e){return vi(e)&&e.Pa.length<10}function ki(e,t){e.Pa.push(t);const n=Mi(e);n.x_()&&n.Z_&&n.X_(t.mutations)}function _i(e){return vi(e)&&!Mi(e).M_()&&e.Pa.length>0}function Ai(e){Mi(e).start()}async function Ti(e){Mi(e).na()}async function Ii(e){const t=Mi(e);for(const n of e.Pa)t.X_(n.mutations)}async function Pi(e,t,n){const r=e.Pa.shift(),s=Hr.from(r,t,n);await Ei(e,()=>e.remoteSyncer.applySuccessfulWrite(s)),await Si(e)}async function Ri(e,t){t&&Mi(e).Z_&&await async function(e,t){if(function(e){return Yr(e)&&e!==O.ABORTED}(t.code)){const n=e.Pa.shift();Mi(e).N_(),await Ei(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await Si(e)}}(e,t),_i(e)&&Ai(e)}async function Di(e,t){const n=D(e);n.asyncQueue.verifyOperationInProgress(),k(oi,"RemoteStore received new credentials");const r=vi(n);n.Ia.add(3),await ui(n),r&&n.Aa.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.Ia.delete(3),await ci(n)}async function Oi(e,t){const n=D(e);t?(n.Ia.delete(2),await ci(n)):t||(n.Ia.add(2),await ui(n),n.Aa.set("Unknown"))}function Li(e){return e.Va||(e.Va=function(e,t,n){const r=D(e);return r.ia(),new ni(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{Zo:bi.bind(null,e),e_:xi.bind(null,e),n_:wi.bind(null,e),J_:Ni.bind(null,e)}),e.da.push(async t=>{t?(e.Va.N_(),gi(e)?fi(e):e.Aa.set("Unknown")):(await e.Va.stop(),yi(e))})),e.Va}function Mi(e){return e.ma||(e.ma=function(e,t,n){const r=D(e);return r.ia(),new ri(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{Zo:()=>Promise.resolve(),e_:Ti.bind(null,e),n_:Ri.bind(null,e),ea:Ii.bind(null,e),ta:Pi.bind(null,e)}),e.da.push(async t=>{t?(e.ma.N_(),await Si(e)):(await e.ma.stop(),e.Pa.length>0&&(k(oi,"Stopping write stream with ".concat(e.Pa.length," pending writes")),e.Pa=[]))})),e.ma}class Fi{constructor(e,t,n,r,s){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=s,this.deferred=new M,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,n,r,s){const a=Date.now()+n,i=new Fi(e,t,a,r,s);return i.start(n),i}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new L(O.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Ui(e,t){if(_("AsyncQueue","".concat(t,": ").concat(e)),Te(e))return new L(O.UNAVAILABLE,"".concat(t,": ").concat(e));throw e}class Vi{static emptySet(e){return new Vi(e.comparator)}constructor(e){this.comparator=e?(t,n)=>e(t,n)||ae.comparator(t.key,n.key):(e,t)=>ae.comparator(e.key,t.key),this.keyedMap=tr(),this.sortedSet=new ht(this.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof Vi))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n  "+e.join("  \n")+"\n)"}copy(e,t){const n=new Vi;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class zi{constructor(){this.fa=new ht(ae.comparator)}track(e){const t=e.doc.key,n=this.fa.get(t);n?0!==e.type&&3===n.type?this.fa=this.fa.insert(t,e):3===e.type&&1!==n.type?this.fa=this.fa.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.fa=this.fa.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.fa=this.fa.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.fa=this.fa.remove(t):1===e.type&&2===n.type?this.fa=this.fa.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.fa=this.fa.insert(t,{type:2,doc:e.doc}):I(63341,{At:e,ga:n}):this.fa=this.fa.insert(t,e)}pa(){const e=[];return this.fa.inorderTraversal((t,n)=>{e.push(n)}),e}}class Bi{constructor(e,t,n,r,s,a,i,o,l){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=s,this.fromCache=a,this.syncStateChanged=i,this.excludesMetadataChanges=o,this.hasCachedResults=l}
2static fromInitialDocuments(e,t,n,r,s){const a=[];return t.forEach(e=>{a.push({type:0,doc:e})}),new Bi(e,t,Vi.emptySet(t),a,n,r,!0,!1,s)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Hn(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r].type!==n[r].type||!t[r].doc.isEqual(n[r].doc))return!1;return!0}}class qi{constructor(){this.ya=void 0,this.wa=[]}Sa(){return this.wa.some(e=>e.ba())}}class Hi{constructor(){this.queries=Wi(),this.onlineState="Unknown",this.Da=new Set}terminate(){!function(e,t){const n=D(e),r=n.queries;n.queries=Wi(),r.forEach((e,n)=>{for(const r of n.wa)r.onError(t)})}(this,new L(O.ABORTED,"Firestore shutting down"))}}function Wi(){return new $n(e=>Wn(e),Hn)}async function Gi(e,t){const n=D(e);let r=3;const s=t.query;let a=n.queries.get(s);a?!a.Sa()&&t.ba()&&(r=2):(a=new qi,r=t.ba()?0:1);try{switch(r){case 0:a.ya=await n.onListen(s,!0);break;case 1:a.ya=await n.onListen(s,!1);break;case 2:await n.onFirstRemoteStoreListen(s)}}catch(e){const n=Ui(e,"Initialization of query '".concat(Gn(t.query),"' failed"));return void t.onError(n)}n.queries.set(s,a),a.wa.push(t),t.va(n.onlineState),a.ya&&t.Ca(a.ya)&&Qi(n)}async function Ki(e,t){const n=D(e),r=t.query;let s=3;const a=n.queries.get(r);if(a){const e=a.wa.indexOf(t);e>=0&&(a.wa.splice(e,1),0===a.wa.length?s=t.ba()?0:1:!a.Sa()&&t.ba()&&(s=2))}switch(s){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function Ji(e,t){const n=D(e);let r=!1;for(const s of t){const e=s.query,t=n.queries.get(e);if(t){for(const e of t.wa)e.Ca(s)&&(r=!0);t.ya=s}}r&&Qi(n)}function Yi(e,t,n){const r=D(e),s=r.queries.get(t);if(s)for(const a of s.wa)a.onError(n);r.queries.delete(t)}
2function Qi(e){e.Da.forEach(e=>{e.next()})}var $i,Xi;(Xi=$i||($i={})).Fa="default",Xi.Cache="cache";class Zi{constructor(e,t,n){this.query=e,this.Ma=t,this.xa=!1,this.Oa=null,this.onlineState="Unknown",this.options=n||{}}Ca(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new Bi(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.xa?this.Na(e)&&(this.Ma.next(e),t=!0):this.Ba(e,this.onlineState)&&(this.La(e),t=!0),this.Oa=e,t}onError(e){this.Ma.error(e)}va(e){this.onlineState=e;let t=!1;return this.Oa&&!this.xa&&this.Ba(this.Oa,e)&&(this.La(this.Oa),t=!0),t}Ba(e,t){if(!e.fromCache)return!0;if(!this.ba())return!0;const n="Offline"!==t;return(!this.options.ka||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Na(e){if(e.docChanges.length>0)return!0;const t=this.Oa&&this.Oa.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}La(e){e=Bi.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.xa=!0,this.Ma.next(e)}ba(){return this.options.source!==$i.Cache}}class eo{constructor(e){this.key=e}}class to{constructor(e){this.key=e}}class no{constructor(e,t){this.query=e,this.Ha=t,this.Ya=null,this.hasCachedResults=!1,this.current=!1,this.Za=lr(),this.mutatedKeys=lr(),this.Xa=Yn(e),this.eu=new Vi(this.Xa)}get tu(){return this.Ha}nu(e,t){const n=t?t.ru:new zi,r=t?t.eu:this.eu;let s=t?t.mutatedKeys:this.mutatedKeys,a=r,i=!1;const o="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,l="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>{const c=r.get(e),u=Kn(this.query,t)?t:null,d=!!c&&this.mutatedKeys.has(c.key),h=!!u&&(u.hasLocalMutations||this.mutatedKeys.has(u.key)&&u.hasCommittedMutations);let m=!1;c&&u?c.data.isEqual(u.data)?d!==h&&(n.track({type:3,doc:u}),m=!0):this.iu(c,u)||(n.track({type:2,doc:u}),m=!0,(o&&this.Xa(u,o)>0||l&&this.Xa(u,l)<0)&&(i=!0)):!c&&u?(n.track({type:0,doc:u}),m=!0):c&&!u&&(n.track({type:1,doc:c}),m=!0,(o||l)&&(i=!0)),m&&(u?(a=a.add(u),s=h?s.add(e):s.delete(e)):(a=a.delete(e),s=s.delete(e)))}),null!==this.query.limit)for(;a.size>this.query.limit;){const e="F"===this.query.limitType?a.last():a.first();a=a.delete(e.key),s=s.delete(e.key),n.track({type:1,doc:e})}return{eu:a,ru:n,Ds:i,mutatedKeys:s}}iu(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n,r){const s=this.eu;this.eu=e.eu,this.mutatedKeys=e.mutatedKeys;const a=e.ru.pa();a.sort((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return I(20277,{At:e})}};return n(e)-n(t)}(e.type,t.type)||this.Xa(e.doc,t.doc)),this.su(n),r=null!=r&&r;const i=t&&!r?this.ou():[],o=0===this.Za.size&&this.current&&!r?1:0,l=o!==this.Ya;return this.Ya=o,0!==a.length||l?{snapshot:new Bi(this.query,e.eu,s,a,e.mutatedKeys,0===o,l,!1,!!n&&n.resumeToken.approximateByteSize()>0),_u:i}:{_u:i}}va(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({eu:this.eu,ru:new zi,mutatedKeys:this.mutatedKeys,Ds:!1},!1)):{_u:[]}}au(e){return!this.Ha.has(e)&&!!this.eu.has(e)&&!this.eu.get(e).hasLocalMutations}su(e){e&&(e.addedDocuments.forEach(e=>this.Ha=this.Ha.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Ha=this.Ha.delete(e)),this.current=e.current)}ou(){if(!this.current)return[];const e=this.Za;this.Za=lr(),this.eu.forEach(e=>{this.au(e.key)&&(this.Za=this.Za.add(e.key))});const t=[];return e.forEach(e=>{this.Za.has(e)||t.push(new to(e))}
2),this.Za.forEach(n=>{e.has(n)||t.push(new eo(n))}),t}uu(e){this.Ha=e.qs,this.Za=lr();const t=this.nu(e.documents);return this.applyChanges(t,!0)}cu(){return Bi.fromInitialDocuments(this.query,this.eu,this.mutatedKeys,0===this.Ya,this.hasCachedResults)}}const ro="SyncEngine";class so{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class ao{constructor(e){this.key=e,this.lu=!1}}class io{constructor(e,t,n,r,s,a){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=s,this.maxConcurrentLimboResolutions=a,this.hu={},this.Pu=new $n(e=>Wn(e),Hn),this.Tu=new Map,this.Iu=new Set,this.du=new ht(ae.comparator),this.Eu=new Map,this.Au=new ma,this.Ru={},this.Vu=new Map,this.mu=Zs.ur(),this.onlineState="Unknown",this.fu=void 0}get isPrimaryClient(){return!0===this.fu}}async function oo(e,t){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=Ao(e);let s;const a=r.Pu.get(t);return a?(r.sharedClientState.addLocalQueryTarget(a.targetId),s=a.view.cu()):s=await co(r,t,n,!0),s}async function lo(e,t){const n=Ao(e);await co(n,t,!0,!1)}async function co(e,t,n,r){const s=await Da(e.localStore,Vn(t)),a=s.targetId,i=e.sharedClientState.addLocalQueryTarget(a,n);let o;return r&&(o=await uo(e,t,a,"current"===i,s.resumeToken)),e.isPrimaryClient&&n&&di(e.remoteStore,s),o}async function uo(e,t,n,r,s){e.gu=(t,n,r)=>async function(e,t,n,r){let s=t.view.nu(n);s.Ds&&(s=await La(e.localStore,t.query,!1).then(e=>{let{documents:n}=e;return t.view.nu(n,s)}));const a=r&&r.targetChanges.get(t.targetId),i=r&&null!=r.targetMismatches.get(t.targetId),o=t.view.applyChanges(s,e.isPrimaryClient,a,i);return jo(e,t.targetId,o._u),o.snapshot}(e,t,n,r);const a=await La(e.localStore,t,!0),i=new no(t,a.qs),o=i.nu(a.documents),l=ss.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,s),c=i.applyChanges(o,e.isPrimaryClient,l);jo(e,n,c._u);const u=new so(t,n,i);return e.Pu.set(t,u),e.Tu.has(n)?e.Tu.get(n).push(t):e.Tu.set(n,[t]),c.snapshot}async function ho(e,t,n){const r=D(e),s=r.Pu.get(t),a=r.Tu.get(s.targetId);if(a.length>1)return r.Tu.set(s.targetId,a.filter(e=>!Hn(e,t))),void r.Pu.delete(t);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedCl
2ientState.isActiveQueryTarget(s.targetId)||await Oa(r.localStore,s.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(s.targetId),n&&hi(r.remoteStore,s.targetId),wo(r,s.targetId)}).catch(ke)):(wo(r,s.targetId),await Oa(r.localStore,s.targetId,!0))}async function mo(e,t){const n=D(e),r=n.Pu.get(t),s=n.Tu.get(r.targetId);n.isPrimaryClient&&1===s.length&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),hi(n.remoteStore,r.targetId))}async function po(e,t){const n=D(e);try{const e=await function(e,t){const n=D(e),r=t.snapshotVersion;let s=n.Fs;return n.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const a=n.Os.newChangeBuffer({trackRemovals:!0});s=n.Fs;const i=[];t.targetChanges.forEach((a,o)=>{const l=s.get(o);if(!l)return;i.push(n.hi.removeMatchingKeys(e,a.removedDocuments,o).next(()=>n.hi.addMatchingKeys(e,a.addedDocuments,o)));let c=l.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(o)?c=c.withResumeToken(bt.EMPTY_BYTE_STRING,ye.min()).withLastLimboFreeSnapshotVersion(ye.min()):a.resumeToken.approximateByteSize()>0&&(c=c.withResumeToken(a.resumeToken,r)),s=s.insert(o,c),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||(t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=ka||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0)}(l,c,a)&&i.push(n.hi.updateTargetData(e,c))});let o=Zn(),l=lr();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&i.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))}),i.push(Pa(e,a,t.documentUpdates).next(e=>{o=e.Ls,l=e.ks})),!r.isEqual(ye.min())){const t=n.hi.getLastRemoteSnapshotVersion(e).next(t=>n.hi.setTargetsMetadata(e,e.currentSequenceNumber,r));i.push(t)}return _e.waitFor(i).next(()=>a.apply(e)).next(()=>n.localDocuments.getLocalViewOfDocuments(e,o,l)).next(()=>o)}).then(e=>(n.Fs=s,e))}(n.localStore,t);
2t.targetChanges.forEach((e,t)=>{const r=n.Eu.get(t);r&&(R(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1,22616),e.addedDocuments.size>0?r.lu=!0:e.modifiedDocuments.size>0?R(r.lu,14607):e.removedDocuments.size>0&&(R(r.lu,42227),r.lu=!1))}),await Co(n,e,t)}catch(e){await ke(e)}}function fo(e,t,n){const r=D(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.Pu.forEach((n,r)=>{const s=r.view.va(t);s.snapshot&&e.push(s.snapshot)}),function(e,t){const n=D(e);n.onlineState=t;let r=!1;n.queries.forEach((e,n)=>{for(const s of n.wa)s.va(t)&&(r=!0)}),r&&Qi(n)}(r.eventManager,t),e.length&&r.hu.J_(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function go(e,t,n){const r=D(e);r.sharedClientState.updateQueryState(t,"rejected",n);const s=r.Eu.get(t),a=s&&s.key;if(a){let e=new ht(ae.comparator);e=e.insert(a,an.newNoDocument(a,ye.min()));const n=lr().add(a),s=new rs(ye.min(),new Map,new ht(Y),e,n);await po(r,s),r.du=r.du.remove(a),r.Eu.delete(t),So(r)}else await Oa(r.localStore,t,!1).then(()=>wo(r,t,n)).catch(ke)}async function vo(e,t){const n=D(e),r=t.batch.batchId;try{const e=await function(e,t){const n=D(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const r=t.batch.keys(),s=n.Os.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const s=n.batch,a=s.keys();let i=_e.resolve();return a.forEach(e=>{i=i.next(()=>r.getEntry(t,e)).next(t=>{const a=n.docVersions.get(e);R(null!==a,48541),t.version.compareTo(a)<0&&(s.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),i.next(()=>e.mutationQueue.removeMutationBatch(t,s))}(n,e,t,s).next(()=>s.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=lr();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))})}(n.localStore,t);xo(n,r,null),bo(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Co(n,e)}catch(e){await ke(e)}}async function yo(e,t,n){const r=D(e);try{const e=await function(e,t){const n=D(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;
2return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(R(null!==t,37113),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r)).next(()=>n.localDocuments.getDocuments(e,r))})}(r.localStore,t);xo(r,t,n),bo(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await Co(r,e)}catch(n){await ke(n)}}function bo(e,t){(e.Vu.get(t)||[]).forEach(e=>{e.resolve()}),e.Vu.delete(t)}function xo(e,t,n){const r=D(e);let s=r.Ru[r.currentUser.toKey()];if(s){const e=s.get(t);e&&(n?e.reject(n):e.resolve(),s=s.remove(t)),r.Ru[r.currentUser.toKey()]=s}}function wo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.sharedClientState.removeLocalQueryTarget(t);for(const r of e.Tu.get(t))e.Pu.delete(r),n&&e.hu.pu(r,n);e.Tu.delete(t),e.isPrimaryClient&&e.Au.zr(t).forEach(t=>{e.Au.containsKey(t)||No(e,t)})}function No(e,t){e.Iu.delete(t.path.canonicalString());const n=e.du.get(t);null!==n&&(hi(e.remoteStore,n),e.du=e.du.remove(t),e.Eu.delete(n),So(e))}function jo(e,t,n){for(const r of n)r instanceof eo?(e.Au.addReference(r.key,t),Eo(e,r)):r instanceof to?(k(ro,"Document no longer in limbo: "+r.key),e.Au.removeReference(r.key,t),e.Au.containsKey(r.key)||No(e,r.key)):I(19791,{yu:r})}function Eo(e,t){const n=t.key,r=n.path.canonicalString();e.du.get(n)||e.Iu.has(r)||(k(ro,"New document in limbo: "+n),e.Iu.add(r),So(e))}function So(e){for(;e.Iu.size>0&&e.du.size<e.maxConcurrentLimboResolutions;){const t=e.Iu.values().next().value;e.Iu.delete(t);const n=new ae(ne.fromString(t)),r=e.mu.next();e.Eu.set(r,new ao(n)),e.du=e.du.insert(n,r),di(e.remoteStore,new Hs(Vn(Ln(n.path)),r,"TargetPurposeLimboResolution",Ie.ue))}}async function Co(e,t,n){const r=D(e),s=[],a=[],i=[];r.Pu.isEmpty()||(r.Pu.forEach((e,o)=>{i.push(r.gu(o,t,n).then(e=>{var t;if((e||n)&&r.isPrimaryClient){const s=e?!e.fromCache:null===(t=null==n?void 0:n.targetChanges.get(o.targetId))||void 0===t?void 0:t.current;
2r.sharedClientState.updateQueryState(o.targetId,s?"current":"not-current")}if(e){s.push(e);const t=ja.Es(o.targetId,e);a.push(t)}}))}),await Promise.all(i),r.hu.J_(s),await async function(e,t){const n=D(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>_e.forEach(t,t=>_e.forEach(t.Is,r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r)).next(()=>_e.forEach(t.ds,r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))}catch(e){if(!Te(e))throw e;k(Ca,"Failed to update sequence numbers: "+e)}for(const r of t){const e=r.targetId;if(!r.fromCache){const t=n.Fs.get(e),r=t.snapshotVersion,s=t.withLastLimboFreeSnapshotVersion(r);n.Fs=n.Fs.insert(e,s)}}}(r.localStore,a))}async function ko(e,t){const n=D(e);if(!n.currentUser.isEqual(t)){k(ro,"User change. New user:",t.toKey());const e=await Ta(n.localStore,t);n.currentUser=t,function(e,t){e.Vu.forEach(e=>{e.forEach(e=>{e.reject(new L(O.CANCELLED,t))})}),e.Vu.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await Co(n,e.Bs)}}function _o(e,t){const n=D(e),r=n.Eu.get(t);if(r&&r.lu)return lr().add(r.key);{let e=lr();const r=n.Tu.get(t);if(!r)return e;for(const t of r){const r=n.Pu.get(t);e=e.unionWith(r.view.tu)}return e}}function Ao(e){const t=D(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=po.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=_o.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=go.bind(null,t),t.hu.J_=Ji.bind(null,t.eventManager),t.hu.pu=Yi.bind(null,t.eventManager),t}function To(e){const t=D(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=vo.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=yo.bind(null,t),t}class Io{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Xa(e.databaseInfo.databaseId),this.sharedClientState=this.bu(e),this.persistence=this.Du(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Cu(e,this.localStore),this.indexBackfillerScheduler=this.Fu(e,this.localStore)}Cu(e,t){return null}Fu(e,t){return null}vu(e){return Aa(this.persistence,new Sa,e.initialUser,this.serializer)}Du(e){return new ba(wa.Vi,this.serializer)}bu(e){return new Ua}async terminate(){var e,t;null===(e=this.gcScheduler)||void 0===e||e.stop(),null===(t=this.indexBackfillerScheduler)||void 0===t||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Io.provider={build:()=>new Io};class Po extends Io{constructor(e){super(),this.cacheSizeBytes=e}Cu(e,t){R(this.persistence.referenceDelegate instanceof Na,46915);const n=this.persistence.referenceDelegate.garbageCollector;return new sa(n,e.asyncQueue,t)}Du(e){const t=void 0!==this.cacheSizeBytes?Xs.withCacheSize(this.cacheSizeBytes):Xs.DEFAULT;return new ba(e=>Na.Vi(e,t),this.serializer)}}class Ro{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>fo(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=ko.bind(null,this.syncEngine),await Oi(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new Hi}createDatastore(e){const t=Xa(e.databaseInfo.databaseId),n=function(e){return new Qa(e)}(e.databaseInfo);return function(e,t,n,r){return new ai(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return function(e,t,n,r,s){return new li(e,t,n,r,s)}(this.localStore,this.datastore,e.asyncQueue,e=>fo(this.syncEngine,e,0),Ba.C()?new Ba:new Va)}createSyncEngine(e,t){return function(e,t,n,r,s,a,i){const o=new io(e,t,n,r,s,a);return i&&(o.fu=!0),o}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(e){const t=D(e);k(oi,"RemoteStore shutting down."),t.Ia.add(5),await ui(t),t.Ea.shutdown(),t.Aa.set("Unknown")}(this.remoteStore),null===(e=this.datastore)||void 0===e||e.terminate(),null===(t=this.eventManager)||void 0===t||t.terminate()}}Ro.provider={build:()=>new Ro};class Do{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.xu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.xu(this.observer.error,e):_("Uncaught Error in snapshot listener:",e.toString()))}Ou(){this.muted=!0}
2xu(e,t){setTimeout(()=>{this.muted||e(t)},0)}}const Oo="FirestoreClient";class Lo{constructor(e,t,n,r,s){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=j.UNAUTHENTICATED,this.clientId=J.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=s,this.authCredentials.start(n,async e=>{k(Oo,"Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(k(Oo,"Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new M;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=Ui(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function Mo(e,t){e.asyncQueue.verifyOperationInProgress(),k(Oo,"Initializing OfflineComponentProvider");const n=e.configuration;await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await Ta(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>{A("Terminating Firestore due to IndexedDb database deletion"),e.terminate().then(()=>{k("Terminating Firestore due to IndexedDb database deletion completed successfully")}).catch(e=>{A("Terminating Firestore due to IndexedDb database deletion failed",e)})}),e._offlineComponents=t}async function Fo(e,t){e.asyncQueue.verifyOperationInProgress();const n=await Uo(e);k(Oo,"Initializing OnlineComponentProvider"),await t.initialize(n,e.configuration),e.setCredentialChangeListener(e=>Di(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>Di(t.remoteStore,n)),e._onlineComponents=t}async function Uo(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){k(Oo,"Using user provided OfflineComponentProvider");try{await Mo(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!function(e){return"FirebaseError"===e.name?e.code===O.FAILED_PRECONDITION||e.code===O.UNIMPLEMENTED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}(n))throw n;A("Error using user provided cache. Falling back to memory cache: "+n),await Mo(e,new Io)}}else k(Oo,"Using default OfflineComponentProvider"),await Mo(e,new Po(void 0));return e._offlineComponents}async function Vo(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(k(Oo,"Using user provided OnlineComponentProvider"),await Fo(e,e._uninitializedComponentsProvider._online)):(k(Oo,"Using default OnlineComponentProvider"),await Fo(e,new Ro))),e._onlineComponents}function zo(e){return Vo(e).then(e=>e.syncEngine)}async function Bo(e){const t=await Vo(e),n=t.eventManager;return n.onListen=oo.bind(null,t.syncEngine),n.onUnlisten=ho.bind(null,t.syncEngine),n.onFirstRemoteStoreListen=lo.bind(null,t.syncEngine),n.onLastRemoteStoreUnlisten=mo.bind(null,t.syncEngine),n}function qo(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new M;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,s){const a=new Do({next:o=>{a.Ou(),t.enqueueAndForget(()=>Ki(e,i));const l=o.docs.has(n);!l&&o.fromCache?s.reject(new L(O.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&o.fromCache&&r&&"server"===r.source?s.reject(new L(O.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):s.resolve(o)},error:e=>s.reject(e)}),i=new Zi(Ln(n.path),a,{includeMetadataChanges:!0,ka:!0});return Gi(e,i)}(await Bo(e),e.asyncQueue,t,n,r)),r.promise}function Ho(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=new M;return e.asyncQueue.enqueueAndForget(async()=>
2function(e,t,n,r,s){const a=new Do({next:n=>{a.Ou(),t.enqueueAndForget(()=>Ki(e,i)),n.fromCache&&"server"===r.source?s.reject(new L(O.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):s.resolve(n)},error:e=>s.reject(e)}),i=new Zi(n,a,{includeMetadataChanges:!0,ka:!0});return Gi(e,i)}(await Bo(e),e.asyncQueue,t,n,r)),r.promise}function Wo(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const Go=new Map,Ko="firestore.googleapis.com",Jo=!0;class Yo{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new L(O.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Ko,this.ssl=Jo}else this.host=e.host,this.ssl=null!==(t=e.ssl)&&void 0!==t?t:Jo;if(this.isUsingEmulator=void 0!==e.emulatorOptions,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=$s;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<ta)throw new L(O.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}(function(e,t,n,r){if(!0===t&&!0===r)throw new L(O.INVALID_ARGUMENT,"".concat(e," and ").concat(n," cannot be used together."))})("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Wo(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new L(O.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (must not be NaN)"));if(e.timeoutSeconds<5)throw new L(O.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (minimum allowed value is 5)"));if(e.timeoutSeconds>30)throw new L(O.INVALID_ARGUMENT,"invalid long polling timeout: ".concat(e.timeoutSeconds," (maximum allowed value is 30)"))}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(e,t){return e.timeoutSeconds===t.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Qo{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Yo({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new L(O.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return"notTerminated"!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new L(O.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new Yo(e),this._emulatorOptions=e.emulatorOptions||{},void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new U;switch(e.type){case"firstParty":return new q(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new L(O.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2d credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return"notTerminated"===this._terminateTask&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){"notTerminated"===this._terminateTask?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=Go.get(e);t&&(k("ComponentProvider","Removing Datastore"),Go.delete(e),t.terminate())}(this),Promise.resolve()}}class $o{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new $o(this.firestore,e,this._query)}}class Xo{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Zo(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Xo(this.firestore,e,this._key)}toJSON(){return{type:Xo._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,n){if(pe(t,Xo._jsonSchema))return new Xo(e,n||null,new ae(ne.fromString(t.referencePath)))}}Xo._jsonSchemaVersion="firestore/documentReference/1.0",Xo._jsonSchema={type:me("string",Xo._jsonSchemaVersion),referencePath:me("string")};class Zo extends $o{constructor(e,t,n){super(e,t,Ln(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Xo(this.firestore,null,new ae(e))}withConverter(e){return new Zo(this.firestore,e,this._path)}}function el(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];if(e=(0,l.Ku)(e),ie("collection","path",t),e instanceof Qo){const n=ne.fromString(t,...r);return le(n),new Zo(e,null,n)}{if(!(e instanceof Xo||e instanceof Zo))throw new L(O.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=e._path.child(ne.fromString(t,...r));return le(n),new Zo(e.firestore,null,n)}}function tl(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];if(e=(0,l.Ku)(e),1===arguments.length&&(t=J.newId()),ie("doc","path",t),e instanceof Qo){const n=ne.fromString(t,...r);return oe(n),new Xo(e,null,new ae(n))}{if(!(e instanceof Xo||e instanceof Zo))throw new L(O.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=e._path.child(ne.fromString(t,...r));return oe(n),new Xo(e.firestore,e instanceof Zo?e.converter:null,new ae(n))}}const nl="AsyncQueue";class rl{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Promise.resolve();this.Zu=[],this.Xu=!1,this.ec=[],this.tc=null,this.nc=!1,this.rc=!1,this.sc=[],this.F_=new Za(this,"async_queue_retry"),this.oc=()=>{const e=$a();e&&k(nl,"Visibility state changed to "+e.visibilityState),this.F_.y_()},this._c=e;const t=$a();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.oc)}get isShuttingDown(){return this.Xu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.ac(),this.uc(e)}enterRestrictedMode(e){if(!this.Xu){this.Xu=!0,this.rc=e||!1;const t=$a();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.oc)}}enqueue(e){if(this.ac(),this.Xu)return new Promise(()=>{});const t=new M;return this.uc(()=>this.Xu&&this.rc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Zu.push(e),this.cc()))}async cc(){if(0!==this.Zu.length){try{await this.Zu[0](),this.Zu.shift(),this.F_.reset()}catch(e){if(!Te(e))throw e;k(nl,"Operation failed with retryable error: "+e)}this.Zu.length>0&&this.F_.g_(()=>this.cc())}}uc(e){const t=this._c.then(()=>(this.nc=!0,e().catch(e=>{throw this.tc=e,this.nc=!1,_("INTERNAL UNHANDLED ERROR: ",sl(e)),e}).then(e=>(this.nc=!1,e))));return this._c=t,t}enqueueAfterDelay(e,t,n){this.ac(),this.sc.indexOf(e)>-1&&(t=0);const r=Fi.createAndSchedule(this,e,t,n,e=>this.lc(e));return this.ec.push(r),r}ac(){this.tc&&I(47125,{hc:sl(this.tc)})}verifyOperationInProgress(){}async Pc(){let e;do{e=this._c,await e}while(e!==this._c)}Tc(e){for(const t of this.ec)if(t.timerId===e)return!0;return!1}Ic(e){return this.Pc().then(()=>{this.ec.sort((e,t)=>
2e.targetTimeMs-t.targetTimeMs);for(const t of this.ec)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.Pc()})}dc(e){this.sc.push(e)}lc(e){const t=this.ec.indexOf(e);this.ec.splice(t,1)}}function sl(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}function al(e){return function(e,t){if("object"!=typeof e||null===e)return!1;const n=e;for(const r of t)if(r in n&&"function"==typeof n[r])return!0;return!1}(e,["next","error","complete"])}class il extends Qo{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new rl,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new rl(e),this._firestoreClient=void 0,await e}}}function ol(e,t){const n="object"==typeof e?e:(0,a.Sx)(),r="string"==typeof e?e:t||Pt,s=(0,a.j6)(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const e=(0,l.yU)("firestore");e&&function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};var s;e=de(e,Qo);const a=(0,l.zJ)(t),i=e._getSettings(),o=Object.assign(Object.assign({},i),{emulatorOptions:e._getEmulatorOptions()}),c="".concat(t,":").concat(n);a&&((0,l.gE)("https://".concat(c)),(0,l.P1)("Firestore",!0)),i.host!==Ko&&i.host!==c&&A("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u=Object.assign(Object.assign({},i),{host:c,ssl:a,emulatorOptions:r});if(!(0,l.bD)(u,o)&&(e._setSettings(u),r.mockUserToken)){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=j.MOCK_USER;else{t=(0,l.Fy)(r.mockUserToken,null===(s=e._app)||void 0===s?void 0:s.options.projectId);const a=r.mockUserToken.sub||r.mockUserToken.user_id;if(!a)throw new L(O.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new j(a)}e._authCredentials=new V(new F(t,n))}}(s,...e)}return s}function ll(e){if(e._terminated)throw new L(O.FAILED_PRECONDITION,"The client has already been terminated.");return e._firestoreClient||cl(e),e._firestoreClient}function cl(e){var t,n,r;const s=e._freezeSettings(),a=function(e,t,n,r){return new It(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,Wo(r.experimentalLongPollingOptions),r.useFetchStreams,r.isUsingEmulator)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,s);e._componentsProvider||(null===(n=s.localCache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=s.localCache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),e._firestoreClient=new Lo(e._authCredentials,e._appCheckCredentials,e._queue,a,e._componentsProvider&&function(e){const t=null==e?void 0:e._online.build();return{_offline:null==e?void 0:e._offline.build(t),_online:t}}(e._componentsProvider))}class ul{constructor(e){this._byteString=e}static fromBase64String(e){try{return new ul(bt.fromBase64String(e))}catch(e){throw new L(O.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new ul(bt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:ul._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(pe(e,ul._jsonSchema))return ul.fromBase64String(e.bytes)}}ul._jsonSchemaVersion="firestore/bytes/1.0",ul._jsonSchema={type:me("string",ul._jsonSchemaVersion),bytes:me("string")};class dl{constructor(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(let r=0;r<t.length;++r)if(0===t[r].length)throw new L(O.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new se(t)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class hl{constructor(e){this._methodName=e}}class ml{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new L(O.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new L(O.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Y(this._lat,e._lat)||Y(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:ml._jsonSchemaVersion}}static fromJSON(e){if(pe(e,ml._jsonSchema))return new ml(e.latitude,e.longitude)}}ml._jsonSchemaVersion="firestore/geoPoint/1.0",ml._jsonSchema={type:me("string",ml._jsonSchemaVersion),latitude:me("number"),longitude:me("number")};class pl{constructor(e){this._values=(e||[]).map(e=>e)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(e[n]!==t[n])return!1;return!0}(this._values,e._values)}toJSON(){return{type:pl._jsonSchemaVersion,vectorValues:this._values}}
2static fromJSON(e){if(pe(e,pl._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every(e=>"number"==typeof e))return new pl(e.vectorValues);throw new L(O.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}pl._jsonSchemaVersion="firestore/vectorValue/1.0",pl._jsonSchema={type:me("string",pl._jsonSchemaVersion),vectorValues:me("object")};const fl=/^__.*__$/;class gl{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new Mr(e,this.data,this.fieldMask,t,this.fieldTransforms):new Lr(e,this.data,t,this.fieldTransforms)}}class vl{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new Mr(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function yl(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw I(40011,{Ec:e})}}class bl{constructor(e,t,n,r,s,a){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===s&&this.Ac(),this.fieldTransforms=s||[],this.fieldMask=a||[]}get path(){return this.settings.path}get Ec(){return this.settings.Ec}Rc(e){return new bl(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Vc(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Rc({path:n,mc:!1});return r.fc(e),r}gc(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.Rc({path:n,mc:!1});return r.Ac(),r}yc(e){return this.Rc({path:void 0,mc:!0})}wc(e){return Ll(e,this.settings.methodName,this.settings.Sc||!1,this.path,this.settings.bc)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}Ac(){if(this.path)for(let e=0;e<this.path.length;e++)this.fc(this.path.get(e))}fc(e){if(0===e.length)throw this.wc("Document fields must not be empty");if(yl(this.Ec)&&fl.test(e))throw this.wc('Document fields cannot begin and end with "__"')}}class xl{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||Xa(e)}Dc(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new bl({Ec:e,methodName:t,bc:n,path:se.emptyPath(),mc:!1,Sc:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function wl(e){const t=e._freezeSettings(),n=Xa(e._databaseId);return new xl(e._databaseId,!!t.ignoreUndefinedProperties,n)}function Nl(e,t,n,r,s){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const i=e.Dc(a.merge||a.mergeFields?2:0,t,n,s);Pl("Data must be an object, but it was:",i,r);const o=Tl(r,i);let l,c;if(a.merge)l=new vt(i.fieldMask),c=i.fieldTransforms;else if(a.mergeFields){const e=[];for(const r of a.mergeFields){const s=Rl(t,r,n);if(!i.contains(s))throw new L(O.INVALID_ARGUMENT,"Field '".concat(s,"' is specified in your field mask but missing from your input data."));Ml(e,s)||e.push(s)}l=new vt(e),c=i.fieldTransforms.filter(e=>l.covers(e.field))}else l=null,c=i.fieldTransforms;return new gl(new rn(o),l,c)}class jl extends hl{_toFieldTransform(e){if(2!==e.Ec)throw 1===e.Ec?e.wc("".concat(this._methodName,"() can only appear at the top level of your update data")):e.wc("".concat(this._methodName,"() cannot be used with set() unless you pass {merge:true}"));return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof jl}}class El extends hl{_toFieldTransform(e){return new Cr(e.path,new yr)}isEqual(e){return e instanceof El}}class Sl extends hl{constructor(e,t){super(e),this.Cc=t}_toFieldTransform(e){const t=new jr(e.serializer,mr(e.serializer,this.Cc));return new Cr(e.path,t)}isEqual(e){return e instanceof Sl&&this.Cc===e.Cc}}function Cl(e,t,n,r){const s=e.Dc(1,t,n);Pl("Data must be an object, but it was:",s,r);const a=[],i=rn.empty();ut(r,(e,r)=>{const o=Ol(t,e,n);r=(0,l.Ku)(r);const c=s.gc(o);if(r instanceof jl)a.push(o);else{const e=Al(r,c);null!=e&&(a.push(o),i.set(o,e))}});const o=new vt(a);return new vl(i,o,s.fieldTransforms)}function kl(e,t,n,r,s,a){const i=e.Dc(1,t,n),o=[Rl(t,r,n)],c=[s];if(a.length%2!=0)throw new L(O.INVALID_ARGUMENT,"Function ".concat(t,"() needs to be called with an even number of arguments that alternate between field names and values."));for(let l=0;l<a.length;l+=2)o.push(Rl(t,a[l])),c.push(a[l+1]);const u=[],d=rn.empty();for(let m=o.length-1;m>=0;--m)if(!Ml(u,o[m])){const e=o[m];let t=c[m];t=(0,l.Ku)(t);const n=i.gc(e);if(t instanceof jl)u.push(e);else{const r=Al(t,n);null!=r&&(u.push(e),d.set(e,r))}}const h=new vt(u);return new vl(d,h,i.fieldTransforms)}function _l(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return Al(n,e.Dc(r?4:3,t))}function Al(e,t){if(Il(e=(0,l.Ku)(e)))return Pl("Unsupported field value:",t,e),Tl(e,t);if(e instanceof hl)return function(e,t){if(!yl(t.Ec))throw t.wc("".concat(e._methodName,"() can only be used with update(
2) and set()"));if(!t.path)throw t.wc("".concat(e._methodName,"() is not currently supported inside arrays"));const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.mc&&4!==t.Ec)throw t.wc("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const s of e){let e=Al(s,t.yc(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,l.Ku)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return mr(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=ve.fromDate(e);return{timestampValue:vs(t.serializer,n)}}if(e instanceof ve){const n=new ve(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:vs(t.serializer,n)}}if(e instanceof ml)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof ul)return{bytesValue:ys(t.serializer,e._byteString)};if(e instanceof Xo){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t.wc("Document reference is for database ".concat(r.projectId,"/").concat(r.database," but should be for database ").concat(n.projectId,"/").concat(n.database));return{referenceValue:ws(e.firestore._databaseId||t.databaseId,e._key.path)}}if(e instanceof pl)return function(e,t){return{mapValue:{fields:{[Dt]:{stringValue:Mt},[Ft]:{arrayValue:{values:e.toArray().map(e=>{if("number"!=typeof e)throw t.wc("VectorValues must only contain numeric values.");return dr(t.serializer,e)})}}}}}}(e,t);throw t.wc("Unsupported field value: ".concat(ue(e)))}(e,t)}function Tl(e,t){const n={};return dt(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ut(e,(e,r)=>{const s=Al(r,t.Vc(e));null!=s&&(n[e]=s)}),{mapValue:{fields:n}}}function Il(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof ve||e instanceof ml||e instanceof ul||e instanceof Xo||e instanceof hl||e instanceof pl)}function Pl(e,t,n){if(!Il(n)||!ce(n)){const r=ue(n);throw"an object"===r?t.wc(e+" a custom object"):t.wc(e+" "+r)}}function Rl(e,t,n){if((t=(0,l.Ku)(t))instanceof dl)return t._internalPath;if("string"==typeof t)return Ol(e,t);throw Ll("Field path arguments must be of type string or ",e,!1,void 0,n)}const Dl=new RegExp("[~\\*/\\[\\]]");function Ol(e,t,n){if(t.search(Dl)>=0)throw Ll("Invalid field path (".concat(t,"). Paths must not contain '~', '*', '/', '[', or ']'"),e,!1,void 0,n);try{return new dl(...t.split("."))._internalPath}catch(r){throw Ll("Invalid field path (".concat(t,"). Paths must not be empty, begin with '.', end with '.', or contain '..'"),e,!1,void 0,n)}}function Ll(e,t,n,r,s){const a=r&&!r.isEmpty(),i=void 0!==s;let o="Function ".concat(t,"() called with invalid data");n&&(o+=" (via `toFirestore()`)"),o+=". ";let l="";return(a||i)&&(l+=" (found",a&&(l+=" in field ".concat(r)),i&&(l+=" in document ".concat(s)),l+=")"),new L(O.INVALID_ARGUMENT,o+e+l)}function Ml(e,t){return e.some(e=>e.isEqual(t))}class Fl{constructor(e,t,n,r,s){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=s}get id(){return this._key.path.lastSegment()}get ref(){return new Xo(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new Ul(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Vl("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class Ul extends Fl{data(){return super.data()}}function Vl(e,t){return"string"==typeof t?Ol(e,t):t instanceof dl?t._internalPath:t._delegate._internalPath}function zl(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new L(O.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Bl{}class ql extends Bl{}function Hl(e,t){let n=[];for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];t instanceof Bl&&n.push(t),n=n.concat(s),function(e){const t=e.filter(e=>e instanceof Kl).length,n=e.filter(e=>e instanceof Wl).length;if(t>1||t>0&&n>0)throw new L(O.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(n);for(const i of n)e=i._apply(e);return e}class Wl extends ql{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Wl(e,t,n)}_apply(e){const t=this._parse(e);return ac(e._query,t),new $o(e.firestore,e.converter,Bn(e._query,t))}_parse(e){const t=wl(e.firestore),n=function(e,t,n,r,s,a,i){let o;
2if(s.isKeyField()){if("array-contains"===a||"array-contains-any"===a)throw new L(O.INVALID_ARGUMENT,"Invalid Query. You can't perform '".concat(a,"' queries on documentId()."));if("in"===a||"not-in"===a){sc(i,a);const t=[];for(const n of i)t.push(rc(r,e,n));o={arrayValue:{values:t}}}else o=rc(r,e,i)}else"in"!==a&&"not-in"!==a&&"array-contains-any"!==a||sc(i,a),o=_l(n,t,i,"in"===a||"not-in"===a);return mn.create(s,a,o)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value);return n}}function Gl(e,t,n){const r=t,s=Vl("where",e);return Wl._create(s,r,n)}class Kl extends Bl{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Kl(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:pn.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const s of r)ac(n,s),n=Bn(n,s)}(e._query,t),new $o(e.firestore,e.converter,Bn(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class Jl extends ql{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Jl(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new L(O.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new L(O.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new un(t,n)}(e._query,this._field,this._direction);return new $o(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new Dn(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function Yl(e){const t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc",n=Vl("orderBy",e);return Jl._create(n,t)}class Ql extends ql{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new Ql(e,t,n)}_apply(e){return new $o(e.firestore,e.converter,qn(e._query,this._limit,this._limitType))}}function $l(e){return he("limit",e),Ql._create("limit",e,"F")}class Xl extends ql{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new Xl(e,t,n)}_apply(e){const t=nc(e,this.type,this._docOrFields,this._inclusive);return new $o(e.firestore,e.converter,function(e,t){return new Dn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))}}function Zl(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Xl._create("startAt",t,!0)}class ec extends ql{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new ec(e,t,n)}_apply(e){const t=nc(e,this.type,this._docOrFields,this._inclusive);return new $o(e.firestore,e.converter,function(e,t){return new Dn(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))}}function tc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return ec._create("endAt",t,!0)}function nc(e,t,n,r){if(n[0]=(0,l.Ku)(n[0]),n[0]instanceof Fl)return function(e,t,n,r,s){if(!r)throw new L(O.NOT_FOUND,"Can't use a DocumentSnapshot that doesn't exist for ".concat(n,"()."));const a=[];for(const i of Un(e))if(i.field.isKeyField())a.push(Jt(t,r.key));else{const e=r.data.field(i.field);if(_t(e))throw new L(O.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+i.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){const e=i.field.canonicalString();throw new L(O.INVALID_ARGUMENT,"Invalid query. You are trying to start or end a query using a document for which the field '".concat(e,"' (used as the orderBy) does not exist."))}a.push(e)}return new on(a,s)}(e._query,e.firestore._databaseId,t,n[0]._document,r);{const s=wl(e.firestore);return function(e,t,n,r,s,a){const i=e.explicitOrderBy;if(s.length>i.length)throw new L(O.INVALID_ARGUMENT,"Too many arguments provided to ".concat(r,"(). The number of arguments must be less than or equal to the number of orderBy() clauses"));const o=[];for(let l=0;l<s.length;l++){const a=s[l];
2if(i[l].field.isKeyField()){if("string"!=typeof a)throw new L(O.INVALID_ARGUMENT,"Invalid query. Expected a string for document ID in ".concat(r,"(), but got a ").concat(typeof a));if(!Fn(e)&&-1!==a.indexOf("/"))throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying a collection and ordering by documentId(), the value passed to ".concat(r,"() must be a plain document ID, but '").concat(a,"' contains a slash."));const n=e.path.child(ne.fromString(a));if(!ae.isDocumentKey(n))throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying a collection group and ordering by documentId(), the value passed to ".concat(r,"() must result in a valid document path, but '").concat(n,"' is not because it contains an odd number of segments."));const s=new ae(n);o.push(Jt(t,s))}else{const e=_l(n,r,a);o.push(e)}}return new on(o,a)}(e._query,e.firestore._databaseId,s,t,n,r)}}function rc(e,t,n){if("string"==typeof(n=(0,l.Ku)(n))){if(""===n)throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!Fn(t)&&-1!==n.indexOf("/"))throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '".concat(n,"' contains a '/' character."));const r=t.path.child(ne.fromString(n));if(!ae.isDocumentKey(r))throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '".concat(r,"' is not because it has an odd number of segments (").concat(r.length,")."));return Jt(e,new ae(r))}if(n instanceof Xo)return Jt(e,n._key);throw new L(O.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ".concat(ue(n),"."))}function sc(e,t){if(!Array.isArray(e)||0===e.length)throw new L(O.INVALID_ARGUMENT,"Invalid Query. A non-empty array is required for '".concat(t.toString(),"' filters."))}function ac(e,t){const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new L(O.INVALID_ARGUMENT,"Invalid query. You cannot use more than one '".concat(t.op.toString(),"' filter.")):new L(O.INVALID_ARGUMENT,"Invalid query. You cannot use '".concat(t.op.toString(),"' filters with '").concat(n.toString(),"' filters."))}class ic{convertValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";switch(Ut(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Nt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(jt(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw I(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none";const n={};return ut(e,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertVectorValue(e){var t,n,r;const s=null===(r=null===(n=null===(t=e.fields)||void 0===t?void 0:t[Ft].arrayValue)||void 0===n?void 0:n.values)||void 0===r?void 0:r.map(e=>Nt(e.doubleValue));return new pl(s)}convertGeoPoint(e){return new ml(Nt(e.latitude),Nt(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const n=At(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(Tt(e));default:return null}}convertTimestamp(e){const t=wt(e);return new ve(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=ne.fromString(e);R(qs(n),9688,{name:e});const r=new Rt(n.get(1),n.get(3)),s=new ae(n.popFirst(5));return r.isEqual(t)||_("Document ".concat(s," contains a document reference within a different database (").concat(r.projectId,"/").concat(r.database,") which is not supported. It will be treated as a reference in the current database (").concat(t.projectId,"/").concat(t.database,") instead.")),s}}function oc(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class lc{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class cc extends Fl{constructor(e,t,n,r,s,a){super(e,t,n,r,a),this._firestore=e,this._firestoreImpl=e,this.metadata=s}exists(){return super.exists()}data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._document){if(this._converter){const t=new uc(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this._document){const n=this._document.data.field(Vl("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new L(O.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=cc._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),e&&e.isValidDocument()&&e.isFoundDocument()?(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t):t}}cc._jsonSchemaVersion="firestore/documentSnapshot/1.0",cc._jsonSchema={type:me("string",cc._jsonSchemaVersion),bundleSource:me("string","DocumentSnapshot"),bundleName:me("string"),bundle:me("string")};class uc extends cc{data(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return super.data(e)}}class dc{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new lc(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new uc(this._firestore,this._userDataWriter,n.key,n,new lc(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}
2docChanges(){const e=!!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new L(O.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const r=new uc(e._firestore,e._userDataWriter,n.doc.key,n.doc,new lc(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const r=new uc(e._firestore,e._userDataWriter,t.doc.key,t.doc,new lc(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let s=-1,a=-1;return 0!==t.type&&(s=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),a=n.indexOf(t.doc.key)),{type:hc(t.type),doc:r,oldIndex:s,newIndex:a}})}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new L(O.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=dc._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=J.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],n=[],r=[];return this.docs.forEach(e=>{null!==e._document&&(t.push(e._document),n.push(this._userDataWriter.convertObjectMap(e._document.data.value.mapValue.fields,"previous")),r.push(e.ref.path))}),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function hc(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return I(61501,{type:e})}}function mc(e){e=de(e,Xo);const t=de(e.firestore,il);return qo(ll(t),e._key).then(n=>Nc(t,e,n))}dc._jsonSchemaVersion="firestore/querySnapshot/1.0",dc._jsonSchema={type:me("string",dc._jsonSchemaVersion),bundleSource:me("string","QuerySnapshot"),bundleName:me("string"),bundle:me("string")};class pc extends ic{constructor(e){super(),this.firestore=e}convertBytes(e){return new ul(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Xo(this.firestore,null,t)}}function fc(e){e=de(e,$o);const t=de(e.firestore,il),n=ll(t),r=new pc(t);return zl(e._query),Ho(n,e._query).then(n=>new dc(t,r,e,n))}function gc(e,t,n){e=de(e,Xo);const r=de(e.firestore,il),s=oc(e.converter,t,n);return wc(r,[Nl(wl(r),"setDoc",e._key,s,null!==e.converter,n).toMutation(e._key,_r.none())])}function vc(e,t,n){e=de(e,Xo);const r=de(e.firestore,il),s=wl(r);let a;for(var i=arguments.length,o=new Array(i>3?i-3:0),c=3;c<i;c++)o[c-3]=arguments[c];return a="string"==typeof(t=(0,l.Ku)(t))||t instanceof dl?kl(s,"updateDoc",e._key,t,n,o):Cl(s,"updateDoc",e._key,t),wc(r,[a.toMutation(e._key,_r.exists(!0))])}function yc(e){return wc(de(e.firestore,il),[new zr(e._key,_r.none())])}function bc(e,t){const n=de(e.firestore,il),r=tl(e),s=oc(e.converter,t);return wc(n,[Nl(wl(e.firestore),"addDoc",r._key,s,null!==e.converter,{}).toMutation(r._key,_r.exists(!1))]).then(()=>r)}function xc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s,a,i;e=(0,l.Ku)(e);let o={includeMetadataChanges:!1,source:"default"},c=0;"object"!=typeof n[c]||al(n[c])||(o=n[c++]);const u={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(al(n[c])){const e=n[c];n[c]=null===(s=e.next)||void 0===s?void 0:s.bind(e),n[c+1]=null===(a=e.error)||void 0===a?void 0:a.bind(e),n[c+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let d,h,m;if(e instanceof Xo)h=de(e.firestore,il),m=Ln(e._key.path),d={next:t=>{n[c]&&n[c](Nc(h,e,t))},error:n[c+1],complete:n[c+2]};else{const t=de(e,$o);h=de(t.firestore,il),m=t._query;const r=new pc(h);d={next:e=>{n[c]&&n[c](new dc(h,r,t,e))},error:n[c+1],complete:n[c+2]},zl(e._query)}return function(e,t,n,r){const s=new Do(r),a=new Zi(t,s,n);return e.asyncQueue.enqueueAndForget(async()=>Gi(await Bo(e),a)),()=>{s.Ou(),e.asyncQueue.enqueueAndForget(async()=>Ki(await Bo(e),a))}}(ll(h),m,u,d)}function wc(e,t){return function(e,t){const n=new M;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){const r=To(e);try{const e=await function(e,t){const n=D(e),r=ve.now(),s=t.reduce((e,t)=>
2e.add(t.key),lr());let a,i;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let o=Zn(),l=lr();return n.Os.getEntries(e,s).next(e=>{o=e,o.forEach((e,t)=>{t.isValidDocument()||(l=l.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,o)).next(s=>{a=s;const i=[];for(const e of t){const t=Dr(e,a.get(e.key).overlayedDocument);null!=t&&i.push(new Mr(e.key,t,sn(t.value.mapValue),_r.exists(!0)))}return n.mutationQueue.addMutationBatch(e,r,i,t)}).next(t=>{i=t;const r=t.applyToLocalDocumentSet(a,l);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)})}).then(()=>({batchId:i.batchId,changes:nr(a)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.Ru[e.currentUser.toKey()];r||(r=new ht(Y)),r=r.insert(t,n),e.Ru[e.currentUser.toKey()]=r}(r,e.batchId,n),await Co(r,e.changes),await Si(r.remoteStore)}catch(e){const t=Ui(e,"Failed to persist write");n.reject(t)}}(await zo(e),t,n)),n.promise}(ll(e),t)}function Nc(e,t,n){const r=n.docs.get(t._key),s=new pc(e);return new cc(e,s,t._key,r,new lc(n.hasPendingWrites,n.fromCache),t.converter)}class jc{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=wl(e)}set(e,t,n){this._verifyNotCommitted();const r=Ec(e,this._firestore),s=oc(r.converter,t,n),a=Nl(this._dataReader,"WriteBatch.set",r._key,s,null!==r.converter,n);return this._mutations.push(a.toMutation(r._key,_r.none())),this}update(e,t,n){this._verifyNotCommitted();const r=Ec(e,this._firestore);let s;for(var a=arguments.length,i=new Array(a>3?a-3:0),o=3;o<a;o++)i[o-3]=arguments[o];return s="string"==typeof(t=(0,l.Ku)(t))||t instanceof dl?kl(this._dataReader,"WriteBatch.update",r._key,t,n,i):Cl(this._dataReader,"WriteBatch.update",r._key,t),this._mutations.push(s.toMutation(r._key,_r.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=Ec(e,this._firestore);return this._mutations=this._mutations.concat(new zr(t._key,_r.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new L(O.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Ec(e,t){if((e=(0,l.Ku)(e)).firestore!==t)throw new L(O.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}function Sc(){return new El("serverTimestamp")}function Cc(e){return new Sl("increment",e)}function kc(e){return ll(e=de(e,il)),new jc(e,t=>wc(e,t))}new WeakMap;!function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];!function(e){E=e}(a.MF),(0,a.om)(new i.uA("firestore",(e,n)=>{let{instanceIdentifier:r,options:s}=n;const a=e.getProvider("app").getImmediate(),i=new il(new z(e.getProvider("auth-internal")),new W(a,e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new L(O.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Rt(e.options.projectId,t)}(a,r),a);return s=Object.assign({useFetchStreams:t},s),i._setSettings(s),i},"PUBLIC").setMultipleInstances(!0)),(0,a.KO)(w,N,e),(0,a.KO)(w,N,"esm2017")}()},5491:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{BG:()=>o,BZ:()=>c,N_:()=>h,VQ:()=>x,Wq:()=>b,YR:()=>f,eN:()=>N,hJ:()=>d,hT:()=>g,kU:()=>p,kw:()=>w,lk:()=>u,pU:()=>l,rU:()=>y,up:()=>m,vE:()=>v});var s=n(7324);let e=null,a=null;const i=3e5,o=async()=>{const t=Date.now();if(e&&a&&t-a<i)return e;try{const n=await(0,s.OM)();return e=n,a=t,n}catch(n){return console.error("Error fetching courses:",n),e||[]}},l=await o().catch(()=>[]),c=async e=>(await o()).find(t=>t.id===e)||null,u=e=>!0===(null===e||void 0===e?void 0:e.comingSoon),d=async e=>{try{const t=await(0,s.getCourseBatches)(e);if(!t||0===t.length)return null;return t.find(e=>"active"===e.status||"upcoming"===e.status)||t[t.length-1]}catch(t){return console.error("Error getting next available batch:",t),null}},h=async(e,t)=>{try{return(await(0,s.getCourseBatches)(e)).find(e=>e.batchNumber===t)||null}catch(n){return console.error("Error getting batch by number:",n),null}},m=e=>e?"Batch ".concat(e.batchNumber,": ").concat(e.batchName||""):"Unknown Batch",p=e=>e?e.batchName||"Batch ".concat(e.batchNumber):"N/A",f=e=>({upcoming:"Upcoming",active:"Active",completed:"Completed",cancelled:"Cancelled"}[e]||e),g=e=>{if(!e||!e.startDate)return"Dates TBD";const t=new Date(e.startDate).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});if(!e.endDate)return t;const n=new Date(e.endDate).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return"".concat(t," - ").concat(n)},v=async e=>{try{return(await(0,s.getCourseBatches)(e)).filter(e=>"upcoming"===e.status)}catch(t){return console.error("Error getting upcoming batches:",t),[]}},y=async e=>{try{return(await(0,s.getCourseBatches)(e)).filter(e=>"active"===e.status)}catch(t){return console.error("Error getting active batches:",t),[]}},b=async e=>{try{const t=await(0,s.getCourseBatches)(e),n=t.find(e=>"active"===e.status);return n||(t[t.length-1]||null)}catch(t){return console.error("Error getting current batch:",t),null}},x=e=>{if(!e||!e.classLinks)return[];const t=[];return e.classLinks.zoom&&t.push({type:"zoom",label:"Zoom Meeting",url:e.classLinks.zoom,icon:"\ud83d\udcf9"}),e.classLinks.discord&&t.push({type:"discord",label:"Discord Server",url:e.classLinks.discord,icon:"\ud83d\udcac"}),t},w=e=>e&&e.schedule&&e.schedule.length>0,N=e=>!(!e||!e.classLinks)&&!(!e.classLinks.zoom&&!e.classLinks.discord);r()}catch(a){r(a)}},1)},5511:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{x:()=>c});var s=n(5043),a=n(342),i=n(7096),o=n(6982),l=e([i,o]);[i,o]=l.then?(await l)():l;const c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{user:n}
2=(0,a.A)(),[r,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(null),[d,h]=(0,s.useState)([]),[m,p]=(0,s.useState)([]),[f,g]=(0,s.useState)(null),[v,y]=(0,s.useState)(!1),[b,x]=(0,s.useState)(null),w=(0,s.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!n||!e)return l(!1),u(null),!1;y(!0),x(null);try{const r=await(0,i.WA)(n.uid,e,t);return r.error?(x(r.error),l(!1),u(null),!1):(l(r.hasAccess),u(r.enrollment),r.hasAccess)}catch(r){return x(r.message),l(!1),u(null),!1}finally{y(!1)}},[n]),N=(0,s.useCallback)(async()=>{if(n){y(!0),x(null);try{const e=await(0,i.dg)(n.uid);e.success?h(e.enrollments):(x(e.error),h([]))}catch(e){x(e.message),h([])}finally{y(!1)}}else h([])},[n]),j=(0,s.useCallback)(async e=>{if(n&&e)try{const t=await(0,o.ku)(n.uid,e);t.success?p(t.enrollments):(x(t.error),p([]))}catch(t){x(t.message),p([])}else p([])},[n]),E=(0,s.useCallback)(async(e,t)=>{if(n&&e&&t)try{const r=await(0,o.Go)(n.uid,e,t);r.success?g(r.classLinks):(x(r.error),g(null))}catch(r){x(r.message),g(null)}else g(null)},[n]),S=(0,s.useCallback)(async e=>{if(!n)throw new Error("User must be logged in to enroll");y(!0),x(null);try{const t=await(0,i.vv)(e,n.uid);if(!t.success)throw new Error(t.error);return await w(e.courseId,t.batchNumber),await N(),await j(e.courseId),t}catch(t){throw x(t.message),t}finally{y(!1)}},[n,w,N,j]),C=(0,s.useCallback)(async function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!n)throw new Error("User must be logged in");try{const s=await(0,i.K3)(n.uid,e,t,r);return s.success&&(await w(e,r),await N(),await j(e)),s}catch(s){throw x(s.message),s}},[n,w,N,j]),k=(0,s.useCallback)(()=>d.length>0,[d]),_=(0,s.useCallback)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return d.find(n=>n.courseId===e&&n.batchNumber===t);{const t=d.filter(t=>t.courseId===e);return t.sort((e,t)=>{var n,r,s,a;const i=(null===(n=e.enrolledAt)||void 0===n||null===(r=n.toDate)||void 0===r?void 0:r.call(n))||new Date(0);return((null===(s=t.enrolledAt)||void 0===s||null===(a=s.toDate)||void 0===a?void 0:a.call(s))||new Date(0))-i})[0]}},[d]),A=(0,s.useCallback)(e=>d.filter(t=>t.courseId===e),[d]),T=(0,s.useCallback)(e=>d.some(t=>t.courseId===e),[d]);return(0,s.useEffect)(()=>{e&&(w(e,t),j(e))},[e,t,w,j]),(0,s.useEffect)(()=>{c&&c.courseId&&c.batchNumber&&E(c.courseId,c.batchNumber)},[c,E]),(0,s.useEffect)(()=>{N()},[N]),{hasAccess:r,enrollment:c,allEnrollments:d,courseEnrollments:m,batchClassLinks:f,loading:v,error:b,checkAccess:w,loadEnrollments:N,loadCourseEnrollments:j,loadBatchClassLinks:E,processEnrollment:S,updateProgress:C,hasAnyCourseAccess:k,getEnrollmentForCourseBatch:_,getEnrollmentsForCourse:A,hasAccessToAnyCourse:T,clearError:()=>x(null)}};r()}catch(c){r(c)}})},5866:()=>{},5896:(e,t)=>{function n(e,t){var n=e.length;e.push(t);e:for(;0<n;){var r=n-1>>>1,s=e[r];if(!(0<a(s,t)))break e;e[r]=t,e[n]=s,n=r}}function r(e){return 0===e.length?null:e[0]}function s(e){if(0===e.length)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,s=e.length,i=s>>>1;r<i;){var o=2*(r+1)-1,l=e[o],c=o+1,u=e[c];if(0>a(l,n))c<s&&0>a(u,l)?(e[r]=u,e[c]=n,r=c):(e[r]=l,e[o]=n,r=o);else{if(!(c<s&&0>a(u,n)))break e;e[r]=u,e[c]=n,r=c}}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"===typeof performance&&"function"===typeof performance.now){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,m=3,p=!1,f=!1,g=!1,v=!1,y="function"===typeof setTimeout?setTimeout:null,b="function"===typeof clearTimeout?clearTimeout:null,x="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=r(u);null!==t;){if(null===t.callback)s(u);else{if(!(t.startTime<=e))break;s(u),t.sortIndex=t.expirationTime,n(c,t)}t=r(u)}}function N(e){if(g=!1,w(e),!f)if(null!==r(c))f=!0,E||(E=!0,j());else{var t=r(u);null!==t&&P(N,t.startTime-e)}}var j,E=!1,S=-1,C=5,k=-1;function _(){return!!v||!(t.unstable_now()-k<C)}function A(){if(v=!1,E){var e=t.unstable_now();k=e;var n=!0;try{e:{f=!1,g&&(g=!1,b(S),S=-1),p=!0;var a=m;try{t:{for(w(e),h=r(c);null!==h&&!(h.expirationTime>e&&_());){var i=h.callback;if("function"===typeof i){h.callback=null,m=h.priorityLevel;var o=i(h.expirationTime<=e);if(e=t.unstable_now(),"function"===typeof o){h.callback=o,w(e),n=!0;break t}h===r(c)&&s(c),w(e)}else s(c);h=r(c)}if(null!==h)n=!0;else{var l=r(u);null!==l&&P(N,l.startTime-e),n=!1}}break e}finally{h=null,m=a,p=!1}n=void 0}}finally{n?j():E=!1}}}if("function"===typeof x)j=function(){x(A)};else if("undefined"!==typeof MessageChannel){var T=new MessageChannel,I=T.port2;T.port1.onmessage=A,j=function(){I.postMessage(null)}}else j=function(){y(A,0)};function P(e,n){S=y(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):C=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(e){switch(m){case 1:case 2:case 3:var t=3;break;default:t=m}var n=m;m=t;try{return e()}finally{m=n}},t.unstable_requestPaint=function(){v=!0},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=m;m=e;try{return t()}finally{m=n}},t.unstable_scheduleCallback=function(e,s,a){var i=t.unstable_now();switch("object"===typeof a&&null!==a?a="number"===typeof(a=a.delay)&&0<a?i+a:i:a=i,e){case 1:var o=-1;break;case 2:o=250;break;case 5:o=1073741823;break;case 4:o=1e4;break;default:o=5e3}return e={id:d++,callback:s,priorityLevel:e,startTime:a,expirationTime:o=a+o,sortIndex:-1},a>i?(e.sortIndex=a,n(u,e),null===r(c)&&e===r(u)&&(g?(b(S),S=-1):g=!0,P(N,a-i))):(e.sortIndex=o,n(c,e),f||p||(f=!0,E||(E=!0,j()))),e},t.unstable_shouldYield=_,t.unstable_wrapCallback=function(e){var t=m;return function(){var n=m;m=t;try{return e.apply(this,arguments)}finally{m=n}}}},6058:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>m});var s=n(2555),a=n(5043),i=n(8185),o=n(3387),l=n(7096),c=n(8426),u=n(5472),d=(n(4987),n(579)),h=e([l]);l=(h.then?(await h)():h)[0];const m=()=>{const[e,t]=(0,a.useState)("overview"),[n,r]=(0,a.useState)([]),[h,m]=(0,a.useState)([]),[p,f]=(0,a.useState)(!1),[g,v]=(0,a.useState)(""),[y,b]=(0,a.useState)(""),[x,w]=(0,a.useState)(null),[N,j]=(0,a.useState)(""),E=(0,i.Qz)();(0,a.useEffect)(()=>{S(),C()},[]);const S=async()=>{f(!0);try{const e=(0,u.rJ)(c.db,"enrollments"),t=(0,u.P)(e,(0,u.My)("enrolledAt","desc")),n=(await(0,u.GG)(t)).docs.map(e=>{var t,n;return(0,s.A)((0,s.A)({id:e.id},e.data()),{},{enrolledAt:(null===(t=e.data().enrolledAt)||void 0===t||null===(n=t.toDate)||void 0===n?void 0:n.call(t))||new Date(e.data().enrolledAt)})});r(n)}catch(e){v("Failed to load enrollments: "+e.message)}finally{f(!1)}},C=async()=>{try{const e=await(0,o.CF)();e.success&&m(e.users)}catch(e){}},k=e=>{const t=h.find(t=>
2t.id===e);return t?t.displayName||t.email:e};return(0,d.jsxs)("div",{className:"admin-progress-manager",children:[(0,d.jsx)("h2",{children:"Progress Tracking Management"}),!E&&(0,d.jsx)("div",{className:"warning-banner",children:(0,d.jsxs)("div",{className:"warning-content",children:[(0,d.jsx)("span",{className:"warning-icon",children:"\u26a0\ufe0f"}),(0,d.jsxs)("div",{className:"warning-text",children:[(0,d.jsx)("strong",{children:"Progress Tracking System Disabled"}),(0,d.jsxs)("p",{children:["The progress tracking system is currently disabled in the environment configuration. Progress bars and tracking features will not be visible to users. To enable progress tracking, set ",(0,d.jsx)("code",{children:"REACT_APP_ENABLE_PROGRESS_TRACKING=true"})," in your .env file."]})]})]})}),g&&(0,d.jsx)("div",{className:"error-message",children:g}),y&&(0,d.jsx)("div",{className:"success-message",children:y}),(0,d.jsxs)("div",{className:"progress-tabs",children:[(0,d.jsx)("button",{onClick:()=>t("overview"),className:"tab-button ".concat("overview"===e?"active":""),children:"\ud83d\udcca Overview"}),(0,d.jsx)("button",{onClick:()=>t("manage"),className:"tab-button ".concat("manage"===e?"active":""),children:"\ud83d\udcdd Manage Progress"})]}),(0,d.jsxs)("div",{className:"progress-content",children:["overview"===e&&(()=>{const e=(()=>{const e={totalEnrollments:n.length,completedCourses:n.filter(e=>e.progress>=100).length,inProgress:n.filter(e=>e.progress>0&&e.progress<100).length,notStarted:n.filter(e=>0===(e.progress||0)).length,averageProgress:0};if(n.length>0){const t=n.reduce((e,t)=>e+(t.progress||0),0);e.averageProgress=(t/n.length).toFixed(1)}return e})();return(0,d.jsx)("div",{className:"progress-overview",children:(0,d.jsxs)("div",{className:"stats-grid",children:[(0,d.jsxs)("div",{className:"stat-card",children:[(0,d.jsx)("h4",{children:"Total Enrollments"}),(0,d.jsx)("p",{className:"stat-value",children:e.totalEnrollments})]}),(0,d.jsxs)("div",{className:"stat-card",children:[(0,d.jsx)("h4",{children:"Completed Courses"}),(0,d.jsx)("p",{className:"stat-value",children:e.completedCourses})]}),(0,d.jsxs)("div",{className:"stat-card",children:[(0,d.jsx)("h4",{children:"In Progress"}),(0,d.jsx)("p",{className:"stat-value",children:e.inProgress})]}),(0,d.jsxs)("div",{className:"stat-card",children:[(0,d.jsx)("h4",{children:"Not Started"}),(0,d.jsx)("p",{className:"stat-value",children:e.notStarted})]}),(0,d.jsxs)("div",{className:"stat-card",children:[(0,d.jsx)("h4",{children:"Average Progress"}),(0,d.jsxs)("p",{className:"stat-value",children:[e.averageProgress,"%"]})]})]})})})(),"manage"===e&&(0,d.jsxs)("div",{className:"progress-management",children:[(0,d.jsx)("h3",{children:"Manage Student Progress"}),0===n.length?(0,d.jsx)("p",{children:"No enrollments found."}):(0,d.jsx)("div",{className:"enrollments-table",children:(0,d.jsxs)("table",{children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{children:[(0,d.jsx)("th",{children:"Student"}),(0,d.jsx)("th",{children:"Course"}),(0,d.jsx)("th",{children:"Batch"}),(0,d.jsx)("th",{children:"Progress"}),(0,d.jsx)("th",{children:"Enrolled Date"}),(0,d.jsx)("th",{children:"Actions"})]})}),(0,d.jsx)("tbody",{children:n.map(e=>{return(0,d.jsxs)("tr",{children:[(0,d.jsx)("td",{children:k(e.userId)}),(0,d.jsx)("td",{children:e.courseTitle}),(0,d.jsx)("td",{children:(0,d.jsxs)("span",{className:"batch-badge batch-".concat(e.batchNumber),children:["Batch ",e.batchNumber]})}),(0,d.jsx)("td",{children:(0,d.jsxs)("div",{className:"progress-display",children:[(0,d.jsx)("div",{className:"progress-bar-small",children:(0,d.jsx)("div",{className:"progress-fill-small",style:{width:"".concat(e.progress||0,"%")}})}),(0,d.jsxs)("span",{className:"progress-text-small",children:[e.progress||0,"%"]})]})}),(0,d.jsx)("td",{children:(t=e.enrolledAt,t?t.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"N/A")}),(0,d.jsx)("td",{children:(0,d.jsx)("button",{onClick:()=>w(e),className:"btn-update-progress",title:"Update Progress",children:"\ud83d\udcdd"})})]},e.id);var t})})]})}),x&&(0,d.jsx)("div",{className:"modal-overlay",children:(0,d.jsxs)("div",{className:"progress-update-modal",children:[(0,d.jsx)("h4",{children:"Update Progress"}),(0,d.jsxs)("div",{className:"modal-content",children:[(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Student:"})," ",k(x.userId)]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Course:"})," ",x.courseTitle]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("strong",{children:"Current Progress:"})," ",x.progress||0,"%"]}),(0,d.jsxs)("div",{className:"form-group",children:[(0,d.jsx)("label",{children:"New Progress (%)"}),(0,d.jsx)("input",{type:"number",value:N,onChange:e=>j(e.target.value),placeholder:"Enter progress (0-100)",min:"0",max:"100"})]}),(0,d.jsxs)("div",{className:"modal-actions",children:[(0,d.jsx)("button",{onClick:()=>(async e=>{if(!N||N<0||N>100)v("Please enter a valid progress value between 0 and 100");else{f(!0);try{const t=await(0,l.K3)(e.userId,e.courseId,parseInt(N),e.batchNumber);t.success?(b("Progress updated successfully for ".concat(e.courseTitle)),w(null),j(""),await S()):v(t.error||"Failed to update progress")}catch(t){v("Failed to update progress: "+t.message)}finally{f(!1)}}})(x),disabled:p,className:"btn-confirm",children:p?"Updating...":"Update Progress"}),(0,d.jsx)("button",{onClick:()=>{w(null),j("")},className:"btn-cancel",children:"Cancel"})]})]})]})})]})]})]})};r()}catch(m){r(m)}})},6073:(e,t,n)=>{n.d(t,{A:()=>
2o});var r=n(2555),s=n(5043),a=n(7324),i=n(579);const o=e=>{let{course:t,onClose:n,onSave:o}=e;const[l,c]=(0,s.useState)({title:"",description:"",level:"",duration:"",lessons:0,maxCapacity:0,price:0,originalPrice:0,category:"",icon:"",nextBatchDate:""}),[u,d]=(0,s.useState)(!1),[h,m]=(0,s.useState)(null);(0,s.useEffect)(()=>{t&&c({title:t.title||"",description:t.description||"",level:t.level||"",duration:t.duration||"",lessons:t.lessons||0,maxCapacity:t.maxCapacity||0,price:t.price||0,originalPrice:t.originalPrice||0,category:t.category||"",icon:t.icon||"",nextBatchDate:t.nextBatchDate||""})},[t]);const p=e=>{const{name:t,value:n,type:s}=e.target;c(e=>(0,r.A)((0,r.A)({},e),{},{[t]:"number"===s?parseFloat(n)||0:n}))};return(0,i.jsx)("div",{className:"modal-overlay",onClick:n,children:(0,i.jsxs)("div",{className:"modal-content course-editor-modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h2",{children:"\u270f\ufe0f Edit Course Information"}),(0,i.jsx)("button",{className:"modal-close",onClick:n,children:"\xd7"})]}),h&&(0,i.jsx)("div",{className:"error-message",children:h}),(0,i.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),d(!0),m(null);try{await(0,a.J4)(t.id,l),o(),n()}catch(r){m(r.message||"Failed to update course")}finally{d(!1)}},className:"course-editor-form",children:[(0,i.jsxs)("div",{className:"form-grid",children:[(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"title",children:"Course Title *"}),(0,i.jsx)("input",{type:"text",id:"title",name:"title",value:l.title,onChange:p,required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"icon",children:"Icon (Emoji)"}),(0,i.jsx)("input",{type:"text",id:"icon",name:"icon",value:l.icon,onChange:p,placeholder:"\ud83e\udd16",maxLength:"2"})]}),(0,i.jsxs)("div",{className:"form-group full-width",children:[(0,i.jsx)("label",{htmlFor:"description",children:"Description *"}),(0,i.jsx)("textarea",{id:"description",name:"description",value:l.description,onChange:p,rows:"4",required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"level",children:"Level *"}),(0,i.jsx)("input",{type:"text",id:"level",name:"level",value:l.level,onChange:p,placeholder:"Beginner level",required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"category",children:"Category *"}),(0,i.jsx)("input",{type:"text",id:"category",name:"category",value:l.category,onChange:p,placeholder:"Artificial Intelligence",required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"duration",children:"Duration"}),(0,i.jsx)("input",{type:"text",id:"duration",name:"duration",value:l.duration,onChange:p,placeholder:"Approximately 15 weeks"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"lessons",children:"Total Lessons"}),(0,i.jsx)("input",{type:"number",id:"lessons",name:"lessons",value:l.lessons,onChange:p,min:"0"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"maxCapacity",children:"Max Capacity per Batch"}),(0,i.jsx)("input",{type:"number",id:"maxCapacity",name:"maxCapacity",value:l.maxCapacity,onChange:p,min:"1"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"price",children:"Current Price ($)"}),(0,i.jsx)("input",{type:"number",id:"price",name:"price",value:l.price,onChange:p,min:"0",step:"0.01"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"originalPrice",children:"Original Price ($)"}),(0,i.jsx)("input",{type:"number",id:"originalPrice",name:"originalPrice",value:l.originalPrice,onChange:p,min:"0",step:"0.01"})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"nextBatchDate",children:"Next Batch Date"}),(0,i.jsx)("input",{type:"date",id:"nextBatchDate",name:"nextBatchDate",value:l.nextBatchDate,onChange:p})]})]}),(0,i.jsxs)("div",{className:"modal-actions",children:[(0,i.jsx)("button",{type:"button",className:"btn-secondary",onClick:n,disabled:u,children:"Cancel"}),(0,i.jsx)("button",{type:"submit",className:"btn-primary",disabled:u,children:u?"Saving...":"Save Changes"})]})]})]})})}},6263:(e,t,n)=>{n.d(t,{A:()=>i});var r=n(2555),s=n(5043),a=n(579);
2const i=function(){const[e,t]=(0,s.useState)({name:"",email:"",phone:"",message:""}),[n,i]=(0,s.useState)(!1),[o,l]=(0,s.useState)(null),[c,u]=(0,s.useState)({}),[d,h]=(0,s.useState)({}),m=(e,t)=>{const n=(0,r.A)({},c);switch(e){case"name":t.trim()?t.trim().length<2?n.name="Name must be at least 2 characters":delete n.name:n.name="Name is required";break;case"email":const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;t.trim()?e.test(t)?delete n.email:n.email="Please enter a valid email address":n.email="Email is required";break;case"phone":if(t&&t.length>0){/^[+]?[\d\s\-()]+$/.test(t)?delete n.phone:n.phone="Please enter a valid phone number"}else delete n.phone;break;case"message":t.trim()?t.trim().length<10?n.message="Message must be at least 10 characters":delete n.message:n.message="Message is required"}return u(n),0===Object.keys(n).length},p=e=>{const{name:n,value:s}=e.target;t(e=>(0,r.A)((0,r.A)({},e),{},{[n]:s})),d[n]&&m(n,s),o&&l(null)},f=e=>{const{name:t,value:n}=e.target;h(e=>(0,r.A)((0,r.A)({},e),{},{[t]:!0})),m(t,n)};return(0,a.jsx)("div",{className:"contact-page-container",children:(0,a.jsxs)("div",{className:"contact-card",children:[(0,a.jsxs)("div",{className:"contact-header",children:[(0,a.jsx)("h1",{className:"contact-title",children:"Contact Us"}),(0,a.jsx)("p",{className:"contact-subtitle",children:"Have questions or suggestions? We'd love to hear from you!"})]}),(0,a.jsxs)("form",{onSubmit:async n=>{if(n.preventDefault(),h({name:!0,email:!0,phone:!0,message:!0}),(()=>{const t=["name","email","message"].every(t=>(m(t,e[t]),!c[t]));return e.phone&&m("phone",e.phone),t&&0===Object.keys(c).length})()){i(!0),l(null);try{const n="xkgbylng";if(!n)throw new Error("Contact form not configured");(await fetch("https://formspree.io/f/".concat(n),{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({name:e.name,email:e.email,phone:e.phone,message:e.message,_subject:"New contact form submission from ".concat(e.name)})})).ok?(l("success"),t({name:"",email:"",phone:"",message:""}),u({}),h({})):l("error")}catch(r){l("error")}finally{i(!1)}}else l("validation")},className:"contact-form",children:["validation"===o&&(0,a.jsx)("div",{className:"form-message error",children:(0,a.jsx)("p",{children:"\u274c Please fix the errors below and try again."})}),"success"===o&&(0,a.jsx)("div",{className:"form-message success",children:(0,a.jsx)("p",{children:"\u2705 Thank you for your message! We'll get back to you within 24 hours."})}),"error"===o&&(0,a.jsxs)("div",{className:"form-message error",children:[(0,a.jsx)("p",{children:"\u274c Sorry, there was an error sending your message."}),(0,a.jsxs)("p",{className:"contact-form-note",children:["Please try again or email us directly at"," ",(0,a.jsx)("a",{href:"mailto:".concat("[email protected]"),className:"contact-form-link",children:"[email protected]"})]})]}),(0,a.jsxs)("div",{className:"form-field",children:[(0,a.jsx)("label",{className:"form-label",children:"Name"}),(0,a.jsx)("input",{type:"text",name:"name",value:e.name,onChange:p,onBlur:f,placeholder:"Your full name",required:!0,className:"form-input ".concat(c.name?"error":"")}),c.name&&(0,a.jsx)("span",{className:"field-error",children:c.name})]}),(0,a.jsxs)("div",{className:"form-field",children:[(0,a.jsx)("label",{className:"form-label",children:"Email Address"}),(0,a.jsx)("input",{type:"email",name:"email",value:e.email,onChange:p,onBlur:f,placeholder:"Your email address",required:!0,className:"form-input ".concat(c.email?"error":"")}),c.email&&(0,a.jsx)("span",{className:"field-error",children:c.email})]}),(0,a.jsxs)("div",{className:"form-field",children:[(0,a.jsxs)("label",{className:"form-label",children:["Phone Number ",(0,a.jsx)("span",{className:"optional-text",children:"(optional)"})]}),(0,a.jsx)("input",{type:"tel",name:"phone",value:e.phone,onChange:p,onBlur:f,placeholder:"Your phone number",className:"form-input ".concat(c.phone?"error":"")}),c.phone&&(0,a.jsx)("span",{className:"field-error",children:c.phone})]}),(0,a.jsxs)("div",{className:"form-field",children:[(0,a.jsx)("label",{className:"form-label",children:"Message"}),(0,a.jsx)("textarea",{name:"message",value:e.message,onChange:p,onBlur:f,placeholder:"Tell us about your question or feedback...",rows:"5",required:!0,className:"form-textarea ".concat(c.message?"error":"")}),c.message&&(0,a.jsx)("span",{className:"field-error",children:c.message}),(0,a.jsxs)("div",{className:"character-count",children:[e.message.length,"/500 characters"]})]}),(0,a.jsx)("button",{type:"submit",className:"btn",disabled:n,children:n?"Sending...":"Send Message"})]}),(0,a.jsxs)("div",{className:"alternative-contact",children:[(0,a.jsx)("p",{children:"Having trouble with the form? You can also reach us directly:"}),(0,a.jsx)("a",{href:"mailto:".concat("[email protected]","?subject=Contact Form Inquiry&body=Hello TuneParams.ai team,%0D%0A%0D%0AI would like to inquire about..."),className:"btn",children:"\ud83d\udce7 Send Email Directly"})]}),(0,a.jsxs)("div",{className:"contact-info",children:[(0,a.jsxs)("div",{className:"contact-grid",children:[(0,a.jsxs)("div",{className:"contact-item",children:[(0,a.jsx)("div",{className:"contact-item-icon",children:"\ud83d\udce7"}),(0,a.jsx)("div",{className:"contact-item-title",children:"Email"}),(0,a.jsx)("div",{className:"contact-item-text",children:"[email protected]"})]}),(0,a.jsxs)("div",{className:"contact-item",children:[(0,a.jsx)("div",{className:"contact-item-icon",children:"\ud83d\udd52"}),(0,a.jsx)("div",{className:"contact-item-title",children:"Response Time"}),(0,a.jsx)("div",{className:"contact-item-text",children:"Within 24 hours"})]})]}),(0,a.jsxs)("div",{className:"social-section",children:[(0,a.jsx)("p",{children:"Follow us on social media"}),(0,a.jsxs)("div",{className:"social-buttons",children:[(0,a.jsx)("a",{href:"https://www.linkedin.com/in/tuneparams/",target:"_blank",rel:"noopener noreferrer",className:"social-btn linkedin",children:"LinkedIn"}),(0,a.jsx)("a",{href:"https://twitter.com/tuneparams",target:"_blank",rel:"noopener noreferrer",className:"social-btn twitter",children:"Twitter"}),(0,a.jsx)("a",{href:"https://github.com/TuneParams-ai",target:"_blank",rel:"noopener noreferrer",className:"social-btn github",children:"GitHub"})]})]})]})]})})}},6267:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(2555),s=n(5043),a=n(5472),i=n(8426),o=n(579);const l=()=>
2{const[e,t]=(0,s.useState)([]),[n,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(null),d=async()=>{l(!0),u(null);try{const e=(0,a.P)((0,a.rJ)(i.db,"payments"),(0,a.My)("createdAt","desc")),n=(await(0,a.GG)(e)).docs.map(e=>(0,r.A)({id:e.id},e.data()));t(n)}catch(e){u(e.message)}finally{l(!1)}};return(0,s.useEffect)(()=>{d()},[]),(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"admin-section-header",children:[(0,o.jsxs)("h2",{children:["Payment Records (",e.length,")"]}),(0,o.jsx)("button",{onClick:d,className:"admin-refresh-button",disabled:n,children:n?"Loading...":"\ud83d\udd04 Refresh"})]}),c&&(0,o.jsxs)("p",{className:"admin-error",children:["Error: ",c]}),(0,o.jsx)("div",{className:"admin-table-container",children:(0,o.jsxs)("table",{className:"admin-table",children:[(0,o.jsx)("thead",{children:(0,o.jsxs)("tr",{children:[(0,o.jsx)("th",{children:"Date"}),(0,o.jsx)("th",{children:"Course"}),(0,o.jsx)("th",{children:"User Email"}),(0,o.jsx)("th",{children:"Amount"}),(0,o.jsx)("th",{children:"Payment ID"}),(0,o.jsx)("th",{children:"Status"})]})}),(0,o.jsx)("tbody",{children:e.map(e=>{var t,n,r;return(0,o.jsxs)("tr",{children:[(0,o.jsx)("td",{children:(null===(t=e.paymentDate)||void 0===t||null===(n=t.toDate)||void 0===n||null===(r=n.call(t))||void 0===r?void 0:r.toLocaleDateString())||"N/A"}),(0,o.jsx)("td",{children:e.courseTitle}),(0,o.jsx)("td",{children:e.userEmail||e.payerEmail}),(0,o.jsxs)("td",{children:["$",e.amount]}),(0,o.jsx)("td",{className:"payment-id",children:e.paymentId}),(0,o.jsx)("td",{children:(0,o.jsx)("span",{className:"status-".concat(e.status),children:e.status})})]},e.id)})})]})}),0===e.length&&!n&&(0,o.jsx)("div",{className:"admin-empty-state",children:(0,o.jsx)("p",{children:"No payment records found."})})]})}},6672:(e,t,n)=>{var r=n(5043);function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var i={d:{f:a,r:function(){throw Error(s(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");var l=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){return"font"===e?"":"string"===typeof t?"use-credentials"===t?t:"":void 0}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(s(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:o,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},t.preconnect=function(e,t){"string"===typeof e&&(t?t="string"===typeof(t=t.crossOrigin)?"use-credentials"===t?t:"":void 0:t=null,i.d.C(e,t))},t.prefetchDNS=function(e){"string"===typeof e&&i.d.D(e)},t.preinit=function(e,t){if("string"===typeof e&&t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin),s="string"===typeof t.integrity?t.integrity:void 0,a="string"===typeof t.fetchPriority?t.fetchPriority:void 0;"style"===n?i.d.S(e,"string"===typeof t.precedence?t.precedence:void 0,{crossOrigin:r,integrity:s,fetchPriority:a}):"script"===n&&i.d.X(e,{crossOrigin:r,integrity:s,fetchPriority:a,nonce:"string"===typeof t.nonce?t.nonce:void 0})}},t.preinitModule=function(e,t){if("string"===typeof e)if("object"===typeof t&&null!==t){if(null==t.as||"script"===t.as){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0})}}else null==t&&i.d.M(e)},t.preload=function(e,t){if("string"===typeof e&&"object"===typeof t&&null!==t&&"string"===typeof t.as){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:"string"===typeof t.integrity?t.integrity:void 0,nonce:"string"===typeof t.nonce?t.nonce:void 0,type:"string"===typeof t.type?t.type:void 0,fetchPriority:"string"===typeof t.fetchPriority?t.fetchPriority:void 0,referrerPolicy:"str
2ing"===typeof t.referrerPolicy?t.referrerPolicy:void 0,imageSrcSet:"string"===typeof t.imageSrcSet?t.imageSrcSet:void 0,imageSizes:"string"===typeof t.imageSizes?t.imageSizes:void 0,media:"string"===typeof t.media?t.media:void 0})}},t.preloadModule=function(e,t){if("string"===typeof e)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:"string"===typeof t.as&&"script"!==t.as?t.as:void 0,crossOrigin:n,integrity:"string"===typeof t.integrity?t.integrity:void 0})}else i.d.m(e)},t.requestFormReset=function(e){i.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},t.useFormStatus=function(){return l.H.useHostTransitionStatus()},t.version="19.1.0"},6682:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>j});var s=n(5043),a=n(342),i=n(4366),o=n(762),l=n(4241),c=n(3663),u=n(6267),d=n(1905),h=n(1487),m=n(6770),p=n(4999),f=n(6058),g=n(3893),v=n(575),y=n(8985),b=n(4640),x=n(8130),w=(n(3150),n(579)),N=e([d,h,p,f]);[d,h,p,f]=N.then?(await N)():N;const j=()=>{const{user:e}=(0,a.A)(),t=(0,i.Zp)(),[n,r]=(0,s.useState)("overview"),[N,j]=(0,s.useState)(!1),[E,S]=(0,s.useState)(!0);(0,s.useEffect)(()=>{(async()=>{if(!e)return j(!1),void S(!1);try{const t=await(0,o.N6)(e.uid);j(!!t)}catch(t){j(!1)}finally{S(!1)}})()},[e]);const C=e&&["[email protected]","[email protected]","[email protected]"].includes(e.email),k=N||C;return e?E?(0,w.jsx)("div",{className:"admin-loading",children:(0,w.jsx)("h2",{children:"Checking admin permissions..."})}):k?(0,w.jsxs)("div",{className:"admin-container",children:[(0,w.jsxs)("div",{className:"admin-header-section",children:[(0,w.jsx)("h1",{children:"Admin Dashboard"}),(0,w.jsxs)("div",{className:"quick-actions",children:[(0,w.jsx)("button",{onClick:()=>t("/admin/courses"),className:"quick-action-btn course-management-btn",children:"\ud83d\udcda Course Management"}),(0,w.jsx)("button",{onClick:()=>r("courseAccess"),className:"quick-action-btn course-access-btn",title:"Access any course dashboard as admin",children:"\ud83c\udf93 Course Access"})]})]}),(0,w.jsxs)("div",{className:"admin-tabs",children:[(0,w.jsx)("button",{onClick:()=>r("overview"),className:"admin-tab-button ".concat("overview"===n?"active":""),children:"\ud83d\udcca Overview"}),(0,w.jsx)("button",{onClick:()=>r("payments"),className:"admin-tab-button ".concat("payments"===n?"active":""),children:"\ud83d\udcb3 Payments"}),(0,w.jsx)("button",{onClick:()=>r("manualPayments"),className:"admin-tab-button ".concat("manualPayments"===n?"active":""),children:"\ud83e\uddfe Manual Payments"}),(0,w.jsx)("button",{onClick:()=>r("enrollments"),className:"admin-tab-button ".concat("enrollments"===n?"active":""),children:"\ud83d\udcda Enrollments"}),(0,w.jsx)("button",{onClick:()=>r("courseAccess"),className:"admin-tab-button ".concat("courseAccess"===n?"active":""),children:"\ud83c\udf93 Course Access"}),(0,w.jsx)("button",{onClick:()=>r("emails"),className:"admin-tab-button ".concat("emails"===n?"active":""),children:"\ud83d\udce7 Email Tracking"}),(0,w.jsx)("button",{onClick:()=>r("coupons"),className:"admin-tab-button ".concat("coupons"===n?"active":""),children:"\ud83c\udfab Coupons"}),(0,w.jsx)("button",{onClick:()=>r("progress"),className:"admin-tab-button ".concat("progress"===n?"active":""),children:"\ud83d\udcc8 Progress Tracking"}),(0,w.jsx)("button",{onClick:()=>r("search"),className:"admin-tab-button ".concat("search"===n?"active":""),children:"\ud83d\udd0d Search"}),(0,w.jsx)("button",{onClick:()=>r("roles"),className:"admin-tab-button ".concat("roles"===n?"active":""),children:"\ud83d\udc51 Role Management"}),(0,w.jsx)("button",{onClick:()=>r("audit"),className:"admin-tab-button ".concat("audit"===n?"active":""),children:"\ud83d\udccb Audit Logs"}),(0,w.jsx)("button",{onClick:()=>r("backup"),className:"admin-tab-button ".concat("backup"===n?"active":""),style:{backgroundColor:"#28a745",color:"#fff"},title:"Create Firestore database backups",children:"\ud83d\udee1\ufe0f Database Backup"}),(0,w.jsx)("button",{onClick:()=>r("restore"),className:"admin-tab-button ".concat("restore"===n?"active":""),style:{backgroundColor:"#dc3545",color:"#fff"},title:"Restore from database backups",children:"\ud83d\udd04 Database Restore"})]}),(0,w.jsxs)("div",{className:"admin-content",children:["overview"===n&&(0,w.jsx)(c.A,{}),"payments"===n&&(0,w.jsx)(u.A,{}),"manualPayments"===n&&(0,w.jsx)(d.A,{}),"enrollments"===n&&(0,w.jsx)(h.A,{}),"courseAccess"===n&&(0,w.jsx)(y.A,{}),"emails"===n&&(0,w.jsx)(m.A,{}),"coupons"===n&&(0,w.jsx)(p.A,{}),"progress"===n&&(0,w.jsx)(f.A,{}),"search"===n&&(0,w.jsx)(g.A,{}),"roles"===n&&(0,w.jsx)(l.A,{}),"audit"===n&&(0,w.jsx)(v.A,{}),"backup"===n&&(0,w.jsx)(b.A,{}),"restore"===n&&(0,w.jsx)(x.A,{})]})]}):(0,w.jsxs)("div",{className:"admin-access-denied",children:[(0,w.jsx)("h2",{children:"Access Denied"}),(0,w.jsx)("p",{children:"You don't have permission to access this page."}),(0,w.jsx)("p",{children:"Please contact an administrator to assign you admin privileges."})]}):(0,w.jsx)("div",{className:"admin-access-denied",children:(0,w.jsx)("h2",{children:"Please log in to access admin panel"})})};r()}catch(j){r(j)}})},6770:(e,t,n)=>{n.d(t,{A:()=>
2o});var r=n(5043),s=n(7417),a=n(579);const i=e=>{let{emails:t,formatDate:n}=e;const[s,i]=r.useState(null);return(0,a.jsx)("div",{className:"email-table-container",children:(0,a.jsx)("div",{style:{overflowX:"auto"},children:(0,a.jsxs)("table",{className:"email-table",children:[(0,a.jsx)("thead",{className:"email-table-header",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"email-table-header-cell",children:"\ud83d\udcc5 Date"}),(0,a.jsx)("th",{className:"email-table-header-cell",children:"\ud83d\udc64 Recipient"}),(0,a.jsx)("th",{className:"email-table-header-cell",children:"\ud83d\udce7 Type"}),(0,a.jsx)("th",{className:"email-table-header-cell",children:"\ud83d\udcda Course"}),(0,a.jsx)("th",{className:"email-table-header-cell",children:"\u2705 Status"}),(0,a.jsx)("th",{className:"email-table-header-cell",children:"\ud83d\udcb3 Payment ID"}),(0,a.jsx)("th",{className:"email-table-header-cell-center",children:"\u2699\ufe0f Actions"})]})}),(0,a.jsx)("tbody",{children:0===t.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"table-empty-state",children:(0,a.jsxs)("div",{className:"table-empty-content",children:[(0,a.jsx)("div",{className:"table-empty-icon",children:"\ud83d\udce7"}),(0,a.jsx)("h3",{className:"table-empty-title",children:"No emails to display"}),(0,a.jsx)("p",{className:"table-empty-text",children:"Emails will appear here once they are sent through the system."})]})})}):t.map((e,t)=>{var o;return(0,a.jsxs)(r.Fragment,{children:[(0,a.jsxs)("tr",{className:"email-table-row ".concat(t%2===0?"even":"odd"),children:[(0,a.jsx)("td",{className:"email-table-cell",children:(0,a.jsx)("div",{className:"cell-date",children:n(e.sentAt)})}),(0,a.jsx)("td",{className:"email-table-cell",children:(0,a.jsxs)("div",{className:"cell-recipient",children:[(0,a.jsx)("div",{className:"recipient-name",children:e.recipientName||"N/A"}),(0,a.jsx)("div",{className:"recipient-email",children:e.recipientEmail})]})}),(0,a.jsx)("td",{className:"email-table-cell",children:(0,a.jsx)("span",{className:"email-type-badge ".concat("enrollment_confirmation"===e.emailType?"enrollment":"other"),children:null===(o=e.emailType)||void 0===o?void 0:o.replace("_"," ")})}),(0,a.jsx)("td",{className:"email-table-cell",children:(0,a.jsxs)("div",{className:"cell-course",children:[(0,a.jsx)("div",{className:"course-title",children:e.courseTitle||"N/A"}),e.amount&&(0,a.jsxs)("div",{className:"course-amount",children:["$",e.amount]})]})}),(0,a.jsx)("td",{className:"email-table-cell",children:(0,a.jsxs)("div",{className:"cell-status",children:[(0,a.jsx)("span",{className:"status-badge ".concat("sent"===e.status?"success":"error"),children:e.status}),e.errorMessage&&(0,a.jsx)("div",{className:"error-message",children:e.errorMessage})]})}),(0,a.jsx)("td",{className:"email-table-cell payment-id-cell",children:(0,a.jsx)("div",{className:"payment-id",children:e.paymentId?e.paymentId.substring(0,12)+"...":"N/A"})}),(0,a.jsx)("td",{className:"email-table-cell actions-cell",children:(0,a.jsx)("button",{onClick:()=>{return t=e.id,void i(s===t?null:t);var t},className:"action-button ".concat(s===e.id?"hide":"view"),children:s===e.id?"\ud83d\ude48 Hide":"\ud83d\udc41\ufe0f View"})})]}),s===e.id&&(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"email-details-section",children:(0,a.jsxs)("div",{className:"email-details-content",children:[(0,a.jsx)("h4",{className:"email-details-title",children:"\ud83d\udccb Email Details"}),(0,a.jsxs)("div",{className:"email-details-grid",children:[(0,a.jsxs)("div",{className:"email-detail-card",children:[(0,a.jsx)("div",{className:"detail-label",children:"\ud83d\udce7 Subject"}),(0,a.jsx)("div",{className:"detail-value",children:e.subject||"N/A"})]}),(0,a.jsxs)("div",{className:"email-detail-card",children:[(0,a.jsx)("div",{className:"detail-label",children:"\ud83d\uded2 Order ID"}),(0,a.jsx)("div",{className:"detail-value detail-code",children:e.orderId||"N/A"})]}),(0,a.jsxs)("div",{className:"email-detail-card",children:[(0,a.jsx)("div",{className:"detail-label",children:"\ud83c\udf93 Enrollment ID"}),(0,a.jsx)("div",{className:"detail-value detail-code",children:e.enrollmentId||"N/A"})]}),(0,a.jsxs)("div",{className:"email-detail-card",children:[(0,a.jsx)("div",{className:"detail-label",children:"\ud83d\udd27 Service Response"}),(0,a.jsx)("div",{className:"detail-value detail-small",children:e.emailServiceResponse||"N/A"})]})]}),e.rawTextContent&&(0,a.jsx)("div",{className:"email-content-section",children:(0,a.jsxs)("div",{className:"email-detail-card",children:[(0,a.jsx)("div",{className:"email-content-header",children:"\ud83d\udcdd Email Content"}),(0,a.jsx)("div",{className:"email-content-viewer",children:(0,a.jsx)("pre",{className:"email-content-pre",children:e.rawTextContent})})]})})]})})})]},e.id)})})]})})})},o=()=>{const[e,t]=(0,r.useState)(null),[n,o]=(0,r.useState)([]),[l,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)("overview"),[h,m]=(0,r.useState)(""),[p,f]=(0,r.useState)("enrollment_confirmation");(0,r.useEffect)(()=>{g()},[]);const g=async()=>{c(!0);try{const e=await(0,s.CB)();e.success&&t(e.statistics)}catch(e){}finally{c(!1)}},v=e=>{if(!e)return"N/A";return(e.toDate?e.toDate():new Date(e)).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})};return l&&!e?(0,a.jsxs)("div",{className:"loading-container",children:[(0,a.jsx)("div",{className:"loading-spinner"}),(0,a.jsx)("p",{className:"loading-text",children:"Loading email tracking data..."})]}):(0,a.jsx)("div",{className:"email-tracking-container",children:(0,a.jsxs)("div",{className:"email-tracking-card",children:[(0,a.jsx)("h2",{className:"email-tracking-title",children:"\ud83d\udce7 Email Tracking Dashboard"}),(0,a.jsx)("div",{className:"tab-navigation",children:[{key:"overview",label:"Overview",icon:"\ud83d\udcca"},{key:"search",label:"Search Emails",icon:"\ud83d\udd0d"},{key:"by-type",label:"By Type",icon:"\ud83d\udcdd"}].map(e=>(0,a.jsxs)("button",{onClick:()=>
2d(e.key),className:"tab-button ".concat(u===e.key?"active":""),children:[(0,a.jsx)("span",{children:e.icon}),e.label]},e.key))}),"overview"===u&&e&&(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"stats-grid",children:[{title:"Total Emails",value:e.totalEmails,color:"#667eea",icon:"\ud83d\udce7"},{title:"Sent Successfully",value:e.sentSuccessfully,color:"#10b981",icon:"\u2705"},{title:"Failed",value:e.failed,color:"#ef4444",icon:"\u274c"},{title:"Success Rate",value:"".concat(e.successRate,"%"),color:"#06b6d4",icon:"\ud83d\udcca"}].map((e,t)=>(0,a.jsxs)("div",{className:"stat-card",children:[(0,a.jsx)("div",{className:"stat-icon",children:e.icon}),(0,a.jsx)("h3",{className:"stat-title",children:e.title}),(0,a.jsx)("p",{className:"stat-value",style:{color:e.color},children:e.value})]},t))}),(0,a.jsxs)("div",{className:"overview-grid",children:[(0,a.jsxs)("div",{className:"overview-card",children:[(0,a.jsx)("h3",{className:"overview-card-title",children:"\ud83d\udce7 Email Types"}),Object.entries(e.emailTypes).map(e=>{let[t,n]=e;return(0,a.jsxs)("div",{className:"overview-list-item",children:[(0,a.jsx)("span",{className:"overview-item-label",children:t.replace("_"," ").toUpperCase()}),(0,a.jsx)("div",{className:"overview-badge primary",children:n})]},t)})]}),(0,a.jsxs)("div",{className:"overview-card",children:[(0,a.jsx)("h3",{className:"overview-card-title",children:"\ud83d\udcda Course Emails"}),Object.entries(e.courses).map(e=>{let[t,n]=e;const r=t.split("_").slice(1).join("_");return(0,a.jsxs)("div",{className:"overview-list-item",children:[(0,a.jsx)("span",{className:"overview-item-label overview-item-truncate",children:r}),(0,a.jsx)("div",{className:"overview-badge success",children:n})]},t)})]})]})]}),"search"===u&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"search-section",children:[(0,a.jsx)("h3",{className:"search-title",children:"\ud83d\udd0d General Search"}),(0,a.jsxs)("div",{className:"search-form",children:[(0,a.jsxs)("div",{className:"form-group",children:[(0,a.jsx)("label",{className:"form-label",children:"Search Term"}),(0,a.jsx)("input",{type:"text",placeholder:"Search by name, course, payment ID, etc...",value:h,onChange:e=>m(e.target.value),className:"form-input general-search-input"})]}),(0,a.jsx)("button",{onClick:async()=>{if(h.trim()){c(!0);try{const e=await(0,s.uw)(h.trim());e.success&&o(e.emails)}catch(e){}finally{c(!1)}}},disabled:l,className:"search-button success",children:l?"Searching...":"\ud83d\udd0d General Search"})]})]}),n.length>0?(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"search-results-title",children:["\ud83c\udfaf Search Results (",n.length,")"]}),(0,a.jsx)(i,{emails:n,formatDate:v})]}):h.trim()?(0,a.jsxs)("div",{className:"empty-state",children:[(0,a.jsx)("div",{className:"empty-state-icon",children:"\ud83d\udd0d"}),(0,a.jsx)("h3",{className:"empty-state-title",children:"No emails found"}),(0,a.jsx)("p",{className:"empty-state-text",children:"Try adjusting your search terms or check if the email address is correct."})]}):null]}),"by-type"===u&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"search-section",children:[(0,a.jsx)("h3",{className:"search-title",children:"\ud83d\udcdd Filter by Email Type"}),(0,a.jsxs)("div",{className:"search-form",children:[(0,a.jsxs)("div",{className:"form-group-small",children:[(0,a.jsx)("label",{className:"form-label",children:"Email Type"}),(0,a.jsxs)("select",{value:p,onChange:e=>f(e.target.value),className:"form-select",children:[(0,a.jsx)("option",{value:"enrollment_confirmation",children:"\ud83d\udce7 Enrollment Confirmation"}),(0,a.jsx)("option",{value:"course_reminder",children:"\u23f0 Course Reminder"}),(0,a.jsx)("option",{value:"payment_receipt",children:"\ud83e\uddfe Payment Receipt"})]})]}),(0,a.jsx)("button",{onClick:async()=>{c(!0);try{const e=await(0,s.Xu)(p);e.success&&o(e.emails)}catch(e){}finally{c(!1)}},disabled:l,className:"search-button primary",children:l?"Loading...":"\ud83d\udcca Load Emails"})]})]}),n.length>0?(0,a.jsxs)("div",{children:[(0,a.jsxs)("h3",{className:"search-results-title",children:["\ud83d\udccb ",p.replace("_"," ").toUpperCase()," Emails (",n.length,")"]}),(0,a.jsx)(i,{emails:n,formatDate:v})]}):(0,a.jsxs)("div",{className:"empty-state",children:[(0,a.jsx)("div",{className:"empty-state-icon",children:"\ud83d\udce7"}),(0,a.jsxs)("h3",{className:"empty-state-title",children:["No ",p.replace("_"," ")," emails found"]}
2),(0,a.jsx)("p",{className:"empty-state-text",children:'Click "Load Emails" to fetch emails of this type.'})]})]})]})})}},6798:(e,t,n)=>{n.d(t,{A:()=>f});var r=n(2555),s=n(5043),a=n(342),i=n(4366),o=n(2099),l=n(1291),c=n(4879),u=n(579);const d=e=>{var t,n,r,i;let{thread:d,onClick:h,onDelete:m,onLike:p}=e;const{user:f}=(0,a.A)(),{userRole:g}=(0,c.h)(),[v,y]=(0,s.useState)(!1),[b,x]=(0,s.useState)((null===(t=d.likedBy)||void 0===t?void 0:t.length)||0),[w,N]=(0,s.useState)(!!f&&(null===(n=d.likedBy)||void 0===n?void 0:n.includes(f.uid))),j=(0,l.Ry)(d.createdAt),E=(0,l.Ry)(d.lastReplyAt),S=f&&(f.uid===d.authorId||"admin"===(null===g||void 0===g?void 0:g.role));return(0,u.jsxs)("div",{className:"thread-card",onClick:e=>{e.target.closest(".delete-btn")||e.target.closest(".like-btn")||h&&h()},children:[(0,u.jsxs)("div",{className:"thread-header",children:[(0,u.jsxs)("div",{className:"thread-title-row",children:[(0,u.jsxs)("h3",{className:"thread-title",children:[d.isPinned&&(0,u.jsx)("span",{className:"pin-icon",title:"Pinned",children:"\ud83d\udccc"}),d.title]}),(0,u.jsx)("span",{className:"thread-category",style:{backgroundColor:"var(--category-".concat(d.category,"-color)")},children:o.Bi[d.category]||"General"})]}),(0,u.jsxs)("p",{className:"thread-preview",children:[(C=d.content,(new DOMParser).parseFromString(C,"text/html").body.textContent||"").substring(0,150),"..."]})]}),(0,u.jsxs)("div",{className:"thread-footer",children:[(0,u.jsxs)("div",{className:"thread-author",children:[(0,u.jsxs)("div",{className:"author-avatar",children:[d.authorAvatar?(0,u.jsx)("img",{src:d.authorAvatar,alt:d.authorName,onError:e=>{e.target.style.display="none",e.target.nextElementSibling.style.display="flex"}}):null,(0,u.jsx)("div",{className:"default-avatar",style:{display:d.authorAvatar?"none":"flex"},children:null===(r=d.authorName)||void 0===r||null===(i=r.charAt(0))||void 0===i?void 0:i.toUpperCase()})]}),(0,u.jsxs)("div",{className:"author-info",children:[(0,u.jsx)("span",{className:"author-name",children:d.authorName}),(0,u.jsxs)("span",{className:"post-date",title:j.tooltip,children:["posted ",j.display]})]})]}),(0,u.jsxs)("div",{className:"thread-stats",children:[(0,u.jsxs)("span",{className:"stat-item",title:"Replies",children:[(0,u.jsx)("span",{className:"stat-icon",children:"\ud83d\udcac"}),d.replyCount]}),(0,u.jsxs)("span",{className:"stat-item",title:"Views",children:[(0,u.jsx)("span",{className:"stat-icon",children:"\ud83d\udc40"}),(0,o.Ld)(d.viewCount)]}),(0,u.jsxs)("button",{className:"like-btn ".concat(w?"liked":""),onClick:async e=>{if(e.stopPropagation(),f){if(!v){y(!0);try{const e=await(0,o.Mq)(d.id,f.uid);e.success&&(N(e.liked),x(e.likeCount),p&&p(d.id,e.liked,e.likeCount))}catch(t){}finally{y(!1)}}}else alert("Please log in to like threads")},disabled:v,title:w?"Unlike":"Like",children:[(0,u.jsx)("span",{className:"like-icon",children:"\ud83d\udc4d"}),(0,u.jsx)("span",{className:"like-count",children:b})]}),d.lastReplyAt&&d.lastReplyAt.getTime()!==d.createdAt.getTime()&&(0,u.jsxs)("span",{className:"stat-item",title:"Last reply: ".concat(E.tooltip),children:[(0,u.jsx)("span",{className:"stat-icon",children:"\u23f1\ufe0f"}),E.display]}),S&&(0,u.jsx)("button",{className:"delete-btn thread-stats-delete",onClick:async e=>{e.stopPropagation(),window.confirm("Are you sure you want to delete this thread? This action cannot be undone.")&&m&&await m(d.id)},title:"Delete thread",children:"\ud83d\uddd1\ufe0f"})]})]})]});var C},h=e=>{let{onClose:t,onThreadCreated:n}=e;const{user:i}=(0,a.A)(),[l,c]=(0,s.useState)({title:"",content:"",category:o.js.GENERAL,tags:""}
2),[d,h]=(0,s.useState)(!1),[m,p]=(0,s.useState)({}),f=e=>{const{name:t,value:n}=e.target;c(e=>(0,r.A)((0,r.A)({},e),{},{[t]:n})),m[t]&&p(e=>(0,r.A)((0,r.A)({},e),{},{[t]:""}))};return(0,u.jsx)("div",{className:"modal-overlay",onClick:t,children:(0,u.jsxs)("div",{className:"modal-content create-thread-modal",onClick:e=>e.stopPropagation(),children:[(0,u.jsxs)("div",{className:"modal-header",children:[(0,u.jsxs)("div",{className:"modal-header-content",children:[(0,u.jsx)("h2",{children:"Start a New Discussion"}),(0,u.jsx)("p",{className:"modal-subtitle",children:"Share your thoughts and connect with the community"})]}),(0,u.jsx)("button",{onClick:t,className:"close-btn","aria-label":"Close modal",children:"\xd7"})]}),(0,u.jsxs)("form",{onSubmit:async e=>{if(e.preventDefault(),(()=>{const e={};return l.title.trim()?l.title.length<5?e.title="Title must be at least 5 characters long":l.title.length>200&&(e.title="Title must be less than 200 characters long"):e.title="Title is required",l.content.trim()?l.content.length<10?e.content="Content must be at least 10 characters long":l.content.length>5e3&&(e.content="Content must be less than 5000 characters long"):e.content="Content is required",p(e),0===Object.keys(e).length})()){h(!0);try{const e=(0,r.A)((0,r.A)({},l),{},{tags:l.tags.split(",").map(e=>e.trim()).filter(Boolean),authorId:i.uid,authorEmail:i.email,authorName:i.name||i.displayName||"Anonymous",authorAvatar:i.photoURL||null}),t=await(0,o.Nw)(e);t.success?n():p({form:t.error})}catch(t){p({form:"An unexpected error occurred."})}finally{h(!1)}}},className:"modal-form",children:[(0,u.jsx)("div",{className:"form-row",children:(0,u.jsxs)("div",{className:"form-group form-group-title",children:[(0,u.jsxs)("label",{htmlFor:"title",children:[(0,u.jsx)("span",{className:"label-text",children:"Discussion Title"}),(0,u.jsx)("span",{className:"label-required",children:"*"})]}),(0,u.jsx)("input",{type:"text",id:"title",name:"title",value:l.title,onChange:f,placeholder:"Enter a clear and descriptive title...",className:m.title?"input-error":"",maxLength:"200",required:!0}),(0,u.jsxs)("div",{className:"input-helper-row",children:[(0,u.jsx)("small",{className:"input-helper",children:"A good title helps others understand your discussion"}),(0,u.jsxs)("small",{className:"char-counter",children:[l.title.length,"/200"]})]}),m.title&&(0,u.jsx)("p",{className:"error-text",children:m.title})]})}),(0,u.jsx)("div",{className:"form-row",children:(0,u.jsxs)("div",{className:"form-group form-group-category",children:[(0,u.jsxs)("label",{htmlFor:"category",children:[(0,u.jsx)("span",{className:"label-text",children:"Category"}),(0,u.jsx)("span",{className:"label-required",children:"*"})]}),(0,u.jsx)("select",{id:"category",name:"category",value:l.category,onChange:f,className:"select-styled",children:Object.entries(o.Bi).map(e=>{let[t,n]=e;return(0,u.jsx)("option",{value:t,children:n},t)})})]})}),(0,u.jsx)("div",{className:"form-row",children:(0,u.jsxs)("div",{className:"form-group form-group-content",children:[(0,u.jsxs)("label",{htmlFor:"content",children:[(0,u.jsx)("span",{className:"label-text",children:"Content"}),(0,u.jsx)("span",{className:"label-required",children:"*"})]}),(0,u.jsxs)("div",{className:"content-input-wrapper",children:[(0,u.jsx)("textarea",{id:"content",name:"content",value:l.content,onChange:f,placeholder:"Share your thoughts, questions, or ideas with the community. Be descriptive and helpful to get the best responses...",rows:"10",className:m.content?"input-error":"",maxLength:"5000",required:!0}),(0,u.jsx)("div",{className:"content-helper",children:(0,u.jsxs)("div",{className:"helper-row",children:[(0,u.jsx)("small",{children:"Tip: Use clear formatting and provide context for better engagement"}),(0,u.jsxs)("small",{className:"char-counter",children:[l.content.length,"/5000 characters"]})]})})]}),m.content&&(0,u.jsx)("p",{className:"error-text",children:m.content})]})}),(0,u.jsx)("div",{className:"form-row",children:(0,u.jsxs)("div",{className:"form-group form-group-tags",children:[(0,u.jsxs)("label",{htmlFor:"tags",children:[(0,u.jsx)("span",{className:"label-text",children:"Tags"}),(0,u.jsx)("span",{className:"label-optional",children:"(optional)"})]}),(0,u.jsx)("input",{type:"text",id:"tags",name:"tags",value:l.tags,onChange:f,placeholder:"e.g., python, machine-learning, career-advice",className:"tags-input"}),(0,u.jsx)("small",{className:"input-helper",children:"Separate tags with commas to help others find your discussion"})]})}),m.form&&(0,u.jsxs)("div",{className:"form-error-container",children:[(0,u.jsx)("div",{className:"form-error-icon",children:"\u26a0\ufe0f"}),(0,u.jsx)("p",{className:"error-text form-error",children:m.form})]}),(0,u.jsxs)("div",{className:"form-actions",children:[(0,u.jsx)("button",{type:"button",className:"btn-secondary",onClick:t,children:"Cancel"}),(0,u.jsx)("button",{type:"submit",className:"btn-primary",disabled:d,children:d?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("span",{className:"loading-spinner-small"}),"Posting..."]}):"Post Discussion"})]})]})]})})};class m extends s.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){}render(){var e;return this.state.hasError?(0,u.jsx)("div",{className:"forum-container",children:(0,u.jsxs)("div",{className:"error-state",children:[(0,u.jsx)("div",{className:"error-icon",children:"\u26a0\ufe0f"}),(0,u.jsx)("h3",{children:"Something went wrong"}),(0,u.jsx)("p",{children:(null===(e=this.state.error)||void 0===e?void 0:e.message)||"An unexpected error occurred"}),(0,u.jsx)("button",{className:"create-thread-btn",onClick:()=>this.setState({hasError:!1,error:null}),children:"Try Again"})]})}):this.props.children}}const p=()=>{const{user:e}
2=(0,a.A)(),t=(0,i.Zp)(),[n,l]=(0,s.useState)([]),[c,m]=(0,s.useState)(!0),[p,f]=(0,s.useState)(null),[g,v]=(0,s.useState)(""),[y,b]=(0,s.useState)(!1),[x,w]=(0,s.useState)(!0),[N,j]=(0,s.useState)(null),[E,S]=(0,s.useState)(!1),[C,k]=(0,s.useState)(null),_=(0,s.useRef)(null);(0,s.useEffect)(()=>{_.current=N},[N]);const A=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];m(!0),k(null);try{const t=e?null:_.current,n=await(0,o.A3)(p,10,t);n.success?(l(t=>e?n.threads:[...t,...n.threads]),w(n.hasMore),j(n.lastDoc)):(k(n.error),l([]),w(!1))}catch(C){k(C.message),l([]),w(!1)}finally{m(!1)}},[p]);(0,s.useEffect)(()=>{document.title="Community Forums - TuneParams.ai";const e=document.querySelector('link[rel="icon"]'),t=Date.now();if(e)e.href="/favicon.ico?v=".concat(t);else{const e=document.createElement("link");e.rel="icon",e.href="/favicon.ico?v=".concat(t),e.type="image/x-icon",document.head.appendChild(e)}let n=document.querySelector('link[rel="shortcut icon"]');n?n.href="/favicon.ico?v=".concat(t):(n=document.createElement("link"),n.rel="shortcut icon",n.href="/favicon.ico?v=".concat(t),n.type="image/x-icon",document.head.appendChild(n))},[]),(0,s.useEffect)(()=>{S(!1),j(null),_.current=null;(async()=>{m(!0),k(null);try{const e=await(0,o.A3)(p,10,null);e.success?(l(e.threads),w(e.hasMore),j(e.lastDoc)):(k(e.error),l([]),w(!1))}catch(C){k(C.message),l([]),w(!1)}finally{m(!1)}})()},[p]);const T=async e=>{if(e&&(e.preventDefault(),e.stopPropagation()),!g||!g.trim())return S(!1),v(""),void A(!0);m(!0),S(!0),k(null);try{const e=await(0,o.U)(g.trim(),p);e.success?(l(e.threads),w(!1)):k(e.error||"Search failed")}catch(C){k(C.message||"An error occurred during search")}finally{m(!1)}},I=()=>{e?b(!0):t("/login")},P=async e=>{m(!0);try{(await(0,o.KX)(e)).success?l(t=>t.filter(t=>t.id!==e)):alert("Failed to delete thread. Please try again.")}catch(C){alert("An error occurred while deleting the thread.")}finally{m(!1)}},R=(t,n,s)=>{l(s=>s.map(s=>s.id===t?(0,r.A)((0,r.A)({},s),{},{likedBy:n?[...s.likedBy||[],e.uid]:(s.likedBy||[]).filter(t=>t!==e.uid)}):s))};return(0,u.jsxs)("div",{className:"forum-container",children:[(0,u.jsxs)("div",{className:"forum-header",children:[(0,u.jsxs)("div",{className:"forum-title",children:[(0,u.jsx)("h1",{children:"Community Forums"}),(0,u.jsx)("p",{children:"Join the conversation and connect with fellow learners"})]}),(0,u.jsxs)("div",{className:"forum-header-actions",children:[(0,u.jsxs)("div",{className:"search-form-compact",children:[(0,u.jsx)("input",{type:"text",placeholder:"Search discussions...",value:g,onChange:e=>v(e.target.value),onKeyPress:e=>{"Enter"===e.key&&(e.preventDefault(),T())},className:"search-input-compact"}),(0,u.jsx)("button",{type:"button",onClick:e=>{e.preventDefault(),e.stopPropagation(),T()},className:"search-btn-compact",children:"\ud83d\udd0d"}),g&&(0,u.jsx)("button",{type:"button",onClick:()=>{v(""),S(!1),A(!0)},className:"search-btn-compact clear-btn",children:"\u2715"})]}),(0,u.jsx)("button",{className:"create-thread-btn",onClick:I,children:e?"Start New Discussion":"Login to Post"})]})]}),(0,u.jsx)("div",{className:"forum-controls",children:(0,u.jsxs)("div",{className:"category-filter",children:[(0,u.jsx)("button",{className:"category-btn ".concat(null===p?"active":""),onClick:()=>f(null),children:"All Categories"}),Object.entries(o.Bi).map(e=>{let[t,n]=e;return(0,u.jsx)("button",{className:"category-btn ".concat(p===t?"active":""),onClick:()=>f(t),children:n},t)})]})}),(0,u.jsx)("div",{className:"forum-content",children:C?(0,u.jsxs)("div",{className:"error-state",children:[(0,u.jsx)("div",{className:"error-icon",children:"\u26a0\ufe0f"}),(0,u.jsx)("h3",{children:"Error Loading Forum"}),(0,u.jsx)("p",{children:C}),(0,u.jsx)("button",{className:"create-thread-btn",onClick:()=>{k(null),A(!0)},children:"Try Again"})]}):c&&0===n.length?(0,u.jsxs)("div",{className:"loading-state",children:[(0,u.jsx)("div",{className:"loading-spinner"}),(0,u.jsx)("p",{children:"Loading discussions..."})]}):0===n.length?(0,u.jsxs)("div",{className:"empty-state",children:[(0,u.jsx)("div",{className:"empty-icon",children:"\ud83d\udcac"}
2),(0,u.jsx)("h3",{children:"No discussions found"}),(0,u.jsx)("p",{children:E?"Try a different search term.":"Be the first to start a discussion!"}),!E&&(0,u.jsx)("button",{className:"create-thread-btn",onClick:I,children:e?"Start First Discussion":"Login to Post"})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"threads-list",children:n.map(e=>(0,u.jsx)(d,{thread:e,onClick:()=>t("/forums/thread/".concat(e.id)),onDelete:P,onLike:R},e.id))}),x&&!E&&(0,u.jsx)("button",{className:"load-more-btn",onClick:()=>A(),disabled:c,children:c?"Loading...":"Load More"})]})}),y&&(0,u.jsx)(h,{onClose:()=>b(!1),onThreadCreated:()=>{b(!1),A(!0)}})]})},f=()=>(0,u.jsx)(m,{children:(0,u.jsx)(p,{})})},6982:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{Go:()=>p,Y_:()=>u,ku:()=>h,sY:()=>m});var s=n(2555),a=n(5472),i=n(8426),o=n(5491),l=e([o]);o=(l.then?(await l)():l)[0];const c=async(e,t)=>{try{if(!i.db)throw new Error("Firestore not initialized");const n=(0,a.P)((0,a.rJ)(i.db,"enrollments"),(0,a._M)("courseId","==",e),(0,a._M)("batchNumber","==",t),(0,a._M)("status","==","enrolled")),r=await(0,a.GG)(n);return{success:!0,count:r.size}}catch(n){return{success:!1,error:n.message,count:0}}},u=async e=>{try{if(!i.db)throw new Error("Firestore not initialized");const t=(0,o.BZ)(e);if(!t||!t.batches)return{success:!1,error:"Course not found or no batches defined"};const n={};for(const r of t.batches){const t=await c(e,r.batchNumber);n[r.batchNumber]=(0,s.A)((0,s.A)({},r),{},{enrollmentCount:t.success?t.count:0,error:t.success?null:t.error})}return{success:!0,batchStats:n}}catch(t){return{success:!1,error:t.message,batchStats:{}}}},d=async(e,t,n)=>{try{if(!i.db)return{success:!1,error:"Firestore not initialized"};const r="".concat(e,"_").concat(t,"_batch").concat(n),o=(0,a.H9)(i.db,"enrollments",r),l=await(0,a.x7)(o);return l.exists()?{success:!0,enrollment:(0,s.A)({id:l.id},l.data())}:{success:!1,enrollment:null}}catch(r){return{success:!1,error:r.message}}},h=async(e,t)=>{try{if(!i.db)return{success:!1,error:"Firestore not initialized"};const n=(0,a.P)((0,a.rJ)(i.db,"enrollments"),(0,a._M)("userId","==",e),(0,a._M)("courseId","==",t)),r=await(0,a.GG)(n),o=[];return r.forEach(e=>{o.push((0,s.A)({id:e.id},e.data()))}),o.sort((e,t)=>(e.batchNumber||0)-(t.batchNumber||0)),{success:!0,enrollments:o}}catch(n){return{success:!1,error:n.message,enrollments:[]}}},m=async e=>{try{const t=(0,o.BZ)(e);if(!t)return{success:!1,error:"Course not found"};const n=(0,o.hJ)(t);if(!n)return{success:!0,batch:null,reason:"No available batches"};const r=await c(e,n.batchNumber);return{success:!0,batch:(0,s.A)((0,s.A)({},n),{},{enrollmentCount:r.success?r.count:0})}}catch(t){return{success:!1,error:t.message}}},p=async(e,t,n)=>{try{const r=await d(e,t,n);if(!r.success||!r.enrollment)return{success:!1,error:"User not enrolled in this batch"};const s=(0,o.BZ)(t);if(!s)return{success:!1,error:"Course not found"};const a=(0,o.N_)(s,n);return a?{success:!0,classLinks:a.classLinks||{},batch:a,enrollment:r.enrollment}:{success:!1,error:"Batch not found"}}catch(r){return{success:!1,error:r.message}}};r()}catch(c){r(c)}})},6990:(e,t,n)=>{n.d(t,{A:()=>s});n(5043),n(5866);var r=n(579);const s=()=>(0,r.jsx)("footer",{className:"footer",children:(0,r.jsx)("p",{children:"\xa9 2025 TuneParams.ai. All rights reserved."})})},7004:(e,t,n)=>{var r=n(8853),s=n(5043),a=n(7950);function i(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function c(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function u(e){if(l(e)!==e)throw Error(i(188))}function d(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e;for(e=e.child;null!==e;){if(null!==(t=d(e)))return t;e=e.sibling}return null}var h=Object.assign,m=Symbol.for("react.element"),p=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),x=Symbol.for("react.consumer"),w=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),C=Symbol.for("react.lazy");Symbol.for("react.scope");var k=Symbol.for("react.activity");Symbol.for("react.legacy_hidden"),Symbol.for("react.tracing_marker");var _=Symbol.for("react.memo_cache_sentinel");Symbol.for("react.view_transition");var A=Symbol.iterator;function T(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=A&&e[A]||e["@@iterator"])?e:null}var I=Symbol.for("react.client.reference");function P(e){if(null==e)return null;if("function"===typeof e)return e.$$typeof===I?null:e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case g:return"Fragment";case y:return"Profiler";case v:return"StrictMode";case j:return"Suspense";case E:return"SuspenseList";case k:return"Activity"}if("object"===typeof e)switch(e.$$typeof){case f:return"Portal";case w:return(e.displayName||"Context")+".Provider";case x:return(e._context.displayName||"Context")+".Consumer";case N:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(t=e.displayName||null)?t:P(e.type)||"Memo";case C:t=e._payload,e=e._init;try{return P(e(t))}catch(n){}}return null}var R=Array.isArray,D=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},M=[],F=-1;function U(e){return{current:e}}function V(e){0>F||(e.current=M[F],M[F]=null,F--)}function z(e,t){F++,M[F]=e.current,e.current=t}var B=U(null),q=U(null),H=U(null),W=U(null);function G(e,t){switch(z(H,t),z(q,e),z(B,null),t.nodeType){case 9:case 11:e=(e
vendor: 6,283 bytes, line 2
2=t.documentElement)&&(e=e.namespaceURI)?sd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)e=ad(t=sd(t),e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V(B),z(B,e)}function K(){V(B),V(q),V(H)}function J(e){null!==e.memoizedState&&z(W,e);var t=B.current,n=ad(t,e.type);t!==n&&(z(q,e),z(B,n))}function Y(e){q.current===e&&(V(B),V(q)),W.current===e&&(V(W),Jd._currentValue=L)}var Q=Object.prototype.hasOwnProperty,$=r.unstable_scheduleCallback,X=r.unstable_cancelCallback,Z=r.unstable_shouldYield,ee=r.unstable_requestPaint,te=r.unstable_now,ne=r.unstable_getCurrentPriorityLevel,re=r.unstable_ImmediatePriority,se=r.unstable_UserBlockingPriority,ae=r.unstable_NormalPriority,ie=r.unstable_LowPriority,oe=r.unstable_IdlePriority,le=r.log,ce=r.unstable_setDisableYieldValue,ue=null,de=null;function he(e){if("function"===typeof le&&ce(e),de&&"function"===typeof de.setStrictMode)try{de.setStrictMode(ue,e)}catch(t){}}var me=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(pe(e)/fe|0)|0},pe=Math.log,fe=Math.LN2;var ge=256,ve=4194304;function ye(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194048&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function be(e,t,n){var r=e.pendingLanes;if(0===r)return 0;var s=0,a=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var o=134217727&r;return 0!==o?0!==(r=o&~a)?s=ye(r):0!==(i&=o)?s=ye(i):n||0!==(n=o&~e)&&(s=ye(n)):0!==(o=r&~a)?s=ye(o):0!==i?s=ye(i):n||0!==(n=r&~e)&&(s=ye(n)),0===s?0:0!==t&&t!==s&&0===(t&a)&&((a=s&-s)>=(n=t&-t)||32===a&&0!==(4194048&n))?t:s}function xe(e,t){return 0===(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)}function we(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function Ne(){var e=ge;return 0===(4194048&(ge<<=1))&&(ge=256),e}function je(){var e=ve;return 0===(62914560&(ve<<=1))&&(ve=4194304),e}function Ee(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Se(e,t){e.pendingLanes|=t,268435456!==t&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ce(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-me(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194090&n}function ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-me(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}function _e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ae(e){return 2<(e&=-e)?8<e?0!==(134217727&e)?32:268435456:8:2}function Te(){var e=O.p;return 0!==e?e:void 0===(e=window.event)?32:ch(e.type)}var Ie=Math.random().toString(36).slice(2),Pe="__reactFiber$"+Ie,Re="__reactProps$"+Ie,De="__reactContainer$"+Ie,Oe="__reactEvents$"+Ie,Le="__reactListeners$"+Ie,Me="__reactHandles$"+Ie,Fe="__reactResources$"+Ie,Ue="__reactMarker$"+Ie;function Ve(e){delete e[Pe],delete e[Re],delete e[Oe],delete e[Le],delete e[Me]}function ze(e){var t=e[Pe];if(t)return t;for(var n=e.parentNode;n;){if(t=n[De]||n[Pe]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=bd(e);null!==e;){if(n=e[Pe])return n;e=bd(e)}return t}n=(e=n).parentNode}return null}function Be(e){if(e=e[Pe]||e[De]){var t=e.tag;if(5===t||6===t||13===t||26===t||27===t||3===t)return e}return null}function qe(e){var t=e.tag;if(5===t||26===t||27===t||6===t)return e.stateNode;throw Error(i(33))}function He(e){var t=e[Fe];return t||(t=e[Fe]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[Ue]=!0}var Ge=new Set,Ke={};function Je(e,t){Ye(e,t),Ye(e+"Capture",t)}function Ye(e,t){for(Ke[e]=t,e=0;e<t.length;e++)Ge.add(t[e])}var Qe,$e,Xe=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ze={},et={};function tt(e,t,n){if(s=t,Q.call(et,s)||!Q.call(Ze,s)&&(Xe.test(s)?et[s]=!0:(Ze[s]=!0,0)))if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":return void e.removeAttribute(t);case"boolean":var r=t.toLowerCase().slice(0,5);if("data-"!==r&&"aria-"!==r)return void e.removeAttribute(t)}e.setAttribute(t,""+n)}var s}function nt(e,t,n){if(null===n)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(t)}e.setAttribute(t,""+n)}}function rt(e,t,n,r){if(null===r)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":return void e.removeAttribute(n)}e.setAttributeNS(t,n,""+r)}}function st(e){if(void 0===Qe)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Qe=t&&t[1]||"",$e=-1<n.stack.indexOf("\n    at")?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return"\n"+Qe+e+$e}var at=!1;function it(e,t){if(!e||at)return"";at=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(n,[])}catch(s){var r=s}Reflect.construct(e,[],n)}
2else{try{n.call()}catch(a){r=a}e.call(n.prototype)}}else{try{throw Error()}catch(i){r=i}(n=e())&&"function"===typeof n.catch&&n.catch(function(){})}}catch(o){if(o&&r&&"string"===typeof o.stack)return[o.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var a=r.DetermineComponentFrameRoot(),i=a[0],o=a[1];if(i&&o){var l=i.split("\n"),c=o.split("\n");for(s=r=0;r<l.length&&!l[r].includes("DetermineComponentFrameRoot");)r++;for(;s<c.length&&!c[s].includes("DetermineComponentFrameRoot");)s++;if(r===l.length||s===c.length)for(r=l.length-1,s=c.length-1;1<=r&&0<=s&&l[r]!==c[s];)s--;for(;1<=r&&0<=s;r--,s--)if(l[r]!==c[s]){if(1!==r||1!==s)do{if(r--,0>--s||l[r]!==c[s]){var u="\n"+l[r].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=r&&0<=s);break}}}finally{at=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?st(n):""}function ot(e){switch(e.tag){case 26:case 27:case 5:return st(e.type);case 16:return st("Lazy");case 13:return st("Suspense");case 19:return st("SuspenseList");case 0:case 15:return it(e.type,!1);case 11:return it(e.type.render,!1);case 1:return it(e.type,!0);case 31:return st("Activity");default:return""}}function lt(e){try{var t="";do{t+=ot(e),e=e.return}while(e);return t}catch(n){return"\nError generating stack: "+n.message+"\n"+n.stack}}function ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function ut(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function dt(e){e._valueTracker||(e._valueTracker=function(e){var t=ut(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof n&&"function"===typeof n.get&&"function"===typeof n.set){var s=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function ht(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ut(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function mt(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var pt=/[\n"\\]/g;function ft(e){return e.replace(pt,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function gt(e,t,n,r,s,a,i,o){e.name="",null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i?e.type=i:e.removeAttribute("type"),null!=t?"number"===i?(0===t&&""===e.value||e.value!=t)&&(e.value=""+ct(t)):e.value!==""+ct(t)&&(e.value=""+ct(t)):"submit"!==i&&"reset"!==i||e.removeAttribute("value"),null!=t?yt(e,i,ct(t)):null!=n?yt(e,i,ct(n)):null!=r&&e.removeAttribute("value"),null==s&&null!=a&&(e.defaultChecked=!!a),null!=s&&(e.checked=s&&"function"!==typeof s&&"symbol"!==typeof s),null!=o&&"function"!==typeof o&&"symbol"!==typeof o&&"boolean"!==typeof o?e.name=""+ct(o):e.removeAttribute("name")}function vt(e,t,n,r,s,a,i,o){if(null!=a&&"function"!==typeof a&&"symbol"!==typeof a&&"boolean"!==typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||void 0!==t&&null!==t))return;n=null!=n?""+ct(n):"",t=null!=t?""+ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}r="function"!==typeof(r=null!=r?r:s)&&"symbol"!==typeof r&&!!r,e.checked=o?e.checked:!!r,e.defaultChecked=!!r,null!=i&&"function"!==typeof i&&"symbol"!==typeof i&&"boolean"!==typeof i&&(e.name=i)}function yt(e,t,n){"number"===t&&mt(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function bt(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+ct(n),t=null,s=0;s<e.length;s++){if(e[s].value===n)return e[s].selected=!0,void(r&&(e[s].defaultSelected=!0));null!==t||e[s].disabled||(t=e[s])}null!==t&&(t.selected=!0)}}function xt(e,t,n){null==t||((t=""+ct(t))!==e.value&&(e.value=t),null!=n)?e.defaultValue=null!=n?""+ct(n):"":e.defaultValue!==t&&(e.defaultValue=t)}function wt(e,t,n,r){if(null==t){if(null!=r){if(null!=n)throw Error(i(92));if(R(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}null==n&&(n=""),t=n}n=ct(t),e.defaultValue=n,(r=e.textContent)===n&&""!==r&&null!==r&&(e.value=r)}function Nt(e,t){if(t){var n=e.firstChild;
2if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var jt=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Et(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"===typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!==typeof n||0===n||jt.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function St(e,t,n){if(null!=t&&"object"!==typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var s in t)r=t[s],t.hasOwnProperty(s)&&n[s]!==r&&Et(e,s,r)}else for(var a in t)t.hasOwnProperty(a)&&Et(e,a,t[a])}function Ct(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var kt=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode
2-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),_t=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function At(e){return _t.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var Tt=null;function It(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Pt=null,Rt=null;function Dt(e){var t=Be(e);if(t&&(e=t.stateNode)){var n=e[Re]||null;e:switch(e=t.stateNode,t.type){case"input":if(gt(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+ft(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=r[Re]||null;if(!s)throw Error(i(90));gt(r,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<n.length;t++)(r=n[t]).form===e.form&&ht(r)}break e;case"textarea":xt(e,n.value,n.defaultValue);break e;case"select":null!=(t=n.value)&&bt(e,!!n.multiple,t,!1)}}}var Ot=!1;function Lt(e,t,n){if(Ot)return e(t,n);Ot=!0;try{return e(t)}finally{if(Ot=!1,(null!==Pt||null!==Rt)&&(zc(),Pt&&(t=Pt,e=Rt,Rt=Pt=null,Dt(t),e)))for(t=0;t<e.length;t++)Dt(e[t])}}function Mt(e,t){var n=e.stateNode;if(null===n)return null;var r=n[Re]||null;if(null===r)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(r=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!r;break e;default:e=!1}if(e)return null;if(n&&"function"!==typeof n)throw Error(i(231,t,typeof n));return n}var Ft=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),Ut=!1;if(Ft)try{var Vt={};Object.defineProperty(Vt,"passive",{get:function(){Ut=!0}}),window.addEventListener("test",Vt,Vt),window.removeEventListener("test",Vt,Vt)}catch(Rh){Ut=!1}var zt=null,Bt=null,qt=null;function Ht(){if(qt)return qt;var e,t,n=Bt,r=n.length,s="value"in zt?zt.value:zt.textContent,a=s.length;for(e=0;e<r&&n[e]===s[e];e++);var i=r-e;for(t=1;t<=i&&n[r-t]===s[a-t];t++);return qt=s.slice(e,1<t?1-t:void 0)}function Wt(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function Gt(){return!0}function Kt(){return!1}function Jt(e){function t(t,n,r,s,a){for(var i in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=s,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(i)&&(t=e[i],this[i]=t?t(s):s[i]);return this.isDefaultPrevented=(null!=s.defaultPrevented?s.defaultPrevented:!1===s.returnValue)?Gt:Kt,this.isPropagationStopped=Kt,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Gt)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Gt)},persist:function(){},isPersistent:Gt}),t}var Yt,Qt,$t,Xt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zt=Jt(Xt),en=h({},Xt,{view:0,detail:0}),tn=Jt(en),nn=h({},en,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pn,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.from
vendor: 4,404 bytes, line 2
2Element===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==$t&&($t&&"mousemove"===e.type?(Yt=e.screenX-$t.screenX,Qt=e.screenY-$t.screenY):Qt=Yt=0,$t=e),Yt)},movementY:function(e){return"movementY"in e?e.movementY:Qt}}),rn=Jt(nn),sn=Jt(h({},nn,{dataTransfer:0})),an=Jt(h({},en,{relatedTarget:0})),on=Jt(h({},Xt,{animationName:0,elapsedTime:0,pseudoElement:0})),ln=Jt(h({},Xt,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}})),cn=Jt(h({},Xt,{data:0})),un={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},dn={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hn={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=hn[e])&&!!t[e]}function pn(){return mn}var fn=Jt(h({},en,{key:function(e){if(e.key){var t=un[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Wt(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?dn[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pn,charCode:function(e){return"keypress"===e.type?Wt(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Wt(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}})),gn=Jt(h({},nn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),vn=Jt(h({},en,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pn})),yn=Jt(h({},Xt,{propertyName:0,elapsedTime:0,pseudoElement:0})),bn=Jt(h({},nn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),xn=Jt(h({},Xt,{newState:0,oldState:0})),wn=[9,13,27,32],Nn=Ft&&"CompositionEvent"in window,jn=null;Ft&&"documentMode"in document&&(jn=document.documentMode);var En=Ft&&"TextEvent"in window&&!jn,Sn=Ft&&(!Nn||jn&&8<jn&&11>=jn),Cn=String.fromCharCode(32),kn=!1;function _n(e,t){switch(e){case"keyup":return-1!==wn.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function An(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Tn=!1;var In={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Pn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!In[e.type]:"textarea"===t}function Rn(e,t,n,r){Pt?Rt?Rt.push(r):Rt=[r]:Pt=r,0<(t=Hu(t,"onChange")).length&&(n=new Zt("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Dn=null,On=null;function Ln(e){Lu(e,0)}function Mn(e){if(ht(qe(e)))return e}function Fn(e,t){if("change"===e)return t}var Un=!1;if(Ft){var Vn;if(Ft){var zn="oninput"in document;if(!zn){var Bn=document.createElement("div");Bn.setAttribute("oninput","return;"),zn="function"===typeof Bn.oninput}Vn=zn}else Vn=!1;Un=Vn&&(!document.documentMode||9<document.documentMode)}function qn(){Dn&&(Dn.detachEvent("onpropertychange",Hn),On=Dn=null)}function Hn(e){if("value"===e.propertyName&&Mn(On)){var t=[];Rn(t,On,e,It(e)),Lt(Ln,t)}}function Wn(e,t,n){"focusin"===e?(qn(),On=n,(Dn=t).attachEvent("onpropertychange",Hn)):"focusout"===e&&qn()}function Gn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Mn(On)}function Kn(e,t){if("click"===e)return Mn(t)}function Jn(e,t){if("input"===e||"change"===e)return Mn(t)}var Yn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function Qn(e,t){if(Yn(e,t))return!0;
vendor: 4,361 bytes, line 2
2if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Q.call(t,s)||!Yn(e[s],t[s]))return!1}return!0}function $n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Xn(e,t){var n,r=$n(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=$n(r)}}function Zn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?Zn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function er(e){for(var t=mt((e=null!=e&&null!=e.ownerDocument&&null!=e.ownerDocument.defaultView?e.ownerDocument.defaultView:window).document);t instanceof e.HTMLIFrameElement;){try{var n="string"===typeof t.contentWindow.location.href}catch(r){n=!1}if(!n)break;t=mt((e=t.contentWindow).document)}return t}function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var nr=Ft&&"documentMode"in document&&11>=document.documentMode,rr=null,sr=null,ar=null,ir=!1;function or(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;ir||null==rr||rr!==mt(r)||("selectionStart"in(r=rr)&&tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:r={anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},ar&&Qn(ar,r)||(ar=r,0<(r=Hu(sr,"onSelect")).length&&(t=new Zt("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=rr)))}function lr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var cr={animationend:lr("Animation","AnimationEnd"),animationiteration:lr("Animation","AnimationIteration"),animationstart:lr("Animation","AnimationStart"),transitionrun:lr("Transition","TransitionRun"),transitionstart:lr("Transition","TransitionStart"),transitioncancel:lr("Transition","TransitionCancel"),transitionend:lr("Transition","TransitionEnd")},ur={},dr={};function hr(e){if(ur[e])return ur[e];if(!cr[e])return e;var t,n=cr[e];for(t in n)if(n.hasOwnProperty(t)&&t in dr)return ur[e]=n[t];return e}Ft&&(dr=document.createElement("div").style,"AnimationEvent"in window||(delete cr.animationend.animation,delete cr.animationiteration.animation,delete cr.animationstart.animation),"TransitionEvent"in window||delete cr.transitionend.transition);var mr=hr("animationend"),pr=hr("animationiteration"),fr=hr("animationstart"),gr=hr("transitionrun"),vr=hr("transitionstart"),yr=hr("transitioncancel"),br=hr("transitionend"),xr=new Map,wr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Nr(e,t){xr.set(e,t),Je(t,[e])}wr.push("scrollEnd");var jr=new WeakMap;function Er(e,t){if("object"===typeof e&&null!==e){var n=jr.get(e);return void 0!==n?n:(t={value:e,source:t,stack:lt(t)},jr.set(e,t),t)}return{value:e,source:t,stack:lt(t)}}var Sr=[],Cr=0,kr=0;function _r(){for(var e=Cr,t=kr=Cr=0;t<e;){var n=Sr[t];Sr[t++]=null;var r=Sr[t];Sr[t++]=null;var s=Sr[t];Sr[t++]=null;var a=Sr[t];if(Sr[t++]=null,null!==r&&null!==s){var i=r.pending;null===i?s.next=s:(s.next=i.next,i.next=s),r.pending=s}0!==a&&Pr(n,s,a)}}function Ar(e,t,n,r){Sr[Cr++]=e,Sr[Cr++]=t,Sr[Cr++]=n,Sr[Cr++]=r,kr|=r,e.lanes|=r,null!==(e=e.alternate)&&(e.lanes|=r)}function Tr(e,t,n,r){return Ar(e,t,n,r),Rr(e)}function Ir(e,t){return Ar(e,null,null,t),Rr(e)}function Pr(e,t,n){e.lanes|=n;var r=e.alternate;null!==r&&(r.lanes|=n);for(var s=!1,a=e.return;null!==a;
vendor: 7,625 bytes, line 2
2)a.childLanes|=n,null!==(r=a.alternate)&&(r.childLanes|=n),22===a.tag&&(null===(e=a.stateNode)||1&e._visibility||(s=!0)),e=a,a=a.return;return 3===e.tag?(a=e.stateNode,s&&null!==t&&(s=31-me(n),null===(r=(e=a.hiddenUpdates)[s])?e[s]=[t]:r.push(t),t.lane=536870912|n),a):null}function Rr(e){if(50<Pc)throw Pc=0,Rc=null,Error(i(185));for(var t=e.return;null!==t;)t=(e=t).return;return 3===e.tag?e.stateNode:null}var Dr={};function Or(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(e,t,n,r){return new Or(e,t,n,r)}function Mr(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Fr(e,t){var n=e.alternate;return null===n?((n=Lr(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=65011712&e.flags,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ur(e,t){e.flags&=65011714;var n=e.alternate;return null===n?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Vr(e,t,n,r,s,a){var o=0;if(r=e,"function"===typeof e)Mr(e)&&(o=1);else if("string"===typeof e)o=function(e,t,n){if(1===n||null!=t.itemProp)return!1;switch(e){case"meta":case"title":return!0;case"style":if("string"!==typeof t.precedence||"string"!==typeof t.href||""===t.href)break;return!0;case"link":if("string"!==typeof t.rel||"string"!==typeof t.href||""===t.href||t.onLoad||t.onError)break;return"stylesheet"!==t.rel||(e=t.disabled,"string"===typeof t.precedence&&null==e);case"script":if(t.async&&"function"!==typeof t.async&&"symbol"!==typeof t.async&&!t.onLoad&&!t.onError&&t.src&&"string"===typeof t.src)return!0}return!1}(e,n,B.current)?26:"html"===e||"head"===e||"body"===e?27:5;else e:switch(e){case k:return(e=Lr(31,n,t,s)).elementType=k,e.lanes=a,e;case g:return zr(n.children,s,a,t);case v:o=8,s|=24;break;case y:return(e=Lr(12,n,t,2|s)).elementType=y,e.lanes=a,e;case j:return(e=Lr(13,n,t,s)).elementType=j,e.lanes=a,e;case E:return(e=Lr(19,n,t,s)).elementType=E,e.lanes=a,e;default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case b:case w:o=10;break e;case x:o=9;break e;case N:o=11;break e;case S:o=14;break e;case C:o=16,r=null;break e}o=29,n=Error(i(130,null===e?"null":typeof e,"")),r=null}return(t=Lr(o,n,t,s)).elementType=e,t.type=r,t.lanes=a,t}function zr(e,t,n,r){return(e=Lr(7,e,r,t)).lanes=n,e}function Br(e,t,n){return(e=Lr(6,e,null,t)).lanes=n,e}function qr(e,t,n){return(t=Lr(4,null!==e.children?e.children:[],e.key,t)).lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hr=[],Wr=0,Gr=null,Kr=0,Jr=[],Yr=0,Qr=null,$r=1,Xr="";function Zr(e,t){Hr[Wr++]=Kr,Hr[Wr++]=Gr,Gr=e,Kr=t}function es(e,t,n){Jr[Yr++]=$r,Jr[Yr++]=Xr,Jr[Yr++]=Qr,Qr=e;var r=$r;e=Xr;var s=32-me(r)-1;r&=~(1<<s),n+=1;var a=32-me(t)+s;if(30<a){var i=s-s%5;a=(r&(1<<i)-1).toString(32),r>>=i,s-=i,$r=1<<32-me(t)+s|n<<s|r,Xr=a+e}else $r=1<<a|n<<s|r,Xr=e}function ts(e){null!==e.return&&(Zr(e,1),es(e,1,0))}function ns(e){for(;e===Gr;)Gr=Hr[--Wr],Hr[Wr]=null,Kr=Hr[--Wr],Hr[Wr]=null;for(;e===Qr;)Qr=Jr[--Yr],Jr[Yr]=null,Xr=Jr[--Yr],Jr[Yr]=null,$r=Jr[--Yr],Jr[Yr]=null}var rs=null,ss=null,as=!1,is=null,os=!1,ls=Error(i(519));function cs(e){throw fs(Er(Error(i(418,"")),e)),ls}function us(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Pe]=e,t[Re]=r,n){case"dialog":Mu("cancel",t),Mu("close",t);break;case"iframe":case"object":case"embed":Mu("load",t);break;case"video":case"audio":for(n=0;n<Du.length;n++)Mu(Du[n],t);break;case"source":Mu("error",t);break;case"img":case"image":case"link":Mu("error",t),Mu("load",t);break;case"details":Mu("toggle",t);break;case"input":Mu("invalid",t),vt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0),dt(t);break;case"select":Mu("invalid",t);break;case"textarea":Mu("invalid",t),wt(t,r.value,r.defaultValue,r.children),dt(t)}"string"!==typeof(n=r.children)&&"number"!==typeof n&&"bigint"!==typeof n||t.textContent===""+n||!0===r.suppressHydrationWarning||Qu(t.textContent,n)?(null!=r.popover&&(Mu("beforetoggle",t),Mu("toggle",t)),null!=r.onScroll&&Mu("scroll",t),null!=r.onScrollEnd&&Mu("scrollend",t),null!=r.onClick&&(t.onclick=$u),t=!0):t=!1,t||cs(e)}function ds(e){for(rs=e.return;rs;)switch(rs.tag){case 5:case 13:return void(os=!1);case 27:case 3:return void(os=!0);default:rs=rs.return}}function hs(e){if(e!==rs)return!1;if(!as)return ds(e),as=!0,!1;var t,n=e.tag;if((t=3!==n&&27!==n)&&((t=5===n)&&(t=!("form"!==(t=e.type)&&"button"!==t)||id(e.type,e.memoizedProps)),t=!t),t&&ss&&cs(e),ds(e),13===n){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(i(317));e:{for(e=e.nextSibling,n=0;e;){if(8===e.nodeType)if("/$"===(t=e.data)){if(0===n){ss=vd(e.nextSibling);break e}n--}else"$"!==t&&"$!"!==t&&"$?"!==t||n++;e=e.nextSibling}ss=null}}else 27===n?(n=ss,md(e.type)?(e=yd,yd=null,ss=e):ss=n):ss=rs?vd(e.stateNode.nextSibling):null;return!0}function ms(){ss=rs=null,as=!1}function ps(){var e=is;return null!==e&&(null===bc?bc=e:bc.push.apply(bc,e),is=null),e}function fs(e){null===is?is=[e]:is.push(e)}var gs=U(null),vs=null,ys=null;function bs(e,t,n){z(gs,t._currentValue),t._currentValue=n}function xs(e){e._currentValue=gs.current,V(gs)}function ws(e,t,n){for(;null!==e;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==r&&(r.childLanes|=t)):null!==r&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ns(e,t,n,r){var s=e.child;for(null!==s&&(s.return=e);null!==s;){var a=s.dependencies;if(null!==a){var o=s.child;a=a.firstContext;e:for(;null!==a;){var l=a;a=s;for(var c=0;c<t.length;c++)if(l.context===t[c]){a.lanes|=n,null!==(l=a.alternate)&&(l.lanes|=n),ws(a.return,n,e),r||(o=null);break e}a=l.next}}else if(18===s.tag){if(null===(o=s.return))throw Error(i(341));o.lanes|=n,null!==(a=o.alternate)&&(a.lanes|=n),ws(o,n,e),o=null}else o=s.child;if(null!==o)o.return=s;else for(o=s;null!==o;){if(o===e){o=null;break}if(null!==(s=o.sibling)){s.return=o.return,o=s;break}o=o.return}s=o}}function js(e,t,n,r){e=null;for(var s=t,a=!1;null!==s;){if(!a)if(0!==(524288&s.flags))a=!0;else if(0!==(262144&s.flags))break;if(10===s.tag){var o=s.alternate;if(null===o)throw Error(i(387));if(null!==(o=o.memoizedProps)){var l=s.type;Yn(s.pendingProps.value,o.value)||(null!==e?e.push(l):e=[l])}}else if(s===W.current){if(null===(o=s.alternate))throw Error(i(387));o.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(null!==e?e.push(Jd):e=[Jd])}s=s.return}null!==e&&Ns(t,e,n,r),t.flags|=262144}function Es(e){for(e=e.firstContext;null!==e;){if(!Yn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}
vendor: 19,933 bytes, line 2
2function Ss(e){vs=e,ys=null,null!==(e=e.dependencies)&&(e.firstContext=null)}function Cs(e){return _s(vs,e)}function ks(e,t){return null===vs&&Ss(e),_s(e,t)}function _s(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},null===ys){if(null===e)throw Error(i(308));ys=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ys=ys.next=t;return n}var As="undefined"!==typeof AbortController?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Ts=r.unstable_scheduleCallback,Is=r.unstable_NormalPriority,Ps={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Rs(){return{controller:new As,data:new Map,refCount:0}}function Ds(e){e.refCount--,0===e.refCount&&Ts(Is,function(){e.controller.abort()})}var Os=null,Ls=0,Ms=0,Fs=null;function Us(){if(0===--Ls&&null!==Os){null!==Fs&&(Fs.status="fulfilled");var e=Os;Os=null,Ms=0,Fs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}var Vs=D.S;D.S=function(e,t){"object"===typeof t&&null!==t&&"function"===typeof t.then&&function(e,t){if(null===Os){var n=Os=[];Ls=0,Ms=Au(),Fs={status:"pending",value:void 0,then:function(e){n.push(e)}}}Ls++,t.then(Us,Us)}(0,t),null!==Vs&&Vs(e,t)};var zs=U(null);function Bs(){var e=zs.current;return null!==e?e:rc.pooledCache}function qs(e,t){z(zs,null===t?zs.current:t.pool)}function Hs(){var e=Bs();return null===e?null:{parent:Ps._currentValue,pool:e}}var Ws=Error(i(460)),Gs=Error(i(474)),Ks=Error(i(542)),Js={then:function(){}};function Ys(e){return"fulfilled"===(e=e.status)||"rejected"===e}function Qs(){}function $s(e,t,n){switch(void 0===(n=e[n])?e.push(t):n!==t&&(t.then(Qs,Qs),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw ea(e=t.reason),e;default:if("string"===typeof t.status)t.then(Qs,Qs);else{if(null!==(e=rc)&&100<e.shellSuspendCounter)throw Error(i(482));(e=t).status="pending",e.then(function(e){if("pending"===t.status){var n=t;n.status="fulfilled",n.value=e}},function(e){if("pending"===t.status){var n=t;n.status="rejected",n.reason=e}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw ea(e=t.reason),e}throw Xs=t,Ws}}var Xs=null;function Zs(){if(null===Xs)throw Error(i(459));var e=Xs;return Xs=null,e}function ea(e){if(e===Ws||e===Ks)throw Error(i(483))}var ta=!1;function na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function sa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function aa(e,t,n){var r=e.updateQueue;if(null===r)return null;if(r=r.shared,0!==(2&nc)){var s=r.pending;return null===s?t.next=t:(t.next=s.next,s.next=t),r.pending=t,t=Rr(e),Pr(e,null,n),t}return Ar(e,r,t,n),Rr(e)}function ia(e,t,n){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194048&n))){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,ke(e,n)}}function oa(e,t){var n=e.updateQueue,r=e.alternate;if(null!==r&&n===(r=r.updateQueue)){var s=null,a=null;if(null!==(n=n.firstBaseUpdate)){do{var i={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};null===a?s=a=i:a=a.next=i,n=n.next}while(null!==n);null===a?s=a=t:a=a.next=t}else s=a=t;return n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},void(e.updateQueue=n)}null===(e=n.lastBaseUpdate)?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var la=!1;function ca(){if(la){if(null!==Fs)throw Fs}}function ua(e,t,n,r){la=!1;var s=e.updateQueue;ta=!1;var a=s.firstBaseUpdate,i=s.lastBaseUpdate,o=s.shared.pending;if(null!==o){s.shared.pending=null;var l=o,c=l.next;l.next=null,null===i?a=c:i.next=c,i=l;var u=e.alternate;null!==u&&((o=(u=u.updateQueue).lastBaseUpdate)!==i&&(null===o?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(null!==a){var d=s.baseState;for(i=0,u=c=l=null,o=a;;){var m=-536870913&o.lane,p=m!==o.lane;if(p?(ac&m)===m:(r&m)===m){0!==m&&m===Ms&&(la=!0),null!==u&&(u=u.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var f=e,g=o;m=t;var v=n;switch(g.tag){case 1:if("function"===typeof(f=g.payload)){d=f.call(v,d,m);break e}d=f;break e;case 3:f.flags=-65537&f.flags|128;case 0:if(null===(m="function"===typeof(f=g.payload)?f.call(v,d,m):f)||void 0===m)break e;d=h({},d,m);break e;case 2:ta=!0}}null!==(m=o.callback)&&(e.flags|=64,p&&(e.flags|=8192),null===(p=s.callbacks)?s.callbacks=[m]:p.push(m))}else p={lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},null===u?(c=u=p,l=d):u=u.next=p,i|=m;if(null===(o=o.next)){if(null===(o=s.shared.pending))break;o=(p=o).next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}null===u&&(l=d),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=u,null===a&&(s.shared.lanes=0),mc|=i,e.lanes=i,e.memoizedState=d}}function da(e,t){if("function"!==typeof e)throw Error(i(191,e));e.call(t)}function ha(e,t){var n=e.callbacks;if(null!==n)for(e.callbacks=null,e=0;e<n.length;e++)da(n[e],t)}var ma=U(null),pa=U(0);function fa(e,t){z(pa,e=dc),z(ma,t),dc=e|t.baseLanes}function ga(){z(pa,dc),z(ma,ma.current)}function va(){dc=pa.current,V(ma),V(pa)}var ya=0,ba=null,xa=null,wa=null,Na=!1,ja=!1,Ea=!1,Sa=0,Ca=0,ka=null,_a=0;function Aa(){throw Error(i(321))}function Ta(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Yn(e[n],t[n]))return!1;return!0}function Ia(e,t,n,r,s,a){return ya=a,ba=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=null===e||null===e.memoizedState?Wi:Gi,Ea=!1,a=n(r,s),Ea=!1,ja&&(a=Ra(t,n,r,s)),Pa(e),a}function Pa(e){D.H=Hi;var t=null!==xa&&null!==xa.next;if(ya=0,wa=xa=ba=null,Na=!1,Ca=0,ka=null,t)throw Error(i(300));null===e||ko||null!==(e=e.dependencies)&&Es(e)&&(ko=!0)}function Ra(e,t,n,r){ba=e;var s=0;do{if(ja&&(ka=null),Ca=0,ja=!1,25<=s)throw Error(i(301));if(s+=1,wa=xa=null,null!=e.updateQueue){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,null!=a.memoCache&&(a.memoCache.index=0)}D.H=Ki,a=t(n,r)}while(ja);return a}function Da(){var e=D.H,t=e.useState()[0];return t="function"===typeof t.then?Va(t):t,e=e.useState()[0],(null!==xa?xa.memoizedState:null)!==e&&(ba.flags|=1024),t}function Oa(){var e=0!==Sa;return Sa=0,e}function La(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ma(e){if(Na){for(e=e.memoizedState;null!==e;){var t=e.queue;null!==t&&(t.pending=null),e=e.next}Na=!1}ya=0,wa=xa=ba=null,ja=!1,Ca=Sa=0,ka=null}function Fa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===wa?ba.memoizedState=wa=e:wa=wa.next=e,wa}function Ua(){if(null===xa){var e=ba.alternate;e=null!==e?e.memoizedState:null}else e=xa.next;var t=null===wa?ba.memoizedState:wa.next;if(null!==t)wa=t,xa=e;else{if(null===e){if(null===ba.alternate)throw Error(i(467));throw Error(i(310))}e={memoizedState:(xa=e).memoizedState,baseState:xa.baseState,baseQueue:xa.baseQueue,queue:xa.queue,next:null},null===wa?ba.memoizedState=wa=e:wa=wa.next=e}return wa}function Va(e){var t=Ca;return Ca+=1,null===ka&&(ka=[]),e=$s(ka,e,t),t=ba,null===(null===wa?t.memoizedState:wa.next)&&(t=t.alternate,D.H=null===t||null===t.memoizedState?Wi:Gi),e}function za(e){if(null!==e&&"object"===typeof e){if("function"===typeof e.then)return Va(e);if(e.$$typeof===w)return Cs(e)}throw Error(i(438,String(e)))}function Ba(e){var t=null,n=ba.updateQueue;if(null!==n&&(t=n.memoCache),null==t){var r=ba.alternate;null!==r&&(null!==(r=r.updateQueue)&&(null!=(r=r.memoCache)&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(null==t&&(t={data:[],index:0}),null===n&&(n={lastEffect:null,events:null,stores:null,memoCache:null},ba.updateQueue=n),n.memoCache=t,void 0===(n=t.data[t.index]))for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=_;return t.index++,n}function qa(e,t){return"function"===typeof t?t(e):t}function Ha(e){return Wa(Ua(),xa,e)}function Wa(e,t,n){var r=e.queue;if(null===r)throw Error(i(311));r.lastRenderedReducer=n;var s=e.baseQueue,a=r.pending;if(null!==a){if(null!==s){var o=s.next;s.next=a.next,a.next=o}t.baseQueue=s=a,r.pending=null}if(a=e.baseState,null===s)e.memoizedState=a;else{var l=o=null,c=null,u=t=s.next,d=!1;do{var h=-536870913&u.lane;if(h!==u.lane?(ac&h)===h:(ya&h)===h){var m=u.revertLane;if(0===m)null!==c&&(c=c.next={lane:0,revertLane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),h===Ms&&(d=!0);else{if((ya&m)===m){u=u.next,m===Ms&&(d=!0);continue}h={lane:0,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=h,o=a):c=c.next=h,ba.lanes|=m,mc|=m}h=u.action,Ea&&n(a,h),a=u.hasEagerState?u.eagerState:n(a,h)}else m={lane:h,revertLane:u.revertLane,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},null===c?(l=c=m,o=a):c=c.next=m,ba.lanes|=h,mc|=h;u=u.next}while(null!==u&&u!==t);if(null===c?o=a:c.next=l,!Yn(a,e.memoizedState)&&(ko=!0,d&&null!==(n=Fs)))throw n;e.memoizedState=a,e.baseState=o,e.baseQueue=c,r.lastRenderedState=a}return null===s&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ga(e){var t=Ua(),n=t.queue;if(null===n)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,a=t.memoizedState;if(null!==s){n.pending=null;var o=s=s.next;do{a=e(a,o.action),o=o.next}while(o!==s);Yn(a,t.memoizedState)||(ko=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Ka(e,t,n){var r=ba,s=Ua(),a=as;if(a){if(void 0===n)throw Error(i(407));n=n()}else n=t();var o=!Yn((xa||s).memoizedState,n);if(o&&(s.memoizedState=n,ko=!0),s=s.queue,gi(2048,8,Qa.bind(null,r,s,e),[e]),s.getSnapshot!==t||o||null!==wa&&1&wa.memoizedState.tag){if(r.flags|=2048,mi(9,{destroy:void 0,resource:void 0},Ya.bind(null,r,s,n,t),null),null===rc)throw Error(i(349));a||0!==(124&ya)||Ja(r,t,n)}return n}function Ja(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},null===(t=ba.updateQueue)?(t={lastEffect:null,events:null,stores:null,memoCache:null},ba.updateQueue=t,t.stores=[e]):null===(n=t.stores)?t.stores=[e]:n.push(e)}function Ya(e,t,n,r){t.value=n,t.getSnapshot=r,$a(t)&&Xa(e)}function Qa(e,t,n){return n(function(){$a(t)&&Xa(e)})}function $a(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Yn(e,n)}catch(r){return!0}}function Xa(e){var t=Ir(e,2);null!==t&&Lc(t,e,2)}function Za(e){var t=Fa();if("function"===typeof e){var n=e;if(e=n(),Ea){he(!0);try{n()}finally{he(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:e},t}function ei(e,t,n,r){return e.baseState=n,Wa(e,xa,"function"===typeof r?r:qa)}function ti(e,t,n,r,s){if(zi(e))throw Error(i(485));if(null!==(e=t.action)){var a={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};null!==D.T?n(!0):a.isTransition=!1,r(a),null===(n=t.pending)?(a.next=t.pending=a,ni(t,a)):(a.next=n.next,t.pending=n.next=a)}}function ni(e,t){var n=t.action,r=t.payload,s=e.state;if(t.isTransition){var a=D.T,i={};D.T=i;try{var o=n(s,r),l=D.S;null!==l&&l(i,o),ri(e,t,o)}catch(c){ai(e,t,c)}finally{D.T=a}}else try{ri(e,t,a=n(s,r))}catch(u){ai(e,t,u)}}function ri(e,t,n){null!==n&&"object"===typeof n&&"function"===typeof n.then?n.then(function(n){si(e,t,n)},function(n){return ai(e,t,n)}):si(e,t,n)}function si(e,t,n){t.status="fulfilled",t.value=n,ii(t),e.state=n,null!==(t=e.pending)&&((n=t.next)===t?e.pending=null:(n=n.next,t.next=n,ni(e,n)))}function ai(e,t,n){var r=e.pending;if(e.pending=null,null!==r){r=r.next;do{t.status="rejected",t.reason=n,ii(t),t=t.next}while(t!==r)}e.action=null}function ii(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function oi(e,t){return t}function li(e,t){if(as){var n=rc.formState;if(null!==n){e:{var r=ba;if(as){if(ss){t:{for(var s=ss,a=os;8!==s.nodeType;){if(!a){s=null;break t}if(null===(s=vd(s.nextSibling))){s=null;break t}}s="F!"===(a=s.data)||"F"===a?s:null}if(s){ss=vd(s.nextSibling),r="F!"===s.data;break e}}cs(r)}r=!1}r&&(t=n[0])}}return(n=Fa()).memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:t},n.queue=r,n=Fi.bind(null,ba,r),r.dispatch=n,r=Za(!1),a=Vi.bind(null,ba,!1,r.queue),s={state:t,dispatch:null,action:e,pending:null},(r=Fa()).queue=s,n=ti.bind(null,ba,s,a,n),s.dispatch=n,r.memoizedState=e,[t,n,!1]}function ci(e){return ui(Ua(),xa,e)}function ui(e,t,n){if(t=Wa(e,t,oi)[0],e=Ha(qa)[0],"object"===typeof t&&null!==t&&"function"===typeof t.then)try{var r=Va(t)}catch(i){if(i===Ws)throw Ks;throw i}else r=t;var s=(t=Ua()).queue,a=s.dispatch;return n!==t.memoizedState&&(ba.flags|=2048,mi(9,{destroy:void 0,resource:void 0},di.bind(null,s,n),null)),[r,a,e]}function di(e,t){e.action=t}function hi(e){var t=Ua(),n=xa;if(null!==n)return ui(t,n,e);Ua(),t=t.memoizedState;var r=(n=Ua()).queue.dispatch;return n.memoizedState=e,[t,r,!1]}function mi(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},null===(t=ba.updateQueue)&&(t={lastEffect:null,events:null,stores:null,memoCache:null},ba.updateQueue=t),null===(n=t.lastEffect)?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function pi(){return Ua().memoizedState}function fi(e,t,n,r){var s=Fa();r=void 0===r?null:r,ba.flags|=e,s.memoizedState=mi(1|t,{destroy:void 0,resource:void 0},n,r)}function gi(e,t,n,r){var s=Ua();r=void 0===r?null:r;var a=s.memoizedState.inst;null!==xa&&null!==r&&Ta(r,xa.memoizedState.deps)?s.memoizedState=mi(t,a,n,r):(ba.flags|=e,s.memoizedState=mi(1|t,a,n,r))}function vi(e,t){fi(8390656,8,e,t)}function yi(e,t){gi(2048,8,e,t)}function bi(e,t){return gi(4,2,e,t)}function xi(e,t){return gi(4,4,e,t)}function wi(e,t){if("function"===typeof t){e=e();var n=t(e);return function(){"function"===typeof n?n():t(null)}}if(null!==t&&void 0!==t)return e=e(),t.current=e,function(){t.current=null}}function Ni(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,gi(4,4,wi.bind(null,t,e),n)}function ji(){}function Ei(e,t){var n=Ua();t=void 0===t?null:t;var r=n.memoizedState;return null!==t&&Ta(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Si(e,t){var n=Ua();t=void 0===t?null:t;var r=n.memoizedState;if(null!==t&&Ta(t,r[1]))return r[0];if(r=e(),Ea){he(!0);try{e()}finally{he(!1)}}return n.memoizedState=[r,t],r}function Ci(e,t,n){return void 0===n||0!==(1073741824&ya)?e.memoizedState=t:(e.memoizedState=n,e=Oc(),ba.lanes|=e,mc|=e,n)}function ki(e,t,n,r){return Yn(n,t)?n:null!==ma.current?(e=Ci(e,n,r),Yn(e,t)||(ko=!0),e):0===(42&ya)?(ko=!0,e.memoizedState=n):(e=Oc(),ba.lanes|=e,mc|=e,t)}function _i(e,t,n,r,s){var a=O.p;O.p=0!==a&&8>a?a:8;var i=D.T,o={};D.T=o,Vi(e,!1,t,n);try{var l=s(),c=D.S;if(null!==c&&c(o,l),null!==l&&"object"===typeof l&&"function"===typeof l.then)Ui(e,t,function(e,t){var n=[],r={status:"pending",value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status="rejected",r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}(l,r),Dc());else Ui(e,t,r,Dc())}catch(u){Ui(e,t,{then:function(){},status:"rejected",reason:u},Dc())}finally{O.p=a,D.T=i}}function Ai(){}function Ti(e,t,n,r){if(5!==e.tag)throw Error(i(476));var s=Ii(e).queue;_i(e,s,t,L,null===n?Ai:function(){return Pi(e),n(r)})}function Ii(e){var t=e.memoizedState;if(null!==t)return t;var n={};return(t={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:L},next:null}).next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:n},next:null},e.memoizedState=t,null!==(e=e.alternate)&&(e.memoizedState=t),t}function Pi(e){Ui(e,Ii(e).next.queue,{},Dc())}function Ri(){return Cs(Jd)}function Di(){return Ua().memoizedState}function Oi(){return Ua().memoizedState}function Li(e){for(var t=e.return;null!==t;){switch(t.tag){case 24:case 3:var n=Dc(),r=aa(t,e=sa(n),n);return null!==r&&(Lc(r,t,n),ia(r,t,n)),t={cache:Rs()},void(e.payload=t)}t=t.return}}function Mi(e,t,n){var r=Dc();n={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null},zi(e)?Bi(t,n):null!==(n=Tr(e,t,n,r))&&(Lc(n,e,r),qi(n,t,r))}function Fi(e,t,n){Ui(e,t,n,Dc())}function Ui(e,t,n,r){var s={lane:r,revertLane:0,action:n,hasEagerState:!1,eagerState:null,next:null};if(zi(e))Bi(t,s);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&null!==(a=t.lastRenderedReducer))try{var i=t.lastRenderedState,o=a(i,n);if(s.hasEagerState=!0,s.eagerState=o,Yn(o,i))return Ar(e,t,s,0),null===rc&&_r(),!1}catch(l){}if(null!==(n=Tr(e,t,s,r)))return Lc(n,e,r),qi(n,t,r),!0}return!1}function Vi(e,t,n,r){if(r={lane:2,revertLane:Au(),action:r,hasEagerState:!1,eagerState:null,next:null},zi(e)){if(t)throw Error(i(479))}else null!==(t=Tr(e,n,r,2))&&Lc(t,e,2)}function zi(e){var t=e.alternate;return e===ba||null!==t&&t===ba}function Bi(e,t){ja=Na=!0;var n=e.pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qi(e,t,n){if(0!==(4194048&n)){var r=t.lanes;n|=r&=e.pendingLanes,t.lanes=n,ke(e,n)}}var Hi={readContext:Cs,use:za,useCallback:Aa,useContext:Aa,useEffect:Aa,useImperativeHandle:Aa,useLayoutEffect:Aa,useInsertionEffect:Aa,useMemo:Aa,useReducer:Aa,useRef:Aa,useState:Aa,useDebugValue:Aa,useDeferredValue:Aa,useTransition:Aa,useSyncExternalStore:Aa,useId:Aa,useHostTransitionStatus:Aa,useFormState:Aa,useActionState:Aa,useOptimistic:Aa,useMemoCache:Aa,useCacheRefresh:Aa},Wi={readContext:Cs,use:za,useCallback:function(e,t){return Fa().memoizedState=[e,void 0===t?null:t],e},useContext:Cs,useEffect:vi,useImperativeHandle:function(e,t,n){n=null!==n&&void 0!==n?n.concat([e]):null,fi(4194308,4,wi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fi(4194308,4,e,t)},useInsertionEffect:function(e,t){fi(4,2,e,t)},useMemo:function(e,t){var n=Fa();t=void 0===t?null:t;var r=e();if(Ea){he(!0);try{e()}finally{he(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Fa();if(void 0!==n){var s=n(t);if(Ea){he(!0);try{n(t)}finally{he(!1)}}}else s=t;return r.memoizedState=r.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},r.queue=e,e=e.dispatch=Mi.bind(null,ba,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},Fa().memoizedState=e},useState:function(e){var t=(e=Za(e)).queue,n=Fi.bind(null,ba,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ji,useDeferredValue:function(e,t){return Ci(Fa(),e,t)},useTransition:function(){var e=Za(!1);return e=_i.bind(null,ba,e.queue,!0,!1),Fa().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ba,s=Fa();if(as){if(void 0===n)throw Error(i(407));n=n()}else{if(n=t(),null===rc)throw Error(i(349));0!==(124&ac)||Ja(r,t,n)}s.memoizedState=n;var a={value:n,getSnapshot:t};return s.queue=a,vi(Qa.bind(null,r,a,e),[e]),r.flags|=2048,mi(9,{destroy:void 0,resource:void 0},Ya.bind(null,r,a,n,t),null),n},useId:function(){var e=Fa(),t=rc.identifierPrefix;if(as){var n=Xr;t="\xab"+t+"R"+(n=($r&~(1<<32-me($r)-1)).toString(32)+n),0<(n=Sa++)&&(t+="H"+n.toString(32)),t+="\xbb"}else t="\xab"+t+"r"+(n=_a++).toString(32)+"\xbb";return e.memoizedState=t},useHostTransitionStatus:Ri,useFormState:li,useActionState:li,useOptimistic:function(e){var t=Fa();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Vi.bind(null,ba,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ba,useCacheRefresh:function(){return Fa().memoizedState=Li.bind(null,ba)}},Gi={readContext:Cs,use:za,useCallback:Ei,useContext:Cs,useEffect:yi,useImperativeHandle:Ni,useInsertionEffect:bi,useLayoutEffect:xi,useMemo:Si,useReducer:Ha,useRef
2:pi,useState:function(){return Ha(qa)},useDebugValue:ji,useDeferredValue:function(e,t){return ki(Ua(),xa.memoizedState,e,t)},useTransition:function(){var e=Ha(qa)[0],t=Ua().memoizedState;return["boolean"===typeof e?e:Va(e),t]},useSyncExternalStore:Ka,useId:Di,useHostTransitionStatus:Ri,useFormState:ci,useActionState:ci,useOptimistic:function(e,t){return ei(Ua(),0,e,t)},useMemoCache:Ba,useCacheRefresh:Oi},Ki={readContext:Cs,use:za,useCallback:Ei,useContext:Cs,useEffect:yi,useImperativeHandle:Ni,useInsertionEffect:bi,useLayoutEffect:xi,useMemo:Si,useReducer:Ga,useRef:pi,useState:function(){return Ga(qa)},useDebugValue:ji,useDeferredValue:function(e,t){var n=Ua();return null===xa?Ci(n,e,t):ki(n,xa.memoizedState,e,t)},useTransition:function(){var e=Ga(qa)[0],t=Ua().memoizedState;return["boolean"===typeof e?e:Va(e),t]},useSyncExternalStore:Ka,useId:Di,useHostTransitionStatus:Ri,useFormState:hi,useActionState:hi,useOptimistic:function(e,t){var n=Ua();return null!==xa?ei(n,0,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Ba,useCacheRefresh:Oi},Ji=null,Yi=0;function Qi(e){var t=Yi;return Yi+=1,null===Ji&&(Ji=[]),$s(Ji,e,t)}function $i(e,t){t=t.props.ref,e.ref=void 0!==t?t:null}function Xi(e,t){if(t.$$typeof===m)throw Error(i(525));throw e=Object.prototype.toString.call(t),Error(i(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Zi(e){return(0,e._init)(e._payload)}function eo(e){function t(t,n){if(e){var r=t.deletions;null===r?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;null!==r;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;null!==e;)null!==e.key?t.set(e.key,e):t.set(e.index,e),e=e.sibling;return t}function s(e,t){return(e=Fr(e,t)).index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?null!==(r=t.alternate)?(r=r.index)<n?(t.flags|=67108866,n):r:(t.flags|=67108866,n):(t.flags|=1048576,n)}function o(t){return e&&null===t.alternate&&(t.flags|=67108866),t}function l(e,t,n,r){return null===t||6!==t.tag?((t=Br(n,e.mode,r)).return=e,t):((t=s(t,n)).return=e,t)}function c(e,t,n,r){var a=n.type;return a===g?d(e,t,n.props.children,r,n.key):null!==t&&(t.elementType===a||"object"===typeof a&&null!==a&&a.$$typeof===C&&Zi(a)===t.type)?($i(t=s(t,n.props),n),t.return=e,t):($i(t=Vr(n.type,n.key,n.props,null,e.mode,r),n),t.return=e,t)}function u(e,t,n,r){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=qr(n,e.mode,r)).return=e,t):((t=s(t,n.children||[])).return=e,t)}function d(e,t,n,r,a){return null===t||7!==t.tag?((t=zr(n,e.mode,r,a)).return=e,t):((t=s(t,n)).return=e,t)}function h(e,t,n){if("string"===typeof t&&""!==t||"number"===typeof t||"bigint"===typeof t)return(t=Br(""+t,e.mode,n)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case p:return $i(n=Vr(t.type,t.key,t.props,null,e.mode,n),t),n.return=e,n;case f:return(t=qr(t,e.mode,n)).return=e,t;case C:return h(e,t=(0,t._init)(t._payload),n)}if(R(t)||T(t))return(t=zr(t,e.mode,n,null)).return=e,t;if("function"===typeof t.then)return h(e,Qi(t),n);if(t.$$typeof===w)return h(e,ks(e,t),n);Xi(e,t)}return null}function m(e,t,n,r){var s=null!==t?t.key:null;if("string"===typeof n&&""!==n||"number"===typeof n||"bigint"===typeof n)return null!==s?null:l(e,t,""+n,r);if("object"===typeof n&&null!==n){switch(n.$$typeof){case p:return n.key===s?c(e,t,n,r):null;case f:return n.key===s?u(e,t,n,r):null;case C:return m(e,t,n=(s=n._init)(n._payload),r)}if(R(n)||T(n))return null!==s?null:d(e,t,n,r,null);if("function"===typeof n.then)return m(e,t,Qi(n),r);if(n.$$typeof===w)return m(e,t,ks(e,n),r);Xi(e,n)}return null}function v(e,t,n,r,s){if("string"===typeof r&&""!==r||"number"===typeof r||"bigint"===typeof r)return l(t,e=e.get(n)||null,""+r,s);if("object"===typeof r&&null!==r){switch(r.$$typeof){case p:return c(t,e=e.get(null===r.key?n:r.key)||null,r,s);case f:return u(t,e=e.get(null===r.key?n:r.key)||null,r,s);case C:return v(e,t,n,r=(0,r._init)(r._payload),s)}if(R(r)||T(r))return d(t,e=e.get(n)||null,r,s,null);if("function"===typeof r.then)return v(e,t,n,Qi(r),s);if(r.$$typeof===w)return v(e,t,n,ks(t,r),s);Xi(t,r)}return null}function y(l,c,u,d){if("object"===typeof u&&null!==u&&u.type===g&&null===u.key&&(u=u.props.children),"object"===typeof u&&null!==u){switch(u.$$typeof){case p:e:{for(var b=u.key;null!==c;){if(c.key===b){if((b=u.type)===g){if(7===c.tag){n(l,c.sibling),(
vendor: 3,099 bytes, line 2
2d=s(c,u.props.children)).return=l,l=d;break e}}else if(c.elementType===b||"object"===typeof b&&null!==b&&b.$$typeof===C&&Zi(b)===c.type){n(l,c.sibling),$i(d=s(c,u.props),u),d.return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}u.type===g?((d=zr(u.props.children,l.mode,d,u.key)).return=l,l=d):($i(d=Vr(u.type,u.key,u.props,null,l.mode,d),u),d.return=l,l=d)}return o(l);case f:e:{for(b=u.key;null!==c;){if(c.key===b){if(4===c.tag&&c.stateNode.containerInfo===u.containerInfo&&c.stateNode.implementation===u.implementation){n(l,c.sibling),(d=s(c,u.children||[])).return=l,l=d;break e}n(l,c);break}t(l,c),c=c.sibling}(d=qr(u,l.mode,d)).return=l,l=d}return o(l);case C:return y(l,c,u=(b=u._init)(u._payload),d)}if(R(u))return function(s,i,o,l){for(var c=null,u=null,d=i,p=i=0,f=null;null!==d&&p<o.length;p++){d.index>p?(f=d,d=null):f=d.sibling;var g=m(s,d,o[p],l);if(null===g){null===d&&(d=f);break}e&&d&&null===g.alternate&&t(s,d),i=a(g,i,p),null===u?c=g:u.sibling=g,u=g,d=f}if(p===o.length)return n(s,d),as&&Zr(s,p),c;if(null===d){for(;p<o.length;p++)null!==(d=h(s,o[p],l))&&(i=a(d,i,p),null===u?c=d:u.sibling=d,u=d);return as&&Zr(s,p),c}for(d=r(d);p<o.length;p++)null!==(f=v(d,s,p,o[p],l))&&(e&&null!==f.alternate&&d.delete(null===f.key?p:f.key),i=a(f,i,p),null===u?c=f:u.sibling=f,u=f);return e&&d.forEach(function(e){return t(s,e)}),as&&Zr(s,p),c}(l,c,u,d);if(T(u)){if("function"!==typeof(b=T(u)))throw Error(i(150));return function(s,o,l,c){if(null==l)throw Error(i(151));for(var u=null,d=null,p=o,f=o=0,g=null,y=l.next();null!==p&&!y.done;f++,y=l.next()){p.index>f?(g=p,p=null):g=p.sibling;var b=m(s,p,y.value,c);if(null===b){null===p&&(p=g);break}e&&p&&null===b.alternate&&t(s,p),o=a(b,o,f),null===d?u=b:d.sibling=b,d=b,p=g}if(y.done)return n(s,p),as&&Zr(s,f),u;if(null===p){for(;!y.done;f++,y=l.next())null!==(y=h(s,y.value,c))&&(o=a(y,o,f),null===d?u=y:d.sibling=y,d=y);return as&&Zr(s,f),u}for(p=r(p);!y.done;f++,y=l.next())null!==(y=v(p,s,f,y.value,c))&&(e&&null!==y.alternate&&p.delete(null===y.key?f:y.key),o=a(y,o,f),null===d?u=y:d.sibling=y,d=y);return e&&p.forEach(function(e){return t(s,e)}),as&&Zr(s,f),u}(l,c,u=b.call(u),d)}if("function"===typeof u.then)return y(l,c,Qi(u),d);if(u.$$typeof===w)return y(l,c,ks(l,u),d);Xi(l,u)}return"string"===typeof u&&""!==u||"number"===typeof u||"bigint"===typeof u?(u=""+u,null!==c&&6===c.tag?(n(l,c.sibling),(d=s(c,u)).return=l,l=d):(n(l,c),(d=Br(u,l.mode,d)).return=l,l=d),o(l)):n(l,c)}return function(e,t,n,r){try{Yi=0;var s=y(e,t,n,r);return Ji=null,s}catch(i){if(i===Ws||i===Ks)throw i;var a=Lr(29,i,null,e.mode);return a.lanes=r,a.return=e,a}}}var to=eo(!0),no=eo(!1),ro=U(null),so=null;function ao(e){var t=e.alternate;z(co,1&co.current),z(ro,e),null===so&&(null===t||null!==ma.current||null!==t.memoizedState)&&(so=e)}function io(e){if(22===e.tag){if(z(co,co.current),z(ro,e),null===so){var t=e.alternate;null!==t&&null!==t.memoizedState&&(so=e)}}else oo()}function oo(){z(co,co.current),z(ro,ro.current)}function lo(e){V(ro),so===e&&(so=null),V(co)}var co=U(0);function uo(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;
2if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||gd(n)))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function ho(e,t,n,r){n=null===(n=n(r,t=e.memoizedState))||void 0===n?t:h({},t,n),e.memoizedState=n,0===e.lanes&&(e.updateQueue.baseState=n)}var mo={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Dc(),s=sa(r);s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=aa(e,s,r))&&(Lc(t,e,r),ia(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Dc(),s=sa(r);s.tag=1,s.payload=t,void 0!==n&&null!==n&&(s.callback=n),null!==(t=aa(e,s,r))&&(Lc(t,e,r),ia(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Dc(),r=sa(n);r.tag=2,void 0!==t&&null!==t&&(r.callback=t),null!==(t=aa(e,r,n))&&(Lc(t,e,n),ia(t,e,n))}};function po(e,t,n,r,s,a,i){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(r,a,i):!t.prototype||!t.prototype.isPureReactComponent||(!Qn(n,r)||!Qn(s,a))}function fo(e,t,n,r){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&mo.enqueueReplaceState(t,t.state,null)}function go(e,t){var n=t;if("ref"in t)for(var r in n={},t)"ref"!==r&&(n[r]=t[r]);if(e=e.defaultProps)for(var s in n===t&&(n=h({},n)),e)void 0===n[s]&&(n[s]=e[s]);return n}var vo="function"===typeof reportError?reportError:function(e){if("object"===typeof window&&"function"===typeof window.ErrorEvent){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:"object"===typeof e&&null!==e&&"string"===typeof e.message?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if("object"===typeof process&&"function"===typeof process.emit)return void process.emit("uncaughtException",e);console.error(e)};function yo(e){vo(e)}function bo(e){console.error(e)}function xo(e){vo(e)}function wo(e,t){try{(0,e.onUncaughtError)(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function No(e,t,n){try{(0,e.onCaughtError)(n.value,{componentStack:n.stack,errorBoundary:1===t.tag?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function jo(e,t,n){return(n=sa(n)).tag=3,n.payload={element:null},n.callback=function(){wo(e,t)},n}function Eo(e){return(e=sa(e)).tag=3,e}function So(e,t,n,r){var s=n.type.getDerivedStateFromError;if("function"===typeof s){var a=r.value;e.payload=function(){return s(a)},e.callback=function(){No(t,n,r)}}var i=n.stateNode;null!==i&&"function"===typeof i.componentDidCatch&&(e.callback=function(){No(t,n,r),"function"!==typeof s&&(null===Ec?Ec=new Set([this]):Ec.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:null!==e?e:""})})}var Co=Error(i(461)),ko=!1;function _o(e,t,n,r){t.child=null===e?no(t,null,n,r):to(t,e.child,n,r)}function Ao(e,t,n,r,s){n=n.render;var a=t.ref;if("ref"in r){var i={};for(var o in r)"ref"!==o&&(i[o]=r[o])}else i=r;return Ss(t),r=Ia(e,t,n,i,a,s),o=Oa(),null===e||ko?(as&&o&&ts(t),t.flags|=1,_o(e,t,r,s),t.child):(La(e,t,s),Yo(e,t,s))}function To(e,t,n,r,s){if(null===e){var a=n.type;return"function"!==typeof a||Mr(a)||void 0!==a.defaultProps||null!==n.compare?((e=Vr(n.type,null,r,t,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Io(e,t,a,r,s))}if(a=e.child,!Qo(e,s)){var i=a.memoizedProps;if((n=null!==(n=n.compare)?n:Qn)(i,r)&&e.ref===t.ref)return Yo(e,t,s)}return t.flags|=1,(e=Fr(a,r)).ref=t.ref,e.return=t,t.child=e}function Io(e,t,n,r,s){if(null!==e){var a=e.memoizedProps;if(Qn(a,r)&&e.ref===t.ref){if(ko=!1,t.pendingProps=r=a,!Qo(e,s))return t.lanes=e.lanes,Yo(e,t,s);0!==(131072&e.flags)&&(ko=!0)}}return Oo(e,t,n,r,s)}function Po(e,t,n){var r=t.pendingProps,s=r.children,a=null!==e?e.memoizedState:null;if("hidden"===r.mode){if(0!==(128&t.flags)){if(r=null!==a?a.baseLanes|n:n,null!==e){for(s=t.child=e.child,a=0;null!==s;)a=a|s.lanes|s.childLanes,s=s.sibling;t.childLanes=a&~r}else t.childLanes=0,t.child=null;return Ro(e,t,r,n)}if(0===(536870912&n))return t.lanes=t.childLanes=536870912,Ro(e,t,null!==a?a.baseLanes|n:n,n);t.memoizedState={baseLanes:0,cachePool:null},null!==e&&qs(0,null!==a?a.cachePool:null),null!==a?fa(t,a):ga(),io(t)}else null!==a?(qs(0,a.cachePool),fa(t,a),oo(),t.memoizedState=null):(null!==e&&qs(0,null),ga(),oo());return _o(e,t,s,n),t.child}function Ro(e,t,n,r){var s=Bs();return s=null===s?null:{parent:Ps._currentValue,pool:s},t.memoizedState={baseLanes:n,cachePool:s},null!==e&&qs(0,null),ga(),io(t),null!==e&&js(e,t,r,!0),null}function Do(e,t){var n=t.ref;if(null===n)null!==e&&null!==e.ref&&(t.flags|=4194816);else{if("function"!==typeof n&&"object"!==typeof n)throw Error(i(284));null!==e&&e.ref===n||(t.flags|=4194816)}}
2function Oo(e,t,n,r,s){return Ss(t),n=Ia(e,t,n,r,void 0,s),r=Oa(),null===e||ko?(as&&r&&ts(t),t.flags|=1,_o(e,t,n,s),t.child):(La(e,t,s),Yo(e,t,s))}function Lo(e,t,n,r,s,a){return Ss(t),t.updateQueue=null,n=Ra(t,r,n,s),Pa(e),r=Oa(),null===e||ko?(as&&r&&ts(t),t.flags|=1,_o(e,t,n,a),t.child):(La(e,t,a),Yo(e,t,a))}function Mo(e,t,n,r,s){if(Ss(t),null===t.stateNode){var a=Dr,i=n.contextType;"object"===typeof i&&null!==i&&(a=Cs(i)),a=new n(r,a),t.memoizedState=null!==a.state&&void 0!==a.state?a.state:null,a.updater=mo,t.stateNode=a,a._reactInternals=t,(a=t.stateNode).props=r,a.state=t.memoizedState,a.refs={},na(t),i=n.contextType,a.context="object"===typeof i&&null!==i?Cs(i):Dr,a.state=t.memoizedState,"function"===typeof(i=n.getDerivedStateFromProps)&&(ho(t,n,i,r),a.state=t.memoizedState),"function"===typeof n.getDerivedStateFromProps||"function"===typeof a.getSnapshotBeforeUpdate||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||(i=a.state,"function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount(),i!==a.state&&mo.enqueueReplaceState(a,a.state,null),ua(t,r,a,s),ca(),a.state=t.memoizedState),"function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!0}else if(null===e){a=t.stateNode;var o=t.memoizedProps,l=go(n,o);a.props=l;var c=a.context,u=n.contextType;i=Dr,"object"===typeof u&&null!==u&&(i=Cs(u));var d=n.getDerivedStateFromProps;u="function"===typeof d||"function"===typeof a.getSnapshotBeforeUpdate,o=t.pendingProps!==o,u||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(o||c!==i)&&fo(t,a,r,i),ta=!1;var h=t.memoizedState;a.state=h,ua(t,r,a,s),ca(),c=t.memoizedState,o||h!==c||ta?("function"===typeof d&&(ho(t,n,d,r),c=t.memoizedState),(l=ta||po(t,n,l,r,h,c,i))?(u||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=i,r=l):("function"===typeof a.componentDidMount&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,ra(e,t),u=go(n,i=t.memoizedProps),a.props=u,d=t.pendingProps,h=a.context,c=n.contextType,l=Dr,"object"===typeof c&&null!==c&&(l=Cs(c)),(c="function"===typeof(o=n.getDerivedStateFromProps)||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(i!==d||h!==l)&&fo(t,a,r,l),ta=!1,h=t.memoizedState,a.state=h,ua(t,r,a,s),ca();var m=t.memoizedState;i!==d||h!==m||ta||null!==e&&null!==e.dependencies&&Es(e.dependencies)?("function"===typeof o&&(ho(t,n,o,r),m=t.memoizedState),(u=ta||po(t,n,u,r,h,m,l)||null!==e&&null!==e.dependencies&&Es(e.dependencies))?(c||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(r,m,l),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(r,m,l)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),a.props=r,a.state=m,a.context=l,r=u):("function"!==typeof a.componentDidUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||i===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Do(e,t),r=0!==(128&t.flags),a||r?(a=t.stateNode,n=r&&"function"!==typeof n.getDerivedStateFromError?null:a.render(),t.flags|=1,null!==e&&r?(t.child=to(t,e.child,null,s),t.child=to(t,null,n,s)):_o(e,t,n,s),t.memoizedState=a.state,e=t.child):e=Yo(e,t,s),e}function Fo(e,t,n,r){return ms(),t.flags|=256,_o(e,t,n,r),t.child}var Uo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vo(e){return{baseLanes:e,cachePool:Hs()}}function zo(e,t,n){return e=null!==e?e.childLanes&~n:0,t&&(e|=gc),e}
vendor: 9,018 bytes, line 2
2function Bo(e,t,n){var r,s=t.pendingProps,a=!1,o=0!==(128&t.flags);if((r=o)||(r=(null===e||null!==e.memoizedState)&&0!==(2&co.current)),r&&(a=!0,t.flags&=-129),r=0!==(32&t.flags),t.flags&=-33,null===e){if(as){if(a?ao(t):oo(),as){var l,c=ss;if(l=c){e:{for(l=c,c=os;8!==l.nodeType;){if(!c){c=null;break e}if(null===(l=vd(l.nextSibling))){c=null;break e}}c=l}null!==c?(t.memoizedState={dehydrated:c,treeContext:null!==Qr?{id:$r,overflow:Xr}:null,retryLane:536870912,hydrationErrors:null},(l=Lr(18,null,null,0)).stateNode=c,l.return=t,t.child=l,rs=t,ss=null,l=!0):l=!1}l||cs(t)}if(null!==(c=t.memoizedState)&&null!==(c=c.dehydrated))return gd(c)?t.lanes=32:t.lanes=536870912,null;lo(t)}return c=s.children,s=s.fallback,a?(oo(),c=Ho({mode:"hidden",children:c},a=t.mode),s=zr(s,a,n,null),c.return=t,s.return=t,c.sibling=s,t.child=c,(a=t.child).memoizedState=Vo(n),a.childLanes=zo(e,r,n),t.memoizedState=Uo,s):(ao(t),qo(t,c))}if(null!==(l=e.memoizedState)&&null!==(c=l.dehydrated)){if(o)256&t.flags?(ao(t),t.flags&=-257,t=Wo(e,t,n)):null!==t.memoizedState?(oo(),t.child=e.child,t.flags|=128,t=null):(oo(),a=s.fallback,c=t.mode,s=Ho({mode:"visible",children:s.children},c),(a=zr(a,c,n,null)).flags|=2,s.return=t,a.return=t,s.sibling=a,t.child=s,to(t,e.child,null,n),(s=t.child).memoizedState=Vo(n),s.childLanes=zo(e,r,n),t.memoizedState=Uo,t=a);else if(ao(t),gd(c)){if(r=c.nextSibling&&c.nextSibling.dataset)var u=r.dgst;r=u,(s=Error(i(419))).stack="",s.digest=r,fs({value:s,source:null,stack:null}),t=Wo(e,t,n)}else if(ko||js(e,t,n,!1),r=0!==(n&e.childLanes),ko||r){if(null!==(r=rc)&&(0!==(s=0!==((s=0!==(42&(s=n&-n))?1:_e(s))&(r.suspendedLanes|n))?0:s)&&s!==l.retryLane))throw l.retryLane=s,Ir(e,s),Lc(r,e,s),Co;"$?"===c.data||Kc(),t=Wo(e,t,n)}else"$?"===c.data?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ss=vd(c.nextSibling),rs=t,as=!0,is=null,os=!1,null!==e&&(Jr[Yr++]=$r,Jr[Yr++]=Xr,Jr[Yr++]=Qr,$r=e.id,Xr=e.overflow,Qr=t),(t=qo(t,s.children)).flags|=4096);return t}return a?(oo(),a=s.fallback,c=t.mode,u=(l=e.child).sibling,(s=Fr(l,{mode:"hidden",children:s.children})).subtreeFlags=65011712&l.subtreeFlags,null!==u?a=Fr(u,a):(a=zr(a,c,n,null)).flags|=2,a.return=t,s.return=t,s.sibling=a,t.child=s,s=a,a=t.child,null===(c=e.child.memoizedState)?c=Vo(n):(null!==(l=c.cachePool)?(u=Ps._currentValue,l=l.parent!==u?{parent:u,pool:u}:l):l=Hs(),c={baseLanes:c.baseLanes|n,cachePool:l}),a.memoizedState=c,a.childLanes=zo(e,r,n),t.memoizedState=Uo,s):(ao(t),e=(n=e.child).sibling,(n=Fr(n,{mode:"visible",children:s.children})).return=t,n.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n)}function qo(e,t){return(t=Ho({mode:"visible",children:t},e.mode)).return=e,e.child=t}function Ho(e,t){return(e=Lr(22,e,null,t)).lanes=0,e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},e}function Wo(e,t,n){return to(t,e.child,null,n),(e=qo(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function Go(e,t,n){e.lanes|=t;var r=e.alternate;null!==r&&(r.lanes|=t),ws(e.return,t,n)}function Ko(e,t,n,r,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=s)}function Jo(e,t,n){var r=t.pendingProps,s=r.revealOrder,a=r.tail;if(_o(e,t,r.children,n),0!==(2&(r=co.current)))r=1&r|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Go(e,n,t);else if(19===e.tag)Go(e,n,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}switch(z(co,r),s){case"forwards":for(n=t.child,s=null;null!==n;)null!==(e=n.alternate)&&null===uo(e)&&(s=n),n=n.sibling;null===(n=s)?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Ko(t,!1,s,n,a);break;case"backwards":for(n=null,s=t.child,t.child=null;null!==s;){if(null!==(e=s.alternate)&&null===uo(e)){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Ko(t,!0,n,null,a);break;case"together":Ko(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Yo(e,t,n){if(null!==e&&(t.dependencies=e.dependencies),mc|=t.lanes,0===(n&t.childLanes)){if(null===e)return null;if(js(e,t,n,!1),0===(n&t.childLanes))return null}if(null!==e&&t.child!==e.child)throw Error(i(153));if(null!==t.child){for(n=Fr(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=Fr(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Qo(e,t){return 0!==(e.lanes&t)||!(null===(e=e.dependencies)||!Es(e))}function $o(e,t,n){if(null!==e)if(e.memoizedProps!==t.pendingProps)ko=!0;else{if(!Qo(e,n)&&0===(128&t.flags))return ko=!1,function(e,t,n){switch(t.tag){case 3:G(t,t.stateNode.containerInfo),bs(0,Ps,e.memoizedState.cache),ms();break;case 27:case 5:J(t);break;case 4:G(t,t.stateNode.containerInfo);break;case 10:bs(0,t.type,t.memoizedProps.value);break;case 13:var r=t.memoizedState;if(null!==r)return null!==r.dehydrated?(ao(t),t.flags|=128,null):0!==(n&t.child.childLanes)?Bo(e,t,n):(ao(t),null!==(e=Yo(e,t,n))?e.sibling:null);ao(t);break;case 19:var s=0!==(128&e.flags);if((r=0!==(n&t.childLanes))||(js(e,t,n,!1),r=0!==(n&t.childLanes)),s){if(r)return Jo(e,t,n);t.flags|=128}if(null!==(s=t.memoizedState)&&(s.rendering=null,s.tail=null,s.lastEffect=null),z(co,co.current),r)break;return null;case 22:case 23:return t.lanes=0,Po(e,t,n);case 24:bs(0,Ps,e.memoizedState.cache)}return Yo(e,t,n)}(e,t,n);ko=0!==(131072&e.flags)}else ko=!1,as&&0!==(1048576&t.flags)&&es(t,Kr,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var r=t.elementType,s=r._init;if(r=s(r._payload),t.type=r,"function"!==typeof r){if(void 0!==r&&null!==r){if((s=r.$$typeof)===N){t.tag=11,t=Ao(null,t,r,e,n);break e}if(s===S){t.tag=14,t=To(null,t,r,e,n);break e}}throw t=P(r)||r,Error(i(306,t,""))}Mr(r)?(e=go(r,e),t.tag=1,t=Mo(null,t,r,e,n)):(t.tag=0,t=Oo(null,t,r,e,n))}return t;case 0:return Oo(e,t,t.type,t.pendingProps,n);case 1:return Mo(e,t,r=t.type,s=go(r,t.pendingProps),n);case 3:e:{if(G(t,t.stateNode.containerInfo),null===e)throw Error(i(387));r=t.pendingProps;var a=t.memoizedState;s=a.element,ra(e,t),ua(t,r,null,n);var o=t.memoizedState;if(r=o.cache,bs(0,Ps,r),r!==a.cache&&Ns(t,[Ps],n,!0),ca(),r=o.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:o.cache},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Fo(e,t,r,n);break e}if(r!==s){fs(s=Er(Error(i(424)),t)),t=Fo(e,t,r,n);break e}if(9===(e=t.stateNode.containerInfo).nodeType)e=e.body;else e="HTML"===e.nodeName?e.ownerDocument.body:e;for(ss=vd(e.firstChild),rs=t,as=!0,is=null,os=!0,n=no(t,null,r,n),t.child=n;n;)n.flags=-3&n.flags|4096,n=n.sibling}else{if(ms(),r===s){t=Yo(e,t,n);break e}_o(e,t,r,n)}t=t.child}return t;case 26:return Do(e,t),null===e?(n=_d(t.type,null,t.pendingProps,null))?t.memoizedState=n:as||(n=t.type,e=t.pendingProps,(r=rd(H.current).createElement(n))[Pe]=t,r[Re]=e,ed(r,n,e),We(r),t.stateNode=r):t.memoizedState=_d(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return J(t),null===e&&as&&(r=t.stateNode=xd(t.type,t.pendingProps,H.current),rs=t,os=!0,s=ss,md(t.type)?(yd=s,ss=vd(r.firstChild)):ss=s),_o(e,t,t.pendingProps.children,n),Do(e,t),null===e&&(t.flags|=4194304),t.child;case 5:return null===e&&as&&((s=r=ss)&&(null!==(r=function(e,t,n,r){for(;1===e.nodeType;){var s=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&("INPUT"!==e.nodeName||"hidden"!==e.type))break}else if(r){if(!e[Ue])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if("stylesheet"===(a=e.getAttribute("rel"))&&e.hasAttribute("data-precedence"))break;if(a!==s.rel||e.getAttribute("href")!==(null==s.href||""===s.href?null:s.href)||e.getAttribute("crossorigin")!==(null==s.crossOrigin?null:s.crossOrigin)||e.getAttribute("title")!==(null==s.title?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(((a=e.getAttribute("src"))!==(null==s.src?null:s.src)||e.getAttribute("type")!==(null==s.type?null:s.type)||e.getAttribute("crossorigin")!==(null==s.crossOrigin?null:s.crossOrigin))&&a&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else{if("input"!==t||"hidden"!==e.type)return e;var a=null==s.name?null:""+s.name;if("hidden"===s.type&&e.getAttribute("name")===a)return e}if(null===(e=vd(e.nextSibling)))break}return null}(r,t.type,t.pendingProps,os))?(t.stateNode=r,rs=t,ss=vd(r.firstChild),os=!1,s=!0):s=!1),s||cs(t)),J(t),s=t.type,a=t.pendingProps,o=null!==e?e.memoizedProps:null,r=a.children,id(s,a)?r=null:null!==o&&id(s,o)&&(t.flags|=32),null!==t.memoizedState&&(s=Ia(e,t,Da,null,null,n),Jd._currentValue=s),Do(e,t),_o(e,t,r,n),t.child;case 6:return null===e&&as&&((e=n=ss)&&(null!==(n=function(e,t,n){if(""===t)return null;for(;3!==e.nodeType;
vendor: 9,407 bytes, line 2
2){if((1!==e.nodeType||"INPUT"!==e.nodeName||"hidden"!==e.type)&&!n)return null;if(null===(e=vd(e.nextSibling)))return null}return e}(n,t.pendingProps,os))?(t.stateNode=n,rs=t,ss=null,e=!0):e=!1),e||cs(t)),null;case 13:return Bo(e,t,n);case 4:return G(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=to(t,null,r,n):_o(e,t,r,n),t.child;case 11:return Ao(e,t,t.type,t.pendingProps,n);case 7:return _o(e,t,t.pendingProps,n),t.child;case 8:case 12:return _o(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,bs(0,t.type,r.value),_o(e,t,r.children,n),t.child;case 9:return s=t.type._context,r=t.pendingProps.children,Ss(t),r=r(s=Cs(s)),t.flags|=1,_o(e,t,r,n),t.child;case 14:return To(e,t,t.type,t.pendingProps,n);case 15:return Io(e,t,t.type,t.pendingProps,n);case 19:return Jo(e,t,n);case 31:return r=t.pendingProps,n=t.mode,r={mode:r.mode,children:r.children},null===e?((n=Ho(r,n)).ref=t.ref,t.child=n,n.return=t,t=n):((n=Fr(e.child,r)).ref=t.ref,t.child=n,n.return=t,t=n),t;case 22:return Po(e,t,n);case 24:return Ss(t),r=Cs(Ps),null===e?(null===(s=Bs())&&(s=rc,a=Rs(),s.pooledCache=a,a.refCount++,null!==a&&(s.pooledCacheLanes|=n),s=a),t.memoizedState={parent:r,cache:s},na(t),bs(0,Ps,s)):(0!==(e.lanes&n)&&(ra(e,t),ua(t,null,null,n),ca()),s=e.memoizedState,a=t.memoizedState,s.parent!==r?(s={parent:r,cache:r},t.memoizedState=s,0===t.lanes&&(t.memoizedState=t.updateQueue.baseState=s),bs(0,Ps,r)):(r=a.cache,bs(0,Ps,r),r!==s.cache&&Ns(t,[Ps],n,!0))),_o(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Xo(e){e.flags|=4}function Zo(e,t){if("stylesheet"!==t.type||0!==(4&t.state.loading))e.flags&=-16777217;else if(e.flags|=16777216,!zd(t)){if(null!==(t=ro.current)&&((4194048&ac)===ac?null!==so:(62914560&ac)!==ac&&0===(536870912&ac)||t!==so))throw Xs=Js,Gs;e.flags|=8192}}function el(e,t){null!==t&&(e.flags|=4),16384&e.flags&&(t=22!==e.tag?je():536870912,e.lanes|=t,vc|=t)}function tl(e,t){if(!as)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;null!==n;)null!==n.alternate&&(r=n),n=n.sibling;null===r?t||null===e.tail?e.tail=null:e.tail.sibling=null:r.sibling=null}}function nl(e){var t=null!==e.alternate&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;null!==s;)n|=s.lanes|s.childLanes,r|=65011712&s.subtreeFlags,r|=65011712&s.flags,s.return=e,s=s.sibling;else for(s=e.child;null!==s;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function rl(e,t,n){var r=t.pendingProps;switch(ns(t),t.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:case 1:return nl(t),null;case 3:return n=t.stateNode,r=null,null!==e&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xs(Ps),K(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(hs(t)?Xo(t):null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,ps())),nl(t),null;case 26:return n=t.memoizedState,null===e?(Xo(t),null!==n?(nl(t),Zo(t,n)):(nl(t),t.flags&=-16777217)):n?n!==e.memoizedState?(Xo(t),nl(t),Zo(t,n)):(nl(t),t.flags&=-16777217):(e.memoizedProps!==r&&Xo(t),nl(t),t.flags&=-16777217),null;case 27:Y(t),n=H.current;var s=t.type;if(null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return nl(t),null}e=B.current,hs(t)?us(t):(e=xd(s,r,n),t.stateNode=e,Xo(t))}return nl(t),null;case 5:if(Y(t),n=t.type,null!==e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if(!r){if(null===t.stateNode)throw Error(i(166));return nl(t),null}if(e=B.current,hs(t))us(t);else{switch(s=rd(H.current),e){case 1:e=s.createElementNS("http://www.w3.org/2000/svg",n);break;case 2:e=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;default:switch(n){case"svg":e=s.createElementNS("http://www.w3.org/2000/svg",n);break;case"math":e=s.createElementNS("http://www.w3.org/1998/Math/MathML",n);break;case"script":(e=s.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e="string"===typeof r.is?s.createElement("select",{is:r.is}):s.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"===typeof r.is?s.createElement(n,{is:r.is}):s.createElement(n)}}e[Pe]=t,e[Re]=r;e:for(s=t.child;null!==s;){if(5===s.tag||6===s.tag)e.appendChild(s.stateNode);else if(4!==s.tag&&27!==s.tag&&null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break e;for(;null===s.sibling;){if(null===s.return||s.return===t)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=e;e:switch(ed(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&Xo(t)}}return nl(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&Xo(t);else{if("string"!==typeof r&&null===t.stateNode)throw Error(i(166));if(e=H.current,hs(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,null!==(s=rs))switch(s.tag){case 27:case 5:r=s.memoizedProps}e[Pe]=t,(e=!!(e.nodeValue===n||null!==r&&!0===r.suppressHydrationWarning||Qu(e.nodeValue,n)))||cs(t)}else(e=rd(e).createTextNode(r))[Pe]=t,t.stateNode=e}return nl(t),null;case 13:if(r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(s=hs(t),null!==r&&null!==r.dehydrated){if(null===e){if(!s)throw Error(i(318));if(!(s=null!==(s=t.memoizedState)?s.dehydrated:null))throw Error(i(317));s[Pe]=t}else ms(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;nl(t),s=!1}else s=ps(),null!==e&&null!==e.memoizedState&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return 256&t.flags?(lo(t),t):(lo(t),null)}if(lo(t),0!==(128&t.flags))return t.lanes=n,t;if(n=null!==r,e=null!==e&&null!==e.memoizedState,n){s=null,null!==(r=t.child).alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(s=r.alternate.memoizedState.cachePool.pool);var a=null;null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==s&&(r.flags|=2048)}return n!==e&&n&&(t.child.flags|=8192),el(t,t.updateQueue),nl(t),null;case 4:return K(),null===e&&Vu(t.stateNode.containerInfo),nl(t),null;case 10:return xs(t.type),nl(t),null;case 19:if(V(co),null===(s=t.memoizedState))return nl(t),null;if(r=0!==(128&t.flags),null===(a=s.rendering))if(r)tl(s,!1);else{if(0!==hc||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=uo(e))){for(t.flags|=128,tl(s,!1),e=a.updateQueue,t.updateQueue=e,el(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)Ur(n,e),n=n.sibling;return z(co,1&co.current|2),t.child}e=e.sibling}null!==s.tail&&te()>Nc&&(t.flags|=128,r=!0,tl(s,!1),t.lanes=4194304)}else{if(!r)if(null!==(e=uo(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,el(t,e),tl(s,!0),null===s.tail&&"hidden"===s.tailMode&&!a.alternate&&!as)return nl(t),null}else 2*te()-s.renderingStartTime>Nc&&536870912!==n&&(t.flags|=128,r=!0,tl(s,!1),t.lanes=4194304);s.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=s.last)?e.sibling=a:t.child=a,s.last=a)}return null!==s.tail?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=te(),t.sibling=null,e=co.current,z(co,r?1&e|2:1&e),t):(nl(t),null);case 22:case 23:return lo(t),va(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?0!==(536870912&n)&&0===(128&t.flags)&&(nl(t),6&t.subtreeFlags&&(t.flags|=8192)):nl(t),null!==(n=t.updateQueue)&&el(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&V(zs),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xs(Ps),nl(t),null;case 25:case 30:return null}throw Error(i(156,t.tag))}function sl(e,t){switch(ns(t),t.tag){case 1:return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return xs(Ps),K(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 26:case 27:case 5:return Y(t),null;case 13:if(lo(t),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(i(340));ms()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return V(co),null;case 4:return K(),null;case 10:return xs(t.type),null;case 22:case 23:return lo(t),va(),null!==e&&V(zs),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 24:return xs(Ps),null;default:return null}}function al(e,t){switch(ns(t),t.tag){case 3:xs(Ps),K();break;case 26:case 27:case 5:Y(t);break;case 4:K();break;case 13:lo(t);break;case 19:V(co);break;case 10:xs(t.type);break;case 22:case 23:lo(t),va(),null!==e&&V(zs);break;case 24:xs(Ps)}}function il(e,t){try{var n=t.updateQueue,r=null!==n?n.lastEffect:null;if(null!==r){var s=r.next;n=s;do{if((n.tag&e)===e){r=void 0;var a=n.create,i=n.inst;r=a(),i.destroy=r}n=n.next}while(n!==s)}}catch(o){uu(t,t.return,o)}}function ol(e,t,n){try{var r=t.updateQueue,s=null!==r?r.lastEffect:null;if(null!==s){var a=s.next;r=a;do{if((r.tag&e)===e){var i=r.inst,o=i.destroy;if(void 0!==o){i.destroy=void 0,s=t;var l=n,c=o;try{c()}catch(u){uu(s,l,u)}}}r=r.next}
vendor: 4,339 bytes, line 2
2while(r!==a)}}catch(u){uu(t,t.return,u)}}function ll(e){var t=e.updateQueue;if(null!==t){var n=e.stateNode;try{ha(t,n)}catch(r){uu(e,e.return,r)}}}function cl(e,t,n){n.props=go(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(r){uu(e,t,r)}}function ul(e,t){try{var n=e.ref;if(null!==n){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;default:r=e.stateNode}"function"===typeof n?e.refCleanup=n(r):n.current=r}}catch(s){uu(e,t,s)}}function dl(e,t){var n=e.ref,r=e.refCleanup;if(null!==n)if("function"===typeof r)try{r()}catch(s){uu(e,t,s)}finally{e.refCleanup=null,null!=(e=e.alternate)&&(e.refCleanup=null)}else if("function"===typeof n)try{n(null)}catch(a){uu(e,t,a)}else n.current=null}function hl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&r.focus();break e;case"img":n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(s){uu(e,e.return,s)}}function ml(e,t,n){try{var r=e.stateNode;!function(e,t,n,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,a=null,o=null,l=null,c=null,u=null,d=null;for(p in n){var h=n[p];if(n.hasOwnProperty(p)&&null!=h)switch(p){case"checked":case"value":break;case"defaultValue":c=h;default:r.hasOwnProperty(p)||Xu(e,t,p,null,r,h)}}for(var m in r){var p=r[m];if(h=n[m],r.hasOwnProperty(m)&&(null!=p||null!=h))switch(m){case"type":a=p;break;case"name":s=p;break;case"checked":u=p;break;case"defaultChecked":d=p;break;case"value":o=p;break;case"defaultValue":l=p;break;case"children":case"dangerouslySetInnerHTML":if(null!=p)throw Error(i(137,t));break;default:p!==h&&Xu(e,t,m,p,r,h)}}return void gt(e,o,l,c,u,d,a,s);case"select":for(a in p=o=l=m=null,n)if(c=n[a],n.hasOwnProperty(a)&&null!=c)switch(a){case"value":break;case"multiple":p=c;default:r.hasOwnProperty(a)||Xu(e,t,a,null,r,c)}for(s in r)if(a=r[s],c=n[s],r.hasOwnProperty(s)&&(null!=a||null!=c))switch(s){case"value":m=a;break;case"defaultValue":l=a;break;case"multiple":o=a;default:a!==c&&Xu(e,t,s,a,r,c)}return t=l,n=o,r=p,void(null!=m?bt(e,!!n,m,!1):!!r!==!!n&&(null!=t?bt(e,!!n,t,!0):bt(e,!!n,n?[]:"",!1)));case"textarea":for(l in p=m=null,n)if(s=n[l],n.hasOwnProperty(l)&&null!=s&&!r.hasOwnProperty(l))switch(l){case"value":case"children":break;default:Xu(e,t,l,null,r,s)}for(o in r)if(s=r[o],a=n[o],r.hasOwnProperty(o)&&(null!=s||null!=a))switch(o){case"value":m=s;break;case"defaultValue":p=s;break;case"children":break;case"dangerouslySetInnerHTML":if(null!=s)throw Error(i(91));break;default:s!==a&&Xu(e,t,o,s,r,a)}return void xt(e,m,p);case"option":for(var f in n)if(m=n[f],n.hasOwnProperty(f)&&null!=m&&!r.hasOwnProperty(f))if("selected"===f)e.selected=!1;else Xu(e,t,f,null,r,m);for(c in r)if(m=r[c],p=n[c],r.hasOwnProperty(c)&&m!==p&&(null!=m||null!=p))if("selected"===c)e.selected=m&&"function"!==typeof m&&"symbol"!==typeof m;else Xu(e,t,c,m,r,p);return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var g in n)m=n[g],n.hasOwnProperty(g)&&null!=m&&!r.hasOwnProperty(g)&&Xu(e,t,g,null,r,m);for(u in r)if(m=r[u],p=n[u],r.hasOwnProperty(u)&&m!==p&&(null!=m||null!=p))switch(u){case"children":case"dangerouslySetInnerHTML":if(null!=m)throw Error(i(137,t));break;default:Xu(e,t,u,m,r,p)}return;default:if(Ct(t)){for(var v in n)m=n[v],n.hasOwnProperty(v)&&void 0!==m&&!r.hasOwnProperty(v)&&Zu(e,t,v,void 0,r,m);for(d in r)m=r[d],p=n[d],!r.hasOwnProperty(d)||m===p||void 0===m&&void 0===p||Zu(e,t,d,m,r,p);return}}for(var y in n)m=n[y],n.hasOwnProperty(y)&&null!=m&&!r.hasOwnProperty(y)&&Xu(e,t,y,null,r,m);for(h in r)m=r[h],p=n[h],!r.hasOwnProperty(h)||m===p||null==m&&null==p||Xu(e,t,h,m,r,p)}(r,e.type,n,t),r[Re]=t}catch(s){uu(e,e.return,s)}}function pl(e){return 5===e.tag||3===e.tag||26===e.tag||27===e.tag&&md(e.type)||4===e.tag}function fl(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||pl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(27===e.tag&&md(e.type))continue e;if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function gl(e,t,n){var r=e.tag;
vendor: 23,187 bytes, line 2
2if(5===r||6===r)e=e.stateNode,t?(9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).insertBefore(e,t):((t=9===n.nodeType?n.body:"HTML"===n.nodeName?n.ownerDocument.body:n).appendChild(e),null!==(n=n._reactRootContainer)&&void 0!==n||null!==t.onclick||(t.onclick=$u));else if(4!==r&&(27===r&&md(e.type)&&(n=e.stateNode,t=null),null!==(e=e.child)))for(gl(e,t,n),e=e.sibling;null!==e;)gl(e,t,n),e=e.sibling}function vl(e,t,n){var r=e.tag;if(5===r||6===r)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==r&&(27===r&&md(e.type)&&(n=e.stateNode),null!==(e=e.child)))for(vl(e,t,n),e=e.sibling;null!==e;)vl(e,t,n),e=e.sibling}function yl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);ed(t,r,n),t[Pe]=e,t[Re]=n}catch(a){uu(e,e.return,a)}}var bl=!1,xl=!1,wl=!1,Nl="function"===typeof WeakSet?WeakSet:Set,jl=null;function El(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Ml(e,n),4&r&&il(5,n);break;case 1:if(Ml(e,n),4&r)if(e=n.stateNode,null===t)try{e.componentDidMount()}catch(i){uu(n,n.return,i)}else{var s=go(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(o){uu(n,n.return,o)}}64&r&&ll(n),512&r&&ul(n,n.return);break;case 3:if(Ml(e,n),64&r&&null!==(e=n.updateQueue)){if(t=null,null!==n.child)switch(n.child.tag){case 27:case 5:case 1:t=n.child.stateNode}try{ha(e,t)}catch(i){uu(n,n.return,i)}}break;case 27:null===t&&4&r&&yl(n);case 26:case 5:Ml(e,n),null===t&&4&r&&hl(n),512&r&&ul(n,n.return);break;case 12:Ml(e,n);break;case 13:Ml(e,n),4&r&&Tl(e,n),64&r&&(null!==(e=n.memoizedState)&&(null!==(e=e.dehydrated)&&function(e,t){var n=e.ownerDocument;if("$?"!==e.data||"complete"===n.readyState)t();else{var r=function(){t(),n.removeEventListener("DOMContentLoaded",r)};n.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}(e,n=pu.bind(null,n))));break;case 22:if(!(r=null!==n.memoizedState||bl)){t=null!==t&&null!==t.memoizedState||xl,s=bl;var a=xl;bl=r,(xl=t)&&!a?Ul(e,n,0!==(8772&n.subtreeFlags)):Ml(e,n),bl=s,xl=a}break;case 30:break;default:Ml(e,n)}}function Sl(e){var t=e.alternate;null!==t&&(e.alternate=null,Sl(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&Ve(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Cl=null,kl=!1;function _l(e,t,n){for(n=n.child;null!==n;)Al(e,t,n),n=n.sibling}function Al(e,t,n){if(de&&"function"===typeof de.onCommitFiberUnmount)try{de.onCommitFiberUnmount(ue,n)}catch(a){}switch(n.tag){case 26:xl||dl(n,t),_l(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode).parentNode.removeChild(n);break;case 27:xl||dl(n,t);var r=Cl,s=kl;md(n.type)&&(Cl=n.stateNode,kl=!1),_l(e,t,n),wd(n.stateNode),Cl=r,kl=s;break;case 5:xl||dl(n,t);case 6:if(r=Cl,s=kl,Cl=null,_l(e,t,n),kl=s,null!==(Cl=r))if(kl)try{(9===Cl.nodeType?Cl.body:"HTML"===Cl.nodeName?Cl.ownerDocument.body:Cl).removeChild(n.stateNode)}catch(i){uu(n,t,i)}else try{Cl.removeChild(n.stateNode)}catch(i){uu(n,t,i)}break;case 18:null!==Cl&&(kl?(pd(9===(e=Cl).nodeType?e.body:"HTML"===e.nodeName?e.ownerDocument.body:e,n.stateNode),kh(e)):pd(Cl,n.stateNode));break;case 4:r=Cl,s=kl,Cl=n.stateNode.containerInfo,kl=!0,_l(e,t,n),Cl=r,kl=s;break;case 0:case 11:case 14:case 15:xl||ol(2,n,t),xl||ol(4,n,t),_l(e,t,n);break;case 1:xl||(dl(n,t),"function"===typeof(r=n.stateNode).componentWillUnmount&&cl(n,t,r)),_l(e,t,n);break;case 21:_l(e,t,n);break;case 22:xl=(r=xl)||null!==n.memoizedState,_l(e,t,n),xl=r;break;default:_l(e,t,n)}}function Tl(e,t){if(null===t.memoizedState&&(null!==(e=t.alternate)&&(null!==(e=e.memoizedState)&&null!==(e=e.dehydrated))))try{kh(e)}catch(n){uu(t,t.return,n)}}function Il(e,t){var n=function(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return null===t&&(t=e.stateNode=new Nl),t;case 22:return null===(t=(e=e.stateNode)._retryCache)&&(t=e._retryCache=new Nl),t;default:throw Error(i(435,e.tag))}}(e);t.forEach(function(t){var r=fu.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}function Pl(e,t){var n=t.deletions;if(null!==n)for(var r=0;r<n.length;r++){var s=n[r],a=e,o=t,l=o;e:for(;null!==l;){switch(l.tag){case 27:if(md(l.type)){Cl=l.stateNode,kl=!1;break e}break;case 5:Cl=l.stateNode,kl=!1;break e;case 3:case 4:Cl=l.stateNode.containerInfo,kl=!0;break e}l=l.return}if(null===Cl)throw Error(i(160));Al(a,o,s),Cl=null,kl=!1,null!==(a=s.alternate)&&(a.return=null),s.return=null}if(13878&t.subtreeFlags)for(t=t.child;null!==t;)Dl(t,e),t=t.sibling}var Rl=null;function Dl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Pl(t,e),Ol(e),4&r&&(ol(3,e,e.return),il(3,e),ol(5,e,e.return));break;case 1:Pl(t,e),Ol(e),512&r&&(xl||null===n||dl(n,n.return)),64&r&&bl&&(null!==(e=e.updateQueue)&&(null!==(r=e.callbacks)&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=null===n?r:n.concat(r))));break;case 26:var s=Rl;if(Pl(t,e),Ol(e),512&r&&(xl||null===n||dl(n,n.return)),4&r){var a=null!==n?n.memoizedState:null;if(r=e.memoizedState,null===n)if(null===r)if(null===e.stateNode){e:{r=e.type,n=e.memoizedProps,s=s.ownerDocument||s;t:switch(r){case"title":(!(a=s.getElementsByTagName("title")[0])||a[Ue]||a[Pe]||"http://www.w3.org/2000/svg"===a.namespaceURI||a.hasAttribute("itemprop"))&&(a=s.createElement(r),s.head.insertBefore(a,s.querySelector("head > title"))),ed(a,r,n),a[Pe]=e,We(a),r=a;break e;case"link":var o=Ud("link","href",s).get(r+(n.href||""));if(o)for(var l=0;l<o.length;l++)if((a=o[l]).getAttribute("href")===(null==n.href||""===n.href?null:n.href)&&a.getAttribute("rel")===(null==n.rel?null:n.rel)&&a.getAttribute("title")===(null==n.title?null:n.title)&&a.getAttribute("crossorigin")===(null==n.crossOrigin?null:n.crossOrigin)){o.splice(l,1);break t}ed(a=s.createElement(r),r,n),s.head.appendChild(a);break;case"meta":if(o=Ud("meta","content",s).get(r+(n.content||"")))for(l=0;l<o.length;l++)if((a=o[l]).getAttribute("content")===(null==n.content?null:""+n.content)&&a.getAttribute("name")===(null==n.name?null:n.name)&&a.getAttribute("property")===(null==n.property?null:n.property)&&a.getAttribute("http-equiv")===(null==n.httpEquiv?null:n.httpEquiv)&&a.getAttribute("charset")===(null==n.charSet?null:n.charSet)){o.splice(l,1);break t}ed(a=s.createElement(r),r,n),s.head.appendChild(a);break;default:throw Error(i(468,r))}a[Pe]=e,We(a),r=a}e.stateNode=r}else Vd(s,e.type,e.stateNode);else e.stateNode=Dd(s,r,e.memoizedProps);else a!==r?(null===a?null!==n.stateNode&&(n=n.stateNode).parentNode.removeChild(n):a.count--,null===r?Vd(s,e.type,e.stateNode):Dd(s,r,e.memoizedProps)):null===r&&null!==e.stateNode&&ml(e,e.memoizedProps,n.memoizedProps)}break;case 27:Pl(t,e),Ol(e),512&r&&(xl||null===n||dl(n,n.return)),null!==n&&4&r&&ml(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Pl(t,e),Ol(e),512&r&&(xl||null===n||dl(n,n.return)),32&e.flags){s=e.stateNode;try{Nt(s,"")}catch(p){uu(e,e.return,p)}}4&r&&null!=e.stateNode&&ml(e,s=e.memoizedProps,null!==n?n.memoizedProps:s),1024&r&&(wl=!0);break;case 6:if(Pl(t,e),Ol(e),4&r){if(null===e.stateNode)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(p){uu(e,e.return,p)}}break;case 3:if(Fd=null,s=Rl,Rl=Ed(t.containerInfo),Pl(t,e),Rl=s,Ol(e),4&r&&null!==n&&n.memoizedState.isDehydrated)try{kh(t.containerInfo)}catch(p){uu(e,e.return,p)}wl&&(wl=!1,Ll(e));break;case 4:r=Rl,Rl=Ed(e.stateNode.containerInfo),Pl(t,e),Ol(e),Rl=r;break;case 12:default:Pl(t,e),Ol(e);break;case 13:Pl(t,e),Ol(e),8192&e.child.flags&&null!==e.memoizedState!==(null!==n&&null!==n.memoizedState)&&(wc=te()),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Il(e,r)));break;case 22:s=null!==e.memoizedState;var c=null!==n&&null!==n.memoizedState,u=bl,d=xl;if(bl=u||s,xl=d||c,Pl(t,e),xl=d,bl=u,Ol(e),8192&r)e:for(t=e.stateNode,t._visibility=s?-2&t._visibility:1|t._visibility,s&&(null===n||c||bl||xl||Fl(e)),n=null,t=e;;){if(5===t.tag||26===t.tag){if(null===n){c=n=t;try{if(a=c.stateNode,s)"function"===typeof(o=a.style).setProperty?o.setProperty("display","none","important"):o.display="none";else{l=c.stateNode;var h=c.memoizedProps.style,m=void 0!==h&&null!==h&&h.hasOwnProperty("display")?h.display:null;l.style.display=null==m||"boolean"===typeof m?"":(""+m).trim()}}catch(p){uu(c,c.return,p)}}}else if(6===t.tag){if(null===n){c=t;try{c.stateNode.nodeValue=s?"":c.memoizedProps}catch(p){uu(c,c.return,p)}}}else if((22!==t.tag&&23!==t.tag||null===t.memoizedState||t===e)&&null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;null===t.sibling;){if(null===t.return||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}4&r&&(null!==(r=e.updateQueue)&&(null!==(n=r.retryQueue)&&(r.retryQueue=null,Il(e,n))));break;case 19:Pl(t,e),Ol(e),4&r&&(null!==(r=e.updateQueue)&&(e.updateQueue=null,Il(e,r)));case 30:case 21:}}function Ol(e){var t=e.flags;if(2&t){try{for(var n,r=e.return;null!==r;){if(pl(r)){n=r;break}r=r.return}if(null==n)throw Error(i(160));switch(n.tag){case 27:var s=n.stateNode;vl(e,fl(e),s);break;case 5:var a=n.stateNode;32&n.flags&&(Nt(a,""),n.flags&=-33),vl(e,fl(e),a);break;case 3:case 4:var o=n.stateNode.containerInfo;gl(e,fl(e),o);break;default:throw Error(i(161))}}catch(l){uu(e,e.return,l)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function Ll(e){if(1024&e.subtreeFlags)for(e=e.child;null!==e;){var t=e;Ll(t),5===t.tag&&1024&t.flags&&t.stateNode.reset(),e=e.sibling}}function Ml(e,t){if(8772&t.subtreeFlags)for(t=t.child;null!==t;)El(e,t.alternate,t),t=t.sibling}function Fl(e){for(e=e.child;null!==e;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ol(4,t,t.return),Fl(t);break;case 1:dl(t,t.return);var n=t.stateNode;"function"===typeof n.componentWillUnmount&&cl(t,t.return,n),Fl(t);break;case 27:wd(t.stateNode);case 26:case 5:dl(t,t.return),Fl(t);break;case 22:null===t.memoizedState&&Fl(t);break;default:Fl(t)}e=e.sibling}}function Ul(e,t,n){for(n=n&&0!==(8772&t.subtreeFlags),t=t.child;null!==t;){var r=t.alternate,s=e,a=t,i=a.flags;switch(a.tag){case 0:case 11:case 15:Ul(s,a,n),il(4,a);break;case 1:if(Ul(s,a,n),"function"===typeof(s=(r=a).stateNode).componentDidMount)try{s.componentDidMount()}catch(c){uu(r,r.return,c)}if(null!==(s=(r=a).updateQueue)){var o=r.stateNode;try{var l=s.shared.hiddenCallbacks;if(null!==l)for(s.shared.hiddenCallbacks=null,s=0;s<l.length;s++)da(l[s],o)}catch(c){uu(r,r.return,c)}}n&&64&i&&ll(a),ul(a,a.return);break;case 27:yl(a);case 26:case 5:Ul(s,a,n),n&&null===r&&4&i&&hl(a),ul(a,a.return);break;case 12:Ul(s,a,n);break;case 13:Ul(s,a,n),n&&4&i&&Tl(s,a);break;case 22:null===a.memoizedState&&Ul(s,a,n),ul(a,a.return);break;case 30:break;default:Ul(s,a,n)}t=t.sibling}}function Vl(e,t){var n=null;null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),e=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(e=t.memoizedState.cachePool.pool),e!==n&&(null!=e&&e.refCount++,null!=n&&Ds(n))}function zl(e,t){e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ds(e))}function Bl(e,t,n,r){if(10256&t.subtreeFlags)for(t=t.child;null!==t;)ql(e,t,n,r),t=t.sibling}function ql(e,t,n,r){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Bl(e,t,n,r),2048&s&&il(9,t);break;case 1:case 13:default:Bl(e,t,n,r);break;case 3:Bl(e,t,n,r),2048&s&&(e=null,null!==t.alternate&&(e=t.alternate.memoizedState.cache),(t=t.memoizedState.cache)!==e&&(t.refCount++,null!=e&&Ds(e)));break;case 12:if(2048&s){Bl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,i=a.id,o=a.onPostCommit;"function"===typeof o&&o(i,null===t.alternate?"mount":"update",e.passiveEffectDuration,-0)}catch(l){uu(t,t.return,l)}}else Bl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,i=t.alternate,null!==t.memoizedState?2&a._visibility?Bl(e,t,n,r):Wl(e,t):2&a._visibility?Bl(e,t,n,r):(a._visibility|=2,Hl(e,t,n,r,0!==(10256&t.subtreeFlags))),2048&s&&Vl(i,t);break;case 24:Bl(e,t,n,r),2048&s&&zl(t.alternate,t)}}function Hl(e,t,n,r,s){for(s=s&&0!==(10256&t.subtreeFlags),t=t.child;null!==t;){var a=e,i=t,o=n,l=r,c=i.flags;switch(i.tag){case 0:case 11:case 15:Hl(a,i,o,l,s),il(8,i);break;case 23:break;case 22:var u=i.stateNode;null!==i.memoizedState?2&u._visibility?Hl(a,i,o,l,s):Wl(a,i):(u._visibility|=2,Hl(a,i,o,l,s)),s&&2048&c&&Vl(i.alternate,i);break;case 24:Hl(a,i,o,l,s),s&&2048&c&&zl(i.alternate,i);break;default:Hl(a,i,o,l,s)}t=t.sibling}}function Wl(e,t){if(10256&t.subtreeFlags)for(t=t.child;null!==t;){var n=e,r=t,s=r.flags;switch(r.tag){case 22:Wl(n,r),2048&s&&Vl(r.alternate,r);break;case 24:Wl(n,r),2048&s&&zl(r.alternate,r);break;default:Wl(n,r)}t=t.sibling}}var Gl=8192;function Kl(e){if(e.subtreeFlags&Gl)for(e=e.child;null!==e;)Jl(e),e=e.sibling}function Jl(e){switch(e.tag){case 26:Kl(e),e.flags&Gl&&null!==e.memoizedState&&function(e,t,n){if(null===Bd)throw Error(i(475));var r=Bd;if("stylesheet"===t.type&&("string"!==typeof n.media||!1!==matchMedia(n.media).matches)&&0===(4&t.state.loading)){if(null===t.instance){var s=Ad(n.href),a=e.querySelector(Td(s));if(a)return null!==(e=a._p)&&"object"===typeof e&&"function"===typeof e.then&&(r.count++,r=Hd.bind(r),e.then(r,r)),t.state.loading|=4,t.instance=a,void We(a);a=e.ownerDocument||e,n=Id(n),(s=Nd.get(s))&&Ld(n,s),We(a=a.createElement("link"));var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ed(a,"link",n),t.instance=a}null===r.stylesheets&&(r.stylesheets=new Map),r.stylesheets.set(t,e),(e=t.state.preload)&&0===(3&t.state.loading)&&(r.count++,t=Hd.bind(r),e.addEventListener("load",t),e.addEventListener("error",t))}}(Rl,e.memoizedState,e.memoizedProps);break;case 5:default:Kl(e);break;case 3:case 4:var t=Rl;Rl=Ed(e.stateNode.containerInfo),Kl(e),Rl=t;break;case 22:null===e.memoizedState&&(null!==(t=e.alternate)&&null!==t.memoizedState?(t=Gl,Gl=16777216,Kl(e),Gl=t):Kl(e))}}function Yl(e){var t=e.alternate;if(null!==t&&null!==(e=t.child)){t.child=null;do{t=e.sibling,e.sibling=null,e=t}while(null!==e)}}function Ql(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];jl=r,Zl(r,e)}Yl(e)}if(10256&e.subtreeFlags)for(e=e.child;null!==e;)$l(e),e=e.sibling}function $l(e){switch(e.tag){case 0:case 11:case 15:Ql(e),2048&e.flags&&ol(9,e,e.return);break;case 3:case 12:default:Ql(e);break;case 22:var t=e.stateNode;null!==e.memoizedState&&2&t._visibility&&(null===e.return||13!==e.return.tag)?(t._visibility&=-3,Xl(e)):Ql(e)}}function Xl(e){var t=e.deletions;if(0!==(16&e.flags)){if(null!==t)for(var n=0;n<t.length;n++){var r=t[n];jl=r,Zl(r,e)}Yl(e)}for(e=e.child;null!==e;){switch((t=e).tag){case 0:case 11:case 15:ol(8,t,t.return),Xl(t);break;case 22:2&(n=t.stateNode)._visibility&&(n._visibility&=-3,Xl(t));break;default:Xl(t)}e=e.sibling}}function Zl(e,t){for(;null!==jl;){var n=jl;switch(n.tag){case 0:case 11:case 15:ol(8,n,t);break;case 23:case 22:if(null!==n.memoizedState&&null!==n.memoizedState.cachePool){var r=n.memoizedState.cachePool.pool;null!=r&&r.refCount++}break;case 24:Ds(n.memoizedState.cache)}if(null!==(r=n.child))r.return=n,jl=r;else e:for(n=e;null!==jl;){var s=(r=jl).sibling,a=r.return;if(Sl(r),r===n){jl=null;break e}if(null!==s){s.return=a,jl=s;break e}jl=a}}}var ec={getCacheForType:function(e){var t=Cs(Ps),n=t.data.get(e);return void 0===n&&(n=e(),t.data.set(e,n)),n}},tc="function"===typeof WeakMap?WeakMap:Map,nc=0,rc=null,sc=null,ac=0,ic=0,oc=null,lc=!1,cc=!1,uc=!1,dc=0,hc=0,mc=0,pc=0,fc=0,gc=0,vc=0,yc=null,bc=null,xc=!1,wc=0,Nc=1/0,jc=null,Ec=null,Sc=0,Cc=null,kc=null,_c=0,Ac=0,Tc=null,Ic=null,Pc=0,Rc=null;function Dc(){if(0!==(2&nc)&&0!==ac)return ac&-ac;if(null!==D.T){return 0!==Ms?Ms:Au()}return Te()}function Oc(){0===gc&&(gc=0===(536870912&ac)||as?Ne():536870912);var e=ro.current;return null!==e&&(e.flags|=32),gc}function Lc(e,t,n){(e!==rc||2!==ic&&9!==ic)&&null===e.cancelPendingCommit||(qc(e,0),Vc(e,ac,gc,!1)),Se(e,n),0!==(2&nc)&&e===rc||(e===rc&&(0===(2&nc)&&(pc|=n),4===hc&&Vc(e,ac,gc,!1)),Nu(e))}function Mc(e,t,n){if(0!==(6&nc))throw Error(i(327));for(var r=!n&&0===(124&t)&&0===(t&e.expiredLanes)||xe(e,t),s=r?function(e,t){var n=nc;nc|=2;var r=Wc(),s=Gc();rc!==e||ac!==t?(jc=null,Nc=te()+500,qc(e,t)):cc=xe(e,t);e:for(;;)try{if(0!==ic&&null!==sc){t=sc;var a=oc;t:switch(ic){case 1:ic=0,oc=null,Zc(e,t,a,1);break;case 2:case 9:if(Ys(a)){ic=0,oc=null,Xc(t);break}t=function(){2!==ic&&9!==ic||rc!==e||(ic=7),Nu(e)},a.then(t,t);break e;case 3:ic=7;break e;case 4:ic=5;break e;case 7:Ys(a)?(ic=0,oc=null,Xc(t)):(ic=0,oc=null,Zc(e,t,a,7));break;case 5:var o=null;switch(sc.tag){case 26:o=sc.memoizedState;case 5:case 27:var l=sc;if(!o||zd(o)){ic=0,oc=null;var c=l.sibling;if(null!==c)sc=c;else{var u=l.return;null!==u?(sc=u,eu(u)):sc=null}break t}}ic=0,oc=null,Zc(e,t,a,5);break;case 6:ic=0,oc=null,Zc(e,t,a,6);break;case 8:Bc(),hc=6;break e;default:throw Error(i(462))}}Qc();break}catch(d){Hc(e,d)}return ys=vs=null,D.H=r,D.A=s,nc=n,null!==sc?0:(rc=null,ac=0,_r(),hc)}(e,t):Jc(e,t,!0),a=r;;){if(0===s){cc&&!r&&Vc(e,t,0,!1);break}if(n=e.current.alternate,!a||Uc(n)){if(2===s){if(a=t,e.errorRecoveryDisabledLanes&a)var o=0;else o=0!==(o=-536870913&e.pendingLanes)?o:536870912&o?536870912:0;if(0!==o){t=o;e:{var l=e;s=yc;var c=l.current.memoizedState.isDehydrated;if(c&&(qc(l,o).flags|=256),2!==(o=Jc(l,o,!1))){if(uc&&!c){l.errorRecoveryDisabledLanes|=a,pc|=a,s=4;break e}a=bc,bc=s,null!==a&&(null===bc?bc=a:bc.push.apply(bc,a))}s=o}if(a=!1,2!==s)continue}}if(1===s){qc(e,0),Vc(e,t,0,!0);break}e:{switch(r=e,a=s){case 0:case 1:throw Error(i(345));case 4:if((4194048&t)!==t)break;case 6:Vc(r,t,gc,!lc);break e;case 2:bc=null;break;case 3:case 5:break;default:throw Error(i(329))}if((62914560&t)===t&&10<(s=wc+300-te())){if(Vc(r,t,gc,!lc),0!==be(r,0,!0))break e;r.timeoutHandle=ld(Fc.bind(null,r,n,bc,jc,xc,t,gc,pc,vc,lc,a,2,-0,0),s)}else Fc(r,n,bc,jc,xc,t,gc,pc,vc,lc,a,0,-0,0)}break}s=Jc(e,t,!1),a=!1}Nu(e)}function Fc(e,t,n,r,s,a,o,l,c,u,d,h,m,p){if(e.timeoutHandle=-1,(8192&(h=t.subtreeFlags)||16785408===(16785408&h))&&(Bd={stylesheets:null,count:0,unsuspend:qd},Jl(t),null!==(h=function(){if(null===Bd)throw Error(i(475));var e=Bd;return e.stylesheets&&0===e.count&&Gd(e,e.stylesheets),0<e.count?function(t){var n=setTimeout(function(){if(e.stylesheets&&Gd(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(n)}}:null}())))return e.cancelPendingCommit=h(nu.bind(null,e,t,a,n,r,s,o,l,c,d,1,m,p)),void Vc(e,a,o,!u);nu(e,t,a,n,r,s,o,l,c)}function Uc(e){for(var t=e;;){var n=t.tag;if((0===n||11===n||15===n)&&16384&t.flags&&(null!==(n=t.updateQueue)&&null!==(n=n.stores)))for(var r=0;r<n.length;r++){var s=n[r],a=s.getSnapshot;s=s.value;try{if(!Yn(a(),s))return!1}catch(i){return!1}}if(n=t.child,16384&t.subtreeFlags&&null!==n)n.return=t,t=n;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Vc(e,t,n,r){t&=~fc,t&=~pc,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var s=t;0<s;){var a=31-me(s),i=1<<a;r[a]=-1,s&=~i}0!==n&&Ce(e,n,t)}function zc(){return 0!==(6&nc)||(ju(0,!1),!1)}function Bc(){if(null!==sc){if(0===ic)var e=sc.return;else ys=vs=null,Ma(e=sc),Ji=null,Yi=0,e=sc;for(;null!==e;)al(e.alternate,e),e=e.return;sc=null}}function qc(e,t){var n=e.timeoutHandle;-1!==n&&(e.timeoutHandle=-1,cd(n)),null!==(n=e.cancelPendingCommit)&&(e.cancelPendingCommit=null,n()),Bc(),rc=e,sc=n=Fr(e.current,null),ac=t,ic=0,oc=null,lc=!1,cc=xe(e,t),uc=!1,vc=gc=fc=pc=mc=hc=0,bc=yc=null,xc=!1,0!==(8&t)&&(t|=32&t);var r=e.entangledLanes;if(0!==r)for(e=e.entanglements,r&=t;0<r;){var s=31-me(r),a=1<<s;t|=e[s],r&=~a}return dc=t,_r(),n}function Hc(e,t){ba=null,D.H=Hi,t===Ws||t===Ks?(t=Zs(),ic=3):t===Gs?(t=Zs(),ic=4):ic=t===Co?8:null!==t&&"object"===typeof t&&"function"===typeof t.then?6:1,oc=t,null===sc&&(hc=1,wo(e,Er(t,e.current)))}function Wc(){var e=D.H;return D.H=Hi,null===e?Hi:e}function Gc(){var e=D.A;return D.A=ec,e}function Kc(){hc=4,lc||(4194048&ac)!==ac&&null!==ro.current||(cc=!0),0===(134217727&mc)&&0===(134217727&pc)||null===rc||Vc(rc,ac,gc,!1)}function Jc(e,t,n){var r=nc;nc|=2;var s=Wc(),a=Gc();rc===e&&ac===t||(jc=null,qc(e,t)),t=!1;var i=hc;e:for(;;)try{if(0!==ic&&null!==sc){var o=sc,l=oc;switch(ic){case 8:Bc(),i=6;break e;case 3:case 2:case 9:case 6:null===ro.current&&(t=!0);var c=ic;if(ic=0,oc=null,Zc(e,o,l,c),n&&cc){i=0;break e}break;default:c=ic,ic=0,oc=null,Zc(e,o,l,c)}}Yc(),i=hc;break}catch(u){Hc(e,u)}return t&&e.shellSuspendCounter++,ys=vs=null,nc=r,D.H=s,D.A=a,null===sc&&(rc=null,ac=0,_r()),i}function Yc(){for(;null!==sc;)$c(sc)}function Qc(){for(;null!==sc&&!Z();)$c(sc)}function $c(e){var t=$o(e.alternate,e,dc);e.memoizedProps=e.pendingProps,null===t?eu(e):sc=t}function Xc(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Lo(n,t,t.pendingProps,t.type,void 0,ac);break;case 11:t=Lo(n,t,t.pendingProps,t.type.render,t.ref,ac);break;case 5:Ma(t);default:al(n,t),t=$o(n,t=sc=Ur(t,dc),dc)}e.memoizedProps=e.pendingProps,null===t?eu(e):sc=t}function Zc(e,t,n,r){ys=vs=null,Ma(t),Ji=null,Yi=0;var s=t.return;try{if(function(e,t,n,r,s){if(n.flags|=32768,null!==r&&"object"===typeof r&&"function"===typeof r.then){if(null!==(t=n.alternate)&&js(t,n,s,!0),null!==(n=ro.current)){switch(n.tag){case 13:return null===so?Kc():null===n.alternate&&0===hc&&(hc=3),n.flags&=-257,n.flags|=65536,n.lanes=s,r===Js?n.flags|=16384:(null===(t=n.updateQueue)?n.updateQueue=new Set([r]):t.add(r),du(e,r,s)),!1;case 22:return n.flags|=65536,r===Js?n.flags|=16384:(null===(t=n.updateQueue)?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):null===(n=t.retryQueue)?t.retryQueue=new Set([r]):n.add(r),du(e,r,s)),!1}throw Error(i(435,n.tag))}return du(e,r,s),Kc(),!1}if(as)return null!==(t=ro.current)?(0===(65536&t.flags)&&(t.flags|=256),t.flags|=65536,t.lanes=s,r!==ls&&fs(Er(e=Error(i(422),{cause:r}),n))):(r!==ls&&fs(Er(t=Error(i(423),{cause:r}),n)),(e=e.current.alternate).flags|=65536,s&=-s,e.lanes|=s,r=Er(r,n),oa(e,s=jo(e.stateNode,r,s)),4!==hc&&(hc=2)),!1;var a=Error(i(520),{cause:r});if(a=Er(a,n),null===yc?yc=[a]:yc.push(a),4!==hc&&(hc=2),null===t)return!0;r=Er(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=s&-s,n.lanes|=e,oa(n,e=jo(n.stateNode,r,e)),!1;case 1:if(t=n.type,a=n.stateNode,0===(128&n.flags)&&("function"===typeof t.getDerivedStateFromError||null!==a&&"function"===typeof a.componentDidCatch&&(null===Ec||!Ec.has(a))))return n.flags|=65536,s&=-s,n.lanes|=s,So(s=Eo(s),e,n,r),oa(n,s),!1}n=n.return}while(null!==n);return!1}(e,s,t,n,ac))return hc=1,wo(e,Er(n,e.current)),void(sc=null)}catch(a){if(null!==s)throw sc=s,a;return hc=1,wo(e,Er(n,e.current)),void(sc=null)}32768&t.flags?(as||1===r?e=!0:cc||0!==(536870912&ac)?e=!1:(lc=e=!0,(2===r||9===r||3===r||6===r)&&(null!==(r=ro.current)&&13===r.tag&&(r.flags|=16384))),tu(t,e)):eu(t)}function eu(e){var t=e;do{if(0!==(32768&t.flags))return void tu(t,lc);e=t.return;var n=rl(t.alternate,t,dc);if(null!==n)return void(sc=n);if(null!==(t=t.sibling))return void(sc=t);sc=t=e}while(null!==t);
20===hc&&(hc=5)}function tu(e,t){do{var n=sl(e.alternate,e);if(null!==n)return n.flags&=32767,void(sc=n);if(null!==(n=e.return)&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&null!==(e=e.sibling))return void(sc=e);sc=e=n}while(null!==e);hc=6,sc=null}function nu(e,t,n,r,s,a,o,l,c){e.cancelPendingCommit=null;do{ou()}while(0!==Sc);if(0!==(6&nc))throw Error(i(327));if(null!==t){if(t===e.current)throw Error(i(177));if(a=t.lanes|t.childLanes,function(e,t,n,r,s,a){var i=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var o=e.entanglements,l=e.expirationTimes,c=e.hiddenUpdates;for(n=i&~n;0<n;){var u=31-me(n),d=1<<u;o[u]=0,l[u]=-1;var h=c[u];if(null!==h)for(c[u]=null,u=0;u<h.length;u++){var m=h[u];null!==m&&(m.lane&=-536870913)}n&=~d}0!==r&&Ce(e,r,0),0!==a&&0===s&&0!==e.tag&&(e.suspendedLanes|=a&~(i&~t))}(e,n,a|=kr,o,l,c),e===rc&&(sc=rc=null,ac=0),kc=t,Cc=e,_c=n,Ac=a,Tc=s,Ic=r,0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?(e.callbackNode=null,e.callbackPriority=0,$(ae,function(){return lu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=0!==(13878&t.flags),0!==(13878&t.subtreeFlags)||r){r=D.T,D.T=null,s=O.p,O.p=2,o=nc,nc|=4;try{!function(e,t){if(e=e.containerInfo,td=nh,tr(e=er(e))){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{var r=(n=(n=e.ownerDocument)&&n.defaultView||window).getSelection&&n.getSelection();if(r&&0!==r.rangeCount){n=r.anchorNode;var s=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch(g){n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=e,m=null;t:for(;;){for(var p;h!==n||0!==s&&3!==h.nodeType||(l=o+s),h!==a||0!==r&&3!==h.nodeType||(c=o+r),3===h.nodeType&&(o+=h.nodeValue.length),null!==(p=h.firstChild);)m=h,h=p;for(;;){if(h===e)break t;if(m===n&&++u===s&&(l=o),m===a&&++d===r&&(c=o),null!==(p=h.nextSibling))break;m=(h=m).parentNode}h=p}n=-1===l||-1===c?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(nd={focusedElem:e,selectionRange:n},nh=!1,jl=t;null!==jl;)if(e=(t=jl).child,0!==(1024&t.subtreeFlags)&&null!==e)e.return=t,jl=e;else for(;null!==jl;){switch(a=(t=jl).alternate,e=t.flags,t.tag){case 0:case 11:case 15:case 5:case 26:case 27:case 6:case 4:case 17:break;case 1:if(0!==(1024&e)&&null!==a){e=void 0,n=t,s=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var f=go(n.type,s,(n.elementType,n.type));e=r.getSnapshotBeforeUpdate(f,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(v){uu(n,n.return,v)}}break;case 3:if(0!==(1024&e))if(9===(n=(e=t.stateNode.containerInfo).nodeType))fd(e);else if(1===n)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fd(e);break;default:e.textContent=""}break;default:if(0!==(1024&e))throw Error(i(163))}if(null!==(e=t.sibling)){e.return=t.return,jl=e;break}jl=t.return}}(e,t)}finally{nc=o,O.p=s,D.T=r}}Sc=1,ru(),su(),au()}}function ru(){if(1===Sc){Sc=0;var e=Cc,t=kc,n=0!==(13878&t.flags);if(0!==(13878&t.subtreeFlags)||n){n=D.T,D.T=null;var r=O.p;O.p=2;var s=nc;nc|=4;try{Dl(t,e);var a=nd,i=er(e.containerInfo),o=a.focusedElem,l=a.selectionRange;if(i!==o&&o&&o.ownerDocument&&Zn(o.ownerDocument.documentElement,o)){if(null!==l&&tr(o)){var c=l.start,u=l.end;if(void 0===u&&(u=c),"selectionStart"in o)o.selectionStart=c,o.selectionEnd=Math.min(u,o.value.length);else{var d=o.ownerDocument||document,h=d&&d.defaultView||window;if(h.getSelection){var m=h.getSelection(),p=o.textContent.length,f=Math.min(l.start,p),g=void 0===l.end?f:Math.min(l.end,p);!m.extend&&f>g&&(i=g,g=f,f=i);var v=Xn(o,f),y=Xn(o,g);if(v&&y&&(1!==m.rangeCount||m.anchorNode!==v.node||m.anchorOffset!==v.offset||m.focusNode!==y.node||m.focusOffset!==y.offset)){var b=d.createRange();b.setStart(v.node,v.offset),m.removeAllRanges(),f>g?(m.addRange(b),m.extend(y.node,y.offset)):(b.setEnd(y.node,y.offset),m.addRange(b))}}}}for(d=[],m=o;m=m.parentNode;)1===m.nodeType&&d.push({element:m,left:m.scrollLeft,top:m.scrollTop});for("function"===typeof o.focus&&o.focus(),o=0;o<d.length;o++){var x=d[o];x.element.scrollLeft=x.left,x.element.scrollTop=x.top}}nh=!!td,nd=td=null}finally{nc=s,O.p=r,D.T=n}}e.current=t,Sc=2}}
2function su(){if(2===Sc){Sc=0;var e=Cc,t=kc,n=0!==(8772&t.flags);if(0!==(8772&t.subtreeFlags)||n){n=D.T,D.T=null;var r=O.p;O.p=2;var s=nc;nc|=4;try{El(e,t.alternate,t)}finally{nc=s,O.p=r,D.T=n}}Sc=3}}function au(){if(4===Sc||3===Sc){Sc=0,ee();var e=Cc,t=kc,n=_c,r=Ic;0!==(10256&t.subtreeFlags)||0!==(10256&t.flags)?Sc=5:(Sc=0,kc=Cc=null,iu(e,e.pendingLanes));var s=e.pendingLanes;if(0===s&&(Ec=null),Ae(n),t=t.stateNode,de&&"function"===typeof de.onCommitFiberRoot)try{de.onCommitFiberRoot(ue,t,void 0,128===(128&t.current.flags))}catch(l){}if(null!==r){t=D.T,s=O.p,O.p=2,D.T=null;try{for(var a=e.onRecoverableError,i=0;i<r.length;i++){var o=r[i];a(o.value,{componentStack:o.stack})}}finally{D.T=t,O.p=s}}0!==(3&_c)&&ou(),Nu(e),s=e.pendingLanes,0!==(4194090&n)&&0!==(42&s)?e===Rc?Pc++:(Pc=0,Rc=e):Pc=0,ju(0,!1)}}function iu(e,t){0===(e.pooledCacheLanes&=t)&&(null!=(t=e.pooledCache)&&(e.pooledCache=null,Ds(t)))}function ou(e){return ru(),su(),au(),lu()}function lu(){if(5!==Sc)return!1;var e=Cc,t=Ac;Ac=0;var n=Ae(_c),r=D.T,s=O.p;try{O.p=32>n?32:n,D.T=null,n=Tc,Tc=null;var a=Cc,o=_c;if(Sc=0,kc=Cc=null,_c=0,0!==(6&nc))throw Error(i(331));var l=nc;if(nc|=4,$l(a.current),ql(a,a.current,o,n),nc=l,ju(0,!1),de&&"function"===typeof de.onPostCommitFiberRoot)try{de.onPostCommitFiberRoot(ue,a)}catch(c){}return!0}finally{O.p=s,D.T=r,iu(e,t)}}function cu(e,t,n){t=Er(n,t),null!==(e=aa(e,t=jo(e.stateNode,t,2),2))&&(Se(e,2),Nu(e))}function uu(e,t,n){if(3===e.tag)cu(e,e,n);else for(;null!==t;){if(3===t.tag){cu(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof r.componentDidCatch&&(null===Ec||!Ec.has(r))){e=Er(n,e),null!==(r=aa(t,n=Eo(2),2))&&(So(n,r,t,e),Se(r,2),Nu(r));break}}t=t.return}}function du(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new tc;var s=new Set;r.set(t,s)}else void 0===(s=r.get(t))&&(s=new Set,r.set(t,s));s.has(n)||(uc=!0,s.add(n),e=hu.bind(null,e,t,n),t.then(e,e))}function hu(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,rc===e&&(ac&n)===n&&(4===hc||3===hc&&(62914560&ac)===ac&&300>te()-wc?0===(2&nc)&&qc(e,0):fc|=n,vc===ac&&(vc=0)),Nu(e)}function mu(e,t){0===t&&(t=je()),null!==(e=Ir(e,t))&&(Se(e,t),Nu(e))}function pu(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),mu(e,n)}function fu(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;null!==s&&(n=s.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),mu(e,n)}var gu=null,vu=null,yu=!1,bu=!1,xu=!1,wu=0;function Nu(e){e!==vu&&null===e.next&&(null===vu?gu=vu=e:vu=vu.next=e),bu=!0,yu||(yu=!0,dd(function(){0!==(6&nc)?$(re,Eu):Su()}))}function ju(e,t){if(!xu&&bu){xu=!0;do{for(var n=!1,r=gu;null!==r;){if(!t)if(0!==e){var s=r.pendingLanes;if(0===s)var a=0;else{var i=r.suspendedLanes,o=r.pingedLanes;a=(1<<31-me(42|e)+1)-1,a=201326741&(a&=s&~(i&~o))?201326741&a|1:a?2|a:0}0!==a&&(n=!0,_u(r,a))}else a=ac,0===(3&(a=be(r,r===rc?a:0,null!==r.cancelPendingCommit||-1!==r.timeoutHandle)))||xe(r,a)||(n=!0,_u(r,a));r=r.next}}while(n);xu=!1}}function Eu(){Su()}function Su(){bu=yu=!1;var e=0;0!==wu&&(function(){var e=window.event;if(e&&"popstate"===e.type)return e!==od&&(od=e,!0);return od=null,!1}()&&(e=wu),wu=0);for(var t=te(),n=null,r=gu;null!==r;){var s=r.next,a=Cu(r,t);0===a?(r.next=null,null===n?gu=s:n.next=s,null===s&&(vu=n)):(n=r,(0!==e||0!==(3&a))&&(bu=!0)),r=s}ju(e,!1)}function Cu(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,a=-62914561&e.pendingLanes;0<a;){var i=31-me(a),o=1<<i,l=s[i];-1===l?0!==(o&n)&&0===(o&r)||(s[i]=we(o,t)):l<=t&&(e.expiredLanes|=o),a&=~o}if(n=ac,n=be(e,e===(t=rc)?n:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle),r=e.callbackNode,0===n||e===t&&(2===ic||9===ic)||null!==e.cancelPendingCommit)return null!==r&&null!==r&&X(r),e.callbackNode=null,e.callbackPriority=0;if(0===(3&n)||xe(e,n)){if((t=n&-n)===e.callbackPriority)return t;switch(null!==r&&X(r),Ae(n)){case 2:case 8:n=se;break;case 32:default:n=ae;break;case 268435456:n=oe}return r=ku.bind(null,e),n=$(n,r),e.callbackPriority=t,e.callbackNode=n,t}return null!==r&&null!==r&&X(r),e.callbackPriority=2,e.callbackNode=null,2}function ku(e,t){if(0!==Sc&&5!==Sc)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(ou()&&e.callbackNode!==n)return null;var r=ac;return 0===(r=be(e,e===rc?r:0,null!==e.cancelPendingCommit||-1!==e.timeoutHandle))?null:(Mc(e,r,t),Cu(e,te
vendor: 4,283 bytes, line 2
2()),null!=e.callbackNode&&e.callbackNode===n?ku.bind(null,e):null)}function _u(e,t){if(ou())return null;Mc(e,t,!0)}function Au(){return 0===wu&&(wu=Ne()),wu}function Tu(e){return null==e||"symbol"===typeof e||"boolean"===typeof e?null:"function"===typeof e?e:At(""+e)}function Iu(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}for(var Pu=0;Pu<wr.length;Pu++){var Ru=wr[Pu];Nr(Ru.toLowerCase(),"on"+(Ru[0].toUpperCase()+Ru.slice(1)))}Nr(mr,"onAnimationEnd"),Nr(pr,"onAnimationIteration"),Nr(fr,"onAnimationStart"),Nr("dblclick","onDoubleClick"),Nr("focusin","onFocus"),Nr("focusout","onBlur"),Nr(gr,"onTransitionRun"),Nr(vr,"onTransitionStart"),Nr(yr,"onTransitionCancel"),Nr(br,"onTransitionEnd"),Ye("onMouseEnter",["mouseout","mouseover"]),Ye("onMouseLeave",["mouseout","mouseover"]),Ye("onPointerEnter",["pointerout","pointerover"]),Ye("onPointerLeave",["pointerout","pointerover"]),Je("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Je("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Je("onBeforeInput",["compositionend","keypress","textInput","paste"]),Je("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Je("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Je("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Du="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Ou=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Du));function Lu(e,t){t=0!==(4&t);for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var a=void 0;if(t)for(var i=r.length-1;0<=i;i--){var o=r[i],l=o.instance,c=o.currentTarget;if(o=o.listener,l!==a&&s.isPropagationStopped())break e;a=o,s.currentTarget=c;try{a(s)}catch(u){vo(u)}s.currentTarget=null,a=l}else for(i=0;i<r.length;i++){if(l=(o=r[i]).instance,c=o.currentTarget,o=o.listener,l!==a&&s.isPropagationStopped())break e;a=o,s.currentTarget=c;try{a(s)}catch(u){vo(u)}s.currentTarget=null,a=l}}}}function Mu(e,t){var n=t[Oe];void 0===n&&(n=t[Oe]=new Set);var r=e+"__bubble";n.has(r)||(zu(t,e,2,!1),n.add(r))}function Fu(e,t,n){var r=0;t&&(r|=4),zu(n,e,r,t)}var Uu="_reactListening"+Math.random().toString(36).slice(2);function Vu(e){if(!e[Uu]){e[Uu]=!0,Ge.forEach(function(t){"selectionchange"!==t&&(Ou.has(t)||Fu(t,!1,e),Fu(t,!0,e))});var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Uu]||(t[Uu]=!0,Fu("selectionchange",!1,t))}}function zu(e,t,n,r){switch(ch(t)){case 2:var s=rh;break;case 8:s=sh;break;default:s=ah}n=s.bind(null,t,n,e),s=void 0,!Ut||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(s=!0),r?void 0!==s?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):void 0!==s?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Bu(e,t,n,r,s){var a=r;if(0===(1&t)&&0===(2&t)&&null!==r)e:for(;;){if(null===r)return;var i=r.tag;if(3===i||4===i){var o=r.stateNode.containerInfo;if(o===s)break;if(4===i)for(i=r.return;null!==i;){var c=i.tag;if((3===c||4===c)&&i.stateNode.containerInfo===s)return;i=i.return}for(;null!==o;){if(null===(i=ze(o)))return;if(5===(c=i.tag)||6===c||26===c||27===c){r=a=i;continue e}o=o.parentNode}}r=r.return}Lt(function(){var r=a,s=It(n),i=[];e:{var o=xr.get(e);if(void 0!==o){var c=Zt,u=e;switch(e){case"keypress":if(0===Wt(n))break e;case"keydown":case"keyup":c=fn;break;case"focusin":u="focus",c=an;break;case"focusout":u="blur",c=an;break;case"beforeblur":case"afterblur":c=an;break;case"click":if(2===n.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":c=rn;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=sn;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=v
vendor: 4,620 bytes, line 2
2n;break;case mr:case pr:case fr:c=on;break;case br:c=yn;break;case"scroll":case"scrollend":c=tn;break;case"wheel":c=bn;break;case"copy":case"cut":case"paste":c=ln;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=gn;break;case"toggle":case"beforetoggle":c=xn}var d=0!==(4&t),h=!d&&("scroll"===e||"scrollend"===e),m=d?null!==o?o+"Capture":null:o;d=[];for(var p,f=r;null!==f;){var g=f;if(p=g.stateNode,5!==(g=g.tag)&&26!==g&&27!==g||null===p||null===m||null!=(g=Mt(f,m))&&d.push(qu(f,g,p)),h)break;f=f.return}0<d.length&&(o=new c(o,u,null,n,s),i.push({event:o,listeners:d}))}}if(0===(7&t)){if(c="mouseout"===e||"pointerout"===e,(!(o="mouseover"===e||"pointerover"===e)||n===Tt||!(u=n.relatedTarget||n.fromElement)||!ze(u)&&!u[De])&&(c||o)&&(o=s.window===s?s:(o=s.ownerDocument)?o.defaultView||o.parentWindow:window,c?(c=r,null!==(u=(u=n.relatedTarget||n.toElement)?ze(u):null)&&(h=l(u),d=u.tag,u!==h||5!==d&&27!==d&&6!==d)&&(u=null)):(c=null,u=r),c!==u)){if(d=rn,g="onMouseLeave",m="onMouseEnter",f="mouse","pointerout"!==e&&"pointerover"!==e||(d=gn,g="onPointerLeave",m="onPointerEnter",f="pointer"),h=null==c?o:qe(c),p=null==u?o:qe(u),(o=new d(g,f+"leave",c,n,s)).target=h,o.relatedTarget=p,g=null,ze(s)===r&&((d=new d(m,f+"enter",u,n,s)).target=p,d.relatedTarget=h,g=d),h=g,c&&u)e:{for(m=u,f=0,p=d=c;p;p=Wu(p))f++;for(p=0,g=m;g;g=Wu(g))p++;for(;0<f-p;)d=Wu(d),f--;for(;0<p-f;)m=Wu(m),p--;for(;f--;){if(d===m||null!==m&&d===m.alternate)break e;d=Wu(d),m=Wu(m)}d=null}else d=null;null!==c&&Gu(i,o,c,d,!1),null!==u&&null!==h&&Gu(i,h,u,d,!0)}if("select"===(c=(o=r?qe(r):window).nodeName&&o.nodeName.toLowerCase())||"input"===c&&"file"===o.type)var v=Fn;else if(Pn(o))if(Un)v=Jn;else{v=Gn;var y=Wn}else!(c=o.nodeName)||"input"!==c.toLowerCase()||"checkbox"!==o.type&&"radio"!==o.type?r&&Ct(r.elementType)&&(v=Fn):v=Kn;switch(v&&(v=v(e,r))?Rn(i,v,n,s):(y&&y(e,o,r),"focusout"===e&&r&&"number"===o.type&&null!=r.memoizedProps.value&&yt(o,"number",o.value)),y=r?qe(r):window,e){case"focusin":(Pn(y)||"true"===y.contentEditable)&&(rr=y,sr=r,ar=null);break;case"focusout":ar=sr=rr=null;break;case"mousedown":ir=!0;break;case"contextmenu":case"mouseup":case"dragend":ir=!1,or(i,n,s);break;case"selectionchange":if(nr)break;case"keydown":case"keyup":or(i,n,s)}var b;if(Nn)e:{switch(e){case"compositionstart":var x="onCompositionStart";break e;case"compositionend":x="onCompositionEnd";break e;case"compositionupdate":x="onCompositionUpdate";break e}x=void 0}else Tn?_n(e,n)&&(x="onCompositionEnd"):"keydown"===e&&229===n.keyCode&&(x="onCompositionStart");x&&(Sn&&"ko"!==n.locale&&(Tn||"onCompositionStart"!==x?"onCompositionEnd"===x&&Tn&&(b=Ht()):(Bt="value"in(zt=s)?zt.value:zt.textContent,Tn=!0)),0<(y=Hu(r,x)).length&&(x=new cn(x,e,null,n,s),i.push({event:x,listeners:y}),b?x.data=b:null!==(b=An(n))&&(x.data=b))),(b=En?function(e,t){switch(e){case"compositionend":return An(t);case"keypress":return 32!==t.which?null:(kn=!0,Cn);case"textInput":return(e=t.data)===Cn&&kn?null:e;default:return null}}(e,n):function(e,t){if(Tn)return"compositionend"===e||!Nn&&_n(e,t)?(e=Ht(),qt=Bt=zt=null,Tn=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Sn&&"ko"!==t.locale?null:t.data}}(e,n))&&(0<(x=Hu(r,"onBeforeInput")).length&&(y=new cn("onBeforeInput","beforeinput",null,n,s),i.push({event:y,listeners:x}),y.data=b)),function(e,t,n,r,s){if("submit"===t&&n&&n.stateNode===s){var a=Tu((s[Re]||null).action),i=r.submitter;i&&null!==(t=(t=i[Re]||null)?Tu(t.formAction):i.getAttribute("formAction"))&&(a=t,i=null);var o=new Zt("action","action",null,r,s);e.push({event:o,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(0!==wu){var e=i?Iu(s,i):new FormData(s);Ti(n,{pending:!0,data:e,method:s.method,action:a},null,e)}}else"function"===typeof a&&(o.preventDefault(),e=i?Iu(s,i):new FormData(s),Ti(n,{pending:!0,data:e,method:s.method,action:a},a,e))},currentTarget:s}]})}}(i,e,r,n,s)}Lu(i,t)})}function qu(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hu(e,t){for(var n=t+"Capture",r=[];null!==e;){var s=e,a=s.stateNode;if(5!==(s=s.tag)&&26!==s&&27!==s||null===a||(null!=(s=Mt(e,n))&&r.unshift(qu(e,s,a)),null!=(s=Mt(e,t))&&r.push(qu(e,s,a))),3===e.tag)return r;e=e.return}return[]}function Wu(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag&&27!==e.tag);return e||null}
2function Gu(e,t,n,r,s){for(var a=t._reactName,i=[];null!==n&&n!==r;){var o=n,l=o.alternate,c=o.stateNode;if(o=o.tag,null!==l&&l===r)break;5!==o&&26!==o&&27!==o||null===c||(l=c,s?null!=(c=Mt(n,a))&&i.unshift(qu(n,c,l)):s||null!=(c=Mt(n,a))&&i.push(qu(n,c,l))),n=n.return}0!==i.length&&e.push({event:t,listeners:i})}var Ku=/\r\n?/g,Ju=/\u0000|\uFFFD/g;function Yu(e){return("string"===typeof e?e:""+e).replace(Ku,"\n").replace(Ju,"")}function Qu(e,t){return t=Yu(t),Yu(e)===t}function $u(){}function Xu(e,t,n,r,s,a){switch(n){case"children":"string"===typeof r?"body"===t||"textarea"===t&&""===r||Nt(e,r):("number"===typeof r||"bigint"===typeof r)&&"body"!==t&&Nt(e,""+r);break;case"className":nt(e,"class",r);break;case"tabIndex":nt(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":nt(e,n,r);break;case"style":St(e,r,a);break;case"data":if("object"!==t){nt(e,"data",r);break}case"src":case"href":if(""===r&&("a"!==t||"href"!==n)){e.removeAttribute(n);break}if(null==r||"function"===typeof r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"action":case"formAction":if("function"===typeof r){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}if("function"===typeof a&&("formAction"===n?("input"!==t&&Xu(e,t,"name",s.name,s,null),Xu(e,t,"formEncType",s.formEncType,s,null),Xu(e,t,"formMethod",s.formMethod,s,null),Xu(e,t,"formTarget",s.formTarget,s,null)):(Xu(e,t,"encType",s.encType,s,null),Xu(e,t,"method",s.method,s,null),Xu(e,t,"target",s.target,s,null))),null==r||"symbol"===typeof r||"boolean"===typeof r){e.removeAttribute(n);break}r=At(""+r),e.setAttribute(n,r);break;case"onClick":null!=r&&(e.onclick=$u);break;case"onScroll":null!=r&&Mu("scroll",e);break;case"onScrollEnd":null!=r&&Mu("scrollend",e);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=s.children)throw Error(i(60));e.innerHTML=n}}break;case"multiple":e.multiple=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"muted":e.muted=r&&"function"!==typeof r&&"symbol"!==typeof r;break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":case"autoFocus":break;case"xlinkHref":if(null==r||"function"===typeof r||"boolean"===typeof r||"symbol"===typeof r){e.removeAttribute("xlink:href");break}n=At(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""+r):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":!0===r?e.setAttribute(n,""):!1!==r&&null!=r&&"function"!==typeof r&&"symbol"!==typeof r?e.setAttribute(n,r):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":null!=r&&"function"!==typeof r&&"symbol"!==typeof r&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case"rowSpan":case"start":null==r||"function"===typeof r||"symbol"===typeof r||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case"popover":Mu("beforetoggle",e),Mu("toggle",e),tt(e,"popover",r);break;case"xlinkActuate":rt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":rt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":rt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":rt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":rt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":rt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":rt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":rt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":rt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":tt(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<n.length)||"o"!==n[0]&&"O"!==n[0]||"n"!==n[1]&&"N"!==n[1])&&tt(e,n=kt.get(n)||n,r)}}function Zu(e,t,n,r,s,a){switch(n){case"style":St(e,r,a);break;case"dangerouslySetInnerHTML":if(null!=r){if("object"!==typeof r||!("__html"in r))throw Error(i(61));if(null!=(n=r.__html)){if(null!=s.children)throw Error(i(60));e.innerHTML=n}}break;case"children":"string"===typeof r?Nt(e,r):("number"===typeof r||"bigint"===typeof r)&&Nt(e,""+r);break;case"onScroll":null!=r&&Mu("scroll",e);break;case"onScrollEnd":null!=r&&Mu("scrollend",e);break;case"onClick":null!=r&&(e.onclick=$u);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":case"innerText":case"textContent":break;default:Ke.hasOwnProperty(n)||("o"!==n[0]||"n"!==n[1]||(s=n.endsWith("Capture"),t=n.slice(2,s?n.length-7:void 0),"function"===typeof(a=null!=(a=e[Re]||null)?a[n]:null)&&e.removeEventListener(t,a,s),"function"!==typeof r)?n in e?e[n]=r:!0===r?e.setAttribute(n,""):tt(e,n,r):("function"!==typeof a&&null!==a&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,s)))}}function ed(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mu("error",e),Mu("load",e);var r,s=!1,a=!1;for(r in n)if(n.hasOwnProperty(r)){var o=n[r];if(null!=o)switch(r){case"src":s=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xu(e,t,r,o,n,null)}}return a&&Xu(e,t,"srcSet",n.srcSet,n,null),void(s&&Xu(e,t,"src",n.src,n,null));case"input":Mu("invalid",e);var l=r=o=a=null,c=null,u=null;for(s in n)if(n.hasOwnProperty(s)){var d=n[s];if(null!=d)switch(s){case"name":a=d;break;case"type":o=d;break;case"checked":c=d;break;case"defaultChecked":u=d;break;case"value":r=d;break;case"defaultValue":l=d;break;case"children":case"dangerouslySetInnerHTML":if(null!=d)throw Error(i(137,t));break;default:Xu(e,t,s,d,n,null)}}return vt(e,r,l,c,u,o,a,!1),void dt(e);case"select":for(a in Mu("invalid",e),s=o=r=null,n)if(n.hasOwnProperty(a)&&null!=(l=n[a]
vendor: 4,314 bytes, line 2
2))switch(a){case"value":r=l;break;case"defaultValue":o=l;break;case"multiple":s=l;default:Xu(e,t,a,l,n,null)}return t=r,n=o,e.multiple=!!s,void(null!=t?bt(e,!!s,t,!1):null!=n&&bt(e,!!s,n,!0));case"textarea":for(o in Mu("invalid",e),r=a=s=null,n)if(n.hasOwnProperty(o)&&null!=(l=n[o]))switch(o){case"value":s=l;break;case"defaultValue":a=l;break;case"children":r=l;break;case"dangerouslySetInnerHTML":if(null!=l)throw Error(i(91));break;default:Xu(e,t,o,l,n,null)}return wt(e,s,a,r),void dt(e);case"option":for(c in n)if(n.hasOwnProperty(c)&&null!=(s=n[c]))if("selected"===c)e.selected=s&&"function"!==typeof s&&"symbol"!==typeof s;else Xu(e,t,c,s,n,null);return;case"dialog":Mu("beforetoggle",e),Mu("toggle",e),Mu("cancel",e),Mu("close",e);break;case"iframe":case"object":Mu("load",e);break;case"video":case"audio":for(s=0;s<Du.length;s++)Mu(Du[s],e);break;case"image":Mu("error",e),Mu("load",e);break;case"details":Mu("toggle",e);break;case"embed":case"source":case"link":Mu("error",e),Mu("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(u in n)if(n.hasOwnProperty(u)&&null!=(s=n[u]))switch(u){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,t));default:Xu(e,t,u,s,n,null)}return;default:if(Ct(t)){for(d in n)n.hasOwnProperty(d)&&(void 0!==(s=n[d])&&Zu(e,t,d,s,n,void 0));return}}for(l in n)n.hasOwnProperty(l)&&(null!=(s=n[l])&&Xu(e,t,l,s,n,null))}var td=null,nd=null;function rd(e){return 9===e.nodeType?e:e.ownerDocument}function sd(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ad(e,t){if(0===e)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return 1===e&&"foreignObject"===t?0:e}function id(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"bigint"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var od=null;var ld="function"===typeof setTimeout?setTimeout:void 0,cd="function"===typeof clearTimeout?clearTimeout:void 0,ud="function"===typeof Promise?Promise:void 0,dd="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof ud?function(e){return ud.resolve(null).then(e).catch(hd)}:ld;function hd(e){setTimeout(function(){throw e})}function md(e){return"head"===e}function pd(e,t){var n=t,r=0,s=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&8===a.nodeType)if("/$"===(n=a.data)){if(0<r&&8>r){n=r;var i=e.ownerDocument;if(1&n&&wd(i.documentElement),2&n&&wd(i.body),4&n)for(wd(n=i.head),i=n.firstChild;i;){var o=i.nextSibling,l=i.nodeName;i[Ue]||"SCRIPT"===l||"STYLE"===l||"LINK"===l&&"stylesheet"===i.rel.toLowerCase()||n.removeChild(i),i=o}}if(0===s)return e.removeChild(a),void kh(t);s--}else"$"===n||"$?"===n||"$!"===n?s++:r=n.charCodeAt(0)-48;else r=0;n=a}while(n);kh(t)}function fd(e){var t=e.firstChild;for(t&&10===t.nodeType&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":fd(n),Ve(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if("stylesheet"===n.rel.toLowerCase())continue}e.removeChild(n)}}function gd(e){return"$!"===e.data||"$?"===e.data&&"complete"===e.ownerDocument.readyState}function vd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t||"F!"===t||"F"===t)break;if("/$"===t)return null}}return e}var yd=null;function bd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}function xd(e,t,n){switch(t=rd(n),e){case"html":if(!(e=t.documentElement))throw Error(i(452));return e;case"head":if(!(e=t.head))throw Error(i(453));return e;case"body":if(!(e=t.body))throw Error(i(454));return e;default:throw Error(i(451))}}function wd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Ve(e)}var Nd=new Map,jd=new Set;function Ed(e){return"function"===typeof e.getRootNode?e.getRootNode():9===e.nodeType?e:e.ownerDocument}var Sd=O.d;O.d={f:function(){var e=Sd.f(),t=zc();return e||t},r:function(e){var t=Be(e);null!==t&&5===t.tag&&"form"===t.type?Pi(t):Sd.r(e)}
vendor: 4,116 bytes, line 2
2,D:function(e){Sd.D(e),kd("dns-prefetch",e,null)},C:function(e,t){Sd.C(e,t),kd("preconnect",e,t)},L:function(e,t,n){Sd.L(e,t,n);var r=Cd;if(r&&e&&t){var s='link[rel="preload"][as="'+ft(t)+'"]';"image"===t&&n&&n.imageSrcSet?(s+='[imagesrcset="'+ft(n.imageSrcSet)+'"]',"string"===typeof n.imageSizes&&(s+='[imagesizes="'+ft(n.imageSizes)+'"]')):s+='[href="'+ft(e)+'"]';var a=s;switch(t){case"style":a=Ad(e);break;case"script":a=Pd(e)}Nd.has(a)||(e=h({rel:"preload",href:"image"===t&&n&&n.imageSrcSet?void 0:e,as:t},n),Nd.set(a,e),null!==r.querySelector(s)||"style"===t&&r.querySelector(Td(a))||"script"===t&&r.querySelector(Rd(a))||(ed(t=r.createElement("link"),"link",e),We(t),r.head.appendChild(t)))}},m:function(e,t){Sd.m(e,t);var n=Cd;if(n&&e){var r=t&&"string"===typeof t.as?t.as:"script",s='link[rel="modulepreload"][as="'+ft(r)+'"][href="'+ft(e)+'"]',a=s;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":a=Pd(e)}if(!Nd.has(a)&&(e=h({rel:"modulepreload",href:e},t),Nd.set(a,e),null===n.querySelector(s))){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Rd(a)))return}ed(r=n.createElement("link"),"link",e),We(r),n.head.appendChild(r)}}},X:function(e,t){Sd.X(e,t);var n=Cd;if(n&&e){var r=He(n).hoistableScripts,s=Pd(e),a=r.get(s);a||((a=n.querySelector(Rd(s)))||(e=h({src:e,async:!0},t),(t=Nd.get(s))&&Md(e,t),We(a=n.createElement("script")),ed(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(s,a))}},S:function(e,t,n){Sd.S(e,t,n);var r=Cd;if(r&&e){var s=He(r).hoistableStyles,a=Ad(e);t=t||"default";var i=s.get(a);if(!i){var o={loading:0,preload:null};if(i=r.querySelector(Td(a)))o.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Nd.get(a))&&Ld(e,n);var l=i=r.createElement("link");We(l),ed(l,"link",e),l._p=new Promise(function(e,t){l.onload=e,l.onerror=t}),l.addEventListener("load",function(){o.loading|=1}),l.addEventListener("error",function(){o.loading|=2}),o.loading|=4,Od(i,t,r)}i={type:"stylesheet",instance:i,count:1,state:o},s.set(a,i)}}},M:function(e,t){Sd.M(e,t);var n=Cd;if(n&&e){var r=He(n).hoistableScripts,s=Pd(e),a=r.get(s);a||((a=n.querySelector(Rd(s)))||(e=h({src:e,async:!0,type:"module"},t),(t=Nd.get(s))&&Md(e,t),We(a=n.createElement("script")),ed(a,"link",e),n.head.appendChild(a)),a={type:"script",instance:a,count:1,state:null},r.set(s,a))}}};var Cd="undefined"===typeof document?null:document;function kd(e,t,n){var r=Cd;if(r&&"string"===typeof t&&t){var s=ft(t);s='link[rel="'+e+'"][href="'+s+'"]',"string"===typeof n&&(s+='[crossorigin="'+n+'"]'),jd.has(s)||(jd.add(s),e={rel:e,crossOrigin:n,href:t},null===r.querySelector(s)&&(ed(t=r.createElement("link"),"link",e),We(t),r.head.appendChild(t)))}}function _d(e,t,n,r){var s,a,o,l,c=(c=H.current)?Ed(c):null;if(!c)throw Error(i(446));switch(e){case"meta":case"title":return null;case"style":return"string"===typeof n.precedence&&"string"===typeof n.href?(t=Ad(n.href),(r=(n=He(c).hoistableStyles).get(t))||(r={type:"style",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if("stylesheet"===n.rel&&"string"===typeof n.href&&"string"===typeof n.precedence){e=Ad(n.href);var u=He(c).hoistableStyles,d=u.get(e);if(d||(c=c.ownerDocument||c,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,d),(u=c.querySelector(Td(e)))&&!u._p&&(d.instance=u,d.state.loading=5),Nd.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Nd.set(e,n),u||(s=c,a=e,o=n,l=d.state,s.querySelector('link[rel="preload"][as="style"]['+a+"]")?l.loading=1:(a=s.createElement("link"),l.preload=a,a.addEventListener("load",function(){return l.loading|=1}),a.addEventListener("error",function(){return l.loading|=2}),ed(a,"link",o),We(a),s.head.appendChild(a))))),t&&null===r)throw Error(i(528,""));return d}if(t&&null!==r)throw Error(i(529,""));return null;
vendor: 5,668 bytes, line 2
2case"script":return t=n.async,"string"===typeof(n=n.src)&&t&&"function"!==typeof t&&"symbol"!==typeof t?(t=Pd(n),(r=(n=He(c).hoistableScripts).get(t))||(r={type:"script",instance:null,count:0,state:null},n.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Ad(e){return'href="'+ft(e)+'"'}function Td(e){return'link[rel="stylesheet"]['+e+"]"}function Id(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Pd(e){return'[src="'+ft(e)+'"]'}function Rd(e){return"script[async]"+e}function Dd(e,t,n){if(t.count++,null===t.instance)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+ft(n.href)+'"]');if(r)return t.instance=r,We(r),r;var s=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return We(r=(e.ownerDocument||e).createElement("style")),ed(r,"style",s),Od(r,n.precedence,e),t.instance=r;case"stylesheet":s=Ad(n.href);var a=e.querySelector(Td(s));if(a)return t.state.loading|=4,t.instance=a,We(a),a;r=Id(n),(s=Nd.get(s))&&Ld(r,s),We(a=(e.ownerDocument||e).createElement("link"));var o=a;return o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ed(a,"link",r),t.state.loading|=4,Od(a,n.precedence,e),t.instance=a;case"script":return a=Pd(n.src),(s=e.querySelector(Rd(a)))?(t.instance=s,We(s),s):(r=n,(s=Nd.get(a))&&Md(r=h({},n),s),We(s=(e=e.ownerDocument||e).createElement("script")),ed(s,"link",r),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(i(443,t.type))}else"stylesheet"===t.type&&0===(4&t.state.loading)&&(r=t.instance,t.state.loading|=4,Od(r,n.precedence,e));return t.instance}function Od(e,t,n){for(var r=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=r.length?r[r.length-1]:null,a=s,i=0;i<r.length;i++){var o=r[i];if(o.dataset.precedence===t)a=o;else if(a!==s)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=9===n.nodeType?n.head:n).insertBefore(e,t.firstChild)}function Ld(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.title&&(e.title=t.title)}function Md(e,t){null==e.crossOrigin&&(e.crossOrigin=t.crossOrigin),null==e.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),null==e.integrity&&(e.integrity=t.integrity)}var Fd=null;function Ud(e,t,n){if(null===Fd){var r=new Map,s=Fd=new Map;s.set(n,r)}else(r=(s=Fd).get(n))||(r=new Map,s.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),s=0;s<n.length;s++){var a=n[s];if(!(a[Ue]||a[Pe]||"link"===e&&"stylesheet"===a.getAttribute("rel"))&&"http://www.w3.org/2000/svg"!==a.namespaceURI){var i=a.getAttribute(t)||"";i=e+i;var o=r.get(i);o?o.push(a):r.set(i,[a])}}return r}function Vd(e,t,n){(e=e.ownerDocument||e).head.insertBefore(n,"title"===t?e.querySelector("head > title"):null)}function zd(e){return"stylesheet"!==e.type||0!==(3&e.state.loading)}var Bd=null;function qd(){}function Hd(){if(this.count--,0===this.count)if(this.stylesheets)Gd(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}var Wd=null;function Gd(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,Wd=new Map,t.forEach(Kd,e),Wd=null,Hd.call(e))}function Kd(e,t){if(!(4&t.state.loading)){var n=Wd.get(e);if(n)var r=n.get(null);else{n=new Map,Wd.set(e,n);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a<s.length;a++){var i=s[a];"LINK"!==i.nodeName&&"not all"===i.getAttribute("media")||(n.set(i.dataset.precedence,i),r=i)}r&&n.set(null,r)}i=(s=t.instance).getAttribute("data-precedence"),(a=n.get(i)||r)===r&&n.set(null,s),n.set(i,s),this.count++,r=Hd.bind(this),s.addEventListener("load",r),s.addEventListener("error",r),a?a.parentNode.insertBefore(s,a.nextSibling):(e=9===e.nodeType?e.head:e).insertBefore(s,e.firstChild),t.state.loading|=4}}var Jd={$$typeof:w,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function Yd(e,t,n,r,s,a,i,o){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ee(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ee(0),this.hiddenUpdates=Ee(null),this.identifierPrefix=r,this.onUncaughtError=s,this.onCaughtError=a,this.onRecoverableError=i,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=o,this.incompleteTransitions=new Map}function Qd(e,t,n,r,s,a,i,o,l,c,u,d){return e=new Yd(e,t,n,i,o,l,c,d),t=1,!0===a&&(t|=24),a=Lr(3,null,null,t),e.current=a,a.stateNode=e,(t=Rs()).refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},na(a),e}function $d(e){return e?e=Dr:Dr}function Xd(e,t,n,r,s,a){s=$d(s),null===r.context?r.context=s:r.pendingContext=s,(r=sa(t)).payload={element:n},null!==(a=void 0===a?null:a)&&(r.callback=a),null!==(n=aa(e,r,t))&&(Lc(n,0,t),ia(n,e,t))}function Zd(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var n=e.retryLane;e.retryLane=0!==n&&n<t?n:t}}function eh(e,t){Zd(e,t),(e=e.alternate)&&Zd(e,t)}function th(e){if(13===e.tag){var t=Ir(e,67108864);null!==t&&Lc(t,0,67108864),eh(e,67108864)}}var nh=!0;function rh(e,t,n,r){var s=D.T;D.T=null;var a=O.p;try{O.p=2,ah(e,t,n,r)}finally{O.p=a,D.T=s}}function sh(e,t,n,r){var s=D.T;D.T=null;var a=O.p;try{O.p=8,ah(e,t,n,r)}finally{O.p=a,D.T=s}}function ah(e,t,n,r){if(nh){var s=ih(r);if(null===s)Bu(e,t,r,oh,n),yh(e,r);
vendor: 3,462 bytes, line 2
2else if(function(e,t,n,r,s){switch(t){case"focusin":return dh=bh(dh,e,t,n,r,s),!0;case"dragenter":return hh=bh(hh,e,t,n,r,s),!0;case"mouseover":return mh=bh(mh,e,t,n,r,s),!0;case"pointerover":var a=s.pointerId;return ph.set(a,bh(ph.get(a)||null,e,t,n,r,s)),!0;case"gotpointercapture":return a=s.pointerId,fh.set(a,bh(fh.get(a)||null,e,t,n,r,s)),!0}return!1}(s,e,t,n,r))r.stopPropagation();else if(yh(e,r),4&t&&-1<vh.indexOf(e)){for(;null!==s;){var a=Be(s);if(null!==a)switch(a.tag){case 3:if((a=a.stateNode).current.memoizedState.isDehydrated){var i=ye(a.pendingLanes);if(0!==i){var o=a;for(o.pendingLanes|=2,o.entangledLanes|=2;i;){var l=1<<31-me(i);o.entanglements[1]|=l,i&=~l}Nu(a),0===(6&nc)&&(Nc=te()+500,ju(0,!1))}}break;case 13:null!==(o=Ir(a,2))&&Lc(o,0,2),zc(),eh(a,2)}if(null===(a=ih(r))&&Bu(e,t,r,oh,n),a===s)break;s=a}null!==s&&r.stopPropagation()}else Bu(e,t,r,null,n)}}function ih(e){return lh(e=It(e))}var oh=null;function lh(e){if(oh=null,null!==(e=ze(e))){var t=l(e);if(null===t)e=null;else{var n=t.tag;if(13===n){if(null!==(e=c(t)))return e;e=null}else if(3===n){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return oh=e,null}function ch(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ne()){case re:return 2;case se:return 8;case ae:case ie:return 32;case oe:return 268435456;default:return 32}default:return 32}}var uh=!1,dh=null,hh=null,mh=null,ph=new Map,fh=new Map,gh=[],vh="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yh(e,t){switch(e){case"focusin":case"focusout":dh=null;break;case"dragenter":case"dragleave":hh=null;break;case"mouseover":case"mouseout":mh=null;break;case"pointerover":case"pointerout":ph.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fh.delete(t.pointerId)}}function bh(e,t,n,r,s,a){return null===e||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[s]},null!==t&&(null!==(t=Be(t))&&th(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,null!==s&&-1===t.indexOf(s)&&t.push(s),e)}function xh(e){var t=ze(e.target);if(null!==t){var n=l(t);
vendor: 5,288 bytes, line 2
2if(null!==n)if(13===(t=n.tag)){if(null!==(t=c(n)))return e.blockedOn=t,void function(e,t){var n=O.p;try{return O.p=e,t()}finally{O.p=n}}(e.priority,function(){if(13===n.tag){var e=Dc();e=_e(e);var t=Ir(n,e);null!==t&&Lc(t,0,e),eh(n,e)}})}else if(3===t&&n.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function wh(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var n=ih(e.nativeEvent);if(null!==n)return null!==(t=Be(n))&&th(t),e.blockedOn=n,!1;var r=new(n=e.nativeEvent).constructor(n.type,n);Tt=r,n.target.dispatchEvent(r),Tt=null,t.shift()}return!0}function Nh(e,t,n){wh(e)&&n.delete(t)}function jh(){uh=!1,null!==dh&&wh(dh)&&(dh=null),null!==hh&&wh(hh)&&(hh=null),null!==mh&&wh(mh)&&(mh=null),ph.forEach(Nh),fh.forEach(Nh)}function Eh(e,t){e.blockedOn===t&&(e.blockedOn=null,uh||(uh=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,jh)))}var Sh=null;function Ch(e){Sh!==e&&(Sh=e,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){Sh===e&&(Sh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],s=e[t+2];if("function"!==typeof r){if(null===lh(r||n))continue;break}var a=Be(n);null!==a&&(e.splice(t,3),t-=3,Ti(a,{pending:!0,data:s,method:n.method,action:r},r,s))}}))}function kh(e){function t(t){return Eh(t,e)}null!==dh&&Eh(dh,e),null!==hh&&Eh(hh,e),null!==mh&&Eh(mh,e),ph.forEach(t),fh.forEach(t);for(var n=0;n<gh.length;n++){var r=gh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<gh.length&&null===(n=gh[0]).blockedOn;)xh(n),null===n.blockedOn&&gh.shift();if(null!=(n=(e.ownerDocument||e).$$reactFormReplay))for(r=0;r<n.length;r+=3){var s=n[r],a=n[r+1],i=s[Re]||null;if("function"===typeof a)i||Ch(n);else if(i){var o=null;if(a&&a.hasAttribute("formAction")){if(s=a,i=a[Re]||null)o=i.formAction;else if(null!==lh(s))continue}else o=i.action;"function"===typeof o?n[r+1]=o:(n.splice(r,3),r-=3),Ch(n)}}}function _h(e){this._internalRoot=e}function Ah(e){this._internalRoot=e}Ah.prototype.render=_h.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(i(409));Xd(t.current,Dc(),e,t,null,null)},Ah.prototype.unmount=_h.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;Xd(e.current,2,null,e,null,null),zc(),t[De]=null}},Ah.prototype.unstable_scheduleHydration=function(e){if(e){var t=Te();e={blockedOn:null,target:e,priority:t};for(var n=0;n<gh.length&&0!==t&&t<gh[n].priority;n++);gh.splice(n,0,e),0===n&&xh(e)}};var Th=s.version;if("19.1.0"!==Th)throw Error(i(527,Th,"19.1.0"));O.findDOMNode=function(e){var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(i(188));throw e=Object.keys(e).join(","),Error(i(268,e))}return e=function(e){var t=e.alternate;if(!t){if(null===(t=l(e)))throw Error(i(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(null===s)break;var a=s.alternate;if(null===a){if(null!==(r=s.return)){n=r;continue}break}if(s.child===a.child){for(a=s.child;a;){if(a===n)return u(s),e;if(a===r)return u(s),t;a=a.sibling}throw Error(i(188))}if(n.return!==r.return)n=s,r=a;else{for(var o=!1,c=s.child;c;){if(c===n){o=!0,n=s,r=a;break}if(c===r){o=!0,r=s,n=a;break}c=c.sibling}if(!o){for(c=a.child;c;){if(c===n){o=!0,n=a,r=s;break}if(c===r){o=!0,r=a,n=s;break}c=c.sibling}if(!o)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(3!==n.tag)throw Error(i(188));return n.stateNode.current===n?e:t}(t),e=null===(e=null!==e?d(e):null)?null:e.stateNode};var Ih={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.1.0"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var Ph=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ph.isDisabled&&Ph.supportsFiber)try{ue=Ph.inject(Ih),de=Ph}catch(Dh){}}t.createRoot=function(e,t){if(!o(e))throw Error(i(299));var n=!1,r="",s=yo,a=bo,l=xo;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(n=!0),void 0!==t.identifierPrefix&&(r=t.identifierPrefix),void 0!==t.onUncaughtError&&(s=t.onUncaughtError),void 0!==t.onCaughtError&&(a=t.onCaughtError),void 0!==t.onRecoverableError&&(l=t.onRecoverableError),void 0!==t.unstable_transitionCallbacks&&t.unstable_transitionCallbacks),t=Qd(e,1,!1,null,0,n,r,s,a,l,0,null),e[De]=t.current,Vu(e),new _h(t)},t.hydrateRoot=function(e,t,n){if(!o(e))throw Error(i(299));var r=!1,s="",a=yo,l=bo,c=xo,u=null;return null!==n&&void 0!==n&&(!0===n.unstable_strictMode&&(r=!0),void 0!==n.identifierPrefix&&(s=n.identifierPrefix),void 0!==n.onUncaughtError&&(a=n.onUncaughtError),void 0!==n.onCaughtError&&(l=n.onCaughtError),void 0!==n.onRecoverableError&&(c=n.onRecoverableError),void 0!==n.unstable_transitionCallbacks&&n.unstable_transitionCallbacks,void 0!==n.formState&&(u=n.formState)),(t=Qd(e,1,!0,t,0,r,s,a,l,c,0,u)).context=$d(null),n=t.current,(s=sa(r=_e(r=Dc()))).callback=null,aa(n,s,r),n=r,t.current.lanes=n,Se(t,n),Nu(t),e[De]=t.current,Vu(e),new Ah(t)},t.version="19.1.0"},7006:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>h});var s=n(5043),a=n(342),i=n(1105),o=n(628),l=n(7096),c=n(5082),u=(n(346),n(579)),d=e([i,o,l]);[i,o,l]=d.then?(await d)():d;const h=e=>{let{courseId:t,courseTitle:n,coursePrice:r,onSuccess:l,onError:d,onCancel:h,disabled:m=!1}=e;const{user:p}
2=(0,a.A)(),f=(0,s.useRef)(),[g,v]=(0,s.useState)(!0),[y,b]=(0,s.useState)(!1),[x,w]=(0,s.useState)(!1),[N,j]=(0,s.useState)(!1),[E,S]=(0,s.useState)(!1),[C,k]=(0,s.useState)(null),[_,A]=(0,s.useState)(r),[T]=(0,s.useState)(r),I="Acpw6Y9AC_WmjeowDefzez5UraQz8Is2eli9_B1EiyTmkiilTremv-JSsTzcT65epfBO3BHiBmn7X-OF",P=!1;(0,s.useEffect)(()=>(console.log("PayPal is disabled via REACT_APP_ENABLE_PAYPAL"),void v(!1)),[I,d,P]);const R=e=>{k(e),A(e.finalAmount)},D=()=>{k(null),A(T)},O=(0,s.useCallback)(()=>{f.current&&window.paypal&&(f.current.innerHTML="",window.paypal.Buttons({createOrder:(e,r)=>{if(console.log("Creating PayPal order for:",n,"$"+_),!_||_<=0)throw console.error("\u274c Invalid payment amount:",_),alert("Invalid payment amount. Please refresh and try again."),new Error("Invalid payment amount");if(null===p||void 0===p||!p.uid)throw console.error("\u274c User not authenticated"),alert("Please log in to continue with payment."),new Error("User not authenticated");const s={purchase_units:[{amount:{value:_.toString(),currency_code:"USD"},description:C?"Enrollment for ".concat(n," (Coupon: ").concat(C.couponCode,")"):"Enrollment for ".concat(n),custom_id:t,soft_descriptor:"TuneParams Course"}],application_context:{brand_name:"TuneParams.ai",landing_page:"BILLING",user_action:"PAY_NOW",shipping_preference:"NO_SHIPPING"}};return console.log("Order data being sent to PayPal:",s),r.order.create(s).then(e=>(console.log("\u2705 PayPal order created:",e),e)).catch(e=>{console.error("\u274c Failed to create PayPal order:",e);let t="Failed to create payment order";throw e.message&&e.message.includes("422")?t="PayPal Client ID invalid. Please contact support.":e.message&&e.message.includes("401")?t="PayPal authentication failed. Please contact support.":e.message&&e.message.includes("403")?t="PayPal access denied. Please contact support.":e.message&&(t="PayPal error: ".concat(e.message)),alert(t),e})},onApprove:async(e,r)=>{console.log("Processing payment approval...");try{var s,a,i,c;const e=await r.order.capture();if(console.log("\u2705 Payment captured successfully"),null===e||void 0===e||null===(s=e.purchase_units)||void 0===s||null===(a=s[0])||void 0===a||null===(i=a.payments)||void 0===i||null===(c=i.captures)||void 0===c||!c[0])throw console.error("\u274c Invalid payment structure"),new Error("Payment capture failed. Please contact support.");const d=e.purchase_units[0].payments.captures[0];if("COMPLETED"!==d.status)throw console.error("\u274c Payment not completed:",d.status),new Error("Payment ".concat(d.status.toLowerCase(),". Please try again."));if(console.log("\u2705 Payment completed successfully"),!l)return console.error("\u274c No success handler provided"),void alert("Payment successful but no success handler. Please contact support.");{const r=e.payer.name?"".concat(e.payer.name.given_name||""," ").concat(e.payer.name.surname||"").trim():"Student",s={orderID:e.id,payerID:e.payer.payer_id,paymentID:e.purchase_units[0].payments.captures[0].id,courseId:t,courseTitle:n,amount:_,originalAmount:T,payerEmail:e.payer.email_address,payerName:r,transactionStatus:e.status,timestamp:(new Date).toISOString(),paymentSource:e.purchase_units[0].payments.captures[0].payment_source||{},fundingSource:e.purchase_units[0].payments.captures[0].funding_source||null,payerAddress:e.payer.address||null,termsAccepted:x,termsAcceptedAt:(new Date).toISOString(),appliedCoupon:C};console.log("Calling success handler with data:",s);try{l(s),console.log("\u2705 Success handler called successfully")}catch(u){return console.error("\u274c Error in success handler:",u),void alert("Payment successful but enrollment failed: ".concat(u.message,". Please contact support with Order ID: ").concat(e.id))}if(C)try{const n=await(0,o.Fo)(C.couponId,null===p||void 0===p?void 0:p.uid,t,{orderAmount:T,discountAmount:C.discountAmount,finalAmount:_,paymentId:e.purchase_units[0].payments.captures[0].id,orderId:e.id});n.success?console.log("Coupon usage recorded successfully"):console.error("Failed to record coupon usage:",n.error)}catch(h){console.error("Error recording coupon usage:",h)}}}catch(m){console.error("Payment processing error:",m);let e="Payment processing failed. Please try again.";m.message&&m.message.includes("capture")?e="Payment capture failed. Your card may have been charged but enrollment was not completed. Please contact support.":m.message&&m.message.includes("network")?e="Network error during payment processing. Please check your connection and try again.":m.message&&(e=m.message);const t=new Error(e);t.originalError=m,d&&d(t)}},onError:e=>{console.error("PayPal payment error:",e);let t="Payment failed. Please try again.";"VALIDATION_ERROR"===e.name?t="Payment validation failed. Please check your payment information and try again.":"INSTRUMENT_DECLINED"===e.name?t="Your payment method was declined. Please try a different card or payment method.":"PAYER_ACTION_REQUIRED"===e.name?t="Additional verification required. Please complete the payment process.":"UNPROCESSABLE_ENTITY"===e.name?t="Payment c
2ould not be processed. Please verify your payment details.":e.message&&e.message.includes("network")&&(t="Network error. Please check your connection and try again.");const n=new Error(t);n.originalError=e,d&&d(n)},onCancel:e=>{h&&h(e)},style:{layout:"vertical",color:"blue",shape:"rect",label:"pay",height:45,tagline:!1}}).render(f.current).then(()=>{console.log("\u2705 PayPal Buttons rendered successfully")}).catch(e=>{console.error("\u274c Failed to render PayPal Buttons:",e),d&&d(new Error("Failed to load payment options. Please refresh the page and try again."))}))},[_,n,t,l,d,h,C,T,x,p]);return(0,s.useEffect)(()=>{y&&!m&&_>0&&x?O():f.current&&(f.current.innerHTML="")},[y,m,_,x,O]),(0,u.jsxs)("div",{className:"paypal-checkout-container",children:[p&&(0,u.jsx)(i.A,{userId:p.uid,courseId:t,originalAmount:T,onCouponApplied:R,onCouponRemoved:D,disabled:m}),(0,u.jsxs)("div",{className:"payment-summary",children:[(0,u.jsx)("h4",{children:"Payment Summary"}),(0,u.jsxs)("div",{className:"payment-details",children:[(0,u.jsxs)("div",{className:"payment-item",children:[(0,u.jsx)("span",{children:"Course:"}),(0,u.jsx)("span",{children:n})]}),C&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{className:"payment-item",children:[(0,u.jsx)("span",{children:"Original Price:"}),(0,u.jsxs)("span",{children:["$",T.toFixed(2)]})]}),(0,u.jsxs)("div",{className:"payment-item discount-item",children:[(0,u.jsxs)("span",{children:["Discount (",C.couponCode,"):"]}),(0,u.jsxs)("span",{children:["-$",C.discountAmount.toFixed(2)]})]})]}),(0,u.jsxs)("div",{className:"payment-item total",children:[(0,u.jsx)("span",{children:"Total:"}),(0,u.jsxs)("span",{children:["$",_.toFixed(2)]})]}),C&&C.savings>0&&(0,u.jsxs)("div",{className:"savings-info",children:["You save $",C.savings.toFixed(2),"!"]})]})]}),(0,u.jsxs)("div",{className:"terms-conditions-section",children:[(0,u.jsx)("div",{className:"terms-checkbox-container",children:(0,u.jsxs)("label",{className:"terms-checkbox-label",children:[(0,u.jsx)("input",{type:"checkbox",checked:x,onChange:e=>w(e.target.checked),className:"terms-checkbox"}),(0,u.jsx)("span",{className:"checkmark"}),(0,u.jsxs)("span",{className:"terms-text",children:["I agree to the ",(0,u.jsx)("button",{type:"button",className:"terms-link",onClick:()=>j(!0),children:"Terms and Conditions"})," and ",(0,u.jsx)("button",{type:"button",className:"terms-link",onClick:()=>S(!0),children:"Privacy Policy"})]})]})}),!x&&(0,u.jsx)("p",{className:"terms-requirement",children:"Please accept the Terms and Conditions to proceed with payment."})]}),(0,u.jsx)("div",{style:{marginTop:12},children:(0,u.jsx)(c.A,{courseId:t,courseTitle:n,coursePrice:_,user:p,onSuccess:l,onError:d,disabled:!x})})]})};r()}catch(h){r(h)}})},7010:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>h});var s=n(5043),a=n(4366),i=n(342),o=n(1798),l=n(5491),c=n(4532),u=(n(4685),n(579)),d=e([o,l]);[o,l]=d.then?(await d)():d;const h=e=>{let{course:t,isEnrolled:n=!1}=e;const r=(0,a.Zp)(),{user:d}=(0,i.A)(),[h,m]=(0,s.useState)(!1),[p,f]=(0,s.useState)(!1),{stats:g,loading:v}=(0,o.I1)(t.id,!1),y=(0,l.lk)(t),b=v?t.students||0:g.enrollmentCount,x=t.maxCapacity||0,w=!y&&x>0&&b/x>=.8,N=!y&&x>0&&b>=x,j=function(e){return!y||"TBD"!==e&&"N/A"!==e&&null!==e&&0!==e?e||(arguments.length>1&&void 0!==arguments[1]?arguments[1]:"TBD"):"Coming Soon"};return(0,u.jsxs)("div",{className:"course-card",onClick:()=>{r("/courses/".concat(t.id))},children:[n?(0,u.jsx)("div",{className:"enrollment-status enrolled",children:"\u2705 Enrolled"}):y?(0,u.jsx)("div",{className:"enrollment-status coming-soon",children:"Coming Soon"}):w&&(0,u.jsx)("div",{className:"enrollment-status ".concat(N?"full":"nearly-full"),children:N?"Course Full":"Few Seats Left"}),(0,u.jsx)("div",{className:"course-image",children:!t.image||h?(0,u.jsx)("div",{className:"course-image-fallback",children:t.icon}):(0,u.jsxs)("div",{className:"course-image-container",children:[!p&&(0,u.jsx)("div",{className:"course-image-loading",children:t.icon}),(0,u.jsx)("img",{src:t.image,alt:t.title,className:"course-image-img ".concat(p?"loaded":"loading"),onError:()=>{m(!0)},onLoad:()=>{f(!0)},style:{display:p?"block":"none"}})]})}),(0,u.jsx)("h3",{className:"course-title",children:t.title}),(0,u.jsx)("p",{className:"course-description",children:t.description}),(0,u.jsxs)("div",{className:"course-meta",children:[(0,u.jsx)("span",{className:"course-level",children:j(t.level)}),(0,u.jsxs)("span",{className:"course-duration",children:["\u23f1\ufe0f ",j(t.duration)]})]}),(0,u.jsxs)("div",{className:"course-stats",children:[(0,u.jsxs)("span",{className:"course-stat",children:["\ud83d\udcda ",j(t.lessons)," lessons"]}),(0,u.jsx)("div",{className:"course-stat course-rating-stat",children:y?"Coming Soon":(0,u.jsx)(c.A,{rating:v?t.rating:g.hasReviews?g.averageRating:t.rating,reviewCount:v?0:g.reviewCount,showReviewCount:!v&&g.hasReviews,size:"small",showNumeric:!0})})]}),(0,u.jsxs)("div",{className:"course-price",children:[t.originalPrice&&!y&&(0,u.jsxs)("span",{className:"original-price",children:["$",t.originalPrice]}),y?"Price TBD":"$".concat(t.price)]}),(0,u.jsx)("div",{className:"course-action",children:(0,u.jsx)("button",{className:"btn enroll-btn ".concat(y?"coming-soon":""," ").concat(n?"enrolled":""),onClick:e=>{e.stopPropagation(),r(d?n?"/course/".concat(t.id,"/dashboard"):"/courses/".concat(t.id):"/login")},disabled:y,children:n?"Continue Learning":y?"Coming Soon":d?"Enroll Now":"Login to Enroll"})})]})};r()}catch(h){r(h)}})},7096:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{K3:()=>b,WA:()=>f,cV:()=>x,dg:()=>g,tj:()=>v,vv:()=>y});var s=n(2555),a=n(5472),i=n(8426),o=n(3387),l=n(9540),c=n(7417),u=n(628),d=n(5491),h=e([u,d]);[u,d]=h.then?(await h)():h;const m=async(e,t)=>{try{if(!i.db)throw new Error("Firestore not initialized");const n=await(0,o.VM)(t),r=n.success?n.userData:null,s={paymentId:e.paymentID,orderId:e.orderID,payerId:e.payerID,courseId:e.courseId,courseTitle:e.courseTitle,amount:parseFloat(e.amount),originalAmount:e.originalAmount?parseFloat(e.originalAmount):parseFloat(e.amount),appliedCoupon:e.appliedCoupon||null,discountAmount:e.appliedCoupon?e.appliedCoupon.discountAmount:0,couponCode:e.appliedCoupon?e.appliedCoupon.couponCode:null,userId:t,userEmail:(null===r||void 0===r?void 0:r.email)||e.payerEmail,userName:(null===r||void 0===r?void 0:r.displayName)||e.payerName,payerEmail:e.payerEmail,payerName:e.payerName,status:"completed",transactionStatus:e.transactionStatus,paymentMethod:"paypal",termsAccepted:e.termsAccepted||!1,termsAcceptedAt:e.termsAcceptedAt?new Date(e.termsAcceptedAt):null,paymentDate:e.timestamp?new Date(e.timestamp):new Date,createdAt:(0,a.O5)(),updatedAt:(0,a.O5)()};return{success:!0,paymentRecordId:(await(0,a.gS)((0,a.rJ)(i.db,"payments"),s)).id}}catch(n){return{success:!1,error:n.message}}},p=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{if(!i.db)throw new Error("Firestore not initialized");const s=await(0,d.BZ)(t);if(!s)throw new Error("Course not found: ".concat(t));const o=await(0,d.hJ)(t);if(!o)throw new Error("No available batches for enrollment");const l={userId:e,userEmail:r,courseId:t,courseTitle:n.courseTitle||s.title,batchNumber:o.batchNumber,batchStartDate:o.startDate,batchEndDate:o.endDate,batchStatus:o.status,status:"enrolled",progress:0,paymentId:n.paymentID,orderId:n.orderID,amountPaid:parseFloat(n.amount),termsAccepted:n.termsAccepted||!1,termsAcceptedAt:n.termsAcceptedAt?new Date(n.termsAcceptedAt):null,enrolledAt:(0,a.O5)(),lastAccessed:null,completedAt:null,paymentMethod:"paypal",enrollmentSource:"web_purchase"},c="".concat(e,"_").concat(t,"_batch").concat(o.batchNumber),u=(0,a.H9)(i.db,"enrollments",c);return await(0,a.BN)(u,l),{success:!0,enrollmentId:c,batchNumber:o.batchNumber,batchInfo:{startDate:o.startDate,endD
2ate:o.endDate,status:o.status}}}catch(s){return{success:!1,error:s.message}}},f=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;try{if(!i.db)return{hasAccess:!1,error:"Firestore not initialized"};if(n){const r="".concat(e,"_").concat(t,"_batch").concat(n),o=(0,a.H9)(i.db,"enrollments",r),l=await(0,a.x7)(o);if(l.exists()){const e=l.data();return await(0,a.mZ)(o,{lastAccessed:(0,a.O5)()}),{hasAccess:!0,enrollment:(0,s.A)((0,s.A)({},e),{},{id:l.id})}}return{hasAccess:!1,enrollment:null}}const r=(0,a.P)((0,a.rJ)(i.db,"enrollments"),(0,a._M)("userId","==",e),(0,a._M)("courseId","==",t),(0,a._M)("status","==","enrolled")),o=await(0,a.GG)(r);if(o.empty)return{hasAccess:!1,enrollment:null};let l=null,c=null;return o.forEach(e=>{const t=e.data();(!l||t.enrolledAt&&(!l.enrolledAt||t.enrolledAt.toDate()>l.enrolledAt.toDate()))&&(l=t,c=e)}),l&&c?(await(0,a.mZ)(c.ref,{lastAccessed:(0,a.O5)()}),{hasAccess:!0,enrollment:(0,s.A)((0,s.A)({},l),{},{id:c.id}),allEnrollments:o.docs.map(e=>(0,s.A)({id:e.id},e.data()))}):{hasAccess:!1,enrollment:null}}catch(r){return{hasAccess:!1,error:r.message}}},g=async e=>{try{if(!i.db)return{success:!1,error:"Firestore not initialized"};const t=(0,a.P)((0,a.rJ)(i.db,"enrollments"),(0,a._M)("userId","==",e)),n=await(0,a.GG)(t),r=[];return n.forEach(e=>{r.push((0,s.A)({id:e.id},e.data()))}),{success:!0,enrollments:r}}catch(t){return{success:!1,error:t.message,enrollments:[]}}},v=async(e,t)=>{try{var n,r,s,a,i,d,h;const g=await(0,o.VM)(t),v=g.success?g.userData:null,y=null===v||void 0===v?void 0:v.email;if(!y)throw new Error("User email not found");const b={courseId:e.courseId,courseTitle:e.courseTitle,amount:0,originalAmount:e.originalAmount,paymentID:"FREE_".concat(Date.now(),"_").concat(t.substring(0,8)),orderID:"FREE_ORDER_".concat(Date.now()),payerEmail:y,payerName:(null===v||void 0===v?void 0:v.displayName)||(null===v||void 0===v||null===(n=v.email)||void 0===n?void 0:n.split("@")[0])||"Student",transactionStatus:"Free_Enrollment",timestamp:(new Date).toISOString(),termsAccepted:e.termsAccepted||!0,termsAcceptedAt:(new Date).toISOString(),appliedCoupon:e.appliedCoupon,paymentMethod:"Free_Coupon",fundingSource:"Coupon_100_Percent_Off"},x=await p(t,e.courseId,b,y);if(!x.success)throw new Error("Enrollment failed: ".concat(x.error));const w=(new Date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}),N={userName:(null===v||void 0===v?void 0:v.displayName)||(null===v||void 0===v||null===(r=v.email)||void 0===r?void 0:r.split("@")[0])||"Student",userEmail:y,courseTitle:e.courseTitle,courseId:e.courseId,amount:0,originalAmount:e.originalAmount,paymentId:b.paymentID,orderId:b.orderID,enrollmentId:x.enrollmentId,enrollmentDate:w,batchNumber:x.batchNumber,batchStartDate:null===(s=x.batchInfo)||void 0===s?void 0:s.startDate,batchEndDate:null===(a=x.batchInfo)||void 0===a?void 0:a.endDate,batchStatus:null===(i=x.batchInfo)||void 0===i?void 0:i.status,paymentMethod:"Free Enrollment (100% Off Coupon)",payerName:b.payerName,payerEmail:b.payerEmail,transactionStatus:"Free Enrollment",paymentSource:null,fundingSource:"Coupon_100_Percent_Off",appliedCoupon:e.appliedCoupon},j=await(0,l.cK)(N);let E=null;try{E=await(0,c.w9)(N,j,t),E.success}catch(m){}if(e.appliedCoupon)try{await(0,u.Fo)(e.appliedCoupon.couponId,t,e.courseId,{orderAmount:e.originalAmount,discountAmount:e.appliedCoupon.discountAmount,finalAmount:0,paymentId:b.paymentID,orderId:b.orderID,enrollmentType:"free_coupon"})}catch(f){}return{success:!0,enrollmentId:x.enrollmentId,batchNumber:x.batchNumber,batchInfo:x.batchInfo,emailSent:j.success,emailTrackingId:null===(d=E)||void 0===d?void 0:d.emailRecordId,paymentId:b.paymentID,orderId:b.orderID,enrollmentType:"free_coupon",couponUsed:(null===(h=e.appliedCoupon)||void 0===h?void 0:h.couponCode)||null}}catch(g){return{success:!1,error:g.message}}},y=async(e,t)=>{try{var n,r,s,a,i;const d=await(0,o.VM)(t),h=d.success?d.userData:null,f=null===h||void 0===h?void 0:h.email,g=await m(e,t);if(!g.success)throw new Error("Payment recording failed: ".concat(g.error));const v=await p(t,e.courseId,e,f);if(!v.success)throw new Error("Enrollment failed: ".concat(v.error));const y=(new Date).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}),b={userName:(null===h||void 0===h?void 0:h.displayName)||(null===h||void 0===h||null===(n=h.email)||void 0===n?void 0:n.split("@")[0])||"Student",userEmail:(null===h||void 0===h?void 0:h.email)||e.payerEmail,courseTitle:e.courseTitle,courseId:e.courseId,amount:e.amount,paymentId:e.paymentID,orderId:e.orderID,enrollmentId:v.enrollmentId,enrollmentDate:y,batchNumber:v.batchNumber,batchStartDate:null===(r=v.batchInfo)||void 0===r?void 0:r.startDate,batchEndDate:null===(s=v.batchInfo)||void 0===s?void 0:s.endDate,batchStatus:null===(a=v.batchInfo)||void 0===a?void 0:a.status,paymentMethod:"PayPal",payerName:e.payerName,payerEmail:e.payerEmail,transactionStatus:e.transactionStatus,paymentSource:e.paymentSource||null,fundingSource:e.fundingSource||null},x=await(0,l.cK)(b);let w=null;try{w=await(0,c.w9)(b,x,t),w.success}catch(u){}return x.success||x.skipped,{success:!0,paymentRecordId:g.paymentRecordId,enrollmentId:v.enrollmentId,batchNumber:v.batchNumber,batchInfo:v.batchInfo,emailSent:x.success,emailError:x.success?null:x.error,emailTrackingId:(null===(i=w)||void 0===i?void 0:i.emailRecordId)||null,enrollmentData:b}}catch(d){return{success:!1,error:d.message}}},b=async function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;try{if(!i.db)throw new Error("Firestore not initialized");let s;if(r){const n="".concat(e,"_").concat(t,"_batch").concat(r);s=(0,a.H9)(i.db,"enrollments",n);if(!(await(0,a.x7)(s)).exists())throw new Error("No enrollment found for batch ".concat(r))}else{const n=(0,a.P)((0,a.rJ)(i.db,"enrollments"),(0,a._M)("userId","==",e),(0,a._M)("courseId","==",t),(0,a._M)("status","in",["enrolled","active"])),r=await(0,a.GG)(n);if(r.empty)throw new Error("No active enrollment found for this course");let o=null,l=null;
2if(r.forEach(e=>{var t;const n=null===(t=e.data().enrolledAt)||void 0===t?void 0:t.toDate();(!l||n&&n>l)&&(l=n,o=e)}),!o)throw new Error("Could not determine latest enrollment");s=o.ref}const o={progress:Math.min(Math.max(n,0),100),lastAccessed:(0,a.O5)(),updatedAt:(0,a.O5)()};return n>=100&&(o.completedAt=(0,a.O5)(),o.status="completed"),await(0,a.mZ)(s,o),{success:!0,enrollmentId:s.id}}catch(s){return{success:!1,error:s.message}}},x=async function(e,t,r){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0;try{if(!i.db)throw new Error("Firestore not initialized");const u=await(0,d.BZ)(t);if(!u)throw new Error("Course not found: ".concat(t));let h;if(s){const{getCourseBatches:e}=await Promise.resolve().then(n.bind(n,7324));if(h=(await e(t)).find(e=>e.batchNumber===parseInt(s)),!h)throw new Error("Batch ".concat(s," not found for course ").concat(t))}else if(h=await(0,d.hJ)(t),!h)throw new Error("No available batches for enrollment");const m="".concat(e,"_").concat(t,"_batch").concat(h.batchNumber),p=(0,a.H9)(i.db,"enrollments",m);if((await(0,a.x7)(p)).exists())throw new Error("User is already enrolled in ".concat(u.title," - Batch ").concat(h.batchNumber));const f=await(0,o.VM)(e),g=f.success?f.userData:null,v={userId:e,userEmail:null===g||void 0===g?void 0:g.email,courseId:t,courseTitle:u.title,batchNumber:h.batchNumber,batchStartDate:h.startDate,batchEndDate:h.endDate,batchStatus:h.status,status:"enrolled",progress:0,enrollmentType:"manual",manualEnrollmentBy:r,manualEnrollmentNotes:l,amountPaid:parseFloat(c)||0,termsAccepted:null,termsAcceptedAt:null,enrolledAt:(0,a.O5)(),lastAccessed:null,completedAt:null,paymentMethod:"manual",enrollmentSource:"admin_manual"};return await(0,a.BN)(p,v),{success:!0,enrollmentId:m,batchNumber:h.batchNumber,batchInfo:{startDate:h.startDate,endDate:h.endDate,status:h.status,batchName:h.batchName}}}catch(u){return{success:!1,error:u.message}}};r()}catch(m){r(m)}})},7106:()=>{},7116:(e,t,n)=>{n.d(t,{A:()=>s});n(5043);var r=n(579);const s=()=>(0,r.jsx)("div",{className:"about-page-container",children:(0,r.jsxs)("div",{className:"about-card metallic-border metallic-glow",children:[(0,r.jsxs)("header",{className:"about-header",children:[(0,r.jsx)("h1",{className:"about-title",children:"\ud83d\udc4b About Us"}),(0,r.jsxs)("p",{className:"about-subtitle",children:["Hello! from ",(0,r.jsx)("span",{className:"metallic-text",children:"TuneParams"})]})]}),(0,r.jsxs)("section",{className:"about-section",children:[(0,r.jsx)("p",{children:"Our journey begins with our instructors \u2014 PhDs in Machine Learning from top-tier universities, with over 8 years of research experience and 2 years building state-of-the-art AI models in industry. They have worked on cutting-edge applications and now bring their expertise to guide you, from foundational concepts to advanced mastery."}),(0,r.jsx)("p",{children:"Together, we\u2019re a small, passionate team with diverse backgrounds, united by a shared mission: to make a positive societal impact through Artificial Intelligence. We start with accessible, practical, and impactful AI courses designed for learners from all\xa0walks\xa0of\xa0life."}),(0,r.jsxs)("p",{className:"about-highlight metallic-border",children:["At ",(0,r.jsx)("strong",{children:"TuneParams.ai"}),", we don\u2019t just teach you. We prepare you to become an AI expert - confident, capable, and ready to thrive in the era of AI."]})]})]})})},7150:(e,t,n)=>{n.d(t,{MF:()=>de,j6:()=>ie,xZ:()=>oe,om:()=>ae,Sx:()=>me,Wp:()=>he,KO:()=>pe});var r=n(8812),s=n(443),a=n(1529),i=n(2555);let o,l;const c=new WeakMap,u=new WeakMap,d=new WeakMap,h=new WeakMap,m=new WeakMap;let p={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return u.get(e);if("objectStoreNames"===t)return e.objectStoreNames||d.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return v(e[t])},set:(e,t,n)=>(e[t]=n,!0),has:(e,t)=>e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e};function f(e){return e!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(l||(l=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(e)?function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(y(this),n),v(c.get(this))}:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];
2return v(e.apply(y(this),n))}:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];const a=e.call(y(this),t,...r);return d.set(a,t.sort?t.sort():[t]),v(a)}}function g(e){return"function"===typeof e?f(e):(e instanceof IDBTransaction&&function(e){if(u.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",s),e.removeEventListener("error",a),e.removeEventListener("abort",a)},s=()=>{t(),r()},a=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",s),e.addEventListener("error",a),e.addEventListener("abort",a)});u.set(e,t)}(e),t=e,(o||(o=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])).some(e=>t instanceof e)?new Proxy(e,p):e);var t}function v(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",s),e.removeEventListener("error",a)},s=()=>{t(v(e.result)),r()},a=()=>{n(e.error),r()};e.addEventListener("success",s),e.addEventListener("error",a)});return t.then(t=>{t instanceof IDBCursor&&c.set(t,e)}).catch(()=>{}),m.set(t,e),t}(e);if(h.has(e))return h.get(e);const t=g(e);return t!==e&&(h.set(e,t),m.set(t,e)),t}const y=e=>m.get(e);const b=["get","getKey","getAll","getAllKeys","count"],x=["put","add","delete","clear"],w=new Map;function N(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!==typeof t)return;if(w.get(t))return w.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=x.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!s&&!b.includes(n))return;const a=async function(e){const t=this.transaction(e,s?"readwrite":"readonly");let a=t.store;for(var i=arguments.length,o=new Array(i>1?i-1:0),l=1;l<i;l++)o[l-1]=arguments[l];return r&&(a=a.index(o.shift())),(await Promise.all([a[n](...o),s&&t.done]))[0]};return w.set(t,a),a}p=(e=>(0,i.A)((0,i.A)({},e),{},{get:(t,n,r)=>N(t,n)||e.get(t,n,r),has:(t,n)=>!!N(t,n)||e.has(t,n)}))(p);class j{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null===t||void 0===t?void 0:t.type)}(e)){const t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null}).filter(e=>e).join(" ")}}const E="@firebase/app",S="0.13.2",C=new s.Vy("@firebase/app"),k="@firebase/app-compat",_="@firebase/analytics-compat",A="@firebase/analytics",T="@firebase/app-check-compat",I="@firebase/app-check",P="@firebase/auth",R="@firebase/auth-compat",D="@firebase/database",O="@firebase/data-connect",L="@firebase/database-compat",M="@firebase/functions",F="@firebase/functions-compat",U="@firebase/installations",V="@firebase/installations-compat",z="@firebase/messaging",B="@firebase/messaging-compat",q="@firebase/performance",H="@firebase/performance-compat",W="@firebase/remote-config",G="@firebase/remote-config-compat",K="@firebase/storage",J="@firebase/storage-compat",Y="@firebase/firestore",Q="@firebase/ai",$="@firebase/firestore-compat",X="firebase",Z="[DEFAULT]",ee={[E]:"fire-core",[k]:"fire-core-compat",[A]:"fire-analytics",[_]:"fire-analytics-compat",[I]:"fire-app-check",[T]:"fire-app-check-compat",[P]:"fire-auth",[R]:"fire-auth-compat",[D]:"fire-rtdb",[O]:"fire-data-connect",[L]:"fire-rtdb-compat",[M]:"fire-fn",[F]:"fire-fn-compat",[U]:"fire-iid",[V]:"fire-iid-compat",[z]:"fire-fcm",[B]:"fire-fcm-compat",[q]:"fire-perf",[H]:"fire-perf-compat",[W]:"fire-rc",[G]:"fire-rc-compat",[K]:"fire-gcs",[J]:"fire-g
2cs-compat",[Y]:"fire-fst",[$]:"fire-fst-compat",[Q]:"fire-vertex","fire-js":"fire-js",[X]:"fire-js-all"},te=new Map,ne=new Map,re=new Map;function se(e,t){try{e.container.addComponent(t)}catch(n){C.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),n)}}function ae(e){const t=e.name;if(re.has(t))return C.debug("There were multiple attempts to register component ".concat(t,".")),!1;re.set(t,e);for(const n of te.values())se(n,e);for(const n of ne.values())se(n,e);return!0}function ie(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function oe(e){return null!==e&&void 0!==e&&void 0!==e.settings}const le={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","
2server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},ce=new a.FA("app","Firebase",le);class ue{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.uA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw ce.create("app-deleted",{appName:this._name})}}const de="11.10.0";function he(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;if("object"!==typeof t){t={name:t}}const s=Object.assign({name:Z,automaticDataCollectionEnabled:!0},t),i=s.name;if("string"!==typeof i||!i)throw ce.create("bad-app-name",{appName:String(i)});if(n||(n=(0,a.T9)()),!n)throw ce.create("no-options");const o=te.get(i);if(o){if((0,a.bD)(n,o.options)&&(0,a.bD)(s,o.config))return o;throw ce.create("duplicate-app",{appName:i})}const l=new r.h1(i);for(const r of re.values())l.addComponent(r);const c=new ue(n,s,l);return te.set(i,c),c}function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Z;const t=te.get(e);if(!t&&e===Z&&(0,a.T9)())return he();if(!t)throw ce.create("no-app",{appName:e});return t}function pe(e,t,n){var s;let a=null!==(s=ee[e])&&void 0!==s?s:e;n&&(a+="-".concat(n));const i=a.match(/\s|\//),o=t.match(/\s|\//);if(i||o){const e=['Unable to register library "'.concat(a,'" with version "').concat(t,'":')];return i&&e.push('library name "'.concat(a,'" contains illegal characters (whitespace or "/")')),i&&o&&e.push("and"),o&&e.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void C.warn(e.join(" "))}ae(new r.uA("".concat(a,"-version"),()=>({library:a,version:t}),"VERSION"))}const fe="firebase-heartbeat-store";let ge=null;function ve(){return ge||(ge=function(e,t){let{blocked:n,upgrade:r,blocking:s,terminated:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=indexedDB.open(e,t),o=v(i);return r&&i.addEventListener("upgradeneeded",e=>{r(v(i.result),e.oldVersion,e.newVersion,v(i.transaction),e)}),n&&i.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),o.then(e=>{a&&e.addEventListener("close",()=>a()),s&&e.addEventListener("versionchange",e=>s(e.oldVersion,e.newVersion,e))}).catch(()=>{}),o}("firebase-heartbeat-database",1,{upgrade:(e,t)=>{if(0===t)try{e.createObjectStore(fe)}catch(n){console.warn(n)}}}).catch(e=>{throw ce.create("idb-open",{originalErrorMessage:e.message})})),ge}async function ye(e,t){try{const n=(await ve()).transaction(fe,"readwrite"),r=n.objectStore(fe);await r.put(t,be(e)),await n.done}catch(n){if(n instanceof a.g)C.warn(n.message);else{const e=ce.create("idb-set",{originalErrorMessage:null===n||void 0===n?void 0:n.message});C.warn(e.message)}}}function be(e){return"".concat(e.name,"!").concat(e.options.appId)}class xe{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new Ne(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){var e,t;try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=we();if(null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)&&(this._heartbeatsCache=await this._heartbeatsCachePromise,null==(null===(t=this._heartbeatsCache)||void 0===t?void 0:t.heartbeats)))return;if(this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(e=>e.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>30){const e=function(e){if(0===e.length)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(e,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(n){C.warn(n)}}async getHeartbeatsHeader(){var e;try{if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null==(null===(e=this._heartbeatsCache)||void 0===e?void 0:e.heartbeats)||0===this._heartbeatsCache.heartbeats.length)return"";const t=we(),{heartbeatsToSend:n,unsentEntries:r}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1024;const n=[];let r=e.slice();for(const s of e){const e=n.find(e=>e.agent===s.agent);if(e){if(e.dates.push(s.date),je(n)>t){e.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),je(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),s=(0,a.Uj)(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(t){return C.warn(t),""}}}function we(){return(new Date).toISOString().substring(0,10)}class Ne{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,a.zW)()&&(0,a.eX)().then(()=>!0).catch(()=>!1)}async read(){if(await this._canUseIndexedDBPromise){const e=await async function(e){try{const t=(await ve()).transaction(fe),n=await t.objectStore(fe).get(be(e));return await t.done,n}catch(t){if(t instanceof a.g)C.warn(t.message);else{const e=ce.create("idb-get",{originalErrorMessage:null===t||void 0===t?void 0:t.message});C.warn(e.message)}}}(this.app);return(null===e||void 0===e?void 0:e.heartbeats)?e:{heartbeats:[]}}return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ye(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ye(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function je(e){return(0,a.Uj)(JSON.stringify({version:2,heartbeats:e})).length}var Ee;Ee="",ae(new r.uA("platform-logger",e=>new j(e),"PRIVATE")),ae(new r.uA("heartbeat",e=>new xe(e),"PRIVATE")),pe(E,S,Ee),pe(E,S,"esm2017"),pe("fire-js","")},7210:()=>{},7324:(e,t,n)=>{n.d(t,{GE:()=>h,HP:()=>c,HR:()=>v,J4:()=>l,Kq:()=>f,OM:()=>i,Xm:()=>p,YY:()=>d,deleteBatch:()=>g,getCourse:()=>o,getCourseBatches:()=>m,kU:()=>u});var r=n(2555),s=n(5472),a=n(8426);const i=async()=>{try{const e=(0,s.rJ)(a.db,"courses");return(await(0,s.GG)(e)).docs.map(e=>(0,r.A)({id:e.id},e.data()))}catch(e){throw console.error("Error getting courses:",e),e}},o=async e=>{try{const t=(0,s.H9)(a.db,"courses",e),n=await(0,s.x7)(t);if(!n.exists())throw new Error("Course not found");return(0,r.A)({id:n.id},n.data())}catch(t){throw console.error("Error getting course:",t),t}},l=async(e,t)=>{try{const n=(0,s.H9)(a.db,"courses",e);await(0,s.mZ)(n,(0,r.A)((0,r.A)({},t),{},{updatedAt:(0,s.O5)()}))}catch(n){throw console.error("Error updating course:",n),n}},c=async e=>{try{console.log("Fetching curriculum for course:",e);const t=(0,s.rJ)(a.db,"courses",e,"curriculum"),n=await(0,s.GG)(t);console.log("Curriculum snapshot size:",n.size);const i=n.docs.map(e=>{const t=e.data();return console.log("Curriculum doc:",e.id,t),(0,r.A)({id:e.id},t)});return i.sort((e,t)=>
2(e.order||0)-(t.order||0)),console.log("Processed curriculum:",i),i}catch(t){throw console.error("Error getting curriculum:",t),t}},u=async(e,t)=>{try{const n=(0,s.rJ)(a.db,"courses",e,"curriculum");return(await(0,s.gS)(n,(0,r.A)((0,r.A)({},t),{},{createdAt:(0,s.O5)(),updatedAt:(0,s.O5)()}))).id}catch(n){throw console.error("Error adding curriculum section:",n),n}},d=async(e,t,n)=>{try{const i=(0,s.H9)(a.db,"courses",e,"curriculum",t);await(0,s.mZ)(i,(0,r.A)((0,r.A)({},n),{},{updatedAt:(0,s.O5)()}))}catch(i){throw console.error("Error updating curriculum section:",i),i}},h=async(e,t)=>{try{const n=(0,s.H9)(a.db,"courses",e,"curriculum",t);await(0,s.kd)(n)}catch(n){throw console.error("Error deleting curriculum section:",n),n}},m=async e=>{try{console.log("Fetching batches for course:",e);const t=(0,s.rJ)(a.db,"courses",e,"batches"),n=await(0,s.GG)(t);console.log("Batches snapshot size:",n.size);const i=n.docs.map(e=>{const t=e.data();return console.log("Batch doc:",e.id,t),(0,r.A)({id:e.id},t)});return i.sort((e,t)=>(e.batchNumber||0)-(t.batchNumber||0)),console.log("Processed batches:",i),i}catch(t){throw console.error("Error getting batches:",t),t}},p=async(e,t)=>{try{const n=(0,s.rJ)(a.db,"courses",e,"batches");return(await(0,s.gS)(n,(0,r.A)((0,r.A)({},t),{},{enrollmentCount:0,createdAt:(0,s.O5)(),updatedAt:(0,s.O5)()}))).id}catch(n){throw console.error("Error creating batch:",n),n}},f=async(e,t,n)=>{try{const i=(0,s.H9)(a.db,"courses",e,"batches",t);await(0,s.mZ)(i,(0,r.A)((0,r.A)({},n),{},{updatedAt:(0,s.O5)()}))}catch(i){throw console.error("Error updating batch:",i),i}},g=async(e,t)=>{try{const n=(0,s.H9)(a.db,"courses",e,"batches",t);await(0,s.kd)(n),console.warn("Remember to delete subcollections (videos, schedule) manually or via Cloud Function")}catch(n){throw console.error("Error deleting batch:",n),n}},v=async e=>{try{console.log("\ud83d\udd0d getCompleteCourse called for:",e),console.log("\ud83d\udcda Fetching base course data...");const t=await o(e);console.log("\u2705 Base course:",t),console.log("\ud83d\udce6 Fetching batches...");const n=await m(e);console.log("\u2705 Batches fetched:",n),console.log("\ud83d\udcd6 Fetching curriculum...");const i=await c(e);console.log("\u2705 Curriculum fetched:",i),console.log("\ud83c\udfa5 Fetching videos and schedules for each batch...");const l=await Promise.all(n.map(async t=>{try{console.log("Processing batch:",t.id);const n=await(async(e,t)=>{try{const n=(0,s.rJ)(a.db,"courses",e,"batches",t,"videos"),i=(await(0,s.GG)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return i.sort((e,t)=>(e.order||0)-(t.order||0)),i}catch(n){return console.error("Error getting videos:",n),console.warn("Returning empty videos array for batch:",t),[]}})(e,t.id),i=await(async(e,t)=>{try{const n=(0,s.rJ)(a.db,"courses",e,"batches",t,"schedule"),i=(await(0,s.GG)(n)).docs.map(e=>(0,r.A)({id:e.id},e.data()));return i.sort((e,t)=>{const n=(e.date||"").localeCompare(t.date||"");return 0!==n?n:(e.time||"").localeCompare(t.time||"")}),i}catch(n){return console.error("Error getting schedule:",n),console.warn("Returning empty schedule array for batch:",t),[]}})(e,t.id);return(0,r.A)((0,r.A)({},t),{},{videos:n,schedule:i})}catch(n){return console.error("Error processing batch ".concat(t.id,":"),n),(0,r.A)((0,r.A)({},t),{},{videos:[],schedule:[]})}})),u=(0,r.A)((0,r.A)({},t),{},{batches:l,curriculum:i});return console.log("\u2705 Complete course data:",u),u}catch(t){throw console.error("\u274c Error getting complete course:",t),t}}},7417:(e,t,n)=>{n.d(t,{CB:()=>c,Xu:()=>l,recordEmailSent:()=>i,uw:()=>o,w9:()=>u});var r=n(2555),s=n(5472),a=n(8426);const i=async e=>{try{if(!a.db)throw new Error("Firestore not initialized");const{userId:t,recipientEmail:n,recipientName:r,emailType:i,subject:o,templateId:l,courseId:c,courseTitle:u,paymentId:d,orderId:h,amount:m,enrollmentId:p,emailServiceResponse:f,success:g,error:v,rawTextContent:y}=e,b={userId:t||null,recipientEmail:n,recipientName:r||"",emailType:i,subject:o,templateId:l||null,courseId:c||null,courseTitle:u||"",paymentId:d||null,orderId:h||null,amount:m||null,enrollmentId:p||null,emailServiceProvider:"emailjs",emailServiceResponse:f||null,status:g?"sent":"failed",errorMessage:v||null,rawTextContent:y||null,sentAt:(0,s.O5)(),createdAt:(0,s.O5)(),metadata:{userAgent:navigator.userAgent,t
2imestamp:(new Date).toISOString(),origin:window.location.origin}};return{success:!0,emailRecordId:(await(0,s.gS)((0,s.rJ)(a.db,"emails_sent"),b)).id}}catch(t){return{success:!1,error:t.message}}},o=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;try{if(!a.db)return{success:!1,error:"Firestore not initialized"};if(!e||!e.trim())return{success:!1,error:"Search term is required",emails:[]};const n=e.trim().toLowerCase(),i=(0,s.P)((0,s.rJ)(a.db,"emails_sent"),(0,s.My)("sentAt","desc"),(0,s.AB)(1e3)),o=await(0,s.GG)(i),l=[];o.forEach(e=>{l.push((0,r.A)({id:e.id},e.data()))});const c=l.filter(e=>[e.recipientEmail,e.recipientName,e.courseTitle,e.paymentId,e.orderId,e.subject,e.emailType].some(e=>e&&e.toLowerCase().includes(n)));return{success:!0,emails:c.slice(0,t)}}catch(n){return{success:!1,error:n.message,emails:[]}}},l=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;try{if(!a.db)return{success:!1,error:"Firestore not initialized"};const n=(0,s.P)((0,s.rJ)(a.db,"emails_sent"),(0,s._M)("emailType","==",e),(0,s.My)("sentAt","desc"),(0,s.AB)(t)),i=await(0,s.GG)(n),o=[];return i.forEach(e=>{o.push((0,r.A)({id:e.id},e.data()))}),{success:!0,emails:o}}catch(n){return{success:!1,error:n.message,emails:[]}}},c=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!a.db)return{success:!1,error:"Firestore not initialized"};let t=(0,s.rJ)(a.db,"emails_sent");const n=[];e.courseId&&n.push((0,s._M)("courseId","==",e.courseId)),e.emailType&&n.push((0,s._M)("emailType","==",e.emailType)),e.status&&n.push((0,s._M)("status","==",e.status)),n.length>0&&(t=(0,s.P)(t,...n));const r=await(0,s.GG)(t);let i=0,o=0,l=0;const c={},u={};return r.forEach(e=>{const t=e.data();i++,"sent"===t.status?o++:"failed"===t.status&&l++;const n=t.emailType||"unknown";if(c[n]=(c[n]||0)+1,t.courseId&&t.courseTitle){const e="".concat(t.courseId,"_").concat(t.courseTitle);u[e]=(u[e]||0)+1}}),{success:!0,statistics:{totalEmails:i,sentSuccessfully:o,failed:l,successRate:i>0?(o/i*100).toFixed(2):0,emailTypes:c,courses:u}}}catch(t){return{success:!1,error:t.message}}},u=async(e,t,n)=>{const r={userId:n,recipientEmail:e.userEmail,recipientName:e.userName,emailType:"enrollment_confirmation",subject:"\ud83c\udf89 Welcome to ".concat(e.courseTitle,"! Your AI learning journey starts now"),templateId:"template_660cmfs",courseId:e.courseId,courseTitle:e.courseTitle,paymentId:e.paymentId,orderId:e.orderId,amount:parseFloat(e.amount),enrollmentId:e.enrollmentId,emailServiceResponse:t.messageId,success:t.success,error:t.error,rawTextContent:t.rawTextContent};return await i(r)}},7677:(e,t,n)=>{n.d(t,{A:()=>l});var r=n(2555),s=n(5043),a=n(4366),i=n(342),o=n(579);const l=()=>{const[e,t]=(0,s.useState)({firstName:"",lastName:"",email:"",password:"",confirmPassword:""}),[n,l]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!1),[d,h]=(0,s.use
2State)(!1),[m,p]=(0,s.useState)(""),{registerWithEmail:f,signInWithGoogle:g}=(0,i.A)(),v=(0,a.Zp)(),y=e=>{const{name:n,value:s}=e.target;t(e=>(0,r.A)((0,r.A)({},e),{},{[n]:s})),m&&p("")};return(0,o.jsx)("div",{className:"register-page-container",children:(0,o.jsxs)("div",{className:"register-card",children:[(0,o.jsxs)("div",{className:"register-header",children:[(0,o.jsx)("h1",{className:"register-title",children:"Create Account"}),(0,o.jsx)("p",{className:"register-subtitle",children:"Join our learning platform"})]}),m&&(0,o.jsx)("div",{className:"register-error-message",children:m}),(0,o.jsxs)("button",{type:"button",onClick:async()=>{h(!0),p("");const e=await g();e.success?v("/dashboard"):p(e.error),h(!1)},disabled:d,className:"register-google-button",children:[(0,o.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",children:[(0,o.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,o.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,o.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,o.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),d?"Signing up...":"Continue with Google"]}),(0,o.jsxs)("div",{className:"register-divider-container",children:[(0,o.jsx)("hr",{className:"register-divider-line"}),(0,o.jsx)("span",{className:"register-divider-text",children:"or"}),(0,o.jsx)("hr",{className:"register-divider-line"})]}),(0,o.jsxs)("form",{onSubmit:async t=>{if(t.preventDefault(),e.password!==e.confirmPassword)return void p("Passwords don't match!");if(e.password.length<6)return void p("Password must be at least 6 characters long!");h(!0),p("");const n=await f(e.email,e.password,e.firstName,e.lastName);n.success?n.requiresVerification?(p(""),alert(n.message||"Registration successful! Please check your email and verify your account before signing in. If you don't see the email, please check your **SPAM**/junk folder."),v("/login?message=verify-email")):v("/dashboard"):p(n.error),h(!1)},className:"register-form",children:[(0,o.jsxs)("div",{className:"name-fields-row",children:[(0,o.jsxs)("div",{className:"form-field-half",children:[(0,o.jsx)("label",{className:"form-label",children:"First Name"}),(0,o.jsx)("input",{type:"text",name:"firstName",value:e.firstName,onChange:y,placeholder:"First name",required:!0,className:"form-input"})]}),(0,o.jsxs)("div",{className:"form-field-half",children:[(0,o.jsx)("label",{className:"form-label",children:"Last Name"}),(0,o.jsx)("input",{type:"text",name:"lastName",value:e.lastName,onChange:y,placeholder:"Last name",required:!0,className:"form-input"})]})]}),(0,o.jsxs)("div",{className:"form-field",children:[(0,o.jsx)("label",{className:"form-label",children:"Email Address"}),(0,o.jsx)("input",{type:"email",name:"email",value:e.email,onChange:y,placeholder:"Enter your email",required:!0,className:"form-input"})]}),(0,o.jsxs)("div",{className:"form-field",children:[(0,o.jsx)("label",{className:"form-label",children:"Password"}),(0,o.jsxs)("div",{className:"password-field-container",children:[(0,o.jsx)("input",{type:n?"text":"password",name:"password",value:e.password,onChange:y,placeholder:"Create a password",required:!0,className:"form-input"}),(0,o.jsx)("button",{type:"button",onClick:()=>l(!n),className:"password-toggle-button",children:n?"\ud83d\udc41\ufe0f":"\ud83d\udc41\ufe0f\u200d\ud83d\udde8\ufe0f"})]})]}),(0,o.jsxs)("div",{className:"form-field",children:[(0,o.jsx)("label",{className:"form-label",children:"Confirm Password"}),(0,o.jsxs)("div",{className:"password-field-container",children:[(0,o.jsx)("input",{type:c?"text":"password",name:"confirmPassword",value:e.confirmPassword,onChange:y,placeholder:"Confirm your password",required:!0,className:"form-input"}),(0,o.jsx)("button",{type:"button",onClick:()=>u(!c),className:"password-toggle-button",children:c?"\ud83d\udc41\ufe0f":"\ud83d\udc41\ufe0f\u200d\ud83d\udde8\ufe0f"})]})]}),(0,o.jsx)("button",{type:"submit",className:"btn",disabled:d,children:d?"Creating account...":"Create Account"})]}),(0,o.jsx)("div",{className:"register-footer",children:(0,o.jsxs)("p",{className:"footer-text",children:["Already have an account?"," ",(0,o.jsx)(a.N_,{to:"/login",className:"footer-link",children:"Sign in"})]})})]})})}}
2,7898:(e,t,n)=>{n.d(t,{HF:()=>Xe,sv:()=>mt,eJ:()=>pt,xI:()=>qn,hg:()=>yt,gA:()=>gt,J1:()=>ht,x9:()=>ft,df:()=>rn,CI:()=>bt,r7:()=>vt});var r=n(7150),s=n(1529),a=n(443);function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var s=0;for(r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]])}return n}Object.create;Object.create;"function"===typeof SuppressedError&&SuppressedError;var o=n(8812);function l(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const c=l,u=new s.FA("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),d=new a.Vy("@firebase/auth");function h(e){if(d.logLevel<=a.$b.ERROR){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];d.error("Auth (".concat(r.MF,"): ").concat(e),...n)}}function m(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw y(e,...n)}function p(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return y(e,...n)}function f(e,t,n){const r=Object.assign(Object.assign({},c()),{[t]:n});return new s.FA("auth","Firebase",r).create(t,{appName:e.name})}function g(e){return f(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function v(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&m(e,"argument-error"),f(e,"argument-error","Type of ".concat(t.constructor.name," does not match expected instance.")+"Did you pass a reference from a different Auth SDK?")}function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];if("string"!==typeof e){const t=n[0],r=[...n.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(t,...r)}return u.create(e,...n)}function b(e,t){if(!e){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s<n;s++)r[s-2]=arguments[s];throw y(t,...r)}}function x(e){const t="INTERNAL ASSERTION FAILED: "+e;throw h(t),new Error(t)}function w(e,t){e||x(t)}function N(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function j(){return"http:"===E()||"https:"===E()}function E(){var e;return"undefined"!==typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class S{constructor(e,t){this.shortDelay=e,this.longDelay=t,w(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,s.jZ)()||(0,s.lV)()}get(){return"undefined"!==typeof navigator&&navigator&&"onLine"in navigator&&"boolean"===typeof navigator.onLine&&(j()||(0,s.sr)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function C(e,t){w(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?"".concat(n).concat(t.startsWith("/")?t.slice(1):t):n}class k{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!==typeof self&&"fetch"in self?self.fetch:"undefined"!==typeof globalThis&&globalThis.fetch?globalThis.fetch:"undefined"!==typeof fetch?fetch:void x("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!==typeof self&&"Headers"in self?self.Headers:"undefined"!==typeof globalThis&&globalThis.Headers?globalThis.Headers:"undefined"!==typeof Headers?Headers:void x("Could not find Headers implementation, make sure you call FetchProvi
2der.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!==typeof self&&"Response"in self?self.Response:"undefined"!==typeof globalThis&&globalThis.Response?globalThis.Response:"undefined"!==typeof Response?Response:void x("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const _={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},A=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],T=new S(3e4,6e4);function I(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function P(e,t,n,r){return R(e,arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},async()=>{let a={},i={};r&&("GET"===t?i=r:a={body:JSON.stringify(r)});const o=(0,s.Am)(Object.assign({key:e.config.apiKey},i)).slice(1),l=await e._getAdditionalHeaders();l["Content-Type"]="application/json",e.languageCode&&(l["X-Firebase-Locale"]=e.languageCode);const c=Object.assign({method:t,headers:l},a);return(0,s.c1)()||(c.referrerPolicy="no-referrer"),e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(c.credentials="include"),k.fetch()(await O(e,e.config.apiHost,n,o),c)})}async function R(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},_),t);try{const t=new M(e),s=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const a=await s.json();if("needConfirmation"in a)throw F(e,"account-exists-with-different-credential",a);if(s.ok&&!("errorMessage"in a))return a;{const t=s.ok?a.errorMessage:a.error.message,[n,i]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw F(e,"credential-already-in-use",a);if("EMAIL_EXISTS"===n)throw F(e,"email-already-in-use",a);if("USER_DISABLED"===n)throw F(e,"user-disabled",a);const o=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(i)throw f(e,o,i);m(e,o)}}catch(a){if(a instanceof s.g)throw a;m(e,"network-request-failed",{message:String(a)})}}async function D(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};
2const a=await P(e,t,n,r,s);return"mfaPendingCredential"in a&&m(e,"multi-factor-auth-required",{_serverResponse:a}),a}async function O(e,t,n,r){const s="".concat(t).concat(n,"?").concat(r),a=e,i=a.config.emulator?C(e.config,s):"".concat(e.config.apiScheme,"://").concat(s);if(A.includes(n)&&(await a._persistenceManagerAvailable,"COOKIE"===a._getPersistenceType())){return a._getPersistence()._getFinalTarget(i).toString()}return i}function L(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class M{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(p(this.auth,"network-request-failed")),T.get())})}}function F(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=p(e,t,r);return s.customData._tokenResponse=n,s}function U(e){return void 0!==e&&void 0!==e.enterprise}class V{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||0===this.recaptchaEnforcementState.length)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return L(t.enforcementState);return null}isProviderEnabled(e){return"ENFORCE"===this.getProviderEnforcementState(e)||"AUDIT"===this.getProviderEnforcementState(e)}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function z(e,t){return P(e,"GET","/v2/recaptchaConfig",I(e,t))}async function B(e,t){return P(e,"POST","/v1/accounts:lookup",t)}function q(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function H(e){return 1e3*Number(e)}function W(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return h("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,s.u)(n);return e?JSON.parse(e):(h("Failed to decode base64 JWT payload"),null)}catch(a){return h("Caught error parsing JWT payload as JSON",null===a||void 0===a?void 0:a.toString()),null}}function G(e){const t=W(e);return b(t,"internal-error"),b("undefined"!==typeof t.exp,"internal-error"),b("undefined"!==typeof t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}async function K(e,t){if(arguments.length>2&&void 0!==arguments[2]&&arguments[2])return t;try{return await t}catch(n){throw n instanceof s.g&&function(e){let{code:t}=e;return t==="auth/".concat("user-disabled")||t==="auth/".concat("user-token-expired")}(n)&&e.auth.currentUser===e&&await e.auth.signOut(),n}}class J{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void((null===e||void 0===e?void 0:e.code)==="auth/".concat("network-request-failed")&&this.schedule(!0))}this.schedule()}}class Y{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=q(this.lastLoginAt),this.creationTime=q(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function Q(e){var t;const n=e.auth,r=await e.getIdToken(),s=await K(e,B(n,{idToken:r}));b(null===s||void 0===s?void 0:s.users.length,n,"internal-error");const a=s.users[0];e._notifyReloadListener(a);const i=(null===(t=a.providerUserInfo)||void 0===t?void 0:t.length)?$(a.providerUserInfo):[],o=(l=e.providerData,c=i,[...l.filter(e=>!c.some(t=>t.providerId===e.providerId)),...c]);var l,c;const u=e.isAnonymous,d=!(e.email&&a.passwordHash)&&!(null===o||void 0===o?void 0:o.length),h=!!u&&d,m={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:o,metadata:new Y(a.createdAt,a.lastLoginAt),isAnonymous:h};Object.assign(e,m)}function $(e){return e.map(e=>{var{providerId:t}=e,n=i(e,["providerId"]);
2return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}class X{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){b(e.idToken,"internal-error"),b("undefined"!==typeof e.idToken,"internal-error"),b("undefined"!==typeof e.refreshToken,"internal-error");const t="expiresIn"in e&&"undefined"!==typeof e.expiresIn?Number(e.expiresIn):G(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){b(0!==e.length,"internal-error");const t=G(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e){return arguments.length>1&&void 0!==arguments[1]&&arguments[1]||!this.accessToken||this.isExpired?(b(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null):this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:a}=await async function(e,t){const n=await R(e,{},async()=>{const n=(0,s.Am)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:a}=e.config,i=await O(e,r,"/v1/token","key=".concat(a)),o=await e._getAdditionalHeaders();o["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:o,body:n};return e.emulatorConfig&&(0,s.zJ)(e.emulatorConfig.host)&&(l.credentials="include"),k.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(a))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:s}=t,a=new X;return n&&(b("string"===typeof n,"internal-error",{appName:e}),a.refreshToken=n),r&&(b("string"===typeof r,"internal-error",{appName:e}),a.accessToken=r),s&&(b("number"===typeof s,"internal-error",{appName:e}),a.expirationTime=s),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new X,this.toJSON())}_performRefresh(){return x("not implemented")}}function Z(e,t){b("string"===typeof e||"undefined"===typeof e,"internal-error",{appName:t})}class ee{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,s=i(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new J(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Y(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await K(this,this.stsTokenManager.getToken(this.auth,e));return b(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=(0,s.Ku)(e),r=await n.getIdToken(t),a=W(r);b(a&&a.exp&&a.auth_time&&a.iat,n.auth,"internal-error");const i="object"===typeof a.firebase?a.firebase:void 0,o=null===i||void 0===i?void 0:i.sign_in_provider;return{claims:a,token:r,authTime:q(H(a.auth_time)),issuedAtTime:q(H(a.iat)),expirationTime:q(H(a.exp)),signInProvider:o||null,signInSecondFactor:(null===i||void 0===i?void 0:i.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=(0,s.Ku)(e);await Q(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(b(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
2otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new ee(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){b(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await Q(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if((0,r.xZ)(this.auth.app))return Promise.reject(g(this.auth));const e=await this.getIdToken();return await K(this,async function(e,t){return P(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,s,a,i,o,l,c;const u=null!==(n=t.displayName)&&void 0!==n?n:void 0,d=null!==(r=t.email)&&void 0!==r?r:void 0,h=null!==(s=t.phoneNumber)&&void 0!==s?s:void 0,m=null!==(a=t.photoURL)&&void 0!==a?a:void 0,p=null!==(i=t.tenantId)&&void 0!==i?i:void 0,f=null!==(o=t._redirectEventId)&&void 0!==o?o:void 0,g=null!==(l=t.createdAt)&&void 0!==l?l:void 0,v=null!==(c=t.lastLoginAt)&&void 0!==c?c:void 0,{uid:y,emailVerified:x,isAnonymous:w,providerData:N,stsTokenManager:j}=t;b(y&&j,e,"internal-error");const E=X.fromJSON(this.name,j);b("string"===typeof y,e,"internal-error"),Z(u,e.name),Z(d,e.name),b("boolean"===typeof x,e,"internal-error"),b("boolean"===typeof w,e,"internal-error"),Z(h,e.name),Z(m,e.name),Z(p,e.name),Z(f,e.name),Z(g,e.name),Z(v,e.name);const S=new ee({uid:y,auth:e,email:d,emailVerified:x,displayName:u,isAnonymous:w,photoURL:m,phoneNumber:h,tenantId:p,stsTokenManager:E,createdAt:g,lastLoginAt:v});return N&&Array.isArray(N)&&(S.providerData=N.map(e=>Object.assign({},e))),f&&(S._redirectEventId=f),S}static async _fromIdTokenResponse(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new X;r.updateFromServerResponse(t);const s=new ee({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await Q(s),s}static async _fromGetAccountInfoResponse(e,t,n){const r=t.users[0];b(void 0!==r.localId,"internal-error");const s=void 0!==r.providerUserInfo?$(r.providerUserInfo):[],a=!(r.email&&r.passwordHash)&&!(null===s||void 0===s?void 0:s.length),i=new X;i.updateFromIdToken(n);const o=new ee({uid:r.localId,auth:e,stsTokenManager:i,isAnonymous:a}),l={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:s,metadata:new Y(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(null===s||void 0===s?void 0:s.length)};return Object.assign(o,l),o}}const te=new Map;function ne(e){w(e instanceof Function,"Expected a class definition");let t=te.get(e);return t?(w(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,te.set(e,t),t)}class re{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}re.type="NONE";const se=re;function ae(e,t,n){return"firebase".concat(":",e,":").concat(t,":").concat(n)}class ie{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:s}=this.auth;this.fullUserKey=ae(this.userKey,r.apiKey,s),this.fullPersistenceKey=ae("persistence",r.apiKey,s),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if("string"===typeof e){const t=await B(this.auth,{idToken:e}).catch(()=>{});return t?ee._fromGetAccountInfoResponse(this.auth,t,e):null}return ee._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"authUser";if(!t.length)return new ie(ne(se),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let s=r[0]||ne(se);const a=ae(n,e.config.apiKey,e.name);let i=null;for(const c of t)try{const t=await c._get(a);if(t){let n;if("string"===typeof t){const r=await B(e,{idToken:t}).catch(()=>{});if(!r)break;n=await ee._fromGetAccountInfoResponse(e,r,t)}else n=ee._fromJSON(e,t);c!==s&&(i=n),s=c;break}}catch(l){}const o=r.filter(e=>e._shouldAllowMigration);return s._shouldAllowMigration&&o.length?(s=o[0],i&&await s._set(a,i.toJSON()),await Promise.all(t.map(async e=>{if(e!==s)try{await e._remove(a)}catch(l){}})),new ie(s,e,n)):new ie(s,e,n)}}function oe(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(de(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(le(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(me(t))return"Blackberry";if(pe(t))return"Webos";if(ce(t))return"Safari";
2if((t.includes("chrome/")||ue(t))&&!t.includes("edge/"))return"Chrome";if(he(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null===n||void 0===n?void 0:n.length))return n[1]}return"Other"}function le(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/firefox\//i.test(e)}function ce(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)()).toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function ue(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/crios\//i.test(e)}function de(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/iemobile/i.test(e)}function he(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/android/i.test(e)}function me(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/blackberry/i.test(e)}function pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/webos/i.test(e)}function fe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)();return fe(e)||he(e)||pe(e)||me(e)||/windows phone/i.test(e)||de(e)}function ve(e){let t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];switch(e){case"Browser":t=oe((0,s.ZQ)());break;case"Worker":t="".concat(oe((0,s.ZQ)()),"-").concat(e);break;default:t=e}const a=n.length?n.join(","):"FirebaseCore-web";return"".concat(t,"/","JsCore","/").concat(r.MF,"/").concat(a)}class ye{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(s){r(s)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(n){t.reverse();for(const e of t)try{e()}catch(r){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null===n||void 0===n?void 0:n.message})}}}class be{constructor(e){var t,n,r,s;const a=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=null!==(t=a.minPasswordLength)&&void 0!==t?t:6,a.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=a.maxPasswordLength),void 0!==a.containsLowercaseCharacter&&(this.customStrengthOptions.containsLowercaseLetter=a.containsLowercaseCharacter),void 0!==a.containsUppercaseCharacter&&(this.customStrengthOptions.containsUppercaseLetter=a.containsUppercaseCharacter),void 0!==a.containsNumericCharacter&&(this.customStrengthOptions.containsNumericCharacter=a.containsNumericCharacter),void 0!==a.containsNonAlphanumericCharacter&&(this.customStrengthOptions.containsNonAlphanumericCharacter=a.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,"ENFORCEMENT_STATE_UNSPECIFIED"===this.enforcementState&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=null!==(r=null===(n=e.allowedNonAlphanumericCharacters)||void 0===n?void 0:n.join(""))&&void 0!==r?r:"",this.forceUpgradeOnSignin=null!==(s=e.forceUpgradeOnSignin)&&void 0!==s&&s,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,n,r,s,a,i;const o={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,o),this.validatePasswordCharacterOptions(e,o),o.isValid&&(o.isValid=null===(t=o.meetsMinPasswordLength)||void 0===t||t),o.isValid&&(o.isValid=null===(n=o.meetsMaxPasswordLength)||void 0===n||n),o.isValid&&(o.isValid=null===(r=o.containsLowercaseLetter)||void 0===r||r),o.isValid&&(o.isValid=null===(s=o.containsUppercaseLetter)||void 0===s||s),o.isValid&&(o.isValid=null===(a=o.containsNumericCharacter)||void 0===a||a),o.isValid&&(o.isValid=null===(i=o.containsNonAlphanumericCharacter)||void 0===i||i),o}validatePasswordLengthOptions(e,t){const n=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;n&&(t.meetsMinPasswordLength=e.length>=n),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){let n;this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);for(let r=0;r<e.length;r++)n=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}
2updatePasswordCharacterOptionsStatuses(e,t,n,r,s){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=s))}}class xe{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Ne(this),this.idTokenSubscription=new Ne(this),this.beforeStateQueue=new ye(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=u,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(e=>this._resolvePersistenceManagerAvailable=e)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=ne(t)),this._initializationPromise=this.queue(async()=>{var n,r,s;if(!this._deleted&&(this.persistenceManager=await ie.create(this,e),null===(n=this._resolvePersistenceManagerAvailable)||void 0===n||n.call(this),!this._deleted)){if(null===(r=this._popupRedirectResolver)||void 0===r?void 0:r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(a){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(s=this.currentUser)||void 0===s?void 0:s.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUserFromIdToken(e){try{const t=await B(this,{idToken:e}),n=await ee._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(n)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if((0,r.xZ)(this.app)){const e=this.app.settings.authIdToken;return e?new Promise(t=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(e).then(t,t))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let s=n,a=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,r=null===s||void 0===s?void 0:s._redirectEventId,i=await this.tryRedirectSignIn(e);n&&n!==r||!(null===i||void 0===i?void 0:i.user)||(s=i.user,a=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(a)try{await this.beforeStateQueue.runMiddleware(s)}catch(i){s=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return b(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(n){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Q(e)}catch(t){if((null===t||void 0===t?void 0:t.code)!=="auth/".concat("network-request-failed"))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"===typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}
2async updateCurrentUser(e){if((0,r.xZ)(this.app))return Promise.reject(g(this));const t=e?(0,s.Ku)(e):null;return t&&b(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this._deleted)return e&&b(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return(0,r.xZ)(this.app)?Promise.reject(g(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return(0,r.xZ)(this.app)?Promise.reject(g(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ne(e))})}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return null===this.tenantId?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await async function(e){return P(e,"GET","/v2/passwordPolicy",I(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}(this),t=new be(e);null===this.tenantId?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new s.FA("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:await this.currentUser.getIdToken()};null!=this.tenantId&&(t.tenantId=this.tenantId),await async function(e,t){return P(e,"POST","/v2/accounts:revokeToken",I(e,t))}(this,t)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&ne(e)||this._popupRedirectResolver;b(t,this,"argument-error"),this.redirectPersistenceManager=await ie.create(this,[ne(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return"".concat(this.config.authDomain,":").concat(this.config.apiKey,":").concat(this.name)}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const s="function"===typeof t?t:t.next.bind(t);let a=!1;const i=this._isInitialized?Promise.resolve():this._initializationPromise;if(b(i,this,"internal-error"),i.then(()=>{a||s(this.currentUser)}),"function"===typeof t){const s=e.addObserver(t,n,r);return()=>{a=!0,s()}}{const n=e.addObserver(t);return()=>{a=!0,n()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return b(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ve(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;if((0,r.xZ)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null===t||void 0===t?void 0:t.error)&&function(e){if(d.logLevel<=a.$b.WARN){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];d.warn("Auth (".concat(r.MF,"): ").concat(e),...n)}}("Error while retrieving App Check token: ".concat(t.error)),null===t||void 0===t?void 0:t.token}}function we(e){return(0,s.Ku)(e)}class Ne{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,s.tD)(e=>this.observer=e)}get next(){return b(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let je={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Ee(e){return je.loadJS(e)}function Se(e){return"__".concat(e).concat(Math.floor(1e6*Math.random()))}class Ce{constructor(){this.enterprise=new ke}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class ke{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const _e="NO_RECAPTCHA";class Ae{constructor(e){this.type="recaptcha-enterprise",this.auth=we(e)}async verify(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"verify",t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function n(t,n,r){const s=window.grecaptcha;U(s)?s.enterprise.ready(()=>{s.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n(_e)})}):r(Error("No reCAPTCHA enterprise script loaded."))}if(this.auth.settings.appVerificationDisabledForTesting){return(new Ce).execute("siteKey",{action:"verify"})}return new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>
2{z(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new V(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(s=>{if(!t&&U(window.grecaptcha))n(s,e,r);else{if("undefined"===typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));let t=je.recaptchaEnterpriseScript;0!==t.length&&(t+=s),Ee(t).then(()=>{n(s,e,r)}).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function Te(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=new Ae(e);let i;if(s)i=_e;else try{i=await a.verify(n)}catch(l){i=await a.verify(n,!0)}const o=Object.assign({},t);if("mfaSmsEnrollment"===n||"mfaSmsSignIn"===n){if("phoneEnrollmentInfo"in o){const e=o.phoneEnrollmentInfo.phoneNumber,t=o.phoneEnrollmentInfo.recaptchaToken;Object.assign(o,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:t,captchaResponse:i,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in o){const e=o.phoneSignInInfo.recaptchaToken;Object.assign(o,{phoneSignInInfo:{recaptchaToken:e,captchaResponse:i,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return o}return r?Object.assign(o,{captchaResp:i}):Object.assign(o,{captchaResponse:i}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function Ie(e,t,n,r,s){var a,i;if("EMAIL_PASSWORD_PROVIDER"===s){if(null===(a=e._getRecaptchaConfig())||void 0===a?void 0:a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const s=await Te(e,t,n,"getOobCode"===n);return r(e,s)}return r(e,t).catch(async s=>{if(s.code==="auth/".concat("missing-recaptcha-token")){console.log("".concat(n," is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow."));const s=await Te(e,t,n,"getOobCode"===n);return r(e,s)}return Promise.reject(s)})}if("PHONE_PROVIDER"===s){if(null===(i=e._getRecaptchaConfig())||void 0===i?void 0:i.isProviderEnabled("PHONE_PROVIDER")){const s=await Te(e,t,n);return r(e,s).catch(async s=>{var a;if("AUDIT"===(null===(a=e._getRecaptchaConfig())||void 0===a?void 0:a.getProviderEnforcementState("PHONE_PROVIDER"))&&(s.code==="auth/".concat("missing-recaptcha-token")||s.code==="auth/".concat("invalid-app-credential"))){console.log("Failed to verify with reCAPTCHA Enterprise. Automatically triggering the reCAPTCHA v2 flow to complete the ".concat(n," flow."));const s=await Te(e,t,n,!1,!0);return r(e,s)}return Promise.reject(s)})}{const s=await Te(e,t,n,!1,!0);return r(e,s)}}return Promise.reject(s+" provider is not supported.")}async function Pe(e){const t=we(e),n=await z(t,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}),r=new V(n);if(null==t.tenantId?t._agentRecaptchaConfig=r:t._tenantRecaptchaConfigs[t.tenantId]=r,r.isAnyProviderEnabled()){new Ae(t).verify()}}function Re(e,t,n){const r=we(e);b(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const a=!!(null===n||void 0===n?void 0:n.disableWarnings),i=De(t),{host:o,port:l}=function(e){const t=De(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const e=s[1];return{host:e,port:Oe(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Oe(t)}}}(t),c=null===l?"":":".concat(l),u={url:"".concat(i,"//").concat(o).concat(c,"/")},d=Object.freeze({host:o,port:l,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:a})});if(!r._canInitEmulator)return b(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),void b((0,s.bD)(u,r.config.emulator)&&(0,s.bD)(d,r.emulatorConfig),r,"emulator-config-failed");r.config.emulator=u,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,(0,s.zJ)(o)?((0,s.gE)("".concat(i,"//").concat(o).concat(c)),(0,s.P1)("Auth",!0)):a||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!==typeof console&&"function"===typeof console.info&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials.");"undefined"!==typeof window&&"undefined"!==typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}function De(e){const t=e.indexOf(":");
2return t<0?"":e.substr(0,t+1)}function Oe(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Le{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return x("not implemented")}_getIdTokenResponse(e){return x("not implemented")}_linkToIdToken(e,t){return x("not implemented")}_getReauthenticationResolver(e){return x("not implemented")}}async function Me(e,t){return P(e,"POST","/v1/accounts:signUp",t)}async function Fe(e,t){return D(e,"POST","/v1/accounts:signInWithPassword",I(e,t))}async function Ue(e,t){return P(e,"POST","/v1/accounts:sendOobCode",I(e,t))}async function Ve(e,t){return Ue(e,t)}class ze extends Le{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new ze(e,t,"password")}static _fromEmailAndCode(e,t){return new ze(e,t,"emailLink",arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e;if((null===t||void 0===t?void 0:t.email)&&(null===t||void 0===t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":return Ie(e,{returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signInWithPassword",Fe,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return D(e,"POST","/v1/accounts:signInWithEmailLink",I(e,t))}(e,{email:this._email,oobCode:this._password});default:m(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return Ie(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Me,"EMAIL_PASSWORD_PROVIDER");case"emailLink":return async function(e,t){return D(e,"POST","/v1/accounts:signInWithEmailLink",I(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:m(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Be(e,t){return D(e,"POST","/v1/accounts:signInWithIdp",I(e,t))}class qe extends Le{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new qe(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):m("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"===typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,s=i(t,["providerId","signInMethod"]);if(!n||!r)return null;const a=new qe(n,r);return a.idToken=s.idToken||void 0,a.accessToken=s.accessToken||void 0,a.secret=s.secret,a.nonce=s.nonce,a.pendingToken=s.pendingToken||null,a}_getIdTokenResponse(e){return Be(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Be(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Be(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,s.Am)(t)}return e}}async function He(e,t){return P(e,"POST","/v1/accounts:sendVerificationCode",I(e,t))}const We={USER_NOT_FOUND:"user-not-found"};class Ge extends Le{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Ge({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Ge({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return D(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await D(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,t));if(n.temporaryProof)throw F(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return D(e,"POST","/v1/accounts:signInWithPhoneNumber",I(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),We)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"===typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:s}=e;return n||t||r||s?new Ge({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:s}):null}}class Ke{constructor(e){var t,n,r,a,i,o;const l=(0,s.I9)((0,s.hp)(e)),c=null!==(t=l.apiKey)&&void 0!==t?t:null,u=null!==(n=l.oobCode)&&void 0!==n?n:null,d=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=l.mode)&&void 0!==r?r:null);b(c&&u&&d,"argument-error"),this.apiKey=c,this.operation=d,this.code=u,this.continueUrl=null!==(a=l.continueUrl)&&void 0!==a?a:null,this.languageCode=null!==(i=l.lang)&&void 0!==i?i:null,this.tenantId=null!==(o=l.tenantId)&&void 0!==o?o:null}static parseLink(e){const t=function(e){const t=(0,s.I9)((0,s.hp)(e)).link,n=t?(0,s.I9)((0,s.hp)(t)).deep_link_id:null,r=(0,s.I9)((0,s.hp)(e)).deep_link_id;return(r?(0,s.I9)((0,s.hp)(r)).link:null)||r||n||t||e}(e);try{return new Ke(t)}catch(n){return null}}}class Je{constructor(){this.providerId=Je.PROVIDER_ID}static credential(e,t){return ze._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Ke.parseLink(t);return b(n,"argument-error"),ze._fromEmailAndCode(e,n.code,n.tenantId)}}Je.PROVIDER_ID="password",Je.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Je.
2EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Ye{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Qe extends Ye{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class $e extends Qe{constructor(){super("facebook.com")}static credential(e){return qe._fromParams({providerId:$e.PROVIDER_ID,signInMethod:$e.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return $e.credentialFromTaggedObject(e)}static credentialFromError(e){return $e.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return $e.credential(t.oauthAccessToken)}catch(n){return null}}}$e.FACEBOOK_SIGN_IN_METHOD="facebook.com",$e.PROVIDER_ID="facebook.com";class Xe extends Qe{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return qe._fromParams({providerId:Xe.PROVIDER_ID,signInMethod:Xe.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Xe.credentialFromTaggedObject(e)}static credentialFromError(e){return Xe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return Xe.credential(n,r)}catch(s){return null}}}Xe.GOOGLE_SIGN_IN_METHOD="google.com",Xe.PROVIDER_ID="google.com";class Ze extends Qe{constructor(){super("github.com")}static credential(e){return qe._fromParams({providerId:Ze.PROVIDER_ID,signInMethod:Ze.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Ze.credentialFromTaggedObject(e)}static credentialFromError(e){return Ze.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Ze.credential(t.oauthAccessToken)}catch(n){return null}}}Ze.GITHUB_SIGN_IN_METHOD="github.com",Ze.PROVIDER_ID="github.com";class et extends Qe{constructor(){super("twitter.com")}static credential(e,t){return qe._fromParams({providerId:et.PROVIDER_ID,signInMethod:et.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return et.credentialFromTaggedObject(e)}static credentialFromError(e){return et.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return et.credential(n,r)}catch(s){return null}}}async function tt(e,t){return D(e,"POST","/v1/accounts:signUp",I(e,t))}et.TWITTER_SIGN_IN_METHOD="twitter.com",et.PROVIDER_ID="twitter.com";class nt{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const s=await ee._fromIdTokenResponse(e,n,r),a=rt(n);return new nt({user:s,providerId:a,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=rt(n);return new nt({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function rt(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class st extends s.g{constructor(e,t,n,r){var s;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,st.prototype),this.customData={appName:e.name,tenantId:null!==(s=e.tenantId)&&void 0!==s?s:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new st(e,t,n,r)}}function at(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if(n.code==="auth/".concat("multi-factor-auth-required"))throw st._fromErrorAndOperation(e,n,t,r);throw n})}async function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=await K(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return nt._forOperation(e,"link",r)}async function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const{auth:s}=e;if((0,r.xZ)(s.app))return Promise.reject(g(s));const a="reauthenticate";try{const r=await K(e,at(s,a,t,e),n);b(r.idToken,s,"internal-error");const i=W(r.idToken);b(i,s,"internal-error");const{sub:o}=i;return b(e.uid===o,s,"user-mismatch"),nt._forOperation(e,a,r)}catch(i){throw(null===i||void 0===i?void 0:i.code)==="auth/".concat("user-not-found")&&m(s,"user-mismatch"),i}}async function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,r.xZ)(e.app))return Promise.reject(g(e));const s="signIn",a=await at(e,s,t),i=await nt._fromIdTokenResponse(e,s,a);return n||await e._updateCurrentUser(i.user),i}async function ct(e,t){return lt(we(e),t)}function ut(e,t,n){var r;b((null===(r=n.url)||void 0===r?void 0:r.length)>
20,e,"invalid-continue-uri"),b("undefined"===typeof n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),b("undefined"===typeof n.linkDomain||n.linkDomain.length>0,e,"invalid-hosting-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.linkDomain=n.linkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(b(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(b(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function dt(e){const t=we(e);t._getPasswordPolicyInternal()&&await t._updatePasswordPolicy()}async function ht(e,t,n){const r=we(e),s={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};n&&ut(r,s,n),await Ie(r,s,"getOobCode",Ve,"EMAIL_PASSWORD_PROVIDER")}async function mt(e,t){await async function(e,t){return P(e,"POST","/v1/accounts:update",I(e,t))}((0,s.Ku)(e),{oobCode:t})}async function pt(e,t,n){if((0,r.xZ)(e.app))return Promise.reject(g(e));const s=we(e),a=Ie(s,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",tt,"EMAIL_PASSWORD_PROVIDER"),i=await a.catch(t=>{throw t.code==="auth/".concat("password-does-not-meet-requirements")&&dt(e),t}),o=await nt._fromIdTokenResponse(s,"signIn",i);return await s._updateCurrentUser(o.user),o}function ft(e,t,n){return(0,r.xZ)(e.app)?Promise.reject(g(e)):ct((0,s.Ku)(e),Je.credential(t,n)).catch(async t=>{throw t.code==="auth/".concat("password-does-not-meet-requirements")&&dt(e),t})}async function gt(e,t){const n=(0,s.Ku)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&ut(n.auth,r,t);const{email:a}=await async function(e,t){return Ue(e,t)}(n.auth,r);a!==e.email&&await e.reload()}async function vt(e,t){let{displayName:n,photoURL:r}=t;if(void 0===n&&void 0===r)return;const a=(0,s.Ku)(e),i={idToken:await a.getIdToken(),displayName:n,photoUrl:r,returnSecureToken:!0},o=await K(a,async function(e,t){return P(e,"POST","/v1/accounts:update",t)}(a.auth,i));a.displayName=o.displayName||null,a.photoURL=o.photoUrl||null;const l=a.providerData.find(e=>{let{providerId:t}=e;return"password"===t});l&&(l.displayName=a.displayName,l.photoURL=a.photoURL),await a._updateTokensIfNecessary(o)}function yt(e,t,n,r){return(0,s.Ku)(e).onAuthStateChanged(t,n,r)}function bt(e){return(0,s.Ku)(e).signOut()}function xt(e,t){return P(e,"POST","/v2/accounts/mfaEnrollment:start",I(e,t))}new WeakMap;const wt="__sak";class Nt{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(wt,"1"),this.storage.removeItem(wt),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class jt extends Nt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=ge(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},a=this.storage.getItem(n);(0,s.lT)()&&10===document.documentMode&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}jt.type="LOCAL";const Et=jt;function St(e){var t,n;const r=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),s=RegExp("".concat(r,"=([^;]+)"));return null!==(n=null===(t=document.cookie.match(s))||void 0===t?void 0:t[1])&&void 0!==n?n:null}function Ct(e){const t="http:"===window.location.protocol;return"".concat(t?"__dev_":"__HOST-","FIREBASE_").concat(e.split(":")[3])}class kt{constructor(){this.type="COOKIE",this.listenerUnsubscribes=new Map}_getFinalTarget(e){if(void 0===typeof window)return e;const t=new URL("".concat(window.location.origin,"/__cookies__"));return t.searchParams.set("finalTarget",e),t}async _isAvailable(){var e;return!("boolean"===typeof isSecureContext&&!isSecureContext)&&("undefined"!==typeof navigator&&"undefined"!==typeof document&&(null===(e=navigator.cookieEnabled)||void 0===e||e))}async _set(e,t){}async _get(e){if(!this._isAvailable())return null;const t=Ct(e);if(window.cookieStore){const e=await window.cookieStore.get(t);return null===e||void 0===e?void 0:e.value}return St(t)}async _remove(e){if(!this._isAvailable())return;if(!await this._get(e))return;const t=Ct(e);document.cookie="".concat(t,"=;Max-Age=34560000;Partitioned;Secure;SameSite=Strict;Path=/;
2Priority=High"),await fetch("/__cookies__",{method:"DELETE"}).catch(()=>{})}_addListener(e,t){if(!this._isAvailable())return;const n=Ct(e);if(window.cookieStore){const e=e=>{const r=e.changed.find(e=>e.name===n);r&&t(r.value);e.deleted.find(e=>e.name===n)&&t(null)},r=()=>window.cookieStore.removeEventListener("change",e);return this.listenerUnsubscribes.set(t,r),window.cookieStore.addEventListener("change",e)}let r=St(n);const s=setInterval(()=>{const e=St(n);e!==r&&(t(e),r=e)},1e3);this.listenerUnsubscribes.set(t,()=>clearInterval(s))}_removeListener(e,t){const n=this.listenerUnsubscribes.get(t);n&&(n(),this.listenerUnsubscribes.delete(t))}}kt.type="COOKIE";class _t extends Nt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}_t.type="SESSION";const At=_t;class Tt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new Tt(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:s}=t.data,a=this.handlersMap[r];if(!(null===a||void 0===a?void 0:a.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const i=Array.from(a).map(async e=>e(t.origin,s)),o=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}(i);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:o})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function It(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n="";for(let r=0;r<t;r++)n+=Math.floor(10*Math.random());return e+n}Tt.receivers=[];class Pt{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;const r="undefined"!==typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let s,a;return new Promise((i,o)=>{const l=It("",20);r.port1.start();const c=setTimeout(()=>{o(new Error("unsupported_event"))},n);a={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===l)switch(t.data.status){case"ack":clearTimeout(c),s=setTimeout(()=>{o(new Error("timeout"))},3e3);break;case"done":clearTimeout(s),i(t.data.response);break;default:clearTimeout(c),clearTimeout(s),o(new Error("invalid_response"))}}},this.handlers.add(a),r.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:e,eventId:l,data:t},[r.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})}}function Rt(){return window}function Dt(){return"undefined"!==typeof Rt().WorkerGlobalScope&&"function"===typeof Rt().importScripts}const Ot="firebaseLocalStorageDb",Lt="firebaseLocalStorage",Mt="fbase_key";class Ft{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Ut(e,t){return e.transaction([Lt],t?"readwrite":"readonly").objectStore(Lt)}function Vt(){const e=indexedDB.open(Ot,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(Lt,{keyPath:Mt})}catch(r){n(r)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(Lt)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Ot);
2return new Ft(e).toPromise()}(),t(await Vt()))})})}async function zt(e,t,n){const r=Ut(e,!0).put({[Mt]:t,value:n});return new Ft(r).toPromise()}function Bt(e,t){const n=Ut(e,!0).delete(t);return new Ft(n).toPromise()}class qt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await Vt()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(n){if(t++>3)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Dt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Tt._getInstance(Dt()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new Pt(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(this.sender&&this.activeServiceWorker&&function(){var e;return(null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null}()===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Vt();return await zt(e,wt,"1"),await Bt(e,wt),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>zt(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=Ut(e,!1).get(t),r=await new Ft(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Bt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=Ut(e,!1).getAll();return new Ft(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;if(0!==e.length)for(const{fbase_key:r,value:s}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(s)&&(this.notifyListeners(r,s),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!n.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const r of Array.from(n))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}qt.type="LOCAL";const Ht=qt;function Wt(e,t){return P(e,"POST","/v2/accounts/mfaSignIn:start",I(e,t))}Se("rcb"),new S(3e4,6e4);const Gt="recaptcha";async function Kt(e,t,n){var r;if(!e._getRecaptchaConfig())try{await Pe(e)}catch(s){console.log("Failed to initialize reCAPTCHA Enterprise config. Triggering the reCAPTCHA v2 verification.")}try{let s;if(s="string"===typeof t?{phoneNumber:t}
2:t,"session"in s){const t=s.session;if("phoneNumber"in s){b("enroll"===t.type,e,"internal-error");const r={idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,clientType:"CLIENT_TYPE_WEB"}},a=Ie(e,r,"mfaSmsEnrollment",async(e,t)=>{if(t.phoneEnrollmentInfo.captchaResponse===_e){b((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return xt(e,await Jt(e,t,n))}return xt(e,t)},"PHONE_PROVIDER");return(await a.catch(e=>Promise.reject(e))).phoneSessionInfo.sessionInfo}{b("signin"===t.type,e,"internal-error");const a=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;b(a,e,"missing-multi-factor-info");const i={mfaPendingCredential:t.credential,mfaEnrollmentId:a,phoneSignInInfo:{clientType:"CLIENT_TYPE_WEB"}},o=Ie(e,i,"mfaSmsSignIn",async(e,t)=>{if(t.phoneSignInInfo.captchaResponse===_e){b((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return Wt(e,await Jt(e,t,n))}return Wt(e,t)},"PHONE_PROVIDER");return(await o.catch(e=>Promise.reject(e))).phoneResponseInfo.sessionInfo}}{const t={phoneNumber:s.phoneNumber,clientType:"CLIENT_TYPE_WEB"},r=Ie(e,t,"sendVerificationCode",async(e,t)=>{if(t.captchaResponse===_e){b((null===n||void 0===n?void 0:n.type)===Gt,e,"argument-error");return He(e,await Jt(e,t,n))}return He(e,t)},"PHONE_PROVIDER");return(await r.catch(e=>Promise.reject(e))).sessionInfo}}finally{null===n||void 0===n||n._reset()}}async function Jt(e,t,n){b(n.type===Gt,e,"argument-error");const r=await n.verify();b("string"===typeof r,e,"argument-error");const s=Object.assign({},t);if("phoneEnrollmentInfo"in s){const e=s.phoneEnrollmentInfo.phoneNumber,t=s.phoneEnrollmentInfo.captchaResponse,n=s.phoneEnrollmentInfo.clientType,a=s.phoneEnrollmentInfo.recaptchaVersion;return Object.assign(s,{phoneEnrollmentInfo:{phoneNumber:e,recaptchaToken:r,captchaResponse:t,clientType:n,recaptchaVersion:a}}),s}if("phoneSignInInfo"in s){const e=s.phoneSignInInfo.captchaResponse,t=s.phoneSignInInfo.clientType,n=s.phoneSignInInfo.recaptchaVersion;return Object.assign(s,{phoneSignInInfo:{recaptchaToken:r,captchaResponse:e,clientType:t,recaptchaVersion:n}}),s}return Object.assign(s,{recaptchaToken:r}),s}class Yt{constructor(e){this.providerId=Yt.PROVIDER_ID,this.auth=we(e)}verifyPhoneNumber(e,t){return Kt(this.auth,e,(0,s.Ku)(t))}static credential(e,t){return Ge._fromVerification(e,t)}static credentialFromResult(e){const t=e;return Yt.credentialFromTaggedObject(t)}static credentialFromError(e){return Yt.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject(e){let{_tokenResponse:t}=e;if(!t)return null;const{phoneNumber:n,temporaryProof:r}=t;return n&&r?Ge._fromTokenResponse(n,r):null}}function Qt(e,t){return t?ne(t):(b(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}Yt.PROVIDER_ID="phone",Yt.PHONE_SIGN_IN_METHOD="phone";class $t extends Le{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Be(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Be(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Be(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Xt(e){return lt(e.auth,new $t(e),e.bypassAuthState)}function Zt(e){const{auth:t,user:n}=e;return b(n,t,"internal-error"),ot(n,new $t(e),e.bypassAuthState)}async function en(e){const{auth:t,user:n}=e;return b(n,t,"internal-error"),it(n,new $t(e),e.bypassAuthState)}class tn{constructor(e,t,n,r){let s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=s,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:s,error:a,type:i}=e;if(a)return void this.reject(a);const o={auth:this.auth,requestUri:t,sessionId:n,tenantId:s||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(i)(o))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Xt;case"linkViaPopup":case"linkViaRedirect":return en;case"reauthViaPopup":case"reauthViaRedirect":return Zt;default:m(this.auth,"internal-error")}}resolve(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){w(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const nn=new S(2e3,1e4);async function rn(e,t,n){if((0,r.xZ)(e.app))return Promise.reject(p(e,"operation-not-supported-in-this-environment"));const s=we(e);v(e,t,Ye);const a=Qt(s,n);return new sn(s,"signInViaPopup",t,a).executeNotNull()}
2class sn extends tn{constructor(e,t,n,r,s){super(e,t,r,s),this.provider=n,this.authWindow=null,this.pollId=null,sn.currentPopupAction&&sn.currentPopupAction.cancel(),sn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return b(e,this.auth,"internal-error"),e}async onExecution(){w(1===this.filter.length,"Popup operations only handle one event");const e=It();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(p(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(p(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,sn.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(p(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,nn.get())};e()}}sn.currentPopupAction=null;const an=new Map;class on extends tn{constructor(e,t){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,arguments.length>2&&void 0!==arguments[2]&&arguments[2]),this.eventId=null}async execute(){let e=an.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=un(t),r=cn(e);if(!await r._isAvailable())return!1;const s="true"===await r._get(n);return await r._remove(n),s}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}an.set(this.auth._key(),e)}return this.bypassAuthState||an.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}function ln(e,t){an.set(e._key(),t)}function cn(e){return ne(e._redirectPersistence)}function un(e){return ae("pendingRedirect",e.config.apiKey,e.name)}async function dn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if((0,r.xZ)(e.app))return Promise.reject(g(e));const s=we(e),a=Qt(s,t),i=new on(s,a,n),o=await i.execute();return o&&!n&&(delete o.user._redirectEventId,await s._persistUserIfCurrent(o.user),await s._setRedirectUser(null,t)),o}class hn{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return pn(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!pn(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(p(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(mn(e))}saveEventToCache(e){this.cachedEventUids.add(mn(e)),this.lastProcessedEventTime=
2Date.now()}}function mn(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function pn(e){let{type:t,error:n}=e;return"unknown"===t&&(null===n||void 0===n?void 0:n.code)==="auth/".concat("no-auth-event")}const fn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,gn=/^https?/;async function vn(e){if(e.config.emulator)return;const{authorizedDomains:t}=await async function(e){return P(e,"GET","/v1/projects",arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})}(e);for(const r of t)try{if(yn(r))return}catch(n){}m(e,"unauthorized-domain")}function yn(e){const t=N(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const s=new URL(e);return""===s.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&s.hostname===r}if(!gn.test(n))return!1;if(fn.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}const bn=new S(3e4,6e4);function xn(){const e=Rt().___jsl;if(null===e||void 0===e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}function wn(e){return new Promise((t,n)=>{var r,s,a;function i(){xn(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{xn(),n(p(e,"network-request-failed"))},timeout:bn.get()})}if(null===(s=null===(r=Rt().gapi)||void 0===r?void 0:r.iframes)||void 0===s?void 0:s.Iframe)t(gapi.iframes.getContext());else{if(!(null===(a=Rt().gapi)||void 0===a?void 0:a.load)){const t=Se("iframefcb");return Rt()[t]=()=>{gapi.load?i():n(p(e,"network-request-failed"))},Ee("".concat(je.gapiScript,"?onload=").concat(t)).catch(e=>n(e))}i()}}).catch(e=>{throw Nn=null,e})}let Nn=null;const jn=new S(5e3,15e3),En={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Sn=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Cn(e){const t=e.config;b(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?C(t,"emulator/auth/iframe"):"https://".concat(e.config.authDomain,"/").concat("__/auth/iframe"),a={apiKey:t.apiKey,appName:e.name,v:r.MF},i=Sn.get(e.config.apiHost);i&&(a.eid=i);const o=e._getFrameworks();return o.length&&(a.fw=o.join(",")),"".concat(n,"?").concat((0,s.Am)(a).slice(1))}async function kn(e){const t=await function(e){return Nn=Nn||wn(e),Nn}(e),n=Rt().gapi;return b(n,e,"internal-error"),t.open({where:document.body,url:Cn(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:En,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const s=p(e,"network-request-failed"),a=Rt().setTimeout(()=>{r(s)},jn.get());function i(){Rt().clearTimeout(a),n(t)}t.ping(i).then(i,()=>{r(s)})}))}const _n={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class An{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}function Tn(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:500,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:600;const i=Math.max((window.screen.availHeight-a)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const c=Object.assign(Object.assign({},_n),{width:r.toString(),height:a.toString(),top:i,left:o}),u=(0,s.ZQ)().toLowerCase();n&&(l=ue(u)?"_blank":n),le(u)&&(t=t||"http://localhost",c.scrollbars="yes");const d=Object.entries(c).reduce((e,t)=>{let[n,r]=t;return"".concat(e).concat(n,"=").concat(r,",")},"");if(function(){var e;return fe(arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,s.ZQ)())&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(u)&&"_self"!==l)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",l),new An(null);const h=window.open(t||"",l,d);b(h,e,"popup-blocked");try{h.focus()}catch(m){}return new An(h)}const In="__/auth/handler",Pn="emulator/auth/handler",Rn=encodeURIComponent("fac");async function Dn(e,t,n,a,i,o){b(e.config.authDomain,e,"auth-domain-config-required"),b(e.config.apiKey,e,"invali
2d-api-key");const l={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:a,v:r.MF,eventId:i};if(t instanceof Ye){t.setDefaultLanguage(e.languageCode),l.providerId=t.providerId||"",(0,s.Im)(t.getCustomParameters())||(l.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(o||{}))l[e]=t}if(t instanceof Qe){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(l.scopes=e.join(","))}e.tenantId&&(l.tid=e.tenantId);const c=l;for(const r of Object.keys(c))void 0===c[r]&&delete c[r];const u=await e._getAppCheckToken(),d=u?"#".concat(Rn,"=").concat(encodeURIComponent(u)):"";return"".concat(function(e){let{config:t}=e;if(!t.emulator)return"https://".concat(t.authDomain,"/").concat(In);return C(t,Pn)}(e),"?").concat((0,s.Am)(c).slice(1)).concat(d)}const On="webStorageSupport";const Ln=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=At,this._completeRedirectFn=dn,this._overrideRedirectResult=ln}async _openPopup(e,t,n,r){var s;w(null===(s=this.eventManagers[e._key()])||void 0===s?void 0:s.manager,"_initialize() not called before _openPopup()");return Tn(e,await Dn(e,t,n,N(),r),It())}async _openRedirect(e,t,n,r){await this._originValidation(e);return function(e){Rt().location.href=e}(await Dn(e,t,n,N(),r)),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(w(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await kn(e),n=new hn(e);return t.register("authEvent",t=>{b(null===t||void 0===t?void 0:t.authEvent,e,"invalid-auth-event");return{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(On,{type:On},n=>{var r;const s=null===(r=null===n||void 0===n?void 0:n[0])||void 0===r?void 0:r[On];void 0!==s&&t(!!s),m(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=vn(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ge()||ce()||fe()}};var Mn="@firebase/auth",Fn="1.10.8";class Un{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(e)}}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null===t||void 0===t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){b(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}const Vn=(0,s.XA)("authIdTokenMaxAge")||300;let zn=null;const Bn=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&((new Date).getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Vn)return;const s=null===n||void 0===n?void 0:n.token;zn!==s&&(zn=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:"Bearer ".concat(s)}:{}}))};function qn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,r.Sx)();const t=(0,r.j6)(e,"auth");if(t.isInitialized())return t.getImmediate();const n=function(e,t){const n=(0,r.j6)(e,"auth");if(n.isInitialized()){const e=n.getImmediate(),r=n.getOptions();if((0,s.bD)(r,null!==t&&void 0!==t?t:{}))return e;m(e,"already-initialized")}return n.initialize({options:t})}(e,{popupRedirectResolver:Ln,persistence:[Ht,Et,At]}),a=(0,s.XA)("authTokenSyncURL");if(a&&"boolean"===typeof isSecureContext&&isSecureContext){const e=new URL(a,location.origin);if(location.origin===e.origin){const t=Bn(e.toString());!function(e,t,n){(0,s.Ku)(e).beforeAuthStateChanged(t,n)}(n,t,()=>t(n.currentUser)),function(e,t,n,r){(0,s.Ku)(e).onIdTokenChanged(t,n,r)}(n,e=>t(e))}}const i=(0,s.Tj)("auth");return i&&Re(n,"http://".concat(i)),n}var Hn;je={loadJS:e=>
2new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=p("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",function(){var e,t;return null!==(t=null===(e=document.getElementsByTagName("head"))||void 0===e?void 0:e[0])&&void 0!==t?t:document}().appendChild(r)}),gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="},Hn="Browser",(0,r.om)(new o.uA("auth",(e,t)=>{let{options:n}=t;const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:i,authDomain:o}=r.options;b(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:o,clientPlatform:Hn,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ve(Hn)},c=new xe(r,s,a,l);return function(e,t){const n=(null===t||void 0===t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(ne);(null===t||void 0===t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null===t||void 0===t?void 0:t.popupRedirectResolver)}(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),(0,r.om)(new o.uA("auth-internal",e=>(e=>new Un(e))(we(e.getProvider("auth").getImmediate())),"PRIVATE").setInstantiationMode("EXPLICIT")),(0,r.KO)(Mn,Fn,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}(Hn)),(0,r.KO)(Mn,Fn,"esm2017")},7943:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>h});var s=n(5043),a=n(4758),i=n(4879),o=n(5114),l=n(4366),c=n(579),u=e([a,o]);[a,o]=u.then?(await u)():u;const d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:220;return e?e.length<=t?e:e.slice(0,t-1)+"\u2026":""},h=()=>{const{reviews:e,loading:t,error:n}=(0,a.m)({limit:18}),{isAdminUser:r}=(0,i.h)(),[u,h]=(0,s.useState)(0),[m,p]=(0,s.useState)(new Set);(0,s.useEffect)(()=>{if(!e||e.length<=3)return;const t=setInterval(()=>{h(t=>t>=e.length-3?0:t+1)},8e3);return()=>clearInterval(t)},[e]);const f=e?e.slice(u,u+3):[];return(0,c.jsxs)("section",{className:"home-reviews-section",children:[(0,c.jsx)("h2",{children:"What Students Say"}),t&&(0,c.jsx)("div",{className:"reviews-loading",children:"Loading reviews\u2026"}),n&&(0,c.jsx)("div",{className:"reviews-error",children:String(n)}),!t&&!n&&(0,c.jsxs)("div",{className:"home-reviews-container",children:[(0,c.jsx)("div",{className:"home-reviews-row",role:"list",children:f.map(e=>{var t;const s=(e.comment||"").length>220,a="/courses/".concat(e.courseId,"#reviews-section"),i=e.userPhotoURL&&!m.has(e.id);return(0,c.jsxs)("article",{className:"home-review-card",role:"listitem",children:[(0,c.jsxs)("div",{className:"home-review-header",children:[(0,c.jsxs)("div",{className:"review-user",children:[(0,c.jsx)("div",{className:"review-avatar","aria-hidden":!0,children:i?(0,c.jsx)("img",{src:e.userPhotoURL,alt:e.userName||"User",onError:()=>{return t=e.id,void p(e=>new Set([...e,t]));var t}}):(0,c.jsx)("div",{className:"default-avatar",children:null===(t=(e.userName||"User").charAt(0))||void 0===t?void 0:t.toUpperCase()})}),(0,c.jsx)("div",{children:(0,c.jsxs)("div",{className:"review-username",children:[(0,c.jsx)("span",{children:e.userName||"User"}),e.verified&&(0,c.jsx)("span",{className:"review-verified",title:"Verified User",children:"\u2713"})]})})]}),(0,c.jsx)("button",{className:"review-stars clickable-stars",onClick:()=>{window.location.href="/courses/".concat(e.courseId,"#reviews-section")},title:"Click to view all reviews for this course","aria-label":"".concat(e.rating," out of 5 stars. Click to view reviews for ").concat(e.courseTitle),children:"\u2605".repeat(Math.round(e.rating||0)).padEnd(5,"\u2606")})]}),(0,c.jsx)("div",{className:"review-course-chip",children:e.courseTitle||e.courseId}),(0,c.jsx)("p",{className:"home-review-comment",children:d(e.comment)}),(0,c.jsxs)("div",{className:"home-review-footer",children:[s&&(0,c.jsx)(l.N_,{to:a,className:"home-review-more",children:"Read more \u2192"}),r&&(0,c.jsx)("button",{className:"home-review-admin-delete-btn",onClick:t=>{t.preventDefault(),(async e=>{if(window.confirm("Are you sure you want to delete ".concat(e.userName,"'s review? This action cannot be undone.")))try{const t=await(0,o.hk)(e.id);t.success?(alert("Review deleted successfully"),window.location.reload()):alert("Failed to delete review: ".concat(t.error))}catch(n){alert("Failed to delete review. Please try again.")}})(e)},title:"Admin: Delete this review",children:"\ud83d\uddd1\ufe0f"})]})]},e.id)})}),e&&e.length>3&&(0,c.jsx)("div",{className:"home-reviews-indicators",children:Array.from({length:Math.max(1,e.length-2)}).map((t,n)=>(0,c.jsx)("button",{className:"review-indicator ".concat(n===u?"active":""),onClick:()=>h(n),"aria-label":"Show reviews ".concat(n+1,"-").concat(Math.min(n+3,e.length))}
2,n))})]})]})};r()}catch(d){r(d)}})},7950:(e,t,n)=>{!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=n(6672)},8108:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(2555),s=n(5043),a=n(7324),i=n(579);const o=e=>{let{course:t,batch:n,onClose:o,onSave:l,showNotification:c}=e;const u=!!n,[d,h]=(0,s.useState)(null),[m,p]=(0,s.useState)({batchNumber:1,batchName:"",startDate:"",endDate:"",status:"upcoming",maxCapacity:30,enrollmentCount:0,classLinks:{zoom:"",discord:""},driveLinks:{videosFolder:"",materialsFolder:""}}),[f,g]=(0,s.useState)(!1),[v,y]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(n){var e,s,a,i;h(n.id),p({batchNumber:n.batchNumber||1,batchName:n.batchName||"",startDate:n.startDate||"",endDate:n.endDate||"",status:n.status||"upcoming",maxCapacity:n.maxCapacity||30,enrollmentCount:n.enrollmentCount||0,classLinks:{zoom:(null===(e=n.classLinks)||void 0===e?void 0:e.zoom)||"",discord:(null===(s=n.classLinks)||void 0===s?void 0:s.discord)||""},driveLinks:{videosFolder:(null===(a=n.driveLinks)||void 0===a?void 0:a.videosFolder)||"",materialsFolder:(null===(i=n.driveLinks)||void 0===i?void 0:i.materialsFolder)||""}})}else{var o;h(null);const e=((null===(o=t.batches)||void 0===o?void 0:o.length)||0)+1;p(t=>(0,r.A)((0,r.A)({},t),{},{batchNumber:e}))}},[n,t]);const b=e=>{const{name:t,value:n,type:s}=e.target;if(t.startsWith("classLinks.")){const e=t.split(".")[1];p(t=>(0,r.A)((0,r.A)({},t),{},{classLinks:(0,r.A)((0,r.A)({},t.classLinks),{},{[e]:n})}))}else if(t.startsWith("driveLinks.")){const e=t.split(".")[1];p(t=>(0,r.A)((0,r.A)({},t),{},{driveLinks:(0,r.A)((0,r.A)({},t.driveLinks),{},{[e]:n})}))}else p(e=>(0,r.A)((0,r.A)({},e),{},{[t]:"number"===s?parseInt(n)||0:n}))};return(0,i.jsx)("div",{className:"modal-overlay",onClick:o,children:(0,i.jsxs)("div",{className:"modal-content batch-manager-modal",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)("div",{className:"modal-header",children:[(0,i.jsx)("h2",{children:u?"\u270f\ufe0f Edit Batch":"\u2795 Add New Batch"}),(0,i.jsx)("button",{className:"modal-close",onClick:o,children:"\xd7"})]}),v&&(0,i.jsx)("div",{className:"error-message",children:v}),(0,i.jsxs)("form",{onSubmit:async e=>{e.preventDefault(),g(!0),y(null);try{u?(await(0,a.Kq)(t.id,d,m),c&&c("Batch updated successfully!","success")):(await(0,a.Xm)(t.id,(0,r.A)((0,r.A)({},m),{},{schedule:[],videos:[]})),c&&c("Batch created successfully!","success")),l(),o()}catch(n){const e=n.message||"Failed to ".concat(u?"update":"create"," batch");y(e),c&&c(e,"error")}finally{g(!1)}},className:"batch-manager-form",children:[(0,i.jsxs)("div",{className:"form-grid",children:[(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"batchNumber",children:"Batch Number *"}),(0,i.jsx)("input",{type:"number",id:"batchNumber",name:"batchNumber",value:m.batchNumber,onChange:b,required:!0,min:"1",disabled:u})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"batchName",children:"Batch Name *"}),(0,i.jsx)("input",{type:"text",id:"batchName",name:"batchName",value:m.batchName,onChange:b,placeholder:"e.g., Alpha, Beta",required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"startDate",children:"Start Date *"}),(0,i.jsx)("input",{type:"date",id:"startDate",name:"startDate",value:m.startDate,onChange:b,required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"endDate",children:"End Date *"}),(0,i.jsx)("input",{type:"date",id:"endDate",name:"endDate",value:m.endDate,onChange:b,required:!0})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"status",children:"Status *"}),(0,i.jsxs)("select",{id:"status",name:"status",value:m.status,onChange:b,required:!0,children:[(0,i.jsx)("option",{value:"upcoming",children:"Upcoming"}),(0,i.jsx)("option",{value:"active",children:"Active"}),(0,i.jsx)("option",{value:"completed",children:"Completed"})]})]}),(0,i.jsxs)("div",{className:"form-group",children:[(0,i.jsx)("label",{htmlFor:"maxCapacity",children:"Max Capacity *"}),(0,i.jsx)("input",{type:"number",id:"maxCapacity",name:"maxCapacity",value:m.maxCapacity,onChange:b,required:!0,min:"1"})]}),(0,i.jsxs)("div",{className:"form-group full-width",children:[(0,i.jsx)("label",{htmlFor:"zoom",children:"Zoom Link"}),(0,i.jsx)("input",{type:"url",id:"zoom",name:"classLinks.zoom",value:m.classLinks.zoom,onChange:b,placeholder:"https://zoom.us/j/..."})]}),(0,i.jsxs)("div",{className:"form-group full-width",children:[(0,i.jsx)("label",{htmlFor:"discord",children:"Discord Link"}
2),(0,i.jsx)("input",{type:"url",id:"discord",name:"classLinks.discord",value:m.classLinks.discord,onChange:b,placeholder:"https://discord.gg/..."})]}),(0,i.jsxs)("div",{className:"form-section-divider",children:[(0,i.jsx)("h4",{children:"\ud83d\udcc1 Google Drive Folders"}),(0,i.jsx)("p",{className:"form-section-description",children:"Share your Google Drive folders containing videos and course materials. Students will access content directly through these folder links."})]}),(0,i.jsxs)("div",{className:"form-group full-width",children:[(0,i.jsxs)("label",{htmlFor:"videosFolder",children:["\ud83d\udcf9 Videos Folder Link",(0,i.jsx)("span",{className:"field-hint",children:"Google Drive folder containing all class recordings"})]}),(0,i.jsx)("input",{type:"url",id:"videosFolder",name:"driveLinks.videosFolder",value:m.driveLinks.videosFolder,onChange:b,placeholder:"https://drive.google.com/drive/folders/..."})]}),(0,i.jsxs)("div",{className:"form-group full-width",children:[(0,i.jsxs)("label",{htmlFor:"materialsFolder",children:["\ud83d\udcda Materials Folder Link",(0,i.jsx)("span",{className:"field-hint",children:"Google Drive folder containing PDFs, slides, and resources"})]}),(0,i.jsx)("input",{type:"url",id:"materialsFolder",name:"driveLinks.materialsFolder",value:m.driveLinks.materialsFolder,onChange:b,placeholder:"https://drive.google.com/drive/folders/..."})]})]}),(0,i.jsxs)("div",{className:"modal-actions",children:[u&&(0,i.jsx)("button",{type:"button",className:"btn-danger",onClick:async()=>{if(window.confirm("Are you sure you want to delete Batch ".concat(m.batchNumber,"? This action cannot be undone."))){g(!0),y(null);try{await(0,a.deleteBatch)(t.id,d),c&&c("Batch deleted successfully!","success"),l(),o()}catch(e){const t=e.message||"Failed to delete batch";y(t),c&&c(t,"error"),g(!1)}}},disabled:f,children:"Delete Batch"}),(0,i.jsx)("div",{style:{flex:1}}),(0,i.jsx)("button",{type:"button",className:"btn-secondary",onClick:o,disabled:f,children:"Cancel"}),(0,i.jsx)("button",{type:"submit",className:"btn-primary",disabled:f,children:f?"Saving...":u?"Update Batch":"Create Batch"})]})]})]})})}},8114:(e,t,n)=>{n.d(t,{A:()=>c});var r=n(5043),s=n(4366),a=n(342),i=n(762),o=(n(5866),n(579));const l=["[email protected]","[email protected]","[email protected]"],c=()=>{var e,t;const[n,c]=(0,r.useState)(!1),[u,d]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1),p=(0,s.zy)(),f=(0,s.Zp)(),{user:g,logout:v}=(0,a.A)();(0,r.useEffect)(()=>{(async()=>{if(g)try{if(await(0,i.N6)(g.uid))return void m(!0);m(l.includes(g.email))}catch(e){m(l.includes(g.email))}else m(!1)})()},[g]);const y=()=>{c(!1),d(!1)},b=e=>"/"===e&&"/"===p.pathname||!("/"===e||!p.pathname.startsWith(e));return(0,r.useEffect)(()=>(n?document.body.classList.add("menu-open"):document.body.classList.remove("menu-open"),()=>{document.body.classList.remove("menu-open")}),[n]),(0,r.useEffect)(()=>{const e=e=>{"Escape"===e.key&&n&&y()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n]),(0,o.jsxs)("nav",{className:"navbar",children:[(0,o.jsx)("div",{className:"logo",children:(0,o.jsxs)(s.N_,{to:"/",onClick:y,children:[(0,o.jsx)("img",{src:"/logo192.png",alt:"TuneParams Logo",className:"logo-image"}),"TunePARAMS"]})}),(0,o.jsxs)("button",{className:"hamburger ".concat(n?"hamburger-open":""),onClick:()=>{c(!n)},"aria-label":"Toggle navigation",children:[(0,o.jsx)("span",{}),(0,o.jsx)("span",{}),(0,o.jsx)("span",{})]}),(0,o.jsxs)("div",{className:"nav-links ".concat(n?"nav-links-open":""),children:[(0,o.jsx)(s.N_,{to:"/",onClick:y,className:b("/")?"active":"",children:"Home"}),(0,o.jsx)(s.N_,{to:"/courses",onClick:y,className:b("/courses")?"active":"",children:"Courses"}),(0,o.jsx)(s.N_,{to:"/forums",onClick:y,className:b("/forums")?"active":"",children:"Forums"}),(0,o.jsx)(s.N_,{to:"/about-us",onClick:y,className:b("/about-us")?"active":"",children:"About Us"}),g&&(0,o.jsx)(s.N_,{to:"/dashboard",onClick:y,className:b("/dashboard")?"active":"",children:"Dashboard"}),(0,o.jsx)(s.N_,{to:"/contact",onClick:y,className:b("/contact")?"active":"",children:"Contact"}),g?(0,o.jsxs)("div",{className:"user-menu-container",children:[(0,o.jsxs)("button",{className:"user-profile-button",onClick:()=>d(!u),children:[g.photoURL?(0,o.jsx)("img",{src:g.photoURL,alt:g.
2name,className:"user-avatar"}):(0,o.jsx)("div",{className:"user-avatar-fallback",children:(null===(e=g.name)||void 0===e||null===(t=e.charAt(0))||void 0===t?void 0:t.toUpperCase())||"U"}),(0,o.jsx)("span",{className:"user-name",children:g.name}),(0,o.jsx)("span",{className:"dropdown-arrow",children:"\u25bc"})]}),u&&(0,o.jsxs)("div",{className:"user-dropdown",children:[(0,o.jsxs)("div",{className:"user-info-section",children:[(0,o.jsx)("div",{className:"user-info-name",children:g.name}),(0,o.jsx)("div",{className:"user-info-email",children:g.email}),(0,o.jsxs)("div",{className:"user-info-role",children:["Role: ",g.role," ",h&&"(Admin)"]})]}),h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.N_,{to:"/admin/dashboard",onClick:y,className:"admin-menu-link",children:"\ud83c\udfdb\ufe0f Admin Panel"}),(0,o.jsx)("div",{className:"admin-menu-separator"})]}),(0,o.jsx)("button",{onClick:async()=>{(await v()).success&&(f("/"),y())},className:"",children:"Logout"})]})]}):(0,o.jsx)(s.N_,{to:"/login",onClick:y,className:b("/login")?"active":"",children:"Login"})]}),n&&(0,o.jsx)("div",{className:"nav-overlay",onClick:y})]})}},8130:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(5043),s=n(5472),a=n(8426),i=n(579);const o=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)(!1),[l,c]=(0,r.useState)(null),[u,d]=(0,r.useState)([]),h=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info";const r=(new Date).toLocaleTimeString();t(t=>[...t,{timestamp:r,message:e,type:n}]),console.log("[".concat(r,"] ").concat(e))},m=e=>{d(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},p=e=>e&&"firestore/timestamp/1.0"===e.type?new Date(1e3*e.seconds+e.nanoseconds/1e6):e,f=e=>{const t={};for(const[n,r]of Object.entries(e))r&&"object"===typeof r&&"firestore/timestamp/1.0"===r.type?t[n]=p(r):r&&"object"===typeof r&&!Array.isArray(r)?t[n]=f(r):t[n]=r;return t},g=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"replace";h("\ud83d\udd04 Restoring collection: ".concat(e," (").concat(t.length," documents)"),"info");try{if("replace"===n){h("\ud83d\uddd1\ufe0f Clearing existing ".concat(e," collection..."),"info");const t=await(0,s.GG)((0,s.rJ)(a.db,e));if(!t.empty){const e=400,n=t.docs;for(let t=0;t<n.length;t+=e){const r=n.slice(t,t+e),i=(0,s.wP)(a.db);r.forEach(e=>{i.delete(e.ref)}),await i.commit(),h("  \ud83d\uddd1\ufe0f Deleted batch ".concat(Math.floor(t/e)+1,"/").concat(Math.ceil(n.length/e)),"info")}h("\u2705 Cleared ".concat(n.length," existing documents"),"success")}}const r=400;for(let n=0;n<t.length;n+=r){const i=t.slice(n,n+r),o=(0,s.wP)(a.db);i.forEach(t=>{const n=(0,s.H9)(a.db,e,t.id),r=f(t.data);o.set(n,r)}),await o.commit(),h("  \u2705 Restored batch ".concat(Math.floor(n/r)+1,"/").concat(Math.ceil(t.length/r)),"success")}h("\ud83c\udf89 Successfully restored ".concat(t.length," documents to ").concat(e),"success")}catch(r){throw h("\u274c Error restoring ".concat(e,": ").concat(r.message),"error"),r}},v=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"replace";h("\ud83d\udd04 Restoring subcollection: ".concat(e),"info");try{const r=e.split("/");if(3!==r.length)throw new Error("Invalid subcollection path: ".concat(e));const[i,o,l]=r,c=(0,s.H9)(a.db,i,o),u=(0,s.rJ)(c,l);if("replace"===n){h("  \ud83d\uddd1\ufe0f Clearing existing documents in ".concat(e,"..."),"info");const t=(await(0,s.GG)(u)).docs;if(t.length>0){const e=400;for(let n=0;n<t.length;n+=e){const r=t.slice(n,n+e),i=(0,s.wP)(a.db);r.forEach(e=>{i.delete(e.ref)}),await i.commit(),h("  \ud83d\uddd1\ufe0f Deleted batch ".concat(Math.floor(n/e)+1,"/").concat(Math.ceil(t.length/e)),"info")}h("\u2705 Cleared ".concat(t.length," existing documents"),"success")}}const d=400;for(let e=0;e<t.length;e+=d){const n=t.slice(e,e+d),r=(0,s.wP)(a.db);n.forEach(e=>{const t=(0,s.H9)(c,l,e.id),n=f(e.data);r.set(t,n)}),await r.commit(),h("  \u2705 Restored batch ".concat(Math.floor(e/d)+1,"/").concat(Math.ceil(t.length/d)),"success")}h("\ud83c\udf89 Successfully restored ".concat(t.length," documents to ").concat(e),"success")}catch(r){throw h("\u274c Error restoring ".concat(e,": ").concat(r.message),"error"),r}},y=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"replace";if(!l)return void h("\u274c No backup data loaded","error");
2if(0===u.length)return void h("\u274c No collections selected for restore","error");if(window.confirm("\ud83d\udea8 DANGER! This will ".concat("replace"===e?"REPLACE":"ADD TO"," the following collections:\n\n")+u.join(", ")+"\n\nAre you absolutely sure you want to proceed?\n\nThis action cannot be easily undone!")){o(!0),h("\ud83d\udea8 Starting ".concat(e," restore operation..."),"info"),h("\ud83d\udcca Restoring ".concat(u.length," collections"),"info");try{let t=0;for(const n of u)if(l.collections&&l.collections[n]){const r=l.collections[n];r&&r.length>0?(await g(n,r,e),t+=r.length):h("\u26a0\ufe0f No documents found for collection: ".concat(n),"warning")}else if(l.subcollections&&l.subcollections[n]){const r=l.subcollections[n];r&&r.length>0?(await v(n,r,e),t+=r.length):h("\u26a0\ufe0f No documents found for subcollection: ".concat(n),"warning")}else h("\u26a0\ufe0f Collection/subcollection not found in backup: ".concat(n),"warning");h("\ud83c\udf89 RESTORE COMPLETED! Total documents restored: ".concat(t),"success")}catch(t){h("\u274c CRITICAL ERROR during restore: ".concat(t.message),"error")}finally{o(!1)}}else h("\u274c Restore cancelled by user","warning")};return(0,i.jsxs)("div",{style:{maxWidth:"1200px",margin:"0 auto",padding:"24px",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',backgroundColor:"#f8f9fa",minHeight:"100vh"},children:[(0,i.jsxs)("div",{style:{background:"linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%)",color:"white",padding:"32px",borderRadius:"12px",marginBottom:"24px",boxShadow:"0 4px 20px rgba(0,0,0,0.1)"},children:[(0,i.jsx)("h1",{style:{fontSize:"2.25rem",fontWeight:"700",margin:"0 0 8px 0",display:"flex",alignItems:"center",gap:"12px"},children:"\ud83d\udd04 Database Restore Tool"}),(0,i.jsx)("p",{style:{fontSize:"1.1rem",margin:"0",opacity:"0.9",fontWeight:"400"},children:"Restore data from backup files with precision and safety"})]}),(0,i.jsx)("div",{style:{background:"linear-gradient(135deg, #fff3cd 0%, #f8d7da 100%)",border:"2px solid #dc3545",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 4px 12px rgba(220,53,69,0.2)"},children:(0,i.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:"16px"},children:[(0,i.jsx)("span",{style:{fontSize:"2rem",flexShrink:0},children:"\u26a0\ufe0f"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{style:{margin:"0 0 12px 0",color:"#721c24",fontSize:"1.3rem",fontWeight:"700"},children:"CRITICAL WARNING - DATA REPLACEMENT OPERATION"}),(0,i.jsxs)("div",{style:{color:"#721c24",lineHeight:"1.7",fontSize:"1rem"},children:[(0,i.jsxs)("p",{style:{margin:"0 0 12px 0",fontWeight:"600"},children:["This tool can ",(0,i.jsx)("strong",{children:"completely overwrite"})," your entire database."]}),(0,i.jsxs)("ul",{style:{margin:"0",paddingLeft:"20px"},children:[(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"REPLACE mode:"})," Deletes existing data and replaces with backup"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"MERGE mode:"})," Adds backup data alongside existing data"]}),(0,i.jsx)("li",{children:(0,i.jsx)("strong",{children:"Always test on development environments first!"})}),(0,i.jsx)("li",{children:(0,i.jsx)("strong",{children:"Create a fresh backup before any restore operation"})})]})]})]})]})}),(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udcc1 Select Backup File"}),(0,i.jsxs)("div",{style:{border:"3px dashed #6c757d",borderRadius:"12px",padding:"32px",textAlign:"center",transition:"all 0.2s ease",backgroundColor:"#f8f9fa"},children:[(0,i.jsx)("div",{style:{fontSize:"3rem",marginBottom:"16px",opacity:"0.6"},children:"\ud83d\udcc4"}),(0,i.jsx)("input",{type:"file",accept:".json",onChange:e=>{const t=e.target.files[0];if(!t)return;h("\ud83d\udcc1 Selected backup file: ".concat(t.name),"info");const n=new FileReader;n.onload=e=>{try{const t=JSON.parse(e.target.result);c(t),h("\u2705 Backup file loaded successfully","success"),h("\ud83d\udcca Backup created: ".concat(new Date(t.timestamp).toLocaleStr
2ing()),"info"),h("\ud83d\udccb Version: ".concat(t.version||"1.0"),"info"),h("\ud83d\udccb Collections available: ".concat(Object.keys(t.collections).join(", ")),"info"),t.subcollections&&Object.keys(t.subcollections).length>0&&h("\ud83d\uddc2\ufe0f Subcollections found: ".concat(Object.keys(t.subcollections).join(", ")),"info");const n=Object.keys(t.collections);t.subcollections&&n.push(...Object.keys(t.subcollections)),d(n)}catch(t){h("\u274c Error parsing backup file: ".concat(t.message),"error"),c(null)}},n.readAsText(t)},style:{padding:"12px",fontSize:"1rem",border:"2px solid #007bff",borderRadius:"8px",backgroundColor:"white",cursor:"pointer",marginBottom:"12px"}}),(0,i.jsx)("p",{style:{margin:"0",color:"#6c757d",fontSize:"1.1rem",fontWeight:"500"},children:"Select a backup JSON file to restore from"})]})]}),l&&(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"2px solid #28a745"},children:[(0,i.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udccb Backup Information"}),(0,i.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(200px, 1fr))",gap:"16px",marginBottom:"24px"},children:[(0,i.jsxs)("div",{style:{background:"#e3f2fd",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"1.1rem",fontWeight:"600",color:"#1976d2"},children:new Date(l.timestamp).toLocaleString()}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Created"})]}),(0,i.jsxs)("div",{style:{background:"#e8f5e8",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"1.5rem",fontWeight:"700",color:"#2e7d32"},children:l.version}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Version"})]}),(0,i.jsxs)("div",{style:{background:"#fff3cd",padding:"16px",borderRadius:"8px",textAlign:"center"},children:[(0,i.jsx)("div",{style:{fontSize:"1.1rem",fontWeight:"600",color:"#856404",wordBreak:"break-word"},children:l.description||"No description"}),(0,i.jsx)("div",{style:{color:"#6c757d",fontSize:"0.9rem"},children:"Description"})]})]}),(0,i.jsx)("h3",{style:{fontSize:"1.2rem",fontWeight:"600",margin:"0 0 16px 0",color:"#495057"},children:"\ud83d\udce6 Select Collections to Restore"}),Object.keys(l.collections).length>0&&(0,i.jsxs)("div",{style:{marginBottom:"20px"},children:[(0,i.jsx)("h4",{style:{margin:"0 0 12px 0",color:"#495057",fontSize:"1.1rem",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udcda Top-level Collections"}),(0,i.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(280px, 1fr))",gap:"12px"},children:Object.entries(l.collections).map(e=>{let[t,n]=e;return(0,i.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",border:"2px solid #e9ecef",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:u.includes(t)?"#e7f3ff":"white"},onMouseOver:e=>{e.currentTarget.style.borderColor="#007bff",e.currentTarget.style.backgroundColor=u.includes(t)?"#cce7ff":"#f8f9fa"},onMouseOut:e=>{e.currentTarget.style.borderColor=u.includes(t)?"#007bff":"#e9ecef",e.currentTarget.style.backgroundColor=u.includes(t)?"#e7f3ff":"white"},children:[(0,i.jsx)("input",{type:"checkbox",checked:u.includes(t),onChange:()=>m(t),style:{width:"18px",height:"18px",cursor:"pointer"}}),(0,i.jsxs)("div",{style:{flex:1},children:[(0,i.jsx)("div",{style:{fontWeight:"600",color:"#343a40"},children:t}),(0,i.jsxs)("div",{style:{fontSize:"0.85rem",color:"#6c757d"},children:[n.length," documents"]})]})]},t)})})]}),l.subcollections&&Object.keys(l.subcollections).length>0&&(0,i.jsxs)("div",{children:[(0,i.jsx)("h4",{style:{margin:"0 0 12px 0",color:"#495057",fontSize:"1.1rem",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\uddc2\ufe0f Course-specific Subcollections"}),(0,i.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"12px"},children:Object.entries(l.subcollections).map(e=>{let[t,n]=e;return(0,i.jsxs)("label",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"12px 16px",border:"2px s
2olid #e9ecef",borderRadius:"8px",cursor:"pointer",transition:"all 0.2s ease",backgroundColor:u.includes(t)?"#e8f5e8":"white"},onMouseOver:e=>{e.currentTarget.style.borderColor="#28a745",e.currentTarget.style.backgroundColor=u.includes(t)?"#d1ecf1":"#f8f9fa"},onMouseOut:e=>{e.currentTarget.style.borderColor=u.includes(t)?"#28a745":"#e9ecef",e.currentTarget.style.backgroundColor=u.includes(t)?"#e8f5e8":"white"},children:[(0,i.jsx)("input",{type:"checkbox",checked:u.includes(t),onChange:()=>m(t),style:{width:"18px",height:"18px",cursor:"pointer"}}),(0,i.jsxs)("div",{style:{flex:1},children:[(0,i.jsx)("div",{style:{fontWeight:"600",color:"#343a40"},children:t}),(0,i.jsxs)("div",{style:{fontSize:"0.85rem",color:"#6c757d"},children:[n.length," documents"]})]})]},t)})})]})]}),l&&(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsx)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:"\u26a1 Restore Actions"}),(0,i.jsxs)("div",{style:{display:"flex",gap:"16px",flexWrap:"wrap"},children:[(0,i.jsx)("button",{onClick:()=>y("replace"),disabled:n||!l||0===u.length,style:{padding:"16px 24px",backgroundColor:n||!l||0===u.length?"#6c757d":"#dc3545",color:"white",border:"none",borderRadius:"10px",fontSize:"1.1rem",fontWeight:"600",cursor:n||!l||0===u.length?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"10px",boxShadow:n||!l||0===u.length?"none":"0 4px 12px rgba(220,53,69,0.2)",minWidth:"200px",justifyContent:"center"},onMouseOver:e=>{!n&&l&&u.length>0&&(e.target.style.backgroundColor="#c82333",e.target.style.transform="translateY(-2px)",e.target.style.boxShadow="0 6px 20px rgba(220,53,69,0.3)")},onMouseOut:e=>{!n&&l&&u.length>0&&(e.target.style.backgroundColor="#dc3545",e.target.style.transform="translateY(0)",e.target.style.boxShadow="0 4px 12px rgba(220,53,69,0.2)")},children:"\ud83d\udea8 REPLACE Database"}),(0,i.jsx)("button",{onClick:()=>y("merge"),disabled:n||!l||0===u.length,style:{padding:"16px 24px",backgroundColor:n||!l||0===u.length?"#6c757d":"#ffc107",color:n||!l||0===u.length?"white":"#000",border:"none",borderRadius:"10px",fontSize:"1.1rem",fontWeight:"600",cursor:n||!l||0===u.length?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"10px",boxShadow:n||!l||0===u.length?"none":"0 4px 12px rgba(255,193,7,0.2)",minWidth:"200px",justifyContent:"center"},onMouseOver:e=>{!n&&l&&u.length>0&&(e.target.style.backgroundColor="#e0a800",e.target.style.transform="translateY(-1px)",e.target.style.boxShadow="0 6px 16px rgba(255,193,7,0.3)")},onMouseOut:e=>{!n&&l&&u.length>0&&(e.target.style.backgroundColor="#ffc107",e.target.style.transform="translateY(0)",e.target.style.boxShadow="0 4px 12px rgba(255,193,7,0.2)")},children:"\u2795 MERGE with Database"}),(0,i.jsx)("button",{onClick:()=>{t([])},disabled:n,style:{padding:"16px 20px",backgroundColor:"#6c757d",color:"white",border:"none",borderRadius:"10px",fontSize:"1rem",fontWeight:"500",cursor:n?"not-allowed":"pointer",transition:"all 0.2s ease",display:"flex",alignItems:"center",gap:"8px"},onMouseOver:e=>{n||(e.target.style.backgroundColor="#5a6268")},onMouseOut:e=>{n||(e.target.style.backgroundColor="#6c757d")},children:"\ud83d\uddd1\ufe0f Clear Logs"})]})]}),(0,i.jsxs)("div",{style:{backgroundColor:"white",borderRadius:"12px",padding:"24px",marginBottom:"24px",boxShadow:"0 2px 8px rgba(0,0,0,0.1)",border:"1px solid #e9ecef"},children:[(0,i.jsxs)("h2",{style:{fontSize:"1.5rem",fontWeight:"600",margin:"0 0 20px 0",color:"#343a40",display:"flex",alignItems:"center",gap:"8px"},children:["\ud83d\udccb Activity Log",(0,i.jsxs)("span",{style:{backgroundColor:"#6c757d",color:"white",padding:"4px 8px",borderRadius:"12px",fontSize:"0.8rem",fontWeight:"500"},children:[e.length," entries"]})]}),(0,i.jsx)("div",{style:{backgroundColor:"#1e1e1e",borderRadius:"8px",padding:"20px",maxHeight:"400px",overflowY:"auto",border:"1px solid #333",fontFamily:'Monaco, Menlo, "Ubuntu Mono", monospace'},children:0===e.length?(0,i.jsx)("div",{style:{color:"#6c757d",fontStyle:"italic",textAlign:"center",padding:"40px 20px",fontSize:"1rem"},children:"\ud83d\udcad No activity yet. Select a backup file and choose restore options to begin."}):e.map((e,t)=>(0,i.jsxs)("div",{style:{marginBottom:"8px",color:"error"===e.type?"#ff6b6b":"success"===e.type?"#51cf66":"warning"===e.type?"#ffd43b":"#74c0fc",fontSize:"0.95rem",lineHeight:"1.5",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[(0,i.jsxs)("span",{style:{opacity:"0.7",fontSize:"0.85rem"}
2,children:["[",(new Date).toLocaleTimeString(),"]"]})," ",e.message]},t))})]}),(0,i.jsxs)("div",{style:{background:"linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%)",border:"1px solid #ffc107",borderRadius:"12px",padding:"24px"},children:[(0,i.jsx)("h3",{style:{margin:"0 0 16px 0",color:"#856404",fontSize:"1.3rem",fontWeight:"600",display:"flex",alignItems:"center",gap:"8px"},children:"\ud83d\udca1 Step-by-Step Instructions"}),(0,i.jsxs)("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:"20px"},children:[(0,i.jsx)("div",{children:(0,i.jsxs)("ol",{style:{margin:"0",paddingLeft:"20px",color:"#856404",lineHeight:"1.8"},children:[(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Upload:"})," Select a backup JSON file"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Review:"})," Check backup information and version"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Select:"})," Choose collections to restore"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Choose Mode:"})," REPLACE (overwrites) or MERGE (adds)"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Confirm:"})," Multiple confirmation prompts will appear"]}),(0,i.jsxs)("li",{children:[(0,i.jsx)("strong",{children:"Monitor:"})," Watch the logs for progress and any errors"]})]})}),(0,i.jsxs)("div",{style:{backgroundColor:"#f8d7da",padding:"16px",borderRadius:"8px",border:"1px solid #f5c6cb"},children:[(0,i.jsx)("h4",{style:{margin:"0 0 8px 0",color:"#721c24",fontSize:"1rem"},children:"\ud83d\udea8 Safety Reminder"}),(0,i.jsxs)("p",{style:{margin:"0",fontSize:"0.95rem",color:"#721c24",lineHeight:"1.6"},children:[(0,i.jsx)("strong",{children:"Always test restore operations on a development/staging environment first!"}),"Create a fresh backup before any restore operation. This action cannot be easily undone."]})]})]})]}),(0,i.jsx)("style",{children:"\n                /* Scrollbar styling for logs */\n                div::-webkit-scrollbar {\n                    width: 8px;\n                }\n                div::-webkit-scrollbar-track {\n                    background: #2d2d2d;\n                    border-radius: 4px;\n                }\n                div::-webkit-scrollbar-thumb {\n                    background: #555;\n                    border-radius: 4px;\n                }\n                div::-webkit-scrollbar-thumb:hover {\n                    background: #777;\n                }\n            "})]})}},8185:(e,t,n)=>{n.d(t,{F_:()=>r,Qz:()=>s});const r=()=>!0,s=()=>"true"==={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMPANY_EMAIL:"[email protected]",REACT_APP_COMPANY_NAME:"TuneParams AI Learning Platform",REACT_APP_COMPANY_PHONE:"+1 (469) 702-1086",REACT_APP_EMAILJS_PUBLIC_KEY:"g2ZIKXu5CMAtlW-yr",REACT_APP_EMAILJS_SERVICE_ID:"service_6nnlhkw",REACT_APP_EMAILJS_TEMPLATE_ID:"template_660cmfs",REACT_APP_ENABLE_COUPONS:"true",REACT_APP_ENABLE_PAYPAL:"false",REACT_APP_FIREBASE_API_KEY:"AIzaSyCn55V2y3cXp4Ln0NWjlauU8rgZgMgwDyc",REACT_APP_FIREBASE_APP_ID:"1:995918337622:web:505babbabe198e3f0d0df7",REACT_APP_FIREBASE_AUTH_DOMAIN:"tuneparams.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"995918337622",REACT_APP_FIREBASE_PROJECT_ID:"tuneparams",REACT_APP_FIREBASE_STORAGE_BUCKET:"tuneparams.firebasestorage.app",REACT_APP_FORMSPREE_FORM_ID:"xkgbylng",REACT_APP_FROM_EMAIL:"[email protected]",REACT_APP_GITHUB_URL:"https://github.com/TuneParams-ai",REACT_APP_HERO_IMAGE_URL:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=500&h=400&fit=crop&auto=format",REACT_APP_LINKEDIN_URL:"https://www.linkedin.com/in/tuneparams/",REACT_APP_PAYPAL_CLIENT_ID:"Acpw6Y9AC_WmjeowDefzez5UraQz8Is2eli9_B1EiyTmkiilTremv-JSsTzcT65epfBO3BHiBmn7X-OF",REACT_APP_PAYPAL_ENVIRONMENT:"live",REACT_APP_SUPPORT_EMAIL:"[email protected]",REACT_APP_TWITTER_URL:"https://twitter.com/tuneparams",REACT_APP_WEBSITE_URL:"https://www.tuneparams.ai"}.REACT_APP_ENABLE_PROGRESS_TRACKING},8426:(e,t,n)=>{n.d(t,{j2:()=>B,db:()=>q,hJ:()=>W,Gg:()=>G});var r=n(7150);(0,r.KO)("firebase","11.10.0","app");var s=n(7898),a=n(5472),i=n(1529),o=n(8812);const l="firebasestorage.googleapis.com",c="storageBucket";class u extends i.g{constructor(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(m(e),"Firebase Storage: ".concat(t," (").concat(m(e),")")),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,u.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return m(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message="".concat(this._baseMessage,"\n").concat(this.customData.serverResponse):this.message=this._baseMessage}}var d,h;function m(e){return"storage/"+e}function p(){return new u(d.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function f(){return new u(d.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function g(){return new u(d.CANCELED,"User canceled the upload/download.")}function v(e){return new u(d.INVALID_ARGUMENT,e)}function y(){return new u(d.APP_DELETED,"The Firebase app was deleted.")}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CA
2NNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(d||(d={}));class b{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=b.makeFromUrl(e,t)}catch(s){return new b(e,"")}if(""===n.path)return n;throw r=e,new u(d.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+r+"'.");var r}static makeFromUrl(e,t){let n=null;const r="([A-Za-z0-9.\\-_]+)";const s=new RegExp("^gs://"+r+"(/(.*))?$","i");function a(e){e.path_=decodeURIComponent(e.path)}const i=t.replace(/[.]/g,"\\."),o=[{regex:s,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp("^https?://".concat(i,"/").concat("v[A-Za-z0-9_]+","/b/").concat(r,"/o").concat("(/([^?#]*).*)?$"),"i"),indices:{bucket:1,path:3},postModify:a},{regex:new RegExp("^https?://".concat(t===l?"(?:storage.googleapis.com|storage.cloud.google.com)":t,"/").concat(r,"/").concat("([^?#]*)"),"i"),indices:{bucket:1,path:2},postModify:a}];for(let l=0;l<o.length;l++){const t=o[l],r=t.regex.exec(e);if(r){const e=r[t.indices.bucket];let s=r[t.indices.path];s||(s=""),n=new b(e,s),t.postModify(n);break}}if(null==n)throw function(e){return new u(d.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class x{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(){}}function w(e,t,n,r){if(r<t)throw v("Invalid value for '".concat(e,"'. Expected ").concat(t," or greater."));if(r>n)throw v("Invalid value for '".concat(e,"'. Expected ").concat(n," or less."))}function N(e){const t=encodeURIComponent;let n="?";for(const r in e)if(e.hasOwnProperty(r)){n=n+(t(r)+"="+t(e[r]))+"&"}return n=n.slice(0,-1),n}function j(e,t){const n=e>=500&&e<600,r=-1!==[408,429].indexOf(e),s=-1!==t.indexOf(e);return n||r||s}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(h||(h={}));class E{constructor(e,t,n,r,s,a,i,o,l,c,u){let d=!(arguments.length>11&&void 0!==arguments[11])||arguments[11],h=arguments.length>12&&void 0!==arguments[12]&&arguments[12];this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=s,this.additionalRetryCodes_=a,this.callback_=i,this.errorCallback_=o,this.timeout_=l,this.progressCallback_=c,this.connectionFactory_=u,this.retry=d,this.isUsingEmulator=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{if(t)return void e(!1,new S(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const r=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(r),n.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(r),this.pendingConnection_=null;const t=n.getErrorCode()===h.NO_ERROR,s=n.getStatus();if(!t||j(s,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===h.ABORT;return void e(!1,new S(!1,null,t))}const a=-1!==this.successCodes_.indexOf(s);e(!0,new S(a,n))})},t=(e,t)=>{const n=this.resolve_,r=this.reject_,s=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(s,s.getResponse());void 0!==e?n(e):n()}catch(a){r(a)}else if(null!==s){const e=p();e.serverResponse=s.getErrorText(),this.errorCallback_?r(this.errorCallback_(s,e)):r(e)}else if(t.canceled){r(this.appDelete_?y():g())}else{r(f())}};this.canceled_?t(0,new S(!1,null,!0)):this.backoffId_=function(e,t,n){let r=1,s=null,a=null,i=!1,o=0;function l(){return 2===o}let c=!1;function u(){if(!c){c=!0;for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.apply(null,n)}}function d(t){s=setTimeout(()=>{s=null,e(m,l())},t)}function h(){a&&clearTimeout(a)}function m(e){if(c)return void h();for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];if(e)return h(),void u.call(null,e,...n);if(l()||i)return h(),void u.call(null,e,...n);let a;r<64&&(r*=2),1===o?(o=2,a=0):a=1e3*(r+Math.random()),d(a)}let p=!1;function f(e){p||(p=!0,h(),c||(null!==s?(e||(o=2),clearTimeout(s),d(0)):e||(o=1)))}return d(0),a=setTimeout(()=>{i=!0,f(!0)},n),f}(e,t,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class S{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function C(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}class k{constructor(e,t){this._service=e,this._location=t instanceof b?t:b.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new k(e,t)}get root(){const e=new b(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return C(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new b(this._location.bucket,e);return new k(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw function(e){return new u(d.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}(e)}}function _(e,t){const n=null===t||void 0===t?void 0:t[c];return null==n?null:b.makeFromBucketSpec(n,e)}
2class A{constructor(e,t,n,r,s){let a=arguments.length>5&&void 0!==arguments[5]&&arguments[5];this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=s,this._isUsingEmulator=a,this._bucket=null,this._host=l,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?b.makeFromBucketSpec(r,this._host):_(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=b.makeFromBucketSpec(this._url,e):this._bucket=_(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){w("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){w("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){if((0,r.xZ)(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});if(e){return(await e.getToken()).token}return null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new k(this,e)}_makeRequest(e,t,n,r){let s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(this._deleted)return new x(y());{const a=function(e,t,n,r,s,a){let i=!(arguments.length>6&&void 0!==arguments[6])||arguments[6],o=arguments.length>7&&void 0!==arguments[7]&&arguments[7];const l=N(e.urlParams),c=e.url+l,u=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(u,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(u,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!==t&&void 0!==t?t:"AppManager")}(u,a),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(u,r),new E(c,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,s,i,o)}(e,this._appId,n,r,t,this._firebaseVersion,s,this._isUsingEmulator);return this._requests.add(a),a.getPromise().then(()=>this._requests.delete(a),()=>this._requests.delete(a)),a}}async makeRequestWithTokens(e,t){const[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}}const T="@firebase/storage",I="0.13.14",P="storage";function R(e,t){let{instanceIdentifier:n}=t;const s=e.getProvider("app").getImmediate(),a=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return new A(s,a,i,n,r.MF)}var D,O,L,M,F,U;(0,r.om)(new o.uA(P,R,"PUBLIC").setMultipleInstances(!0)),(0,r.KO)(T,I,""),(0,r.KO)(T,I,"esm2017");const V={apiKey:null===(D="AIzaSyCn55V2y3cXp4Ln0NWjlauU8rgZgMgwDyc")?void 0:D.trim(),authDomain:null===(O="tuneparams.firebaseapp.com")?void 0:O.trim(),projectId:null===(L="tuneparams")?void 0:L.trim(),storageBucket:null===(M="tuneparams.firebasestorage.app")?void 0:M.trim(),messagingSenderId:null===(F="995918337622")?void 0:F.trim(),appId:null===(U="1:995918337622:web:505babbabe198e3f0d0df7")?void 0:U.trim()};let z,B,q,H,W;["REACT_APP_FIREBASE_API_KEY","REACT_APP_FIREBASE_AUTH_DOMAIN","REACT_APP_FIREBASE_PROJECT_ID","REACT_APP_FIREBASE_APP_ID"].filter(e=>!{NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_COMPANY_EMAIL:"[email protected]",REACT_APP_COMPANY_NAME:"TuneParams AI Learning Platform",REACT_APP_COMPANY_PHONE:"+1 (469) 702-1086",REACT_APP_EMAILJS_PUBLIC_KEY:"g2ZIKXu5CMAtlW-yr",REACT_APP_EMAILJS_SERVICE_ID:"service_6nnlhkw",REACT_APP_EMAILJS_TEMPLATE_ID:"template_660cmfs",REACT_APP_ENABLE_COUPONS:"true",REACT_APP_ENABLE_PAYPAL:"false",REACT_APP_FIREBASE_API_KEY:"AIzaSyCn55V2y3cXp4Ln0NWjlauU8rgZgMgwDyc",REACT_APP_FIREBASE_APP_ID:"1:995918337622:web:505babbabe198e3f0d0df7",REACT_APP_FIREBASE_AUTH_DOMAIN:"tuneparams.firebaseapp.com",REACT_APP_FIREBASE_MESSAGING_SENDER_ID:"995918337622",REACT_APP_FIREBASE_PROJECT_ID:"tuneparams",REACT_APP_FIREBASE_STORAGE_BUCKET:"tuneparams.firebasestorage.app",REACT_APP_FORMSPREE_FORM_ID:"xkgbylng",REACT_APP_FROM_EMAIL:"[email protected]",REACT_APP_GITHUB_URL:"https://github.com/TuneParams-ai",REACT_APP_HERO_IMAGE_URL:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=500&h=400&fit=crop&auto=format",REACT_APP_LINKEDIN_URL:"https://www.linkedin.com/in/tuneparams/",REACT_APP_PAYPAL_CLIENT_ID:"Acpw6Y9AC_WmjeowDefzez5UraQz8Is2eli9_B1EiyTmkiilTremv-JSsTzcT65epfBO3BHiBmn7X-OF",REACT_APP_PAYPAL_ENVIRONMENT:"live",REACT_APP_SUPPORT_EMAIL:"[email protected]",REACT_APP_TWITTER_URL:"https://twitter.com/tuneparams",REACT_APP_WEBSITE_URL:"https://www.tuneparams.ai"}[e]).length;let G=!1;try{const e=["apiKey","authDomain","projectId","storageBucket","messagingSenderId","appId"].filter(e=>!V[e]);if(e.length>0)throw new Error("Missing Firebase configuration: ".concat(e.join(", ")));z=(0,r.Wp)(V),B=(0,s.xI)(z),q=(0,a.aU)(z),H=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,r.Sx)(),t=arguments.length>1?arguments[1]:void 0;e=(0,i.Ku)(e);const n=(0,r.j6)(e,P).getImmediate({identifier:t}),s=(0,i.yU)("storage");return s&&function(e,t,n){!function(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};e.host="".concat(t,":").concat(n);const s=(0,i.zJ)(t);s&&((0,i.gE)("https://".concat(e.host,"/b")),(0,i.P1)("Storage",!0)),e._isUsingEmulator=!0,e._protocol=s?"https":"http";const{mockUserToken:a}=r;a&&(e._overrideAuthToken="string"===typeof a?a:(0,i.Fy)(a,e.app.options.projectId))}(e,t,n,arguments.length>3&&void 0!==arguments[3]?arguments[3]:{})}(n,...s),n}(z),W=new s.HF,W.setCustomParameters({prompt:"select_account"}),G=!0}catch(K){B=null,q=null,H=null,W=null,G=!1}}
2,8812:(e,t,n)=>{n.d(t,{h1:()=>o,uA:()=>s});var r=n(1529);class s{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const a="[DEFAULT]";class i{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(n){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null===e||void 0===e?void 0:e.identifier),r=null!==(t=null===e||void 0===e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:a})}catch(t){}for(const[e,n]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:r});n.resolve(e)}catch(t){}}}}clearInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.instances.has(e)}getOptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.instancesOptions.get(e)||{}}initialize(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error("".concat(this.name,"(").concat(n,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[s,a]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(s)&&a.resolve(r)}return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),s=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;s.add(e),this.onInitCallbacks.set(r,s);const a=this.instances.get(r);return a&&e(a,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const s of n)try{s(e,t)}catch(r){}}getOrInitializeService(e){let{instanceIdentifier:t,options:n={}}=e,r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:(s=t,s===a?void 0:s),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch(i){}var s;return r||null}normalizeInstanceIdentifier(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a;return this.component?this.component.multipleInstances?e:a:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class o{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new i(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},8853:(e,t,n)=>{e.exports=n(5896)},8985:(e,t,n)=>{n.d(t,{A:()=>
2o});var r=n(5043),s=n(4366),a=n(7324),i=n(579);const o=()=>{const[e,t]=(0,r.useState)([]),[n,o]=(0,r.useState)([]),[l,c]=(0,r.useState)(!0),[u,d]=(0,r.useState)(null),[h,m]=(0,r.useState)(""),[p,f]=(0,r.useState)("ALL"),g=(0,s.Zp)();(0,r.useEffect)(()=>{(async()=>{try{c(!0);const e=await(0,a.OM)();t(e),o(e)}catch(e){console.error("Error fetching courses:",e),d("Failed to load courses")}finally{c(!1)}})()},[]),(0,r.useEffect)(()=>{let t=e;"ALL"!==p&&(t=t.filter(e=>e.category===p)),h&&(t=t.filter(e=>{var t;return e.title.toLowerCase().includes(h.toLowerCase())||(null===(t=e.description)||void 0===t?void 0:t.toLowerCase().includes(h.toLowerCase()))})),o(t)},[e,h,p]);return l?(0,i.jsx)("div",{className:"admin-course-access",children:(0,i.jsxs)("div",{className:"loading-state",children:[(0,i.jsx)("div",{className:"loading-spinner"}),(0,i.jsx)("p",{children:"Loading courses..."})]})}):u?(0,i.jsx)("div",{className:"admin-course-access",children:(0,i.jsxs)("div",{className:"error-state",children:[(0,i.jsx)("h3",{children:"Error"}),(0,i.jsx)("p",{children:u})]})}):(0,i.jsxs)("div",{className:"admin-course-access",children:[(0,i.jsxs)("div",{className:"admin-course-header",children:[(0,i.jsx)("h2",{children:"\ud83c\udf93 Course Dashboard Access"}),(0,i.jsx)("p",{children:"Access any course dashboard as an administrator"})]}),(0,i.jsxs)("div",{className:"course-filters",children:[(0,i.jsx)("div",{className:"search-box",children:(0,i.jsx)("input",{type:"text",placeholder:"Search courses...",value:h,onChange:e=>m(e.target.value),className:"course-search-input"})}),(0,i.jsx)("div",{className:"category-filter",children:(0,i.jsxs)("select",{value:p,onChange:e=>f(e.target.value),className:"category-select",children:[(0,i.jsx)("option",{value:"ALL",children:"All Categories"}),(0,i.jsx)("option",{value:"FAAI",children:"FAAI"}),(0,i.jsx)("option",{value:"RLAI",children:"RLAI"})]})})]}),(0,i.jsx)("div",{className:"courses-grid",children:0===n.length?(0,i.jsx)("div",{className:"no-courses",children:(0,i.jsx)("p",{children:0===e.length?"No courses available":"No courses match your filters"})}):n.map(e=>{var t,n;return(0,i.jsxs)("div",{className:"admin-course-card",children:[(0,i.jsxs)("div",{className:"course-info",children:[(0,i.jsx)("div",{className:"course-icon",children:"FAAI"===e.category?"\ud83e\udd16":"\ud83e\udde0"}),(0,i.jsxs)("div",{className:"course-details",children:[(0,i.jsx)("h3",{children:e.title}),(0,i.jsx)("p",{className:"course-category",children:e.category}),(0,i.jsx)("p",{className:"course-description",children:(null===(t=e.description)||void 0===t?void 0:t.length)>100?"".concat(e.description.substring(0,100),"..."):e.description}),(0,i.jsxs)("div",{className:"course-meta",children:[(0,i.jsxs)("span",{className:"course-price",children:["\u20b9",null===(n=e.price)||void 0===n?void 0:n.toLocaleString()]}),(0,i.jsx)("span",{className:"course-duration",children:e.duration})]})]})]}),(0,i.jsxs)("div",{className:"course-actions",children:[(0,i.jsxs)("button",{onClick:()=>{return t=e.id,void g("/course/".concat(t,"/dashboard"));var t},className:"admin-dashboard-btn",title:"Access course dashboard as admin",children:[(0,i.jsx)("span",{children:"\ud83d\ude80 Access Dashboard"}),(0,i.jsx)("small",{children:"Admin Access"})]}),(0,i.jsx)("button",{onClick:()=>g("/course/".concat(e.id)),className:"course-detail-btn",title:"View course details page",children:"\ud83d\udcc4 Course Details"})]})]},e.id)})})]})}},8996:(e,t,n)=>{n.d(t,{A:()=>o});var r=n(5043),s=n(4366),a=n(342),i=n(579);const o=()=>{const[e]=(0,s.ok)(),t=(0,s.Zp)(),{verifyEmail:n}=(0,a.A)(),[o,l]=(0,r.useState)("verifying"),[c,u]=(0,r.useState)("Verifying your email...");return(0,r.useEffect)(()=>{(async()=>{const r=e.get("mode"),s=e.get("oobCode");if("verifyEmail"===r&&s)try{const e=await n(s);e.success?(l("success"),u("Email verified successfully! You can now sign in."),setTimeout(()=>{t("/login?verified=true")},3e3)):(l("error"),u(e.error||"Email verification failed."))}catch(a){l("error"),u("Email verification failed. Please try again.")}else l("error"),u("Invalid verification link.")})()},[e,n,t]),(0,i.jsx)("div",{className:"verify-email-container",children:(0,i.jsxs)("div",{className:"verify-email-card",children:[(0,i.jsx)("div",{className:"verify-email-header",children:(0,i.jsx)("h2",{children:"Email Verification"})}),(0,i.jsxs)("div",{className:"verify-email-content",children:["verifying"===o&&(0,i.jsxs)("div",{className:"verification-status",children:[(0,i.jsx)("div",{className:"loading-spinner"}),(0,i.jsx)("p",{children:c})]}),"success"===o&&(0,i.jsxs)("div",{className:"verification-status success",children:[(0,i.jsx)("div",{className:"success-icon",children:"\u2705"}),(0,i.jsx)("p",{children:c}),(0,i.jsx)("p",{className:"redirect-message",children:"Redirecting to login..."})]}),"error"===o&&(0,i.jsxs)("div",{className:"verification-status error",children:[(0,i.jsx)("div",{className:"error-icon",children:"\u274c"}),(0,i.jsx)("p",{children:c}),(0,i.jsx)("button",{className:"btn btn-primary",onClick:()=>
2t("/login"),children:"Go to Login"})]})]})]})})}},9277:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>j});var s=n(2555),a=n(5043),i=n(4366),o=n(342),l=n(9412),c=n(1798),u=n(5491),d=n(7324),h=n(5511),m=n(8185),p=n(7006),f=n(1176),g=n(4532),v=n(4628),y=(n(9651),n(4685),n(346),n(2743)),b=n(579),x=e([l,c,u,h,p,v,y]);[l,c,u,h,p,v,y]=x.then?(await x)():x;const w=()=>{const{courseId:e}=(0,i.g)(),t=(0,i.Zp)(),{user:n}=(0,o.A)(),[r,s]=(0,a.useState)(!1),[x,w]=(0,a.useState)(null),[j,E]=(0,a.useState)(null),[S,C]=(0,a.useState)(!1),[k,_]=(0,a.useState)(null),[A,T]=(0,a.useState)([]),I=(0,m.Qz)(),[P,R]=(0,a.useState)(!1),{courses:D,loading:O}=(0,l.A8)(),{hasAccess:L,enrollment:M,loading:F,error:U,processEnrollment:V,clearError:z}=(0,h.x)(e),{stats:B,loading:q}=(0,c.I1)(e,!0),H=D.find(t=>t.id===e);(0,a.useEffect)(()=>{(async()=>{if(e&&H&&!O)try{const t=await(0,u.hJ)(e);_(t)}catch(t){if(console.error("Error loading next batch:",t),H.batches&&H.batches.length>0){const e=H.batches.find(e=>"active"===e.status||"upcoming"===e.status);_(e||H.batches[H.batches.length-1])}}})()},[e,H,O]),(0,a.useEffect)(()=>{(async()=>{if(e&&H&&!O)try{const t=await(0,d.HP)(e);T(t||[])}catch(t){console.error("Error loading curriculum:",t),T(H.curriculum||[])}})()},[e,H,O]);const W=(0,a.useCallback)(async e=>{console.log("Processing enrollment for:",e.courseTitle);try{if(e.manualSubmission)return console.log("Manual payment submitted; awaiting admin verification"),w(e),E({success:!1,pendingManual:!0}),s(!0),void R(!1);if(e.enrollmentComplete)return console.log("\u2705 Direct enrollment complete"),w(e),E({success:!0,enrollmentId:e.enrollmentId,batchNumber:e.batchNumber,batchInfo:e.batchInfo,emailSent:!0}),s(!0),void R(!1);console.log("Processing paid enrollment...");const t=await V(e);if(!t.success)throw console.error("\u274c Enrollment failed:",t),new Error(t.error||"Enrollment processing failed");console.log("\u2705 Enrollment successful"),w(e),E(t),s(!0),R(!1)}catch(t){console.error("\u274c Enrollment error:",t),alert("Enrollment failed: ".concat(t.message,". Please contact support with your payment details.")),R(!1)}},[V]),G=(0,a.useCallback)(e=>{console.error("Payment error:",e);const t=(null===e||void 0===e?void 0:e.message)||"Payment failed. Please try again or contact support.";alert(t),R(!1)},[]),K=(0,a.useCallback)(e=>{R(!1)},[]),J=(0,a.useCallback)(()=>{s(!1),t("/course/".concat(e,"/dashboard"))},[t,e]),Y=(0,a.useCallback)(()=>{t("/courses")},[t]);(0,a.useEffect)(()=>{let e=!1;const t=()=>{"#reviews-section"!==window.location.hash||e||(e=!0,setTimeout(()=>{let e=document.getElementById("reviews-section");e||(e=document.querySelector(".reviews-section")||document.querySelector('[id*="review"]')||document.querySelector(".home-reviews-section")),e&&(e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),e.style.transition="box-shadow 0.3s ease",e.style.boxShadow="0 0 15px rgba(255, 193, 7, 0.4)",setTimeout(()=>{e.style.boxShadow=""},1500))},200))};t();const n=()=>{e=!1,t()};return window.addEventListener("hashchange",n),()=>{window.removeEventListener("hashchange",n)}},[]);const Q=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"N/A";return!(0,u.lk)(H)||"TBD"!==e&&"N/A"!==e&&null!==e&&0!==e?e||t:"Coming Soon"},$=(0,u.lk)(H);if(O)return(0,b.jsx)("div",{className:"course-detail-container",children:(0,b.jsx)("div",{className:"course-detail-header",children:(0,b.jsx)("div",{className:"course-hero",children:(0,b.jsxs)("div",{className:"course-hero-content",children:[(0,b.jsx)("div",{className:"course-icon-large",children:"\u23f3"}),(0,b.jsxs)("div",{className:"course-info",children:[(0,b.jsx)("h1",{className:"course-detail-title",children:"Loading Course..."}),(0,b.jsx)("p",{className:"course-detail-description",children:"Please wait while we fetch the course information."})]})]})})})});if(!H)return(0,b.jsx)("div",{className:"course-detail-container",children:(0,b.jsx)("div",{className:"course-detail-header",children:(0,b.jsx)("div",{className:"course-hero",children:(0,b.jsxs)("div",{className:"course-hero-content",children:[(0,b.jsx)("div",{className:"course-icon-large",children:"\u2753"}),(0,b.jsxs)("div",{className:"course-info",children:[(0,b.jsx)("h1",{className:"course-detail-title",children:"Course Not Found"}),(0,b.jsx)("p",{className:"course-detail-description",children:"The course you're looking for doesn't exist or has been removed."})]})]})})})});const X=!k;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"course-detail-container",children:[(0,b.jsxs)("div",{className:"course-detail-header",style:{backgroundImage:H.image?"url(".concat(H.image,")"):"none"},children:[(0,b.jsx)("div",{className:"course-detail-header-overlay"}),(0,b.jsxs)("div",{className:"course-detail-header-content",children:[(0,b.jsx)("button",{className:"btn btn-secondary btn-small back-btn",onClick:Y,children:"\u2190 Back to Courses"}),(0,b.jsxs)("div",{className:"course-hero",children:[(0,b.jsxs)("div",{className:"course-hero-content",children:[(0,b.jsx)("div",{className:"course-icon-large",children:Q(H.icon,"\ud83d\udcda")}),(0,b.jsxs)("div",{className:"course-info",children:[(0,b.jsx)("h1",{className:"course-detail-title",children:Q(H.title)}),(0,b.jsx)("p",{className:"course-detail-description",children:Q(H.description)}),(0,b.jsxs)("div",{className:"course-meta-detail",children:[(0,b.jsx)("span",{className:"course-level-detail",children:Q(H.level)}),(0,b.jsxs)("span",{className:"course-duration-detail",children:["\u23f1\ufe0f ",Q(H.duration)]}),(0,b.jsx)("div",{className:"course-rating-detail",children:$?(0,b.jsx)("span",{children:"\u2b50 Coming Soon"}):(0,b.jsx)(g.A,{rating:q?H.rating:B.hasReviews?B.averageRating:H.rating,reviewCount:q?0:B.reviewCount,showReviewCount:!q&&B.hasReviews,size:"small",showNumeric:!0,clickable:!0,onClick:()=>
2{if(S)return;C(!0);setTimeout(()=>{let e=document.getElementById("reviews-section");if(!e){const t=document.querySelectorAll("h3"),n=Array.from(t).find(e=>e.textContent.includes("Student Reviews")||e.textContent.includes("Reviews"));e=(null===n||void 0===n?void 0:n.closest("section"))||(null===n||void 0===n?void 0:n.parentElement)}if(!e){const t=document.querySelectorAll(".course-section");e=Array.from(t).find(e=>e.textContent.includes("Student Reviews"))}e?(e.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"}),e.style.transition="box-shadow 0.3s ease",e.style.boxShadow="0 0 0 3px rgba(255, 193, 7, 0.5)",setTimeout(()=>{e.style.boxShadow="",C(!1)},1500)):(C(!1),alert("Reviews section not found. Please scroll down manually to see reviews."))},100)}})})]})]})]}),(0,b.jsxs)("div",{className:"course-enrollment",children:[!L&&!F&&(0,b.jsxs)("div",{className:"course-price-detail",children:[H.originalPrice&&!$&&(0,b.jsxs)("span",{className:"original-price-detail",children:["$",H.originalPrice]}),(0,b.jsx)("span",{className:"current-price-detail",children:$?"Price TBD":H.price?"$".concat(H.price):"Price N/A"})]}),F&&(0,b.jsxs)("div",{className:"enrollment-loading",children:[(0,b.jsx)("div",{className:"loading-spinner"}),(0,b.jsx)("p",{children:"Checking enrollment status..."})]}),U&&(0,b.jsxs)("div",{className:"enrollment-error",children:[(0,b.jsx)("p",{className:"course-detail-error-text",children:U}),(0,b.jsx)("button",{className:"btn btn-secondary course-detail-access-button",onClick:z,children:"Retry"})]}),!F&&!P&&(0,b.jsx)(b.Fragment,{children:L?(0,b.jsxs)("div",{className:"enrollment-success",children:[(0,b.jsxs)("div",{className:"course-detail-enrollment-success",children:[(0,b.jsx)("p",{className:"course-detail-success-title",children:"\u2705 Enrolled"}),I&&M&&(0,b.jsxs)("p",{className:"course-detail-progress-text",children:["Progress: ",M.progress||0,"%"]})]}),(0,b.jsx)("button",{className:"btn enroll-btn-detail",onClick:()=>t("/course/".concat(e,"/dashboard")),children:"Go to Dashboard \u2192"})]}):(0,b.jsx)("button",{className:"btn enroll-btn-detail ".concat(X?"full":""," ").concat($?"coming-soon":""),onClick:()=>{n?(z(),(0,u.lk)(H)?alert("This course is still in planning phase. Please check back for updates!"):k?L?t("/dashboard"):R(!0):alert("No available batches for enrollment at this time. Please check back later or contact us for more information.")):t("/login")},disabled:X||$,children:$?"Coming Soon":X?"No Available Batches":n?"Enroll Now":"Login to Enroll"})}),P&&(0,b.jsxs)("div",{className:"enrollment-options",children:[(0,b.jsx)("button",{className:"back-to-enroll-btn",onClick:()=>R(!1),children:"\u2190 Back to Course Details"}),(0,b.jsx)(p.A,{courseId:H.id,courseTitle:H.title,coursePrice:H.price,onSuccess:W,onError:G,onCancel:K,disabled:X||$||!H.price})]}),!L&&!F&&k&&k.startDate&&!$&&(0,b.jsxs)("div",{className:"next-batch-info",children:[(0,b.jsx)("span",{className:"next-batch-label",children:"Next Batch Starts:"}),(0,b.jsx)("span",{className:"next-batch-date",children:(()=>{try{const[e,t,n]=k.startDate.split("-"),r=new Date(e,t-1,n);return"".concat(["January","February","March","April","May","June","July","August","September","October","November","December"][r.getMonth()]," ").concat(r.getDate(),", ").concat(r.getFullYear())}catch(e){return console.error("Error formatting batch date:",e),k.startDate}})()})]})]})]})]})]}),(0,b.jsxs)("div",{className:"course-content",children:[(0,b.jsxs)("div",{className:"course-main",children:[(0,b.jsxs)("section",{className:"course-section",children:[(0,b.jsx)("h2",{children:"What You'll Learn"}),H.outcomes&&H.outcomes.length>0?(0,b.jsx)("ul",{className:"outcomes-list",children:H.outcomes.map((e,t)=>(0,b.jsx)("li",{children:e},t))}):(0,b.jsx)("div",{className:"na-message",children:(0,b.jsx)("p",{children:"Learning outcomes information is not available at this time."})})]}),(0,b.jsxs)("section",{className:"course-section",children:[(0,b.jsx)("h2",{children:"Weekly Schedule"}),H.weeklySchedule&&H.weeklySchedule.length>0?(0,b.jsxs)("div",{className:"weekly-schedule-container",children:[(0,b.jsx)("div",{className:"weekly-schedule-list",children:H.weeklySchedule.map((e,t)=>(0,b.jsxs)("div",{className:"schedule-item",children:[(0,b.jsxs)("div",{className:"schedule-info",children:[(0,b.jsx)("span",{className:"day-name",children:e.day}),(0,b.jsx)("span",{className:"session-type",children:e.type}),(0,b.jsx)("span",{className:"schedule-time",children:e.time})]}),e.note&&(0,b.jsx)("div",{className:"session-note",children:(0,b.jsx)("small",{children:e.note})})]},t))}),(0,b.jsxs)("p",{className:"schedule-note",children:[(0,b.jsx)("strong",{children:"Note:"})," All times are in Eastern Time (ET). Detailed schedules provided after enrollment."]})]}):(0,b.jsx)("div",{className:"na-message",children:(0,b.jsx)("p",{children:"Weekly schedule information will be available closer to the course start date."})})]}),(0,b.jsxs)("section",{className:"course-section",children:[(0,b.jsx)("h2",{children:"Course Content"}),A&&A.length>0?(0,b.jsx)(N,{curriculum:A}):H&&H.curriculum&&H.curriculum.length>0?(0,b.jsx)(N,{curriculum:H.curriculum}):(0,b.jsxs)("div",{className:"na-message",children:[(0,b.jsx)("p",{children:"Detailed curriculum information is not available at this time."}),(0,b.jsx)("p",{children:"Course details coming soon!"})]})]})]}),(0,b.jsxs)("div",{className:"course-sidebar",children:[(0,b.jsxs)("section",{className:"course-section",children:[(0,b.jsx)("h3",{children:"Prerequisites"}),H.prerequisites&&H.prerequisites.length>0?(0,b.jsx)("ul",{className:"prerequisites-list",children:H.prerequisites.map((e,t)=>(0,b.jsx)("li",{children:e},t))}):(0,b.jsx)("div",{className:"na-message",children:(0,b.jsx)("p",{children:"No specific prerequisites listed."})})]}),(0,b.jsxs)("section",{className:"course-section",children:[(0,b.jsx)("h3",{children:"Course Information"}),(0,b.jsxs)("div",{className:"course-additional-info",children:[(0,b.jsxs)("div",{className:"info-item",children:[(0,b.jsx)("strong",{children:"Category:"})," ",Q(H.category)]}),(0,b.jsxs)("div",{className:"info-item",children:[(0,b.jsx)("strong",{children:"Level:"})," ",Q(H.level)]}),(0,b.jsxs)("div",{className:"info-item",children:[(0,b.jsx)("strong",{children:"Duration:"})," ",Q(H.duration)]}),(0,b.jsxs)("div",{className:"info-item",children:[(0,b.jsx)("strong",{children:"Total Lessons:"})," ",Q(H.lessons)]}),(0,b.jsxs)("div",{className:"info-item",children:[(0,b.jsx)("strong",{children:"Next Batch:"})," ",k&&k.startDate?(()=>{try{const[e,t,n]=k.startDate.split("-"),r=new Date(e,t-1,n);return"".concat(["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][r.getMonth()]," ").concat(r.getDate(),", ").concat(r.getFullYear())}catch(e){return console.error("Error formatting batch date:",e),k.startDate}})():"N/A"]})]})]}),(0,b.jsx)(y.A,{courseId:H.id,courseTitle:H.title})]})]}),(0,b.jsx)(v.A,{course:H})]}),(0,b.jsx)(f.A,{isOpen:r,onClose:()=>s(!1),paymentData:x,enrollmentResult:j,onGoToDashboard:J})]})},N=e=>{let{curriculum:t}=e;const[n,r]=(0,a.useState)({}),[i,o]=(0,a.useState)({});return(0,b.jsx)("div",{className:"curriculum-list",children:t.map((e,t)=>(0,b.jsxs)("div",{className:"curriculum-item",children:[(0,b.jsxs)("div",{className:"section-header clickable",onClick:()=>(e=>{r(t=>(0,s.A)((0,s.A)({},t),{},{[e]:!t[e]}))})(t),children:[(0,b.jsxs)("div",{className:"section-title-container",children:[(0,b.jsxs)("div",{className:"section-title-with-count",children:[(0,b.jsx)("h3",{children:e.section}),(0,b.jsxs)("span",{className:"topic-count",children:[e.topics?e.topics.length:0," topics"]})]}),(0,b.jsx)("span",{className:"expand-icon ".concat(n[t]?"expanded":""),children:"\u25bc"})]}),e.description&&(0,b.jsx)("p",{className:"section-description",children:e.description})]}
2),n[t]&&e.topics&&e.topics.length>0&&(0,b.jsx)("ul",{className:"topics-list expanded",children:e.topics.map((e,n)=>{const r="".concat(t,"-").concat(n),a=i[r],l="string"===typeof e?e:e.title,c="object"===typeof e&&(e.description||e.duration||e.keyPoints);return(0,b.jsxs)("li",{className:"topic-item",children:[(0,b.jsxs)("div",{className:"topic-header ".concat(c?"clickable":""),onClick:()=>c&&((e,t)=>{const n="".concat(e,"-").concat(t);o(e=>(0,s.A)((0,s.A)({},e),{},{[n]:!e[n]}))})(t,n),children:[(0,b.jsx)("span",{className:"topic-title",children:l}),c&&(0,b.jsx)("span",{className:"topic-expand-icon ".concat(a?"expanded":""),children:"\u25bc"})]}),c&&a&&(0,b.jsxs)("div",{className:"topic-details",children:[e.description&&(0,b.jsx)("p",{className:"topic-description",children:e.description}),(0,b.jsxs)("div",{className:"topic-meta",children:[e.duration&&(0,b.jsxs)("span",{className:"topic-duration",children:["\u23f1\ufe0f ",e.duration]}),e.keyPoints&&e.keyPoints.length>0&&(0,b.jsxs)("div",{className:"key-points",children:[(0,b.jsx)("strong",{children:"Key Points:"}),(0,b.jsx)("ul",{className:"key-points-list",children:e.keyPoints.map((e,t)=>(0,b.jsx)("li",{children:e},t))})]})]})]})]},n)})})]},t))})},j=w;r()}catch(w){r(w)}})},9412:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A8:()=>l});var s=n(5043),a=n(7324),i=n(5491),o=e([i]);i=(o.then?(await o)():o)[0];const l=()=>{const[e,t]=(0,s.useState)([]),[n,r]=(0,s.useState)(!0),[o,l]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1),d=async()=>{try{r(!0),l(null);const e=await(0,a.OM)();e&&e.length>0?(t(e),u(!1)):(console.warn("No courses found in Firebase, using static data"),t(i.pU),u(!0))}catch(e){console.error("Error fetching courses from Firebase:",e),l(e.message),t(i.pU),u(!0)}finally{r(!1)}};(0,s.useEffect)(()=>{d()},[]);return{courses:e,loading:n,error:o,refetch:()=>{d()},useStatic:c}};r()}catch(l){r(l)}})},9540:(e,t,n)=>{n.d(t,{vS:()=>S,cK:()=>E});class r{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Network Error";this.status=e,this.text=t}}const s={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:(()=>{if("undefined"!==typeof localStorage)return{get:e=>Promise.resolve(localStorage.getItem(e)),set:(e,t)=>Promise.resolve(localStorage.setItem(e,t)),remove:e=>Promise.resolve(localStorage.removeItem(e))}})()},a=e=>e?"string"===typeof e?{publicKey:e}:"[object Object]"===e.toString()?e:{}:{};var i=n(2555);const o=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a=await fetch(s.origin+e,{method:"POST",headers:n,body:t}),i=await a.text(),o=new r(a.status,i);if(a.ok)return o;throw o},l=(e,t,n)=>{if(!e||"string"!==typeof e)throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!t||"string"!==typeof t)throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!n||"string"!==typeof n)throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},c=e=>e.webdriver||!e.languages||0===e.languages.length,u=()=>new r(451,"Unavailable For Headless Browser"),d=(e,t)=>{if((e=>{var t;return!(null!==(t=e.list)&&void 0!==t&&t.length)||!e.watchVariable})(e))return!1;((e,t)=>{if(!Array.isArray(e))throw"The BlockList list has to be an array";if("string"!==typeof t)throw"The BlockList watchVariable has to be a string"})(e.list,e.watchVariable);const n=(r=t,s=e.watchVariable,r instanceof FormData?r.get(s):r[s]);var r,s;return"string"===typeof n&&e.list.includes(n)},h=()=>new r(403,"Forbidden"),m=async(e,t,n)=>{if(!t.throttle||!n)return!1;((e,t)=>{if("number"!==typeof e||e<0)throw"The LimitRate throttle has to be a positive number";if(t&&"string"!==typeof t)throw"The LimitRate ID has to be a non-empty string"})(t.throttle,t.id);const r=t.id||e,s=await(async(e,t,n)=>{const r=Number(await n.get(e)||0);return t-Date.now()+r})(r,t.throttle,n);return s>0||(await n.set(r,Date.now().toString()),!1)},p=()=>new r(429,"Too Many Requests"),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://api.emailjs.com";if(!e)return;const n=a(e);s.publicKey=n.publicKey,s.blockHeadless=n.blockHeadless,s.storageProvider=n.storageProvider,s.blockList=n.blockList,s.limitRate=n.limitRate,s.origin=n.origin||t},g=async(e,t,n,r)=>{const f=a(r),g=f.publicKey||s.publicKey,v=f.blockHeadless||s.blockHeadless,y=f.storageProvider||s.storageProvider,b=(0,i.A)((0,i.A)({},s.blockList),f.blockList),x=(0,i.A)((0,i.A)({},s.limitRate),f.limitRate);if(v&&c(navigator))return Promise.reject(u());if(l(g,e,t),(e=>{if(e&&"[object Object]"!==e.toString())throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send
2/"})(n),n&&d(b,n))return Promise.reject(h());if(await m(location.pathname,x,y))return Promise.reject(p());const w={lib_version:"4.4.1",user_id:g,service_id:e,template_id:t,template_params:n};return o("/api/v1.0/email/send",JSON.stringify(w),{"Content-type":"application/json"})},v="service_6nnlhkw",y="template_660cmfs",b="g2ZIKXu5CMAtlW-yr",x="TuneParams AI Learning Platform",w="[email protected]",N="https://www.tuneparams.ai",j=()=>{b&&f(b)},E=async e=>{try{0,j();const t=(e=>{const{userName:t,userEmail:n,courseTitle:r,amount:s,paymentId:a,orderId:i,enrollmentDate:o,paymentMethod:l,payerName:c,payerEmail:u,transactionStatus:d,fundingSource:h}=e;let m="Student";return t&&("string"===typeof t?m=t.split(" ")[0]:"object"===typeof t&&t.given_name?m=t.given_name:"object"===typeof t&&t.firstName&&(m=t.firstName)),{subject:"Welcome to ".concat(r," Your AI learning journey starts now"),htmlContent:'\n        <div style="font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #000000;">\n            <div style="background: linear-gradient(135deg, #1D7E99 0%, #C3C7CA 100%); padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">\n                <h1 style="color: white; margin: 0; font-size: 28px;">Welcome to '.concat(x,'!</h1>\n                <p style="color: #ffffff; margin: 10px 0 0 0; font-size: 16px; opacity: 0.9;">Your AI learning journey starts now</p>\n            </div>\n\n            <div style="background: #000000; padding: 30px; border-radius: 0 0 10px 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); border: 1px solid rgba(29, 126, 153, 0.2);">\n                <p style="font-size: 16px; color: #ffffff; margin-bottom: 20px;">Hi ').concat(m,',</p>\n\n                <p style="font-size: 16px; color: #ffffff; line-height: 1.6;">\n                    Thank you for registering for our AI Training Course \u2014 we\'re excited to have you on board! \ud83d\ude80\n                </p>\n\n                <div style="background: rgba(29, 126, 153, 0.1); padding: 20px; border-radius: 8px; margin: 25px 0; border: 1px solid rgba(29, 126, 153, 0.2);">\n                    <h3 style="color: #ffffff; margin-top: 0;">\ud83d\udccb Enrollment Details</h3>\n                    <table style="width: 100%; border-collapse: collapse;">\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Course:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">').concat(r,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Amount Paid:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">$').concat(s,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Payment Method:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">').concat(l||"PayPal",'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Transaction Status:</td>\n                            <td style="padding: 8px 0; color: #ffffff; text-transform: capitalize;">').concat(d||"Completed",'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Payment ID:</td>\n                            <td style="padding: 8px 0; color: #ffffff; font-family: monospace; font-size: 14px;">').concat(a,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Order ID:</td>\n                            <td style="padding: 8px 0; color: #ffffff; font-family: monospace; font-size: 14px;">').concat(i,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Enrollment Date:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">').concat(o,"</td>\n                        </tr>\n                        ").concat(c&&c!==t?'\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Payer Name:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">'.concat(c,"</td>\n                        </tr>\n                        "):"","\n                        ").concat(u&&u!==n?'\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Payment Email:</td>\n                            <td style="padding: 8px 0; color: #ffffff;">'.concat(u,"</td>\n                        </tr>\n                        "):"","\n                        ").concat(h?'\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold;">Funding Source:</td>\n                            <td style="padding: 8px 0; color: #ffffff; text-transform: capitalize;">'.concat(h,"</td>\n                        </tr>\n                        "):"",'\n                    </table>\n                </div>\n\n                <h3 style="color: #ffffff; margin-top: 30px;">Here\'s what you can expect:</h3>\n                <ul style="color: #ffffff; line-height: 1.8; padding-left: 20px;">\n                    <li><strong>Live lessons</strong> covering machine learning, deep learning, NLP, and large language models (LLMs).</li>\n                    <li><strong>Hands-on coding exercises</strong> and assignments to strengthen your skills.</li>\n                    <li><strong>Projects and labs</strong> that bring AI concepts to life with real-world applications.</li>\n                    <li><strong>A supportive learning community</strong> to ask questions, share progress, and get feedback.</li>\n                </ul>\n\n                <h3 style="color: #ffffff; margin-top: 30px;">Next Steps:</h3>\n                <ul style="color: #ffffff; line-height: 1.8; padding-left: 20px;">\n                    <li>Log in to your account at <a href="').concat(N,'" style="color: #1D7E99; text-decoration: none;">').concat(N,'</a>.</li>\n                    <li>Check out the course schedule and upcoming sessions on our website.</li>\n                </ul>\n\n                <p style="color: #ffffff; line-height: 1.6; margin-top: 25px;">\n                    We\'re thrilled to have you join our community of learners. If you have any questions, feel free to reply to this email or reach out at\n                    <a href="mailto:').concat(w,'" style="color: #1D7E99; text-decoration: none;">').concat(w,'</a>.\n                </p>\n\n                <p style="color: #ffffff; line-height: 1.6; margin-top: 20px;">\n                    Let\'s make your AI journey an exciting and rewarding one!\n                </p>\n\n                <p style="color: #ffffff; margin-top: 30px;">\n                    Best,<br>\n                    <strong>TuneParams Team</strong>\n                </p>\n            </div>\n\n            <div style="text-align: center; padding: 20px; color: #C3C7CA; font-size: 14px; background-color: #000000;">\n                <p>\xa9 2025 ').concat(x,". All rights reserved.</p>\n                <p>This email was sent to ").concat(n," regarding your course enrollment.</p>\n            </div>\n        </div>\n    "),textContent:"\nHi ".concat(m,",\n\nThank you for registering for our AI Training Course \u2014 we're excited to have you on board! \ud83d\ude80\n\nENROLLMENT DETAILS:\n- Course: ").concat(r,"\n- Amount Paid: $").concat(s,"\n- Payment Method: ").concat(l||"PayPal","\n- Transaction Status: ").concat(d||"Completed","\n- Payment ID: ").concat(a,"\n- Order ID: ").concat(i,"\n- Enrollment Date: ").concat(o,"\n").concat(c&&c!==t?"- Payer Name: ".concat(c):"","\n").concat(u&&u!==n?"- Payment Email: ".concat(u):"","\n").concat(h?"- Funding Source: ".concat(h):"","\n\nHere's what you can expect:\n\n\u2022 Live lessons covering machine learning, deep learning, NLP, and large language models (LLMs).\n\n\u2022 Hands-on coding exercises and assignments to strengthen your skills.\n\n\u2022 Projects and labs that bring AI concepts to life with real-world applications.\n\n\u2022 A supportive learning community to ask questions, share progress, and get feedback.\n\nNext Steps:\n\n\u2022 Log in to your account at ").concat(N,".\n\n\u2022 Check out the course schedule and upcoming sessions on our website.\n\nWe're thrilled to have you join our community of learners. If you have any questions, feel free to reply to this email or reach out at ").concat(w,".\n\nLet's make your AI journey an exciting and rewarding one! \ud83c\udf1f\n\nBest,\nTuneParams Team\n\n---\nENROLLMENT DETAILS:\n- Course: ").concat(r,"\n- Amount Paid: $").concat(s,"\n- Payment ID: ").concat(a,"\n- Order ID: ").concat(i,"\n- Enrollment Date: ").concat(o,"\n\nThis email was sent to ").concat(n," regarding your course enrollment.\n\xa9 2025 ").concat(x,". All rights reserved.\n    "),recipientEmail:n,recipientName:t||m}})(e),n={to_email:t.recipientEmail,to_name:t.recipientName,from_name:"".concat(x," Team"),subject:t.subject,html_content:t.htmlContent,text_content:t.textContent,course_title:e.courseTitle,user_name:e.userName,amount:e.amount,payment_id:e.paymentId,order_id:e.orderId,enrollment_date:e.enrollmentDate,website_url:N,support_email:w,payment_method:e.paymentMethod||"PayPal",payer_name:e.payerName||"",payer_email:e.payerEmail||"",transaction_status:e.transactionStatus||"Completed",funding_source:e.fundingSource||""};return{success:!0,messageId:(await g(v,y,n)).text,emailContent:t,rawTextContent:t.textContent}}catch(t){return{success:!1,error:t.message||"Failed to send email"}}},S=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{recordEmailSent:r}=await Promise.resolve().then(n.bind(n,7417));try{j();const n=C(e),a={to_email:n.to_email,to_name:n.to_name,from_name:n.from_name,subject:n.subject,html_content:n.html_content,text_content:n.text_content,coupon_code:n.coupon_code,coupon_name:n.coupon_name,discount_type:n.discount_type,discount_value:n.discount_value,website_url:N,support_email:w,course_id:n.course_id||"",course_title:e.courseTitle||"",recipient_name:n.to_name,sender_name:e.senderName||"",admin_message:e.adminMessage||""},i=await g(v,y,a);try{await r({userId:t,recipientEmail:e.recipientEmail,recipientName:e.recipientName,emailType:"coupon_notification",subject:n.subject,courseId:e.courseId||null,courseTitle:e.courseTitle||null,emailServiceResponse:i,success:!0,rawTextContent:n.text_content,metadata:{couponCode:e.couponCode,couponName:e.couponName,discountType:e.discountType,discountValue:e.discountValue,validUntil:e.validUntil,minOrderAmount:e.minOrderAmount,senderName:e.senderName}})}catch(s){}return{success:!0,response:i,emailId:i.text,emailContent:n,rawTextContent:n.text_content}}catch(a){try{await r({userId:t,recipientEmail:e.recipientEmail,recipientName:e.recipientName,emailType:"coupon_notification",subject:"\ud83c\udfab Your Exclusive Coupon Code: ".concat(e.couponCode),courseId:e.courseId||null,courseTitle:e.courseTitle||null,success:!1,error:a.message||"Failed to send coupon email",metadata:{couponCode:e.couponCode,couponName:e.couponName,discountType:e.discountType,discountValue:e.discountValue}})}catch(s){}return{success:!1,error:a.message||"Failed to send coupon email"}}},C=e=>{const{recipientName:t,recipientEmail:n,couponCode:r,couponName:s,discountType:a,discountValue:i,courseTitle:o,courseId:l,validUntil:c,minOrderAmount:u,adminMessage:d}=e,h="percentage"===a?"".concat(i,"% off"):"$".concat(i," off"),m=c?"Valid until ".concat(new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})):"No expiry date",p=u?"Minimum order amount: $".concat(u):"No minimum order requirement";let f="".concat(N,"/courses"),g="";o&&l?(f="".concat(N,"/courses/").concat(l),g='\n            <div style="background: rgba(29, 126, 153, 0.15); padding: 15px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #1D7E99;">\n                <h4 style="color: #1D7E99; margin: 0 0 8px 0; font-size: 16px;">Course Specific Coupon</h4>\n                <p style="color: #ffffff; margin: 0; font-size: 14px;">This coupon is exclusively for <strong>'.concat(o,"</strong></p>\n            </div>\n        ")):g='\n            <div style="background: rgba(29, 126, 153, 0.15); padding: 15px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #1D7E99;">\n                <h4 style="color: #1D7E99; margin: 0 0 8px 0; font-size: 16px;">General Coupon</h4>\n                <p style="color: #ffffff; margin: 0; font-size: 14px;">This coupon can be used for any of our AI & Machine Learning courses</p>\n            </div>\n        ';const v='\n        <div style="font-family: \'Segoe UI\', Tahoma, Geneva, Verdana, sans-serif; max-width: 600px; margin: 0 auto; padding: 20px; background-color: #000000;">\n            <div style="background: linear-gradient(135deg, #1D7E99 0%, #C3C7CA 100%); padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">\n                <h1 style="color: white; margin: 0; font-size: 28px;">Your Exclusive Coupon</h1>\n                <p style="color: #ffffff; margin: 10px 0 0 0; font-size: 16px; opacity: 0.9;">Special discount for '.concat(x,' courses</p>\n            </div>\n\n            <div style="background: #000000; padding: 30px; border-radius: 0 0 10px 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); border: 1px solid rgba(29, 126, 153, 0.2);">\n                <p style="font-size: 16px; color: #ffffff; margin-bottom: 20px;">Dear ').concat(t||"Student",',</p>\n\n                <p style="font-size: 16px; color: #ffffff; line-height: 1.6;">\n                    Here is your exclusive coupon code for ').concat(x,"! Get ready to advance your AI and machine learning skills at a special discounted price.\n                </p>\n\n                ").concat(g,'\n\n                <div style="background: rgba(29, 126, 153, 0.1); padding: 25px; border-radius: 8px; margin: 25px 0; border: 1px solid rgba(29, 126, 153, 0.2); text-align: center;">\n                    <h3 style="color: #ffffff; margin-top: 0; margin-bottom: 20px;">Your Coupon Details</h3>\n                    \n                    <div style="background: rgba(255, 255, 255, 0.1); padding: 15px; border-radius: 6px; margin: 15px 0;
2 border: 2px dashed #1D7E99;">\n                        <div style="font-family: monospace; font-size: 24px; font-weight: bold; color: #1D7E99; letter-spacing: 2px; text-align: center;">\n                            ').concat(r,'\n                        </div>\n                    </div>\n                    \n                    <table style="width: 100%; border-collapse: collapse; margin-top: 20px;">\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold; text-align: left;">Coupon Name:</td>\n                            <td style="padding: 8px 0; color: #ffffff; text-align: right;">').concat(s||"Special Discount",'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold; text-align: left;">Discount:</td>\n                            <td style="padding: 8px 0; color: #00ff88; font-weight: bold; text-align: right; font-size: 18px;">').concat(h,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold; text-align: left;">Valid Until:</td>\n                            <td style="padding: 8px 0; color: #ffffff; text-align: right;">').concat(m,'</td>\n                        </tr>\n                        <tr>\n                            <td style="padding: 8px 0; color: #C3C7CA; font-weight: bold; text-align: left;">Minimum Order:</td>\n                            <td style="padding: 8px 0; color: #ffffff; text-align: right;">').concat(p,"</td>\n                        </tr>\n                    </table>\n                </div>\n\n                ").concat(d?'\n                <div style="background: rgba(255, 215, 0, 0.1); padding: 20px; border-radius: 8px; margin: 25px 0; border-left: 4px solid #FFD700;">\n                    <h4 style="color: #FFD700; margin: 0 0 10px 0; font-size: 16px;">Personal Message</h4>\n                    <p style="color: #ffffff; margin: 0; font-style: italic; line-height: 1.5;">"'.concat(d,'"</p>\n                </div>\n                '):"",'\n\n                <h3 style="color: #ffffff; margin-top: 30px;">How to Redeem Your Coupon:</h3>\n                <ol style="color: #ffffff; line-height: 1.8; padding-left: 20px;">\n                    <li>Visit ').concat(o&&l?"the course page":"our courses",': <a href="').concat(f,'" style="color: #1D7E99; text-decoration: none;">').concat(f,'</a></li>\n                    <li>Click <strong>"Enroll Now"</strong> ').concat(o&&l?"":"on your chosen course",'</li>\n                    <li>At checkout, look for <strong>"Have a coupon code?"</strong> section</li>\n                    <li>Enter your coupon code: <strong>').concat(r,'</strong></li>\n                    <li>Click <strong>"Apply"</strong> to see your discount applied instantly</li>\n                    <li>Complete payment with your discounted price</li>\n                    <li>Start learning immediately after enrollment!</li>\n                </ol>\n\n                <h3 style="color: #ffffff; margin-top: 30px;">Why Choose TuneParams.ai?</h3>\n                <ul style="color: #ffffff; line-height: 1.8; padding-left: 20px;">\n                    <li><strong>Expert-led courses</strong> by industry professionals</li>\n                    <li><strong>Hands-on projects</strong> and real-world applications</li>\n                    <li><strong>Small batch sizes</strong> for personalized attention</li>\n                    <li><strong>Comprehensive curriculum</strong> from foundations to advanced topics</li>\n                    <li><strong>Career support</strong> and networking opportunities</li>\n                </ul>\n\n                <div style="text-align: center; margin: 30px 0;">\n                    <a href="').concat(f,'" style="display: inline-block; background: linear-gradient(135deg, #1D7E99 0%, #C3C7CA 100%); color: white; padding: 15px 30px; text-decoration: none; border-radius: 8px; font-weight: bold; font-size: 16px;">\n                        ').concat(o&&l?"Enroll in ".concat(o," Now \u2192"):"Browse All Courses \u2192",'\n                    </a>\n                </div>\n\n                <p style="color: #ffffff; line-height: 1.6; margin-top: 25px;">\n                    If you have any questions or need help redeeming your coupon, feel free to reach out to us at\n                    <a href="mailto:').concat(w,'" style="color: #1D7E99; text-decoration: none;">').concat(w,'</a>.\n                </p>\n\n                <p style="color: #ffffff; line-height: 1.6; margin-top: 20px;">\n                    We\'re excited to have you join our community of AI learners!\n                </p>\n\n                <p style="color: #ffffff; margin-top: 30px;">\n                    Best regards,<br>\n                    <strong>The ').concat(x,' Team</strong>\n                </p>\n            </div>\n\n            <div style="text-align: center; padding: 20px; color: #C3C7CA; font-size: 14px; background-color: #000000;">\n                <p style="margin: 0 0 10px 0;">\n                    <strong>Important:</strong> This coupon code is unique to you - please don\'t share it\n                </p>\n                <p style="margin: 0 0 15px 0;">\xa9 2025 ').concat(x,'. All rights reserved.</p>\n                <p style="margin: 0; font-size: 12px;">\n                    Follow us: \n                    <a href="').concat(N,'" style="color: #1D7E99; text-decoration: none;">Website</a> | \n                    <a href="https://linkedin.com/company/tuneparams-ai" style="color: #1D7E99; text-decoration: none;">LinkedIn</a> | \n                    <a href="https://twitter.com/tuneparamsai" style="color: #1D7E99; text-decoration: none;">Twitter</a>\n                </p>\n            </div>\n        </div>\n    '),y="\nYour Exclusive Coupon Code: ".concat(r,"\n\nDear ").concat(t||"Student",",\n\nHere is your exclusive coupon code for ").concat(x,"!\n\nCOUPON DETAILS:\n- Code: ").concat(r,"\n- Discount: ").concat(h,"\n- Name: ").concat(s||"Special Discount","\n- Validity: ").concat(m,"\n- ").concat(p,"\n\n").concat(o?"This coupon is for: ".concat(o):"This coupon can be used for any course","\n\nHOW TO REDEEM:\n1. Visit: ").concat(f,'\n2. Select your course and click "Enroll Now"\n3. At 
2checkout, enter coupon code: ').concat(r,'\n4. Click "Apply" to see your discount\n5. Complete payment and start learning!\n\n').concat(d?'Personal Message: "'.concat(d,'"'):"","\n\nNeed help? Email us at ").concat(w,"\n\nBest regards,\nThe ").concat(x," Team\n").concat(N,"\n    ");let b;return b=o&&l?"percentage"===a&&100===i?"Free Access: ".concat(o," - Use Code ").concat(r):"percentage"===a?"".concat(i,"% Off ").concat(o," - Code ").concat(r):"$".concat(i," Off ").concat(o," - Code ").concat(r):"percentage"===a&&100===i?"Free Course Access - Your Code: ".concat(r):"percentage"===a?"".concat(i,"% Off TuneParams.ai Courses - Code ").concat(r):"$".concat(i," Off AI Courses - Code ").concat(r),{to_email:n,to_name:t||"Student",from_name:x,reply_to:w,subject:b,html_content:v,text_content:y,email_type:"coupon_notification",coupon_code:r,coupon_name:s,discount_type:a,discount_value:i,course_id:l,timestamp:(new Date).toISOString()}}},9588:()=>{},9651:()=>{},9772:(e,t,n)=>{n.a(e,async(e,r)=>{try{n.d(t,{A:()=>g});var s=n(5043),a=n(4366),i=n(5472),o=n(8426),l=n(5491),c=n(7324),u=n(342),d=n(5511),h=n(4879),m=n(9866),p=(n(2738),n(579)),f=e([l,d]);[l,d]=f.then?(await f)():f;const g=()=>{var e,t;const{courseId:n}=(0,a.g)(),{user:r,loading:f}=(0,u.A)(),{hasAccess:g,enrollment:v,loading:y}=(0,d.x)(n),{isAdminUser:b,loading:x}=(0,h.h)(),[w,N]=(0,s.useState)(null),[j,E]=(0,s.useState)([]),[S,C]=(0,s.useState)(null),[k,_]=(0,s.useState)(!0),[A,T]=(0,s.useState)({});if((0,s.useEffect)(()=>{(async()=>{try{_(!0);const e=await(0,l.BZ)(n);if(e){N(e);const t=await(0,c.getCourseBatches)(n);if(E(t),!x&&!y&&!f&&t.length>0)if(b){const e=await(0,l.Wq)(n),r=await(0,l.rU)(n);C(e||r[0]||t[0])}else if(v){const e=t.find(e=>e.batchNumber===v.batchNumber);C(e||t[0])}else{const e=await(0,l.Wq)(n),r=await(0,l.rU)(n);C(e||r[0]||t[0])}}}catch(e){console.error("Error loading course data:",e)}finally{_(!1)}})()},[n,v,b,x,y,f]),(0,s.useEffect)(()=>{(async()=>{if(w&&0!==j.length)try{const e=(0,i.P)((0,i.rJ)(o.db,"enrollments"),(0,i._M)("courseId","==",n)),t=(await(0,i.GG)(e)).docs.map(e=>e.data()),r={};j.forEach(e=>{const n=t.filter(t=>t.batchNumber===e.batchNumber||parseInt(t.batchNumber)===parseInt(e.batchNumber)||String(t.batchNumber)===String(e.batchNumber));r[e.batchNumber]=n.length});const s=t.filter(e=>!e.batchNumber);s.length>0&&(r.legacy=s.length),T(r)}catch(e){console.error("Failed to load enrollment counts:",e)}})()},[w,j,n]),k||y||x||f)return(0,p.jsx)("div",{className:"course-dashboard-container",children:(0,p.jsxs)("div",{className:"loading-state",children:[(0,p.jsx)("div",{className:"loading-spinner"}),(0,p.jsx)("h2",{children:"Loading dashboard..."}),(0,p.jsx)("p",{children:"Please wait while we verify your access..."})]})});if(!f&&!r)return(0,p.jsx)(a.C5,{to:"/login",replace:!0});if(!f&&r&&y)return(0,p.jsx)("div",{className:"course-dashboard-container",children:(0,p.jsxs)("div",{className:"loading-state",children:[(0,p.jsx)("div",{className:"loading-spinner"}),(0,p.jsx)("h2",{children:"Verifying enrollment..."}),(0,p.jsx)("p",{children:"Checking your course access..."})]})});if(!f&&!x&&!y&&r&&!(b||r&&g))return(0,p.jsx)("div",{className:"course-dashboard-container",children:(0,p.jsxs)("div",{className:"access-denied",children:[(0,p.jsx)("h2",{children:"Access Denied"}),(0,p.jsx)("p",{children:"You need to be enrolled in this course to access the dashboard."}),(0,p.jsx)(a.N_,{to:"/course/".concat(n),className:"back-to-course-btn",children:"View Course Details"})]})});if(!w)return(0,p.jsx)("div",{className:"course-dashboard-container",children:(0,p.jsxs)("div",{className:"error-state",children:[(0,p.jsx)("h2",{children:"Course not found"}),(0,p.jsx)(a.N_,{to:"/courses",className:"back-to-courses-btn",children:"Back to Courses"})]})});const I=e=>{if(!e.date||!e.time)return"TBD";const[t,n,r]=e.date.split("-").map(Number),[s,a]=e.time.split(":").map(Number),i=new Date(t,n-1,r,s,a,0,0),o=i.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"short",day:"numeric"}),l=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),c=e.timezone?" (".concat(e.timezone,")"):"",u=e.duration?" \u2022 ".concat(e.duration," mins"):"";return"".concat(o," at ").concat(l).concat(c).concat(u)},P=e=>(0,p.jsx)("span",{className:"status-badge ".concat({upcoming:"bg-blue-100 text-blue-800",active:"bg-green-100 text-green-800",completed:"bg-gray-100 text-gray-800"}[e.status]),children:{upcoming:"Starting Soon",active:"In Progress",completed:"Completed"}[e.status]}),R=e=>{switch(e){case"live":return(0,p.jsxs)("span",{className:"live-badge",children:[(0,p.jsx)("span",{className:"live-indicator"}),"LIVE"]});case"scheduled":return(0,p.jsx)("span",{className:"scheduled-badge",children:"SCHEDULED"});case"completed":return(0,p.jsx)("span",{className:"completed-badge",children:"COMPLETED"});default:return null}};return k?(0,p.jsx)("div",{className:"course-dashboard",children:(0,p.jsx)("div",{className:"loading-container",children:(0,p.jsx)("div",{className:"loading-spinner",children:"Loading course dashboard..."})})}):w?j&&0!==j.length?(0,p.jsx)("div",{className:"course-dashboard",children:(0,p.jsxs)("div",{className:"dashboard-container",children:[(0,p.jsxs)("div",{className:"course-header",children:[(0,p.jsxs)("div",{className:"course-info",children:[(0,p.jsxs)("h1",{children:[w.title," Dashboard"]}),(0,p.jsx)("p",{className:"course-description",children:w.description})]}),(0,p.jsxs)("div",{className:"navigation-links",children:[(0,p.jsx)(a.N_,{to:"/courses",className:"back-link",children:"\u2190 Back to Courses"}),(0,p.jsx)(a.N_,{to:"/courses/".concat(n),className:"course-detail-link",children:"Course Details"})]})]}),b&&(0,p.jsxs)("div",{className:"batch-selector",children:[(0,p.jsx)("h2",{children:"Select Batch"}),(0,p.jsx)("div",{className:"batch-tabs",children:j.map(e=>(0,p.jsxs)("button",{className:"batch-tab ".concat((null===S||void 0===S?void 0:S.batchNumber)===e.batchNumber?"active":""),onClick:()=>C(e),children:[(0,p.jsx)("span",{className:"batch-name",children:(0,l.up)(e)}),(0,p.jsx)("span",{className:"batch-dates",children:(0,l.hT)(e)}),(0,p.jsxs)("span",{className:"batch-capacity",style:{fontSize:"12px",color:"var(--secondary-text-color)",background:"rgba(29, 126, 153, 0.1)",padding:"2px 6px",borderRadius:"4px",margin:"2px 0"},children:[A[e.batchNumber]||0," / ",e.maxCapacity," enrolled"]}),P(e)]},e.batchNumber))})]}),S&&(0,p.jsxs)("div",{className:"dashboard-content",children:[(0,p.jsxs)("div",{className:"quick-access-section",children:[(0,p.jsx)("h2",{children:"Qu
2ick Access"}),(0,p.jsxs)("div",{className:"quick-access-grid",children:[(0,p.jsxs)("div",{className:"access-card zoom-card",children:[(0,p.jsx)("div",{className:"card-icon",children:"\ud83d\udcf9"}),(0,p.jsx)("h3",{children:"Zoom Classroom"}),null!==(e=S.classLinks)&&void 0!==e&&e.zoom?(0,p.jsx)("a",{href:S.classLinks.zoom,target:"_blank",rel:"noopener noreferrer",className:"access-link",children:"Join Class"}):(0,p.jsx)("span",{className:"link-unavailable",children:"Link will be shared soon"})]}),(0,p.jsxs)("div",{className:"access-card discord-card",children:[(0,p.jsx)("div",{className:"card-icon",children:"\ud83d\udcac"}),(0,p.jsx)("h3",{children:"Discord Community"}),null!==(t=S.classLinks)&&void 0!==t&&t.discord?(0,p.jsx)("a",{href:S.classLinks.discord,target:"_blank",rel:"noopener noreferrer",className:"access-link",children:"Join Discussion"}):(0,p.jsx)("span",{className:"link-unavailable",children:"Link will be shared soon"})]})]})]}),(0,p.jsx)(m.A,{batch:S}),(0,p.jsxs)("div",{className:"schedule-section",children:[(0,p.jsx)("h2",{children:"Class Schedule"}),(0,l.kw)(S)?(0,p.jsx)("div",{className:"schedule-list",children:S.schedule.map((e,t)=>{const n=(e=>{if(!e.date||!e.time)return"scheduled";const t=new Date,[n,r,s]=e.date.split("-").map(Number),[a,i]=e.time.split(":").map(Number),o=new Date(n,r-1,s,a,i,0,0),l=e.duration||90,c=(t-new Date(o.getTime()+60*l*1e3))/6e4;return(t-o)/6e4>=-30&&c<=0?"live":c>0?"completed":"scheduled"})(e);return(0,p.jsxs)("div",{className:"schedule-card ".concat("live"===n?"live-class":"completed"===n?"completed-class":"scheduled-class"),children:[(0,p.jsxs)("div",{className:"schedule-header",children:[(0,p.jsxs)("div",{className:"date-time-info",children:[(0,p.jsx)("h3",{children:e.topic||"Topic TBD"}),(0,p.jsx)("p",{className:"date-time",children:I(e)})]}),R(n)]}),(0,p.jsx)("div",{className:"schedule-content",children:"live"===n&&(0,l.eN)(S)&&(0,p.jsx)("a",{href:(0,l.VQ)(S).zoom||S.classLinks.zoom,target:"_blank",rel:"noopener noreferrer",className:"join-now-btn",children:"Join Class"})})]},t)})}):(0,p.jsxs)("div",{className:"no-schedule",children:[(0,p.jsx)("div",{className:"no-schedule-icon",children:"\ud83d\udcc5"}),"completed"===S.status?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("h3",{children:"No Schedule Available"}),(0,p.jsx)("p",{children:"This batch has been completed. Schedule is no longer available."})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("h3",{children:"Schedule Coming Soon"}),(0,p.jsx)("p",{children:"The class schedule for this batch will be announced soon. Stay tuned!"})]})]})]}),b&&(0,p.jsxs)("div",{className:"batch-info-section",children:[(0,p.jsx)("h2",{children:"Batch Information"}),(0,p.jsxs)("div",{className:"batch-info-grid",children:[(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("h4",{children:"Batch Name"}),(0,p.jsx)("p",{children:(0,l.up)(S)})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("h4",{children:"Duration"}),(0,p.jsx)("p",{children:(0,l.hT)(S)})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("h4",{children:"Status"}),(0,p.jsx)("p",{children:P(S)})]}),(0,p.jsxs)("div",{className:"info-card",children:[(0,p.jsx)("h4",{children:"Capacity"}),(0,p.jsxs)("p",{children:[A[null===S||void 0===S?void 0:S.batchNumber]||0," / ",S.maxCapacity," students"]})]})]})]})]})]})}):(0,p.jsx)("div",{className:"course-dashboard",children:(0,p.jsx)("div",{className:"dashboard-container",children:(0,p.jsxs)("div",{className:"course-header",children:[(0,p.jsx)("h1",{children:w.title}),(0,p.jsx)("p",{children:"No batches available for this course yet."}),(0,p.jsx)(a.N_,{to:"/courses",className:"back-link",children:"Back to Courses"})]})})}):(0,p.jsx)("div",{className:"course-dashboard",children:(0,p.jsxs)("div",{className:"error-container",children:[(0,p.jsx)("h1",{children:"Course Not Found"}),(0,p.jsx)("p",{children:"The course you're looking for doesn't exist."}),(0,p.jsx)(a.N_,{to:"/courses",className:"back-link",children:"Back to Courses"})]})})};r()}catch(g){r(g)}})},9864:()=>{},9866:(e,t,n)=>{n.d(t,{A:()=>s});n(5043);var r=n(579);const s=e=>{var t,n;let{batch:s}=e;return null!==s&&void 0!==s&&null!==(t=s.driveLinks)&&void 0!==t&&t.videosFolder||null!==s&&void 0!==s&&null!==(n=s.driveLinks)&&void 0!==n&&n.materialsFolder?(0,r.jsxs)("div",{className:"drive-access",children:[(0,r.jsxs)("div",{className:"drive-access-header",children:[(0,r.jsx)("h2",{children:"\ud83d\udcc1 Course Resources"}),(0,r.jsx)("p",{children:"Access all your course content through Google Drive folders"})]}),(0,r.jsxs)("div",{className:"drive-access-grid",children:[(0,r.jsxs)("div",{className:"drive-card",children:[(0,r.jsx)("div",{className:"drive-card-icon",children:"\ud83c\udfa5"}),(0,r.jsx)("h3",{children:"Class Recordings"}),(0,r.jsx)("p",{children:"All video recordings from live sessions"}),s.driveLinks.videosFolder?(0,r.jsx)("a",{href:s.driveLinks.videosFolder,target:"_blank",rel:"noopener noreferrer",className:"drive-access-button videos",children:(0,r.jsx)("span",{children:"Open Videos Folder"})}):(0,r.jsx)("span",{className:"unavailable-text",children:"Videos will be available after classes"})]}),(0,r.jsxs)("div",{className:"drive-card",children:[(0,r.jsx)("div",{className:"drive-card-icon",children:"\ud83d\udcda"}),(0,r.jsx)("h3",{children:"Course Materials"}),(0,r.jsx)("p",{children:"PDFs, slides, code files, and additional resources"}),s.driveLinks.materialsFolder?(0,r.jsx)("a",{href:s.driveLinks.materialsFolder,target:"_blank",rel:"noopener noreferrer",className:"drive-access-button materials",children:(0,r.jsx)("span",{children:"Open Materials Folder"})}):(0,r.jsx)("span",{className:"unavailable-text",children:"Materials will be available soon"})]})]}),(0,r.jsxs)("div",{className:"drive-instructions",children:[(0,r.jsx)("h4",{children:"\ud83d\udccb How to Access Your Files"}),(0,r.jsxs)("div",{className:"instructions-grid",children:[(0,r.jsxs)("div",{className:"instruction-item",children:[(0,r.jsx)("span",{className:"instruction-number",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:"Use the same email for access"}),(0,r.jsx)("p",{children:"Make sure you're logged into Google Drive with the same email you used to register for this course"})]})]}),(0,r.jsxs)("div",{className:"instruction-item",children:[(0,r.jsx)("span",{className:"instruction-number",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:"Notebooks and datasets"}),(0,r.jsx)("p",{children:"You can download Python notebooks, datasets, and assignment files needed for your coursework"})]})]}),(0,r.jsxs)("div",{className:"instruction-item",children:[(0,r.jsx)("span",{className:"instruction-number",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("strong",{children:"Check back for updates"}),(0,r.jsx)("p",{children:"New videos and materials are added regularly"})]})]})]})]})]}):(0,r.jsxs)("div",{className:"drive-access",children:[(0,r.jsxs)("div",{className:"drive-access-header",children:[(0,r.jsx)("h2",{children:"\ud83d\udcc1 Course Resources"}),(0,r.jsx)("p",{children:"Access your videos and materials through Google Drive"})]}),(0,r.jsxs)("div",{className:"drive-access-grid",children:[(0,r.jsxs)("div",{className:"drive-card unavailable",children:[(0,r.jsx)("div",{className:"drive-card-icon",children:"\ud83c\udfa5"}),(0,r.jsx)("h3",{children:"Class Recordings"}),(0,r.jsx)("p",{children:"Video recordings will be available after class sessions"}),(0,r.jsx)("span",{className:"unavailable-text",children:"Coming Soon"})]}),(0,r.jsxs)("div",{className:"drive-card unavailable",children:[(0,r.jsx)("div",{className:"drive-card-icon",children:"\ud83d\udcda"}),(0,r.jsx)("h3",{children:"Course Materials"}),(0,r.jsx)("p",{children:"PDFs, slides, and additional resources"}),(0,r.jsx)("span",{className:"unavailable-text",children:"Coming Soon"})]})]})]})}}},t={};function n(r){var s=t[r];
2if(void 0!==s)return s.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}(()=>{var e="function"===typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",t="function"===typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",r="function"===typeof Symbol?Symbol("webpack error"):"__webpack_error__",s=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))};n.a=(n,a,i)=>{var o;i&&((o=[]).d=-1);var l,c,u,d=new Set,h=n.exports,m=new Promise((e,t)=>{u=t,c=e});m[t]=h,m[e]=e=>(o&&e(o),d.forEach(e),m.catch(e=>{})),n.exports=m,a(n=>{var a;l=(n=>n.map(n=>{if(null!==n&&"object"===typeof n){if(n[e])return n;if(n.then){var a=[];a.d=0,n.then(e=>{i[t]=e,s(a)},e=>{i[r]=e,s(a)});var i={};return i[e]=e=>e(a),i}}var o={};return o[e]=e=>{},o[t]=n,o}))(n);var i=()=>l.map(e=>{if(e[r])throw e[r];return e[t]}),c=new Promise(t=>{(a=()=>t(i)).r=0;var n=e=>e!==o&&!d.has(e)&&(d.add(e),e&&!e.d&&(a.r++,e.push(a)));l.map(t=>t[e](n))});return a.r?c:i()},e=>(e?u(m[r]=e):c(h),s(o))),o&&o.d<0&&(o.d=0)}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.p="/";n(2812)})();
3//# sourceMappingURL=main.3c5d8f99.js.map

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.