@ai-development-environment/server 0.0.45 → 0.0.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/actions/page_client-reference-manifest.js +1 -1
  6. package/standalone/.next/server/app/[locale]/actions-cache/page_client-reference-manifest.js +1 -1
  7. package/standalone/.next/server/app/[locale]/agents/[id]/page_client-reference-manifest.js +1 -1
  8. package/standalone/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
  9. package/standalone/.next/server/app/[locale]/analytics-events/page_client-reference-manifest.js +1 -1
  10. package/standalone/.next/server/app/[locale]/build-data/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  12. package/standalone/.next/server/app/[locale]/builds/[buildId]/page_client-reference-manifest.js +1 -1
  13. package/standalone/.next/server/app/[locale]/builds/page_client-reference-manifest.js +1 -1
  14. package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  15. package/standalone/.next/server/app/[locale]/codebases/page_client-reference-manifest.js +1 -1
  16. package/standalone/.next/server/app/[locale]/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/comments/page_client-reference-manifest.js +1 -1
  18. package/standalone/.next/server/app/[locale]/console-logs/page_client-reference-manifest.js +1 -1
  19. package/standalone/.next/server/app/[locale]/credentials/page_client-reference-manifest.js +1 -1
  20. package/standalone/.next/server/app/[locale]/devices/[id]/page_client-reference-manifest.js +1 -1
  21. package/standalone/.next/server/app/[locale]/devices/enroll/page_client-reference-manifest.js +1 -1
  22. package/standalone/.next/server/app/[locale]/devices/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/jira/cache/page_client-reference-manifest.js +1 -1
  24. package/standalone/.next/server/app/[locale]/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  25. package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  26. package/standalone/.next/server/app/[locale]/jira/tickets/page_client-reference-manifest.js +1 -1
  27. package/standalone/.next/server/app/[locale]/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  28. package/standalone/.next/server/app/[locale]/notifications/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  30. package/standalone/.next/server/app/[locale]/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  31. package/standalone/.next/server/app/[locale]/provisioning-profiles/page_client-reference-manifest.js +1 -1
  32. package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  33. package/standalone/.next/server/app/[locale]/pull-requests/page_client-reference-manifest.js +1 -1
  34. package/standalone/.next/server/app/[locale]/push-notifications/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
  36. package/standalone/.next/server/app/[locale]/skills/[skillId]/page_client-reference-manifest.js +1 -1
  37. package/standalone/.next/server/app/[locale]/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  38. package/standalone/.next/server/app/[locale]/skills/groups/page_client-reference-manifest.js +1 -1
  39. package/standalone/.next/server/app/[locale]/skills/page_client-reference-manifest.js +1 -1
  40. package/standalone/.next/server/app/[locale]/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/tools/page_client-reference-manifest.js +1 -1
  42. package/standalone/.next/server/app/[locale]/unified-events/page_client-reference-manifest.js +1 -1
  43. package/standalone/.next/server/app/[locale]/usage/page_client-reference-manifest.js +1 -1
  44. package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  45. package/standalone/.next/server/app/[locale]/worktrees/page_client-reference-manifest.js +1 -1
  46. package/standalone/.next/server/app/_global-error.html +1 -1
  47. package/standalone/.next/server/app/_global-error.rsc +1 -1
  48. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  49. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  50. package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  51. package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  52. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  53. package/standalone/.next/server/app/_not-found.html +1 -1
  54. package/standalone/.next/server/app/_not-found.rsc +1 -1
  55. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  56. package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  57. package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  58. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  59. package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  60. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  61. package/standalone/.next/server/chunks/ssr/_0dvnys0._.js +4 -4
  62. package/standalone/.next/server/chunks/ssr/_0k5jx04._.js +4 -4
  63. package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
  64. package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
  65. package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
  66. package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
  67. package/standalone/.next/server/chunks/ssr/src_components_settings-page_tsx_06dxqc7._.js +31 -31
  68. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  69. package/standalone/.next/server/pages/404.html +1 -1
  70. package/standalone/.next/server/pages/500.html +1 -1
  71. package/standalone/.next/server/server-reference-manifest.js +1 -1
  72. package/standalone/.next/server/server-reference-manifest.json +1 -1
  73. package/standalone/.next/static/chunks/{0zha00anzjjeh.js → 0eibx0a-j2s56.js} +4 -4
  74. package/standalone/.next/static/chunks/{2xeugqh9w5yfk.js → 0ftq0sdx2ck_7.js} +4 -4
  75. package/standalone/.next/static/chunks/1x-rxqwi4o4t2.css +1 -0
  76. package/standalone/.next/static/chunks/2t9stoad5r1nz.js +35 -0
  77. package/standalone/.next/static/chunks/1gz-q30e1qzuf.js +0 -35
  78. package/standalone/.next/static/chunks/2-6q03hqlurh2.css +0 -1
  79. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_buildManifest.js +0 -0
  80. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_clientMiddlewareManifest.js +0 -0
  81. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_ssgManifest.js +0 -0
@@ -0,0 +1,35 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,534710,e=>{"use strict";var t=e.i(843476),a=e.i(551757),s=e.i(452330),n=e.i(634398),r=e.i(758925),i=e.i(825398),l=e.i(856522),o=e.i(584026),c=e.i(573474);let d=(0,e.i(456420).default)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);var u=e.i(725981),p=e.i(861745),m=e.i(948148),x=e.i(271645),h=e.i(340953),g=e.i(567745),f=e.i(77071),j=e.i(929592),v=e.i(487486),S=e.i(519455),C=e.i(515288),b=e.i(793479),y=e.i(110204),N=e.i(987968),k=e.i(637611),w=e.i(45407);function I(){let e=(0,m.useTranslations)("cacheServerSettings"),s=(0,m.useTranslations)("common"),[n,r]=(0,x.useState)(null),[i,o]=(0,x.useState)(""),[u,p]=(0,x.useState)(""),[I,E]=(0,x.useState)([]),[A,T]=(0,x.useState)(!0),[D,P]=(0,x.useState)(!1),[L,R]=(0,x.useState)(null),[H,K]=(0,x.useState)(null),q=(0,x.useCallback)(e=>{r(e),o(e.baseUrl??""),p(""),E(e.headers.map(e=>({...e,value:""})))},[]),$=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${w.CACHE_SERVER_SETTINGS_FIELDS} } }`);q(e.cacheServerSettings)}catch(e){R(e instanceof Error?e.message:String(e))}finally{T(!1)}},[q]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void $(),0);return()=>window.clearTimeout(e)},[$]);let F=(e,t,a)=>E(s=>s.map((s,n)=>n===e?{...s,[t]:a,..."name"===t&&a!==s.name?{valueConfigured:!1}:{}}:s)),G=async t=>{t.preventDefault(),P(!0);try{let t=I.map(e=>({name:e.name.trim(),value:e.value||null})).filter(e=>e.name),a=await (0,k.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
2
+ saveCacheServerSettings(input: $input) { ${w.CACHE_SERVER_SETTINGS_FIELDS} }
3
+ }`,{input:{baseUrl:i.trim(),apiKey:u||null,headers:t}});q(a.saveCacheServerSettings),R(null),K(e("saved"))}catch(e){R(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}},V=async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestCacheServerConnection {
4
+ testCacheServerConnection { ${w.CACHE_SERVER_SETTINGS_FIELDS} }
5
+ }`);q(t.testCacheServerConnection),R(null),K(e("connectionSucceeded"))}catch(e){R(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}},B=async()=>{P(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearCacheServerSettings {
6
+ clearCacheServerSettings { ${w.CACHE_SERVER_SETTINGS_FIELDS} }
7
+ }`);q(t.clearCacheServerSettings),R(null),K(e("removed"))}catch(e){R(e instanceof Error?e.message:String(e)),K(null)}finally{P(!1)}};return(0,t.jsx)("form",{onSubmit:G,children:(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.DatabaseZap,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(v.Badge,{className:n?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:n?.configured?e("configured"):e("notConfigured")})]}),A?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[L&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:L})}),H&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:H})]}),(0,t.jsx)("p",{className:"rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground",children:e("setupHelp")}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:e("baseUrl")}),(0,t.jsx)(b.Input,{autoComplete:"url",id:"cache-server-base-url",onChange:e=>o(e.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:i}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("baseUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:e("apiKey")}),(0,t.jsx)(b.Input,{autoComplete:"new-password",id:"cache-server-api-key",onChange:e=>p(e.target.value),placeholder:n?.apiKeyConfigured?e("apiKeyPlaceholderConfigured"):e("apiKeyPlaceholder"),required:!n?.apiKeyConfigured,type:"password",value:u}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:n?.apiKeyConfigured?e("apiKeyKeepHelp"):e("apiKeyHelp")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:e("headers")}),(0,t.jsxs)(S.Button,{onClick:()=>E(e=>[...e,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,t.jsx)(f.Plus,{}),e("addHeader")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersHelp")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersSetupHelp")}),0===I.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("noHeaders")}):(0,t.jsx)("div",{className:"space-y-2",children:I.map((a,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.Input,{"aria-label":e("headerName"),className:"flex-1",onChange:e=>F(s,"name",e.target.value),placeholder:e("headerName"),value:a.name}),(0,t.jsx)(b.Input,{"aria-label":e("headerValue"),autoComplete:"new-password",className:"flex-1",onChange:e=>F(s,"value",e.target.value),placeholder:a.valueConfigured?e("headerValuePlaceholderConfigured"):e("headerValue"),required:!a.valueConfigured,type:"password",value:a.value}),(0,t.jsx)(S.Button,{"aria-label":e("removeHeader"),onClick:()=>E(e=>e.filter((e,t)=>t!==s)),size:"icon",type:"button",variant:"ghost",children:(0,t.jsx)(c.Trash2,{})})]},s))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:B,title:e("confirmRemove"),trigger:(0,t.jsxs)(S.Button,{disabled:D||!n?.configured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{}),e("remove")]})}),(0,t.jsxs)(S.Button,{disabled:D||!n?.configured,onClick:()=>void V(),type:"button",variant:"outline",children:[(0,t.jsx)(d,{}),e("test")]}),(0,t.jsxs)(S.Button,{disabled:D,type:"submit",children:[D?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}var E=e.i(636162),A=e.i(741120),T=e.i(482022);function D({children:e,href:a}){return(0,t.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:a,rel:"noreferrer",target:"_blank",children:[e,(0,t.jsx)(T.ExternalLink,{"aria-hidden":"true",className:"size-3 shrink-0"})]})}var P=e.i(624687),L=e.i(360583),R=e.i(938882);function H(){let e=(0,m.useTranslations)("iosDeviceSettings"),s=(0,m.useTranslations)("common"),n=(0,p.useLocale)(),[i,d]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[T,H]=(0,x.useState)(""),[K,q]=(0,x.useState)(""),[$,F]=(0,x.useState)(""),[G,V]=(0,x.useState)(!1),[B,_]=(0,x.useState)(!0),[z,O]=(0,x.useState)(!1),[U,J]=(0,x.useState)(!1),[M,W]=(0,x.useState)(null),[Z,Y]=(0,x.useState)(null),X=(0,x.useCallback)(e=>{d(e),f(e.organizationName),I(e.profileIdentifier),H(e.appStoreConnectIssuerId??""),q(e.appStoreConnectKeyId??""),F("")},[]),Q=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query IosDeviceSettings {
8
+ iosDeviceSettings { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
9
+ }`);X(e.iosDeviceSettings)}catch(e){W(e instanceof Error?e.message:String(e))}finally{_(!1)}},[X]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void Q(),0);return()=>window.clearTimeout(e)},[Q]);let ee=t=>(0,L.formatDateValue)(t,"short",{locale:n,fallback:e("unavailable")}),et=async t=>{t.preventDefault(),O(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
10
+ saveIosProfileSettings(input: $input) { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
11
+ }`,{input:{organizationName:g,profileIdentifier:w}});X(t.saveIosProfileSettings),W(null),Y(e("profileSaved"))}catch(e){W(e instanceof Error?e.message:String(e)),Y(null)}finally{O(!1)}},ea=async()=>{O(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
12
+ regenerateIosProfileSigner { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
13
+ }`);X(t.regenerateIosProfileSigner),W(null),Y(e("signerRegenerated"))}catch(e){W(e instanceof Error?e.message:String(e)),Y(null)}finally{O(!1)}},es=async t=>{t.preventDefault(),J(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
14
+ saveAppStoreConnectSettings(input: $input) { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
15
+ }`,{input:{issuerId:T.trim(),keyId:K.trim(),privateKey:$||null}});X(t.saveAppStoreConnectSettings),W(null),Y(e("appleSaved"))}catch(e){W(e instanceof Error?e.message:String(e)),Y(null)}finally{J(!1)}},en=async()=>{J(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
16
+ testAppStoreConnectSettings { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
17
+ }`);X(t.testAppStoreConnectSettings),W(null),Y(e("appleTestSucceeded"))}catch(e){W(e instanceof Error?e.message:String(e)),Y(null),Q()}finally{J(!1)}},er=async()=>{J(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
18
+ clearAppStoreConnectSettings { ${R.IOS_DEVICE_SETTINGS_FIELDS} }
19
+ }`);X(t.clearAppStoreConnectSettings),W(null),Y(e("appleCleared"))}catch(e){W(e instanceof Error?e.message:String(e)),Y(null)}finally{J(!1)}},ei=async t=>{if(!t.name.toLowerCase().endsWith(".p8")){W(e("p8Invalid")),Y(null);return}try{let a=await t.text();if(!a.includes("-----BEGIN PRIVATE KEY-----")||!a.includes("-----END PRIVATE KEY-----")){W(e("p8Invalid")),Y(null);return}F(a),W(null),Y(e("p8Loaded",{filename:t.name}))}catch{W(e("p8ReadError")),Y(null)}};return(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(E.Apple,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),M&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:M})}),Z&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:Z})]}),B?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{})," ",e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{className:"space-y-4",onSubmit:et,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-4"})," ",e("profileTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("profileDescription")})]}),(0,t.jsx)(v.Badge,{variant:"outline",children:i?.signerConfigured?e("signerReady"):e("signerNotGenerated")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-organization-name",children:e("organizationName")}),(0,t.jsx)(b.Input,{id:"ios-organization-name",maxLength:100,onChange:e=>f(e.target.value),required:!0,value:g}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileOrganizationHelp")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-profile-identifier",children:e("profileIdentifier")}),(0,t.jsx)(b.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:e=>I(e.target.value),required:!0,spellCheck:!1,value:w}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileIdentifierHelp")})]})]}),i?.signerConfigured&&(0,t.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,t.jsx)("p",{children:e("signerCreated",{date:ee(i.signerCreatedAt)})}),(0,t.jsx)("p",{children:e("signerExpires",{date:ee(i.signerExpiresAt)})}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:i.signerFingerprint}),(0,t.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:e("unverifiedWarning")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("regenerateSigner"),cancelLabel:s("cancel"),description:e("regenerateDescription"),onConfirm:ea,title:e("regenerateTitle"),trigger:(0,t.jsxs)(S.Button,{disabled:z,type:"button",variant:"outline",children:[(0,t.jsx)(A.RefreshCw,{})," ",e("regenerateSigner")]})}),(0,t.jsxs)(S.Button,{disabled:z,type:"submit",children:[z?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveProfile")]})]})]}),(0,t.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:es,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(r.KeyRound,{className:"size-4"})," ",e("appleTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("appleDescription")})]}),(0,t.jsx)(v.Badge,{className:i?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:i?.appStoreConnectConfigured?e("verified"):e("notVerified")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("p",{className:"sm:col-span-2 text-xs text-muted-foreground",children:[e("appleSetupHelp")," ",(0,t.jsx)(D,{href:"https://appstoreconnect.apple.com/access/integrations/api",children:e("openApiKeys")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-issuer-id",children:e("issuerId")}),(0,t.jsx)(b.Input,{autoCapitalize:"none",id:"app-store-issuer-id",maxLength:100,onChange:e=>H(e.target.value),required:!0,spellCheck:!1,value:T})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-key-id",children:e("keyId")}),(0,t.jsx)(b.Input,{autoCapitalize:"characters",id:"app-store-key-id",maxLength:100,onChange:e=>q(e.target.value),required:!0,spellCheck:!1,value:K})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${G?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),V(!0)},onDragLeave:()=>V(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",V(!0)},onDrop:e=>{e.preventDefault(),V(!1);let t=e.dataTransfer.files.item(0);t&&ei(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"})," ",e("p8DropHint")]}),(0,t.jsx)(P.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"app-store-private-key",onChange:e=>F(e.target.value),placeholder:i?.appStoreConnectPrivateKeyConfigured?e("privateKeyConfiguredPlaceholder"):e("privateKeyPlaceholder"),required:!i?.appStoreConnectPrivateKeyConfigured,value:$}),(0,t.jsx)(b.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":e("chooseP8"),className:"mt-2 h-auto text-xs",onChange:e=>{let t=e.target.files?.item(0);t&&ei(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:i?.appStoreConnectPrivateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),(i?.appStoreConnectLastTestedAt||i?.appStoreConnectPrivateKeyFingerprint)&&(0,t.jsx)(j.Alert,{variant:i.appStoreConnectVerificationError?"destructive":"default",children:(0,t.jsxs)(j.AlertDescription,{children:[(0,t.jsx)("p",{className:"font-medium",children:i.appStoreConnectVerificationError?e("lastTestFailed",{date:ee(i.appStoreConnectLastTestedAt)}):e("lastVerified",{date:ee(i.appStoreConnectVerifiedAt)})}),i.appStoreConnectVerificationError&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:i.appStoreConnectVerificationError}),i.appStoreConnectPrivateKeyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:i.appStoreConnectPrivateKeyFingerprint})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("clear"),cancelLabel:s("cancel"),description:e("clearDescription"),onConfirm:er,title:e("clearTitle"),trigger:(0,t.jsxs)(S.Button,{disabled:U||!i?.appStoreConnectPrivateKeyConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{})," ",e("clear")]})}),(0,t.jsxs)(S.Button,{disabled:U||!i?.appStoreConnectPrivateKeyConfigured,onClick:()=>void en(),type:"button",variant:"outline",children:[(0,t.jsx)(A.RefreshCw,{})," ",e("retest")]}),(0,t.jsxs)(S.Button,{disabled:U,type:"submit",children:[U?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveAndVerify")]})]})]})]})]})})}var K=e.i(967489);let q=`
20
+ tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
21
+ tokenConfiguredAt tokenLastUsedAt tokenLastError
22
+ certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
23
+ `;function $(){let e=(0,m.useTranslations)("pushSettings"),a=(0,m.useTranslations)("common"),s=(0,p.useLocale)(),[n,i]=(0,x.useState)(null),[o,d]=(0,x.useState)(""),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[E,T]=(0,x.useState)(""),[P,R]=(0,x.useState)(""),[H,$]=(0,x.useState)("SANDBOX"),[F,G]=(0,x.useState)(""),[V,B]=(0,x.useState)(""),[_,z]=(0,x.useState)(!1),[O,U]=(0,x.useState)(null),J=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${q} } }`);i(e.pushNotificationSettings),d(e.pushNotificationSettings.tokenTeamId??""),f(e.pushNotificationSettings.tokenKeyId??"")}catch(e){U(e instanceof Error?e.message:String(e))}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void J(),0);return()=>window.clearTimeout(e)},[J]);let M=async e=>{e.preventDefault(),z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${q} } }`,{input:{teamId:o,keyId:g,privateKey:w||null}});i(e.saveApnsTokenSettings),I(""),U(null)}catch(e){U(e instanceof Error?e.message:String(e))}finally{z(!1)}},W=async e=>{e.preventDefault(),z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${q} } }`,{input:{name:E,topic:P,environment:H,p12Base64:F,passphrase:V}});i(e.addApnsCertificateCredential),T(""),R(""),G(""),B(""),U(null)}catch(e){U(e instanceof Error?e.message:String(e))}finally{z(!1)}};return(0,t.jsxs)(C.Card,{children:[(0,t.jsx)(C.CardHeader,{children:(0,t.jsx)(C.CardTitle,{children:e("title")})}),(0,t.jsxs)(C.CardContent,{className:"space-y-6",children:[O&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:O})}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:M,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("tokenAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tokenDescription")})]}),(0,t.jsx)(v.Badge,{variant:n?.tokenConfigured?"default":"secondary",children:n?.tokenConfigured?e("configured"):e("notConfigured")})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("tokenSetupHelp")," ",(0,t.jsx)(D,{href:"https://developer.apple.com/account/resources/authkeys/add",children:e("createTokenKey")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-team",children:e("teamId")}),(0,t.jsx)(b.Input,{id:"apns-team",onChange:e=>d(e.target.value),value:o})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-key",children:e("keyId")}),(0,t.jsx)(b.Input,{id:"apns-key",onChange:e=>f(e.target.value),value:g})]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("teamIdHelp")," ",(0,t.jsx)(D,{href:"https://developer.apple.com/account#MembershipDetailsCard",children:e("openMembership")})]}),(0,t.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-6",children:[(0,t.jsx)(u.Upload,{})," ",w?e("p8Ready"):n?.tokenConfigured?e("replaceP8"):e("chooseP8"),(0,t.jsx)(b.Input,{accept:".p8",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&t.text().then(I)},type:"file"})]}),n?.tokenPrivateKeyFingerprint&&(0,t.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",n.tokenPrivateKeyFingerprint]}),n?.tokenLastError&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:n.tokenLastError}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("removeTokenDescription"),onConfirm:async()=>{i((await (0,k.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${q} } }`)).clearApnsTokenSettings),d(""),f("")},title:e("removeToken"),trigger:(0,t.jsxs)(S.Button,{disabled:_||!n?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{})," ",e("remove")]})}),(0,t.jsxs)(S.Button,{disabled:_||!o||!g||!w&&!n?.tokenConfigured,type:"submit",children:[_?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]}),(0,t.jsx)("div",{className:"border-t"}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:W,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("certificateAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("certificateDescription")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("certificateSetupHelp")," ",(0,t.jsx)(D,{href:"https://developer.apple.com/account/resources/certificates/add",children:e("createCertificate")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("name")}),(0,t.jsx)(b.Input,{onChange:e=>T(e.target.value),value:E})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("topic")}),(0,t.jsx)(b.Input,{onChange:e=>R(e.target.value),value:P})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("environment")}),(0,t.jsxs)(K.Select,{onValueChange:$,value:H,children:[(0,t.jsx)(K.SelectTrigger,{children:(0,t.jsx)(K.SelectValue,{})}),(0,t.jsxs)(K.SelectContent,{children:[(0,t.jsx)(K.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,t.jsx)(K.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-5",children:[(0,t.jsx)(r.KeyRound,{})," ",F?e("p12Ready"):e("chooseP12"),(0,t.jsx)(b.Input,{accept:".p12,.pfx",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&new Promise((e,a)=>{let s=new FileReader;s.onerror=()=>a(s.error),s.onload=()=>e(String(s.result).split(",")[1]??""),s.readAsDataURL(t)}).then(G)},type:"file"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{children:e("passphrase")}),(0,t.jsx)(b.Input,{onChange:e=>B(e.target.value),type:"password",value:V})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(S.Button,{disabled:_||!E||!P||!F,type:"submit",children:[(0,t.jsx)(l.Save,{})," ",e("addCertificate")]})})]}),n?.certificates.map(n=>(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:n.name}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[n.topic," · ",n.environment]}),(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",n.fingerprint]}),n.expiresAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("expires",{date:(0,L.formatDateValue)(n.expiresAt,"short",{locale:s,showTime:!1})})}),n.lastTestedAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("lastTested",{date:(0,L.formatDateValue)(n.lastTestedAt,"short",{locale:s})})}),n.lastError&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:n.lastError})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(S.Button,{disabled:_,onClick:()=>void(async()=>{z(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${q} } }`,{id:n.id});i(e.retestApnsCertificateCredential),U(null)}catch(e){U(e instanceof Error?e.message:String(e)),await J()}finally{z(!1)}})(),size:"sm",variant:"outline",children:[(0,t.jsx)(A.RefreshCw,{})," ",e("retest")]}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("removeCertificateDescription"),onConfirm:async()=>{await (0,k.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:n.id}),await J()},title:e("removeCertificate"),trigger:(0,t.jsx)(S.Button,{size:"icon-sm",variant:"ghost",children:(0,t.jsx)(c.Trash2,{})})})]})]},n.id))]})]})}let F="siteUrl email tokenConfigured cacheTtlSeconds updatedAt";function G({embedded:e=!1}={}){let s=(0,m.useTranslations)("jiraSettings"),n=(0,m.useTranslations)("common"),[i,o]=(0,x.useState)(null),[u,p]=(0,x.useState)(""),[g,f]=(0,x.useState)(""),[w,I]=(0,x.useState)(""),[E,A]=(0,x.useState)(null),[T,P]=(0,x.useState)(!0),[L,R]=(0,x.useState)(!1),[H,K]=(0,x.useState)(null),[q,$]=(0,x.useState)(null),[V,B]=(0,x.useState)(!1),_=e=>{o(e),p(e.siteUrl??""),f(e.email??""),I("")},z=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query { jiraSettings { ${F} } }`);_(e.jiraSettings)}catch(e){K(e instanceof Error?e.message:String(e))}finally{P(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void z(),0);return()=>window.clearTimeout(e)},[z]);let O=async e=>{R(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${F} } }`,{input:{siteUrl:u,email:g,apiToken:w||null,resetSite:e}});_(t.saveJiraSettings),A(null),K(null),$(s("saved"))}catch(e){K(e instanceof Error?e.message:String(e)),$(null)}finally{R(!1)}},U=async()=>{R(!0);try{let e=await (0,k.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");A(e.testJiraConnection),K(null),$(s("connectionSucceeded"))}catch(e){A(null),K(e instanceof Error?e.message:String(e)),$(null)}finally{R(!1)}},J=async()=>{R(!0);try{let e=await (0,k.controlPlaneRequest)(`mutation { clearJiraCredentials { ${F} } }`);_(e.clearJiraCredentials),A(null),K(null),$(s("removed"))}catch(e){K(e instanceof Error?e.message:String(e))}finally{R(!1)}};return(0,t.jsxs)("section",{className:e?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!e&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:s("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s("description")})]}),T?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),s("loading")]}):(0,t.jsx)("form",{onSubmit:e=>{(e.preventDefault(),i?.siteUrl&&i.siteUrl!==u.trim().replace(/\/$/,""))?B(!0):O(!1)},children:(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.KeyRound,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:s("credentials")})]}),(0,t.jsx)(v.Badge,{className:i?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:i?.tokenConfigured?s("configured"):s("notConfigured")})]}),H&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:H})}),q&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:q})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:s("siteUrl")}),(0,t.jsx)(b.Input,{autoComplete:"url",id:"jira-site-url",onChange:e=>p(e.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:u}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("siteUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:s("email")}),(0,t.jsx)(b.Input,{autoComplete:"username",id:"jira-email",onChange:e=>f(e.target.value),required:!0,type:"email",value:g}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("accountHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:s("apiToken")}),(0,t.jsx)(b.Input,{autoComplete:"new-password",id:"jira-token",onChange:e=>I(e.target.value),placeholder:i?.tokenConfigured?s("tokenPlaceholderConfigured"):s("tokenPlaceholder"),required:!i?.tokenConfigured,type:"password",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?.tokenConfigured?s("tokenKeepHelp"):s("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[s("tokenAcquireHelp")," ",(0,t.jsx)(D,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:s("createToken")})]})]}),E&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:E.displayName}),(0,t.jsx)("p",{className:"text-muted-foreground",children:E.emailAddress??E.accountId})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:s("remove"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:J,title:s("confirmRemove"),trigger:(0,t.jsxs)(S.Button,{disabled:L||!i?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{}),s("remove")]})}),(0,t.jsxs)(S.Button,{disabled:L||!i?.tokenConfigured,onClick:()=>void U(),type:"button",variant:"outline",children:[(0,t.jsx)(d,{}),s("test")]}),(0,t.jsxs)(S.Button,{disabled:L,type:"submit",children:[L?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),s("save")]})]})]})})}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:n("continue"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:()=>O(!0),onOpenChange:B,open:V,title:s("confirmSiteChange")})]})}var V=e.i(468096);let B="tokenConfigured defaultJiraKeyRegex updatedAt",_="configured appId installationId privateKeyConfigured keyFingerprint appSlug accountLogin repositorySelection actionsPermission verifiedAt updatedAt";function z({children:e,description:a,id:s,title:n}){return(0,t.jsxs)("section",{"aria-labelledby":s,className:"min-w-0 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:s,children:n}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:e})]})}function O(){let e=(0,m.useTranslations)("editorSettings"),[a,n]=(0,x.useState)("CODE"),[r,i]=(0,x.useState)(!0),[o,c]=(0,x.useState)(!1),[d,u]=(0,x.useState)(null),[p,h]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{(0,k.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(e=>n(e.worktreeSettings.editorVariant)).catch(e=>h(e instanceof Error?e.message:String(e))).finally(()=>i(!1))},0);return()=>window.clearTimeout(e)},[]);let g=async()=>{c(!0);try{await (0,k.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
24
+ saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
25
+ }`,{editorVariant:a}),u(e("saved")),h(null)}catch(e){h(e instanceof Error?e.message:String(e)),u(null)}finally{c(!1)}};return(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Code2,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),p&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:p})}),d&&(0,t.jsx)(j.Alert,{children:(0,t.jsx)(j.AlertDescription,{children:d})}),r?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{})," ",e("loading")]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{className:"min-w-64 flex-1 space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"editor-variant",children:e("label")}),(0,t.jsxs)(K.Select,{onValueChange:e=>n(e),value:a,children:[(0,t.jsx)(K.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,t.jsx)(K.SelectValue,{})}),(0,t.jsxs)(K.SelectContent,{children:[(0,t.jsx)(K.SelectItem,{value:"CODE",children:e("code")}),(0,t.jsx)(K.SelectItem,{value:"CODE_INSIDERS",children:e("insiders")}),(0,t.jsx)(K.SelectItem,{value:"NONE",children:e("none")})]})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("setupHelp")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[(0,t.jsx)(D,{href:"https://code.visualstudio.com/download",children:e("downloadCode")}),(0,t.jsx)(D,{href:"https://code.visualstudio.com/insiders/",children:e("downloadInsiders")})]})]})]}),(0,t.jsxs)(S.Button,{disabled:o,onClick:()=>void g(),children:[o?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]})})}function U(){let e=(0,m.useTranslations)("githubAppSettings"),s=(0,m.useTranslations)("common"),n=(0,p.useLocale)(),[g,f]=(0,x.useState)(null),[w,I]=(0,x.useState)(""),[E,A]=(0,x.useState)(""),[T,R]=(0,x.useState)(""),[H,K]=(0,x.useState)(""),[q,$]=(0,x.useState)(!1),[F,G]=(0,x.useState)(!0),[V,B]=(0,x.useState)(!1),[z,O]=(0,x.useState)(null),[U,J]=(0,x.useState)(null),M=(0,x.useCallback)(e=>{f(e),I(e.appId??""),A(e.installationId??""),R("")},[]),W=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${_} } }`);M(e.githubAppSettings)}catch(e){O(e instanceof Error?e.message:String(e))}finally{G(!1)}},[M]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{K(window.location.origin),W()},0);return()=>window.clearTimeout(e)},[W]);let Z=async t=>{t.preventDefault(),B(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
26
+ saveGitHubAppSettings(input: $input) { ${_} }
27
+ }`,{input:{appId:w.trim(),installationId:E.trim(),privateKey:T||null}});M(t.saveGitHubAppSettings),O(null),J(T&&g?.configured?e("rotated"):e("saved"))}catch(e){O(e instanceof Error?e.message:String(e)),J(null)}finally{B(!1)}},Y=async()=>{B(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation TestGitHubAppConnection {
28
+ testGitHubAppConnection { ${_} }
29
+ }`);M(t.testGitHubAppConnection),O(null),J(e("connectionSucceeded"))}catch(e){O(e instanceof Error?e.message:String(e)),J(null)}finally{B(!1)}},X=async()=>{B(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
30
+ clearGitHubAppCredentials { ${_} }
31
+ }`);M(t.clearGitHubAppCredentials),O(null),J(e("removed"))}catch(e){O(e instanceof Error?e.message:String(e)),J(null)}finally{B(!1)}},Q=async t=>{if(!t.name.toLowerCase().endsWith(".pem")){O(e("pemFileInvalid")),J(null);return}try{let a=await t.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(a)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(a)){O(e("pemFileInvalid")),J(null);return}R(a),O(null),J(e("pemFileLoaded",{filename:t.name}))}catch{O(e("pemFileReadError")),J(null)}};return(0,t.jsx)("form",{onSubmit:Z,children:(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(v.Badge,{className:g?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:g?.configured?e("verified"):e("notConfigured")})]}),F?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[z&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:z})}),U&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:U})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,t.jsx)("h3",{className:"font-medium",children:e("setupTitle")}),(0,t.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,t.jsxs)("li",{children:[e("stepRegister")," ",(0,t.jsx)(D,{href:"https://github.com/settings/apps/new",children:e("registerLink")})]}),(0,t.jsxs)("li",{children:[e("stepHomepage")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:H}),e("stepHomepageSuffix")]}),(0,t.jsx)("li",{children:e("stepPermissions")}),(0,t.jsx)("li",{children:e("stepInstall")}),(0,t.jsxs)("li",{children:[e("stepInstallationId")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:"https://github.com/organizations/<Organization-name>/settings/installations/<ID>"}),e("stepInstallationIdSuffix")]}),(0,t.jsx)("li",{children:e("stepCredentials")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:e("appId")}),(0,t.jsx)(b.Input,{id:"github-app-id",inputMode:"numeric",onChange:e=>I(e.target.value),placeholder:e("appIdPlaceholder"),required:!0,value:w})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:e("installationId")}),(0,t.jsx)(b.Input,{id:"github-installation-id",inputMode:"numeric",onChange:e=>A(e.target.value),placeholder:e("installationIdPlaceholder"),required:!0,value:E})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${q?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),$(!0)},onDragLeave:()=>$(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",$(!0)},onDrop:e=>{e.preventDefault(),$(!1);let t=e.dataTransfer.files.item(0);t&&Q(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"}),e("pemDropHint")]}),(0,t.jsx)(P.Textarea,{autoComplete:"new-password",className:"min-h-40 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"github-app-private-key",onChange:e=>R(e.target.value),placeholder:g?.privateKeyConfigured?e("privateKeyPlaceholderConfigured"):e("privateKeyPlaceholder"),required:!g?.privateKeyConfigured,value:T})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:g?.privateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),g?.configured&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(r.KeyRound,{}),(0,t.jsxs)(j.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)("p",{className:"font-medium",children:e("connectedAs",{app:g.appSlug??"—",account:g.accountLogin??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("connectionDetails",{permission:g.actionsPermission??"—",selection:g.repositorySelection??"—"})}),g.verifiedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastVerified",{date:(0,L.formatDateValue)(g.verifiedAt,"short",{locale:n})})}),g.keyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:g.keyFingerprint})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:X,title:e("confirmRemove"),trigger:(0,t.jsxs)(S.Button,{disabled:V||!g?.configured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{}),e("remove")]})}),(0,t.jsxs)(S.Button,{disabled:V||!g?.configured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,t.jsx)(d,{}),e("test")]}),(0,t.jsxs)(S.Button,{disabled:V,type:"submit",children:[V?(0,t.jsx)(N.Spinner,{}):T&&g?.configured?(0,t.jsx)(i.RotateCw,{}):(0,t.jsx)(l.Save,{}),T&&g?.configured?e("rotate"):e("save")]})]})]})]})})})}function J(){let e=(0,m.useTranslations)("githubSettings"),s=(0,m.useTranslations)("common"),[r,i]=(0,x.useState)(null),[o,u]=(0,x.useState)(""),[p,g]=(0,x.useState)(null),[f,w]=(0,x.useState)(!0),[I,E]=(0,x.useState)(!1),[A,T]=(0,x.useState)(null),[P,L]=(0,x.useState)(null),R=e=>{i(e),u("")},H=(0,x.useCallback)(async()=>{try{let e=await (0,k.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${B} } }`);R(e.githubSettings)}catch(e){T(e instanceof Error?e.message:String(e))}finally{w(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void H(),0);return()=>window.clearTimeout(e)},[H]);let K=async t=>{t.preventDefault(),E(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
32
+ saveGitHubSettings(input: $input) { ${B} }
33
+ }`,{input:{apiToken:o||null}});R(t.saveGitHubSettings),g(null),T(null),L(e("saved"))}catch(e){T(e instanceof Error?e.message:String(e)),L(null)}finally{E(!1)}},q=async()=>{E(!0);try{let t=await (0,k.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");g(t.testGitHubConnection),T(null),L(e("connectionSucceeded"))}catch(e){g(null),T(e instanceof Error?e.message:String(e)),L(null)}finally{E(!1)}},$=async()=>{E(!0);try{let t=await (0,k.controlPlaneRequest)(`mutation ClearGitHubCredentials {
34
+ clearGitHubCredentials { ${B} }
35
+ }`);R(t.clearGitHubCredentials),g(null),T(null),L(e("removed"))}catch(e){T(e instanceof Error?e.message:String(e)),L(null)}finally{E(!1)}};return(0,t.jsx)("form",{onSubmit:K,children:(0,t.jsx)(C.Card,{children:(0,t.jsxs)(C.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.GitPullRequest,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(v.Badge,{className:r?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:r?.tokenConfigured?e("configured"):e("notConfigured")})]}),f?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(N.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[A&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:A})}),P&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:P})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:e("apiToken")}),(0,t.jsx)(b.Input,{autoComplete:"new-password",id:"github-token",onChange:e=>u(e.target.value),placeholder:r?.tokenConfigured?e("tokenPlaceholderConfigured"):e("tokenPlaceholder"),required:!r?.tokenConfigured,type:"password",value:o}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?.tokenConfigured?e("tokenKeepHelp"):e("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("tokenAcquireHelp")," ",(0,t.jsx)(D,{href:"https://github.com/settings/personal-access-tokens/new",children:e("createToken")})]})]}),p&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:p.name??p.login}),(0,t.jsxs)("a",{className:"text-sm text-primary hover:underline",href:p.url,rel:"noreferrer",target:"_blank",children:["@",p.login]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:$,title:e("confirmRemove"),trigger:(0,t.jsxs)(S.Button,{disabled:I||!r?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(c.Trash2,{}),e("remove")]})}),(0,t.jsxs)(S.Button,{disabled:I||!r?.tokenConfigured,onClick:()=>void q(),type:"button",variant:"outline",children:[(0,t.jsx)(d,{}),e("test")]}),(0,t.jsxs)(S.Button,{disabled:I,type:"submit",children:[I?(0,t.jsx)(N.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}e.s(["SettingsPage",0,function(){let e=(0,m.useTranslations)("settings");return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(V.DatabaseEncryptionAlert,{}),(0,t.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,t.jsx)(z,{description:e("developmentGroupDescription"),id:"settings-development",title:e("developmentGroup"),children:(0,t.jsx)(O,{})}),(0,t.jsxs)(z,{description:e("appleGroupDescription"),id:"settings-apple",title:e("appleGroup"),children:[(0,t.jsx)(H,{}),(0,t.jsx)($,{})]})]}),(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsxs)(z,{description:e("integrationsGroupDescription"),id:"settings-integrations",title:e("integrationsGroup"),children:[(0,t.jsx)(G,{embedded:!0}),(0,t.jsx)(J,{}),(0,t.jsx)(U,{}),(0,t.jsx)(I,{})]})})]})]})}],534710)}]);
@@ -1,35 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,534710,e=>{"use strict";var t=e.i(843476),a=e.i(551757),s=e.i(452330),n=e.i(482022),r=e.i(634398),i=e.i(758925),l=e.i(825398),o=e.i(856522),c=e.i(584026),d=e.i(573474);let u=(0,e.i(456420).default)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);var m=e.i(725981),p=e.i(861745),x=e.i(948148),g=e.i(271645),h=e.i(340953),f=e.i(567745),j=e.i(77071),v=e.i(929592),S=e.i(487486),C=e.i(519455),b=e.i(515288),y=e.i(793479),N=e.i(110204),k=e.i(987968),w=e.i(637611),I=e.i(45407);function E(){let e=(0,x.useTranslations)("cacheServerSettings"),s=(0,x.useTranslations)("common"),[n,r]=(0,g.useState)(null),[i,l]=(0,g.useState)(""),[c,m]=(0,g.useState)(""),[p,E]=(0,g.useState)([]),[A,T]=(0,g.useState)(!0),[D,P]=(0,g.useState)(!1),[L,R]=(0,g.useState)(null),[K,q]=(0,g.useState)(null),$=(0,g.useCallback)(e=>{r(e),l(e.baseUrl??""),m(""),E(e.headers.map(e=>({...e,value:""})))},[]),H=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${I.CACHE_SERVER_SETTINGS_FIELDS} } }`);$(e.cacheServerSettings)}catch(e){R(e instanceof Error?e.message:String(e))}finally{T(!1)}},[$]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>void H(),0);return()=>window.clearTimeout(e)},[H]);let F=(e,t,a)=>E(s=>s.map((s,n)=>n===e?{...s,[t]:a,..."name"===t&&a!==s.name?{valueConfigured:!1}:{}}:s)),G=async t=>{t.preventDefault(),P(!0);try{let t=p.map(e=>({name:e.name.trim(),value:e.value||null})).filter(e=>e.name),a=await (0,w.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
2
- saveCacheServerSettings(input: $input) { ${I.CACHE_SERVER_SETTINGS_FIELDS} }
3
- }`,{input:{baseUrl:i.trim(),apiKey:c||null,headers:t}});$(a.saveCacheServerSettings),R(null),q(e("saved"))}catch(e){R(e instanceof Error?e.message:String(e)),q(null)}finally{P(!1)}},V=async()=>{P(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation TestCacheServerConnection {
4
- testCacheServerConnection { ${I.CACHE_SERVER_SETTINGS_FIELDS} }
5
- }`);$(t.testCacheServerConnection),R(null),q(e("connectionSucceeded"))}catch(e){R(e instanceof Error?e.message:String(e)),q(null)}finally{P(!1)}},B=async()=>{P(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation ClearCacheServerSettings {
6
- clearCacheServerSettings { ${I.CACHE_SERVER_SETTINGS_FIELDS} }
7
- }`);$(t.clearCacheServerSettings),R(null),q(e("removed"))}catch(e){R(e instanceof Error?e.message:String(e)),q(null)}finally{P(!1)}};return(0,t.jsx)("form",{onSubmit:G,children:(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(f.DatabaseZap,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(S.Badge,{className:n?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:n?.configured?e("configured"):e("notConfigured")})]}),A?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[L&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:L})}),K&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(v.AlertDescription,{className:"text-current",children:K})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:e("baseUrl")}),(0,t.jsx)(y.Input,{autoComplete:"url",id:"cache-server-base-url",onChange:e=>l(e.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:i}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("baseUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:e("apiKey")}),(0,t.jsx)(y.Input,{autoComplete:"new-password",id:"cache-server-api-key",onChange:e=>m(e.target.value),placeholder:n?.apiKeyConfigured?e("apiKeyPlaceholderConfigured"):e("apiKeyPlaceholder"),required:!n?.apiKeyConfigured,type:"password",value:c}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:n?.apiKeyConfigured?e("apiKeyKeepHelp"):e("apiKeyHelp")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(N.Label,{className:"text-sm font-medium",children:e("headers")}),(0,t.jsxs)(C.Button,{onClick:()=>E(e=>[...e,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,t.jsx)(j.Plus,{}),e("addHeader")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersHelp")}),0===p.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("noHeaders")}):(0,t.jsx)("div",{className:"space-y-2",children:p.map((a,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(y.Input,{"aria-label":e("headerName"),className:"flex-1",onChange:e=>F(s,"name",e.target.value),placeholder:e("headerName"),value:a.name}),(0,t.jsx)(y.Input,{"aria-label":e("headerValue"),autoComplete:"new-password",className:"flex-1",onChange:e=>F(s,"value",e.target.value),placeholder:a.valueConfigured?e("headerValuePlaceholderConfigured"):e("headerValue"),required:!a.valueConfigured,type:"password",value:a.value}),(0,t.jsx)(C.Button,{"aria-label":e("removeHeader"),onClick:()=>E(e=>e.filter((e,t)=>t!==s)),size:"icon",type:"button",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})]},s))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:B,title:e("confirmRemove"),trigger:(0,t.jsxs)(C.Button,{disabled:D||!n?.configured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(C.Button,{disabled:D||!n?.configured,onClick:()=>void V(),type:"button",variant:"outline",children:[(0,t.jsx)(u,{}),e("test")]}),(0,t.jsxs)(C.Button,{disabled:D,type:"submit",children:[D?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{}),e("save")]})]})]})]})})})}var A=e.i(636162),T=e.i(741120),D=e.i(624687),P=e.i(360583),L=e.i(938882);function R(){let e=(0,x.useTranslations)("iosDeviceSettings"),s=(0,x.useTranslations)("common"),n=(0,p.useLocale)(),[r,l]=(0,g.useState)(null),[u,f]=(0,g.useState)(""),[j,I]=(0,g.useState)(""),[E,R]=(0,g.useState)(""),[K,q]=(0,g.useState)(""),[$,H]=(0,g.useState)(""),[F,G]=(0,g.useState)(!1),[V,B]=(0,g.useState)(!0),[_,z]=(0,g.useState)(!1),[U,O]=(0,g.useState)(!1),[J,M]=(0,g.useState)(null),[W,Z]=(0,g.useState)(null),Y=(0,g.useCallback)(e=>{l(e),f(e.organizationName),I(e.profileIdentifier),R(e.appStoreConnectIssuerId??""),q(e.appStoreConnectKeyId??""),H("")},[]),X=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query IosDeviceSettings {
8
- iosDeviceSettings { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
9
- }`);Y(e.iosDeviceSettings)}catch(e){M(e instanceof Error?e.message:String(e))}finally{B(!1)}},[Y]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>void X(),0);return()=>window.clearTimeout(e)},[X]);let Q=t=>(0,P.formatDateValue)(t,"short",{locale:n,fallback:e("unavailable")}),ee=async t=>{t.preventDefault(),z(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
10
- saveIosProfileSettings(input: $input) { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
11
- }`,{input:{organizationName:u,profileIdentifier:j}});Y(t.saveIosProfileSettings),M(null),Z(e("profileSaved"))}catch(e){M(e instanceof Error?e.message:String(e)),Z(null)}finally{z(!1)}},et=async()=>{z(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
12
- regenerateIosProfileSigner { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
13
- }`);Y(t.regenerateIosProfileSigner),M(null),Z(e("signerRegenerated"))}catch(e){M(e instanceof Error?e.message:String(e)),Z(null)}finally{z(!1)}},ea=async t=>{t.preventDefault(),O(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
14
- saveAppStoreConnectSettings(input: $input) { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
15
- }`,{input:{issuerId:E.trim(),keyId:K.trim(),privateKey:$||null}});Y(t.saveAppStoreConnectSettings),M(null),Z(e("appleSaved"))}catch(e){M(e instanceof Error?e.message:String(e)),Z(null)}finally{O(!1)}},es=async()=>{O(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
16
- testAppStoreConnectSettings { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
17
- }`);Y(t.testAppStoreConnectSettings),M(null),Z(e("appleTestSucceeded"))}catch(e){M(e instanceof Error?e.message:String(e)),Z(null),X()}finally{O(!1)}},en=async()=>{O(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
18
- clearAppStoreConnectSettings { ${L.IOS_DEVICE_SETTINGS_FIELDS} }
19
- }`);Y(t.clearAppStoreConnectSettings),M(null),Z(e("appleCleared"))}catch(e){M(e instanceof Error?e.message:String(e)),Z(null)}finally{O(!1)}},er=async t=>{if(!t.name.toLowerCase().endsWith(".p8")){M(e("p8Invalid")),Z(null);return}try{let a=await t.text();if(!a.includes("-----BEGIN PRIVATE KEY-----")||!a.includes("-----END PRIVATE KEY-----")){M(e("p8Invalid")),Z(null);return}H(a),M(null),Z(e("p8Loaded",{filename:t.name}))}catch{M(e("p8ReadError")),Z(null)}};return(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(A.Apple,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),J&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:J})}),W&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(v.AlertDescription,{className:"text-current",children:W})]}),V?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{className:"space-y-4",onSubmit:ee,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(c.ShieldCheck,{className:"size-4"})," ",e("profileTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("profileDescription")})]}),(0,t.jsx)(S.Badge,{variant:"outline",children:r?.signerConfigured?e("signerReady"):e("signerNotGenerated")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(N.Label,{htmlFor:"ios-organization-name",children:e("organizationName")}),(0,t.jsx)(y.Input,{id:"ios-organization-name",maxLength:100,onChange:e=>f(e.target.value),required:!0,value:u})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(N.Label,{htmlFor:"ios-profile-identifier",children:e("profileIdentifier")}),(0,t.jsx)(y.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:e=>I(e.target.value),required:!0,spellCheck:!1,value:j})]})]}),r?.signerConfigured&&(0,t.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,t.jsx)("p",{children:e("signerCreated",{date:Q(r.signerCreatedAt)})}),(0,t.jsx)("p",{children:e("signerExpires",{date:Q(r.signerExpiresAt)})}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:r.signerFingerprint}),(0,t.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:e("unverifiedWarning")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("regenerateSigner"),cancelLabel:s("cancel"),description:e("regenerateDescription"),onConfirm:et,title:e("regenerateTitle"),trigger:(0,t.jsxs)(C.Button,{disabled:_,type:"button",variant:"outline",children:[(0,t.jsx)(T.RefreshCw,{})," ",e("regenerateSigner")]})}),(0,t.jsxs)(C.Button,{disabled:_,type:"submit",children:[_?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{})," ",e("saveProfile")]})]})]}),(0,t.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:ea,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(i.KeyRound,{className:"size-4"})," ",e("appleTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("appleDescription")})]}),(0,t.jsx)(S.Badge,{className:r?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:r?.appStoreConnectConfigured?e("verified"):e("notVerified")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(N.Label,{htmlFor:"app-store-issuer-id",children:e("issuerId")}),(0,t.jsx)(y.Input,{autoCapitalize:"none",id:"app-store-issuer-id",maxLength:100,onChange:e=>R(e.target.value),required:!0,spellCheck:!1,value:E})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(N.Label,{htmlFor:"app-store-key-id",children:e("keyId")}),(0,t.jsx)(y.Input,{autoCapitalize:"characters",id:"app-store-key-id",maxLength:100,onChange:e=>q(e.target.value),required:!0,spellCheck:!1,value:K})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(N.Label,{htmlFor:"app-store-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${F?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),G(!0)},onDragLeave:()=>G(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",G(!0)},onDrop:e=>{e.preventDefault(),G(!1);let t=e.dataTransfer.files.item(0);t&&er(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(m.Upload,{className:"size-3.5"})," ",e("p8DropHint")]}),(0,t.jsx)(D.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"app-store-private-key",onChange:e=>H(e.target.value),placeholder:r?.appStoreConnectPrivateKeyConfigured?e("privateKeyConfiguredPlaceholder"):e("privateKeyPlaceholder"),required:!r?.appStoreConnectPrivateKeyConfigured,value:$}),(0,t.jsx)(y.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":e("chooseP8"),className:"mt-2 h-auto text-xs",onChange:e=>{let t=e.target.files?.item(0);t&&er(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:r?.appStoreConnectPrivateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),(r?.appStoreConnectLastTestedAt||r?.appStoreConnectPrivateKeyFingerprint)&&(0,t.jsx)(v.Alert,{variant:r.appStoreConnectVerificationError?"destructive":"default",children:(0,t.jsxs)(v.AlertDescription,{children:[(0,t.jsx)("p",{className:"font-medium",children:r.appStoreConnectVerificationError?e("lastTestFailed",{date:Q(r.appStoreConnectLastTestedAt)}):e("lastVerified",{date:Q(r.appStoreConnectVerifiedAt)})}),r.appStoreConnectVerificationError&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:r.appStoreConnectVerificationError}),r.appStoreConnectPrivateKeyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:r.appStoreConnectPrivateKeyFingerprint})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("clear"),cancelLabel:s("cancel"),description:e("clearDescription"),onConfirm:en,title:e("clearTitle"),trigger:(0,t.jsxs)(C.Button,{disabled:U||!r?.appStoreConnectPrivateKeyConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("clear")]})}),(0,t.jsxs)(C.Button,{disabled:U||!r?.appStoreConnectPrivateKeyConfigured,onClick:()=>void es(),type:"button",variant:"outline",children:[(0,t.jsx)(T.RefreshCw,{})," ",e("retest")]}),(0,t.jsxs)(C.Button,{disabled:U,type:"submit",children:[U?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{})," ",e("saveAndVerify")]})]})]})]})]})})}var K=e.i(967489);let q=`
20
- tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
21
- tokenConfiguredAt tokenLastUsedAt tokenLastError
22
- certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
23
- `;function $(){let e=(0,x.useTranslations)("pushSettings"),a=(0,x.useTranslations)("common"),s=(0,p.useLocale)(),[n,r]=(0,g.useState)(null),[l,c]=(0,g.useState)(""),[u,f]=(0,g.useState)(""),[j,I]=(0,g.useState)(""),[E,A]=(0,g.useState)(""),[D,L]=(0,g.useState)(""),[R,$]=(0,g.useState)("SANDBOX"),[H,F]=(0,g.useState)(""),[G,V]=(0,g.useState)(""),[B,_]=(0,g.useState)(!1),[z,U]=(0,g.useState)(null),O=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${q} } }`);r(e.pushNotificationSettings),c(e.pushNotificationSettings.tokenTeamId??""),f(e.pushNotificationSettings.tokenKeyId??"")}catch(e){U(e instanceof Error?e.message:String(e))}},[]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>void O(),0);return()=>window.clearTimeout(e)},[O]);let J=async e=>{e.preventDefault(),_(!0);try{let e=await (0,w.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${q} } }`,{input:{teamId:l,keyId:u,privateKey:j||null}});r(e.saveApnsTokenSettings),I(""),U(null)}catch(e){U(e instanceof Error?e.message:String(e))}finally{_(!1)}},M=async e=>{e.preventDefault(),_(!0);try{let e=await (0,w.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${q} } }`,{input:{name:E,topic:D,environment:R,p12Base64:H,passphrase:G}});r(e.addApnsCertificateCredential),A(""),L(""),F(""),V(""),U(null)}catch(e){U(e instanceof Error?e.message:String(e))}finally{_(!1)}};return(0,t.jsxs)(b.Card,{children:[(0,t.jsx)(b.CardHeader,{children:(0,t.jsx)(b.CardTitle,{children:e("title")})}),(0,t.jsxs)(b.CardContent,{className:"space-y-6",children:[z&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:z})}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:J,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("tokenAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tokenDescription")})]}),(0,t.jsx)(S.Badge,{variant:n?.tokenConfigured?"default":"secondary",children:n?.tokenConfigured?e("configured"):e("notConfigured")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{htmlFor:"apns-team",children:e("teamId")}),(0,t.jsx)(y.Input,{id:"apns-team",onChange:e=>c(e.target.value),value:l})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{htmlFor:"apns-key",children:e("keyId")}),(0,t.jsx)(y.Input,{id:"apns-key",onChange:e=>f(e.target.value),value:u})]})]}),(0,t.jsxs)(N.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-6",children:[(0,t.jsx)(m.Upload,{})," ",j?e("p8Ready"):n?.tokenConfigured?e("replaceP8"):e("chooseP8"),(0,t.jsx)(y.Input,{accept:".p8",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&t.text().then(I)},type:"file"})]}),n?.tokenPrivateKeyFingerprint&&(0,t.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",n.tokenPrivateKeyFingerprint]}),n?.tokenLastError&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:n.tokenLastError}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("removeTokenDescription"),onConfirm:async()=>{r((await (0,w.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${q} } }`)).clearApnsTokenSettings),c(""),f("")},title:e("removeToken"),trigger:(0,t.jsxs)(C.Button,{disabled:B||!n?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("remove")]})}),(0,t.jsxs)(C.Button,{disabled:B||!l||!u||!j&&!n?.tokenConfigured,type:"submit",children:[B?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{})," ",e("save")]})]})]}),(0,t.jsx)("div",{className:"border-t"}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:M,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("certificateAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("certificateDescription")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{children:e("name")}),(0,t.jsx)(y.Input,{onChange:e=>A(e.target.value),value:E})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{children:e("topic")}),(0,t.jsx)(y.Input,{onChange:e=>L(e.target.value),value:D})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{children:e("environment")}),(0,t.jsxs)(K.Select,{onValueChange:$,value:R,children:[(0,t.jsx)(K.SelectTrigger,{children:(0,t.jsx)(K.SelectValue,{})}),(0,t.jsxs)(K.SelectContent,{children:[(0,t.jsx)(K.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,t.jsx)(K.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)(N.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-5",children:[(0,t.jsx)(i.KeyRound,{})," ",H?e("p12Ready"):e("chooseP12"),(0,t.jsx)(y.Input,{accept:".p12,.pfx",className:"sr-only",onChange:e=>{let t=e.target.files?.[0];t&&new Promise((e,a)=>{let s=new FileReader;s.onerror=()=>a(s.error),s.onload=()=>e(String(s.result).split(",")[1]??""),s.readAsDataURL(t)}).then(F)},type:"file"})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(N.Label,{children:e("passphrase")}),(0,t.jsx)(y.Input,{onChange:e=>V(e.target.value),type:"password",value:G})]})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(C.Button,{disabled:B||!E||!D||!H,type:"submit",children:[(0,t.jsx)(o.Save,{})," ",e("addCertificate")]})})]}),n?.certificates.map(n=>(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:n.name}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[n.topic," · ",n.environment]}),(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",n.fingerprint]}),n.expiresAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("expires",{date:(0,P.formatDateValue)(n.expiresAt,"short",{locale:s,showTime:!1})})}),n.lastTestedAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("lastTested",{date:(0,P.formatDateValue)(n.lastTestedAt,"short",{locale:s})})}),n.lastError&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:n.lastError})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(C.Button,{disabled:B,onClick:()=>void(async()=>{_(!0);try{let e=await (0,w.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${q} } }`,{id:n.id});r(e.retestApnsCertificateCredential),U(null)}catch(e){U(e instanceof Error?e.message:String(e)),await O()}finally{_(!1)}})(),size:"sm",variant:"outline",children:[(0,t.jsx)(T.RefreshCw,{})," ",e("retest")]}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:a("cancel"),description:e("removeCertificateDescription"),onConfirm:async()=>{await (0,w.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:n.id}),await O()},title:e("removeCertificate"),trigger:(0,t.jsx)(C.Button,{size:"icon-sm",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})})]})]},n.id))]})]})}let H="siteUrl email tokenConfigured cacheTtlSeconds updatedAt";function F({embedded:e=!1}={}){let s=(0,x.useTranslations)("jiraSettings"),n=(0,x.useTranslations)("common"),[r,l]=(0,g.useState)(null),[c,m]=(0,g.useState)(""),[p,f]=(0,g.useState)(""),[j,I]=(0,g.useState)(""),[E,A]=(0,g.useState)(null),[T,D]=(0,g.useState)(!0),[P,L]=(0,g.useState)(!1),[R,K]=(0,g.useState)(null),[q,$]=(0,g.useState)(null),[G,V]=(0,g.useState)(!1),B=e=>{l(e),m(e.siteUrl??""),f(e.email??""),I("")},_=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query { jiraSettings { ${H} } }`);B(e.jiraSettings)}catch(e){K(e instanceof Error?e.message:String(e))}finally{D(!1)}},[]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>void _(),0);return()=>window.clearTimeout(e)},[_]);let z=async e=>{L(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${H} } }`,{input:{siteUrl:c,email:p,apiToken:j||null,resetSite:e}});B(t.saveJiraSettings),A(null),K(null),$(s("saved"))}catch(e){K(e instanceof Error?e.message:String(e)),$(null)}finally{L(!1)}},U=async()=>{L(!0);try{let e=await (0,w.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");A(e.testJiraConnection),K(null),$(s("connectionSucceeded"))}catch(e){A(null),K(e instanceof Error?e.message:String(e)),$(null)}finally{L(!1)}},O=async()=>{L(!0);try{let e=await (0,w.controlPlaneRequest)(`mutation { clearJiraCredentials { ${H} } }`);B(e.clearJiraCredentials),A(null),K(null),$(s("removed"))}catch(e){K(e instanceof Error?e.message:String(e))}finally{L(!1)}};return(0,t.jsxs)("section",{className:e?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!e&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:s("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s("description")})]}),T?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),s("loading")]}):(0,t.jsx)("form",{onSubmit:e=>{(e.preventDefault(),r?.siteUrl&&r.siteUrl!==c.trim().replace(/\/$/,""))?V(!0):z(!1)},children:(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(i.KeyRound,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:s("credentials")})]}),(0,t.jsx)(S.Badge,{className:r?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:r?.tokenConfigured?s("configured"):s("notConfigured")})]}),R&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:R})}),q&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(v.AlertDescription,{className:"text-current",children:q})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:s("siteUrl")}),(0,t.jsx)(y.Input,{autoComplete:"url",id:"jira-site-url",onChange:e=>m(e.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:c}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("siteUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:s("email")}),(0,t.jsx)(y.Input,{autoComplete:"username",id:"jira-email",onChange:e=>f(e.target.value),required:!0,type:"email",value:p})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:s("apiToken")}),(0,t.jsx)(y.Input,{autoComplete:"new-password",id:"jira-token",onChange:e=>I(e.target.value),placeholder:r?.tokenConfigured?s("tokenPlaceholderConfigured"):s("tokenPlaceholder"),required:!r?.tokenConfigured,type:"password",value:j}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?.tokenConfigured?s("tokenKeepHelp"):s("tokenHelp")})]}),E&&(0,t.jsx)(v.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:E.displayName}),(0,t.jsx)("p",{className:"text-muted-foreground",children:E.emailAddress??E.accountId})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:s("remove"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:O,title:s("confirmRemove"),trigger:(0,t.jsxs)(C.Button,{disabled:P||!r?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),s("remove")]})}),(0,t.jsxs)(C.Button,{disabled:P||!r?.tokenConfigured,onClick:()=>void U(),type:"button",variant:"outline",children:[(0,t.jsx)(u,{}),s("test")]}),(0,t.jsxs)(C.Button,{disabled:P,type:"submit",children:[P?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{}),s("save")]})]})]})})}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:n("continue"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:()=>z(!0),onOpenChange:V,open:G,title:s("confirmSiteChange")})]})}var G=e.i(468096);let V="tokenConfigured defaultJiraKeyRegex updatedAt",B="configured appId installationId privateKeyConfigured keyFingerprint appSlug accountLogin repositorySelection actionsPermission verifiedAt updatedAt";function _({children:e,description:a,id:s,title:n}){return(0,t.jsxs)("section",{"aria-labelledby":s,className:"min-w-0 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:s,children:n}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:e})]})}function z(){let e=(0,x.useTranslations)("editorSettings"),[a,n]=(0,g.useState)("CODE"),[r,i]=(0,g.useState)(!0),[l,c]=(0,g.useState)(!1),[d,u]=(0,g.useState)(null),[m,p]=(0,g.useState)(null);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>{(0,w.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(e=>n(e.worktreeSettings.editorVariant)).catch(e=>p(e instanceof Error?e.message:String(e))).finally(()=>i(!1))},0);return()=>window.clearTimeout(e)},[]);let h=async()=>{c(!0);try{await (0,w.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
24
- saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
25
- }`,{editorVariant:a}),u(e("saved")),p(null)}catch(e){p(e instanceof Error?e.message:String(e)),u(null)}finally{c(!1)}};return(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Code2,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),m&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:m})}),d&&(0,t.jsx)(v.Alert,{children:(0,t.jsx)(v.AlertDescription,{children:d})}),r?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loading")]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{className:"min-w-64 flex-1 space-y-2",children:[(0,t.jsx)(N.Label,{htmlFor:"editor-variant",children:e("label")}),(0,t.jsxs)(K.Select,{onValueChange:e=>n(e),value:a,children:[(0,t.jsx)(K.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,t.jsx)(K.SelectValue,{})}),(0,t.jsxs)(K.SelectContent,{children:[(0,t.jsx)(K.SelectItem,{value:"CODE",children:e("code")}),(0,t.jsx)(K.SelectItem,{value:"CODE_INSIDERS",children:e("insiders")}),(0,t.jsx)(K.SelectItem,{value:"NONE",children:e("none")})]})]})]}),(0,t.jsxs)(C.Button,{disabled:l,onClick:()=>void h(),children:[l?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{})," ",e("save")]})]})]})})}function U(){let e=(0,x.useTranslations)("githubAppSettings"),s=(0,x.useTranslations)("common"),r=(0,p.useLocale)(),[f,j]=(0,g.useState)(null),[I,E]=(0,g.useState)(""),[A,T]=(0,g.useState)(""),[L,R]=(0,g.useState)(""),[K,q]=(0,g.useState)(""),[$,H]=(0,g.useState)(!1),[F,G]=(0,g.useState)(!0),[V,_]=(0,g.useState)(!1),[z,U]=(0,g.useState)(null),[O,J]=(0,g.useState)(null),M=(0,g.useCallback)(e=>{j(e),E(e.appId??""),T(e.installationId??""),R("")},[]),W=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${B} } }`);M(e.githubAppSettings)}catch(e){U(e instanceof Error?e.message:String(e))}finally{G(!1)}},[M]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>{q(window.location.origin),W()},0);return()=>window.clearTimeout(e)},[W]);let Z=async t=>{t.preventDefault(),_(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
26
- saveGitHubAppSettings(input: $input) { ${B} }
27
- }`,{input:{appId:I.trim(),installationId:A.trim(),privateKey:L||null}});M(t.saveGitHubAppSettings),U(null),J(L&&f?.configured?e("rotated"):e("saved"))}catch(e){U(e instanceof Error?e.message:String(e)),J(null)}finally{_(!1)}},Y=async()=>{_(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation TestGitHubAppConnection {
28
- testGitHubAppConnection { ${B} }
29
- }`);M(t.testGitHubAppConnection),U(null),J(e("connectionSucceeded"))}catch(e){U(e instanceof Error?e.message:String(e)),J(null)}finally{_(!1)}},X=async()=>{_(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
30
- clearGitHubAppCredentials { ${B} }
31
- }`);M(t.clearGitHubAppCredentials),U(null),J(e("removed"))}catch(e){U(e instanceof Error?e.message:String(e)),J(null)}finally{_(!1)}},Q=async t=>{if(!t.name.toLowerCase().endsWith(".pem")){U(e("pemFileInvalid")),J(null);return}try{let a=await t.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(a)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(a)){U(e("pemFileInvalid")),J(null);return}R(a),U(null),J(e("pemFileLoaded",{filename:t.name}))}catch{U(e("pemFileReadError")),J(null)}};return(0,t.jsx)("form",{onSubmit:Z,children:(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(c.ShieldCheck,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(S.Badge,{className:f?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.configured?e("verified"):e("notConfigured")})]}),F?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[z&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:z})}),O&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(v.AlertDescription,{className:"text-current",children:O})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,t.jsx)("h3",{className:"font-medium",children:e("setupTitle")}),(0,t.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,t.jsxs)("li",{children:[e("stepRegister")," ",(0,t.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:"https://github.com/settings/apps/new",rel:"noreferrer",target:"_blank",children:[e("registerLink"),(0,t.jsx)(n.ExternalLink,{className:"size-3"})]})]}),(0,t.jsxs)("li",{children:[e("stepHomepage")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:K}),e("stepHomepageSuffix")]}),(0,t.jsx)("li",{children:e("stepPermissions")}),(0,t.jsx)("li",{children:e("stepInstall")}),(0,t.jsxs)("li",{children:[e("stepInstallationId")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:"https://github.com/organizations/<Organization-name>/settings/installations/<ID>"}),e("stepInstallationIdSuffix")]}),(0,t.jsx)("li",{children:e("stepCredentials")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:e("appId")}),(0,t.jsx)(y.Input,{id:"github-app-id",inputMode:"numeric",onChange:e=>E(e.target.value),placeholder:e("appIdPlaceholder"),required:!0,value:I})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:e("installationId")}),(0,t.jsx)(y.Input,{id:"github-installation-id",inputMode:"numeric",onChange:e=>T(e.target.value),placeholder:e("installationIdPlaceholder"),required:!0,value:A})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${$?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),H(!0)},onDragLeave:()=>H(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",H(!0)},onDrop:e=>{e.preventDefault(),H(!1);let t=e.dataTransfer.files.item(0);t&&Q(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(m.Upload,{className:"size-3.5"}),e("pemDropHint")]}),(0,t.jsx)(D.Textarea,{autoComplete:"new-password",className:"min-h-40 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"github-app-private-key",onChange:e=>R(e.target.value),placeholder:f?.privateKeyConfigured?e("privateKeyPlaceholderConfigured"):e("privateKeyPlaceholder"),required:!f?.privateKeyConfigured,value:L})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:f?.privateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),f?.configured&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(i.KeyRound,{}),(0,t.jsxs)(v.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)("p",{className:"font-medium",children:e("connectedAs",{app:f.appSlug??"—",account:f.accountLogin??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("connectionDetails",{permission:f.actionsPermission??"—",selection:f.repositorySelection??"—"})}),f.verifiedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastVerified",{date:(0,P.formatDateValue)(f.verifiedAt,"short",{locale:r})})}),f.keyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:f.keyFingerprint})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:X,title:e("confirmRemove"),trigger:(0,t.jsxs)(C.Button,{disabled:V||!f?.configured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(C.Button,{disabled:V||!f?.configured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,t.jsx)(u,{}),e("test")]}),(0,t.jsxs)(C.Button,{disabled:V,type:"submit",children:[V?(0,t.jsx)(k.Spinner,{}):L&&f?.configured?(0,t.jsx)(l.RotateCw,{}):(0,t.jsx)(o.Save,{}),L&&f?.configured?e("rotate"):e("save")]})]})]})]})})})}function O(){let e=(0,x.useTranslations)("githubSettings"),s=(0,x.useTranslations)("common"),[n,i]=(0,g.useState)(null),[l,c]=(0,g.useState)(""),[m,p]=(0,g.useState)(null),[f,j]=(0,g.useState)(!0),[I,E]=(0,g.useState)(!1),[A,T]=(0,g.useState)(null),[D,P]=(0,g.useState)(null),L=e=>{i(e),c("")},R=(0,g.useCallback)(async()=>{try{let e=await (0,w.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${V} } }`);L(e.githubSettings)}catch(e){T(e instanceof Error?e.message:String(e))}finally{j(!1)}},[]);(0,g.useEffect)(()=>{let e=window.setTimeout(()=>void R(),0);return()=>window.clearTimeout(e)},[R]);let K=async t=>{t.preventDefault(),E(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
32
- saveGitHubSettings(input: $input) { ${V} }
33
- }`,{input:{apiToken:l||null}});L(t.saveGitHubSettings),p(null),T(null),P(e("saved"))}catch(e){T(e instanceof Error?e.message:String(e)),P(null)}finally{E(!1)}},q=async()=>{E(!0);try{let t=await (0,w.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");p(t.testGitHubConnection),T(null),P(e("connectionSucceeded"))}catch(e){p(null),T(e instanceof Error?e.message:String(e)),P(null)}finally{E(!1)}},$=async()=>{E(!0);try{let t=await (0,w.controlPlaneRequest)(`mutation ClearGitHubCredentials {
34
- clearGitHubCredentials { ${V} }
35
- }`);L(t.clearGitHubCredentials),p(null),T(null),P(e("removed"))}catch(e){T(e instanceof Error?e.message:String(e)),P(null)}finally{E(!1)}};return(0,t.jsx)("form",{onSubmit:K,children:(0,t.jsx)(b.Card,{children:(0,t.jsxs)(b.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.GitPullRequest,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(S.Badge,{className:n?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:n?.tokenConfigured?e("configured"):e("notConfigured")})]}),f?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[A&&(0,t.jsx)(v.Alert,{variant:"destructive",children:(0,t.jsx)(v.AlertDescription,{children:A})}),D&&(0,t.jsxs)(v.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(v.AlertDescription,{className:"text-current",children:D})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(N.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:e("apiToken")}),(0,t.jsx)(y.Input,{autoComplete:"new-password",id:"github-token",onChange:e=>c(e.target.value),placeholder:n?.tokenConfigured?e("tokenPlaceholderConfigured"):e("tokenPlaceholder"),required:!n?.tokenConfigured,type:"password",value:l}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:n?.tokenConfigured?e("tokenKeepHelp"):e("tokenHelp")})]}),m&&(0,t.jsx)(v.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:m.name??m.login}),(0,t.jsxs)("a",{className:"text-sm text-primary hover:underline",href:m.url,rel:"noreferrer",target:"_blank",children:["@",m.login]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:$,title:e("confirmRemove"),trigger:(0,t.jsxs)(C.Button,{disabled:I||!n?.tokenConfigured,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(C.Button,{disabled:I||!n?.tokenConfigured,onClick:()=>void q(),type:"button",variant:"outline",children:[(0,t.jsx)(u,{}),e("test")]}),(0,t.jsxs)(C.Button,{disabled:I,type:"submit",children:[I?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(o.Save,{}),e("save")]})]})]})]})})})}e.s(["SettingsPage",0,function(){let e=(0,x.useTranslations)("settings");return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(G.DatabaseEncryptionAlert,{}),(0,t.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,t.jsx)(_,{description:e("developmentGroupDescription"),id:"settings-development",title:e("developmentGroup"),children:(0,t.jsx)(z,{})}),(0,t.jsxs)(_,{description:e("appleGroupDescription"),id:"settings-apple",title:e("appleGroup"),children:[(0,t.jsx)(R,{}),(0,t.jsx)($,{})]})]}),(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsxs)(_,{description:e("integrationsGroupDescription"),id:"settings-integrations",title:e("integrationsGroup"),children:[(0,t.jsx)(F,{embedded:!0}),(0,t.jsx)(O,{}),(0,t.jsx)(U,{}),(0,t.jsx)(E,{})]})})]})]})}],534710)}]);