@smartmemory/compose 0.2.50-beta → 0.2.51-beta
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/.claude/skills/compose/SKILL.md +24 -1
- package/.claude/skills/compose/references/hermes-tools.md +80 -0
- package/README.md +1 -1
- package/bin/compose.js +310 -52
- package/dist/assets/App-CT0vXPgd.js +724 -0
- package/dist/assets/_baseUniq-CsOHc_iS.js +1 -0
- package/dist/assets/{arc-DeHak63Z.js → arc-BXht3LyE.js} +1 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-BV1r86-w.js +36 -0
- package/dist/assets/blockDiagram-DXYQGD6D-BgcMJjAR.js +132 -0
- package/dist/assets/{browser-DW2JlJCC.js → browser-CnKiSnlr.js} +6 -6
- package/dist/assets/{c4Diagram-AAUBKEIU-BsFJmPuS.js → c4Diagram-AHTNJAMY-nBIRLJTv.js} +1 -1
- package/dist/assets/channel-Dd4XaiYv.js +1 -0
- package/dist/assets/{chunk-4BX2VUAB-XO4S2_89.js → chunk-4BX2VUAB-CNmGyhrp.js} +1 -1
- package/dist/assets/chunk-4TB4RGXK-MLT7I7w4.js +206 -0
- package/dist/assets/{chunk-55IACEB6-CtFSLInj.js → chunk-55IACEB6-D8KuKVLa.js} +1 -1
- package/dist/assets/{chunk-2J33WTMH-AEu6HIoY.js → chunk-EDXVE4YY-TPlt1bS2.js} +1 -1
- package/dist/assets/{chunk-FMBD7UC4-BMGd_Y9a.js → chunk-FMBD7UC4-tYY8xcjr.js} +1 -1
- package/dist/assets/chunk-OYMX7WX6-yBPwT1AT.js +231 -0
- package/dist/assets/{chunk-QZHKN3VN-DHhUJ8RK.js → chunk-QZHKN3VN-B4Wfybww.js} +1 -1
- package/dist/assets/{chunk-ND2GUHAM-BlrOECEr.js → chunk-YZCP3GAM-DE6_5aqh.js} +1 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DshSQDF9.js +1 -0
- package/dist/assets/classDiagram-v2-HSJHXN6E-DshSQDF9.js +1 -0
- package/dist/assets/clone-CBsbNGAa.js +1 -0
- package/dist/assets/{cose-bilkent-S5V4N54A-C3M0mZqk.js → cose-bilkent-S5V4N54A-DzzRyJtB.js} +1 -1
- package/dist/assets/dagre-KV5264BT-CTcTVGdU.js +4 -0
- package/dist/assets/diagram-5BDNPKRD-qR6mc8kJ.js +10 -0
- package/dist/assets/diagram-G4DWMVQ6-CUcGXyNb.js +24 -0
- package/dist/assets/diagram-MMDJMWI5-B68cPonH.js +43 -0
- package/dist/assets/diagram-TYMM5635-q8Id8eFG.js +24 -0
- package/dist/assets/{erDiagram-TEJ5UH35-AMDitV0b.js → erDiagram-SMLLAGMA-CtxJi57K.js} +1 -1
- package/dist/assets/{flowDiagram-I6XJVG4X-C0t2ZGQv.js → flowDiagram-DWJPFMVM-BzzO4JYU.js} +1 -1
- package/dist/assets/ganttDiagram-T4ZO3ILL-Dn0wIyhR.js +292 -0
- package/dist/assets/gitGraphDiagram-UUTBAWPF-tnNFXfMM.js +106 -0
- package/dist/assets/graph-DZe55uk8.js +331 -0
- package/dist/assets/graph-Tq_bs_r0.js +1 -0
- package/dist/assets/index-8UhRLbGq.js +123 -0
- package/dist/assets/index-CRqB9els.css +1 -0
- package/dist/assets/infoDiagram-42DDH7IO-BXLvLeS0.js +2 -0
- package/dist/assets/{ishikawaDiagram-YF4QCWOH-CCBwgjFs.js → ishikawaDiagram-UXIWVN3A-DWx-7BBy.js} +5 -5
- package/dist/assets/{journeyDiagram-JHISSGLW-zUJN38EU.js → journeyDiagram-VCZTEJTY-C42hXNha.js} +1 -1
- package/dist/assets/{kanban-definition-UN3LZRKU-BNxWi-8J.js → kanban-definition-6JOO6SKY-CEq930ew.js} +1 -1
- package/dist/assets/katex-DkKDou_j.js +257 -0
- package/dist/assets/layout-qtUgN9BC.js +1 -0
- package/dist/assets/{linear-CRH9b4g7.js → linear-D158F7OT.js} +1 -1
- package/dist/assets/min-hESxN-c0.js +1 -0
- package/dist/assets/{mindmap-definition-RKZ34NQL-DolYwq7Y.js → mindmap-definition-QFDTVHPH-d9SSh2nG.js} +7 -7
- package/dist/assets/mobile-1gVCT0OK.css +1 -0
- package/dist/assets/mobile-Chw8RWyH.js +17 -0
- package/dist/assets/pieDiagram-DEJITSTG-gglmeMav.js +30 -0
- package/dist/assets/quadrantDiagram-34T5L4WZ-CqFC_htU.js +7 -0
- package/dist/assets/{requirementDiagram-4Y6WPE33-DsXZ05jo.js → requirementDiagram-MS252O5E-B1ZFIotK.js} +1 -1
- package/dist/assets/sankeyDiagram-XADWPNL6-BvItvZt5.js +10 -0
- package/dist/assets/sequenceDiagram-FGHM5R23-CAIn5Z3U.js +157 -0
- package/dist/assets/stateDiagram-FHFEXIEX-CyJrGzib.js +1 -0
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-DprhF_Ho.js +1 -0
- package/dist/assets/{timeline-definition-PNZ67QCA-Bvnhw58e.js → timeline-definition-GMOUNBTQ-k_0vJQAK.js} +1 -1
- package/dist/assets/{vennDiagram-CIIHVFJN-5WnyjZqf.js → vennDiagram-DHZGUBPP-TZAW60b0.js} +4 -4
- package/dist/assets/wardley-RL74JXVD-DzQEoG6X.js +162 -0
- package/dist/assets/wardleyDiagram-NUSXRM2D-BAoVVIjZ.js +20 -0
- package/dist/assets/{xychartDiagram-2RQKCTM6-BCShes6B.js → xychartDiagram-5P7HB3ND-CynkZcUb.js} +1 -1
- package/dist/index.html +4 -4
- package/lib/build.js +272 -33
- package/lib/codex-preflight.js +151 -0
- package/lib/completion-writer.js +21 -1
- package/lib/feature-validator.js +5 -1
- package/lib/hooks-status.js +135 -0
- package/lib/install-agent-defs.js +22 -0
- package/lib/migrate-anon.js +277 -0
- package/lib/roadmap-parser.js +1 -1
- package/lib/test-bootstrap.js +165 -2
- package/lib/vocabulary-inject.js +103 -0
- package/package.json +2 -1
- package/pipelines/build-quick.stratum.yaml +433 -0
- package/pipelines/build.stratum.yaml +60 -3
- package/scripts/watch-server.sh +32 -0
- package/server/build-routes.js +89 -9
- package/server/build-stream-bridge.js +12 -0
- package/server/compose-mcp-tools.js +73 -1
- package/server/compose-mcp.js +27 -0
- package/server/feature-scaffold-routes.js +82 -0
- package/server/health-routes.js +261 -0
- package/server/qa-scope-routes.js +96 -0
- package/server/validate-routes.js +70 -0
- package/server/vision-routes.js +29 -0
- package/server/vision-server.js +21 -0
- package/dist/assets/App-Bxyif1yv.js +0 -706
- package/dist/assets/architectureDiagram-3BPJPVTR-C5Nkyl9y.js +0 -36
- package/dist/assets/blockDiagram-GPEHLZMM-BilnUBG2.js +0 -132
- package/dist/assets/channel-ZgbQ1k0u.js +0 -1
- package/dist/assets/chunk-727SXJPM-CZeBRpM9.js +0 -206
- package/dist/assets/chunk-AQP2D5EJ-_vmxcBc4.js +0 -231
- package/dist/assets/classDiagram-4FO5ZUOK-KXxOorUx.js +0 -1
- package/dist/assets/classDiagram-v2-Q7XG4LA2-KXxOorUx.js +0 -1
- package/dist/assets/dagre-BM42HDAG-DJlm4fEk.js +0 -4
- package/dist/assets/diagram-2AECGRRQ-BmcONQG5.js +0 -43
- package/dist/assets/diagram-5GNKFQAL-5JbWGIwd.js +0 -10
- package/dist/assets/diagram-KO2AKTUF-DAnIvyI0.js +0 -3
- package/dist/assets/diagram-LMA3HP47-Bmh7tvmI.js +0 -24
- package/dist/assets/diagram-OG6HWLK6-hnHVMNnk.js +0 -24
- package/dist/assets/ganttDiagram-6RSMTGT7-BPlM-BEN.js +0 -292
- package/dist/assets/gitGraphDiagram-PVQCEYII-Lv_YTxnb.js +0 -106
- package/dist/assets/graph-BBXaecIU.js +0 -331
- package/dist/assets/graph-CAnANduQ.js +0 -1
- package/dist/assets/index-BwLfbbOu.css +0 -1
- package/dist/assets/index-COq21Zym.js +0 -119
- package/dist/assets/infoDiagram-5YYISTIA-Dul1vdUm.js +0 -2
- package/dist/assets/katex-C5jXJg4s.js +0 -257
- package/dist/assets/layout-DGIYPm2g.js +0 -1
- package/dist/assets/mobile-Cag5dHlF.css +0 -1
- package/dist/assets/mobile-DwmxS_O4.js +0 -17
- package/dist/assets/pieDiagram-4H26LBE5-oxNfr2TX.js +0 -30
- package/dist/assets/quadrantDiagram-W4KKPZXB-BmZCvD-z.js +0 -7
- package/dist/assets/sankeyDiagram-5OEKKPKP-DsnYaawP.js +0 -40
- package/dist/assets/sequenceDiagram-3UESZ5HK-Dt5mu3g8.js +0 -162
- package/dist/assets/stateDiagram-AJRCARHV-BFR5ZINQ.js +0 -1
- package/dist/assets/stateDiagram-v2-BHNVJYJU-BDrQD8fR.js +0 -1
- package/dist/assets/wardley-L42UT6IY-CTxW4xow.js +0 -173
- package/dist/assets/wardleyDiagram-YWT4CUSO-K8Y1EOvb.js +0 -78
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function tt(e,a){for(var s=0;s<a.length;s++){const n=a[s];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(n,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Xs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vs(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var a=e.default;if(typeof a=="function"){var s=function n(){return this instanceof n?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};s.prototype=a.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),s}var je={exports:{}},re={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ae;function at(){if(Ae)return re;Ae=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function s(n,i,u){var o=null;if(u!==void 0&&(o=""+u),i.key!==void 0&&(o=""+i.key),"key"in i){u={};for(var l in i)l!=="key"&&(u[l]=i[l])}else u=i;return i=u.ref,{$$typeof:e,type:n,key:o,ref:i!==void 0?i:null,props:u}}return re.Fragment=a,re.jsx=s,re.jsxs=s,re}var Re;function nt(){return Re||(Re=1,je.exports=at()),je.exports}var t=nt(),ve={exports:{}},I={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var _e;function rt(){if(_e)return I;_e=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),p=Symbol.iterator;function h(c){return c===null||typeof c!="object"?null:(c=p&&c[p]||c["@@iterator"],typeof c=="function"?c:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function E(c,k,_){this.props=c,this.context=k,this.refs=w,this.updater=_||N}E.prototype.isReactComponent={},E.prototype.setState=function(c,k){if(typeof c!="object"&&typeof c!="function"&&c!=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,c,k,"setState")},E.prototype.forceUpdate=function(c){this.updater.enqueueForceUpdate(this,c,"forceUpdate")};function v(){}v.prototype=E.prototype;function T(c,k,_){this.props=c,this.context=k,this.refs=w,this.updater=_||N}var x=T.prototype=new v;x.constructor=T,C(x,E.prototype),x.isPureReactComponent=!0;var j=Array.isArray;function b(){}var y={H:null,A:null,T:null,S:null},S=Object.prototype.hasOwnProperty;function A(c,k,_){var $=_.ref;return{$$typeof:e,type:c,key:k,ref:$!==void 0?$:null,props:_}}function M(c,k){return A(c.type,k,c.props)}function P(c){return typeof c=="object"&&c!==null&&c.$$typeof===e}function L(c){var k={"=":"=0",":":"=2"};return"$"+c.replace(/[=:]/g,function(_){return k[_]})}var O=/\/+/g;function F(c,k){return typeof c=="object"&&c!==null&&c.key!=null?L(""+c.key):k.toString(36)}function Y(c){switch(c.status){case"fulfilled":return c.value;case"rejected":throw c.reason;default:switch(typeof c.status=="string"?c.then(b,b):(c.status="pending",c.then(function(k){c.status==="pending"&&(c.status="fulfilled",c.value=k)},function(k){c.status==="pending"&&(c.status="rejected",c.reason=k)})),c.status){case"fulfilled":return c.value;case"rejected":throw c.reason}}throw c}function q(c,k,_,$,D){var U=typeof c;(U==="undefined"||U==="boolean")&&(c=null);var G=!1;if(c===null)G=!0;else switch(U){case"bigint":case"string":case"number":G=!0;break;case"object":switch(c.$$typeof){case e:case a:G=!0;break;case m:return G=c._init,q(G(c._payload),k,_,$,D)}}if(G)return D=D(c),G=$===""?"."+F(c,0):$,j(D)?(_="",G!=null&&(_=G.replace(O,"$&/")+"/"),q(D,k,_,"",function(R){return R})):D!=null&&(P(D)&&(D=M(D,_+(D.key==null||c&&c.key===D.key?"":(""+D.key).replace(O,"$&/")+"/")+G)),k.push(D)),1;G=0;var W=$===""?".":$+":";if(j(c))for(var J=0;J<c.length;J++)$=c[J],U=W+F($,J),G+=q($,k,_,U,D);else if(J=h(c),typeof J=="function")for(c=J.call(c),J=0;!($=c.next()).done;)$=$.value,U=W+F($,J++),G+=q($,k,_,U,D);else if(U==="object"){if(typeof c.then=="function")return q(Y(c),k,_,$,D);throw k=String(c),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return G}function z(c,k,_){if(c==null)return c;var $=[],D=0;return q(c,$,"","",function(U){return k.call(_,U,D++)}),$}function ae(c){if(c._status===-1){var k=c._result;k=k(),k.then(function(_){(c._status===0||c._status===-1)&&(c._status=1,c._result=_)},function(_){(c._status===0||c._status===-1)&&(c._status=2,c._result=_)}),c._status===-1&&(c._status=0,c._result=k)}if(c._status===1)return c._result.default;throw c._result}var Q=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},K={map:z,forEach:function(c,k,_){z(c,function(){k.apply(this,arguments)},_)},count:function(c){var k=0;return z(c,function(){k++}),k},toArray:function(c){return z(c,function(k){return k})||[]},only:function(c){if(!P(c))throw Error("React.Children.only expected to receive a single React element child.");return c}};return I.Activity=f,I.Children=K,I.Component=E,I.Fragment=s,I.Profiler=i,I.PureComponent=T,I.StrictMode=n,I.Suspense=d,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,I.__COMPILER_RUNTIME={__proto__:null,c:function(c){return y.H.useMemoCache(c)}},I.cache=function(c){return function(){return c.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(c,k,_){if(c==null)throw Error("The argument must be a React element, but you passed "+c+".");var $=C({},c.props),D=c.key;if(k!=null)for(U in k.key!==void 0&&(D=""+k.key),k)!S.call(k,U)||U==="key"||U==="__self"||U==="__source"||U==="ref"&&k.ref===void 0||($[U]=k[U]);var U=arguments.length-2;if(U===1)$.children=_;else if(1<U){for(var G=Array(U),W=0;W<U;W++)G[W]=arguments[W+2];$.children=G}return A(c.type,D,$)},I.createContext=function(c){return c={$$typeof:o,_currentValue:c,_currentValue2:c,_threadCount:0,Provider:null,Consumer:null},c.Provider=c,c.Consumer={$$typeof:u,_context:c},c},I.createElement=function(c,k,_){var $,D={},U=null;if(k!=null)for($ in k.key!==void 0&&(U=""+k.key),k)S.call(k,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(D[$]=k[$]);var G=arguments.length-2;if(G===1)D.children=_;else if(1<G){for(var W=Array(G),J=0;J<G;J++)W[J]=arguments[J+2];D.children=W}if(c&&c.defaultProps)for($ in G=c.defaultProps,G)D[$]===void 0&&(D[$]=G[$]);return A(c,U,D)},I.createRef=function(){return{current:null}},I.forwardRef=function(c){return{$$typeof:l,render:c}},I.isValidElement=P,I.lazy=function(c){return{$$typeof:m,_payload:{_status:-1,_result:c},_init:ae}},I.memo=function(c,k){return{$$typeof:g,type:c,compare:k===void 0?null:k}},I.startTransition=function(c){var k=y.T,_={};y.T=_;try{var $=c(),D=y.S;D!==null&&D(_,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(b,Q)}catch(U){Q(U)}finally{k!==null&&_.types!==null&&(k.types=_.types),y.T=k}},I.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},I.use=function(c){return y.H.use(c)},I.useActionState=function(c,k,_){return y.H.useActionState(c,k,_)},I.useCallback=function(c,k){return y.H.useCallback(c,k)},I.useContext=function(c){return y.H.useContext(c)},I.useDebugValue=function(){},I.useDeferredValue=function(c,k){return y.H.useDeferredValue(c,k)},I.useEffect=function(c,k){return y.H.useEffect(c,k)},I.useEffectEvent=function(c){return y.H.useEffectEvent(c)},I.useId=function(){return y.H.useId()},I.useImperativeHandle=function(c,k,_){return y.H.useImperativeHandle(c,k,_)},I.useInsertionEffect=function(c,k){return y.H.useInsertionEffect(c,k)},I.useLayoutEffect=function(c,k){return y.H.useLayoutEffect(c,k)},I.useMemo=function(c,k){return y.H.useMemo(c,k)},I.useOptimistic=function(c,k){return y.H.useOptimistic(c,k)},I.useReducer=function(c,k,_){return y.H.useReducer(c,k,_)},I.useRef=function(c){return y.H.useRef(c)},I.useState=function(c){return y.H.useState(c)},I.useSyncExternalStore=function(c,k,_){return y.H.useSyncExternalStore(c,k,_)},I.useTransition=function(){return y.H.useTransition()},I.version="19.2.5",I}var $e;function it(){return $e||($e=1,ve.exports=rt()),ve.exports}var r=it();const lt=st(r),Qs=tt({__proto__:null,default:lt},[r]),Ne={},ot=(Ne==null?void 0:Ne.VITE_COMPOSE_API_TOKEN)||"";let He=null;function se(e){He=e||null}function ce(){return He||ot||""}function V(e={}){const a=ce();return a?{...e,"x-compose-token":a}:e}const de="compose:mobile:accessToken",oe="compose:mobile:refreshToken",ye="compose:mobile:accessExpiry";let ie=null,pe=null;function ct(e){pe=e}async function dt(){const e=localStorage.getItem(de),a=parseInt(localStorage.getItem(ye)||"0",10);return e&&a>Date.now()+3e4?(ce()!==e&&se(e),e):Be()}async function Be(){if(ie)return ie;const e=localStorage.getItem(oe);if(!e)throw new Error("NoRefreshToken");return ie=fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})}).then(async a=>{if(!a.ok)throw localStorage.removeItem(de),localStorage.removeItem(oe),localStorage.removeItem(ye),se(localStorage.getItem("compose:mobile:sensitiveToken")||null),pe==null||pe("cockpit"),new Error("RefreshFailed");const s=await a.json();return localStorage.setItem(de,s.access_token),localStorage.setItem(oe,s.refresh_token),localStorage.setItem(ye,String(Date.now()+s.expires_in*1e3)),se(s.access_token),s.access_token}).finally(()=>{ie=null}),ie}let ke=null,ue="cockpit";ct(e=>{ue=e});function Zs(e){ke=e??null}function Je(e){ue=e}function Ce(){return ue}async function B(e,a={}){if(ue==="mobile-paired")try{await dt()}catch{}const s={...a.headers||{}};ke&&(s["X-Compose-Workspace-Id"]=ke);const n=ce();n&&(ue==="mobile-paired"?s.Authorization=`Bearer ${n}`:s["x-compose-token"]=n);let i=await fetch(e,{...a,headers:s});if(i.status===401){if((await i.clone().json().catch(()=>({}))).code==="TokenExpired"){try{await Be()}catch{throw window.location.href="/m/pair",new Error("NeedsPairing")}i=await fetch(e,{...a,headers:{...s,Authorization:`Bearer ${ce()}`}})}if(i.status===401){const o=await i.clone().json().catch(()=>({}));if(o.code==="TokenExpired"||o.code==="TokenInvalid")throw window.location.href="/m/pair",new Error("NeedsPairing")}}return i}let Te=!1;function Ye(e){Te=!0}function ea(){return Te}function ut(){if(Ce()==="mobile-paired"){try{const e=localStorage.getItem(de);if(e)return e}catch{}return null}if(Te){const e=ce();if(e)return e}return null}function Ee(e){const a=ut();return a?`${e}?token=${encodeURIComponent(a)}`:e}function qe(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${e}`}function fe(){return Ee(qe("/ws/vision"))}function ta(){return Ee(qe("/ws/files"))}function mt(e){return Ee(e)}function ft(e){return e?/iPad|iPhone|iPod/.test(e)?"iOS":/Android/.test(e)?"Android":/Mac/.test(e)?"macOS":/Win/.test(e)?"Windows":/Linux/.test(e)?"Linux":"Unknown":"Unknown"}function ht(e){return e?/Edg/.test(e)?"Edge":/CriOS|Chrome/.test(e)?"Chrome":/FxiOS|Firefox/.test(e)?"Firefox":/Safari/.test(e)?"Safari":"Browser":"Browser"}function pt(e){const a=String(e).indexOf("?");if(a===-1)return null;try{return new URLSearchParams(String(e).slice(a+1)).get("code")||null}catch{return null}}function bt(){const[e,a]=r.useState(()=>{try{return new URLSearchParams(window.location.search||"").get("code")||null}catch{return null}}),[s,n]=r.useState(()=>{const p=typeof navigator<"u"&&navigator.userAgent||"";return`${ft(p)} (${ht(p)})`}),[i,u]=r.useState(!1),[o,l]=r.useState(null),[d,g]=r.useState(""),m=r.useCallback(p=>{const h=p.target.value;g(h);const N=pt(h);N&&(a(N),l(null))},[]),f=r.useCallback(async p=>{if(p==null||p.preventDefault(),!!e){u(!0),l(null);try{const h=await fetch("/api/auth/pair/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,device_name:s})}),N=await h.json().catch(()=>({}));if(!h.ok){const C=(N==null?void 0:N.error)||`HTTP ${h.status}`;l(`Pairing failed: ${C}. On your desktop, run \`compose remote pair\` to generate a new code.`);return}localStorage.setItem(de,N.access_token),localStorage.setItem(oe,N.refresh_token),localStorage.setItem(ye,String(Date.now()+N.expires_in*1e3)),se(N.access_token),Je("mobile-paired"),Ye(!0),window.location.href="/m/agents"}catch(h){l(`Pairing failed: ${h.message}. On your desktop, run \`compose remote pair\` to generate a new code.`)}finally{u(!1)}}},[e,s]);return e?t.jsxs("div",{className:"m-root","data-testid":"mobile-pair-code-screen",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Complete pairing"})}),t.jsxs("main",{className:"m-main m-pair-page",children:[t.jsx("p",{className:"m-pair-instructions",children:"Give this device a name so you can recognize it in the paired devices list."}),t.jsxs("form",{onSubmit:f,className:"m-pair-form",children:[t.jsxs("div",{className:"m-pair-field",children:[t.jsx("label",{htmlFor:"m-pair-device-name",className:"m-pair-label",children:"Device name"}),t.jsx("input",{id:"m-pair-device-name","data-testid":"mobile-pair-device-name-input",className:"m-pair-input",type:"text",value:s,onChange:p=>n(p.target.value),disabled:i,required:!0})]}),o&&t.jsx("p",{"data-testid":"mobile-pair-error",className:"m-pair-error",children:o}),t.jsx("button",{type:"submit","data-testid":"mobile-pair-submit-btn",className:"m-pair-btn",disabled:i||!s.trim(),children:i?"Pairing…":"Pair this device"})]})]})]}):t.jsxs("div",{className:"m-root","data-testid":"mobile-pair-codeless-screen",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Pair this device"})}),t.jsxs("main",{className:"m-main m-pair-page",children:[t.jsxs("p",{"data-testid":"mobile-pair-codeless-instructions",className:"m-pair-instructions",children:["This device is no longer paired (or pairing has expired). On your desktop, run ",t.jsx("code",{children:"compose remote pair"})," or open Cockpit → Pair mobile, then scan the new QR code. If your camera is unavailable, paste the pairing URL below:"]}),t.jsxs("div",{className:"m-pair-field",children:[t.jsx("label",{htmlFor:"m-pair-url-input",className:"m-pair-label",children:"Pairing URL"}),t.jsx("input",{id:"m-pair-url-input","data-testid":"mobile-pair-url-input",className:"m-pair-input",type:"text",placeholder:"https://your-host/m/pair?code=...",value:d,onChange:m,autoComplete:"off"})]}),o&&t.jsx("p",{"data-testid":"mobile-pair-error",className:"m-pair-error",children:o})]})]})}const yt=[{id:"explore_design",name:"Explore Design",agent:"claude",phase:"design",hasGate:!1},{id:"design_review",name:"Design Review",agent:"codex",phase:"design",hasGate:!1},{id:"design_gate",name:"Design Gate",agent:"human",phase:"design",hasGate:!0},{id:"prd",name:"PRD",agent:"claude",phase:"design",hasGate:!1},{id:"prd_review",name:"PRD Review",agent:"codex",phase:"design",hasGate:!1},{id:"prd_gate",name:"PRD Gate",agent:"human",phase:"design",hasGate:!0},{id:"architecture",name:"Architecture",agent:"claude",phase:"design",hasGate:!1},{id:"architecture_review",name:"Arch Review",agent:"codex",phase:"design",hasGate:!1},{id:"architecture_gate",name:"Arch Gate",agent:"human",phase:"design",hasGate:!0},{id:"blueprint",name:"Blueprint",agent:"claude",phase:"blueprint",hasGate:!1},{id:"verification",name:"Verification",agent:"claude",phase:"blueprint",hasGate:!1},{id:"blueprint_review",name:"BP Review",agent:"codex",phase:"blueprint",hasGate:!1},{id:"plan",name:"Plan",agent:"claude",phase:"implementation",hasGate:!1},{id:"plan_review",name:"Plan Review",agent:"codex",phase:"implementation",hasGate:!1},{id:"plan_gate",name:"Plan Gate",agent:"human",phase:"implementation",hasGate:!0},{id:"execute",name:"Execute",agent:"claude",phase:"implementation",hasGate:!1},{id:"review",name:"Review Loop",agent:"codex",phase:"implementation",hasGate:!1},{id:"coverage",name:"Coverage Sweep",agent:"claude",phase:"implementation",hasGate:!1},{id:"report",name:"Report",agent:"claude",phase:"ship",hasGate:!1},{id:"report_review",name:"Report Review",agent:"codex",phase:"ship",hasGate:!1},{id:"report_gate",name:"Report Gate",agent:"human",phase:"ship",hasGate:!0},{id:"docs",name:"Docs",agent:"claude",phase:"ship",hasGate:!1},{id:"ship",name:"Ship",agent:"claude",phase:"ship",hasGate:!1},{id:"ship_gate",name:"Ship Gate",agent:"human",phase:"ship",hasGate:!0}],gt=new Set(["complete","completed","aborted","failed","killed","done"]);function me(e){return gt.has(e)}function xt(e,a,s){const n=Array.isArray(a)?Object.fromEntries(a.map(o=>[o.id,o.status])):{},i=Array.isArray(a)?Object.fromEntries(a.map(o=>[o.id,o])):{},u=e.map(o=>{const l=i[o.id],d=l?{...o,...l}:{...o};return d.id===s&&!n[d.id]&&(d.status="active"),d});if(Array.isArray(a))for(const o of a)e.find(l=>l.id===o.id)||u.push({id:o.id,name:o.id.replace(/_/g," "),agent:"claude",phase:"implementation",...o});return u}function jt(e,a,s){if(!e)return!1;const{featureCode:n,status:i,currentStepId:u}=e;if(i!=="running"||!u||!u.endsWith("_gate"))return!1;const o=Array.isArray(s)?s:[],l=o.find(d=>d.featureCode===n)||o.find(d=>d.title===n)||o.find(d=>d.title&&d.title.startsWith(n+":"));return l?(Array.isArray(a)?a:[]).some(d=>d.itemId===l.id&&!d.resolvedAt):!1}const vt=[{id:"agents",label:"Agents",icon:"◇"},{id:"roadmap",label:"Roadmap",icon:"⚡"},{id:"builds",label:"Builds",icon:"⏵"},{id:"ideas",label:"Ideas",icon:"✦"}];function Nt({active:e,onSelect:a,badges:s}){return t.jsx("nav",{className:"m-bottom-nav",role:"tablist","aria-label":"Mobile navigation",children:vt.map(n=>{const i=s==null?void 0:s[n.id];return t.jsxs("button",{type:"button",className:"m-nav-btn",role:"tab","aria-pressed":e===n.id?"true":"false","aria-label":n.label,"data-tab":n.id,"data-testid":`mobile-nav-${n.id}`,onClick:()=>a(n.id),children:[t.jsxs("span",{className:"m-nav-icon-wrap",children:[t.jsx("span",{className:"m-nav-icon","aria-hidden":"true",children:n.icon}),i&&t.jsx("span",{className:`m-nav-badge m-nav-badge-${i.level||"info"}`,"data-testid":`mobile-nav-badge-${n.id}`,"aria-hidden":"true",children:i.count!=null?String(i.count):""})]}),t.jsx("span",{className:"m-nav-label",children:n.label})]},n.id)})})}function he({url:e,onMessage:a,onOpen:s,onClose:n,onError:i,maxBackoffMs:u=3e4}){let o=null,l=0,d=!1,g=null;function m(h){return typeof h=="function"?h():h}function f(){if(!d){try{o=new WebSocket(m(e))}catch(h){i==null||i(h),p();return}o.onopen=()=>{l=0,s==null||s(o)},o.onmessage=h=>a==null?void 0:a(h),o.onclose=()=>{n==null||n(),p()},o.onerror=h=>{i==null||i(h)}}}function p(){if(d||g)return;const h=Math.min(u,1e3*Math.pow(2,l++));g=setTimeout(()=>{g=null,f()},h)}return f(),{get socket(){return o},isOpen(){return(o==null?void 0:o.readyState)===1},send(h){(o==null?void 0:o.readyState)===1&&o.send(h)},close(){if(d=!0,g&&(clearTimeout(g),g=null),o){try{o.onclose=null,o.onerror=null,o.close()}catch{}o=null}}}}async function wt(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function St(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),o=r.useRef(!0),l=r.useCallback(async()=>{try{const d=await wt("/api/agents/tree");if(!o.current)return;a(Array.isArray(d==null?void 0:d.agents)?d.agents:[]),u(null)}catch(d){if(!o.current)return;u(d.message)}finally{o.current&&n(!1)}},[]);return r.useEffect(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const d=he({url:()=>fe(),onMessage:g=>{try{const m=JSON.parse(g.data);if(!m||!m.type)return;(m.type==="agentSpawned"||m.type==="agentStopped"||m.type==="agentStatusChanged"||m.type==="agentTreeUpdated")&&l()}catch{}}});return()=>{try{d.close()}catch{}}},[l]),{agents:e,loading:s,error:i,refetch:l}}const we={};function Ke(e){if(typeof window>"u"||!window.location)return e;const a=typeof import.meta<"u"&&(we==null?void 0:we.VITE_AGENT_PORT)||"4002";return`${window.location.protocol}//${window.location.hostname}:${a}${e}`}const kt=5e3,Ct={"/api/agent/session":"/api/agent/proxy/session","/api/agent/message":"/api/agent/proxy/message","/api/agent/interrupt":"/api/agent/proxy/interrupt","/api/agent/session/status":"/api/agent/proxy/session/status"};function We(e){return Ce()==="mobile-paired"?Ct[e]||e:Ke(e)}async function Pe(e,a){const s=await B(We(e),{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(a||{})});let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function Tt(){const[e,a]=r.useState(!1),[s,n]=r.useState(null),[i,u]=r.useState(!0),[o,l]=r.useState(null),[d,g]=r.useState(!1),m=r.useRef(!0),f=r.useCallback(async()=>{try{const C=await(await B(We("/api/agent/session/status"))).json().catch(()=>({}));if(!m.current)return;a(!!C.active),n(C.sessionId||null),l(null)}catch(N){if(!m.current)return;l(N.message)}finally{m.current&&u(!1)}},[]);r.useEffect(()=>{m.current=!0,f();const N=setInterval(f,kt);return()=>{m.current=!1,clearInterval(N)}},[f]);const p=r.useCallback(async N=>{const C=(N||"").trim();if(!C)throw new Error("message is empty");g(!0);try{const E=await Pe(s?"/api/agent/message":"/api/agent/session",{prompt:C});return f(),E}finally{g(!1)}},[s,f]),h=r.useCallback(async()=>Pe("/api/agent/interrupt",{}),[]);return{active:e,sessionId:s,loading:i,error:o,sending:d,sendMessage:p,interrupt:h,refresh:f}}function Et(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function At({agent:e,onOpen:a,onAfterKill:s}){const[n,i]=r.useState(!1),[u,o]=r.useState(null),l=e.agentId||e.id,d=e.status||"unknown",g=e.lastActivityAt||e.lastEventAt||e.startedAt||null,m=r.useCallback(async p=>{if(p==null||p.stopPropagation(),!!l){i(!0),o(null);try{const h=await B(`/api/agent/${encodeURIComponent(l)}/stop`,{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!h.ok){let N=null;try{N=await h.json()}catch{}throw new Error(N&&N.error||`HTTP ${h.status}`)}s==null||s(l)}catch(h){o(h.message)}finally{i(!1)}}},[l,s]),f=r.useCallback(()=>a==null?void 0:a(e),[a,e]);return t.jsxs("div",{className:"m-agent-card","data-testid":`mobile-agent-card-${l}`,role:"button",tabIndex:0,onClick:f,onKeyDown:p=>{p.key==="Enter"&&f()},children:[t.jsxs("div",{className:"m-agent-card-row",children:[t.jsx("div",{className:"m-agent-card-id",title:l,children:l||"(no id)"}),t.jsx("span",{className:"m-status-pill","data-status":d,children:d})]}),t.jsxs("div",{className:"m-agent-card-meta",children:[t.jsx("span",{className:"m-agent-card-time",children:Et(g)}),t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":`mobile-agent-kill-${l}`,disabled:n||d!=="running",onClick:m,children:n?"Killing…":"Kill"})]}),u&&t.jsx("div",{className:"m-agent-card-error",children:u})]})}const Rt=3e4,_t=5,$t=3e4;function Pt({url:e,onEvent:a,onOpen:s,onClose:n,onError:i,onRetry:u,onStall:o,onExhausted:l,namedEvents:d=["hydrate"],maxBackoffMs:g=Rt,maxRetries:m=_t,stallTimeoutMs:f=$t}){if(!e)throw new Error("createAgentStream: url is required");if(typeof EventSource>"u")return{close(){}};let p=null,h=!1,N=0,C=null,w=null;function E(){w&&clearTimeout(w),!h&&(w=setTimeout(()=>{o==null||o({elapsedMs:f})},f))}function v(){w&&(clearTimeout(w),w=null)}function T(b,y){if(E(),!!a)try{const S=JSON.parse(y);a(S,b)}catch{}}function x(){if(v(),h||C)return;if(N>=m){const y=new Error(`agent-stream: failed after ${m} retries`);i==null||i(y),h=!0;try{p==null||p.close()}catch{}p=null,n==null||n(),l==null||l();return}const b=Math.min(g,1e3*Math.pow(2,N));N+=1,u==null||u({attempt:N,maxRetries:m,nextBackoffMs:b}),C=setTimeout(()=>{C=null,j()},b)}function j(){if(!h){try{p=new EventSource(e)}catch(b){i==null||i(b),x();return}p.onopen=()=>{N=0,v(),s==null||s()},p.onmessage=b=>T("message",b.data);for(const b of d)p.addEventListener(b,y=>T(b,y.data));p.onerror=b=>{i==null||i(b instanceof Error?b:new Error("agent-stream error"));try{p==null||p.close()}catch{}p=null,n==null||n(),x()}}}return j(),{close(){h=!0,v(),C&&(clearTimeout(C),C=null);try{p==null||p.close()}catch{}p=null},reconnect(){h=!1,N=0,v(),C&&(clearTimeout(C),C=null);try{p==null||p.close()}catch{}p=null,j()}}}function It(){return typeof window>"u"||!window.location?"":Ce()==="mobile-paired"?mt("/api/agent/proxy/stream"):Ke("/api/agent/stream")}function Ot(e){return!e||typeof e!="object"?null:e.agentId||e.agent_id||e.id||null}function ze({url:e,agentId:a,max:s=500,enabled:n=!0}={}){const[i,u]=r.useState([]),[o,l]=r.useState(!1),d=r.useRef(null),g=r.useMemo(()=>e||It(),[e]);return r.useEffect(()=>{if(!n||!g)return;const f=Pt({url:g,onOpen:()=>l(!0),onClose:()=>l(!1),onEvent:p=>{u(h=>{const N=h.length>=s?h.slice(h.length-s+1):h.slice();return N.push(p),N})}});return d.current=f,()=>{try{f.close()}catch{}}},[g,n,s]),{events:r.useMemo(()=>a?i.filter(f=>Ot(f)===a):i,[i,a]),allEvents:i,connected:o}}function Lt(e,a){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${a})`}}function Mt({agent:e,onClose:a}){const s=(e==null?void 0:e.agentId)||(e==null?void 0:e.id),{events:n}=ze({agentId:s}),i=r.useRef(null),[u,o]=r.useState(!1),[l,d]=r.useState(null);r.useEffect(()=>{var m;(m=i.current)==null||m.scrollIntoView({behavior:"smooth"})},[n.length]);const g=r.useCallback(async()=>{if(s){o(!0),d(null);try{const m=await B(`/api/agent/${encodeURIComponent(s)}/stop`,{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!m.ok){let f=null;try{f=await m.json()}catch{}throw new Error(f&&f.error||`HTTP ${m.status}`)}}catch(m){d(m.message)}finally{o(!1)}}},[s]);return e?t.jsxs("div",{className:"m-overlay","data-testid":"mobile-agent-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:s,children:s}),t.jsx("span",{className:"m-status-pill","data-status":e.status,children:e.status||"unknown"})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:u,onClick:g,"data-testid":"mobile-agent-detail-kill",children:u?"Killing…":"Kill"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:a,"data-testid":"mobile-agent-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[n.length===0?t.jsx("div",{className:"m-empty",children:"No live events for this agent yet."}):n.map((m,f)=>t.jsx("div",{className:"m-agent-log-line",children:Lt(m,f)},f)),t.jsx("div",{ref:i})]}),l&&t.jsx("div",{className:"m-agent-card-error",children:l})]}):null}function Dt({session:e}){const{active:a,sessionId:s,sending:n,sendMessage:i}=e,[u,o]=r.useState(""),[l,d]=r.useState(null),g=r.useCallback(async m=>{if(m==null||m.preventDefault(),!!u.trim()){d(null);try{await i(u),o("")}catch(f){d(f.message)}}},[u,i]);return t.jsxs("div",{className:"m-session-card","data-testid":"mobile-interactive-session",children:[t.jsxs("div",{className:"m-session-card-row",children:[t.jsx("div",{className:"m-session-card-title",children:"Interactive session"}),t.jsx("span",{className:"m-status-pill","data-status":a?"in_progress":"planned",children:a?"active":"ready"})]}),t.jsx("div",{className:"m-session-card-id",children:s?`id: ${s}`:"No active session"}),t.jsxs("form",{className:"m-session-card-form",onSubmit:g,children:[t.jsx("input",{type:"text",className:"m-input",placeholder:a?"Message Claude…":"Start a new session…",value:u,onChange:m=>o(m.target.value),"data-testid":"mobile-interactive-session-input",disabled:n}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:n||!u.trim(),"data-testid":"mobile-interactive-session-send",children:n?"Sending…":"Send"})]}),l&&t.jsx("div",{className:"m-agent-card-error",children:l})]})}function Ut({gate:e,onOpen:a}){const s=e.id,n=e.flowId||e.flow||"",i=e.stepId||e.step||"",u=e.summary||e.comment||"",o=e.toPhase||e.fromPhase||"";return t.jsxs("div",{className:"m-gate-card","data-testid":`mobile-gate-card-${s}`,role:"button",tabIndex:0,onClick:()=>a==null?void 0:a(e),onKeyDown:l=>{l.key==="Enter"&&(a==null||a(e))},children:[t.jsxs("div",{className:"m-gate-card-row",children:[t.jsx("div",{className:"m-gate-card-title",children:n||s}),o&&t.jsx("span",{className:"m-status-pill","data-status":"in_progress",children:o})]}),t.jsx("div",{className:"m-gate-card-step",children:i}),u&&t.jsx("div",{className:"m-gate-card-summary",children:u})]})}const Ft=[{id:"approve",label:"Approve",kind:"primary"},{id:"revise",label:"Revise",kind:"warn"},{id:"kill",label:"Kill",kind:"danger"}];function Gt({gate:e,onResolve:a,onClose:s}){const[n,i]=r.useState(null),[u,o]=r.useState(""),[l,d]=r.useState(""),[g,m]=r.useState(!1),[f,p]=r.useState(null),h=r.useCallback(async N=>{if(N==null||N.preventDefault(),!n){p("Pick an outcome");return}if(n==="kill"&&!u.trim()){p("Reason is required when killing a gate");return}m(!0),p(null);try{await a(e.id,{outcome:n,reason:u.trim(),summary:l.trim()}),s==null||s()}catch(C){p(C.message)}finally{m(!1)}},[e,n,u,l,a,s]);return t.jsx("div",{className:"m-sheet-backdrop","data-testid":"mobile-gate-sheet",onClick:s,children:t.jsxs("div",{className:"m-sheet",role:"dialog","aria-modal":"true",onClick:N=>N.stopPropagation(),children:[t.jsxs("div",{className:"m-sheet-header",children:[t.jsx("div",{className:"m-sheet-title",children:"Resolve gate"}),t.jsxs("div",{className:"m-sheet-subtitle",children:[e.flowId,":",e.stepId]})]}),t.jsxs("form",{onSubmit:h,className:"m-sheet-body",children:[t.jsx("div",{className:"m-sheet-outcomes",role:"radiogroup","aria-label":"Outcome",children:Ft.map(N=>t.jsx("button",{type:"button",role:"radio","aria-checked":n===N.id,className:`m-btn m-btn-${N.kind} ${n===N.id?"m-btn-active":""}`,"data-testid":`mobile-gate-outcome-${N.id}`,onClick:()=>i(N.id),children:N.label},N.id))}),t.jsxs("label",{className:"m-field",children:[t.jsxs("span",{className:"m-field-label",children:["Reason ",n==="kill"?"(required)":"(optional)"]}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-reason",value:u,onChange:N=>o(N.target.value),rows:2})]}),t.jsxs("label",{className:"m-field",children:[t.jsx("span",{className:"m-field-label",children:"Summary (optional)"}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-summary",value:l,onChange:N=>d(N.target.value),rows:2})]}),f&&t.jsx("div",{className:"m-agent-card-error",children:f}),t.jsxs("div",{className:"m-sheet-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:s,disabled:g,children:"Cancel"}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:g||!n,"data-testid":"mobile-gate-submit",children:g?"Submitting…":"Submit"})]})]})]})})}function Ht({gates:e=[],gatesLoading:a=!1,resolveGate:s}){const{agents:n,loading:i,refetch:u}=St(),o=Tt(),[l,d]=r.useState(null),[g,m]=r.useState(null),f=r.useCallback(()=>{u(),d(null)},[u]);return t.jsxs("section",{"data-testid":"mobile-tab-agents",className:"m-agents-tab",children:[t.jsxs("div",{className:"m-section","data-testid":"mobile-section-spawned",children:[t.jsx("h2",{className:"m-section-title",children:"Spawned agents"}),i?t.jsx("div",{className:"m-empty",children:"Loading agents…"}):n.length===0?t.jsx("div",{className:"m-empty",children:"No spawned agents."}):t.jsx("div",{className:"m-stack",children:n.map(p=>t.jsx(At,{agent:p,onOpen:d,onAfterKill:f},p.agentId||p.id))})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-session",children:[t.jsx("h2",{className:"m-section-title",children:"Interactive session"}),t.jsx(Dt,{session:o})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-gates",children:[t.jsx("h2",{className:"m-section-title",children:"Pending gates"}),a?t.jsx("div",{className:"m-empty",children:"Loading gates…"}):e.length===0?t.jsx("div",{className:"m-empty",children:"No pending gates."}):t.jsx("div",{className:"m-stack",children:e.map(p=>t.jsx(Ut,{gate:p,onOpen:m},p.id))})]}),l&&t.jsx(Mt,{agent:l,onClose:()=>d(null)}),g&&t.jsx(Gt,{gate:g,onResolve:s,onClose:()=>m(null)})]})}const Bt=[{value:"planned",label:"planned"},{value:"in_progress",label:"in progress"},{value:"blocked",label:"blocked"},{value:"complete",label:"complete"},{value:"parked",label:"parked"},{value:"killed",label:"killed"}];function Jt({statuses:e=[],onToggleStatus:a,group:s="",groupOptions:n=[],onChangeGroup:i,keyword:u="",onChangeKeyword:o}){return t.jsxs("div",{className:"m-filter-bar","data-testid":"mobile-filter-bar",children:[t.jsx("div",{className:"m-filter-chips",role:"group","aria-label":"Status filter",children:Bt.map(l=>{const d=e.includes(l.value);return t.jsx("button",{type:"button",className:"m-filter-chip","aria-pressed":d,"data-testid":`mobile-filter-status-${l.value}`,onClick:()=>a==null?void 0:a(l.value),children:l.label},l.value)})}),t.jsxs("div",{className:"m-filter-row",children:[t.jsxs("select",{className:"m-filter-select","data-testid":"mobile-filter-group",value:s,onChange:l=>i==null?void 0:i(l.target.value),"aria-label":"Group filter",children:[t.jsx("option",{value:"",children:"All groups"}),n.map(l=>t.jsx("option",{value:l,children:l},l))]}),t.jsx("input",{type:"search",className:"m-filter-keyword","data-testid":"mobile-filter-keyword",placeholder:"Search title or description",value:u,onChange:l=>o==null?void 0:o(l.target.value),"aria-label":"Keyword filter"})]})]})}const Yt=new Set(["planned","in_progress","blocked","complete","partial","superseded","parked"]);function Xe({status:e,children:a}){const s=typeof e=="string"?e.toLowerCase():"",n=Yt.has(s)?s:"unknown",i=a??e??"unknown";return t.jsx("span",{className:"m-status-pill","data-status":n,children:i})}function qt(e,a=140){if(typeof e!="string")return"";const s=e.trim();return s.length<=a?s:s.slice(0,a-1).trimEnd()+"…"}function Kt({item:e,onSelect:a}){if(!e)return null;const s=e.title||e.id||"Untitled",n=e.status||"unknown",i=e.group||"",u=qt(e.description||"");return t.jsxs("button",{type:"button",className:"m-item-card","data-testid":`mobile-item-card-${e.id}`,onClick:()=>a==null?void 0:a(e),children:[t.jsxs("div",{className:"m-item-card-row",children:[t.jsx("div",{className:"m-item-card-title",children:s}),t.jsx(Xe,{status:n})]}),t.jsxs("div",{className:"m-item-card-meta",children:[i?t.jsx("span",{className:"m-item-card-group","data-testid":"mobile-item-group",children:i}):null,e.id?t.jsx("span",{className:"m-item-card-id",children:e.id}):null]}),u?t.jsx("div",{className:"m-item-card-desc",children:u}):null]})}const Wt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"],zt=["informs","blocks","supports","contradicts","implements"];function Xt({item:e,onClose:a,onSave:s,onDelete:n,allItems:i=[],addConnection:u,removeConnection:o,fetchItemDetail:l}){const d=r.useMemo(()=>({status:(e==null?void 0:e.status)||"planned",group:(e==null?void 0:e.group)||"",confidence:(e==null?void 0:e.confidence)??""}),[e]),[g,m]=r.useState(d.status),[f,p]=r.useState(d.group),[h,N]=r.useState(d.confidence),[C,w]=r.useState(!1),[E,v]=r.useState(!1),[T,x]=r.useState(!1),j=r.useRef(null),[b,y]=r.useState([]),[S,A]=r.useState(!1),[M,P]=r.useState(!1),[L,O]=r.useState(""),[F,Y]=r.useState("informs"),[q,z]=r.useState(!1),[ae,Q]=r.useState(null),K=r.useRef(null);if(r.useEffect(()=>{m(d.status),p(d.group),N(d.confidence),v(!1),y([]),P(!1),O(""),Y("informs"),Q(null),j.current&&clearTimeout(j.current),K.current&&clearTimeout(K.current)},[e==null?void 0:e.id,d.status,d.group,d.confidence]),r.useEffect(()=>{!(e!=null&&e.id)||!l||(A(!0),l(e.id).then(R=>{var H;R!=null&&R.ok&&Array.isArray((H=R.item)==null?void 0:H.connections)&&y(R.item.connections)}).finally(()=>A(!1)))},[e==null?void 0:e.id,l]),r.useEffect(()=>()=>{j.current&&clearTimeout(j.current),K.current&&clearTimeout(K.current)},[]),!e)return null;const c=g!==d.status||f!==d.group||String(h)!==String(d.confidence);function k(){v(!1),j.current&&clearTimeout(j.current)}function _(){E&&k(),ae!==null&&(Q(null),K.current&&clearTimeout(K.current))}const $=async()=>{if(!c||C)return;const R={};if(g!==d.status&&(R.status=g),f!==d.group&&(R.group=f),String(h)!==String(d.confidence)){const H=h===""?null:Number(h);H!==null&&Number.isFinite(H)?R.confidence=H:h===""&&(R.confidence=null)}w(!0);try{await(s==null?void 0:s(e.id,R))}finally{w(!1)}},D=async()=>{if(!E)v(!0),j.current=setTimeout(()=>{v(!1)},3e3);else{j.current&&clearTimeout(j.current),v(!1),x(!0);try{await(n==null?void 0:n(e.id))}finally{x(!1)}}},U=r.useMemo(()=>{const R=L.toLowerCase();return i.filter(H=>H.id===e.id?!1:R?H.id.toLowerCase().includes(R)||(H.title||"").toLowerCase().includes(R):!0)},[i,e==null?void 0:e.id,L]),G=async R=>{z(!0);const H=await(u==null?void 0:u({fromId:e.id,toId:R.id,type:F}));if(H!=null&&H.ok){const X=H.connection||{id:`local-${Date.now()}`,fromId:e.id,toId:R.id,type:F};y(ne=>[...ne,X]),P(!1),O(""),Y("informs")}z(!1)},W=async(R,H)=>{if(ae!==H)K.current&&clearTimeout(K.current),Q(H),K.current=setTimeout(()=>{Q(null)},3e3);else{K.current&&clearTimeout(K.current),Q(null);const X=await(o==null?void 0:o(R.id));X!=null&&X.ok&&y(ne=>ne.filter(ge=>ge.id!==R.id))}};function J(R){const H=i.find(X=>X.id===R);return(H==null?void 0:H.title)||R}return t.jsx("div",{className:"m-sheet-overlay",role:"dialog","aria-modal":"true","data-testid":"mobile-item-sheet",children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close",onClick:a,"data-testid":"mobile-item-sheet-close","aria-label":"Close",children:"×"}),t.jsxs("div",{className:"m-sheet-title-row",children:[t.jsx("div",{className:"m-sheet-title",children:e.title||e.id}),t.jsx(Xe,{status:g})]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-status",children:"Status"}),t.jsx("select",{id:"m-sheet-status",className:"m-sheet-input","data-testid":"mobile-item-sheet-status",value:g,onChange:R=>{_(),m(R.target.value)},children:Wt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-group",children:"Group"}),t.jsx("input",{id:"m-sheet-group",type:"text",className:"m-sheet-input","data-testid":"mobile-item-sheet-group",value:f,onChange:R=>{_(),p(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-confidence",children:"Confidence (0–4)"}),t.jsx("input",{id:"m-sheet-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input","data-testid":"mobile-item-sheet-confidence",value:h,onChange:R=>{_(),N(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section m-sheet-connections",children:[t.jsxs("div",{className:"m-sheet-connections-header",children:[t.jsx("span",{className:"m-sheet-label",children:"Connections"}),!M&&t.jsx("button",{type:"button",className:"m-conn-add-btn","data-testid":"mobile-item-conn-add",onClick:()=>{_(),P(!0)},children:"+ Add"})]}),S?t.jsx("div",{className:"m-conn-loading",children:"Loading…"}):b.length===0&&!M?t.jsx("div",{className:"m-conn-empty",children:"No connections"}):t.jsx("ul",{className:"m-conn-list",children:b.map((R,H)=>{const X=R.fromId===e.id,ne=X?R.toId:R.fromId,ge=J(ne),xe=ae===H;return t.jsxs("li",{className:"m-conn-row",children:[t.jsx("span",{className:"m-conn-dir",children:X?"→":"←"}),t.jsx("span",{className:"m-conn-title",children:ge}),t.jsx("span",{className:"m-conn-type",children:R.type}),t.jsx("button",{type:"button",className:`m-conn-remove${xe?" m-conn-remove--armed":""}`,"data-testid":`mobile-item-conn-remove-${H}`,"aria-label":xe?"Confirm remove connection":"Remove connection",onClick:()=>{_(),W(R,H)},children:xe?"✓":"×"})]},R.id)})}),M&&t.jsxs("div",{className:"m-conn-picker",children:[t.jsxs("div",{className:"m-conn-picker-row",children:[t.jsx("input",{type:"text",className:"m-sheet-input m-conn-search",placeholder:"Search items…",value:L,onChange:R=>O(R.target.value),"data-testid":"mobile-item-conn-search",autoFocus:!0}),t.jsx("select",{className:"m-sheet-input m-conn-type-select",value:F,onChange:R=>Y(R.target.value),"data-testid":"mobile-item-conn-type",children:zt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("ul",{className:"m-conn-picker-list",children:[U.map(R=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:"m-conn-picker-item",disabled:q,onClick:()=>G(R),"data-testid":`mobile-item-conn-pick-${R.id}`,children:[t.jsx("span",{className:"m-conn-picker-title",children:R.title||R.id}),t.jsx("span",{className:"m-conn-picker-id",children:R.id})]})},R.id)),U.length===0&&t.jsx("li",{className:"m-conn-picker-empty",children:"No items found"})]}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:()=>{P(!1),O(""),Y("informs")},children:"Cancel"})]})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:`m-sheet-btn m-sheet-btn-danger${E?" m-sheet-btn-danger--armed":""}`,onClick:D,disabled:T,"data-testid":"mobile-item-sheet-delete",children:T?"Deleting…":E?"Confirm delete":"Delete"}),t.jsxs("div",{className:"m-sheet-footer-right",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:a,"data-testid":"mobile-item-sheet-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",onClick:$,disabled:!c||C,"data-testid":"mobile-item-sheet-save",children:C?"Saving…":"Save"})]})]})]})})}const Vt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"];function Qt({open:e,onClose:a,onCreate:s,groupOptions:n=[]}){const[i,u]=r.useState(""),[o,l]=r.useState(""),[d,g]=r.useState(""),[m,f]=r.useState("planned"),[p,h]=r.useState(""),[N,C]=r.useState(!1),[w,E]=r.useState(null),v=r.useId();if(!e)return null;function T(){u(""),l(""),g(""),f("planned"),h(""),E(null),C(!1)}function x(){T(),a==null||a()}async function j(b){if(b.preventDefault(),!i.trim()){E("Title is required");return}C(!0),E(null);try{const y={title:i.trim()};if(o.trim()&&(y.description=o.trim()),d.trim()&&(y.group=d.trim()),m&&(y.status=m),p!==""){const S=Number(p);Number.isFinite(S)&&(y.confidence=S)}await(s==null?void 0:s(y)),x()}catch(y){E(y.message||"Failed to create item"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-create-sheet",role:"dialog","aria-modal":"true","aria-label":"Create roadmap item",onClick:b=>{b.target===b.currentTarget&&x()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close",onClick:x,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"New roadmap item"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:j,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-title",children:"Title"}),t.jsx("input",{id:"m-create-title",type:"text",className:"m-sheet-input",value:i,onChange:b=>u(b.target.value),placeholder:"Feature title","data-testid":"mobile-create-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-create-desc",className:"m-sheet-input m-textarea",value:o,onChange:b=>l(b.target.value),rows:3,"data-testid":"mobile-create-desc"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-group",children:"Group (optional)"}),t.jsx("input",{id:"m-create-group",type:"text",className:"m-sheet-input",value:d,onChange:b=>g(b.target.value),list:v,placeholder:"e.g. core, infra","data-testid":"mobile-create-group"}),t.jsx("datalist",{id:v,children:n.map(b=>t.jsx("option",{value:b},b))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-status",children:"Status"}),t.jsx("select",{id:"m-create-status",className:"m-sheet-input",value:m,onChange:b=>f(b.target.value),"data-testid":"mobile-create-status",children:Vt.map(b=>t.jsx("option",{value:b,children:b},b))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-confidence",children:"Confidence (0–4, optional)"}),t.jsx("input",{id:"m-create-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input",value:p,onChange:b=>h(b.target.value),"data-testid":"mobile-create-confidence"})]}),w?t.jsx("div",{className:"m-form-error",role:"alert","data-testid":"mobile-create-error",children:w}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:x,disabled:N,"data-testid":"mobile-create-cancel",children:"Cancel"}),t.jsx("div",{className:"m-sheet-footer-right",children:t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"mobile-create-submit",onClick:j,children:N?"Creating…":"Create"})})]})]})})}function Ve({message:e,kind:a="error",durationMs:s=3e3,onDismiss:n}){return r.useEffect(()=>{if(!e)return;const i=setTimeout(()=>n==null?void 0:n(),s);return()=>clearTimeout(i)},[e,s,n]),e?t.jsx("div",{className:"m-toast",role:"status","data-kind":a,"data-testid":"mobile-toast",children:e}):null}function Zt(e){const a=new Set;for(const s of e){const n=((s==null?void 0:s.group)||"").trim();n&&a.add(n)}return Array.from(a).sort()}function es(e,a){if(!a)return!0;const s=a.toLowerCase(),n=(e.title||"").toLowerCase(),i=(e.description||"").toLowerCase();return n.includes(s)||i.includes(s)}function ts({items:e=[],loading:a=!1,error:s=null,applyOptimisticEdit:n,createItem:i,deleteItem:u,addConnection:o,removeConnection:l,fetchItemDetail:d}){const[g,m]=r.useState([]),[f,p]=r.useState(""),[h,N]=r.useState(""),[C,w]=r.useState(null),[E,v]=r.useState(!1),[T,x]=r.useState(null),j=r.useMemo(()=>Zt(e),[e]),b=r.useMemo(()=>e.filter(L=>!(g.length&&!g.includes(L.status)||f&&L.group!==f||!es(L,h))),[e,g,f,h]),y=r.useMemo(()=>e.find(L=>L.id===C)||null,[e,C]),S=L=>{m(O=>O.includes(L)?O.filter(F=>F!==L):[...O,L])},A=async(L,O)=>{const F=await n(L,O);F!=null&&F.ok?w(null):x((F==null?void 0:F.error)||"Save failed")},M=async L=>{const O=await(i==null?void 0:i(L));if(!(O!=null&&O.ok))throw new Error((O==null?void 0:O.error)||"Create failed")},P=async L=>{const O=await(u==null?void 0:u(L));O!=null&&O.ok?w(null):x((O==null?void 0:O.error)||"Delete failed")};return t.jsxs("section",{className:"m-roadmap","data-testid":"mobile-tab-roadmap",children:[t.jsx(Jt,{statuses:g,onToggleStatus:S,group:f,groupOptions:j,onChangeGroup:p,keyword:h,onChangeKeyword:N}),s?t.jsx("div",{className:"m-roadmap-error","data-testid":"mobile-roadmap-error",children:s}):null,a?t.jsx("div",{className:"m-roadmap-skeleton","data-testid":"mobile-roadmap-loading",children:Array.from({length:4}).map((L,O)=>t.jsx("div",{className:"m-skel-card"},O))}):b.length===0?t.jsx("div",{className:"m-roadmap-empty","data-testid":"mobile-roadmap-empty",children:e.length===0?"No roadmap items yet.":"No items match the current filters."}):t.jsx("ul",{className:"m-roadmap-list","data-testid":"mobile-roadmap-list",children:b.map(L=>t.jsx("li",{children:t.jsx(Kt,{item:L,onSelect:O=>w(O.id)})},L.id))}),y?t.jsx(Xt,{item:y,onClose:()=>w(null),onSave:A,onDelete:P,allItems:e,addConnection:o,removeConnection:l,fetchItemDetail:d}):null,t.jsx(Qt,{open:E,onClose:()=>v(!1),onCreate:M,groupOptions:j}),t.jsx("button",{type:"button",className:"m-fab","data-testid":"mobile-roadmap-fab","aria-label":"Create new roadmap item",onClick:()=>v(!0),children:"+"}),t.jsx(Ve,{message:T,onDismiss:()=>x(null)})]})}const Z="—";async function le(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function ss(){const[e,a]=r.useState([]),[s,n]=r.useState([]),[i,u]=r.useState(!0),[o,l]=r.useState(null),[d,g]=r.useState([]),m=r.useRef(e);m.current=e;const f=r.useCallback((v,T)=>{const x=`t_${Date.now()}_${Math.random().toString(36).slice(2,6)}`;g(j=>[...j,{id:x,kind:v,message:T}]),setTimeout(()=>{g(j=>j.filter(b=>b.id!==x))},3500)},[]),p=r.useCallback(v=>{g(T=>T.filter(x=>x.id!==v))},[]),h=r.useCallback(async()=>{try{const v=await le("/api/ideabox");a(Array.isArray(v==null?void 0:v.ideas)?v.ideas:[]),n(Array.isArray(v==null?void 0:v.killed)?v.killed:[]),l(null)}catch(v){l(v.message),f("error",`Failed to load ideas: ${v.message}`)}finally{u(!1)}},[f]);r.useEffect(()=>{let v=!0;return(async()=>v&&await h())(),()=>{v=!1}},[h]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const v=he({url:()=>fe(),onMessage:T=>{try{const x=JSON.parse(T.data);x&&x.type==="ideaboxUpdated"&&h()}catch{}}});return()=>{try{v.close()}catch{}}},[h]);const N=r.useCallback(async({title:v,description:T,source:x,tags:j,cluster:b})=>{if(!v||!v.trim()){const A=new Error("title is required");throw f("error",A.message),A}const y=`tmp_${Date.now()}`,S={id:y,num:0,title:v.trim(),description:T||"",source:x||"",tags:Array.isArray(j)?j:[],cluster:b||null,status:"NEW",priority:Z,_pending:!0};a(A=>[S,...A]);try{const A=await le("/api/ideabox/ideas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:v.trim(),description:T,source:x,tags:j,cluster:b})});return a(M=>M.map(P=>P.id===y?{...A}:P)),f("ok","Idea captured"),A}catch(A){throw a(M=>M.filter(P=>P.id!==y)),f("error",`Capture failed: ${A.message}`),A}},[f]),C=r.useCallback(async(v,{featureCode:T}={})=>{const x=m.current;a(j=>j.map(b=>b.id===v?{...b,_promoting:!0}:b));try{const j=await le(`/api/ideabox/ideas/${encodeURIComponent(v)}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureCode:T||""})});return f("ok",`Promoted${j!=null&&j.featureCode?` → ${j.featureCode}`:""}`),h(),j}catch(j){throw a(x),f("error",`Promote failed: ${j.message}`),j}},[f,h]),w=r.useCallback(async(v,{reason:T}={})=>{const x=m.current,j=x.find(b=>b.id===v);a(b=>b.filter(y=>y.id!==v)),j&&n(b=>[{...j,status:"KILLED",reason:T||""},...b]);try{const b=await le(`/api/ideabox/ideas/${encodeURIComponent(v)}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:T||""})});return f("ok","Idea killed"),h(),b}catch(b){throw a(x),n(y=>y.filter(S=>S.id!==v||S.status!=="KILLED")),f("error",`Kill failed: ${b.message}`),b}},[f,h]),E=r.useCallback(async(v,T)=>{if(!["P0","P1","P2",Z].includes(T)){const b=new Error(`Invalid priority: ${T}`);throw f("error",b.message),b}const j=m.current;a(b=>b.map(y=>y.id===v?{...y,priority:T}:y));try{const b=await le(`/api/ideabox/ideas/${encodeURIComponent(v)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:T})});return f("ok",`Priority → ${T===Z?"Untriaged":T}`),b}catch(b){throw a(j),f("error",`Set priority failed: ${b.message}`),b}},[f]);return{ideas:e,killed:s,loading:i,error:o,toasts:d,dismissToast:p,refetch:h,createIdea:N,promote:C,kill:w,setPriority:E}}function as(e,a={}){const{onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u,threshold:o=80,axis:l="x"}=a,d=r.useRef({onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u});d.current={onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u},r.useEffect(()=>{const g=e&&e.current;if(!g)return;let m=0,f=0,p=null,h=!1,N=0;function C(v){if(!(v.button!==void 0&&v.button!==0)){p=v.pointerId,m=v.clientX,f=v.clientY,h=!0,N=0;try{g.setPointerCapture(v.pointerId)}catch{}}}function w(v){var j,b,y,S;if(!h||v.pointerId!==p)return;const T=v.clientX-m,x=v.clientY-f;if(l==="x"&&Math.abs(x)>Math.abs(T)&&Math.abs(x)>12){h=!1,(b=(j=d.current).onDragEnd)==null||b.call(j,0,!1);return}N=T,(S=(y=d.current).onDrag)==null||S.call(y,T)}function E(v){var j,b,y,S,A,M;if(!h||v&&v.pointerId!==p)return;const T=N;h=!1;try{g.releasePointerCapture(p)}catch{}p=null;let x=!1;T<=-o?((b=(j=d.current).onSwipeLeft)==null||b.call(j),x=!0):T>=o&&((S=(y=d.current).onSwipeRight)==null||S.call(y),x=!0),(M=(A=d.current).onDragEnd)==null||M.call(A,T,x)}return g.addEventListener("pointerdown",C),g.addEventListener("pointermove",w),g.addEventListener("pointerup",E),g.addEventListener("pointercancel",E),()=>{g.removeEventListener("pointerdown",C),g.removeEventListener("pointermove",w),g.removeEventListener("pointerup",E),g.removeEventListener("pointercancel",E)}},[e,o,l])}function ns(e){return e==="P0"||e==="P1"||e==="P2"?e.toLowerCase():"untriaged"}function rs(e){return e==="P0"||e==="P1"||e==="P2"?e:"Untriaged"}function is({idea:e,onTap:a,onSwipeLeft:s,onSwipeRight:n}){const i=r.useRef(null),[u,o]=r.useState(0),[l,d]=r.useState(null),g=r.useCallback(h=>{o(h),h<=-40?d("kill"):h>=40?d("promote"):d(null)},[]),m=r.useCallback(()=>{o(0),d(null)},[]);as(i,{onSwipeLeft:()=>s==null?void 0:s(e),onSwipeRight:()=>n==null?void 0:n(e),onDrag:g,onDragEnd:m,threshold:80});const f=ns(e.priority),p=Array.isArray(e.tags)?e.tags:[];return t.jsxs("div",{className:"m-idea-row","data-testid":`idea-row-${e.id}`,children:[t.jsx("div",{className:"m-idea-action m-idea-action-left","aria-hidden":"true",children:"Promote"}),t.jsx("div",{className:"m-idea-action m-idea-action-right","aria-hidden":"true",children:"Kill"}),t.jsxs("article",{ref:i,className:`m-idea-card${l?` is-intent-${l}`:""}`,"data-testid":"idea-card","data-idea-id":e.id,"data-priority":f,style:{transform:`translateX(${u}px)`},role:"button",tabIndex:0,onClick:()=>{Math.abs(u)<4&&(a==null||a(e))},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),a==null||a(e))},children:[t.jsxs("div",{className:"m-idea-head",children:[t.jsx("span",{className:"m-priority-badge","data-priority":f,"data-testid":`priority-badge-${e.id}`,children:rs(e.priority)}),e.cluster?t.jsx("span",{className:"m-idea-cluster",title:e.cluster,children:e.cluster}):null]}),t.jsx("h3",{className:"m-idea-title","data-testid":`idea-title-${e.id}`,children:e.title}),p.length>0?t.jsx("div",{className:"m-idea-tags",children:p.map(h=>t.jsx("span",{className:"m-idea-tag",children:h},h))}):null]})]})}function ls({open:e,onClose:a,onSubmit:s,existingClusters:n=[]}){const[i,u]=r.useState(""),[o,l]=r.useState(""),[d,g]=r.useState(""),[m,f]=r.useState([]),[p,h]=r.useState(""),[N,C]=r.useState(!1),[w,E]=r.useState(null),v=r.useId(),T=r.useMemo(()=>{const S=new Set;for(const A of n)A&&typeof A=="string"&&S.add(A);return[...S].sort()},[n]);if(!e)return null;function x(){u(""),l(""),g(""),f([]),h(""),E(null),C(!1)}function j(){x(),a==null||a()}function b(){const S=d.trim();S&&(m.includes(S)||f([...m,S]),g(""))}async function y(S){if(S.preventDefault(),!i.trim()){E("Title is required");return}C(!0),E(null);try{await(s==null?void 0:s({title:i.trim(),description:o.trim()||void 0,tags:m.length?m:void 0,cluster:p.trim()||void 0})),j()}catch(A){E(A.message||"Failed to capture"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"capture-sheet",role:"dialog","aria-modal":"true","aria-label":"Capture idea",onClick:S=>{S.target===S.currentTarget&&j()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close capture",onClick:j,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Capture idea"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:y,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-title",children:"Title"}),t.jsx("input",{id:"m-capture-title",type:"text",className:"m-sheet-input",value:i,onChange:S=>u(S.target.value),placeholder:"What's the idea?","data-testid":"capture-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-capture-desc",className:"m-sheet-input m-textarea",value:o,onChange:S=>l(S.target.value),rows:4,"data-testid":"capture-description"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-tag",children:"Tags (optional)"}),t.jsxs("div",{className:"m-tag-input-row",children:[t.jsx("input",{id:"m-capture-tag",type:"text",className:"m-sheet-input",value:d,onChange:S=>g(S.target.value),onKeyDown:S=>{(S.key==="Enter"||S.key===",")&&(S.preventDefault(),b())},placeholder:"Add tag and press Enter","data-testid":"capture-tag-input"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary m-tag-add",onClick:b,children:"Add"})]}),m.length>0?t.jsx("div",{className:"m-idea-tags","data-testid":"capture-tags",children:m.map(S=>t.jsxs("span",{className:"m-idea-tag",children:[S,t.jsx("button",{type:"button",className:"m-tag-remove","aria-label":`Remove tag ${S}`,onClick:()=>f(m.filter(A=>A!==S)),children:"×"})]},S))}):null]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-cluster",children:"Cluster (optional)"}),t.jsx("input",{id:"m-capture-cluster",type:"text",className:"m-sheet-input",value:p,onChange:S=>h(S.target.value),list:v,placeholder:"Group into a theme","data-testid":"capture-cluster"}),t.jsx("datalist",{id:v,children:T.map(S=>t.jsx("option",{value:S},S))})]}),w?t.jsx("div",{className:"m-form-error",role:"alert",children:w}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:j,disabled:N,"data-testid":"capture-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"capture-submit",onClick:y,children:N?"Saving…":"Capture"})]})]})})}const os=[{value:"P0",label:"P0"},{value:"P1",label:"P1"},{value:"P2",label:"P2"},{value:Z,label:"Untriaged"}];function cs({value:e,onChange:a,disabled:s=!1}){return t.jsx("div",{className:"m-priority-selector",role:"radiogroup","aria-label":"Priority",children:os.map(n=>{const i=e===n.value,u=`m-priority-chip${i?" is-selected":""}`;return t.jsx("button",{type:"button",role:"radio","aria-checked":i?"true":"false",className:u,"data-priority":n.value===Z?"untriaged":n.value.toLowerCase(),"data-testid":`priority-chip-${n.value===Z?"untriaged":n.value.toLowerCase()}`,disabled:s,onClick:()=>a(n.value),children:n.label},n.value)})})}function ds({idea:e,open:a,onClose:s,onPromote:n,onKill:i,onSetPriority:u}){const[o,l]=r.useState(!1);if(!a||!e)return null;const d=Array.isArray(e.tags)?e.tags:[],g=e.priority||Z;async function m(f,p=!0){l(!0);try{await f(),p&&(s==null||s())}catch{}finally{l(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"idea-detail-sheet",role:"dialog","aria-modal":"true","aria-label":`Idea ${e.id}`,onClick:f=>{f.target===f.currentTarget&&(s==null||s())},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close detail",onClick:s,disabled:o,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:e.title})}),t.jsxs("div",{className:"m-detail-meta",children:[t.jsx("span",{className:"m-detail-meta-id",children:e.id}),t.jsx("span",{className:"m-detail-meta-status",children:e.status||"NEW"}),e.cluster?t.jsx("span",{className:"m-detail-meta-cluster",children:e.cluster}):null]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,e.source?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Source"}),t.jsx("p",{className:"m-sheet-desc",children:e.source})]}):null,d.length>0?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Tags"}),t.jsx("div",{className:"m-idea-tags",children:d.map(f=>t.jsx("span",{className:"m-idea-tag",children:f},f))})]}):null,t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Priority"}),t.jsx(cs,{value:g,disabled:o,onChange:f=>m(()=>u==null?void 0:u(e.id,f),!1)})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary","data-testid":"detail-kill",disabled:o,onClick:()=>m(()=>i==null?void 0:i(e.id)),children:"Kill"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary","data-testid":"detail-promote",disabled:o,onClick:()=>m(()=>n==null?void 0:n(e.id)),children:"Promote"})]})]})})}const us=[{id:"all",label:"All"},{id:"P0",label:"P0"},{id:"P1",label:"P1"},{id:"P2",label:"P2"},{id:"untriaged",label:"Untriaged"}],Ie={P0:3,P1:2,P2:1};function ms(e){return[...e].sort((a,s)=>{const n=Ie[a.priority]||0,i=Ie[s.priority]||0;if(n!==i)return i-n;const u=typeof a.num=="number"?a.num:0;return(typeof s.num=="number"?s.num:0)-u})}function fs(){const{ideas:e,loading:a,toasts:s,dismissToast:n,createIdea:i,promote:u,kill:o,setPriority:l}=ss(),[d,g]=r.useState("all"),[m,f]=r.useState(!1),[p,h]=r.useState(null),N=r.useMemo(()=>{let w=e;return d==="untriaged"?w=w.filter(E=>!E.priority||E.priority===Z||E.priority===""):d!=="all"&&(w=w.filter(E=>E.priority===d)),ms(w)},[e,d]),C=r.useMemo(()=>{const w=new Set;for(const E of e)E.cluster&&w.add(E.cluster);return[...w]},[e]);return t.jsxs("section",{className:"m-ideas-tab","data-testid":"mobile-tab-ideas",children:[t.jsxs("div",{className:"m-ideas-toolbar",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary m-capture-btn",onClick:()=>f(!0),"data-testid":"open-capture","aria-label":"Capture new idea",children:"+ Capture"}),t.jsx("div",{className:"m-filter-chips",role:"tablist","aria-label":"Priority filter",children:us.map(w=>t.jsx("button",{type:"button",role:"tab","aria-pressed":d===w.id?"true":"false","aria-selected":d===w.id?"true":"false",className:"m-filter-chip",onClick:()=>g(w.id),"data-testid":`filter-${w.id}`,children:w.label},w.id))})]}),a?t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-loading",children:[0,1,2].map(w=>t.jsx("div",{className:"m-idea-skeleton","aria-hidden":"true"},w))}):N.length===0?t.jsxs("div",{className:"m-empty-state","data-testid":"ideas-empty",children:[t.jsx("div",{className:"m-empty-title",children:e.length===0?"No ideas yet":"Nothing matches this filter"}),t.jsx("div",{className:"m-empty-body",children:e.length===0?"Tap Capture to add your first idea.":"Try All to see everything."})]}):t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-list",children:N.map(w=>t.jsx(is,{idea:w,onTap:E=>h(E),onSwipeLeft:E=>o(E.id),onSwipeRight:E=>u(E.id)},w.id))}),t.jsx(ls,{open:m,onClose:()=>f(!1),onSubmit:i,existingClusters:C}),t.jsx(ds,{idea:p,open:!!p,onClose:()=>h(null),onPromote:w=>u(w),onKill:w=>o(w),onSetPriority:(w,E)=>l(w,E)}),t.jsx("div",{className:"m-toast-stack","aria-live":"polite","data-testid":"toasts",children:s.map(w=>t.jsx("div",{className:"m-toast","data-kind":w.kind==="error"?"error":"ok",role:w.kind==="error"?"alert":"status",onClick:()=>n(w.id),children:w.message},w.id))})]})}function hs(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function ps(e,a=3){return e?Array.isArray(e.logTail)?e.logTail.slice(-a):Array.isArray(e.recentLogs)?e.recentLogs.slice(-a):Array.isArray(e.steps)?e.steps.slice(-a).map(s=>`${s.id||s.name||""}: ${s.status||""}`.trim()):[]:[]}function bs({active:e,onOpen:a,onAbort:s,aborting:n}){const[i,u]=r.useState(null),o=(e==null?void 0:e.featureCode)||"(unknown)",l=(e==null?void 0:e.mode)||"feature",d=(e==null?void 0:e.status)||"unknown",g=(e==null?void 0:e.startedAt)||(e==null?void 0:e.started_at)||null,m=ps(e),f=r.useCallback(async h=>{if(h==null||h.stopPropagation(),!!(e!=null&&e.featureCode)){u(null);try{await(s==null?void 0:s({featureCode:e.featureCode}))}catch(N){u(N.message||"Failed to abort")}}},[e,s]),p=r.useCallback(()=>a==null?void 0:a(e),[a,e]);return t.jsxs("div",{className:"m-build-card","data-testid":"mobile-build-card","data-feature":o,role:"button",tabIndex:0,onClick:p,onKeyDown:h=>{h.key==="Enter"&&p()},children:[t.jsxs("div",{className:"m-build-card-row",children:[t.jsx("div",{className:"m-build-card-feature",title:o,children:o}),t.jsx("span",{className:"m-status-pill","data-status":d,children:d})]}),t.jsxs("div",{className:"m-build-card-meta",children:[t.jsx("span",{className:"m-build-card-mode","data-mode":l,children:l}),t.jsx("span",{className:"m-build-card-time",children:hs(g)})]}),m.length>0&&t.jsx("div",{className:"m-build-card-tail",children:m.map((h,N)=>t.jsx("div",{className:"m-build-card-tail-line",children:String(h).slice(0,200)},N))}),t.jsx("div",{className:"m-build-card-actions",children:t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":"mobile-build-abort",disabled:n||me(d),onClick:f,children:n?"Aborting…":"Abort"})}),i&&t.jsx("div",{className:"m-agent-card-error",children:i})]})}const ys={design:"Design",blueprint:"Blueprint",implementation:"Implementation",ship:"Ship"},gs=["design","blueprint","implementation","ship"];function xs(e){return e==="active"?"◉":e==="done"||e==="complete"||e==="completed"?"●":e==="failed"||e==="error"?"✕":"○"}function Oe(e){return e==="done"||e==="complete"||e==="completed"}function js(e){return e==="failed"||e==="error"}function vs(e){return e||null}function Ns(e){const a=[];let s=0;for(;s<e.length;){const n=e[s];if(!Oe(n.status)){a.push({type:"step",step:n}),s++;continue}let i=s;for(;i<e.length&&Oe(e[i].status);)i++;const u=i-s;if(u>=3)a.push({type:"collapsed",steps:e.slice(s,i),count:u});else for(let o=s;o<i;o++)a.push({type:"step",step:e[o]});s=i}return a}function Qe({step:e}){const a=xs(e.status),s=js(e.status),n=e.status==="active";return t.jsxs("div",{className:["m-step-row",n?"m-step-row--active":"",s?"m-step-row--failed":""].filter(Boolean).join(" "),"data-testid":`mobile-build-step-${e.id}`,"data-status":e.status||"pending",children:[t.jsx("span",{className:`m-step-glyph${n?" m-step-glyph--pulse":""}`,"aria-hidden":"true",children:a}),t.jsx("span",{className:"m-step-name",children:e.name||e.id}),vs(e.agent)&&t.jsx("span",{className:"m-step-agent-chip",children:e.agent}),s&&e.summary&&t.jsx("div",{className:"m-step-summary",children:e.summary})]})}function ws({segment:e,expandedKey:a,onToggle:s}){const n=a===e.steps[0].id;return t.jsx("div",{className:"m-step-collapsed-row","data-testid":"mobile-build-steps-collapsed",role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>s(e.steps[0].id),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&s(e.steps[0].id)},children:n?e.steps.map(i=>t.jsx(Qe,{step:i},i.id)):t.jsxs("span",{className:"m-step-collapsed-label",children:[e.count," done ✓"]})})}function Ss({active:e}){const[a,s]=r.useState(null),n=xt(yt,(e==null?void 0:e.steps)??null,(e==null?void 0:e.currentStepId)??null),i={};for(const l of n){const d=l.phase||"implementation";i[d]||(i[d]=[]),i[d].push(l)}const u=gs.filter(l=>{var d;return((d=i[l])==null?void 0:d.length)>0});function o(l){s(d=>d===l?null:l)}return t.jsx("div",{className:"m-build-steps-list","data-testid":"mobile-build-steps",children:u.map(l=>{const d=i[l],g=Ns(d);return t.jsxs("div",{className:"m-build-steps-phase",children:[t.jsx("div",{className:"m-build-steps-phase-header",children:ys[l]||l}),t.jsx("div",{className:"m-build-steps-phase-rows",children:g.map((m,f)=>m.type==="collapsed"?t.jsx(ws,{segment:m,expandedKey:a,onToggle:o},`collapsed-${f}`):t.jsx(Qe,{step:m.step},m.step.id))})]},l)})})}function ks(e,a){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${a})`}}function Cs({active:e,onClose:a,onAbort:s}){const n=e==null?void 0:e.featureCode,{events:i}=ze({agentId:(e==null?void 0:e.flowId)||null}),u=r.useRef(null),[o,l]=r.useState(!1),[d,g]=r.useState(null),[m,f]=r.useState("steps");r.useEffect(()=>{var C;(C=u.current)==null||C.scrollIntoView({behavior:"smooth"})},[i.length]);const p=r.useCallback(async()=>{if(n){l(!0),g(null);try{await(s==null?void 0:s({featureCode:n}))}catch(C){g(C.message||"Failed to abort")}finally{l(!1)}}},[n,s]);if(!e)return null;const h=e.status||"unknown",N=e.mode||"feature";return t.jsxs("div",{className:"m-overlay","data-testid":"mobile-build-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:n,children:n}),t.jsx("span",{className:"m-status-pill","data-status":h,children:h}),t.jsx("span",{className:"m-build-card-mode","data-mode":N,children:N})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:o||me(h),onClick:p,"data-testid":"mobile-build-detail-abort",children:o?"Aborting…":"Abort"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:a,"data-testid":"mobile-build-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-build-detail-tabs",children:[t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="steps"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-steps","aria-pressed":m==="steps",onClick:()=>f("steps"),children:"Steps"}),t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="log"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-log","aria-pressed":m==="log",onClick:()=>f("log"),children:"Log"})]}),m==="steps"?t.jsx("div",{className:"m-overlay-body",children:t.jsx(Ss,{active:e})}):t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[i.length===0?t.jsx("div",{className:"m-empty",children:"No live events yet."}):i.map((C,w)=>t.jsx("div",{className:"m-agent-log-line",children:ks(C,w)},w)),t.jsx("div",{ref:u})]}),d&&t.jsx("div",{className:"m-agent-card-error",children:d})]})}function Ts(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`}function Es(e){if(!e||typeof e!="number")return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${Math.floor(e/1e3)}s`;if(e<36e5){const n=Math.floor(e/6e4),i=Math.floor(e%6e4/1e3);return i>0?`${n}m ${i}s`:`${n}m`}const a=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4);return s>0?`${a}h ${s}m`:`${a}h`}const Le=80,As={done:"●",failed:"✕",revised:"↻",killed:"✕"};function Rs(e){if(!e)return"";const a=e.toLowerCase();return a==="complete"||a==="completed"?"ok":a==="failed"||a==="error"?"error":a==="aborted"||a==="killed"?"warn":""}function _s({build:e,index:a}){const[s,n]=r.useState(!1),i=Ts(e.completedAt),u=e.failureReason?e.failureReason.slice(0,Le)+(e.failureReason.length>Le?"…":""):null,o=Rs(e.status);return t.jsxs("div",{className:`m-build-history-row${s?" is-expanded":""}`,"data-testid":`mobile-build-history-${a}`,"data-status":e.status||"unknown",role:"button",tabIndex:0,"aria-expanded":s,onClick:()=>n(l=>!l),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n(d=>!d)},children:[t.jsxs("div",{className:"m-build-history-summary",children:[t.jsx("span",{className:"m-build-history-code",children:e.featureCode||"(unknown)"}),t.jsx("span",{className:`m-status-pill${o?" m-status-pill--"+o:""}`,"data-status":e.status,children:e.status||"unknown"}),i&&t.jsx("span",{className:"m-build-history-rel",children:i}),!s&&u&&t.jsx("span",{className:"m-build-history-reason-trunc",children:u})]}),s&&t.jsxs("div",{className:"m-build-history-detail",children:[e.mode!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Mode"}),t.jsx("span",{className:"m-build-history-field-value",children:e.mode})]}),e.durationMs!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Duration"}),t.jsx("span",{className:"m-build-history-field-value",children:Es(e.durationMs)})]}),e.stepCount!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Steps"}),t.jsx("span",{className:"m-build-history-field-value",children:e.stepCount})]}),Array.isArray(e.steps)&&e.steps.length>0&&t.jsx("div",{className:"m-build-history-steps","data-testid":`mobile-build-history-steps-${a}`,children:e.steps.map((l,d)=>t.jsxs("div",{className:`m-build-history-step${l.status==="failed"?" is-failed":""}`,"data-status":l.status,children:[t.jsx("span",{className:"m-build-history-step-glyph",children:As[l.status]||"○"}),t.jsx("span",{className:"m-build-history-step-id",children:(l.id||"").replace(/_/g," ")}),l.agent&&t.jsx("span",{className:"m-build-history-step-agent",children:l.agent}),l.status==="failed"&&l.summary&&t.jsx("span",{className:"m-build-history-step-summary",children:l.summary})]},`${l.id||d}`))}),e.failureReason&&t.jsxs("div",{className:"m-build-history-field m-build-history-field--block",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Failure reason"}),t.jsx("span",{className:"m-build-history-field-value m-build-history-failure",children:e.failureReason})]}),e.startedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Started"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.startedAt).toLocaleString()})]}),e.completedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Completed"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.completedAt).toLocaleString()})]})]})]})}function $s({builds:e,loading:a,error:s}){return a?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsx("div",{className:"m-empty",children:"Loading history…"})}):s?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsxs("div",{className:"m-empty",children:["Error: ",s]})}):t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:!e||e.length===0?t.jsx("div",{className:"m-empty",children:"No past builds."}):e.map((n,i)=>t.jsx(_s,{build:n,index:i},n.flowId||i))})}async function Ps(){var e;try{const a=await B("/api/vision/items");if(!a.ok)return[];const s=await a.json(),n=Array.isArray(s==null?void 0:s.items)?s.items:Array.isArray(s)?s:[],i=new Set;for(const u of n){const o=((e=u==null?void 0:u.lifecycle)==null?void 0:e.featureCode)||(u==null?void 0:u.featureCode)||(u==null?void 0:u.id);o&&typeof o=="string"&&i.add(o)}return[...i].sort()}catch{return[]}}function Is({open:e,onClose:a,onSubmit:s}){const[n,i]=r.useState(""),[u,o]=r.useState("feature"),[l,d]=r.useState(""),[g,m]=r.useState(!1),[f,p]=r.useState(null),[h,N]=r.useState([]),C=r.useId();r.useEffect(()=>{if(!e)return;let x=!0;return Ps().then(j=>{x&&N(j)}),()=>{x=!1}},[e]);const w=r.useMemo(()=>h,[h]);if(!e)return null;function E(){i(""),o("feature"),d(""),p(null),m(!1)}function v(){E(),a==null||a()}async function T(x){if(x==null||x.preventDefault(),!n.trim()){p("Feature code is required");return}m(!0),p(null);try{await(s==null?void 0:s({featureCode:n.trim(),mode:u,description:l.trim()})),v()}catch(j){p(j.message||"Failed to start build"),m(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-start-build-sheet",role:"dialog","aria-modal":"true","aria-label":"Start build",onClick:x=>{x.target===x.currentTarget&&v()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close start build",onClick:v,disabled:g,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Start build"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:T,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-feature",children:"Feature code"}),t.jsx("input",{id:"m-build-feature",type:"text",className:"m-sheet-input",value:n,onChange:x=>i(x.target.value),placeholder:"e.g. COMP-MOBILE","data-testid":"mobile-build-feature-input",list:C,autoFocus:!0,required:!0}),t.jsx("datalist",{id:C,children:w.map(x=>t.jsx("option",{value:x},x))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Mode"}),t.jsxs("div",{className:"m-build-mode-row",role:"radiogroup","aria-label":"Build mode",children:[t.jsx("button",{type:"button",role:"radio","aria-checked":u==="feature",className:`m-priority-chip${u==="feature"?" is-selected":""}`,"data-testid":"mobile-build-mode-feature",onClick:()=>o("feature"),children:"Feature"}),t.jsx("button",{type:"button",role:"radio","aria-checked":u==="bug",className:`m-priority-chip${u==="bug"?" is-selected":""}`,"data-testid":"mobile-build-mode-bug",onClick:()=>o("bug"),children:"Bug"})]})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-build-desc",className:"m-sheet-input m-textarea",value:l,onChange:x=>d(x.target.value),rows:4,"data-testid":"mobile-build-description"})]}),f?t.jsx("div",{className:"m-form-error",role:"alert",children:f}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:v,disabled:g,"data-testid":"mobile-build-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:g||!n.trim(),"data-testid":"mobile-build-submit",onClick:T,children:g?"Starting…":"Start"})]})]})})}const Ze=4e3,Me={info:{color:"hsl(var(--foreground))",bg:"hsl(var(--muted))"},warn:{color:"hsl(var(--warning, 32 95% 52%))",bg:"hsl(var(--muted))"},error:{color:"hsl(var(--destructive))",bg:"hsl(var(--destructive) / 0.08)"}};function sa(){const[e,a]=r.useState(null),s=r.useRef(null);if(r.useEffect(()=>{function i(u){const{message:o,level:l="info",ttl:d=Ze}=u.detail??{};o&&(clearTimeout(s.current),a({message:o,level:l}),d>0&&(s.current=setTimeout(()=>a(null),d)))}return window.addEventListener("compose:notify",i),()=>{window.removeEventListener("compose:notify",i),clearTimeout(s.current)}},[]),!e)return null;const n=Me[e.level]??Me.info;return t.jsxs("div",{className:"h-6 flex items-center justify-between px-3 gap-2 shrink-0 text-[11px] font-mono",style:{background:n.bg,color:n.color,borderTop:"1px solid hsl(var(--border))"},role:"status","aria-live":"polite",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate",children:e.message}),t.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 text-[10px]",onClick:()=>{clearTimeout(s.current),a(null)},"aria-label":"Dismiss notification",children:"✕"})]})}function be(e,a="info",s=Ze){try{window.dispatchEvent(new CustomEvent("compose:notify",{detail:{message:e,level:a,ttl:s}}))}catch{}}async function De(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}const Os=new Set(["complete","completed"]);function Ls({active:e,limit:a=20}={}){const[s,n]=r.useState([]),[i,u]=r.useState(!0),[o,l]=r.useState(null),d=r.useRef(new Map),g=r.useRef(new Map),m=r.useRef(!0),f=r.useRef(null),p=r.useCallback(C=>{n(C),l(null);for(const w of C){const E=w.flowId;if(!E)continue;const v=d.current.get(E);if(v&&Os.has(v)&&w.status==="failed"&&g.current.get(E)!==w.status){g.current.set(E,w.status);try{be(`Build failed post-checks: ${w.featureCode}`,"error",0)}catch{}}}},[]),h=r.useCallback(async({pendingFlowId:C}={})=>{try{const w=await De(`/api/builds?limit=${a}`);if(!m.current)return;const E=Array.isArray(w==null?void 0:w.builds)?w.builds:[];p(E),C&&(E.some(T=>T.flowId===C)||(f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{if(m.current)try{const T=await De(`/api/builds?limit=${a}`);if(!m.current)return;const x=Array.isArray(T==null?void 0:T.builds)?T.builds:[];p(x)}catch(T){m.current&&l(T.message)}},2500)))}catch(w){if(!m.current)return;l(w.message)}finally{m.current&&u(!1)}},[a,p]);r.useEffect(()=>(m.current=!0,h(),()=>{m.current=!1,f.current&&clearTimeout(f.current)}),[h]);const N=r.useRef(null);return r.useEffect(()=>{if(!e)return;N.current,N.current=e;const C=e.flowId;if(!(!C||!me(e.status))){if(d.current.has(C)){d.current.get(C)!==e.status&&d.current.set(C,e.status);return}d.current.set(C,e.status),h({pendingFlowId:C})}},[e,h]),{builds:s,loading:i,error:o,refetch:h}}function Ms({active:e,loading:a,error:s,startBuild:n,abortBuild:i}){const[u,o]=r.useState(!1),[l,d]=r.useState(!1),[g,m]=r.useState(!1),[f,p]=r.useState(null),{builds:h,loading:N,error:C}=Ls({active:e}),w=!!(e&&e.featureCode&&!me(e.status)),E=r.useCallback(async({featureCode:T,mode:x,description:j})=>{try{await n({featureCode:T,mode:x,description:j}),p({kind:"ok",message:`Build started for ${T}`})}catch(b){const y=(b==null?void 0:b.status)===409?`A build for ${T} is already active`:(b==null?void 0:b.message)||"Failed to start build";throw p({kind:"error",message:y}),b}},[n]),v=r.useCallback(async({featureCode:T})=>{m(!0);try{await i({featureCode:T}),p({kind:"ok",message:`Aborted ${T}`}),d(!1)}catch(x){throw p({kind:"error",message:(x==null?void 0:x.message)||"Failed to abort"}),x}finally{m(!1)}},[i]);return t.jsxs("section",{"data-testid":"mobile-tab-builds",className:"m-builds-tab",children:[t.jsxs("div",{className:"m-section",children:[t.jsx("h2",{className:"m-section-title",children:"Current build"}),a?t.jsx("div",{className:"m-empty","data-testid":"mobile-build-loading",children:"Loading…"}):w?t.jsx(bs,{active:e,onOpen:()=>d(!0),onAbort:v,aborting:g}):t.jsxs("div",{className:"m-empty-state","data-testid":"mobile-build-empty",children:[t.jsx("div",{className:"m-empty-title",children:"No active build"}),t.jsx("div",{className:"m-empty-body",children:e&&me(e.status)?`Last build: ${e.featureCode} (${e.status})`:"Start a build to track progress here."}),t.jsx("button",{type:"button",className:"m-btn m-btn-primary","data-testid":"mobile-build-start",onClick:()=>o(!0),children:"Start build"})]}),s&&t.jsxs("div",{className:"m-empty","data-testid":"mobile-build-error",children:["Error: ",s]})]}),w&&t.jsx("div",{className:"m-section",children:t.jsx("button",{type:"button",className:"m-btn m-btn-sm","data-testid":"mobile-build-start-secondary",onClick:()=>o(!0),children:"Start another build"})}),t.jsxs("div",{className:"m-section","data-testid":"mobile-build-history-section",children:[t.jsx("h2",{className:"m-section-title",children:"History"}),t.jsx($s,{builds:h,loading:N,error:C})]}),t.jsx(Is,{open:u,onClose:()=>o(!1),onSubmit:E}),l&&e&&t.jsx(Cs,{active:e,onClose:()=>d(!1),onAbort:v}),t.jsx(Ve,{message:f==null?void 0:f.message,kind:f==null?void 0:f.kind,onDismiss:()=>p(null)})]})}const Ds=3;function Us({onNavigate:e}){const[a,s]=r.useState([]),n=r.useRef(new Map),i=r.useRef(0),u=r.useCallback(l=>{clearTimeout(n.current.get(l)),n.current.delete(l),s(d=>d.filter(g=>g.id!==l))},[]);if(r.useEffect(()=>{function l(d){const{message:g,level:m="info",ttl:f}=d.detail??{};if(!g)return;const p=++i.current;s(N=>{const C=[...N,{id:p,message:g,level:m}];if(C.length>Ds){const w=C.shift();clearTimeout(n.current.get(w.id)),n.current.delete(w.id)}return C});const h=typeof f=="number"&&f>0&&isFinite(f)?f:0;if(h>0){const N=setTimeout(()=>{s(C=>C.filter(w=>w.id!==p)),n.current.delete(p)},h);n.current.set(p,N)}}return window.addEventListener("compose:notify",l),()=>{window.removeEventListener("compose:notify",l);for(const d of n.current.values())clearTimeout(d);n.current.clear()}},[]),a.length===0)return null;function o(l){return l==="warn"?"agents":"builds"}return t.jsx("div",{className:"m-alert-bar","data-testid":"mobile-alert-bar","aria-live":"polite",children:a.map(l=>t.jsxs("div",{className:`m-alert m-alert-${l.level}`,"data-testid":`mobile-alert-${l.level}`,role:"status",onClick:()=>{e==null||e(o(l.level)),u(l.id)},children:[t.jsx("span",{className:"m-alert-msg",children:l.message}),t.jsx("button",{type:"button",className:"m-alert-dismiss","aria-label":"Dismiss",onClick:d=>{d.stopPropagation(),u(l.id)},children:"✕"})]},l.id))})}const Fs={ok:"var(--m-ok)",warn:"var(--m-warn)",error:"var(--m-danger)"},te="var(--m-text-dim)",Gs={"installed-current":"var(--m-ok)",absent:"var(--m-text-dim)",foreign:"var(--m-danger)","installed-stale":"var(--m-warn)","workspace-unverified":"var(--m-warn)",unavailable:"var(--m-text-dim)"};function ee({color:e}){return t.jsx("span",{className:"m-env-dot","aria-hidden":"true",style:{background:e}})}function Hs(...e){return e.reduce((a,s)=>!s||s.unavailable?a:a+(s.missing||[]).length,0)}function Bs(){var C,w,E;const[e,a]=r.useState(null),[s,n]=r.useState(null),[i,u]=r.useState(!1),[o,l]=r.useState(!1),d=r.useRef(null),g=r.useCallback(async()=>{u(!0);try{const T=await(await B("/api/environment-health")).json();a(T),n(null)}catch(v){a(null),n((v==null?void 0:v.message)||"unavailable")}finally{u(!1)}},[]);r.useEffect(()=>{g()},[g]),r.useEffect(()=>{if(!o)return;const v=x=>{var j;(j=d.current)!=null&&j.contains(x.target)||l(!1)},T=x=>{x.key==="Escape"&&l(!1)};return window.addEventListener("mousedown",v),window.addEventListener("keydown",T),()=>{window.removeEventListener("mousedown",v),window.removeEventListener("keydown",T)}},[o]);const m=e==null?void 0:e.summary,f=m&&Fs[m]||te,p=e?Hs(e.dependencies,e.binaries):0,h=!!(e&&((C=e.dependencies)!=null&&C.unavailable||(w=e.binaries)!=null&&w.unavailable)),N=e!=null&&e.hooks&&!e.hooks.unavailable?Object.entries(e.hooks).filter(([v])=>v!=="unavailable"):[];return t.jsxs("div",{ref:d,className:"m-env-health",children:[t.jsx("button",{type:"button",className:"m-env-btn","data-testid":"mobile-env-health-dot",onClick:()=>l(v=>!v),title:`Environment health: ${m||(i?"checking…":"unknown")}`,"aria-label":"Environment health","aria-haspopup":"dialog","aria-expanded":o,children:t.jsx(ee,{color:f})}),o&&t.jsxs("div",{className:"m-env-detail","data-testid":"mobile-env-health-detail",role:"dialog","aria-label":"Environment health",children:[t.jsx("div",{className:"m-env-detail-head",children:"Environment Health"}),s&&t.jsxs("div",{className:"m-env-row m-env-unavailable",children:["Unavailable: ",s]}),!e&&!s&&t.jsx("div",{className:"m-env-row m-env-dim",children:i?"Checking…":"No data"}),e&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"m-env-row","data-testid":"mobile-env-health-deps",children:[t.jsx(ee,{color:h?te:p>0?"var(--m-warn)":"var(--m-ok)"}),t.jsx("span",{className:h?"m-env-dim":void 0,children:h?"dependencies unavailable":p>0?`${p} dependenc${p===1?"y":"ies"} missing`:"All dependencies present"})]}),t.jsx("div",{className:"m-env-row","data-testid":"mobile-env-health-version",children:e.version?e.version.behind?t.jsxs(t.Fragment,{children:[t.jsx(ee,{color:"var(--m-warn)"}),t.jsxs("span",{children:[e.version.current," → ",e.version.latest," (behind)"]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{color:"var(--m-ok)"}),t.jsxs("span",{children:[e.version.current," (up to date)"]})]}):t.jsxs(t.Fragment,{children:[t.jsx(ee,{color:te}),t.jsx("span",{className:"m-env-dim",children:"version check unavailable"})]})}),N.map(([v,T])=>t.jsxs("div",{className:"m-env-row","data-testid":`mobile-env-health-hook-${v}`,children:[t.jsx(ee,{color:Gs[T.state]||te}),t.jsx("span",{className:"m-env-mono",children:v}),t.jsx("span",{className:"m-env-dim",children:T.state})]},v)),((E=e.hooks)==null?void 0:E.unavailable)&&t.jsxs("div",{className:"m-env-row",children:[t.jsx(ee,{color:te}),t.jsx("span",{className:"m-env-dim",children:"hook status unavailable"})]})]})]})]})}async function Ue(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function Js(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),o=r.useRef(!0),l=r.useCallback(async()=>{try{const g=await Ue("/api/vision/gates");if(!o.current)return;a(Array.isArray(g==null?void 0:g.gates)?g.gates:[]),u(null)}catch(g){if(!o.current)return;u(g.message)}finally{o.current&&n(!1)}},[]);r.useEffect(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const g=he({url:()=>fe(),onMessage:m=>{try{const f=JSON.parse(m.data);if(!f||!f.type)return;(f.type==="gateCreated"||f.type==="gateResolved"||f.type==="gateUpdated")&&l()}catch{}}});return()=>{try{g.close()}catch{}}},[l]);const d=r.useCallback(async(g,{outcome:m,reason:f,summary:p}={})=>{if(!["approve","revise","kill"].includes(m))throw new Error(`outcome must be approve|revise|kill (got ${m})`);const h=[];f&&h.push(f),p&&h.push(p);const N=h.join(" — ")||void 0,C={outcome:m};N&&(C.comment=N);const w=await Ue(`/api/vision/gates/${encodeURIComponent(g)}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});return l(),w},[l]);return{gates:e,loading:s,error:i,refetch:l,resolve:d}}async function Se(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`,u=new Error(i);throw u.status=s.status,u.data=n,u}return n}function Ys(){const[e,a]=r.useState(null),[s,n]=r.useState(!0),[i,u]=r.useState(null),o=r.useRef(!0),l=r.useCallback(async()=>{try{const m=await Se("/api/build/state");if(!o.current)return;a((m==null?void 0:m.state)??null),u(null)}catch(m){if(!o.current)return;u(m.message)}finally{o.current&&n(!1)}},[]);r.useEffect(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const m=he({url:()=>fe(),onMessage:f=>{try{const p=JSON.parse(f.data);if(!p||!p.type)return;p.type==="buildState"&&l()}catch{}}});return()=>{try{m.close()}catch{}}},[l]);const d=r.useCallback(async({featureCode:m,mode:f="feature",description:p=""}={})=>{if(!m)throw new Error("featureCode required");const h=await Se("/api/build/start",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m,mode:f,description:p})});return l(),h},[l]),g=r.useCallback(async({featureCode:m}={})=>{if(!m)throw new Error("featureCode required");const f=await Se("/api/build/abort",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m})});return l(),f},[l]);return{active:e,loading:s,error:i,refetch:l,startBuild:d,abortBuild:g}}function qs(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),[o,l]=r.useState(!1),d=r.useRef(e);d.current=e;const g=r.useRef(new Map),m=r.useRef(new Map),f=r.useRef(new Set),p=r.useRef(0),h=r.useCallback(async()=>{try{const j=await(await B("/api/vision/items")).json(),b=Array.isArray(j==null?void 0:j.items)?j.items:Array.isArray(j)?j:[];a(b),u(null)}catch(x){u((x==null?void 0:x.message)||"Failed to load items")}finally{n(!1)}},[]);r.useEffect(()=>{let x=!1;h();const j=he({url:()=>fe(),onOpen:()=>{x||l(!0)},onClose:()=>{x||l(!1)},onMessage:b=>{var A,M;if(x)return;let y;try{y=JSON.parse(b.data)}catch{return}if(!y||typeof y!="object")return;const S=y.type;(S==="visionState"||S==="hydrate")&&Array.isArray(y.items)?a(()=>{const P=g.current,L=m.current,O=f.current;let F=y.items;if(P.size>0&&(F=F.map(Y=>{const q=P.get(Y.id);return q?{...Y,...q}:Y})),O.size>0&&(F=F.filter(Y=>!O.has(Y.id))),L.size>0){const Y=new Set(F.map(z=>z.id)),q=[...L.values()].filter(z=>!Y.has(z.id));q.length>0&&(F=[...q,...F])}return F}):S==="itemUpdated"&&((A=y.item)!=null&&A.id)?a(P=>{const L=P.findIndex(F=>F.id===y.item.id);if(L===-1)return[...P,y.item];const O=P.slice();return O[L]={...O[L],...y.item},O}):S==="itemCreated"&&((M=y.item)!=null&&M.id)?a(P=>P.some(L=>L.id===y.item.id)?P:[...P,y.item]):S==="itemDeleted"&&y.id?a(P=>P.filter(L=>L.id!==y.id)):S==="state"&&Array.isArray(y.items)?a(y.items):(S==="visionUpdated"||S==="roadmapUpdated")&&h()}});return()=>{x=!0;try{j.close()}catch{}}},[h]);const N=r.useCallback(async(x,j)=>{if(!x||!j||typeof j!="object")return{ok:!1,error:"invalid patch"};const b=d.current;if(!b.find(A=>A.id===x))return{ok:!1,error:"item not found"};g.current.set(x,j);const S=b.map(A=>A.id===x?{...A,...j}:A);a(S);try{const A=await B(`/api/vision/items/${x}`,{method:"PATCH",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(j)}),M=await A.json().catch(()=>({}));if(!A.ok)return g.current.delete(x),a(b),{ok:!1,error:(M==null?void 0:M.error)||`HTTP ${A.status}`};g.current.delete(x);const P=(M==null?void 0:M.item)||(M==null?void 0:M.updated)||null;return P&&P.id===x&&a(L=>L.map(O=>O.id===x?{...O,...P}:O)),{ok:!0,item:P||S.find(L=>L.id===x)}}catch(A){return g.current.delete(x),a(b),{ok:!1,error:(A==null?void 0:A.message)||"Network error"}}},[]),C=r.useCallback(async x=>{if(!x||typeof x!="object")return{ok:!1,error:"invalid fields"};const j=`tmp-${++p.current}`,b={...x,type:"feature",id:j};m.current.set(j,b),a(y=>[b,...y]);try{const y=await B("/api/vision/items",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({...x,type:"feature"})}),S=await y.json().catch(()=>({}));if(!y.ok)return m.current.delete(j),a(M=>M.filter(P=>P.id!==j)),{ok:!1,error:(S==null?void 0:S.error)||`HTTP ${y.status}`};const A=(S==null?void 0:S.item)||(S!=null&&S.id?S:null);return m.current.delete(j),a(M=>A&&M.some(P=>P.id===A.id)?M.filter(P=>P.id!==j):M.map(P=>P.id===j&&A?{...P,...A}:P)),{ok:!0,item:A}}catch(y){return m.current.delete(j),a(S=>S.filter(A=>A.id!==j)),{ok:!1,error:(y==null?void 0:y.message)||"Network error"}}},[]),w=r.useCallback(async x=>{if(!x)return{ok:!1,error:"id required"};const j=d.current;f.current.add(x),a(b=>b.filter(y=>y.id!==x));try{const b=await B(`/api/vision/items/${x}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),y=await b.json().catch(()=>({}));return b.ok?(f.current.delete(x),{ok:!0}):(f.current.delete(x),a(j),{ok:!1,error:(y==null?void 0:y.error)||`HTTP ${b.status}`})}catch(b){return f.current.delete(x),a(j),{ok:!1,error:(b==null?void 0:b.message)||"Network error"}}},[]),E=r.useCallback(async({fromId:x,toId:j,type:b})=>{try{const y=await B("/api/vision/connections",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({fromId:x,toId:j,type:b})}),S=await y.json().catch(()=>({}));return y.ok?{ok:!0,connection:(S==null?void 0:S.connection)||S}:{ok:!1,error:(S==null?void 0:S.error)||`HTTP ${y.status}`}}catch(y){return{ok:!1,error:(y==null?void 0:y.message)||"Network error"}}},[]),v=r.useCallback(async x=>{try{const j=await B(`/api/vision/connections/${x}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),b=await j.json().catch(()=>({}));return j.ok?{ok:!0}:{ok:!1,error:(b==null?void 0:b.error)||`HTTP ${j.status}`}}catch(j){return{ok:!1,error:(j==null?void 0:j.message)||"Network error"}}},[]),T=r.useCallback(async x=>{try{const j=await B(`/api/vision/items/${x}`),b=await j.json().catch(()=>({}));return j.ok?{ok:!0,item:b}:{ok:!1,error:(b==null?void 0:b.error)||`HTTP ${j.status}`}}catch(j){return{ok:!1,error:(j==null?void 0:j.message)||"Network error"}}},[]);return{items:e,loading:s,error:i,connected:o,refetch:h,applyOptimisticEdit:N,createItem:C,deleteItem:w,addConnection:E,removeConnection:v,fetchItemDetail:T}}function Ks({active:e,gates:a,items:s}){const n=r.useRef(null),i=r.useRef(new Map);r.useEffect(()=>{if(Array.isArray(a)){if(n.current===null){n.current=new Set(a.map(u=>u.id));return}for(const u of a)if(!n.current.has(u.id)){n.current.add(u.id);const o=(Array.isArray(s)?s:[]).find(d=>d.id===u.itemId),l=(o==null?void 0:o.title)||"Gate pending";be(`Gate pending: ${l}`,"warn",0)}}},[a,s]),r.useEffect(()=>{if(!e||!e.flowId)return;const u=i.current.get(e.flowId),o=e.status;u!==void 0&&u!==o&&(o==="failed"?be(`Build failed: ${e.featureCode||e.flowId}`,"error",0):(o==="complete"||o==="completed")&&be(`Build complete: ${e.featureCode||e.flowId}`,"info",4e3)),i.current.set(e.flowId,o)},[e])}const et=["agents","roadmap","builds","ideas"],Fe="agents",Ge="compose:mobile:sensitiveToken";function Ws(e){const a=e.match(/^\/m(?:\/([^/?#]+))?\/?$/);if(!a)return Fe;const s=a[1];return s&&et.includes(s)?s:Fe}function zs(){const e=window.location.pathname==="/m/pair",[a,s]=r.useState(()=>Ws(window.location.pathname));r.useEffect(()=>{try{localStorage.getItem(oe)&&(Je("mobile-paired"),Ye(!0))}catch{}},[]),r.useEffect(()=>{try{const y=new URL(window.location.href),S=y.searchParams.get("token");if(S){try{localStorage.setItem(Ge,S)}catch{}se(S),y.searchParams.delete("token"),window.history.replaceState({},"",y.pathname+(y.search?y.search:"")+y.hash)}else{let A=null;try{A=localStorage.getItem(Ge)}catch{}A&&se(A)}}catch{}},[]),r.useEffect(()=>{if(!(typeof navigator>"u")&&"serviceWorker"in navigator)try{navigator.serviceWorker.register("/m-sw.js").catch(y=>{console.warn("[compose-mobile] SW registration failed:",y)})}catch(y){console.warn("[compose-mobile] SW registration threw:",y)}},[]);const n=r.useCallback(y=>{if(et.includes(y)){s(y);try{const S=new URL(window.location.href);S.pathname=`/m/${y}`,window.history.replaceState({},"",S.pathname+S.search+S.hash)}catch{}}},[]),{gates:i,loading:u,resolve:o}=Js(),{active:l,loading:d,error:g,startBuild:m,abortBuild:f}=Ys(),{items:p,loading:h,error:N,applyOptimisticEdit:C,createItem:w,deleteItem:E,addConnection:v,removeConnection:T,fetchItemDetail:x}=qs();Ks({active:l,gates:i,items:p});const j={};if(i.length>0&&(j.agents={count:i.length,level:"warn"}),(l==null?void 0:l.status)==="failed"?j.builds={level:"error"}:jt(l,i,p)&&(j.builds={level:"warn"}),e)return t.jsx(bt,{});let b=null;return a==="agents"?b=t.jsx(Ht,{gates:i,gatesLoading:u,resolveGate:o}):a==="roadmap"?b=t.jsx(ts,{items:p,loading:h,error:N,applyOptimisticEdit:C,createItem:w,deleteItem:E,addConnection:v,removeConnection:T,fetchItemDetail:x}):a==="ideas"?b=t.jsx(fs,{}):a==="builds"&&(b=t.jsx(Ms,{active:l,loading:d,error:g,startBuild:m,abortBuild:f})),t.jsxs("div",{className:"m-root","data-testid":"mobile-root",children:[t.jsx("header",{className:"m-header",children:t.jsxs("div",{className:"m-header-bar",children:[t.jsx("div",{className:"m-header-title",children:"Compose"}),t.jsx(Bs,{})]})}),t.jsx(Us,{onNavigate:n}),t.jsx("main",{className:"m-main","data-testid":"mobile-main","data-tab":a,children:b}),t.jsx(Nt,{active:a,onSelect:n,badges:j})]})}const aa=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"}));export{aa as M,sa as N,yt as P,Qs as R,r as a,Ye as b,Xs as c,lt as d,mt as e,Pt as f,st as g,he as h,ea as i,t as j,V as k,Ke as l,xt as m,be as n,ta as o,Vs as p,it as r,Zs as s,fe as v,B as w};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{a4 as S,a7 as R,aH as Q,g as Y,s as tt,a as et,b as at,q as rt,p as nt,_ as p,l as z,c as it,F as st,I as ot,N as lt,e as ct,z as ut,G as pt}from"./App-CT0vXPgd.js";import{p as gt}from"./chunk-4BX2VUAB-CNmGyhrp.js";import{p as dt}from"./wardley-RL74JXVD-DzQEoG6X.js";import{d as _}from"./arc-BXht3LyE.js";import{o as ft}from"./ordinal-Cboi1Yqb.js";import"./mobile-Chw8RWyH.js";import"./index-8UhRLbGq.js";import"./graph-DZe55uk8.js";import"./min-hESxN-c0.js";import"./_baseUniq-CsOHc_iS.js";import"./init-Gi6I4Gst.js";function ht(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function mt(t){return t}function vt(){var t=mt,a=ht,f=null,y=S(0),s=S(R),g=S(0);function o(e){var n,l=(e=Q(e)).length,d,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,g.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n<l;++n)(u=i[c[n]=n]=+t(e[n],n,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n<l;++n,x=m)d=c[n],u=i[d],m=x+(u>0?u*h:0)+$,i[d]={data:e[d],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(g=typeof e=="function"?e:S(+e),o):g},o}var xt=pt.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,St=structuredClone(xt),yt=p(()=>structuredClone(St),"getConfig"),wt=p(()=>{T=new Map,W=F.showData,ut()},"clear"),At=p(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=p(()=>T,"getSections"),Dt=p(t=>{W=t},"setShowData"),$t=p(()=>W,"getShowData"),V={getConfig:yt,clear:wt,setDiagramTitle:nt,getDiagramTitle:rt,setAccTitle:at,getAccTitle:et,setAccDescription:tt,getAccDescription:Y,addSection:At,getSections:Ct,setShowData:Dt,getShowData:$t},Tt=p((t,a)=>{gt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),bt={parse:p(async t=>{const a=await dt("pie",t);z.debug(a),Tt(a,V)},"parse")},kt=p(t=>`
|
|
2
|
+
.pieCircle{
|
|
3
|
+
stroke: ${t.pieStrokeColor};
|
|
4
|
+
stroke-width : ${t.pieStrokeWidth};
|
|
5
|
+
opacity : ${t.pieOpacity};
|
|
6
|
+
}
|
|
7
|
+
.pieOuterCircle{
|
|
8
|
+
stroke: ${t.pieOuterStrokeColor};
|
|
9
|
+
stroke-width: ${t.pieOuterStrokeWidth};
|
|
10
|
+
fill: none;
|
|
11
|
+
}
|
|
12
|
+
.pieTitleText {
|
|
13
|
+
text-anchor: middle;
|
|
14
|
+
font-size: ${t.pieTitleTextSize};
|
|
15
|
+
fill: ${t.pieTitleTextColor};
|
|
16
|
+
font-family: ${t.fontFamily};
|
|
17
|
+
}
|
|
18
|
+
.slice {
|
|
19
|
+
font-family: ${t.fontFamily};
|
|
20
|
+
fill: ${t.pieSectionTextColor};
|
|
21
|
+
font-size:${t.pieSectionTextSize};
|
|
22
|
+
// fill: white;
|
|
23
|
+
}
|
|
24
|
+
.legend text {
|
|
25
|
+
fill: ${t.pieLegendTextColor};
|
|
26
|
+
font-family: ${t.fontFamily};
|
|
27
|
+
font-size: ${t.pieLegendTextSize};
|
|
28
|
+
}
|
|
29
|
+
`,"getStyles"),Et=kt,Mt=p(t=>{const a=[...t.values()].reduce((s,g)=>s+g,0),f=[...t.entries()].map(([s,g])=>({label:s,value:g})).filter(s=>s.value/a*100>=1);return vt().value(s=>s.value).sort(null)(f)},"createPieArcs"),Rt=p((t,a,f,y)=>{var O;z.debug(`rendering pie chart
|
|
30
|
+
`+t);const s=y.db,g=it(),o=st(s.getConfig(),g.pie),e=40,n=18,l=4,d=450,h=d,v=ot(a),c=v.append("g");c.attr("transform","translate("+h/2+","+d/2+")");const{themeVariables:i}=g;let[x]=lt(i.pieOuterStrokeWidth);x??(x=2);const w=o.textPosition,m=Math.min(h,d)/2-e,D=_().innerRadius(0).outerRadius(m),$=_().innerRadius(m*w).outerRadius(m*w);c.append("circle").attr("cx",0).attr("cy",0).attr("r",m+x/2).attr("class","pieOuterCircle");const u=s.getSections(),A=Mt(u),C=[i.pie1,i.pie2,i.pie3,i.pie4,i.pie5,i.pie6,i.pie7,i.pie8,i.pie9,i.pie10,i.pie11,i.pie12];let b=0;u.forEach(r=>{b+=r});const G=A.filter(r=>(r.data.value/b*100).toFixed(0)!=="0"),k=ft(C).domain([...u.keys()]);c.selectAll("mySlices").data(G).enter().append("path").attr("d",D).attr("fill",r=>k(r.data.label)).attr("class","pieCircle"),c.selectAll("mySlices").data(G).enter().append("text").text(r=>(r.data.value/b*100).toFixed(0)+"%").attr("transform",r=>"translate("+$.centroid(r)+")").style("text-anchor","middle").attr("class","slice");const U=c.append("text").text(s.getDiagramTitle()).attr("x",0).attr("y",-400/2).attr("class","pieTitleText"),N=[...u.entries()].map(([r,M])=>({label:r,value:M})),E=c.selectAll(".legend").data(N).enter().append("g").attr("class","legend").attr("transform",(r,M)=>{const P=n+l,Z=P*N.length/2,J=12*n,K=M*P-Z;return"translate("+J+","+K+")"});E.append("rect").attr("width",n).attr("height",n).style("fill",r=>k(r.label)).style("stroke",r=>k(r.label)),E.append("text").attr("x",n+l).attr("y",n-l).text(r=>s.getShowData()?`${r.label} [${r.value}]`:r.label);const j=Math.max(...E.selectAll("text").nodes().map(r=>(r==null?void 0:r.getBoundingClientRect().width)??0)),q=h+e+n+l+j,L=((O=U.node())==null?void 0:O.getBoundingClientRect().width)??0,H=h/2-L/2,X=h/2+L/2,B=Math.min(0,H),I=Math.max(q,X)-B;v.attr("viewBox",`${B} 0 ${I} ${d}`),ct(v,d,I,o.useMaxWidth)},"draw"),zt={draw:Rt},jt={parser:bt,db:V,renderer:zt,styles:Et};export{jt as diagram};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{s as _e,g as Ae,q as ie,p as ke,a as Fe,b as Pe,_ as o,c as wt,l as At,d as zt,e as ve,z as Ce,G as D,i as Le,K as Ee}from"./App-CT0vXPgd.js";import{l as ee}from"./linear-D158F7OT.js";import"./mobile-Chw8RWyH.js";import"./index-8UhRLbGq.js";import"./graph-DZe55uk8.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Vt=(function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],A=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],O=[1,14],Y=[1,23],G=[1,18],yt=[1,19],Tt=[1,20],dt=[1,21],Ft=[1,22],ut=[1,24],xt=[1,25],ft=[1,26],gt=[1,27],i=[1,28],Bt=[1,29],W=[1,32],U=[1,33],k=[1,34],F=[1,39],P=[1,40],v=[1,42],C=[1,44],H=[1,62],X=[1,61],L=[4,5,8,10,12,13,14,18,44,47,49,55,56,57,63,64,65,66,67],Rt=[1,65],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],I=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,90],$=[1,91],tt=[1,92],et=[1,99],it=[1,93],at=[1,96],nt=[1,94],st=[1,95],rt=[1,97],ot=[1,98],Pt=[1,102],Kt=[10,55,56,57],R=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,_,e,pt){var s=e.length-1;switch(_){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,A,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(y,[2,34]),{27:45,55:c,56:h,57:p},t(a,[2,37]),t(a,A,{24:13,32:15,33:16,34:17,43:30,58:31,31:46,4:d,5:T,10:m,12:q,13:b,14:x,18:O,25:Y,35:G,37:yt,39:Tt,41:dt,42:Ft,48:ut,50:xt,51:ft,52:gt,53:i,54:Bt,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,47]},{38:[1,48]},{40:[1,49]},t(a,[2,45]),t(a,[2,46]),{18:[1,50]},{4:d,5:T,10:m,12:q,13:b,14:x,43:51,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:m,12:q,13:b,14:x,43:52,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:m,12:q,13:b,14:x,43:53,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:m,12:q,13:b,14:x,43:54,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:m,12:q,13:b,14:x,43:55,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,10:m,12:q,13:b,14:x,43:56,58:31,60:W,61:U,63:k,64:F,65:P,66:v,67:C},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,44:[1,57],47:[1,58],58:60,59:59,63:k,64:F,65:P,66:v,67:C},t(L,[2,64]),t(L,[2,66]),t(L,[2,67]),t(L,[2,70]),t(L,[2,71]),t(L,[2,72]),t(L,[2,73]),t(L,[2,74]),t(L,[2,75]),t(L,[2,76]),t(L,[2,77]),t(L,[2,78]),t(L,[2,79]),t(L,[2,80]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:64,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,21:63},t(a,[2,53],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,49:[1,77],63:k,64:F,65:P,66:v,67:C}),t(a,[2,56],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,49:[1,78],63:k,64:F,65:P,66:v,67:C}),t(a,[2,57],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,58],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,59],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,60],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),{45:[1,79]},{44:[1,80]},t(L,[2,65]),t(L,[2,81]),t(L,[2,82]),t(L,[2,83]),{3:82,4:Rt,5:Nt,6:Wt,7:Ut,8:Qt,9:Ot,10:Ht,11:Xt,12:Mt,13:Yt,14:jt,15:Gt,18:[1,81]},t(I,[2,23]),t(I,[2,1]),t(I,[2,2]),t(I,[2,3]),t(I,[2,4]),t(I,[2,5]),t(I,[2,6]),t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12]),t(a,[2,52],{58:31,43:83,4:d,5:T,10:m,12:q,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),t(a,[2,55],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,60:W,61:U,63:k,64:F,65:P,66:v,67:C}),{46:[1,85]},{45:[1,86]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:88,23:87},t(I,[2,24]),t(a,[2,51],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,54],{59:59,58:60,4:d,5:T,8:H,10:m,12:q,13:b,14:x,18:X,63:k,64:F,65:P,66:v,67:C}),t(a,[2,47],{22:88,16:89,23:100,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,101]},t(a,[2,29],{10:Pt}),t(Kt,[2,27],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(R,[2,25]),t(R,[2,13]),t(R,[2,14]),t(R,[2,15]),t(R,[2,16]),t(R,[2,17]),t(R,[2,18]),t(R,[2,19]),t(R,[2,20]),t(R,[2,21]),t(R,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:88,16:89,23:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:89,17:nt,18:st,19:rt,20:ot,22:105},t(R,[2,26]),t(a,[2,50],{10:Pt}),t(Kt,[2,28],{16:103,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],_=[null],e=[],pt=this.table,s="",qt=0,Zt=0,me=2,Jt=1,qe=e.slice.call(arguments,1),E=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);E.setInput(r,K.yy),K.yy.lexer=E,K.yy.parser=this,typeof E.yylloc>"u"&&(E.yylloc={});var Lt=E.yylloc;e.push(Lt);var be=E.options&&E.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Se(B){g.length=g.length-2*B,_.length=_.length-B,e.length=e.length-B}o(Se,"popStack");function $t(){var B;return B=f.pop()||E.lex()||Jt,typeof B!="number"&&(B instanceof Array&&(f=B,B=f.pop()),B=l.symbols_[B]||B),B}o($t,"lex");for(var w,Z,N,Et,lt={},bt,M,te,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?N=this.defaultActions[Z]:((w===null||typeof w>"u")&&(w=$t()),N=pt[Z]&&pt[Z][w]),typeof N>"u"||!N.length||!N[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>me&&St.push("'"+this.terminals_[bt]+"'");E.showPosition?Dt="Parse error on line "+(qt+1)+`:
|
|
2
|
+
`+E.showPosition()+`
|
|
3
|
+
Expecting `+St.join(", ")+", got '"+(this.terminals_[w]||w)+"'":Dt="Parse error on line "+(qt+1)+": Unexpected "+(w==Jt?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(Dt,{text:E.match,token:this.terminals_[w]||w,line:E.yylineno,loc:Lt,expected:St})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+w);switch(N[0]){case 1:g.push(w),_.push(E.yytext),e.push(E.yylloc),g.push(N[1]),w=null,Zt=E.yyleng,s=E.yytext,qt=E.yylineno,Lt=E.yylloc;break;case 2:if(M=this.productions_[N[1]][1],lt.$=_[_.length-M],lt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},be&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Zt,qt,K.yy,N[1],_,e].concat(qe)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),_=_.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[N[1]][0]),_.push(lt.$),e.push(lt._$),te=pt[g[g.length-2]][g[g.length-1]],g.push(te);break;case 3:return!0}}return!0},"parse")},Te=(function(){var j={EOF:1,parseError:o(function(l,g){if(this.yy.parser)this.yy.parser.parseError(l,g);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,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:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var f=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),g.length-1&&(this.yylineno-=g.length-1);var _=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:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(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
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
|
|
5
|
+
`+l+"^"},"showPosition"),test_match:o(function(r,l){var g,f,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),f=r[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],g=this.performAction.call(this,this.yy,this,l,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var e in _)this[e]=_[e];return!1}return!1},"test_match"),next:o(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,l,g,f;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),e=0;e<_.length;e++)if(g=this._input.match(this.rules[_[e]]),g&&(!l||g[0].length>l[0].length)){if(l=g,f=e,this.options.backtrack_lexer){if(r=this.test_match(g,_[e]),r!==!1)return r;if(this._backtrack){l=!1;continue}else return!1}else if(!this.options.flex)break}return l?(r=this.test_match(l,_[f]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:o(function(){var l=this.next();return l||this.lex()},"lex"),begin:o(function(l){this.conditionStack.push(l)},"begin"),popState:o(function(){var l=this.conditionStack.length-1;return l>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:o(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:o(function(l){return l=this.conditionStack.length-1-Math.abs(l||0),l>=0?this.conditionStack[l]:"INITIAL"},"topState"),pushState:o(function(l){this.begin(l)},"pushState"),stateStackSize:o(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:o(function(l,g,f,_){switch(f){case 0:break;case 1:break;case 2:return 55;case 3:break;case 4:return this.begin("title"),35;case 5:return this.popState(),"title_value";case 6:return this.begin("acc_title"),37;case 7:return this.popState(),"acc_title_value";case 8:return this.begin("acc_descr"),39;case 9:return this.popState(),"acc_descr_value";case 10:this.begin("acc_descr_multiline");break;case 11:this.popState();break;case 12:return"acc_descr_multiline_value";case 13:return 48;case 14:return 50;case 15:return 49;case 16:return 51;case 17:return 52;case 18:return 53;case 19:return 54;case 20:return 25;case 21:this.begin("md_string");break;case 22:return"MD_STR";case 23:this.popState();break;case 24:this.begin("string");break;case 25:this.popState();break;case 26:return"STR";case 27:this.begin("class_name");break;case 28:return this.popState(),47;case 29:return this.begin("point_start"),44;case 30:return this.begin("point_x"),45;case 31:this.popState();break;case 32:this.popState(),this.begin("point_y");break;case 33:return this.popState(),46;case 34:return 28;case 35:return 4;case 36:return 11;case 37:return 64;case 38:return 10;case 39:return 65;case 40:return 65;case 41:return 14;case 42:return 13;case 43:return 67;case 44:return 66;case 45:return 12;case 46:return 8;case 47:return 5;case 48:return 18;case 49:return 56;case 50:return 63;case 51:return 57}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?: *x-axis *)/i,/^(?: *y-axis *)/i,/^(?: *--+> *)/i,/^(?: *quadrant-1 *)/i,/^(?: *quadrant-2 *)/i,/^(?: *quadrant-3 *)/i,/^(?: *quadrant-4 *)/i,/^(?:classDef\b)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?::::)/i,/^(?:^\w+)/i,/^(?:\s*:\s*\[\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?:\s*\] *)/i,/^(?:\s*,\s*)/i,/^(?:(1)|(0(.\d+)?))/i,/^(?: *quadrantChart *)/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s)/i,/^(?:;)/i,/^(?:[!"#$%&'*+,-.`?\\_/])/i,/^(?:$)/i],conditions:{class_name:{rules:[28],inclusive:!1},point_y:{rules:[33],inclusive:!1},point_x:{rules:[32],inclusive:!1},point_start:{rules:[30,31],inclusive:!1},acc_descr_multiline:{rules:[11,12],inclusive:!1},acc_descr:{rules:[9],inclusive:!1},acc_title:{rules:[7],inclusive:!1},title:{rules:[5],inclusive:!1},md_string:{rules:[22,23],inclusive:!1},string:{rules:[25,26],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,6,8,10,13,14,15,16,17,18,19,20,21,24,27,29,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],inclusive:!0}}};return j})();vt.lexer=Te;function mt(){this.yy={}}return o(mt,"Parser"),mt.prototype=vt,vt.Parser=mt,new mt})();Vt.parser=Vt;var De=Vt,V=Ee(),ht,ze=(ht=class{constructor(){this.classes=new Map,this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData()}getDefaultData(){return{titleText:"",quadrant1Text:"",quadrant2Text:"",quadrant3Text:"",quadrant4Text:"",xAxisLeftText:"",xAxisRightText:"",yAxisBottomText:"",yAxisTopText:"",points:[]}}getDefaultConfig(){var n,u,c,h,p,y,S,a,A,d,T,m,q,b,x,O,Y,G;return{showXAxis:!0,showYAxis:!0,showTitle:!0,chartHeight:((n=D.quadrantChart)==null?void 0:n.chartWidth)||500,chartWidth:((u=D.quadrantChart)==null?void 0:u.chartHeight)||500,titlePadding:((c=D.quadrantChart)==null?void 0:c.titlePadding)||10,titleFontSize:((h=D.quadrantChart)==null?void 0:h.titleFontSize)||20,quadrantPadding:((p=D.quadrantChart)==null?void 0:p.quadrantPadding)||5,xAxisLabelPadding:((y=D.quadrantChart)==null?void 0:y.xAxisLabelPadding)||5,yAxisLabelPadding:((S=D.quadrantChart)==null?void 0:S.yAxisLabelPadding)||5,xAxisLabelFontSize:((a=D.quadrantChart)==null?void 0:a.xAxisLabelFontSize)||16,yAxisLabelFontSize:((A=D.quadrantChart)==null?void 0:A.yAxisLabelFontSize)||16,quadrantLabelFontSize:((d=D.quadrantChart)==null?void 0:d.quadrantLabelFontSize)||16,quadrantTextTopPadding:((T=D.quadrantChart)==null?void 0:T.quadrantTextTopPadding)||5,pointTextPadding:((m=D.quadrantChart)==null?void 0:m.pointTextPadding)||5,pointLabelFontSize:((q=D.quadrantChart)==null?void 0:q.pointLabelFontSize)||12,pointRadius:((b=D.quadrantChart)==null?void 0:b.pointRadius)||5,xAxisPosition:((x=D.quadrantChart)==null?void 0:x.xAxisPosition)||"top",yAxisPosition:((O=D.quadrantChart)==null?void 0:O.yAxisPosition)||"left",quadrantInternalBorderStrokeWidth:((Y=D.quadrantChart)==null?void 0:Y.quadrantInternalBorderStrokeWidth)||1,quadrantExternalBorderStrokeWidth:((G=D.quadrantChart)==null?void 0:G.quadrantExternalBorderStrokeWidth)||2}}getDefaultThemeConfig(){return{quadrant1Fill:V.quadrant1Fill,quadrant2Fill:V.quadrant2Fill,quadrant3Fill:V.quadrant3Fill,quadrant4Fill:V.quadrant4Fill,quadrant1TextFill:V.quadrant1TextFill,quadrant2TextFill:V.quadrant2TextFill,quadrant3TextFill:V.quadrant3TextFill,quadrant4TextFill:V.quadrant4TextFill,quadrantPointFill:V.quadrantPointFill,quadrantPointTextFill:V.quadrantPointTextFill,quadrantXAxisTextFill:V.quadrantXAxisTextFill,quadrantYAxisTextFill:V.quadrantYAxisTextFill,quadrantTitleFill:V.quadrantTitleFill,quadrantInternalBorderStrokeFill:V.quadrantInternalBorderStrokeFill,quadrantExternalBorderStrokeFill:V.quadrantExternalBorderStrokeFill}}clear(){this.config=this.getDefaultConfig(),this.themeConfig=this.getDefaultThemeConfig(),this.data=this.getDefaultData(),this.classes=new Map,At.info("clear called")}setData(n){this.data={...this.data,...n}}addPoints(n){this.data.points=[...n,...this.data.points]}addClass(n,u){this.classes.set(n,u)}setConfig(n){At.trace("setConfig called with: ",n),this.config={...this.config,...n}}setThemeConfig(n){At.trace("setThemeConfig called with: ",n),this.themeConfig={...this.themeConfig,...n}}calculateSpace(n,u,c,h){const p=this.config.xAxisLabelPadding*2+this.config.xAxisLabelFontSize,y={top:n==="top"&&u?p:0,bottom:n==="bottom"&&u?p:0},S=this.config.yAxisLabelPadding*2+this.config.yAxisLabelFontSize,a={left:this.config.yAxisPosition==="left"&&c?S:0,right:this.config.yAxisPosition==="right"&&c?S:0},A=this.config.titleFontSize+this.config.titlePadding*2,d={top:h?A:0},T=this.config.quadrantPadding+a.left,m=this.config.quadrantPadding+y.top+d.top,q=this.config.chartWidth-this.config.quadrantPadding*2-a.left-a.right,b=this.config.chartHeight-this.config.quadrantPadding*2-y.top-y.bottom-d.top,x=q/2,O=b/2;return{xAxisSpace:y,yAxisSpace:a,titleSpace:d,quadrantSpace:{quadrantLeft:T,quadrantTop:m,quadrantWidth:q,quadrantHalfWidth:x,quadrantHeight:b,quadrantHalfHeight:O}}}getAxisLabels(n,u,c,h){const{quadrantSpace:p,titleSpace:y}=h,{quadrantHalfHeight:S,quadrantHeight:a,quadrantLeft:A,quadrantHalfWidth:d,quadrantTop:T,quadrantWidth:m}=p,q=!!this.data.xAxisRightText,b=!!this.data.yAxisTopText,x=[];return this.data.xAxisLeftText&&u&&x.push({text:this.data.xAxisLeftText,fill:this.themeConfig.quadrantXAxisTextFill,x:A+(q?d/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.xAxisRightText&&u&&x.push({text:this.data.xAxisRightText,fill:this.themeConfig.quadrantXAxisTextFill,x:A+d+(q?d/2:0),y:n==="top"?this.config.xAxisLabelPadding+y.top:this.config.xAxisLabelPadding+T+a+this.config.quadrantPadding,fontSize:this.config.xAxisLabelFontSize,verticalPos:q?"center":"left",horizontalPos:"top",rotation:0}),this.data.yAxisBottomText&&c&&x.push({text:this.data.yAxisBottomText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+A+m+this.config.quadrantPadding,y:T+a-(b?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),this.data.yAxisTopText&&c&&x.push({text:this.data.yAxisTopText,fill:this.themeConfig.quadrantYAxisTextFill,x:this.config.yAxisPosition==="left"?this.config.yAxisLabelPadding:this.config.yAxisLabelPadding+A+m+this.config.quadrantPadding,y:T+S-(b?S/2:0),fontSize:this.config.yAxisLabelFontSize,verticalPos:b?"center":"left",horizontalPos:"top",rotation:-90}),x}getQuadrants(n){const{quadrantSpace:u}=n,{quadrantHalfHeight:c,quadrantLeft:h,quadrantHalfWidth:p,quadrantTop:y}=u,S=[{text:{text:this.data.quadrant1Text,fill:this.themeConfig.quadrant1TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y,width:p,height:c,fill:this.themeConfig.quadrant1Fill},{text:{text:this.data.quadrant2Text,fill:this.themeConfig.quadrant2TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y,width:p,height:c,fill:this.themeConfig.quadrant2Fill},{text:{text:this.data.quadrant3Text,fill:this.themeConfig.quadrant3TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h,y:y+c,width:p,height:c,fill:this.themeConfig.quadrant3Fill},{text:{text:this.data.quadrant4Text,fill:this.themeConfig.quadrant4TextFill,x:0,y:0,fontSize:this.config.quadrantLabelFontSize,verticalPos:"center",horizontalPos:"middle",rotation:0},x:h+p,y:y+c,width:p,height:c,fill:this.themeConfig.quadrant4Fill}];for(const a of S)a.text.x=a.x+a.width/2,this.data.points.length===0?(a.text.y=a.y+a.height/2,a.text.horizontalPos="middle"):(a.text.y=a.y+this.config.quadrantTextTopPadding,a.text.horizontalPos="top");return S}getQuadrantPoints(n){const{quadrantSpace:u}=n,{quadrantHeight:c,quadrantLeft:h,quadrantTop:p,quadrantWidth:y}=u,S=ee().domain([0,1]).range([h,y+h]),a=ee().domain([0,1]).range([c+p,p]);return this.data.points.map(d=>{const T=this.classes.get(d.className);return T&&(d={...T,...d}),{x:S(d.x),y:a(d.y),fill:d.color??this.themeConfig.quadrantPointFill,radius:d.radius??this.config.pointRadius,text:{text:d.text,fill:this.themeConfig.quadrantPointTextFill,x:S(d.x),y:a(d.y)+this.config.pointTextPadding,verticalPos:"center",horizontalPos:"top",fontSize:this.config.pointLabelFontSize,rotation:0},strokeColor:d.strokeColor??this.themeConfig.quadrantPointFill,strokeWidth:d.strokeWidth??"0px"}})}getBorders(n){const u=this.config.quadrantExternalBorderStrokeWidth/2,{quadrantSpace:c}=n,{quadrantHalfHeight:h,quadrantHeight:p,quadrantLeft:y,quadrantHalfWidth:S,quadrantTop:a,quadrantWidth:A}=c;return[{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-u,y1:a,x2:y+A+u,y2:a},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y+A,y1:a+u,x2:y+A,y2:a+p-u},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y-u,y1:a+p,x2:y+A+u,y2:a+p},{strokeFill:this.themeConfig.quadrantExternalBorderStrokeFill,strokeWidth:this.config.quadrantExternalBorderStrokeWidth,x1:y,y1:a+u,x2:y,y2:a+p-u},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+S,y1:a+u,x2:y+S,y2:a+p-u},{strokeFill:this.themeConfig.quadrantInternalBorderStrokeFill,strokeWidth:this.config.quadrantInternalBorderStrokeWidth,x1:y+u,y1:a+h,x2:y+A-u,y2:a+h}]}getTitle(n){if(n)return{text:this.data.titleText,fill:this.themeConfig.quadrantTitleFill,fontSize:this.config.titleFontSize,horizontalPos:"top",verticalPos:"center",rotation:0,y:this.config.titlePadding,x:this.config.chartWidth/2}}build(){const n=this.config.showXAxis&&!!(this.data.xAxisLeftText||this.data.xAxisRightText),u=this.config.showYAxis&&!!(this.data.yAxisTopText||this.data.yAxisBottomText),c=this.config.showTitle&&!!this.data.titleText,h=this.data.points.length>0?"bottom":this.config.xAxisPosition,p=this.calculateSpace(h,n,u,c);return{points:this.getQuadrantPoints(p),quadrants:this.getQuadrants(p),axisLabels:this.getAxisLabels(h,n,u,p),borderLines:this.getBorders(p),title:this.getTitle(c)}}},o(ht,"QuadrantBuilder"),ht),ct,_t=(ct=class extends Error{constructor(n,u,c){super(`value for ${n} ${u} is invalid, please use a valid ${c}`),this.name="InvalidStyleError"}},o(ct,"InvalidStyleError"),ct);function It(t){return!/^#?([\dA-Fa-f]{6}|[\dA-Fa-f]{3})$/.test(t)}o(It,"validateHexCode");function ae(t){return!/^\d+$/.test(t)}o(ae,"validateNumber");function ne(t){return!/^\d+px$/.test(t)}o(ne,"validateSizeInPixels");var Ve=wt();function Q(t){return Le(t.trim(),Ve)}o(Q,"textSanitizer");var z=new ze;function se(t){z.setData({quadrant1Text:Q(t.text)})}o(se,"setQuadrant1Text");function re(t){z.setData({quadrant2Text:Q(t.text)})}o(re,"setQuadrant2Text");function oe(t){z.setData({quadrant3Text:Q(t.text)})}o(oe,"setQuadrant3Text");function le(t){z.setData({quadrant4Text:Q(t.text)})}o(le,"setQuadrant4Text");function he(t){z.setData({xAxisLeftText:Q(t.text)})}o(he,"setXAxisLeftText");function ce(t){z.setData({xAxisRightText:Q(t.text)})}o(ce,"setXAxisRightText");function de(t){z.setData({yAxisTopText:Q(t.text)})}o(de,"setYAxisTopText");function ue(t){z.setData({yAxisBottomText:Q(t.text)})}o(ue,"setYAxisBottomText");function kt(t){const n={};for(const u of t){const[c,h]=u.trim().split(/\s*:\s*/);if(c==="radius"){if(ae(h))throw new _t(c,h,"number");n.radius=parseInt(h)}else if(c==="color"){if(It(h))throw new _t(c,h,"hex code");n.color=h}else if(c==="stroke-color"){if(It(h))throw new _t(c,h,"hex code");n.strokeColor=h}else if(c==="stroke-width"){if(ne(h))throw new _t(c,h,"number of pixels (eg. 10px)");n.strokeWidth=h}else throw new Error(`style named ${c} is not supported.`)}return n}o(kt,"parseStyles");function xe(t,n,u,c,h){const p=kt(h);z.addPoints([{x:u,y:c,text:Q(t.text),className:n,...p}])}o(xe,"addPoint");function fe(t,n){z.addClass(t,kt(n))}o(fe,"addClass");function ge(t){z.setConfig({chartWidth:t})}o(ge,"setWidth");function pe(t){z.setConfig({chartHeight:t})}o(pe,"setHeight");function ye(){const t=wt(),{themeVariables:n,quadrantChart:u}=t;return u&&z.setConfig(u),z.setThemeConfig({quadrant1Fill:n.quadrant1Fill,quadrant2Fill:n.quadrant2Fill,quadrant3Fill:n.quadrant3Fill,quadrant4Fill:n.quadrant4Fill,quadrant1TextFill:n.quadrant1TextFill,quadrant2TextFill:n.quadrant2TextFill,quadrant3TextFill:n.quadrant3TextFill,quadrant4TextFill:n.quadrant4TextFill,quadrantPointFill:n.quadrantPointFill,quadrantPointTextFill:n.quadrantPointTextFill,quadrantXAxisTextFill:n.quadrantXAxisTextFill,quadrantYAxisTextFill:n.quadrantYAxisTextFill,quadrantExternalBorderStrokeFill:n.quadrantExternalBorderStrokeFill,quadrantInternalBorderStrokeFill:n.quadrantInternalBorderStrokeFill,quadrantTitleFill:n.quadrantTitleFill}),z.setData({titleText:ie()}),z.build()}o(ye,"getQuadrantData");var Ie=o(function(){z.clear(),Ce()},"clear"),we={setWidth:ge,setHeight:pe,setQuadrant1Text:se,setQuadrant2Text:re,setQuadrant3Text:oe,setQuadrant4Text:le,setXAxisLeftText:he,setXAxisRightText:ce,setYAxisTopText:de,setYAxisBottomText:ue,parseStyles:kt,addPoint:xe,addClass:fe,getQuadrantData:ye,clear:Ie,setAccTitle:Pe,getAccTitle:Fe,setDiagramTitle:ke,getDiagramTitle:ie,getAccDescription:Ae,setAccDescription:_e},Be=o((t,n,u,c)=>{var xt,ft,gt;function h(i){return i==="top"?"hanging":"middle"}o(h,"getDominantBaseLine");function p(i){return i==="left"?"start":"middle"}o(p,"getTextAnchor");function y(i){return`translate(${i.x}, ${i.y}) rotate(${i.rotation||0})`}o(y,"getTransformation");const S=wt();At.debug(`Rendering quadrant chart
|
|
7
|
+
`+t);const a=S.securityLevel;let A;a==="sandbox"&&(A=zt("#i"+n));const T=(a==="sandbox"?zt(A.nodes()[0].contentDocument.body):zt("body")).select(`[id="${n}"]`),m=T.append("g").attr("class","main"),q=((xt=S.quadrantChart)==null?void 0:xt.chartWidth)??500,b=((ft=S.quadrantChart)==null?void 0:ft.chartHeight)??500;ve(T,b,q,((gt=S.quadrantChart)==null?void 0:gt.useMaxWidth)??!0),T.attr("viewBox","0 0 "+q+" "+b),c.db.setHeight(b),c.db.setWidth(q);const x=c.db.getQuadrantData(),O=m.append("g").attr("class","quadrants"),Y=m.append("g").attr("class","border"),G=m.append("g").attr("class","data-points"),yt=m.append("g").attr("class","labels"),Tt=m.append("g").attr("class","title");x.title&&Tt.append("text").attr("x",0).attr("y",0).attr("fill",x.title.fill).attr("font-size",x.title.fontSize).attr("dominant-baseline",h(x.title.horizontalPos)).attr("text-anchor",p(x.title.verticalPos)).attr("transform",y(x.title)).text(x.title.text),x.borderLines&&Y.selectAll("line").data(x.borderLines).enter().append("line").attr("x1",i=>i.x1).attr("y1",i=>i.y1).attr("x2",i=>i.x2).attr("y2",i=>i.y2).style("stroke",i=>i.strokeFill).style("stroke-width",i=>i.strokeWidth);const dt=O.selectAll("g.quadrant").data(x.quadrants).enter().append("g").attr("class","quadrant");dt.append("rect").attr("x",i=>i.x).attr("y",i=>i.y).attr("width",i=>i.width).attr("height",i=>i.height).attr("fill",i=>i.fill),dt.append("text").attr("x",0).attr("y",0).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text)).text(i=>i.text.text),yt.selectAll("g.label").data(x.axisLabels).enter().append("g").attr("class","label").append("text").attr("x",0).attr("y",0).text(i=>i.text).attr("fill",i=>i.fill).attr("font-size",i=>i.fontSize).attr("dominant-baseline",i=>h(i.horizontalPos)).attr("text-anchor",i=>p(i.verticalPos)).attr("transform",i=>y(i));const ut=G.selectAll("g.data-point").data(x.points).enter().append("g").attr("class","data-point");ut.append("circle").attr("cx",i=>i.x).attr("cy",i=>i.y).attr("r",i=>i.radius).attr("fill",i=>i.fill).attr("stroke",i=>i.strokeColor).attr("stroke-width",i=>i.strokeWidth),ut.append("text").attr("x",0).attr("y",0).text(i=>i.text.text).attr("fill",i=>i.text.fill).attr("font-size",i=>i.text.fontSize).attr("dominant-baseline",i=>h(i.text.horizontalPos)).attr("text-anchor",i=>p(i.text.verticalPos)).attr("transform",i=>y(i.text))},"draw"),Re={draw:Be},Me={parser:De,db:we,renderer:Re,styles:o(()=>"","styles")};export{Me as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ge}from"./chunk-55IACEB6-CtFSLInj.js";import{s as Xe}from"./chunk-2J33WTMH-AEu6HIoY.js";import{_ as d,D as Be,b as Je,a as Ze,s as et,g as tt,p as st,q as it,c as Ne,l as qe,z as rt,C as nt,o as at,r as lt,u as ct}from"./App-Bxyif1yv.js";import"./mobile-DwmxS_O4.js";import"./index-COq21Zym.js";import"./graph-BBXaecIU.js";var Ce=(function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),z={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(z.yy[be]=this.yy[be]);S.setInput(i,z.yy),z.yy.lexer=S,z.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ze(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(ze,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,G,q,Te,J={},ye,F,Ye,_e;;){if(G=l[l.length-1],this.defaultActions[G]?q=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Ue()),q=de[G]&&de[G][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[G])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`:
|
|
1
|
+
import{g as Ge}from"./chunk-55IACEB6-D8KuKVLa.js";import{s as Xe}from"./chunk-EDXVE4YY-TPlt1bS2.js";import{_ as d,D as Be,b as Je,a as Ze,s as et,g as tt,p as st,q as it,c as Ne,l as qe,z as rt,C as nt,o as at,r as lt,u as ct}from"./App-CT0vXPgd.js";import"./mobile-Chw8RWyH.js";import"./index-8UhRLbGq.js";import"./graph-DZe55uk8.js";var Ce=(function(){var e=d(function($,i,n,l){for(n=n||{},l=$.length;l--;n[$[l]]=i);return n},"o"),r=[1,3],u=[1,4],h=[1,5],o=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],E=[1,22],p=[2,7],f=[1,26],m=[1,27],b=[1,28],k=[1,29],C=[1,33],V=[1,34],A=[1,35],v=[1,36],L=[1,37],x=[1,38],O=[1,24],w=[1,31],D=[1,32],M=[1,30],y=[1,39],_=[1,40],g=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],P=[1,61],X=[89,90],Ve=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ae=[1,70],ve=[1,71],Le=[1,72],xe=[1,73],Oe=[1,74],we=[1,75],De=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:d(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:d(function(i,n,l,s,R,t,de){var a=t.length-1;switch(R){case 4:this.$=t[a].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[a].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[a-3],t[a-4]);break;case 22:s.addRequirement(t[a-5],t[a-6]),s.setClass([t[a-5]],t[a-3]);break;case 23:s.setNewReqId(t[a-2]);break;case 24:s.setNewReqText(t[a-2]);break;case 25:s.setNewReqRisk(t[a-2]);break;case 26:s.setNewReqVerifyMethod(t[a-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[a-3]);break;case 43:s.addElement(t[a-5]),s.setClass([t[a-5]],t[a-3]);break;case 44:s.setNewElementType(t[a-2]);break;case 45:s.setNewElementDocRef(t[a-2]);break;case 48:s.addRelationship(t[a-2],t[a],t[a-4]);break;case 49:s.addRelationship(t[a-2],t[a-4],t[a]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[a-2],s.defineClass(t[a-1],t[a]);break;case 58:s.setClass(t[a-1],t[a]);break;case 59:s.setClass([t[a-2]],t[a]);break;case 60:case 62:this.$=[t[a]];break;case 61:case 63:this.$=t[a-2].concat([t[a]]);break;case 64:this.$=t[a-2],s.setCssStyle(t[a-1],t[a]);break;case 65:this.$=[t[a]];break;case 66:t[a-2].push(t[a]),this.$=t[a-2];break;case 68:this.$=t[a-1]+t[a];break}},"anonymous"),table:[{3:1,4:2,6:r,9:u,11:h,13:o},{1:[3]},{3:8,4:2,5:[1,7],6:r,9:u,11:h,13:o},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:r,9:u,11:h,13:o},{1:[2,2]},{4:17,5:E,7:13,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:E,7:42,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:43,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:44,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:45,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:46,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:47,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:48,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:49,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{4:17,5:E,7:50,8:p,9:u,11:h,13:o,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:f,22:m,23:b,24:k,25:23,33:25,41:C,42:V,43:A,44:v,45:L,46:x,54:O,72:w,74:D,77:M,89:y,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),{30:60,33:62,75:P,89:y,90:_},{30:63,33:62,75:P,89:y,90:_},{30:64,33:62,75:P,89:y,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ve,[2,81]),e(Ve,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{62:77,65:Ae,66:ve,67:Le,68:xe,69:Oe,70:we,71:De},{30:78,33:62,75:P,89:y,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:P,76:U,89:y,90:_},{5:[1,95]},{30:96,33:62,75:P,89:y,90:_},{5:[1,97]},{30:98,33:62,75:P,89:y,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(g,[2,59],{76:U}),e(g,[2,64],{76:Me}),{33:103,75:[1,102],89:y,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(g,[2,57],{76:Me}),e(g,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:y,90:_},{33:120,89:y,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(g,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(g,[2,28]),{5:[1,127]},e(g,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(g,[2,47]),{5:[1,131]},e(g,[2,48]),e(g,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:y,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(g,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(g,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(g,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(g,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(g,[2,23]),e(g,[2,24]),e(g,[2,25]),e(g,[2,26]),e(g,[2,44]),e(g,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:d(function(i,n){if(n.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=n,l}},"parseError"),parse:d(function(i){var n=this,l=[0],s=[],R=[null],t=[],de=this.table,a="",ge=0,$e=0,Ke=2,Pe=1,We=t.slice.call(arguments,1),S=Object.create(this.lexer),z={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(z.yy[be]=this.yy[be]);S.setInput(i,z.yy),z.yy.lexer=S,z.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ze(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(ze,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||Pe,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=n.symbols_[T]||T),T}d(Ue,"lex");for(var I,G,q,Te,J={},ye,F,Ye,_e;;){if(G=l[l.length-1],this.defaultActions[G]?q=this.defaultActions[G]:((I===null||typeof I>"u")&&(I=Ue()),q=de[G]&&de[G][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[G])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`:
|
|
2
2
|
`+S.showPosition()+`
|
|
3
3
|
Expecting `+_e.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ke="Parse error on line "+(ge+1)+": Unexpected "+(I==Pe?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ke,{text:S.match,token:this.terminals_[I]||I,line:S.yylineno,loc:Ie,expected:_e})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+G+", token: "+I);switch(q[0]){case 1:l.push(I),R.push(S.yytext),t.push(S.yylloc),l.push(q[1]),I=null,$e=S.yyleng,a=S.yytext,ge=S.yylineno,Ie=S.yylloc;break;case 2:if(F=this.productions_[q[1]][1],J.$=R[R.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},je&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(J,[a,$e,ge,z.yy,q[1],R,t].concat(We)),typeof Te<"u")return Te;F&&(l=l.slice(0,-1*F*2),R=R.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[q[1]][0]),R.push(J.$),t.push(J._$),Ye=de[l[l.length-2]][l[l.length-1]],l.push(Ye);break;case 3:return!0}}return!0},"parse")},He=(function(){var $={EOF:1,parseError:d(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:d(function(i,n){return this.yy=n||this.yy||{},this._input=i,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:d(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var n=i.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:d(function(i){var n=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var s=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),l.length-1&&(this.yylineno-=l.length-1);var R=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:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[R[0],R[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:d(function(){return this._more=!0,this},"more"),reject:d(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:d(function(i){this.unput(this.match.slice(i))},"less"),pastInput:d(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var i=this.pastInput(),n=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{p as _t,q as xt,s as vt,g as bt,b as wt,a as St,_ as p,c as lt,A as Lt,d as H,Y as Et,z as At,k as Tt}from"./App-CT0vXPgd.js";import{o as Mt}from"./ordinal-Cboi1Yqb.js";import"./mobile-Chw8RWyH.js";import"./index-8UhRLbGq.js";import"./graph-DZe55uk8.js";import"./init-Gi6I4Gst.js";function Nt(t){for(var e=t.length/6|0,i=new Array(e),a=0;a<e;)i[a]="#"+t.slice(a*6,++a*6);return i}const It=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i<a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i<h||i===void 0&&h>=h)&&(i=h)}return i}function pt(t,e){let i;if(e===void 0)for(const a of t)a!=null&&(i>a||i===void 0&&a>=a)&&(i=a);else{let a=-1;for(let h of t)(h=e(h,++a,t))!=null&&(i>h||i===void 0&&h>=h)&&(i=h)}return i}function nt(t,e){let i=0;if(e===void 0)for(let a of t)(a=+a)&&(i+=a);else{let a=-1;for(let h of t)(h=+e(h,++a,t))&&(i+=h)}return i}function Pt(t){return t.target.depth}function Ct(t){return t.depth}function Ot(t,e){return e-1-t.height}function mt(t,e){return t.sourceLinks.length?t.depth:e-1}function zt(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function X(t){return function(){return t}}function ut(t,e){return Q(t.source,e.source)||t.index-e.index}function ht(t,e){return Q(t.target,e.target)||t.index-e.index}function Q(t,e){return t.y0-e.y0}function it(t){return t.value}function Dt(t){return t.index}function $t(t){return t.nodes}function jt(t){return t.links}function ft(t,e){const i=t.get(e);if(!i)throw new Error("missing: "+e);return i}function yt({nodes:t}){for(const e of t){let i=e.y0,a=i;for(const h of e.sourceLinks)h.y0=i+h.width/2,i+=h.width;for(const h of e.targetLinks)h.y1=a+h.width/2,a+=h.width}}function Bt(){let t=0,e=0,i=1,a=1,h=24,d=8,m,_=Dt,s=mt,o,l,x=$t,v=jt,y=6;function b(){const n={nodes:x.apply(null,arguments),links:v.apply(null,arguments)};return M(n),T(n),N(n),C(n),S(n),yt(n),n}b.update=function(n){return yt(n),n},b.nodeId=function(n){return arguments.length?(_=typeof n=="function"?n:X(n),b):_},b.nodeAlign=function(n){return arguments.length?(s=typeof n=="function"?n:X(n),b):s},b.nodeSort=function(n){return arguments.length?(o=n,b):o},b.nodeWidth=function(n){return arguments.length?(h=+n,b):h},b.nodePadding=function(n){return arguments.length?(d=m=+n,b):d},b.nodes=function(n){return arguments.length?(x=typeof n=="function"?n:X(n),b):x},b.links=function(n){return arguments.length?(v=typeof n=="function"?n:X(n),b):v},b.linkSort=function(n){return arguments.length?(l=n,b):l},b.size=function(n){return arguments.length?(t=e=0,i=+n[0],a=+n[1],b):[i-t,a-e]},b.extent=function(n){return arguments.length?(t=+n[0][0],i=+n[1][0],e=+n[0][1],a=+n[1][1],b):[[t,e],[i,a]]},b.iterations=function(n){return arguments.length?(y=+n,b):y};function M({nodes:n,links:f}){for(const[c,r]of n.entries())r.index=c,r.sourceLinks=[],r.targetLinks=[];const u=new Map(n.map((c,r)=>[_(c,r,n),c]));for(const[c,r]of f.entries()){r.index=c;let{source:k,target:w}=r;typeof k!="object"&&(k=r.source=ft(u,k)),typeof w!="object"&&(w=r.target=ft(u,w)),k.sourceLinks.push(r),w.targetLinks.push(r)}if(l!=null)for(const{sourceLinks:c,targetLinks:r}of n)c.sort(l),r.sort(l)}function T({nodes:n}){for(const f of n)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function N({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.depth=r;for(const{target:w}of k.sourceLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function C({nodes:n}){const f=n.length;let u=new Set(n),c=new Set,r=0;for(;u.size;){for(const k of u){k.height=r;for(const{source:w}of k.targetLinks)c.add(w)}if(++r>f)throw new Error("circular link");u=c,c=new Set}}function D({nodes:n}){const f=ct(n,r=>r.depth)+1,u=(i-t-h)/(f-1),c=new Array(f);for(const r of n){const k=Math.max(0,Math.min(f-1,Math.floor(s.call(null,r,f))));r.layer=k,r.x0=t+k*u,r.x1=r.x0+h,c[k]?c[k].push(r):c[k]=[r]}if(o)for(const r of c)r.sort(o);return c}function R(n){const f=pt(n,u=>(a-e-(u.length-1)*m)/nt(u,it));for(const u of n){let c=e;for(const r of u){r.y0=c,r.y1=c+r.value*f,c=r.y1+m;for(const k of r.sourceLinks)k.width=k.value*f}c=(a-c+m)/(u.length+1);for(let r=0;r<u.length;++r){const k=u[r];k.y0+=c*(r+1),k.y1+=c*(r+1)}A(u)}}function S(n){const f=D(n);m=Math.min(d,(a-e)/(ct(f,u=>u.length)-1)),R(f);for(let u=0;u<y;++u){const c=Math.pow(.99,u),r=Math.max(1-c,(u+1)/y);B(f,c,r),P(f,c,r)}}function P(n,f,u){for(let c=1,r=n.length;c<r;++c){const k=n[c];for(const w of k){let L=0,F=0;for(const{source:Y,value:et}of w.targetLinks){let q=et*(w.layer-Y.layer);L+=$(Y,w)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function B(n,f,u){for(let c=n.length,r=c-2;r>=0;--r){const k=n[r];for(const w of k){let L=0,F=0;for(const{target:Y,value:et}of w.sourceLinks){let q=et*(Y.layer-w.layer);L+=I(w,Y)*q,F+=q}if(!(F>0))continue;let G=(L/F-w.y0)*f;w.y0+=G,w.y1+=G,E(w)}o===void 0&&k.sort(Q),O(k,u)}}function O(n,f){const u=n.length>>1,c=n[u];g(n,c.y0-m,u-1,f),z(n,c.y1+m,u+1,f),g(n,a,n.length-1,f),z(n,e,0,f)}function z(n,f,u,c){for(;u<n.length;++u){const r=n[u],k=(f-r.y0)*c;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+m}}function g(n,f,u,c){for(;u>=0;--u){const r=n[u],k=(r.y1-f)*c;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-m}}function E({sourceLinks:n,targetLinks:f}){if(l===void 0){for(const{source:{sourceLinks:u}}of f)u.sort(ht);for(const{target:{targetLinks:u}}of n)u.sort(ut)}}function A(n){if(l===void 0)for(const{sourceLinks:f,targetLinks:u}of n)f.sort(ht),u.sort(ut)}function $(n,f){let u=n.y0-(n.sourceLinks.length-1)*m/2;for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u+=r+m}for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u-=r}return u}function I(n,f){let u=f.y0-(f.targetLinks.length-1)*m/2;for(const{source:c,width:r}of f.targetLinks){if(c===n)break;u+=r+m}for(const{target:c,width:r}of n.sourceLinks){if(c===f)break;u-=r}return u}return b}var st=Math.PI,rt=2*st,V=1e-6,Rt=rt-V;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function kt(){return new ot}ot.prototype=kt.prototype={constructor:ot,moveTo:function(t,e){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,e){this._+="L"+(this._x1=+t)+","+(this._y1=+e)},quadraticCurveTo:function(t,e,i,a){this._+="Q"+ +t+","+ +e+","+(this._x1=+i)+","+(this._y1=+a)},bezierCurveTo:function(t,e,i,a,h,d){this._+="C"+ +t+","+ +e+","+ +i+","+ +a+","+(this._x1=+h)+","+(this._y1=+d)},arcTo:function(t,e,i,a,h){t=+t,e=+e,i=+i,a=+a,h=+h;var d=this._x1,m=this._y1,_=i-t,s=a-e,o=d-t,l=m-e,x=o*o+l*l;if(h<0)throw new Error("negative radius: "+h);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=e);else if(x>V)if(!(Math.abs(l*_-s*o)>V)||!h)this._+="L"+(this._x1=t)+","+(this._y1=e);else{var v=i-d,y=a-m,b=_*_+s*s,M=v*v+y*y,T=Math.sqrt(b),N=Math.sqrt(x),C=h*Math.tan((st-Math.acos((b+x-M)/(2*T*N)))/2),D=C/N,R=C/T;Math.abs(D-1)>V&&(this._+="L"+(t+D*o)+","+(e+D*l)),this._+="A"+h+","+h+",0,0,"+ +(l*v>o*y)+","+(this._x1=t+R*_)+","+(this._y1=e+R*s)}},arc:function(t,e,i,a,h,d){t=+t,e=+e,i=+i,d=!!d;var m=i*Math.cos(a),_=i*Math.sin(a),s=t+m,o=e+_,l=1^d,x=d?a-h:h-a;if(i<0)throw new Error("negative radius: "+i);this._x1===null?this._+="M"+s+","+o:(Math.abs(this._x1-s)>V||Math.abs(this._y1-o)>V)&&(this._+="L"+s+","+o),i&&(x<0&&(x=x%rt+rt),x>Rt?this._+="A"+i+","+i+",0,1,"+l+","+(t-m)+","+(e-_)+"A"+i+","+i+",0,1,"+l+","+(this._x1=s)+","+(this._y1=o):x>V&&(this._+="A"+i+","+i+",0,"+ +(x>=st)+","+l+","+(this._x1=t+i*Math.cos(h))+","+(this._y1=e+i*Math.sin(h))))},rect:function(t,e,i,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+e)+"h"+ +i+"v"+ +a+"h"+-i+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Ft(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Ut(t){return t.source}function Gt(t){return t.target}function Yt(t){var e=Ut,i=Gt,a=Ft,h=Vt,d=null;function m(){var _,s=Wt.call(arguments),o=e.apply(this,s),l=i.apply(this,s);if(d||(d=_=kt()),t(d,+a.apply(this,(s[0]=o,s)),+h.apply(this,s),+a.apply(this,(s[0]=l,s)),+h.apply(this,s)),_)return d=null,_+""||null}return m.source=function(_){return arguments.length?(e=_,m):e},m.target=function(_){return arguments.length?(i=_,m):i},m.x=function(_){return arguments.length?(a=typeof _=="function"?_:dt(+_),m):a},m.y=function(_){return arguments.length?(h=typeof _=="function"?_:dt(+_),m):h},m.context=function(_){return arguments.length?(d=_??null,m):d},m}function qt(t,e,i,a,h){t.moveTo(e,i),t.bezierCurveTo(e=(e+a)/2,i,e,h,a,h)}function Ht(){return Yt(qt)}function Xt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Ht().source(Xt).target(Qt)}var at=(function(){var t=p(function(_,s,o,l){for(o=o||{},l=_.length;l--;o[_[l]]=s);return o},"o"),e=[1,9],i=[1,10],a=[1,5,10,12],h={trace:p(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:p(function(s,o,l,x,v,y,b){var M=y.length-1;switch(v){case 7:const T=x.findOrCreateNode(y[M-4].trim().replaceAll('""','"')),N=x.findOrCreateNode(y[M-2].trim().replaceAll('""','"')),C=parseFloat(y[M].trim());x.addLink(T,N,C);break;case 8:case 9:case 11:this.$=y[M];break;case 10:this.$=y[M-1];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:e,20:i},{1:[2,6],7:11,10:[1,12]},t(i,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(a,[2,8]),t(a,[2,9]),{19:[1,16]},t(a,[2,11]),{1:[2,1]},{1:[2,5]},t(i,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:e,20:i},{15:18,16:7,17:8,18:e,20:i},{18:[1,19]},t(i,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:e,20:i},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:p(function(s,o){if(o.recoverable)this.trace(s);else{var l=new Error(s);throw l.hash=o,l}},"parseError"),parse:p(function(s){var o=this,l=[0],x=[],v=[null],y=[],b=this.table,M="",T=0,N=0,C=2,D=1,R=y.slice.call(arguments,1),S=Object.create(this.lexer),P={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(P.yy[B]=this.yy[B]);S.setInput(s,P.yy),P.yy.lexer=S,P.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var O=S.yylloc;y.push(O);var z=S.options&&S.options.ranges;typeof P.yy.parseError=="function"?this.parseError=P.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function g(L){l.length=l.length-2*L,v.length=v.length-L,y.length=y.length-L}p(g,"popStack");function E(){var L;return L=x.pop()||S.lex()||D,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=o.symbols_[L]||L),L}p(E,"lex");for(var A,$,I,n,f={},u,c,r,k;;){if($=l[l.length-1],this.defaultActions[$]?I=this.defaultActions[$]:((A===null||typeof A>"u")&&(A=E()),I=b[$]&&b[$][A]),typeof I>"u"||!I.length||!I[0]){var w="";k=[];for(u in b[$])this.terminals_[u]&&u>C&&k.push("'"+this.terminals_[u]+"'");S.showPosition?w="Parse error on line "+(T+1)+`:
|
|
2
|
+
`+S.showPosition()+`
|
|
3
|
+
Expecting `+k.join(", ")+", got '"+(this.terminals_[A]||A)+"'":w="Parse error on line "+(T+1)+": Unexpected "+(A==D?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(w,{text:S.match,token:this.terminals_[A]||A,line:S.yylineno,loc:O,expected:k})}if(I[0]instanceof Array&&I.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+A);switch(I[0]){case 1:l.push(A),v.push(S.yytext),y.push(S.yylloc),l.push(I[1]),A=null,N=S.yyleng,M=S.yytext,T=S.yylineno,O=S.yylloc;break;case 2:if(c=this.productions_[I[1]][1],f.$=v[v.length-c],f._$={first_line:y[y.length-(c||1)].first_line,last_line:y[y.length-1].last_line,first_column:y[y.length-(c||1)].first_column,last_column:y[y.length-1].last_column},z&&(f._$.range=[y[y.length-(c||1)].range[0],y[y.length-1].range[1]]),n=this.performAction.apply(f,[M,N,T,P.yy,I[1],v,y].concat(R)),typeof n<"u")return n;c&&(l=l.slice(0,-1*c*2),v=v.slice(0,-1*c),y=y.slice(0,-1*c)),l.push(this.productions_[I[1]][0]),v.push(f.$),y.push(f._$),r=b[l[l.length-2]][l[l.length-1]],l.push(r);break;case 3:return!0}}return!0},"parse")},d=(function(){var _={EOF:1,parseError:p(function(o,l){if(this.yy.parser)this.yy.parser.parseError(o,l);else throw new Error(o)},"parseError"),setInput:p(function(s,o){return this.yy=o||this.yy||{},this._input=s,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:p(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var o=s.match(/(?:\r\n?|\n).*/g);return o?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:p(function(s){var o=s.length,l=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-o),this.offset-=o;var x=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),l.length-1&&(this.yylineno-=l.length-1);var v=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:l?(l.length===x.length?this.yylloc.first_column:0)+x[x.length-l.length].length-l[0].length:this.yylloc.first_column-o},this.options.ranges&&(this.yylloc.range=[v[0],v[0]+this.yyleng-o]),this.yyleng=this.yytext.length,this},"unput"),more:p(function(){return this._more=!0,this},"more"),reject:p(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
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:p(function(s){this.unput(this.match.slice(s))},"less"),pastInput:p(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:p(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:p(function(){var s=this.pastInput(),o=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
+
`+o+"^"},"showPosition"),test_match:p(function(s,o){var l,x,v;if(this.options.backtrack_lexer&&(v={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(v.yylloc.range=this.yylloc.range.slice(0))),x=s[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(s[0].length),this.matched+=s[0],l=this.performAction.call(this,this.yy,this,o,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var y in v)this[y]=v[y];return!1}return!1},"test_match"),next:p(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,o,l,x;this._more||(this.yytext="",this.match="");for(var v=this._currentRules(),y=0;y<v.length;y++)if(l=this._input.match(this.rules[v[y]]),l&&(!o||l[0].length>o[0].length)){if(o=l,x=y,this.options.backtrack_lexer){if(s=this.test_match(l,v[y]),s!==!1)return s;if(this._backtrack){o=!1;continue}else return!1}else if(!this.options.flex)break}return o?(s=this.test_match(o,v[x]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:p(function(){var o=this.next();return o||this.lex()},"lex"),begin:p(function(o){this.conditionStack.push(o)},"begin"),popState:p(function(){var o=this.conditionStack.length-1;return o>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:p(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:p(function(o){return o=this.conditionStack.length-1-Math.abs(o||0),o>=0?this.conditionStack[o]:"INITIAL"},"topState"),pushState:p(function(o){this.begin(o)},"pushState"),stateStackSize:p(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:p(function(o,l,x,v){switch(x){case 0:return this.pushState("csv"),4;case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}};return _})();h.lexer=d;function m(){this.yy={}}return p(m,"Parser"),m.prototype=h,h.Parser=m,new m})();at.parser=at;var K=at,J=[],tt=[],Z=new Map,Zt=p(()=>{J=[],tt=[],Z=new Map,At()},"clear"),W,Jt=(W=class{constructor(e,i,a=0){this.source=e,this.target=i,this.value=a}},p(W,"SankeyLink"),W),te=p((t,e,i)=>{J.push(new Jt(t,e,i))},"addLink"),U,ee=(U=class{constructor(e){this.ID=e}},p(U,"SankeyNode"),U),ne=p(t=>{t=Tt.sanitizeText(t,lt());let e=Z.get(t);return e===void 0&&(e=new ee(t),Z.set(t,e),tt.push(e)),e},"findOrCreateNode"),ie=p(()=>tt,"getNodes"),se=p(()=>J,"getLinks"),re=p(()=>({nodes:tt.map(t=>({id:t.ID})),links:J.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),oe={nodesMap:Z,getConfig:p(()=>lt().sankey,"getConfig"),getNodes:ie,getLinks:se,getGraph:re,addLink:te,findOrCreateNode:ne,getAccTitle:St,setAccTitle:wt,getAccDescription:bt,setAccDescription:vt,getDiagramTitle:xt,setDiagramTitle:_t,clear:Zt},j,gt=(j=class{static next(e){return new j(e+ ++j.count)}constructor(e){this.id=e,this.href=`#${e}`}toString(){return"url("+this.href+")"}},p(j,"Uid"),j.count=0,j),ae={left:Ct,right:Ot,center:zt,justify:mt},le=p(function(t,e,i,a){const{securityLevel:h,sankey:d}=lt(),m=Lt.sankey;let _;h==="sandbox"&&(_=H("#i"+e));const s=h==="sandbox"?H(_.nodes()[0].contentDocument.body):H("body"),o=h==="sandbox"?s.select(`[id="${e}"]`):H(`[id="${e}"]`),l=(d==null?void 0:d.width)??m.width,x=(d==null?void 0:d.height)??m.width,v=(d==null?void 0:d.useMaxWidth)??m.useMaxWidth,y=(d==null?void 0:d.nodeAlignment)??m.nodeAlignment,b=(d==null?void 0:d.prefix)??m.prefix,M=(d==null?void 0:d.suffix)??m.suffix,T=(d==null?void 0:d.showValues)??m.showValues,N=a.db.getGraph(),C=ae[y];Bt().nodeId(g=>g.id).nodeWidth(10).nodePadding(10+(T?15:0)).nodeAlign(C).extent([[0,0],[l,x]])(N);const S=Mt(It);o.append("g").attr("class","nodes").selectAll(".node").data(N.nodes).join("g").attr("class","node").attr("id",g=>(g.uid=gt.next("node-")).id).attr("transform",function(g){return"translate("+g.x0+","+g.y0+")"}).attr("x",g=>g.x0).attr("y",g=>g.y0).append("rect").attr("height",g=>g.y1-g.y0).attr("width",g=>g.x1-g.x0).attr("fill",g=>S(g.id));const P=p(({id:g,value:E})=>T?`${g}
|
|
7
|
+
${b}${Math.round(E*100)/100}${M}`:g,"getText");o.append("g").attr("class","node-labels").attr("font-size",14).selectAll("text").data(N.nodes).join("text").attr("x",g=>g.x0<l/2?g.x1+6:g.x0-6).attr("y",g=>(g.y1+g.y0)/2).attr("dy",`${T?"0":"0.35"}em`).attr("text-anchor",g=>g.x0<l/2?"start":"end").text(P);const B=o.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(N.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),O=(d==null?void 0:d.linkColor)??"gradient";if(O==="gradient"){const g=B.append("linearGradient").attr("id",E=>(E.uid=gt.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",E=>E.source.x1).attr("x2",E=>E.target.x0);g.append("stop").attr("offset","0%").attr("stop-color",E=>S(E.source.id)),g.append("stop").attr("offset","100%").attr("stop-color",E=>S(E.target.id))}let z;switch(O){case"gradient":z=p(g=>g.uid,"coloring");break;case"source":z=p(g=>S(g.source.id),"coloring");break;case"target":z=p(g=>S(g.target.id),"coloring");break;default:z=O}B.append("path").attr("d",Kt()).attr("stroke",z).attr("stroke-width",g=>Math.max(1,g.width)),Et(void 0,o,0,v)},"draw"),ce={draw:le},ue=p(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,`
|
|
8
|
+
`).trim(),"prepareTextForParsing"),he=p(t=>`.label {
|
|
9
|
+
font-family: ${t.fontFamily};
|
|
10
|
+
}`,"getStyles"),fe=he,ye=K.parse.bind(K);K.parse=t=>ye(ue(t));var xe={styles:fe,parser:K,db:oe,renderer:ce};export{xe as diagram};
|