@diffohq/diffo 0.14.1 → 0.14.2
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/client/assets/{abnfDiagram-O67JEVCF-CWLH81FZ.js → abnfDiagram-O67JEVCF-CMnC6TpZ.js} +1 -1
- package/dist/client/assets/{arc-Boi3vJx1.js → arc-DZk3sJZl.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-BFR0RRUB.js +1 -0
- package/dist/client/assets/{architectureDiagram-NJMV4G6O-Dv6FL33A.js → architectureDiagram-NJMV4G6O-Dz9QZrKb.js} +1 -1
- package/dist/client/assets/{blockDiagram-BEXU5L5S-JL6NkjcT.js → blockDiagram-BEXU5L5S-EcyDxzoo.js} +1 -1
- package/dist/client/assets/{c4Diagram-YGBWAQC7-BX8kio45.js → c4Diagram-YGBWAQC7-BKJoKbJ0.js} +1 -1
- package/dist/client/assets/channel-DqbS8I7B.js +1 -0
- package/dist/client/assets/{chunk-3FUC2YCW-CO9Amjtk.js → chunk-3FUC2YCW-CvCppQd9.js} +1 -1
- package/dist/client/assets/{chunk-5DYCD2WN-2rOrgg5f.js → chunk-5DYCD2WN-BgEct2K6.js} +1 -1
- package/dist/client/assets/{chunk-742MDFTN-I1URsrBZ.js → chunk-742MDFTN-BqjxeZIP.js} +1 -1
- package/dist/client/assets/{chunk-7INBJB4K-CUZj-C6g.js → chunk-7INBJB4K-tXIMGd-a.js} +1 -1
- package/dist/client/assets/{chunk-7M6MHVWA-DPNR3NbA.js → chunk-7M6MHVWA-Dvn3lbjR.js} +1 -1
- package/dist/client/assets/{chunk-7PRAP22T-C9q-YcpS.js → chunk-7PRAP22T-Dhf_jRyf.js} +1 -1
- package/dist/client/assets/{chunk-GTNCS2PH-CzwPny5O.js → chunk-GTNCS2PH-DrLr4ax6.js} +1 -1
- package/dist/client/assets/{chunk-GWA4HPMP-CRfFZn0F.js → chunk-GWA4HPMP-B19E2BR4.js} +1 -1
- package/dist/client/assets/{chunk-MBY4JIJT-BHlU7n-C.js → chunk-MBY4JIJT-B39se3mh.js} +1 -1
- package/dist/client/assets/{chunk-NETBCI7D-CEyXgnax.js → chunk-NETBCI7D-DNqlAaqS.js} +1 -1
- package/dist/client/assets/{chunk-O7XYJQB3-DxdkNc8m.js → chunk-O7XYJQB3-DKVir5ql.js} +1 -1
- package/dist/client/assets/{chunk-UA2S7LBM-CWz4tJRd.js → chunk-UA2S7LBM-BJrTT987.js} +1 -1
- package/dist/client/assets/{chunk-WEXAMYUT-Dyj5_bjS.js → chunk-WEXAMYUT-CVJkRDlB.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-D9nUo8qv.js → chunk-XXDRQBXY-BxCscPzy.js} +1 -1
- package/dist/client/assets/{chunk-Z7XXMR3K-CKwjz3Sm.js → chunk-Z7XXMR3K-BN62CsO3.js} +1 -1
- package/dist/client/assets/{chunk-ZIGJFQKS-D9Hg0L-2.js → chunk-ZIGJFQKS-D5CFKrxE.js} +1 -1
- package/dist/client/assets/{classDiagram-v2-NBCMYWYE-Szi56-yb.js → classDiagram-v2-NBCMYWYE-BKkAeVYM.js} +1 -1
- package/dist/client/assets/{core-CmtFUBrQ.js → core-Q3dXPkAg.js} +1 -1
- package/dist/client/assets/{cose-bilkent-JH36ORCC-BWNiEgAI.js → cose-bilkent-JH36ORCC-YcS_RGCv.js} +1 -1
- package/dist/client/assets/{cynefin-OW5HDTMX-BRwo_ga9.js → cynefin-OW5HDTMX-yrbryS5G.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-VND7K2PF-HwqbUUIy.js → cynefinDiagram-VND7K2PF-Hc8uQFhv.js} +1 -1
- package/dist/client/assets/{dagre-6A5THRUB-Vr9XVRxE.js → dagre-6A5THRUB-KXPtswtI.js} +1 -1
- package/dist/client/assets/{diagram-22UHCM2B-D2AV1t0V.js → diagram-22UHCM2B-Y8pX48tu.js} +1 -1
- package/dist/client/assets/{diagram-3UASUU5V-BebAfmaQ.js → diagram-3UASUU5V-CVa1vLpR.js} +1 -1
- package/dist/client/assets/{diagram-ATOU4E4O-DyOZr1ty.js → diagram-ATOU4E4O-CneE7Zes.js} +1 -1
- package/dist/client/assets/{diagram-CDSNMT55-CfUcq-A2.js → diagram-CDSNMT55-oZKmQM2r.js} +1 -1
- package/dist/client/assets/{diagram-MLGK6HIB-feBafK9Y.js → diagram-MLGK6HIB-DFI0Zy59.js} +1 -1
- package/dist/client/assets/{diagram-MPIPVDR6-fuRWH1sG.js → diagram-MPIPVDR6-eArDdjHg.js} +1 -1
- package/dist/client/assets/{dist-D8Qb0Dmg.js → dist-D0R2sCr-.js} +1 -1
- package/dist/client/assets/{dist-BNObUdRB.js → dist-Dpuu8gDL.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-ZINNZB2B-BQOIIWkD.js → ebnfDiagram-ZINNZB2B-BGQz6GUg.js} +1 -1
- package/dist/client/assets/{elk-276RUBZZ-BUXjENa5.js → elk-276RUBZZ-BIfKEkPZ.js} +1 -1
- package/dist/client/assets/{engine-oniguruma-BjMH3wEI.js → engine-oniguruma-CAQyYVrA.js} +1 -1
- package/dist/client/assets/{erDiagram-OPXOYQCR-CLVWgAj1.js → erDiagram-OPXOYQCR-DrJ1SBCa.js} +1 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-DmPAZ63r.js +1 -0
- package/dist/client/assets/flowDiagram-KWPJA3E3-8YgnZgsF.js +1 -0
- package/dist/client/assets/{ganttDiagram-FUAMR5RP-zhdMVh3n.js → ganttDiagram-FUAMR5RP-C7I_nqgh.js} +1 -1
- package/dist/client/assets/{gitGraph-4MIJSDKK-BRDusxYN.js → gitGraph-4MIJSDKK-BJpLoDlb.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-X574FWY7-hi2GrOpe.js → gitGraphDiagram-X574FWY7-DFhuC-Rb.js} +1 -1
- package/dist/client/assets/{index-BA230KUb.css → index-BH1cCDEv.css} +1 -1
- package/dist/client/assets/{index-BBBJbJZo.js → index-C47xobM0.js} +3 -3
- package/dist/client/assets/{info-A6RAGUB7-B8_M0GwD.js → info-A6RAGUB7-BLikVQLs.js} +1 -1
- package/dist/client/assets/{infoDiagram-VRGFBTTK-D1SckQLr.js → infoDiagram-VRGFBTTK-BuEHO71F.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-OU5B5YK6-BWGRW6iu.js → ishikawaDiagram-OU5B5YK6-DFMfeW2E.js} +1 -1
- package/dist/client/assets/{journeyDiagram-ZHPQQLJL-BZMBlD-u.js → journeyDiagram-ZHPQQLJL-CTB146da.js} +1 -1
- package/dist/client/assets/{kanban-definition-PNTS6WVX-BawAhHrc.js → kanban-definition-PNTS6WVX-8r22deVT.js} +1 -1
- package/dist/client/assets/{line-Kb3oE4Aw.js → line-CSUq9tDd.js} +1 -1
- package/dist/client/assets/{linear-CzZmB-YY.js → linear-T3cnNwPj.js} +1 -1
- package/dist/client/assets/{mermaid-parser.core-30zdyqZr.js → mermaid-parser.core-QCdEYrye.js} +3 -3
- package/dist/client/assets/{mermaid.core-BZsTuSGk.js → mermaid.core-BRH8LAdQ.js} +4 -4
- package/dist/client/assets/{mindmap-definition-NLK3R4M7-Bm7FCTi7.js → mindmap-definition-NLK3R4M7-F92n7hZW.js} +1 -1
- package/dist/client/assets/{packet-AYTQ26CC-BwuhQpcj.js → packet-AYTQ26CC-20aELlan.js} +1 -1
- package/dist/client/assets/{pegDiagram-GJSIUBJH-BbRs1Ryb.js → pegDiagram-GJSIUBJH-DeFQFgFM.js} +1 -1
- package/dist/client/assets/{pie-WAS4IAKB-DtQofJX0.js → pie-WAS4IAKB-ClBZY8bG.js} +1 -1
- package/dist/client/assets/{pieDiagram-5QR66LMP-Cdu1hQd1.js → pieDiagram-5QR66LMP-CcDXekON.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-O4NWA36T-Bshr17Y5.js → quadrantDiagram-O4NWA36T-BhpHJFDT.js} +1 -1
- package/dist/client/assets/{radar-RG4KPBEZ-BuerLUtq.js → radar-RG4KPBEZ-Dlr7Lw2F.js} +1 -1
- package/dist/client/assets/{railroad-74A4TZTK-BsE8b9hd.js → railroad-74A4TZTK-DBtgFHX3.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DnCwaKGs.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-Bn85hVcR.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-CHNLHRua.js +1 -0
- package/dist/client/assets/{railroadDiagram-XR7U4H2S-BqIA3pC6.js → railroadDiagram-XR7U4H2S-DyP83oqZ.js} +1 -1
- package/dist/client/assets/{requirementDiagram-PLB6GJNP-Bm2AGotF.js → requirementDiagram-PLB6GJNP-6tSvb8E_.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-IPEJSGJF-99nr1xkQ.js → sankeyDiagram-IPEJSGJF-DB3N2C4T.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-PO4LG4MO-CApQASjN.js → sequenceDiagram-PO4LG4MO-BdLgUl7V.js} +1 -1
- package/dist/client/assets/{src-BSYgMDEE.js → src-BvmeK_-w.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-GCMORJYK-CrQnTrn1.js → stateDiagram-v2-GCMORJYK-DgmIAAtq.js} +1 -1
- package/dist/client/assets/{swimlanes-2SLR337P-Ce21f9vx.js → swimlanes-2SLR337P-CGuG0DXr.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-TC7HE7FX-CQzlAvK7.js +8 -0
- package/dist/client/assets/{timeline-definition-EJHVYXUP-BoeRsX3e.js → timeline-definition-EJHVYXUP-BWw3aGPy.js} +1 -1
- package/dist/client/assets/{treeView-Q6P3EWNA-HKKOZRne.js → treeView-Q6P3EWNA-l8VtpJxe.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-BG5rp2bZ.js → treemap-WGGIJYW6-Cp_qtDl8.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-POWQR4AR-sx5gD3FR.js → usecaseDiagram-POWQR4AR-BXq3uA_V.js} +1 -1
- package/dist/client/assets/{vennDiagram-UO4OBE2U-ckr2KNS0.js → vennDiagram-UO4OBE2U-0J7vWDX-.js} +1 -1
- package/dist/client/assets/{wardley-WFR3VGLG-C52x6tow.js → wardley-WFR3VGLG-z_aeXQvi.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-VNRHLVJA-C-4Ioqpr.js → wardleyDiagram-VNRHLVJA-DWf3HNTA.js} +1 -1
- package/dist/client/assets/{xychartDiagram-PMCCYNJV-C0feTPPk.js → xychartDiagram-PMCCYNJV-DWxpNFi9.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-6Io79Z_R.js +0 -1
- package/dist/client/assets/channel-DYSvh7rY.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-BnOGyEbk.js +0 -1
- package/dist/client/assets/flowDiagram-KWPJA3E3-Dh4oiyMW.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-CADz2x_5.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-CfWuG45A.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-9Ce0sj3N.js +0 -1
- package/dist/client/assets/swimlanesDiagram-TC7HE7FX-8cvzmsNb.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-BRH8LAdQ.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BvmeK_-w.js","assets/chunk-O7XYJQB3-DKVir5ql.js","assets/chunk-ZIGJFQKS-D5CFKrxE.js","assets/dist-D0R2sCr-.js","assets/chunk-742MDFTN-BqjxeZIP.js","assets/chunk-MBY4JIJT-B39se3mh.js","assets/chunk-DUW6YSOI-Dgx8z5s3.js","assets/chunk-7PRAP22T-Dhf_jRyf.js","assets/chunk-7INBJB4K-tXIMGd-a.js","assets/chunk-J5ZVWO5B-oDCd-gWO.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-5DYCD2WN-BgEct2K6.js","assets/chunk-Z7XXMR3K-BN62CsO3.js","assets/line-CSUq9tDd.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-UA2S7LBM-BJrTT987.js","assets/c-DWGmR78Y.js","assets/c-SSSlmE39.js","assets/cpp-CJIxL8VH.js","assets/cpp-Cts1PyIS.js","assets/css-CdtkT07m.js","assets/css-LbU1hoFO.js","assets/html-DDNsd9lV.js","assets/html-BcACZWSP.js","assets/javascript-BzbQS41l.js","assets/java-DxlWrXwe.js","assets/java-BtIQNnN0.js","assets/javascript-Yelw-5ZN.js","assets/json-CaljABEy.js","assets/json-B88Oqtu5.js","assets/jsx-hEbJ82HF.js","assets/jsx-D3KKoC5L.js","assets/php-CQT4wx5i.js","assets/xml-WY0zc4PG.js","assets/sql-CP0rg-5b.js","assets/ruby-D_UtGFHI.js","assets/typescript-j_1H8WHN.js","assets/tsx-BOvsFOI6.js","assets/shellscript-CqHdAlCp.js","assets/yaml-DijMHRDA.js","assets/scss-DHtrkMkT.js","assets/shellscript-BiGZg9Om.js","assets/sql-0Qcw9ht3.js","assets/svelte-BUVJxsYv.js","assets/tsx-5f3ulCja.js","assets/typescript-Utq2Cl8c.js","assets/vue-CSBlZ1UP.js","assets/xml-CoDIzWF0.js","assets/yaml-CxbubiML.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,o)=>(o=n==null?{}:e(i(n)),c(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n)),u=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function w(){}var T={H:null,A:null,T:null,S:null},E=Object.prototype.hasOwnProperty;function D(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function O(e,t){return D(e.type,t,e.props)}function k(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function A(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var j=/\/+/g;function M(e,t){return typeof e==`object`&&e&&e.key!=null?A(``+e.key):t.toString(36)}function ee(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(w,w):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+M(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(j,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(k(o)&&(o=O(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(j,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+M(a,u),c+=N(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+M(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(ee(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var te=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function ne(e){var t=T.T,n={};n.types=t===null?null:t.types,T.T=n;try{var r=e(),i=T.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(w,te)}catch(e){te(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),T.T=t}}function re(e){var t=T.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else ne(re.bind(null,e))}var I={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!k(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=I,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return T.H.useMemoCache(e)}},e.addTransitionType=re,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!E.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return D(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)E.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return D(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=k,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=ne,e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},e.use=function(e){return T.H.use(e)},e.useActionState=function(e,t,n){return T.H.useActionState(e,t,n)},e.useCallback=function(e,t){return T.H.useCallback(e,t)},e.useContext=function(e){return T.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return T.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return T.H.useEffect(e,t)},e.useEffectEvent=function(e){return T.H.useEffectEvent(e)},e.useId=function(){return T.H.useId()},e.useImperativeHandle=function(e,t,n){return T.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return T.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return T.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return T.H.useMemo(e,t)},e.useOptimistic=function(e,t){return T.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return T.H.useReducer(e,t,n)},e.useRef=function(e){return T.H.useRef(e)},e.useState=function(e){return T.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return T.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return T.H.useTransition()},e.version=`19.3.0`})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),m=o(((e,t)=>{t.exports=p()})),h=o((e=>{var t=f();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`),o=Symbol.for(`react.recoverable`),s=Symbol.for(`react.optimistic_key`);function c(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:r===s?s:``+r,children:e,containerInfo:t,implementation:n}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.browser=function(e){return{$$typeof:o,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return c(e,t,null,r)},e.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=u(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=u(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=u(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return l.H.useFormState(e,t,n)},e.useFormStatus=function(){return l.H.useHostTransitionStatus()},e.version=`19.3.0`})),g=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=o((e=>{var t=m(),n=f(),r=g();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function h(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=h(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(i(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function w(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function T(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function E(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var D=Object.assign,O=Symbol.for(`react.element`),k=Symbol.for(`react.transitional.element`),A=Symbol.for(`react.portal`),j=Symbol.for(`react.fragment`),M=Symbol.for(`react.strict_mode`),ee=Symbol.for(`react.profiler`),N=Symbol.for(`react.consumer`),P=Symbol.for(`react.context`),F=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),ne=Symbol.for(`react.suspense_list`),re=Symbol.for(`react.memo`),I=Symbol.for(`react.lazy`),ie=Symbol.for(`react.activity`),ae=Symbol.for(`react.legacy_hidden`),oe=Symbol.for(`react.memo_cache_sentinel`),se=Symbol.for(`react.view_transition`),ce=Symbol.for(`react.recoverable`),le=Symbol.iterator;function ue(e){return typeof e!=`object`||!e?null:(e=le&&e[le]||e[`@@iterator`],typeof e==`function`?e:null)}var de=Symbol.for(`react.client.reference`);function fe(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===de?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case j:return`Fragment`;case ee:return`Profiler`;case M:return`StrictMode`;case te:return`Suspense`;case ne:return`SuspenseList`;case ie:return`Activity`;case se:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case A:return`Portal`;case P:return e.displayName||`Context`;case N:return(e._context.displayName||`Context`)+`.Consumer`;case F:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case re:return t=e.displayName||null,t===null?fe(e.type)||`Memo`:t;case I:t=e._payload,e=e._init;try{return fe(e(t))}catch{}}return null}var L=Array.isArray,R=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,pe={pending:!1,data:null,method:null,action:null},me=[],he=-1;function ge(e){return{current:e}}function _e(e){0>he||(e.current=me[he],me[he]=null,he--)}function ve(e,t){he++,me[he]=e.current,e.current=t}var ye=ge(null),be=ge(null),xe=ge(null),Se=ge(null);function Ce(e,t){switch(ve(xe,t),ve(be,e),ve(ye,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=up(t),e=dp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}_e(ye),ve(ye,e)}function we(){_e(ye),_e(be),_e(xe)}function Te(e){var t=e.memoizedState;t!==null&&(sh._currentValue=t.memoizedState,ve(Se,e)),t=ye.current;var n=dp(t,e.type);t!==n&&(ve(be,e),ve(ye,n))}function Ee(e){be.current===e&&(_e(ye),_e(be)),Se.current===e&&(_e(Se),sh._currentValue=pe)}var De,Oe;function B(e){if(De===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||``,Oe=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+De+e+Oe}var ke=!1;function Ae(e,t){if(!e||ke)return``;ke=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
@@ -78,13 +78,13 @@ ${e}</tr>
|
|
|
78
78
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ri(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Ri(n,!0):this.parser.parseInline(r),o=Bi(e);if(o===null)return a;e=Ri(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Ri(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Bi(e);if(i===null)return Ri(n);e=i;let a=`<img src="${Ri(e)}" alt="${Ri(n)}"`;return t&&(a+=` title="${Ri(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Ri(e.text)}},K=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},$i=class e{options;renderer;textRenderer;constructor(e){this.options=e||hr,this.options.renderer=this.options.renderer||new Qi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new K}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},ea=class{options;block;constructor(e){this.options=e||hr}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Zi.lex:Zi.lexInline}provideParser(e=this.block){return e?$i.parse:$i.parseInline}},ta=new class{defaults=mr();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$i;Renderer=Qi;TextRenderer=K;Lexer=Zi;Tokenizer=Xi;Hooks=ea;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Qi(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Xi(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new ea;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=ea.passThroughHooks.has(n)?e=>{if(this.defaults.async&&ea.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Zi.lex(e,t??this.defaults)}parser(e,t){return $i.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Zi.lex:Zi.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?$i.parse:$i.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Zi.lex:Zi.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?$i.parse:$i.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
79
79
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Ri(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function q(e,t){return ta.parse(e,t)}q.options=q.setOptions=function(e){return ta.setOptions(e),q.defaults=ta.defaults,gr(q.defaults),q},q.getDefaults=mr,q.defaults=hr;function na(...e){return ta.use(...e),q.defaults=ta.defaults,gr(q.defaults),q}q.use=na,q.walkTokens=function(e,t){return ta.walkTokens(e,t)},q.parseInline=ta.parseInline,q.Parser=$i,q.parser=$i.parse,q.Renderer=Qi,q.TextRenderer=K,q.Lexer=Zi,q.lexer=Zi.lex,q.Tokenizer=Xi,q.Hooks=ea,q.parse=q,q.options,q.setOptions,q.walkTokens,q.parseInline,$i.parse,Zi.lex,q.setOptions({gfm:!0,breaks:!0});var ra=[`p`,`br`,`hr`,`strong`,`em`,`del`,`code`,`pre`,`blockquote`,`ul`,`ol`,`li`,`a`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`table`,`thead`,`tbody`,`tr`,`th`,`td`],ia=pr(),aa=!1;function oa(){aa||(aa=!0,ia.addHook(`afterSanitizeAttributes`,e=>{if(e instanceof Element&&(e.tagName===`A`&&e.hasAttribute(`href`)&&!(e.getAttribute(`href`)??``).startsWith(`#`)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.hasAttribute(`class`))){let t=/^language-[\w+-]+$/.exec(e.getAttribute(`class`)??``);e.tagName===`CODE`&&t?e.setAttribute(`class`,t[0]):e.removeAttribute(`class`)}}))}function sa(e){oa();let t=q.parse(e,{async:!1});return ia.sanitize(t,{ALLOWED_TAGS:ra,ALLOWED_ATTR:[`href`,`title`,`target`,`rel`,`class`],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#)/i})}var ca=[...ra,`img`,`picture`,`source`,`div`,`span`,`details`,`summary`],la=pr(),ua=``;function da(e,t){let n=t.split(/[?#]/,1)[0]??``,r=n.startsWith(`/`)?n.slice(1):e?`${e}/${n}`:n,i=[];for(let e of r.split(`/`))e!==``&&e!==`.`&&(e===`..`?i.pop():i.push(e));return i.join(`/`)}function fa(e){return`/api/file?path=${encodeURIComponent(da(ua,e))}&side=head`}var pa=/^(?:[a-z][a-z0-9+.-]*:|\/\/|#)/i,ma=/^(?:https?:|mailto:|#)/i,ha=!1;function ga(){ha||(ha=!0,la.addHook(`uponSanitizeAttribute`,(e,t)=>{let{attrName:n,attrValue:r}=t;n===`src`||n===`href`?pa.test(r)?ma.test(r)||(t.keepAttr=!1):t.attrValue=fa(r):n===`srcset`&&(t.attrValue=r.split(`,`).map(e=>{let[t,...n]=e.trim().split(/\s+/);return t?pa.test(t)?ma.test(t)?[t,...n].join(` `):``:[fa(t),...n].join(` `):``}).filter(Boolean).join(`, `))}),la.addHook(`afterSanitizeAttributes`,e=>{if(e instanceof Element&&(e.tagName===`A`&&e.hasAttribute(`href`)&&(e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)),e.hasAttribute(`class`))){let t=/^language-[\w+-]+$/.exec(e.getAttribute(`class`)??``);e.tagName===`CODE`&&t?e.setAttribute(`class`,t[0]):e.removeAttribute(`class`)}}))}function _a(e,t){ga();let n=t.lastIndexOf(`/`);ua=n===-1?``:t.slice(0,n);let r=q.parse(e,{async:!1});return la.sanitize(r,{ALLOWED_TAGS:ca,ALLOWED_ATTR:[`href`,`title`,`target`,`rel`,`class`,`src`,`srcset`,`alt`,`width`,`height`,`media`,`align`,`open`]})}function va(e,t=Date.now()){if(!e)return``;let n=Date.parse(e);if(Number.isNaN(n))return e;let r=Math.round((t-n)/1e3);if(r<45)return`just now`;let i=Math.round(r/60);if(i<60)return`${i} minute${i===1?``:`s`} ago`;let a=Math.round(i/60);if(a<24)return`${a} hour${a===1?``:`s`} ago`;let o=Math.round(a/24);return o<7?`${o} day${o===1?``:`s`} ago`:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function ya(e,t=Date.now()){if(!e)return``;let n=Date.parse(e);if(Number.isNaN(n))return``;let r=Math.max(0,Math.round((t-n)/1e3));if(r<60)return`${r}s`;let i=Math.round(r/60);if(i<60)return`${i}m`;let a=Math.round(i/60);if(a<24)return`${a}h`;let o=Math.round(a/24);return o<7?`${o}d`:new Date(n).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}var ba=30,xa=22,Sa=48,Ca=1100,wa=1500,Ta=1.1,Ea=3e3,Da=110,Oa=560,ka=64,Aa=90/24,ja=ba*3.5/24,Ma=540/24,Na={shut:`M7.8 10.4h2.4M13.8 10.4h2.4`,plus:`M7.8 10.2h2.4M9 9v2.4M13.8 10.2h2.4M15 9v2.4`,happy:`M7.8 11l1.2-1.4 1.2 1.4M13.8 11l1.2-1.4 1.2 1.4`},Pa=new Set([`stand`,`sit`]);function Fa(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}var Ia=(e,t)=>e+Math.random()*(t-e),La=e=>`translate(${e.x}px, ${e.y}px) scale(${e.s})`;function Ra({presence:e,reason:t,seat:n,onAway:r,summon:i=0}){let a=(0,x.useRef)(null),o=(0,x.useRef)(null),[s,c]=(0,x.useState)(!1),l=(0,x.useRef)(!1),u=(0,x.useRef)(r);u.current=r;let d=(0,x.useCallback)(e=>{l.current=e,c(e),u.current?.(e)},[]),[f,p]=(0,x.useState)(!1),m=(0,x.useRef)(null),h=(0,x.useRef)(0),g=(0,x.useRef)(!1),_=(0,x.useRef)(i),[v,y]=(0,x.useState)(0),[b,C]=(0,x.useState)(null),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(`stand`),[O,k]=(0,x.useState)(null),A=(0,x.useRef)(null);A.current=b;let[j,M]=(0,x.useState)(!1),ee=(0,x.useRef)(!1);ee.current=j;let[N,P]=(0,x.useState)(!1);(0,x.useEffect)(()=>{let e,t=t=>{ee.current||M(!0),t.type===`keydown`&&P(!0),clearTimeout(e),e=setTimeout(()=>{M(!1),P(!1)},Ea)},n={capture:!0,passive:!0},r=[`pointermove`,`wheel`,`scroll`,`keydown`];for(let e of r)addEventListener(e,t,n);return()=>{clearTimeout(e);for(let e of r)removeEventListener(e,t,n)}},[]),(0,x.useEffect)(()=>{let e=a.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(([e])=>e&&y(e.contentRect.width));return t.observe(e),()=>t.disconnect()},[]);let F=(0,x.useRef)(t);(0,x.useEffect)(()=>{t===`replied`&&F.current!==`replied`&&!Fa()&&k(`approve`),F.current=t},[t]);let te=Pa.has(E)&&!O;(0,x.useEffect)(()=>{let e=o.current,t=e?.querySelector(`.critter-look`);if(!e||!t)return;if(!te||Fa()){t.style.transform=``;return}let n=0,r=r=>{n||=requestAnimationFrame(()=>{n=0;let i=e.getBoundingClientRect(),a=r.clientX-(i.left+i.width/2),o=r.clientY-(i.top+i.height*.4),s=Math.hypot(a,o)||1;t.style.transform=`translate(${a/s*Ta}px, ${o/s*Ta*.8}px)`})};return addEventListener(`pointermove`,r),()=>{removeEventListener(`pointermove`,r),cancelAnimationFrame(n),t.style.transform=``}},[te]);let ne=Math.max(0,v-ba),re=(0,x.useRef)(ne);re.current=ne;let I=v>0,ie=e===`waiting`||ne<ka||Fa();(0,x.useEffect)(()=>()=>u.current?.(!1),[]),(0,x.useLayoutEffect)(()=>{!s&&m.current&&(m.current.anim.cancel(),m.current=null)},[s]),(0,x.useEffect)(()=>{if(!I)return;let t=()=>re.current,r,s=!0,c=()=>Math.min(A.current??t(),t()),u=(e,t)=>{r=setTimeout(()=>s&&t(),e)},f=(e,t,n)=>{D(e),u(t,n)},v=(e,t,n)=>{let r=c(),i=Math.abs(e-r)/t*1e3;if(i<150){n();return}D(`walk`),T({ms:i,dir:e<r?`left`:`right`}),C(e),u(i,()=>{T(null),n()})},y=()=>{let e=n?.current?n.current.getBoundingClientRect():void 0,t=a.current?.getBoundingClientRect(),r=o.current;if(!e?.width||!t||!r)return null;let i=e.width/Ma;return{x:e.left-t.left-Aa*i,y:e.top+e.height/30-t.top-r.offsetTop-ja*i,s:i}},b=(e,t,n,r)=>{let i=o.current;if(!i||typeof i.animate!=`function`){r();return}let a={x:(e.x+t.x)/2,y:Math.min(e.y,t.y)-16,s:(e.s+t.s)/2},s=i.animate([e,a,t].map(e=>({transform:La(e)})),{duration:Oa,easing:`cubic-bezier(0.3, 0.7, 0.4, 1)`,fill:`forwards`});m.current={anim:s,home:n},u(Oa,r)},x=()=>{p(!1),d(!1)},S=e=>{v(t(),Da,()=>{let t=y();if(!t){x(),e?.();return}D(`stand`),p(!0),b({x:c(),y:0,s:1},t,!0,()=>{x(),e?.()})})},w=e=>{let n=y();if(C(t()),D(`stand`),p(!0),d(!0),!n){p(!1),e();return}b(n,{x:t(),y:0,s:1},!1,()=>{m.current?.anim.cancel(),m.current=null,p(!1),e()})},E=()=>{if(e===`working`){let e=()=>c()>t()/2?Ia(0,t()*.4):Ia(t()*.6,t()),n=()=>Math.random()<.5?`inspect`:`write`,r=()=>ee.current?f(n(),Ia(2500,4e3),r):v(e(),Sa,()=>f(n(),Ia(2500,5e3),()=>Math.random()<.4?f(`think`,Ia(1500,2800),r):r()));f(n(),Ia(1500,3e3),r)}else{let e=()=>{let n=Math.random();ee.current?f(n<.5?`stand`:`read`,Ia(3e3,6e3),e):n<.3?f(`read`,Ia(4e3,8e3),e):n<.5?f(`stand`,Ia(3e3,6e3),e):n<.75?v(Ia(0,t()),xa,e):n<.9?f(`sit`,Ia(4e3,8e3),e):f(`think`,Ia(2e3,3500),e)};f(`read`,Ia(3e3,5e3),e)}},j=()=>u(Math.max(e===`working`?Ia(300,700):Ia(1e3,2500),h.current-Date.now()),()=>w(E)),M=i!==_.current;if(_.current=i,M&&!O&&!ie&&!l.current)w(()=>k(`poke`));else if(M&&!O&&l.current)k(`poke`);else if(O&&l.current)f(O,O===`poke`?Ca:wa,()=>{O===`approve`&&(g.current=!0),k(null)});else if(O)k(null);else if(ie)l.current&&!Fa()?S():l.current&&x(),D(e===`waiting`?`sleep`:`stand`);else if(l.current&&(N||g.current)){let e=g.current;g.current=!1,e&&(h.current=Date.now()+Ia(4e3,6e3)),S(N?void 0:j)}else l.current?E():(D(`stand`),N||j());return()=>{if(s=!1,clearTimeout(r),m.current){let{anim:e,home:t}=m.current;e.cancel(),m.current=null,p(!1),t&&d(!1),T(null);return}let e=o.current;if(e)try{C(new DOMMatrixReadOnly(getComputedStyle(e).transform).m41)}catch{}T(null)}},[e,I,O,N,ie,n,d,i]);let ae=()=>{!O&&!Fa()&&k(`poke`)},oe={transform:La({x:Math.min(b??ne,ne),y:0,s:1}),transition:w?`transform ${w.ms}ms linear`:`none`,visibility:v&&s?void 0:`hidden`};return(0,S.jsx)(`span`,{className:`critter-track`,ref:a,children:(0,S.jsx)(`span`,{ref:o,className:`critter-walker${w?` critter-moving critter-${w.dir}`:``}${j?` critter-calm`:``}${f?` critter-tucked`:``}`,style:oe,onPointerEnter:ae,children:(0,S.jsx)(za,{presence:e,act:E})})})}function za({presence:e,act:t=e===`waiting`?`sleep`:`stand`,size:n=ba}){return(0,S.jsxs)(`svg`,{className:`critter critter-${e} critter-act-${t}`,width:n,height:n,viewBox:`0 0 24 24`,"aria-hidden":`true`,focusable:`false`,children:[(0,S.jsxs)(`g`,{className:`critter-figure`,children:[(0,S.jsx)(`rect`,{className:`critter-leg critter-leg-l`,x:`7`,y:`16.5`,width:`3`,height:`4.5`,rx:`1`}),(0,S.jsx)(`rect`,{className:`critter-leg critter-leg-r`,x:`14`,y:`16.5`,width:`3`,height:`4.5`,rx:`1`}),(0,S.jsxs)(`g`,{className:`critter-torso`,children:[(0,S.jsx)(`rect`,{className:`critter-body`,x:`3`,y:`3.5`,width:`18`,height:`14`,rx:`4`}),(0,S.jsxs)(`g`,{className:`critter-look`,children:[(0,S.jsx)(`path`,{className:`critter-eyes critter-eyes-shut`,d:Na.shut}),(0,S.jsxs)(`g`,{className:`critter-eyes-open`,children:[(0,S.jsx)(`rect`,{x:`8.1`,y:`8.6`,width:`1.8`,height:`3.1`,rx:`0.9`}),(0,S.jsx)(`rect`,{x:`14.1`,y:`8.6`,width:`1.8`,height:`3.1`,rx:`0.9`})]}),(0,S.jsx)(`path`,{className:`critter-eyes critter-eyes-plus`,d:Na.plus}),(0,S.jsx)(`path`,{className:`critter-eyes critter-eyes-happy`,d:Na.happy})]}),(0,S.jsxs)(`g`,{className:`critter-glasses`,children:[(0,S.jsx)(`circle`,{cx:`9`,cy:`10.2`,r:`3`}),(0,S.jsx)(`circle`,{cx:`15`,cy:`10.2`,r:`3`})]})]}),(0,S.jsxs)(`g`,{className:`critter-page`,children:[(0,S.jsx)(`rect`,{x:`6.2`,y:`13.2`,width:`11.6`,height:`7`,rx:`1`}),(0,S.jsx)(`path`,{className:`critter-line-del`,d:`M8 15.1h4`}),(0,S.jsx)(`path`,{className:`critter-line-ctx`,d:`M8 16.7h6.5`}),(0,S.jsx)(`path`,{className:`critter-line-add`,pathLength:`1`,d:`M8 18.3h5.5`})]}),(0,S.jsxs)(`g`,{className:`critter-hands`,children:[(0,S.jsx)(`circle`,{cx:`6.2`,cy:`17`,r:`1.4`}),(0,S.jsx)(`circle`,{cx:`17.8`,cy:`17`,r:`1.4`})]}),(0,S.jsxs)(`g`,{className:`critter-pen`,children:[(0,S.jsx)(`path`,{d:`M14.6 19l3.4-3.6`}),(0,S.jsx)(`circle`,{cx:`18.3`,cy:`15.3`,r:`1.4`})]}),(0,S.jsxs)(`g`,{className:`critter-mag`,children:[(0,S.jsx)(`circle`,{className:`critter-lens`,cx:`21.6`,cy:`13.4`,r:`3`}),(0,S.jsx)(`path`,{d:`M23.7 15.6l2 2`}),(0,S.jsx)(`circle`,{className:`critter-mag-hand`,cx:`25.8`,cy:`17.7`,r:`1.4`})]})]}),(0,S.jsxs)(`g`,{className:`critter-z`,children:[(0,S.jsx)(`path`,{className:`critter-z-a`,d:`M17.5 0.5h3l-3 3h3`}),(0,S.jsx)(`path`,{className:`critter-z-b`,d:`M21.5 -4.5h4l-4 4h4`})]}),(0,S.jsxs)(`g`,{className:`critter-thought`,children:[(0,S.jsx)(`circle`,{cx:`20.5`,cy:`2.6`,r:`0.9`}),(0,S.jsx)(`circle`,{cx:`22.6`,cy:`0.2`,r:`1.15`}),(0,S.jsx)(`circle`,{cx:`25.2`,cy:`-2.6`,r:`1.4`})]}),(0,S.jsx)(`path`,{className:`critter-spark critter-spark-a`,d:`M19.5 1.5h2.4M20.7 0.3v2.4`}),(0,S.jsx)(`path`,{className:`critter-spark critter-spark-b`,d:`M2.5 2.5h2.4M3.7 1.3v2.4`}),(0,S.jsxs)(`g`,{className:`critter-badge`,children:[(0,S.jsx)(`circle`,{cx:`12`,cy:`-2.5`,r:`3`}),(0,S.jsx)(`path`,{d:`M10.6 -2.5l1 1 1.9-2`})]})]})}function Ba({eyes:e}){return(0,S.jsxs)(`svg`,{className:`critter-face`,width:`18`,height:`15`,viewBox:`3 3 18 15`,"aria-hidden":`true`,focusable:`false`,children:[(0,S.jsx)(`rect`,{x:`3`,y:`3.5`,width:`18`,height:`14`,rx:`4`}),e===`open`?(0,S.jsxs)(`g`,{className:`critter-face-open`,children:[(0,S.jsx)(`rect`,{x:`8.1`,y:`8.6`,width:`1.8`,height:`3.1`,rx:`0.9`}),(0,S.jsx)(`rect`,{x:`14.1`,y:`8.6`,width:`1.8`,height:`3.1`,rx:`0.9`})]}):(0,S.jsx)(`path`,{className:`critter-face-eyes`,d:Na[e]})]})}function Va({size:e=24,className:t,label:n}){return(0,S.jsx)(`svg`,{className:t?`icon living-mark ${t}`:`icon living-mark`,width:e,height:e,viewBox:`0 0 24 24`,focusable:`false`,"aria-hidden":!n||void 0,role:n?`img`:void 0,"aria-label":n,children:(0,S.jsxs)(`g`,{fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,children:[(0,S.jsx)(`path`,{className:`lm-minus`,d:`M3.3 7.4h2.6`}),(0,S.jsx)(`path`,{className:`lm-plus-h`,d:`M3.3 16.6h2.6`}),(0,S.jsx)(`path`,{className:`lm-plus-v`,d:`M4.6 15.3v2.6`}),(0,S.jsx)(`path`,{className:`lm-l1`,d:`M9.3 7.4H20.4`}),(0,S.jsx)(`path`,{d:`M9.3 12h8`}),(0,S.jsx)(`path`,{className:`lm-l3`,d:`M9.3 16.6h10.2`})]})})}function Ha({label:e,icon:t=`more`,children:n,align:r=`right`,triggerClassName:i=`btn btn-ghost btn-icon btn-sm`}){let[a,o]=(0,x.useState)(!1),s=(0,x.useRef)(null);return(0,x.useEffect)(()=>{if(!a)return;let e=e=>{s.current?.contains(e.target)||o(!1)},t=e=>{e.key===`Escape`&&(e.stopPropagation(),o(!1))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t,!0)}},[a]),(0,S.jsxs)(`div`,{className:`menu`,ref:s,children:[(0,S.jsx)(`button`,{type:`button`,className:i,"aria-label":e,"data-tip":a?void 0:e,"aria-haspopup":`menu`,"aria-expanded":a,onClick:e=>{e.stopPropagation(),o(e=>!e)},children:(0,S.jsx)(H,{name:t})}),a&&(0,S.jsx)(`div`,{className:`menu-panel${r===`left`?` menu-panel-left`:``}`,role:`menu`,children:n(()=>o(!1))})]})}function Ua({icon:e,kbd:t,checked:n,danger:r=!1,onClick:i,children:a}){return(0,S.jsxs)(`button`,{type:`button`,role:n===void 0?`menuitem`:`menuitemradio`,...n===void 0?{}:{"aria-checked":n},className:`menu-item${r?` menu-item-danger`:``}`,onClick:i,children:[e&&(0,S.jsx)(H,{name:e,size:`sm`}),(0,S.jsx)(`span`,{className:`menu-item-label`,children:a}),n&&(0,S.jsx)(H,{name:`check`,size:`sm`,className:`menu-item-check`}),t&&(0,S.jsx)(`span`,{className:`kbd`,children:t})]})}function Wa(){return(0,S.jsx)(`hr`,{className:`menu-sep`})}function Ga({children:e}){return(0,S.jsx)(`div`,{className:`menu-label`,children:e})}function Ka({changeset:e}){let{spec:t,repo:n,pr:r}=e;if(r)return null;let i=t.kind===`working-tree`,a=i?`working tree`:n.branch||`HEAD`,o=i?`HEAD`:t.base,s=[i?`comparing your working tree against HEAD${n.branch?` on branch ${n.branch}`:``}`:`comparing ${a} against ${o}`,n.worktree&&`linked worktree '${n.worktree}'`].filter(Boolean).join(` · `);return(0,S.jsxs)(`span`,{className:`cmp`,title:s,children:[(0,S.jsx)(`span`,{className:`repo`,children:n.name}),(0,S.jsx)(`span`,{className:`cmp-dot`,"aria-hidden":`true`,children:`·`}),(0,S.jsx)(`span`,{className:`cmp-side`,children:a}),(0,S.jsx)(H,{name:`arrow`,size:`sm`,className:`cmp-arrow`}),(0,S.jsx)(`span`,{className:`cmp-side cmp-side-base`,children:o})]})}var qa={success:`CI passing`,failure:`CI failing`,pending:`CI running`,none:`no checks`,unknown:`checks not visible to your token`};function Ja(e){return e.state===`open`?e.changesRequested>0?{label:`changes requested`,className:`chip-attn`}:e.checks.state===`failure`?{label:`CI failing`,className:`pr-check-failure`}:e.draft?{label:`draft`,className:`chip-mute pr-state pr-state-draft`}:e.checks.state===`pending`?{label:`CI running`,className:`pr-check-pending`}:null:{label:e.state,className:`chip-mute pr-state pr-state-${e.state}`}}function Ya({user:e,large:t=!1}){let n=t?`pr-avatar pr-avatar-lg`:`pr-avatar`;return e.avatarUrl?(0,S.jsx)(`img`,{className:n,src:e.avatarUrl,alt:``}):(0,S.jsx)(`span`,{className:`${n} pr-avatar-none`,children:(0,S.jsx)(H,{name:`user`,size:t?`md`:`sm`})})}var Xa=e=>{let t=ya(e);return/^\d/.test(t)?`${t} ago`:t};function Za({pr:e}){let[t,n]=(0,x.useState)(!1),r=e.commits.at(-1),i=[qa[e.checks.state],r?`pushed ${Xa(r.at)}`:``].filter(Boolean).join(` · `),a=e.approvals===0&&e.changesRequested===0?{text:`no reviews yet`,tone:`mute`}:e.changesRequested>0?{text:`changes requested${e.approvals>0?` · ${e.approvals} ${e.approvals===1?`approval`:`approvals`}`:``}`,tone:`attn`}:{text:`${e.approvals} ${e.approvals===1?`approval`:`approvals`}`,tone:`ok`},o=e.commits.length,s=t=>`https://${e.host}/${e.owner}/${e.repo}/pull/${e.number}/commits/${t}`;return(0,S.jsxs)(`section`,{className:`menu-panel menu-panel-left pr-card`,"aria-label":`pull request details`,children:[(0,S.jsxs)(`div`,{className:`pr-card-who`,children:[(0,S.jsx)(Ya,{user:e.author,large:!0}),(0,S.jsxs)(`span`,{className:`pr-card-who-text`,children:[(0,S.jsx)(`span`,{className:`pr-card-login`,children:e.author.login}),(0,S.jsxs)(`span`,{className:`pr-card-where`,children:[e.owner,`/`,e.repo,` #`,e.number]})]})]}),(0,S.jsxs)(`div`,{className:`pr-card-body`,children:[(0,S.jsxs)(`div`,{className:`pr-card-refs`,title:`${e.head.ref} into ${e.base.ref}`,children:[(0,S.jsx)(`code`,{className:`pr-ref`,children:e.head.ref}),(0,S.jsx)(H,{name:`arrow`,size:`sm`,className:`cmp-arrow`}),(0,S.jsx)(`code`,{className:`pr-ref pr-ref-base`,children:e.base.ref})]}),(0,S.jsxs)(`ul`,{className:`pr-card-facts`,children:[(0,S.jsxs)(`li`,{className:`pr-fact pr-fact-${e.checks.state}`,children:[(0,S.jsx)(`i`,{className:`pr-fact-dot`,"aria-hidden":`true`}),e.checks.url?(0,S.jsx)(`a`,{href:e.checks.url,target:`_blank`,rel:`noreferrer`,children:i}):i]}),(0,S.jsxs)(`li`,{className:`pr-fact pr-fact-${a.tone}`,children:[(0,S.jsx)(H,{name:a.tone===`ok`?`check`:a.tone===`attn`?`alert`:`chat`,size:`sm`}),a.text]})]}),o>0&&(0,S.jsxs)(`div`,{className:`pr-commits`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`pr-commits-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,S.jsx)(`span`,{className:`chevron${t?``:` chevron-shut`}`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),o,` `,o===1?`commit`:`commits`]}),t&&(0,S.jsx)(`ol`,{className:`pr-commit-list`,children:[...e.commits].reverse().map(e=>(0,S.jsx)(`li`,{children:(0,S.jsxs)(`a`,{className:`pr-commit`,href:s(e.sha),target:`_blank`,rel:`noreferrer`,title:`${e.subject}${e.author?`, by ${e.author.login}`:``}, opens on GitHub`,children:[(0,S.jsx)(`code`,{className:`pr-commit-sha`,children:e.sha.slice(0,7)}),(0,S.jsx)(`span`,{className:`pr-commit-subject`,children:e.subject}),(0,S.jsx)(`span`,{className:`pr-commit-ago`,children:ya(e.at)})]})},e.sha))})]})]}),(0,S.jsxs)(`a`,{className:`btn btn-ghost pr-card-link`,href:e.url,target:`_blank`,rel:`noreferrer`,children:[`Open on GitHub`,(0,S.jsx)(H,{name:`link`,size:`sm`})]})]})}function Qa({pr:e}){let[t,n]=(0,x.useState)(!1),r=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)},i=e=>{e.key===`Escape`&&(e.stopPropagation(),n(!1))};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,i,!0),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,i,!0)}},[t]);let i=Ja(e);return(0,S.jsxs)(`span`,{className:`where pr-chips menu`,ref:r,children:[(0,S.jsxs)(`button`,{type:`button`,className:`pr-title`,"aria-haspopup":`dialog`,"aria-expanded":t,onClick:()=>n(e=>!e),title:t?void 0:`${e.owner}/${e.repo}#${e.number}: author, branches, checks, reviews`,children:[(0,S.jsx)(H,{name:`pr`,size:`sm`}),(0,S.jsxs)(`span`,{className:`pr-number`,children:[`#`,e.number]}),(0,S.jsx)(`span`,{className:`pr-title-text`,children:e.title})]}),i&&(0,S.jsx)(`span`,{className:`chip ${i.className}`,children:i.label}),t&&(0,S.jsx)(Za,{pr:e})]})}var $a={waiting:`no agent is attached; sends queue for the next poll, and the prompt is copied so you can paste it yourself`,listening:`your agent is here and listening; anything you send reaches it right away`,working:`the agent received feedback and is working on it`},eo=`the agent is attached but its last poll ended; a send queues and reaches it when it polls again`,to=`your agent opened this review and is reading the change before it starts listening — its guide lands first; a send queues and reaches it at its first poll`,no=/^(working on|answered|picked up|outlining) (.+)$/,ro=e=>e.charAt(0).toUpperCase()+e.slice(1);function io(e,t,n,r){if(e===`waiting`)return r?{verb:`Invite`,detail:`your agent`}:{verb:`No agent`};if(e===`listening`)return{verb:`Listening`};if(n){let e=no.exec(n);return e?{verb:ro(e[1]),detail:e[2]}:{verb:ro(n)}}return t===`arriving`?{verb:`Reading`,detail:`the change`}:t===`repolling`?{verb:`Paused`,detail:`sends wait`}:{verb:`Working`}}function ao(e,t,n){return n?`happy`:e===`waiting`?`shut`:e===`listening`||t===`arriving`||t===`repolling`?`open`:`plus`}function oo(e,t){return e===`working`?t===`repolling`?eo:t===`arriving`?to:$a[e]:$a[e]}function so(e){let t=Math.max(0,Math.round(e/1e3));return t<60?`${t}s`:`${Math.round(t/60)}m`}function co({presence:e,reason:t,since:n,activity:r,onInvite:i,batch:a,monitorOpen:o=!1,onOpenMonitor:s,monitorPanel:c,suggestion:l,seat:u,faceAway:d=!1,onHover:f}){let[,p]=(0,x.useState)(0),m=(0,x.useRef)(null),h=e===`working`&&typeof n==`number`;(0,x.useEffect)(()=>{if(!h)return;let e=setInterval(()=>p(e=>e+1),1e4);return()=>clearInterval(e)},[h]),(0,x.useEffect)(()=>{if(!o||!s)return;let e=e=>{m.current?.contains(e.target)||s(!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[o,s]);let[g,_]=(0,x.useState)(!1),v=(0,x.useRef)(t);(0,x.useEffect)(()=>{let e=v.current;if(v.current=t,t!==`replied`||e===`replied`)return;_(!0);let n=setTimeout(()=>_(!1),1500);return()=>{clearTimeout(n),_(!1)}},[t]);let y=a?.segments.length??0,b=e!==`waiting`&&!!l&&y===0,C=b?{verb:`Suggests`,detail:`layers`}:io(e,t,r,e===`waiting`&&!!i),w=e===`waiting`?void 0:f,T=(0,S.jsx)(`span`,{className:`presence-face${d?` presence-face-away`:``}${g?` presence-face-cheer`:``}`,ref:u,"aria-hidden":`true`,children:(0,S.jsx)(Ba,{eyes:b?`happy`:ao(e,t,g)})}),E=(0,S.jsxs)(S.Fragment,{children:[T,(0,S.jsxs)(`span`,{className:`presence-label`,children:[(0,S.jsx)(`span`,{className:`presence-verb`,children:C.verb}),C.detail&&(0,S.jsxs)(S.Fragment,{children:[` `,(0,S.jsx)(`span`,{className:`presence-detail`,children:C.detail})]}),h&&(0,S.jsxs)(`span`,{className:`presence-ago`,children:[` · `,so(Date.now()-n)]})]})]});if(e===`waiting`&&i)return(0,S.jsx)(`button`,{type:`button`,className:`presence presence-waiting presence-invite`,onClick:i,title:`bring your agent into this review`,children:E});if(b)return(0,S.jsxs)(`button`,{type:`button`,className:`presence presence-${e} presence-suggests`,onClick:l.onOutline,onPointerEnter:w,title:l.reason?`the agent suggests reading this in layers: “${l.reason}”`:`the agent suggests reading this in layers`,children:[E,(0,S.jsx)(`span`,{className:`presence-cta`,children:`Ask it`})]});if(e===`waiting`||y===0||!s)return(0,S.jsx)(`span`,{className:`presence presence-${e}`,title:oo(e,t),onPointerEnter:w,children:E});let D=Math.round(a.done/y*100);return(0,S.jsxs)(`div`,{className:`menu monitor-anchor`,ref:m,children:[(0,S.jsxs)(`button`,{type:`button`,className:`presence presence-${e} presence-batch`,"aria-haspopup":`dialog`,"aria-expanded":o,onClick:()=>s(!o),onPointerEnter:w,title:`${$a[e]}. ${a.done} of ${y} answered; click to watch the queue`,children:[D>0&&(0,S.jsx)(`span`,{className:`presence-fill`,style:{width:`${D}%`},"aria-hidden":`true`}),E,` `,(0,S.jsxs)(`span`,{className:`presence-batch-n`,children:[a.done,`/`,y]})]}),o&&c]})}function lo({changeset:e,agent:t={},review:n={},settings:r={}}){let{openComments:i=0,publicDrafts:a=0,onFinishReview:o}=n,s=(0,x.useRef)(null),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(0),{theme:f,onSetTheme:p,critter:m=!0,onSetCritter:h,onShowShortcuts:g,onShowPrivacy:_}=r;return(0,S.jsxs)(`header`,{className:`top`,children:[(0,S.jsxs)(`span`,{className:`mark`,children:[(0,S.jsx)(Va,{size:36}),(0,S.jsx)(`span`,{className:`wordmark`,role:`img`,"aria-label":`Diffo`,children:[...`Diffo`].map((e,t)=>(0,S.jsx)(`span`,{className:`wordmark-letter`,style:{"--i":t},"aria-hidden":`true`,children:e},t))}),zt()&&(0,S.jsx)(`span`,{className:`dev-badge`,title:`this review is served by a diffo running from a source checkout, not the released CLI`,children:`dev`})]}),e.pr&&(0,S.jsx)(Qa,{pr:e.pr}),(0,S.jsx)(Ka,{changeset:e}),t.presence&&m?(0,S.jsx)(Ra,{presence:t.presence,reason:t.reason,seat:s,onAway:l,summon:u}):(0,S.jsx)(`span`,{className:`grow`}),t.presence&&(0,S.jsx)(co,{presence:t.presence,reason:t.reason,since:t.since,activity:t.activity,onInvite:t.onInvite,batch:t.batch,monitorOpen:t.monitorOpen,onOpenMonitor:t.onOpenMonitor,monitorPanel:t.monitorPanel,suggestion:t.suggestion,seat:s,faceAway:m&&c,onHover:m?()=>d(e=>e+1):void 0}),o&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-primary`,onClick:o,title:e.pr?a>0?`submit your review on GitHub with ${a} pending ${a===1?`comment`:`comments`}; private threads go to your agent`:`submit your review on GitHub; private threads and coverage go to your agent`:`finish review: send open comments + coverage to your agent`,children:e.pr?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` Submit review`,a>0?` (${a})`:``]}):`Finish review${i>0?` (${i})`:``}`}),(0,S.jsx)(Ha,{label:`Settings`,triggerClassName:`btn btn-ghost btn-icon`,children:e=>(0,S.jsxs)(S.Fragment,{children:[p&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(Ga,{children:`Theme`}),(0,S.jsx)(Ua,{icon:`display`,checked:f===`system`,onClick:()=>{e(),p(`system`)},children:`System`}),(0,S.jsx)(Ua,{icon:`sun`,checked:f===`light`,onClick:()=>{e(),p(`light`)},children:`Light`}),(0,S.jsx)(Ua,{icon:`moon`,checked:f===`dark`,onClick:()=>{e(),p(`dark`)},children:`Dark`})]}),h&&(0,S.jsxs)(S.Fragment,{children:[p&&(0,S.jsx)(Wa,{}),(0,S.jsx)(Ua,{icon:`sparkle`,checked:m,onClick:()=>{e(),h(!m)},children:`Companion`})]}),g&&(0,S.jsxs)(S.Fragment,{children:[(p||h)&&(0,S.jsx)(Wa,{}),(0,S.jsx)(Ua,{icon:`keys`,kbd:`?`,onClick:()=>{e(),g()},children:`Shortcuts`})]}),_&&(0,S.jsxs)(S.Fragment,{children:[(p||h||g)&&(0,S.jsx)(Wa,{}),(0,S.jsx)(Ua,{icon:`lock`,onClick:()=>{e(),_()},children:`Privacy`})]})]})})]})}function uo({presence:e,reason:t,onClose:n}){let{data:r,isLoading:i,error:a}=xt(!0),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1),[u,d]=(0,x.useState)(!1),f=e!==`waiting`,[p,m]=(0,x.useState)(f?`connected`:`invite`),[h,g]=(0,x.useState)(!1),_=(0,x.useRef)(f);(0,x.useEffect)(()=>{f!==_.current&&(_.current=f,m(f?`connected`:`invite`),g(!f))},[f]);let v=(0,x.useRef)(n);v.current=n,(0,x.useEffect)(()=>{if(p!==`connected`)return;let e=setTimeout(()=>v.current(),1800);return()=>clearTimeout(e)},[p]);let y=e=>{wt(e).then(e=>{l(!e),e&&(s(!0),d(!0),setTimeout(()=>s(!1),2500))})};return p===`connected`?(0,S.jsx)(jt,{title:`Agent attached`,onClose:n,children:(0,S.jsxs)(`div`,{className:`invite-connected`,children:[(0,S.jsx)(`span`,{className:`presence-dot`}),(0,S.jsx)(`p`,{className:`cov-note`,children:`Everything you send from here lands in that thread.`})]})}):(0,S.jsxs)(jt,{title:`Connect your agent`,onClose:n,children:[h&&(0,S.jsxs)(`div`,{className:`warn`,children:[(0,S.jsx)(H,{name:`alert`,size:`sm`}),(0,S.jsx)(`div`,{children:t===`ended`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`b`,{children:`Your agent left the review`}),`: it detached on purpose. Bring it back whenever you like.`]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`b`,{children:`Your agent disconnected`}),`: its poll died without detaching.`]})})]}),i&&(0,S.jsx)(`div`,{className:`shimmer`}),a&&(0,S.jsxs)(`p`,{className:`cov-note`,children:[`Couldn't build the invite: `,a.message]}),r&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{className:`cov-note`,children:`Paste this to your agent. Its Diffo skill does the rest.`}),(0,S.jsxs)(`button`,{type:`button`,className:`invite-cmd`,title:o?`Copied`:`copy the ask`,onClick:()=>y(r.ask),children:[(0,S.jsx)(`code`,{children:r.ask}),(0,S.jsx)(H,{name:o?`check`:`copy`,size:`sm`})]}),u&&(0,S.jsxs)(`div`,{className:`invite-live`,children:[(0,S.jsx)(`span`,{className:`presence-dot`}),`Listening for your agent…`]}),c&&(0,S.jsxs)(`div`,{className:`warn`,children:[(0,S.jsx)(H,{name:`alert`,size:`sm`}),(0,S.jsxs)(`div`,{children:[(0,S.jsx)(`b`,{children:`Couldn't reach the clipboard`}),`: this browser blocked it. Select the text and copy it by hand.`]})]})]})]})}function fo(e){return e.hunks.length>0?e.hunks.map(e=>e.id):[po(e)]}function po(e){return`file:${e.status}:${e.oldPath??``}${e.path}`}function mo(e,t){return t!==void 0&&fo(e).every(e=>t.has(e))}var ho=`Since your review`;function go(e,t){return e.hunks.find(e=>e.lines.some(e=>e.kind!==`del`&&e.newNo===t))}function _o(e,t){let n=t.get(e.path);if(!n)return{at:e};let r=e.line===void 0?void 0:go(n,e.line);return r?{at:e,file:n,hunkId:r.id}:{at:e,file:n}}function vo(e,t){if(e&&e.length!==0)return e.map(e=>({decision:e,places:(e.at??[]).map(e=>_o(e,t))}))}function yo(e,t){if(!e||e.items.length===0)return[];let n=new Map(t.map(e=>[e.path,e])),r=new Set,i=e.items.map((e,t)=>{let i=new Set,a=[],o=[];for(let t of e.files){let e=dt(t);if(i.has(e))continue;i.add(e),r.add(e);let s=n.get(e);if(!s){o.push(e);continue}let c=ft(t);a.push(c?{file:s,note:c}:{file:s})}let s=vo(e.decisions,n);return{id:e.id,number:t+1,title:e.title,...e.summary?{summary:e.summary}:{},...e.kind?{kind:e.kind}:{},files:a,missing:o,derived:!1,...s?{decisions:s}:{}}}),a=t.filter(e=>!r.has(e.path));return a.length>0&&i.push({id:null,number:null,title:ho,files:a.map(e=>({file:e})),missing:[],derived:!0}),i}function bo(e,t){return e.map(e=>{let n=e.files.filter(e=>!t(e.file)),r=e.files.length-n.length;return r===0?e:{...e,files:n,hidden:r}})}function xo(e){return e.id??`since`}function So(e){return e.filter(e=>e.anchor.kind===`changeset`&&ct(e)).at(-1)}function Co(e){return e.find(e=>e.github?.kind===`description`)}function wo(e){let t=new Map;for(let n of e)for(let{file:e}of n.files)t.has(e.path)||t.set(e.path,n);return t}function To(e,t){let n=0,r=0,i=0;for(let{file:a}of e.files){let e=fo(a),o=e.filter(e=>t.has(e)).length;n+=e.length,r+=o,o===e.length&&i++}return{files:e.files.length,doneFiles:i,marks:n,doneMarks:r}}function Eo(e,t){let n=To(e,t);return n.doneFiles===n.files}function Do(e,t,n,r=()=>!1){for(let i=t+n;i>=0&&i<e.length;i+=n)if(!r(e[i]))return i;return null}function Oo(e,t){let n=e.findIndex(e=>e.files.length>0&&!Eo(e,t));return n===-1?0:n}var ko=`#diffo-file:`;function Ao(e,t){return`${ko}${encodeURIComponent(e)}${t===null?``:`:${t}`}`}function jo(e){if(!e.startsWith(`#diffo-file:`))return null;let t=e.slice(12),n=/^(.*):(\d+)$/.exec(t);try{return n?{path:decodeURIComponent(n[1]),line:Number.parseInt(n[2],10)}:{path:decodeURIComponent(t),line:null}}catch{return null}}var Mo=/`([^`\n]+)`/g,No=/^([^\s:`]+?)(?::(\d+)(?:-\d+)?)?$/;function Po(e){let t=e.closest(`a[href], [data-diffo-jump]`);return t?jo(t.getAttribute(`data-diffo-jump`)??t.getAttribute(`href`)??``):null}function Fo(e,t){if(t.includes(e))return e;let n=t.filter(t=>t.slice(t.lastIndexOf(`/`)+1)===e);return n.length===1?n[0]:null}function J(e,t){return t.length===0?e:e.split(/(```[\s\S]*?```|\[[^\]\n]*\]\([^)\n]*\))/).map((e,n)=>n%2==1?e:e.replace(Mo,(e,n)=>{let r=No.exec(n);if(!r)return e;let i=Fo(r[1],t);return i===null?e:`[${e}](${Ao(i,r[2]===void 0?null:Number.parseInt(r[2],10))})`})).join(``)}function Y({state:e=!1}){return(0,S.jsx)(`span`,{className:`markbox`,"data-state":e===`mixed`?`mixed`:e?`on`:`off`,"aria-hidden":`true`,children:e===!0&&(0,S.jsx)(H,{name:`check`,size:`sm`})})}var Io=()=>{let e=document.documentElement.getAttribute(`data-theme`);return e===`dark`?!0:e===`light`?!1:window.matchMedia?.(`(prefers-color-scheme: dark)`).matches??!1};function Lo(){let[e,t]=(0,x.useState)(()=>typeof window<`u`&&Io());return(0,x.useEffect)(()=>{let e=()=>t(Io()),n=window.matchMedia?.(`(prefers-color-scheme: dark)`);n?.addEventListener(`change`,e);let r=new MutationObserver(e);return r.observe(document.documentElement,{attributeFilter:[`data-theme`]}),()=>{n?.removeEventListener(`change`,e),r.disconnect()}},[]),e}function Ro(e){return`file-${e.replace(/[^a-zA-Z0-9_-]/g,`_`)}`}function zo(e,t,n=`start`){let r=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1,i=e.closest(`.reading-pane`),a=i?.scrollTop,o=()=>e.scrollIntoView({behavior:r?`instant`:`smooth`,block:n});if(o(),r){t?.(e);return}let s=i?.querySelector(`.reading-col`),c=e.offsetTop,l=null;s&&typeof ResizeObserver==`function`&&(l=new ResizeObserver(()=>{let t=e.offsetTop;t!==c&&(c=t,o())}),l.observe(s));let u=!1,d=()=>{u||(u=!0,l?.disconnect(),i&&i.scrollTop===a&&e.scrollIntoView({behavior:`instant`,block:n}),t?.(e))};i?.addEventListener(`scrollend`,d,{once:!0}),setTimeout(d,1200)}var Bo=[/[._-](test|spec)s?\.[^/]+$/,/(^|\/)test_[^/]+$/,/(^|[/.a-z0-9])Tests?\.[^/]+$/,/(^|\/)test[-_]?([Uu]tils?|[Hh]elpers?|[Ss]etup|[Ss]upport)\.[^/]+$/,/\.cy\.[^/]+$/,/[._-]e2e\.[^/]+$/,/(^|\/)(jest|vitest|playwright|cypress|karma|wdio|protractor)[.-](config|setup)(\.[^/]+)?$/,/\.snap$/,/[a-z0-9]Specs?\.(kt|kts|scala|groovy|swift)$/,/[a-z0-9](IT|ITCase)\.(java|kt|groovy|scala)$/,/(^|\/)(conftest|tests?)\.py$/,/(^|\/)pytest\.ini$/,/(^|\/)(spec|rails)_helper\.rb$/,/(^|\/)spec\/.+\.rb$/,/(^|\/)phpunit\.xml(\.dist)?$/,/(^|\/)mock_[^/]+\.go$/,/_mock\.go$/,/\.golden$/,/\.(feature|robot)$/,/(^|\/)(__tests__|__mocks__|__snapshots__|__fixtures__|[Tt]ests?)\//,/\.([A-Z][A-Za-z]*)?Tests?\//,/(^|\/)[a-z]+Tests?\//,/(^|\/)test[A-Z][A-Za-z]*\//,/(^|\/)tests?[-_][a-z]+\//,/(^|[/_-])e2e([-_][^/]*)?\//,/(^|\/)(cypress|playwright|testdata|step_definitions|mocks)\//];function Vo(e){return Bo.some(t=>t.test(e))}var Ho=`diffo:ui:hideReviewed`,Uo=`diffo:ui:hideTests`;function Wo(e){let t=localStorage.getItem(e);return t===`1`||t!==`0`&&null}function Go(e,t){let n=0,r=0,i=0,a=0,o=[];for(let s of e){let e=t.isDone(s);if(!t.pinned.has(s.path)){if(t.onlyChanged&&!t.changed.has(s.path)){e||(a++,o.push(s.path));continue}if(t.hideTests&&Vo(s.path)){e||(i++,o.push(s.path));continue}}r++,e||n++}return{left:n,total:r,excludedTests:i,excludedUnchanged:a,excludedPaths:o}}function Ko(e,t){let n=[],r=t.query.trim().toLowerCase(),i=0,a=0,o=0,s=0;for(let c of e){if(t.pinned.has(c.path)){n.push(c);continue}if(r!==``&&!c.path.toLowerCase().includes(r)){s++;continue}if(t.onlyChanged&&!t.changed.has(c.path)){o++;continue}if(t.hideTests&&Vo(c.path)){i++;continue}if(t.hideReviewed&&t.isDone(c)){a++;continue}n.push(c)}return{visible:n,hiddenTests:i,hiddenReviewed:a,hiddenUnchanged:o,hiddenQuery:s}}function qo(e,t,n){let[r,i]=(0,x.useState)(()=>Wo(Ho)),[a,o]=(0,x.useState)(()=>Wo(Uo)),[s,c]=(0,x.useState)(new Set),[l,u]=(0,x.useState)(``),d=(0,x.useCallback)(e=>{u(e),c(e=>e.size===0?e:new Set)},[]),f=r??e.length>25,p=a??!1,m=(0,x.useCallback)(e=>{localStorage.setItem(Ho,e?`1`:`0`),i(e),c(new Set)},[]),h=(0,x.useCallback)(e=>{localStorage.setItem(Uo,e?`1`:`0`),o(e)},[]),g=(0,x.useCallback)(e=>{c(t=>t.has(e)?t:new Set(t).add(e))},[]),_=(0,x.useCallback)(e=>{c(t=>{if(!t.has(e))return t;let n=new Set(t);return n.delete(e),n})},[]),v=n.set,y=(0,x.useCallback)(()=>{localStorage.setItem(Ho,`0`),localStorage.setItem(Uo,`0`),i(!1),o(!1),c(new Set),u(``),v(!1)},[v]),b=(0,x.useMemo)(()=>Ko(e,{query:l,hideReviewed:f,hideTests:p,onlyChanged:n.on,changed:n.changed,pinned:s,isDone:t}),[e,l,f,p,n.on,n.changed,s,t]),S=(0,x.useMemo)(()=>e.filter(e=>Vo(e.path)).length,[e]),C=(0,x.useMemo)(()=>Go(e,{hideTests:p,onlyChanged:n.on,changed:n.changed,pinned:s,isDone:t}),[e,p,n.on,n.changed,s,t]);return{query:l,setQuery:d,hideReviewed:f,hideTests:p,setHideReviewed:m,setHideTests:h,onlyChanged:n.on,setOnlyChanged:v,files:b.visible,hiddenTests:b.hiddenTests,hiddenReviewed:b.hiddenReviewed,hiddenUnchanged:b.hiddenUnchanged,hiddenQuery:b.hiddenQuery,testCount:S,changedCount:n.changed.size,scope:C,pinned:s,pin:g,unpin:_,showAll:y}}var Jo=e=>e.slice(e.lastIndexOf(`/`)+1),Yo={added:`new file`,deleted:`deleted`,renamed:`renamed`,modified:`edited`};function Xo(e){let t={dirs:new Map,files:[],path:``};for(let n of e){let e=n.path.split(`/`),r=t;for(let t of e.slice(0,-1)){let e=r.dirs.get(t);e||(e={dirs:new Map,files:[],path:r.path===``?t:`${r.path}/${t}`},r.dirs.set(t,e)),r=e}r.files.push(n)}let n=e=>{let t=[];for(let[r,i]of e.dirs){let e={kind:`dir`,name:r,path:i.path,children:n(i)};for(;;){let t=e.children.length===1?e.children[0]:void 0;if(t===void 0||t.kind!==`dir`)break;e={kind:`dir`,name:`${e.name}/${t.name}`,path:t.path,children:t.children}}t.push(e)}t.sort((e,t)=>e.name.localeCompare(t.name));let r=e.files.map(e=>({kind:`file`,file:e})).sort((e,t)=>Jo(e.file.path).localeCompare(Jo(t.file.path)));return[...t,...r]};return n(t)}function Zo(e){return e.kind===`file`?[e.file]:e.children.flatMap(Zo)}function Qo(e){return Xo(e).flatMap(Zo)}function $o({file:e,depth:t,done:n,current:r,threads:i,wantsYou:a=0,changed:o=!1,note:s,onPick:c,onToggleViewed:l,onAsk:u}){let d=i?.length??0,f=0,p=0;for(let t of e.hunks)for(let e of t.lines)e.kind===`add`?f++:e.kind===`del`&&p++;let m=f>0||p>0?` · ${f>0?`+${f}`:``}${f>0&&p>0?` `:``}${p>0?`−${p}`:``}`:``;return(0,S.jsxs)(`div`,{className:`row${n?` row-done`:``}`,"aria-current":r?`true`:void 0,"data-path":e.path,style:{paddingLeft:12+t*14},children:[(0,S.jsx)(`button`,{type:`button`,className:`row-box`,role:`checkbox`,"aria-checked":n,"aria-label":`${n?`Mark not reviewed`:`Mark reviewed`}: ${e.path}`,"data-tip":n?`Mark not reviewed`:`Mark reviewed`,disabled:!l,onClick:l,children:(0,S.jsx)(Y,{state:n})}),(0,S.jsx)(`button`,{type:`button`,className:`row-pick`,title:`${e.path} · ${Yo[e.status]}${n?` · read`:``}${m}${s?`, ${s}`:``}`,onClick:()=>{if(c)return c();let t=document.getElementById(Ro(e.path));t&&zo(t)},children:(0,S.jsxs)(`span`,{className:`row-name`,children:[e.status===`added`&&(0,S.jsx)(`span`,{className:`row-st row-st-add`,"aria-hidden":`true`,children:`+`}),e.status===`deleted`&&(0,S.jsx)(`span`,{className:`row-st row-st-del`,"aria-hidden":`true`,children:`−`}),e.status===`renamed`&&e.oldPath!==null&&(0,S.jsxs)(`span`,{className:`row-was`,children:[Jo(e.oldPath),` →`]}),(0,S.jsx)(`span`,{className:`row-base${e.status===`deleted`?` row-base-del`:``}`,children:Jo(e.path)})]})}),(0,S.jsxs)(`span`,{className:`row-right`,children:[o&&(0,S.jsx)(`span`,{role:`img`,className:`row-since row-since-changed`,title:`your agent rewrote this since you last finished a review`,"aria-label":`changed since your last review`}),(0,S.jsx)(`span`,{className:`row-passive`,children:a>0?(0,S.jsxs)(`span`,{className:`row-count row-count-hot`,title:`${a} of ${d} thread${d===1?``:`s`} needs you`,children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),a,` needs you`]}):d>0?(0,S.jsxs)(`span`,{className:`row-count`,title:`${d} thread${d===1?``:`s`}`,children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),d]}):null}),(0,S.jsx)(`span`,{className:`row-acts`,children:u&&(0,S.jsx)(`button`,{type:`button`,className:`row-act`,"data-tip":`Comment on this file`,"aria-label":`Comment on this file`,onClick:u,children:(0,S.jsx)(H,{name:`chat`,size:`sm`})})})]})]})}function es({files:e,viewed:t,selectedPath:n,onPickFile:r,onToggleFileViewed:i,onMarkFiles:a,onClearFiles:o,onAskFile:s,threads:c,attention:l,changed:u,notes:d,forceOpen:f=!1}){let[p,m]=(0,x.useState)(new Set),h=(0,x.useCallback)(e=>mo(e,t),[t]),g=(0,x.useMemo)(()=>Xo(e),[e]),_=(e,t)=>(0,S.jsx)($o,{file:e,depth:t,done:h(e),current:n===e.path,threads:c?.get(e.path),wantsYou:(l?.get(e.path)??[]).filter(e=>e.turn===`yours`).length,changed:u?.has(e.path)??!1,note:d?.get(e.path),onPick:r?()=>r(e.path):void 0,onToggleViewed:i?()=>i(e.path):void 0,onAsk:s?()=>s(e.path):void 0},e.path),v=(e,t)=>{let n=Zo(e),r=f||!p.has(e.path),i=n.filter(h).length,s=n.length>0&&i===n.length,c=n.filter(e=>!h(e)),l=(0,S.jsxs)(`div`,{className:`row row-dir${s?` row-done`:``}`,style:{paddingLeft:12+t*14},children:[(0,S.jsx)(`button`,{type:`button`,className:`row-box`,role:`checkbox`,"aria-checked":s?!0:i>0&&`mixed`,"aria-label":s?`Mark ${e.name} not reviewed`:`Mark ${c.length} file${c.length===1?``:`s`} in ${e.name} reviewed`,"data-tip":s?`Mark ${n.length} file${n.length===1?``:`s`} not reviewed`:`Mark ${c.length} file${c.length===1?``:`s`} reviewed`,disabled:s?!o:!a,onClick:()=>{s?o?.(n.map(e=>e.path)):a?.(c.map(e=>e.path))},children:(0,S.jsx)(Y,{state:s?!0:i>0&&`mixed`})}),(0,S.jsx)(`button`,{type:`button`,className:`row-pick`,title:e.path,"aria-expanded":r,onClick:()=>m(t=>{let n=new Set(t);return r?n.add(e.path):n.delete(e.path),n}),children:(0,S.jsxs)(`span`,{className:`row-name`,children:[(0,S.jsx)(`span`,{className:`chevron${r?``:` chevron-shut`}`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),(0,S.jsx)(`span`,{className:`dir-ico`,children:(0,S.jsx)(H,{name:`folder`,size:`sm`})}),(0,S.jsx)(`span`,{className:`row-base`,children:e.name})]})})]},`dir:${e.path}`);return r?[l,...y(e.children,t+1)]:[l]},y=(e,t)=>e.flatMap(e=>e.kind===`file`?[_(e.file,t)]:v(e,t));return(0,S.jsx)(S.Fragment,{children:y(g,0)})}function ts({files:e,viewed:t,selectedPath:n,onPickFile:r,onToggleFileViewed:i,onMarkFiles:a,onClearFiles:o,onAskFile:s,threads:c,attention:l,changed:u,query:d,onQuery:f,focusTick:p=0,hideReviewed:m=!1,onHideReviewed:h,hideTests:g=!1,onHideTests:_,onlyChanged:v=!1,onOnlyChanged:y}){let[b,C]=(0,x.useState)(``),w=d??b,T=f??C,E=(0,x.useRef)(null);(0,x.useEffect)(()=>{p>0&&E.current?.focus()},[p]);let D=(0,x.useCallback)(e=>mo(e,t),[t]),O=(0,x.useMemo)(()=>{let t=w.trim().toLowerCase();return e.filter(e=>(t===``||e.path.toLowerCase().includes(t))&&!(m&&D(e))&&!(g&&Vo(e.path))&&!(v&&!(u?.has(e.path)??!1)))},[e,w,m,g,v,u,D]),k=w.trim()!==``,A=w.trim().toLowerCase(),j=e.filter(e=>A===``||e.path.toLowerCase().includes(A)).length-O.length,M=!!(h||_||y);return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`rail-search`,children:(0,S.jsxs)(`span`,{className:`sb`,children:[(0,S.jsx)(H,{name:`search`,size:`sm`}),(0,S.jsx)(`input`,{ref:E,className:`nav-search`,type:`search`,placeholder:`Filter files`,"aria-label":`Filter files`,title:`Press / to jump here`,value:w,onChange:e=>T(e.target.value)}),w!==``&&(0,S.jsx)(`button`,{type:`button`,className:`sb-clear`,"data-tip":`Clear filter`,"aria-label":`Clear filter`,onClick:()=>{T(``),E.current?.focus()},children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]})}),(0,S.jsxs)(`div`,{className:`rail-scroll`,children:[(0,S.jsx)(es,{files:O,viewed:t,selectedPath:n,onPickFile:r,onToggleFileViewed:i,onMarkFiles:a,onClearFiles:o,onAskFile:s,threads:c,attention:l,changed:u,forceOpen:k}),O.length===0&&j===0&&(0,S.jsx)(`div`,{className:`rail-empty`,children:`no files match`})]}),j>0&&(0,S.jsxs)(`div`,{className:`rail-hidden`,children:[j,` `,j===1?`file`:`files`,` hidden by filters`,M&&(0,S.jsx)(`button`,{type:`button`,className:`rail-hidden-show`,onClick:()=>{m&&h?.(!1),g&&_?.(!1),v&&y?.(!1)},children:`show`})]})]})}var ns=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function rs(e,t){let n=e.hidden??0;if(e.files.length===0)return n>0?`${ns(n,`test`)} hidden`:e.missing.length===0?`nothing here now`:`${ns(e.missing.length,`listed file`)} not in the changeset`;let r=To(e,t),i=r.doneFiles===r.files?` · read`:``,a=e.kind===`mechanical`?` · mechanical`:``,o=n>0?` · ${n} hidden`:``;return`${ns(r.files,`file`)}${i}${a}${o}`}function is({layer:e,index:t,current:n,open:r,onToggleOpen:i,viewed:a,threadCount:o,onPick:s,onMarkFiles:c,onClearFiles:l}){let u=To(e,a),d=u.files>0&&u.doneFiles===u.files,f=u.doneMarks>0,p=e.files.filter(e=>!mo(e.file,a)).map(e=>e.file.path),m=e.files.map(e=>e.file.path);return(0,S.jsxs)(`div`,{className:`row row-layer${d?` row-done`:``}${e.derived?` row-layer-since`:``}`,"aria-current":n?`true`:void 0,"data-layer":e.id??`since`,onClick:()=>s(t),children:[(0,S.jsx)(`button`,{type:`button`,className:`row-box`,role:`checkbox`,"aria-checked":d?!0:f?`mixed`:!1,"aria-label":d?`Mark ${e.title} not reviewed`:`Mark ${ns(p.length,`file`)} in ${e.title} reviewed`,"data-tip":d?`Mark ${ns(m.length,`file`)} not reviewed`:`Mark ${ns(p.length,`file`)} reviewed`,disabled:m.length===0||(d?!l:!c),onClick:e=>{e.stopPropagation(),d?l?.(m):c?.(p)},children:(0,S.jsx)(Y,{state:d?!0:f?`mixed`:!1})}),(0,S.jsxs)(`button`,{type:`button`,className:`row-pick`,title:e.title,onClick:e=>{e.stopPropagation(),s(t)},children:[(0,S.jsx)(`span`,{className:`row-name`,children:(0,S.jsx)(`span`,{className:`row-base`,children:e.title})}),(0,S.jsxs)(`span`,{className:`ch-sub`,children:[u.doneMarks>0&&(0,S.jsx)(`span`,{className:`prog-track`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{style:{width:`${u.marks===0?0:Math.round(u.doneMarks/u.marks*100)}%`}})}),(0,S.jsx)(`span`,{children:rs(e,a)})]})]}),(0,S.jsxs)(`span`,{className:`row-right`,children:[o>0&&(0,S.jsxs)(`span`,{className:`row-count`,title:ns(o,`thread`),children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),o]}),e.files.length>0&&(0,S.jsx)(`button`,{type:`button`,className:`row-act ch-fold chevron${r?``:` chevron-shut`}`,"aria-expanded":r,"aria-label":`${r?`Hide`:`Show`} the files in ${e.title}`,"data-tip":r?`Hide files`:`Show files`,onClick:e=>{e.stopPropagation(),i()},children:(0,S.jsx)(H,{name:`chev`,size:`sm`})})]})]})}function as({layer:e,...t}){let n=(0,x.useMemo)(()=>e.files.map(e=>e.file),[e.files]),r=(0,x.useMemo)(()=>new Map(e.files.flatMap(e=>e.note?[[e.file.path,e.note]]:[])),[e.files]);return(0,S.jsx)(es,{files:n,notes:r,...t})}function os({layers:e,activeIndex:t,onPick:n,viewed:r,guide:i,description:a,overviewActive:o=!1,onOpenGuide:s,threads:c,attention:l,changed:u,selectedPath:d,onPickFile:f,onToggleFileViewed:p,onMarkFiles:m,onClearFiles:h,onAskFile:g,onRefresh:_,request:v=null}){let y=e=>e.files.reduce((e,t)=>e+(c?.get(t.file.path)?.length??0),0),[b,C]=(0,x.useState)(new Set),w=e=>b.has(e.id??`since`),T=e=>C(t=>{let n=new Set(t),r=e.id??`since`;return n.has(r)?n.delete(r):n.add(r),n});return(0,S.jsxs)(`div`,{className:`rail-scroll`,children:[(i||a)&&(0,S.jsxs)(`div`,{className:`row row-layer row-layer-overview`,"aria-current":o?`true`:void 0,onClick:s,children:[(0,S.jsx)(`span`,{className:`row-box`,"aria-hidden":`true`,children:(0,S.jsx)(Y,{})}),(0,S.jsxs)(`button`,{type:`button`,className:`row-pick`,title:a&&i?`The pull request description, and the agent’s guide to this change`:a?`The pull request description`:`The agent’s guide to this change`,onClick:e=>{e.stopPropagation(),s?.()},children:[(0,S.jsx)(`span`,{className:`row-name`,children:(0,S.jsx)(`span`,{className:`row-base`,children:`Overview`})}),(0,S.jsx)(`span`,{className:`ch-sub`,children:(0,S.jsx)(`span`,{children:a&&i?`the description, and the agent’s guide`:a?`the pull request description`:`the agent’s guide`})})]}),(0,S.jsx)(`span`,{className:`row-right`})]}),e.map((e,i)=>{let a=i===t,o=w(e);return(0,S.jsxs)(`div`,{className:`ch-layer`,children:[e.derived&&(0,S.jsx)(`div`,{className:`rail-rule`}),(0,S.jsx)(is,{layer:e,index:i,current:a,open:o,onToggleOpen:()=>T(e),viewed:r,threadCount:y(e),onPick:n,onMarkFiles:m,onClearFiles:h}),o&&e.files.length>0&&(0,S.jsx)(`div`,{className:`ch-files`,children:(0,S.jsx)(as,{layer:e,viewed:r,selectedPath:d,threads:c,attention:l,changed:u,onPickFile:f,onToggleFileViewed:p,onMarkFiles:m,onClearFiles:h,onAskFile:g})})]},e.id??`since`)}),v===null?_?(0,S.jsx)(`button`,{type:`button`,className:`ch-foot ch-foot-act`,title:`the change moved on; a re-post keeps your place`,onClick:_,children:`Ask the agent to re-outline…`}):(0,S.jsx)(`div`,{className:`ch-foot`,title:`Invite one from the header`,children:`No agent attached to re-outline`}):(0,S.jsxs)(`div`,{className:`ch-foot ch-foot-live`,"aria-live":`polite`,children:[(0,S.jsxs)(`span`,{className:`ch-working`,"aria-hidden":`true`,children:[(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{})]}),` `,v===`outlining`?`re-outlining…`:`asked · waits for the open threads`]})]})}function ss({state:e,onOutline:t,onInvite:n}){if(e===`queued`||e===`outlining`){let t=e===`outlining`;return(0,S.jsx)(`div`,{className:`rail-scroll`,children:(0,S.jsxs)(`div`,{className:`ch-empty`,"data-state":e,"aria-live":`polite`,children:[(0,S.jsxs)(`h2`,{className:`ch-empty-title`,children:[(0,S.jsxs)(`span`,{className:`ch-working${t?``:` ch-working-idle`}`,"aria-hidden":`true`,children:[(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{})]}),t?`Outlining…`:`Asked`]}),(0,S.jsx)(`p`,{className:`ch-empty-sub`,children:t?`The steps appear here as soon as the agent posts them.`:`The agent starts once it finishes the threads it’s answering.`})]})})}return(0,S.jsx)(`div`,{className:`rail-scroll`,children:(0,S.jsxs)(`div`,{className:`ch-empty`,"data-state":e,"aria-live":`polite`,children:[(0,S.jsx)(`h2`,{className:`ch-empty-title`,children:`Read in layers`}),(0,S.jsx)(`p`,{className:`ch-empty-sub`,children:`The agent splits its change into steps you read in order.`}),e===`noagent`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`p`,{className:`ch-empty-note`,children:`No agent is attached to outline it.`}),n&&(0,S.jsx)(`button`,{type:`button`,className:`btn ch-empty-cta`,onClick:n,children:`Invite an agent`})]}):(0,S.jsxs)(`button`,{type:`button`,className:`btn ch-empty-cta`,onClick:t,disabled:!t,children:[(0,S.jsx)(H,{name:`list`,size:`sm`}),`Ask the agent to outline`]})]})})}function cs({tab:e,onSetTab:t,fileCount:n,threadCount:r,settledCount:i=0,wantsYou:a,layerCount:o=null,layersSuggested:s=!1,layers:c,files:l,threads:u}){return(0,S.jsxs)(`nav`,{className:`rail`,children:[(0,S.jsxs)(`div`,{className:`tabs`,role:`tablist`,"aria-label":`Files, threads, or layers`,children:[(0,S.jsxs)(`button`,{type:`button`,role:`tab`,className:`tab`,"aria-selected":e===`files`,onClick:()=>t(`files`),children:[`Files `,(0,S.jsx)(`span`,{className:`tab-n`,children:n})]}),(0,S.jsxs)(`button`,{type:`button`,role:`tab`,className:`tab`,"aria-selected":e===`threads`,onClick:()=>t(`threads`),title:i>0?`${r} still going · ${i} settled`:void 0,children:[a>0&&(0,S.jsx)(`span`,{className:`tab-dot`,"aria-hidden":`true`}),`Threads `,(0,S.jsx)(`span`,{className:`tab-n`,children:r})]}),(0,S.jsxs)(`button`,{type:`button`,role:`tab`,className:`tab`,"aria-selected":e===`layers`,onClick:()=>t(`layers`),title:o===null?`The agent’s reading plan, once it posts one`:void 0,children:[s&&o===null&&(0,S.jsx)(`span`,{className:`tab-dot`,"aria-hidden":`true`}),`Layers `,o!==null&&(0,S.jsx)(`span`,{className:`tab-n`,children:o})]})]}),e===`layers`?c:e===`files`?l:u]})}var ls=(0,x.createContext)(null);function us(){return(0,x.useContext)(ls)}function ds(e){return e.state===`resolved`?`resolved`:at(e)?e.state===`open`&&!e.github?`note`:`posted`:ut(e)&&e.state===`open`?`proposed`:e.state===`open`?`note`:e.messages.at(-1)?.author===`agent`?e.awaitingFollowUp===!0?`agent`:`yours`:e.withheld?`note`:e.unanswered?e.state===`addressed`?`yours`:`unanswered`:`agent`}function fs(e){return(e.state===`open`||e.withheld===!0)&&!ut(e)&&!at(e)}var ps=[`yours`,`unanswered`,`proposed`,`agent`,`note`,`posted`,`resolved`],ms={yours:`Your turn`,unanswered:`No answer`,proposed:`From the agent`,agent:`Waiting on agent`,note:`Draft`,posted:`On GitHub`,resolved:`Resolved`},hs=[`yours`,`proposed`,`agent`,`note`,`posted`,`settled`],gs={yours:`Your turn`,proposed:`From the agent`,agent:`Waiting on the agent`,note:`Drafts`,posted:`On GitHub`,settled:`Settled`};function _s(e){switch(e){case`yours`:case`unanswered`:return`yours`;case`proposed`:return`proposed`;case`agent`:return`agent`;case`note`:return`note`;case`posted`:return`posted`;case`resolved`:return`settled`}}function vs(e){if(e.state===`open`||e.state===`resolved`||at(e))return null;let t=e.messages.at(-1)?.author===`agent`&&e.awaitingFollowUp!==!0,n=e.state===`addressed`;return t?n?`fixed`:`answered`:n?`changed`:e.unanswered?`no-answer`:`waiting`}function ys(e){for(let t of e.split(`
|
|
80
80
|
`)){let e=t.trim();if(e!==``)return e}return``}function bs(e){let t=e.anchor;return t.kind===`changeset`?{anchor:null,path:null}:t.kind===`file`?{anchor:t.path,path:t.path}:t.kind===`layer`?{anchor:`layer “${t.title}”`,path:null}:{anchor:`${t.path}:${mt(t)}`,path:t.path}}function xs(e,t){if(e.messages.some(e=>e.author===`reviewer`))return!0;if(!t)return!1;let n=RegExp(`@${t}(?![\\w-])`,`i`);return e.messages.some(e=>e.author===`github`&&(e.github?.user.login===t||n.test(e.text)))}function Ss(e){let t=e=>ps.indexOf(e.turn),n=e=>e.sort((e,n)=>t(e)-t(n)||n.updatedAt.localeCompare(e.updatedAt));return{github:n(e.filter(e=>at(e.thread))),agent:n(e.filter(e=>!at(e.thread)))}}function Cs(e,t=new Set,n=new Map){return e.map(e=>{let r=[...e.messages].reverse().find(t=>at(e)?t.author===`github`:t.author===`agent`),i=n.get(e.id),a=vs(e);return{thread:e,turn:ds(e),...a?{outcome:a}:{},...t.has(e.id)?{working:!0}:{},...i!==void 0&&!t.has(e.id)?{queued:i}:{},...e.github?.outdated===!0?{outdated:!0}:{},question:ys(e.messages[0]?.text??``),answer:r?ys(r.text):null,...bs(e),...r?.durationMs===void 0?{}:{durationMs:r.durationMs},updatedAt:e.updatedAt}})}function ws(e){return e===null?`the changeset`:e.slice(e.lastIndexOf(`/`)+1)}function Ts(e,t){let n=e.find(e=>e.working===!0);return n?`working on ${ws(n.anchor)}`:t===null?e.length>0?`picked up ${e.length} comment${e.length===1?``:`s`}`:null:`answered ${t}`}function Es(e){let t=new Map;for(let n of hs){let r=e.filter(e=>_s(e.turn)===n).sort((e,t)=>t.updatedAt.localeCompare(e.updatedAt));r.length>0&&t.set(n,r)}return t}function Ds(e){return e.filter(e=>e.turn===`yours`||e.turn===`unanswered`).length}function Os(e){return e.filter(e=>_s(e.turn)!==`settled`).length}function ks(e){let t=new Map;for(let n of e){if(n.path===null)continue;let e=t.get(n.path);e?e.push(n):t.set(n.path,[n])}return t}var As=`modulepreload`,js=function(e){return`/`+e},Ms={},X=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=js(t,n),t=s(t),t in Ms)return;Ms[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:As,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ns=null,Ps=null,Fs=null,Is=0,Ls=pr(),Rs=/^(graph|flowchart|stateDiagram|sequenceDiagram|classDiagram|erDiagram|xychart)\b/;function zs(e){for(let t of e.split(`
|
|
81
|
-
`)){let e=t.trim();if(!(e===``||e.startsWith(`%%`)))return Rs.test(e)}return!1}var Bs={bg:`var(--fill)`,fg:`var(--ink)`,transparent:!0,font:`system-ui`};function Vs(e){return e.replace(/@import url\([^)]*\);?/g,``)}async function Hs(){return Ns||=X(()=>import(`./dist-
|
|
81
|
+
`)){let e=t.trim();if(!(e===``||e.startsWith(`%%`)))return Rs.test(e)}return!1}var Bs={bg:`var(--fill)`,fg:`var(--ink)`,transparent:!0,font:`system-ui`};function Vs(e){return e.replace(/@import url\([^)]*\);?/g,``)}async function Hs(){return Ns||=X(()=>import(`./dist-Dpuu8gDL.js`),[]),Ns}function Us(){let e=document.documentElement.getAttribute(`data-theme`);return e===`dark`?`dark`:e===`light`?`neutral`:window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`neutral`}async function Ws(){Ps||=X(()=>import(`./mermaid.core-BRH8LAdQ.js`).then(e=>e.default),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]));let e=await Ps,t=Us();return Fs!==t&&(Fs=t,e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:t,htmlLabels:!1,flowchart:{htmlLabels:!1,useMaxWidth:!1},sequence:{useMaxWidth:!1},state:{useMaxWidth:!1},er:{useMaxWidth:!1},class:{useMaxWidth:!1},pie:{useMaxWidth:!1}})),e}async function Gs(e){try{let t=await Ws();await t.parse(e);let{svg:n}=await t.render(`diffo-mermaid-${++Is}`,e);return n}catch{return null}}async function Ks(e){if(zs(e))try{return{svg:Vs((await Hs()).renderMermaidSVG(e,Bs)),live:!0}}catch{}let t=await Gs(e);return t===null?null:{svg:t,live:!1}}function qs(e){return Ls.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}})}var Js=.6;function Ys(e){let t=e.querySelector(`svg`);if(!t)return;let n=Number.parseFloat(t.getAttribute(`width`)??``)||Number.parseFloat(t.getAttribute(`viewBox`)?.split(/\s+/)[2]??``);Number.isFinite(n)&&n>0&&(t.style.minWidth=`${Math.round(n*Js)}px`)}var Xs=[29,29,31],Zs=[245,245,247];function Qs(e){let t=e.trim().toLowerCase(),n=/^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(t)?.[1];if(n){let[e,t,r,i]=(n.length<=4?Array.from(n,e=>e+e):n.match(/../g)).map(e=>Number.parseInt(e,16));return{rgb:[e,t,r],alpha:i===void 0?1:i/255}}let r=/^rgba?\(([^)]*)\)$/.exec(t)?.[1];if(r){let e=r.split(/[\s,/]+/).filter(Boolean);if(e.length<3)return null;let[t,n,i]=e.slice(0,3).map(Number),a=e[3]===void 0?1:Number.parseFloat(e[3])/(e[3].endsWith(`%`)?100:1);return[t,n,i,a].every(Number.isFinite)?{rgb:[t,n,i],alpha:a}:null}return null}function $s(e){let[t,n,r]=e.map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r}function ec(e){for(let t of Array.from(e.querySelectorAll(`g.node`))){let e=t.querySelectorAll(`text[fill="var(--_text)"]`),n=t.querySelector(`[fill]:not(text):not(tspan)`),r=n?.getAttribute(`fill`)??``;if(e.length===0||!n||r.startsWith(`var(`)||r===`none`)continue;let i=Qs(r)??Qs(getComputedStyle(n).fill);if(!i||i.alpha<.5)continue;let a=$s(i.rgb),o=(a+.05)/($s(Xs)+.05)>=($s(Zs)+.05)/(a+.05)?Xs:Zs;for(let t of Array.from(e))t.setAttribute(`fill`,`rgb(${o.join(` `)})`)}}var tc=!1;function nc(){if(tc)return;tc=!0;let e=()=>void rc();new MutationObserver(e).observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]}),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,e)}async function rc(){if(Us()===Fs)return;let e=document.querySelectorAll(`.mermaid-figure[data-mermaid-source]`);for(let t of Array.from(e)){let e=await Gs(t.dataset.mermaidSource??``);e!==null&&t.isConnected&&(t.innerHTML=qs(e),Ys(t))}}function ic(e){return Array.from(e.querySelectorAll(`code.language-mermaid`)).map(e=>e.closest(`pre`)).filter(e=>e!==null&&!e.hasAttribute(`data-mermaid-done`))}async function ac(e){if(e&&ic(e).length!==0)for(let t of ic(e)){if(t.hasAttribute(`data-mermaid-done`))continue;t.setAttribute(`data-mermaid-done`,``);let e=t.textContent??``,n=await Ks(e);if(!t.isConnected)continue;if(n===null){let e=document.createElement(`div`);e.className=`mermaid-broken`,e.textContent=`diagram didn't parse, showing its source`,t.before(e);continue}let r=document.createElement(`div`);r.className=`mermaid-figure`,r.innerHTML=qs(n.svg),Ys(r),n.live||(r.dataset.mermaidSource=e,nc()),t.replaceWith(r),n.live&&ec(r)}}function oc(e){let t=Array.from(e.querySelectorAll(`tspan`));return t.length===0?e.textContent??``:t.map(e=>e.textContent??``).join(` `)}function sc(e){return e.split(/[\s·,;()[\]{}"'«»]+/).filter(Boolean)}function cc(e,t){for(let n of sc(e)){let e=No.exec(n);if(!e)continue;let r=Fo(e[1],t);if(r!==null)return{path:r,line:e[2]===void 0?null:Number.parseInt(e[2],10)}}return null}function lc(e,t){if(!e||t.length===0)return;let n=e.querySelectorAll(`.mermaid-figure text:not([data-diffo-jump]):not([data-diffo-plain])`);for(let e of Array.from(n)){let n=cc(oc(e),t);if(!n){e.setAttribute(`data-diffo-plain`,``);continue}e.setAttribute(`data-diffo-jump`,Ao(n.path,n.line)),e.setAttribute(`role`,`link`),e.setAttribute(`tabindex`,`0`),e.classList.add(`diffo-ref`)}}var uc=(0,x.memo)(function({text:e,className:t,docPath:n,paths:r}){let i=(0,x.useRef)(null),a=n===void 0?sa(e):_a(e,n);return(0,x.useEffect)(()=>{let e=i.current;if(!e)return;let t=async()=>{await ac(e),r&&lc(e,r)};t();let n=new MutationObserver(()=>{t()});return n.observe(e,{childList:!0,subtree:!0}),()=>n.disconnect()},[a,r]),(0,S.jsx)(`div`,{ref:i,className:t,dangerouslySetInnerHTML:{__html:a}})});function dc({who:e,user:t}){return e===`github`?t?.avatarUrl?(0,S.jsx)(`img`,{className:`avatar avatar-github`,src:t.avatarUrl,alt:``,"aria-hidden":`true`}):(0,S.jsx)(`span`,{className:`avatar avatar-github`,"aria-hidden":`true`,children:(t?.login??`?`).slice(0,1).toUpperCase()}):(0,S.jsx)(`span`,{className:`avatar avatar-${e}`,"aria-hidden":`true`,children:(0,S.jsx)(H,{name:e===`you`?`user`:`sparkle`,size:`sm`})})}function fc({value:e,onChange:t}){return(0,S.jsxs)(`div`,{className:`aud-tabs`,role:`radiogroup`,"aria-label":`Who this comment is for`,children:[(0,S.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e===`pr`,className:`aud-tab aud-tab-pr${e===`pr`?` aud-tab-on`:``}`,title:`a review comment: drafted here, posted to GitHub when you submit (⌘. flips)`,onClick:()=>t(`pr`),children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` Comment on PR`]}),(0,S.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":e===`agent`,className:`aud-tab aud-tab-agent${e===`agent`?` aud-tab-on`:``}`,title:`a private question for your agent: never leaves this machine (⌘. flips)`,onClick:()=>t(`agent`),children:[(0,S.jsx)(H,{name:`lock`,size:`sm`}),` Ask agent`]})]})}var pc=[{icon:`bold`,label:`Bold`,wrap:[`**`,`**`]},{icon:`italic`,label:`Italic`,wrap:[`_`,`_`]},{icon:`code`,label:`Code`,wrap:["`","`"]},`sep`,{icon:`link`,label:`Link`,wrap:[`[`,`](url)`]},{icon:`list`,label:`Bulleted list`,prefix:`- `},{icon:`quote`,label:`Quote`,prefix:`> `},`sep`,{icon:`at`,label:`Reference a file`,wrap:["`","`"]}],mc=[{label:`Explain this`,text:`Explain what this does and why it’s needed.`,intent:`question`},{label:`Clean up the comments`,text:`Cut comments that narrate the code. Keep the ones that explain why.`,intent:`fix`},{label:`Simplify this`,text:`Simplify this. Same behavior, less code, no new abstractions.`,intent:`fix`}],hc=[{intent:`fix`,label:`Change`,title:`ask the agent to change the code`},{intent:`question`,label:`Question`,title:`ask for an answer; the agent won’t change code`},{intent:void 0,label:`Agent decides`,title:`no label — the agent reads what you want from your words`}];function gc(e,t,n){let{value:r,selectionStart:i,selectionEnd:a}=e,o=r.slice(i,a),s,c;if(t.prefix){let e=r.lastIndexOf(`
|
|
82
82
|
`,i-1)+1,n=r.indexOf(`
|
|
83
83
|
`,a),o=n===-1?r.length:n,l=r.slice(e,o).split(`
|
|
84
84
|
`).map(e=>`${t.prefix}${e}`).join(`
|
|
85
85
|
`);s=r.slice(0,e)+l+r.slice(o),c=[e,e+l.length]}else{let[e,n]=t.wrap;s=r.slice(0,i)+e+o+n+r.slice(a),c=o?[i+e.length,i+e.length+o.length]:[i+e.length,i+e.length]}n(s),requestAnimationFrame(()=>{e.focus(),e.setSelectionRange(c[0],c[1])})}function _c({title:e,placeholder:t,scope:n,onSubmit:r,onSend:i,onCancel:a,agentConnected:o=!1,autoFocus:s=!0,draft:c,onDraft:l,draftIntent:u,onDraftIntent:d,initialText:f,fixedAudience:p,citing:m}){let[h,g]=(0,x.useState)(f??``),[_,v]=(0,x.useState)(`write`),[y,b]=(0,x.useState)(!1),C=us(),[w,T]=(0,x.useState)(`pr`),E=C===null?void 0:p??w,D=E===`pr`,O=E!==void 0&&p===void 0,k=E===`agent`&&i!==void 0,[A,j]=(0,x.useState)(void 0),[M,ee]=(0,x.useState)(!1),N=l?c??``:h,P=l??g,F=d?u:A,te=d??j,ne=(0,x.useRef)(null),re=N.trim().length>0,I=e=>m?`> ${m.label}: ${m.text}\n\n${e}`:e,ie=()=>{re&&(E===void 0?r(I(N),y,F):k?i(I(N),y,void 0):r(I(N),y,void 0,E))},ae=()=>T(e=>e===`pr`?`agent`:`pr`),oe=()=>{ee(e=>!e),v(`write`)},se=(0,S.jsx)(S.Fragment,{children:n&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`scope-chip`,children:[(0,S.jsx)(H,{name:y?`cmp`:`unified`,size:`sm`}),y?`the whole changeset`:n.label,!y&&n.adjust&&(0,S.jsxs)(`span`,{className:`scope-chip-steppers`,children:[(0,S.jsx)(`button`,{type:`button`,className:`scope-chip-step`,disabled:!n.adjust.up,"data-tip":`walk the range's edge one line up; the line you started on stays put`,"aria-label":`range edge one line up`,onClick:n.adjust.up,children:(0,S.jsx)(H,{name:`up`,size:`sm`})}),(0,S.jsx)(`button`,{type:`button`,className:`scope-chip-step`,disabled:!n.adjust.down,"data-tip":`walk the range's edge one line down; the line you started on stays put`,"aria-label":`range edge one line down`,onClick:n.adjust.down,children:(0,S.jsx)(H,{name:`down`,size:`sm`})})]}),y&&n.canWiden&&(0,S.jsx)(`button`,{type:`button`,className:`scope-chip-x`,"data-tip":`Narrow the scope back`,"aria-label":`Narrow the scope back`,onClick:()=>b(!1),children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]}),!y&&n.canWiden&&(0,S.jsx)(`button`,{type:`button`,className:`cbox-widen`,onClick:()=>b(!0),children:`+ whole changeset`})]})}),ce=(0,S.jsx)(`button`,{type:`button`,className:`cbox-close`,"data-tip":`Close (Esc)`,"aria-label":`Close`,onClick:a,children:(0,S.jsx)(H,{name:`x`,size:`sm`})});return(0,S.jsxs)(`div`,{className:`cbox thread-composer${E?` cbox-${E}`:``}`,onClick:e=>e.stopPropagation(),children:[(0,S.jsx)(`div`,{className:`cbox-head${O?` cbox-head-aud`:``}`,children:O?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(fc,{value:E,onChange:T}),(0,S.jsxs)(`span`,{className:`cbox-head-right`,children:[se,ce]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`cbox-title`,children:p===`agent`?`Ask your agent`:n?`Comment on`:e}),se,ce]})}),m&&(0,S.jsxs)(`div`,{className:`cbox-cite`,children:[(0,S.jsx)(`span`,{className:`cbox-cite-label`,children:m.label}),(0,S.jsx)(`span`,{className:`cbox-cite-text`,children:m.text})]}),M&&(0,S.jsx)(`div`,{className:`cbox-tabs`,role:`tablist`,children:[`write`,`preview`].map(e=>(0,S.jsx)(`button`,{type:`button`,role:`tab`,className:`cbox-tab`,"aria-selected":_===e,onClick:()=>v(e),children:e===`write`?`Write`:`Preview`},e))}),M&&_===`write`&&(0,S.jsx)(`div`,{className:`cbox-mdbar`,children:pc.map((e,t)=>e===`sep`?(0,S.jsx)(`span`,{className:`cbox-mdsep`},t):(0,S.jsx)(`button`,{type:`button`,className:`cbox-mdb`,"data-tip":e.label,"aria-label":e.label,onClick:()=>ne.current&&gc(ne.current,e,P),children:(0,S.jsx)(H,{name:e.icon,size:`sm`})},t))}),(0,S.jsx)(`div`,{className:`cbox-body`,children:_===`write`?(0,S.jsx)(`textarea`,{ref:ne,autoFocus:s,className:`thread-input cbox-input`,placeholder:t,value:N,onChange:e=>P(e.target.value),onKeyDown:e=>{e.key===`Escape`?a():(e.metaKey||e.ctrlKey)&&e.key===`Enter`?(e.preventDefault(),ie()):(e.metaKey||e.ctrlKey)&&e.key===`.`&&O&&(e.preventDefault(),ae())}}):re?(0,S.jsx)(uc,{className:`cbox-preview markdown`,text:N}):(0,S.jsx)(`div`,{className:`cbox-preview cbox-preview-empty`,children:`Nothing to preview yet.`})}),!re&&!D&&(0,S.jsx)(`div`,{className:`cbox-openers`,children:mc.map(e=>(0,S.jsx)(`button`,{type:`button`,className:`cbox-opener`,title:e.text,onClick:()=>{P(e.text),te(e.intent),v(`write`),ne.current?.focus()},children:e.label},e.label))}),(0,S.jsxs)(`div`,{className:`cbox-foot`,children:[(0,S.jsx)(`button`,{type:`button`,className:`cbox-rich`,"aria-pressed":M,"data-tip":`Formatting and preview`,"aria-label":`Formatting and preview`,onClick:oe,children:`Aa`}),E===`pr`&&(0,S.jsx)(`span`,{className:`cbox-hint`,children:`Posts to GitHub when you submit the review`}),E===`agent`&&(0,S.jsx)(`span`,{className:`cbox-hint`,children:`Private, stays on this machine`}),E===void 0&&(0,S.jsx)(`span`,{className:`cbox-intent`,role:`radiogroup`,"aria-label":`What this comment wants`,children:hc.map(({intent:e,label:t,title:n})=>(0,S.jsx)(`button`,{type:`button`,role:`radio`,className:`cbox-intent-chip`,"aria-checked":F===e,title:n,onClick:()=>te(e),children:t},t))}),M&&(0,S.jsxs)(`span`,{className:`cbox-attach`,children:[(0,S.jsx)(H,{name:`attach`,size:`sm`}),` Markdown supported`]}),(0,S.jsxs)(`span`,{className:`cbox-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-ghost`,onClick:a,children:`Close`}),i&&!D&&!k&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-outline`,disabled:!re,onClick:()=>re&&i(I(N),y,F),title:o?`add the comment and send it to your agent`:`add the comment and copy its prompt for your agent`,children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Send to agent`]}),(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,disabled:!re,onClick:ie,title:D?`add this to your review; it posts to GitHub when you submit`:k?o?`send this to your agent; it never leaves this machine`:`add this and copy its prompt for your agent`:`leave this comment on the review`,children:[k&&(0,S.jsx)(H,{name:`send`,size:`sm`}),D?`Add to review`:k?`Send to agent`:`Add comment`,(0,S.jsx)(`span`,{className:`btn-kbd`,children:`⌘↵`})]})]})]})]})}var vc={fix:`Change`,question:`Question`},yc={open:`Draft`,sent:`Sent`,addressed:`Answered`,resolved:`Resolved`},bc={open:`mute`,sent:`mute`,addressed:`ok`,resolved:`mute`};function xc(e){let t=Math.max(0,e)/1e3;if(t<60)return`${t.toFixed(1)}s`;let n=Math.round(t);return`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function Sc(e){return e<=1?`next in line`:`#${e} in line`}function Cc({working:e,place:t,unanswered:n,followUp:r,since:i}){let a=n?`no answer, the agent moved on`:e?`with the agent${i?` · ${va(i)}`:``}`:r?`follow-up on the way${i?` · ${va(i)}`:``}`:`queued, ${Sc(t??1)}`;return(0,S.jsxs)(`div`,{className:`cmt thread-message thread-message-agent thread-message-pending${n?` thread-message-unanswered`:``}`,children:[(0,S.jsxs)(`div`,{className:`cmt-head`,children:[(0,S.jsx)(dc,{who:`agent`}),(0,S.jsx)(`span`,{className:`cmt-who cmt-who-agent`,children:`Agent`}),(0,S.jsx)(`span`,{className:`cmt-when`,children:a})]}),(0,S.jsx)(`div`,{className:`cmt-body pending-reply`,role:`status`,"aria-label":a,children:n?(0,S.jsx)(`span`,{className:`pending-none`,children:`Send it again, or resolve it if you've let it go.`}):(0,S.jsxs)(`span`,{className:`pending-dots`,children:[(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{}),(0,S.jsx)(`i`,{})]})})]})}function wc({code:e}){let[t,n]=(0,x.useState)(!1),r=e.split(`
|
|
86
86
|
`);return(0,S.jsxs)(`div`,{className:`thread-context-wrap`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`thread-context-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,S.jsx)(`span`,{className:`chevron${t?``:` chevron-shut`}`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),`the commented change`,(0,S.jsxs)(`span`,{className:`thread-context-n`,children:[r.length,` `,r.length===1?`line`:`lines`]})]}),t&&(0,S.jsx)(`pre`,{className:`thread-context`,children:r.map((e,t)=>(0,S.jsx)(`span`,{className:`ctx-line${e.startsWith(`+`)?` ctx-add`:e.startsWith(`-`)?` ctx-del`:``}`,children:e===``?`
|
|
87
|
-
`:e},`${t}-${e}`))})]})}function Tc(e,t){return e===`reviewer`||t===0?`commented`:`replied`}var Ec={APPROVED:`approved`,CHANGES_REQUESTED:`requested changes`,COMMENTED:`reviewed`,DISMISSED:`dismissed`};function Dc(e){let t=[...e.messages].reverse().find(e=>e.author===`agent`);if(t){let e=/```suggestion\n[\s\S]*?```/.exec(t.text);return e?e[0]:t.text}return[...e.messages].reverse().find(e=>e.author===`reviewer`)?.text??``}function Oc(e,t){(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),t())}function kc({text:e,links:t}){return t?(0,S.jsx)(`div`,{onClick:e=>{let n=Po(e.target);n&&(e.preventDefault(),t.onJump(n.path,n.line))},children:(0,S.jsx)(uc,{className:`cmt-body markdown`,text:J(e,t.paths),paths:t.paths})}):(0,S.jsx)(uc,{className:`cmt-body markdown`,text:e})}function Ac({message:e,live:t,editing:n,agentConnected:r,onEdit:i,onCancelEdit:a,onAdd:o,onDismiss:s,onRestore:c}){let l=e.prComment,u=l.outcome,[d,f]=(0,x.useState)(!1);if(u||!t){let e=u?u.kind:`superseded`,t=u?u.kind===`added`?u.edited?`added to your review, edited`:`added to your review`:`dismissed`:`superseded by the reply below`;return(0,S.jsxs)(`div`,{className:`psc psc-done psc-${e}`,"data-testid":`pr-suggestion-receipt`,children:[(0,S.jsxs)(`div`,{className:`psc-done-line`,children:[(0,S.jsx)(`button`,{type:`button`,className:`thread-shut chevron${d?``:` chevron-shut`}`,"aria-expanded":d,"aria-label":d?`hide the suggested comment`:`show the suggested comment`,"data-tip":d?`hide the suggested comment`:`show the suggested comment`,onClick:()=>f(!d),children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),(0,S.jsx)(H,{name:`globe`,size:`sm`}),(0,S.jsxs)(`span`,{className:`psc-done-text`,children:[`Suggested PR comment `,(0,S.jsxs)(`span`,{className:`psc-done-status`,children:[`· `,t]})]}),e===`dismissed`&&c&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`bring the suggestion back, with its buttons`,onClick:c,children:`Undo`})]}),d&&(0,S.jsx)(uc,{className:`psc-body markdown`,text:l.text})]})}return n?(0,S.jsx)(`div`,{className:`psc psc-editing`,children:(0,S.jsx)(_c,{title:`Suggested PR comment`,placeholder:`The review comment as GitHub will show it…`,fixedAudience:`pr`,initialText:l.text,agentConnected:r,onSubmit:e=>void o(e),onCancel:a})}):(0,S.jsxs)(`div`,{className:`psc`,"data-testid":`pr-suggestion`,children:[(0,S.jsxs)(`div`,{className:`psc-head`,children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),(0,S.jsx)(`span`,{children:`Suggested PR comment`}),(0,S.jsx)(`span`,{className:`psc-head-note`,children:`for the author, in your words`})]}),(0,S.jsx)(uc,{className:`psc-body markdown`,text:l.text}),(0,S.jsxs)(`div`,{className:`psc-foot`,children:[(0,S.jsx)(`span`,{className:`psc-hint`,children:`Draft · posts when you submit the review`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm psc-add`,title:`a draft PR comment on these lines, in your review; it posts when you submit`,onClick:()=>void o(l.text),children:`Add as PR comment draft`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-sm`,title:`rewrite it before it joins the review`,onClick:i,children:`Edit`}),s&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm`,"aria-label":`dismiss this suggested comment`,title:`pass on it; the thread stays open`,onClick:s,children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]})]})}function jc({thread:e,actions:t,showContext:n=!1,agentConnected:r=!1,working:i=!1,queuePosition:a,gone:o=!1,links:s,asides:c}){let l=us(),u=at(e),d=e.github,f=u&&e.state===`open`&&d===void 0,p=d!==void 0&&e.id.startsWith(`gh:`),[m,h]=(0,x.useState)(null),[g,_]=(0,x.useState)(!1),[v,y]=(0,x.useState)(``),[b,C]=(0,x.useState)(!1),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(!1),[O,k]=(0,x.useState)(!1),[A,j]=(0,x.useState)(!1),[M,ee]=(0,x.useState)(!1),[N,P]=(0,x.useState)(null),[F,te]=(0,x.useState)(null),ne=(0,x.useRef)(null),re=(0,x.useRef)(null),I=(0,x.useRef)(void 0);(0,x.useEffect)(()=>()=>clearTimeout(I.current),[]);let ie=(n=!0)=>{v.trim()&&(D(!1),t.reply(e.id,v,n).then(()=>y(``)).catch(()=>D(!0)))},ae=N?e.messages.findIndex(e=>e.id===N.id):-1,oe=ae===-1?0:e.messages.length-1-ae,se=ae!==-1&<(e,ae),ce=se&&r&&(e.state===`sent`||e.state===`addressed`),le=n=>t.edit!==void 0&&n.author===`reviewer`&&e.state!==`resolved`&&n.github===void 0,ue=e=>{te(null),P({id:e.id,draft:e.text})},de=()=>{P(null),te(null)},fe=(n=!0)=>{if(!N||ae===-1)return;let r=N.draft.trim();if(r){if(r===e.messages[ae].text.trim())return de();te(null),t.edit(e.id,N.id,r,n).then(de).catch(e=>te(e instanceof Error&&e.message?e.message:`couldn't reach the diffo server — your text is still here; try again`))}},L=()=>(D(!1),T(null),t.send(e.id).then(({delivered:e,copied:t,prompt:n})=>{if(!e){if(!t){T(n??null);return}C(!0),clearTimeout(I.current),I.current=setTimeout(()=>C(!1),2500)}}).catch(()=>D(!0))),R=it(e),z=(n,r)=>(D(!1),t.create(e.anchor,r,void 0,{audience:`pr`,origin:{threadId:e.id,messageId:n}}).then(()=>_(!1)).catch(()=>D(!0))),pe=n=>{t.dismissPrComment&&(D(!1),t.dismissPrComment(e.id,n).catch(()=>D(!0)))},me=n=>{t.restorePrComment&&(D(!1),t.restorePrComment(e.id,n).catch(()=>D(!0)))},he=e.messages[e.messages.length-1]?.author,ge=e.withheld===!0,_e=fs(e),ve=!u&&!ge&&he===`reviewer`&&(e.state===`sent`||e.state===`addressed`),ye=e.state===`sent`&&ve&&!r,be=u&&d?e.messages.filter(e=>e.author===`reviewer`&&e.github===void 0).length:0,xe=ut(e)&&e.state===`open`,Se=!u&&r&&(e.state===`sent`||e.state===`addressed`||xe),Ce=O||v.trim()!==``,we=e.state!==`resolved`&&Ce,Te=e.state!==`resolved`&&!Ce,Ee=e.messages[e.messages.length-1],De=e.state!==`resolved`&&Ee?.author===`agent`?Ee.suggestedReply??null:null,Oe=De!==null&&v===``,B=()=>{De!==null&&(y(De),k(!0),requestAnimationFrame(()=>{let e=re.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))}))},ke=e=>Oe&&(e.key===`Tab`||e.key===`ArrowRight`)&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey,Ae=u?f?`Draft`:e.state===`resolved`?`Resolved`:`On GitHub`:xe?`From the agent`:ge?ms.note:e.state===`addressed`&&e.intent===`fix`?`Addressed`:yc[e.state],je=u?f?`attn`:e.state===`resolved`?`mute`:`pr`:xe||ge?`attn`:bc[e.state],Me=(0,S.jsxs)(S.Fragment,{children:[e.queued?.resolve&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`resolves when you submit`}),e.queued?.unresolve&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`reopens when you submit`})]}),Ne=(0,S.jsxs)(`span`,{className:`thread-marks`,children:[e.intent&&!ct(e)&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-kind thread-kind-${e.intent}`,children:vc[e.intent]}),e.closingNote&&(0,S.jsx)(`span`,{className:`thread-badge`,children:`closing note`}),R!==null&&(0,S.jsxs)(`span`,{className:`thread-badge thread-badge-pr`,title:`your agent drafted a review comment for the author; it is under its reply`,children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` suggests a PR comment`]}),d?.reviewState&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-${d.reviewState.toLowerCase()}`,children:Ec[d.reviewState]}),d?.outdated&&(0,S.jsx)(`span`,{className:`thread-badge`,title:`the commented line is no longer in the diff`,children:`outdated`}),f&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`posts when you submit`}),be>0&&(0,S.jsxs)(`span`,{className:`thread-badge thread-badge-pr`,children:[be===1?`reply posts`:`${be} replies post`,` when you submit`]}),Me,d?.url&&(0,S.jsxs)(`a`,{className:`thread-badge thread-badge-link`,href:d.url,target:`_blank`,rel:`noreferrer`,title:`open on GitHub`,children:[(0,S.jsx)(H,{name:`link`,size:`sm`}),` GitHub`]}),e.codeChanged&&(0,S.jsxs)(`span`,{className:`thread-badge`,children:[(0,S.jsx)(H,{name:`alert`,size:`sm`}),` code changed since this comment`]}),b&&(0,S.jsx)(`span`,{className:`thread-badge`,children:`prompt copied, paste it to your agent`}),!(xe&&ct(e))&&(0,S.jsx)(`span`,{className:`chip chip-${je}`,children:Ae})]}),Pe=e.awaitingFollowUp===!0,Fe=!u&&(i||a!==void 0||e.unanswered||Pe)?(0,S.jsx)(Cc,{working:i,place:a,followUp:Pe,unanswered:e.unanswered===!0&&a===void 0&&!i,since:e.updatedAt}):null,Ie=(i||Pe)&&e.deliveredThrough?Date.parse(e.deliveredThrough):null,Le=Ie===null?-1:e.messages.findIndex(e=>e.author===`reviewer`&&Date.parse(e.at)>Ie),Re=Le===-1?e.messages.length:Le,ze=oe>0?null:Fe,Be=e.state===`resolved`?(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void t.reopen(e.id),children:`Reopen`}):f&&t.remove?(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`drop this draft; nothing was posted`,onClick:()=>void t.remove(e.id),children:`Discard draft`}):(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:d?`resolve on GitHub when you submit; until then it is only marked here`:void 0,onClick:()=>void t.resolve(e.id),children:`Resolve`}),Ve=l&&!u&&R===null&&e.messages.length>0&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm thread-promote`,title:`turn this into a review comment for GitHub; you edit it before it joins the review`,onClick:()=>h(Dc(e)),children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` Post as PR comment`]}),He=m!==null&&(0,S.jsx)(`div`,{className:`thread-aside-compose`,children:(0,S.jsx)(_c,{title:`Comment on PR`,placeholder:`The review comment as GitHub will show it…`,fixedAudience:`pr`,initialText:m,agentConnected:r,onSubmit:n=>{t.create(e.anchor,n,void 0,{audience:`pr`}),h(null)},onCancel:()=>h(null)})}),Ue=ye&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:L,children:[(0,S.jsx)(H,{name:`copy`,size:`sm`}),` Copy prompt`]}),We=_e&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-sm ${we&&v.trim()!==``?`btn-outline`:`btn-primary`}`,onClick:L,title:r?`send this thread to your agent`:`mark sent and copy the prompt`,children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Send`]}),Ge=e.state===`resolved`&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`reopen this thread`,onClick:()=>void t.reopen(e.id),children:`Reopen`}),Ke=t.remove&&!p&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm btn-ghost-danger`,"aria-label":`delete this thread`,"data-tip":`delete this thread`,onClick:()=>void t.remove(e.id),children:(0,S.jsx)(H,{name:`trash`,size:`sm`})});if(e.state===`resolved`&&!A){let t=e.messages[0];return(0,S.jsxs)(`div`,{className:`thread thread-resolved thread-collapsed`,"data-thread-id":e.id,ref:ne,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`button`,{type:`button`,className:`thread-collapsed-summary`,onClick:()=>j(!0),title:`expand this resolved thread`,children:[(0,S.jsx)(`span`,{className:`chip chip-mute`,children:`Resolved`}),Me,(0,S.jsx)(`span`,{className:`thread-collapsed-text`,children:ys(t?.text??``)}),(0,S.jsx)(`span`,{className:`thread-collapsed-count`,children:e.messages.length>1?`${e.messages.length} messages`:``}),(0,S.jsx)(`span`,{className:`thread-collapsed-hint chevron chevron-shut`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})})]}),Ge,Ke]})}return(0,S.jsxs)(`div`,{className:`thread conv thread-${e.state}${u?` thread-public`:l?` thread-private`:``}${e.parentId?` thread-aside`:``}`,"data-thread-id":e.id,ref:ne,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`thread-head`,children:[(0,S.jsx)(`button`,{type:`button`,className:`thread-shut chevron${M?` chevron-shut`:``}`,"aria-expanded":!M,"data-tip":M?`expand this thread`:`collapse this thread`,"aria-label":M?`expand this thread`:`collapse this thread`,onClick:()=>ee(!M),children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),l&&(0,S.jsxs)(`span`,{className:`thread-side thread-side-${u?`pr`:`agent`}`,title:u?`a review comment: on GitHub, or headed there when you submit`:`private: between you and your agent, never leaves this machine`,children:[(0,S.jsx)(H,{name:u?`globe`:`lock`,size:`sm`}),u?`PR comment`:`Private`]}),(0,S.jsx)(`span`,{className:`thread-where${o?` thread-where-gone`:``}`,title:o?d?.outdated?`outdated on GitHub: the line left the diff`:`this file is no longer in the changeset`:void 0,children:Mc(e,o)}),M&&e.messages.length>1&&(0,S.jsxs)(`span`,{className:`thread-where-n`,children:[e.messages.length,` messages`]}),Ne,M&&Ge]}),M?(0,S.jsx)(`button`,{type:`button`,className:`thread-shut-peek`,onClick:()=>ee(!1),children:ys(e.messages[0]?.text??``)}):(0,S.jsxs)(S.Fragment,{children:[n&&e.codeContext&&(0,S.jsx)(wc,{code:e.codeContext}),ye&&(0,S.jsx)(`div`,{className:`thread-hint`,children:`waiting on your agent: paste the copied prompt into it; replies land here live`}),ge&&(0,S.jsx)(`div`,{className:`thread-hint`,children:o?`your reply is held here: Send hands it over; Finish review will not, since this file has left the changeset`:`your reply is held here: Send hands it over now, or Finish review takes it with the batch`}),(0,S.jsxs)(`div`,{className:`thread-messages`,children:[e.messages.map((n,a)=>(0,S.jsxs)(x.Fragment,{children:[a===Re&&ze,(0,S.jsxs)(`div`,{className:`cmt thread-message thread-message-${n.author}${a===ae?` thread-message-editing`:``}${ae!==-1&&a>ae?` thread-message-cut`:``}`,children:[(0,S.jsxs)(`div`,{className:`cmt-head`,children:[(0,S.jsx)(dc,{who:n.author===`reviewer`?`you`:n.author===`agent`?`agent`:`github`,user:n.github?.user}),(0,S.jsx)(`span`,{className:`cmt-who cmt-who-${n.author}`,children:n.author===`reviewer`?`You`:n.author===`agent`?`Agent`:n.github?.user.login??`GitHub`}),(0,S.jsxs)(`span`,{className:`cmt-when`,children:[n.author===`agent`&&n.durationMs!==void 0?`answered in ${xc(n.durationMs)}`:`${Tc(n.author,a)} ${va(n.at)}`,n.editedAt&&` · edited`,n.author===`github`&&` · on GitHub`,n.author===`reviewer`&&u&&n.github&&` · on GitHub`,n.author===`reviewer`&&u&&!n.github&&(f?` · draft`:` · posts when you submit`),a===0&&u&&e.origin&&(0,S.jsx)(`span`,{className:`cmt-origin`,title:`your agent wrote the first version of this comment; it posts as yours`,children:e.origin.edited?` · from your agent, edited`:` · from your agent`})]}),le(n)&&N?.id!==n.id&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm cmt-edit`,"aria-label":`edit this message`,"aria-disabled":i||void 0,"data-tip":i?`the agent is answering — edit after it replies`:`edit this message`,onClick:()=>{i||ue(n)},children:(0,S.jsx)(H,{name:`edit`,size:`sm`})})]}),N?.id===n.id?(0,S.jsxs)(`div`,{className:`cmt-edit-box`,children:[(0,S.jsx)(`textarea`,{autoFocus:!0,className:`cmt-edit-input`,"aria-label":`edit your message`,value:N.draft,onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onChange:e=>P({id:n.id,draft:e.target.value}),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),de()):Oc(e,()=>fe(!0))}}),F&&(0,S.jsx)(`div`,{className:`cmt-edit-error`,role:`alert`,children:F}),(0,S.jsxs)(`div`,{className:`cmt-edit-foot`,children:[(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:de,children:`Cancel`}),ce&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>fe(!1),title:o?`save it without handing it over — Send takes it; the finish batch will not`:`save it without handing it over — Send or Finish takes it`,children:`Save`}),(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>fe(!0),title:ce?`save the edit and hand the thread back to your agent — its withdrawn replies are named, and code it changed for them stays until it says otherwise`:se?`save the edit — the thread waits for the agent, which is told its earlier replies were withdrawn`:`save the edit`,children:[ce?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Save & resend`]}):`Save`,(0,S.jsx)(`span`,{className:`btn-kbd`,children:`⌘↵`})]})]})]}):(0,S.jsx)(kc,{text:n.text,links:s}),n.author===`agent`&&n.prComment&&(0,S.jsx)(Ac,{message:n,live:R?.id===n.id,editing:g&&R?.id===n.id,agentConnected:r,onEdit:()=>_(!0),onCancelEdit:()=>_(!1),onAdd:e=>z(n.id,e),onDismiss:t.dismissPrComment?()=>pe(n.id):void 0,onRestore:t.restorePrComment?()=>me(n.id):void 0})]}),a===ae&&oe>0&&(0,S.jsx)(`div`,{className:`cmt-cut`,role:`note`,children:(0,S.jsxs)(`span`,{children:[`Saving removes the ${oe===1?`message`:`${oe} messages`} below`,se&&` · the agent answers again`]})})]},n.id)),Re>=e.messages.length&&ze]}),c&&(0,S.jsx)(`div`,{className:`thread-asides`,children:c}),He,E&&(0,S.jsx)(`div`,{className:`thread-hint thread-hint-error`,children:`couldn't reach the diffo server; your text is still here, try again`}),w&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`thread-hint thread-hint-error`,children:`couldn't reach the clipboard; this browser blocked it. The thread is marked sent; select the prompt below and copy it by hand.`}),(0,S.jsx)(`pre`,{className:`invite-prompt`,children:w})]})]}),!M&&ae===-1&&(0,S.jsxs)(`div`,{className:`thread-foot${Te||we?``:` thread-foot-bare`}`,children:[Te&&De!==null&&(0,S.jsxs)(`div`,{className:`thread-offer replybar`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`thread-reply-stub thread-reply-stub-offer`,onClick:()=>k(!0),title:`the agent suggests this reply — click to write your own, Tab in the box takes this one`,children:[(0,S.jsx)(H,{name:`sparkle`,size:`sm`,className:`thread-offer-icon`}),(0,S.jsx)(`span`,{className:`thread-offer-text`,children:De})]}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-outline btn-sm thread-offer-use`,onClick:B,title:`take the suggested reply into the box, ready to edit or send`,children:`Use`})]}),Te&&De===null&&(0,S.jsx)(`button`,{type:`button`,className:`thread-reply-stub replybar`,onClick:()=>k(!0),children:u?`Reply on GitHub…`:`Reply…`}),we&&(0,S.jsxs)(`div`,{className:`thread-input-wrap${Oe?` thread-input-wrap-ghost`:``}`,children:[Oe&&(0,S.jsx)(H,{name:`sparkle`,size:`sm`,className:`thread-offer-icon thread-ghost-icon`}),(0,S.jsx)(`textarea`,{autoFocus:!0,ref:re,rows:1,className:`thread-input${Oe?` thread-input-ghost`:``}`,placeholder:Oe?De:u?`reply on GitHub, posts when you submit…`:`reply…`,"aria-description":Oe?`the agent offered this reply; press Tab to take it`:void 0,value:v,onChange:e=>y(e.target.value),onBlur:()=>{v.trim()||k(!1)},onKeyDown:e=>{ke(e)?(e.preventDefault(),y(De)):e.key===`Escape`&&!v.trim()?k(!1):Oc(e,()=>ie(!0))}}),Oe&&(0,S.jsx)(`button`,{type:`button`,className:`thread-offer-kbd thread-ghost-hint`,onMouseDown:e=>e.preventDefault(),onClick:B,title:`take the suggested reply (Tab)`,children:`Tab`})]}),!Te&&!we&&(0,S.jsx)(`span`,{className:`thread-spacer`}),we&&v.trim()!==``&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>ie(!0),title:Se?`reply and hand it to your agent in one go`:u?`reply on GitHub; it posts when you submit the review`:`write it into the thread`,children:[Se?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Reply & send`]}):`Reply`,(0,S.jsx)(`span`,{className:`btn-kbd`,children:`⌘↵`})]}),we&&v.trim()!==``&&Se&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>ie(!1),title:o?`write it into the thread without handing it over: Send takes it; the finish batch will not`:`write it into the thread without handing it over: Send or Finish takes it`,children:`Reply`}),We,Ue,Ve,Be,e.state===`resolved`&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>j(!1),children:`Collapse`}),Ke]})]})}function Mc(e,t=!1){let n=e.anchor,r=e.github;if(r?.kind===`description`)return`Pull request description`;if(r?.kind===`review`)return`Review on the pull request`;if(r?.kind===`comment`||at(e)&&n.kind===`changeset`)return`Comment on the pull request`;let i=ct(e)?`Agent comment`:e.messages[0]?.author===`github`?`${e.messages[0].github?.user.login??`GitHub`}'s comment`:at(e)?`Review comment`:`Comment`;return n.kind===`changeset`?ct(e)?`${i} on the changeset`:`Note on the changeset`:n.kind===`layer`?t?`Layer “${n.title}”`:`${i} on this layer`:t?n.kind===`hunk`?`${n.path}:${mt(n)}`:n.path:n.kind===`hunk`?`${i} on ${n.endLine===void 0?`line`:`lines`} ${mt(n)}`:`${i} on this file`}function Nc({threads:e,actions:t,showContext:n=!1,agentConnected:r=!1,workingOn:i,queuedOn:a,gone:o=!1,links:s}){if(e.length===0)return null;let c=new Set(e.map(e=>e.id)),l=new Map;for(let t of e)if(t.parentId&&c.has(t.parentId)){let e=l.get(t.parentId);e?e.push(t):l.set(t.parentId,[t])}let u=(e,c)=>(0,S.jsx)(jc,{thread:e,actions:t,showContext:n,agentConnected:r,working:i?.has(e.id)??!1,queuePosition:a?.get(e.id),gone:o,links:s,asides:c},e.id);return(0,S.jsx)(`div`,{className:`thread-list`,children:e.filter(e=>!(e.parentId&&c.has(e.parentId))).map(e=>{let t=l.get(e.id);return u(e,t?.map(e=>u(e)))})})}function Pc({stillTo:e,back:t,onOpen:n,onClose:r}){let i=e.filter(e=>e.working===!0).length,a=e.length-i,o=e.length===0&&t.length>0;(0,x.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.stopPropagation(),r())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[r]);let s=[t.length>0?`${t.length} answered`:null,i>0?`${i} in progress`:null,a>0?`${a} waiting`:null].filter(Boolean);return(0,S.jsx)(`div`,{className:`monitor`,role:`dialog`,"aria-label":`Comments with your agent`,children:(0,S.jsxs)(`div`,{className:`monitor-inner`,children:[(0,S.jsx)(Fc,{stillTo:e,back:t}),s.length>0&&(0,S.jsx)(`div`,{className:`monitor-counts${o?` monitor-counts-done`:``}`,children:o?`all ${t.length} answered`:s.join(` · `)}),e.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`monitor-group`,children:[`Still to answer · `,e.length]}),(0,S.jsx)(`ul`,{className:`monitor-rows`,children:e.map(e=>(0,S.jsx)(Lc,{item:e,onOpen:n},e.thread.id))})]}),t.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`monitor-group`,children:[`Answered · `,t.length]}),(0,S.jsx)(`ul`,{className:`monitor-rows monitor-rows-done`,children:t.map(e=>(0,S.jsx)(Lc,{item:e,onOpen:n},e.thread.id))})]})]})})}function Fc({stillTo:e,back:t}){return(0,S.jsxs)(`div`,{className:`monitor-qbar`,"aria-hidden":!0,children:[t.map(e=>(0,S.jsx)(`i`,{className:`q-done`},e.thread.id)),e.map(e=>(0,S.jsx)(`i`,{className:e.working?`q-now`:`q-wait`},e.thread.id))]})}function Ic(e){if(e.working)return{label:`working on it`,kind:`now`};if(e.queued!==void 0)return{label:Sc(e.queued),kind:`wait`};if(e.turn===`agent`)return{label:`sent`,kind:`wait`};if(e.turn===`resolved`)return{label:`settled`,kind:`done`};switch(e.outcome){case`fixed`:return{label:`fixed`,kind:`done`};case`answered`:return{label:`answered`,kind:`done`};case`changed`:return{label:`changed, no reply`,kind:`silent`};case`no-answer`:return{label:`no answer`,kind:`silent`};default:return{label:`back`,kind:`done`}}}function Lc({item:e,onOpen:t}){let[n,r]=(0,x.useState)(()=>Date.now());(0,x.useEffect)(()=>{if(e.working!==!0)return;let t=setInterval(()=>r(Date.now()),1e4);return()=>clearInterval(t)},[e.working]);let{label:i,kind:a}=Ic(e),o=e.working===!0?Math.max(0,n-Date.parse(e.updatedAt)):void 0;return(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:`monitor-row`,onClick:()=>t(e),children:[(0,S.jsxs)(`span`,{className:`monitor-row-top`,children:[(0,S.jsxs)(`span`,{className:`monitor-st monitor-st-${a}`,children:[e.working===!0&&(0,S.jsx)(`span`,{className:`monitor-pulse`}),i]}),o!==void 0&&(0,S.jsxs)(`span`,{className:`monitor-took`,children:[xc(o),`…`]}),e.durationMs!==void 0&&!e.working&&(0,S.jsx)(`span`,{className:`monitor-took`,children:xc(e.durationMs)})]}),(0,S.jsxs)(`span`,{className:`monitor-q`,children:[(0,S.jsx)(`span`,{className:`monitor-anchor`,children:e.anchor??`the whole changeset`}),e.question]}),e.answer!==null&&(0,S.jsxs)(`span`,{className:`monitor-a`,children:[`↳ `,e.answer]})]})})}function Rc({status:e,onSetEnabled:t,onClose:n}){let[r,i]=(0,x.useState)(!1),a=e.source===`env`;return(0,S.jsxs)(jt,{title:`Privacy`,onClose:n,footer:r?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{t(!1),i(!1)},children:`Turn off`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>i(!1),children:`Keep sharing`})]}):void 0,children:[(0,S.jsxs)(`div`,{className:`privacy-row`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`pane-sw${e.enabled?` pane-sw-on`:``}`,role:`switch`,"aria-checked":e.enabled,disabled:a,onClick:()=>e.enabled?i(!0):t(!0),children:[(0,S.jsx)(`span`,{className:`pane-track`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{})}),`Share anonymous usage data`]}),(0,S.jsx)(`span`,{className:`privacy-state`,children:a?`Off: ${e.variable} is set in your environment`:e.enabled?`On`:`Off`})]}),(0,S.jsxs)(`p`,{className:`cov-note`,children:[`Two small events per review, opened and finished: the version, your OS, the kind of review, which agent, and counts. Never code, paths, or comment text. One random id per machine tells returning machines from new ones; turning this off deletes it.`,` `,(0,S.jsx)(`a`,{href:e.docs,target:`_blank`,rel:`noreferrer`,children:`What is sent`})]}),r&&(0,S.jsxs)(`p`,{className:`cov-note privacy-confirm`,children:[(0,S.jsx)(`strong`,{children:`Stop sharing?`}),` Diffo will send nothing more from this machine and delete its random id. You can turn it back on here any time.`]})]})}var zc=[/(^|\/)pnpm-lock\.yaml$/,/(^|\/)package-lock\.json$/,/(^|\/)npm-shrinkwrap\.json$/,/(^|\/)yarn\.lock$/,/(^|\/)bun\.lockb?$/,/(^|\/)Cargo\.lock$/,/(^|\/)Gemfile\.lock$/,/(^|\/)composer\.lock$/,/(^|\/)go\.sum$/,/(^|\/)poetry\.lock$/,/(^|\/)uv\.lock$/,/\.min\.(js|css)$/,/\.(js|css)\.map$/,/\.snap$/];function Bc(e){let t=0;for(let n of e.hunks)for(let e of n.lines)e.kind!==`context`&&t++;return t}function Vc(e){return e.hunks.length===0?null:zc.some(t=>t.test(e.path))?`generated`:Bc(e)>400?`large`:null}var Hc={fromTop:0,fromBottom:0};function Uc(e){return e.lines.filter(e=>e.kind!==`del`).length}function Wc(e){return e.lines.filter(e=>e.kind!==`add`).length}function Gc(e){return Uc(e)===0?e.newStart+1:e.newStart}function Kc(e){return Wc(e)===0?e.oldStart+1:e.oldStart}function qc(e){return Gc(e)}function Jc(e){return Gc(e)+Uc(e)-1}function Yc(e){return Gc(e)-Kc(e)}function Xc(e){return Gc(e)+Uc(e)-(Kc(e)+Wc(e))}function Zc(e){let t=e.hunks;if(t.length===0)return[];let n=[],r=t[0];qc(r)>1&&n.push({key:`top:${r.id}`,above:null,below:0,startNewNo:1,endNewNo:qc(r)-1,offset:Yc(r)});for(let e=1;e<t.length;e++){let r=t[e-1],i=t[e],a=Jc(r)+1,o=qc(i)-1;o>=a&&n.push({key:`${r.id}:${i.id}`,above:e-1,below:e,startNewNo:a,endNewNo:o,offset:Yc(i)})}let i=t[t.length-1],a=e.newLineCount;return typeof a==`number`&&a>Jc(i)&&n.push({key:`${i.id}:tail`,above:t.length-1,below:null,startNewNo:Jc(i)+1,endNewNo:a,offset:Xc(i)}),n}function Qc(e){return e.endNewNo-e.startNewNo+1}function $c(e,t){return Math.max(0,Qc(e)-t.fromTop-t.fromBottom)}function el(e,t,n,r){let i=[],a=Math.max(t.startNewNo,n),o=Math.min(t.endNewNo,r,e.length);for(let n=a;n<=o;n++){let r=e[n-1];if(r===void 0)break;i.push({kind:`context`,oldNo:n-t.offset,newNo:n,text:r})}return i}function tl(e,t,n){if($c(t,n)===0){let n=el(e,t,t.startNewNo,t.endNewNo);return t.below===null?{top:n,bottom:[],merged:!0}:{top:[],bottom:n,merged:!0}}return{top:n.fromTop>0?el(e,t,t.startNewNo,t.startNewNo+n.fromTop-1):[],bottom:n.fromBottom>0?el(e,t,t.endNewNo-n.fromBottom+1,t.endNewNo):[],merged:!1}}var nl={freshHunkIds:new Set,changedViewedHunkIds:new Set};function rl(e,t,n){if(!e)return nl;let r=new Set,i=new Map;for(let t of e.files){let e=new Set;for(let n of t.hunks)e.add(n.id),r.add(n.id);i.set(t.path,e)}let a=new Set,o=new Set;for(let e of t.files){let t=new Set(e.hunks.map(e=>e.id)),s=[...i.get(e.path)??new Set].some(e=>n.has(e)&&!t.has(e));for(let t of e.hunks)r.has(t.id)||(a.add(t.id),s&&o.add(t.id))}return{freshHunkIds:a,changedViewedHunkIds:o}}function il({decisions:e,open:t,onOpen:n,onJump:r,onComment:i}){return e.length===0?null:(0,S.jsxs)(`section`,{className:`ch-dec`,"aria-label":`Decisions`,children:[(0,S.jsx)(`div`,{className:`ch-dec-h`,children:`Decisions`}),e.map((e,a)=>(0,S.jsx)(ol,{resolved:e,open:t===a,onToggle:()=>n(t===a?null:a),onJump:r,onComment:i?()=>i(a):void 0},a))]})}function al(e){return e.line===void 0?e.path:`${e.path}:${e.line}${e.endLine===void 0?``:`–${e.endLine}`}`}function ol({resolved:e,open:t,onToggle:n,onJump:r,onComment:i}){let{decision:a,places:o}=e,s=o.filter(e=>e.file);return(0,S.jsxs)(`div`,{className:`ch-dec-item${t?` ch-dec-item-open`:``}`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`ch-dec-main`,"aria-expanded":t,onClick:n,children:[(0,S.jsx)(`span`,{className:`chevron ch-dec-chev${t?``:` chevron-shut`}`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),(0,S.jsx)(`span`,{className:`ch-dec-text`,children:a.text})]}),t&&(0,S.jsxs)(`div`,{className:`ch-dec-card`,children:[a.detail&&(0,S.jsx)(uc,{text:a.detail,className:`ch-dec-detail markdown`}),(0,S.jsxs)(`div`,{className:`ch-dec-acts`,children:[s.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`ch-dec-place`,title:al(e.at),onClick:()=>r(e.at.path,e.at.line??null),children:[(0,S.jsx)(`span`,{className:`ch-dec-place-path`,children:e.at.path}),e.at.line!==void 0&&(0,S.jsxs)(`span`,{className:`ch-dec-place-lines`,children:[e.at.line,e.at.endLine!==void 0&&`–${e.at.endLine}`]})]},al(e.at))),s.length===0&&o.length>0&&(0,S.jsxs)(`span`,{className:`ch-dec-gone`,children:[o.length===1?`its file is`:`its files are`,` not in the changeset now`]}),i&&(0,S.jsx)(`button`,{type:`button`,className:`ch-dec-comment`,onClick:i,children:`Comment`})]})]})]})}var sl={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,css:`css`,scss:`scss`,html:`html`,md:`markdown`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,hpp:`cpp`,cs:`csharp`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sql:`sql`,vue:`vue`,svelte:`svelte`,php:`php`,xml:`xml`,dockerfile:`docker`},cl={c:()=>X(()=>import(`./c-DWGmR78Y.js`),__vite__mapDeps([19,20])),cpp:()=>X(()=>import(`./cpp-CJIxL8VH.js`),__vite__mapDeps([21,22,20])),csharp:()=>X(()=>import(`./csharp-oqKa8noW.js`),[]),css:()=>X(()=>import(`./css-CdtkT07m.js`),__vite__mapDeps([23,24])),docker:()=>X(()=>import(`./docker-IyjqRm3v.js`),[]),go:()=>X(()=>import(`./go-rLFTqkRN.js`),[]),html:()=>X(()=>import(`./html-DDNsd9lV.js`),__vite__mapDeps([25,26,24,27])),java:()=>X(()=>import(`./java-DxlWrXwe.js`),__vite__mapDeps([28,29])),javascript:()=>X(()=>import(`./javascript-Yelw-5ZN.js`),__vite__mapDeps([30,27])),json:()=>X(()=>import(`./json-CaljABEy.js`),__vite__mapDeps([31,32])),jsx:()=>X(()=>import(`./jsx-hEbJ82HF.js`),__vite__mapDeps([33,34])),kotlin:()=>X(()=>import(`./kotlin-DhhofPvG.js`),[]),markdown:()=>X(()=>import(`./markdown-BYOwaDjH.js`),[]),php:()=>X(()=>import(`./php-CQT4wx5i.js`),__vite__mapDeps([35,24,27,26,32,36,29,37])),python:()=>X(()=>import(`./python-gzcpVVnB.js`),[]),ruby:()=>X(()=>import(`./ruby-D_UtGFHI.js`),__vite__mapDeps([38,20,22,24,27,26,34,36,29,37,39,40,41,42])),rust:()=>X(()=>import(`./rust-Cfkwpbl8.js`),[]),scss:()=>X(()=>import(`./scss-DHtrkMkT.js`),__vite__mapDeps([43,24])),shellscript:()=>X(()=>import(`./shellscript-BiGZg9Om.js`),__vite__mapDeps([44,41])),sql:()=>X(()=>import(`./sql-0Qcw9ht3.js`),__vite__mapDeps([45,37])),svelte:()=>X(()=>import(`./svelte-BUVJxsYv.js`),__vite__mapDeps([46,24,27,39])),swift:()=>X(()=>import(`./swift-CyEgAFGc.js`),[]),toml:()=>X(()=>import(`./toml-CcmNWLt0.js`),[]),tsx:()=>X(()=>import(`./tsx-5f3ulCja.js`),__vite__mapDeps([47,40])),typescript:()=>X(()=>import(`./typescript-Utq2Cl8c.js`),__vite__mapDeps([48,39])),vue:()=>X(()=>import(`./vue-CSBlZ1UP.js`),__vite__mapDeps([49,24,27,26,32,39])),xml:()=>X(()=>import(`./xml-CoDIzWF0.js`),__vite__mapDeps([50,36,29])),yaml:()=>X(()=>import(`./yaml-CxbubiML.js`),__vite__mapDeps([51,42]))};function ll(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:sl[t.slice(t.lastIndexOf(`.`)+1)]??null}var ul=null;async function dl(){return ul||=(async()=>{let[{createHighlighterCore:e},{createOnigurumaEngine:t}]=await Promise.all([X(()=>import(`./core-CmtFUBrQ.js`),[]),X(()=>import(`./engine-oniguruma-BjMH3wEI.js`),[])]);return e({themes:[X(()=>import(`./github-light-EUqPIrTm.js`),[]),X(()=>import(`./github-dark-C-LZuMrd.js`),[])],langs:[],engine:t(X(()=>import(`./wasm-BnjxR4X6.js`),[]))})})(),ul}var fl=new Map;function pl(e,t){if(e.getLoadedLanguages().includes(t))return null;let n=fl.get(t);if(n)return n;let r=cl[t];if(!r)return null;let i=r().then(t=>e.loadLanguage(t.default)).finally(()=>fl.delete(t));return fl.set(t,i),i}async function ml(e,t,n){let r=ll(t);if(!r||e.length===0)return null;try{let t=await dl();return await pl(t,r),t.getLoadedLanguages().includes(r)?t.codeToTokensBase(e.join(`
|
|
87
|
+
`:e},`${t}-${e}`))})]})}function Tc(e,t){return e===`reviewer`||t===0?`commented`:`replied`}var Ec={APPROVED:`approved`,CHANGES_REQUESTED:`requested changes`,COMMENTED:`reviewed`,DISMISSED:`dismissed`};function Dc(e){let t=[...e.messages].reverse().find(e=>e.author===`agent`);if(t){let e=/```suggestion\n[\s\S]*?```/.exec(t.text);return e?e[0]:t.text}return[...e.messages].reverse().find(e=>e.author===`reviewer`)?.text??``}function Oc(e,t){(e.metaKey||e.ctrlKey)&&e.key===`Enter`&&(e.preventDefault(),t())}function kc({text:e,links:t}){return t?(0,S.jsx)(`div`,{onClick:e=>{let n=Po(e.target);n&&(e.preventDefault(),t.onJump(n.path,n.line))},children:(0,S.jsx)(uc,{className:`cmt-body markdown`,text:J(e,t.paths),paths:t.paths})}):(0,S.jsx)(uc,{className:`cmt-body markdown`,text:e})}function Ac({message:e,live:t,editing:n,agentConnected:r,onEdit:i,onCancelEdit:a,onAdd:o,onDismiss:s,onRestore:c}){let l=e.prComment,u=l.outcome,[d,f]=(0,x.useState)(!1);if(u||!t){let e=u?u.kind:`superseded`,t=u?u.kind===`added`?u.edited?`added to your review, edited`:`added to your review`:`dismissed`:`superseded by the reply below`;return(0,S.jsxs)(`div`,{className:`psc psc-done psc-${e}`,"data-testid":`pr-suggestion-receipt`,children:[(0,S.jsxs)(`div`,{className:`psc-done-line`,children:[(0,S.jsx)(`button`,{type:`button`,className:`thread-shut chevron${d?``:` chevron-shut`}`,"aria-expanded":d,"aria-label":d?`hide the suggested comment`:`show the suggested comment`,"data-tip":d?`hide the suggested comment`:`show the suggested comment`,onClick:()=>f(!d),children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),(0,S.jsx)(H,{name:`globe`,size:`sm`}),(0,S.jsxs)(`span`,{className:`psc-done-text`,children:[`Suggested PR comment `,(0,S.jsxs)(`span`,{className:`psc-done-status`,children:[`· `,t]})]}),e===`dismissed`&&c&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`bring the suggestion back, with its buttons`,onClick:c,children:`Undo`})]}),d&&(0,S.jsx)(uc,{className:`psc-body markdown`,text:l.text})]})}return n?(0,S.jsx)(`div`,{className:`psc psc-editing`,children:(0,S.jsx)(_c,{title:`Suggested PR comment`,placeholder:`The review comment as GitHub will show it…`,fixedAudience:`pr`,initialText:l.text,agentConnected:r,onSubmit:e=>void o(e),onCancel:a})}):(0,S.jsxs)(`div`,{className:`psc`,"data-testid":`pr-suggestion`,children:[(0,S.jsxs)(`div`,{className:`psc-head`,children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),(0,S.jsx)(`span`,{children:`Suggested PR comment`}),(0,S.jsx)(`span`,{className:`psc-head-note`,children:`for the author, in your words`})]}),(0,S.jsx)(uc,{className:`psc-body markdown`,text:l.text}),(0,S.jsxs)(`div`,{className:`psc-foot`,children:[(0,S.jsx)(`span`,{className:`psc-hint`,children:`Draft · posts when you submit the review`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm psc-add`,title:`a draft PR comment on these lines, in your review; it posts when you submit`,onClick:()=>void o(l.text),children:`Add as PR comment draft`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-sm`,title:`rewrite it before it joins the review`,onClick:i,children:`Edit`}),s&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm`,"aria-label":`dismiss this suggested comment`,title:`pass on it; the thread stays open`,onClick:s,children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]})]})}function jc({thread:e,actions:t,showContext:n=!1,agentConnected:r=!1,working:i=!1,queuePosition:a,gone:o=!1,links:s,asides:c}){let l=us(),u=at(e),d=e.github,f=u&&e.state===`open`&&d===void 0,p=d!==void 0&&e.id.startsWith(`gh:`),[m,h]=(0,x.useState)(null),[g,_]=(0,x.useState)(!1),[v,y]=(0,x.useState)(``),[b,C]=(0,x.useState)(!1),[w,T]=(0,x.useState)(null),[E,D]=(0,x.useState)(!1),[O,k]=(0,x.useState)(!1),[A,j]=(0,x.useState)(!1),[M,ee]=(0,x.useState)(!1),[N,P]=(0,x.useState)(null),[F,te]=(0,x.useState)(null),ne=(0,x.useRef)(null),re=(0,x.useRef)(null),I=(0,x.useRef)(void 0);(0,x.useEffect)(()=>()=>clearTimeout(I.current),[]);let ie=(n=!0)=>{v.trim()&&(D(!1),t.reply(e.id,v,n).then(()=>y(``)).catch(()=>D(!0)))},ae=N?e.messages.findIndex(e=>e.id===N.id):-1,oe=ae===-1?0:e.messages.length-1-ae,se=ae!==-1&<(e,ae),ce=se&&r&&(e.state===`sent`||e.state===`addressed`),le=n=>t.edit!==void 0&&n.author===`reviewer`&&e.state!==`resolved`&&n.github===void 0,ue=e=>{te(null),P({id:e.id,draft:e.text})},de=()=>{P(null),te(null)},fe=(n=!0)=>{if(!N||ae===-1)return;let r=N.draft.trim();if(r){if(r===e.messages[ae].text.trim())return de();te(null),t.edit(e.id,N.id,r,n).then(de).catch(e=>te(e instanceof Error&&e.message?e.message:`couldn't reach the diffo server — your text is still here; try again`))}},L=()=>(D(!1),T(null),t.send(e.id).then(({delivered:e,copied:t,prompt:n})=>{if(!e){if(!t){T(n??null);return}C(!0),clearTimeout(I.current),I.current=setTimeout(()=>C(!1),2500)}}).catch(()=>D(!0))),R=it(e),z=(n,r)=>(D(!1),t.create(e.anchor,r,void 0,{audience:`pr`,origin:{threadId:e.id,messageId:n}}).then(()=>_(!1)).catch(()=>D(!0))),pe=n=>{t.dismissPrComment&&(D(!1),t.dismissPrComment(e.id,n).catch(()=>D(!0)))},me=n=>{t.restorePrComment&&(D(!1),t.restorePrComment(e.id,n).catch(()=>D(!0)))},he=e.messages[e.messages.length-1]?.author,ge=e.withheld===!0,_e=fs(e),ve=!u&&!ge&&he===`reviewer`&&(e.state===`sent`||e.state===`addressed`),ye=e.state===`sent`&&ve&&!r,be=u&&d?e.messages.filter(e=>e.author===`reviewer`&&e.github===void 0).length:0,xe=ut(e)&&e.state===`open`,Se=!u&&r&&(e.state===`sent`||e.state===`addressed`||xe),Ce=O||v.trim()!==``,we=e.state!==`resolved`&&Ce,Te=e.state!==`resolved`&&!Ce,Ee=e.messages[e.messages.length-1],De=e.state!==`resolved`&&Ee?.author===`agent`?Ee.suggestedReply??null:null,Oe=De!==null&&v===``,B=()=>{De!==null&&(y(De),k(!0),requestAnimationFrame(()=>{let e=re.current;e&&(e.focus(),e.setSelectionRange(e.value.length,e.value.length))}))},ke=e=>Oe&&(e.key===`Tab`||e.key===`ArrowRight`)&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey&&!e.altKey,Ae=u?f?`Draft`:e.state===`resolved`?`Resolved`:`On GitHub`:xe?`From the agent`:ge?ms.note:e.state===`addressed`&&e.intent===`fix`?`Addressed`:yc[e.state],je=u?f?`attn`:e.state===`resolved`?`mute`:`pr`:xe||ge?`attn`:bc[e.state],Me=(0,S.jsxs)(S.Fragment,{children:[e.queued?.resolve&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`resolves when you submit`}),e.queued?.unresolve&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`reopens when you submit`})]}),Ne=(0,S.jsxs)(`span`,{className:`thread-marks`,children:[e.intent&&!ct(e)&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-kind thread-kind-${e.intent}`,children:vc[e.intent]}),e.closingNote&&(0,S.jsx)(`span`,{className:`thread-badge`,children:`closing note`}),R!==null&&(0,S.jsxs)(`span`,{className:`thread-badge thread-badge-pr`,title:`your agent drafted a review comment for the author; it is under its reply`,children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` suggests a PR comment`]}),d?.reviewState&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-${d.reviewState.toLowerCase()}`,children:Ec[d.reviewState]}),d?.outdated&&(0,S.jsx)(`span`,{className:`thread-badge`,title:`the commented line is no longer in the diff`,children:`outdated`}),f&&(0,S.jsx)(`span`,{className:`thread-badge thread-badge-pr`,children:`posts when you submit`}),be>0&&(0,S.jsxs)(`span`,{className:`thread-badge thread-badge-pr`,children:[be===1?`reply posts`:`${be} replies post`,` when you submit`]}),Me,d?.url&&(0,S.jsxs)(`a`,{className:`thread-badge thread-badge-link`,href:d.url,target:`_blank`,rel:`noreferrer`,title:`open on GitHub`,children:[(0,S.jsx)(H,{name:`link`,size:`sm`}),` GitHub`]}),e.codeChanged&&(0,S.jsxs)(`span`,{className:`thread-badge`,children:[(0,S.jsx)(H,{name:`alert`,size:`sm`}),` code changed since this comment`]}),b&&(0,S.jsx)(`span`,{className:`thread-badge`,children:`prompt copied, paste it to your agent`}),!(xe&&ct(e))&&(0,S.jsx)(`span`,{className:`chip chip-${je}`,children:Ae})]}),Pe=e.awaitingFollowUp===!0,Fe=!u&&(i||a!==void 0||e.unanswered||Pe)?(0,S.jsx)(Cc,{working:i,place:a,followUp:Pe,unanswered:e.unanswered===!0&&a===void 0&&!i,since:e.updatedAt}):null,Ie=(i||Pe)&&e.deliveredThrough?Date.parse(e.deliveredThrough):null,Le=Ie===null?-1:e.messages.findIndex(e=>e.author===`reviewer`&&Date.parse(e.at)>Ie),Re=Le===-1?e.messages.length:Le,ze=oe>0?null:Fe,Be=e.state===`resolved`?(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>void t.reopen(e.id),children:`Reopen`}):f&&t.remove?(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`drop this draft; nothing was posted`,onClick:()=>void t.remove(e.id),children:`Discard draft`}):(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:d?`resolve on GitHub when you submit; until then it is only marked here`:void 0,onClick:()=>void t.resolve(e.id),children:`Resolve`}),Ve=l&&!u&&R===null&&e.messages.length>0&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm thread-promote`,title:`turn this into a review comment for GitHub; you edit it before it joins the review`,onClick:()=>h(Dc(e)),children:[(0,S.jsx)(H,{name:`globe`,size:`sm`}),` Post as PR comment`]}),He=m!==null&&(0,S.jsx)(`div`,{className:`thread-aside-compose`,children:(0,S.jsx)(_c,{title:`Comment on PR`,placeholder:`The review comment as GitHub will show it…`,fixedAudience:`pr`,initialText:m,agentConnected:r,onSubmit:n=>{t.create(e.anchor,n,void 0,{audience:`pr`}),h(null)},onCancel:()=>h(null)})}),Ue=ye&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:L,children:[(0,S.jsx)(H,{name:`copy`,size:`sm`}),` Copy prompt`]}),We=_e&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-sm ${we&&v.trim()!==``?`btn-outline`:`btn-primary`}`,onClick:L,title:r?`send this thread to your agent`:`mark sent and copy the prompt`,children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Send`]}),Ge=e.state===`resolved`&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`reopen this thread`,onClick:()=>void t.reopen(e.id),children:`Reopen`}),Ke=t.remove&&!p&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm btn-ghost-danger`,"aria-label":`delete this thread`,"data-tip":`delete this thread`,onClick:()=>void t.remove(e.id),children:(0,S.jsx)(H,{name:`trash`,size:`sm`})});if(e.state===`resolved`&&!A){let t=e.messages[0];return(0,S.jsxs)(`div`,{className:`thread thread-resolved thread-collapsed`,"data-thread-id":e.id,ref:ne,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`button`,{type:`button`,className:`thread-collapsed-summary`,onClick:()=>j(!0),title:`expand this resolved thread`,children:[(0,S.jsx)(`span`,{className:`chip chip-mute`,children:`Resolved`}),Me,(0,S.jsx)(`span`,{className:`thread-collapsed-text`,children:ys(t?.text??``)}),(0,S.jsx)(`span`,{className:`thread-collapsed-count`,children:e.messages.length>1?`${e.messages.length} messages`:``}),(0,S.jsx)(`span`,{className:`thread-collapsed-hint chevron chevron-shut`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})})]}),Ge,Ke]})}return(0,S.jsxs)(`div`,{className:`thread conv thread-${e.state}${u?` thread-public`:l?` thread-private`:``}${e.parentId?` thread-aside`:``}`,"data-thread-id":e.id,ref:ne,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`thread-head`,children:[(0,S.jsx)(`button`,{type:`button`,className:`thread-shut chevron${M?` chevron-shut`:``}`,"aria-expanded":!M,"data-tip":M?`expand this thread`:`collapse this thread`,"aria-label":M?`expand this thread`:`collapse this thread`,onClick:()=>ee(!M),children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),l&&(0,S.jsxs)(`span`,{className:`thread-side thread-side-${u?`pr`:`agent`}`,title:u?`a review comment: on GitHub, or headed there when you submit`:`private: between you and your agent, never leaves this machine`,children:[(0,S.jsx)(H,{name:u?`globe`:`lock`,size:`sm`}),u?`PR comment`:`Private`]}),(0,S.jsx)(`span`,{className:`thread-where${o?` thread-where-gone`:``}`,title:o?d?.outdated?`outdated on GitHub: the line left the diff`:`this file is no longer in the changeset`:void 0,children:Mc(e,o)}),M&&e.messages.length>1&&(0,S.jsxs)(`span`,{className:`thread-where-n`,children:[e.messages.length,` messages`]}),Ne,M&&Ge]}),M?(0,S.jsx)(`button`,{type:`button`,className:`thread-shut-peek`,onClick:()=>ee(!1),children:ys(e.messages[0]?.text??``)}):(0,S.jsxs)(S.Fragment,{children:[n&&e.codeContext&&(0,S.jsx)(wc,{code:e.codeContext}),ye&&(0,S.jsx)(`div`,{className:`thread-hint`,children:`waiting on your agent: paste the copied prompt into it; replies land here live`}),ge&&(0,S.jsx)(`div`,{className:`thread-hint`,children:o?`your reply is held here: Send hands it over; Finish review will not, since this file has left the changeset`:`your reply is held here: Send hands it over now, or Finish review takes it with the batch`}),(0,S.jsxs)(`div`,{className:`thread-messages`,children:[e.messages.map((n,a)=>(0,S.jsxs)(x.Fragment,{children:[a===Re&&ze,(0,S.jsxs)(`div`,{className:`cmt thread-message thread-message-${n.author}${a===ae?` thread-message-editing`:``}${ae!==-1&&a>ae?` thread-message-cut`:``}`,children:[(0,S.jsxs)(`div`,{className:`cmt-head`,children:[(0,S.jsx)(dc,{who:n.author===`reviewer`?`you`:n.author===`agent`?`agent`:`github`,user:n.github?.user}),(0,S.jsx)(`span`,{className:`cmt-who cmt-who-${n.author}`,children:n.author===`reviewer`?`You`:n.author===`agent`?`Agent`:n.github?.user.login??`GitHub`}),(0,S.jsxs)(`span`,{className:`cmt-when`,children:[n.author===`agent`&&n.durationMs!==void 0?`answered in ${xc(n.durationMs)}`:`${Tc(n.author,a)} ${va(n.at)}`,n.editedAt&&` · edited`,n.author===`github`&&` · on GitHub`,n.author===`reviewer`&&u&&n.github&&` · on GitHub`,n.author===`reviewer`&&u&&!n.github&&(f?` · draft`:` · posts when you submit`),a===0&&u&&e.origin&&(0,S.jsx)(`span`,{className:`cmt-origin`,title:`your agent wrote the first version of this comment; it posts as yours`,children:e.origin.edited?` · from your agent, edited`:` · from your agent`})]}),le(n)&&N?.id!==n.id&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-icon btn-sm cmt-edit`,"aria-label":`edit this message`,"aria-disabled":i||void 0,"data-tip":i?`the agent is answering — edit after it replies`:`edit this message`,onClick:()=>{i||ue(n)},children:(0,S.jsx)(H,{name:`edit`,size:`sm`})})]}),N?.id===n.id?(0,S.jsxs)(`div`,{className:`cmt-edit-box`,children:[(0,S.jsx)(`textarea`,{autoFocus:!0,className:`cmt-edit-input`,"aria-label":`edit your message`,value:N.draft,onFocus:e=>e.currentTarget.setSelectionRange(e.currentTarget.value.length,e.currentTarget.value.length),onChange:e=>P({id:n.id,draft:e.target.value}),onKeyDown:e=>{e.key===`Escape`?(e.preventDefault(),de()):Oc(e,()=>fe(!0))}}),F&&(0,S.jsx)(`div`,{className:`cmt-edit-error`,role:`alert`,children:F}),(0,S.jsxs)(`div`,{className:`cmt-edit-foot`,children:[(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:de,children:`Cancel`}),ce&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>fe(!1),title:o?`save it without handing it over — Send takes it; the finish batch will not`:`save it without handing it over — Send or Finish takes it`,children:`Save`}),(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>fe(!0),title:ce?`save the edit and hand the thread back to your agent — its withdrawn replies are named, and code it changed for them stays until it says otherwise`:se?`save the edit — the thread waits for the agent, which is told its earlier replies were withdrawn`:`save the edit`,children:[ce?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Save & resend`]}):`Save`,(0,S.jsx)(`span`,{className:`btn-kbd`,children:`⌘↵`})]})]})]}):(0,S.jsx)(kc,{text:n.text,links:s}),n.author===`agent`&&n.prComment&&(0,S.jsx)(Ac,{message:n,live:R?.id===n.id,editing:g&&R?.id===n.id,agentConnected:r,onEdit:()=>_(!0),onCancelEdit:()=>_(!1),onAdd:e=>z(n.id,e),onDismiss:t.dismissPrComment?()=>pe(n.id):void 0,onRestore:t.restorePrComment?()=>me(n.id):void 0})]}),a===ae&&oe>0&&(0,S.jsx)(`div`,{className:`cmt-cut`,role:`note`,children:(0,S.jsxs)(`span`,{children:[`Saving removes the ${oe===1?`message`:`${oe} messages`} below`,se&&` · the agent answers again`]})})]},n.id)),Re>=e.messages.length&&ze]}),c&&(0,S.jsx)(`div`,{className:`thread-asides`,children:c}),He,E&&(0,S.jsx)(`div`,{className:`thread-hint thread-hint-error`,children:`couldn't reach the diffo server; your text is still here, try again`}),w&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`div`,{className:`thread-hint thread-hint-error`,children:`couldn't reach the clipboard; this browser blocked it. The thread is marked sent; select the prompt below and copy it by hand.`}),(0,S.jsx)(`pre`,{className:`invite-prompt`,children:w})]})]}),!M&&ae===-1&&(0,S.jsxs)(`div`,{className:`thread-foot${Te||we?``:` thread-foot-bare`}`,children:[Te&&De!==null&&(0,S.jsxs)(`div`,{className:`thread-offer replybar`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`thread-reply-stub thread-reply-stub-offer`,onClick:()=>k(!0),title:`the agent suggests this reply — click to write your own, Tab in the box takes this one`,children:[(0,S.jsx)(H,{name:`sparkle`,size:`sm`,className:`thread-offer-icon`}),(0,S.jsx)(`span`,{className:`thread-offer-text`,children:De})]}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-outline btn-sm thread-offer-use`,onClick:B,title:`take the suggested reply into the box, ready to edit or send`,children:`Use`})]}),Te&&De===null&&(0,S.jsx)(`button`,{type:`button`,className:`thread-reply-stub replybar`,onClick:()=>k(!0),children:u?`Reply on GitHub…`:`Reply…`}),we&&(0,S.jsxs)(`div`,{className:`thread-input-wrap${Oe?` thread-input-wrap-ghost`:``}`,children:[Oe&&(0,S.jsx)(H,{name:`sparkle`,size:`sm`,className:`thread-offer-icon thread-ghost-icon`}),(0,S.jsx)(`textarea`,{autoFocus:!0,ref:re,rows:1,className:`thread-input${Oe?` thread-input-ghost`:``}`,placeholder:Oe?De:u?`reply on GitHub, posts when you submit…`:`reply…`,"aria-description":Oe?`the agent offered this reply; press Tab to take it`:void 0,value:v,onChange:e=>y(e.target.value),onBlur:()=>{v.trim()||k(!1)},onKeyDown:e=>{ke(e)?(e.preventDefault(),y(De)):e.key===`Escape`&&!v.trim()?k(!1):Oc(e,()=>ie(!0))}}),Oe&&(0,S.jsx)(`button`,{type:`button`,className:`thread-offer-kbd thread-ghost-hint`,onMouseDown:e=>e.preventDefault(),onClick:B,title:`take the suggested reply (Tab)`,children:`Tab`})]}),!Te&&!we&&(0,S.jsx)(`span`,{className:`thread-spacer`}),we&&v.trim()!==``&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>ie(!0),title:Se?`reply and hand it to your agent in one go`:u?`reply on GitHub; it posts when you submit the review`:`write it into the thread`,children:[Se?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(H,{name:`send`,size:`sm`}),` Reply & send`]}):`Reply`,(0,S.jsx)(`span`,{className:`btn-kbd`,children:`⌘↵`})]}),we&&v.trim()!==``&&Se&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>ie(!1),title:o?`write it into the thread without handing it over: Send takes it; the finish batch will not`:`write it into the thread without handing it over: Send or Finish takes it`,children:`Reply`}),We,Ue,Ve,Be,e.state===`resolved`&&(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>j(!1),children:`Collapse`}),Ke]})]})}function Mc(e,t=!1){let n=e.anchor,r=e.github;if(r?.kind===`description`)return`Pull request description`;if(r?.kind===`review`)return`Review on the pull request`;if(r?.kind===`comment`||at(e)&&n.kind===`changeset`)return`Comment on the pull request`;let i=ct(e)?`Agent comment`:e.messages[0]?.author===`github`?`${e.messages[0].github?.user.login??`GitHub`}'s comment`:at(e)?`Review comment`:`Comment`;return n.kind===`changeset`?ct(e)?`${i} on the changeset`:`Note on the changeset`:n.kind===`layer`?t?`Layer “${n.title}”`:`${i} on this layer`:t?n.kind===`hunk`?`${n.path}:${mt(n)}`:n.path:n.kind===`hunk`?`${i} on ${n.endLine===void 0?`line`:`lines`} ${mt(n)}`:`${i} on this file`}function Nc({threads:e,actions:t,showContext:n=!1,agentConnected:r=!1,workingOn:i,queuedOn:a,gone:o=!1,links:s}){if(e.length===0)return null;let c=new Set(e.map(e=>e.id)),l=new Map;for(let t of e)if(t.parentId&&c.has(t.parentId)){let e=l.get(t.parentId);e?e.push(t):l.set(t.parentId,[t])}let u=(e,c)=>(0,S.jsx)(jc,{thread:e,actions:t,showContext:n,agentConnected:r,working:i?.has(e.id)??!1,queuePosition:a?.get(e.id),gone:o,links:s,asides:c},e.id);return(0,S.jsx)(`div`,{className:`thread-list`,children:e.filter(e=>!(e.parentId&&c.has(e.parentId))).map(e=>{let t=l.get(e.id);return u(e,t?.map(e=>u(e)))})})}function Pc({stillTo:e,back:t,onOpen:n,onClose:r}){let i=e.filter(e=>e.working===!0).length,a=e.length-i,o=e.length===0&&t.length>0;(0,x.useEffect)(()=>{let e=e=>{e.key===`Escape`&&(e.stopPropagation(),r())};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[r]);let s=[t.length>0?`${t.length} answered`:null,i>0?`${i} in progress`:null,a>0?`${a} waiting`:null].filter(Boolean);return(0,S.jsx)(`div`,{className:`monitor`,role:`dialog`,"aria-label":`Comments with your agent`,children:(0,S.jsxs)(`div`,{className:`monitor-inner`,children:[(0,S.jsx)(Fc,{stillTo:e,back:t}),s.length>0&&(0,S.jsx)(`div`,{className:`monitor-counts${o?` monitor-counts-done`:``}`,children:o?`all ${t.length} answered`:s.join(` · `)}),e.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`monitor-group`,children:[`Still to answer · `,e.length]}),(0,S.jsx)(`ul`,{className:`monitor-rows`,children:e.map(e=>(0,S.jsx)(Lc,{item:e,onOpen:n},e.thread.id))})]}),t.length>0&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`monitor-group`,children:[`Answered · `,t.length]}),(0,S.jsx)(`ul`,{className:`monitor-rows monitor-rows-done`,children:t.map(e=>(0,S.jsx)(Lc,{item:e,onOpen:n},e.thread.id))})]})]})})}function Fc({stillTo:e,back:t}){return(0,S.jsxs)(`div`,{className:`monitor-qbar`,"aria-hidden":!0,children:[t.map(e=>(0,S.jsx)(`i`,{className:`q-done`},e.thread.id)),e.map(e=>(0,S.jsx)(`i`,{className:e.working?`q-now`:`q-wait`},e.thread.id))]})}function Ic(e){if(e.working)return{label:`working on it`,kind:`now`};if(e.queued!==void 0)return{label:Sc(e.queued),kind:`wait`};if(e.turn===`agent`)return{label:`sent`,kind:`wait`};if(e.turn===`resolved`)return{label:`settled`,kind:`done`};switch(e.outcome){case`fixed`:return{label:`fixed`,kind:`done`};case`answered`:return{label:`answered`,kind:`done`};case`changed`:return{label:`changed, no reply`,kind:`silent`};case`no-answer`:return{label:`no answer`,kind:`silent`};default:return{label:`back`,kind:`done`}}}function Lc({item:e,onOpen:t}){let[n,r]=(0,x.useState)(()=>Date.now());(0,x.useEffect)(()=>{if(e.working!==!0)return;let t=setInterval(()=>r(Date.now()),1e4);return()=>clearInterval(t)},[e.working]);let{label:i,kind:a}=Ic(e),o=e.working===!0?Math.max(0,n-Date.parse(e.updatedAt)):void 0;return(0,S.jsx)(`li`,{children:(0,S.jsxs)(`button`,{type:`button`,className:`monitor-row`,onClick:()=>t(e),children:[(0,S.jsxs)(`span`,{className:`monitor-row-top`,children:[(0,S.jsxs)(`span`,{className:`monitor-st monitor-st-${a}`,children:[e.working===!0&&(0,S.jsx)(`span`,{className:`monitor-pulse`}),i]}),o!==void 0&&(0,S.jsxs)(`span`,{className:`monitor-took`,children:[xc(o),`…`]}),e.durationMs!==void 0&&!e.working&&(0,S.jsx)(`span`,{className:`monitor-took`,children:xc(e.durationMs)})]}),(0,S.jsxs)(`span`,{className:`monitor-q`,children:[(0,S.jsx)(`span`,{className:`monitor-anchor`,children:e.anchor??`the whole changeset`}),e.question]}),e.answer!==null&&(0,S.jsxs)(`span`,{className:`monitor-a`,children:[`↳ `,e.answer]})]})})}function Rc({status:e,onSetEnabled:t,onClose:n}){let[r,i]=(0,x.useState)(!1),a=e.source===`env`;return(0,S.jsxs)(jt,{title:`Privacy`,onClose:n,footer:r?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>{t(!1),i(!1)},children:`Turn off`}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>i(!1),children:`Keep sharing`})]}):void 0,children:[(0,S.jsxs)(`div`,{className:`privacy-row`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`pane-sw${e.enabled?` pane-sw-on`:``}`,role:`switch`,"aria-checked":e.enabled,disabled:a,onClick:()=>e.enabled?i(!0):t(!0),children:[(0,S.jsx)(`span`,{className:`pane-track`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{})}),`Share anonymous usage data`]}),(0,S.jsx)(`span`,{className:`privacy-state`,children:a?`Off: ${e.variable} is set in your environment`:e.enabled?`On`:`Off`})]}),(0,S.jsxs)(`p`,{className:`cov-note`,children:[`Two small events per review, opened and finished: the version, your OS, the kind of review, which agent, and counts. Never code, paths, or comment text. One random id per machine tells returning machines from new ones; turning this off deletes it.`,` `,(0,S.jsx)(`a`,{href:e.docs,target:`_blank`,rel:`noreferrer`,children:`What is sent`})]}),r&&(0,S.jsxs)(`p`,{className:`cov-note privacy-confirm`,children:[(0,S.jsx)(`strong`,{children:`Stop sharing?`}),` Diffo will send nothing more from this machine and delete its random id. You can turn it back on here any time.`]})]})}var zc=[/(^|\/)pnpm-lock\.yaml$/,/(^|\/)package-lock\.json$/,/(^|\/)npm-shrinkwrap\.json$/,/(^|\/)yarn\.lock$/,/(^|\/)bun\.lockb?$/,/(^|\/)Cargo\.lock$/,/(^|\/)Gemfile\.lock$/,/(^|\/)composer\.lock$/,/(^|\/)go\.sum$/,/(^|\/)poetry\.lock$/,/(^|\/)uv\.lock$/,/\.min\.(js|css)$/,/\.(js|css)\.map$/,/\.snap$/];function Bc(e){let t=0;for(let n of e.hunks)for(let e of n.lines)e.kind!==`context`&&t++;return t}function Vc(e){return e.hunks.length===0?null:zc.some(t=>t.test(e.path))?`generated`:Bc(e)>400?`large`:null}var Hc={fromTop:0,fromBottom:0};function Uc(e){return e.lines.filter(e=>e.kind!==`del`).length}function Wc(e){return e.lines.filter(e=>e.kind!==`add`).length}function Gc(e){return Uc(e)===0?e.newStart+1:e.newStart}function Kc(e){return Wc(e)===0?e.oldStart+1:e.oldStart}function qc(e){return Gc(e)}function Jc(e){return Gc(e)+Uc(e)-1}function Yc(e){return Gc(e)-Kc(e)}function Xc(e){return Gc(e)+Uc(e)-(Kc(e)+Wc(e))}function Zc(e){let t=e.hunks;if(t.length===0)return[];let n=[],r=t[0];qc(r)>1&&n.push({key:`top:${r.id}`,above:null,below:0,startNewNo:1,endNewNo:qc(r)-1,offset:Yc(r)});for(let e=1;e<t.length;e++){let r=t[e-1],i=t[e],a=Jc(r)+1,o=qc(i)-1;o>=a&&n.push({key:`${r.id}:${i.id}`,above:e-1,below:e,startNewNo:a,endNewNo:o,offset:Yc(i)})}let i=t[t.length-1],a=e.newLineCount;return typeof a==`number`&&a>Jc(i)&&n.push({key:`${i.id}:tail`,above:t.length-1,below:null,startNewNo:Jc(i)+1,endNewNo:a,offset:Xc(i)}),n}function Qc(e){return e.endNewNo-e.startNewNo+1}function $c(e,t){return Math.max(0,Qc(e)-t.fromTop-t.fromBottom)}function el(e,t,n,r){let i=[],a=Math.max(t.startNewNo,n),o=Math.min(t.endNewNo,r,e.length);for(let n=a;n<=o;n++){let r=e[n-1];if(r===void 0)break;i.push({kind:`context`,oldNo:n-t.offset,newNo:n,text:r})}return i}function tl(e,t,n){if($c(t,n)===0){let n=el(e,t,t.startNewNo,t.endNewNo);return t.below===null?{top:n,bottom:[],merged:!0}:{top:[],bottom:n,merged:!0}}return{top:n.fromTop>0?el(e,t,t.startNewNo,t.startNewNo+n.fromTop-1):[],bottom:n.fromBottom>0?el(e,t,t.endNewNo-n.fromBottom+1,t.endNewNo):[],merged:!1}}var nl={freshHunkIds:new Set,changedViewedHunkIds:new Set};function rl(e,t,n){if(!e)return nl;let r=new Set,i=new Map;for(let t of e.files){let e=new Set;for(let n of t.hunks)e.add(n.id),r.add(n.id);i.set(t.path,e)}let a=new Set,o=new Set;for(let e of t.files){let t=new Set(e.hunks.map(e=>e.id)),s=[...i.get(e.path)??new Set].some(e=>n.has(e)&&!t.has(e));for(let t of e.hunks)r.has(t.id)||(a.add(t.id),s&&o.add(t.id))}return{freshHunkIds:a,changedViewedHunkIds:o}}function il({decisions:e,open:t,onOpen:n,onJump:r,onComment:i}){return e.length===0?null:(0,S.jsxs)(`section`,{className:`ch-dec`,"aria-label":`Decisions`,children:[(0,S.jsx)(`div`,{className:`ch-dec-h`,children:`Decisions`}),e.map((e,a)=>(0,S.jsx)(ol,{resolved:e,open:t===a,onToggle:()=>n(t===a?null:a),onJump:r,onComment:i?()=>i(a):void 0},a))]})}function al(e){return e.line===void 0?e.path:`${e.path}:${e.line}${e.endLine===void 0?``:`–${e.endLine}`}`}function ol({resolved:e,open:t,onToggle:n,onJump:r,onComment:i}){let{decision:a,places:o}=e,s=o.filter(e=>e.file);return(0,S.jsxs)(`div`,{className:`ch-dec-item${t?` ch-dec-item-open`:``}`,children:[(0,S.jsxs)(`button`,{type:`button`,className:`ch-dec-main`,"aria-expanded":t,onClick:n,children:[(0,S.jsx)(`span`,{className:`chevron ch-dec-chev${t?``:` chevron-shut`}`,children:(0,S.jsx)(H,{name:`chev`,size:`sm`})}),(0,S.jsx)(`span`,{className:`ch-dec-text`,children:a.text})]}),t&&(0,S.jsxs)(`div`,{className:`ch-dec-card`,children:[a.detail&&(0,S.jsx)(uc,{text:a.detail,className:`ch-dec-detail markdown`}),(0,S.jsxs)(`div`,{className:`ch-dec-acts`,children:[s.map(e=>(0,S.jsxs)(`button`,{type:`button`,className:`ch-dec-place`,title:al(e.at),onClick:()=>r(e.at.path,e.at.line??null),children:[(0,S.jsx)(`span`,{className:`ch-dec-place-path`,children:e.at.path}),e.at.line!==void 0&&(0,S.jsxs)(`span`,{className:`ch-dec-place-lines`,children:[e.at.line,e.at.endLine!==void 0&&`–${e.at.endLine}`]})]},al(e.at))),s.length===0&&o.length>0&&(0,S.jsxs)(`span`,{className:`ch-dec-gone`,children:[o.length===1?`its file is`:`its files are`,` not in the changeset now`]}),i&&(0,S.jsx)(`button`,{type:`button`,className:`ch-dec-comment`,onClick:i,children:`Comment`})]})]})]})}var sl={ts:`typescript`,tsx:`tsx`,js:`javascript`,jsx:`jsx`,mjs:`javascript`,cjs:`javascript`,json:`json`,css:`css`,scss:`scss`,html:`html`,md:`markdown`,py:`python`,rb:`ruby`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,swift:`swift`,c:`c`,h:`c`,cpp:`cpp`,hpp:`cpp`,cs:`csharp`,sh:`shellscript`,bash:`shellscript`,zsh:`shellscript`,yml:`yaml`,yaml:`yaml`,toml:`toml`,sql:`sql`,vue:`vue`,svelte:`svelte`,php:`php`,xml:`xml`,dockerfile:`docker`},cl={c:()=>X(()=>import(`./c-DWGmR78Y.js`),__vite__mapDeps([19,20])),cpp:()=>X(()=>import(`./cpp-CJIxL8VH.js`),__vite__mapDeps([21,22,20])),csharp:()=>X(()=>import(`./csharp-oqKa8noW.js`),[]),css:()=>X(()=>import(`./css-CdtkT07m.js`),__vite__mapDeps([23,24])),docker:()=>X(()=>import(`./docker-IyjqRm3v.js`),[]),go:()=>X(()=>import(`./go-rLFTqkRN.js`),[]),html:()=>X(()=>import(`./html-DDNsd9lV.js`),__vite__mapDeps([25,26,24,27])),java:()=>X(()=>import(`./java-DxlWrXwe.js`),__vite__mapDeps([28,29])),javascript:()=>X(()=>import(`./javascript-Yelw-5ZN.js`),__vite__mapDeps([30,27])),json:()=>X(()=>import(`./json-CaljABEy.js`),__vite__mapDeps([31,32])),jsx:()=>X(()=>import(`./jsx-hEbJ82HF.js`),__vite__mapDeps([33,34])),kotlin:()=>X(()=>import(`./kotlin-DhhofPvG.js`),[]),markdown:()=>X(()=>import(`./markdown-BYOwaDjH.js`),[]),php:()=>X(()=>import(`./php-CQT4wx5i.js`),__vite__mapDeps([35,24,27,26,32,36,29,37])),python:()=>X(()=>import(`./python-gzcpVVnB.js`),[]),ruby:()=>X(()=>import(`./ruby-D_UtGFHI.js`),__vite__mapDeps([38,20,22,24,27,26,34,36,29,37,39,40,41,42])),rust:()=>X(()=>import(`./rust-Cfkwpbl8.js`),[]),scss:()=>X(()=>import(`./scss-DHtrkMkT.js`),__vite__mapDeps([43,24])),shellscript:()=>X(()=>import(`./shellscript-BiGZg9Om.js`),__vite__mapDeps([44,41])),sql:()=>X(()=>import(`./sql-0Qcw9ht3.js`),__vite__mapDeps([45,37])),svelte:()=>X(()=>import(`./svelte-BUVJxsYv.js`),__vite__mapDeps([46,24,27,39])),swift:()=>X(()=>import(`./swift-CyEgAFGc.js`),[]),toml:()=>X(()=>import(`./toml-CcmNWLt0.js`),[]),tsx:()=>X(()=>import(`./tsx-5f3ulCja.js`),__vite__mapDeps([47,40])),typescript:()=>X(()=>import(`./typescript-Utq2Cl8c.js`),__vite__mapDeps([48,39])),vue:()=>X(()=>import(`./vue-CSBlZ1UP.js`),__vite__mapDeps([49,24,27,26,32,39])),xml:()=>X(()=>import(`./xml-CoDIzWF0.js`),__vite__mapDeps([50,36,29])),yaml:()=>X(()=>import(`./yaml-CxbubiML.js`),__vite__mapDeps([51,42]))};function ll(e){let t=e.slice(e.lastIndexOf(`/`)+1).toLowerCase();return t===`dockerfile`?`docker`:sl[t.slice(t.lastIndexOf(`.`)+1)]??null}var ul=null;async function dl(){return ul||=(async()=>{let[{createHighlighterCore:e},{createOnigurumaEngine:t}]=await Promise.all([X(()=>import(`./core-Q3dXPkAg.js`),[]),X(()=>import(`./engine-oniguruma-CAQyYVrA.js`),[])]);return e({themes:[X(()=>import(`./github-light-EUqPIrTm.js`),[]),X(()=>import(`./github-dark-C-LZuMrd.js`),[])],langs:[],engine:t(X(()=>import(`./wasm-BnjxR4X6.js`),[]))})})(),ul}var fl=new Map;function pl(e,t){if(e.getLoadedLanguages().includes(t))return null;let n=fl.get(t);if(n)return n;let r=cl[t];if(!r)return null;let i=r().then(t=>e.loadLanguage(t.default)).finally(()=>fl.delete(t));return fl.set(t,i),i}async function ml(e,t,n){let r=ll(t);if(!r||e.length===0)return null;try{let t=await dl();return await pl(t,r),t.getLoadedLanguages().includes(r)?t.codeToTokensBase(e.join(`
|
|
88
88
|
`),{lang:r,theme:n?`github-dark`:`github-light`,includeExplanation:`scopeName`}):null}catch{return null}}var hl=/^(text|comment|string|keyword|storage|punctuation|constant\.(numeric|language|character)|variable\.language|support\.type\.primitive)\b/;function gl(e){let t=e.explanation;if(!t||t.length===0)return[{content:e.content,sym:!0}];let n=[];for(let e of t){let t=!e.scopes.some(e=>hl.test(e.scopeName)),r=n[n.length-1];r&&r.sym===t?r.content+=e.content:n.push({content:e.content,sym:t})}return n}var _l=400,vl=.3,yl=400,bl=3,xl=.65;function Sl(e){return e.match(/[A-Za-z0-9_$]+|\s+|[^A-Za-z0-9_$\s]/g)??[]}function Cl(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>new Uint32Array(r+1));for(let a=n-1;a>=0;a--){let n=i[a],o=i[a+1];for(let i=r-1;i>=0;i--)n[i]=e[a]===t[i]?o[i+1]+1:Math.max(o[i],n[i+1])}let a=[],o=0,s=0;for(;o<n&&s<r;)e[o]===t[s]?(a.push([o,s]),o++,s++):i[o+1][s]>=i[o][s+1]?o++:s++;return a}function wl(e,t){let n=[],r=0;for(let i=0;i<e.length;i++){let a=e[i].length;if(!t[i]){let e=n[n.length-1];e&&e.end===r?e.end=r+a:n.push({start:r,end:r+a})}r+=a}return n.filter(t=>e.length>0&&t.end>t.start)}function Tl(e){let t=[];for(let n of e){let e=t[t.length-1];e&&n.start-e.end<=bl?e.end=n.end:t.push({...n})}return t}var El=(e,t)=>t===0?0:e.reduce((e,t)=>e+(t.end-t.start),0)/t;function Dl(e,t){if(e.length>_l||t.length>_l)return null;let n=Sl(e),r=Sl(t);if(n.length===0||r.length===0)return null;let i=Cl(n,r),a=Array(n.length).fill(!1),o=Array(r.length).fill(!1),s=0;for(let[e,t]of i)a[e]=!0,o[t]=!0,s+=n[e].length;let c=2*s/(e.length+t.length);if(c<vl)return null;let l=Tl(wl(n,a)),u=Tl(wl(r,o));return El(l,e.length)>xl||El(u,t.length)>xl?{similarity:c,del:[],add:[]}:{similarity:c,del:l,add:u}}function Ol(e,t,n){let r=[];if(t.length===n.length){for(let i=0;i<t.length;i++){let a=Dl(e[t[i]].text,e[n[i]].text);a&&r.push([t[i],n[i],a])}return r}if(t.length*n.length>yl)return r;let i=[];for(let r of t)for(let t of n){let n=Dl(e[r].text,e[t].text);n&&i.push({d:r,a:t,cmp:n})}i.sort((e,t)=>t.cmp.similarity-e.cmp.similarity);let a=new Set,o=new Set;for(let{d:e,a:t,cmp:n}of i)a.has(e)||o.has(t)||(a.add(e),o.add(t),r.push([e,t,n]));return r}function kl(e){let t=e.map(()=>null),n=0;for(;n<e.length;){if(e[n].kind!==`del`){n++;continue}let r=[];for(;n<e.length&&e[n].kind===`del`;)r.push(n++);let i=[];for(;n<e.length&&e[n].kind===`add`;)i.push(n++);if(i.length!==0)for(let[n,a,o]of Ol(e,r,i))o.del.length>0&&(t[n]=o.del),o.add.length>0&&(t[a]=o.add)}return t}function Al(e,t,n){if(!n||n.length===0)return[{text:e,changed:!1}];let r=[],i=0,a=(t,n,i)=>{if(n<=t)return;let a=e.slice(t,n),o=r[r.length-1];o&&o.changed===i?o.text+=a:r.push({text:a,changed:i})};for(let r of n){let n=Math.max(0,r.start-t),o=Math.min(e.length,r.end-t);o<=0||n>=e.length||o<=n||(a(i,n,!1),a(n,o,!0),i=Math.max(i,o))}return a(i,e.length,!1),r}function jl(e,t){let n=new Set(e.flatMap(e=>e.hunks.map(e=>e.id))),r=new Set(e.map(e=>e.path)),i=new Map,a=new Map,o=new Map,s=[],c=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])};for(let l of t){let t=l.anchor;if(t.kind===`changeset`)s.push(l);else if(t.kind===`layer`)c(o,t.layerId,l);else if(t.kind===`file`)r.has(t.path)?c(a,t.path,l):s.push(l);else if(n.has(t.hunkId))c(i,t.hunkId,l);else{let n=Ml(e,t);n===null?r.has(t.path)?c(a,t.path,l):s.push(l):c(i,n,l)}}return{byHunk:i,byFile:a,byLayer:o,changeset:s}}function Ml(e,t){let n=e.find(e=>e.path===t.path);return n?n.hunks.find(e=>Ll(e.lines,t)!==-1)?.id??null:null}function Nl(e,t){let n=new Map;for(let r of e){let e=[...t.byFile.get(r.path)??[]];for(let n of r.hunks)e.push(...t.byHunk.get(n.id)??[]);e.length>0&&n.set(r.path,e)}return n}function Pl(e,t,n){return n.kind===`del`?n.oldNo===null?null:{kind:`hunk`,hunkId:e,path:t,side:`old`,line:n.oldNo}:n.newNo===null?null:{kind:`hunk`,hunkId:e,path:t,side:`new`,line:n.newNo}}function Fl(e,t,n,r,i){let a=Math.max(0,Math.min(r,i)),o=Math.min(n.length-1,Math.max(r,i)),s=null;for(let r=a;r<=o&&!s;r++)s=Pl(e,t,n[r]);if(!s)return null;let c=e=>s.side===`old`?e.kind===`add`?null:e.oldNo:e.kind===`del`?null:e.newNo,l=s.line;for(let e=o;e>a;e--){let t=c(n[e]);if(t!==null){l=t;break}}return l>s.line?{...s,endLine:l}:s}function Il(e,t,n){return e.findIndex(e=>t===`old`?e.kind!==`add`&&e.oldNo===n:e.kind!==`del`&&e.newNo===n)}function Ll(e,t){return Il(e,t.side,t.line)}function Rl(e,t){if(t.endLine!==void 0){let n=Il(e,t.side,t.endLine);if(n!==-1)return n}return Ll(e,t)}function zl(e,t){let n=new Map;for(let r of t){if(r.anchor.kind!==`hunk`)continue;let t=Rl(e,r.anchor),i=n.get(t);i?i.push(r):n.set(t,[r])}return n}function Bl(e,t){let n=new Set;for(let r of t){let t=r.anchor;if(t.kind!==`hunk`||t.endLine===void 0)continue;let i=Ll(e,t),a=Rl(e,t);if(i!==-1&&a!==-1)for(let e=Math.min(i,a);e<=Math.max(i,a);e++)n.add(e)}return n}function Vl(e,t){let n=new Set;for(let r of t){let t=r.anchor;if(t.kind!==`hunk`||t.endLine===void 0)continue;let i=Ll(e,t),a=Rl(e,t);i!==-1&&a!==-1&&n.add(Math.min(i,a))}return n}function Hl(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r.kind===`context`){t.push({left:{line:r,idx:n},right:{line:r,idx:n}}),n++;continue}let i=[],a=[];for(;n<e.length&&e[n].kind===`del`;)i.push({line:e[n],idx:n}),n++;for(;n<e.length&&e[n].kind===`add`;)a.push({line:e[n],idx:n}),n++;let o=Math.max(i.length,a.length);for(let e=0;e<o;e++)t.push({left:i[e]??null,right:a[e]??null})}return t}function Ul({gap:e}){if(e.remaining<=0)return null;let t=(e,t)=>{e.stopPropagation(),t()};if(e.remaining<=20)return(0,S.jsx)(`span`,{className:`gap-x`,children:(0,S.jsx)(`button`,{type:`button`,className:`gap-btn`,"data-tip":`expand all (${e.remaining} hidden ${e.remaining===1?`line`:`lines`})`,"aria-label":`expand all ${e.remaining} hidden lines`,onClick:n=>t(n,e.onAll),children:(0,S.jsx)(H,{name:`unfold`,size:`sm`})})});let n=e.canUp&&e.canDown;return(0,S.jsxs)(`span`,{className:`gap-x${n?` gap-x-2`:``}`,children:[e.canDown&&(0,S.jsx)(`button`,{type:`button`,className:`gap-btn`,"data-tip":`expand down (20 lines)`,"aria-label":`expand down`,onClick:n=>t(n,e.onDown),children:(0,S.jsx)(H,{name:`down`,size:n?`xs`:`sm`})}),e.canUp&&(0,S.jsx)(`button`,{type:`button`,className:`gap-btn`,"data-tip":`expand up (20 lines)`,"aria-label":`expand up`,onClick:n=>t(n,e.onUp),children:(0,S.jsx)(H,{name:`up`,size:n?`xs`:`sm`})})]})}function Wl({onCollapse:e}){return(0,S.jsx)(`button`,{type:`button`,className:`gap-fold`,"data-tip":`hide expanded lines`,"aria-label":`hide expanded lines`,onClick:t=>{t.stopPropagation(),e()},children:(0,S.jsx)(H,{name:`fold`,size:`sm`})})}var Gl=`couldn't read more context; the file may have changed since`;function Kl({gap:e}){return(0,S.jsx)(`div`,{className:`gap-band`,children:(0,S.jsx)(`table`,{className:`hunk-lines`,children:(0,S.jsx)(`tbody`,{children:(0,S.jsx)(`tr`,{className:`hunk-boundary${e.merged?` hunk-boundary-merged`:``}`,children:(0,S.jsx)(`td`,{colSpan:4,children:(0,S.jsxs)(`span`,{className:`hunk-boundary-bar`,children:[!e.merged&&(0,S.jsx)(Ul,{gap:e}),(e.merged||e.expanded)&&(0,S.jsx)(Wl,{onCollapse:e.onCollapse}),e.failed&&(0,S.jsx)(`span`,{className:`hunk-expand-failed`,role:`status`,children:Gl})]})})})})})})}function ql(e,t){let n=Lo(),[r,i]=(0,x.useState)([]);return(0,x.useEffect)(()=>{let r=!1,a=e.filter(e=>e.kind!==`add`),o=e.filter(e=>e.kind!==`del`);return Promise.all([ml(a.map(e=>e.text),t,n),ml(o.map(e=>e.text),t,n)]).then(([t,n])=>{if(r)return;let a=0,o=0;i(e.map(e=>e.kind===`add`?n?.[o++]??null:(e.kind===`del`||o++,t?.[a++]??null)))}).catch(()=>{}),()=>{r=!0}},[e,t,n]),r}function Jl({line:e,tokens:t,ranges:n}){if(!t)return(0,S.jsx)(S.Fragment,{children:Al(e.text,0,n??null).map((e,t)=>e.changed?(0,S.jsx)(`span`,{className:`word-changed`,children:e.text},t):(0,S.jsx)(`span`,{children:e.text},t))});let r=0;return(0,S.jsx)(S.Fragment,{children:t.map((e,t)=>{let i=e.color?{color:e.color}:void 0;return gl(e).map((e,a)=>{let o=r;r+=e.content.length;let s=e.sym?void 0:`nosym`,c=Al(e.content,o,n??null);return c.length===1&&!c[0].changed?(0,S.jsx)(`span`,{style:i,className:s,children:e.content},`${t}:${a}`):(0,S.jsx)(`span`,{style:i,className:s,children:c.map((e,t)=>e.changed?(0,S.jsx)(`span`,{className:`word-changed`,children:e.text},t):(0,S.jsx)(`span`,{children:e.text},t))},`${t}:${a}`)})})})}var Yl={add:`+`,del:`−`,context:` `};function Xl(e,t){return{"data-side":t,"data-old":e.oldNo??void 0,"data-new":e.newNo??void 0}}function Zl(){return(0,S.jsx)(`span`,{className:`line-range-glyph`,"aria-hidden":`true`,children:(0,S.jsx)(H,{name:`chat`,size:`sm`})})}function Ql(e,t,n,...r){let i=e=>e!==void 0&&r.some(t=>t!==void 0&&e.has(t)),a=n!=null&&r.includes(n);return`${i(e)?` line-sel`:``}${i(t)?` line-ranged`:``}${a?` line-focus`:``}`}function $l(e,t){if(e)return n=>{n.button===0&&(n.preventDefault(),e(t,n.shiftKey))}}function eu({onClick:e}){return(0,S.jsx)(`button`,{type:`button`,className:`line-comment-btn`,"data-tip":`comment on this line; drag down to take more lines`,"aria-label":`comment on this line, or drag down to comment on a range`,onClick:t=>{t.stopPropagation(),t.shiftKey||e()},children:(0,S.jsx)(H,{name:`plus`,size:`sm`})})}function tu({lines:e,tokens:t,ranges:n,extraFor:r,extraClass:i,onComment:a,onRowClick:o,focusRow:s,onGutterDown:c,onLineEnter:l,selRows:u,rangeRows:d,rangeStarts:f,boundary:p}){return(0,S.jsx)(`table`,{className:`hunk-lines`,children:(0,S.jsxs)(`tbody`,{children:[p,e.map((e,p)=>{let m=r?.(p),h=$l(c,p);return(0,S.jsxs)(x.Fragment,{children:[(0,S.jsxs)(`tr`,{className:`line line-${e.kind}${Ql(u,d,s,p)}`,onMouseEnter:l?()=>l(p):void 0,onClick:o?()=>o(p):void 0,children:[(0,S.jsxs)(`td`,{className:`line-no`,onMouseDown:h,children:[f?.has(p)&&(0,S.jsx)(Zl,{}),a&&(0,S.jsx)(eu,{onClick:()=>a(p)}),e.oldNo??``]}),(0,S.jsx)(`td`,{className:`line-no`,onMouseDown:h,children:e.newNo??``}),(0,S.jsx)(`td`,{className:`line-marker`,children:Yl[e.kind]}),(0,S.jsx)(`td`,{className:`line-code`,...Xl(e,e.kind===`del`?`base`:`head`),children:(0,S.jsx)(Jl,{line:e,tokens:t[p]??null,ranges:n?.[p]})})]}),m&&(0,S.jsx)(`tr`,{className:`thread-row${i?.(p)??``}`,children:(0,S.jsx)(`td`,{colSpan:4,children:m})})]},p)})]})})}function nu({lines:e,tokens:t,ranges:n,extraFor:r,extraClass:i,onComment:a,onRowClick:o,focusRow:s,onGutterDown:c,onLineEnter:l,selRows:u,rangeRows:d,rangeStarts:f,boundary:p}){let m=Hl(e),h=e=>o&&e!==void 0?()=>o(e):void 0,g=e=>l&&e!==void 0?()=>l(e):void 0;return(0,S.jsxs)(`table`,{className:`hunk-lines hunk-lines-split`,children:[(0,S.jsxs)(`colgroup`,{children:[(0,S.jsx)(`col`,{className:`split-col-no`}),(0,S.jsx)(`col`,{}),(0,S.jsx)(`col`,{className:`split-col-no`}),(0,S.jsx)(`col`,{})]}),(0,S.jsxs)(`tbody`,{children:[p,m.map((e,o)=>{let l=e.left?r?.(e.left.idx):null,p=e.right&&e.right.idx!==e.left?.idx?r?.(e.right.idx):null;return(0,S.jsxs)(x.Fragment,{children:[(0,S.jsxs)(`tr`,{className:`line${Ql(u,d,s,e.left?.idx,e.right?.idx)}`,children:[(0,S.jsxs)(`td`,{className:`line-no`,onMouseDown:e.left?$l(c,e.left.idx):void 0,onMouseEnter:g(e.left?.idx),onClick:h(e.left?.idx),children:[e.left&&f?.has(e.left.idx)&&(0,S.jsx)(Zl,{}),a&&e.left&&(0,S.jsx)(eu,{onClick:()=>a(e.left.idx)}),e.left?.line.oldNo??``]}),(0,S.jsx)(`td`,{className:`line-half line-half-${e.left?.line.kind??`empty`}`,...e.left&&Xl(e.left.line,`base`),onMouseEnter:g(e.left?.idx),onClick:h(e.left?.idx),children:e.left&&(0,S.jsx)(Jl,{line:e.left.line,tokens:t[e.left.idx]??null,ranges:n?.[e.left.idx]})}),(0,S.jsxs)(`td`,{className:`line-no`,onMouseDown:e.right?$l(c,e.right.idx):void 0,onMouseEnter:g(e.right?.idx),onClick:h(e.right?.idx),children:[e.right&&f?.has(e.right.idx)&&(0,S.jsx)(Zl,{}),a&&e.right&&(0,S.jsx)(eu,{onClick:()=>a(e.right.idx)}),e.right?.line.newNo??``]}),(0,S.jsx)(`td`,{className:`line-half line-half-${e.right?.line.kind??`empty`}`,...e.right&&Xl(e.right.line,`head`),onMouseEnter:g(e.right?.idx),onClick:h(e.right?.idx),children:e.right&&(0,S.jsx)(Jl,{line:e.right.line,tokens:t[e.right.idx]??null,ranges:n?.[e.right.idx]})})]}),(l||p)&&(0,S.jsx)(`tr`,{className:`thread-row${l&&e.left&&i?.(e.left.idx)||p&&e.right&&i?.(e.right.idx)||``}`,children:(0,S.jsxs)(`td`,{colSpan:4,children:[l,p]})})]},o)})]})]})}function ru({hunk:e,fresh:t=!1,changedSinceReview:n=!1,changedSinceViewed:r=!1,viewed:i=!1,selected:a=!1,onSelect:o,viewMode:s=`unified`,linesAbove:c,linesBelow:l,gapAbove:u=null,threads:d=[],reviewActions:f,agentConnected:p,workingOn:m,queuedOn:h,composeRequested:g=!1,onComposeHandled:_}){let[v,y]=(0,x.useState)(null),[b,C]=(0,x.useState)(null),[w,T]=(0,x.useState)(null);(0,x.useEffect)(()=>{a||T(null)},[a]);let E=(0,x.useMemo)(()=>(c?.length??0)===0&&(l?.length??0)===0?e.lines:[...c??[],...e.lines,...l??[]],[c,l,e.lines]),D=ql(E,e.path),O=(0,x.useMemo)(()=>kl(E),[E]);(0,x.useEffect)(()=>{if(!g)return;let e=w??E.findIndex(e=>e.kind!==`context`),t=e===-1?0:e;y({at:t,edge:t}),_?.()},[g]);let[k,A]=(0,x.useState)(``),[j,M]=(0,x.useState)(void 0),ee=()=>{y(null),A(``),M(void 0)};(0,x.useEffect)(()=>{if(!b)return;let e=()=>{C(null),y({at:b.start,edge:b.end})};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[b]);let N=f?(e,t)=>{if(t&&v){y({at:v.at,edge:e});return}C({start:e,end:e})}:void 0,P=b?e=>C(t=>t&&t.end!==e?{...t,end:e}:t):void 0,F=zl(E,d),te=F.get(-1)??[],ne=(0,x.useMemo)(()=>Bl(E,d),[E,d]),re=(0,x.useMemo)(()=>Vl(E,d),[E,d]),[I,ie]=(0,x.useState)(null),ae=(0,x.useMemo)(()=>{let e=b??(v?{start:v.at,end:v.edge}:null),t=new Set(I?.rows??[]);if(e)for(let n=Math.min(e.start,e.end);n<=Math.max(e.start,e.end);n++)t.add(n);return t},[b,v,I]),oe=t=>{if(!f)return null;let n=Fl(e.id,e.path,E,t.at,t.edge);if(!n)return null;let r=`${e.path.slice(e.path.lastIndexOf(`/`)+1)}:${mt(n)}`,i=e=>e?{kind:`changeset`}:n;return(0,S.jsx)(_c,{title:`Comment on ${r}`,placeholder:`Leave a comment…`,scope:{label:r,canWiden:!0,adjust:{up:t.edge>0?()=>y({at:t.at,edge:t.edge-1}):void 0,down:t.edge<E.length-1?()=>y({at:t.at,edge:t.edge+1}):void 0}},agentConnected:p,draft:k,onDraft:A,draftIntent:j,onDraftIntent:M,onSubmit:(e,t,n,r)=>{r?f.create(i(t),e,n,{audience:r}):f.create(i(t),e,n),ee()},onSend:(e,t,n)=>{f.create(i(t),e,n).then(e=>f.send(e.id)),ee()},onCancel:ee})},se=e=>{let t=F.get(e);return!t||Bl(E,t).size===0?``:` thread-row-ranged${I?.idx===e?` thread-row-lit`:``}`},ce=e=>{let t=F.get(e),n=v!==null&&Math.max(v.at,v.edge)===e?oe(v):null;if(!t&&!n)return null;let r=t?Bl(E,t):new Set;return(0,S.jsxs)(S.Fragment,{children:[t&&f&&(0,S.jsx)(`div`,{className:`thread-anchor-scope`,onMouseEnter:r.size>0?()=>ie({idx:e,rows:r}):void 0,onMouseLeave:r.size>0?()=>ie(null):void 0,children:(0,S.jsx)(Nc,{threads:t,actions:f,agentConnected:p,workingOn:m,queuedOn:h})}),n]})},le=n&&!i,ue=[`hunk`];le&&ue.push(`hunk-since-review`),t&&ue.push(`hunk-fresh`),i&&ue.push(`hunk-viewed`),a&&ue.push(`hunk-selected`);let de=e.lines.filter(e=>e.kind!==`add`).length,fe=e.lines.filter(e=>e.kind!==`del`).length,L=u?.merged??!1,R=!le&&r&&(0,S.jsx)(`span`,{className:`hunk-badge`,children:`changed since you read it`}),z=(0,S.jsx)(`tr`,{className:`hunk-boundary${L?` hunk-boundary-merged`:``}`,title:le?`the agent changed this since your last review`:void 0,children:(0,S.jsx)(`td`,{colSpan:4,children:(0,S.jsxs)(`span`,{className:`hunk-boundary-bar`,children:[u&&!L&&(0,S.jsx)(Ul,{gap:u}),u&&(L||u.expanded)&&(0,S.jsx)(Wl,{onCollapse:u.onCollapse}),!L&&(0,S.jsxs)(`span`,{className:`hunk-at`,title:`hunk position in the file`,children:[`@@ −`,e.oldStart,`,`,de,` +`,e.newStart,`,`,fe,` @@`,e.context!==void 0&&(0,S.jsxs)(`span`,{className:`hunk-at-scope`,children:[` `,e.context]})]}),u?.failed&&(0,S.jsx)(`span`,{className:`hunk-expand-failed`,role:`status`,children:Gl}),R]})})});return(0,S.jsxs)(`div`,{className:ue.join(` `),"data-hunk-id":e.id,onClick:()=>o?.(e.id),children:[s===`split`?(0,S.jsx)(nu,{lines:E,tokens:D,ranges:O,extraFor:ce,extraClass:se,onComment:f?e=>y({at:e,edge:e}):void 0,onRowClick:f?T:void 0,focusRow:w,onGutterDown:N,onLineEnter:P,selRows:ae,rangeRows:ne,rangeStarts:re,boundary:z}):(0,S.jsx)(tu,{lines:E,tokens:D,ranges:O,extraFor:ce,extraClass:se,onComment:f?e=>y({at:e,edge:e}):void 0,onRowClick:f?T:void 0,focusRow:w,onGutterDown:N,onLineEnter:P,selRows:ae,rangeRows:ne,rangeStarts:re,boundary:z}),te.length>0&&f&&(0,S.jsx)(Nc,{threads:te,actions:f,agentConnected:p,workingOn:m,queuedOn:h})]})}function iu(e,t){return`/api/file?path=${encodeURIComponent(e)}&side=${t}`}function au({file:e}){let t=e.status!==`added`,n=e.status!==`deleted`,r=e.oldPath??e.path;return(0,S.jsxs)(`div`,{className:`image-diff`,children:[t&&(0,S.jsxs)(`figure`,{className:`image-side image-side-base`,children:[(0,S.jsx)(`img`,{src:iu(r,`base`),alt:`${r} (base)`}),(0,S.jsx)(`figcaption`,{children:`base`})]}),n&&(0,S.jsxs)(`figure`,{className:`image-side image-side-head`,children:[(0,S.jsx)(`img`,{src:iu(e.path,`head`),alt:`${e.path} (head)`}),(0,S.jsx)(`figcaption`,{children:`head`})]})]})}function ou(e){return e.status!==`deleted`&&/\.(md|markdown)$/i.test(e.path)}function su({path:e,onClose:t}){let[n,r]=(0,x.useState)(null),[i,a]=(0,x.useState)(!1);return(0,x.useEffect)(()=>{let t=!1;return(async()=>{try{let n=await fetch(`/api/file?path=${encodeURIComponent(e)}&side=head`);if(!n.ok)throw Error(`/api/file → ${n.status}`);let i=await n.text();t||r(i)}catch{t||a(!0)}})(),()=>{t=!0}},[e]),(0,S.jsx)(jt,{title:e,className:`md-preview`,onClose:t,children:i?(0,S.jsx)(`div`,{className:`file-stub`,children:`couldn't read this file; it may have just changed on disk`}):n===null?(0,S.jsxs)(`div`,{"aria-hidden":`true`,children:[(0,S.jsx)(`div`,{className:`shimmer`}),(0,S.jsx)(`div`,{className:`shimmer`}),(0,S.jsx)(`div`,{className:`shimmer shimmer-short`})]}):(0,S.jsx)(uc,{className:`markdown md-doc`,text:n,docPath:e})})}function cu({navHidden:e,onToggleNav:t,left:n,total:r,hunksRead:i,hunksTotal:a,hunkAt:o=0,hunkCount:s=0,query:c=``,onClearQuery:l,hideReviewed:u,onHideReviewed:d,hideTests:f,onHideTests:p,testCount:m,onlyChanged:h,onOnlyChanged:g,changedCount:_,viewMode:v,onSetViewMode:y,allCollapsed:b,onToggleCollapseAll:x,stats:C,layer:w}){let T=r-n,E=w?w.progress:a!==void 0&&i!==void 0&&a>0?i/a:r===0?0:T/r,D=n===0?`all reviewed`:`${T} of ${r} files`,O=m>0||f,k=_>0||h,A=T>0||u,j=`${m} test ${m===1?`file`:`files`}`,M=c.trim();return(0,S.jsxs)(`div`,{className:`pane-bar`,children:[t&&(0,S.jsx)(`button`,{type:`button`,className:`pane-icon pane-nav`,onClick:t,"data-tip":`${e?`Show`:`Hide`} the file list (b)`,"aria-label":`${e?`Show`:`Hide`} the file list`,"aria-pressed":!e,children:(0,S.jsx)(H,{name:`sidebar`,size:`md`})}),E!==null&&(0,S.jsx)(`span`,{className:`prog-track prog-track-pane`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{style:{width:`${Math.round(E*100)}%`}})}),w?(0,S.jsx)(`span`,{className:`pane-left`,title:w.title,children:w.text}):(0,S.jsx)(`span`,{className:`pane-left`,title:`${T} of ${r} files marked reviewed`,children:D}),C&&!w&&(0,S.jsxs)(`span`,{className:`pane-size`,title:`lines added and removed across the changeset`,children:[C.additions>0&&(0,S.jsxs)(`span`,{className:`stat-add`,children:[`+`,C.additions.toLocaleString(`en-US`)]}),C.deletions>0&&(0,S.jsxs)(`span`,{className:`stat-del`,children:[`−`,C.deletions.toLocaleString(`en-US`)]})]}),o>0&&s>0&&(0,S.jsxs)(`span`,{className:`pane-at`,title:`the selected hunk — j / k move it`,children:[`hunk `,o,` / `,s]}),(0,S.jsx)(`span`,{className:`grow`}),!w&&M!==``&&l&&(0,S.jsxs)(`button`,{type:`button`,className:`pane-q`,title:`Showing only files matching “${M}”; click to clear`,"aria-label":`Clear the file filter “${M}”`,onClick:l,children:[(0,S.jsx)(H,{name:`search`,size:`sm`}),(0,S.jsx)(`span`,{className:`pane-q-word`,children:M}),(0,S.jsx)(H,{name:`x`,size:`sm`})]}),!w&&k&&(0,S.jsx)(lu,{on:h,onChange:g,label:_>0?`Only ${_} since review`:`Only since review`,onLabel:_>0?`only ${_} since review`:void 0}),!w&&A&&(0,S.jsx)(lu,{on:u,onChange:d,label:T>0?`Hide ${T} reviewed`:`Hide reviewed`,onLabel:T>0?`${T} reviewed hidden`:void 0}),O&&(0,S.jsx)(lu,{on:f,onChange:p,label:m>0?`Hide ${j}`:`Hide tests`,onLabel:m>0?`${j} hidden`:void 0}),(0,S.jsx)(`span`,{className:`pane-sep`}),(0,S.jsxs)(`span`,{className:`pane-modes`,role:`group`,"aria-label":`Diff layout`,children:[(0,S.jsx)(`button`,{type:`button`,className:`pane-icon`,"aria-pressed":v===`unified`,"data-tip":`Unified diff (u)`,"aria-label":`Unified diff`,onClick:()=>y(`unified`),children:(0,S.jsx)(H,{name:`unified`,size:`sm`})}),(0,S.jsx)(`button`,{type:`button`,className:`pane-icon`,"aria-pressed":v===`split`,"data-tip":`Split diff (u)`,"aria-label":`Split diff`,onClick:()=>y(`split`),children:(0,S.jsx)(H,{name:`split`,size:`sm`})})]}),(0,S.jsx)(`button`,{type:`button`,className:`pane-icon`,"aria-pressed":b,"data-tip":`${b?`Expand`:`Collapse`} all files`,"aria-label":`${b?`Expand`:`Collapse`} all files`,onClick:x,children:(0,S.jsx)(H,{name:`fold`,size:`sm`})}),w&&(w.prev||w.next)&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`pane-sep`}),(0,S.jsxs)(`span`,{className:`ch-pager`,children:[w.prev&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Previous layer: ${w.prev.title} ([)`,"aria-label":`Previous layer: ${w.prev.title}`,onClick:w.prev.onGo,children:[`‹ `,(0,S.jsx)(`span`,{className:`ch-pager-t`,children:w.prev.title})]}),w.next&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-sm`,title:`Next layer: ${w.next.title} (])`,"aria-label":`Next layer: ${w.next.title}`,onClick:w.next.onGo,children:[(0,S.jsx)(`span`,{className:`ch-pager-t`,children:w.next.title}),` ›`,` `,(0,S.jsx)(`span`,{className:`kbd`,"aria-hidden":`true`,children:`]`})]})]})]})]})}function lu({on:e,onChange:t,label:n,onLabel:r}){return(0,S.jsxs)(`button`,{type:`button`,className:`pane-sw${e?` pane-sw-on`:``}`,role:`switch`,"aria-checked":e,onClick:()=>t(!e),children:[(0,S.jsx)(`span`,{className:`pane-track`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{})}),e&&r?r:n]})}var uu=e=>e.toLocaleString(`en-US`);function du({read:e,total:t,excludedTests:n,excludedUnchanged:r,stats:i,unsent:a,onFinish:o,onIncludeExcluded:s,onDismiss:c,shape:l}){let u=n+r,d=a!==void 0&&a>0?a:0,f=u===0?`That's the whole changeset`:`That's everything you asked to see`,p=t===0?1:Math.min(1,(u===0?t:e)/t),m=(0,S.jsxs)(`div`,{className:`done-stats`,children:[(0,S.jsxs)(`span`,{className:`done-stat`,children:[(0,S.jsx)(`span`,{className:`done-n`,children:u===0?uu(t):`${e} of ${t}`}),` `,t===1?`file`:`files`,` read`]}),u===0&&i&&(i.additions>0||i.deletions>0)&&(0,S.jsxs)(`span`,{className:`done-stat done-size`,children:[i.additions>0&&(0,S.jsxs)(`span`,{className:`stat-add`,children:[`+`,uu(i.additions)]}),i.deletions>0&&(0,S.jsxs)(`span`,{className:`stat-del`,children:[`−`,uu(i.deletions)]})]}),d>0&&(0,S.jsxs)(`span`,{className:`done-stat done-unsent`,role:`img`,"aria-label":`${d} comment${d===1?``:`s`} waiting to go back to your agent`,title:`${d} comment${d===1?``:`s`} waiting to go back to your agent`,children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),d]})]}),h=(0,S.jsxs)(`div`,{className:`done-meter`,children:[(0,S.jsx)(`div`,{className:`done-bar`,"aria-hidden":`true`,children:(0,S.jsx)(`i`,{style:{"--p":p}})}),m]}),g=u>0&&(0,S.jsxs)(`div`,{className:`done-caveat`,children:[(0,S.jsx)(H,{name:`eye-off`,size:`sm`}),(0,S.jsxs)(`span`,{className:`done-caveat-text`,children:[n>0&&(0,S.jsxs)(S.Fragment,{children:[n,` test `,n===1?`file was`:`files were`,` hidden`]}),n>0&&r>0&&`, and `,r>0&&(0,S.jsxs)(S.Fragment,{children:[r,` `,r===1?`file is`:`files are`,` outside this round`]}),`; nobody reviewed `,u===1?`it`:`them`,`.`]}),s&&(0,S.jsxs)(`button`,{type:`button`,className:`done-caveat-act`,onClick:s,children:[`Review `,u===1?`it`:`them`,` too`]})]}),_=(0,S.jsx)(`div`,{className:l===`full`?`empty-acts`:`done-acts`,children:o&&(0,S.jsx)(`button`,{type:`button`,className:l===`full`?`btn btn-primary`:`btn btn-primary btn-sm`,onClick:o,children:`Finish review`})});return l===`docked`?(0,S.jsxs)(`div`,{className:`done-card`,role:`status`,children:[(0,S.jsxs)(`div`,{className:`done-card-row`,children:[(0,S.jsx)(pu,{}),(0,S.jsxs)(`span`,{className:`done-said`,children:[(0,S.jsx)(`span`,{className:`done-head`,children:f}),m]}),_,c&&(0,S.jsx)(`button`,{type:`button`,className:`done-close`,"data-tip":`Dismiss`,"aria-label":`Dismiss`,onClick:c,children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]}),g]}):(0,S.jsxs)(`div`,{className:`pane-done`,children:[(0,S.jsx)(pu,{drawn:!0}),(0,S.jsx)(`h2`,{children:f}),h,g,_]})}var fu=[0,1,2,3,4,5,6,7];function pu({drawn:e=!1}){return(0,S.jsxs)(`span`,{className:`done-seal${e?` done-seal-drawn`:``}`,"aria-hidden":`true`,children:[e&&(0,S.jsx)(`span`,{className:`done-spark`,children:fu.map(e=>(0,S.jsx)(`i`,{},e))}),e?(0,S.jsx)(`svg`,{className:`done-tick`,viewBox:`0 0 24 24`,width:`26`,height:`26`,"aria-hidden":`true`,children:(0,S.jsx)(`path`,{d:`M5 12.5 L10 17.5 L19 7`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})}):(0,S.jsx)(H,{name:`check`,size:`md`})]})}function mu({sha:e,subject:t,threads:n,onClear:r,onDismiss:i,shape:a}){let[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1),u=us(),d=u&&u.state!==`open`?u:null,f=()=>{s(!0),l(!1),r().catch(()=>{s(!1),l(!0)})},p=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`landed-sha`,children:e.slice(0,7)}),t!==``&&(0,S.jsxs)(`span`,{className:`landed-subject`,children:[` “`,t,`”`]})]}),m=n===0?`its review record`:`its ${n===1?`thread`:`${n} threads`} and guide`,h=o?`Clearing…`:n===0?d?`Clear the review`:`Start fresh`:d?`Clear ${n===1?`the thread`:`${n} threads`}`:`Start fresh: clear ${n===1?`the thread`:`${n} threads`}`,g=d&&(d.state===`merged`?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`b`,{children:`Merged`}),` as `,(0,S.jsx)(`span`,{className:`landed-sha`,children:e.slice(0,7)}),`. The diff is what shipped, and comments still post to GitHub.`]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`b`,{children:`Closed`}),` without merging. The diff stays to read, and comments still post to GitHub.`]})),_=c&&(0,S.jsx)(`p`,{className:`cov-note cov-note-error`,children:`Couldn't clear the review; the server may be down. Nothing was deleted; try again.`});return a===`docked`&&d?(0,S.jsxs)(`div`,{className:`landed-strip landed-strip-${d.state}`,role:`status`,children:[(0,S.jsx)(H,{name:`pr`,size:`sm`}),(0,S.jsx)(`span`,{className:`landed-strip-text`,children:g}),(0,S.jsx)(`button`,{type:`button`,className:`landed-strip-act`,disabled:o,title:`Deletes the threads and guide; Diffo drops the checkout when the server exits`,onClick:f,children:h}),(0,S.jsx)(`button`,{type:`button`,className:`done-close`,"data-tip":`Keep them`,"aria-label":`Keep the review as it is`,onClick:i,children:(0,S.jsx)(H,{name:`x`,size:`sm`})}),c&&(0,S.jsx)(`span`,{className:`landed-strip-err`,children:`Couldn't clear; nothing was deleted.`})]}):a===`docked`?(0,S.jsxs)(`div`,{className:`landed-card`,role:`status`,children:[(0,S.jsx)(`span`,{className:`landed-seal`,"aria-hidden":`true`,children:(0,S.jsx)(H,{name:`check`,size:`md`})}),(0,S.jsxs)(`span`,{className:`landed-said`,children:[`The previous review landed in `,p,`; `,m,` `,n===0?`is`:`are`,` still here, under this new changeset.`]}),(0,S.jsx)(`div`,{className:`landed-acts`,children:(0,S.jsx)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,disabled:o,onClick:f,children:h})}),(0,S.jsx)(`button`,{type:`button`,className:`done-close`,"data-tip":`Keep them`,"aria-label":`Keep the previous review's threads`,onClick:i,children:(0,S.jsx)(H,{name:`x`,size:`sm`})})]}):(0,S.jsxs)(`div`,{className:`empty-state landed-full`,children:[(0,S.jsx)(H,{name:`check`,size:`lg`}),g?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`h2`,{children:[`This pull request `,d.state===`merged`?`merged`:`closed`]}),(0,S.jsxs)(`p`,{children:[g,` Clear `,m,` when you are done, and Diffo drops the checkout.`]})]}):(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`h2`,{children:`This review landed`}),(0,S.jsxs)(`p`,{children:[`Commit `,p,` took the whole changeset;`,` `,n===0?`${m} belongs`:`${m} belong`,` to that round. Clear the slate and the next changeset starts its own review.`]})]}),(0,S.jsxs)(`div`,{className:`empty-acts`,children:[(0,S.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:o,onClick:f,children:h}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:i,children:`Keep them`})]}),_]})}function hu({layer:e,filesShown:t,comments:n}){let r=e.summary?J(e.summary,e.knownPaths):null,[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(null),c=e.id===null?[]:n?.partition.byLayer.get(e.id)??[],l=e.id===null?null:{kind:`layer`,layerId:e.id,title:e.title},u=t=>{let n=Po(t.target);n&&(t.preventDefault(),e.onJump(n.path,n.line))},d=t===0,f=!!(e.decisions&&e.decisions.length>0&&e.onOpenDecision),p=r!==null||e.missing.length>0||d,m=n!==void 0&&l!==null;return(0,S.jsxs)(`section`,{className:`ch-head`,"aria-label":`${e.kicker}: ${e.title}`,children:[(0,S.jsxs)(`div`,{className:`ch-head-top`,children:[(0,S.jsx)(`div`,{className:`ch-head-kicker`,children:e.kicker}),m&&!i&&(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-ghost btn-sm ch-head-ask`,onClick:()=>a(!0),children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),`Comment on this layer`]})]}),(0,S.jsxs)(`h2`,{children:[e.title,e.mechanical&&(0,S.jsx)(`span`,{className:`ch-kind`,title:`changes no behaviour; files are folded, expand one to check`,children:`mechanical`})]}),(p||f)&&(0,S.jsxs)(`div`,{className:`ch-head-body`,children:[p&&(0,S.jsxs)(`div`,{className:`ch-head-about`,children:[r&&(0,S.jsx)(`div`,{onClick:u,children:(0,S.jsx)(uc,{text:r,className:`cmt-body markdown ch-summary`,paths:e.knownPaths})}),e.missing.length>0&&(0,S.jsxs)(`div`,{className:`ch-head-files`,children:[(0,S.jsx)(`span`,{className:`ch-head-missing`,children:`not in the changeset now:`}),e.missing.map(e=>(0,S.jsx)(`span`,{className:`ch-chip ch-chip-done`,title:`${e}, not in the changeset now`,children:e},e))]}),d&&e.listed===0&&(0,S.jsxs)(`div`,{className:`ch-head-empty`,children:[`Nothing this layer lists is in the changeset right now. Move on with`,` `,(0,S.jsx)(`span`,{className:`kbd`,children:`]`}),`.`]}),d&&e.listed>0&&e.hidden===e.listed&&(0,S.jsxs)(`div`,{className:`ch-head-empty`,children:[e.hidden===1?`The one file`:`All ${e.hidden} files`,` in this layer`,` `,e.hidden===1?`is a test`:`are tests`,`, hidden by `,(0,S.jsx)(`b`,{children:`Hide tests`}),` on the bar. Move on with `,(0,S.jsx)(`span`,{className:`kbd`,children:`]`}),`.`]})]}),f&&(0,S.jsx)(il,{decisions:e.decisions,open:e.openDecision??null,onOpen:e.onOpenDecision,onJump:e.onJump,onComment:m?t=>{s({label:`decision`,text:e.decisions[t].decision.text}),a(!0)}:void 0})]}),m&&(c.length>0||i)&&(0,S.jsxs)(`div`,{className:`ch-head-threads`,children:[c.length>0&&(0,S.jsx)(Nc,{threads:c,actions:n.actions,showContext:!0,agentConnected:n.agentConnected,workingOn:n.workingOn,queuedOn:n.queuedOn,links:n.links}),i&&(0,S.jsx)(_c,{citing:o??void 0,title:`Comment on this layer`,placeholder:`Ask about this step, or say what should change in it…`,scope:{label:`layer “${e.title}”`,canWiden:!1},fixedAudience:`agent`,agentConnected:n.agentConnected,onSubmit:(e,t,r)=>{n.actions.create(l,e,r),a(!1),s(null)},onSend:(e,t,r)=>{n.actions.create(l,e,r).then(e=>n.actions.send(e.id)),a(!1),s(null)},onCancel:()=>{a(!1),s(null)}})]})]})}var gu={added:`added`,deleted:`deleted`,renamed:`renamed`};function _u({file:e,viewed:t,collapsed:n=!1,onToggle:r,commentCount:i=0,sinceCount:a=0,note:o,onComment:s,onToggleFileViewed:c}){let[l,u]=(0,x.useState)(!1),[d,f]=(0,x.useState)(!1),p=(0,x.useRef)(void 0);(0,x.useEffect)(()=>()=>clearTimeout(p.current),[]);let m=0,h=0;for(let t of e.hunks)for(let e of t.lines)e.kind===`add`?m++:e.kind===`del`&&h++;let g=mo(e,t),_=e.path.lastIndexOf(`/`),v=gu[e.status],y=e=>e.stopPropagation();return(0,S.jsxs)(`div`,{className:`file-header`,onClick:r,children:[(0,S.jsx)(`button`,{type:`button`,className:`file-chevron chevron${n?` chevron-shut`:``}`,"aria-expanded":!n,"data-tip":`${n?`Expand`:`Collapse`} this file`,"aria-label":`${n?`Expand`:`Collapse`} ${e.path}`,children:(0,S.jsx)(H,{name:`chev`})}),(0,S.jsxs)(`span`,{className:`file-path`,children:[e.status===`renamed`&&e.oldPath&&(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(`span`,{className:`file-oldpath`,children:e.oldPath}),` → `]}),_!==-1&&(0,S.jsx)(`span`,{className:`file-dir`,children:(0,S.jsx)(`bdi`,{children:e.path.slice(0,_+1)})}),(0,S.jsx)(`span`,{className:`file-base`,children:e.path.slice(_+1)})]}),v&&(0,S.jsx)(`span`,{className:`file-status file-status-${e.status}`,children:v}),a>0&&(0,S.jsxs)(`span`,{className:`file-since`,title:`since your last review; reading it settles it`,children:[`the agent changed`,` `,a===e.hunks.length?`this`:`${a} ${a===1?`hunk`:`hunks`}`]}),o&&(0,S.jsx)(`span`,{className:`ch-file-note`,title:o,children:o}),(0,S.jsx)(`button`,{type:`button`,className:`ghb file-copy`,"data-tip":l?`Copied`:`Copy path`,"aria-label":`Copy path`,onClick:t=>{y(t),wt(e.path).then(()=>{u(!0),clearTimeout(p.current),p.current=setTimeout(()=>u(!1),1500)})},children:(0,S.jsx)(H,{name:l?`check`:`copy`,size:`sm`})}),(0,S.jsx)(`span`,{className:`grow`}),(m>0||h>0)&&(0,S.jsxs)(`span`,{className:`dstat`,children:[m>0&&(0,S.jsxs)(`span`,{className:`stat-add`,children:[`+`,m]}),h>0&&(0,S.jsxs)(`span`,{className:`stat-del`,children:[`−`,h]})]}),ou(e)&&(0,S.jsxs)(`button`,{type:`button`,className:`file-preview-btn`,title:`Read this file rendered`,"aria-label":`Preview ${e.path} rendered`,onClick:e=>{y(e),f(!0)},children:[(0,S.jsx)(H,{name:`book`,size:`sm`}),`Preview`]}),c&&(0,S.jsxs)(`button`,{type:`button`,className:`file-viewed-toggle`,"aria-pressed":g,title:`mark this whole file read`,onClick:e=>{y(e),c()},children:[(0,S.jsx)(Y,{state:g}),`Viewed`]}),s&&i>0&&(0,S.jsxs)(`button`,{type:`button`,className:`ghb file-comment-btn`,title:`${i} ${i===1?`thread`:`threads`} on this file`,"aria-label":`Comment on this file`,onClick:e=>{y(e),s()},children:[(0,S.jsx)(H,{name:`chat`,size:`sm`}),(0,S.jsx)(`span`,{className:`ghb-badge`,children:i})]}),(0,S.jsx)(`span`,{onClick:y,children:(0,S.jsx)(Ha,{label:`More file actions`,triggerClassName:`ghb`,children:t=>(0,S.jsxs)(S.Fragment,{children:[s&&(0,S.jsx)(Ua,{icon:`chat`,onClick:()=>{t(),s()},children:`Comment on this file`}),(0,S.jsx)(Ua,{icon:`copy`,onClick:()=>{t(),wt(e.path)},children:`Copy path`}),(0,S.jsx)(Ua,{icon:`fold`,kbd:`o`,onClick:()=>{t(),r?.()},children:n?`Expand file`:`Collapse file`})]})})}),d&&(0,S.jsx)(`span`,{onClick:y,children:(0,S.jsx)(su,{path:e.path,onClose:()=>f(!1)})})]})}function vu(e){return{fingerprint:e,headLines:null,exp:new Map,failed:new Set}}function yu(e){let t=(0,x.useMemo)(()=>Zc(e),[e]),n=(0,x.useMemo)(()=>`${e.newLineCount??``}#${e.hunks.map(e=>e.id).join(`
|
|
89
89
|
`)}`,[e]),[r,i]=(0,x.useState)(()=>vu(n));r.fingerprint!==n&&i(vu(n));let a=r.fingerprint===n?r:vu(n),o=async(t,r)=>{let o=a.headLines;if(o===null)try{let t=await fetch(`/api/file?path=${encodeURIComponent(e.path)}&side=head`);if(!t.ok)throw Error(`/api/file → ${t.status}`);let n=await t.text();o=n.endsWith(`
|
|
90
90
|
`)?n.slice(0,-1).split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk-FOHPRMQF-DzxwRta7.js";import{w as e}from"./mermaid-parser.core-
|
|
1
|
+
import"./chunk-FOHPRMQF-DzxwRta7.js";import{w as e}from"./mermaid-parser.core-QCdEYrye.js";export{e as createInfoServices};
|
package/dist/client/assets/{infoDiagram-VRGFBTTK-D1SckQLr.js → infoDiagram-VRGFBTTK-BuEHO71F.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./mermaid-parser.core-
|
|
1
|
+
import{n as e}from"./mermaid-parser.core-QCdEYrye.js";import{n as t}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as n}from"./src-BvmeK_-w.js";import{c as r}from"./chunk-O7XYJQB3-DKVir5ql.js";import{a as i}from"./mermaid.core-BRH8LAdQ.js";var a={parse:t(async t=>{let r=await e(`info`,t);n.debug(r)},`parse`)},o={version:`12.0.0`},s={parser:a,db:{getVersion:t(()=>o.version,`getVersion`)},renderer:{draw:t((e,t,a)=>{n.debug(`rendering info diagram
|
|
2
2
|
`+e);let o=i(t);r(o,100,400,!0),o.append(`g`).append(`text`).attr(`x`,100).attr(`y`,40).attr(`class`,`version`).attr(`font-size`,32).style(`text-anchor`,`middle`).text(`v${a}`)},`draw`)}};export{s as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-
|
|
1
|
+
import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-BvmeK_-w.js";import{H as t,U as n,a as r,c as i,q as a,s as o,v as s,w as c,x as l,y as u}from"./chunk-O7XYJQB3-DKVir5ql.js";import{p as d}from"./chunk-ZIGJFQKS-D5CFKrxE.js";import{t as f}from"./rough.esm-Dy-Kn_BL.js";import{a as p}from"./mermaid.core-BRH8LAdQ.js";var m=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[1,4],r=[1,14],i=[1,12],a=[1,13],o=[6,7,8],s=[1,20],c=[1,18],l=[1,19],u=[6,7,11],d=[1,6,13,14],f=[1,23],p=[1,24],m=[1,6,7,11,13,14],h={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:`error`,6:`SPACELINE`,7:`NL`,8:`ISHIKAWA`,11:`EOF`,13:`SPACELIST`,14:`TEXT`},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 6:case 7:return r;case 15:r.addNode(a[s-1].length,a[s].trim());break;case 16:r.addNode(0,a[s].trim())}},`anonymous`),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:r,7:[1,10],9:9,12:11,13:i,14:a},t(o,[2,3]),{1:[2,2]},t(o,[2,4]),t(o,[2,5]),{1:[2,6],6:r,12:15,13:i,14:a},{6:r,9:16,12:11,13:i,14:a},{6:s,7:c,10:17,11:l},t(u,[2,18],{14:[1,21]}),t(u,[2,16]),t(u,[2,17]),{6:s,7:c,10:22,11:l},{1:[2,7],6:r,12:15,13:i,14:a},t(d,[2,14],{7:f,11:p}),t(m,[2,8]),t(m,[2,9]),t(m,[2,10]),t(u,[2,15]),t(d,[2,13],{7:f,11:p}),t(m,[2,11]),t(m,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;this.parseError=typeof g.yy.parseError==`function`?g.yy.parseError:Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};h.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|