geneseed 4.3.0 → 4.3.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.
- package/CHANGELOG.md +11 -0
- package/SHIPPED.md +1 -1
- package/adapters/opencode/plugins/geneseed-context.js +25 -1
- package/adapters/opencode/plugins/geneseed-guard.js +25 -1
- package/adapters/opencode/plugins/geneseed-learn.js +25 -1
- package/docs/concepts/exclusions.md +2 -0
- package/docs/concepts/host-matrix.md +2 -1
- package/docs/reference/opencode-plugins.md +1 -1
- package/harness.config.json +1 -1
- package/js/hosts/gitref.mjs +25 -1
- package/js/hosts/hosts.mjs +14 -4
- package/js/inspect/excludes.mjs +33 -2
- package/package.json +1 -1
- package/web/dist/assets/{Activity-DDTRkc4M.js → Activity-UiGvYgEl.js} +1 -1
- package/web/dist/assets/{ActivityDetail-C41RsH-S.js → ActivityDetail-COXCSeXn.js} +1 -1
- package/web/dist/assets/{Dashboard-B0DJ2oUk.js → Dashboard-DkdOUpke.js} +2 -2
- package/web/dist/assets/{Docs-DBj7-n9F.js → Docs-TtVyc_Dy.js} +1 -1
- package/web/dist/assets/{GreenhouseView-Bz-Q1Xl-.js → GreenhouseView-Bh0xq6Up.js} +1 -1
- package/web/dist/assets/{Installs-BNlWdJJE.js → Installs-J3IoSqk6.js} +1 -1
- package/web/dist/assets/{JournalView-BkwmfkEy.js → JournalView-BrD33V35.js} +1 -1
- package/web/dist/assets/{Laws-CzvMZCUL.js → Laws-Cjkenizx.js} +1 -1
- package/web/dist/assets/{Library-BgIpOTHi.js → Library-CKyeB096.js} +1 -1
- package/web/dist/assets/{Loops-s_NsuNaQ.js → Loops-D15LDhZO.js} +1 -1
- package/web/dist/assets/Markdown-DrXLM6TA.js +65 -0
- package/web/dist/assets/{OperatorHudView-CgeWJnPI.js → OperatorHudView-B5CcWoJ6.js} +1 -1
- package/web/dist/assets/{Personal-DMM6jfE0.js → Personal-BBdGbJn6.js} +1 -1
- package/web/dist/assets/{Tabs-CPpcsYDc.js → Tabs-s8T501po.js} +1 -1
- package/web/dist/assets/{drawable-D-fIT_ow.js → drawable-DALqyS4l.js} +1 -1
- package/web/dist/assets/index-BP4foUp0.js +2 -0
- package/web/dist/index.html +1 -1
- package/web/dist/assets/Markdown-C6fRd4A4.js +0 -67
- package/web/dist/assets/index-DXIa0ZG_.js +0 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./FilterInput-BSfpStOZ.js";var i=e(t(),1),a=n(),o={experimental:{label:`experimental`,cls:`warn`,hint:`Shipped, but not yet confirmed by real use.`},deprecated:{label:`deprecated`,cls:`bad`,hint:`On its way out — look for the replacement before building on it.`},personal:{label:`personal`,cls:``,hint:`Yours — present in this install, not shipped or versioned by Geneseed.`},unknown:{label:`no status`,cls:``,hint:`Not listed in registry.json.`}};function s({status:e}){let t=o[e];return t?(0,a.jsxs)(`span`,{className:`badge ${t.cls}`,title:t.hint,children:[(0,a.jsx)(`span`,{className:`dot`}),t.label]}):null}function c(e,t){let n=(t||``).trim().toLowerCase();return n?e.filter(e=>`${e.title||``} ${e.name||``} ${e.desc||``}`.toLowerCase().includes(n)):e}function l({label:e,count:t,extra:n,q:i,onQ:o,matched:s,inView:c,children:l}){let u=p(c);return(0,a.jsxs)(`section`,{className:`lib-list`,"aria-label":e,children:[(0,a.jsxs)(`div`,{className:`lib-list-head`,children:[(0,a.jsxs)(`b`,{children:[e,` `,(0,a.jsx)(`span`,{className:`mono dim`,children:t})]}),n]}),(0,a.jsx)(r,{value:i,onChange:o,placeholder:`Filter ${e.toLowerCase()}`,label:`Filter ${e}`}),(0,a.jsxs)(`div`,{className:`lib-rows`,ref:u,onKeyDown:f,children:[l,i.trim()&&s===0&&(0,a.jsxs)(`div`,{className:`empty`,style:{padding:32},children:[(0,a.jsx)(`div`,{className:`big`,children:`No matches`}),`Nothing in `,e.toLowerCase(),` matches “`,i.trim(),`”.`]})]})]})}function u({item:e,isOpen:t,href:n,children:r}){return(0,a.jsxs)(`a`,{className:`lib-row${t?` on`:``}`,href:n,"aria-current":t?`true`:void 0,children:[(0,a.jsxs)(`span`,{className:`lr-name`,children:[e.title||e.name,(0,a.jsx)(s,{status:e.status}),r]}),e.desc?(0,a.jsx)(`span`,{className:`lr-desc`,children:e.desc}):null]})}function d({rows:e,activeName:t,hrefOf:n,pills:r}){let i=null,o=[];for(let s of e)s.group&&s.group!==i&&(i=s.group,o.push((0,a.jsxs)(`div`,{className:`lib-group`,children:[s.groupC?(0,a.jsx)(`span`,{className:`cdot`,style:{"--cc":s.groupC},"aria-hidden":`true`}):null,s.group]},`g-${s.group}`))),o.push((0,a.jsx)(u,{item:s,isOpen:t===s.name,href:n(s),children:r?.(s)},s.name));return o}function f(e){if(e.key!==`ArrowDown`&&e.key!==`ArrowUp`)return;let t=[...e.currentTarget.querySelectorAll(`.lib-row`)],n=t.indexOf(document.activeElement);n!==-1&&(e.preventDefault(),t[e.key===`ArrowDown`?Math.min(n+1,t.length-1):Math.max(n-1,0)]?.focus())}function p(e){let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=t.current,n=e?.querySelector(`.lib-row.on`);if(!n||!e)return;let r=n.offsetTop;r>=e.scrollTop&&r+n.clientHeight<=e.scrollTop+e.clientHeight||(e.scrollTop=Math.max(0,r-e.clientHeight/2+n.clientHeight/2))},e),t}function m({label:e,total:t,cats:n,cat:r,onChange:i}){if(n.length<=1)return null;let o=[{key:`all`,label:`All`,n:t,c:`var(--text-3)`},...n];return(0,a.jsxs)(`div`,{className:`rail-cats`,children:[(0,a.jsx)(`ul`,{"aria-label":e,children:o.map(({key:e,label:t,n,c:o})=>(0,a.jsx)(`li`,{children:(0,a.jsxs)(`button`,{type:`button`,className:r===e?`on`:``,"aria-pressed":r===e,style:{"--cc":o},onClick:()=>i(e),children:[(0,a.jsx)(`span`,{className:`cdot`,"aria-hidden":`true`}),(0,a.jsx)(`span`,{className:`rc-name`,children:t}),(0,a.jsx)(`span`,{className:`mono dim`,children:n})]})},e))}),(0,a.jsx)(`div`,{className:`rail-mix`,"aria-hidden":`true`,children:n.map(({key:e,n:t,c:n})=>(0,a.jsx)(`span`,{className:r===`all`||r===e?``:`dim`,style:{"--cc":n,flexGrow:t}},e))})]})}function h(e){let t=[],n=new Map;for(let r of e)n.has(r.group)||t.push(r.group),n.set(r.group,(n.get(r.group)||0)+1);return t.map(e=>({key:e,label:e,n:n.get(e),c:`var(--accent)`}))}function g(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var _=g();function v(e){_=e}var y={exec:()=>null};function b(e){let t=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=t[r];return i||(i=e(r),t[r]=i),i}}function x(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(S.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var ee=((e=``)=>{try{return!!RegExp(`(?<=1)(?<!1)`+e)}catch{return!1}})(),S={codeRemoveIndent:/^(?: {0,3}\t| {1,4})/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,endingSpaceTabChar:/[ \t]$/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,leadingSpaceTab:/^[ \t]+/,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,numericCharacterReference:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));/,numericCharacterReferenceOrAmpersand:/&#(?:(\d{1,7})|[Xx]([A-Fa-f0-9]{1,6}));|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:b(e=>RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:b(e=>RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),fencesBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),headingBeginRegex:b(e=>RegExp(`^ {0,${e}}#`)),htmlBeginRegex:b(e=>RegExp(`^ {0,${e}}(?:</?(?:${D})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`,`i`)),blockquoteBeginRegex:b(e=>RegExp(`^ {0,${e}}>`))},te=/^(?:[ \t]*(?:\n|$))+/,ne=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,C=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ie=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,w=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,ae=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,oe=x(ae).replace(/bull/g,w).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,``).getRegex(),se=x(ae).replace(/bull/g,w).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/hr/g,/ {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),T=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,ce=/^[^\n]+/,E=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,le=x(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,E).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ue=x(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,w).getRegex(),D=`address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul`,O=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,de=x(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))`,`i`).replace(`comment`,O).replace(`tag`,D).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fe=e=>x(T).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,e).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,D).getRegex(),pe=fe(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),me=fe(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),k={blockquote:x(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,me).getRegex(),code:ne,def:le,fences:re,heading:ie,hr:C,html:de,lheading:oe,list:ue,newline:te,paragraph:pe,table:y,text:ce},he=x(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,`(?: {4}| {0,3} )[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,D).getRegex(),ge={...k,lheading:se,table:he,paragraph:x(T).replace(`hr`,C).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,he).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace(`list`,` {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]`).replace(`html`,` {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`).replace(`tag`,D).getRegex()},_e={...k,html:x(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,O).replace(/tag/g,`(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b`).getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:y,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:x(T).replace(`hr`,C).replace(`heading`,` *#{1,6} *[^
|
|
2
|
+
]`).replace(`lheading`,oe).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ye=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,A=/^( {2,}|\\)\n(?!\s*$)[ \t]*/,be=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,j=/[\p{P}\p{S}]/u,M=/[\s\p{P}\p{S}]/u,N=/[^\s\p{P}\p{S}]/u,xe=x(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,M).getRegex(),Se=/[\p{Pi}\p{Ps}"']/u,Ce=/(?!~)[\p{P}\p{S}]/u,we=/(?!~)[\s\p{P}\p{S}]/u,Te=/(?:[^\s\p{P}\p{S}]|~)/u,Ee=x(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,ee?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),P=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,De=x(P,`u`).replace(/punct/g,j).getRegex(),Oe=x(P,`u`).replace(/punct/g,Ce).getRegex(),ke=x(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,`u`).replace(/openQuote/g,Se).replace(/punct/g,j).getRegex(),Ae=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,je=x(Ae,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Me=x(Ae,`gu`).replace(/notPunctSpace/g,Te).replace(/punctSpace/g,we).replace(/punct/g,Ce).getRegex(),Ne=x(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Pe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Fe=x(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Ie=x(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,j).getRegex(),Le=x(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,N).replace(/punctSpace/g,M).replace(/punct/g,j).getRegex(),Re=x(/\\(punct)/,`gu`).replace(/punct/g,j).getRegex(),ze=x(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/,`gu`).replace(/punct/g,j).getRegex(),Be=x(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace(`scheme`,/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace(`email`,/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ve=x(O).replace(`(?:-->|$)`,`-->`).getRegex(),He=x(`^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,Ve).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ue=/\[(?:\\[\s\S]|[^\[\]\\])*\]/,F=x(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace(`brackets`,Ue).getRegex(),We=x(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace(`label`,F).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ge=x(/^!?\[(label)\]\[(ref)\]/).replace(`label`,F).replace(`ref`,E).getRegex(),Ke=x(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,E).getRegex(),qe=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/,Je=x(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace(`brackets`,Ue).getRegex(),Ye=x(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,x(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Je).replace(`ref`,qe).getRegex()).replace(`nolink`,x(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,qe).getRegex()).getRegex(),Xe=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Ze=x(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g,/[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),I={_backpedal:y,anyPunctuation:Re,anyPunctuationOutsideCode:ze,autolink:Be,blockSkip:Ee,br:A,code:ye,del:y,delLDelim:y,delRDelim:y,emStrongLDelim:De,emStrongRDelimAst:je,emStrongRDelimUnd:Pe,escape:ve,link:We,nolink:Ke,punctuation:xe,reflink:Ge,reflinkSearch:Ye,tag:He,text:be,url:y},Qe={...I,emStrongLDelim:ke,emStrongRDelimAst:Ne,emStrongRDelimUnd:Fe,link:x(/^!?\[(label)\]\((.*?)\)/).replace(`label`,F).getRegex(),reflink:x(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,F).getRegex()},L={...I,emStrongRDelimAst:Me,emStrongLDelim:Oe,delLDelim:Ie,delRDelim:Le,url:x(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`emailProtocol`,Ze).replace(`protocol`,Xe).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:x(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace(`protocol`,Xe).replace(/emailProtocol/g,/(?:mailto|xmpp):/).getRegex()},$e={...L,br:x(A).replace(`{2,}`,`*`).getRegex(),text:x(L.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},R={normal:k,gfm:ge,pedantic:_e},z={normal:I,gfm:L,breaks:$e,pedantic:Qe},et={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},tt=e=>et[e];function B(e,t){if(t){if(S.escapeTest.test(e))return e.replace(S.escapeReplace,tt)}else if(S.escapeTestNoEncode.test(e))return e.replace(S.escapeReplaceNoEncode,tt);return e}function nt(e){return S.numericCharacterReference.test(e)?e.replace(S.numericCharacterReferenceOrAmpersand,(e,t,n)=>{if(t===void 0&&n===void 0)return`&`;let r=t===void 0?Number.parseInt(n,16):Number.parseInt(t,10);return r===0||r>1114111||r>=55296&&r<=57343?`�`:r===38?`&`:String.fromCodePoint(r)}):e}function rt(e){try{e=encodeURI(e).replace(S.percentDecode,`%`)}catch{return null}return e}function V(e,t){let n=e.replace(S.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(S.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(S.slashPipe,`|`);return n}function H(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function it(e){let t=e.split(`
|
|
3
|
+
`),n=t.length-1;for(;n>=0&&S.blankLine.test(t[n]);)n--;return t.length-n<=2?e:t.slice(0,n+1).join(`
|
|
4
|
+
`)}function U(e){return e.trim().toLowerCase().toUpperCase().toLowerCase()}function at(e,t){if(e.indexOf(t[0])===-1&&e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function W(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function ot(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`),c=e[0].charAt(0)===`!`,l=r.state.inLink,u=r.state.linkEmitted,d=r.state.inRawBlock;r.state.inLink=!0,r.state.linkEmitted=!1;let f=r.inlineTokens(s),p=r.state.linkEmitted;if(r.state.linkEmitted=u,r.state.inLink=l,!c){if(p){r.state.inRawBlock=d;return}r.state.linkEmitted=!0}return{type:c?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:f}}function st(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
5
|
+
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return e.slice(Math.min(r.length,i.length))}).join(`
|
|
6
|
+
`)}function ct(e,t,n,r){if(!t.includes(`<`))return!1;for(let i=0;i<t.length;i++){if(t[i]===`\\`){i++;continue}if(t[i]==="`"){let e=r.inline.code.exec(t.slice(i));if(e){i+=e[0].length-1;continue}}if(t[i]!==`<`)continue;let a=e.slice(n+i),o=r.inline.tag.exec(a)||r.inline.autolink.exec(a);if(o){if(o[0].length>t.length-i)return!0;i+=o[0].length-1}}return!1}var G=class{options;rules;lexer;constructor(e){this.options=e||_}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=this.options.pedantic?t[0]:it(t[0]);return{type:`code`,raw:e,codeBlockStyle:`indented`,text:e.replace(this.rules.other.codeRemoveIndent,``)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=st(e,t[3]||``,this.rules);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=H(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceTabChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:H(t[0],`
|
|
7
|
+
`),depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:H(t[0],`
|
|
8
|
+
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=H(t[0],`
|
|
9
|
+
`).split(`
|
|
10
|
+
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
11
|
+
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
12
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
13
|
+
${s}`:s,r=r?`${r}
|
|
14
|
+
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`||u?.type===`heading`||u?.type===`hr`||u?.type===`html`)break;if(u?.type===`blockquote`){let t=u,a=e.join(`
|
|
15
|
+
`),o=t.raw+`
|
|
16
|
+
`+a.replace(this.rules.other.blockquoteSetextReplace2,``),s=this.blockquote(o);i[i.length-1]=s;let c=o.substring(s.raw.length).replace(/^\n/,``),l=c?c.split(`
|
|
17
|
+
`).length:0,d=l?e.slice(0,-l):e;d.length>0&&(n=`${n}
|
|
18
|
+
${d.join(`
|
|
19
|
+
`)}`),r=r.substring(0,r.length-t.text.length)+s.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
20
|
+
`+e.join(`
|
|
21
|
+
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
22
|
+
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=e,r=()=>n.length-e.length,i=t[1].trim(),a=i.length>1,o={type:`list`,raw:``,ordered:a,start:a?+i.slice(0,-1):``,loose:!1,items:[]};i=a?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=a?i:`[*+-]`);let s=this.rules.other.listItemRegex(i),c=!1;for(;e;){let i=!1,a=``;if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;let l=r();e=e.substring(t[0].length);let u=t[2].split(`
|
|
23
|
+
`,1)[0],d=t[1].length,f=this.options.pedantic?W(u,d):u.replace(this.rules.other.leadingSpaceTab,e=>W(e,d)),p=e.split(`
|
|
24
|
+
`,1)[0],m=!f.trim(),h=0;if(this.options.pedantic?(h=2,a=f.trimStart()):m?h=d+1:(h=f.search(this.rules.other.nonSpaceChar),h=h>4?1:h,a=f.slice(h),h+=d),m&&this.rules.other.blankLine.test(p)&&(e=e.substring(p.length+1),i=!0),!i){let t=this.rules.other.nextBulletRegex(h),n=this.rules.other.hrRegex(h),r=this.rules.other.fencesBeginRegex(h),i=this.rules.other.headingBeginRegex(h),o=this.rules.other.htmlBeginRegex(h),s=this.rules.other.blockquoteBeginRegex(h);for(;e;){let c=e.split(`
|
|
25
|
+
`,1)[0],l;if(p=c,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting,` `),l=p):l=p.replace(this.rules.other.leadingSpaceTab,e=>W(e)),r.test(p)||i.test(p)||o.test(p)||s.test(p)||t.test(p)||n.test(p))break;if(l.search(this.rules.other.nonSpaceChar)>=h||!p.trim())a+=`
|
|
26
|
+
`+l.slice(h);else{if(m||f.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||r.test(f)||i.test(f)||n.test(f))break;a+=`
|
|
27
|
+
`+p}m=!p.trim(),e=e.substring(c.length+1),f=l.slice(h)}}let g=n.slice(l,r());o.loose||(c?o.loose=!0:this.rules.other.doubleBlankLine.test(g)&&(c=!0)),o.items.push({type:`list_item`,raw:g,task:!!this.options.gfm&&this.rules.other.listIsTask.test(a),loose:!1,text:a,tokens:[]})}let l=o.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;o.raw=n.slice(0,r()).trimEnd();for(let e of o.items)if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),!o.loose){let t=e.tokens.filter(e=>e.type===`space`);o.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}for(let e of o.items){let t=e.tokens[0];if(e.task&&(t?.type===`text`||t?.type===`paragraph`)){e.text=e.text.replace(this.rules.other.listReplaceTask,``),t.raw=t.raw.replace(this.rules.other.listReplaceTask,``),t.text=t.text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}let n=this.rules.other.listTaskCheckbox.exec(e.raw);if(n){let t={type:`checkbox`,raw:n[0]+` `,checked:n[0]!==`[ ]`};e.checked=t.checked,o.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=t.raw+e.tokens[0].raw,e.tokens[0].text=t.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(t)):e.tokens.unshift({type:`paragraph`,raw:t.raw,text:t.raw,tokens:[t]}):e.tokens.unshift(t)}}else e.task&&=!1}if(o.loose)for(let e of o.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return o}}html(e){let t=this.rules.block.html.exec(e);if(t){let e=it(t[0]);return{type:`html`,block:!0,raw:e,pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:e}}}def(e){let t=this.rules.block.def.exec(e);if(t){if(!this.rules.other.startAngleBracket.test(t[2])&&at(t[2],`()`)!==-1)return;let e=U(t[1]).replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,`$1`):t[3];return{type:`def`,tag:e,raw:H(t[0],`
|
|
28
|
+
`),href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=V(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
29
|
+
`):[],a={type:`table`,raw:H(t[0],`
|
|
30
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(V(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let e=t[1].trim();return{type:`heading`,raw:H(t[0],`
|
|
31
|
+
`),depth:t[2].charAt(0)===`=`?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
32
|
+
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){if(this.lexer.state.linkParenPossible===!1)return;let t=this.rules.inline.link.exec(e);if(t){let n=t[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ct(e,t[1],n,this.rules))return;let r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let e=H(r.slice(0,-1),`\\`);if((r.length-e.length)%2==0)return}else{let e=at(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let i=t[2],a=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(i);e&&(i=e[1],a=e[3])}else a=t[3]?t[3].slice(1,-1):``;return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(i=this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i.slice(1):i.slice(1,-1)),ot(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,`$1`),title:a&&a.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let r=n[0].charAt(0)===`!`?2:1;if(!this.options.pedantic&&ct(e,n[1],r,this.rules))return;let i=t[U((n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `))];if(!i){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return ot(n,i,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,a,o,s=i,c=0,l=r[0][0],u=n===l,d=l===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(r=d.exec(t))!==null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(o=[...a].length,r[3]||r[4]){s+=o;continue}if(r[5]||r[6]){if(i%3&&!((i+o)%3)){c+=o;continue}if(u)break}if(s-=o,s>0)continue;o=Math.min(o,o+s+c);let t=[...r[0]][0].length,n=e.slice(0,i+r.index+t+o);if(Math.min(i,o)%2){let e=n.slice(1,-1);return{type:`em`,raw:n,text:e,tokens:this.lexer.inlineTokens(e)}}let l=n.slice(2,-2);return{type:`strong`,raw:n,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,autolink:!0,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:e?t[0]:nt(t[0]),escaped:e}}}},K=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||_,this.options.tokenizer=this.options.tokenizer||new G,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,linkParenPossible:!0,top:!0};let t={other:S,block:R.normal,inline:z.normal};this.options.pedantic?(t.block=R.pedantic,t.inline=z.pedantic):this.options.gfm&&(t.block=R.gfm,t.inline=this.options.breaks?z.breaks:z.gfm),this.tokenizer.rules=t}static get rules(){return{block:R,inline:z}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(S.carriageReturn,`
|
|
33
|
+
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(S.tabCharGlobal,` `).replace(S.spaceLine,``));let r=1/0;for(;e;){if(e.length<r)r=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let i;if(this.options.extensions?.block?.some(n=>(i=n.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);i.raw.length===1&&n!==void 0?n.raw+=`
|
|
34
|
+
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
35
|
+
`)?``:`
|
|
36
|
+
`)+i.raw,n.text+=`
|
|
37
|
+
`+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
38
|
+
`)?``:`
|
|
39
|
+
`)+i.raw,n.text+=`
|
|
40
|
+
`+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(a=e.substring(0,t+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let r=t.at(-1);n&&r?.type===`paragraph`?(r.raw+=(r.raw.endsWith(`
|
|
41
|
+
`)?``:`
|
|
42
|
+
`)+i.raw,r.text+=`
|
|
43
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
44
|
+
`)?``:`
|
|
45
|
+
`)+i.raw,n.text+=`
|
|
46
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}linkInText(e){if(!e.includes(`[`))return!1;let t=this.tokenizer.rules.inline.link;for(let n of e.matchAll(this.tokenizer.rules.inline.blockSkip))if(t.test(n[0])&&e.charAt(n.index-1)!==`!`)return!0;for(let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let e=t[0],n=e.lastIndexOf(`[`);if(e.charAt(0)!==`!`&&Object.hasOwn(this.tokens.links,U(e.slice(n+1,-1)))&&!(n>1&&this.linkInText(e.slice(1,n-1))))return!0}return!1}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=this.state.linkParenPossible;this.state.linkParenPossible=n&&e.includes(`)`);try{return this.#e(e,t)}finally{this.state.linkParenPossible=n}}#e(e,t){let n=e;if(this.tokens.links&&e.includes(`[`)){let e=this.tokenizer.rules.inline.reflinkSearch,t=n=>{let r=n.lastIndexOf(`[`);if(!Object.hasOwn(this.tokens.links,U(n.slice(r+1,-1))))return n;if(r>1&&n.charAt(0)!==`!`){let i=n.slice(1,r-1);if(this.linkInText(i))return`[`+i.replace(e,t)+`][`+`a`.repeat(n.length-r-2)+`]`}return`[`+`a`.repeat(n.length-2)+`]`};n=n.replace(e,t)}n=n.replace(this.tokenizer.rules.inline.anyPunctuationOutsideCode,(e,t,n)=>n?`+`.repeat(e.length):t?t+e.slice(t.length,-t.length).replace(/`/g,`+`)+t:e),n=n.replace(this.tokenizer.rules.inline.blockSkip,(e,t,n)=>{let r=n?n.length:0;return e.slice(0,r)+`[`+`a`.repeat(e.length-r-2)+`]`}),n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let r=!1,i=``,a=1/0;for(;e;){if(e.length<a)a=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}r||(i=``),r=!1;let o;if(this.options.extensions?.inline?.some(n=>(o=n.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let n=t.at(-1);o.type===`text`&&n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e,n,i)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(o=this.tokenizer.inlineText(s)){e=e.substring(o.raw.length),o.raw.slice(-1)!==`_`&&(i=o.raw.slice(-1)),r=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=o.raw,n.text+=o.text):t.push(o);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return t}infiniteLoopError(e){let t=`Infinite loop on byte: `+e;if(this.options.silent)console.error(t);else throw Error(t)}},q=class{options;parser;constructor(e){this.options=e||_}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(S.notSpaceStart)?.[0],i=e?e.replace(S.endingNewline,``)+`
|
|
47
|
+
`:``;return r?`<pre><code class="language-`+B(r)+`">`+(n?i:B(i,!0))+`</code></pre>
|
|
48
|
+
`:`<pre><code>`+(n?i:B(i,!0))+`</code></pre>
|
|
49
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
50
|
+
${this.parser.parse(e)}</blockquote>
|
|
51
|
+
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
52
|
+
`}hr(e){return`<hr>
|
|
53
|
+
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
54
|
+
`+r+`</`+i+`>
|
|
55
|
+
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
56
|
+
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
57
|
+
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
58
|
+
<thead>
|
|
59
|
+
`+t+`</thead>
|
|
60
|
+
`+r+`</table>
|
|
61
|
+
`}tablerow({text:e}){return`<tr>
|
|
62
|
+
${e}</tr>
|
|
63
|
+
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
64
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${B(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?B(n,!0):this.parser.parseInline(r),o=rt(e);if(o===null)return a;e=B(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+B(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=rt(e);if(i===null)return B(n);e=i;let a=`<img src="${B(e)}" alt="${B(n)}"`;return t&&(a+=` title="${B(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:B(e.text)}},J=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Y=class e{options;renderer;textRenderer;constructor(e){this.options=e||_,this.options.renderer=this.options.renderer||new q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new J}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},X=class{options;block;constructor(e){this.options=e||_}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?K.lex:K.lexInline}provideParser(e=this.block){return e?Y.parse:Y.parseInline}};function Z(e,t){if(Array.isArray(t))for(let n=0;n<t.length;n++)e.push(t[n]);else e.push(t)}var Q=new class{defaults=g();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Y;Renderer=q;TextRenderer=J;Lexer=K;Tokenizer=G;Hooks=X;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(Z(n,t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)Z(n,this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)Z(n,this.walkTokens(e.tokens,t));break}case`list`:{let e=r;Z(n,this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);Z(n,this.walkTokens(i,t))}):e.tokens&&Z(n,this.walkTokens(e.tokens,t))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new q(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new G(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new X;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=X.passThroughHooks.has(n)?e=>{if(this.defaults.async&&X.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&Z(n,t.call(this,e)),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return K.lex(e,t??this.defaults)}parser(e,t){return Y.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?K.lex:K.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?K.lex:K.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Y.parse:Y.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
65
|
+
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+B(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function $(e,t){return Q.parse(e,t)}$.options=$.setOptions=function(e){return Q.setOptions(e),$.defaults=Q.defaults,v($.defaults),$},$.getDefaults=g,$.defaults=_;function lt(...e){return Q.use(...e),$.defaults=Q.defaults,v($.defaults),$}$.use=lt,$.walkTokens=function(e,t){return Q.walkTokens(e,t)},$.parseInline=Q.parseInline,$.Parser=Y,$.parser=Y.parse,$.Renderer=q,$.TextRenderer=J,$.Lexer=K,$.lexer=K.lex,$.Tokenizer=G,$.Hooks=X,$.parse=$,$.options,$.setOptions,$.walkTokens,$.parseInline,Y.parse,K.lex;var ut=`script,style,iframe,frame,frameset,object,embed,link,meta,base,form`,dt=new Set([`href`,`src`,`xlink:href`,`action`,`formaction`,`poster`,`background`]),ft=new Set([`http`,`https`,`mailto`]);function pt(e){let t=/^([a-z][a-z0-9+.-]*):/.exec(e.replace(/[\u0000- ]/g,``).toLowerCase());return!t||ft.has(t[1])}function mt(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content.querySelectorAll(ut).forEach(e=>e.remove()),t.content.querySelectorAll(`*`).forEach(e=>{for(let{name:t,value:n}of[...e.attributes]){let r=t.toLowerCase();(r.startsWith(`on`)||r===`srcdoc`||dt.has(r)&&!pt(n))&&e.removeAttribute(t)}}),t.innerHTML}function ht(e,t=[]){let n=new Map(t.map(e=>[e.label,e])),r=(e||``).replace(/\[\[([^\]]+)\]\]/g,(e,t)=>{let r=n.get(t.trim());return r?`[${r.label}](#/item/${r.type}/${encodeURIComponent(r.name)})`:e});return mt($.parse(r,{breaks:!1}))}var gt=[];function _t({body:e,links:t=gt}){let n=(0,i.useMemo)(()=>ht(e,t),[e,t]);return(0,a.jsx)(`div`,{className:`markdown`,dangerouslySetInnerHTML:{__html:n}})}export{m as a,l as c,$ as i,c as l,ht as n,h as o,mt as r,d as s,_t as t,s as u};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e,r as t}from"./sections-GalMS0Zv.js";import{i as n,t as r}from"./react-DRhoX0kS.js";import{A as i,k as a}from"./index-
|
|
1
|
+
import{n as e,r as t}from"./sections-GalMS0Zv.js";import{i as n,t as r}from"./react-DRhoX0kS.js";import{A as i,k as a}from"./index-BP4foUp0.js";import{t as o}from"./jobBuckets-Dbq8ZlWW.js";n();var s=r(),c=14,l=120;function u({title:e,right:t,children:n,span:r}){return(0,s.jsxs)(`div`,{className:`c-mod`,style:r?{gridColumn:`span ${r}`}:null,children:[(0,s.jsxs)(`div`,{className:`c-mod-head`,children:[(0,s.jsx)(`span`,{className:`c-tab`}),(0,s.jsx)(`h3`,{children:e}),t&&(0,s.jsx)(`span`,{className:`c-mod-right`,children:t})]}),(0,s.jsx)(`div`,{className:`c-mod-body`,children:n})]})}function d({label:e,value:t}){return(0,s.jsxs)(`div`,{className:`c-kpi`,children:[(0,s.jsx)(`div`,{className:`c-kpi-label`,children:e}),(0,s.jsx)(`div`,{className:`c-kpi-val`+(t===0?` zero`:``),children:t})]})}function f({data:e,height:t=120,hi:n}){if(!e.length)return null;let r=Math.max(...e.map(e=>e.v),1);return(0,s.jsx)(`div`,{className:`c-cols`,style:{height:t},children:e.map((e,i)=>{let a=Math.max(e.v/r*(t-6),2);return(0,s.jsx)(`div`,{className:`c-col ${i===n?`hi`:``}`,style:{height:a},title:`${e.t}: ${e.v}`},i)})})}function p({checks:e}){return(0,s.jsx)(`div`,{className:`c-band`,children:e.map((e,t)=>(0,s.jsx)(`span`,{className:`c-band-cell ${e.problems.length===0?`ok`:`bad`}`,title:`${e.label}: ${e.problems.length===0?`pass`:`${e.problems.length} problem(s)`}`},t))})}function m(e){let t={};for(let n of e||[]){let e=n.action||`unknown`;t[e]=(t[e]||0)+1}return Object.entries(t).map(([e,t])=>({label:e,value:t})).sort((e,t)=>t.value-e.value)}function h({overview:n,jobs:r,doctor:h,onAction:g}){let _=n.counts||{},v=t.reduce((e,t)=>e+(_[t]||0),0),y=Math.max(...t.map(e=>_[e]||0),1),b=h?.groups||[],x=b.filter(e=>e.problems.length===0).length,S=o(r||[],10,`0d`),C=S.reduce((e,t)=>e+t.v,0),w=m(r),T=Math.max(...w.map(e=>e.value),1),E=i(n.diff),D=[[`status`,n.deployed?(0,s.jsx)(`span`,{className:`c-pill ok`,children:`DEPLOYED`}):(0,s.jsx)(`span`,{className:`c-pill warn`,children:`NOT DEPLOYED`})],[`voice`,(0,s.jsx)(`span`,{style:{textTransform:`capitalize`},children:n.theme})],[`mode`,n.emit],[`doctor`,b.length===0?(0,s.jsx)(`span`,{className:`c-pill`,children:`—`}):x===b.length?(0,s.jsx)(`span`,{className:`c-pill ok`,children:`CLEAN`}):(0,s.jsxs)(`span`,{className:`c-pill warn`,children:[b.length-x,` ISSUES`]})],[`edits`,String(E)],[`built`,n.build_time||`—`],[`target`,(0,s.jsx)(`span`,{className:`c-dim mono`,children:n.target})]];return(0,s.jsxs)(`div`,{className:`c-root`,children:[(0,s.jsxs)(`div`,{className:`c-titlebar`,children:[(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h1`,{className:`c-h1`,children:`HARNESS // STATUS READOUT`}),(0,s.jsxs)(`div`,{className:`c-sub`,children:[n.target,` · rendered from src/ · inherited everywhere`]})]}),(0,s.jsxs)(`div`,{className:`row gap-8`,children:[(0,s.jsxs)(`button`,{className:`btn`,onClick:()=>g(`update`),children:[(0,s.jsx)(a,{name:`refresh`}),`UPDATE`]}),(0,s.jsx)(`button`,{className:`btn ghost`,onClick:()=>g(`build-all`),children:`REBUILD`}),(0,s.jsx)(`button`,{className:`btn ghost`,onClick:()=>g(`doctor`),children:`DOCTOR`})]})]}),(0,s.jsx)(`div`,{className:`c-strip`,children:D.map(([e,t],n)=>(0,s.jsxs)(`div`,{className:`c-strip-cell`,children:[(0,s.jsx)(`div`,{className:`c-strip-k`,children:e}),(0,s.jsx)(`div`,{className:`c-strip-v`,children:t})]},n))}),(0,s.jsxs)(`div`,{className:`c-kpi-row`,children:[(0,s.jsx)(d,{label:`AGENTS`,value:_.agents??`—`}),(0,s.jsx)(d,{label:`SKILLS`,value:_.skills??`—`}),(0,s.jsx)(d,{label:`INVARIANTS`,value:_.laws??`—`}),(0,s.jsx)(d,{label:`PACKS`,value:_.doctrines?`${_.doctrines.active}/${_.doctrines.total}`:`—`}),(0,s.jsx)(d,{label:`MEMORY`,value:_.memory??`—`}),(0,s.jsx)(d,{label:`NOTEBOOK`,value:_.notebook??`—`}),(0,s.jsx)(d,{label:`EDITS`,value:E})]}),(0,s.jsxs)(`div`,{className:`c-grid`,children:[(0,s.jsx)(u,{title:`CAPABILITY DISTRIBUTION`,right:`${v} ENTRIES`,span:2,children:(0,s.jsxs)(`table`,{className:`c-tbl`,children:[(0,s.jsx)(`thead`,{children:(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`th`,{children:`SECTION`}),(0,s.jsx)(`th`,{children:`DETAIL`}),(0,s.jsx)(`th`,{style:{width:150},children:`SHARE`}),(0,s.jsx)(`th`,{className:`num`,children:`N`})]})}),(0,s.jsx)(`tbody`,{children:t.map(t=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{className:`c-name`,children:e[t].label}),(0,s.jsx)(`td`,{className:`c-dim`,children:e[t].desc}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`div`,{className:`c-bar`,children:(0,s.jsx)(`i`,{style:{width:`${(_[t]||0)/y*100}%`,background:t===`agents`||t===`skills`?`var(--accent)`:`var(--line-3)`}})})}),(0,s.jsx)(`td`,{className:(_[t]||0)>0?`num`:`num c-dim`,children:_[t]??0})]},t))})]})}),(0,s.jsx)(u,{title:`DOCTOR // CHECKS`,right:b.length?`${x}/${b.length}`:`—`,children:b.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(p,{checks:b}),(0,s.jsx)(`div`,{className:`c-check-list`,children:b.map(e=>{let t=e.problems.length===0;return(0,s.jsxs)(`div`,{className:`c-check-row`,children:[(0,s.jsx)(`span`,{className:`c-dotmark ${t?`ok`:`bad`}`}),(0,s.jsx)(`span`,{className:`c-check-name`,children:e.label}),(0,s.jsx)(`span`,{className:`c-check-detail`,children:t?`clean`:`${e.problems.length} problem${e.problems.length===1?``:`s`}`})]},e.label)})})]}):(0,s.jsx)(`p`,{className:`c-dim mono`,style:{fontSize:11},children:`No doctor run loaded yet.`})}),(0,s.jsxs)(u,{title:`RUN RATE // 10D`,right:`${C} RUNS`,span:2,children:[(0,s.jsx)(f,{data:S,height:120,hi:S.length-1}),(0,s.jsx)(`div`,{className:`c-axis`,children:S.map((e,t)=>(0,s.jsx)(`span`,{children:t%2==0?e.t:``},t))})]}),(0,s.jsx)(u,{title:`RUN LOG // BY TYPE`,right:`${(r||[]).length} LOGGED`,children:w.length>0?(0,s.jsx)(`table`,{className:`c-tbl`,children:(0,s.jsx)(`tbody`,{children:w.map(e=>(0,s.jsxs)(`tr`,{children:[(0,s.jsx)(`td`,{className:`c-name`,style:{textTransform:`uppercase`,fontWeight:400},children:e.label}),(0,s.jsx)(`td`,{children:(0,s.jsx)(`div`,{className:`c-bar`,children:(0,s.jsx)(`i`,{style:{width:`${e.value/T*100}%`,background:`var(--accent)`}})})}),(0,s.jsx)(`td`,{className:`num`,children:e.value})]},e.label))})}):(0,s.jsx)(`p`,{className:`c-dim mono`,style:{fontSize:11},children:`No runs logged.`})}),(0,s.jsx)(u,{title:`RECENT // RUN LOG`,span:3,children:(0,s.jsx)(`table`,{className:`c-tbl`,children:(0,s.jsxs)(`tbody`,{children:[(r||[]).slice(0,c).map(e=>{let t=e.status===`done`,n=e.status===`failed`?`bad`:t?`ok`:`acc`,r=e.output?e.output.split(`
|
|
2
2
|
`)[0].slice(0,l):`—`;return(0,s.jsxs)(`tr`,{children:[(0,s.jsxs)(`td`,{style:{width:96},children:[(0,s.jsx)(`span`,{className:`c-dotmark ${n}`}),` `,(0,s.jsx)(`span`,{className:`c-dim`,children:e.action})]}),(0,s.jsx)(`td`,{className:`c-name`,style:{fontWeight:400},children:r}),(0,s.jsx)(`td`,{className:`num c-dim`,children:e.duration?`${e.duration}s`:e.status})]},e.id)}),(!r||r.length===0)&&(0,s.jsx)(`tr`,{children:(0,s.jsx)(`td`,{colSpan:`3`,className:`c-dim`,style:{fontSize:11},children:`No runs logged.`})})]})})})]})]})}export{h as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./api-Bp5eW_6m.js";import{F as i,_ as a,v as o,x as s,y as c}from"./index-DXIa0ZG_.js";import{t as l}from"./Markdown-C6fRd4A4.js";import{t as u}from"./Tabs-CPpcsYDc.js";import d from"./Library-BgIpOTHi.js";var f=e(t(),1),p=n(),m={title:``,body:``,scope:`project`,trial_until:``};function h({initial:e,onCancel:t,onSave:n,busy:r}){let[i,a]=(0,f.useState)(e),o=e=>t=>a({...i,[e]:t.target.value}),s=i.title.trim()&&i.body.trim();return(0,p.jsxs)(`div`,{className:`rule-form`,children:[(0,p.jsx)(`input`,{className:`lib-filter`,type:`text`,value:i.title,onChange:o(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,"aria-label":`Rule title`}),(0,p.jsx)(`textarea`,{className:`rule-body-input`,value:i.body,onChange:o(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-label":`Rule body`}),(0,p.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,p.jsxs)(`select`,{className:`sel`,value:i.scope,onChange:o(`scope`),"aria-label":`Rule scope`,children:[(0,p.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,p.jsx)(`option`,{value:`user`,children:`scope: user (personal)`})]}),(0,p.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,p.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:i.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,p.jsxs)(`div`,{style:{marginLeft:`auto`,display:`flex`,gap:8},children:[(0,p.jsx)(`button`,{className:`btn sm`,disabled:!s||r,onClick:()=>n(i),children:r?`Saving…`:`Save rule`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:t,children:`Cancel`})]})]})]})}function g({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,p.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,p.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,children:[(0,p.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,p.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,p.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,p.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,p.jsxs)(`div`,{className:`rule-expand`,children:[(0,p.jsx)(`p`,{children:e.body}),e.source?(0,p.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,p.jsxs)(`div`,{className:`row`,style:{marginTop:10,gap:8},children:[e.status===`trial`&&(0,p.jsx)(`button`,{className:`btn sm`,onClick:a,title:`Adopt for good — drop the trial marker`,children:`Graduate`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:r,children:`Edit`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Retire`})]})]})]})}function _({onChanged:e}){let t=o(),[n,s]=(0,f.useState)(0),{data:l,error:u}=i(()=>r.rules(),[n]),[d,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(``),w=()=>s(e=>e+1);if(u)return(0,p.jsx)(a,{error:u});if(!l)return(0,p.jsx)(c,{});let T=l.rules||[],{stats:E}=l,D=Math.round(Math.max(E.rules/E.max_rules,E.tokens/E.max_tokens)*100),O=D>=100?`over`:D>=70?`warn`:``,k=async t=>{x(!0),C(``);try{await r.rulesMutate({...t,fingerprint:l.fingerprint}),y(null)}catch(e){C(e.status===409?`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy; re-apply your edit.`:e.message)}finally{x(!1),w(),e?.()}},A=async e=>{await t(`Retire rule R${e.id} — “${e.title}”? It is removed from user-rules.md.`,{title:`Retire this rule?`,confirmLabel:`Retire`})&&k({op:`delete`,id:e.id})},j=e=>k({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,p.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),` beside the deployed AGENT.md. The agent obeys them with the same force as the Laws — they may tighten a Law, never repeal one — and no update ever touches the file. Keep the set small: every rule is loaded every session.`]})]}),l.exists&&v===null&&(0,p.jsx)(`button`,{className:`btn`,onClick:()=>y(`new`),children:`Add rule`})]}),l.exists&&(0,p.jsxs)(`div`,{className:`rules-meter ${O}`,children:[(0,p.jsx)(`div`,{className:`rules-meter-bar`,children:(0,p.jsx)(`div`,{className:`rules-meter-fill`,style:{width:`${Math.min(D,100)}%`}})}),(0,p.jsxs)(`span`,{className:`rules-meter-label`,children:[E.rules,`/`,E.max_rules,` rules · ~`,E.tokens,` tokens`,D>=100?` — over budget: a bloated rule set dilutes the rules that matter`:D>=70?` — getting heavy; consider merging or pruning`:``]})]}),S?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:S}):null,(l.warnings||[]).map(e=>(0,p.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),v===`new`&&(0,p.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,p.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),(0,p.jsx)(h,{initial:m,busy:b,onCancel:()=>y(null),onSave:e=>k({op:`add`,...e})})]}),l.exists?T.length===0&&v!==`new`?(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.jsx)(`div`,{className:`big`,children:`No rules yet`}),`The file is seeded and loaded every session — it is just empty. Add your first standing rule here, ask the agent for one in-session (the rule skill), or promote a recurring memory fact from the Library.`]}):(0,p.jsx)(`div`,{className:`card rules-list`,children:T.map(e=>v===e.id?(0,p.jsx)(`div`,{className:`rule-row on`,children:(0,p.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,p.jsx)(h,{initial:{title:e.title,body:e.body,scope:e.scope,trial_until:e.trial_until},busy:b,onCancel:()=>y(null),onSave:t=>k({op:`update`,id:e.id,source:e.source,...t})})})},e.id):(0,p.jsx)(g,{rule:e,isOpen:d===e.id,onToggle:()=>_(d===e.id?null:e.id),onEdit:()=>{_(e.id),y(e.id)},onDelete:()=>A(e),onGraduate:()=>j(e)},e.id))}):(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.jsx)(`div`,{className:`big`,children:`No user-rules.md here yet`}),`The build seeds it beside AGENT.md — run a build/update from the Dashboard (or`,` `,(0,p.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}function v({onChanged:e}){let{data:t,error:n,loading:o,reload:u}=i(()=>r.profile(),[]),[d,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(null);t&&t!==T&&(E(t),g(t.fingerprint||``),C?w(!1):m(t.text||``),S(e=>e||((t.text||``).trim()?`view`:`edit`)));let D=!!t&&d!==(t.text||``);return(0,f.useEffect)(()=>{if(!D)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[D]),o&&!t?(0,p.jsx)(c,{}):n?(0,p.jsx)(a,{error:n}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,p.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,p.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`, it is identity, not rules — it colours how the agent works but never binds (precedence is Laws, then rules, then this). Seeded once, never overwritten by an update. Prefer not to write it by hand? Ask the agent to run the `,(0,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,p.jsxs)(`div`,{className:`row`,style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,p.jsx)(s,{"aria-label":`Profile mode`,children:[[`view`,`View`],[`edit`,`Edit`]].map(([e,t])=>(0,p.jsx)(`button`,{className:x===e?`on`:``,onClick:()=>S(e),children:t},e))}),x===`edit`&&(0,p.jsx)(`button`,{className:`btn`,disabled:!D||_,onClick:async()=>{v(!0),b(``);try{let t=await r.profileSave({text:d,fingerprint:h});t.ok?(g(t.fingerprint||``),b(`Saved.`),S(`view`),u(),e?.()):(w(!0),b(`${t.detail||`PROFILE.md changed on disk since you opened it.`} Your edit is kept — Save again to replace the newer version with it.`),u())}catch(e){b(e.message)}finally{v(!1)}},children:_?`Saving…`:`Save`})]})]}),y?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:y}):null,x===`edit`?(0,p.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:d,onChange:e=>m(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):d.trim()?(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsx)(l,{body:d})}):(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsxs)(`p`,{className:`sub`,style:{margin:0},children:[`No profile yet — switch to Edit to write one, or ask the agent to run the`,` `,(0,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})})]})}var y=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function b({rules:e,profile:t,facts:n,notes:r}){let i=e?.exists?e.stats:null;if(!i)return null;let a=[{k:`Profile`,v:t?.seeded?`template`:t?.exists?`written`:`missing`,fill:t?.exists&&!t.seeded?1:0,warn:!!t?.seeded},{k:`Rules`,v:`${i.rules}/${i.max_rules}`,fill:i.rules/i.max_rules},{k:`Memory`,v:n==null?`n/a`:`${n} facts`,fill:+!!n},{k:`Notebook`,v:r==null?`n/a`:`${r} notes`,fill:+!!r}];return(0,p.jsxs)(`div`,{className:`card-row`,children:[(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-budget`,children:`Token budget`}),(0,p.jsx)(`span`,{className:`mono dim`,children:`loaded every turn`})]}),(0,p.jsxs)(`p`,{className:`big-num`,children:[(0,p.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,p.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens`]})]}),(0,p.jsx)(`span`,{className:`hbar${i.tokens>i.max_tokens?` bad`:``}`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{style:{width:y(i.tokens,i.max_tokens)}})}),(0,p.jsx)(`p`,{className:`panel-note`,children:i.rules?`${i.rules} rules in ${i.lines} lines.`:`All of it is the file’s preamble; no rule text yet.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-slots`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-slots`,children:`Rule slots`}),(0,p.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,p.jsx)(`div`,{className:`slots`,style:{"--slots":i.max_rules},role:`img`,"aria-label":`${i.rules} of ${i.max_rules} rule slots used`,children:Array.from({length:i.max_rules},(e,t)=>(0,p.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,p.jsx)(`p`,{className:`panel-note`,children:`Trial rules graduate once they have held.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,p.jsx)(`div`,{className:`panel-head`,children:(0,p.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,p.jsx)(`ul`,{className:`hbars`,children:a.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,p.jsx)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:`hb-ok`,style:{width:y(e.fill,1)}})}),(0,p.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}function x({tab:e=`rules`,item:t,setup:n,dataRev:a}){let[o,s]=(0,f.useState)(0),c=e=>Promise.resolve(e).catch(()=>null),{data:l}=i(()=>c(r.rules()),[a,o]),{data:m}=i(()=>c(r.profile()),[a,o]),{data:h}=i(()=>c(r.catalog(`notebook`)),[a],`catalog`),g=h?(h.items||[]).filter(e=>e.name!==`NOTEBOOK`&&e.name!==`README`).length:null,y=n?.facts??null,x={rules:l?.stats?.rules,profile:m?.seeded?`●`:null,memory:y,notebook:g};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`page-head`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h1`,{className:`h`,children:`Personal`}),(0,p.jsx)(`p`,{className:`sub`,children:`The only files you write. They survive updates, reinstalls and voice changes.`})]})}),(0,p.jsx)(u,{page:`personal`,current:e,badges:x,label:`Personal files`}),e===`rules`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{rules:l,profile:m,facts:y,notes:g}),(0,p.jsx)(_,{onChanged:()=>s(e=>e+1)})]}),e===`profile`&&(0,p.jsx)(v,{onChanged:()=>s(e=>e+1)}),(e===`memory`||e===`notebook`)&&(0,p.jsx)(d,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:a},e)]})}export{x as default};
|
|
1
|
+
import{s as e}from"./sections-GalMS0Zv.js";import{i as t,t as n}from"./react-DRhoX0kS.js";import{t as r}from"./api-Bp5eW_6m.js";import{F as i,_ as a,v as o,x as s,y as c}from"./index-BP4foUp0.js";import{t as l}from"./Markdown-DrXLM6TA.js";import{t as u}from"./Tabs-s8T501po.js";import d from"./Library-CKyeB096.js";var f=e(t(),1),p=n(),m={title:``,body:``,scope:`project`,trial_until:``};function h({initial:e,onCancel:t,onSave:n,busy:r}){let[i,a]=(0,f.useState)(e),o=e=>t=>a({...i,[e]:t.target.value}),s=i.title.trim()&&i.body.trim();return(0,p.jsxs)(`div`,{className:`rule-form`,children:[(0,p.jsx)(`input`,{className:`lib-filter`,type:`text`,value:i.title,onChange:o(`title`),placeholder:`Title — short and imperative (e.g. No emoji in commit subjects)`,"aria-label":`Rule title`}),(0,p.jsx)(`textarea`,{className:`rule-body-input`,value:i.body,onChange:o(`body`),rows:4,placeholder:`The rule, stated plainly and testably, in one short paragraph.`,"aria-label":`Rule body`}),(0,p.jsxs)(`div`,{className:`row`,style:{flexWrap:`wrap`},children:[(0,p.jsxs)(`select`,{className:`sel`,value:i.scope,onChange:o(`scope`),"aria-label":`Rule scope`,children:[(0,p.jsx)(`option`,{value:`project`,children:`scope: project (this repo, committable)`}),(0,p.jsx)(`option`,{value:`user`,children:`scope: user (personal)`})]}),(0,p.jsxs)(`label`,{className:`rule-trial-label`,children:[`trial until`,(0,p.jsx)(`input`,{className:`lib-filter rule-date`,type:`date`,value:i.trial_until,onChange:o(`trial_until`),"aria-label":`Trial until date (optional)`})]}),(0,p.jsxs)(`div`,{style:{marginLeft:`auto`,display:`flex`,gap:8},children:[(0,p.jsx)(`button`,{className:`btn sm`,disabled:!s||r,onClick:()=>n(i),children:r?`Saving…`:`Save rule`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:t,children:`Cancel`})]})]})]})}function g({rule:e,isOpen:t,onToggle:n,onEdit:r,onDelete:i,onGraduate:a}){return(0,p.jsxs)(`div`,{className:`rule-row ${t?`on`:``}`,children:[(0,p.jsxs)(`button`,{className:`rule-head`,onClick:n,"aria-expanded":t,children:[(0,p.jsxs)(`span`,{className:`rule-no`,children:[`R`,e.id]}),(0,p.jsx)(`span`,{className:`rule-title`,children:e.title}),(0,p.jsx)(`span`,{className:`rule-chip ${e.scope===`user`?`user`:``}`,children:e.scope}),e.status===`trial`&&(0,p.jsx)(`span`,{className:`rule-chip trial ${e.overdue?`overdue`:``}`,children:e.overdue?`review due`:`trial · ${e.trial_until}`})]}),t&&(0,p.jsxs)(`div`,{className:`rule-expand`,children:[(0,p.jsx)(`p`,{children:e.body}),e.source?(0,p.jsxs)(`div`,{className:`rule-src`,children:[`source: `,e.source]}):null,(0,p.jsxs)(`div`,{className:`row`,style:{marginTop:10,gap:8},children:[e.status===`trial`&&(0,p.jsx)(`button`,{className:`btn sm`,onClick:a,title:`Adopt for good — drop the trial marker`,children:`Graduate`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:r,children:`Edit`}),(0,p.jsx)(`button`,{className:`btn ghost sm`,onClick:i,children:`Retire`})]})]})]})}function _({onChanged:e}){let t=o(),[n,s]=(0,f.useState)(0),{data:l,error:u}=i(()=>r.rules(),[n]),[d,_]=(0,f.useState)(null),[v,y]=(0,f.useState)(null),[b,x]=(0,f.useState)(!1),[S,C]=(0,f.useState)(``),w=()=>s(e=>e+1);if(u)return(0,p.jsx)(a,{error:u});if(!l)return(0,p.jsx)(c,{});let T=l.rules||[],{stats:E}=l,D=Math.round(Math.max(E.rules/E.max_rules,E.tokens/E.max_tokens)*100),O=D>=100?`over`:D>=70?`warn`:``,k=async t=>{x(!0),C(``);try{await r.rulesMutate({...t,fingerprint:l.fingerprint}),y(null)}catch(e){C(e.status===409?`user-rules.md changed on disk (an agent session?) — reloaded the fresh copy; re-apply your edit.`:e.message)}finally{x(!1),w(),e?.()}},A=async e=>{await t(`Retire rule R${e.id} — “${e.title}”? It is removed from user-rules.md.`,{title:`Retire this rule?`,confirmLabel:`Retire`})&&k({op:`delete`,id:e.id})},j=e=>k({op:`update`,id:e.id,title:e.title,body:e.body,scope:e.scope,source:e.source,trial_until:``});return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`governance · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Rules`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Your own standing rules, from `,(0,p.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),` beside the deployed AGENT.md. The agent obeys them with the same force as the Laws — they may tighten a Law, never repeal one — and no update ever touches the file. Keep the set small: every rule is loaded every session.`]})]}),l.exists&&v===null&&(0,p.jsx)(`button`,{className:`btn`,onClick:()=>y(`new`),children:`Add rule`})]}),l.exists&&(0,p.jsxs)(`div`,{className:`rules-meter ${O}`,children:[(0,p.jsx)(`div`,{className:`rules-meter-bar`,children:(0,p.jsx)(`div`,{className:`rules-meter-fill`,style:{width:`${Math.min(D,100)}%`}})}),(0,p.jsxs)(`span`,{className:`rules-meter-label`,children:[E.rules,`/`,E.max_rules,` rules · ~`,E.tokens,` tokens`,D>=100?` — over budget: a bloated rule set dilutes the rules that matter`:D>=70?` — getting heavy; consider merging or pruning`:``]})]}),S?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:S}):null,(l.warnings||[]).map(e=>(0,p.jsxs)(`p`,{className:`sub rule-notice`,children:[`format warning: `,e]},e)),v===`new`&&(0,p.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,p.jsx)(`div`,{className:`eyebrow`,style:{marginBottom:10},children:`new rule`}),(0,p.jsx)(h,{initial:m,busy:b,onCancel:()=>y(null),onSave:e=>k({op:`add`,...e})})]}),l.exists?T.length===0&&v!==`new`?(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.jsx)(`div`,{className:`big`,children:`No rules yet`}),`The file is seeded and loaded every session — it is just empty. Add your first standing rule here, ask the agent for one in-session (the rule skill), or promote a recurring memory fact from the Library.`]}):(0,p.jsx)(`div`,{className:`card rules-list`,children:T.map(e=>v===e.id?(0,p.jsx)(`div`,{className:`rule-row on`,children:(0,p.jsx)(`div`,{className:`rule-expand`,style:{paddingTop:14},children:(0,p.jsx)(h,{initial:{title:e.title,body:e.body,scope:e.scope,trial_until:e.trial_until},busy:b,onCancel:()=>y(null),onSave:t=>k({op:`update`,id:e.id,source:e.source,...t})})})},e.id):(0,p.jsx)(g,{rule:e,isOpen:d===e.id,onToggle:()=>_(d===e.id?null:e.id),onEdit:()=>{_(e.id),y(e.id)},onDelete:()=>A(e),onGraduate:()=>j(e)},e.id))}):(0,p.jsxs)(`div`,{className:`empty`,style:{padding:48},children:[(0,p.jsx)(`div`,{className:`big`,children:`No user-rules.md here yet`}),`The build seeds it beside AGENT.md — run a build/update from the Dashboard (or`,` `,(0,p.jsx)(`code`,{className:`mono`,children:`geneseed update`}),`) and it appears, ready for your rules.`]})]})}function v({onChanged:e}){let{data:t,error:n,loading:o,reload:u}=i(()=>r.profile(),[]),[d,m]=(0,f.useState)(``),[h,g]=(0,f.useState)(``),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(``),[x,S]=(0,f.useState)(null),[C,w]=(0,f.useState)(!1),[T,E]=(0,f.useState)(null);t&&t!==T&&(E(t),g(t.fingerprint||``),C?w(!1):m(t.text||``),S(e=>e||((t.text||``).trim()?`view`:`edit`)));let D=!!t&&d!==(t.text||``);return(0,f.useEffect)(()=>{if(!D)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[D]),o&&!t?(0,p.jsx)(c,{}):n?(0,p.jsx)(a,{error:n}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`head-row mb-16`,children:[(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`div`,{className:`eyebrow`,children:`identity · yours`}),(0,p.jsx)(`h2`,{className:`h`,children:`Profile`}),(0,p.jsxs)(`p`,{className:`sub`,children:[`Who you are and how you like to work, from `,(0,p.jsx)(`code`,{className:`mono`,children:`PROFILE.md`}),` `,`beside the deployed AGENT.md. Unlike `,(0,p.jsx)(`code`,{className:`mono`,children:`user-rules.md`}),`, it is identity, not rules — it colours how the agent works but never binds (precedence is Laws, then rules, then this). Seeded once, never overwritten by an update. Prefer not to write it by hand? Ask the agent to run the `,(0,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill — it interviews you and drafts this file with your consent.`]})]}),(0,p.jsxs)(`div`,{className:`row`,style:{display:`flex`,alignItems:`center`,gap:12},children:[(0,p.jsx)(s,{"aria-label":`Profile mode`,children:[[`view`,`View`],[`edit`,`Edit`]].map(([e,t])=>(0,p.jsx)(`button`,{className:x===e?`on`:``,onClick:()=>S(e),children:t},e))}),x===`edit`&&(0,p.jsx)(`button`,{className:`btn`,disabled:!D||_,onClick:async()=>{v(!0),b(``);try{let t=await r.profileSave({text:d,fingerprint:h});t.ok?(g(t.fingerprint||``),b(`Saved.`),S(`view`),u(),e?.()):(w(!0),b(`${t.detail||`PROFILE.md changed on disk since you opened it.`} Your edit is kept — Save again to replace the newer version with it.`),u())}catch(e){b(e.message)}finally{v(!1)}},children:_?`Saving…`:`Save`})]})]}),y?(0,p.jsx)(`p`,{className:`sub rule-notice`,children:y}):null,x===`edit`?(0,p.jsx)(`textarea`,{className:`rule-body-input`,style:{width:`100%`,minHeight:`60vh`,fontFamily:`var(--mono, monospace)`},value:d,onChange:e=>m(e.target.value),spellCheck:!1,"aria-label":`Profile markdown`}):d.trim()?(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsx)(l,{body:d})}):(0,p.jsx)(`div`,{className:`card pad-lg`,children:(0,p.jsxs)(`p`,{className:`sub`,style:{margin:0},children:[`No profile yet — switch to Edit to write one, or ask the agent to run the`,` `,(0,p.jsx)(`code`,{className:`mono`,children:`profile`}),` skill.`]})})]})}var y=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function b({rules:e,profile:t,facts:n,notes:r}){let i=e?.exists?e.stats:null;if(!i)return null;let a=[{k:`Profile`,v:t?.seeded?`template`:t?.exists?`written`:`missing`,fill:t?.exists&&!t.seeded?1:0,warn:!!t?.seeded},{k:`Rules`,v:`${i.rules}/${i.max_rules}`,fill:i.rules/i.max_rules},{k:`Memory`,v:n==null?`n/a`:`${n} facts`,fill:+!!n},{k:`Notebook`,v:r==null?`n/a`:`${r} notes`,fill:+!!r}];return(0,p.jsxs)(`div`,{className:`card-row`,children:[(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-budget`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-budget`,children:`Token budget`}),(0,p.jsx)(`span`,{className:`mono dim`,children:`loaded every turn`})]}),(0,p.jsxs)(`p`,{className:`big-num`,children:[(0,p.jsx)(`span`,{className:`mono`,children:i.tokens}),` `,(0,p.jsxs)(`span`,{className:`dim`,children:[`/ `,i.max_tokens.toLocaleString(`en-US`),` tokens`]})]}),(0,p.jsx)(`span`,{className:`hbar${i.tokens>i.max_tokens?` bad`:``}`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{style:{width:y(i.tokens,i.max_tokens)}})}),(0,p.jsx)(`p`,{className:`panel-note`,children:i.rules?`${i.rules} rules in ${i.lines} lines.`:`All of it is the file’s preamble; no rule text yet.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-slots`,children:[(0,p.jsxs)(`div`,{className:`panel-head`,children:[(0,p.jsx)(`h2`,{id:`pc-slots`,children:`Rule slots`}),(0,p.jsxs)(`span`,{className:`mono dim`,children:[i.rules,` of `,i.max_rules]})]}),(0,p.jsx)(`div`,{className:`slots`,style:{"--slots":i.max_rules},role:`img`,"aria-label":`${i.rules} of ${i.max_rules} rule slots used`,children:Array.from({length:i.max_rules},(e,t)=>(0,p.jsx)(`span`,{className:t<i.rules?`used`:``},t))}),(0,p.jsx)(`p`,{className:`panel-note`,children:`Trial rules graduate once they have held.`})]}),(0,p.jsxs)(`section`,{className:`panel`,"aria-labelledby":`pc-known`,children:[(0,p.jsx)(`div`,{className:`panel-head`,children:(0,p.jsx)(`h2`,{id:`pc-known`,children:`What the agent knows about you`})}),(0,p.jsx)(`ul`,{className:`hbars`,children:a.map(e=>(0,p.jsxs)(`li`,{children:[(0,p.jsx)(`span`,{className:`hb-label`,children:e.k}),(0,p.jsx)(`span`,{className:`hb-track`,"aria-hidden":`true`,children:(0,p.jsx)(`span`,{className:`hb-ok`,style:{width:y(e.fill,1)}})}),(0,p.jsx)(`span`,{className:`mono hb-n${e.warn?` warn`:``}`,children:e.v})]},e.k))})]})]})}function x({tab:e=`rules`,item:t,setup:n,dataRev:a}){let[o,s]=(0,f.useState)(0),c=e=>Promise.resolve(e).catch(()=>null),{data:l}=i(()=>c(r.rules()),[a,o]),{data:m}=i(()=>c(r.profile()),[a,o]),{data:h}=i(()=>c(r.catalog(`notebook`)),[a],`catalog`),g=h?(h.items||[]).filter(e=>e.name!==`NOTEBOOK`&&e.name!==`README`).length:null,y=n?.facts??null,x={rules:l?.stats?.rules,profile:m?.seeded?`●`:null,memory:y,notebook:g};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(`div`,{className:`page-head`,children:(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h1`,{className:`h`,children:`Personal`}),(0,p.jsx)(`p`,{className:`sub`,children:`The only files you write. They survive updates, reinstalls and voice changes.`})]})}),(0,p.jsx)(u,{page:`personal`,current:e,badges:x,label:`Personal files`}),e===`rules`&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(b,{rules:l,profile:m,facts:y,notes:g}),(0,p.jsx)(_,{onChanged:()=>s(e=>e+1)})]}),e===`profile`&&(0,p.jsx)(v,{onChanged:()=>s(e=>e+1)}),(e===`memory`||e===`notebook`)&&(0,p.jsx)(d,{lock:e,base:`#/personal/${e}`,selected:t,dataRev:a},e)]})}export{x as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./sections-GalMS0Zv.js";import{i as e,t}from"./react-DRhoX0kS.js";import{B as n,V as r}from"./index-
|
|
1
|
+
import"./sections-GalMS0Zv.js";import{i as e,t}from"./react-DRhoX0kS.js";import{B as n,V as r}from"./index-BP4foUp0.js";e();var i=t();function a({page:e,current:t,badges:a={},label:o}){return(0,i.jsx)(`nav`,{className:`tabs`,"aria-label":o,children:n[e].map(n=>(0,i.jsxs)(`a`,{href:`#/${e}/${n}`,className:t===n?`on`:``,"aria-current":t===n?`page`:void 0,children:[r[n],a[n]==null?null:(0,i.jsx)(`span`,{className:`tab-badge`,children:a[n]})]},n))})}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{et as e,gt as t,lt as n,vt as r,xt as i}from"./index-
|
|
1
|
+
import{et as e,gt as t,lt as n,vt as r,xt as i}from"./index-BP4foUp0.js";var a=e=>{let n=1;if(e&&e.getCTM){let r=e.getCTM();r&&(n=(t(r.a*r.a+r.b*r.b)+t(r.c*r.c+r.d*r.d))/2)}return n},o=(e,t,o)=>{let s=r,c=getComputedStyle(e),l=c.strokeLinecap,u=c.vectorEffect===`non-scaling-stroke`?e:null,d=l,f=new Proxy(e,{get(e,t){let r=e[t];return t===i?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),r=+n[0],i=+n[1],o=a(u),c=r*-s*o,f=i*s*o+c,p=s*o+(r===0&&i===1||r===1&&i===0?0:10*o)-f;if(l!==`butt`){let t=r===i?`butt`:l;d!==t&&(e.style.strokeLinecap=`${t}`,d=t)}e.setAttribute(`stroke-dashoffset`,`${c}`),e.setAttribute(`stroke-dasharray`,`${f} ${p}`)}return Reflect.apply(r,e,t)}:n(r)?(...t)=>Reflect.apply(r,e,t):r}});return e.getAttribute(`pathLength`)!==`${s}`&&(e.setAttribute(`pathLength`,`${s}`),f.setAttribute(`draw`,`${t} ${o}`)),f},s=(t,n=0,r=0)=>e(t).map(e=>o(e,n,r));export{s as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DkdOUpke.js","assets/sections-GalMS0Zv.js","assets/react-DRhoX0kS.js","assets/api-Bp5eW_6m.js","assets/Activity-UiGvYgEl.js","assets/activity-dcg5vF9j.js","assets/usePoll-BmR631BB.js","assets/ActivityDetail-COXCSeXn.js","assets/Library-CKyeB096.js","assets/Markdown-DrXLM6TA.js","assets/FilterInput-BSfpStOZ.js","assets/Loops-D15LDhZO.js","assets/Laws-Cjkenizx.js","assets/Personal-BBdGbJn6.js","assets/Tabs-s8T501po.js","assets/Installs-J3IoSqk6.js","assets/Docs-TtVyc_Dy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e,n as t,r as n,s as r}from"./sections-GalMS0Zv.js";import{i,n as a,r as o,t as s}from"./react-DRhoX0kS.js";import{t as c}from"./api-Bp5eW_6m.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=typeof window<`u`,u=l?window:null,d=l?document:null,f={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},p={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},m={NONE:0,AUTO:1,FORCE:2},h={replace:0,none:1,blend:2},g=Symbol(),_=Symbol(),v=Symbol(),y=Symbol(),b=Symbol(),x=1e-11,S=0xe8d4a51000,C=1e3,w=[],T=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),E=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],D=E.reduce((e,t)=>({...e,[t]:t+`(`}),{}),O=()=>{},ee=e=>e,k=/\)\s*[-.\d]/,te=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,ne=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,A=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,j=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,M=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,N=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,P=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,F=/([a-z])([A-Z])/g,re=/(\*=|\+=|-=)/,ie=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,ae={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:C,delay:0,loopDelay:0,ease:`out(2)`,composition:h.replace,modifier:ee,onBegin:O,onBeforeUpdate:O,onUpdate:O,onLoop:O,onPause:O,onComplete:O,onRender:O},oe={current:null,root:d},I={defaults:ae,precision:4,timeScale:1,tickThreshold:200,editor:null},se={version:`4.5.0`,engine:null};l&&(u.AnimeJS||=[],u.AnimeJS.push(se));var ce=e=>e.replace(F,`$1-$2`).toLowerCase(),le=(e,t)=>e.indexOf(t)===0,ue=Date.now,de=Array.isArray,fe=e=>e&&e.constructor===Object,pe=e=>typeof e==`number`&&!isNaN(e),me=e=>typeof e==`string`,he=e=>typeof e==`function`,L=e=>e===void 0,ge=e=>L(e)||e===null,R=e=>l&&e instanceof SVGElement,_e=e=>te.test(e),ve=e=>le(e,`rgb`),ye=e=>le(e,`hsl`),be=e=>_e(e)||(ve(e)||ye(e))&&(e[e.length-1]===`)`||!k.test(e)),xe=e=>!I.defaults.hasOwnProperty(e),Se=[`opacity`,`rotate`,`overflow`,`color`],z=(e,t)=>{if(Se.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},Ce=e=>me(e)?parseFloat(e):e,we=Math.pow,Te=Math.sqrt,Ee=Math.sin,De=Math.cos,Oe=Math.abs,ke=Math.floor,Ae=Math.asin,je=Math.PI,Me=Math.round,Ne=(e,t,n)=>e<t?t:e>n?n:e,B=(e,t)=>{if(t<0)return e;if(!t)return Me(e);let n=10**t;return Me(e*n)/n},Pe=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,Fe=e=>e===1/0?S:e===-1/0?-S:e,Ie=e=>e<=1e-11?x:Fe(B(e,11)),V=e=>de(e)?[...e]:e,Le=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=L(i)?t[r]:i}return n},H=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},Re=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},ze=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},Be=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[y],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!L(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:le(t,`scale`)?`1`:le(t,`rotate`)||le(t,`skew`)?`0deg`:`0px`},Ve=e=>{let t=``;for(let n=0,r=E.length;n<r;n++){let r=E[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${D[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},He=[];function Ue(e,t){if(!e)return null;let n=He.length;outer:for(let r=0;r<n;r++){let n=He[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=He[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var We=e=>{let t=ne.exec(e)||A.exec(e),n=L(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},Ge=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},Ke=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),qe=e=>{let t=j.exec(e)||M.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=L(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=B(Ke(t,e,n+1/3)*255,0),s=B(Ke(t,e,n)*255,0),c=B(Ke(t,e,n-1/3)*255,0)}return[o,s,c,a]},Je=e=>ve(e)?We(e):_e(e)?Ge(e):ye(e)?qe(e):[0,0,0,1],U=(e,t)=>L(e)?t:e,Ye=(e,t)=>{let n=e.match(ie),r=t[_]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Xe=(e,t,n,r,i,a)=>{if(he(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(me(e)&&le(e,`var(`)){if(!i)return Ye(e,t);let n=()=>Ye(e,t);return i.func=n,n()}return e},Ze=(e,t)=>e[_]?e[v]&&z(e,t)?f.ATTRIBUTE:E.includes(t)||T.get(t)?f.TRANSFORM:le(t,`--`)?f.CSS_VAR:t in e.style?f.CSS:t in e?f.OBJECT:f.ATTRIBUTE:f.OBJECT,Qe=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[b]||e).getPropertyValue(t);return i===`auto`?`0`:i},$e=(e,t,n,r)=>{let i=L(n)?Ze(e,t):n,a=Ue(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===f.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===f.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===f.TRANSFORM?Be(e,t,r):i===f.CSS_VAR?Qe(e,t,r).trimStart():Qe(e,t,r)},et=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,tt=()=>({t:p.NUMBER,n:0,u:null,o:null,d:null,s:null}),W=(e,t)=>{if(t.t=p.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&P.exec(r);if(i)return t.t=p.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(be(r))return t.t=p.COLOR,t.d=Je(r),t;{let e=r.match(N);return t.t=p.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(N)||[],t}},nt=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=V(e._toNumbers),t.s=V(e._strings),t),rt=tt(),it=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(B(Pe(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},at=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,g=e._reversed,_=e._alternate,v=e._hasChildren,b=e._delay,S=e._currentTime,C=b+c,w=t-b,T=Ne(S,-b,o),E=Ne(w,-b,o),D=w-S,O=E>0,ee=E>=o,k=o<=x,te=i===m.FORCE,ne=0,A=w,j=0;if(l>1){let t=c+(ee?0:d),n=~~(E/t);e._currentIteration=Ne(n,0,l),ee&&e._currentIteration--,ne=e._currentIteration%2,A=E-n*t||0}let M=g^(_&&ne),N=e._ease,P=ee?M?0:o:M?c-A:A;N&&(P=c*N(P/c)||0);let F=(a?a.backwards:w<S)?!M:!!M;if(e._currentTime=w,e._iterationTime=P,e.backwards=F,O&&!e.began?(e.began=!0,!n&&(!a||!F&&a.began)&&e.onBegin(e)):w<=0&&(e.began=!1),!n&&!v&&O&&e._currentIteration!==u&&e.onLoop(e),te||i===m.AUTO&&(t>=(a&&b>0?0:b)&&t<=C||t<=b&&T>b||t>=C&&T!==o)||P>=C&&T!==o||P<=b&&T>0&&!ee||t<=T&&T===o&&s||ee&&!s&&k){if(O&&(e.computeDeltaTime(T),n||e.onBeforeUpdate(e)),!v){let t=te||(F?D*-1:D)>=I.tickThreshold,i=B(e._offset+(a?a._offset:0)+b+P,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,m=o._absoluteStartTime+o._changeDuration,g=o._nextRep,_=o._prevRep,v=e!==h.none,b=_?_._absoluteStartTime+_._changeDuration:0,x=_&&_.parent!==o.parent,S=!g||g._isOverridden?m:g.parent===o.parent?m+g._delay:g._absoluteStartTime<g._absoluteUpdateStartTime?g._absoluteStartTime:g._absoluteUpdateStartTime;if((t||(n!==a||i<=S||_&&!x&&(!g||g.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||x&&!o._hasFromValue&&!_._isOverridden&&i>=b||g&&!g._isOverridden&&g.parent===o.parent&&g._currentTime!==0&&P<g._startTime))&&(!_||x||P>=o._startTime)&&(!v||!o._isOverridden&&(!o._isOverlapped||i<=m)&&(!g||g._isOverridden||i<=S)&&(!_||_._isOverridden||(x?i>=o._absoluteStartTime||!o._hasFromValue&&i>=b:i>=b+o._delay)))){let t=o._currentTime=Ne(P-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,m=o._valueType,g=o._tweenType,_=g===f.OBJECT,b=m===p.NUMBER,x=b&&_||n===0||n===1?-1:I.precision,S,C;if(b)S=C=i(B(Pe(o._fromNumber,o._toNumber,n),x));else if(m===p.UNIT)C=i(B(Pe(o._fromNumber,o._toNumber,n),x)),S=`${C}${o._unit}`;else if(m===p.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(Pe(t[3],a[3],n)),(!o._setter||r)&&(S=`rgba(${B(e[0],0)},${B(e[1],0)},${B(e[2],0)},${e[3]})`)}else m===p.COMPLEX&&(S=it(o,n,x));if(v&&(o._number=C),!r&&e!==h.blend){let e=o.property;s=o.target,o._setter?o._setter(s,C,o):_?s[e]=S:g===f.ATTRIBUTE?s.setAttribute(e,S):(c=s.style,g===f.TRANSFORM?(s!==l&&(l=s,u=s[y]),u[e]=S,d=1):g===f.CSS?c[e]=S:g===f.CSS_VAR&&c.setProperty(e,S)),O&&(j=1)}else o._value=S}else n&&_&&!x&&P<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=Ve(u),d=0),o=o._next}!n&&j&&e.onRender(e)}!n&&O&&e.onUpdate(e)}return a&&k?!n&&(a.began&&!F&&w>0&&!s||F&&w<=1e-11&&s)&&(e.onComplete(e),e.completed=!F):O&&ee?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!v&&(e.completed=!0,!n&&(!a||!F&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,j},ot=(e,t,n,r,i)=>{let a=e._currentIteration;if(at(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=ue(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;H(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&at(t,e,n,1,m.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}H(o,e=>{let t=B((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=at(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},st={},ct=(e,t,n)=>{if(n===f.TRANSFORM)return T.get(e)||e;if(n===f.CSS||n===f.ATTRIBUTE&&R(t)&&e in t.style){let t=st[e];if(t)return t;{let t=e&&ce(e);return st[e]=t,t}}return e},lt=(e,t=!1)=>{if(e._hasChildren)H(e,e=>lt(e,t),!0);else{let n=e;n.pause(),H(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=ge(o)||o===``;if(e._setter){if(!t&&!s){if(W(o,rt),rt.d){let t=rt.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=rt.n;e._setter(e.target,e._number,e)}}else if(a===f.OBJECT)!t&&!s&&(i[r]=o);else if(i[_]){if(a===f.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===f.TRANSFORM){let n=i[y];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=Ve(n):t.removeProperty(`transform`))}else s?t.removeProperty(ce(r)):t[r]=o}}i[_]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},ut=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=C/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?x:t,r=C/n;n>ae.frameRate&&(ae.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?x:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?m.NONE:(this._lastTickTime=n>=t?e-n%t:e,m.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},dt={animation:null,update:O},ft=e=>{let t=dt.animation;return t||(t={duration:x,computeDeltaTime:O,_offset:0,_delay:0,_head:null,_tail:null},dt.animation=t,dt.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===p.COMPLEX||e===p.COLOR?V(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),at(t,1,1,0,m.FORCE)}),t},pt=l?requestAnimationFrame:setImmediate,mt=l?cancelAnimationFrame:clearImmediate,ht=class extends ut{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=ae,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=ue();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(Re(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):ot(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):m.AUTO),r=i}dt.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(ue()),this.reqId=pt(gt)),this}pause(){if(this.reqId)return this.paused=!0,_t()}resume(){if(this.paused)return this.paused=!1,H(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(I.timeScale===1?1:C)}set speed(e){let t=e*I.timeScale;this._speed!==t&&(this._speed=t,H(this,e=>e.speed=e._speed))}get timeUnit(){return I.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(I.timeScale!==r){I.timeScale=r,I.tickThreshold=200*r;let e=n?t:C;this.defaults.duration*=e,this._speed*=e}}get precision(){return I.precision}set precision(e){I.precision=e}},G=(()=>{let e=new ht(ue());return l&&(se.engine=e,d.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(d.hidden?e.pause():e.resume())})),e})(),gt=()=>{G._head?(G.reqId=pt(gt),G.update()):G.reqId=0},_t=()=>(mt(G.reqId),G.reqId=0,G),vt={_rep:new WeakMap,_add:new Map},yt=(e,t,n=`_rep`)=>{let r=vt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},bt=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,xt=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=x,e._currentTime=x},St=(e,t)=>{let n=e._composition;if(n===h.replace){let n=e._absoluteStartTime;ze(t,e,bt,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){xt(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)xt(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=B(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&xt(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(H(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;H(e,e=>{e!==t&&H(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===h.blend){let t=yt(e.target,e.property,`_add`),n=ft(vt._add),r=t._head;r||(r={...e},r._composition=h.replace,r._updateDuration=x,r._startTime=0,r._numbers=V(e._fromNumbers),r._number=0,r._next=null,r._prev=null,ze(t,r),ze(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=V(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=V(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}ze(t,e,null,`_prevAdd`,`_nextAdd`)}return e},Ct=e=>{let t=e._composition;if(t!==h.none){let n=e.target,r=e.property,i=vt._rep.get(n)[r];if(Re(i,e,`_prevRep`,`_nextRep`),t===h.blend){let t=vt._add,i=t.get(n);if(!i)return;let a=i[r],o=dt.animation;Re(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){Re(a,s,`_prevAdd`,`_nextAdd`),Re(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},wt=(e,t,n)=>{let r=!1;return H(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=ct(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===f.TRANSFORM&&i._prev&&i._prev._tweenType===f.TRANSFORM&&(i._prev._renderTransforms=1),Re(t,i),Ct(i),r=!0)}},!0),r},Tt=(e,t,n)=>{let r=t||G,i;if(r._hasChildren){let t=0;H(r,a=>{if(!a._hasChildren){if(i=wt(e,a,n),i&&!a._head)a.cancel(),Re(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?Tt(e,a,n):a._hasChildren=!1},!0),L(r.iterationDuration)||(r.iterationDuration=t)}else i=wt(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},Et=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),Dt=e=>e._cancelled?(e._hasChildren?H(e,Dt):H(e,e=>{e._composition!==h.none&&St(e,yt(e.target,e.property))}),e._cancelled=0,e):e,Ot=0,kt=(e,t)=>e._priority>t._priority,At=class extends ut{constructor(e={},t=null,n=0){super(0),++Ot;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;oe.current&&oe.current.register(this);let b=t?0:G._lastTickTime,x=t?t.defaults:I.defaults,S=he(i)||L(i)?x.delay:+i,C=he(a)||L(a)?1/0:+a,w=U(c,x.loop),T=U(l,x.loopDelay),E=w===!0||w===1/0||w<0?1/0:w+1,D=0;t?D=n:(G.reqId||G.requestTick(ue()),D=(G._lastTickTime-G._startTime)*I.timeScale),this.id=L(r)?Ot:r,this.parent=t,this.duration=Fe((C+T)*E-T)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=E,this._autoplay=!t&&U(u,x.autoplay),this._offset=D,this._delay=S,this._loopDelay=T,this._iterationTime=0,this._currentIteration=0,this._resolve=O,this._running=!1,this._reversed=+U(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=U(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=U(d,x.frameRate),this._speed=U(f,x.playbackRate),this._priority=+U(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return Ne(B(this._currentTime,I.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return Ne(B(this._iterationTime,I.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return Ne(B(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return Ne(B(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*Ne(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return Dt(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,ot(this,0,1,~~e,m.FORCE),Et(this),this._hasChildren&&H(this,Et),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&ot(this,this.duration,1,~~e,m.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!L(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*G._speed);return this._startTime=ue()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?ot(this,x,0,0,m.FORCE):(this._running||=(ze(G,this,kt),G._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,G.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){Dt(this),this.completed=!1;let r=this.paused;return this.paused=!0,ot(this,e+this._delay,~~t,~~n,m.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?ke(S/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?H(this,e=>e.cancel(),!0):H(this,Ct),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=Ie(e);if(t===n)return this;let r=e/t,i=e<=x;return this.duration=i?x:n,this.iterationDuration=i?x:Ie(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){ot(this,0,1,0,m.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=O){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=O};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function jt(e){let t=me(e)?oe.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function Mt(e){if(ge(e))return[];if(!l)return de(e)&&e.flat(1/0)||[e];if(de(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!ge(r)){let e=jt(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!ge(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=jt(e);return t?Array.from(t):[e]}function Nt(e){let t=Mt(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[g]){n[g]=!0;let e=R(n);(n.nodeType||e)&&(n[_]=!0,n[v]=e,n[y]={})}}return t}var Pt={deg:1,rad:180/je,turn:360},Ft={},It=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===p.UNIT&&i===n)return t;let o=a+i+n,s=Ft[o];if(!L(s)&&!r)t.n=s;else{let r;if(i in Pt)r=a*Pt[i]/Pt[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==d?o:d.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,Ft[o]=r}return t.t,p.UNIT,t.u=n,t},Lt=e=>e,Rt=(e=1.68)=>t=>we(t,+e),zt={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},Bt=je/2,Vt=je*2,Ht={"":Rt,Quad:Rt(2),Cubic:Rt(3),Quart:Rt(4),Quint:Rt(5),Sine:e=>1-De(e*Bt),Circ:e=>1-Te(1-e*e),Expo:e=>e?we(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=we(2,--n))-1)/11;);return 1/we(4,3-n)-7.5625*we((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=Ne(+e,1,10),r=Ne(+t,x,2),i=r/Vt*Ae(1/n),a=Vt/r;return e=>e===0||e===1?e:-n*we(2,-10*(1-e))*Ee((1-e-i)*a)}},Ut=(()=>{let e={linear:Lt,none:Lt};for(let t in zt)for(let n in Ht){let r=Ht[n],i=zt[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),Wt={linear:Lt,none:Lt},Gt=e=>{if(Wt[e])return Wt[e];if(e.indexOf(`(`)<=-1){let t=zt[e]||e.includes(`Back`)||e.includes(`Elastic`)?Ut[e]():Ut[e];return t?Wt[e]=t:Lt}{let t=e.slice(0,-1).split(`(`),n=Ut[t[0]];return n?Wt[e]=n(...t[1].split(`,`)):Lt}},Kt=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],qt=e=>{if(me(e)){for(let t=0,n=Kt.length;t<n;t++)if(le(e,Kt[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),Lt}return he(e)?e:me(e)?Gt(e):Lt},K=tt(),q=tt(),Jt={},Yt={func:null},Xt={func:null},Zt=[null],Qt=[null,null],$t={to:null},en=0,tn=0,nn,rn,an=(e,t)=>{let n={};if(de(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(xe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];xe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=U(t.duration,I.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(xe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},on=class extends At{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++tn;let s=Nt(e),c=s.length,l=t.keyframes,u=l?Le(an(l,t),t):t,{id:d,delay:m,duration:g,ease:_,playbackEase:v,modifier:y,composition:b,onRender:S}=u,C=n?n.defaults:I.defaults,T=U(_,C.ease),E=U(v,C.playbackEase),D=E?qt(E):null,O=!L(T.ease),ee=O?T.ease:U(_,D?`linear`:C.ease),k=O?T.settlingDuration:U(g,C.duration),te=U(m,C.delay),ne=y||C.modifier,A=L(b)&&c>=1e3?h.none:L(b)?C.composition:b,j=this._offset+(n?n._offset:0);O&&(T.parent=this);let M=NaN,N=NaN,P=0,F=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(xe(e)){let a=Ze(t,e),o=Ue(t,e),s=ct(e,t,a),m=u[e],g=de(m);if(i&&!g&&(Qt[0]=m,Qt[1]=m,m=Qt),g){let e=m.length,t=!fe(m[0]);e===2&&t?($t.to=m,Zt[0]=$t,nn=Zt):e>2&&t?(nn=[],m.forEach((e,t)=>{t?t===1?(Qt[1]=e,nn.push(Qt)):nn.push(e):Qt[0]=e})):nn=m}else Zt[0]=m,nn=Zt;let _=null,v=null,y=NaN,b=0,x=0;for(let e=nn.length;x<e;x++){let i=nn[x];fe(i)?rn=i:($t.to=i,rn=$t),Yt.func=null,Xt.func=null;let l=Xe(U(rn.composition,A),t,r,c,null,null),u=pe(l)?l:h[l];!_&&u!==h.none&&(_=yt(t,s));let d=_?_._tail:null,f=n&&d&&d.parent.parent===n?d:v,m=Xe(rn.to,t,r,c,Yt,f),g;fe(m)&&!L(m.to)?(rn=m,g=m.to):g=m;let S=Xe(rn.from,t,r,c,Xt,f),C=rn.ease||ee,T=Xe(C,t,r,c,null,f),E=he(T)||me(T)?T:C,D=!L(E)&&!L(E.ease),O=D?E.ease:E,M=D?E.settlingDuration:Xe(U(rn.duration,e>1?Xe(k,t,r,c,null,f)/e:k),t,r,c,null,f),N=Xe(U(rn.delay,x?0:te),t,r,c,null,f),re=rn.modifier||ne,ie=!L(S),ae=!L(g),oe=de(g),I=oe||ie&&ae,se=v?b:0,ce=v?b+N:N,le=B(j+ce,12),ue=B(j+se,12);!F&&(ie||oe)&&(F=1);let R=v;if(u!==h.none){let e=_._head;for(;e&&e._absoluteStartTime<=le;)if(e._isOverridden||(R=e),e=e._nextRep,e&&e._absoluteStartTime>=le)for(;e;)xt(e),e=e._nextRep}if(I){W(oe?Xe(g[0],t,r,c,Xt,f):S,K),W(oe?Xe(g[1],t,r,c,Yt,f):g,q);let e=$e(t,s,a,Jt);K.t===p.NUMBER&&(R?R._valueType===p.UNIT&&(K.t=p.UNIT,K.u=R._unit):(W(e,rt),rt.t===p.UNIT&&(K.t=p.UNIT,K.u=rt.u)))}else ae?W(g,q):v?nt(v,q):W(n&&R&&R.parent.parent===n?R._value:$e(t,s,a,Jt),q),ie?W(S,K):v?nt(v,K):W(n&&R&&R.parent.parent===n?R._value:$e(t,s,a,Jt),K);if(K.o&&(K.n=et(R?R._toNumber:W($e(t,s,a,Jt),rt).n,K.n,K.o)),q.o&&(q.n=et(K.n,q.n,q.o)),K.t!==q.t){if(K.t===p.COMPLEX||q.t===p.COMPLEX){let e=K.t===p.COMPLEX?K:q,t=K.t===p.COMPLEX?q:K;t.t=p.COMPLEX,t.s=V(e.s),t.d=e.d.map(()=>t.n)}else if(K.t===p.UNIT||q.t===p.UNIT){let e=K.t===p.UNIT?K:q,t=K.t===p.UNIT?q:K;t.t=p.UNIT,t.u=e.u}else if(K.t===p.COLOR||q.t===p.COLOR){let e=K.t===p.COLOR?K:q,t=K.t===p.COLOR?q:K;t.t=p.COLOR,t.d=e.d.map(()=>0)}}if(K.u!==q.u){let e=q.u?K:q;e=It(t,e,q.u?q.u:K.u,!1)}if(q.d&&K.d&&q.d.length!==K.d.length){let e=K.d.length>q.d.length?K:q,t=e===K?q:K;t.d=e.d.map((e,n)=>L(t.d[n])?0:t.d[n]),t.s=V(e.s)}let _e=B(+M||1e-11,12),ve=Jt[s];ge(ve)||(Jt[s]=null);let ye=o?o.set:null;b=B(ce+_e,12);let be=K.d,xe=q.d,Se=q.s,z={parent:this,id:en++,property:s,target:t,_value:null,_toFunc:Yt.func,_fromFunc:Xt.func,_ease:qt(O),_fromNumbers:be?V(be):w,_toNumbers:xe?V(xe):w,_strings:Se?V(Se):w,_fromNumber:K.n,_toNumber:q.n,_numbers:be?V(be):w,_number:K.n,_unit:q.u,_modifier:re,_currentTime:0,_startTime:ce,_delay:+N,_updateDuration:_e,_changeDuration:_e,_absoluteStartTime:le,_absoluteUpdateStartTime:ue,_absoluteEndTime:B(j+b,12),_hasFromValue:ie||oe?1:0,_tweenType:a,_setter:ye,_valueType:q.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:ve,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==h.none&&St(z,_);let Ce=z._valueType;if(Ce===p.COMPLEX)z._value=it(z,1,-1);else if(Ce===p.UNIT)z._value=`${re(z._toNumber)}${z._unit}`;else if(Ce===p.COLOR){let e=q.d;z._value=`rgba(${B(e[0],0)},${B(e[1],0)},${B(e[2],0)},${e[3]})`}else z._value=re(z._toNumber);isNaN(y)&&(y=z._startTime),v=z,P++,ze(this,z)}(isNaN(N)||y<N)&&(N=y),(isNaN(M)||b>M)&&(M=b),a===f.TRANSFORM&&(l=P-x,d=P)}if(!isNaN(l)){let e=0;H(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===h.blend&&H(dt.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),N?(H(this,e=>{e._startTime-e._delay||(e._delay-=N),e._startTime-=N}),M-=N):N=0,M||(M=x,this.iterationCount=0),this.targets=s,this.id=L(d)?tn:d,this.duration=M===1e-11?x:Fe((M+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=S||C.onRender,this._ease=D,this._delay=N,this.iterationDuration=M,!this._autoplay&&F&&this.onRender(this)}stretch(e){let t=this.duration;if(t===Ie(e))return this;let n=e/t;return H(this,e=>{e._updateDuration=Ie(e._updateDuration*n),e._changeDuration=Ie(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return H(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(W(n(),K),K.u!==e._unit&&e.target[_]&&It(e.target,K,e._unit,!0),e._fromNumbers=V(K.d),e._fromNumber=K.n):t&&(W($e(e.target,e.property,e._tweenType),rt),e._fromNumbers=V(rt.d),e._fromNumber=rt.n),t&&(W(t(),q),e._toNumbers=V(q.d),e._strings=V(q.s),e._toNumber=q.o?et(e._fromNumber,q.n,q.o):q.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),lt(this)}then(e){return super.then(e)}},sn=(e,t)=>I.editor?I.editor.addAnimation(e,t):new on(e,t,null,0,!1).init(),cn=(e,t)=>{if(le(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},ln=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),L(t))return n;if(pe(+t))return+t;let r=t,i=e?e.labels:null,a=!ge(i),o=cn(e,r),s=!L(o),c=re.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return et(s?o:a?l:n,+t[1],e[0])}return s?o:a?L(i[r])?n:i[r]:n},un=(e,t)=>{if(!L(t))return I.editor&&I.editor.addSet?I.editor.addSet(e,t):(t.duration=x,t.composition=U(t.composition,h.none),new on(e,t,null,0,!0).resume())},dn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},fn=0,pn=(e,t=0,n=1,r=0)=>{let i=e===void 0?fn++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},mn=(e,t=dn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},hn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!L(c),u=l&&!L(c.ease)?c.ease:l?qt(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=L(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=de(o),b=de(e),x=t.use,S=Ce(b?e[0]:e),C=b?Ce(e[1]):0,w=P.exec((b?e[1]:e)+``),T=t.start||0+(b?S:0),E=t.seed,D=!L(E)&&E!==!1?pn(E===!0?0:E):dn,O=t.jitter,ee=!L(O),k=de(O),te=k?O[0]:O||0,ne=k?O[1]:O||0,A=h?0:pe(o)?o:0;return(e,c,l,h,E)=>{let[O]=Nt(e),k=L(m)?l.length:m,j=L(x)?!1:he(x)?x(O,c,k):$e(O,x),M=pe(j)||me(j)&&pe(+j)?+j:c,N=M>=0&&M<k?M:c;if(g&&(A=(k-1)/2),_&&(A=k-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<k;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&he(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&pe(e.x)&&pe(e.y)&&(p=e.x,h=e.y,pe(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[k-1],l=f[k-1],h=m[k-1]):pe(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<k;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=Te(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<k;e++){let t=Oe(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<k;e++)n[e]=n[e]/v}else for(let e=0;e<k;e++)n.push(Oe(A-e))}else for(let e=0;e<k;e++)if(!d)n.push(Oe(A-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=A%d[0],a=ke(A/d[0])%d[1],s=t===3?ke(A/r):0);let c=e%d[0],l=ke(e/d[0])%d[1],u=t===3?ke(e/r):0,f=i-c,m=a-l,h=s-u,_=Te(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<k;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<k;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:Oe(r-t)),n[e]=t}if(ee){a=Array(k);for(let e=0;e<k;e++)a[e]=D(-1,1,4)}v&&(n=mn(n,D))}let P=b?(C-S)/r:S;L(i)&&(i=E?ln(E,L(t.start)?E.iterationDuration:T):T);let F=i+(P*B(n[N],2)||0);if(ee){let e=r?n[N]/r:0,t=te+(ne-te)*e;F+=a[N]*t}return t.modifier&&(F=t.modifier(F)),w&&(F=`${F}${w[2]}`),F}},gn=o(),_n=a(),J=r(i(),1);function vn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function yn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function bn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&vn(),[i,a]=(0,J.useState)(0),o=(0,J.useRef)(0);return(0,J.useEffect)(()=>{if(!r)return;let e={n:o.current},i=sn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{o.current=e.n,a(e.n)},onComplete:()=>{o.current=n,a(n)}}),s=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(s),i.pause()}},[n,t,r]),r?i:n}function xn({value:e,duration:t}){let n=bn(e,t);return n===null?e??null:Math.round(n)}function Sn(e){let t=(0,J.useRef)(null),n=(0,J.useRef)(null),r=(0,J.useRef)(()=>{}),i=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&vn()){let e=sn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else un(o,l)}},r.current(!0))}),(0,J.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function Cn(){let e=(0,J.useRef)(null),t=(0,J.useRef)(null);return(0,J.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&vn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?yn(sn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&yn(sn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var wn={overview:`Overview`,laws:`Constitution`,library:`Library`,loops:`Loops`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},Tn={loops:[`templates`,`bricks`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`edits`,`doctor`,`server`]},En={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},Dn={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},On=(e,t)=>t!==void 0&&Object.hasOwn(e,t),kn=(e,t)=>Tn[e].includes(t)?t:Tn[e][0];function An(t){let n=(t||`#/`).slice(2).split(`/`).filter(Boolean),[r,i,a]=n,o=e=>decodeURIComponent(e||``);if(r===`section`||r===`item`){let t=r===`item`&&On(e,i)?e[i]:i,n=r===`item`?o(a):void 0;return{page:t===`laws`?`laws`:`library`,section:t,item:n}}if(r===`docs`)return{page:`docs`,item:o(n.slice(1).join(`/`))};if(r===`activity`&&i)return{page:`activity`,item:o(i)};if(r===`skills`||r===`agents`)return{page:`library`,section:r};if(On(Tn,r)){let e=kn(r,i);return a&&e===i?{page:r,tab:e,item:o(a)}:{page:r,tab:e}}if(On(Dn,r)){let[e,t]=Dn[r];return t?{page:e,tab:t}:{page:e}}return{page:On(wn,r)?r:`overview`}}function jn(){let e=()=>An(typeof window<`u`?window.location.hash:``),[t,n]=(0,J.useState)(e);return(0,J.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var Mn=e=>{window.location.hash=e},Nn={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},Pn={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},Fn=e=>Nn[e]||Nn.cyan,In={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`},Ln=e=>e===`yellow`||e===`white`||e===`cyan`||e===`green`?`#06100D`:`#FFFFFF`;function Rn(e,t,n){if(!e)return;let r=n===`light`,i=r?Pn[t]||Pn.cyan:Fn(t),a=r?`#FFFFFF`:Ln(t);r&&t===`white`&&(i=`#566B62`,a=`#FFFFFF`),e.style.setProperty(`--accent`,i),e.style.setProperty(`--accent-2`,Pn[t]||Pn.cyan),e.style.setProperty(`--accent-ink`,a),e.style.setProperty(`--accent-text`,r?In[t]||In.cyan:i),t===`yellow`?e.style.setProperty(`--warn`,r?`#B4521C`:`#F08A4B`):e.style.removeProperty(`--warn`)}var zn={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`,inkLight:`#FFFFFF`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`,inkLight:`#FFFFFF`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`,inkLight:`#FFFFFF`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`,inkLight:`#FFFFFF`}};function Bn(e,t,n){let r=zn[t];if(!e||!r)return!1;let i=n===`light`;return e.style.setProperty(`--accent`,i?r.light:r.dark),e.style.setProperty(`--accent-2`,r.light),e.style.setProperty(`--accent-ink`,i?r.inkLight:r.ink),e.style.setProperty(`--accent-text`,i?r.light:r.dark),!0}var Vn=`#101317`,Hn=`#F4F6F8`,Un=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},Wn=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),Gn=e=>{let[t,n,r]=Un(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},Kn=(e,t)=>{let[n,r]=[Gn(e),Gn(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},qn=(e,t,n)=>{let r=Un(e),i=Un(t);return Wn(r.map((e,t)=>e+(i[t]-e)*n))},Jn=(e,t,n,r)=>{let i=e;for(let a=.05;Kn(i,t)<n&&a<=1.0001;a+=.05)i=qn(e,r,a);return i},Yn=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Xn(e,t){let n=t===`light`,r=n?Hn:Vn,i=n?`#000000`:`#FFFFFF`,a=Jn(e,r,3,i),o=Jn(a,r,4.5,i),s=Kn(a,`#06100D`)>=Kn(a,`#FFFFFF`)?`#06100D`:`#FFFFFF`;return{accent:a,accent2:Jn(a,r,4.5,i),ink:s,text:o}}function Zn(e,t,n){if(!e||!Yn(t))return!1;let r=Xn(t,n);return e.style.setProperty(`--accent`,r.accent),e.style.setProperty(`--accent-2`,r.accent2),e.style.setProperty(`--accent-ink`,r.ink),e.style.setProperty(`--accent-text`,r.text),!0}function Qn(e,t){let[n,r]=(0,J.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return[n,(0,J.useCallback)(t=>r(n=>{let r=typeof t==`function`?t(n):t;try{localStorage.setItem(e,r)}catch{}return r}),[e])]}var $n=`geneseed-mode`;function er(){let[e,t]=Qn($n,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var tr=`geneseed-flavour`,nr=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],rr=new Set(nr.map(e=>e.id)),ir={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function ar(){return Qn(tr,or)}function or(e){return rr.has(e)?e:ir[e]||`cultivar`}var sr=`geneseed-accent`,cr=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],lr=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:Fn(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),ur=[...cr,...lr],dr=new Set(ur.map(e=>e.id)),fr=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return Yn(t)?t.toUpperCase():null},pr=e=>e&&(dr.has(e)||fr(e))?e:`curated`,mr=e=>lr.find(t=>t.id===e)?.name??null,hr=e=>{let t=fr(e);return t?`Your own colour, ${t}.`:ur.find(t=>t.id===e)?.tagline??``};function gr(){return Qn(sr,pr)}var _r=`geneseed-layout`,vr=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],yr=new Set(vr.map(e=>e.id));function br(e){return e&&yr.has(e)?e:`overview`}function xr(){return Qn(_r,br)}function Sr(e){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)([]),s=()=>c.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,J.useEffect)(()=>{s()},[]),(0,J.useEffect)(()=>{c.themes().then(e=>o(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:a,reload:s}}var Cr=1e3,wr=e=>new Promise(t=>setTimeout(t,e));async function Tr(){try{return(await c.ping()).pid??null}catch{return null}}async function Er(e=0,t=null){await wr(e);for(let e=0;e<30;e++){let e=await Tr();if(e!==null&&e!==t)break;await wr(Cr)}window.location.reload()}async function Dr(){let e=await Tr();try{await c.restart()}catch(e){if(e.status)throw e}await Er(Cr,e)}var Or=600;function kr({onFinish:e,onError:t}={}){let[n,r]=(0,J.useState)([]),[i,a]=(0,J.useState)(null),[o,s]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{c.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(a(t.id),s(!0))}).catch(()=>{})},[]),(0,J.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i)?.action===`update`,o=null;t&&Tr().then(e=>o=e);let s=setInterval(async()=>{if(!document.hidden)try{let n=await c.job(i);if(r(e=>{let t=e.findIndex(e=>e.id===i);if(t===-1)return e;let r=e[t],a=n.output||``;if(r.output===a&&r.status===n.status&&r.duration===n.duration)return e;let o=e.slice();return o[t]={...r,output:a,status:n.status,duration:n.duration},o}),n.status!==`running`){if(clearInterval(s),a(null),t){Er(2e3,o);return}e?.(n.status)}}catch{if(!t)return;clearInterval(s),Er(0,o)}},Or);return()=>clearInterval(s)},[i]),{runs:n,activeId:i,consoleOpen:o,setConsoleOpen:s,runAction:async(e,n)=>{try{let{job_id:t}=await c.action(e,n),i=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:i,status:`running`,output:``,started:Date.now()/1e3}]),a(t),s(!0),t}catch(e){t?.(e)}},cancelJob:e=>c.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var Ar=new Map;function Y(e,t=[],n=null){let r=n===null?null:`${n}|${t.join(``)}`,[i,a]=(0,J.useState)(()=>r!==null&&Ar.has(r)?Ar.get(r):null),[o,s]=(0,J.useState)(``),[c,l]=(0,J.useState)(()=>!(r!==null&&Ar.has(r))),u=(0,J.useRef)(e),d=(0,J.useRef)(r);(0,J.useLayoutEffect)(()=>{u.current=e,d.current=r});let f=(0,J.useCallback)(()=>(l(!0),s(``),Promise.resolve(u.current()).then(e=>{d.current!==null&&Ar.set(d.current,e),a(e)}).catch(e=>s(e.message)).finally(()=>l(!1))),t);return(0,J.useEffect)(()=>{if(d.current!==null&&Ar.has(d.current)){a(Ar.get(d.current)),s(``),l(!1);return}f()},[f]),{data:i,error:o,loading:c,reload:f,setData:a}}var jr=60,Mr=3600,Nr=86400,Pr={seconds:90,minutes:5400,hours:36*Mr};function Fr(e){let t=Math.max(0,Date.now()/1e3-e);return t<Pr.seconds?`${Math.round(t)}s`:t<Pr.minutes?`${Math.round(t/jr)}m`:t<Pr.hours?`${Math.round(t/Mr)}h`:`${Math.round(t/Nr)}d`}function Ir(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var Lr={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function Rr(e,t){if(!e)return 0;let n=e.doctor?.problems?.length??99,r=e.doctor?.ok?Lr.doctorClean:n<=Lr.doctorMinorMax?Lr.doctorMinor:Lr.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?Lr.deployed:0)+r+(i?Lr.versionSynced:0)+(e.diff&&e.diff.missing===0?Lr.diskClean:0)}var zr=e=>Math.max(...n.map(t=>e?.[t]??0),1),Br=e=>(e?.edited??0)+(e?.added??0),Vr=e=>(e?.laws??0)+(e?.doctrines?.rules??0),X=s(),Hr={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,loop:`M19.5 9A8 8 0 1 1 15 4.6M15 1.5l.2 3.3-3.2.8`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function Z({name:e,className:t=`glyph`,style:n}){return(0,X.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,X.jsx)(`path`,{d:Hr[e]||``})})}function Ur({className:e=`sprout`}){return(0,X.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,X.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,X.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,X.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var Wr=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,short:`Laws`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,count:e=>e?.counts?.loops??null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],Gr=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function Kr({n:e,lit:t,count:n,onNavigate:r}){return(0,X.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,X.jsx)(Z,{name:e.icon}),(0,X.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,X.jsx)(`span`,{className:`sb-count`,children:n})]})}function qr({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=Br(e.diff)+(e.diff?.missing??0);return(0,X.jsxs)(`div`,{className:`sb-vitals`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`doctor`}),(0,X.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`drift`}),(0,X.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`span`,{children:`built`}),(0,X.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${Fr(e.build_epoch)} ago`:`never`})]}),(0,X.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,children:[(0,X.jsx)(`span`,{children:`voice`}),(0,X.jsxs)(`b`,{children:[e.theme||`none`,(0,X.jsx)(Z,{name:`chevron`})]})]})]})}function Jr({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,X.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,X.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{Mn(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,X.jsx)(`span`,{className:`sb-mark`,children:(0,X.jsx)(Ur,{})}),(0,X.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,X.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,X.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),Wr.map(r=>(0,X.jsx)(Kr,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page)),(0,X.jsx)(`div`,{className:`sb-spacer`}),Gr.map(t=>(0,X.jsx)(Kr,{n:t,lit:e.page===t.page,onNavigate:i},t.page)),(0,X.jsx)(qr,{overview:t,onOpenVoice:r})]})}function Yr({route:e}){return(0,X.jsx)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:Wr.map(t=>(0,X.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,X.jsx)(Z,{name:t.icon}),t.short||t.label]},t.page))})}var Xr=[{id:`opencode`,label:`OpenCode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`openclaude`,label:`OpenClaude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Zr=e=>Xr.find(t=>t.id===e)||Xr[0],Qr=(e,t)=>t===`project`?Zr(e).removeProject:Zr(e).removeGlobal,$r=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,ei=e=>e.scope===`global`?Zr(e.host).label:$r(e.path),ti=`geneseed-harness`,ni=Xr.map(({id:e,label:t})=>({id:e,label:t}));function ri(e=`opencode`){let[t,n]=Qn(ti,e=>ni.some(t=>t.id===e)?e:null);return[t??e,n]}function ii(e){let t=String(e||``);return Xr.find(e=>t.startsWith(e.id))?.id||`opencode`}function ai(e=0){let[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(``),s=(0,J.useRef)(null),[l]=ri(),u=`${e}|${l}`,[d,f]=(0,J.useState)(u);return d!==u&&(f(u),i(null)),(0,J.useEffect)(()=>{s.current=null},[u]),{index:r,error:a,prime:(0,J.useCallback)(()=>{if(r||s.current)return s.current;let e=(async()=>{let e=Object.entries(wn).flatMap(([e,t])=>(Tn[e]||[``]).map(n=>{let r=n?t+` / `+En[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}})),r=[`laws`,`skills`,...n],a=await Promise.all(r.map(async e=>{try{return{sec:e,items:(await c.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of a){let a=t[n];for(let t of i){let i=t.title||t.name;e.push({kind:a.label,sortKey:r.indexOf(n),title:i,desc:t.desc||``,hay:`${i} ${t.desc||``} ${t.name||``}`.toLowerCase(),route:`#/item/${a.type}/${encodeURIComponent(t.name)}`})}}try{let t=await c.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await c.docs(l);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``} ${t.section||``} ${t.description||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return i(e),s.current=null,e})().catch(e=>(s.current=null,o(e.message||String(e)),[]));return s.current=e,e},[r,l])}}var oi=24;function si(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function ci(e,t){let n=t.toLowerCase().trim();if(!n||!e)return[];let r=[];for(let t of e){let e=si(t,n);e>=0&&r.push({e:t,s:e})}return r.sort((e,t)=>e.s-t.s||e.e.sortKey-t.e.sortKey||e.e.title.localeCompare(t.e.title)),r.slice(0,oi).map(e=>e.e)}function li(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,X.jsxs)(X.Fragment,{children:[e.slice(0,r),(0,X.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function ui({query:e,index:t,loading:n,error:r,active:i,onActive:a,onClose:o}){let s=(0,J.useMemo)(()=>ci(t,e),[t,e]),c=(0,J.useRef)(null),l=s.length>0;(0,J.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);return!l||!e?.length||!vn()?void 0:yn(sn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:hn(18),ease:`outQuart`}),220+18*e.length)},[l]),(0,J.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,J.useEffect)(()=>{(c.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let u=e=>{e&&(Mn(e.route),o())},d=[],f=null;return s.forEach((e,t)=>{(!f||f.kind!==e.kind)&&(f={kind:e.kind,rows:[]},d.push(f)),f.rows.push({entry:e,index:t})}),e.trim()?(0,X.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[r&&!t&&(0,X.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),n&&!t&&!r&&(0,X.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),!n&&s.length===0&&t&&(0,X.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]}),d.map(t=>(0,X.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,X.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,X.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),u(t)},onMouseEnter:()=>a(n),children:[(0,X.jsx)(`div`,{className:`spot-title`,children:li(t.title,e)}),t.desc?(0,X.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route}-${n}`))]},t.kind))]}):null}function di({value:e,onChange:t,dataRev:n}){let r=(0,J.useRef)(null),i=(0,J.useRef)(null),[a,o]=(0,J.useState)(!1),[s,c]=(0,J.useState)(0),{index:l,error:u,prime:d}=ai(n);(0,J.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),r.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,J.useEffect)(()=>{if(!a)return;let e=e=>{i.current?.contains(e.target)||o(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[a]);let f=a&&!!e.trim(),p=f&&l?ci(l,e):[],m=s<p.length?`spot-opt-${s}`:void 0;return(0,X.jsxs)(`div`,{className:`tb-search`,ref:i,children:[(0,X.jsx)(Z,{name:`search`,className:`mag glyph`}),(0,X.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search the harness`,"aria-autocomplete":`list`,"aria-expanded":f,"aria-controls":f?`spotlight-list`:void 0,"aria-activedescendant":m,value:e,onChange:e=>{t(e.target.value),c(0)},onFocus:()=>{o(!0),d()},onKeyDown:n=>{if(f){if(n.key===`ArrowDown`)n.preventDefault(),c(e=>Math.min(e+1,Math.max(p.length-1,0)));else if(n.key===`ArrowUp`)n.preventDefault(),c(e=>Math.max(e-1,0));else if(n.key===`Enter`){let e=p[s];e&&(n.preventDefault(),Mn(e.route),o(!1),r.current?.blur())}else n.key===`Escape`&&(n.preventDefault(),e?t(``):(o(!1),r.current?.blur()))}},placeholder:`Search the harness…`,title:`Press / to jump here, or Ctrl-K / ⌘K from inside any field`}),(0,X.jsx)(`span`,{className:`kbd`,children:`Ctrl K`}),(0,X.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:f?p.length?`${p.length} results`:`no matches`:``}),f&&(0,X.jsx)(ui,{query:e,index:l,loading:!l,error:u,active:s,onActive:c,onClose:()=>{o(!1),r.current?.blur()}})]})}function fi({installs:e,onSwitch:t}){let n=(e||[]).filter(e=>e.state===`active`);if(n.length<2)return null;let r=n.find(e=>e.selected)||n[0];return(0,X.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:r.id,onChange:async e=>{let r=n.find(t=>t.id===e.target.value);if(r)try{await c.selectView(r.host,r.path),t?.()}catch{}},children:n.map(e=>(0,X.jsx)(`option`,{value:e.id,children:e.scope===`global`?`${e.host} · global`:`${ei(e)} · ${e.host}`},e.id))})}function pi({children:e,...t}){let n=Sn(`button.on`);return(0,X.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,X.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function mi({value:e,onChange:t,labelledBy:n}){let r=fr(e);return(0,X.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[cr.map(n=>(0,X.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,X.jsxs)(`div`,{className:`accent-swatches`,children:[lr.map(n=>(0,X.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,X.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,X.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function hi({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o}){let s=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&!e.target.closest?.(`.tb-pop-anchor`)&&o()},t=e=>{e.key===`Escape`&&o()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[o]);let c=(e,t,n,r,i)=>(0,X.jsxs)(`div`,{className:`ap-group`,children:[(0,X.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,X.jsx)(pi,{"aria-labelledby":e,children:n.map(e=>(0,X.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,X.jsxs)(`div`,{className:`appearance-pop`,ref:s,role:`dialog`,"aria-label":`Appearance`,children:[c(`ap-skin`,`Skin`,nr,e,t),(0,X.jsxs)(`div`,{className:`ap-group`,children:[(0,X.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,X.jsx)(mi,{value:n,onChange:r,labelledBy:`ap-accent`})]}),c(`ap-view`,`Overview view`,vr,i,a)]})}function gi({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,query:a,onQuery:o,mode:s,onToggleMode:c,appearance:l,dataRev:u,onSwitch:d}){let[f,p]=(0,J.useState)(!1),m=r?.install,h=m?`${m.host}:${m.scope}`:Ir(r?.target),g=e.tab&&En[e.tab];return(0,X.jsxs)(`header`,{className:`topbar`,children:[(0,X.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,X.jsx)(Z,{name:t?`x`:`menu`})}),(0,X.jsxs)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:[(0,X.jsx)(`span`,{className:`crumb-root mono`,title:r?.target||void 0,children:h}),(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,X.jsx)(`span`,{className:g?``:`crumb-here`,"aria-current":g?void 0:`page`,children:wn[e.page]}),g?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,children:`/`}),(0,X.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:g})]}):null]}),(0,X.jsx)(`div`,{className:`topbar-spacer`}),(0,X.jsx)(fi,{installs:i,onSwitch:d}),(0,X.jsx)(di,{value:a,onChange:o,dataRev:u}),(0,X.jsxs)(`div`,{className:`tb-pop-anchor`,children:[(0,X.jsx)(`button`,{type:`button`,className:`iconbtn`,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":f,onClick:()=>p(e=>!e),children:(0,X.jsx)(Z,{name:`themes`})}),f?(0,X.jsx)(hi,{...l,onClose:()=>p(!1)}):null]}),(0,X.jsx)(`button`,{type:`button`,className:`iconbtn`,title:s===`light`?`Switch to dark`:`Switch to light`,"aria-label":s===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:c,children:(0,X.jsx)(Z,{name:s===`light`?`moon`:`sun`})})]})}function _i({themes:e,current:t,onPick:n,onClose:r}){let i=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,J.useEffect)(()=>{i.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,X.jsxs)(`div`,{className:`pop`,ref:i,role:`menu`,"aria-label":`Switch voice`,children:[(0,X.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,X.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:()=>n(e.name),children:[(0,X.jsx)(`span`,{className:`po`,style:{background:Fn(e.accent),boxShadow:`0 0 8px ${Fn(e.accent)}`}}),(0,X.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var vi=3500;function yi({toast:e,onClose:t}){return(0,J.useEffect)(()=>{let e=setTimeout(t,vi);return()=>clearTimeout(e)},[e]),(0,X.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:`status`,"aria-live":e.kind===`err`?void 0:`polite`,children:[(0,X.jsx)(`div`,{children:e.msg}),(0,X.jsx)(`div`,{style:{marginTop:8},children:(0,X.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})}function bi({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,J.useRef)(null),c=(0,J.useRef)(null);(0,J.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let l=e.length?e[e.length-1].output.length:0;return(0,J.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,l,t]),(0,X.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,X.jsxs)(`div`,{className:`console-head`,ref:c,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,X.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,X.jsxs)(`span`,{className:`ttl`,children:[(0,X.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,X.jsx)(`span`,{className:`count`,children:e.length}),(0,X.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,X.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,X.jsx)(Z,{name:`clear`})}),(0,X.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,X.jsx)(Z,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,X.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,X.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,X.jsxs)(`div`,{className:`run`,children:[(0,X.jsxs)(`div`,{className:`run-head`,children:[(0,X.jsx)(`span`,{className:`pr`,children:`$`}),(0,X.jsx)(`span`,{className:`act`,children:e.action}),(0,X.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,X.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,X.jsx)(Z,{name:`x`})})]}),e.output&&(0,X.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var xi=550,Si=`gs-splash-seen`;function Ci(){try{if(window.localStorage.getItem(Si))return 0;window.localStorage.setItem(Si,`1`)}catch{}return xi}function wi({ready:e,onDone:t}){let[n,r]=(0,J.useState)(!1),[i,a]=(0,J.useState)(!1);return(0,J.useEffect)(()=>{let e=setTimeout(()=>r(!0),Ci());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,J.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,X.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,X.jsxs)(`div`,{className:`boot-dial`,children:[(0,X.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,X.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,X.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,X.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,X.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,X.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,X.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,X.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,X.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,X.jsxs)(`div`,{className:`boot-status`,children:[(0,X.jsx)(`span`,{children:`germinating harness`}),(0,X.jsx)(`span`,{className:`boot-caret`})]})]})}function Ti({label:e=`Loading…`}){return(0,X.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,X.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,X.jsx)(`div`,{className:`skel-bar`}),(0,X.jsx)(`div`,{className:`skel-bar`}),(0,X.jsx)(`div`,{className:`skel-bar`})]})]})}function Ei({open:e,title:t,children:n,confirmLabel:r,onConfirm:i,onClose:a}){let o=(0,J.useRef)(null);return(0,J.useEffect)(()=>{let t=o.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e]),(0,X.jsxs)(`dialog`,{ref:o,className:`confirm`,onCancel:a,onClose:a,children:[(0,X.jsx)(`h3`,{className:`confirm-title`,children:t}),(0,X.jsx)(`div`,{className:`confirm-body`,children:n}),(0,X.jsxs)(`div`,{className:`confirm-actions`,children:[(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:a,children:`Cancel`}),(0,X.jsx)(`button`,{type:`button`,className:`btn`,onClick:i,autoFocus:!0,children:r||`Confirm`})]})]})}var Di=(0,J.createContext)(null),Oi=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function ki(){return(0,J.useContext)(Di)||Oi}function Ai({children:e}){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,J.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,X.jsxs)(Di.Provider,{value:a,children:[e,(0,X.jsx)(Ei,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}function ji({error:e,style:t}){return e?(0,X.jsx)(`p`,{className:`badge bad`,style:t,children:e}):null}function Mi({onAction:e}){let{data:t,error:n}=Y(()=>c.themes(),[]),[r,i]=(0,J.useState)(``),[a,o]=(0,J.useState)(``);if(n)return(0,X.jsx)(ji,{error:n});if(!t)return(0,X.jsx)(Ti,{});let s=r||t.current?.theme||`neutral`,l=t.emits?.some(e=>e.name===`opencode-global`),u=a||(l?`opencode-global`:t.current?.emit||t.emits?.[0]?.name||``),d=i,f=o;return(0,X.jsxs)(`div`,{className:`narrow-lg`,children:[(0,X.jsx)(`div`,{className:`head-row mb-18`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,X.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,X.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,X.jsx)(`div`,{className:`card-head`,children:(0,X.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,X.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,X.jsxs)(`button`,{className:`btn ${e.name===s?`soft`:`ghost`}`,onClick:()=>d(e.name),title:e.blurb||e.tagline||e.name,children:[(0,X.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:Fn(e.accent),boxShadow:`0 0 8px ${Fn(e.accent)}`}}),(0,X.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,X.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,X.jsx)(`div`,{className:`card-head`,children:(0,X.jsx)(`h3`,{children:`2 · Install mode`})}),(0,X.jsxs)(`p`,{className:`sub mb-16`,children:[(0,X.jsx)(`code`,{children:`opencode-global`}),` deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory.`]}),(0,X.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,X.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,X.jsx)(`select`,{className:`sel`,value:u,onChange:e=>f(e.target.value),children:t.emits.map(e=>(0,X.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]})]}),(0,X.jsxs)(`button`,{className:`btn btn-grid`,disabled:!s||!u,onClick:()=>e(`build`,{theme:s,emit:u}),children:[(0,X.jsx)(Z,{name:`build`}),`Deploy harness`]})]})}var Q={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},Ni={security:{label:`Security`,c:Q.security},verify:{label:`Verification`,c:Q.verify},process:{label:`Process`,c:Q.process},craft:{label:`Craft`,c:Q.craft},context:{label:`Context`,c:Q.context},comms:{label:`Communication`,c:Q.comms}},Pi={craft:Q.craft,rigor:Q.verify,ops:Q.process,process:Q.security,comms:Q.comms},Fi=e=>Pi[e]||`var(--text-3)`,Ii={design:{label:`Design`,c:Q.context},build:{label:`Build`,c:Q.craft},review:{label:`Review`,c:Q.security},ship:{label:`Ship`,c:Q.process},understand:{label:`Understand`,c:Q.verify},learn:{label:`Learn`,c:Q.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},Li=Object.keys(Ii);function Ri(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var zi=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],Bi=e=>{let t=``;for(let[n,r]of zi)for(;e>=n;)t+=r,e-=n;return t};function Vi(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?Bi(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var Hi=new Set([`I`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),Ui=e=>Hi.has(e)?`Hook gate`:`Instruction`;function Wi(e){let t={};for(let n of e||[]){let e=Ii[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:Ii[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=Li.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}var $=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function Gi({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${$(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=l?Br(l)+(l.missing??0):0;u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${$(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=Vi(e),i=(o?.items||[]).find(e=>e.name===r),a=i?Ri(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${$(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=Wi(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${$(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var Ki=e=>e.drift?e.drift.edited+e.drift.added+e.drift.missing:0;function qi(e){let t=e?.installs||[],n=t.filter(e=>e.state===`active`),r=t.length-n.length,i=n.filter(e=>e.verdict===`behind`).length,a=n.reduce((e,t)=>e+Ki(t),0),o=e?.doctor,s=o&&!o.ok?`bad`:i||a?`warn`:`good`;return{tone:s,head:{good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[s],facts:[$(n.length,`active install`)+(r?`, ${r} disabled`:``),o?o.ok?`doctor clean`:`doctor found ${$(o.problems.length,`problem`)}`:`doctor not run yet`,i?`${$(i,`install`)} behind source`:`all in step with source`,a?`${$(a,`file`)} hand-edited`:`no hand edits`]}}var Ji=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],Yi=e=>e?e.carrier+e.skills+e.agents+e.context:0,Xi=e=>`≈${(e/4/1e3).toFixed(1)}k`,Zi=e=>`${e.host} · ${e.scope}`;function Qi({fleet:e,usage:t,...n}){let r=[],i=e?.doctor;i&&!i.ok&&r.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${$(i.problems.length,`problem`)}`,detail:i.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){t.verdict===`behind`&&r.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${Zi(t)} is behind its source`,detail:t.built_epoch?`built ${Fr(t.built_epoch)} ago`:`never built`,where:t.host,verb:`Rebuild`,act:`build-all`});let e=Ki(t);e&&r.push({id:`drift:${t.id}`,tag:`Drift`,tone:`warn`,title:`${Zi(t)}: ${$(e,`file`)} edited by hand`,detail:`${t.drift.edited} edited, ${t.drift.added} added, ${t.drift.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`})}if(t&&t.days_counted>=30&&t.never?.length){let e=t.never.filter(e=>e.kind===`skill`).length;r.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${$(e,`skill`)} never fired in 30 days`,detail:`${$(t.never.length-e,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let a=Gi({...n,overview:n.overview&&{...n.overview,doctor:null,diff:null}});for(let e of a)r.push({...e,sugg:!0});return r}function $i(e,t){return(e?.rules||[]).map(e=>{let n=Vi(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?Ri(r.title).name:e.rule===`wiki`?`Wiki guard`:n}})}var ea=e=>e.catch(()=>null),ta=(e,t)=>`${t?Math.min(100,e/t*100):0}%`;function na({update:e,onAction:t}){return e?e.latest===null?(0,X.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · update check unavailable`]}):e.available?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,X.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}),(0,X.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>t(`update`),children:`Update`})]}):(0,X.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):null}function ra({fleet:e}){let t=qi(e);return(0,X.jsxs)(`div`,{className:`health ${t.tone}`,role:`status`,children:[(0,X.jsx)(`span`,{className:`health-dot`,"aria-hidden":`true`}),(0,X.jsxs)(`p`,{className:`verdict-facts`,children:[(0,X.jsx)(`b`,{children:t.head}),t.facts.map(e=>(0,X.jsx)(`span`,{className:`muted`,children:e},e))]})]})}function ia({chars:e}){let t=bn(e);return(0,X.jsxs)(`span`,{className:`mono`,children:[Xi(t??e),` tok`]})}function aa({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,X.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,X.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,X.jsx)(`circle`,{className:`fg`+(e.ceiling&&e.carrier>e.ceiling?` over`:``),cx:`18`,cy:`18`,r:14,strokeDasharray:n.toFixed(2),strokeDashoffset:(n*(1-r)).toFixed(2),style:{"--circ":n.toFixed(2),"--i":t}})]})}function oa({i:e,n:t,onAction:n,onOpen:r}){let i=(0,X.jsxs)(`td`,{children:[(0,X.jsx)(`span`,{className:`ldg-host`,children:e.host}),` `,(0,X.jsx)(`span`,{className:`dim`,children:e.scope}),(0,X.jsx)(`div`,{className:`mono dim ldg-path`,children:e.path})]});if(e.state!==`active`)return(0,X.jsxs)(`tr`,{className:`ldg-off`,children:[i,(0,X.jsxs)(`td`,{children:[e.theme,` `,(0,X.jsxs)(`span`,{className:`dim`,children:[`· `,e.footprint]})]}),(0,X.jsx)(`td`,{children:(0,X.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{}),(0,X.jsx)(`td`,{className:`ldg-act`,children:(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>r(e),children:`Open`})})]});let a=e.drift?e.drift.edited+e.drift.added+e.drift.missing:0,o={synced:(0,X.jsx)(`span`,{className:`pill good`,children:`in step`}),behind:(0,X.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,X.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],s=Yi(e.cost);return(0,X.jsxs)(`tr`,{children:[i,(0,X.jsxs)(`td`,{children:[e.theme,` `,(0,X.jsxs)(`span`,{className:`dim`,children:[`· `,e.footprint]})]}),(0,X.jsx)(`td`,{children:o}),(0,X.jsx)(`td`,{children:e.diffable?a?(0,X.jsxs)(`span`,{className:`mono t-warn`,children:[a,` edited`]}):(0,X.jsx)(`span`,{className:`mono dim`,children:`none`}):(0,X.jsx)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:`not checkable`})}),(0,X.jsx)(`td`,{children:e.cost?(0,X.jsxs)(`div`,{className:`ldg-cost`,title:`root file ${Math.round(e.cost.carrier/e.cost.ceiling*100)}% of the ${e.footprint} ceiling`,children:[(0,X.jsx)(aa,{cost:e.cost,i:t}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(ia,{chars:s}),(0,X.jsxs)(`span`,{className:`dim ldg-sub`,children:[`root file `,Math.round(e.cost.carrier/e.cost.ceiling*100),`% of ceiling`]})]})]}):(0,X.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,X.jsx)(`td`,{className:`mono dim`,children:e.built_epoch?`${Fr(e.built_epoch)} ago`:`never`}),(0,X.jsx)(`td`,{className:`ldg-act`,children:e.verdict===`behind`||a?(0,X.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>n(`build-all`),children:`Rebuild`}):(0,X.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:()=>r(e),children:`Open`})})]})}function sa({rows:e,onAction:t}){let n=e.filter(e=>!e.sugg).length;return(0,X.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,X.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,X.jsx)(`h2`,{id:`ldg-needs`,children:`Needs attention`}),(0,X.jsxs)(`span`,{className:`mono dim`,children:[n,` problem`,n===1?``:`s`,`, `,e.length-n,` suggestion`,e.length-n===1?``:`s`]})]}),e.length?(0,X.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,X.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,X.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,X.jsxs)(`span`,{className:`needs-what`,children:[(0,X.jsx)(`b`,{children:e.title}),e.detail?(0,X.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,X.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),e.act?(0,X.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,onClick:()=>t(e.act),children:e.verb}):(0,X.jsx)(`a`,{className:`needs-verb`,href:e.href,children:e.verb})]},e.id))}):(0,X.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function ca({installs:e}){let t=e.filter(e=>e.state===`active`&&e.cost),n=Math.max(1,...t.map(e=>Math.max(Yi(e.cost),e.cost.ceiling||0)));return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-cost`,children:[(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-cost`,children:`Always-on cost`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`≈ tokens per session`})]}),t.length?t.map((e,t)=>(0,X.jsxs)(`div`,{className:`cost-row`,children:[(0,X.jsxs)(`div`,{className:`cost-lab`,children:[(0,X.jsxs)(`span`,{children:[e.host,` `,(0,X.jsx)(`span`,{className:`dim`,children:e.scope})]}),(0,X.jsx)(`span`,{className:`mono`,children:Xi(Yi(e.cost))})]}),(0,X.jsxs)(`div`,{className:`cost-stack`,children:[(0,X.jsx)(`span`,{className:`cost-segs`,style:{"--i":t},children:Ji.map(([t])=>(0,X.jsx)(`span`,{className:`cs-${t}`,style:{width:ta(e.cost[t],n)}},t))}),e.cost.ceiling?(0,X.jsx)(`span`,{className:`cost-ceil`,style:{left:ta(e.cost.ceiling,n)},title:`root file ceiling`}):null]})]},e.id)):(0,X.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`}),(0,X.jsxs)(`div`,{className:`cost-key`,children:[Ji.map(([e,t])=>(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`i`,{className:`cs-${e}`}),t]},e)),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`i`,{className:`cost-ceil-key`}),`root file ceiling`]})]}),(0,X.jsx)(`p`,{className:`dim chart-foot`,children:`Estimated as characters ÷ 4 from the emitted files.`})]})}function la({usage:e}){let t=(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})]});if(!e.enabled)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsx)(`p`,{className:`muted`,children:e.since?(0,X.jsxs)(X.Fragment,{children:[`Counting since `,(0,X.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,X.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,X.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,X.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let n=e.rows.slice(0,7),r=Math.max(1,...n.map(e=>e.n)),i=Math.max(1,...e.per_day),a=e.per_day.reduce((e,t)=>e+t,0);return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-usage`,children:[t,(0,X.jsxs)(`div`,{className:`cols30-wrap`,children:[(0,X.jsxs)(`div`,{className:`chart-axis mono dim`,children:[(0,X.jsx)(`span`,{children:`calls per day`}),(0,X.jsxs)(`span`,{children:[(0,X.jsx)(xn,{value:a}),` in 30 d`]})]}),(0,X.jsx)(`div`,{className:`cols30`,"aria-hidden":`true`,children:e.per_day.map((e,t)=>(0,X.jsx)(`i`,{className:t===29?`today`:``,style:{height:ta(e,i),"--i":t}},t))})]}),(0,X.jsx)(`ul`,{className:`ubars`,children:n.map((e,t)=>(0,X.jsxs)(`li`,{className:e.kind,children:[(0,X.jsx)(`span`,{className:`ub-name`,children:e.name}),(0,X.jsx)(`span`,{className:`ub-trk`,children:(0,X.jsx)(`i`,{style:{width:ta(e.n,r),"--i":t}})}),(0,X.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,X.jsxs)(`div`,{className:`ub-never`,children:[(0,X.jsxs)(`span`,{children:[(0,X.jsx)(`b`,{children:e.never.filter(e=>e.kind===`skill`).length}),` skills never fired`]}),(0,X.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function ua({vals:e,i:t}){let n=Math.max(1,...e),r=96/(e.length-1),i=e.map((e,t)=>`${(t*r).toFixed(1)},${(20-e/n*17).toFixed(1)}`),[a,o]=i[i.length-1].split(`,`);return(0,X.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,X.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,X.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${i.join(` `)} 96,21`}),(0,X.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:i.join(` `)}),(0,X.jsx)(`circle`,{className:`spk-end`,cx:a,cy:o,r:`2.4`})]})}function da({gates:e,laws:t}){let n=$i(e,t);return(0,X.jsxs)(`section`,{className:`panel chart-card`,"aria-labelledby":`ldg-gates`,children:[(0,X.jsxs)(`div`,{className:`panel-head`,children:[(0,X.jsx)(`h2`,{id:`ldg-gates`,children:`Gates`}),(0,X.jsx)(`span`,{className:`mono dim`,children:`asks per rule, 30 d`})]}),n.length?(0,X.jsx)(`ul`,{className:`gate-rows`,children:n.slice(0,6).map((e,t)=>(0,X.jsxs)(`li`,{children:[(0,X.jsx)(`span`,{children:e.name}),(0,X.jsx)(ua,{vals:e.per_day,i:t}),(0,X.jsx)(`span`,{className:`mono`,children:e.n})]},e.rule))}):(0,X.jsx)(`p`,{className:`dim`,children:e?`No gate asked in 30 days.`:`Gate activity could not be read.`})]})}function fa({overview:e,setup:t,onAction:n,onRetry:r,dataRev:i,banner:a}){let{data:o}=Y(()=>ea(c.fleet()),[i]),{data:s}=Y(()=>ea(c.usage()),[i]),{data:l}=Y(()=>ea(c.gates()),[i]),{data:u}=Y(()=>ea(c.update()),[i]),{data:d}=Y(()=>ea(c.rules()),[i]),{data:f}=Y(()=>ea(c.activity()),[i]),{data:p}=Y(()=>ea(c.profile()),[i]),{data:m}=Y(()=>ea(c.catalog(`skills`)),[i],`catalog:skills`),{data:h}=Y(()=>ea(c.catalog(`laws`)),[i],`catalog:laws`),g=o?.installs||[],_=async e=>{try{await c.selectView(e.host,e.path)}catch{}r?.(),window.location.hash=`#/installs`},v=Qi({fleet:o,usage:s,overview:e,setup:t,rules:d,activity:f,profile:p,skills:m,laws:h});return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`page-head`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`h`,children:`Overview`}),(0,X.jsx)(`p`,{className:`sub mono`,children:o?`${g.length} installed · machine-wide`:` `})]}),(0,X.jsxs)(`div`,{className:`page-actions`,children:[(0,X.jsx)(na,{update:u,onAction:n}),(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>n(`doctor`),children:`Run doctor`})]})]}),a,(0,X.jsxs)(`div`,{className:`ov-stack ldg`,children:[o?(0,X.jsx)(ra,{fleet:o}):(0,X.jsx)(`div`,{className:`health`,"aria-busy":`true`}),(0,X.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,X.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,X.jsx)(`h2`,{id:`ldg-fleet`,children:`Installs`}),o?.source_fp?(0,X.jsxs)(`span`,{className:`mono dim`,children:[`source `,o.source_fp]}):null]}),(0,X.jsx)(`div`,{className:`ldg-scroll`,children:(0,X.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,X.jsx)(`thead`,{children:(0,X.jsxs)(`tr`,{children:[(0,X.jsx)(`th`,{children:`Install`}),(0,X.jsx)(`th`,{children:`Voice`}),(0,X.jsx)(`th`,{children:`Sync`}),(0,X.jsx)(`th`,{children:`Hand edits`}),(0,X.jsx)(`th`,{children:`Always-on`}),(0,X.jsx)(`th`,{children:`Built`}),(0,X.jsx)(`th`,{})]})}),(0,X.jsx)(`tbody`,{children:g.map((e,t)=>(0,X.jsx)(oa,{i:e,n:t,onAction:n,onOpen:_},e.id))})]})})]}),(0,X.jsx)(sa,{rows:v,onAction:n}),(0,X.jsxs)(`div`,{className:`ov-charts`,children:[(0,X.jsx)(ca,{installs:g}),(0,X.jsx)(la,{usage:s}),(0,X.jsx)(da,{gates:l,laws:h})]})]})]})}var pa=`geneseed-understand-seen`,ma=`understand`;function ha(){try{let e=JSON.parse(localStorage.getItem(pa));return Array.isArray(e)?e:[]}catch{return[]}}function ga(e){let t=ha();if(t.includes(e))return t;let n=[...t,e];return localStorage.setItem(pa,JSON.stringify(n)),n}function _a(e,t){let n=e?.groups||[],r=n.findIndex(e=>e.id===ma),i=n[r]?.pages||[],a=i.findIndex(e=>e.id===t);if(a<0)return{prev:null,next:null};let o=n.slice(r+1).find(e=>e.pages.length);return{prev:i[a-1]||null,next:i[a+1]||o?.pages[0]||null}}function va(e,t){for(let n of e?.groups||[]){let e=n.pages.find(e=>e.id===t);if(e)return{part:n,section:e.section||`General`,page:e}}return{part:null,section:null,page:null}}function ya(e,t){let{part:n,section:r}=va(e,t);if(!n)return{prev:null,next:null};if(n.id===`understand`)return _a(e,t);let i=n.pages.filter(e=>(e.section||`General`)===r),a=i.findIndex(e=>e.id===t);return{prev:i[a-1]||null,next:i[a+1]||null}}var ba=e=>Mn(`#/docs/${encodeURIComponent(e)}`);function xa({pages:e,seen:t}){let n=e.filter(e=>t.includes(e.id)).length;return(0,X.jsx)(`div`,{className:`track-prog`,role:`progressbar`,"aria-label":`Pages read`,"aria-valuemin":0,"aria-valuemax":e.length,"aria-valuenow":n,children:(0,X.jsx)(`i`,{style:{width:`${n/(e.length||1)*100}%`}})})}function Sa({menu:e,pageId:t}){let{prev:n,next:r}=ya(e,t);return!n&&!r?null:(0,X.jsxs)(`div`,{className:`track-bar`,children:[n?(0,X.jsxs)(`button`,{className:`btn ghost sm`,onClick:()=>ba(n.id),children:[`← `,n.title]}):(0,X.jsx)(`span`,{}),r&&(0,X.jsxs)(`button`,{className:`btn sm`,onClick:()=>ba(r.id),children:[`Next: `,r.title,` →`]})]})}var Ca=`modulepreload`,wa=function(e){return`/`+e},Ta={},Ea=function(e){return e.pathname.endsWith(`.css`)},Da=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Oa=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=wa(t,n);let r=s(t),i=Ea(r);return Da(Ta,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ca,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ka=`geneseed-newhere-dismissed`,Aa=(0,J.lazy)(()=>Oa(()=>import(`./Dashboard-DkdOUpke.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3])));function ja({harness:e}){let[t,n]=(0,J.useState)(()=>!!localStorage.getItem(ka)),{data:r}=Y(()=>t?Promise.resolve(null):c.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],a=ha(),o=i.findIndex(e=>!a.includes(e.id));if(t||!i.length||o<0)return null;let s=i.filter(e=>a.includes(e.id)).length;return(0,X.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,X.jsxs)(`div`,{className:`newhere-body`,children:[(0,X.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,X.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),(0,X.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${s} of ${i.length} read`,children:i.map(e=>(0,X.jsx)(`i`,{className:a.includes(e.id)?`f`:``},e.id))})]}),(0,X.jsx)(`a`,{className:`btn`,href:`#/docs/${encodeURIComponent(i[o].id)}`,children:s?`Continue · step ${o+1}`:`Start`}),(0,X.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(ka,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function Ma({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,dataRev:c}){if(!e)return t?(0,X.jsxs)(`div`,{children:[(0,X.jsx)(ji,{error:`Could not load the harness overview: ${t}`}),(0,X.jsx)(`button`,{type:`button`,className:`btn`,onClick:n,children:`Retry`})]}):(0,X.jsx)(Ti,{});if(!e.deployed)return(0,X.jsx)(Mi,{onAction:o});let l=(0,X.jsx)(ja,{harness:ii(e.emit)});return s===`overview`?(0,X.jsx)(fa,{overview:e,setup:i,onAction:o,onRetry:n,dataRev:c,banner:l}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`div`,{className:`page-head`,children:[(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h1`,{className:`h`,children:`Overview`}),(0,X.jsx)(`p`,{className:`sub`,children:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `)})]}),(0,X.jsxs)(`div`,{className:`page-actions`,children:[(0,X.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),(0,X.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`})]})]}),l,(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(Ti,{}),children:(0,X.jsx)(Aa,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:c})})]})}var Na=(0,J.lazy)(()=>Oa(()=>import(`./Activity-UiGvYgEl.js`),__vite__mapDeps([4,1,2,3,5,6]))),Pa=(0,J.lazy)(()=>Oa(()=>import(`./ActivityDetail-COXCSeXn.js`),__vite__mapDeps([7,1,2,3,5,6]))),Fa=(0,J.lazy)(()=>Oa(()=>import(`./Library-CKyeB096.js`),__vite__mapDeps([8,1,2,3,9,10]))),Ia=(0,J.lazy)(()=>Oa(()=>import(`./Loops-D15LDhZO.js`),__vite__mapDeps([11,1,2,3,6,9,10]))),La=(0,J.lazy)(()=>Oa(()=>import(`./Laws-Cjkenizx.js`),__vite__mapDeps([12,1,2,3,10]))),Ra=(0,J.lazy)(()=>Oa(()=>import(`./Personal-BBdGbJn6.js`),__vite__mapDeps([13,1,2,3,9,10,14,8]))),za=(0,J.lazy)(()=>Oa(()=>import(`./Installs-J3IoSqk6.js`),__vite__mapDeps([15,1,2,3,14]))),Ba=(0,J.lazy)(()=>Oa(()=>import(`./Docs-TtVyc_Dy.js`),__vite__mapDeps([16,1,2,3,9,10])));function Va(){let e=jn(),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(null),[a,o]=(0,J.useState)(!1),[s,l]=er(),[u,d]=ar(),f=e=>{if(!document.startViewTransition||!vn())return d(e);document.startViewTransition(()=>(0,gn.flushSync)(()=>d(e)))},[p,m]=gr(),[h,g]=xr(),[_,v]=(0,J.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[y,b]=(0,J.useState)(!1),x=(0,J.useRef)(null),S=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(!y)return;let e=e=>{e.key===`Escape`&&b(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[y]),(0,J.useEffect)(()=>{if(!y)return;let e=S.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[y]);let C=e=>i({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:w,error:T,themes:E,reload:D}=Sr(C),[O,ee]=(0,J.useState)(0),k=()=>{D(),ee(e=>e+1)},[te,ne]=(0,J.useState)(null),{runs:A,activeId:j,consoleOpen:M,setConsoleOpen:N,runAction:P,cancelJob:F,clearRuns:re}=kr({onFinish:e=>{k(),ne({status:e,at:Date.now()})},onError:C}),{data:ie}=Y(()=>c.setup().catch(()=>null),[O],`setup`),{data:ae}=Y(()=>c.installs().catch(()=>null),[O],`installs`),oe=ae?.installs||null,I=A[A.length-1],se=I?I.status===`running`?`${I.action} running`:`${I.action} ${I.status}`:``;(0,J.useEffect)(()=>{let e=x.current;if(!e||Zn(e,fr(p),s))return;let t=mr(p);if(t)return Rn(e,t,s);Bn(e,u,s)||w?.accent&&Rn(e,w.accent,s)},[w,s,p,u]);let ce={flavour:u,onFlavour:f,accentMode:p,onAccentMode:m,layout:h,onLayout:g};return(0,X.jsx)(`div`,{className:`app fl-${u} ${s===`light`?`light`:``}${y?` nav-open`:``}`,ref:x,children:(0,X.jsxs)(Ai,{children:[(0,X.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,X.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,X.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:se}),y&&(0,X.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>b(!1)}),(0,X.jsx)(Jr,{route:e,overview:w,installs:oe,onOpenVoice:()=>o(e=>!e),onNavigate:()=>b(!1)}),a&&(0,X.jsx)(_i,{themes:E,current:w?.theme,onPick:e=>{o(!1),P(`build`,{theme:e,emit:w?.emit})},onClose:()=>o(!1)}),(0,X.jsxs)(`div`,{className:`col`,ref:S,children:[(0,X.jsx)(gi,{route:e,navOpen:y,onToggleNav:()=>b(e=>!e),overview:w,installs:oe,query:t,onQuery:n,mode:s,onToggleMode:l,appearance:ce,dataRev:O,onSwitch:k}),(0,X.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,X.jsx)(`div`,{className:[`library`,`loops`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:(0,X.jsx)(J.Suspense,{fallback:(0,X.jsx)(Ti,{}),children:{overview:()=>(0,X.jsx)(Ma,{overview:w,overviewError:T,onRetry:D,themes:E,setup:ie,runs:A,onAction:P,layout:h,dataRev:O}),laws:()=>(0,X.jsx)(La,{selected:e.item,overview:w,setup:ie,onAction:P,dataRev:O}),library:()=>(0,X.jsx)(Fa,{overview:w,section:e.section,selected:e.item,dataRev:O}),loops:()=>(0,X.jsx)(Ia,{tab:e.tab,item:e.item,dataRev:O}),personal:()=>(0,X.jsx)(Ra,{tab:e.tab,item:e.item,setup:ie,dataRev:O}),installs:()=>(0,X.jsx)(za,{tab:e.tab,overview:w,setup:ie,themes:E,onAction:P,onMutated:k,dataRev:O,appearance:ce}),activity:()=>e.item?(0,X.jsx)(Pa,{sid:e.item},e.item):(0,X.jsx)(Na,{}),docs:()=>(0,X.jsx)(Ba,{page:e.item,onAction:P,overview:w})}[e.page]?.()})})}),(0,X.jsx)(Yr,{route:e}),(0,X.jsx)(bi,{runs:A,open:M,busy:!!j,finish:te,onToggle:()=>N(e=>!e),onClear:re,onCancel:F})]}),r&&(0,X.jsx)(yi,{toast:r,onClose:()=>i(null)}),_&&(0,X.jsx)(wi,{ready:!!w||!!T,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}v(!1)}})]})})}(0,_n.createRoot)(document.getElementById(`root`)).render((0,X.jsx)(Va,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{qt as $,Br as A,Tn as B,ii as C,ei as D,Zr as E,Y as F,yn as G,Mn as H,Dr as I,hn as J,bn as K,vr as L,Rr as M,Fr as N,Qr as O,Vr as P,sn as Q,hr as R,ni as S,m as St,Xr as T,xn as U,En as V,vn as W,ln as X,un as Y,on as Z,ji as _,I as _t,ga as a,U as at,mi as b,x as bt,Ui as c,H as ct,Ni as d,fe as dt,Mt as et,Pi as f,me as ft,Mi as g,Te as gt,Fi as h,Ie as ht,xa as i,ot as it,zr as j,Z as k,Vi as l,he as lt,Li as m,Le as mt,Sa as n,Tt as nt,va as o,ze as ot,Ii as p,L as pt,Cn as q,ma as r,lt as rt,ha as s,Fe as st,Oa as t,At as tt,Ri as u,pe as ut,ki as v,C as vt,ri as w,pi as x,b as xt,Ti as y,h as yt,nr as z};
|
package/web/dist/index.html
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<!-- The brand sprout as an inline SVG favicon (no extra asset to serve). -->
|
|
12
12
|
<link rel="icon" type="image/svg+xml"
|
|
13
13
|
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5v-9' stroke='%233AD4C4' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z' fill='%233AD4C4'/%3E%3Cpath d='M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z' fill='%233AD4C4' opacity='.42'/%3E%3C/svg%3E" />
|
|
14
|
-
<script type="module" crossorigin src="/assets/index-
|
|
14
|
+
<script type="module" crossorigin src="/assets/index-BP4foUp0.js"></script>
|
|
15
15
|
<link rel="modulepreload" crossorigin href="/assets/sections-GalMS0Zv.js">
|
|
16
16
|
<link rel="modulepreload" crossorigin href="/assets/react-DRhoX0kS.js">
|
|
17
17
|
<link rel="modulepreload" crossorigin href="/assets/api-Bp5eW_6m.js">
|