dsh-plugin-strict-spec 0.0.0-stage → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +236 -2
  3. package/README.zh.md +191 -0
  4. package/cordis.patch.yml +5 -0
  5. package/dist/cli/strict-spec-cli.js +38892 -0
  6. package/dist/client.js +50 -0
  7. package/dist/host.js +154 -0
  8. package/dist/skills/strict-roadmap-plan/SKILL.md +176 -0
  9. package/dist/skills/strict-roadmap-recommend/SKILL.md +321 -0
  10. package/dist/skills/strict-roadmap-reorder/SKILL.md +194 -0
  11. package/dist/skills/strict-roadmap-review/SKILL.md +180 -0
  12. package/dist/skills/strict-roadmap-transition/SKILL.md +323 -0
  13. package/dist/skills/strict-scene-edit/SKILL.md +156 -0
  14. package/dist/skills/strict-spec-apply/SKILL.md +212 -0
  15. package/dist/skills/strict-spec-architecture/SKILL.md +143 -0
  16. package/dist/skills/strict-spec-archive/SKILL.md +165 -0
  17. package/dist/skills/strict-spec-auto/SKILL.md +334 -0
  18. package/dist/skills/strict-spec-brainstorm/SKILL.md +228 -0
  19. package/dist/skills/strict-spec-bugfix/SKILL.md +285 -0
  20. package/dist/skills/strict-spec-design/SKILL.md +168 -0
  21. package/dist/skills/strict-spec-design-sync/SKILL.md +165 -0
  22. package/dist/skills/strict-spec-init/SKILL.md +123 -0
  23. package/dist/skills/strict-spec-maintenance/SKILL.md +130 -0
  24. package/dist/skills/strict-spec-modify/SKILL.md +148 -0
  25. package/dist/skills/strict-spec-propose/SKILL.md +553 -0
  26. package/dist/skills/strict-spec-review/SKILL.md +315 -0
  27. package/dist/skills/strict-spec-ship/SKILL.md +94 -0
  28. package/dist/skills/strict-spec-spec-edit/SKILL.md +117 -0
  29. package/dist/skills/strict-spec-sync-specs/SKILL.md +128 -0
  30. package/dist/skills/strict-spec-verify/SKILL.md +79 -0
  31. package/dist/skills/strict-tech-edit/SKILL.md +161 -0
  32. package/dist/skills/strict-tech-sync/SKILL.md +202 -0
  33. package/package.json +109 -4
package/dist/client.js ADDED
@@ -0,0 +1,50 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "dsh-plugin-strict-spec",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ if (typeof document !== "undefined" && !document.getElementById("dsh-plugin-strict-spec-styles")) {
8
+ var style = document.createElement("style");
9
+ style.id = "dsh-plugin-strict-spec-styles";
10
+ style.textContent = ".viewport_kcgEpw{display:flex;color:var(--dsw-alias-label-primary);flex-direction:column;flex:auto;height:100%;min-height:0}.scroll_kcgEpw{overflow-y:auto;flex:auto;min-height:0}.rows_kcgEpw{position:relative;width:100%}.virtualRow_kcgEpw{position:absolute;width:100%;top:0;left:0}.row_kcgEpw{padding-left:calc(var(--dssw-depth,0)*var(--dssw-indent-step,16px));border-radius:var(--dsw-radius-md)}.row_kcgEpw[data-focused]{background:var(--dsw-alias-bg-module-platform)}.disclosure_kcgEpw{min-width:0}.count_kcgEpw{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary);white-space:nowrap}.truncation_kcgEpw{padding:2px 8px 2px calc(8px + var(--dssw-depth,0)*var(--dssw-indent-step,16px));font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary)}.state_kcgEpw{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);padding:12px}.document_A8YcYA{display:flex;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;padding:12px}.header_A8YcYA{display:flex;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);flex-wrap:wrap;gap:4px 16px;padding:8px 12px}.headerField_A8YcYA{display:inline-flex;gap:6px;min-width:0}.section_A8YcYA{display:flex;flex-direction:column;gap:4px}.sectionTitle_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);margin:0;font-weight:600}.fields_A8YcYA{display:flex;flex-direction:column;gap:2px}.field_A8YcYA{display:flex;padding-left:calc(var(--dssw-depth,0)*var(--dssw-indent-step,16px));gap:8px;min-width:0}.fieldKey_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary);flex:none}.scalar_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.paragraph_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0}.list_A8YcYA{display:flex;flex-direction:column;gap:2px;margin:0;padding-left:20px}.listItem_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px)}.block_A8YcYA{padding-left:calc(var(--dssw-depth,0)*var(--dssw-indent-step,16px))}.disclosure_A8YcYA{min-width:0}.parseError_A8YcYA{display:flex;flex-direction:column;gap:8px;padding:12px}.parseMessage_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-state-error-primary)}.rawHeading_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary)}.raw_A8YcYA{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);font-family:var(--dsw-mono-font-family,monospace);font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:8px}.state_A8YcYA{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);padding:12px}.view_3lbvJg{display:flex;color:var(--dsw-alias-label-primary);flex-direction:column;gap:12px;padding:12px}.facts_3lbvJg{display:flex;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);flex-wrap:wrap;gap:4px 16px;padding:8px 12px}.fact_3lbvJg{display:inline-flex;gap:6px;min-width:0}.factKey_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary);flex:none}.factText_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.section_3lbvJg{display:flex;flex-direction:column;gap:4px}.sectionTitle_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);margin:0;font-weight:600}.entries_3lbvJg{display:flex;flex-direction:column;gap:2px;margin:0;padding-left:20px}.entry_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.card_3lbvJg{display:flex;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:4px;padding:8px 12px}.cardHeader_3lbvJg{display:flex;flex-wrap:wrap;align-items: center;gap:8px}.cardId_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;font-weight:600}.statement_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;margin:0}.meta_3lbvJg{display:flex;flex-direction:column;gap:2px}.metaRow_3lbvJg{display:flex;gap:8px;min-width:0}.metaKey_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary);flex:none}.metaText_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.scenario_3lbvJg{display:flex;flex-direction:column;gap:2px;padding-left:12px}.scenarioId_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);font-weight:600}.step_3lbvJg{display:flex;gap:8px;min-width:0;padding-left:12px}.stepKind_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-tertiary);flex:none}.stepText_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}.flowSteps_3lbvJg{display:flex;list-style:none;flex-direction:column;gap:4px;margin:0;padding:0}.flowStep_3lbvJg{display:flex;flex-direction:column;gap:2px}.coverageList_3lbvJg{display:flex;flex-wrap:wrap;gap:4px 8px}.coverage_3lbvJg{font-family:var(--dsw-mono-font-family,monospace);font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary)}.coverageLink_3lbvJg{border-radius:var(--dsw-radius-sm);font-family:var(--dsw-mono-font-family,monospace);font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);text-align:start;text-decoration:underline;text-decoration-color:var(--dsw-alias-border-l4);cursor:pointer;background:0 0;border:0;padding:0}.coverageUnresolved_3lbvJg{display:inline-flex;font-family:var(--dsw-mono-font-family,monospace);font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);align-items: center;gap:4px}.command_3lbvJg{font-family:var(--dsw-mono-font-family,monospace);font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}.completion_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary)}.operationGroup_3lbvJg{display:flex;flex-direction:column;gap:4px}.operationTitle_3lbvJg{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);margin:0;font-weight:600}.scopeColumns_IWr50g{display:grid;grid-template-columns:minmax(0,1fr)minmax(0,1fr);align-items: start;gap:12px}.scopeColumn_IWr50g{display:flex;flex-direction:column;gap:4px;min-width:0}.checklist_IWr50g{list-style:none;display:flex;flex-direction:column;gap:2px;margin:0;padding:0}.checklistItem_IWr50g{display:flex;font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere;gap:6px}.checkMark_IWr50g{color:var(--dsw-alias-label-secondary);font-size:var(--dsh-content-font-size-secondary,13px);flex:none}.ownedRows_IWr50g{display:flex;flex-direction:column;gap:2px}.ownedRow_IWr50g{display:inline-flex;border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);text-align:start;cursor:pointer;background:0 0;border:0;align-items: center;gap:6px;min-width:0;padding:0}.ownedRowText_IWr50g{overflow-wrap:anywhere;text-decoration:underline;text-decoration-color:var(--dsw-alias-border-l4);min-width:0}.ownedRowStatic_IWr50g{display:inline-flex;align-items: center;gap:6px;min-width:0}.dependencyList_IWr50g{list-style:none;display:flex;flex-direction:column;gap:2px;margin:0;padding:0}.dependencyRow_IWr50g{display:flex;align-items: center;gap:6px;min-width:0}.dependencyTarget_IWr50g{display:inline-flex;border-radius:var(--dsw-radius-sm);color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);cursor:pointer;background:0 0;border:0;align-items: center;gap:6px;min-width:0;padding:0}.dependencyId_IWr50g{overflow-wrap:anywhere;text-decoration:underline;text-decoration-color:var(--dsw-alias-border-l4);min-width:0}.dependencyIdUnresolved_IWr50g{overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary);min-width:0}.indexRows_IWr50g{display:flex;flex-direction:column;gap:2px}.indexRow_IWr50g{display:flex;align-items: center;gap:6px;min-width:0}.indexId_IWr50g{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);min-width:0}.indexTitle_IWr50g{overflow-wrap:anywhere;color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);min-width:0}@media (max-width:480px){.scopeColumns_IWr50g{grid-template-columns:minmax(0,1fr)}}.goalLaunch_IWr50g{display:flex;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:6px;padding:8px 10px}.goalActions_IWr50g{display:flex;flex-wrap:wrap;align-items: center;gap:8px}.goalHint_IWr50g,.goalConfirmSession_IWr50g,.goalNotice_IWr50g{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}.goalConfirmTitle_IWr50g{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-label-primary);font-weight:600}.goalObjective_IWr50g{border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-label-primary);font-family:var(--dsw-mono-font-family);font-size:var(--dsh-content-font-size-secondary,13px);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;padding:6px 8px}.goalRefusal_IWr50g{font-size:var(--dsh-content-font-size-secondary,13px);color:var(--dsw-alias-state-error-primary);overflow-wrap:anywhere}.groupRows_1hxWWw{display:flex;flex-direction:column;gap:2px}.groupRow_1hxWWw{display:flex;align-items: center;gap:6px;min-width:0}.rowId_1hxWWw{overflow-wrap:anywhere;color:var(--dsw-alias-label-primary);font-size:var(--dsh-content-font-size-secondary,13px);min-width:0}.rowTitle_1hxWWw{overflow-wrap:anywhere;color:var(--dsw-alias-label-tertiary);font-size:var(--dsh-content-font-size-secondary,13px);min-width:0}.page_gBEKqQ{display:flex;color:var(--dsw-alias-label-primary);flex-direction:column;min-width:0;height:100%}.header_gBEKqQ{display:flex;border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-module-platform);align-items: center;gap:8px;padding:8px 12px}.pickerLabel_gBEKqQ{color:var(--dsw-alias-label-secondary);white-space:nowrap}.picker_gBEKqQ{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);flex:1;min-width:0;max-width:420px;padding:4px 8px}.pickerEmpty_gBEKqQ{color:var(--dsw-alias-label-tertiary)}.panes_gBEKqQ{display:flex;flex:1;min-height:0}.treePane_gBEKqQ{overflow:hidden;border-right:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-module-platform);flex-shrink:0;width:320px;min-width:240px;max-width:480px}.documentPane_gBEKqQ{overflow:auto;background:var(--dsw-alias-bg-layer-1);flex:1;min-width:0}.state_gBEKqQ{color:var(--dsw-alias-label-tertiary);padding:24px}.tab_TzlCdw{display:flex;color:var(--dsw-alias-label-primary);flex-direction:column;min-width:0;height:100%}.treeRegion_TzlCdw{overflow:hidden;border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-module-platform);flex:50%;min-height:0}.documentRegion_TzlCdw{overflow:auto;background:var(--dsw-alias-bg-layer-1);flex:50%;min-height:0}\n";
11
+ document.head.appendChild(style);
12
+ }
13
+ var es=Object.create;var{getPrototypeOf:ts,defineProperty:et,getOwnPropertyNames:jn,getOwnPropertyDescriptor:ns}=Object,Xt=Object.prototype.hasOwnProperty;function qn(e){return this[e]}var os,rs,is=(e,t,n)=>{var o=e!=null&&typeof e==="object";if(o){var r=t?os??=new WeakMap:rs??=new WeakMap,i=r.get(e);if(i)return i}n=e!=null?es(ts(e)):{};let s=t||!e||!e.__esModule||!Xt.call(e,"default")?et(n,"default",{value:e,enumerable:!0}):n;if(e&&typeof e==="object"||typeof e==="function"){for(let a of jn(e))if(!Xt.call(s,a))et(s,a,{get:qn.bind(e,a),enumerable:!0})}if(o)r.set(e,s);return s},ss=(e)=>{var t=(Wn??=new WeakMap).get(e),n;if(t)return t;if(t=et({},"__esModule",{value:!0}),e&&typeof e==="object"||typeof e==="function"){for(var o of jn(e))if(!Xt.call(t,o))et(t,o,{get:qn.bind(e,o),enumerable:!(n=ns(e,o))||n.enumerable})}return Wn.set(e,t),t},Wn;var as=(e)=>e;function ls(e,t){this[e]=as.bind(null,t)}var cs=(e,t)=>{for(var n in t)et(e,n,{get:t[n],enumerable:!0,configurable:!0,set:ls.bind(t,n)})};var xd={};cs(xd,{apply:()=>wd,inject:()=>hd});module.exports=ss(xd);var Ji=require("react/jsx-runtime");var We=require("react/jsx-runtime");function Kn({size:e,active:t}){return We.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:t?2:1.5,"aria-hidden":"true",focusable:"false",children:[We.jsx("rect",{x:"3.5",y:"4.5",width:"8",height:"6",rx:"1"}),We.jsx("rect",{x:"14.5",y:"4.5",width:"6",height:"15",rx:"1"}),We.jsx("path",{d:"M5 13.5h5M5 16.5h5M5 19.5h3",strokeLinecap:"round"})]})}var Ee=require("react");var se=require("react");var he=is(require("react"),1),ao=require("react-dom");function Hn(e){return typeof e==="object"?e.key:e}function Gn(e,t){let n=e.length;return new Proxy(e,{get(o,r,i){if(typeof r==="string"){let s=r.charCodeAt(0);if(s>=48&&s<=57){let a=+r;if(Number.isInteger(a)&&a>=0&&a<n){let l=o[a];if(typeof l!=="object"){let d=t[a*2];l=o[a]={index:a,key:l,start:d,size:t[a*2+1],end:d+t[a*2+1],lane:0}}return l}}if(r==="length")return n}return Reflect.get(o,r,i)}})}function Oe(e,t,n){let o=n.initialDeps??[],r,i=!0;function s(){var a;let l=!1,d=0,p=e();if(!(p.length!==o.length||p.some((v,y)=>o[y]!==v)))return r;o=p;let h=0;if(r=t(...p),(n==null?void 0:n.onChange)&&!(i&&n.skipInitialOnChange))n.onChange(r);return i=!1,r}return s.updateDeps=(a)=>{o=a},s}function Zt(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:""}`);else return e}var be=(e,t)=>Math.abs(e-t)<1.01,Yn=(e,t,n)=>{let o;return Object.assign(function(...r){e.clearTimeout(o),o=e.setTimeout(()=>t.apply(this,r),n)},{cancel:()=>{e.clearTimeout(o)}})};function $n({offset:e,isScrolling:t,elementMax:n,holdOffset:o,scrollOffset:r,pendingWrite:i,clampedMaxAtWrite:s}){var a;if(t&&i===null&&e===r)return"spurious";if(i!==null&&Math.abs(e-i.target)<1.5)return"readBack";if(i!==null&&!i.smooth&&n!==null&&i.target>n+o+0.5&&Math.abs(e-(n+o))<1.5)return"clampedReadBack";if(i!==null&&!i.smooth&&((a=i.lowMaxes)==null?void 0:a.some((l)=>Math.abs(e-l)<1.5)))return"clampedReadBack";if(s!==null&&Math.abs(e-s)<1.5)return"clampedEcho";return"external"}var ds=(e)=>e==="smooth"||e==="smoothFinishing";function Un({kind:e,offset:t,command:n,target:o}){return e!=="spurious"&&e!=="readBack"&&e!=="clampedReadBack"&&(n==null?void 0:n.index)!=null&&n.phase!=="queued"&&!ds(n.phase)&&!be(t,n.lastTargetOffset)&&!be(t,o())&&e!=="clampedEcho"}var Jt=40;function Qn(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;while(n>=0&&t.t-e[n].t<Jt)n--;if(n<0)return!1;let o=e[n],r=n-1;while(r>=0&&o.t-e[r].t<Jt)r--;if(r<0)return!1;let i=e[r],s=(t.offset-o.offset)/(t.t-o.t),a=(o.offset-i.offset)/(o.t-i.t);return s*a>=0&&Math.abs(s)>=2*Math.abs(a)&&Math.abs(s)-Math.abs(a)>=0.8}function Xn(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;while(n>=0&&t.t-e[n].t<Jt)n--;if(n<0)return!1;let o=e[n];return Math.abs(t.offset-o.offset)/(t.t-o.t)>=0.05}var tt,nt=()=>{if(tt!==void 0)return tt;if(typeof navigator>"u")return tt=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return tt=!0;let e=navigator.maxTouchPoints;return tt=navigator.platform==="MacIntel"&&e!==void 0&&e>0},en,Zn=()=>{if(en!==void 0)return en;return en=nt()&&typeof CSS<"u"&&typeof CSS.supports==="function"&&CSS.supports("overflow-anchor: auto")};var je={capture:!0,passive:!0};class tn{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!=="lateFling",this.dragging=()=>{var t;return((t=this._touch)==null?void 0:t.phase)==="down"&&this._touch.moved},this.tail=()=>{var t;return((t=this._touch)==null?void 0:t.phase)==="tail"?this._touch.moved?"fling":"tap":null},this.onScroll=({isScrolling:t,ownReadBack:n,moved:o,external:r})=>{var i,s,a;if(t&&((i=this._touch)==null?void 0:i.phase)==="tail")this._openTail(this._touch.moved||!n,!1);else if(((s=this._touch)==null?void 0:s.phase)==="lateFling"){if(this.host.now()>this._touch.until)this._touch=null;else if(r&&t&&o)this._openTail(!0,!1)}if(!n&&t&&o&&((a=this._touch)==null?void 0:a.phase)==="down")return this._touch.moved=!0,!0;return!1},this.touchStart=()=>{this.end(),this._touch={phase:"down",moved:!1}},this.touchEnd=()=>{var t;let n=((t=this._touch)==null?void 0:t.phase)==="down"&&this._touch.moved;this.end(),this._openTail(n,n)},this.end=()=>{var t;let n=this.host.getWindow();if(((t=this._touch)==null?void 0:t.phase)==="tail"&&n!=null)n.clearTimeout(this._touch.timerId);this._touch=null},this.listen=(t)=>{let n=()=>this.touchStart(),o=()=>this.touchEnd();return t.addEventListener("touchstart",n,je),t.addEventListener("touchend",o,je),t.addEventListener("touchcancel",o,je),()=>{t.removeEventListener("touchstart",n,je),t.removeEventListener("touchend",o,je),t.removeEventListener("touchcancel",o,je),this.end()}},this._openTail=(t,n)=>{let o=this.host.getWindow();if(!nt()||o==null)return;this.end();let r={phase:"tail",moved:t,awaitingFling:n,timerId:o.setTimeout(()=>{if(this.host.tailStillMoving()){this._openTail(r.moved,r.awaitingFling);return}this._touch=r.awaitingFling?{phase:"lateFling",until:this.host.now()+1000}:null,this.host.onTailClosed()},150)};this._touch=r}}get touch(){return this._touch}}var Jn=(e)=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},no=(e)=>{let t=new Set;return{schedule:(n)=>{let o=e.requestAnimationFrame(()=>{t.delete(o),n()});t.add(o)},cancel:()=>{t.forEach((n)=>e.cancelAnimationFrame(n)),t.clear()}}},us=(e)=>e,ps=(e)=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let s=0;s<r;s++)i[s]=n+s;return i},oo=(e,t)=>{let n=e.scrollElement;if(!n)return;let o=e.targetWindow;if(!o)return;let r=(a)=>{let{width:l,height:d}=a;t({width:Math.round(l),height:Math.round(d)})};if(r(Jn(n)),!o.ResizeObserver)return()=>{};let i=no(o),s=new o.ResizeObserver(()=>{let a=()=>{r(Jn(n))};e.options.useAnimationFrameWithResizeObserver?i.schedule(a):a()});return s.observe(n,{box:"content-box"}),()=>{s.unobserve(n),i.cancel()}},eo={passive:!0};var fs=typeof window>"u"?!0:("onscrollend"in window),ms=(e,t,n)=>{let o=e.scrollElement;if(!o)return;let r=e.targetWindow;if(!r)return;let i=e.options.useScrollendEvent&&fs,s=0,a=i?null:Yn(r,()=>t(n(o),!1),e.options.isScrollingResetDelay),l=(f)=>()=>{s=n(o),a==null||a(),t(s,f)},d=l(!0),p=l(!1);if(o.addEventListener("scroll",d,eo),i)o.addEventListener("scrollend",p,eo);return()=>{if(o.removeEventListener("scroll",d),i)o.removeEventListener("scrollend",p);a==null||a.cancel()}},ro=(e,t)=>ms(e,t,(n)=>{let{horizontal:o,isRtl:r}=e.options;return o?n.scrollLeft*(r&&-1||1):n.scrollTop});var hs=(e,t,n)=>{if(n.options.useCachedMeasurements){let o=n.indexFromElement(e),r=n.options.getItemKey(o);return n.itemSizeCache.get(r)??n.options.estimateSize(o)}if(t==null?void 0:t.borderBoxSize){let o=t.borderBoxSize[0];if(o)return Math.round(o[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){let o=n.indexFromElement(e),r=n.options.getItemKey(o),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},gs=(e,{adjustments:t=0,behavior:n},o)=>{var r,i;(i=(r=o.scrollElement)==null?void 0:r.scrollTo)==null||i.call(r,{[o.options.horizontal?"left":"top"]:e+t,behavior:n})};var io=gs,to=(e,t)=>e==="smooth"?t?"smoothLanded":"smooth":"instant",ot=(e)=>(e==null?void 0:e.phase)==="smooth"||(e==null?void 0:e.phase)==="smoothLanded";function ys(e,t,n,o){if(t===0)return!1;let r=o(0),i=new Set,s=0;while(s<e){let l=n(s);if(l===r)break;i.add(l),s++}let a=e-s;if(a===0||a>=t)return!1;for(let l=0;l<a;l++)if(o(l)!==n(s+l))return!1;for(let l=a;l<t;l++)if(i.has(o(l)))return!1;return!0}class nn{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new tn({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let t=this.scrollState;if((t==null?void 0:t.phase)!=="queued"||this.pendingWrite!==null)return!1;let n=this._readElementOffset();if(n===null||this._lastElementOffset===null||Math.abs(n-this._lastElementOffset)<1)return!1;return this._lastElementOffset=n,t.samples=[...t.samples??[],{t:this.now(),offset:n}],!0},onTailClosed:()=>{let t=this.scrollState;if((t==null?void 0:t.phase)==="queued"&&Xn(t.samples??[]))this.scrollState=null;this._flushHoldIfReady(!0),this._writeAwaitingCommand()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=new Map,this._resizeBatch=null,this.now=()=>{var t,n,o;return((o=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:o.call(n))??Date.now()},this.observer=(()=>{let t=null,n=null,o=()=>{if(t)return t;let i=this.targetWindow;if(!i||!i.ResizeObserver)return null;let s=n=no(i);return t=new i.ResizeObserver((a)=>{let l=()=>{let d={sync:!1};this._resizeBatch=d;try{a.forEach(r)}finally{if(this._resizeBatch=null,d.notify)this.notify(d.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}};this.options.useAnimationFrameWithResizeObserver?s.schedule(l):l()})},r=(i)=>{let s=i.target,a=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);for(let[l,d]of this.elementsCache)if(d===s){this.elementsCache.delete(l);break}return}if(!this.isIndexInRange(a))return;if(this.shouldMeasureDuringScroll(a))this.resizeItem(a,this.options.measureElement(s,i,this))};return{disconnect:()=>{var i;(i=o())==null||i.disconnect(),n==null||n.cancel(),t=null,n=null},observe:(i)=>{var s;return(s=o())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:(i)=>{var s;return(s=o())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=(t)=>{var n;let o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:us,rangeExtractor:ps,onChange:()=>{},measureElement:hs,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let d in t){let p=t[d];if(p!==void 0)o[d]=p}let r=this.options,i=null,s=null,a=!1;if(r!==void 0&&r.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){let d=r.count,p=o.count,f=this.getMeasurements(),h=((n=this._singleLaneMeasurements)==null?void 0:n.items)??f,v=(S)=>Hn(h[S]),y=d>0?v(0):null,x=d>0?v(d-1):null;if(p!==d||d>0&&p>0&&(o.getItemKey(0)!==y||o.getItemKey(p-1)!==x)){a=!0;let S=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;if(S)i=[S.key,this.getScrollOffset()-S.start];let ie=o.followOnAppend===!0?"auto":o.followOnAppend||null;if(ie&&p>0&&this.isAtEnd(r.scrollEndThreshold)&&(d===0||o.getItemKey(p-1)!==x)){if(p>d||ys(d,p,v,o.getItemKey))s=ie}}}if(this.options=o,a)this.pendingMin=0,this.itemSizeCacheVersion++;let l=null;if(i&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[d,p]=i,f=this.getMeasurements(),{count:h,getItemKey:v}=this.options,y=0;while(y<h&&v(y)!==d)y++;if(y<h){let x=f[y];if(x){let A=Math.max(0,x.start+p);if(!s&&A!==this.scrollOffset)l=A-this.scrollOffset,this.scrollOffset=A}}}if(s)this.pendingScrollAnchor={kind:"follow",behavior:s};else if(l!==null)if(this._canWriteScroll())this.pendingScrollAnchor={kind:"anchor",delta:l};else this._holdOffset+=l,this._followOffsetTarget(l)},this.notify=(t)=>{var n,o;(o=(n=this.options).onChange)==null||o.call(n,this,t)},this.maybeNotify=Oe(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),(t)=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var t;if(this.unsubs.filter(Boolean).forEach((n)=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow)this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null;this.scrollState=null,(t=this._momentumStop)==null||t.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;let n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}if(this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement)this.targetWindow=this.scrollElement.ownerDocument.defaultView;else this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null;if(this.elementsCache.forEach((r)=>{this.observer.observe(r)}),this.unsubs.push(this.options.observeElementRect(this,(r)=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,i)=>{var s,a,l,d;let p=i?this._elementMaxScrollOffset():null,f=this._reportedOverscroll;this._reportedOverscroll=r<0||p!==null&&r>p+1;let h=r;this._lastElementOffset=h,r=this._toLayoutOffset(r);let v=this._classifyScrollEvent(r,i,p);if(v==="spurious")return;if(v==="readBack")r=this.pendingWrite.target;else if(v==="clampedReadBack"&&((s=this.scrollState)==null?void 0:s.index)!=null&&r<this.getMaxScrollOffset()-1.5)this.scrollState.lastTargetOffset=r;else if(Un({kind:v,offset:r,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)}))this.scrollState=null;if(this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(r-this._clampedAdjustment.maxAtWrite)>=1.5)this._clampedAdjustment=null;let y=this.getScrollOffset(),x=this.scrollDirection;this.scrollDirection=i?y===r?this.scrollDirection:y<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=i;let A=this.scrollState;if((A==null?void 0:A.phase)==="queued"&&v==="external"&&i)if(f||this._reportedOverscroll)A.samples=[];else{let C=this.now();if(A.samples=[...(A.samples??[]).filter((S)=>C-S.t<=200),{t:C,offset:h}],x!==null&&this.scrollDirection!==x||Qn(A.samples))this.scrollState=null}if(this._iosGesture.onScroll({isScrolling:i,ownReadBack:v==="readBack",moved:r!==y,external:v==="external"&&((a=this.scrollState)==null?void 0:a.phase)!=="smooth"&&((l=this.scrollState)==null?void 0:l.phase)!=="smoothFinishing"})&&((d=this.scrollState)==null?void 0:d.phase)==="queued")this.scrollState=null;if(this._flushHoldIfReady(!0),this.scrollState)this.scheduleScrollReconcile();this.maybeNotify()})),"addEventListener"in this.scrollElement)this.unsubs.push(this._iosGesture.listen(this.scrollElement));this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let o=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,o&&this.scrollElement&&this.options.enabled)if(o.kind==="anchor")if(!this._canWriteScroll())this._holdOffset+=o.delta,this._followOffsetTarget(o.delta),this.notify(!1);else if(ot(this.scrollState)&&!be(this.getScrollOffset()-o.delta,this.scrollState.lastTargetOffset));else this._followOffsetTarget(o.delta),this._scrollToOffset(this.getScrollOffset());else this.scrollToEnd({behavior:o.behavior});this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(t,n,o)=>{var r;return $n({offset:t,isScrolling:n,elementMax:o,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:((r=this._clampedAdjustment)==null?void 0:r.maxAtWrite)??null})},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:t,maxAtWrite:n}=this._clampedAdjustment,o=this.getMaxScrollOffset();if(o>n+0.5)this._clampedAdjustment=t>o+0.5?{target:t,maxAtWrite:o}:null,this._scrollToOffset(t)},this._writeAwaitingCommand=()=>{let t=this.scrollState;if(t===null||t.phase!=="queued")return;let{behavior:n}=t;this.getMeasurements();let o=this.getScrollStateTarget(t);t.lastTargetOffset=o,this._clampedAdjustment=null,t.phase=to(n,t.index!=null&&be(o,this.getScrollOffset())),this._scrollToOffset(o,{behavior:n}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let t=this.scrollElement;if(t==null)return null;let{horizontal:n,isRtl:o}=this.options;if(typeof t.scrollTop==="number")return n?t.scrollLeft*(o&&-1||1):t.scrollTop;if(typeof t.scrollY==="number")return n?t.scrollX:t.scrollY;return null},this._canWriteScroll=()=>!(nt()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=(t)=>{var n;if(this._holdOffset===0)return;if(!this.scrollElement||!this.options.enabled)return;if(!this._canWriteScroll())return;if(((n=this.scrollState)==null?void 0:n.phase)==="smooth")return;if(this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0)this.scrollOffset=0;this.notify(t);let o=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(o),this._scrollToOffset(o)},this.rafId=null,this.getSize=()=>{if(!this.options.enabled)return this.scrollRect=null,0;return this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]},this.getScrollOffset=()=>{if(!this.options.enabled)return this.scrollOffset=null,0;return this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset},this.getMeasurementOptions=Oe(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(t,n,o,r,i,s,a,l)=>{if(this.prevLanes!==void 0&&this.prevLanes!==s)this.lanesChangedFlag=!0;return this.prevLanes=s,this.pendingMin=null,{count:t,paddingStart:n,scrollMargin:o,getItemKey:r,enabled:i,lanes:s,laneAssignmentMode:a,gap:l}},{key:!1}),this.isIndexInRange=(t)=>t>=0&&t<this.options.count,this.getMeasurements=Oe(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:n,scrollMargin:o,getItemKey:r,enabled:i,lanes:s,laneAssignmentMode:a,gap:l},d)=>{var p;let f=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t){for(let C of this.laneAssignments.keys())if(C>=t)this.laneAssignments.delete(C)}if(this.lanesChangedFlag)this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null;if(this.measurementsCache.length===0&&!this.lanesSettling)this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach((C)=>{this.itemSizeCache.set(C.key,C.size)});let h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t)this.lanesSettling=!1;if(s===1){let C=t*2,S=(p=this._singleLaneMeasurements)==null?void 0:p.flat;if(!S||S.length<C){let P=new Float64Array(C);if(S&&h>0)P.set(S.subarray(0,h*2));S=P}let ie=h===0?Array(t):this._singleLaneMeasurements.items.slice(),Q;if(h===0)Q=n+o;else{let P=h-1;Q=S[P*2]+S[P*2+1]+l}for(let P=h;P<t;P++){let ne=r(P);ie[P]=ne;let _=f.get(ne),N=typeof _==="number"?_:this.options.estimateSize(P);S[P*2]=Q,S[P*2+1]=N,Q+=N+l}this._singleLaneMeasurements={flat:S,items:ie};let L=Gn(ie,S);return this.measurementsCache=L,L}let v=this.measurementsCache.slice(0,h),y=Array(s).fill(void 0),x=new Float64Array(s),A=0;for(let C=0;C<h;C++){let S=v[C];if(S){if(y[S.lane]===void 0)A++;y[S.lane]=C,x[S.lane]=S.end}}for(let C=h;C<t;C++){let S=r(C),ie=this.laneAssignments.get(C),Q,L,P=a==="estimate"||f.has(S);if(ie!==void 0&&this.options.lanes>1){Q=ie;let R=y[Q],T=R!==void 0?v[R]:void 0;L=T?T.end+l:n+o}else if(A===s){let R=0,T=x[0],D=y[0];for(let O=1;O<s;O++){let F=x[O];if(F<T||F===T&&y[O]<D)R=O,T=F,D=y[O]}if(Q=R,L=T+l,P)this.laneAssignments.set(C,Q)}else if(Q=C%this.options.lanes,L=n+o,P)this.laneAssignments.set(C,Q);let ne=f.get(S),_=typeof ne==="number"?ne:this.options.estimateSize(C),N=L+_;if(v[C]={index:C,start:L,size:_,end:N,key:S,lane:Q},y[Q]===void 0)A++;y[Q]=C,x[Q]=N}return this.measurementsCache=v,v},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Oe(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,o,r)=>{if(t.length===0||n===0)return this.range=null,null;return this.range=ws(t,n,o,r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Oe(()=>{let t=null,n=null,o=this.calculateRange();if(o)t=o.startIndex,n=o.endIndex;return this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n,this.options.lanes]},(t,n,o,r,i,s)=>r===null||i===null?[]:t({startIndex:r,endIndex:i,overscan:n,count:o,lanes:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=(t)=>{let n=this.options.indexAttribute,o=t.getAttribute(n);if(!o)return console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1;return parseInt(o,10)},this.shouldMeasureDuringScroll=(t)=>{var n;if(!ot(this.scrollState))return!0;let o=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(o!==void 0&&this.range){let r=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,o-r),s=Math.min(this.options.count-1,o+r);return t>=i&&t<=s}return!0},this.measureElement=(t)=>{if(!t){this.elementsCache.forEach((i,s)=>{if(!i.isConnected)this.observer.unobserve(i),this.elementsCache.delete(s)});return}let n=this.indexFromElement(t);if(!this.isIndexInRange(n))return;let o=this.options.getItemKey(n),r=this.elementsCache.get(o);if(r!==t){if(r)this.observer.unobserve(r);this.observer.observe(t),this.elementsCache.set(o,t)}if(t.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n))this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var o,r,i;if(!this.isIndexInRange(t))return;if((o=this._resizeBatch)==null?void 0:o.sync)this.getMeasurements();let s,a,l,d=(r=this._singleLaneMeasurements)==null?void 0:r.flat;if(this.options.lanes===1&&d!=null)l=this.options.getItemKey(t),a=d[t*2],s=d[t*2+1];else{let h=this.measurementsCache[t];if(!h)return;l=h.key,a=h.start,s=h.size}let p=this.itemSizeCache.get(l)??s,f=n-p;if(f!==0){let h=this.options.anchorTo==="end"&&!ot(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,v=h?this._getLayoutTotalSize():0,y=this.getScrollOffset(),A=!this.itemSizeCache.has(l)?a<y:a+p<=y&&this.scrollDirection!=="backward",C=!ot(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:l,start:a,size:s,end:a+s,lane:0},f,this):A);if(this.pendingMin===null||t<this.pendingMin)this.pendingMin=t;this.itemSizeCache.set(l,n),this.itemSizeCacheVersion++;let S=!1;if(!this._awaitingCommandReadBack()){if(h)S=this.applyScrollAdjustment(this._getLayoutTotalSize()-v);else if(C)S=this.applyScrollAdjustment(f)}if(this._resizeBatch){this._resizeBatch.notify=!0,(i=this._resizeBatch).sync||(i.sync=S);return}this.notify(S),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=Oe(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(t,n,o)=>{let r=[];for(let i=0,s=t.length;i<s;i++){let a=t[i],l=n[a];r.push(o===0?l:{...l,start:l.start-o,end:l.end-o})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=(t)=>{var n;let o=this.getMeasurements();if(o.length===0)return;let r=(n=this._singleLaneMeasurements)==null?void 0:n.flat,i=this.options.lanes===1&&r!=null,s=so(0,o.length-1,i?(a)=>r[a*2]:(a)=>Zt(o[a]).start,t);return Zt(o[s])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let t=this._elementMaxScrollOffset();if(t===null)return;let n=this.pendingWrite,o=Math.max(t,0)+this._holdOffset;if(o>=n.target)return;let r=n.lowMaxes??(n.lowMaxes=[]);if(r[r.length-1]!==o)r.push(o)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=(t)=>{var n;let o=t+this._holdOffset;if(((n=this.pendingScrollAnchor)==null?void 0:n.kind)==="anchor")o+=this.pendingScrollAnchor.delta;return o},this._elementMaxScrollOffset=()=>{let t=this.scrollElement;if(t===null)return null;if("scrollHeight"in t)return this.options.horizontal?t.scrollWidth-t.clientWidth:t.scrollHeight-t.clientHeight;if("document"in t){let n=t.document.documentElement;return this.options.horizontal?n.scrollWidth-t.innerWidth:n.scrollHeight-t.innerHeight}return null},this._momentumStop=null,this._stopMomentum=(t)=>{let n=this.scrollElement,o=this.targetWindow;if(n===null||o===null)return;let r="document"in n?n.document.scrollingElement:n;if(!(r==null?void 0:r.style))return;if(this._momentumStop){this._momentumStop.done=t;return}let{style:i}=r,s=this.options.horizontal?"overflow-x":"overflow-y",a=i.getPropertyValue(s),l=i.getPropertyPriority(s);i.setProperty(s,"hidden","important");let d={restore:()=>{if(i.getPropertyValue(s)!=="hidden"||i.getPropertyPriority(s)!=="important")return!1;return i.setProperty(s,a,l),!0},done:t};this._momentumStop=d,o.requestAnimationFrame(()=>o.requestAnimationFrame(()=>{if(this._momentumStop!==d)return;if(this._momentumStop=null,d.restore())d.done()}))},this._clampedBy=(t)=>{let n=this._elementMaxScrollOffset();if(n===null)return null;let o=n+this._holdOffset;return t>o+0.5?{target:t,maxAtWrite:o}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,n,o=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();if(n==="auto")n=t>=i+r?"end":"start";if(n==="center")t+=(o-r)/2;else if(n==="end")t-=r;let s=this.getMaxScrollOffset();return Math.max(Math.min(s,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));let o=this.getSize(),r=this.getScrollOffset(),i=this.measurementsCache[t];if(!i)return;if(n==="auto")if(i.end>=r+o-this.options.scrollPaddingEnd)n="end";else if(i.start<=r+this.options.scrollPaddingStart)n="start";else return[r,n];if(n==="end"&&t===this.options.count-1){let a=this.getMaxScrollOffset(),l=a-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(l,a),0),n]}let s=n==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,n,i.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:o="auto"}={})=>{this._startScroll({index:null,align:n},this.getOffsetForAlignment(t,n),o,"absolute")},this.scrollToIndex=(t,{align:n="auto",behavior:o="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));let r=this.getOffsetForIndex(t,n);if(!r)return;let[i,s]=r;this._startScroll({index:t,align:s},i,o,"absolute")},this.scrollBy=(t,{behavior:n="auto"}={})=>{let o=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+t,"start");this._startScroll({index:null,align:"start"},o,n,"relative")},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this._startScroll({index:this.options.count-1,align:"end",toEnd:!0},Math.max(this.getMaxScrollOffset(),0),t,"absolute");return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.cancelScroll=()=>{if(this.rafId!=null&&this.targetWindow)this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null;this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{var t,n;let o=this.getMeasurements(),r;if(o.length===0)r=this.options.paddingStart;else if(this.options.lanes===1){let i=o.length-1,s=(t=this._singleLaneMeasurements)==null?void 0:t.flat;if(s!=null)r=s[i*2]+s[i*2+1];else r=((n=o[i])==null?void 0:n.end)??0}else{let i=Array(this.options.lanes).fill(null),s=o.length-1;while(s>=0&&i.some((a)=>a===null)){let a=o[s];if(i[a.lane]===null)i[a.lane]=a.end;s--}r=Math.max(...i.filter((a)=>a!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let t=[];if(this.itemSizeCache.size===0)return t;let n=this.getMeasurements();for(let o of n)if(o&&this.itemSizeCache.has(o.key))t.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return t},this._scrollToOffset=(t,{adjustments:n,behavior:o}={})=>{let r={target:t+(n??0),smooth:o==="smooth"};return this.pendingWrite=r,this.options.scrollToFn(t-this._holdOffset,{behavior:o,adjustments:n},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let t=this.getCommandWrittenOffset();return!(nt()&&this._iosGesture.dragging())&&t!==null&&!be(t,this.getScrollOffset())},this._followOffsetTarget=(t)=>{if(this.scrollState!==null&&this.scrollState.index==null)this.scrollState.lastTargetOffset+=t},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),!this._canWriteScroll()){if(this._holdOffset+=e,this.scrollOffset!==null)this.scrollOffset+=e;return!0}else{let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let o=this._scrollToOffset(n,{adjustments:e,behavior:t});if(this.scrollOffset!==null){if(this.pendingWrite===o)this.scrollOffset+=e;if(this.scrollOffset<0)this.scrollOffset=0}return!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}if(this.rafId!=null)return;this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()})}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index!=null?this.getOffsetForIndex(e.index,e.align):void 0;return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState)return;if(!this.scrollElement)return;let t=5000;if(this.now()-this.scrollState.startedAt>t){this.scrollState=null;return}if(this.scrollState.phase==="queued"){this.scheduleScrollReconcile();return}this.getMeasurements();let n=this.getScrollStateTarget(this.scrollState),o=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,r=n!==this.scrollState.lastTargetOffset;if(!r&&be(n,this.getScrollOffset())){if(this.scrollState.phase==="smooth")this.scrollState.phase="smoothLanded";else if(this.scrollState.phase==="smoothFinishing")this.scrollState.phase="instant";if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){if(this.getScrollOffset()!==n)this._scrollToOffset(n,{behavior:"auto"});this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,r){let i=this.getSize()||600,s=Math.abs(n-this.getScrollOffset()),a=ot(this.scrollState)&&s>i;if(this.scrollState.lastTargetOffset=n,a)this.scrollState.phase="smooth";else if(this.scrollState.phase==="smooth")this.scrollState.phase="smoothFinishing";else if(this.scrollState.phase==="smoothLanded")this.scrollState.phase="instant";this._scrollToOffset(n,{behavior:a?"smooth":"auto"})}this.scheduleScrollReconcile()}_startScroll(e,t,n,o){let r=this._iosGesture.tail();if(o==="absolute"&&r!==null){if(r==="fling"&&Zn()){this._stopMomentum(()=>{let i=this.scrollState;if((i==null?void 0:i.phase)!=="queued"||this._iosGesture.tail()!=="fling"||this._reportedOverscroll)return;this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand()}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:"queued",behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:to(n,e.index!=null&&be(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}}var so=(e,t,n,o)=>{while(e<=t){let r=(e+t)/2|0,i=n(r);if(i<o)e=r+1;else if(i>o)t=r-1;else return r}if(e>0)return e-1;else return 0};function vs(e,t,n){let o=0;while(o<=t){let r=(o+t)/2|0,i=e[r*2];if(i<n)o=r+1;else if(i>n)t=r-1;else return r}return o>0?o-1:0}function ws(e,t,n,o,r){let i=e.length-1;if(e.length<=o)return{startIndex:0,endIndex:i};if(o===1&&r!==null){let d=vs(r,i,n),p=d,f=n+t;while(p<i&&r[p*2]+r[p*2+1]<f)p++;return{startIndex:d,endIndex:p}}let a=so(0,i,(d)=>e[d].start,n),l=a;if(o===1)while(l<i&&e[l].end<n+t)l++;else if(o>1){let d=Array(o).fill(0);while(l<i&&d.some((f)=>f<n+t)){let f=e[l];d[f.lane]=f.end,l++}let p=Array(o).fill(n+t);while(a>=0&&p.some((f)=>f>=n)){let f=e[a];p[f.lane]=f.start,a--}a=Math.max(0,a-a%o),l=Math.min(i,l+(o-1-l%o))}return{startIndex:a,endIndex:l}}var on=typeof document<"u"?he.useLayoutEffect:he.useEffect;function xs({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...o}){let r=he.useReducer((h)=>h+1,0)[1],i=he.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});i.current.enabled=t,i.current.mode=n;let s=he.useRef(!1),a=(h)=>{let v=i.current;if(!v.enabled||!v.container)return;let y=h.getTotalSize();if(y!==v.lastSize){v.lastSize=y;let x=h.options.horizontal?"width":"height";v.container.style[x]=`${y}px`}},l=(h,v,y)=>{let x=i.current,A=!!h.options.horizontal,C=v.start-h.options.scrollMargin;if(x.lastPositions.get(y)===C)return;if(x.lastPositions.set(y,C),x.mode==="transform")y.style.transform=A?`translate3d(${C}px, 0, 0)`:`translate3d(0, ${C}px, 0)`;else y.style[A?"left":"top"]=`${C}px`},d=(h)=>{let v=i.current;if(!v.enabled||!v.container)return;a(h);for(let y of h.getVirtualItems()){let x=h.elementsCache.get(y.key);if(x)l(h,y,x)}},p={...o,onChange:(h,v)=>{var y;let x=i.current,A=!0;if(x.enabled){d(h);let C=h.range,S=x.prevRange;if(A=!S||S.isScrolling!==h.isScrolling||S.startIndex!==(C==null?void 0:C.startIndex)||S.endIndex!==(C==null?void 0:C.endIndex),A)x.prevRange=C?{startIndex:C.startIndex,endIndex:C.endIndex,isScrolling:h.isScrolling}:null}if(A)if(e&&v&&!s.current)ao.flushSync(r);else r();(y=o.onChange)==null||y.call(o,h,v)}},[f]=he.useState(()=>{let h=new nn(p),v=h.measureElement;return h.measureElement=(y)=>{s.current=!0;try{v(y)}finally{s.current=!1}let x=i.current;if(y!==null&&x.enabled&&x.container){let A=h.measurementsCache[h.indexFromElement(y)];if(A)l(h,A,y)}},Object.assign(h,{containerRef:(y)=>{let x=i.current;if(x.container=y,x.lastSize=null,y!==null)d(h)}})});return f.setOptions(p),on(()=>f._didMount(),[]),on(()=>(a(f),f._willUpdate())),on(()=>{d(f)}),f}function lo(e){return xs({observeElementRect:oo,observeElementOffset:ro,scrollToFn:io,...e})}var De=require("@deepseek-ai/dsh-client-ui-primitives");function co(e){if(e.status!=="ready")return[];let t=[],n=(o,r)=>{for(let i of o){if(i.kind==="truncation"){t.push({id:i.id,kind:"truncation",depth:r,label:i.label,path:i.path,family:i.family,archived:i.archived,open:!1,expandable:!1,document:!1});continue}let s=i.kind==="family"||i.kind==="group",a=s&&i.loaded,l=i.children??[],d=s&&i.loaded?l.filter((f)=>f.kind!=="truncation").length:void 0,p=e.documents[i.path];if(t.push({id:i.id,kind:i.kind,depth:r,label:i.label,path:i.path,family:i.family,archived:i.archived,count:d,status:i.kind==="document"?p?.status:void 0,taskCompletion:s?e.changeCompletion?.[i.path]:void 0,open:a,expandable:s,document:i.kind==="document"}),a&&l.length>0)n(l,r+1)}};return n(e.families,0),t}function uo(e,t,n){if(e.length===0)return;let o=t===void 0?-1:e.findIndex((i)=>i.id===t),r=o>=0?e[o]:void 0;switch(n){case"ArrowDown":{let i=e[o+1];return i===void 0?void 0:{focusId:i.id}}case"ArrowUp":{let i=e[o-1];return i===void 0?void 0:{focusId:i.id}}case"Home":{let i=e[0];return i===void 0?void 0:{focusId:i.id}}case"End":{let i=e[e.length-1];return i===void 0?void 0:{focusId:i.id}}case"ArrowRight":{if(r===void 0)return;if(r.expandable)return r.open?{focusId:e[o+1]?.id}:{activation:"expand"};return}case"ArrowLeft":{if(r===void 0)return;if(r.expandable&&r.open)return{activation:"collapse"};for(let i=o-1;i>=0;i-=1)if(e[i].expandable&&e[i].depth<r.depth)return{focusId:e[i].id};return}case"Enter":case" ":case"Spacebar":{if(r===void 0)return;if(r.expandable)return{activation:r.open?"collapse":"expand"};if(r.document)return{activation:"open"};return}default:return}}function po(e){if(e.kind==="truncation")return;if(e.expandable)return{focusId:e.id,activation:e.open?"collapse":"expand"};return e.document?{focusId:e.id,activation:"open"}:{focusId:e.id}}var ue={viewport:"viewport_kcgEpw",scroll:"scroll_kcgEpw",rows:"rows_kcgEpw",virtualRow:"virtualRow_kcgEpw",row:"row_kcgEpw",disclosure:"disclosure_kcgEpw",count:"count_kcgEpw",truncation:"truncation_kcgEpw",state:"state_kcgEpw"};var Y=require("react/jsx-runtime"),bs={config:"tree.family.config",architecture:"tree.family.architecture",roadmap:"tree.family.roadmap",changes:"tree.family.changes",scenes:"tree.family.scenes",specs:"tree.family.specs",tech:"tree.family.tech",lessons:"tree.family.lessons",sops:"tree.family.sops","design-system":"tree.family.design-system"},ks={status:"idle"},Ns={subscribe:()=>()=>{return},getSnapshot:()=>ks},rt={complete:"success",active:"info",accepted:"success",proposed:"info",planned:"neutral",deferred:"warning",paused:"warning",obsolete:"quiet"};function _s(e){let{row:t,focused:n,t:o,onToggle:r}=e,i={"--dssw-depth":t.depth};if(t.kind==="truncation")return Y.jsx("div",{className:ue.truncation,style:i,role:"presentation",children:o("tree.truncated")});let s=Y.jsx(De.FileTypeIcon,{path:t.path,size:16}),a=t.kind==="family"?o(bs[t.family]):t.label,l=Y.jsxs(Y.Fragment,{children:[t.status===void 0?null:Y.jsx(De.Tag,{tone:rt[t.status]??"outline",children:t.status}),t.taskCompletion===void 0?null:Y.jsx(De.Tag,{tone:t.taskCompletion.done===t.taskCompletion.total?"success":"info",children:o("tree.task-completion",{done:t.taskCompletion.done,total:t.taskCompletion.total})}),t.count===void 0?null:Y.jsx("span",{className:ue.count,children:o("tree.group-count",{count:t.count})})]});return Y.jsx("div",{className:ue.row,style:i,role:"treeitem","aria-level":t.depth+1,"aria-expanded":t.expandable?t.open:void 0,"aria-selected":t.document&&n?!0:void 0,"data-focused":n?"":void 0,onClick:()=>r(t),children:Y.jsx(De.DisclosureRow,{icon:s,title:a,open:t.open,expandable:t.expandable,onToggle:()=>r(t),headerAccessory:l,className:ue.disclosure})})}function kt(e){let{sessionId:t,tree:n,actions:o,t:r}=e,i=e.open??Ns,s=se.useSyncExternalStore(n.subscribe,n.getSnapshot,n.getSnapshot),a=se.useSyncExternalStore(i.subscribe,i.getSnapshot,i.getSnapshot),[l,d]=se.useState(void 0),[p,f]=se.useState(void 0),[h,v]=se.useState(void 0),y=se.useRef(null),x=co(s),A=a.status==="idle"?void 0:a.path;if(A!==p){let L=A===void 0?void 0:x.find((P)=>P.document&&P.path===A);if(A===void 0||L!==void 0)f(A);if(L!==void 0)d(L.id),v(L.id)}let C=l!==void 0&&x.some((L)=>L.id===l)?l:x[0]?.id,S=lo({count:x.length,getScrollElement:()=>y.current,estimateSize:()=>28,overscan:8,initialRect:{width:320,height:480},getItemKey:(L)=>x[L]?.id??L});se.useEffect(()=>{if(h===void 0)return;let L=x.findIndex((P)=>P.id===h);if(L>=0)S.scrollToIndex(L,{align:"auto"})},[h]);let ie=se.useCallback((L)=>{let P=po(L);if(P?.focusId!==void 0)d(P.focusId);if(P?.activation==="expand")o.expandNode(t,L.id);else if(P?.activation==="collapse")o.collapseNode(t,L.id);else if(P?.activation==="open")o.openDocument(t,L.path)},[o,t]),Q=se.useCallback((L)=>{let P=uo(x,C,L.key);if(P===void 0)return;if(L.preventDefault(),P.focusId!==void 0){d(P.focusId);let _=x.findIndex((N)=>N.id===P.focusId);if(_>=0)S.scrollToIndex(_);return}if(P.activation===void 0||C===void 0)return;let ne=x.find((_)=>_.id===C);if(ne===void 0)return;if(P.activation==="expand")o.expandNode(t,ne.id);else if(P.activation==="collapse")o.collapseNode(t,ne.id);else if(P.activation==="open")o.openDocument(t,ne.path)},[o,C,x,t,S]);if(s.status==="loading")return Y.jsx("div",{className:ue.state,role:"status",children:r("tree.loading")});if(s.status==="empty")return Y.jsx("div",{className:ue.state,role:"status",children:r("tree.empty")});if(s.status==="error")return Y.jsx("div",{className:ue.state,role:"alert",children:r("tree.error",{code:s.errorCode??"unknown"})});return Y.jsxs("div",{className:ue.viewport,role:"tree","aria-label":r("tree.label"),tabIndex:0,onKeyDown:Q,children:[s.rootTruncated?Y.jsx("div",{className:ue.truncation,role:"presentation",children:r("tree.root-truncated")}):null,Y.jsx("div",{ref:y,className:ue.scroll,children:Y.jsx("div",{className:ue.rows,style:{height:`${S.getTotalSize()}px`},children:S.getVirtualItems().map((L)=>{let P=x[L.index];if(P===void 0)return null;return Y.jsx("div",{className:ue.virtualRow,style:{transform:`translateY(${L.start}px)`},"data-index":L.index,children:Y.jsx(_s,{row:P,focused:P.id===C,t:r,onToggle:ie})},L.key)})})})]})}var Ts=new Set(["workflow_config","architecture","roadmap_index","roadmap_milestone","planned_change","change_proposal","change_design","task_list","question_list","delta_spec","delta_tech","delta_scene","scenes_index","scene","spec_index","main_spec","tech_index","main_tech","lessons_index","lesson","sops_index","sop_category","sop","design_system"]);function Nt(e){return e!==void 0&&Ts.has(e)}function _t(e){if(typeof e==="object"&&e!==null&&"artifact_type"in e){let t=e.artifact_type;if(typeof t==="string"&&t.length>0)return t}return}function mo(e){if(typeof e==="string")return{kind:"scalar",text:e,multiline:e.includes(`
14
+ `)};if(typeof e==="number"||typeof e==="boolean")return{kind:"scalar",text:String(e),multiline:!1};return{kind:"scalar",text:e===null?"null":String(e),multiline:!1}}function Tt(e){if(Array.isArray(e))return{kind:"sequence",items:e.map(Tt)};if(typeof e==="object"&&e!==null)return{kind:"mapping",fields:Object.entries(e).map(([t,n])=>({key:t,value:Tt(n)}))};return mo(e)}function fo(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Rt(e){if(!fo(e))return{header:[],blocks:[]};let t=[],n=[];for(let[o,r]of Object.entries(e)){if(fo(r)){n.push({kind:"section",title:o,fields:Object.entries(r).map(([s,a])=>({key:s,value:Tt(a)}))});continue}if(Array.isArray(r)){n.push({kind:"list",title:o,items:r.map(Tt)});continue}let i=mo(r);if(i.multiline){n.push({kind:"paragraph",title:o,text:i.text});continue}t.push({key:o,text:i.text})}return{header:t,blocks:n}}var ho=require("react"),Ct=require("@deepseek-ai/dsh-client-ui-primitives");var M={document:"document_A8YcYA",header:"header_A8YcYA",headerField:"headerField_A8YcYA",section:"section_A8YcYA",sectionTitle:"sectionTitle_A8YcYA",fields:"fields_A8YcYA",field:"field_A8YcYA",fieldKey:"fieldKey_A8YcYA",scalar:"scalar_A8YcYA",paragraph:"paragraph_A8YcYA",list:"list_A8YcYA",listItem:"listItem_A8YcYA",block:"block_A8YcYA",disclosure:"disclosure_A8YcYA",parseError:"parseError_A8YcYA",parseMessage:"parseMessage_A8YcYA",rawHeading:"rawHeading_A8YcYA",raw:"raw_A8YcYA",state:"state_A8YcYA"};var B=require("react/jsx-runtime");function go(e){let{part:t}=e;if(t.multiline)return B.jsx("p",{className:M.paragraph,children:t.text});return B.jsx("span",{className:M.scalar,children:t.text})}function yo(e){let{fieldKey:t,value:n,depth:o}=e;if(n.kind==="scalar")return B.jsxs("div",{className:M.field,children:[B.jsx("span",{className:M.fieldKey,children:t}),B.jsx(go,{part:n})]});return B.jsx(Cs,{title:t,depth:o,children:B.jsx(rn,{part:n,depth:o+1})})}function rn(e){let{part:t,depth:n}=e;if(t.kind==="scalar")return B.jsx(go,{part:t});if(t.kind==="sequence")return B.jsx("ul",{className:M.list,children:t.items.map((o,r)=>B.jsx("li",{className:M.listItem,children:B.jsx(rn,{part:o,depth:n})},r))});return B.jsx("div",{className:M.fields,children:t.fields.map((o)=>B.jsx(yo,{fieldKey:o.key,value:o.value,depth:n},o.key))})}function Cs(e){let{title:t,depth:n,children:o}=e,[r,i]=ho.useState(!1);return B.jsx("div",{className:M.block,style:{"--dssw-depth":n},children:B.jsx(Ct.DisclosureRow,{icon:B.jsx(Ct.FileTypeIcon,{kind:"other",size:16}),title:t,open:r,expandable:!0,onToggle:()=>i(!r),className:M.disclosure,children:r?o:null})})}function sn(e){let{blocks:t}=e;return B.jsx(B.Fragment,{children:t.map((n)=>{if(n.kind==="section")return B.jsxs("section",{className:M.section,children:[B.jsx("h3",{className:M.sectionTitle,children:n.title}),B.jsx("div",{className:M.fields,children:n.fields.map((o)=>B.jsx(yo,{fieldKey:o.key,value:o.value,depth:1},o.key))})]},n.title);if(n.kind==="list")return B.jsxs("section",{className:M.section,children:[B.jsx("h3",{className:M.sectionTitle,children:n.title}),B.jsx(rn,{part:{kind:"sequence",items:n.items},depth:1})]},n.title);return B.jsxs("section",{className:M.section,children:[B.jsx("h3",{className:M.sectionTitle,children:n.title}),B.jsx("p",{className:M.paragraph,children:n.text})]},n.title)})})}function q(e){let{blocks:t,t:n}=e;if(t.length===0)return null;return B.jsxs("section",{className:M.section,children:[B.jsx("h3",{className:M.sectionTitle,children:n("view.additional-fields")}),B.jsx(sn,{blocks:t})]})}var No=require("@deepseek-ai/dsh-client-ui-primitives");function m(e,t){if(typeof e==="object"&&e!==null&&t in e){let n=e[t];if(typeof n==="string"&&n.trim().length>0)return n}return}function g(e,t){if(typeof e==="object"&&e!==null&&t in e)return e[t];return}function V(e){if(!Array.isArray(e))return[];return e.filter((t)=>typeof t==="string"&&t.trim().length>0)}function qe(e){if(typeof e==="string")return e.trim().length>0?e:void 0;if(typeof e==="number"||typeof e==="boolean")return String(e);return}function Fe(e,t){if(typeof e==="object"&&e!==null&&t in e)return qe(e[t]);return}function j(e,t){let n=Rt(e);return{header:[...n.header],additional:n.blocks.filter((o)=>!t.has(o.title))}}function Is(e,t){if(typeof e==="object"&&e!==null&&t in e){let n=e[t];if(typeof n==="string"&&n.trim().length>0)return n}return}function it(e){if(typeof e!=="object"||e===null)return;let t=e.sections;if(typeof t!=="object"||t===null)return;let n=0,o=0;for(let r of Object.values(t)){if(typeof r!=="object"||r===null)continue;for(let i of Object.values(r)){if(typeof i!=="object"||i===null)continue;if(o+=1,Is(i,"status")==="complete")n+=1}}return o===0?void 0:{done:n,total:o}}function vo(e){let t=e.lastIndexOf("/");return t===-1?"":e.slice(0,t)}var As=new Set(["schema","schema_version","artifact_type","schema_file","change","summary","scope","unchanged_behavior","roadmap"]);function xo(e){let t=g(e,"change"),n=g(e,"summary"),o=g(e,"scope"),r=g(e,"roadmap"),i={change:t===void 0?void 0:{id:m(t,"id"),status:m(t,"status")},what:V(g(n,"what")),why:V(g(n,"why")),in:V(g(o,"in")),out:V(g(o,"out")),unchanged:V(g(e,"unchanged_behavior")),roadmap:r===void 0?void 0:{milestone:m(r,"milestone"),plannedChange:m(r,"planned_change")}};return{...j(e,As),body:i}}var Es=new Set(["schema","schema_version","artifact_type","schema_file","change","approach","decisions","alternatives","risks"]);function So(e){let t=g(e,"decisions"),n=[];if(typeof t==="object"&&t!==null)for(let[s,a]of Object.entries(t)){let l=m(a,"decision"),d=m(a,"rationale");if(l!==void 0&&d!==void 0)n.push({id:s,text:l,rationale:d})}let o=g(e,"alternatives"),r=[];if(Array.isArray(o))for(let s of o){let a=m(s,"option"),l=m(s,"reason");if(a!==void 0&&l!==void 0)r.push({option:a,reason:l})}let i={approach:V(g(e,"approach")),decisions:n,alternatives:r,risks:V(g(e,"risks"))};return{...j(e,Es),body:i}}var Os=new Set(["schema","schema_version","artifact_type","schema_file","change","sections","testing_gates"]);function bo(e){let t=g(e,"sections"),n=[];if(typeof t==="object"&&t!==null)for(let[s,a]of Object.entries(t)){let l=[];if(typeof a==="object"&&a!==null)for(let[p,f]of Object.entries(a)){let h=m(f,"text");if(h===void 0)continue;l.push({id:p,text:h,done:m(f,"status")==="complete",command:m(f,"command")})}if(l.length===0)continue;let d=l.filter((p)=>p.done).length;n.push({id:s,tasks:l,completion:{done:d,total:l.length}})}let o=g(e,"testing_gates"),r=o===void 0?void 0:{validationTask:m(o,"validation_task"),unitTestTask:m(o,"unit_test_task")},i=it(e);return{...j(e,Os),body:{sections:n,overall:i,gates:r}}}var Ds=new Set(["schema","schema_version","artifact_type","schema_file","change","open","resolved"]);function wo(e,t){let n=m(t,"question");if(n===void 0)return;return{id:e,question:n,context:m(t,"context")}}function ko(e){let t=g(e,"open"),n=[];if(Array.isArray(t))for(let i of t){let s=m(i,"id"),a=s===void 0?void 0:wo(s,i);if(a!==void 0)n.push(a)}let o=g(e,"resolved"),r=[];if(Array.isArray(o))for(let i of o){let s=m(i,"id"),a=s===void 0?void 0:wo(s,i);if(a!==void 0)r.push({...a,answer:m(i,"answer")})}return{...j(e,Ds),body:{open:n,resolved:r}}}var c={view:"view_3lbvJg",facts:"facts_3lbvJg",fact:"fact_3lbvJg",factKey:"factKey_3lbvJg",factText:"factText_3lbvJg",section:"section_3lbvJg",sectionTitle:"sectionTitle_3lbvJg",entries:"entries_3lbvJg",entry:"entry_3lbvJg",card:"card_3lbvJg",cardHeader:"cardHeader_3lbvJg",cardId:"cardId_3lbvJg",statement:"statement_3lbvJg",meta:"meta_3lbvJg",metaRow:"metaRow_3lbvJg",metaKey:"metaKey_3lbvJg",metaText:"metaText_3lbvJg",scenario:"scenario_3lbvJg",scenarioId:"scenarioId_3lbvJg",step:"step_3lbvJg",stepKind:"stepKind_3lbvJg",stepText:"stepText_3lbvJg",flowSteps:"flowSteps_3lbvJg",flowStep:"flowStep_3lbvJg",coverageList:"coverageList_3lbvJg",coverage:"coverage_3lbvJg",coverageLink:"coverageLink_3lbvJg",coverageUnresolved:"coverageUnresolved_3lbvJg",command:"command_3lbvJg",completion:"completion_3lbvJg",operationGroup:"operationGroup_3lbvJg",operationTitle:"operationTitle_3lbvJg"};var k=require("react/jsx-runtime");function It(e){let{header:t}=e;if(t.length===0)return null;return k.jsx("header",{className:c.facts,children:t.map((n)=>k.jsxs("span",{className:c.fact,children:[k.jsx("span",{className:c.factKey,children:n.key}),k.jsx("span",{className:c.factText,children:n.text})]},n.key))})}function _e(e){let{title:t,children:n}=e;return k.jsxs("section",{className:c.section,children:[k.jsx("h3",{className:c.sectionTitle,children:t}),n]})}function ge(e){let{label:t,value:n}=e;return k.jsxs("div",{className:c.metaRow,children:[k.jsx("span",{className:c.metaKey,children:t}),k.jsx("span",{className:c.metaText,children:n})]})}function Pe(e){let{title:t,entries:n}=e;if(n.length===0)return null;return k.jsx(_e,{title:t,children:k.jsx(Ps,{entries:n})})}function Ps(e){let{entries:t}=e;if(t.length===0)return null;return k.jsx("ul",{className:c.entries,children:t.map((n,o)=>k.jsx("li",{className:c.entry,children:n},o))})}function _o(e){let{data:t,t:n}=e,o=xo(t),{body:r}=o;return k.jsxs("div",{className:c.view,children:[k.jsx(It,{header:o.header}),r.change===void 0?null:k.jsxs("div",{className:c.meta,children:[r.change.id===void 0?null:k.jsx(ge,{label:n("proposal.change-id"),value:r.change.id}),r.change.status===void 0?null:k.jsx(ge,{label:n("proposal.change-status"),value:r.change.status})]}),k.jsx(Pe,{title:n("proposal.what"),entries:r.what}),k.jsx(Pe,{title:n("proposal.why"),entries:r.why}),k.jsx(Pe,{title:n("proposal.in"),entries:r.in}),k.jsx(Pe,{title:n("proposal.out"),entries:r.out}),k.jsx(Pe,{title:n("proposal.unchanged"),entries:r.unchanged}),r.roadmap===void 0?null:k.jsx(_e,{title:n("proposal.roadmap"),children:k.jsxs("div",{className:c.meta,children:[r.roadmap.milestone===void 0?null:k.jsx(ge,{label:n("proposal.roadmap-milestone"),value:r.roadmap.milestone}),r.roadmap.plannedChange===void 0?null:k.jsx(ge,{label:n("proposal.roadmap-planned-change"),value:r.roadmap.plannedChange})]})}),k.jsx(q,{blocks:o.additional,t:n})]})}function To(e){let{data:t,t:n}=e,o=So(t),{body:r}=o;return k.jsxs("div",{className:c.view,children:[k.jsx(It,{header:o.header}),k.jsx(Pe,{title:n("design.approach"),entries:r.approach}),r.decisions.length===0?null:k.jsx(_e,{title:n("design.decisions"),children:r.decisions.map((i)=>k.jsxs("div",{className:c.card,children:[k.jsx("div",{className:c.cardHeader,children:k.jsx("span",{className:c.cardId,children:i.id})}),k.jsx("p",{className:c.statement,children:i.text}),k.jsx("div",{className:c.meta,children:k.jsx(ge,{label:n("design.rationale"),value:i.rationale})})]},i.id))}),r.alternatives.length===0?null:k.jsx(_e,{title:n("design.alternatives"),children:r.alternatives.map((i,s)=>k.jsxs("div",{className:c.card,children:[k.jsx("p",{className:c.statement,children:i.option}),k.jsx("div",{className:c.meta,children:k.jsx(ge,{label:n("design.reason"),value:i.reason})})]},s))}),k.jsx(Pe,{title:n("design.risks"),entries:r.risks}),k.jsx(q,{blocks:o.additional,t:n})]})}function Ro(e){let{data:t,t:n}=e,o=bo(t),{body:r}=o;return k.jsxs("div",{className:c.view,children:[k.jsx(It,{header:o.header}),r.overall===void 0?null:k.jsx("div",{className:c.completion,children:n("tasks.overall",{done:r.overall.done,total:r.overall.total})}),r.sections.map((i)=>k.jsxs(_e,{title:i.id,children:[k.jsx("span",{className:c.completion,children:n("tasks.completion",{done:i.completion.done,total:i.completion.total})}),k.jsx("ul",{className:c.entries,children:i.tasks.map((s)=>k.jsxs("li",{className:c.entry,children:[k.jsx(No.Tag,{tone:s.done?"success":"neutral",children:n(s.done?"tasks.done":"tasks.pending")}),k.jsx("span",{className:c.cardId,children:s.id}),k.jsx("span",{className:c.entry,children:s.text}),s.command===void 0?null:k.jsx("span",{className:c.command,children:n("tasks.command",{command:s.command})})]},s.id))})]},i.id)),r.gates===void 0||r.gates.validationTask===void 0&&r.gates.unitTestTask===void 0?null:k.jsx(_e,{title:n("tasks.gates"),children:k.jsxs("div",{className:c.meta,children:[r.gates.validationTask===void 0?null:k.jsx(ge,{label:n("tasks.gate-validation"),value:r.gates.validationTask}),r.gates.unitTestTask===void 0?null:k.jsx(ge,{label:n("tasks.gate-unit-test"),value:r.gates.unitTestTask})]})}),k.jsx(q,{blocks:o.additional,t:n})]})}function Co(e){let{data:t,t:n}=e,o=ko(t),{body:r}=o;return k.jsxs("div",{className:c.view,children:[k.jsx(It,{header:o.header}),r.open.length===0?null:k.jsx(_e,{title:n("questions.open"),children:r.open.map((i)=>k.jsxs("div",{className:c.card,children:[k.jsx("div",{className:c.cardHeader,children:k.jsx("span",{className:c.cardId,children:i.id})}),k.jsx("p",{className:c.statement,children:i.question}),i.context===void 0?null:k.jsx("div",{className:c.meta,children:k.jsx(ge,{label:n("questions.context"),value:i.context})})]},i.id))}),r.resolved.length===0?null:k.jsx(_e,{title:n("questions.resolved"),children:r.resolved.map((i)=>k.jsxs("div",{className:c.card,children:[k.jsx("div",{className:c.cardHeader,children:k.jsx("span",{className:c.cardId,children:i.id})}),k.jsx("p",{className:c.statement,children:i.question}),k.jsxs("div",{className:c.meta,children:[i.context===void 0?null:k.jsx(ge,{label:n("questions.context"),value:i.context}),i.answer===void 0?null:k.jsx(ge,{label:n("questions.answer"),value:i.answer})]})]},i.id))}),k.jsx(q,{blocks:o.additional,t:n})]})}var lt=require("@deepseek-ai/dsh-client-ui-primitives");var Io=["ADDED","MODIFIED","REMOVED"];function an(e,t){let n=g(t,"scenarios"),o=[];if(typeof n==="object"&&n!==null&&!Array.isArray(n))for(let[r,i]of Object.entries(n)){let s=[];if(Array.isArray(i))for(let a of i){if(typeof a!=="object"||a===null)continue;let l=Object.entries(a);if(l.length!==1)continue;let[d,p]=l[0];if(typeof p==="string")s.push({kind:d,text:p})}o.push({id:r,steps:s})}return{id:e,strength:m(t,"strength"),statement:m(t,"statement"),scenarios:o,reason:m(t,"reason")}}function Vs(e,t){let n=g(t,"covered_by"),o=[];if(Array.isArray(n))for(let r of n){let i=m(r,"spec_id"),s=m(r,"requirement_id");if(i!==void 0&&s!==void 0)o.push({specId:i,requirementId:s})}return{id:e,action:m(t,"action"),coveredBy:o,noCoverageReason:m(t,"no_coverage_reason"),reason:m(t,"reason")}}function st(e){if(typeof e!=="object"||e===null)return[];return Object.entries(e).map(([t,n])=>Vs(t,n))}function ln(e,t){let n=g(t,"enforcement"),o=g(t,"examples"),r=o===void 0?void 0:g(o,"good"),i=o===void 0?void 0:g(o,"bad"),s=g(t,"exceptions");return{id:e,strength:m(t,"strength"),statement:m(t,"statement"),rationale:m(t,"rationale"),enforcement:n===void 0?void 0:{method:m(n,"method"),detail:m(n,"detail")},examples:o===void 0?void 0:{good:Array.isArray(r)?r.filter((a)=>typeof a==="string"):[],bad:Array.isArray(i)?i.filter((a)=>typeof a==="string"):[]},exceptions:Array.isArray(s)?s.filter((a)=>typeof a==="string"):[],reason:m(t,"reason")}}function Ao(e,t){if(typeof e!=="object"||e===null)return[];let n=[];for(let o of Io){let r=e[o];if(typeof r!=="object"||r===null)continue;let i=Object.entries(r).map(([s,a])=>t(s,a));if(i.length===0)continue;n.push({operation:o,items:i})}return n}var Ls=new Set(["schema","schema_version","artifact_type","schema_file","target_spec","spec","operations"]);function Eo(e){let t=g(e,"spec"),n={targetSpec:m(e,"target_spec"),newSpec:t===void 0?void 0:{title:m(t,"title"),path:m(t,"path")},operations:Ao(g(e,"operations"),an)};return{...j(e,Ls),body:n}}var Ms=new Set(["schema","schema_version","artifact_type","schema_file","target_scene","operations"]);function Oo(e){let t=g(e,"operations"),n=[];if(typeof t==="object"&&t!==null)for(let r of Io){let i=t[r];if(typeof i!=="object"||i===null)continue;let s=g(i,"exception_flows"),a=[];if(typeof s==="object"&&s!==null)for(let[d,p]of Object.entries(s))a.push({id:d,trigger:m(p,"trigger"),steps:st(g(p,"steps"))});let l=st(g(i,"main_flow"));if(l.length===0&&a.length===0)continue;n.push({operation:r,mainFlow:l,exceptionFlows:a})}let o={targetScene:m(e,"target_scene"),operations:n};return{...j(e,Ms),body:o}}var Bs=new Set(["schema","schema_version","artifact_type","schema_file","target_standard","standard","operations"]);function Do(e){let t=g(e,"standard"),n={targetStandard:m(e,"target_standard"),newStandard:t===void 0?void 0:{title:m(t,"title"),category:m(t,"category")},operations:Ao(g(e,"operations"),ln)};return{...j(e,Bs),body:n}}var b=require("react/jsx-runtime"),Fo={MUST:"warning",SHOULD:"info",MAY:"neutral"};function cn(e){let{header:t}=e;if(t.length===0)return null;return b.jsx("header",{className:c.facts,children:t.map((n)=>b.jsxs("span",{className:c.fact,children:[b.jsx("span",{className:c.factKey,children:n.key}),b.jsx("span",{className:c.factText,children:n.text})]},n.key))})}function re(e){let{label:t,value:n}=e;return b.jsxs("div",{className:c.metaRow,children:[b.jsx("span",{className:c.metaKey,children:t}),b.jsx("span",{className:c.metaText,children:n})]})}function dn(e){let{requirement:t,t:n,anchorId:o}=e;return b.jsxs("div",{className:c.card,id:o,children:[b.jsxs("div",{className:c.cardHeader,children:[b.jsx("span",{className:c.cardId,children:t.id}),t.strength===void 0?null:b.jsx(lt.Tag,{tone:Fo[t.strength]??"outline",children:t.strength})]}),t.statement===void 0?null:b.jsx("p",{className:c.statement,children:t.statement}),t.reason===void 0?null:b.jsx("div",{className:c.meta,children:b.jsx(re,{label:n("delta.reason"),value:t.reason})}),t.scenarios.map((r)=>b.jsxs("div",{className:c.scenario,children:[b.jsx("span",{className:c.scenarioId,children:r.id}),r.steps.map((i,s)=>b.jsxs("div",{className:c.step,children:[b.jsx("span",{className:c.stepKind,children:i.kind}),b.jsx("span",{className:c.stepText,children:i.text})]},s))]},r.id))]})}function zs(e){let{coveredBy:t,t:n,navigation:o}=e;if(t.length===0)return null;return b.jsx("div",{className:c.coverageList,children:t.map((r,i)=>{let s=`${r.specId}:${r.requirementId}`;if(o!==void 0&&o.resolve(r))return b.jsx("button",{type:"button",className:c.coverageLink,title:s,onClick:()=>o.onOpen(r),children:s},i);if(o!==void 0)return b.jsxs("span",{className:c.coverageUnresolved,children:[s,b.jsx(lt.Tag,{tone:"warning",children:n("roadmap.unresolved")})]},i);return b.jsx("span",{className:c.coverage,children:s},i)})})}function at(e){let{step:t,t:n,navigation:o}=e;return b.jsxs("li",{className:c.flowStep,children:[b.jsxs("div",{className:c.cardHeader,children:[b.jsx("span",{className:c.cardId,children:t.id}),t.coveredBy.length===0&&t.noCoverageReason===void 0?b.jsx(lt.Tag,{tone:"warning",children:n("scene.uncovered-step")}):null]}),t.action===void 0?null:b.jsx("p",{className:c.statement,children:t.action}),b.jsx(zs,{coveredBy:t.coveredBy,t:n,navigation:o}),t.noCoverageReason===void 0?null:b.jsx("div",{className:c.meta,children:b.jsx(re,{label:n("delta.no-coverage"),value:t.noCoverageReason})}),t.reason===void 0?null:b.jsx("div",{className:c.meta,children:b.jsx(re,{label:n("delta.reason"),value:t.reason})})]})}function un(e){let{rule:t,t:n}=e;return b.jsxs("div",{className:c.card,children:[b.jsxs("div",{className:c.cardHeader,children:[b.jsx("span",{className:c.cardId,children:t.id}),t.strength===void 0?null:b.jsx(lt.Tag,{tone:Fo[t.strength]??"outline",children:t.strength})]}),t.statement===void 0?null:b.jsx("p",{className:c.statement,children:t.statement}),b.jsxs("div",{className:c.meta,children:[t.rationale===void 0?null:b.jsx(re,{label:n("delta.rationale"),value:t.rationale}),t.enforcement===void 0?null:b.jsx(re,{label:n("delta.enforcement"),value:`${t.enforcement.method??""}${t.enforcement.detail===void 0?"":` — ${t.enforcement.detail}`}`}),t.reason===void 0?null:b.jsx(re,{label:n("delta.reason"),value:t.reason})]}),t.examples===void 0||t.examples.good.length===0&&t.examples.bad.length===0?null:b.jsxs("div",{className:c.meta,children:[t.examples.good.map((o,r)=>b.jsx(re,{label:n("delta.example-good"),value:o},`good-${r}`)),t.examples.bad.map((o,r)=>b.jsx(re,{label:n("delta.example-bad"),value:o},`bad-${r}`))]}),t.exceptions.length===0?null:b.jsx("div",{className:c.meta,children:t.exceptions.map((o,r)=>b.jsx(re,{label:n("delta.exceptions"),value:o},r))})]})}function Po(e){let{data:t,t:n}=e,o=Eo(t),{body:r}=o;return b.jsxs("div",{className:c.view,children:[b.jsx(cn,{header:o.header}),b.jsxs("div",{className:c.meta,children:[r.targetSpec===void 0?null:b.jsx(re,{label:n("delta.target-spec"),value:r.targetSpec}),r.newSpec===void 0?null:b.jsx(re,{label:n("delta.new-spec"),value:[r.newSpec.title,r.newSpec.path].filter((i)=>i!==void 0&&i!=="").join(" — ")})]}),r.operations.map((i)=>b.jsxs("section",{className:c.operationGroup,children:[b.jsx("h3",{className:c.operationTitle,children:i.operation}),i.items.map((s)=>b.jsx(dn,{requirement:s,t:n},s.id))]},i.operation)),b.jsx(q,{blocks:o.additional,t:n})]})}function Vo(e){let{data:t,t:n}=e,o=Oo(t),{body:r}=o;return b.jsxs("div",{className:c.view,children:[b.jsx(cn,{header:o.header}),b.jsx("div",{className:c.meta,children:r.targetScene===void 0?null:b.jsx(re,{label:n("delta.target-scene"),value:r.targetScene})}),r.operations.map((i)=>b.jsxs("section",{className:c.operationGroup,children:[b.jsx("h3",{className:c.operationTitle,children:i.operation}),i.mainFlow.length===0?null:b.jsxs("section",{className:c.section,children:[b.jsx("h4",{className:c.sectionTitle,children:n("delta.main-flow")}),b.jsx("ol",{className:c.flowSteps,children:i.mainFlow.map((s)=>b.jsx(at,{step:s,t:n},s.id))})]}),i.exceptionFlows.map((s)=>b.jsxs("section",{className:c.section,children:[b.jsx("h4",{className:c.sectionTitle,children:`${n("delta.exception-flow")}: ${s.id}`}),s.trigger===void 0?null:b.jsx("div",{className:c.meta,children:b.jsx(re,{label:n("delta.trigger"),value:s.trigger})}),b.jsx("ol",{className:c.flowSteps,children:s.steps.map((a)=>b.jsx(at,{step:a,t:n},a.id))})]},s.id))]},i.operation)),b.jsx(q,{blocks:o.additional,t:n})]})}function Lo(e){let{data:t,t:n}=e,o=Do(t),{body:r}=o;return b.jsxs("div",{className:c.view,children:[b.jsx(cn,{header:o.header}),b.jsxs("div",{className:c.meta,children:[r.targetStandard===void 0?null:b.jsx(re,{label:n("delta.target-standard"),value:r.targetStandard}),r.newStandard===void 0?null:b.jsx(re,{label:n("delta.new-standard"),value:[r.newStandard.title,r.newStandard.category===void 0?void 0:`(${r.newStandard.category})`].filter((i)=>i!==void 0&&i!=="").join(" ")})]}),r.operations.map((i)=>b.jsxs("section",{className:c.operationGroup,children:[b.jsx("h3",{className:c.operationTitle,children:i.operation}),i.items.map((s)=>b.jsx(un,{rule:s,t:n},s.id))]},i.operation)),b.jsx(q,{blocks:o.additional,t:n})]})}var qr=require("react"),In=require("@deepseek-ai/dsh-client-ui-primitives");var Mo=require("react"),At=require("@deepseek-ai/dsh-client-ui-primitives");var W={scopeColumns:"scopeColumns_IWr50g",scopeColumn:"scopeColumn_IWr50g",checklist:"checklist_IWr50g",checklistItem:"checklistItem_IWr50g",checkMark:"checkMark_IWr50g",ownedRows:"ownedRows_IWr50g",ownedRow:"ownedRow_IWr50g",ownedRowText:"ownedRowText_IWr50g",ownedRowStatic:"ownedRowStatic_IWr50g",dependencyList:"dependencyList_IWr50g",dependencyRow:"dependencyRow_IWr50g",dependencyTarget:"dependencyTarget_IWr50g",dependencyId:"dependencyId_IWr50g",dependencyIdUnresolved:"dependencyIdUnresolved_IWr50g",indexRows:"indexRows_IWr50g",indexRow:"indexRow_IWr50g",indexId:"indexId_IWr50g",indexTitle:"indexTitle_IWr50g",goalLaunch:"goalLaunch_IWr50g",goalActions:"goalActions_IWr50g",goalHint:"goalHint_IWr50g",goalConfirmSession:"goalConfirmSession_IWr50g",goalNotice:"goalNotice_IWr50g",goalConfirmTitle:"goalConfirmTitle_IWr50g",goalObjective:"goalObjective_IWr50g",goalRefusal:"goalRefusal_IWr50g"};var J=require("react/jsx-runtime");function js(e,t){switch(e.kind){case"refused":return t("roadmap.goal-refused",{reason:e.text});case"unavailable":return t("roadmap.goal-unavailable");case"failed":return t("roadmap.goal-failed",{reason:e.message})}}function qs(e){let{state:t,objective:n,sessionId:o,actions:r,t:i}=e;if(t.phase==="confirming"||t.phase==="pending"){let s=t.phase==="pending";return J.jsxs("div",{className:W.goalLaunch,role:"group","aria-label":i("roadmap.goal-launch"),children:[J.jsx("div",{className:W.goalConfirmTitle,children:i("roadmap.goal-confirm-title")}),J.jsx("div",{className:W.goalConfirmSession,children:i("roadmap.goal-confirm-session",{sessionId:o})}),J.jsx("pre",{className:W.goalObjective,children:n}),J.jsxs("div",{className:W.goalActions,children:[J.jsx(At.Button,{variant:"primary",size:"sm",disabled:s,onClick:()=>void r.confirm(),children:s?i("roadmap.goal-pending"):i("roadmap.goal-confirm")}),J.jsx(At.Button,{variant:"ghost",size:"sm",disabled:s,onClick:()=>r.cancel(),children:i("roadmap.goal-cancel")})]})]})}return J.jsxs("div",{className:W.goalLaunch,children:[J.jsxs("div",{className:W.goalActions,children:[J.jsx(At.Button,{variant:"outline",size:"sm",onClick:()=>r.request(),children:i("roadmap.goal-launch")}),J.jsx("span",{className:W.goalHint,children:i("roadmap.goal-launch-hint")})]}),t.phase==="launched"?J.jsx("div",{className:W.goalNotice,role:"status",children:i("roadmap.goal-launched")}):t.phase==="refused"?J.jsx("div",{className:W.goalRefusal,role:"alert",children:js(t.refusal,i)}):null]})}var Ks={phase:"idle"},Hs={subscribe:()=>()=>{return},getSnapshot:()=>Ks};function Bo(e){let{launcher:t,t:n}=e,o=t===void 0?Hs:t.state,r=Mo.useSyncExternalStore(o.subscribe,o.getSnapshot,o.getSnapshot);if(t===void 0)return null;return J.jsx(qs,{state:r,objective:t.objective,sessionId:t.sessionId,actions:t.actions,t:n})}function zo(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Gs=new Set(["schema","schema_version","artifact_type","schema_file","milestones"]);function Wo(e){let t=g(e,"milestones"),n=[];if(zo(t))for(let[o,r]of Object.entries(t))n.push({id:o,title:m(r,"title"),path:m(r,"path"),status:m(r,"status")});return{...j(e,Gs),body:{milestones:n}}}function jo(e,t){let n=new Map;for(let o of Object.values(t))if(o.milestoneId!==void 0&&o.milestoneOrder!==void 0)n.set(o.milestoneId,o.milestoneOrder);return e.map((o,r)=>({entry:o,index:r,order:n.get(o.id)})).sort((o,r)=>{if(o.order!==void 0&&r.order!==void 0&&o.order!==r.order)return o.order-r.order;if(o.order!==void 0&&r.order===void 0)return-1;if(o.order===void 0&&r.order!==void 0)return 1;return o.index-r.index}).map((o)=>({...o.entry,order:o.order}))}var Ys=new Set(["schema","schema_version","artifact_type","schema_file","milestone","order","goal","scope","done_criteria","intake_questions","dependencies","risks","status","notes","details"]);function qo(e){let t=g(e,"milestone"),n;if(zo(t)){let a=Object.keys(t);if(a.length===1)n={id:a[0],title:m(t[a[0]],"title")}}let o=g(e,"scope"),r=g(e,"intake_questions"),i=[];if(Array.isArray(r))for(let a of r){let l=m(a,"id"),d=m(a,"question");if(l===void 0||d===void 0)continue;i.push({id:l,question:d,context:m(a,"context"),impact:m(a,"impact"),recommendation:m(a,"recommendation")})}let s={milestone:n,status:m(e,"status"),goal:m(e,"goal"),in:V(g(o,"in")),out:V(g(o,"out")),doneCriteria:V(g(e,"done_criteria")),dependencies:V(g(e,"dependencies")),risks:V(g(e,"risks")),notes:V(g(e,"notes")),details:m(e,"details"),intakeQuestions:i};return{...j(e,Ys),body:s}}function Ko(e,t){return Object.values(e).filter((n)=>!n.archived&&n.family==="roadmap"&&n.plannedChangeId!==void 0&&n.plannedChangeMilestone===t).map((n)=>({path:n.path,id:n.plannedChangeId,label:n.label,status:n.status})).sort((n,o)=>n.path<o.path?-1:n.path>o.path?1:0)}var $s=new Set(["schema","schema_version","artifact_type","schema_file","planned_change","status","summary","details","depends_on"]);function Ho(e){let t=g(e,"planned_change");return{...j(e,$s),body:{id:m(t,"id"),milestone:m(t,"milestone"),status:m(e,"status"),summary:m(e,"summary"),details:m(e,"details"),dependsOn:V(g(e,"depends_on"))}}}function pn(e,t){return Object.values(e).find((n)=>!n.archived&&n.plannedChangeId===t)}function fn(e,t,n){return{openPlannedChange(o){let r=pn(n,o);if(r===void 0)return!1;return e.openDocument(t,r.path),!0},openPath(o){e.openDocument(t,o)}}}/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function ar(e){return typeof e>"u"||e===null}function Us(e){return typeof e==="object"&&e!==null}function Qs(e){if(Array.isArray(e))return e;else if(ar(e))return[];return[e]}function Xs(e,t){var n,o,r,i;if(t){i=Object.keys(t);for(n=0,o=i.length;n<o;n+=1)r=i[n],e[r]=t[r]}return e}function Zs(e,t){var n="",o;for(o=0;o<t;o+=1)n+=e;return n}function Js(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var ea=ar,ta=Us,na=Qs,oa=Zs,ra=Js,ia=Xs,X={isNothing:ea,isObject:ta,toArray:na,repeat:oa,isNegativeZero:ra,extend:ia};function lr(e,t){var n="",o=e.reason||"(unknown reason)";if(!e.mark)return o;if(e.mark.name)n+='in "'+e.mark.name+'" ';if(n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet)n+=`
15
+
16
+ `+e.mark.snippet;return o+" "+n}function dt(e,t){if(Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=lr(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}dt.prototype=Object.create(Error.prototype);dt.prototype.constructor=dt;dt.prototype.toString=function(t){return this.name+": "+lr(this,t)};var ae=dt;function mn(e,t,n,o,r){var i="",s="",a=Math.floor(r/2)-1;if(o-t>a)i=" ... ",t=o-a+i.length;if(n-o>a)s=" ...",n=o+a-s.length;return{str:i+e.slice(t,n).replace(/\t/g,"→")+s,pos:o-t+i.length}}function hn(e,t){return X.repeat(" ",t-e.length)+e}function sa(e,t){if(t=Object.create(t||null),!e.buffer)return null;if(!t.maxLength)t.maxLength=79;if(typeof t.indent!=="number")t.indent=1;if(typeof t.linesBefore!=="number")t.linesBefore=3;if(typeof t.linesAfter!=="number")t.linesAfter=2;var n=/\r?\n|\r|\0/g,o=[0],r=[],i,s=-1;while(i=n.exec(e.buffer))if(r.push(i.index),o.push(i.index+i[0].length),e.position<=i.index&&s<0)s=o.length-2;if(s<0)s=o.length-1;var a="",l,d,p=Math.min(e.line+t.linesAfter,r.length).toString().length,f=t.maxLength-(t.indent+p+3);for(l=1;l<=t.linesBefore;l++){if(s-l<0)break;d=mn(e.buffer,o[s-l],r[s-l],e.position-(o[s]-o[s-l]),f),a=X.repeat(" ",t.indent)+hn((e.line-l+1).toString(),p)+" | "+d.str+`
17
+ `+a}d=mn(e.buffer,o[s],r[s],e.position,f),a+=X.repeat(" ",t.indent)+hn((e.line+1).toString(),p)+" | "+d.str+`
18
+ `,a+=X.repeat("-",t.indent+p+3+d.pos)+`^
19
+ `;for(l=1;l<=t.linesAfter;l++){if(s+l>=r.length)break;d=mn(e.buffer,o[s+l],r[s+l],e.position-(o[s]-o[s+l]),f),a+=X.repeat(" ",t.indent)+hn((e.line+l+1).toString(),p)+" | "+d.str+`
20
+ `}return a.replace(/\n$/,"")}var aa=sa,la=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],ca=["scalar","sequence","mapping"];function da(e){var t={};if(e!==null)Object.keys(e).forEach(function(n){e[n].forEach(function(o){t[String(o)]=n})});return t}function ua(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(la.indexOf(n)===-1)throw new ae('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=da(t.styleAliases||null),ca.indexOf(this.kind)===-1)throw new ae('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var ee=ua;function Go(e,t){var n=[];return e[t].forEach(function(o){var r=n.length;n.forEach(function(i,s){if(i.tag===o.tag&&i.kind===o.kind&&i.multi===o.multi)r=s}),n[r]=o}),n}function pa(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function o(r){if(r.multi)e.multi[r.kind].push(r),e.multi.fallback.push(r);else e[r.kind][r.tag]=e.fallback[r.tag]=r}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(o);return e}function yn(e){return this.extend(e)}yn.prototype.extend=function(t){var n=[],o=[];if(t instanceof ee)o.push(t);else if(Array.isArray(t))o=o.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit))){if(t.implicit)n=n.concat(t.implicit);if(t.explicit)o=o.concat(t.explicit)}else throw new ae("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(i){if(!(i instanceof ee))throw new ae("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(i.loadKind&&i.loadKind!=="scalar")throw new ae("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(i.multi)throw new ae("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),o.forEach(function(i){if(!(i instanceof ee))throw new ae("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var r=Object.create(yn.prototype);return r.implicit=(this.implicit||[]).concat(n),r.explicit=(this.explicit||[]).concat(o),r.compiledImplicit=Go(r,"implicit"),r.compiledExplicit=Go(r,"explicit"),r.compiledTypeMap=pa(r.compiledImplicit,r.compiledExplicit),r};var fa=yn,ma=new ee("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),ha=new ee("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),ga=new ee("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ya=new fa({explicit:[ma,ha,ga]});function va(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function wa(){return null}function xa(e){return e===null}var Sa=new ee("tag:yaml.org,2002:null",{kind:"scalar",resolve:va,construct:wa,predicate:xa,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function ba(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function ka(e){return e==="true"||e==="True"||e==="TRUE"}function Na(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var _a=new ee("tag:yaml.org,2002:bool",{kind:"scalar",resolve:ba,construct:ka,predicate:Na,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Ta(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ra(e){return 48<=e&&e<=55}function Ca(e){return 48<=e&&e<=57}function Ia(e){if(e===null)return!1;var t=e.length,n=0,o=!1,r;if(!t)return!1;if(r=e[n],r==="-"||r==="+")r=e[++n];if(r==="0"){if(n+1===t)return!0;if(r=e[++n],r==="b"){n++;for(;n<t;n++){if(r=e[n],r==="_")continue;if(r!=="0"&&r!=="1")return!1;o=!0}return o&&r!=="_"}if(r==="x"){n++;for(;n<t;n++){if(r=e[n],r==="_")continue;if(!Ta(e.charCodeAt(n)))return!1;o=!0}return o&&r!=="_"}if(r==="o"){n++;for(;n<t;n++){if(r=e[n],r==="_")continue;if(!Ra(e.charCodeAt(n)))return!1;o=!0}return o&&r!=="_"}}if(r==="_")return!1;for(;n<t;n++){if(r=e[n],r==="_")continue;if(!Ca(e.charCodeAt(n)))return!1;o=!0}if(!o||r==="_")return!1;return!0}function Aa(e){var t=e,n=1,o;if(t.indexOf("_")!==-1)t=t.replace(/_/g,"");if(o=t[0],o==="-"||o==="+"){if(o==="-")n=-1;t=t.slice(1),o=t[0]}if(t==="0")return 0;if(o==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function Ea(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1===0&&!X.isNegativeZero(e))}var Oa=new ee("tag:yaml.org,2002:int",{kind:"scalar",resolve:Ia,construct:Aa,predicate:Ea,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Da=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Fa(e){if(e===null)return!1;if(!Da.test(e)||e[e.length-1]==="_")return!1;return!0}function Pa(e){var t,n;if(t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0)t=t.slice(1);if(t===".inf")return n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(t===".nan")return NaN;return n*parseFloat(t,10)}var Va=/^[-+]?[0-9]+e/;function La(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(X.isNegativeZero(e))return"-0.0";return n=e.toString(10),Va.test(n)?n.replace("e",".e"):n}function Ma(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||X.isNegativeZero(e))}var Ba=new ee("tag:yaml.org,2002:float",{kind:"scalar",resolve:Fa,construct:Pa,predicate:Ma,represent:La,defaultStyle:"lowercase"}),za=ya.extend({implicit:[Sa,_a,Oa,Ba]}),cr=za,dr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ur=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Wa(e){if(e===null)return!1;if(dr.exec(e)!==null)return!0;if(ur.exec(e)!==null)return!0;return!1}function ja(e){var t,n,o,r,i,s,a,l=0,d=null,p,f,h;if(t=dr.exec(e),t===null)t=ur.exec(e);if(t===null)throw Error("Date resolve error");if(n=+t[1],o=+t[2]-1,r=+t[3],!t[4])return new Date(Date.UTC(n,o,r));if(i=+t[4],s=+t[5],a=+t[6],t[7]){l=t[7].slice(0,3);while(l.length<3)l+="0";l=+l}if(t[9]){if(p=+t[10],f=+(t[11]||0),d=(p*60+f)*60000,t[9]==="-")d=-d}if(h=new Date(Date.UTC(n,o,r,i,s,a,l)),d)h.setTime(h.getTime()-d);return h}function qa(e){return e.toISOString()}var Ka=new ee("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Wa,construct:ja,instanceOf:Date,represent:qa});function Ha(e){return e==="<<"||e===null}var Ga=new ee("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Ha}),bn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
21
+ \r`;function Ya(e){if(e===null)return!1;var t,n,o=0,r=e.length,i=bn;for(n=0;n<r;n++){if(t=i.indexOf(e.charAt(n)),t>64)continue;if(t<0)return!1;o+=6}return o%8===0}function $a(e){var t,n,o=e.replace(/[\r\n=]/g,""),r=o.length,i=bn,s=0,a=[];for(t=0;t<r;t++){if(t%4===0&&t)a.push(s>>16&255),a.push(s>>8&255),a.push(s&255);s=s<<6|i.indexOf(o.charAt(t))}if(n=r%4*6,n===0)a.push(s>>16&255),a.push(s>>8&255),a.push(s&255);else if(n===18)a.push(s>>10&255),a.push(s>>2&255);else if(n===12)a.push(s>>4&255);return new Uint8Array(a)}function Ua(e){var t="",n=0,o,r,i=e.length,s=bn;for(o=0;o<i;o++){if(o%3===0&&o)t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63];n=(n<<8)+e[o]}if(r=i%3,r===0)t+=s[n>>18&63],t+=s[n>>12&63],t+=s[n>>6&63],t+=s[n&63];else if(r===2)t+=s[n>>10&63],t+=s[n>>4&63],t+=s[n<<2&63],t+=s[64];else if(r===1)t+=s[n>>2&63],t+=s[n<<4&63],t+=s[64],t+=s[64];return t}function Qa(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var Xa=new ee("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Ya,construct:$a,predicate:Qa,represent:Ua}),Za=Object.prototype.hasOwnProperty,Ja=Object.prototype.toString;function el(e){if(e===null)return!0;var t=[],n,o,r,i,s,a=e;for(n=0,o=a.length;n<o;n+=1){if(r=a[n],s=!1,Ja.call(r)!=="[object Object]")return!1;for(i in r)if(Za.call(r,i))if(!s)s=!0;else return!1;if(!s)return!1;if(t.indexOf(i)===-1)t.push(i);else return!1}return!0}function tl(e){return e!==null?e:[]}var nl=new ee("tag:yaml.org,2002:omap",{kind:"sequence",resolve:el,construct:tl}),ol=Object.prototype.toString;function rl(e){if(e===null)return!0;var t,n,o,r,i,s=e;i=Array(s.length);for(t=0,n=s.length;t<n;t+=1){if(o=s[t],ol.call(o)!=="[object Object]")return!1;if(r=Object.keys(o),r.length!==1)return!1;i[t]=[r[0],o[r[0]]]}return!0}function il(e){if(e===null)return[];var t,n,o,r,i,s=e;i=Array(s.length);for(t=0,n=s.length;t<n;t+=1)o=s[t],r=Object.keys(o),i[t]=[r[0],o[r[0]]];return i}var sl=new ee("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:rl,construct:il}),al=Object.prototype.hasOwnProperty;function ll(e){if(e===null)return!0;var t,n=e;for(t in n)if(al.call(n,t)){if(n[t]!==null)return!1}return!0}function cl(e){return e!==null?e:{}}var dl=new ee("tag:yaml.org,2002:set",{kind:"mapping",resolve:ll,construct:cl}),pr=cr.extend({implicit:[Ka,Ga],explicit:[Xa,nl,sl,dl]}),Ce=Object.prototype.hasOwnProperty,Et=1,fr=2,mr=3,Ot=4,gn=1,ul=2,Yo=3,pl=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,fl=/[\x85\u2028\u2029]/,ml=/[,\[\]\{\}]/,hr=/^(?:!|!!|![a-z\-]+!)$/i,gr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function $o(e){return Object.prototype.toString.call(e)}function ve(e){return e===10||e===13}function Ve(e){return e===9||e===32}function le(e){return e===9||e===32||e===10||e===13}function He(e){return e===44||e===91||e===93||e===123||e===125}function hl(e){var t;if(48<=e&&e<=57)return e-48;if(t=e|32,97<=t&&t<=102)return t-97+10;return-1}function gl(e){if(e===120)return 2;if(e===117)return 4;if(e===85)return 8;return 0}function yl(e){if(48<=e&&e<=57)return e-48;return-1}function Uo(e){return e===48?"\x00":e===97?"\x07":e===98?"\b":e===116?"\t":e===9?"\t":e===110?`
22
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function vl(e){if(e<=65535)return String.fromCharCode(e);return String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function yr(e,t,n){if(t==="__proto__")Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n});else e[t]=n}var vr=Array(256),wr=Array(256);for(Te=0;Te<256;Te++)vr[Te]=Uo(Te)?1:0,wr[Te]=Uo(Te);var Te;function wl(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||pr,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function xr(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=aa(n),new ae(t,n)}function E(e,t){throw xr(e,t)}function Dt(e,t){if(e.onWarning)e.onWarning.call(null,xr(e,t))}var Qo={YAML:function(t,n,o){var r,i,s;if(t.version!==null)E(t,"duplication of %YAML directive");if(o.length!==1)E(t,"YAML directive accepts exactly one argument");if(r=/^([0-9]+)\.([0-9]+)$/.exec(o[0]),r===null)E(t,"ill-formed argument of the YAML directive");if(i=parseInt(r[1],10),s=parseInt(r[2],10),i!==1)E(t,"unacceptable YAML version of the document");if(t.version=o[0],t.checkLineBreaks=s<2,s!==1&&s!==2)Dt(t,"unsupported YAML version of the document")},TAG:function(t,n,o){var r,i;if(o.length!==2)E(t,"TAG directive accepts exactly two arguments");if(r=o[0],i=o[1],!hr.test(r))E(t,"ill-formed tag handle (first argument) of the TAG directive");if(Ce.call(t.tagMap,r))E(t,'there is a previously declared suffix for "'+r+'" tag handle');if(!gr.test(i))E(t,"ill-formed tag prefix (second argument) of the TAG directive");try{i=decodeURIComponent(i)}catch(s){E(t,"tag prefix is malformed: "+i)}t.tagMap[r]=i}};function Re(e,t,n,o){var r,i,s,a;if(t<n){if(a=e.input.slice(t,n),o){for(r=0,i=a.length;r<i;r+=1)if(s=a.charCodeAt(r),!(s===9||32<=s&&s<=1114111))E(e,"expected valid JSON character")}else if(pl.test(a))E(e,"the stream contains non-printable characters");e.result+=a}}function Xo(e,t,n,o){var r,i,s,a;if(!X.isObject(n))E(e,"cannot merge mappings; the provided source object is unacceptable");r=Object.keys(n);for(s=0,a=r.length;s<a;s+=1)if(i=r[s],!Ce.call(t,i))yr(t,i,n[i]),o[i]=!0}function Ge(e,t,n,o,r,i,s,a,l){var d,p;if(Array.isArray(r)){r=Array.prototype.slice.call(r);for(d=0,p=r.length;d<p;d+=1){if(Array.isArray(r[d]))E(e,"nested arrays are not supported inside keys");if(typeof r==="object"&&$o(r[d])==="[object Object]")r[d]="[object Object]"}}if(typeof r==="object"&&$o(r)==="[object Object]")r="[object Object]";if(r=String(r),t===null)t={};if(o==="tag:yaml.org,2002:merge")if(Array.isArray(i))for(d=0,p=i.length;d<p;d+=1)Xo(e,t,i[d],n);else Xo(e,t,i,n);else{if(!e.json&&!Ce.call(n,r)&&Ce.call(t,r))e.line=s||e.line,e.lineStart=a||e.lineStart,e.position=l||e.position,E(e,"duplicated mapping key");yr(t,r,i),delete n[r]}return t}function kn(e){var t=e.input.charCodeAt(e.position);if(t===10)e.position++;else if(t===13){if(e.position++,e.input.charCodeAt(e.position)===10)e.position++}else E(e,"a line break is expected");e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function U(e,t,n){var o=0,r=e.input.charCodeAt(e.position);while(r!==0){while(Ve(r)){if(r===9&&e.firstTabInLine===-1)e.firstTabInLine=e.position;r=e.input.charCodeAt(++e.position)}if(t&&r===35)do r=e.input.charCodeAt(++e.position);while(r!==10&&r!==13&&r!==0);if(ve(r)){kn(e),r=e.input.charCodeAt(e.position),o++,e.lineIndent=0;while(r===32)e.lineIndent++,r=e.input.charCodeAt(++e.position)}else break}if(n!==-1&&o!==0&&e.lineIndent<n)Dt(e,"deficient indentation");return o}function Vt(e){var t=e.position,n;if(n=e.input.charCodeAt(t),(n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)){if(t+=3,n=e.input.charCodeAt(t),n===0||le(n))return!0}return!1}function Nn(e,t){if(t===1)e.result+=" ";else if(t>1)e.result+=X.repeat(`
23
+ `,t-1)}function xl(e,t,n){var o,r,i,s,a,l,d,p,{kind:f,result:h}=e,v;if(v=e.input.charCodeAt(e.position),le(v)||He(v)||v===35||v===38||v===42||v===33||v===124||v===62||v===39||v===34||v===37||v===64||v===96)return!1;if(v===63||v===45){if(r=e.input.charCodeAt(e.position+1),le(r)||n&&He(r))return!1}e.kind="scalar",e.result="",i=s=e.position,a=!1;while(v!==0){if(v===58){if(r=e.input.charCodeAt(e.position+1),le(r)||n&&He(r))break}else if(v===35){if(o=e.input.charCodeAt(e.position-1),le(o))break}else if(e.position===e.lineStart&&Vt(e)||n&&He(v))break;else if(ve(v))if(l=e.line,d=e.lineStart,p=e.lineIndent,U(e,!1,-1),e.lineIndent>=t){a=!0,v=e.input.charCodeAt(e.position);continue}else{e.position=s,e.line=l,e.lineStart=d,e.lineIndent=p;break}if(a)Re(e,i,s,!1),Nn(e,e.line-l),i=s=e.position,a=!1;if(!Ve(v))s=e.position+1;v=e.input.charCodeAt(++e.position)}if(Re(e,i,s,!1),e.result)return!0;return e.kind=f,e.result=h,!1}function Sl(e,t){var n,o,r;if(n=e.input.charCodeAt(e.position),n!==39)return!1;e.kind="scalar",e.result="",e.position++,o=r=e.position;while((n=e.input.charCodeAt(e.position))!==0)if(n===39)if(Re(e,o,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)o=e.position,e.position++,r=e.position;else return!0;else if(ve(n))Re(e,o,r,!0),Nn(e,U(e,!1,t)),o=r=e.position;else if(e.position===e.lineStart&&Vt(e))E(e,"unexpected end of the document within a single quoted scalar");else e.position++,r=e.position;E(e,"unexpected end of the stream within a single quoted scalar")}function bl(e,t){var n,o,r,i,s,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;e.kind="scalar",e.result="",e.position++,n=o=e.position;while((a=e.input.charCodeAt(e.position))!==0)if(a===34)return Re(e,n,e.position,!0),e.position++,!0;else if(a===92){if(Re(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),ve(a))U(e,!1,t);else if(a<256&&vr[a])e.result+=wr[a],e.position++;else if((s=gl(a))>0){r=s,i=0;for(;r>0;r--)if(a=e.input.charCodeAt(++e.position),(s=hl(a))>=0)i=(i<<4)+s;else E(e,"expected hexadecimal character");e.result+=vl(i),e.position++}else E(e,"unknown escape sequence");n=o=e.position}else if(ve(a))Re(e,n,o,!0),Nn(e,U(e,!1,t)),n=o=e.position;else if(e.position===e.lineStart&&Vt(e))E(e,"unexpected end of the document within a double quoted scalar");else e.position++,o=e.position;E(e,"unexpected end of the stream within a double quoted scalar")}function kl(e,t){var n=!0,o,r,i,s=e.tag,a,l=e.anchor,d,p,f,h,v,y=Object.create(null),x,A,C,S;if(S=e.input.charCodeAt(e.position),S===91)p=93,v=!1,a=[];else if(S===123)p=125,v=!0,a={};else return!1;if(e.anchor!==null)e.anchorMap[e.anchor]=a;S=e.input.charCodeAt(++e.position);while(S!==0){if(U(e,!0,t),S=e.input.charCodeAt(e.position),S===p)return e.position++,e.tag=s,e.anchor=l,e.kind=v?"mapping":"sequence",e.result=a,!0;else if(!n)E(e,"missed comma between flow collection entries");else if(S===44)E(e,"expected the node content, but found ','");if(A=x=C=null,f=h=!1,S===63){if(d=e.input.charCodeAt(e.position+1),le(d))f=h=!0,e.position++,U(e,!0,t)}if(o=e.line,r=e.lineStart,i=e.position,Ye(e,t,Et,!1,!0),A=e.tag,x=e.result,U(e,!0,t),S=e.input.charCodeAt(e.position),(h||e.line===o)&&S===58)f=!0,S=e.input.charCodeAt(++e.position),U(e,!0,t),Ye(e,t,Et,!1,!0),C=e.result;if(v)Ge(e,a,y,A,x,C,o,r,i);else if(f)a.push(Ge(e,null,y,A,x,C,o,r,i));else a.push(x);if(U(e,!0,t),S=e.input.charCodeAt(e.position),S===44)n=!0,S=e.input.charCodeAt(++e.position);else n=!1}E(e,"unexpected end of the stream within a flow collection")}function Nl(e,t){var n,o,r=gn,i=!1,s=!1,a=t,l=0,d=!1,p,f;if(f=e.input.charCodeAt(e.position),f===124)o=!1;else if(f===62)o=!0;else return!1;e.kind="scalar",e.result="";while(f!==0)if(f=e.input.charCodeAt(++e.position),f===43||f===45)if(gn===r)r=f===43?Yo:ul;else E(e,"repeat of a chomping mode identifier");else if((p=yl(f))>=0)if(p===0)E(e,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!s)a=t+p-1,s=!0;else E(e,"repeat of an indentation width identifier");else break;if(Ve(f)){do f=e.input.charCodeAt(++e.position);while(Ve(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!ve(f)&&f!==0)}while(f!==0){kn(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);while((!s||e.lineIndent<a)&&f===32)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!s&&e.lineIndent>a)a=e.lineIndent;if(ve(f)){l++;continue}if(e.lineIndent<a){if(r===Yo)e.result+=X.repeat(`
24
+ `,i?1+l:l);else if(r===gn){if(i)e.result+=`
25
+ `}break}if(o)if(Ve(f))d=!0,e.result+=X.repeat(`
26
+ `,i?1+l:l);else if(d)d=!1,e.result+=X.repeat(`
27
+ `,l+1);else if(l===0){if(i)e.result+=" "}else e.result+=X.repeat(`
28
+ `,l);else e.result+=X.repeat(`
29
+ `,i?1+l:l);i=!0,s=!0,l=0,n=e.position;while(!ve(f)&&f!==0)f=e.input.charCodeAt(++e.position);Re(e,n,e.position,!1)}return!0}function Zo(e,t){var n,{tag:o,anchor:r}=e,i=[],s,a=!1,l;if(e.firstTabInLine!==-1)return!1;if(e.anchor!==null)e.anchorMap[e.anchor]=i;l=e.input.charCodeAt(e.position);while(l!==0){if(e.firstTabInLine!==-1)e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation");if(l!==45)break;if(s=e.input.charCodeAt(e.position+1),!le(s))break;if(a=!0,e.position++,U(e,!0,-1)){if(e.lineIndent<=t){i.push(null),l=e.input.charCodeAt(e.position);continue}}if(n=e.line,Ye(e,t,mr,!1,!0),i.push(e.result),U(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&l!==0)E(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}if(a)return e.tag=o,e.anchor=r,e.kind="sequence",e.result=i,!0;return!1}function _l(e,t,n){var o,r,i,s,a,l,{tag:d,anchor:p}=e,f={},h=Object.create(null),v=null,y=null,x=null,A=!1,C=!1,S;if(e.firstTabInLine!==-1)return!1;if(e.anchor!==null)e.anchorMap[e.anchor]=f;S=e.input.charCodeAt(e.position);while(S!==0){if(!A&&e.firstTabInLine!==-1)e.position=e.firstTabInLine,E(e,"tab characters must not be used in indentation");if(o=e.input.charCodeAt(e.position+1),i=e.line,(S===63||S===58)&&le(o)){if(S===63){if(A)Ge(e,f,h,v,y,null,s,a,l),v=y=x=null;C=!0,A=!0,r=!0}else if(A)A=!1,r=!0;else E(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");e.position+=1,S=o}else{if(s=e.line,a=e.lineStart,l=e.position,!Ye(e,n,fr,!1,!0))break;if(e.line===i){S=e.input.charCodeAt(e.position);while(Ve(S))S=e.input.charCodeAt(++e.position);if(S===58){if(S=e.input.charCodeAt(++e.position),!le(S))E(e,"a whitespace character is expected after the key-value separator within a block mapping");if(A)Ge(e,f,h,v,y,null,s,a,l),v=y=x=null;C=!0,A=!1,r=!1,v=e.tag,y=e.result}else if(C)E(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=d,e.anchor=p,!0}else if(C)E(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=d,e.anchor=p,!0}if(e.line===i||e.lineIndent>t){if(A)s=e.line,a=e.lineStart,l=e.position;if(Ye(e,t,Ot,!0,r))if(A)y=e.result;else x=e.result;if(!A)Ge(e,f,h,v,y,x,s,a,l),v=y=x=null;U(e,!0,-1),S=e.input.charCodeAt(e.position)}if((e.line===i||e.lineIndent>t)&&S!==0)E(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}if(A)Ge(e,f,h,v,y,null,s,a,l);if(C)e.tag=d,e.anchor=p,e.kind="mapping",e.result=f;return C}function Tl(e){var t,n=!1,o=!1,r,i,s;if(s=e.input.charCodeAt(e.position),s!==33)return!1;if(e.tag!==null)E(e,"duplication of a tag property");if(s=e.input.charCodeAt(++e.position),s===60)n=!0,s=e.input.charCodeAt(++e.position);else if(s===33)o=!0,r="!!",s=e.input.charCodeAt(++e.position);else r="!";if(t=e.position,n){do s=e.input.charCodeAt(++e.position);while(s!==0&&s!==62);if(e.position<e.length)i=e.input.slice(t,e.position),s=e.input.charCodeAt(++e.position);else E(e,"unexpected end of the stream within a verbatim tag")}else{while(s!==0&&!le(s)){if(s===33)if(!o){if(r=e.input.slice(t-1,e.position+1),!hr.test(r))E(e,"named tag handle cannot contain such characters");o=!0,t=e.position+1}else E(e,"tag suffix cannot contain exclamation marks");s=e.input.charCodeAt(++e.position)}if(i=e.input.slice(t,e.position),ml.test(i))E(e,"tag suffix cannot contain flow indicator characters")}if(i&&!gr.test(i))E(e,"tag name cannot contain such characters: "+i);try{i=decodeURIComponent(i)}catch(a){E(e,"tag name is malformed: "+i)}if(n)e.tag=i;else if(Ce.call(e.tagMap,r))e.tag=e.tagMap[r]+i;else if(r==="!")e.tag="!"+i;else if(r==="!!")e.tag="tag:yaml.org,2002:"+i;else E(e,'undeclared tag handle "'+r+'"');return!0}function Rl(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;if(e.anchor!==null)E(e,"duplication of an anchor property");n=e.input.charCodeAt(++e.position),t=e.position;while(n!==0&&!le(n)&&!He(n))n=e.input.charCodeAt(++e.position);if(e.position===t)E(e,"name of an anchor node must contain at least one character");return e.anchor=e.input.slice(t,e.position),!0}function Cl(e){var t,n,o;if(o=e.input.charCodeAt(e.position),o!==42)return!1;o=e.input.charCodeAt(++e.position),t=e.position;while(o!==0&&!le(o)&&!He(o))o=e.input.charCodeAt(++e.position);if(e.position===t)E(e,"name of an alias node must contain at least one character");if(n=e.input.slice(t,e.position),!Ce.call(e.anchorMap,n))E(e,'unidentified alias "'+n+'"');return e.result=e.anchorMap[n],U(e,!0,-1),!0}function Ye(e,t,n,o,r){var i,s,a,l=1,d=!1,p=!1,f,h,v,y,x,A;if(e.listener!==null)e.listener("open",e);if(e.tag=null,e.anchor=null,e.kind=null,e.result=null,i=s=a=Ot===n||mr===n,o){if(U(e,!0,-1)){if(d=!0,e.lineIndent>t)l=1;else if(e.lineIndent===t)l=0;else if(e.lineIndent<t)l=-1}}if(l===1)while(Tl(e)||Rl(e))if(U(e,!0,-1)){if(d=!0,a=i,e.lineIndent>t)l=1;else if(e.lineIndent===t)l=0;else if(e.lineIndent<t)l=-1}else a=!1;if(a)a=d||r;if(l===1||Ot===n){if(Et===n||fr===n)x=t;else x=t+1;if(A=e.position-e.lineStart,l===1)if(a&&(Zo(e,A)||_l(e,A,x))||kl(e,x))p=!0;else{if(s&&Nl(e,x)||Sl(e,x)||bl(e,x))p=!0;else if(Cl(e)){if(p=!0,e.tag!==null||e.anchor!==null)E(e,"alias node should not have any properties")}else if(xl(e,x,Et===n)){if(p=!0,e.tag===null)e.tag="?"}if(e.anchor!==null)e.anchorMap[e.anchor]=e.result}else if(l===0)p=a&&Zo(e,A)}if(e.tag===null){if(e.anchor!==null)e.anchorMap[e.anchor]=e.result}else if(e.tag==="?"){if(e.result!==null&&e.kind!=="scalar")E(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"');for(f=0,h=e.implicitTypes.length;f<h;f+=1)if(y=e.implicitTypes[f],y.resolve(e.result)){if(e.result=y.construct(e.result),e.tag=y.tag,e.anchor!==null)e.anchorMap[e.anchor]=e.result;break}}else if(e.tag!=="!"){if(Ce.call(e.typeMap[e.kind||"fallback"],e.tag))y=e.typeMap[e.kind||"fallback"][e.tag];else{y=null,v=e.typeMap.multi[e.kind||"fallback"];for(f=0,h=v.length;f<h;f+=1)if(e.tag.slice(0,v[f].tag.length)===v[f].tag){y=v[f];break}}if(!y)E(e,"unknown tag !<"+e.tag+">");if(e.result!==null&&y.kind!==e.kind)E(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+y.kind+'", not "'+e.kind+'"');if(!y.resolve(e.result,e.tag))E(e,"cannot resolve a node with !<"+e.tag+"> explicit tag");else if(e.result=y.construct(e.result,e.tag),e.anchor!==null)e.anchorMap[e.anchor]=e.result}if(e.listener!==null)e.listener("close",e);return e.tag!==null||e.anchor!==null||p}function Il(e){var t=e.position,n,o,r,i=!1,s;e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);while((s=e.input.charCodeAt(e.position))!==0){if(U(e,!0,-1),s=e.input.charCodeAt(e.position),e.lineIndent>0||s!==37)break;i=!0,s=e.input.charCodeAt(++e.position),n=e.position;while(s!==0&&!le(s))s=e.input.charCodeAt(++e.position);if(o=e.input.slice(n,e.position),r=[],o.length<1)E(e,"directive name must not be less than one character in length");while(s!==0){while(Ve(s))s=e.input.charCodeAt(++e.position);if(s===35){do s=e.input.charCodeAt(++e.position);while(s!==0&&!ve(s));break}if(ve(s))break;n=e.position;while(s!==0&&!le(s))s=e.input.charCodeAt(++e.position);r.push(e.input.slice(n,e.position))}if(s!==0)kn(e);if(Ce.call(Qo,o))Qo[o](e,o,r);else Dt(e,'unknown document directive "'+o+'"')}if(U(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45)e.position+=3,U(e,!0,-1);else if(i)E(e,"directives end mark is expected");if(Ye(e,e.lineIndent-1,Ot,!1,!0),U(e,!0,-1),e.checkLineBreaks&&fl.test(e.input.slice(t,e.position)))Dt(e,"non-ASCII line breaks are interpreted as content");if(e.documents.push(e.result),e.position===e.lineStart&&Vt(e)){if(e.input.charCodeAt(e.position)===46)e.position+=3,U(e,!0,-1);return}if(e.position<e.length-1)E(e,"end of the stream or a document separator is expected");else return}function Sr(e,t){if(e=String(e),t=t||{},e.length!==0){if(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13)e+=`
30
+ `;if(e.charCodeAt(0)===65279)e=e.slice(1)}var n=new wl(e,t),o=e.indexOf("\x00");if(o!==-1)n.position=o,E(n,"null byte is not allowed in input");n.input+="\x00";while(n.input.charCodeAt(n.position)===32)n.lineIndent+=1,n.position+=1;while(n.position<n.length-1)Il(n);return n.documents}function Al(e,t,n){if(t!==null&&typeof t==="object"&&typeof n>"u")n=t,t=null;var o=Sr(e,n);if(typeof t!=="function")return o;for(var r=0,i=o.length;r<i;r+=1)t(o[r])}function El(e,t){var n=Sr(e,t);if(n.length===0)return;else if(n.length===1)return n[0];throw new ae("expected a single document in the stream, but found more")}var Ol=Al,Dl=El,br={loadAll:Ol,load:Dl},kr=Object.prototype.toString,Nr=Object.prototype.hasOwnProperty,_n=65279,Fl=9,ut=10,Pl=13,Vl=32,Ll=33,Ml=34,vn=35,Bl=37,zl=38,Wl=39,jl=42,_r=44,ql=45,Ft=58,Kl=61,Hl=62,Gl=63,Yl=64,Tr=91,Rr=93,$l=96,Cr=123,Ul=124,Ir=125,te={};te[0]="\\0";te[7]="\\a";te[8]="\\b";te[9]="\\t";te[10]="\\n";te[11]="\\v";te[12]="\\f";te[13]="\\r";te[27]="\\e";te[34]="\\\"";te[92]="\\\\";te[133]="\\N";te[160]="\\_";te[8232]="\\L";te[8233]="\\P";var Ql=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],Xl=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function Zl(e,t){var n,o,r,i,s,a,l;if(t===null)return{};n={},o=Object.keys(t);for(r=0,i=o.length;r<i;r+=1){if(s=o[r],a=String(t[s]),s.slice(0,2)==="!!")s="tag:yaml.org,2002:"+s.slice(2);if(l=e.compiledTypeMap.fallback[s],l&&Nr.call(l.styleAliases,a))a=l.styleAliases[a];n[s]=a}return n}function Jl(e){var t,n,o;if(t=e.toString(16).toUpperCase(),e<=255)n="x",o=2;else if(e<=65535)n="u",o=4;else if(e<=4294967295)n="U",o=8;else throw new ae("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+X.repeat("0",o-t.length)+t}var ec=1,pt=2;function tc(e){this.schema=e.schema||pr,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=X.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Zl(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?pt:ec,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer==="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Jo(e,t){var n=X.repeat(" ",t),o=0,r=-1,i="",s,a=e.length;while(o<a){if(r=e.indexOf(`
31
+ `,o),r===-1)s=e.slice(o),o=a;else s=e.slice(o,r+1),o=r+1;if(s.length&&s!==`
32
+ `)i+=n;i+=s}return i}function wn(e,t){return`
33
+ `+X.repeat(" ",e.indent*t)}function nc(e,t){var n,o,r;for(n=0,o=e.implicitTypes.length;n<o;n+=1)if(r=e.implicitTypes[n],r.resolve(t))return!0;return!1}function Pt(e){return e===Vl||e===Fl}function ft(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==_n||65536<=e&&e<=1114111}function er(e){return ft(e)&&e!==_n&&e!==Pl&&e!==ut}function tr(e,t,n){var o=er(e),r=o&&!Pt(e);return(n?o:o&&e!==_r&&e!==Tr&&e!==Rr&&e!==Cr&&e!==Ir)&&e!==vn&&!(t===Ft&&!r)||er(t)&&!Pt(t)&&e===vn||t===Ft&&r}function oc(e){return ft(e)&&e!==_n&&!Pt(e)&&e!==ql&&e!==Gl&&e!==Ft&&e!==_r&&e!==Tr&&e!==Rr&&e!==Cr&&e!==Ir&&e!==vn&&e!==zl&&e!==jl&&e!==Ll&&e!==Ul&&e!==Kl&&e!==Hl&&e!==Wl&&e!==Ml&&e!==Bl&&e!==Yl&&e!==$l}function rc(e){return!Pt(e)&&e!==Ft}function ct(e,t){var n=e.charCodeAt(t),o;if(n>=55296&&n<=56319&&t+1<e.length){if(o=e.charCodeAt(t+1),o>=56320&&o<=57343)return(n-55296)*1024+o-56320+65536}return n}function Ar(e){var t=/^\n* /;return t.test(e)}var Er=1,xn=2,Or=3,Dr=4,Ke=5;function ic(e,t,n,o,r,i,s,a){var l,d=0,p=null,f=!1,h=!1,v=o!==-1,y=-1,x=oc(ct(e,0))&&rc(ct(e,e.length-1));if(t||s)for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=ct(e,l),!ft(d))return Ke;x=x&&tr(d,p,a),p=d}else{for(l=0;l<e.length;d>=65536?l+=2:l++){if(d=ct(e,l),d===ut){if(f=!0,v)h=h||l-y-1>o&&e[y+1]!==" ",y=l}else if(!ft(d))return Ke;x=x&&tr(d,p,a),p=d}h=h||v&&(l-y-1>o&&e[y+1]!==" ")}if(!f&&!h){if(x&&!s&&!r(e))return Er;return i===pt?Ke:xn}if(n>9&&Ar(e))return Ke;if(!s)return h?Dr:Or;return i===pt?Ke:xn}function sc(e,t,n,o,r){e.dump=function(){if(t.length===0)return e.quotingType===pt?'""':"''";if(!e.noCompatMode){if(Ql.indexOf(t)!==-1||Xl.test(t))return e.quotingType===pt?'"'+t+'"':"'"+t+"'"}var i=e.indent*Math.max(1,n),s=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),a=o||e.flowLevel>-1&&n>=e.flowLevel;function l(d){return nc(e,d)}switch(ic(t,a,e.indent,s,l,e.quotingType,e.forceQuotes&&!o,r)){case Er:return t;case xn:return"'"+t.replace(/'/g,"''")+"'";case Or:return"|"+nr(t,e.indent)+or(Jo(t,i));case Dr:return">"+nr(t,e.indent)+or(Jo(ac(t,s),i));case Ke:return'"'+lc(t)+'"';default:throw new ae("impossible error: invalid scalar style")}}()}function nr(e,t){var n=Ar(e)?String(t):"",o=e[e.length-1]===`
34
+ `,r=o&&(e[e.length-2]===`
35
+ `||e===`
36
+ `),i=r?"+":o?"":"-";return n+i+`
37
+ `}function or(e){return e[e.length-1]===`
38
+ `?e.slice(0,-1):e}function ac(e,t){var n=/(\n+)([^\n]*)/g,o=function(){var d=e.indexOf(`
39
+ `);return d=d!==-1?d:e.length,n.lastIndex=d,rr(e.slice(0,d),t)}(),r=e[0]===`
40
+ `||e[0]===" ",i,s;while(s=n.exec(e)){var a=s[1],l=s[2];i=l[0]===" ",o+=a+(!r&&!i&&l!==""?`
41
+ `:"")+rr(l,t),r=i}return o}function rr(e,t){if(e===""||e[0]===" ")return e;var n=/ [^ ]/g,o,r=0,i,s=0,a=0,l="";while(o=n.exec(e)){if(a=o.index,a-r>t)i=s>r?s:a,l+=`
42
+ `+e.slice(r,i),r=i+1;s=a}if(l+=`
43
+ `,e.length-r>t&&s>r)l+=e.slice(r,s)+`
44
+ `+e.slice(s+1);else l+=e.slice(r);return l.slice(1)}function lc(e){var t="",n=0,o;for(var r=0;r<e.length;n>=65536?r+=2:r++)if(n=ct(e,r),o=te[n],!o&&ft(n)){if(t+=e[r],n>=65536)t+=e[r+1]}else t+=o||Jl(n);return t}function cc(e,t,n){var o="",r=e.tag,i,s,a;for(i=0,s=n.length;i<s;i+=1){if(a=n[i],e.replacer)a=e.replacer.call(n,String(i),a);if(ke(e,t,a,!1,!1)||typeof a>"u"&&ke(e,t,null,!1,!1)){if(o!=="")o+=","+(!e.condenseFlow?" ":"");o+=e.dump}}e.tag=r,e.dump="["+o+"]"}function ir(e,t,n,o){var r="",i=e.tag,s,a,l;for(s=0,a=n.length;s<a;s+=1){if(l=n[s],e.replacer)l=e.replacer.call(n,String(s),l);if(ke(e,t+1,l,!0,!0,!1,!0)||typeof l>"u"&&ke(e,t+1,null,!0,!0,!1,!0)){if(!o||r!=="")r+=wn(e,t);if(e.dump&&ut===e.dump.charCodeAt(0))r+="-";else r+="- ";r+=e.dump}}e.tag=i,e.dump=r||"[]"}function dc(e,t,n){var o="",r=e.tag,i=Object.keys(n),s,a,l,d,p;for(s=0,a=i.length;s<a;s+=1){if(p="",o!=="")p+=", ";if(e.condenseFlow)p+='"';if(l=i[s],d=n[l],e.replacer)d=e.replacer.call(n,l,d);if(!ke(e,t,l,!1,!1))continue;if(e.dump.length>1024)p+="? ";if(p+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),!ke(e,t,d,!1,!1))continue;p+=e.dump,o+=p}e.tag=r,e.dump="{"+o+"}"}function uc(e,t,n,o){var r="",i=e.tag,s=Object.keys(n),a,l,d,p,f,h;if(e.sortKeys===!0)s.sort();else if(typeof e.sortKeys==="function")s.sort(e.sortKeys);else if(e.sortKeys)throw new ae("sortKeys must be a boolean or a function");for(a=0,l=s.length;a<l;a+=1){if(h="",!o||r!=="")h+=wn(e,t);if(d=s[a],p=n[d],e.replacer)p=e.replacer.call(n,d,p);if(!ke(e,t+1,d,!0,!0,!0))continue;if(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f)if(e.dump&&ut===e.dump.charCodeAt(0))h+="?";else h+="? ";if(h+=e.dump,f)h+=wn(e,t);if(!ke(e,t+1,p,!0,f))continue;if(e.dump&&ut===e.dump.charCodeAt(0))h+=":";else h+=": ";h+=e.dump,r+=h}e.tag=i,e.dump=r||"{}"}function sr(e,t,n){var o,r,i,s,a,l;r=n?e.explicitTypes:e.implicitTypes;for(i=0,s=r.length;i<s;i+=1)if(a=r[i],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t==="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n)if(a.multi&&a.representName)e.tag=a.representName(t);else e.tag=a.tag;else e.tag="?";if(a.represent){if(l=e.styleMap[a.tag]||a.defaultStyle,kr.call(a.represent)==="[object Function]")o=a.represent(t,l);else if(Nr.call(a.represent,l))o=a.represent[l](t,l);else throw new ae("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');e.dump=o}return!0}return!1}function ke(e,t,n,o,r,i,s){if(e.tag=null,e.dump=n,!sr(e,n,!1))sr(e,n,!0);var a=kr.call(e.dump),l=o,d;if(o)o=e.flowLevel<0||e.flowLevel>t;var p=a==="[object Object]"||a==="[object Array]",f,h;if(p)f=e.duplicates.indexOf(n),h=f!==-1;if(e.tag!==null&&e.tag!=="?"||h||e.indent!==2&&t>0)r=!1;if(h&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(p&&h&&!e.usedDuplicates[f])e.usedDuplicates[f]=!0;if(a==="[object Object]"){if(o&&Object.keys(e.dump).length!==0){if(uc(e,t,e.dump,r),h)e.dump="&ref_"+f+e.dump}else if(dc(e,t,e.dump),h)e.dump="&ref_"+f+" "+e.dump}else if(a==="[object Array]"){if(o&&e.dump.length!==0){if(e.noArrayIndent&&!s&&t>0)ir(e,t-1,e.dump,r);else ir(e,t,e.dump,r);if(h)e.dump="&ref_"+f+e.dump}else if(cc(e,t,e.dump),h)e.dump="&ref_"+f+" "+e.dump}else if(a==="[object String]"){if(e.tag!=="?")sc(e,e.dump,t,i,l)}else if(a==="[object Undefined]")return!1;else{if(e.skipInvalid)return!1;throw new ae("unacceptable kind of an object to dump "+a)}if(e.tag!==null&&e.tag!=="?"){if(d=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!")d="!"+d;else if(d.slice(0,18)==="tag:yaml.org,2002:")d="!!"+d.slice(18);else d="!<"+d+">";e.dump=d+" "+e.dump}}return!0}function pc(e,t){var n=[],o=[],r,i;Sn(e,n,o);for(r=0,i=o.length;r<i;r+=1)t.duplicates.push(n[o[r]]);t.usedDuplicates=Array(i)}function Sn(e,t,n){var o,r,i;if(e!==null&&typeof e==="object")if(r=t.indexOf(e),r!==-1){if(n.indexOf(r)===-1)n.push(r)}else if(t.push(e),Array.isArray(e))for(r=0,i=e.length;r<i;r+=1)Sn(e[r],t,n);else{o=Object.keys(e);for(r=0,i=o.length;r<i;r+=1)Sn(e[o[r]],t,n)}}function fc(e,t){t=t||{};var n=new tc(t);if(!n.noRefs)pc(e,n);var o=e;if(n.replacer)o=n.replacer.call({"":o},"",o);if(ke(n,0,o,!0,!0))return n.dump+`
45
+ `;return""}var mc=fc,hc={dump:mc};function Tn(e,t){return function(){throw Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Fr=cr;var{load:Pr,loadAll:vu}=br,wu=hc.dump;var xu=Tn("safeLoad","load"),Su=Tn("safeLoadAll","loadAll"),bu=Tn("safeDump","dump");function Rn(e){if(e.ok)return e.value;throw e.error}function Vr(e){return{list:async(t,n,o)=>Rn(await e.workspaceFiles.list(t,n,o)),read:async(t,n,o,r)=>Rn(await e.workspaceFiles.read(t,n,o??{},r)),readBytes:async(t,n,o,r)=>Rn(await e.workspaceFiles.readBytes(t,n,o??{},r)),changes:(t,n,o)=>e.workspaceFiles.changes(t,n,o)}}function fe(e){if(typeof e==="object"&&e!==null&&"code"in e){let t=e.code;if(typeof t==="string"&&t.length>0)return t}return}var gc=new TextDecoder("utf-8",{fatal:!0});function yc(e,t){let n=e?.mark,o=typeof n?.line==="number"&&n.line>=0?n.line+1:1,r=typeof n?.column==="number"&&n.column>=0?n.column+1:1;return{kind:"parse",message:e instanceof Error?e.message:String(e),line:o,column:r,raw:t}}function Lr(e){return{kind:"read",code:fe(e)??"unknown"}}async function vc(e,t,n,o){let r=[],i=1;for(;;){let s=await e.read(t,n,{offset:i},o);if(s.lines>0)r.push(s.text),i+=s.lines;else if(!s.eof)throw Error("workspace read page reported neither lines nor eof");if(s.eof)return r.length===0?"":r.join(`
46
+ `)}}async function $e(e,t,n,o){let r;try{let i=await e.readBytes(t,n,{},o);try{r=gc.decode(i.data)}catch{return{ok:!1,error:{kind:"read",code:"workspace-file/not-text"}}}}catch(i){if(fe(i)!=="workspace-file/too-large")return{ok:!1,error:Lr(i)};try{r=await vc(e,t,n,o)}catch(s){return{ok:!1,error:Lr(s)}}}try{let i=Pr(r,{schema:Fr});return{ok:!0,data:i,artifactType:_t(i)}}catch(i){return{ok:!1,error:yc(i,r)}}}var Mr=["config","architecture","roadmap","changes","scenes","specs","tech","lessons","sops","design-system"],me=".strict-spec-driven",mt={config:["config.yaml"],architecture:["architecture.yaml"],roadmap:["roadmap"],changes:["changes"],scenes:["scenes"],specs:["specs"],tech:["tech"],lessons:["lessons"],sops:["sops"],"design-system":["design-system.yaml"]};function Lt(){return{status:"loading",families:[],documents:{}}}function ht(){return{status:"idle"}}var Br=`${me}/roadmap/archive/planned-changes`;function we(){return{status:"idle",owned:[],truncated:!1}}function wc(e){let t=e.split("/");return t[t.length-1]||e}function xc(e){if(typeof e==="object"&&e!==null&&"planned_change"in e){let t=e.planned_change;if(typeof t==="object"&&t!==null){let n=t.milestone;if(typeof n==="string"&&n.trim().length>0)return n}}return}function Sc(e){let t={};if(typeof e!=="object"||e===null)return t;let n=e;if(typeof n.status==="string"&&n.status.trim().length>0)t.status=n.status;let o=n.planned_change;if(typeof o==="object"&&o!==null){let r=o.id;if(typeof r==="string"&&r.trim().length>0)t.id=r}return t}async function zr(e,t,n){let o;try{o=await e.list(t,Br)}catch(i){let s=fe(i);if(s==="workspace-file/not-found"||s==="workspace-file/not-directory"||s==="workspace-file/outside-workspace")return{owned:[],truncated:!1,failed:!1};return{owned:[],truncated:!1,failed:!0}}let r=[];for(let i of o.entries){if(i.type!=="file")continue;let s=`${Br}/${i.name}`,a=await $e(e,t,s);if(!a.ok||a.artifactType!=="planned_change")continue;if(xc(a.data)!==n)continue;let l=Sc(a.data);r.push({path:s,id:l.id,label:wc(s),status:l.status})}return{owned:r,truncated:o.truncated,failed:!1}}var Wr=require("react"),bc={status:"ready",families:[],documents:{}},kc={subscribe:()=>()=>{return},getSnapshot:()=>bc};function Ue(e){let t=e===void 0?kc:e.viewer.tree;return Wr.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot).documents}var w=require("react/jsx-runtime"),Nc=we(),_c={subscribe:()=>()=>{return},getSnapshot:()=>Nc};function Tc(e){let t=e===void 0?_c:e.viewer.ownership;return qr.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot)}function An(e){let{header:t}=e;if(t.length===0)return null;return w.jsx("header",{className:c.facts,children:t.map((n)=>w.jsxs("span",{className:c.fact,children:[w.jsx("span",{className:c.factKey,children:n.key}),w.jsx("span",{className:c.factText,children:n.text})]},n.key))})}function Ie(e){let{title:t,children:n}=e;return w.jsxs("section",{className:c.section,children:[w.jsx("h3",{className:c.sectionTitle,children:t}),n]})}function Qe(e){let{label:t,value:n}=e;return w.jsxs("div",{className:c.metaRow,children:[w.jsx("span",{className:c.metaKey,children:t}),w.jsx("span",{className:c.metaText,children:n})]})}function Cn(e){let{title:t,entries:n}=e;if(n.length===0)return null;return w.jsx(Ie,{title:t,children:w.jsx("ul",{className:c.entries,children:n.map((o,r)=>w.jsx("li",{className:c.entry,children:o},r))})})}function Mt(e){let{title:t,text:n}=e;if(n===void 0)return null;return w.jsx(Ie,{title:t,children:w.jsx("p",{className:c.statement,children:n})})}function Bt(e){let{status:t}=e;if(t===void 0)return null;return w.jsx(In.Tag,{tone:rt[t]??"outline",children:t})}function jr(e){let{title:t,entries:n}=e;return w.jsxs("div",{className:W.scopeColumn,children:[w.jsx("h4",{className:c.sectionTitle,children:t}),w.jsx("ul",{className:c.entries,children:n.map((o,r)=>w.jsx("li",{className:c.entry,children:o},r))})]})}function Rc(e){let{question:t,t:n}=e;return w.jsxs("div",{className:c.card,children:[w.jsx("div",{className:c.cardHeader,children:w.jsx("span",{className:c.cardId,children:t.id})}),w.jsx("p",{className:c.statement,children:t.question}),w.jsxs("div",{className:c.meta,children:[t.context===void 0?null:w.jsx(Qe,{label:n("questions.context"),value:t.context}),t.impact===void 0?null:w.jsx(Qe,{label:n("roadmap.impact"),value:t.impact}),t.recommendation===void 0?null:w.jsx(Qe,{label:n("roadmap.recommendation"),value:t.recommendation})]})]})}function Cc(e){let{entry:t,onOpen:n}=e,o=w.jsxs(w.Fragment,{children:[w.jsx(Bt,{status:t.status}),w.jsx("span",{className:W.ownedRowText,children:t.id??t.label})]});if(n===void 0)return w.jsx("span",{className:W.ownedRowStatic,children:o});return w.jsx("button",{type:"button",className:W.ownedRow,onClick:()=>n(t.path),title:t.id??t.label,children:o})}function Kr(e){let{data:t,t:n,context:o}=e,r=Wo(t),i=Ue(o),s=o===void 0?r.body.milestones:jo(r.body.milestones,i);return w.jsxs("div",{className:c.view,children:[w.jsx(An,{header:r.header}),w.jsx(Bo,{launcher:o?.goal,t:n}),s.length===0?null:w.jsx(Ie,{title:n("roadmap.milestones"),children:w.jsx("div",{className:W.indexRows,children:s.map((a)=>w.jsxs("span",{className:W.indexRow,children:[w.jsx(Bt,{status:a.status}),w.jsx("span",{className:W.indexId,children:a.id}),a.title===void 0?null:w.jsx("span",{className:W.indexTitle,children:a.title})]},a.id))})}),w.jsx(q,{blocks:r.additional,t:n})]})}function Hr(e){let{data:t,t:n,path:o,context:r}=e,i=qo(t),{body:s}=i,a=Ue(r),l=Tc(r),d=s.milestone?.id,p=o!==void 0&&a[o]?.archived===!0,f=r===void 0?void 0:fn(r.viewer.actions,r.sessionId,a),h=p&&l.status==="ready"&&l.milestoneId===d,v=h?l.owned:d===void 0?[]:Ko(a,d);return w.jsxs("div",{className:c.view,children:[w.jsx(An,{header:i.header}),s.milestone===void 0?null:w.jsx("div",{className:c.meta,children:s.milestone.title===void 0?null:w.jsx(Qe,{label:n("ctx.title"),value:s.milestone.title})}),w.jsx("div",{className:c.meta,children:w.jsx(Bt,{status:s.status})}),w.jsx(Mt,{title:n("roadmap.goal"),text:s.goal}),s.in.length===0&&s.out.length===0?null:w.jsx(Ie,{title:n("sop.scope"),children:w.jsxs("div",{className:W.scopeColumns,children:[w.jsx(jr,{title:n("proposal.in"),entries:s.in}),w.jsx(jr,{title:n("proposal.out"),entries:s.out})]})}),s.doneCriteria.length===0?null:w.jsx(Ie,{title:n("roadmap.done-criteria"),children:w.jsx("ul",{className:W.checklist,children:s.doneCriteria.map((y,x)=>w.jsxs("li",{className:W.checklistItem,children:[w.jsx("span",{className:W.checkMark,"aria-hidden":"true",children:"☑"}),w.jsx("span",{className:c.entry,children:y})]},x))})}),w.jsx(Cn,{title:n("roadmap.dependencies"),entries:s.dependencies}),w.jsx(Cn,{title:n("design.risks"),entries:s.risks}),w.jsx(Cn,{title:n("roadmap.notes"),entries:s.notes}),w.jsx(Mt,{title:n("roadmap.details"),text:s.details}),s.intakeQuestions.length===0?null:w.jsx(Ie,{title:n("roadmap.intake-questions"),children:s.intakeQuestions.map((y,x)=>w.jsx(Rc,{question:y,t:n},`${y.id}:${x}`))}),d===void 0?null:w.jsxs(Ie,{title:n("roadmap.owned-planned-changes"),children:[p&&l.status==="loading"?w.jsx("span",{className:c.entry,children:n("view.loading")}):null,p&&l.status==="error"?w.jsx("span",{className:c.entry,role:"alert",children:n("roadmap.ownership-error")}):null,h&&l.truncated?w.jsx("div",{className:c.entry,children:n("tree.truncated")}):null,w.jsx("div",{className:W.ownedRows,children:v.map((y)=>w.jsx(Cc,{entry:y,onOpen:f===void 0?void 0:f.openPath},y.path))})]}),w.jsx(q,{blocks:i.additional,t:n})]})}function Gr(e){let{data:t,t:n,context:o}=e,r=Ho(t),{body:i}=r,s=Ue(o),a=o===void 0?void 0:fn(o.viewer.actions,o.sessionId,s);return w.jsxs("div",{className:c.view,children:[w.jsx(An,{header:r.header}),w.jsx("div",{className:c.meta,children:w.jsx(Bt,{status:i.status})}),w.jsxs("div",{className:c.meta,children:[i.id===void 0?null:w.jsx(Qe,{label:n("proposal.change-id"),value:i.id}),i.milestone===void 0?null:w.jsx(Qe,{label:n("proposal.roadmap-milestone"),value:i.milestone})]}),w.jsx(Mt,{title:n("roadmap.summary"),text:i.summary}),w.jsx(Mt,{title:n("roadmap.details"),text:i.details}),i.dependsOn.length===0?null:w.jsx(Ie,{title:n("roadmap.depends-on"),children:w.jsx("ul",{className:W.dependencyList,children:i.dependsOn.map((l,d)=>{let p=pn(s,l);return w.jsx("li",{className:W.dependencyRow,children:p!==void 0&&a!==void 0?w.jsx("button",{type:"button",className:W.dependencyTarget,onClick:()=>a.openPlannedChange(l),title:p.label,children:w.jsx("span",{className:W.dependencyId,children:l})}):p!==void 0?w.jsx("span",{className:W.dependencyId,children:l}):w.jsxs(w.Fragment,{children:[w.jsx("span",{className:W.dependencyIdUnresolved,children:l}),w.jsx(In.Tag,{tone:"warning",children:n("roadmap.unresolved")})]})},d)})})}),w.jsx(q,{blocks:r.additional,t:n})]})}var Zr=require("@deepseek-ai/dsh-client-ui-primitives");function Wt(e,t){return`strict-spec-req-${e}-${t}`}var Ic=new Set(["schema","schema_version","artifact_type","schema_file","spec","requirements"]);function Yr(e){let t=g(e,"spec"),n=g(e,"requirements"),o=[];if(typeof n==="object"&&n!==null&&!Array.isArray(n))for(let[i,s]of Object.entries(n))o.push(an(i,s));let r={spec:t===void 0?void 0:{id:m(t,"id"),title:m(t,"title")},requirements:o};return{...j(e,Ic),body:r}}var Ac=new Set(["schema","schema_version","artifact_type","schema_file","specs"]),zt="(unspecified)";function Ec(e){if(e===void 0)return zt;let t=e.split("/"),n=t.lastIndexOf("specs"),o=n===-1?t:t.slice(n+1);return o.length>=2&&o[0]!==void 0&&o[0].length>0?o[0]:zt}function $r(e){let t=g(e,"specs"),n=[];if(Array.isArray(t))for(let i of t){let s=m(i,"id");if(s===void 0)continue;n.push({id:s,title:m(i,"title"),path:m(i,"path")})}let o=[],r=new Map;for(let i of n){let s=Ec(i.path),a=r.get(s);if(a===void 0)a={area:s,specs:[]},r.set(s,a),o.push(a);a.specs.push(i)}return{...j(e,Ac),body:{groups:o}}}var Oc=new Set(["schema","schema_version","artifact_type","schema_file","scene","area","status","actors","preconditions","main_flow","exception_flows"]);function Dc(e){let t=m(e,"name");if(t===void 0)return;return{name:t,role:m(e,"role")}}function Ur(e){let t=g(e,"scene"),n=g(e,"actors"),o=[];if(Array.isArray(n))for(let a of n){let l=Dc(a);if(l!==void 0)o.push(l)}let r=g(e,"exception_flows"),i=[];if(typeof r==="object"&&r!==null&&!Array.isArray(r))for(let[a,l]of Object.entries(r))i.push({id:a,trigger:m(l,"trigger"),steps:st(g(l,"steps"))});let s={scene:t===void 0?void 0:{id:m(t,"id"),title:m(t,"title")},area:m(e,"area"),status:m(e,"status"),actors:o,preconditions:V(g(e,"preconditions")),mainFlow:st(g(e,"main_flow")),exceptionFlows:i};return{...j(e,Oc),body:s}}var Fc=new Set(["schema","schema_version","artifact_type","schema_file","areas"]);function Qr(e){let t=g(e,"areas"),n=[];if(typeof t==="object"&&t!==null&&!Array.isArray(t))for(let[o,r]of Object.entries(t)){let i=[];if(typeof r==="object"&&r!==null&&!Array.isArray(r))for(let[s,a]of Object.entries(r))i.push({id:s,title:m(a,"title"),status:m(a,"status"),path:m(a,"path")});n.push({area:o,scenes:i})}return{...j(e,Fc),body:{groups:n}}}function En(e,t,n){let o=Object.values(e).find((r)=>!r.archived&&r.family==="specs"&&r.specId===t);if(o===void 0)return;if(n!==void 0&&o.requirementIds!==void 0&&!o.requirementIds.includes(n))return;return o}function Xr(e,t,n){return{openRequirement(o,r){let i=En(n,o,r);if(i===void 0)return!1;return e.openDocument(t,i.path,Wt(o,r)),!0}}}var Ne={groupRows:"groupRows_1hxWWw",groupRow:"groupRow_1hxWWw",rowId:"rowId_1hxWWw",rowTitle:"rowTitle_1hxWWw"};var I=require("react/jsx-runtime");function jt(e){let{header:t}=e;if(t.length===0)return null;return I.jsx("header",{className:c.facts,children:t.map((n)=>I.jsxs("span",{className:c.fact,children:[I.jsx("span",{className:c.factKey,children:n.key}),I.jsx("span",{className:c.factText,children:n.text})]},n.key))})}function Le(e){let{title:t,children:n}=e;return I.jsxs("section",{className:c.section,children:[I.jsx("h3",{className:c.sectionTitle,children:t}),n]})}function Xe(e){let{label:t,value:n}=e;return I.jsxs("div",{className:c.metaRow,children:[I.jsx("span",{className:c.metaKey,children:t}),I.jsx("span",{className:c.metaText,children:n})]})}function Vc(e){let{title:t,entries:n}=e;if(n.length===0)return null;return I.jsx(Le,{title:t,children:I.jsx("ul",{className:c.entries,children:n.map((o,r)=>I.jsx("li",{className:c.entry,children:o},r))})})}function Jr(e){let{status:t}=e;if(t===void 0)return null;return I.jsx(Zr.Tag,{tone:rt[t]??"outline",children:t})}function Lc(e){let{group:t,t:n}=e;return I.jsx(Le,{title:t.area===zt?n("spec-index.other-area"):t.area,children:I.jsx("div",{className:Ne.groupRows,children:t.specs.map((o)=>I.jsxs("span",{className:Ne.groupRow,children:[I.jsx("span",{className:Ne.rowId,children:o.id}),o.title===void 0?null:I.jsx("span",{className:Ne.rowTitle,children:o.title})]},o.id))})})}function Mc(e){let{group:t}=e;return I.jsx(Le,{title:t.area,children:I.jsx("div",{className:Ne.groupRows,children:t.scenes.map((n)=>I.jsxs("span",{className:Ne.groupRow,children:[I.jsx(Jr,{status:n.status}),I.jsx("span",{className:Ne.rowId,children:n.id}),n.title===void 0?null:I.jsx("span",{className:Ne.rowTitle,children:n.title})]},n.id))})})}function Bc(e){let{actor:t,t:n}=e;return I.jsxs("div",{className:c.card,children:[I.jsx("div",{className:c.cardHeader,children:I.jsx("span",{className:c.cardId,children:t.name})}),t.role===void 0?null:I.jsx("div",{className:c.meta,children:I.jsx(Xe,{label:n("scene.actor-role"),value:t.role})})]})}function zc(e,t){if(e===void 0)return;let n=Xr(e.viewer.actions,e.sessionId,t);return{resolve:(o)=>En(t,o.specId,o.requirementId)!==void 0,onOpen:(o)=>{n.openRequirement(o.specId,o.requirementId)}}}function ei(e){let{data:t,t:n}=e,o=Yr(t),{body:r}=o;return I.jsxs("div",{className:c.view,children:[I.jsx(jt,{header:o.header}),r.spec===void 0?null:I.jsxs("div",{className:c.meta,children:[r.spec.id===void 0?null:I.jsx(Xe,{label:n("ctx.id"),value:r.spec.id}),r.spec.title===void 0?null:I.jsx(Xe,{label:n("ctx.title"),value:r.spec.title})]}),r.requirements.length===0?null:I.jsx(Le,{title:n("spec.requirements"),children:r.requirements.map((i)=>I.jsx(dn,{requirement:i,t:n,anchorId:r.spec?.id===void 0?void 0:Wt(r.spec.id,i.id)},i.id))}),I.jsx(q,{blocks:o.additional,t:n})]})}function ti(e){let{data:t,t:n}=e,o=$r(t),{body:r}=o;return I.jsxs("div",{className:c.view,children:[I.jsx(jt,{header:o.header}),r.groups.map((i)=>I.jsx(Lc,{group:i,t:n},i.area)),I.jsx(q,{blocks:o.additional,t:n})]})}function ni(e){let{data:t,t:n,context:o}=e,r=Ur(t),{body:i}=r,s=Ue(o),a=zc(o,s);return I.jsxs("div",{className:c.view,children:[I.jsx(jt,{header:r.header}),i.scene===void 0?null:I.jsxs("div",{className:c.meta,children:[i.scene.id===void 0?null:I.jsx(Xe,{label:n("ctx.id"),value:i.scene.id}),i.scene.title===void 0?null:I.jsx(Xe,{label:n("ctx.title"),value:i.scene.title})]}),I.jsx("div",{className:c.meta,children:I.jsx(Jr,{status:i.status})}),i.actors.length===0?null:I.jsx(Le,{title:n("scene.actors"),children:i.actors.map((l)=>I.jsx(Bc,{actor:l,t:n},l.name))}),I.jsx(Vc,{title:n("scene.preconditions"),entries:i.preconditions}),i.mainFlow.length===0?null:I.jsx(Le,{title:n("delta.main-flow"),children:I.jsx("ol",{className:c.flowSteps,children:i.mainFlow.map((l)=>I.jsx(at,{step:l,t:n,navigation:a},l.id))})}),i.exceptionFlows.map((l)=>I.jsxs(Le,{title:`${n("delta.exception-flow")}: ${l.id}`,children:[l.trigger===void 0?null:I.jsx("div",{className:c.meta,children:I.jsx(Xe,{label:n("delta.trigger"),value:l.trigger})}),I.jsx("ol",{className:c.flowSteps,children:l.steps.map((d)=>I.jsx(at,{step:d,t:n,navigation:a},d.id))})]},l.id)),I.jsx(q,{blocks:r.additional,t:n})]})}function oi(e){let{data:t,t:n}=e,o=Qr(t),{body:r}=o;return I.jsxs("div",{className:c.view,children:[I.jsx(jt,{header:o.header}),r.groups.map((i)=>I.jsx(Mc,{group:i},i.area)),I.jsx(q,{blocks:o.additional,t:n})]})}var On=require("@deepseek-ai/dsh-client-ui-primitives");function Ze(e){if(e===void 0)return;return{id:m(e,"id"),title:m(e,"title"),description:m(e,"description")}}var Wc=new Set(["schema","schema_version","artifact_type","preferred_human_language","context","rules","review_evidence","maintenance"]);function ii(e){let t=[],n=g(e,"rules");if(typeof n==="object"&&n!==null)for(let[l,d]of Object.entries(n)){let p=V(d);if(p.length>0)t.push({category:l,entries:p})}let o=[],r=g(e,"review_evidence");if(typeof r==="object"&&r!==null)for(let[l,d]of Object.entries(r)){let p=g(d,"coverage"),f=p===void 0?void 0:g(p,"scope");o.push({name:l,method:m(d,"method"),command:m(d,"command"),meaning:m(d,"meaning"),unavailableBehavior:m(d,"unavailable_behavior"),coverage:p===void 0?void 0:{threshold:Fe(p,"threshold"),metric:Fe(p,"metric"),include:f===void 0?[]:V(g(f,"include")),exclude:f===void 0?[]:V(g(f,"exclude"))}})}let i=[],s=g(g(e,"maintenance"),"checks");if(Array.isArray(s))for(let l of s){let d=qe(l);if(d!==void 0){i.push({text:d,fields:[]});continue}if(typeof l==="object"&&l!==null){let p=[];for(let[f,h]of Object.entries(l)){let v=qe(h);if(v!==void 0)p.push({key:f,text:v})}if(p.length>0)i.push({fields:p})}}let a={context:m(e,"context"),ruleGroups:t,evidence:o,maintenanceChecks:i};return{...j(e,Wc),body:a}}var jc=new Set(["schema","schema_version","artifact_type","schema_file","architecture","components","data_flows","decisions"]);function si(e){let t=[],n=g(e,"components");if(typeof n==="object"&&n!==null)for(let[l,d]of Object.entries(n)){let p=g(d,"mapping");t.push({id:l,title:m(d,"title"),responsibility:m(d,"responsibility"),boundaries:V(g(d,"boundaries")),dependsOn:V(g(d,"depends_on")),implementation:p===void 0?[]:V(g(p,"implementation"))})}let o=[],r=g(e,"data_flows");if(typeof r==="object"&&r!==null)for(let[l,d]of Object.entries(r))o.push({id:l,title:m(d,"title"),trigger:m(d,"trigger"),steps:V(g(d,"steps")),components:V(g(d,"components"))});let i=[],s=g(e,"decisions");if(typeof s==="object"&&s!==null)for(let[l,d]of Object.entries(s))i.push({id:l,title:m(d,"title"),statement:m(d,"statement"),rationale:m(d,"rationale"),status:m(d,"status"),alternatives:V(g(d,"alternatives"))});let a={identity:Ze(g(e,"architecture")),components:t,dataFlows:o,decisions:i};return{...j(e,jc),body:a}}var qc=new Set(["schema","schema_version","artifact_type","schema_file","standard","rules"]);function ai(e){let t=g(e,"standard"),n=[],o=g(e,"rules");if(typeof o==="object"&&o!==null)for(let[i,s]of Object.entries(o))n.push(ln(i,s));let r={identity:Ze(t),category:t===void 0?void 0:m(t,"category"),rules:n};return{...j(e,qc),body:r}}var Kc=new Set(["schema","schema_version","artifact_type","schema_file","standards"]);function li(e){let t=[],n=g(e,"standards");if(Array.isArray(n))for(let o of n){let r=m(o,"id");if(r===void 0)continue;t.push({id:r,title:m(o,"title"),category:m(o,"category"),path:m(o,"path")})}return{...j(e,Kc),body:{standards:t}}}var Hc=new Set(["schema","schema_version","artifact_type","schema_file","lesson","category","status","created_at","updated_at","context","observation","takeaway","applies_when","occurrences","promoted_to","obsoleted_reason","obsoleted_at"]);function ci(e){let t=[],n=g(e,"occurrences");if(Array.isArray(n))for(let i of n){let s=m(i,"origin");if(s===void 0)continue;t.push({origin:s,date:m(i,"date"),evidence:m(i,"evidence")})}let o=g(e,"promoted_to"),r={identity:Ze(g(e,"lesson")),category:m(e,"category"),status:m(e,"status"),context:m(e,"context"),observation:m(e,"observation"),takeaway:m(e,"takeaway"),appliesWhen:m(e,"applies_when"),occurrences:t,promotedTo:o===void 0?void 0:{standard:m(o,"standard"),rule:m(o,"rule")},obsoletedReason:m(e,"obsoleted_reason"),obsoletedAt:m(e,"obsoleted_at")};return{...j(e,Hc),body:r}}var Gc=new Set(["schema","schema_version","artifact_type","schema_file","categories"]);function di(e){let t=[],n=g(e,"categories");if(typeof n==="object"&&n!==null)for(let[o,r]of Object.entries(n)){let i=[];if(typeof r==="object"&&r!==null)for(let[s,a]of Object.entries(r))i.push({id:s,title:m(a,"title"),status:m(a,"status"),occurrences:Fe(a,"occurrences"),path:m(a,"path")});if(i.length>0)t.push({category:o,lessons:i})}return{...j(e,Gc),body:{categories:t}}}var Yc=new Set(["schema","schema_version","artifact_type","schema_file","sop","category","status","created_at","updated_at","purpose","scope","trigger","roles","prerequisites","steps","exceptions","success_criteria"]);function ri(e){let[t]=e,n=Fe(t,"order");if(n===void 0)return Number.POSITIVE_INFINITY;let o=Number(n);return Number.isNaN(o)?Number.POSITIVE_INFINITY:o}function ui(e){let t=[],n=g(e,"roles");if(Array.isArray(n))for(let p of n){let f=m(p,"id");if(f===void 0)continue;t.push({id:f,name:m(p,"name"),responsibility:m(p,"responsibility")})}let o=[],r=g(e,"steps");if(Array.isArray(r))for(let p of r){let f=m(p,"id");if(f===void 0)continue;let h=[],v=g(p,"branches");if(Array.isArray(v))for(let y of v)h.push({condition:m(y,"condition"),gotoStep:m(y,"goto_step")});o.push([p,{id:f,order:Fe(p,"order"),actor:m(p,"actor"),action:m(p,"action"),expectedResult:m(p,"expected_result"),branches:h}])}let i=o.map((p,f)=>({entry:p,index:f})).sort((p,f)=>ri(p.entry)-ri(f.entry)||p.index-f.index).map((p)=>p.entry[1]),s=[],a=g(e,"exceptions");if(Array.isArray(a))for(let p of a)s.push({condition:m(p,"condition"),handling:m(p,"handling")});let l=g(e,"scope"),d={identity:Ze(g(e,"sop")),category:m(e,"category"),status:m(e,"status"),purpose:m(e,"purpose"),scopeIn:l===void 0?[]:V(g(l,"in")),scopeOut:l===void 0?[]:V(g(l,"out")),trigger:m(e,"trigger"),roles:t,prerequisites:V(g(e,"prerequisites")),steps:i,exceptions:s,successCriteria:V(g(e,"success_criteria"))};return{...j(e,Yc),body:d}}var $c=new Set(["schema","schema_version","artifact_type","schema_file","category","questions","constraints"]);function pi(e){let t=[],n=g(e,"questions");if(Array.isArray(n))for(let i of n){let s=m(i,"id");if(s===void 0)continue;let a=g(i,"required");t.push({id:s,prompt:m(i,"prompt"),mapsTo:m(i,"maps_to"),required:typeof a==="boolean"?a:void 0})}let o=g(e,"constraints"),r={identity:Ze(g(e,"category")),questions:t,constraints:o===void 0?void 0:{requiredSections:V(g(o,"required_sections")),minSteps:Fe(o,"min_steps")}};return{...j(e,$c),body:r}}var Uc=new Set(["schema","schema_version","artifact_type","schema_file","sops"]);function fi(e){let t=[],n=g(e,"sops");if(typeof n==="object"&&n!==null)for(let[o,r]of Object.entries(n))t.push({id:o,title:m(r,"title"),category:m(r,"category"),status:m(r,"status"),path:m(r,"path")});return{...j(e,Uc),body:{sops:t}}}var Qc=new Set(["schema","schema_version","artifact_type","schema_file","design_system","tokens","components","guidance"]);function mi(e){if(typeof e!=="object"||e===null)return[];let t=[];for(let[n,o]of Object.entries(e)){let r=qe(o);if(r!==void 0){t.push({name:n,value:r,children:[]});continue}let i=mi(o);if(i.length>0)t.push({name:n,children:i})}return t}function hi(e){let t=[],n=g(e,"tokens");if(typeof n==="object"&&n!==null)for(let[l,d]of Object.entries(n)){let p=mi(d);if(p.length>0)t.push({family:l,nodes:p})}let o=[],r=g(e,"components");if(typeof r==="object"&&r!==null)for(let[l,d]of Object.entries(r)){let p=g(d,"tokens"),f=[];if(typeof p==="object"&&p!==null)for(let[v,y]of Object.entries(p)){let x=qe(y);if(x!==void 0)f.push({key:v,value:x})}let h=g(d,"mapping");o.push({id:l,title:m(d,"title"),description:m(d,"description"),tokenRefs:f,implementation:h===void 0?[]:V(g(h,"implementation")),snapshots:h===void 0?[]:V(g(h,"snapshots"))})}let i=g(e,"guidance"),s=i===void 0?void 0:{overview:m(i,"overview"),do:V(g(i,"do")),dont:V(g(i,"dont"))},a={identity:Ze(g(e,"design_system")),tokenFamilies:t,components:o,guidance:s};return{...j(e,Qc),body:a}}var u=require("react/jsx-runtime"),Xc={active:"success",promoted:"info",obsolete:"neutral",draft:"warning"};function xe(e){let{header:t}=e;if(t.length===0)return null;return u.jsx("header",{className:c.facts,children:t.map((n)=>u.jsxs("span",{className:c.fact,children:[u.jsx("span",{className:c.factKey,children:n.key}),u.jsx("span",{className:c.factText,children:n.text})]},n.key))})}function G(e){let{title:t,children:n}=e;return u.jsxs("section",{className:c.section,children:[u.jsx("h3",{className:c.sectionTitle,children:t}),n]})}function Me(e){let{label:t,value:n}=e;return u.jsxs("div",{className:c.metaRow,children:[u.jsx("span",{className:c.metaKey,children:t}),u.jsx("span",{className:c.metaText,children:n})]})}function H(e){let{rows:t}=e,n=t.filter((o)=>o.value!==void 0&&o.value!=="");if(n.length===0)return null;return u.jsx("div",{className:c.meta,children:n.map((o)=>u.jsx(Me,{label:o.label,value:o.value},o.label))})}function gt(e){let{entries:t}=e;if(t.length===0)return null;return u.jsx("ul",{className:c.entries,children:t.map((n,o)=>u.jsx("li",{className:c.entry,children:n},o))})}function ye(e){let{title:t,entries:n}=e;if(n.length===0)return null;return u.jsx(G,{title:t,children:u.jsx(gt,{entries:n})})}function Ae(e){let{title:t,text:n}=e;if(n===void 0)return null;return u.jsx(G,{title:t,children:u.jsx("p",{className:c.statement,children:n})})}function yt(e){let{status:t}=e;if(t===void 0)return null;return u.jsx(On.Tag,{tone:Xc[t]??"outline",children:t})}function gi(e){let{nodes:t}=e;if(t.length===0)return null;return u.jsx("div",{className:c.meta,children:t.map((n)=>n.value===void 0?u.jsxs("div",{className:c.scenario,children:[u.jsx("span",{className:c.cardId,children:n.name}),u.jsx(gi,{nodes:n.children})]},n.name):u.jsx(Me,{label:n.name,value:n.value},n.name))})}function yi(e){let{data:t,t:n}=e,o=ii(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx(Ae,{title:n("config.context"),text:r.context}),r.ruleGroups.length===0?null:u.jsx(G,{title:n("config.rules"),children:r.ruleGroups.map((i)=>u.jsxs("div",{className:c.meta,children:[u.jsx("span",{className:c.cardId,children:i.category}),u.jsx(gt,{entries:i.entries})]},i.category))}),r.evidence.map((i)=>u.jsxs(G,{title:i.name,children:[u.jsx(H,{rows:[{label:n("config.method"),value:i.method??""},{label:n("config.command"),value:i.command??""},{label:n("config.meaning"),value:i.meaning??""},{label:n("config.unavailable"),value:i.unavailableBehavior??""}]}),i.coverage===void 0?null:u.jsxs("div",{className:c.meta,children:[u.jsx("span",{className:c.cardId,children:n("config.coverage")}),u.jsx(H,{rows:[{label:n("config.threshold"),value:i.coverage.threshold??""},{label:n("config.metric"),value:i.coverage.metric??""}]}),u.jsx(ye,{title:n("config.include"),entries:i.coverage.include}),u.jsx(ye,{title:n("config.exclude"),entries:i.coverage.exclude})]})]},i.name)),r.maintenanceChecks.length===0?null:u.jsx(G,{title:n("config.maintenance"),children:r.maintenanceChecks.map((i,s)=>u.jsxs("div",{className:c.meta,children:[i.text===void 0?null:u.jsx("span",{className:c.entry,children:i.text}),i.fields.map((a)=>u.jsx(Me,{label:a.key,value:a.text},a.key))]},s))}),u.jsx(q,{blocks:o.additional,t:n})]})}function vi(e){let{data:t,t:n}=e,o=si(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),r.identity===void 0?null:u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity.id??""},{label:n("ctx.title"),value:r.identity.title??""}]})}),r.components.length===0?null:u.jsx(G,{title:n("architecture.components"),children:r.components.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.id})}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("architecture.responsibility"),value:i.responsibility??""}]}),u.jsx(gt,{entries:i.boundaries}),u.jsxs("div",{className:c.meta,children:[i.dependsOn.length===0?null:u.jsx(Me,{label:n("architecture.depends-on"),value:i.dependsOn.join(", ")}),i.implementation.length===0?null:u.jsx(Me,{label:n("architecture.implementation"),value:i.implementation.join(", ")})]})]},i.id))}),r.dataFlows.length===0?null:u.jsx(G,{title:n("architecture.data-flows"),children:r.dataFlows.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.id})}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("ctx.trigger"),value:i.trigger??""},{label:n("architecture.flow-components"),value:i.components.join(", ")}]}),u.jsx(gt,{entries:i.steps})]},i.id))}),r.decisions.length===0?null:u.jsx(G,{title:n("architecture.decisions"),children:r.decisions.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsxs("div",{className:c.cardHeader,children:[u.jsx("span",{className:c.cardId,children:i.id}),u.jsx(yt,{status:i.status})]}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("architecture.statement"),value:i.statement??""},{label:n("architecture.rationale"),value:i.rationale??""}]}),u.jsx(ye,{title:n("architecture.alternatives"),entries:i.alternatives})]},i.id))}),u.jsx(q,{blocks:o.additional,t:n})]})}function wi(e){let{data:t,t:n}=e,o=ai(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity?.id??""},{label:n("ctx.title"),value:r.identity?.title??""},{label:n("ctx.category"),value:r.category??""}]})}),u.jsx(G,{title:n("tech.rules"),children:r.rules.map((i)=>u.jsx(un,{rule:i,t:n},i.id))}),u.jsx(q,{blocks:o.additional,t:n})]})}function xi(e){let{data:t,t:n}=e,o=li(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),r.standards.length===0?null:u.jsx(G,{title:n("tech-index.standards"),children:r.standards.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.id})}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("ctx.category"),value:i.category??""},{label:n("ctx.path"),value:i.path??""}]})]},i.id))}),u.jsx(q,{blocks:o.additional,t:n})]})}function Si(e){let{data:t,t:n}=e,o=ci(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity?.id??""},{label:n("ctx.title"),value:r.identity?.title??""},{label:n("ctx.category"),value:r.category??""}]})}),u.jsx(yt,{status:r.status}),u.jsx(Ae,{title:n("lesson.context"),text:r.context}),u.jsx(Ae,{title:n("lesson.observation"),text:r.observation}),u.jsx(Ae,{title:n("lesson.takeaway"),text:r.takeaway}),u.jsx(Ae,{title:n("lesson.applies-when"),text:r.appliesWhen}),r.occurrences.length===0?null:u.jsx(G,{title:n("lesson.occurrences"),children:r.occurrences.map((i,s)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.origin})}),u.jsx(H,{rows:[{label:n("lesson.occurrence-date"),value:i.date??""},{label:n("lesson.occurrence-evidence"),value:i.evidence??""}]})]},s))}),r.promotedTo===void 0?null:u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("lesson.promoted-to"),value:r.promotedTo.standard??""},{label:n("lesson.promoted-rule"),value:r.promotedTo.rule??""}]})}),r.obsoletedReason===void 0&&r.obsoletedAt===void 0?null:u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("lesson.obsoleted-reason"),value:r.obsoletedReason??""},{label:n("lesson.obsoleted-at"),value:r.obsoletedAt??""}]})}),u.jsx(q,{blocks:o.additional,t:n})]})}function bi(e){let{data:t,t:n}=e,o=di(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),r.categories.map((i)=>u.jsx(G,{title:i.category,children:i.lessons.map((s)=>u.jsxs("div",{className:c.card,children:[u.jsxs("div",{className:c.cardHeader,children:[u.jsx("span",{className:c.cardId,children:s.id}),u.jsx(yt,{status:s.status})]}),u.jsx(H,{rows:[{label:n("ctx.title"),value:s.title??""},{label:n("lessons-index.occurrences"),value:s.occurrences??""},{label:n("ctx.path"),value:s.path??""}]})]},s.id))},i.category)),u.jsx(q,{blocks:o.additional,t:n})]})}function ki(e){let{data:t,t:n}=e,o=ui(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity?.id??""},{label:n("ctx.title"),value:r.identity?.title??""},{label:n("ctx.category"),value:r.category??""}]})}),u.jsx(yt,{status:r.status}),u.jsx(Ae,{title:n("sop.purpose"),text:r.purpose}),u.jsx(Ae,{title:n("ctx.trigger"),text:r.trigger}),r.scopeIn.length===0&&r.scopeOut.length===0?null:u.jsx(G,{title:n("sop.scope"),children:u.jsxs("div",{className:c.meta,children:[u.jsx(ye,{title:n("sop.scope-in"),entries:r.scopeIn}),u.jsx(ye,{title:n("sop.scope-out"),entries:r.scopeOut})]})}),r.roles.length===0?null:u.jsx(G,{title:n("sop.roles"),children:r.roles.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.id})}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.name??""},{label:n("sop.role-responsibility"),value:i.responsibility??""}]})]},i.id))}),u.jsx(ye,{title:n("sop.prerequisites"),entries:r.prerequisites}),u.jsx(G,{title:n("sop.steps"),children:u.jsx("ol",{className:c.flowSteps,children:r.steps.map((i)=>u.jsxs("li",{className:c.flowStep,children:[u.jsxs("div",{className:c.cardHeader,children:[u.jsx("span",{className:c.cardId,children:i.id}),i.order===void 0?null:u.jsx("span",{className:c.completion,children:i.order})]}),u.jsx(H,{rows:[{label:n("sop.actor"),value:i.actor??""},{label:n("sop.expected-result"),value:i.expectedResult??""}]}),i.action===void 0?null:u.jsx("p",{className:c.statement,children:i.action}),i.branches.length===0?null:u.jsx("div",{className:c.meta,children:i.branches.map((s,a)=>u.jsx(Me,{label:n("sop.branches"),value:`${s.condition??""}${s.gotoStep===void 0?"":` → ${s.gotoStep}`}`},a))})]},i.id))})}),r.exceptions.length===0?null:u.jsx(G,{title:n("sop.exceptions"),children:r.exceptions.map((i,s)=>u.jsxs("div",{className:c.card,children:[u.jsx("p",{className:c.statement,children:i.condition??""}),u.jsx(H,{rows:[{label:n("sop.exception-handling"),value:i.handling??""}]})]},s))}),u.jsx(ye,{title:n("sop.success-criteria"),entries:r.successCriteria}),u.jsx(q,{blocks:o.additional,t:n})]})}function Ni(e){let{data:t,t:n}=e,o=pi(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity?.id??""},{label:n("ctx.title"),value:r.identity?.title??""},{label:n("ctx.description"),value:r.identity?.description??""}]})}),r.questions.length===0?null:u.jsx(G,{title:n("sop-category.questions"),children:r.questions.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsxs("div",{className:c.cardHeader,children:[u.jsx("span",{className:c.cardId,children:i.id}),i.required===!0?u.jsx(On.Tag,{tone:"info",children:n("sop-category.required")}):null]}),u.jsx("p",{className:c.statement,children:i.prompt??""}),u.jsx(H,{rows:[{label:n("sop-category.maps-to"),value:i.mapsTo??""}]})]},i.id))}),r.constraints===void 0?null:u.jsx(G,{title:n("sop-category.constraints"),children:u.jsxs("div",{className:c.meta,children:[u.jsx(H,{rows:[{label:n("sop-category.min-steps"),value:r.constraints.minSteps??""}]}),u.jsx(gt,{entries:r.constraints.requiredSections})]})}),u.jsx(q,{blocks:o.additional,t:n})]})}function _i(e){let{data:t,t:n}=e,o=fi(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),r.sops.length===0?null:u.jsx(G,{title:n("sops-index.sops"),children:r.sops.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsxs("div",{className:c.cardHeader,children:[u.jsx("span",{className:c.cardId,children:i.id}),u.jsx(yt,{status:i.status})]}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("ctx.category"),value:i.category??""},{label:n("ctx.path"),value:i.path??""}]})]},i.id))}),u.jsx(q,{blocks:o.additional,t:n})]})}function Ti(e){let{data:t,t:n}=e,o=hi(t),{body:r}=o;return u.jsxs("div",{className:c.view,children:[u.jsx(xe,{header:o.header}),u.jsx("div",{className:c.meta,children:u.jsx(H,{rows:[{label:n("ctx.id"),value:r.identity?.id??""},{label:n("ctx.title"),value:r.identity?.title??""}]})}),r.tokenFamilies.length===0?null:u.jsx(G,{title:n("design-system.tokens"),children:r.tokenFamilies.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.family})}),u.jsx(gi,{nodes:i.nodes})]},i.family))}),r.components.length===0?null:u.jsx(G,{title:n("design-system.components"),children:r.components.map((i)=>u.jsxs("div",{className:c.card,children:[u.jsx("div",{className:c.cardHeader,children:u.jsx("span",{className:c.cardId,children:i.id})}),u.jsx(H,{rows:[{label:n("ctx.title"),value:i.title??""},{label:n("ctx.description"),value:i.description??""}]}),i.tokenRefs.length===0?null:u.jsx("div",{className:c.meta,children:i.tokenRefs.map((s)=>u.jsx(Me,{label:`${n("design-system.token-references")}: ${s.key}`,value:s.value},s.key))}),u.jsx(ye,{title:n("design-system.implementation"),entries:i.implementation}),u.jsx(ye,{title:n("design-system.snapshots"),entries:i.snapshots})]},i.id))}),r.guidance===void 0?null:u.jsxs(G,{title:n("design-system.guidance"),children:[u.jsx(Ae,{title:n("design-system.overview"),text:r.guidance.overview}),u.jsx(ye,{title:n("design-system.do"),entries:r.guidance.do}),u.jsx(ye,{title:n("design-system.dont"),entries:r.guidance.dont})]}),u.jsx(q,{blocks:o.additional,t:n})]})}var Z=require("react/jsx-runtime"),Zc={change_proposal:_o,change_design:To,task_list:Ro,question_list:Co,delta_spec:Po,delta_scene:Vo,delta_tech:Lo,roadmap_index:Kr,roadmap_milestone:Hr,planned_change:Gr,main_spec:ei,spec_index:ti,scene:ni,scenes_index:oi,workflow_config:yi,architecture:vi,main_tech:wi,tech_index:xi,lesson:Si,lessons_index:bi,sop:ki,sop_category:Ni,sops_index:_i,design_system:Ti};function qt(e){let{state:t,t:n}=e;if(t.status==="idle")return Z.jsx("div",{className:M.state,role:"status",children:n("view.idle")});if(t.status==="loading")return Z.jsx("div",{className:M.state,role:"status",children:n("view.loading")});if(t.status==="absent")return Z.jsx("div",{className:M.state,role:"status",children:n("view.absent")});if(t.status==="error"){if(t.error?.kind==="parse")return Z.jsxs("div",{className:M.parseError,role:"alert",children:[Z.jsx("div",{className:M.parseMessage,children:n("view.parse-error",{line:t.error.line,column:t.error.column,message:t.error.message})}),Z.jsx("div",{className:M.rawHeading,children:n("view.raw-text")}),Z.jsx("pre",{className:M.raw,children:t.error.raw})]});return Z.jsx("div",{className:M.state,role:"alert",children:n("view.error",{code:t.error?.code??"unknown"})})}let o=_t(t.data),r=o===void 0?void 0:Zc[o];if(r!==void 0)return Z.jsx(r,{data:t.data,t:n,path:t.path,context:e.context});let i=Rt(t.data);if(i.header.length===0&&i.blocks.length===0)return Z.jsx("div",{className:M.state,role:"status",children:n("view.empty-document")});return Z.jsxs("div",{className:M.document,children:[i.header.length===0?null:Z.jsx("header",{className:M.header,children:i.header.map((s)=>Z.jsxs("div",{className:M.headerField,children:[Z.jsx("span",{className:M.fieldKey,children:s.key}),Z.jsx("span",{className:M.scalar,children:s.text})]},s.key))}),Z.jsx(sn,{blocks:i.blocks})]})}function Jc(e){if(typeof document>"u")return null;let t=document.getElementById(e);return t===null?null:{scrollIntoView:(n)=>t.scrollIntoView(n)}}function Kt(e,t=Jc){if(e===void 0||e.length===0)return!1;let n=t(e);if(n===null)return!1;return n.scrollIntoView({block:"start"}),!0}var Ii=require("@deepseek-ai/dsh-client-store");function Ai(e,t){let n;return{getCatalog:()=>{let r=t.list.getSnapshot(),i=e.list.getSnapshot();if(n!==void 0&&n.workspaces===r&&n.sessions===i)return n.catalog;let s=ed(r,i);return n={workspaces:r,sessions:i,catalog:s},s},subscribe:(r)=>{let i=t.list.subscribe(r),s=e.list.subscribe(r);return()=>{i(),s()}}}}function Ri(e,t){let n=t[e];if(n===void 0)return;return{sessionId:e,displayTitle:n.displayTitle,updatedAt:n.updatedAt}}function Ci(e,t){return t.updatedAt-e.updatedAt}function ed(e,t){let n=e.state==="error"?"error":e.phase==="pending"||t.phase==="pending"?"loading":"ready",o=new Set,r=[];for(let s of e.items){let a=[];for(let l of s.sessionIds){let d=Ri(l,t.byId);if(d!==void 0)o.add(l),a.push(d)}a.sort(Ci),r.push({workspaceId:s.workspaceId,title:s.title,path:s.path,sessions:a})}let i=[];for(let s of t.ids){if(o.has(s))continue;let a=Ri(s,t.byId);if(a!==void 0)i.push(a)}return i.sort(Ci),{workspaces:r,ungrouped:i,status:n}}function Ei(e,t){if(t.sessionId!==void 0){for(let r of e.workspaces)if(r.sessions.some((s)=>s.sessionId===t.sessionId))return{workspaceId:r.workspaceId,sessionId:t.sessionId};if(e.ungrouped.some((r)=>r.sessionId===t.sessionId))return{sessionId:t.sessionId}}if(t.workspaceId!==void 0){let o=e.workspaces.find((r)=>r.workspaceId===t.workspaceId);if(o!==void 0)return o.sessions.length>0?{workspaceId:o.workspaceId,sessionId:o.sessions[0]?.sessionId}:{workspaceId:o.workspaceId}}let n=e.workspaces.find((o)=>o.sessions.length>0);if(n!==void 0&&n.sessions[0]!==void 0)return{workspaceId:n.workspaceId,sessionId:n.sessions[0].sessionId};return{}}function Oi(){let e=Ii.createSnapshotStore({});return{store:e,actions:{chooseSession(t,n){e.set({...e.getSnapshot(),workspaceId:t,sessionId:n})},chooseWorkspace(t,n){let o=e.getSnapshot();e.set(n?{...o,workspaceId:t}:{workspaceId:t})},recordDocument(t){e.set({...e.getSnapshot(),documentPath:t})}}}}function Di(e,t){let n,o=0;return{showSession(r){if(r===void 0){if(n===void 0)return;n=void 0,o+=1,e.actions.dispose();return}if(n===r)return;n=r,o+=1;let i=o,s=t.getSnapshot().documentPath;(async()=>{if(await e.actions.loadWorkspace(r),i!==o)return;if(s!==void 0)await e.actions.openDocument(r,s)})()},dispose(){n=void 0,o+=1,e.actions.dispose()}}}var ce={page:"page_gBEKqQ",header:"header_gBEKqQ",pickerLabel:"pickerLabel_gBEKqQ",picker:"picker_gBEKqQ",pickerEmpty:"pickerEmpty_gBEKqQ",panes:"panes_gBEKqQ",treePane:"treePane_gBEKqQ",documentPane:"documentPane_gBEKqQ",state:"state_gBEKqQ"};var K=require("react/jsx-runtime"),vt="session:",Ht="workspace:";function Fi(e){return Ee.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function nd(e){let{catalog:t,t:n}=e;return K.jsxs(K.Fragment,{children:[t.workspaces.map((o)=>K.jsx("optgroup",{label:o.title,children:o.sessions.length>0?o.sessions.map((r)=>K.jsx("option",{value:`${vt}${r.sessionId}`,children:r.displayTitle},r.sessionId)):K.jsx("option",{value:`${Ht}${o.workspaceId}`,children:n("page.workspace-empty")})},o.workspaceId)),t.ungrouped.length>0?K.jsx("optgroup",{label:n("page.workspace-other"),children:t.ungrouped.map((o)=>K.jsx("option",{value:`${vt}${o.sessionId}`,children:o.displayTitle},o.sessionId))}):null]})}function Pi(e){let{picker:t,pageSelection:n,pageActions:o,viewer:r,t:i}=e,s=Ee.useSyncExternalStore(t.subscribe,t.getCatalog,t.getCatalog),a=Fi(n),l=Fi(r.open),d=Ei(s,a),p=d.sessionId!==void 0?`${vt}${d.sessionId}`:d.workspaceId!==void 0?`${Ht}${d.workspaceId}`:"",f=e.controller;Ee.useEffect(()=>{f.showSession(d.sessionId)},[d.sessionId,f]),Ee.useEffect(()=>()=>f.dispose(),[f]),Ee.useEffect(()=>{if(d.sessionId===void 0)return;o.recordDocument(l.status==="ready"||l.status==="error"||l.status==="absent"?l.path:void 0)},[l,o,d.sessionId]),Ee.useEffect(()=>{Kt(l.anchor)},[l]);function h(y){if(y.startsWith(vt)){let x=y.slice(vt.length),A=s.workspaces.find((C)=>C.sessions.some((S)=>S.sessionId===x));if(x!==d.sessionId)o.recordDocument(void 0);o.chooseSession(A?.workspaceId,x);return}if(y.startsWith(Ht)){let x=y.slice(Ht.length),A=s.workspaces.find((S)=>S.workspaceId===x),C=A!==void 0&&a.sessionId!==void 0&&A.sessions.some((S)=>S.sessionId===a.sessionId);o.chooseWorkspace(x,C)}}if(s.status==="loading")return K.jsx("div",{className:ce.state,role:"status",children:i("page.loading")});if(s.status==="error")return K.jsx("div",{className:ce.state,role:"alert",children:i("page.error")});let v=s.workspaces.length===0&&s.ungrouped.length===0;return K.jsxs("div",{className:ce.page,children:[K.jsxs("header",{className:ce.header,children:[K.jsx("label",{className:ce.pickerLabel,htmlFor:"strict-spec-session-picker",children:i("page.picker-label")}),v?K.jsx("span",{className:ce.pickerEmpty,children:i("page.no-sessions")}):K.jsxs("select",{id:"strict-spec-session-picker",className:ce.picker,value:p,onChange:(y)=>h(y.target.value),children:[p===""?K.jsx("option",{value:"",children:i("page.picker-placeholder")}):null,K.jsx(nd,{catalog:s,t:i})]})]}),v?K.jsx("div",{className:ce.state,role:"status",children:i("page.no-sessions")}):d.sessionId!==void 0?K.jsxs("div",{className:ce.panes,children:[K.jsx("div",{className:ce.treePane,role:"region","aria-label":i("page.tree-pane"),children:K.jsx(kt,{sessionId:d.sessionId,tree:r.tree,actions:r.actions,open:r.open,t:i})}),K.jsx("div",{className:ce.documentPane,role:"region","aria-label":i("page.document-pane"),children:K.jsx(qt,{state:l,t:i,context:{sessionId:d.sessionId,viewer:r,goal:e.goalLaunchers?.get(d.sessionId)}})})]}):d.workspaceId!==void 0?K.jsx("div",{className:ce.state,role:"status",children:i("page.no-session-prompt")}):K.jsx("div",{className:ce.state,role:"status",children:i("page.picker-placeholder")})]})}var Je=require("react");var Gt={tab:"tab_TzlCdw",treeRegion:"treeRegion_TzlCdw",documentRegion:"documentRegion_TzlCdw"};var Be=require("react/jsx-runtime");function rd(e){return Je.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Vi(e){let{surface:t,t:n}=e,o=rd(t.viewer.open);return Je.useEffect(()=>{t.controller.show()},[t]),Je.useEffect(()=>()=>t.controller.dispose(),[t]),Je.useEffect(()=>{Kt(o.anchor)},[o]),Be.jsxs("div",{className:Gt.tab,children:[Be.jsx("div",{className:Gt.treeRegion,role:"region","aria-label":n("tab.tree-region"),children:Be.jsx(kt,{sessionId:t.sessionId,tree:t.viewer.tree,actions:t.viewer.actions,open:t.viewer.open,t:n})}),Be.jsx("div",{className:Gt.documentRegion,role:"region","aria-label":n("tab.document-region"),children:Be.jsx(qt,{state:o,t:n,context:{sessionId:t.sessionId,viewer:t.viewer,goal:t.goal}})})]})}var Li={"panel.title":"Strict 文档","tree.label":"Strict 文档树","tree.family.config":"配置","tree.family.architecture":"架构","tree.family.roadmap":"路线图","tree.family.changes":"变更","tree.family.scenes":"场景","tree.family.specs":"规格","tree.family.tech":"技术标准","tree.family.lessons":"经验","tree.family.sops":"SOP","tree.family.design-system":"设计系统","tree.loading":"正在加载文档树…","tree.empty":"此工作区没有 .strict-spec-driven/ 目录。","tree.error":"工作区列表读取失败({code})。","tree.root-truncated":"根目录列表被截断,部分文档族可能缺失。","tree.truncated":"此目录的列表被截断,条目不完整。","tree.group-count":"{count} 项","tree.task-completion":"{done}/{total} 项任务完成","view.idle":"从树中选择一个文档。","view.loading":"正在加载文档…","view.absent":"此文件已从磁盘移除。","view.error":"读取失败({code})。","view.parse-error":"解析失败:第 {line} 行第 {column} 列 — {message}","view.raw-text":"原始文本","view.empty-document":"此文档未声明任何字段。","page.picker-label":"会话","page.picker-placeholder":"选择一个会话","page.workspace-empty":"暂无会话 — 请先打开一个","page.workspace-other":"其他会话","page.loading":"正在加载会话…","page.error":"会话列表加载失败。","page.no-sessions":"尚不存在会话——请先打开一个会话再阅读其 Strict 文档。","page.no-session-prompt":"此工作区没有会话。请为它打开一个会话后再阅读其 Strict 文档。","page.tree-pane":"文档树窗格","page.document-pane":"文档窗格","tab.title":"Strict 文档","tab.guide-title":"Strict 文档","tab.guide-description":"在右侧栏中浏览当前会话工作区的 Strict 工作流文档。","tab.tree-region":"文档树区域","tab.document-region":"文档区域","view.additional-fields":"附加字段","proposal.what":"做什么","proposal.why":"为什么","proposal.in":"范围内","proposal.out":"范围外","proposal.unchanged":"保持不变的行为","proposal.roadmap":"路线图","proposal.roadmap-milestone":"里程碑","proposal.roadmap-planned-change":"计划变更","proposal.change-id":"变更","proposal.change-status":"状态","design.approach":"实施方式","design.decisions":"设计决策","design.rationale":"依据","design.alternatives":"备选方案","design.reason":"否决原因","design.risks":"风险","tasks.overall":"总进度:{done}/{total} 完成","tasks.completion":"{done}/{total} 完成","tasks.done":"已完成","tasks.pending":"待办","tasks.command":"命令:{command}","tasks.gates":"测试门禁","tasks.gate-validation":"验证任务","tasks.gate-unit-test":"单元测试任务","questions.open":"开放问题","questions.resolved":"已解决问题","questions.context":"背景","questions.answer":"答案","delta.target-spec":"目标规格","delta.new-spec":"新规格","delta.target-scene":"目标场景","delta.target-standard":"目标标准","delta.new-standard":"新标准","delta.main-flow":"主流程","delta.exception-flow":"异常流程","delta.trigger":"触发条件","delta.reason":"原因","delta.rationale":"依据","delta.enforcement":"执行方式","delta.example-good":"正例","delta.example-bad":"反例","delta.exceptions":"例外","delta.no-coverage":"无覆盖原因","ctx.id":"标识","ctx.title":"标题","ctx.category":"类别","ctx.status":"状态","ctx.path":"路径","ctx.description":"描述","ctx.trigger":"触发条件","config.context":"项目背景","config.rules":"规则","config.maintenance":"维护检查","config.method":"方法","config.command":"命令","config.meaning":"含义","config.unavailable":"不可运行时","config.coverage":"覆盖率","config.threshold":"阈值","config.metric":"指标","config.include":"统计范围","config.exclude":"排除","architecture.components":"组件","architecture.responsibility":"职责","architecture.depends-on":"依赖于","architecture.implementation":"实现文件","architecture.data-flows":"数据流","architecture.flow-components":"涉及组件","architecture.decisions":"决策","architecture.statement":"决策内容","architecture.rationale":"依据","architecture.alternatives":"备选方案","tech.rules":"规则","tech-index.standards":"技术标准","lesson.context":"背景","lesson.observation":"观察","lesson.takeaway":"结论","lesson.applies-when":"适用时机","lesson.occurrences":"发生记录","lesson.occurrence-date":"日期","lesson.occurrence-evidence":"证据","lesson.promoted-to":"已提升为标准","lesson.promoted-rule":"规则","lesson.obsoleted-reason":"失效原因","lesson.obsoleted-at":"失效时间","lessons-index.occurrences":"发生次数","sop.purpose":"目的","sop.scope":"范围","sop.scope-in":"范围内","sop.scope-out":"范围外","sop.roles":"角色","sop.role-responsibility":"职责","sop.prerequisites":"前置条件","sop.steps":"步骤","sop.actor":"执行者","sop.expected-result":"预期结果","sop.branches":"分支","sop.exceptions":"例外情况","sop.exception-handling":"处理","sop.success-criteria":"成功标准","sop-category.questions":"准入问题","sop-category.maps-to":"对应字段","sop-category.required":"必填","sop-category.constraints":"约束","sop-category.min-steps":"最少步骤数","sops-index.sops":"SOP","design-system.tokens":"设计令牌","design-system.components":"组件","design-system.guidance":"使用指引","design-system.overview":"概述","design-system.do":"推荐","design-system.dont":"避免","design-system.token-references":"引用令牌","design-system.implementation":"实现文件","design-system.snapshots":"快照","roadmap.milestones":"里程碑","roadmap.intake-questions":"准入问题","roadmap.owned-planned-changes":"所属计划变更","roadmap.goal":"目标","roadmap.done-criteria":"完成标准","roadmap.dependencies":"依赖","roadmap.notes":"备注","roadmap.details":"详情","roadmap.summary":"摘要","roadmap.depends-on":"依赖项","roadmap.unresolved":"未找到目标","roadmap.impact":"影响","roadmap.recommendation":"建议","roadmap.ownership-error":"归档计划变更列表读取失败。","roadmap.goal-launch":"一键完成下一个里程碑","roadmap.goal-launch-hint":"向当前 Session 提交一个目标,反复运行 strict-roadmap-recommend,直到一个里程碑完成。","roadmap.goal-confirm-title":"确认向 Session 提交以下目标?","roadmap.goal-confirm-session":"目标 Session:{sessionId}","roadmap.goal-confirm":"确认提交","roadmap.goal-cancel":"取消","roadmap.goal-pending":"正在提交…","roadmap.goal-launched":"目标已提交到当前 Session。","roadmap.goal-refused":"Session 拒绝了该目标:{reason}","roadmap.goal-unavailable":"当前 Session 不提供 /goal 命令。","roadmap.goal-failed":"目标提交失败:{reason}","spec.requirements":"需求","spec-index.other-area":"其他","scene.actors":"参与者","scene.actor-role":"职责","scene.preconditions":"前置条件","scene.uncovered-step":"此步骤未声明覆盖需求,也未声明无覆盖原因。"},Mi={"panel.title":"Strict documents","tree.label":"Strict document tree","tree.family.config":"Config","tree.family.architecture":"Architecture","tree.family.roadmap":"Roadmap","tree.family.changes":"Changes","tree.family.scenes":"Scenes","tree.family.specs":"Specs","tree.family.tech":"Tech standards","tree.family.lessons":"Lessons","tree.family.sops":"SOPs","tree.family.design-system":"Design system","tree.loading":"Loading the document tree…","tree.empty":"This workspace has no .strict-spec-driven/ directory.","tree.error":"The workspace listing failed ({code}).","tree.root-truncated":"The root listing was truncated; some document families may be missing.","tree.truncated":"This directory's listing was truncated; its entries are incomplete.","tree.group-count":"{count} entries","tree.task-completion":"{done}/{total} tasks complete","view.idle":"Select a document from the tree.","view.loading":"Loading the document…","view.absent":"This file is no longer on disk.","view.error":"The read failed ({code}).","view.parse-error":"Parse error: line {line}, column {column} — {message}","view.raw-text":"Raw text","view.empty-document":"This document declares no fields.","page.picker-label":"Session","page.picker-placeholder":"Select a Session","page.workspace-empty":"No Session yet — open one","page.workspace-other":"Other Sessions","page.loading":"Loading sessions…","page.error":"The session list failed to load.","page.no-sessions":"No Session exists yet — open one to read its strict documents.","page.no-session-prompt":"This workspace has no Session. Open a Session for it to read its strict documents.","page.tree-pane":"Document tree pane","page.document-pane":"Document pane","tab.title":"Strict documents","tab.guide-title":"Strict documents","tab.guide-description":"Browse the active Session workspace's strict workflow documents in the right sidebar.","tab.tree-region":"Document tree region","tab.document-region":"Document region","view.additional-fields":"Additional fields","proposal.what":"What","proposal.why":"Why","proposal.in":"In scope","proposal.out":"Out of scope","proposal.unchanged":"Unchanged behavior","proposal.roadmap":"Roadmap","proposal.roadmap-milestone":"Milestone","proposal.roadmap-planned-change":"Planned change","proposal.change-id":"Change","proposal.change-status":"Status","design.approach":"Approach","design.decisions":"Decisions","design.rationale":"Rationale","design.alternatives":"Alternatives","design.reason":"Rejected because","design.risks":"Risks","tasks.overall":"Overall: {done}/{total} complete","tasks.completion":"{done}/{total} complete","tasks.done":"Done","tasks.pending":"Pending","tasks.command":"Command: {command}","tasks.gates":"Testing gates","tasks.gate-validation":"Validation task","tasks.gate-unit-test":"Unit test task","questions.open":"Open questions","questions.resolved":"Resolved questions","questions.context":"Context","questions.answer":"Answer","delta.target-spec":"Target spec","delta.new-spec":"New spec","delta.target-scene":"Target scene","delta.target-standard":"Target standard","delta.new-standard":"New standard","delta.main-flow":"Main flow","delta.exception-flow":"Exception flow","delta.trigger":"Trigger","delta.reason":"Reason","delta.rationale":"Rationale","delta.enforcement":"Enforcement","delta.example-good":"Good example","delta.example-bad":"Bad example","delta.exceptions":"Exceptions","delta.no-coverage":"No coverage reason","ctx.id":"Id","ctx.title":"Title","ctx.category":"Category","ctx.status":"Status","ctx.path":"Path","ctx.description":"Description","ctx.trigger":"Trigger","config.context":"Project context","config.rules":"Rules","config.maintenance":"Maintenance checks","config.method":"Method","config.command":"Command","config.meaning":"Meaning","config.unavailable":"When unavailable","config.coverage":"Coverage","config.threshold":"Threshold","config.metric":"Metric","config.include":"Include","config.exclude":"Exclude","architecture.components":"Components","architecture.responsibility":"Responsibility","architecture.depends-on":"Depends on","architecture.implementation":"Implementation","architecture.data-flows":"Data flows","architecture.flow-components":"Components used","architecture.decisions":"Decisions","architecture.statement":"Statement","architecture.rationale":"Rationale","architecture.alternatives":"Alternatives","tech.rules":"Rules","tech-index.standards":"Standards","lesson.context":"Context","lesson.observation":"Observation","lesson.takeaway":"Takeaway","lesson.applies-when":"Applies when","lesson.occurrences":"Occurrences","lesson.occurrence-date":"Date","lesson.occurrence-evidence":"Evidence","lesson.promoted-to":"Promoted to standard","lesson.promoted-rule":"Rule","lesson.obsoleted-reason":"Obsoleted because","lesson.obsoleted-at":"Obsoleted at","lessons-index.occurrences":"Occurrences","sop.purpose":"Purpose","sop.scope":"Scope","sop.scope-in":"In scope","sop.scope-out":"Out of scope","sop.roles":"Roles","sop.role-responsibility":"Responsibility","sop.prerequisites":"Prerequisites","sop.steps":"Steps","sop.actor":"Actor","sop.expected-result":"Expected result","sop.branches":"Branches","sop.exceptions":"Exceptions","sop.exception-handling":"Handling","sop.success-criteria":"Success criteria","sop-category.questions":"Intake questions","sop-category.maps-to":"Maps to","sop-category.required":"Required","sop-category.constraints":"Constraints","sop-category.min-steps":"Minimum steps","sops-index.sops":"SOPs","design-system.tokens":"Tokens","design-system.components":"Components","design-system.guidance":"Guidance","design-system.overview":"Overview","design-system.do":"Do","design-system.dont":"Don't","design-system.token-references":"Token reference","design-system.implementation":"Implementation","design-system.snapshots":"Snapshots","roadmap.milestones":"Milestones","roadmap.intake-questions":"Intake questions","roadmap.owned-planned-changes":"Owned planned changes","roadmap.goal":"Goal","roadmap.done-criteria":"Done criteria","roadmap.dependencies":"Dependencies","roadmap.notes":"Notes","roadmap.details":"Details","roadmap.summary":"Summary","roadmap.depends-on":"Depends on","roadmap.unresolved":"Target not found","roadmap.impact":"Impact","roadmap.recommendation":"Recommendation","roadmap.ownership-error":"The archived planned-change listing failed.","roadmap.goal-launch":"Complete next milestone","roadmap.goal-launch-hint":"Submits a goal to this Session that repeatedly runs strict-roadmap-recommend until one milestone is complete.","roadmap.goal-confirm-title":"Submit this goal to the Session?","roadmap.goal-confirm-session":"Target Session: {sessionId}","roadmap.goal-confirm":"Submit goal","roadmap.goal-cancel":"Cancel","roadmap.goal-pending":"Submitting…","roadmap.goal-launched":"The goal was submitted to this Session.","roadmap.goal-refused":"The Session refused the goal: {reason}","roadmap.goal-unavailable":"This Session offers no /goal command.","roadmap.goal-failed":"The goal submission failed: {reason}","spec.requirements":"Requirements","spec-index.other-area":"Other","scene.actors":"Actors","scene.actor-role":"Role","scene.preconditions":"Preconditions","scene.uncovered-step":"This step declares neither a covering requirement nor a no-coverage reason."};var Ut=require("@deepseek-ai/dsh-client-store");var id="archive";function Dn(e,t){return e===""?t:`${e}/${t}`}function Bi(e){let t=new Set(e.map((r)=>r.name)),n=[],o=[];for(let r of Mr)if(mt[r].some((s)=>t.has(s)))n.push(r);else o.push(r);return{present:n,absent:o}}function sd(e,t,n){return{id:`${e===""?me:e}::truncated`,kind:"truncation",path:e,family:t,label:"",archived:n,loaded:!0,truncated:!0,watch:"none"}}function Fn(e,t,n,o,r=[]){return{id:e,kind:"group",path:e,family:t,label:e.split("/").pop()??e,archived:n,children:r,loaded:o,truncated:!1,watch:"none"}}function zi(e,t,n){return{id:e,kind:"document",path:e,family:t,label:e.split("/").pop()??e,archived:n,loaded:!0,truncated:!1,watch:"none"}}async function Pn(e,t,n,o,r,i){let s=await e.list(t,n,i),a=[];for(let l of s.entries){let d=Dn(s.path,l.name);if(l.type==="directory"){if(l.name===id&&!r){a.push(Fn(d,o,!0,!1));continue}let p=await Pn(e,t,d,o,r,i);a.push(Vn(Fn(d,o,r,!0),p.children,p.truncated));continue}if(l.type==="file")a.push(zi(d,o,r))}return{children:a,truncated:s.truncated}}function Vn(e,t,n){let o=n?[...t,sd(e.path,e.family,e.archived)]:t;return{...e,children:o,truncated:n}}async function Wi(e,t,n,o,r){let i={id:`${me}/${n}`,kind:"family",path:`${me}/${n}`,family:n,label:n,archived:!1,children:[],loaded:!0,truncated:!1,watch:"none"},s=mt[n],a=[];for(let l of s){let d=o.find((p)=>p.name===l);if(!d)continue;if(d.type==="file"){a.push(zi(Dn(me,l),n,!1));continue}if(d.type==="directory"){let p=Dn(me,l),f=await Pn(e,t,p,n,!1,r),h=Vn(Fn(p,n,!1,!0),f.children,f.truncated);a.push(...h.children??[])}}return{...i,children:a}}async function Ln(e,t,n,o){if(n.kind==="family"){let i=await e.list(t,me,o);if(!Bi(i.entries).present.includes(n.family))throw Object.assign(Error(`family ${n.family} is absent from the workflow root`),{code:"workspace-file/not-found"});let s=await Wi(e,t,n.family,i.entries,o);return{...n,children:s.children,loaded:!0}}let r=await Pn(e,t,n.path,n.family,n.archived,o);return Vn({...n,loaded:!0},r.children,r.truncated)}async function ji(e,t,n){let o;try{o=await e.list(t,me,n)}catch(s){let a=fe(s);if(a==="workspace-file/not-found"||a==="workspace-file/outside-workspace"||a==="workspace-file/not-directory")return{status:"empty",families:[],documents:{}};return{status:"error",errorCode:a??"unknown",families:[],documents:{}}}let r=Bi(o.entries),i=[];for(let s of r.present)i.push(await Wi(e,t,s,o.entries,n));return{status:"ready",families:i,documents:{},rootTruncated:o.truncated}}function pe(e,t){if(typeof e==="object"&&e!==null&&t in e){let n=e[t];if(typeof n==="string"&&n.trim().length>0)return n}return}function de(e,t){if(typeof e==="object"&&e!==null&&t in e)return e[t];return}function Se(e){let t=e.split("/");return t[t.length-1]||e}function Mn(e,t,n){switch(n){case"roadmap_milestone":{let o=de(t,"milestone");if(typeof o==="object"&&o!==null){let r=o,i=Object.keys(r);if(i.length===1){let s=pe(r[i[0]],"title");if(s!==void 0)return s}}return Se(e)}case"planned_change":return pe(de(t,"planned_change"),"id")??Se(e);case"change_proposal":return pe(de(t,"change"),"id")??Se(e);case"main_spec":return pe(de(t,"spec"),"title")??Se(e);case"scene":return pe(de(t,"scene"),"title")??Se(e);case"lesson":return pe(de(t,"lesson"),"title")??Se(e);case"main_tech":return pe(de(t,"standard"),"title")??Se(e);case"architecture":return pe(de(t,"architecture"),"title")??Se(e);case"design_system":return pe(de(t,"design_system"),"title")??Se(e);default:return Se(e)}}function Yt(e,t){switch(t){case"roadmap_milestone":case"planned_change":return pe(e,"status");default:return}}function ad(e,t){if(typeof e==="object"&&e!==null&&t in e){let n=e[t];if(typeof n==="number"&&Number.isFinite(n))return n}return}function wt(e,t){switch(t){case"roadmap_milestone":{let n=de(e,"milestone");if(typeof n==="object"&&n!==null){let r=Object.keys(n);if(r.length===1)return{milestoneId:r[0],milestoneOrder:ad(e,"order")}}return{}}case"planned_change":return{plannedChangeId:pe(de(e,"planned_change"),"id"),plannedChangeMilestone:pe(de(e,"planned_change"),"milestone")};default:return{}}}function $t(e,t){if(t!=="main_spec")return{};let n=pe(de(e,"spec"),"id"),o=de(e,"requirements"),r=[];if(typeof o==="object"&&o!==null&&!Array.isArray(o))r.push(...Object.keys(o));return{specId:n,requirementIds:r}}class Bn{port;sessionId;callbacks;directoryWatches=new Map;openDocumentWatch;openDocumentPath;disposed=!1;constructor(e,t,n){this.port=e;this.sessionId=t;this.callbacks=n}healthOf(e){if(this.openDocumentPath===e)return this.openDocumentWatch?.health??"none";return this.directoryWatches.get(e)?.health??"none"}watchDirectory(e){if(this.disposed||this.directoryWatches.has(e))return;let t={controller:new AbortController,health:"active"};this.directoryWatches.set(e,t),this.pump(t,e,"directory")}unwatchDirectory(e){let t=this.directoryWatches.get(e);if(t===void 0)return;this.directoryWatches.delete(e),t.controller.abort()}watchOpenDocument(e){if(this.disposed)return;if(this.openDocumentPath===e)return;this.unwatchOpenDocument();let t={controller:new AbortController,health:"active"};this.openDocumentWatch=t,this.openDocumentPath=e,this.pump(t,e,"file")}unwatchOpenDocument(){let e=this.openDocumentWatch;if(e===void 0)return;this.openDocumentWatch=void 0,this.openDocumentPath=void 0,e.controller.abort()}dispose(){this.disposed=!0,this.unwatchOpenDocument();for(let e of[...this.directoryWatches.keys()])this.unwatchDirectory(e)}setHealth(e,t,n){e.health=n,this.callbacks.onHealthChange?.(t,n)}async pump(e,t,n){try{for await(let o of this.port.changes(this.sessionId,t,e.controller.signal)){if(o.kind==="ready")this.setHealth(e,t,"active");if(o.kind==="change")this.callbacks.onInvalidate({path:t,kind:n,absent:"absent"in o.change})}if(!e.controller.signal.aborted)this.setHealth(e,t,"failed")}catch(o){if(e.controller.signal.aborted)return;this.setHealth(e,t,fe(o)==="workspace-file/watch-unsupported"?"unsupported":"failed")}}}function ld(e,t){let n=(r)=>t===r||t.startsWith(`${r}/`),o=e.find((r)=>mt[r.family].some((i)=>n(`${me}/${i}`)));while(o!==void 0){if(!o.loaded)return o;let r=(o.children??[]).find((i)=>i.kind!=="truncation"&&n(i.path));if(r===void 0||r.kind==="document")return r?.path===t?"listed":void 0;o=r}return}var cd=6;async function dd(e,t,n){let o=Array(e.length),r=0,i=async()=>{for(let l=r;l<e.length;l=r)r+=1,o[l]=await n(e[l])},s=[],a=Math.min(Math.max(1,t),e.length);for(let l=0;l<a;l+=1)s.push(i());return await Promise.all(s),o}function xt(e,t){for(let n of e){if(n.id===t)return n;let o=n.children===void 0?void 0:xt(n.children,t);if(o!==void 0)return o}return}function qi(e,t){for(let n of e){if(n.path===t&&(n.kind==="group"||n.kind==="family"))return n;let o=n.children===void 0?void 0:qi(n.children,t);if(o!==void 0)return o}return}function St(e,t){return e.map((n)=>{if(n.id===t.id)return t;if(n.children===void 0)return n;let o=St(n.children,t);return o===n.children?n:{...n,children:o}})}function Ki(e,t=[]){for(let n of e){if((n.kind==="group"||n.kind==="family")&&n.loaded)t.push(n.path);if(n.children!==void 0)Ki(n.children,t)}return t}function zn(e,t){for(let n of Ki([t]))e.watchDirectory(n)}function Qt(e){let t=Ut.createSnapshotStore(Lt()),n=Ut.createSnapshotStore(ht()),o=Ut.createSnapshotStore(we()),r=new Map,i=new Map,s=new Map,a,l;function d(_,N){let R=l;if(R===void 0)return;let T=s.get(R)??new Map;T.set(_,N),s.set(R,T)}async function p(_){let N=s.get(_);if(N===void 0)return;let R=[...N.entries()].sort((T,D)=>T[0].length-D[0].length);for(let[T,D]of R)if(D==="open")await ne.expandNode(_,T);else ne.collapseNode(_,T)}function f(_){let N={},R=new Set,T=(O)=>{for(let F of O){if(F.kind==="document"){R.add(F.path);let z=r.get(F.path);N[F.path]={path:F.path,family:F.family,label:F.label,artifactType:z?.artifactType,known:z?.known??!1,status:z?.status,milestoneId:z?.roadmap?.milestoneId,milestoneOrder:z?.roadmap?.milestoneOrder,plannedChangeId:z?.roadmap?.plannedChangeId,plannedChangeMilestone:z?.roadmap?.plannedChangeMilestone,specId:z?.spec?.specId,requirementIds:z?.spec?.requirementIds,archived:F.archived}}if(F.children!==void 0)T(F.children)}};T(_.families);for(let O of r.keys())if(!R.has(O))r.delete(O);for(let O of i.keys())if(!R.has(O))i.delete(O);let D={};for(let[O,F]of i){let z=vo(O);if(z!=="")D[z]=F}return{..._,documents:N,changeCompletion:D}}function h(_){let N=(R)=>R.map((T)=>{let D=T.children===void 0?void 0:N(T.children),O=(T.kind==="group"||T.kind==="family")&&T.loaded?a?.healthOf(T.path)??"none":"none";return T.watch===O&&D===T.children?T:{...T,watch:O,children:D}});return{..._,families:N(_.families)}}async function v(_,N){if(N.kind!=="document"||N.archived)return N;let R=await $e(e,_,N.path);if(!R.ok)return N;if(r.set(N.path,{artifactType:R.artifactType,known:Nt(R.artifactType),status:Yt(R.data,R.artifactType),roadmap:wt(R.data,R.artifactType),spec:$t(R.data,R.artifactType)}),N.family==="changes"&&R.artifactType==="task_list"){let D=it(R.data);if(D===void 0)i.delete(N.path);else i.set(N.path,D)}let T=Mn(N.path,R.data,R.artifactType);return T===N.label?N:{...N,label:T}}async function y(_,N){let R=[],T=(z)=>{for(let oe of z)if(oe.children===void 0)R.push(oe);else T(oe.children)};T(N);let D=await dd(R,cd,(z)=>v(_,z)),O=0,F=(z)=>z.map((oe)=>{if(oe.children===void 0){let bt=D[O];return O+=1,bt}let ze=F(oe.children);return ze===oe.children?oe:{...oe,children:ze}});return F(N)}function x(_){if(a===void 0||l!==_)a?.dispose(),a=new Bn(e,_,{onInvalidate:S,onHealthChange:C}),l=_;return a}async function A(_,N,R,T,D){if(T!=="roadmap_milestone"||D===void 0||!D.archived){o.set(we());return}let O=wt(R,T);if(O.milestoneId===void 0){o.set(we());return}o.set({status:"loading",milestoneId:O.milestoneId,owned:[],truncated:!1});let F=await zr(e,_,O.milestoneId),z=n.getSnapshot();if(z.status==="idle"||z.path!==N)return;o.set(F.failed?{status:"error",milestoneId:O.milestoneId,owned:[],truncated:!1}:{status:"ready",milestoneId:O.milestoneId,owned:F.owned,truncated:F.truncated})}function C(){let _=t.getSnapshot();if(_.status==="ready")t.set(h(_))}function S(_){if(a===void 0)return;if(_.kind==="file"){let R=n.getSnapshot();if(R.status==="idle"||R.path!==_.path)return;if(_.absent){n.set({status:"absent",path:_.path}),Q(_.path);return}L(_.path);return}ie(_.path)}async function ie(_){let N=t.getSnapshot(),R=qi(N.families,_);if(R===void 0||!R.loaded)return;let T=l;if(T===void 0)return;try{let D=await Ln(e,T,R),O={...D,children:await y(T,D.children??[])},F={...N,families:St(N.families,O)};F=h(f(F));let z=x(T);zn(z,O),t.set(F)}catch{}}async function Q(_){let N=_.lastIndexOf("/");await ie(N===-1?"":_.slice(0,N))}async function L(_){let N=l;if(N===void 0)return;let R=await $e(e,N,_),T=n.getSnapshot();if(T.status==="idle"||T.path!==_)return;if(R.ok){r.set(_,{artifactType:R.artifactType,known:Nt(R.artifactType),status:Yt(R.data,R.artifactType),roadmap:wt(R.data,R.artifactType),spec:$t(R.data,R.artifactType)}),n.set({status:"ready",path:_,data:R.data,anchor:T.anchor});return}n.set({status:"error",path:_,error:R.error})}async function P(_,N){for(let R=0;R<32&&l===_&&n.getSnapshot().path===N;R+=1){let T=ld(t.getSnapshot().families,N);if(T===void 0||T==="listed")return;if(await ne.expandNode(_,T.id),xt(t.getSnapshot().families,T.id)?.loaded!==!0)return}}let ne={async loadWorkspace(_){let N=x(_),R=()=>l!==_;t.set(Lt()),r.clear(),i.clear();let T;try{T=await ji(e,_)}catch(F){if(R())return;t.set({status:"error",errorCode:fe(F)??"unknown",families:[],documents:{}});return}if(R())return;if(T.status!=="ready"){n.set(ht()),o.set(we()),N.unwatchOpenDocument(),t.set(T);return}let D=[];try{for(let F of T.families)D.push({...F,children:await y(_,F.children??[])})}catch(F){if(R())return;t.set({status:"error",errorCode:fe(F)??"unknown",families:[],documents:{}});return}if(R())return;let O={status:"ready",families:D,documents:{},rootTruncated:T.rootTruncated};O=f(O);for(let F of O.families)zn(N,F);t.set(h(O)),await p(_)},async expandNode(_,N){let R=t.getSnapshot(),T=xt(R.families,N);if(T===void 0||T.kind!=="group"&&T.kind!=="family"||T.loaded)return;let D=x(_),O,F;try{O=await Ln(e,_,T),F=O.archived?O.children??[]:await y(_,O.children??[])}catch{return}if(l!==_)return;let z=t.getSnapshot(),oe={...z,families:St(z.families,{...O,children:F})};oe=f(oe),zn(D,O),t.set(h(oe)),d(N,"open")},collapseNode(_,N){let R=t.getSnapshot(),T=xt(R.families,N);if(T===void 0||T.kind!=="group"&&T.kind!=="family")return;a?.unwatchDirectory(T.path);let D={...T,children:[],loaded:!1,truncated:!1},O={...R,families:St(R.families,D)};O=h(f(O)),t.set(O),d(N,"closed")},async openDocument(_,N,R){let T=x(_);n.set({status:"loading",path:N,anchor:R}),P(_,N);let D=await $e(e,_,N),O=n.getSnapshot();if(O.status==="idle"||O.path!==N)return;if(D.ok){let F=t.getSnapshot(),z=xt(F.families,N);if(z!==void 0&&z.kind==="document"&&!z.archived){if(r.set(N,{artifactType:D.artifactType,known:Nt(D.artifactType),status:Yt(D.data,D.artifactType),roadmap:wt(D.data,D.artifactType),spec:$t(D.data,D.artifactType)}),z.family==="changes"&&D.artifactType==="task_list"){let bt=it(D.data);if(bt===void 0)i.delete(N);else i.set(N,bt)}let oe=Mn(N,D.data,D.artifactType),ze={...F,families:St(F.families,{...z,label:oe})};ze=f(ze),t.set(ze)}n.set({status:"ready",path:N,data:D.data,anchor:R}),T.watchOpenDocument(N),await A(_,N,D.data,D.artifactType,z);return}n.set({status:"error",path:N,error:D.error}),T.watchOpenDocument(N),o.set(we())},closeDocument(){a?.unwatchOpenDocument(),n.set(ht()),o.set(we())},dispose(){a?.dispose(),a=void 0,l=void 0,r.clear(),i.clear(),s.clear(),n.set(ht()),o.set(we()),t.set(Lt())}};return{tree:t,open:n,ownership:o,actions:ne}}function ud(e,t){let n=!1;return{show(){if(n)return;n=!0,e.actions.loadWorkspace(t)},dispose(){n=!1,e.actions.dispose()}}}function Hi(e,t){let n=new Map;return{get(o){let r=n.get(o);if(r!==void 0)return r;let i=Qt(e),s={sessionId:o,viewer:i,controller:ud(i,o),goal:t?.get(o)};return n.set(o,s),s},dispose(){for(let o of n.values())o.controller.dispose();n.clear()}}}var Yi=require("@deepseek-ai/dsh-client-store"),$i="Repeatedly run the strict-roadmap-recommend skill until one roadmap milestone is complete. In the first round, run it without a milestone hint; the milestone that owns the planned change it recommends is the target milestone. In every later round, pass the target milestone id as the milestone hint, so the recommendation runs with --milestone <target-milestone-id>, and carry each recommended change through strict-spec-auto to archive. Complete the goal once strict-spec-cli roadmap-status reports every planned change of the target milestone complete. Block the goal, stating the reason, when the recommendation reports roadmap-error, refine-milestone, or no-candidate before the target milestone is complete, or when a created change has open questions that need a human answer.",pd=`/goal ${$i}`;function Ui(e){return{execute:async(t,n)=>{let o=await e.commands.execute(t,n,[]);if(!o.ok)throw o.error;return o.value===void 0?{kind:"unknown-command"}:{kind:"executed",result:o.value.result}}}}var Gi={phase:"idle"};function fd(e){if(typeof e==="object"&&e!==null){let{message:t,code:n}=e;if(typeof t==="string"&&t.length>0)return t;if(typeof n==="string"&&n.length>0)return n}return String(e)}function md(e,t){let n=Yi.createSnapshotStore(Gi),o=()=>n.getSnapshot().phase;return{sessionId:t,objective:$i,state:n,actions:{request(){if(o()==="confirming"||o()==="pending")return;n.set({phase:"confirming"})},cancel(){if(o()!=="confirming")return;n.set(Gi)},async confirm(){if(o()!=="confirming")return;n.set({phase:"pending"});let r;try{let i=await e.execute(t,pd);if(i.kind==="unknown-command")r={phase:"refused",refusal:{kind:"unavailable"}};else if(i.result.kind==="error")r={phase:"refused",refusal:{kind:"refused",text:i.result.text}};else r={phase:"launched"}}catch(i){r={phase:"refused",refusal:{kind:"failed",message:fd(i)}}}n.set(r)}}}}function Qi(e){let t=new Map;return{get(n){let o=t.get(n);if(o!==void 0)return o;let r=md(e,n);return t.set(n,r),r}}}var hd=["slots","locale","remote","remote.workspaceFiles","remote.commands","sessions","workspaces","sidebarRightTabs"],Xi="strict-spec",gd=900,Zi="dsh-plugin-strict-spec",yd="strict-spec-documents",vd=90;function wd(e){e.effect(()=>e.locale.register("strictSpec",{zh:Li,en:Mi}),"dsh-plugin-strict-spec: dictionaries");let t=e.locale.bind("strictSpec"),n=Vr({workspaceFiles:e.remote.workspaceFiles}),o=Qt(n),r=Oi(),i=Di(o,r.store),s=Ai(e.sessions,e.workspaces),a=Qi(Ui({commands:e.remote.commands})),l=Hi(n,a),d=(p)=>Ji.jsx(Pi,{...p,picker:s,pageSelection:r.store,pageActions:r.actions,controller:i,viewer:o,goalLaunchers:a});e.slots.inject("sidebar.panellist",()=>e.slots.register({name:"sidebar.panellist",id:Xi,order:gd,label:()=>t("panel.title"),registrant:"dsh-plugin-strict-spec"},Kn)),e.slots.inject("main",()=>e.slots.register({name:"main",key:Xi,locale:"strictSpec",registrant:"dsh-plugin-strict-spec"},d)),e.effect(()=>e.sidebarRightTabs.register({id:Zi,kind:yd,title:()=>t("tab.title"),guide:[{id:"open",order:vd,title:()=>t("tab.guide-title"),description:()=>t("tab.guide-description")}]}),"dsh-plugin-strict-spec: sidebar-right tab type"),e.slots.inject("sidebar.right.pane.tab",()=>{let p=e.slots.register({name:"sidebar.right.pane.tab",key:Zi,locale:"strictSpec",registrant:"dsh-plugin-strict-spec",inject:(f)=>({surface:l.get(f)})},Vi);return()=>{p(),l.dispose()}})}
47
+
48
+ return module.exports;
49
+ },
50
+ });