1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9549,5704],{26110:function(e,t,r){r.d(t,{$N:function(){return y},Be:function(){return b},Vq:function(){return c},cN:function(){return h},cZ:function(){return p},fK:function(){return f},hg:function(){return l}});var n=r(57437),a=r(2265),o=r(49027),i=r(20653),s=r(94508);let c=o.fC,l=o.xz,u=o.h_;o.x8;let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(o.aV,{ref:t,className:(0,s.cn)("fixed inset-0 z-[200] bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a})});d.displayName=o.aV.displayName;let p=a.forwardRef((e,t)=>{let{className:r,children:a,...c}=e;return(0,n.jsxs)(u,{children:[(0,n.jsx)(d,{}),(0,n.jsxs)(o.VY,{ref:t,className:(0,s.cn)("h-full md:h-auto fixed left-[50%] top-[50%] z-[200] grid content-start overflow-y-auto w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",r),...c,children:[a,(0,n.jsxs)(o.x8,{className:"absolute right-4 top-4 z-20 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,n.jsx)(i.Pxu,{className:"h-4 w-4"}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});p.displayName=o.VY.displayName;let f=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,s.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...r})};f.displayName="DialogHeader";let h=e=>{let{className:t,...r}=e;return(0,n.jsx)("div",{className:(0,s.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};h.displayName="DialogFooter";let y=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(o.Dx,{ref:t,className:(0,s.cn)("text-lg font-semibold leading-none tracking-tight",r),...a})});y.displayName=o.Dx.displayName;let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(o.dk,{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",r),...a})});b.displayName=o.dk.displayName},95186:function(e,t,r){r.d(t,{I:function(){return i}});var n=r(57437),a=r(2265),o=r(94508);let i=a.forwardRef((e,t)=>{let{className:r,type:a,...i}=e;return(0,n.jsx)("input",{type:a,className:(0,o.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...i})});i.displayName="Input"},97855:function(e,t,r){r.d(t,{CT:function(){return a},QW:function(){return u},R1:function(){return i},SC:function(){return o},apiPut:function(){return l},nc:function(){return c},sg:function(){return s}});var n=r(65993);let a="https://api.beta.architect.new";async function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{token:r,headers:o,...i}=t,s={"Content-Type":"application/json",Accept:"application/json"};o&&"object"==typeof o&&!Array.isArray(o)&&Object.assign(s,o),r&&(s.Authorization="Bearer ".concat(r));let c=e.startsWith("http")?e:"".concat(a).concat(e),l=await fetch(c,{...i,headers:s,credentials:"include"});if(!l.ok)throw await (0,n.Wl)(l);let u=l.headers.get("content-type");return u&&u.includes("application/json")?l.json():{}}async function i(e,t){return o(e,{method:"GET",token:t})}async function s(e,t,r){return o(e,{method:"POST",body:t?JSON.stringify(t):void 0,token:r})}async function c(e,t,r){return o(e,{method:"PATCH",body:JSON.stringify(t),token:r})}async function l(e,t,r){return o(e,{method:"PUT",body:JSON.stringify(t),token:r})}async function u(e,t){return o(e,{method:"DELETE",token:t})}},51082:function(e,t,r){function n(){{let e=localStorage.getItem("tenant_pagos_base_url");
1if(e)return"".concat(e,"/api/v1")}return"https://pagos-prod.studio.lyzr.ai/api/v1"}async function a(e){try{var t;let r=await fetch("".concat(n(),"/organizations/current"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!r.ok)return console.error("Failed to fetch organization:",r.status),null;let a=await r.json();return{...a.current_organization,policyId:(null===(t=a.policy)||void 0===t?void 0:t._id)||""}}catch(e){return console.error("Error fetching organization:",e),null}}async function o(e){let{token:t,organization_id:r}=e;try{let e=await fetch("".concat(n(),"/keys/by_organization?organization_id=").concat(r),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(t)}});if(!e.ok){if(422===e.status)return console.error("Validation error fetching API keys"),[];throw Error("Failed to fetch API keys: ".concat(e.status))}let a=await e.json();return Array.isArray(a)?a:[]}catch(e){throw console.error("Error fetching API keys:",e),e}}async function i(e){try{let t=await fetch("".concat(n(),"/keys/"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!t.ok)throw Error("Failed to fetch current user key: ".concat(t.status));let r=await t.json();return Array.isArray(r)?r:[]}catch(e){throw console.error("Error fetching current user key:",e),e}}r.d(t,{BN:function(){return a},Gz:function(){return s},Kg:function(){return d},RR:function(){return o},VA:function(){return u},YP:function(){return i},Yi:function(){return l},d3:function(){return h},e4:function(){return p},tX:function(){return f}});class s extends Error{constructor(e,t){super(t),this.name="OrgProvisionError",this.status=e}}let c=null;function l(e){return c||(c=y(e).finally(()=>{c=null}))}async function u(e){try{let t=await fetch("".concat(n(),"/organizations/all"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!t.ok)return console.error("Failed to fetch all organizations:",t.status),null;return await t.json()}catch(e){return console.error("Error fetching all organizations:",e),null}}async function d(e,t){let r=await fetch("".concat(n(),"/organizations/current?organization_id=").concat(t),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!r.ok){let e=await r.text();throw Error("Failed to set current organization: ".concat(r.status," ").concat(e))}}async function p(e,t){try{let r=await fetch("".concat(n(),"/organizations/").concat(t,"/members"),{method:"GET",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e)}});if(!r.ok)return console.error("Failed to fetch organization members:",r.status),[];let a=await r.json();return Array.isArray(a)?a:[]}catch(e){return console.error("Error fetching organization members:",e),[]}}async function f(e,t,r){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"member";try{let o=await fetch("".concat(n(),"/organizations/").concat(t,"/add_user_sso"),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},body:JSON.stringify({user_email:r,role:a})});if(!o.ok){let e=await o.text();if(console.error("Failed to invite user:",o.status,e),e.includes("seat")||e.includes("full"))return{success:!1,error:"Organization has reached its seat limit"};if(e.includes("already exists")||e.includes("already a member"))return{success:!1,alreadyExists:!0};if(e.includes("plan")||e.includes("upgrade"))return{success:!1,error:"Plan upgrade required to add more members"};return{success:!1,error:"Failed to invite user: ".concat(e)}}let i=await o.json().catch(()=>({}));if(null==i?void 0:i.already_exists)return{success:!0,alreadyExists:!0};return{success:!0}}catch(e){return console.error("Error inviting user:",e),{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}async function h(e,t){try{let r="".concat(n(),"/rbac/roles?org_id=").concat(encodeURIComponent(e),"&system_roles=true"),a={"Content-Type":"application/json"};t&&(a.Authorization="Bearer ".concat(t));let o=await fetch(r,{method:"GET",headers:a});if(!o.ok)return console.error("Failed to get RBAC roles:",o.status),[];let i=await o.json();return Array.isArray(i)?i:[]}catch(e){return console.error("Error getting RBAC roles:",e),[]}}async function y(e){let{token:t,name:r,domain:a,industry:o,about_company:i,event_id:c}=e;try{let e=new URLSearchParams;e.set("name",r),a&&e.set("domain",a),o&&e.set("industry",o),i&&e.set("about_company",i),c&&e.set("event_id",c);let l=await fetch("".concat(n(),"/organizations/?").concat(e.toString()),{method:"POST",headers:{Accept:"application/json",Authorization:"Bearer ".concat(t)}});if(!l.ok){let e=await l.text();throw console.error("Failed to create organization:",l.status,e),new s(l.status,function(e,t){let r=(()=>{try{var e,r;return String(null!==(r=null===(e=JSON.parse(t))||void 0===e?void 0:e.detail)&&void 0!==r?r:"")}catch(e){return""}})();return 400===e&&r.toLowerCase().includes("device verification")?"We could not verify this device. Disable your ad blocker or privacy shields for this site and reload.":r||(e>=500?"Our account service is temporarily unavailable. Please try again in a few minutes.":"We could not set up your workspace (error ".concat(e,"). Please contact support."))}(l.status,e))}return await l.json()}catch(e){if(e instanceof s)throw e;throw console.error("Error creating organization:",e),new s(0,"We could not reach our account service. Check your connection and reload.")}}},59010:function(e,t,r){r.d(t,{a:function(){return a}});var n=r(46413);let a=()=>{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}}},65993:function(e,t,r){r.d(t,{AR:function(){return L},Fp:function(){return K},GX:function(){return g},M6:function(){return p},ME:function(){return j},O3:function(){return u},UH:function(){return d},VF:function(){return I},Wl:function(){return f},fs:function(){return k},ho:function(){return N},id:function(){return z},kU:function(){return y},pf:function(){return h},pm:function(){return s},uT:function(){return S},un:function(){return c}});let n=/(?:authorization|api[_-]?key|token|secret|password|credential|cookie|connection[_-]?(?:string|url)|database[_-]?url)/i,a=/(?:bearer\s+[a-z0-9._~+/=-]+|(?:postgres(?:ql)?|mysql|mongodb(?:\+srv)?|redis):\/\/[^\s]+)/i;function o(e){return"string"==typeof e&&e.trim()?e.trim():void 0}function i(e){return"number"==typeof e&&Number.isInteger(e)?e:void 0}function s(e){if(!(!e||"object"!=typeof e||Array.isArray(e)))return function e(t,r,o){if(null==t||"boolean"==typeof t||"number"==typeof t)return t;if("string"==typeof t)return a.test(t)?"[redacted]":t.slice(0,1024);if(r>=4||"object"!=typeof t||o.has(t))return;if(o.add(t),Array.isArray(t))return t.slice(0,50).map(t=>e(t,r+1,o)).filter(e=>void 0!==e);let i={};for(let[a,s]of Object.entries(t).slice(0,50)){if(n.test(a)){i[a]="[redacted]";
1continue}let t=e(s,r+1,o);void 0!==t&&(i[a]=t)}return i}(e,0,new WeakSet)}class c extends Error{constructor(e){var t,r;super((null===(t=e.message)||void 0===t?void 0:t.trim())||"The operation failed.",{cause:e.cause}),this.name="OperationError",this.errorCode=(null===(r=e.errorCode)||void 0===r?void 0:r.trim())||"UNKNOWN_ERROR",this.retryable=!0===e.retryable,this.requestId=o(e.requestId),this.status=i(e.status),this.details=s(e.details)}}function l(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:void 0}function u(e){var t,r,n,a,s,u,d,p,f,h,y,b,g,m,v,_,w,x,T,k,E,C,R;let A=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof c)return e;let j=l(e),z=null==j?void 0:j.detail,I=l(z),L=null!=I?I:j,O=l(null!==(n=null!==(r=null!==(t=null==L?void 0:L.details)&&void 0!==t?t:null==L?void 0:L.error_details)&&void 0!==r?r:null==j?void 0:j.details)&&void 0!==n?n:null==j?void 0:j.error_details),N=null!==(s=null!==(a=i(null==O?void 0:O.harness_status))&&void 0!==a?a:i(null==L?void 0:L.harness_status))&&void 0!==s?s:i(null==j?void 0:j.harness_status),S=null!==(f=null!==(p=null!==(d=null!==(u=i(null==L?void 0:L.status))&&void 0!==u?u:i(null==L?void 0:L.status_code))&&void 0!==d?d:i(null==j?void 0:j.status))&&void 0!==p?p:N)&&void 0!==f?f:A.status,q=null!==(h=o(null==L?void 0:L.cause))&&void 0!==h?h:o(null==j?void 0:j.cause),K=null!==(w=null!==(_=null!==(v=null!==(m=null!==(g=null!==(b=null!==(y=o(null==L?void 0:L.message))&&void 0!==y?y:o(null==L?void 0:L.error))&&void 0!==b?b:o(z))&&void 0!==g?g:o(null==j?void 0:j.message))&&void 0!==m?m:q)&&void 0!==v?v:o(e))&&void 0!==_?_:A.fallbackMessage)&&void 0!==w?w:A.statusText?"Request failed: ".concat(A.statusText):"The operation failed.",P=null!==(k=null!==(T=null!==(x=o(null==L?void 0:L.error_code))&&void 0!==x?x:o(null==L?void 0:L.errorCode))&&void 0!==T?T:o(null==j?void 0:j.error_code))&&void 0!==k?k:function(e){switch(e){case 400:return"VALIDATION_ERROR";case 401:return"UNAUTHORIZED";case 403:return"FORBIDDEN";case 404:return"NOT_FOUND";case 408:case 504:return"TIMEOUT";case 503:return"SERVICE_UNAVAILABLE";default:return"UNKNOWN_ERROR"}}(S),D=409===N||409===S&&["engine_error","harness_busy","resource_busy"].includes(P.toLowerCase()),B=D?"resource_busy":P,W=null!==(R=null!==(C=null!==(E=o(null==L?void 0:L.request_id))&&void 0!==E?E:o(null==L?void 0:L.requestId))&&void 0!==C?C:o(null==j?void 0:j.request_id))&&void 0!==R?R:A.requestId,F="boolean"==typeof(null==L?void 0:L.retryable)?L.retryable:"boolean"==typeof(null==j?void 0:j.retryable)&&j.retryable,U={...null!=O?O:{},...D&&P!==B?{upstream_error_code:P}:{},...o(null==L?void 0:L.scope)?{scope:o(null==L?void 0:L.scope)}:{}};return new c({errorCode:B,message:K,retryable:F,requestId:W,status:S,details:U,cause:null!=q?q:A.cause})}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof c)return e;if("undefined"!=typeof DOMException&&e instanceof DOMException&&"AbortError"===e.name)return new c({errorCode:"CLIENT_ABORTED",message:"The request was cancelled before it completed.",retryable:!1,...t,cause:e});if(e instanceof Error){var r;return new c({errorCode:t.errorCode||"NETWORK_ERROR",message:e.message||t.message||"The network request failed.",retryable:null===(r=t.retryable)||void 0===r||r,...t,cause:e})}return u(e,{fallbackMessage:t.message,requestId:t.requestId,status:t.status,cause:e})}function p(e,t){var r,n,a,o,i,s,l;let u=d(e);return new c({errorCode:t.errorCode,message:null!==(r=t.message)&&void 0!==r?r:u.message,retryable:null!==(n=t.retryable)&&void 0!==n?n:u.retryable,requestId:null!==(a=t.requestId)&&void 0!==a?a:u.requestId,status:null!==(o=t.status)&&void 0!==o?o:u.status,details:{...null!==(i=u.details)&&void 0!==i?i:{},...null!==(s=t.details)&&void 0!==s?s:{}},cause:null!==(l=t.cause)&&void 0!==l?l:u})}async function f(e,t){let r;let n=e.clone();try{r=await e.json()}catch(e){try{r=await n.text()}catch(e){r=void 0}}return u(r,{status:e.status,statusText:e.statusText,requestId:t})}async function h(e){let t=e.clone();try{return await e.json()}catch(e){throw await f(t)}}async function y(e){try{return await e.json()}catch(e){return null}}let b={initialize_sandbox:"Sandbox initialization",create_app:"App creation",chat:"Build request",generate_plan:"Plan generation",save_agent:"Agent save",delete_knowledge_base:"Knowledge-base deletion",upload_knowledge_base:"Knowledge-base upload",ingest_knowledge_base:"Knowledge-base ingestion",crawl_website:"Website import",request:"Request"},g="The previous build is still finishing. Wait a moment, then retry; your attachments are still attached.";function m(e){return"number"==typeof e&&Number.isInteger(e)&&e>=0?e:void 0}function v(e){return e<6e4?"about ".concat(Math.round(e/1e3)," seconds"):"about ".concat(Math.round(e/6e4)," minutes")}function _(e,t){return e.retryable?t:"This failure is not marked retryable right now."}function w(e){return["The AI provider was temporarily overloaded or rate-limited.","Your build stopped partway, but your app and its code are unchanged and safe.",function(e){var t,r;let n=m(null===(t=e.details)||void 0===t?void 0:t.attempts),a=m(null===(r=e.details)||void 0===r?void 0:r.elapsed_ms);return void 0!==n&&void 0!==a?"We made ".concat(n," attempts over ").concat(v(a),"."):void 0!==n?"We made ".concat(n," attempts."):void 0!==a?"We spent ".concat(v(a)," retrying."):void 0}
1(e),_(e,"Retrying in about a minute usually works.")].filter(Boolean).join(" ")}function x(e){return["The connection to the AI provider failed while your build was in progress.","Your app and its code are unchanged and safe.",_(e,"Retry when youâre ready.")].join(" ")}function T(e){return["The AI provider is failing in a way that retrying will not fix right now.","Your app and its code are unchanged and safe.",e.retryable?"Wait for the provider to recover before retrying.":void 0].filter(Boolean).join(" ")}function k(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"request",n=d(e,{retryable:!1}),a=n.errorCode.toLowerCase(),o=e=>n.requestId?"".concat(e," Reference: ").concat(n.requestId,"."):e;if((null===(t=n.details)||void 0===t?void 0:t.scope)==="connection")return{headline:"The connection dropped. Your build is still running.",description:o("Reattach to continue watching it."),actionLabel:"Reattach"};switch(a){case"sandbox_not_found":return{headline:"This appâs sandbox no longer exists.",description:o("The app record is preserved. Contact support before restoring it."),actionLabel:"Contact support"};case"sandbox_unreachable":return{headline:"We couldnât reach your app sandbox.",description:o("Retry the sandbox connection."),actionLabel:"Retry"};case"sandbox_probe_timeout":return{headline:"Your app sandbox did not respond in time.",description:o("Retry the sandbox connection."),actionLabel:"Retry"};case"health_unknown":return{headline:"We couldnât verify the sandbox state.",description:o("The sandbox has not been marked as gone. Retry the check."),actionLabel:"Retry"};case"sandbox_auth_failed":return{headline:"The platform could not authenticate to the app runtime.",description:o("Your session is still signed in. Retry the sandbox connection."),actionLabel:"Retry"};case"database_provision_pending":return{headline:"The app started, but database setup is still in progress.",description:o("Check the Database tab for its current state.")};case"database_connectivity_failed":return{headline:"The database was created, but the app runtime cannot reach it.",description:o("Open the Database tab to review the connection issue.")};case"unauthorized":case"invalid_token":case"missing_token":return{headline:"Your session is no longer authorized.",description:o("Sign in again, then retry the operation."),actionLabel:"Sign in"};case"forbidden":return{headline:"You donât have access to this operation.",description:o(n.message)};case"validation_error":case"invalid_message":case"missing_field":case"invalid_event":case"invalid_request":return{headline:"".concat(b[r]," needs different input."),description:o(n.message)};case"not_found":return{headline:"".concat(b[r]," could not find the requested resource."),description:o(n.message)};case"already_exists":return{headline:"That resource already exists.",description:o(n.message)};case"resource_busy":return{headline:"Another build is already running.",description:o(g),actionLabel:"Reattach"};case"client_timeout":return{headline:"".concat(b[r]," stopped waiting for a response."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"timeout":return{headline:"".concat(b[r]," timed out on the server."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"turn_deadline_exceeded":return{headline:"The build reached its time limit.",description:o("This run reached its time limit. Completed work was preserved. Resume to continue."),actionLabel:n.retryable?"Retry":void 0};case"service_unavailable":return{headline:"".concat(b[r]," is temporarily unavailable."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"internal_error":return{headline:"The service failed while handling ".concat(b[r].toLowerCase(),"."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"operation_failed":return{headline:"".concat(b[r]," did not complete."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"security_blocked":return{headline:"The request was blocked by the security policy.",description:o(n.message)};case"sandbox_unavailable":return{headline:"The sandbox is not available for this request.",description:o(n.message),actionLabel:"Retry"};case"sandbox_ended":return{headline:"The sandbox stopped.",description:o("Restart the sandbox to continue."),actionLabel:"Retry"};case"stream_transport_interrupted":case"harness_restarted":return{headline:"The connection dropped. Your build is still running.",description:o("Reattach to continue watching it."),actionLabel:"Reattach"};case"network_failure":return{headline:"The connection to the AI provider failed mid-build.",description:o(x(n)),actionLabel:n.retryable?"Retry":void 0};case"stream_interrupted":return{headline:"The model stream ended before the turn completed.",description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"rate_limited":return{headline:"The AI provider is temporarily rate-limiting this build.",description:o(w(n)),actionLabel:n.retryable?"Retry":void 0};case"context_overflow":return{headline:"This conversation is too large for the AI model.",description:o("Retrying this request as-is will not help. Start a new session or narrow the request. Your app and its code are unchanged and safe.")};case"authentication":return{headline:"The model credentials were rejected.",description:o("This is a downstream credential issue; your session remains signed in.")};case"canceled":case"client_aborted":return{headline:"The operation was cancelled.",description:o("Work completed before cancellation is kept.")};case"server_failure":return{headline:"The AI provider is temporarily overloaded.",description:o(w(n)),actionLabel:n.retryable?"Retry":void 0};case"provider_failure":return{headline:"The AI provider could not complete this build.",description:o(T(n)),actionLabel:n.retryable?"Retry":void 0};case"engine_error":return{headline:"The model execution engine failed during this turn.",description:o(n.message),actionLabel:n.retryable?"Retry":void 0};case"attempt_timeout":return{headline:"The AI provider connection timed out mid-build.",description:o(x(n)),actionLabel:n.retryable?"Retry":void 0};case"attempts_exhausted":return{headline:"The AI provider stopped responding after repeated attempts.",description:o(w(n)),actionLabel:n.retryable?"Retry":void 0};case"retry_delay_exceeded":return{headline:"The AI provider could not retry this build in time.",description:o(T(n)),actionLabel:n.retryable?"Retry":void 0};case"harness_result_error":return{headline:"The build could not finish.",description:o(["The build stopped before it completed.","Your app and its code are unchanged and safe.",_(n,"You can retry when youâre ready.")].join(" ")),actionLabel:n.retryable?"Retry":void 0};default:return{headline:"".concat(b[r]," failed."),description:o(n.message),actionLabel:n.retryable?"Retry":void 0}}}let E={rate_limited:!0,server_failure:!0,network_failure:!0,attempt_timeout:!0,stream_interrupted:!0,provider_failure:!0,attempts_exhausted:!0,retry_delay_exceeded:!0,harness_result_error:!0,engine_error:!0,timeout:!0,turn_deadline_exceeded:!0},C={context_overflow:!0,invalid_request:!0,validation_error:!0},R={sandbox_not_found:!0},A={upload_failed:!0,upload_error:!0,tool_error:!0,tool_failed:!0,tool_denied:!0,tool_rejected:!0,tool_missing:!0,tool_blocked:!0,build_error:!0,build_check:!0,console_error_check:!0,console_errors_found:!0,github_sync_
1indicator:!0,github_sync_failed:!0,subagent_run_indicator:!0,task_result_block:!0,database_create_failed:!0,database_failed:!0,database_create_unreadable:!0,app_restart_failed:!0};function j(e,t){var r;let n=d(e,{retryable:!1}),a=n.errorCode.toLowerCase(),o=function(e){var t;let r=null===(t=l(e))||void 0===t?void 0:t.event_type;return"string"==typeof r&&!0===A[r.toLowerCase()]}(e),i=!o&&function(e,t){let r=l(e);return"blocked"===(null==r?void 0:r.__status)||"security_blocked"===t||"tool_blocked"===t}(e,a),s=o?"diagnostic":i?"blocked":!0===C[a]||a.startsWith("document_")?"input":!0===E[a]?"recoverable":!0===R[a]?"support":"diagnostic",c=k(n,"chat"),u=!o&&!((null===(r=n.details)||void 0===r?void 0:r.scope)==="connection"||"stream_transport_interrupted"===n.errorCode.toLowerCase()||"harness_restarted"===n.errorCode.toLowerCase()),p=u&&t.isLive&&t.turnStopped&&t.composerUnlocked&&"support"!==s&&"diagnostic"!==s,f=c.headline;return"blocked"===s?f="One action was blocked":"input"===s&&(f="The request needs a smaller next step"),{visible:u,tone:"blocked"===s?"warning":p?"warning":"diagnostic"===s?"muted":"danger",icon:"blocked"===s?"blocked":"input"===s?"input":p?"warning":"danger",headline:f,description:function(e){let t=e.lastIndexOf(" Reference:");return -1===t?e:e.slice(0,t).trim()}(c.description),errorCode:n.errorCode,requestId:n.requestId,...p?{actionLabel:"Continue"}:{}}}function z(e){let t=d(e,{retryable:!1}).errorCode.toLowerCase();return"unauthorized"===t||"invalid_token"===t||"missing_token"===t}function I(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200;return!t||!e.has(t)&&(e.size>=r&&e.clear(),e.add(t),!0)}function L(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=d(e,{retryable:!1}),o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"resource_busy"===d(e,{retryable:!1}).errorCode.toLowerCase()?{action:"reattach_active_stream",retainQueuedInput:!t.isMachinePayload,presentError:!1}:{action:"present_error",retainQueuedInput:!1,presentError:!0}}(a,n);return"reattach_active_stream"===o.action?(o.retainQueuedInput&&r.queueInput(t,a.requestId),r.reattachActiveStream()):r.presentError(a),o}let O={database_created:!0,database_create_failed:!0,database_create_unreadable:!0,database_failed:!0};function N(e){return"string"==typeof e&&!0===O[e]}function S(e){let t=l(e),r=o(null==t?void 0:t.status);return t?"connection_failed"===r?{visible:!0,label:"Database issue",title:"The database exists, but the app cannot connect to it"}:"ready"===r?{visible:!0,label:"Database",title:"Browse database"}:{visible:!0,label:"Database setup",title:"Database setup is not complete"}:{visible:!1,label:"Database setup",title:"Database setup is not complete"}}let q=[250,750];async function K(e){let t,{maxAttempts:r=3,sleep:n=e=>{let{promise:t,resolve:r}=Promise.withResolvers();return setTimeout(r,e),t}}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=Math.max(1,Math.min(r,q.length+1));for(let r=0;r<a;r+=1)try{return await e()}catch(e){t=e,r+1<a&&await n(q[r])}throw t}},42097:function(e,t,r){var n=r(3011),a=r(89134);let o=(0,n.U)()((0,a.tJ)((e,t)=>({apiKey:"",apiKeys:[],apiKeyInitializationStatus:"initializing",organizationId:"",policyId:"",currentOrganization:null,allOrganizations:[],credits:0,creditsKnown:!1,creditsLoading:!1,showCreditsExhausted:!1,setApiKey:t=>e({apiKey:t}),setApiKeys:t=>e({apiKeys:t}),setApiKeyInitializationStatus:t=>e({apiKeyInitializationStatus:t}),setOrganizationId:t=>e({organizationId:t}),setPolicyId:t=>e({policyId:t}),setCurrentOrganization:t=>e({currentOrganization:t}),setAllOrganizations:t=>e({allOrganizations:t}),setCredits:t=>e({credits:t,creditsKnown:!0}),setCreditsLoading:t=>e({creditsLoading:t}),setShowCreditsExhausted:t=>e({showCreditsExhausted:t}),getApiKey:()=>t().apiKey,clearStore:()=>e({apiKey:"",apiKeys:[],apiKeyInitializationStatus:"initializing",organizationId:"",policyId:"",currentOrganization:null,allOrganizations:[],credits:0,creditsKnown:!1,creditsLoading:!1,showCreditsExhausted:!1})}),{name:"architect-store",partialize:e=>{let{apiKeyInitializationStatus:t,credits:r,creditsKnown:n,creditsLoading:a,...o}=e;return o}}));t.Z=o},95704:function(e,t,r){r.d(t,{ET:function(){return y},JM:function(){return g},Lj:function(){return u},PR:function(){return s},Zr:function(){return b},bQ:function(){return m},checkUserAccess:function(){return d},getOrCreateReferralCode:function(){return h},il:function(){return v},oU:function(){return p},r4:function(){return c},uO:function(){return f},updateUser:function(){return l}});var n=r(97855),a=r(39004);function o(e){var t;return null!==(t=null!=e?e:(0,a.bW)())&&void 0!==t?t:void 0}function i(e){let t=o(e);return t?{Authorization:"Bearer ".concat(t)}:{}}async function s(e,t){try{return await (0,n.R1)("/api/v1/users/".concat(e),o(t))}catch(e){if(404===e.status)return null;throw console.error("Error fetching user:",e),e}}async function c(e){try{return await (0,n.sg)("/api/v1/users",e)}catch(e){throw console.error("Error creating user:",e),e}}async function l(e,t,r){try{return await (0,n.nc)("/api/v1/users/".concat(e),t,o(r))}catch(e){throw console.error("Error updating user:",e),e}}async function u(e,t,r){try{let a=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/profile"),{method:"PATCH",headers:{"Content-Type":"application/json",...i(r)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.detail||"Failed to update profile: ".concat(a.statusText))}return await a.json()}catch(e){throw console.error("Error updating user profile:",e),e}}async function d(e,t,r){try{let a=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/access?email=").concat(encodeURIComponent(t)),{method:"GET",headers:{"Content-Type":"application/json",...i(r)}});if(!a.ok)throw Error("Failed to check user access: ".concat(a.statusText));return await a.json()}catch(e){throw console.error("Error checking user access:",e),e}}function p(e){let t=e.split("@")[1];if(!t||["gmail.com","yahoo.com","hotmail.com","outlook.com","icloud.com","proton.me","protonmail.com"].includes(t.toLowerCase()))return"";let r=t.split(".")[0];return r.charAt(0).toUpperCase()+r.slice(1)}function f(e){return e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")}async function h(e,t,r,a){try{let o=new URLSearchParams;t&&o.set("email",t),r&&o.set("name",r);let s=o.toString(),c="".concat(n.CT,"/api/v1/users/").concat(e,"/referral-code").concat(s?"?".concat(s):""),l=await fetch(c,{headers:i(a)});if(!l.ok)return null;return await l.json()}catch(e){return null}}async function y(e,t){try{let r=await fetch("".concat(n.CT,"/api/v1/users/feedback"),{method:"POST",headers:{"Content-Type":"application/json",...i(t)},body:JSON.stringify(e)});if(!r.ok){let e=await r.json();throw Error(e.detail||"Failed to submit feedback: ".concat(r.statusText))}return await r.json()}catch(e){throw console.error("Error submitting feedback:",e),e}}async function b(e,t){try{let r=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/preferences/exists"),{method:"GET",headers:{"Content-Type":"application/json",...i(t)}});if(!r.ok)return console.error("Error checking preferences exist:",r.statusText),!1;return(await r.json()).exists}catch(e){return console.error("Error checking user preferences exist:",e),!1}}async function g(e,t){try{let r=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/preferences"),{method:"GET",headers:{"Content-Type":"application/json",...i(t)}});if(404===r.status)return null;if(!r.ok)throw Error("Failed to get user preferences: ".concat(r.statusText));return await r.json()}catch(e){return console.error("Error fetching user preferences:",e),null}}async function m(e,t,r){try{let a=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/preferences"),{method:"POST",headers:{"Content-Type":"application/json",...i(r)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to create preferences: ".concat(a.statusText))}return await a.json()}catch(e){throw console.error("Error creating user preferences:",e),e}}async function v(e,t,r){try{let a=await fetch("".concat(n.CT,"/api/v1/users/").concat(e,"/preferences"),{method:"PATCH",headers:{"Content-Type":"application/json",...i(r)},body:JSON.stringify(t)});if(!a.ok){let e=await a.json();throw Error(e.detail||"Failed to update preferences: ".concat(a.statusText))}return await a.json()}catch(e){throw console.error("Error updating user preferences:",e),e}}}}]);
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.