1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7869,9847],{447:(e,t,a)=>{a.d(t,{H:()=>n});function n(){try{return window.self!==window.top}catch(e){return!0}}},8047:(e,t,a)=>{a.d(t,{$9:()=>i,KL:()=>l,Wi:()=>r,ru:()=>o});var n=a(35760);let r="x-posthog-session-id",i="x-village-client",o="web";function l(){try{var e;return(null==(e=n.Ay.get_session_id)?void 0:e.call(n.Ay))||void 0}catch(e){return}}},9055:(e,t,a)=>{a.d(t,{BH:()=>i,u6:()=>n,yA:()=>r});let n=a(23727).env.NEXT_SSR_API_KEY||"";function r(){return!1}function i(){return!0}new Set(["development","dev","local","staging","stg","test"]).has("production")},9847:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(70217),r=a.n(n),i=a(8047);let o=r().create({baseURL:"https://api.village.ai",withCredentials:!0,timeout:12e4});o.interceptors.request.use(e=>{{let n=new URL(window.location.href);if("pk_landing_public"===(n.searchParams.get("partnerKey")||n.searchParams.get("public_key")))try{let t=sessionStorage.getItem("village_csrf_token");if(t){let a=JSON.parse(t);a.expiresAt>Date.now()&&(e.headers["x-csrf-token"]=a.token,e.headers["x-partner-key"]="pk_landing_public")}}catch(e){Promise.resolve().then(a.bind(a,5281)).then(t=>{let{logger:a}=t;return a.warn("failed to get CSRF token from storage",{scope:"api-client",err:e})}).catch(()=>{})}else{var t;let a=null==(t=document.cookie.split("; ").find(e=>e.startsWith("village.token=")))?void 0:t.split("=").slice(1).join("=");a&&(e.headers["x-access-token"]=a)}let r=(0,i.KL)();r&&(e.headers[i.Wi]=r)}return e.headers[i.$9]=i.ru,e});let l=e=>{var t,a,n;return null!=(n=null==e||null==(t=e.headers)?void 0:t["x-request-id"])?n:null==e||null==(a=e.headers)?void 0:a["x-trace-id"]};o.interceptors.response.use(e=>(e.requestId=l(e),e),e=>(e.requestId=l(e.response),Promise.reject(e))),o.CancelToken=r().CancelToken,o.isCancel=r().isCancel;let s=o},13716:(e,t,a)=>{a.d(t,{O:()=>u,_:()=>c});var n=a(41695),r=a(16304),i=a(35760),o=a(90993),l=a(39277);let s=["/directory"];function u(e){return s.some(t=>e===t||e.startsWith("".concat(t,"/")))}function c(){let e=(0,r.useRouter)().asPath.split("#")[0];(0,n.useEffect)(()=>{if(!l.rX&&i.Ay.__loaded&&!(0,o.N)())try{i.Ay.capture("$pageview")}catch(e){console.error("[tracking] PostHog $pageview capture failed",{err:e})}},[e])}},13966:(e,t,a)=>{a.d(t,{A:()=>u});var n=a(20674),r=a(67299),i=a(11850),o=a(5281);class l{error(e,t){o.logger.error(e,{scope:"partner-oauth",err:t})}isOAuthRequired(){try{let e=window.location.hostname;return!(e.includes("village.do")||e.includes("village.ai")||"localhost"===e)}catch(e){return this.error("Error determining if OAuth is required:",e),!1}}getPartnerKey(){let e=(0,i.zp)().get(r.rh);if(null==e?void 0:e.partner_key){try{localStorage.setItem("village.partnerKey",e.partner_key)}catch(e){this.error("Failed to store partner key in localStorage:",e)}return e.partner_key}try{let e=localStorage.getItem("village.partnerKey");if(e)return e}catch(e){this.error("Failed to read partner key from localStorage:",e)}return null}initOAuth(){let{partnerKey:e,userReference:t,loginState:a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="".concat("https://village.ai","/widget/oauth"),r=new URLSearchParams,i=e||this.getPartnerKey();i&&r.append("partnerKey",i),t&&r.append("userReference",t),r.append("parent_origin",encodeURIComponent(window.location.origin)),(null==a?void 0:a.planId)&&r.append("plan",String(a.planId)),(null==a?void 0:a.billingCadence)&&r.append("cadence",String(a.billingCadence));let o=r.toString()?"".concat(n,"?").concat(r.toString()):n;if(this.oauthPopupRef&&!this.oauthPopupRef.closed)try{this.oauthPopupRef.close()}catch(e){this.error("error closing popup",e)}if(this.oauthPopupRef=window.open(o,"village-oauth","popup=true,width=500,height=600"),!this.oauthPopupRef){this.error("Failed to open popup - it may have been blocked"),alert("Village sign-in popup was blocked. Please allow popups for this site.");return}this.checkPopupInterval&&clearInterval(this.checkPopupInterval),this.checkPopupInterval=setInterval(()=>{this.oauthPopupRef&&this.oauthPopupRef.closed&&(this.checkPopupInterval&&clearInterval(this.checkPopupInterval),this.oauthPopupRef=null)},1e3)}handleMessage(e){if(e.data&&e.data.type)switch(e.data.type){case"VILLAGE_OAUTH_SUCCESS":this.handleOAuthSuccess(e.data);break;case"VILLAGE_OAUTH_ERROR":this.handleOAuthError(e.data)}}handleOAuthSuccess(e){if(e.token){let t=!0;try{n.A.set("village.token",e.token,{secure:!0,expires:60,path:"/",sameSite:"lax"})}
1catch(e){t=!1,this.error("Failed to set cookie:",e)}if(t&&n.A.get("village.token")!==e.token&&(t=!1,this.error("Cookie was set but did not persist (likely blocked by browser).")),!t){if(alert("Authentication succeeded but your browser blocked the session cookie. This usually happens when third-party cookies are blocked or in private browsing. Please allow cookies for this site and try again."),this.checkPopupInterval&&clearInterval(this.checkPopupInterval),this.oauthPopupRef&&!this.oauthPopupRef.closed)try{this.oauthPopupRef.close()}catch(e){this.error("Error closing popup:",e)}this.oauthPopupRef=null;return}if(e.partnerData)try{localStorage.setItem("village.partnerAppData",JSON.stringify(e.partnerData))}catch(e){this.error("Failed to store partner data:",e)}if(this.oauthPopupRef&&!this.oauthPopupRef.closed)try{let e=new URL("https://village.ai").origin;this.oauthPopupRef.postMessage({type:"VILLAGE_OAUTH_ACKNOWLEDGED"},e)}catch(e){this.error("Error acknowledging auth success:",e)}this.checkPopupInterval&&clearInterval(this.checkPopupInterval),this.oauthPopupRef=null,setTimeout(()=>{window.location.reload()},1e3)}else this.error("No token in OAuth success message"),alert("Authentication succeeded but no token was received. Please try again.")}handleOAuthError(e){this.error("OAuth error:",e.error||"Unknown error"),this.checkPopupInterval&&clearInterval(this.checkPopupInterval),this.oauthPopupRef=null,e.error?alert("Authentication failed: ".concat(e.error)):alert("Authentication failed. Please try again later.")}constructor(){this.oauthPopupRef=null,this.checkPopupInterval=null,window.addEventListener("message",this.handleMessage.bind(this))}}let s=null,u=s=new l},33899:(e,t,a)=>{function n(e){let t=null==e?void 0:e.response;if((null==t?void 0:t.status)!==402)return null;let a=t.data;return(null==a?void 0:a.error)==="insufficient_credits"?a:null}function r(e){return e?{title:"You're not in a workspace yet",description:"Create a workspace to get credits."}:{title:"You don't have a seat in this workspace",description:"Ask a workspace admin for a seat, or switch to your own workspace."}}a.d(t,{B$:()=>s,Fu:()=>o,L9:()=>r,Y6:()=>l,g_:()=>n});let i=null;function o(e){return i=e,()=>{i===e&&(i=null)}}function l(e){if(!i)return void Promise.resolve().then(a.bind(a,5281)).then(t=>{var a;let{logger:n}=t;return n.warn("insufficient_credits prompt dropped â no provider registered",{scope:"credits",credits_left:null!=(a=e.credits_left)?a:null})}).catch(()=>{});i(e)}function s(e){let t=n(e);t&&l(t)}},33973:(e,t,a)=>{a.d(t,{y:()=>v,s:()=>y});var n=a(64255),r=a(41695),i=a(49954),o=a(34087),l=a(78694),s=a(35760),u=a(51304),c=a.n(u),d=a(25026),p=a.n(d),h=a(39277),g=a(13716),f=a(74594);let w=r.createContext(),v=e=>{let{children:t}=e,{isFreshSalesInitialized:a,FreshSalesAnalytic:u}=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let e,a;if((0,o.G)())return;let n=(0,i.l_)();if(window.fcWidget)return void t(!0);let r=!0,l=()=>{(a=document.createElement("script")).defer=!0,a.type="text/javascript",a.src="//fw-cdn.com/6281814/3218455.js",a.chat=!0,a.onload=()=>{r&&t(!0)},document.head.appendChild(a)};return n?e=setTimeout(l,3e3):l(),()=>{r=!1,clearTimeout(e),a&&(a.onload=null)}},[]),{FreshSalesAnalytic:{freshChat:{init:e=>{var t,a;return null==(a=window)||null==(t=a.fcWidget)?void 0:t.init(e)}}},isFreshSalesInitialized:e}}(),d=(0,l.zy)(),v=function(e){let t=new URLSearchParams(e);if(t.get("session_id")||["success","cancel"].includes(t.get("stripe_payment_status"))||"success"===t.get("checkout")||"true"===t.get("success")||["success","cancelled"].includes(t.get("upgrade")))for(let e of["session_id","stripe_payment_status","checkout","success","upgrade"])t.delete(e);return t.toString()}(d.search),y={UNKNOWN:0,DISABLED:1,ENABLED:2},[m,_]=(0,r.useState)(y.UNKNOWN),k=()=>m!==y.DISABLED&&(m===y.ENABLED||(localStorage.getItem("village.shouldNotTrack")?(_(y.DISABLED),!1):(_(y.ENABLED),!0)));(0,r.useEffect)(()=>{!k()&&s.Ay.__loaded&&s.Ay.opt_out_capturing()},[]),(0,r.useEffect)(()=>{!(h.rX||!s.Ay.__loaded||(0,g.O)(window.location.pathname))&&k()&&s.Ay.capture("$pageview")},[d.pathname,v]),(0,r.useEffect)(()=>
1{if(h.rX||!s.Ay.__loaded)return;let e=()=>{k()&&s.Ay.capture("$pageleave")};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[]);let A=r.useMemo(()=>({isReadyToTrack:s.Ay.__loaded,identify:e=>{if(!k())return;let t={full_name:e.name,first_name:e.first_name,last_name:e.last_name,email:e.email,graph_identity_id:e.graph_identity_id,is_admin:e.is_admin,type:e.type,is_sync_complete:e.is_sync_complete,signed_up_through_partner_id:e.signed_up_through_partner_id,created_date:e.created_date};if(s.Ay.__loaded&&s.Ay.identify(String(e.id),t),(0,f.yu)({id:e.id,email:e.email,name:e.name}),a){var n,r,i,l,d;(null==u||null==(n=u.freshChat)?void 0:n.init)&&u.freshChat.init({externalId:null!=(i=null==e?void 0:e.id)?i:"",firstName:null!=(l=null==e||null==(r=e.name)?void 0:r.split(" ")[0])?l:"",email:null!=(d=null==e?void 0:e.email)?d:""})}(0,o.b)(()=>{e&&!h.rX&&p()({app_id:"dzxhq1u5",user_id:e.id,name:e.name,email:e.email,created_at:c()(e.created_date).unix()})})},page:e=>{k()&&s.Ay.__loaded&&!h.rX&&s.Ay.capture("$pageview",{name:e})},reset:()=>{s.Ay.__loaded&&(s.Ay.reset(),s.Ay.opt_in_capturing({captureEventName:null})),(0,f.lf)(),localStorage.removeItem("village.shouldNotTrack"),(0,f.LN)(),_(y.UNKNOWN)},disableTracking:()=>{localStorage.setItem("village.shouldNotTrack","true"),s.Ay.__loaded&&s.Ay.opt_out_capturing(),(0,f.m9)(),_(y.DISABLED)}}),[a,m]);return(0,n.jsx)(w.Provider,{value:A,children:t})},y=()=>{let e=r.useContext(w);if(!e)throw Error("Context used outside of its Provider!");return e}},39277:(e,t,a)=>{var n,r,i;a.d(t,{rX:()=>l,wo:()=>s});let o=null!=(i=null==(r=window)||null==(n=r.location)?void 0:n.pathname)?i:"",l=!!o.startsWith("/widget"),s=function(e){return!!(null==e?void 0:e.startsWith("/widget"))||"/oauth/v2"===e}(o)},53004:(e,t,a)=>{a.d(t,{$B:()=>d,AO:()=>c,K6:()=>l,Lf:()=>g,fP:()=>p,iV:()=>s,nm:()=>i,pj:()=>h,qb:()=>o,qg:()=>u});var n=a(61132),r=a(9847);let i=async e=>{let{partnerKey:t}=e,{data:a}=await r.default.get("/partner",{params:{partnerKey:t}});return a},o=async e=>{try{let{data:t}=await r.default.get("/partner/app-data",{params:e?{custom_domain:e}:{}});return{data:t,success:!0}}catch(e){var t;if((null==(t=e.response)?void 0:t.status)===404)return{data:null,success:!1,error:"App not found"};throw e}},l=async e=>{let{public_key:t}=e,{data:a}=await r.default.get("/partner/check-authorization",{params:{public_key:t}});return a},s=async e=>{let{public_key:t,app_external_reference:a}=e,{data:n}=await r.default.post("/partner/create-authorization",{public_key:t,app_external_reference:a});return n},u=async()=>{let{data:e}=await r.default.post("/partner");return e},c=async e=>{let{data:t}=await r.default.patch("/partner",e);return t},d=async e=>{let{startDate:t,endDate:a,public_key:i}=e,o=e=>e?(0,n.GP)(new Date(e),"yyyy-MM-dd"):void 0,{data:l}=await r.default.get("/partner/usage",{params:{startDate:o(t),endDate:o(a),public_key:i}});return l},p=async e=>{let{data:t}=await r.default.get("/partner/team/".concat(e));return t},h=async e=>{let{data:t}=await r.default.post("/partner/team/invite",e);return t},g=async e=>{let{data:t}=await r.default.post("/partner/team/accept-invite",{token:e});return t}},57149:(e,t,a)=>{a.d(t,{Cm:()=>c,ln:()=>u,x_:()=>d});var n=a(32334),r=a(81210),i=a(48880),o=a(94994);let l=(0,n.$)({storage:{getItem:async e=>{var t;return null!=(t=await (0,i.Jt)(e))?t:null},setItem:async(e,t)=>{await (0,i.hZ)(e,t)},removeItem:async e=>{await (0,i.yH)(e)}},key:o.Qd}),s=new Set(o.Nk),u={persister:l,maxAge:o.GQ,buster:o.lj,dehydrateOptions:{shouldDehydrateQuery:function(e){return!(e.queryKey[0]===o.YO||e.queryKey[0]===o.nI||s.has(String(e.queryKey[0])))&&(0,r.XS)(e)}}};function c(){try{window.localStorage.removeItem(o.Ot)}catch(e){}}async function d(){try{await (0,i.yH)(o.Qd)}catch(e){console.warn("Failed to clear persisted query cache:",e)}c()}},58182:(e,t,a)=>{a.d(t,{Bc:()=>d,ZI:()=>g,k$:()=>h,m_:()=>p});var n=a(8777),r=a(62913),i=a(86917),o=a(97722),l=a(25722),s=a(64255);a(41695);var u=a(58836),c=a(62768);function d(e){var{delayDuration:t=0}=e,a=(0,l._)(e,["delayDuration"]);return(0,s.jsx)(c.Kq,(0,i._)({"data-slot":"tooltip-provider",delayDuration:t},a))}function p(e){var t=(0,n._)({},(0,r._)(e));return(0,s.jsx)(c.bL,(0,i._)({"data-slot":"tooltip"},t))}function h(e){var t=(0,n._)({},(0,r._)(e));return(0,s.jsx)(c.l9,(0,i._)({"data-slot":"tooltip-trigger"},t))}function g(e){var{className:t,sideOffset:a=0,children:n}=e,r=(0,l._)(e,["className","sideOffset","children"]);return(0,s.jsx)(c.ZL,{children:(0,s.jsxs)(c.UC,(0,o._)((0,i._)({"data-slot":"tooltip-content",sideOffset:a,className:(0,u.cn)("z-9999 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-xl bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-4xl data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t)},r),{children:[n,(0,s.jsx)(c.i3,{className:"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=left]:translate-x-[-1.5px] data-[side=right]:translate-x-[1.5px]"})]}))})}},58933:(e,t,a)=>{a.d(t,{T:()=>o,s:()=>i});var n=a(91772),r=a(23727);function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,t=window.opener;return t?new Promise(a=>{let n=!1,r=e=>{n||(n=!0,window.removeEventListener("message",i),clearTimeout(o),a(e))},i=e=>{if(e.origin!==window.location.origin||e.source!==t)return;let a=e.data;(null==a?void 0:a.type)==="VILLAGE_GRANT_SESSION"&&r("string"==typeof a.token&&a.token?a.token:null)};window.addEventListener("message",i);let o=setTimeout(()=>r(null),e);t.postMessage({type:"VILLAGE_GRANT_READY"},window.location.origin)}):Promise.resolve(null)}function o(e){let{purpose:t,loginHint:a}=e,i=window.open(function(e,t){let a=void 0!==r&&"https://village.ai"||window.location.origin,n=new URLSearchParams({purpose:e});return n.append("parent_origin",encodeURIComponent(window.location.origin)),t&&n.append("login_hint",t),"".concat(a,"/widget/grant?").concat(n.toString())}(t,a),"village-grant","popup=true,width=500,height=600");return i?new Promise(e=>{let t=!1,a=a=>{t||(t=!0,window.removeEventListener("message",r),clearInterval(o),e(a))},r=e=>{var t,r;if(e.origin!==window.location.origin||e.source!==i)return;let o=e.data;if((null==o?void 0:o.type)==="VILLAGE_GRANT_READY"){let e={type:"VILLAGE_GRANT_SESSION",token:null!=(r=(0,n.c)())?r:null};i.postMessage(e,window.location.origin)}else(null==o?void 0:o.type)==="VILLAGE_GRANT_SUCCESS"?a({kind:"granted"}):(null==o?void 0:o.type)==="VILLAGE_GRANT_ERROR"&&a({kind:"error",status:null!=(t=o.status)?t:null})};window.addEventListener("message",r);let o=setInterval(()=>{i.closed&&a({kind:"error",status:null})},800)}):Promise.resolve({kind:"blocked"})}},63371:(e,t,a)=>{a.d(t,{JV:()=>d,U1:()=>p,xw:()=>h});var n=a(9055),r=a(5281),i=a(9847);let o="unknown",l=!1,s=new Set;function u(e){o!==e&&(o=e,s.forEach(e=>e()))}function c(){!l&&(0,n.BH)()&&(l=!0,i.default.get("/api/auth/ok",{timeout:4e3}).then(()=>u("ok")).catch(e=>{var t;let a=null==e||null==(t=e.response)?void 0:t.status;u("down"),r.logger.error("better auth backend dark â falling back to legacy login",{scope:"better-auth-login",status:null!=a?a:null})}))}function d(){return c(),"down"===o}function p(){l=!0,u("down")}function h(e){return c(),s.add(e),()=>s.delete(e)}},67299:(e,t,a)=>{a.d(t,{O0:()=>r,rh:()=>i});var n=a(11850);let r=(0,n.eU)("loading"),i=(0,n.eU)(null);(0,n.eU)(e=>"loaded"===e(r)&&null!==e(i))},79770:(e,t,a)=>{a.d(t,{Z:()=>n});let n={all:["integrations"],initial:()=>["integration","initial"],syncRuns:()=>[...n.all,"sync-runs"],syncRunsForIntegration:e=>[...n.syncRuns(),e]}},84399:(e,t,a)=>{a.d(t,{EA:()=>g,xb:()=>y,pe:()=>f,Ib:()=>w,f1:()=>p,UN:()=>d,y:()=>v});var n=a(9055),r=a(447),i=a(5281),o=a(9847),l=a(13966),s=a(63371);let u=new Set(["/","/login","/signup","/register","/auth/callback","/auth/error"]);function c(e,t){if(!e||"string"!=typeof e||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\"))return null;try{let a=new URL(e,t);if(a.origin!==t)return null;return"".concat(a.pathname).concat(a.search).concat(a.hash)}catch(e){return null}}function d(e,t){let a=new URLSearchParams(e||""),n=a.get("ticket"),r="1"===a.get("new_user"),i=a.get("redirect"),o=a,l=i;if(i)try{let e=new URL(i,t);e.origin===t&&"/auth/callback"===e.pathname&&(o=e.searchParams,l=e.searchParams.get("redirect"))}catch(e){}return{ticket:n,isNewUser:r,redirectPath:l,planId:o.get("plan"),billingCadence:o.get("cadence"),inviteCode:o.get("invite")}}function p(e,t,a){return e.ticket&&t?{kind:"authenticated",token:t,destination:function(e,t){if(e.inviteCode){let a=c(e.redirectPath,t);return a&&a.startsWith("/join/")?a:"/join/".concat(encodeURIComponent(e.inviteCode))}let a=c(e.redirectPath,t);if(a){let e=a.split(/[?#]/)[0];if(!u.has(e))return a}return"/network"}(e,a)}:{kind:"expired"}}let h="/api/auth/partner/bridge";async function g(e){await o.default.post(h,{ticket:e})}async function f(e){await o.default.post(h,{},e?{headers:{"x-access-token":e}}:void 0)}function w(){return(0,n.BH)()&&!(0,s.JV)()}async function v(e){if((0,r.H)()||l.A.isOAuthRequired())return l.A.initOAuth({userReference:function(){try{var e;return null!=(e=localStorage.getItem("approximateUserIdentity"))?e:void 0}catch(e){return}}(),loginState:{planId:e.planId,billingCadence:e.billingCadence}}),"popup";let t={provider:"google",callbackURL:function(e,t){var a;let n=new URL("/auth/callback",t),r=c(null!=(a=e.redirectTo)?a:null,t);return r&&n.searchParams.set("redirect",r),e.planId&&n.searchParams.set("plan",String(e.planId)),e.billingCadence&&n.searchParams.set("cadence",String(e.billingCadence)),e.invite
1Code&&n.searchParams.set("invite",String(e.inviteCode)),n.toString()}(e,window.location.origin)};e.loginHint&&(t.loginHint=e.loginHint);let{data:a}=await o.default.post("/api/auth/sign-in/social",t),n=null==a?void 0:a.url;if(!n||"string"!=typeof n)throw Error("sign-in/social did not return an authorization url");return window.location.href=n,"redirect"}async function y(e){try{let{data:t}=await o.default.post("/auth/ticket/claim",{ticket:e});return"string"==typeof(null==t?void 0:t.token)?t.token:null}catch(a){var t;let e=null==a||null==(t=a.response)?void 0:t.status;return 404!==e&&i.logger.error("better auth ticket claim failed",{scope:"better-auth-login",status:null!=e?e:null}),null}}},91772:(e,t,a)=>{a.d(t,{O:()=>i,c:()=>o});var n=a(20674),r=a(9847);function i(e){let t="https:"===window.location.protocol;n.A.set("village.token",e,{secure:t,sameSite:"Lax",path:"/",expires:60}),r.default.defaults.headers["x-access-token"]=e}function o(){var e,t;let a=n.A.get("village.token");if(a)return a;let i=r.default.defaults.headers,o=null!=(t=null==i?void 0:i["x-access-token"])?t:null==i||null==(e=i.common)?void 0:e["x-access-token"];return"string"==typeof o&&o?o:void 0}},92491:(e,t,a)=>{a.d(t,{S:()=>r,c:()=>n});let n=e=>{if(!window.opener)return void alert("Sorry, something went wrong. Please restart and try again.");window.opener.postMessage(e,"*")},r=e=>{if(!window.parent)return void alert("Sorry, something went wrong. Please restart and try again.");window.parent.postMessage(e,"*")}},94994:(e,t,a)=>{a.d(t,{BP:()=>i,GQ:()=>o,KX:()=>c,Nk:()=>h,Ot:()=>u,Qd:()=>s,SB:()=>n,YO:()=>d,lj:()=>l,nI:()=>p,ov:()=>r});let n={NETWORK_PREFERENCES:3e5,USER_PROFILE:6e5,SEARCH_RESULTS:12e4},r=6048e5,i=3e5,o=6048e5,l="3",s="village-query-cache",u="village-query-cache",c=2592e6,d="unified-search",p="listMembership",h=["plans","billing","teamBilling","pendingMembers","credits","team-credits","seatCatalog","availableSeatPlans","userPaymentMethods"]},98677:(e,t,a)=>{a.d(t,{EZ:()=>f,Lv:()=>v,SW:()=>w,tr:()=>d,v6:()=>g,yN:()=>h});var n=a(9847),r=a(79770),i=a(447),o=a(13966),l=a(84399),s=a(58933);let u="granted",c={sync:["openid","profile","email","https://www.googleapis.com/auth/calendar.readonly","https://www.googleapis.com/auth/contacts.readonly","https://www.googleapis.com/auth/contacts.other.readonly","https://www.googleapis.com/auth/calendar.events.readonly"],gmail:["openid","profile","email","https://www.googleapis.com/auth/gmail.send","https://www.googleapis.com/auth/gmail.readonly"],gmail_send:["openid","profile","email","https://www.googleapis.com/auth/gmail.send"]};async function d(e){var t;let a={provider:"google",scopes:c[e.purpose],additionalParams:{access_type:"offline",prompt:"consent",include_granted_scopes:"true"},callbackURL:null!=(t=e.returnTo)?t:function(){let e=new URL(window.location.href);return e.searchParams.set(u,"1"),e.toString()}()};e.loginHint&&(a.loginHint=e.loginHint);let{data:r}=await n.default.post("/api/auth/link-social",a),i=null==r?void 0:r.url;if(!i||"string"!=typeof i)throw Error("link-social did not return an authorization url");window.location.href=i}let p=!1;async function h(e){let{purpose:t,loginHint:a,openLegacyPopup:n,onPlanGated:r,onGranted:u}=e;if(!(0,l.Ib)())return n();if((0,i.H)()){if(p)return n();let e=await (0,s.T)({purpose:t,loginHint:a});return"granted"===e.kind?(p=!1,u()):"error"===e.kind&&403===e.status&&r?r():(p=!0,n())}if(o.A.isOAuthRequired())return n();try{await d({purpose:t,loginHint:a})}catch(t){let e=g(t);if(401===e||404===e)return n();if(403===e&&r)return r();throw t}}function g(e){var t;let a=null==e||null==(t=e.response)?void 0:t.status;return"number"==typeof a?a:null}function f(e){var t,a;let n=null==e||null==(a=e.response)||null==(t=a.data)?void 0:t.message;return"string"==typeof n&&n?n:null}function w(e){let t;try{t=new URL(window.location.href)}catch(e){return}"1"===t.searchParams.get(u)&&(t.searchParams.delete(u),window.history.replaceState(window.history.state,"",t.toString()),v(e))}function v(e){e.invalidateQueries({queryKey:r.Z.initial()}),e.invalidateQueries({queryKey:["network-status"]}
1),e.invalidateQueries({queryKey:["mailbox-settings"]})}}}]);
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.