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]="9d429962-3600-4870-bd9c-0931ae80f589",e._sentryDebugIdIdentifier="sentry-dbid-9d429962-3600-4870-bd9c-0931ae80f589")}catch(e){}{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:anthropic-apps":!0})}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18119],{0x1ee873af:(e,t,r)=>{r.d(t,{Q:()=>u,t:()=>l});var n=r(0x9845e38c),a=r(0x16ab3413b),i=r.n(a),o=r(0xfc89b4a4);function l(e){var t,r,a;let{key:l,defaultValue:u,deserialize:s=JSON.parse,getInitialValueInEffect:c=!1,sync:d=!0}=e,f="LSS-".concat(l),g=(0,o.useRef)(null!=(a=null==(t=(r=crypto).randomUUID)?void 0:t.call(r))?a:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))),y=(0,o.useRef)(!1),[p,v]=(0,o.useState)(()=>{if(c)return u;try{let e=window.localStorage.getItem(f);if(e){let t=JSON.parse(e);if(t&&"object"==typeof t&&"value"in t)return t.value;return s(e)}}catch(e){n.v.warn(n.u.LOCAL_STORAGE,"Error reading localStorage key “".concat(f,"”"),e)}return u});(0,o.useEffect)(()=>{if(c)try{let e=window.localStorage.getItem(f);if(e){let t=JSON.parse(e);t&&"object"==typeof t&&"value"in t?v(t.value):v(s(e))}}catch(e){n.v.warn(n.u.LOCAL_STORAGE,"Error reading localStorage key “".concat(f,"”"),e)}},[f,s,c]);let b=(0,o.useCallback)(e=>{y.current=!0,v(t=>{let r="function"==typeof e?e(t):e;try{let e={value:r,tabId:g.current,timestamp:Date.now()},t=JSON.stringify(e);if(window.localStorage.setItem(f,t),d){let e=new StorageEvent("storage",{key:f,newValue:t,oldValue:window.localStorage.getItem(f),storageArea:window.localStorage,url:window.location.href});setTimeout(()=>{window.dispatchEvent(e)},0)}}catch(e){n.v.warn(n.u.LOCAL_STORAGE,"Error writing localStorage key “".concat(f,"”"),e)}return r}),Promise.resolve().then(()=>{y.current=!1})},[f,d]),_=(0,o.useCallback)(()=>{window.localStorage.removeItem(f),v(u)},[f,u]);return(0,o.useEffect)(()=>{if(!d)return;let e=e=>{if(e.key===f&&e.newValue&&!y.current)try{let t=JSON.parse(e.newValue);if(t&&"object"==typeof t&&"value"in t&&"tabId"in t){if(t.tabId===g.current)return;v(e=>i()(e,t.value)?e:t.value)}else{let t=s(e.newValue);v(e=>i()(e,t)?e:t)}}catch(e){n.v.warn(n.u.LOCAL_STORAGE,"Error handling storage event for “".concat(f,"”"),e)}};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[f,d,s]),[p,b,_]}function u(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return l({key:e,defaultValue:t,deserialize:e=>void 0===e?t:JSON.parse(e),getInitialValueInEffect:!1,sync:r})}},0x495c605f:(e,t,r)=>{r.d(t,{Ah:()=>o,Bs:()=>a,NJ:()=>i,VH:()=>n,Xs:()=>u,u5:()=>l});let n=e=>{let{account:t,isClaudeDot:r}=e;return r?!1===t.settings.has_finished_claudeai_onboarding:!t.full_name||!t.display_name},a=(e,t)=>t&&!e.is_verified,i=(e,t)=>!!function(e,t){for(let r of e.invites)if(r.organization.capabilities&&r.organization.capabilities.includes(t))return r}(e,t?"raven":"api"),o=(e,t)=>!t&&0===e.invites.length&&0===e.memberships.filter(e=>e.organization.capabilities.includes("api")).length,l=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return r&&t&&!e.age_is_verified},u=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n({account:e,isClaudeDot:t})||a(e,t)||i(e,t)||o(e,t)||l(e,t,r)}},0xb804d868:(e,t,r)=>{r.d(t,{Vc:()=>o,Wz:()=>i});var n=r(0x11bc810a7),a=r(0x1ee873af);function i(e,t){return(0,n.F)({key:"SSS-".concat(e),defaultValue:t,serialize:JSON.stringify,deserialize:e=>void 0===e?t:JSON.parse(e)})}function o(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return(0,a.Q)(e,t,r)}},0x139b5e710:(e,t,r)=>{r.d(t,{ErrorSegmentConnector:()=>I,ErrorsProvider:()=>Y,MS:()=>z,ic:()=>q,Yf:()=>V});var n=r(0x22102fd88),a=r(0x495c605f),i=r(0x1016c6ed2);r(0x9845e38c);var o=r(0xac309a83),l=r(0x253a5c787),u=r(0x8009b83c),s=r.n(u),c=r(0x1d22aa00b),d=r.n(c),f=r(0x1351529bf),g=r.n(f),y=r(0x4d348f95),p=r(0xfc89b4a4),v=r(0x38e6572),b=r(0x156c4e43b),_=r(0xf32c56dd),m=r(0x14de19ae8);r(0x7dbd6363);function w(e,t){let r=[];for(let n of e){if(null==n)continue;let e=h(n,t+1);""!==e&&r.push(e)}return r.length>0?r.join(" "):""}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t>5?"":e instanceof Error?e.message:"string"==typeof e||"number"==typeof e||"boolean"==typeof e?String(e):p.isValidElement(e)?function e(t,r){var n;let a=t.props;if("object"==typeof a&&null!==a&&"defaultMessage"in a&&"string"==typeof a.defaultMessage)return a.defaultMessage;if("function"==typeof t.type&&"object"==typeof t.props&&null!==t.props)try{let e=(0,t.type)(t.props);if(e)return h(e,r+1)}catch(e){}return"object"==typeof a&&null!==a&&"children"in a?(n=a.children,"string"==typeof n||"number"==typeof n||"boolean"==typeof n?String(n):null==n?"":Array.isArray(n)?w(n,r+1):p.isValidElement(n)?e(n,r+1):h(n,r+1)):""}(e,t):Array.isArray(e)?w(e,t):""}let S=e=>{if(e instanceof Error){if("statusCode"in e&&"number"==typeof e.statusCode)return e.statusCode;if("status"in e&&"number"==typeof e.status)return e.status}},x=e=>{var t;if(e instanceof i.LG&&(null==(t=e.extra)?void 0:t.details)&&"object"==typeof e.extra.details&&"error_visibility"in e.extra.details)return String(e.extra.details.error_visibility)},k=e=>e instanceof i.LG?e.type:e instanceof Error?e.name:typeof e,E=e=>{if(e instanceof i.LG){var t;if(e.errorCode)return e.errorCode;if((null==(t=e.extra)?void 0:t.details)&&"object"==typeof e.extra.details&&"error_code"in e.extra.details&&"string"==typeof e.extra.details.error_code)return e.extra.details.error_code}if(e instanceof Error&&"code"in e)return String(e.code)};var L=r(0xb804d868);let C=null,T=null;function z(e){C=e.onError,T=e.onSegmentReady}let M=(0,p.createContext)(void 0);function O(e){var t;let{userFacingMessage:r,error:n,toastId:a,errorContext:o,track:l,isApiError:u}=e;null==C||C();let s=h(r);l({event_key:"claudeai.user_facing_error.shown",error_message:s?"".concat(s.substring(0,200)).concat(s.length>200?"...":""):"[Error message could not be extracted for logging]",toast_id:a,error_type:k(n),error_source:(null==o||null==(t=o.tags)?void 0:t.source)||"unknown",error_endpoint:n instanceof i.LG?n.endpoint:void 0,error_method:n instanceof i.LG?n.method:void 0,has_original_error:!!n,original_error_message:n instanceof Error?n.message.substring(0,200):void 0,error_stack_trace:(e=>{if(e instanceof Error&&e.stack)return e.stack.split("\n").slice(0,3).join("\n").substring(0,500)})(n),error_code:E(n),error_status_code:S(n),error_visibility:x(n),websocket_close_code:(e=>{var t;if(e instanceof i.LG&&(null==(t=e.extra)?void 0:t.details)&&"object"==typeof e.extra.details&&"websocket_close_code"in e.extra.details&&"number"==typeof e.extra.details.websocket_close_code)return e.extra.details.websocket_close_code})(n),is_instanceof_api_error:n instanceof i.LG,is_caller_api_error:u,offline_status:"undefined"!=typeof navigator?!navigator.onLine:void 0})}function Y(e){let{children:t}=e,r=(0,p.useRef)(1),[a,i]=(0,p.useState)([]),o=(0,p.useRef)(null),u=(0,p.useRef)([]),s=(0,p.useCallback)(e=>{o.current=e,u.current.forEach(t=>{e(t,void 0)}),u.current=[],null==T||T(e)},[]),c=(0,p.useCallback)(async e=>{if(null!==o.current)return o.current(e);u.current.push(e)},[]),d=(0,p.useCallback)(e=>{i(t=>t.filter(t=>t.id!==e))},[]),f=(0,p.useCallback)((e,t)=>{let n=r.current++,{timeout:a,error:o,errorContext:l,messageForLogging:u,uniqueKey:s}=t||{};return O({userFacingMessage:u||e,error:o,toastId:n,errorContext:l,track:c,isApiError:!1}),i(t=>[...t,{id:n,message:e,toastType:"error",uniqueKey:s,details:""}]),a&&setTimeout(()=>d(n),a),n},[d,"",c]),g=(0,p.useCallback)((e,t)=>{let a=r.current++,{timeout:o,errorContext:u}=t||{},s=e instanceof Error?e.message:String(e);if("user_facing"!==x(e))if(500===S(e))s=(0,n.jsx)(v.A,{defaultMessage:"This isn't working right now. You can try again later.",id:"+jfKVKRlw7"});else{null==C||C(),e instanceof TypeError&&(e.message.startsWith("Failed to fetch")||e.message.startsWith("NetworkError when attempting to fetch resource.")||e.message.startsWith("Load failed"))||(0,l.Cp)(e,{tags:{source:"api-error"},extra:{isSuppressed:!0}});return}return"account_needs_verification"===s&&(s="Your account needs to be verified."),O({userFacingMessage:s,error:e,toastId:a,errorContext:u,track:c,isApiError:!0}),i(e=>[...e,{id:a,message:s,toastType:"error",details:""}]),o&&setTimeout(()=>d(a),o),a},[d,"",c]),y=(0,p.useCallback)((e,t)=>{let n=r.current++,{timeout:a,uniqueKey:o}=t||{};return i(t=>[...t,{id:n,message:e,toastType:"info",uniqueKey:o}]),a&&setTimeout(()=>d(n),a),n},[d]),b=(0,p.useMemo)(()=>({toasts:a,addError:f,addApiError:g,addSuccess:y,clearToast:d,registerSegmentTracker:s}),[a,f,g,y,d,s]);return(0,n.jsx)(M.Provider,{value:b,children:t})}function V(){let e=(0,p.useContext)(M);if(!e)throw Error("Must be called within ErrorsProvider");return e}let K=b.Ik({id:b.Yj().optional().nullable(),title:b.Yj().optional().nullable(),message:b.Yj().optional().nullable(),displayFrequencyHours:b.ai().optional().nullable()}),j={};function I(){let{registerSegmentTracker:e}=V(),{track:t}=(0,_.st)();return(0,p.useEffect)(()=>{e(t)},[e,t]),null}function q(){var e;let{id:t,title:r,message:n,displayFrequencyHours:i}=(0,o.iW)("claude_system_message",j,K),{account:l}=(0,m.YL)(),u=null!=(e=null==l?void 0:l.uuid)?e:"logged-out",c=(0,y.usePathname)(),[f,v]=(0,L.Vc)("dismissed-system-messages",{}),b=(0,p.useMemo)(()=>()=>v(e=>{let r=s()(e);return t&&g()(r,[u,t],Date.now()),r}),[v,u,t]);return(0,p.useMemo)(()=>{if(!l||(0,a.Xs)(l,!0)||"/download"===c||!t)return!1;let e=d()(f,[u,t]);return!e||"boolean"==typeof e||!!i&&Date.now()-e>=60*i*6e4},[l,t,u,f,i,c])?{currentSystemMessageId:t,currentSystemMessageTitle:r,currentSystemMessageContent:n,dismissCurrentSystemMessage:b}:{currentSystemMessageId:null,currentSystemMessageTitle:null,currentSystemMessageContent:null,dismissCurrentSystemMessage:()=>null}}},0x1cbe50837:(e,t,r)=>{r.d(t,{K:()=>o,t:()=>i});var n=r(0x12c9046cd),a=r(0x14de19ae8);let i="cowork_settings",o=()=>{let{activeOrganization:e}=(0,a.YL)(),t=null==e?void 0:e.uuid,r=(0,a.mV)();return(0,n.Sk)("/api/organizations/".concat(t,"/cowork_settings"),{queryKey:[i,t],enabled:!!t&&r})}},0x22be9474c:(e,t,r)=>{r.d(t,{BH:()=>f,NE:()=>w,NL:()=>p,Nf:()=>k,Nj:()=>u,QY:()=>b,RK:()=>E,U6:()=>c,VH:()=>m,VK:()=>h,a:()=>v,b3:()=>x,gn:()=>L,iD:()=>s,k3:()=>S,kP:()=>d,q:()=>g,rX:()=>y,tX:()=>_});var n=r(0x1cbe50837),a=r(0x12c9046cd),i=r(0x14de19ae8),o=r(0x49fac030),l=r(0x17e725145);let u=e=>(0,a.Sk)("/api/organizations/".concat(e),{queryKey:[o.i5,e],enabled:!!e,staleTime:3e4}),s=()=>{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid;return(0,a.Qv)(e=>{let{flagType:r}=e;return"/api/organizations/".concat(t,"/flags/").concat(r,"/dismiss")},"POST",(e,t)=>{let{flagType:r}=e;if(t)return{...t,active_flags:t.active_flags.filter(e=>e.type!==r)}},{queryKey:[o.i5,t]})},c=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{activeOrganization:r}=(0,i.YL)(),n=null==r?void 0:r.uuid,l=(0,i.mV)();return(0,a.Sk)("/api/organizations/".concat(n,"/members_limit"),{queryKey:[o.hz,n],enabled:!!n&&l&&(null==(e=t.enabled)||e),staleTime:0})},d=()=>{var e;let{data:t}=c();return null!=(e=null==t?void 0:t.minimum_seats)?e:5},f=()=>{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid,r=(0,l.useQueryClient)();return(0,a.L2)("/api/organizations/".concat(t,"/contracted_quantity"),"PUT",{enabled:!!t,onSuccess:async()=>{await r.invalidateQueries({queryKey:[o.hz,t]})}})},g=()=>{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid;return(0,a.Sk)("/api/organizations/".concat(t,"/public_projects_enabled"),{queryKey:[o._d,t],enabled:!!t,staleTime:0})},y=()=>{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid;return(0,a.Sk)("/api/organizations/".concat(t,"/feature_settings"),{queryKey:[o.RR,t],enabled:!!t,staleTime:0})},p=e=>{let{data:t}=y();if(!(null==t?void 0:t.forced_settings))return{isOrgPolicyControlled:!1,policyValue:void 0};let r=t.forced_settings.find(t=>t.feature===e);return{isOrgPolicyControlled:!!r,policyValue:null==r?void 0:r.forced_state}},v=()=>{var e;let t=(0,i.mV)(),{data:r}=y();return!t||(r?!(null==(e=r.disabled_features)?void 0:e.includes("claude_code_web")):void 0)},b=()=>{var e,t;let{activeOrganization:r}=(0,i.YL)(),{data:n}=u(null==r?void 0:r.uuid);return null==(t=null==n||null==(e=n.settings)?void 0:e.claude_ai_completion_feedback_enabled)||t},_=()=>{var e,t;let{activeOrganization:r}=(0,i.YL)(),{data:n}=u(null==r?void 0:r.uuid);return null==(t=null==n||null==(e=n.settings)?void 0:e.claude_ai_integration_sharing_enabled)||t},m=()=>{var e,t;let{activeOrganization:r}=(0,i.YL)(),{data:n}=u(null==r?void 0:r.uuid);return null==(t=null==n||null==(e=n.settings)?void 0:e.claude_ai_chat_sharing_enabled)||t};function w(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{activeOrganization:r}=(0,i.YL)(),u="/api/organizations/".concat(null!=(e=null==r?void 0:r.uuid)?e:""),s=(0,l.useQueryClient)();return(0,a.L2)(u,"PUT",{enabled:!!r,...t,async onSuccess(){for(var e,a=arguments.length,i=Array(a),l=0;l{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid;return(0,a.Sk)("/api/organizations/".concat(t,"/allowed_domains"),{queryKey:[o.OX,t],enabled:!!t})},S=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{activeOrganization:t}=(0,i.YL)(),r=null==t?void 0:t.uuid,n=(0,l.useQueryClient)();return(0,a.L2)("/api/organizations/".concat(r,"/allowed_domains"),"PUT",{enabled:!!r,...e,onSuccess:async function(){for(var t,a=arguments.length,i=Array(a),l=0;l{let{activeOrganization:e}=(0,i.YL)(),t=null==e?void 0:e.uuid;return(0,a.L2)("/api/organizations/".concat(t,"/projects/request_haystack"),"POST",{enabled:!!t})},k=()=>{let{activeOrganization:e}=(0,i.YL)(),t=(0,i.mV)(),r=null==e?void 0:e.uuid;return(0,a.Sk)("/api/organizations/".concat(r,"/is_pure_usage_based"),{queryKey:["is_pure_usage_based",r],enabled:!!r&&t,staleTime:3e4})},E=()=>{let{activeOrganization:e}=(0,i.YL)(),t=(0,i.mV)(),r=null==e?void 0:e.uuid;return(0,a.Sk)("/api/organizations/".concat(r,"/is_overage_billing_enabled"),{queryKey:["is_overage_billing_enabled",r],enabled:!!r&&t,staleTime:3e4})},L=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{activeOrganization:t}=(0,i.YL)(),r=null==t?void 0:t.uuid,n=(0,l.useQueryClient)();return(0,a.L2)("/api/organizations/".concat(r,"/compliance_api_settings"),"POST",{enabled:!!r,...e,async onSuccess(t,a,i){var l;r&&n.setQueryData([o.Rw],e=>(function(e,t,r){if(!(null==e?void 0:e.account))return e;let n=e.account.memberships.findIndex(e=>e.organization.uuid===t);if(-1===n)return e;let a=e.account.memberships[n],i=a.organization.capabilities,o=i.includes("compliance_api");if(r&&o||!r&&!o)return e;let l=r?[...i,"compliance_api"]:i.filter(e=>"compliance_api"!==e),u=[...e.account.memberships];return u[n]={...a,organization:{...a.organization,capabilities:l}},{...e,account:{...e.account,memberships:u}}})(e,r,a.enable_compliance_api)),await (null==(l=e.onSuccess)?void 0:l.call(e,t,a,i))}})}}}]);