@smartmemory/compose 0.2.56-beta → 0.2.57-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/dist/assets/{App-B4vuNX1g.js → App-BmhlHOXF.js} +240 -240
- package/dist/assets/{abnfDiagram-VRR7QNED-B8gEiWHf.js → abnfDiagram-VRR7QNED-CMOTYAnt.js} +1 -1
- package/dist/assets/{arc-Bm5kTLjD.js → arc-BJAv_6dL.js} +1 -1
- package/dist/assets/{architectureDiagram-ZJ3FMSHR-CBaqdB_L.js → architectureDiagram-ZJ3FMSHR-xa4DLUcp.js} +1 -1
- package/dist/assets/{blockDiagram-677ZJIJ3-RfS1bm8E.js → blockDiagram-677ZJIJ3-BdkDqeQF.js} +1 -1
- package/dist/assets/{browser-Cr0recrN.js → browser-CvETNQNv.js} +1 -1
- package/dist/assets/{c4Diagram-LMCZKHZV-BFv92TMM.js → c4Diagram-LMCZKHZV-DiNrLIuL.js} +1 -1
- package/dist/assets/channel-CYErfopw.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-B2XD65Ql.js → chunk-2Q5K7J3B-BsjtgrSL.js} +1 -1
- package/dist/assets/{chunk-32BRIVSS-CLJH-LjM.js → chunk-32BRIVSS-DpImULWy.js} +1 -1
- package/dist/assets/{chunk-5VM5RSS4-BkOdBdcj.js → chunk-5VM5RSS4-DTdG5JnR.js} +1 -1
- package/dist/assets/{chunk-EX3LRPZG-BY9ywAYh.js → chunk-EX3LRPZG-Cj1jNuKY.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-CBBIoS07.js → chunk-JWPE2WC7-DwQ0wwWn.js} +1 -1
- package/dist/assets/{chunk-MOJQB5TN-BZFkgaBr.js → chunk-MOJQB5TN-DZZa7unc.js} +1 -1
- package/dist/assets/{chunk-RYQCIY6F-C0ZEmfqx.js → chunk-RYQCIY6F-CgdjqYQj.js} +1 -1
- package/dist/assets/{chunk-V7JOEXUC-CKNWOjmw.js → chunk-V7JOEXUC-DrPIj6XI.js} +1 -1
- package/dist/assets/{chunk-VR4S4FIN-Bx3WjdJ3.js → chunk-VR4S4FIN-BBUOVC5W.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-Ct9K5k9G.js → chunk-XXDRQBXY-BEIiZ6gS.js} +1 -1
- package/dist/assets/classDiagram-OUVF2IWQ-qCC_hnXu.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-qCC_hnXu.js +1 -0
- package/dist/assets/{cose-bilkent-JH36ORCC-nz4ydSEO.js → cose-bilkent-JH36ORCC-ClFTQEyD.js} +1 -1
- package/dist/assets/{cynefin-VYW2F7L2-DID2ucPE.js → cynefin-VYW2F7L2-5Bp7xFO0.js} +1 -1
- package/dist/assets/{cynefinDiagram-TSTJHNR4-YbvuXwBB.js → cynefinDiagram-TSTJHNR4-C-0QlSda.js} +1 -1
- package/dist/assets/{dagre-VKFMJZFB-DxTA5-If.js → dagre-VKFMJZFB-DLkqsfBy.js} +1 -1
- package/dist/assets/{diagram-FQU43EPY-BIaCD_qo.js → diagram-FQU43EPY-Cwh_tJ_r.js} +1 -1
- package/dist/assets/{diagram-G47NLZAW-DK_qkNJs.js → diagram-G47NLZAW-CvvAjulf.js} +1 -1
- package/dist/assets/{diagram-NH7WQ7WH-CrJVSMoz.js → diagram-NH7WQ7WH-CCoyx8_e.js} +1 -1
- package/dist/assets/{diagram-OA4YK3LP-Bm7HIxZi.js → diagram-OA4YK3LP-DfjhKYCp.js} +1 -1
- package/dist/assets/{diagram-WEI45ONY-Bu6nbQK2.js → diagram-WEI45ONY-Vjz0ygfB.js} +1 -1
- package/dist/assets/{ebnfDiagram-CCIWWBDH-B7mnwRX5.js → ebnfDiagram-CCIWWBDH-GsA8c6g2.js} +1 -1
- package/dist/assets/{erDiagram-Q63AITRT-BRAfRVRu.js → erDiagram-Q63AITRT-Cc0lJ9sQ.js} +1 -1
- package/dist/assets/{flowDiagram-23GEKE2U-DGbxzKqF.js → flowDiagram-23GEKE2U-C_sotK-k.js} +1 -1
- package/dist/assets/{ganttDiagram-NO4QXBWP-CW_0kejm.js → ganttDiagram-NO4QXBWP-BBtu_WUe.js} +1 -1
- package/dist/assets/{gitGraphDiagram-IHSO6WYX-Bmy0T13a.js → gitGraphDiagram-IHSO6WYX-BV_aSB8-.js} +1 -1
- package/dist/assets/{graph-xkel59g2.js → graph--wGAvskB.js} +1 -1
- package/dist/assets/{index-D4TlupB7.js → index-CKfOVv2N.js} +3 -3
- package/dist/assets/{infoDiagram-FWYZ7A6U-CWPUMg-E.js → infoDiagram-FWYZ7A6U-DMAvNGtX.js} +1 -1
- package/dist/assets/{ishikawaDiagram-FXEZZL3T-DkNHdDsm.js → ishikawaDiagram-FXEZZL3T-DfQB91MZ.js} +1 -1
- package/dist/assets/{journeyDiagram-5HDEW3XC-CEzDprBt.js → journeyDiagram-5HDEW3XC-Bq4Llm9o.js} +1 -1
- package/dist/assets/{kanban-definition-HUTT4EX6-BfY8Rvep.js → kanban-definition-HUTT4EX6-DTXHiDiE.js} +1 -1
- package/dist/assets/{linear-DbaFz_Eo.js → linear-BQSYZcVg.js} +1 -1
- package/dist/assets/{mindmap-definition-LN4V7U3C-DPep1uhn.js → mindmap-definition-LN4V7U3C-KuH2NIj0.js} +1 -1
- package/dist/assets/mobile-PV1zQVwv.js +17 -0
- package/dist/assets/{pegDiagram-2B236MQR-D3ucuvxJ.js → pegDiagram-2B236MQR-BKoNGQFr.js} +1 -1
- package/dist/assets/{pieDiagram-ENE6RG2P-BP6PrvRT.js → pieDiagram-ENE6RG2P-EpYv162Y.js} +1 -1
- package/dist/assets/{quadrantDiagram-ABIIQ3AL-DqL3BMFc.js → quadrantDiagram-ABIIQ3AL-C9deUjQ2.js} +1 -1
- package/dist/assets/{railroadDiagram-RFXS5EU6-UGGWX3B7.js → railroadDiagram-RFXS5EU6-Csqw2hK9.js} +1 -1
- package/dist/assets/{requirementDiagram-TGXJPOKE-BwtWKMbS.js → requirementDiagram-TGXJPOKE-DCuz3emr.js} +1 -1
- package/dist/assets/{sankeyDiagram-HTMAVEWB-CHNubde1.js → sankeyDiagram-HTMAVEWB-BTeTL24f.js} +1 -1
- package/dist/assets/{sequenceDiagram-DBY2YBRQ-DmXC79Eq.js → sequenceDiagram-DBY2YBRQ-Cf1ZkTwO.js} +1 -1
- package/dist/assets/{sizeCapture-X5ZJPWSS-B_tckiVY.js → sizeCapture-X5ZJPWSS-D3Lbewzg.js} +1 -1
- package/dist/assets/{stateDiagram-2N3HPSRC-CU-NWaBE.js → stateDiagram-2N3HPSRC-O8l37yJI.js} +1 -1
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BWqk_9py.js +1 -0
- package/dist/assets/{swimlanes-5IMT3BWC-D5uOTtln.js → swimlanes-5IMT3BWC-BikmTh8b.js} +2 -2
- package/dist/assets/swimlanesDiagram-G3AALYLV-C60ICdks.js +8 -0
- package/dist/assets/{timeline-definition-FHXFAJF6-lfUZ73z6.js → timeline-definition-FHXFAJF6-BOxSosG0.js} +1 -1
- package/dist/assets/{vennDiagram-L72KCM5P-DpsKaW7a.js → vennDiagram-L72KCM5P-BSClOErZ.js} +1 -1
- package/dist/assets/{wardleyDiagram-EHGQE667-DF9TcdSf.js → wardleyDiagram-EHGQE667-DHFRjOK0.js} +1 -1
- package/dist/assets/{xychartDiagram-FW5EYKEG-DrO8j_TX.js → xychartDiagram-FW5EYKEG-Dh1v4x-O.js} +1 -1
- package/dist/index.html +2 -2
- package/lib/feature-writer.js +24 -5
- package/package.json +1 -1
- package/server/settings-routes.js +11 -4
- package/server/settings-store.js +53 -5
- package/dist/assets/channel-BwltV6wa.js +0 -1
- package/dist/assets/classDiagram-OUVF2IWQ-D4b7dksL.js +0 -1
- package/dist/assets/classDiagram-v2-EOCWNBFH-D4b7dksL.js +0 -1
- package/dist/assets/mobile-CNLMhdFP.js +0 -17
- package/dist/assets/stateDiagram-v2-6OUMAXLB-C-St-BDG.js +0 -1
- package/dist/assets/swimlanesDiagram-G3AALYLV-B5KMjp5z.js +0 -8
|
@@ -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}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 O(c){var k={"=":"=0",":":"=2"};return"$"+c.replace(/[=:]/g,function(_){return k[_]})}var L=/\/+/g;function F(c,k){return typeof c=="object"&&c!==null&&c.key!=null?O(""+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(L,"$&/")+"/"),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(L,"$&/")+"/")+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.7",I}var $e;function it(){return $e||($e=1,ve.exports=rt()),ve.exports}var r=it();const lt=st(r),Vs=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 Qs(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 Zs(){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 ea(){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==="agentComplete"||m.type==="agentKilled")&&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 Lt(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=>Lt(f)===a):i,[i,a]),allEvents:i,connected:o}}function Ot(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:Ot(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),[O,L]=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),L(""),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=O.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,O]),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),L(""),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:O,onChange:R=>L(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),L(""),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(O=>!(g.length&&!g.includes(O.status)||f&&O.group!==f||!es(O,h))),[e,g,f,h]),y=r.useMemo(()=>e.find(O=>O.id===C)||null,[e,C]),S=O=>{m(L=>L.includes(O)?L.filter(F=>F!==O):[...L,O])},A=async(O,L)=>{const F=await n(O,L);F!=null&&F.ok?w(null):x((F==null?void 0:F.error)||"Save failed")},M=async O=>{const L=await(i==null?void 0:i(O));if(!(L!=null&&L.ok))throw new Error((L==null?void 0:L.error)||"Create failed")},P=async O=>{const L=await(u==null?void 0:u(O));L!=null&&L.ok?w(null):x((L==null?void 0:L.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((O,L)=>t.jsx("div",{className:"m-skel-card"},L))}):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(O=>t.jsx("li",{children:t.jsx(Kt,{item:O,onSelect:L=>w(L.id)})},O.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 Le(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(!Le(n.status)){a.push({type:"step",step:n}),s++;continue}let i=s;for(;i<e.length&&Le(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 Oe=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,Oe)+(e.failureReason.length>Oe?"…":""):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 ta(){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 Ls=new Set(["complete","completed"]);function Os({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&&Ls.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}=Os({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,O=m.current,L=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})),L.size>0&&(F=F.filter(Y=>!L.has(Y.id))),O.size>0){const Y=new Set(F.map(z=>z.id)),q=[...O.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 O=P.findIndex(F=>F.id===y.item.id);if(O===-1)return[...P,y.item];const L=P.slice();return L[O]={...L[O],...y.item},L}):S==="itemCreated"&&((M=y.item)!=null&&M.id)?a(P=>P.some(O=>O.id===y.item.id)?P:[...P,y.item]):S==="itemDeleted"&&y.id?a(P=>P.filter(O=>O.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(O=>O.map(L=>L.id===x?{...L,...P}:L)),{ok:!0,item:P||S.find(O=>O.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 sa=Object.freeze(Object.defineProperty({__proto__:null,default:zs},Symbol.toStringTag,{value:"Module"}));export{sa as M,ta as N,yt as P,Vs 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,Zs as i,t as j,V as k,Ke as l,xt as m,be as n,ea as o,it as r,Qs as s,fe as v,B as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as l,r as m,d as a}from"./chunk-MOJQB5TN-DZZa7unc.js";import{p}from"./chunk-JWPE2WC7-DwQ0wwWn.js";import{_ as t,l as o}from"./App-BmhlHOXF.js";import{M as u,d as c}from"./cynefin-VYW2F7L2-5Bp7xFO0.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=v(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),v=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),y=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(y(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},R={parser:b,db:a,renderer:m,styles:l};export{R as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as rt}from"./chunk-JWPE2WC7-
|
|
1
|
+
import{p as rt}from"./chunk-JWPE2WC7-DwQ0wwWn.js";import{a2 as T,a5 as B,b6 as nt,g as it,s as ot,a as st,b as lt,o as ct,n as ut,_ as d,l as G,c as gt,A as dt,D as pt,K as ht,e as ft,p as mt,B as vt}from"./App-BmhlHOXF.js";import{p as xt}from"./cynefin-VYW2F7L2-5Bp7xFO0.js";import{d as q}from"./arc-BJAv_6dL.js";import{o as St}from"./ordinal-Cboi1Yqb.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.js";import"./init-Gi6I4Gst.js";function yt(t,n){return n<t?-1:n>t?1:n>=t?0:NaN}function wt(t){return t}function At(){var t=wt,n=yt,y=null,b=T(0),l=T(B),p=T(0);function i(e){var r,s=(e=nt(e)).length,h,w,$=0,f=new Array(s),o=new Array(s),D=+b.apply(this,arguments),E=Math.min(B,Math.max(-B,l.apply(this,arguments)-D)),k,L=Math.min(Math.abs(E)/s,p.apply(this,arguments)),u=L*(E<0?-1:1),A;for(r=0;r<s;++r)(A=o[f[r]=r]=+t(e[r],r,e))>0&&($+=A);for(n!=null?f.sort(function(M,m){return n(o[M],o[m])}):y!=null&&f.sort(function(M,m){return y(e[M],e[m])}),r=0,w=$?(E-s*u)/$:0;r<s;++r,D=k)h=f[r],A=o[h],k=D+(A>0?A*w:0)+u,o[h]={data:e[h],index:r,value:A,startAngle:D,endAngle:k,padAngle:L};return o}return i.value=function(e){return arguments.length?(t=typeof e=="function"?e:T(+e),i):t},i.sortValues=function(e){return arguments.length?(n=e,y=null,i):n},i.sort=function(e){return arguments.length?(y=e,n=null,i):y},i.startAngle=function(e){return arguments.length?(b=typeof e=="function"?e:T(+e),i):b},i.endAngle=function(e){return arguments.length?(l=typeof e=="function"?e:T(+e),i):l},i.padAngle=function(e){return arguments.length?(p=typeof e=="function"?e:T(+e),i):p},i}var Ct=vt.pie,I={sections:new Map,showData:!1},F=I.sections,V=I.showData,$t=structuredClone(Ct),Dt=d(()=>structuredClone($t),"getConfig"),Tt=d(()=>{F=new Map,V=I.showData,mt()},"clear"),bt=d(({label:t,value:n})=>{if(n<0)throw new Error(`"${t}" has invalid value: ${n}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);F.has(t)||(F.set(t,n),G.debug(`added new section: ${t}, with value: ${n}`))},"addSection"),kt=d(()=>F,"getSections"),zt=d(t=>{V=t},"setShowData"),Et=d(()=>V,"getShowData"),J={getConfig:Dt,clear:Tt,setDiagramTitle:ut,getDiagramTitle:ct,setAccTitle:lt,getAccTitle:st,setAccDescription:ot,getAccDescription:it,addSection:bt,getSections:kt,setShowData:zt,getShowData:Et},Mt=d((t,n)=>{rt(t,n),n.setShowData(t.showData),t.sections.map(n.addSection)},"populateDb"),Rt={parse:d(async t=>{const n=await xt("pie",t);G.debug(n),Mt(n,J)},"parse")},Lt=d(t=>`
|
|
2
2
|
.pieCircle{
|
|
3
3
|
stroke: ${t.pieStrokeColor};
|
|
4
4
|
stroke-width : ${t.pieStrokeWidth};
|
package/dist/assets/{quadrantDiagram-ABIIQ3AL-DqL3BMFc.js → quadrantDiagram-ABIIQ3AL-C9deUjQ2.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{s as Ae,g as ke,o as ae,n as Fe,a as Pe,b as ve,_ as o,c as wt,l as At,d as zt,e as Ce,p as Le,B as z,i as Ee,E as De}from"./App-
|
|
1
|
+
import{s as Ae,g as ke,o as ae,n as Fe,a as Pe,b as ve,_ as o,c as wt,l as At,d as zt,e as Ce,p as Le,B as z,i as Ee,E as De}from"./App-BmhlHOXF.js";import{l as ie}from"./linear-BQSYZcVg.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.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,15,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,15,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],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],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],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[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],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){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,k,{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,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,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:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,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=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=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]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+St.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Dt="Parse error on line "+(qt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Dt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Lt,expected:St})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+B);switch(W[0]){case 1:g.push(B),A.push(D.yytext),e.push(D.yylloc),g.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,qt=D.yylineno,Lt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],lt.$=A[A.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},Se&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Jt,qt,K.yy,W[1],A,e].concat(be)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[W[1]][0]),A.push(lt.$),e.push(lt._$),ee=pt[g[g.length-2]][g[g.length-1]],g.push(ee);break;case 3:return!0}}return!0},"parse")},me=(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 A=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=[A[0],A[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
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()+`
|
package/dist/assets/{railroadDiagram-RFXS5EU6-UGGWX3B7.js → railroadDiagram-RFXS5EU6-Csqw2hK9.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-
|
|
1
|
+
import{g as s,r as l,d as t}from"./chunk-MOJQB5TN-DZZa7unc.js";import{p as m}from"./chunk-JWPE2WC7-DwQ0wwWn.js";import{_ as n,l as i}from"./App-BmhlHOXF.js";import{M as p,c as u}from"./cynefin-VYW2F7L2-5Bp7xFO0.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),g=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),y={parse:n(e=>{t.clear(),i.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const o=r.value;i.debug("[Railroad Parser] Parsed rules:",o.rules.length),g(o),i.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},b={parser:y,db:t,renderer:l,styles:s};export{b as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ze}from"./chunk-XXDRQBXY-Ct9K5k9G.js";import{s as Xe}from"./chunk-VR4S4FIN-Bx3WjdJ3.js";import{_ as d,y as Be,b as Je,a as Ze,s as et,g as tt,n as st,o as it,c as Ne,l as qe,p as rt,t as nt,u as at,v as lt,x as ct}from"./App-B4vuNX1g.js";import"./mobile-CNLMhdFP.js";import"./index-D4TlupB7.js";import"./graph-xkel59g2.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),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"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,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])this.terminals_[ye]&&ye>Ke&&_e.push("'"+this.terminals_[ye]+"'");S.showPosition?ke="Parse error on line "+(ge+1)+`:
|
|
1
|
+
import{g as ze}from"./chunk-XXDRQBXY-BEIiZ6gS.js";import{s as Xe}from"./chunk-VR4S4FIN-BBUOVC5W.js";import{_ as d,y as Be,b as Je,a as Ze,s as et,g as tt,n as st,o as it,c as Ne,l as qe,p as rt,t as nt,u as at,v as lt,x as ct}from"./App-BmhlHOXF.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.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),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var je=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Ge(T){l.length=l.length-2*T,R.length=R.length-T,t.length=t.length-T}d(Ge,"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,z,q,Te,J={},ye,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ye in de[z])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: "+z+", 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,G.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()+`
|
package/dist/assets/{sankeyDiagram-HTMAVEWB-CHNubde1.js → sankeyDiagram-HTMAVEWB-BTeTL24f.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as xt,o as _t,s as vt,g as bt,b as St,a as wt,_ as d,c as lt,b8 as Lt,d as X,W as Et,p as At,k as Tt}from"./App-B4vuNX1g.js";import{o as Mt}from"./ordinal-Cboi1Yqb.js";import"./mobile-CNLMhdFP.js";import"./index-D4TlupB7.js";import"./graph-xkel59g2.js";import"./init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a<n;)s[a]="#"+t.slice(a*6,++a*6);return s}const Ct=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,n){return Q(t.source,n.source)||t.index-n.index}function ht(t,n){return Q(t.target,n.target)||t.index-n.index}function Q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:q(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:q(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:q(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:q(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;r<c.length;++r){const k=c[r];k.y0+=e*(r+1),k.y1+=e*(r+1)}w(c)}}function S(i){const f=N(i);p=Math.min(y,(a-n)/(ct(f,c=>c.length)-1)),D(f);for(let c=0;c<g;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/g);R(f,e,r),C(f,e,r)}}function C(i,f,c){for(let e=1,r=i.length;e<r;++e){const k=i[e];for(const b of k){let L=0,B=0;for(const{source:Y,value:et}of b.targetLinks){let H=et*(b.layer-Y.layer);L+=P(Y,b)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(Q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(Q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c<i.length;++c){const r=i[c],k=(f-r.y0)*e;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Xt(){return Yt(Ht)}function qt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Xt().source(qt).target(Qt)}var at=(function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(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:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-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:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[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(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`:
|
|
1
|
+
import{n as xt,o as _t,s as vt,g as bt,b as St,a as wt,_ as d,c as lt,b8 as Lt,d as X,W as Et,p as At,k as Tt}from"./App-BmhlHOXF.js";import{o as Mt}from"./ordinal-Cboi1Yqb.js";import"./mobile-PV1zQVwv.js";import"./index-CKfOVv2N.js";import"./graph--wGAvskB.js";import"./init-Gi6I4Gst.js";function Nt(t){for(var n=t.length/6|0,s=new Array(n),a=0;a<n;)s[a]="#"+t.slice(a*6,++a*6);return s}const Ct=Nt("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");function ct(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s<a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s<u||s===void 0&&u>=u)&&(s=u)}return s}function pt(t,n){let s;if(n===void 0)for(const a of t)a!=null&&(s>a||s===void 0&&a>=a)&&(s=a);else{let a=-1;for(let u of t)(u=n(u,++a,t))!=null&&(s>u||s===void 0&&u>=u)&&(s=u)}return s}function nt(t,n){let s=0;if(n===void 0)for(let a of t)(a=+a)&&(s+=a);else{let a=-1;for(let u of t)(u=+n(u,++a,t))&&(s+=u)}return s}function Pt(t){return t.target.depth}function It(t){return t.depth}function Ot(t,n){return n-1-t.height}function kt(t,n){return t.sourceLinks.length?t.depth:n-1}function $t(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?pt(t.sourceLinks,Pt)-1:0}function q(t){return function(){return t}}function ut(t,n){return Q(t.source,n.source)||t.index-n.index}function ht(t,n){return Q(t.target,n.target)||t.index-n.index}function Q(t,n){return t.y0-n.y0}function it(t){return t.value}function Dt(t){return t.index}function jt(t){return t.nodes}function zt(t){return t.links}function ft(t,n){const s=t.get(n);if(!s)throw new Error("missing: "+n);return s}function yt({nodes:t}){for(const n of t){let s=n.y0,a=s;for(const u of n.sourceLinks)u.y0=s+u.width/2,s+=u.width;for(const u of n.targetLinks)u.y1=a+u.width/2,a+=u.width}}function Bt(){let t=0,n=0,s=1,a=1,u=24,y=8,p,m=Dt,o=kt,l,h,x=jt,_=zt,g=6;function v(){const i={nodes:x.apply(null,arguments),links:_.apply(null,arguments)};return T(i),A(i),M(i),I(i),S(i),yt(i),i}v.update=function(i){return yt(i),i},v.nodeId=function(i){return arguments.length?(m=typeof i=="function"?i:q(i),v):m},v.nodeAlign=function(i){return arguments.length?(o=typeof i=="function"?i:q(i),v):o},v.nodeSort=function(i){return arguments.length?(l=i,v):l},v.nodeWidth=function(i){return arguments.length?(u=+i,v):u},v.nodePadding=function(i){return arguments.length?(y=p=+i,v):y},v.nodes=function(i){return arguments.length?(x=typeof i=="function"?i:q(i),v):x},v.links=function(i){return arguments.length?(_=typeof i=="function"?i:q(i),v):_},v.linkSort=function(i){return arguments.length?(h=i,v):h},v.size=function(i){return arguments.length?(t=n=0,s=+i[0],a=+i[1],v):[s-t,a-n]},v.extent=function(i){return arguments.length?(t=+i[0][0],s=+i[1][0],n=+i[0][1],a=+i[1][1],v):[[t,n],[s,a]]},v.iterations=function(i){return arguments.length?(g=+i,v):g};function T({nodes:i,links:f}){for(const[e,r]of i.entries())r.index=e,r.sourceLinks=[],r.targetLinks=[];const c=new Map(i.map((e,r)=>[m(e,r,i),e]));for(const[e,r]of f.entries()){r.index=e;let{source:k,target:b}=r;typeof k!="object"&&(k=r.source=ft(c,k)),typeof b!="object"&&(b=r.target=ft(c,b)),k.sourceLinks.push(r),b.targetLinks.push(r)}if(h!=null)for(const{sourceLinks:e,targetLinks:r}of i)e.sort(h),r.sort(h)}function A({nodes:i}){for(const f of i)f.value=f.fixedValue===void 0?Math.max(nt(f.sourceLinks,it),nt(f.targetLinks,it)):f.fixedValue}function M({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.depth=r;for(const{target:b}of k.sourceLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function I({nodes:i}){const f=i.length;let c=new Set(i),e=new Set,r=0;for(;c.size;){for(const k of c){k.height=r;for(const{source:b}of k.targetLinks)e.add(b)}if(++r>f)throw new Error("circular link");c=e,e=new Set}}function N({nodes:i}){const f=ct(i,r=>r.depth)+1,c=(s-t-u)/(f-1),e=new Array(f);for(const r of i){const k=Math.max(0,Math.min(f-1,Math.floor(o.call(null,r,f))));r.layer=k,r.x0=t+k*c,r.x1=r.x0+u,e[k]?e[k].push(r):e[k]=[r]}if(l)for(const r of e)r.sort(l);return e}function D(i){const f=pt(i,c=>(a-n-(c.length-1)*p)/nt(c,it));for(const c of i){let e=n;for(const r of c){r.y0=e,r.y1=e+r.value*f,e=r.y1+p;for(const k of r.sourceLinks)k.width=k.value*f}e=(a-e+p)/(c.length+1);for(let r=0;r<c.length;++r){const k=c[r];k.y0+=e*(r+1),k.y1+=e*(r+1)}w(c)}}function S(i){const f=N(i);p=Math.min(y,(a-n)/(ct(f,c=>c.length)-1)),D(f);for(let c=0;c<g;++c){const e=Math.pow(.99,c),r=Math.max(1-e,(c+1)/g);R(f,e,r),C(f,e,r)}}function C(i,f,c){for(let e=1,r=i.length;e<r;++e){const k=i[e];for(const b of k){let L=0,B=0;for(const{source:Y,value:et}of b.targetLinks){let H=et*(b.layer-Y.layer);L+=P(Y,b)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(Q),j(k,c)}}function R(i,f,c){for(let e=i.length,r=e-2;r>=0;--r){const k=i[r];for(const b of k){let L=0,B=0;for(const{target:Y,value:et}of b.sourceLinks){let H=et*(Y.layer-b.layer);L+=E(b,Y)*H,B+=H}if(!(B>0))continue;let U=(L/B-b.y0)*f;b.y0+=U,b.y1+=U,z(b)}l===void 0&&k.sort(Q),j(k,c)}}function j(i,f){const c=i.length>>1,e=i[c];O(i,e.y0-p,c-1,f),V(i,e.y1+p,c+1,f),O(i,a,i.length-1,f),V(i,n,0,f)}function V(i,f,c,e){for(;c<i.length;++c){const r=i[c],k=(f-r.y0)*e;k>1e-6&&(r.y0+=k,r.y1+=k),f=r.y1+p}}function O(i,f,c,e){for(;c>=0;--c){const r=i[c],k=(r.y1-f)*e;k>1e-6&&(r.y0-=k,r.y1-=k),f=r.y0-p}}function z({sourceLinks:i,targetLinks:f}){if(h===void 0){for(const{source:{sourceLinks:c}}of f)c.sort(ht);for(const{target:{targetLinks:c}}of i)c.sort(ut)}}function w(i){if(h===void 0)for(const{sourceLinks:f,targetLinks:c}of i)f.sort(ht),c.sort(ut)}function P(i,f){let c=i.y0-(i.sourceLinks.length-1)*p/2;for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c+=r+p}for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c-=r}return c}function E(i,f){let c=f.y0-(f.targetLinks.length-1)*p/2;for(const{source:e,width:r}of f.targetLinks){if(e===i)break;c+=r+p}for(const{target:e,width:r}of i.sourceLinks){if(e===f)break;c-=r}return c}return v}var rt=Math.PI,st=2*rt,F=1e-6,Ft=st-F;function ot(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function mt(){return new ot}ot.prototype=mt.prototype={constructor:ot,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,s,a){this._+="Q"+ +t+","+ +n+","+(this._x1=+s)+","+(this._y1=+a)},bezierCurveTo:function(t,n,s,a,u,y){this._+="C"+ +t+","+ +n+","+ +s+","+ +a+","+(this._x1=+u)+","+(this._y1=+y)},arcTo:function(t,n,s,a,u){t=+t,n=+n,s=+s,a=+a,u=+u;var y=this._x1,p=this._y1,m=s-t,o=a-n,l=y-t,h=p-n,x=l*l+h*h;if(u<0)throw new Error("negative radius: "+u);if(this._x1===null)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(x>F)if(!(Math.abs(h*m-o*l)>F)||!u)this._+="L"+(this._x1=t)+","+(this._y1=n);else{var _=s-y,g=a-p,v=m*m+o*o,T=_*_+g*g,A=Math.sqrt(v),M=Math.sqrt(x),I=u*Math.tan((rt-Math.acos((v+x-T)/(2*A*M)))/2),N=I/M,D=I/A;Math.abs(N-1)>F&&(this._+="L"+(t+N*l)+","+(n+N*h)),this._+="A"+u+","+u+",0,0,"+ +(h*_>l*g)+","+(this._x1=t+D*m)+","+(this._y1=n+D*o)}},arc:function(t,n,s,a,u,y){t=+t,n=+n,s=+s,y=!!y;var p=s*Math.cos(a),m=s*Math.sin(a),o=t+p,l=n+m,h=1^y,x=y?a-u:u-a;if(s<0)throw new Error("negative radius: "+s);this._x1===null?this._+="M"+o+","+l:(Math.abs(this._x1-o)>F||Math.abs(this._y1-l)>F)&&(this._+="L"+o+","+l),s&&(x<0&&(x=x%st+st),x>Ft?this._+="A"+s+","+s+",0,1,"+h+","+(t-p)+","+(n-m)+"A"+s+","+s+",0,1,"+h+","+(this._x1=o)+","+(this._y1=l):x>F&&(this._+="A"+s+","+s+",0,"+ +(x>=rt)+","+h+","+(this._x1=t+s*Math.cos(u))+","+(this._y1=n+s*Math.sin(u))))},rect:function(t,n,s,a){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +s+"v"+ +a+"h"+-s+"Z"},toString:function(){return this._}};function dt(t){return function(){return t}}function Rt(t){return t[0]}function Vt(t){return t[1]}var Wt=Array.prototype.slice;function Gt(t){return t.source}function Ut(t){return t.target}function Yt(t){var n=Gt,s=Ut,a=Rt,u=Vt,y=null;function p(){var m,o=Wt.call(arguments),l=n.apply(this,o),h=s.apply(this,o);if(y||(y=m=mt()),t(y,+a.apply(this,(o[0]=l,o)),+u.apply(this,o),+a.apply(this,(o[0]=h,o)),+u.apply(this,o)),m)return y=null,m+""||null}return p.source=function(m){return arguments.length?(n=m,p):n},p.target=function(m){return arguments.length?(s=m,p):s},p.x=function(m){return arguments.length?(a=typeof m=="function"?m:dt(+m),p):a},p.y=function(m){return arguments.length?(u=typeof m=="function"?m:dt(+m),p):u},p.context=function(m){return arguments.length?(y=m??null,p):y},p}function Ht(t,n,s,a,u){t.moveTo(n,s),t.bezierCurveTo(n=(n+a)/2,s,n,u,a,u)}function Xt(){return Yt(Ht)}function qt(t){return[t.source.x1,t.y0]}function Qt(t){return[t.target.x0,t.y1]}function Kt(){return Xt().source(qt).target(Qt)}var at=(function(){var t=d(function(m,o,l,h){for(l=l||{},h=m.length;h--;l[m[h]]=o);return l},"o"),n=[1,9],s=[1,10],a=[1,5,10,12],u={trace:d(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:d(function(o,l,h,x,_,g,v){var T=g.length-1;switch(_){case 7:const A=x.findOrCreateNode(g[T-4].trim().replaceAll('""','"')),M=x.findOrCreateNode(g[T-2].trim().replaceAll('""','"')),I=parseFloat(g[T].trim());x.addLink(A,M,I);break;case 8:case 9:case 11:this.$=g[T];break;case 10:this.$=g[T-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:n,20:s},{1:[2,6],7:11,10:[1,12]},t(s,[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(s,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:s},{15:18,16:7,17:8,18:n,20:s},{18:[1,19]},t(s,[2,3]),{12:[1,20]},t(a,[2,10]),{15:21,16:7,17:8,18:n,20:s},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:d(function(o,l){if(l.recoverable)this.trace(o);else{var h=new Error(o);throw h.hash=l,h}},"parseError"),parse:d(function(o){var l=this,h=[0],x=[],_=[null],g=[],v=this.table,T="",A=0,M=0,I=2,N=1,D=g.slice.call(arguments,1),S=Object.create(this.lexer),C={yy:{}};for(var R in this.yy)Object.prototype.hasOwnProperty.call(this.yy,R)&&(C.yy[R]=this.yy[R]);S.setInput(o,C.yy),C.yy.lexer=S,C.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var j=S.yylloc;g.push(j);var V=S.options&&S.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function O(L){h.length=h.length-2*L,_.length=_.length-L,g.length=g.length-L}d(O,"popStack");function z(){var L;return L=x.pop()||S.lex()||N,typeof L!="number"&&(L instanceof Array&&(x=L,L=x.pop()),L=l.symbols_[L]||L),L}d(z,"lex");for(var w,P,E,i,f={},c,e,r,k;;){if(P=h[h.length-1],this.defaultActions[P]?E=this.defaultActions[P]:((w===null||typeof w>"u")&&(w=z()),E=v[P]&&v[P][w]),typeof E>"u"||!E.length||!E[0]){var b="";k=[];for(c in v[P])this.terminals_[c]&&c>I&&k.push("'"+this.terminals_[c]+"'");S.showPosition?b="Parse error on line "+(A+1)+`:
|
|
2
2
|
`+S.showPosition()+`
|
|
3
3
|
Expecting `+k.join(", ")+", got '"+(this.terminals_[w]||w)+"'":b="Parse error on line "+(A+1)+": Unexpected "+(w==N?"end of input":"'"+(this.terminals_[w]||w)+"'"),this.parseError(b,{text:S.match,token:this.terminals_[w]||w,line:S.yylineno,loc:j,expected:k})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+w);switch(E[0]){case 1:h.push(w),_.push(S.yytext),g.push(S.yylloc),h.push(E[1]),w=null,M=S.yyleng,T=S.yytext,A=S.yylineno,j=S.yylloc;break;case 2:if(e=this.productions_[E[1]][1],f.$=_[_.length-e],f._$={first_line:g[g.length-(e||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(e||1)].first_column,last_column:g[g.length-1].last_column},V&&(f._$.range=[g[g.length-(e||1)].range[0],g[g.length-1].range[1]]),i=this.performAction.apply(f,[T,M,A,C.yy,E[1],_,g].concat(D)),typeof i<"u")return i;e&&(h=h.slice(0,-1*e*2),_=_.slice(0,-1*e),g=g.slice(0,-1*e)),h.push(this.productions_[E[1]][0]),_.push(f.$),g.push(f._$),r=v[h[h.length-2]][h[h.length-1]],h.push(r);break;case 3:return!0}}return!0},"parse")},y=(function(){var m={EOF:1,parseError:d(function(l,h){if(this.yy.parser)this.yy.parser.parseError(l,h);else throw new Error(l)},"parseError"),setInput:d(function(o,l){return this.yy=l||this.yy||{},this._input=o,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 o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var l=o.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),o},"input"),unput:d(function(o){var l=o.length,h=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;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),h.length-1&&(this.yylineno-=h.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:h?(h.length===x.length?this.yylloc.first_column:0)+x[x.length-h.length].length-h[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: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(o){this.unput(this.match.slice(o))},"less"),pastInput:d(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:d(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:d(function(){var o=this.pastInput(),l=new Array(o.length+1).join("-");return o+this.upcomingInput()+`
|