1import{r as C,a as Ta,L as ce,g as Ea,c as be,u as $e,b as Aa,R as jr,d as Zs,N as $a,e as Oa,B as Ia,f as Da,h as se}from"./vendor-Dmwew988.js";import{f as Ma,d as c}from"./style-DSC5lam1.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(s){if(s.ep)return;s.ep=!0;const o=t(s);fetch(s.href,o)}})();var eo={exports:{}},_r={};/** 2 * @license React 3 * react-jsx-runtime.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Ra=C,Na=Symbol.for("react.element"),Fa=Symbol.for("react.fragment"),La=Object.prototype.hasOwnProperty,za=Ra.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ua={key:!0,ref:!0,__self:!0,__source:!0};function to(r,e,t){var i,s={},o=null,a=null;t!==void 0&&(o=""+t),e.key!==void 0&&(o=""+e.key),e.ref!==void 0&&(a=e.ref);for(i in e)La.call(e,i)&&!Ua.hasOwnProperty(i)&&(s[i]=e[i]);if(r&&r.defaultProps)for(i in e=r.defaultProps,e)s[i]===void 0&&(s[i]=e[i]);return{$$typeof:Na,type:r,key:o,ref:a,props:s,_owner:za.current}}_r.Fragment=Fa;_r.jsx=to;_r.jsxs=to;eo.exports=_r;var n=eo.exports,Dn={},Pi=Ta;Dn.createRoot=Pi.createRoot,Dn.hydrateRoot=Pi.hydrateRoot;const Ba=Ma` 10 * { 11 margin: 0; 12 padding: 0; 13 box-sizing: border-box; 14 } 15 16 :root { 17 --primary-color: #FF6B4A; 18 --text-color: #ffffff; 19 --text-secondary: #888888; 20 --bg-color: #000000; 21 } 22 23 body { 24 font-family: 'Inter', sans-serif; 25 background-color: var(--bg-color); 26 color: var(--text-color); 27 line-height: 1.5; 28 } 29 30 h1, h2, h3, h4, h5, h6 { 31 font-weight: 700; 32 text-transform: uppercase; 33 } 34 35 button { 36 cursor: pointer; 37 border: none; 38 background: none; 39 font-family: inherit; 40 } 41 42 a { 43 text-decoration: none; 44 color: inherit; 45 } 46 47 img { 48 max-width: 100%; 49 height: auto; 50 } 51`,qa=c(ce)` 52 display: flex; 53 align-items: center; 54 gap: 0.5rem; 55 text-decoration: none; 56 padding: 0.5rem; 57 58 @media (max-width: 768px) { 59 padding: 0.25rem; 60 } 61`,Wa=c.img` 62 height: 48px; 63 width: auto; 64 transition: height 0.3s ease; 65 66 @media (max-width: 768px) { 67 height: 36px; 68 } 69 70 @media (max-width: 480px) { 71 height: 32px; 72 } 73`,Ha=()=>n.jsx(qa,{to:"/",children:n.jsx(Wa,{src:"/images/MM-Logo-white.png",alt:"Media Mill"})}),Va="modulepreload",Ga=function(r){return"/"+r},Ti={},vt=function(e,t,i){let s=Promise.resolve();return t&&t.length>0&&(document.getElementsByTagName("link"),s=Promise.all(t.map(o=>{if(o=Ga(o),o in Ti)return;Ti[o]=!0;const a=o.endsWith(".css"),l=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${l}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":Va,a||(d.as="script",d.crossOrigin=""),d.href=o,document.head.appendChild(d),a)return new Promise((h,u)=>{d.addEventListener("load",h),d.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})}))),s.then(()=>e()).catch(o=>{const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o})},Ya=r=>{let e;return r?e=r:typeof fetch>"u"?e=(...t)=>vt(()=>Promise.resolve().then(()=>jt),void 0).then(({default:i})=>i(...t)):e=fetch,(...t)=>e(...t)};class di extends Error{constructor(e,t="FunctionsError",i){super(e),this.name=t,this.context=i}}class Ja extends di{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Ka extends di{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Xa extends di{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Mn;(function(r){r.Any="any",r.ApNortheast1="ap-northeast-1",r.ApNortheast2="ap-northeast-2",r.ApSouth1="ap-south-1",r.ApSoutheast1="ap-southeast-1",r.ApSoutheast2="ap-southeast-2",r.CaCentral1="ca-central-1",r.EuCentral1="eu-central-1",r.EuWest1="eu-west-1",r.EuWest2="eu-west-2",r.EuWest3="eu-west-3",r.SaEast1="sa-east-1",r.UsEast1="us-east-1",r.UsWest1="us-west-1",r.UsWest2="us-west-2"})(Mn||(Mn={}));var Qa=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};class Za{constructor(e,{headers:t={},customFetch:i,region:s=Mn.Any}={}){this.url=e,this.headers=t,this.region=s,this.fetch=Ya(i)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var i;return Qa(this,void 0,void 0,function*(){try{const{headers:s,method:o,body:a}=t;let l={},{region:d}=t;d||(d=this.region),d&&d!=="any"&&(l["x-region"]=d);let h;a&&(s&&!Object.prototype.hasOwnProperty.call(s,"Content-Type")||!s)&&(typeof Blob<"u"&&a
73instanceof Blob||a instanceof ArrayBuffer?(l["Content-Type"]="application/octet-stream",h=a):typeof a=="string"?(l["Content-Type"]="text/plain",h=a):typeof FormData<"u"&&a instanceof FormData?h=a:(l["Content-Type"]="application/json",h=JSON.stringify(a)));const u=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},l),this.headers),s),body:h}).catch(v=>{throw new Ja(v)}),m=u.headers.get("x-relay-error");if(m&&m==="true")throw new Ka(u);if(!u.ok)throw new Xa(u);let x=((i=u.headers.get("Content-Type"))!==null&&i!==void 0?i:"text/plain").split(";")[0].trim(),g;return x==="application/json"?g=yield u.json():x==="application/octet-stream"?g=yield u.blob():x==="text/event-stream"?g=u:x==="multipart/form-data"?g=yield u.formData():g=yield u.text(),{data:g,error:null}}catch(s){return{data:null,error:s}}})}}var pe={},ui={},kr={},Vt={},Sr={},Cr={},el=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")},yt=el();const tl=yt.fetch,ro=yt.fetch.bind(yt),no=yt.Headers,rl=yt.Request,nl=yt.Response,jt=Object.freeze(Object.defineProperty({__proto__:null,Headers:no,Request:rl,Response:nl,default:ro,fetch:tl},Symbol.toStringTag,{value:"Module"})),il=Ea(jt);var Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});let sl=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.co
73de=e.code}};Pr.default=sl;var io=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Cr,"__esModule",{value:!0});const ol=io(il),al=io(Pr);let ll=class{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=ol.default:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=Object.assign({},this.headers),this.headers[e]=t,this}then(e,t){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const i=this.fetch;let s=i(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{var a,l,d;let h=null,u=null,m=null,x=o.status,g=o.statusText;if(o.ok){if(this.method!=="HEAD"){const S=await o.text();S===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?u=S:u=JSON.parse(S))}const b=(a=this.headers.Prefer)===null||a===void 0?void 0:a.match(/count=(exact|planned|estimated)/),y=(l=o.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");b&&y&&y.length>1&&(m=parseInt(y[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(u)&&(u.length>1?(h={code:"PGRST116",details:`Results contain ${u.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},u=null,m=null,x=406,g="Not Acceptable"):u.length===1?u=u[0]:u=null)}else{const b=await o.text();try{h=JSON.parse(b),Array.isArray(h)&&o.status===404&&(u=[],h=null,x=200,g="OK")}catch{o.status===404&&b===""?(x=204,g="No Content"):h={message:b}}if(h&&this.isMaybeSingle&&(!((d=h==null?void 0:h.details)===null||d===void 0)&&d.includes("0 rows"))&&(h=null,x=200,g="OK"),h&&this.shouldThrowOnError)throw new al.default(h)}return{error:h,data:u,count:m,status:x,statusText:g}});return this.shouldThrowOnError||(s=s.catch(o=>{var a,l,d;return{error:{message:`${(a=o==null?void 0:o.name)!==null&&a!==void 0?a:"FetchError"}: ${o==null?void 0:o.message}`,details:`${(l=o==null?void 0:o.stack)!==null&&l!==void 0?l:""}`,hint:"",code:`${(d=o==null?void 0:o.code)!==null&&d!==void 0?d:""}`},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}};Cr.default=ll;var cl=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};
vendor: 4,830 bytes, line 73
73Object.defineProperty(Sr,"__esModule",{value:!0});const dl=cl(Cr);let ul=class extends dl.default{select(e){let t=!1;const i=(e??"*").split("").map(s=>/\s/.test(s)&&!t?"":(s==='"'&&(t=!t),s)).join("");return this.url.searchParams.set("select",i),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:i,foreignTable:s,referencedTable:o=s}={}){const a=o?`${o}.order`:"order",l=this.url.searchParams.get(a);return this.url.searchParams.set(a,`${l?`${l},`:""}${e}.${t?"asc":"desc"}${i===void 0?"":i?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:i=t}={}){const s=typeof i>"u"?"limit":`${i}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:i,referencedTable:s=i}={}){const o=typeof s>"u"?"offset":`${s}.offset`,a=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(o,`${e}`),this.url.searchParams.set(a,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:i=!1,buffers:s=!1,wal:o=!1,format:a="text"}={}){var l;const d=[e?"analyze":null,t?"verbose":null,i?"settings":null,s?"buffers":null,o?"wal":null].filter(Boolean).join("|"),h=(l=this.headers.Accept)!==null&&l!==void 0?l:"application/json";return this.headers.Accept=`application/vnd.pgrst.plan+${a}; for="${h}"; options=${d};`,a==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}};Sr.default=ul;var hl=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vt,"__esModule",{value:!0});const ml=hl(Sr);let fl=class extends ml.default{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const i=Array.from(new Set(t)).map(s=>typeof s=="string"&&new RegExp("[,()]").test(s)?`"${s}"`:`${s}`).join(",");return this.url.searchParams.append(e,`in.(${i})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:i,type:s}={}){let o="";s==="plain"?o="pl":s==="phrase"?o="ph":s==="websearch"&&(o="w");const a=i===void 0?"":`(${i})`;return this.url.searchParams.append(e,`${o}fts${a}.${t}`),this}match(e){return Object.entries(e).forEach(([t,i])=>{this.url.searchParams.append(t,`eq.${i}`)}),this}not(e,t,i){return this.url.searchParams.append(e,`not.${t}.${i}`),this}or(e,{foreignTable:t,referencedTable:i=t}={}){const s=i?`${i}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,i){return this.url.searchParams.append(e,`${t}.${i}`),this}};Vt.default=fl;var pl=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};
73Object.defineProperty(kr,"__esModule",{value:!0});const St=pl(Vt);let gl=class{constructor(e,{headers:t={},schema:i,fetch:s}){this.url=e,this.headers=t,this.schema=i,this.fetch=s}select(e,{head:t=!1,count:i}={}){const s=t?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(l=>/\s/.test(l)&&!o?"":(l==='"'&&(o=!o),l)).join("");return this.url.searchParams.set("select",a),i&&(this.headers.Prefer=`count=${i}`),new St.default({method:s,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:i=!0}={}){const s="POST",o=[];if(this.headers.Prefer&&o.push(this.headers.Prefer),t&&o.push(`count=${t}`),i||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){const a=e.reduce((l,d)=>l.concat(Object.keys(d)),[]);if(a.length>0){const l=[...new Set(a)].map(d=>`"${d}"`);this.url.searchParams.set("columns",l.join(","))}}return new St.default({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:i=!1,count:s,defaultToNull:o=!0}={}){const a="POST",l=[`resolution=${i?"ignore":"merge"}-duplicates`];if(t!==void 0&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&l.push(this.headers.Prefer),s&&l.push(`count=${s}`),o||l.push("missing=default"),this.headers.Prefer=l.join(","),Array.isArray(e)){const d=e.reduce((h,u)=>h.concat(Object.keys(u)),[]);if(d.length>0){const h=[...new Set(d)].map(u=>`"${u}"`);this.url.searchParams.set("columns",h.join(","))}}return new St.default({method:a,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const i="PATCH",s=[];return this.headers.Prefer&&s.push(this.headers.Prefer),t&&s.push(`count=${t}`),this.headers.Prefer=s.join(","),new St.default({method:i,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t="DELETE",i=[];return e&&i.push(`count=${e}`),this.headers.Prefer&&i.unshift(this.headers.Prefer),this.headers.Prefer=i.join(","),new St.default({method:t,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}};kr.default=gl;var Tr={},Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.version=void 0;Er.version="0.0.0-automated";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.DEFAULT_HEADERS=void 0;const xl=Er;Tr.DEFAULT_HEADERS={"X-Client-Info":`postgrest-js/${xl.version}`};var so=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ui,"__esModule",{value:!0});const bl=so(kr),vl=so(Vt),yl=Tr;let wl=class oo{constructor(e,{headers:t={},schema:i,fetch:s}={}){this.url=e,this.headers=Object.assign(Object.assign({},yl.DEFAULT_HEADERS),t),this.schemaName=i,this.fetch=s}from(e){const t=new URL(`${this.url}/${e}`);return new bl.default(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new oo(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:i=!1,get:s=!1,count:o}={}){let a;const l=new URL(`${this.url}/rpc/${e}`);let d;i||s?(a=i?"HEAD":"GET",Object.entries(t).filter(([u,m])=>m!==void 0).map(([u,m])=>[u,Array.isArray(m)?`{${m.join(",")}}`:`${m}`]).forEach(([u,m])=>{l.searchParams.append(u,m)})):(a="POST",d=t);const h=Object.assign({},this.headers);return o&&(h.Prefer=`count=${o}`),new vl.default({method:a,url:l,headers:h,schema:this.schemaName,body:d,fetch:this.fetch,allowEmpty:!1})}};ui.default=wl;var _t=be&&be.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pe,"__esModule",{value:!0});pe.PostgrestError=pe.PostgrestBuilder=pe.PostgrestTransformBuilder=pe.PostgrestFilterBuilder=pe.PostgrestQueryBuilder=pe.PostgrestClient=void 0;const ao=_t(ui);pe.PostgrestClient=ao.default;const lo=_t(kr);pe.PostgrestQueryBuilder=lo.default;const co=_t(Vt);pe.PostgrestFilterBuilder=co.default;const uo=_t(Sr);pe.PostgrestTransformBuilder=uo.default;const ho=_t(Cr);pe.PostgrestBuilder=ho.default;const mo=_t(Pr);pe.PostgrestError=mo.default;var jl=pe.default={PostgrestClient:ao.default,PostgrestQueryBuilder:lo.default,PostgrestFilterBuilder:co.default,PostgrestTransformBuilder:uo.default,PostgrestBuilder:ho.default,PostgrestError:mo.default};
73const{PostgrestClient:_l,PostgrestQueryBuilder:$0,PostgrestFilterBuilder:O0,PostgrestTransformBuilder:I0,PostgrestBuilder:D0,PostgrestError:M0}=jl,kl="2.11.2",Sl={"X-Client-Info":`realtime-js/${kl}`},Cl="1.0.0",fo=1e4,Pl=1e3;var xt;(function(r){r[r.connecting=0]="connecting",r[r.open=1]="open",r[r.closing=2]="closing",r[r.closed=3]="closed"})(xt||(xt={}));var ge;(function(r){r.closed="closed",r.errored="errored",r.joined="joined",r.joining="joining",r.leaving="leaving"})(ge||(ge={}));var we;(function(r){r.close="phx_close",r.error="phx_error",r.join="phx_join",r.reply="phx_reply",r.leave="phx_leave",r.access_token="access_token"})(we||(we={}));var Rn;(function(r){r.websocket="websocket"})(Rn||(Rn={}));var Qe;(function(r){r.Connecting="connecting",r.Open="open",r.Closing="closing",r.Closed="closed"})(Qe||(Qe={}));class Tl{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),i=new TextDecoder;return this._decodeBroadcast(e,t,i)}_decodeBroadcast(e,t,i){const s=t.getUint8(1),o=t.getUint8(2);let a=this.HEADER_LENGTH+2;const l=i.decode(e.slice(a,a+s));a=a+s;const d=i.decode(e.slice(a,a+o));a=a+o;const h=JSON.parse(i.decode(e.slice(a,e.byteLength)));return{ref:null,topic:l,event:d,payload:h}}}class po{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var te;(function(r){r.abstime="abstime",r.bool="bool",r.date="date",r.daterange="daterange",r.float4="float4",r.float8="float8",r.int2="int2",r.int4="int4",r.int4range="int4range",r.int8="int8",r.int8range="int8range",r.json="json",r.jsonb="jsonb",r.money="money",r.numeric="numeric",r.oid="oid",r.reltime="reltime",r.text="text",r.time="time",r.timestamp="timestamp",r.timestamptz="timestamptz",r.timetz="timetz",r.tsrange="tsrange",r.tstzrange="tstzrange"})(te||(te={}));const Ei=(r,e,t={})=>{var i;const s=(i=t.skipTypes)!==null&&i!==void 0?i:[];return Object.keys(e).reduce((o,a)=>(o[a]=El(a,r,e,s),o),{})},El=(r,e,t,i)=>{const s=e.find(l=>
vendor: 12,192 bytes, line 73
73l.name===r),o=s==null?void 0:s.type,a=t[r];return o&&!i.includes(o)?go(o,a):Nn(a)},go=(r,e)=>{if(r.charAt(0)==="_"){const t=r.slice(1,r.length);return Il(e,t)}switch(r){case te.bool:return Al(e);case te.float4:case te.float8:case te.int2:case te.int4:case te.int8:case te.numeric:case te.oid:return $l(e);case te.json:case te.jsonb:return Ol(e);case te.timestamp:return Dl(e);case te.abstime:case te.date:case te.daterange:case te.int4range:case te.int8range:case te.money:case te.reltime:case te.text:case te.time:case te.timestamptz:case te.timetz:case te.tsrange:case te.tstzrange:return Nn(e);default:return Nn(e)}},Nn=r=>r,Al=r=>{switch(r){case"t":return!0;case"f":return!1;default:return r}},$l=r=>{if(typeof r=="string"){const e=parseFloat(r);if(!Number.isNaN(e))return e}return r},Ol=r=>{if(typeof r=="string")try{return JSON.parse(r)}catch(e){return console.log(`JSON parse error: ${e}`),r}return r},Il=(r,e)=>{if(typeof r!="string")return r;const t=r.length-1,i=r[t];if(r[0]==="{"&&i==="}"){let o;const a=r.slice(1,t);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(l=>go(e,l))}return r},Dl=r=>typeof r=="string"?r.replace(" ","T"):r,xo=r=>{let e=r;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")};class Fr{constructor(e,t,i={},s=fo){this.channel=e,this.event=t,this.payload=i,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var i;return this._hasReceived(e)&&t((i=this.receivedResp)===null||i===void 0?void 0:i.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(i=>i.status===e).forEach(i=>i.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Ai;(function(r){r.SYNC="sync",r.JOIN="join",r.LEAVE="leave"})(Ai||(Ai={}));class Nt{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const i=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(i.state,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Nt.syncState(this.state,s,o,a),this.pendingDiffs.forEach(d=>{this.state=Nt.syncDiff(this.state,d,o,a)}),this.pendingDiffs=[],l()}),this.channel._on(i.diff,{},s=>{const{onJoin:o,onLeave:a,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=Nt.syncDiff(this.state,s,o,a),l())}),this.onJoin((s,o,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:a})}),this.onLeave((s,o,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,i,s){const o=this.cloneDeep(e),a=this.transformState(t),l={},d={};return this.map(o,(h,u)=>{a[h]||(d[h]=u)}),this.map(a,(h,u)=>{const m=o[h];if(m){const x=u.map(y=>y.presence_ref),g=m.map(y=>y.presence_ref),v=u.filter(y=>g.indexOf(y.presence_ref)<0),b=m.filter(y=>x.indexOf(y.presence_ref)<0);v.length>0&&(l[h]=v),b.length>0&&(d[h]=b)}else l[h]=u}),this.syncDiff(o,{joins:l,leaves:d},i,s)}static syncDiff(e,t,i,s){const{joins:o,leaves:a}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return i||(i=()=>{}),s||(s=()=>{}),this.map(o,(l,d)=>{var h;const u=(h=e[l])!==null&&h!==void 0?h:[];if(e[l]=this.cloneDeep(d),u.length>0){const m=e[l].map(g=>g.presence_ref),x=u.filter(g=>m.indexOf(g.presence_ref)<0);e[l].unshift(...x)}i(l,u,d)}),this.map(a,(l,d)=>{let h=e[l];if(!h)return;const u=d.map(m=>m.presence_ref);h=h.filter(m=>u.indexOf(m.presence_ref)<0),e[l]=h,s(l,h,d),h.length===0&&delete e[l]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(i=>t(i,e[i]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,i)=>{const s=e[i];return"metas"in s?t[i]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):t[i]=s,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var $i;(function(r){r.ALL="*",r.INSERT="INSERT",r.UPDATE="UPDATE",r.DELETE="DELETE"})($i||($i={}));var Oi;(function(r){r.BROADCAST="broadcast",r.PRESENCE="presence",r.POSTGRES_CHANGES="postgres_changes",r.SYSTEM="system"})(Oi||(Oi={}));var Te;(function(r){r.SUBSCRIBED="SUBSCRIBED",r.TIMED_OUT="TIMED_OUT",r.CLOSED="CLOSED",r.CHANNEL_ERROR="CHANNEL_ERROR"})(Te||(Te={}));class hi{constructor(e,t={config:{}},i){this.topic=e,this.params=t,this.socket=i,this.bindings={},this.state=ge.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""},private:!1},t.config),this.timeout=this.socket.timeout,this.joinPush=new Fr(this,we.join,this.params,this.timeout),this.rejoinTimer=new po(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=ge.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(s=>s.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=ge.closed,this.socket._remove(this)}),this._onError(s=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,s),this.state=ge.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=ge.errored,this.rejoinTimer.scheduleTimeout())}),this._on(we.reply,{},(s,o)=>{this._trigger(this._replyEventName(o),s)}),this.presence=new Nt(this),this.broadcastEndpointURL=xo(this.socket.endPoint)+"/api/broadcast",this.private=this.params.config.private||!1}subscribe(e,t=this.timeout){var i,s;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:o,presence:a,private:l}}=this.params;this._onError(u=>e==null?void 0:e(Te.CHANNEL_ERROR,u)),this._onClose(()=>e==null?void 0:e(Te.CLOSED));const d={},h={broadcast:o,presence:a,postgres_changes:(s=(i=this.bindings.postgres_changes)===null||i===void 0?void 0:i.map(u=>u.filter))!==null&&s!==void 0?s:[],private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this.updateJoinPayload(Object.assign({config:h},d)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",async({postgres_changes:u})=>{var m;if(this.socket.setAuth(),u===void 0){e==null||e(Te.SUBSCRIBED);return}else{const x=this.bindings.postgres_changes,g=(m=x==null?void 0:x.length)!==null&&m!==void 0?m:0,v=[];for(let b=0;b<g;b++){const y=x[b],{filter:{event:S,schema:R,table:L,filter:B}}=y,z=u&&u[b];if(z&&z.event===S&&z.schema===R&&z.table===L&&z.filter===B)v.push(Object.assign(Object.assign({},y),{id:z.id}));else{this.unsubscribe(),e==null||e(Te.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=v,e&&e(Te.SUBSCRIBED);return}}).receive("error",u=>{e==null||e(Te.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(u).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Te.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,i){return this._on(e,t,i)}async send(e,t={}){var i,s;if(!this._canPush()&&e.type==="broadcast"){const{event:o,payload:a}=e,d={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,d,(i=t.timeout)!==null&&i!==void 0?i:this.timeout);return await((s=h.body)===null||s===void 0?void 0:s.cancel()),h.ok?"ok":"error"}catch(h){return h.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,l,d;const h=this._push(e.type,e,t.timeout||this.timeout);e.type==="broadcast"&&!(!((d=(l=(a=this.params)===null||a===void 0?void 0:a.config)===null||l===void 0?void 0:l.broadcast)===null||d===void 0)&&d.ack)&&o("ok"),h.receive("ok",()=>o("ok")),h.receive("error",()=>o("error")),h.receive("timeout",()=>o("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=ge.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(we.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(i=>{const s=new Fr(this,we.leave,{},e);s.receive("ok",()=>{t(),i("ok")}).receive("timeout",()=>{t(),i("timed out")}).receive("error",()=>{i("error")}),s.send(),this._canPush()||s.trigger("ok",{})})}async _fetchWithTimeout(e,t,i){const s=new AbortController,o=setTimeout(()=>s.abort(),i),a=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:s.signal}));return clearTimeout(o),a}_push(e,t,i=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new Fr(this,e,t,i);return this._canPush()?s.send():(s.startTimeout(),this.pushBuffer.push(s)),s}_onMessage(e,t,i){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,i){var s,o;const a=e.toLocaleLowerCase(),{close:l,error:d,leave:h,join:u}=we;if(i&&[l,d,h,u].indexOf(a)>=0&&i!==this._joinRef())return;let x=this._onMessage(a,t,i);if(t&&!x)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(g=>{var v,b,y;return((v=g.filter)===null||v===void 0?void 0:v.event)==="*"||((y=(b=g.filter)===null||b===void 0?void 0:b.event)===null||y===void 0?void 0:y.toLocaleLowerCase())===a}).map(g=>g.callback(x,i)):(o=this.bindings[a])===null||o===void 0||o.filter(g=>{var v,b,y,S,R,L;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in g){const B=g.id,z=(v=g.filter)===null||v===void 0?void 0:v.event;return B&&((b=t.ids)===null||b===void 0?void 0:b.includes(B))&&(z==="*"||(z==null?void 0:z.toLocaleLowerCase())===((y=t.data)===null||y===void 0?void 0:y.type.toLocaleLowerCase()))}else{const B=(R=(S=g==null?void 0:g.filter)===null||S===void 0?void 0:S.event)===null||R===void 0?void 0:R.toLocaleLowerCase();return B==="*"||B===((L=t==null?void 0:t.event)===null||L===void 0?void 0:L.toLocaleLowerCase())}else return g.type.toLocaleLowerCase()===a}).map(g=>
73{if(typeof x=="object"&&"ids"in x){const v=x.data,{schema:b,table:y,commit_timestamp:S,type:R,errors:L}=v;x=Object.assign(Object.assign({},{schema:b,table:y,commit_timestamp:S,eventType:R,new:{},old:{},errors:L}),this._getPayloadRecords(v))}g.callback(x,i)})}_isClosed(){return this.state===ge.closed}_isJoined(){return this.state===ge.joined}_isJoining(){return this.state===ge.joining}_isLeaving(){return this.state===ge.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,i){const s=e.toLocaleLowerCase(),o={type:s,filter:t,callback:i};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(e,t){const i=e.toLocaleLowerCase();return this.bindings[i]=this.bindings[i].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===i&&hi.isEqual(s.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(we.close,{},e)}_onError(e){this._on(we.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=ge.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=Ei(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=Ei(e.columns,e.old_record)),t}}const Ml=()=>{},Rl=typeof WebSocket<"u",Nl=` 74 addEventListener("message", (e) => { 75 if (e.data.event === "start") { 76 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 77 } 78 });`;class Fl{constructor(e,t){var i;this.accessTokenValue=null,this.apiKey=null,this.channels=[],this.endPoint="",this.httpEndpoint="",this.headers=Sl,this.params={},this.timeout=fo,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Ml,this.conn=null,this.sendBuffer=[],this.serializer=new Tl,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._resolveFetch=o=>{let a;return o?a=o:typeof fetch>"u"?a=(...l)=>vt(()=>Promise.resolve().then(()=>jt),void 0).then(({default:d})=>d(...l)):a=fetch,(...l)=>a(...l)},this.endPoint=`${e}/${Rn.websocket}`,this.httpEndpoint=xo(e),t!=null&&t.transport?this.transport=t.transport:this.transport=null,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const s=(i=t==null?void 0:t.params)===null||i===void 0?void 0:i.apikey;if(s&&(this.accessTokenValue=s,this.apiKey=s),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:o=>[1e3,2e3,5e3,1e4][o-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(o,a)=>a(JSON.stringify(o)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new po(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t==null?void 0:t.fetch),t!=null&&t.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.worker=(t==null?void 0:t.worker)||!1,this.workerUrl=t==null?void 0:t.workerUrl}this.accessToken=(t==null?void 0:t.accessToken)||null}connect(){if(!this.conn){if(this.transport){this.conn=new this.transport(this.endpointURL(),void 0,{headers:this.headers});return}if(Rl){this.conn=new WebSocket(this.endpointURL()),this.setupConnection();return}this.conn=new Ll(this.endpointURL(),void 0,{close:()=>{this.conn=null}}),vt(()=>import("./browser-BscB7iPs.js").then(e=>e.b),__vite__mapDeps([0,1])).then(({default:e})=>{this.conn=new e(this.endpointURL(),void 0,{headers:this.headers}),this.setupConnection()})}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Cl}))}
78disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,i){this.logger(e,t,i)}connectionState(){switch(this.conn&&this.conn.readyState){case xt.connecting:return Qe.Connecting;case xt.open:return Qe.Open;case xt.closing:return Qe.Closing;default:return Qe.Closed}}isConnected(){return this.connectionState()===Qe.Open}channel(e,t={config:{}}){const i=new hi(`realtime:${e}`,t,this);return this.channels.push(i),i}push(e){const{topic:t,event:i,payload:s,ref:o}=e,a=()=>{this.encode(e,l=>{var d;(d=this.conn)===null||d===void 0||d.send(l)})};this.log("push",`${t} ${i} (${o})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(e=null){let t=e||this.accessToken&&await this.accessToken()||this.accessTokenValue;if(t){let i=null;try{i=JSON.parse(atob(t.split(".")[1]))}catch{}if(i&&i.exp&&!(Math.floor(Date.now()/1e3)-i.exp<0))return this.log("auth",`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${i.exp}`),Promise.reject(`InvalidJWTToken: Invalid value for JWT claim "exp" with value ${i.exp}`);this.accessTokenValue=t,this.channels.forEach(s=>{t&&s.updateJoinPayload({access_token:t}),s.joinedOnce&&s._isJoined()&&s._push(we.access_token,{access_token:t})})}}async sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(Pl,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth()}}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(i=>i.topic===e&&(i._isJoined()||i._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}setupConnection(){this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:i,event:s,payload:o,ref:a}=t;a&&a===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null),this.log("receive",`${o.status||""} ${i} ${s} ${a&&"("+a+")"||""}`,o),this.channels.filter(l=>l._isMember(i)).forEach(l=>l._trigger(s,o,a)),this.stateChangeCallbacks.message.forEach(l=>l(t))})}async _onConnOpen(){if(this.log("transport",`connected to ${this.endpointURL()}`),this.flushSendBuffer(),this.reconnectTimer.reset(),!this.worker)this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs);else{this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=t=>{this.log("worker","worker error",t.message),this.workerRef.terminate()},this.workerRef.onmessage=t=>{t.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}
78_triggerChanError(){this.channels.forEach(e=>e._trigger(we.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const i=e.match(/\?/)?"&":"?",s=new URLSearchParams(t);return`${e}${i}${s}`}_workerObjectUrl(e){let t;if(e)t=e;else{const i=new Blob([Nl],{type:"application/javascript"});t=URL.createObjectURL(i)}return t}}class Ll{constructor(e,t,i){this.binaryType="arraybuffer",this.onclose=()=>{},this.onerror=()=>{},this.onmessage=()=>{},this.onopen=()=>{},this.readyState=xt.connecting,this.send=()=>{},this.url=null,this.url=e,this.close=i.close}}class mi extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function ae(r){return typeof r=="object"&&r!==null&&"__isStorageError"in r}class zl extends mi{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class Fn extends mi{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var Ul=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};const bo=r=>{let e;return r?e=r:typeof fetch>"u"?e=(...t)=>vt(()=>Promise.resolve().then(()=>jt),void 0).then(({default:i})=>i(...t)):e=fetch,(...t)=>e(...t)},Bl=()=>Ul(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield vt(()=>Promise.resolve().then(()=>jt),void 0)).Response:Response}),Ln=r=>{if(Array.isArray(r))return r.map(t=>Ln(t));if(typeof r=="function"||r!==Object(r))return r;const e={};return Object.entries(r).forEach(([t,i])=>{const s=t.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));e[s]=Ln(i)}),e};var rt=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};const Lr=r=>r.msg||r.message||r.error_description||r.error||JSON.stringify(r),ql=(r,e,t)=>rt(void 0,void 0,void 0,function*(){const i=yield Bl();r instanceof i&&!(t!=null&&t.noResolveJson)?r.json().then(s=>{e(new zl(Lr(s),r.status||500))}).catch(s=>{e(new Fn(Lr(s),s))}):e(new Fn(Lr(r),r))}),Wl=(r,e,t,i)=>{const s={method:r,headers:(e==null?void 0:e.headers)||{}};return r==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),i&&(s.body=JSON.stringify(i)),Object.assign(Object.assign({},s),t))};function Gt(r,e,t,i,s,o){return rt(this,void 0,void 0,function*(){return new Promise((a,l)=>{r(t,Wl(e,i,s,o)).then(d=>{if(!d.ok)throw d;return i!=null&&i.noResolveJson?d:d.json()}).then(d=>a(d)).catch(d=>ql(d,l,i))})})}function br(r,e,t,i){return rt(this,void 0,void 0,function*(){return Gt(r,"GET",e,t,i)})}function Be(r,e,t,i,s){return rt(this,void 0,void 0,function*(){return Gt(r,"POST",e,i,s,t)})}function Hl(r,e,t,i,s){return rt(this,void 0,void 0,function*(){return Gt(r,"PUT",e,i,s,t)})}function Vl(r,e,t,i){return rt(this,void 0,void 0,function*(){return Gt(r,"HEAD",e,Object.assign(Object.assign({},t),{noResolveJson:!0}),i)})}function vo(r,e,t,i,s){return rt(this,void 0,void 0,function*(){return Gt(r,"DELETE",e,i,s,t)})}var me=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};const Gl={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Ii={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Yl{constructor(e,t={},i,s){this.url=e,this.headers=t,this.bucketId=i,this.fetch=bo(s)}uploadOrUpdate(e,t,i,s){return me(this,void 0,void 0,function*(){try{let o;const a=Object.assign(Object.assign({},Ii),s);let l=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const d=a.metadata;typeof Blob<"u"&&i instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),d&&o.append("metadata",this.encodeMetadata(d)),o.append("",i)):typeof FormData<"u"&&i instanceof FormData?(o=i,o.append("cacheControl",a.cacheControl),d&&o.append("metadata",this.encodeMetadata(d))):(o=i,l["cache-control"]=`max-age=${a.cacheControl}`,l["content-type"]=a.contentType,d&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(d)))),s!=null&&s.headers&&(l=Object.assign(Object.assign({},l),s.headers));const h=this._removeEmptyFolders(t),u=this._getFinalPath(h),m=yield this.fetch(`${this.url}/object/${u}`,Object.assign({method:e,body:o,headers:l},a!=null&&a.duplex?{duplex:a.duplex}:{})),x=yield m.json();return m.ok?{data:{path:h,id:x.Id,fullPath:x.Key},error:null}:{data:null,error:x}}catch(o){if(ae(o))return{data:null,error:o};throw o}})}upload(e,t,i){return me(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,i)})}uploadToSignedUrl(e,t,i,s){return me(this,void 0,void 0,function*(){const o=this._removeEmptyFolders(e),a=this._getFinalPath(o),l=new URL(this.url+`/object/upload/sign/${a}`);l.searchParams.set("token",t);try{let d;const h=Object.assign({upsert:Ii.upsert},s),u=Object.assign(Object.assign({},this.headers),{"x-upsert":String(h.upsert)});typeof Blob<"u"&&i instanceof Blob?(d=new FormData,d.append("cacheControl",h.cacheControl),d.append("",i)):typeof FormData<"u"&&i instanceof FormData?(d=i,d.append("cacheControl",h.cacheControl)):(d=i,u["cache-control"]=`max-age=${h.cacheControl}`,u["content-type"]=h.contentType);const m=yield this.fetch(l.toString(),{method:"PUT",body:d,headers:u}),x=yield m.json();return m.ok?{data:{path:o,fullPath:x.Key},error:null}:{data:null,error:x}}catch(d){if(ae(d))return{data:null,error:d};throw d}})}createSignedUploadUrl(e,t){return me(this,void 0,void 0,function*(){try{let i=this._getFinalPath(e);const s=Object.assign({},this.headers);t!=null&&t.upsert&&(s["x-upsert"]="true");const o=yield Be(this.fetch,`${this.url}/object/upload/sign/${i}`,{},{headers:s}),a=new URL(this.url+o.url),l=a.searchParams.get("token");if(!l)throw new mi("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:l},error:null}}catch(i){if(ae(i))return{data:null,error:i};throw i}})}update(e,t,i){return me(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,i)})}move(e,t,i){return me(this,void 0,void 0,function*(){try{return{data:yield Be(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,de
78stinationBucket:i==null?void 0:i.destinationBucket},{headers:this.headers}),error:null}}catch(s){if(ae(s))return{data:null,error:s};throw s}})}copy(e,t,i){return me(this,void 0,void 0,function*(){try{return{data:{path:(yield Be(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t,destinationBucket:i==null?void 0:i.destinationBucket},{headers:this.headers})).Key},error:null}}catch(s){if(ae(s))return{data:null,error:s};throw s}})}createSignedUrl(e,t,i){return me(this,void 0,void 0,function*(){try{let s=this._getFinalPath(e),o=yield Be(this.fetch,`${this.url}/object/sign/${s}`,Object.assign({expiresIn:t},i!=null&&i.transform?{transform:i.transform}:{}),{headers:this.headers});const a=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return o={signedUrl:encodeURI(`${this.url}${o.signedURL}${a}`)},{data:o,error:null}}catch(s){if(ae(s))return{data:null,error:s};throw s}})}createSignedUrls(e,t,i){return me(this,void 0,void 0,function*(){try{const s=yield Be(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),o=i!=null&&i.download?`&download=${i.download===!0?"":i.download}`:"";return{data:s.map(a=>Object.assign(Object.assign({},a),{signedUrl:a.signedURL?encodeURI(`${this.url}${a.signedURL}${o}`):null})),error:null}}catch(s){if(ae(s))return{data:null,error:s};throw s}})}download(e,t){return me(this,void 0,void 0,function*(){const s=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",o=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),a=o?`?${o}`:"";try{const l=this._getFinalPath(e);return{data:yield(yield br(this.fetch,`${this.url}/${s}/${l}${a}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(l){if(ae(l))return{data:null,error:l};throw l}})}info(e){return me(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{const i=yield br(this.fetch,`${this.url}/object/info/${t}`,{headers:this.headers});return{data:Ln(i),error:null}}catch(i){if(ae(i))return{data:null,error:i};throw i}})}exists(e){return me(this,void 0,void 0,function*(){const t=this._getFinalPath(e);try{return yield Vl(this.fetch,`${this.url}/object/${t}`,{headers:this.headers}),{data:!0,error:null}}catch(i){if(ae(i)&&i instanceof Fn){const s=i.originalError;if([400,404].includes(s==null?void 0:s.status))return{data:!1,error:i}}throw i}})}getPublicUrl(e,t){const i=this._getFinalPath(e),s=[],o=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";o!==""&&s.push(o);const l=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",d=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});d!==""&&s.push(d);let h=s.join("&");return h!==""&&(h=`?${h}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${i}${h}`)}}}remove(e){return me(this,void 0,void 0,function*(){try{return{data:yield vo(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(ae(t))return{data:null,error:t};throw t}})}list(e,t,i){return me(this,void 0,void 0,function*(){try{const s=Object.assign(Object.assign(Object.assign({},Gl),t),{prefix:e||""});return{data:yield Be(this.fetch,`${this.url}/object/list/${this.bucketId}`,s,{headers:this.headers},i),error:null}}catch(s){if(ae(s))return{data:null,error:s};throw s}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const Jl="2.7.1",Kl={"X-Client-Info":`storage-js/${Jl}`};var nt=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};class Xl{constructor(e,t={},i){this.url=e,this.headers=Object.assign(Object.assign({},Kl),t),this.fetch=bo(i)}listBuckets(){return nt(this,void 0,void 0,function*(){try{return{data:yield br(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(ae(e))return{data:null,error:e};throw e}})}getBucket(e){return nt(this,void 0,void 0,function*(){try{return{data:yield br(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(ae(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return nt(this,void 0,void 0,function*(){try{return{data:yield Be(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(ae(i))return{data:null,error:i};throw i}})}updateBucket(e,t){return nt(this,void 0,void 0,function*(){try{return{data:yield Hl(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(i){if(ae(i))return{data:null,error:i};throw i}})}emptyBucket(e){return nt(this,void 0,void 0,function*(){try{return{data:yield Be(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(ae(t))return{data:null,error:t};throw t}})}deleteBucket(e){return nt(this,void 0,void 0,function*(){try{return{data:yield vo(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(ae(t))return{data:null,error:t};throw t}})}}class Ql extends Xl{constructor(e,t={},i){super(e,t,i)}from(e){return new Yl(this.url,this.headers,e,this.fetch)}}const Zl="2.49.4";let Dt="";typeof Deno<"u"?Dt="deno":typeof document<"u"?Dt="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Dt="react-native":Dt="node";const ec={"X-Client-Info":`supabase-js-${Dt}/${Zl}`},tc={headers:ec},rc={schema:"public"},nc={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},ic={};var sc=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};const oc=r=>{let e;return r?e=r:typeof fetch>"u"?e=ro:e=fetch,(...t)=>e(...t)},ac=()=>typeof Headers>"u"?no:Headers,lc=(r,e,t)=>{const i=oc(t),s=ac();return(o,a)=>sc(void 0,void 0,void 0,function*(){var l;const d=(l=yield e())!==null&&l!==void 0?l:r;let h=new s(a==null?void 0:a.headers);return h.has("apikey")||h.set("apikey",r),h.has("Authorization")||h.set("Authorization",`Bearer ${d}`),i(o,Object.assign(Object.assign({},a),{headers:h}))})};var cc=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};function dc(r){return r.replace(/\/$/,"")}function uc(r,e){const{db:t,auth:i,realtime:s,global:o}=r,{db:a,auth:l,realtime:d,global:h}=e,u={db:Object.assign(Object.assign({},a),t),auth:Object.assign(Object.assign({},l),i),realtime:Object.assign(Object.assign({},d),s),global:Object.assign(Object.assign({},h),o),accessToken:()=>cc(this,void 0,void 0,function*(){return""})};return r.accessToken?u.accessToken=r.accessToken:delete u.accessToken,u}const yo="2.69.1",ft=30*1e3,zn=3,zr=zn*ft,hc="http://localhost:9999",mc="supabase.auth.token",fc={"X-Client-Info":`gotrue-js/${yo}`},Un="X-Supabase-Api-Version",wo={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},pc=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,gc=6e5;
78class fi extends Error{constructor(e,t,i){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t,this.code=i}}function q(r){return typeof r=="object"&&r!==null&&"__isAuthError"in r}class xc extends fi{constructor(e,t,i){super(e,t,i),this.name="AuthApiError",this.status=t,this.code=i}}function bc(r){return q(r)&&r.name==="AuthApiError"}class jo extends fi{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class Ge extends fi{constructor(e,t,i,s){super(e,i,s),this.name=t,this.status=i}}class ze extends Ge{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function vc(r){return q(r)&&r.name==="AuthSessionMissingError"}class Ur extends Ge{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Zt extends Ge{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class er extends Ge{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function yc(r){return q(r)&&r.name==="AuthImplicitGrantRedirectError"}class Di extends Ge{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Bn extends Ge{constructor(e,t){super(e,"AuthRetryableFetchError",t,void 0)}}function Br(r){return q(r)&&r.name==="AuthRetryableFetchError"}class Mi extends Ge{constructor(e,t,i){super(e,"AuthWeakPasswordError",t,"weak_password"),this.reasons=i}}class Ft extends Ge{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Ni=` 79\r=`.split(""),wc=(()=>{const r=new Array(128);for(let e=0;e<r.length;e+=1)r[e]=-1;for(let e=0;e<Ni.length;e+=1)r[Ni[e].charCodeAt(0)]=-2;for(let e=0;e<Ri.length;e+=1)r[Ri[e].charCodeAt(0)]=e;return r})();function _o(r,e,t){const i=wc[r];if(i>-1)for(e.queue=e.queue<<6|i,e.queuedBits+=6;e.queuedBits>=8;)t(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(i===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(r)}"`)}}function Fi(r){const e=[],t=a=>{e.push(String.fromCodePoint(a))},i={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{kc(a,i,t)};for(let a=0;a<r.length;a+=1)_o(r.charCodeAt(a),s,o);return e.join("")}function jc(r,e){if(r<=127){e(r);return}else if(r<=2047){e(192|r>>6),e(128|r&63);return}else if(r<=65535){e(224|r>>12),e(128|r>>6&63),e(128|r&63);return}else if(r<=1114111){e(240|r>>18),e(128|r>>12&63),e(128|r>>6&63),e(128|r&63);return}throw new Error(`Unrecognized Unicode codepoint: ${r.toString(16)}`)}function _c(r,e){for(let t=0;t<r.length;t+=1){let i=r.charCodeAt(t);if(i>55295&&i<=56319){const s=(i-55296)*1024&65535;i=(r.charCodeAt(t+1)-56320&65535|s)+65536,t+=1}jc(i,e)}}function kc(r,e,t){if(e.utf8seq===0){if(r<=127){t(r);return}for(let i=1;i<6;i+=1)if(!(r>>7-i&1)){e.utf8seq=i;break}if(e.utf8seq===2)e.codepoint=r&31;else if(e.utf8seq===3)e.codepoint=r&15;else if(e.utf8seq===4)e.codepoint=r&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(r<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|r&63,e.utf8seq-=1,e.utf8seq===0&&t(e.codepoint)}}function Sc(r){const e=[],t={queue:0,queuedBits:0},i=s=>{e.push(s)};for(let s=0;s<r.length;s+=1)_o(r.charCodeAt(s),t,i);return new Uint8Array(e)}function Cc(r){const e=[];return _c(r,t=>e.push(t)),new Uint8Array(e)}function Pc(r){return Math.round(Date.now()/1e3)+r}function Tc(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(r){const e=Math.random()*16|0;return(r=="x"?e:e&3|8).toString(16)})}const _e=()=>typeof window<"u"&&typeof document<"u",Ye={tested:!1,writable:!1},Lt=()=>{if(!_e())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Ye.tested)return Ye.writable;const r=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(r,r),globalThis.localStorage.removeItem(r),Ye.tested=!0,Ye.writable=!0}catch{Ye.tested=!0,Ye.writable=!1}return Ye.writable};function Ec(r){const e={},t=new URL(r);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEac
79h((s,o)=>{e[o]=s})}catch{}return t.searchParams.forEach((i,s)=>{e[s]=i}),e}const ko=r=>{let e;return r?e=r:typeof fetch>"u"?e=(...t)=>vt(()=>Promise.resolve().then(()=>jt),void 0).then(({default:i})=>i(...t)):e=fetch,(...t)=>e(...t)},Ac=r=>typeof r=="object"&&r!==null&&"status"in r&&"ok"in r&&"json"in r&&typeof r.json=="function",So=async(r,e,t)=>{await r.setItem(e,JSON.stringify(t))},tr=async(r,e)=>{const t=await r.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},rr=async(r,e)=>{await r.removeItem(e)};class Ar{constructor(){this.promise=new Ar.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Ar.promiseConstructor=Promise;function qr(r){const e=r.split(".");if(e.length!==3)throw new Ft("Invalid JWT structure");for(let i=0;i<e.length;i++)if(!pc.test(e[i]))throw new Ft("JWT not in base64url format");return{header:JSON.parse(Fi(e[0])),payload:JSON.parse(Fi(e[1])),signature:Sc(e[2]),raw:{header:e[0],payload:e[1]}}}async function $c(r){return await new Promise(e=>{setTimeout(()=>e(null),r)})}function Oc(r,e){return new Promise((i,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await r(o);if(!e(o,null,a)){i(a);return}}catch(a){if(!e(o,a)){s(a);return}}})()})}function Ic(r){return("0"+r.toString(16)).substr(-2)}function Dc(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=t.length;let s="";for(let o=0;o<56;o++)s+=t.charAt(Math.floor(Math.random()*i));return s}return crypto.getRandomValues(e),Array.from(e,Ic).join("")}async function Mc(r){const t=new TextEncoder().encode(r),i=await crypto.subtle.digest("SHA-256",t),s=new Uint8Array(i);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function Rc(r){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),r;const t=await Mc(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function it(r,e,t=!1){const i=Dc();let s=i;t&&(s+="/PASSWORD_RECOVERY"),await So(r,`${e}-code-verifier`,s);const o=await Rc(i);return[o,i===o?"plain":"s256"]}const Nc=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Fc(r){const e=r.headers.get(Un);if(!e||!e.match(Nc))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function Lc(r){if(!r)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(r<=e)throw new Error("JWT has expired")}function zc(r){switch(r){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}var Uc=function(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t};const Xe=r=>r.msg||r.message||r.error_description||r.error||JSON.stringify(r),Bc=[502,503,504];async function Li(r){var e;if(!Ac(r))throw new Bn(Xe(r),0);if(Bc.includes(r.status))throw new Bn(Xe(r),r.status);let t;try{t=await r.json()}catch(o){throw new jo(Xe(o),o)}let i;const s=Fc(r);if(s&&s.getTime()>=wo["2024-01-01"].timestamp&&typeof t=="object"&&t&&typeof t.code=="string"?i=t.code:typeof t=="object"&&t&&typeof t.error_code=="string"&&(i=t.error_code),i){if(i==="weak_password")throw new Mi(Xe(t),r.status,((e=t.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(i==="session_not_found")throw new ze}else if(typeof t=="object"&&t&&typeof t.weak_password=="object"&&t.weak_password&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.reasons.reduce((o,a)=>o&&typeof a=="string",!0))throw new Mi(Xe(t),r.status,t.weak_password.reasons);throw new xc(Xe(t),r.status||500,i)}const qc=(r,e,t,i)=>{const s={method:r,headers:(e==null?void 0:e.headers)||{}};return r==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"}
79,e==null?void 0:e.headers),s.body=JSON.stringify(i),Object.assign(Object.assign({},s),t))};async function G(r,e,t,i){var s;const o=Object.assign({},i==null?void 0:i.headers);o[Un]||(o[Un]=wo["2024-01-01"].name),i!=null&&i.jwt&&(o.Authorization=`Bearer ${i.jwt}`);const a=(s=i==null?void 0:i.query)!==null&&s!==void 0?s:{};i!=null&&i.redirectTo&&(a.redirect_to=i.redirectTo);const l=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",d=await Wc(r,e,t+l,{headers:o,noResolveJson:i==null?void 0:i.noResolveJson},{},i==null?void 0:i.body);return i!=null&&i.xform?i==null?void 0:i.xform(d):{data:Object.assign({},d),error:null}}async function Wc(r,e,t,i,s,o){const a=qc(e,i,s,o);let l;try{l=await r(t,Object.assign({},a))}catch(d){throw console.error(d),new Bn(Xe(d),0)}if(l.ok||await Li(l),i!=null&&i.noResolveJson)return l;try{return await l.json()}catch(d){await Li(d)}}function Ue(r){var e;let t=null;Yc(r)&&(t=Object.assign({},r),r.expires_at||(t.expires_at=Pc(r.expires_in)));const i=(e=r.user)!==null&&e!==void 0?e:r;return{data:{session:t,user:i},error:null}}function zi(r){const e=Ue(r);return!e.error&&r.weak_password&&typeof r.weak_password=="object"&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.message&&typeof r.weak_password.message=="string"&&r.weak_password.reasons.reduce((t,i)=>t&&typeof i=="string",!0)&&(e.data.weak_password=r.weak_password),e}function qe(r){var e;return{data:{user:(e=r.user)!==null&&e!==void 0?e:r},error:null}}function Hc(r){return{data:r,error:null}}function Vc(r){const{action_link:e,email_otp:t,hashed_token:i,redirect_to:s,verification_type:o}=r,a=Uc(r,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:e,email_otp:t,hashed_token:i,redirect_to:s,verification_type:o},d=Object.assign({},a);return{data:{properties:l,user:d},error:null}}function Gc(r){return r}function Yc(r){return r.access_token&&r.refresh_token&&r.expires_in}var Jc=function(r,e){var t={};for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&e.indexOf(i)<0&&(t[i]=r[i]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,i=Object.getOwnPropertySymbols(r);s<i.length;s++)e.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(r,i[s])&&(t[i[s]]=r[i[s]]);return t};class Kc{constructor({url:e="",headers:t={},fetch:i}){this.url=e,this.headers=t,this.fetch=ko(i),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await G(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(i){if(q(i))return{data:null,error:i};throw i}}async inviteUserByEmail(e,t={}){try{return await G(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:qe})}catch(i){if(q(i))return{data:{user:null},error:i};throw i}}async generateLink(e){try{const{options:t}=e,i=Jc(e,["options"]),s=Object.assign(Object.assign({},i),t);return"newEmail"in i&&(s.new_email=i==null?void 0:i.newEmail,delete s.newEmail),await G(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:Vc,redirectTo:t==null?void 0:t.redirectTo})}catch(t){if(q(t))return{data:{properties:null,user:null},error:t};throw t}}async createUser(e){try{return await G(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:qe})}catch(t){if(q(t))return{data:{user:null},error:t};throw t}}async listUsers(e){var t,i,s,o,a,l,d;try{const h={nextPage:null,lastPage:0,total:0},u=await G(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(i=(t=e==null?void 0:e.page)===null||t===void 0?void 0:t.toString())!==null&&i!==void 0?i:"",per_page:(o=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:Gc});if(u.error)throw u.error;const m=await u.json(),x=(a=u.headers.get("x-total-count"))!==null&&a!==void 0?a:0,g=(d=(l=u.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&d!==void 0?d:[];return g.length>0&&(g.forEach(v=>{const b=parseInt(v.split(";")[0].split("=")[1].substring(0,1)),y=JSON.parse(v.split(";")[1].split("=")[1]);h[`${y}Page`]=b}),h.total=parseInt(x)),{data:Object.assign(Object.assign({},m),h),error:null}}catch(h){if(q(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){try{return await G(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:qe})}catch(t){if(q(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await G(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:qe})}catch(i){if(q(i))return{data:{user:null},error:i};throw i}}
79async deleteUser(e,t=!1){try{return await G(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:qe})}catch(i){if(q(i))return{data:{user:null},error:i};throw i}}async _listFactors(e){try{const{data:t,error:i}=await G(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:t,error:i}}catch(t){if(q(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await G(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(q(t))return{data:null,error:t};throw t}}}const Xc={getItem:r=>Lt()?globalThis.localStorage.getItem(r):null,setItem:(r,e)=>{Lt()&&globalThis.localStorage.setItem(r,e)},removeItem:r=>{Lt()&&globalThis.localStorage.removeItem(r)}};function Ui(r={}){return{getItem:e=>r[e]||null,setItem:(e,t)=>{r[e]=t},removeItem:e=>{delete r[e]}}}function Qc(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}const st={debug:!!(globalThis&&Lt()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Co extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class Zc extends Co{}async function ed(r,e,t){st.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",r,e);const i=new globalThis.AbortController;return e>0&&setTimeout(()=>{i.abort(),st.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",r)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(r,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:i.signal},async s=>{if(s){st.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",r,s.name);try{return await t()}finally{st.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",r,s.name)}}else{if(e===0)throw st.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",r),new Zc(`Acquiring an exclusive Navigator LockManager lock "${r}" immediately failed`);if(st.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await t()}}))}Qc();const td={url:hc,storageKey:mc,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:fc,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1};async function Bi(r,e,t){return await t()}class qt{constructor(e){var t,i;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=qt.nextInstanceID,qt.nextInstanceID+=1,this.instanceID>0&&_e()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},td),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Kc({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=ko(s.fetch),this.lock=s.lock||Bi,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,s.lock?this.lock=s.lock:_e()&&
79(!((t=globalThis==null?void 0:globalThis.navigator)===null||t===void 0)&&t.locks)?this.lock=ed:this.lock=Bi,this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:Lt()?this.storage=Xc:(this.memoryStorage={},this.storage=Ui(this.memoryStorage)):(this.memoryStorage={},this.storage=Ui(this.memoryStorage)),_e()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(i=this.broadcastChannel)===null||i===void 0||i.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${yo}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{const t=Ec(window.location.href);let i="none";if(this._isImplicitGrantCallback(t)?i="implicit":await this._isPKCECallback(t)&&(i="pkce"),_e()&&this.detectSessionInUrl&&i!=="none"){const{data:s,error:o}=await this._getSessionFromURL(t,i);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),yc(o)){const d=(e=o.details)===null||e===void 0?void 0:e.code;if(d==="identity_already_exists"||d==="identity_not_found"||d==="single_identity_not_deletable")return{error:o}}return await this._removeSession(),{error:o}}const{session:a,redirectType:l}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",l),await this._saveSession(a),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(t){return q(t)?{error:t}:{error:new jo("Unexpected error during initialization",t)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var t,i,s;try{const o=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(i=(t=e==null?void 0:e.options)===null||t===void 0?void 0:t.data)!==null&&i!==void 0?i:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:Ue}),{data:a,error:l}=o;if(l||!a)return{data:{user:null,session:null},error:l};const d=a.session,h=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",d)),{data:{user:h,session:d},error:null}}catch(o){if(q(o))return{data:{user:null,session:null},error:o};throw o}}async signUp(e){var t,i,s;try{let o;if("email"in e){const{email:u,password:m,options:x}=e;let g=null,v=null;this.flowType==="pkce"&&([g,v]=await it(this.storage,this.storageKey)),o=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:x==null?void 0:x.emailRedirectTo,body:{email:u,password:m,data:(t=x==null?void 0:x.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken},code_challenge:g,code_challenge_method:v},xform:Ue})}else if("phone"in e){const{phone:u,password:m,options:x}=e;o=await G(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:u,password:m,data:(i=x==null?void 0:x.data)!==null&&i!==void 0?i:{},channel:(s=x==null?void 0:x.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:x==null?void 0:x.captchaToken}},xform:Ue})}else throw new Zt("You must provide either an email or phone number and a password");const{data:a,error:l}=o;if(l||!a)return{data:{user:null,session:null},error:l};const d=a.session,h=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",d)),{data:{user:h,session:d},error:null}}catch(o){if(q(o))return{data:{user:null,session:null},error:o};throw o}}async signInWithPassword(e){try{let t;if("email"in e){const{email:o,password:a,options:l}=e;t=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:zi})}else if("phone"in e){const{phone:o,password:a,options:l}=e;t=await G(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:zi})}else throw new Zt("You must provide either an email or phone number and a password");const{data:i,error:s}=t;return s?{data:{user:null,session:null},error:s}:!i||!i.session||!i.user?{data:{user:null,session:null},error:new Ur}:(i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),{data:Object.assign({user:i.user,session:i.session},i.weak_password?{weakPassword:i.weak_password}:null),error:s})}catch(t){if(q(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,i,s,o;return await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(i=e.options)===null||i===void 0?void 0:i.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=e.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await tr(this.storage,`${this.storageKey}-code-verifier`),[i,s]=(t??"").split("/");try{const{data:o,error:a}=await G(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:i},xform:Ue});if(await rr(this.storage,`${this.storageKey}-code-verifier`),a)throw a;return!o||!o.session||!o.user?{data:{user:null,session:null,redirectType:null},error:new Ur}:(o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",o.session)),{data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(q(o))return{data:{user:null,session:null,redirectType:null},error:o};throw o}}async signInWithIdToken(e){try{const{options:t,provider:i,token:s,access_token:o,nonce:a}=e,l=await G(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:i,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:Ue}),{data:d,error:h}=l;return h?{data:{user:null,session:null},error:h}:!d||!d.session||!d.user?{data:{user:null,session:null},error:new Ur}:(d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",d.session)),{data:d,error:h})}catch(t){if(q(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,i,s,o,a;try{if("email"in e){const{email:l,options:d}=e;let h=null,u=null;this.flowType==="pkce"&&([h,u]=await it(this.storage,this.storageKey));const{error:m}=await G(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(t=d==null?void 0:d.data)!==null&&t!==void 0?t:{},create_user:(i=d==null?void 0:d.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},code_challenge:h,code_challenge_method:u},redirectTo:d==null?void 0:d.emailRedirectTo});return{data:{user:null,session:null},error:m}}if("phone"in e){const{phone:l,options:d}=e,{data:h,error:u}=await G(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(s=d==null?void 0:d.data)!==null&&s!==void 0?s:{},create_user:(o=d==null?void 0:d.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:d==null?void 0:d.captchaToken},channel:(a=d==null?void 0:d.channel)!==null&&a!==void 0?a:"sms"}});return{data:{user:null,session:null,messageId:h==null?void 0:h.message_id},error:u}}throw new Zt("You must provide either an email or phone number.")}catch(l){if(q(l))return{data:{user:null,session:null},error:l};throw l}}async verifyOtp(e){var t,i;try{let s,o;"options"in e&&(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo,o=(i=e.options)===null||i===void 0?void 0:i.captchaToken);const{data:a,error:l}=await G(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:Ue});if(l)throw l;if(!a)throw new Error("An error occurred on token verification.");const d=a.session,h=a.user;return d!=null&&d.access_token&&(await this._saveSession(d),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",d)),{data:{user:h,session:d},error:null}}catch(s){if(q(s))return{data:{user:null,session:null},error:s};throw s}}async signInWithSSO(e){var t,i,s;try{let o=null,a=null;return this.flowType==="pkce"&&([o,a]=await it(this.storage,this.storageKey)),await G(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(i=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&i!==void 0?i:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
79:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:a}),headers:this.headers,xform:Hc})}catch(o){if(q(o))return{data:null,error:o};throw o}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:i}=e;if(i)throw i;if(!t)throw new ze;const{error:s}=await G(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:s}})}catch(e){if(q(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{const t=`${this.url}/resend`;if("email"in e){const{email:i,type:s,options:o}=e,{error:a}=await G(this.fetch,"POST",t,{headers:this.headers,body:{email:i,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},redirectTo:o==null?void 0:o.emailRedirectTo});return{data:{user:null,session:null},error:a}}else if("phone"in e){const{phone:i,type:s,options:o}=e,{data:a,error:l}=await G(this.fetch,"POST",t,{headers:this.headers,body:{phone:i,type:s,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}}});return{data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:l}}throw new Zt("You must provide either an email or phone number and a type")}catch(t){if(q(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async t=>t))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const i=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await i,await t()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const i=t();for(this.pendingInLock.push((async()=>{try{await i}catch{}})()),await i;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await i}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await tr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const i=e.expires_at?e.expires_at*1e3-Date.now()<zr:!1;if(this._debug("#__loadSession()",`session has${i?"":" not"} expired`,"expires_at",e.expires_at),!i){if(this.storage.isServer){let a=this.suppressGetSessionWarning;e=new Proxy(e,{get:(d,h,u)=>(!a&&h==="user"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),a=!0,this.suppressGetSessionWarning=!0),Reflect.get(d,h,u))})}return{data:{session:e},error:null}}const{session:s,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{session:null},error:o}:{data:{session:s},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:qe}):await this._useSession(async t=>{var i,s,o;const{data:a,error:l}=t;if(l)throw l;return!(!((i=a.session)===null||i===void 0)&&i.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new ze}:await G(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:qe})})}catch(t){if(q(t))return vc(t)&&(await this._removeSession(),await rr(this.storage,`${this.storageKey}-code-verifier`)),{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async i=>{const{data:s,error:o}=i;if(o)throw o;if(!s.session)throw new ze;
79const a=s.session;let l=null,d=null;this.flowType==="pkce"&&e.email!=null&&([l,d]=await it(this.storage,this.storageKey));const{data:h,error:u}=await G(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:l,code_challenge_method:d}),jwt:a.access_token,xform:qe});if(u)throw u;return a.user=h.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),{data:{user:a.user},error:null}})}catch(i){if(q(i))return{data:{user:null},error:i};throw i}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new ze;const t=Date.now()/1e3;let i=t,s=!0,o=null;const{payload:a}=qr(e.access_token);if(a.exp&&(i=a.exp,s=i<=t),s){const{session:l,error:d}=await this._callRefreshToken(e.refresh_token);if(d)return{data:{user:null,session:null},error:d};if(!l)return{data:{user:null,session:null},error:null};o=l}else{const{data:l,error:d}=await this._getUser(e.access_token);if(d)throw d;o={access_token:e.access_token,refresh_token:e.refresh_token,user:l.user,token_type:"bearer",expires_in:i-t,expires_at:i},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return{data:{user:o.user,session:o},error:null}}catch(t){if(q(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var i;if(!e){const{data:a,error:l}=t;if(l)throw l;e=(i=a.session)!==null&&i!==void 0?i:void 0}if(!(e!=null&&e.refresh_token))throw new ze;const{session:s,error:o}=await this._callRefreshToken(e.refresh_token);return o?{data:{user:null,session:null},error:o}:s?{data:{user:s.user,session:s},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(q(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e,t){try{if(!_e())throw new er("No browser detected.");if(e.error||e.error_description||e.error_code)throw new er(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(t){case"implicit":if(this.flowType==="pkce")throw new Di("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new er("Not a valid implicit grant flow url.");break;default:}if(t==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new Di("No code detected.");const{data:R,error:L}=await this._exchangeCodeForSession(e.code);if(L)throw L;const B=new URL(window.location.href);return B.searchParams.delete("code"),window.history.replaceState(window.history.state,"",B.toString()),{data:{session:R.session,redirectType:null},error:null}}const{provider_token:i,provider_refresh_token:s,access_token:o,refresh_token:a,expires_in:l,expires_at:d,token_type:h}=e;if(!o||!l||!a||!h)throw new er("No session defined in URL");const u=Math.round(Date.now()/1e3),m=parseInt(l);let x=u+m;d&&(x=parseInt(d));const g=x-u;g*1e3<=ft&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${g}s, should have been closer to ${m}s`);const v=x-m;u-v>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",v,x,u):u-v<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",v,x,u);const{data:b,error:y}=await this._getUser(o);if(y)throw y;const S={provider_token:i,provider_refresh_token:s,access_token:o,expires_in:m,expires_at:x,refresh_token:a,token_type:h,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:S,redirectType:e.type},error:null}}catch(i){if(q(i))return{data:{session:null,redirectType:null},error:i};throw i}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const t=await tr(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var i;const{data:s,error:o}=t;if(o)return{error:o};const a=(i=s.session)===null||i===void 0?void 0:i.access_token;if(a){const{error:l}=await this.admin.signOut(a,e);
79if(l&&!(bc(l)&&(l.status===404||l.status===401||l.status===403)))return{error:l}}return e!=="others"&&(await this._removeSession(),await rr(this.storage,`${this.storageKey}-code-verifier`)),{error:null}})}onAuthStateChange(e){const t=Tc(),i={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,i),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:i}}}async _emitInitialSession(e){return await this._useSession(async t=>{var i,s;try{const{data:{session:o},error:a}=t;if(a)throw a;await((i=this.stateChangeEmitters.get(e))===null||i===void 0?void 0:i.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",e,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",o),console.error(o)}})}async resetPasswordForEmail(e,t={}){let i=null,s=null;this.flowType==="pkce"&&([i,s]=await it(this.storage,this.storageKey,!0));try{return await G(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:i,code_challenge_method:s,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(o){if(q(o))return{data:null,error:o};throw o}}async getUserIdentities(){var e;try{const{data:t,error:i}=await this.getUser();if(i)throw i;return{data:{identities:(e=t.user.identities)!==null&&e!==void 0?e:[]},error:null}}catch(t){if(q(t))return{data:null,error:t};throw t}}async linkIdentity(e){var t;try{const{data:i,error:s}=await this._useSession(async o=>{var a,l,d,h,u;const{data:m,error:x}=o;if(x)throw x;const g=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(l=e.options)===null||l===void 0?void 0:l.scopes,queryParams:(d=e.options)===null||d===void 0?void 0:d.queryParams,skipBrowserRedirect:!0});return await G(this.fetch,"GET",g,{headers:this.headers,jwt:(u=(h=m.session)===null||h===void 0?void 0:h.access_token)!==null&&u!==void 0?u:void 0})});if(s)throw s;return _e()&&!(!((t=e.options)===null||t===void 0)&&t.skipBrowserRedirect)&&window.location.assign(i==null?void 0:i.url),{data:{provider:e.provider,url:i==null?void 0:i.url},error:null}}catch(i){if(q(i))return{data:{provider:e.provider,url:null},error:i};throw i}}async unlinkIdentity(e){try{return await this._useSession(async t=>{var i,s;const{data:o,error:a}=t;if(a)throw a;return await G(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(i=o.session)===null||i===void 0?void 0:i.access_token)!==null&&s!==void 0?s:void 0})})}catch(t){if(q(t))return{data:null,error:t};throw t}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const i=Date.now();return await Oc(async s=>(s>
790&&await $c(200*Math.pow(2,s-1)),this._debug(t,"refreshing attempt",s),await G(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Ue})),(s,o)=>{const a=200*Math.pow(2,s);return o&&Br(o)&&Date.now()+a-i<ft})}catch(i){if(this._debug(t,"error",i),q(i))return{data:{session:null,user:null},error:i};throw i}finally{this._debug(t,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){const i=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",i),_e()&&!t.skipBrowserRedirect&&window.location.assign(i),{data:{provider:e,url:i},error:null}}async _recoverAndRefresh(){var e;const t="#_recoverAndRefresh()";this._debug(t,"begin");try{const i=await tr(this.storage,this.storageKey);if(this._debug(t,"session from storage",i),!this._isValidSession(i)){this._debug(t,"session is not valid"),i!==null&&await this._removeSession();return}const s=((e=i.expires_at)!==null&&e!==void 0?e:1/0)*1e3-Date.now()<zr;if(this._debug(t,`session has${s?"":" not"} expired with margin of ${zr}s`),s){if(this.autoRefreshToken&&i.refresh_token){const{error:o}=await this._callRefreshToken(i.refresh_token);o&&(console.error(o),Br(o)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",i)}catch(i){this._debug(t,"error",i),console.error(i);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,i;if(!e)throw new ze;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Ar;const{data:o,error:a}=await this._refreshAccessToken(e);if(a)throw a;if(!o.session)throw new ze;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const l={session:o.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(o){if(this._debug(s,"error",o),q(o)){const a={session:null,error:o};return Br(o)||await this._removeSession(),(t=this.refreshingDeferred)===null||t===void 0||t.resolve(a),a}throw(i=this.refreshingDeferred)===null||i===void 0||i.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,t,i=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",t,`broadcast = ${i}`);try{this.broadcastChannel&&i&&this.broadcastChannel.postMessage({event:e,session:t});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(e,t)}catch(d){o.push(d)}});if(await Promise.all(a),o.length>0){for(let l=0;l<o.length;l+=1)console.error(o[l]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await So(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),await rr(this.storage,this.storageKey),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&_e()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(t){console.error("removing visibilitychange callback failed",t)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),ft);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:i}}=t;if(!i||!i.refresh_token||!i.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((i.expires_at*1e3-e)/ft);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${ft}ms, refresh threshold is ${zn} ticks`),s<=zn&&await this._callRefreshToken(i.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Co)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!_e()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(
79await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t,i){const s=[`provider=${encodeURIComponent(t)}`];if(i!=null&&i.redirectTo&&s.push(`redirect_to=${encodeURIComponent(i.redirectTo)}`),i!=null&&i.scopes&&s.push(`scopes=${encodeURIComponent(i.scopes)}`),this.flowType==="pkce"){const[o,a]=await it(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(l.toString())}if(i!=null&&i.queryParams){const o=new URLSearchParams(i.queryParams);s.push(o.toString())}return i!=null&&i.skipBrowserRedirect&&s.push(`skip_http_redirect=${i.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var i;const{data:s,error:o}=t;return o?{data:null,error:o}:await G(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(i=s==null?void 0:s.session)===null||i===void 0?void 0:i.access_token})})}catch(t){if(q(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var i,s;const{data:o,error:a}=t;if(a)return{data:null,error:a};const l=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:{issuer:e.issuer}),{data:d,error:h}=await G(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(i=o==null?void 0:o.session)===null||i===void 0?void 0:i.access_token});return h?{data:null,error:h}:(e.factorType==="totp"&&(!((s=d==null?void 0:d.totp)===null||s===void 0)&&s.qr_code)&&(d.totp.qr_code=`data:image/svg+xml;utf-8,${d.totp.qr_code}`),{data:d,error:null})})}catch(t){if(q(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var i;const{data:s,error:o}=t;if(o)return{data:null,error:o};const{data:a,error:l}=await G(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(i=s==null?void 0:s.session)===null||i===void 0?void 0:i.access_token});return l?{data:null,error:l}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+a.expires_in},a)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",a),{data:a,error:l})})}catch(t){if(q(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var i;const{data:s,error:o}=t;return o?{data:null,error:o}:await G(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:{channel:e.channel},headers:this.headers,jwt:(i=s==null?void 0:s.session)===null||i===void 0?void 0:i.access_token})})}catch(t){if(q(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:i}=await this._challenge({factorId:e.factorId});return i?{data:null,error:i}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const i=(e==null?void 0:e.factors)||[],s=i.filter(a=>a.factor_type==="totp"&&a.status==="verified"),o=i.filter(a=>a.factor_type==="phone"&&a.status==="verified");return{data:{all:i,totp:s,phone:o},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,i;const{data:{session:s},error:o}=e;if(o)return{data:null,error:o};if(!s)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:a}=qr(s.access_token);let l=null;a.aal&&(l=a.aal);let d=l;((i=(t=s.user.factors)===null||t===void 0?void 0:t.filter(m=>m.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(d="aal2");const u=a.amr||[];return{data:{currentLevel:l,nextLevel:d,currentAuthenticationMethods:u},error:null}}))}async fetchJwk(e,t={keys:[]}){let i=t.keys.find(a=>a.kid===e);if(i||(i=this.jwks.keys.find(a=>a.kid===e),i&&this.jwks_cached_at+gc>Date.now()))return i;const{data:s,error:o}=await G(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;if(!s.keys||s.keys.length===0)throw new Ft("JWKS is empty");if(this.jwks=s,this.jwks_cached_at=Date.now(),i=s.keys.find(a=>a.kid===e),!i)throw new Ft("No matching signing key found in JWKS");return i}async getClaims(e,t={keys:[]}){try{let i=e;if(!i){const{data:g,error:v}
79=await this.getSession();if(v||!g.session)return{data:null,error:v};i=g.session.access_token}const{header:s,payload:o,signature:a,raw:{header:l,payload:d}}=qr(i);if(Lc(o.exp),!s.kid||s.alg==="HS256"||!("crypto"in globalThis&&"subtle"in globalThis.crypto)){const{error:g}=await this.getUser(i);if(g)throw g;return{data:{claims:o,header:s,signature:a},error:null}}const h=zc(s.alg),u=await this.fetchJwk(s.kid,t),m=await crypto.subtle.importKey("jwk",u,h,!0,["verify"]);if(!await crypto.subtle.verify(h,m,a,Cc(`${l}.${d}`)))throw new Ft("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(i){if(q(i))return{data:null,error:i};throw i}}}qt.nextInstanceID=0;const rd=qt;class nd extends rd{constructor(e){super(e)}}var id=function(r,e,t,i){function s(o){return o instanceof t?o:new t(function(a){a(o)})}return new(t||(t=Promise))(function(o,a){function l(u){try{h(i.next(u))}catch(m){a(m)}}function d(u){try{h(i.throw(u))}catch(m){a(m)}}function h(u){u.done?o(u.value):s(u.value).then(l,d)}h((i=i.apply(r,e||[])).next())})};class sd{constructor(e,t,i){var s,o,a;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const l=dc(e);this.realtimeUrl=`${l}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${l}/auth/v1`,this.storageUrl=`${l}/storage/v1`,this.functionsUrl=`${l}/functions/v1`;const d=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,h={db:rc,realtime:ic,auth:Object.assign(Object.assign({},nc),{storageKey:d}),global:tc},u=uc(i??{},h);this.storageKey=(s=u.auth.storageKey)!==null&&s!==void 0?s:"",this.headers=(o=u.global.headers)!==null&&o!==void 0?o:{},u.accessToken?(this.accessToken=u.accessToken,this.auth=new Proxy({},{get:(m,x)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(x)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((a=u.auth)!==null&&a!==void 0?a:{},this.headers,u.global.fetch),this.fetch=lc(t,this._getAccessToken.bind(this),u.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},u.realtime)),this.rest=new _l(`${l}/rest/v1`,{headers:this.headers,schema:u.db.schema,fetch:this.fetch}),u.accessToken||this._listenForAuthEvents()}get functions(){return new Za(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Ql(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},i={}){return this.rest.rpc(e,t,i)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return id(this,void 0,void 0,function*(){if(this.accessToken)return yield this.accessToken();const{data:i}=yield this.auth.getSession();return(t=(e=i.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:i,storage:s,storageKey:o,flowType:a,lock:l,debug:d},h,u){const m={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new nd({url:this.authUrl,headers:Object.assign(Object.assign({},m),h),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:i,storage:s,flowType:a,lock:l,debug:d,fetch:u,hasCustomAuthorizationHeader:"Authorization"in this.headers})}_initRealtimeClient(e){return new Fl(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,i)=>{this._handleTokenChanged(t,"CLIENT",i==null?void 0:i.access_token)})}_handleTokenChanged(e,t,i){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==i?this.changedAccessToken=i:e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Po=(r,e,t)=>new sd(r,e,t),F=Po("https://supabasekong-y8ggc40ckogo48g0kw0s0sc4.silicasites.com","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzQ3MTA4ODAwLCJleHAiOjE5MDQ4NzUyMDB9.FUfcRrtIcqCIxDaejxWm2T09XeinOLV8_DaKxRztdF8"),$=Po("https://supabasekong-y8ggc40ckogo48g0kw0s0sc4.silicasites.com","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UiLCJpYXQiOjE3NDcxMDg4MDAsImV4cCI6MTkwNDg3NTIwMH0.WYBpJmGpQggI64bCh31x0CHzxQmksJQDBt9CDCaDCro"),od=c.header` 80 position: fixed; 81 top: 0; 82 left: 0; 83 right: 0; 84 padding: 1rem 2rem; 85 background: var(--bg-color); 86 z-index: 1000; 87 display: flex; 88 justify-content: space-between; 89 align-items: center; 90 91 @media (max-width: 1024px) { 92 padding: 1rem; 93 } 94`,ad=c(ce)` 95 position: absolute; 96 left: 50%; 97 transform: translateX(-50%); 98 display: flex; 99 align-items: center; 100 gap: 0.5rem; 101 background: rgba(0, 0, 0, 0.5); 102 border: 2px solid var(--primary-color); 103 border-radius: 25px; 104 padding: 0.5rem 1.25rem; 105 color: white; 106 text-decoration: none; 107 font-weight: 500; 108 transition: all 0.3s ease; 109 110 &:hover {
111 background: rgba(227, 101, 39, 0.1); 112 } 113 114 span { 115 font-size: 1.2rem; 116 } 117 118 @media (max-width: 768px) { 119 display: none; 120 } 121`,ld=c(ce)` 122 display: flex; 123 align-items: center; 124 background: var(--primary-color); 125 border-radius: 25px; 126 padding: 0.5rem 1.25rem; 127 color: white; 128 text-decoration: none; 129 font-weight: 500; 130 transition: all 0.3s ease; 131 margin-left: 1.5rem; 132 133 &:hover { 134 background: #ff8c1a; 135 transform: translateY(-2px); 136 } 137 138 @media (max-width: 768px) { 139 margin-left: 1rem; 140 padding: 0.4rem 1rem; 141 font-size: 0.9rem; 142 } 143`,cd=c.div` 144 color: var(--primary-color); 145 font-size: 1.2rem; 146 font-weight: bold; 147`,dd=c(ce)` 148 display: none; 149 background: var(--primary-color); 150 color: white; 151 text-decoration: none; 152 padding: 1rem 2rem; 153 font-weight: 500; 154 width: 100%; 155 text-align: center; 156 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 157 158 @media (max-width: 1024px) { 159 display: block; 160 } 161 162 &:hover { 163 background: rgba(217, 91, 43, 0.8); 164 } 165`,ud=c.nav` 166 display: flex; 167 gap: 3rem; 168 align-items: center; 169 margin-right: 2rem; 170 171 @media (max-width: 1024px) { 172 position: fixed; 173 top: 72px; 174 left: 0; 175 right: 0; 176 background: rgba(0, 0, 0, 0.95); 177 flex-direction: column; 178 gap: 0; 179 padding: 0; 180 margin: 0; 181 transform: translateX(${r=>r.isOpen?"0":"-100%"}); 182 transition: transform 0.3s ease; 183 height: calc(100vh - 72px); 184 overflow-y: auto; 185 border-top: 1px solid rgba(255, 255, 255, 0.1); 186 } 187`,hd=c.div` 188 display: flex; 189 align-items: center; 190`,Wr=c.div` 191 position: relative; 192 193 &:last-child > ul { 194 right: auto; 195 left: 0; 196 transform: none; 197 } 198 199 &:hover > ul { 200 opacity: 1; 201 visibility: visible; 202 } 203 204 @media (max-width: 1024px) { 205 width: 100%; 206 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 207 208 &:hover > ul { 209 position: static; 210 opacity: 1; 211 visibility: visible; 212 background: transparent; 213 padding: 0; 214 margin: 0; 215 box-shadow: none; 216 } 217 } 218`,md=c.div` 219 color: white; 220 text-decoration: none; 221 font-size: 1.25rem; 222 font-weight: 500; 223 cursor: pointer; 224 transition: color 0.3s; 225 padding: 0.5rem 1rem; 226 227 &:hover { 228 color: var(--primary-color); 229 } 230 231 @media (max-width: 1024px) { 232 padding: 1rem 2rem; 233 font-size: 1rem; 234 } 235`,qi=c.div` 236 color: white; 237 text-decoration: none; 238 font-size: 1.25rem; 239 cursor: pointer; 240 transition: color 0.3s; 241 242 &:hover { 243 color: var(--primary-color); 244 } 245 246 &:last-child { 247 color: var(--primary-color); 248 } 249 250 @media (max-width: 1024px) { 251 display: block; 252 padding: 1rem 2rem; 253 font-size: 1rem; 254 } 255`,Hr=c.ul` 256 position: absolute; 257 top: 100%; 258 left: 0; 259 background: rgba(0, 0, 0, 0.95); 260 padding: 1rem 0; 261 margin-top: 1rem; 262 min-width: 220px; 263 opacity: 0; 264 visibility: hidden; 265 transition: all 0.3s; 266 list-style: none; 267 text-align: left; 268 269 li { 270 padding: 0.5rem 1.5rem; 271 white-space: nowrap; 272 273 a { 274 color: rgba(255, 255, 255, 0.7); 275 text-decoration: none; 276 font-size: 1rem; 277 transition: color 0.3s; 278 display: block; 279 280 &:hover { 281 color: var(--primary-color); 282 } 283 } 284 } 285 286 @media (max-width: 1024px) { 287 position: static; 288 background: rgba(0, 0, 0, 0.3); 289 padding: 0; 290 margin: 0; 291 min-width: 100%; 292 width: 100%; 293 left: 0; 294 opacity: ${r=>r.isVisible?1:0}; 295 visibility: ${r=>r.isVisible?"visible":"hidden"}; 296 max-height: ${r=>r.isVisible?"500px":"0"}; 297 overflow: hidden; 298 transition: all 0.3s ease; 299 300 li { 301 padding: 0; 302 background: rgba(0, 0, 0, 0.5); 303 width: 100%; 304 305 a { 306 padding: 0.75rem 3rem; 307 font-size: 0.95rem; 308 color: white; 309 opacity: 1; 310 width: 100%; 311 display: block; 312 313 &:hover { 314 color: var(--primary-color); 315 background: rgba(255, 255, 255, 0.1); 316 } 317 } 318 } 319 } 320`,fd=c.button` 321 display: none; 322 background: none; 323 border: none; 324 cursor: pointer; 325 padding: 0.5rem; 326 width: 30px; 327 height: 30px; 328 position: relative; 329 z-index: 1000; 330 331 @media (max-width: 1024px) { 332 display: block; 333 } 334 335 span { 336 display: block; 337 width: 24px; 338 height: 2px; 339 background: white; 340 position: absolute; 341 left: 3px; 342 transition: all 0.3s ease; 343 344 &:first-child { 345 top: ${r=>r.isOpen?"14px":"8px"}; 346 transform: ${r=>r.isOpen?"rotate(45deg)":"none"}; 347 } 348 349 &:nth-child(2) { 350 top: 14px; 351 opacity: ${r=>r.isOpen?"0":"1"}; 352 } 353 354 &:last-child { 355 top: ${r=>r.isOpen?"14px":"20px"}; 356 transform: ${r=>r.isOpen?"rotate(-45deg)":"none"}; 357 } 358 } 359`,je=c(ce)` 360 color: rgba(255, 255, 255, 0.7); 361 text-decoration: none; 362 font-size: 1rem; 363 transition: color 0.3s; 364 white-space: nowrap; 365 display: block; 366 367 &:hover { 368 color: var(--primary-color); 369 } 370`,pd=c.div` 371 position: relative; 372 display: flex; 373 align-items: center; 374 gap: 0.75rem; 375 background: rgba(255, 255, 255, 0.1); 376 border-radius: 25px; 377 padding: 0.5rem 1rem; 378 color: white; 379 cursor: pointer; 380 transition: all 0.3s ease; 381 margin-left: 1.5rem; 382 383 &:hover { 384 background: rgba(255, 255, 255, 0.15); 385 } 386`,gd=c.div` 387 width: 32px; 388 height: 32px; 389 border-radius: 50%; 390 background: var(--primary-color); 391 display: flex; 392 align-items: center; 393 justify-content: center; 394 font-weight: 600; 395 font-size: 1rem; 396`,xd=c.span` 397 font-size: 0.95rem; 398 font-weight: 500; 399`,Vr=c.div` 400 padding: 0.75rem 1rem; 401 color: ${r=>r.isPrimary?"var(--primary-color)":"rgba(255, 255, 255, 0.8)"}; 402 font-size: 0.9rem; 403 cursor: pointer; 404 border-radius: 4px; 405 transition: all 0.2s ease; 406 display: flex; 407 align-items: center; 408 gap: 0.5rem; 409 410 svg { 411 width: 16px; 412 height: 16px; 413 stroke: currentColor; 414 } 415 416 &:hover { 417 background: rgba(255, 255, 255, 0.1); 418 color: var(--primary-color); 419 } 420`,bd=c.div` 421 position: absolute; 422 top: calc(100% + 0.5rem); 423 right: 0; 424 background: rgba(0, 0, 0, 0.95); 425 border: 1px solid rgba(255, 255, 255, 0.1); 426 border-radius: 8px; 427 padding: 0.5rem; 428 min-width: 200px; 429 opacity: ${r=>r.isOpen?1:0}; 430 visibility: ${r=>r.isOpen?"visible":"hidden"}; 431 transform: translateY(${r=>r.isOpen?"0":"-10px"}); 432 transition: all 0.3s ease; 433 z-index: 1000; 434`,vd=()=>{const r=$e(),[e,t]=C.useState(null),[i,s]=C.useState(null),[o,a]=C.useState(!1),[l,d]=C.useState(!1),[h,u]=C.useState(null);C.useEffect(()=>{F.auth.getSession().then(({data:{session:y}})=>{y!=null&&y.user&&(t(y.user),m(y.user.id))});const{data:{subscription:b}}=F.auth.onAuthStateChange((y,S)=>{S!=null&&S.user?(t(S.user),m(S.user.id)):(t(null),s(null))});return()=>{b.unsubscribe()}},[]);const m=async b=>{const{data:y,error:S}=await F.from("profiles").select("*").eq("id",b).single();!S&&y&&s(y)},x=async()=>{await F.auth.signOut(),r("/"),a(!1),d(!1)},g=()=>i?`${i.first_name[0]}${i.last_name[0]}`.toUpperCase():"U",v=b=>{u(h===b?null:b)};return n.jsxs(od,{children:[n.jsx(ce,{to:"/",children:n.jsx(Ha,{})}),n.jsxs(ad,{to:"/hub",children:[n.jsx(cd,{children:"+"}),n.jsx("span",{children:"Hub"})]}),n.jsxs(hd,{children:[n.jsxs(fd,{isOpen:l,onClick:()=>d(!l),children:[n.jsx("span",{}),n.jsx("span",{}),n.jsx("span",{})]}),n.jsxs(ud,{isOpen:l,children:[e&&n.jsx(dd,{to:"/hub",onClick:()=>{d(!1),u(null)},children:"Hub"}),n.jsxs(Wr,{children:[n.jsx(md,{onClick:()=>v("services"),children:"Services"}),n.jsxs(Hr,{isVisible:h==="services",children:[n.jsx("li",{children:n.jsx(je,{to:"/projects/futuristic-world",onClick:()=>{d(!1),u(null)},children:"A Futuristic World"})}),n.jsx("li",{children:n.jsx(je,{to:"/projects/good-vibez",onClick:()=>{d(!1),u(null)},children:"Creating Good Vibez"})}),n.jsx("li",{children:n.jsx(je,{to:"/projects/building-character",onClick:()=>{d(!1),u(null)},children:"Building Character"})}),n.jsx("li",{children:n.jsx(je,{to:"/projects",onClick:()=>{d(!1),u(null)},children:"All Projects"})})]})]}),n.jsxs(Wr,{children:[n.jsx(qi,{onClick:()=>v("workWithUs"),children:"Work With Us"}),n.jsxs(Hr,{isVisible:h==="workWithUs",children:[n.jsx("li",{children:n.jsx(je,{to:"/who-we-are",onClick:()=>{d(!1),u(null)},children:"Who We Are"})}),n.jsx("li",{children:n.jsx(je,{to:"/what-we-do",onClick:()=>{d(!1),u(null)},children:"What We Do"})}),n.jsx("li",{children:n.jsx(je,{to:"/book-service",onClick:()=>{d(!1),u(null)},children:"How to Book a Service"})}),n.jsx("li",{children:n.jsx(je,{to:"/hub-registration",onClick:()=>{d(!1),u(null)},children:"Hub Registration"})})]})]}),n.jsxs(Wr,{children:[n.jsx(qi,{onClick:()=>v("dreamWithUs"),children:"Dream With Us"}),n.jsxs(Hr,{isVisible:h==="dreamWithUs",children:[n.jsx("li",{children:n.jsx(je,{to:"/join-community",onClick:()=>{d(!1),u(null)},children:"Join the Community"})}),n.jsx("li",{children:n.jsx(je,{to:"/download-portfolio",onClick:()=>{d(!1),u(null)},children:"Download Portfolio"})})]})]})]}),e?n.jsxs(pd,{onClick:()=>a(!o),children:[n.jsx(gd,{children:g()}),n.jsx(xd,{children:(i==null?void 0:i.first_name)||"User"}),n.jsxs(bd,{isOpen:o,children:[n.jsxs(Vr,{isPrimary:!0,onClick:()=>{r("/hub"),a(!1),d(!1)},children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),n.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),n.jsx("rect",{x:"3",y:"14",width:"7",height:"7"}),n.jsx("rect",{x:"14",y:"14",width:"7",height:"7"})]}),"Dashboard"]}),(i==null?void 0:i.is_admin)&&n.jsxs(Vr,{onClick:()=>{r("/admin"),a(!1),d(!1)},children:[n.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[n.jsx("path",{d:"M12 4L4 8l8 4 8-4-8-4z"}),n.jsx("path",{d:"M4 12l8 4 8-4"}),n.jsx("path",{d:"M4 16l8 4 8-4"})]}),"Admin Dashboard"]}),n.jsx(Vr,{onClick:x,children:"Logout"})]})]}):n.jsx(ld,{to:"/login",children:"Login"})]})]})};/*! 435 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com 436 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 437 * Copyright 2024 Fonticons, Inc. 438 */function yd(r,e,t){return(e=jd(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Wi(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function j(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
vendor: 5,609 bytes, line 438
438e%2?Wi(Object(t),!0).forEach(function(i){yd(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Wi(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function wd(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var i=t.call(r,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function jd(r){var e=wd(r,"string");return typeof e=="symbol"?e:e+""}const Hi=()=>{};let pi={},To={},Eo=null,Ao={mark:Hi,measure:Hi};try{typeof window<"u"&&(pi=window),typeof document<"u"&&(To=document),typeof MutationObserver<"u"&&(Eo=MutationObserver),typeof performance<"u"&&(Ao=performance)}catch{}const{userAgent:Vi=""}=pi.navigator||{},We=pi,re=To,Gi=Eo,nr=Ao;We.document;const Oe=!!re.documentElement&&!!re.head&&typeof re.addEventListener=="function"&&typeof re.createElement=="function",$o=~Vi.indexOf("MSIE")||~Vi.indexOf("Trident/");var _d=/fa(s|r|l|t|d|dr|dl|dt|b|k|kd|ss|sr|sl|st|sds|sdr|sdl|sdt)?[\-\ ]/,kd=/Font ?Awesome ?([56 ]*)(Solid|Regular|Light|Thin|Duotone|Brands|Free|Pro|Sharp Duotone|Sharp|Kit)?.*/i,Oo={classic:{fa:"solid",fas:"solid","fa-solid":"solid",far:"regular","fa-regular":"regular",fal:"light","fa-light":"light",fat:"thin","fa-thin":"thin",fab:"brands","fa-brands":"brands"},duotone:{fa:"solid",fad:"solid","fa-solid":"solid","fa-duotone":"solid",fadr:"regular","fa-regular":"regular",fadl:"light","fa-light":"light",fadt:"thin","fa-thin":"thin"},sharp:{fa:"solid",fass:"solid","fa-solid":"solid",fasr:"regular","fa-regular":"regular",fasl:"light","fa-light":"light",fast:"thin","fa-thin":"thin"},"sharp-duotone":{fa:"solid",fasds:"solid","fa-solid":"solid",fasdr:"regular","fa-regular":"regular",fasdl:"light","fa-light":"light",fasdt:"thin","fa-thin":"thin"}},Sd={GROUP:"duotone-group",PRIMARY:"primary",SECONDARY:"secondary"},Io=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],de="classic",$r="duotone",Cd="sharp",Pd="sharp-duotone",Do=[de,$r,Cd,Pd],Td={classic:{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},duotone:{900:"fad",400:"fadr",300:"fadl",100:"fadt"},sharp:{900:"fass",400:"fasr",300:"fasl",100:"fast"},"sharp-duotone":{900:"fasds",400:"fasdr",300:"fasdl",100:"fasdt"}},Ed={"Font Awesome 6 Free":{900:"fas",400:"far"},"Font Awesome 6 Pro":{900:"fas",400:"far",normal:"far",300:"fal",100:"fat"},"Font Awesome 6 Brands":{400:"fab",normal:"fab"},"Font Awesome 6 Duotone":{900:"fad",400:"fadr",normal:"fadr",300:"fadl",100:"fadt"},"Font Awesome 6 Sharp":{900:"fass",400:"fasr",normal:"fasr",300:"fasl",100:"fast"},"Font Awesome 6 Sharp Duotone":{900:"fasds",400:"fasdr",normal:"fasdr",300:"fasdl",100:"fasdt"}},Ad=new Map([["classic",{defaultShortPrefixId:"fas",defaultStyleId:"solid",styleIds:["solid","regular","light","thin","brands"],futureStyleIds:[],defaultFontWeight:900}],["sharp",{defaultShortPrefixId:"fass",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["duotone",{defaultShortPrefixId:"fad",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}],["sharp-duotone",{defaultShortPrefixId:"fasds",defaultStyleId:"solid",styleIds:["solid","regular","light","thin"],futureStyleIds:[],defaultFontWeight:900}]]),$d={classic:{solid:"fas",regular:"far",light:"fal",thin:"fat",brands:"fab"},duotone:{solid:"fad",regular:"fadr",light:"fadl",thin:"fadt"},sharp:{solid:"fass",regular:"fasr",light:"fasl",thin:"fast"},"sharp-duotone":{solid:"fasds",regular:"fasdr",light:"fasdl",thin:"fasdt"}},Od=["fak","fa-kit","fakd","fa-kit-duotone"],Yi={kit:{fak:"kit","fa-kit":"kit"},"kit-duotone":{fakd:"kit-duotone","fa-kit-duotone":"kit-duotone"}},Id=["kit"],Dd={kit:{"fa-kit":"fak"}},Md=["fak","fakd"],Rd={kit:{fak:"fa-kit"}},Ji={kit:{kit:"fak"},"kit-duotone":{"kit-duotone":"fakd"}},ir={GROUP:"duotone-group",SWAP_OPACITY:"swap-opacity",PRIMARY:"primary",SECONDARY:"secondary"},Nd=["fa-classic","fa-duotone","fa-sharp","fa-sharp-duotone"],Fd=["fak","fa-kit","fakd","fa-kit-duotone"],Ld={"Font Awesome Kit":{400:"fak",normal:"fak"},"Font Awesome Kit Duotone":{400:"fakd",normal:"fakd"}},zd={classic:{"fa-brands":"fab","fa-duotone":"fad","fa-light":"fal","fa-regular":"far","fa-solid":"fas","fa-thin":"fat"},duotone:{"fa-regular":"fadr","fa-light":"fadl","fa-thin":"fadt"},sharp:{"fa-solid":"fass","fa-regular":"fasr","fa-light":"fasl","fa-thin":"fast"},"sharp-duotone":{"fa-solid":"fasds","fa-regular":"fasdr","fa-light":"fasdl","fa-thin":"fasdt"}},Ud={classic:["fas","far","fal","fat","fad"],duotone:["fadr","fadl","fadt"],sharp:["fass","fasr","fasl","fast"],"sharp-duotone":["fasds","fasdr","fasdl","fasdt"]},qn={classic:{fab:"fa-brands",fad:"fa-duotone",fal:"fa-light",far:"fa-regular",fas:"fa-solid",fat:"fa-thin"},duotone:{fadr:"fa-regular",fadl:"fa-light",fadt:"fa-thin"},sharp:{fass:"fa-solid",fasr:"fa-regular",fasl:"fa-light",fast:"fa-thin"},"sharp-duotone":{fasds:"fa-solid",fasdr:"fa-regular",fasdl:"fa-light",fasdt:"fa-thin"}},Bd=["fa-solid","fa-regular","fa-light","fa-thin","fa-duotone","fa-brands"],Wn=["fa","fas","far","fal","fat","fad","fadr","fadl","fadt","fab","fass","fasr","fasl","fast","fasds","fasdr","fasdl","fasdt",...Nd,...Bd],qd=["solid","regular","light","thin","duotone","brands"],Mo=[1,2,3,4,5,6,7,8,9,10],Wd=Mo.concat([11,12,13,14,15,16,17,18,19,20]),Hd=[...Object.keys(Ud),...qd,"2xs","xs","sm","lg","xl","2xl","beat","border","fade","beat-fade","bounce","flip-both","flip-horizontal","flip-vert
438ical","flip","fw","inverse","layers-counter","layers-text","layers","li","pull-left","pull-right","pulse","rotate-180","rotate-270","rotate-90","rotate-by","shake","spin-pulse","spin-reverse","spin","stack-1x","stack-2x","stack","ul",ir.GROUP,ir.SWAP_OPACITY,ir.PRIMARY,ir.SECONDARY].concat(Mo.map(r=>"".concat(r,"x"))).concat(Wd.map(r=>"w-".concat(r))),Vd={"Font Awesome 5 Free":{900:"fas",400:"far"},"Font Awesome 5 Pro":{900:"fas",400:"far",normal:"far",300:"fal"},"Font Awesome 5 Brands":{400:"fab",normal:"fab"},"Font Awesome 5 Duotone":{900:"fad"}};const Ee="___FONT_AWESOME___",Hn=16,Ro="fa",No="svg-inline--fa",et="data-fa-i2svg",Vn="data-fa-pseudo-element",Gd="data-fa-pseudo-element-pending",gi="data-prefix",xi="data-icon",Ki="fontawesome-i2svg",Yd="async",Jd=["HTML","HEAD","STYLE","SCRIPT"],Fo=(()=>{try{return!0}catch{return!1}})();function Yt(r){return new Proxy(r,{get(e,t){return t in e?e[t]:e[de]}})}const Lo=j({},Oo);Lo[de]=j(j(j(j({},{"fa-duotone":"duotone"}),Oo[de]),Yi.kit),Yi["kit-duotone"]);const Kd=Yt(Lo),Gn=j({},$d);Gn[de]=j(j(j(j({},{duotone:"fad"}),Gn[de]),Ji.kit),Ji["kit-duotone"]);const Xi=Yt(Gn),Yn=j({},qn);Yn[de]=j(j({},Yn[de]),Rd.kit);const bi=Yt(Yn),Jn=j({},zd);Jn[de]=j(j({},Jn[de]),Dd.kit);Yt(Jn);const Xd=_d,zo="fa-layers-text",Qd=kd,Zd=j({},Td);Yt(Zd);const eu=["class","data-prefix","data-icon","data-fa-transform","data-fa-mask"],Gr=Sd,tu=[...Id,...Hd],zt=We.FontAwesomeConfig||{};function ru(r){var e=re.querySelector("script["+r+"]");if(e)return e.getAttribute(r)}function nu(r){return r===""?!0:r==="false"?!1:r==="true"?!0:r}re&&typeof re.querySelector=="function"&&[["data-family-prefix","familyPrefix"],["data-css-prefix","cssPrefix"],["data-family-default","familyDefault"],["data-style-default","styleDefault"],["data-replacement-class","replacementClass"],["data-auto-replace-svg","autoReplaceSvg"],["data-auto-add-css","autoAddCss"],["data-auto-a11y","autoA11y"],["data-search-pseudo-elements","searchPseudoElements"],["data-observe-mutations","observeMutations"],["data-mutate-approach","mutateApproach"],["data-keep-original-source","keepOriginalSource"],["data-measure-performance","measurePerformance"],["data-show-missing-icons","showMissingIcons"]].forEach(e=>{let[t,i]=e;const s=nu(ru(t));s!=null&&(zt[i]=s)});const Uo={styleDefault:"solid",familyDefault:de,cssPrefix:Ro,replacementClass:No,autoReplaceSvg:!0,autoAddCss:!0,autoA11y:!0,searchPseudoElements:!1,observeMutations:!0,mutateApproach:"async",keepOriginalSource:!0,measurePerformance:!1,showMissingIcons:!0};zt.familyPrefix&&(zt.cssPrefix=zt.familyPrefix);const wt=j(j({},Uo),zt);wt.autoReplaceSvg||(wt.observeMutations=!1);const A={};Object.keys(Uo).forEach(r=>{Object.defineProperty(A,r,{enumerable:!0,set:function(e){wt[r]=e,Ut.forEach(t=>t(A))},get:function(){return wt[r]}})});Object.defineProperty(A,"familyPrefix",{enumerable:!0,set:function(r){wt.cssPrefix=r,Ut.forEach(e=>e(A))},get:function(){return wt.cssPrefix}});We.FontAwesomeConfig=A;const Ut=[];function iu(r){return Ut.push(r),()=>{Ut.splice(Ut.indexOf(r),1)}}const De=Hn,Se={size:16,x:0,y:0,rotate:0,flipX:!1,flipY:!1};function su(r){if(!r||!Oe)return;const e=re.createElement("style");e.setAttribute("type","text/css"),e.innerHTML=r;const t=re.head.childNodes;let i=null;for(let s=t.length-1;s>-1;s--){const o=t[s],a=(o.tagName||"").toUpperCase();["STYLE","LINK"].indexOf(a)>-1&&(i=o)}return re.head.insertBefore(e,i),r}const ou="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function Wt(){let r=12,e="";for(;r-- >0;)e+=ou[Math.random()*62|0];return e}function kt(r){const e=[];for(let t=(r||[]).length>>>0;t--;)e[t]=r[t];return e}function vi(r){return r.classList?kt(r.classList):(r.getAttribute("class")||"").split(" ").filter(e=>e)}function Bo(r){return"".concat(r).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function au(r){return Object.keys(r||{}).reduce((e,t)=>e+"".concat(t,'="').concat(Bo(r[t]),'" '),"").trim()}function Or(r){return Object.keys(r||{}).reduce((e,t)=>e+"".concat(t,": ").concat(r[t].trim(),";"),"")}function yi(r){return r.size!==Se.size||r.x!==Se.x||r.y!==Se.y||r.rotate!==Se.rotate||r.flipX||r.flipY}function lu(r){let{transform:e,containerWidth:t,iconWidth:i}=r;const s={transform:"translate(".concat(t/2," 256)")},o="translate(".concat(e.x*32,", ").concat(e.y*32,") "),a="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),l="rotate(".concat(e.rotate," 0 0)"),d={transform:"".concat(o," ").concat(a," ").concat(l)},h={transform:"translate(".concat(i/2*-1," -256)")};return{outer:s,inner:d,path:h}}function cu(r){let{transform:e,width:t=Hn,height:i=Hn,startCentered:s=!1}=r,o="";return s&&$o?o+="translate(".concat(e.x/De-t/2,"em, ").concat(e.y/De-i/2,"em) "):s?o+="translate(calc(-50% + ".concat(e.x/De,"em), calc(-50% + ").concat(e.y/De,"em)) "):o+="translate(".concat(e.x/De,"em, ").concat(e.y/De,"em) "),o+="scale(".concat(e.size/De*(e.flipX?-1:1),", ").concat(e.size/De*(e.flipY?-1:1),") "),o+="rotate(".concat(e.rotate,"deg) "),o}var du=
vendor: 12,335 bytes, lines 438-991
438`:root, :host { 439 --fa-font-solid: normal 900 1em/1 "Font Awesome 6 Free"; 440 --fa-font-regular: normal 400 1em/1 "Font Awesome 6 Free"; 441 --fa-font-light: normal 300 1em/1 "Font Awesome 6 Pro"; 442 --fa-font-thin: normal 100 1em/1 "Font Awesome 6 Pro"; 443 --fa-font-duotone: normal 900 1em/1 "Font Awesome 6 Duotone"; 444 --fa-font-duotone-regular: normal 400 1em/1 "Font Awesome 6 Duotone"; 445 --fa-font-duotone-light: normal 300 1em/1 "Font Awesome 6 Duotone"; 446 --fa-font-duotone-thin: normal 100 1em/1 "Font Awesome 6 Duotone"; 447 --fa-font-brands: normal 400 1em/1 "Font Awesome 6 Brands"; 448 --fa-font-sharp-solid: normal 900 1em/1 "Font Awesome 6 Sharp"; 449 --fa-font-sharp-regular: normal 400 1em/1 "Font Awesome 6 Sharp"; 450 --fa-font-sharp-light: normal 300 1em/1 "Font Awesome 6 Sharp"; 451 --fa-font-sharp-thin: normal 100 1em/1 "Font Awesome 6 Sharp"; 452 --fa-font-sharp-duotone-solid: normal 900 1em/1 "Font Awesome 6 Sharp Duotone"; 453 --fa-font-sharp-duotone-regular: normal 400 1em/1 "Font Awesome 6 Sharp Duotone"; 454 --fa-font-sharp-duotone-light: normal 300 1em/1 "Font Awesome 6 Sharp Duotone"; 455 --fa-font-sharp-duotone-thin: normal 100 1em/1 "Font Awesome 6 Sharp Duotone"; 456} 457 458svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa { 459 overflow: visible; 460 box-sizing: content-box; 461} 462 463.svg-inline--fa { 464 display: var(--fa-display, inline-block); 465 height: 1em; 466 overflow: visible; 467 vertical-align: -0.125em; 468} 469.svg-inline--fa.fa-2xs { 470 vertical-align: 0.1em; 471} 472.svg-inline--fa.fa-xs { 473 vertical-align: 0em; 474} 475.svg-inline--fa.fa-sm { 476 vertical-align: -0.0714285705em; 477} 478.svg-inline--fa.fa-lg { 479 vertical-align: -0.2em; 480} 481.svg-inline--fa.fa-xl { 482 vertical-align: -0.25em; 483} 484.svg-inline--fa.fa-2xl { 485 vertical-align: -0.3125em; 486} 487.svg-inline--fa.fa-pull-left { 488 margin-right: var(--fa-pull-margin, 0.3em); 489 width: auto; 490} 491.svg-inline--fa.fa-pull-right { 492 margin-left: var(--fa-pull-margin, 0.3em); 493 width: auto; 494} 495.svg-inline--fa.fa-li { 496 width: var(--fa-li-width, 2em); 497 top: 0.25em; 498} 499.svg-inline--fa.fa-fw { 500 width: var(--fa-fw-width, 1.25em); 501} 502 503.fa-layers svg.svg-inline--fa { 504 bottom: 0; 505 left: 0; 506 margin: auto; 507 position: absolute; 508 right: 0; 509 top: 0; 510} 511 512.fa-layers-counter, .fa-layers-text { 513 display: inline-block; 514 position: absolute; 515 text-align: center; 516} 517 518.fa-layers { 519 display: inline-block; 520 height: 1em; 521 position: relative; 522 text-align: center; 523 vertical-align: -0.125em; 524 width: 1em; 525} 526.fa-layers svg.svg-inline--fa { 527 transform-origin: center center; 528} 529 530.fa-layers-text { 531 left: 50%; 532 top: 50%; 533 transform: translate(-50%, -50%); 534 transform-origin: center center; 535} 536 537.fa-layers-counter { 538 background-color: var(--fa-counter-background-color, #ff253a); 539 border-radius: var(--fa-counter-border-radius, 1em); 540 box-sizing: border-box; 541 color: var(--fa-inverse, #fff); 542 line-height: var(--fa-counter-line-height, 1); 543 max-width: var(--fa-counter-max-width, 5em); 544 min-width: var(--fa-counter-min-width, 1.5em); 545 overflow: hidden; 546 padding: var(--fa-counter-padding, 0.25em 0.5em); 547 right: var(--fa-right, 0); 548 text-overflow: ellipsis; 549 top: var(--fa-top, 0); 550 transform: scale(var(--fa-counter-scale, 0.25)); 551 transform-origin: top right; 552} 553 554.fa-layers-bottom-right { 555 bottom: var(--fa-bottom, 0); 556 right: var(--fa-right, 0); 557 top: auto; 558 transform: scale(var(--fa-layers-scale, 0.25)); 559 transform-origin: bottom right; 560} 561 562.fa-layers-bottom-left { 563 bottom: var(--fa-bottom, 0); 564 left: var(--fa-left, 0); 565 right: auto; 566 top: auto; 567 transform: scale(var(--fa-layers-scale, 0.25)); 568 transform-origin: bottom left; 569} 570 571.fa-layers-top-right { 572 top: var(--fa-top, 0); 573 right: var(--fa-right, 0); 574 transform: scale(var(--fa-layers-scale, 0.25)); 575 transform-origin: top right; 576} 577 578.fa-layers-top-left { 579 left: var(--fa-left, 0); 580 right: auto; 581 top: var(--fa-top, 0); 582 transform: scale(var(--fa-layers-scale, 0.25)); 583 transform-origin: top left; 584} 585 586.fa-1x { 587 font-size: 1em; 588} 589 590.fa-2x { 591 font-size: 2em; 592} 593 594.fa-3x { 595 font-size: 3em; 596} 597 598.fa-4x { 599 font-size: 4em; 600} 601 602.fa-5x { 603 font-size: 5em; 604} 605 606.fa-6x { 607 font-size: 6em; 608} 609 610.fa-7x { 611 font-size: 7em; 612} 613 614.fa-8x { 615 font-size: 8em; 616} 617 618.fa-9x { 619 font-size: 9em; 620} 621 622.fa-10x { 623 font-size: 10em; 624} 625 626.fa-2xs { 627 font-size: 0.625em; 628 line-height: 0.1em; 629 vertical-align: 0.225em; 630} 631 632.fa-xs { 633 font-size: 0.75em; 634 line-height: 0.0833333337em; 635 vertical-align: 0.125em; 636} 637 638.fa-sm { 639 font-size: 0.875em; 640 line-height: 0.0714285718em; 641 vertical-align: 0.0535714295em; 642} 643 644.fa-lg { 645 font-size: 1.25em; 646 line-height: 0.05em; 647 vertical-align: -0.075em; 648} 649 650.fa-xl { 651 font-size: 1.5em; 652 line-height: 0.0416666682em; 653 vertical-align: -0.125em; 654} 655 656.fa-2xl { 657 font-size: 2em; 658 line-height: 0.03125em; 659 vertical-align: -0.1875em; 660} 661 662.fa-fw { 663 text-align: center; 664 width: 1.25em; 665} 666 667.fa-ul { 668 list-style-type: none; 669 margin-left: var(--fa-li-margin, 2.5em); 670 padding-left: 0; 671} 672.fa-ul > li { 673 position: relative; 674} 675 676.fa-li { 677 left: calc(-1 * var(--fa-li-width, 2em)); 678 position: absolute; 679 text-align: center; 680 width: var(--fa-li-width, 2em); 681 line-height: inherit; 682} 683 684.fa-border { 685 border-color: var(--fa-border-color, #eee); 686 border-radius: var(--fa-border-radius, 0.1em); 687 border-style: var(--fa-border-style, solid); 688 border-width: var(--fa-border-width, 0.08em); 689 padding: var(--fa-border-padding, 0.2em 0.25em 0.15em); 690} 691 692.fa-pull-left { 693 float: left; 694 margin-right: var(--fa-pull-margin, 0.3em); 695} 696 697.fa-pull-right { 698 float: right; 699 margin-left: var(--fa-pull-margin, 0.3em); 700} 701 702.fa-beat { 703 animation-name: fa-beat; 704 animation-delay: var(--fa-animation-delay, 0s); 705 animation-direction: var(--fa-animation-direction, normal); 706 animation-duration: var(--fa-animation-duration, 1s); 707 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 708 animation-timing-function: var(--fa-animation-timing, ease-in-out); 709} 710 711.fa-bounce { 712 animation-name: fa-bounce; 713 animation-delay: var(--fa-animation-delay, 0s); 714 animation-direction: var(--fa-animation-direction, normal); 715 animation-duration: var(--fa-animation-duration, 1s); 716 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 717 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.28, 0.84, 0.42, 1)); 718} 719 720.fa-fade { 721 animation-name: fa-fade; 722 animation-delay: var(--fa-animation-delay, 0s); 723 animation-direction: var(--fa-animation-direction, normal); 724 animation-duration: var(--fa-animation-duration, 1s); 725 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 726 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 727} 728 729.fa-beat-fade { 730 animation-name: fa-beat-fade; 731 animation-delay: var(--fa-animation-delay, 0s); 732 animation-direction: var(--fa-animation-direction, normal); 733 animation-duration: var(--fa-animation-duration, 1s); 734 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 735 animation-timing-function: var(--fa-animation-timing, cubic-bezier(0.4, 0, 0.6, 1)); 736} 737 738.fa-flip { 739 animation-name: fa-flip; 740 animation-delay: var(--fa-animation-delay, 0s); 741 animation-direction: var(--fa-animation-direction, normal); 742 animation-duration: var(--fa-animation-duration, 1s); 743 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 744 animation-timing-function: var(--fa-animation-timing, ease-in-out); 745} 746 747.fa-shake { 748 animation-name: fa-shake; 749 animation-delay: var(--fa-animation-delay, 0s); 750 animation-direction: var(--fa-animation-direction, normal); 751 animation-duration: var(--fa-animation-duration, 1s); 752 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 753 animation-timing-function: var(--fa-animation-timing, linear); 754} 755 756.fa-spin { 757 animation-name: fa-spin; 758 animation-delay: var(--fa-animation-delay, 0s); 759 animation-direction: var(--fa-animation-direction, normal); 760 animation-duration: var(--fa-animation-duration, 2s); 761 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 762 animation-timing-function: var(--fa-animation-timing, linear); 763} 764 765.fa-spin-reverse { 766 --fa-animation-direction: reverse; 767} 768 769.fa-pulse, 770.fa-spin-pulse { 771 animation-name: fa-spin; 772 animation-direction: var(--fa-animation-direction, normal); 773 animation-duration: var(--fa-animation-duration, 1s); 774 animation-iteration-count: var(--fa-animation-iteration-count, infinite); 775 animation-timing-function: var(--fa-animation-timing, steps(8)); 776} 777 778@media (prefers-reduced-motion: reduce) { 779 .fa-beat, 780.fa-bounce, 781.fa-fade, 782.fa-beat-fade, 783.fa-flip, 784.fa-pulse, 785.fa-shake, 786.fa-spin, 787.fa-spin-pulse { 788 animation-delay: -1ms; 789 animation-duration: 1ms; 790 animation-iteration-count: 1; 791 transition-delay: 0s; 792 transition-duration: 0s; 793 } 794} 795@keyframes fa-beat { 796 0%, 90% { 797 transform: scale(1); 798 } 799 45% { 800 transform: scale(var(--fa-beat-scale, 1.25)); 801 } 802} 803@keyframes fa-bounce { 804 0% { 805 transform: scale(1, 1) translateY(0); 806 } 807 10% { 808 transform: scale(var(--fa-bounce-start-scale-x, 1.1), var(--fa-bounce-start-scale-y, 0.9)) translateY(0); 809 } 810 30% { 811 transform: scale(var(--fa-bounce-jump-scale-x, 0.9), var(--fa-bounce-jump-scale-y, 1.1)) translateY(var(--fa-bounce-height, -0.5em)); 812 } 813 50% { 814 transform: scale(var(--fa-bounce-land-scale-x, 1.05), var(--fa-bounce-land-scale-y, 0.95)) translateY(0); 815 } 816 57% { 817 transform: scale(1, 1) translateY(var(--fa-bounce-rebound, -0.125em)); 818 } 819 64% { 820 transform: scale(1, 1) translateY(0); 821 } 822 100% { 823 transform: scale(1, 1) translateY(0); 824 } 825} 826@keyframes fa-fade { 827 50% { 828 opacity: var(--fa-fade-opacity, 0.4); 829 } 830} 831@keyframes fa-beat-fade { 832 0%, 100% { 833 opacity: var(--fa-beat-fade-opacity, 0.4); 834 transform: scale(1); 835 } 836 50% { 837 opacity: 1; 838 transform: scale(var(--fa-beat-fade-scale, 1.125)); 839 } 840} 841@keyframes fa-flip { 842 50% { 843 transform: rotate3d(var(--fa-flip-x, 0), var(--fa-flip-y, 1), var(--fa-flip-z, 0), var(--fa-flip-angle, -180deg)); 844 } 845} 846@keyframes fa-shake { 847 0% { 848 transform: rotate(-15deg); 849 } 850 4% { 851 transform: rotate(15deg); 852 } 853 8%, 24% { 854 transform: rotate(-18deg); 855 } 856 12%, 28% { 857 transform: rotate(18deg); 858 } 859 16% { 860 transform: rotate(-22deg); 861 } 862 20% { 863 transform: rotate(22deg); 864 } 865 32% { 866 transform: rotate(-12deg); 867 } 868 36% { 869 transform: rotate(12deg); 870 } 871 40%, 100% { 872 transform: rotate(0deg); 873 } 874} 875@keyframes fa-spin { 876 0% { 877 transform: rotate(0deg); 878 } 879 100% { 880 transform: rotate(360deg); 881 } 882} 883.fa-rotate-90 { 884 transform: rotate(90deg); 885} 886 887.fa-rotate-180 { 888 transform: rotate(180deg); 889} 890 891.fa-rotate-270 { 892 transform: rotate(270deg); 893} 894 895.fa-flip-horizontal { 896 transform: scale(-1, 1); 897} 898 899.fa-flip-vertical { 900 transform: scale(1, -1); 901} 902 903.fa-flip-both, 904.fa-flip-horizontal.fa-flip-vertical { 905 transform: scale(-1, -1); 906} 907 908.fa-rotate-by { 909 transform: rotate(var(--fa-rotate-angle, 0)); 910} 911 912.fa-stack { 913 display: inline-block; 914 vertical-align: middle; 915 height: 2em; 916 position: relative; 917 width: 2.5em; 918} 919 920.fa-stack-1x, 921.fa-stack-2x { 922 bottom: 0; 923 left: 0; 924 margin: auto; 925 position: absolute; 926 right: 0; 927 top: 0; 928 z-index: var(--fa-stack-z-index, auto); 929} 930 931.svg-inline--fa.fa-stack-1x { 932 height: 1em; 933 width: 1.25em; 934} 935.svg-inline--fa.fa-stack-2x { 936 height: 2em; 937 width: 2.5em; 938} 939 940.fa-inverse { 941 color: var(--fa-inverse, #fff); 942} 943 944.sr-only, 945.fa-sr-only { 946 position: absolute; 947 width: 1px; 948 height: 1px; 949 padding: 0; 950 margin: -1px; 951 overflow: hidden; 952 clip: rect(0, 0, 0, 0); 953 white-space: nowrap; 954 border-width: 0; 955} 956 957.sr-only-focusable:not(:focus), 958.fa-sr-only-focusable:not(:focus) { 959 position: absolute; 960 width: 1px; 961 height: 1px; 962 padding: 0; 963 margin: -1px; 964 overflow: hidden; 965 clip: rect(0, 0, 0, 0); 966 white-space: nowrap; 967 border-width: 0; 968} 969 970.svg-inline--fa .fa-primary { 971 fill: var(--fa-primary-color, currentColor); 972 opacity: var(--fa-primary-opacity, 1); 973} 974 975.svg-inline--fa .fa-secondary { 976 fill: var(--fa-secondary-color, currentColor); 977 opacity: var(--fa-secondary-opacity, 0.4); 978} 979 980.svg-inline--fa.fa-swap-opacity .fa-primary { 981 opacity: var(--fa-secondary-opacity, 0.4); 982} 983 984.svg-inline--fa.fa-swap-opacity .fa-secondary { 985 opacity: var(--fa-primary-opacity, 1); 986} 987 988.svg-inline--fa mask .fa-primary, 989.svg-inline--fa mask .fa-secondary { 990 fill: black; 991}`;
991function qo(){const r=Ro,e=No,t=A.cssPrefix,i=A.replacementClass;let s=du;if(t!==r||i!==e){const o=new RegExp("\\.".concat(r,"\\-"),"g"),a=new RegExp("\\--".concat(r,"\\-"),"g"),l=new RegExp("\\.".concat(e),"g");s=s.replace(o,".".concat(t,"-")).replace(a,"--".concat(t,"-")).replace(l,".".concat(i))}return s}let Qi=!1;function Yr(){A.autoAddCss&&!Qi&&(su(qo()),Qi=!0)}var uu={mixout(){return{dom:{css:qo,insertCss:Yr}}},hooks(){return{beforeDOMElementCreation(){Yr()},beforeI2svg(){Yr()}}}};const Ae=We||{};Ae[Ee]||(Ae[Ee]={});Ae[Ee].styles||(Ae[Ee].styles={});Ae[Ee].hooks||(Ae[Ee].hooks={});Ae[Ee].shims||(Ae[Ee].shims=[]);var Ce=Ae[Ee];const Wo=[],Ho=function(){re.removeEventListener("DOMContentLoaded",Ho),vr=1,Wo.map(r=>r())};let vr=!1;Oe&&(vr=(re.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(re.readyState),vr||re.addEventListener("DOMContentLoaded",Ho));function hu(r){Oe&&(vr?setTimeout(r,0):Wo.push(r))}function Jt(r){const{tag:e,attributes:t={},children:i=[]}=r;return typeof r=="string"?Bo(r):"<".concat(e," ").concat(au(t),">").concat(i.map(Jt).join(""),"</").concat(e,">")}function Zi(r,e,t){if(r&&r[e]&&r[e][t])return{prefix:e,iconName:t,icon:r[e][t]}}var Jr=function(e,t,i,s){var o=Object.keys(e),a=o.length,l=t,d,h,u;for(i===void 0?(d=1,u=e[o[0]]):(d=0,u=i);d<a;d++)h=o[d],u=l(u,e[h],h,e);return u};function mu(r){const e=[];let t=0;const i=r.length;for(;t<i;){const s=r.charCodeAt(t++);if(s>=55296&&s<=56319&&t<i){const o=r.charCodeAt(t++);(o&64512)==56320?e.push(((s&1023)<<10)+(o&1023)+65536):(e.push(s),t--)}else e.push(s)}return e}function Kn(r){const e=mu(r);return e.length===1?e[0].toString(16):null}function fu(r,e){const t=r.length;let i=r.charCodeAt(e),s;return i>=55296&&i<=56319&&t>e+1&&(s=r.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function es(r){return Object.keys(r).reduce((e,t)=>{const i=r[t];return!!i.icon?e[i.iconName]=i.icon:e[t]=i,e},{})}function Xn(r,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:i=!1}=t,s=es(e);typeof Ce.hooks.addPack=="function"&&!i?Ce.hooks.addPack(r,es(e)):Ce.styles[r]=j(j({},Ce.styles[r]||{}),s),r==="fas"&&Xn("fa",e)}const{styles:Ht,shims:pu}=Ce,Vo=Object.keys(bi),gu=Vo.reduce((r,e)=>(r[e]=Object.keys(bi[e]),r),{});let wi=null,Go={},Yo={},Jo={},Ko={},Xo={};function xu(r){return~tu.indexOf(r)}function bu(r,e){const t=e.split("-"),i=t[0],s=t.slice(1).join("-");return i===r&&s!==""&&!xu(s)?s:null}const Qo=()=>{const r=i=>Jr(Ht,(s,o,a)=>(s[a]=Jr(o,i,{}),s),{});Go=r((i,s,o)=>(s[3]&&(i[s[3]]=o),s[2]&&s[2].filter(l=>typeof l=="number").forEach(l=>{i[l.toString(16)]=o}),i)),Yo=r((i,s,o)=>(i[o]=o,s[2]&&s[2].filter(l=>typeof l=="string").forEach(l=>{i[l]=o}
991),i)),Xo=r((i,s,o)=>{const a=s[2];return i[o]=o,a.forEach(l=>{i[l]=o}),i});const e="far"in Ht||A.autoFetchSvg,t=Jr(pu,(i,s)=>{const o=s[0];let a=s[1];const l=s[2];return a==="far"&&!e&&(a="fas"),typeof o=="string"&&(i.names[o]={prefix:a,iconName:l}),typeof o=="number"&&(i.unicodes[o.toString(16)]={prefix:a,iconName:l}),i},{names:{},unicodes:{}});Jo=t.names,Ko=t.unicodes,wi=Ir(A.styleDefault,{family:A.familyDefault})};iu(r=>{wi=Ir(r.styleDefault,{family:A.familyDefault})});Qo();function ji(r,e){return(Go[r]||{})[e]}function vu(r,e){return(Yo[r]||{})[e]}function Ze(r,e){return(Xo[r]||{})[e]}function Zo(r){return Jo[r]||{prefix:null,iconName:null}}function yu(r){const e=Ko[r],t=ji("fas",r);return e||(t?{prefix:"fas",iconName:t}:null)||{prefix:null,iconName:null}}function He(){return wi}const ea=()=>({prefix:null,iconName:null,rest:[]});function wu(r){let e=de;const t=Vo.reduce((i,s)=>(i[s]="".concat(A.cssPrefix,"-").concat(s),i),{});return Do.forEach(i=>{(r.includes(t[i])||r.some(s=>gu[i].includes(s)))&&(e=i)}),e}function Ir(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:t=de}=e,i=Kd[t][r];if(t===$r&&!r)return"fad";const s=Xi[t][r]||Xi[t][i],o=r in Ce.styles?r:null;return s||o||null}function ju(r){let e=[],t=null;return r.forEach(i=>{const s=bu(A.cssPrefix,i);s?t=s:i&&e.push(i)}),{iconName:t,rest:e}}function ts(r){return r.sort().filter((e,t,i)=>i.indexOf(e)===t)}function Dr(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:t=!1}=e;let i=null;const s=Wn.concat(Fd),o=ts(r.filter(m=>s.includes(m))),a=ts(r.filter(m=>!Wn.includes(m))),l=o.filter(m=>(i=m,!Io.includes(m))),[d=null]=l,h=wu(o),u=j(j({},ju(a)),{},{prefix:Ir(d,{family:h})});return j(j(j({},u),Cu({values:r,family:h,styles:Ht,config:A,canonical:u,givenPrefix:i})),_u(t,i,u))}function _u(r,e,t){let{prefix:i,iconName:s}=t;if(r||!i||!s)return{prefix:i,iconName:s};const o=e==="fa"?Zo(s):{},a=Ze(i,s);return s=o.iconName||a||s,i=o.prefix||i,i==="far"&&!Ht.far&&Ht.fas&&!A.autoFetchSvg&&(i="fas"),{prefix:i,iconName:s}}const ku=Do.filter(r=>r!==de||r!==$r),Su=Object.keys(qn).filter(r=>r!==de).map(r=>Object.keys(qn[r])).flat();function Cu(r){const{values:e,family:t,canonical:i,givenPrefix:s="",styles:o={},config:a={}}=r,l=t===$r,d=e.includes("fa-duotone")||e.includes("fad"),h=a.familyDefault==="duotone",u=i.prefix==="fad"||i.prefix==="fa-duotone";if(!l&&(d||h||u)&&(i.prefix="fad"),(e.includes("fa-brands")||e.includes("fab"))&&(i.prefix="fab"),!i.prefix&&ku.includes(t)&&(Object.keys(o).find(x=>Su.includes(x))||a.autoFetchSvg)){const x=Ad.get(t).defaultShortPrefixId;i.prefix=x,i.iconName=Ze(i.prefix,i.iconName)||i.iconName}return(i.prefix==="fa"||s==="fa")&&(i.prefix=He()||"fas"),i}class Pu{constructor(){this.definitions={}}add(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const s=t.reduce(this._pullDefinitions,{});Object.keys(s).forEach(o=>{this.definitions[o]=j(j({},this.definitions[o]||{}),s[o]),Xn(o,s[o]);const a=bi[de][o];a&&Xn(a,s[o]),Qo()})}reset(){this.definitions={}}_pullDefinitions(e,t){const i=t.prefix&&t.iconName&&t.icon?{0:t}:t;return Object.keys(i).map(s=>{const{prefix:o,iconName:a,icon:l}=i[s],d=l[2];e[o]||(e[o]={}),d.length>0&&d.forEach(h=>{typeof h=="string"&&(e[o][h]=l)}),e[o][a]=l}),e}}let rs=[],pt={};const bt={},Tu=Object.keys(bt);function Eu(r,e){let{mixoutsTo:t}=e;return rs=r,pt={},Object.keys(bt).forEach(i=>{Tu.indexOf(i)===-1&&delete bt[i]}),rs.forEach(i=>{const s=i.mixout?i.mixout():{};if(Object.keys(s).forEach(o=>{typeof s[o]=="function"&&(t[o]=s[o]),typeof s[o]=="object"&&Object.keys(s[o]).forEach(a=>{t[o]||(t[o]={}),t[o][a]=s[o][a]})}),i.hooks){const o=i.hooks();Object.keys(o).forEach(a=>{pt[a]||(pt[a]=[]),pt[a].push(o[a])})}i.provides&&i.provides(bt)}),t}function Qn(r,e){for(var t=arguments.length,i=new Array(t>2?t-2:0),s=2;s<t;s++)i[s-2]=arguments[s];return(pt[r]||[]).forEach(a=>{e=a.apply(null,[e,...i])}),e}function tt(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];(pt[r]||[]).forEach(o=>{o.apply(null,t)})}function Ve(){const r=arguments[0],e=Array.prototype.slice.call(arguments,1
991);return bt[r]?bt[r].apply(null,e):void 0}function Zn(r){r.prefix==="fa"&&(r.prefix="fas");let{iconName:e}=r;const t=r.prefix||He();if(e)return e=Ze(t,e)||e,Zi(ta.definitions,t,e)||Zi(Ce.styles,t,e)}const ta=new Pu,Au=()=>{A.autoReplaceSvg=!1,A.observeMutations=!1,tt("noAuto")},$u={i2svg:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Oe?(tt("beforeI2svg",r),Ve("pseudoElements2svg",r),Ve("i2svg",r)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e}=r;A.autoReplaceSvg===!1&&(A.autoReplaceSvg=!0),A.observeMutations=!0,hu(()=>{Iu({autoReplaceSvgRoot:e}),tt("watch",r)})}},Ou={icon:r=>{if(r===null)return null;if(typeof r=="object"&&r.prefix&&r.iconName)return{prefix:r.prefix,iconName:Ze(r.prefix,r.iconName)||r.iconName};if(Array.isArray(r)&&r.length===2){const e=r[1].indexOf("fa-")===0?r[1].slice(3):r[1],t=Ir(r[0]);return{prefix:t,iconName:Ze(t,e)||e}}if(typeof r=="string"&&(r.indexOf("".concat(A.cssPrefix,"-"))>-1||r.match(Xd))){const e=Dr(r.split(" "),{skipLookups:!0});return{prefix:e.prefix||He(),iconName:Ze(e.prefix,e.iconName)||e.iconName}}if(typeof r=="string"){const e=He();return{prefix:e,iconName:Ze(e,r)||r}}}},xe={noAuto:Au,config:A,dom:$u,parse:Ou,library:ta,findIconDefinition:Zn,toHtml:Jt},Iu=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:e=re}=r;(Object.keys(Ce.styles).length>0||A.autoFetchSvg)&&Oe&&A.autoReplaceSvg&&xe.dom.i2svg({node:e})};function Mr(r,e){return Object.defineProperty(r,"abstract",{get:e}),Object.defineProperty(r,"html",{get:function(){return r.abstract.map(t=>Jt(t))}}),Object.defineProperty(r,"node",{get:function(){if(!Oe)return;const t=re.createElement("div");return t.innerHTML=r.html,t.children}}),r}function Du(r){let{children:e,main:t,mask:i,attributes:s,styles:o,transform:a}=r;if(yi(a)&&t.found&&!i.found){const{width:l,height:d}=t,h={x:l/d/2,y:.5};s.style=Or(j(j({},o),{},{"transform-origin":"".concat(h.x+a.x/16,"em ").concat(h.y+a.y/16,"em")}))}return[{tag:"svg",attributes:s,children:e}]}function Mu(r){let{prefix:e,iconName:t,children:i,attributes:s,symbol:o}=r;const a=o===!0?"".concat(e,"-").concat(A.cssPrefix,"-").concat(t):o;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:j(j({},s),{},{id:a}),children:i}]}]}function _i(r){const{icons:{main:e,mask:t},prefix:i,iconName:s,transform:o,symbol:a,title:l,maskId:d,titleId:h,extra:u,watchable:m=!1}=r,{width:x,height:g}=t.found?t:e,v=Md.includes(i),b=[A.replacementClass,s?"".concat(A.cssPrefix,"-").concat(s):""].filter(z=>u.classes.indexOf(z)===-1).filter(z=>z!==""||!!z).concat(u.classes).join(" ");let y={children:[],attributes:j(j({},u.attributes),{},{"data-prefix":i,"data-icon":s,class:b,role:u.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(x," ").concat(g)})};const S=v&&!~u.classes.indexOf("fa-fw")?{width:"".concat(x/g*16*.0625,"em")}:{};m&&(y.attributes[et]=""),l&&(y.children.push({tag:"title",attributes:{id:y.attributes["aria-labelledby"]||"title-".concat(h||Wt())},children:[l]}),delete y.attributes.title);const R=j(j({},y),{},{prefix:i,iconName:s,main:e,mask:t,maskId:d,transform:o,symbol:a,styles:j(j({},S),u.styles)}),{children:L,attributes:B}=t.found&&e.found?Ve("generateAbstractMask",R)||{children:[],attributes:{}}:Ve("generateAbstractIcon",R)||{children:[],attributes:{}};return R.children=L,R.attributes=B,a?Mu(R):Du(R)}function ns(r){const{content:e,width:t,height:i,transform:s,title:o,extra:a,watchable:l=!1}=r,d=j(j(j({},a.attributes),o?{title:o}:{}),{},{class:a.classes.join(" ")});l&&(d[et]="");const h=j({},a.styles);yi(s)&&(h.transform=cu({transform:s,startCentered:!0,width:t,height:i}),h["-webkit-transform"]=h.transform);const u=Or(h);u.length>0&&(d.style=u);const m=[];return m.push({tag:"span",attributes:d,children:[e]}),o&&m.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),m}function Ru(r){const{content:e,title:t,extra:i}=r,s=j(j(j({},i.attributes),t?{title:t}:{}),{},{class:i.classes.join(" ")}),o=Or(i.styles);o.length>0&&(s.style=o);const a=[];return a.push({tag:"span",attributes:s,children:[e]}),t&&a.push({tag:"span",attributes:{class:"sr-only"},children:[t]}),a}const{styles:Kr}=Ce;function ei(r){const e=r[0],t=r[1],[i]=r.slice(4);let s=null;return Array.isArray(i)?s={tag:"g",attributes:{class:"".concat(A.cssPrefix,"-").concat(Gr.GROUP)},children:[{tag:"path",attributes:{class:"".concat(A.cssPrefix,"-").concat(Gr.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(A.cssPrefix,"-").concat(Gr.PRIMARY),fill:"currentColor",d:i[1]}}]}
991:s={tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:e,height:t,icon:s}}const Nu={found:!1,width:512,height:512};function Fu(r,e){!Fo&&!A.showMissingIcons&&r&&console.error('Icon with name "'.concat(r,'" and prefix "').concat(e,'" is missing.'))}function ti(r,e){let t=e;return e==="fa"&&A.styleDefault!==null&&(e=He()),new Promise((i,s)=>{if(t==="fa"){const o=Zo(r)||{};r=o.iconName||r,e=o.prefix||e}if(r&&e&&Kr[e]&&Kr[e][r]){const o=Kr[e][r];return i(ei(o))}Fu(r,e),i(j(j({},Nu),{},{icon:A.showMissingIcons&&r?Ve("missingIconAbstract")||{}:{}}))})}const is=()=>{},ri=A.measurePerformance&&nr&&nr.mark&&nr.measure?nr:{mark:is,measure:is},Mt='FA "6.7.2"',Lu=r=>(ri.mark("".concat(Mt," ").concat(r," begins")),()=>ra(r)),ra=r=>{ri.mark("".concat(Mt," ").concat(r," ends")),ri.measure("".concat(Mt," ").concat(r),"".concat(Mt," ").concat(r," begins"),"".concat(Mt," ").concat(r," ends"))};var ki={begin:Lu,end:ra};const pr=()=>{};function ss(r){return typeof(r.getAttribute?r.getAttribute(et):null)=="string"}function zu(r){const e=r.getAttribute?r.getAttribute(gi):null,t=r.getAttribute?r.getAttribute(xi):null;return e&&t}function Uu(r){return r&&r.classList&&r.classList.contains&&r.classList.contains(A.replacementClass)}function Bu(){return A.autoReplaceSvg===!0?gr.replace:gr[A.autoReplaceSvg]||gr.replace}function qu(r){return re.createElementNS("http://www.w3.org/2000/svg",r)}function Wu(r){return re.createElement(r)}function na(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:t=r.tag==="svg"?qu:Wu}=e;if(typeof r=="string")return re.createTextNode(r);const i=t(r.tag);return Object.keys(r.attributes||[]).forEach(function(o){i.setAttribute(o,r.attributes[o])}),(r.children||[]).forEach(function(o){i.appendChild(na(o,{ceFn:t}))}),i}function Hu(r){let e=" ".concat(r.outerHTML," ");return e="".concat(e,"Font Awesome fontawesome.com "),e}const gr={replace:function(r){const e=r[0];if(e.parentNode)if(r[1].forEach(t=>{e.parentNode.insertBefore(na(t),e)}),e.getAttribute(et)===null&&A.keepOriginalSource){let t=re.createComment(Hu(e));e.parentNode.replaceChild(t,e)}else e.remove()},nest:function(r){const e=r[0],t=r[1];if(~vi(e).indexOf(A.replacementClass))return gr.replace(r);const i=new RegExp("".concat(A.cssPrefix,"-.*"));if(delete t[0].attributes.id,t[0].attributes.class){const o=t[0].attributes.class.split(" ").reduce((a,l)=>(l===A.replacementClass||l.match(i)?a.toSvg.push(l):a.toNode.push(l),a),{toNode:[],toSvg:[]});t[0].attributes.class=o.toSvg.join(" "),o.toNode.length===0?e.removeAttribute("class"):e.setAttribute("class",o.toNode.join(" "))}const s=t.map(o=>Jt(o)).join(` 992`);e.setAttribute(et,""),e.innerHTML=s}};function os(r){r()}function ia(r,e){const t=typeof e=="function"?e:pr;if(r.length===0)t();else{let i=os;A.mutateApproach===Yd&&(i=We.requestAnimationFrame||os),i(()=>{const s=Bu(),o=ki.begin("mutate");r.map(s),o(),t()})}}let Si=!1;function sa(){Si=!0}function ni(){Si=!1}let yr=null;function as(r){if(!Gi||!A.observeMutations)return;const{treeCallback:e=pr,nodeCallback:t=pr,pseudoElementsCallback:i=pr,observeMutationsRoot:s=re}=r;yr=new Gi(o=>{if(Si)return;const a=He();kt(o).forEach(l=>{if(l.type==="childList"&&l.addedNodes.length>0&&!ss(l.addedNodes[0])&&(A.searchPseudoElements&&i(l.target),e(l.target)),l.type==="attributes"&&l.target.parentNode&&A.searchPseudoElements&&i(l.target.parentNode),l.type==="attributes"&&ss(l.target)&&~eu.indexOf(l.attributeName))if(l.attributeName==="class"&&zu(l.target)){const{prefix:d,iconName:h}=Dr(vi(l.target));l.target.setAttribute(gi,d||a),h&&l.target.setAttribute(xi,h)}else Uu(l.target)&&t(l.target)})}),Oe&&yr.observe(s,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function Vu(){yr&&yr.disconnect()}function Gu(r){const e=r.getAttribute("style");let t=[];return e&&(t=e.split(";").reduce((i,s)=>{const o=s.split(":"),a=o[0],l=o.slice(1);return a&&l.length>0&&(i[a]=l.join(":").trim()),i},{})),t}function Yu(r){const e=r.getAttribute("data-prefix"),t=r.getAttribute("data-icon"),i=r.innerText!==void 0?r.innerText.trim():"";let s=Dr(vi(r));return s.prefix||(s.prefix=He()),e&&t&&(s.prefix=e,s.iconName=t),s.iconName&&s.prefix||(s.prefix&&i.length>0&&(s.iconName=vu(s.prefix,r.innerText)||ji(s.prefix,Kn(r.innerText))),!s.iconName&&A.autoFetchSvg&&r.firstChild&&r.f
992irstChild.nodeType===Node.TEXT_NODE&&(s.iconName=r.firstChild.data)),s}function Ju(r){const e=kt(r.attributes).reduce((s,o)=>(s.name!=="class"&&s.name!=="style"&&(s[o.name]=o.value),s),{}),t=r.getAttribute("title"),i=r.getAttribute("data-fa-title-id");return A.autoA11y&&(t?e["aria-labelledby"]="".concat(A.replacementClass,"-title-").concat(i||Wt()):(e["aria-hidden"]="true",e.focusable="false")),e}function Ku(){return{iconName:null,title:null,titleId:null,prefix:null,transform:Se,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function ls(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:t,prefix:i,rest:s}=Yu(r),o=Ju(r),a=Qn("parseNodeAttributes",{},r);let l=e.styleParser?Gu(r):[];return j({iconName:t,title:r.getAttribute("title"),titleId:r.getAttribute("data-fa-title-id"),prefix:i,transform:Se,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:s,styles:l,attributes:o}},a)}const{styles:Xu}=Ce;function oa(r){const e=A.autoReplaceSvg==="nest"?ls(r,{styleParser:!1}):ls(r);return~e.extra.classes.indexOf(zo)?Ve("generateLayersText",r,e):Ve("generateSvgReplacementMutation",r,e)}function Qu(){return[...Od,...Wn]}function cs(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!Oe)return Promise.resolve();const t=re.documentElement.classList,i=u=>t.add("".concat(Ki,"-").concat(u)),s=u=>t.remove("".concat(Ki,"-").concat(u)),o=A.autoFetchSvg?Qu():Io.concat(Object.keys(Xu));o.includes("fa")||o.push("fa");const a=[".".concat(zo,":not([").concat(et,"])")].concat(o.map(u=>".".concat(u,":not([").concat(et,"])"))).join(", ");if(a.length===0)return Promise.resolve();let l=[];try{l=kt(r.querySelectorAll(a))}catch{}if(l.length>0)i("pending"),s("complete");else return Promise.resolve();const d=ki.begin("onTree"),h=l.reduce((u,m)=>{try{const x=oa(m);x&&u.push(x)}catch(x){Fo||x.name==="MissingIcon"&&console.error(x)}return u},[]);return new Promise((u,m)=>{Promise.all(h).then(x=>{ia(x,()=>{i("active"),i("complete"),s("pending"),typeof e=="function"&&e(),d(),u()})}).catch(x=>{d(),m(x)})})}function Zu(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;oa(r).then(t=>{t&&ia([t],e)})}function eh(r){return function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=(e||{}).icon?e:Zn(e||{});let{mask:s}=t;return s&&(s=(s||{}).icon?s:Zn(s||{})),r(i,j(j({},t),{},{mask:s}))}}const th=function(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=Se,symbol:i=!1,mask:s=null,maskId:o=null,title:a=null,titleId:l=null,classes:d=[],attributes:h={},styles:u={}}=e;if(!r)return;const{prefix:m,iconName:x,icon:g}=r;return Mr(j({type:"icon"},r),()=>(tt("beforeDOMElementCreation",{iconDefinition:r,params:e}),A.autoA11y&&(a?h["aria-labelledby"]="".concat(A.replacementClass,"-title-").concat(l||Wt()):(h["aria-hidden"]="true",h.focusable="false")),_i({icons:{main:ei(g),mask:s?ei(s.icon):{found:!1,width:null,height:null,icon:{}}},prefix:m,iconName:x,transform:j(j({},Se),t),symbol:i,title:a,maskId:o,titleId:l,extra:{attributes:h,styles:u,classes:d}})))};var rh={mixout(){return{icon:eh(th)}},hooks(){return{mutationObserverCallbacks(r){return r.treeCallback=cs,r.nodeCallback=Zu,r}}},provides(r){r.i2svg=function(e){const{node:t=re,callback:i=()=>{}}=e;return cs(t,i)},r.generateSvgReplacementMutation=function(e,t){const{iconName:i,title:s,titleId:o,prefix:a,transform:l,symbol:d,mask:h,maskId:u,extra:m}=t;return new Promise((x,g)=>{Promise.all([ti(i,a),h.iconName?ti(h.iconName,h.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(v=>{let[b,y]=v;x([e,_i({icons:{main:b,mask:y},prefix:a,iconName:i,transform:l,symbol:d,maskId:u,title:s,titleId:o,extra:m,watchable:!0})])}).catch(g)})},r.generateAbstractIcon=function(e){let{children:t,attributes:i,main:s,transform:o,styles:a}=e;const l=Or(a);l.length>0&&(i.style=l);let d;return yi(o)&&(d=Ve("generateAbstractTransformGrouping",{main:s,transform:o,containerWidth:s.width,iconWidth:s.width})),t.push(d||s.icon),{children:t,attributes:i}}}},nh={mixout(){return{layer(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:t=[]}=e;return Mr({type:"layer"},()=>{tt("beforeDOMElementCreation",{assembler:r,params:e});let i=[];return r(s=>{Array.isArray(s)?s.map(o=>{i=i.concat(o.abstract)}):i=i.concat(s.abstract)}),[{tag:"span",attributes:{class:["".concat(A.cssPrefix,"-layers"),...t].join(" ")},children:i}]})}}}},ih={mixout(){return{counter(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:t=null,classes:i=[],attributes:s={},styles:o={}}
992=e;return Mr({type:"counter",content:r},()=>(tt("beforeDOMElementCreation",{content:r,params:e}),Ru({content:r.toString(),title:t,extra:{attributes:s,styles:o,classes:["".concat(A.cssPrefix,"-layers-counter"),...i]}})))}}}},sh={mixout(){return{text(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:t=Se,title:i=null,classes:s=[],attributes:o={},styles:a={}}=e;return Mr({type:"text",content:r},()=>(tt("beforeDOMElementCreation",{content:r,params:e}),ns({content:r,transform:j(j({},Se),t),title:i,extra:{attributes:o,styles:a,classes:["".concat(A.cssPrefix,"-layers-text"),...s]}})))}}},provides(r){r.generateLayersText=function(e,t){const{title:i,transform:s,extra:o}=t;let a=null,l=null;if($o){const d=parseInt(getComputedStyle(e).fontSize,10),h=e.getBoundingClientRect();a=h.width/d,l=h.height/d}return A.autoA11y&&!i&&(o.attributes["aria-hidden"]="true"),Promise.resolve([e,ns({content:e.innerHTML,width:a,height:l,transform:s,title:i,extra:o,watchable:!0})])}}};const oh=new RegExp('"',"ug"),ds=[1105920,1112319],us=j(j(j(j({},{FontAwesome:{normal:"fas",400:"fas"}}),Ed),Vd),Ld),ii=Object.keys(us).reduce((r,e)=>(r[e.toLowerCase()]=us[e],r),{}),ah=Object.keys(ii).reduce((r,e)=>{const t=ii[e];return r[e]=t[900]||[...Object.entries(t)][0][1],r},{});function lh(r){const e=r.replace(oh,""),t=fu(e,0),i=t>=ds[0]&&t<=ds[1],s=e.length===2?e[0]===e[1]:!1;return{value:Kn(s?e[0]:e),isSecondary:i||s}}function ch(r,e){const t=r.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(e),s=isNaN(i)?"normal":i;return(ii[t]||{})[s]||ah[t]}function hs(r,e){const t="".concat(Gd).concat(e.replace(":","-"));return new Promise((i,s)=>{if(r.getAttribute(t)!==null)return i();const a=kt(r.children).filter(x=>x.getAttribute(Vn)===e)[0],l=We.getComputedStyle(r,e),d=l.getPropertyValue("font-family"),h=d.match(Qd),u=l.getPropertyValue("font-weight"),m=l.getPropertyValue("content");if(a&&!h)return r.removeChild(a),i();if(h&&m!=="none"&&m!==""){const x=l.getPropertyValue("content");let g=ch(d,u);const{value:v,isSecondary:b}=lh(x),y=h[0].startsWith("FontAwesome");let S=ji(g,v),R=S;if(y){const L=yu(v);L.iconName&&L.prefix&&(S=L.iconName,g=L.prefix)}if(S&&!b&&(!a||a.getAttribute(gi)!==g||a.getAttribute(xi)!==R)){r.setAttribute(t,R),a&&r.removeChild(a);const L=Ku(),{extra:B}=L;B.attributes[Vn]=e,ti(S,g).then(z=>{const ue=_i(j(j({},L),{},{icons:{main:z,mask:ea()},prefix:g,iconName:R,extra:B,watchable:!0})),I=re.createElementNS("http://www.w3.org/2000/svg","svg");e==="::before"?r.insertBefore(I,r.firstChild):r.appendChild(I),I.outerHTML=ue.map(M=>Jt(M)).join(` 993`),r.removeAttribute(t),i()}).catch(s)}else i()}else i()})}function dh(r){return Promise.all([hs(r,"::before"),hs(r,"::after")])}function uh(r){return r.parentNode!==document.head&&!~Jd.indexOf(r.tagName.toUpperCase())&&!r.getAttribute(Vn)&&(!r.parentNode||r.parentNode.tagName!=="svg")}function ms(r){if(Oe)return new Promise((e,t)=>{const i=kt(r.querySelectorAll("*")).filter(uh).map(dh),s=ki.begin("searchPseudoElements");sa(),Promise.all(i).then(()=>{s(),ni(),e()}).catch(()=>{s(),ni(),t()})})}var hh={hooks(){return{mutationObserverCallbacks(r){return r.pseudoElementsCallback=ms,r}}},provides(r){r.pseudoElements2svg=function(e){const{node:t=re}=e;A.searchPseudoElements&&ms(t)}}};let fs=!1;var mh={mixout(){return{dom:{unwatch(){sa(),fs=!0}}}},hooks(){return{bootstrap(){as(Qn("mutationObserverCallbacks",{}))},noAuto(){Vu()},watch(r){const{observeMutationsRoot:e}=r;fs?ni():as(Qn("mutationObserverCallbacks",{observeMutationsRoot:e}))}}}};const ps=r=>{let e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return r.toLowerCase().split(" ").reduce((t,i)=>{const s=i.toLowerCase().split("-"),o=s[0];let a=s.slice(1).join("-");if(o&&a==="h")return t.flipX=!0,t;if(o&&a==="v")return t.flipY=!0,t;if(a=parseFloat(a),isNaN(a))return t;switch(o){case"grow":t.size=t.size+a;break;case"shrink":t.size=t.size-a;break;case"left":t.x=t.x-a;break;case"right":t.x=t.x+a;break;case"up":t.y=t.y-a;break;case"down":t.y=t.y+a;break;case"rotate":t.rotate=t.rotate+a;break}return t},e)};var fh={mixout(){return{parse:{transform:r=>ps(r)}}},hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-transform");return t&&(r.transform=ps(t)),r}}},provides(r){r.generateAbstractTransformGrouping=function(e){let{main:t,transform:i,containerWidth:s,iconWidth:o}=e;const a={transform:"translate(".concat(s/2," 256)")},l="translate(".concat(i.x*32,", ").concat(i.y*32,") "),d="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),h="rotate(".concat(i.rotate," 0 0)"),u={transform:"".concat(l," ").concat(d," ").concat(h)},m={transform:"translate(".concat(o/2*-1," -256)")},x={outer:a,inner:u,path:m};return{tag:"g",attributes:j({},x.outer),children:[{tag:"g",attributes:j({},x.inner),children:[{tag:t.icon.tag,children:t.icon.children,attributes:j(j({},t.icon.attributes),x.path)}]}]}}}};const Xr={x:0,y:0,width:"100%",height:"100%"};function gs(r){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return r.attributes&&(r.attributes.fill||e)&&(r.attributes.fill="black"),r}function ph(r){return r.tag==="g"?r.children:[r]}var gh={hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-mask"),i=t?Dr(t.split(" ").map(s=>s.trim())):ea();return i.prefix||(i.prefix=He()),r.mask=i,r.maskId=e.getAttribute("data-fa-mask-id"),r}}},provides(r){r.generateAbstractMask=function(e){let{children:t,attributes:i,main:s,mask:o,maskId:a,transform:l}=e;const{width:d,icon:h}=s,{width:u,icon:m}=o,x=lu({transform:l,containerWidth:u,iconWidth:d}),g={tag:"rect",attributes:j(j({},Xr),{},{fill:"white"})},v=h.children?{children:h.children.map(gs)}:{},b={tag:"g",attributes:j({},x.inner),children:[gs(j({tag:h.tag,attributes:j(j({},h.attributes),x.path)},v))]},y={tag:"g",attributes:j({},x.outer),children:[b]},S="mask-".concat(a||Wt()),R="clip-".concat(a||Wt()),L={tag:"mask",attributes:j(j({},Xr),{},{id:S,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[g,y]},B={tag:"defs",children:[{tag:"clipPath",attributes:{id:R},children:ph(m)},L]};
993return t.push(B,{tag:"rect",attributes:j({fill:"currentColor","clip-path":"url(#".concat(R,")"),mask:"url(#".concat(S,")")},Xr)}),{children:t,attributes:i}}}},xh={provides(r){let e=!1;We.matchMedia&&(e=We.matchMedia("(prefers-reduced-motion: reduce)").matches),r.missingIconAbstract=function(){const t=[],i={fill:"currentColor"},s={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};t.push({tag:"path",attributes:j(j({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const o=j(j({},s),{},{attributeName:"opacity"}),a={tag:"circle",attributes:j(j({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return e||a.children.push({tag:"animate",attributes:j(j({},s),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:j(j({},o),{},{values:"1;0;1;1;0;1;"})}),t.push(a),t.push({tag:"path",attributes:j(j({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:e?[]:[{tag:"animate",attributes:j(j({},o),{},{values:"1;0;0;0;0;1;"})}]}),e||t.push({tag:"path",attributes:j(j({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:j(j({},o),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:t}}}},bh={hooks(){return{parseNodeAttributes(r,e){const t=e.getAttribute("data-fa-symbol"),i=t===null?!1:t===""?!0:t;return r.symbol=i,r}}}},vh=[uu,rh,nh,ih,sh,hh,mh,fh,gh,xh,bh];Eu(vh,{mixoutsTo:xe});xe.noAuto;xe.config;xe.library;xe.dom;const si=xe.parse;xe.findIconDefinition;xe.toHtml;const yh=xe.icon;xe.layer;xe.text;xe.counter;var aa={exports:{}},wh="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",jh=wh,_h=jh;function la(){}function ca(){}ca.resetWarningCache=la;var kh=function(){function r(i,s,o,a,l,d){if(d!==_h){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function e(){return r}var t={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:e,element:r,elementType:r,instanceOf:e,node:r,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:ca,resetWarningCache:la};return t.PropTypes=t,t};aa.exports=kh();var Sh=aa.exports;const V=Aa(Sh);function xs(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(r,s).enumerable})),t.push.apply(t,i)}return t}function ke(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
993e%2?xs(Object(t),!0).forEach(function(i){gt(r,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):xs(Object(t)).forEach(function(i){Object.defineProperty(r,i,Object.getOwnPropertyDescriptor(t,i))})}return r}function wr(r){"@babel/helpers - typeof";return wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(r)}function gt(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Ch(r,e){if(r==null)return{};var t={},i=Object.keys(r),s,o;for(o=0;o<i.length;o++)s=i[o],!(e.indexOf(s)>=0)&&(t[s]=r[s]);return t}function Ph(r,e){if(r==null)return{};var t=Ch(r,e),i,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(s=0;s<o.length;s++)i=o[s],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(r,i)&&(t[i]=r[i])}return t}function oi(r){return Th(r)||Eh(r)||Ah(r)||$h()}function Th(r){if(Array.isArray(r))return ai(r)}function Eh(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Ah(r,e){if(r){if(typeof r=="string")return ai(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ai(r,e)}}function ai(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,i=new Array(e);t<e;t++)i[t]=r[t];return i}function $h(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 994In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oh(r){var e,t=r.beat,i=r.fade,s=r.beatFade,o=r.bounce,a=r.shake,l=r.flash,d=r.spin,h=r.spinPulse,u=r.spinReverse,m=r.pulse,x=r.fixedWidth,g=r.inverse,v=r.border,b=r.listItem,y=r.flip,S=r.size,R=r.rotation,L=r.pull,B=(e={"fa-beat":t,"fa-fade":i,"fa-beat-fade":s,"fa-bounce":o,"fa-shake":a,"fa-flash":l,"fa-spin":d,"fa-spin-reverse":u,"fa-spin-pulse":h,"fa-pulse":m,"fa-fw":x,"fa-inverse":g,"fa-border":v,"fa-li":b,"fa-flip":y===!0,"fa-flip-horizontal":y==="horizontal"||y==="both","fa-flip-vertical":y==="vertical"||y==="both"},gt(e,"fa-".concat(S),typeof S<"u"&&S!==null),gt(e,"fa-rotate-".concat(R),typeof R<"u"&&R!==null&&R!==0),gt(e,"fa-pull-".concat(L),typeof L<"u"&&L!==null),gt(e,"fa-swap-opacity",r.swapOpacity),e);return Object.keys(B).map(function(z){return B[z]?z:null}).filter(function(z){return z})}function Ih(r){return r=r-0,r===r}function da(r){return Ih(r)?r:(r=r.replace(/[\-_\s]+(.)?/g,function(e,t){return t?t.toUpperCase():""}),r.substr(0,1).toLowerCase()+r.substr(1))}var Dh=["style"];function Mh(r){return r.charAt(0).toUpperCase()+r.slice(1)}function Rh(r){return r.split(";").map(function(e){return e.trim()}).filter(function(e){return e}).reduce(function(e,t){var i=t.indexOf(":"),s=da(t.slice(0,i)),o=t.slice(i+1).trim();return s.startsWith("webkit")?e[Mh(s)]=o:e[s]=o,e},{})}function ua(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof e=="string")return e;var i=(e.children||[]).map(function(d){return ua(r,d)}),s=Object.keys(e.attributes||{}).reduce(function(d,h){var u=e.attributes[h];switch(h){case"class":d.attrs.className=u,delete e.attributes.class;break;case"style":d.attrs.style=Rh(u);break;default:h.indexOf("aria-")===0||h.indexOf("data-")===0?d.attrs[h.toLowerCase()]=u:d.attrs[da(h)]=u}return d},{attrs:{}}),o=t.style,a=o===void 0?{}:o,l=Ph(t,Dh);return s.attrs.style=ke(ke({},s.attrs.style),a),r.apply(void 0,[e.tag,ke(ke({},s.attrs),l)].concat(oi(i)))}var ha=!1;try{ha=!0}catch{}function Nh(){if(!ha&&console&&typeof console.error=="function"){var r;(r=console).error.apply(r,arguments)}}function bs(r){if(r&&wr(r)==="object"&&r.prefix&&r.iconName&&r.icon)return r;if(si.icon)return si.icon(r);if(r===null)return null;if(r&&wr(r)==="object"&&r.prefix&&r.iconName)return r;if(Array.isArray(r)&&r.length===2)return{prefix:r[0],iconName:r[1]};if(typeof r=="string")return{prefix:"fas",iconName:r}}function Qr(r,e){return Array.isArray(e)&&e.length>0||!Array.isArray(e)&&e?gt({},r,e):{}}var vs={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1},Bt=jr.forwardRef(function(r,e){var t=ke(ke({},vs),r),i=t.icon,s=t.mask,o=t.symbol,a=t.className,l=t.title,d=t.titleId,h=t.maskId,u=bs(i),m=Qr("classes",[].concat(oi(Oh(t)),oi((a||"").split(" ")))),x=Qr("transform",typeof t.transform=="string"?si.transform(t.transform):t.transform),g=Qr("mask",bs(s)),v=yh(u,ke(ke(ke(ke({},m),x),g),{},{symbol:o,title:l,titleId:d,maskId:h}));if(!v)return Nh("Could not find icon",u),null;var b=v.abstract,y={ref:e};return Object.keys(t).forEach(function(S){vs.hasOwnProperty(S)||(y[S]=t[S])}),Fh(b[0],y)});Bt.displayName="FontAwesomeIcon";Bt.propTypes={beat:V.bool,border:V.bool,beatFade:V.bool,bounce:V.bool,className:V.string,fade:V.bool,flash:V.bool,mask:V.oneOfType([
994V.object,V.array,V.string]),maskId:V.string,fixedWidth:V.bool,inverse:V.bool,flip:V.oneOf([!0,!1,"horizontal","vertical","both"]),icon:V.oneOfType([V.object,V.array,V.string]),listItem:V.bool,pull:V.oneOf(["right","left"]),pulse:V.bool,rotation:V.oneOf([0,90,180,270]),shake:V.bool,size:V.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:V.bool,spinPulse:V.bool,spinReverse:V.bool,symbol:V.oneOfType([V.bool,V.string]),title:V.string,titleId:V.string,transform:V.oneOfType([V.string,V.object]),swapOpacity:V.bool};var Fh=ua.bind(null,jr.createElement);/*! 995 * Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com 996 * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) 997 * Copyright 2024 Fonticons, Inc. 998 */const Lh={prefix:"fab",iconName:"linkedin-in",icon:[448,512,[],"f0e1","M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"]},zh={prefix:"fab",iconName:"facebook-f",icon:[320,512,[],"f39e","M80 299.3V512H196V299.3h86.5l18-97.8H196V166.9c0-51.7 20.3-71.5 72.7-71.5c16.3 0 29.4 .4 37 1.2V7.9C291.4 4 256.4 0 236.2 0C129.3 0 80 50.5 80 159.4v42.1H14v97.8H80z"]},Uh={prefix:"fab",iconName:"twitter",icon:[512,512,[],"f099","M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"]},Bh=c.footer` 999 background-color: var(--bg-color); 1000 padding: 5rem 0 3rem; 1001 color: var(--text-color); 1002 margin-top: 5rem; 1003 1004 @media (max-width: 768px) { 1005 padding: 3rem 0 2rem; 1006 margin-top: 3rem; 1007 } 1008`,qh=c.div` 1009 max-width: 1200px; 1010 margin: 0 auto; 1011 display: grid; 1012 grid-template-columns: repeat(3, 1fr); 1013 gap: 2rem; 1014 padding: 0 2rem; 1015 1016 @media (max-width: 768px) { 1017 grid-template-columns: 1fr; 1018 gap: 3rem; 1019 padding: 0 1rem; 1020 text-align: center; 1021 } 1022`,Zr=c.div` 1023 h3 { 1024 color: var(--text-color); 1025 font-size: 1.5rem; 1026 margin-bottom: 2rem; 1027 text-transform: uppercase; 1028 font-weight: 600; 1029 1030 @media (max-width: 768px) { 1031 font-size: 1.25rem; 1032 margin-bottom: 1.5rem; 1033 } 1034 } 1035 1036 p { 1037 color: rgba(255, 255, 255, 0.7); 1038 font-size: 1.125rem; 1039 margin-bottom: 1rem; 1040 line-height: 1.4; 1041 1042 @media (max-width: 768px) { 1043 font-size: 1rem; 1044 margin-bottom: 0.75rem; 1045 } 1046 } 1047 1048 a { 1049 color: rgba(255, 255, 255, 0.7); 1050 text-decoration: none; 1051 transition: color 0.3s; 1052 1053 &:hover { 1054 color: var(--primary-color); 1055 } 1056 } 1057`,Wh=c.div` 1058 display: flex; 1059 gap: 2rem; 1060 margin-top: 3rem; 1061 1062 @media (max-width: 768px) { 1063 justify-content: center; 1064 margin-top: 2rem; 1065 gap: 1.5rem; 1066 } 1067 1068 a { 1069 width: 40px; 1070 height: 40px; 1071 border-radius: 50%; 1072 border: 1px solid rgba(255, 255, 255, 0.3); 1073 display: flex; 1074 align-items: center; 1075 justify-content: center; 1076 transition: all 0.3s; 1077 color: rgba(255, 255, 255, 0.7); 1078 1079 @media (max-width: 768px) { 1080 width: 36px; 1081 height: 36px; 1082 } 1083 1084 &:hover { 1085 border-color: var(--primary-color); 1086 color: var(--primary-color); 1087 } 1088 1089 svg { 1090 font-size: 1.125rem; 1091 1092 @media (max-width: 768px) { 1093 font-size: 1rem; 1094 } 1095 } 1096 } 1097`,Hh=c.form` 1098 display: flex; 1099 gap: 1rem; 1100 margin-top: 1.5rem; 1101 1102 @media (max-width: 768px) { 1103 flex-direction: column; 1104 gap: 0.75rem; 1105 max-width: 300px; 1106 margin: 1.5rem auto 0; 1107 } 1108 1109 input { 1110 flex: 1; 1111 padding: 0.75rem 1rem; 1112 border: 1px solid rgba(255, 255, 255, 0.2); 1113 border-radius: 4px; 1114 background: transparent; 1115 color: white; 1116 font-size: 1rem; 1117 1118 &::placeholder { 1119 color: rgba(255, 255, 255, 0.5); 1120 } 1121 1122 &:focus { 1123 outline: none; 1124 border-color: var(--primary-color); 1125 } 1126 1127 @media (max-width: 768px) { 1128 width: 100%; 1129 padding: 0.75rem; 1130 } 1131 } 1132 1133 button { 1134 padding: 0.75rem 1.5rem; 1135 background-color: var(--primary-color); 1136 color: white; 1137 border: none; 1138 border-radius: 4px; 1139 font-size: 1rem; 1140 cursor: pointer; 1141 transition: background-color 0.3s; 1142 1143 &:hover { 1144 background-color: #ff5733; 1145 } 1146 1147 @media (max-width: 768px) { 1148 width: 100%; 1149 padding: 0.75rem; 1150 } 1151 } 1152`,Vh=c.a` 1153 display: inline-block; 1154 margin-top: 2rem; 1155 padding: 0.75rem 2rem; 1156 border: 1px solid var(--primary-color); 1157 border-radius: 4px; 1158 color: white; 1159 text-transform: uppercase; 1160 font-size: 1rem; 1161 text-decoration: none; 1162 transition: all 0.3s; 1163 1164 @media (max-width: 768px) { 1165 display: block; 1166 text-align: center; 1167 margin: 2rem auto 0; 1168 max-width: 300px; 1169 } 1170 1171 &:hover { 1172 background-color: var(--primary-color); 1173 } 1174`,Gh=()=>{const r=e=>{e.preventDefault();const t=document.createElement("a");t.href="/downloads/MM-Portfolio-2022.pdf",t.download="MediaMill-Portfolio-2022.pdf",document.body.appendChild(t),t.click(),document.body.removeChild(t)};return n.jsx(Bh,{children:n.jsxs(qh,{children:[n.jsxs(Zr,{children:[n.jsx("h3",{children:"Visit Us"}),n.jsx("p",{children:"75A Saddle Road Maraval"}),n.jsx("p",{children:"+1 868-622-4647"}),n.jsx("p",{children:"[email protected]"}),n.jsx("p",{children:n.jsx("a",{href:"#",onClick:r,children:"Company Portfolio 2022"})}),n.jsxs(Wh,{children:[n.jsx("a",{href:"#","aria-label":"Facebook",children:n.jsx(Bt,{icon:zh})}),n.jsx("a",{href:"#","aria-label":"Twitter",children:n.jsx(Bt,{icon:Uh})}),n.jsx("a",{href:"#","aria-label":"LinkedIn",children:n.jsx(Bt,{icon:Lh})})]})]}),n.jsxs(Zr,{children:[n.jsx("h3",{children:"Opening Hours"}),n.jsx("p",{children:"Monday - Friday:"}),n.jsx("p",{children:"9:00AM - 5:00PM"}),n.jsx(Vh,{href:"#",children:"Submit a Ticket"})]}),n.jsxs(Zr,{children:[n.jsx("h3",{children:"Join The Newsletter"}),n.jsx("p",{children:"Get updates on the latest news."}),n.jsxs(Hh,{children:[n.jsx("input",{type:"email",placeholder:"Email"}),n.jsx("button",{type:"submit",children:"Subscribe"})]})]})]})})},Yh=()=>{const{pathname:r}=Zs();return C.useEffect(()=>{window.scrollTo(0,0)},[r]),null},sr=({children:r})=>{const[e,t]=C.useState(null),[i,s]=C.useState(!0);C.useEffect(()=>{o()},[]);const o=async()=>{try{const{data:{session:a}}=await F.auth.getSession();if(!a){t(!1),s(!1);return}const{data:l}=await F.from("profiles").select("is_admin").eq("id",a.user.id).single();t(!!(l!=null&&l.is_admin)),s(!1)}catch(a){console.error("Error checking admin access:",a),t(!1),s(!1)}};return i?n.jsx("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",color:"white",background:"var(--bg-color)"},children:"Loading..."}):e?n.jsx(n.Fragment,{children:r}):n.jsx($a,{to:"/hub",replace:!0})},Jh=c.section` 1175 min-height: 100vh; 1176 display: flex; 1177 flex-direction: column; 1178 justify-content: flex-start; 1179 align-items: center; 1180 padding: 0; 1181 position: relative; 1182 width: 100%; 1183 overflow: hidden; 1184 padding-top: 72px; 1185 1186 @media (max-width: 768px) { 1187 padding: 72px 0 0; 1188 } 1189`,Kh=c.div` 1190 width: 100%; 1191 max-width: 1400px; 1192 margin: 0 auto; 1193 margin-top: 10vh; 1194 padding: 0 4rem; 1195 text-align: left; 1196 1197 @media (max-width: 768px) { 1198 margin-top: 5vh; 1199 padding: 0 1rem; 1200 text-align: center; 1201 } 1202`,Xh=c.h1` 1203 font-size: clamp(4rem, 8vw, 6rem); 1204 font-weight: 900; 1205 line-height: 1; 1206 margin-bottom: 2rem; 1207 letter-spacing: -2px; 1208 1209 span { 1210 color: var(--primary-color); 1211 display: inline; 1212 } 1213 1214 @media (max-width: 768px) { 1215 font-size: clamp(2.5rem, 6vw, 3.5rem); 1216 margin-bottom: 1rem; 1217 1218 span { 1219 display: block; 1220 } 1221 } 1222`,Qh=c.h2` 1223 font-size: clamp(2rem, 4vw, 3rem); 1224 margin-bottom: 3rem; 1225 font-weight: 700; 1226 1227 span { 1228 color: var(--primary-color); 1229 } 1230 1231 @media (max-width: 768px) { 1232 font-size: clamp(1.25rem, 3vw, 1.75rem); 1233 margin-bottom: 2rem; 1234 } 1235`,Zh=c(ce)` 1236 background-color: var(--primary-color); 1237 color: var(--text-color); 1238 padding: 0.75rem 2rem; 1239 border-radius: 50px; 1240 font-size: 1rem; 1241 font-weight: 600; 1242 transition: transform 0.2s ease; 1243 text-decoration: none; 1244 display: inline-block; 1245 1246 &:hover { 1247 transform: scale(1.05); 1248 } 1249 1250 @media (max-width: 768px) { 1251 padding: 0.75rem 1.75rem; 1252 font-size: 0.95rem; 1253 } 1254`;c.div` 1255 width: 100%; 1256 padding: 2.5rem 0; 1257`;c.div` 1258 max-width: 600px; 1259 margin-left: 4rem; 1260`;
1260const em=c.div` 1261 width: 100%; 1262 max-width: 1400px; 1263 margin: 15vh auto 0; 1264 padding: 0 4rem; 1265 text-align: left; 1266 1267 h2 { 1268 font-size: clamp(2.5rem, 4vw, 3.5rem); 1269 line-height: 1.1; 1270 margin-bottom: 2rem; 1271 font-weight: 900; 1272 text-transform: uppercase; 1273 max-width: 800px; 1274 1275 span { 1276 color: var(--primary-color); 1277 display: inline; 1278 } 1279 } 1280 1281 p { 1282 max-width: 600px; 1283 color: rgba(255, 255, 255, 0.8); 1284 font-size: 1.125rem; 1285 margin-bottom: 1rem; 1286 line-height: 1.6; 1287 } 1288 1289 a { 1290 color: rgba(255, 255, 255, 0.8); 1291 text-decoration: underline; 1292 transition: color 0.2s ease; 1293 1294 &:hover { 1295 color: var(--primary-color); 1296 } 1297 } 1298 1299 @media (max-width: 768px) { 1300 margin-top: 10vh; 1301 padding: 0 1rem; 1302 1303 h2 { 1304 font-size: clamp(1.5rem, 3vw, 2rem); 1305 margin-bottom: 1rem; 1306 1307 span { 1308 display: block; 1309 } 1310 } 1311 1312 p { 1313 font-size: 0.95rem; 1314 margin-bottom: 0.5rem; 1315 } 1316 } 1317`,tm=()=>n.jsxs(Jh,{children:[n.jsxs(Kh,{children:[n.jsxs(Xh,{children:["HOW WILL ",n.jsx("span",{children:"YOU"})," IMPACT THE WORLD?"]}),n.jsxs(Qh,{children:["BOOK YOUR ",n.jsx("span",{children:"COMMERCIAL"})]}),n.jsx(Zh,{to:"/book-service",children:"Dream with Us"})]}),n.jsxs(em,{children:[n.jsxs("h2",{children:["NOT EVERY MONA LISA IS ",n.jsx("span",{children:"THE MONA LISA"})]}),n.jsx("p",{children:"We go further to create your masterpiece."}),n.jsxs("p",{children:["Not all creatives are created equally. MediaMill combines raw talent with cutting-edge technology and techniques to ensure your smile never falters. Learn more about ",n.jsx("a",{href:"#",children:"who we are"})," and ",n.jsx("a",{href:"#",children:"what we do"}),"."]})]})]}),rm=c.section` 1318 padding: 6rem 0; 1319 background: #000; 1320 color: white; 1321 width: 100%; 1322 margin-top: 6rem; 1323 1324 @media (max-width: 768px) { 1325 padding: 3rem 0; 1326 margin-top: 0; 1327 } 1328`,nm=c.div` 1329 display: grid; 1330 grid-template-columns: repeat(3, 1fr); 1331 gap: 4rem; 1332 width: 100%; 1333 1334 @media (max-width: 768px) { 1335 grid-template-columns: 1fr; 1336 gap: 2rem; 1337 } 1338`,en=c.div` 1339 display: flex; 1340 flex-direction: column; 1341 align-items: flex-start; 1342 text-align: left; 1343 gap: 1.5rem; 1344 1345 @media (max-width: 768px) { 1346 gap: 0.75rem; 1347 align-items: center; 1348 text-align: center; 1349 } 1350`,tn=c.div` 1351 width: 48px; 1352 height: 48px; 1353 border: 2px solid #E36527; 1354 display: flex; 1355 align-items: center; 1356 justify-content: center; 1357 margin-bottom: 0.5rem; 1358 1359 @media (max-width: 768px) { 1360 width: 32px; 1361 height: 32px; 1362 margin-bottom: 0; 1363 } 1364`,rn=c.h3` 1365 font-size: 1.5rem; 1366 font-weight: 700; 1367 text-transform: uppercase; 1368 letter-spacing: 1px; 1369 margin: 0; 1370 1371 @media (max-width: 768px) { 1372 font-size: 1rem; 1373 } 1374`,nn=c.p` 1375 color: rgba(255, 255, 255, 0.8); 1376 font-size: 1rem; 1377 line-height: 1.6; 1378 max-width: 300px; 1379 margin: 0; 1380 1381 @media (max-width: 768px) { 1382 max-width: 280px; 1383 font-size: 0.85rem; 1384 } 1385`,im=()=>n.jsx(rm,{children:n.jsxs(nm,{children:[n.jsxs(en,{children:[n.jsx(tn,{children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#E36527",strokeWidth:"2",children:[n.jsx("rect",{x:"3",y:"4",width:"18",height:"18"}),n.jsx("line",{x1:"3",y1:"10",x2:"21",y2:"10"}),n.jsx("line",{x1:"9",y1:"4",x2:"9",y2:"22"})]})}),n.jsx(rn,{children:"Schedule"}),n.jsx(nn,{children:"Book us for your website, photoshoot, commercial, mobile app, digital campaign, brand development, brand launch, podcast shoot..."})]}),n.jsxs(en,{children:[n.jsx(tn,{children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#E36527",strokeWidth:"2",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"22"}),n.jsx("line",{x1:"2",y1:"12",x2:"22",y2:"12"})]})}),n.jsx(rn,{children:"Manage"}),n.jsx(nn,{children:"We make managing your project easy through our MediaMill hub. View project status and timelines, approve and reject drafts and interact with your project from an easy-to-use interface."})]}),n.jsxs(en,{children:[n.jsx(tn,{children:n.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"#E36527",strokeWidth:"2",children:[n.jsx("circle",{cx:"12",cy:"12",r:"5"}),n.jsx("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"})]})}),n.jsx(rn,{children:"Control"}),n.jsx(nn,{children:"View invoices, manage your meeting dates, chat directly with your production team and much more! We're the engine, you're the driver."})]})]})}),sm=c.section` 1386 padding: 6rem 0; 1387 background: #000; 1388 color: white; 1389 width: 100%; 1390 1391 @media (max-width: 768px) { 1392 padding: 3rem 0 2rem; 1393 } 1394`,om=c.div` 1395 display: grid; 1396 grid-template-columns: repeat(2, 1fr); 1397 gap: 4rem 3rem; 1398 width: 100%; 1399 1400 @media (max-width: 768px) { 1401 grid-template-columns: 1fr; 1402 gap: 2rem; 1403 } 1404`,ot=c.div` 1405 display: flex; 1406 flex-direction: column; 1407 gap: 1rem; 1408 1409 @media (max-width: 768px) { 1410 gap: 0.75rem;
1411 align-items: center; 1412 text-align: center; 1413 } 1414`,at=c.div` 1415 display: flex; 1416 align-items: center; 1417 gap: 1rem; 1418 1419 @media (max-width: 768px) { 1420 gap: 0.75rem; 1421 justify-content: center; 1422 } 1423`,lt=c.div` 1424 width: 40px; 1425 height: 40px; 1426 background: #E36527; 1427 display: flex; 1428 align-items: center; 1429 justify-content: center; 1430 border-radius: 4px; 1431 1432 @media (max-width: 768px) { 1433 width: 32px; 1434 height: 32px; 1435 } 1436`,ct=c.h3` 1437 font-size: 1.75rem; 1438 font-weight: 700; 1439 text-transform: uppercase; 1440 letter-spacing: 1px; 1441 margin: 0; 1442 1443 @media (max-width: 768px) { 1444 font-size: 1.25rem; 1445 } 1446`,dt=c.ul` 1447 list-style: none; 1448 padding: 0; 1449 margin: 0; 1450 display: flex; 1451 flex-direction: column; 1452 gap: 0.75rem; 1453 padding-left: 3.5rem; 1454 1455 @media (max-width: 768px) { 1456 padding-left: 0; 1457 gap: 0.5rem; 1458 align-items: center; 1459 } 1460`,ve=c.li` 1461 display: flex; 1462 align-items: center; 1463 gap: 0.5rem; 1464 color: rgba(255, 255, 255, 0.8); 1465 font-size: 1.1rem; 1466 1467 &:before { 1468 content: "â¢"; 1469 color: #E36527; 1470 margin-right: 0.5rem; 1471 } 1472 1473 @media (max-width: 768px) { 1474 font-size: 0.95rem; 1475 justify-content: center; 1476 1477 &:before { 1478 display: none; 1479 } 1480 } 1481`,am=()=>n.jsx(sm,{children:n.jsxs(om,{children:[n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"ð¹"})}),n.jsx(ct,{children:"Videography"})]}),n.jsx(dt,{children:n.jsx(ve,{children:"HD video and drone footage"})})]}),n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"ð¸"})}),n.jsx(ct,{children:"Photography"})]}),n.jsxs(dt,{children:[n.jsx(ve,{children:"Campaign photography"}),n.jsx(ve,{children:"Landmark and portraiture"})]})]}),n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"âï¸"})}),n.jsx(ct,{children:"Editing"})]}),n.jsxs(dt,{children:[n.jsx(ve,{children:"3 short spots for socials"}),n.jsx(ve,{children:"1 larger feature for television"})]})]}),n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"ð¨"})}),n.jsx(ct,{children:"Graphic Design"})]}),n.jsxs(dt,{children:[n.jsx(ve,{children:"Hand-drawn illustrations"}),n.jsx(ve,{children:"Graphic illustrations and GIFs"})]})]}),n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"ð¬"})}),n.jsx(ct,{children:"Animation"})]}),n.jsxs(dt,{children:[n.jsx(ve,{children:"Several animated shorts for social media"}),n.jsx(ve,{children:"3D tracking and animation compositing"})]})]}),n.jsxs(ot,{children:[n.jsxs(at,{children:[n.jsx(lt,{children:n.jsx("span",{children:"ð"})}),n.jsx(ct,{children:"Management"})]}),n.jsxs(dt,{children:[n.jsx(ve,{children:"Media buying"}),n.jsx(ve,{children:"Social media post management"})]})]})]})}),lm=c.section` 1482 padding: 6rem 0; 1483 background: #000; 1484 color: white; 1485 width: 100%; 1486 1487 @media (max-width: 768px) { 1488 padding: 2rem 0; 1489 } 1490`,cm=c.div` 1491 display: grid; 1492 grid-template-columns: 1fr; 1493 gap: 3rem; 1494 width: 100%; 1495 1496 @media (max-width: 768px) { 1497 gap: 2rem; 1498 } 1499`,dm=c.div` 1500 display: flex; 1501 flex-direction: column; 1502 gap: 2rem; 1503 1504 @media (max-width: 768px) { 1505 gap: 1.5rem; 1506 align-items: center; 1507 text-align: center; 1508 } 1509`,um=c.h2` 1510 font-size: clamp(3rem, 5vw, 4.5rem); 1511 font-weight: 900; 1512 line-height: 1; 1513 margin: 0; 1514 text-transform: uppercase; 1515 max-width: 800px; 1516 1517 @media (max-width: 768px) { 1518 font-size: clamp(2rem, 4vw, 3rem); 1519 br { 1520 display: none; 1521 } 1522 } 1523`,hm=c.p` 1524 font-size: 1.5rem; 1525 margin: 0; 1526 color: rgba(255, 255, 255, 0.8); 1527 max-width: 700px; 1528 line-height: 1.4; 1529 1530 @media (max-width: 768px) { 1531 font-size: 1.1rem; 1532 text-align: center; 1533 } 1534`,mm=c.div` 1535 color: rgba(255, 255, 255, 0.8); 1536 font-size: 1.25rem; 1537 line-height: 1.6; 1538 max-width: 700px; 1539 1540 strong { 1541 color: white; 1542 } 1543 1544 @media (max-width: 768px) { 1545 font-size: 1rem; 1546 text-align: center; 1547 } 1548`,fm=()=>n.jsx(lm,{children:n.jsx(cm,{children:n.jsxs(dm,{children:[n.jsxs(um,{children:["IN CASE",n.jsx("br",{}),"YOU MISSED IT"]}),n.jsx(hm,{children:"We like to spotlight the most interesting, relevant or impactful brands we've worked with recently."}),n.jsxs(mm,{children:["The public launch of ",n.jsx("strong",{children:"TTWIFI"}),"âan initiative launched by the Ministry of Public Administrationârequired a combination of our services, delivered over the course of a 3-month campaign.",n.jsx("br",{}),n.jsx("br",{}),"TTWIFI provides ",n.jsx("strong",{children:"free wifi"})," at transportation hubs, libraries and more."]})]})})}),pm=c.div` 1549 min-height: 100vh; 1550 background: var(--bg-color); 1551 color: var(--text-color); 1552 overflow-x: hidden; 1553`,gm=c.div` 1554 width: 100%; 1555 max-width: 1400px; 1556 margin: 0 auto; 1557 display: flex; 1558 flex-direction: column; 1559 padding: 0 4rem; 1560 1561 @media (max-width: 768px) { 1562 padding: 0 1rem; 1563 } 1564`,xm=()=>n.jsx(pm,{children:n.jsxs(gm,{children:[n.jsx(tm,{}),n.jsx(im,{}),n.jsx(am,{}),n.jsx(fm,{})]})}),bm=c.div` 1565 padding-top: 80px; 1566 min-height: 100vh; 1567 background: var(--bg-color); 1568 color: var(--text-color); 1569`,vm=c.div` 1570 max-width: 1200px; 1571 margin: 0 auto; 1572 padding: 4rem 2rem; 1573`,ym=c.h1` 1574 font-size: clamp(3rem, 5vw, 4.5rem); 1575 font-weight: 900; 1576 margin-bottom: 1rem; 1577 line-height: 1.1; 1578`,wm=c.h2` 1579 font-size: 1.5rem; 1580 color: var(--primary-color); 1581 margin-bottom: 2rem; 1582`,jm=c.div` 1583 display: grid; 1584 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 1585 gap: 2rem; 1586 margin: 3rem 0; 1587 padding: 2rem; 1588 background: rgba(255, 255, 255, 0.05); 1589 border-radius: 12px; 1590`,or=c.div` 1591 h3 { 1592 font-size: 1.25rem; 1593 color: var(--primary-color); 1594 margin-bottom: 0.5rem; 1595 } 1596 1597 p { 1598 color: rgba(255, 255, 255, 0.8); 1599 line-height: 1.6; 1600 } 1601`,sn=c.section` 1602 margin: 3rem 0; 1603 1604 h2 { 1605 font-size: 2rem; 1606 margin-bottom: 1.5rem; 1607 color: var(--primary-color); 1608 } 1609 1610 p { 1611 color: rgba(255, 255, 255, 0.8); 1612 font-size: 1.125rem; 1613 line-height: 1.6; 1614 margin-bottom: 1.5rem; 1615 } 1616`,_m=c.div` 1617 margin-top: 4rem; 1618 padding: 2rem; 1619 background: rgba(255, 255, 255, 0.05); 1620 border-radius: 12px; 1621 1622 h2 { 1623 font-size: 2rem; 1624 margin-bottom: 2rem; 1625 color: var(--primary-color); 1626 } 1627`,Ct=c.div` 1628 margin-bottom: 2rem; 1629 1630 h3 { 1631 font-size: 1.25rem; 1632 color: var(--primary-color); 1633 margin-bottom: 1rem; 1634 } 1635 1636 p { 1637 color: rgba(255, 255, 255, 0.8); 1638 line-height: 1.6; 1639 margin-bottom: 0.5rem; 1640 } 1641`,km=c.div` 1642 margin: 3rem 0; 1643 position: relative; 1644 padding-top: 56.25%; /* 16:9 Aspect Ratio */ 1645 width: 100%; 1646 background: rgba(0, 0, 0, 0.2); 1647 border-radius: 12px; 1648 overflow: hidden; 1649 1650 iframe { 1651 position: absolute; 1652 top: 0; 1653 left: 0; 1654 width: 100%; 1655 height: 100%; 1656 border: none; 1657 } 1658`,Sm=()=>n.jsx(bm,{children:n.jsxs(vm,{children:[n.jsx(ym,{children:"Creating a Futuristic World for Caesar's Army"}),n.jsx(wm,{children:"A.M.BUSH Event Campaign"}),n.jsx(km,{children:n.jsx("iframe",{src:"https://player.vimeo.com/video/534604972",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,title:"A Futuristic World - Caesar's Army"})}),n.jsxs(jm,{children:[n.jsxs(or,{children:[n.jsx("h3",{children:"CLIENT"}),n.jsx("p",{children:"Caesar's Army"})]}),n.jsxs(or,{children:[n.jsx("h3",{children:"PRODUCTION COMPANY"}),n.jsx("p",{children:"MediaMill"})]}),n.jsxs(or,{children:[n.jsx("h3",{children:"DIRECTOR"}),n.jsx("p",{children:"Mark Alvarez"})]}),n.jsxs(or,{children:[n.jsx("h3",{children:"CAPABILITIES"}),n.jsx("p",{children:"Direction / Matte Painting / VFX"})]})]}),n.jsxs(sn,{children:[n.jsx("h2",{children:"Concept"}),n.jsx("p",{children:"To create a spot to promote Caesar's Army A.M.Bush event. Our partners with the Army wanted to create a futuristic world complete with destroyed cities, burning buildings, a futuristic NAPA and, of course, robots. Our solution involved some matte painting, modeling and a little creativity."})]}),n.jsxs(sn,{children:[n.jsx("h2",{children:"Process"}),n.jsx("p",{children:"Create an animated feature using matte digital painting to create realistic landscapes and inject it with a bit of life b
1658y overlaying elements of smoke, dust and fire alongside rigged 3D models."})]}),n.jsxs(sn,{children:[n.jsx("h2",{children:"Impression"}),n.jsx("p",{children:"An innovative feature for a bold, forward-thinking brand."}),n.jsx("p",{children:"MediaMill Art Director Mark Alvarez teamed up with VFX Superstar Crystal Samuel to deliver a spot for Caesar's Army A.M.Bush event."}),n.jsx("p",{children:`"Typically, when we're doing promos for carnival events or things like that we have a pretty general idea on how we're going to approach it. This one was a bit different and we got a chance to try some things we wouldn't normally. We utilized our standard toolkit of After Effects and Photoshop but got to play around in Cinema 4D and even a bit of Maya for good measure. It took a lot of exceptional artistic talent and traditional VFX knowledge and methods to achieve this look and make everything come together realistically."`})]}),n.jsxs(_m,{children:[n.jsx("h2",{children:"Credits"}),n.jsxs(Ct,{children:[n.jsx("h3",{children:"CLIENT - Caesar's Army"}),n.jsx("p",{children:"Senior Producer â Cherisse Ruben"}),n.jsx("p",{children:"Creative Director â Renata Sankar"})]}),n.jsxs(Ct,{children:[n.jsx("h3",{children:"PRODUCTION - MediaMill"}),n.jsx("p",{children:"Director â Mark Alvarez"})]}),n.jsxs(Ct,{children:[n.jsx("h3",{children:"VFX PRODUCTION - MediaMill"}),n.jsx("p",{children:"Executive Producer â Mark Alvarez"}),n.jsx("p",{children:"Senior Producer â Keron Yan"})]}),n.jsxs(Ct,{children:[n.jsx("h3",{children:"COLOUR - MediaMill"}),n.jsx("p",{children:"Colourist â Mark Alvarez"})]}),n.jsxs(Ct,{children:[n.jsx("h3",{children:"VFX CREATIVE - MediaMill"}),n.jsx("p",{children:"CG Lead â Mark Alvarez"}),n.jsx("p",{children:"VFX Supervisor â Mark Alvarez"}),n.jsx("p",{children:"3D Lead â Mark Alvarez"}),n.jsx("p",{children:"Matte Painting â Crystal Samuel"}),n.jsx("p",{children:"Animation â Mark Alvarez"}),n.jsx("p",{children:"Design â Sonielle Rahim"}),n.jsx("p",{children:"Art Department â Mark Alvarez"})]})]})]})}),Cm=c.div` 1659 padding-top: 80px; 1660 min-height: 100vh; 1661 background: var(--bg-color); 1662 color: var(--text-color); 1663`,Pm=c.div` 1664 max-width: 1200px; 1665 margin: 0 auto; 1666 padding: 4rem 2rem; 1667`,Tm=c.h1` 1668 font-size: clamp(3rem, 5vw, 4.5rem); 1669 font-weight: 900; 1670 margin-bottom: 1rem; 1671 line-height: 1.1; 1672`,Em=c.h2` 1673 font-size: 1.5rem; 1674 color: var(--primary-color); 1675 margin-bottom: 2rem; 1676`,Am=c.div` 1677 display: grid; 1678 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 1679 gap: 2rem; 1680 margin: 3rem 0; 1681 padding: 2rem; 1682 background: rgba(255, 255, 255, 0.05); 1683 border-radius: 12px; 1684`,Pt=c.div` 1685 h3 { 1686 font-size: 1.25rem; 1687 color: var(--primary-color); 1688 margin-bottom: 0.5rem; 1689 } 1690 1691 p { 1692 color: rgba(255, 255, 255, 0.8); 1693 line-height: 1.6; 1694 } 1695`,on=c.section` 1696 margin: 3rem 0; 1697 1698 h2 { 1699 font-size: 2rem; 1700 margin-bottom: 1.5rem; 1701 color: var(--primary-color); 1702 } 1703 1704 p { 1705 color: rgba(255, 255, 255, 0.8); 1706 font-size: 1.125rem; 1707 line-height: 1.6; 1708 margin-bottom: 1.5rem; 1709 } 1710`,$m=c.div` 1711 margin-top: 4rem; 1712 padding: 2rem; 1713 background: rgba(255, 255, 255, 0.05); 1714 border-radius: 12px; 1715 1716 h2 { 1717 font-size: 2rem; 1718 margin-bottom: 2rem; 1719 color: var(--primary-color); 1720 } 1721`,ys=c.div` 1722 margin-bottom: 2rem; 1723 1724 h3 { 1725 font-size: 1.25rem; 1726 color: var(--primary-color); 1727 margin-bottom: 1rem; 1728 } 1729 1730 p { 1731 color: rgba(255, 255, 255, 0.8); 1732 line-height: 1.6; 1733 margin-bottom: 0.5rem; 1734 } 1735`,Om=c.div` 1736 margin: 3rem 0; 1737 position: relative; 1738 padding-top: 56.25%; /* 16:9 Aspect Ratio */ 1739 width: 100%; 1740 background: rgba(0, 0, 0, 0.2); 1741 border-radius: 12px; 1742 overflow: hidden; 1743 1744 iframe { 1745 position: absolute; 1746 top: 0; 1747 left: 0; 1748 width: 100%; 1749 height: 100%; 1750 border: none; 1751 } 1752`,Im=()=>n.jsx(Cm,{children:n.jsxs(Pm,{children:[n.jsx(Tm,{children:"Creating Good Vibez with Great Friends"}),n.jsx(Em,{children:"Dil-e-Nadan Music Video"}),n.jsx(Om,{children:n.jsx("iframe",{src:"https://player.vimeo.com/video/645306069",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,title:"Creating Good Vibez - Dil-e-Nadan"})}),n.jsxs(Am,{children:[n.jsxs(Pt,{children:[n.jsx("h3",{children:"BRAND"}),n.jsx("p",{children:"Dil-e-Nadan"})]}),n.jsxs(Pt,{children:[n.jsx("h3",{children:"CLIENT"}),n.jsx("p",{children:"Richard Ramnarine"})]}),n.jsxs(Pt,{children:[n.jsx("h3",{children:"PRODUCTION COMPANY"}),n.jsx("p",{children:"MediaMill"})]}),n.jsxs(Pt,{children:[n.jsx("h3",{children:"DIRECTOR"}),n.jsx("p",{children:"Keron Yan"})]}),n.jsxs(Pt,{children:[n.jsx("h3",{children:"CAPABILITIES"}
1752),n.jsx("p",{children:"Direction / Video Editing / Video Capture / Conceptualisation"})]})]}),n.jsxs(on,{children:[n.jsx("h2",{children:"Concept"}),n.jsx("p",{children:"Use the beauty of Trinidad and Tobago to showcase a storied past of two friends and the lasting power of friendship."})]}),n.jsxs(on,{children:[n.jsx("h2",{children:"Process"}),n.jsx("p",{children:'After scouting the perfect locations in Trinidad to help embody our concept, we shot, edited and produced the music video to showcase a uniquely "Trini" vibe.'})]}),n.jsxs(on,{children:[n.jsx("h2",{children:"Impact"}),n.jsx("p",{children:"262,000 Views in 2 months really helps to creates a good vibe. Our main goals were to raise existing production values while executing subtle product placement in an effort to enrich associated brands."})]}),n.jsxs($m,{children:[n.jsx("h2",{children:"Credits"}),n.jsxs(ys,{children:[n.jsx("h3",{children:"CLIENT - Richard Ramnarine"}),n.jsx("p",{children:"Executive Producer â Richard Ramnarine"})]}),n.jsxs(ys,{children:[n.jsx("h3",{children:"PRODUCTION - MediaMill"}),n.jsx("p",{children:"Executive Producer â Keron Yan"}),n.jsx("p",{children:"Supervising Producer â Stacy Wyke"}),n.jsx("p",{children:"Videography â Ian Davis"}),n.jsx("p",{children:"Gaffer â Thion Lord"}),n.jsx("p",{children:"Editor â Keron Yan"}),n.jsx("p",{children:"DP â Keron Yan"}),n.jsx("p",{children:"Motion Graphics â Keron Yan"})]})]})]})}),Dm=c.div` 1753 padding-top: 80px; 1754 min-height: 100vh; 1755 background: var(--bg-color); 1756 color: var(--text-color); 1757`,Mm=c.div` 1758 max-width: 1200px; 1759 margin: 0 auto; 1760 padding: 4rem 2rem; 1761`,Rm=c.h1` 1762 font-size: clamp(3rem, 5vw, 4.5rem); 1763 font-weight: 900; 1764 margin-bottom: 1rem; 1765 line-height: 1.1; 1766`,Nm=c.h2` 1767 font-size: 1.5rem; 1768 color: var(--primary-color); 1769 margin-bottom: 2rem; 1770`,Fm=c.div` 1771 display: grid; 1772 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 1773 gap: 2rem; 1774 margin: 3rem 0; 1775 padding: 2rem; 1776 background: rgba(255, 255, 255, 0.05); 1777 border-radius: 12px; 1778`,Tt=c.div` 1779 h3 { 1780 font-size: 1.25rem; 1781 color: var(--primary-color); 1782 margin-bottom: 0.5rem; 1783 } 1784 1785 p { 1786 color: rgba(255, 255, 255, 0.8); 1787 line-height: 1.6; 1788 } 1789`,an=c.section` 1790 margin: 3rem 0; 1791 1792 h2 { 1793 font-size: 2rem; 1794 margin-bottom: 1.5rem; 1795 color: var(--primary-color); 1796 } 1797 1798 p { 1799 color: rgba(255, 255, 255, 0.8); 1800 font-size: 1.125rem; 1801 line-height: 1.6; 1802 margin-bottom: 1.5rem; 1803 } 1804`,Lm=c.div` 1805 margin-top: 4rem; 1806 padding: 2rem; 1807 background: rgba(255, 255, 255, 0.05); 1808 border-radius: 12px; 1809 1810 h2 { 1811 font-size: 2rem; 1812 margin-bottom: 2rem; 1813 color: var(--primary-color); 1814 } 1815`,ar=c.div` 1816 margin-bottom: 2rem; 1817 1818 h3 { 1819 font-size: 1.25rem; 1820 color: var(--primary-color); 1821 margin-bottom: 1rem; 1822 } 1823 1824 p { 1825 color: rgba(255, 255, 255, 0.8); 1826 line-height: 1.6; 1827 margin-bottom: 0.5rem; 1828 } 1829`,zm=c.div` 1830 margin: 3rem 0; 1831 position: relative; 1832 padding-top: 56.25%; /* 16:9 Aspect Ratio */ 1833 width: 100%; 1834 background: rgba(0, 0, 0, 0.2); 1835 border-radius: 12px; 1836 overflow: hidden; 1837 1838 iframe { 1839 position: absolute; 1840 top: 0; 1841 left: 0; 1842 width: 100%; 1843 height: 100%; 1844 border: none; 1845 } 1846`,Um=()=>n.jsx(Dm,{children:n.jsxs(Mm,{children:[n.jsx(Rm,{children:"Character Building with the Central Bank"}),n.jsx(Nm,{children:"CBTT Educational Series"}),n.jsx(zm,{children:n.jsx("iframe",{src:"https://player.vimeo.com/video/534998192",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,title:"Character Building - CBTT Educational Series"})}),n.jsxs(Fm,{children:[n.jsxs(Tt,{children:[n.jsx("h3",{children:"BRAND"}),n.jsx("p",{children:"CBTT"})]}),n.jsxs(Tt,{children:[n.jsx("h3",{children:"CLIENT"}),n.jsx("p",{children:"The Central Bank of Trinidad & Tobago"})]}),n.jsxs(Tt,{children:[n.jsx("h3",{children:"PRODUCTION COMPANY"}),n.jsx("p",{children:"MediaMill"})]}),n.jsxs(Tt,{children:[n.jsx("h3",{children:"DIRECTOR"}),n.jsx("p",{children:"Mark Alvarez"})]}),n.jsxs(Tt,{children:[n.jsx("h3",{children:"CAPABILITIES"}),n.jsx("p",{children:"Direction / Character Rigging / VFX"})]})]}),n.jsxs(an,{children:[n.jsx("h2",{children:"Concept"}),n.jsx("p",{children:"The Central Bank of Trinidad and Tobago wanted a series of features outlining who they are and what they do. CeeBee the robot would act as our guide as we learn more about the Central Bank."})]}),n.jsxs(an,{children:[n.jsx("h2",{children:"Process"}),n.jsx("p",{children:"Create an animated feature using a semi-3D, fully rigged character rendered over digitally illustrated 2D backdrops."})]}),n.jsxs(an,{children:[n.jsx("h2",{children:"Impression"}),n.jsx("p",{children:"An educational, entertaining feature for all ages."}),n.jsx("p",{children:"We worked with talented local designer, Ezra Burnley, to help recreate the Central Bank in glorious 2D."}),n.jsx("p",{children:`After that, it was a simple matter of rigging up Central Bank's mascot, CeeBee, to take us on a tour of the Central Bank's main roles and functions. Art Director, Mark Alvarez comments, "After Effects has really improved their character r
1846igging capabilities with some pretty impressive addons. If you don't have to get into too much 3D, it's perfect."`})]}),n.jsxs(Lm,{children:[n.jsx("h2",{children:"Credits"}),n.jsxs(ar,{children:[n.jsx("h3",{children:"CLIENT - The Central Bank"}),n.jsx("p",{children:"Senior Producer â Nicole Crooks"}),n.jsx("p",{children:"Executive Producer â Jo-Anna Gonsalves"})]}),n.jsxs(ar,{children:[n.jsx("h3",{children:"PRODUCTION - MediaMill"}),n.jsx("p",{children:"Director â Mark Alvarez"})]}),n.jsxs(ar,{children:[n.jsx("h3",{children:"VFX PRODUCTION - MediaMill"}),n.jsx("p",{children:"Executive Producer â Mark Alvarez"}),n.jsx("p",{children:"Senior Producer â Keron Yan"})]}),n.jsxs(ar,{children:[n.jsx("h3",{children:"VFX CREATIVE - MediaMill"}),n.jsx("p",{children:"Animation Lead â Mark Alvarez"}),n.jsx("p",{children:"VFX Supervisor â Mark Alvarez"}),n.jsx("p",{children:"Illustrator â Ezra Burnley"}),n.jsx("p",{children:"Animation / Rigging â Mark Alvarez"}),n.jsx("p",{children:"Secondary Animation â Hayden Matheson"}),n.jsx("p",{children:"Art Department â Mark Alvarez"})]})]})]})}),Bm=c.div` 1847 padding-top: 80px; 1848 min-height: 100vh; 1849 background: var(--bg-color); 1850 color: var(--text-color); 1851`,qm=c.div` 1852 max-width: 1200px; 1853 margin: 0 auto; 1854 padding: 4rem 2rem; 1855`,Wm=c.h1` 1856 font-size: clamp(3rem, 5vw, 4.5rem); 1857 font-weight: 900; 1858 margin-bottom: 1rem; 1859 line-height: 1.1; 1860`,Hm=c.h2` 1861 font-size: 1.5rem; 1862 color: var(--primary-color); 1863 margin-bottom: 2rem; 1864`,Vm=c.div` 1865 display: grid; 1866 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 1867 gap: 2rem; 1868 margin: 3rem 0; 1869 padding: 2rem; 1870 background: rgba(255, 255, 255, 0.05); 1871 border-radius: 12px; 1872`,lr=c.div` 1873 h3 { 1874 font-size: 1.25rem; 1875 color: var(--primary-color); 1876 margin-bottom: 0.5rem; 1877 } 1878 1879 p { 1880 color: rgba(255, 255, 255, 0.8); 1881 line-height: 1.6; 1882 } 1883`,Gm=c.section` 1884 margin: 3rem 0; 1885 1886 h2 { 1887 font-size: 2rem; 1888 margin-bottom: 1.5rem; 1889 color: var(--primary-color); 1890 } 1891 1892 p { 1893 color: rgba(255, 255, 255, 0.8); 1894 font-size: 1.125rem; 1895 line-height: 1.6; 1896 margin-bottom: 1.5rem; 1897 } 1898`,Ym=c.div` 1899 margin-top: 4rem; 1900 padding: 2rem; 1901 background: rgba(255, 255, 255, 0.05); 1902 border-radius: 12px; 1903 1904 h2 { 1905 font-size: 2rem; 1906 margin-bottom: 2rem; 1907 color: var(--primary-color); 1908 } 1909`,ln=c.div` 1910 margin-bottom: 2rem; 1911 1912 h3 { 1913 font-size: 1.25rem; 1914 color: var(--primary-color); 1915 margin-bottom: 1rem; 1916 } 1917 1918 p { 1919 color: rgba(255, 255, 255, 0.8); 1920 line-height: 1.6; 1921 margin-bottom: 0.5rem; 1922 } 1923`,Jm=c.div` 1924 margin: 3rem 0; 1925 position: relative; 1926 padding-top: 56.25%; /* 16:9 Aspect Ratio */ 1927 width: 100%; 1928 background: rgba(0, 0, 0, 0.2); 1929 border-radius: 12px; 1930 overflow: hidden; 1931 1932 iframe { 1933 position: absolute; 1934 top: 0; 1935 left: 0; 1936 width: 100%; 1937 height: 100%; 1938 border: none; 1939 } 1940`,Km=()=>n.jsx(Bm,{children:n.jsxs(qm,{children:[n.jsx(Wm,{children:"Black Liberation"}),n.jsx(Hm,{children:"Olatunji X Good Times Ahead"}),n.jsx(Jm,{children:n.jsx("iframe",{src:"https://player.vimeo.com/video/645310154",allow:"autoplay; fullscreen; picture-in-picture",allowFullScreen:!0,title:"Black Liberation - Olatunji X Good Times Ahead"})}),n.jsxs(Vm,{children:[n.jsxs(lr,{children:[n.jsx("h3",{children:"PRODUCTION COMPANY"}),n.jsx("p",{children:"MediaMill Limited"})]}),n.jsxs(lr,{children:[n.jsx("h3",{children:"DIRECTOR"}),n.jsx("p",{children:"Keron Yan"})]}),n.jsxs(lr,{children:[n.jsx("h3",{children:"CO-DIRECTOR"}),n.jsx("p",{children:"Ola"})]}),n.jsxs(lr,{children:[n.jsx("h3",{children:"CAPABILITIES"}),n.jsx("p",{children:"Direction / Video Editing / Cinematography"})]})]}),n.jsxs(Gm,{children:[n.jsx("h2",{children:"Production Credits"}),n.jsx("p",{children:"Directed by Keron Yan with co-direction from Ola, this music video showcases the powerful collaboration between Olatunji and Good Times Ahead. The project combines expert cinematography and editing, all handled by Keron Yan as DP and editor."})]}),n.jsxs(Ym,{children:[n.jsx("h2",{children:"Credits"}),n.jsxs(ln,{children:[n.jsx("h3",{children:"PRODUCTION"}),n.jsx("p",{children:"Director â Keron Yan"}),n.jsx("p",{children:"Co-Director â Ola"}),n.jsx("p",{children:"Editor â Keron Yan"}),n.jsx("p",{children:"Videography/DP â Keron Yan"})]}),n.jsxs(ln,{children:[n.jsx("h3",{children:"SONG CREDITS"}),n.jsx("p",{children:"Title â Black Liberation"}),n.jsx("p",{children:"Performed by â Olatunji & Good Times Ahead"}),n.jsx("p",{children:"Written by â Olatunji Yearwood"}),n.jsx("p",{children:"Produced by â Good Times Ahead & System32"}),n.jsx("p",{children:'Mix & Mastered by â Kevin "vexmony" Beharry'}),n.jsx("p",{children:"Executive Producer â Chinese LAUNDRY Music"})]}),n.jsxs(ln,{children:[n.jsx("h3",{children:"DISTRIBUTION"}),n.jsx("p",{children:"Shayegan Media & Marketing"}),n.jsx("p",{children:"Chinese LAUNDRY Music"})]})]})]})}),Xm=c.div` 1941 padding-top: 80px; 1942 min-height: 100vh; 1943 background: var(--bg-color); 1944 color: var(--text-color); 1945`,Qm=c.div` 1946 max-width: 1200px; 1947 margin: 0 auto; 1948 padding: 4rem 2rem; 1949`,Zm=c.h1` 1950 font-size: clamp(3rem, 5vw, 4.5rem); 1951 font-weight: 900; 1952 margin-bottom: 3rem; 1953 line-height: 1.1; 1954`,ef=c.div` 1955 display: grid; 1956 grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 1957 gap: 3rem; 1958`,tf=c(ce)` 1959 background: rgba(255, 255, 255, 0.05); 1960 border-radius: 12px; 1961 padding: 2rem; 1962 text-decoration: none; 1963 color: var(--text-color); 1964 transition: all 0.3s ease; 1965 1966 &:hover { 1967 transform: translateY(-5px); 1968 background: rgba(255, 255, 255, 0.1); 1969 } 1970 1971 h2 { 1972 font-size: 1.75rem; 1973 margin-bottom: 1rem; 1974 color: var(--primary-color); 1975 } 1976 1977 p { 1978 color: rgba(255, 255, 255, 0.8); 1979 line-height: 1.6; 1980 font-size: 1.125rem; 1981 } 1982`,rf=()=>{const r=[{title:"Black Liberation",description:"A powerful music video collaboration between Olatunji and Good Times Ahead, directed by
1982Keron Yan.",path:"/projects/black-liberation"},{title:"A Futuristic World",description:"Step into tomorrow with our visionary project that pushes the boundaries of imagination and technology.",path:"/projects/futuristic-world"},{title:"Creating Good Vibez",description:"An innovative campaign that celebrates positivity, creativity, and the power of good energy.",path:"/projects/good-vibez"},{title:"Building Character",description:"Bringing unique personalities to life through innovative design, storytelling, and animation techniques.",path:"/projects/building-character"}];return n.jsx(Xm,{children:n.jsxs(Qm,{children:[n.jsx(Zm,{children:"Our Projects"}),n.jsx(ef,{children:r.map((e,t)=>n.jsxs(tf,{to:e.path,children:[n.jsx("h2",{children:e.title}),n.jsx("p",{children:e.description})]},t))})]})})},nf=c.div` 1983 padding-top: 80px; 1984 min-height: 100vh; 1985 background: var(--bg-color); 1986 color: var(--text-color); 1987`,sf=c.div` 1988 max-width: 1200px; 1989 margin: 0 auto; 1990 padding: 4rem 2rem; 1991`,of=c.h1` 1992 font-size: clamp(3rem, 5vw, 4.5rem); 1993 font-weight: 900; 1994 margin-bottom: 2rem; 1995 line-height: 1.1; 1996 text-align: center; 1997`,ws=c.section` 1998 margin: 4rem 0; 1999 max-width: 800px; 2000 margin-left: auto; 2001 margin-right: auto; 2002 2003 p { 2004 color: rgba(255, 255, 255, 0.9); 2005 font-size: 1.25rem; 2006 line-height: 1.8; 2007 margin-bottom: 2rem; 2008 } 2009`,js=c.div` 2010 text-align: center; 2011 font-size: 2rem; 2012 color: var(--primary-color); 2013 font-weight: 600; 2014 margin: 4rem 0; 2015 line-height: 1.4; 2016`,af=c(ce)` 2017 display: inline-block; 2018 background-color: #d95b2b; 2019 color: #ffffff; 2020 padding: 1rem 2.5rem; 2021 border-radius: 25px; 2022 text-decoration: none; 2023 font-size: 1.25rem; 2024 font-weight: 600; 2025 transition: all 0.3s ease; 2026 margin: 2rem 0; 2027 2028 &:hover { 2029 transform: translateY(-2px); 2030 box-shadow: 0 4px 12px rgba(217, 91, 43, 0.3); 2031 } 2032`,lf=c.div` 2033 text-align: center; 2034 margin: 4rem 0; 2035`,cf=()=>n.jsx(nf,{children:n.jsxs(sf,{children:[n.jsx(of,{children:"Who We Are"}),n.jsxs(ws,{children:[n.jsx("p",{children:"People throughout the ages have gazed upward for inspiration. It has always been in our curious nature to know. To learn more. To discover new lands, new techniques, new technologies. We can look back at our heritage as a people, embracing catastrophe with miracle, and celebrate where we are today."}),n.jsx("p",{children:"Forging ahead, we've always left behind a trail for others to follow. How will you contribute to this legacy? What stories will your dreams tell?"})]}),n.jsx(lf,{children:n.jsx(af,{to:"/book-service",children:"Dream with Us"})}),n.jsx(js,{children:"We are at the MediaMill"}),n.jsxs(ws,{children:[n.jsx("p",{children:"We've often been asked over the years, by ourselves as much as others, what is MediaMill? A production company? A creative agency? Truth be told, we've always struggled to put ourselves in a box."}),n.jsx("p",{children:"We are made up of a talented team of designers, writers, animators, editors, photographers, videographers and coders. Yet we can help conceive and manage your idea with the same creativity and care we deliver in its execution. In this ever-evolving world, it helps to know yourself. It also helps to stay nimble."})]}),n.jsx(js,{children:"We are the engine powered by the creative energy in us all."})]})}),df=c.div` 2036 padding-top: 80px; 2037 min-height: 100vh; 2038 background: var(--bg-color); 2039 color: var(--text-color); 2040`,uf=c.div` 2041 max-width: 1200px; 2042 margin: 0 auto; 2043 padding: 4rem 2rem; 2044`,hf=c.h1` 2045 font-size: clamp(3rem, 5vw, 4.5rem); 2046 font-weight: 900; 2047 margin-bottom: 2rem; 2048 line-height: 1.1; 2049 text-align: center; 2050`,mf=c.div` 2051 text-align: center; 2052 max-width: 800px; 2053 margin: 0 auto 4rem; 2054 2055 p { 2056 color: rgba(255, 255, 255, 0.9); 2057 font-size: 1.25rem; 2058 line-height: 1.8; 2059 margin-bottom: 2rem; 2060 } 2061`,ff=c.div` 2062 display: grid; 2063 grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 2064 gap: 2rem; 2065 margin: 4rem 0; 2066`,cr=c.div` 2067 background: rgba(255, 255, 255, 0.05); 2068 border-radius: 12px; 2069 padding: 2rem; 2070 transition: all 0.3s ease; 2071 2072 &:hover { 2073 transform: translateY(-5px); 2074 background: rgba(255, 255, 255, 0.1); 2075 } 2076 2077 h2 { 2078 font-size: 1.75rem; 2079 color: var(--primary-color); 2080 margin-bottom: 1rem; 2081 } 2082 2083 p { 2084 color: rgba(255, 255, 255, 0.8); 2085 line-height: 1.6; 2086 font-size: 1.125rem; 2087 margin-bottom: 1.5rem; 2088 } 2089 2090 ul { 2091 list-style: none; 2092 padding: 0; 2093 margin: 0; 2094 2095 li { 2096 color: rgba(255, 255, 255, 0.8); 2097 margin-bottom: 0.5rem; 2098 font-size: 1.125rem; 2099 display: flex; 2100 align-items: center; 2101 2102 &:before { 2103 content: "â¢"; 2104 color: var(--primary-color); 2105 margin-right: 0.5rem; 2106 } 2107 } 2108 } 2109`,pf=c.div` 2110 text-align: center; 2111 margin: 4rem 0; 2112 padding: 3rem; 2113 background: rgba(255, 255, 255, 0.05); 2114 border-radius: 12px; 2115 2116 h2 { 2117 font-size: 2rem; 2118 color: var(--primary-color); 2119 margin-bottom: 1.5rem; 2120 } 2121 2122 p { 2123 color: rgba(255, 255, 255, 0.9); 2124 font-size: 1.25rem; 2125 line-height: 1.8; 2126 margin-bottom: 2rem; 2127 max-width: 800px; 2128 margin-left: auto; 2129 margin-right: auto; 2130 } 2131`,gf=c(ce)` 2132 display: inline-block; 2133 background-color: #d95b2b; 2134 color: #ffffff; 2135 padding: 1rem 2.5rem; 2136 border-radius: 25px; 2137 text-decoration: none; 2138 font-size: 1.25rem; 2139 font-weight: 600; 2140 transition: all 0.3s ease; 2141 2142 &:hover { 2143 transform: translateY(-2px); 2144 box-shadow: 0 4px 12px rgba(217, 91, 43, 0.3); 2145 } 2146`,xf=()=>n.jsx(df,{children:n.jsxs(uf,{children:[n.jsx(hf,{children:"What We Do"}),n.jsx(mf,{children:n.jsx("p",{children:"At MediaMill, we blend creativity with technical expertise to bring your vision to life. From concept to execution, we're your partners in creating compelling digital experiences that captivate and inspire."})}),n.jsxs(ff,{children:[n.jsxs(cr,{children:[n.jsx("h2",{children:"Animation & VFX"}),n.jsx("p",{children:"Bringing stories to life through cutting-edge animation and visual effects."}),n.jsxs("ul",{children:[n.jsx("li",{children:"Character Animation & Rigging"}),n.jsx("li",{children:"2D & 3D Animation"}),n.jsx("li",{children:"Visual Effects (VFX)"}),n.jsx("li",{children:"Motion Graphics"}),n.jsx("li",{children:"Matte Painting"})]})]}),n.jsxs(cr,{children:[n.jsx("h2",{children:"Video Production"}),n.jsx("p",{children:"Full-service video production from concept to final delivery."}),n.jsxs("ul",{children:[n.jsx("li",{children:"Direction & Cinematography"}),n.jsx("li",{children:"Video Editing"}),n.jsx("li",{children:"Color Grading"}),n.jsx("li",{children:"Sound Design"}),n.jsx("li",{children:"Music Videos"})]})]}),n.jsxs(cr,{children:[n.jsx("h2",{children:"Creative Design"}),n.jsx("p",{children:"Crafting visually stunning designs that tell your story."}),n.jsxs("ul",{children:[n.jsx("li",{children:"Character Design"}),n.jsx("li",{children:"Digital Illustration"}),n.jsx("li",{children:"Brand Identity"}),n.jsx("li",{children:"UI/UX Design"}),n.jsx("li",{children:"Art Direction"})]})]}),n.jsxs(cr,{children:[n.jsx("h2",{children:"Digital Development"}),n.jsx("p",{children:"Building interactive experiences for the digital world."}),n.jsxs("ul",{children:[n.jsx("li",{children:"Web Development"}),n.jsx("li",{children:"Interactive Media"}),n.jsx("li",{children:"Custom Applications"}),n.jsx("li",{children:"Digital Integration"}),n.jsx("li",{children:"Technical Consulting"})]})]})]}),n.jsxs(pf,{children:[n.jsx("h2",{children:"Ready to Bring Your Vision to Life?"}),n.jsx("p",{children:"Whether you're looking to create an animated feature, produce a music video, or develop a digital campaign, we have the expertise and creativity to make it happen. Let's work together to create something extraordinary."}),n.jsx(gf,{to:"/book-service",children:"Start Your Project"})]})]})}),bf=c.div` 2147 width: 100%; 2148 max-width: 400px; 2149 background: rgba(255, 255, 255, 0.05); 2150 border-radius: 12px; 2151 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); 2152 padding: 2rem; 2153 margin: 0 auto; 2154 border: 1px solid rgba(255, 255, 255, 0.1); 2155 2156 @media (max-width: 768px) { 2157 padding: 1rem; 2158 max-width: 100%; 2159 } 2160`,vf=c.div` 2161 display: flex; 2162 justify-content: space-between; 2163 align-items: center; 2164 margin-bottom: 2rem; 2165 padding: 0 1rem; 2166 2167 @media (max-width: 768px) { 2168 margin-bottom: 1.5rem; 2169 padding: 0; 2170 } 2171`,_s=c.button` 2172 background: none; 2173 border: none; 2174 cursor: pointer;
2175 color: var(--primary-color); 2176 font-size: 1.5rem; 2177 padding: 0.5rem; 2178 transition: all 0.3s ease; 2179 border-radius: 50%; 2180 width: 40px; 2181 height: 40px; 2182 display: flex; 2183 align-items: center; 2184 justify-content: center; 2185 2186 &:hover { 2187 background: rgba(217, 91, 43, 0.1); 2188 } 2189 2190 &:disabled { 2191 color: rgba(255, 255, 255, 0.2); 2192 cursor: not-allowed; 2193 } 2194 2195 @media (max-width: 768px) { 2196 width: 36px; 2197 height: 36px; 2198 font-size: 1.25rem; 2199 } 2200`,yf=c.span` 2201 font-weight: 500; 2202 font-size: 1.25rem; 2203 color: #fff; 2204 2205 @media (max-width: 768px) { 2206 font-size: 1.1rem; 2207 } 2208`,wf=c.div` 2209 display: grid; 2210 grid-template-columns: repeat(7, 1fr); 2211 gap: 0.75rem; 2212 text-align: center; 2213 2214 @media (max-width: 768px) { 2215 gap: 0.5rem; 2216 } 2217`,jf=c.div` 2218 font-weight: 500; 2219 color: rgba(255, 255, 255, 0.6); 2220 font-size: 0.9rem; 2221 padding: 0.5rem 0; 2222 text-transform: uppercase; 2223 2224 @media (max-width: 768px) { 2225 font-size: 0.8rem; 2226 padding: 0.25rem 0; 2227 } 2228`,ks=c.button` 2229 aspect-ratio: 1; 2230 border: none; 2231 background: ${r=>r.isSelected?"var(--primary-color)":r.isToday?"rgba(217, 91, 43, 0.2)":"transparent"}; 2232 color: ${r=>r.isSelected?"#fff":r.isToday?"var(--primary-color)":"#fff"}; 2233 border-radius: 50%; 2234 cursor: pointer; 2235 transition: all 0.3s ease; 2236 font-size: 1rem; 2237 width: 40px; 2238 height: 40px; 2239 display: flex; 2240 align-items: center; 2241 justify-content: center; 2242 border: 2px solid ${r=>r.isSelected||r.isToday?"var(--primary-color)":"transparent"}; 2243 2244 &:hover:not(:disabled) { 2245 background: ${r=>r.isSelected?"var(--primary-color)":"rgba(217, 91, 43, 0.1)"}; 2246 border-color: var(--primary-color); 2247 } 2248 2249 &:disabled { 2250 color: rgba(255, 255, 255, 0.2); 2251 cursor: not-allowed; 2252 background: transparent; 2253 border-color: transparent; 2254 } 2255 2256 @media (max-width: 768px) { 2257 width: 32px; 2258 height: 32px; 2259 font-size: 0.9rem; 2260 border-width: 1px; 2261 } 2262 2263 @media (max-width: 360px) { 2264 width: 28px; 2265 height: 28px; 2266 font-size: 0.85rem; 2267 } 2268`,_f=({onDateSelect:r,selectedDate:e})=>{const[t,i]=C.useState(new Date),s=new Date,o=new Date(t.getFullYear(),t.getMonth()+1,0).getDate(),a=new Date(t.getFullYear(),t.getMonth(),1).getDay(),l=["January","February","March","April","May","June","July","August","September","October","November","December"],d=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],h=()=>{i(new Date(t.getFullYear(),t.getMonth()-1))},u=()=>{i(new Date(t.getFullYear(),t.getMonth()+1))},m=b=>{const y=new Date(Date.UTC(t.getFullYear(),t.getMonth(),b));r(y)},x=b=>{const y=new Date(Date.UTC(t.getFullYear(),t.getMonth(),b)),S=new Date(Date.UTC(s.getFullYear(),s.getMonth(),s.getDate()));return y<S},g=b=>b===s.getUTCDate()&&t.getMonth()===s.getUTCMonth()&&t.getFullYear()===s.getUTCFullYear(),v=b=>e?b===e.getUTCDate()&&t.getMonth()===e.getUTCMonth()&&t.getFullYear()===e.getUTCFullYear():!1;return n.jsxs(bf,{children:[n.jsxs(vf,{children:[n.jsx(_s,{onClick:h,disabled:t.getMonth()===s.getMonth()&&t.getFullYear()===s.getFullYear(),children:"â"}),n.jsxs(yf,{children:[l[t.getMonth()]," ",t.getFullYear()]}),n.jsx(_s,{onClick:u,children:"â"})]}),n.jsxs(wf,{children:[d.map(b=>n.jsx(jf,{children:b},b)),Array.from({length:a}).map((b,y)=>n.jsx(ks,{disabled:!0,style:{visibility:"hidden"},children:" "},`empty-${y}`)),Array.from({length:o}).map((b,y)=>{const S=y+1;return n.jsx(ks,{onClick:()=>m(S),disabled:x(S),isToday:g(S),isSelected:v(S),children:S},S)})]})]})};class Kt{constructor(e=0,t="Network Error"){this.status=e,this.text=t}}const kf=()=>{if(!(typeof localStorage>"u"))return{get:r=>Promise.resolve(localStorage.getItem(r)),set:(r,e)=>Promise.resolve(localStorage.setItem(r,e)),remove:r=>Promise.resolve(localStorage.removeItem(r))}},le={origin:"https://api.emailjs.com",blockHeadless:!1,storageProvider:kf()},Ci=r=>r?typeof r=="string"?{publicKey:r}:r.toString()==="[object Object]"?r:{}:{},Sf=(r,e="https://api.emailjs.com")=>{if(!r)return;const t=Ci(r);le.publicKey=t.publicKey,le.blockHeadless=t.blockHeadless,le.storageProvider=t.storageProvider,le.blockList=t.blockList,le.limitRate=t.limitRate,le.origin=t.origin||e},ma=async(r,e,t={})=>{const i=await fetch(le.origin+r,{method:"POST",headers:t,body:e}),s=await i.text(),o=new Kt(i.status,s);if(i.ok)return o;throw o},fa=(r,e,t)=>{if(!r||typeof r!="string")throw"The public key is required. Visit https://dashboard.emailjs.com/admin/account";if(!e||typeof e!="string")throw"The service ID is required. Visit https://dashboard.emailjs.com/admin";if(!t||typeof t!="string")throw"The template ID is required. Visit https://dashboard.emailjs.com/admin/templates"},Cf=r=>{if(r&&r.toString()!=="[object Object]")throw"The template params have to be the object. Visit https://www.emailjs.com/docs/sdk/send
2268/"},pa=r=>r.webdriver||!r.languages||r.languages.length===0,ga=()=>new Kt(451,"Unavailable For Headless Browser"),Pf=(r,e)=>{if(!Array.isArray(r))throw"The BlockList list has to be an array";if(typeof e!="string")throw"The BlockList watchVariable has to be a string"},Tf=r=>{var e;return!((e=r.list)!=null&&e.length)||!r.watchVariable},Ef=(r,e)=>r instanceof FormData?r.get(e):r[e],xa=(r,e)=>{if(Tf(r))return!1;Pf(r.list,r.watchVariable);const t=Ef(e,r.watchVariable);return typeof t!="string"?!1:r.list.includes(t)},ba=()=>new Kt(403,"Forbidden"),Af=(r,e)=>{if(typeof r!="number"||r<0)throw"The LimitRate throttle has to be a positive number";if(e&&typeof e!="string")throw"The LimitRate ID has to be a non-empty string"},$f=async(r,e,t)=>{const i=Number(await t.get(r)||0);return e-Date.now()+i},va=async(r,e,t)=>{if(!e.throttle||!t)return!1;Af(e.throttle,e.id);const i=e.id||r;return await $f(i,e.throttle,t)>0?!0:(await t.set(i,Date.now().toString()),!1)},ya=()=>new Kt(429,"Too Many Requests"),Of=async(r,e,t,i)=>{const s=Ci(i),o=s.publicKey||le.publicKey,a=s.blockHeadless||le.blockHeadless,l=s.storageProvider||le.storageProvider,d={...le.blockList,...s.blockList},h={...le.limitRate,...s.limitRate};return a&&pa(navigator)?Promise.reject(ga()):(fa(o,r,e),Cf(t),t&&xa(d,t)?Promise.reject(ba()):await va(location.pathname,h,l)?Promise.reject(ya()):ma("/api/v1.0/email/send",JSON.stringify({lib_version:"4.4.1",user_id:o,service_id:r,template_id:e,template_params:t}),{"Content-type":"application/json"}))},If=r=>{if(!r||r.nodeName!=="FORM")throw"The 3rd parameter is expected to be the HTML form element or the style selector of the form"},Df=r=>typeof r=="string"?document.querySelector(r):r,Mf=async(r,e,t,i)=>{const s=Ci(i),o=s.publicKey||le.publicKey,a=s.blockHeadless||le.blockHeadless,l=le.storageProvider||s.storageProvider,d={...le.blockList,...s.blockList},h={...le.limitRate,...s.limitRate};if(a&&pa(navigator))return Promise.reject(ga());const u=Df(t);fa(o,r,e),If(u);const m=new FormData(u);return xa(d,m)?Promise.reject(ba()):await va(location.pathname,h,l)?Promise.reject(ya()):(m.append("lib_version","4.4.1"),m.append("service_id",r),m.append("template_id",e),m.append("user_id",o),ma("/api/v1.0/email/send-form",m))},Xt={init:Sf,send:Of,sendForm:Mf,EmailJSResponseStatus:Kt};Xt.init("s9jDupwpOvpmwFXFZ");const Rf=async r=>{try{console.log("Sending booking confirmation email with data:",r);const e={title:"Booking Confirmation - MediaMill",email:r.customerEmail,name:r.customerName,information:`â BOOKING CONFIRMED â 2269 2270Dear ${r.customerName}, 2271 2272Your booking has been confirmed! Here are your booking details: 2273 2274- Service: ${r.serviceType} 2275- Date: ${r.bookingDate} 2276- Time: ${r.bookingTime} 2277 2278Additional Information: 2279${r.additionalNotes||"No additional notes"} 2280 2281We look forward to working with you! 2282 2283Best regards, 2284MediaMill Team`};console.log("Using template parameters for booking confirmation:",e);const t=await Xt.send("service_rl1jz2g","template_wp9zn5d",e);return console.log("Booking confirmation email sent successfully:",t),{success:!0,message:"Booking confirmation sent!"}}catch(e){throw console.error("Failed to send booking confirmation email:",e),new Error(`Failed to send booking confirmation: ${e instanceof Error?e.message:"Unknown error"}`)}},wa=async r=>{try{console.log("Sending admin notification email with data:",r);const e={title:"New Booking Request - Action Required",email:r.customerEmail,name:"MediaMill Admin",information:`ð NEW BOOKING REQUEST ð 2285 2286A new booking request has been submitted: 2287 2288Customer Details: 2289- Name: ${r.customerName} 2290- Email: ${r.customerEmail} 2291 2292Booking Details: 2293- Service: ${r.serviceType} 2294- Date: ${r.bookingDate} 2295- Time: ${r.bookingTime} 2296 2297Additional Information: 2298${r.additionalNotes||"No additional notes"} 2299 2300Please review this booking request in the admin dashboard and take appropriate action. 2301 2302This is an automated notification.`};console.log("Using template parameters for admin notification:",e);const t=await Xt.send("service_rl1jz2g","template_wp9zn5d",e);return console.log("Admin notification email sent successfully:",t),{success:!0,message:"Admin notification sent!"}}catch(e){throw console.error("Failed to send admin notification email:",e),new Error(`Failed to send admin notification: ${e instanceof Error?e.message:"Unknown error"}`)}},Nf=async r=>{try{console.log("Cancellation - Raw booking data:",JSON.stringify(r,null,2));
2302const e={title:"Booking Cancellation Notice - MediaMill",email:r.customerEmail,name:r.customerName,information:`â ï¸ BOOKING CANCELLED â ï¸ 2303 2304Dear ${r.customerName}, 2305 2306We regret to inform you that your booking has been cancelled. 2307 2308Booking Details: 2309- Service: ${r.serviceType} 2310- Date: ${r.bookingDate} 2311- Time: ${r.bookingTime} 2312 2313${r.additionalNotes||""} 2314 2315If you have any questions about this cancellation, please contact our support team. 2316 2317Best regards, 2318MediaMill Team`};console.log("Cancellation - Template parameters:",JSON.stringify(e,null,2));const t=await Xt.send("service_rl1jz2g","template_wp9zn5d",e);return console.log("Cancellation email sent successfully:",t),{success:!0,message:"Cancellation notification sent!"}}catch(e){throw console.error("Cancellation email error details:",{error:e,bookingData:r,errorMessage:e instanceof Error?e.message:"Unknown error",errorStack:e instanceof Error?e.stack:void 0}),new Error(`Failed to send cancellation notification: ${e instanceof Error?e.message:"Unknown error"}`)}},Ff=async r=>{try{console.log("Sending project completion email with data:",r);const e={title:"Project Completion - MediaMill",email:r.clientEmail,name:r.clientName,information:`ð PROJECT COMPLETED ð 2319 2320Dear ${r.clientName}, 2321 2322Great news! Your project "${r.projectTitle}" has been completed successfully! 2323 2324Project Details: 2325- Project: ${r.projectTitle} 2326- Completion Date: ${r.completionDate} 2327${r.projectDetails?` 2328Additional Details: 2329${r.projectDetails}`:""} 2330 2331Thank you for choosing MediaMill for your project. We hope you're satisfied with the results! 2332 2333If you have any questions or need further assistance, please don't hesitate to contact us. 2334 2335Best regards, 2336MediaMill Team`};console.log("Using template parameters for project completion:",e);const t=await Xt.send("service_rl1jz2g","template_wp9zn5d",e);return console.log("Project completion email sent successfully:",t),{success:!0,message:"Project completion notification sent!"}}catch(e){throw console.error("Failed to send project completion email:",e),new Error(`Failed to send project completion notification: ${e instanceof Error?e.message:"Unknown error"}`)}},Lf=c.div` 2337 padding-top: 80px; 2338 min-height: 100vh; 2339 background: var(--bg-color); 2340 color: var(--text-color); 2341`,zf=c.div` 2342 max-width: 1200px; 2343 margin: 0 auto; 2344 padding: 4rem 2rem; 2345 2346 @media (max-width: 768px) { 2347 padding: 2rem 1rem; 2348 } 2349`,Uf=c.h1` 2350 font-size: clamp(3rem, 5vw, 4.5rem); 2351 font-weight: 900; 2352 margin-bottom: 2rem; 2353 line-height: 1.1; 2354 text-align: center; 2355 2356 @media (max-width: 768px) { 2357 margin-bottom: 1.5rem; 2358 } 2359`,Bf=c.div` 2360 max-width: 800px; 2361 margin: 0 auto; 2362 background: rgba(255, 255, 255, 0.05); 2363 border-radius: 12px; 2364 padding: 2rem; 2365 2366 @media (max-width: 768px) { 2367 padding: 1.5rem; 2368 border-radius: 8px; 2369 } 2370`,qf=c.div` 2371 display: flex; 2372 justify-content: space-between; 2373 margin-bottom: 3rem; 2374 position: relative; 2375 padding: 0 2rem; 2376 2377 &::before { 2378 content: ''; 2379 position: absolute; 2380 top: 50%; 2381 left: 2rem; 2382 right: 2rem; 2383 height: 2px; 2384 background: rgba(255, 255, 255, 0.1); 2385 transform: translateY(-50%); 2386 z-index: 0; 2387 } 2388 2389 @media (max-width: 768px) { 2390 margin-bottom: 2rem; 2391 padding: 0 1rem; 2392 2393 &::before { 2394 left: 1rem; 2395 right: 1rem; 2396 } 2397 } 2398`,Wf=c.div` 2399 width: 40px; 2400 height: 40px; 2401 border-radius: 50%; 2402 background: ${r=>r.completed?"var(--primary-color)":r.active?"rgba(217, 91, 43, 0.2)":"rgba(255, 255, 255, 0.1)"}; 2403 border: 2px solid ${r=>r.active||r.completed?"var(--primary-color)":"rgba(255, 255, 255, 0.1)"}; 2404 color: ${r=>r.completed?"#fff":"rgba(255, 255, 255, 0.8)"}; 2405 display: flex; 2406 align-items: center; 2407 justify-content: center; 2408 font-weight: 600; 2409 position: relative; 2410 z-index: 1; 2411 2412 @media (max-width: 768px) { 2413 width: 32px; 2414 height: 32px; 2415 font-size: 0.9rem; 2416 } 2417`,Me=c.div` 2418 margin-bottom: 2rem; 2419 2420 @media (max-width: 768px) { 2421 margin-bottom: 1.5rem; 2422 } 2423`,Re=c.h2` 2424 font-size: 1.75rem; 2425 color: var(--primary-color); 2426 margin-bottom: 1rem; 2427 2428 @media (max-width: 768px) { 2429 font-size: 1.5rem; 2430 } 2431`,Ne=c.p` 2432 color: rgba(255, 255, 255, 0.8); 2433 font-size: 1.125rem; 2434 line-height: 1.6; 2435 margin-bottom: 2rem; 2436 2437 @media (max-width: 768px) { 2438 font-size: 1rem; 2439 margin-bottom: 1.5rem; 2440 } 2441`,cn=c.div` 2442 display: grid; 2443 grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); 2444 gap: 1rem; 2445 margin-bottom: 2rem; 2446 2447 @media (max-width: 768px) { 2448 grid-template-columns: 1fr; 2449 gap: 0.75rem; 2450 } 2451`,dr=c.button` 2452 background: ${r=>r.selected?"rgba(217, 91, 43, 0.2)":"rgba(255, 255, 255, 0.05)"}; 2453 border: 2px solid ${r=>r.selected?"var(--primary-color)":"transparent"}; 2454 border-radius: 8px; 2455 padding: 1rem; 2456 color: #fff; 2457 text-align: left; 2458 cursor: pointer; 2459 transition: all 0.3s ease; 2460 2461 &:hover {
2462 background: rgba(217, 91, 43, 0.1); 2463 } 2464`;c.div` 2465 display: grid; 2466 grid-template-columns: repeat(7, 1fr); 2467 gap: 0.5rem; 2468 margin-bottom: 2rem; 2469`;c.button` 2470 background: ${r=>r.selected?"rgba(217, 91, 43, 0.2)":r.available?"rgba(255, 255, 255, 0.05)":"rgba(255, 0, 0, 0.1)"}; 2471 border: 2px solid ${r=>r.selected?"var(--primary-color)":"transparent"}; 2472 border-radius: 8px; 2473 padding: 0.5rem; 2474 color: ${r=>r.available?"#fff":"rgba(255, 255, 255, 0.4)"}; 2475 cursor: ${r=>r.available?"pointer":"not-allowed"}; 2476 transition: all 0.3s ease; 2477 2478 &:hover { 2479 background: ${r=>r.available?"rgba(217, 91, 43, 0.1)":"rgba(255, 0, 0, 0.1)"}; 2480 } 2481`;const Hf=c.div` 2482 display: grid; 2483 grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); 2484 gap: 1rem; 2485 margin-bottom: 2rem; 2486`,Vf=c.div` 2487 display: flex; 2488 justify-content: space-between; 2489 margin-top: 2rem; 2490 gap: 1rem; 2491 2492 @media (max-width: 768px) { 2493 flex-direction: column; 2494 margin-top: 1.5rem; 2495 } 2496`,dn=c.button` 2497 background: ${r=>r.primary?"var(--primary-color)":"transparent"}; 2498 border: 2px solid ${r=>r.primary?"transparent":"var(--primary-color)"}; 2499 color: #fff; 2500 padding: 0.75rem 1.5rem; 2501 border-radius: 25px; 2502 cursor: pointer; 2503 font-size: 1rem; 2504 transition: all 0.3s ease; 2505 width: auto; 2506 2507 &:hover { 2508 transform: translateY(-2px); 2509 box-shadow: ${r=>r.primary?"0 4px 12px rgba(217, 91, 43, 0.3)":"none"}; 2510 } 2511 2512 @media (max-width: 768px) { 2513 width: 100%; 2514 padding: 0.75rem 1rem; 2515 font-size: 0.95rem; 2516 2517 &:hover { 2518 transform: none; 2519 } 2520 } 2521`,Gf=c.form` 2522 display: flex; 2523 flex-direction: column; 2524 gap: 1rem; 2525`,un=c.input` 2526 background: rgba(255, 255, 255, 0.05); 2527 border: 1px solid rgba(255, 255, 255, 0.1); 2528 border-radius: 8px; 2529 padding: 0.75rem 1rem; 2530 color: #fff; 2531 font-size: 1rem; 2532 2533 &:focus { 2534 outline: none; 2535 border-color: var(--primary-color); 2536 } 2537`,Yf=c.div` 2538 background: rgba(76, 175, 80, 0.1); 2539 border: 1px solid #4caf50; 2540 color: #4caf50; 2541 padding: 1rem; 2542 border-radius: 8px; 2543 margin-bottom: 1rem; 2544 text-align: center; 2545`,Jf=c.div` 2546 background: rgba(244, 67, 54, 0.1); 2547 border: 1px solid #f44336; 2548 color: #f44336; 2549 padding: 1rem; 2550 border-radius: 8px; 2551 margin-bottom: 1rem; 2552 text-align: center; 2553`,Kf=c.button` 2554 background: var(--primary-color); 2555 border: none; 2556 color: #fff; 2557 padding: 0.75rem 1.5rem; 2558 border-radius: 25px; 2559 cursor: pointer; 2560 font-size: 1rem; 2561 transition: all 0.3s ease; 2562 2563 &:hover { 2564 transform: translateY(-2px); 2565 box-shadow: 0 4px 12px rgba(217, 91, 43, 0.3); 2566 } 2567 2568 &:disabled { 2569 background: rgba(255, 255, 255, 0.1); 2570 cursor: not-allowed; 2571 } 2572`,Xf=()=>{const r=$e(),[e,t]=C.useState(1),[i,s]=C.useState({division:"",service:"",agent:"",date:"",time:"",name:"",email:""}),[o,a]=C.useState(!1),[l,d]=C.useState(null),[h,u]=C.useState(null),[m,x]=C.useState(!1),[g,v]=C.useState(""),[b,y]=C.useState(!1),[S,R]=C.useState(!1),L=["Motion","Still","Design","Web","Campaigns"],B={Motion:["Videography","Motion Graphics","Animation"],Still:["Photography","Photo Editing"],Design:["Graphic Design","Brand Identity","Illustration"],Web:["Web Development","UI/UX Design"],Campaigns:["Digital Marketing","Social Media","Content Strategy"]},z=[{name:"Keron Yan"},{name:"Chinye-Hope Callendar"},{name:"Jason Dottin"}];C.useEffect(()=>{(async()=>{const{data:{session:D}}=await F.auth.getSession();if(D!=null&&D.user){R(!0);const{data:W}=await F.from("profiles").select("*").eq("id",D.user.id).single();W&&s(ie=>({...ie,name:`${W.first_name} ${W.last_name}`,email:W.email}))}})();const{data:{subscription:U}}=F.auth.onAuthStateChange((D,W)=>{R(!!W)});return()=>{U.unsubscribe()}},[]);const ue=async()=>{a(!0),d(null),u(null);try{const{data:{session:w}}=await F.auth.getSession();if(!(w!=null&&w.user))throw new Error("You must be logged in to submit a booking");const{data:U,error:D}=await F.from("service_bookings").insert({user_id:w.user.id,division:i.division,service_type:i.service,agent_name:i.agent,booking_date:i.date,booking_time:i.time,client_name:i.name,client_email:i.email,status:"pending"}).select().single();if(D)throw D;console.log("Booking created successfully, sending admin notification...");try{await wa({customerName:i.name,customerEmail:i.email,serviceType:i.service,bookingDate:i.date,bookingTime:i.time,additionalNotes:`Division: ${i.division} 2573Agent: ${i.agent}`}),console.log("Admin notification sent successfully")}catch(W){console.error("Failed to send admin notification:",W),d("Booking created but failed to send admin notification. Please contact support.")}u("Booking request submitted successfully! You will receive a confirmation email once an admin approves your booking."),t(8),setTimeout(()=>{r("/hub")},3e3)}catch(w){console.error("Error submitting booking:",w),d(w.message||"Failed to submit booking. Please try again.")}finally{a(!1)}},I=async()=>
2573{if(!b){y(!0),d(null),u(null);try{if(m){const{data:w,error:U}=await F.auth.signInWithPassword({email:i.email,password:g});if(U)throw U;if(w.user){const{data:D}=await F.from("profiles").select("*").eq("id",w.user.id).single();D&&s(W=>({...W,name:`${D.first_name} ${D.last_name}`})),u("Login successful!"),t(W=>W+1)}}else{if(!i.name){d("Please enter your full name");return}if(!i.email){d("Please enter your email");return}if(!i.email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)){d("Please enter a valid email address");return}if(!g){d("Please enter a password");return}if(g.length<6){d("Password must be at least 6 characters long");return}const{data:w,error:U}=await F.auth.signUp({email:i.email,password:g,options:{data:{first_name:i.name.split(" ")[0]||"",last_name:i.name.split(" ").slice(1).join(" ")||""}}});if(U)throw U;if(w.user){const{data:D,error:W}=await F.auth.signInWithPassword({email:i.email,password:g});if(W)throw W;const{data:ie}=await $.from("profiles").select("id").eq("id",w.user.id).single();if(ie){const{error:J}=await $.from("profiles").update({first_name:i.name.split(" ")[0]||"",last_name:i.name.split(" ").slice(1).join(" ")||"",email:i.email,company:"",role:"",industry:""}).eq("id",w.user.id);if(J)throw J}u("Registration successful! You are now logged in."),t(J=>J+1)}}}catch(w){console.error("Auth error:",w),d(w.message)}finally{y(!1)}}},M=()=>{if(O()){if(e===6&&S){t(w=>w+2);return}if(e!==6){if(e===7){ue();return}t(e===5&&S?w=>w+2:w=>Math.min(w+1,8))}}},O=()=>{switch(d(null),e){case 1:if(!i.division)return d("Please select a division"),!1;break;case 2:if(!i.service)return d("Please select a service"),!1;break;case 3:if(!i.agent)return d("Please select an agent"),!1;break;case 4:if(!i.date)return d("Please select a date"),!1;break;case 5:if(!i.time)return d("Please select a time"),!1;break;case 6:return!0;case 7:case 8:return!0}return!0},T=()=>{if(e===6&&S)return t(7),null;switch(e){case 1:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Select Division"}),n.jsx(Ne,{children:"Select from Motion, Still, Design, Web or Campaigns for the service you'd like to book."}),n.jsx(cn,{children:L.map(w=>n.jsx(dr,{selected:i.division===w,onClick:()=>s({...i,division:w}),children:w},w))})]});case 2:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Select Service"}),n.jsx(Ne,{children:"Choose the Service Type. For instance in Motion, select whether you'd like to book a meeting to schedule a Videography or Motion Graphics project."}),n.jsx(cn,{children:i.division&&B[i.division].map(w=>n.jsx(dr,{selected:i.service===w,onClick:()=>s({...i,service:w}),children:w},w))})]});case 3:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Select Agent"}),n.jsx(Ne,{children:"Choose who you'd like to meet with."}),n.jsx(cn,{children:z.map(w=>n.jsx(dr,{selected:i.agent===w.name,onClick:()=>s({...i,agent:w.name}),children:w.name},w.name))})]});case 4:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Select Date"}),n.jsx(Ne,{children:"Select the date most convenient for you. Past dates are automatically disabled."}),n.jsx(_f,{selectedDate:i.date?new Date(i.date):void 0,onDateSelect:w=>{const U=w.getUTCFullYear(),D=String(w.getUTCMonth()+1).padStart(2,"0"),W=String(w.getUTCDate()).padStart(2,"0");s({...i,date:`${U}-${D}-${W}`})}})]});case 5:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Select Time"}),n.jsx(Ne,{children:"Choose the time. Meetings are set for 1 hour duration."}),n.jsx(Hf,{children:["9:00 AM","10:00 AM","11:00 AM","1:00 PM","2:00 PM","3:00 PM"].map(w=>n.jsx(dr,{selected:i.time===w,onClick:()=>s({...i,time:w}),children:w},w))})]});case 6:return S?null:n.jsxs(Me,{children:[n.jsx(Re,{children:"Register or Login"}),n.jsx(Ne,{children:m?"Welcome back! Please login to continue.":"Create an account to book your service."}),h&&n.jsx("div",{style:{background:"rgba(76, 175, 80, 0.1)",border:"1px solid #4caf50",color:"#4caf50",padding:"1rem",borderRadius:"8px",marginBottom:"1rem",textAlign:"center"},children:h}),n.jsxs(Gf,{onSubmit:w=>{w.preventDefault(),I()},children:[!m&&n.jsx(un,{type:"text",placeholder:"Full Name",value:i.name,onChange:w=>s({...i,name:w.target.value}),required:!0}),n.jsx(un,{type:"email",placeholder:"Email Address",value:i.email,onChange:w=>s({...i,email:w.target.value}),required:!0}),n.jsx(un,{type:"password",placeholder:"Password",value:g,onChange:w=>v(w.target.value),required:!0}),n.jsx(Kf,{type:"submit",disabled:b,children:b?"Processing...":m?"Login":"Register"})]}),n.jsx("div",{style:{marginTop:"1rem",textAlign:"center",color:"rgba(255, 255, 255, 0.7)"},children:m?n.jsxs(n.Fragment,{children:["Don't have an account?"," ",n.jsx("button",{onClick:()=>x(!1),style:{background:"none",border:"none",color:"var(--primary-color)",cursor:"pointer",padding:0,font:"inherit",textDecoration:"underline"},children:"Register here"})]}):n.jsxs(n.Fragment,{children:["Already have an account?"," ",n.jsx("button",{onClick:()=>x(!0),style:{background:"none",border:"none",color:"var(--primary-color)",cursor:"pointer",padding:0,font:"inherit",textDecoration:"underline"},children:"Login here"})]})})]});case 7:return n.jsxs(Me,{children:[n.jsx(Re,{children:"Review"}),n.jsx(Ne,{children:"Review your booking information."}),n.jsxs("div",{style:{color:"rgba(255, 255, 255, 0.8)"},children:[n.jsxs("p",{children:["Division: ",i.division]}),n.jsxs("p",{children:["Service: ",i.service]}),n.jsxs("p",{children:["Agent: ",i.agent]}),n.jsxs("p",{children:["Date: ",i.date]}),n.jsxs("p",{children:["Time: ",i.time]}),n.jsxs("p",{children:["Name: ",i.name]}),n.jsxs("p",{children:["Email: ",i.email]})]})]});case 8:return n.jsxs(Me,{children:[n.jsx(Re,{children:"That's It!"}),n.jsx(Ne,{children:"Your meeting is all booked. Select the User icon in the Menu to go to your Hub. Here you can view all your past and current bookings, cancel them or chat with your service agent."}),n.jsx(ce,{to:"/hub-registration",style:{color:"var(--primary-color)"},children:"View your Hub for more information"})]});default:return null}};return n.jsx(Lf,{children:n.jsxs(zf,{children:[n.jsx(Uf,{children:"Book a Service"}),n.jsxs(Bf,{children:[l&&n.jsx(Jf,{children:l}),h&&n.jsx(Yf,{children:h}),n.jsx(qf,{children:Array.from({length:S?7:8},(w,U)=>n.jsx(Wf,{active:e===U+1,completed:e>U+1,children:U+1},U+1))}),T(),n.jsxs(Vf,{children:[e>1&&e<8&&n.jsx(dn,{onClick:()=>{t(e===7&&S?5:w=>Math.max(w-1,1))},children:"Back"}),e<8?n.jsx(dn,{primary:!0,onClick:M,disabled:o,children:e===7?o?"Submitting...":"Confirm Booking":"Next"}):n.jsx(dn,{primary:!0,as:ce,to:"/hub",children:"Go to Hub"})]})]})]})})};async function Qf({to:r,subject:e,content:t}){try{const{data:i,error:s}=await F.functions.invoke("send-email",{body:{to:r,subject:e,content:t}});if(s)throw console.error("Error sending email:",s),s;return i}catch(i){throw console.error("Error in sendEmailNotification:",i),i}}async function Zf(r){try{const{data:e,error:t}=await F.from("profiles").select("email").eq("role","admin");if(t)throw t;for(const i of e)await Qf({to:i.email,subject:"New Meeting Scheduled",content:` 2574 A new meeting has been scheduled: 2575 2576 Date: ${new Date(r.date).toLocaleDateString()} 2577 Time: ${r.time} 2578 Purpose: ${r.purpose||"Quick Meeting"} 2579 2580 Please check your calendar and confirm your availability. 2581 `})}catch(e){throw console.error("Error in notifyAdminsNewMeeting:",e),e}}const ep=c.div` 2582 padding-top: 80px; 2583 min-height: 100vh; 2584 background: var(--bg-color); 2585 color: var(--text-color); 2586`,tp=c.div` 2587 max-width: 1400px; 2588 margin: 0 auto; 2589 padding: 4rem 2rem; 2590 2591 @media (max-width: 768px) { 2592 padding: 2rem 1rem; 2593 } 2594`,rp=c.div` 2595 margin-bottom: 4rem; 2596 2597 @media (max-width: 768px) { 2598 margin-bottom: 2rem; 2599 } 2600`,np=c.h1` 2601 font-size: clamp(2rem, 5vw, 4.5rem); 2602 font-weight: 900; 2603 margin-bottom: 1rem; 2604 line-height: 1.1; 2605 2606 @media (max-width: 768px) { 2607 margin-bottom: 0.75rem; 2608 } 2609`,ip=c.p` 2610 font-size: clamp(1rem, 2vw, 1.25rem); 2611 color: rgba(255, 255, 255, 0.8); 2612 max-width: 800px; 2613 line-height: 1.6; 2614`,sp=c.div` 2615 display: grid; 2616 grid-template-columns: 2fr 1fr; 2617 gap: 2rem; 2618 2619 @media (max-width: 1024px) { 2620 grid-template-columns: 1fr; 2621 } 2622`,op=c.div` 2623 display: flex; 2624 flex-direction: column; 2625 gap: 2rem; 2626`,ap=c.div` 2627 display: flex; 2628 flex-direction: column; 2629 gap: 2rem; 2630`,Ss=c.div` 2631 background: rgba(255, 255, 255, 0.05); 2632 border-radius: 12px; 2633 padding: 2rem; 2634 border: 1px solid rgba(255, 255, 255, 0.1); 2635 transition: all 0.3s ease; 2636 2637 &:hover { 2638 border-color: var(--primary-color); 2639 } 2640 2641 @media (max-width: 768px) { 2642 padding: 1.5rem; 2643 border-radius: 8px; 2644 } 2645`,Cs=c.h3` 2646 font-size: clamp(1.25rem, 3vw, 1.5rem); 2647 color: var(--primary-color); 2648 margin-bottom: 1.5rem; 2649 display: flex; 2650 justify-content: space-between; 2651 align-items: center; 2652 gap: 1rem; 2653 flex-wrap: wrap; 2654 2655 @media (max-width: 768px) { 2656 margin-bottom: 1rem; 2657 flex-direction: column; 2658 align-items: stretch; 2659 } 2660 2661 div.button-group { 2662 display: flex; 2663 gap: 0.5rem; 2664 2665 @media (max-width: 768px) { 2666 flex-direction: row; 2667 width: 100%; 2668 } 2669 } 2670`,Ps=c.div` 2671 display: flex; 2672 flex-direction: column; 2673 gap: 1rem; 2674`,lp=c(ce)` 2675 text-decoration: none; 2676 color: inherit; 2677 display: block; 2678`,li=c.div` 2679 background: rgba(255, 255, 255, 0.03); 2680 border-radius: 8px; 2681 padding: 1.5rem; 2682 border: 1px solid rgba(255, 255, 255, 0.05); 2683 transition: all 0.3s ease;
2684 cursor: pointer; 2685 2686 &:hover { 2687 transform: translateX(5px); 2688 border-color: var(--primary-color); 2689 background: rgba(255, 255, 255, 0.05); 2690 } 2691 2692 @media (max-width: 768px) { 2693 padding: 1rem; 2694 2695 &:hover { 2696 transform: none; 2697 } 2698 } 2699`,cp=c.div` 2700 display: flex; 2701 justify-content: space-between; 2702 align-items: flex-start; 2703 margin-bottom: 1rem; 2704 gap: 1rem; 2705 flex-wrap: wrap; 2706 2707 @media (max-width: 768px) { 2708 margin-bottom: 0.75rem; 2709 } 2710`,ci=c.h4` 2711 font-size: clamp(1.1rem, 2vw, 1.25rem); 2712 color: #fff; 2713 margin: 0; 2714`,dp=c.span` 2715 display: inline-block; 2716 padding: 0.25rem 0.75rem; 2717 border-radius: 15px; 2718 font-size: 0.875rem; 2719 font-weight: 500; 2720 background: ${r=>r.status==="pending"?"rgba(255, 193, 7, 0.2)":r.status==="active"?"rgba(76, 175, 80, 0.2)":r.status==="review"?"rgba(33, 150, 243, 0.2)":"rgba(158, 158, 158, 0.2)"}; 2721 color: ${r=>r.status==="pending"?"#ffc107":r.status==="active"?"#4caf50":r.status==="review"?"#2196f3":"#9e9e9e"}; 2722`,up=c.div` 2723 width: 100%; 2724 height: 6px; 2725 background: rgba(255, 255, 255, 0.1); 2726 border-radius: 3px; 2727 margin: 1rem 0; 2728 position: relative; 2729 overflow: hidden; 2730 2731 &::after { 2732 content: ''; 2733 position: absolute; 2734 left: 0; 2735 top: 0; 2736 height: 100%; 2737 width: ${r=>r.progress}%; 2738 background: var(--primary-color); 2739 border-radius: 3px; 2740 transition: width 0.3s ease; 2741 } 2742`,hp=c.div` 2743 display: grid; 2744 grid-template-columns: repeat(3, 1fr); 2745 gap: 1rem; 2746 margin-top: 1rem; 2747 2748 @media (max-width: 480px) { 2749 grid-template-columns: repeat(2, 1fr); 2750 } 2751`,hn=c.div` 2752 text-align: center; 2753 padding: 0.5rem; 2754 background: rgba(255, 255, 255, 0.03); 2755 border-radius: 6px; 2756 2757 h5 { 2758 font-size: 0.875rem; 2759 color: rgba(255, 255, 255, 0.6); 2760 margin: 0 0 0.25rem 0; 2761 } 2762 2763 p { 2764 font-size: clamp(0.9rem, 2vw, 1rem); 2765 color: #fff; 2766 margin: 0; 2767 display: flex; 2768 align-items: center; 2769 justify-content: center; 2770 gap: 0.5rem; 2771 } 2772 2773 @media (max-width: 768px) { 2774 padding: 0.4rem; 2775 } 2776`,mp=c.button` 2777 background: transparent; 2778 border: 1px solid var(--primary-color); 2779 color: var(--primary-color); 2780 padding: 0.5rem 1rem; 2781 border-radius: 20px; 2782 cursor: pointer; 2783 transition: all 0.3s ease; 2784 font-size: 0.875rem; 2785 white-space: nowrap; 2786 2787 &:hover { 2788 background: var(--primary-color); 2789 color: #fff; 2790 } 2791 2792 @media (max-width: 768px) { 2793 padding: 0.4rem 0.75rem; 2794 font-size: 0.8rem; 2795 } 2796`;c.div` 2797 display: flex; 2798 flex-direction: column; 2799 gap: 1rem; 2800`;c.div` 2801 display: flex; 2802 gap: 1rem; 2803 align-items: flex-start; 2804 padding-bottom: 1rem; 2805 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 2806 2807 &:last-child { 2808 border-bottom: none; 2809 } 2810`;c.div` 2811 width: 32px; 2812 height: 32px; 2813 border-radius: 50%; 2814 display: flex; 2815 align-items: center; 2816 justify-content: center; 2817 background: ${r=>r.type==="message"?"rgba(33, 150, 243, 0.2)":r.type==="update"?"rgba(76, 175, 80, 0.2)":"rgba(255, 193, 7, 0.2)"}; 2818 color: ${r=>r.type==="message"?"#2196f3":r.type==="update"?"#4caf50":"#ffc107"}; 2819`;c.div` 2820 flex: 1; 2821 2822 h4 { 2823 font-size: 1rem; 2824 color: #fff; 2825 margin: 0 0 0.25rem 0; 2826 } 2827 2828 p { 2829 font-size: 0.875rem; 2830 color: rgba(255, 255, 255, 0.6); 2831 margin: 0; 2832 } 2833`;c.span` 2834 font-size: 0.75rem; 2835 color: rgba(255, 255, 255, 0.4); 2836`;const fp=c(ce)` 2837 display: inline-flex; 2838 align-items: center; 2839 color: var(--primary-color); 2840 text-decoration: none; 2841 font-size: 0.875rem; 2842 margin-top: 1rem; 2843 transition: all 0.3s ease; 2844 2845 &:hover { 2846 color: #ff8c1a; 2847 } 2848 2849 &::after { 2850 content: 'â'; 2851 margin-left: 0.25rem; 2852 } 2853`,pp=c.div` 2854 position: fixed; 2855 top: 0; 2856 left: 0; 2857 right: 0; 2858 bottom: 0; 2859 background: rgba(0, 0, 0, 0.8); 2860 display: flex; 2861 justify-content: center; 2862 align-items: center; 2863 z-index: 1000; 2864`,gp=c.div` 2865 background: var(--bg-color); 2866 border: 1px solid rgba(255, 255, 255, 0.1); 2867 border-radius: 12px; 2868 padding: 2rem; 2869 max-width: 500px; 2870 width: 90%; 2871 position: relative; 2872`,xp=c.h3` 2873 font-size: 1.5rem; 2874 color: var(--primary-color); 2875 margin: 0; 2876`,bp=c.div` 2877 display: flex; 2878 justify-content: space-between; 2879 align-items: center; 2880 margin-bottom: 1.5rem; 2881`,vp=c.button` 2882 background: none; 2883 border: none; 2884 color: rgba(255, 255, 255, 0.6); 2885 cursor: pointer; 2886 font-size: 1.5rem; 2887 padding: 0; 2888 transition: color 0.3s ease; 2889 2890 &:hover { 2891 color: var(--primary-color); 2892 } 2893`,Et=c.div` 2894 margin-bottom: 1rem; 2895 2896 h4 { 2897 color: rgba(255, 255, 255, 0.6); 2898 font-size: 0.9rem; 2899 margin-bottom: 0.25rem; 2900 } 2901 2902 p { 2903 color: #fff; 2904 font-size: 1.1rem; 2905 margin: 0; 2906 } 2907`,ur=c.button` 2908 background: var(--primary-color); 2909 color: white; 2910 border: none; 2911 border-radius: 8px; 2912 padding: 0.75rem 1rem; 2913 font-size: 1rem; 2914 cursor: pointer; 2915 transition: background 0.2s; 2916 flex: 1; 2917 white-space: nowrap; 2918 2919 &:hover { 2920 background: #ff8c1a; 2921 } 2922 2923 @media (max-width: 768px) { 2924 width: 100%; 2925 padding: 0.75rem; 2926 font-size: 0.95rem; 2927 } 2928`,yp=c.div` 2929 position: fixed; 2930 top: 0; 2931 left: 0; 2932 width: 100vw; 2933 height: 100vh; 2934 background: rgba(0,0,0,0.7); 2935 display: flex; 2936 align-items: center; 2937 justify-content: center; 2938 z-index: 2000; 2939`,wp=c.div` 2940 background: var(--bg-color); 2941 border-radius: 12px; 2942 padding: 2rem 2.5rem; 2943 min-width: 340px; 2944 max-width: 95vw; 2945 box-shadow: 0 2px 16px rgba(0,0,0,0.15); 2946 display: flex; 2947 flex-direction: column; 2948 gap: 1.25rem; 2949`,jp=c.h3` 2950 color: var(--primary-color); 2951 margin: 0 0 1rem 0; 2952`,Ts=c.input` 2953 padding: 0.75rem 1rem; 2954 border-radius: 8px; 2955 border: 1px solid rgba(255,255,255,0.2); 2956 background: rgba(255,255,255,0.08); 2957 color: var(--text-color); 2958 font-size: 1rem; 2959 &:focus { 2960 outline: none; 2961 border-color: var(--primary-color); 2962 } 2963`,Es=c.div` 2964 position: relative; 2965 width: 100%; 2966 2967 &::after { 2968 content: ''; 2969 position: absolute; 2970 right: 1rem; 2971 top: 50%; 2972 transform: translateY(-50%);
2973 width: 20px; 2974 height: 20px; 2975 background-size: contain; 2976 background-repeat: no-repeat; 2977 pointer-events: none; 2978 } 2979 2980 &.date::after { 2981 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11z'/%3E%3C/svg%3E"); 2982 } 2983 2984 &.time::after { 2985 background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E"); 2986 } 2987 2988 input[type="date"], input[type="time"] { 2989 padding-right: 2.5rem; 2990 cursor: pointer; 2991 position: relative; 2992 background: rgba(255,255,255,0.08); 2993 } 2994 2995 /* Hide default calendar and clock icons */ 2996 input[type="date"]::-webkit-calendar-picker-indicator, 2997 input[type="time"]::-webkit-calendar-picker-indicator { 2998 opacity: 0; 2999 width: 100%; 3000 height: 100%; 3001 position: absolute; 3002 top: 0; 3003 left: 0; 3004 cursor: pointer; 3005 } 3006`,_p=c.textarea` 3007 padding: 0.75rem 1rem; 3008 border-radius: 8px; 3009 border: 1px solid rgba(255,255,255,0.2); 3010 background: rgba(255,255,255,0.08); 3011 color: var(--text-color); 3012 font-size: 1rem; 3013 min-height: 80px; 3014 resize: vertical; 3015 &:focus { 3016 outline: none; 3017 border-color: var(--primary-color); 3018 } 3019`,kp=c.div` 3020 display: flex; 3021 gap: 1rem; 3022 justify-content: flex-end; 3023`,Sp=({project:r})=>{var o,a,l,d;if(!r)return null;const e=((a=(o=r.tasks)==null?void 0:o.filter(h=>h.completed))==null?void 0:a.length)||0,t=((l=r.tasks)==null?void 0:l.length)||0,i=t>0?Math.round(e/t*100):0,s=((d=r.team_members)==null?void 0:d.length)||0;return n.jsx(lp,{to:`/hub/project/${r.id}`,children:n.jsxs(li,{children:[n.jsxs(cp,{children:[n.jsx(ci,{children:r.title}),n.jsx(dp,{status:r.status,children:r.status.charAt(0).toUpperCase()+r.status.slice(1)})]}),r.client&&n.jsxs("div",{style:{color:"rgba(255, 255, 255, 0.7)",fontSize:"0.9rem",marginBottom:"0.5rem"},children:[n.jsx("strong",{children:"Client:"})," ",r.client.first_name," ",r.client.last_name,r.client.company&&` (${r.client.company})`]}),n.jsx(up,{progress:r.progress||0}),n.jsxs(hp,{children:[n.jsxs(hn,{children:[n.jsx("h5",{children:"Tasks"}),n.jsxs("p",{children:[e,"/",t,n.jsxs("span",{style:{fontSize:"0.875rem",color:"rgba(255, 255, 255, 0.6)"},children:["(",i,"%)"]})]})]}),n.jsxs(hn,{children:[n.jsx("h5",{children:"Team"}),n.jsxs("p",{children:[s," members"]})]}),n.jsxs(hn,{children:[n.jsx("h5",{children:"Due Date"}),n.jsx("p",{children:r.deadline?new Date(r.deadline).toLocaleDateString():"No deadline"})]})]}),n.jsx(fp,{to:`/hub/project/${r.id}`,children:"View details"})]})})},Cp=({meeting:r,onClose:e})=>r?n.jsx(pp,{onClick:e,children:n.jsxs(gp,{onClick:t=>t.stopPropagation(),children:[n.jsxs(bp,{children:[n.jsx(xp,{children:"Meeting Details"}),n.jsx(vp,{onClick:e,children:"Ã"})]}),n.jsxs(Et,{children:[n.jsx("h4",{children:"Service Type"}),n.jsx("p",{children:r.service_type})]}),n.jsxs(Et,{children:[n.jsx("h4",{children:"Division"}),n.jsx("p",{children:r.division})]}),n.jsxs(Et,{children:[n.jsx("h4",{children:"Agent"}),n.jsx("p",{children:r.agent_name})]}),n.jsxs(Et,{children:[n.jsx("h4",{children:"Date & Time"}),n.jsxs("p",{children:[new Date(r.booking_date).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})," at ",r.booking_time]})]}),n.jsxs(Et,{children:[n.jsx("h4",{children:"Status"}),n.jsx("p",{style:{color:r.status==="pending"?"#ffc107":r.status==="completed"?"#4caf50":"#ff4444"},children:r.status.charAt(0).toUpperCase()+r.status.slice(1)})]})]})}):null,Pp=()=>{var M;const r=$e(),[e,t]=C.useState(null),[i,s]=C.useState([]),[o,a]=C.useState(!0),[l,d]=C.useState([]),[h,u]=C.useState(null),[m,x]=C.useState(!1),[g,v]=C.useState({details:"",date:"",time:""}),[b,y]=C.useState(!1),[S,R]=C.useState("");C.useEffect(()=>{F.auth.getSession().then(({data:{session:T}})=>{T!=null&&T.user?(L(T.user.id),B(T.user.id)):r("/login")});const{data:{subscription:O}}=F.auth.onAuthStateChange((T,w)=>{w!=null&&w.user?(L(w.user.id),B(w.user.id)):r("/login")});return()=>{O.unsubscribe()}},[r]),C.useEffect(()=>{(async()=>{const{data:{session:T}}=await F.auth.getSession();if(T!=null&&T.user){const w=new Date;w.setHours(0,0,0,0);const{data:U,error:D}=await F.from("service_bookings").select("*").eq("user_id",T.user.id).eq("status","pen
3023ding").gte("booking_date",w.toISOString()).order("booking_date",{ascending:!0}).order("booking_time",{ascending:!0}).limit(5);D?console.error("Error fetching meetings:",D):d(U||[])}})()},[]);const L=async O=>{const{data:T,error:w}=await F.from("profiles").select("*").eq("id",O).single();!w&&T&&t(T)},B=async O=>{try{console.log("Fetching projects for user:",O);const{data:T,error:w}=await $.from("projects").select(` 3024 *, 3025 client:profiles!projects_client_id_fkey ( 3026 first_name, 3027 last_name, 3028 company 3029 ) 3030 `).eq("client_id",O);if(w)throw console.error("Error fetching projects:",w),w;if(!T||T.length===0){console.log("No projects found"),s([]);return}const U=await Promise.all(T.map(async J=>{try{console.log(`Fetching tasks for project ${J.id} using RPC function...`);const{data:_,error:k}=await $.rpc("client_view_project_tasks",{p_project_id:J.id});return k?(console.error(`Error fetching tasks for project ${J.id}:`,k),{...J,tasks:[]}):(console.log(`Found ${(_==null?void 0:_.length)||0} tasks for project ${J.id}`),{...J,tasks:_||[]})}catch(_){return console.error(`Error in task fetching for project ${J.id}:`,_),{...J,tasks:[]}}})),{data:D,error:W}=await $.from("project_members").select("*").in("project_id",T.map(J=>J.id));W&&console.error("Error fetching project members:",W);const ie=U.map(J=>({...J,team_members:(D||[]).filter(_=>_.project_id===J.id)||[],client:J.client||null}));console.log("Transformed projects:",ie),s(ie)}catch(T){console.error("Error in fetchProjects:",T),s([])}finally{a(!1)}},z=(O,T)=>{const w=new Date(O),U=new Date,D=new Date(U);return D.setDate(D.getDate()+1),w.toDateString()===U.toDateString()?`Today, ${T}`:w.toDateString()===D.toDateString()?`Tomorrow, ${T}`:`${w.toLocaleDateString("en-US",{weekday:"long"})}, ${T}`},ue=O=>{const{name:T,value:w}=O.target;if(T==="date"){const U=new Date(w),D=new Date;if(D.setHours(0,0,0,0),U<D)return}v({...g,[T]:w})},I=async O=>{O.preventDefault(),R(""),y(!0);try{const{data:{session:T}}=await F.auth.getSession();if(!(T!=null&&T.user))throw new Error("Not authenticated");const{data:w,error:U}=await F.from("profiles").select("first_name, last_name, email, company").eq("id",T.user.id).single();if(U)throw U;const{details:D,date:W,time:ie}=g;if(!D||!W||!ie){R("All fields are required."),y(!1);return}const J=new Date(`2000-01-01T${ie}`).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),_=`${w.first_name} ${w.last_name}`,{data:k,error:P}=await F.from("service_bookings").insert({user_id:T.user.id,service_type:D,division:"-",agent_name:"-",booking_date:W,booking_time:J,client_name:_,client_email:w.email,status:"pending"}).select().single();if(P)throw P;console.log("Quick meeting created successfully, sending admin notifications...");try{await Promise.all([wa({customerName:_,customerEmail:w.email,serviceType:D,bookingDate:W,bookingTime:J,additionalNotes:"Qu
3030ick meeting request"}),Zf({date:W,time:J,purpose:D,client:_,email:w.email})]),console.log("Admin notifications sent successfully")}catch(H){console.error("Failed to send admin notifications:",H),R("Meeting booked but failed to send admin notifications. Please contact support.")}x(!1),v({details:"",date:"",time:""});const N=new Date;N.setHours(0,0,0,0);const{data:Z,error:X}=await F.from("service_bookings").select("*").eq("user_id",T.user.id).eq("status","pending").gte("booking_date",N.toISOString()).order("booking_date",{ascending:!0}).order("booking_time",{ascending:!0}).limit(5);X||d(Z||[])}catch(T){console.error("Error creating quick meeting:",T),R(T.message||"Failed to create meeting.")}finally{y(!1)}};return n.jsxs(ep,{children:[n.jsxs(tp,{children:[n.jsxs(rp,{children:[n.jsxs(np,{children:["WELCOME BACK, ",((M=e==null?void 0:e.first_name)==null?void 0:M.toUpperCase())||"USER"]}),n.jsx(ip,{children:"Track your project progress, manage tasks, and collaborate with your team."})]}),n.jsxs(sp,{children:[n.jsx(op,{children:n.jsxs(Ss,{children:[n.jsx(Cs,{children:"Active Projects"}),o?n.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"Loading projects..."}):i.length===0?n.jsx("div",{style:{textAlign:"center",padding:"2rem",color:"rgba(255, 255, 255, 0.6)"},children:"No projects found"}):n.jsx(Ps,{children:i.map(O=>n.jsx(Sp,{project:O},O.id))})]})}),n.jsx(ap,{children:n.jsxs(Ss,{children:[n.jsxs(Cs,{children:["Upcoming Meetings",n.jsxs("div",{className:"button-group",children:[n.jsx(ur,{onClick:()=>r("/book-service"),children:"+ New Booking"}),n.jsx(ur,{style:{background:"#2196f3"},onClick:()=>x(!0),children:"Quick Meeting"})]})]}),n.jsxs(Ps,{children:[l.map(O=>n.jsxs(li,{children:[n.jsx(ci,{children:O.service_type}),n.jsx("p",{style:{color:"rgba(255, 255, 255, 0.6)"},children:z(O.booking_date,O.booking_time)}),n.jsx("div",{style:{marginTop:"0.5rem"},children:n.jsx(mp,{onClick:()=>u(O),children:"View Details"})})]},O.id)),l.length===0&&n.jsx(li,{children:n.jsx(ci,{children:"No upcoming meetings"})})]})]})})]})]}),h&&n.jsx(Cp,{meeting:h,onClose:()=>u(null)}),m&&n.jsx(yp,{onClick:()=>x(!1),children:n.jsxs(wp,{onClick:O=>O.stopPropagation(),children:[n.jsx(jp,{children:"Quick Meeting"}),n.jsxs("form",{onSubmit:I,style:{display:"flex",flexDirection:"column",gap:"1rem"},children:[n.jsx(_p,{name:"details",placeholder:"Meeting details",value:g.details,onChange:ue,required:!0}),n.jsx(Es,{className:"date",children:n.jsx(Ts,{type:"date",name:"date",value:g.date,onChange:ue,min:new Date().toISOString().split("T")[0],required:!0})}),n.jsx(Es,{className:"time",children:n.jsx(Ts,{type:"time",name:"time",value:g.time,onChange:ue,required:!0})}),S&&n.jsx("div",{style:{color:"#ff4d4d",textAlign:"center"},children:S}),n.jsxs(kp,{children:[n.jsx(ur,{type:"button",style:{background:"#888"},onClick:()=>x(!1),children:"Cancel"}),n.jsx(ur,{type:"submit",disabled:b,children:b?"Booking...":"Book Meeting"})]})]})]})})]})},Tp=c.div` 3031 padding-top: 80px; 3032 min-height: 100vh; 3033 background: var(--bg-color); 3034 color: var(--text-color); 3035`,Ep=c.div` 3036 max-width: 1200px; 3037 margin: 0 auto; 3038 padding: 4rem 2rem; 3039 display: flex; 3040 flex-direction: column; 3041 align-items: center; 3042`,Ap=c.h1` 3043 font-size: clamp(2.5rem, 5vw, 3.5rem); 3044 font-weight: 900; 3045 margin-bottom: 2rem; 3046 text-align: center; 3047`,$p=c.div` 3048 width: 100%; 3049 max-width: 600px; 3050 background: rgba(255, 255, 255, 0.05); 3051 border-radius: 12px; 3052 padding: 2.5rem; 3053 border: 1px solid rgba(255, 255, 255, 0.1); 3054`,Op=c.form` 3055 display: flex; 3056 flex-direction: column; 3057 gap: 1.5rem; 3058`,As=c.div` 3059 display: grid; 3060 grid-template-columns: 1fr 1fr; 3061 gap: 1.5rem; 3062 3063 @media (max-width: 600px) { 3064 grid-template-columns: 1fr; 3065 } 3066`,Fe=c.div` 3067 display: flex; 3068 flex-direction: column; 3069 gap: 0.5rem; 3070`,Le=c.label` 3071 font-size: 0.95rem; 3072 color: rgba(255, 255, 255, 0.8); 3073`,ut=c.input` 3074 padding: 0.75rem 1rem; 3075 background: rgba(255, 255, 255, 0.07); 3076 border: 1px solid rgba(255, 255, 255, 0.1); 3077 border-radius: 6px; 3078 color: var(--text-color); 3079 font-size: 1rem; 3080 transition: all 0.3s ease; 3081 3082 &:focus { 3083 outline: none; 3084 border-color: var(--primary-color); 3085 box-shadow: 0 0 0 2px rgba(255, 125, 0, 0.2); 3086 } 3087 3088 &::placeholder { 3089 color: rgba(255, 255, 255, 0.4); 3090 } 3091`,$s=c.select` 3092 padding: 0.75rem 1rem; 3093 background: rgba(255, 255, 255, 0.07); 3094 border: 1px solid rgba(255, 255, 255, 0.1); 3095 border-radius: 6px; 3096 color: var(--text-color); 3097 font-size: 1rem; 3098 transition: all 0.3s ease; 3099 3100 &:focus { 3101 outline: none; 3102 border-color: var(--primary-color); 3103 box-shadow: 0 0 0 2px rgba(255, 125, 0, 0.2); 3104 } 3105 3106 option { 3107 background: var(--bg-color); 3108 } 3109`,Pe=c.span` 3110 color: #ff4d4d; 3111 font-size: 0.85rem; 3112 margin-top: 0.25rem; 3113`,Ip=c.button` 3114 background: var(--primary-color); 3115 color: #fff; 3116 font-weight: 600; 3117 border: none; 3118 border-radius: 6px; 3119 padding: 1rem; 3120 font-size: 1rem; 3121 cursor: pointer; 3122 transition: all 0.3s ease; 3123 margin-top: 1rem; 3124 3125 &:hover { 3126 background: #ff8c1a; 3127 } 3128 3129 &:disabled { 3130 background: rgba(255, 125, 0, 0.5);
3131 cursor: not-allowed; 3132 } 3133`,Dp=c.div` 3134 background: rgba(76, 175, 80, 0.2); 3135 border: 1px solid rgba(76, 175, 80, 0.4); 3136 color: #4caf50; 3137 padding: 1.5rem; 3138 border-radius: 6px; 3139 margin-bottom: 1.5rem; 3140 text-align: center; 3141 display: flex; 3142 flex-direction: column; 3143 gap: 1rem; 3144`,Os=c.p` 3145 color: rgba(255, 255, 255, 0.8); 3146 font-size: 0.95rem; 3147 line-height: 1.5; 3148`,Mp=c.button` 3149 background: none; 3150 border: 1px solid var(--primary-color); 3151 color: var(--primary-color); 3152 padding: 0.5rem 1rem; 3153 border-radius: 4px; 3154 cursor: pointer; 3155 font-size: 0.9rem; 3156 margin-top: 0.5rem; 3157 transition: all 0.3s ease; 3158 3159 &:hover { 3160 background: rgba(255, 107, 74, 0.1); 3161 } 3162 3163 &:disabled { 3164 opacity: 0.5; 3165 cursor: not-allowed; 3166 } 3167`,Rp=()=>{$e();const[r,e]=C.useState({firstName:"",lastName:"",email:"",company:"",role:"",industry:"",password:"",confirmPassword:""}),[t,i]=C.useState({}),[s,o]=C.useState(!1),[a,l]=C.useState(!1),[d,h]=C.useState(!1),u=v=>{const{name:b,value:y}=v.target;e(S=>({...S,[b]:y})),t[b]&&i({...t,[b]:""})},m=()=>{let v=!0;const b={...t};return r.firstName.trim()||(b.firstName="First name is required",v=!1),r.lastName.trim()||(b.lastName="Last name is required",v=!1),r.email.trim()?/\S+@\S+\.\S+/.test(r.email)||(b.email="Email is invalid",v=!1):(b.email="Email is required",v=!1),r.company.trim()||(b.company="Company name is required",v=!1),r.role||(b.role="Please select a role",v=!1),r.industry||(b.industry="Please select an industry",v=!1),r.password?r.password.length<8&&(b.password="Password must be at least 8 characters",v=!1):(b.password="Password is required",v=!1),r.confirmPassword?r.password!==r.confirmPassword&&(b.confirmPassword="Passwords do not match",v=!1):(b.confirmPassword="Please confirm your password",v=!1),i(b),v},x=async()=>{h(!0);try{const{error:v}=await F.auth.resend({type:"signup",email:r.email});if(v)throw v;alert("Verification email resent successfully!")}catch{alert("Failed to resend verification email. Please try again.")}finally{h(!1)}},g=async v=>{var b;if(v.preventDefault(),m()){o(!0),i({...t,submit:""});let y;try{const{data:S,error:R}=await F.auth.signUp({email:r.email,password:r.password});if(y=S,R){i(L=>({...L,submit:R.message}));return}if(console.log("Auth signup response:",y),y.user){const{data:L}=await $.from("profiles").select("id").eq("id",y.user.id).single();if(L){const{error:B}=await $.from("profiles").update({first_name:r.firstName,last_name:r.lastName,email:r.email,company:r.company,role:r.role,industry:r.industry,is_admin:!1}).eq("id",y.user.id);if(B)throw B}else{const B={id:y.user.id,first_name:r.firstName,last_name:r.lastName,email:r.email,company:r.company,role:r.role,industry:r.industry,is_admin:!1},{error:z}=await $.from("profiles").insert([B]);if(z)throw z}l(!0)}else throw new Error("User registration failed - no user data received")}catch(S){console.error("Registration error:",S),(b=S.message)!=null&&b.includes("duplicate key value violates unique constraint")?i({...t,submit:"An account with this email already exists. Please try logging in instead."}):i({...t,submit:S.message||"An error occurred during registration. Please try again."}),y!=null&&y.user&&await F.auth.signOut()}finally{o(!1)}}};return n.jsx(Tp,{children:n.jsxs(Ep,{children:[n.jsx(Ap,{children:"Join the Media Mill Hub"}),n.jsx($p,{children:a?n.jsxs(Dp,{children:[n.jsx("h3",{children:"Registration Successful!"}),n.jsxs(Os,{children:["We've sent a verification link to ",n.jsx("strong",{children:r.email}),". Please check your email and click the link to verify your account."]}),n.jsx(Os,{children:"If you don't see the email in your inbox, please check your spam folder."}),n.jsx(Mp,{onClick:x,disabled:d,children:d?"Resending...":"Resend Verification Email"})]}):n.jsxs(n.Fragment,{children:[t.submit&&n.jsx(Pe,{style:{marginBottom:"1rem",textAlign:"center"},children:t.submit}),n.jsxs(Op,{onSubmit:g,children:[n.jsxs(As,{children:[n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"firstName",children:"First Name"}),n.jsx(ut,{type:"text",id:"firstName",name:"firstName",placeholder:"Enter your first name",value:r.firstName,onChange:u}),t.firstName&&n.jsx(Pe,{children:t.firstName})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"lastName",children:"Last Name"}),n.jsx(ut,{type:"text",id:"lastName",name:"lastName",placeholder:"Enter your last name",value:r.lastName,onChange:u}),t.lastName&&n.jsx(Pe,{children:t.lastName})]})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"email",children:"Email Address"}),n.jsx(ut,{type:"email",id:"email",name:"email",placeholder:"Enter your email address",value:r.email,onChange:u}),t.email&&n.jsx(Pe,{children:t.email})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"company",children:"Company Name"}),n.jsx(ut,{type:"text",id:"company",name:"company",placeholder:"Enter your company name",value:r.company,onChange:u}),t.company&&n.jsx(Pe,{children:t.company})]}),n.jsxs(As,{children:[n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"role",children:"Your Role"}),n.jsxs($s,{id:"role",name:"role",value:r.role,onChange:u,children:[n.jsx("option",{value:"",children:"Select your role"}),n.jsx("option",{value:"ceo",children:"CEO"}),n.jsx("option",{value:"cto",children:"CTO"}),n.jsx("option",{value:"marketing",children:"Marketing Director"}),n.jsx("option",{value:"product",children:"Product Manager"}),n.jsx("option",{value:"designer",children:"Designer"}),n.jsx("option",{value:"developer",children:"Developer"}),n.jsx("option",{value:"other",children:"Other"})]}),t.role&&n.jsx(Pe,{children:t.role})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"industry",children:"Industry"}
3167),n.jsxs($s,{id:"industry",name:"industry",value:r.industry,onChange:u,children:[n.jsx("option",{value:"",children:"Select your industry"}),n.jsx("option",{value:"technology",children:"Technology"}),n.jsx("option",{value:"finance",children:"Finance"}),n.jsx("option",{value:"healthcare",children:"Healthcare"}),n.jsx("option",{value:"education",children:"Education"}),n.jsx("option",{value:"retail",children:"Retail"}),n.jsx("option",{value:"manufacturing",children:"Manufacturing"}),n.jsx("option",{value:"media",children:"Media & Entertainment"}),n.jsx("option",{value:"other",children:"Other"})]}),t.industry&&n.jsx(Pe,{children:t.industry})]})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"password",children:"Password"}),n.jsx(ut,{type:"password",id:"password",name:"password",placeholder:"Create a password",value:r.password,onChange:u}),t.password&&n.jsx(Pe,{children:t.password})]}),n.jsxs(Fe,{children:[n.jsx(Le,{htmlFor:"confirmPassword",children:"Confirm Password"}),n.jsx(ut,{type:"password",id:"confirmPassword",name:"confirmPassword",placeholder:"Confirm your password",value:r.confirmPassword,onChange:u}),t.confirmPassword&&n.jsx(Pe,{children:t.confirmPassword})]}),n.jsx(Ip,{type:"submit",disabled:s,children:s?"Registering...":"Register Account"})]})]})})]})})},Np=c.div` 3168 min-height: 100vh; 3169 display: flex; 3170 justify-content: center; 3171 align-items: center; 3172 padding: 2rem; 3173 background: var(--bg-color); 3174`,Fp=c.div` 3175 width: 100%; 3176 max-width: 450px; 3177 background: rgba(0, 0, 0, 0.6); 3178 border-radius: 15px; 3179 padding: 3rem; 3180 box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); 3181 backdrop-filter: blur(8px); 3182`,Lp=c.h1` 3183 font-size: 2.5rem; 3184 color: white; 3185 margin-bottom: 0.5rem; 3186 text-align: center; 3187`,zp=c.p` 3188 font-size: 1rem; 3189 color: rgba(255, 255, 255, 0.7); 3190 margin-bottom: 2rem; 3191 text-align: center; 3192`,Up=c.form` 3193 display: flex; 3194 flex-direction: column; 3195 gap: 1.5rem; 3196`,Is=c.div` 3197 display: flex; 3198 flex-direction: column; 3199 gap: 0.5rem; 3200`,Ds=c.label` 3201 font-size: 0.9rem; 3202 color: rgba(255, 255, 255, 0.8); 3203`,Ms=c.input` 3204 padding: 0.75rem 1rem; 3205 background: rgba(255, 255, 255, 0.1); 3206 border: 1px solid rgba(255, 255, 255, 0.2); 3207 border-radius: 8px; 3208 color: white; 3209 font-size: 1rem; 3210 transition: all 0.3s; 3211 3212 &:focus { 3213 outline: none; 3214 border-color: var(--primary-color); 3215 box-shadow: 0 0 0 2px rgba(227, 101, 39, 0.3); 3216 } 3217 3218 &::placeholder { 3219 color: rgba(255, 255, 255, 0.4); 3220 } 3221`,Bp=c.button` 3222 padding: 0.75rem; 3223 background: var(--primary-color); 3224 color: white; 3225 border: none; 3226 border-radius: 8px; 3227 font-size: 1rem; 3228 font-weight: 500; 3229 cursor: pointer; 3230 transition: all 0.3s; 3231 margin-top: 1rem; 3232 3233 &:hover { 3234 background: #ff8c1a; 3235 transform: translateY(-2px); 3236 } 3237 3238 &:disabled { 3239 background: #7d7d7d; 3240 cursor: not-allowed; 3241 transform: none; 3242 } 3243`,mn=c.div` 3244 color: #ff5757; 3245 font-size: 0.9rem; 3246 margin-top: 0.25rem; 3247`,qp=c(ce)` 3248 color: var(--primary-color); 3249 text-decoration: none; 3250 font-size: 0.9rem; 3251 text-align: right; 3252 margin-top: 0.5rem; 3253 3254 &:hover { 3255 text-decoration: underline; 3256 } 3257`,Wp=c.div` 3258 margin-top: 2rem; 3259 text-align: center; 3260 color: rgba(255, 255, 255, 0.7); 3261 font-size: 0.9rem; 3262 3263 a { 3264 color: var(--primary-color); 3265 text-decoration: none; 3266 font-weight: 500; 3267 3268 &:hover { 3269 text-decoration: underline; 3270 } 3271 } 3272`,Hp=c.div` 3273 background: rgba(255, 152, 0, 0.1); 3274 border: 1px solid rgba(255, 152, 0, 0.3); 3275 color: #ffa726; 3276 padding: 1rem; 3277 border-radius: 6px; 3278 margin-bottom: 1rem; 3279 text-align: center; 3280 font-size: 0.9rem; 3281`,Vp=c.button` 3282 background: var(--primary-color); 3283 color: white; 3284 border: none; 3285 border-radius: 6px; 3286 padding: 0.5rem 1rem; 3287 font-size: 0.9rem; 3288 font-weight: 500; 3289 cursor: pointer; 3290 transition: all 0.3s; 3291 3292 &:hover { 3293 background: #ff8c1a; 3294 transform: translateY(-2px); 3295 } 3296`,Gp=()=>{const r=$e(),[e,t]=C.useState({email:"",password:""}),[i,s]=C.useState({email:"",password:"",submit:""}),[o,a]=C.useState(!1),[l,d]=C.useState(!1),h=g=>{const{name:v,value:b}=g.target;t({...e,[v]:b}),i[v]&&s({...i,[v]:"",submit:""})},u=()=>{let g=!0;const v={...i};return e.email?/\S+@\S+\.\S+/.test(e.email)||(v.email="Email is invali
3296d",g=!1):(v.email="Email is required",g=!1),e.password||(v.password="Password is required",g=!1),s(v),g},m=async()=>{try{const{error:g}=await F.auth.resend({type:"signup",email:e.email});if(g)throw g;alert("Verification email resent successfully! Please check your inbox.")}catch{alert("Failed to resend verification email. Please try again.")}},x=async g=>{if(g.preventDefault(),u()){a(!0),s({...i,submit:""}),d(!1);try{const{data:v,error:b}=await F.auth.signInWithPassword({email:e.email,password:e.password});if(b)throw b.message.toLowerCase().includes("email not confirmed")?(d(!0),new Error("Please verify your email address before logging in.")):b;if(v.user){const{data:y,error:S}=await F.from("profiles").select("*").eq("id",v.user.id).single();if(S&&S.code==="PGRST116"){const{error:R}=await F.from("profiles").insert([{id:v.user.id,email:v.user.email,first_name:v.user.user_metadata.first_name||"",last_name:v.user.user_metadata.last_name||"",company:"",role:"",industry:"",is_admin:!1}]);if(R)throw R}else if(S)throw S;r("/hub")}}catch(v){console.error("Login error:",v),s({...i,submit:v.message})}finally{a(!1)}}};return n.jsx(Np,{children:n.jsxs(Fp,{children:[n.jsx(Lp,{children:"Login"}),n.jsx(zp,{children:"Welcome back! Enter your details to continue"}),l&&n.jsxs(Hp,{children:["Please verify your email address to login.",n.jsx("br",{}),n.jsx(Vp,{onClick:m,children:"Resend verification email"})]}),i.submit&&n.jsx(mn,{style:{marginBottom:"1rem",textAlign:"center"},children:i.submit}),n.jsxs(Up,{onSubmit:x,children:[n.jsxs(Is,{children:[n.jsx(Ds,{htmlFor:"email",children:"Email"}),n.jsx(Ms,{type:"email",id:"email",name:"email",placeholder:"Enter your email",value:e.email,onChange:h}),i.email&&n.jsx(mn,{children:i.email})]}),n.jsxs(Is,{children:[n.jsx(Ds,{htmlFor:"password",children:"Password"}),n.jsx(Ms,{type:"password",id:"password",name:"password",placeholder:"Enter your password",value:e.password,onChange:h}),i.password&&n.jsx(mn,{children:i.password})]}),n.jsx(qp,{to:"/forgot-password",children:"Forgot password?"}),n.jsx(Bp,{type:"submit",disabled:o,children:o?"Logging in...":"Login"})]}),n.jsxs(Wp,{children:["Don't have an account? ",n.jsx(ce,{to:"/hub-registration",children:"Register now"})]})]})})},fn=c.div` 3297 padding-top: 80px; 3298 min-height: 100vh; 3299 background: var(--bg-color); 3300 color: var(--text-color); 3301`,pn=c.div` 3302 max-width: 1200px; 3303 margin: 0 auto; 3304 padding: 4rem 1rem; 3305 3306 @media (max-width: 768px) { 3307 padding: 2rem 1rem; 3308 } 3309`,Yp=c.div` 3310 margin-bottom: 3rem; 3311 3312 @media (max-width: 768px) { 3313 margin-bottom: 2rem; 3314 } 3315`,Jp=c.h1` 3316 font-size: clamp(2rem, 4vw, 3rem); 3317 font-weight: 900; 3318 margin-bottom: 1rem; 3319 3320 @media (max-width: 768px) { 3321 font-size: 1.75rem; 3322 } 3323`,Kp=c.p` 3324 font-size: 1.1rem; 3325 color: rgba(255, 255, 255, 0.8); 3326 max-width: 800px; 3327 line-height: 1.6; 3328 3329 @media (max-width: 768px) { 3330 font-size: 1rem; 3331 line-height: 1.5; 3332 } 3333`,Xp=c.div` 3334 display: grid; 3335 grid-template-columns: 2fr 1fr; 3336 gap: 2rem; 3337 3338 @media (max-width: 1024px) { 3339 grid-template-columns: 1fr; 3340 } 3341`,gn=c.div` 3342 background: rgba(255, 255, 255, 0.05); 3343 border-radius: 12px; 3344 padding: 2rem; 3345 border: 1px solid rgba(255, 255, 255, 0.1); 3346 margin-bottom: 2rem; 3347 3348 @media (max-width: 768px) { 3349 padding: 1.25rem; 3350 margin-bottom: 1.5rem; 3351 } 3352`,xn=c.h2` 3353 font-size: 1.5rem; 3354 color: var(--primary-color); 3355 margin-bottom: 1.5rem; 3356`,Qp=c.span` 3357 display: inline-block; 3358 padding: 0.5rem 1rem; 3359 border-radius: 20px; 3360 font-size: 0.875rem; 3361 background: ${r=>r.status==="active"?"rgba(76, 175, 80, 0.2)":r.status==="review"?"rgba(33, 150, 243, 0.2)":"rgba(158, 158, 158, 0.2)"}; 3362 color: ${r=>r.status==="active"?"#4caf50":r.status==="review"?"#2196f3":"#9e9e9e"}; 3363 3364 @media (max-width: 768px) { 3365 padding: 0.4rem 0.8rem; 3366 font-size: 0.8rem; 3367 } 3368`,Zp=c.div` 3369 width: 100%; 3370 height: 8px; 3371 background: rgba(255, 255, 255, 0.1); 3372 border-radius: 4px; 3373 margin: 1.5rem 0; 3374 position: relative; 3375 overflow: hidden; 3376 3377 &::after { 3378 content: ''; 3379 position: absolute; 3380 left: 0; 3381 top: 0; 3382 height: 100%; 3383 width: ${r=>r.progress}%; 3384 background: var(--primary-color); 3385 border-radius: 4px; 3386 transition: width 0.3s ease; 3387 } 3388`,eg=c.div` 3389 display: flex; 3390 flex-direction: column; 3391 gap: 1rem; 3392`,tg=c.div` 3393 display: flex; 3394 align-items: center; 3395 gap: 1rem; 3396 padding: 1rem; 3397 background: rgba(255, 255, 255, 0.03); 3398 border-radius: 8px; 3399 border: 1px solid rgba(255, 255, 255, 0.05); 3400`,rg=c.input`
3401 width: 20px; 3402 height: 20px; 3403 margin: 0; 3404`,ng=c.span` 3405 flex: 1; 3406 text-decoration: ${r=>r.$completed?"line-through":"none"}; 3407 color: ${r=>r.$completed?"rgba(255, 255, 255, 0.6)":"white"}; 3408`,ig=c.div` 3409 display: grid; 3410 grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); 3411 gap: 1rem; 3412 3413 @media (max-width: 768px) { 3414 grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 3415 gap: 0.75rem; 3416 } 3417`,sg=c.div` 3418 background: rgba(255, 255, 255, 0.03); 3419 border-radius: 8px; 3420 padding: 1rem; 3421 border: 1px solid rgba(255, 255, 255, 0.05); 3422 3423 @media (max-width: 768px) { 3424 padding: 0.75rem; 3425 } 3426`,og=c.div` 3427 font-weight: 500; 3428 margin-bottom: 0.25rem; 3429`,ag=c.div` 3430 font-size: 0.875rem; 3431 color: rgba(255, 255, 255, 0.6); 3432`,lg=c.span` 3433 cursor: pointer; 3434 color: var(--primary-color); 3435 transition: all 0.2s ease; 3436 3437 &:hover { 3438 text-decoration: underline; 3439 opacity: 0.9; 3440 } 3441`,cg=c.div` 3442 position: fixed; 3443 top: 0; 3444 left: 0; 3445 width: 100%; 3446 height: 100%; 3447 background: rgba(0, 0, 0, 0.8); 3448 display: flex; 3449 justify-content: center; 3450 align-items: center; 3451 z-index: 1000; 3452`,dg=c.div` 3453 background: var(--bg-color); 3454 border: 1px solid rgba(255, 255, 255, 0.1); 3455 border-radius: 12px; 3456 padding: 2rem; 3457 max-width: 500px; 3458 width: 90%; 3459 box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); 3460 3461 @media (max-width: 768px) { 3462 padding: 1.5rem; 3463 width: 95%; 3464 margin: 1rem; 3465 } 3466`,ug=c.div` 3467 display: flex; 3468 justify-content: space-between; 3469 align-items: center; 3470 margin-bottom: 1.5rem; 3471 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 3472 padding-bottom: 1rem; 3473`,hg=c.h3` 3474 font-size: 1.5rem; 3475 color: var(--primary-color); 3476 margin: 0; 3477`,mg=c.button` 3478 background: none; 3479 border: none; 3480 color: rgba(255, 255, 255, 0.6); 3481 font-size: 1.5rem; 3482 cursor: pointer; 3483 transition: all 0.2s ease; 3484 3485 &:hover { 3486 color: white; 3487 } 3488`,bn=c.div` 3489 margin-bottom: 1rem; 3490 3491 strong { 3492 display: inline-block; 3493 width: 100px; 3494 color: rgba(255, 255, 255, 0.8); 3495 } 3496`,xr=c.button` 3497 background: var(--primary-color); 3498 color: white; 3499 border: none; 3500 border-radius: 8px; 3501 padding: 0.75rem 1.5rem; 3502 cursor: pointer; 3503 font-size: 1rem; 3504 transition: all 0.3s ease; 3505 3506 &:hover { 3507 background: #ff8c1a; 3508 } 3509`,fg=c.form` 3510 display: flex; 3511 margin-top: 1rem; 3512 gap: 0.5rem; 3513 align-items: center; 3514 3515 @media (max-width: 768px) { 3516 flex-direction: column; 3517 gap: 0.75rem; 3518 } 3519`,pg=c.input` 3520 flex: 1; 3521 padding: 0.75rem; 3522 border-radius: 8px; 3523 border: 1px solid rgba(255, 255, 255, 0.2); 3524 background: rgba(255, 255, 255, 0.05); 3525 color: var(--text-color); 3526 font-size: 1rem; 3527 width: 100%; 3528 3529 &:focus { 3530 outline: none; 3531 border-color: var(--primary-color); 3532 } 3533`,gg=c(xr)` 3534 padding: 0.75rem 1rem; 3535 white-space: nowrap; 3536 3537 @media (max-width: 768px) { 3538 width: 100%; 3539 } 3540`,xg=c.select` 3541 background: rgba(255, 255, 255, 0.1); 3542 border: 1px solid rgba(255, 255, 255, 0.2); 3543 color: white; 3544 padding: 0.5rem; 3545 border-radius: 4px; 3546 margin-left: 0.5rem; 3547 cursor: pointer; 3548 font-size: 0.9rem; 3549 min-width: 120px; 3550 appearance: none; 3551 background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFFFFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); 3552 background-repeat: no-repeat; 3553 background-position: right 0.7rem top 50%; 3554 background-size: 0.65rem auto; 3555 3556 @media (max-width: 768px) { 3557 margin-left: 0; 3558 margin-top: 0.5rem; 3559 width: 100%; 3560 } 3561 3562 &:focus { 3563 outline: none; 3564 border-color: var(--primary-color); 3565 } 3566 3567 & option { 3568 background: var(--bg-color); 3569 color: white; 3570 padding: 0.5rem; 3571 } 3572`,bg=c.div` 3573 display: flex; 3574 align-items: center; 3575 gap: 1rem; 3576 flex-wrap: wrap; 3577 3578 @media (max-width: 768px) { 3579 flex-direction: column; 3580 align-items: flex-start; 3581 gap: 0.5rem; 3582 } 3583`,vg=()=>{const{id:r}=Oa(),e=$e(),[t,i]=C.useState(null),[s,o]=C.useState(!0),[a,l]=C.useState(""),[d,h]=C.useState(!1),[u,m]=C.useState(!1),[x,g]=C.useState(null),[v,b]=C.useState(!1),[y,S]=C.useState(!1);C.useEffect(()=>{(async()=>{const{data:{session:M}}=await F.auth.getSession();if(M!=null&&M.user){g(M.user.id);const{data:O}=await F.from("profiles").select("is_admin").eq("id",M.user.id).single();O!=null&&O.is_admin&&b(!0)}})(),r&&B(r)}
3583,[r]),C.useEffect(()=>{if(t&&x){const I=t.team_members.some(M=>M.user_id===x);S(I)}},[t,x]);const R=t&&x?t.client_id===x:!1,L=v||y,B=async I=>{try{console.log("Fetching project with ID:",I);const{data:M,error:O}=await $.from("projects").select("*").eq("id",I).single();if(O)throw console.error("Error fetching project:",O),O;if(!M)throw console.error("No project found with ID:",I),new Error("Project not found");console.log("Project data:",M),console.log("Fetching tasks for project directly:",I);const{data:T,error:w}=await $.from("tasks").select("*").eq("project_id",I);w?console.error("Error fetching tasks:",w):console.log("Tasks found:",T?T.length:0,T);const{data:U,error:D}=await $.from("project_members").select(` 3584 *, 3585 profiles ( 3586 first_name, 3587 last_name, 3588 email 3589 ) 3590 `).eq("project_id",I);D?console.error("Error fetching team members:",D):console.log("Team members found:",U?U.length:0);let W=null;if(M.client_id){const{data:P,error:N}=await $.from("profiles").select("first_name, last_name, email, company").eq("id",M.client_id).single();N?console.error("Error fetching client:",N):P&&(console.log("Client found:",P),W=P)}const ie=T?T.filter(P=>P.completed).length:0,J=T?T.length:0,_=J>0?Math.round(ie/J*100):0,k={...M,tasks:T||[],team_members:U||[],client:W,progress:J>0?_:M.progress||0};console.log("Combined project data:",k),i(k)}catch(M){console.error("Error in fetchProject:",M),e("/hub")}finally{o(!1)}},z=async(I,M)=>{if(t)try{const{error:O}=await $.from("tasks").update({completed:M}).eq("id",I);if(O)throw console.error("Error updating task status:",O),O;console.log(`Task ${I} updated to completed: ${M}`);const T=t.tasks.map(ie=>ie.id===I?{...ie,completed:M}:ie),w=T.filter(ie=>ie.completed).length,U=T.length,D=U>0?Math.round(w/U*100):0;console.log(`New progress: ${D}% (${w}/${U} tasks completed)`);const{error:W}=await $.from("projects").update({progress:D}).eq("id",t.id);W?console.error("Error updating project progress:",W):console.log(`Project progress updated to ${D}%`),i({...t,tasks:T,progress:D})}catch(O){console.error("Error in handleTaskUpdate:",O)}},ue=async I=>{if(I.preventDefault(),!(!t||!a.trim())){h(!0);try{console.log(`Adding new task "${a}" to project ${t.id}`);const{data:M,error:O}=await $.from("tasks").insert({project_id:t.id,title:a.trim(),completed:!1}).select().single();if(O)throw console.error("Error adding task:",O),O;console.log("Task added successfully:",M);const T=[...t.tasks,M],w=T.filter(W=>W.completed).length,U=T.length,D=U>0?Math.round(w/U*100):0;await $.from("projects").update({progress:D}).eq("id",t.id),i({...t,tasks:T,progress:D}),l("")}catch(M){console.error("Error in handleAddTask:",M),alert("Failed to add task. Please try again.")}finally{h(!1)}}};return s?n.jsx(fn,{children:n.jsx(pn,{children:n.jsx("div",{style:{textAlign:"center",padding:"4rem"},children:"Loading project details..."})})}):t?n.jsx(fn,{children:n.jsx(pn,{children:s?n.jsx("div",{style:{textAlign:"center",padding:"4rem"},children:"Loading project details..."}):t?n.jsxs(n.Fragment,{children:[u&&t.client&&n.jsx(cg,{onClick:()=>m(!1),children:n.jsxs(dg,{onClick:I=>I.stopPropagation(),children:[n.jsxs(ug,{children:[n.jsx(hg,{children:"Client Information"}),n.jsx(mg,{onClick:()=>m(!1),children:"Ã"})]}),n.jsxs(bn,{children:[n.jsx("strong",{children:"Name:"})," ",t.client.first_name," ",t.client.last_name]}),t.client.company&&n.jsxs(bn,{children:[n.jsx("strong",{children:"Company:"})," ",t.client.company]}),n.jsxs(bn,{children:[n.jsx("strong",{children:"Email:"})," ",t.client.email]}),n.jsx("div",{style:{marginTop:"2rem",textAlign:"center"},children:n.jsx(xr,{onClick:()=>{navigator.clipboard.writeText(t.client.email).then(()=>{alert("Email copied to clipboard!")}).catch(I=>{console.error("Could not copy email: ",I)})},children:"Copy Email"})})]})}),n.jsxs(Yp,{children:[n.jsxs(bg,{children:[n.jsx(Jp,{children:t.title}),n.jsx(Qp,{status:t.status,children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})]}),n.jsx(Kp,{children:t.description})]}),n.jsx(Zp,{progress:t.progress||0}),n.jsxs("p",{style:{textAlign:"right",marginTop:"0.5rem"},children:["Progress: ",t.progress||0,"%",t.tasks&&t.tasks.length>0?` (${t.tasks.filter(I=>I.completed).length}/${t.tasks.length} tasks complete)`:" (No tasks)"]}),n.jsxs(Xp,{children:[n.jsxs("div",{children:[n.jsxs(gn,{children:[n.jsx(xn,{children:"Tasks"}),t.tasks&&t.tasks.length>0?n.jsx(eg,{children:t.tasks.map(I=>n.jsxs(tg,{children:[n.jsx(rg,{type:"checkbox",checked:I.completed,onChange:M=>z(I.id,M.target.checked),disabled:R}),n.jsx(ng,{$completed:I.completed,children:I.title})]},I.id))}):n.jsx("p",{children:"No tasks have been created for this project."}),L&&n.jsxs(fg,{onSubmit:ue,children:[n.jsx(pg,{type:"text",placeholder:"Enter new task...",value:a,onChange:I=>l(I.target.value),required:!0}),n.jsx(gg,{type:"submit",disabled:d,children:d?"Adding...":"+ Add Task"})]})]}),L&&n.jsx("div",{style:{marginTop:"2rem"},children:n.jsx(xr,{onClick:()=>e(`/project-form?project=${t.id}`),children:"Add Tasks"})})]}),n.jsxs("div",{children:[n.jsxs(gn,{children:[n.jsx(xn,{children:"Project Details"}),n.jsxs("div",{style:{marginBottom:"1rem"},children:[n.jsx("strong",{children:"Client:"})," ",t.client?n.jsxs(lg,{onClick:()=>m(!0),children:[t.client.first_name," ",t.client.last_name,t.client.company&&n.jsxs("span",{children:[" (",t.client.company,")"]})]}):"Not assigned"]}),n.jsxs("div",{style:{marginBottom:"1rem"},children:[n.jsx("strong",{children:"Deadline:"})," ",t.deadline?new Date(t.deadline).toLocaleDateString():"Not set"]}),n.jsxs("div",{style:{marginBottom:"1rem"},children:[n.jsx("strong",{children:"Created:"})," ",new Date(t.created_at).toLocaleDateString()]}),n.jsxs("div",{style:{marginBottom:"1rem"},children:[n.jsx("strong",{children:"Status:"})," ",v||y?n.jsxs(xg,{value:t.status,onChange:async I=>{const M=I.target.value;console.log("Status change initiated:",{newStatus:M,currentStatus:t.status});try{console.log("Updating project status in database...");const{error:O}=await $.from("projects").update({status:M}).eq("id",t.id);if(O)throw console.error("Database update error:",O),O;if(console.log("Database update successful"),M==="completed"&&t.client){console.log("Preparing to send completion email",{clientName:`${t.client.first_name} ${t.client.last_name}`,clientEmail:t.client.email,projectTitle:t.title});try{const T=await Ff({clientName:`${t.client.first_name} ${t.client.last_name}`,clientEmail:t.client.email,projectTitle:t.title,completionDate:new Date().toLocaleDateString(),projectDetails:`Project has been marked as completed. 3591 3592Project Description: ${t.description}`});console.log("Email sending result:",T),alert("Project status updated and completion email sent to client.")}catch(T){console.error("Failed to send project completion email:",T),alert("Project status updated but failed to send completion email. Please try again or c
3592ontact support.")}}i({...t,status:M})}catch(O){console.error("Error updating project status:",O),alert("Failed to update project status. Please try again.")}},children:[n.jsx("option",{value:"active",children:"Active"}),n.jsx("option",{value:"completed",children:"Completed"})]}):n.jsx("span",{style:{marginLeft:"0.5rem"},children:t.status.charAt(0).toUpperCase()+t.status.slice(1)})]})]}),n.jsxs(gn,{children:[n.jsx(xn,{children:"Team"}),t.team_members&&t.team_members.length>0?n.jsx(ig,{children:t.team_members.map(I=>n.jsxs(sg,{children:[n.jsx(og,{children:I.profiles?`${I.profiles.first_name} ${I.profiles.last_name}`:`User ${I.user_id}`}),n.jsx(ag,{children:I.role})]},I.id))}):n.jsx("p",{children:"No team members have been assigned to this project."})]})]})]}),n.jsx("div",{style:{marginTop:"2rem"},children:n.jsx(xr,{onClick:()=>e("/hub"),children:"Back to Hub"})})]}):n.jsxs("div",{style:{textAlign:"center",padding:"4rem"},children:["Project not found. ",n.jsx("a",{href:"/hub",style:{color:"var(--primary-color)"},children:"Return to Hub"})]})})}):n.jsx(fn,{children:n.jsx(pn,{children:n.jsx("div",{style:{textAlign:"center",padding:"4rem"},children:"Project not found"})})})},yg=c.div` 3593 padding-top: 80px; 3594 min-height: 100vh; 3595 background: var(--bg-color); 3596 color: var(--text-color); 3597`,wg=c.div` 3598 max-width: 1200px; 3599 margin: 0 auto; 3600 padding: 4rem 2rem; 3601`,jg=c.div` 3602 text-align: center; 3603 margin-bottom: 4rem; 3604`,_g=c.h1` 3605 font-size: clamp(3rem, 5vw, 4.5rem); 3606 font-weight: 900; 3607 margin-bottom: 1.5rem; 3608 line-height: 1.1; 3609`,kg=c.p` 3610 font-size: 1.25rem; 3611 color: rgba(255, 255, 255, 0.8); 3612 max-width: 800px; 3613 margin: 0 auto; 3614 line-height: 1.6; 3615`,Sg=c.div` 3616 display: grid; 3617 grid-template-columns: 1fr 1fr; 3618 gap: 3rem; 3619 margin-bottom: 4rem; 3620 3621 @media (max-width: 768px) { 3622 grid-template-columns: 1fr; 3623 } 3624`,Cg=c.div``,Pg=c.div``,Tg=c.section` 3625 margin-bottom: 2.5rem; 3626`,Rs=c.h2` 3627 font-size: 1.75rem; 3628 color: var(--primary-color); 3629 margin-bottom: 1.5rem; 3630`,Eg=c.div` 3631 font-size: 1.125rem; 3632 line-height: 1.6; 3633 color: rgba(255, 255, 255, 0.8); 3634 3635 p { 3636 margin-bottom: 1.5rem; 3637 } 3638 3639 ul { 3640 margin-bottom: 1.5rem; 3641 padding-left: 1.5rem; 3642 } 3643 3644 li { 3645 margin-bottom: 0.75rem; 3646 } 3647`,vn=c.div` 3648 background: rgba(255, 255, 255, 0.05); 3649 border-radius: 12px; 3650 padding: 2rem; 3651 border: 1px solid rgba(255, 255, 255, 0.1); 3652 transition: all 0.3s ease; 3653 margin-bottom: 2rem; 3654 3655 &:hover { 3656 transform: translateY(-5px); 3657 border-color: var(--primary-color); 3658 } 3659`,yn=c.div` 3660 width: 60px; 3661 height: 60px; 3662 background: rgba(217, 91, 43, 0.2); 3663 border-radius: 50%; 3664 display: flex; 3665 align-items: center; 3666 justify-content: center; 3667 margin-bottom: 1.5rem; 3668 font-size: 1.75rem; 3669`,wn=c.h3` 3670 font-size: 1.5rem; 3671 margin-bottom: 1rem; 3672`,jn=c.p` 3673 font-size: 1rem; 3674 line-height: 1.6; 3675 color: rgba(255, 255, 255, 0.8); 3676`,Ag=c.form` 3677 background: rgba(255, 255, 255, 0.05); 3678 border-radius: 12px; 3679 padding: 2rem; 3680 border: 1px solid rgba(255, 255, 255, 0.1); 3681`,$g=c.h3` 3682 font-size: 1.5rem; 3683 margin-bottom: 1.5rem; 3684`,At=c.div` 3685 margin-bottom: 1.5rem; 3686`,$t=c.label` 3687 display: block; 3688 margin-bottom: 0.5rem; 3689 font-size: 0.95rem; 3690 color: rgba(255, 255, 255, 0.8); 3691`,Ns=c.input` 3692 width: 100%; 3693 padding: 0.75rem 1rem; 3694 background: rgba(255, 255, 255, 0.07); 3695 border: 1px solid rgba(255, 255, 255, 0.1); 3696 border-radius: 6px; 3697 color: var(--text-color); 3698 font-size: 1rem; 3699 3700 &:focus { 3701 outline: none; 3702 border-color: var(--primary-color); 3703 } 3704`,Fs=c.select` 3705 width: 100%; 3706 padding: 0.75rem 1rem; 3707 background: rgba(255, 255, 255, 0.07); 3708 border: 1px solid rgba(255, 255, 255, 0.1); 3709 border-radius: 6px; 3710 color: var(--text-color); 3711 font-size: 1rem; 3712 3713 &:focus { 3714 outline: none; 3715 border-color: var(--primary-color); 3716 } 3717 3718 option { 3719 background: #121212; 3720 } 3721`,Og=c.textarea` 3722 width: 100%; 3723 padding: 0.75rem 1rem; 3724 background: rgba(255, 255, 255, 0.07); 3725 border: 1px solid rgba(255, 255, 255, 0.1); 3726 border-radius: 6px; 3727 color: var(--text-color); 3728 font-size: 1rem; 3729 min-height: 120px; 3730 resize: vertical; 3731 3732 &:focus { 3733 outline: none; 3734 border-color: var(--primary-color); 3735 } 3736`,Ig=c.div` 3737 display: flex; 3738 align-items: flex-start; 3739 gap: 0.75rem; 3740 margin-bottom: 1.5rem; 3741 3742 input { 3743 margin-top: 0.25rem; 3744 } 3745 3746 label { 3747 font-size: 0.9rem; 3748 color: rgba(255, 255, 255, 0.7); 3749 line-height: 1.5; 3750 } 3751`,Dg=c.button` 3752 background: var(--primary-color); 3753 color: #fff; 3754 font-weight: 600; 3755 border: none; 3756 border-radius: 6px; 3757 padding: 0.75rem 1.5rem; 3758 font-size: 1rem; 3759 cursor: pointer; 3760 transition: all 0.3s ease; 3761 3762 &:hover { 3763 background: #ff8c1a; 3764 transform: translateY(-2px); 3765 } 3766`,Mg=c.div` 3767 background: rgba(76, 175, 80, 0.2); 3768 border: 1px solid rgba(76, 175, 80, 0.4); 3769 color: #4caf50; 3770 padding: 1rem; 3771 border-radius: 6px; 3772 margin-bottom: 1.5rem; 3773 text-align: center; 3774`,Rg=c.section` 3775 margin-top: 4rem; 3776`,Ng=c.div` 3777 display: grid; 3778 grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 3779 gap: 2rem; 3780 margin-top: 2rem; 3781`,_n=c.div` 3782 background: rgba(255, 255, 255, 0.05); 3783 border-radius: 12px; 3784 padding: 2rem; 3785 border: 1px solid rgba(255, 255, 255, 0.1); 3786`,kn=c.p` 3787 font-size: 1.125rem; 3788 line-height: 1.6; 3789 color: rgba(255, 255, 255, 0.9); 3790 margin-bottom: 1.5rem; 3791 font-style: italic; 3792 3793 &::before { 3794 content: '"'; 3795 font-size: 2rem; 3796 color: var(--primary-color); 3797 line-height: 0; 3798 vertical-align: -0.5rem; 3799 margin-right: 0.25rem; 3800 } 3801 3802 &::after { 3803 content: '"'; 3804 font-size: 2rem; 3805 color: var(--primary-color); 3806 line-height: 0; 3807 vertical-align: -0.5rem; 3808 margin-left: 0.25rem; 3809 } 3810`,Sn=c.div` 3811 display: flex; 3812 align-items: center; 3813`,Cn=c.div` 3814 width: 48px; 3815 height: 48px; 3816 border-radius: 50%; 3817 background: var(--primary-color); 3818 display: flex; 3819 align-items: center; 3820 justify-content: center; 3821 margin-right: 1rem; 3822 font-weight: 600; 3823 font-size: 1rem; 3824`,Pn=c.div``,Tn=c.div` 3825 font-size: 1rem; 3826 color: #fff; 3827 font-weight: 600; 3828`,En=c.div` 3829 font-size: 0.875rem; 3830 color: rgba(255, 255, 255, 0.6); 3831`,Fg=()=>{const[r,e]=C.useState({name:"",email:"",role:"",industry:"",message:"",subscribe:!1}),[t,i]=C.useState(!1),s=a=>{const{name:l,value:d,type:h,checked:u}=a.target;e(m=>({...m,[l]:h==="checkbox"?u:d}))},o=a=>{a.preventDefault(),console.log("Form submitted:",r),setTimeout(()=>{i(!0),e({name:"",email:"",role:"",industry:"",message:"",subscribe:!1})},1e3)};return n.jsx(yg,{children:n.jsxs(wg,{children:[n.jsxs(jg,{children:[n.jsx(_g,{children:"Join Our Creative
3831Community"}),n.jsx(kg,{children:"Connect with like-minded creators, share your work, get feedback, and collaborate on exciting projects."})]}),n.jsxs(Sg,{children:[n.jsxs(Cg,{children:[n.jsxs(Tg,{children:[n.jsx(Rs,{children:"Why Join the MediaMill Community?"}),n.jsxs(Eg,{children:[n.jsx("p",{children:"The MediaMill community is a thriving ecosystem of creators, designers, filmmakers, and digital artists from around the world. By joining our community, you'll have access to:"}),n.jsxs("ul",{children:[n.jsxs("li",{children:[n.jsx("strong",{children:"Networking opportunities"})," with industry professionals and like-minded creators"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Exclusive events"})," including workshops, masterclasses, and community meetups"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Feedback sessions"})," where you can share your work and get constructive criticism"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Collaboration opportunities"})," with other community members on exciting projects"]}),n.jsxs("li",{children:[n.jsx("strong",{children:"Early access"})," to new MediaMill tools, resources, and educational content"]})]})]})]}),n.jsxs(vn,{children:[n.jsx(yn,{children:"ð¥"}),n.jsx(wn,{children:"Monthly Community Meetups"}),n.jsx(jn,{children:"Join our monthly virtual meetups where we showcase member work, discuss industry trends, and foster meaningful connections within our community."})]}),n.jsxs(vn,{children:[n.jsx(yn,{children:"ð"}),n.jsx(wn,{children:"Skills Development"}),n.jsx(jn,{children:"Access exclusive workshops, tutorials, and resources designed to help you advance your creative skills and stay at the cutting edge of your field."})]}),n.jsxs(vn,{children:[n.jsx(yn,{children:"ð¼"}),n.jsx(wn,{children:"Career Opportunities"}),n.jsx(jn,{children:"Get connected with job opportunities, freelance gigs, and collaborative projects through our community job board and partnership network."})]})]}),n.jsx(Pg,{children:n.jsxs(Ag,{onSubmit:o,children:[n.jsx($g,{children:"Sign Up for Community Membership"}),t&&n.jsx(Mg,{children:"Thank you for joining! We've sent you a confirmation email with next steps."}),n.jsxs(At,{children:[n.jsx($t,{htmlFor:"name",children:"Your Name"}),n.jsx(Ns,{type:"text",id:"name",name:"name",value:r.name,onChange:s,required:!0,placeholder:"Enter your full name"})]}),n.jsxs(At,{children:[n.jsx($t,{htmlFor:"email",children:"Email Address"}),n.jsx(Ns,{type:"email",id:"email",name:"email",value:r.email,onChange:s,required:!0,placeholder:"[email protected]"})]}),n.jsxs(At,{children:[n.jsx($t,{htmlFor:"role",children:"Primary Interest"}),n.jsxs(Fs,{id:"role",name:"role",value:r.role,onChange:s,required:!0,children:[n.jsx("option",{value:"",children:"Select your primary interest"}),n.jsx("option",{value:"motion",children:"Motion Design & Animation"}),n.jsx("option",{value:"film",children:"Film & Video Production"}),n.jsx("option",{value:"graphic",children:"Graphic Design"}),n.jsx("option",{value:"ui",children:"UI/UX Design"}),n.jsx("option",{value:"web",children:"Web Development"}),n.jsx("option",{value:"3d",children:"3D Modeling & Rendering"}),n.jsx("option",{value:"photography",children:"Photography"}),n.jsx("option",{value:"other",children:"Other Creative Field"})]})]}),n.jsxs(At,{children:[n.jsx($t,{htmlFor:"industry",children:"Experience Level"}
3831),n.jsxs(Fs,{id:"industry",name:"industry",value:r.industry,onChange:s,required:!0,children:[n.jsx("option",{value:"",children:"Select your experience level"}),n.jsx("option",{value:"student",children:"Student"}),n.jsx("option",{value:"beginner",children:"Beginner (0-2 years)"}),n.jsx("option",{value:"intermediate",children:"Intermediate (2-5 years)"}),n.jsx("option",{value:"professional",children:"Professional (5+ years)"}),n.jsx("option",{value:"expert",children:"Expert/Industry Leader"})]})]}),n.jsxs(At,{children:[n.jsx($t,{htmlFor:"message",children:"Tell us about yourself"}),n.jsx(Og,{id:"message",name:"message",value:r.message,onChange:s,placeholder:"Share a bit about yourself, your creative journey, and what you hope to get from the community"})]}),n.jsxs(Ig,{children:[n.jsx("input",{type:"checkbox",id:"subscribe",name:"subscribe",checked:r.subscribe,onChange:s}),n.jsx("label",{htmlFor:"subscribe",children:"I'd like to receive the MediaMill newsletter with community updates, event announcements, and creative inspiration."})]}),n.jsx(Dg,{type:"submit",children:"Join Community"})]})})]}),n.jsxs(Rg,{children:[n.jsx(Rs,{children:"What Our Community Members Say"}),n.jsxs(Ng,{children:[n.jsxs(_n,{children:[n.jsx(kn,{children:"Joining the MediaMill community was a game-changer for my creative career. The connections I've made and the feedback I've received have elevated my work to a whole new level."}),n.jsxs(Sn,{children:[n.jsx(Cn,{children:"JS"}),n.jsxs(Pn,{children:[n.jsx(Tn,{children:"Jason Smith"}),n.jsx(En,{children:"Motion Designer"})]})]})]}),n.jsxs(_n,{children:[n.jsx(kn,{children:"The workshops and skill-sharing sessions have been invaluable. I've learned more practical techniques in six months than I did in two years of formal education."}),n.jsxs(Sn,{children:[n.jsx(Cn,{children:"MR"}),n.jsxs(Pn,{children:[n.jsx(Tn,{children:"Maria Rodriguez"}),n.jsx(En,{children:"Filmmaker"})]})]})]}),n.jsxs(_n,{children:[n.jsx(kn,{children:"What I love most about this community is how supportive everyone is. It's not competitiveâit's collaborative. We all grow together and celebrate each other's successes."}),n.jsxs(Sn,{children:[n.jsx(Cn,{children:"DK"}),n.jsxs(Pn,{children:[n.jsx(Tn,{children:"David Kim"}),n.jsx(En,{children:"UX Designer"})]})]})]})]})]})]})})},Lg=c.div` 3832 padding-top: 80px; 3833 min-height: 100vh; 3834 background: var(--bg-color); 3835 color: var(--text-color); 3836`,zg=c.div` 3837 max-width: 1400px; 3838 margin: 0 auto; 3839 padding: 4rem 2rem; 3840 width: 100%; 3841 overflow-x: hidden; 3842 3843 @media (max-width: 1500px) { 3844 padding: 3rem 1.5rem; 3845 } 3846 3847 @media (max-width: 768px) { 3848 padding: 2rem 1rem; 3849 } 3850`,Ug=c.div` 3851 margin-bottom: 3rem; 3852 3853 @media (max-width: 768px) { 3854 margin-bottom: 2rem; 3855 } 3856`,Bg=c.h1` 3857 font-size: clamp(2rem, 4vw, 3rem); 3858 font-weight: 900; 3859 margin-bottom: 1rem; 3860`,qg=c.p` 3861 font-size: 1.1rem; 3862 color: rgba(255, 255, 255, 0.8); 3863 max-width: 800px; 3864`,Wg=c.div` 3865 display: flex; 3866 gap: 1rem; 3867 margin-bottom: 2rem; 3868 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 3869 padding-bottom: 1rem; 3870 overflow-x: auto; 3871 -webkit-overflow-scrolling: touch; 3872 3873 @media (max-width: 768px) { 3874 gap: 0.5rem; 3875 margin-bottom: 1.5rem; 3876 padding-bottom: 0.75rem; 3877 } 3878`,ht=c.button` 3879 padding: 0.75rem 1.5rem; 3880 background: ${r=>r.active?"var(--primary-color)":"transparent"}; 3881 border: 1px solid ${r=>r.active?"var(--primary-color)":"rgba(255, 255, 255, 0.2)"}; 3882 color: white; 3883 border-radius: 8px; 3884 cursor: pointer; 3885 transition: all 0.3s ease; 3886 white-space: nowrap; 3887 3888 &:hover { 3889 background: ${r=>r.active?"var(--primary-color)":"rgba(255, 255, 255, 0.1)"}; 3890 } 3891 3892 @media (max-width: 768px) { 3893 padding: 0.5rem 1rem; 3894 font-size: 0.9rem; 3895 } 3896`,An=c.div` 3897 background: rgba(255, 255, 255, 0.05); 3898 border-radius: 12px; 3899 overflow-x: auto; 3900 -webkit-overflow-scrolling: touch; 3901 width: 100%; 3902 min-width: 100%; 3903 3904 @media (max-width: 768px) { 3905 border-radius: 8px; 3906 } 3907`,$n=c.div` 3908 display: grid; 3909 grid-template-columns: 2fr 2fr 1fr 1.5fr 1fr; 3910 padding: 1rem; 3911 background: rgba(0, 0, 0, 0.3); 3912 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 3913 font-weight: 500; 3914 min-width: 800px; 3915 3916 @media (max-width: 768px) { 3917 font-size: 0.85rem; 3918 padding: 0.75rem; 3919 grid-template-columns: 1.5fr 2fr 1fr 1fr 1fr; 3920 } 3921`,On=c.div` 3922 display: grid; 3923 grid-template-columns: 2fr 2fr 1fr 1.5fr 1fr; 3924 padding: 1rem; 3925 border-bottom: 1px solid rgba(255, 255, 255, 0.1); 3926 align-items: center; 3927 min-width: 800px; 3928 3929 &:last-child { 3930 border-bottom: none; 3931 } 3932 3933 &:hover { 3934 background: rgba(255, 255, 255, 0.02); 3935 } 3936 3937 @media (max-width: 768px) { 3938 font-size: 0.85rem; 3939 padding: 0.75rem; 3940 grid-template-columns: 1.5fr 2fr 1fr 1fr 1fr; 3941 gap: 0.5rem; 3942 3943 > div { 3944 overflow: hidden; 3945 text-overflow: ellipsis; 3946 white-space: nowrap; 3947 } 3948 } 3949`,fe=c.button` 3950 padding: 0.5rem 1rem; 3951 border-radius: 6px; 3952 border: none; 3953 cursor: pointer; 3954 font-size: 0.9rem; 3955 transition: all 0.3s ease; 3956 white-space: nowrap; 3957 background: ${r=>r.variant==="danger"?"rgba(220, 53, 69, 0.1)":r.variant==="success"?"rgba(40, 167, 69, 0.1)":"rgba(255, 255, 255, 0.1)"}; 3958 color: ${r=>r.variant==="danger"?"#dc3545":r.variant==="success"?"#28a745":"white"}; 3959 3960 &:hover { 3961 background: ${r=>r.variant==="danger"?"rgba(220, 53, 69, 0.2)":r.variant==="success"?"rgba(40, 167, 69, 0.2)":"rgba(255, 255, 255, 0.2)"}; 3962 } 3963 3964 @media (max-width: 768px) { 3965 padding: 0.4rem 0.75rem; 3966 font-size: 0.8rem; 3967 } 3968 3969 @media (max-width: 480px) { 3970 padding: 0.35rem 0.6rem; 3971 font-size: 0.75rem; 3972 } 3973`,Ot=c.span` 3974 padding: 0.25rem 0.75rem; 3975 border-radius: 20px; 3976 font-size: 0.875rem; 3977 background: ${r=>r.status==="active"?"rgba(40, 167, 69, 0.1)":r.status==="pending"?"rgba(255, 193, 7, 0.1)":"rgba(220, 53, 69, 0.1)"}; 3978 color: ${r=>r.status==="active"?"#28a745":r.status==="pending"?"#ffc107":"#dc3545"}; 3979 3980 @media (max-width: 768px) { 3981 padding: 0.2rem 0.5rem; 3982 font-size: 0.8rem; 3983 } 3984`,Ls=c.input` 3985 padding: 0.75rem 1rem; 3986 background: rgba(255, 255, 255, 0.05); 3987 border: 1px solid rgba(255, 255, 255, 0.1); 3988 border-radius: 8px; 3989 color: white; 3990 width: 100%; 3991 max-width: 300px; 3992 margin-bottom: 1rem; 3993 3994 &::placeholder { 3995 color: rgba(255, 255, 255, 0.5); 3996 } 3997 3998 &:focus { 3999 outline: none; 4000 border-color: var(--primary-color); 4001 } 4002 4003 @media (max-width: 768px) { 4004 max-width: 100%; 4005 padding: 0.6rem 0.875rem; 4006 } 4007`,zs=c.div` 4008 display: grid; 4009 gap: 2rem; 4010 grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 4011 width: 100%; 4012 overflow-x: hidden; 4013 4014 @media (min-width: 1200px) { 4015 grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); 4016 } 4017 4018 @media (min-width: 769px) and (max-width: 1199px) { 4019 grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 4020 } 4021 4022 @media (max-width: 768px) { 4023 grid-template-columns: 1fr; 4024 gap: 1.25rem; 4025 } 4026`,Us=c.div` 4027 background: rgba(255, 255, 255, 0.05); 4028 border-radius: 12px; 4029 padding: 1.5rem; 4030 border: 1px solid rgba(255, 255, 255, 0.1); 4031 height: 100%; 4032 display: flex; 4033 flex-direction: column; 4034 overflow: hidden; 4035 width: 100%; 4036 4037 @media (max-width: 768px) { 4038 padding: 1.25rem; 4039 border-radius: 8px; 4040 } 4041`,Bs=c.div` 4042 display: flex; 4043 justify-content: space-between; 4044 align-items: flex-start; 4045 margin-bottom: 1.25rem; 4046 gap: 0.75rem; 4047 flex-wrap: wrap; 4048 4049 @media (max-width: 768px) { 4050 margin-bottom: 1rem; 4051 gap: 0.5rem; 4052 } 4053`,qs=c.h3` 4054 font-size: clamp(1.25rem, 3vw, 1.5rem); 4055 margin: 0; 4056 color: white; 4057`,Ws=c.div` 4058 width: 100%; 4059 height: 8px; 4060 background: rgba(255, 255, 255, 0.1); 4061 border-radius: 4px; 4062 position: relative; 4063 overflow: hidden; 4064 4065 &::after { 4066 content: ''; 4067 position: absolute; 4068 top: 0; 4069 left: 0; 4070 height: 100%; 4071 width: ${r=>r.progress}%; 4072 background: var(--primary-color); 4073 border-radius: 4px; 4074 transition: width 0.3s ease; 4075 } 4076`,Hs=c.div` 4077 display: grid; 4078 grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); 4079 gap: 0.75rem; 4080 margin-top: auto; 4081 4082 @media (min-width: 769px) { 4083 grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); 4084 } 4085 4086 @media (max-width: 768px) { 4087 grid-template-columns: 1fr; 4088 gap: 0.5rem; 4089 } 4090`,mt=c.div` 4091 background: rgba(255, 255, 255, 0.03); 4092 padding: 1rem; 4093 border-radius: 8px; 4094 height: 100%; 4095 4096 @media (max-width: 768px) { 4097 padding: 0.875rem; 4098 } 4099 4100 h4 { 4101 font-size: 0.875rem; 4102 color: rgba(255, 255, 255, 0.6); 4103 margin: 0 0 0.5rem 0; 4104 4105 @media (max-width: 768px) { 4106 font-size: 0.8rem; 4107 margin-bottom: 0.375rem; 4108 } 4109 } 4110 4111 p { 4112 font-size: 1rem; 4113 color: white; 4114 margin: 0; 4115 4116 @media (max-width: 768px) { 4117 font-size: 0.9rem; 4118 } 4119 } 4120`,Hg=c.div` 4121 display: flex; 4122 gap: 0.75rem; 4123 margin-top: 1.5rem; 4124 flex-wrap: wrap; 4125 4126 ${fe} { 4127 flex: 1; 4128 min-width: 120px; 4129 white-space: nowrap; 4130 font-size: 0.9rem; 4131 padding: 0.5rem 0.75rem; 4132 } 4133 4134 @media (max-width: 768px) { 4135 flex-direction: column; 4136 gap: 0.5rem; 4137 margin-top: 1rem; 4138 } 4139`;c.div` 4140 margin-top: 1.5rem; 4141`;c.div` 4142 display: flex; 4143 align-items: center; 4144 gap: 1rem; 4145 padding: 0.75rem; 4146 background: rgba(255, 255, 255, 0.03); 4147 border-radius: 6px; 4148 margin-bottom: 0.5rem; 4149 4150 &:last-child { 4151 margin-bottom: 0; 4152 } 4153`;c.input` 4154 width: 18px; 4155 height: 18px; 4156 margin: 0; 4157`;c.span` 4158 flex: 1; 4159 color: rgba(255, 255, 255, 0.8); 4160`;c.select` 4161 background: rgba(255, 255, 255, 0.1); 4162 border: 1px solid rgba(255, 255, 255, 0.2); 4163 color: white; 4164 padding: 0.5rem; 4165 border-radius: 4px; 4166 min-width: 120px; 4167 4168 option { 4169 background: #1a1a1a; 4170 } 4171`;const Vg=c(fe)` 4172 background: var(--primary-color); 4173 color: white; 4174 padding: 0.75rem 1.5rem; 4175 height: 45px; 4176 margin: 0; 4177 4178 &:hover { 4179 background: #ff8c1a; 4180 } 4181 4182 @media (max-width: 768px) { 4183 width: 100%; 4184 height: 40px; 4185 padding: 0.6rem 1rem; 4186 } 4187`,Vs=c.select` 4188 background: rgba(255, 255, 255, 0.05); 4189 border: 1px solid rgba(255, 255, 255, 0.1); 4190 color: ${r=>r.value==="confirmed"||r.value==="completed"?"#28a745":r.value==="pending"?"#ffc107":r.value==="cancelled"?"#dc3545":"white"}; 4191 padding: 0.75rem; 4192 border-radius: 6px; 4193 cursor: pointer; 4194 font-size: 0.9rem; 4195 width: 100%; 4196 transition: all 0.3s ease; 4197 text-align: center; 4198 font-weight: 500; 4199 4200 &:hover { 4201 border-color: var(--primary-color); 4202 background: rgba(255, 255, 255, 0.1); 4203 } 4204 4205 &:focus { 4206 outline: none; 4207 border-color: var(--primary-color); 4208 box-shadow: 0 0 0 2px rgba(217, 91, 43, 0.2); 4209 } 4210 4211 option { 4212 background: #1a1a1a; 4213 padding: 8px; 4214 color: white; 4215 } 4216`,Gs=c.div` 4217 display: flex; 4218 align-items: center; 4219 justify-content: center; 4220`,ja=c.div` 4221 display: flex; 4222 gap: 1rem; 4223 margin-bottom: 1.5rem; 4224 align-items: flex-start; 4225 justify-content: space-between; 4226 flex-wrap: wrap; 4227 4228 @media (max-width: 1024px) { 4229 gap: 1rem; 4230 } 4231 4232 @media (max-width: 768px) { 4233 flex-direction: column; 4234 align-items: stretch; 4235 gap: 1rem; 4236 } 4237`,Ys=c.div` 4238 display: flex; 4239 gap: 1rem; 4240 align-items: center; 4241 flex-wrap: wrap; 4242 4243 @media (max-width: 1024px) { 4244 gap: 0.75rem; 4245 } 4246 4247 @media (max-width: 768px) { 4248 flex-direction: column; 4249 gap: 0.75rem; 4250 width: 100%; 4251 4252 > div { 4253 width: 100%; 4254 } 4255 } 4256`,It=c.span` 4257 color: rgba(255, 255, 255, 0.8); 4258 font-size: 0.9rem; 4259 4260 @media (max-width: 768px) { 4261 font-size: 0.85rem; 4262 margin-bottom: 0.25rem; 4263 display: block; 4264 } 4265`,hr=c.select` 4266 background: rgba(255, 255, 255, 0.05); 4267 border: 1px solid rgba(255, 255, 255, 0.1); 4268 color: white; 4269 padding: 0.75rem; 4270 border-radius: 6px; 4271 cursor: pointer; 4272 font-size: 0.9rem; 4273 min-width: 150px; 4274 transition: all 0.3s ease; 4275 4276 @media (max-width: 768px) { 4277 width: 100%; 4278 min-width: unset; 4279 padding: 0.6rem; 4280 font-size: 0.85rem; 4281 } 4282 4283 &:hover { 4284 border-color: var(--primary-color); 4285 background: rgba(255, 255, 255, 0.1); 4286 } 4287 4288 &:focus { 4289 outline: none; 4290 border-color: var(--primary-color); 4291 box-shadow: 0 0 0 2px rgba(217, 91, 43, 0.2); 4292 } 4293 4294 option { 4295 background: #1a1a1a; 4296 padding: 8px; 4297 color: white; 4298 } 4299`,_a=c.div` 4300 display: none; 4301 background: rgba(255, 255, 255, 0.05); 4302 border-radius: 12px; 4303 padding: 1.25rem; 4304 margin-bottom: 1rem; 4305 border: 1px solid rgba(255, 255, 255, 0.1); 4306 4307 @media (max-width: 768px) { 4308 display: block; 4309 } 4310 4311 &:last-child { 4312 margin-bottom: 0; 4313 } 4314`,ye=c.div` 4315 margin-bottom: 1rem; 4316 4317 &:last-child { 4318 margin-bottom: 0; 4319 } 4320 4321 label { 4322 display: block; 4323 font-size: 0.8rem; 4324 color: rgba(255, 255, 255, 0.6); 4325 margin-bottom: 0.25rem; 4326 } 4327 4328 .value { 4329 font-size: 0.9rem; 4330 color: white; 4331 } 4332 4333 .secondary { 4334 font-size: 0.8rem; 4335 color: rgba(255, 255, 255, 0.6); 4336 margin-top: 0.25rem; 4337 } 4338`,Js=c.div` 4339 @media (max-width: 768px) { 4340 display: none; 4341 } 4342`,Gg=c(ja)` 4343 @media (max-width: 768px) { 4344 flex-direction: column; 4345 gap: 1rem; 4346 margin-bottom: 1.5rem; 4347 4348 > div { 4349 width: 100%; 4350 } 4351 } 4352`,Yg=c(_a)` 4353 display: none; 4354 4355 @media (max-width: 768px) { 4356 display: block; 4357 } 4358`,Jg=c.h2` 4359 margin-bottom: 1.5rem; 4360 font-size: clamp(1.5rem, 3vw, 2rem); 4361 4362 @media (max-width: 768px) { 4363 margin-bottom: 1rem; 4364 padding: 0 0.5rem; 4365 } 4366`,Kg=()=>{const r=$e(),[e,t]=C.useState("projects"),[i,s]=C.useState([]),[o,a]=C.useState([]),[l,d]=C.useState([]),[h,u]=C.useState(""),[m,x]=C.useState(!0),[g,v]=C.useState("all"),[b,y]=C.useState("date"),[S,R]=C.useState("all"),[L,B]=C.useState("date"),[z,ue]=C.useState("projects"),[I,M]=C.useState([]);C.useEffect(()=>{(async()=>{const{data:{session:f}}=await F.auth.getSession();if(!f){r("/login");return}const{data:E}=await F.from("profiles").select("is_admin").eq("id",f.user.id).single();if(!(E!=null&&E.is_admin)){r("/hub");return}const K=e==="users"&&i.length===0,Y=(e==="projects"||e==="archived"&&z==="projects")&&o.length===0,Q=(e==="meetings"||e==="archived"&&z==="meetings")&&l.length===0;K&&O(),Y&&w(),Q&&U()})()},[e,z,r,i.length,o.length,l.length]),C.useEffect(()=>{const p=JSON.parse(localStorage.getItem("hiddenProjects")||"[]");M(p)},[]);const O=async()=>{try{x(!0);const{data:p,error:f}=await $.from("profiles").select("*").order("created_at",{ascending:!1});if(f){console.error("Error fetching users:",f),alert("Failed to fetch users. Please try again.");return}p&&(console.log("Fetched users:",p),s(p))}catch(p){console.error("Error in fetchUsers:",p),alert("An error occurred while fetching users.")}finally{x(!1)}},T=async(p,f)=>{try{console.log(`Updating admin status for user ${p} to ${f}`);const{error:E}=await $.from("profiles").update({is_admin:f}).eq("id",p);if(E)throw console.error("Error updating admin status:",E),E;s(i.map(K=>K.id===p?{...K,is_admin:f}:K)),alert(`User ${f?"promoted to":"removed from"} admin role successfully`)}catch(E){console.error("Error in handleAdminStatusChange:",E),alert("Failed to update admin status. Please try again.")}},w=async()=>{try{x(!0),console.log("Fetching all projects from database...");const{data:p,error:f}=await $.from("projects").select(` 4367 id, 4368 title, 4369 description, 4370 client_id, 4371 status, 4372 progress, 4373 deadline, 4374 created_at, 4375 tasks (*), 4376 project_members ( 4377 *, 4378 profiles ( 4379 first_name, 4380 last_name, 4381 email 4382 ) 4383 ), 4384 client:profiles!projects_client_id_fkey ( 4385 first_name, 4386 last_name, 4387 email, 4388 company 4389 ) 4390 `).order("created_at",{ascending:!1});if(f){console.error("Error fetching projects:",f);return}if(!p||p.length===0){console.log("No projects found in database"),a([]);return}console.log(`Fetched ${p.length} projects from database`),p.forEach(Y=>{console.log(`Project ID: ${Y.id}, Title: ${Y.title}, Status: ${Y.status}`)});const E=p.filter(Y=>Y.status==="archived");E.length>0?console.log(`Found ${E.length} archived projects:`,E.map(Y=>({id:Y.id,title:Y.title}))):console.log("No archived projects found");const K=p.reduce((Y,Q)=>{const ne=Q.status||"unknown";return Y[ne]=(Y[ne]||0)+1,Y},{});
4390console.log("Projects by status:",K),a(p)}catch(p){console.error("Error in fetchProjects:",p)}finally{x(!1)}},U=async()=>{try{const{data:p,error:f}=await $.from("service_bookings").select("*").order("booking_date",{ascending:!0}).order("booking_time",{ascending:!0});if(f)throw f;d(p||[]),x(!1)}catch(p){console.error("Error fetching meetings:",p),x(!1)}},D=p=>new Date(p).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"}),W=i.filter(p=>p.email.toLowerCase().includes(h.toLowerCase())||p.first_name.toLowerCase().includes(h.toLowerCase())||p.last_name.toLowerCase().includes(h.toLowerCase())),ie=async(p,f)=>{try{console.log("Updating meeting status:",{meetingId:p,newStatus:f});const{data:E,error:K}=await $.from("service_bookings").select("*").eq("id",p).single();if(K)throw console.error("Error fetching meeting:",K),K;if(!E)throw console.error("No meeting found with ID:",p),new Error("Meeting not found");console.log("Found meeting:",E);const{error:Y}=await $.from("service_bookings").update({status:f}).eq("id",p);if(Y)throw console.error("Error updating meeting:",Y),Y;console.log("Successfully updated meeting status to:",f);let Q=E.booking_time;if(!Q.includes("AM")&&!Q.includes("PM")&&(Q=new Date(`2000-01-01T${E.booking_time}`).toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0})),f==="confirmed"){console.log("Status is confirmed, preparing to send confirmation email");try{const ne=await Rf({customerName:E.client_name,customerEmail:E.client_email,serviceType:E.service_type,bookingDate:E.booking_date,bookingTime:Q,additionalNotes:`Your booking has been confirmed! 4391 4392Division: ${E.division} 4393Agent: ${E.agent_name}`});console.log("Confirmation email sent successfully:",ne)}catch(ne){console.error("Failed to send confirmation email:",ne),alert("Meeting status updated but failed to send confirmation email. Please contact support.")}}if(f==="cancelled"){console.log("Status is cancelled, preparing to send cancellation email");try{console.log("Meeting data for cancellation:",{meetingId:p,meeting:E,formattedTime:Q});const ne=await Nf({customerName:E.client_name,customerEmail:E.client_email,serviceType:E.service_type,bookingDate:E.booking_date,bookingTime:Q,additionalNotes:`Division: ${E.division} 4394Agent: ${E.agent_name} 4395 4396If you have any questions about this cancellation, please contact our support team.`});console.log("Cancellation email sent successfully:",ne)}catch(ne){console.error("Failed to send cancellation email:",ne),alert("Meeting status updated but failed to send cancellation email. Please contact support.")}}d(l.map(ne=>ne.id===p?{...ne,status:f}:ne)),alert(`Meeting status updated to ${f}${f==="confirmed"?" and confirmation email sent":f==="cancelled"?" and cancellation email sent":""}`)}catch(E){console.error("Error in handleStatusChange:",E),alert("Failed to update meeting status. Please try again.")}},J=p=>{switch(p.toLowerCase()){case"confirmed":return"active";case"pending":return"pending";case"cancelled":return"blocked";case"completed":return"active";default:return"pending"}},_=()=>l.filter(p=>{if(e==="meetings"&&(p.status==="completed"||p.status==="cancelled"))return!1;const f=p.client_name.toLowerCase().includes(h.toLowerCase())||p.service_type.toLowerCase().includes(h.toLowerCase())||p.agent_name.toLowerCase().includes(h.toLowerCase()),E=g==="all"||p.status===g;return f&&E}).sort((p,f)=>{switch(b){case"date":return new Date(p.booking_date).getTime()-new Date(f.booking_date).getTime();case"status":return p.status.localeCompare(f.status);case"client":return p.client_name.localeCompare(f.client_name);default:return 0}}),k=async p=>{try{console.log(`Archiving project: ${p}`);const{data:f,error:E}=await $.from("projects").select("id, title, status").eq("id",p).single();if(E){console.error("Error fetching project before archive:",E),alert("Failed to fetch project details.");return}console.log("Project status before archive:",f),console.log("Attempting to archive using direct database function...");const{data:K,error:Y}=await $.rpc("admin_update_project_status",{project_id:p,new_status:"archived"});
4396if(Y){console.error("Error using RPC method:",Y),console.log("Falling back to regular update method...");const ee=await $.from("projects").update({status:"archived"}).eq("id",p);if(ee.error){console.error("Error archiving project with regular update:",ee.error),console.error("Error details:",{message:ee.error.message,details:ee.error.details,hint:ee.error.hint,code:ee.error.code}),alert(`Failed to archive project: ${ee.error.message}`);return}console.log("Regular update result:",ee)}else console.log("RPC update result:",K);const{data:Q,error:ne}=await $.from("projects").select("id, title, status").eq("id",p).single();if(ne)console.error("Error fetching project after archive:",ne);else if(console.log("Project status after archive:",Q),Q.status!=="archived"){console.error("Project status was not updated to archived!",Q),console.log("Attempting final direct SQL update...");const{data:ee,error:he}=await $.rpc("update_project_status",{p_project_id:p,p_status:"archived"});if(he){console.error("Final direct update failed:",he),alert("Project archive failed after multiple attempts. Please try again or contact support.");return}else{console.log("Final update result:",ee);const{data:Qt}=await $.from("projects").select("id, title, status").eq("id",p).single();if(console.log("Final status check:",Qt),(Qt==null?void 0:Qt.status)!=="archived"){alert("Unable to archive project. This is likely a database permission issue.");return}else a(Pa=>Pa.map(Nr=>Nr.id===p?{...Nr,status:"archived"}:Nr))}}else a(ee=>ee.map(he=>he.id===p?{...he,status:"archived"}:he));setTimeout(()=>{t("archived"),ue("projects"),setTimeout(()=>{w(),console.log("Project successfully archived")},300)},50)}catch(f){console.error("Error in handleArchiveProject:",f),alert("An unexpected error occurred while archiving the project.")}},P=async p=>{try{console.log("Unarchiving project:",p);const{data:f,error:E}=await $.from("projects").select("id, title, status").eq("id",p).single();if(E){console.error("Error fetching project before unarchive:",E),alert("Failed to fetch project details.");return}console.log("Project status before unarchive:",f),console.log("Attempting to unarchive using direct database function...");const{data:K,error:Y}=await $.rpc("admin_update_project_status",{project_id:p,new_status:"active"});if(Y){console.error("Error using RPC method for unarchive:",Y),console.log("Falling back to regular update method...");const ee=await $.from("projects").update({status:"active"}).eq("id",p);if(ee.error){console.error("Error unarchiving project with regular update:",ee.error),console.error("Error details:",{message:ee.error.message,details:ee.error.details,hint:ee.error.hint,code:ee.error.code}),alert(`Failed to unarchive project: ${ee.error.message}`);return}console.log("Regular update result:",ee)}else console.log("RPC update result:",K);const{data:Q,error:ne}=await $.from("projects").select("id, title, status").eq("id",p).single();if(ne)console.error("Error verifying project update:",ne);else if(Q&&(console.log(`Verified project status after unarchive: ${Q.status}`),Q.status!=="active")){console.error("Project was not unarchived! Current status:",Q.status),alert("Project unarchive failed. Please try again or contact support.");return}a(ee=>ee.map(he=>he.id===p?{...he,status:"active"}:he)),t("projects"),setTimeout(()=>{w(),console.log("Project unarchived successfully")},300)}catch(f){console.error("Error in handleUnarchiveProject:",f),alert("Failed to unarchive project.")}},N=async p=>{const{error:f}=await $.from("service_bookings").update({status:"pending"}).eq("id",p);f?alert("Failed to unarchive meeting."):d(E=>E.map(K=>K.id===p?{...K,status:"pending"}:K))},Z=async p=>{try{if(!confirm("Are you sure you want to permanently delete this project? This action cannot be undone."))return;console.log(`Attempting to delete project ${p} from the database...`),console.log("Using admin_delete_project RPC function to bypass RLS...");const{data:f,error:E}=await $.rpc("admin_delete_project",{p_project_id:p});if(E){console.error("Error deleting project via RPC:",E),console.log("Attempting fallback deletion method...");const{error:K}=await $.from("tasks").delete().eq("project_id",p);if(K){console.error("Error deleting associated tasks:",K),alert("Failed to delete associated tasks. Please try again.");return}const{error:Y}=await $.from("project_members").delete().eq("project_id",p);if(Y){console.error("Error deleting project members:",Y),alert("Failed to delete project members. Please try again.");return}const{error:Q}=await $.from("projects").delete().eq("id",p);if(Q){console.error("Error deleting project:",Q),alert("Failed to delete project. Please try again.");return}}else console.log("Project successfully deleted via RPC function, result:",f);console.log("Project successfully deleted from the database"),a(K=>K.filter(Y=>Y.id!==p)),alert("Project has been permanently deleted.")}catch(f){console.error("Unexpected error deleting project:",f),alert("An unexpected error occurred while deleting the project.")}},X=async()=>{try{console.log("Testing database permissions with supabaseAdmin..."),console.log("Checking for admin functions...");const p=prompt("Enter a name for a test project (or leave empty to skip):");if(p){console.log(`Creating test project with name: ${p}`);const{data:f,error:E}=await $.from("projects").insert({title:p,description:"Test project for debugging",status:"active",progress:0,client_id:null}).select().single();if(E)console.error("Error creating test project:",E);else if(console.log("Created test project:",f),f){console.log("Trying to archive with direct update...");const{data:K,error:Y}=await $.from("projects").update({status:"archived"}).eq("id",f.id).select().single();Y?console.error("Error archiving with update:",Y):console.log("Update result:",K);const{data:Q}=await $.from("projects").select("id, title, status").eq("id",f.id).single();console.log("Current project status:",Q),console.log("Trying with admin_update_project_status RPC...");try{const{data:ne,error:ee}=await $.rpc("admin_update_project_status",{project_id:f.id,new_status:"archived"});if(ee)console.error("RPC error:",ee);else{console.log("RPC result:",ne);const{data:he}=await $.from("projects").select("id, title, status").eq("id",f.id).single();console.log("Final status:",he),alert(`Test results in console. Final status: ${he==null?void 0:he.status}`)}}catch(ne){console.error("Error calling RPC:",ne)}}}else{const f=prompt("Enter existing project ID to test:");if(f){console.log(`Testing with existing project ID: ${f}`);const{data:E}=await $.from("projects").select("id, title, status").eq("id",f).single();console.log("Current status:",E),console.log("Trying with admin_update_project_status RPC...");try{const{data:K,error:Y}=await $.rpc("admin_update_project_status",{project_id:f,new_status:"archived"});if(Y)console.error("RPC error:",Y);else{console.log("RPC result:",K);const{data:Q}=await $.from("projects").select("id, title, status").eq("id",f).single();console.log("Final status:",Q),alert(`Test results in console. Final status: ${Q==null?void 0:Q.status}`)}}catch(K){console.error("Error calling RPC:",K)}}}}catch(p){console.error("Error testing database permissions:",p),alert("Error testing permissions. See console for details.")}},H=()=>{const p=o.filter(f=>f.status!=="archived").filter(f=>!I.includes(f.id));return console.log("Rendering projects tab with filtered projects:",{total:o.length,active:p.length,archived:o.filter(f=>f.status==="archived").length,hidden:I.length}),n.jsxs(n.Fragment,{children:[n.jsxs(ja,{children:[n.jsxs(Ys,{children:[n.jsxs("div",{children:[n.jsx(It,{children:"Status:"}),n.jsxs(hr,{value:S,onChange:f=>R(f.target.value),children:[n.jsx("option",{value:"all",children:"All Statuses"}),n.jsx("option",{value:"active",children:"Active"}),n.jsx("option",{value:"review",children:"In Review"}),n.jsx("option",{value:"completed",children:"Completed"})]})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Sort by:"}),n.jsxs(hr,{value:L,onChange:f=>B(f.target.value),children:[n.jsx("option",{value:"date",children:"Date Created"}),n.jsx("option",{value:"status",children:"Status"}),n.jsx("option",{value:"title",children:"Project Title"})]})]})]}),n.jsxs("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:[n.jsx(Vg,{onClick:()=>r("/project-form"),children:"+ New Project"}),I.length>0&&n.jsxs(fe,{variant:"success",onClick:()=>{M([]),localStorage.removeItem("hiddenProjects"),alert("All hidden projects are now visible")},children:["Show Hidden Projects (",I.length,")"]}),n.jsx(fe,{variant:"danger",onClick:X,children:"Debug Database"})]})]}),m?n.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"Loading projects..."}):p.length===0?n.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"No projects found. Create your first project using the button above."}):n.jsx(zs,{children:p.filter(f=>S==="all"||f.status===S).sort((f,E)=>{switch(L){case"date":return new Date(E.created_at).getTime()-new Date(f.created_at).getTime();case"status":return f.status.localeCompare(E.status);case"title":return f.title.localeCompare(E.title);default:return 0}}).map(f=>n.jsxs(Us,{children:[n.jsxs(Bs,{children:[n.jsx(qs,{children:f.title}
4396),n.jsx(Ot,{status:f.status==="active"?"active":f.status==="review"?"pending":"blocked",children:f.status.charAt(0).toUpperCase()+f.status.slice(1)})]}),n.jsx(Ws,{progress:f.progress||0}),n.jsxs(Hs,{children:[n.jsxs(mt,{children:[n.jsx("h4",{children:"Deadline"}),n.jsx("p",{children:f.deadline?new Date(f.deadline).toLocaleDateString():"Not set"})]}),n.jsxs(mt,{children:[n.jsx("h4",{children:"Description"}),n.jsx("p",{children:f.description?f.description.length>50?f.description.substring(0,50)+"...":f.description:"No description"})]}),n.jsxs(mt,{children:[n.jsx("h4",{children:"Created"}),n.jsx("p",{children:f.created_at?new Date(f.created_at).toLocaleDateString():"Unknown"})]})]}),n.jsxs(Hg,{children:[n.jsx(fe,{onClick:()=>r(`/hub/project/${f.id}`),children:"View Details"}),n.jsx(fe,{onClick:()=>r(`/project-form?project=${f.id}`),children:"Add Tasks"}),n.jsx(fe,{variant:"danger",onClick:()=>k(f.id),children:"Archive Project"}),n.jsx(fe,{variant:"danger",onClick:()=>Z(f.id),children:"Delete Project"}),n.jsx(fe,{variant:"danger",onClick:()=>Ca(f.id),children:"Hide Project"})]})]},f.id))})]})},oe=()=>n.jsxs(n.Fragment,{children:[n.jsxs(Gg,{children:[n.jsxs("div",{children:[n.jsx(It,{children:"Search:"}),n.jsx(Ls,{type:"text",placeholder:"Search meetings...",value:h,onChange:p=>u(p.target.value)})]}),n.jsxs(Ys,{children:[n.jsxs("div",{children:[n.jsx(It,{children:"Status:"}),n.jsxs(hr,{value:g,onChange:p=>v(p.target.value),children:[n.jsx("option",{value:"all",children:"All Statuses"}),n.jsx("option",{value:"pending",children:"Pending"}),n.jsx("option",{value:"confirmed",children:"Confirmed"}),n.jsx("option",{value:"completed",children:"Completed"}),n.jsx("option",{value:"cancelled",children:"Cancelled"})]})]}),n.jsxs("div",{children:[n.jsx(It,{children:"Sort by:"}),n.jsxs(hr,{value:b,onChange:p=>y(p.target.value),children:[n.jsx("option",{value:"date",children:"Date"}),n.jsx("option",{value:"status",children:"Status"}),n.jsx("option",{value:"client",children:"Client Name"})]})]})]})]}),n.jsx(Js,{children:n.jsxs(An,{children:[n.jsxs($n,{children:[n.jsx("div",{children:"Client"}),n.jsx("div",{children:"Service"}),n.jsx("div",{children:"Agent"}),n.jsx("div",{children:"Date & Time"}),n.jsx("div",{children:"Status"})]}),_().map(p=>n.jsxs(On,{children:[n.jsxs("div",{children:[n.jsx("div",{children:p.client_name}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:p.client_email})]}),n.jsxs("div",{children:[n.jsx("div",{children:p.service_type}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:p.division})]}),n.jsx("div",{children:p.agent_name}),n.jsxs("div",{children:[n.jsx("div",{children:D(p.booking_date)}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:p.booking_time})]}),n.jsx(Gs,{children:n.jsxs(Vs,{value:p.status,onChange:f=>ie(p.id,f.target.value),children:[n.jsx("option",{value:"pending",children:"Pending"}),n.jsx("option",{value:"confirmed",children:"Confirmed"}),n.jsx("option",{value:"completed",children:"Completed"}),n.jsx("option",{value:"cancelled",children:"Cancelled"})]})})]},p.id))]})}),_().map(p=>n.jsxs(_a,{children:[n.jsxs(ye,{children:[n.jsx("label",{children:"Client"}),n.jsx("div",{className:"value",children:p.client_name}),n.jsx("div",{className:"secondary",children:p.client_email})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Service"}),n.jsx("div",{className:"value",children:p.service_type}),n.jsx("div",{className:"secondary",children:p.division})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Agent"}),n.jsx("div",{className:"value",children:p.agent_name})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Date & Time"}),n.jsx("div",{className:"value",children:D(p.booking_date)}),n.jsx("div",{className:"secondary",children:p.booking_time})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Status"}),n.jsxs(Vs,{value:p.status,onChange:f=>ie(p.id,f.target.value),style:{width:"100%",marginTop:"0.25rem"},children:[n.jsx("option",{value:"pending",children:"Pending"}),n.jsx("option",{value:"confirmed",children:"Confirmed"}),n.jsx("option",{value:"completed",children:"Completed"}),n.jsx("option",{value:"cancelled",children:"Cancelled"})]})]})]}
4396,p.id))]}),Ie=()=>{const p=o.filter(f=>f.status==="archived");return console.log("Rendering archived projects tab:",{total:o.length,archived:p.length,archivedIds:p.map(f=>f.id),allStatuses:o.map(f=>({id:f.id,status:f.status}))}),n.jsxs(n.Fragment,{children:[n.jsx("h2",{children:"Archived Projects"}),p.length===0?n.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:"No archived projects found."}):n.jsx(zs,{children:p.sort((f,E)=>new Date(E.created_at).getTime()-new Date(f.created_at).getTime()).map(f=>n.jsxs(Us,{children:[n.jsxs(Bs,{children:[n.jsx(qs,{children:f.title}),n.jsx(Ot,{status:"blocked",children:"Archived"})]}),n.jsx(Ws,{progress:f.progress||0}),n.jsxs(Hs,{children:[n.jsxs(mt,{children:[n.jsx("h4",{children:"Deadline"}),n.jsx("p",{children:f.deadline?new Date(f.deadline).toLocaleDateString():"Not set"})]}),n.jsxs(mt,{children:[n.jsx("h4",{children:"Description"}),n.jsx("p",{children:f.description?f.description.length>50?f.description.substring(0,50)+"...":f.description:"No description"})]}),n.jsxs(mt,{children:[n.jsx("h4",{children:"Created"}),n.jsx("p",{children:f.created_at?new Date(f.created_at).toLocaleDateString():"Unknown"})]})]}),n.jsxs("div",{style:{marginTop:"1.5rem",display:"flex",gap:"1rem"},children:[n.jsx(fe,{variant:"success",onClick:()=>P(f.id),children:"Unarchive Project"}),n.jsx(fe,{variant:"danger",onClick:()=>Z(f.id),children:"Delete Project"})]})]},f.id))})]})},ka=()=>{console.log("Rendering archived meetings tab:",{total:l.length,archived:l.filter(f=>f.status==="completed"||f.status==="cancelled").length});const p=l.filter(f=>f.status==="completed"||f.status==="cancelled");return n.jsxs(n.Fragment,{children:[n.jsx(Jg,{children:"Archived Meetings"}),p.length===0&&n.jsx("div",{style:{textAlign:"center",padding:"2rem"},children:'No archived meetings found. Meetings with status "completed" or "cancelled" will appear here.'}),p.length>0&&n.jsx(Js,{children:n.jsxs(An,{children:[n.jsxs($n,{children:[n.jsx("div",{children:"Client"}),n.jsx("div",{children:"Service"}),n.jsx("div",{children:"Agent"}),n.jsx("div",{children:"Date & Time"}),n.jsx("div",{children:"Status"}),n.jsx("div",{children:"Actions"})]}),p.map(f=>n.jsxs(On,{children:[n.jsxs("div",{children:[n.jsx("div",{children:f.client_name}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:f.client_email})]}),n.jsxs("div",{children:[n.jsx("div",{children:f.service_type}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:f.division})]}),n.jsx("div",{children:f.agent_name}),n.jsxs("div",{children:[n.jsx("div",{children:D(f.booking_date)}),n.jsx("div",{style:{fontSize:"0.8rem",color:"rgba(255, 255, 255, 0.6)"},children:f.booking_time})]}),n.jsx(Gs,{children:n.jsx(Ot,{status:J(f.status),children:f.status.charAt(0).toUpperCase()+f.status.slice(1)})}),n.jsx("div",{children:n.jsx(fe,{variant:"success",onClick:()=>N(f.id),children:"Unarchive Meeting"})})]},f.id))]})}),p.map(f=>n.jsxs(Yg,{children:[n.jsxs(ye,{children:[n.jsx("label",{children:"Client"}),n.jsx("div",{className:"value",children:f.client_name}),n.jsx("div",{className:"secondary",children:f.client_email})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Service"}),n.jsx("div",{className:"value",children:f.service_type}),n.jsx("div",{className:"secondary",children:f.division})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Agent"}),n.jsx("div",{className:"value",children:f.agent_name})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Date & Time"}),n.jsx("div",{className:"value",children:D(f.booking_date)}),n.jsx("div",{className:"secondary",children:f.booking_time})]}),n.jsxs(ye,{children:[n.jsx("label",{children:"Status"}),n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",marginTop:"0.25rem"},children:n.jsx(Ot,{status:J(f.status),children:f.status.charAt(0).toUpperCase()+f.status.slice(1)})})]}),n.jsx(ye,{children:n.jsx(fe,{variant:"success",onClick:()=>N(f.id),style:{width:"100%"},children:"Unarchive Meeting"})})]},f.id))]})},Sa=()=>n.jsxs(n.Fragment,{children:[n.jsxs("div",{style:{display:"flex",gap:"1rem",marginBottom:"1.5rem"},children:[n.jsx(ht,{active:z==="projects",onClick:()=>ue("projects"),children:"Projects"}),n.jsx(ht,{active:z==="meetings",onClick:()=>ue("meetings"),children:"Meetings"})]}),z==="projects"&&Ie(),z==="meetings"&&ka()]}),Ca=p=>{console.log(`Hiding project ${p} from UI (client-side only)`),M(K=>[...K,p]);const E=[...JSON.parse(localStorage.getItem("hiddenProjects")||"[]"),p];localStorage.setItem("hiddenProjects",JSON.stringify(E)),alert("Project hidden from view. It still exists in the database but will not appear in the projects list.")};return n.jsx(Lg,{children:n.jsxs(zg,{children:[n.jsxs(Ug,{children:[n.jsx(Bg,{children:"Admin Dashboard"}),n.jsx(qg,{children:"Manage users, projects, and service bookings."})]}),n.jsxs(Wg,{children:[n.jsx(ht,{active:e==="users",onClick:()=>t("users"),children:"Users"}),n.jsx(ht,{active:e==="projects",onClick:()=>t("projects"),children:"Projects"}),n.jsx(ht,{active:e==="meetings",onClick:()=>t("meetings"),children:"Meetings"}),n.jsx(ht,{active:e==="archived",onClick:()=>t("archived"),children:"Archived"})]}),e==="users"&&n.jsxs(n.Fragment,{children:[n.jsx(Ls,{type:"text",placeholder:"Search users...",value:h,onChange:p=>u(p.target.value)}),n.jsx("div",{style:{overflowX:"auto",WebkitOverflowScrolling:"touch",width:"100%"},children:n.jsxs(An,{children:[n.jsxs($n,{children:[n.jsx("div",{children:"User"}),n.jsx("div",{children:"Email"}),n.jsx("div",{children:"Role"}),n.jsx("div",{children:"Joined"}),n.jsx("div",{children:"Actions"})]}),W.map(p=>n.jsxs(On,{children:[n.jsxs("div",{children:[p.first_name," ",p.last_name]}),n.jsx("div",{style:{overflow:"hidden",textOverflow:"ellipsis"},children:p.email}),n.jsx("div",{children:n.jsx(Ot,{status:p.is_admin?"active":"pending",children:p.is_admin?"Admin":"User"})}),n.jsx("div",{children:new Date(p.created_at).toLocaleDateString()}),n.jsx("div",{children:n.jsx(fe,{variant:p.is_admin?"danger":"success",onClick:()=>T(p.id,!p.is_admin),children:p.is_admin?"Remove Admin":"Make Admin"})})]}
4396,p.id))]})})]}),e==="projects"&&H(),e==="meetings"&&oe(),e==="archived"&&Sa()]})})},Xg=c.div` 4397 padding-top: 80px; 4398 min-height: 100vh; 4399 background: var(--bg-color); 4400 color: var(--text-color); 4401`,Qg=c.div` 4402 max-width: 800px; 4403 margin: 0 auto; 4404 padding: 4rem 2rem; 4405 4406 @media (max-width: 768px) { 4407 padding: 2rem 1rem; 4408 } 4409`,Zg=c.h1` 4410 font-size: 2.5rem; 4411 margin-bottom: 2rem; 4412 color: var(--primary-color); 4413 4414 @media (max-width: 768px) { 4415 font-size: 2rem; 4416 margin-bottom: 1.5rem; 4417 } 4418`,e0=c.form` 4419 display: flex; 4420 flex-direction: column; 4421 gap: 1.5rem; 4422 4423 @media (max-width: 768px) { 4424 gap: 1.25rem; 4425 } 4426`,Je=c.div` 4427 display: flex; 4428 flex-direction: column; 4429 gap: 0.5rem; 4430 4431 @media (max-width: 768px) { 4432 gap: 0.375rem; 4433 } 4434`,Ke=c.label` 4435 font-size: 1rem; 4436 color: var(--text-color); 4437 4438 @media (max-width: 768px) { 4439 font-size: 0.9rem; 4440 } 4441`,Rt=c.input` 4442 padding: 0.75rem; 4443 border-radius: 8px; 4444 border: 1px solid rgba(255, 255, 255, 0.1); 4445 background: rgba(255, 255, 255, 0.05); 4446 color: var(--text-color); 4447 font-size: 1rem; 4448 4449 @media (max-width: 768px) { 4450 padding: 0.625rem; 4451 font-size: 0.9rem; 4452 } 4453 4454 &:focus { 4455 outline: none; 4456 border-color: var(--primary-color); 4457 } 4458`,t0=c.textarea` 4459 padding: 0.75rem; 4460 border-radius: 8px; 4461 border: 1px solid rgba(255, 255, 255, 0.1); 4462 background: rgba(255, 255, 255, 0.05); 4463 color: var(--text-color); 4464 font-size: 1rem; 4465 min-height: 100px; 4466 resize: vertical; 4467 4468 @media (max-width: 768px) { 4469 padding: 0.625rem; 4470 font-size: 0.9rem; 4471 min-height: 80px; 4472 } 4473 4474 &:focus { 4475 outline: none; 4476 border-color: var(--primary-color); 4477 } 4478`,mr=c.select` 4479 padding: 0.75rem; 4480 border-radius: 8px; 4481 border: 1px solid rgba(255, 255, 255, 0.1); 4482 background: rgba(255, 255, 255, 0.05); 4483 color: var(--text-color); 4484 font-size: 1rem; 4485 width: 100%; 4486 cursor: pointer; 4487 appearance: none; 4488 background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); 4489 background-repeat: no-repeat; 4490 background-position: right 1rem center; 4491 background-size: 1em; 4492 4493 @media (max-width: 768px) { 4494 padding: 0.625rem; 4495 font-size: 0.9rem; 4496 background-position: right 0.75rem center; 4497 } 4498 4499 &:focus { 4500 outline: none; 4501 border-color: var(--primary-color); 4502 } 4503 4504 option { 4505 background: var(--bg-color); 4506 color: var(--text-color); 4507 padding: 0.5rem; 4508 } 4509`,Rr=c.button` 4510 padding: 0.75rem 1.5rem; 4511 border-radius: 8px; 4512 border: none; 4513 background: var(--primary-color); 4514 color: white; 4515 font-size: 1rem; 4516 cursor: pointer; 4517 transition: all 0.3s ease; 4518 4519 @media (max-width: 768px) { 4520 padding: 0.625rem 1.25rem; 4521 font-size: 0.9rem; 4522 width: 100%; 4523 } 4524 4525 &:hover { 4526 background: #ff8c1a; 4527 } 4528 4529 &:disabled { 4530 background: #666; 4531 cursor: not-allowed; 4532 } 4533`,fr=c(Rr)` 4534 padding: 0.5rem; 4535 min-width: 36px; 4536 height: 36px; 4537 display: flex; 4538 align-items: center; 4539 justify-content: center; 4540 font-size: 1.2rem; 4541 4542 @media (max-width: 768px) { 4543 min-width: 32px; 4544 height: 32px; 4545 padding: 0.375rem; 4546 font-size: 1rem; 4547 } 4548 4549 &:hover { 4550 transform: scale(1.05); 4551 } 4552`;c(Rr)` 4553 background: #dc3545; 4554 padding: 0.5rem; 4555 4556 &:hover { 4557 background: #c82333; 4558 } 4559`;const Ks=c(Rr)` 4560 background: #28a745; 4561 align-self: flex-start; 4562 4563 @media (max-width: 768px) { 4564 width: 100%; 4565 align-self: stretch; 4566 } 4567 4568 &:hover { 4569 background: #218838; 4570 } 4571`,r0=c.div` 4572 display: flex; 4573 flex-direction: column; 4574 gap: 1rem; 4575 background: rgba(255, 255, 255, 0.03); 4576 padding: 1.5rem; 4577 border-radius: 8px; 4578 border: 1px solid rgba(255, 255, 255, 0.1); 4579 4580 @media (max-width: 768px) { 4581 padding: 1rem; 4582 gap: 0.75rem; 4583 } 4584`,Xs=c.div` 4585 display: flex; 4586 gap: 1rem; 4587 align-items: center; 4588 background: rgba(255, 255, 255, 0.05); 4589 padding: 1rem; 4590 border-radius: 6px; 4591 border: 1px solid rgba(255, 255, 255, 0.1); 4592 transition: all 0.3s ease; 4593 4594 @media (max-width: 768px) { 4595 padding: 0.75rem; 4596 gap: 0.5rem; 4597 flex-direction: column; 4598 align-items: stretch; 4599 4600 & > div { 4601 flex-direction: column; 4602 gap: 0.5rem; 4603 } 4604 } 4605 4606 &:hover { 4607 border-color: var(--primary-color); 4608 background: rgba(255, 255, 255, 0.07); 4609 } 4610`,n0=c(Rt)` 4611 flex: 1; 4612 margin: 0; 4613 background: rgba(255, 255, 255, 0.05); 4614 4615 @media (max-width: 768px) { 4616 width: 100%; 4617 } 4618 4619 &:focus { 4620 background: rgba(255, 255, 255, 0.08); 4621 } 4622`,Qs=c.div` 4623 display: flex; 4624 gap: 0.5rem; 4625 4626 @media (max-width: 768px) { 4627 width: 100%; 4628 justify-content: flex-end; 4629 } 4630`,i0=c.div` 4631 display: flex; 4632 justify-content: space-between; 4633 align-items: center; 4634 margin-bottom: 1rem; 4635 4636 @media (max-width: 768px) { 4637 margin-bottom: 0.75rem; 4638 } 4639`,s0=c.span` 4640 color: rgba(255, 255, 255, 0.6); 4641 4642 @media (max-width: 768px) { 4643 font-size: 0.9rem; 4644 } 4645`,o0=c.div` 4646 display: flex; 4647 flex-direction: column; 4648 gap: 0.5rem; 4649 width: 100%; 4650 4651 @media (max-width: 768px) { 4652 gap: 0.375rem; 4653 } 4654`,a0=c.label` 4655 display: flex; 4656 align-items: center; 4657 gap: 0.5rem; 4658 font-size: 0.9rem; 4659 color: var(--text-color); 4660 4661 @media (max-width: 768px) { 4662 font-size: 0.85rem; 4663 margin-bottom: 0.25rem; 4664 } 4665 4666 input[type="checkbox"] { 4667 width: 16px; 4668 height: 16px; 4669 } 4670`,In=()=>{const r=$e(),e=Zs(),i=new URLSearchParams(e.search).get("project"),s=!!i,[o,a]=C.useState(!1),[l,d]=C.useState([]),[h,u]=C.useState([{user_id:"",role:"",custom_name:"",custom_email:"",is_custom:!1}]),[m,x]=C.useState([]),[g,v]=C.useState({title:"",description:"",status:"active",deadline:"",client_id:""}),[b,y]=C.useState([{title:"",completed:!1}]);C.useEffect(()=>{S(),R(),s&&i&&L(i)},[i]);const S=async()=>{try{console.log("Fetching users...");const{data:{session:_}}=await F.auth.getSession();if(!_){console.error("No authenticated session found");return}const{data:k,error:P}=await F.from("profiles").select("*").order("first_name",{ascending:!0});if(P){console.error("Error fetching profiles:",P);return}if(console.log("Fetched profiles:",k),k&&k.length>0){const N=k.filter(X=>!X.is_admin&&X.first_name&&X.last_name&&X.email);console.log("Valid clients:",N),d(N);const Z=k.filter(X=>X.is_admin&&X.first_name&&X.last_name&&X.email);console.log("Valid team members:",Z),x(Z)}else console.log("No profiles found")}catch(_){console.error("Error in fetchUsers:",_)}},R=async()=>{const{data:{session:_},error:k}=await F.auth.getSession();if(k||!_){console.error("No authenticated session:",k),r("/login");return}},L=async _=>{try{a(!0),console.log("Loading project data for editing, ID:",_);const{data:k,error:P}=await F.from("projects").select("*").eq("id",_).single();if(P){console.error("Error loading project:",P);return}if(!k){console.error("Project not found");return}console.log("Project data loaded:",k),v({title:k.title||"",description:k.description||"",status:k.status||"active",deadline:k.deadline||"",client_id:k.client_id||""});const{data:N,error:Z}=await F.from("tasks").select("*").eq("project_id",_);Z?console.error("Error loading tasks:",Z):N&&N.length>0&&(console.log("Existing tasks loaded:",N),y(N.map(oe=>({id:oe.id,title:oe.title,completed:oe.completed,project_id:oe.project_id}))));const{data:X,error:H}=await F.from("project_members").select(` 4671 *, 4672 profiles ( 4673 first_name, 4674 last_name, 4675 email 4676 ) 4677 `).eq("project_id",_);H?console.error("Error loading team members:",H):X&&X.length>0&&(console.log("Existing team members loaded:",X),u(X.map(oe=>({user_id:oe.user_id||"",role:oe.role||"",custom_name:"",custom_email:"",is_custom:!1}))))}catch(k){console.error("Error in loadProjectData:",k)}finally{a(!1)}},B=_=>{const{name:k,value:P}=_.target;v(N=>({...N,[k]:P}))},z=(_,k)=>{const P=[...b];P[_].title=k,y(P)},ue=()=>{y(_=>[..._,{title:"",completed:!1}])},I=_=>{y(k=>k.filter((P,N)=>N!==_))},M=(_,k,P)=>{const N=[...h];if(k==="is_custom")N[_]={...N[_],is_custom:P,user_id:"",custom_name:"",custom_email:""};else if(k==="user_id"&&!N[_].is_custom){if(h.some((X,H)=>H!==_&&X.user_id===P)){alert("This user is already part of the team.");return}N[_][k]=P}else N[_][k]=P;u(N)},O=()=>{u(_=>[..._,{user_id:"",role:"",custom_name:"",custom_email:"",is_custom:!1}])},T=_=>{u(k=>k.filter((P,N)=>N!==_))},w=async _=>{_.preventDefault(),a(!0);try{const{data:{session:k},error:P}=await F.auth.getSession();if(P||!k)throw new Error("You must be logged in to create a project");s&&i?await D(i):await U(),r("/admin")}catch(k){console.error("Error in handleSubmit:",k),alert(k instanceof Error?k.message:"An error occurred while saving the project")}finally{a(!1)}},U=async()=>
4677{console.log("Creating project with data:",{title:g.title,description:g.description,status:g.status,deadline:g.deadline,client_id:g.client_id,progress:0});try{console.log("Using admin_create_project function to bypass RLS...");const{data:_,error:k}=await $.rpc("admin_create_project",{project_title:g.title,project_description:g.description,project_status:g.status,project_deadline:g.deadline,project_client_id:g.client_id,project_progress:0});if(k){console.error("Project creation RPC error:",k),console.log("RPC function failed, attempting fallback method...");const{data:N,error:Z}=await $.from("projects").insert([{title:g.title,description:g.description,status:"active",progress:0,deadline:g.deadline,client_id:g.client_id}]).select().single();if(Z)throw console.error("Project creation error:",Z),new Error(`Failed to create project: ${Z.message}`);if(!N)throw new Error("No project data returned after creation");if(console.log("Project created successfully with temporary status via fallback method:",N),g.status!=="active"){console.log(`Updating project status to ${g.status} using admin function...`);const{data:X,error:H}=await $.rpc("admin_update_project_status",{project_id:N.id,new_status:g.status});H?(console.error("Error updating project status:",H),alert(`Project created, but status could not be set to ${g.status}. It will remain 'active'.`)):console.log("Status updated successfully:",X)}await W(N.id),await ie(N.id);return}const P=_;console.log("Project created successfully via RPC function, ID:",P),await W(P),await ie(P)}catch(_){throw console.error("Error in handleProjectCreate:",_),_}},D=async _=>{console.log("Updating project with ID:",_);const{data:k,error:P}=await $.from("projects").select("status").eq("id",_).single();if(P)throw console.error("Error fetching current project status:",P),new Error(`Failed to fetch project status: ${P.message}`);const N=(k==null?void 0:k.status)||"active";console.log(`Current project status: ${N}, new status: ${g.status}`);const{error:Z}=await $.from("projects").update({title:g.title,description:g.description,deadline:g.deadline,client_id:g.client_id}).eq("id",_);if(Z)throw console.error("Error updating project:",Z),new Error(`Failed to update project: ${Z.message}`);if(console.log("Project basic details updated successfully"),g.status!==N){console.log(`Updating project status from ${N} to ${g.status} using admin function...`);const{data:X,error:H}=await $.rpc("admin_update_project_status",{project_id:_,new_status:g.status});H?(console.error("Error updating project status:",H),alert(`Project updated, but status could not be changed from ${N} to ${g.status}.`)):console.log("Status updated successfully:",X)}await W(_)},W=async _=>{if(b.length>0){const k=b.filter(H=>!H.id&&H.title.trim()!=="");if(k.length>0){console.log("Creating tasks for project:",_),console.log("New tasks to insert:",k);const H=k.map(oe=>({project_id:_,title:oe.title.trim(),completed:oe.completed||!1}));console.log("Formatted tasks to insert:",H);try{const{data:oe,error:Ie}=await $.from("tasks").insert(H).select();if(Ie)throw console.error("Error creating tasks:",Ie),new Error(`Failed to create tasks: ${Ie.message}`);console.log("Tasks created successfully:",oe)}catch(oe){console.error("Exception occurred while creating tasks:",oe)}}else console.log("No new tasks to insert.");const P=b.filter(H=>H.id);console.log("Existing tasks to update:",P);for(const H of P){console.log(`Updating task ${H.id}:`,H);try{const{data:oe,error:Ie}=await $.from("tasks").update({title:H.title.trim(),completed:H.completed}).eq("id",H.id).select();Ie?console.error(`Error updating task ${H.id}:`,Ie):console.log(`Task ${H.id} updated successfully:`,oe)}catch(oe){console.error(`Exception while updating task ${H.id}:`,oe)}}const N=b.filter(H=>H.completed).length,Z=b.length,X=Z>0?Math.round(N/Z*100):0;console.log(`Updating project progress to ${X}% (${N}/${Z})`);try{const{error:H}=await $.from("projects").update({progress:X}).eq("id",_);H?console.error("Error updating project progress:",H):console.log(`Project progress updated to ${X}%`)}catch(H){console.error("Exception while updating project progress:",H)}}else console.log("No tasks to create or update.")},ie=async _=>{if(h.length>0){const k=h.filter(P=>P.user_id);if(k.length>0){console.log("Creating team members using admin_create_project_member function...");for(const P of k)try{const{data:N,error:Z}=await $.rpc("admin_create_project_member",{p_project_id:_,p_user_id:P.user_id,p_role:P.role});if(Z){console.error("Error creating team member via RPC:",Z),console.log("Trying fallback direct insert as last resort...");const{error:X}=await $.from("project_members").insert({project_id:_,user_id:P.user_id,role:P.role});X?console.error("Fallback insert also failed:",X):console.log("Fallback insert succeeded for member")}else console.log("Successfully added team member, returned ID:",N)}catch(N){console.error("Exception creating team member:",N)}}}},J=(_,k)=>n.jsxs(Xs,{children:[n.jsxs(o0,{children:[n.jsxs(a0,{children:[n.jsx("input",{type:"checkbox",checked:_.is_custom,onChange:P=>M(k,"is_custom",P.target.checked)}),"Manual Entry"]}),_.is_custom?n.jsxs(n.Fragment,{children:[n.jsx(Rt,{type:"text",placeholder:"Team member name",value:_.custom_name,onChange:P=>M(k,"custom_name",P.target.value),required:_.is_custom}),n.jsx(Rt,{type:"email",placeholder:"Team member email",value:_.custom_email,onChange:P=>M(k,"custom_email",P.target.value),required:_.is_custom})]}):n.jsxs(mr,{value:_.user_id,onChange:P=>M(k,"user_id",P.target.value),required:!_.is_custom,children:[n.jsx("option",{value:"",children:"Select team member"}),m.map(P=>n.jsxs("option",{value:P.id,children:[P.first_name," ",P.last_name,"
4677(",P.email,")"]},P.id))]}),n.jsxs(mr,{value:_.role,onChange:P=>M(k,"role",P.target.value),required:!0,children:[n.jsx("option",{value:"",children:"Select role"}),n.jsxs("optgroup",{label:"Management",children:[n.jsx("option",{value:"project_manager",children:"Project Manager"}),n.jsx("option",{value:"creative_director",children:"Creative Director"}),n.jsx("option",{value:"art_director",children:"Art Director"}),n.jsx("option",{value:"production_manager",children:"Production Manager"})]}),n.jsxs("optgroup",{label:"Creative",children:[n.jsx("option",{value:"designer",children:"Designer"}),n.jsx("option",{value:"ui_designer",children:"UI Designer"}),n.jsx("option",{value:"motion_designer",children:"Motion Designer"}),n.jsx("option",{value:"graphic_designer",children:"Graphic Designer"}),n.jsx("option",{value:"illustrator",children:"Illustrator"})]}),n.jsxs("optgroup",{label:"Development",children:[n.jsx("option",{value:"developer",children:"Developer"}),n.jsx("option",{value:"frontend_developer",children:"Frontend Developer"}),n.jsx("option",{value:"backend_developer",children:"Backend Developer"}),n.jsx("option",{value:"fullstack_developer",children:"Fullstack Developer"})]})]})]}),n.jsx(Qs,{children:n.jsx(fr,{type:"button",onClick:()=>T(k),style:{background:"#dc3545"},children:"Ã"})})]},k);return n.jsx(Xg,{children:n.jsxs(Qg,{children:[n.jsx(Zg,{children:s?"Edit Project":"Create New Project"}),n.jsxs(e0,{onSubmit:w,children:[n.jsxs(Je,{children:[n.jsx(Ke,{children:"Project Title"}),n.jsx(Rt,{type:"text",name:"title",value:g.title,onChange:B,required:!0})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:"Description"}),n.jsx(t0,{name:"description",value:g.description,onChange:B,required:!0})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:"Status"}),n.jsxs(mr,{name:"status",value:g.status,onChange:B,required:!0,children:[n.jsx("option",{value:"active",children:"Active"}),n.jsx("option",{value:"review",children:"Review"}),n.jsx("option",{value:"completed",children:"Completed"})]})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:"Deadline"}),n.jsx(Rt,{type:"date",name:"deadline",value:g.deadline,onChange:B,required:!0})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:"Client"}),n.jsxs(mr,{name:"client_id",value:g.client_id,onChange:B,required:!0,children:[n.jsx("option",{value:"",children:"Select a client"}),l.length>0?l.map(_=>n.jsx("option",{value:_.id,children:_.company_name?`${_.company_name} (${_.first_name} ${_.last_name})`:`${_.first_name} ${_.last_name}`},_.id)):n.jsx("option",{value:"",disabled:!0,children:"Loading clients..."})]})]}),n.jsxs(Je,{children:[n.jsxs(i0,{children:[n.jsx(Ke,{children:"Tasks"}),n.jsxs(s0,{children:[b.length," task",b.length!==1?"s":""]})]}),n.jsx(r0,{children:b.map((_,k)=>n.jsxs(Xs,{children:[n.jsx(n0,{type:"text",value:_.title,onChange:P=>z(k,P.target.value),placeholder:"Enter task description...",required:!0}),n.jsxs(Qs,{children:[n.jsx(fr,{type:"button",onClick:()=>{if(k>0){const P=[...b];[P[k-1],P[k]]=[P[k],P[k-1]],y(P)}},disabled:k===0,title:"Move Up",style:{background:"rgba(255, 255, 255, 0.1)"},children:"â"}),n.jsx(fr,{type:"button",onClick:()=>{if(k<b.length-1){const P=[...b];[P[k],P[k+1]]=[P[k+1],P[k]],y(P)}},disabled:k===b.length-1,title:"Move Down",style:{background:"rgba(255, 255, 255, 0.1)"},children:"â"}),n.jsx(fr,{type:"button",onClick:()=>I(k),disabled:b.length===1,title:"Remove Task",style:{background:"#dc3545"},children:"Ã"})]})]},k))}),n.jsx(Ks,{type:"button",onClick:ue,style:{marginTop:"1rem"},children:"+ Add Task"})]}),n.jsxs(Je,{children:[n.jsx(Ke,{children:"Team Members"}),h.map((_,k)=>J(_,k)),n.jsx(Ks,{type:"button",onClick:O,children:"Add Team Member"})]}),n.jsx(Rr,{type:"submit",disabled:o,children:o?"Saving Project...":"Save Project"})]})]})})},l0=c.div` 4678 min-height: 100vh; 4679 display: flex; 4680 flex-direction: column; 4681 align-items: center; 4682 justify-content: flex-start; 4683 padding-top: 120px; 4684 background: var(--bg-color); 4685`,c0=c.form` 4686 background: rgba(255,255,255,0.04); 4687 border-radius: 12px; 4688 padding: 2rem 2.5rem; 4689 box-shadow: 0 2px 16px rgba(0,0,0,0.08); 4690 display: flex; 4691 flex-direction: column; 4692 gap: 1.5rem; 4693 min-width: 320px; 4694 max-width: 90vw; 4695`,d0=c.input` 4696 padding: 0.75rem 1rem; 4697 border-radius: 8px; 4698 border: 1px solid rgba(255,255,255,0.2); 4699 background: rgba(255,255,255,0.08); 4700 color: var(--text-color); 4701 font-size: 1rem; 4702 &:focus { 4703 outline: none; 4704 border-color: var(--primary-color); 4705 } 4706`,u0=c.button` 4707 background: var(--primary-color); 4708 color: white; 4709 border: none; 4710 border-radius: 8px; 4711 padding: 0.75rem 1rem; 4712 font-size: 1rem; 4713 cursor: pointer; 4714 transition: background 0.2s; 4715 &:hover { 4716 background: #ff8c1a; 4717 } 4718`,h0=c.p` 4719 color: var(--primary-color); 4720 text-align: center; 4721`,m0=()=>{const[r,e]=C.useState(""),[t,i]=C.useState(""),s=async o=>{o.preventDefault(),i("");const{error:a}=await F.auth.resetPasswordForEmail(r,{redirectTo:"http://localhost:5173/reset-password"});i(a?a.message:"Check your email for a password reset link.")};return n.jsx(l0,{children:n.jsxs(c0,{onSubmit:s,children:[n.jsx("h2",{style:{textAlign:"center",margin:0},children:"Forgot Password"}),n.jsx(d0,{type:"email",placeholder:"Your email",value:r,onChange:o=>e(o.target.value),required:!0}),n.jsx(u0,{type:"submit",children:"Send Reset Link"}),t&&n.jsx(h0,{children:t})]})})},f0=c.div` 4722 min-height: 100vh; 4723 display: flex; 4724 flex-direction: column; 4725 align-items: center; 4726 justify-content: flex-start; 4727 padding-top: 120px; 4728 background: var(--bg-color); 4729`,p0=c.form` 4730 background: rgba(255,255,255,0.04); 4731 border-radius: 12px; 4732 padding: 2rem 2.5rem; 4733 box-shadow: 0 2px 16px rgba(0,0,0,0.08); 4734 display: flex; 4735 flex-direction: column; 4736 gap: 1.5rem; 4737 min-width: 320px; 4738 max-width: 90vw; 4739`,g0=c.input` 4740 padding: 0.75rem 1rem; 4741 border-radius: 8px; 4742 border: 1px solid rgba(255,255,255,0.2); 4743 background: rgba(255,255,255,0.08); 4744 color: var(--text-color); 4745 font-size: 1rem; 4746 &:focus { 4747 outline: none; 4748 border-color: var(--primary-color); 4749 } 4750`,x0=c.button` 4751 background: var(--primary-color); 4752 color: white; 4753 border: none; 4754 border-radius: 8px; 4755 padding: 0.75rem 1rem; 4756 font-size: 1rem; 4757 cursor: pointer; 4758 transition: background 0.2s; 4759 &:hover { 4760 background: #ff8c1a; 4761 } 4762`,b0=c.p` 4763 color: var(--primary-color); 4764 text-align: center;
4765`,v0=()=>{const[r,e]=C.useState(""),[t,i]=C.useState(""),s=$e(),o=async a=>{a.preventDefault();const{error:l}=await F.auth.updateUser({password:r});l?i(l.message):(i("Password updated! Redirecting to login..."),setTimeout(()=>s("/login"),2e3))};return n.jsx(f0,{children:n.jsxs(p0,{onSubmit:o,children:[n.jsx("h2",{style:{textAlign:"center",margin:0},children:"Set New Password"}),n.jsx(g0,{type:"password",placeholder:"New password",value:r,onChange:a=>e(a.target.value),required:!0}),n.jsx(x0,{type:"submit",children:"Set New Password"}),t&&n.jsx(b0,{children:t})]})})},y0=c.div` 4766 min-height: 100vh; 4767 background-color: var(--bg-color); 4768 overflow-x: hidden; 4769`,w0=c.main` 4770 max-width: 100%; 4771 margin: 0 auto; 4772`,j0=()=>(jr.useEffect(()=>{const r=document.createElement("a");r.href="/downloads/MM-Portfolio-2022.pdf",r.download="MediaMill-Portfolio-2022.pdf",document.body.appendChild(r),r.click(),document.body.removeChild(r);const e=setTimeout(()=>{window.location.href="/"},100);return()=>clearTimeout(e)},[]),n.jsx("div",{style:{padding:"100px 20px",textAlign:"center",color:"white"},children:"Downloading portfolio..."})),_0=()=>n.jsxs(Ia,{children:[n.jsx(Yh,{}),n.jsxs(y0,{children:[n.jsx(Ba,{}),n.jsx(vd,{}),n.jsxs(Da,{children:[n.jsx(se,{path:"/",element:n.jsx(xm,{})}),n.jsx(se,{path:"/projects",element:n.jsx(rf,{})}),n.jsx(se,{path:"/projects/black-liberation",element:n.jsx(Km,{})}),n.jsx(se,{path:"/projects/futuristic-world",element:n.jsx(Sm,{})}),n.jsx(se,{path:"/projects/good-vibez",element:n.jsx(Im,{})}),n.jsx(se,{path:"/projects/building-character",element:n.jsx(Um,{})}),n.jsx(se,{path:"/who-we-are",element:n.jsx(cf,{})}),n.jsx(se,{path:"/what-we-do",element:n.jsx(xf,{})}),n.jsx(se,{path:"/book-service",element:n.jsx(Xf,{})}),n.jsx(se,{path:"/hub",element:n.jsx(Pp,{})}),n.jsx(se,{path:"/hub/project/:id",element:n.jsx(vg,{})}),n.jsx(se,{path:"/hub-registration",element:n.jsx(Rp,{})}),n.jsx(se,{path:"/login",element:n.jsx(Gp,{})}),n.jsx(se,{path:"/download-portfolio",element:n.jsx(j0,{})}),n.jsx(se,{path:"/join-community",element:n.jsx(Fg,{})}),n.jsx(se,{path:"/admin",element:n.jsx(sr,{children:n.jsx(Kg,{})})}),n.jsx(se,{path:"/project-form",element:n.jsx(sr,{children:n.jsx(In,{})})}),n.jsx(se,{path:"/admin/projects/new",element:n.jsx(sr,{children:n.jsx(In,{})})}),n.jsx(se,{path:"/admin/projects/:id/edit",element:n.jsx(sr,{children:n.jsx(In,{})})}),n.jsx(se,{path:"/forgot-password",element:n.jsx(m0,{})}),n.jsx(se,{path:"/reset-password",element:n.jsx(v0,{})})]}),n.jsx(w0,{children:n.jsx(Gh,{})})]})]});Dn.createRoot(document.getElementById("root")).render(n.jsx(jr.StrictMode,{children:n.jsx(_0,{})})); 4773function __vite__mapDeps(indexes) { 4774 if (!__vite__mapDeps.viteFileDeps) { 4775 __vite__mapDeps.viteFileDeps = ["assets/browser-BscB7iPs.js","assets/vendor-Dmwew988.js"] 4776 } 4777 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 4778} 4779//# sourceMappingURL=index-BvzbtCNs.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.