@staff0rd/assist 0.1218.0 → 0.1219.0
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.
- package/dist/.build-files +81 -81
- package/dist/{addActivity-4AZB5FNU.js → addActivity-BB356JUC.js} +2 -2
- package/dist/{addPhase-LNPXIYPK.js → addPhase-7XECKHH4.js} +3 -3
- package/dist/{advise-MTBFUXTQ.js → advise-GSYVYRR7.js} +3 -3
- package/dist/{askCheck-SX5W2VA4.js → askCheck-RC7ZVCRL.js} +7 -7
- package/dist/{askDesign-SZ7K6CGJ.js → askDesign-QFCRD43M.js} +1 -1
- package/dist/{branch-VE22QM2F.js → branch-YQ3UUCKY.js} +3 -3
- package/dist/built-version +1 -1
- package/dist/{chunk-4RFTQWCL.js → chunk-3GINAMFT.js} +1 -1
- package/dist/{chunk-VOZOQ7ZU.js → chunk-3LQYJXPU.js} +6 -6
- package/dist/{chunk-2CRZID7T.js → chunk-3NOKJIMX.js} +10 -36
- package/dist/{chunk-ZKBD7ZIP.js → chunk-3Q2ILAJX.js} +1 -1
- package/dist/{chunk-PIPTIJL2.js → chunk-4XVWGIQZ.js} +1 -1
- package/dist/{chunk-T6WF6NZA.js → chunk-56Q4LYVU.js} +1 -1
- package/dist/{chunk-XE57ISQA.js → chunk-A37Z423F.js} +1 -1
- package/dist/{chunk-HOZ7ATOX.js → chunk-A6LWYAU3.js} +1 -1
- package/dist/{chunk-YBVGYTVF.js → chunk-BHVGF75Y.js} +1 -1
- package/dist/{chunk-HANSK4D3.js → chunk-C7RV262Q.js} +1 -1
- package/dist/{chunk-5PVYAAPY.js → chunk-EQ4PJNR3.js} +1 -1
- package/dist/{chunk-V23C35QR.js → chunk-EVNYRQFN.js} +2 -2
- package/dist/{chunk-NWCNDJBK.js → chunk-FAGKXS7M.js} +1 -1
- package/dist/{chunk-ORIIRECU.js → chunk-JK35TMPQ.js} +1 -1
- package/dist/{chunk-TLJTRWSR.js → chunk-KQJCHYLI.js} +1 -1
- package/dist/{chunk-JEWWWHLD.js → chunk-L6TIUQG7.js} +1 -1
- package/dist/{chunk-AEKCC6KD.js → chunk-LGCT5GWJ.js} +2 -2
- package/dist/{chunk-7Q7JIS5A.js → chunk-LJO2QGU2.js} +1 -1
- package/dist/{chunk-CUQ7A4YH.js → chunk-LW3XI5ST.js} +1 -1
- package/dist/{chunk-3ODUG247.js → chunk-MKKUAIO5.js} +1 -1
- package/dist/{chunk-6C255DOU.js → chunk-ODRXZQ3P.js} +175 -68
- package/dist/{chunk-SLTINDT7.js → chunk-OSZF5OIC.js} +3 -3
- package/dist/{chunk-NGG4N5VZ.js → chunk-PVMR7BDN.js} +1 -1
- package/dist/{chunk-2KN7ASRE.js → chunk-Q5FCUGEG.js} +1 -1
- package/dist/{chunk-TGCXWMNU.js → chunk-RORCGUAQ.js} +2 -2
- package/dist/{chunk-2VQGIVEV.js → chunk-RUU5Q4QJ.js} +2 -2
- package/dist/{chunk-ATKBOUCC.js → chunk-TMER6T2Y.js} +7 -7
- package/dist/{chunk-3FMGNYHM.js → chunk-TMXJY4YK.js} +1 -1
- package/dist/{chunk-EN57YHHK.js → chunk-TWQF3TMB.js} +1 -1
- package/dist/{chunk-G5IRYDTJ.js → chunk-UCRYRT7T.js} +5 -5
- package/dist/{chunk-24WESUC2.js → chunk-UNIWH4ZG.js} +1 -1
- package/dist/{chunk-R3BKXOWM.js → chunk-UVF7AAOM.js} +2 -2
- package/dist/{chunk-S4NSHQQ3.js → chunk-XVPHIREY.js} +1 -1
- package/dist/{chunk-7QTQJKJU.js → chunk-Y4RZPE5K.js} +1 -1
- package/dist/{chunk-3RPXIPH5.js → chunk-Z3FHSBJX.js} +1 -1
- package/dist/{chunk-MBSMCUTL.js → chunk-ZGNYGFEH.js} +1 -1
- package/dist/{chunk-RKNMJQF6.js → chunk-ZRI4LLEL.js} +3 -3
- package/dist/{chunk-KPVSCQHQ.js → chunk-ZYRQKPB5.js} +2 -2
- package/dist/{cliHook-66JBCEHG.js → cliHook-IHIYSUUT.js} +6 -6
- package/dist/{cliHookCheck-6VEZGNQI.js → cliHookCheck-37GDC6GC.js} +2 -2
- package/dist/{codexHook-5LK4N2AU.js → codexHook-QNPEZFMN.js} +8 -8
- package/dist/commands/extension/extension/updates.json +2 -2
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/{commit-YWSX4PND.js → commit-63G2R6X4.js} +4 -4
- package/dist/{doctorNodes-MR5C4FAF.js → doctorNodes-ZHT4VXJH.js} +3 -3
- package/dist/{done-6SQ4ZFU5.js → done-73ZFHC3V.js} +4 -4
- package/dist/{editHook-ZJBYDJ7A.js → editHook-UYFUDUBH.js} +6 -6
- package/dist/{fixConflict-CK6BZSOB.js → fixConflict-VDFA2YYB.js} +4 -4
- package/dist/index.js +50 -50
- package/dist/{launchMode-2AV2GQZV.js → launchMode-2Y6A3THN.js} +14 -14
- package/dist/{list-B53EGB5N.js → list-2I6MF33C.js} +5 -5
- package/dist/{migrate-EQEBYLSV.js → migrate-MMIFWW4D.js} +3 -3
- package/dist/{next-G5K5TM3V.js → next-ASEZ7YID.js} +13 -13
- package/dist/{phaseDone-X77US4BL.js → phaseDone-QUOCYSFL.js} +5 -5
- package/dist/{piHook-PHJVAO43.js → piHook-4UZFXOL2.js} +6 -6
- package/dist/{propose-V4APKP64.js → propose-TEAY3APD.js} +4 -4
- package/dist/{refine-U245OW2L.js → refine-OOKRHH6R.js} +15 -15
- package/dist/{restartNode-Y4IHGBFW.js → restartNode-SHSBTIPE.js} +5 -5
- package/dist/{review-RWWCSIRN.js → review-BI24OPV6.js} +4 -4
- package/dist/{reviewPrComments-MKPSQ6BR.js → reviewPrComments-BCPAUAY6.js} +4 -4
- package/dist/{rewindPhase-SZFVC6W5.js → rewindPhase-7AQG7BYT.js} +8 -8
- package/dist/{run-JXWKKDT5.js → run-L2KHLVUN.js} +11 -11
- package/dist/{run-FYD73JOG.js → run-R4W3PZCM.js} +11 -11
- package/dist/{runDaemon-5SPXM7TW.js → runDaemon-PANJUNOL.js} +31 -23
- package/dist/{runParallelPhase-VXN3OZXF.js → runParallelPhase-ER4T22WS.js} +7 -7
- package/dist/{runRefine-MDYWKJ3O.js → runRefine-2AOVNZGF.js} +15 -15
- package/dist/{scan-VAQU6SGK.js → scan-C7IJHRET.js} +2 -2
- package/dist/{schemaConfirm-6TEMFXGX.js → schemaConfirm-SCIGN5LJ.js} +2 -2
- package/dist/{schemaLock-WKR3Y542.js → schemaLock-TPOAQ3PF.js} +2 -2
- package/dist/{schemaUnlock-BYFQUMQ2.js → schemaUnlock-SLQ7Z6RV.js} +2 -2
- package/dist/{search-RGWI5N3E.js → search-3GQ2J6JG.js} +5 -5
- package/dist/{show-MPJ5KOKQ.js → show-4D35SSSY.js} +3 -3
- package/dist/{show-AF3AHY3O.js → show-HAR6XVMW.js} +3 -3
- package/dist/{signExtension-AHXRV5XT.js → signExtension-CNR43DHY.js} +1 -1
- package/dist/{updateNode-3EH44S2Z.js → updateNode-KOMLTDVK.js} +5 -5
- package/dist/{updatePlan-JPQNCN43.js → updatePlan-JYJMAJSP.js} +4 -4
- package/dist/{web-PPEZAIVF.js → web-HU52H4CS.js} +16 -16
- package/dist/{web-2RV7AVAP.js → web-NUVTYS3O.js} +16 -16
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
next
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RUU5Q4QJ.js";
|
|
4
4
|
import {
|
|
5
5
|
pullIfConfigured
|
|
6
6
|
} from "./chunk-3UMMZHZG.js";
|
|
7
7
|
import {
|
|
8
8
|
run
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3LQYJXPU.js";
|
|
10
10
|
import {
|
|
11
11
|
launchBlocker
|
|
12
12
|
} from "./chunk-24YN3552.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
readSignal,
|
|
16
16
|
stopWatching,
|
|
17
17
|
watchForMarker
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OSZF5OIC.js";
|
|
19
19
|
import {
|
|
20
20
|
resumeNudge
|
|
21
21
|
} from "./chunk-7NZOH4LN.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-3DNFNT2L.js";
|
|
32
32
|
import {
|
|
33
33
|
isBlocked
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-A6LWYAU3.js";
|
|
35
35
|
import {
|
|
36
36
|
loadItemSummaries
|
|
37
37
|
} from "./chunk-SGZ57DJO.js";
|
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
} from "./chunk-N65VOEFI.js";
|
|
50
50
|
import {
|
|
51
51
|
harnessAdapter
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-ODRXZQ3P.js";
|
|
53
53
|
|
|
54
54
|
// src/commands/backlog/launchMode.ts
|
|
55
55
|
import chalk3 from "chalk";
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-ZT3S2DV2.js";
|
|
7
7
|
import {
|
|
8
8
|
resolveRewindPlan
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RORCGUAQ.js";
|
|
10
10
|
import {
|
|
11
11
|
resolvePlan
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3GINAMFT.js";
|
|
13
13
|
import {
|
|
14
14
|
resetPhaseAndDependents,
|
|
15
15
|
updateStatus
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
isDocsPath,
|
|
9
9
|
isSchemaPath,
|
|
10
10
|
mentionsDocsPath
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UNIWH4ZG.js";
|
|
12
12
|
import {
|
|
13
13
|
isSchemaLocked
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A37Z423F.js";
|
|
15
15
|
import {
|
|
16
16
|
findBuiltinDenyRaw,
|
|
17
17
|
findDeny,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isApprovedRead,
|
|
22
22
|
resolvePermission,
|
|
23
23
|
splitCompound
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-FAGKXS7M.js";
|
|
25
25
|
import {
|
|
26
26
|
inWebSession
|
|
27
27
|
} from "./chunk-HKGCLAZ7.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZRI4LLEL.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-UNIWH4ZG.js";
|
|
7
|
+
import "./chunk-A37Z423F.js";
|
|
8
8
|
import "./chunk-ZN4PSZSA.js";
|
|
9
9
|
import {
|
|
10
10
|
currentExecutionIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LJO2QGU2.js";
|
|
12
12
|
import "./chunk-ZMH7UZNP.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FAGKXS7M.js";
|
|
14
14
|
import "./chunk-VDXS55BC.js";
|
|
15
15
|
import "./chunk-HKGCLAZ7.js";
|
|
16
16
|
import "./chunk-FPWL4VRC.js";
|
|
@@ -28,7 +28,7 @@ import "./chunk-WPRXBDFP.js";
|
|
|
28
28
|
import "./chunk-TBHJ7JDT.js";
|
|
29
29
|
import {
|
|
30
30
|
claudeAdapter
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-ODRXZQ3P.js";
|
|
32
32
|
import "./chunk-MRUIXQXS.js";
|
|
33
33
|
import "./chunk-YLQAQHRT.js";
|
|
34
34
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
findTruncatedReadDenyRaw,
|
|
6
6
|
isApprovedRead,
|
|
7
7
|
splitCompound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-FAGKXS7M.js";
|
|
9
9
|
import "./chunk-VDXS55BC.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ODRXZQ3P.js";
|
|
11
11
|
import "./chunk-MRUIXQXS.js";
|
|
12
12
|
import "./chunk-YLQAQHRT.js";
|
|
13
13
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZRI4LLEL.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-UNIWH4ZG.js";
|
|
7
|
+
import "./chunk-A37Z423F.js";
|
|
8
8
|
import "./chunk-ZN4PSZSA.js";
|
|
9
9
|
import {
|
|
10
10
|
currentExecutionIdentity
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LJO2QGU2.js";
|
|
12
12
|
import "./chunk-ZMH7UZNP.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-FAGKXS7M.js";
|
|
14
14
|
import "./chunk-VDXS55BC.js";
|
|
15
15
|
import "./chunk-HKGCLAZ7.js";
|
|
16
16
|
import {
|
|
@@ -20,7 +20,7 @@ import "./chunk-FPWL4VRC.js";
|
|
|
20
20
|
import "./chunk-H63MI5HI.js";
|
|
21
21
|
import {
|
|
22
22
|
adviceHookPayload
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-BHVGF75Y.js";
|
|
24
24
|
import "./chunk-P7FVAGFQ.js";
|
|
25
25
|
import "./chunk-XJTXAL22.js";
|
|
26
26
|
import {
|
|
@@ -40,11 +40,11 @@ import "./chunk-XEHE4IC2.js";
|
|
|
40
40
|
import "./chunk-EKKGNYON.js";
|
|
41
41
|
import "./chunk-WPRXBDFP.js";
|
|
42
42
|
import "./chunk-TBHJ7JDT.js";
|
|
43
|
-
import "./chunk-
|
|
43
|
+
import "./chunk-Q5FCUGEG.js";
|
|
44
44
|
import "./chunk-6MXYEGDK.js";
|
|
45
45
|
import {
|
|
46
46
|
codexAdapter
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-ODRXZQ3P.js";
|
|
48
48
|
import "./chunk-MRUIXQXS.js";
|
|
49
49
|
import "./chunk-YLQAQHRT.js";
|
|
50
50
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"assist@staff0rd.github.io": {
|
|
4
4
|
"updates": [
|
|
5
5
|
{
|
|
6
|
-
"version": "0.
|
|
7
|
-
"update_link": "https://github.com/staff0rd/assist/releases/download/v0.
|
|
6
|
+
"version": "0.1218.0",
|
|
7
|
+
"update_link": "https://github.com/staff0rd/assist/releases/download/v0.1218.0/assist-extension.xpi"
|
|
8
8
|
}
|
|
9
9
|
]
|
|
10
10
|
}
|
|
@@ -4148,7 +4148,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4148
4148
|
`)){let n=t[t.length-1];r.startsWith("@@")||n===void 0?t.push(r):t[t.length-1]=`${n}
|
|
4149
4149
|
${r}`}return t}function CJr(e){return wJr(e??"").filter(t=>t.startsWith("@@"))}function iZo(e){return Number(/^@@ -(\d+)/.exec(e)?.[1]??1)}function aZo(e){return/^@@[^@]*@@/.exec(e)?.[0]??e.split(`
|
|
4150
4150
|
`)[0]??""}function kJr(e,t){return e.reduce((r,n)=>r+TJr(n,t),0)}function _Jr(e,t,r){let n=CJr(e.patch),o=[],i=[];return n.forEach((a,s)=>{let l=r.get(`${e.path}#${s}`)??[];l.includes(t)?o.push(a):i.push({oldStart:iZo(a),header:aZo(a),slice:l[0]??0})}),o.length===0||i.length===0?e:{...e,patch:o.join(`
|
|
4151
|
-
`),additions:kJr(o,"+"),deletions:kJr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function EJr(e){return e.flatMap(t=>{if(t.kind==="dir")return EJr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function sZo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function RJr(e,t,r=new Set,n=new Set){let o=EJr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=sZo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(DY));return SJr(o.filter(u=>l.has(u.path)).map(u=>_Jr(u,s+1,i)))})}function lZo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>DY(s)===e).length;a>n&&(r=i,n=a)}),r}function PJr(e,t){let r=t.map(()=>[]);for(let n of e)r[lZo(n.path,t)]?.push(n);return r}function AJr(e,t){let r=RJr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=PJr(e.tests,t),o=_Ae(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function LJr(e){if(!e.slices)return;let t=AJr(e,e.slices);return{entries:pJr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function IJr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function zN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Dyt=e=>typeof e=="string"?e:"";function DJr(e){return{repo:Dyt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Dyt(e.headSha),body:Dyt(e.body)}}var Myt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function XAe(e){let t;try{t=JSON.parse(e)}catch{return Myt}return typeof t!="object"||t===null?Myt:{...DJr(t),checks:zN(t.checks,IJr),structure:{...Myt.structure,...t.structure},criticalDiffs:zN(t.criticalDiffs),criticalPaths:zN(t.criticalPaths),tests:zN(t.tests),testPaths:zN(t.testPaths),collapsedPaths:zN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.progress?{progress:t.progress}:{}}}function MJr(e){let t=(0,Nyt.useMemo)(()=>XAe(e.body),[e.body]),r=(0,Nyt.useMemo)(()=>LJr(t),[t]);return{payload:t,sliced:r}}var NJr=x(te(),1);function OJr(e){let[t,r]=(0,NJr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var Qle=x(te(),1);function BJr(e,t,r){let n=(0,Qle.useRef)(!1),o=(0,Qle.useRef)(r);o.current=r,(0,Qle.useEffect)(()=>{if(!n.current){n.current=!0;return}o.current({items:e,reviewComments:t})},[e,t])}function FJr(e,t,r,n){let{payload:o,sliced:i}=MJr(e),{progress:a}=n,s=dJr(o.checks,a,i?.slicing),l=OJr(a),u=tJr(i?.entries??[]),{comments:d,sentTo:f,clearSent:p}=gY(t,r),h={...d,onQueue:l.onQueue};BJr(s.items,l.queued,n.onChange);let m=(0,$Jr.useMemo)(()=>aJr(o),[o]);return{payload:o,checklist:s,queue:l,details:iJr(o,h),counts:m,sentTo:f,clearSent:p,sliced:i,nav:u,diffComments:h}}var US=x(_(),1);function zJr({preview:e,session:t,sendInput:r,stored:n,onDecision:o}){let i=FJr(e,t,r,n);return(0,US.jsxs)(H,{sx:f0,children:[(0,US.jsx)(Fh,{preview:e,draft:!1}),(0,US.jsx)(vY,{items:e.metadata??[]}),(0,US.jsx)(Yn,{}),(0,US.jsx)(zQr,{payload:i.payload,checklist:i.checklist,details:i.details,counts:i.counts,sliced:i.sliced,nav:i.nav,comments:i.diffComments}),(0,US.jsx)(Yn,{}),(0,US.jsx)(JQr,{pane:i,onDecision:(a,s)=>{n.close(),o(a,s)}}),(0,US.jsx)(pf,{sessionName:i.sentTo,onClose:i.clearSent})]})}var JAe=x(te(),1);var Jle=x(te(),1);var ZAe="/api/high-level-progress";function HJr(e,t){let r,n,o=!1,i=s=>$t(Er(ZAe,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...s})}).catch(l=>xr(l,"high-level progress write")),a=async()=>{for(;r;){let s=r;r=void 0,await i(s)}n=void 0};return{write(s){o||(r=s,n??(n=a()))},close(){o=!0}}}function UJr(e,t){let{repo:r,prNumber:n,headSha:o,requestId:i}=e,a=(0,Jle.useMemo)(()=>r&&o?HJr({repo:r,prNumber:n,headSha:o,requestId:i},t):void 0,[r,n,o,i,t]),s=(0,Jle.useRef)(!1),l=(0,Jle.useRef)(void 0);return{markLoaded:()=>(s.current=!0,l.current&&a?.write(l.current),l.current!==void 0),onChange:u=>{l.current=u,s.current&&a?.write(u)},close:()=>a?.close()}}var QAe=x(te(),1);async function WJr(e,t){let r=new URLSearchParams({repo:e.repo,prNumber:String(e.prNumber),headSha:e.headSha}),n=await $t(Er(`${ZAe}?${r}`,t));if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).progress??void 0}function VJr(e,t,r){let n=(0,QAe.useRef)(r);n.current=r;let{repo:o,prNumber:i,headSha:a}=e;(0,QAe.useEffect)(()=>{if(!o||!a)return;let s=!1,l=u=>{s||n.current(u)};return WJr({repo:o,prNumber:i,headSha:a},t).then(l,()=>l(void 0)),()=>{s=!0}},[o,i,a,t])}function GJr(e,t){let r=(0,JAe.useMemo)(()=>XAe(e.body),[e.body]),n={repo:r.repo,prNumber:r.prNumber,headSha:r.headSha},[o,i]=(0,JAe.useState)(()=>({progress:r.progress??r.saved,version:0})),a=UJr({...n,requestId:e.requestId},t);return VJr(n,t,s=>{a.markLoaded()||!s||s.updatedAt!==r.progress?.updatedAt&&i(u=>({progress:s,version:u.version+1}))}),{...o,onChange:a.onChange,close:a.close}}var jJr=x(_(),1);function qJr({preview:e,session:t,sendInput:r,onDecision:n}){let o=GJr(e,t?.node);return(0,jJr.jsx)(zJr,{preview:e,session:t,sendInput:r,stored:o,onDecision:n},o.version)}var ten=x(te(),1);var HN=x(_(),1);function cZo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function YJr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,HN.jsxs)(bt,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,HN.jsx)(ve,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:cZo(e)}),(0,HN.jsx)(et,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,HN.jsx)(et,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,HN.jsx)(et,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var uZo={"top-left":nc.miro.topLeft,"bottom-right":nc.miro.bottomRight};function KJr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?uZo[t]:nc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ece=x(_(),1);function XJr({box:e,role:t,onSelect:r}){let n=KJr(e,t);return(0,ece.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ece.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ece.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:nc.miro.text,children:e.text})]})}function ZJr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var e6e=x(_(),1);function QJr({boxes:e,selection:t}){return(0,e6e.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,e6e.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:ZJr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,e6e.jsx)(XJr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function dZo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function JJr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(dZo):[]}catch{return[]}}var Oyt=x(te(),1);function een(){let[e,t]=(0,Oyt.useState)(null),[r,n]=(0,Oyt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var Q3=x(_(),1);function ren({preview:e,onDecision:t}){let r=(0,ten.useMemo)(()=>JJr(e.body),[e.body]),n=een();return(0,Q3.jsxs)(H,{sx:f0,children:[(0,Q3.jsx)(Fh,{preview:e,draft:!1}),(0,Q3.jsx)(Yn,{}),(0,Q3.jsx)(QJr,{boxes:r,selection:n}),(0,Q3.jsx)(Yn,{}),(0,Q3.jsx)(YJr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var Den=x(te(),1);function nen(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function t6e(e){return e*22}function oen(e){return Math.round(e/22)}var ien={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},aen={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},sen={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},len={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Byt={p:.25,mt:"2px"},cen={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var den=x(_(),1),fZo=8;function uen({drag:e}){return e?(0,den.jsx)(H,{sx:cen,style:{top:e.top-1,left:fZo+t6e(e.depth)}}):null}var fen=x(_(),1),pen=ot((0,fen.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var $yt=x(_(),1);function hen({number:e,onGrip:t}){return(0,$yt.jsx)(Mt,{size:"small",className:"criterion-action",sx:aen,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,$yt.jsx)(pen,{fontSize:"inherit"})})}var xk=x(_(),1);function men({number:e,onAdd:t,onDelete:r}){return(0,xk.jsxs)(xk.Fragment,{children:[(0,xk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Byt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,xk.jsx)(Kd,{fontSize:"inherit"})}),(0,xk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Byt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,xk.jsx)(Eo,{fontSize:"inherit"})})]})}var r6e=x(te(),1);function gen(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function yen(e){let t=(0,r6e.useRef)(null);return(0,r6e.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=gen(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var UN=x(_(),1);function ven({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=yen(n.focus?.index===e?n.focus:null),s={marginLeft:t6e(r.depth),opacity:o?.4:1};return(0,UN.jsxs)(H,{sx:ien,"data-criterion-row":!0,style:s,children:[(0,UN.jsx)(hen,{number:t,onGrip:i}),(0,UN.jsx)(H,{component:"span",sx:sen,"aria-hidden":"true",children:`${t}.`}),(0,UN.jsx)(Ui,{multiline:!0,value:r.text,sx:len,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,UN.jsx)(men,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var ken=x(te(),1);function ben(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function J3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function n6e(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:J3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function bg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function o6e(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function xen(e,t){let r=bg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function Sen(e,t,r){let n=r<0?o6e(e,t):xen(e,t);if(n<0)return null;let o=bg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:bg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function i6e(e,t){let r=bg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:J3(n),index:Math.max(0,t-1)}}function Ten(e,t,r){if(r<0&&e[t].depth===0||r>0&&o6e(e,t)<0)return null;let n=bg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function a6e(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function pZo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return a6e(n6e(e,t,o,n.slice(r)),"start")}function hZo(e,t,{shift:r,caret:n}){let o=Ten(e,t,r?-1:1);return a6e(o?{items:o,index:t}:null,n)}function wen(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?pZo(e,t,r):n==="Tab"?hZo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?a6e(Sen(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?a6e(i6e(e,t),"end"):null}function Cen(e,t,r){return wen(e,t,r)??ben(e,t,r)}function _en(e,t){let[r,n]=(0,ken.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=Cen(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(n6e(e,a,e[a].text,""),"start"),onDelete:a=>o(i6e(e,a),"end")}}var Len=x(te(),1);function mZo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=bg(t,r);return o>r&&o<i?r:o}function gZo(e,t,r,n){let o=bg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+oen(n),s))}function yZo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function Een(e,t,r,n,o){let i=mZo(e,t,r,o);return{target:i,depth:gZo(t,r,i,n),top:yZo(e,i)}}function vZo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function Ren(e,t,r,n){return o=>{let{boxes:i,origin:a}=vZo(t);return Een(i,e,r,o.clientX-n,o.clientY-a)}}function Pen(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function Aen(e,t,r,n){let o=bg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:J3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function Ien(e,t,r){let[n,o]=(0,Len.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),Pen(s.currentTarget,s.pointerId,Ren(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(Aen(e,a,d.target,d.depth))})(s)}}}var tce=x(_(),1),bZo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},xZo=[{text:"",depth:0}];function Men({items:e,onChange:t}){let r=(0,Den.useRef)(null),n=e.length>0?e:xZo,o=_en(n,t),{drag:i,onGrip:a}=Ien(n,r,o.onDrop),s=nen(n.map(l=>l.depth));return(0,tce.jsxs)(H,{sx:bZo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,tce.jsx)(ven,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,tce.jsx)(uen,{drag:i})]})}var Nen=x(_(),1),Oen=ot((0,Nen.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var rce=x(_(),1),SZo={insert:"Add acceptance criteria",convert:"Convert to outline"};function Ben({kind:e,onClick:t}){return(0,rce.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,rce.jsx)(et,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,rce.jsx)(Kd,{}):(0,rce.jsx)(Oen,{}),onClick:t,children:SZo[e]})})}var nce=x(te(),1);function $en(e,t,{color:r,pin:n}){let o=j6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>TZo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function TZo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function Fen(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function zen(e,t){for(let r of t){let n=$7t(e,r);n&&$en(e,n,r)}}var oce=x(_(),1);function Hen({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,nce.useMemo)(()=>ZD(e),[e]),a=(0,nce.useMemo)(()=>ZD(r??""),[r]);return(0,nce.useLayoutEffect)(()=>{let s=o.current;s&&(Fen(s),zen(s,n))},[i,a,n,o]),(0,oce.jsxs)(H,{ref:o,children:[(0,oce.jsx)(jD,{segments:i,skipDiagramText:!0}),t,t?(0,oce.jsx)(jD,{segments:a,skipDiagramText:!0}):null]})}var WN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function s6e(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[WN("")]:{lineHeight:1.6},[WN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[WN("ul, ol")]:{pl:2.5,mb:2},[WN("li")]:{mb:"6px"},[WN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[WN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[WN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var Uen=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...g9(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...s6e(e)});var UY=x(_(),1);function Wen({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,UY.jsxs)(H,{ref:o,onMouseDown:l,sx:Uen,children:[(0,UY.jsx)(Hen,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,UY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,UY.jsx)(a9,{rects:a,color:s})]})}function Ven(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var l6e=x(te(),1),Gen=x(_(),1);function Fyt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,l6e.useState)(t);return(0,l6e.useEffect)(()=>i(t),[t]),(0,Gen.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var ice=x(_(),1),zyt="screenshot-groups";function wZo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function qen({screenshot:e,onUpdate:t}){return(0,ice.jsxs)(bt,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,ice.jsx)(Fyt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||wZo(e.path)})}),(0,ice.jsx)(Fyt,{label:"Group",value:e.group??"",listId:zyt,onCommit:r=>t(e.id,{group:r})})]})}var eP=x(_(),1),jen={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},CZo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function Yen({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,eP.jsxs)(H,{sx:{position:"relative"},children:[n?(0,eP.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:jen}):(0,eP.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:jen}),(0,eP.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:CZo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,eP.jsx)(Eo,{fontSize:"small"})}),(0,eP.jsx)(qen,{screenshot:e,onUpdate:r})]})}var x0=x(_(),1);function kZo(){return(0,x0.jsxs)(bt,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,x0.jsx)(Vn,{size:16}),(0,x0.jsx)(ve,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function _Zo({error:e}){return(0,x0.jsx)(ve,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function Ken({uploads:e,empty:t}){return e.length>0?(0,x0.jsx)(x0.Fragment,{children:e.map(r=>r.error?(0,x0.jsx)(_Zo,{error:r.error},r.id):(0,x0.jsx)(kZo,{},r.id))}):t?(0,x0.jsx)(ve,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var S0=x(_(),1),EZo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function Xen({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=Ven(e),a=s=>(0,S0.jsx)(Yen,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,S0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,S0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,S0.jsx)("datalist",{id:zyt,children:o.map(([s])=>(0,S0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,S0.jsxs)(H,{sx:{mb:2},children:[(0,S0.jsx)(H,{component:"h3",children:s}),(0,S0.jsx)(H,{sx:EZo,children:l.map(a)})]},s)),(0,S0.jsxs)(bt,{spacing:1,children:[i.map(a),(0,S0.jsx)(Ken,{uploads:t,empty:e.length===0})]})]})}var ace=x(_(),1);function RZo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,ace.jsx)(Men,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,ace.jsx)(Ben,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function c6e({pane:e,screenshots:t}){return(0,ace.jsx)(Wen,{...RZo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,ace.jsx)(Xen,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var Zen=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),Qen={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},Jen=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),etn={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var Sk=x(_(),1);function ttn({comments:e,colors:t,onRemove:r}){return(0,Sk.jsxs)(H,{sx:Zen,children:[(0,Sk.jsxs)(ve,{sx:Qen,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,Sk.jsxs)(H,{sx:Jen,children:[(0,Sk.jsx)(r9,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,Sk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,Sk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:etn,children:(0,Sk.jsx)(Eo,{})})]},n.id))]})}var ntn=x(_(),1);function rtn(e){return e.comments.length===0?null:(0,ntn.jsx)(ttn,{...e})}var otn=x(_(),1),u6e=ot((0,otn.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var utn=x(te(),1);var itn=x(_(),1),atn=ot((0,itn.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var T0="0.1218.0";var PZo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function stn(e){return e?PZo[e]:"success.main"}function ltn(e){return e.split("-")[0].split(".").map(Number)}function ctn(e,t){if(!e||!t||e===t)return;let r=ltn(e),n=ltn(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var d6e=x(te(),1),Hyt=(0,d6e.createContext)(null);function f6e(){return(0,d6e.useContext)(Hyt)}var VN=x(_(),1),AZo={height:16,fontSize:10},LZo={opacity:.6,fontSize:"0.85em"};function IZo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function tP({nodes:e,name:t,showVersion:r=!1}){let n=f6e()??T0,o=e.links.find(a=>a.name===t),i=ctn(o?.peerVersion,n);return(0,VN.jsx)(lr,{title:IZo(e,t),placement:"right",children:(0,VN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,VN.jsx)(atn,{sx:{fontSize:8,color:stn(o?.state)}}),t,r&&o?.peerVersion&&(0,VN.jsxs)(H,{component:"span",sx:LZo,children:["v",o.peerVersion]}),i&&(0,VN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:AZo})]})})}var w0=x(_(),1),DZo={textTransform:"none"};function p6e({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,utn.useState)(null);return(0,w0.jsxs)(w0.Fragment,{children:[(0,w0.jsx)(et,{size:"small",color:"inherit",startIcon:(0,w0.jsx)(u6e,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:DZo,children:(0,w0.jsx)(tP,{nodes:e,name:r.node})}),(0,w0.jsx)(gi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,w0.jsx)(Nr,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,w0.jsx)(yc,{primary:(0,w0.jsx)(tP,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var dtn=x(te(),1);function MZo(e,t){return e?.toLowerCase()===t.toLowerCase()}function h6e(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=xn(),[d,f]=(0,dtn.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>MZo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(S=>S.name===b&&S.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var rP=x(_(),1);function ftn({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=$ge(),a=h6e(r,t);return(0,rP.jsxs)(rP.Fragment,{children:[(0,rP.jsx)(et,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,rP.jsx)(p6e,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,rP.jsx)(et,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Uyt=x(_(),1),NZo={"& .MuiFormControlLabel-label":{fontSize:12}};function sce({label:e,title:t,checked:r,onChange:n}){return(0,Uyt.jsx)(zd,{control:(0,Uyt.jsx)(Op,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:NZo})}var GN=x(_(),1);function m6e({chain:e,newPr:t,onChange:r}){return(0,GN.jsxs)(bt,{direction:"row",sx:{mr:"auto"},children:[t&&(0,GN.jsx)(sce,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,GN.jsx)(sce,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,GN.jsx)(sce,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,GN.jsx)(sce,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var qN=x(_(),1);function ptn({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,qN.jsxs)(bt,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,qN.jsx)(m6e,{chain:t,newPr:r,onChange:i}),(0,qN.jsx)(et,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,qN.jsxs)(et,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,qN.jsx)(ftn,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var mtn=x(_(),1);function htn({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,mtn.jsx)(ptn,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var Tk=x(_(),1);function gtn(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,Tk.jsxs)(Tk.Fragment,{children:[(0,Tk.jsx)(rtn,{comments:t,colors:r,onRemove:d}),(0,Tk.jsx)(Yn,{}),(0,Tk.jsx)(htn,{...e}),(0,Tk.jsx)(e0e,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var lce=x(_(),1),OZo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},BZo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ytn({url:e}){return(0,lce.jsxs)(H,{sx:OZo,children:[(0,lce.jsx)(et,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,lce.jsx)(ve,{variant:"body2",sx:BZo,title:e,children:e})]})}var Wyt=x(_(),1);function vtn({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Wyt.jsx)(ytn,{url:t}):(0,Wyt.jsx)(vY,{items:e.metadata??[]})}function btn({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function WY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit"||t==="github-issue-comment",editable:t==="github-issue-edit",closeOnly:t==="show"}}function xtn(e,t){return e?`${e}:${t??"pr"}`:void 0}function g6e(e,t,r,n){return{...WY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:xtn(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function Stn(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,U_e({quote:r,note:o})),n()}}function Ttn(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,Xx(r,Hye(o))),n()}}function y6e(e,t,r,n){return{onCite:Ttn(e,t,r,n),onAddRule:Stn(e,t,r,n)}}function wtn(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var Itn=x(te(),1);var wk=x(te(),1);var Ctn="assist:pr-preview-comments:",Vyt=e=>`${Ctn}${e}`;function Gyt(e){return oc(Vyt(e))}function cce(e,t){ku(Vyt(e),t)}function v6e(e){rM(Vyt(e))}function ktn(){_R(Ctn)}function _tn(e){let t=j6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function $Zo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function Etn(e,t){return e.flatMap(r=>{let n=$Zo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function Rtn(e,t,r){let n=Gyt(e);if(n.length>0||!t||!r)return n;let o=Etn(Gyt(t),_tn(r));return cce(e,o),v6e(t),o}function Ptn(e,t,r){let[n,o]=(0,wk.useState)([]),i=(0,wk.useRef)(0);(0,wk.useEffect)(()=>{ktn(),o(Rtn(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,wk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return cce(e,d),d})},[e]),s=(0,wk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return cce(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function Atn(e,t){let r=e.map((i,a)=>zG(a).solid),n=zG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:zG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function Ltn(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function Dtn(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Xy(),{comments:d,add:f,remove:p}=Ptn(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,Itn.useMemo)(()=>Atn(d,i),[d,i]),{onAdd:y,onCollapse:v}=Ltn(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var x6e=x(te(),1);var qyt="assist:preview-screenshots:",jyt=e=>`${qyt}${e}`,b6e=e=>`${qyt}seeded:${e}`;function Mtn(e){return e?(_R(qyt),oc(jyt(e)).filter(t=>typeof t.path=="string")):[]}function jN(e,t){e&&ku(jyt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function Ntn(e){e&&(rM(jyt(e)),rM(b6e(e)))}var YN=x(te(),1);var Otn={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function FZo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(Otn).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function Btn(e){return e.map(t=>({...t,contentType:FZo(t.path),seeded:!0}))}function $tn(e,t,r){if(!e)return Btn(r);let n=Mtn(e);if(oc(b6e(e))[0]===t)return n;let o=[...Btn(r),...n.filter(i=>!i.seeded)];return jN(e,o),ku(b6e(e),[t]),o}function Ftn(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),sv(`/api/pr-preview/image?${r}`)}function ztn(e,t,r){let[n,o]=(0,YN.useState)([]),i=(0,YN.useRef)(0),a=cr(),s=(0,YN.useRef)(r);return s.current=r,(0,YN.useEffect)(()=>{o($tn(e,t,s.current).map(l=>({...l,url:Ftn(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var Htn=x(te(),1);function Utn(e,t){return(0,Htn.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return jN(e,i),i})},[e,t])}function Wtn(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=ztn(e,t,r),a=(0,x6e.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return jN(e,p),p})},[e,o,i]),s=(0,x6e.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return jN(e,h),h})},[e,o]),l=Utn(e,o),u=(0,x6e.useCallback)(()=>Ntn(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var VY=x(te(),1);async function Vtn(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await $t(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var Ytn=x(te(),1);function Gtn(e){return e.startsWith("image/")||e.startsWith("video/")}function qtn(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&Gtn(t.type)){let r=t.getAsFile();if(r)return r}return null}function jtn(e){return e?Array.from(e.files).find(t=>Gtn(t.type))??null:null}function Ktn(e,t){return(0,Ytn.useEffect)(()=>{if(!t)return;let o=i=>{let a=qtn(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=jtn(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function Xtn(e,t,r){let[n,o]=(0,VY.useState)([]),i=(0,VY.useRef)(0),a=cr(),s=(0,VY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await Vtn(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=Ktn(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function Ztn({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=Wtn(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=Xtn(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var arn=x(te(),1);var Qtn="assist:pr-preview-chain:",Yyt=e=>`${Qtn}${e}`;function Jtn(e){if(e)return oc(Yyt(e))[0]}function ern(e,t){e&&ku(Yyt(e),[t])}function trn(e){e&&rM(Yyt(e))}function rrn(){_R(Qtn)}function nrn(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};rrn();let n=Jtn(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function orn(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function irn(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function srn(e,t,r,n,o,i,a){let[s,l]=(0,arn.useState)(()=>nrn(n,t,o));return{chain:s,setChain:f=>{l(f),ern(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...orn(m,p,s,m?i.attachments():[],a()),...irn(m,h)}),v6e(e),m&&(trn(t),i.clearPersisted())}}}var yrn=x(te(),1);var zZo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,HZo=/^ {0,3}#{1,6}[ \t]/;function nP(e){let t=e.split(`
|
|
4151
|
+
`),additions:kJr(o,"+"),deletions:kJr(o,"-"),split:{hunks:o.length,of:n.length,elsewhere:i}}}function EJr(e){return e.flatMap(t=>{if(t.kind==="dir")return EJr(t.children);let{kind:r,name:n,...o}=t;return[o]})}function sZo(e){let t=new Map;return e.forEach((r,n)=>{for(let o of r.hunks)t.set(o,[...t.get(o)??[],n+1])}),t}function RJr(e,t,r=new Set,n=new Set){let o=EJr(e.tree).filter(a=>!r.has(a.path)).map(a=>n.has(a.path)?{...a,critical:!0}:a),i=sZo(t);return t.map((a,s)=>{let l=new Set(a.hunks.map(DY));return SJr(o.filter(u=>l.has(u.path)).map(u=>_Jr(u,s+1,i)))})}function lZo(e,t){let r=-1,n=0;return t.forEach((o,i)=>{let a=o.hunks.filter(s=>DY(s)===e).length;a>n&&(r=i,n=a)}),r}function PJr(e,t){let r=t.map(()=>[]);for(let n of e)r[lZo(n.path,t)]?.push(n);return r}function AJr(e,t){let r=RJr(e.structure,t,new Set(e.tests.map(i=>i.path)),new Set(e.criticalDiffs.map(i=>i.path))),n=PJr(e.tests,t),o=_Ae(t);return t.map((i,a)=>{let s=a+1;return{number:s,slice:i,structure:r[a]??e.structure,tests:n[a]??[],critical:e.criticalDiffs.filter(l=>o.get(l.path)?.some(u=>u.number===s))}})}function LJr(e){if(!e.slices)return;let t=AJr(e,e.slices);return{entries:pJr(e,t),slicing:{count:t.length,noCritical:new Set(t.filter(r=>r.critical.length===0).map(r=>r.number))}}}function IJr(e){let t=e;return typeof t?.id=="string"&&typeof t.title=="string"&&typeof t.reason=="string"&&(t.kind==="deterministic"||t.kind==="manual")&&["pass","fail","manual"].includes(t.status)}function zN(e,t){return Array.isArray(e)?t?e.filter(t):e:[]}var Dyt=e=>typeof e=="string"?e:"";function DJr(e){return{repo:Dyt(e.repo),prNumber:typeof e.prNumber=="number"?e.prNumber:0,headSha:Dyt(e.headSha),body:Dyt(e.body)}}var Myt={repo:"",prNumber:0,headSha:"",body:"",checks:[],structure:{tree:[],added:0,removed:0,modified:0,additions:0,deletions:0},criticalDiffs:[],criticalPaths:[],tests:[],testPaths:[],collapsedPaths:[]};function XAe(e){let t;try{t=JSON.parse(e)}catch{return Myt}return typeof t!="object"||t===null?Myt:{...DJr(t),checks:zN(t.checks,IJr),structure:{...Myt.structure,...t.structure},criticalDiffs:zN(t.criticalDiffs),criticalPaths:zN(t.criticalPaths),tests:zN(t.tests),testPaths:zN(t.testPaths),collapsedPaths:zN(t.collapsedPaths),...Array.isArray(t.slices)?{slices:t.slices}:{},...t.manualTesting?{manualTesting:t.manualTesting}:{},...t.saved?{saved:t.saved}:{},...t.progress?{progress:t.progress}:{}}}function MJr(e){let t=(0,Nyt.useMemo)(()=>XAe(e.body),[e.body]),r=(0,Nyt.useMemo)(()=>LJr(t),[t]);return{payload:t,sliced:r}}var NJr=x(te(),1);function OJr(e){let[t,r]=(0,NJr.useState)(()=>e?.reviewComments??[]);return{queued:t,onQueue:n=>r(o=>[...o,n]),onRemove:n=>r(o=>o.filter((i,a)=>a!==n)),onEdit:(n,o)=>r(i=>i.map((a,s)=>s===n?{...a,note:o}:a))}}var Qle=x(te(),1);function BJr(e,t,r){let n=(0,Qle.useRef)(!1),o=(0,Qle.useRef)(r);o.current=r,(0,Qle.useEffect)(()=>{if(!n.current){n.current=!0;return}o.current({items:e,reviewComments:t})},[e,t])}function FJr(e,t,r,n){let{payload:o,sliced:i}=MJr(e),{progress:a}=n,s=dJr(o.checks,a,i?.slicing),l=OJr(a),u=tJr(i?.entries??[]),{comments:d,sentTo:f,clearSent:p}=gY(t,r),h={...d,onQueue:l.onQueue};BJr(s.items,l.queued,n.onChange);let m=(0,$Jr.useMemo)(()=>aJr(o),[o]);return{payload:o,checklist:s,queue:l,details:iJr(o,h),counts:m,sentTo:f,clearSent:p,sliced:i,nav:u,diffComments:h}}var US=x(_(),1);function zJr({preview:e,session:t,sendInput:r,stored:n,onDecision:o}){let i=FJr(e,t,r,n);return(0,US.jsxs)(H,{sx:f0,children:[(0,US.jsx)(Fh,{preview:e,draft:!1}),(0,US.jsx)(vY,{items:e.metadata??[]}),(0,US.jsx)(Yn,{}),(0,US.jsx)(zQr,{payload:i.payload,checklist:i.checklist,details:i.details,counts:i.counts,sliced:i.sliced,nav:i.nav,comments:i.diffComments}),(0,US.jsx)(Yn,{}),(0,US.jsx)(JQr,{pane:i,onDecision:(a,s)=>{n.close(),o(a,s)}}),(0,US.jsx)(pf,{sessionName:i.sentTo,onClose:i.clearSent})]})}var JAe=x(te(),1);var Jle=x(te(),1);var ZAe="/api/high-level-progress";function HJr(e,t){let r,n,o=!1,i=s=>$t(Er(ZAe,t),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...s})}).catch(l=>xr(l,"high-level progress write")),a=async()=>{for(;r;){let s=r;r=void 0,await i(s)}n=void 0};return{write(s){o||(r=s,n??(n=a()))},close(){o=!0}}}function UJr(e,t){let{repo:r,prNumber:n,headSha:o,requestId:i}=e,a=(0,Jle.useMemo)(()=>r&&o?HJr({repo:r,prNumber:n,headSha:o,requestId:i},t):void 0,[r,n,o,i,t]),s=(0,Jle.useRef)(!1),l=(0,Jle.useRef)(void 0);return{markLoaded:()=>(s.current=!0,l.current&&a?.write(l.current),l.current!==void 0),onChange:u=>{l.current=u,s.current&&a?.write(u)},close:()=>a?.close()}}var QAe=x(te(),1);async function WJr(e,t){let r=new URLSearchParams({repo:e.repo,prNumber:String(e.prNumber),headSha:e.headSha}),n=await $t(Er(`${ZAe}?${r}`,t));if(!n.ok)throw new Error(`HTTP ${n.status}`);return(await n.json()).progress??void 0}function VJr(e,t,r){let n=(0,QAe.useRef)(r);n.current=r;let{repo:o,prNumber:i,headSha:a}=e;(0,QAe.useEffect)(()=>{if(!o||!a)return;let s=!1,l=u=>{s||n.current(u)};return WJr({repo:o,prNumber:i,headSha:a},t).then(l,()=>l(void 0)),()=>{s=!0}},[o,i,a,t])}function GJr(e,t){let r=(0,JAe.useMemo)(()=>XAe(e.body),[e.body]),n={repo:r.repo,prNumber:r.prNumber,headSha:r.headSha},[o,i]=(0,JAe.useState)(()=>({progress:r.progress??r.saved,version:0})),a=UJr({...n,requestId:e.requestId},t);return VJr(n,t,s=>{a.markLoaded()||!s||s.updatedAt!==r.progress?.updatedAt&&i(u=>({progress:s,version:u.version+1}))}),{...o,onChange:a.onChange,close:a.close}}var jJr=x(_(),1);function qJr({preview:e,session:t,sendInput:r,onDecision:n}){let o=GJr(e,t?.node);return(0,jJr.jsx)(zJr,{preview:e,session:t,sendInput:r,stored:o,onDecision:n},o.version)}var ten=x(te(),1);var HN=x(_(),1);function cZo(e){return e.topLeft===null?"Click the top-left box":e.bottomRight===null?"Now click the bottom-right box":"Both anchors picked"}function YJr({selection:e,onConfirm:t,onReject:r}){let n=e.topLeft!==null&&e.bottomRight!==null;return(0,HN.jsxs)(bt,{direction:"row",spacing:1,sx:{p:2,alignItems:"center",justifyContent:"flex-end"},children:[(0,HN.jsx)(ve,{variant:"body2",sx:{flex:1,color:"text.secondary"},children:cZo(e)}),(0,HN.jsx)(et,{color:"error",variant:"outlined",onClick:r,children:"Cancel"}),(0,HN.jsx)(et,{variant:"outlined",onClick:e.reset,children:"Start over"}),(0,HN.jsx)(et,{color:"success",variant:"contained",disabled:!n,onClick:t,children:"Extract boxes"})]})}var uZo={"top-left":nc.miro.topLeft,"bottom-right":nc.miro.bottomRight};function KJr(e,t){let r=e.right-e.left,n=e.bottom-e.top;return{width:r,height:n,fontSize:Math.max(6,Math.min(n*.3,r/6,28)),radius:Math.min(8,n/4),colour:t?uZo[t]:nc.miro.box,opacity:t?.75:.35,strokeWidth:Math.max(1,r*.004)}}var ece=x(_(),1);function XJr({box:e,role:t,onSelect:r}){let n=KJr(e,t);return(0,ece.jsxs)("g",{role:"button",tabIndex:0,"aria-label":t?`${e.text} (${t})`:e.text,onClick:()=>r(e.id),onKeyDown:o=>{o.key==="Enter"&&r(e.id)},style:{cursor:"pointer"},children:[(0,ece.jsx)("rect",{x:e.left,y:e.top,width:n.width,height:n.height,rx:n.radius,fill:n.colour,fillOpacity:n.opacity,stroke:n.colour,strokeWidth:n.strokeWidth}),(0,ece.jsx)("text",{x:e.left+n.width/2,y:e.top+n.height/2,textAnchor:"middle",dominantBaseline:"central",fontSize:n.fontSize,fill:nc.miro.text,children:e.text})]})}function ZJr(e){if(e.length===0)return"0 0 100 100";let t=Math.min(...e.map(a=>a.left)),r=Math.min(...e.map(a=>a.top)),n=Math.max(...e.map(a=>a.right))-t,o=Math.max(...e.map(a=>a.bottom))-r,i=Math.max(n*.02,8);return`${t-i} ${r-i} ${n+i*2} ${o+i*2}`}var e6e=x(_(),1);function QJr({boxes:e,selection:t}){return(0,e6e.jsx)(H,{sx:{flex:1,minHeight:0,overflow:"auto",p:2},children:(0,e6e.jsx)("svg",{role:"img","aria-label":"Miro board boxes",viewBox:ZJr(e),preserveAspectRatio:"xMidYMid meet",style:{width:"100%",height:"100%"},children:e.map(r=>(0,e6e.jsx)(XJr,{box:r,role:t.roleOf(r.id),onSelect:t.choose},r.id))})})}function dZo(e){return typeof e?.id=="string"&&typeof e.text=="string"&&[e.left,e.top,e.right,e.bottom].every(t=>typeof t=="number"&&Number.isFinite(t))}function JJr(e){try{let t=JSON.parse(e);return Array.isArray(t?.boxes)?t.boxes.filter(dZo):[]}catch{return[]}}var Oyt=x(te(),1);function een(){let[e,t]=(0,Oyt.useState)(null),[r,n]=(0,Oyt.useState)(null);return{topLeft:e,bottomRight:r,choose:s=>{if(e===null||r!==null){t(s),n(null);return}n(s)},reset:()=>{t(null),n(null)},roleOf:s=>s===e?"top-left":s===r?"bottom-right":null}}var Q3=x(_(),1);function ren({preview:e,onDecision:t}){let r=(0,ten.useMemo)(()=>JJr(e.body),[e.body]),n=een();return(0,Q3.jsxs)(H,{sx:f0,children:[(0,Q3.jsx)(Fh,{preview:e,draft:!1}),(0,Q3.jsx)(Yn,{}),(0,Q3.jsx)(QJr,{boxes:r,selection:n}),(0,Q3.jsx)(Yn,{}),(0,Q3.jsx)(YJr,{selection:n,onConfirm:()=>{let{topLeft:i,bottomRight:a}=n;i===null||a===null||t("approve",Gc({topLeft:i,bottomRight:a}))},onReject:()=>t("reject",Gc())})]})}var Den=x(te(),1);function nen(e){let t=[];return e.map(r=>(t.length=r+1,t[r]=(t[r]??0)+1,t.map(n=>n??1).join(".")))}function t6e(e){return e*22}function oen(e){return Math.round(e/22)}var ien={display:"flex",alignItems:"flex-start",gap:.25,"& .criterion-action":{opacity:0,transition:"opacity 120ms"},"&:hover .criterion-action":{opacity:1},"&:focus-within .criterion-action":{opacity:1},"& .criterion-action:focus-visible":{opacity:1}},aen={p:.25,mt:"2px",color:"text.disabled",cursor:"grab",touchAction:"none","&:active":{cursor:"grabbing"}},sen={fontFamily:"fontFamilyMono",fontSize:"0.8rem",color:"text.secondary",minWidth:32,pt:"5px",textAlign:"right",userSelect:"none",whiteSpace:"nowrap"},len={flex:1,fontSize:"inherit",lineHeight:1.5,px:.75,py:0,borderRadius:1,"&:hover":{bgcolor:"action.hover"},"&.Mui-focused":{bgcolor:"action.selected"}},Byt={p:.25,mt:"2px"},cen={position:"absolute",right:8,height:2,borderRadius:1,bgcolor:"primary.main",pointerEvents:"none"};var den=x(_(),1),fZo=8;function uen({drag:e}){return e?(0,den.jsx)(H,{sx:cen,style:{top:e.top-1,left:fZo+t6e(e.depth)}}):null}var fen=x(_(),1),pen=ot((0,fen.jsx)("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator");var $yt=x(_(),1);function hen({number:e,onGrip:t}){return(0,$yt.jsx)(Mt,{size:"small",className:"criterion-action",sx:aen,"aria-label":`Reorder criterion ${e}`,onPointerDown:t,children:(0,$yt.jsx)(pen,{fontSize:"inherit"})})}var xk=x(_(),1);function men({number:e,onAdd:t,onDelete:r}){return(0,xk.jsxs)(xk.Fragment,{children:[(0,xk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Byt,"aria-label":`Add criterion after ${e}`,onClick:t,children:(0,xk.jsx)(Kd,{fontSize:"inherit"})}),(0,xk.jsx)(Mt,{size:"small",className:"criterion-action",sx:Byt,"aria-label":`Delete criterion ${e}`,onClick:r,children:(0,xk.jsx)(Eo,{fontSize:"inherit"})})]})}var r6e=x(te(),1);function gen(e,t){return e==="start"?0:e==="end"?t:Math.min(Math.max(e,0),t)}function yen(e){let t=(0,r6e.useRef)(null);return(0,r6e.useEffect)(()=>{let r=t.current;if(!e||!r)return;r.focus();let n=gen(e.caret,r.value.length);r.setSelectionRange(n,n)},[e]),t}var UN=x(_(),1);function ven({index:e,number:t,item:r,outline:n,dragging:o,onGrip:i}){let a=yen(n.focus?.index===e?n.focus:null),s={marginLeft:t6e(r.depth),opacity:o?.4:1};return(0,UN.jsxs)(H,{sx:ien,"data-criterion-row":!0,style:s,children:[(0,UN.jsx)(hen,{number:t,onGrip:i}),(0,UN.jsx)(H,{component:"span",sx:sen,"aria-hidden":"true",children:`${t}.`}),(0,UN.jsx)(Ui,{multiline:!0,value:r.text,sx:len,inputRef:a,inputProps:{"aria-label":`Criterion ${t}`},onChange:l=>n.onText(e,l.target.value),onKeyDown:l=>n.onKeyDown(e,l)}),(0,UN.jsx)(men,{number:t,onAdd:()=>n.onAdd(e),onDelete:()=>n.onDelete(e)})]})}var ken=x(te(),1);function ben(e,t,{key:r,shift:n,alt:o,caret:i,text:a}){return o||n?null:r==="ArrowUp"&&i===0&&t>0?{kind:"focus",index:t-1}:r==="ArrowDown"&&i===a.length&&t<e.length-1?{kind:"focus",index:t+1}:null}function J3(e){if(e.length===0)return[{text:"",depth:0}];let t=-1;return e.map(r=>{let n=Math.min(Math.max(r.depth,0),t+1);return t=n,r.depth===n?r:{...r,depth:n}})}function n6e(e,t,r,n){let o=e[t]?.depth??0,i=e.map((a,s)=>s===t?{...a,text:r}:a);return{items:J3([...i.slice(0,t+1),{text:n,depth:o},...i.slice(t+1)]),index:t+1}}function bg(e,t){let r=t+1;for(;r<e.length&&e[r].depth>e[t].depth;)r+=1;return r}function o6e(e,t){let r=e[t].depth;for(let n=t-1;n>=0;n-=1){if(e[n].depth<r)return-1;if(e[n].depth===r)return n}return-1}function xen(e,t){let r=bg(e,t);return r<e.length&&e[r].depth===e[t].depth?r:-1}function Sen(e,t,r){let n=r<0?o6e(e,t):xen(e,t);if(n<0)return null;let o=bg(e,t),i=e.slice(t,o),a=[...e.slice(0,t),...e.slice(o)],s=r<0?n:bg(e,n)-(o-t);return{items:[...a.slice(0,s),...i,...a.slice(s)],index:s}}function i6e(e,t){let r=bg(e,t),n=e.map((o,i)=>i>t&&i<r?{...o,depth:o.depth-1}:o).filter((o,i)=>i!==t);return{items:J3(n),index:Math.max(0,t-1)}}function Ten(e,t,r){if(r<0&&e[t].depth===0||r>0&&o6e(e,t)<0)return null;let n=bg(e,t);return e.map((o,i)=>i>=t&&i<n?{...o,depth:o.depth+r}:o)}function a6e(e,t){return e?{kind:"edit",edit:e,caret:t}:null}function pZo(e,t,{caret:r,text:n}){let o=n.slice(0,r);return a6e(n6e(e,t,o,n.slice(r)),"start")}function hZo(e,t,{shift:r,caret:n}){let o=Ten(e,t,r?-1:1);return a6e(o?{items:o,index:t}:null,n)}function wen(e,t,r){let{key:n,shift:o,alt:i,caret:a,text:s}=r;return n==="Enter"&&!o?pZo(e,t,r):n==="Tab"?hZo(e,t,r):i&&(n==="ArrowUp"||n==="ArrowDown")?a6e(Sen(e,t,n==="ArrowUp"?-1:1),a):n==="Backspace"&&a===0&&s===""?a6e(i6e(e,t),"end"):null}function Cen(e,t,r){return wen(e,t,r)??ben(e,t,r)}function _en(e,t){let[r,n]=(0,ken.useState)(null),o=(a,s)=>{a&&(t(a.items),n({index:a.index,caret:s}))};return{focus:r,onKeyDown:(a,s)=>{let l=s.currentTarget;(s.key==="Enter"||s.key==="Tab")&&s.preventDefault();let u=Cen(e,a,{key:s.key,shift:s.shiftKey,alt:s.altKey,caret:l.selectionStart??0,text:l.value});u&&(s.preventDefault(),u.kind==="focus"?n({index:u.index,caret:"end"}):o(u.edit,u.caret))},onDrop:a=>o(a,"end"),onText:(a,s)=>t(e.map((l,u)=>u===a?{...l,text:s}:l)),onAdd:a=>o(n6e(e,a,e[a].text,""),"start"),onDelete:a=>o(i6e(e,a),"end")}}var Len=x(te(),1);function mZo(e,t,r,n){let o=t.length;for(let a=0;a<e.length;a+=1)if(n<e[a].top+e[a].height/2){o=a;break}let i=bg(t,r);return o>r&&o<i?r:o}function gZo(e,t,r,n){let o=bg(e,t),i=r-1,a=i>=t&&i<o?t-1:i,s=a>=0?e[a].depth+1:0;return Math.max(0,Math.min(e[t].depth+oen(n),s))}function yZo(e,t){if(t<e.length)return e[t].top;let r=e[e.length-1];return r?r.top+r.height:0}function Een(e,t,r,n,o){let i=mZo(e,t,r,o);return{target:i,depth:gZo(t,r,i,n),top:yZo(e,i)}}function vZo(e){let t=e.getBoundingClientRect().top;return{boxes:Array.from(e.querySelectorAll("[data-criterion-row]")).map(n=>{let o=n.getBoundingClientRect();return{top:o.top-t,height:o.height}}),origin:t}}function Ren(e,t,r,n){return o=>{let{boxes:i,origin:a}=vZo(t);return Een(i,e,r,o.clientX-n,o.clientY-a)}}function Pen(e,t,r,n,o){let i=new AbortController,a=null,s=d=>{a=r(d),n(a)},l=()=>{i.abort(),a&&o(a)},u={signal:i.signal};return e.setPointerCapture(t),e.addEventListener("pointermove",s,u),e.addEventListener("pointerup",l,u),e.addEventListener("pointercancel",l,u),s}function Aen(e,t,r,n){let o=bg(e,t),i=n-e[t].depth,a=e.slice(t,o).map(u=>({...u,depth:Math.max(0,u.depth+i)})),s=[...e.slice(0,t),...e.slice(o)],l=r>t?r-a.length:r;return{items:J3([...s.slice(0,l),...a,...s.slice(l)]),index:l}}function Ien(e,t,r){let[n,o]=(0,Len.useState)(null);return{drag:n,onGrip:a=>s=>{let l=t.current;if(!l||s.pointerType==="mouse"&&s.button!==0)return;s.preventDefault(),Pen(s.currentTarget,s.pointerId,Ren(e,l,a,s.clientX),d=>o({from:a,depth:d.depth,top:d.top}),d=>{o(null),r(Aen(e,a,d.target,d.depth))})(s)}}}var tce=x(_(),1),bZo={my:1,px:1,py:.5,border:1,borderColor:"divider",borderRadius:1,position:"relative",userSelect:"text",cursor:"auto"},xZo=[{text:"",depth:0}];function Men({items:e,onChange:t}){let r=(0,Den.useRef)(null),n=e.length>0?e:xZo,o=_en(n,t),{drag:i,onGrip:a}=Ien(n,r,o.onDrop),s=nen(n.map(l=>l.depth));return(0,tce.jsxs)(H,{sx:bZo,ref:r,"data-preview-skip":!0,"aria-label":"Acceptance criteria",children:[n.map((l,u)=>(0,tce.jsx)(ven,{index:u,number:s[u],item:l,outline:o,dragging:i?.from===u,onGrip:a(u)},`criterion-${u}`)),(0,tce.jsx)(uen,{drag:i})]})}var Nen=x(_(),1),Oen=ot((0,Nen.jsx)("path",{d:"M2 17h2v.5H3v1h1v.5H2v1h3v-4H2zm1-9h1V4H2v1h1zm-1 3h1.8L2 13.1v.9h3v-1H3.2L5 10.9V10H2zm5-6v2h14V5zm0 14h14v-2H7zm0-6h14v-2H7z"}),"FormatListNumbered");var rce=x(_(),1),SZo={insert:"Add acceptance criteria",convert:"Convert to outline"};function Ben({kind:e,onClick:t}){return(0,rce.jsx)(H,{sx:{my:1},"data-preview-skip":!0,children:(0,rce.jsx)(et,{size:"small",variant:"outlined",startIcon:e==="insert"?(0,rce.jsx)(Kd,{}):(0,rce.jsx)(Oen,{}),onClick:t,children:SZo[e]})})}var nce=x(te(),1);function $en(e,t,{color:r,pin:n}){let o=j6(e),i=[],a=o.nextNode();for(;a;){let u=a;if(t.intersectsNode(u)){let d=u===t.startContainer?t.startOffset:0,f=u===t.endContainer?t.endOffset:u.length;d<f&&i.push({node:u,start:d,end:f})}a=o.nextNode()}let l=i.map(u=>TZo(u.node,u.start,u.end,r)).at(-1);l&&n&&(l.dataset.pin=n)}function TZo(e,t,r,n){let o=document.createRange();o.setStart(e,t),o.setEnd(e,r);let i=document.createElement("mark");return i.className="pr-comment",i.style.backgroundColor=n,o.surroundContents(i),i}function Fen(e){for(let t of e.querySelectorAll("mark.pr-comment"))if(t.parentNode){for(;t.firstChild;)t.before(t.firstChild);t.remove()}}function zen(e,t){for(let r of t){let n=$7t(e,r);n&&$en(e,n,r)}}var oce=x(_(),1);function Hen({content:e,control:t,trailing:r,ranges:n,contentRef:o}){let i=(0,nce.useMemo)(()=>ZD(e),[e]),a=(0,nce.useMemo)(()=>ZD(r??""),[r]);return(0,nce.useLayoutEffect)(()=>{let s=o.current;s&&(Fen(s),zen(s,n))},[i,a,n,o]),(0,oce.jsxs)(H,{ref:o,children:[(0,oce.jsx)(jD,{segments:i,skipDiagramText:!0}),t,t?(0,oce.jsx)(jD,{segments:a,skipDiagramText:!0}):null]})}var WN=e=>e.split(",").map(t=>`&& .markdown ${t.trim()}`).join(", ");function s6e(e){let{color:t,radius:r}=e.tokens;return{px:2.5,py:2,fontSize:14,lineHeight:1.6,[WN("")]:{lineHeight:1.6},[WN("h1, h2, h3, h4, h5, h6")]:{fontSize:15,fontWeight:600,lineHeight:1.4,mt:2,mb:1},[WN("ul, ol")]:{pl:2.5,mb:2},[WN("li")]:{mb:"6px"},[WN("code")]:{fontFamily:e.typography.fontFamilyMono,fontSize:"0.86em",px:"5px",py:0,bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:"4px"},[WN("pre")]:{bgcolor:t.raised,border:1,borderColor:t.lineSoft,borderRadius:`${r.sm}px`},[WN("pre code")]:{border:0,px:0,bgcolor:"transparent"}}}var Uen=e=>({flex:1,overflow:"auto",position:"relative",userSelect:"none",cursor:"text",wordBreak:"break-word","& .markdown":{...g9(e),maxWidth:"none"},"& a":{color:"primary.main"},"& mark.pr-comment":{color:"inherit",borderRadius:"2px"},...s6e(e)});var UY=x(_(),1);function Wen({content:e,control:t,trailing:r,ranges:n,wrapperRef:o,contentRef:i,dragRects:a,dragColor:s,onMouseDown:l,footer:u}){return(0,UY.jsxs)(H,{ref:o,onMouseDown:l,sx:Uen,children:[(0,UY.jsx)(Hen,{content:e,control:t,trailing:r,ranges:n,contentRef:i}),u&&(0,UY.jsx)(H,{sx:{userSelect:"text"},children:u}),(0,UY.jsx)(a9,{rects:a,color:s})]})}function Ven(e){let t=new Map,r=[];for(let n of e){if(!n.group){r.push(n);continue}t.set(n.group,[...t.get(n.group)??[],n])}return{groups:[...t],ungrouped:r}}var l6e=x(te(),1),Gen=x(_(),1);function Fyt({label:e,value:t,onCommit:r,listId:n}){let[o,i]=(0,l6e.useState)(t);return(0,l6e.useEffect)(()=>i(t),[t]),(0,Gen.jsx)(An,{size:"small",variant:"standard",fullWidth:!0,label:e,value:o,onChange:s=>i(s.target.value),onBlur:()=>{let s=o.trim();i(t),s!==t&&r(s)},onKeyDown:s=>{s.key==="Enter"&&s.target.blur()},onMouseDown:s=>s.stopPropagation(),slotProps:{htmlInput:{list:n}}})}var ice=x(_(),1),zyt="screenshot-groups";function wZo(e){return(e.split(/[\\/]/).pop()??e).replace(/\.[^.]+$/,"")}function qen({screenshot:e,onUpdate:t}){return(0,ice.jsxs)(bt,{direction:"row",spacing:1,sx:{mt:.5},children:[(0,ice.jsx)(Fyt,{label:"Caption",value:e.alt,onCommit:r=>t(e.id,{alt:r||wZo(e.path)})}),(0,ice.jsx)(Fyt,{label:"Group",value:e.group??"",listId:zyt,onCommit:r=>t(e.id,{group:r})})]})}var eP=x(_(),1),jen={display:"block",maxWidth:"100%",borderRadius:1,border:1,borderColor:"divider"},CZo={position:"absolute",top:4,right:4,bgcolor:"background.paper","&:hover":{bgcolor:"background.paper"}};function Yen({screenshot:e,onRemove:t,onUpdate:r}){let n=e.contentType.startsWith("video/");return(0,eP.jsxs)(H,{sx:{position:"relative"},children:[n?(0,eP.jsx)(H,{component:"video",controls:!0,src:e.url,"aria-label":"screenshot",sx:jen}):(0,eP.jsx)(H,{component:"img",src:e.url,alt:"screenshot",sx:jen}),(0,eP.jsx)(Mt,{size:"small","aria-label":"Remove screenshot",sx:CZo,onMouseDown:o=>o.stopPropagation(),onClick:()=>t(e.id),children:(0,eP.jsx)(Eo,{fontSize:"small"})}),(0,eP.jsx)(qen,{screenshot:e,onUpdate:r})]})}var x0=x(_(),1);function kZo(){return(0,x0.jsxs)(bt,{direction:"row",spacing:1,sx:{alignItems:"center"},children:[(0,x0.jsx)(Vn,{size:16}),(0,x0.jsx)(ve,{variant:"caption",color:"text.secondary",children:"Attaching screenshot or video\u2026"})]})}function _Zo({error:e}){return(0,x0.jsx)(ve,{variant:"caption",color:"error",sx:{wordBreak:"break-word"},children:e})}function Ken({uploads:e,empty:t}){return e.length>0?(0,x0.jsx)(x0.Fragment,{children:e.map(r=>r.error?(0,x0.jsx)(_Zo,{error:r.error},r.id):(0,x0.jsx)(kZo,{},r.id))}):t?(0,x0.jsx)(ve,{variant:"caption",color:"text.secondary",children:"Drop or paste an image or video to attach"}):null}var S0=x(_(),1),EZo={display:"grid",gridTemplateColumns:"repeat(2, minmax(0, 1fr))",gap:1};function Xen({screenshots:e,uploads:t,onRemove:r,onUpdate:n}){let{groups:o,ungrouped:i}=Ven(e),a=s=>(0,S0.jsx)(Yen,{screenshot:s,onRemove:r,onUpdate:n},s.id);return(0,S0.jsxs)(H,{sx:{mt:3},children:[e.length>0&&(0,S0.jsx)(H,{component:"h2",children:"Screenshots"}),(0,S0.jsx)("datalist",{id:zyt,children:o.map(([s])=>(0,S0.jsx)("option",{value:s},s))}),o.map(([s,l])=>(0,S0.jsxs)(H,{sx:{mb:2},children:[(0,S0.jsx)(H,{component:"h3",children:s}),(0,S0.jsx)(H,{sx:EZo,children:l.map(a)})]},s)),(0,S0.jsxs)(bt,{spacing:1,children:[i.map(a),(0,S0.jsx)(Ken,{uploads:t,empty:e.length===0})]})]})}var ace=x(_(),1);function RZo(e){let t=e.criteria;if(!t)return{content:e.body};let r={content:t.before,trailing:t.after};return t.kind==="outline"?{...r,control:(0,ace.jsx)(Men,{items:t.items,onChange:e.onCriteriaChange})}:{...r,control:(0,ace.jsx)(Ben,{kind:t.kind,onClick:t.kind==="insert"?e.onCriteriaInsert:e.onCriteriaConvert})}}function c6e({pane:e,screenshots:t}){return(0,ace.jsx)(Wen,{...RZo(e),ranges:e.ranges,wrapperRef:e.wrapperRef,contentRef:e.contentRef,dragRects:e.dragRects,dragColor:e.dragColor,onMouseDown:e.onMouseDown,footer:t?(0,ace.jsx)(Xen,{screenshots:e.screenshots,uploads:e.uploads,onRemove:e.removeScreenshot,onUpdate:e.updateScreenshot}):void 0})}var Zen=e=>({display:"grid",gap:1,maxHeight:220,overflow:"auto",px:2,py:1.25,borderTop:1,borderColor:e.tokens.color.lineSoft}),Qen={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"text.secondary"},Jen=e=>({display:"grid",gridTemplateColumns:"minmax(0, 1fr) auto",gap:"4px 8px",px:1.25,py:1,borderRadius:`${e.tokens.radius.sm}px`,bgcolor:e.tokens.color.raised,border:1,borderColor:e.tokens.color.lineSoft,fontSize:12.5}),etn={gridColumn:2,gridRow:1,width:20,height:20,color:"text.disabled","& .MuiSvgIcon-root":{fontSize:14}};var Sk=x(_(),1);function ttn({comments:e,colors:t,onRemove:r}){return(0,Sk.jsxs)(H,{sx:Zen,children:[(0,Sk.jsxs)(ve,{sx:Qen,children:["Comments (",e.length,")"]}),e.map((n,o)=>(0,Sk.jsxs)(H,{sx:Jen,children:[(0,Sk.jsx)(r9,{text:n.quote,sx:{gridColumn:1,borderLeft:2,pl:1,borderColor:t[o]}}),(0,Sk.jsx)(H,{sx:{gridColumn:1,wordBreak:"break-word"},children:n.note}),(0,Sk.jsx)(Mt,{"aria-label":"Remove comment",onClick:()=>r(n.id),sx:etn,children:(0,Sk.jsx)(Eo,{})})]},n.id))]})}var ntn=x(_(),1);function rtn(e){return e.comments.length===0?null:(0,ntn.jsx)(ttn,{...e})}var otn=x(_(),1),u6e=ot((0,otn.jsx)("path",{d:"M20 18c1.1 0 1.99-.9 1.99-2L22 6c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2H0v2h24v-2zM4 6h16v10H4z"}),"Computer");var utn=x(te(),1);var itn=x(_(),1),atn=ot((0,itn.jsx)("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2"}),"Circle");var T0="0.1219.0";var PZo={connected:"success.main",connecting:"warning.main",disconnected:"error.main","version-blocked":"error.main"};function stn(e){return e?PZo[e]:"success.main"}function ltn(e){return e.split("-")[0].split(".").map(Number)}function ctn(e,t){if(!e||!t||e===t)return;let r=ltn(e),n=ltn(t);for(let o=0;o<Math.max(r.length,n.length);o++){let i=(r[o]??0)-(n[o]??0);if(Number.isNaN(i))return;if(i!==0)return i<0?"behind":"ahead"}}var d6e=x(te(),1),Hyt=(0,d6e.createContext)(null);function f6e(){return(0,d6e.useContext)(Hyt)}var VN=x(_(),1),AZo={height:16,fontSize:10},LZo={opacity:.6,fontSize:"0.85em"};function IZo(e,t){if(t===e.local)return"this machine";let r=e.links.find(n=>n.name===t);return r?r.error?`${r.state}: ${r.error}`:r.state:""}function tP({nodes:e,name:t,showVersion:r=!1}){let n=f6e()??T0,o=e.links.find(a=>a.name===t),i=ctn(o?.peerVersion,n);return(0,VN.jsx)(lr,{title:IZo(e,t),placement:"right",children:(0,VN.jsxs)(H,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75},children:[(0,VN.jsx)(atn,{sx:{fontSize:8,color:stn(o?.state)}}),t,r&&o?.peerVersion&&(0,VN.jsxs)(H,{component:"span",sx:LZo,children:["v",o.peerVersion]}),i&&(0,VN.jsx)(vn,{label:i,size:"small",color:i==="behind"?"warning":"info",sx:AZo})]})})}var w0=x(_(),1),DZo={textTransform:"none"};function p6e({nodes:e,options:t,target:r,onPick:n}){let[o,i]=(0,utn.useState)(null);return(0,w0.jsxs)(w0.Fragment,{children:[(0,w0.jsx)(et,{size:"small",color:"inherit",startIcon:(0,w0.jsx)(u6e,{fontSize:"small"}),"aria-label":"Start on node","aria-haspopup":"menu",onClick:a=>i(a.currentTarget),sx:DZo,children:(0,w0.jsx)(tP,{nodes:e,name:r.node})}),(0,w0.jsx)(gi,{anchorEl:o,open:!!o,onClose:()=>i(null),children:t.map(({name:a,cwd:s})=>(0,w0.jsx)(Nr,{disabled:!s,selected:a===r.node,onClick:()=>{n(a),i(null)},children:(0,w0.jsx)(yc,{primary:(0,w0.jsx)(tP,{nodes:e,name:a}),secondary:s?void 0:"no clone"})},a))})]})}var dtn=x(te(),1);function MZo(e,t){return e?.toLowerCase()===t.toLowerCase()}function h6e(e,t){let{nodes:r,names:n,visible:o}=ds(),{repos:i,selectedCwd:a,selectedNode:s,cloneOn:l,originOf:u}=xn(),[d,f]=(0,dtn.useState)(),p=e&&u(e)?e:a,h=t?i.find(b=>MZo(u(b),t)):p,m=n.map(b=>({name:b,cwd:h?l(h,b):void 0})),g=b=>m.find(S=>S.name===b&&S.cwd),y=g(d)??g(s??r?.local)??m.find(b=>b.cwd),v=o&&y?.cwd?{node:y.name,cwd:y.cwd}:void 0;return{nodes:r,visible:o,options:m,target:v,pick:f}}var rP=x(_(),1);function ftn({canStart:e,startOrigin:t,cwd:r,onApprove:n,onApproveAndStart:o}){let i=$ge(),a=h6e(r,t);return(0,rP.jsxs)(rP.Fragment,{children:[(0,rP.jsx)(et,{color:"primary",variant:e?"tonal":"contained",onClick:n,...e?{}:i,children:"Approve"}),e&&a.nodes&&a.target&&(0,rP.jsx)(p6e,{nodes:a.nodes,options:a.options,target:a.target,onPick:a.pick}),e&&(0,rP.jsx)(et,{color:"primary",variant:"contained",onClick:()=>o(a.target),...i,children:"Approve & start"})]})}var Uyt=x(_(),1),NZo={"& .MuiFormControlLabel-label":{fontSize:12}};function sce({label:e,title:t,checked:r,onChange:n}){return(0,Uyt.jsx)(zd,{control:(0,Uyt.jsx)(Op,{size:"small",checked:r,onChange:o=>n(o.target.checked)}),label:e,title:t,sx:NZo})}var GN=x(_(),1);function m6e({chain:e,newPr:t,onChange:r}){return(0,GN.jsxs)(bt,{direction:"row",sx:{mr:"auto"},children:[t&&(0,GN.jsx)(sce,{label:"Draft",title:"Create the PR as a draft rather than ready for review",checked:e.draft,onChange:n=>r({...e,draft:n,autoMerge:n?!1:e.autoMerge})}),(0,GN.jsx)(sce,{label:"Auto-merge (squash)",title:"Squash-merge the PR automatically once its required checks pass",checked:e.autoMerge,onChange:n=>r({...e,autoMerge:n,draft:n?!1:e.draft})}),(0,GN.jsx)(sce,{label:"Review PR",title:"After raising, run a review that posts its findings and then addresses them",checked:e.reviewAfter,onChange:n=>r({...e,reviewAfter:n})}),(0,GN.jsx)(sce,{label:"Post to Slack",title:"Announce the PR in Slack at the tail of the chain",checked:e.announceAfter,onChange:n=>r({...e,announceAfter:n})})]})}var qN=x(_(),1);function ptn({commentCount:e,chain:t,newPr:r,canStart:n,startOrigin:o,onChainChange:i,onApprove:a,cwd:s,onApproveAndStart:l,onReject:u,onRequestChanges:d}){return(0,qN.jsxs)(bt,{direction:"row",spacing:1,sx:{px:2,py:1.5,alignItems:"center",justifyContent:"flex-end"},children:[t&&(0,qN.jsx)(m6e,{chain:t,newPr:r,onChange:i}),(0,qN.jsx)(et,{color:"error",variant:"outlined",onClick:u,children:"Reject"}),e>0&&(0,qN.jsxs)(et,{color:"warning",variant:"tonal",onClick:d,children:["Request changes (",e,")"]}),(0,qN.jsx)(ftn,{canStart:n,startOrigin:o,cwd:s,onApprove:a,onApproveAndStart:l})]})}var mtn=x(_(),1);function htn({comments:e,cwd:t,onDecision:r,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s}){let l=()=>e.map(u=>({quote:u.quote,note:u.note}));return(0,mtn.jsx)(ptn,{commentCount:e.length,chain:n,newPr:o,canStart:i,startOrigin:a,onChainChange:s,onApprove:()=>r("approve",l()),cwd:t,onApproveAndStart:u=>r("approve",l(),u??!0),onReject:()=>r("reject",[]),onRequestChanges:()=>r("reject",l())})}var Tk=x(_(),1);function gtn(e){let{comments:t,commentColors:r,pending:n,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onRemove:d,onCancel:f,onCollapse:p,editable:h}=e;return(0,Tk.jsxs)(Tk.Fragment,{children:[(0,Tk.jsx)(rtn,{comments:t,colors:r,onRemove:d}),(0,Tk.jsx)(Yn,{}),(0,Tk.jsx)(htn,{...e}),(0,Tk.jsx)(e0e,{pending:n,editable:h,cwd:o,unavailable:i,onAdd:a,onQueue:s,onCite:l,onAddRule:u,onCancel:f,onCollapse:p})]})}var lce=x(_(),1),OZo={px:2,pb:2,display:"flex",alignItems:"center",gap:1.5,minWidth:0},BZo={color:"text.secondary",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"};function ytn({url:e}){return(0,lce.jsxs)(H,{sx:OZo,children:[(0,lce.jsx)(et,{variant:"contained",href:e,target:"_blank",rel:"noopener noreferrer",sx:{flexShrink:0},children:"Open design \u2197"}),(0,lce.jsx)(ve,{variant:"body2",sx:BZo,title:e,children:e})]})}var Wyt=x(_(),1);function vtn({preview:e}){let t=e.kind==="design"?e.metadata?.[0]?.url:void 0;return t?(0,Wyt.jsx)(ytn,{url:t}):(0,Wyt.jsx)(vY,{items:e.metadata??[]})}function btn({preview:e,pane:t,cwd:r,isPr:n,editable:o,sender:i,onCite:a,onAddRule:s}){return{comments:t.comments,commentColors:t.commentColors,pending:t.pending,cwd:r,unavailable:i.unavailable,onAdd:i.onSend,onQueue:t.onAdd,onCite:a,onAddRule:s,onRemove:t.remove,onCancel:t.onCancel,onCollapse:t.onCollapse,onDecision:t.onDecide,chain:n?t.chain:void 0,editable:o,newPr:n&&e.prNumber===null,canStart:e.kind==="backlog-item"&&e.canStart===!0,startOrigin:e.startOrigin,onChainChange:t.setChain}}function WY(e){let t=e??"pr";return{isPr:t==="pr",screenshots:t==="pr"||t==="github-issue"||t==="github-issue-edit"||t==="github-issue-comment",editable:t==="github-issue-edit",closeOnly:t==="show"}}function xtn(e,t){return e?`${e}:${t??"pr"}`:void 0}function g6e(e,t,r,n){return{...WY(e.kind),requestId:e.requestId,supersedes:e.supersedes,sessionId:t,cwd:r,onDecision:n,screenshotScope:xtn(t,e.kind),seededScreenshots:e.screenshots??[],chainDefaults:{draft:e.draft===!0,reviewAfter:e.reviewAfter??!0},initialBody:e.body}}function Stn(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,U_e({quote:r,note:o})),n()}}function Ttn(e,t,r,n){if(!(!e||!t))return o=>{r!==void 0&&dl(t,e,Xx(r,Hye(o))),n()}}function y6e(e,t,r,n){return{onCite:Ttn(e,t,r,n),onAddRule:Stn(e,t,r,n)}}function wtn(e){return{criteria:e.criteria,onCriteriaChange:e.writeCriteria,onCriteriaInsert:e.insertCriteria,onCriteriaConvert:e.convertCriteria}}var Itn=x(te(),1);var wk=x(te(),1);var Ctn="assist:pr-preview-comments:",Vyt=e=>`${Ctn}${e}`;function Gyt(e){return oc(Vyt(e))}function cce(e,t){ku(Vyt(e),t)}function v6e(e){rM(Vyt(e))}function ktn(){_R(Ctn)}function _tn(e){let t=j6(e),r="";for(let n=t.nextNode();n;n=t.nextNode())r+=n.textContent??"";return r}function $Zo(e,t,r){let n=-1;for(let o=e.indexOf(t);o!==-1;o=e.indexOf(t,o+1))(n===-1||Math.abs(o-r)<Math.abs(n-r))&&(n=o);return n}function Etn(e,t){return e.flatMap(r=>{let n=$Zo(t,r.quote,r.start);return n===-1?[]:[{...r,start:n,end:n+r.quote.length}]})}function Rtn(e,t,r){let n=Gyt(e);if(n.length>0||!t||!r)return n;let o=Etn(Gyt(t),_tn(r));return cce(e,o),v6e(t),o}function Ptn(e,t,r){let[n,o]=(0,wk.useState)([]),i=(0,wk.useRef)(0);(0,wk.useEffect)(()=>{ktn(),o(Rtn(e,t,r.current).map(l=>({...l,id:i.current++})))},[e,t,r]);let a=(0,wk.useCallback)(l=>{o(u=>{let d=[...u,{...l,id:i.current++}];return cce(e,d),d})},[e]),s=(0,wk.useCallback)(l=>{o(u=>{let d=u.filter(f=>f.id!==l);return cce(e,d),d})},[e]);return{comments:n,add:a,remove:s}}function Atn(e,t){let r=e.map((i,a)=>zG(a).solid),n=zG(e.length).fill,o=e.map((i,a)=>({start:i.start,end:i.end,color:zG(a).fill,pin:String(a+1)}));return t&&o.push({start:t.start,end:t.end,color:n}),{commentColors:r,dragColor:n,ranges:o}}function Ltn(e,t,r,n){return{onAdd:o=>{e&&t({quote:e.quote,note:o,start:e.start,end:e.end}),n()},onCollapse:()=>{e&&r(e.quote),n()}}}function Dtn(e,t,r){let{wrapperRef:n,contentRef:o,pending:i,dragRects:a,onMouseDown:s,clear:l,select:u}=Xy(),{comments:d,add:f,remove:p}=Ptn(e,t,o),{commentColors:h,dragColor:m,ranges:g}=(0,Itn.useMemo)(()=>Atn(d,i),[d,i]),{onAdd:y,onCollapse:v}=Ltn(i,f,r,l);return{wrapperRef:n,contentRef:o,onMouseDown:s,comments:d,commentColors:h,remove:p,pending:i,ranges:g,dragRects:a,dragColor:m,onAdd:y,onCollapse:v,onCancel:l,onSelect:u}}var x6e=x(te(),1);var qyt="assist:preview-screenshots:",jyt=e=>`${qyt}${e}`,b6e=e=>`${qyt}seeded:${e}`;function Mtn(e){return e?(_R(qyt),oc(jyt(e)).filter(t=>typeof t.path=="string")):[]}function jN(e,t){e&&ku(jyt(e),t.map(({path:r,alt:n,group:o,contentType:i,seeded:a})=>({path:r,alt:n,group:o,contentType:i,seeded:a})))}function Ntn(e){e&&(rM(jyt(e)),rM(b6e(e)))}var YN=x(te(),1);var Otn={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","video/mp4":"mp4","video/webm":"webm","video/quicktime":"mov"};function FZo(e){let t=e.split(".").pop()?.toLowerCase();return Object.entries(Otn).find(([,n])=>n===t)?.[0]??"application/octet-stream"}function Btn(e){return e.map(t=>({...t,contentType:FZo(t.path),seeded:!0}))}function $tn(e,t,r){if(!e)return Btn(r);let n=Mtn(e);if(oc(b6e(e))[0]===t)return n;let o=[...Btn(r),...n.filter(i=>!i.seeded)];return jN(e,o),ku(b6e(e),[t]),o}function Ftn(e,t){let r=new URLSearchParams({path:e});return t&&r.set("node",t),sv(`/api/pr-preview/image?${r}`)}function ztn(e,t,r){let[n,o]=(0,YN.useState)([]),i=(0,YN.useRef)(0),a=cr(),s=(0,YN.useRef)(r);return s.current=r,(0,YN.useEffect)(()=>{o($tn(e,t,s.current).map(l=>({...l,url:Ftn(l.path,a),id:i.current++})))},[e,t,a]),{screenshots:n,setScreenshots:o,nextId:i}}var Htn=x(te(),1);function Utn(e,t){return(0,Htn.useCallback)((r,n)=>{t(o=>{let i=o.map(a=>a.id===r?{...a,...n}:a);return jN(e,i),i})},[e,t])}function Wtn(e,t,r){let{screenshots:n,setScreenshots:o,nextId:i}=ztn(e,t,r),a=(0,x6e.useCallback)(d=>{o(f=>{let p=[...f,{...d,id:i.current++}];return jN(e,p),p})},[e,o,i]),s=(0,x6e.useCallback)(d=>{o(f=>{let p=f.find(m=>m.id===d);p?.url.startsWith("blob:")&&URL.revokeObjectURL(p.url);let h=f.filter(m=>m.id!==d);return jN(e,h),h})},[e,o]),l=Utn(e,o),u=(0,x6e.useCallback)(()=>Ntn(e),[e]);return{screenshots:n,add:a,remove:s,update:l,clearPersisted:u}}var VY=x(te(),1);async function Vtn(e,t,r){let n=new URLSearchParams;t&&n.set("cwd",t),r&&n.set("node",r),e instanceof File&&e.name&&n.set("name",e.name);let o=await $t(`/api/pr-preview/upload-image?${n}`,{method:"POST",headers:{"Content-Type":e.type||"application/octet-stream"},body:e,timeoutMs:12e4}),i=await o.json().catch(()=>null);if(!o.ok||!i?.path)throw new Error(i?.error??"Failed to attach file");return{path:i.path,alt:i.alt??"screenshot"}}var Ytn=x(te(),1);function Gtn(e){return e.startsWith("image/")||e.startsWith("video/")}function qtn(e){if(!e)return null;for(let t of e.items)if(t.kind==="file"&&Gtn(t.type)){let r=t.getAsFile();if(r)return r}return null}function jtn(e){return e?Array.from(e.files).find(t=>Gtn(t.type))??null:null}function Ktn(e,t){return(0,Ytn.useEffect)(()=>{if(!t)return;let o=i=>{let a=qtn(i.clipboardData);a&&(i.preventDefault(),e(a))};return globalThis.addEventListener("paste",o),()=>globalThis.removeEventListener("paste",o)},[e,t]),t?{onDrop:o=>{let i=jtn(o.dataTransfer);i&&(o.preventDefault(),e(i))},onDragOver:o=>{Array.from(o.dataTransfer.items).some(i=>i.kind==="file")&&o.preventDefault()}}:{onDrop:void 0,onDragOver:void 0}}function Xtn(e,t,r){let[n,o]=(0,VY.useState)([]),i=(0,VY.useRef)(0),a=cr(),s=(0,VY.useCallback)(async d=>{let f=i.current++;o(p=>[...p.filter(h=>!h.error),{id:f}]);try{let p=await Vtn(d,e,a);t({...p,url:URL.createObjectURL(d),contentType:d.type}),o(h=>h.filter(m=>m.id!==f))}catch(p){let h=p instanceof Error?p.message:"Failed to attach file";o(m=>m.map(g=>g.id===f?{id:f,error:h}:g))}},[e,a,t]),{onDrop:l,onDragOver:u}=Ktn(s,r);return{uploads:n,onDrop:l,onDragOver:u}}function Ztn({cwd:e,screenshots:t,screenshotScope:r,requestId:n,seededScreenshots:o}){let{screenshots:i,add:a,remove:s,update:l,clearPersisted:u}=Wtn(t?r:void 0,n,t?o:[]),{uploads:d,onDrop:f,onDragOver:p}=Xtn(e,a,t);return{screenshots:i,removeScreenshot:s,updateScreenshot:l,decision:{attachments:()=>i.map(({path:h,alt:m,group:g})=>g?{path:h,alt:m,group:g}:{path:h,alt:m}),clearPersisted:u},uploads:d,onDrop:f,onDragOver:p}}var arn=x(te(),1);var Qtn="assist:pr-preview-chain:",Yyt=e=>`${Qtn}${e}`;function Jtn(e){if(e)return oc(Yyt(e))[0]}function ern(e,t){e&&ku(Yyt(e),[t])}function trn(e){e&&rM(Yyt(e))}function rrn(){_R(Qtn)}function nrn(e,t,r){if(!e)return{reviewAfter:!1,announceAfter:!1,draft:!1,autoMerge:!1};rrn();let n=Jtn(t);return{reviewAfter:n?.reviewAfter??r.reviewAfter,announceAfter:n?.announceAfter??!0,draft:n?.draft??r.draft,autoMerge:n?.autoMerge??!1}}function orn(e,t,r,n,o){return{comments:t,screenshots:n,reviewAfter:e&&r.reviewAfter,announceAfter:e&&r.announceAfter,draft:r.draft,autoMerge:e&&r.autoMerge,...o===void 0?{}:{body:o}}}function irn(e,t){return!e||t===!1?{}:t===!0?{autostart:!0}:{autostart:!0,startOn:t}}function srn(e,t,r,n,o,i,a){let[s,l]=(0,arn.useState)(()=>nrn(n,t,o));return{chain:s,setChain:f=>{l(f),ern(t,f)},onDecide:(f,p,h=!1)=>{let m=f==="approve";r(f,{...orn(m,p,s,m?i.attachments():[],a()),...irn(m,h)}),v6e(e),m&&(trn(t),i.clearPersisted())}}}var yrn=x(te(),1);var zZo=/^ {0,3}#{1,6}[ \t]+acceptance criteria[ \t]*$/i,HZo=/^ {0,3}#{1,6}[ \t]/;function nP(e){let t=e.split(`
|
|
4152
4152
|
`),r=t.findIndex(a=>zZo.test(a));if(r===-1)return null;let n=r+1;for(;n<t.length&&!HZo.test(t[n]);)n+=1;let o=r+1;for(;o<n&&t[o].trim()==="";)o+=1;let i=n;for(;i>o&&t[i-1].trim()==="";)i-=1;return o===n&&(o=r+1,i=r+1),{before:t.slice(0,o),lines:t.slice(o,i),after:t.slice(i)}}function S6e(e){let t=0;for(let r of e)t+=r===" "?4:1;return t}function T6e(e){let t=[];return e.map(r=>{for(;t.length>0&&r<t[t.length-1];)t.pop();return(t.length===0||r>t[t.length-1])&&t.push(r),t.length-1})}var UZo=" ";function WZo({text:e,depth:t}){let r=`${UZo.repeat(t)}1.`;return e===""?r:`${r} ${e}`}function w6e(e,t){let r=nP(e);return r?[...r.before,...t.map(WZo),...r.after].join(`
|
|
4153
4153
|
`):e}var VZo=/^([ \t]*)(?:[-*+]|\d+[.)])(?:[ \t]+(.*))?$/,GZo=/^\[[ xX]\][ \t]*/;function qZo(e){return e.slice(0,e.length-e.trimStart().length)}function lrn(e){let t=nP(e);if(!t)return e;let r=t.lines.filter(o=>o.trim()!=="").map(o=>{let i=VZo.exec(o);return{width:S6e(i?i[1]:qZo(o)),text:(i?i[2]??"":o.trim()).replace(GZo,"")}}),n=T6e(r.map(o=>o.width));return w6e(e,J3(r.map((o,i)=>({text:o.text,depth:n[i]}))))}var crn=`## Acceptance criteria
|
|
4154
4154
|
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
isDocsLocked,
|
|
15
15
|
isLockedDocsRelativePath,
|
|
16
16
|
isSchemaRelativePath
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UNIWH4ZG.js";
|
|
18
18
|
import {
|
|
19
19
|
isSchemaLocked
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-A37Z423F.js";
|
|
21
21
|
import "./chunk-ZN4PSZSA.js";
|
|
22
22
|
import {
|
|
23
23
|
currentExecutionIdentity
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-LJO2QGU2.js";
|
|
25
25
|
import "./chunk-ZMH7UZNP.js";
|
|
26
26
|
import {
|
|
27
27
|
gitRefUrl
|
|
@@ -45,7 +45,7 @@ import "./chunk-XEHE4IC2.js";
|
|
|
45
45
|
import "./chunk-EKKGNYON.js";
|
|
46
46
|
import "./chunk-WPRXBDFP.js";
|
|
47
47
|
import "./chunk-TBHJ7JDT.js";
|
|
48
|
-
import "./chunk-
|
|
48
|
+
import "./chunk-ODRXZQ3P.js";
|
|
49
49
|
import "./chunk-MRUIXQXS.js";
|
|
50
50
|
import "./chunk-YLQAQHRT.js";
|
|
51
51
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
buildDoctorProbes,
|
|
11
11
|
diagnoseLink
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3Q2ILAJX.js";
|
|
13
13
|
import "./chunk-VABNWHSE.js";
|
|
14
14
|
import "./chunk-DS2YJZZY.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-KQJCHYLI.js";
|
|
16
16
|
import {
|
|
17
17
|
loadLinkSpecs
|
|
18
18
|
} from "./chunk-6KSMPTXN.js";
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
detectPlatform
|
|
31
31
|
} from "./chunk-E36L7ASL.js";
|
|
32
32
|
import "./chunk-GIHVMELY.js";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-4XVWGIQZ.js";
|
|
34
34
|
import "./chunk-RV5U5FUG.js";
|
|
35
35
|
import "./chunk-YS46IJ4M.js";
|
|
36
36
|
import "./chunk-XSDG7HTJ.js";
|
|
@@ -8,8 +8,8 @@ import {
|
|
|
8
8
|
} from "./chunk-ZT3S2DV2.js";
|
|
9
9
|
import {
|
|
10
10
|
authoredPhases
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-MKKUAIO5.js";
|
|
12
|
+
import "./chunk-LW3XI5ST.js";
|
|
13
13
|
import "./chunk-6Z7XJJNZ.js";
|
|
14
14
|
import {
|
|
15
15
|
findOneItem,
|
|
@@ -26,9 +26,9 @@ import "./chunk-XEHE4IC2.js";
|
|
|
26
26
|
import "./chunk-EKKGNYON.js";
|
|
27
27
|
import "./chunk-WPRXBDFP.js";
|
|
28
28
|
import "./chunk-TBHJ7JDT.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-Q5FCUGEG.js";
|
|
30
30
|
import "./chunk-6MXYEGDK.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-ODRXZQ3P.js";
|
|
32
32
|
import "./chunk-MRUIXQXS.js";
|
|
33
33
|
import "./chunk-YLQAQHRT.js";
|
|
34
34
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -19,16 +19,16 @@ import {
|
|
|
19
19
|
import {
|
|
20
20
|
decideToolOperations,
|
|
21
21
|
logPolicyDeny
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZRI4LLEL.js";
|
|
23
23
|
import "./chunk-CDU6M5IX.js";
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-UNIWH4ZG.js";
|
|
25
|
+
import "./chunk-A37Z423F.js";
|
|
26
26
|
import "./chunk-ZN4PSZSA.js";
|
|
27
27
|
import {
|
|
28
28
|
currentExecutionIdentity
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-LJO2QGU2.js";
|
|
30
30
|
import "./chunk-ZMH7UZNP.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-FAGKXS7M.js";
|
|
32
32
|
import "./chunk-VDXS55BC.js";
|
|
33
33
|
import "./chunk-HKGCLAZ7.js";
|
|
34
34
|
import "./chunk-FPWL4VRC.js";
|
|
@@ -46,7 +46,7 @@ import "./chunk-WPRXBDFP.js";
|
|
|
46
46
|
import "./chunk-TBHJ7JDT.js";
|
|
47
47
|
import {
|
|
48
48
|
claudeAdapter
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ODRXZQ3P.js";
|
|
50
50
|
import "./chunk-MRUIXQXS.js";
|
|
51
51
|
import "./chunk-YLQAQHRT.js";
|
|
52
52
|
import "./chunk-HRQ7LBXR.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
launchPrSkill
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-LGCT5GWJ.js";
|
|
4
|
+
import "./chunk-ZGNYGFEH.js";
|
|
5
|
+
import "./chunk-3NOKJIMX.js";
|
|
6
6
|
import "./chunk-2GTVP7JI.js";
|
|
7
7
|
import "./chunk-V3AWLJ7P.js";
|
|
8
8
|
import "./chunk-UN4ABKA7.js";
|
|
@@ -22,7 +22,7 @@ import "./chunk-4OOUSHS4.js";
|
|
|
22
22
|
import "./chunk-5H7EHZ3J.js";
|
|
23
23
|
import "./chunk-LKDW2GWH.js";
|
|
24
24
|
import "./chunk-6MXYEGDK.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-ODRXZQ3P.js";
|
|
26
26
|
import "./chunk-MRUIXQXS.js";
|
|
27
27
|
import "./chunk-YLQAQHRT.js";
|
|
28
28
|
import "./chunk-HRQ7LBXR.js";
|