1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8032],{59010:function(e,t,a){a.d(t,{a:function(){return l}});var n=a(46413);let l=()=>{var e;let t=(0,n.Eu)();return{user:t.user,userEmail:null===(e=t.user)||void 0===e?void 0:e.email,isLoggedIn:t.isLoggedIn,userId:t.userId,getToken:t.getToken,status:t.status,loading:t.userLoading,signOut:t.signOut,memberData:t.memberData,role:t.role}}},76809:function(e,t,a){a.d(t,{$:function(){return d},P:function(){return c}});var n=a(57437),l=a(2265),i=a(59658),o=a(39004),r=a(48522),s=a(46413);let u=null;function c(e){let{children:t}=e,a=(0,r.S)(),[c,d]=(0,l.useState)(null),[_,h]=(0,l.useState)(null),[g,p]=(0,l.useState)((0,o.bW)()),[f,k]=(0,l.useState)(null),[m,w]=(0,l.useState)(!0),[b,v]=(0,l.useState)(null),[y,S]=(0,l.useState)(null),I=(0,l.useRef)(null),j=(0,l.useCallback)(async e=>{try{var t,n;S(null);let l=a.api_urls.pagos_base_url,i=a.auth_config.user_endpoint||"/api/v1/keycloak/user",r="https://api.beta.architect.new",s={Authorization:"Bearer ".concat(e)},[u,c,_]=await Promise.allSettled([fetch("".concat(l).concat(i),{headers:s}),fetch("".concat(l,"/api/v1/organizations/current"),{headers:s}),r?fetch("".concat(r,"/api/v1/tenant/me"),{headers:s}):Promise.resolve(null)]),g="fulfilled"===_.status?_.value:null;if(g&&(401===g.status||403===g.status)){let e="Please connect with admin to get invited";try{let t=await g.json();(null==t?void 0:t.detail)&&(e=t.detail)}catch(e){}S(e),(0,o.Rn)(),d(null),h(null),p(null);return}if("fulfilled"===u.status&&u.value.ok){let a=await u.value.json(),n=a.data||a,l=n.id||n.sub||n.user_id,i=(null===(t=n.auth)||void 0===t?void 0:t.email)||n.email;if(!n.name){let t=function(e){try{let t=JSON.parse(atob(e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")));return t.name||[t.given_name,t.family_name].filter(Boolean).join(" ")||null}catch(e){return null}}(e);t&&(n.name=t)}d({id:l,email:i}),h(n)}else"rejected"===u.status&&console.error("[KeycloakAuth] Failed to fetch PAGOS user data:",u.reason);if("fulfilled"===c.status&&c.value.ok){let e=await c.value.json();k((null==e?void 0:null===(n=e.policy)||void 0===n?void 0:n.role)||null)}else"rejected"===c.status&&console.error("[KeycloakAuth] Failed to fetch organization role:",c.reason)}catch(e){console.error("[KeycloakAuth] Failed to fetch user data:",e)}},[a.api_urls.pagos_base_url,a.auth_config.user_endpoint]);(0,l.useEffect)(()=>{if(u){v(u);return}let{keycloak_url:e,keycloak_realm:t,keycloak_client_id:n}=a.auth_config;if(!e||!t||!n){console.error("[KeycloakAuth] Missing Keycloak config"),w(!1);return}let l=new i.Z({url:e,realm:t,clientId:n});l.onTokenExpired=()=>{l.updateToken(30).then(e=>{e&&l.token&&(p(l.token),(0,o.uB)(l.token,3600))}).catch(()=>{console.warn("[KeycloakAuth] Token refresh failed, redirecting to login"),(0,o.Rn)(),d(null),l.login({idpHint:a.auth_config.idp_hint||void 0,redirectUri:window.location.origin+"/"})})};let r={checkLoginIframe:!1,..."/login"===window.location.pathname?{}:{onLoad:"check-sso",silentCheckSsoRedirectUri:window.location.origin+"/silent-check-sso.html",silentCheckSsoFallback:!1,redirectUri:window.location.origin+"/"}};return l.init(r).then(async e=>{if(u=l,v(l),window.location.hash&&window.history.replaceState(null,"",window.location.pathname+window.location.search),e&&l.token)p(l.token),(0,o.uB)(l.token,3600),await j(l.token),I.current=setInterval(()=>{l.updateToken(90).then(e=>{e&&l.token&&(p(l.token),(0,o.uB)(l.token,3600))}).catch(()=>{console.warn("[KeycloakAuth] Proactive refresh failed")})},21e4);else{let e=(0,o.bW)();e&&(p(e),await j(e))}w(!1)}).catch(e=>{console.error("[KeycloakAuth] Init failed:",e);let t=(0,o.bW)();t&&(p(t),j(t)),w(!1)}),()=>{I.current&&clearInterval(I.current)}},[a.auth_config.keycloak_url,a.auth_config.keycloak_realm,a.auth_config.keycloak_client_id,j]);let x=(0,l.useCallback)(async()=>{I.current&&clearInterval(I.current),(0,o.Rn)(),d(null),p(null),h(null),u=null,null==b||b.logout({redirectUri:window.location.origin+"/"})},[b]),C=(0,l.useCallback)(()=>(null==b?void 0:b.token)?b.token:(0,o.bW)()||"",[b]);return(0,n.jsx)(s.Vo.Provider,{value:{token:g,isAuthenticated:!!c,isLoading:m,user:c,userLoading:m,memberData:_,isLoggedIn:!!c,userId:null==c?void 0:c.id,getToken:C,status:m?"loading":c?"authenticated":"unauthenticated",signOut:x,role:f,loginBlocked:y,sessionExpired:!1},children:t})}function d(){let e=(0,r.S)();return{login:(0,l.useCallback)(t=>{u?u.login({idpHint:t||e.auth_config.idp_hint||void 0,redirectUri:window.location.origin+"/"}):window.location.href="/login"},[e.auth_config.idp_hint])}}},48522:function(e,t,a){a.d(t,{S:function(){return r},TenantProvider:function(){return s}});var n=a(57437),l=a(2265);let i={tenant_id:"default",display_name:"Architect",auth_provider:"memberstack",auth_config:{},features:{marketplace:!0,marketplace_clone:!0,billing:!0,public_signup:!0,support_chat:!0,analytics_tracking:!0,referral_program:!0,new_studio:!1,blank_projects_enabled:!1},branding:{app_name:"Architect"},api_urls:{agent_base_url:"https://agent-prod.studio.lyzr.ai",rag_base_url:"https://rag-prod.studio.lyzr.ai",pagos_base_url:"https://pagos-prod.studio.lyzr.ai",crawler_base_url:"https://crawler-prod.studio.lyzr.ai",asset_service_url:"https://asset.lyzr.app",studio_base_url:"https://studio.lyzr.ai",metrics_ws_url:"wss://metrics.studio.lyzr.ai"},credits_divisor:1},o=(0,l.createContext)(i),r=()=>(0,l.useContext)(o);function s(e){let{children:t}=e,[a,r]=(0,l.useState)(null);return((0,l.useEffect)(()=>{let e=window.location.hostname,t="tenant_config_"+e;try{let e=localStorage.getItem(t);if(e){let t=JSON.parse(e);Date.now()-t.timestamp<3e5&&r(t.config)}}catch(e){}fetch("".concat("https://api.beta.architect.new","/api/v1/tenant/config?domain=").concat(e)).then(e=>{if(!e.ok)throw Error("HTTP ".concat(e.status));return e.json()}).then(e=>{r(e),localStorage.setItem("tenant_agent_base_url",e.api_urls.agent_base_url),localStorage.setItem("tenant_pagos_base_url",e.api_urls.pagos_base_url),localStorage.setItem("tenant_rag_base_url",e.api_urls.rag_base_url),localStorage.setItem("tenant_crawler_base_url",e.api_urls.crawler_base_url),localStorage.setItem("tenant_studio_base_url",e.api_urls.studio_base_url||"https://studio.lyzr.ai"),localStorage.setItem("tenant_metrics_ws_url",e.api_urls.metrics_ws_url||"wss://metrics.studio.lyzr.ai"),document.cookie="tenant_urls=".concat(encodeURIComponent(JSON.stringify(e.api_urls)),";path=/;max-age=300;SameSite=Lax"),localStorage.setItem(t,JSON.stringify({config:e,timestamp:Date.now()}))}).catch(e=>{console.warn("[Tenant] Failed to fetch config, using default:",e),a||r(i)})},[]),a)?(0,n.jsx)(o.Provider,{value:a,children:t}):(0,n.jsxs)("div",{style:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,n.jsx)("div",{style:{width:24,height:24,border:"2px s
1olid #e5e7eb",borderTopColor:"#6b7280",borderRadius:"50%",animation:"spin 0.6s linear infinite"}}),(0,n.jsx)("style",{children:"@keyframes spin { to { transform: rotate(360deg) } }"})]})}}}]);
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.