try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="284d0cc3-7bb0-40d9-b186-04b42db020d9",e._sentryDebugIdIdentifier="sentry-dbid-284d0cc3-7bb0-40d9-b186-04b42db020d9")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4604],{84604:function(e,t,n){n.d(t,{a:function(){return l},d:function(){return s}});var r=n(57437),o=n(85434),i=n(67365),a=n(65905),u=n(2265);let c=(0,u.createContext)({user:null,getUser:()=>{throw Error()},setUser:()=>{throw Error()},profile:void 0,setProfile:()=>{throw Error()},coreProfile:null,getCoreProfile:()=>{throw Error()},setCoreProfile:()=>{throw Error()},getAvailabilitySettings:()=>{throw Error()},userGMT:"Unknown",googleConnected:!1,checkGoogleStatus:()=>{throw Error()},loading:!0}),l=()=>{let e=(0,u.useContext)(c);if(void 0===e)throw Error("useUser must be used within a UserProvider");return e},s=e=>{let{children:t}=e,n=(0,a.kM)(),[l,s]=(0,u.useState)(null),[d,f]=(0,u.useState)(void 0),[g,p]=(0,u.useState)(null),[h,v]=(0,u.useState)("Unknown"),[w,m]=(0,u.useState)(!1),[y,D]=(0,u.useState)(!0);async function S(e){try{let t=await (0,o.hi)().get("user/info",{headers:{"Content-Type":"application/json",Authorization:n.getAccessToken()},..."update"===e&&{cache:!1}});s(t.data)}catch(e){console.error(e)}finally{D(!1)}}async function b(){try{let e=await (0,o.hi)({core:!0}).get("v1/schedule/settings/",{headers:{"Content-Type":"application/json",Authorization:n.getAccessToken()},id:"".concat(null==l?void 0:l.ID,":schedule_settings")});s({...l,AvailabilitySettings:e.data})}catch(e){console.error(e)}}async function C(){f(await n.getProfileAsync())}async function T(e){try{let t="update"===e?{_:Date.now()}:void 0,r=await (0,o.hi)({core:!0}).get("v1/profile/",{headers:{"Content-Type":"application/json",Authorization:n.getAccessToken(),"Cache-Control":"no-cache",Pragma:"no-cache"},params:t});return p(r.data),v((0,i._x)(r.data.timezone)),r.data}catch(e){console.error(e)}}async function E(){var e;m(!!(null===(e=(await (0,o.ZP)({core:!0}).get("/pub/v1/google/calendar/status/",{headers:{"Content-Type":"application/json",Authorization:n.getAccessToken()}})).data)||void 0===e?void 0:e.connected))}(0,u.useEffect)(()=>{(async()=>{await S()})()},[]),(0,u.useEffect)(()=>{l&&(C(),T(),E())},[l]);let U=(0,u.useMemo)(()=>({user:l,getUser:S,setUser:s,profile:d,setProfile:f,coreProfile:g,getCoreProfile:T,setCoreProfile:p,getAvailabilitySettings:b,userGMT:h,googleConnected:w,checkGoogleStatus:E,loading:y}),[l,d,g,h,w,y]);return(0,r.jsx)(c.Provider,{value:U,children:t})}},85434:function(e,t,n){n.d(t,{IZ:function(){return c},hi:function(){return u}});var r=n(38472),o=n(61232),i=n(88726);let a=e=>r.default.create({baseURL:(null==e?void 0:e.core)?"https://core.meto.co":"https://altdev.meto.co",headers:{"Content-Type":"application/json",Authorization:"mqVfrdUxBv0kcHd0C7lZi7WB2DS1NyxpmkLH50NjHM3je5I7IXVCxnW37xYGgTHxH1ZFXd"}}),u=e=>(0,o.v8)(a(e),{ttl:0,cachePredicate:()=>!1,storage:(0,o.ZF)(window.localStorage,"axios-cache:")}),c=e=>{if(console.error(e),r.default.isAxiosError(e)){var t,n,o,a,u,c,l,s,d,f,g,p;(null===(t=e.response)||void 0===t?void 0:t.status)===403||(null===(o=e.response)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:n.detail)==="unauthorized"?(i.ZP.error("Unauthorized"),window.location.href="/signin/"):(null===(a=e.response)||void 0===a?void 0:a.data)?i.ZP.error((null===(c=e.response)||void 0===c?void 0:null===(u=c.data)||void 0===u?void 0:u.error)||(null===(d=e.response)||void 0===d?void 0:null===(s=d.data)||void 0===s?void 0:null===(l=s.error)||void 0===l?void 0:l.message)||(null===(g=e.response)||void 0===g?void 0:null===(f=g.data)||void 0===f?void 0:f.message)||JSON.stringify(null===(p=e.response)||void 0===p?void 0:p.data)):i.ZP.error("Oops! The server encountered an error and could not complete your request.")}else e instanceof Error&&e.message?i.ZP.error(e.message):i.ZP.error("Oops! An unexpected error occurred.");return e};t.ZP=a},67365:function(e,t,n){n.d(t,{Bo:function(){return U},C3:function(){return O},DC:function(){return S},DY:function(){return M},Ho:function(){return z},I0:function(){return b},J4:function(){return B},Jg:function(){return Z},P$:function(){return w},Rl:function(){return R},Sy:function(){return _},VG:function(){return V},X5:function(){return E},Yh:function(){return G},_x:function(){return Y},aA:function(){return F},ap:function(){return A},fq:function(){return T},g4:function(){return m},h$:function(){return N},lV:function(){return W},lb:function(){return I},mq:function(){return y},nv:function(){return q},oQ:function(){return C},oV:function(){return P},un:function(){return D},wh:function(){return x},xB:function(){return j},xd:function(){return k},yE:function(){return H},zk:function(){return L}});var r=n(25147),o=n(75804),i=n(54461),a=n(6469),u=n(24040),c=n(24722),l=n(92991),s=n(61174),d=n(72781),f=n(63609),g=n(59520),p=n(51936),h=n(45158),v=n(81553);function w(){return window.location.origin}function m(e){return e.split(" ").map(e=>e[0]).join("").toUpperCase()}function y(e,t){let n=e.includes("?")?"&":"?";return e+n+Object.keys(t).map(e=>"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(t[e]))).join("&")}function D(e){if(!e)return e;let t=(0,r.S)(e,"US");return t?t.formatNational():e}function S(e){let t=e.interval,n=[],r=new Date("".concat((0,o.S)(new Date),"-01-01T").concat("00:00","Z")),i=new Date("".concat((0,o.S)(new Date),"-01-01T").concat("23:45","Z"));for(;r<=i;){let o=r.getUTCMinutes().toString().padStart(2,"0"),i=r.getUTCHours()>=12?"pm":"am",a=(r.getUTCHours()%12||12).toString().padStart(2,"0");n.push(e.minutes?a+":"+o+i:a+" "+i),r.setMinutes(r.getMinutes()+t)}return n}function b(){let e=(0,o.S)(new Date),t=[];for(let n=1970;n<=e;n++)t.push(n.toString());return t}function C(e){let t=(0,i.Qc)(e,"hh:mma",new Date);return(0,a.WU)(t,"HH:mm")}function T(e){let t=(0,i.Qc)(e,"HH:mm",new Date);return(0,a.WU)(t,"hh:mma").toLowerCase()}function E(e,t){return Object.keys(e).some(n=>!(t||[]).includes(n)&&(null===e[n]||void 0===e[n]||""===e[n]||!1===e[n]||e[n]&&0===e[n].length))}function U(e){let t="";for(let n=0;n<(e||[]).length;n++)""!==e[n]&&(""!==t&&", "!==t.slice(-2)&&(t+=", "),t+=e[n]);return t}function k(e,t,n){let r=Math.ceil(e/t),o=[];if(r<=2*n+1)for(let e=1;e<=r;e++)o.push({page:e});else{for(let e=1;e<=n;e++)o.push({page:e});o.push({page:"..."});for(let e=r-n+1;e<=r;e++)o.push({page:e})}return o}function x(e){let t=e.getDate(),n=e.getFullYear(),r=[];return[0,3,6,9].forEach(e=>{let o=new Date(n,e,t);r.push(o)}),r}function P(e,t){let n=e.getDate(),r=(0,u.x)(e);return(0,c.P)(r,t).setDate(n)}function M(e){return(.393701*e).toFixed(2)}let I=e=>{let t=e.toFixed(2),n=t.toString().split(".");return n[0]=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=n.join(".")};function A(e){if(!e||"n/a"===e.toLowerCase())return 0;let t=parseFloat((e||"").toString().replace(/,/g,""));return isNaN(t)?0:t}let N=e=>e.includes("..."),Z=e=>(2.2046*Number(e)).toFixed(2),F=e=>(Number(e)/2.2046).toFixed(2),j=e=>(Number(e)/.3937).toFixed(2),H=e=>(.3937*Number(e)).toFixed(2),_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"US/Pacific";return(0,v.zW)(new Date,e)},z=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"US/Pacific";return(0,v.CV)(new Date,e,"O").replace("-"," - ")},L=(e,t)=>(0,a.WU)(new Date(e),"MM-dd-yyyy")===(0,a.WU)(new Date(t),"MM-dd-yyyy");function W(e){return e.toString().toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-")}let O=e=>e.toLowerCase().includes("person")?"in-person":"virtual";function Y(e){var t;let n=function(e){let t=new Date,n=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"short",hour:"2-digit",minute:"2-digit"}).formatToParts(t).find(e=>"timeZoneName"===e.type);return(null==n?void 0:n.value)||"Unknown"}(e||Intl.DateTimeFormat().resolvedOptions().timeZone),r=n.match(/GMT[+-]\d+/),o=null!==(t=null==r?void 0:r[0])&&void 0!==t?t:"Unknown";return n.replace(o,"").trim()||o}function B(e){return(0,l.z)(e)?"Today":(0,s.g)(e)?"Yesterday":(0,a.WU)(e,"EEEE MMM d, yyyy")}function V(e){let t=new Date,n=(e+7-t.getDay())%7||7,r=(0,d.E)(t,n);return(0,f.I)((0,g.O)((0,p.H)((0,h.B)(r,9),0),0),0)}function G(e){let t=new Date(e),n=new Date,r=(e,t)=>e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),o=Math.floor((n.getTime()-t.getTime())/864e5);return r(n,t)?t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):(e=>{let t=new Date;return t.setDate(n.getDate()-1),r(e,t)})(t)?"Yesterday":o>7?t.toLocaleDateString("en-US"):t.toLocaleDateString("en-US",{weekday:"long"})}function q(e){let t;let n=navigator.userAgent;if(n.includes("Safari")&&!n.includes("Chrome")){let[n,r="00:00"]=e.split(" "),[o,i,a]=n.split("-");if(!o||!i||!a)throw Error("Invalid date format for Safari fallback");t=new Date("".concat(a,"-").concat(o.padStart(2,"0"),"-").concat(i.padStart(2,"0"),"T").concat(r))}else t=new Date(e);if(isNaN(t.getTime()))throw Error("Invalid Date");return t}let R=()=>{let e=new Date,t=(0,d.E)(e,1),n=(0,a.WU)(t,"EEEE");return["Tomorrow (".concat(n,") at 9:00am"),n]}}}]);