1__d(function(g,r,i,a,m,e,d){"use strict";Object.defineProperty(e,'__esModule',{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return u}}),r(d[0]);var n=r(d[1]),t=r(d[2]);function u(){return(0,t.jsx)(n.ConnectionsScreen,{})}},5642,[19,5643,2]); 2__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"ConnectionsScreen",{enumerable:!0,get:function(){return A}}),r(d[0]);var e,t=r(d[1]),n=(e=t)&&e.__esModule?e:{default:e},s=r(d[2]),c=r(d[3]),l=r(d[4]),o=r(d[5]),u=r(d[6]),h=r(d[7]),p=r(d[8]),j=r(d[9]),S=r(d[10]),x=r(d[11]),f=r(d[12]),_=r(d[13]);const A=()=>{const{user:e,loading:t}=(0,o.useCurrentUser)(),{hasRefreshToken:A,isChecking:C}=(0,o.useAuthState)(),{access:b}=(0,f.useOrganizationProductAccess)(),{width:y}=(0,n.default)(),P=y<680,T=b.mcpLabel;return(t||C)&&!1!==A?(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(x.PageTitle,{detail:T}),(0,_.jsx)(j.FullScreenLoading,{})]}):e?.id||!1!==A?(0,_.jsx)(S.PageScrollShell,{pageTitle:T,headerTitle:T,headerSubtitle:'Connect once, then say "Use Super Carl to find..." anywhere.',maxWidth:l.CONSTRAINED_PAGE_MAX_WIDTH,children:(0,_.jsxs)(s.YStack,{gap:"$6",paddingVertical:P?"$3":"$4",width:"100%",children:[(0,_.jsx)(p.OAuthConnectionsList,{compact:P}),(0,_.jsx)(h.CustomMcpSection,{compact:P}),b.capabilities.manageApiKeys?(0,_.jsx)(u.ApiKeysSection,{compact:P}):null]})}):(0,_.jsx)(c.Redirect,{href:"/login"})}},5643,[19,439,2923,474,3595,3020,5644,5648,5650,2786,5046,5010,3439,2]); 3__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"API_KEY_SCOPES",{enumerable:!0,get:function(){return w}}),Object.defineProperty(_e,"ApiKeysSection",{enumerable:!0,get:function(){return z}});var t=r(d[0]),o=e(r(d[1])),n=e(r(d[2]));r(d[3]);var l=e(r(d[4])),s=e(r(d[5])),c=e(r(d[6])),u=e(r(d[7])),p=r(d[8]),y=r(d[9]),h=r(d[10]),x=r(d[11]),f=r(d[12]),k=r(d[13]),S=r(d[14]),b=r(d[15]),C=r(d[16]),j=r(d[17]),T=r(d[18]),v=r(d[19]),A=r(d[20]),F=r(d[21]),P=r(d[22]);const w=[...b.MCP_API_KEY_SCOPES],I="current_period",R=e=>Number.isFinite(e)?e.toLocaleString("en-US"):"0",W=({scope:e,active:t,onPress:o})=>(0,P.jsx)(l.default,{onPress:o,accessibilityRole:"checkbox",accessibilityLabel:e,accessibilityState:{checked:t},style:({pressed:e})=>[K.scopeChip,t?K.scopeChipActive:null,e?K.pressed:null],children:(0,P.jsx)(k.Text,{style:[K.scopeChipText,t?K.scopeChipTextActive:null],children:e})}),z=({compact:e=!1})=>{const s=(0,p.useQueryClient)(),{user:z,loading:D}=(0,C.useCurrentUser)(),[$,E]=(0,t.useState)(!1),[H,_]=(0,t.useState)(""),[V,Y]=(0,t.useState)([...b.MCP_DEFAULT_API_KEY_SCOPES]),[L,q]=(0,t.useState)(null),[M,U]=(0,t.useState)(null),[N,O]=(0,t.useState)(null),[X,Q]=(0,t.useState)({}),[G,J]=(0,t.useState)(null),[Z,ee]=(0,t.useState)(!1),[te,ie]=(0,t.useState)(null),oe=(0,t.useRef)(new o.default.Value(0)).current,re=(0,p.useQuery)({queryKey:j.queryKeys.apiKeys.usage(I),queryFn:()=>(0,T.fetchApiKeyUsage)({range:I}),enabled:Boolean(z?.id),staleTime:6e4}),ne=(0,p.useMutation)({mutationFn:T.createApiKey,onSuccess:async e=>{E(!1),_(""),Y([...b.MCP_DEFAULT_API_KEY_SCOPES]),J(null),q(null),U(e.apiKey),O(e.key.name||"New API key"),e.key.id&&e.apiKey&&Q(t=>({...t,[e.key.id]:e.apiKey})),await s.invalidateQueries({queryKey:j.queryKeys.apiKeys.usage(I)})},onError:e=>{J(e.message||"Failed to create API key")}}),ae=(0,p.useMutation)({mutationFn:T.revokeApiKey,onSuccess:async()=>{q("API key revoked."),await s.invalidateQueries({queryKey:j.queryKeys.apiKeys.usage(I)})},onError:e=>{q(e.message||"Failed to revoke API key")}}),le=(0,t.useMemo)(()=>re.data?.keys??[],[re.data?.keys]),se=(0,t.useMemo)(()=>le.filter(e=>"revoked"!==e.status),[le]),de=(0,t.useMemo)(()=>le.filter(e=>"revoked"===e.status),[le]),ce=Z?[...se,...de]:se,ue=e=>{Y(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},pe=e=>{(0,F.confirmDestructiveAction)("Revoke API key?","This key will stop working immediately.",()=>ae.mutate(e.id))},ye=(e,t,n="success")=>{ie({targetId:e,message:t,tone:n}),oe.stopAnimation(()=>{oe.setValue(1),o.default.timing(oe,{toValue:0,duration:1200,delay:700,useNativeDriver:!1}).start(({finished:t})=>{t&&ie(t=>t?.targetId===e?null:t)})})},ge=async(e,t)=>{const o=await(0,v.copyTextToClipboard)(e);ye(t,o?"API key copied":"Clipboard unavailable on this device",o?"success":"info")};return D||!z?.id?null:(0,P.jsxs)(y.YStack,{gap:"$3",paddingTop:"$6",borderTopWidth:1,borderTopColor:S.DS.color.border,children:[(0,P.jsxs)(y.XStack,{justifyContent:"space-between",alignItems:"flex-end",gap:"$3",flexWrap:"wrap",children:[(0,P.jsxs)(y.YStack,{flex:1,minWidth:e?"100%":300,gap:"$1",children:[(0,P.jsx)(k.Text,{fontSize:12,lineHeight:16,fontWeight:"700",letterSpacing:1.2,color:"#94A3B8",children:"API KEYS"}),(0,P.jsx)(k.Text,{fontSize:14,lineHeight:20,color:"#7C8CA2",children:"For CLIs and services without interactive sign-in. Usage draws from the account's credit pool."})]}),(0,P.jsx)(x.ActionButton,{variant:"secondary",onPress:()=>E(!0),fullWidth:e,children:"Create API key"})]}),L?(0,P.jsx)(k.Text,{accessibilityRole:"alert",fontSize:13,lineHeight:18,color:"#334155",children:L}):null,(0,P.jsxs)(y.YStack,{children:[M?(0,P.jsxs)(y.YStack,{gap:"$3",paddingVertical:"$4",borderTopWidth:1,borderTopColor:S.DS.color.border,children:[(0,P.jsxs)(y.YStack,{gap:"$1",children:[(0,P.jsxs)(k.Text,{fontSize:16,lineHeight:22,fontWeight:"600",color:"#0F172A",children:["New API key: ",
3N]}),(0,P.jsx)(k.Text,{fontSize:13,lineHeight:18,color:"#64748B",children:"Copy this key now. For security, it remains available only until you leave this page."})]}),(0,P.jsx)(u.default,{style:K.newKeyValueContainer,children:(0,P.jsx)(k.Text,{style:K.newKeyValueText,selectable:!0,children:M})}),(0,P.jsxs)(y.XStack,{gap:"$2",justifyContent:"flex-end",flexWrap:"wrap",children:[(0,P.jsx)(x.ActionButton,{variant:"neutral",onPress:()=>{U(null),O(null)},children:"Done"}),(0,P.jsx)(x.ActionButton,{variant:"primary",onPress:()=>{ge(M,"new-key")},children:"Copy key"})]}),"new-key"===te?.targetId?(0,P.jsx)(B,{feedback:te,opacity:oe}):null]}):null,re.isLoading?(0,P.jsx)(y.YStack,{paddingVertical:"$4",borderTopWidth:1,borderTopColor:S.DS.color.border,children:(0,P.jsx)(f.LoadingState,{message:"Loading keys...",variant:"inline"})}):re.isError?(0,P.jsx)(k.Text,{accessibilityRole:"alert",fontSize:14,color:"#DC2626",paddingVertical:"$4",children:re.error?.message||"Failed to load API keys."}):ce.length?(0,P.jsx)(y.YStack,{borderTopWidth:1,borderTopColor:S.DS.color.border,children:ce.map(e=>{const t=e.apiKey??X[e.id],o="revoked"===e.status;return(0,P.jsxs)(u.default,{style:K.keyRow,children:[(0,P.jsxs)(y.YStack,{gap:"$2",children:[(0,P.jsxs)(y.XStack,{justifyContent:"space-between",alignItems:"center",gap:"$3",flexWrap:"wrap",children:[(0,P.jsx)(k.Text,{fontSize:16,lineHeight:22,fontWeight:"600",color:"#0F172A",children:e.name}),(0,P.jsxs)(y.XStack,{gap:"$3",alignItems:"center",flexWrap:"wrap",children:[(0,P.jsx)(u.default,{style:o?K.statusBadgeRevoked:K.statusBadgeActive,children:(0,P.jsx)(k.Text,{style:o?K.statusTextRevoked:K.statusTextActive,children:o?"Revoked":"Active"})}),!o&&t?(0,P.jsx)(x.ActionButton,{variant:"secondary",onPress:()=>{ge(t,e.id)},children:"Copy key"}):null,o?null:(0,P.jsx)(l.default,{onPress:()=>pe(e),disabled:ae.isPending,accessibilityRole:"button",accessibilityLabel:`Revoke ${e.name}`,style:({pressed:e})=>[K.textAction,e?K.pressed:null],children:(0,P.jsx)(k.Text,{style:[K.revokeText,ae.isPending?K.actionDisabled:null],children:"Revoke"})})]})]}),(0,P.jsxs)(k.Text,{style:K.keyPrefixText,selectable:!0,children:[e.keyPrefix,"\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022"]}),(0,P.jsx)(y.XStack,{gap:"$2",flexWrap:"wrap",children:e.scopes.map(t=>(0,P.jsx)(u.default,{style:K.scopeBadge,children:(0,P.jsx)(k.Text,{style:K.scopeBadgeText,children:t})},`${e.id}-${t}`))}),(0,P.jsxs)(k.Text,{fontSize:13,lineHeight:18,color:"#8493A8",children:["Last used ",(0,A.formatRelativeTimeShort)(e.lastUsedAt,"never")," \xb7 ",R(e.creditsUsed)," ","credits used this period \xb7 ",R(e.fullSearches)," full searches \xb7"," ",R(e.previewSearches),"previews"]})]}),te?.targetId===e.id?(0,P.jsx)(B,{feedback:te,opacity:oe}):null]},e.id)})}):(0,P.jsx)(k.Text,{fontSize:14,lineHeight:20,color:"#64748B",paddingVertical:"$4",children:0===se.length&&de.length>0&&!Z?"No active API keys. Create one to start integrating.":"No API keys yet. Create one to start integrating."}),de.length>0?(0,P.jsx)(l.default,{onPress:()=>ee(e=>!e),accessibilityRole:"button",accessibilityLabel:Z?"Hide revoked API keys":"Show revoked API keys",style:({pressed:e})=>[K.revokedToggle,e?K.pressed:null],children:(0,P.jsx)(k.Text,{fontSize:14,lineHeight:20,fontWeight:"600",color:S.DS.color.primary,children:Z?`Hide revoked (${de.length})`:`Show revoked (${de.length})`})}):null]}),(0,P.jsx)(n.default,{visible:$,animationType:"fade",transparent:!0,onRequestClose:()=>E(!1),children:(0,P.jsx)(u.default,{style:K.modalBackdrop,children:(0,P.jsxs)(y.YStack,{style:K.modalCard,gap:"$3",children:[(0,P.jsx)(k.Text,{fontSize:18,lineHeight:25,fontWeight:"700",color:"#0F172A",children:"Create API key"}),(0,P.jsx)(h.FormSection,{label:"Key name",required:!0,children:(0,P.jsx)(c.default,{value:H,onChangeText:e=>{_(e),J(null)},placeholder:"e.g. Production key",placeholderTextColor:"#94A3B8",style:K.textInput,autoFocus:!0})}),(0,P.jsx)(h.FormSection,{label:"Scopes",helperText:"Scopes control what this key can access.",children:(0,P.jsx)(y.XStack,{gap:"$2",flexWrap:"wrap",children:w.map(e=>(0,P.jsx)(W,{scope:e,active:V.includes(e),onPress:()=>ue(e)},e))})}),G?(0,P.jsx)(k.Text,{accessibilityRole:"alert",fontSize:13,color:"#DC2626",children:G}):null,(0,P.jsxs)(y.XStack,{gap:"$2",justifyContent:"flex-end",flexWrap:"wrap",marginTop:"$2",children:[(0,P.jsx)(x.ActionButton,{variant:"neutral",onPress:()=>E(!1),children:"Cancel"}),(0,P.jsx)(x.ActionButton,{variant:"primary",onPress:()=>{const e=H.trim();e?0!==V.length?ne.mutate({name:e,scopes:V}):J("Select at least one scope"):J("Name is required")},disabled:ne.isPending,loading:ne.isPending,children:"Create key"})]})]})})})]})},B=({feedback:e,opacity:t})=>(0,P.jsx)(o.default.View,{style:[K.copyFeedbackRow,{opacity:t}],children:(0,P.jsx)(k.Text,{style:[K.copyFeedbackText,"info"===e.tone?K.copyFeedbackTextInfo:null],children:e.message})}),K=s.default.create({pressed:{opacity:.7},newKeyValueContainer:{backgroundColor:"#0F172A",borderRadius:S.DS.radius.control,padding:12},newKeyValueText:{fontFamily:"monospace",color:"#E2E8F0",fontSize:12},keyRow:{paddingVertical:S.DS.space.md,borderBottomWidth:1,borderBottomColor:S.DS.color.border},keyPrefixText:{fontFamily:"monospace",color:"#475569",fontSize:13},scopeBadge:{paddingHorizontal:10,paddingVertical:4,borderRadius:S.DS.radius.pill,backgroundColor:"#F1F5F9"},scopeBadgeText:{fontSize:12,color:"#40516A",fontWeight:"600"},statusBadgeActive:{paddingHorizontal:12,paddingVertical:6,borderRadius:S.DS.radius.pill,backgroundColor:"#E4F7EC"},statusBadgeRevoked:{paddingHorizontal:12,paddingVertical:6,borderRadius:S.DS.radius.pill,backgroundColor:"#F1F5F9"},statusTextActive:{color:"#169B62",fontSize:12,lineHeight:16,fontWeight:"700"},statusTextRevoked:{color:"#7C8CA2",fontSize:12,lineHeight:16,fontWeight:"700"},textAction:{minHeight:40,justifyContent:"center",paddingHorizontal:4},revokeText:{color:"#EF4444",fontSize:14,lineHeight:20,fontWeight:"600"},actionDisabled:{opacity:.55},revokedToggle:{alignSelf:"flex-start",minHeight:40,justifyContent:"center"},copyFeedbackRow:{marginTop:6},copyFeedbackText:{fontSize:12,color:"#16A34A",fontWeight:"600"},copyFeedbackTextInfo:{color:"#475569"},modalBackdrop:{flex:1,backgroundColor:"rgba(15, 23, 42, 0.6)",justifyContent:"center",alignItems:"center",padding:24},modalCard:{backgroundColor:"#FFFFFF",borderRadius:16,padding:20,width:"100%",maxWidth:520},textInput:{borderWidth:1,borderColor:"#CBD5E1",borderRadius:S.DS.radius.control,paddingHorizontal:12,paddingVertical:10,fontSize:14,color:"#0F172A",backgroundColor:"#FFFFFF"},scopeChip:{borderWidth:1,borderColor:"#CBD5E1",borderRadius:S.DS.radius.pill,paddingHorizontal:12,paddingVertical:6,backgroundColor:"#FFFFFF"},scopeChipActive:{backgroundColor:"#E0F2FE",borderColor:"#38BDF8"},scopeChipText:{fontSize:13,color:"#334155"},scopeChipTextActive:{color:"#0284C7",fontWeight:"600"}})},5644,[19,301,407,110,414,133,424,307,1073,2923,5645,2938,2786,2940,2771,5601,3020,3021,5646,3801,3834,5647,2]); 4__d(function(g,r,i,a,m,_e,d){"use strict";
4Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"confirmDestructiveAction",{enumerable:!0,get:function(){return o}});var e,t=r(d[0]),n=(e=t)&&e.__esModule?e:{default:e};r(d[1]);const o=(e,t,o,c="Revoke")=>{if("undefined"!=typeof window){return void(window.confirm(`${e}\n\n${t}`)&&o())}n.default.alert(e,t,[{text:"Cancel",style:"cancel"},{text:c,style:"destructive",onPress:o}])}},5647,[300,110]); 5__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.CustomMcpSection=function({compact:e=!1}){const S=(0,o.useRouter)(),[C,f]=n.default.useState(null),y=async(e,n)=>{f(null);try{await t.default.openURL(n)}catch(n){console.error(`[CustomMcpSection] Failed to open ${e} setup guide`,n),f(`${e} setup guide could not be opened. Please try again.`)}};return(0,x.jsxs)(l.YStack,{gap:"$3",paddingTop:"$6",children:[(0,x.jsxs)(l.YStack,{gap:"$1",children:[(0,x.jsx)(u.Text,{fontSize:12,lineHeight:16,fontWeight:"700",letterSpacing:1.2,color:"#94A3B8",children:"CUSTOM MCP"}),(0,x.jsx)(u.Text,{fontSize:18,lineHeight:25,fontWeight:"700",color:"#0F172A",children:"Carl's MCP endpoint"}),(0,x.jsxs)(u.Text,{fontSize:14,lineHeight:20,color:"#64748B",children:["Works anyw
5here MCP does, including"," ",(0,x.jsx)(u.Text,{accessibilityRole:"link",accessibilityLabel:"Open OpenClaw MCP setup guide",onPress:()=>{y("OpenClaw",h.OPENCLAW_MCP_SETUP_GUIDE_URL)},color:p.DS.color.primary,textDecorationLine:"underline",children:"OpenClaw"})," and ",(0,x.jsx)(u.Text,{accessibilityRole:"link",accessibilityLabel:"Open Goose MCP setup guide",onPress:()=>{y("Goose",h.GOOSE_MCP_SETUP_GUIDE_URL)},color:p.DS.color.primary,textDecorationLine:"underline",children:"Goose"}),". Paste this endpoint into Cursor, Windsurf, your own agents, or any MCP client."]})]}),C?(0,x.jsx)(u.Text,{accessibilityRole:"alert",fontSize:13,lineHeight:18,color:"#DC2626",children:C}):null,(0,x.jsx)(s.McpEndpointCopyRow,{compact:e}),(0,x.jsxs)(l.XStack,{gap:"$3",alignItems:"center",flexWrap:"wrap",children:[(0,x.jsx)(c.ActionButton,{variant:"neutral",onPress:()=>S.push("/docs"),children:"View docs"}),(0,x.jsx)(u.Text,{flex:1,minWidth:e?"100%":280,fontSize:13,lineHeight:19,color:"#94A3B8",fontStyle:"italic",children:"Try: \"Use Super Carl to find Series B investors who've backed dev-tools companies.\""})]})]})};var n=e(r(d[0])),t=e(r(d[1])),o=r(d[2]),l=r(d[3]),s=r(d[4]),c=r(d[5]),u=r(d[6]),p=r(d[7]),h=r(d[8]),x=r(d[9])},5648,[19,393,474,2923,5649,2938,2940,2771,5601,2]); 6__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),_e.McpEndpointCopyRow=function({compact:e=!1}){const[o,p]=(0,t.useState)(!1),[h,T]=(0,t.useState)(null),b=(0,t.useRef)(null);(0,t.useEffect)(()=>()=>{b.current&&clearTimeout(b.current)},[]);const S=async()=>{await(0,f.copyTextToClipboard)(C.MCP_CONNECTOR_URL)?(T(null),p(!0),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{b.current=null,p(!1)},1800)):T("The MCP endpoint could not be copied on this device.")};return(0,x.jsxs)(n.default,{children:[(0,x.jsxs)(c.XStack,{gap:"$2",alignItems:"center",flexWrap:"wrap",children:[(0,x.jsx)(n.default,{style:[y.endpointField,e?y.endpointFieldCompact:null],children:(0,x.jsx)(u.Text,{selectable:!0,numberOfLines:1,style:y.endpointText,children:C.MCP_CONNECTOR_URL})}),(0,x.jsx)(s.ActionButton,{variant:"secondary",onPress:()=>{S()},icon:o?(0,x.jsx)(l.Check,{size:15,color:"#0F766E"}):(0,x.jsx)(l.Copy,{size:15}),fullWidth:e,style:e?y.compactCopyButton:void 0,accessibilityLabel:"Copy MCP endpoint",children:o?"Copied":"Copy"})]}),h?(0,x.jsx)(u.Text,{accessibilityRole:"alert",style:y.errorText,children:h}):null]})};var t=r(d[0]);r(d[1]);var o=e(r(d[2])),n=e(r(d[3])),c=r(d[4]),l=r(d[5]),s=r(d[6]),u=r(d[7]),p=r(d[8]),C=r(d[9]),f=r(d[10]),x=r(d[11]);const y=o.default.create({endpointField:{flex:1,minWidth:240,minHeight:p.DS.component.buttonHeight,justifyContent:"center",paddingHorizontal:p.DS.space.md,backgroundColor:p.DS.color.subtleSurface,borderWidth:1,borderColor:p.DS.color.border,borderRadius:p.DS.radius.control},endpointFieldCompact:{flexBasis:"100%",minWidth:0},endpointText:{color:"#334155",fontSize:14,fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, monospace"},compactCopyButton:{marginTop:p.DS.space.tight},errorText:{color:"#DC2626",fontSize:12,lineHeight:16,marginTop:p.DS.space.sm}})},5649,[19,110,133,307,2923,6134,2938,2940,2771,5601,3801,2]); 7__d(function(g,r,i,a,m,_e,d){"use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"isClaudeOAuthClient",{enumerable:!0,get:function(){return I}}),Object.defineProperty(_e,"isChatGptOAuthClient",{enumerable:!0,get:function(){return H}}),Object.defineProperty(_e,"OAuthConnectionsList",{enumerable:!0,get:function(){return _}});var t=e(r(d[0])),n=e(r(d[1])),o=e(r(d[2])),l=e(r(d[3])),s=e(r(d[4])),c=e(r(d[5])),u=r(d[6]),h=r(d[7]),p=r(d[8]),x=r(d[9]),f=e(r(d[10])),C=e(r(d[11])),v=r(d[12]),y=r(d[13]),j=r(d[14]),S=r(d[15]),k=r(d[16]),A=r(d[17]),b=r(d[18]),T=r(d[19]),P=r(d[20]),R=r(d[21]),w=r(d[22]),F=r(d[23]),L=r(d[24]);const $=e=>[e.clientId,e.clientName,e.clientUri,e.logoUri].filter(e=>"string"==typeof e&&e.trim().length>0).map(e=>e.trim().toLowerCase()),I=e=>$(e).some(e=>e.includes("claude")),H=e=>$(e).some(e=>e.includes("chatgpt")),z=e=>{const t=e.clientName?.trim();return t||(e.clientId||"Connected app")},D=e=>"dcr"===e.registrationSource?"Added via MCP":"admin"===e.registrationSource?"Provisioned by Super Carl":"Connected app",O=e=>{const t=[D(e)];return e.createdAt&&t.push(`connected ${(0,R.formatShortDate)(e.createdAt)}
7`),t.push(`last used ${(0,R.formatRelativeTimeShort)(e.lastUsedAt,"never")}`),t.join(" \xb7 ")},E=({client:e})=>{if(I(e))return(0,L.jsx)(B,{});if(H(e))return(0,L.jsx)(W,{});const t=e.logoUri&&e.logoUri.startsWith("http")?e.logoUri:null;return t?(0,L.jsx)(c.default,{style:[G.iconTile,G.genericIconTile],children:(0,L.jsx)(n.default,{source:{uri:(0,w.buildMediaUrl)(t,{width:28,fit:"contain"})},style:G.logoImage,resizeMode:"contain"})}):(0,L.jsx)(c.default,{style:[G.iconTile,G.genericIconTile],children:(0,L.jsx)(x.Link2,{size:19,color:"#64748B"})})},B=()=>(0,L.jsx)(p.LinearGradient,{testID:"claude-logo-badge",colors:["#FFF7ED","#FED7AA","#F2A36F"],start:{x:.5,y:0},end:{x:.5,y:1},style:G.iconTile,children:(0,L.jsx)(C.default,{testID:"claude-brand-logo",width:27,height:27})}),W=()=>(0,L.jsx)(p.LinearGradient,{testID:"chatgpt-logo-badge",colors:["#F8FAFC","#CBD5E1","#94A3B8"],start:{x:.5,y:0},end:{x:.5,y:1},style:G.iconTile,children:(0,L.jsx)(n.default,{testID:"chatgpt-brand-logo",source:f.default,style:G.chatGptLogoImage,resizeMode:"cover"})}),M=({client:e,onRevoke:t,isRevoking:n,compact:o=!1})=>{const s=(0,L.jsx)(c.default,{style:e.hasActiveToken?G.statusBadgeActive:G.statusBadgeRevoked,children:(0,L.jsx)(k.Text,{style:e.hasActiveToken?G.statusTextActive:G.statusTextRevoked,children:e.hasActiveToken?"Active":"Revoked"})}),u=e.hasActiveToken?(0,L.jsx)(l.default,{onPress:()=>t(e),disabled:n,accessibilityRole:"button",accessibilityLabel:`Revoke ${z(e)}`,style:({pressed:e})=>[G.textAction,o?G.textActionFlushRight:null,e?G.textActionPressed:null],children:(0,L.jsx)(k.Text,{style:[G.revokeText,n?G.actionDisabled:null],children:"Revoke"})}):null;return(0,L.jsx)(c.default,{style:G.row,children:(0,L.jsxs)(h.XStack,{gap:"$3",alignItems:o?"flex-start":"center",children:[(0,L.jsx)(E,{client:e}),(0,L.jsxs)(h.YStack,{flex:1,minWidth:0,gap:"$1",children:[(0,L.jsx)(k.Text,{fontSize:16,lineHeight:22,fontWeight:"600",color:"#0F172A",children:z(e)}),(0,L.jsx)(k.Text,{fontSize:13,lineHeight:18,color:"#8493A8",children:O(e)})]}),o?(0,L.jsxs)(h.YStack,{gap:"$1",alignItems:"flex-end",flexShrink:0,children:[s,u]}):(0,L.jsxs)(h.XStack,{gap:"$3",alignItems:"center",flexShrink:0,children:[s,u]})]})})},U=({provider:e,description:t,icon:n,onConnect:o,expanded:l=!1,compact:s=!1,children:u})=>(0,L.jsxs)(c.default,{style:G.row,children:[(0,L.jsxs)(h.XStack,{gap:"$3",alignItems:s?"flex-start":"center",children:[n,(0,L.jsxs)(h.YStack,{flex:1,minWidth:0,gap:"$1",children:[(0,L.jsx)(k.Text,{fontSize:16,lineHeight:22,fontWeight:"600",color:"#0F172A",children:e}),(0,L.jsx)(k.Text,{fontSize:13,lineHeight:18,color:"#8493A8",children:t})]}),(0,L.jsx)(c.default,{style:G.starterAction,children:(0,L.jsx)(j.ActionButton,{variant:"secondary",onPress:o,accessibilityLabel:l?`Hide ${e} setup`:`Connect ${e}`,children:l?"Hide setup":"Connect"})})]}),l?u:null]}),_=({compact:e=!1})=>{const n=(0,u.useQueryClient)(),[s,c]=t.default.useState(null),[p,f]=t.default.useState(!1),[C,R]=t.default.useState(!1),[w,$]=t.default.useState(!1),D=(0,u.useQuery)({queryKey:T.queryKeys.oauth.clients(),queryFn:P.listOAuthClients,staleTime:6e4,refetchOnWindowFocus:!0}),O=(0,u.useMutation)({mutationFn:P.revokeOAuthClient,onSuccess:async()=>{c("Connected app revoked."),await n.invalidateQueries({queryKey:T.queryKeys.oauth.clients()})},onError:e=>{c(e.message||"Failed to revoke connected app")}}),E=(0,u.useMutation)({mutationFn:P.clearRevokedOAuthClients,onSuccess:async({clearedClientCount:e})=>{$(!1),R(!1),c(1===e?"Revoked connected app cleared.":`${e} revoked connected apps cleared.`),await n.invalidateQueries({queryKey:T.queryKeys.oauth.clients()})},onError:e=>{$(!1),c(e.message||"Failed to clear revoked connected apps")}}),_=e=>{const t=z(e);(0,F.confirmDestructiveAction)(`Revoke ${t}?`,"It will stop working immediately. To reconnect, run the connector setup again in your MCP client.",()=>O.mutate(e.clientId))},Y=async(e,t)=>{c(null);try{await o.default.openURL(t)}catch(t){console.error(`[OAuthConnectionsList] Failed to open ${e}`,t),c(`${e} could not be opened. Please try again.`)}},q=D.data??[],K=q.filter(e=>e.hasActiveToken),N=K.filter(I),X=K.filter(H),Q=K.filter(e=>!I(e)&&!H(e)),V=q.filter(e=>!e.hasActiveToken),J=D.error,Z=404===J?.status||"not found"===(J?.message??"").toLowerCase().trim(),ee=D.isError&&!Z,te=t=>t.map(t=>(0,L.jsx)(M,{client:t,onRevoke:_,isRevoking:O.isPending,compact:e},t.id||t.clientId));return(0,L.jsxs)(h.YStack,{gap:"$3",children:[(0,L.jsxs)(h.YStack,{gap:"$1",children:[(0,L.jsx)(k.Text,{fontSize:12,lineHeight:16,fontWeight:"700",letterSpacing:1.2,color:"#94A3B8",children:"CONNECTED APPS"}),(0,L.jsx)(k.Text,{fontSize:14,lineHeight:20,color:"#7C8CA2",children:"MCP clients with access to your account."})]}),s?(0,L.jsx)(k.Text,{accessibilityRole:"alert",fontSize:13,lineHeight:18,color:"#334155",children:s}):null,D.isLoading?(0,L.jsx)(S.LoadingState,{message:"Loading connected apps...",variant:"inline"}):ee?(0,L.jsx)(k.Text,{fontSize:14,color:"#DC2626",children:J?.message||"Failed to load connected apps."}
7):(0,L.jsxs)(h.YStack,{borderTopWidth:1,borderTopColor:A.DS.color.border,children:[N.length?te(N):(0,L.jsx)(U,{provider:"Claude",description:"Use Super Carl from Claude with a custom MCP connector.",icon:(0,L.jsx)(B,{}),onConnect:()=>f(e=>!e),expanded:p,compact:e,children:(0,L.jsxs)(h.YStack,{gap:"$3",marginLeft:e?0:52,marginTop:"$4",paddingBottom:"$1",children:[(0,L.jsx)(k.Text,{fontSize:14,lineHeight:20,color:"#475569",children:"In Claude, open Settings \u2192 Capabilities and scroll to Connectors near the bottom (newer Claude versions: Customize \u2192 Connectors). Choose Add custom connector, name it Super Carl, and paste the endpoint below. Claude will open Super Carl sign-in to finish."}),(0,L.jsx)(v.McpEndpointCopyRow,{compact:e}),(0,L.jsx)(h.XStack,{children:(0,L.jsx)(j.ActionButton,{variant:"neutral",onPress:()=>{Y("Claude Connectors",b.CLAUDE_CONNECTORS_URL)},iconAfter:(0,L.jsx)(x.ExternalLink,{size:15}),children:"Open Claude connectors"})})]})}),X.length?te(X):(0,L.jsx)(U,{provider:"ChatGPT",description:"Add the Super Carl app to your ChatGPT conversations.",icon:(0,L.jsx)(W,{}),onConnect:()=>{Y("ChatGPT",b.CHATGPT_SUPER_CARL_APP_URL)},compact:e}),te(Q)]}),!D.isLoading&&!ee&&V.length>0?(0,L.jsxs)(h.YStack,{children:[(0,L.jsxs)(h.XStack,{justifyContent:"space-between",alignItems:"center",gap:"$3",flexWrap:"wrap",children:[(0,L.jsx)(l.default,{onPress:()=>R(e=>!e),accessibilityRole:"button",accessibilityLabel:C?"Hide revoked connected apps":"Show revoked connected apps",style:({pressed:e})=>[G.revokedToggle,e?G.textActionPressed:null],children:(0,L.jsx)(k.Text,{fontSize:14,lineHeight:20,fontWeight:"600",color:A.DS.color.primary,children:C?`Hide revoked (${V.length})`:`Show revoked (${V.length})`})}),C?(0,L.jsx)(j.ActionButton,{variant:"destructiveOutlined",onPress:()=>{c(null),$(!0)},disabled:E.isPending,accessibilityLabel:"Clear all revoked connected apps",children:"Clear all"}):null]}),C?(0,L.jsx)(h.YStack,{borderTopWidth:1,borderTopColor:A.DS.color.border,children:te(V)}):null]}):null,(0,L.jsx)(y.ConfirmModal,{visible:w,title:"Clear all revoked connected apps?",message:`Are you sure? This will permanently remove ${V.length} revoked connected app${1===V.length?"":"s"} from this list. Active connections will not be affected. This cannot be undone.`,confirmLabel:"Clear all",destructive:!0,loading:E.isPending,onCancel:()=>{E.isPending||$(!1)},onConfirm:()=>E.mutate()})]})},G=s.default.create({row:{paddingVertical:A.DS.space.md,borderBottomWidth:1,borderBottomColor:A.DS.color.border},iconTile:{width:46,height:46,borderRadius:12,alignItems:"center",justifyContent:"center",overflow:"hidden"},genericIconTile:{backgroundColor:"#F1F5F9"},logoImage:{width:28,height:28},chatGptLogoImage:{width:34,height:34},statusBadgeActive:{paddingHorizontal:12,paddingVertical:6,borderRadius:A.DS.radius.pill,backgroundColor:"#E4F7EC"},statusBadgeRevoked:{paddingHorizontal:12,paddingVertical:6,borderRadius:A.DS.radius.pill,backgroundColor:"#F1F5F9"},statusTextActive:{color:"#169B62",fontSize:12,lineHeight:16,fontWeight:"700"},statusTextRevoked:{color:"#7C8CA2",fontSize:12,lineHeight:16,fontWeight:"700"},starterAction:{flexShrink:0},textAction:{minHeight:40,justifyContent:"center",paddingHorizontal:4},textActionFlushRight:{paddingRight:0},textActionPressed:{opacity:.65},revokeText:{color:"#EF4444",fontSize:14,lineHeight:20,fontWeight:"600"},actionDisabled:{opacity:.55},revokedToggle:{alignSelf:"flex-start",minHeight:40,justifyContent:"center"}})},5650,[19,355,393,414,133,307,1073,2923,3610,6134,5651,5652,5649,3557,2938,2786,2940,2771,5601,3021,5599,3834,2974,5647,2]); 8__d(function(g,r,i,a,m,e,d){m.exports={uri:"/assets/images/logos/chatgpt.ebae9fa7c48571049e4a446df7b4972c.png",width:192,height:108}},5651,[]); 9__d(function(g,r,i,a,m,_e,d){"use strict";Object.defineProperty(_e,'__esModule',{value:!0}),Object.defineProperty(_e,"default",{enumerable:!0,get:function(){return h}}),r(d[0]);var l,e=r(d[1]),t=(l=e)&&l.__esModule?l:{default:l},L=r(d[2]);var h=l=>(0,L.jsx)(t.default,{xmlns:"http://www.w3.org/2000/svg",fill:"hsl(14.8, 63.1%, 59.6%)",viewBox:"0 0 100 100",...l,children:(0,L.jsx)(e.Path,{d:"m19.6 66.5 19.7-11 .3-1-.3-.5h-1l-3.3-.2-11.2-.3L14 53l-9.5-.5-2.4-.5L0 49l.2-1.5 2-1.3 2.9.2 6.3.5 9.5.
96 6.9.4L38 49.1h1.6l.2-.7-.5-.4-.4-.4L29 41l-10.6-7-5.6-4.1-3-2-1.5-2-.6-4.2 2.7-3 3.7.3.9.2 3.7 2.9 8 6.1L37 36l1.5 1.2.6-.4.1-.3-.7-1.1L33 25l-6-10.4-2.7-4.3-.7-2.6c-.3-1-.4-2-.4-3l3-4.2L28 0l4.2.6L33.8 2l2.6 6 4.1 9.3L47 29.9l2 3.8 1 3.4.3 1h.7v-.5l.5-7.2 1-8.7 1-11.2.3-3.2 1.6-3.8 3-2L61 2.6l2 2.9-.3 1.8-1.1 7.7L59 27.1l-1.5 8.2h.9l1-1.1 4.1-5.4 6.9-8.6 3-3.5L77 13l2.3-1.8h4.3l3.1 4.7-1.4 4.9-4.4 5.6-3.7 4.7-5.3 7.1-3.2 5.7.3.4h.7l12-2.6 6.4-1.1 7.6-1.3 3.5 1.6.4 1.6-1.4 3.4-8.2 2-9.6 2-14.3 3.3-.2.1.2.3 6.4.6 2.8.2h6.8l12.6 1 3.3 2 1.9 2.7-.3 2-5.1 2.6-6.8-1.6-16-3.8-5.4-1.3h-.8v.4l4.6 4.5 8.3 7.5L89 80.1l.5 2.4-1.3 2-1.4-.2-9.2-7-3.6-3-8-6.8h-.5v.7l1.8 2.7 9.8 14.7.5 4.5-.7 1.4-2.6 1-2.7-.6-5.8-8-6-9-4.7-8.2-.5.4-2.9 30.2-1.3 1.5-3 1.2-2.5-2-1.4-3 1.4-6.2 1.6-8 1.3-6.4 1.2-7.9.7-2.6v-.2H49L43 72l-9 12.3-7.2 7.6-1.7.7-3-1.5.3-2.8L24 86l10-12.8 6-7.9 4-4.6-.1-.5h-.3L17.2 77.4l-4.7.6-2-2 .2-3 1-1 8-5.5Z"})})},5652,[19,6138,2]);
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.