@polycode-projects/the-mechanical-code-talker 6.0.18 → 6.0.19

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.
@@ -1,41 +1,41 @@
1
- (()=>{var pR=Object.defineProperty;var P=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Lt=(e,t)=>{for(var n in t)pR(e,n,{get:t[n],enumerable:!0})};var wt,aU,cU,lU,uU,dU,fU,pU,mU,hU,gU,bU,wU,yU,$U,vU,SU,ne,$e,Kt,Xu,lg,EU,xU,jU,Qe=P(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},aU=wt("createRequire"),cU=wt("readFileSync"),lU=wt("access"),uU=wt("readFile"),dU=wt("writeFile"),fU=wt("appendFile"),pU=wt("mkdir"),mU=wt("mkdtemp"),hU=wt("rename"),gU=wt("unlink"),bU=wt("rm"),wU=wt("stat"),yU=wt("copyFile"),$U=wt("readdir"),vU=wt("createReadStream"),SU=wt("createWriteStream"),ne=(...e)=>e.join("/"),$e=e=>String(e).replace(/\/[^/]*$/,""),Kt=(...e)=>e.join("/"),Xu=e=>String(e).startsWith("/"),lg="/",EU=wt("randomBytes"),xU=wt("spawnSync"),jU=wt("createInterface")});var yt,RU,_U,Ju,Ie,Er,mR,Xn,ug,Wa,Qu,dg,hR,TU,gR,AU,CU,IU,OU,NU,Pt=P(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},RU=yt("createRequire"),_U=yt("readFileSync"),Ju=yt("access"),Ie=yt("readFile"),Er=yt("writeFile"),mR=yt("appendFile"),Xn=yt("mkdir"),ug=yt("mkdtemp"),Wa=yt("rename"),Qu=yt("unlink"),dg=yt("rm"),hR=yt("stat"),TU=yt("copyFile"),gR=yt("readdir"),AU=yt("createReadStream"),CU=yt("createWriteStream"),IU=yt("randomBytes"),OU=yt("spawnSync"),NU=yt("createInterface")});function xr(e){let t=yR.exec(String(e||""));return t?t[1].toLowerCase():null}function $R(e){return/(?:[sxz]|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function gg(e){let t=String(e||""),n=Ao[t]||t.endsWith("Symbol")&&Ao[t.slice(0,-6)]||null;if(!n)return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();let[s,...o]=n.bare.split(" ");return[$R(s),...o].join(" ")}function Qs(e,t){return!e||!vR.has(t)?e:e.shape==="ask"?{...e,subject:e.object,object:e.subject}:e.shape==="reverse"?{...e,shape:"forward"}:e.shape==="forward"?{...e,shape:"reverse"}:e}function Ga(e){return String(e||"").replace(SR,"$1")}function Zs(e){return e.replace(ER,"").trim()}function gn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(jR,"").trim();if(s=s.replace(RR,"").trim(),s===t)break;t=s}return t}var fg,pg,bR,Ao,Co,mg,hg,wR,yR,bg,vR,hn,Zu,SR,Bn,ed,ER,xR,jR,kR,RR,he,gi,Va,_R,wg,nt,bn,eo,Ka,td,nd,sd,yg,bi,Io,$g,vg,Oo,jn,js,to,Ve,Sg,No,Lo,Jn,Qn,Eg,wi,jr,Ha,kr,xg,Zn=P(()=>{fg=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],pg=["belongs to","belong to","is part of","are part of","is defined in","are defined in"],bR=["lives in","live in","sits in","sit in","sits inside","sit inside"],Ao={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","containing",...pg,...bR]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",...fg]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},Co=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),mg=Object.freeze(Object.fromEntries(Object.entries(Co).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),hg=Object.freeze(Object.values(Co).map(e=>e.predicate)),wR=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),yR=new RegExp(`^mgx:[a-z]+-(${wR.join("|")})$`,"i");bg=Object.freeze([...fg,"is the superclass of","are the superclass of","is the parent class of"]),vR=Object.freeze(new Set([...bg,...pg]));hn=Object.freeze(["defined","declared","located","implemented"]),Zu=Object.freeze(["now","currently","right now","at the moment","these days","today"]),SR=new RegExp(`\\s+(?:${[...Zu].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Bn=Object.freeze(["mentioned","referenced"]),ed=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),ER=new RegExp(`\\s+(?:${ed.join("|")})\\s*[?.!]*$`,"i");xR=Object.freeze(["then","though","too"]),jR=new RegExp(`\\s+(?:${xR.join("|")})\\s*[?.!]*$`,"i"),kR=Object.freeze(["please explain","explain"]),RR=new RegExp(`,\\s*(?:${kR.join("|")})\\s*[?.!]*$`,"i");he=Object.freeze(Object.fromEntries(Object.entries(Ao).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),gi=Object.freeze(new Set(["has","have","holds","hold"])),Va=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),_R=e=>!bg.includes(e),wg=Object.freeze([...new Set(Object.keys(he).filter(_R).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),nt=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),bn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),eo=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),Ka=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),td=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),nd=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),sd=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),yg=/\b([a-z]{3,})in'/gi,bi=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),Io=Object.freeze(["this","it","that","here","this one","that one"]),$g=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),vg=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),Oo=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),jn=Object.freeze(["that","which","who"]),js=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),to=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),Ve=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),Sg=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),No=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),Lo=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),Jn=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),Qn=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),Eg=Object.freeze({tests:"Module",test:"Module"}),wi=Object.freeze(["those","them","these"]),jr=Object.freeze(["contains","defines"]),Ha=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),kr=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),xg=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var st,no,qa=P(()=>{st="#000000",no=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${st}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${st}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${st}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${st}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${st}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${st}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${st}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${st}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${st}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var TR,kn,jg,kg,od,Rg,zU,BU,_g=P(()=>{Zn();qa();TR=()=>Object.keys(no).sort(),kn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),jg=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),kg=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),od=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:hn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:kn("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:kn("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:jg("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:kg("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:kg("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:TR(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:jg("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:kn("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:kn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:kn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:kn("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:kn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:kn("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:kn("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:kn("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:kn("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:kn("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),Rg=od.filter(e=>e.tier==="hot"),zU=od.filter(e=>e.tier==="cold"),BU=Object.freeze(od.map(e=>e.name))});var Tg,Ne,Qt=P(()=>{Qe();Tg=ne(".tmct","graph.json"),Ne=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function AR(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function Ag(e){let t=(Array.isArray(e)?e:[]).map((c,l)=>({file:c?.file,payload:c?.payload||{},name:c?.name!=null&&String(c.name).length?String(c.name):String(l)})),n=t.map(({payload:c})=>AR(c)),s=new Map;for(let c of n)for(let l of c)s.set(l,(s.get(l)||0)+1);let o=new Set([...s.entries()].filter(([,c])=>c>1).map(([c])=>c)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:c,name:l}of t){a=a&&!!c.bootstrap,typeof c.generated_at=="string"&&c.generated_at>i&&(i=c.generated_at);let u=p=>o.has(p)?`${l}/${p}`:p;Array.isArray(c.classes)&&r.classes.push(...c.classes),Array.isArray(c.vocabulary)&&r.vocabulary.push(...c.vocabulary);for(let p of Array.isArray(c.individuals)?c.individuals:[]){if(!p)continue;let f={...p};f.id&&(f.id=u(f.id)),Array.isArray(f.derived_from)&&(f.derived_from=f.derived_from.map(m=>u(m))),Array.isArray(f.mentions)&&(f.mentions=f.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(f)}for(let p of Array.isArray(c.objectProperties)?c.objectProperties:[]){if(!p)continue;let f={...p};Array.isArray(f.examples)&&(f.examples=f.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(f)}let d=c.proseIndex&&typeof c.proseIndex=="object"?c.proseIndex:{};for(let[p,f]of Object.entries(d)){let m=r.proseIndex[p]||(r.proseIndex[p]=[]);for(let h of Array.isArray(f)?f:[]){let b=u(h);m.includes(b)||m.push(b)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Cg=P(()=>{});var _r={};Lt(_r,{clearCache:()=>CR,emptyEntities:()=>Xa,fetchEntities:()=>LR,registerProvider:()=>IR});function CR(){Rr=null,yi=null}function IR(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Ya;return Ya=e??null,Rr=null,t}function Xa(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function OR(e){let t;try{t=await Ie(e,"utf8")}catch(n){if(n?.code==="ENOENT")return Xa();throw new Ne(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Ne(`graph artifact ${e} is not valid JSON`)}}async function NR(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(yi&&yi.key===n)return yi.payload;let s=[];for(let r=0;r<t.length;r++){let i=await OR(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Ag(s);return yi={key:n,payload:o},o}async function LR(e){let t=e||{};if(Ya){let o;try{o=await Ya(t)}catch(r){throw r instanceof Ne?r:new Ne(`graph provider failed (${r?.message||r})`)}if(!o||typeof o!="object")throw new Ne("graph provider returned no entities payload");return o}if(Array.isArray(t.graphFiles)&&t.graphFiles.length>1)return NR(t);if(!t.graphFile)return Xa();if(Rr&&Rr.file===t.graphFile)return Rr.payload;let n;try{n=await Ie(t.graphFile,"utf8")}catch(o){if(o?.code==="ENOENT")return Xa();throw new Ne(`cannot read graph artifact at ${t.graphFile} (${o?.code||o?.message||o})`)}let s;try{s=JSON.parse(n)}catch{throw new Ne(`graph artifact ${t.graphFile} is not valid JSON`)}return Rr={file:t.graphFile,payload:s},s}var Rr,yi,Ya,$i=P(()=>{Pt();Qt();Cg();Rr=null,yi=null,Ya=null});function Un(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=Og)}function rd(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>Og||Ig.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=PR))break;return t}function Ja({name:e,doc:t}={}){return[...new Set([...Un(e),...rd(t)])].sort()}function Qa(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function Po(e,t,{limit:n=10}={}){let s=[...new Set([...Un(t),...rd(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function Lg(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let c of Object.keys(s)){let l=s[c];if(!l||typeof l!="object")continue;let u=l[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let p of d)i.add(p);a.add(c)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var Ig,Og,PR,Ng,Wn=P(()=>{Ig=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),Og=40,PR=120;Ng=e=>/^[a-z0-9]+$/.test(e)&&!Ig.has(e)});function Pg(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function MR(e){if(!e.startsWith(Fg))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Mg);if(o<0)return null;let r=n.slice(o+Mg.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Fg.length,o),createdAt:s}:null}function zR(e){if(e.startsWith("news:"))return id(e);let{pack:t}=cd(e.slice(9));return`research:${t}`}function cd(e){let t=e.lastIndexOf("@");if(t>=0)return{kind:"referenceLive",pack:"research",article:e.slice(0,t).trim()||"unknown"};let n=e.indexOf(":");return n<0?{kind:"referenceLive",pack:"research",article:e.trim()||"unknown"}:{kind:"referenceLive",pack:e.slice(0,n)||"research",article:e.slice(n+1).trim()}}function Dg(e){if(!e.sessionId?.startsWith(ad))return null;let t=e.sessionId.slice(ad.length);if(t.startsWith("teach:")||t.startsWith("ace:"))return null;let n=Rn(t);return n?{...n,...e.createdAt?{createdAt:e.createdAt}:{}}:null}function Rn(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:DR(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:"))return cd(t.slice(9));let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:")){let s=Pg(n.slice(4));return Dg(s)||{kind:"operator",...s}}if(n.startsWith("teach:")){let s=n.slice(6),o=MR(s);if(o)return o;let r=Pg(s);return Dg(r)||{kind:"teach",...r}}if(n.startsWith("web:"))return{kind:"web",url:n.slice(4)};if(n.startsWith("url:"))return{kind:"web",url:n.slice(4)};if(n.startsWith("news-fixture:"))return{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"};if(n.startsWith("extracted:news:"))return{kind:"web",url:id(n.slice(10))};if(n.startsWith("news:"))return{kind:"web",url:id(n)};if(n.startsWith("extracted:research:"))return cd(n.slice(19));if(n.startsWith("optimistic-extract:")){let s=n.slice(19);return{kind:"optimisticExtract",name:(s.startsWith("news:")||s.startsWith("research:")?zR(s):s)||"unknown"}}return n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function Gg(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Bg;let n=Number(t);return Number.isFinite(n)?Math.max(ld,Math.min(Wg,n)):Bg}function Vg(e,t=Date.now(),n=BR){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return zg+(1-zg)*Math.pow(.5,o/n)}function Kg(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let f of o){if(r.has(f))continue;r.add(f);let m=t[f],h=UR(m);if(!h)continue;i.push(h);let b=(Rs[h]??0)*Gg(m);a.push(Math.max(0,Math.min(1,b)))}let c=0,l=1;for(let f of a)l*=1-f;if(a.length&&(c=Math.min(1,1-l)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let f=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;c=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*f))}let u=Vg(e?.createdAt,s,n.halfLifeMs),d=Tr(Math.min(1,c*u)),p={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Tr(u)};return{score:d,inputs:p}}function ec(e,t){let n=(Rs[e]??0)*Gg(t);return Tr(Math.max(0,Math.min(1,n)))}function WR(e){if(e==="operator")return 1;let t=Rs[e];return t===void 0?1:(t+1)/2}function tc(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let c=Vg(a?.assertedAt,n,t.halfLifeMs),l=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,l*c)),p=o.get(u)||{complement:1,strongest:0};p.complement*=1-d,p.strongest=Math.max(p.strongest,d),o.set(u,p),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:l,recency:Tr(c)})}let i=1;for(let[a,c]of o){let l=Math.max(WR(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?Tr(Math.min(1,1-i)):0,inputs:r}}function Hg(e){return tc(e,{halfLifeMs:GR})}function qg({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+VR),i=(o*r+1)/2;return Tr(ld+(Wg-ld)*i)}var Ar,Za,ut,ks,Mg,Fg,FR,DR,id,ad,Rs,ud,Ug,BR,zg,ld,Wg,Bg,Tr,UR,GR,VR,_n=P(()=>{Ar="mgx:trustScore",Za="mgx:trustInputs",ut="mgx:createdAt",ks="mgx:updatedAt";Mg="#node:",Fg="peer:";FR="wikipedia-live",DR=e=>e===FR?"referenceLive":"reference",id=e=>String(e||"").split("@")[0];ad="ingest#";Rs=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),ud=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),Ug=new Set(Object.entries(ud).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),BR=720*60*60*1e3,zg=.9,ld=.5,Wg=1.5,Bg=1,Tr=(e,t=6)=>Number(e.toFixed(t)),UR=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";GR=1/0;VR=19});var Mo,dd=P(()=>{Mo=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function fd(e,t){return Math.log(1+e/(1+t))}var vi=P(()=>{});var sc={};Lt(sc,{bfsLevels:()=>nc,findActionPath:()=>Si,findReachableSet:()=>pd});function Yg(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function Xg(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function Si(e,t,n,{maxDepth:s=50,stateKey:o=Yg}={}){if(t(e))return{actions:[],states:[e]};let r=Xg(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let l of r)if(t(l.state))return{actions:l.actions,states:l.states};if(a===s)break;let c=[];for(let l of r){let u=o(l.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:p}of n(l.state)||[]){let f=o(p);i.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}}r=c}return null}function pd(e,t,{maxDepth:n=50,stateKey:s=Yg}={}){let o=Xg(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let c=[];for(let l of o){let u=s(l.state);if(!r.has(u)&&(r.add(u),i.push({node:l.state,path:{actions:l.actions,states:l.states}}),a!==n))for(let{action:d,nextState:p}of t(l.state)||[]){let f=s(p);r.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}o=c}return i}function*nc(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],c=[];for(let l of r)for(let u of t(l)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),c.push(d))}r=c,yield a}}var _s=P(()=>{});function rc(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function Ei(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function Cs(e){let t=String(e?.prop||"").toLowerCase();if(Jg[t])return Jg[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":/denot/.test(n)?"denotes":/\bserve/.test(n)?"serves":null}function Zt(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function md(e){let t=Zt(e).split("/");return t[t.length-1]}function KR(e){return(e?.derived_from||[]).filter(ub).length}function Qg(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+KR(e)}function wn(e,t){let n=Zt(t);if(!n)return{match:null,candidates:[]};let s=md(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=Zt(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&(md(a)===s||md(a).replace(/\.[a-z]+$/,"")===s)?l=80:a.includes(n)&&(l=Math.max(10,50-(a.length-n.length))),l>0&&r.push({ind:i,score:l})}return r.sort((i,a)=>a.score-i.score||Qg(a.ind)-Qg(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function Ht(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function HR(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function Zg(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function As(e){let t=e||"Entity",n=Un(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function $t(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function $d(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${As(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(ub);o.length&&s.push(`attestation: ${o.length} provenance ref(s)`);for(let c of t.attributes||[])s.push(`attribute: ${c.key} = ${c.value}${c.prop?` [${c.prop}]`:""}`);let{out:r,incoming:i}=HR(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:c,edges:l}of r)s.push(` ${Zg(c)} (${l.length}) \u2192 ${$t(l.map(u=>u.objectLabel||u.object),eb)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${Zg(c)} (${l.length}) by ${$t(l.map(u=>u.subjectLabel||u.subject),eb)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${$t(a,qR)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${As(c.class)})`).join(", ")}`),e.truncated.length&&s.push(YR(e)),s.join(`
2
- `)}function YR(e){return`note: partial edge lists for: ${e.truncated.map(n=>`${n.predicate} (${n.shown}/${n.count})`).join(", ")}. Counts are complete; the lists are not.`}function Ir(e,t,{maxDepth:n=8,includeCycleReturn:s=!1}={}){let o=new Map,r=new Map,i=(c,l,u,d)=>{!c||!l||c===l||(o.has(c)||o.set(c,[]),o.get(c).push({id:l,label:u,via:d}))};for(let c of e.relations){let l=Cs(c);if(l==="imports"||l==="calls")for(let u of c.edges)i(u.object,u.subject,u.subjectLabel||u.subject,c.predicate);else if(l==="callsSymbol")for(let u of c.edges){let d=Ts(e,u.subject),p=Ts(e,u.object);if(!d||!p)continue;let f=e.byId.get(d)?.label||d;i(p,d,f,c.predicate),d!==p&&i(u.object,d,f,c.predicate)}else if(l==="tests")for(let u of c.edges)r.has(u.object)||r.set(u.object,[]),r.get(u.object).push(u.subjectLabel||u.subject);else if(l==="serves")for(let u of c.edges)i(u.subject,u.object,u.objectLabel||u.object,c.predicate)}let a=[];for(let c of nc(t.id,l=>o.get(l)||[],{maxDepth:n,keyOf:l=>l.id})){if(!c.length)continue;let l=c.map(u=>({...u,tests:r.get(u.id)||[]})).sort((u,d)=>String(u.label).localeCompare(String(d.label)));a.push(l)}for(let c=0;s&&c<a.length;c+=1){let l=a[c].flatMap(d=>(o.get(d.id)||[]).filter(p=>p.id===t.id)).sort((d,p)=>String(d.via).localeCompare(String(p.via)));if(!l.length)continue;let u={...l[0],tests:r.get(t.id)||[]};a[c+1]||(a[c+1]=[]),a[c+1]=[...a[c+1],u].sort((d,p)=>String(d.label).localeCompare(String(p.label)));break}return a}function db(e,t,{maxDepth:n=8}={}){let s=Ir(e,t,{maxDepth:n}),o=[`Impact of changing ${t.label} (reverse closure over imports/calls edges, module- and function-level):`];s.length||o.push("no dependents found in the current artifact \u2014 nothing imports or calls it (or its edges are not in the extracted graph yet).");let r=s.reduce((a,c)=>a+c.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,c)=>{if(c>=XR){o.push(`depth ${c+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(c===0?`depth 1 (${a.length} direct dependents):`:`depth ${c+1} (${a.length}):`);for(let l of a.slice(0,hd)){let u=l.tests.length?`tests: ${$t(l.tests,JR)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>hd&&o.push(` \u2026+${a.length-hd} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=Cs({predicate:a.predicate});return c==="imports"||c==="calls"||c==="callsSymbol"||c==="tests"||c==="serves"});return i.length&&o.push("warning: partial edge lists ("+i.map(a=>`${a.predicate}: ${a.shown}/${a.count}`).join(", ")+") \u2014 this closure may be missing edges. Cross-check critical results with a lexical search (/find <term>)."),o.join(`
3
- `)}function fb(e){let t=new Map;for(let n of e.relations)if(Cs(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function nb(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function bb(e,t,n=null){let s=n||(i=>Ts(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of Te(e,i))r(s(a.subject),s(a.object));return o}function O_(e,t,n){if(t.length<2)return;let s=new Map(t.map(l=>[l.ind.id,l])),o=new Map(t.map(l=>[l.ind.id,l.score])),r=l=>{if(!l.size)return[[],[]];let u=0;for(let m of l.values())u=Math.max(u,m);let d=[...l.entries()].sort((m,h)=>h[1]-m[1]),p=[],f=[];for(let[m,h]of d)h>=u*E_&&p.length<n?p.push([m,h]):f.length<tb&&f.push([m,h]);return[p,f]},[i,a]=r(new Map(t.map(l=>[l.ind.id,l.score]))),c=new Set(i.map(([l])=>l));for(let l=0;l<k_&&i.length;l++){let u=new Map,d=[];for(let p of R_){let f=bb(e,p),m=new Map;for(let[g,y]of i)for(let w of f.get(g)||[])o.has(w)&&m.set(w,Math.max(m.get(w)||0,y));let[h,b]=r(m);for(let[g,y]of h)u.set(g,Math.max(u.get(g)||0,y));d.push(...b)}a.push(...d);for(let[p,f]of u){if(c.has(p))continue;let m=s.get(p);m&&(m.score+=Math.min(f*x_,m.score*j_),c.add(p))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,tb).filter(([p])=>!c.has(p)))}}function N_(e,t=[],{depth:n=mb,q:s=gb,nodeLimit:o=hb,kinds:r=__,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=1/0}={}){let u=new Map(t.map(x=>[x.ind.id,x])),d=0;for(let x of t)d=Math.max(d,x.score);let p=t.length>0&&d>0,f=new Set(c??u.keys());if(!f.size)return[];let m=bb(e,r,a),h=x=>m.get(x)?.size||0,b=[],g=(x,T)=>x.hop!==T.hop?x.hop<T.hop:x.deg!==T.deg?x.deg<T.deg:x.id<T.id,y=(x,T)=>{let $=b[x];b[x]=b[T],b[T]=$},w=x=>{b.push(x);let T=b.length-1;for(;T>0;){let $=T-1>>1;if(g(b[T],b[$]))y(T,$),T=$;else break}},E=()=>{let x=b[0],T=b.pop();if(b.length){b[0]=T;let $=0;for(;;){let _=2*$+1,C=2*$+2,S=$;if(_<b.length&&g(b[_],b[S])&&(S=_),C<b.length&&g(b[C],b[S])&&(S=C),S===$)break;y($,S),$=S}}return x},R=new Set(f);for(let x of f)w({id:x,hop:0,deg:h(x)});let v=null,k=0,I=[];for(;b.length&&k<o;){let x=E();if(I.push({id:x.id,hop:x.hop}),!f.has(x.id)){if(p){let _=d*T_*Math.pow(A_,x.hop-1),C=u.get(x.id);if(C)C.score+=Math.min(_*C_,C.score*I_);else{let S=e.byId?.get?.(x.id);if(S&&i(S)){v||(v=fb(e));let j=v.get(S.id)||[],M={ind:S,score:_,defineCount:j.length,matching:[],density:0};t.push(M),u.set(x.id,M)}}}k++}if(x.hop>=n||x.hop>0&&h(x.id)>l)continue;let T=[];for(let _ of m.get(x.id)||[]){if(R.has(_))continue;let C=e.byId?.get?.(_);!C||!i(C)||T.push({id:_,deg:h(_)})}if(!T.length)continue;T.sort((_,C)=>_.deg-C.deg||(_.id<C.id?-1:_.id>C.id?1:0));let $=Math.max(1,Math.floor(s*T.length));for(let _=0;_<$;_++){let C=T[_];R.add(C.id),w({id:C.id,hop:x.hop+1,deg:C.deg})}}return I}function wb(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:c=!1,proseLayers:l=!1,literalMention:u=!1,rawQuery:d=""}=n,p=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,f=fb(e),m=[];for(let E of e.individuals){if((E.class||"")!=="Module")continue;let R=String(E.label),v=R.toLowerCase(),k=f.get(E.id)||[],I=new Set(k.map($=>$.toLowerCase())),x=new Set;for(let $ of k)for(let _ of nb($))x.add(_);let T=u?String((E.attributes||[]).find($=>$.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:E,label:R,labelLc:v,defines:k,symSet:I,symComps:x,dotted:T})}let h=m.length||1,b=new Map,g=E=>{let R=0;for(let v of m)(v.labelLc.includes(E)||v.symComps.has(E)||v.symSet.has(E))&&R++;return R},y=E=>(b.has(E)||b.set(E,fd(h,g(E))),b.get(E));for(let E of t)y(E);let w=[];for(let E of m){let R=0,v=0,k=0,I=[];for(let C of t){let S=b.get(C)||0;S&&(E.symSet.has(C)?(R+=S*pb,k++):E.symComps.has(C)&&(I.push(S),k++),E.labelLc.includes(C)&&(v+=S*ZR))}I.sort((C,S)=>S-C);let x=0;for(let C=0;C<Math.min(I.length,t_);C++)x+=I[C]*e_;let T=R+v+x;if(!T)continue;s&&(Mo(E.labelLc)||r_(E.labelLc))?T*=o_:Mo(E.labelLc)&&(T*=.4);let $=E.defines.filter(C=>{let S=C.toLowerCase(),j=nb(C);return t.some(M=>S===M||j.has(M))}),_=E.defines.length?k/E.defines.length:0;w.push({ind:E.ind,score:T,defineCount:E.defines.length,matching:$,density:_})}if(u&&d&&w.length){let E=String(d).toLowerCase(),R=x=>x!=null&&/[a-z0-9_./]/.test(x),v=x=>{for(let T=E.indexOf(x);T!==-1;T=E.indexOf(x,T+1))if(!R(E[T-1])&&!R(E[T+x.length]))return!0;return!1},k=new Map(m.map(x=>[x.ind.id,x])),I=0;for(let x of w)I=Math.max(I,x.score);for(let x of w){let T=k.get(x.ind.id);if(!T)continue;let $=0;for(let _ of new Set([T.dotted,T.labelLc])){if(!_||_.split(/[./]+/).filter(Boolean).length<y_||!v(_))continue;let C=[...new Set(_.split(/[^a-z0-9_]+/).filter(Boolean))].map(y).sort((j,M)=>M-j),S=0;for(let j=0;j<Math.min(C.length,$_);j++)S+=C[j]*w_;$=Math.max($,S)}$&&(x.score+=Math.min($*v_,I*S_))}}if(w.length>1){let E=new Map(w.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of Te(e,"imports"))!E.has(v.subject)&&!E.has(v.object)||(R.has(v.subject)||R.set(v.subject,new Set),R.has(v.object)||R.set(v.object,new Set),R.get(v.subject).add(v.object),R.get(v.object).add(v.subject));for(let v of w){let k=0;for(let I of R.get(v.ind.id)||[])k=Math.max(k,E.get(I)||0);v.score+=Math.min(k*n_,v.score*s_)}}if(o&&w.length>1){let E=new Map(w.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of["calls","callsSymbol"])for(let k of Te(e,v)){let I=Ts(e,k.subject),x=Ts(e,k.object);!I||!x||I===x||!E.has(I)&&!E.has(x)||(R.has(I)||R.set(I,new Set),R.has(x)||R.set(x,new Set),R.get(I).add(x),R.get(x).add(I))}for(let v of w){let k=0;for(let I of R.get(v.ind.id)||[])k=Math.max(k,E.get(I)||0);v.score+=Math.min(k*i_,v.score*a_)}}if(r&&w.length>1){let E=new Map(w.map(v=>[v.ind.id,v.score])),R=new Map;for(let v of e.individuals)(v.class||"")==="Class"&&v.label&&R.set(String(v.label),v);for(let v of w){if(!u_(v.ind.label))continue;let k=0;for(let I of Te(e,"inherits")){if(Ts(e,I.subject)!==v.ind.id||!d_(I.objectLabel))continue;let T=Ts(e,I.object);if(!T){let $=R.get(String(I.objectLabel||""));$&&(T=es(e,$))}T&&(k=Math.max(k,E.get(T)||0))}v.score+=Math.min(k*c_,v.score*l_)}}if(c&&w.length&&e.proseIndex){let E=Po(e.proseIndex,t.join(" "),{limit:m_});if(E.length){let R=new Map;for(let{id:v,score:k}of E){let I=Ts(e,v);I&&R.set(I,(R.get(I)||0)+k)}for(let v of w){let k=R.get(v.ind.id)||0;k&&(v.score+=Math.min(k*f_,v.score*p_))}}}if(l&&w.length&&e.proseIndex){let E=new Map(w.map(k=>[k.ind.id,k])),R=new Map(m.map(k=>[k.ind.id,k])),v=new Map;for(let k of new Set(t)){let I=b.get(k)||0;if(!I)continue;let{ids:x}=Lg(e.proseIndex,k);if(!x.length)continue;let T=new Set;for(let $ of x){let _=Ts(e,$);if(!_||T.has(_)||(T.add(_),!E.has(_)))continue;let C=R.get(_);C&&(C.symSet.has(k)||C.symComps.has(k)||C.labelLc.includes(k))||v.set(_,(v.get(_)||0)+I*b_)}}for(let k of w){let I=v.get(k.ind.id)||0;I&&(k.score+=Math.min(I*h_,k.score*g_))}}return i&&w.length>1&&O_(e,w,p),a&&w.length&&N_(e,w,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:mb,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:gb,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:hb}),w.sort((E,R)=>R.score-E.score||R.density-E.density||E.defineCount-R.defineCount||String(E.ind.label).length-String(R.ind.label).length),w}function yb(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return wb(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function P_(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let c=0;c<e.length;c++){let l=e[c];if(l==="\\"){let u=e[c+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),c+=1,r="",i=!1;continue}if(o){l==="]"&&(o=!1,r="]",i=!1);continue}if(l==="["){o=!0,r="[",i=!1;continue}if(l==="?"&&(r==="("||i)){r="?",i=!1;continue}if(l==="*"||l==="+"||l==="?"){a(),r=l;continue}if(l==="{"){let u=e.indexOf("}",c),d=u===-1?"":e.slice(c+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),c=u,r="}";continue}r="{",i=!1;continue}r=l,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function vd(e,{now:t=Date.now}={}){let n=String(e);if(n.length>sb)return{error:`name pattern is ${n.length} characters; the limit is ${sb}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=P_(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>ob)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${ob}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(c){if(a===null)a=t()+rb;else if(t()>a)throw new oc(`name pattern "${n}" exceeded its ${rb}ms matching budget.`);return i.test(String(c).slice(0,L_))}}}function $b(e,t,{limit:n=ic,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),c=String(s||"").trim().toLowerCase(),l=String(o||"").trim().toLowerCase(),u=null;if(r){let m=vd(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return B_(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof oc)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=wb(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let p=d.slice(0,n),f=[`${d.length} module(s) match "${t}" (top ${p.length}):`];for(let{ind:m,defineCount:h,matching:b}of p){let g=b.length?` \u2014 matching: ${$t([...new Set(b)],QR)}`:"";f.push(`- ${m.label} (defines ${h} symbol(s))${g}`)}return f.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),f.join(`
4
- `)}function Te(e,t){let n=ib.get(e);n||(n=new Map,ib.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Cs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function Ts(e,t){let n=e.byId?.get?.(t);if(n)return es(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function es(e,t){if((t?.class||"")==="Module")return t.id;let n=Ht(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function Sd(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Cr(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function vb(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${As(t.class)} (id: ${t.id})`],o=Te(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
- `);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=Sd(c?Ht(c):null),u=c?Cr(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${$t(r,ab)}`),i.length&&s.push(`attributes (${i.length}): ${$t(i,ab)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
- `)}function Sb(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Ht(t),o=[`${t.label} \u2014 ${As(t.class)}${Sd(s)}`],r=qe(t,"params"),i=qe(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];qe(t,"isStatic")&&a.push("static"),qe(t,"isAbstract")&&a.push("abstract"),qe(t,"isConstant")&&a.push("constant");let c=qe(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=Cr(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=qe(t,"raises");u&&o.push(`raises: ${u}`);let d=qe(t,"catches");d&&o.push(`catches: ${d}`);let p=qe(t,"self_fields");p&&o.push(`self fields: ${p}`);let f=qe(t,"value");f&&o.push(`value: ${f}`);let m=qe(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
- `)}function Eb(e,t){let n=Te(e,"inherits"),s=n.filter(c=>c.subject===t.id).map(c=>c.objectLabel||c.object),o=new Map;for(let c of n)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push({id:c.subject,label:c.subjectLabel||c.subject});let r=[`${t.label} \u2014 ${As(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${$t(s,cb)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of nc(t.id,l=>o.get(l)||[],{maxDepth:8,keyOf:l=>l.id}))c.length&&i.push(c.map(l=>l.label).sort((l,u)=>String(l).localeCompare(String(u))));let a=i.reduce((c,l)=>c+l.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((c,l)=>r.push(` depth ${l+1} (${c.length}): ${$t(c,cb)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
- `)}function ac(e){let t=new Map;for(let n of e){let s=n.label.includes("/")?n.label.slice(0,n.label.lastIndexOf("/")):"(root)";t.set(s,(t.get(s)||0)+1)}return t}function cc(e,t=""){let n=Zt(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||Zt(s.label).startsWith(n)))}function xb(e,{pkg:t=""}={}){let n=Zt(t),s=cc(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=ac(s),r=new Map;for(let u of Te(e,"imports"))r.set(u.object,(r.get(u.object)||0)+1);let i=new Set(s.map(u=>u.id)),a=[...r.entries()].filter(([u])=>i.has(u)).sort((u,d)=>d[1]-u[1]).slice(0,F_).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),c=[...o.entries()].sort((u,d)=>d[1]-u[1]),l=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${c.length} package(s).`];return l.push(`packages (by module count): ${$t(c.map(([u,d])=>`${u} (${d})`),M_)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
9
- `)}function kb(e,t){let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Ht(t)?.path||n,o=[...new Set(Te(e,"tests").filter(a=>a.object===n).map(a=>a.subjectLabel||a.subject))],r=o.length>0,i=r?`covered by ${o.length} test module(s):
10
- ${$t(o,jb,`
1
+ (()=>{var AR=Object.defineProperty;var M=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(s){throw n=[s],s}};var Nt=(e,t)=>{for(var n in t)AR(e,n,{get:t[n],enumerable:!0})};var wt,TU,AU,CU,IU,OU,NU,LU,PU,MU,FU,DU,zU,BU,UU,WU,GU,ne,$e,Vt,td,hg,VU,KU,HU,Qe=M(()=>{wt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},TU=wt("createRequire"),AU=wt("readFileSync"),CU=wt("access"),IU=wt("readFile"),OU=wt("writeFile"),NU=wt("appendFile"),LU=wt("mkdir"),PU=wt("mkdtemp"),MU=wt("rename"),FU=wt("unlink"),DU=wt("rm"),zU=wt("stat"),BU=wt("copyFile"),UU=wt("readdir"),WU=wt("createReadStream"),GU=wt("createWriteStream"),ne=(...e)=>e.join("/"),$e=e=>String(e).replace(/\/[^/]*$/,""),Vt=(...e)=>e.join("/"),td=e=>String(e).startsWith("/"),hg="/",VU=wt("randomBytes"),KU=wt("spawnSync"),HU=wt("createInterface")});var yt,YU,XU,nd,Ne,jr,CR,Zn,gg,Ka,sd,bg,IR,JU,OR,QU,ZU,e2,t2,n2,Lt=M(()=>{yt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},YU=yt("createRequire"),XU=yt("readFileSync"),nd=yt("access"),Ne=yt("readFile"),jr=yt("writeFile"),CR=yt("appendFile"),Zn=yt("mkdir"),gg=yt("mkdtemp"),Ka=yt("rename"),sd=yt("unlink"),bg=yt("rm"),IR=yt("stat"),JU=yt("copyFile"),OR=yt("readdir"),QU=yt("createReadStream"),ZU=yt("createWriteStream"),e2=yt("randomBytes"),t2=yt("spawnSync"),n2=yt("createInterface")});function kr(e){let t=PR.exec(String(e||""));return t?t[1].toLowerCase():null}function MR(e){return/(?:[sxz]|ch|sh)$/i.test(e)?`${e}es`:/[^aeiou]y$/i.test(e)?`${e.slice(0,-1)}ies`:`${e}s`}function Sg(e){let t=String(e||""),n=Io[t]||t.endsWith("Symbol")&&Io[t.slice(0,-6)]||null;if(!n)return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase();let[s,...o]=n.bare.split(" ");return[MR(s),...o].join(" ")}function Zs(e,t){return!e||!FR.has(t)?e:e.shape==="ask"?{...e,subject:e.object,object:e.subject}:e.shape==="reverse"?{...e,shape:"forward"}:e.shape==="forward"?{...e,shape:"reverse"}:e}function Ha(e){return String(e||"").replace(DR,"$1")}function eo(e){return e.replace(zR,"").trim()}function wn(e){let t=e;for(let n=0;n<2;n+=1){let s=t.replace(UR,"").trim();if(s=s.replace(GR,"").trim(),s===t)break;t=s}return t}var wg,yg,NR,Io,Oo,$g,vg,LR,PR,Eg,FR,bn,od,DR,Gn,rd,zR,BR,UR,WR,GR,me,$i,qa,VR,xg,nt,yn,to,Ya,id,ad,cd,jg,vi,No,kg,Rg,Lo,_n,ks,no,Ge,_g,Po,Mo,es,ts,Tg,Si,Rr,Xa,_r,Ag,ns=M(()=>{wg=["is a superclass of","are a superclass of","is a parent class of","are a parent class of","superclass","superclasses"],yg=["belongs to","belong to","is part of","are part of","is defined in","are defined in"],NR=["lives in","live in","sits in","sit in","sits inside","sit inside"],Io={imports:{bare:"import",comment:"Module -> Module: subject's import graph references object (usesComplexType).",verbs:["couples to","couple to","depends on","imports","import","relies on","rely on","requires","require","references","reference","pulls in","pull in","built on","builds on","build on","uses code from","grabs","grab","pulls from","pull from","leans on","lean on","is wired to","are wired to","is hooked up to","are hooked up to","importing"]},uses:{bare:"use",comment:"query-side union: imports (Module->Module) + calls (Module->Module) + callsSymbol (fn->fn).",verbs:["uses","use","makes use of","make use of","talks to","talk to","using"]},calls:{bare:"call",comment:"Function/Method -> Function/Class (symbol-grain) or Module -> Module (coarse): subject invokes object.",verbs:["invokes","invoke","calls","call","runs","run","executes","execute","hits","hit","triggers","trigger","fires","fire","kicks off","kick off","calling"]},defines:{bare:"define",comment:"Module -> top-level Function/Class/Method/Attribute: subject declares object.",verbs:["defines","define","declares","declare","has","have","holds","hold","defining"]},contains:{bare:"contain",comment:"Class -> Method/Attribute: subject's membership includes object.",verbs:["contains","contain","containing",...yg,...NR]},tests:{bare:"test",comment:"Module -> Module: subject is a test module importing/covering object.",verbs:["tests","test","covers","cover","verifies","verify","exercises","exercise","checks","check","makes sure of","make sure of","testing"]},inherits:{bare:"inherit from",comment:"Class -> Class: subject's declared base resolves to object (subclassOf).",verbs:["inherits from","inherit from","inherits","inherit","extends","extend","subclasses","subclass","derives from","derive from","is a subclass of","are a subclass of","is a kind of","are a kind of","is built off","are built off","is built on top of","are built on top of","extending","inheriting from","inheriting","subclassing","extends from",...wg]},touches:{bare:"touch",comment:"Commit -> Module (coarse) or Commit -> symbol (fine, touchesSymbol): a commit's changed-line-range intersects object.",verbs:["touched","touches","changed","change","modified","modifies","was changed in","were changed in","was edited in","were edited in","was modified by","were modified by","was tweaked in","were tweaked in","got changed in","got edited in","touch","changed in","landed in","land in","was in","were in","went into","included in","updated","edited","touching"]},cochange:{bare:"co-change with",comment:"Module -> Module: subject and object are frequently committed together (changeCoupledWith).",verbs:["changed with","co-changes with","co-change with","changes alongside","change alongside","shares commits with","share commits with","tends to change together with","tend to change together with","moves together with","move together with","changed together with","change together with","changes together with","changes with","change with","tends to change with","tend to change with","usually changes with"]},reexports:{bare:"re-export",comment:"Module -> exported symbol: subject's public API surface (__all__/export list).",verbs:["exports","export","re-exports","re-export","passes through","pass through","exposes","expose","exporting"]},serves:{bare:"serve",comment:"subject provides or backs the object \u2014 a handler serving a route, a module serving a surface (mgx:serves).",verbs:["serves","serve","serving"]},denotes:{bare:"denote",comment:"subject names the object \u2014 a glossary/lexicon term denoting a code entity (mgx:denotes).",verbs:["denotes","denote","denoting"]}},Oo=Object.freeze({placement:Object.freeze({predicate:"mgx:currently-in",comment:"individual -> place: where the subject is right now.",nouns:Object.freeze(["location","locations","position","positions","place","places","whereabouts","room","rooms"]),reads:"is in",matchesLocativePredicates:!0}),mood:Object.freeze({predicate:"mgx:feels",comment:"individual -> mood word: how the subject feels right now.",nouns:Object.freeze(["mood","moods","feeling","feelings","emotion","emotions"]),reads:"feels"}),mass:Object.freeze({predicate:"mgx:hasMass",comment:"individual -> number: the subject's current mass.",nouns:Object.freeze(["mass","masses","weight","weights"]),reads:"has mass"})}),$g=Object.freeze(Object.fromEntries(Object.entries(Oo).flatMap(([e,{nouns:t}])=>t.map(n=>[n,e])))),vg=Object.freeze(Object.values(Oo).map(e=>e.predicate)),LR=Object.freeze(["on","in","at","inside","under","below","above","near","beside","behind","by"]),PR=new RegExp(`^mgx:[a-z]+-(${LR.join("|")})$`,"i");Eg=Object.freeze([...wg,"is the superclass of","are the superclass of","is the parent class of"]),FR=Object.freeze(new Set([...Eg,...yg]));bn=Object.freeze(["defined","declared","located","implemented"]),od=Object.freeze(["now","currently","right now","at the moment","these days","today"]),DR=new RegExp(`\\s+(?:${[...od].sort((e,t)=>t.length-e.length).join("|")})(\\s*[?.!]*)$`,"i");Gn=Object.freeze(["mentioned","referenced"]),rd=Object.freeze(["in this graph","in the graph","in this codebase","in the codebase","in this repo","in the repo","here"]),zR=new RegExp(`\\s+(?:${rd.join("|")})\\s*[?.!]*$`,"i");BR=Object.freeze(["then","though","too"]),UR=new RegExp(`\\s+(?:${BR.join("|")})\\s*[?.!]*$`,"i"),WR=Object.freeze(["please explain","explain"]),GR=new RegExp(`,\\s*(?:${WR.join("|")})\\s*[?.!]*$`,"i");me=Object.freeze(Object.fromEntries(Object.entries(Io).flatMap(([e,{verbs:t}])=>t.map(n=>[n,e])))),$i=Object.freeze(new Set(["has","have","holds","hold"])),qa=Object.freeze(new Set(["search","describe","signature","impact","members","subclasses","exports","callers","callees","calls","tests","untested","history","cochanges","architecture","arch","related","sprite"])),VR=e=>!Eg.includes(e),xg=Object.freeze([...new Set(Object.keys(me).filter(VR).map(e=>e.match(/^(?:is|are)\s+an?\s+(.+)$/i)).filter(Boolean).map(e=>e[1].toLowerCase()))]),nt=Object.freeze({function:"Function",functions:"Function",method:"Method",methods:"Method",class:"Class",classes:"Class",module:"Module",modules:"Module",mod:"Module",mods:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",attribute:"Attribute",attributes:"Attribute",field:"Attribute",fields:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",change:"Change",changes:"Change",commit:"Commit",commits:"Commit"}),yn=Object.freeze({explicitly:"direct",directly:"direct",transitively:"transitive",indirectly:"transitive"}),to=Object.freeze({imported:"imports",called:"calls",used:"uses",tested:"tests",covered:"tests",verified:"tests",exercised:"tests",checked:"tests",defined:"defines",declared:"defines",inherited:"inherits",extended:"inherits",subclassed:"inherits",contained:"contains",exported:"reexports","re-exported":"reexports",exposed:"reexports",touched:"touches",changed:"touches",modified:"touches",edited:"touches",updated:"touches"}),Ya=Object.freeze({"inherited from":{kind:"inherits",role:"object"},"extended from":{kind:"inherits",role:"object"},"subclassed from":{kind:"inherits",role:"object"},"defined in":{kind:"defines",role:"agent"},"declared in":{kind:"defines",role:"agent"},"contained in":{kind:"contains",role:"agent"},"imported by":{kind:"imports",role:"agent"},"called by":{kind:"calls",role:"agent"},"used by":{kind:"uses",role:"agent"},"tested by":{kind:"tests",role:"agent"},"covered by":{kind:"tests",role:"agent"},"touched by":{kind:"touches",role:"agent"},"changed by":{kind:"touches",role:"agent"},"exported by":{kind:"reexports",role:"agent"}}),id=Object.freeze({"ain't":"is not",aint:"is not","isn't":"is not",isnt:"is not","aren't":"are not",arent:"are not","doesn't":"does not",doesnt:"does not","don't":"do not",dont:"do not","didn't":"did not",didnt:"did not","there's":"there is",theres:"there is","what's":"what is",whats:"what is","who's":"who is",whos:"who is",gonna:"going to",wanna:"want to",gotta:"got to",yer:"your",ur:"your",gimme:"give me"}),ad=Object.freeze({funtion:"function",funtions:"functions",fucntion:"function",fucntions:"functions",functoin:"function",functoins:"functions",calss:"class",calsses:"classes",classs:"class",clases:"classes",modul:"module",moduls:"modules",moduel:"module",moduels:"modules",moudle:"module",moudles:"modules",methdo:"method",methdos:"methods",mehtod:"method",mehtods:"methods",comit:"commit",comits:"commits",commmit:"commit",commmits:"commits",varaible:"variable",varaibles:"variables",varibale:"variable",varibales:"variables",atribute:"attribute",atributes:"attributes",improt:"import",improts:"imports",imoprt:"import",imoprts:"imports",inherts:"inherits",inheirts:"inherits",extands:"extends",extneds:"extends",depnds:"depends",touchs:"touches",tuoches:"touches",touhced:"touched",touchd:"touched",defned:"defined",chagned:"changed",chnaged:"changed",chagnes:"changes",chnages:"changes",calles:"calls",exprot:"export",exprots:"exports",tets:"tests",whcih:"which",wich:"which",whihc:"which",wehre:"where",whre:"where",waht:"what",wat:"what",dat:"that",dose:"does",doess:"does",teh:"the",manyn:"many",mnay:"many",amny:"many",mnany:"many",hwo:"how",coutn:"count",conut:"count",cuont:"count",ocunt:"count",numer:"number",nubmer:"number",numbr:"number",nmuber:"number",lst:"list",lsit:"list",ilst:"list",shwo:"show",hsow:"show",dispaly:"display",dsiplay:"display",funtcions:"functions",funciton:"function",funcitons:"functions"}),cd=Object.freeze({folder:"module",folders:"modules",directory:"module",directories:"modules",func:"function",funcs:"functions",changeset:"commit",changesets:"commits",revision:"commit",revisions:"commits",property:"attribute",properties:"attributes"}),jg=/\b([a-z]{3,})in'/gi,vi=Object.freeze(["um","uh","erm","so","like","yo","hey","bru","bro","fam","mate","please","could you","can you","would you","tell me","i wonder","just wondering","quickly","real quick","kinda","sorta","btw","by the way","you","quick q"]),No=Object.freeze(["this","it","that","here","this one","that one"]),kg=Object.freeze([{re:/\bthere\s+is\s+not\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bthere\s+is\s+no\s+\S+\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\bis\s+not\s+there\s+(?:anything|nothing)\s+(?:that\s+)?(\S.*)$/i,to:e=>`what ${e[1]}`},{re:/\b(?:nobody|nothing|no one)\s+(\S.*?)(?:,?\s+does\s+it\??|,?\s+do\s+they\??)?$/i,to:e=>`what ${e[1]}`}]),Rg=Object.freeze([{re:/^what\s+(?:is|was|were|are)\s+in\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+(?:went|got)\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`},{re:/^what\s+made\s+it\s+into\s+((?:commit\s+)?[0-9a-f]{7,40})\??$/i,to:e=>`what did ${e[1]} touch`}]),Lo=Object.freeze(["mean","means","stand for","stands for","signify","signifies","represent","represents","refer to","refers to"]),_n=Object.freeze(["that","which","who"]),ks=Object.freeze(["something","anything","everything","somethings","things","thing","entities","entity","nodes","node","stuff","code","symbol","symbols"]),no=Object.freeze({"but do not":"difference","but does not":"difference","and do not":"difference","and does not":"difference","but not":"difference","and not":"difference",except:"difference",without:"difference",and:"intersection",plus:"intersection",but:"intersection",or:"union"}),Ge=Object.freeze({public:{via:"visibility",value:"public"},private:{via:"visibility",value:"private"},protected:{via:"visibility",value:"protected"},static:{via:"attr",attr:"isStatic"},abstract:{via:"attr",attr:"isAbstract"},constant:{via:"attr",attr:"isConstant"},exported:{via:"exported"},"re-exported":{via:"exported"},tested:{via:"tested",value:!0},covered:{via:"tested",value:!0},untested:{via:"tested",value:!1},uncovered:{via:"tested",value:!1}}),_g=Object.freeze(new Set(["tests","test","anything","something","anyone","someone","any"])),Po=Object.freeze(["how many","how much","how many of","number of","total number of","quantity of","tally of","sum of","total of","amount of","count","count up","count of","tot up"]),Mo=Object.freeze(["list","show","show me","show us","display","print","print out","dump","enumerate","name","give me","get me","spit out","rattle off","run down","run through","ls","what are","which are"]),es=Object.freeze({most:"most",greatest:"most",highest:"most",biggest:"most",largest:"most","most-connected":"most","most connected":"most",fewest:"fewest",least:"fewest",smallest:"fewest",lowest:"fewest"}),ts=Object.freeze({imports:{kind:"imports",dir:"out"},dependencies:{kind:"imports",dir:"out"},importers:{kind:"imports",dir:"in"},dependents:{kind:"imports",dir:"in"},callers:{kind:"calls",dir:"in",sibling:"callsSymbol"},callees:{kind:"calls",dir:"out",sibling:"callsSymbol"},calls:{kind:"calls",dir:"out",sibling:"callsSymbol"},methods:{kind:"contains",dir:"out",filter:"Method"},members:{kind:"contains",dir:"out"},tests:{kind:"tests",dir:"in"},test:{kind:"tests",dir:"in"},subclasses:{kind:"inherits",dir:"in"},connections:{kind:"*",dir:"both"},edges:{kind:"*",dir:"both"},connected:{kind:"*",dir:"both"},imported:{kind:"imports",dir:"in"},"depended-on":{kind:"imports",dir:"in"},depended:{kind:"imports",dir:"in"},used:{kind:"imports",dir:"in",sibling:"callsSymbol"},called:{kind:"calls",dir:"in",sibling:"callsSymbol"}}),Tg=Object.freeze({tests:"Module",test:"Module"}),Si=Object.freeze(["those","them","these"]),Rr=Object.freeze(["contains","defines"]),Xa=Object.freeze(["the","a","an","some","other","about","please","pls","plz","kindly","just","simply","maybe","perhaps","thanks","thank","ta","cheers","too","also","well","either","sorry","oops","actually","mean","meant","rather","hi","hello","hey","yo","hiya","howdy","ok","okay","matey","mate","buddy","pal","dude","man","bro","bru","fam","friend","sir","maam","folks","guys","everyone","dear","tmct","show","tell","give","list","find","me","us","lemme"]),_r=Object.freeze({tally:"count",tallies:"count",sum:"count",total:"count",totals:"count"}),Ag=Object.freeze(["help","help me","how do i ask","how do i use this","what can i ask","what can you ask","usage","commands","examples","syntax","options"])});var st,so,Ja=M(()=>{st="#000000",so=Object.freeze({happy:`<circle cx="-0.4" cy="-0.15" r="0.11" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.15" r="0.11" fill="${st}" opacity="0.85"/><path d="M -0.4 0.35 Q 0 0.68 0.4 0.35" fill="none" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,sad:`<circle cx="-0.4" cy="-0.1" r="0.1" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.1" r="0.1" fill="${st}" opacity="0.85"/><path d="M -0.38 0.55 Q 0 0.3 0.38 0.55" fill="none" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/>`,angry:`<path d="M -0.58 -0.32 L -0.22 -0.16" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><path d="M 0.58 -0.32 L 0.22 -0.16" stroke="${st}" stroke-width="0.09" stroke-linecap="round" opacity="0.85"/><circle cx="-0.32" cy="-0.02" r="0.09" fill="${st}" opacity="0.85"/><circle cx="0.32" cy="-0.02" r="0.09" fill="${st}" opacity="0.85"/><path d="M -0.36 0.5 L 0.36 0.42" stroke="${st}" stroke-width="0.1" stroke-linecap="round" opacity="0.85"/>`,scared:`<circle cx="-0.4" cy="-0.12" r="0.2" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.4" cy="-0.12" r="0.07" fill="${st}" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.2" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="0.4" cy="-0.12" r="0.07" fill="${st}" opacity="0.85"/><circle cx="0" cy="0.42" r="0.09" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/>`,surprised:`<circle cx="-0.38" cy="-0.12" r="0.17" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="-0.38" cy="-0.12" r="0.06" fill="${st}" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.17" fill="none" stroke="${st}" stroke-width="0.07" opacity="0.85"/><circle cx="0.38" cy="-0.12" r="0.06" fill="${st}" opacity="0.85"/><ellipse cx="0" cy="0.42" rx="0.16" ry="0.22" fill="${st}" opacity="0.7"/>`,calm:`<path d="M -0.5 -0.1 Q -0.4 -0.2 -0.3 -0.1" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M 0.3 -0.1 Q 0.4 -0.2 0.5 -0.1" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/><path d="M -0.3 0.4 Q 0 0.5 0.3 0.4" fill="none" stroke="${st}" stroke-width="0.08" stroke-linecap="round" opacity="0.85"/>`})});var KR,Tn,Cg,Ig,ld,Og,c2,l2,Ng=M(()=>{ns();Ja();KR=()=>Object.keys(so).sort(),Tn=e=>({type:"object",required:["symbol"],properties:{symbol:{type:"string",description:e}}}),Cg=e=>({type:"object",required:["module"],properties:{module:{type:"string",description:e}}}),Ig=e=>({type:"object",required:["class"],properties:{class:{type:"string",description:e}}}),ld=Object.freeze([{name:"tmct_context",tier:"hot",summary:"A sized edit bundle for one symbol \u2014 exemplar source, sibling signatures, registration anchor and the insertion region, in one call.",agentDescription:"START HERE to add/modify code: ONE call returns a sized edit bundle (exemplar source, sibling signatures, registration, insertion region) \u2014 then write directly, don't Read.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"Module path (e.g. path/to/module) or a sibling function/class name defined in it."},depth:{type:"string",enum:["min","auto","full"],default:"auto",description:"auto (sized to the task) | min (leanest) | full (every section)."}}},example:{symbol:"django/utils/text.py"}},{name:"tmct_snippet",tier:"hot",summary:"The exact source of one function, class or Class.method \u2014 its line span only, plus a one-line in-repo call hint.",agentDescription:"EXACT source of one function/class/Class.method by name (its line span only) + a one-line in-repo call hint. Prefer over Read for a single symbol.",inputSchema:{type:"object",required:["symbol"],properties:{symbol:{type:"string",description:"function/class name, Class.method, or fn:<path>#name."}}},example:{symbol:"Truncator.chars"}},{name:"tmct_ask",tier:"hot",summary:"A structural question in plain English, answered from the graph in one call \u2014 no model, and a clean miss instead of a guess.",agentDescription:'Ask a structural question in plain English: "which functions call X", "what uses X", "where is X defined", "when did X change". One call, no model. A clean miss beats a guess.',inputSchema:{type:"object",required:["query"],properties:{query:{type:"string",description:'A free-text question, e.g. "which functions explicitly couple to logging".'}}},example:{query:"which modules import src/core/model.mjs"},chat:{exampleRepo:"examples/mini-webapp",grammar:[{form:"which <things> <relation-verb> <entity>",example:"which modules import src/core/model.mjs",answers:"the imports edge, read forwards"},{form:"what is <relation-verb-passive> <entity>",example:"what is imported by src/core/store.mjs",answers:"the same edge, read backwards \u2014 a passive is the opposite direction, not a synonym"},{form:"what <relation-verb> <entity>",example:"what uses src/lib/http.mjs",answers:"the uses union: imports plus calls"},{form:"where is <entity> <where-marker>",example:"where is saveStore defined",answers:"the definition's file and line span"},{form:"when did <entity> change",example:"when did src/core/store.mjs change",answers:"the commits that touched it, newest first"}],whereMarkers:bn}},{name:"tmct_describe",tier:"cold",summary:"Locate one symbol and list its typed edges (both directions) with provenance.",inputSchema:Tn("A module path, symbol name, or Class.method."),example:{symbol:"django/utils/text.py"}},{name:"tmct_signature",tier:"cold",summary:"One symbol's API surface (params, returns, raises/catches, flags, decorators, doc) without the body.",inputSchema:Tn("A function, method, or Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_impact",tier:"cold",summary:"Transitive reverse closure over imports/calls \u2014 what breaks if a module or symbol changes, by depth, with tests.",inputSchema:Cg("The module (or a symbol it defines) whose dependents you want."),example:{module:"django/utils/text.py"}},{name:"tmct_search",tier:"cold",summary:"Free-text/ranked lookup over the code-map to find the right module or symbol.",inputSchema:{type:"object",required:[],properties:{query:{type:"string",description:"Free text to rank against the code-map. Required unless kind narrows the search on its own."},kind:{type:"string",description:"Restrict to an entity class, e.g. function, class, module."},decorator:{type:"string",description:"Restrict to definitions carrying this decorator."},name:{type:"string",description:"Restrict to definitions whose name matches."}}},example:{query:"template filters",kind:"function"}},{name:"tmct_members",tier:"cold",summary:"A class's methods + attributes (file:line, decorators) in one slice.",inputSchema:Ig("The class whose members you want."),example:{class:"Truncator"}},{name:"tmct_subclasses",tier:"cold",summary:"A class's base classes plus the transitive set of classes that extend it.",inputSchema:Ig("The class to walk the inheritance edges of."),example:{class:"Field"}},{name:"tmct_related",tier:"cold",summary:"A term's synonyms (skos:altLabel) and related concepts (skos:related), from the memory graph's relation facts.",inputSchema:{type:"object",required:["term"],properties:{term:{type:"string",description:"The term whose synonyms / related concepts you want."}}},example:{term:"sofa"}},{name:"tmct_sprite",tier:"cold",summary:"The sprite markup for a class, resolved up the taught rdfs:subClassOf chain \u2014 with the expression and size asked for, and the ancestor chain the resolver walked to find it.",inputSchema:{type:"object",required:["class"],properties:{class:{type:"string",description:"The class to draw, e.g. spider. Resolved through the memory graph's own rdfs:subClassOf taxonomy."},expression:{type:"string",enum:KR(),description:"The face the sprite wears, as an mgx:feels value. A class whose template takes no expression parameter misses rather than dropping it."},size:{type:"string",description:"A taught size property word (mgx:hasProperty), resolved to a numeric render SCALE \u2014 the size of the thing drawn, not a choice of template tier."}}},example:{class:"spider",expression:"happy",size:"large"}},{name:"tmct_architecture",tier:"cold",summary:"Package/module map + the most-imported hub modules (optionally scoped to a package).",inputSchema:{type:"object",required:[],properties:{package:{type:"string",description:"Scope the map to one package. Omit for the whole repository."}}},example:{package:"django/template"}},{name:"tmct_exports",tier:"cold",summary:"A module's public __all__ surface, each name resolved to the module that defines it.",inputSchema:Cg("The module whose public API surface you want."),example:{module:"django/db/models/__init__.py"}},{name:"tmct_tests_for",tier:"cold",summary:"The test modules covering a symbol or module, from the typed test edges.",inputSchema:Tn("The symbol or module to find covering tests for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_untested",tier:"cold",summary:"Source modules with no covering test module \u2014 a coverage-gap view (no arguments).",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_history",tier:"cold",summary:"Recent commits that touched a symbol's module (newest first).",inputSchema:Tn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_file_history",tier:"cold",summary:"Commits that touched a symbol's module, each with author / date / subject.",inputSchema:Tn("The symbol whose module's history you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_method_history",tier:"cold",summary:"Commits that touched a specific method symbol (fine-grained), with author / date / subject.",inputSchema:Tn("A Class.method name."),example:{symbol:"Truncator.chars"}},{name:"tmct_class_history",tier:"cold",summary:"Commits that touched a specific class symbol (fine-grained), with author / date / subject.",inputSchema:Tn("A class name."),example:{symbol:"Truncator"}},{name:"tmct_callers",tier:"cold",summary:"Modules that call into a symbol's module (one hop).",inputSchema:Tn("The symbol whose callers you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_callees",tier:"cold",summary:"Modules a symbol's module calls into (one hop).",inputSchema:Tn("The symbol whose callees you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_calls",tier:"cold",summary:"The in-repo symbols a function calls (fn\u2192fn), each with file:line.",inputSchema:Tn("The function whose in-repo call sites you want."),example:{symbol:"slugify"}},{name:"tmct_cochanges",tier:"cold",summary:"Modules that historically change in the same commit as a symbol's module (git co-change).",inputSchema:Tn("The symbol whose module's change-coupling you want."),example:{symbol:"django/utils/text.py"}},{name:"tmct_context_more",tier:"cold",summary:"The bundle sections a lean tmct_context omitted (siblings / tests / cochange / class members / re-exports).",inputSchema:Tn("The symbol a lean tmct_context bundle was built for."),example:{symbol:"django/utils/text.py"}},{name:"tmct_export",tier:"cold",summary:"Every stored memory fact as JSONL (subject/predicate/object/provenance) \u2014 the shape `tmct extract` emits, for backup or audit.",inputSchema:{type:"object",required:[],properties:{}},example:{}},{name:"tmct_ingest",tier:"cold",summary:"Ground plain text into memory facts with the same deterministic recognizer the chat teach lane uses \u2014 the strict tier, plus an optional lower-trust fuzzy tier \u2014 and report the canonical triples.",inputSchema:{type:"object",required:["text"],properties:{text:{type:"string",description:"The plain text to ground into facts."},optimistic:{type:"boolean",description:"Also run the lower-trust fuzzy tier over sentences the strict recognizer skips."}}},example:{text:"A kettle is a container. An otter is a mammal.",optimistic:!0}}]),Og=ld.filter(e=>e.tier==="hot"),c2=ld.filter(e=>e.tier==="cold"),l2=Object.freeze(ld.map(e=>e.name))});var Lg,Le,Qt=M(()=>{Qe();Lg=ne(".tmct","graph.json"),Le=class extends Error{constructor(t){super(t),this.name="ToolError"}}});function HR(e){let t=new Set;for(let n of Array.isArray(e?.individuals)?e.individuals:[])n&&n.id&&t.add(n.id);return t}function Pg(e){let t=(Array.isArray(e)?e:[]).map((c,l)=>({file:c?.file,payload:c?.payload||{},name:c?.name!=null&&String(c.name).length?String(c.name):String(l)})),n=t.map(({payload:c})=>HR(c)),s=new Map;for(let c of n)for(let l of c)s.set(l,(s.get(l)||0)+1);let o=new Set([...s.entries()].filter(([,c])=>c>1).map(([c])=>c)),r={generated_at:"",classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}},i="",a=t.length>0;for(let{payload:c,name:l}of t){a=a&&!!c.bootstrap,typeof c.generated_at=="string"&&c.generated_at>i&&(i=c.generated_at);let u=p=>o.has(p)?`${l}/${p}`:p;Array.isArray(c.classes)&&r.classes.push(...c.classes),Array.isArray(c.vocabulary)&&r.vocabulary.push(...c.vocabulary);for(let p of Array.isArray(c.individuals)?c.individuals:[]){if(!p)continue;let f={...p};f.id&&(f.id=u(f.id)),Array.isArray(f.derived_from)&&(f.derived_from=f.derived_from.map(m=>u(m))),Array.isArray(f.mentions)&&(f.mentions=f.mentions.map(m=>m&&m.id?{...m,id:u(m.id)}:m)),r.individuals.push(f)}for(let p of Array.isArray(c.objectProperties)?c.objectProperties:[]){if(!p)continue;let f={...p};Array.isArray(f.examples)&&(f.examples=f.examples.map(m=>{if(!m)return m;let h={...m};return h.subject&&(h.subject=u(h.subject)),h.object&&(h.object=u(h.object)),h})),r.objectProperties.push(f)}let d=c.proseIndex&&typeof c.proseIndex=="object"?c.proseIndex:{};for(let[p,f]of Object.entries(d)){let m=r.proseIndex[p]||(r.proseIndex[p]=[]);for(let h of Array.isArray(f)?f:[]){let b=u(h);m.includes(b)||m.push(b)}}}return r.generated_at=i,a&&(r.bootstrap=!0),r}var Mg=M(()=>{});var Ar={};Nt(Ar,{clearCache:()=>qR,emptyEntities:()=>Za,fetchEntities:()=>QR,registerProvider:()=>YR});function qR(){Tr=null,Ei=null}function YR(e){if(e!=null&&typeof e!="function")throw new TypeError("registerProvider expects a function (config) => entities payload, or null");let t=Qa;return Qa=e??null,Tr=null,t}function Za(){return{generated_at:"",bootstrap:!0,classes:[],vocabulary:[],objectProperties:[],individuals:[],proseIndex:{}}}async function XR(e){let t;try{t=await Ne(e,"utf8")}catch(n){if(n?.code==="ENOENT")return Za();throw new Le(`cannot read graph artifact at ${e} (${n?.code||n?.message||n})`)}try{return JSON.parse(t)}catch{throw new Le(`graph artifact ${e} is not valid JSON`)}}async function JR(e){let t=e.graphFiles,n=[...t].map(String).sort().join("|");if(Ei&&Ei.key===n)return Ei.payload;let s=[];for(let r=0;r<t.length;r++){let i=await XR(t[r]);s.push({file:t[r],payload:i,name:e.graphNames?.[r]})}let o=Pg(s);return Ei={key:n,payload:o},o}async function QR(e){let t=e||{};if(Qa){let o;try{o=await Qa(t)}catch(r){throw r instanceof Le?r:new Le(`graph provider failed (${r?.message||r})`)}if(!o||typeof o!="object")throw new Le("graph provider returned no entities payload");return o}if(Array.isArray(t.graphFiles)&&t.graphFiles.length>1)return JR(t);if(!t.graphFile)return Za();if(Tr&&Tr.file===t.graphFile)return Tr.payload;let n;try{n=await Ne(t.graphFile,"utf8")}catch(o){if(o?.code==="ENOENT")return Za();throw new Le(`cannot read graph artifact at ${t.graphFile} (${o?.code||o?.message||o})`)}let s;try{s=JSON.parse(n)}catch{throw new Le(`graph artifact ${t.graphFile} is not valid JSON`)}return Tr={file:t.graphFile,payload:s},s}var Tr,Ei,Qa,xi=M(()=>{Lt();Qt();Mg();Tr=null,Ei=null,Qa=null});function Vn(e){if(!e)return[];let t=String(e).replace(/\.[A-Za-z0-9]+$/,"");return t=t.replace(/[/\\]/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([A-Za-z])([0-9])/g,"$1 $2").replace(/([0-9])([A-Za-z])/g,"$1 $2").replace(/[_\-.]+/g," "),t.split(/\s+/).map(n=>n.toLowerCase()).filter(n=>n.length>1&&n.length<=Dg)}function ud(e){if(!e)return[];let t=[],n=new Set;for(let s of String(e).toLowerCase().split(/[^a-z0-9]+/))if(!(s.length<2||s.length>Dg||Fg.has(s))&&!n.has(s)&&(n.add(s),t.push(s),t.length>=ZR))break;return t}function ec({name:e,doc:t}={}){return[...new Set([...Vn(e),...ud(t)])].sort()}function dd(e){let t=Object.create(null);for(let n of e){let s=(n.attributes||[]).find(o=>o.key==="prose_tokens");if(s?.value)for(let o of s.value.split(" "))t[o]||(t[o]=[]),t[o].push(n.id)}for(let n of Object.keys(t))t[n].sort();return t}function Fo(e,t,{limit:n=10}={}){let s=[...new Set([...Vn(t),...ud(t)])];if(!s.length)return[];let o=new Map;for(let r of s)for(let i of e?.[r]||[])o.set(i,(o.get(i)||0)+1);return[...o.entries()].sort((r,i)=>i[1]-r[1]||String(r[0]).localeCompare(i[0])).slice(0,n).map(([r,i])=>({id:r,score:i}))}function Bg(e,t){let n=e&&(e["tmct:layers"]?e:e.proseIndex),s=n&&n["tmct:layers"],o=String(t||"").toLowerCase(),r={ids:[],via:null};if(!o||!s||typeof s!="object")return r;let i=new Set,a=new Set;for(let c of Object.keys(s)){let l=s[c];if(!l||typeof l!="object")continue;let u=l[o],d=Array.isArray(u)?u:Array.isArray(u?.ids)?u.ids:null;if(d?.length){for(let p of d)i.add(p);a.add(c)}}return i.size?{ids:[...i].sort(),via:[...a].sort().join("+")}:r}var Fg,Dg,ZR,zg,Kn=M(()=>{Fg=new Set("a an and or but the of to in on at for with from by as is are was were be been being it its this that these those i you he she they we me my your our do does did not no yes if then else than so such can will would should could may might about into over under out up down off again more most some any all what which who whom whose when where why how".split(/\s+/)),Dg=40,ZR=120;zg=e=>/^[a-z0-9]+$/.test(e)&&!Fg.has(e)});function Ug(e){let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(":"),r=o>=0?n.slice(o+1):"";return{createdAt:s,...r?{sessionId:r}:{}}}function e_(e){if(!e.startsWith(Gg))return null;let t=e.indexOf("@"),n=t>=0?e.slice(0,t):e,s=t>=0?e.slice(t+1):"",o=n.indexOf(Wg);if(o<0)return null;let r=n.slice(o+Wg.length);return r?{kind:"teachNode",nodeId:r,displayName:n.slice(Gg.length,o),createdAt:s}:null}function s_(e){if(e.startsWith("news:"))return fd(e);let{pack:t}=md(e.slice(9));return`research:${t}`}function md(e){let t=e.lastIndexOf("@");if(t>=0)return{kind:"referenceLive",pack:"research",article:e.slice(0,t).trim()||"unknown"};let n=e.indexOf(":");return n<0?{kind:"referenceLive",pack:"research",article:e.trim()||"unknown"}:{kind:"referenceLive",pack:e.slice(0,n)||"research",article:e.slice(n+1).trim()}}function Vg(e){if(!e.sessionId?.startsWith(pd))return null;let t=e.sessionId.slice(pd.length);if(t.startsWith("teach:")||t.startsWith("ace:"))return null;let n=An(t);return n?{...n,...e.createdAt?{createdAt:e.createdAt}:{}}:null}function An(e){let t=String(e||"").trim();if(!t)return null;if(t.startsWith("reference:")){let s=t.slice(10),o=s.indexOf(":");if(o<0)return{kind:"reference",pack:s||"unknown",article:""};let r=s.slice(0,o)||"unknown";return{kind:n_(r),pack:r,article:s.slice(o+1)}}if(t.startsWith("research:"))return md(t.slice(9));let n=t.split(/\s+/)[0];if(n.startsWith("corpus-weak:"))return{kind:"corpusWeak",name:n.slice(12)||"unknown"};if(n.startsWith("corpus:"))return{kind:"corpus",name:n.slice(7)||"unknown"};if(n.startsWith("child:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("world:"))return{kind:"corpus",name:n.slice(6).split(":")[0]||"unknown"};if(n.startsWith("mud:"))return{kind:"corpus",name:`mud:${n.slice(4).split(":")[0]||"unknown"}`};if(n.startsWith("ace:")){let s=Ug(n.slice(4));return Vg(s)||{kind:"operator",...s}}if(n.startsWith("teach:")){let s=n.slice(6),o=e_(s);if(o)return o;let r=Ug(s);return Vg(r)||{kind:"teach",...r}}if(n.startsWith("web:"))return{kind:"web",url:n.slice(4)};if(n.startsWith("url:"))return{kind:"web",url:n.slice(4)};if(n.startsWith("news-fixture:"))return{kind:"corpus",name:n.slice(13).split("@")[0]||"unknown"};if(n.startsWith("extracted:news:"))return{kind:"web",url:fd(n.slice(10))};if(n.startsWith("news:"))return{kind:"web",url:fd(n)};if(n.startsWith("extracted:research:"))return md(n.slice(19));if(n.startsWith("optimistic-extract:")){let s=n.slice(19);return{kind:"optimisticExtract",name:(s.startsWith("news:")||s.startsWith("research:")?s_(s):s)||"unknown"}}return n.startsWith("extracted:")?{kind:"extracted",name:n.slice(10)||"unknown"}:n.startsWith("entailed:")?{kind:"entailed",rule:n.slice(9)}:n.startsWith("chat:")||n.startsWith("session:")||n.startsWith("operator")?{kind:"operator"}:null}function Xg(e){let t=(e?.attributes||[]).find(s=>s.prop==="mgx:sourceReliability")?.value;if(t===void 0)return Hg;let n=Number(t);return Number.isFinite(n)?Math.max(hd,Math.min(Yg,n)):Hg}function Jg(e,t=Date.now(),n=o_){let s=Date.parse(e);if(!Number.isFinite(s))return 1;let o=Math.max(0,t-s);return Kg+(1-Kg)*Math.pow(.5,o/n)}function Qg(e,t={},n={}){let s=typeof n.now=="number"?n.now:Date.now(),o=Array.isArray(e?.sourceIds)?e.sourceIds:[],r=new Set,i=[],a=[];for(let f of o){if(r.has(f))continue;r.add(f);let m=t[f],h=r_(m);if(!h)continue;i.push(h);let b=(_s[h]??0)*Xg(m);a.push(Math.max(0,Math.min(1,b)))}let c=0,l=1;for(let f of a)l*=1-f;if(a.length&&(c=Math.min(1,1-l)),i.includes("entailed")&&Array.isArray(n.premiseTrusts)&&n.premiseTrusts.length){let f=typeof n.ruleConfidence=="number"?n.ruleConfidence:1;c=Math.max(0,Math.min(1,Math.min(...n.premiseTrusts)*f))}let u=Jg(e?.createdAt,s,n.halfLifeMs),d=Cr(Math.min(1,c*u)),p={sourceTypes:i.slice().sort(),corroboration:i.length,createdAt:e?.createdAt||"",recency:Cr(u)};return{score:d,inputs:p}}function nc(e,t){let n=(_s[e]??0)*Xg(t);return Cr(Math.max(0,Math.min(1,n)))}function i_(e){if(e==="operator")return 1;let t=_s[e];return t===void 0?1:(t+1)/2}function sc(e,t={}){let n=typeof t.now=="number"?t.now:Date.now(),s=Array.isArray(e)?e:[],o=new Map,r=[];for(let a of s){let c=Jg(a?.assertedAt,n,t.halfLifeMs),l=Math.max(0,Math.min(1,Number(a?.ownTrust)||0)),u=a?.sourceType||"",d=Math.max(0,Math.min(1,l*c)),p=o.get(u)||{complement:1,strongest:0};p.complement*=1-d,p.strongest=Math.max(p.strongest,d),o.set(u,p),r.push({sourceId:a?.sourceId||"",sourceType:u,ownTrust:l,recency:Cr(c)})}let i=1;for(let[a,c]of o){let l=Math.max(i_(a),c.strongest);i*=1-Math.min(1-c.complement,l)}return{score:s.length?Cr(Math.min(1,1-i)):0,inputs:r}}function Zg(e){return sc(e,{halfLifeMs:a_})}function eb({factsAsserted:e=0,factsContradicted:t=0}={}){let n=Math.max(0,Number(e)||0),s=Math.max(0,Number(t)||0),o=Math.max(-1,Math.min(1,(n-2*s)/Math.max(1,n))),r=n/(n+c_),i=(o*r+1)/2;return Cr(hd+(Yg-hd)*i)}var Ir,tc,ut,Rs,Wg,Gg,t_,n_,fd,pd,_s,gd,qg,o_,Kg,hd,Yg,Hg,Cr,r_,a_,c_,Cn=M(()=>{Ir="mgx:trustScore",tc="mgx:trustInputs",ut="mgx:createdAt",Rs="mgx:updatedAt";Wg="#node:",Gg="peer:";t_="wikipedia-live",n_=e=>e===t_?"referenceLive":"reference",fd=e=>String(e||"").split("@")[0];pd="ingest#";_s=Object.freeze({operator:1,teach:.95,provider:.9,corpus:.7,reference:.6,corpusWeak:.55,referenceLive:.5,extracted:.45,web:.4,optimisticExtract:.35,entailed:.3}),gd=Object.freeze({operator:{subClass:"tmct:AgentSource",prov:"prov:Agent"},teach:{subClass:"tmct:AgentSource",prov:"prov:Agent"},provider:{subClass:"tmct:AgentSource",prov:"prov:Agent"},corpus:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},corpusWeak:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},reference:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},referenceLive:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},web:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},extracted:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},optimisticExtract:{subClass:"tmct:DocumentSource",prov:"prov:Entity"},entailed:{subClass:"tmct:ActivitySource",prov:"prov:Activity"}}),qg=new Set(Object.entries(gd).filter(([,e])=>e.prov==="prov:Agent").map(([e])=>e)),o_=720*60*60*1e3,Kg=.9,hd=.5,Yg=1.5,Hg=1,Cr=(e,t=6)=>Number(e.toFixed(t)),r_=e=>(e?.attributes||[]).find(t=>t.prop==="mgx:sourceType")?.value||"";a_=1/0;c_=19});var Do,bd=M(()=>{Do=e=>/(^|\/)tests?\//.test(e)||/(^|\/)test_[^/]*\.py$/.test(e)||/\.tests(\.|$)/.test(e)||/(^|\/)[^/]*[-_]tests?\//.test(e)||/\.(test|spec)\.[cm]?[jt]sx?$/.test(e)});function wd(e,t){return Math.log(1+e/(1+t))}var ji=M(()=>{});var rc={};Nt(rc,{bfsLevels:()=>oc,findActionPath:()=>ki,findReachableSet:()=>yd});function tb(e){return e&&typeof e=="object"?JSON.stringify(e):String(e)}function nb(e,t){let n=[];for(let{action:s,nextState:o}of t(e)||[])n.push({state:o,actions:[s],states:[e,o]});return n}function ki(e,t,n,{maxDepth:s=50,stateKey:o=tb}={}){if(t(e))return{actions:[],states:[e]};let r=nb(e,n),i=new Set([o(e)]);for(let a=1;a<=s&&r.length;a+=1){for(let l of r)if(t(l.state))return{actions:l.actions,states:l.states};if(a===s)break;let c=[];for(let l of r){let u=o(l.state);if(!i.has(u)){i.add(u);for(let{action:d,nextState:p}of n(l.state)||[]){let f=o(p);i.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}}r=c}return null}function yd(e,t,{maxDepth:n=50,stateKey:s=tb}={}){let o=nb(e,t),r=new Set([s(e)]),i=[];for(let a=1;a<=n&&o.length;a+=1){let c=[];for(let l of o){let u=s(l.state);if(!r.has(u)&&(r.add(u),i.push({node:l.state,path:{actions:l.actions,states:l.states}}),a!==n))for(let{action:d,nextState:p}of t(l.state)||[]){let f=s(p);r.has(f)||c.push({state:p,actions:[...l.actions,d],states:[...l.states,p]})}}o=c}return i}function*oc(e,t,{maxDepth:n=8,keyOf:s=o=>o}={}){let o=new Set([e]),r=[e];for(let i=1;i<=n&&r.length;i+=1){let a=[],c=[];for(let l of r)for(let u of t(l)||[]){let d=s(u);o.has(d)||(o.add(d),a.push(u),c.push(d))}r=c,yield a}}var Ts=M(()=>{});function ac(e){let t=Array.isArray(e?.individuals)?e.individuals:[],n=new Map;for(let r of t)r&&r.id&&n.set(r.id,r);let s=(Array.isArray(e?.objectProperties)?e.objectProperties:[]).filter(r=>r&&(r.predicate||r.prop)).map(r=>{let i=(Array.isArray(r.examples)?r.examples:[]).filter(a=>a&&a.subject&&a.object);return{predicate:String(r.predicate||""),prop:r.prop||null,count:Number(r.count)||i.length,edges:i}}),o=s.filter(r=>r.count>r.edges.length).map(r=>({predicate:r.predicate,count:r.count,shown:r.edges.length}));return{individuals:t,byId:n,relations:s,truncated:o,generatedAt:e?.generated_at||null,proseIndex:e?.proseIndex||{}}}function Ri(e){return!e||!Array.isArray(e.individuals)?0:e.individuals.filter(t=>(t.class||"")==="Module").length}function Is(e){let t=String(e?.prop||"").toLowerCase();if(sb[t])return sb[t];let n=String(e?.predicate||"").toLowerCase();if(/symbol/.test(n)){if(/\b(call|invoke)/.test(n))return"callsSymbol";if(/(touch|chang|modif)/.test(n))return"touchesSymbol"}return/\bimport/.test(n)?"imports":/\b(call|invoke)/.test(n)?"calls":/\b(define|export|declare)/.test(n)?"defines":/\b(test|cover)/.test(n)?"tests":/\b(touch|chang|modif)/.test(n)?"touches":/\bcontain/.test(n)?"contains":/\b(inherit|subclass|extend|specializ)/.test(n)?"inherits":/denot/.test(n)?"denotes":/\bserve/.test(n)?"serves":null}function Zt(e){return String(e||"").trim().toLowerCase().replace(/^\.\//,"").replace(/^\//,"")}function $d(e){let t=Zt(e).split("/");return t[t.length-1]}function l_(e){return(e?.derived_from||[]).filter(gb).length}function ob(e){return(e?.mentions||[]).reduce((n,s)=>n+(Number(s?.count)||0),0)+l_(e)}function $n(e,t){let n=Zt(t);if(!n)return{match:null,candidates:[]};let s=$d(n),o=!n.includes("/"),r=[];for(let i of e.individuals){let a=Zt(i.label),c=String(i.id||"").toLowerCase(),l=0;a===n||c===n?l=100:a.endsWith(`/${n}`)||o&&($d(a)===s||$d(a).replace(/\.[a-z]+$/,"")===s)?l=80:a.includes(n)&&(l=Math.max(10,50-(a.length-n.length))),l>0&&r.push({ind:i,score:l})}return r.sort((i,a)=>a.score-i.score||ob(a.ind)-ob(i.ind)||String(i.ind.label).length-String(a.ind.label).length),{match:r[0]?.ind||null,candidates:r.slice(1,5).map(i=>i.ind)}}function Kt(e){let t=(e?.attributes||[]).find(s=>s.key==="site");if(!t)return null;let n=String(t.value).match(/^(.*):(\d+)(?:-(\d+))?$/);return n?{path:n[1],start:Number(n[2]),end:n[3]?Number(n[3]):Number(n[2])}:null}function u_(e,t){let n=[],s=[];for(let o of e.relations){let r=o.edges.filter(a=>a.subject===t),i=o.edges.filter(a=>a.object===t);r.length&&n.push({group:o,edges:r}),i.length&&s.push({group:o,edges:i})}return{out:n,incoming:s}}function rb(e){return e.prop?`${e.predicate} [${e.prop}]`:e.predicate}function Cs(e){let t=e||"Entity",n=Vn(t);return n.length<2?t:n.map(s=>s[0].toUpperCase()+s.slice(1)).join(" ")}function $t(e,t,n=", "){return e.length<=t?e.join(n):e.slice(0,t).join(n)+`, +${e.length-t} more`}function kd(e,t,{candidates:n=[]}={}){let s=[];s.push(`${t.label} \u2014 ${Cs(t.class)} (id: ${t.id})`);let o=(t.derived_from||[]).filter(gb);o.length&&s.push(`attestation: ${o.length} provenance ref(s)`);for(let c of t.attributes||[])s.push(`attribute: ${c.key} = ${c.value}${c.prop?` [${c.prop}]`:""}`);let{out:r,incoming:i}=u_(e,t.id);if(!r.length&&!i.length)s.push("edges: none in the current artifact");else{s.push("edges:");for(let{group:c,edges:l}of r)s.push(` ${rb(c)} (${l.length}) \u2192 ${$t(l.map(u=>u.objectLabel||u.object),ib)}`);for(let{group:c,edges:l}of i)s.push(` \u2190 ${rb(c)} (${l.length}) by ${$t(l.map(u=>u.subjectLabel||u.subject),ib)}`)}let a=t.derived_from||[];return a.length&&s.push(`provenance: ${$t(a,d_)}`),n.length&&s.push(`other matches: ${n.map(c=>`${c.label} (${Cs(c.class)})`).join(", ")}`),e.truncated.length&&s.push(f_(e)),s.join(`
2
+ `)}function f_(e){return`note: partial edge lists for: ${e.truncated.map(n=>`${n.predicate} (${n.shown}/${n.count})`).join(", ")}. Counts are complete; the lists are not.`}function Nr(e,t,{maxDepth:n=8,includeCycleReturn:s=!1}={}){let o=new Map,r=new Map,i=(c,l,u,d)=>{!c||!l||c===l||(o.has(c)||o.set(c,[]),o.get(c).push({id:l,label:u,via:d}))};for(let c of e.relations){let l=Is(c);if(l==="imports"||l==="calls")for(let u of c.edges)i(u.object,u.subject,u.subjectLabel||u.subject,c.predicate);else if(l==="callsSymbol")for(let u of c.edges){let d=As(e,u.subject),p=As(e,u.object);if(!d||!p)continue;let f=e.byId.get(d)?.label||d;i(p,d,f,c.predicate),d!==p&&i(u.object,d,f,c.predicate)}else if(l==="tests")for(let u of c.edges)r.has(u.object)||r.set(u.object,[]),r.get(u.object).push(u.subjectLabel||u.subject);else if(l==="serves")for(let u of c.edges)i(u.subject,u.object,u.objectLabel||u.object,c.predicate)}let a=[];for(let c of oc(t.id,l=>o.get(l)||[],{maxDepth:n,keyOf:l=>l.id})){if(!c.length)continue;let l=c.map(u=>({...u,tests:r.get(u.id)||[]})).sort((u,d)=>String(u.label).localeCompare(String(d.label)));a.push(l)}for(let c=0;s&&c<a.length;c+=1){let l=a[c].flatMap(d=>(o.get(d.id)||[]).filter(p=>p.id===t.id)).sort((d,p)=>String(d.via).localeCompare(String(p.via)));if(!l.length)continue;let u={...l[0],tests:r.get(t.id)||[]};a[c+1]||(a[c+1]=[]),a[c+1]=[...a[c+1],u].sort((d,p)=>String(d.label).localeCompare(String(p.label)));break}return a}function bb(e,t,{maxDepth:n=8}={}){let s=Nr(e,t,{maxDepth:n}),o=[`Impact of changing ${t.label} (reverse closure over imports/calls edges, module- and function-level):`];s.length||o.push("no dependents found in the current artifact \u2014 nothing imports or calls it (or its edges are not in the extracted graph yet).");let r=s.reduce((a,c)=>a+c.length,0);s.length&&o.push(`total: ${r} dependent(s) across ${s.length} depth level(s) (lists capped for brevity).`),s.forEach((a,c)=>{if(c>=p_){o.push(`depth ${c+1}: ${a.length} more dependent(s) (not listed)`);return}o.push(c===0?`depth 1 (${a.length} direct dependents):`:`depth ${c+1} (${a.length}):`);for(let l of a.slice(0,vd)){let u=l.tests.length?`tests: ${$t(l.tests,m_)}`:"tests: none recorded",d=c===0?`${l.via} it`:"reaches it through an intermediary";o.push(` - ${l.label} (${d}) \u2014 ${u}`)}a.length>vd&&o.push(` \u2026+${a.length-vd} more at depth ${c+1}`)});let i=e.truncated.filter(a=>{let c=Is({predicate:a.predicate});return c==="imports"||c==="calls"||c==="callsSymbol"||c==="tests"||c==="serves"});return i.length&&o.push("warning: partial edge lists ("+i.map(a=>`${a.predicate}: ${a.shown}/${a.count}`).join(", ")+") \u2014 this closure may be missing edges. Cross-check critical results with a lexical search (/find <term>)."),o.join(`
3
+ `)}function wb(e){let t=new Map;for(let n of e.relations)if(Is(n)==="defines")for(let s of n.edges)t.has(s.subject)||t.set(s.subject,[]),t.get(s.subject).push(s.objectLabel||s.object);return t}function cb(e){return new Set(String(e).replace(/([a-z0-9])([A-Z])/g,"$1_$2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Eb(e,t,n=null){let s=n||(i=>As(e,i)),o=new Map,r=(i,a)=>{!i||!a||i===a||(o.has(i)||o.set(i,new Set),o.has(a)||o.set(a,new Set),o.get(i).add(a),o.get(a).add(i))};for(let i of t)for(let a of Te(e,i))r(s(a.subject),s(a.object));return o}function X_(e,t,n){if(t.length<2)return;let s=new Map(t.map(l=>[l.ind.id,l])),o=new Map(t.map(l=>[l.ind.id,l.score])),r=l=>{if(!l.size)return[[],[]];let u=0;for(let m of l.values())u=Math.max(u,m);let d=[...l.entries()].sort((m,h)=>h[1]-m[1]),p=[],f=[];for(let[m,h]of d)h>=u*z_&&p.length<n?p.push([m,h]):f.length<ab&&f.push([m,h]);return[p,f]},[i,a]=r(new Map(t.map(l=>[l.ind.id,l.score]))),c=new Set(i.map(([l])=>l));for(let l=0;l<W_&&i.length;l++){let u=new Map,d=[];for(let p of G_){let f=Eb(e,p),m=new Map;for(let[g,w]of i)for(let y of f.get(g)||[])o.has(y)&&m.set(y,Math.max(m.get(y)||0,w));let[h,b]=r(m);for(let[g,w]of h)u.set(g,Math.max(u.get(g)||0,w));d.push(...b)}a.push(...d);for(let[p,f]of u){if(c.has(p))continue;let m=s.get(p);m&&(m.score+=Math.min(f*B_,m.score*U_),c.add(p))}i=[...u.entries()],!i.length&&a.length&&(i=a.splice(0,ab).filter(([p])=>!c.has(p)))}}function J_(e,t=[],{depth:n=$b,q:s=Sb,nodeLimit:o=vb,kinds:r=V_,classPredicate:i=u=>(u.class||"")==="Module",idNormalizer:a=null,seeds:c=null,hubDegree:l=1/0}={}){let u=new Map(t.map(x=>[x.ind.id,x])),d=0;for(let x of t)d=Math.max(d,x.score);let p=t.length>0&&d>0,f=new Set(c??u.keys());if(!f.size)return[];let m=Eb(e,r,a),h=x=>m.get(x)?.size||0,b=[],g=(x,_)=>x.hop!==_.hop?x.hop<_.hop:x.deg!==_.deg?x.deg<_.deg:x.id<_.id,w=(x,_)=>{let $=b[x];b[x]=b[_],b[_]=$},y=x=>{b.push(x);let _=b.length-1;for(;_>0;){let $=_-1>>1;if(g(b[_],b[$]))w(_,$),_=$;else break}},v=()=>{let x=b[0],_=b.pop();if(b.length){b[0]=_;let $=0;for(;;){let T=2*$+1,C=2*$+2,E=$;if(T<b.length&&g(b[T],b[E])&&(E=T),C<b.length&&g(b[C],b[E])&&(E=C),E===$)break;w($,E),$=E}}return x},R=new Set(f);for(let x of f)y({id:x,hop:0,deg:h(x)});let S=null,j=0,I=[];for(;b.length&&j<o;){let x=v();if(I.push({id:x.id,hop:x.hop}),!f.has(x.id)){if(p){let T=d*K_*Math.pow(H_,x.hop-1),C=u.get(x.id);if(C)C.score+=Math.min(T*q_,C.score*Y_);else{let E=e.byId?.get?.(x.id);if(E&&i(E)){S||(S=wb(e));let k=S.get(E.id)||[],P={ind:E,score:T,defineCount:k.length,matching:[],density:0};t.push(P),u.set(x.id,P)}}}j++}if(x.hop>=n||x.hop>0&&h(x.id)>l)continue;let _=[];for(let T of m.get(x.id)||[]){if(R.has(T))continue;let C=e.byId?.get?.(T);!C||!i(C)||_.push({id:T,deg:h(T)})}if(!_.length)continue;_.sort((T,C)=>T.deg-C.deg||(T.id<C.id?-1:T.id>C.id?1:0));let $=Math.max(1,Math.floor(s*_.length));for(let T=0;T<$;T++){let C=_[T];R.add(C.id),y({id:C.id,hop:x.hop+1,deg:C.deg})}}return I}function xb(e,t,n={}){let{demoteNonProd:s=!1,callAdjacency:o=!1,implOfInterface:r=!1,beamSearch:i=!1,spiral:a=!1,proseBoost:c=!1,proseLayers:l=!1,literalMention:u=!1,rawQuery:d=""}=n,p=Number.isFinite(n.beamWidth)&&n.beamWidth>0?n.beamWidth:8,f=wb(e),m=[];for(let v of e.individuals){if((v.class||"")!=="Module")continue;let R=String(v.label),S=R.toLowerCase(),j=f.get(v.id)||[],I=new Set(j.map($=>$.toLowerCase())),x=new Set;for(let $ of j)for(let T of cb($))x.add(T);let _=u?String((v.attributes||[]).find($=>$.key==="dotted")?.value||"").toLowerCase():"";m.push({ind:v,label:R,labelLc:S,defines:j,symSet:I,symComps:x,dotted:_})}let h=m.length||1,b=new Map,g=v=>{let R=0;for(let S of m)(S.labelLc.includes(v)||S.symComps.has(v)||S.symSet.has(v))&&R++;return R},w=v=>(b.has(v)||b.set(v,wd(h,g(v))),b.get(v));for(let v of t)w(v);let y=[];for(let v of m){let R=0,S=0,j=0,I=[];for(let C of t){let E=b.get(C)||0;E&&(v.symSet.has(C)?(R+=E*yb,j++):v.symComps.has(C)&&(I.push(E),j++),v.labelLc.includes(C)&&(S+=E*g_))}I.sort((C,E)=>E-C);let x=0;for(let C=0;C<Math.min(I.length,w_);C++)x+=I[C]*b_;let _=R+S+x;if(!_)continue;s&&(Do(v.labelLc)||S_(v.labelLc))?_*=v_:Do(v.labelLc)&&(_*=.4);let $=v.defines.filter(C=>{let E=C.toLowerCase(),k=cb(C);return t.some(P=>E===P||k.has(P))}),T=v.defines.length?j/v.defines.length:0;y.push({ind:v.ind,score:_,defineCount:v.defines.length,matching:$,density:T})}if(u&&d&&y.length){let v=String(d).toLowerCase(),R=x=>x!=null&&/[a-z0-9_./]/.test(x),S=x=>{for(let _=v.indexOf(x);_!==-1;_=v.indexOf(x,_+1))if(!R(v[_-1])&&!R(v[_+x.length]))return!0;return!1},j=new Map(m.map(x=>[x.ind.id,x])),I=0;for(let x of y)I=Math.max(I,x.score);for(let x of y){let _=j.get(x.ind.id);if(!_)continue;let $=0;for(let T of new Set([_.dotted,_.labelLc])){if(!T||T.split(/[./]+/).filter(Boolean).length<P_||!S(T))continue;let C=[...new Set(T.split(/[^a-z0-9_]+/).filter(Boolean))].map(w).sort((k,P)=>P-k),E=0;for(let k=0;k<Math.min(C.length,M_);k++)E+=C[k]*L_;$=Math.max($,E)}$&&(x.score+=Math.min($*F_,I*D_))}}if(y.length>1){let v=new Map(y.map(S=>[S.ind.id,S.score])),R=new Map;for(let S of Te(e,"imports"))!v.has(S.subject)&&!v.has(S.object)||(R.has(S.subject)||R.set(S.subject,new Set),R.has(S.object)||R.set(S.object,new Set),R.get(S.subject).add(S.object),R.get(S.object).add(S.subject));for(let S of y){let j=0;for(let I of R.get(S.ind.id)||[])j=Math.max(j,v.get(I)||0);S.score+=Math.min(j*y_,S.score*$_)}}if(o&&y.length>1){let v=new Map(y.map(S=>[S.ind.id,S.score])),R=new Map;for(let S of["calls","callsSymbol"])for(let j of Te(e,S)){let I=As(e,j.subject),x=As(e,j.object);!I||!x||I===x||!v.has(I)&&!v.has(x)||(R.has(I)||R.set(I,new Set),R.has(x)||R.set(x,new Set),R.get(I).add(x),R.get(x).add(I))}for(let S of y){let j=0;for(let I of R.get(S.ind.id)||[])j=Math.max(j,v.get(I)||0);S.score+=Math.min(j*E_,S.score*x_)}}if(r&&y.length>1){let v=new Map(y.map(S=>[S.ind.id,S.score])),R=new Map;for(let S of e.individuals)(S.class||"")==="Class"&&S.label&&R.set(String(S.label),S);for(let S of y){if(!R_(S.ind.label))continue;let j=0;for(let I of Te(e,"inherits")){if(As(e,I.subject)!==S.ind.id||!__(I.objectLabel))continue;let _=As(e,I.object);if(!_){let $=R.get(String(I.objectLabel||""));$&&(_=ss(e,$))}_&&(j=Math.max(j,v.get(_)||0))}S.score+=Math.min(j*j_,S.score*k_)}}if(c&&y.length&&e.proseIndex){let v=Fo(e.proseIndex,t.join(" "),{limit:C_});if(v.length){let R=new Map;for(let{id:S,score:j}of v){let I=As(e,S);I&&R.set(I,(R.get(I)||0)+j)}for(let S of y){let j=R.get(S.ind.id)||0;j&&(S.score+=Math.min(j*T_,S.score*A_))}}}if(l&&y.length&&e.proseIndex){let v=new Map(y.map(j=>[j.ind.id,j])),R=new Map(m.map(j=>[j.ind.id,j])),S=new Map;for(let j of new Set(t)){let I=b.get(j)||0;if(!I)continue;let{ids:x}=Bg(e.proseIndex,j);if(!x.length)continue;let _=new Set;for(let $ of x){let T=As(e,$);if(!T||_.has(T)||(_.add(T),!v.has(T)))continue;let C=R.get(T);C&&(C.symSet.has(j)||C.symComps.has(j)||C.labelLc.includes(j))||S.set(T,(S.get(T)||0)+I*N_)}}for(let j of y){let I=S.get(j.ind.id)||0;I&&(j.score+=Math.min(I*I_,j.score*O_))}}return i&&y.length>1&&X_(e,y,p),a&&y.length&&J_(e,y,{depth:Number.isFinite(n.spiralDepth)&&n.spiralDepth>0?n.spiralDepth:$b,q:Number.isFinite(n.mostDistinctiveBeams)&&n.mostDistinctiveBeams>0?n.mostDistinctiveBeams:Sb,nodeLimit:Number.isFinite(n.spiralNodeLimit)&&n.spiralNodeLimit>0?n.spiralNodeLimit:vb}),y.sort((v,R)=>R.score-v.score||R.density-v.density||v.defineCount-R.defineCount||String(v.ind.label).length-String(R.ind.label).length),y}function jb(e,t,n={}){let s=String(t||""),o=s.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);if(!o.length)return[];let r=n.literalMention?{...n,rawQuery:s}:n;return xb(e,o,r).map(i=>({path:String(i.ind.label),score:i.score}))}function Z_(e){let t=0,n=!1,s=!1,o=!1,r="",i=!1,a=()=>{t+=1,r===")"&&(n=!0),i=!0};for(let c=0;c<e.length;c++){let l=e[c];if(l==="\\"){let u=e[c+1]||"";!o&&u>="1"&&u<="9"&&(s=!0),c+=1,r="",i=!1;continue}if(o){l==="]"&&(o=!1,r="]",i=!1);continue}if(l==="["){o=!0,r="[",i=!1;continue}if(l==="?"&&(r==="("||i)){r="?",i=!1;continue}if(l==="*"||l==="+"||l==="?"){a(),r=l;continue}if(l==="{"){let u=e.indexOf("}",c),d=u===-1?"":e.slice(c+1,u);if(u!==-1&&/^\d+(,\d*)?$/.test(d)){a(),c=u,r="}";continue}r="{",i=!1;continue}r=l,i=!1}return{quantifiers:t,quantifiedGroup:n,backreference:s}}function Rd(e,{now:t=Date.now}={}){let n=String(e);if(n.length>lb)return{error:`name pattern is ${n.length} characters; the limit is ${lb}.`};let{quantifiers:s,quantifiedGroup:o,backreference:r}=Z_(n);if(o)return{error:`name pattern "${n}" quantifies a group, which can backtrack for minutes on one label. Quantify a character or a class instead.`};if(r)return{error:`name pattern "${n}" uses a back-reference, which can backtrack for minutes on one label.`};if(s>ub)return{error:`name pattern "${n}" has ${s} quantifiers; the limit is ${ub}.`};let i;try{i=new RegExp(n,"i")}catch{return{error:`invalid name pattern: ${n}`}}let a=null;return{test(c){if(a===null)a=t()+db;else if(t()>a)throw new ic(`name pattern "${n}" exceeded its ${db}ms matching budget.`);return i.test(String(c).slice(0,Q_))}}}function kb(e,t,{limit:n=cc,kind:s="",decorator:o="",name:r="",toolNamePrefix:i="tmct_"}={}){let a=String(t||"").toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean),c=String(s||"").trim().toLowerCase(),l=String(o||"").trim().toLowerCase(),u=null;if(r){let m=Rd(r);if(m.error)return m.error;u=m}if(c&&c!=="module")try{return oT(e,a,{limit:n,kind:c,decFilter:l,nameRe:u,toolNamePrefix:i})}catch(m){if(m instanceof ic)return m.message;throw m}if(!a.length&&!u&&!l)return"empty query";let d=xb(e,a);if(!d.length)return`no module matches "${t}". Try broader keywords, or ${i}describe <path> if you know where it lives.`;let p=d.slice(0,n),f=[`${d.length} module(s) match "${t}" (top ${p.length}):`];for(let{ind:m,defineCount:h,matching:b}of p){let g=b.length?` \u2014 matching: ${$t([...new Set(b)],h_)}`:"";f.push(`- ${m.label} (defines ${h} symbol(s))${g}`)}return f.push(`Then ${i}describe <path> for the full sibling list + typed edges, or ${i}impact <path> for dependents.`),f.join(`
4
+ `)}function Te(e,t){let n=fb.get(e);n||(n=new Map,fb.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Is(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function As(e,t){let n=e.byId?.get?.(t);if(n)return ss(e,n);let s=String(t||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function ss(e,t){if((t?.class||"")==="Module")return t.id;let n=Kt(t);if(n)return`mod:${n.path}`;let s=String(t?.id||"").match(/^fn:(.+)#/);return s?`mod:${s[1]}`:null}function _d(e){if(!e)return"";let t=e.end>e.start?`${e.start}-${e.end}`:`${e.start}`;return` [${e.path}:${t}]`}function Or(e){return(e?.attributes||[]).find(t=>t.key==="decorators")?.value||""}function Rb(e,t,{toolNamePrefix:n="tmct_"}={}){let s=[`${t.label} \u2014 ${Cs(t.class)} (id: ${t.id})`],o=Te(e,"contains").filter(a=>a.subject===t.id);if(!o.length)return s.push(`members: none recorded (empty class, or members not in the extracted graph). Use ${n}describe for its edges.`),s.join(`
5
+ `);let r=[],i=[];for(let a of o){let c=e.byId.get(a.object),l=_d(c?Kt(c):null),u=c?Or(c):"",d=`${a.objectLabel||a.object}${l}${u?` @${u}`:""}`;((c?.class||"")==="Attribute"?i:r).push(d)}return r.length&&s.push(`methods (${r.length}): ${$t(r,pb)}`),i.length&&s.push(`attributes (${i.length}): ${$t(i,pb)}`),s.push(`Use ${n}snippet <Class.member> for an exact body.`),s.join(`
6
+ `)}function _b(e,t,{toolNamePrefix:n="tmct_"}={}){let s=Kt(t),o=[`${t.label} \u2014 ${Cs(t.class)}${_d(s)}`],r=He(t,"params"),i=He(t,"returns");(r||i||(t.class||"")==="Method"||(t.class||"")==="Function")&&o.push(`signature: ${t.label}(${r})${i?` -> ${i}`:""}`);let a=[];He(t,"isStatic")&&a.push("static"),He(t,"isAbstract")&&a.push("abstract"),He(t,"isConstant")&&a.push("constant");let c=He(t,"visibility");c&&a.push(c),a.length&&o.push(`flags: ${a.join(", ")}`);let l=Or(t);l&&o.push(`decorators: @${l.split(", ").join(", @")}`);let u=He(t,"raises");u&&o.push(`raises: ${u}`);let d=He(t,"catches");d&&o.push(`catches: ${d}`);let p=He(t,"self_fields");p&&o.push(`self fields: ${p}`);let f=He(t,"value");f&&o.push(`value: ${f}`);let m=He(t,"doc");return m&&o.push(`doc: ${m}`),o.length===1&&o.push(`(no signature detail recorded for this symbol \u2014 likely a module or attribute; use ${n}snippet for its source.)`),o.push(`Use ${n}snippet for the exact body.`),o.join(`
7
+ `)}function Tb(e,t){let n=Te(e,"inherits"),s=n.filter(c=>c.subject===t.id).map(c=>c.objectLabel||c.object),o=new Map;for(let c of n)o.has(c.object)||o.set(c.object,[]),o.get(c.object).push({id:c.subject,label:c.subjectLabel||c.subject});let r=[`${t.label} \u2014 ${Cs(t.class)} (id: ${t.id})`];r.push(s.length?`extends: ${$t(s,mb)}`:"extends: (no internal/recorded base classes)");let i=[];for(let c of oc(t.id,l=>o.get(l)||[],{maxDepth:8,keyOf:l=>l.id}))c.length&&i.push(c.map(l=>l.label).sort((l,u)=>String(l).localeCompare(String(u))));let a=i.reduce((c,l)=>c+l.length,0);return a?(r.push(`subclasses: ${a} total across ${i.length} level(s).`),i.forEach((c,l)=>r.push(` depth ${l+1} (${c.length}): ${$t(c,mb)}`))):r.push("subclasses: none recorded \u2014 nothing extends it in the extracted graph."),r.join(`
8
+ `)}function lc(e){let t=new Map;for(let n of e){let s=n.label.includes("/")?n.label.slice(0,n.label.lastIndexOf("/")):"(root)";t.set(s,(t.get(s)||0)+1)}return t}function uc(e,t=""){let n=Zt(t);return e.individuals.filter(s=>(s.class||"")==="Module"&&(!n||Zt(s.label).startsWith(n)))}function Ab(e,{pkg:t=""}={}){let n=Zt(t),s=uc(e,t);if(!s.length)return n?`no modules under "${t}".`:"no modules in the graph.";let o=lc(s),r=new Map;for(let u of Te(e,"imports"))r.set(u.object,(r.get(u.object)||0)+1);let i=new Set(s.map(u=>u.id)),a=[...r.entries()].filter(([u])=>i.has(u)).sort((u,d)=>d[1]-u[1]).slice(0,tT).map(([u,d])=>`${e.byId.get(u)?.label||u} (${d} importers)`),c=[...o.entries()].sort((u,d)=>d[1]-u[1]),l=[`Architecture${n?` of ${t}`:""}: ${s.length} module(s) in ${c.length} package(s).`];return l.push(`packages (by module count): ${$t(c.map(([u,d])=>`${u} (${d})`),eT)}`),l.push(a.length?`hub modules (most imported): ${a.join(", ")}`:"hub modules: none (no internal imports recorded)."),l.join(`
9
+ `)}function Ib(e,t){let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||Kt(t)?.path||n,o=[...new Set(Te(e,"tests").filter(a=>a.object===n).map(a=>a.subjectLabel||a.subject))],r=o.length>0,i=r?`covered by ${o.length} test module(s):
10
+ ${$t(o,Cb,`
11
11
  `)}`:"no covering tests recorded (no test module imports it).";return n===t.id?`${s}: ${i}`:`${t.label} is defined in ${s}, which ${r?"is":"has"} ${i}
12
- ${D_}`}function Rb(e,{codeDomainActive:t=null}={}){let n=t??Ei(e)>0,s=new Set,o=new Set;for(let a of Te(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!Mo(String(a.label).toLowerCase()));if(!r.length)return n?Ei(e)===0?`no modules to check for test coverage in this index. ${yd}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.":"this session holds no graph to check test coverage against.";let i=r.filter(a=>!s.has(a.id)).map(a=>a.label).sort();return i.length?`${i.length} source module(s) with no covering test module:
13
- ${$t(i,jb,`
14
- `)}`:"every source module has at least one covering test module."}function _b(e,t){let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${$t(o,rn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Ab(e,t,{toolNamePrefix:n="tmct_"}={}){if(Tb.has(t.class)){let i=[...new Set(Te(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
15
- ${$t(i,xi,`
16
- `)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=es(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(Te(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
17
- ${$t(r,xi,`
18
- `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function Cb(e,t){if(Tb.has(t.class)){let r=[...new Set(Te(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
19
- ${$t(r,xi,`
20
- `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(Te(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
21
- ${$t(o,xi,`
22
- `)}`:`${s}: no recorded callees.`}function Ib(e,t){let n=e.byId.get(t.object),s=n?Ht(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function Ed(e,t){if(!t?.id)return"";let n=Te(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${$t(n.map(s=>Ib(e,s)),z_)}`:""}function Ob(e,t){let n=Te(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${As(t.class)}: no in-repo calls recorded (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`;let s=n.map(o=>Ib(e,o));return`${t.label} \u2014 ${As(t.class)} calls ${n.length} in-repo symbol(s):
23
- ${$t(s,xi,`
24
- `)}`}function Nb(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=qe(s,"commitDate")||qe(s,"date"),i=qe(s,"commitAuthor")||qe(s,"author"),a=qe(s,"commitMessage")||qe(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function Lb(e,t){let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"touches").filter(a=>a.object===n);if(!o.length)return`${s}: no commit history recorded (outside the git-log window or unmodified).`;let r=o.slice(0,rn).map(a=>` ${Nb(e,a.subject,a.subjectLabel)}`),i=o.length>rn?`
25
- \u2026+${o.length-rn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
12
+ ${nT}`}function Ob(e,{codeDomainActive:t=null}={}){let n=t??Ri(e)>0,s=new Set,o=new Set;for(let a of Te(e,"tests"))s.add(a.object),o.add(a.subject);let r=e.individuals.filter(a=>(a.class||"")==="Module"&&!o.has(a.id)&&!Do(String(a.label).toLowerCase()));if(!r.length)return n?Ri(e)===0?`no modules to check for test coverage in this index. ${jd}`:"no source modules to check for test coverage in this index \u2014 only test modules are recorded.":"this session holds no graph to check test coverage against.";let i=r.filter(a=>!s.has(a.id)).map(a=>a.label).sort();return i.length?`${i.length} source module(s) with no covering test module:
13
+ ${$t(i,Cb,`
14
+ `)}`:"every source module has at least one covering test module."}function Nb(e,t){let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"touches").filter(r=>r.object===n).map(r=>r.subjectLabel||r.subject);return o.length?`${s}: touched by ${o.length} recent commit(s): ${$t(o,cn)}`:`${s}: no commit history recorded (outside the git-log window or unmodified).`}function Pb(e,t,{toolNamePrefix:n="tmct_"}={}){if(Lb.has(t.class)){let i=[...new Set(Te(e,"callsSymbol").filter(a=>a.object===t.id).map(a=>a.subjectLabel||a.subject))];return i.length?`${t.label} \u2014 called by ${i.length} symbol(s):
15
+ ${$t(i,_i,`
16
+ `)}`:`${t.label}: no recorded callers (fine-grained call edges are conservative \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}let s=ss(e,t);if(!s)return`cannot map ${t.label} to a module.`;let o=e.byId.get(s)?.label||s,r=[...new Set(Te(e,"calls").filter(i=>i.object===s).map(i=>i.subjectLabel||i.subject))];return r.length?`${o} \u2014 called by ${r.length} module(s):
17
+ ${$t(r,_i,`
18
+ `)}`:`${o}: no recorded callers (calls are coarse/import-backed \u2014 absence is not proof). Try ${n}impact for the full reverse closure.`}function Mb(e,t){if(Lb.has(t.class)){let r=[...new Set(Te(e,"callsSymbol").filter(i=>i.subject===t.id).map(i=>i.objectLabel||i.object))];return r.length?`${t.label} \u2014 calls into ${r.length} symbol(s):
19
+ ${$t(r,_i,`
20
+ `)}`:`${t.label}: no recorded callees (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`}let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=[...new Set(Te(e,"calls").filter(r=>r.subject===n).map(r=>r.objectLabel||r.object))];return o.length?`${s} \u2014 calls into ${o.length} module(s):
21
+ ${$t(o,_i,`
22
+ `)}`:`${s}: no recorded callees.`}function Fb(e,t){let n=e.byId.get(t.object),s=n?Kt(n):null;return`${t.objectLabel||n?.label||t.object}${s?` [${s.path}:${s.start}]`:""}`}function Td(e,t){if(!t?.id)return"";let n=Te(e,"callsSymbol").filter(s=>s.subject===t.id);return n.length?`calls in-repo: ${$t(n.map(s=>Fb(e,s)),sT)}`:""}function Db(e,t){let n=Te(e,"callsSymbol").filter(o=>o.subject===t.id);if(!n.length)return`${t.label} \u2014 ${Cs(t.class)}: no in-repo calls recorded (calls only stdlib/external, or fine-grained call edges are not in the extracted graph).`;let s=n.map(o=>Fb(e,o));return`${t.label} \u2014 ${Cs(t.class)} calls ${n.length} in-repo symbol(s):
23
+ ${$t(s,_i,`
24
+ `)}`}function zb(e,t,n){let s=e.byId.get(t),o=s?.label||n||t,r=He(s,"commitDate")||He(s,"date"),i=He(s,"commitAuthor")||He(s,"author"),a=He(s,"commitMessage")||He(s,"message"),c=[o,r,i].filter(Boolean).join(" ");return a?`${c} \u2014 ${a}`:c}function Bb(e,t){let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"touches").filter(a=>a.object===n);if(!o.length)return`${s}: no commit history recorded (outside the git-log window or unmodified).`;let r=o.slice(0,cn).map(a=>` ${zb(e,a.subject,a.subjectLabel)}`),i=o.length>cn?`
25
+ \u2026+${o.length-cn} more`:"";return`${s}: touched by ${o.length} recent commit(s):
26
26
  ${r.join(`
27
- `)}${i}`}function Pb(e,t){let n=Te(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${As(t.class)}: no symbol-level commit history recorded (outside the git-log window, or fine-grained history is not in the extracted graph).`;let s=n.slice(0,rn).map(r=>` ${Nb(e,r.subject,r.subjectLabel)}`),o=n.length>rn?`
28
- \u2026+${n.length-rn} more`:"";return`${t.label} \u2014 ${As(t.class)}: touched by ${n.length} commit(s):
27
+ `)}${i}`}function Ub(e,t){let n=Te(e,"touchesSymbol").filter(r=>r.object===t.id);if(!n.length)return`${t.label} \u2014 ${Cs(t.class)}: no symbol-level commit history recorded (outside the git-log window, or fine-grained history is not in the extracted graph).`;let s=n.slice(0,cn).map(r=>` ${zb(e,r.subject,r.subjectLabel)}`),o=n.length>cn?`
28
+ \u2026+${n.length-cn} more`:"";return`${t.label} \u2014 ${Cs(t.class)}: touched by ${n.length} commit(s):
29
29
  ${s.join(`
30
- `)}${o}`}function Mb(e,t){return Pb(e,t)}function Fb(e,t){return Pb(e,t)}function xd(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Db[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Cr(a).toLowerCase().includes(s))continue;let c=String(a.label).toLowerCase(),l=t.length?0:1;for(let u of t)c.includes(u)&&(l+=5);t.length&&!l||i.push({ind:a,score:l})}return i.sort((a,c)=>c.score-a.score||String(a.ind.label).length-String(c.ind.label).length),i}function B_(e,t,{limit:n=ic,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Db[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=xd(e,t,{kind:s,decFilter:o,nameRe:r});if(!c.length)return`no ${s} matches the given filters.`;let l=c.slice(0,n),u=[`${c.length} ${s}(s) match (top ${l.length}):`];for(let{ind:d}of l)u.push(`- ${d.label}${Sd(Ht(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
- `)}function J_(e){return{paramCount:lc(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function Q_(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>lc(i.params)),n=e.filter(i=>!!i.returns).length,s=e.filter(i=>!!i.raises).length,o=new Map;for(let i of e)for(let a of i.callees||[])o.set(a,(o.get(a)||0)+1);let r=new Set([...o.entries()].filter(([,i])=>i>=2).map(([i])=>i));return{paramCount:X_(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function Z_(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(lc(e.params)-t.paramCount));!!e.returns===t.hasReturns&&(n+=2),!!e.raises===t.hasRaises&&(n+=2);let s=[...e.callees||[]].filter(o=>t.callees.has(o)).length;return n+Math.min(s,4)*2}function eT(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let p of e)for(let f of gd(p.decorators))r.set(f,(r.get(f)||0)+1);let i="",a=1;for(let[p,f]of r)f>a&&(a=f,i=p);let c=new Set(gd(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(lb(n)),d=s?.start??null;for(let p of e){let f=gd(p.decorators).some(g=>l.has(g))?1:0,m=lb(p.label).filter(g=>u.has(g)).length,h=Z_(p,o),b=d!=null&&p.site?1/(1+Math.abs(p.site.start-d)):0;p._score=f*1e3+m*50+h+b}return[...e].sort((p,f)=>f._score-p._score||(p.site?.start||0)-(f.site?.start||0))}function Or(e,t){let n=es(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Te(e,"defines").filter($=>$.subject===n),r=new Map;for(let $ of Te(e,"callsSymbol"))r.has($.subject)||r.set($.subject,new Set),r.get($.subject).add($.object);let i=[],a=[],c=0;for(let $ of o){let _=e.byId.get($.object);if(!_)continue;let C=_.class||"",S=Ht(_);C==="GlobalVariable"?(a.push({label:_.label,value:(_.attributes||[]).find(j=>j.key==="value")?.value||"",site:S}),S&&(c=Math.max(c,S.end))):(C==="Function"||C==="Class")&&(i.push({id:_.id,label:_.label,class:C,site:S,decorators:Cr(_),raises:qe(_,"raises"),doc:qe(_,"doc"),params:qe(_,"params"),returns:qe(_,"returns"),callees:r.get(_.id)||new Set}),S&&(c=Math.max(c,S.end)))}let l=Ht(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:Cr(t),raises:qe(t,"raises"),params:qe(t,"params"),returns:qe(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,p=u?J_(u):Q_(i);i=eT(i,u||{label:t.label},p);let f=u?null:i.find($=>$.site&&$.label!==t.label)||null,m=[...new Set(Te(e,"tests").filter($=>$.object===n).map($=>$.subjectLabel||$.subject))].slice(0,V_),h=Wb(e,n).slice(0,G_),b=Te(e,"reexports").filter($=>$.subject===n).map($=>$.objectLabel||$.object).slice(0,20),g=qe(e.byId.get(n),"all"),y=Te(e,"contains"),w=null;(t.class||"")==="Class"?w=t.id:(t.class||"")==="Method"&&(w=y.find($=>$.object===t.id)?.subject||null);let E=null;if(w){let $=e.byId.get(w),_=y.filter(C=>C.subject===w).map(C=>{let S=e.byId.get(C.object);return{label:C.objectLabel||S?.label||C.object,class:S?.class||"",site:S?Ht(S):null,decorators:S?Cr(S):"",params:S?qe(S,"params"):"",returns:S?qe(S,"returns"):"",raises:S?qe(S,"raises"):""}}).slice(0,W_);E={className:$?.label||String(w).replace(/^fn:.*#/,""),members:_,total:y.filter(C=>C.subject===w).length}}let R=null;for(let $ of[...i,...a])$.site&&(!R||$.site.start>R.start)&&(R=$.site);let v=R?{start:R.start,end:R.end}:null,k=u||f,I=k?.id?e.byId.get(k.id):null,x=I?Ed(e,I):"",T=[];if(k?.callees)for(let $ of k.callees){let _=e.byId.get($),C=_?Ht(_):null;if(C&&T.push({label:_.label,site:C}),T.length>=Y_)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:f,globals:a,tests:m,cochange:h,exports:b,allExports:g,classMembers:E,insertion:c,insertionRegion:v,calleeBodies:T,callHint:x,siblingCap:U_}}function Fo(e){let t={anchor:!0,exemplar:!0,registration:!0,insertionRegion:!0,allExports:!0,classMembers:!0,siblings:!0,reexports:!0,tests:!0,cochange:!0,inlinedCallees:!1};return e==="TINY"?{...t,classMembers:!1,siblings:!1,reexports:!1,tests:!1,cochange:!1}:e==="LARGE"||e==="FULL"?{...t,inlinedCallees:!0}:t}function zb(e){return{...e,anchor:!1,exemplar:!1,inlinedCallees:!1,classMembers:!1,reexports:!1,tests:!1,cochange:!1,registration:!0,siblings:!0,insertionRegion:!0,allExports:!0}}function uc(e,t,{untuned:n=!1}={}){let s=e.anchor||e.exemplar,o="TINY";if(e.anchor&&e.anchor.site||e.exemplar&&e.exemplar.site||(o="MID"),e.classMembers&&e.classMembers.members&&e.classMembers.members.length&&(o="MID"),s){let i=s.site?s.site.end-s.site.start+1:1/0,a=lc(s.params);(i>K_||a>H_||s.raises)&&(o="MID");let c=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),p=d?Ht(d):null;if(p&&p.path!==e.moduleLabel){c=!0;break}}let l=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=q_;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:Fo(o),topup:o!=="TINY"}}function Bb(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
30
+ `)}${o}`}function Wb(e,t){return Ub(e,t)}function Gb(e,t){return Ub(e,t)}function Ad(e,t,{kind:n,decFilter:s="",nameRe:o=null}={}){let r=Vb[n];if(!r)return[];let i=[];for(let a of e.individuals){if((a.class||"")!==r||o&&!o.test(a.label)||s&&!Or(a).toLowerCase().includes(s))continue;let c=String(a.label).toLowerCase(),l=t.length?0:1;for(let u of t)c.includes(u)&&(l+=5);t.length&&!l||i.push({ind:a,score:l})}return i.sort((a,c)=>c.score-a.score||String(a.ind.label).length-String(c.ind.label).length),i}function oT(e,t,{limit:n=cc,kind:s,decFilter:o,nameRe:r,toolNamePrefix:i="tmct_"}){if(!Vb[s])return`unknown kind "${s}" (use function, class, method, attribute, or module).`;let c=Ad(e,t,{kind:s,decFilter:o,nameRe:r});if(!c.length)return`no ${s} matches the given filters.`;let l=c.slice(0,n),u=[`${c.length} ${s}(s) match (top ${l.length}):`];for(let{ind:d}of l)u.push(`- ${d.label}${_d(Kt(d))}`);return u.push(`Then ${i}snippet <name> for the exact body, or ${i}describe for its edges.`),u.join(`
31
+ `)}function mT(e){return{paramCount:dc(e?.params),hasReturns:!!e?.returns,hasRaises:!!e?.raises,callees:e?.callees instanceof Set?e.callees:new Set}}function hT(e){if(!e.length)return{paramCount:0,hasReturns:!1,hasRaises:!1,callees:new Set};let t=e.map(i=>dc(i.params)),n=e.filter(i=>!!i.returns).length,s=e.filter(i=>!!i.raises).length,o=new Map;for(let i of e)for(let a of i.callees||[])o.set(a,(o.get(a)||0)+1);let r=new Set([...o.entries()].filter(([,i])=>i>=2).map(([i])=>i));return{paramCount:pT(t),hasReturns:n*2>=e.length,hasRaises:s*2>=e.length,callees:r}}function gT(e,t){if(!t)return 0;let n=Math.max(0,4-Math.abs(dc(e.params)-t.paramCount));!!e.returns===t.hasReturns&&(n+=2),!!e.raises===t.hasRaises&&(n+=2);let s=[...e.callees||[]].filter(o=>t.callees.has(o)).length;return n+Math.min(s,4)*2}function bT(e,{decorators:t="",label:n="",site:s=null}={},o=null){let r=new Map;for(let p of e)for(let f of Sd(p.decorators))r.set(f,(r.get(f)||0)+1);let i="",a=1;for(let[p,f]of r)f>a&&(a=f,i=p);let c=new Set(Sd(t)),l=c.size?c:new Set(i?[i]:[]),u=new Set(hb(n)),d=s?.start??null;for(let p of e){let f=Sd(p.decorators).some(g=>l.has(g))?1:0,m=hb(p.label).filter(g=>u.has(g)).length,h=gT(p,o),b=d!=null&&p.site?1/(1+Math.abs(p.site.start-d)):0;p._score=f*1e3+m*50+h+b}return[...e].sort((p,f)=>f._score-p._score||(p.site?.start||0)-(f.site?.start||0))}function Lr(e,t){let n=ss(e,t),s=e.byId.get(n)?.label||String(n||"").replace(/^mod:/,""),o=Te(e,"defines").filter($=>$.subject===n),r=new Map;for(let $ of Te(e,"callsSymbol"))r.has($.subject)||r.set($.subject,new Set),r.get($.subject).add($.object);let i=[],a=[],c=0;for(let $ of o){let T=e.byId.get($.object);if(!T)continue;let C=T.class||"",E=Kt(T);C==="GlobalVariable"?(a.push({label:T.label,value:(T.attributes||[]).find(k=>k.key==="value")?.value||"",site:E}),E&&(c=Math.max(c,E.end))):(C==="Function"||C==="Class")&&(i.push({id:T.id,label:T.label,class:C,site:E,decorators:Or(T),raises:He(T,"raises"),doc:He(T,"doc"),params:He(T,"params"),returns:He(T,"returns"),callees:r.get(T.id)||new Set}),E&&(c=Math.max(c,E.end)))}let l=Kt(t),u=l&&(t.class||"")!=="Module"?{id:t.id,label:t.label,class:t.class||"",site:l,decorators:Or(t),raises:He(t,"raises"),params:He(t,"params"),returns:He(t,"returns"),callees:r.get(t.id)||new Set}:null,d=i.length,p=u?mT(u):hT(i);i=bT(i,u||{label:t.label},p);let f=u?null:i.find($=>$.site&&$.label!==t.label)||null,m=[...new Set(Te(e,"tests").filter($=>$.object===n).map($=>$.subjectLabel||$.subject))].slice(0,cT),h=Yb(e,n).slice(0,aT),b=Te(e,"reexports").filter($=>$.subject===n).map($=>$.objectLabel||$.object).slice(0,20),g=He(e.byId.get(n),"all"),w=Te(e,"contains"),y=null;(t.class||"")==="Class"?y=t.id:(t.class||"")==="Method"&&(y=w.find($=>$.object===t.id)?.subject||null);let v=null;if(y){let $=e.byId.get(y),T=w.filter(C=>C.subject===y).map(C=>{let E=e.byId.get(C.object);return{label:C.objectLabel||E?.label||C.object,class:E?.class||"",site:E?Kt(E):null,decorators:E?Or(E):"",params:E?He(E,"params"):"",returns:E?He(E,"returns"):"",raises:E?He(E,"raises"):""}}).slice(0,iT);v={className:$?.label||String(y).replace(/^fn:.*#/,""),members:T,total:w.filter(C=>C.subject===y).length}}let R=null;for(let $ of[...i,...a])$.site&&(!R||$.site.start>R.start)&&(R=$.site);let S=R?{start:R.start,end:R.end}:null,j=u||f,I=j?.id?e.byId.get(j.id):null,x=I?Td(e,I):"",_=[];if(j?.callees)for(let $ of j.callees){let T=e.byId.get($),C=T?Kt(T):null;if(C&&_.push({label:T.label,site:C}),_.length>=fT)break}return{modId:n,moduleLabel:s,anchor:u,siblings:i,totalSiblings:d,exemplar:f,globals:a,tests:m,cochange:h,exports:b,allExports:g,classMembers:v,insertion:c,insertionRegion:S,calleeBodies:_,callHint:x,siblingCap:rT}}function zo(e){let t={anchor:!0,exemplar:!0,registration:!0,insertionRegion:!0,allExports:!0,classMembers:!0,siblings:!0,reexports:!0,tests:!0,cochange:!0,inlinedCallees:!1};return e==="TINY"?{...t,classMembers:!1,siblings:!1,reexports:!1,tests:!1,cochange:!1}:e==="LARGE"||e==="FULL"?{...t,inlinedCallees:!0}:t}function Kb(e){return{...e,anchor:!1,exemplar:!1,inlinedCallees:!1,classMembers:!1,reexports:!1,tests:!1,cochange:!1,registration:!0,siblings:!0,insertionRegion:!0,allExports:!0}}function fc(e,t,{untuned:n=!1}={}){let s=e.anchor||e.exemplar,o="TINY";if(e.anchor&&e.anchor.site||e.exemplar&&e.exemplar.site||(o="MID"),e.classMembers&&e.classMembers.members&&e.classMembers.members.length&&(o="MID"),s){let i=s.site?s.site.end-s.site.start+1:1/0,a=dc(s.params);(i>lT||a>uT||s.raises)&&(o="MID");let c=!1;if(e.anchor)for(let u of s.callees||[]){let d=t.byId.get(u),p=d?Kt(d):null;if(p&&p.path!==e.moduleLabel){c=!0;break}}let l=(e.anchor?.class||"")==="Method"&&Number(e.classMembers?.total||e.classMembers?.members?.length||0)>=dT;(c||l)&&(o="LARGE")}else o="MID";return{tier:o,mask:zo(o),topup:o!=="TINY"}}function Hb(e){let t=[`Additional context for ${e.moduleLabel} (sections omitted from the lean bundle):`];if(e.classMembers&&e.classMembers.members.length){t.push(`
32
32
  ## members of ${e.classMembers.className}:`);for(let n of e.classMembers.members){let s=String(n.label).split(".").pop(),o=n.params!=null&&n.params!==""?`(${n.params})${n.returns?` -> ${n.returns}`:""}`:"",r=n.decorators?`@${n.decorators} `:"",i=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${s}${n.site?` :${n.site.start}`:""} ${r}${s}${o}${i}`)}}if(e.siblings.length){t.push(`
33
33
  ## sibling symbols (most relevant first; ${e.siblings.length} total):`);for(let n of e.siblings.slice(0,e.siblingCap)){let s=n.decorators?`@${n.decorators} `:"",o=n.raises?` raises=${n.raises}`:"";t.push(` ${n.class} ${n.label}${n.site?` :${n.site.start}`:""} ${s}${o}`)}e.siblings.length>e.siblingCap&&t.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return e.allExports&&t.push(`
34
34
  ## module __all__: ${e.allExports}`),e.exports&&e.exports.length&&t.push(`
35
35
  ## re-exported symbols: ${e.exports.join(", ")}`),e.tests.length&&t.push(`
36
36
  ## covering tests: ${e.tests.join(", ")}`),e.cochange&&e.cochange.length&&t.push(`
37
37
  ## usually changed together: ${e.cochange.map(n=>`${n.label} (\xD7${n.weight})`).join(", ")}`),t.length===1&&t.push("(no omitted sections \u2014 the lean bundle already contained everything for this symbol.)"),t.join(`
38
- `)}function Ub(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
38
+ `)}function qb(e,t){let n=[`Edit context for ${e.moduleLabel} (graph-only bundle \u2014 siblings/registration/tests are real graph truth; no source body without a source-capable provider).`];if(t.registration&&e.globals.length){n.push(`
39
39
  ## registration / module globals (replicate this pattern):`);for(let s of e.globals)n.push(` ${s.label} = ${s.value}${s.site?` [:${s.site.start}]`:""}`)}if(t.classMembers&&e.classMembers&&e.classMembers.members.length){n.push(`
40
40
  ## members of ${e.classMembers.className}:`);for(let s of e.classMembers.members){let o=String(s.label).split(".").pop(),r=s.params!=null&&s.params!==""?`(${s.params})${s.returns?` -> ${s.returns}`:""}`:"",i=s.decorators?`@${s.decorators} `:"",a=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${o}${s.site?` :${s.site.start}`:""} ${i}${o}${r}${a}`)}}if(t.siblings&&e.siblings.length){n.push(`
41
41
  ## sibling symbols to copy the style of (most relevant first; ${e.siblings.length} total):`);for(let s of e.siblings.slice(0,e.siblingCap)){let o=s.decorators?`@${s.decorators} `:"",r=s.raises?` raises=${s.raises}`:"";n.push(` ${s.class} ${s.label}${s.site?` :${s.site.start}`:""} ${o}${r}`)}e.siblings.length>e.siblingCap&&n.push(` \u2026+${e.siblings.length-e.siblingCap} more`)}return t.allExports&&e.allExports&&n.push(`
@@ -45,66 +45,66 @@ ${s.join(`
45
45
  ## insert the new sibling after line ~${e.insertion} (end of the last top-level definition).`)),t.tests&&e.tests.length&&n.push(`
46
46
  ## covering tests: ${e.tests.join(", ")}`),t.cochange&&e.cochange&&e.cochange.length&&n.push(`
47
47
  ## usually changed together (consider editing these too): ${e.cochange.map(s=>`${s.label} (\xD7${s.weight})`).join(", ")}`),n.join(`
48
- `)}function Wb(e,t){let n=[];for(let s of Te(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function Gb(e,t){let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Wb(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,bd).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
48
+ `)}function Yb(e,t){let n=[];for(let s of Te(e,"cochange"))s.subject===t?n.push({label:s.objectLabel||s.object,weight:s.weight||0}):s.object===t&&n.push({label:s.subjectLabel||s.subject,weight:s.weight||0});return n.sort((s,o)=>o.weight-s.weight)}function Xb(e,t){let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Yb(e,n);if(!o.length)return`${s}: no change-coupling recorded (rarely co-committed, or outside the git-log window).`;let r=o.slice(0,Ed).map(i=>`${i.label} (\xD7${i.weight})`);return`${s} \u2014 usually changes together with ${o.length} module(s) (edit these too):
49
49
  ${r.join(`
50
- `)}`+(o.length>bd?`
51
- \u2026+${o.length-bd} more`:"")}function Vb(e,t){let n=es(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"reexports").filter(i=>i.subject===n);if(!o.length)return`${s}: no public exports recorded (no export list / __all__ found, or none resolved).`;let r=o.slice(0,wd).map(i=>{let a=e.byId.get(i.object),c=a?Ht(a):null,l=c?` \u2190 ${c.path}`:"";return`${i.objectLabel||i.object}${l}`});return`${s} \u2014 public API (${o.length} export(s)):
50
+ `)}`+(o.length>Ed?`
51
+ \u2026+${o.length-Ed} more`:"")}function Jb(e,t){let n=ss(e,t);if(!n)return`cannot map ${t.label} to a module.`;let s=e.byId.get(n)?.label||n,o=Te(e,"reexports").filter(i=>i.subject===n);if(!o.length)return`${s}: no public exports recorded (no export list / __all__ found, or none resolved).`;let r=o.slice(0,xd).map(i=>{let a=e.byId.get(i.object),c=a?Kt(a):null,l=c?` \u2190 ${c.path}`:"";return`${i.objectLabel||i.object}${l}`});return`${s} \u2014 public API (${o.length} export(s)):
52
52
  ${r.join(`
53
- `)}`+(o.length>wd?`
54
- \u2026+${o.length-wd} more`:"")}var yd,Jg,ub,eb,qR,XR,hd,JR,ic,QR,ZR,e_,pb,t_,n_,s_,o_,r_,i_,a_,c_,l_,u_,d_,f_,p_,m_,h_,g_,b_,w_,y_,$_,v_,S_,E_,x_,j_,tb,k_,R_,mb,hb,gb,__,T_,A_,C_,I_,sb,ob,L_,rb,oc,ib,ab,cb,xi,qe,M_,F_,jb,D_,rn,Tb,z_,Db,U_,W_,G_,V_,K_,H_,q_,Y_,gd,lb,lc,X_,bd,wd,Fe=P(()=>{Wn();_n();dd();vi();_s();yd="This store holds no code index, so it records no modules or commits to look through.",Jg={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};ub=e=>/^(git|turn):/.test(String(e||""));eb=30,qR=8;XR=2,hd=25,JR=3;ic=10,QR=8,ZR=3,e_=2,pb=5,t_=4,n_=.2,s_=.35,o_=.15,r_=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),i_=.2,a_=.35,c_=.2,l_=.35,u_=e=>/\.cs$/i.test(e),d_=e=>/^I[A-Z]/.test(String(e||"")),f_=.2,p_=.35,m_=50,h_=.2,g_=.35,b_=.5,w_=pb,y_=3,$_=4,v_=1,S_=.9,E_=.5,x_=.2,j_=.35,tb=4,k_=2,R_=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],mb=3,hb=12,gb=.9,__=["imports","calls","callsSymbol","inherits"],T_=.5,A_=.6,C_=.2,I_=.35;sb=128,ob=4,L_=64,rb=250,oc=class extends Error{};ib=new WeakMap;ab=40,cb=40,xi=30;qe=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";M_=25,F_=15;jb=40,D_="tests edges are recorded module to module, so this is module-grain coverage.";rn=15;Tb=new Set(["Function","Method"]);z_=8;Db={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};U_=8,W_=16,G_=4,V_=6,K_=12,H_=2,q_=8,Y_=3,gd=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),lb=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),lc=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},X_=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};bd=20;wd=40});function at(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qb(e){let t=String(e||"");return Kb&&(t=t.replace(Kb," ")),t.replace(/\s+/g," ").trim()}function Zb(e){let t=String(e||"");t=t.replace(yT," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(mT);if(o&&(t=o[1].trim()),o=t.match(hT),o&&(t=o[1].trim()),o=t.match(Hb),o&&(t=o[1].trim()),o=t.match(qb),o&&(t=o[1].trim()),o=t.match(Yb),o&&(t=o[1].trim()),o=t.match(wT),o&&(t=o[1].trim()),o=t.match(Xb),o&&(t=o[1].trim()),o=t.match($T),o&&(t=o[1].trim()),o=t.match(vT),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(ST),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(ET),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(xT),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(jT),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(kT),o&&so.test(o[1].trim())&&(t=o[1].trim()),o=t.match(RT),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(_T),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(TT),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(AT),o){let r=o[1].trim();pT(r)||(t=!CT.test(r)&&(uT.test(r)||so.test(r))?r:`describe ${r}`)}if(o=t.match(IT),o){let r=o[1].trim();(so.test(r)||OT.test(r)||Xb.test(r)||Hb.test(r)||Yb.test(r)||qb.test(r)||NT.test(r))&&(t=r)}if(t===s)break}return t}function VT(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(WT);if(o&&(t=o[1].trim()),o=t.match(GT),o&&(t=o[1].trim()),t===s)break}return t}function HT(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(KT);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function ki(e){let t=String(e||"").trim(),n=t.match(XT)||t.match(JT);return n?n[1].trim():null}function Rd(e){let t=String(e||""),n=t.match(YT);if(n){let o=tw[n[1].toLowerCase()],r=ew[n[2].toLowerCase()],i=n[5]||n[6],a=n[4]?n[4].toLowerCase():jd[i.toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${a}`}let s=ki(t);return s?`which modules transitively import ${s}`:t}function Ri(e){return String(e||"").replace(nT,t=>td[t.toLowerCase()])}function Do(e){let t=Ri(e);return t=t.replace(sT,n=>nd[n.toLowerCase()]),t=t.replace(oT,n=>sd[n.toLowerCase()]),t=t.replace(rT,"with"),t=t.replace(iT,(n,s)=>`${s} for`),t=t.replace(aT,(n,s)=>`for ${s}`),t=t.replace(cT,(n,s)=>s),t=t.replace(QT,"$1$2"),t=t.replace(yg,"$1ing"),t=Zb(t),t=HT(t),t=VT(t),t=Rd(t),t=Qb(t),t=gn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function _i(e){for(let t of[...vg,...$g]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function _d(e){for(let t of ZT){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function ow(e){let t=String(e||"").match(eA);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var tT,nT,Jb,sT,oT,rT,iT,aT,cT,lT,Kb,uT,so,dT,fT,pT,ji,mT,hT,gT,bT,Hb,qb,Yb,wT,yT,$T,vT,ST,ET,xT,jT,kT,RT,_T,TT,AT,CT,IT,OT,NT,Xb,dc,LT,PT,MT,FT,DT,zT,BT,c2,kd,UT,l2,u2,d2,WT,GT,KT,ew,tw,qT,jd,YT,nw,sw,XT,JT,QT,ZT,eA,ft,an,be,Tn=P(()=>{Zn();tT=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(at).join("|")+")\\b","gi"),nT=tT(td),Jb=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(at).join("|")+")\\b(?!\\.[a-z0-9])","gi"),sT=Jb(nd),oT=Jb(sd),rT=/(?<=^|\s)w\/(?=\s|$)/gi,iT=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,aT=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,cT=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,lT=Object.keys(he).sort((e,t)=>t.length-e.length).map(at).join("|"),Kb=bi.length?new RegExp("\\b("+[...bi].sort((e,t)=>t.length-e.length).map(at).join("|")+")\\b\\s*,?","gi"):null;uT=new RegExp("\\b(?:"+Object.keys(he).sort((e,t)=>t.length-e.length).map(at).join("|")+")\\b","i"),so=/^(?:which|what|who|whose|where|when|why|how)\b/i,dT=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),fT=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,pT=e=>{if(fT.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return dT.has((t[t.length-1]||"").toLowerCase())},ji="[,.;:!]|\u2014|\u2013|-",mT=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,hT=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,gT="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",bT="(?:just\\s+)?(?:one|another)\\s+more",Hb=new RegExp(`^(?:(?:${gT})[\\s,]+|(?:${bT})\\s*(?:${ji})\\s*)+(.+)$`,"i"),qb=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,Yb=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,wT=/^(?:please[\s,]+)+(.+)$/i,yT=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,$T=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,vT=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,ST=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,ET=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,xT=/^do\s+you\s+know\s+(.+?)\??$/i,jT=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,kT=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,RT=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,_T=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,TT=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,AT=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,CT=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,IT=/^(?:and|also|so|then|now|but)\s+(.+)$/i,OT=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,NT=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,Xb=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;dc=e=>[...e].sort((t,n)=>n.length-t.length).map(at).join("|"),LT=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),PT=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),MT=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),FT=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),DT=`(?:${dc(LT)})(?:\\s+(?:${dc(PT)}))?\\s*(?:${ji})\\s*`,zT=`(?:${dc(MT)})\\s*(?:(?:${ji})\\s*|\\s+)`,BT=`(?:${dc(FT)})\\s*(?:${ji})\\s*`,c2=new RegExp(`^(?:sorry\\s*(?:${ji})?\\s*)?(?:${DT}|${zT}|${BT})+`,"i"),kd="what|who|which|where|when|why|how",UT="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",l2=new RegExp(`\\b(?:an?|the)?\\s*(?:${kd})\\s*\\?\\s*$`,"i"),u2=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${kd})\\b`,"i"),d2=new RegExp(`\\b(?:${kd})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${UT})\\b`,"i"),WT=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,GT=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;KT=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;ew=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),tw=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),qT="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",jd=Object.freeze({tests:"tested","a test":"tested","any tests":"tested",coverage:"covered","test coverage":"covered"}),YT=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(tw).join("|")+")\\s+("+Object.keys(ew).join("|")+")\\s+(.+?),\\s*(?:(?:is|are)\\s+(?:it|that|they|this)\\s+("+qT+")|(?:has|have)\\s+(?:it|that|they|this)\\s+got\\s+("+Object.keys(jd).join("|")+")|(?:does|do)\\s+(?:it|that|they|this)\\s+have\\s+("+Object.keys(jd).join("|")+"))\\??$","i"),nw="(?:were|was)\\s+(?:deleted|removed)",sw="what\\s+(?:would|might|could)\\s+(?:break|fail|be\\s+affected)",XT=new RegExp("^if\\s+(.+?)\\s+"+nw+",?\\s*"+sw+"\\??$","i"),JT=new RegExp("^"+sw+"\\s+if\\s+(.+?)\\s+"+nw+"\\??$","i");QT=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${Zu.map(at).join("|")})(\\s*[?.!]*)$`,"i");ZT=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${ed.map(at).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${lT})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);eA=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");ft=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),an=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),be=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var iw,rw=P(()=>{iw={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function Is(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let c=1;c<=t.length;c+=1){let l=e[r-1]===t[c-1]?0:1,u=Math.min(o[c]+1,i[c-1]+1,o[c-1]+l);r>1&&c>1&&e[r-1]===t[c-2]&&e[r-2]===t[c-1]&&(u=Math.min(u,s[c-2]+l)),i[c]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Ad(e){return/^[a-z]+$/.test(e)&&!ft.has(e)&&!Td.has(e)}function lw(e){return oA(e)?null:fc(e,cw,Os(e))}function fc(e,t,n=Os(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Is(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var nA,Os,Td,aw,cw,sA,oA,Nr=P(()=>{Zn();rw();Tn();nA=["used"];Os=e=>e.length<=5?1:2,Td=new Set([...Object.keys(he),...Object.keys(nt),...Object.keys(bn),...nA].flatMap(e=>e.split(" "))),aw=4,cw=[...new Set([...Object.keys(he),...Object.keys(bn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=aw))],sA=new Set(iw.words),oA=e=>sA.has(e)});function Lr(e){for(let t of cA){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var pc,rA,iA,aA,Cd,cA,uw,mc=P(()=>{Zn();Tn();pc=Object.keys(he).sort((e,t)=>t.length-e.length).map(at).join("|"),rA=Object.keys(nt).sort((e,t)=>t.length-e.length).map(at).join("|"),iA=Object.keys(bn).sort((e,t)=>t.length-e.length).map(at).join("|"),aA=Oo.slice().sort((e,t)=>t.length-e.length).map(at).join("|"),Cd=(e,t)=>e==="defines"&&gi.has(t),cA=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${pc})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=he[t];return Cd(n,t)?null:Qs({shape:"ask",entityType:null,modifier:"direct",kind:n,subject:e[1].trim(),object:e[3].trim()},t)}},{name:"reverse",re:new RegExp(`^which\\s+(${rA})\\s+(?:(${iA})\\s+)?(${pc})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=he[t];return Cd(n,t)?null:Qs({shape:"reverse",entityType:nt[e[1].toLowerCase()],modifier:e[2]?bn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()},t)}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${pc})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=he[t];return Cd(n,t)?null:Qs({shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()},t)}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${aA})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=gn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!nt[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&wg.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:Zs(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Bn.map(at).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${hn.map(at).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${pc})\\??$`,"i"),build:e=>he[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];uw={id:"grammar",class:"graph-query",run(e){let t=Lr(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function dw(e){let t=e.trim().split(/\s+/);return t.length>1&&Va.has(t[0].toLowerCase())}function fA(e){return he[e.trim().toLowerCase()]==="calls"}function Mt(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,c)=>n.has(i+c)))&&r.every((a,c)=>e[i+c]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function Ai(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(x=>x.toLowerCase());if(s.includes("where")&&!Mt(s,he)){let x=s.some(_=>Bn.includes(_)),T=new Set([...hn,...Bn]),$=n.filter((_,C)=>!ft.has(s[C])&&!T.has(s[C])).join(" ").trim();if($){let _=x?"mentions":"where";return{shape:_,entityType:null,modifier:"direct",kind:_,object:$}}}if(new Set(["has","have","had"]).has(s[0])){let x=s.length;for(;x>1&&(s[x-1]==="ever"||s[x-1]==="been");)x-=1;if((x>1?he[s[x-1]]:null)==="touches"){let $=n.slice(1,x-1).filter((_,C)=>!ft.has(s[1+C])).join(" ").trim();if($)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:$}}}let r=s,i=Mt(s,he);if(!i&&t){let x=s.map(T=>{if(!Ad(T))return T;let $=t.lemma(T);return Td.has($)?$:T});i=Mt(x,he),i&&(r=x)}let a=null;if(!i){let x=s.map(T=>T.length>=4&&Ad(T)&&lw(T)||T);if(i=Mt(x,he),i){r=x;let T=s.slice(i.start,i.end).findIndex((_,C)=>_!==x[i.start+C]),$=i.start+Math.max(T,0);a={from:s[$],to:x[$]}}}let c=!1;if(!i)for(let x=0;x<s.length;x+=1){let T=eo[s[x]];if(!(T&&s[x]==="used"&&s[x+1]==="for")&&T&&s.slice(0,x).some($=>Ti.has($))){i={kind:T,start:x,end:x+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&eo[s[i.start]]&&s.slice(0,i.start).some(x=>Ti.has(x))&&(c=!0);let l=x=>a?{...x,fuzzyVerb:a}:x;if(t&&i.end-i.start===1){let x=i.start,T=s[x-1];if((T==="the"||T==="these"||T==="those")&&s[x+1]==="of"&&t.posTags(n)[x]==="NOUN"){let _=n.slice(x+2).filter((C,S)=>!ft.has(s[x+2+S])).join(" ").trim();if(_)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:_})}}let u=new Set,d=x=>{if(x)for(let T=x.start;T<x.end;T+=1)u.add(T)};d(i);for(let[x,T]of Object.entries(he)){if(T!==i.kind)continue;let $=x.split(" "),_=i.end;if($.every((C,S)=>r[_+S]===C)){d({start:_,end:_+$.length});break}}let p=Mt(r,nt,u);d(p);let f=Mt(r,bn,u);d(f);let m=(x,T)=>n.slice(x,T).filter(($,_)=>!u.has(x+_)&&!ft.has(s[x+_])).join(" ").trim(),h=m(0,i.start),b=m(i.end,n.length);c&&!s.includes("by")&&dA.has(b.toLowerCase())&&(b="");let g=i.kind,y=p?nt[r.slice(p.start,p.end).join(" ")]:null,w=f?bn[r.slice(f.start,f.end).join(" ")]:"direct",E=r.slice(i.start,i.end).join(" ");if(g==="touches"&&s.includes("when")){let x=h||b;if(x)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:x})}if(g==="touches"&&s.includes("who")&&s.includes("last")){let x=h||b;if(x)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:x})}let R=s.indexOf("by"),v=s.slice(0,i.start).findIndex(x=>Ti.has(x)),k=v>=0,I=k&&v>R;if(R>=0&&!u.has(R)&&k){let x=(_,C)=>n.slice(_,C).filter((S,j)=>{let M=_+j,z=s[M];return!u.has(M)&&!ft.has(z)&&z!=="by"&&!Ti.has(z)&&!lA.has(z)&&!uA.has(z)}).join(" ").trim(),[T,$]=I?[x(v+1,n.length),x(R+1,v)]:[x(0,R),x(R+1,n.length)];if(T&&$)return g==="defines"&&gi.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:$,object:T});if($)return l({shape:"forward",entityType:y,modifier:w,kind:g,object:$});if(T)return l({shape:"reverse",entityType:y,modifier:w,kind:g,object:T})}if(c&&R<0&&b&&s[i.start]==="called")return null;if(h&&b){if(g==="defines"&&gi.has(E)||g==="calls"&&(dw(b)||fA(h)))return null;let x=c&&R<0?Ka[`${s[i.start]} ${s[i.end]}`]:null;return x&&x.role==="agent"&&x.kind===g?l({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:b,object:h}):l(Qs({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:h,object:b},E))}if(b){if(g==="calls"&&dw(b))return null;let x=p&&p.start>=i.end?null:y;return l(Qs({shape:"reverse",entityType:x,modifier:w,kind:g,object:b},E))}if(g==="inherits"&&!h&&p&&p.start===i.end){let x=r.slice(p.start,p.end).join(" ");if(x)return l({shape:"reverse",entityType:null,modifier:w,kind:g,object:x})}if(h&&!b&&k&&i.end-i.start===1&&eo[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(g==="touches")return l({shape:"when",entityType:null,modifier:"direct",kind:g,object:h});let x=Ti.has(s[0]);return l({shape:"reverse",entityType:y,modifier:w,kind:g,object:h,...x?{polar:!0}:{}})}return h?l(Qs({shape:"forward",entityType:y,modifier:"direct",kind:g,object:h},E)):null}var Ti,lA,uA,dA,fw,hc=P(()=>{Zn();Tn();Nr();Ti=new Set(["is","are","was","were","be","been","being","get","gets","got"]),lA=new Set(["which","what","who","whom","whose"]),uA=new Set(js.map(e=>e.toLowerCase())),dA=new Set(["recently","lately","yet","already","ever","again"]);fw={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Ai(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function mA(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],c=a.toLowerCase();!/^[a-z]+$/.test(a)||pw.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function hA(e,t=null){let n=an(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!pw.has(a)&&(pA.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=mA(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var pw,pA,mw,hw=P(()=>{Zn();Tn();mc();hc();pw=new Set([...ft,...be(Io),...be(Object.keys(he)),...be(Object.keys(nt)),...be(Object.keys(bn)),...be(Object.keys(Ve)),...be(No),...be(Lo),...be(Object.keys(Jn)),...be(Object.keys(Qn)),...be(Object.keys(to)),...be(js),...be(wi),...be(Oo),...be(hn),...be(Bn),...be(jn),...be(Object.keys(kr))]),pA=new Set([...be(bi),...be(Ha)]);mw={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Lr(e))return null;let{text:n,dropped:s,maybeNoise:o}=hA(e,t.nlp||null);if(!s.length||!n)return null;let r=Lr(n)||Ai(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var gw=P(()=>{});var gc,bc=P(()=>{gc=()=>{}});function ww(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Pr(e.subject)===Pr(t.subject)&&Pr(e.object)===Pr(t.object):Pr(e.object)===Pr(t.object)}function Id(e){let t=(e||[]).filter(l=>l&&Array.isArray(l.candidates)&&l.candidates.length);if(!t.length)return null;let n=[];for(let l of t)for(let u of l.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:l.strategyId,class:l.class});if(n.some(l=>!yw(l))&&(n=n.filter(l=>!yw(l))),!n.length)return null;let s=new Map;for(let l of n)s.has(l.class)||s.set(l.class,[]),s.get(l.class).push(l);let o=[];for(let[l,u]of s){let d=[];for(let p of u){let f=d.find(m=>ww(m.parsed,p.parsed)&&m.via===p.via);if(f){f.agreed+=1,f.confidence=Math.max(f.confidence,p.confidence),bw(p.parsed)<bw(f.parsed)&&(f.parsed=p.parsed);continue}d.push({...p,agreed:1})}d.length&&o.push({class:l,candidates:d})}if(!o.length)return null;let r=l=>Math.max(...l.candidates.map(u=>u.confidence)),i=o[0];for(let l of o)r(l)>r(i)&&(i=l);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(l=>l.parsed)},c=o.filter(l=>l!==i).map(l=>l.candidates[0]).filter(l=>!i.candidates.some(u=>ww(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function wA(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function $w(e,{describe:t=wA,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var Pr,gA,bw,bA,yw,Od=P(()=>{Pr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),gA=/^\s*(?:the|a|an)\s+/i,bw=e=>[e?.subject,e?.object].filter(t=>gA.test(String(t||""))).length;bA=new Set(["fuzzy","lemma","spell"]),yw=e=>bA.has(e.via)});function wc(e){Nd=e}function yc(){return typeof Nd=="function"?Nd():null}var Nd,Mr=P(()=>{Nd=null});function Ew(e,t={},n=$A){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var yA,$A,xw=P(()=>{Tn();mc();hc();hw();gw();bc();Od();Mr();yA=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],$A=[uw,fw,mw,...yA]});function Ns(e){return vA.test(String(e||"").trim())?"an":"a"}function $c(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function Fr(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Ci(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var vA,Ii=P(()=>{vA=/^[aeiou]/i});var Oi,Ld=P(()=>{Oi=(e,t,n)=>n});var _y={};Lt(_y,{DYNAMIC_TAIL_OK_RE:()=>$f,applyNegationFrames:()=>_i,ask:()=>uo,classDisplayName:()=>Ls,degreeMetric:()=>hy,metaFallbackEntityAnswer:()=>iy,normalizeQuery:()=>Do,parseQuery:()=>Uo,parseQueryFull:()=>Zd,render:()=>Gn,rephraseHint:()=>mf,resolveObject:()=>vn,traverse:()=>cn,worldRelationGraphPayload:()=>CI});function tt(e,t){let n=jw.get(e);n||(n=new Map,jw.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Cs(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function de(e,t){let[n,s]=zd[e]||["result","results"];return t===1?n:s}function Di(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${de(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function Ls(e){let t=String(e||"");if(typeof Un=="function"){let n=Un(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function zo(e){return EA[e]||e}function _A(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||RA.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return be(Oo).includes(o)?t:e}function AA(e,t){if(!e||e.shape!=="where"||e.altObject||!TA.test(t))return e;let n=Ga(t),s=Ga(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=an(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||ft.has(i)||he[i]||i.endsWith("ing"))return o;let a=an(n).map(l=>l.toLowerCase());for(;a.length&&Gw.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let c=r.slice(0,-1).join(" ");return{...e,object:c,altObject:s,verb:i}}function Uo(e,{nlp:t=void 0}={}){return Zd(e,{nlp:t}).parsed}function Zd(e,{nlp:t=void 0}={}){let n=t===void 0?yc():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=_d(_i(Do(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=IA(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Id(Ew(o,{nlp:n,raw:s}));return i?{parsed:AA(_A(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function jc(e,t){return t.length&&ef.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Ur(e,t){return Lr(e)||Ai(e,t)}function IA(e,t){let n=an(e),s=n.map(o=>o.toLowerCase());return sC(n,s)||rC(n,s)||PA(n,s,t)||Hw(e,t,0)||iC(n,s,t)||FA(n,s,t)||HA(n,s,t,0)||QA(n,s,t,0)||Jw(n,s)||tC(n,s,t)||aC(n,s,t)||uC(n,s,t)||fC(n,s,t,0)||lC(n,s,t,0)||Yw(n,s,t,0)||nf(n,s,t,0)||Xw(n,s,t,0)||UA(n,s,t)||NA(n,s)||ny(n,s,t,0)}function NA(e,t){let n=0;OA.has(t[n])&&(n+=1);let s=dt(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?Ka[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,c=-1,l;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){c=m,l=h;break}}if(c<0)return null;let u=e.slice(a,c).join(" ").trim(),d=e.slice(c+2).join(" ").trim();if(!u||!d)return null;let p=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},f=p(i,u);return f.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:f}},{op:"intersection",kind:"set",ast:{node:"clause",clause:p(l,d)}}]}}function Sc(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function PA(e,t,n){if(!["do","does","did"].includes(t[0])||!LA.has(t[1]))return null;let s=dt(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let c=Mt(a,he);if(!c)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((p,f)=>(f<c.start||f>=c.end)&&!ft.has(a[f])&&a[f]!=="from").join(" ").trim();if(!u)return null;let d=Ms(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:c.kind,object:u,complement:Sc(o,{op:"difference",kind:"set",ast:d})}}function Hw(e,t,n=0){let s=ow(e);if(!s)return null;let o=dt(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=an(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Ve[d]))return Sc(r,{op:"difference",kind:"qual",filters:a});let c=Mt(a,he);if(!c)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,p)=>(p<c.start||p>=c.end)&&!ft.has(a[p])&&a[p]!=="from").length)return Sc(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=Ms(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:Sc(r,{op:"difference",kind:"set",ast:u})}function FA(e,t,n){let s=0;for(;s<t.length&&MA.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=Mt(r,he);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!ft.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function tf(e,t){let n=new Set;for(let s of t)for(let o of tt(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function qw(e,t){let n=Tt(t),s=n.filter(r=>!Ww.has(r)),o=tf(e,s.length?s:n);return o.size===1?[...o][0]:null}function Ms(e,t,n){if(n>Vw)return{node:"miss",reason:"too deep to resolve"};let s=Hw(e,t,n);if(s)return s;let o=an(e),r=o.map(p=>p.toLowerCase()),i=Jw(o,r);if(i)return i;let a=Yw(o,r,t,n);if(a)return a;let c=nf(o,r,t,n);if(c)return c;let l=Xw(o,r,t,n);if(l)return l;let u=ny(o,r,t,n);if(u)return u;let d=Ur(e,t);return d?{node:"clause",clause:d}:null}function DA(e){let t=e.map(r=>r.toLowerCase()),n=Object.keys(to).sort((r,i)=>i.split(" ").length-r.split(" ").length),s=[],o=e.length;for(;;){let r=null;for(let c=o-1;c>=1&&!r;c-=1)for(let l of n){let u=l.split(" ");if(c+u.length<=o&&t.slice(c,c+u.length).join(" ")===l){r={at:c,len:u.length,op:to[l]};break}}if(!r)break;let i=e.slice(r.at+r.len,o),{blc:a}=jc(i,i.map(c=>c.toLowerCase()));if(!a.length||!a.every(c=>Ve[c]))break;s.unshift({op:r.op,kind:"qual",filters:a}),o=r.at}return!s.length||!o?null:{rest:e.slice(0,o),lifted:s}}function nf(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=jn.includes(t[o]),i=!r&&Kw(t[o]);if(!r&&!i||r&&o+1>=t.length||!dt(t[o-1]))continue;let c=e.slice(0,o-1);if(!c.length||c.every(h=>Ve[h.toLowerCase()]))continue;let l=Ur([...c,Bd].join(" "),n);if(!l||l.shape!=="reverse"&&l.shape!=="forward"||l.modifier&&l.modifier!=="direct")continue;let u=e.slice(r?o+1:o),d=DA(u),p=`which ${t[o-1]} ${(d?d.rest:u).join(" ")}`,f=Ms(p,n,s+1);if(!f||f.node==="miss")return f?{node:"miss",reason:f.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"};let m={node:l.shape==="reverse"?"reverseSet":"forwardSet",kind:l.kind,entityType:l.entityType,inner:f};return d?{node:"boolean",entityType:l.entityType,atoms:[{op:"seed",kind:"set",ast:m},...d.lifted]}:m}return null}function Yw(e,t,n,s){let o=0;(ao.has(t[o])||sf.has(t[o]))&&(o+=1);let r=dt(t[o]);if(!r||r.placeholder||!r.entityType||(o+=1,ef.has(t[o])&&(o+=1),!zA.has(t[o])||t[o+1]!=="in"))return null;let i=e.slice(o+2);return i.length?of(r.entityType,i,n,s):null}function Xw(e,t,n,s){let o=0;if(!ao.has(t[0]))return null;o+=1;let r=dt(t[o]);if(!r)return null;o+=1;let i=e.slice(o),a=t.slice(o);if(i.length<2)return null;let c=null;for(let h=i.length-1;h>0;h-=1){let b=a.slice(h),g=Mt(b,he);if(g&&g.start===0&&g.end===b.length){c={kind:g.kind,at:h};break}}if(!c)return null;let l=i.slice(0,c.at),u=a.slice(0,c.at);if(!u.some(h=>jn.includes(h)))return null;let d=l,p=u;for(;p.length&&sf.has(p[0]);)d=d.slice(1),p=p.slice(1);if(!p.length||!dt(p[0]))return null;let f=ao.has(p[0])?d.join(" "):`which ${d.join(" ")}`,m=Ms(f,n,s+1);return!m||m.node==="miss"?{node:"miss",reason:m&&m.reason||"the embedded subject clause didn't parse"}:{node:"forwardSet",kind:c.kind,entityType:r.entityType,inner:m}}function UA(e,t,n){for(let s=0;s<t.length;s+=1){if(!BA.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!he[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Bd,...e.slice(s+1)],a=Ur(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Bd&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function HA(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!WA.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(GA.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&VA.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&KA.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>jn.includes(d)))return null;let c=ao.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=Ms(c,n,s+1);if(!l||l.node==="miss")return l?{node:"miss",reason:l.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=dt(a[0]);return{node:"temporal",inner:l,entityType:u&&u.entityType||null}}function Jw(e,t){if(!YA.has(t[0]))return null;let n=1,s=null;if(t[n]!=="changed"){let i=dt(t[n]);if(!i||i.placeholder)return null;s=i.entityType,n+=1}if(t[n]!=="changed"||(n+=1,t[n]==="ever"&&(n+=1),!qA.has(t[n])))return null;let o=t[n],r=e.slice(n+1).join(" ").trim();return r?{node:"commitFilter",op:o,pivotRaw:r,entityType:s}:{node:"miss",reason:`"changed ${o}" needs a date or commit afterward`}}function of(e,t,n,s){let o=t.map(r=>r.toLowerCase());if(o.some(r=>jn.includes(r))){let r=t,i=o;for(;i.length&&sf.has(i[0]);)r=r.slice(1),i=i.slice(1);if(i.length&&dt(i[0])){let a=ao.has(i[0])?r.join(" "):`which ${r.join(" ")}`,c=Ms(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the owner clause of this membership query didn't parse"}:{node:"membershipSet",entityType:e,inner:c}}}return{node:"membership",entityType:e,term:t.join(" ")}}function QA(e,t,n,s=0){if(t[0]!=="where"||!XA.has(t[1])||!Gw.has(t[t.length-1]))return null;let o=e.slice(2,t.length-1),r=t.slice(2,t.length-1);for(;r.length&&JA.has(r[0]);)o=o.slice(1),r=r.slice(1);if(!o.length||!r.some(l=>jn.includes(l)))return null;let i=dt(r[0]);if(!i)return null;let a=ao.has(r[0])?o.join(" "):`which ${o.join(" ")}`,c=Ms(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the inner set of the location query didn't parse"}:{node:"whereSet",inner:c,entityType:i.entityType||null}}function eC(e){let t=new Set,n=[];for(let s of e){if(!s||!ZA.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function tC(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!wi.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let p=t.slice(0,d).join(" ");if(d===t.length-1&&(No.includes(p)||Lo.includes(p))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=No.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=nC(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let c=o?s-1:s,l=eC(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function nC(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&CA.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Ve[a]))return{type:"qual",filters:r};if(o.length===1){let a=dt(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Ur(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function sC(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?dt(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let c=i.indexOf("in",1);if(c>0){let u=a.slice(1,c).join(" ").trim(),d=a.slice(c+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:l,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:null,scopeModule:c}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function oC(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=Zs(n).slice(e.length).trim(),o=an(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function rC(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let l=1;l<t.length;l+=1)if(Ve[t[l]]){n=l,s=t[l-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&eo[t[n]]){let l=o+1;for(;l<t.length&&(t[l]==="the"||t[l]==="a"||t[l]==="an");)l+=1;let u=t[l];if(u&&!Sg.has(u))return null}let r=oC(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let c=a>i?e.slice(i,a).join(" ").trim():"";return c?{node:"qualCheck",term:c,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function iC(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=Ur(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function aC(e,t,n){let s=No.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&Ve[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?dt(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let c=e.slice(o),l=t.slice(o).some(d=>!ft.has(d)&&!Qw.has(d)),u;if(l){let d=Ms(`which ${a} ${c.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function lC(e,t,n,s){let o=0,r=!1,i=null;for(let y of Zw){let w=y.split(" ");if(t.slice(0,w.length).join(" ")===y){i=y,o=w.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&rf.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Ve[t[o]];)a.push(t[o]),o+=1;let c=o<t.length?dt(t[o]):null;if(!c||c.placeholder||c.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!he[t[o]]&&!js.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ey}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),p=t.slice(o).some(y=>!ft.has(y)&&!Qw.has(y)),f=t.slice(o),m=d;(f[0]==="is"||f[0]==="are")&&(f=f.slice(1),m=m.slice(1));let h=r&&cC.has(f[0]);if(r&&(p&&!h||d.length===0))return null;let b,g=!1;if(p){let y=h?m:d,w=Ms(`which ${[...a,u,...y].join(" ")}`,n,(s||0)+1);if(!w||w.node==="miss")return{node:"miss",reason:w&&w.reason||"the list filter didn't parse"};b=w,g=!0}else b={node:"allOfClass",entityType:l},a.length&&(b={node:"qualifier",filters:a,inner:b});return{node:"list",entityType:l,base:b,scoped:g}}function uC(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(Jn[h]){s=Jn[h],o=m;break}if(Jn[t[m]]){s=Jn[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(Qn[t[m]]){r=Qn[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(Qn[t[m]]){r=Qn[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),c=["important","significant","central","key","core","essential","critical","principal"],l=t.some(m=>c.includes(m));!r&&(a||l)&&(r=Qn.connections,i="connections");let u,d=null;for(let m of t){let h=dt(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?Eg[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let p=["needs","need","needing","lacks","lack","lacking","misses","missing"],f=t.some(m=>p.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:f}}function fC(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&rf.has(t[o]);)o+=1;if(o>=t.length)return null;let r=dt(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&dC.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=dt(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>jn.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!he[t[o]]&&!js.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${ey}`}:null}function pC(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&rf.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(jn.includes(t[i])){s=i;break}if(s<0)return null;let o=dt(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function ty(e,t,n,s){if(!n.length||n[0]!=="named"&&!(n[0]==="called"&&s)||n[1]==="by")return null;let o=t.slice(1).join(" ").trim();return o?{node:"named",entityType:e||null,term:o}:null}function mC(e,t,n,s,o,r){let{branches:i,ops:a}=Ec(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],p=d.map(w=>w.toLowerCase()),f=u===0?"intersection":a[u-1],m=jc(d,p);if(m.blc.length&&m.blc.every(w=>Ve[w])){l.push({op:f,kind:"qual",filters:m.blc});continue}let h=ty(e,m.bw,m.blc,m.blc.length!==p.length);if(h){l.push({op:f,kind:"set",ast:h});continue}if(p[0]==="of"||p[0]==="in"){let w=of(e,d.slice(1),o,r);if(w.node==="miss")return{miss:w.reason};l.push({op:f,kind:"set",ast:w});continue}let b=d,g=Mt(p,he);g?c=d.slice(g.start,g.end):c&&(b=[...c,...d]);let y=sy(`${t} ${b.join(" ")}`,o,r);if(!y||y.node==="miss")return{miss:y&&y.reason||"a clause in the combination didn't parse"};l.push({op:f,kind:"set",ast:y})}return{atoms:l}}function ny(e,t,n,s){let o=pC(e,t);if(o){let{entityType:T,term:$,relIdx:_}=o,C=t.slice(_+1),S=e.slice(_+1);if(!C.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[_]}"`};let j=mC(T,`which ${t[_-1]}`,C,S,n,s+1);if(j.miss)return{node:"miss",reason:j.miss};let M=[{op:"seed",kind:"set",ast:{node:"find",entityType:T,term:$}},...j.atoms];return M.length===1?M[0].ast:{node:"boolean",entityType:T,atoms:M}}let r=0;for(;r<t.length&&ao.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Ve[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?dt(t[r]):null;if(!c){let T=r+1<t.length?dt(t[r+1]):null;if(kw.has(t[r])&&T&&T.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(ef.has(t[r])){let $=r+1;$<t.length&&(t[$]==="the"||t[$]==="a"||t[$]==="an")&&($+=1);let _=$+1<t.length?dt(t[$+1]):null;if(kw.has(t[$])&&_&&_.entityType==="Commit"&&$+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&T&&/^[a-z]+$/.test(t[r])&&!he[t[r]]&&!ft.has(t[r])&&!wf.has(t[r])?{node:"find",entityType:T.entityType,term:e[r]}:null}let l=c.entityType,u=t[r];r+=1;let d=t.slice(r),p=e.slice(r),f=!1;d.length&&jn.includes(d[0])&&(f=!0,d=d.slice(1),p=p.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&Kw(d[0]),b=p.length>0&&Ec(d,p).branches.some(T=>{let{blc:$}=jc(T,T.map(_=>_.toLowerCase()));return $.length&&$.every(_=>Ve[_])}),g=p.length>0?Ec(d,p).branches:[],y=!1;if(g.length>1){let T=g[0].map(_=>_.toLowerCase()),$=Mt(T,he);$&&$.start===0&&(y=g.slice(1).every(_=>{let C=_.map(j=>j.toLowerCase()),S=Mt(C,he);return S&&S.start===0?S.kind===$.kind:!S}))}let w=!1;if(g.length>1){let T=g[0].map(_=>_.toLowerCase()),$=Mt(T,he);$&&$.start===0&&(w=g.slice(1).every(_=>{let C=_.map(j=>j.toLowerCase()),S=Mt(C,he);return!!S&&S.start===0&&S.end-S.start===1}))}if(!(a.length||f||m||h||b||y||w))return null;if(!p.length){let T={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:T,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let E=c.placeholder?"what":`which ${u}`,{branches:R,ops:v}=Ec(d,p),k=null,I=[];for(let T=0;T<R.length;T+=1){let $=R[T],_=$.map(Y=>Y.toLowerCase()),C=T===0?"seed":v[T-1],S=jc($,_);if(S.blc.length&&S.blc.every(Y=>Ve[Y])){I.push({op:C,kind:"qual",filters:S.blc});continue}let j=ty(l,S.bw,S.blc,S.blc.length!==_.length);if(j){I.push({op:C,kind:"set",ast:j});continue}if(_[0]==="of"||_[0]==="in"){let Y=of(l,$.slice(1),n,s+1);if(Y.node==="miss")return Y;I.push({op:C,kind:"set",ast:Y});continue}let M=$,z=Mt(_,he);z?k=$.slice(z.start,z.end):k&&(M=[...k,...$]);let K=sy(`${E} ${M.join(" ")}`,n,s+1);if(!K||K.node==="miss")return{node:"miss",reason:K&&K.reason||"a clause in the combination didn't parse"};I.push({op:C,kind:"set",ast:K})}if(I[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let x;return I.length===1?x=I[0].ast:x={node:"boolean",entityType:l,atoms:I},a.length&&(x={node:"qualifier",filters:a,inner:x,entityType:l}),x}function sy(e,t,n){if(n>Vw)return{node:"miss",reason:"too deep to resolve"};let s=an(e),o=s.map(a=>a.toLowerCase()),r=nf(s,o,t,n);if(r)return r;let i=Ur(e,t);return i?{node:"clause",clause:i}:null}function Ec(e,t){let n=Object.keys(to).sort((a,c)=>c.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let c of n){let l=c.split(" ");if(e.slice(i,i+l.length).join(" ")===c){a={c,len:l.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(to[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function af(e){let t=Rw.get(e);if(t)return t;t=new Map;for(let n of e.individuals||[])n.class==="Module"&&t.set(Zt(n.label),n);return Rw.set(e,t),t}function oy(e,t){let n=af(e),s=[];for(let o of t){let r=e.byId.get(o);if(!r||r.class==="Module")continue;let i=lo(r),a=i?n.get(Zt(i)):null;a&&s.push(a)}return $n(s)}function gC(e){let t=_w.get(e);if(t)return t;t=new Map;let n=af(e);for(let s of e.individuals||[]){if(s.class==="Module")continue;let o=lo(s),r=o?n.get(Zt(o)):null;r&&(t.has(r.id)||t.set(r.id,[]),t.get(r.id).push(s))}return _w.set(e,t),t}function cf(e,t,n,s){let o=Dr[t];if(o&&ro.has(n)){let d=tt(e,o).filter(p=>s.has(p.object));return $n(d.map(p=>e.byId.get(p.subject)).filter(p=>p&&p.class===n))}let a=(!!o&&[...s].some(d=>ro.has(e.byId.get(d)?.class))?[...Tt(t),o]:Tt(t)).flatMap(d=>tt(e,d)),c=a.filter(d=>s.has(d.object));t==="cochange"&&(c=c.concat(a.filter(d=>s.has(d.subject)).map(d=>({...d,subject:d.object,object:d.subject}))));let l=$n(c.map(d=>e.byId.get(d.subject)).filter(Boolean));if(!n||n==="Change")return l;let u=l.filter(d=>d.class===n);if(ry(t,n)){let d=new Set(c.map(f=>f.object)),p=new Set([...s].filter(f=>!d.has(f)));return $n([...u,...oy(e,p)])}return u.length?u:n!=="Module"&&l.some(d=>d.class==="Module")?hf(e,new Set(l.filter(d=>d.class==="Module").map(d=>d.id)),n):[]}function wC(e){let t=new Set;for(let n of["touches","touchesSymbol"])for(let s of tt(e,n)){let o=e.byId.get(s.subject);o?.class==="Commit"&&t.add(String(o.label||"").toLowerCase())}return e.individuals.filter(n=>n.class==="Commit").map(n=>String(n.label||"").toLowerCase()).filter(n=>n&&!t.has(n)).sort()}function yC(e,t){let n=new Set(cf(e,"touches","Commit",t).map(o=>String(o.label||"").toLowerCase())),s=wC(e);for(let o of t)for(let r of e.byId.get(o)?.derived_from||[]){let i=bC.exec(String(r||""));if(!i)continue;let a=i[1].toLowerCase(),c=s.find(l=>l.startsWith(a)||a.startsWith(l));c&&n.add(c)}return n.size}function Pi(e,t,n){let s=Tt(t).flatMap(o=>tt(e,o)).filter(o=>n.has(o.subject));return $n(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function $n(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function $C(e,t){let n=Zt(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&Zt(o.label).startsWith(s))}function Ud(e){let t=Tw.get(e);if(t)return t;let n=new Set;for(let i of tt(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of tt(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of tt(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Tw.set(e,t),t}function Wo(e,t){return t?t.class==="Module"?t.id:Ud(e).moduleOfSymbol.get(t.id)||null:null}function vC(e,t){let n=Wo(e,t);if(n)return n;let s=lo(t);return s&&af(e).get(Zt(s))?.id||null}function iy(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>SC.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Wo(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=de(o.class,1),c=a==="attribute"?"an":"a",l=i?`, ${Oi("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${c} ${a} in this codebase${l} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function kc(e,t,n){let s=$n(jr.flatMap(i=>Pi(e,i,new Set([t])))),o=n?s.filter(i=>i.class===n):s;if(o.length)return o;let r=gC(e).get(t)||[];return n?r.filter(i=>i.class===n):r}function lf(e,t,n=null){let s=Ps(e,t,n);if(!(s.match&&s.tier===1)){let o=$C(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function uf(e,t,n,s,o){let r=o||(()=>!0),i=kc(e,t,s).filter(r);if(i.length||!cy(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of ay(e,t)){let c=e.byId.get(a);if(!c)continue;let l=kc(e,a,s).filter(r);if(l.length)return{own:i,inherited:l,viaId:a,viaLabel:c.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function io(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=Ud(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=vC(e,t),o=Ud(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&Mo(String(r.label).toLowerCase()))||!s?!1:o.testedModules.has(s)===n.value}default:return!1}}function df(e){return tt(e,"inherits")}function Wd(e,t){return df(e).filter(n=>n.object===t).map(n=>n.subject)}function Aw(e,t){return df(e).filter(n=>n.subject===t).map(n=>n.object)}function EC(e,t){let n=new Set,s=[...Wd(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Wd(e,o))n.has(r)||s.push(r)}}return n}function ay(e,t){let n=new Set,s=[...Aw(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Aw(e,o))n.has(r)||s.push(r)}}return n}function cy(e,t){let n=Cw.get(e);if(n||(n=new Map,Cw.set(e,n)),n.has(t))return n.get(t);let s=df(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function Iw(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function Nw(e){return e.slice().sort((t,n)=>Ow[n.via]-Ow[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Lw(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Os(n);if(Is(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of Bo(e.label))if(Is(o,n,s)<=s)return!0;return!1}function ly(e,t,n){let s=e.individuals.filter(c=>c.class===t),o=[...Bo(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=cy(e,t),i=[];for(let c of s){let l=Iw(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...EC(e,c.id)].some(d=>{let p=e.byId.get(d);return!!p&&!!Iw(p,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:Nw(i),broad:[]};let a=new Map;for(let c of s)for(let l of ay(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&Lw(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Wd(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Lw(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:Nw([...a.values()])}}function uy(e){return[...ac(cc(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function Gd(e,t,n){let s=String(t||"").trim().toLowerCase();if(!s)return[];let o=Zt(s);return e.individuals.filter(r=>{if(n&&r.class!==n)return!1;let i=String(r.label||"").toLowerCase();return i===s||String(r.id||"").toLowerCase()===s?!0:r.class==="Module"&&Zt(i)===o})}function Vd(e,t){if(!t||typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let s=Vd(e,n);if(s)return s}return null}if(t.node==="named")return Gd(e,t.term,t.entityType).length?null:{term:t.term,entityType:t.entityType||null,elsewhere:Gd(e,t.term,null)[0]||null};for(let n of Object.values(t)){let s=Vd(e,n);if(s)return s}return null}function en(e,t,n){switch(t.node){case"named":return Gd(e,t.term,t.entityType);case"clause":return cn(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?uy(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=ly(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(Tt(t.kind).flatMap(o=>tt(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=Ps(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=qw(e,t.kind);if(!o)return[];let r=new Set(Pi(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"commitFilter":return Kd(e,t).matches;case"reverseSet":{let s=new Set(en(e,t.inner,n).map(o=>o.id));return cf(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(en(e,t.inner,n).map(o=>o.id));return Pi(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=lf(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(c=>c.id));return $n(jr.flatMap(c=>Pi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=uf(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"membershipSet":{let s=en(e,t.inner,n);return s.length?$n(s.flatMap(o=>kc(e,o.id,t.entityType))):[]}case"qualifier":return t.inner.node==="membership"?gy(e,t,n).matches:en(e,t.inner,n).filter(o=>t.filters.every(r=>io(e,o,Ve[r])));case"boolean":return py(e,t,n);case"anaphora":return my(e,t,n).matches;default:return[]}}function xC(e){let t=Ve[e],n=dy(t);return n&&Object.keys(Ve).find(s=>Ve[s].via===n.via&&Ve[s].value===n.value)||null}function fy(e,t,n){let s=[],o=[];for(let r of t.atoms){let i=o;if(r.op==="seed")o=en(e,r.ast,n);else if(r.kind==="qual"){let a=l=>r.filters.every(u=>io(e,l,Ve[u])),c=l=>r.filters.every(u=>{let d=dy(Ve[u]);return d?io(e,l,d):!io(e,l,Ve[u])});o=r.op==="difference"?i.filter(c):i.filter(a)}else{let a=en(e,r.ast,n),c=new Set(a.map(l=>l.id));if(r.op==="intersection")o=i.filter(l=>c.has(l.id));else if(r.op==="difference")o=i.filter(l=>!c.has(l.id));else if(r.op==="union"){let l=new Set(i.map(u=>u.id));o=i.slice();for(let u of a)l.has(u.id)||(l.add(u.id),o.push(u))}}s.push({atom:r,before:i,after:o})}return{matches:o,steps:s}}function py(e,t,n){return fy(e,t,n).matches}function jC(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=vn(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function my(e,t,n){let o=jC(e,t.candidateTerms);if(!o){let p=n&&n.prev;if(!Array.isArray(p)||!p.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=p.map(f=>e.byId.get(f)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(p=>i.filters.every(f=>io(e,p,Ve[f])));else if(i&&i.type==="entity")r=r.filter(p=>p.class===i.entityType);else if(i&&i.type==="clause"){let p=vn(e,i.clause.object);if(!p.match)r=[];else{let f=Dr[i.clause.kind],m=[...Tt(i.clause.kind),...f?[f]:[]],h=new Set(m.flatMap(b=>tt(e,b)).filter(b=>b.object===p.match.id).map(b=>b.subject));r=r.filter(b=>h.has(b.id))}}let a=p=>p.length&&p.every(f=>f.class===p[0].class)?p[0].class:null,c=i&&i.type==="entity"?i.entityType:a(o),l=r.length?a(r):c;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:l,matches:[]};let u=Di(l,r,"anaphora",{bound:!0}),d=r.length?null:kC(e,o,i);return{compositeKind:"set",matches:r,entityType:l,referents:u,...d?{emptied:d}:{}}}function kC(e,t,n){if(!t.length||!n)return null;let s={...Mi(t,null,null)};if(n.type==="qual"){let o=_c(e,n.filters,!1,t);return o?{held:s,step:o}:null}return n.type==="entity"?{held:s,step:{type:"entityKind",entityType:n.entityType}}:n.type==="clause"&&n.clause?.kind&&n.clause.object?{held:s,step:{type:"clause",clause:{kind:n.clause.kind,object:n.clause.object},excluded:!1}}:null}function hy(e,t,n){let s=n.kind==="*"?RC:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of tt(e,r)){let a=i.subject===t.id,c=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let l=e.byId.get(i.object);if(!l||l.class!==n.filter)continue}o+=1}else(n.dir==="in"&&c||n.dir==="both"&&(a||c))&&(o+=1)}return o}function _C(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function Kd(e,t){let{op:n,pivotRaw:s,entityType:o=null}=t,r=f=>String((f.attributes||[]).find(m=>m.key==="date")?.value||"").slice(0,10),i=null,a=null,c=null;if(TC.test(s))i=s;else{let{match:f,ambiguous:m}=vn(e,s,{expectedClass:"Commit"});f&&!m&&f.class==="Commit"&&r(f)&&(a=f.id,c=f.label,i=r(f))}if(!i)return{compositeKind:"commitFilter",op:n,pivotRaw:s,entityType:o,pivotResolved:!1,matches:[]};let l=e.individuals.filter(f=>f.class==="Commit"&&f.id!==a&&r(f)).filter(f=>{let m=r(f);return n==="since"?m>=i:n==="before"?m<i:n==="after"?m>i:m===i}).sort((f,m)=>r(m).localeCompare(r(f))||String(f.id).localeCompare(String(m.id))),u=o&&o!=="Commit"&&o!=="Change"?$n(l.flatMap(f=>Sy(e,f,o).matches)):null,d=u||l,p=[];if(d.length){let f=u?o:"Commit";p.push({kind:"set",class:f,label:`${d.length} ${de(f,d.length)} ${n} ${s}`,ids:d.map(m=>m.id),attrs:{count:d.length,op:n,...a?{pivot:a}:{}},lane:"commitFilter"})}return a&&p.push({kind:"event",class:"Commit",label:c,ids:[a],attrs:{date:i},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:i,pivotResolved:!0,entityType:o,windowCount:l.length,matches:d,referents:p}}function AC(e,t,n){let s=en(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size){let a=zr(e,t.inner,n);return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0,...a?{emptied:a}:{}}}let r=cf(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(c=>c.key==="date")?.value||"");return r.sort((a,c)=>i(c).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function CC(e,t,n){let s=en(e,t.inner,n),o=s.length?null:zr(e,t.inner,n);return{compositeKind:"whereSet",matches:s,entityType:t.entityType,sites:s.map(r=>(r.attributes||[]).find(i=>i.key==="site")?.value||null),...o?{emptied:o}:{}}}function IC(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(tt(e,"tests").map(c=>c.subject));n=n.filter(c=>!a.has(c.id)&&!Mo(String(c.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:hy(e,a,t.metric)})).sort((a,c)=>t.extreme==="most"?c.score-a.score:a.score-c.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?Di(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function gy(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?h=>s.filters.every(b=>io(e,h,Ve[b])):null,a=h=>Di(r,h,"membership"),c=lf(e,o.term,n&&n.contextId);if(c.kind==="dir"){let h;if(!r||r==="Module")h=c.mods;else{let b=new Set(c.mods.map(g=>g.id));h=$n(jr.flatMap(g=>Pi(e,g,b))).filter(g=>g.class===r)}return i&&(h=h.filter(i)),{compositeKind:"set",matches:h,entityType:r,referents:a(h)}}if(c.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:l,inherited:u,viaLabel:d}=uf(e,c.id,c.entityClass,r,i),p=!l.length&&u.length>0,f=p?u:l,m=f.length?null:OC(e,c,r,s);return{compositeKind:"membership",entityType:r,matches:f,inheritedNotOwn:p,viaLabel:d,ownerLabel:c.label,referents:a(f),...m?{emptied:m}:{}}}function OC(e,t,n,s){if(!s)return null;let{own:o,inherited:r}=uf(e,t.id,t.entityClass,n,null),i=o.length?o:r;if(!i.length)return null;let a=_c(e,s.filters,!1,i);return a?{held:{...Mi(i,null,{entityType:n}),owner:t.label},step:a}:null}function NC(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=vn(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=vn(e,s,{expectedClass:n}),c=!r||a.match&&Wo(e,a.match)===r.id,l=a.match&&c;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:l?[a.match]:[]}}let i=r?hf(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function LC(e,t,n){let s=Wo(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||kc(e,n.id).some(o=>o.id===t.id)}function PC(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=Ps(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=lf(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!LC(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let c=io(e,a.match,Ve[o]),l=r?!c:c,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:l,matches:[a.match],referents:u}}function MC(e,t,n){let s=vn(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=en(e,{node:"allOfClass",entityType:t.entityType},n),r=py(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function FC(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(en(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=cn(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function DC(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};let s=Vd(e,t);if(s)return{compositeMiss:!0,unknownName:s,matches:[]};if(t.node==="exists")return NC(e,t);if(t.node==="qualCheck")return PC(e,t,n);if(t.node==="universal")return MC(e,t,n);if(t.node==="count"){if(t.base.node==="commitFilter"){let l=Kd(e,t.base);return l.pivotResolved?{compositeKind:"count",count:l.matches.length,entityType:t.entityType,matches:[]}:l}let c=FC(e,t.base,n);return c?{compositeKind:"count",count:yC(e,c),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:en(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:en(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return _I(e,t);if(t.node==="superlative")return IC(e,t);if(t.node==="temporal")return AC(e,t,n);if(t.node==="whereSet")return CC(e,t,n);if(t.node==="recentCommits")return _C(e);if(t.node==="commitFilter")return Kd(e,t);if(t.node==="anaphora")return my(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return gy(e,t,n);if(t.node==="find"){let{narrow:c,broad:l}=ly(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:c.length?c:l,broad:!c.length&&l.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let o=en(e,t,n),r=t.entityType||null,i=Di(r,o,t.node==="qualifier"?"qualifierListing":"compositeSet"),a=o.length?null:zr(e,t,n);return{compositeKind:"set",matches:o,entityType:r,referents:i,...a?{emptied:a}:{}}}function ff(e){let t=e?.node==="clause"?e.clause:null;if(!t?.kind||!t.object||t.modifier==="transitive"||t.shape!=="reverse"&&t.shape!=="forward")return null;let n=t.shape==="forward";return n&&co(t.kind).includes(" ")?null:{kind:t.kind,object:t.object,passive:n,entityType:t.entityType||e.entityType||null}}function pf(e){let t=co(e.kind);return`${t.endsWith("e")?`${t}d`:`${t}ed`} ${zC[e.kind]||"by"} ${e.object}`}function _c(e,t,n,s){let o=a=>s.every(c=>a.every(l=>io(e,c,Ve[l])));if(n&&!o(t))return null;let r=n||!t.every(a=>Ve[a]?.value===!1)?[]:t.map(xC),i=r.length>0&&r.every(Boolean)&&o(r);return{type:"qual",filters:i?r:t,negated:!n&&!i}}function UC(e,t,n){if(t.kind==="qual")return t.op!=="difference"&&t.op!=="intersection"?null:_c(e,t.filters,t.op==="difference",n);if(t.op!=="difference"&&t.op!=="intersection")return null;let s=t.op==="difference";if(t.ast?.node==="named")return{type:"named",term:t.ast.term,excluded:s};let o=ff(t.ast);return o?{type:"clause",clause:o,excluded:s}:null}function zr(e,t,n){if(!t||typeof t!="object")return null;if(t.node==="boolean"){let{steps:o}=fy(e,t,n),r=[...o].reverse().find(c=>c.before.length&&!c.after.length);if(!r)return zr(e,o[0]?.atom?.ast,n);let i=UC(e,r.atom,r.before);if(!i)return null;let a=o.indexOf(r)===1?o[0].atom.ast:null;return{held:Mi(r.before,a,t),step:i}}if(t.node==="qualifier"&&t.inner?.node!=="membership"&&t.filters?.length){let o=en(e,t.inner,n);if(!o.length)return zr(e,t.inner,n);let r=_c(e,t.filters,!1,o);return r?{held:Mi(o,t.inner,t),step:r}:null}if(t.node==="reverseSet"||t.node==="forwardSet"||t.node==="membershipSet"){let o=en(e,t.inner,n);if(!o.length)return zr(e,t.inner,n);let r=t.node==="membershipSet"?t.entityType?{type:"membership",entityType:t.entityType}:null:{type:t.node==="reverseSet"?"reverse":"forward",kind:t.kind,entityType:t.entityType||null};return r?{held:Mi(o,t.inner,t),step:r}:null}let s=ff(t);return s?{leaf:s}:null}function Mi(e,t,n){let s=ff(t);return{count:e.length,entityType:BC(e)||s?.entityType||n?.entityType||null,clause:s,wholeKind:t?.node==="allOfClass",members:e}}function Hd(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function WC(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=lo(e);return n?`${t} in ${n}`:t}function qd(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(qd):Array.isArray(e.filters)&&e.filters.some(t=>Ve[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(qd)}function by(e,t){return!["Function","Method"].includes(t)||!qd(e)?null:`This index records tests edges module to module, so a ${de(t,1)} counts as covered exactly when the module it lives in is tested \u2014 ask about that module to see the coverage itself.`}function GC(e){if(e?.node==="qualifier"&&e.inner?.node==="allOfClass"&&e.filters?.length)return{entityType:e.inner.entityType||e.entityType,filters:e.filters,negated:!1};if(e?.node!=="boolean"||e.atoms?.length!==2)return null;let[t,n]=e.atoms;return t.op!=="seed"||t.ast?.node!=="allOfClass"||n.kind!=="qual"||!n.filters?.length||n.op!=="difference"&&n.op!=="intersection"?null:{entityType:t.ast.entityType||e.entityType,filters:n.filters,negated:n.op==="difference"}}function wy(e){let t=GC(e);if(!t)return null;let n=de(t.entityType||"Module",2),s=t.negated?"":"not ";return`Try "which ${n} are ${s}${yn(t.filters)}" for that branch on its own.`}function VC(e,t){return!e||!t?null:t==="Package"?uy(e).length:e.individuals.filter(n=>n.class===t).length}function KC(e){let t=n=>e.entityType?de(e.entityType,n):null;switch(e.type){case"qual":{let n=yn(e.filters);return e.negated?{one:`it is not ${n}`,many:`none of them is ${n}`}:{one:`it is ${n}`,many:`all of them are ${n}`}}case"named":return e.excluded?{one:`it is named "${e.term}"`,many:`all of them are named "${e.term}"`}:{one:`it is not named "${e.term}"`,many:`none of them is named "${e.term}"`};case"clause":{let{clause:n}=e;if(n.passive){let r=pf(n);return e.excluded?{one:`it is ${r}`,many:`all of them are ${r}`}:{one:`it is not ${r}`,many:`none of them is ${r}`}}let s=co(n.kind),o=Br(n.kind);return e.excluded?{one:`it ${o} ${n.object} too`,many:`all of them ${s} ${n.object} too`}:{one:`it does not ${s} ${n.object}`,many:`none of them ${o} ${n.object}`}}case"reverse":{let n=Br(e.kind),s=t(1)?`no ${t(1)} in this index`:"nothing in this index";return{one:`${s} ${n} it`,many:`${s} ${n} them`}}case"forward":{let n=Br(e.kind);return{one:`it ${n} nothing in this index`,many:`none of them ${n} anything in this index`}}case"membership":return{one:`it has no ${t(2)}`,many:`none of them has any ${t(2)}`};case"entityKind":return{one:`it is not a ${t(1)}`,many:`none of them is a ${t(1)}`};default:return null}}function HC(e){let t=de(e.entityType,1),n=de(e.entityType,2);if(e.owner)return{one:`${e.owner} has 1 ${t}`,many:`${e.owner} has ${e.count} ${n}`};if(e.wholeKind)return{one:`The index has 1 ${t}`,many:`The index has ${e.count} ${n}`};if(e.clause?.passive){let o=pf(e.clause);return{one:`1 ${t} is ${o}`,many:`${e.count} ${n} are ${o}`}}if(e.clause)return{one:`1 ${t} ${Br(e.clause.kind)} ${e.clause.object}`,many:`${e.count} ${n} ${co(e.clause.kind)} ${e.clause.object}`};let s=ts(e.members);return{one:`1 ${t} matched that far (${s})`,many:`${e.count} ${n} matched that far (${s})`}}function qC(e){if(!e.clause||!e.entityType)return null;let t=de(e.entityType,2);return`Try "${e.clause.passive?`which ${t} are ${pf(e.clause)}`:`which ${t} ${co(e.clause.kind)} ${e.clause.object}`}" for that branch on its own.`}function Yd(e,t,{branchNote:n=null,verdictTail:s=""}={}){if(!e?.held)return null;let o=KC(e.step);if(!o)return null;let r=e.held,i=HC(r),a=r.count===1,c=qC(r)||n;return`${t?`no ${de(t,2)} match that`:"nothing matches that"}${s}. ${a?i.one:i.many}, but ${a?o.one:o.many}.${c?` ${c}`:""}`}function yy(e){if(e.passive){let n=e.entityType?`no ${de(e.entityType,2)}`:"nothing";return`${e.object} ${Br(e.kind)} ${n} in this index`}return`${e.entityType?`no ${de(e.entityType,1)} in this index`:"nothing in this index"} ${Br(e.kind)} ${e.object}`}function $y(e,t){let n=VC(e,t);return n===null?`nothing in the index matches that${t?` (${de(t,2)})`:""}`:n===0?`no ${de(t,2)} in this index`:n===1?`the index has 1 ${de(t,1)}, and it does not match that`:`the index has ${n} ${de(t,2)}, and none of them matches that`}function Mw(e,t,n,s,o){let r=by(t.inner,n.entityType)||wy(t.inner),i=Yd(n.emptied,n.entityType,{branchNote:r,verdictTail:s});return i||`${n.emptied?.leaf?yy(n.emptied.leaf):$y(e,n.entityType)}${s}. ${r||o}`}function YC(e,t,n){if(t.compositeMiss){if(t.reason==="no-prev")return{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1};if(t.unknownName){let{term:s,entityType:o,elsewhere:r}=t.unknownName,i=o?de(o,1):"entity",a=r?` "${s}" names ${Ns(de(r.class,1))} ${de(r.class,1)} here, not ${Ns(i)} ${i}.`:"";return{content:`no ${i} named "${s}" in this index.${a}`,miss:!0,ambiguous:!1}}return{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${Hd()}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=de(t.entityType,1),o=de(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=lo(i),c=i.class==="Module"?"":a?`, ${Oi("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${ts(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=de(t.entityType,t.total),o=jA(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${ts(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?de(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${de(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>ct?` \u2014 narrow with "${de(t.entityType,2)} in <module>"`:"";return{content:`${ts(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=yn(t.asked),o=Co[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length){let s=Yd(t.emptied,t.entityType);return s?{content:s,miss:!0,ambiguous:!1,matches:[]}:{content:`${t.ownerLabel&&t.entityType?`${t.ownerLabel} has no ${de(t.entityType,2)} in this index.`:Pw(n,t.entityType)} ${oo(n)}`,miss:!0,ambiguous:!1,matches:[]}}if(t.inheritedNotOwn){let s=de(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${ts(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${ts(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=de(t.entityType,1);if(!t.matches.length)return{content:`no ${de(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?WC(t.matches[0]):ts(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:de(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,rn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>rn?` \u2026+${t.matches.length-rn} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.windowCount)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};if(t.entityType&&t.entityType!=="Commit"&&t.entityType!=="Change"){let i=de(t.entityType,t.matches.length||2);return t.matches.length?{content:`${ts(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${i} changed ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]}}let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,rn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>rn?` \u2026+${t.matches.length-rn} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${de(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${ts(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?de(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:Mw(n,e,t,", so there is no change history to date",oo(n)),miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${oo(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let c=(i.attributes||[]).find(d=>d.key==="message")?.value||"",l=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${l}${c?` ("${c}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="whereSet"){if(!t.matches.length)return{content:Mw(n,e,t,", so there is no location to cite",`${Hd()}.`),miss:!0,ambiguous:!1,matches:[]};let s=t.matches.map((r,i)=>Xd(r,t.sites[i])||`${r.label} has no recorded code location in this index.`),o=t.matches.filter((r,i)=>Xd(r,t.sites[i]));return{content:s.join(" "),miss:o.length===0,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=by(e,t.entityType)||wy(e),o=Yd(t.emptied,t.entityType,{branchNote:s});if(o)return{content:o,miss:!0,ambiguous:!1,matches:[]};let r=s||oo(n);return{content:`${t.emptied?.leaf?`${yy(t.emptied.leaf)}.`:Pw(n,t.entityType)} ${r}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${ts(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function mf(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+Hd()}function oo(e=null){return e&&Ei(e)===0?yd:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function Bo(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Rc(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function vy(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function XC(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Ni(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(b=>b.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let b=i[2],g=r.filter(y=>y.class==="Commit"&&(String(y.id).toLowerCase().startsWith(`commit:${b}`)||String(y.label).toLowerCase().startsWith(b)));if(g.length===1)return{match:g[0],candidates:[],tier:1,ambiguous:!1};if(g.length>1)return{match:g[0],candidates:g.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(b=>String(b.label).toLowerCase()===o||String(b.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let c=`ext:${o}`,l=null;e:for(let b of e.relations)for(let g of b.edges)if(String(g.object).toLowerCase()===c){l=g.object;break e}if(l&&!n)return{match:{id:l,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(b=>b.trim()).filter(Boolean);if(u.length>1){let b=new Set;for(let g of u){let y=Ni(e,g,{expectedClass:n});y.match&&!y.ambiguous&&b.add(y.match.id)}if(b.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],p=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(p){let b=o.split(".").pop();for(let g of r){let y=String(g.label||"").toLowerCase();g.class==="Module"?y.split("/").pop()===o&&d.push({ind:g,score:1e3-Math.abs(y.length-o.length)}):y.includes(o)?d.push({ind:g,score:2e3-Math.abs(y.length-o.length)}):y.endsWith(`.${b}`)&&d.push({ind:g,score:1500-Math.abs(y.length-o.length)})}}else{let b=[...Bo(s)],g=o.split(/\s+/).find(v=>v.includes("/")),y=g?g.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,E=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,R=E?XC(s):null;for(let v of r){let k=String(v.label||"").toLowerCase(),I=k.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(I===o){d.push({ind:v,score:5e3});continue}if(o.length>=4&&(I.startsWith(o)||I.endsWith(o))){d.push({ind:v,score:4e3-Math.abs(I.length-o.length)});continue}if(E){let $=vy(v.label);if($&&$===R){d.push({ind:v,score:5e3});continue}let _=/[/_-]/.test(v.label)||/\.[a-z0-9]+$/i.test(String(v.label||""));if($&&_&&R.length>=4&&$.includes(R)){d.push({ind:v,score:2e3-Math.abs($.length-R.length)});continue}}if(v.class==="Module"){let $=Rc(o);if($!==o&&$===Rc(I)){let _=Os(o);if(Is(I,o,_)>_){d.push({ind:v,score:3e3-Math.abs(I.length-o.length)});continue}}}if(o.length>=4&&k.includes(o)){d.push({ind:v,score:1e3-Math.abs(k.length-o.length)});continue}let x=Bo(v.label),T=b.filter($=>x.has($)).length;T>0&&(!y||x.has(y))&&d.push({ind:v,score:T/b.length*Md})}}if(d.sort((b,g)=>g.score-b.score),d.length){let[b,...g]=d,y=g.filter(E=>E.score===b.score),w=b.score>=Md?g.filter(E=>E.score>=Md):g;return{match:b.ind,candidates:w.slice(0,4).map(E=>E.ind),tier:3,ambiguous:y.length>0}}let f=p||o.includes("/"),m=null,h=!f&&typeof Po=="function"?Po(e.proseIndex,s).filter(b=>!n||e.byId.get(b.id)?.class===n):[];if(h.length){let[b,...g]=h,y=e.byId.get(b.id);if(y){let w=g.filter(E=>E.score===b.score);if(m={match:y,candidates:g.slice(0,4).map(E=>e.byId.get(E.id)).filter(Boolean),tier:4,ambiguous:w.length>0,matchedVia:"prose"},!m.ambiguous&&b.via!=="spell")return m}}if(!i&&o.length>=4){let b=Os(o),g=b+1,y=[];for(let w of r){let E=Is(String(w.label||"").toLowerCase(),o,b);if(E>0)for(let R of Bo(w.label)){if(E<=0)break;E=Math.min(E,Is(R,o,b))}E<g?(g=E,y=[w]):E===g&&E<=b&&y.push(w)}if(g<=b&&y.length===1)return{match:y[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(g<=b&&y.length>1&&!m){let[w,...E]=y;return{match:w,candidates:E.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Fd(e,t){let n=vy(t),s=[...Bo(t)],o=[];for(let r of Bo(e))n.includes(r)||s.some(i=>Rc(i)===Rc(r))||xc.has(r)||jy.has(r)||o.push(r);return o}function vc(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(Fd(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Fd(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:yn(s.slice(0,4).map(r=>r.label))}:e}let n=Fd(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function vn(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(JC,"").trim(),i=r.match(QC);if(i){let a=r.slice(0,i.index).trim(),c=nt[i[1].toLowerCase()];if(a&&c){let l=vc(Ni(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=vc(Ni(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return vc(Ni(e,t,n),t)}return vc(Ni(e,t,n),t)}function Ps(e,t,n){if(Io.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return vn(e,t)}function hf(e,t,n){let s=[];for(let o of tt(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function Sy(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||ro.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>tt(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&ro.has(n)&&(c=c.filter(l=>l.class===n)),{matches:c,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function nI(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&gf.has(Fw(s.label))).map(s=>({ind:s,named:n.has(Fw(s.label))?1:0,depth:String(s.label).split("/").length,fixture:tI(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function sI(e,t,n){return e!=="reverse"?!1:t==="imports"||t==="calls"?!n||n==="Module":t==="inherits"?!n||n==="Class":!1}function oI(e,t,n){let s=Tt(n).flatMap(a=>tt(e,a)),o=a=>{let c=`ext:${String(a.label).toLowerCase()}`;return s.filter(l=>l.object===a.id||String(l.object).toLowerCase()===c).map(l=>e.byId.get(l.subject)).filter(Boolean)},r=new Map,i=o(t);for(;i.length;){let a=i.shift();r.has(a.id)||a.id===t.id||(r.set(a.id,a),i.push(...o(a)))}return[...r.values()].sort((a,c)=>String(a.label).localeCompare(String(c.label)))}function bf(e){return(e?.attributes||[]).find(t=>rI.has(t.prop))?.value||null}function iI(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Ns(e)} ${e} in this graph's vocabulary`}function cn(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return DC(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let S=t.candidates.map(j=>{let M=cn(e,j,{contextId:n,prev:s});return{parsed:j,result:M,rendered:Gn(j,M,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:S}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let S=String(t.object||"").trim(),j=S.toLowerCase(),M=(e.individuals||[]).find(z=>{if(!bf(z))return!1;if(String(z.label).toLowerCase()===j)return!0;let K=(z.attributes||[]).find(Y=>Y.key==="token")?.value;return K&&String(K).toLowerCase()===j});if(!M){let z=iy(e,S);return z?{matches:[z.hit],objMatch:z.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:z.text,traversal:`schema lookup for "${S}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${S}"`,ambiguous:!1}}return{matches:[M],objMatch:M,candidates:[],traversal:`schema lookup for "${S}"`,ambiguous:!1}}if(r==="mentions"){let S=String(t.object||"").trim();return{matches:(typeof Po=="function"?Po(e.proseIndex,S):[]).map(z=>e.byId.get(z.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${S}"`}}if(r==="where"&&ZC.test(String(t.object||"").trim())){let S=nI(e,t.object);return{matches:S,objMatch:S[0]||null,candidates:S.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...gf].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!sI(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let S=Ps(e,t.subject,n),j=Ps(e,t.object,n);if(!S.match||!j.match||S.ambiguous||j.ambiguous)return{matches:[],objMatch:j.match,candidates:j.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(S.unresolvedPronoun||j.unresolvedPronoun)};let[M,z]=[S.match,j.match];i==="touches"&&z.class==="Commit"&&M.class!=="Commit"&&([M,z]=[z,M]);let K=Dr[i],Y=[...new Set(K?[...Tt(i),K]:Tt(i))],X=Y.flatMap(L=>tt(e,L)).filter(L=>L.subject===M.id&&L.object===z.id);return{matches:X,answer:t.negated?X.length===0:X.length>0,objMatch:j.match,subjMatch:S.match,candidates:[],traversal:`${Y.join("+")} edge from ${M.label} to ${z.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=Ps(e,t.object,n),t.altObject&&t.altObject!==t.object){let S=Ps(e,t.altObject,n),j=!!c.match&&!c.ambiguous,M=!!S.match&&!S.ambiguous;!j&&M?c=S:j&&M&&c.match.id!==S.match.id&&(c={...c,ambiguous:!0,candidates:[S.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let S=z=>z.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),j=S(String(t.object||"").trim().toLowerCase()),M=(e.individuals||[]).find(z=>{if(z.class!=="Module"||z.id===c.match.id)return!1;let K=String(z.label||"").toLowerCase().split("/").pop();return K!==S(K)&&S(K)===j});M&&(c={...c,ambiguous:!0,candidates:[M,...c.candidates||[]]})}}let{match:l,candidates:u,ambiguous:d,unresolvedPronoun:p,matchedVia:f,unplacedWords:m,nearestLabel:h}=c;if(!l)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:p,unplacedWords:m,nearestLabel:h};if(d){let j=$n([l,...u||[]]).slice(0,ct).map(M=>{let z=cn(e,t,{contextId:n,prev:s,pinnedObjMatch:M});return{candidate:M,result:z,rendered:Gn(t,z,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:j}}if(r==="where"){let S=(l.attributes||[]).find(j=>j.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whereShape:!0,site:S,traversal:S?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let S=z=>String((z.attributes||[]).find(K=>K.key==="date")?.value||""),j;if(l.class==="Commit")j=[l];else{let z=["touches","touchesSymbol"].flatMap(Y=>tt(e,Y)).filter(Y=>Y.object===l.id),K=new Set;j=[];for(let Y of z){if(K.has(Y.subject))continue;K.add(Y.subject);let X=e.byId.get(Y.subject);X&&X.class==="Commit"&&j.push(X)}j.sort((Y,X)=>S(X).localeCompare(S(Y)))}let M=j.length&&S(j[0])?[{kind:"event",class:"Commit",label:j[0].label,ids:[j[0].id],attrs:{date:S(j[0]).slice(0,10)},lane:"when"}]:[];return{matches:j,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whenShape:!0,referents:M,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let S=Y=>String((Y.attributes||[]).find(X=>X.key==="date")?.value||""),j=["touches","touchesSymbol"].flatMap(Y=>tt(e,Y)).filter(Y=>Y.object===l.id),M=new Set,z=[];for(let Y of j){if(M.has(Y.subject))continue;M.add(Y.subject);let X=e.byId.get(Y.subject);X&&X.class==="Commit"&&z.push(X)}z.sort((Y,X)=>S(X).localeCompare(S(Y)));let K=z.length&&S(z[0])?[{kind:"event",class:"Commit",label:z[0].label,ids:[z[0].id],attrs:{date:S(z[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:z,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whoLastShape:!0,referents:K,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return Sy(e,l,a,{candidates:u,ambiguous:d,matchedVia:f});if(r==="forward"){let S=Dr[i],M=!!(S&&l.class&&ro.has(l.class))?[...new Set([...Tt(i),S])]:Tt(i);if(a&&a!=="Change"){let H=tf(e,M),W=Pd[a];if(H.size&&!H.has(a)&&!(W&&H.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,forwardGrainMiss:!0,wantClasses:[...H],traversal:`${M.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${Ls(a)})`}}let K=M.flatMap(H=>tt(e,H)).filter(H=>H.subject===l.id).map(H=>e.byId.get(H.object)).filter(Boolean),Y=$n(K),X=Y,L="";if(a&&a!=="Change"){X=Y.filter(W=>W.class===a);let H=Pd[a];if(!X.length&&H){let W=Y.filter(O=>O.class===H);W.length&&(X=W,L=`, widened to ${H} subjects (no ${a} recorded)`)}}return{matches:X,objMatch:l,candidates:u,traversal:`${M.join("+")} edges where subject = ${l.label}${L}`,ambiguous:d,matchedVia:f}}if(t.modifier==="transitive")return i==="inherits"?{matches:oI(e,l,i),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`subclass closure over inherits edges from ${l.label}`}:{matches:Ir(e,l,{maxDepth:Dw,includeCycleReturn:!0}).flat().map(M=>e.byId.get(M.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${Dw})`};let b=Dr[i]||Tt(i).find(S=>Ww.has(S))||null,g=!!(l.class&&ro.has(l.class));if(b&&(ro.has(a)||g)){let S=tt(e,b).filter(L=>L.object===l.id),j=$n(S.map(L=>e.byId.get(L.subject)).filter(Boolean)),M=!a||a==="Change"?j:j.filter(L=>L.class===a),z="",K=Pd[a];if(!M.length&&K){let L=j.filter(H=>H.class===K);L.length&&(M=L,z=`, widened to ${K} subjects (no ${a} recorded)`)}let Y=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!tt(e,"contains").some(L=>L.subject===l.id),X=Y?e.byId.get(Wo(e,l)||""):null;if(M.length||!(Y&&X))return{matches:M,objMatch:l,candidates:u,traversal:`${b} edges where object = ${l.label}${z}`,ambiguous:d,matchedVia:f}}let y=l,w=u,E=d,R=f,v="",k=qw(e,i);if(k&&y.class&&y.class!==k){let S=vn(e,t.object,{expectedClass:k});if(S.match&&!S.ambiguous)y=S.match,w=S.candidates,E=S.ambiguous,R=S.matchedVia;else if(k==="Module"){let j=Wo(e,y),M=j&&e.byId.get(j);if(M)v=`, refined from ${y.label} to its containing module`,y=M;else return{matches:[],objMatch:y,candidates:w,ambiguous:E,matchedVia:R,wrongGrainMiss:!0,wantClass:k,traversal:`"${t.object}" resolved to ${Ls(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${Ls(k)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:y,candidates:w,ambiguous:E,matchedVia:R,wrongGrainMiss:!0,wantClass:k,traversal:`"${t.object}" resolved to ${Ls(y.class)} ${y.label} (grain mismatch: this "${i}" question needs a ${Ls(k)})`}}let I=Tt(i).flatMap(S=>tt(e,S)).filter(S=>S.object===y.id);i==="cochange"&&(I=I.concat(Tt(i).flatMap(S=>tt(e,S)).filter(S=>S.subject===y.id).map(S=>({...S,subject:S.object,object:S.subject}))));let x="";if(!I.length&&y.class){let S=`ext:${String(y.label).toLowerCase()}`;I=Tt(i).flatMap(j=>tt(e,j)).filter(j=>String(j.object).toLowerCase()===S),I.length&&(x=` (by name, via unresolved ${S} references)`)}let T=[],$=new Set;for(let S of I){let j=e.byId.get(S.subject);j&&!$.has(j.id)&&($.add(j.id),T.push(j))}let _,C="";if(!a||a==="Change")_=T;else{let S=T.filter(M=>M.class===a),j=S.length||!ry(i,a)?[]:oy(e,new Set([y.id]));if(S.length)_=S;else if(j.length)_=j,C=`, falling back to ${y.label}'s recorded source site (no defines edge)`;else if(a!=="Module"&&T.some(M=>M.class==="Module")){let M=new Set(T.filter(z=>z.class==="Module").map(z=>z.id));_=hf(e,M,a),C=`, then ${Ls(a)} defined in the matched module(s)`}else _=[]}return{matches:_,objMatch:y,candidates:w,traversal:`${Tt(i).join("+")} edges where object = ${y.label}${x}${C}${v}`,ambiguous:E,matchedVia:R}}function lo(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function Xd(e,t){let n=String(t||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(n){let o=n[3]&&n[3]!==n[2]?`lines ${n[2]}-${n[3]}`:`line ${n[2]}`;return`${Jd(e)} is defined in ${n[1]} at ${o}.`}let s=lo(e);return s?`${Jd(e)} is defined in ${s} (no line span recorded in this index).`:null}function Jd(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function aI(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function yn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function Li(e){let t=e.object??e.subject??"?";return`${e.entityType?de(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function co(e){return Ao[e]?.bare||e}function Br(e){return gg(e)}function cI(e){let t=co(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function lI(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=de(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${co(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${co(o.kind)} ${JSON.stringify(String(r))}`}function Ey(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(Li).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Ey(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?lI(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${zo(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?de(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${zo(e.kind)}`:`${r}${zo(e.kind)} "${e.object}"`}return{english:o,machine:s}}function Gn(e,t,n=null){let s=xy(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function xy(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${mf()}`,miss:!0,ambiguous:!1};if(e.node)return YC(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
- ${t.branches.map((c,l)=>`${l+1}) as ${Li(c.parsed)}: ${c.rendered.content}`).join(`
53
+ `)}`+(o.length>xd?`
54
+ \u2026+${o.length-xd} more`:"")}var jd,sb,gb,ib,d_,p_,vd,m_,cc,h_,g_,b_,yb,w_,y_,$_,v_,S_,E_,x_,j_,k_,R_,__,T_,A_,C_,I_,O_,N_,L_,P_,M_,F_,D_,z_,B_,U_,ab,W_,G_,$b,vb,Sb,V_,K_,H_,q_,Y_,lb,ub,Q_,db,ic,fb,pb,mb,_i,He,eT,tT,Cb,nT,cn,Lb,sT,Vb,rT,iT,aT,cT,lT,uT,dT,fT,Sd,hb,dc,pT,Ed,xd,Me=M(()=>{Kn();Cn();bd();ji();Ts();jd="This store holds no code index, so it records no modules or commits to look through.",sb={"mgx:importsnamespace":"imports","mgx:callscoarse":"calls","seon:declaresmethod":"defines","mgx:testscoverage":"tests","mgx:touchedbycommit":"touches","seon:containscodeentity":"contains","seon:hassupertype":"inherits","mgx:changecoupledwith":"cochange","mgx:reexports":"reexports","mgx:serves":"serves","mgx:denotes":"denotes","mgx:touchessymbol":"touchesSymbol","mgx:callssymbol":"callsSymbol","seon:usescomplextype":"imports","seon:invokesmethod":"calls","seon:history":"touches","mgx:subclassof":"inherits","mg:imports":"imports","mg:calls":"calls","mg:defines":"defines","mg:tests":"tests","mg:touches":"touches","mgx:saidinsession":"saidInSession","mgx:inreplyto":"inReplyTo","mgx:statedby":"statedBy","mgx:canonicalisedfrom":"canonicalisedFrom"};gb=e=>/^(git|turn):/.test(String(e||""));ib=30,d_=8;p_=2,vd=25,m_=3;cc=10,h_=8,g_=3,b_=2,yb=5,w_=4,y_=.2,$_=.35,v_=.15,S_=e=>/(^|\/)(examples?|fixtures?|samples?|demos?|benchmarks?|test-[^/]+)(\/|$)/.test(e),E_=.2,x_=.35,j_=.2,k_=.35,R_=e=>/\.cs$/i.test(e),__=e=>/^I[A-Z]/.test(String(e||"")),T_=.2,A_=.35,C_=50,I_=.2,O_=.35,N_=.5,L_=yb,P_=3,M_=4,F_=1,D_=.9,z_=.5,B_=.2,U_=.35,ab=4,W_=2,G_=[["imports"],["calls","callsSymbol"],["inherits"],["cochange"]],$b=3,vb=12,Sb=.9,V_=["imports","calls","callsSymbol","inherits"],K_=.5,H_=.6,q_=.2,Y_=.35;lb=128,ub=4,Q_=64,db=250,ic=class extends Error{};fb=new WeakMap;pb=40,mb=40,_i=30;He=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value||"";eT=25,tT=15;Cb=40,nT="tests edges are recorded module to module, so this is module-grain coverage.";cn=15;Lb=new Set(["Function","Method"]);sT=8;Vb={function:"Function",class:"Class",method:"Method",attribute:"Attribute"};rT=8,iT=16,aT=4,cT=6,lT=12,uT=2,dT=8,fT=3,Sd=e=>String(e||"").split(",").map(t=>t.trim()).filter(Boolean),hb=e=>String(e||"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(Boolean),dc=e=>{let t=String(e||"").trim();return t?t.split(",").map(n=>n.trim()).filter(Boolean).length:0},pT=e=>{let t=new Map,n=e[0]??0,s=0;for(let o of e){let r=(t.get(o)||0)+1;t.set(o,r),r>s&&(s=r,n=o)}return n};Ed=20;xd=40});function it(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ow(e){let t=String(e||"");return Qb&&(t=t.replace(Qb," ")),t.replace(/\s+/g," ").trim()}function rw(e){let t=String(e||"");t=t.replace(PT," ").replace(/\s+/g," ").trim();for(let n=0;n<3;n++){let s=t,o=t.match(CT);if(o&&(t=o[1].trim()),o=t.match(IT),o&&(t=o[1].trim()),o=t.match(Zb),o&&(t=o[1].trim()),o=t.match(ew),o&&(t=o[1].trim()),o=t.match(tw),o&&(t=o[1].trim()),o=t.match(LT),o&&(t=o[1].trim()),o=t.match(nw),o&&(t=o[1].trim()),o=t.match(MT),o&&(t=o[1].trim()),o=t.match(FT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(DT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(zT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(BT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(UT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(WT),o&&oo.test(o[1].trim())&&(t=o[1].trim()),o=t.match(GT),o&&(t=`what ${o[2].toLowerCase()} ${o[1].trim()}`),o=t.match(VT),o&&(t=`what does ${o[1].trim()} mean`),o=t.match(KT),o&&(t=`what do you ${o[1].toLowerCase()} about ${o[2].trim()}`),o=t.match(HT),o){let r=o[1].trim();AT(r)||(t=!qT.test(r)&&(RT.test(r)||oo.test(r))?r:`describe ${r}`)}if(o=t.match(YT),o){let r=o[1].trim();(oo.test(r)||XT.test(r)||nw.test(r)||Zb.test(r)||tw.test(r)||ew.test(r)||JT.test(r))&&(t=r)}if(t===s)break}return t}function cA(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t,o=t.match(iA);if(o&&(t=o[1].trim()),o=t.match(aA),o&&(t=o[1].trim()),t===s)break}return t}function uA(e){let t=String(e||"");for(let n=0;n<3;n++){let s=t.match(lA);if(!s)break;let o=s[1].trim();if(!o||o===t)break;t=o}return t}function Ai(e){let t=String(e||"").trim(),n=t.match(pA)||t.match(mA);return n?n[1].trim():null}function Od(e){let t=String(e||""),n=t.match(fA);if(n){let o=aw[n[1].toLowerCase()],r=iw[n[2].toLowerCase()],i=n[5]||n[6],a=n[4]?n[4].toLowerCase():Cd[i.toLowerCase()];return`${o} ${r} ${n[3].trim()} and ${a}`}let s=Ai(t);return s?`which modules transitively import ${s}`:t}function Ci(e){return String(e||"").replace(yT,t=>id[t.toLowerCase()])}function Bo(e){let t=Ci(e);return t=t.replace($T,n=>ad[n.toLowerCase()]),t=t.replace(vT,n=>cd[n.toLowerCase()]),t=t.replace(ST,"with"),t=t.replace(ET,(n,s)=>`${s} for`),t=t.replace(xT,(n,s)=>`for ${s}`),t=t.replace(jT,(n,s)=>s),t=t.replace(hA,"$1$2"),t=t.replace(jg,"$1ing"),t=rw(t),t=uA(t),t=cA(t),t=Od(t),t=ow(t),t=wn(t),t=t.replace(/\?{2,}\s*$/,"?"),t.replace(/\s+/g," ").trim()}function Ii(e){for(let t of[...Rg,...kg]){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function Nd(e){for(let t of gA){let n=e.match(t.re);if(n)return t.to(n).replace(/\s+/g," ").trim()}return e}function uw(e){let t=String(e||"").match(bA);if(!t)return null;let n=t[1].toLowerCase(),s=t[2].trim();return s?{entWord:n,predicate:s}:null}var wT,yT,sw,$T,vT,ST,ET,xT,jT,kT,Qb,RT,oo,_T,TT,AT,Ti,CT,IT,OT,NT,Zb,ew,tw,LT,PT,MT,FT,DT,zT,BT,UT,WT,GT,VT,KT,HT,qT,YT,XT,JT,nw,pc,QT,ZT,eA,tA,nA,sA,oA,A2,Id,rA,C2,I2,O2,iA,aA,lA,iw,aw,dA,Cd,fA,cw,lw,pA,mA,hA,gA,bA,ft,ln,be,In=M(()=>{ns();wT=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(it).join("|")+")\\b","gi"),yT=wT(id),sw=e=>new RegExp("\\b("+Object.keys(e).sort((t,n)=>n.length-t.length).map(it).join("|")+")\\b(?!\\.[a-z0-9])","gi"),$T=sw(ad),vT=sw(cd),ST=/(?<=^|\s)w\/(?=\s|$)/gi,ET=/\b(thx|thanks|thank\s+you|many\s+thanks|ty|cheers)\s+4\b/gi,xT=/\b4\s+(example|instance)\b(?!\s*[a-z])/gi,jT=/\b(this|that)\s+(class|module|function|method|attribute|variable|file|commit)\b/gi,kT=Object.keys(me).sort((e,t)=>t.length-e.length).map(it).join("|"),Qb=vi.length?new RegExp("\\b("+[...vi].sort((e,t)=>t.length-e.length).map(it).join("|")+")\\b\\s*,?","gi"):null;RT=new RegExp("\\b(?:"+Object.keys(me).sort((e,t)=>t.length-e.length).map(it).join("|")+")\\b","i"),oo=/^(?:which|what|who|whose|where|when|why|how)\b/i,_T=new Set(["modules","files","packages","functions","methods","classes","attributes","fields","properties","variables","globals","commits","changes","tests","members"]),TT=/^(?:all\s+|the\s+)?(?:module|file|package|function|method|class|attribute|field|property|variable|global|commit|change|test|member)\??$/i,AT=e=>{if(TT.test(e))return!0;let t=e.replace(/\?+\s*$/,"").trim().split(/\s+/);return _T.has((t[t.length-1]||"").toLowerCase())},Ti="[,.;:!]|\u2014|\u2013|-",CT=/^(?:hi|hiya|hello|hey|yo|howdy|g'?day|yeah\s+nah|good\s+(?:morning|afternoon|evening|day)|greetings|salutations)(?:\s+(?:there|pardner|folks|friend|mate))?\s*[,.—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,IT=/^(?:thanks|thank\s+you|many\s+thanks|thx|ty|cheers)(?:\s+(?:so\s+much|a\s+lot|very\s+much|a\s+bunch))?\s*[,—–-]\s*(?:(?:just\s+a\s+)?quick\s+question\s*[,:—–-]?\s*)?(.+)$/i,OT="ok(?:ay)?|aight|cool|alright|sure|right|fine|great|nice|got it|gotcha|sounds good|no worries|no problem|another\\s+one",NT="(?:just\\s+)?(?:one|another)\\s+more",Zb=new RegExp(`^(?:(?:${OT})[\\s,]+|(?:${NT})\\s*(?:${Ti})\\s*)+(.+)$`,"i"),ew=/^(?:just\s+(?:poking\s+around|looking\s+around|browsing|exploring|checking\s+(?:this|it)\s+out)|first\s+time\s+(?:trying\s+this\s+out|using\s+this|here)|i'?m\s+new\s+(?:here|around\s+here|to\s+(?:this|all\s+this)(?:\s+(?:repo|codebase|project|app|tool|thing))?))\s*[,.—–-]\s*(.+)$/i,tw=/^(?:(?:maybe|possibly|perhaps)\s+)+(.+)$/i,LT=/^(?:please[\s,]+)+(.+)$/i,PT=/,?\s*if\s+(?:it'?s|it\s+is|that'?s|that\s+is)\s+not\s+too\s+much\s+(?:trouble|bother|hassle)\s*,?\s*/i,MT=/^(?:can|could|would|will)\s+you\s+(?:please\s+)?(.+?)(?:[,\s]+please)?\??$/i,FT=/^explain\s+(?:to\s+me\s+|please\s+)*(.+?)\??$/i,DT=/^tell\s+me\s+(?:please\s+)?(.+?)\??$/i,zT=/^(?:(?:would|do)\s+you\s+)?mind\s+telling\s+(?:me|us)\s+(?:please\s+)?(.+?)\??$/i,BT=/^do\s+you\s+know\s+(.+?)\??$/i,UT=/^i(?:'d|\s+would)?\s+(?:(?:like|want|need)\s+to|wanna)\s+know\s+(.+?)\??$/i,WT=/^i(?:\s+was|\s+am|'m)?\s+(?:just\s+)?(?:wonder(?:ing|ed)?|curious)(?:\s+(?:if|whether|about))?\s+(.+?)\??$/i,GT=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+(is|are)\??$/i,VT=/^what\s+((?:an?\s+|the\s+)?[\w'-]+(?:\s+[\w'-]+){0,2})\s+means\??$/i,KT=/^what\s+you\s+(know|remember)\s+about\s+(.+?)\??$/i,HT=/^(?:show|give)\s+me\s+(?:the\s+)?(.+?)\??$/i,qT=/^everything\s+i(?:'d|\s+would)?\s+need\b/i,YT=/^(?:and|also|so|then|now|but)\s+(.+)$/i,XT=/^(?:does|do|did|is|are|was|were|has|have|had|can|could|will|would|should)\b/i,JT=/^(?:the|its|their|his|her|our|my)\s+[\w'-]+(?:\s+[\w'-]+){0,2}\s+(?:that|which|who)\s+\S/i,nw=/^(?:(?:actually|no\s+wait|wait|hold\s+on|never\s+mind|scratch\s+that|on\s+second\s+thought|i\s+mean(?:t)?)[\s,.]+)+(.+)$/i;pc=e=>[...e].sort((t,n)=>n.length-t.length).map(it).join("|"),QT=Object.freeze(["oh","ah","aha","ooh","ohh","wow","huh","hm","hmm","mm","mmm","heh","ha","yay","ugh","oof","phew","whoa","oops","yikes","oi"]),ZT=Object.freeze(["nice","cool","great","neat","lovely","interesting","good","ok","okay","fair enough","makes sense","i see","got it","fine"]),eA=Object.freeze(["um","umm","uhm","uh","uhh","er","err","erm","ehm","eh","well","anyway","anyhow","anyways","regardless","moving on"]),tA=Object.freeze(["quick question","quick q","one quick question","just a quick question","random question","random thing","one more random thing","another random thing","one more thing","one last thing","last thing","one more question","side note","side question","sidebar","off topic","unrelated","on a different note","different topic","changing the subject","new topic","just curious","out of curiosity","curious","genuinely curious","while i'm here","while i have you","before i forget"]),nA=`(?:${pc(QT)})(?:\\s+(?:${pc(ZT)}))?\\s*(?:${Ti})\\s*`,sA=`(?:${pc(eA)})\\s*(?:(?:${Ti})\\s*|\\s+)`,oA=`(?:${pc(tA)})\\s*(?:${Ti})\\s*`,A2=new RegExp(`^(?:sorry\\s*(?:${Ti})?\\s*)?(?:${nA}|${sA}|${oA})+`,"i"),Id="what|who|which|where|when|why|how",rA="is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must",C2=new RegExp(`\\b(?:an?|the)?\\s*(?:${Id})\\s*\\?\\s*$`,"i"),I2=new RegExp(`^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:${Id})\\b`,"i"),O2=new RegExp(`\\b(?:${Id})\\s+(?:i|you|he|she|it|we|they)?\\s*(?:${rA})\\b`,"i"),iA=/^(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+?,\s*(.+)$/i,aA=/^(.+?),\s*(?:since|although|(?:even\s+)?though|while|because|whereas|given\s+that|now\s+that)\s+.+$/i;lA=/^.+?(?:\s*(?:--|—|-)\s*)?\b(?:sorry|i\s+mean)\b\s*(?:--|—|-|,|:)\s*(.+)$/i;iw=Object.freeze({imports:"importing",calls:"calling",touches:"touching",tests:"testing",exports:"exporting",contains:"containing",defines:"defining",uses:"using","inherits from":"inheriting from"}),aw=Object.freeze({module:"modules",class:"classes",function:"functions",method:"methods",attribute:"attributes",variable:"variables",commit:"commits",file:"files"}),dA="public|private|protected|static|abstract|constant|re-?exported|exported|tested|covered|untested|uncovered",Cd=Object.freeze({tests:"tested","a test":"tested","any tests":"tested",coverage:"covered","test coverage":"covered"}),fA=new RegExp("^if\\s+(?:a|an|the)?\\s*("+Object.keys(aw).join("|")+")\\s+("+Object.keys(iw).join("|")+")\\s+(.+?),\\s*(?:(?:is|are)\\s+(?:it|that|they|this)\\s+("+dA+")|(?:has|have)\\s+(?:it|that|they|this)\\s+got\\s+("+Object.keys(Cd).join("|")+")|(?:does|do)\\s+(?:it|that|they|this)\\s+have\\s+("+Object.keys(Cd).join("|")+"))\\??$","i"),cw="(?:were|was)\\s+(?:deleted|removed)",lw="what\\s+(?:would|might|could)\\s+(?:break|fail|be\\s+affected)",pA=new RegExp("^if\\s+(.+?)\\s+"+cw+",?\\s*"+lw+"\\??$","i"),mA=new RegExp("^"+lw+"\\s+if\\s+(.+?)\\s+"+cw+"\\??$","i");hA=new RegExp(`^(where\\s+(?:is|are|was|were)\\s+.+?)\\s+(?:${od.map(it).join("|")})(\\s*[?.!]*)$`,"i");gA=Object.freeze([{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:are|is)\s+(?:in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:does|do)\s+(.+?)\s+have\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+are\s+(?:the\s+)?(?:functions?|methods?|members?|attributes?|fields?|properties)\s+(?:of|in|inside|within)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^(?:the\s+)?(?:members?|methods?|attributes?|contents)\s+of\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+else\s+is\s+(?:in|inside)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`what does ${e[1]} contain`},{re:/^what\s+(?:defined|declared)\s+(?:the\s+)?(?:function\s+|method\s+|class\s+|module\s+|variable\s+|constant\s+)?(.+?)\??$/i,to:e=>`where is ${e[1]} defined`},{re:/^where'?s\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^were\s+is\s+(?:the\s+)?(.+?)\s+(defined|declared|located|implemented)\??$/i,to:e=>`where is ${e[1]} ${e[2]}`},{re:/^what\s+is\s+the\s+purpose\s+of\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\??$/i,to:e=>`what is a ${e[1]}`},{re:new RegExp(`^what\\s+does\\s+(?:the\\s+)?(?!(?:an?|it|this|that|these|those)\\s)(.+?)\\s+do\\s+(?:${rd.map(it).join("|")})\\??$`,"i"),to:e=>`what is a ${e[1]}`},{re:/^(?:which|what)\s+(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:are|is)\s+(public|private|protected|static|abstract|constant|exported|re-?exported|tested|covered|untested|uncovered)\??$/i,to:e=>`${e[2].toLowerCase()} ${e[1].toLowerCase()}`},{re:/^what\s+(?:is|are)\s+(not\s+)?(tested|untested|covered|uncovered)\??$/i,to:e=>{let t=e[2].toLowerCase();return`${e[1]?t==="tested"?"untested":t==="covered"?"uncovered":t:t} modules`}},{re:/^what\s+does\s+(.+?)\s+changes?\s+together\s+with\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^what\s+changes?\s+together\s+with\s+(.+?)\??$/i,to:e=>`what co-changes with ${e[1]}`},{re:/^how\s+many\s+commits\s+(?:are|were)\s+(?:recorded|logged)\s+(?:for|against)\s+(?:the\s+)?(.+?)\??$/i,to:e=>`how many commits touched ${e[1]}`},{re:/^who\s+(?:wrote|authored)\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^who\s+is\s+the\s+authors?\s+of\s+(?:the\s+)?(?!(?:commit\s+)?[0-9a-f]{7,40}\??$)(.+?)\??$/i,to:e=>`who touched ${e[1]}`},{re:/^(?:does|do)\s+(?!.*\bnot\b)(.+?)\s+have\s+(?:any\s+)?(?:tests?|test\s+coverage|coverage)\??$/i,to:e=>`what tests ${e[1]}`},{re:/^(?:is|are)\s+(?!.*\bnot\b)(.+?)\s+tested\??$/i,to:e=>`what tests ${e[1]}`},{re:/^what\s+needs\s+(?:to\s+be\s+)?(?:a\s+)?(?:tested|tests?|testing|coverage|covering)\??$/i,to:()=>"untested modules"},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+(?:(?:that|which)\s+)?(?:have|has|having|with)\s+no\s+tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:/^(?:which|what|list|show(?:\s+me)?|find)?\s*(?:the\s+|all\s+)?([a-z][a-z-]*?)\s+without\s+(?:any\s+)?tests?\??$/i,to:e=>`untested ${e[1].toLowerCase()}`},{re:new RegExp(`^(?:do|does)\\s+(.+?)\\s+(${kT})\\s+(?:anything|something)(?:\\s+else)?\\??$`,"i"),to:e=>`what does ${e[1]} ${e[2]}`}]);bA=new RegExp("^(?:which|what|who|list|show(?:\\s+me)?|find|give\\s+me)?\\s*(?:the\\s+|all\\s+)?([a-z][a-z-]*)\\s+(?:(?:that|which|who)\\s+)?(?:(?:do|does|did|are|is|was|were|have|has|can|could|will|would|should)\\s+not|cannot|can't|won't|couldn't|shouldn't|wouldn't|not)\\s+(.+)$","i");ft=new Set(["what","who","which","where","when","why","how","does","do","did","is","are","was","were","the","a","an","of","to","from","at","in","on","there","something","anything","nothing","one","any","anywhere","last","usually","typically","generally","normally","often","commonly","mostly","should","would","could","can","will","shall","might","must"]),ln=e=>String(e).replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),be=e=>e.flatMap(t=>String(t).toLowerCase().split(" "))});var fw,dw=M(()=>{fw={source:"corpus/wordnet/*.jsonl lemmas, expanded through the regular -s/-ed/-ing inflections",generator:"scripts/generate-real-word-collisions.mjs",targets:["alongside","build","builds","built","call","calling","calls","change","changed","changes","check","checks","class","co-change","co-changes","code","commits","contain","containing","contains","couple","couples","cover","covers","declare","declares","define","defined","defines","defining","denote","denotes","denoting","depends","derive","derives","directly","edited","execute","executes","exercise","exercises","explicitly","export","exporting","exports","expose","exposes","extend","extending","extends","fire","fires","from","grab","grabs","have","hits","hold","holds","hooked","import","importing","imports","included","indirectly","inherit","inheriting","inherits","inside","into","invoke","invokes","kick","kicks","kind","land","landed","lean","leans","live","lives","make","makes","modified","modifies","move","moves","parent","part","pass","passes","pull","pulls","re-export","re-exports","reference","references","relies","rely","require","requires","runs","serve","serves","serving","share","shares","sits","subclass","subclasses","subclassing","superclass","superclasses","sure","talk","talks","tend","tends","test","testing","tests","through","together","touch","touched","touches","touching","transitively","trigger","triggers","tweaked","updated","uses","using","usually","verifies","verify","went","were","wired","with"],words:["aalging","aasing","aave","ablies","abling","aboves","absing","abuses","abusing","acauling","achinged","acolds","acquire","acquires","acyling","adelies","adenine","adenined","adenines","adenining","adenota","adenotaing","adenotas","aditted","aerides","aerified","aerifies","aerify","aerying","affine","affined","affines","affining","afire","afires","afling","agalling","ailing","aired","airied","airies","airport","airporting","airports","airsed","airses","airted","alaing","alases","albing","alecks","aleves","aliaes","alikes","alines","alive","alives","allaing","allies","alling","alls","allying","alongsided","alongsides","alping","alting","altogether","amasses","amazes","amends","amorting","amorts","amuses","amusing","analling","anded","anoded","ansing","anuses","apart","aparts","apises","apparent","appends","appose","apposes","apsing","apsises","arab","arabis","arabs","ardent","argent","arpent","arrive","arrives","arsing","asaing","asding","aseans","ases","ashing","ashore","ashores","asing","asking","asping","asring","asses","assess","assets","assing","assure","attending","attest","attesting","attests","audited","aufing","auging","auking","aurifies","aurify","avouch","avouched","avouches","avouching","awaked","awakes","awared","awares","awling","awried","axling","baases","badded","bailed","bailing","baited","bake","bakeds","bakers","bakes","balded","balding","baling","balk","balking","balks","ball","balling","balls","ballsing","ballying","balming","band","banded","bandeds","bandied","bandsed","banked","banned","barded","barelies","barely","barses","bart","baseses","bashes","basing","basises","bass","bassed","basses","basset","bassets","bassos","bastes","basting","batses","bauded","baulks","bawded","bawling","bbsing","beaked","bean","beanos","beans","beasting","beasts","beating","beeting","begild","begilds","behave","behold","beholds","belied","belief","beliefs","belies","belikes","belizes","belles","bellies","belling","belting","bend","bended","bends","bent","berging","bering","berking","berming","beroes","besets","besots","besses","bessing","best","besting","bests","beting","betting","bevies","bhanged","biered","bigger","biggers","billing","bind","binded","birded","birled","birles","biroed","birred","bising","bjsing","bladed","blanced","bland","blanda","blandaed","blanded","blands","blanked","blares","blases","blasts","bleaked","bleaks","blears","bleats","blended","blends","blesting","blests","blinded","blinds","blited","blites","bloked","blonded","bmuses","bnsing","boched","boches","boching","bocked","bode","bodilied","bodilies","boiled","boileds","bokked","bold","bolds","bolling","bonded","boners","bonked","boobed","booked","bookeds","bookend","booker","bookied","booksed","boomed","booned","boored","booted","boozed","borers","borough","bosked","bosses","botched","botches","botching","boucheed","bouchees","boucle","boucled","boucling","boughed","boughing","boules","boulle","boulles","bouses","bousing","bowers","boxers","bpsing","bragger","braggers","brakes","branded","brasses","breaked","breves","breving","bricks","brigged","brills","broked","brooked","bruins","brunts","brunus","bses","bsing","bugled","bugles","buhled","builders","buildups","bull","bulled","bullet","bulling","bulls","buns","bunses","bunsing","buried","burieds","burled","burleds","buses","bushes","bushing","busied","busies","busking","bussing","busying","buyied","buying","bypass","bypasses","caballing","cabals","cabbing","cabers","cabged","cabging","cables","cablin","cabling","cablins","caching","cackling","cadded","cadding","cadent","cadged","cadges","cadging","cadring","cafers","caffing","cafing","cagers","caging","cagying","caining","cajoling","cake","cakes","cakiling","caking","calcine","calean","caleans","caleying","caleys","calf","calfing","calfs","califs","calkin","calking","calkins","callaing","callas","callers","callinged","callings","callous","callowing","callows","calluna","callus","calm","calming","calmings","calmlying","calms","calquing","calvaing","calvas","calves","calving","calvings","calx","calxes","calxing","calycling","calyxing","camass","camelling","camels","camming","camoing","camping","canaing","canalling","canals","candid","candied","candled","candling","cangue","cangued","cangues","caning","canning","canoes","canting","cantling","capers","caping","caplin","caplins","capoing","capping","captain","captaining","captains","carded","carding","caring","carking","carlina","carline","carling","carlings","carlos","carning","caroling","carolling","carols","carping","carring","cart","carting","carver","carvers","carves","casaing","cashes","cashing","casking","cassies","castes","castling","casually","casuses","caters","catling","catlings","catses","catsing","catting","cattling","caul","cauline","cauling","caulking","cauls","cavaing","cave","caverns","cavilling","cavils","caving","cavying","cawing","caying","ceases","cecalling","cede","cedied","ceiling","cell","celling","celloing","cellos","cells","cellsing","cent","cercises","cere","cering","cerise","cerises","ceroing","cerring","certain","certaining","certains","certifies","certify","cervina","cervus","cfling","cgsing","chadded","chafed","chaffed","chafinged","chagaed","chagas","chagga","chaggaed","chaggas","chained","chainsed","chainses","chaired","chaise","chaised","chaises","chaited","chaits","chajaed","chalked","chalking","challis","champed","chanal","chanals","chanar","chanars","chance","chanced","chancels","chances","chancied","chancies","chancre","chancred","chancres","chancy","changers","channels","chanted","chanters","chanteys","chantied","chanties","chanty","chaosed","chaoses","chappe","chapped","chappes","charded","chards","charge","charged","chargers","charges","charied","charmed","charms","charred","charrs","charted","charts","chased","chasmed","chasms","chassed","chaste","chasted","chastes","chatted","chaunaed","chaused","chauses","chawed","cheaps","cheats","checkeds","checkers","checksum","checkups","cheek","cheeks","cheeps","chelas","chenned","cheops","cherts","chesting","chewas","chianed","chick","chicks","chigger","chiggers","chiling","chilling","chills","chinaed","chined","chines","chinked","chinks","chinned","chinoed","chirks","chits","chives","choanaed","chock","chocked","chocks","choked","choker","chokers","choler","cholers","chonned","choosed","chords","chores","chough","chuaned","chuck","chucks","chugged","chunga","chungaed","chungas","chunked","chunks","chyling","cialis","cicers","ciders","circed","circes","cive","cives","civies","cladded","claded","clades","clading","clads","claims","clamps","clams","clamses","clanged","clangers","clanks","clans","claps","clarks","claros","clash","clashes","clasp","clasps","classed","classic","classy","clast","clasts","clausa","clausas","clause","clauses","claver","clavers","clavus","clawing","claws","claying","clays","clean","cleans","cleanse","clerks","clever","clevers","cliing","climes","clinged","cloaks","clocks","closer","closers","closes","cloved","cloven","clovens","clover","clovers","clucks","cluing","clving","clxing","cnsing","coached","coaches","coaching","coaling","coasts","coaxer","coaxers","cobber","cobbers","cobble","cobbles","cocain","cocaining","cocains","cocked","cocker","cockers","cockle","cockles","coda","codaed","codded","coddles","coded","coders","codes","codex","codgers","codified","codifies","codling","cods","coed","coeurs","coffer","coffers","coggle","coggles","coheres","coiling","coiner","coiners","coired","coke","colaing","cold","colded","colding","colds","cole","coleus","coliing","coling","colling","collins","collying","colors","coltan","coltanning","coltans","colter","colters","colting","comalling","combats","comber","combers","come","comer","comers","comfies","comfit","comfits","comics","comints","comity","commas","comments","commes","commie","commied","commies","comming","commit","commix","commixes","commons","commute","commutes","compel","compels","compile","compiles","complies","comply","comport","comporting","comports","conched","conches","conching","concluded","cone","coneys","confer","confers","confining","confits","conged","conger","congers","conges","conjoin","conjoining","conjoins","conked","conker","conkers","constrain","constraining","constrains","contact","contacting","contacts","contadinoing","contadinos","contagion","contagioning","contagions","containeds","containers","contemn","contemning","contemns","continuing","contrail","contrailing","contrails","contriting","contriving","converse","converso","converts","convex","convey","conveys","convoke","convokes","cooked","cookeds","cookers","cookied","cooled","cooler","coolers","cooling","cooned","cooped","cooper","coopers","cooted","cooter","cooters","copalling","cope","copeck","copecks","copier","copiers","copies","copper","coppers","copses","copula","copulas","coralling","corded","core","coreference","coreferences","corer","corers","corked","corker","corkers","corner","corners","corpse","corpses","corvee","corvees","cosecs","cosher","coshers","cosmics","cosmids","cosses","costing","cotanning","cotans","cote","cotter","cotters","couch","couched","couches","couching","coude","couded","coue","coughed","coughing","coupe","coupes","coupleds","couplers","couplets","coupon","coupons","course","courses","couthed","couthing","coved","coven","covens","covereds","coverts","covet","covets","covey","coveys","cower","cowers","cowling","cowpie","cowpies","cozens","cpsing","crab","crabs","cracks","cradling","cragged","crakes","craned","cranes","cranked","cranned","crass","crasses","crawling","crawls","creaked","creaks","credited","creeks","cresting","crests","criers","cringe","cringed","cringes","crocks","crooked","crouch","crouched","crouches","crouching","croupe","croupes","crumple","crumples","cruses","crusing","cses","csing","ctened","ctenes","cubing","cuking","culling","culming","culting","cupalling","cupels","cupsing","cupule","cupules","cure","curing","curling","curses","cursing","curtain","curtaining","curtains","curves","curving","cusking","cusping","cussing","cuting","cutlass","cutses","cutsing","cxling","cxlving","cyanned","cyanoed","cycling","cyders","cymling","cysting","dadded","dahling","dailing","daises","daling","dall","dalliing","dalling","dallis","dalls","dallying","daloing","danced","dander","dandied","dandled","danked","dansed","danses","darded","darling","dart","dashes","dassed","dassies","dative","datives","dayses","ddsing","deafened","deafening","deafing","deaing","dealting","dean","deaned","deaning","deans","dearie","dearies","debate","debates","debating","debiled","debiling","deboned","debrises","debted","decade","decades","decalling","decease","deceases","deceive","deceives","decents","decided","deciding","deciled","deciling","declaim","declaims","declareds","declarers","declaw","declined","declining","decocting","decodes","decoding","decoing","decoke","decokes","decoking","decouple","decouples","decoying","decries","deepens","deface","defaced","defaces","defacing","defame","defamed","defames","defaming","defang","defanged","defanging","defangs","defence","defenced","defences","defencing","defended","defending","defends","defensed","defenses","defensing","deference","deferences","deferenses","defiance","defianced","defiances","defiancing","defiant","defianted","defianting","defiants","defied","defies","defile","defiled","defilers","defiles","defiling","defininged","definings","definited","definites","definiting","deflate","deflates","deftness","defuse","defused","defuses","defusing","deglaze","deglazes","deicing","deified","deifying","deigned","deigning","deisted","deists","deitied","delete","deletes","deleting","delfing","delfting","deliing","delivers","delling","delving","demands","demised","demising","demode","demodes","demoding","demoing","demote","demotes","demoting","dengue","dengues","denguing","denied","denned","denotives","denotiving","densaing","denses","densing","dent","dentate","dentates","dentating","dente","denteds","dentes","dentin","dentined","dentines","denting","dentining","dentins","denude","denudes","denuding","denying","depart","depend","depended","deplane","deplanes","deplore","deplores","deponed","deposing","depotting","deprave","depraves","deprive","depriveds","deprives","depute","deputes","deputing","derating","derbies","deride","derides","deriding","derisive","derisives","deriveds","dermises","derpies","derping","derring","derrises","derving","descends","deserve","deserves","deserving","designed","designing","desired","desiring","desking","desponds","dessing","destined","destines","destining","destiny","detained","detaining","detents","detest","detesting","detests","detinue","detinued","detinues","detinuing","detoxes","detoxing","deuses","deusing","deveined","deveining","deviced","devicing","deviled","devised","devising","devote","devoteds","devotees","devotes","devoting","devouting","dewied","dewiness","dewing","dexoned","dhalling","dholed","dholes","dick","dicks","dieted","digger","diggers","dilling","dining","dinted","dinting","dire","direct","directed","director","directory","directs","dired","dires","dirged","dirges","dirked","disport","disporting","disports","disses","ditaed","ditted","dive","dives","divest","divine","divined","divines","divining","dmuses","docked","doleds","dolling","domine","domined","domines","domining","donate","donates","donating","doobed","doomed","doored","dopeds","dories","dorked","dosing","dosses","doting","double","doubles","douched","douches","douching","doughed","doughing","douses","dousing","dove","doves","dowers","dozers","drab","drabas","drabs","dragger","draggers","drained","draining","drakes","dranged","drecks","drilies","drive","drivels","drivens","drivers","drives","drover","drovers","drunks","druses","drusing","drylies","dses","dsing","dsling","dtsing","ducing","duding","dudses","dudsing","duking","dulies","dull","dulling","dulls","dulses","dulsing","duning","duns","duoing","duping","duples","during","dusking","eagling","earling","earses","easies","easing","easted","easting","eating","eatses","ebitted","ebooked","ebsing","ebving","echted","eclats","ecting","eddaed","eddied","eddoed","edgied","edibled","edicted","editeds","editor","editted","edsing","edtaed","educed","eduled","eelses","eerilies","eerily","eerying","effort","efforting","efforts","efting","egesting","egests","eidoses","eiraed","elan","eland","elanded","elanned","elans","elanus","elated","elegans","elided","elinted","elited","elling","elocute","elocutes","elopses","elsing","eluted","elvers","emending","emiled","emitted","emoted","emoting","emsing","enated","enates","enating","encode","endived","ends","energise","energises","enquire","enquires","ensile","ensure","entendring","ententing","epopses","eposes","equally","equine","equines","eraing","erectly","erging","erning","eroses","erring","ersted","ersting","erudited","erying","escort","escorting","escorts","eses","esing","esports","esportsing","espouse","espouses","esquire","esquires","esting","ests","eternise","eternises","ethoses","evicted","evoked","evokes","exceed","exceeding","exceeds","exchange","exchanged","exchanges","excite","excited","excites","excluded","execrate","execrates","executeds","executive","executives","executors","exegete","exegetes","exercisers","exerciseses","exerting","exerts","exhort","exhorting","exhorts","exiled","existed","exitted","exodes","exorcise","exorcisers","exorcises","exorcism","exorcisms","exorcist","exorcists","exorcize","exorcizes","expand","expanding","expands","expanse","expanses","expats","expatting","expect","expecting","expects","expend","expending","expendings","expends","expense","expenses","expensing","expert","experting","expertise","expertises","experts","expiating","expiring","expiry","expirying","explicit","explicits","explode","explodes","exploit","exploiting","exploits","exploring","expoing","exporters","exportinged","exportings","expos","exposeds","exposing","exposure","exposures","express","exsert","exserting","exserts","extant","extanting","extants","extendeds","extent","extented","extenting","extents","extern","externa","externaing","externas","externed","externing","externus","extort","extorting","extorts","extruding","fabling","fadded","failing","failling","faire","faires","fairies","faited","fake","fakers","fakes","fall","falling","fallings","falls","fallsing","falses","falsing","fanned","farces","fare","fares","fart","fasces","fassed","fasting","fawkes","fcsing","feasting","feasts","feating","fecalling","feeting","feined","feining","feisting","feists","felids","feline","felined","felining","felises","fellies","felling","felting","fend","fended","fends","feres","ferined","fering","ferining","ferning","ferring","fesses","fessing","feting","fetting","fevers","fibers","fibre","fibres","fice","fices","fide","fides","fiends","fierce","fierces","fieries","fieris","fife","fifes","figure","figures","file","filers","files","filets","filles","filling","filses","find","finded","fine","finers","fines","fining","fiords","fireds","firm","firmas","firmers","firms","firmus","firsts","firths","fishes","fisting","fitses","fixe","fixeds","fixers","fixes","fizzes","flakes","flange","flanges","flanked","flanned","flasks","flecks","flicks","fliers","flirts","focalling","fold","folds","folies","folked","fonded","fooded","fooled","footed","forces","fore","fores","forest","forges","forked","form","fortes","fosses","fountain","fountaining","fountains","foyers","fpsing","freaked","frieds","friers","fries","frigged","frog","froms","frores","fros","frsing","fsbing","fshing","full","fulling","fulls","fuming","funded","funs","furies","furzes","fuseds","fusees","fusels","fuses","fusing","fussing","fuzing","fwsing","gabling","gabs","gadded","gaeling","gaited","galaing","galing","gall","galliing","gallina","galling","gallings","gallis","galls","gallus","gand","ganded","gander","gandied","ganked","gaoling","garb","garbs","garded","garment","garnet","gaseses","gashes","gassed","gassies","gatling","gauched","gauches","gauching","gauded","gauling","gausses","gcsing","gean","geans","gelids","gellies","gelling","gelting","genies","genome","genomes","genoming","gent","germing","gerres","gestaing","gestes","gesting","getting","gilling","girded","girled","giroed","gisting","give","givens","gives","gladded","gladed","glanced","gland","glanded","glands","glandsed","glansed","glares","glass","glasses","glassy","gleams","glean","gleans","glides","glises","gofers","gold","golds","gonded","goners","gooded","goofed","gooked","gooned","gooped","goosed","gorals","gouached","gouaches","gouaching","governs","gpsing","graces","grad","grades","grads","graf","grafs","grafts","grails","grains","gram","gramas","gramps","grams","gran","granded","grands","grange","granged","granges","grans","grants","grapes","graphs","grases","grasps","grass","grasses","grassy","gratas","grates","gratis","graves","gravis","gray","grays","grazes","greats","grebes","greylies","greyly","groaks","groans","groats","grouch","grouched","grouches","grouching","groves","grub","grubs","grunts","gruses","gsaing","gsring","guesting","guests","guiing","guild","guilds","guiled","guiles","guilt","guilty","guises","guising","gull","gulling","gulls","guns","guses","gushes","gushing","gussing","gutses","gutsing","guying","gyrans","habits","hacked","hadded","hagged","haicks","haiked","hailing","haired","haje","hakeas","hakes","halals","hale","halfing","haling","hall","halling","halls","halming","haloing","halting","halve","halved","halves","halving","hame","hand","handed","handeds","handel","hander","handied","handled","handsed","hanged","hangers","harded","harems","hares","harked","harold","harolds","hart","harvey","hashes","hassles","hastes","hasting","hate","hats","hauling","haved","haven","havens","haves","hawked","hawses","haze","heating","heave","heaved","heaven","heaver","heaving","hectare","hectares","hefting","heired","heisting","held","helds","helixes","helling","helving","herbes","herbing","herding","here","hering","herming","heroing","herpes","herring","hets","hetting","hexine","hexined","hexines","hexining","hexose","hexoses","hhsing","hiatus","hick","hicked","hicks","hies","hilling","hilts","hind","hinded","hinged","hinges","hins","hints","hips","hire","hired","hirers","hires","hirtas","hiss","hisses","hives","hivs","hoards","hoared","hoaxed","hobbed","hoboed","hocced","hocked","hockey","hodded","hods","hoed","hogged","hoists","hokaed","holcus","holders","holdups","hole","holed","holes","holeys","holism","hollas","hollos","holm","holms","holy","homers","homied","homoed","honied","honked","honker","honkey","honkied","honored","hooches","hooching","hood","hooded","hoodeds","hoods","hooeyed","hoofed","hoofeds","hoofer","hookah","hookeds","hooker","hookeri","hookers","hookied","hookies","hooksed","hookses","hookup","hooped","hoopoed","hoopsed","hooted","hooter","hooved","hooveds","hoovers","hopers","hopied","hopped","hopple","hopples","hopsed","horded","hordes","horned","horsed","hosing","hosted","hosting","hotbed","hots","hotsed","hotted","hounds","houred","housed","houses","housing","hover","hovers","hoyaed","hrts","hses","hsing","hucked","huging","hulked","hull","hulling","hullos","hulls","hunged","hunked","huns","huoned","hushes","hushing","husked","husking","husoing","huts","hyoids","ictalling","idioted","idlies","iising","ileals","illing","images","impact","impacting","impacts","impart","imparting","impartings","imparts","impasses","impends","implore","implores","imploring","impoliting","important","importeds","importeeing","importees","importers","importinged","importings","importune","importuning","imposing","impost","imposting","imposts","improving","impure","impures","impuring","imputing","inbuilt","incise","incite","inclined","inclosed","include","includeds","includes","income","incomes","indied","indirect","indirected","indirects","indite","indited","indole","indoles","inerting","inerts","inference","inferences","infidel","influxed","info","inhabit","inhabits","inhere","inhered","inherent","inherenting","inherents","inheriteds","inheritinged","inheritings","inheritors","inheritting","inhibit","inhibits","initio","inkied","inland","inlanded","inline","inosine","inquire","inquires","insane","insert","inserting","inserts","insided","insider","insiders","insides","insist","insoles","inspire","insted","insting","intake","intakes","intending","interim","interims","intermit","intermits","inti","intied","intoed","intones","intos","intro","intron","intros","intruded","invades","invert","inverting","inverts","invites","invoice","invoices","involve","involves","iodide","ipsing","ired","ires","ironside","irsing","iruses","ises","isiing","ising","island","islanded","isling","isming","isning","isring","itsing","iuding","jailing","jakes","janned","jawses","jean","jeans","jellies","jelling","jerking","jest","jesting","jestings","jests","jetting","jigger","jiggers","jirded","jive","jives","jocked","jokers","jooked","josing","josses","joules","jove","joves","juking","julies","juning","jure","juring","juses","jussing","justes","juting","kailing","kakkes","kalaing","kaliing","kaling","kalkas","karens","karling","kelpies","kelting","kenoing","kepting","keraing","kerbing","kerite","kerited","kerites","kerning","kerring","keynote","keynotes","keynoting","khanned","kianged","kickers","kied","killing","kilned","kina","kinaed","kinda","kindas","kindle","kindly","kinds","kine","kined","king","kinged","kinked","kinks","kinned","kino","kinoed","kins","kiosks","kirk","kirked","kirks","kisses","kith","kleins","klick","klicks","knacks","knocks","knucks","koined","kooked","kookied","kuiing","kvasses","kweeked","kylies","labbed","lacced","lacied","lacked","ladded","ladder","laddied","laded","ladied","ladled","ladling","laed","lagans","lagend","lagended","lagged","lahhed","lahued","laiced","laid","laided","lairded","lake","lakes","lakhed","lallying","lamaed","lambed","lament","lammed","lamnaed","lamped","lanaied","lanated","lanced","lancer","lances","lancet","landaued","landeds","lander","landers","landler","lands","lane","lang","langed","langued","lank","lankaed","lanked","lankied","lanned","lansaed","lanseh","lanset","lapped","lapsed","lapses","lard","larded","larder","larged","laried","larked","larred","lashed","lashes","lassas","lasses","lassies","lassos","lasted","lasting","latent","latest","latesting","latests","lathed","latked","latkes","latsed","latses","latted","lauans","laud","lauded","lauder","laudes","launced","launder","lavaed","laves","lavved","lawsed","lawses","laxaed","lazied","lead","leaded","leaden","leadens","leads","leaf","leafs","leak","leaked","leaks","leal","leals","leaners","leap","leaps","learn","learns","leases","leasting","leaven","leavens","leaving","ledded","lefting","legals","legends","lemnas","lemons","lended","lender","lends","lenifies","lenify","lens","lensed","lent","lented","lentes","lentoing","leon","leones","leons","lerring","lesses","lessing","letting","levants","levees","levels","levited","levving","lewded","lianaed","lianas","liared","libels","libred","lice","lices","lick","licks","lidded","lieded","lieges","lies","life","lifers","lifes","ligand","liganded","ligans","ligers","lignes","like","likeds","likens","likes","limans","lime","limens","limes","limeys","linden","lindied","line","lineds","linens","liners","lines","linged","linied","linked","linoed","linted","liraed","lirred","lises","lisles","listes","listing","lite","liters","lites","lithes","litred","livedos","livens","livers","livias","livids","llanoed","llanos","loached","loaches","loaching","loaded","loan","loans","localling","loched","loches","loching","locked","lode","lohans","loired","lolling","loners","longed","looked","looker","looksed","loomed","looned","looped","loosed","looted","lorded","losers","losing","losses","losting","louched","louches","louching","louded","loughed","loughing","loupes","louses","lousing","louver","louvers","lover","lovers","lowans","lowers","lsding","lubing","lueses","luesing","luging","lull","lulling","lulls","lunaed","lundaed","lunged","lunned","luoing","lure","luring","lushes","lushing","luting","luxing","lynxed","mace","macers","maces","maches","mackems","mackle","mackles","madake","madakes","madded","made","mades","maes","magens","mahoes","maided","mailing","maines","maired","maizes","makers","makeups","mako","makos","male","maleos","males","maliing","maliks","maling","mall","malling","malls","malsing","malting","mameys","mandaed","manded","mane","maneds","manes","manied","manies","mankies","manned","mansed","manxed","manxes","maples","mapling","mare","mares","marges","maries","markeds","markers","markets","marling","mart","martes","masers","mases","maskeds","maskers","mass","massed","masseds","masses","masting","mate","mateds","maters","mates","mateys","mattes","mauling","maunded","maxes","maybes","maze","mazeds","mazers","mazes","mazies","mealies","mean","means","meating","mediaed","mediated","medicied","meeting","meined","meining","melees","melias","melics","melting","mend","mended","mends","menoing","mere","merelies","merely","merges","merging","mering","merited","merles","merling","merring","merses","mersing","mesaing","meshing","mesning","messes","messing","meting","metrifies","metrify","mevving","mick","micks","mike","mikes","milling","mind","minded","minified","minifies","minkes","mire","mired","mires","miried","miries","miroed","mising","misses","misting","mitred","mitres","mlsing","mocked","models","modems","modes","modest","modifieded","modifiered","modifiers","modished","modishes","modisted","modistes","modses","mogens","mohaves","mohses","moired","mojave","mojaves","mold","molds","mole","moles","molest","molles","mollified","mollifies","molling","molvas","mommies","monded","mondes","monels","moneys","monked","monses","montan","montanning","montans","montes","mooched","mooches","mooching","mooded","mooned","moored","moosed","mooses","mooted","mope","mopeds","mopes","more","morels","mores","morses","mortified","mortifies","moses","moseys","moshes","mosting","mote","motels","motes","motets","motiffed","motive","motives","moue","moues","moulds","mountain","mountaining","mountains","mousing","mouthed","mouthing","moveds","movie","movies","moxies","mpsing","mrsing","msbing","mscing","mses","msging","mshing","msing","muanged","muched","muches","muching","muling","mull","mullas","mulling","mulls","mullus","muming","musaing","musding","musers","muses","mushes","mushing","musing","musings","musking","mussing","muting","mutually","myalling","myalls","myopes","nadded","nailing","naives","nakeds","nalline","nanaed","nanced","nand","nanded","nandued","nanned","narded","nashes","nasuses","nauched","nauches","nauching","nave","neating","nemine","nemined","nemines","nemining","nerding","nerve","nerves","nerving","nervus","nervying","nesses","nessing","nest","nesting","nestings","nestling","nests","netting","nevers","neving","newlies","newting","nexted","nexting","nick","nicks","nigger","niggers","nilling","nisied","nisting","nitred","nitres","niveas","nivose","nivoses","nocked","node","noired","noires","nolling","nonuple","nonuples","nooked","nookied","nooksed","nooned","noosed","nosing","notched","notches","notching","notified","notifies","noting","nouses","nousing","nsaing","nscing","nsfing","nsuing","nswing","nuding","nuited","nuking","null","nulling","nulls","nuns","nurses","nursing","nutses","nutsing","nuxing","oakens","oasing","oasises","oasting","oatses","observe","observes","observing","obtain","obtaining","obtains","occluded","oceans","ochers","octalling","octuple","octuples","odisted","ogives","oilies","oising","olds","olefine","olefined","olefines","olefining","oleins","olive","olives","onlies","onto","onuses","opalling","opiated","oppose","opposes","opulus","opuses","oralling","orange","oranged","oranges","oses","osing","otuses","ouring","ousels","outclass","outclasses","outclassing","outdated","outing","outrigger","outriggers","ovalling","over","overs","overts","pacoses","pacs","pact","padded","padres","pads","paduses","paeans","pageant","pageses","paided","pailing","painses","paired","paks","palases","paliing","paling","palling","pallying","palming","palmses","paloing","pals","palsies","pandaed","pander","pangses","panned","pans","pansies","pant","panted","pantses","paps","para","parang","pare","parental","parented","parents","parers","pareve","pari","paries","paring","parises","parity","park","parr","parsec","parsecs","parsed","parsee","parsees","parser","parsers","parses","parted","parti","partis","partly","parts","partses","party","paruses","parvenu","parving","pasches","paso","pasoed","pasos","pasques","passages","passed","passeds","passee","passeed","passees","passel","passels","passer","passers","passims","passives","passkey","passkeys","passu","passued","passus","pasted","pasteds","pastel","pastels","paster","pasters","pastes","pasties","pasting","pastises","pasts","patases","patens","patent","patents","patient","pats","patsies","pauling","paulis","paused","pauses","pausing","pave","pavises","pawling","paws","payees","payment","pays","pbsing","peaked","pean","peans","peated","peating","pecans","pecses","peeves","peeving","pekans","pelling","pelting","pent","percent","perces","percing","pere","periing","pering","perking","perming","perring","pert","peruing","perve","perves","perving","pesoing","pessed","pessing","pest","pesting","pestis","pestling","pestoing","pestos","pests","petited","petrifies","petrify","petting","peyote","peyotes","peyoting","phaged","pharos","pholis","phsing","pick","picks","piered","pigses","pill","pilling","pills","pinses","pinto","pintos","pisces","piss","pissed","pisseds","pisser","pissers","pisses","pistes","pisting","pith","pitses","plaided","planaed","planked","planned","planted","plashes","plated","pleads","pleats","plover","plovers","pmsing","poached","poaches","poaching","pocked","poises","pokers","polers","polies","poll","polling","pollos","polls","pommies","ponded","ponses","pooched","pooches","pooching","pooded","poofed","pooled","pooned","pooped","poored","pooved","pooves","porched","porches","porching","porked","port","portent","posers","poshes","posies","posing","posits","possed","posses","possess","posset","possets","postes","posting","potent","pouch","pouched","pouches","pouching","powers","praises","pranged","prat","prated","preference","preferences","prelims","premies","preses","presses","prexies","pricks","prigged","prises","prom","proses","proves","prunes","prunos","prunus","psaing","psas","pses","psiing","psing","pucing","puking","pula","pulas","pule","pules","puling","pullers","pullets","pulleys","pulling","pulp","pulps","pulsing","puns","pupals","pupated","pupils","pure","purelies","purely","purifies","purify","puring","purl","purls","pursing","puses","pushing","puss","pussed","pusses","pussies","pussing","pyrene","qianged","quaing","quakes","quares","quells","questing","quests","quicks","quiing","quilt","quired","quited","quoing","quolls","rabies","racies","radded","raided","railing","raises","rake","rakes","raling","rallies","rallying","ramies","ranaed","rand","randed","randied","raneed","ranges","ranied","ranked","ranted","rarelies","rarely","rarifies","rarify","rashes","rasing","rassed","rave","ravers","readies","realines","realise","realises","realizes","reallies","really","realties","realty","reaving","rebuild","rebuilds","reburies","recall","recalling","recalls","recces","reccies","recipes","recited","recites","reclines","recode","recommits","recover","recovers","redefine","redefined","redefines","redefining","redlines","reedies","reefies","reeving","referee","referees","referenceds","referent","refine","refined","refiners","refines","refining","refinings","refits","regias","regimes","regius","reined","reining","reited","reiting","rejigs","relaces","relates","relaxes","relay","relics","relict","relicts","relied","relief","reliefs","relieve","relieves","relievo","relievos","relines","relining","relish","relishes","relived","relives","remake","remakes","remise","remises","remiss","remits","remote","remotes","remoting","remove","removes","rend","rended","rends","renins","renises","rent","repands","repens","repents","repine","repined","repining","replay","replied","replies","reply","repose","reposes","requiems","requireds","requite","requites","requote","requotes","reruns","reserve","reserves","reserving","resets","reshes","reshing","reside","resides","resids","resiles","resins","resizes","respire","respires","ressing","rest","resting","restings","rests","retied","reties","reting","retire","retouch","retouched","retouches","retouching","retries","retting","reusing","reverence","reverences","revers","review","reviews","reviles","revise","revises","revive","revoke","revokes","revues","revving","rewire","rewired","rhuses","rick","ricks","rigged","riggeds","rigger","riggers","rilling","rimies","rind","rinded","ringer","ringers","ringside","rising","risses","rive","rives","rivets","roached","roaches","roaching","rocked","rogers","roilies","rolling","rons","rooded","roofed","rooked","rookied","roomed","rooted","ropers","ropies","rosies","rosing","rouble","roubles","roughed","roughing","rounds","rouses","rousing","rove","rover","rovers","roves","rowers","rubens","rubies","rubing","rubins","rubs","rudelies","rudely","ruding","rues","rugger","ruggers","rugs","ruins","rulied","rulies","ruling","ruly","rumens","rums","rune","runes","rung","rungs","runics","runing","runt","runts","runups","ruses","rushes","rushing","rusing","rusking","russing","ruts","saales","saaling","saames","sabling","sabres","sadded","saided","sailing","saints","saises","sake","sakes","salals","saling","salk","salking","salks","salling","sallying","salols","salping","salting","salves","sand","sanded","sander","sandied","sandsed","sanned","sansed","sanses","sapling","sarded","sarding","sariing","sarsing","sashes","sass","sassed","sasses","sassies","sats","saurel","save","savers","saving","scalding","scalds","scaling","scalping","scalps","scalying","scapes","scarce","scarces","scare","scareds","scarers","scares","scarfs","scaries","scarps","scends","schick","schicks","scired","scoked","scolds","scorer","scorers","scores","scoter","scoters","screes","scries","scruple","scruples","scrying","sculling","seaing","sealing","seaming","seaport","seaporting","seaports","seareds","searing","seasing","seaxing","sebaes","sebaing","sebbing","sebing","sebses","sebsing","seccing","secluded","secure","sedans","sedding","sedges","sedging","seeding","seeing","seeking","seeling","seeming","seening","seeping","seering","segoing","segues","seguing","seiding","seifing","seiing","seined","seiths","seizes","seizing","selfing","selvaing","selvas","semiing","semited","senate","senates","senating","send","sended","sending","sends","sening","senning","senses","sensing","sent","sepping","sequine","sequines","serape","serapes","seraping","seraxes","seraxing","serbing","serene","serenes","serening","serers","seres","serfing","serge","sergers","serges","serging","series","serined","sering","serous","serowing","serows","serpens","serums","servals","servant","servers","services","servicing","serviles","serviling","servinged","servings","servo","servoing","servos","setaing","sets","seuling","sevens","sewing","sewning","sexing","sexpot","sexpots","sexpotting","sexted","sexying","shabus","shade","shadeds","shades","shadies","shafts","shagged","shake","shakens","shakers","shakes","shakies","shakos","shale","shales","shame","shameds","shames","shamus","shanged","shanked","shanks","shanned","shape","shapeds","shapers","shapes","shard","shards","shareds","sharers","shareses","sharias","shark","sharks","sharons","sharp","sharpens","sharpers","sharpie","sharpies","sharps","shart","sharts","shaveds","shavens","shavers","shaves","shaving","shawls","shawms","sheareds","shearers","shearses","sheers","sheiks","shelve","shelves","shelving","sherding","sherds","shines","shinto","shire","shires","shirks","shirrs","shited","shnooked","shocked","shocks","shoeds","shooed","shooked","shooted","shore","shoreas","shores","shorns","shorts","shotes","shover","shovers","shoving","shreds","shrews","shriving","shrove","shroves","shroving","shucks","sibs","sick","sicks","sics","sids","sieving","sifts","sights","silling","silts","sind","sinded","sing","sins","sips","sirced","sircing","sired","sirens","sires","siring","sirred","sirring","sirs","sising","siss","sisses","sitars","site","sites","sitkas","sittas","situ","situs","sitz","sitzes","sixths","skates","skinks","skints","skirts","skits","skiving","skulls","slander","slanted","slates","slaving","sleeve","sleeves","sleeving","slices","slicks","slides","slimes","slits","slivers","slouch","slouched","slouches","slouching","slsing","smalling","smalls","smarms","smarts","smited","smites","smiths","smoked","snare","snarers","snares","snarfs","snarls","sneaked","snicks","snigger","sniggers","snits","snooked","snores","soaked","soaving","sobers","socked","solare","solares","sold","solds","solids","solling","solver","solvers","solving","sooned","sooted","sorbing","sore","sorelies","sorely","soring","sorting","sots","souchong","soughed","soughing","souked","soupies","source","soured","souses","sousing","southed","southing","sowers","spaces","spades","spalling","spanged","spare","sparers","spares","sparge","sparges","sparks","spasms","spated","spates","spazes","speaked","specks","spells","sperming","sphere","spheres","spicks","spills","spinto","spired","spirts","spited","spites","spits","splits","spoked","spooked","spores","sprees","spries","sprigger","spriggers","spring","sprits","sprues","spruing","sprying","spurge","squally","squares","squires","sriing","ssaing","sses","ssing","ssping","ssriing","sssing","sswing","stacks","stages","stalk","stalks","stalling","standed","stands","stanks","stapes","stare","starers","stares","starets","starses","starts","starving","states","staving","steads","steaked","steeds","stenting","sterling","sterning","stetting","sticks","stilts","stints","stoked","stores","stover","stovers","stoving","streaked","string","stringer","stringers","striving","suaving","subclassed","suched","suches","suching","sucre","sucred","sudated","sudses","sudsing","suer","suered","suering","sues","suiing","suing","suited","suites","suits","sullas","summits","sundated","sunglass","sunglasses","sunglassing","suns","superclassed","supergrass","supergrasses","sura","suraed","suraing","surd","surded","surding","sured","surelies","sures","surety","surf","surfed","surfer","surfing","surge","surged","surging","surrey","surveys","suses","sussing","suture","suvving","svring","swages","swales","swards","swarms","swarts","sweared","sweated","swerve","swerves","swerving","swervings","swifts","swined","swiped","swirled","switch","taaling","tables","tabling","tabses","tached","taches","taching","tack","tacks","tacting","tadded","taeling","tagger","taggers","tailing","tajiks","take","takens","takers","takes","tala","talaing","talas","talc","talcing","talcs","tale","talent","tales","taling","talkers","talkies","talking","talksed","talkses","talling","tallying","talons","talus","tandem","tank","tankas","tanked","tanks","tanned","taoses","tapses","tart","tarting","task","tasking","tasks","tassed","tassel","tassels","tasses","tasset","tassets","tassing","tasting","tastings","tastying","tatting","tauting","tawses","tdting","teached","teaches","teaching","teaing","teaked","teaking","tealed","tealing","teamed","teaming","teared","tearing","teased","teases","teasing","teasling","teat","teated","teating","teats","tebets","teccing","teched","teches","tectaing","tectas","tedding","teds","teed","teeing","teeming","teened","teening","teething","teeths","teffing","tegging","teiids","tejuing","tellies","temming","temping","tempting","tempts","tenched","tenches","tenching","tendeds","tenders","tendons","tenens","tenged","tenges","tenging","tenias","tenned","tenning","tennis","tennos","tenons","tenors","tensed","tenseds","tensing","tented","tenthing","tenting","tentings","tenuis","tepids","terces","tereting","terned","terrifies","terrify","teslaing","teslas","testaing","testas","testating","testeds","testeeing","testees","testers","testes","testied","testify","testily","testinged","testings","testis","testying","tether","tething","tetting","tevets","texans","text","texted","textes","texting","textings","texts","thaned","thanked","thanks","thanned","thecas","thefting","thefts","theist","theisting","theists","theres","thesis","thinged","tholed","tholes","thonged","thorough","thoroughs","thought","thrive","thrives","throng","throngs","throughed","throughs","thrush","thuses","ticalling","tick","ticks","tiered","tigers","tilling","tilting","tineds","tinting","tire","tired","tires","tiroed","titred","titres","titting","tnting","toasting","toasts","toeaed","toeses","toesing","togethers","told","tolds","tolling","tommies","tomtits","toneds","toners","tontining","tooled","tooned","tooted","toothed","toothing","tooting","topers","toposes","topple","topples","torch","torched","torches","torching","torting","toshed","toshes","tosked","tosking","tosses","tossing","toters","toting","totting","toucan","toucans","touchers","touchied","touchies","touchinged","touchingly","touchings","touchline","touchy","touchying","tough","toughed","toughens","toughied","toughies","toughing","toughying","touped","toupee","toupeed","touping","toured","touring","tousle","tousled","tousling","touted","towers","tracks","transitive","transitived","transitives","transitivity","treaded","treads","treated","treating","treats","treeds","trekked","trend","trends","trenting","tressing","trestling","triage","triaged","tricker","trickers","tricks","triers","trifler","triflers","trigged","trimer","trimers","trimmer","trimmers","tripper","trippers","trited","triting","troched","troches","troching","trough","troughed","troughing","troughs","troves","truced","truces","trucing","trucked","trucking","trudger","trudgers","trulies","trunks","trusting","trusts","truthed","truthing","trysting","trysts","tsetse","tsetsing","tubing","tucked","tucking","tufting","tugger","tuggers","tuling","tulles","tulling","tumses","tumsing","tuning","tuns","turing","tushed","tutting","tuxing","twanged","tweaks","tweeded","tweeds","tweeped","tweeted","tweeting","tweets","tweezed","twelved","twenty","twerked","twerped","twiced","twigged","twined","twirled","twirped","twisting","twists","twitch","ufoing","uglies","uhfing","uing","ukases","ukasing","ukes","uking","ulls","ulting","umaing","umping","unchanged","unclouded","uncouple","uncouples","uncover","uncovers","undated","undateds","undefined","unding","unedited","unhooked","uniated","uning","united","unkind","unlive","unlives","unmake","unmakes","unmated","unmodified","unqing","unsated","unsees","unsung","unsure","untouched","unusually","unwired","unyoke","unyokes","upbeated","upcasted","update","updates","updrafted","uphold","upholds","uping","upland","uplanded","upsets","upside","uptaked","upvoted","urated","urging","urling","urning","urns","ursine","uruses","usages","usaging","usaing","usas","usbegs","usbeks","uscbing","usdaed","usdaing","used","useds","user","userring","users","ushers","usinged","usings","usmcing","usneas","usning","usns","usps","uspses","uspsing","usss","usssing","usualed","usuals","usurer","utaing","utcing","utes","uting","utning","uubing","uuhing","uuping","uuqing","uuting","uving","uziing","valiing","valing","valling","valses","valsing","valuing","valving","vandaed","vanned","varment","vasing","vassed","vasting","vedisted","vegans","veined","veines","veining","vend","vended","vends","venose","venoses","venosing","vent","veraing","verbified","verbifies","verbify","verbing","verdes","verding","verges","verging","veridis","veridises","veried","verified","verifieds","verifier","verifiers","verited","veritied","verities","verity","verses","versified","versifier","versifiers","versifies","versify","versing","versting","versts","vertes","verve","verves","vervets","verving","verying","vest","vesting","vests","vetting","vianded","vilifies","vilify","vinifies","vinify","virens","vireos","vising","visits","visually","vitrifies","vitrify","vive","vives","vivifies","vivify","vivred","vocalling","vomers","vomits","voters","vouch","vouched","voucheed","vouchees","vouchers","vouches","vouching","vowers","wadded","wadses","waifed","wailed","wailing","wained","waived","waives","wake","wakens","wakers","wakes","waling","walk","walking","walks","wall","walling","wallings","walls","wallying","wand","wanded","wander","wanked","wanned","want","wanted","ware","wared","waried","warmed","warned","warped","warred","warsed","warses","wart","warted","washes","wassed","wastes","wasting","watses","wauling","wave","wavers","wawling","wayses","wbsing","weaked","weaken","wealed","wean","weaned","weans","wearer","weaved","weaves","weaving","weeked","weft","wefting","weirded","weired","wekaed","welling","welt","welting","wended","wends","wens","weres","wering","westing","wests","wetting","whacks","whales","whanged","wharfs","whelks","whiled","whined","whirled","whirred","whists","whites","whits","wholed","wholes","whooped","whored","whores","wick","wicked","wicks","wided","width","widths","wifed","wified","wigged","wilded","wiled","wilied","wilies","willed","willing","wilted","wimped","winced","wind","wined","winged","winied","winked","winned","winoed","wiped","wipeds","wireds","wirer","wiried","wised","wisent","wish","wished","wising","wisped","witch","withal","withe","wither","withes","within","withs","withy","witsed","witted","wive","wived","wives","wizzed","wlanned","wokked","wold","wolds","wonked","wont","wooded","wooers","woofed","wooled","worded","worlds","wormed","worned","worsed","worted","woulds","wove","woves","wraith","wrasses","wreaked","wrecks","wresting","wrests","wricks","wried","wriggler","wrigglers","wringer","wringers","writhe","wswing","wussing","wyrded","xerotes","xmases","yanaed","yanked","yarded","yawling","yawses","yearns","yeasting","yeasts","yelling","yerring","yessing","yetting","yolked","yorked","youthed","youthing","yuling","yuses","yussing","zaired","zaires","zanied","zend","zended","zends","zeroing","zest","zesting","zests","zestying","zeuses","zeusing","zhuanged","zilling","zonked","zoomed","zooted"]}});function Os(e,t,n){if(e===t)return 0;if(Math.abs(e.length-t.length)>n)return n+1;let s=null,o=Array.from({length:t.length+1},(r,i)=>i);for(let r=1;r<=e.length;r+=1){let i=[r],a=r;for(let c=1;c<=t.length;c+=1){let l=e[r-1]===t[c-1]?0:1,u=Math.min(o[c]+1,i[c-1]+1,o[c-1]+l);r>1&&c>1&&e[r-1]===t[c-2]&&e[r-2]===t[c-1]&&(u=Math.min(u,s[c-2]+l)),i[c]=u,u<a&&(a=u)}if(a>n)return n+1;s=o,o=i}return o[t.length]}function Pd(e){return/^[a-z]+$/.test(e)&&!ft.has(e)&&!Ld.has(e)}function hw(e){return vA(e)?null:mc(e,mw,Ns(e))}function mc(e,t,n=Ns(e)){let s=n+1,o=null,r=!1;for(let i of t){let a=Os(e,i,Math.min(s,n));a<s?(s=a,o=i,r=!1):a===s&&a<=n&&i!==o&&(r=!0)}return s<=n&&!r?o:null}var yA,Ns,Ld,pw,mw,$A,vA,Pr=M(()=>{ns();dw();In();yA=["used"];Ns=e=>e.length<=5?1:2,Ld=new Set([...Object.keys(me),...Object.keys(nt),...Object.keys(yn),...yA].flatMap(e=>e.split(" "))),pw=4,mw=[...new Set([...Object.keys(me),...Object.keys(yn)].flatMap(e=>e.split(" ")).filter(e=>e.length>=pw))],$A=new Set(fw.words),vA=e=>$A.has(e)});function Mr(e){for(let t of jA){let n=e.match(t.re);if(n){let s=t.build(n);if(s)return s}}return null}var hc,SA,EA,xA,Md,jA,gw,gc=M(()=>{ns();In();hc=Object.keys(me).sort((e,t)=>t.length-e.length).map(it).join("|"),SA=Object.keys(nt).sort((e,t)=>t.length-e.length).map(it).join("|"),EA=Object.keys(yn).sort((e,t)=>t.length-e.length).map(it).join("|"),xA=Lo.slice().sort((e,t)=>t.length-e.length).map(it).join("|"),Md=(e,t)=>e==="defines"&&$i.has(t),jA=[{name:"ask",re:new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+(${hc})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Md(n,t)?null:Zs({shape:"ask",entityType:null,modifier:"direct",kind:n,subject:e[1].trim(),object:e[3].trim()},t)}},{name:"reverse",re:new RegExp(`^which\\s+(${SA})\\s+(?:(${EA})\\s+)?(${hc})\\s+(.+?)\\??$`,"i"),build:e=>{let t=e[3].toLowerCase(),n=me[t];return Md(n,t)?null:Zs({shape:"reverse",entityType:nt[e[1].toLowerCase()],modifier:e[2]?yn[e[2].toLowerCase()]:"direct",kind:n,object:e[4].trim()},t)}},{name:"forward",re:new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+(${hc})\\??$`,"i"),build:e=>{let t=e[2].toLowerCase(),n=me[t];return Md(n,t)?null:Zs({shape:"forward",entityType:null,modifier:"direct",kind:n,object:e[1].trim()},t)}},{name:"meta-mean",re:new RegExp(`^what\\s+(?:does|do|is|are)\\s+(.+?)\\s+(?:${xA})\\??$`,"i"),build:e=>({shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:e[1].trim()})},{name:"meta-whatis",re:new RegExp("^what\\s+(?:is|are)\\s+(?:(an?|the)\\s+)?(.+?)\\??$","i"),build:e=>{let t=e[1]?e[1].toLowerCase():null,n=wn(e[2].trim()),s=!/\s/.test(n);if(t==="the"&&!s||!t&&!nt[n.toLowerCase()])return null;let o=n.toLowerCase();return t&&t!=="the"&&xg.some(r=>o===r||o.startsWith(`${r} `))?null:{shape:"meta",entityType:null,modifier:"direct",kind:"meta",object:eo(n)}}},{name:"mention",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)\\s+(?:${Gn.map(it).join("|")})\\??$`,"i"),build:e=>({shape:"mentions",entityType:null,modifier:"direct",kind:"mentions",object:e[1].trim()})},{name:"where",re:new RegExp(`^where\\s+(?:is|are|was|were)\\s+(.+?)(?:\\s+(?:${bn.map(it).join("|")}))?\\??$`,"i"),build:e=>({shape:"where",entityType:null,modifier:"direct",kind:"where",object:e[1].trim()})},{name:"when",re:new RegExp(`^when\\s+(?:did|does|do|was|were|is)\\s+(.+?)\\s+(?:last\\s+)?(${hc})\\??$`,"i"),build:e=>me[e[2].toLowerCase()]==="touches"?{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()}:null},{name:"commit-history",re:/^(?:the\s+)?commit\s+history\s+(?:of|for)\s+(.+?)\??$/i,build:e=>({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:e[1].trim()})},{name:"cochange-partners",re:/^co-?change\s+partners\s+(?:of|for|with)\s+(.+?)\??$/i,build:e=>({shape:"reverse",entityType:"Module",modifier:"direct",kind:"cochange",object:e[1].trim()})}];gw={id:"grammar",class:"graph-query",run(e){let t=Mr(e);return t?{strategyId:"grammar",class:"graph-query",candidates:[{parsed:t,confidence:.9}]}:null}}});function bw(e){let t=e.trim().split(/\s+/);return t.length>1&&qa.has(t[0].toLowerCase())}function TA(e){return me[e.trim().toLowerCase()]==="calls"}function Pt(e,t,n=null){let s=Object.keys(t).sort((o,r)=>r.split(" ").length-o.split(" ").length);for(let o of s){let r=o.split(" ");for(let i=0;i<=e.length-r.length;i+=1)if(!(n&&r.some((a,c)=>n.has(i+c)))&&r.every((a,c)=>e[i+c]===a))return{kind:t[o],start:i,end:i+r.length}}return null}function Ni(e,t=null){let n=e.replace(/\?+\s*$/,"").replace(/,/g," ").split(/\s+/).filter(Boolean),s=n.map(x=>x.toLowerCase());if(s.includes("where")&&!Pt(s,me)){let x=s.some(T=>Gn.includes(T)),_=new Set([...bn,...Gn]),$=n.filter((T,C)=>!ft.has(s[C])&&!_.has(s[C])).join(" ").trim();if($){let T=x?"mentions":"where";return{shape:T,entityType:null,modifier:"direct",kind:T,object:$}}}if(new Set(["has","have","had"]).has(s[0])){let x=s.length;for(;x>1&&(s[x-1]==="ever"||s[x-1]==="been");)x-=1;if((x>1?me[s[x-1]]:null)==="touches"){let $=n.slice(1,x-1).filter((T,C)=>!ft.has(s[1+C])).join(" ").trim();if($)return{shape:"when",entityType:null,modifier:"direct",kind:"touches",object:$}}}let r=s,i=Pt(s,me);if(!i&&t){let x=s.map(_=>{if(!Pd(_))return _;let $=t.lemma(_);return Ld.has($)?$:_});i=Pt(x,me),i&&(r=x)}let a=null;if(!i){let x=s.map(_=>_.length>=4&&Pd(_)&&hw(_)||_);if(i=Pt(x,me),i){r=x;let _=s.slice(i.start,i.end).findIndex((T,C)=>T!==x[i.start+C]),$=i.start+Math.max(_,0);a={from:s[$],to:x[$]}}}let c=!1;if(!i)for(let x=0;x<s.length;x+=1){let _=to[s[x]];if(!(_&&s[x]==="used"&&s[x+1]==="for")&&_&&s.slice(0,x).some($=>Oi.has($))){i={kind:_,start:x,end:x+1},c=!0;break}}if(!i)return null;!c&&i.end-i.start===1&&to[s[i.start]]&&s.slice(0,i.start).some(x=>Oi.has(x))&&(c=!0);let l=x=>a?{...x,fuzzyVerb:a}:x;if(t&&i.end-i.start===1){let x=i.start,_=s[x-1];if((_==="the"||_==="these"||_==="those")&&s[x+1]==="of"&&t.posTags(n)[x]==="NOUN"){let T=n.slice(x+2).filter((C,E)=>!ft.has(s[x+2+E])).join(" ").trim();if(T)return l({shape:"forward",entityType:null,modifier:"direct",kind:i.kind,object:T})}}let u=new Set,d=x=>{if(x)for(let _=x.start;_<x.end;_+=1)u.add(_)};d(i);for(let[x,_]of Object.entries(me)){if(_!==i.kind)continue;let $=x.split(" "),T=i.end;if($.every((C,E)=>r[T+E]===C)){d({start:T,end:T+$.length});break}}let p=Pt(r,nt,u);d(p);let f=Pt(r,yn,u);d(f);let m=(x,_)=>n.slice(x,_).filter(($,T)=>!u.has(x+T)&&!ft.has(s[x+T])).join(" ").trim(),h=m(0,i.start),b=m(i.end,n.length);c&&!s.includes("by")&&_A.has(b.toLowerCase())&&(b="");let g=i.kind,w=p?nt[r.slice(p.start,p.end).join(" ")]:null,y=f?yn[r.slice(f.start,f.end).join(" ")]:"direct",v=r.slice(i.start,i.end).join(" ");if(g==="touches"&&s.includes("when")){let x=h||b;if(x)return l({shape:"when",entityType:null,modifier:"direct",kind:"touches",object:x})}if(g==="touches"&&s.includes("who")&&s.includes("last")){let x=h||b;if(x)return l({shape:"whoLast",entityType:null,modifier:"direct",kind:"touches",object:x})}let R=s.indexOf("by"),S=s.slice(0,i.start).findIndex(x=>Oi.has(x)),j=S>=0,I=j&&S>R;if(R>=0&&!u.has(R)&&j){let x=(T,C)=>n.slice(T,C).filter((E,k)=>{let P=T+k,D=s[P];return!u.has(P)&&!ft.has(D)&&D!=="by"&&!Oi.has(D)&&!kA.has(D)&&!RA.has(D)}).join(" ").trim(),[_,$]=I?[x(S+1,n.length),x(R+1,S)]:[x(0,R),x(R+1,n.length)];if(_&&$)return g==="defines"&&$i.has(r.slice(i.start,i.end).join(" "))?null:l({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:$,object:_});if($)return l({shape:"forward",entityType:w,modifier:y,kind:g,object:$});if(_)return l({shape:"reverse",entityType:w,modifier:y,kind:g,object:_})}if(c&&R<0&&b&&s[i.start]==="called")return null;if(h&&b){if(g==="defines"&&$i.has(v)||g==="calls"&&(bw(b)||TA(h)))return null;let x=c&&R<0?Ya[`${s[i.start]} ${s[i.end]}`]:null;return x&&x.role==="agent"&&x.kind===g?l({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:b,object:h}):l(Zs({shape:"ask",entityType:null,modifier:"direct",kind:g,subject:h,object:b},v))}if(b){if(g==="calls"&&bw(b))return null;let x=p&&p.start>=i.end?null:w;return l(Zs({shape:"reverse",entityType:x,modifier:y,kind:g,object:b},v))}if(g==="inherits"&&!h&&p&&p.start===i.end){let x=r.slice(p.start,p.end).join(" ");if(x)return l({shape:"reverse",entityType:null,modifier:y,kind:g,object:x})}if(h&&!b&&j&&i.end-i.start===1&&to[s[i.start]]){if(h.split(/\s+/).length>1)return null;if(g==="touches")return l({shape:"when",entityType:null,modifier:"direct",kind:g,object:h});let x=Oi.has(s[0]);return l({shape:"reverse",entityType:w,modifier:y,kind:g,object:h,...x?{polar:!0}:{}})}return h?l(Zs({shape:"forward",entityType:w,modifier:"direct",kind:g,object:h},v)):null}var Oi,kA,RA,_A,ww,bc=M(()=>{ns();In();Pr();Oi=new Set(["is","are","was","were","be","been","being","get","gets","got"]),kA=new Set(["which","what","who","whom","whose"]),RA=new Set(ks.map(e=>e.toLowerCase())),_A=new Set(["recently","lately","yet","already","ever","again"]);ww={id:"keyword-spot",class:"graph-query",run(e,t={}){let n=Ni(e,t.nlp||null);return n?{strategyId:"keyword-spot",class:"graph-query",candidates:[{parsed:n,confidence:.7}]}:null}}});function CA(e,t,n){if(!n||typeof n.posTags!="function"||!t.length)return[];let s=new Set(t.map(i=>i.toLowerCase())),o;try{o=n.posTags(e)}catch{return[]}let r=[];for(let i=0;i<e.length;i+=1){let a=e[i],c=a.toLowerCase();!/^[a-z]+$/.test(a)||yw.has(c)||!s.has(c)||o[i]==="VERB"&&r.push(c)}return r}function IA(e,t=null){let n=ln(e),s=[],o=[];for(let i of n){let a=i.toLowerCase();/^[a-z]+$/.test(i)&&!yw.has(a)&&(AA.has(a)||t&&typeof t.isStopWord=="function"&&t.isStopWord(a))?o.push(i):s.push(i)}let r=CA(n,s,t);return{text:s.join(" "),dropped:o,maybeNoise:r}}var yw,AA,$w,vw=M(()=>{ns();In();gc();bc();yw=new Set([...ft,...be(No),...be(Object.keys(me)),...be(Object.keys(nt)),...be(Object.keys(yn)),...be(Object.keys(Ge)),...be(Po),...be(Mo),...be(Object.keys(es)),...be(Object.keys(ts)),...be(Object.keys(no)),...be(ks),...be(Si),...be(Lo),...be(bn),...be(Gn),...be(_n),...be(Object.keys(_r))]),AA=new Set([...be(vi),...be(Xa)]);$w={id:"noise-strip",class:"noise-stripped",run(e,t={}){if(Mr(e))return null;let{text:n,dropped:s,maybeNoise:o}=IA(e,t.nlp||null);if(!s.length||!n)return null;let r=Mr(n)||Ni(n,t.nlp||null);if(!r)return null;if(o.length&&(r.shape==="where"||r.shape==="mentions")&&r.object){let i=r.object.split(/\s+/).filter(a=>!o.includes(a.toLowerCase())).join(" ").trim();i&&i!==r.object&&(r.altObject=i)}return{strategyId:"noise-strip",class:"noise-stripped",candidates:[{parsed:r,confidence:.75,note:`noise-stripped to "${n}"`}]}}}});var Sw=M(()=>{});var wc,yc=M(()=>{wc=()=>{}});function xw(e,t){return e.shape!==t.shape||e.kind!==t.kind?!1:e.shape==="ask"?Fr(e.subject)===Fr(t.subject)&&Fr(e.object)===Fr(t.object):Fr(e.object)===Fr(t.object)}function Fd(e){let t=(e||[]).filter(l=>l&&Array.isArray(l.candidates)&&l.candidates.length);if(!t.length)return null;let n=[];for(let l of t)for(let u of l.candidates)!u||!u.parsed||n.push({parsed:u.parsed,confidence:typeof u.confidence=="number"?u.confidence:.5,note:u.note||null,via:u.via||null,strategyId:l.strategyId,class:l.class});if(n.some(l=>!jw(l))&&(n=n.filter(l=>!jw(l))),!n.length)return null;let s=new Map;for(let l of n)s.has(l.class)||s.set(l.class,[]),s.get(l.class).push(l);let o=[];for(let[l,u]of s){let d=[];for(let p of u){let f=d.find(m=>xw(m.parsed,p.parsed)&&m.via===p.via);if(f){f.agreed+=1,f.confidence=Math.max(f.confidence,p.confidence),Ew(p.parsed)<Ew(f.parsed)&&(f.parsed=p.parsed);continue}d.push({...p,agreed:1})}d.length&&o.push({class:l,candidates:d})}if(!o.length)return null;let r=l=>Math.max(...l.candidates.map(u=>u.confidence)),i=o[0];for(let l of o)r(l)>r(i)&&(i=l);let a=i.candidates.length===1?i.candidates[0].parsed:{ambiguousParse:!0,candidates:i.candidates.map(l=>l.parsed)},c=o.filter(l=>l!==i).map(l=>l.candidates[0]).filter(l=>!i.candidates.some(u=>xw(u.parsed,l.parsed)));return{class:i.class,parsed:a,winner:i.candidates[0],alternates:c}}function LA(e){if(!e)return"something else";if(e.ambiguousParse)return"one of several readings";let t=e.object??e.subject??"?";return`${e.kind} "${t}"`}function kw(e,{describe:t=LA,answerFor:n=null}={}){return(e||[]).map(s=>{let o=s.note||t(s.parsed),r=n&&n(s)||"ask it that way";return`if you mean ${o} then ${r}`})}var Fr,OA,Ew,NA,jw,Dd=M(()=>{Fr=e=>String(e||"").trim().toLowerCase().replace(/\s+/g," ").replace(/^(?:the|a|an)\s+/,"").replace(/^commit\s+(?=[0-9a-f]{7,40}$)/,""),OA=/^\s*(?:the|a|an)\s+/i,Ew=e=>[e?.subject,e?.object].filter(t=>OA.test(String(t||""))).length;NA=new Set(["fuzzy","lemma","spell"]),jw=e=>NA.has(e.via)});function $c(e){zd=e}function vc(){return typeof zd=="function"?zd():null}var zd,Dr=M(()=>{zd=null});function Tw(e,t={},n=MA){let s=[];for(let o of n)try{let r=o.run(e,t);r&&typeof r.then!="function"&&s.push(r)}catch{}return s}var PA,MA,Aw=M(()=>{In();gc();bc();vw();Sw();yc();Dd();Dr();PA=[...typeof void 0<"u"?[void 0]:[],...typeof void 0<"u"?[void 0]:[]],MA=[gw,ww,$w,...PA]});function Ls(e){return FA.test(String(e||"").trim())?"an":"a"}function Sc(e){let t=String(e||"").trim();return t&&(/(?:s|x|z|ch|sh)$/.test(t)?`${t}es`:/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:`${t}s`)}function zr(e){let t=String(e||"");return t&&t[0].toUpperCase()+t.slice(1)}function Li(e){let t=(e||[]).map(n=>String(n||"").trim()).filter(Boolean);return t.length===0?"":t.length===1?t[0]:t.length===2?`${t[0]} and ${t[1]}`:`${t.slice(0,-1).join(", ")}, and ${t[t.length-1]}`}var FA,Pi=M(()=>{FA=/^[aeiou]/i});var Mi,Bd=M(()=>{Mi=(e,t,n)=>n});var Ny={};Nt(Ny,{DYNAMIC_TAIL_OK_RE:()=>kf,applyNegationFrames:()=>Ii,ask:()=>fo,classDisplayName:()=>Ps,degreeMetric:()=>vy,metaFallbackEntityAnswer:()=>fy,normalizeQuery:()=>Bo,parseQuery:()=>Go,parseQueryFull:()=>rf,render:()=>Hn,rephraseHint:()=>$f,resolveObject:()=>En,traverse:()=>un,worldRelationGraphPayload:()=>qI});function tt(e,t){let n=Cw.get(e);n||(n=new Map,Cw.set(e,n));let s=n.get(t);if(s)return s;let o=[];for(let r of e.relations)if(Is(r)===t)for(let i of r.edges)o.push(i);return n.set(t,o),o}function de(e,t){let[n,s]=Kd[e]||["result","results"];return t===1?n:s}function Wi(e,t,n,s={}){return!e||!t.length?[]:[{kind:"set",class:e,label:`${t.length} ${de(e,t.length)}`,ids:t.map(o=>o.id),attrs:{count:t.length},lane:n,...s}]}function Ps(e){let t=String(e||"");if(typeof Vn=="function"){let n=Vn(t).join(" ");if(n)return n}return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase()}function Uo(e){return zA[e]||e}function VA(e){if(!e?.ambiguousParse||!Array.isArray(e.candidates)||e.candidates.length!==2)return e;let t=e.candidates.find(r=>r?.shape==="meta"),n=e.candidates.find(r=>r!==t);if(!t||!n)return e;let s=String(t.object||"").trim().toLowerCase();if(!s||GA.has(s))return e;let o=String(n.object||"").trim().toLowerCase();return be(Lo).includes(o)?t:e}function HA(e,t){if(!e||e.shape!=="where"||e.altObject||!KA.test(t))return e;let n=Ha(t),s=Ha(String(e.object||"")),o=s===e.object?e:{...e,object:s},r=ln(s);if(r.length<2)return o;let i=r[r.length-1].toLowerCase();if(!/^[a-z][a-z'-]*$/.test(i)||ft.has(i)||me[i]||i.endsWith("ing"))return o;let a=ln(n).map(l=>l.toLowerCase());for(;a.length&&Xw.has(a[a.length-1]);)a.pop();if(a[a.length-1]!==i)return o;let c=r.slice(0,-1).join(" ");return{...e,object:c,altObject:s,verb:i}}function Go(e,{nlp:t=void 0}={}){return rf(e,{nlp:t}).parsed}function rf(e,{nlp:t=void 0}={}){let n=t===void 0?vc():t,s=String(e||"").trim().replace(/\s+/g," ");if(!s)return{parsed:null,alternates:[],class:null};let o=Nd(Ii(Bo(s)));if(!o)return{parsed:null,alternates:[],class:null};let r=YA(o,n);if(r)return{parsed:r,alternates:[],class:null};let i=Fd(Tw(o,{nlp:n,raw:s}));return i?{parsed:HA(VA(i.parsed),o),alternates:i.alternates||[],class:i.class||null}:{parsed:null,alternates:[],class:null}}function Rc(e,t){return t.length&&af.has(t[0])?{bw:e.slice(1),blc:t.slice(1)}:{bw:e,blc:t}}function Gr(e,t){return Mr(e)||Ni(e,t)}function YA(e,t){let n=ln(e),s=n.map(o=>o.toLowerCase());return $C(n,s)||SC(n,s)||ZA(n,s,t)||Zw(e,t,0)||EC(n,s,t)||tC(n,s,t)||uC(n,s,t,0)||hC(n,s,t,0)||sy(n,s)||wC(n,s,t)||xC(n,s,t)||RC(n,s,t)||TC(n,s,t,0)||kC(n,s,t,0)||ty(n,s,t,0)||lf(n,s,t,0)||ny(n,s,t,0)||rC(n,s,t)||JA(n,s)||cy(n,s,t,0)}function JA(e,t){let n=0;XA.has(t[n])&&(n+=1);let s=dt(t[n]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;n+=1;let r=m=>m+1<t.length?Ya[`${t[m]} ${t[m+1]}`]:void 0,i=r(n);if(!i)return null;let a=n+2,c=-1,l;for(let m=a;m+1<t.length;m+=1){let h=r(m);if(h){c=m,l=h;break}}if(c<0)return null;let u=e.slice(a,c).join(" ").trim(),d=e.slice(c+2).join(" ").trim();if(!u||!d)return null;let p=(m,h)=>m.role==="object"?{shape:"reverse",kind:m.kind,entityType:o,modifier:"direct",object:h}:{shape:"forward",kind:m.kind,modifier:"direct",object:h},f=p(i,u);return f.entityType=o,{node:"boolean",entityType:o,atoms:[{op:"seed",kind:"set",ast:{node:"clause",clause:f}},{op:"intersection",kind:"set",ast:{node:"clause",clause:p(l,d)}}]}}function xc(e,t){return{node:"boolean",entityType:e,atoms:[{op:"seed",kind:"set",ast:{node:"allOfClass",entityType:e}},t]}}function ZA(e,t,n){if(!["do","does","did"].includes(t[0])||!QA.has(t[1]))return null;let s=dt(t[2]);if(!s||s.placeholder||!s.entityType)return null;let o=s.entityType;if(o==="Change")return{node:"miss",reason:`"${t[2]}" isn't an enumerable kind \u2014 a universal check needs a concrete kind (functions, classes, modules, \u2026)`};let r=t[2],i=e.slice(3),a=t.slice(3);if(!i.length)return null;let c=Pt(a,me);if(!c)return{node:"miss",reason:"a universal check needs a known relation verb (import, call, inherit from, test, \u2026)"};let u=i.filter((p,f)=>(f<c.start||f>=c.end)&&!ft.has(a[f])&&a[f]!=="from").join(" ").trim();if(!u)return null;let d=Fs(`which ${r} ${i.join(" ")}`,n,1);return!d||d.node==="miss"?{node:"miss",reason:d&&d.reason||"the universal clause didn't parse"}:{node:"universal",entityType:o,kind:c.kind,object:u,complement:xc(o,{op:"difference",kind:"set",ast:d})}}function Zw(e,t,n=0){let s=uw(e);if(!s)return null;let o=dt(s.entWord);if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;if(r==="Change")return{node:"miss",reason:`"${s.entWord}" isn't an enumerable kind \u2014 a set complement needs a concrete kind (functions, classes, modules, \u2026)`};let i=ln(s.predicate),a=i.map(d=>d.toLowerCase());if(a.length&&a.every(d=>Ge[d]))return xc(r,{op:"difference",kind:"qual",filters:a});let c=Pt(a,me);if(!c)return{node:"miss",reason:"a negated set query needs a known relation verb (import, call, inherit from, test, \u2026)"};if(!i.filter((d,p)=>(p<c.start||p>=c.end)&&!ft.has(a[p])&&a[p]!=="from").length)return xc(r,{op:"difference",kind:"set",ast:{node:"existsEdge",entityType:r,kind:c.kind}});let u=Fs(`which ${s.entWord} ${s.predicate}`,t,n+1);return!u||u.node==="miss"?{node:"miss",reason:u&&u.reason||"the negated clause didn't parse"}:xc(r,{op:"difference",kind:"set",ast:u})}function tC(e,t,n){let s=0;for(;s<t.length&&eC.has(t[s]);)s+=1;if(!["do","does","did"].includes(t[s]))return null;s+=1;let o=e.slice(s),r=t.slice(s),i=r.indexOf("not");if(i<0)return null;let a=Pt(r,me);if(!a)return null;let l=o.filter((u,d)=>d!==i&&(d<a.start||d>=a.end)&&r[d]!=="from"&&!ft.has(r[d])).join(" ").trim();return l?{node:"forwardComplement",kind:a.kind,subjectTerm:l}:null}function cf(e,t){let n=new Set;for(let s of t)for(let o of tt(e,s)){let r=e.byId.get(o.object);r&&r.class&&n.add(r.class)}return n}function ey(e,t){let n=_t(t),s=n.filter(r=>!Yw.has(r)),o=cf(e,s.length?s:n);return o.size===1?[...o][0]:null}function Fs(e,t,n){if(n>Jw)return{node:"miss",reason:"too deep to resolve"};let s=Zw(e,t,n);if(s)return s;let o=ln(e),r=o.map(p=>p.toLowerCase()),i=sy(o,r);if(i)return i;let a=ty(o,r,t,n);if(a)return a;let c=lf(o,r,t,n);if(c)return c;let l=ny(o,r,t,n);if(l)return l;let u=cy(o,r,t,n);if(u)return u;let d=Gr(e,t);return d?{node:"clause",clause:d}:null}function nC(e){let t=e.map(r=>r.toLowerCase()),n=Object.keys(no).sort((r,i)=>i.split(" ").length-r.split(" ").length),s=[],o=e.length;for(;;){let r=null;for(let c=o-1;c>=1&&!r;c-=1)for(let l of n){let u=l.split(" ");if(c+u.length<=o&&t.slice(c,c+u.length).join(" ")===l){r={at:c,len:u.length,op:no[l]};break}}if(!r)break;let i=e.slice(r.at+r.len,o),{blc:a}=Rc(i,i.map(c=>c.toLowerCase()));if(!a.length||!a.every(c=>Ge[c]))break;s.unshift({op:r.op,kind:"qual",filters:a}),o=r.at}return!s.length||!o?null:{rest:e.slice(0,o),lifted:s}}function lf(e,t,n,s){for(let o=1;o<t.length;o+=1){let r=_n.includes(t[o]),i=!r&&Qw(t[o]);if(!r&&!i||r&&o+1>=t.length||!dt(t[o-1]))continue;let c=e.slice(0,o-1);if(!c.length||c.every(h=>Ge[h.toLowerCase()]))continue;let l=Gr([...c,Hd].join(" "),n);if(!l||l.shape!=="reverse"&&l.shape!=="forward"||l.modifier&&l.modifier!=="direct")continue;let u=e.slice(r?o+1:o),d=nC(u),p=`which ${t[o-1]} ${(d?d.rest:u).join(" ")}`,f=Fs(p,n,s+1);if(!f||f.node==="miss")return f?{node:"miss",reason:f.reason||"inner clause didn't parse"}:{node:"miss",reason:"inner clause didn't parse"};let m={node:l.shape==="reverse"?"reverseSet":"forwardSet",kind:l.kind,entityType:l.entityType,inner:f};return d?{node:"boolean",entityType:l.entityType,atoms:[{op:"seed",kind:"set",ast:m},...d.lifted]}:m}return null}function ty(e,t,n,s){let o=0;(co.has(t[o])||uf.has(t[o]))&&(o+=1);let r=dt(t[o]);if(!r||r.placeholder||!r.entityType||(o+=1,af.has(t[o])&&(o+=1),!sC.has(t[o])||t[o+1]!=="in"))return null;let i=e.slice(o+2);return i.length?df(r.entityType,i,n,s):null}function ny(e,t,n,s){let o=0;if(!co.has(t[0]))return null;o+=1;let r=dt(t[o]);if(!r)return null;o+=1;let i=e.slice(o),a=t.slice(o);if(i.length<2)return null;let c=null;for(let h=i.length-1;h>0;h-=1){let b=a.slice(h),g=Pt(b,me);if(g&&g.start===0&&g.end===b.length){c={kind:g.kind,at:h};break}}if(!c)return null;let l=i.slice(0,c.at),u=a.slice(0,c.at);if(!u.some(h=>_n.includes(h)))return null;let d=l,p=u;for(;p.length&&uf.has(p[0]);)d=d.slice(1),p=p.slice(1);if(!p.length||!dt(p[0]))return null;let f=co.has(p[0])?d.join(" "):`which ${d.join(" ")}`,m=Fs(f,n,s+1);return!m||m.node==="miss"?{node:"miss",reason:m&&m.reason||"the embedded subject clause didn't parse"}:{node:"forwardSet",kind:c.kind,entityType:r.entityType,inner:m}}function rC(e,t,n){for(let s=0;s<t.length;s+=1){if(!oC.has(t[s])||t[s-1]==="of")continue;let o=s===t.length-1,r=s+1<t.length&&!!me[t[s+1]];if(!o&&!r)continue;let i=[...e.slice(0,s),Hd,...e.slice(s+1)],a=Gr(i.join(" "),n);if(!(!a||a.shape!=="reverse"&&a.shape!=="forward")&&a.object===Hd&&!(a.modifier&&a.modifier!=="direct"))return{node:a.shape==="reverse"?"reverseSet":"forwardSet",kind:a.kind,entityType:a.entityType,inner:{node:"prevSet"}}}return null}function uC(e,t,n,s=0){if(t[0]!=="when")return null;let o=1;if(!iC.has(t[o]))return null;o+=1;let r=-1;for(let d=t.length-1;d>=o;d-=1)if(aC.has(t[d])){r=d;break}if(r<0)return null;let i=e.slice(o,r),a=t.slice(o,r);for(;a.length&&cC.has(a[a.length-1]);)i=i.slice(0,-1),a=a.slice(0,-1);for(;a.length&&lC.has(a[0]);)i=i.slice(1),a=a.slice(1);if(!i.length||!a.some(d=>_n.includes(d)))return null;let c=co.has(a[0])?i.join(" "):`which ${i.join(" ")}`,l=Fs(c,n,s+1);if(!l||l.node==="miss")return l?{node:"miss",reason:l.reason||"the inner set of the temporal query didn't parse"}:{node:"miss",reason:"the inner set of the temporal query didn't parse"};let u=dt(a[0]);return{node:"temporal",inner:l,entityType:u&&u.entityType||null}}function sy(e,t){if(!fC.has(t[0]))return null;let n=1,s=null;if(t[n]!=="changed"){let i=dt(t[n]);if(!i||i.placeholder)return null;s=i.entityType,n+=1}if(t[n]!=="changed"||(n+=1,t[n]==="ever"&&(n+=1),!dC.has(t[n])))return null;let o=t[n],r=e.slice(n+1).join(" ").trim();return r?{node:"commitFilter",op:o,pivotRaw:r,entityType:s}:{node:"miss",reason:`"changed ${o}" needs a date or commit afterward`}}function df(e,t,n,s){let o=t.map(r=>r.toLowerCase());if(o.some(r=>_n.includes(r))){let r=t,i=o;for(;i.length&&uf.has(i[0]);)r=r.slice(1),i=i.slice(1);if(i.length&&dt(i[0])){let a=co.has(i[0])?r.join(" "):`which ${r.join(" ")}`,c=Fs(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the owner clause of this membership query didn't parse"}:{node:"membershipSet",entityType:e,inner:c}}}return{node:"membership",entityType:e,term:t.join(" ")}}function hC(e,t,n,s=0){if(t[0]!=="where"||!pC.has(t[1])||!Xw.has(t[t.length-1]))return null;let o=e.slice(2,t.length-1),r=t.slice(2,t.length-1);for(;r.length&&mC.has(r[0]);)o=o.slice(1),r=r.slice(1);if(!o.length||!r.some(l=>_n.includes(l)))return null;let i=dt(r[0]);if(!i)return null;let a=co.has(r[0])?o.join(" "):`which ${o.join(" ")}`,c=Fs(a,n,s+1);return!c||c.node==="miss"?{node:"miss",reason:c&&c.reason||"the inner set of the location query didn't parse"}:{node:"whereSet",inner:c,entityType:i.entityType||null}}function bC(e){let t=new Set,n=[];for(let s of e){if(!s||!gC.test(s))continue;let o=s.toLowerCase();t.has(o)||(t.add(o),n.push(s))}return n}function wC(e,t,n){if(t.length===2&&t[0]==="which"&&(t[1]==="ones"||t[1]==="one"))return{node:"anaphora",mode:"list",filter:{type:"all"}};let s=-1,o=!1;for(let d=1;d<t.length;d+=1){if(!Si.includes(t[d]))continue;if(t[d-1]==="of"){s=d,o=!0;break}let p=t.slice(0,d).join(" ");if(d===t.length-1&&(Po.includes(p)||Mo.includes(p))){s=d;break}}if(s<0)return null;let r=(o?t.slice(0,s-1):t.slice(0,s)).join(" "),i=Po.includes(r)||/^(how many|how much|count|number|quantity|total)\b/.test(r)?"count":"list",a=yC(e.slice(s+1),n);if(a===void 0)return{node:"miss",reason:"the follow-up filter didn't parse"};let c=o?s-1:s,l=bC(e.slice(0,c)),u={node:"anaphora",mode:i,filter:a};return l.length>=2&&(u.candidateTerms=l),u}function yC(e,t){let n=0,s=e.map(a=>a.toLowerCase());for(;n<s.length&&qA.has(s[n]);)n+=1;let o=e.slice(n),r=s.slice(n);if(!o.length)return{type:"all"};if(r.every(a=>Ge[a]))return{type:"qual",filters:r};if(o.length===1){let a=dt(r[0]);if(a&&!a.placeholder&&a.entityType)return{type:"entity",entityType:a.entityType}}let i=Gr(`what ${o.join(" ")}`,t);if(i&&(i.shape==="reverse"||i.shape==="forward")&&i.object)return{type:"clause",clause:i}}function $C(e,t){let n;if(t[0]==="is"&&t[1]==="there")n=2;else if(t[0]==="are"&&t[1]==="there")n=2;else return null;let s=t[n];if(s==="a"||s==="an"||s==="any")n+=1;else return null;let o=n<t.length?dt(t[n]):null;if(!o||o.placeholder||!o.entityType)return null;let r=o.entityType;n+=1;let i=t.slice(n),a=e.slice(n);if(i.length&&i[i.length-1]==="anywhere"?(i=i.slice(0,-1),a=a.slice(0,-1)):i.length>=2&&i[i.length-2]==="at"&&i[i.length-1]==="all"&&(i=i.slice(0,-2),a=a.slice(0,-2)),!i.length)return{node:"exists",entityType:r,term:null,scopeModule:null};if(i[0]==="called"||i[0]==="named"){if(i.length<2)return{node:"miss",reason:`"${i[0]}" needs a name afterward`};let c=i.indexOf("in",1);if(c>0){let u=a.slice(1,c).join(" ").trim(),d=a.slice(c+1).join(" ").trim();return!u||!d?{node:"miss",reason:'a named existence check needs both a name and a module after "in"'}:{node:"exists",entityType:r,term:u,scopeModule:d}}let l=a.slice(1).join(" ").trim();return l?{node:"exists",entityType:r,term:l,scopeModule:null}:{node:"miss",reason:`"${i[0]}" needs a name afterward`}}if(i[0]==="in"){let c=a.slice(1).join(" ").trim();return c?{node:"exists",entityType:r,term:null,scopeModule:c}:{node:"miss",reason:'"in" needs a module afterward'}}return null}function vC(e,t){if(!t.length)return null;let n=`${e} ${t.join(" ")}`,s=eo(n).slice(e.length).trim(),o=ln(s),r=o.findIndex(a=>a.toLowerCase()==="in");if(r<0)return null;let i=o.slice(r+1).join(" ").trim();return i?{scope:i}:{node:"miss",reason:'"in" needs a scope afterward'}}function SC(e,t){if(t[0]!=="is"&&t[0]!=="are"||t[1]==="there")return null;let n=-1,s=!1;for(let l=1;l<t.length;l+=1)if(Ge[t[l]]){n=l,s=t[l-1]==="not";break}if(n<0)return null;let o=t.indexOf("by",n+1);if(o>0&&to[t[n]]){let l=o+1;for(;l<t.length&&(t[l]==="the"||t[l]==="a"||t[l]==="an");)l+=1;let u=t[l];if(u&&!_g.has(u))return null}let r=vC(t[n],e.slice(n+1));if(r?.node==="miss")return r;let i=1;t[i]==="the"&&(i+=1);let a=s?n-1:n;a>i&&(t[a-1]==="a"||t[a-1]==="an")&&(a-=1);let c=a>i?e.slice(i,a).join(" ").trim():"";return c?{node:"qualCheck",term:c,qualifier:t[n],negated:s,scope:r?.scope||null}:{node:"miss",reason:'"is/are <qualifier>" needs a named thing to check first'}}function EC(e,t,n){if(!["do","does","did","is","are","was","were"].includes(t[0]))return null;let s=t.indexOf("not",1);if(s<0)return null;let o=Gr(e.filter((r,i)=>i!==s).join(" "),n);return!o||o.shape!=="ask"?null:{...o,negated:!0}}function xC(e,t,n){let s=Po.find(d=>t.slice(0,d.split(" ").length).join(" ")===d);if(!s)return null;let o=s.split(" ").length;for(;o<t.length&&(t[o]==="the"||t[o]==="a"||t[o]==="all");)o+=1;let r=[];for(;o<t.length&&Ge[t[o]];)r.push(t[o]),o+=1;let i=o<t.length?dt(t[o]):null;if(!i)return{node:"miss",reason:"count needs a known entity kind (functions, classes, modules, \u2026)"};let a=t[o];o+=1;let c=e.slice(o),l=t.slice(o).some(d=>!ft.has(d)&&!oy.has(d)),u;if(l){let d=Fs(`which ${a} ${c.join(" ")}`,n,1);if(!d||d.node==="miss")return{node:"miss",reason:"the count restrictor didn't parse"};u=d}else u={node:"allOfClass",entityType:i.entityType};return r.length&&(u={node:"qualifier",filters:r,inner:u}),{node:"count",entityType:i.entityType,base:u}}function kC(e,t,n,s){let o=0,r=!1,i=null;for(let w of ry){let y=w.split(" ");if(t.slice(0,y.length).join(" ")===w){i=w,o=y.length;break}}if(!i)if(t[0]==="what"||t[0]==="which")r=!0,o=1;else return null;for(;o<t.length&&ff.has(t[o]);)o+=1;let a=[];for(;o<t.length&&Ge[t[o]];)a.push(t[o]),o+=1;let c=o<t.length?dt(t[o]):null;if(!c||c.placeholder||c.entityType==="Change")return!r&&o<t.length&&o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!ks.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${iy}`}:null;let l=c.entityType,u=t[o];o+=1;let d=e.slice(o),p=t.slice(o).some(w=>!ft.has(w)&&!oy.has(w)),f=t.slice(o),m=d;(f[0]==="is"||f[0]==="are")&&(f=f.slice(1),m=m.slice(1));let h=r&&jC.has(f[0]);if(r&&(p&&!h||d.length===0))return null;let b,g=!1;if(p){let w=h?m:d,y=Fs(`which ${[...a,u,...w].join(" ")}`,n,(s||0)+1);if(!y||y.node==="miss")return{node:"miss",reason:y&&y.reason||"the list filter didn't parse"};b=y,g=!0}else b={node:"allOfClass",entityType:l},a.length&&(b={node:"qualifier",filters:a,inner:b});return{node:"list",entityType:l,base:b,scoped:g}}function RC(e,t,n){let s=null,o=-1;for(let m=0;m<t.length;m+=1){let h=t.slice(m,m+2).join(" ");if(es[h]){s=es[h],o=m;break}if(es[t[m]]){s=es[t[m]],o=m;break}}if(!s)return null;let r=null,i=null;for(let m=o;m<t.length;m+=1)if(ts[t[m]]){r=ts[t[m]],i=t[m];break}if(!r){for(let m=o-1;m>=0;m-=1)if(ts[t[m]]){r=ts[t[m]],i=t[m];break}}let a=t.includes("connected")||t.slice(o,o+2).join(" ")==="most connected"||["largest","biggest","smallest"].includes(t[o]),c=["important","significant","central","key","core","essential","critical","principal"],l=t.some(m=>c.includes(m));!r&&(a||l)&&(r=ts.connections,i="connections");let u,d=null;for(let m of t){let h=dt(m);if(h&&!h.placeholder){u=h.entityType,d=m;break}}if(!d&&(u=i?Tg[i]:void 0,!u))return{node:"miss",reason:"a superlative needs an entity kind (module, class, function, \u2026)"};if(!r)return{node:"miss",reason:"name what to rank by (imports, callers, methods, tests, or connections)"};let p=["needs","need","needing","lacks","lack","lacking","misses","missing"],f=t.some(m=>p.includes(m))?s==="most"?"fewest":"most":s;return{node:"superlative",entityType:u,metric:r,metricNoun:i,extreme:f}}function TC(e,t,n,s){if(t[0]!=="find")return null;let o=1;for(;o<t.length&&ff.has(t[o]);)o+=1;if(o>=t.length)return null;let r=dt(t[o]);if(r&&!r.placeholder&&r.entityType!=="Change"&&o+1<t.length&&_C.has(t[o+1])){let a=e.slice(o+2).join(" ").trim();if(a)return{node:"find",entityType:r.entityType,term:a}}let i=dt(t[t.length-1]);if(i&&!i.placeholder&&i.entityType!=="Change"){let a=e.slice(o,t.length-1).join(" ").trim();if(a)return{node:"find",entityType:i.entityType,term:a}}return t.some(a=>_n.includes(a))?null:o===t.length-1&&/^[a-z]+$/.test(t[o])&&!me[t[o]]&&!ks.includes(t[o])?{node:"miss",reason:`"${t[o]}" isn't a listable kind \u2014 try ${iy}`}:null}function AC(e,t){if(t[0]!=="find")return null;let n=1;for(;n<t.length&&ff.has(t[n]);)n+=1;let s=-1;for(let i=n+1;i<t.length;i+=1)if(_n.includes(t[i])){s=i;break}if(s<0)return null;let o=dt(t[s-1]);if(!o||o.placeholder||o.entityType==="Change")return null;let r=e.slice(n,s-1).join(" ").trim();return r?{entityType:o.entityType,term:r,relIdx:s}:null}function ay(e,t,n,s){if(!n.length||n[0]!=="named"&&!(n[0]==="called"&&s)||n[1]==="by")return null;let o=t.slice(1).join(" ").trim();return o?{node:"named",entityType:e||null,term:o}:null}function CC(e,t,n,s,o,r){let{branches:i,ops:a}=jc(n,s),c=null,l=[];for(let u=0;u<i.length;u+=1){let d=i[u],p=d.map(y=>y.toLowerCase()),f=u===0?"intersection":a[u-1],m=Rc(d,p);if(m.blc.length&&m.blc.every(y=>Ge[y])){l.push({op:f,kind:"qual",filters:m.blc});continue}let h=ay(e,m.bw,m.blc,m.blc.length!==p.length);if(h){l.push({op:f,kind:"set",ast:h});continue}if(p[0]==="of"||p[0]==="in"){let y=df(e,d.slice(1),o,r);if(y.node==="miss")return{miss:y.reason};l.push({op:f,kind:"set",ast:y});continue}let b=d,g=Pt(p,me);g?c=d.slice(g.start,g.end):c&&(b=[...c,...d]);let w=ly(`${t} ${b.join(" ")}`,o,r);if(!w||w.node==="miss")return{miss:w&&w.reason||"a clause in the combination didn't parse"};l.push({op:f,kind:"set",ast:w})}return{atoms:l}}function cy(e,t,n,s){let o=AC(e,t);if(o){let{entityType:_,term:$,relIdx:T}=o,C=t.slice(T+1),E=e.slice(T+1);if(!C.length)return{node:"miss",reason:`a relative clause needs a predicate after "${t[T]}"`};let k=CC(_,`which ${t[T-1]}`,C,E,n,s+1);if(k.miss)return{node:"miss",reason:k.miss};let P=[{op:"seed",kind:"set",ast:{node:"find",entityType:_,term:$}},...k.atoms];return P.length===1?P[0].ast:{node:"boolean",entityType:_,atoms:P}}let r=0;for(;r<t.length&&co.has(t[r]);)r+=1;let i=r>0,a=[];for(;r<t.length&&Ge[t[r]];)a.push(t[r]),r+=1;let c=r<t.length?dt(t[r]):null;if(!c){let _=r+1<t.length?dt(t[r+1]):null;if(Iw.has(t[r])&&_&&_.entityType==="Commit"&&r+2===t.length)return{node:"recentCommits"};if(af.has(t[r])){let $=r+1;$<t.length&&(t[$]==="the"||t[$]==="a"||t[$]==="an")&&($+=1);let T=$+1<t.length?dt(t[$+1]):null;if(Iw.has(t[$])&&T&&T.entityType==="Commit"&&$+2===t.length)return{node:"recentCommits"}}return(i||a.length)&&_&&/^[a-z]+$/.test(t[r])&&!me[t[r]]&&!ft.has(t[r])&&!xf.has(t[r])?{node:"find",entityType:_.entityType,term:e[r]}:null}let l=c.entityType,u=t[r];r+=1;let d=t.slice(r),p=e.slice(r),f=!1;d.length&&_n.includes(d[0])&&(f=!0,d=d.slice(1),p=p.slice(1));let m=d[0]==="of"||d[0]==="in",h=d.length>0&&Qw(d[0]),b=p.length>0&&jc(d,p).branches.some(_=>{let{blc:$}=Rc(_,_.map(T=>T.toLowerCase()));return $.length&&$.every(T=>Ge[T])}),g=p.length>0?jc(d,p).branches:[],w=!1;if(g.length>1){let _=g[0].map(T=>T.toLowerCase()),$=Pt(_,me);$&&$.start===0&&(w=g.slice(1).every(T=>{let C=T.map(k=>k.toLowerCase()),E=Pt(C,me);return E&&E.start===0?E.kind===$.kind:!E}))}let y=!1;if(g.length>1){let _=g[0].map(T=>T.toLowerCase()),$=Pt(_,me);$&&$.start===0&&(y=g.slice(1).every(T=>{let C=T.map(k=>k.toLowerCase()),E=Pt(C,me);return!!E&&E.start===0&&E.end-E.start===1}))}if(!(a.length||f||m||h||b||w||y))return null;if(!p.length){let _={node:"allOfClass",entityType:l};return a.length?{node:"qualifier",filters:a,inner:_,entityType:l}:{node:"miss",reason:"nothing to filter or traverse"}}let v=c.placeholder?"what":`which ${u}`,{branches:R,ops:S}=jc(d,p),j=null,I=[];for(let _=0;_<R.length;_+=1){let $=R[_],T=$.map(Y=>Y.toLowerCase()),C=_===0?"seed":S[_-1],E=Rc($,T);if(E.blc.length&&E.blc.every(Y=>Ge[Y])){I.push({op:C,kind:"qual",filters:E.blc});continue}let k=ay(l,E.bw,E.blc,E.blc.length!==T.length);if(k){I.push({op:C,kind:"set",ast:k});continue}if(T[0]==="of"||T[0]==="in"){let Y=df(l,$.slice(1),n,s+1);if(Y.node==="miss")return Y;I.push({op:C,kind:"set",ast:Y});continue}let P=$,D=Pt(T,me);D?j=$.slice(D.start,D.end):j&&(P=[...j,...$]);let H=ly(`${v} ${P.join(" ")}`,n,s+1);if(!H||H.node==="miss")return{node:"miss",reason:H&&H.reason||"a clause in the combination didn't parse"};I.push({op:C,kind:"set",ast:H})}if(I[0].kind!=="set")return{node:"miss",reason:"start with a clause, then combine with and/or/but-not"};let x;return I.length===1?x=I[0].ast:x={node:"boolean",entityType:l,atoms:I},a.length&&(x={node:"qualifier",filters:a,inner:x,entityType:l}),x}function ly(e,t,n){if(n>Jw)return{node:"miss",reason:"too deep to resolve"};let s=ln(e),o=s.map(a=>a.toLowerCase()),r=lf(s,o,t,n);if(r)return r;let i=Gr(e,t);return i?{node:"clause",clause:i}:null}function jc(e,t){let n=Object.keys(no).sort((a,c)=>c.split(" ").length-a.split(" ").length),s=[],o=[],r=0,i=0;for(;i<e.length;){let a=null;for(let c of n){let l=c.split(" ");if(e.slice(i,i+l.length).join(" ")===c){a={c,len:l.length};break}}a&&i>r?(s.push(t.slice(r,i)),o.push(no[a.c]),i+=a.len,r=i):a?(i+=a.len,r=i):i+=1}return s.push(t.slice(r)),{branches:s,ops:o}}function pf(e){let t=Ow.get(e);if(t)return t;t=new Map;for(let n of e.individuals||[])n.class==="Module"&&t.set(Zt(n.label),n);return Ow.set(e,t),t}function uy(e,t){let n=pf(e),s=[];for(let o of t){let r=e.byId.get(o);if(!r||r.class==="Module")continue;let i=uo(r),a=i?n.get(Zt(i)):null;a&&s.push(a)}return Sn(s)}function OC(e){let t=Nw.get(e);if(t)return t;t=new Map;let n=pf(e);for(let s of e.individuals||[]){if(s.class==="Module")continue;let o=uo(s),r=o?n.get(Zt(o)):null;r&&(t.has(r.id)||t.set(r.id,[]),t.get(r.id).push(s))}return Nw.set(e,t),t}function mf(e,t,n,s){let o=Br[t];if(o&&io.has(n)){let d=tt(e,o).filter(p=>s.has(p.object));return Sn(d.map(p=>e.byId.get(p.subject)).filter(p=>p&&p.class===n))}let a=(!!o&&[...s].some(d=>io.has(e.byId.get(d)?.class))?[..._t(t),o]:_t(t)).flatMap(d=>tt(e,d)),c=a.filter(d=>s.has(d.object));t==="cochange"&&(c=c.concat(a.filter(d=>s.has(d.subject)).map(d=>({...d,subject:d.object,object:d.subject}))));let l=Sn(c.map(d=>e.byId.get(d.subject)).filter(Boolean));if(!n||n==="Change")return l;let u=l.filter(d=>d.class===n);if(dy(t,n)){let d=new Set(c.map(f=>f.object)),p=new Set([...s].filter(f=>!d.has(f)));return Sn([...u,...uy(e,p)])}return u.length?u:n!=="Module"&&l.some(d=>d.class==="Module")?vf(e,new Set(l.filter(d=>d.class==="Module").map(d=>d.id)),n):[]}function LC(e){let t=new Set;for(let n of["touches","touchesSymbol"])for(let s of tt(e,n)){let o=e.byId.get(s.subject);o?.class==="Commit"&&t.add(String(o.label||"").toLowerCase())}return e.individuals.filter(n=>n.class==="Commit").map(n=>String(n.label||"").toLowerCase()).filter(n=>n&&!t.has(n)).sort()}function PC(e,t){let n=new Set(mf(e,"touches","Commit",t).map(o=>String(o.label||"").toLowerCase())),s=LC(e);for(let o of t)for(let r of e.byId.get(o)?.derived_from||[]){let i=NC.exec(String(r||""));if(!i)continue;let a=i[1].toLowerCase(),c=s.find(l=>l.startsWith(a)||a.startsWith(l));c&&n.add(c)}return n.size}function zi(e,t,n){let s=_t(t).flatMap(o=>tt(e,o)).filter(o=>n.has(o.subject));return Sn(s.map(o=>e.byId.get(o.object)).filter(Boolean))}function Sn(e){let t=new Set,n=[];for(let s of e)s&&!t.has(s.id)&&(t.add(s.id),n.push(s));return n}function MC(e,t){let n=Zt(t);if(!n)return[];let s=`${n}/`;return e.individuals.filter(o=>o.class==="Module"&&Zt(o.label).startsWith(s))}function qd(e){let t=Lw.get(e);if(t)return t;let n=new Set;for(let i of tt(e,"reexports")){n.add(String(i.object).toLowerCase());let a=e.byId.get(i.object);a&&n.add(String(a.label).toLowerCase())}let s=new Set,o=new Set;for(let i of tt(e,"tests"))s.add(i.object),o.add(i.subject);let r=new Map;for(let i of tt(e,"defines"))r.set(i.object,i.subject);return t={exported:n,testedModules:s,testModules:o,moduleOfSymbol:r},Lw.set(e,t),t}function Vo(e,t){return t?t.class==="Module"?t.id:qd(e).moduleOfSymbol.get(t.id)||null:null}function FC(e,t){let n=Vo(e,t);if(n)return n;let s=uo(t);return s&&pf(e).get(Zt(s))?.id||null}function fy(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=(e?.individuals||[]).filter(d=>DC.has(d.class)&&String(d.label).toLowerCase()===n);if(s.length!==1)return null;let o=s[0],r=Vo(e,o),i=r&&e.byId.get(r)?.label||String((o.attributes||[]).find(d=>d.key==="site")?.value||"").split(":")[0]||null,a=de(o.class,1),c=a==="attribute"?"an":"a",l=i?`, ${Mi("defined-in",o.id,"defined in")} ${i}`:"",u=o.class==="Class"?` or "which classes inherit from ${o.label}"`:"";return{text:`${o.label} is ${c} ${a} in this codebase${l} \u2014 try "describe ${o.label}"${u}.`,hit:o,modLabel:i}}function _c(e,t,n){let s=Sn(Rr.flatMap(i=>zi(e,i,new Set([t])))),o=n?s.filter(i=>i.class===n):s;if(o.length)return o;let r=OC(e).get(t)||[];return n?r.filter(i=>i.class===n):r}function hf(e,t,n=null){let s=Ms(e,t,n);if(!(s.match&&s.tier===1)){let o=MC(e,t);if(o.length)return{kind:"dir",mods:o}}return s.match?{kind:"single",id:s.match.id,entityClass:s.match.class,label:s.match.label}:{kind:"miss"}}function gf(e,t,n,s,o){let r=o||(()=>!0),i=_c(e,t,s).filter(r);if(i.length||!my(e,n))return{own:i,inherited:[],viaId:null,viaLabel:null};for(let a of py(e,t)){let c=e.byId.get(a);if(!c)continue;let l=_c(e,a,s).filter(r);if(l.length)return{own:i,inherited:l,viaId:a,viaLabel:c.label}}return{own:i,inherited:[],viaId:null,viaLabel:null}}function ao(e,t,n){if(!n)return!1;switch(n.via){case"visibility":return String((t.attributes||[]).find(o=>o.key==="visibility")?.value||"public").toLowerCase()===n.value;case"attr":return!!(t.attributes||[]).find(s=>s.key===n.attr)?.value;case"exported":{let s=qd(e).exported;return s.has(String(t.label).toLowerCase())||s.has(String(t.id).toLowerCase())}case"tested":{let s=FC(e,t),o=qd(e),r=s?e.byId?.get?.(s):null;return s&&(o.testModules.has(s)||r&&Do(String(r.label).toLowerCase()))||!s?!1:o.testedModules.has(s)===n.value}default:return!1}}function bf(e){return tt(e,"inherits")}function Yd(e,t){return bf(e).filter(n=>n.object===t).map(n=>n.subject)}function Pw(e,t){return bf(e).filter(n=>n.subject===t).map(n=>n.object)}function zC(e,t){let n=new Set,s=[...Yd(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Yd(e,o))n.has(r)||s.push(r)}}return n}function py(e,t){let n=new Set,s=[...Pw(e,t)];for(;s.length;){let o=s.shift();if(!n.has(o)){n.add(o);for(let r of Pw(e,o))n.has(r)||s.push(r)}}return n}function my(e,t){let n=Mw.get(e);if(n||(n=new Map,Mw.set(e,n)),n.has(t))return n.get(t);let s=bf(e).some(o=>{let r=e.byId.get(o.subject),i=e.byId.get(o.object);return!!r&&!!i&&r.class===t&&i.class===t});return n.set(t,s),s}function Fw(e,t){let n=String(e.label||"").toLowerCase();if(t.every(o=>n.includes(o)))return"label";let s=(e.attributes||[]).map(o=>String(o.value??"").toLowerCase());return t.every(o=>s.some(r=>r.includes(o)))?"attr":null}function zw(e){return e.slice().sort((t,n)=>Dw[n.via]-Dw[t.via]||String(t.ind.label).length-String(n.ind.label).length).map(t=>t.ind)}function Bw(e,t){let n=String(t||"").trim().toLowerCase();if(n.length<4)return!1;let s=Ns(n);if(Os(String(e.label||"").toLowerCase(),n,s)<=s)return!0;for(let o of Wo(e.label))if(Os(o,n,s)<=s)return!0;return!1}function hy(e,t,n){let s=e.individuals.filter(c=>c.class===t),o=[...Wo(n)];if(!o.length||!s.length)return{narrow:[],broad:[]};let r=my(e,t),i=[];for(let c of s){let l=Fw(c,o);if(l){i.push({ind:c,via:l});continue}if(!r)continue;[...zC(e,c.id)].some(d=>{let p=e.byId.get(d);return!!p&&!!Fw(p,o)})&&i.push({ind:c,via:"chain"})}if(i.length||!r)return{narrow:zw(i),broad:[]};let a=new Map;for(let c of s)for(let l of py(e,c.id)){if(!a.has(l)){let u=e.byId.get(l);u&&u.class===t&&Bw(u,n)&&a.set(l,{ind:u,via:"chain"})}for(let u of Yd(e,l)){if(u===c.id||a.has(u))continue;let d=e.byId.get(u);d&&d.class===t&&Bw(d,n)&&a.set(u,{ind:d,via:"chain"})}}return{narrow:[],broad:zw([...a.values()])}}function gy(e){return[...lc(uc(e)).entries()].sort((t,n)=>n[1]-t[1]||t[0].localeCompare(n[0])).map(([t])=>({id:`pkg:${t}`,label:t,class:"Package"}))}function Xd(e,t,n){let s=String(t||"").trim().toLowerCase();if(!s)return[];let o=Zt(s);return e.individuals.filter(r=>{if(n&&r.class!==n)return!1;let i=String(r.label||"").toLowerCase();return i===s||String(r.id||"").toLowerCase()===s?!0:r.class==="Module"&&Zt(i)===o})}function Jd(e,t){if(!t||typeof t!="object")return null;if(Array.isArray(t)){for(let n of t){let s=Jd(e,n);if(s)return s}return null}if(t.node==="named")return Xd(e,t.term,t.entityType).length?null:{term:t.term,entityType:t.entityType||null,elsewhere:Xd(e,t.term,null)[0]||null};for(let n of Object.values(t)){let s=Jd(e,n);if(s)return s}return null}function en(e,t,n){switch(t.node){case"named":return Xd(e,t.term,t.entityType);case"clause":return un(e,t.clause,n).matches||[];case"allOfClass":return t.entityType==="Package"?gy(e):e.individuals.filter(s=>s.class===t.entityType);case"find":{let{narrow:s,broad:o}=hy(e,t.entityType,t.term);return s.length?s:o}case"existsEdge":{let s=new Set(_t(t.kind).flatMap(o=>tt(e,o)).map(o=>o.subject));return e.individuals.filter(o=>s.has(o.id)&&(!t.entityType||o.class===t.entityType))}case"forwardComplement":{let s=Ms(e,t.subjectTerm,n&&n.contextId);if(!s.match)return[];let o=ey(e,t.kind);if(!o)return[];let r=new Set(zi(e,t.kind,new Set([s.match.id])).map(i=>i.id));return e.individuals.filter(i=>i.class===o&&!r.has(i.id))}case"commitFilter":return Qd(e,t).matches;case"reverseSet":{let s=new Set(en(e,t.inner,n).map(o=>o.id));return mf(e,t.kind,t.entityType,s)}case"forwardSet":{let s=new Set(en(e,t.inner,n).map(o=>o.id));return zi(e,t.kind,s)}case"prevSet":{let s=n&&n.prev;return Array.isArray(s)?s.map(o=>e.byId.get(o)).filter(Boolean):[]}case"membership":{let s=hf(e,t.term,n&&n.contextId);if(s.kind==="dir"){if(!t.entityType||t.entityType==="Module")return s.mods;let i=new Set(s.mods.map(c=>c.id));return Sn(Rr.flatMap(c=>zi(e,c,i))).filter(c=>c.class===t.entityType)}if(s.kind==="miss")return[];let{own:o,inherited:r}=gf(e,s.id,s.entityClass,t.entityType);return o.length?o:r}case"membershipSet":{let s=en(e,t.inner,n);return s.length?Sn(s.flatMap(o=>_c(e,o.id,t.entityType))):[]}case"qualifier":return t.inner.node==="membership"?Sy(e,t,n).matches:en(e,t.inner,n).filter(o=>t.filters.every(r=>ao(e,o,Ge[r])));case"boolean":return yy(e,t,n);case"anaphora":return $y(e,t,n).matches;default:return[]}}function BC(e){let t=Ge[e],n=by(t);return n&&Object.keys(Ge).find(s=>Ge[s].via===n.via&&Ge[s].value===n.value)||null}function wy(e,t,n){let s=[],o=[];for(let r of t.atoms){let i=o;if(r.op==="seed")o=en(e,r.ast,n);else if(r.kind==="qual"){let a=l=>r.filters.every(u=>ao(e,l,Ge[u])),c=l=>r.filters.every(u=>{let d=by(Ge[u]);return d?ao(e,l,d):!ao(e,l,Ge[u])});o=r.op==="difference"?i.filter(c):i.filter(a)}else{let a=en(e,r.ast,n),c=new Set(a.map(l=>l.id));if(r.op==="intersection")o=i.filter(l=>c.has(l.id));else if(r.op==="difference")o=i.filter(l=>!c.has(l.id));else if(r.op==="union"){let l=new Set(i.map(u=>u.id));o=i.slice();for(let u of a)l.has(u.id)||(l.add(u.id),o.push(u))}}s.push({atom:r,before:i,after:o})}return{matches:o,steps:s}}function yy(e,t,n){return wy(e,t,n).matches}function UC(e,t){if(!Array.isArray(t)||t.length<2)return null;let n=new Set,s=[];for(let o of t){let r=En(e,o);r&&r.match&&!n.has(r.match.id)&&(n.add(r.match.id),s.push(r.match))}return s.length>=2?s:null}function $y(e,t,n){let o=UC(e,t.candidateTerms);if(!o){let p=n&&n.prev;if(!Array.isArray(p)||!p.length)return{compositeMiss:!0,reason:"no-prev",matches:[]};o=p.map(f=>e.byId.get(f)).filter(Boolean)}let r=o,i=t.filter;if(i&&i.type==="qual")r=r.filter(p=>i.filters.every(f=>ao(e,p,Ge[f])));else if(i&&i.type==="entity")r=r.filter(p=>p.class===i.entityType);else if(i&&i.type==="clause"){let p=En(e,i.clause.object);if(!p.match)r=[];else{let f=Br[i.clause.kind],m=[..._t(i.clause.kind),...f?[f]:[]],h=new Set(m.flatMap(b=>tt(e,b)).filter(b=>b.object===p.match.id).map(b=>b.subject));r=r.filter(b=>h.has(b.id))}}let a=p=>p.length&&p.every(f=>f.class===p[0].class)?p[0].class:null,c=i&&i.type==="entity"?i.entityType:a(o),l=r.length?a(r):c;if(t.mode==="count")return{compositeKind:"count",count:r.length,entityType:l,matches:[]};let u=Wi(l,r,"anaphora",{bound:!0}),d=r.length?null:WC(e,o,i);return{compositeKind:"set",matches:r,entityType:l,referents:u,...d?{emptied:d}:{}}}function WC(e,t,n){if(!t.length||!n)return null;let s={...Bi(t,null,null)};if(n.type==="qual"){let o=Ac(e,n.filters,!1,t);return o?{held:s,step:o}:null}return n.type==="entity"?{held:s,step:{type:"entityKind",entityType:n.entityType}}:n.type==="clause"&&n.clause?.kind&&n.clause.object?{held:s,step:{type:"clause",clause:{kind:n.clause.kind,object:n.clause.object},excluded:!1}}:null}function vy(e,t,n){let s=n.kind==="*"?GC:[n.kind,...n.sibling?[n.sibling]:[]],o=0;for(let r of s)for(let i of tt(e,r)){let a=i.subject===t.id,c=i.object===t.id;if(n.dir==="out"&&a){if(n.filter){let l=e.byId.get(i.object);if(!l||l.class!==n.filter)continue}o+=1}else(n.dir==="in"&&c||n.dir==="both"&&(a||c))&&(o+=1)}return o}function VC(e){let t=e.individuals.filter(s=>s.class==="Commit"),n=s=>String((s.attributes||[]).find(o=>o.key==="date")?.value||"");return t.sort((s,o)=>n(o).localeCompare(n(s))),{compositeKind:"recentCommits",matches:t}}function Qd(e,t){let{op:n,pivotRaw:s,entityType:o=null}=t,r=f=>String((f.attributes||[]).find(m=>m.key==="date")?.value||"").slice(0,10),i=null,a=null,c=null;if(KC.test(s))i=s;else{let{match:f,ambiguous:m}=En(e,s,{expectedClass:"Commit"});f&&!m&&f.class==="Commit"&&r(f)&&(a=f.id,c=f.label,i=r(f))}if(!i)return{compositeKind:"commitFilter",op:n,pivotRaw:s,entityType:o,pivotResolved:!1,matches:[]};let l=e.individuals.filter(f=>f.class==="Commit"&&f.id!==a&&r(f)).filter(f=>{let m=r(f);return n==="since"?m>=i:n==="before"?m<i:n==="after"?m>i:m===i}).sort((f,m)=>r(m).localeCompare(r(f))||String(f.id).localeCompare(String(m.id))),u=o&&o!=="Commit"&&o!=="Change"?Sn(l.flatMap(f=>_y(e,f,o).matches)):null,d=u||l,p=[];if(d.length){let f=u?o:"Commit";p.push({kind:"set",class:f,label:`${d.length} ${de(f,d.length)} ${n} ${s}`,ids:d.map(m=>m.id),attrs:{count:d.length,op:n,...a?{pivot:a}:{}},lane:"commitFilter"})}return a&&p.push({kind:"event",class:"Commit",label:c,ids:[a],attrs:{date:i},lane:"commitFilter"}),{compositeKind:"commitFilter",op:n,pivotRaw:s,pivotDate:i,pivotResolved:!0,entityType:o,windowCount:l.length,matches:d,referents:p}}function HC(e,t,n){let s=en(e,t.inner,n),o=new Set(s.map(a=>a.id));if(!o.size){let a=Ur(e,t.inner,n);return{compositeKind:"temporal",matches:[],entityType:t.entityType,innerCount:0,...a?{emptied:a}:{}}}let r=mf(e,"touches","Commit",o),i=a=>String((a.attributes||[]).find(c=>c.key==="date")?.value||"");return r.sort((a,c)=>i(c).localeCompare(i(a))),{compositeKind:"temporal",matches:r,entityType:t.entityType,innerCount:s.length}}function qC(e,t,n){let s=en(e,t.inner,n),o=s.length?null:Ur(e,t.inner,n);return{compositeKind:"whereSet",matches:s,entityType:t.entityType,sites:s.map(r=>(r.attributes||[]).find(i=>i.key==="site")?.value||null),...o?{emptied:o}:{}}}function YC(e,t){let n=e.individuals.filter(a=>a.class===t.entityType);if(t.metric?.kind==="tests"&&t.entityType==="Module"){let a=new Set(tt(e,"tests").map(c=>c.subject));n=n.filter(c=>!a.has(c.id)&&!Do(String(c.label).toLowerCase()))}let s=n.map(a=>({ind:a,score:vy(e,a,t.metric)})).sort((a,c)=>t.extreme==="most"?c.score-a.score:a.score-c.score);if(!s.length)return{compositeKind:"superlative",entityType:t.entityType,matches:[]};let o=s[0].score,r=s.filter(a=>a.score===o).map(a=>a.ind),i=r.length>=2?Wi(t.entityType,r,"superlative"):[{kind:"entity",class:t.entityType,label:r[0].label,ids:[r[0].id],attrs:{},lane:"superlative"}];return i.push({kind:"measure",label:`${o} ${t.metricNoun}`,ids:[],attrs:{metric:o},lane:"superlative"}),{compositeKind:"superlative",entityType:t.entityType,metricNoun:t.metricNoun,extreme:t.extreme,score:o,matches:r,referents:i}}function Sy(e,t,n){let s=t.node==="qualifier"&&t.inner.node==="membership"?t:null,o=s?s.inner:t,r=o.entityType,i=s?h=>s.filters.every(b=>ao(e,h,Ge[b])):null,a=h=>Wi(r,h,"membership"),c=hf(e,o.term,n&&n.contextId);if(c.kind==="dir"){let h;if(!r||r==="Module")h=c.mods;else{let b=new Set(c.mods.map(g=>g.id));h=Sn(Rr.flatMap(g=>zi(e,g,b))).filter(g=>g.class===r)}return i&&(h=h.filter(i)),{compositeKind:"set",matches:h,entityType:r,referents:a(h)}}if(c.kind==="miss")return{compositeKind:"set",matches:[],entityType:r};let{own:l,inherited:u,viaLabel:d}=gf(e,c.id,c.entityClass,r,i),p=!l.length&&u.length>0,f=p?u:l,m=f.length?null:XC(e,c,r,s);return{compositeKind:"membership",entityType:r,matches:f,inheritedNotOwn:p,viaLabel:d,ownerLabel:c.label,referents:a(f),...m?{emptied:m}:{}}}function XC(e,t,n,s){if(!s)return null;let{own:o,inherited:r}=gf(e,t.id,t.entityClass,n,null),i=o.length?o:r;if(!i.length)return null;let a=Ac(e,s.filters,!1,i);return a?{held:{...Bi(i,null,{entityType:n}),owner:t.label},step:a}:null}function JC(e,t){let{entityType:n,term:s,scopeModule:o}=t,r=null;if(o){let a=En(e,o,{expectedClass:"Module"});if(!a.match)return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMiss:!0,matches:[]};r=a.match}if(s){let a=En(e,s,{expectedClass:n}),c=!r||a.match&&Vo(e,a.match)===r.id,l=a.match&&c;return{compositeKind:"exists",entityType:n,term:s,scopeModule:o,scopeMatch:r,matches:l?[a.match]:[]}}let i=r?vf(e,new Set([r.id]),n):e.individuals.filter(a=>a.class===n);return{compositeKind:"exists",entityType:n,term:null,scopeModule:o,scopeMatch:r,matches:i}}function QC(e,t,n){let s=Vo(e,t);return n.kind==="dir"?n.mods.some(o=>o.id===t.id||o.id===s):s===n.id||_c(e,n.id).some(o=>o.id===t.id)}function ZC(e,t,n){let{term:s,qualifier:o,negated:r,scope:i}=t,a=Ms(e,s,n.contextId);if(a.unresolvedPronoun)return{compositeKind:"qualCheck",qualCheckMiss:"pronoun",term:s,matches:[]};if(!a.match)return{compositeKind:"qualCheck",qualCheckMiss:"unresolved",term:s,matches:[]};if(i){let d=hf(e,i,n.contextId);if(d.kind==="miss")return{compositeKind:"qualCheck",qualCheckMiss:"scope",term:s,scope:i,matches:[]};if(!QC(e,a.match,d))return{compositeKind:"qualCheck",qualCheckMiss:"outsideScope",term:s,scope:i,subjectLabel:a.match.label,scopeLabel:d.kind==="dir"?i:d.label,matches:[]}}let c=ao(e,a.match,Ge[o]),l=r?!c:c,u=[{kind:"entity",class:a.match.class,label:a.match.label,ids:[a.match.id],attrs:{},lane:"qualCheck"}];return{compositeKind:"qualCheck",subject:a.match,qualifier:o,negated:r,holds:l,matches:[a.match],referents:u}}function eI(e,t,n){let s=En(e,t.object);if(!s||!s.match)return{compositeKind:"universal",universalMiss:"unresolved",object:t.object,matches:[]};let o=en(e,{node:"allOfClass",entityType:t.entityType},n),r=yy(e,t.complement,n),i=r.length===0;return{compositeKind:"universal",entityType:t.entityType,kind:t.kind,object:s.match.label,holds:i,total:o.length,counter:r,matches:i?o:r}}function tI(e,t,n){if(t.node==="reverseSet"&&t.kind==="touches"&&t.entityType==="Commit")return new Set(en(e,t.inner,n).map(s=>s.id));if(t.node==="clause"&&t.clause?.shape==="reverse"&&t.clause.kind==="touches"&&t.clause.entityType==="Commit"){let{objMatch:s,ambiguous:o}=un(e,t.clause,n);return s&&!o?new Set([s.id]):null}return null}function nI(e,t,n={}){if(t.node==="miss")return{compositeMiss:!0,reason:t.reason||null,matches:[]};let s=Jd(e,t);if(s)return{compositeMiss:!0,unknownName:s,matches:[]};if(t.node==="exists")return JC(e,t);if(t.node==="qualCheck")return ZC(e,t,n);if(t.node==="universal")return eI(e,t,n);if(t.node==="count"){if(t.base.node==="commitFilter"){let l=Qd(e,t.base);return l.pivotResolved?{compositeKind:"count",count:l.matches.length,entityType:t.entityType,matches:[]}:l}let c=tI(e,t.base,n);return c?{compositeKind:"count",count:PC(e,c),entityType:t.entityType,matches:[]}:{compositeKind:"count",count:en(e,t.base,n).length,entityType:t.entityType,matches:[]}}if(t.node==="list")return{compositeKind:"list",matches:en(e,t.base,n),entityType:t.entityType,scoped:t.scoped};if(t.node==="worldRelation")return VI(e,t);if(t.node==="superlative")return YC(e,t);if(t.node==="temporal")return HC(e,t,n);if(t.node==="whereSet")return qC(e,t,n);if(t.node==="recentCommits")return VC(e);if(t.node==="commitFilter")return Qd(e,t);if(t.node==="anaphora")return $y(e,t,n);if(t.node==="membership"||t.node==="qualifier"&&t.inner.node==="membership")return Sy(e,t,n);if(t.node==="find"){let{narrow:c,broad:l}=hy(e,t.entityType,t.term);return{compositeKind:"find",entityType:t.entityType,term:t.term,matches:c.length?c:l,broad:!c.length&&l.length>0}}if((t.node==="reverseSet"||t.node==="forwardSet")&&t.inner.node==="prevSet"&&!(Array.isArray(n.prev)&&n.prev.length))return{compositeMiss:!0,reason:"no-prev",matches:[]};let o=en(e,t,n),r=t.entityType||null,i=Wi(r,o,t.node==="qualifier"?"qualifierListing":"compositeSet"),a=o.length?null:Ur(e,t,n);return{compositeKind:"set",matches:o,entityType:r,referents:i,...a?{emptied:a}:{}}}function wf(e){let t=e?.node==="clause"?e.clause:null;if(!t?.kind||!t.object||t.modifier==="transitive"||t.shape!=="reverse"&&t.shape!=="forward")return null;let n=t.shape==="forward";return n&&lo(t.kind).includes(" ")?null:{kind:t.kind,object:t.object,passive:n,entityType:t.entityType||e.entityType||null}}function yf(e){let t=lo(e.kind);return`${t.endsWith("e")?`${t}d`:`${t}ed`} ${sI[e.kind]||"by"} ${e.object}`}function Ac(e,t,n,s){let o=a=>s.every(c=>a.every(l=>ao(e,c,Ge[l])));if(n&&!o(t))return null;let r=n||!t.every(a=>Ge[a]?.value===!1)?[]:t.map(BC),i=r.length>0&&r.every(Boolean)&&o(r);return{type:"qual",filters:i?r:t,negated:!n&&!i}}function rI(e,t,n){if(t.kind==="qual")return t.op!=="difference"&&t.op!=="intersection"?null:Ac(e,t.filters,t.op==="difference",n);if(t.op!=="difference"&&t.op!=="intersection")return null;let s=t.op==="difference";if(t.ast?.node==="named")return{type:"named",term:t.ast.term,excluded:s};let o=wf(t.ast);return o?{type:"clause",clause:o,excluded:s}:null}function Ur(e,t,n){if(!t||typeof t!="object")return null;if(t.node==="boolean"){let{steps:o}=wy(e,t,n),r=[...o].reverse().find(c=>c.before.length&&!c.after.length);if(!r)return Ur(e,o[0]?.atom?.ast,n);let i=rI(e,r.atom,r.before);if(!i)return null;let a=o.indexOf(r)===1?o[0].atom.ast:null;return{held:Bi(r.before,a,t),step:i}}if(t.node==="qualifier"&&t.inner?.node!=="membership"&&t.filters?.length){let o=en(e,t.inner,n);if(!o.length)return Ur(e,t.inner,n);let r=Ac(e,t.filters,!1,o);return r?{held:Bi(o,t.inner,t),step:r}:null}if(t.node==="reverseSet"||t.node==="forwardSet"||t.node==="membershipSet"){let o=en(e,t.inner,n);if(!o.length)return Ur(e,t.inner,n);let r=t.node==="membershipSet"?t.entityType?{type:"membership",entityType:t.entityType}:null:{type:t.node==="reverseSet"?"reverse":"forward",kind:t.kind,entityType:t.entityType||null};return r?{held:Bi(o,t.inner,t),step:r}:null}let s=wf(t);return s?{leaf:s}:null}function Bi(e,t,n){let s=wf(t);return{count:e.length,entityType:oI(e)||s?.entityType||n?.entityType||null,clause:s,wholeKind:t?.node==="allOfClass",members:e}}function Zd(){return'compositional queries also work: "which functions call X and call Y", "what calls something that imports X", "public methods of X", "list functions" / "show me the classes", "how many classes", "which module has the most imports", "find me the payment class", or (after a listing) "which of those are tested"'}function iI(e){let t=["Function","Method"].includes(e.class)?`${e.label}()`:e.label;if(e.class==="Module")return t;let n=uo(e);return n?`${t} in ${n}`:t}function ef(e){return!e||typeof e!="object"?!1:Array.isArray(e)?e.some(ef):Array.isArray(e.filters)&&e.filters.some(t=>Ge[String(t).toLowerCase()]?.via==="tested")?!0:Object.values(e).some(ef)}function Ey(e,t){return!["Function","Method"].includes(t)||!ef(e)?null:`This index records tests edges module to module, so a ${de(t,1)} counts as covered exactly when the module it lives in is tested \u2014 ask about that module to see the coverage itself.`}function aI(e){if(e?.node==="qualifier"&&e.inner?.node==="allOfClass"&&e.filters?.length)return{entityType:e.inner.entityType||e.entityType,filters:e.filters,negated:!1};if(e?.node!=="boolean"||e.atoms?.length!==2)return null;let[t,n]=e.atoms;return t.op!=="seed"||t.ast?.node!=="allOfClass"||n.kind!=="qual"||!n.filters?.length||n.op!=="difference"&&n.op!=="intersection"?null:{entityType:t.ast.entityType||e.entityType,filters:n.filters,negated:n.op==="difference"}}function xy(e){let t=aI(e);if(!t)return null;let n=de(t.entityType||"Module",2),s=t.negated?"":"not ";return`Try "which ${n} are ${s}${vn(t.filters)}" for that branch on its own.`}function cI(e,t){return!e||!t?null:t==="Package"?gy(e).length:e.individuals.filter(n=>n.class===t).length}function lI(e){let t=n=>e.entityType?de(e.entityType,n):null;switch(e.type){case"qual":{let n=vn(e.filters);return e.negated?{one:`it is not ${n}`,many:`none of them is ${n}`}:{one:`it is ${n}`,many:`all of them are ${n}`}}case"named":return e.excluded?{one:`it is named "${e.term}"`,many:`all of them are named "${e.term}"`}:{one:`it is not named "${e.term}"`,many:`none of them is named "${e.term}"`};case"clause":{let{clause:n}=e;if(n.passive){let r=yf(n);return e.excluded?{one:`it is ${r}`,many:`all of them are ${r}`}:{one:`it is not ${r}`,many:`none of them is ${r}`}}let s=lo(n.kind),o=Wr(n.kind);return e.excluded?{one:`it ${o} ${n.object} too`,many:`all of them ${s} ${n.object} too`}:{one:`it does not ${s} ${n.object}`,many:`none of them ${o} ${n.object}`}}case"reverse":{let n=Wr(e.kind),s=t(1)?`no ${t(1)} in this index`:"nothing in this index";return{one:`${s} ${n} it`,many:`${s} ${n} them`}}case"forward":{let n=Wr(e.kind);return{one:`it ${n} nothing in this index`,many:`none of them ${n} anything in this index`}}case"membership":return{one:`it has no ${t(2)}`,many:`none of them has any ${t(2)}`};case"entityKind":return{one:`it is not a ${t(1)}`,many:`none of them is a ${t(1)}`};default:return null}}function uI(e){let t=de(e.entityType,1),n=de(e.entityType,2);if(e.owner)return{one:`${e.owner} has 1 ${t}`,many:`${e.owner} has ${e.count} ${n}`};if(e.wholeKind)return{one:`The index has 1 ${t}`,many:`The index has ${e.count} ${n}`};if(e.clause?.passive){let o=yf(e.clause);return{one:`1 ${t} is ${o}`,many:`${e.count} ${n} are ${o}`}}if(e.clause)return{one:`1 ${t} ${Wr(e.clause.kind)} ${e.clause.object}`,many:`${e.count} ${n} ${lo(e.clause.kind)} ${e.clause.object}`};let s=os(e.members);return{one:`1 ${t} matched that far (${s})`,many:`${e.count} ${n} matched that far (${s})`}}function dI(e){if(!e.clause||!e.entityType)return null;let t=de(e.entityType,2);return`Try "${e.clause.passive?`which ${t} are ${yf(e.clause)}`:`which ${t} ${lo(e.clause.kind)} ${e.clause.object}`}" for that branch on its own.`}function tf(e,t,{branchNote:n=null,verdictTail:s=""}={}){if(!e?.held)return null;let o=lI(e.step);if(!o)return null;let r=e.held,i=uI(r),a=r.count===1,c=dI(r)||n;return`${t?`no ${de(t,2)} match that`:"nothing matches that"}${s}. ${a?i.one:i.many}, but ${a?o.one:o.many}.${c?` ${c}`:""}`}function jy(e){if(e.passive){let n=e.entityType?`no ${de(e.entityType,2)}`:"nothing";return`${e.object} ${Wr(e.kind)} ${n} in this index`}return`${e.entityType?`no ${de(e.entityType,1)} in this index`:"nothing in this index"} ${Wr(e.kind)} ${e.object}`}function ky(e,t){let n=cI(e,t);return n===null?`nothing in the index matches that${t?` (${de(t,2)})`:""}`:n===0?`no ${de(t,2)} in this index`:n===1?`the index has 1 ${de(t,1)}, and it does not match that`:`the index has ${n} ${de(t,2)}, and none of them matches that`}function Ww(e,t,n,s,o){let r=Ey(t.inner,n.entityType)||xy(t.inner),i=tf(n.emptied,n.entityType,{branchNote:r,verdictTail:s});return i||`${n.emptied?.leaf?jy(n.emptied.leaf):ky(e,n.entityType)}${s}. ${r||o}`}function fI(e,t,n){if(t.compositeMiss){if(t.reason==="no-prev")return{content:'"those"/"them" needs a previous answer to refer to \u2014 ask a listing question first, then follow up.',miss:!0,ambiguous:!1};if(t.unknownName){let{term:s,entityType:o,elsewhere:r}=t.unknownName,i=o?de(o,1):"entity",a=r?` "${s}" names ${Ls(de(r.class,1))} ${de(r.class,1)} here, not ${Ls(i)} ${i}.`:"";return{content:`no ${i} named "${s}" in this index.${a}`,miss:!0,ambiguous:!1}}return{content:`couldn't compile this compositional question${t.reason?` (${t.reason})`:""}. ${Zd()}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="exists"){if(t.scopeMiss)return{content:`no module matching "${t.scopeModule}" found in the index.`,miss:!0,ambiguous:!1};let s=de(t.entityType,1),o=de(t.entityType,2),r=t.scopeMatch?` in ${t.scopeMatch.label}`:"";if(t.term){if(!t.matches.length)return{content:`No \u2014 no ${s} named "${t.term}" found${r}.`,miss:!0,ambiguous:!1};let i=t.matches[0],a=uo(i),c=i.class==="Module"?"":a?`, ${Mi("defined-in",i.id,"defined in")} ${a}`:"";return{content:`Yes \u2014 ${i.label} is a ${s}${c}.`,miss:!1,ambiguous:!1,matches:t.matches}}return t.matches.length?{content:`Yes \u2014 ${os(t.matches)}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 no ${o} found${r}.`,miss:!0,ambiguous:!1}}if(t.compositeKind==="qualCheck"){if(t.qualCheckMiss==="pronoun")return{content:`"${t.term}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="unresolved")return{content:`couldn't find "${t.term}" in the index to check.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="scope")return{content:`couldn't find "${t.scope}" in the index to check inside.`,miss:!0,ambiguous:!1};if(t.qualCheckMiss==="outsideScope")return{content:`No \u2014 ${t.subjectLabel} isn't in ${t.scopeLabel}.`,miss:!0,ambiguous:!1};let s=t.subject.label,o=t.negated?`not ${t.qualifier}`:t.qualifier,r=t.negated?t.qualifier:`not ${t.qualifier}`;return{content:`${t.holds?"Yes":"No"} \u2014 ${s} is ${t.holds?o:r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="universal"){if(t.universalMiss==="unresolved")return{content:`couldn't find "${t.object}" in the index to check.`,miss:!0,ambiguous:!1,matches:[]};let s=de(t.entityType,t.total),o=UA(t.kind);return t.holds?{content:`Yes \u2014 all ${t.total} ${s} ${o} ${t.object}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`No \u2014 ${t.counter.length} of ${t.total} ${s} do not ${o} ${t.object}: ${os(t.counter)}.`,miss:!1,ambiguous:!1,matches:t.counter}}if(t.compositeKind==="count"){let s=t.entityType?de(t.entityType,t.count):t.count===1?"result":"results";return{content:`${t.count} ${s}.`,miss:!1,ambiguous:!1,matches:[]}}if(t.compositeKind==="list"){if(!t.matches.length)return{content:`no ${de(t.entityType,2)} in this index.`,miss:!0,ambiguous:!1,matches:[]};let s=!["Module","Package","Commit","Fact","Utterance","Session","Source","Rule"].includes(t.entityType),o=!t.scoped&&s&&t.matches.length>at?` \u2014 narrow with "${de(t.entityType,2)} in <module>"`:"";return{content:`${os(t.matches)}${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="worldRelation"){let s=vn(t.asked),o=Oo[t.relation].nouns[1];return t.pairs.length?{content:`${t.pairs.map(i=>`${i.subject.label||i.subject.id} ${i.reads} ${i.object}`).join("; ")}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${o} on record for ${s} in this graph.`,miss:!0,ambiguous:!1,matches:[]}}if(t.compositeKind==="membership"){if(!t.matches.length){let s=tf(t.emptied,t.entityType);return s?{content:s,miss:!0,ambiguous:!1,matches:[]}:{content:`${t.ownerLabel&&t.entityType?`${t.ownerLabel} has no ${de(t.entityType,2)} in this index.`:Uw(n,t.entityType)} ${ro(n)}`,miss:!0,ambiguous:!1,matches:[]}}if(t.inheritedNotOwn){let s=de(t.entityType,2);return{content:`${t.ownerLabel?`${t.ownerLabel} has no own ${s}`:`no own ${s}`} \u2014 inherited from ${t.viaLabel}: ${os(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches,inheritedNotOwn:!0}}return{content:`${os(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="find"){let s=de(t.entityType,1);if(!t.matches.length)return{content:`no ${de(t.entityType,2)} found matching "${t.term}".`,miss:!0,ambiguous:!1,matches:[]};let o=t.matches.length===1?iI(t.matches[0]):os(t.matches);return t.broad?{content:`no exact ${s} named "${t.term}", but found a related ${t.matches.length===1?s:de(t.entityType,2)}: ${o}.`,miss:!1,ambiguous:!1,matches:t.matches,relatedNotExact:!0}:{content:`${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="recentCommits"){if(!t.matches.length)return{content:"no commits recorded in this index.",miss:!0,ambiguous:!1,matches:[]};let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,cn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>cn?` \u2026+${t.matches.length-cn} more`:"";return{content:`${t.matches.length} recent commit(s): ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="commitFilter"){if(!t.pivotResolved)return{content:`"${t.pivotRaw}" isn't a recognized date (yyyy-mm-dd) or a known commit \u2014 try "what changed since 2026-06-01" or "what changed before <commit>".`,miss:!0,ambiguous:!1,matches:[]};if(!t.windowCount)return{content:`no commits recorded ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]};if(t.entityType&&t.entityType!=="Commit"&&t.entityType!=="Change"){let i=de(t.entityType,t.matches.length||2);return t.matches.length?{content:`${os(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}:{content:`no ${i} changed ${t.op} ${t.pivotRaw}.`,miss:!0,ambiguous:!1,matches:[]}}let s=i=>String((i.attributes||[]).find(a=>a.key==="date")?.value||""),o=t.matches.slice(0,cn).map(i=>{let a=s(i).slice(0,10),c=(i.attributes||[]).find(l=>l.key==="message")?.value||"";return`${i.label}${a?` (${a})`:""}${c?` \u2014 ${c}`:""}`}),r=t.matches.length>cn?` \u2026+${t.matches.length-cn} more`:"";return{content:`${t.matches.length} commit(s) changed ${t.op} ${t.pivotRaw}: ${o.join(", ")}${r}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="superlative"){if(!t.matches.length)return{content:`no ${de(t.entityType,2)} to rank in this index.`,miss:!0,ambiguous:!1};let s=t.extreme==="most"?"the most":"the fewest",o=t.matches.length>1?` (${t.matches.length}-way tie)`:"";return{content:`${os(t.matches)} \u2014 ${s} ${t.metricNoun} (${t.score})${o}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="temporal"){let s=t.innerCount||0,o=t.entityType?de(t.entityType,s||2):s===1?"entity":"entities",r=s===1?"was":"were";if(!s)return{content:Ww(n,e,t,", so there is no change history to date",ro(n)),miss:!0,ambiguous:!1,matches:[]};if(!t.matches.length)return{content:`no recorded commit touched the ${s} ${o} in that set in this index. ${ro(n)}`,miss:!0,ambiguous:!1,matches:[]};let i=t.matches[0],a=(i.attributes||[]).find(d=>d.key==="date")?.value||"";if(!a)return{content:`the ${o} in that set ${r} last touched by commit ${i.label}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1,matches:t.matches};let c=(i.attributes||[]).find(d=>d.key==="message")?.value||"",l=String(a).slice(0,10),u=t.matches.length-1;return{content:`the ${o} in that set ${r} last touched by commit ${i.label} on ${l}${c?` ("${c}")`:""}${u?`; ${u} earlier commit${u===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.compositeKind==="whereSet"){if(!t.matches.length)return{content:Ww(n,e,t,", so there is no location to cite",`${Zd()}.`),miss:!0,ambiguous:!1,matches:[]};let s=t.matches.map((r,i)=>nf(r,t.sites[i])||`${r.label} has no recorded code location in this index.`),o=t.matches.filter((r,i)=>nf(r,t.sites[i]));return{content:s.join(" "),miss:o.length===0,ambiguous:!1,matches:t.matches}}if(!t.matches.length){let s=Ey(e,t.entityType)||xy(e),o=tf(t.emptied,t.entityType,{branchNote:s});if(o)return{content:o,miss:!0,ambiguous:!1,matches:[]};let r=s||ro(n);return{content:`${t.emptied?.leaf?`${jy(t.emptied.leaf)}.`:Uw(n,t.entityType)} ${r}`,miss:!0,ambiguous:!1,matches:[]}}return{content:`${os(t.matches)}.`,miss:!1,ambiguous:!1,matches:t.matches}}function $f(){return`"which <functions|classes|modules> <imports|calls|uses|inherits from|tests> <name>" or "what does <name> <import|call|export>" or "what uses <name>" or "where is <name> defined" / "where is <name> mentioned" or "when did <name> change" or "which commits touched <name>" or "which changes touch commit <sha>"/"what did commit <sha> touch" (a commit's own changes) or plainly "what calls this" (about a selected node) or "what does <term> mean"/"what is a <ClassName>" (about the graph's own vocabulary). `+Zd()}function ro(e=null){return e&&Ri(e)===0?jd:`Try "who touched <a module that actually has commits>" or "/describe <module>" to see what's in the index.`}function Wo(e){return new Set(String(e).toLowerCase().split(/[^a-z0-9]+/).filter(Boolean))}function Tc(e){if(e.length<5)return e;let t=e.replace(/(ing|ers|ors|er|or)$/,"");return t===e?e:t.length>=3&&t[t.length-1]===t[t.length-2]?t.slice(0,-1):t}function Ry(e){return String(e||"").replace(/\.[a-z0-9]+$/i,"").toLowerCase().replace(/[/\-_.]+/g,"")}function pI(e){return String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").toLowerCase().replace(/[\s\-_]+/g,"")}function Fi(e,t,{expectedClass:n=null}={}){let s=String(t||"").trim();if(!s)return{match:null,candidates:[],tier:null,ambiguous:!1};let o=s.toLowerCase(),r=n?e.individuals.filter(b=>b.class===n):e.individuals,i=o.match(/^(commit[:\s])?([0-9a-f]{7,40})$/);if(i){let b=i[2],g=r.filter(w=>w.class==="Commit"&&(String(w.id).toLowerCase().startsWith(`commit:${b}`)||String(w.label).toLowerCase().startsWith(b)));if(g.length===1)return{match:g[0],candidates:[],tier:1,ambiguous:!1};if(g.length>1)return{match:g[0],candidates:g.slice(1,5),tier:1,ambiguous:!0};if(i[1])return{match:null,candidates:[],tier:null,ambiguous:!1}}let a=r.find(b=>String(b.label).toLowerCase()===o||String(b.id).toLowerCase()===o);if(a)return{match:a,candidates:[],tier:1,ambiguous:!1};let c=`ext:${o}`,l=null;e:for(let b of e.relations)for(let g of b.edges)if(String(g.object).toLowerCase()===c){l=g.object;break e}if(l&&!n)return{match:{id:l,label:s,class:null},candidates:[],tier:2,ambiguous:!1};let u=s.split(/\s+and\s+/i).map(b=>b.trim()).filter(Boolean);if(u.length>1){let b=new Set;for(let g of u){let w=Fi(e,g,{expectedClass:n});w.match&&!w.ambiguous&&b.add(w.match.id)}if(b.size>1)return{match:null,candidates:[],tier:null,ambiguous:!1}}let d=[],p=!o.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(o);if(p){let b=o.split(".").pop();for(let g of r){let w=String(g.label||"").toLowerCase();g.class==="Module"?w.split("/").pop()===o&&d.push({ind:g,score:1e3-Math.abs(w.length-o.length)}):w.includes(o)?d.push({ind:g,score:2e3-Math.abs(w.length-o.length)}):w.endsWith(`.${b}`)&&d.push({ind:g,score:1500-Math.abs(w.length-o.length)})}}else{let b=[...Wo(s)],g=o.split(/\s+/).find(S=>S.includes("/")),w=g?g.split("/").pop().replace(/\.[a-z0-9]+$/,""):null,v=s.trim().replace(/^(?:the|a|an)\s+/i,"").trim().split(/\s+/).filter(Boolean).length>=2,R=v?pI(s):null;for(let S of r){let j=String(S.label||"").toLowerCase(),I=j.split("/").pop().replace(/\.[a-z0-9]+$/,"");if(I===o){d.push({ind:S,score:5e3});continue}if(o.length>=4&&(I.startsWith(o)||I.endsWith(o))){d.push({ind:S,score:4e3-Math.abs(I.length-o.length)});continue}if(v){let $=Ry(S.label);if($&&$===R){d.push({ind:S,score:5e3});continue}let T=/[/_-]/.test(S.label)||/\.[a-z0-9]+$/i.test(String(S.label||""));if($&&T&&R.length>=4&&$.includes(R)){d.push({ind:S,score:2e3-Math.abs($.length-R.length)});continue}}if(S.class==="Module"){let $=Tc(o);if($!==o&&$===Tc(I)){let T=Ns(o);if(Os(I,o,T)>T){d.push({ind:S,score:3e3-Math.abs(I.length-o.length)});continue}}}if(o.length>=4&&j.includes(o)){d.push({ind:S,score:1e3-Math.abs(j.length-o.length)});continue}let x=Wo(S.label),_=b.filter($=>x.has($)).length;_>0&&(!w||x.has(w))&&d.push({ind:S,score:_/b.length*Wd})}}if(d.sort((b,g)=>g.score-b.score),d.length){let[b,...g]=d,w=g.filter(v=>v.score===b.score),y=b.score>=Wd?g.filter(v=>v.score>=Wd):g;return{match:b.ind,candidates:y.slice(0,4).map(v=>v.ind),tier:3,ambiguous:w.length>0}}let f=p||o.includes("/"),m=null,h=!f&&typeof Fo=="function"?Fo(e.proseIndex,s).filter(b=>!n||e.byId.get(b.id)?.class===n):[];if(h.length){let[b,...g]=h,w=e.byId.get(b.id);if(w){let y=g.filter(v=>v.score===b.score);if(m={match:w,candidates:g.slice(0,4).map(v=>e.byId.get(v.id)).filter(Boolean),tier:4,ambiguous:y.length>0,matchedVia:"prose"},!m.ambiguous&&b.via!=="spell")return m}}if(!i&&o.length>=4){let b=Ns(o),g=b+1,w=[];for(let y of r){let v=Os(String(y.label||"").toLowerCase(),o,b);if(v>0)for(let R of Wo(y.label)){if(v<=0)break;v=Math.min(v,Os(R,o,b))}v<g?(g=v,w=[y]):v===g&&v<=b&&w.push(y)}if(g<=b&&w.length===1)return{match:w[0],candidates:[],tier:5,ambiguous:!1,matchedVia:"fuzzy"};if(g<=b&&w.length>1&&!m){let[y,...v]=w;return{match:y,candidates:v.slice(0,4),tier:5,ambiguous:!0,matchedVia:"fuzzy"}}}return m||{match:null,candidates:[],tier:null,ambiguous:!1}}function Gd(e,t){let n=Ry(t),s=[...Wo(t)],o=[];for(let r of Wo(e))n.includes(r)||s.some(i=>Tc(i)===Tc(r))||kc.has(r)||Cy.has(r)||o.push(r);return o}function Ec(e,t){if(!e?.match||e.tier!==3||e.matchedVia)return e;if(e.ambiguous){let s=[e.match,...e.candidates||[]],o=s.map(r=>new Set(Gd(t,r.label))).reduce((r,i)=>r.filter(a=>i.has(a)),Gd(t,s[0].label));return o.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:o,nearestLabel:vn(s.slice(0,4).map(r=>r.label))}:e}let n=Gd(t,e.match.label);return n.length?{match:null,candidates:[],tier:null,ambiguous:!1,unplacedWords:n,nearestLabel:e.match.label}:e}function En(e,t,n={}){let{expectedClass:s=null}=n;if(!s){let o=String(t||"").trim(),r=o.replace(mI,"").trim(),i=r.match(hI);if(i){let a=r.slice(0,i.index).trim(),c=nt[i[1].toLowerCase()];if(a&&c){let l=Ec(Fi(e,a,{expectedClass:c}),a);if(l?.match?.id&&!l.ambiguous)return l}}if(r&&r!==o){let a=Ec(Fi(e,r,n),r);if(a?.match?.id&&!a.ambiguous)return a}return Ec(Fi(e,t,n),t)}return Ec(Fi(e,t,n),t)}function Ms(e,t,n){if(No.includes(String(t||"").trim().toLowerCase())){if(!n)return{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0};let s=e.byId.get(n);return s?{match:s,candidates:[],tier:1,ambiguous:!1}:{match:null,candidates:[],tier:null,ambiguous:!1,unresolvedPronoun:!0}}return En(e,t)}function vf(e,t,n){let s=[];for(let o of tt(e,"defines")){if(!t.has(o.subject))continue;let r=e.byId.get(o.object);r&&r.class===n&&s.push(r)}return s}function _y(e,t,n,s={}){let o=!n||n==="Change"||n==="Commit",r=o||n==="Module",i=o||io.has(n),a=[...r?["touches"]:[],...i?["touchesSymbol"]:[]],c=a.flatMap(l=>tt(e,l)).filter(l=>l.subject===t.id).map(l=>e.byId.get(l.object)).filter(Boolean);return n&&io.has(n)&&(c=c.filter(l=>l.class===n)),{matches:c,objMatch:t,commitSubject:!0,ambiguous:!1,candidates:[],traversal:`${a.join("+")} edges where subject = commit ${t.label}`,...s}}function yI(e,t){let n=new Set(String(t||"").toLowerCase().split(/[\s-]+/).filter(Boolean));return(e.individuals||[]).filter(s=>s.class==="Module"&&Sf.has(Gw(s.label))).map(s=>({ind:s,named:n.has(Gw(s.label))?1:0,depth:String(s.label).split("/").length,fixture:wI(s.label)?1:0})).sort((s,o)=>o.named-s.named||s.depth-o.depth||s.fixture-o.fixture||String(s.ind.label).localeCompare(String(o.ind.label))).map(s=>s.ind)}function $I(e,t,n){return e!=="reverse"?!1:t==="imports"||t==="calls"?!n||n==="Module":t==="inherits"?!n||n==="Class":!1}function vI(e,t,n){let s=_t(n).flatMap(a=>tt(e,a)),o=a=>{let c=`ext:${String(a.label).toLowerCase()}`;return s.filter(l=>l.object===a.id||String(l.object).toLowerCase()===c).map(l=>e.byId.get(l.subject)).filter(Boolean)},r=new Map,i=o(t);for(;i.length;){let a=i.shift();r.has(a.id)||a.id===t.id||(r.set(a.id,a),i.push(...o(a)))}return[...r.values()].sort((a,c)=>String(a.label).localeCompare(String(c.label)))}function Ef(e){return(e?.attributes||[]).find(t=>SI.has(t.prop))?.value||null}function EI(e){return e==="SchemaClass"?"a class in the graph's schema":e==="SchemaPredicate"?"a predicate (relation) in the graph's schema":`${Ls(e)} ${e} in this graph's vocabulary`}function un(e,t,{contextId:n=null,prev:s=null,pinnedObjMatch:o=null}={}){if(!t)return{matches:[],objMatch:null,candidates:[],traversal:null,ambiguous:!1};if(t.node)return nI(e,t,{contextId:n,prev:s});if(t.ambiguousParse){let E=t.candidates.map(k=>{let P=un(e,k,{contextId:n,prev:s});return{parsed:k,result:P,rendered:Hn(k,P,e)}});return{matches:[],objMatch:null,candidates:t.candidates,traversal:null,ambiguous:!0,branches:E}}let{shape:r,kind:i,entityType:a}=t;if(r==="meta"){let E=String(t.object||"").trim(),k=E.toLowerCase(),P=(e.individuals||[]).find(D=>{if(!Ef(D))return!1;if(String(D.label).toLowerCase()===k)return!0;let H=(D.attributes||[]).find(Y=>Y.key==="token")?.value;return H&&String(H).toLowerCase()===k});if(!P){let D=fy(e,E);return D?{matches:[D.hit],objMatch:D.hit,candidates:[],ambiguous:!1,metaCodeClass:!0,metaFallbackText:D.text,traversal:`schema lookup for "${E}" (miss), then unique code-entity individual by label`}:{matches:[],objMatch:null,candidates:[],traversal:`schema lookup for "${E}"`,ambiguous:!1}}return{matches:[P],objMatch:P,candidates:[],traversal:`schema lookup for "${E}"`,ambiguous:!1}}if(r==="mentions"){let E=String(t.object||"").trim();return{matches:(typeof Fo=="function"?Fo(e.proseIndex,E):[]).map(D=>e.byId.get(D.id)).filter(Boolean),objMatch:null,candidates:[],ambiguous:!1,mentionsShape:!0,traversal:`proseIndex word lookup for "${E}"`}}if(r==="where"&&gI.test(String(t.object||"").trim())){let E=yI(e,t.object);return{matches:E,objMatch:E[0]||null,candidates:E.slice(1,5),ambiguous:!1,entryPointShape:!0,traversal:`Module individuals with an entry-point basename (${[...Sf].join("/")}), ranked query-named basename first, then shallower path, then non-test path`}}if(t.modifier&&t.modifier!=="direct"&&!$I(r,i,a))return{matches:[],objMatch:null,candidates:[],ambiguous:!1,unsupportedModifier:!0,traversal:`modifier "${t.modifier}" requested for a "${i}" query \u2014 no closure traversal exists for this combination yet`};if(r==="ask"){let E=Ms(e,t.subject,n),k=Ms(e,t.object,n);if(!E.match||!k.match||E.ambiguous||k.ambiguous)return{matches:[],objMatch:k.match,candidates:k.candidates,traversal:null,ambiguous:!1,answer:null,unresolvedPronoun:!!(E.unresolvedPronoun||k.unresolvedPronoun)};let[P,D]=[E.match,k.match];i==="touches"&&D.class==="Commit"&&P.class!=="Commit"&&([P,D]=[D,P]);let H=Br[i],Y=[...new Set(H?[..._t(i),H]:_t(i))],J=Y.flatMap(L=>tt(e,L)).filter(L=>L.subject===P.id&&L.object===D.id);return{matches:J,answer:t.negated?J.length===0:J.length>0,objMatch:k.match,subjMatch:E.match,candidates:[],traversal:`${Y.join("+")} edge from ${P.label} to ${D.label}`,ambiguous:!1}}let c;if(o)c={match:o,candidates:[],ambiguous:!1,matchedVia:null};else{if(c=Ms(e,t.object,n),t.altObject&&t.altObject!==t.object){let E=Ms(e,t.altObject,n),k=!!c.match&&!c.ambiguous,P=!!E.match&&!E.ambiguous;!k&&P?c=E:k&&P&&c.match.id!==E.match.id&&(c={...c,ambiguous:!0,candidates:[E.match,...c.candidates||[]]})}if(t.kind==="tests"&&c.match&&!c.ambiguous&&!String(t.object||"").includes("/")){let E=D=>D.replace(/\.(?:test|spec|tests)(?=\.[^.]+$)/,""),k=E(String(t.object||"").trim().toLowerCase()),P=(e.individuals||[]).find(D=>{if(D.class!=="Module"||D.id===c.match.id)return!1;let H=String(D.label||"").toLowerCase().split("/").pop();return H!==E(H)&&E(H)===k});P&&(c={...c,ambiguous:!0,candidates:[P,...c.candidates||[]]})}}let{match:l,candidates:u,ambiguous:d,unresolvedPronoun:p,matchedVia:f,unplacedWords:m,nearestLabel:h}=c;if(!l)return{matches:[],objMatch:null,candidates:u,traversal:null,ambiguous:!1,unresolvedPronoun:p,unplacedWords:m,nearestLabel:h};if(d){let k=Sn([l,...u||[]]).slice(0,at).map(P=>{let D=un(e,t,{contextId:n,prev:s,pinnedObjMatch:P});return{candidate:P,result:D,rendered:Hn(t,D,e)}});return{matches:[],objMatch:l,candidates:u,traversal:null,ambiguous:!0,branches:k}}if(r==="where"){let E=(l.attributes||[]).find(k=>k.key==="site")?.value||null;return{matches:[l],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whereShape:!0,site:E,traversal:E?`site attribute of ${l.label}`:`class + defining module of ${l.label}`}}if(r==="when"){let E=D=>String((D.attributes||[]).find(H=>H.key==="date")?.value||""),k;if(l.class==="Commit")k=[l];else{let D=["touches","touchesSymbol"].flatMap(Y=>tt(e,Y)).filter(Y=>Y.object===l.id),H=new Set;k=[];for(let Y of D){if(H.has(Y.subject))continue;H.add(Y.subject);let J=e.byId.get(Y.subject);J&&J.class==="Commit"&&k.push(J)}k.sort((Y,J)=>E(J).localeCompare(E(Y)))}let P=k.length&&E(k[0])?[{kind:"event",class:"Commit",label:k[0].label,ids:[k[0].id],attrs:{date:E(k[0]).slice(0,10)},lane:"when"}]:[];return{matches:k,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whenShape:!0,referents:P,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit date first`}}if(r==="whoLast"){let E=Y=>String((Y.attributes||[]).find(J=>J.key==="date")?.value||""),k=["touches","touchesSymbol"].flatMap(Y=>tt(e,Y)).filter(Y=>Y.object===l.id),P=new Set,D=[];for(let Y of k){if(P.has(Y.subject))continue;P.add(Y.subject);let J=e.byId.get(Y.subject);J&&J.class==="Commit"&&D.push(J)}D.sort((Y,J)=>E(J).localeCompare(E(Y)));let H=D.length&&E(D[0])?[{kind:"event",class:"Commit",label:D[0].label,ids:[D[0].id],attrs:{date:E(D[0]).slice(0,10)},lane:"whoLast"}]:[];return{matches:D,objMatch:l,candidates:u,ambiguous:d,matchedVia:f,whoLastShape:!0,referents:H,traversal:`touches+touchesSymbol edges where object = ${l.label}, newest commit's author`}}if(i==="touches"&&l.class==="Commit")return _y(e,l,a,{candidates:u,ambiguous:d,matchedVia:f});if(r==="forward"){let E=Br[i],P=!!(E&&l.class&&io.has(l.class))?[...new Set([..._t(i),E])]:_t(i);if(a&&a!=="Change"){let K=cf(e,P),W=Ud[a];if(K.size&&!K.has(a)&&!(W&&K.has(W)))return{matches:[],objMatch:l,candidates:u,ambiguous:d,matchedVia:f,forwardGrainMiss:!0,wantClasses:[...K],traversal:`${P.join("+")} edges where subject = ${l.label} (grain mismatch: this "${i}" relation never targets a ${Ps(a)})`}}let H=P.flatMap(K=>tt(e,K)).filter(K=>K.subject===l.id).map(K=>e.byId.get(K.object)).filter(Boolean),Y=Sn(H),J=Y,L="";if(a&&a!=="Change"){J=Y.filter(W=>W.class===a);let K=Ud[a];if(!J.length&&K){let W=Y.filter(N=>N.class===K);W.length&&(J=W,L=`, widened to ${K} subjects (no ${a} recorded)`)}}return{matches:J,objMatch:l,candidates:u,traversal:`${P.join("+")} edges where subject = ${l.label}${L}`,ambiguous:d,matchedVia:f}}if(t.modifier==="transitive")return i==="inherits"?{matches:vI(e,l,i),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`subclass closure over inherits edges from ${l.label}`}:{matches:Nr(e,l,{maxDepth:Vw,includeCycleReturn:!0}).flat().map(P=>e.byId.get(P.id)).filter(Boolean),objMatch:l,candidates:u,ambiguous:d,matchedVia:f,traversal:`reverse dependency closure over imports+calls edges from ${l.label} (impactClosure, maxDepth=${Vw})`};let b=Br[i]||_t(i).find(E=>Yw.has(E))||null,g=!!(l.class&&io.has(l.class));if(b&&(io.has(a)||g)){let E=tt(e,b).filter(L=>L.object===l.id),k=Sn(E.map(L=>e.byId.get(L.subject)).filter(Boolean)),P=!a||a==="Change"?k:k.filter(L=>L.class===a),D="",H=Ud[a];if(!P.length&&H){let L=k.filter(K=>K.class===H);L.length&&(P=L,D=`, widened to ${H} subjects (no ${a} recorded)`)}let Y=(i==="touches"||i==="calls"||i==="uses")&&l.class==="Class"&&!tt(e,"contains").some(L=>L.subject===l.id),J=Y?e.byId.get(Vo(e,l)||""):null;if(P.length||!(Y&&J))return{matches:P,objMatch:l,candidates:u,traversal:`${b} edges where object = ${l.label}${D}`,ambiguous:d,matchedVia:f}}let w=l,y=u,v=d,R=f,S="",j=ey(e,i);if(j&&w.class&&w.class!==j){let E=En(e,t.object,{expectedClass:j});if(E.match&&!E.ambiguous)w=E.match,y=E.candidates,v=E.ambiguous,R=E.matchedVia;else if(j==="Module"){let k=Vo(e,w),P=k&&e.byId.get(k);if(P)S=`, refined from ${w.label} to its containing module`,w=P;else return{matches:[],objMatch:w,candidates:y,ambiguous:v,matchedVia:R,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ps(w.class)} ${w.label} (grain mismatch: this "${i}" question needs a ${Ps(j)}, and no containing module could be found to refine to)`}}else return{matches:[],objMatch:w,candidates:y,ambiguous:v,matchedVia:R,wrongGrainMiss:!0,wantClass:j,traversal:`"${t.object}" resolved to ${Ps(w.class)} ${w.label} (grain mismatch: this "${i}" question needs a ${Ps(j)})`}}let I=_t(i).flatMap(E=>tt(e,E)).filter(E=>E.object===w.id);i==="cochange"&&(I=I.concat(_t(i).flatMap(E=>tt(e,E)).filter(E=>E.subject===w.id).map(E=>({...E,subject:E.object,object:E.subject}))));let x="";if(!I.length&&w.class){let E=`ext:${String(w.label).toLowerCase()}`;I=_t(i).flatMap(k=>tt(e,k)).filter(k=>String(k.object).toLowerCase()===E),I.length&&(x=` (by name, via unresolved ${E} references)`)}let _=[],$=new Set;for(let E of I){let k=e.byId.get(E.subject);k&&!$.has(k.id)&&($.add(k.id),_.push(k))}let T,C="";if(!a||a==="Change")T=_;else{let E=_.filter(P=>P.class===a),k=E.length||!dy(i,a)?[]:uy(e,new Set([w.id]));if(E.length)T=E;else if(k.length)T=k,C=`, falling back to ${w.label}'s recorded source site (no defines edge)`;else if(a!=="Module"&&_.some(P=>P.class==="Module")){let P=new Set(_.filter(D=>D.class==="Module").map(D=>D.id));T=vf(e,P,a),C=`, then ${Ps(a)} defined in the matched module(s)`}else T=[]}return{matches:T,objMatch:w,candidates:y,traversal:`${_t(i).join("+")} edges where object = ${w.label}${x}${C}${S}`,ambiguous:v,matchedVia:R}}function uo(e){if(e.class==="Module")return e.label;let t=(e.attributes||[]).find(s=>s.key==="site")?.value;if(t)return String(t).split(":")[0];let n=String(e.id||"").match(/^fn:(.+)#/);return n?n[1]:null}function nf(e,t){let n=String(t||"").match(/^(.*):(\d+)(?:-(\d+))?$/);if(n){let o=n[3]&&n[3]!==n[2]?`lines ${n[2]}-${n[3]}`:`line ${n[2]}`;return`${sf(e)} is defined in ${n[1]} at ${o}.`}let s=uo(e);return s?`${sf(e)} is defined in ${s} (no line span recorded in this index).`:null}function sf(e){let t=String(e.label||e.id||"");return["Function","Method"].includes(e.class)?`function ${t}()`:t}function xI(e){let t=String(e.label||e.id||""),n=(e.attributes||[]).find(s=>s.key==="author")?.value;return n?`${t} (${n})`:t}function vn(e){return e.length>1?`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`:e[0]}function Di(e){let t=e.object??e.subject??"?";return`${e.entityType?de(e.entityType,2)+" that ":""}${e.kind} "${t}"`}function lo(e){return Io[e]?.bare||e}function Wr(e){return Sg(e)}function jI(e){let t=lo(e);return t.endsWith("e")?`${t}d`:`${t}ed`}function kI(e){if(!Array.isArray(e.atoms)||e.atoms.length!==2)return null;let[t,n]=e.atoms;if(t.op!=="seed"||t.ast?.node!=="allOfClass"||n.op!=="difference")return null;let s=de(e.entityType,2);if(n.kind==="qual")return`${s} that are not ${n.filters.join(" and not ")}`;if(n.kind!=="set"||!n.ast)return null;if(n.ast.node==="existsEdge")return`${s} that do not ${lo(n.ast.kind)} anything`;let o=n.ast.node==="clause"?n.ast.clause:n.ast;if(!o||o.node||!o.kind)return null;let r=o.object??o.subject;return r==null?null:`${s} that do not ${lo(o.kind)} ${JSON.stringify(String(r))}`}function Ty(e){if(!e)return null;if(e.ambiguousParse)return{english:`ambiguous: ${e.candidates.map(Di).join(" \u2014 or \u2014 ")}`,machine:`ambiguousParse(${e.candidates.map(r=>Ty(r)?.machine).join(", ")})`};if(e.node)return{english:(e.node==="boolean"?kI(e):null)||`a compositional query (${e.node})`,machine:`composite(${e.node})`};let t=r=>JSON.stringify(String(r??"")),n=[];e.kind&&n.push(e.kind),e.negated&&n.push("negated"),e.entityType&&n.push(`entityType=${e.entityType}`),e.modifier&&e.modifier!=="direct"&&n.push(`modifier=${e.modifier}`),e.subject!=null&&n.push(`subject=${t(e.subject)}`),e.object!=null&&n.push(t(e.object));let s=`${e.shape}(${n.join(", ")})`,o;if(e.shape==="ask")o=`does "${e.subject}" ${e.negated?"not ":""}${Uo(e.kind)} "${e.object}"?`;else if(e.shape==="meta")o=`what does "${e.object}" mean, in this graph's own vocabulary?`;else if(e.shape==="mentions")o=`where is "${e.object}" mentioned?`;else if(e.shape==="where")o=`where is "${e.object}" defined?`;else{let r=e.entityType?de(e.entityType,2)+" that ":"";o=e.shape==="forward"?`what "${e.object}" itself ${Uo(e.kind)}`:`${r}${Uo(e.kind)} "${e.object}"`}return{english:o,machine:s}}function Hn(e,t,n=null){let s=Ay(e,t,n);return t&&t.matchedVia==="fuzzy"&&t.objMatch&&!s.ambiguous&&(s.content=`assuming you meant ${t.objMatch.label}: ${s.content}`),s}function Ay(e,t,n){if(!e)return{content:`couldn't parse this as a graph question. Try: ${$f()}`,miss:!0,ambiguous:!1};if(e.node)return fI(e,t,n);if(e.ambiguousParse)return t.branches&&t.branches.length?{content:`this could mean more than one thing:
55
+ ${t.branches.map((c,l)=>`${l+1}) as ${Di(c.parsed)}: ${c.rendered.content}`).join(`
56
56
  `)}
57
- (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Li),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${Li(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Li),candidateParses:e.candidates};if(t.unresolvedPronoun)return{content:`"${e.object??e.subject}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.unsupportedModifier)return{content:`the "${e.modifier}" modifier isn't supported for "${e.kind}" queries yet \u2014 only imports/calls (module-level) have a transitive closure today.`,miss:!0,ambiguous:!1};if(t.wrongGrainMiss){let i=t.objMatch.class?de(t.objMatch.class,1):"term",a=de(t.wantClass,1);return{content:`"${e.object}" resolved to the ${i} ${t.objMatch.label}, but this question needs a ${a} \u2014 no ${a} named "${e.object}" was found in the index.`,miss:!0,ambiguous:!1}}if(t.forwardGrainMiss){let i=t.wantClasses.map(a=>de(a,2));return{content:`${t.objMatch.label}'s "${zo(e.kind)}" relation in this index never produces ${de(e.entityType,2)} \u2014 only ${yn(i)}.`,miss:!0,ambiguous:!1}}if(e.shape==="meta"){if(!t.objMatch)return{content:`"${e.object}" isn't a term in this graph's own vocabulary (no matching class or predicate).`,miss:!0,ambiguous:!1};if(t.metaCodeClass)return{content:t.metaFallbackText,miss:!1,ambiguous:!1,matches:t.matches};let i=bf(t.objMatch)||"";return{content:`${t.objMatch.label} is ${iI(t.objMatch.class)}: ${i}`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.mentionsShape){if(!t.matches.length)return{content:`"${e.object}" is not mentioned in any indexed identifier or doc-comment prose.`,miss:!0,ambiguous:!1};let i=t.matches.slice(0,ct).map(c=>`${c.label} (${de(c.class,1)})`),a=t.matches.length>ct?`, \u2026and ${t.matches.length-ct} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${yn(i)}${a}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.entryPointShape){if(!t.matches.length)return{content:`no entry-point module found in the index \u2014 no module basename matches ${yn([...gf])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,ct).map(d=>d.label),l=a.length>ct?`, \u2026and ${a.length-ct} more`:"",u=a.length?` \u2014 also matched: ${yn(c)}${l}`:"";return{content:`ranked ${t.matches.length} entry-point match${t.matches.length===1?"":"es"}; top: ${i.label}${u}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.objMatch&&(!t.candidates||t.candidates.length===0)&&e.shape!=="ask"){let i=String(e.object||"").trim(),a=e.entityType&&zd[e.entityType]?de(e.entityType,1):"module",c=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let l=yn(t.unplacedWords.map(p=>`"${p}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${c} matching "${e.object}" found in the index. ${l} ${u} nothing here, and reading past ${t.unplacedWords.length===1?"it":"them"} would answer a different question.${d}`,miss:!0,ambiguous:!1,candidates:[]}}return{content:`no ${c} matching "${e.object}" found in the index. ${oo(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(g=>g.class==="Commit")){let g=w=>!["Commit","Session","Source","Utterance"].includes(w?.class),y=i.filter(g);y.length&&(i=y,a?.length&&(a=a.filter(w=>g(w.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let g=String(e.object||"").toLowerCase(),y=new Set(Un(String(e.object||"")).filter(k=>k.length>=3)),w=new Set(i.map(k=>k.id)),E=null,R=0,v=1/0;if(y.size)for(let k of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(k.class)||w.has(k.id))continue;let I=Un(String(k.label)).filter(T=>y.has(T)).length;if(!I||I<R)continue;let x=Is(String(k.label).toLowerCase(),g,8);(I>R||x<v)&&(E=k,R=I,v=x)}if(E&&(i=[...i,E],a)){let k=cn(n,e,{pinnedObjMatch:E});a=[...a,{candidate:E,result:k,rendered:Gn(e,k,n)}]}}let c=i.length&&i.every(g=>g.class===i[0].class)?i[0].class:null,l=c?zd[c]?de(c,1):Ls(c):"module",u=i.slice(0,ct).map(g=>g.label),d=i.length>ct?`, \u2026and ${i.length-ct} more`:"",p=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${yn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,f=String(e.object||""),m=f?new RegExp(`\\b${at(f)}\\b`,"gi"):null,h=g=>{let y=String(g.candidate.label||"");return!m||!y?g.rendered.content:g.rendered.content.split(y).map(w=>w.replace(m,y)).join(y)};return{content:a&&a.length?`${p}
58
- ${a.map((g,y)=>`${y+1}) ${g.candidate.label}: ${h(g)}`).join(`
59
- `)}`:p,miss:!1,ambiguous:!0,candidates:i.map(g=>g.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=Xd(i,t.site);return a?{content:a,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${oo(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(p=>p.key==="date")?.value||"";if(!c)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let l=(a.attributes||[]).find(p=>p.key==="message")?.value||"",u=String(c).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${Oi("is-dated",a.id,"is dated")} ${u}${l?` ("${l}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${l?` ("${l}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${oo(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!c)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let l=t.matches.length-1;return{content:`${i} was last touched by ${c} (commit ${a.label})${l?`; ${l} earlier commit${l===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,ct)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let c=[...a.entries()].map(([u,d])=>`${de(u,d.length)} ${yn(d)}`),l=t.matches.length>ct?`; \u2026and ${t.matches.length-ct} more`:"";return{content:`${i} touched ${c.join("; ")}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,c=e.negated?a:i,l=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?c:l}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(jr.includes(e.kind)&&n&&t.objMatch)for(let l of jr){if(l===e.kind)continue;let u={...e,kind:l},d=cn(n,u,{pinnedObjMatch:t.objMatch});if(d?.matches?.length&&!d.ambiguous)return xy(u,d,n)}return{content:`${t.objMatch.label} has no ${zo(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(kA,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?de(e.entityType,2):(()=>{let l=[...tf(n,Tt(e.kind))];return l.length===1?de(l[0],2):l.length>1?l.map(u=>de(u,2)).join(" or "):de("Module",2)})(),a=t.objMatch&&Io.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object,c=e.modifier==="transitive"?"transitively":"directly";return{content:`No ${i} found whose module ${c} ${zo(e.kind)} ${a}. ${oo(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${cI(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!ro.has(i.class))){let i=t.matches.slice(0,ct).map(c=>c.class==="Commit"?aI(c):c.label),a=t.matches.length>ct?`, \u2026and ${t.matches.length-ct} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,ct)){let a=lo(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(Jd(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=yn(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>ct?` \u2026and ${t.matches.length-ct} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function ky(e){if(e.length<4||fI.has(e))return null;let t=Os(e),n=t+1,s=null,o=!1;for(let r of dI){let i=Is(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function zw(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!bf(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=ky(n);return!!s&&s!==n&&!!nt[s]}function Ry(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=Ps(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||zw(s,t.object))return!1;if(t.shape==="ask"){let o=Ps(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!zw(o,t.subject))}return!0}function pI(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return xg.includes(t)}function mI(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=_i(Do(String(t||""))),i=an(r);if(!i.length)return null;let a=[],c=[],l=$=>{let _=vn(e,$);return!!_.match&&_.tier!=null&&_.tier<=2},u=$=>{let _=vn(e,$);return!!_.match&&_.tier!=null&&_.tier<=3},d=$=>{let _=String($||"").trim().toLowerCase();return Io.includes(_)?!0:an(_).some(C=>{let S=C.toLowerCase();return!xc.has(S)&&!Qd.has(S)})},p=new Set(["reverse","forward","where","when","ask"]),f=$=>{let _=$.join(" "),C=Uo(_,{nlp:n});return Ry(e,C,s)!==!0||C&&!C.node&&p.has(C.shape)&&(C.object!=null&&!d(C.object)||C.shape==="ask"&&C.subject!=null&&!d(C.subject))||Gn(C,cn(e,C,{contextId:s,prev:o}),e).miss?null:{parsed:C,text:_}},m=$=>({parsed:$.parsed,from:r,to:$.text,dropped:[...a],steps:c}),h=0,b=Math.max(i.length,1)+12;for(;h<b;h+=1){let $=-1;for(let S=0;S<i.length;S+=1){let j=i[S].toLowerCase();if(wf.has(j)&&!xc.has(j)&&!l(i[S])){$=S;break}}if($<0)break;let _=i[$];i=i.filter((S,j)=>j!==$),a.push(_),c.push(`strip noise "${_}" \u2192 "${i.join(" ")}"`);let C=f(i);if(C)return m(C)}let g=Uo(i.join(" "),{nlp:n}),y=new Set;if(g&&!g.node&&p.has(g.shape))for(let $ of[g.object,g.subject])for(let _ of an(String($||"").toLowerCase()))y.add(_);let w=[],E=[],R=[];for(let $ of i){let _=$.toLowerCase();if(!/^[a-z]+$/.test(_)||xc.has(_)||Qd.has(_)||u($)){w.push($);continue}let S=ky(_);if(S&&S!==_){w.push(S),R.push(`${$}\u2192${S}`);continue}if(y.has(_)){w.push($);continue}E.push($)}if((R.length||E.length)&&w.length){i=w,a.push(...E),R.length&&c.push(`fuzzy-correct ${JSON.stringify(R)} \u2192 "${i.join(" ")}"`),E.length&&c.push(`drop unmatched ${JSON.stringify(E)} \u2192 "${i.join(" ")}"`);let $=f(i);if($)return m($)}let v=!1,k=i.map($=>{let _=$.toLowerCase();return kr[_]&&!u($)?(v=!0,kr[_]):$});if(v){c.push(`normalise synonyms \u2192 "${k.join(" ")}"`);let $=f(k);if($)return m($)}let I=an(r).map($=>$.toLowerCase()),x=[],T=[];for(let $ of I){if(jy.has($))continue;let _=nt[$];_&&_!=="Change"?x.push($):T.push($)}if(x.length===1&&T.length===0){let $=f(["count",x[0]]);if($)return c.push(`bare kind "${x[0]}" \u2192 count`),m($)}return null}function gI(e,t){let n=String(t||"");if(!e||!Bw.test(n))return n;let s=e.individuals.filter(c=>c.class==="Commit");if(!s.length)return n;let o=c=>String((c.attributes||[]).find(l=>l.key==="date")?.value||""),r=[...s].sort((c,l)=>o(l).localeCompare(o(c)))[0];if(!r)return n;let i=n.replace(Bw,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return hI.test(a)?`${a} touched`:i}function bI(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function yf(e,t){let n=bI(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function $I(e,t){let n=String(t||"").trim(),s=n.match(wI),o=s?null:n.match(yI),r=s||o;if(!r||!$f.test(r[2]||"")||nt[r[1].toLowerCase()])return null;let i=yf(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function vI(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=yf(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function jI(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function kI(e,t){let n=Ga(String(t||"").trim()),s=n.match(SI),o=s?mg[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(EI)?.[1]||n.match(xI)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Co[o].predicate},a=vI(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=jI(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function RI(e,t){return Co[e].matchesLocativePredicates?xr(Fi(t.prop))||xr(Fi(t.predicate)):null}function _I(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Co[t.relation],r=Fi(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=Fi(l.prop),d=Fi(l.predicate),p=u===r||d===r,f=p?null:RI(t.relation,l);if(!(!p&&!f))for(let m of l.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let g={subject:h,object:m.object,reads:p?o.reads:`is ${f}`};p?i.set(m.subject,g):a.set(`${u||d}\0${m.subject}`,g)}}let c=[...i.values(),...[...a.values()].filter(l=>!i.has(l.subject.id))].sort((l,u)=>String(l.subject.id).localeCompare(String(u.subject.id))||String(l.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:c,matches:c.map(l=>l.subject)}}function Dd(e){let t=TI.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function CI(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Dd(a.subject).base,String(a.object));let s=new Set(hg),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:c,epoch:l,stamp:u}=Dd(a.subject),d=n.get(c)||t(c);if(!d)continue;let p=`${a.predicate}\0${c}`;AI(r.get(p),l,u)&&(o.set(c,{id:c,label:c,class:d}),r.set(p,{epoch:l,stamp:u,predicate:a.predicate,subject:c,object:Dd(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function NI(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=yf(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(c=>c.id));if(i.size<2)return!1;let a=new Map;for(let c of e?.individuals||[])c?.id&&(a.has(c.id)||a.set(c.id,new Set),a.get(c.id).add(c.class));return[...i].every(c=>c===o||a.get(c)?.has(o))}function LI(e,t){return t?.class?t.class==="Module"||t.class==="File"?!0:!!Wo(e,t):!1}function PI(e,t){let n=ki(t);if(!n)return null;let s=vn(e,n),o=s?.ambiguous?null:s?.match;return!o||o.class!=="Class"?null:`which classes transitively inherit from ${o.label}`}function FI(e,t){let n=Ri(String(t||"")).trim();if(ki(n)||Rd(n)!==n)return null;let s=n.match(MI);if(!s)return null;let o=vn(e,s[1].trim()),r=o?.ambiguous?null:o?.match;if(!r||!LI(e,r))return null;let i=r.class==="Class"?"what inherits from it":r.class==="Module"||r.class==="File"?"what imports or calls it":"what calls it";return{content:`I can't answer that \u2014 the index records what is, not what would be. What it can read about ${r.label}: "what would break if ${r.label} were deleted" (${i}), or "/describe ${r.label}" for the facts it holds.`,tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,relaxed:null}}}function uo(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(pI(t))return{content:mf(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};let r=FI(e,t);if(r)return r;t=PI(e,t)||t,t=gI(e,t);let i=Zd(t,{nlp:s}),a=i.parsed,c=a,l=null;if(Ry(e,a,n)===!1){let f=mI(e,t,{nlp:s,contextId:n,prev:o});f&&(c=f.parsed,l={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let u=cn(e,c,{contextId:n,prev:o}),d=Gn(c,u,e);if(Uw(e,c,u,d)){let f=$I(e,t);if(f){let m=cn(e,f,{contextId:n,prev:o}),h=Gn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(Uw(e,c,u,d)){let f=kI(e,t);if(f){let m=cn(e,f,{contextId:n,prev:o}),h=Gn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(c===null&&d.miss&&!d.ambiguous){let m=Ri(String(t||"")).trim().match(II)?.[1]?.trim();if(m&&!/\s+(?:for|about)$/i.test(m)){let h=Uo(`what is a ${m}`,{nlp:s});h?.shape==="meta"&&(u=cn(e,h,{contextId:n,prev:o}),d=Gn(h,u,e))}}if(c===null&&d.miss&&!d.ambiguous){let m=Do(String(t||"")).match(OI)?.[1]?.trim();if(m){let h=Uo(`what is a ${m}`,{nlp:s});if(h?.shape==="meta"){let b=cn(e,h,{contextId:n,prev:o}),g=Gn(h,b,e);!g.miss&&!g.ambiguous&&(u=b,d=g)}}}let p=l&&!d.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${d.content}`:d.content;if(!l&&!d.miss&&!d.ambiguous&&i.alternates.length){let f=i.alternates.map(m=>{let h=cn(e,m.parsed,{contextId:n,prev:o}),b=Gn(m.parsed,h,e);return b.miss?null:{a:m,text:b.content}}).filter(Boolean);if(f.length){let m=$w(f.map(h=>h.a),{answerFor:h=>f.find(b=>b.a===h)?.text||null});p=`${p}
57
+ (ask one of these directly, or try rephrasing more specifically, to get just that reading)`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Di),candidateParses:e.candidates}:{content:`this could mean more than one thing: ${e.candidates.map((a,c)=>`${c+1}) ${Di(a)}`).join(" or ")} \u2014 try rephrasing more specifically.`,miss:!1,ambiguous:!0,candidates:e.candidates.map(Di),candidateParses:e.candidates};if(t.unresolvedPronoun)return{content:`"${e.object??e.subject}" needs a selected node to refer to \u2014 click a node first, or name it directly.`,miss:!0,ambiguous:!1};if(t.unsupportedModifier)return{content:`the "${e.modifier}" modifier isn't supported for "${e.kind}" queries yet \u2014 only imports/calls (module-level) have a transitive closure today.`,miss:!0,ambiguous:!1};if(t.wrongGrainMiss){let i=t.objMatch.class?de(t.objMatch.class,1):"term",a=de(t.wantClass,1);return{content:`"${e.object}" resolved to the ${i} ${t.objMatch.label}, but this question needs a ${a} \u2014 no ${a} named "${e.object}" was found in the index.`,miss:!0,ambiguous:!1}}if(t.forwardGrainMiss){let i=t.wantClasses.map(a=>de(a,2));return{content:`${t.objMatch.label}'s "${Uo(e.kind)}" relation in this index never produces ${de(e.entityType,2)} \u2014 only ${vn(i)}.`,miss:!0,ambiguous:!1}}if(e.shape==="meta"){if(!t.objMatch)return{content:`"${e.object}" isn't a term in this graph's own vocabulary (no matching class or predicate).`,miss:!0,ambiguous:!1};if(t.metaCodeClass)return{content:t.metaFallbackText,miss:!1,ambiguous:!1,matches:t.matches};let i=Ef(t.objMatch)||"";return{content:`${t.objMatch.label} is ${EI(t.objMatch.class)}: ${i}`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.mentionsShape){if(!t.matches.length)return{content:`"${e.object}" is not mentioned in any indexed identifier or doc-comment prose.`,miss:!0,ambiguous:!1};let i=t.matches.slice(0,at).map(c=>`${c.label} (${de(c.class,1)})`),a=t.matches.length>at?`, \u2026and ${t.matches.length-at} more`:"";return{content:`"${e.object}" is mentioned in the prose tokens of ${vn(i)}${a}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.entryPointShape){if(!t.matches.length)return{content:`no entry-point module found in the index \u2014 no module basename matches ${vn([...Sf])}.`,miss:!0,ambiguous:!1,candidates:[]};let[i,...a]=t.matches,c=a.slice(0,at).map(d=>d.label),l=a.length>at?`, \u2026and ${a.length-at} more`:"",u=a.length?` \u2014 also matched: ${vn(c)}${l}`:"";return{content:`ranked ${t.matches.length} entry-point match${t.matches.length===1?"":"es"}; top: ${i.label}${u}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(!t.objMatch&&(!t.candidates||t.candidates.length===0)&&e.shape!=="ask"){let i=String(e.object||"").trim(),a=e.entityType&&Kd[e.entityType]?de(e.entityType,1):"module",c=/^(?:commit[:\s])?[0-9a-f]{7,40}$/i.test(i)?"commit":!i.includes("/")&&/^[\w$]+(\.[\w$]+)+$/.test(i)?"symbol":a;if(t.unplacedWords?.length){let l=vn(t.unplacedWords.map(p=>`"${p}"`)),u=t.unplacedWords.length===1?"names":"name",d=t.nearestLabel?` Did you mean ${t.nearestLabel}?`:"";return{content:`no ${c} matching "${e.object}" found in the index. ${l} ${u} nothing here, and reading past ${t.unplacedWords.length===1?"it":"them"} would answer a different question.${d}`,miss:!0,ambiguous:!1,candidates:[]}}return{content:`no ${c} matching "${e.object}" found in the index. ${ro(n)}`,miss:!0,ambiguous:!1,candidates:[]}}if(t.ambiguous){let i=[t.objMatch,...t.candidates||[]].filter(Boolean),a=t.branches;if(e.kind&&e.kind!=="touches"&&!i.every(g=>g.class==="Commit")){let g=y=>!["Commit","Session","Source","Utterance"].includes(y?.class),w=i.filter(g);w.length&&(i=w,a?.length&&(a=a.filter(y=>g(y.candidate))))}if(n&&!/[/.]/.test(String(e.object||""))){let g=String(e.object||"").toLowerCase(),w=new Set(Vn(String(e.object||"")).filter(j=>j.length>=3)),y=new Set(i.map(j=>j.id)),v=null,R=0,S=1/0;if(w.size)for(let j of n.individuals){if(!["Function","Method","Class","GlobalVariable","Attribute"].includes(j.class)||y.has(j.id))continue;let I=Vn(String(j.label)).filter(_=>w.has(_)).length;if(!I||I<R)continue;let x=Os(String(j.label).toLowerCase(),g,8);(I>R||x<S)&&(v=j,R=I,S=x)}if(v&&(i=[...i,v],a)){let j=un(n,e,{pinnedObjMatch:v});a=[...a,{candidate:v,result:j,rendered:Hn(e,j,n)}]}}let c=i.length&&i.every(g=>g.class===i[0].class)?i[0].class:null,l=c?Kd[c]?de(c,1):Ps(c):"module",u=i.slice(0,at).map(g=>g.label),d=i.length>at?`, \u2026and ${i.length-at} more`:"",p=`"${e.object}" matches more than one ${l} ambiguously \u2014 did you mean ${vn(u)}${d}? Try one of those. If you're not sure, narrow it to one name.`,f=String(e.object||""),m=f?new RegExp(`\\b${it(f)}\\b`,"gi"):null,h=g=>{let w=String(g.candidate.label||"");return!m||!w?g.rendered.content:g.rendered.content.split(w).map(y=>y.replace(m,w)).join(w)};return{content:a&&a.length?`${p}
58
+ ${a.map((g,w)=>`${w+1}) ${g.candidate.label}: ${h(g)}`).join(`
59
+ `)}`:p,miss:!1,ambiguous:!0,candidates:i.map(g=>g.label)}}if(t.whereShape){let i=t.objMatch;if(i.class==="Module")return{content:`${i.label} is a module \u2014 the label is its repo path.`,miss:!1,ambiguous:!1,matches:t.matches};if(i.class==="Commit")return{content:`${i.label} is a commit, not a code location \u2014 try "what did commit ${i.label} touch".`,miss:!0,ambiguous:!1};let a=nf(i,t.site);return a?{content:a,miss:!1,ambiguous:!1,matches:t.matches}:{content:`${i.label} has no recorded code location in this index \u2014 it carries no source site, and nothing places it in a module.`,miss:!0,ambiguous:!1}}if(t.whenShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${ro(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(p=>p.key==="date")?.value||"";if(!c)return{content:`commit ${a.label} touched ${i}, but this index records no commit dates \u2014 regenerate the graph to attach mgx:commitDate.`,miss:!0,ambiguous:!1};let l=(a.attributes||[]).find(p=>p.key==="message")?.value||"",u=String(c).slice(0,10);if(a.id===t.objMatch.id)return{content:`commit ${a.label} ${Mi("is-dated",a.id,"is dated")} ${u}${l?` ("${l}")`:""}.`,miss:!1,ambiguous:!1,matches:t.matches};let d=t.matches.length-1;return{content:`${i} was last touched by commit ${a.label} on ${u}${l?` ("${l}")`:""}${d?`; ${d} earlier commit${d===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.whoLastShape){let i=t.objMatch.label;if(!t.matches.length)return{content:`no recorded commit touches ${i} in this index. ${ro(n)}`,miss:!0,ambiguous:!1};let a=t.matches[0],c=(a.attributes||[]).find(u=>u.key==="author")?.value;if(!c)return{content:`commit ${a.label} last touched ${i}, but this index records no commit author \u2014 regenerate the graph to attach mgx:commitAuthor.`,miss:!0,ambiguous:!1};let l=t.matches.length-1;return{content:`${i} was last touched by ${c} (commit ${a.label})${l?`; ${l} earlier commit${l===1?"":"s"} recorded`:""}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(t.commitSubject){let i=`commit ${t.objMatch.label}`;if(!t.matches.length)return{content:`${i} touched nothing recorded in the index.`,miss:!0,ambiguous:!1};let a=new Map;for(let u of t.matches.slice(0,at)){let d=u.class||"Module";a.has(d)||a.set(d,[]),a.get(d).push(["Function","Method"].includes(d)?`${u.label}()`:u.label)}let c=[...a.entries()].map(([u,d])=>`${de(u,d.length)} ${vn(d)}`),l=t.matches.length>at?`; \u2026and ${t.matches.length-at} more`:"";return{content:`${i} touched ${c.join("; ")}${l}.`,miss:!1,ambiguous:!1,matches:t.matches}}if(e.shape==="ask"){if(!t.objMatch||!t.subjMatch)return{content:"couldn't resolve one of the terms in this question.",miss:!0,ambiguous:!1};let i=`${t.traversal}.`,a=`no ${e.kind} edge found from ${t.subjMatch.label} to ${t.objMatch.label}.`,c=e.negated?a:i,l=e.negated?i:a;return{content:`${t.answer?"Yes":"No"} \u2014 ${t.answer?c:l}`,miss:!t.matches.length,ambiguous:!1}}if(!t.matches.length){if(e.shape==="forward"){if(Rr.includes(e.kind)&&n&&t.objMatch)for(let l of Rr){if(l===e.kind)continue;let u={...e,kind:l},d=un(n,u,{pinnedObjMatch:t.objMatch});if(d?.matches?.length&&!d.ambiguous)return Ay(u,d,n)}return{content:`${t.objMatch.label} has no ${Uo(e.kind)} edges in the index.`,miss:!0,ambiguous:!1}}if(e.kind==="tests"&&!e.entityType)return{content:`No tests cover ${String(e.object||"").replace(WA,"").trim()||String(e.object||"").trim()}.`,miss:!0,ambiguous:!1};let i=e.entityType?de(e.entityType,2):(()=>{let l=[...cf(n,_t(e.kind))];return l.length===1?de(l[0],2):l.length>1?l.map(u=>de(u,2)).join(" or "):de("Module",2)})(),a=t.objMatch&&No.includes(String(e.object||"").toLowerCase())?t.objMatch.label:e.object,c=e.modifier==="transitive"?"transitively":"directly";return{content:`No ${i} found whose module ${c} ${Uo(e.kind)} ${a}. ${ro(n)}`,miss:!0,ambiguous:!1}}if(e.polar&&t.matches.length===1)return{content:`Yes \u2014 ${t.objMatch?.label||e.object} is ${jI(e.kind)} by ${t.matches[0].label}.`,miss:!1,ambiguous:!1,matches:t.matches};if(e.shape==="forward"||e.entityType==="Module"||t.matches.every(i=>!io.has(i.class))){let i=t.matches.slice(0,at).map(c=>c.class==="Commit"?xI(c):c.label),a=t.matches.length>at?`, \u2026and ${t.matches.length-at} more`:"";return{content:i.join(" and ")+a+".",miss:!1,ambiguous:!1,matches:t.matches}}let s=new Map;for(let i of t.matches.slice(0,at)){let a=uo(i)||"no recorded module";s.has(a)||s.set(a,[]),s.get(a).push(sf(i))}let o=[...s.entries()].map(([i,a],c)=>{let l=vn(a);return c===0?`in ${i} there is ${l}`:`there is ${l} in ${i}`}),r=t.matches.length>at?` \u2026and ${t.matches.length-at} more`:"";return{content:o.join(" and ")+r+".",miss:!1,ambiguous:!1,matches:t.matches}}function Iy(e){if(e.length<4||TI.has(e))return null;let t=Ns(e),n=t+1,s=null,o=!1;for(let r of _I){let i=Os(e,r,Math.min(n,t));i<n?(n=i,s=r,o=!1):i===n&&i<=t&&r!==s&&(o=!0)}return n<=t&&!o?s:null}function Kw(e,t){if(!e?.match||e.matchedVia!=="fuzzy"||e.ambiguous||!Ef(e.match))return!1;let n=String(t||"").trim().toLowerCase(),s=Iy(n);return!!s&&s!==n&&!!nt[s]}function Oy(e,t,n){if(!t)return!1;if(t.ambiguousParse)return"ambiguous";if(t.node)return t.node!=="miss";if(t.shape==="meta"||t.shape==="mentions")return!0;let s=Ms(e,t.object,n);if(s.unresolvedPronoun)return"pronoun";if(!s.match||Kw(s,t.object))return!1;if(t.shape==="ask"){let o=Ms(e,t.subject,n);return o.unresolvedPronoun?"pronoun":!!(o.match&&!Kw(o,t.subject))}return!0}function AI(e){let t=String(e||"").trim().toLowerCase().replace(/[?.!\s]+$/,"");return Ag.includes(t)}function CI(e,t,{nlp:n=void 0,contextId:s=null,prev:o=null}={}){let r=Ii(Bo(String(t||""))),i=ln(r);if(!i.length)return null;let a=[],c=[],l=$=>{let T=En(e,$);return!!T.match&&T.tier!=null&&T.tier<=2},u=$=>{let T=En(e,$);return!!T.match&&T.tier!=null&&T.tier<=3},d=$=>{let T=String($||"").trim().toLowerCase();return No.includes(T)?!0:ln(T).some(C=>{let E=C.toLowerCase();return!kc.has(E)&&!of.has(E)})},p=new Set(["reverse","forward","where","when","ask"]),f=$=>{let T=$.join(" "),C=Go(T,{nlp:n});return Oy(e,C,s)!==!0||C&&!C.node&&p.has(C.shape)&&(C.object!=null&&!d(C.object)||C.shape==="ask"&&C.subject!=null&&!d(C.subject))||Hn(C,un(e,C,{contextId:s,prev:o}),e).miss?null:{parsed:C,text:T}},m=$=>({parsed:$.parsed,from:r,to:$.text,dropped:[...a],steps:c}),h=0,b=Math.max(i.length,1)+12;for(;h<b;h+=1){let $=-1;for(let E=0;E<i.length;E+=1){let k=i[E].toLowerCase();if(xf.has(k)&&!kc.has(k)&&!l(i[E])){$=E;break}}if($<0)break;let T=i[$];i=i.filter((E,k)=>k!==$),a.push(T),c.push(`strip noise "${T}" \u2192 "${i.join(" ")}"`);let C=f(i);if(C)return m(C)}let g=Go(i.join(" "),{nlp:n}),w=new Set;if(g&&!g.node&&p.has(g.shape))for(let $ of[g.object,g.subject])for(let T of ln(String($||"").toLowerCase()))w.add(T);let y=[],v=[],R=[];for(let $ of i){let T=$.toLowerCase();if(!/^[a-z]+$/.test(T)||kc.has(T)||of.has(T)||u($)){y.push($);continue}let E=Iy(T);if(E&&E!==T){y.push(E),R.push(`${$}\u2192${E}`);continue}if(w.has(T)){y.push($);continue}v.push($)}if((R.length||v.length)&&y.length){i=y,a.push(...v),R.length&&c.push(`fuzzy-correct ${JSON.stringify(R)} \u2192 "${i.join(" ")}"`),v.length&&c.push(`drop unmatched ${JSON.stringify(v)} \u2192 "${i.join(" ")}"`);let $=f(i);if($)return m($)}let S=!1,j=i.map($=>{let T=$.toLowerCase();return _r[T]&&!u($)?(S=!0,_r[T]):$});if(S){c.push(`normalise synonyms \u2192 "${j.join(" ")}"`);let $=f(j);if($)return m($)}let I=ln(r).map($=>$.toLowerCase()),x=[],_=[];for(let $ of I){if(Cy.has($))continue;let T=nt[$];T&&T!=="Change"?x.push($):_.push($)}if(x.length===1&&_.length===0){let $=f(["count",x[0]]);if($)return c.push(`bare kind "${x[0]}" \u2192 count`),m($)}return null}function OI(e,t){let n=String(t||"");if(!e||!Hw.test(n))return n;let s=e.individuals.filter(c=>c.class==="Commit");if(!s.length)return n;let o=c=>String((c.attributes||[]).find(l=>l.key==="date")?.value||""),r=[...s].sort((c,l)=>o(l).localeCompare(o(c)))[0];if(!r)return n;let i=n.replace(Hw,`commit ${r.label}`),a=i.trim().replace(/[?.!]+$/,"");return II.test(a)?`${a} touched`:i}function NI(e){let t=String(e||"").toLowerCase(),n=new Set([t]);return t.endsWith("ies")&&n.add(`${t.slice(0,-3)}y`),(t.endsWith("ses")||t.endsWith("es"))&&n.add(t.slice(0,-2)),t.endsWith("s")&&t.length>1&&n.add(t.slice(0,-1)),[...n]}function jf(e,t){let n=NI(t);for(let s of e?.individuals||[])if(s?.class&&n.includes(String(s.class).toLowerCase()))return s.class;return null}function MI(e,t){let n=String(t||"").trim(),s=n.match(LI),o=s?null:n.match(PI),r=s||o;if(!r||!kf.test(r[2]||"")||nt[r[1].toLowerCase()])return null;let i=jf(e,r[1]);if(!i)return null;let a={node:"allOfClass",entityType:i};return s?{node:"list",entityType:i,base:a,scoped:!1}:{node:"count",entityType:i,base:a}}function FI(e,t){let n=String(t||"").split(/\s*,\s*|\s+and\s+/i).map(r=>r.trim()).filter(Boolean);if(!n.length)return null;let s=[],o=[];for(let r of n){let i=r.replace(/^(?:all\s+)?(?:the\s+)?/i,"").trim();if(!/^[a-z][a-z'-]*$/i.test(i))return null;let a=jf(e,i);if(!a)return null;s.push(i.toLowerCase()),o.push(a)}return{asked:[...new Set(s)],classes:[...new Set(o)]}}function UI(e,t){let n=String(t||"").trim().toLowerCase();if(!n)return null;let s=new Set;for(let o of e?.individuals||[])o?.id&&(String(o.id).toLowerCase()===n||String(o.label||"").toLowerCase()===n)&&s.add(o.id);return s.size===1?[...s][0]:null}function WI(e,t){let n=Ha(String(t||"").trim()),s=n.match(DI),o=s?$g[s[1].toLowerCase()]:"placement";if(!o)return null;let r=s?s[2]:n.match(zI)?.[1]||n.match(BI)?.[1];if(!r)return null;let i={node:"worldRelation",relation:o,predicate:Oo[o].predicate},a=FI(e,r);if(a)return{...i,classes:a.classes,asked:a.asked};let c=UI(e,r);return c?{...i,subjects:[c],asked:[c]}:null}function GI(e,t){return Oo[e].matchesLocativePredicates?kr(Ui(t.prop))||kr(Ui(t.predicate)):null}function VI(e,t){let n=t.classes?new Set(t.classes):null,s=t.subjects?new Set(t.subjects):null,o=Oo[t.relation],r=Ui(o.predicate),i=new Map,a=new Map;for(let l of e?.relations||[]){let u=Ui(l.prop),d=Ui(l.predicate),p=u===r||d===r,f=p?null:GI(t.relation,l);if(!(!p&&!f))for(let m of l.edges||[]){let h=e.byId?.get(m.subject);if(!h||!(s?s.has(m.subject):n.has(h.class)))continue;let g={subject:h,object:m.object,reads:p?o.reads:`is ${f}`};p?i.set(m.subject,g):a.set(`${u||d}\0${m.subject}`,g)}}let c=[...i.values(),...[...a.values()].filter(l=>!i.has(l.subject.id))].sort((l,u)=>String(l.subject.id).localeCompare(String(u.subject.id))||String(l.object).localeCompare(String(u.object)));return{compositeKind:"worldRelation",relation:t.relation,asked:t.asked,pairs:c,matches:c.map(l=>l.subject)}}function Vd(e){let t=KI.exec(String(e??""));return t?{base:t[1],epoch:t[2]?Number(t[2]):0,stamp:Number(t[3])}:{base:String(e??""),epoch:0,stamp:0}}function qI(e,{classOf:t=()=>null}={}){let n=new Map;for(let a of e||[])a?.predicate==="rdf:type"&&a.subject&&a.object&&n.set(Vd(a.subject).base,String(a.object));let s=new Set(vg),o=new Map,r=new Map;for(let a of e||[]){if(!a?.subject||!s.has(a.predicate))continue;let{base:c,epoch:l,stamp:u}=Vd(a.subject),d=n.get(c)||t(c);if(!d)continue;let p=`${a.predicate}\0${c}`;HI(r.get(p),l,u)&&(o.set(c,{id:c,label:c,class:d}),r.set(p,{epoch:l,stamp:u,predicate:a.predicate,subject:c,object:Vd(a.object).base}))}let i=new Map;for(let a of r.values())i.has(a.predicate)||i.set(a.predicate,{prop:a.predicate,predicate:a.predicate,examples:[]}),i.get(a.predicate).examples.push({subject:a.subject,object:a.object});return{individuals:[...o.values()],objectProperties:[...i.values()]}}function JI(e,t,n){let s=String(t?.object||"").trim();if(!s)return!1;let o=jf(e,s);if(!o)return!1;let r=[n.objMatch,...n.candidates||[]].filter(Boolean),i=new Set(r.map(c=>c.id));if(i.size<2)return!1;let a=new Map;for(let c of e?.individuals||[])c?.id&&(a.has(c.id)||a.set(c.id,new Set),a.get(c.id).add(c.class));return[...i].every(c=>c===o||a.get(c)?.has(o))}function QI(e,t){return t?.class?t.class==="Module"||t.class==="File"?!0:!!Vo(e,t):!1}function ZI(e,t){let n=Ai(t);if(!n)return null;let s=En(e,n),o=s?.ambiguous?null:s?.match;return!o||o.class!=="Class"?null:`which classes transitively inherit from ${o.label}`}function tO(e,t){let n=Ci(String(t||"")).trim();if(Ai(n)||Od(n)!==n)return null;let s=n.match(eO);if(!s)return null;let o=En(e,s[1].trim()),r=o?.ambiguous?null:o?.match;if(!r||!QI(e,r))return null;let i=r.class==="Class"?"what inherits from it":r.class==="Module"||r.class==="File"?"what imports or calls it":"what calls it";return{content:`I can't answer that \u2014 the index records what is, not what would be. What it can read about ${r.label}: "what would break if ${r.label} were deleted" (${i}), or "/describe ${r.label}" for the facts it holds.`,tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,relaxed:null}}}function fo(e,t,{contextId:n=null,nlp:s=void 0,prev:o=null}={}){if(AI(t))return{content:$f(),tmct_ask:{mechanical:!0,parsed:null,canonical:null,matches:[],traversal:null,miss:!0,ambiguous:!1,matchedVia:null,help:!0,relaxed:null}};let r=tO(e,t);if(r)return r;t=ZI(e,t)||t,t=OI(e,t);let i=rf(t,{nlp:s}),a=i.parsed,c=a,l=null;if(Oy(e,a,n)===!1){let f=CI(e,t,{nlp:s,contextId:n,prev:o});f&&(c=f.parsed,l={from:f.from,to:f.to,dropped:f.dropped,steps:f.steps})}let u=un(e,c,{contextId:n,prev:o}),d=Hn(c,u,e);if(qw(e,c,u,d)){let f=MI(e,t);if(f){let m=un(e,f,{contextId:n,prev:o}),h=Hn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(qw(e,c,u,d)){let f=WI(e,t);if(f){let m=un(e,f,{contextId:n,prev:o}),h=Hn(f,m,e);h.miss||(c=f,u=m,d=h,l=null)}}if(c===null&&d.miss&&!d.ambiguous){let m=Ci(String(t||"")).trim().match(YI)?.[1]?.trim();if(m&&!/\s+(?:for|about)$/i.test(m)){let h=Go(`what is a ${m}`,{nlp:s});h?.shape==="meta"&&(u=un(e,h,{contextId:n,prev:o}),d=Hn(h,u,e))}}if(c===null&&d.miss&&!d.ambiguous){let m=Bo(String(t||"")).match(XI)?.[1]?.trim();if(m){let h=Go(`what is a ${m}`,{nlp:s});if(h?.shape==="meta"){let b=un(e,h,{contextId:n,prev:o}),g=Hn(h,b,e);!g.miss&&!g.ambiguous&&(u=b,d=g)}}}let p=l&&!d.miss&&l.to!==l.from?`read as "${l.to}" \u2014 ${d.content}`:d.content;if(!l&&!d.miss&&!d.ambiguous&&i.alternates.length){let f=i.alternates.map(m=>{let h=un(e,m.parsed,{contextId:n,prev:o}),b=Hn(m.parsed,h,e);return b.miss?null:{a:m,text:b.content}}).filter(Boolean);if(f.length){let m=kw(f.map(h=>h.a),{answerFor:h=>f.find(b=>b.a===h)?.text||null});p=`${p}
60
60
  ${m.join(`
61
- `)}`}}if(!d.ambiguous&&u.objMatch&&Array.isArray(u.candidates)&&u.candidates.length){let f=new Set((u.matches||[]).map(h=>h&&h.id)),m=u.candidates.filter(h=>h&&h.id&&h.id!==u.objMatch.id&&!f.has(h.id));if(m.length){let h=m.slice(0,3).map(y=>y.label).filter(Boolean),b=m.length-h.length,g=h.join(", ")+(b>0?`, +${b} more`:"");p=`${p}
62
- (answering for ${u.objMatch.label} \u2014 ${m.length} other match${m.length===1?"":"es"}: ${g})`}}return!Array.isArray(u.referents)&&!d.miss&&!d.ambiguous&&(c?.shape==="reverse"||c?.shape==="forward")&&c.entityType&&Array.isArray(u.matches)&&u.matches.length&&u.matches.every(f=>f&&f.class===c.entityType)&&(u={...u,referents:Di(c.entityType,u.matches,"relationListing")}),{content:p,tmct_ask:{mechanical:!0,parsed:c&&!c.ambiguousParse?c:null,canonical:Ey(c),matches:(u.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?lo(f):void 0})),traversal:u.traversal||null,miss:!!d.miss,ambiguous:!!d.ambiguous,relaxed:l,matchedVia:u.matchedVia||null,...Array.isArray(u.referents)&&u.referents.length?{discourse:u.referents}:{},...d.ambiguous?{candidates:d.candidates,candidateParses:d.candidateParses}:{}}}}var jw,Dr,ro,Pd,SA,Tt,Ww,ct,zd,EA,xA,jA,kA,RA,TA,Gw,Vw,Bd,CA,ao,ef,dt,Kw,OA,LA,MA,zA,BA,WA,GA,VA,KA,qA,YA,sf,XA,JA,ZA,Qw,rf,Zw,ey,cC,dC,kw,Rw,hC,ry,_w,bC,Tw,SC,Cw,Ow,dy,RC,TC,zC,BC,ts,Pw,Md,JC,QC,ZC,gf,eI,Fw,tI,Dw,rI,xc,Qd,wf,jy,uI,dI,fI,Bw,hI,wI,yI,$f,SI,EI,xI,Fi,TI,AI,II,OI,Uw,MI,ns=P(()=>{Fe();dd();Zn();Tn();Nr();mc();hc();xw();Od();Wn();Ii();Ld();Mr();jw=new WeakMap;Dr={calls:"callsSymbol",touches:"touchesSymbol"},ro=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Pd={Function:"Method",Method:"Function"},SA={uses:["imports","calls","callsSymbol"]},Tt=e=>SA[e]||[e],Ww=new Set(Object.values(Dr)),ct=12,zd={Function:["function","functions"],Method:["method","methods"],Class:["class","classes"],Module:["module","modules"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Change:["change","changes"],Package:["package","packages"],Fact:["fact","facts"],Utterance:["utterance","utterances"],Session:["session","sessions"],Source:["source","sources"],Rule:["rule","rules"]};EA={cochange:"cochanges",reexports:"export"};xA={imports:"import",calls:"call",callsSymbol:"call",inherits:"inherit from",contains:"contain",tests:"test",touches:"touch",cochange:"cochange",reexports:"export",uses:"use",serves:"serve",denotes:"denote"},jA=e=>xA[e]||zo(e),kA=new RegExp(`^(?:${Object.keys(he).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),RA=new Set(["imports"]);TA=/^where\s+(?:does|do|did)\s+/i,Gw=new Set(be(hn));Vw=4,Bd="zzinnerset",CA=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),ao=new Set(["which","what","who","list","show","find","give","me","us","all"]),ef=new Set(["are","is","was","were"]);dt=e=>nt[e]?{entityType:nt[e],placeholder:!1}:js.includes(e)?{entityType:null,placeholder:!0}:null,Kw=e=>!!he[e]&&e.endsWith("ing");OA=new Set(["which","the","all"]);LA=new Set(["all","every","each"]);MA=new Set(["what","which","thing","things","one","ones","stuff"]);zA=new Set(["defined","declared"]);BA=new Set(["those","them"]);WA=new Set(["did","was","were","do","does","has","have","had"]),GA=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),VA=new Set(["last","recently","ever","get","got","been","then","now","already"]),KA=new Set(["the","a","an","all","those","these","any"]);qA=new Set(["since","before","after","on"]),YA=new Set(["what","which"]);sf=new Set(["the","a","an","all","those","these","any"]);XA=new Set(["is","are","was","were","does","do","did"]),JA=new Set(["the","a","an","all","those","these","any"]);ZA=/\b[\w-]+(?:[/.][\w-]+)+\b|\b[A-Z][A-Za-z0-9_]*\b|\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/;Qw=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);rf=new Set(["the","a","an","all","me","us"]),Zw=[...Lo].sort((e,t)=>t.split(" ").length-e.split(" ").length),ey="functions, classes, methods, modules, packages, attributes, variables, or commits",cC=new Set(["in","inside","under"]);dC=new Set(["called","named","about","like","containing","matching","with"]);kw=new Set(["recent","latest","newest"]);Rw=new WeakMap;hC=new Set(["defines","contains"]),ry=(e,t)=>t==="Module"&&Tt(e).some(n=>hC.has(n)),_w=new WeakMap;bC=/^git:(.+)$/i;Tw=new WeakMap;SC=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Cw=new WeakMap;Ow={label:3,chain:2,attr:1};dy=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;RC=["imports","calls","callsSymbol","inherits","contains","tests"];TC=/^\d{4}-\d{2}-\d{2}$/;zC={defines:"in",contains:"in"};BC=e=>e.length&&e.every(t=>t.class===e[0].class)?e[0].class:null;ts=e=>yn(e.slice(0,ct).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>ct?`, \u2026and ${e.length-ct} more`:"");Pw=(e,t)=>`${$y(e,t)}.`;Md=10;JC=/^(?:the|a|an)\s+/i,QC=new RegExp(`\\s+(${Object.keys(nt).join("|")})$`,"i");ZC=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,gf=new Set(["index","main","app","server","cli","__main__"]),eI=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Fw=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),tI=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>eI.has(t));Dw=8;rI=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);xc=new Set([...be(Object.keys(he)),...be(Object.keys(nt)),...be(Object.keys(bn)),...be(Object.keys(Ve)),...be(No),...be(Object.keys(Jn)),...be(Object.keys(Qn)),...be(Object.keys(to)),...be(js),...be(wi),...be(Oo),...be(hn),...be(Bn),...be(jn),...be(Object.keys(kr)),...be([...Va])]),Qd=new Set([...ft,...ao,...Io]),wf=new Set(be(Ha)),jy=new Set([...wf,...Qd]),uI=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],dI=[...new Set([...be(Object.keys(he)),...Object.keys(nt),...uI])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!ft.has(e)),fI=new Set(["impact","impacts","impacted"]);Bw=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,hI=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;wI=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,yI=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,$f=/^(?:are there(?:\s+in\s+total)?|is there|do you know(?:\s+about)?|do you have|exist(?:s)?|are known|in (?:the |a )?(?:graph|memory)|you know(?:\s+about)?)?[?.!\s]*$/i;SI=new RegExp(`^(?:${Zw.map(at).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),EI=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,xI=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Fi=e=>String(e||"").toLowerCase();TI=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;AI=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;II=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,OI=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;Uw=(e,t,n,s)=>s.ambiguous?NI(e,t,n):!!s.miss;MI=new RegExp("^if\\s+(.+?)\\s+(?:were|was|had|has|is|are|becomes?|became|gets?|got|stops?|stopped|starts?|started)\\s+[^,]*,?\\s*(?:would|will|could|might|should)\\b","i")});function fo(e,t,n,s){let o=Math.max(1,t),r=Math.min(e.length,n),i=!1;s!=null&&r-o+1>s&&(r=o+s-1,i=!0);let a=e.slice(o-1,r).map((c,l)=>`${o+l} ${c}`).join(`
63
- `);return{start:o,end:r,text:a,truncated:i}}async function Fs({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Kt(t),a=Kt(i,n);if(a!==i&&!a.startsWith(i+lg))throw new Ne(`refusing to read outside the repository root: ${n}`);let l=(await e(a,"utf8")).split(`
64
- `);return s==null||o==null?{lines:l}:{lines:l,...fo(l,s,o,r)}}var Tc=P(()=>{Qe();Qt()});function At(e){return{ok:!0,value:e}}function Ct(e,{detail:t="",term:n=null}={}){if(!gt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function ss(e){return!e||!e.id?null:{id:String(e.id),label:e.label!=null?String(e.label):String(e.id),class:e.class||"Entity",attributes:(Array.isArray(e.attributes)?e.attributes:[]).map(t=>({key:t.key,value:t.value,prop:t.prop||null}))}}function Ac(e,{predicate:t="",prop:n=null}={}){let s={subject:e.subject,object:e.object,predicate:t,prop:n||null};return e.subjectLabel!=null&&(s.subjectLabel=e.subjectLabel),e.objectLabel!=null&&(s.objectLabel=e.objectLabel),e.weight!=null&&(s.weight=e.weight),s}var Sf,DI,gt,Ef,aW,Ty,xf,zI,Vn,vf,qt,cW,Ay=P(()=>{Sf="1.1.0",DI="urn:tmct:core",gt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),Ef=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),aW=Object.freeze({imports:"tmct:imports",calls:"tmct:calls",callsSymbol:"tmct:calls",defines:"tmct:defines",tests:"tmct:covers",touches:"tmct:touches",touchesSymbol:"tmct:touches",contains:"tmct:contains",inherits:"tmct:extends",cochange:"tmct:dependsOn",reexports:"tmct:exports",serves:"tmct:serves",denotes:"tmct:denotes"}),Ty=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),xf=Object.freeze(Object.values(Ty).flat()),zI=Object.freeze(new Set(Ty.source));Vn="Individual",vf="Edge",qt="concurrent-safe: reads immutable graph truth; no shared mutable state",cW=Object.freeze({version:Sf,ontology:DI,missReasons:Object.values(gt),edgeKinds:[...Ef],types:{Individual:{fields:{id:"string (opaque provider id)",label:"string (human/display name)",class:"string \u2014 a tmct: class token (module|class|function|method|attribute|variable|commit|test|\u2026)",attributes:"Array<{ key: string, value: string, prop: string|null }> \u2014 prop is the SEON/mgx token grounding the value"}},Edge:{fields:{subject:"string (individual id)",object:"string (individual id)",predicate:"string \u2014 the relation predicate",prop:"string|null \u2014 the SEON/mgx property token; see edgeKinds \u2192 tmct: mapping",subjectLabel:"string? (additive)",objectLabel:"string? (additive)",weight:"number? (additive; e.g. cochange coupling)"}},Result:{shape:"{ ok: true, value: T } | { ok: false, miss: Miss }"},Miss:{shape:"{ reason: MISS_REASONS, detail: string, term: string|null }"}},capabilitiesModel:"A provider advertises `capabilities: string[]` (service names it implements). A service outside the set is negotiated away to miss(CAPABILITY_ABSENT) \u2014 never an error. snippet may be advertised yet answer miss(NO_SOURCE) when no working tree exists (it has nothing useful without fs); context is graph-only-capable since INTERFACE_VERSION 1.1.0 \u2014 it returns a real hit (graph-only bundle) for any resolvable symbol even with no working tree, only escalating NO_SOURCE-style behavior to richer body text when source-capable.",services:{resolve:{group:"resolution",args:{term:"string"},result:`{ match: ${Vn}, candidates: ${Vn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"The resolveSymbol seam: map a free term to an individual + runner-up candidates. Every id-taking service consumes a resolved id."},describe:{group:"resolution",args:{id:"string"},result:`{ individual: ${Vn}, out: ${vf}[], incoming: ${vf}[] }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${Vn}[], attributes: ${Vn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${Vn}[], subclasses: ${Vn}[], levels: Array<${Vn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape."},exports:{group:"resolution",args:{moduleId:"string"},result:`{ exports: ${Vn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"A module's curated public API (resolved __all__ / re-exports)."},signature:{group:"resolution",args:{id:"string"},result:"{ id, label, class, params, returns, raises, decorators, doc, selfFields, flags }",misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"The compact API surface of a symbol without its body."},edges:{group:"traversal",args:{id:"string",kind:"EDGE_KINDS member"},result:`{ kind: string, edges: ${vf}[] }`,misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"Outgoing edges of one closed kind from an individual (an honest empty array is not a miss).",note:"An unknown kind (outside EDGE_KINDS) is a programming error and throws TypeError, not a miss."},impact:{group:"traversal",args:{moduleId:"string"},result:"{ total: number, levels: Array<Array<{ id, label, via, tests }>> }",misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"The transitive dependent closure the interpreter cannot compute without provider truth."},snippet:{group:"source",args:{id:"string"},result:"{ path: string, span: { start, end }, body: string|null } \u2014 Promise<Result>",misses:["UNRESOLVED_TERM","NO_SOURCE"],concurrency:qt,purpose:"The exact source span of a symbol. A provider with no working tree returns miss(NO_SOURCE) honestly \u2014 snippet has nothing useful without fs.",note:"ASYNC (returns Promise<Result>) \u2014 a real body read is inherently fs I/O; callers should always await it. A graph-only provider still resolves synchronously-in-spirit (the promise settles on the same tick) but the return type is uniformly a Promise regardless of sourceAccess."},context:{group:"source",args:{symbol:"string",depth:"min|auto|full?"},result:"{ text: string, tier: string } (a sized edit bundle) \u2014 Promise<Result>",misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"The composed edit bundle (exemplar, siblings, registration, insertion region). A graph-only provider returns the graph-only sections as a real hit; a source-capable provider (sourceAccess:true, repoRoot, readFile) additionally includes the anchor/exemplar/inlined-callee body text.",note:"ASYNC (returns Promise<Result>) \u2014 see snippet's note; source-capable rendering is fs I/O."},architecture:{group:"aggregate",args:{package:"string?"},result:"{ modules: number, packages: Array<[dir, count]>, hubs: Array<{ id, label, importers }> }",misses:[],concurrency:qt,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${Vn}[] }`,misses:[],concurrency:qt,purpose:"Modules with no covering test module (via the tests relation)."},stats:{group:"aggregate",args:{},result:"{ total: number, classes: Array<{ class: string, count: number }>, truncated: boolean }",misses:[],concurrency:qt,purpose:"Per-tmct:class individual counts, read straight from the payload."},history:{group:"temporal",args:{id:"string"},result:"{ commits: Array<{ id, label, author, date, message }> }",misses:["UNRESOLVED_TERM"],concurrency:qt,purpose:"The commits that touched an individual (tmct:commit individuals via tmct:touches)."},search:{group:"search",args:{query:"string",kind:"string?",name:"string?",decorator:"string?"},result:`{ results: ${Vn}[] }`,misses:[],concurrency:qt,purpose:"Lexical, provider-local locate. An empty result set is honest, not a miss."},ask:{group:"search",args:{query:"string"},result:"{ content: string, tmct_ask: object } (the composed NL round-trip envelope)",misses:[],concurrency:qt,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function BI(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(Ac(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(Ac(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function UI(e,t){for(let n of e.relations)if(Cs(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function GI(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Fs({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
- ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(fo(o,i,a,jf).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,c=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
- ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(fo(o,i,a,jf).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=WI;for(let a of e.calleeBodies){if(i<=0)break;let c=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await Fs({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=fo(u,c,a.site.end,i);r.push(`
61
+ `)}`}}if(!d.ambiguous&&u.objMatch&&Array.isArray(u.candidates)&&u.candidates.length){let f=new Set((u.matches||[]).map(h=>h&&h.id)),m=u.candidates.filter(h=>h&&h.id&&h.id!==u.objMatch.id&&!f.has(h.id));if(m.length){let h=m.slice(0,3).map(w=>w.label).filter(Boolean),b=m.length-h.length,g=h.join(", ")+(b>0?`, +${b} more`:"");p=`${p}
62
+ (answering for ${u.objMatch.label} \u2014 ${m.length} other match${m.length===1?"":"es"}: ${g})`}}return!Array.isArray(u.referents)&&!d.miss&&!d.ambiguous&&(c?.shape==="reverse"||c?.shape==="forward")&&c.entityType&&Array.isArray(u.matches)&&u.matches.length&&u.matches.every(f=>f&&f.class===c.entityType)&&(u={...u,referents:Wi(c.entityType,u.matches,"relationListing")}),{content:p,tmct_ask:{mechanical:!0,parsed:c&&!c.ambiguousParse?c:null,canonical:Ty(c),matches:(u.matches||[]).map(f=>({id:f.id,label:f.label,type:f.class,module:f.class?uo(f):void 0})),traversal:u.traversal||null,miss:!!d.miss,ambiguous:!!d.ambiguous,relaxed:l,matchedVia:u.matchedVia||null,...Array.isArray(u.referents)&&u.referents.length?{discourse:u.referents}:{},...d.ambiguous?{candidates:d.candidates,candidateParses:d.candidateParses}:{}}}}var Cw,Br,io,Ud,DA,_t,Yw,at,Kd,zA,BA,UA,WA,GA,KA,Xw,Jw,Hd,qA,co,af,dt,Qw,XA,QA,eC,sC,oC,iC,aC,cC,lC,dC,fC,uf,pC,mC,gC,oy,ff,ry,iy,jC,_C,Iw,Ow,IC,dy,Nw,NC,Lw,DC,Mw,Dw,by,GC,KC,sI,oI,os,Uw,Wd,mI,hI,gI,Sf,bI,Gw,wI,Vw,SI,kc,of,xf,Cy,RI,_I,TI,Hw,II,LI,PI,kf,DI,zI,BI,Ui,KI,HI,YI,XI,qw,eO,rs=M(()=>{Me();bd();ns();In();Pr();gc();bc();Aw();Dd();Kn();Pi();Bd();Dr();Cw=new WeakMap;Br={calls:"callsSymbol",touches:"touchesSymbol"},io=new Set(["Function","Method","Class","Attribute","GlobalVariable"]),Ud={Function:"Method",Method:"Function"},DA={uses:["imports","calls","callsSymbol"]},_t=e=>DA[e]||[e],Yw=new Set(Object.values(Br)),at=12,Kd={Function:["function","functions"],Method:["method","methods"],Class:["class","classes"],Module:["module","modules"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Change:["change","changes"],Package:["package","packages"],Fact:["fact","facts"],Utterance:["utterance","utterances"],Session:["session","sessions"],Source:["source","sources"],Rule:["rule","rules"]};zA={cochange:"cochanges",reexports:"export"};BA={imports:"import",calls:"call",callsSymbol:"call",inherits:"inherit from",contains:"contain",tests:"test",touches:"touch",cochange:"cochange",reexports:"export",uses:"use",serves:"serve",denotes:"denote"},UA=e=>BA[e]||Uo(e),WA=new RegExp(`^(?:${Object.keys(me).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})(?:s|ing|ed)?\\s+`,"i"),GA=new Set(["imports"]);KA=/^where\s+(?:does|do|did)\s+/i,Xw=new Set(be(bn));Jw=4,Hd="zzinnerset",qA=new Set(["that","which","who","are","is","was","were","do","does","also","still","both","and","then","though"]),co=new Set(["which","what","who","list","show","find","give","me","us","all"]),af=new Set(["are","is","was","were"]);dt=e=>nt[e]?{entityType:nt[e],placeholder:!1}:ks.includes(e)?{entityType:null,placeholder:!0}:null,Qw=e=>!!me[e]&&e.endsWith("ing");XA=new Set(["which","the","all"]);QA=new Set(["all","every","each"]);eC=new Set(["what","which","thing","things","one","ones","stuff"]);sC=new Set(["defined","declared"]);oC=new Set(["those","them"]);iC=new Set(["did","was","were","do","does","has","have","had"]),aC=new Set(["change","changed","changes","update","updated","updates","modify","modified","modifies","touch","touched","touches","edit","edited","revise","revised"]),cC=new Set(["last","recently","ever","get","got","been","then","now","already"]),lC=new Set(["the","a","an","all","those","these","any"]);dC=new Set(["since","before","after","on"]),fC=new Set(["what","which"]);uf=new Set(["the","a","an","all","those","these","any"]);pC=new Set(["is","are","was","were","does","do","did"]),mC=new Set(["the","a","an","all","those","these","any"]);gC=/\b[\w-]+(?:[/.][\w-]+)+\b|\b[A-Z][A-Za-z0-9_]*\b|\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/;oy=new Set(["total","altogether","overall","exist","exists","existing","present","here","now","currently","graph","index","codebase","repo","repository","this","that"]);ff=new Set(["the","a","an","all","me","us"]),ry=[...Mo].sort((e,t)=>t.split(" ").length-e.split(" ").length),iy="functions, classes, methods, modules, packages, attributes, variables, or commits",jC=new Set(["in","inside","under"]);_C=new Set(["called","named","about","like","containing","matching","with"]);Iw=new Set(["recent","latest","newest"]);Ow=new WeakMap;IC=new Set(["defines","contains"]),dy=(e,t)=>t==="Module"&&_t(e).some(n=>IC.has(n)),Nw=new WeakMap;NC=/^git:(.+)$/i;Lw=new WeakMap;DC=new Set(["Class","Function","Method","GlobalVariable","Attribute"]);Mw=new WeakMap;Dw={label:3,chain:2,attr:1};by=e=>e&&typeof e.value=="boolean"?{...e,value:!e.value}:null;GC=["imports","calls","callsSymbol","inherits","contains","tests"];KC=/^\d{4}-\d{2}-\d{2}$/;sI={defines:"in",contains:"in"};oI=e=>e.length&&e.every(t=>t.class===e[0].class)?e[0].class:null;os=e=>vn(e.slice(0,at).map(t=>["Function","Method"].includes(t.class)?`${t.label}()`:t.label))+(e.length>at?`, \u2026and ${e.length-at} more`:"");Uw=(e,t)=>`${ky(e,t)}.`;Wd=10;mI=/^(?:the|a|an)\s+/i,hI=new RegExp(`\\s+(${Object.keys(nt).join("|")})$`,"i");gI=/^(?:the\s+)?(?:main\s+|primary\s+)?entry[\s-]?points?(?:\s+(?:of|to|for)\s+(?:this|the)\s+(?:codebase|code|repo|repository|project|app))?$/i,Sf=new Set(["index","main","app","server","cli","__main__"]),bI=new Set(["test","tests","__tests__","fixture","fixtures","spec","specs","testdata"]),Gw=e=>String(e).toLowerCase().split("/").pop().replace(/\.[a-z0-9]+$/,""),wI=e=>String(e).toLowerCase().split("/").slice(0,-1).some(t=>bI.has(t));Vw=8;SI=new Set(["mgx:schemaDoc","mgx:lexiconDoc"]);kc=new Set([...be(Object.keys(me)),...be(Object.keys(nt)),...be(Object.keys(yn)),...be(Object.keys(Ge)),...be(Po),...be(Object.keys(es)),...be(Object.keys(ts)),...be(Object.keys(no)),...be(ks),...be(Si),...be(Lo),...be(bn),...be(Gn),...be(_n),...be(Object.keys(_r)),...be([...qa])]),of=new Set([...ft,...co,...No]),xf=new Set(be(Xa)),Cy=new Set([...xf,...of]),RI=["many","count","number","quantity","total","tally","list","show","display","print","dump","enumerate","name"],_I=[...new Set([...be(Object.keys(me)),...Object.keys(nt),...RI])].filter(e=>/^[a-z]+$/.test(e)&&e.length>=4&&!ft.has(e)),TI=new Set(["impact","impacts","impacted"]);Hw=/\b(?:the\s+)?(?:last|latest|most\s+recent)\s+commit\b/i,II=/^when\s+(?:was|were|is|did|does|do)\s+commit\s+[0-9a-fA-F:]+$/i;LI=/^(?:list|show(?:\s+me)?)\s+(?:all\s+|the\s+)?([a-z][a-z'-]*)\s*(.*)$/i,PI=/^(?:how\s+many|number\s+of|count(?:\s+the)?)\s+([a-z][a-z'-]*)\s*(.*)$/i,kf=/^(?:are there(?:\s+in\s+total)?|is there|do you know(?:\s+about)?|do you have|exist(?:s)?|are known|in (?:the |a )?(?:graph|memory)|you know(?:\s+about)?)?[?.!\s]*$/i;DI=new RegExp(`^(?:${ry.map(it).join("|")})\\s+(?:all\\s+)?(?:the\\s+)?([a-z][a-z'-]*)\\s+(?:of|for)\\s+(.+?)[?.!\\s]*$`,"i"),zI=/^where(?:'s|\s+is|\s+are)\s+(?:all\s+)?(?:the\s+)?(.+?)[?.!\s]*$/i,BI=/^where\s+(?:does|do|did)\s+(?:all\s+)?(?:the\s+)?(.+?)\s+[a-z][a-z'-]*[?.!\s]*$/i;Ui=e=>String(e||"").toLowerCase();KI=/^(.+?)@(?:epoch(\d+)@)?(?:turn|step)(\d+)$/;HI=(e,t,n)=>!e||e.epoch<t||e.epoch===t&&e.stamp<=n;YI=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,XI=/^what\s+is\s+(?:the\s+)?(?!(?:an?|it|this|that|these|those)\s)(.+?)\s+(?:used\s+)?for[?.!\s]*$/i;qw=(e,t,n,s)=>s.ambiguous?JI(e,t,n):!!s.miss;eO=new RegExp("^if\\s+(.+?)\\s+(?:were|was|had|has|is|are|becomes?|became|gets?|got|stops?|stopped|starts?|started)\\s+[^,]*,?\\s*(?:would|will|could|might|should)\\b","i")});function po(e,t,n,s){let o=Math.max(1,t),r=Math.min(e.length,n),i=!1;s!=null&&r-o+1>s&&(r=o+s-1,i=!0);let a=e.slice(o-1,r).map((c,l)=>`${o+l} ${c}`).join(`
63
+ `);return{start:o,end:r,text:a,truncated:i}}async function Ds({readFile:e,repoRoot:t,path:n,start:s,end:o,maxLines:r}){let i=Vt(t),a=Vt(i,n);if(a!==i&&!a.startsWith(i+hg))throw new Le(`refusing to read outside the repository root: ${n}`);let l=(await e(a,"utf8")).split(`
64
+ `);return s==null||o==null?{lines:l}:{lines:l,...po(l,s,o,r)}}var Cc=M(()=>{Qe();Qt()});function Tt(e){return{ok:!0,value:e}}function At(e,{detail:t="",term:n=null}={}){if(!gt[e])throw new TypeError(`miss(): unknown reason "${e}" (not in MISS_REASONS)`);return{ok:!1,miss:{reason:e,detail:t,term:n}}}function is(e){return!e||!e.id?null:{id:String(e.id),label:e.label!=null?String(e.label):String(e.id),class:e.class||"Entity",attributes:(Array.isArray(e.attributes)?e.attributes:[]).map(t=>({key:t.key,value:t.value,prop:t.prop||null}))}}function Ic(e,{predicate:t="",prop:n=null}={}){let s={subject:e.subject,object:e.object,predicate:t,prop:n||null};return e.subjectLabel!=null&&(s.subjectLabel=e.subjectLabel),e.objectLabel!=null&&(s.objectLabel=e.objectLabel),e.weight!=null&&(s.weight=e.weight),s}var _f,nO,gt,Tf,TW,Ly,Af,sO,qn,Rf,Ht,AW,Py=M(()=>{_f="1.1.0",nO="urn:tmct:core",gt=Object.freeze({UNRESOLVED_TERM:"UNRESOLVED_TERM",CAPABILITY_ABSENT:"CAPABILITY_ABSENT",TRUNCATED_GRAPH:"TRUNCATED_GRAPH",NO_SOURCE:"NO_SOURCE"}),Tf=Object.freeze(["imports","calls","callsSymbol","defines","tests","touches","touchesSymbol","contains","inherits","cochange","reexports","serves","denotes"]),TW=Object.freeze({imports:"tmct:imports",calls:"tmct:calls",callsSymbol:"tmct:calls",defines:"tmct:defines",tests:"tmct:covers",touches:"tmct:touches",touchesSymbol:"tmct:touches",contains:"tmct:contains",inherits:"tmct:extends",cochange:"tmct:dependsOn",reexports:"tmct:exports",serves:"tmct:serves",denotes:"tmct:denotes"}),Ly=Object.freeze({resolution:["resolve","describe","members","subclasses","exports","signature"],traversal:["edges","impact"],source:["snippet","context"],aggregate:["architecture","untested","stats"],temporal:["history"],search:["search","ask"]}),Af=Object.freeze(Object.values(Ly).flat()),sO=Object.freeze(new Set(Ly.source));qn="Individual",Rf="Edge",Ht="concurrent-safe: reads immutable graph truth; no shared mutable state",AW=Object.freeze({version:_f,ontology:nO,missReasons:Object.values(gt),edgeKinds:[...Tf],types:{Individual:{fields:{id:"string (opaque provider id)",label:"string (human/display name)",class:"string \u2014 a tmct: class token (module|class|function|method|attribute|variable|commit|test|\u2026)",attributes:"Array<{ key: string, value: string, prop: string|null }> \u2014 prop is the SEON/mgx token grounding the value"}},Edge:{fields:{subject:"string (individual id)",object:"string (individual id)",predicate:"string \u2014 the relation predicate",prop:"string|null \u2014 the SEON/mgx property token; see edgeKinds \u2192 tmct: mapping",subjectLabel:"string? (additive)",objectLabel:"string? (additive)",weight:"number? (additive; e.g. cochange coupling)"}},Result:{shape:"{ ok: true, value: T } | { ok: false, miss: Miss }"},Miss:{shape:"{ reason: MISS_REASONS, detail: string, term: string|null }"}},capabilitiesModel:"A provider advertises `capabilities: string[]` (service names it implements). A service outside the set is negotiated away to miss(CAPABILITY_ABSENT) \u2014 never an error. snippet may be advertised yet answer miss(NO_SOURCE) when no working tree exists (it has nothing useful without fs); context is graph-only-capable since INTERFACE_VERSION 1.1.0 \u2014 it returns a real hit (graph-only bundle) for any resolvable symbol even with no working tree, only escalating NO_SOURCE-style behavior to richer body text when source-capable.",services:{resolve:{group:"resolution",args:{term:"string"},result:`{ match: ${qn}, candidates: ${qn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The resolveSymbol seam: map a free term to an individual + runner-up candidates. Every id-taking service consumes a resolved id."},describe:{group:"resolution",args:{id:"string"},result:`{ individual: ${qn}, out: ${Rf}[], incoming: ${Rf}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Full typed portrait of one individual: its attributes and its outgoing/incoming edges."},members:{group:"resolution",args:{classId:"string"},result:`{ methods: ${qn}[], attributes: ${qn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A class's methods + attributes (via the contains relation) \u2014 replaces reading the class body."},subclasses:{group:"resolution",args:{classId:"string"},result:`{ bases: ${qn}[], subclasses: ${qn}[], levels: Array<${qn}[]> }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Forward bases + the transitive reverse inheritance closure (who extends this). `subclasses` is the flat closure; `levels` groups the same individuals by inheritance depth (direct children first), mirroring `impact`'s leveled shape."},exports:{group:"resolution",args:{moduleId:"string"},result:`{ exports: ${qn}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"A module's curated public API (resolved __all__ / re-exports)."},signature:{group:"resolution",args:{id:"string"},result:"{ id, label, class, params, returns, raises, decorators, doc, selfFields, flags }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The compact API surface of a symbol without its body."},edges:{group:"traversal",args:{id:"string",kind:"EDGE_KINDS member"},result:`{ kind: string, edges: ${Rf}[] }`,misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"Outgoing edges of one closed kind from an individual (an honest empty array is not a miss).",note:"An unknown kind (outside EDGE_KINDS) is a programming error and throws TypeError, not a miss."},impact:{group:"traversal",args:{moduleId:"string"},result:"{ total: number, levels: Array<Array<{ id, label, via, tests }>> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The transitive dependent closure the interpreter cannot compute without provider truth."},snippet:{group:"source",args:{id:"string"},result:"{ path: string, span: { start, end }, body: string|null } \u2014 Promise<Result>",misses:["UNRESOLVED_TERM","NO_SOURCE"],concurrency:Ht,purpose:"The exact source span of a symbol. A provider with no working tree returns miss(NO_SOURCE) honestly \u2014 snippet has nothing useful without fs.",note:"ASYNC (returns Promise<Result>) \u2014 a real body read is inherently fs I/O; callers should always await it. A graph-only provider still resolves synchronously-in-spirit (the promise settles on the same tick) but the return type is uniformly a Promise regardless of sourceAccess."},context:{group:"source",args:{symbol:"string",depth:"min|auto|full?"},result:"{ text: string, tier: string } (a sized edit bundle) \u2014 Promise<Result>",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The composed edit bundle (exemplar, siblings, registration, insertion region). A graph-only provider returns the graph-only sections as a real hit; a source-capable provider (sourceAccess:true, repoRoot, readFile) additionally includes the anchor/exemplar/inlined-callee body text.",note:"ASYNC (returns Promise<Result>) \u2014 see snippet's note; source-capable rendering is fs I/O."},architecture:{group:"aggregate",args:{package:"string?"},result:"{ modules: number, packages: Array<[dir, count]>, hubs: Array<{ id, label, importers }> }",misses:[],concurrency:Ht,purpose:"Package/module shape + the most-imported hub modules. Optional package prefix scopes it."},untested:{group:"aggregate",args:{},result:`{ modules: ${qn}[] }`,misses:[],concurrency:Ht,purpose:"Modules with no covering test module (via the tests relation)."},stats:{group:"aggregate",args:{},result:"{ total: number, classes: Array<{ class: string, count: number }>, truncated: boolean }",misses:[],concurrency:Ht,purpose:"Per-tmct:class individual counts, read straight from the payload."},history:{group:"temporal",args:{id:"string"},result:"{ commits: Array<{ id, label, author, date, message }> }",misses:["UNRESOLVED_TERM"],concurrency:Ht,purpose:"The commits that touched an individual (tmct:commit individuals via tmct:touches)."},search:{group:"search",args:{query:"string",kind:"string?",name:"string?",decorator:"string?"},result:`{ results: ${qn}[] }`,misses:[],concurrency:Ht,purpose:"Lexical, provider-local locate. An empty result set is honest, not a miss."},ask:{group:"search",args:{query:"string"},result:"{ content: string, tmct_ask: object } (the composed NL round-trip envelope)",misses:[],concurrency:Ht,purpose:"The mechanical, zero-model NL query over the graph \u2014 tmct's whole reason to exist."}}})});function oO(e,t){let n=[],s=[];for(let o of e.relations)for(let r of o.edges)r.subject===t&&n.push(Ic(r,{predicate:o.predicate,prop:o.prop})),r.object===t&&s.push(Ic(r,{predicate:o.predicate,prop:o.prop}));return{out:n,incoming:s}}function rO(e,t){for(let n of e.relations)if(Is(n)===t)return{predicate:n.predicate,prop:n.prop};return{predicate:t,prop:null}}async function aO(e,t,{readFile:n,repoRoot:s}){if(!e.moduleLabel)return"";let o=null;try{({lines:o}=await Ds({readFile:n,repoRoot:s,path:e.moduleLabel}))}catch{o=null}if(!o)return"";let r=[];if(t.anchor&&e.anchor?.site){let{start:i,end:a}=e.anchor.site;r.push(`
65
+ ## anchor: ${e.anchor.label} (${e.anchor.class}) @ ${e.moduleLabel}:${i}-${a}`),r.push(po(o,i,a,Cf).text),e.callHint&&r.push(e.callHint)}if(t.exemplar&&e.exemplar?.site){let{start:i,end:a}=e.exemplar.site,c=e.exemplar.decorators?` @${e.exemplar.decorators}`:"";r.push(`
66
+ ## closest example (full body) \u2014 copy this style: ${e.exemplar.label} (${e.exemplar.class})${c} @ ${e.moduleLabel}:${i}-${a}`),r.push(po(o,i,a,Cf).text),e.callHint&&r.push(e.callHint)}if(t.inlinedCallees&&e.calleeBodies.length){let i=iO;for(let a of e.calleeBodies){if(i<=0)break;let c=a.site.start,u=a.site.path===e.moduleLabel?o:null;if(!u)try{({lines:u}=await Ds({readFile:n,repoRoot:s,path:a.site.path}))}catch{u=null}if(!u)continue;let d=po(u,c,a.site.end,i);r.push(`
67
67
  ## inlined callee body (depth-1 in-repo call): ${a.label} @ ${a.site.path}:${c}-${a.site.end}`),r.push(d.text),i-=d.end-c+1}}return r.join(`
68
- `)}function Cc(e,{sourceAccess:t=!1,repoRoot:n=null,readFile:s=null,tel:o=null,ask:r=null}={}){let i=e.byId;if(t&&(!n||typeof s!="function"))throw new TypeError("createGraphService({ sourceAccess: true }) requires both repoRoot and readFile \u2014 fs access is an injected capability, not an ambient import.");let a=l=>i.get(l)||null,c={version:Sf,capabilities:[...xf],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=wn(e,String(l??""));return u?At({match:ss(u),candidates:d.map(ss)}):Ct(gt.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return Ct(gt.UNRESOLVED_TERM,{term:l});let{out:d,incoming:p}=BI(e,l);return At({individual:ss(u),out:d,incoming:p})},members(l){if(!a(l))return Ct(gt.UNRESOLVED_TERM,{term:l});let d=Te(e,"contains").filter(m=>m.subject===l),p=[],f=[];for(let m of d){let h=i.get(m.object),b=h?ss(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?f.push(b):p.push(b)}return At({methods:p,attributes:f})},subclasses(l){if(!a(l))return Ct(gt.UNRESOLVED_TERM,{term:l});let d=Te(e,"inherits"),p=d.filter(y=>y.subject===l).map(y=>i.get(y.object)?ss(i.get(y.object)):{id:y.object,label:y.objectLabel||y.object,class:"Class",attributes:[]}),f=new Map;for(let y of d)f.has(y.object)||f.set(y.object,[]),f.get(y.object).push(y.subject);let m=new Set([l]),h=[],b=[],g=[l];for(let y=0;y<8&&g.length;y+=1){let w=[],E=[];for(let R of g)for(let v of f.get(R)||[]){if(m.has(v))continue;m.add(v);let k=i.get(v),I=k?ss(k):{id:v,label:v,class:"Class",attributes:[]};h.push(I),E.push(I),w.push(v)}E.length&&b.push(E),g=w}return At({bases:p,subclasses:h,levels:b})},exports(l){if(!a(l))return Ct(gt.UNRESOLVED_TERM,{term:l});let p=Te(e,"reexports").filter(f=>f.subject===l).map(f=>i.get(f.object)?ss(i.get(f.object)):{id:f.object,label:f.objectLabel||f.object,class:"Entity",attributes:[]});return At({exports:p})},signature(l){let u=a(l);if(!u)return Ct(gt.UNRESOLVED_TERM,{term:l});let d=[];for(let[f,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])ln(u,f)&&d.push(m);let p=ln(u,"visibility");return p&&d.push(p),At({id:u.id,label:u.label,class:u.class||"Entity",params:ln(u,"params"),returns:ln(u,"returns"),raises:ln(u,"raises"),decorators:ln(u,"decorators"),doc:ln(u,"doc"),selfFields:ln(u,"self_fields"),flags:d})},edges(l,u,{limit:d,offset:p=0}={}){if(!Ef.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return Ct(gt.UNRESOLVED_TERM,{term:l});let m=UI(e,u),h=Te(e,u).filter(b=>b.subject===l).map(b=>Ac(b,m));return h=d==null?h.slice(p):h.slice(p,p+d),At({kind:u,edges:h})},impact(l,{maxDepth:u}={}){let d=a(l);if(!d)return Ct(gt.UNRESOLVED_TERM,{term:l});let p=u==null?Ir(e,d):Ir(e,d,{maxDepth:u}),f=p.reduce((m,h)=>m+h.length,0);return At({total:f,levels:p})},async snippet(l){let u=a(l);if(!u)return Ct(gt.UNRESOLVED_TERM,{term:l});let d=Ht(u);if(!c.sourceAccess)return Ct(gt.NO_SOURCE,{term:l,detail:d?`span is ${d.path}:${d.start}-${d.end}; this provider exposes no working tree`:"no source span in the graph"});if(!d)return Ct(gt.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let p=await Fs({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:jf});return At({path:d.path,span:{start:d.start,end:d.end},body:p.text})}catch(p){return Ct(gt.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${p?.message||p}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=wn(e,String(l??""));if(!d)return Ct(gt.UNRESOLVED_TERM,{term:String(l??"")});let p=Or(e,d),f=String(u||"auto").trim().toLowerCase(),m,h;f==="min"?(m="TINY",h=Fo("TINY")):f==="full"?(m="FULL",h=Fo("FULL")):{tier:m,mask:h}=uc(p,e,{});let b=Ub(p,h);if(!c.sourceAccess)return At({text:b,tier:m});let g=await GI(p,h,{readFile:s,repoRoot:n});return At({text:g?`${b}
69
- ${g}`:b,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(g=>(g.class||"")==="Module"&&(!u||String(g.label||"").toLowerCase().startsWith(u))),p=new Map;for(let g of d){let y=g.label.includes("/")?g.label.slice(0,g.label.lastIndexOf("/")):"(root)";p.set(y,(p.get(y)||0)+1)}let f=new Set(d.map(g=>g.id)),m=new Map;for(let g of Te(e,"imports"))f.has(g.object)&&m.set(g.object,(m.get(g.object)||0)+1);let h=[...m.entries()].sort((g,y)=>y[1]-g[1]).map(([g,y])=>({id:g,label:i.get(g)?.label||g,importers:y})),b=[...p.entries()].sort((g,y)=>y[1]-g[1]);return At({modules:d.length,packages:b,hubs:h})},untested(){let l=new Set(Te(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(ss);return At({modules:u})},stats(){let l=new Map;for(let d of e.individuals){let p=d.class||"Entity";l.set(p,(l.get(p)||0)+1)}let u=[...l.entries()].map(([d,p])=>({class:d,count:p})).sort((d,p)=>p.count-d.count||d.class.localeCompare(p.class));return At({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(l){if(!a(l))return Ct(gt.UNRESOLVED_TERM,{term:l});let d=[...Te(e,"touches"),...Te(e,"touchesSymbol")].filter(m=>m.object===l),p=new Set,f=[];for(let m of d){if(p.has(m.subject))continue;p.add(m.subject);let h=i.get(m.subject);f.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?ln(h,"author")??ln(h,"commitAuthor"):null,date:h?ln(h,"date")??ln(h,"commitDate"):null,message:h?ln(h,"message")??ln(h,"commitMessage"):null})}return At({commits:f})},search(l,{kind:u="",name:d="",decorator:p="",limit:f=ic,offset:m=0}={}){let h=String(l||""),b=String(u||"").trim().toLowerCase(),g=String(d||"").trim(),y=String(p||"").trim().toLowerCase(),w;if(b&&b!=="module"){let R=null;if(g){let k=vd(g);if(k.error)return Ct(gt.UNRESOLVED_TERM,{term:g,detail:k.error});R=k}let v=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{w=xd(e,v,{kind:b,decFilter:y,nameRe:R}).map(k=>k.ind)}catch(k){return Ct(gt.UNRESOLVED_TERM,{term:g,detail:String(k?.message||k)})}}else{let R=new Map;for(let v of e.individuals)(v.class||"")==="Module"&&R.set(v.label,v);w=yb(e,h).map(({path:v})=>R.get(v)).filter(Boolean)}let E=w.slice(m,m+f).map(ss);return At({results:E})},ask(l){if(typeof r!="function")return Ct(gt.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(l||""));return At({content:u,tmct_ask:d})}};if(o)for(let l of xf){let u=c[l];typeof u=="function"&&(c[l]=(...d)=>{let p=performance.now(),f=u.apply(c,d);return f&&typeof f.then=="function"?f.then(m=>(Cy(o,l,performance.now()-p,m),m)):(Cy(o,l,performance.now()-p,f),f)})}return c}function Cy(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:VI(s)})}catch{}}function VI(e){if(!e||typeof e!="object"||e.ok!==!0)return{ok:!1,reason:e?.miss?.reason||null};let t=0,n=e.value;if(Array.isArray(n))t=n.length;else if(n&&typeof n=="object")for(let s of Object.values(n))Array.isArray(s)&&(t+=s.length);return{ok:!0,count:t}}var ln,jf,WI,Ic=P(()=>{Fe();Tc();Ay();ln=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;jf=200,WI=120});async function zi(e,t){let n=await t.fetchEntities(e),s=rc(n);if(!s.individuals.length){let o=new Ne(`the graph at ${e?.graphFile} is empty \u2014 no entities to answer from yet (this repo starts with no graph; the chat session folds the conversation into one).`);throw o.emptyGraph=!0,o}return s}var Oc=P(()=>{Qt();Fe()});function po({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function pt(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Ne(`${t} is required`);return n}function Ft(e,t,n){let{match:s,candidates:o}=wn(e.graph,t);if(!s)throw new Ne(`no entity matching ${n} "${t}" in the code-map graph. Try a repo-relative path (e.g. path/to/module), a basename, or tmct_search for a fuzzy lookup.`);return{match:s,candidates:o}}var Bi,bt,ot=P(()=>{Qt();Fe();Bi=200;bt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Ft(s,pt(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Iy(e,{config:t,source:n=_r,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Ne("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,c=!!e?.untuned,l=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await zi(t,n),p=$e($e(t.graphFile)),f=Cc(d,{sourceAccess:!0,repoRoot:p,readFile:Ie,tel:o,ask:uo}),{match:m}=Ft(f,r,"symbol"),h=Or(d,m),b,g,y=!1;a||i==="min"?(b="TINY",g=Fo("TINY")):l||i==="full"?(b="FULL",g=Fo("FULL"),y=!0):{tier:b,mask:g,topup:y}=uc(h,d,{untuned:c}),s&&!l&&(g=zb(g));let w=null;if(h.moduleLabel)try{({lines:w}=await Fs({readFile:Ie,repoRoot:p,path:h.moduleLabel}))}catch{w=null}let E=k=>w&&w[k-1]!=null?w[k-1].trim():"",R=(k,I)=>fo(w,k,I,Bi).text,v=[`Edit context for ${h.moduleLabel} [${b}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(g.anchor&&h.anchor?.site&&w){let{start:k,end:I}=h.anchor.site;v.push(`
70
- ## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${k}-${I}`),v.push(R(k,I)),h.callHint&&v.push(h.callHint)}if(g.registration&&h.globals.length){v.push(`
71
- ## registration / module globals (replicate this pattern):`);for(let k of h.globals)v.push(` ${k.label} = ${k.value}${k.site?` [:${k.site.start}]`:""}`)}if(g.exemplar&&h.exemplar?.site&&w){let{start:k,end:I}=h.exemplar.site,x=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";v.push(`
72
- ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${x} @ ${h.moduleLabel}:${k}-${I}`),v.push(R(k,I)),h.callHint&&v.push(h.callHint)}if(g.inlinedCallees&&h.calleeBodies.length&&w){let k=120;for(let I of h.calleeBodies){if(k<=0)break;let x=I.site.start,$=I.site.path===h.moduleLabel&&w?w:await Fs({readFile:Ie,repoRoot:p,path:I.site.path}).then(C=>C.lines).catch(()=>null);if(!$)continue;let _=fo($,x,I.site.end,k);v.push(`
73
- ## inlined callee body (depth-1 in-repo call): ${I.label} @ ${I.site.path}:${x}-${I.site.end}`),v.push(_.text),k-=_.end-x+1}}if(g.classMembers&&h.classMembers&&h.classMembers.members.length){v.push(`
74
- ## members of ${h.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let k of h.classMembers.members){let I=String(k.label).split(".").pop(),x=k.params!=null&&k.params!==""?`(${k.params})${k.returns?` -> ${k.returns}`:""}`:"",T=k.decorators?`@${k.decorators} `:"",$=k.raises?` raises=${k.raises}`:"";v.push(` ${k.class} ${I}${k.site?` :${k.site.start}`:""} ${T}${I}${x}${$}`)}}if(g.siblings&&h.siblings.length){v.push(`
75
- ## sibling symbols to copy the style of (most relevant first; ${h.siblings.length} total):`);for(let k of h.siblings.slice(0,h.siblingCap)){let I=k.site?E(k.site.start):"",x=k.decorators?`@${k.decorators} `:"",T=k.raises?` raises=${k.raises}`:"";v.push(` ${k.class} ${k.label}${k.site?` :${k.site.start}`:""} ${x}${I}${T}`)}h.siblings.length>h.siblingCap&&v.push(` \u2026+${h.siblings.length-h.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(g.allExports&&h.allExports&&v.push(`
68
+ `)}function Oc(e,{sourceAccess:t=!1,repoRoot:n=null,readFile:s=null,tel:o=null,ask:r=null}={}){let i=e.byId;if(t&&(!n||typeof s!="function"))throw new TypeError("createGraphService({ sourceAccess: true }) requires both repoRoot and readFile \u2014 fs access is an injected capability, not an ambient import.");let a=l=>i.get(l)||null,c={version:_f,capabilities:[...Af],sourceAccess:!!t,graph:e,resolve(l){let{match:u,candidates:d}=$n(e,String(l??""));return u?Tt({match:is(u),candidates:d.map(is)}):At(gt.UNRESOLVED_TERM,{term:String(l??"")})},describe(l){let u=a(l);if(!u)return At(gt.UNRESOLVED_TERM,{term:l});let{out:d,incoming:p}=oO(e,l);return Tt({individual:is(u),out:d,incoming:p})},members(l){if(!a(l))return At(gt.UNRESOLVED_TERM,{term:l});let d=Te(e,"contains").filter(m=>m.subject===l),p=[],f=[];for(let m of d){let h=i.get(m.object),b=h?is(h):{id:m.object,label:m.objectLabel||m.object,class:"Entity",attributes:[]};(h?.class||"")==="Attribute"?f.push(b):p.push(b)}return Tt({methods:p,attributes:f})},subclasses(l){if(!a(l))return At(gt.UNRESOLVED_TERM,{term:l});let d=Te(e,"inherits"),p=d.filter(w=>w.subject===l).map(w=>i.get(w.object)?is(i.get(w.object)):{id:w.object,label:w.objectLabel||w.object,class:"Class",attributes:[]}),f=new Map;for(let w of d)f.has(w.object)||f.set(w.object,[]),f.get(w.object).push(w.subject);let m=new Set([l]),h=[],b=[],g=[l];for(let w=0;w<8&&g.length;w+=1){let y=[],v=[];for(let R of g)for(let S of f.get(R)||[]){if(m.has(S))continue;m.add(S);let j=i.get(S),I=j?is(j):{id:S,label:S,class:"Class",attributes:[]};h.push(I),v.push(I),y.push(S)}v.length&&b.push(v),g=y}return Tt({bases:p,subclasses:h,levels:b})},exports(l){if(!a(l))return At(gt.UNRESOLVED_TERM,{term:l});let p=Te(e,"reexports").filter(f=>f.subject===l).map(f=>i.get(f.object)?is(i.get(f.object)):{id:f.object,label:f.objectLabel||f.object,class:"Entity",attributes:[]});return Tt({exports:p})},signature(l){let u=a(l);if(!u)return At(gt.UNRESOLVED_TERM,{term:l});let d=[];for(let[f,m]of[["isStatic","static"],["isAbstract","abstract"],["isConstant","constant"]])dn(u,f)&&d.push(m);let p=dn(u,"visibility");return p&&d.push(p),Tt({id:u.id,label:u.label,class:u.class||"Entity",params:dn(u,"params"),returns:dn(u,"returns"),raises:dn(u,"raises"),decorators:dn(u,"decorators"),doc:dn(u,"doc"),selfFields:dn(u,"self_fields"),flags:d})},edges(l,u,{limit:d,offset:p=0}={}){if(!Tf.includes(u))throw new TypeError(`edges(): unknown kind "${u}" (not in EDGE_KINDS)`);if(!a(l))return At(gt.UNRESOLVED_TERM,{term:l});let m=rO(e,u),h=Te(e,u).filter(b=>b.subject===l).map(b=>Ic(b,m));return h=d==null?h.slice(p):h.slice(p,p+d),Tt({kind:u,edges:h})},impact(l,{maxDepth:u}={}){let d=a(l);if(!d)return At(gt.UNRESOLVED_TERM,{term:l});let p=u==null?Nr(e,d):Nr(e,d,{maxDepth:u}),f=p.reduce((m,h)=>m+h.length,0);return Tt({total:f,levels:p})},async snippet(l){let u=a(l);if(!u)return At(gt.UNRESOLVED_TERM,{term:l});let d=Kt(u);if(!c.sourceAccess)return At(gt.NO_SOURCE,{term:l,detail:d?`span is ${d.path}:${d.start}-${d.end}; this provider exposes no working tree`:"no source span in the graph"});if(!d)return At(gt.NO_SOURCE,{term:l,detail:"no source span in the graph (likely a module)"});try{let p=await Ds({readFile:s,repoRoot:n,path:d.path,start:d.start,end:d.end,maxLines:Cf});return Tt({path:d.path,span:{start:d.start,end:d.end},body:p.text})}catch(p){return At(gt.NO_SOURCE,{term:l,detail:`could not read ${d.path}: ${p?.message||p}`})}},async context(l,{depth:u="auto"}={}){let{match:d}=$n(e,String(l??""));if(!d)return At(gt.UNRESOLVED_TERM,{term:String(l??"")});let p=Lr(e,d),f=String(u||"auto").trim().toLowerCase(),m,h;f==="min"?(m="TINY",h=zo("TINY")):f==="full"?(m="FULL",h=zo("FULL")):{tier:m,mask:h}=fc(p,e,{});let b=qb(p,h);if(!c.sourceAccess)return Tt({text:b,tier:m});let g=await aO(p,h,{readFile:s,repoRoot:n});return Tt({text:g?`${b}
69
+ ${g}`:b,tier:m})},architecture({package:l=""}={}){let u=String(l||"").trim().toLowerCase().replace(/^\.?\//,""),d=e.individuals.filter(g=>(g.class||"")==="Module"&&(!u||String(g.label||"").toLowerCase().startsWith(u))),p=new Map;for(let g of d){let w=g.label.includes("/")?g.label.slice(0,g.label.lastIndexOf("/")):"(root)";p.set(w,(p.get(w)||0)+1)}let f=new Set(d.map(g=>g.id)),m=new Map;for(let g of Te(e,"imports"))f.has(g.object)&&m.set(g.object,(m.get(g.object)||0)+1);let h=[...m.entries()].sort((g,w)=>w[1]-g[1]).map(([g,w])=>({id:g,label:i.get(g)?.label||g,importers:w})),b=[...p.entries()].sort((g,w)=>w[1]-g[1]);return Tt({modules:d.length,packages:b,hubs:h})},untested(){let l=new Set(Te(e,"tests").map(d=>d.object)),u=e.individuals.filter(d=>(d.class||"")==="Module"&&!l.has(d.id)&&!/\.test\./.test(d.label||"")).map(is);return Tt({modules:u})},stats(){let l=new Map;for(let d of e.individuals){let p=d.class||"Entity";l.set(p,(l.get(p)||0)+1)}let u=[...l.entries()].map(([d,p])=>({class:d,count:p})).sort((d,p)=>p.count-d.count||d.class.localeCompare(p.class));return Tt({total:e.individuals.length,classes:u,truncated:(e.truncated||[]).length>0})},history(l){if(!a(l))return At(gt.UNRESOLVED_TERM,{term:l});let d=[...Te(e,"touches"),...Te(e,"touchesSymbol")].filter(m=>m.object===l),p=new Set,f=[];for(let m of d){if(p.has(m.subject))continue;p.add(m.subject);let h=i.get(m.subject);f.push({id:m.subject,label:m.subjectLabel||h?.label||m.subject,author:h?dn(h,"author")??dn(h,"commitAuthor"):null,date:h?dn(h,"date")??dn(h,"commitDate"):null,message:h?dn(h,"message")??dn(h,"commitMessage"):null})}return Tt({commits:f})},search(l,{kind:u="",name:d="",decorator:p="",limit:f=cc,offset:m=0}={}){let h=String(l||""),b=String(u||"").trim().toLowerCase(),g=String(d||"").trim(),w=String(p||"").trim().toLowerCase(),y;if(b&&b!=="module"){let R=null;if(g){let j=Rd(g);if(j.error)return At(gt.UNRESOLVED_TERM,{term:g,detail:j.error});R=j}let S=h.toLowerCase().split(/[^a-z0-9_]+/).filter(Boolean);try{y=Ad(e,S,{kind:b,decFilter:w,nameRe:R}).map(j=>j.ind)}catch(j){return At(gt.UNRESOLVED_TERM,{term:g,detail:String(j?.message||j)})}}else{let R=new Map;for(let S of e.individuals)(S.class||"")==="Module"&&R.set(S.label,S);y=jb(e,h).map(({path:S})=>R.get(S)).filter(Boolean)}let v=y.slice(m,m+f).map(is);return Tt({results:v})},ask(l){if(typeof r!="function")return At(gt.CAPABILITY_ABSENT,"this provider was constructed without an ask answerer");let{content:u,tmct_ask:d}=r(e,String(l||""));return Tt({content:u,tmct_ask:d})}};if(o)for(let l of Af){let u=c[l];typeof u=="function"&&(c[l]=(...d)=>{let p=performance.now(),f=u.apply(c,d);return f&&typeof f.then=="function"?f.then(m=>(My(o,l,performance.now()-p,m),m)):(My(o,l,performance.now()-p,f),f)})}return c}function My(e,t,n,s){try{e.record({tool:`ri.${t}`,perf:{ms_total:n},response:cO(s)})}catch{}}function cO(e){if(!e||typeof e!="object"||e.ok!==!0)return{ok:!1,reason:e?.miss?.reason||null};let t=0,n=e.value;if(Array.isArray(n))t=n.length;else if(n&&typeof n=="object")for(let s of Object.values(n))Array.isArray(s)&&(t+=s.length);return{ok:!0,count:t}}var dn,Cf,iO,Nc=M(()=>{Me();Cc();Py();dn=(e,t)=>(e?.attributes||[]).find(n=>n.key===t)?.value??null;Cf=200,iO=120});async function Gi(e,t){let n=await t.fetchEntities(e),s=ac(n);if(!s.individuals.length){let o=new Le(`the graph at ${e?.graphFile} is empty \u2014 no entities to answer from yet (this repo starts with no graph; the chat session folds the conversation into one).`);throw o.emptyGraph=!0,o}return s}var Lc=M(()=>{Qt();Me()});function mo({content:e,data:t,text:n=null}){return{content:e,data:t,text:n??e}}function pt(e,t){let n=String(e?.[t]||"").trim();if(!n)throw new Le(`${t} is required`);return n}function Mt(e,t,n){let{match:s,candidates:o}=$n(e.graph,t);if(!s)throw new Le(`no entity matching ${n} "${t}" in the code-map graph. Try a repo-relative path (e.g. path/to/module), a basename, or tmct_search for a fuzzy lookup.`);return{match:s,candidates:o}}var Vi,bt,ot=M(()=>{Qt();Me();Vi=200;bt=e=>(t,{graph:n,svc:s,config:o})=>{let{match:r}=Mt(s,pt(t,"symbol"),"symbol");return e(n,r,{toolNamePrefix:o?.toolNamePrefix})}});async function Fy(e,{config:t,source:n=Ar,trim:s=!1,tel:o=null}={}){let r=String(e?.symbol||"").trim();if(!r)throw new Le("symbol is required");let i=String(e?.depth||"auto").trim().toLowerCase(),a=!!e?.min,c=!!e?.untuned,l=!!e?.max,u=t?.toolNamePrefix||"tmct_",d=await Gi(t,n),p=$e($e(t.graphFile)),f=Oc(d,{sourceAccess:!0,repoRoot:p,readFile:Ne,tel:o,ask:fo}),{match:m}=Mt(f,r,"symbol"),h=Lr(d,m),b,g,w=!1;a||i==="min"?(b="TINY",g=zo("TINY")):l||i==="full"?(b="FULL",g=zo("FULL"),w=!0):{tier:b,mask:g,topup:w}=fc(h,d,{untuned:c}),s&&!l&&(g=Kb(g));let y=null;if(h.moduleLabel)try{({lines:y}=await Ds({readFile:Ne,repoRoot:p,path:h.moduleLabel}))}catch{y=null}let v=j=>y&&y[j-1]!=null?y[j-1].trim():"",R=(j,I)=>po(y,j,I,Vi).text,S=[`Edit context for ${h.moduleLabel} [${b}${s?" secondary":""}] \u2014 assembled from the typed graph + that file. You do NOT need to Read it; write the new code directly after reviewing this.`];if(g.anchor&&h.anchor?.site&&y){let{start:j,end:I}=h.anchor.site;S.push(`
70
+ ## anchor: ${h.anchor.label} (${h.anchor.class}) @ ${h.moduleLabel}:${j}-${I}`),S.push(R(j,I)),h.callHint&&S.push(h.callHint)}if(g.registration&&h.globals.length){S.push(`
71
+ ## registration / module globals (replicate this pattern):`);for(let j of h.globals)S.push(` ${j.label} = ${j.value}${j.site?` [:${j.site.start}]`:""}`)}if(g.exemplar&&h.exemplar?.site&&y){let{start:j,end:I}=h.exemplar.site,x=h.exemplar.decorators?` @${h.exemplar.decorators}`:"";S.push(`
72
+ ## closest example (full body) \u2014 copy this style: ${h.exemplar.label} (${h.exemplar.class})${x} @ ${h.moduleLabel}:${j}-${I}`),S.push(R(j,I)),h.callHint&&S.push(h.callHint)}if(g.inlinedCallees&&h.calleeBodies.length&&y){let j=120;for(let I of h.calleeBodies){if(j<=0)break;let x=I.site.start,$=I.site.path===h.moduleLabel&&y?y:await Ds({readFile:Ne,repoRoot:p,path:I.site.path}).then(C=>C.lines).catch(()=>null);if(!$)continue;let T=po($,x,I.site.end,j);S.push(`
73
+ ## inlined callee body (depth-1 in-repo call): ${I.label} @ ${I.site.path}:${x}-${I.site.end}`),S.push(T.text),j-=T.end-x+1}}if(g.classMembers&&h.classMembers&&h.classMembers.members.length){S.push(`
74
+ ## members of ${h.classMembers.className} (the edit likely lives INSIDE this class \u2014 copy a member's shape, do not read the class body):`);for(let j of h.classMembers.members){let I=String(j.label).split(".").pop(),x=j.params!=null&&j.params!==""?`(${j.params})${j.returns?` -> ${j.returns}`:""}`:"",_=j.decorators?`@${j.decorators} `:"",$=j.raises?` raises=${j.raises}`:"";S.push(` ${j.class} ${I}${j.site?` :${j.site.start}`:""} ${_}${I}${x}${$}`)}}if(g.siblings&&h.siblings.length){S.push(`
75
+ ## sibling symbols to copy the style of (most relevant first; ${h.siblings.length} total):`);for(let j of h.siblings.slice(0,h.siblingCap)){let I=j.site?v(j.site.start):"",x=j.decorators?`@${j.decorators} `:"",_=j.raises?` raises=${j.raises}`:"";S.push(` ${j.class} ${j.label}${j.site?` :${j.site.start}`:""} ${x}${I}${_}`)}h.siblings.length>h.siblingCap&&S.push(` \u2026+${h.siblings.length-h.siblingCap} more (use ${u}search kind=function or ${u}snippet <name> for any of them)`)}if(g.allExports&&h.allExports&&S.push(`
76
76
  ## module __all__ \u2014 this module curates its public API; ADD your new public symbol to this list so it is importable:
77
- ${h.allExports}`),g.reexports&&h.exports&&h.exports.length&&v.push(`
78
- ## re-exported symbols (resolved __all__ \u2192 defining module): ${h.exports.join(", ")}`),g.insertionRegion&&h.insertionRegion&&w){let k=h.insertionRegion.start,I=Math.min(w.length,k+40-1);v.push(`
79
- ## insertion region (write your new sibling here) \u2014 ${h.moduleLabel}:${k}-${I}`),v.push(w.slice(k-1,I).map((x,T)=>`${k+T} ${x}`).join(`
80
- `))}else h.insertion&&v.push(`
81
- ## insert the new sibling after line ~${h.insertion} (end of the last top-level definition).`);return g.tests&&h.tests.length&&v.push(`
82
- ## covering tests: ${h.tests.join(", ")}`),g.cochange&&h.cochange&&h.cochange.length&&v.push(`
83
- ## usually changed together (consider editing these too): ${h.cochange.map(k=>`${k.label} (\xD7${k.weight})`).join(", ")}`),v.push(`
84
- You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${h.moduleLabel}.`),b!=="FULL"&&v.push(`(bundle tier ${b}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:v.join(`
85
- `),tier:b,topup:y}}async function kf(e,{config:t,source:n,tel:s}){return(await Iy(e,{config:t,source:n,tel:s})).text}var Rf=P(()=>{Pt();Qe();Qt();Tc();$i();Fe();ns();Ic();Oc();ot();kf.ownsGraphLoad=!0});function Oy(e,{graph:t,svc:n}){let{match:s}=Ft(n,pt(e,"symbol"),"symbol");return Bb(Or(t,s))}var Ny=P(()=>{Fe();ot()});function Nc(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Ui(e){return Nc(e).toString(16).padStart(8,"0")}function _f(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let w=0;w<16;w+=1)i[w]=o.getUint32(u+w*4);for(let w=16;w<64;w+=1){let E=a(i[w-15],7)^a(i[w-15],18)^i[w-15]>>>3,R=a(i[w-2],17)^a(i[w-2],19)^i[w-2]>>>10;i[w]=i[w-16]+E+i[w-7]+R>>>0}let[d,p,f,m,h,b,g,y]=r;for(let w=0;w<64;w+=1){let E=a(h,6)^a(h,11)^a(h,25),R=h&b^~h&g,v=y+E+R+KI[w]+i[w]>>>0,k=a(d,2)^a(d,13)^a(d,22),I=d&p^d&f^p&f,x=k+I>>>0;y=g,g=b,b=h,h=m+v>>>0,m=f,f=p,p=d,d=v+x>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+b>>>0,r[6]=r[6]+g>>>0,r[7]=r[7]+y>>>0}let c=new Uint8Array(32),l=new DataView(c.buffer);for(let u=0;u<8;u+=1)l.setUint32(u*4,r[u]);return c}function HI(e,t){let n=_f(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function V(e){let t=os(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function rs(e){let t=os(e);return YI.get(t)??t}function Se(e,t,n){return Go(V(e),rs(t),V(n))}var KI,qI,os,YI,Go,Ze=P(()=>{KI=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);qI=2e3,os=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,qI);YI=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);Go=(e,t,n)=>`fact:${HI(`${e}\0${t}\0${n}`,8)}`});var un={};Lt(un,{CARDINALITY_RULE_CONFIDENCE:()=>tO,CAX_DW_RULE:()=>Af,CAX_DW_RULE_CONFIDENCE:()=>If,CAX_MAXC0_RULE_CONFIDENCE:()=>sO,CLS_SVF1_RULE:()=>Of,CLS_SVF1_RULE_CONFIDENCE:()=>Lf,DEFAULT_MAX_ENVIRONMENTS:()=>Vr,DISJOINT_PREDICATE:()=>Wr,ENTAILED_DISJOINT_PROVENANCE:()=>Cf,ENTAILED_PROVENANCE:()=>My,ENTAILED_SCM_SVF_PROVENANCE:()=>Df,ENTAILED_SVF1_PROVENANCE:()=>Nf,ENTAILED_TYPE_PROVENANCE:()=>Dy,ON_PROPERTY_PREDICATE:()=>An,SCM_SVF_RULE:()=>Ff,SCM_SVF_RULE_CONFIDENCE:()=>zf,SOME_VALUES_FROM_PREDICATE:()=>Cn,SUBCLASS_PREDICATE:()=>Be,TYPE_PREDICATE:()=>Dt,buildCardinalityRestrictions:()=>Mf,buildRelevanceFrontier:()=>Tf,buildSubClassSuccessors:()=>Lc,deriveDisjointViolations:()=>Wy,deriveSomeValuesFromApplication:()=>Gy,deriveSomeValuesFromSubsumption:()=>Vy,deriveSubClassClosure:()=>zy,deriveSubClassClosureDelta:()=>By,deriveTypePropagation:()=>Uy,entailedTrustFrom:()=>JI,findConsistencyViolations:()=>rO,findIsaChain:()=>Bf,proveCardinalityAtLeast:()=>nO,proveMaxCardinalityZeroDenial:()=>oO,retractSubClassOf:()=>lO,syllogise:()=>Hy});function Ly(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function JI(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function Ds(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function zy(e,{depth:t=32,budget:n=50,focus:s=null}={}){let o=new Set,r=new Map;for(let[u,d]of e||[])!u||!d||u===d||(o.add(`${u}${Ue}${d}`),r.has(u)||r.set(u,new Set),r.get(u).add(d));let i=s instanceof Set?s.size?s:null:Ds(s),a=(u,d,p)=>!i||i.has(u)||i.has(d)||i.has(p),c=[],l=new Set;for(let u=0;u<t;u+=1){let d=[];for(let[f,m]of r)for(let h of m){let b=r.get(h);if(b)for(let g of b){if(f===g)continue;let y=`${f}${Ue}${g}`;o.has(y)||l.has(y)||a(f,h,g)&&d.push([f,h,g,y])}}if(!d.length)break;d.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let p=!1;for(let[f,m,h,b]of d)if(!l.has(b)){if(c.length>=n)break;l.add(b),c.push({subject:f,object:h,via:m}),r.has(f)||r.set(f,new Set),r.get(f).add(h),p=!0}if(c.length>=n||!p)break}return c}function By(e,t,{depth:n=32,budget:s=50,focus:o=null}={}){let r=new Set,i=new Map,a=new Map;for(let[m,h]of e||[])!m||!h||m===h||(r.add(`${m}${Ue}${h}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),a.has(h)||a.set(h,new Set),a.get(h).add(m));let c=[],l=new Set;for(let[m,h]of t||[]){if(!m||!h||m===h)continue;let b=`${m}${Ue}${h}`;l.has(b)||(l.add(b),c.push([m,h]))}let u=o instanceof Set?o.size?o:null:Ds(o),d=(m,h,b)=>!u||u.has(m)||u.has(h)||u.has(b),p=[],f=new Set;for(let m=0;m<n&&c.length;m+=1){let h=[],b=(w,E,R)=>{if(w===R)return;let v=`${w}${Ue}${R}`;r.has(v)||f.has(v)||d(w,E,R)&&h.push([w,E,R,v])};for(let[w,E]of c){for(let R of i.get(E)||[])b(w,E,R);for(let R of a.get(w)||[])b(R,w,E)}if(!h.length)break;h.sort((w,E)=>w[0].localeCompare(E[0])||w[2].localeCompare(E[2])||w[1].localeCompare(E[1]));let g=!1,y=[];for(let[w,E,R,v]of h)if(!f.has(v)){if(p.length>=s)break;f.add(v),p.push({subject:w,object:R,via:E}),i.has(w)||i.set(w,new Set),i.get(w).add(R),a.has(R)||a.set(R,new Set),a.get(R).add(w),y.push([w,R]),g=!0}if(p.length>=s||!g)break;c=y}return p}function is(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function QI(e){return is((e||[]).map(([t,n])=>[n,t]))}function Tf(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(mo(l.predicate)?n.push([l.subject,l.object]):Ko(l.predicate)?s.push([l.subject,l.object]):Gr(l.predicate)?o.set(l.subject,l.object):Gi(l.predicate)&&r.set(l.subject,l.object));let i=QI(n),a=new Set;for(let l of t||[]){let u=V(l);if(u){a.add(u);for(let d of i(u))a.add(d)}}let c=new Set(a);for(let[l,u]of s)a.has(u)&&c.add(l);for(let[l,u]of r)o.has(l)&&a.has(u)&&c.add(l);return c}function Uy(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e}={}){let r=is(t),i=new Set,a=new Set;for(let[f,m]of o||[])f&&m&&i.add(`${f}${Ue}${m}`);let c=s instanceof Set?s.size?s:null:Ds(s),l=(f,m,h)=>!c||c.has(f)||c.has(m)||c.has(h),u=[];for(let[f,m]of e||[]){if(!f||!m)continue;let h=`${f}${Ue}${m}`;if(!a.has(h)){a.add(h);for(let b of r(m)){if(b===m||b===f)continue;let g=`${f}${Ue}${b}`;i.has(g)||l(f,m,b)&&u.push([f,m,b,g])}}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[2].localeCompare(m[2])||f[1].localeCompare(m[1]));let d=[],p=new Set;for(let[f,m,h,b]of u)if(!p.has(b)){if(d.length>=n)break;p.add(b),d.push({subject:f,object:h,via:m})}return d}function Wy(e,t,n,{budget:s=50,focus:o=null}={}){let r=is(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${Ue}${h}`),a.add(`${h}${Ue}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let c=new Set,l=o instanceof Set?o.size?o:null:Ds(o),u=(m,h,b)=>!l||l.has(m)||l.has(h)||l.has(b),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let b=`${m}${Ue}${h}`;if(!c.has(b)){c.add(b);for(let g of[h,...r(h)]){let y=i.get(g);if(y)for(let w of y){if(w===m)continue;let E=`${m}${Ue}${w}`;a.has(E)||u(m,h,w)&&d.push([m,h,g,w,E])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let p=[],f=new Set;for(let[m,h,b,g,y]of d)if(!f.has(y)){if(p.length>=s)break;f.add(y),p.push({subject:m,object:g,viaType:h,viaClass:b})}return p}function Gy(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=is(n),a=new Map;for(let b of s||[]){if(!b||!b.restriction||!b.property||!b.target)continue;let g=`${b.property}${Ue}${b.target}`;a.has(g)||a.set(g,new Set),a.get(g).add(b.restriction)}if(!a.size)return[];let c=new Set,l=new Map;for(let[b,g]of t||[])!b||!g||(c.add(`${b}${Ue}${g}`),l.has(b)||l.set(b,new Set),l.get(b).add(g));let u=r instanceof Set?r.size?r:null:Ds(r),d=(b,g,y)=>!u||u.has(b)||u.has(g)||u.has(y),p=new Set,f=[];for(let[b,g,y]of e||[]){if(!b||!g||!y)continue;let w=V(g),E=`${b}${Ue}${w}${Ue}${y}`;if(p.has(E))continue;p.add(E);let R=l.get(y);if(R)for(let v of R)for(let k of[v,...i(v)]){let I=a.get(`${w}${Ue}${k}`);if(I)for(let x of I){if(b===x)continue;let T=`${b}${Ue}${x}`;c.has(T)||d(b,y,x)&&f.push([b,g,w,y,v,k,x,T])}}}f.sort((b,g)=>b[0].localeCompare(g[0])||b[6].localeCompare(g[6])||b[1].localeCompare(g[1])||b[3].localeCompare(g[3]));let m=[],h=new Set;for(let[b,g,y,w,E,R,v,k]of f)if(!h.has(k)){if(m.length>=o)break;h.add(k),m.push({subject:b,object:v,viaProperty:g,viaPropertyKey:y,viaValue:w,viaType:E,viaTarget:R})}return m}function Mf(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Gr(r.predicate))t.set(r.subject,r.object);else if(XI(r.predicate))s.set(r.subject,r.object);else{let i=eO[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==ZI)continue;let c=s.get(r);c&&o.push({restriction:r,kind:i,n:a,onClass:c})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function Vy(e,t,{budget:n=50,focus:s=null}={}){let o=is(t),r=new Map;for(let p of e||[]){if(!p||!p.restriction||!p.property||!p.target)continue;let f=V(p.property);r.has(f)||r.set(f,[]),r.get(f).push({restriction:p.restriction,target:p.target})}let i=new Set;for(let[p,f]of t||[])p&&f&&i.add(`${p}${Ue}${f}`);let a=s instanceof Set?s.size?s:null:Ds(s),c=(p,f)=>!a||a.has(p)||a.has(f),l=[];for(let[,p]of r)if(!(p.length<2))for(let f of p)for(let m of p){if(f.restriction===m.restriction||f.target===m.target||!o(f.target).has(m.target))continue;let h=`${f.restriction}${Ue}${m.restriction}`;i.has(h)||c(f.restriction,m.restriction)&&l.push([f.restriction,m.restriction,f.target,m.target,h])}l.sort((p,f)=>p[0].localeCompare(f[0])||p[1].localeCompare(f[1]));let u=[],d=new Set;for(let[p,f,m,h,b]of l)if(!d.has(b)){if(u.length>=n)break;d.add(b),u.push({subject:p,object:f,viaY1:m,viaY2:h})}return u}function Ky(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=is(e),a=r instanceof Set?r.size?r:null:Ds(r),c=p=>!a||a.has(n)||a.has(p),l=new Map;for(let[p,f]of e||[])!p||!f||(l.has(p)||l.set(p,new Set),l.get(p).add(f));let u=new Map((t||[]).map(p=>[p.restriction,p])),d=0;for(let p of[n,...i(n)]){if(d>=o)break;if(d+=1,!!c(p))for(let f of l.get(p)||[]){let m=u.get(f);if(m&&s(m))return{viaClass:p,viaRestriction:f,record:m}}}return null}function nO(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=Ky(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function oO(e,t,n,s,o={}){if(!s)return null;let r=Ky(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function rO(e,t,n,{budget:s=50,focus:o=null}={}){let r=is(t),i=new Map;for(let[f,m]of n||[])!f||!m||f===m||(i.has(f)||i.set(f,new Set),i.get(f).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(f));if(!i.size)return[];let a=new Map;for(let[f,m]of e||[])!f||!m||(a.has(f)||a.set(f,new Set),a.get(f).add(m));let c=o instanceof Set?o.size?o:null:Ds(o),l=f=>!c||c.has(f),u=[],d=new Set;for(let[f,m]of a){if(!l(f))continue;let h=[...m].sort();for(let b=0;b<h.length;b+=1)for(let g=b+1;g<h.length;g+=1){let[y,w]=[h[b],h[g]],E=[y,...r(y)],R=[w,...r(w)],v=null;for(let I of E){let x=i.get(I);if(x){for(let T of R)if(x.has(T)){v=[I,T];break}if(v)break}}if(!v)continue;let k=`${f}${Ue}${y}${Ue}${w}`;d.has(k)||(d.add(k),u.push([f,y,w,v[0],v[1]]))}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[1].localeCompare(m[1])||f[2].localeCompare(m[2]));let p=[];for(let[f,m,h,b,g]of u){if(p.length>=s)break;p.push({subject:f,classA:m,classB:h,viaA:b,viaB:g})}return p}async function Hy(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=Vr,full:i=!1,store:a}={}){let{loadMemory:c,readFactRows:l,appendFacts:u}=Ly(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),d=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",p=await c(e),f=l(p),m=f.filter(A=>mo(A.predicate)).map(A=>[A.subject,A.object]),h=f.filter(A=>Ko(A.predicate)).map(A=>[A.subject,A.object]),b=f.filter(A=>Vo(A.predicate)).map(A=>[A.subject,A.object]),g=new Map,y=new Map,w=[];for(let A of f){let ge=String(A.predicate||"").trim().toLowerCase();Gr(A.predicate)?g.set(A.subject,A.object):Gi(A.predicate)?y.set(A.subject,A.object):Pf.has(ge)||w.push([A.subject,A.predicate,A.object])}let E=[];for(let[A,ge]of g){let Oe=y.get(A);Oe&&E.push({restriction:A,property:ge,target:Oe})}let R=Ds(s),v=o&&R?Tf(f,[...R]):R,k=v===null&&d?await a.loadSyllogiseState(e):null,I=new Set(f.map(A=>A.id)),x=Array.isArray(k?.factIds)?k.factIds.filter(A=>!I.has(A)):[],T=k&&Array.isArray(k.factIds)&&!x.length&&!i?"delta":"full",$=T==="delta"?new Set(k.factIds):null,_=T==="delta"?f.filter(A=>!$.has(A.id)):f,C=_.length,S=new Map;for(let A of f)S.set(`${A.subject}${Ue}${A.predicate}${Ue}${A.object}`,A.trust);let j=(A,ge,Oe)=>S.get(`${A}${Ue}${ge}${Ue}${Oe}`),M=(A,ge,Oe)=>S.has(`${A}${Ue}${ge}${Ue}${Oe}`),z=A=>A.filter(ge=>typeof ge=="number"),K=T==="delta"&&!_.length,Y=T==="delta"?_.filter(A=>mo(A.predicate)).map(A=>[A.subject,A.object]):[],X=T==="delta"?Y.length?By(m,Y,{depth:t,budget:n,focus:v}):[]:zy(m,{depth:t,budget:n,focus:v}),L=m.concat(X.map(A=>[A.subject,A.object])),H=v,W=null;if(T==="delta"&&!K){let A=f.concat(X.map(Oe=>({subject:Oe.subject,predicate:Be,object:Oe.object}))),ge=[];for(let Oe of _)ge.push(Oe.subject,Oe.object);W=Tf(A,ge),H=W}let O=A=>!W||W.has(A),D=W?h.filter(([A,ge])=>O(A)||O(ge)):h,N=new Set;if(W)for(let A of _)Vo(A.predicate)&&(N.add(A.subject),N.add(A.object));let F=W&&N.size?is(L):null,B=W?h.filter(([A,ge])=>O(A)||O(ge)||F&&[...F(ge)].some(Oe=>N.has(Oe))):h,U=new Set;if(W){for(let A of _)if(Gr(A.predicate)||Gi(A.predicate)){let ge=g.get(A.subject);ge&&U.add(V(ge))}}let G=W?w.filter(([A,ge,Oe])=>O(A)||O(Oe)||U.has(V(ge))):w,Q=Math.max(0,n-X.length),ie=Q>0&&!K?Uy(D,L,{budget:Q,focus:H,presentTypeEdges:h}):[],fe=Math.max(0,n-X.length-ie.length),ae=fe>0&&!K?Wy(B,L,b,{budget:fe,focus:H}):[],Z=Math.max(0,n-X.length-ie.length-ae.length),J=Z>0&&E.length&&!K?Gy(G,h,L,E,{budget:Z,focus:H}):[],te=Math.max(0,n-X.length-ie.length-ae.length-J.length),oe=te>0&&E.length>1&&!K?Vy(E,L,{budget:te,focus:H}):[],Ae=new Map(E.map(A=>[A.restriction,A])),pe=[...X.map(A=>({subject:A.subject,predicate:Be,object:A.object,provenance:My,justification:[[Se(A.subject,Be,A.via),Se(A.via,Be,A.object)]]})),...ie.map(A=>({subject:A.subject,predicate:Dt,object:A.object,provenance:Dy,justification:[[Se(A.subject,Dt,A.via),Se(A.via,Be,A.object)]]})),...ae.map(A=>{let ge=M(A.viaClass,Wr,A.object),[Oe,Es]=ge?[A.viaClass,A.object]:[A.object,A.viaClass],xs=z([j(A.subject,Dt,A.viaType),j(Oe,Wr,Es),...A.viaClass!==A.viaType?[j(A.viaType,Be,A.viaClass)]:[]]);return{subject:A.subject,predicate:Wr,object:A.object,provenance:Cf,justification:[[Se(A.subject,Dt,A.viaType),Se(Oe,Wr,Es),...A.viaClass!==A.viaType?[Se(A.viaType,Be,A.viaClass)]:[]]],...xs.length?{premiseTrusts:xs,ruleConfidence:If}:{}}}),...J.map(A=>{let ge=z([j(A.subject,A.viaProperty,A.viaValue),j(A.viaValue,Dt,A.viaType),j(A.object,An,A.viaPropertyKey),j(A.object,Cn,A.viaTarget),...A.viaType!==A.viaTarget?[j(A.viaType,Be,A.viaTarget)]:[]]);return{subject:A.subject,predicate:Dt,object:A.object,provenance:Nf,justification:[[Se(A.subject,A.viaProperty,A.viaValue),Se(A.viaValue,Dt,A.viaType),Se(A.object,An,A.viaPropertyKey),Se(A.object,Cn,A.viaTarget),...A.viaType!==A.viaTarget?[Se(A.viaType,Be,A.viaTarget)]:[]]],...ge.length?{premiseTrusts:ge,ruleConfidence:Lf}:{}}}),...oe.map(A=>{let ge=Ae.get(A.subject),Oe=Ae.get(A.object),Es=z([ge&&j(A.subject,An,ge.property),j(A.subject,Cn,A.viaY1),Oe&&j(A.object,An,Oe.property),j(A.object,Cn,A.viaY2),j(A.viaY1,Be,A.viaY2)]);return{subject:A.subject,predicate:Be,object:A.object,provenance:Df,justification:[[...ge?[Se(A.subject,An,ge.property)]:[],Se(A.subject,Cn,A.viaY1),...Oe?[Se(A.object,An,Oe.property)]:[],Se(A.object,Cn,A.viaY2),Se(A.viaY1,Be,A.viaY2)]],...Es.length?{premiseTrusts:Es,ruleConfidence:zf}:{}}})],je=pe.map(A=>({id:Se(A.subject,A.predicate,A.object),subject:A.subject,predicate:A.predicate,object:A.object,environments:A.justification,write:A})),Le=Yy(f.concat(je.map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object})))),ke=new Map(f.map(A=>[A.id,A])),Xe=A=>mo(A)||Ko(A)||Vo(A),ce=A=>T!=="delta"||W!==null&&(W.has(A.subject)||W.has(A.object)),le=f.filter(A=>Xe(A.predicate)&&qy(A.provenance)&&Wi(A).length<r&&ce(A)).map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object,environments:Wi(A),provenance:A.provenance})),me=[...je,...le].sort((A,ge)=>A.subject.localeCompare(ge.subject)||A.predicate.localeCompare(ge.predicate)||A.object.localeCompare(ge.object)),Je=0,Ot=!1,re=0;for(let A of me){if(re>=n){Ot=!0;break}re+=1;let ge=Le(A,{maxEnvironments:r+1}),{kept:Oe,truncated:Es}=aO(A.environments,ge,r);if(Es&&(Ot=!0),!(Oe.length<=A.environments.length)){if(Je+=Oe.length-A.environments.length,A.write){A.write.justification=Oe;continue}pe.push({subject:A.subject,predicate:A.predicate,object:A.object,justification:Oe,...Xy(A.provenance,Oe,xs=>ke.get(xs)?.trust)||{}})}}let{ids:Pe}=await u(e,pe),it=[],ze=0;for(let A of X)it.push({id:Pe[ze],subject:A.subject,object:A.object,via:A.via,rule:Py}),ze+=1;for(let A of ie)it.push({id:Pe[ze],subject:A.subject,object:A.object,via:A.via,rule:Fy}),ze+=1;for(let A of ae)it.push({id:Pe[ze],subject:A.subject,object:A.object,via:A.viaClass,rule:Af}),ze+=1;for(let A of J)it.push({id:Pe[ze],subject:A.subject,object:A.object,via:A.viaValue,rule:Of}),ze+=1;for(let A of oe)it.push({id:Pe[ze],subject:A.subject,object:A.object,via:A.viaY1,rule:Ff}),ze+=1;let Xs=it.length>=n;if(v===null&&d&&!Xs){let A=new Set(I);for(let ge of Pe)A.add(ge);await a.saveSyllogiseState(e,{version:1,factIds:[...A].sort(),completedAt:new Date().toISOString()})}return{derived:it,count:it.length,budget:n,depth:t,truncated:Xs,mode:T,deltaSize:C,environmentsAdded:Je,alternatesTruncated:Ot}}function qy(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function iO(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();mo(u.predicate)?t.push([u.subject,u.object]):Ko(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):Vo(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):Gr(u.predicate)?o.set(u.subject,u.object):Gi(u.predicate)?r.set(u.subject,u.object):Pf.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([V(u.predicate),u.object]))}let a=is(t),c=(u,d)=>u!==d&&a(u).has(d),l=u=>{let d=o.get(u),p=r.get(u);return d&&p?{property:V(d),target:p}:null};return u=>{if(mo(u.predicate)){if(c(u.subject,u.object))return!0;let d=l(u.subject),p=l(u.object);return!!(d&&p&&d.property===p.property&&c(d.target,p.target))}if(Ko(u.predicate)){for(let p of n.get(u.subject)||[])if(c(p,u.object))return!0;let d=l(u.object);if(d){for(let[p,f]of i.get(u.subject)||[])if(p===d.property){for(let m of n.get(f)||[])if(m===d.target||c(m,d.target))return!0}}return!1}if(Vo(u.predicate)){for(let d of n.get(u.subject)||[])for(let p of[d,...a(d)])if(s.get(p)?.has(u.object))return!0;return!1}return!0}}function Yy(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,c=new Map,l=new Map;for(let f of e){if(!f||!f.subject||!f.predicate||!f.object)continue;f.id&&t.add(f.id);let m=String(f.predicate||"").trim().toLowerCase();mo(f.predicate)?(n.push([f.subject,f.object]),s.has(f.subject)||s.set(f.subject,new Set),s.get(f.subject).add(f.object)):Ko(f.predicate)?(o.has(f.subject)||o.set(f.subject,new Set),o.get(f.subject).add(f.object)):Vo(f.predicate)?(r.add(`${f.subject}${Ue}${f.object}`),i.has(f.subject)||i.set(f.subject,new Set),i.get(f.subject).add(f.object),i.has(f.object)||i.set(f.object,new Set),i.get(f.object).add(f.subject)):Gr(f.predicate)?a.set(f.subject,f.object):Gi(f.predicate)?c.set(f.subject,f.object):Pf.has(m)||(l.has(f.subject)||l.set(f.subject,[]),l.get(f.subject).push([f.predicate,f.object]))}let u=is(n),d=f=>s.get(f)||new Set,p=f=>{let m=a.get(f),h=c.get(f);return m&&h?{property:m,propertyKey:V(m),target:h}:null};return(f,{maxEnvironments:m=Vr}={})=>{let h=[],b=new Set,g=y=>{if(h.length>=m||f.id&&y.includes(f.id)||!y.every(E=>t.has(E)))return;let w=[...y].sort().join(" ");b.has(w)||(b.add(w),h.push(y))};if(mo(f.predicate)){for(let y of[...d(f.subject)].sort()){if(h.length>=m)break;y===f.subject||y===f.object||d(y).has(f.object)&&g([Se(f.subject,Be,y),Se(y,Be,f.object)])}if(h.length<m){let y=p(f.subject),w=p(f.object);y&&w&&y.propertyKey===w.propertyKey&&y.target!==w.target&&d(y.target).has(w.target)&&g([Se(f.subject,An,y.property),Se(f.subject,Cn,y.target),Se(f.object,An,w.property),Se(f.object,Cn,w.target),Se(y.target,Be,w.target)])}return h}if(Ko(f.predicate)){for(let w of[...o.get(f.subject)||[]].sort()){if(h.length>=m)break;w!==f.object&&d(w).has(f.object)&&g([Se(f.subject,Dt,w),Se(w,Be,f.object)])}let y=p(f.object);if(y){let w=[...l.get(f.subject)||[]].filter(([E])=>V(E)===y.propertyKey).sort((E,R)=>E[0].localeCompare(R[0])||E[1].localeCompare(R[1]));for(let[E,R]of w){if(h.length>=m)break;for(let v of[...o.get(R)||[]].sort()){if(h.length>=m)break;v!==y.target&&!d(v).has(y.target)||g([Se(f.subject,E,R),Se(R,Dt,v),Se(f.object,An,y.propertyKey),Se(f.object,Cn,y.target),...v!==y.target?[Se(v,Be,y.target)]:[]])}}}return h}if(Vo(f.predicate)){let y=[];for(let w of o.get(f.subject)||[])for(let E of[w,...u(w)])(i.get(E)||new Set).has(f.object)&&y.push([w,E]);y.sort((w,E)=>w[0].localeCompare(E[0])||w[1].localeCompare(E[1]));for(let[w,E]of y){if(h.length>=m)break;let R=r.has(`${E}${Ue}${f.object}`),[v,k]=R?[E,f.object]:[f.object,E];g([Se(f.subject,Dt,w),Se(v,Wr,k),...E!==w?[Se(w,Be,E)]:[]])}return h}return h}}function aO(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function Xy(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=cO.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(l=>n(l)).filter(l=>typeof l=="number");if(a.length!==i.length)continue;let c=Math.min(...a);c>r&&(r=c,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function lO(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=Vr,store:i,sourceTags:a=[],predicate:c=Be}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Ly(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),p=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,m=(a||[]).filter(Boolean);if(m.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=V(t),b=V(n),g=Se(h,c,b),y=await l(e),w=u(y),E=new Map(w.map(M=>[M.id,M]));if(!E.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let R=E.get(g).sourceIds||[],v=m.map(M=>f(g,M).slice(g.length+1)),k=m.length?R.filter(M=>v.includes(M)):[],I=!m.length||k.length>0;if(m.length&&!I)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let x=m.length>0&&k.length<R.length,T=new Set([g]),$=[g],_=new Map,C=!1;if(!x){let M=w.filter(X=>Wi(X).length&&qy(X.provenance)),z=new Map;for(let X of M)for(let L of Wi(X))for(let H of L)z.has(H)||z.set(H,new Set),z.get(H).add(X.id);let K=0,Y=[g];for(;K<o;K+=1){let X=new Set;for(let B of Y)for(let U of z.get(B)||[])T.has(U)||X.add(U);let L=[...X].map(B=>E.get(B)).sort((B,U)=>B.subject.localeCompare(U.subject)||B.predicate.localeCompare(U.predicate)||B.object.localeCompare(U.object));if(!L.length)break;let H=w.filter(B=>!T.has(B.id)&&!X.has(B.id)),W=new Set(H.map(B=>B.id)),O=Yy(H),D=iO(H),N=!1,F=!1;Y=[];for(let B of L){if(T.size>=s){F=!0;break}let U=Wi(B),G=U.filter(ie=>ie.every(fe=>W.has(fe)));if(G.length){G.length!==U.length&&_.set(B.id,G);continue}let Q=O(B,{maxEnvironments:r});if(Q.length){_.set(B.id,Q);continue}D(B)||(T.add(B.id),$.push(B.id),Y.push(B.id),N=!0)}if(F){C=!0;break}if(!N)break}!C&&K>=o&&(C=M.some(X=>!T.has(X.id)&&X.justification.some(L=>T.has(L))))}let S=m.length?[...k.map(M=>`${g}@${M}`),...$.slice(1)]:$,{removed:j}=await d(e,S);if(p){let M=[..._.entries()].filter(([z])=>!T.has(z)).sort((z,K)=>z[0].localeCompare(K[0])).map(([z,K])=>{let Y=E.get(z);return{subject:Y.subject,predicate:Y.predicate,object:Y.object,justification:K,...Xy(Y.provenance,K,X=>E.get(X)?.trust)||{}}});M.length&&await p(e,M)}return{retracted:j,count:j.length,budget:s,depth:o,truncated:C,found:!0,...m.length?{ownRecord:!0,stillStands:x}:{}}}function Lc(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function Bf(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:Lc(s),a=[];for(let[l,u]of n||[])l===e&&u&&a.push({node:u,path:[{subject:l,predicate:Dt,object:u}]});for(let l of i.get(e)||[])a.push({node:l,path:[{subject:e,predicate:Be,object:l}]});let c=new Set([e]);for(let l=1;l<=o&&a.length;l+=1){for(let{node:d,path:p}of a)if(r.has(d))return p;if(l===o)break;let u=[];for(let{node:d,path:p}of a)if(!c.has(d)){c.add(d);for(let f of i.get(d)||[])c.has(f)||u.push({node:f,path:[...p,{subject:d,predicate:Be,object:f}]})}a=u}return null}var Be,Py,My,Dt,Fy,Dy,Wr,Af,Cf,If,An,Cn,Of,Nf,Lf,Vr,Ue,mo,Ko,Vo,Gr,Gi,XI,Pf,ZI,eO,Ff,Df,zf,tO,sO,Wi,cO,It=P(()=>{Ze();Be="rdfs:subClassOf",Py="subClassOf",My=`entailed:${Py}`,Dt="rdf:type",Fy="type",Dy=`entailed:${Fy}`,Wr="owl:disjointWith",Af="disjointWith",Cf=`entailed:${Af}`,If=.95,An="owl:onProperty",Cn="owl:someValuesFrom",Of="someValuesFrom",Nf=`entailed:${Of}`,Lf=.95,Vr=4,Ue="\u241F",mo=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",Ko=e=>String(e||"").trim().toLowerCase()==="rdf:type",Vo=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Gr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",Gi=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",XI=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Pf=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);ZI="has",eO={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Ff="someValuesFromSubsumption",Df=`entailed:${Ff}`,zf=.95;tO=.95;sO=.95;Wi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);cO=new Map([[Cf,If],[Nf,Lf],[Df,zf]])});function qr(e){let t=String(e||""),n=Qy.get(t);return n||(t.startsWith(Jy)?Pc+t.slice(Jy.length):t)}function t$(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=Bf(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function Dc(e,t,n,{maxHops:s=3}={}){let o=Hr(e),r=Hr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=e$(i),l=i.filter(g=>(g.predicate===Fc||g.predicate===Kr)&&r.has(g.object)),u=[];for(let g of l){let y=g.predicate===Kr?"negative":"positive";if(o.has(g.subject)){u.push({fact:g,polarity:y,hops:0,chain:null});continue}let w=t$(o,g.subject,a,c,s);w&&w.length&&u.push({fact:g,polarity:y,hops:w.length,chain:w})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Wf(o,r,i,{maxHops:s})};u.sort((g,y)=>g.hops-y.hops||(y.fact.trust||0)-(g.fact.trust||0));let d=u[0].hops,p=u.filter(g=>g.hops===d),f=p.filter(g=>g.polarity==="positive").map(g=>g.fact),m=p.filter(g=>g.polarity==="negative").map(g=>g.fact),h=m.length&&!f.length?"negative":"positive",b=u.find(g=>g.hops>d&&g.polarity!==h)||null;return{verdict:f.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:f,negative:m,chain:u[0].chain,overrides:b?{fact:b.fact,chain:b.chain}:null,baseRate:null}}function Wf(e,t,n,{maxHops:s=3}={}){let o=Hr(e),r=Hr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===Be||h.predicate===Dt),c=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!c.length)return null;let l=c[0],u=[...new Set(a.filter(h=>h.object===l&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let b=i.find(g=>g.subject===h&&r.has(g.object)&&(g.predicate===Fc||g.predicate===Kr));return b?{name:h,polarity:b.predicate===Kr?"negative":"positive",fact:b}:{name:h,polarity:"unknown",fact:null}},p=u.map(d),{typeEdges:f,subClassSucc:m}=e$(i);return{klass:l,kinds:u.length,positive:p.filter(h=>h.polarity==="positive"),negative:p.filter(h=>h.polarity==="negative"),unknown:p.filter(h=>h.polarity==="unknown"),chain:t$(o,l,f,m,s)}}function Gf(e,t,{exclude:n=[],maxHops:s=3}={}){let o=Hr(e),r=Hr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==Fc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),Dc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(uO)}var Pc,Jy,Mc,Qy,PW,Zy,Fc,Kr,Uf,uO,Hr,e$,zc=P(()=>{It();Pc="mgxneg:",Jy="mgx:",Mc="mgxneg:subClassOf",Qy=new Map([[Be,Mc]]),PW=new Map([...Qy].map(([e,t])=>[t,e]));Zy=e=>String(e||"").startsWith(Pc),Fc="mgx:capableOf",Kr=qr(Fc),Uf=6,uO=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),Hr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),e$=e=>{let t=e.filter(s=>s.predicate===Dt).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===Be).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:Lc(n)}}});function Bc(e){let t=String(e||"");return Hf.has(t)?Vf:fO.has(t)||pO.test(t)?Vi:mO.has(t)?n$:Kf}function hO(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(Ug.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function gO(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(hO(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function qf(e,t){let n=t===n$;if(!n&&t!==Vi)return null;let s=(e||[]).map(r=>({row:r,at:gO(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[c,l]=[String(r.row.object),String(i.row.object)];return c<l?-1:c>l?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Vf,Vi,n$,Kf,dO,Hf,fO,pO,mO,s$=P(()=>{zc();_n();Vf="merge",Vi="latest-observation-wins",n$="first-claim-wins",Kf="contradiction",dO=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],Hf=new Set(dO.flatMap(e=>[e,qr(e)])),fO=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),pO=/^mgx:has-exit-([a-z]+)$/,mO=new Set(["mgx:playedBy"])});function qi(e){let t=String(e||""),n=t.indexOf(Uc);return n<0?"":t.slice(n+Uc.length)}function vO(e){let t=1,n=0;for(let s of e)t*=1-yO(s),n+=1;return n?$O(Math.min(1,1-t)):0}function c$(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function d$(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function f$(e,t="",n=""){let s=t,o=n;for(let r of e)s=l$(s,r.assertedAt),o=u$(o,r.assertedAt);return{earliest:s,latest:o}}function Qf({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let c=[...new Set(o)].filter(Boolean).sort(),l=a?vO(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:bO,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===Yr?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:Hi,key:"rollupCount",value:String(c.length)},{prop:as,key:"rollupEarliest",value:r},{prop:cs,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:Xr,key:"rollupPrior",value:String(l)}]]}}function p$({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort(d$).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=f$(i,zt(s,as),zt(s,cs));return{rollup:Qf({id:Yf(e,t),sourceKey:`rollup:${t}`,template:Zf(i[0].record||s),idsProp:Yr,ids:[...Yi(s),...i.map(u=>u.sourceId)],earliest:a,latest:c,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function m$({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort(d$),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=f$(i,zt(s,as),zt(s,cs));return{rollup:Qf({id:Xf(e,t),sourceKey:t,template:Zf(i[0].record||s),idsProp:Ki,ids:[...wO(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function ep(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=zs(s),r=o?Yr:Ki,i=a=>Jf(zt(a,r));return Qf({id:s,sourceKey:zt(e,"mgx:sourceId")||zt(t,"mgx:sourceId"),template:Zf(zt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:l$(zt(e,as),zt(t,as)),latest:u$(zt(e,cs),zt(t,cs)),priorFor:o?n:void 0})}function h$(e,t){if(!t)return!1;for(let n of e||[])if(Yi(n).includes(t))return!0;return!1}var bO,o$,r$,Wc,i$,Yr,Ki,Hi,as,cs,Xr,Uc,a$,Yf,Xf,zs,Jr,Gc,zt,Jf,Yi,wO,yO,$O,l$,u$,Zf,tp=P(()=>{bO="Fact",o$=64,r$=8,Wc=8,i$=2,Yr="mgx:rollupSourceIds",Ki="mgx:rollupRecordIds",Hi="mgx:rollupCount",as="mgx:rollupEarliest",cs="mgx:rollupLatest",Xr="mgx:rollupPrior",Uc="@rollup:",a$="#rollup",Yf=(e,t)=>`${e}${Uc}${t}`,Xf=(e,t)=>`${e}@${t}${a$}`,zs=e=>String(e||"").includes(Uc),Jr=e=>String(e||"").endsWith(a$),Gc=e=>zs(e)||Jr(e);zt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",Jf=e=>String(e||"").split(" ").filter(Boolean),Yi=e=>Jf(zt(e,Yr)),wO=e=>Jf(zt(e,Ki)),yO=e=>Math.max(0,Math.min(1,Number(e)||0)),$O=e=>Number(e.toFixed(6));l$=(e,t)=>c$(e,t,Math.min),u$=(e,t)=>c$(e,t,Math.max);Zf=e=>({label:e?.label||"",subject:zt(e,"rdf:subject"),predicate:zt(e,"rdf:predicate"),object:zt(e,"rdf:object")})});function rp(e){let t=String(e||"");return op(t)?t.slice(0,-qc.length):""}function g$(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function ip({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:Yt,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:Kc,key:"retractedRecordIds",value:i.join(" ")},{prop:np,key:"retractedCount",value:String(i.length)},{prop:Hc,key:"retractedAt",value:o||""},...a.length?[{prop:Xi,key:"provenance",value:a.join(" | ")}]:[]]}}function w$({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...Ho(o),...n].filter(Boolean);return a.length?ip({id:sp(e,t),sourceId:t,template:r||b$(o),ids:a,retractedAt:g$(qo(o),s),tags:[...Ji(In(o,Xi)),...Ji(i)]}):null}function y$(e,t){let n=b$(In(e,"rdf:subject")?e:t);return ip({id:e?.id||t?.id,sourceId:In(e,"mgx:sourceId")||In(t,"mgx:sourceId"),template:n,ids:[...Ho(e),...Ho(t)],retractedAt:g$(qo(e),qo(t)),tags:[...Ji(In(e,Xi)),...Ji(In(t,Xi))]})}function EO(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function xO(e,t,n=""){return!e||!t||!Ho(e).includes(t)?!1:EO(n,qo(e))}function Yc(e,t,n=""){for(let s of e||[])if(xO(s,t,n))return!0;return!1}function jO(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function kO(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function Xc(e){let t=rp(e?.id);return t?{id:e.id,subject:t,predicate:Vc,object:jO(qo(e),Ho(e)),provenance:In(e,Xi)}:null}function Jc(e){if(!e||e.predicate!==Vc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=kO(e.object);return o.length?ip({id:`${t}${qc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:Ji(e.provenance)}):null}var Yt,Vc,Kc,Hc,np,qc,Xi,sp,op,In,SO,Ji,Ho,qo,b$,ap=P(()=>{Yt="Retraction",Vc="mgx:retracted",Kc="mgx:retractedRecordIds",Hc="mgx:retractedAt",np="mgx:retractedCount",qc="#retracted",Xi="mgx:factProvenance",sp=(e,t)=>`${e}@${t}${qc}`,op=e=>String(e||"").endsWith(qc);In=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",SO=e=>String(e||"").split(" ").filter(Boolean),Ji=e=>String(e||"").split(" | ").filter(Boolean),Ho=e=>SO(In(e,Kc)),qo=e=>In(e,Hc);b$=e=>({label:e?.label||"",subject:In(e,"rdf:subject"),predicate:In(e,"rdf:predicate"),object:In(e,"rdf:object")})});var RO,_O,TO,AO,cp,GW,$$=P(()=>{_n();RO="mgx:worldName",_O="mgx:nodeName",TO="mgx:playedBy",AO="mgx:waved",cp="mgx:invitedBy",GW=Object.freeze([RO,_O,TO,AO,cp])});function Qc(e){let t=new Set;for(let n of e||[])n?.predicate===cp&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function lp(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function Zc({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=lp(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let c=s(a);r.set(a,new Set([...c||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(c=>r.get(c).has(a)))}var up=P(()=>{$$()});function ls(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function MO(e,t){(!e?.class||!CO.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function FO(e,t){for(let a of["rdf:subject","rdf:predicate","rdf:object"])Qi(ls(e,a))||t.push(`a Fact needs a non-empty ${a}`);for(let a of["rdf:subject","rdf:object"]){let c=ls(e,a);c!==void 0&&NO.test(c)&&t.push(`a Fact's ${a} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(c)})`)}let n=ls(e,"mgx:factProvenance");n!==void 0&&!Qi(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";LO(s)&&!S$.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=ls(e,"mgx:sourceId");o!==void 0&&!Qi(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=ls(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);let i=ls(e,"mgx:extractionFinding");if(i!==void 0){let a=i.split(" ").filter(Boolean);a.length||t.push("mgx:extractionFinding, when present, must name at least one finding");for(let c of a)IO.has(c)||t.push(`mgx:extractionFinding must name findings from the closed vocabulary ${el.join(" | ")} (got ${JSON.stringify(c)})`)}for(let a of PO){let c=ls(e,a);if(c===void 0)continue;let l=c.split(" ").filter(Boolean);l.length||t.push(`${a}, when present, must name at least one record id`);for(let u of l)S$.test(u)||t.push(`${a} must name Fact record ids (got ${JSON.stringify(u)})`)}}function DO(e,t){Qi(ls(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=ls(e,"mgx:ruleKind");if(!n||!v$.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...v$].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of OO[n])Qi(ls(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function zO(e){let t=[];return MO(e,t),e?.class==="Fact"&&FO(e,t),e?.class==="Rule"&&DO(e,t),{ok:t.length===0,violations:t}}function dp(e){let t=zO(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var CO,el,IO,v$,OO,NO,S$,LO,PO,Qi,fp=P(()=>{CO=new Set(["Utterance","Fact","Session","Source","Rule"]),el=Object.freeze(["identifier-token","clause-fallback","pronoun-carry","definitional-frame"]),IO=new Set(el),v$=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),OO={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},NO=/[.!?]\s+\w/,S$=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,LO=e=>e.includes("@")||/#v\d/.test(e),PO=["mgx:supersedes","mgx:supersededBy"];Qi=e=>typeof e=="string"&&e.trim().length>0});function j$(e,t){return t?.rowKey&&(e.rowKey=t.rowKey),t?.rowClass&&(e.rowClass=t.rowClass),t?.provenance&&(e.provenance=t.provenance),t?.status&&(e.status=t.status),e}function ea(e){let t=[];if(!e||typeof e!="object")return["not an object"];e.kind!==Qr&&t.push(`kind is ${JSON.stringify(e.kind)}, expected ${JSON.stringify(Qr)}`),e.contractVersion!==1&&t.push(`contractVersion is ${JSON.stringify(e.contractVersion)}, expected 1`);for(let n of BO)typeof e[n]!="function"&&t.push(`${n}() is missing`);for(let n of UO)n in e&&e[n]!=null&&typeof e[n]!="function"&&t.push(`${n} is present but not a function`);return t}function sl(e){return ea(e).length===0}function pp(e){return new TextEncoder().encode(String(e?.json??"")).length}function ol(e){let t=[];if(!e||typeof e!="object")return["not an object"];if((typeof e.rowKey!="string"||!e.rowKey)&&t.push("rowKey must be a non-empty string"),tl.includes(e.rowClass)||t.push(`rowClass ${JSON.stringify(e.rowClass)} is outside the closed set (${tl.join(", ")})`),typeof e.term!="string"&&t.push("term must be a string, empty when the row has no term read path"),typeof e.json!="string"||!e.json)t.push("json must be a non-empty string");else{let n=pp(e);n>Yo&&t.push(`json is ${n} bytes, over the ${Yo}-byte cap`)}return e.expiresAt!==void 0&&!Number.isInteger(e.expiresAt)&&t.push("expiresAt must be epoch seconds as an integer when present"),t}function k$(e){return ol(e).length===0}function ta(e,t={}){let n=ol(e);if(!n.length)return e;throw new On(`invalid memory row ${JSON.stringify(e?.rowKey??null)}: ${n.join("; ")}`,{rowKey:typeof e?.rowKey=="string"?e.rowKey:"",rowClass:e?.rowClass,...t})}var Qr,nl,tl,Zi,Yo,E$,x$,On,Xo,BO,UO,na=P(()=>{Qr="tmct-memory-row-backend",nl=1,tl=Object.freeze(["fact","source","utterance","session","rule","retraction","edge-group","bookkeeping"]),Zi="bookkeeping",Yo=4096,E$="TMCT_BACKEND_REJECTED",x$="TMCT_BACKEND_UNAVAILABLE";On=class extends Error{constructor(t,n={}){super(t,n.cause?{cause:n.cause}:void 0),this.name="BackendRejected",this.code=E$,j$(this,n)}},Xo=class extends Error{constructor(t,n={}){super(t,n.cause?{cause:n.cause}:void 0),this.name="BackendUnavailable",this.code=x$,j$(this,n)}},BO=Object.freeze(["readRows","putRows","deleteRows","readMeta","putMeta","deleteAll","close"]),UO=Object.freeze(["readRowsByTerm"])});function qO(){return mp||(mp=new Map([[et,"fact"],[us,"source"],[ho,"utterance"],[Jo,"session"],[ds,"rule"],[Yt,"retraction"]])),mp}function YO(e){let t=qO().get(e?.class);if(t)return t;throw new On(`individual ${JSON.stringify(e?.id??null)} has class ${JSON.stringify(e?.class??null)}, which no row class covers`,{rowKey:String(e?.id||"")})}function XO(e){return(e?.attributes||[]).some(t=>t?.prop===sa)?{...e,attributes:e.attributes.filter(t=>t?.prop!==sa)}:e}function JO(e){let t=new Map,n=0;for(let s of e||[]){let o;try{o=Number(JSON.parse(s?.json??"{}").ord)}catch{o=NaN}Number.isFinite(o)&&(t.set(s.rowKey,o),o>=n&&(n=o+1))}return s=>{let o=t.get(s);if(o!==void 0)return o;let r=n;return n+=1,r}}function R$(e,t,{onOversizedRow:n,log:s}){let o=pp(e);if(o<=Yo||n==="keep")return!0;let r=t?` (provenance: ${t})`:"",i=`${e.rowClass} row ${e.rowKey} serializes to ${o} bytes, over the ${Yo}-byte cap${r}`;if(n==="drop")return s(`dropped an oversized memory row: ${i}`),!1;throw new On(i,{rowKey:e.rowKey,rowClass:e.rowClass,provenance:t})}function gp(e,{priorRows:t=null,onOversizedRow:n="throw",log:s=QO}={}){if(!ZO.has(n))throw new TypeError(`onOversizedRow must be "throw", "drop", or "keep", got ${JSON.stringify(n)}`);let o=JO(t),r={onOversizedRow:n,log:s},i=[];for(let a of e?.individuals||[]){if(!a?.id)continue;let c=YO(a),l={rowKey:String(a.id),rowClass:c,term:c==="fact"?V(HO(a,"subject")):"",json:JSON.stringify({ord:o(String(a.id)),individual:XO(a)})};R$(l,hp(a,VO),r)&&i.push(l)}for(let a of e?.objectProperties||[]){if(!a?.prop)continue;let c=`${WO}${a.prop}`,l={rowKey:c,rowClass:T$,term:"",json:JSON.stringify({ord:o(c),group:a})};R$(l,"",r)&&i.push(l)}return i}function eN(e){let t=[],n=[];for(let s=0;s<e.length;s+=1)e[s]?.class===et&&(t.push(s),n.push(e[s]));n.sort((s,o)=>s.id<o.id?-1:s.id>o.id?1:0);for(let s=0;s<t.length;s+=1)e[t[s]]=n[s]}function tN(e){let t=new Map;for(let n of e)if(n?.class===et)for(let s of hp(n,GO).split(" ").filter(Boolean)){let o=t.get(s)||new Set;o.add(n.id),t.set(s,o)}for(let n of e){let s=t.get(n?.id),o=(n?.attributes||[]).some(i=>i?.prop===sa);if(!s&&!o)continue;let r=(n.attributes||[]).filter(i=>i?.prop!==sa);n.attributes=s?[...r,{prop:sa,key:"supersededBy",value:[...s].sort().join(" ")}]:r}}function nN(e){let t=[];for(let n of[Jo,ho,et,us,ds]){let s=e.filter(o=>o?.class===n);s.length&&t.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}return t}function sN(e){let t="";for(let n of e){if(n?.class!==ho)continue;let s=hp(n,KO);s>t&&(t=s)}return t}function rl(e,{meta:t=null}={}){let n=fs();t?.memory!==void 0&&(n.memory=t.memory),t?.prefixes!==void 0&&(n.prefixes=t.prefixes);let s=[],o=[];for(let r of e||[]){if(!r||r.rowClass===Zi)continue;let i=JSON.parse(r.json),c={ord:Number.isFinite(Number(i?.ord))?Number(i.ord):0,rowKey:String(r.rowKey||"")};r.rowClass===T$?o.push({...c,group:i?.group}):s.push({...c,individual:i?.individual})}return s.sort(_$),o.sort(_$),n.individuals=s.map(r=>r.individual).filter(Boolean),n.objectProperties=o.map(r=>r.group).filter(Boolean),il(n)}function il(e){let t=e.individuals||[];return eN(t),tN(t),e.classes=nN(t),e.proseIndex=null,e.proseIndex=Qa(t),e.generated_at=sN(t),e}function bp(e,t){let n=new Map((e||[]).filter(i=>i?.rowKey).map(i=>[i.rowKey,i])),s=[],o=new Set;for(let i of t||[]){if(!i?.rowKey)continue;o.add(i.rowKey);let a=n.get(i.rowKey);a&&a.json===i.json&&a.term===i.term&&a.rowClass===i.rowClass||s.push(i)}let r=[...n.keys()].filter(i=>!o.has(i));return{puts:s,deletes:r}}var T$,WO,GO,sa,VO,KO,hp,HO,mp,QO,ZO,_$,wp=P(()=>{We();Ze();Wn();na();T$="edge-group",WO="edge-group:",GO="mgx:supersedes",sa="mgx:supersededBy",VO="mgx:factProvenance",KO="mgx:utteranceTs",hp=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",HO=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",mp=null;QO=e=>console.warn(e),ZO=new Set(["throw","drop","keep"]);_$=(e,t)=>e.ord-t.ord||(e.rowKey<t.rowKey?-1:e.rowKey>t.rowKey?1:0)});var yp={};Lt(yp,{access:()=>iN,appendFile:()=>lN,basename:()=>jN,copyFile:()=>gN,createInterface:()=>AN,createReadStream:()=>wN,createRequire:()=>oN,createWriteStream:()=>yN,default:()=>IN,dirname:()=>SN,existsSync:()=>$N,fileURLToPath:()=>RN,isAbsolute:()=>xN,join:()=>vN,mkdir:()=>uN,mkdtemp:()=>dN,randomBytes:()=>_N,readFile:()=>aN,readFileSync:()=>rN,readdir:()=>bN,rename:()=>fN,resolve:()=>EN,rm:()=>mN,sep:()=>kN,spawnSync:()=>TN,stat:()=>hN,tmpdir:()=>CN,unlink:()=>pN,writeFile:()=>cN});var vt,oN,rN,iN,aN,cN,lN,uN,dN,fN,pN,mN,hN,gN,bN,wN,yN,$N,vN,SN,EN,xN,jN,kN,RN,_N,TN,AN,CN,IN,$p=P(()=>{vt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},oN=vt("createRequire"),rN=vt("readFileSync"),iN=vt("access"),aN=vt("readFile"),cN=vt("writeFile"),lN=vt("appendFile"),uN=vt("mkdir"),dN=vt("mkdtemp"),fN=vt("rename"),pN=vt("unlink"),mN=vt("rm"),hN=vt("stat"),gN=vt("copyFile"),bN=vt("readdir"),wN=vt("createReadStream"),yN=vt("createWriteStream"),$N=()=>!1,vN=(...e)=>e.join("/"),SN=e=>String(e).replace(/\/[^/]*$/,""),EN=(...e)=>e.join("/"),xN=e=>String(e).startsWith("/"),jN=e=>String(e).split("/").pop(),kN="/",RN=e=>String(e),_N=vt("randomBytes"),TN=vt("spawnSync"),AN=vt("createInterface"),CN=()=>"/tmp",IN={}});var ON,oa,vp=P(()=>{ON=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,oa=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(ON);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function NN(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function LN(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
77
+ ${h.allExports}`),g.reexports&&h.exports&&h.exports.length&&S.push(`
78
+ ## re-exported symbols (resolved __all__ \u2192 defining module): ${h.exports.join(", ")}`),g.insertionRegion&&h.insertionRegion&&y){let j=h.insertionRegion.start,I=Math.min(y.length,j+40-1);S.push(`
79
+ ## insertion region (write your new sibling here) \u2014 ${h.moduleLabel}:${j}-${I}`),S.push(y.slice(j-1,I).map((x,_)=>`${j+_} ${x}`).join(`
80
+ `))}else h.insertion&&S.push(`
81
+ ## insert the new sibling after line ~${h.insertion} (end of the last top-level definition).`);return g.tests&&h.tests.length&&S.push(`
82
+ ## covering tests: ${h.tests.join(", ")}`),g.cochange&&h.cochange&&h.cochange.length&&S.push(`
83
+ ## usually changed together (consider editing these too): ${h.cochange.map(j=>`${j.label} (\xD7${j.weight})`).join(", ")}`),S.push(`
84
+ You now have the snippet, the sibling style, the registration anchor and the tests. Write the new code with Edit/Write \u2014 do NOT Read ${h.moduleLabel}.`),b!=="FULL"&&S.push(`(bundle tier ${b}; for any omitted sections run ${u}context_more {"symbol":"${r}"}, or ${u}context with depth="full".)`),{text:S.join(`
85
+ `),tier:b,topup:w}}async function If(e,{config:t,source:n,tel:s}){return(await Fy(e,{config:t,source:n,tel:s})).text}var Of=M(()=>{Lt();Qe();Qt();Cc();xi();Me();rs();Nc();Lc();ot();If.ownsGraphLoad=!0});function Dy(e,{graph:t,svc:n}){let{match:s}=Mt(n,pt(e,"symbol"),"symbol");return Hb(Lr(t,s))}var zy=M(()=>{Me();ot()});function Pc(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return t>>>0}function Ki(e){return Pc(e).toString(16).padStart(8,"0")}function Nf(e){let t=new TextEncoder().encode(String(e)),n=t.length*8,s=new Uint8Array((t.length+8>>6)+1<<6);s.set(t),s[t.length]=128;let o=new DataView(s.buffer);o.setUint32(s.length-8,Math.floor(n/4294967296)),o.setUint32(s.length-4,n>>>0);let r=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),i=new Uint32Array(64),a=(u,d)=>u>>>d|u<<32-d;for(let u=0;u<s.length;u+=64){for(let y=0;y<16;y+=1)i[y]=o.getUint32(u+y*4);for(let y=16;y<64;y+=1){let v=a(i[y-15],7)^a(i[y-15],18)^i[y-15]>>>3,R=a(i[y-2],17)^a(i[y-2],19)^i[y-2]>>>10;i[y]=i[y-16]+v+i[y-7]+R>>>0}let[d,p,f,m,h,b,g,w]=r;for(let y=0;y<64;y+=1){let v=a(h,6)^a(h,11)^a(h,25),R=h&b^~h&g,S=w+v+R+lO[y]+i[y]>>>0,j=a(d,2)^a(d,13)^a(d,22),I=d&p^d&f^p&f,x=j+I>>>0;w=g,g=b,b=h,h=m+S>>>0,m=f,f=p,p=d,d=S+x>>>0}r[0]=r[0]+d>>>0,r[1]=r[1]+p>>>0,r[2]=r[2]+f>>>0,r[3]=r[3]+m>>>0,r[4]=r[4]+h>>>0,r[5]=r[5]+b>>>0,r[6]=r[6]+g>>>0,r[7]=r[7]+w>>>0}let c=new Uint8Array(32),l=new DataView(c.buffer);for(let u=0;u<8;u+=1)l.setUint32(u*4,r[u]);return c}function uO(e,t){let n=Nf(e),s="";for(let o=0;o<t;o+=1)s+=n[o].toString(16).padStart(2,"0");return s}function V(e){let t=as(e);return t=t.replace(/^\/c\/[a-z]{2,3}\//i,""),t=t.replace(/^[a-z][\w.-]*:/i,""),t=t.replace(/_/g," ").replace(/\s+/g," ").trim(),t=t.replace(/^(?:the|an?)\s+/i,""),t.toLowerCase()}function cs(e){let t=as(e);return fO.get(t)??t}function Se(e,t,n){return Ko(V(e),cs(t),V(n))}var lO,dO,as,fO,Ko,Ye=M(()=>{lO=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);dO=2e3,as=e=>String(e??"").replace(/\s+/g," ").trim().slice(0,dO);fO=new Map([["mgx:cause","mgx:causes"],["mgx:desire","mgx:desires"],["mgx:want","mgx:desires"],["mgx:require","mgx:hasPrerequisite"],["mgx:involve","mgx:hasSubevent"],["mgx:used-for","mgx:usedFor"],["mgx:made-of","mgx:madeOf"]]);Ko=(e,t,n)=>`fact:${uO(`${e}\0${t}\0${n}`,8)}`});function pO(e=By,t=Uy){let n=new Set((t||[]).map(([r,i])=>Mc(r,i))),s=(e||[]).map(r=>r.top),o=[];for(let r=0;r<s.length;r+=1)for(let i=r+1;i<s.length;i+=1){let[a,c]=s[r]<s[i]?[s[r],s[i]]:[s[i],s[r]];n.has(Mc(a,c))||o.push([a,c])}return o.sort((r,i)=>r[0]<i[0]?-1:r[0]>i[0]?1:r[1]<i[1]?-1:r[1]>i[1]?1:0),o}function Wy({subClassEdges:e=[],typeEdges:t=[],maxHops:n=mO,maxVisited:s=hO,topClasses:o=By,overlappingPairs:r=Uy}={}){let i=new Map;for(let g of o||[])for(let w of g.labels||[]){let y=V(w);y&&i.set(y,g.top)}let a=(o||[]).map(g=>g.top),c=pO(o,r),l=new Set(c.map(([g,w])=>Mc(g,w))),u=new Map,d=(g,w)=>{!g||!w||g===w||(u.has(g)||u.set(g,new Set),u.get(g).add(w))};for(let[g,w]of e||[])d(g,w);for(let[g,w]of t||[])d(g,w);let p=new Map;for(let[g,w]of u)p.set(g,[...w].sort(Lf));let f=new Map;function m(g){if(!g)return[];if(f.has(g))return f.get(g);let w=[],y=i.get(g);if(y)w=[y];else{let v=new Set([g]),R=[g];for(let S=1;S<=n&&R.length&&v.size<s;S+=1){let j=[];for(let x of R){for(let _ of p.get(x)||[])if(!v.has(_)&&(v.add(_),j.push(_),v.size>=s))break;if(v.size>=s)break}j.sort(Lf);let I=new Set;for(let x of j){let _=i.get(x);_&&I.add(_)}if(I.size){w=[...I].sort(Lf);break}R=j}}return f.set(g,w),w}function h(g,w){for(let y of g)for(let v of w)if(y===v||!l.has(Mc(y,v)))return!1;return!0}function b(g,w){if(!g||!w||g===w)return!1;let y=m(g);if(!y.length)return!1;let v=m(w);return v.length?h(y,v):!1}return{declines:b,topsOf:m,tops:a,disjointPairs:c}}var By,Uy,Mc,mO,hO,Lf,Gy=M(()=>{Ye();By=[{top:"place",labels:["place","location"]},{top:"body part",labels:["body part","organ","internal organ","external body part","body covering","limb","blood vessel"]},{top:"living thing",labels:["living thing","organism"]},{top:"artifact",labels:["artifact","instrumentality"]},{top:"substance",labels:["substance","matter"]},{top:"event",labels:["event","happening"]},{top:"communication",labels:["communication","message"]},{top:"time period",labels:["time period"]},{top:"feeling",labels:["feeling","emotion"]}],Uy=[["artifact","communication"],["artifact","place"],["artifact","substance"],["body part","substance"],["communication","event"],["communication","feeling"],["living thing","substance"]],Mc=(e,t)=>e<t?`${e}\u241F${t}`:`${t}\u241F${e}`;mO=6,hO=3e3,Lf=(e,t)=>e<t?-1:e>t?1:0});var fn={};Nt(fn,{CARDINALITY_RULE_CONFIDENCE:()=>vO,CAX_DW_RULE:()=>Mf,CAX_DW_RULE_CONFIDENCE:()=>Df,CAX_MAXC0_RULE_CONFIDENCE:()=>EO,CLS_SVF1_RULE:()=>zf,CLS_SVF1_RULE_CONFIDENCE:()=>Uf,DEFAULT_MAX_ENVIRONMENTS:()=>Hr,DISJOINT_PREDICATE:()=>Vr,ENTAILED_DISJOINT_PROVENANCE:()=>Ff,ENTAILED_PROVENANCE:()=>Hy,ENTAILED_SCM_SVF_PROVENANCE:()=>Kf,ENTAILED_SVF1_PROVENANCE:()=>Bf,ENTAILED_TYPE_PROVENANCE:()=>Yy,ON_PROPERTY_PREDICATE:()=>On,SCM_SVF_RULE:()=>Vf,SCM_SVF_RULE_CONFIDENCE:()=>Hf,SOME_VALUES_FROM_PREDICATE:()=>Nn,SUBCLASS_PREDICATE:()=>ze,TYPE_PREDICATE:()=>Ft,buildCardinalityRestrictions:()=>Gf,buildRelevanceFrontier:()=>Pf,buildSubClassSuccessors:()=>Dc,deriveDisjointViolations:()=>Zy,deriveSomeValuesFromApplication:()=>e$,deriveSomeValuesFromSubsumption:()=>t$,deriveSubClassClosure:()=>Xy,deriveSubClassClosureDelta:()=>Jy,deriveTypePropagation:()=>Qy,entailedTrustFrom:()=>bO,findConsistencyViolations:()=>jO,findIsaChain:()=>qf,proveCardinalityAtLeast:()=>SO,proveMaxCardinalityZeroDenial:()=>xO,retractSubClassOf:()=>TO,syllogise:()=>s$});function Vy(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function bO(e,t=1){let n=(Array.isArray(e)?e:[]).filter(o=>typeof o=="number");if(!n.length)return null;let s=Math.max(0,Math.min(1,Math.min(...n)*t));return Number(s.toFixed(6))}function Bs(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Xy(e,{depth:t=32,budget:n=50,focus:s=null,gate:o=null}={}){let r=new Set,i=new Map;for(let[d,p]of e||[])!d||!p||d===p||(r.add(`${d}${Be}${p}`),i.has(d)||i.set(d,new Set),i.get(d).add(p));let a=s instanceof Set?s.size?s:null:Bs(s),c=(d,p,f)=>!a||a.has(d)||a.has(p)||a.has(f),l=[],u=new Set;for(let d=0;d<t;d+=1){let p=[];for(let[m,h]of i)for(let b of h){let g=i.get(b);if(g)for(let w of g){if(m===w)continue;let y=`${m}${Be}${w}`;r.has(y)||u.has(y)||c(m,b,w)&&(o?.declines(m,w)||p.push([m,b,w,y]))}}if(!p.length)break;p.sort((m,h)=>m[0].localeCompare(h[0])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let f=!1;for(let[m,h,b,g]of p)if(!u.has(g)){if(l.length>=n)break;u.add(g),l.push({subject:m,object:b,via:h}),i.has(m)||i.set(m,new Set),i.get(m).add(b),f=!0}if(l.length>=n||!f)break}return l}function Jy(e,t,{depth:n=32,budget:s=50,focus:o=null,gate:r=null}={}){let i=new Set,a=new Map,c=new Map;for(let[h,b]of e||[])!h||!b||h===b||(i.add(`${h}${Be}${b}`),a.has(h)||a.set(h,new Set),a.get(h).add(b),c.has(b)||c.set(b,new Set),c.get(b).add(h));let l=[],u=new Set;for(let[h,b]of t||[]){if(!h||!b||h===b)continue;let g=`${h}${Be}${b}`;u.has(g)||(u.add(g),l.push([h,b]))}let d=o instanceof Set?o.size?o:null:Bs(o),p=(h,b,g)=>!d||d.has(h)||d.has(b)||d.has(g),f=[],m=new Set;for(let h=0;h<n&&l.length;h+=1){let b=[],g=(v,R,S)=>{if(v===S)return;let j=`${v}${Be}${S}`;i.has(j)||m.has(j)||p(v,R,S)&&(r?.declines(v,S)||b.push([v,R,S,j]))};for(let[v,R]of l){for(let S of a.get(R)||[])g(v,R,S);for(let S of c.get(v)||[])g(S,v,R)}if(!b.length)break;b.sort((v,R)=>v[0].localeCompare(R[0])||v[2].localeCompare(R[2])||v[1].localeCompare(R[1]));let w=!1,y=[];for(let[v,R,S,j]of b)if(!m.has(j)){if(f.length>=s)break;m.add(j),f.push({subject:v,object:S,via:R}),a.has(v)||a.set(v,new Set),a.get(v).add(S),c.has(S)||c.set(S,new Set),c.get(S).add(v),y.push([v,S]),w=!0}if(f.length>=s||!w)break;l=y}return f}function ls(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function wO(e){return ls((e||[]).map(([t,n])=>[n,t]))}function Pf(e,t){let n=[],s=[],o=new Map,r=new Map;for(let l of e||[])!l||!l.subject||!l.predicate||!l.object||(zs(l.predicate)?n.push([l.subject,l.object]):ho(l.predicate)?s.push([l.subject,l.object]):Kr(l.predicate)?o.set(l.subject,l.object):qi(l.predicate)&&r.set(l.subject,l.object));let i=wO(n),a=new Set;for(let l of t||[]){let u=V(l);if(u){a.add(u);for(let d of i(u))a.add(d)}}let c=new Set(a);for(let[l,u]of s)a.has(u)&&c.add(l);for(let[l,u]of r)o.has(l)&&a.has(u)&&c.add(l);return c}function Qy(e,t,{budget:n=50,focus:s=null,presentTypeEdges:o=e,gate:r=null}={}){let i=ls(t),a=new Set,c=new Set;for(let[m,h]of o||[])m&&h&&a.add(`${m}${Be}${h}`);let l=s instanceof Set?s.size?s:null:Bs(s),u=(m,h,b)=>!l||l.has(m)||l.has(h)||l.has(b),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let b=`${m}${Be}${h}`;if(!c.has(b)){c.add(b);for(let g of i(h)){if(g===h||g===m)continue;let w=`${m}${Be}${g}`;a.has(w)||u(m,h,g)&&(r?.declines(m,g)||d.push([m,h,g,w]))}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let p=[],f=new Set;for(let[m,h,b,g]of d)if(!f.has(g)){if(p.length>=n)break;f.add(g),p.push({subject:m,object:b,via:h})}return p}function Zy(e,t,n,{budget:s=50,focus:o=null}={}){let r=ls(t),i=new Map,a=new Set;for(let[m,h]of n||[])!m||!h||m===h||(a.add(`${m}${Be}${h}`),a.add(`${h}${Be}${m}`),i.has(m)||i.set(m,new Set),i.get(m).add(h),i.has(h)||i.set(h,new Set),i.get(h).add(m));if(!i.size)return[];let c=new Set,l=o instanceof Set?o.size?o:null:Bs(o),u=(m,h,b)=>!l||l.has(m)||l.has(h)||l.has(b),d=[];for(let[m,h]of e||[]){if(!m||!h)continue;let b=`${m}${Be}${h}`;if(!c.has(b)){c.add(b);for(let g of[h,...r(h)]){let w=i.get(g);if(w)for(let y of w){if(y===m)continue;let v=`${m}${Be}${y}`;a.has(v)||u(m,h,y)&&d.push([m,h,g,y,v])}}}}d.sort((m,h)=>m[0].localeCompare(h[0])||m[3].localeCompare(h[3])||m[2].localeCompare(h[2])||m[1].localeCompare(h[1]));let p=[],f=new Set;for(let[m,h,b,g,w]of d)if(!f.has(w)){if(p.length>=s)break;f.add(w),p.push({subject:m,object:g,viaType:h,viaClass:b})}return p}function e$(e,t,n,s,{budget:o=50,focus:r=null}={}){let i=ls(n),a=new Map;for(let b of s||[]){if(!b||!b.restriction||!b.property||!b.target)continue;let g=`${b.property}${Be}${b.target}`;a.has(g)||a.set(g,new Set),a.get(g).add(b.restriction)}if(!a.size)return[];let c=new Set,l=new Map;for(let[b,g]of t||[])!b||!g||(c.add(`${b}${Be}${g}`),l.has(b)||l.set(b,new Set),l.get(b).add(g));let u=r instanceof Set?r.size?r:null:Bs(r),d=(b,g,w)=>!u||u.has(b)||u.has(g)||u.has(w),p=new Set,f=[];for(let[b,g,w]of e||[]){if(!b||!g||!w)continue;let y=V(g),v=`${b}${Be}${y}${Be}${w}`;if(p.has(v))continue;p.add(v);let R=l.get(w);if(R)for(let S of R)for(let j of[S,...i(S)]){let I=a.get(`${y}${Be}${j}`);if(I)for(let x of I){if(b===x)continue;let _=`${b}${Be}${x}`;c.has(_)||d(b,w,x)&&f.push([b,g,y,w,S,j,x,_])}}}f.sort((b,g)=>b[0].localeCompare(g[0])||b[6].localeCompare(g[6])||b[1].localeCompare(g[1])||b[3].localeCompare(g[3]));let m=[],h=new Set;for(let[b,g,w,y,v,R,S,j]of f)if(!h.has(j)){if(m.length>=o)break;h.add(j),m.push({subject:b,object:S,viaProperty:g,viaPropertyKey:w,viaValue:y,viaType:v,viaTarget:R})}return m}function Gf(e){let t=new Map,n=new Map,s=new Map;for(let r of e||[])if(!(!r||!r.subject||!r.predicate))if(Kr(r.predicate))t.set(r.subject,r.object);else if(gO(r.predicate))s.set(r.subject,r.object);else{let i=$O[String(r.predicate).trim().toLowerCase()];if(!i)continue;let a=Number(r.object);Number.isFinite(a)&&n.set(r.subject,{kind:i,n:a})}let o=[];for(let[r,{kind:i,n:a}]of n){if(t.get(r)!==yO)continue;let c=s.get(r);c&&o.push({restriction:r,kind:i,n:a,onClass:c})}return o.sort((r,i)=>r.restriction.localeCompare(i.restriction)),o}function t$(e,t,{budget:n=50,focus:s=null}={}){let o=ls(t),r=new Map;for(let p of e||[]){if(!p||!p.restriction||!p.property||!p.target)continue;let f=V(p.property);r.has(f)||r.set(f,[]),r.get(f).push({restriction:p.restriction,target:p.target})}let i=new Set;for(let[p,f]of t||[])p&&f&&i.add(`${p}${Be}${f}`);let a=s instanceof Set?s.size?s:null:Bs(s),c=(p,f)=>!a||a.has(p)||a.has(f),l=[];for(let[,p]of r)if(!(p.length<2))for(let f of p)for(let m of p){if(f.restriction===m.restriction||f.target===m.target||!o(f.target).has(m.target))continue;let h=`${f.restriction}${Be}${m.restriction}`;i.has(h)||c(f.restriction,m.restriction)&&l.push([f.restriction,m.restriction,f.target,m.target,h])}l.sort((p,f)=>p[0].localeCompare(f[0])||p[1].localeCompare(f[1]));let u=[],d=new Set;for(let[p,f,m,h,b]of l)if(!d.has(b)){if(u.length>=n)break;d.add(b),u.push({subject:p,object:f,viaY1:m,viaY2:h})}return u}function n$(e,t,n,s,{budget:o=20,focus:r=null}={}){if(!n)return null;let i=ls(e),a=r instanceof Set?r.size?r:null:Bs(r),c=p=>!a||a.has(n)||a.has(p),l=new Map;for(let[p,f]of e||[])!p||!f||(l.has(p)||l.set(p,new Set),l.get(p).add(f));let u=new Map((t||[]).map(p=>[p.restriction,p])),d=0;for(let p of[n,...i(n)]){if(d>=o)break;if(d+=1,!!c(p))for(let f of l.get(p)||[]){let m=u.get(f);if(m&&s(m))return{viaClass:p,viaRestriction:f,record:m}}}return null}function SO(e,t,n,s,o,r={}){if(!s||!Number.isFinite(o))return null;let i=n$(e,t,n,a=>a.onClass===s&&(a.kind==="exactly"||a.kind==="min")&&a.n>=o,r);return i?{subject:n,object:s,m:o,n:i.record.n,kind:i.record.kind,viaClass:i.viaClass,viaRestriction:i.viaRestriction}:null}function xO(e,t,n,s,o={}){if(!s)return null;let r=n$(e,t,n,i=>i.onClass===s&&i.kind==="max"&&i.n===0,o);return r?{subject:n,object:s,viaClass:r.viaClass,viaRestriction:r.viaRestriction}:null}function jO(e,t,n,{budget:s=50,focus:o=null}={}){let r=ls(t),i=new Map;for(let[f,m]of n||[])!f||!m||f===m||(i.has(f)||i.set(f,new Set),i.get(f).add(m),i.has(m)||i.set(m,new Set),i.get(m).add(f));if(!i.size)return[];let a=new Map;for(let[f,m]of e||[])!f||!m||(a.has(f)||a.set(f,new Set),a.get(f).add(m));let c=o instanceof Set?o.size?o:null:Bs(o),l=f=>!c||c.has(f),u=[],d=new Set;for(let[f,m]of a){if(!l(f))continue;let h=[...m].sort();for(let b=0;b<h.length;b+=1)for(let g=b+1;g<h.length;g+=1){let[w,y]=[h[b],h[g]],v=[w,...r(w)],R=[y,...r(y)],S=null;for(let I of v){let x=i.get(I);if(x){for(let _ of R)if(x.has(_)){S=[I,_];break}if(S)break}}if(!S)continue;let j=`${f}${Be}${w}${Be}${y}`;d.has(j)||(d.add(j),u.push([f,w,y,S[0],S[1]]))}}u.sort((f,m)=>f[0].localeCompare(m[0])||f[1].localeCompare(m[1])||f[2].localeCompare(m[2]));let p=[];for(let[f,m,h,b,g]of u){if(p.length>=s)break;p.push({subject:f,classA:m,classB:h,viaA:b,viaB:g})}return p}async function s$(e,{depth:t=32,budget:n=50,focus:s=null,expandFocus:o=!1,maxEnvironments:r=Hr,full:i=!1,store:a,senseGate:c=!0}={}){let{loadMemory:l,readFactRows:u,appendFacts:d}=Vy(a,["loadMemory","readFactRows","appendFacts"],"syllogise"),p=typeof a?.loadSyllogiseState=="function"&&typeof a?.saveSyllogiseState=="function",f=await l(e),m=u(f),h=m.filter(A=>zs(A.predicate)).map(A=>[A.subject,A.object]),b=m.filter(A=>ho(A.predicate)).map(A=>[A.subject,A.object]),g=m.filter(A=>Ho(A.predicate)).map(A=>[A.subject,A.object]),w=new Map,y=new Map,v=[];for(let A of m){let ge=String(A.predicate||"").trim().toLowerCase();Kr(A.predicate)?w.set(A.subject,A.object):qi(A.predicate)?y.set(A.subject,A.object):Wf.has(ge)||v.push([A.subject,A.predicate,A.object])}let R=[];for(let[A,ge]of w){let Ie=y.get(A);Ie&&R.push({restriction:A,property:ge,target:Ie})}let S=c?Wy({subClassEdges:m.filter(A=>zs(A.predicate)&&!Fc(A.provenance)).map(A=>[A.subject,A.object]),typeEdges:m.filter(A=>ho(A.predicate)&&!Fc(A.provenance)).map(A=>[A.subject,A.object])}):null,j=Bs(s),I=o&&j?Pf(m,[...j]):j,x=I===null&&p?await a.loadSyllogiseState(e):null,_=new Set(m.map(A=>A.id)),$=Array.isArray(x?.factIds)?x.factIds.filter(A=>!_.has(A)):[],T=x&&Array.isArray(x.factIds)&&!$.length&&!i?"delta":"full",C=T==="delta"?new Set(x.factIds):null,E=T==="delta"?m.filter(A=>!C.has(A.id)):m,k=E.length,P=new Map;for(let A of m)P.set(`${A.subject}${Be}${A.predicate}${Be}${A.object}`,A.trust);let D=(A,ge,Ie)=>P.get(`${A}${Be}${ge}${Be}${Ie}`),H=(A,ge,Ie)=>P.has(`${A}${Be}${ge}${Be}${Ie}`),Y=A=>A.filter(ge=>typeof ge=="number"),J=T==="delta"&&!E.length,L=T==="delta"?E.filter(A=>zs(A.predicate)).map(A=>[A.subject,A.object]):[],K=T==="delta"?L.length?Jy(h,L,{depth:t,budget:n,focus:I,gate:S}):[]:Xy(h,{depth:t,budget:n,focus:I,gate:S}),W=h.concat(K.map(A=>[A.subject,A.object])),N=I,F=null;if(T==="delta"&&!J){let A=m.concat(K.map(Ie=>({subject:Ie.subject,predicate:ze,object:Ie.object}))),ge=[];for(let Ie of E)ge.push(Ie.subject,Ie.object);F=Pf(A,ge),N=F}let O=A=>!F||F.has(A),z=F?b.filter(([A,ge])=>O(A)||O(ge)):b,B=new Set;if(F)for(let A of E)Ho(A.predicate)&&(B.add(A.subject),B.add(A.object));let U=F&&B.size?ls(W):null,G=F?b.filter(([A,ge])=>O(A)||O(ge)||U&&[...U(ge)].some(Ie=>B.has(Ie))):b,Q=new Set;if(F){for(let A of E)if(Kr(A.predicate)||qi(A.predicate)){let ge=w.get(A.subject);ge&&Q.add(V(ge))}}let ae=F?v.filter(([A,ge,Ie])=>O(A)||O(Ie)||Q.has(V(ge))):v,fe=Math.max(0,n-K.length),ie=fe>0&&!J?Qy(z,W,{budget:fe,focus:N,presentTypeEdges:b,gate:S}):[],Z=Math.max(0,n-K.length-ie.length),X=Z>0&&!J?Zy(G,W,g,{budget:Z,focus:N}):[],te=Math.max(0,n-K.length-ie.length-X.length),oe=te>0&&R.length&&!J?e$(ae,b,W,R,{budget:te,focus:N}):[],Ae=Math.max(0,n-K.length-ie.length-X.length-oe.length),he=Ae>0&&R.length>1&&!J?t$(R,W,{budget:Ae,focus:N}):[],ke=new Map(R.map(A=>[A.restriction,A])),Ce=[...K.map(A=>({subject:A.subject,predicate:ze,object:A.object,provenance:Hy,justification:[[Se(A.subject,ze,A.via),Se(A.via,ze,A.object)]]})),...ie.map(A=>({subject:A.subject,predicate:Ft,object:A.object,provenance:Yy,justification:[[Se(A.subject,Ft,A.via),Se(A.via,ze,A.object)]]})),...X.map(A=>{let ge=H(A.viaClass,Vr,A.object),[Ie,kn]=ge?[A.viaClass,A.object]:[A.object,A.viaClass],xr=Y([D(A.subject,Ft,A.viaType),D(Ie,Vr,kn),...A.viaClass!==A.viaType?[D(A.viaType,ze,A.viaClass)]:[]]);return{subject:A.subject,predicate:Vr,object:A.object,provenance:Ff,justification:[[Se(A.subject,Ft,A.viaType),Se(Ie,Vr,kn),...A.viaClass!==A.viaType?[Se(A.viaType,ze,A.viaClass)]:[]]],...xr.length?{premiseTrusts:xr,ruleConfidence:Df}:{}}}),...oe.map(A=>{let ge=Y([D(A.subject,A.viaProperty,A.viaValue),D(A.viaValue,Ft,A.viaType),D(A.object,On,A.viaPropertyKey),D(A.object,Nn,A.viaTarget),...A.viaType!==A.viaTarget?[D(A.viaType,ze,A.viaTarget)]:[]]);return{subject:A.subject,predicate:Ft,object:A.object,provenance:Bf,justification:[[Se(A.subject,A.viaProperty,A.viaValue),Se(A.viaValue,Ft,A.viaType),Se(A.object,On,A.viaPropertyKey),Se(A.object,Nn,A.viaTarget),...A.viaType!==A.viaTarget?[Se(A.viaType,ze,A.viaTarget)]:[]]],...ge.length?{premiseTrusts:ge,ruleConfidence:Uf}:{}}}),...he.map(A=>{let ge=ke.get(A.subject),Ie=ke.get(A.object),kn=Y([ge&&D(A.subject,On,ge.property),D(A.subject,Nn,A.viaY1),Ie&&D(A.object,On,Ie.property),D(A.object,Nn,A.viaY2),D(A.viaY1,ze,A.viaY2)]);return{subject:A.subject,predicate:ze,object:A.object,provenance:Kf,justification:[[...ge?[Se(A.subject,On,ge.property)]:[],Se(A.subject,Nn,A.viaY1),...Ie?[Se(A.object,On,Ie.property)]:[],Se(A.object,Nn,A.viaY2),Se(A.viaY1,ze,A.viaY2)]],...kn.length?{premiseTrusts:kn,ruleConfidence:Hf}:{}}})],Ee=Ce.map(A=>({id:Se(A.subject,A.predicate,A.object),subject:A.subject,predicate:A.predicate,object:A.object,environments:A.justification,write:A})),Xe=o$(m.concat(Ee.map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object})))),ce=new Map(m.map(A=>[A.id,A])),le=A=>zs(A)||ho(A)||Ho(A),pe=A=>T!=="delta"||F!==null&&(F.has(A.subject)||F.has(A.object)),et=m.filter(A=>le(A.predicate)&&Fc(A.provenance)&&Hi(A).length<r&&pe(A)).map(A=>({id:A.id,subject:A.subject,predicate:A.predicate,object:A.object,environments:Hi(A),provenance:A.provenance})),Jt=[...Ee,...et].sort((A,ge)=>A.subject.localeCompare(ge.subject)||A.predicate.localeCompare(ge.predicate)||A.object.localeCompare(ge.object)),re=0,De=!1,It=0;for(let A of Jt){if(It>=n){De=!0;break}It+=1;let ge=Xe(A,{maxEnvironments:r+1}),{kept:Ie,truncated:kn}=RO(A.environments,ge,r);if(kn&&(De=!0),!(Ie.length<=A.environments.length)){if(re+=Ie.length-A.environments.length,A.write){A.write.justification=Ie;continue}Ce.push({subject:A.subject,predicate:A.predicate,object:A.object,justification:Ie,...r$(A.provenance,Ie,xr=>ce.get(xr)?.trust)||{}})}}let{ids:Je}=await d(e,Ce),on=[],rn=0;for(let A of K)on.push({id:Je[rn],subject:A.subject,object:A.object,via:A.via,rule:Ky}),rn+=1;for(let A of ie)on.push({id:Je[rn],subject:A.subject,object:A.object,via:A.via,rule:qy}),rn+=1;for(let A of X)on.push({id:Je[rn],subject:A.subject,object:A.object,via:A.viaClass,rule:Mf}),rn+=1;for(let A of oe)on.push({id:Je[rn],subject:A.subject,object:A.object,via:A.viaValue,rule:zf}),rn+=1;for(let A of he)on.push({id:Je[rn],subject:A.subject,object:A.object,via:A.viaY1,rule:Vf}),rn+=1;let To=on.length>=n;if(I===null&&p&&!To){let A=new Set(_);for(let ge of Je)A.add(ge);await a.saveSyllogiseState(e,{version:1,factIds:[...A].sort(),completedAt:new Date().toISOString()})}return{derived:on,count:on.length,budget:n,depth:t,truncated:To,mode:T,deltaSize:k,environmentsAdded:re,alternatesTruncated:De}}function Fc(e){let t=String(e||"").split(" | ").filter(Boolean);return t.length>0&&t.every(n=>n.startsWith("entailed:"))}function kO(e){let t=[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map;for(let u of e){let d=String(u.predicate||"").trim().toLowerCase();zs(u.predicate)?t.push([u.subject,u.object]):ho(u.predicate)?(n.has(u.subject)||n.set(u.subject,new Set),n.get(u.subject).add(u.object)):Ho(u.predicate)?(s.has(u.subject)||s.set(u.subject,new Set),s.get(u.subject).add(u.object),s.has(u.object)||s.set(u.object,new Set),s.get(u.object).add(u.subject)):Kr(u.predicate)?o.set(u.subject,u.object):qi(u.predicate)?r.set(u.subject,u.object):Wf.has(d)||(i.has(u.subject)||i.set(u.subject,[]),i.get(u.subject).push([V(u.predicate),u.object]))}let a=ls(t),c=(u,d)=>u!==d&&a(u).has(d),l=u=>{let d=o.get(u),p=r.get(u);return d&&p?{property:V(d),target:p}:null};return u=>{if(zs(u.predicate)){if(c(u.subject,u.object))return!0;let d=l(u.subject),p=l(u.object);return!!(d&&p&&d.property===p.property&&c(d.target,p.target))}if(ho(u.predicate)){for(let p of n.get(u.subject)||[])if(c(p,u.object))return!0;let d=l(u.object);if(d){for(let[p,f]of i.get(u.subject)||[])if(p===d.property){for(let m of n.get(f)||[])if(m===d.target||c(m,d.target))return!0}}return!1}if(Ho(u.predicate)){for(let d of n.get(u.subject)||[])for(let p of[d,...a(d)])if(s.get(p)?.has(u.object))return!0;return!1}return!0}}function o$(e){let t=new Set,n=[],s=new Map,o=new Map,r=new Set,i=new Map,a=new Map,c=new Map,l=new Map;for(let f of e){if(!f||!f.subject||!f.predicate||!f.object)continue;f.id&&t.add(f.id);let m=String(f.predicate||"").trim().toLowerCase();zs(f.predicate)?(n.push([f.subject,f.object]),s.has(f.subject)||s.set(f.subject,new Set),s.get(f.subject).add(f.object)):ho(f.predicate)?(o.has(f.subject)||o.set(f.subject,new Set),o.get(f.subject).add(f.object)):Ho(f.predicate)?(r.add(`${f.subject}${Be}${f.object}`),i.has(f.subject)||i.set(f.subject,new Set),i.get(f.subject).add(f.object),i.has(f.object)||i.set(f.object,new Set),i.get(f.object).add(f.subject)):Kr(f.predicate)?a.set(f.subject,f.object):qi(f.predicate)?c.set(f.subject,f.object):Wf.has(m)||(l.has(f.subject)||l.set(f.subject,[]),l.get(f.subject).push([f.predicate,f.object]))}let u=ls(n),d=f=>s.get(f)||new Set,p=f=>{let m=a.get(f),h=c.get(f);return m&&h?{property:m,propertyKey:V(m),target:h}:null};return(f,{maxEnvironments:m=Hr}={})=>{let h=[],b=new Set,g=w=>{if(h.length>=m||f.id&&w.includes(f.id)||!w.every(v=>t.has(v)))return;let y=[...w].sort().join(" ");b.has(y)||(b.add(y),h.push(w))};if(zs(f.predicate)){for(let w of[...d(f.subject)].sort()){if(h.length>=m)break;w===f.subject||w===f.object||d(w).has(f.object)&&g([Se(f.subject,ze,w),Se(w,ze,f.object)])}if(h.length<m){let w=p(f.subject),y=p(f.object);w&&y&&w.propertyKey===y.propertyKey&&w.target!==y.target&&d(w.target).has(y.target)&&g([Se(f.subject,On,w.property),Se(f.subject,Nn,w.target),Se(f.object,On,y.property),Se(f.object,Nn,y.target),Se(w.target,ze,y.target)])}return h}if(ho(f.predicate)){for(let y of[...o.get(f.subject)||[]].sort()){if(h.length>=m)break;y!==f.object&&d(y).has(f.object)&&g([Se(f.subject,Ft,y),Se(y,ze,f.object)])}let w=p(f.object);if(w){let y=[...l.get(f.subject)||[]].filter(([v])=>V(v)===w.propertyKey).sort((v,R)=>v[0].localeCompare(R[0])||v[1].localeCompare(R[1]));for(let[v,R]of y){if(h.length>=m)break;for(let S of[...o.get(R)||[]].sort()){if(h.length>=m)break;S!==w.target&&!d(S).has(w.target)||g([Se(f.subject,v,R),Se(R,Ft,S),Se(f.object,On,w.propertyKey),Se(f.object,Nn,w.target),...S!==w.target?[Se(S,ze,w.target)]:[]])}}}return h}if(Ho(f.predicate)){let w=[];for(let y of o.get(f.subject)||[])for(let v of[y,...u(y)])(i.get(v)||new Set).has(f.object)&&w.push([y,v]);w.sort((y,v)=>y[0].localeCompare(v[0])||y[1].localeCompare(v[1]));for(let[y,v]of w){if(h.length>=m)break;let R=r.has(`${v}${Be}${f.object}`),[S,j]=R?[v,f.object]:[f.object,v];g([Se(f.subject,Ft,y),Se(S,Vr,j),...v!==y?[Se(y,ze,v)]:[]])}return h}return h}}function RO(e,t,n){let s=[],o=new Set,r=!1;for(let i of[...e||[],...t||[]]){if(!Array.isArray(i)||!i.length)continue;let a=[...i].sort().join(" ");if(!o.has(a)){if(s.length>=n){r=!0;continue}o.add(a),s.push(i)}}return{kept:s,truncated:r}}function r$(e,t,n){let s;for(let i of String(e||"").split(" | ")){let a=_O.get(i);if(a!==void 0){s=a;break}}if(s===void 0)return null;let o=null,r=-1;for(let i of t||[]){let a=i.map(l=>n(l)).filter(l=>typeof l=="number");if(a.length!==i.length)continue;let c=Math.min(...a);c>r&&(r=c,o=a)}return o?{premiseTrusts:o,ruleConfidence:s}:null}async function TO(e,t,n,{budget:s=50,depth:o=32,maxEnvironments:r=Hr,store:i,sourceTags:a=[],predicate:c=ze}={}){let{loadMemory:l,readFactRows:u,removeFacts:d}=Vy(i,["loadMemory","readFactRows","removeFacts"],"retractSubClassOf"),p=typeof i?.appendFacts=="function"?i.appendFacts:null,f=typeof i?.factRecordIdForTag=="function"?i.factRecordIdForTag:null,m=(a||[]).filter(Boolean);if(m.length&&!f)throw new TypeError("retractSubClassOf needs a store option carrying factRecordIdForTag (memory/core.mjs's) to scope a retraction to sourceTags");let h=V(t),b=V(n),g=Se(h,c,b),w=await l(e),y=u(w),v=new Map(y.map(P=>[P.id,P]));if(!v.has(g))return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!1};let R=v.get(g).sourceIds||[],S=m.map(P=>f(g,P).slice(g.length+1)),j=m.length?R.filter(P=>S.includes(P)):[],I=!m.length||j.length>0;if(m.length&&!I)return{retracted:[],count:0,budget:s,depth:o,truncated:!1,found:!0,ownRecord:!1,stillStands:!0};let x=m.length>0&&j.length<R.length,_=new Set([g]),$=[g],T=new Map,C=!1;if(!x){let P=y.filter(J=>Hi(J).length&&Fc(J.provenance)),D=new Map;for(let J of P)for(let L of Hi(J))for(let K of L)D.has(K)||D.set(K,new Set),D.get(K).add(J.id);let H=0,Y=[g];for(;H<o;H+=1){let J=new Set;for(let B of Y)for(let U of D.get(B)||[])_.has(U)||J.add(U);let L=[...J].map(B=>v.get(B)).sort((B,U)=>B.subject.localeCompare(U.subject)||B.predicate.localeCompare(U.predicate)||B.object.localeCompare(U.object));if(!L.length)break;let K=y.filter(B=>!_.has(B.id)&&!J.has(B.id)),W=new Set(K.map(B=>B.id)),N=o$(K),F=kO(K),O=!1,z=!1;Y=[];for(let B of L){if(_.size>=s){z=!0;break}let U=Hi(B),G=U.filter(ae=>ae.every(fe=>W.has(fe)));if(G.length){G.length!==U.length&&T.set(B.id,G);continue}let Q=N(B,{maxEnvironments:r});if(Q.length){T.set(B.id,Q);continue}F(B)||(_.add(B.id),$.push(B.id),Y.push(B.id),O=!0)}if(z){C=!0;break}if(!O)break}!C&&H>=o&&(C=P.some(J=>!_.has(J.id)&&J.justification.some(L=>_.has(L))))}let E=m.length?[...j.map(P=>`${g}@${P}`),...$.slice(1)]:$,{removed:k}=await d(e,E);if(p){let P=[...T.entries()].filter(([D])=>!_.has(D)).sort((D,H)=>D[0].localeCompare(H[0])).map(([D,H])=>{let Y=v.get(D);return{subject:Y.subject,predicate:Y.predicate,object:Y.object,justification:H,...r$(Y.provenance,H,J=>v.get(J)?.trust)||{}}});P.length&&await p(e,P)}return{retracted:k,count:k.length,budget:s,depth:o,truncated:C,found:!0,...m.length?{ownRecord:!0,stillStands:x}:{}}}function Dc(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function qf(e,t,n,s,{maxHops:o=6}={}){let r=t instanceof Set?t:new Set(t||[]),i=s instanceof Map?s:Dc(s),a=[];for(let[l,u]of n||[])l===e&&u&&a.push({node:u,path:[{subject:l,predicate:Ft,object:u}]});for(let l of i.get(e)||[])a.push({node:l,path:[{subject:e,predicate:ze,object:l}]});let c=new Set([e]);for(let l=1;l<=o&&a.length;l+=1){for(let{node:d,path:p}of a)if(r.has(d))return p;if(l===o)break;let u=[];for(let{node:d,path:p}of a)if(!c.has(d)){c.add(d);for(let f of i.get(d)||[])c.has(f)||u.push({node:f,path:[...p,{subject:d,predicate:ze,object:f}]})}a=u}return null}var ze,Ky,Hy,Ft,qy,Yy,Vr,Mf,Ff,Df,On,Nn,zf,Bf,Uf,Hr,Be,zs,ho,Ho,Kr,qi,gO,Wf,yO,$O,Vf,Kf,Hf,vO,EO,Hi,_O,Ct=M(()=>{Ye();Gy();ze="rdfs:subClassOf",Ky="subClassOf",Hy=`entailed:${Ky}`,Ft="rdf:type",qy="type",Yy=`entailed:${qy}`,Vr="owl:disjointWith",Mf="disjointWith",Ff=`entailed:${Mf}`,Df=.95,On="owl:onProperty",Nn="owl:someValuesFrom",zf="someValuesFrom",Bf=`entailed:${zf}`,Uf=.95,Hr=4,Be="\u241F",zs=e=>String(e||"").trim().toLowerCase()==="rdfs:subclassof",ho=e=>String(e||"").trim().toLowerCase()==="rdf:type",Ho=e=>String(e||"").trim().toLowerCase()==="owl:disjointwith",Kr=e=>String(e||"").trim().toLowerCase()==="owl:onproperty",qi=e=>String(e||"").trim().toLowerCase()==="owl:somevaluesfrom",gO=e=>String(e||"").trim().toLowerCase()==="owl:onclass",Wf=new Set(["rdfs:subclassof","rdf:type","owl:disjointwith","owl:onproperty","owl:somevaluesfrom","owl:intersectionof"]);yO="has",$O={"owl:cardinality":"exactly","owl:mincardinality":"min","owl:maxcardinality":"max"};Vf="someValuesFromSubsumption",Kf=`entailed:${Vf}`,Hf=.95;vO=.95;EO=.95;Hi=e=>e.environments||(Array.isArray(e.justification)&&e.justification.length?[e.justification]:[]);_O=new Map([[Ff,Df],[Bf,Uf],[Kf,Hf]])});function Xr(e){let t=String(e||""),n=a$.get(t);return n||(t.startsWith(i$)?zc+t.slice(i$.length):t)}function u$(e,t,n,s,o){let r=null;for(let i of e){if(i===t)return[];let a=qf(i,new Set([t]),n,s,{maxHops:o});a&&(!r||a.length<r.length)&&(r=a)}return r}function Wc(e,t,n,{maxHops:s=3}={}){let o=Yr(e),r=Yr(t),i=Array.isArray(n)?n:[],{typeEdges:a,subClassSucc:c}=l$(i),l=i.filter(g=>(g.predicate===Uc||g.predicate===qr)&&r.has(g.object)),u=[];for(let g of l){let w=g.predicate===qr?"negative":"positive";if(o.has(g.subject)){u.push({fact:g,polarity:w,hops:0,chain:null});continue}let y=u$(o,g.subject,a,c,s);y&&y.length&&u.push({fact:g,polarity:w,hops:y.length,chain:y})}if(!u.length)return{verdict:"none",hops:0,positive:[],negative:[],chain:null,overrides:null,baseRate:Xf(o,r,i,{maxHops:s})};u.sort((g,w)=>g.hops-w.hops||(w.fact.trust||0)-(g.fact.trust||0));let d=u[0].hops,p=u.filter(g=>g.hops===d),f=p.filter(g=>g.polarity==="positive").map(g=>g.fact),m=p.filter(g=>g.polarity==="negative").map(g=>g.fact),h=m.length&&!f.length?"negative":"positive",b=u.find(g=>g.hops>d&&g.polarity!==h)||null;return{verdict:f.length&&m.length?"both":m.length?"no":"yes",hops:d,positive:f,negative:m,chain:u[0].chain,overrides:b?{fact:b.fact,chain:b.chain}:null,baseRate:null}}function Xf(e,t,n,{maxHops:s=3}={}){let o=Yr(e),r=Yr(t),i=Array.isArray(n)?n:[],a=i.filter(h=>h.predicate===ze||h.predicate===Ft),c=a.filter(h=>o.has(h.subject)).map(h=>h.object);if(!c.length)return null;let l=c[0],u=[...new Set(a.filter(h=>h.object===l&&!o.has(h.subject)).map(h=>h.subject))],d=h=>{let b=i.find(g=>g.subject===h&&r.has(g.object)&&(g.predicate===Uc||g.predicate===qr));return b?{name:h,polarity:b.predicate===qr?"negative":"positive",fact:b}:{name:h,polarity:"unknown",fact:null}},p=u.map(d),{typeEdges:f,subClassSucc:m}=l$(i);return{klass:l,kinds:u.length,positive:p.filter(h=>h.polarity==="positive"),negative:p.filter(h=>h.polarity==="negative"),unknown:p.filter(h=>h.polarity==="unknown"),chain:u$(o,l,f,m,s)}}function Jf(e,t,{exclude:n=[],maxHops:s=3}={}){let o=Yr(e),r=Yr(n),i=Array.isArray(t)?t:[],a=new Set,c=[];for(let l of i)l.predicate!==Uc||!o.has(l.object)||r.has(l.subject)||a.has(l.subject)||(a.add(l.subject),Wc(new Set([l.subject]),o,i,{maxHops:s}).verdict==="yes"&&c.push(l));return c.sort(AO)}var zc,i$,Bc,a$,aG,c$,Uc,qr,Yf,AO,Yr,l$,Gc=M(()=>{Ct();zc="mgxneg:",i$="mgx:",Bc="mgxneg:subClassOf",a$=new Map([[ze,Bc]]),aG=new Map([...a$].map(([e,t])=>[t,e]));c$=e=>String(e||"").startsWith(zc),Uc="mgx:capableOf",qr=Xr(Uc),Yf=6,AO=(e,t)=>(t.trust||0)-(e.trust||0)||String(e.subject).localeCompare(String(t.subject)),Yr=e=>e instanceof Set?e:new Set(Array.isArray(e)?e:[e]),l$=e=>{let t=e.filter(s=>s.predicate===Ft).map(s=>[s.subject,s.object]),n=e.filter(s=>s.predicate===ze).map(s=>[s.subject,s.object]);return{typeEdges:t,subClassSucc:Dc(n)}}});function Vc(e){let t=String(e||"");return ep.has(t)?Qf:IO.has(t)||OO.test(t)?Yi:NO.has(t)?d$:Zf}function LO(e){let t=e?.observedAt;if(t&&Number.isFinite(Date.parse(t)))return String(t);if(qg.has(e?.sourceType)){for(let n of[e?.assertedAt,e?.createdAt])if(n&&Number.isFinite(Date.parse(n)))return String(n)}}function PO(e,t){let n=null;for(let s of e?.assertions||[]){let o=Date.parse(LO(s)??"");Number.isFinite(o)&&(n===null||(t?o<n:o>n))&&(n=o)}return n}function tp(e,t){let n=t===d$;if(!n&&t!==Yi)return null;let s=(e||[]).map(r=>({row:r,at:PO(r,n)}));s.sort((r,i)=>{if(r.at!==i.at)return r.at===null?1:i.at===null?-1:n?r.at-i.at:i.at-r.at;let a=(i.row.trust||0)-(r.row.trust||0);if(a)return a;let[c,l]=[String(r.row.object),String(i.row.object)];return c<l?-1:c>l?1:0});let o=s.map(r=>r.row);return{winner:o[0]||null,ranked:o,contested:s.length>1&&s[0].at===s[1].at}}var Qf,Yi,d$,Zf,CO,ep,IO,OO,NO,f$=M(()=>{Gc();Cn();Qf="merge",Yi="latest-observation-wins",d$="first-claim-wins",Zf="contradiction",CO=["mgx:hasA","mgx:capableOf","rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:partOf","mgx:memberOf","mgx:collectionOf","mgx:usedFor","mgx:receivesAction","mgx:causes","mgx:causesDesire","mgx:hasSubevent","mgx:hasPrerequisite","mgx:motivatedByGoal","mgx:obstructedBy","mgx:desires","mgx:hasProperty","mgx:madeOf","mgx:atLocation","mgx:locatedNear","mgx:createdBy","mgx:mannerOf","mgx:relatedTo","mgx:synonym","mgx:antonym","mgx:similarTo","mgx:symbolOf","mgx:knows-about"],ep=new Set(CO.flatMap(e=>[e,Xr(e)])),IO=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in","mgx:on-top-of","mgx:on-plane","mgx:under","mgx:is-open","mgx:hasMass","mgx:feels","mgx:faces","mgx:pose","mgx:display-name","mgx:nodeName","mgx:worldName"]),OO=/^mgx:has-exit-([a-z]+)$/,NO=new Set(["mgx:playedBy"])});function Qi(e){let t=String(e||""),n=t.indexOf(Kc);return n<0?"":t.slice(n+Kc.length)}function BO(e){let t=1,n=0;for(let s of e)t*=1-DO(s),n+=1;return n?zO(Math.min(1,1-t)):0}function b$(e,t,n){let s=Date.parse(e),o=Date.parse(t);return Number.isFinite(s)?Number.isFinite(o)?n(s,o)===s?String(e):String(t):String(e):Number.isFinite(o)?String(t):""}function $$(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt),o=Number.isFinite(n)?n:-1/0,r=Number.isFinite(s)?s:-1/0;return o!==r?r-o:e.id<t.id?-1:e.id>t.id?1:0}function v$(e,t="",n=""){let s=t,o=n;for(let r of e)s=w$(s,r.assertedAt),o=y$(o,r.assertedAt);return{earliest:s,latest:o}}function rp({id:e,sourceKey:t,template:n,idsProp:s,ids:o,earliest:r,latest:i,priorFor:a}){let c=[...new Set(o)].filter(Boolean).sort(),l=a?BO(c.map(u=>a(u))):void 0;return{id:e,label:n?.label||"",class:MO,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:createdAt",key:"createdAt",value:r},{prop:"mgx:sourceId",key:"sourceId",value:t},{prop:s,key:s===Jr?"rollupSourceIds":"rollupRecordIds",value:c.join(" ")},{prop:Ji,key:"rollupCount",value:String(c.length)},{prop:us,key:"rollupEarliest",value:r},{prop:ds,key:"rollupLatest",value:i},...l===void 0?[]:[{prop:Qr,key:"rollupPrior",value:String(l)}]]}}function S$({groupId:e,sourceType:t,heads:n=[],existing:s=null,priorFor:o}){if(!e||!t||n.length<64||n.length<=8)return null;let i=n.slice().sort($$).slice(8);if(!i.length)return null;let{earliest:a,latest:c}=v$(i,Dt(s,us),Dt(s,ds));return{rollup:rp({id:np(e,t),sourceKey:`rollup:${t}`,template:ip(i[0].record||s),idsProp:Jr,ids:[...Zi(s),...i.map(u=>u.sourceId)],earliest:a,latest:c,priorFor:o}),absorbed:i.map(u=>u.id),absorbedSourceIds:i.map(u=>u.sourceId)}}function E$({groupId:e,sourceId:t,leaves:n=[],existing:s=null}){if(!e||!t||n.length<8||n.length<=2)return null;let o=n.slice().sort($$),r=o.slice(0,2),i=o.slice(2);if(!i.length)return null;let{earliest:a,latest:c}=v$(i,Dt(s,us),Dt(s,ds));return{rollup:rp({id:sp(e,t),sourceKey:t,template:ip(i[0].record||s),idsProp:Xi,ids:[...FO(s),...i.map(u=>u.id)],earliest:a,latest:c}),absorbed:i.map(u=>u.id),rewire:r[r.length-1]?.id||""}}function ap(e,t,{priorFor:n}={}){let s=e?.id||t?.id,o=Us(s),r=o?Jr:Xi,i=a=>op(Dt(a,r));return rp({id:s,sourceKey:Dt(e,"mgx:sourceId")||Dt(t,"mgx:sourceId"),template:ip(Dt(e,"rdf:subject")?e:t),idsProp:r,ids:[...i(e),...i(t)],earliest:w$(Dt(e,us),Dt(t,us)),latest:y$(Dt(e,ds),Dt(t,ds)),priorFor:o?n:void 0})}function x$(e,t){if(!t)return!1;for(let n of e||[])if(Zi(n).includes(t))return!0;return!1}var MO,p$,m$,Hc,h$,Jr,Xi,Ji,us,ds,Qr,Kc,g$,np,sp,Us,Zr,qc,Dt,op,Zi,FO,DO,zO,w$,y$,ip,cp=M(()=>{MO="Fact",p$=64,m$=8,Hc=8,h$=2,Jr="mgx:rollupSourceIds",Xi="mgx:rollupRecordIds",Ji="mgx:rollupCount",us="mgx:rollupEarliest",ds="mgx:rollupLatest",Qr="mgx:rollupPrior",Kc="@rollup:",g$="#rollup",np=(e,t)=>`${e}${Kc}${t}`,sp=(e,t)=>`${e}@${t}${g$}`,Us=e=>String(e||"").includes(Kc),Zr=e=>String(e||"").endsWith(g$),qc=e=>Us(e)||Zr(e);Dt=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",op=e=>String(e||"").split(" ").filter(Boolean),Zi=e=>op(Dt(e,Jr)),FO=e=>op(Dt(e,Xi)),DO=e=>Math.max(0,Math.min(1,Number(e)||0)),zO=e=>Number(e.toFixed(6));w$=(e,t)=>b$(e,t,Math.min),y$=(e,t)=>b$(e,t,Math.max);ip=e=>({label:e?.label||"",subject:Dt(e,"rdf:subject"),predicate:Dt(e,"rdf:predicate"),object:Dt(e,"rdf:object")})});function fp(e){let t=String(e||"");return dp(t)?t.slice(0,-Qc.length):""}function j$(e,t){let n=Date.parse(e),s=Date.parse(t);return Number.isFinite(n)?Number.isFinite(s)&&s>n?String(t):String(e):Number.isFinite(s)?String(t):""}function pp({id:e,sourceId:t,template:n,ids:s,retractedAt:o,tags:r}){let i=[...new Set(s)].filter(Boolean).sort(),a=[...new Set(r)].filter(Boolean).sort();return{id:e,label:n?.label||"",class:qt,derived_from:[],mentions:[],attributes:[{prop:"rdf:subject",key:"subject",value:n?.subject||""},{prop:"rdf:predicate",key:"predicate",value:n?.predicate||""},{prop:"rdf:object",key:"object",value:n?.object||""},{prop:"mgx:sourceId",key:"sourceId",value:t||""},{prop:Xc,key:"retractedRecordIds",value:i.join(" ")},{prop:lp,key:"retractedCount",value:String(i.length)},{prop:Jc,key:"retractedAt",value:o||""},...a.length?[{prop:ea,key:"provenance",value:a.join(" | ")}]:[]]}}function R$({groupId:e,sourceId:t,recordIds:n=[],retractedAt:s="",existing:o=null,template:r=null,provenance:i=""}){if(!e||!t)return null;let a=[...qo(o),...n].filter(Boolean);return a.length?pp({id:up(e,t),sourceId:t,template:r||k$(o),ids:a,retractedAt:j$(Yo(o),s),tags:[...ta(Ln(o,ea)),...ta(i)]}):null}function _$(e,t){let n=k$(Ln(e,"rdf:subject")?e:t);return pp({id:e?.id||t?.id,sourceId:Ln(e,"mgx:sourceId")||Ln(t,"mgx:sourceId"),template:n,ids:[...qo(e),...qo(t)],retractedAt:j$(Yo(e),Yo(t)),tags:[...ta(Ln(e,ea)),...ta(Ln(t,ea))]})}function WO(e,t){let n=Date.parse(e),s=Date.parse(t);return!Number.isFinite(s)||!Number.isFinite(n)?!0:n<=s}function GO(e,t,n=""){return!e||!t||!qo(e).includes(t)?!1:WO(n,Yo(e))}function Zc(e,t,n=""){for(let s of e||[])if(GO(s,t,n))return!0;return!1}function VO(e,t){let n=[...new Set(t||[])].filter(Boolean).sort();return[e||"-",...n].join(" ")}function KO(e){let t=String(e||"").split(" ").filter(Boolean),n=t[0]||"",s=n==="-"||!Number.isFinite(Date.parse(n))?"":n,o=s||n==="-"?t.slice(1):t;return{retractedAt:s,ids:o}}function el(e){let t=fp(e?.id);return t?{id:e.id,subject:t,predicate:Yc,object:VO(Yo(e),qo(e)),provenance:Ln(e,ea)}:null}function tl(e){if(!e||e.predicate!==Yc)return null;let t=String(e.subject||""),n=t.indexOf("@");if(n<=0||n===t.length-1)return null;let{retractedAt:s,ids:o}=KO(e.object);return o.length?pp({id:`${t}${Qc}`,sourceId:t.slice(n+1),template:null,ids:o,retractedAt:s,tags:ta(e.provenance)}):null}var qt,Yc,Xc,Jc,lp,Qc,ea,up,dp,Ln,UO,ta,qo,Yo,k$,mp=M(()=>{qt="Retraction",Yc="mgx:retracted",Xc="mgx:retractedRecordIds",Jc="mgx:retractedAt",lp="mgx:retractedCount",Qc="#retracted",ea="mgx:factProvenance",up=(e,t)=>`${e}@${t}${Qc}`,dp=e=>String(e||"").endsWith(Qc);Ln=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",UO=e=>String(e||"").split(" ").filter(Boolean),ta=e=>String(e||"").split(" | ").filter(Boolean),qo=e=>UO(Ln(e,Xc)),Yo=e=>Ln(e,Jc);k$=e=>({label:e?.label||"",subject:Ln(e,"rdf:subject"),predicate:Ln(e,"rdf:predicate"),object:Ln(e,"rdf:object")})});var HO,qO,YO,XO,hp,hG,T$=M(()=>{Cn();HO="mgx:worldName",qO="mgx:nodeName",YO="mgx:playedBy",XO="mgx:waved",hp="mgx:invitedBy",hG=Object.freeze([HO,qO,YO,XO,hp])});function nl(e){let t=new Set;for(let n of e||[])n?.predicate===hp&&(n.subject&&t.add(String(n.subject)),n.object&&t.add(String(n.object)));return[...t].sort()}function gp(e,t=""){let n=String(t||"");return(e||[]).map(String).filter(s=>s&&s!==n)}function sl({recordIds:e=[],roster:t=[],self:n="",acknowledgedBy:s=null}={}){let o=gp(t,n);if(!o.length)return[];if(typeof s!="function")return[];let r=new Map;for(let a of o){let c=s(a);r.set(a,new Set([...c||[]].map(String)))}return[...new Set((e||[]).map(String).filter(Boolean))].sort().filter(a=>o.every(c=>r.get(c).has(a)))}var bp=M(()=>{T$()});function fs(e,t){let n=(e?.attributes||[]).find(s=>s?.prop===t);return n?String(n.value??""):void 0}function sN(e,t){(!e?.class||!JO.has(e.class))&&t.push(`must have a class from the closed vocabulary Utterance | Fact | Session | Source | Rule (got ${JSON.stringify(e?.class)})`)}function oN(e,t){for(let a of["rdf:subject","rdf:predicate","rdf:object"])na(fs(e,a))||t.push(`a Fact needs a non-empty ${a}`);for(let a of["rdf:subject","rdf:object"]){let c=fs(e,a);c!==void 0&&eN.test(c)&&t.push(`a Fact's ${a} must be a single term, not text spanning a sentence boundary (got ${JSON.stringify(c)})`)}let n=fs(e,"mgx:factProvenance");n!==void 0&&!na(n)&&t.push("mgx:factProvenance, when present, must be non-empty");let s=typeof e?.id=="string"?e.id:"";tN(s)&&!C$.test(s)&&t.push(`a Fact record id must read <groupId>@<sourceId>, optionally suffixed #v<n> once superseded (got ${JSON.stringify(s)})`);let o=fs(e,"mgx:sourceId");o!==void 0&&!na(o)&&t.push("mgx:sourceId, when present, must be non-empty (every assertion record has a key, src:none included)");let r=fs(e,"mgx:observedAt");r!==void 0&&!Number.isFinite(Date.parse(r))&&t.push(`mgx:observedAt, when present, must be a parseable instant (got ${JSON.stringify(r)})`);let i=fs(e,"mgx:extractionFinding");if(i!==void 0){let a=i.split(" ").filter(Boolean);a.length||t.push("mgx:extractionFinding, when present, must name at least one finding");for(let c of a)QO.has(c)||t.push(`mgx:extractionFinding must name findings from the closed vocabulary ${ol.join(" | ")} (got ${JSON.stringify(c)})`)}for(let a of nN){let c=fs(e,a);if(c===void 0)continue;let l=c.split(" ").filter(Boolean);l.length||t.push(`${a}, when present, must name at least one record id`);for(let u of l)C$.test(u)||t.push(`${a} must name Fact record ids (got ${JSON.stringify(u)})`)}}function rN(e,t){na(fs(e,"mgx:ruleName"))||t.push("a Rule needs a non-empty mgx:ruleName");let n=fs(e,"mgx:ruleKind");if(!n||!A$.has(n)){t.push(`a Rule's mgx:ruleKind must be one of ${[...A$].join(" | ")} (got ${JSON.stringify(n)})`);return}for(let s of ZO[n])na(fs(e,s))||t.push(`a ${n} Rule needs a non-empty ${s}`)}function iN(e){let t=[];return sN(e,t),e?.class==="Fact"&&oN(e,t),e?.class==="Rule"&&rN(e,t),{ok:t.length===0,violations:t}}function wp(e){let t=iN(e);if(!t.ok){let n=new Error(`SHACL validation failed for ${e?.class} "${e?.id}": ${t.violations.join(" | ")}`);throw n.violations=t.violations,n}}var JO,ol,QO,A$,ZO,eN,C$,tN,nN,na,yp=M(()=>{JO=new Set(["Utterance","Fact","Session","Source","Rule"]),ol=Object.freeze(["identifier-token","clause-fallback","pronoun-carry","definitional-frame"]),QO=new Set(ol),A$=new Set(["compose2","filter","recursive","action-signature","action-precond","action-effect","action-constraint"]),ZO={compose2:["mgx:ruleBase1","mgx:ruleBase2"],filter:["mgx:ruleBase1","mgx:ruleFilterProperty"],recursive:["mgx:ruleBaseCase","mgx:ruleRecStep"],"action-signature":["mgx:ruleActionSubjectClass","mgx:ruleActionTargetClass"],"action-precond":["mgx:ruleActionPrecondShape","mgx:ruleActionPrecondPredicate","mgx:ruleActionPrecondRole","mgx:ruleActionPrecondScope"],"action-effect":["mgx:ruleActionEffectPredicate","mgx:ruleActionEffectSubject"],"action-constraint":["mgx:ruleActionConstraintLeft","mgx:ruleActionConstraintRight","mgx:ruleActionConstraintGuard"]},eN=/[.!?]\s+\w/,C$=/^[^@]+@(.+?)(#v[1-9][0-9]*)?$/,tN=e=>e.includes("@")||/#v\d/.test(e),nN=["mgx:supersedes","mgx:supersededBy"];na=e=>typeof e=="string"&&e.trim().length>0});function N$(e,t){return t?.rowKey&&(e.rowKey=t.rowKey),t?.rowClass&&(e.rowClass=t.rowClass),t?.provenance&&(e.provenance=t.provenance),t?.status&&(e.status=t.status),e}function oa(e){let t=[];if(!e||typeof e!="object")return["not an object"];e.kind!==ei&&t.push(`kind is ${JSON.stringify(e.kind)}, expected ${JSON.stringify(ei)}`),e.contractVersion!==1&&t.push(`contractVersion is ${JSON.stringify(e.contractVersion)}, expected 1`);for(let n of aN)typeof e[n]!="function"&&t.push(`${n}() is missing`);for(let n of cN)n in e&&e[n]!=null&&typeof e[n]!="function"&&t.push(`${n} is present but not a function`);return t}function al(e){return oa(e).length===0}function $p(e){return new TextEncoder().encode(String(e?.json??"")).length}function cl(e){let t=[];if(!e||typeof e!="object")return["not an object"];if((typeof e.rowKey!="string"||!e.rowKey)&&t.push("rowKey must be a non-empty string"),rl.includes(e.rowClass)||t.push(`rowClass ${JSON.stringify(e.rowClass)} is outside the closed set (${rl.join(", ")})`),typeof e.term!="string"&&t.push("term must be a string, empty when the row has no term read path"),typeof e.json!="string"||!e.json)t.push("json must be a non-empty string");else{let n=$p(e);n>Xo&&t.push(`json is ${n} bytes, over the ${Xo}-byte cap`)}return e.expiresAt!==void 0&&!Number.isInteger(e.expiresAt)&&t.push("expiresAt must be epoch seconds as an integer when present"),t}function L$(e){return cl(e).length===0}function ra(e,t={}){let n=cl(e);if(!n.length)return e;throw new Pn(`invalid memory row ${JSON.stringify(e?.rowKey??null)}: ${n.join("; ")}`,{rowKey:typeof e?.rowKey=="string"?e.rowKey:"",rowClass:e?.rowClass,...t})}var ei,il,rl,sa,Xo,I$,O$,Pn,Jo,aN,cN,ia=M(()=>{ei="tmct-memory-row-backend",il=1,rl=Object.freeze(["fact","source","utterance","session","rule","retraction","edge-group","bookkeeping"]),sa="bookkeeping",Xo=4096,I$="TMCT_BACKEND_REJECTED",O$="TMCT_BACKEND_UNAVAILABLE";Pn=class extends Error{constructor(t,n={}){super(t,n.cause?{cause:n.cause}:void 0),this.name="BackendRejected",this.code=I$,N$(this,n)}},Jo=class extends Error{constructor(t,n={}){super(t,n.cause?{cause:n.cause}:void 0),this.name="BackendUnavailable",this.code=O$,N$(this,n)}},aN=Object.freeze(["readRows","putRows","deleteRows","readMeta","putMeta","deleteAll","close"]),cN=Object.freeze(["readRowsByTerm"])});function mN(){return vp||(vp=new Map([[Ze,"fact"],[ps,"source"],[go,"utterance"],[Qo,"session"],[ms,"rule"],[qt,"retraction"]])),vp}function hN(e){let t=mN().get(e?.class);if(t)return t;throw new Pn(`individual ${JSON.stringify(e?.id??null)} has class ${JSON.stringify(e?.class??null)}, which no row class covers`,{rowKey:String(e?.id||"")})}function gN(e){return(e?.attributes||[]).some(t=>t?.prop===ti)?{...e,attributes:e.attributes.filter(t=>t?.prop!==ti)}:e}function bN(e){let t=new Map,n=0;for(let s of e||[]){let o;try{o=Number(JSON.parse(s?.json??"{}").ord)}catch{o=NaN}Number.isFinite(o)&&(t.set(s.rowKey,o),o>=n&&(n=o+1))}return s=>{let o=t.get(s);if(o!==void 0)return o;let r=n;return n+=1,r}}function P$(e,t,{onOversizedRow:n,log:s}){let o=$p(e);if(o<=Xo||n==="keep")return!0;let r=t?` (provenance: ${t})`:"",i=`${e.rowClass} row ${e.rowKey} serializes to ${o} bytes, over the ${Xo}-byte cap${r}`;if(n==="drop")return s(`dropped an oversized memory row: ${i}`),!1;throw new Pn(i,{rowKey:e.rowKey,rowClass:e.rowClass,provenance:t})}function Sp(e,{priorRows:t=null,onOversizedRow:n="throw",log:s=wN}={}){if(!yN.has(n))throw new TypeError(`onOversizedRow must be "throw", "drop", or "keep", got ${JSON.stringify(n)}`);let o=bN(t),r={onOversizedRow:n,log:s},i=[];for(let a of e?.individuals||[]){if(!a?.id)continue;let c=hN(a),l={rowKey:String(a.id),rowClass:c,term:c==="fact"?V(pN(a,"subject")):"",json:JSON.stringify({ord:o(String(a.id)),individual:gN(a)})};P$(l,z$(a,dN),r)&&i.push(l)}for(let a of e?.objectProperties||[]){if(!a?.prop)continue;let c=`${lN}${a.prop}`,l={rowKey:c,rowClass:D$,term:"",json:JSON.stringify({ord:o(c),group:a})};P$(l,"",r)&&i.push(l)}return i}function $N(e){let t=[],n=[];for(let s=0;s<e.length;s+=1)e[s]?.class===Ze&&(t.push(s),n.push(e[s]));n.sort((s,o)=>s.id<o.id?-1:s.id>o.id?1:0);for(let s=0;s<t.length;s+=1)e[t[s]]=n[s]}function ll(e){let t="",n="",s=!1,o=!1,r=!1;for(let i of e?.attributes||[])!o&&i?.key==="prose_tokens"&&(t=i.value||"",o=!0),!r&&i?.prop===uN&&(n=i.value||"",r=!0),i?.prop===ti&&(s=!0);return{proseTokens:t,supersedes:n,carriesSupersededBy:s}}function U$(e,t){t.index=e.proseIndex,Object.defineProperty(e,B$,{value:t,writable:!0,configurable:!0,enumerable:!1})}function W$(e,{needSupersessions:t}={}){let n=e[B$];return!n||n.index!==e.proseIndex||!e.proseIndex||t&&!n.successorsById?null:n}function F$(e,t){let n=0,s=e.length;for(;n<s;){let o=n+s>>1;e[o]<t?n=o+1:s=o}return n}function ul(e,t,n,s){if(n!==s){for(let o of n?n.split(" "):[]){let r=e[o];if(!r)continue;let i=F$(r,t);r[i]===t&&(r.splice(i,1),r.length||delete e[o])}for(let o of s?s.split(" "):[]){let r=e[o]||(e[o]=[]);r.splice(F$(r,t),0,t)}}}function G$(e,t){let n=(e?.attributes||[]).some(o=>o?.prop===ti);if(!t&&!n)return;let s=(e.attributes||[]).filter(o=>o?.prop!==ti);e.attributes=t?[...s,{prop:ti,key:"supersededBy",value:[...t].sort().join(" ")}]:s}function vN(e,t){let n=new Map,s=new Map,o=new Map;for(let r of t){let{proseTokens:i,supersedes:a}=ll(r);i&&s.set(r.id,i);let c=V$(r,a);if(c){o.set(r.id,c);for(let l of c.split(" ").filter(Boolean)){let u=n.get(l)||new Set;u.add(r.id),n.set(l,u)}}}for(let r of t)G$(r,n.get(r?.id));e.proseIndex=null,e.proseIndex=dd(t),U$(e,{tokensById:s,supersedesById:o,successorsById:n})}function SN(e,t,n){let{tokensById:s,supersedesById:o,successorsById:r}=n,i=e.proseIndex,a=new Set,c=new Set,l=0,u=0,d=(f,m)=>{let h=r.get(m);h?.delete(f)&&(h.size||r.delete(m),a.add(m))},p=(f,m)=>{let h=r.get(m)||new Set;h.has(f)||(h.add(f),r.set(m,h),a.add(m))};for(let f of t){let m=f?.id,{proseTokens:h,supersedes:b,carriesSupersededBy:g}=ll(f);g&&c.add(m),h&&(l+=1);let w=s.get(m)||"";h!==w&&(ul(i,m,w,h),h?s.set(m,h):s.delete(m));let y=V$(f,b);y&&(u+=1);let v=o.get(m)||"";if(y!==v){for(let R of v.split(" ").filter(Boolean))d(m,R);for(let R of y.split(" ").filter(Boolean))p(m,R);y?o.set(m,y):o.delete(m)}}if(s.size!==l||o.size!==u){let f=new Set(t.map(m=>m?.id));for(let[m,h]of s)f.has(m)||(ul(i,m,h,""),s.delete(m));for(let[m,h]of o)if(!f.has(m)){for(let b of h.split(" ").filter(Boolean))d(m,b);o.delete(m)}}for(let f of c)a.add(f);for(let f of r.keys())a.add(f);if(a.size)for(let f of t)a.has(f?.id)&&G$(f,r.get(f?.id))}function EN(e){let t=[Qo,go,Ze,ps,ms],n=new Map(t.map(s=>[s,{name:s,count:0,sample:[]}]));for(let s of e){let o=n.get(s?.class);o&&(o.count+=1,o.sample.length<3&&o.sample.push(s.label))}return t.map(s=>n.get(s)).filter(s=>s.count)}function xN(e){let t="";for(let n of e){if(n?.class!==go)continue;let s=z$(n,fN);s>t&&(t=s)}return t}function dl(e,{meta:t=null}={}){let n=hs();t?.memory!==void 0&&(n.memory=t.memory),t?.prefixes!==void 0&&(n.prefixes=t.prefixes);let s=[],o=[];for(let r of e||[]){if(!r||r.rowClass===sa)continue;let i=JSON.parse(r.json),c={ord:Number.isFinite(Number(i?.ord))?Number(i.ord):0,rowKey:String(r.rowKey||"")};r.rowClass===D$?o.push({...c,group:i?.group}):s.push({...c,individual:i?.individual})}return s.sort(M$),o.sort(M$),n.individuals=s.map(r=>r.individual).filter(Boolean),n.objectProperties=o.map(r=>r.group).filter(Boolean),fl(n)}function fl(e){let t=e.individuals||[];$N(t);let n=W$(e,{needSupersessions:!0});return n?SN(e,t,n):vN(e,t),e.classes=EN(t),e.generated_at=xN(t),e}function K$(e){let t=e.individuals||[],n=W$(e);if(!n){let i=new Map;for(let a of t){let{proseTokens:c}=ll(a);c&&i.set(a.id,c)}return e.proseIndex=null,e.proseIndex=dd(t),U$(e,{tokensById:i,supersedesById:null,successorsById:null}),e}let{tokensById:s}=n;n.supersedesById=null,n.successorsById=null;let o=e.proseIndex,r=0;for(let i of t){let{proseTokens:a}=ll(i);a&&(r+=1);let c=s.get(i?.id)||"";a!==c&&(ul(o,i?.id,c,a),a?s.set(i.id,a):s.delete(i?.id))}if(s.size!==r){let i=new Set(t.map(a=>a?.id));for(let[a,c]of s)i.has(a)||(ul(o,a,c,""),s.delete(a))}return e}function Ep(e,t){let n=new Map((e||[]).filter(i=>i?.rowKey).map(i=>[i.rowKey,i])),s=[],o=new Set;for(let i of t||[]){if(!i?.rowKey)continue;o.add(i.rowKey);let a=n.get(i.rowKey);a&&a.json===i.json&&a.term===i.term&&a.rowClass===i.rowClass||s.push(i)}let r=[...n.keys()].filter(i=>!o.has(i));return{puts:s,deletes:r}}var D$,lN,uN,ti,dN,fN,z$,pN,vp,wN,yN,M$,B$,V$,xp=M(()=>{Ue();Ye();Kn();ia();D$="edge-group",lN="edge-group:",uN="mgx:supersedes",ti="mgx:supersededBy",dN="mgx:factProvenance",fN="mgx:utteranceTs",z$=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",pN=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",vp=null;wN=e=>console.warn(e),yN=new Set(["throw","drop","keep"]);M$=(e,t)=>e.ord-t.ord||(e.rowKey<t.rowKey?-1:e.rowKey>t.rowKey?1:0);B$=Symbol("tmct.carriedDerivations");V$=(e,t)=>e?.class===Ze?t:""});var jp={};Nt(jp,{access:()=>RN,appendFile:()=>AN,basename:()=>KN,copyFile:()=>MN,createInterface:()=>JN,createReadStream:()=>DN,createRequire:()=>jN,createWriteStream:()=>zN,default:()=>ZN,dirname:()=>WN,existsSync:()=>BN,fileURLToPath:()=>qN,isAbsolute:()=>VN,join:()=>UN,mkdir:()=>CN,mkdtemp:()=>IN,randomBytes:()=>YN,readFile:()=>_N,readFileSync:()=>kN,readdir:()=>FN,rename:()=>ON,resolve:()=>GN,rm:()=>LN,sep:()=>HN,spawnSync:()=>XN,stat:()=>PN,tmpdir:()=>QN,unlink:()=>NN,writeFile:()=>TN});var vt,jN,kN,RN,_N,TN,AN,CN,IN,ON,NN,LN,PN,MN,FN,DN,zN,BN,UN,WN,GN,VN,KN,HN,qN,YN,XN,JN,QN,ZN,kp=M(()=>{vt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},jN=vt("createRequire"),kN=vt("readFileSync"),RN=vt("access"),_N=vt("readFile"),TN=vt("writeFile"),AN=vt("appendFile"),CN=vt("mkdir"),IN=vt("mkdtemp"),ON=vt("rename"),NN=vt("unlink"),LN=vt("rm"),PN=vt("stat"),MN=vt("copyFile"),FN=vt("readdir"),DN=vt("createReadStream"),zN=vt("createWriteStream"),BN=()=>!1,UN=(...e)=>e.join("/"),WN=e=>String(e).replace(/\/[^/]*$/,""),GN=(...e)=>e.join("/"),VN=e=>String(e).startsWith("/"),KN=e=>String(e).split("/").pop(),HN="/",qN=e=>String(e),YN=vt("randomBytes"),XN=vt("spawnSync"),JN=vt("createInterface"),QN=()=>"/tmp",ZN={}});var eL,aa,Rp=M(()=>{eL=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i,aa=class e extends Date{#t=!1;#n=!1;#e=null;constructor(t){let n=!0,s=!0,o="Z";if(typeof t=="string"){let r=t.match(eL);r?(r[1]||(n=!1,t=`0000-01-01T${t}`),s=!!r[2],s&&t[10]===" "&&(t=t.replace(" ","T")),r[2]&&+r[2]>23?t="":(o=r[3]||null,t=t.toUpperCase(),!o&&s&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=n,this.#n=s,this.#e=o)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let n=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return n=this.#e[0]==="-"?n:-n,new Date(this.getTime()-n*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,n="Z"){let s=new e(t);return s.#e=n,s}static wrapAsLocalDateTime(t){let n=new e(t);return n.#e=null,n}static wrapAsLocalDate(t){let n=new e(t);return n.#n=!1,n.#e=null,n}static wrapAsLocalTime(t){let n=new e(t);return n.#t=!1,n.#e=null,n}}});function tL(e,t){let n=e.slice(0,t).split(/\r\n|\n|\r/g);return[n.length,n.pop().length+1]}function nL(e,t,n){let s=e.split(/\r\n|\n|\r/g),o="",r=(Math.log10(t+1)|0)+1;for(let i=t-1;i<=t+1;i++){let a=s[i-1];a&&(o+=i.toString().padEnd(r," "),o+=": ",o+=a,o+=`
86
86
  `,i===t&&(o+=" ".repeat(r+n+2),o+=`^
87
- `))}return o}var ve,Qo=P(()=>{ve=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=NN(n.toml,n.ptr),r=LN(n.toml,s,o);super(`Invalid TOML document: ${t}
87
+ `))}return o}var ve,Zo=M(()=>{ve=class extends Error{line;column;codeblock;constructor(t,n){let[s,o]=tL(n.toml,n.ptr),r=nL(n.toml,s,o);super(`Invalid TOML document: ${t}
88
88
 
89
- ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function al(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
89
+ ${r}`,n),this.line=s,this.column=o,this.codeblock=r}}});function pl(e,t){let n=e[t++],s=n,o=n==="'",r=n===e[t]&&n===e[t+1];r&&(e[t+=2]===`
90
90
  `?t++:e[t]==="\r"&&e[t+1]===`
91
91
  `&&(t+=2));let i="",a=t,c=0;for(let l=t;l<e.length;l++)if(n=e[l],r&&(n===`
92
92
  `||n==="\r"&&e[l+1]===`
93
93
  `))c=c&&3;else{if(n<" "&&n!==" "||n==="\x7F")throw new ve("control characters are not allowed in strings",{toml:e,ptr:l});if((!c||c===3)&&n===s&&(!r||e[l+1]===s&&e[l+2]===s))return r&&(e[l+3]===s&&l++,e[l+3]===s&&l++),[c?i:i+e.slice(a,l),l+(r?3:1)];if(!c)!o&&n==="\\"&&(i+=e.slice(a,a=l),c=1);else if(c===1)if(n==="x"||n==="u"||n==="U"){let u=0,d=n==="x"?2:n==="u"?4:8;for(let p=0;p<d;p++,l++){let f=e.charCodeAt(l+1),m=f>=48&&f<=57?f-48:f>=65&&f<=70?f-65+10:f>=97&&f<=102?f-97+10:-1;if(m<0)throw new ve("invalid non-hex character in unicode escape",{toml:e,ptr:l+1});u=u<<4|m}if(u<0||u>1114111||u>=55296&&u<=57343)throw new ve("invalid unicode escape",{toml:e,ptr:l});i+=String.fromCodePoint(u),a=l+1,c=0}else if(n===" "||n===" ")c=2;else{if(n==="b")i+="\b";else if(n==="t")i+=" ";else if(n==="n")i+=`
94
- `;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new ve("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new ve("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new ve("unfinished string",{toml:e,ptr:t})}function A$(e,t,n,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=PN.test(e);if(o||MN.test(e)){if(FN.test(e))throw new ve("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new ve("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new ve("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new oa(e);if(!r.isValid())throw new ve("invalid value",{toml:t,ptr:n});return r}var PN,MN,FN,Sp=P(()=>{vp();Qo();PN=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,MN=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,FN=/^[+-]?0[0-9_]/});function cl(e,t=0,n=e.length){let s=e.indexOf(`
95
- `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function Zr(e,t){for(let n=t;n<e.length;n++){let s=e[n];if(s===`
94
+ `;else if(n==="f")i+="\f";else if(n==="r")i+="\r";else if(n==="e")i+="\x1B";else if(n==='"')i+='"';else if(n==="\\")i+="\\";else throw new ve("unrecognized escape sequence",{toml:e,ptr:l});a=l+1,c=0}else if(n!==" "&&n!==" "){if(c===2)throw new ve("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:a});c=!o&&n==="\\"?1:0,a=l}}throw new ve("unfinished string",{toml:e,ptr:t})}function H$(e,t,n,s){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return s?0n:0;let o=sL.test(e);if(o||oL.test(e)){if(rL.test(e))throw new ve("leading zeroes are not allowed",{toml:t,ptr:n});e=e.replace(/_/g,"");let i=+e;if(isNaN(i))throw new ve("invalid number",{toml:t,ptr:n});if(o){if((o=!Number.isSafeInteger(i))&&!s)throw new ve("integer value cannot be represented losslessly",{toml:t,ptr:n});(o||s===!0)&&(i=BigInt(e))}return i}let r=new aa(e);if(!r.isValid())throw new ve("invalid value",{toml:t,ptr:n});return r}var sL,oL,rL,_p=M(()=>{Rp();Zo();sL=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,oL=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,rL=/^[+-]?0[0-9_]/});function ml(e,t=0,n=e.length){let s=e.indexOf(`
95
+ `,t);return e[s-1]==="\r"&&s--,s<=n?s:-1}function ni(e,t){for(let n=t;n<e.length;n++){let s=e[n];if(s===`
96
96
  `)return n;if(s==="\r"&&e[n+1]===`
97
- `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new ve("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function ps(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
97
+ `)return n+1;if(s<" "&&s!==" "||s==="\x7F")throw new ve("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function gs(e,t,n,s){let o;for(;;){for(;(o=e[t])===" "||o===" "||!n&&(o===`
98
98
  `||o==="\r"&&e[t+1]===`
99
- `);)t++;if(s||o!=="#")break;t=Zr(e,t)}return t}function C$(e,t,n,s,o=!1){if(!s)return t=cl(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=cl(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
99
+ `);)t++;if(s||o!=="#")break;t=ni(e,t)}return t}function q$(e,t,n,s,o=!1){if(!s)return t=ml(e,t),t<0?e.length:t;for(let r=t;r<e.length;r++){let i=e[r];if(i==="#")r=ml(e,r);else{if(i===n)return r+1;if(i===s||o&&(i===`
100
100
  `||i==="\r"&&e[r+1]===`
101
- `))return r}}throw new ve("cannot find end of structure",{toml:e,ptr:t})}var ll=P(()=>{Qo();});function DN(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(Zr(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ra(e,t,n,s,o){if(s===0)throw new ve("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?O$(e,t,s,o):I$(e,t,s,o);if(n){if(l=ps(e,l),e[l]===",")l++;else if(e[l]!==n)throw new ve("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=al(e,t);if(n){if(l=ps(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
- `&&e[l]!=="\r")throw new ve("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=C$(e,t,",",n),a=DN(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new ve("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=ps(e,t+a[1]),e[i]===","&&i++),[A$(a[0],e,t,o),i]}var Ep=P(()=>{Sp();xp();ll();Qo();});function ul(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new ve("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=al(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=cl(l);if(u>-1)throw new ve("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new ve("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{s=e.indexOf(".",t);let a=e.slice(t,s<0||s>r?r:s);if(!zN.test(a))throw new ve("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(s+1&&s<r);return[o,ps(e,r+1,!0,!0)]}function I$(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=Zr(e,t);else if(i!==" "&&i!==" "&&i!==`
103
- `&&i!=="\r"){let a,c=o,l=!1,[u,d]=ul(e,t-1);for(let m=0;m<u.length;m++){if(m&&(c=l?c[a]:c[a]={}),a=u[m],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||r.has(c[a])))throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});let[p,f]=ra(e,d,"}",n-1,s);r.add(p),c[a]=p,t=f}}if(!i)throw new ve("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function O$(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=Zr(e,t);else if(r!==" "&&r!==" "&&r!==`
104
- `&&r!=="\r"){let i=ra(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new ve("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var zN,xp=P(()=>{Sp();Ep();ll();Qo();zN=/^[a-zA-Z0-9-_]+[ \t]*$/});function N$(e,t,n,s){let o=t,r=n,i,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(o=a?o[i]:o[i]={},r=(c=r[i]).c,s===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[l],(a=Object.hasOwn(o,i))&&r[i]?.t===0&&r[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,writable:!0})),r[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(c=r[i],c.t!==s&&!(s===1&&c.t===3)||(s===2&&(c.d||(c.d=!0,o[i]=[]),o[i].push(o={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,c.c]}function Zo(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=ps(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=ul(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new ve("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=N$(l[0],s,o,c?2:1);if(!u)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=l[1]}else{let c=ul(e,a),l=N$(c[0],r,i,0);if(!l)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ra(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=ps(e,a,!0),e[a]&&e[a]!==`
105
- `&&e[a]!=="\r")throw new ve("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=ps(e,a)}return s}var L$=P(()=>{xp();Ep();ll();Qo();});var P$=P(()=>{});var dl=P(()=>{L$();P$();vp();Qo();});var jp={};Lt(jp,{CONFIG_FILE:()=>pl,loadTomlConfig:()=>ml,mergeEffective:()=>F$,normalizeConfig:()=>M$});async function ml(e,{file:t}={}){let n=t||ne(e,pl),s;try{s=await Ie(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return Zo(s)}catch(o){throw new Error(`Invalid ${pl} at ${n}: ${o&&o.message?o.message:o}`)}}async function BN(e,t){let n;if(Array.isArray(e))n=e;else{let o=Kt(t,String(e));n=(await Ie(o,"utf8")).split(`
106
- `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Kt(t,r))}return s}async function M$(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await BN(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Kt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Kt(s,String(n.graph_file))),n.graph_files!==void 0){let w=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=w.map(E=>Kt(s,String(E)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},c={};a.enabled!==void 0&&(c.enabled=a.enabled),a.limit!==void 0&&(c.limit=a.limit),a.capture_unknown_context!==void 0&&(c.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(c.unknownContextLimit=a.unknown_context_limit),Object.keys(c).length&&(o.seed=c),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let l=n.index||{},u={};l.languages!==void 0&&(u.languages=l.languages),l.exclude!==void 0&&(u.exclude=l.exclude),l.secret_exclude!==void 0&&(u.secretExclude=l.secret_exclude),l.history_depth!==void 0&&(u.historyDepth=l.history_depth),l.include_text!==void 0&&(u.includeText=l.include_text),l.include_structure!==void 0&&(u.includeStructure=l.include_structure),l.respect_gitignore!==void 0&&(u.respectGitignore=l.respect_gitignore),l.markdown_sections!==void 0&&(u.markdownSections=l.markdown_sections),l.vue!==void 0&&(u.vue=l.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},p={};d.score_gap_k!==void 0&&(p.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(p.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(p.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(p.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(p.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(p.beamSearch=d.beam_search),d.beam_width!==void 0&&(p.beamWidth=d.beam_width),d.prose_layers!==void 0&&(p.proseLayers=d.prose_layers);let f=d.expansion||{},m={};f.strategy!==void 0&&(m.strategy=f.strategy),f.nodes!==void 0&&(m.nodes=f.nodes),f.q!==void 0&&(m.q=f.q),f.depth!==void 0&&(m.depth=f.depth),Object.keys(m).length&&(p.expansion=m),Object.keys(p).length&&(o.tune=p);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let b=n.memory||{},g={};b.retention_versions!==void 0&&(g.retentionVersions=b.retention_versions),b.backend!==void 0&&(g.backend=b.backend),Object.keys(g).length&&(o.memory=g);let y=[];for(let[w,E]of UN)n[w]&&n[w][E]!==void 0&&y.push(`${w}.${E}`);return o.unwired=y,o}function fl(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:fl(o,r,n)}return n}function F$({args:e={},toml:t=null,defaults:n={}}={}){let s=fl(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?fl(o):{},i=fl(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),c={},l={};for(let u of a)u in i?(c[u]=i[u],l[u]="arg"):u in r?(c[u]=r[u],l[u]="tmct.toml"):(c[u]=s[u],l[u]="default");return{effective:c,sources:l}}var pl,UN,ia=P(()=>{Pt();Qe();dl();pl="tmct.toml";UN=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Vs={};Lt(Vs,{BackendRejected:()=>On,BackendUnavailable:()=>Xo,CANONICALISED_FROM_PROP:()=>Mp,CAPABLE_OF_PREDICATE:()=>v0,CHAIN_KEEP_DEPTH:()=>i$,CHAIN_ROLLUP_THRESHOLD:()=>Wc,CREATED_AT_PROP:()=>ut,DEFAULT_RETENTION:()=>Cp,EXTRACTION_FINDINGS:()=>el,EXTRACTION_FINDING_PROP:()=>wl,FACT_CLASS:()=>et,GROUP_ROLLUP_THRESHOLD:()=>o$,HAS_A_PREDICATE:()=>si,IN_REPLY_TO_PROP:()=>Pp,MAX_ROW_BYTES:()=>Yo,MEMORY_DIR_REL:()=>ti,MEMORY_GRAPH_REL:()=>Np,MEMORY_MANIFEST_REL:()=>vv,MEMORY_SESSION_CLASS:()=>Jo,MULTI_VALUED_PREDICATES:()=>S0,NODE_ID_REL:()=>Jp,OPERATOR_SOURCE_ID:()=>gl,RETRACTED_AT_PROP:()=>Hc,RETRACTED_COUNT_PROP:()=>np,RETRACTED_RECORD_IDS_PROP:()=>Kc,RETRACTION_CLASS:()=>Yt,RETRACTION_PREDICATE:()=>Vc,ROLLUP_COUNT_PROP:()=>Hi,ROLLUP_EARLIEST_PROP:()=>as,ROLLUP_KEEP_PER_TYPE:()=>r$,ROLLUP_LATEST_PROP:()=>cs,ROLLUP_PRIOR_PROP:()=>Xr,ROLLUP_RECORD_IDS_PROP:()=>Ki,ROLLUP_SOURCE_IDS_PROP:()=>Yr,ROW_BACKEND_CONTRACT_VERSION:()=>nl,ROW_BACKEND_KIND:()=>Qr,ROW_CLASSES:()=>tl,RULE_CLASS:()=>ds,RULE_KIND_ACTION_CONSTRAINT:()=>rm,RULE_KIND_ACTION_EFFECT:()=>ha,RULE_KIND_ACTION_PRECOND:()=>Al,RULE_KIND_ACTION_SIGNATURE:()=>om,RULE_KIND_COMPOSE2:()=>pa,RULE_KIND_FILTER:()=>ma,RULE_KIND_PROP:()=>ni,RULE_KIND_RECURSIVE:()=>sm,SAID_IN_SESSION_PROP:()=>Lp,SOURCE_CLASS:()=>us,SOURCE_RELIABILITY_PROP:()=>V$,STATED_BY_PROP:()=>Sn,SYLLOGISE_STATE_REL:()=>Xp,UPDATED_AT_PROP:()=>ks,UTTERANCE_CLASS:()=>ho,admittedNodes:()=>Qc,appendCanonicalisedFromEdges:()=>o0,appendFact:()=>c0,appendFacts:()=>Kn,appendRetractions:()=>b0,appendRule:()=>Il,appendUtterance:()=>s0,appendUtterances:()=>_v,applySeedPayload:()=>q$,assertValidRow:()=>ta,attachFactHeads:()=>tv,chainRollupIdFor:()=>Xf,cloneMemoryPayload:()=>zp,closeSqliteMemoryStore:()=>jl,createInMemoryStore:()=>ua,createSqliteMemoryStore:()=>Bp,createSqliteRowBackend:()=>PL,emptyMemory:()=>fs,factGroupId:()=>Bt,factHeadsOf:()=>nv,factIdForTriple:()=>Se,factRecordIdForTag:()=>HN,factRecordIdsFor:()=>or,findContradictions:()=>Fv,findRuleByName:()=>im,findRulesByName:()=>p0,headRollupIdFor:()=>Yf,isChainRollupId:()=>Jr,isHeadRollupId:()=>zs,isMemoryOrSqliteHandle:()=>xl,isRetractionId:()=>op,isRollupId:()=>Gc,isRowBackend:()=>sl,isRowHandle:()=>Pn,isValidRow:()=>k$,loadMemory:()=>mt,loadNodeId:()=>VL,loadSyllogiseState:()=>WL,normFactPredicate:()=>rs,normFactTerm:()=>V,openConfiguredMemoryBackend:()=>yo,openExistingMemoryBackend:()=>gL,openMemoryBackend:()=>Gp,openSqliteSeedStore:()=>nL,peersToConvince:()=>lp,provSourceClassFor:()=>qL,provenanceTagToSource:()=>Rn,readFactRows:()=>St,readObjectSupersessions:()=>tL,readOnlyMemorySnapshot:()=>bL,readRetractions:()=>g0,readRuleRows:()=>Ol,removeFacts:()=>Mv,resolveMemoryGraphFile:()=>aa,resolveRelationChase:()=>am,resolveRelationChaseReverse:()=>Lv,retirableRetractions:()=>w0,retireRetractions:()=>y0,retractedAtOf:()=>qo,retractedRecordIds:()=>Ho,retractionFromWire:()=>Jc,retractionIdFor:()=>sp,retractionScopeOf:()=>rp,retractionWireFact:()=>Xc,rowBackendProblems:()=>ea,rowProblems:()=>ol,saveNodeId:()=>KL,saveSyllogiseState:()=>GL,snapshotMemory:()=>FL,sqliteSeedFactTermValues:()=>hL,stableRecordIds:()=>Zc,wrapRowBackend:()=>Up,wrapRowBackendOverSqliteSeed:()=>sL});function fs(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:VN.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function aa(e,t=null){if(xl(e))throw new Error("resolveMemoryGraphFile: dir is a store handle, not a file path (Backend A only)");return t===null?ne(e,Np):ne(e,ti,`graph.v${t}.json`)}function sr(e){return!!e&&typeof e=="object"&&e.backend===Fp}function gs(e){return!!e&&typeof e=="object"&&e.backend===Dp}function Pn(e){return!!e&&typeof e=="object"&&e.backend===H$}function xl(e){return sr(e)||gs(e)||Pn(e)}function ua(){return{backend:Fp,payload:fs()}}function q$(e,t){t&&(e.payload={...e.payload,...t})}function zp(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function Y$(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=Zp(Rn(t));if(n)return n}return{id:Bs,type:""}}function Bt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function HN(e,t){return`${e}@${X$(t).id}`}function X$(e){return Zp(Rn(e))||{id:Bs,type:""}}function J$(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=X$(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(Bs,{sourceId:Bs,sourceType:"",tags:[]}),[...t.values()]}function yl(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=Rn(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function fa(e,t="",n=Math.max){return yl(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function qN(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function Q$(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=Y$(n("mgx:factProvenance")),o=n(da).split(" ").filter(Boolean)[0]||null,r=qi(e.id);return[e.id,Bt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(tr)||s.id,r||s.type,Number(n(r?Xr:Ar))||0,n(ut),n(ca)||null,o,t]}function YN(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(et))return;let t=e.prepare(Z$);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(et))t.run(...Q$(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function XN(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function tv(e,t){return e&&t&&(e[ev]=t),e}function QN(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function sv(e,t,n,s){let o=e.prepare(JN),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Us();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=XN(cm(a,c,t).assertions),u=Hg(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function ZN(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(et))return;let n=Nl(Sl(e));t.exec("BEGIN IMMEDIATE");try{sv(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function eL(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=Us();for(let i of n){let[a,c]=i.split("\0");if(Bc(c)!==Vi)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(f=>{let m=cm(f,t.groups.get(f),t);return m.trust=tc(m.assertions).score,m});if(new Set(u.map(f=>f.object)).size<2)continue;let d=qf(u,Vi)?.winner?.id;if(!d)continue;let p=s.get(a,c);p?.to_id!==d&&o.run(a,c,(p?.ord??-1)+1,p?.to_id||"",d,r)}}function tL(e,{subject:t,predicate:n}={}){if(!gs(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function rv(){if(z$)return;z$=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function Bp(e){rv();let{DatabaseSync:t}=await Promise.resolve().then(()=>($p(),yp)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(KN),YN(n);let s=LL({backend:Dp,db:n,dbPath:e});return ZN(s),s}function jl(e){gs(e)&&e.db.close()}async function nL(e){rv();let{DatabaseSync:t}=await Promise.resolve().then(()=>($p(),yp));try{return{backend:Dp,db:new t(e,{readOnly:!0}),dbPath:e,readOnly:!0}}catch(n){throw new Xo(`could not open the seed store ${e} read-only: ${n.message}`,{cause:n})}}function Up(e,{basePayload:t=null,sqliteSeedStore:n=null,sqliteSeedOverlayRows:s=null,onOversizedRow:o="throw",copyOnRead:r=!0,log:i=void 0}={}){let a=ea(e);if(a.length)throw new On(`not a memory row backend: ${a.join("; ")}`);if(n&&!gs(n))throw new On("sqliteSeedStore must be an open sqlite store handle (openSqliteSeedStore)");if(n&&t)throw new On("a handle takes its seed either as a basePayload or as a sqliteSeedStore, never both");return{backend:H$,impl:e,cachedPayload:null,basePayload:zp(t),sqliteSeedStore:n,sqliteSeedOverlayRows:s?[...s]:null,sqliteSeedKeyOrds:null,baseRows:null,storedRows:null,onOversizedRow:o,copyOnRead:r,log:i}}function sL(e,t,{overlayRows:n=null,onOversizedRow:s="throw",copyOnRead:o=!0,log:r=void 0}={}){return Up(e,{sqliteSeedStore:t,sqliteSeedOverlayRows:n,onOversizedRow:s,copyOnRead:o,log:r})}async function oL(e){let t=await e;if(Array.isArray(t))return t;let n=[];for await(let s of t)n.push(s);return n}function _p(e,t){let n=new Map;for(let s of e)n.set(s.rowKey,s);for(let s of t)n.set(s.rowKey,s);return[...n.values()]}function rL(e){let t=new Set(e.storedRows.map(o=>o.rowKey)),n=e.sqliteSeedStore?dv(e).keys():e.baseRows.map(o=>o.rowKey),s=new Set;for(let o of n)t.has(o)||s.add(o);return s}async function $l(e,t,n){let s=await e.impl.readMeta(t);if(s==null)return n;try{return JSON.parse(s)}catch{return n}}async function Wp(e){if(!e.cachedPayload){let t=fs(),n=await oL(e.impl.readRows());e.storedRows=n.filter(o=>o?.rowClass!==Zi);let s={memory:await $l(e,iv,U$(e,"memory",t.memory)),prefixes:await $l(e,av,U$(e,"prefixes",t.prefixes))};e.sqliteSeedStore?e.cachedPayload=er(fv(e,s)):(e.baseRows=gp(e.basePayload||t,{onOversizedRow:"keep"}),e.cachedPayload=er(rl(_p(e.baseRows,e.storedRows),{meta:s})))}return e.cachedPayload}async function iL(e){let t=await Wp(e);return e.copyOnRead===!1?t:Nn(t)}function aL(e){return{...e,individuals:(e.individuals||[]).map(t=>({...t})),objectProperties:(e.objectProperties||[]).map(t=>({...t,examples:[...t.examples||[]]}))}}function uv(e){Pn(e)&&(e.cachedPayload=null,e.storedRows=null,e.baseRows=null)}function B$(e){let t;try{t=JSON.parse(e)}catch{return e}let n=t?.individual;return Array.isArray(n?.attributes)?JSON.stringify({...t,individual:{...n,attributes:n.attributes.filter(s=>s?.prop!==ks)}}):e}function cL(e,t){return e?B$(e.json)!==B$(t.json):!0}async function lL(e,t){await Wp(e);let n=rL(e),s=e.sqliteSeedStore?e.storedRows:_p(e.baseRows,e.storedRows),o=new Map(s.map(f=>[f.rowKey,f])),r=gp(e.sqliteSeedStore?uL(t,n):t,{priorRows:e.sqliteSeedStore?fL(e):s,onOversizedRow:e.onOversizedRow,...e.log?{log:e.log}:{}}),{puts:i,deletes:a}=bp(s,r),c=i.filter(f=>!n.has(f.rowKey)).filter(f=>cL(o.get(f.rowKey),f)),l=a.filter(f=>!n.has(f));try{c.length&&await e.impl.putRows(c),l.length&&await e.impl.deleteRows(l),await e.impl.putMeta(iv,JSON.stringify(t.memory??fs().memory)),await e.impl.putMeta(av,JSON.stringify(t.prefixes??fs().prefixes))}catch(f){throw uv(e),f}let u=new Set(l),d=new Map(e.storedRows.filter(f=>!u.has(f.rowKey)).map(f=>[f.rowKey,f]));for(let f of c)d.set(f.rowKey,f);e.storedRows=[...d.values()];let p={memory:t.memory,prefixes:t.prefixes};e.sqliteSeedStore&&!l.length?mL(e.cachedPayload,p,c):e.sqliteSeedStore?(e.cachedPayload=null,e.cachedPayload=er(fv(e,p))):(e.cachedPayload=null,e.cachedPayload=er(rl(_p(e.baseRows,e.storedRows),{meta:p})))}function uL(e,t){return t.size?{...e,individuals:(e?.individuals||[]).filter(n=>!t.has(String(n?.id??""))),objectProperties:(e?.objectProperties||[]).filter(n=>!t.has(`${go}${n?.prop}`))}:e}function vl(e){return typeof e.iterate=="function"?e.iterate():e.all()}function*dL(e,t){let n=e.db.prepare("SELECT i.id AS id, i.ord AS ord, i.class AS class, i.json AS json, f.subject AS subject FROM individuals i LEFT JOIN facts f ON f.id = i.id ORDER BY i.ord, i.id");for(let o of vl(n)){if(t(o.id))continue;let r=Vp.get(o.class)||"";yield{rowKey:o.id,rowClass:r,term:r==="fact"?V(o.subject||""):"",json:Hp(o.ord,o.json)}}let s=e.db.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid");for(let o of e.db.prepare("SELECT prop, ord, predicate, count FROM relations ORDER BY ord, prop").all()){if(t(`${go}${o.prop}`))continue;let r=[];for(let i of s.all(o.prop)){let a={subject:i.subject,object:i.object,subjectLabel:i.subject_label,objectLabel:i.object_label};i.extra&&Object.assign(a,JSON.parse(i.extra)),r.push(a)}yield kl({predicate:o.predicate,prop:o.prop,count:o.count,examples:r},o.ord)}for(let o of Yp(e.db))t(o.rowKey)||(yield o)}function dv(e){if(e.sqliteSeedKeyOrds)return e.sqliteSeedKeyOrds;let t=e.sqliteSeedStore.db,n=new Map;for(let s of vl(t.prepare("SELECT id, ord FROM individuals")))n.set(s.id,s.ord);for(let s of vl(t.prepare("SELECT prop, ord FROM relations")))n.set(`${go}${s.prop}`,s.ord);for(let s of Yp(t))n.set(s.rowKey,Tp(s));for(let s of e.sqliteSeedOverlayRows||[])n.set(s.rowKey,Tp(s));return e.sqliteSeedKeyOrds=n,n}function*fL(e){for(let[t,n]of dv(e))yield{rowKey:t,json:`{"ord":${n}}`};yield*e.storedRows}function*pL(...e){for(let t of e)yield*t}function fv(e,t){let n=new Set(e.storedRows.map(o=>o.rowKey)),s=(e.sqliteSeedOverlayRows||[]).filter(o=>o?.rowKey&&!n.has(o.rowKey));for(let o of s)n.add(o.rowKey);return rl(pL(dL(e.sqliteSeedStore,o=>n.has(o)),s,e.storedRows),{meta:t})}function mL(e,t,n){if(e.memory=t.memory,e.prefixes=t.prefixes,!n.length)return il(e);let s=new Map;for(let r=0;r<e.individuals.length;r+=1)s.set(e.individuals[r]?.id,r);let o=new Map;for(let r=0;r<e.objectProperties.length;r+=1)o.set(e.objectProperties[r]?.prop,r);for(let r of n){if(r.rowClass===Zi)continue;let i=JSON.parse(r.json);if(r.rowClass===nr){let l=i?.group;if(!l?.prop)continue;let u=o.get(l.prop);u===void 0?(o.set(l.prop,e.objectProperties.length),e.objectProperties.push(l)):e.objectProperties[u]=l;continue}let a=i?.individual;if(!a?.id)continue;let c=s.get(a.id);c===void 0?(s.set(a.id,e.individuals.length),e.individuals.push(a)):e.individuals[c]=a}return il(e)}function*hL(e){for(let t of["subject","object"])for(let n of vl(e.db.prepare(`SELECT DISTINCT ${t} AS value FROM facts`)))n.value&&(yield n.value)}function U$(e,t,n){if(!e.sqliteSeedStore)return e.basePayload?.[t]??n;let s=e.sqliteSeedStore.db.prepare("SELECT v FROM meta WHERE k = ?").get(t);if(!s)return n;try{return JSON.parse(s.v)}catch{return n}}async function Gp(e,t){if(Pn(t))return{dir:t,close:async()=>{await t.impl.close()}};if(sl(t)){let r=Up(t);return{dir:r,close:async()=>{await r.impl.close()}}}if(t===Fp)return{dir:ua(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>Ju(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,Np))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
- `),await Xn($e(n),{recursive:!0});let o=await Bp(n);return{dir:o,close:async()=>jl(o)}}async function gL(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await Ju(n)}catch{return null}return Gp(e,t)}async function bL(e){if(!e)return null;let t=ua();return q$(t,zp(await mt(e))),t}async function yo(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(ia(),jp));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return Gp(e,n)}function wL(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=Sl(e),e.cachedFactHeads=QN(e.db),e.cachedDataVersion=t),tv(Nn(e.cachedPayload),e.cachedFactHeads)}function Sl(e){let t=e.db,n=fs(),s=(r,i)=>{let a=t.prepare("SELECT v FROM meta WHERE k = ?").get(r);return a?JSON.parse(a.v):i},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(r=>JSON.parse(r.json));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:mv(t).map(r=>r.group),individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function yL(e,t){let n=Nn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function $L(e,t){e.individuals=e.individuals.filter(n=>!t.has(n?.id))}function vL(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function SL(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Nn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function EL(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function xL(e,t){e.objectProperties=e.objectProperties.filter(n=>!t.has(n?.prop))}function Tp(e){let t=kL.exec(e?.json||"");if(t)return Number(t[1]);try{let n=Number(JSON.parse(e.json).ord);return Number.isFinite(n)?n:0}catch{return 0}}function pv(e,t,n){let s=Vp.get(e?.class)||"";return{rowKey:String(e.id),rowClass:s,term:s==="fact"?V(hs(e,"subject")):"",json:Hp(t,n)}}function RL(e){let t={subject:e.subject,object:e.object,subjectLabel:e.subjectLabel??null,objectLabel:e.objectLabel??null};for(let n of Object.keys(e))ov.has(n)||(t[n]=e[n]);return t}function kl(e,t){let n=(e.examples||[]).map(RL);return{rowKey:`${go}${e.prop}`,rowClass:nr,term:"",json:JSON.stringify({ord:t,group:{predicate:e.predicate??null,prop:e.prop,count:Number.isFinite(e.count)?e.count:n.length,examples:n}})}}function mv(e){let t=new Map;for(let n of e.prepare("SELECT prop, ord, predicate, count FROM relations ORDER BY ord, prop").all())t.set(n.prop,{ord:n.ord,group:{predicate:n.predicate,prop:n.prop,count:n.count,examples:[]}});if(!t.size)return[];for(let n of e.prepare("SELECT prop, subject, object, subject_label, object_label, extra FROM edges ORDER BY rowid").all()){let s=t.get(n.prop);if(!s)continue;let o={subject:n.subject,object:n.object,subjectLabel:n.subject_label,objectLabel:n.object_label};n.extra&&Object.assign(o,JSON.parse(n.extra)),s.group.examples.push(o)}return[...t.values()]}function hv(e){let t=[],n=e.db.prepare("SELECT i.id AS id, i.ord AS ord, i.class AS class, i.json AS json, f.subject AS subject FROM individuals i LEFT JOIN facts f ON f.id = i.id ORDER BY i.ord, i.id").all();for(let s of n){let o=Vp.get(s.class)||"";t.push({rowKey:s.id,rowClass:o,term:o==="fact"?V(s.subject||""):"",json:Hp(s.ord,s.json)})}for(let s of mv(e.db))t.push(kl(s.group,s.ord));return t}function _L(e,t){let n=new Map,s=0,o=0;for(let a of t){let c=Tp(a);n.set(a.rowKey,c),a.rowClass===nr?c>=o&&(o=c+1):c>=s&&(s=c+1)}let r=[],i=new Map;for(let a of e.individuals||[]){if(!a?.id)continue;let c=JSON.stringify(a),l=String(a.id),u=n.get(l)??s++;r.push(pv(a,u,c)),i.set(l,{kind:"individual",ord:u,individual:a,json:c})}for(let a of e.objectProperties||[]){if(!a?.prop)continue;let c=`${go}${a.prop}`,l=n.get(c)??o++,u=kl(a,l);r.push(u),i.set(c,{kind:nr,ord:l,group:JSON.parse(u.json).group})}return{rows:r,partsByKey:i}}function TL(e){if(e.expiresAt!==void 0)return null;let t;try{t=JSON.parse(e.json)}catch{return null}if(!t||typeof t!="object"||!Number.isFinite(t.ord))return null;if(e.rowClass===nr){let r=t.group;if(!r?.prop)return null;let i=kl(r,t.ord);return i.rowKey!==e.rowKey||i.term!==e.term||i.json!==e.json?null:{kind:nr,ord:t.ord,group:r}}let n=t.individual;if(!n?.id)return null;let s=JSON.stringify(n),o=pv(n,t.ord,s);return o.rowKey!==e.rowKey||o.rowClass!==e.rowClass||o.term!==e.term||o.json!==e.json?null:{kind:"individual",ord:t.ord,individual:n,json:s}}function gv(e,{cache:t=null}={}){let n=e.db;return{db:n,cache:t,touchedGroups:new Set,touchedPairs:new Set,hasUnmappedRows:!!n.prepare(Kp).get(bo),unmapped:null,upsertInd:n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),upsertFact:n.prepare(Z$),deleteInd:n.prepare("DELETE FROM individuals WHERE id = ?"),deleteFact:n.prepare("DELETE FROM facts WHERE id = ?"),getFact:n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?"),upsertRel:n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),edgesForProp:n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),upsertEdge:n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),deleteEdge:n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),deleteGroupEdges:n.prepare("DELETE FROM edges WHERE prop = ?"),deleteRel:n.prepare("DELETE FROM relations WHERE prop = ?")}}function bv(e){return e.unmapped||(e.db.exec(jL),e.hasUnmappedRows=!0,e.unmapped={upsert:e.db.prepare(`INSERT OR REPLACE INTO ${bo}(row_key, row_class, term, json, expires_at) VALUES (?, ?, ?, ?, ?)`),remove:e.db.prepare(`DELETE FROM ${bo} WHERE row_key = ?`)}),e.unmapped}function qp(e,t){e.hasUnmappedRows&&bv(e).remove.run(t)}function AL(e,{ord:t,individual:n,json:s}){e.upsertInd.run(n.id,t,n.class??null,n.label??null,s),n.class===et&&(e.upsertFact.run(...Q$(n,s)),e.touchedGroups.add(Bt(n.id)),e.touchedPairs.add(la(hs(n,"subject"),hs(n,"predicate")))),qp(e,String(n.id)),e.cache&&yL(e.cache,n)}function CL(e,{ord:t,group:n}){let s=new Map(e.edgesForProp.all(n.prop).map(a=>[`${a.subject}\0${a.object}`,a])),o=new Set,r=e.cache?vL(e.cache,n.prop):null;for(let a of n.examples||[]){let c=`${a.subject}\0${a.object}`;o.add(c);let l=Object.keys(a).filter(f=>!ov.has(f)),u=l.length?JSON.stringify(Object.fromEntries(l.map(f=>[f,a[f]]))):null,d=s.get(c);d&&(d.subject_label??null)===(a.subjectLabel??null)&&(d.object_label??null)===(a.objectLabel??null)&&(d.extra??null)===(u??null)||(e.upsertEdge.run(n.prop,a.subject,a.object,a.subjectLabel??null,a.objectLabel??null,u),r&&SL(r,a,l))}for(let a of s.keys()){if(o.has(a))continue;let[c,l]=a.split("\0");e.deleteEdge.run(n.prop,c,l)}r&&EL(r,o);let i=Number.isFinite(n.count)?n.count:(n.examples||[]).length;e.upsertRel.run(n.prop,t,n.predicate??null,i),qp(e,`${go}${n.prop}`),r&&(r.predicate=n.predicate??null,r.count=i)}function IL(e,t){bv(e).upsert.run(t.rowKey,t.rowClass,t.term,t.json,t.expiresAt??null)}function wv(e,t,n=null){for(let s of t){let o=n?.get(s.rowKey)||TL(s);if(!o){IL(e,s);continue}o.kind===nr?CL(e,o):AL(e,o)}}function yv(e,t){let n=new Set,s=new Set;for(let o of t){if(o.startsWith(go)){let r=o.slice(go.length);e.deleteGroupEdges.run(r),e.deleteRel.run(r),s.add(r)}else{let r=e.getFact.get(o);r&&(e.touchedGroups.add(r.triple_hash),e.touchedPairs.add(la(r.subject,r.predicate))),e.deleteInd.run(o),e.deleteFact.run(o),n.add(o)}qp(e,o)}e.cache&&n.size&&$L(e.cache,n),e.cache&&s.size&&xL(e.cache,s)}function Ap(e,t,n){if(!e.touchedGroups.size)return;let s=Nl(t);sv(e.db,s,e.touchedGroups,n),eL(e.db,s,e.touchedPairs)}function OL(e,t){let n=e.db,s=fs(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Nn(t.generated_at??s.generated_at),o.memory=Nn(t.memory??s.memory),o.prefixes=Nn(t.prefixes??s.prefixes),o.vocabulary=Nn(t.vocabulary??s.vocabulary),o.classes=Nn(t.classes??s.classes),o.proseIndex=Nn(t.proseIndex??s.proseIndex));let i=gv(e,{cache:o}),a=hv(e),{rows:c,partsByKey:l}=_L(t,a),{puts:u,deletes:d}=bp(a,c);wv(i,u,l),yv(i,d),Ap(i,t,e.cachedFactHeads),n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}function Yp(e){if(!e.prepare(Kp).get(bo))return[];let t=Math.floor(Date.now()/1e3),n=[];for(let s of e.prepare(`SELECT row_key, row_class, term, json, expires_at FROM ${bo}`).all()){if(s.expires_at!==null&&s.expires_at<=t)continue;let o={rowKey:s.row_key,rowClass:s.row_class,term:s.term,json:s.json};s.expires_at!==null&&(o.expiresAt=s.expires_at),n.push(o)}return n}function W$(e,t){let n=e.db;n.exec("BEGIN IMMEDIATE");try{t(gv(e)),n.exec("COMMIT")}catch(s){throw n.exec("ROLLBACK"),s}finally{e.cachedPayload=null,e.cachedFactHeads=null}}function LL(e){return Object.assign(e,{async readRows(){return[...hv(e),...Yp(e.db)]},async readRowsByTerm(t){return(await e.readRows()).filter(n=>n.term===t)},async putRows(t){let n=(t||[]).map(s=>ta(s));n.length&&W$(e,s=>{wv(s,n),Ap(s,Sl(e),null)})},async deleteRows(t){let n=[...t||[]];n.length&&W$(e,s=>{yv(s,n),Ap(s,Sl(e),null)})},async readMeta(t){let n=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(t);return n?n.v:null},async putMeta(t,n){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(t,String(n)),e.cachedPayload=null,e.cachedFactHeads=null},async deleteAll(){let t=e.db;t.exec("BEGIN IMMEDIATE");try{for(let n of NL)t.exec(`DELETE FROM ${n}`);t.prepare(Kp).get(bo)&&t.exec(`DELETE FROM ${bo}`),t.exec("COMMIT")}catch(n){throw t.exec("ROLLBACK"),n}finally{e.cachedPayload=null,e.cachedFactHeads=null}},async close(){jl(e)}})}function PL(e){let t=null,n=!1,s=()=>{if(n)throw new Xo("this row backend was closed and can no longer be used");return t=t||Bp(e),t},o=r=>async(...i)=>(await s())[r](...i);return{kind:Qr,contractVersion:1,readRows:o("readRows"),readRowsByTerm:o("readRowsByTerm"),putRows:o("putRows"),deleteRows:o("deleteRows"),readMeta:o("readMeta"),putMeta:o("putMeta"),deleteAll:o("deleteAll"),async close(){let r=t?await t:null;n=!0,r&&jl(r)}}}async function $v(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await Er(n,t),await Wa(n,e)}async function Rl(e,t){await $v(e,JSON.stringify(t))}async function FL(e,{retentionVersions:t}={}){if(xl(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a store handle has no on-disk graph.json to snapshot");let n=aa(e),s;try{s=await Ie(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=ML(e),r;try{r=JSON.parse(await Ie(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??Cp}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??Cp);let i=r.version,a=aa(e,i);await Xn($e(a),{recursive:!0}),await $v(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await Qu(aa(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Rl(o,r),{skipped:!1,version:i,prunedVersion:c}}async function mt(e){if(sr(e))return er(e.payload);if(gs(e))return er(wL(e));if(Pn(e))return iL(e);let t;try{t=await Ie(Rp(e),"utf8")}catch(n){if(n?.code==="ENOENT")return fs();throw n}return er(JSON.parse(t))}function zL(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==et||!DL.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Go(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function BL(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===Sn),n=new Map;for(let c of t?.examples||[]){if(!c?.subject)continue;let l=n.get(c.subject);l?l.push(c):n.set(c.subject,[c])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let c of e.individuals){if(c?.class!==et||String(c.id||"").includes("@")){a.push(c);continue}let l=w=>(c.attributes||[]).find(E=>E?.prop===w)?.value||"",u=l("rdf:subject"),d=l("rdf:predicate"),p=l("rdf:object");if(!u||!d||!p){a.push(c);continue}let f=Go(u,d,p),m=l(ut),h=l("mgx:factProvenance"),b=n.get(c.id)||[],g=h?J$(h):[];for(let w of b)g.some(E=>E.sourceId===w.object)||g.push({sourceId:w.object,sourceType:"",tags:[]});g.length||g.push({sourceId:Bs,sourceType:"",tags:[]});let y=[];for(let w of g){let E={id:`${f}@${w.sourceId}`,label:c.label,class:et,derived_from:Nn(c.derived_from)||[],mentions:Nn(c.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:p},{prop:ut,key:"createdAt",value:fa(w.tags,m,Math.min)||m||Us()},{prop:tr,key:"sourceId",value:w.sourceId},...w.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:w.tags.join(" | ")}]:[],...l("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:l("mgx:hasProseTokens")}]:[],...l("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:l("mgx:factQuantifier")}]:[],...w.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(E),r.push(E),y.push(E.id),w.sourceId!==Bs){let R=b.find(v=>v?.object===w.sourceId);i.push({...R||{},subject:E.id,object:w.sourceId,subjectLabel:E.label,objectLabel:em(w.sourceId)})}}s.add(c.id),o.set(c.id,y)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(c=>!s.has(c?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:Sn,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===Sn||!c?.examples?.length)continue;let l=[];for(let u of c.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],p=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let f of d)for(let m of p)l.push({...u,subject:f,object:m})}c.examples=l,c.count=l.length}e.individuals=a,xv(e);for(let c of r)ei(e,c);return bs(e),e}async function UL(e,t){if(sr(e)){e.payload=t;return}if(gs(e)){OL(e,t);return}if(Pn(e)){await lL(e,t);return}await Xn($e(Rp(e)),{recursive:!0}),await Rl(Rp(e),t)}async function WL(e){if(sr(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(gs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Sv);return t?.v?JSON.parse(t.v):null}if(Pn(e))return $l(e,cv,null);try{return JSON.parse(await Ie(ne(e,Xp),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function GL(e,t){if(sr(e)){e.syllogiseState=structuredClone(t);return}if(gs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Sv,JSON.stringify(t));return}if(Pn(e)){await e.impl.putMeta(cv,JSON.stringify(t));return}let n=ne(e,Xp);await Xn($e(n),{recursive:!0}),await Rl(n,t)}async function VL(e){if(sr(e))return e.nodeId||null;if(gs(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Ev);return t?.v&&JSON.parse(t.v).nodeId||null}if(Pn(e))return(await $l(e,lv,null))?.nodeId||null;try{return JSON.parse(await Ie(ne(e,Jp),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function KL(e,t){if(sr(e)){e.nodeId=t;return}if(gs(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Ev,JSON.stringify({nodeId:t}));return}if(Pn(e)){await e.impl.putMeta(lv,JSON.stringify({nodeId:t}));return}let n=ne(e,Jp);await Xn($e(n),{recursive:!0}),await Rl(n,{nodeId:t})}function xv(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===us&&n.set(a.id,a),a.class===Yt&&Op(r,a),a.class===et)){let c=Bt(a.id),l=o.get(c);l?l.push(a.id):o.set(c,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===Sn);for(let a of i?.examples||[]){if(!a?.subject)continue;let c=s.get(a.subject);c?c.push(a.object):s.set(a.subject,[a.object])}return e[Ip]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[Ip]}function Op(e,t){let n=Bt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function HL(e,t){let n=Ut(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===Yt&&Bt(s.id)===t)}async function Gs(e,t){let n=Pn(e),s=n?aL(await Wp(e)):await mt(e);try{xv(s);let o=await t(s)??s;return QL(o),e0(o),n||(o.proseIndex=Qa(o.individuals)),await UL(e,o),n?e.cachedPayload:o}catch(o){throw uv(e),o}}function Qp(e,t){return e?.attributes?.find(n=>n?.prop===ut)?.value||t||Us()}function Ln(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function Zp(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${gl}:${e.sessionId}`:gl,type:"operator"};case"teach":return{id:e.sessionId?`${kp}:${e.sessionId}`:kp,type:"teach"};case"teachNode":return{id:`${K$}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${Ui(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function qL(e){return ud[e]||null}function YL(e,t,n){let s=Zp(t);if(!s)return null;let o=Ut(e),r=o?o.individualsById.get(s.id):e.individuals.find(l=>l?.id===s.id),i=Qp(r,t?.createdAt||n),a={id:s.id,label:em(s.id),class:us,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:ut,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},c=Ws(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Tl(e){let t=Ut(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===us&&(n[s.id]=s);return n}function jv(e,t){let n=Ut(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===Sn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function XL(e,t,n=Date.now(),s={}){let o=jv(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===ut)?.value||"",{score:i,inputs:a}=Kg({sourceIds:o,createdAt:r},Tl(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});Ln(t,Ar,"trustScore",String(i)),Ln(t,Za,"trustInputs",JSON.stringify(a)),Ln(t,ks,"updatedAt",new Date(n).toISOString())}function JL(e,t,n=Date.now(),s={}){let[o]=jv(e,t.id),r=o?Tl(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=ec(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let l=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*l))}let c=(t.attributes||[]).find(l=>l?.prop===ut)?.value||"";Ln(t,Ar,"trustScore",String(a)),Ln(t,Za,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),Ln(t,ks,"updatedAt",new Date(n).toISOString())}function kv(e,t,n,s){t?.class===et?JL(e,t,n,s):XL(e,t,n,s)}function ei(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===ut)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=Rn(i);if(!a)continue;let c=YL(e,a,r);c&&El(e,{predicate:"statedBy",prop:Sn},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:em(c)})}kv(e,t,n,s)}function QL(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===Sn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==et||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(ei(e,r,o),s=!0);s&&bs(e)}function ZL(e){let t=Ut(e);if(t){let i=!1;for(let a of t.sourcesById.keys())if(hl(a)){i=!0;break}if(!i)return null}let n=e.objectProperties.find(i=>i?.prop===Sn),s=new Set;for(let i of n?.examples||[])hl(i?.object)&&s.add(i.subject);let o=new Set,r=new Set;for(let i of e.individuals){if(i?.class!==et||!(s.has(i.id)||zs(i.id)&&Yi(i).some(hl)))continue;o.add(Bt(i.id));let c=hs(i,"subject");c&&r.add(la(c,hs(i,"predicate")))}return o.size?{pairs:r,scopedGroups:o}:null}function e0(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=ZL(e);if(!t)return;let n=Pv(e,Nl(e,t)),s=new Set;for(let c of Fv(e,{factRows:n}))for(let l of c)s.add(l.id);let o=new Map;for(let c of n)for(let l of c.sourceIds){if(!hl(l))continue;let u=o.get(l)||{factsAsserted:0,factsContradicted:0};u.factsAsserted+=1,s.has(c.id)&&(u.factsContradicted+=1),o.set(l,u)}if(!o.size)return;let r=Ut(e);for(let[c,l]of o){let u=r?r.individualsById.get(c):e.individuals.find(d=>d?.id===c);u&&(Ln(u,V$,"sourceReliability",String(qg(l))),Ln(u,ks,"updatedAt",new Date().toISOString()))}let i=e.objectProperties.find(c=>c?.prop===Sn),a=new Set;for(let c of i?.examples||[])o.has(c?.object)&&a.add(c.subject);for(let c of a){let l=r?r.individualsById.get(c):e.individuals.find(u=>u?.id===c);l&&kv(e,l)}}function t0(e,t,n){if(!Gc(n?.id))return n;let s=qi(n.id);if(!s)return ep(t,n);let o=Tl(e);return ep(t,n,{priorFor:r=>ec(s,o[r])})}function G$(e,t,n){return n?.class===Yt?y$(t,n):t0(e,t,n)}function Ws(e,t){let n=Ut(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,G$(e,o,t)),o.class===Yt&&Op(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===Yt&&Op(n.retractionsByGroup,t),t.class===et){let r=Bt(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=G$(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function El(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(c=>c?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===Sn?Ut(e):null;if(r){let c=r.statedByBySubject.get(s.subject);if(!c||!c.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||Us()}),o.count=o.examples.length,c?c.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(c=>c?.subject===s.subject&&c?.object===s.object)?.createdAt||s.createdAt||Us();if(o.examples=(o.examples||[]).filter(c=>!(c?.subject===s.subject&&c?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let c=r.statedByBySubject.get(s.subject)||[];c.includes(s.object)||c.push(s.object),r.statedByBySubject.set(s.subject,c)}}function bs(e){let t=[Jo,ho,et,us,ds];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function n0(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:Jo,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:ut,key:"createdAt",value:n||Us()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Rv(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!GN.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let l=String(s||""),u=os(n),d=`utt:${o}#${l}#${t}`,p=_l(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),f=Ja({doc:u}),m=e.individuals.find(y=>y?.id===d),h=Qp(m,c||l),b={id:d,label:p,class:ho,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:l},{prop:ut,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...f.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:f.join(" ")}]:[]]};Ws(e,b);let g=n0(e,o,r);if(El(e,{predicate:"saidInSession",prop:Lp},{subject:d,object:g,subjectLabel:p,objectLabel:String(o).slice(0,8)}),a){let y=e.individuals.find(w=>w?.id===a);y&&El(e,{predicate:"inReplyTo",prop:Pp},{subject:d,object:a,subjectLabel:p,objectLabel:y.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function s0(e,t){let n;return await Gs(e,s=>{n=Rv(s,t),bs(s)}),{id:n}}async function _v(e,t){let n=[];return t?.length?(await Gs(e,s=>{for(let o of t)n.push(Rv(s,o));bs(s)}),{ids:n}):{ids:n}}async function o0(e,t){t?.length&&await Gs(e,n=>{for(let s of t)for(let o of or(n,s.factId))El(n,{predicate:"canonicalisedFrom",prop:Mp},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function or(e,t){let n=Ut(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===et&&Bt(s.id)===t).map(s=>s.id)}function Tv(e,t,n,s=""){let o=J$(n);if(o.length===1&&o[0].sourceId===Bs&&or(e,t).length)return[];let r=HL(e,t);if(r.length&&(o=o.filter(a=>!Yc(r,`${t}@${a.sourceId}`,fa(a.tags,s))),!o.length))return o;let i=r0(e,t);return i.length?o.filter(a=>!h$(i,a.sourceId)):o}function r0(e,t){let n=Ut(e),s=n?n.factRecordsByGroup.get(t):or(e,t),o=[];for(let r of s||[]){if(!zs(r))continue;let i=wo(e,r);i&&o.push(i)}return o}function Av(e,t,{quantifier:n,environments:s}){let o=or(e,t).map(i=>wo(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===da)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(c=>c?.prop==="mgx:factJustification"));for(let a of i.length?i:o)Ln(a,"mgx:factJustification","justification",s.map(c=>c.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(Ln(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function i0(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===bl)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function tm(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let s=os(n);s&&t.add(s)}return[...t].sort()}function Cv(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:c,createdAt:l,observedAt:u,quantifier:d,environments:p,extraction:f=[]}=t,m=`${n}@${c.sourceId}`,h=Ut(e),b=h?h.individualsById.get(m):e.individuals.find(_=>_?.id===m),g=_=>(b?.attributes||[]).find(C=>C?.prop===_)?.value||"",y=g("mgx:factProvenance").split(" | ").filter(Boolean),w={assertedAt:yl(c.tags),observedAt:u},E=null,R=c.tags,v=w.assertedAt||l||Us(),k=u,I=[],x=d,T=f;if(b){let _={assertedAt:yl(y),observedAt:g(ca)};qN(w,_)?(E={head:b,id:`${m}#v${i0(b)}`},I=[E.id]):(R=[...new Set([...y,...c.tags])],v=g(ut)||v,k=u||g(ca),I=g(bl).split(" ").filter(Boolean),T=tm([...g(wl).split(" "),...f])),x=d||g("mgx:factQuantifier")}return{candidate:{id:m,label:i,class:et,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:ut,key:"createdAt",value:v},{prop:tr,key:"sourceId",value:c.sourceId},...R.length?[{prop:"mgx:factProvenance",key:"provenance",value:R.join(" | ")}]:[],...k?[{prop:ca,key:"observedAt",value:k}]:[],...T.length?[{prop:wl,key:"extraction",value:T.join(" ")}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...x?[{prop:"mgx:factQuantifier",key:"quantifier",value:x}]:[],...p?[{prop:"mgx:factJustification",key:"justification",value:p.map(_=>_.join(" ")).join(" | ")}]:[],...I.length?[{prop:bl,key:"supersedes",value:I.join(" ")}]:[]]},demote:E}}function a0(e,t){let n=`${t}@${Bs}`,s=Ut(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function Iv(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Bs}`)||a0(e,Bt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};Ln(o,da,"supersededBy",t.id),Ws(e,o),s.push(o.id)}return Ws(e,t),s.push(t.id),s}function wo(e,t){let n=Ut(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function nm(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Ut(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=Bt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Ov(e,t){let n=Ut(e),s=(n?n.factRecordsByGroup.get(t):or(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=wo(e,u);if(!d)continue;let p=y=>(d.attributes||[]).find(w=>w?.prop===y)?.value||"";if(zs(u)){i.set(qi(u),d);continue}if(Jr(u)){a.set(p(tr),d);continue}let f=p("mgx:factProvenance"),m=Y$(f),h=f.split(" | ").filter(Boolean),b={id:u,sourceId:p(tr)||m.id,assertedAt:fa(h,p(ut)),record:d};if(p(da)){let y=r.get(b.sourceId);y?y.push(b):r.set(b.sourceId,[b]);continue}if(!m.type)continue;let g=o.get(m.type);g?g.push(b):o.set(m.type,[b])}let c=Tl(e),l=[];for(let[u,d]of o){let p=p$({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:f=>ec(u,c[f])});if(p){Ws(e,p.rollup),l.push(...p.absorbed);for(let f of p.absorbedSourceIds){for(let h of r.get(f)||[])l.push(h.id);r.delete(f);let m=a.get(f);m&&l.push(m.id),a.delete(f)}}}for(let[u,d]of r){let p=m$({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!p)continue;Ws(e,p.rollup),l.push(...p.absorbed);let f=wo(e,p.rewire);f&&Ln(f,bl,"supersedes",p.rollup.id)}return l}async function c0(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",extraction:c,premiseTrusts:l,ruleConfidence:u}={}){let d=V(t),p=rs(n),f=V(s);if(!d||!p||!f)throw new Error("a fact needs subject, predicate and object");let m=Go(d,p,f),h=`${d} ${p} ${f}`,b=Ja({doc:h}),g=os(a),y=tm(c);return await Gs(e,async w=>{let E=Tv(w,m,os(o),r);for(let R of E.length?[]:Av(w,m,{quantifier:g}))ei(w,wo(w,R),void 0,{premiseTrusts:l,ruleConfidence:u});for(let R of E){let v=Cv(w,{groupId:m,s:d,p,o:f,label:_l(h),tokens:b,group:R,createdAt:r,observedAt:i,quantifier:g,extraction:y});await dp(v.candidate);for(let k of Iv(w,v))ei(w,wo(w,k),void 0,k===v.candidate.id?{premiseTrusts:l,ruleConfidence:u}:void 0)}nm(w,Ov(w,m)),bs(w)}),{id:m}}function l0(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function Kn(e,t){let n=[],s=0;for(let r of t||[]){let i=V(r?.subject),a=rs(r?.predicate),c=V(r?.object);if(!i||!a||!c){s+=1;continue}let l=`${i} ${a} ${c}`;n.push({id:Go(i,a,c),s:i,p:a,o:c,text:l,tokens:Ja({doc:l}),provenance:os(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:os(r?.quantifier),extraction:tm(r?.extraction),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:l0(r?.justification)})}let o=[];return n.length?(await Gs(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=Tv(r,u.id,u.provenance,u.createdAt);for(let p of d.length?[]:Av(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(p)||(a.add(p),i.push(p)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(p,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let p of d){let f=Cv(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:_l(u.text),tokens:u.tokens,group:p,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments,extraction:u.extraction});for(let m of Iv(r,f))a.has(m)||(a.add(m),i.push(m));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(f.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)ei(r,wo(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...Ov(r,u));nm(r,l),bs(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Il(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Nv[n];if(!i)throw new Error(`a rule kind must be one of ${u0.join(", ")}, got ${JSON.stringify(n)}`);let a=V(t);if(!a)throw new Error("a rule needs a name");let c=d0[n]||new Set,l=i.map(([f])=>V(s?.[f])),u=i.filter(([f],m)=>!c.has(f)&&!l[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([f])=>f).join(" + ")}`);if(n===ha){let f=l[i.findIndex(([h])=>h==="objectRole")],m=l[i.findIndex(([h])=>h==="value")];if(!f&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=f0(n,a,l),p=_l(`${a} = ${n}(${l.join(", ")})`);return await Gs(e,async f=>{let m=f.individuals.find(w=>w?.id===d),h=m?.attributes?.find(w=>w?.prop==="mgx:factProvenance")?.value||"",b=[...new Set([...h.split(" | "),os(o)].filter(Boolean))],g=Qp(m,r),y={id:d,label:p,class:ds,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Cl,key:"ruleName",value:a},{prop:ni,key:"ruleKind",value:n},...i.map(([w,E],R)=>({prop:E,key:w,value:l[R],skip:!l[R]&&c.has(w)})).filter(w=>!w.skip).map(({skip:w,...E})=>E),{prop:ut,key:"createdAt",value:g},...b.length?[{prop:"mgx:factProvenance",key:"provenance",value:b.join(" | ")}]:[]]};await dp(y),Ws(f,y),ei(f,f.individuals.find(w=>w?.id===d)),bs(f)}),{id:d}}function im(e,t){let n=V(t);return(e?.individuals||[]).find(s=>s?.class===ds&&(s.attributes||[]).find(o=>o?.prop===Cl)?.value===n)}function p0(e,t){let n=V(t),s=o=>(o.attributes||[]).find(r=>r?.prop===ni)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===ds&&(o.attributes||[]).find(r=>r?.prop===Cl)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Ol(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==ds)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(ni),r=Nv[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Cl)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function am(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:c,byTrust:l,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:p}=o,f=String(t||"").trim().toLowerCase(),m=c(V,n),h=c(V,s),b=r(f).filter(w=>m.has(w.fact.subject)&&h.has(w.fact.object));if(b.length){let w=b.slice().sort((E,R)=>l(E.fact,R.fact))[0];return{citation:[i(w.fact),...w.aliasFacts.map(E=>`${a(E)}${E.provenance?` (source: ${E.provenance})`:""}`)]}}let g=im(e,f),y=g?.attributes?.find(w=>w.prop===ni)?.value;if(g&&y===pa){let w=g.attributes.find(C=>C.prop==="mgx:ruleBase1")?.value,E=g.attributes.find(C=>C.prop==="mgx:ruleBase2")?.value,R=V(n),v=V(s);if(!w||!E||!R||!v)return null;let T=p({entity:R,hopsTaken:0},C=>C.hopsTaken===2&&C.entity===v,C=>{if(C.hopsTaken>=2)return[];let S=C.hopsTaken===0?w:E;return r(S).filter(j=>j.fact.subject===C.entity).map(j=>({action:j,nextState:{entity:j.fact.object,hopsTaken:C.hopsTaken+1}}))},{maxDepth:2,stateKey:C=>`${C.entity}#${C.hopsTaken}`});if(!T)return null;let $=new Set,_=[];for(let C of T.actions){_.push(i(C.fact));for(let S of C.aliasFacts){let j=S.id||`${S.subject}|${S.predicate}|${S.object}`;$.has(j)||($.add(j),_.push(`${a(S)}${S.provenance?` (source: ${S.provenance})`:""}`))}}return{citation:_}}if(g&&y===ma){let w=g.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,E=g.attributes.find(x=>x.prop==="mgx:ruleFilterProperty")?.value;if(!w||!E)return null;let R=await am(e,w,n,s,o);if(!R)return null;let v=V(n),k=V(E),I=u.find(x=>x.predicate===d&&x.subject===v&&V(x.object)===k);return I?{citation:[...R.citation,i(I)]}:null}return null}async function Lv(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:c,rows:l,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,p=String(t||"").trim().toLowerCase(),f=a(V,n),m=o(p).filter(g=>f.has(g.fact.object));if(m.length){let g=new Map;for(let y of m)g.has(y.fact.subject)||g.set(y.fact.subject,[]),g.get(y.fact.subject).push(y);return[...g.entries()].map(([y,w])=>{let E=w.slice().sort((R,v)=>c(R.fact,v.fact))[0];return{subject:y,citation:[r(E.fact),...E.aliasFacts.map(R=>`${i(R)}${R.provenance?` (source: ${R.provenance})`:""}`)]}})}let h=im(e,p),b=h?.attributes?.find(g=>g.prop===ni)?.value;if(h&&b===pa){let g=h.attributes.find(k=>k.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(k=>k.prop==="mgx:ruleBase2")?.value,w=V(n);return!g||!y||!w?[]:d({entity:w,hopsTaken:0},k=>{if(k.hopsTaken>=2)return[];let I=k.hopsTaken===0?y:g;return o(I).filter(x=>x.fact.object===k.entity).map(x=>({action:x,nextState:{entity:x.fact.subject,hopsTaken:k.hopsTaken+1}}))},{maxDepth:2,stateKey:k=>`${k.entity}#${k.hopsTaken}`}).filter(k=>k.node.hopsTaken===2).map(({node:k,path:I})=>{let x=new Set,T=[];for(let $ of I.actions.slice().reverse()){T.push(r($.fact));for(let _ of $.aliasFacts){let C=_.id||`${_.subject}|${_.predicate}|${_.object}`;x.has(C)||(x.add(C),T.push(`${i(_)}${_.provenance?` (source: ${_.provenance})`:""}`))}}return{subject:k.entity,citation:T}})}if(h&&b===ma){let g=h.attributes.find(v=>v.prop==="mgx:ruleBase1")?.value,y=h.attributes.find(v=>v.prop==="mgx:ruleFilterProperty")?.value;if(!g||!y)return[];let w=await Lv(e,g,n,s),E=V(y),R=[];for(let v of w){let k=V(v.subject),I=l.find(x=>x.predicate===u&&x.subject===k&&V(x.object)===E);I&&R.push({subject:v.subject,citation:[...v.citation,r(I)]})}return R}return[]}function St(e,t={}){return Pv(e,Nl(e),t)}function Pv(e,t,n={}){let s=nv(e),o=[];for(let[r,i]of t.groups){let a=cm(r,i,t),c=s?.get(r);a.trust=tc(c?c.inputs:a.assertions,n).score,o.push(a)}return o}function Nl(e,{pairs:t=null,scopedGroups:n=new Set}={}){let s=e?.individuals||[],o=Ut(e),r=o?o.sourcesById:new Map(s.filter(b=>b?.class===us).map(b=>[b.id,b])),i=o?.statedByBySubject;if(!i){let b=(e?.objectProperties||[]).find(g=>g?.prop===Sn);i=new Map;for(let g of b?.examples||[])i.has(g.subject)||i.set(g.subject,[]),i.get(g.subject).push(g.object)}let a=t?new Set([...t].map(b=>b.slice(0,b.indexOf("\0")))):null,c=b=>{if(!t||n.has(Bt(b.id)))return!1;let g=hs(b,"subject");return a.has(g)?!t.has(la(g,hs(b,"predicate"))):!0},l=new Map,u=new Map;for(let b of s){if(b?.class===Yt){let w=Bt(b.id),E=u.get(w);E?E.push(b):u.set(w,[b]);continue}if(b?.class!==et||(b.attributes||[]).some(w=>w?.prop===da)||Jr(b.id)||c(b))continue;let g=Bt(b.id),y=l.get(g);y?y.push(b):l.set(g,[b])}for(let[b,g]of u){let y=l.get(b);if(!y)continue;let w=y.filter(E=>!Yc(g,E.id,fa(ms(E,"mgx:factProvenance").split(" | ").filter(Boolean),ms(E,ut))));w.length!==y.length&&(w.length?l.set(b,w):l.delete(b))}for(let b of l.values())b.sort((g,y)=>g.id<y.id?-1:g.id>y.id?1:0);let d=new Map,p=b=>{let g=d.get(b);return g===void 0&&(g=(r.get(b)?.attributes||[]).find(y=>y?.prop==="mgx:sourceType")?.value||"",d.set(b,g)),g},f=new Map,m=b=>{let g=f.get(b);return g===void 0&&(g=yl(b.split(" | ").filter(Boolean)),f.set(b,g)),g},h=null;return{groups:l,get groupsByPair(){if(h)return h;h=new Map;for(let[b,g]of l){let y=la(hs(g[0],"subject"),hs(g[0],"predicate")),w=h.get(y);w?w.push(b):h.set(y,[b])}return h},statedByRecord:i,sourceTypeOf:p,embeddedTimestampOf:m}}function m0(e){let t="",n="",s="",o="",r="",i="",a="",c="";for(let l of e?.attributes||[]){switch(l?.prop){case"mgx:factProvenance":t=l.value||"";continue;case ut:n=l.value||"";continue;case ca:s=l.value||"";continue;case wl:o=l.value||"";continue;case Ar:r=l.value||"";continue;case tr:i=l.value||"";continue;default:break}l?.key==="quantifier"?a=l.value||"":l?.key==="justification"&&(c=l.value||"")}return{provenance:t,createdAt:n,observedAt:s,extraction:o,trustScore:r,sourceId:i,quantifier:a,justification:c}}function cm(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=ms,i=hs,a=[],c=[],l=[],u=new Set,d=new Set,p=[],f=new Set,m="";for(let g of t){if(zs(g.id)){let T=qi(g.id),$=Yi(g);for(let _ of $)c.includes(_)||(c.push(_),T&&l.push(T));a.push({id:g.id,sourceId:"",sourceType:T,provenance:"",createdAt:r(g,as),ownTrust:Number(r(g,Xr))||0,assertedAt:r(g,cs),rollup:{count:Number(r(g,Hi))||$.length,sourceIds:$,earliest:r(g,as),latest:r(g,cs)}});continue}let y=m0(g),w=y.provenance.split(" | ").filter(Boolean);for(let T of w)u.add(T);let[E]=s.get(g.id)||[],R=E||y.sourceId,v=o(R);E&&!c.includes(E)&&(c.push(E),v&&l.push(v));let k=y.createdAt,I=y.observedAt,x=y.extraction?y.extraction.split(" ").filter(Boolean):[];for(let T of x)d.add(T);a.push({id:g.id,sourceId:R,sourceType:v,provenance:w.join(" | "),createdAt:k,...I?{observedAt:I}:{},...x.length?{extraction:x}:{},ownTrust:Number(y.trustScore)||0,assertedAt:n.embeddedTimestampOf(y.provenance)||(Number.isFinite(Date.parse(k))?k:"")}),m=m||y.quantifier;for(let T of y.justification.split(" | ")){let $=T.split(" ").filter(Boolean);if(!$.length)continue;let _=$.join(" ");f.has(_)||(f.add(_),p.push($))}}let h=[],b=new Set;for(let g of p)for(let y of g)b.has(y)||(b.add(y),h.push(y));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:m,sourceIds:c,sourceTypes:l,...d.size?{extraction:[...d].sort()}:{},environments:p,justification:h,assertions:a}}function h0(e){let t=ms(e,tr);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function Mv(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||Us();return await Gs(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(p=>{if(p?.class!==et)return!0;let f=Bt(p.id),m=o.has(p.id)?p.id:o.has(f)?f:"";if(!m)return!0;u.add(m),l.add(p.id);let h=h0(p),b=`${f}\0${h}`,g=ms(p,"mgx:factProvenance"),y=d.get(b);return y?(y.ids.push(p.id),g&&y.tags.push(g)):d.set(b,{groupId:f,sourceId:h,ids:[p.id],tags:g?[g]:[],template:{label:p.label||"",subject:ms(p,"rdf:subject"),predicate:ms(p,"rdf:predicate"),object:ms(p,"rdf:object")}}),!1});for(let p of u)r.push(p);if(r.length){for(let p of l)i.push(p);for(let p of c.objectProperties||[]){let f=p.examples||[];p.examples=f.filter(m=>!l.has(m?.subject)&&!l.has(m?.object)),p.count=p.examples.length}for(let p of d.values()){let f=w$({groupId:p.groupId,sourceId:p.sourceId,recordIds:p.ids,retractedAt:a,template:p.template,provenance:[...p.tags,n].filter(Boolean).join(" | ")});f&&Ws(c,f)}bs(c)}}),{removed:r,records:i}}function g0(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==Yt)continue;let s=Xc(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function b0(e,t){let n=[];for(let o of t||[]){let r=Jc(o);r&&n.push(r)}let s=[];return n.length?(await Gs(e,o=>{let r=new Map;for(let a of n){let c=Ws(o,a),l=Bt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}let i=new Set;for(let[a,c]of r)for(let l of or(o,a)){let u=wo(o,l);if(!u)continue;let d=ms(u,"mgx:factProvenance").split(" | ").filter(Boolean);Yc(c,l,fa(d,ms(u,ut)))&&i.add(l)}if(i.size){nm(o,i);for(let a of i)s.push(a)}bs(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function w0(e,{self:t="",acknowledgedBy:n=null}={}){let s=Qc(St(e)),o=[];for(let r of e?.individuals||[])r?.class===Yt&&r.id&&o.push(r.id);return{roster:s,retirable:Zc({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function y0(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Gs(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==Yt||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Ut(o);if(i)for(let a of r){i.individualsById.delete(a);let c=Bt(a),l=(i.retractionsByGroup.get(c)||[]).filter(u=>!r.has(u.id));l.length?i.retractionsByGroup.set(c,l):i.retractionsByGroup.delete(c)}bs(o)}),{retired:s}):{retired:s}}function Fv(e,{floor:t=$0,factRows:n=null}={}){let s=(n||St(e)).filter(i=>i.trust>=t),o=new Map;for(let i of s){if(Bc(i.predicate)===Vf)continue;let a=`${i.subject} ${i.predicate}`;o.has(a)||o.set(a,[]),o.get(a).push(i)}let r=[];for(let i of o.values()){if(new Set(i.map(c=>c.object)).size<2)continue;let a=Bc(i[0].predicate);a!==Kf&&!qf(i,a).contested||r.push(i.slice().sort((c,l)=>l.trust-c.trust||c.object.localeCompare(l.object)))}return r.sort((i,a)=>`${i[0].subject} ${i[0].predicate}`.localeCompare(`${a[0].subject} ${a[0].predicate}`))}var ti,Np,ho,et,Jo,us,ds,Lp,Pp,WN,Sn,Mp,V$,gl,kp,K$,GN,D$,VN,Rp,Fp,Dp,H$,KN,Bs,ca,tr,bl,da,wl,Z$,ms,hs,la,ev,nv,JN,ov,z$,iv,av,cv,lv,Nn,nr,go,Vp,bo,jL,Kp,Hp,kL,NL,vv,Cp,ML,er,DL,Xp,Sv,Jp,Ev,Ip,Ut,_l,Us,em,hl,pa,ma,sm,om,Al,ha,rm,u0,Cl,ni,Nv,d0,f0,$0,si,v0,S0,We=P(()=>{Pt();Qe();Wn();Ze();Ze();_n();s$();_n();zc();tp();ap();up();fp();na();na();wp();tp();ap();up();fp();ti=ne(".tmct","memory"),Np=ne(ti,"graph.json"),ho="Utterance",et="Fact",Jo="Session",us="Source",ds="Rule",Lp="mgx:saidInSession",Pp="mgx:inReplyTo",WN="mgx:derivedFrom",Sn="mgx:statedBy",Mp="mgx:canonicalisedFrom",V$="mgx:sourceReliability",gl="src:operator-chat",kp="src:teach-chat",K$="src:teach-node",GN=new Set(["visitor","tmct"]),D$=48,VN=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:Lp,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:Pp,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:extractionFinding",note:"OPTIONAL: the space-joined structural findings the extractor recorded about how THIS assertion's sentence was read, from the closed vocabulary identifier-token | clause-fallback | pronoun-carry | definitional-frame. Per assertion, never per triple: a later clean re-assertion of the same triple carries none. Absence means no findings were recorded, never that the sentence was checked and read cleanly"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:ut,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:ks,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:WN,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:Sn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:Mp,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:Ar,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:Za,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:Pc,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];Rp=e=>aa(e),Fp="memory",Dp="sqlite",H$="row";KN=`
101
+ `))return r}}throw new ve("cannot find end of structure",{toml:e,ptr:t})}var hl=M(()=>{Zo();});function iL(e,t,n){let s=e.slice(t,n),o=s.indexOf("#");return o>-1&&(ni(e,o),s=s.slice(0,o)),[s.trimEnd(),o]}function ca(e,t,n,s,o){if(s===0)throw new ve("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let r=e[t];if(r==="["||r==="{"){let[c,l]=r==="["?X$(e,t,s,o):Y$(e,t,s,o);if(n){if(l=gs(e,l),e[l]===",")l++;else if(e[l]!==n)throw new ve("expected comma or end of structure",{toml:e,ptr:l})}return[c,l]}if(r==='"'||r==="'"){let[c,l]=pl(e,t);if(n){if(l=gs(e,l),e[l]&&e[l]!==","&&e[l]!==n&&e[l]!==`
102
+ `&&e[l]!=="\r")throw new ve("unexpected character encountered",{toml:e,ptr:l});e[l]===","&&l++}return[c,l]}let i=q$(e,t,",",n),a=iL(e,t,i-(e[i-1]===","?1:0));if(!a[0])throw new ve("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return n&&a[1]>-1&&(i=gs(e,t+a[1]),e[i]===","&&i++),[H$(a[0],e,t,o),i]}var Tp=M(()=>{_p();Ap();hl();Zo();});function gl(e,t,n="="){let s=t-1,o=[],r=e.indexOf(n,t);if(r<0)throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let i=e[t=++s];if(i!==" "&&i!==" ")if(i==='"'||i==="'"){if(i===e[t+1]&&i===e[t+2])throw new ve("multiline strings are not allowed in keys",{toml:e,ptr:t});let[a,c]=pl(e,t);s=e.indexOf(".",c);let l=e.slice(c,s<0||s>r?r:s),u=ml(l);if(u>-1)throw new ve("newlines are not allowed in keys",{toml:e,ptr:t+s+u});if(l.trimStart())throw new ve("found extra tokens after the string part",{toml:e,ptr:c});if(r<c&&(r=e.indexOf(n,c),r<0))throw new ve("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(a)}else{s=e.indexOf(".",t);let a=e.slice(t,s<0||s>r?r:s);if(!aL.test(a))throw new ve("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(a.trimEnd())}}while(s+1&&s<r);return[o,gs(e,r+1,!0,!0)]}function Y$(e,t,n,s){let o={},r=new Set,i;for(t++;(i=e[t++])!=="}"&&i;){if(i===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=ni(e,t);else if(i!==" "&&i!==" "&&i!==`
103
+ `&&i!=="\r"){let a,c=o,l=!1,[u,d]=gl(e,t-1);for(let m=0;m<u.length;m++){if(m&&(c=l?c[a]:c[a]={}),a=u[m],(l=Object.hasOwn(c,a))&&(typeof c[a]!="object"||r.has(c[a])))throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});!l&&a==="__proto__"&&Object.defineProperty(c,a,{enumerable:!0,configurable:!0,writable:!0})}if(l)throw new ve("trying to redefine an already defined value",{toml:e,ptr:t});let[p,f]=ca(e,d,"}",n-1,s);r.add(p),c[a]=p,t=f}}if(!i)throw new ve("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function X$(e,t,n,s){let o=[],r;for(t++;(r=e[t++])!=="]"&&r;){if(r===",")throw new ve("expected value, found comma",{toml:e,ptr:t-1});if(r==="#")t=ni(e,t);else if(r!==" "&&r!==" "&&r!==`
104
+ `&&r!=="\r"){let i=ca(e,t-1,"]",n-1,s);o.push(i[0]),t=i[1]}}if(!r)throw new ve("unfinished array encountered",{toml:e,ptr:t});return[o,t]}var aL,Ap=M(()=>{_p();Tp();hl();Zo();aL=/^[a-zA-Z0-9-_]+[ \t]*$/});function J$(e,t,n,s){let o=t,r=n,i,a=!1,c;for(let l=0;l<e.length;l++){if(l){if(o=a?o[i]:o[i]={},r=(c=r[i]).c,s===0&&(c.t===1||c.t===2))return null;if(c.t===2){let u=o.length-1;o=o[u],r=r[u].c}}if(i=e[l],(a=Object.hasOwn(o,i))&&r[i]?.t===0&&r[i]?.d)return null;a||(i==="__proto__"&&(Object.defineProperty(o,i,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(r,i,{enumerable:!0,configurable:!0,writable:!0})),r[i]={t:l<e.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(c=r[i],c.t!==s&&!(s===1&&c.t===3)||(s===2&&(c.d||(c.d=!0,o[i]=[]),o[i].push(o={}),c.c[c.i++]=c={t:1,d:!1,i:0,c:{}}),c.d))return null;if(c.d=!0,s===1)o=a?o[i]:o[i]={};else if(s===0&&a)return null;return[i,o,c.c]}function er(e,{maxDepth:t=1e3,integersAsBigInt:n}={}){let s={},o={},r=s,i=o;for(let a=gs(e,0);a<e.length;){if(e[a]==="["){let c=e[++a]==="[",l=gl(e,a+=+c,"]");if(c){if(e[l[1]-1]!=="]")throw new ve("expected end of table declaration",{toml:e,ptr:l[1]-1});l[1]++}let u=J$(l[0],s,o,c?2:1);if(!u)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});i=u[2],r=u[1],a=l[1]}else{let c=gl(e,a),l=J$(c[0],r,i,0);if(!l)throw new ve("trying to redefine an already defined table or value",{toml:e,ptr:a});let u=ca(e,c[1],void 0,t,n);l[1][l[0]]=u[0],a=u[1]}if(a=gs(e,a,!0),e[a]&&e[a]!==`
105
+ `&&e[a]!=="\r")throw new ve("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:a});a=gs(e,a)}return s}var Q$=M(()=>{Ap();Tp();hl();Zo();});var Z$=M(()=>{});var bl=M(()=>{Q$();Z$();Rp();Zo();});var Cp={};Nt(Cp,{CONFIG_FILE:()=>yl,loadTomlConfig:()=>$l,mergeEffective:()=>tv,normalizeConfig:()=>ev});async function $l(e,{file:t}={}){let n=t||ne(e,yl),s;try{s=await Ne(n,"utf8")}catch(o){if(o&&o.code==="ENOENT")return null;throw o}try{return er(s)}catch(o){throw new Error(`Invalid ${yl} at ${n}: ${o&&o.message?o.message:o}`)}}async function cL(e,t){let n;if(Array.isArray(e))n=e;else{let o=Vt(t,String(e));n=(await Ne(o,"utf8")).split(`
106
+ `)}let s=[];for(let o of n){let r=String(o).trim();!r||r.startsWith("#")||s.push(Vt(t,r))}return s}async function ev(e,{configDir:t}={}){let n=e||{},s=t||process.cwd(),o={};if(n.repositories!==void 0&&(o.repositories=await cL(n.repositories,s)),n.out_root!==void 0&&(o.outRoot=Vt(s,String(n.out_root))),n.graph_file!==void 0&&(o.graphFile=Vt(s,String(n.graph_file))),n.graph_files!==void 0){let y=Array.isArray(n.graph_files)?n.graph_files:[n.graph_files];o.graphFiles=y.map(v=>Vt(s,String(v)))}let r=n.graph||{};r.read_only!==void 0&&(o.graph={readOnly:r.read_only});let i=n.corpus||{};i.tier!==void 0&&(o.corpus={tier:i.tier});let a=n.seed||{},c={};a.enabled!==void 0&&(c.enabled=a.enabled),a.limit!==void 0&&(c.limit=a.limit),a.capture_unknown_context!==void 0&&(c.captureUnknownContext=a.capture_unknown_context),a.unknown_context_limit!==void 0&&(c.unknownContextLimit=a.unknown_context_limit),Object.keys(c).length&&(o.seed=c),n.extensions!==void 0&&(o.extensions=n.extensions),n.bias!==void 0&&(o.bias=n.bias),n.games!==void 0&&(o.games=n.games),n.planning!==void 0&&(o.planning=n.planning),n.research!==void 0&&(o.research=n.research),n.news!==void 0&&(o.news=n.news),n.discourse!==void 0&&(o.discourse=n.discourse),n.recognition!==void 0&&(o.recognition=n.recognition),n.reasoning!==void 0&&(o.reasoning=n.reasoning);let l=n.index||{},u={};l.languages!==void 0&&(u.languages=l.languages),l.exclude!==void 0&&(u.exclude=l.exclude),l.secret_exclude!==void 0&&(u.secretExclude=l.secret_exclude),l.history_depth!==void 0&&(u.historyDepth=l.history_depth),l.include_text!==void 0&&(u.includeText=l.include_text),l.include_structure!==void 0&&(u.includeStructure=l.include_structure),l.respect_gitignore!==void 0&&(u.respectGitignore=l.respect_gitignore),l.markdown_sections!==void 0&&(u.markdownSections=l.markdown_sections),l.vue!==void 0&&(u.vue=l.vue),Object.keys(u).length&&(o.index=u);let d=n.tune||{},p={};d.score_gap_k!==void 0&&(p.scoreGapK=d.score_gap_k),d.literal_mention!==void 0&&(p.literalMention=d.literal_mention),d.demote_non_prod!==void 0&&(p.demoteNonProd=d.demote_non_prod),d.call_adjacency!==void 0&&(p.callAdjacency=d.call_adjacency),d.impl_of_interface!==void 0&&(p.implOfInterface=d.impl_of_interface),d.beam_search!==void 0&&(p.beamSearch=d.beam_search),d.beam_width!==void 0&&(p.beamWidth=d.beam_width),d.prose_layers!==void 0&&(p.proseLayers=d.prose_layers);let f=d.expansion||{},m={};f.strategy!==void 0&&(m.strategy=f.strategy),f.nodes!==void 0&&(m.nodes=f.nodes),f.q!==void 0&&(m.q=f.q),f.depth!==void 0&&(m.depth=f.depth),Object.keys(m).length&&(p.expansion=m),Object.keys(p).length&&(o.tune=p);let h=n.telemetry||{};h.enabled!==void 0&&(o.telemetry={enabled:h.enabled});let b=n.memory||{},g={};b.retention_versions!==void 0&&(g.retentionVersions=b.retention_versions),b.backend!==void 0&&(g.backend=b.backend),Object.keys(g).length&&(o.memory=g);let w=[];for(let[y,v]of lL)n[y]&&n[y][v]!==void 0&&w.push(`${y}.${v}`);return o.unwired=w,o}function wl(e,t="",n={}){for(let[s,o]of Object.entries(e||{})){if(o==null)continue;let r=t?`${t}.${s}`:s;Array.isArray(o)||typeof o!="object"?n[r]=o:wl(o,r,n)}return n}function tv({args:e={},toml:t=null,defaults:n={}}={}){let s=wl(n),o=null;if(t){let{unwired:u,...d}=t;o=d}let r=o?wl(o):{},i=wl(e),a=[...new Set([...Object.keys(s),...Object.keys(r),...Object.keys(i)])].sort(),c={},l={};for(let u of a)u in i?(c[u]=i[u],l[u]="arg"):u in r?(c[u]=r[u],l[u]="tmct.toml"):(c[u]=s[u],l[u]="default");return{effective:c,sources:l}}var yl,lL,la=M(()=>{Lt();Qe();bl();yl="tmct.toml";lL=[["index","include_text"],["index","include_structure"],["index","respect_gitignore"],["index","markdown_sections"],["index","vue"]]});var Hs={};Nt(Hs,{BackendRejected:()=>Pn,BackendUnavailable:()=>Jo,CANONICALISED_FROM_PROP:()=>Wp,CAPABLE_OF_PREDICATE:()=>U0,CHAIN_KEEP_DEPTH:()=>h$,CHAIN_ROLLUP_THRESHOLD:()=>Hc,CREATED_AT_PROP:()=>ut,DEFAULT_RETENTION:()=>Mp,EXTRACTION_FINDINGS:()=>ol,EXTRACTION_FINDING_PROP:()=>xl,FACT_CLASS:()=>Ze,GROUP_ROLLUP_THRESHOLD:()=>p$,HAS_A_PREDICATE:()=>ai,IN_REPLY_TO_PROP:()=>Up,MAX_ROW_BYTES:()=>Xo,MEMORY_DIR_REL:()=>oi,MEMORY_GRAPH_REL:()=>zp,MEMORY_MANIFEST_REL:()=>Fv,MEMORY_SESSION_CLASS:()=>Qo,MULTI_VALUED_PREDICATES:()=>W0,NODE_ID_REL:()=>sm,OPERATOR_SOURCE_ID:()=>Sl,RETRACTED_AT_PROP:()=>Jc,RETRACTED_COUNT_PROP:()=>lp,RETRACTED_RECORD_IDS_PROP:()=>Xc,RETRACTION_CLASS:()=>qt,RETRACTION_PREDICATE:()=>Yc,ROLLUP_COUNT_PROP:()=>Ji,ROLLUP_EARLIEST_PROP:()=>us,ROLLUP_KEEP_PER_TYPE:()=>m$,ROLLUP_LATEST_PROP:()=>ds,ROLLUP_PRIOR_PROP:()=>Qr,ROLLUP_RECORD_IDS_PROP:()=>Xi,ROLLUP_SOURCE_IDS_PROP:()=>Jr,ROW_BACKEND_CONTRACT_VERSION:()=>il,ROW_BACKEND_KIND:()=>ei,ROW_CLASSES:()=>rl,RULE_CLASS:()=>ms,RULE_KIND_ACTION_CONSTRAINT:()=>dm,RULE_KIND_ACTION_EFFECT:()=>ya,RULE_KIND_ACTION_PRECOND:()=>Ll,RULE_KIND_ACTION_SIGNATURE:()=>um,RULE_KIND_COMPOSE2:()=>ba,RULE_KIND_FILTER:()=>wa,RULE_KIND_PROP:()=>ii,RULE_KIND_RECURSIVE:()=>lm,SAID_IN_SESSION_PROP:()=>Bp,SOURCE_CLASS:()=>ps,SOURCE_RELIABILITY_PROP:()=>cv,STATED_BY_PROP:()=>xn,SYLLOGISE_STATE_REL:()=>nm,UPDATED_AT_PROP:()=>Rs,UTTERANCE_CLASS:()=>go,admittedNodes:()=>nl,appendCanonicalisedFromEdges:()=>j0,appendFact:()=>T0,appendFacts:()=>Yn,appendRetractions:()=>F0,appendRule:()=>Ml,appendUtterance:()=>x0,appendUtterances:()=>Vv,applySeedPayload:()=>dv,assertValidRow:()=>ra,attachFactHeads:()=>wv,chainRollupIdFor:()=>sp,cloneMemoryPayload:()=>Kp,closeSqliteMemoryStore:()=>Al,createInMemoryStore:()=>ma,createSqliteMemoryStore:()=>Hp,createSqliteRowBackend:()=>s0,emptyMemory:()=>hs,factGroupId:()=>zt,factHeadsOf:()=>yv,factIdForTriple:()=>Se,factRecordIdForTag:()=>mL,factRecordIdsFor:()=>rr,findContradictions:()=>nS,findRuleByName:()=>fm,findRulesByName:()=>N0,foldedFactRows:()=>Zv,headRollupIdFor:()=>np,isChainRollupId:()=>Zr,isHeadRollupId:()=>Us,isMemoryOrSqliteHandle:()=>ri,isRetractionId:()=>dp,isRollupId:()=>qc,isRowBackend:()=>al,isRowHandle:()=>Dn,isValidRow:()=>L$,loadMemory:()=>ct,loadNodeId:()=>f0,loadSyllogiseState:()=>u0,normFactPredicate:()=>cs,normFactTerm:()=>V,openConfiguredMemoryBackend:()=>$o,openExistingMemoryBackend:()=>ML,openMemoryBackend:()=>Xp,openSqliteSeedStore:()=>EL,peersToConvince:()=>gp,provSourceClassFor:()=>h0,provenanceTagToSource:()=>An,readFactRows:()=>mt,readObjectSupersessions:()=>SL,readOnlyMemorySnapshot:()=>FL,readRetractions:()=>M0,readRuleRows:()=>Fl,removeFacts:()=>tS,resolveMemoryGraphFile:()=>ua,resolveRelationChase:()=>pm,resolveRelationChaseReverse:()=>Qv,retirableRetractions:()=>D0,retireRetractions:()=>z0,retractedAtOf:()=>Yo,retractedRecordIds:()=>qo,retractionFromWire:()=>tl,retractionIdFor:()=>up,retractionScopeOf:()=>fp,retractionWireFact:()=>el,rowBackendProblems:()=>oa,rowProblems:()=>cl,saveNodeId:()=>p0,saveSyllogiseState:()=>d0,snapshotMemory:()=>r0,sqliteSeedFactTermValues:()=>PL,stableRecordIds:()=>sl,wrapRowBackend:()=>qp,wrapRowBackendOverSqliteSeed:()=>xL});function hs(){return{generated_at:"",memory:!0,prefixes:{owl:"http://www.w3.org/2002/07/owl#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",mgx:"urn:tmct:mgx#",mgxneg:"urn:tmct:mgxneg#"},vocabulary:fL.map(e=>({...e})),classes:[],objectProperties:[],individuals:[],proseIndex:{}}}function ua(e,t=null){if(ri(e))throw new Error("resolveMemoryGraphFile: dir is a store handle, not a file path (Backend A only)");return t===null?ne(e,zp):ne(e,oi,`graph.v${t}.json`)}function or(e){return!!e&&typeof e=="object"&&e.backend===Gp}function ys(e){return!!e&&typeof e=="object"&&e.backend===Vp}function Dn(e){return!!e&&typeof e=="object"&&e.backend===uv}function ri(e){return or(e)||ys(e)||Dn(e)}function pa(e){ri(e)&&(e.storeWrites=(e.storeWrites||0)+1)}function ma(){return{backend:Gp,payload:hs()}}function dv(e,t){t&&(e.payload={...e.payload,...t},pa(e))}function Kp(e){if(!e)return null;try{return structuredClone(e)}catch{return JSON.parse(JSON.stringify(e))}}function fv(e){for(let t of String(e||"").split(" | ")){if(!t)continue;let n=rm(An(t));if(n)return n}return{id:Ws,type:""}}function zt(e){let t=String(e||""),n=t.indexOf("@");return n<0?t:t.slice(0,n)}function mL(e,t){return`${e}@${pv(t).id}`}function pv(e){return rm(An(e))||{id:Ws,type:""}}function mv(e){let t=new Map;for(let n of String(e||"").split(" | ")){let s=n.trim();if(!s)continue;let{id:o,type:r}=pv(s),i=t.get(o)||{sourceId:o,sourceType:r,tags:[]};i.tags.includes(s)||i.tags.push(s),t.set(o,i)}return t.size||t.set(Ws,{sourceId:Ws,sourceType:"",tags:[]}),[...t.values()]}function jl(e,t=Math.max){let n="",s=null;for(let o of e||[]){let r=An(o)?.createdAt||"",i=Date.parse(r);Number.isFinite(i)&&(s===null||t(i,s)===i)&&(n=r,s=i)}return n}function ga(e,t="",n=Math.max){return jl(e,n)||(Number.isFinite(Date.parse(t))?String(t):"")}function hL(e,t){let n=Date.parse(e.assertedAt),s=Date.parse(t.assertedAt);return!Number.isFinite(n)||!Number.isFinite(s)?!1:n>s?!0:n===s&&!!e.observedAt&&!t.observedAt}function hv(e,t){let n=i=>(e.attributes||[]).find(a=>a?.prop===i)?.value||"",s=fv(n("mgx:factProvenance")),o=n(ha).split(" ").filter(Boolean)[0]||null,r=Qi(e.id);return[e.id,zt(e.id),n("rdf:subject"),n("rdf:predicate"),n("rdf:object"),n(nr)||s.id,r||s.type,Number(n(r?Qr:Ir))||0,n(ut),n(da)||null,o,t]}function gL(e){if(e.prepare("SELECT id FROM facts LIMIT 1").get()||!e.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Ze))return;let t=e.prepare(gv);e.exec("BEGIN IMMEDIATE");try{for(let n of e.prepare("SELECT json FROM individuals WHERE class = ?").all(Ze))t.run(...hv(JSON.parse(n.json),n.json));e.exec("COMMIT")}catch(n){throw e.exec("ROLLBACK"),n}}function bL(e){return(e||[]).map(t=>({sourceId:t.sourceId||"",sourceType:t.sourceType||"",ownTrust:t.ownTrust,assertedAt:t.assertedAt||""}))}function wv(e,t){return e&&t&&(e[bv]=t),e}function yL(e){let t=new Map;for(let n of e.prepare("SELECT triple_hash, trust_base, inputs_json FROM fact_heads").all())t.set(n.triple_hash,{trustBase:n.trust_base,inputs:JSON.parse(n.inputs_json)});return t}function $v(e,t,n,s){let o=e.prepare(wL),r=e.prepare("DELETE FROM fact_heads WHERE triple_hash = ?"),i=Gs();for(let a of n){let c=t.groups.get(a);if(!c?.length){r.run(a),s?.delete(a);continue}let l=bL(mm(a,c,t).assertions),u=Zg(l).score;o.run(a,u,JSON.stringify(l),i),s?.set(a,{trustBase:u,inputs:l})}}function $L(e){let t=e.db;if(t.prepare("SELECT triple_hash FROM fact_heads LIMIT 1").get()||!t.prepare("SELECT id FROM individuals WHERE class = ? LIMIT 1").get(Ze))return;let n=Dl(_l(e));t.exec("BEGIN IMMEDIATE");try{$v(t,n,n.groups.keys(),null),t.exec("COMMIT")}catch(s){throw t.exec("ROLLBACK"),s}}function vL(e,t,n){let s=e.prepare("SELECT ord, to_id FROM fact_object_supersessions WHERE subject = ? AND predicate = ? ORDER BY ord DESC LIMIT 1"),o=e.prepare("INSERT INTO fact_object_supersessions(subject, predicate, ord, from_id, to_id, recorded_at) VALUES (?, ?, ?, ?, ?, ?)"),r=Gs();for(let i of n){let[a,c]=i.split("\0");if(Vc(c)!==Yi)continue;let l=t.groupsByPair.get(i)||[];if(l.length<2)continue;let u=l.map(f=>{let m=mm(f,t.groups.get(f),t);return m.trust=sc(m.assertions).score,m});if(new Set(u.map(f=>f.object)).size<2)continue;let d=tp(u,Yi)?.winner?.id;if(!d)continue;let p=s.get(a,c);p?.to_id!==d&&o.run(a,c,(p?.ord??-1)+1,p?.to_id||"",d,r)}}function SL(e,{subject:t,predicate:n}={}){if(!ys(e))return[];let s=t&&n?" WHERE subject = ? AND predicate = ?":"",o=s?[t,n]:[];return e.db.prepare(`SELECT subject, predicate, ord, from_id, to_id, recorded_at FROM fact_object_supersessions${s} ORDER BY subject, predicate, ord`).all(...o).map(r=>({subject:r.subject,predicate:r.predicate,ord:r.ord,fromId:r.from_id,toId:r.to_id,recordedAt:r.recorded_at}))}function Sv(){if(sv)return;sv=!0;let e=process.listeners("warning").slice();process.removeAllListeners("warning"),process.on("warning",t=>{if(!(t?.name==="ExperimentalWarning"&&/sqlite/i.test(String(t?.message))))if(e.length)for(let n of e)n(t);else console.error(t.stack||String(t))})}async function Hp(e){Sv();let{DatabaseSync:t}=await Promise.resolve().then(()=>(kp(),jp)),n=new t(e);n.exec("PRAGMA journal_mode = WAL"),n.exec("PRAGMA synchronous = NORMAL"),n.exec(pL),gL(n);let s=n0({backend:Vp,db:n,dbPath:e});return $L(s),s}function Al(e){ys(e)&&e.db.close()}async function EL(e){Sv();let{DatabaseSync:t}=await Promise.resolve().then(()=>(kp(),jp));try{return{backend:Vp,db:new t(e,{readOnly:!0}),dbPath:e,readOnly:!0}}catch(n){throw new Jo(`could not open the seed store ${e} read-only: ${n.message}`,{cause:n})}}function qp(e,{basePayload:t=null,sqliteSeedStore:n=null,sqliteSeedOverlayRows:s=null,onOversizedRow:o="throw",copyOnRead:r=!0,log:i=void 0}={}){let a=oa(e);if(a.length)throw new Pn(`not a memory row backend: ${a.join("; ")}`);if(n&&!ys(n))throw new Pn("sqliteSeedStore must be an open sqlite store handle (openSqliteSeedStore)");if(n&&t)throw new Pn("a handle takes its seed either as a basePayload or as a sqliteSeedStore, never both");return{backend:uv,impl:e,cachedPayload:null,basePayload:Kp(t),sqliteSeedStore:n,sqliteSeedOverlayRows:s?[...s]:null,sqliteSeedKeyOrds:null,baseRows:null,storedRows:null,onOversizedRow:o,copyOnRead:r,log:i}}function xL(e,t,{overlayRows:n=null,onOversizedRow:s="throw",copyOnRead:o=!0,log:r=void 0}={}){return qp(e,{sqliteSeedStore:t,sqliteSeedOverlayRows:n,onOversizedRow:s,copyOnRead:o,log:r})}async function jL(e){let t=await e;if(Array.isArray(t))return t;let n=[];for await(let s of t)n.push(s);return n}function Np(e,t){let n=new Map;for(let s of e)n.set(s.rowKey,s);for(let s of t)n.set(s.rowKey,s);return[...n.values()]}function kL(e){let t=new Set(e.storedRows.map(o=>o.rowKey)),n=e.sqliteSeedStore?_v(e).keys():e.baseRows.map(o=>o.rowKey),s=new Set;for(let o of n)t.has(o)||s.add(o);return s}async function kl(e,t,n){let s=await e.impl.readMeta(t);if(s==null)return n;try{return JSON.parse(s)}catch{return n}}async function Yp(e){if(!e.cachedPayload){let t=hs(),n=await jL(e.impl.readRows());e.storedRows=n.filter(o=>o?.rowClass!==sa);let s={memory:await kl(e,Ev,rv(e,"memory",t.memory)),prefixes:await kl(e,xv,rv(e,"prefixes",t.prefixes))};e.sqliteSeedStore?e.cachedPayload=tr(Tv(e,s)):(e.baseRows=Sp(e.basePayload||t,{onOversizedRow:"keep"}),e.cachedPayload=tr(dl(Np(e.baseRows,e.storedRows),{meta:s})))}return e.cachedPayload}async function RL(e){let t=await Yp(e);return e.copyOnRead===!1?t:Mn(t)}function _L(e){return{...e,individuals:(e.individuals||[]).map(t=>({...t})),objectProperties:(e.objectProperties||[]).map(t=>({...t,examples:[...t.examples||[]]}))}}function Rv(e){Dn(e)&&(pa(e),e.cachedPayload=null,e.storedRows=null,e.baseRows=null)}function ov(e){let t;try{t=JSON.parse(e)}catch{return e}let n=t?.individual;return Array.isArray(n?.attributes)?JSON.stringify({...t,individual:{...n,attributes:n.attributes.filter(s=>s?.prop!==Rs)}}):e}function TL(e,t){return e?ov(e.json)!==ov(t.json):!0}async function AL(e,t){await Yp(e);let n=kL(e),s=e.sqliteSeedStore?e.storedRows:Np(e.baseRows,e.storedRows),o=new Map(s.map(f=>[f.rowKey,f])),r=Sp(e.sqliteSeedStore?CL(t,n):t,{priorRows:e.sqliteSeedStore?OL(e):s,onOversizedRow:e.onOversizedRow,...e.log?{log:e.log}:{}}),{puts:i,deletes:a}=Ep(s,r),c=i.filter(f=>!n.has(f.rowKey)).filter(f=>TL(o.get(f.rowKey),f)),l=a.filter(f=>!n.has(f));try{c.length&&await e.impl.putRows(c),l.length&&await e.impl.deleteRows(l),await e.impl.putMeta(Ev,JSON.stringify(t.memory??hs().memory)),await e.impl.putMeta(xv,JSON.stringify(t.prefixes??hs().prefixes))}catch(f){throw Rv(e),f}let u=new Set(l),d=new Map(e.storedRows.filter(f=>!u.has(f.rowKey)).map(f=>[f.rowKey,f]));for(let f of c)d.set(f.rowKey,f);e.storedRows=[...d.values()];let p={memory:t.memory,prefixes:t.prefixes};e.sqliteSeedStore&&!l.length?LL(e.cachedPayload,p,c):e.sqliteSeedStore?(e.cachedPayload=null,e.cachedPayload=tr(Tv(e,p))):(e.cachedPayload=null,e.cachedPayload=tr(dl(Np(e.baseRows,e.storedRows),{meta:p})))}function CL(e,t){return t.size?{...e,individuals:(e?.individuals||[]).filter(n=>!t.has(String(n?.id??""))),objectProperties:(e?.objectProperties||[]).filter(n=>!t.has(`${bo}${n?.prop}`))}:e}function Rl(e){return typeof e.iterate=="function"?e.iterate():e.all()}function*IL(e,t){let n=e.db.prepare("SELECT i.id AS id, i.ord AS ord, i.class AS class, i.json AS json, f.subject AS subject FROM individuals i LEFT JOIN facts f ON f.id = i.id ORDER BY i.ord, i.id");for(let o of Rl(n)){if(t(o.id))continue;let r=Jp.get(o.class)||"";yield{rowKey:o.id,rowClass:r,term:r==="fact"?V(o.subject||""):"",json:Zp(o.ord,o.json)}}let s=e.db.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ? ORDER BY rowid");for(let o of e.db.prepare("SELECT prop, ord, predicate, count FROM relations ORDER BY ord, prop").all()){if(t(`${bo}${o.prop}`))continue;let r=[];for(let i of s.all(o.prop)){let a={subject:i.subject,object:i.object,subjectLabel:i.subject_label,objectLabel:i.object_label};i.extra&&Object.assign(a,JSON.parse(i.extra)),r.push(a)}yield Cl({predicate:o.predicate,prop:o.prop,count:o.count,examples:r},o.ord)}for(let o of tm(e.db))t(o.rowKey)||(yield o)}function _v(e){if(e.sqliteSeedKeyOrds)return e.sqliteSeedKeyOrds;let t=e.sqliteSeedStore.db,n=new Map;for(let s of Rl(t.prepare("SELECT id, ord FROM individuals")))n.set(s.id,s.ord);for(let s of Rl(t.prepare("SELECT prop, ord FROM relations")))n.set(`${bo}${s.prop}`,s.ord);for(let s of tm(t))n.set(s.rowKey,Lp(s));for(let s of e.sqliteSeedOverlayRows||[])n.set(s.rowKey,Lp(s));return e.sqliteSeedKeyOrds=n,n}function*OL(e){for(let[t,n]of _v(e))yield{rowKey:t,json:`{"ord":${n}}`};yield*e.storedRows}function*NL(...e){for(let t of e)yield*t}function Tv(e,t){let n=new Set(e.storedRows.map(o=>o.rowKey)),s=(e.sqliteSeedOverlayRows||[]).filter(o=>o?.rowKey&&!n.has(o.rowKey));for(let o of s)n.add(o.rowKey);return dl(NL(IL(e.sqliteSeedStore,o=>n.has(o)),s,e.storedRows),{meta:t})}function LL(e,t,n){if(e.memory=t.memory,e.prefixes=t.prefixes,!n.length)return fl(e);let s=new Map;for(let r=0;r<e.individuals.length;r+=1)s.set(e.individuals[r]?.id,r);let o=new Map;for(let r=0;r<e.objectProperties.length;r+=1)o.set(e.objectProperties[r]?.prop,r);for(let r of n){if(r.rowClass===sa)continue;let i=JSON.parse(r.json);if(r.rowClass===sr){let l=i?.group;if(!l?.prop)continue;let u=o.get(l.prop);u===void 0?(o.set(l.prop,e.objectProperties.length),e.objectProperties.push(l)):e.objectProperties[u]=l;continue}let a=i?.individual;if(!a?.id)continue;let c=s.get(a.id);c===void 0?(s.set(a.id,e.individuals.length),e.individuals.push(a)):e.individuals[c]=a}return fl(e)}function*PL(e){for(let t of["subject","object"])for(let n of Rl(e.db.prepare(`SELECT DISTINCT ${t} AS value FROM facts`)))n.value&&(yield n.value)}function rv(e,t,n){if(!e.sqliteSeedStore)return e.basePayload?.[t]??n;let s=e.sqliteSeedStore.db.prepare("SELECT v FROM meta WHERE k = ?").get(t);if(!s)return n;try{return JSON.parse(s.v)}catch{return n}}async function Xp(e,t){if(Dn(t))return{dir:t,close:async()=>{await t.impl.close()}};if(al(t)){let r=qp(t);return{dir:r,close:async()=>{await r.impl.close()}}}if(t===Gp)return{dir:ma(),close:async()=>{}};let n=ne(e,".tmct","memory","graph.sqlite"),s=r=>nd(r).then(()=>!0,()=>!1);!await s(n)&&await s(ne(e,zp))&&process.stderr.write(`found .tmct/memory/graph.json \u2014 the flat-file memory backend is retired; starting a fresh sqlite store (the old file is left untouched)
107
+ `),await Zn($e(n),{recursive:!0});let o=await Hp(n);return{dir:o,close:async()=>Al(o)}}async function ML(e,t=""){if(!e||typeof e!="string")return null;let n=ne(e,".tmct","memory","graph.sqlite");try{await nd(n)}catch{return null}return Xp(e,t)}async function FL(e){if(!e)return null;let t=ma();return dv(t,Kp(await ct(e))),t}async function $o(e,t=process.env){let n=String(t?.TMCT_MEMORY_BACKEND||"").trim().toLowerCase();if(!n)try{let{loadTomlConfig:s}=await Promise.resolve().then(()=>(la(),Cp));n=String((await s(e))?.memory?.backend||"").trim().toLowerCase()}catch{n=""}return Xp(e,n)}function DL(e){let t=e.db.prepare("PRAGMA data_version").get()?.data_version;return e.cachedPayload&&e.cachedDataVersion!==t&&(pa(e),e.cachedPayload=null),e.cachedPayload||(e.cachedPayload=_l(e),e.cachedFactHeads=yL(e.db),e.cachedDataVersion=t),wv(Mn(e.cachedPayload),e.cachedFactHeads)}function _l(e){let t=e.db,n=hs(),s=(r,i)=>{let a=t.prepare("SELECT v FROM meta WHERE k = ?").get(r);return a?JSON.parse(a.v):i},o=t.prepare("SELECT json FROM individuals ORDER BY ord").all().map(r=>JSON.parse(r.json));return{generated_at:s("generated_at",n.generated_at),memory:s("memory",n.memory),prefixes:s("prefixes",n.prefixes),vocabulary:s("vocabulary",n.vocabulary),classes:s("classes",n.classes),objectProperties:Cv(t).map(r=>r.group),individuals:o,proseIndex:s("proseIndex",n.proseIndex)}}function zL(e,t){let n=Mn(t),s=e.individuals.findIndex(o=>o?.id===t.id);s>=0?e.individuals[s]=n:e.individuals.push(n)}function BL(e,t){e.individuals=e.individuals.filter(n=>!t.has(n?.id))}function UL(e,t){let n=e.objectProperties.find(s=>s?.prop===t);return n||(n={predicate:null,prop:t,count:0,examples:[]},e.objectProperties.push(n)),n}function WL(e,t,n){let s=`${t.subject}\0${t.object}`;e.examples=e.examples.filter(r=>`${r.subject}\0${r.object}`!==s);let o={subject:t.subject,object:t.object,subjectLabel:t.subjectLabel??null,objectLabel:t.objectLabel??null};n.length&&Object.assign(o,Mn(Object.fromEntries(n.map(r=>[r,t[r]])))),e.examples.push(o)}function GL(e,t){e.examples=e.examples.filter(n=>t.has(`${n.subject}\0${n.object}`))}function VL(e,t){e.objectProperties=e.objectProperties.filter(n=>!t.has(n?.prop))}function Lp(e){let t=HL.exec(e?.json||"");if(t)return Number(t[1]);try{let n=Number(JSON.parse(e.json).ord);return Number.isFinite(n)?n:0}catch{return 0}}function Av(e,t,n){let s=Jp.get(e?.class)||"";return{rowKey:String(e.id),rowClass:s,term:s==="fact"?V(ws(e,"subject")):"",json:Zp(t,n)}}function qL(e){let t={subject:e.subject,object:e.object,subjectLabel:e.subjectLabel??null,objectLabel:e.objectLabel??null};for(let n of Object.keys(e))vv.has(n)||(t[n]=e[n]);return t}function Cl(e,t){let n=(e.examples||[]).map(qL);return{rowKey:`${bo}${e.prop}`,rowClass:sr,term:"",json:JSON.stringify({ord:t,group:{predicate:e.predicate??null,prop:e.prop,count:Number.isFinite(e.count)?e.count:n.length,examples:n}})}}function Cv(e){let t=new Map;for(let n of e.prepare("SELECT prop, ord, predicate, count FROM relations ORDER BY ord, prop").all())t.set(n.prop,{ord:n.ord,group:{predicate:n.predicate,prop:n.prop,count:n.count,examples:[]}});if(!t.size)return[];for(let n of e.prepare("SELECT prop, subject, object, subject_label, object_label, extra FROM edges ORDER BY rowid").all()){let s=t.get(n.prop);if(!s)continue;let o={subject:n.subject,object:n.object,subjectLabel:n.subject_label,objectLabel:n.object_label};n.extra&&Object.assign(o,JSON.parse(n.extra)),s.group.examples.push(o)}return[...t.values()]}function Iv(e){let t=[],n=e.db.prepare("SELECT i.id AS id, i.ord AS ord, i.class AS class, i.json AS json, f.subject AS subject FROM individuals i LEFT JOIN facts f ON f.id = i.id ORDER BY i.ord, i.id").all();for(let s of n){let o=Jp.get(s.class)||"";t.push({rowKey:s.id,rowClass:o,term:o==="fact"?V(s.subject||""):"",json:Zp(s.ord,s.json)})}for(let s of Cv(e.db))t.push(Cl(s.group,s.ord));return t}function YL(e,t){let n=new Map,s=0,o=0;for(let a of t){let c=Lp(a);n.set(a.rowKey,c),a.rowClass===sr?c>=o&&(o=c+1):c>=s&&(s=c+1)}let r=[],i=new Map;for(let a of e.individuals||[]){if(!a?.id)continue;let c=JSON.stringify(a),l=String(a.id),u=n.get(l)??s++;r.push(Av(a,u,c)),i.set(l,{kind:"individual",ord:u,individual:a,json:c})}for(let a of e.objectProperties||[]){if(!a?.prop)continue;let c=`${bo}${a.prop}`,l=n.get(c)??o++,u=Cl(a,l);r.push(u),i.set(c,{kind:sr,ord:l,group:JSON.parse(u.json).group})}return{rows:r,partsByKey:i}}function XL(e){if(e.expiresAt!==void 0)return null;let t;try{t=JSON.parse(e.json)}catch{return null}if(!t||typeof t!="object"||!Number.isFinite(t.ord))return null;if(e.rowClass===sr){let r=t.group;if(!r?.prop)return null;let i=Cl(r,t.ord);return i.rowKey!==e.rowKey||i.term!==e.term||i.json!==e.json?null:{kind:sr,ord:t.ord,group:r}}let n=t.individual;if(!n?.id)return null;let s=JSON.stringify(n),o=Av(n,t.ord,s);return o.rowKey!==e.rowKey||o.rowClass!==e.rowClass||o.term!==e.term||o.json!==e.json?null:{kind:"individual",ord:t.ord,individual:n,json:s}}function Ov(e,{cache:t=null}={}){let n=e.db;return{db:n,cache:t,touchedGroups:new Set,touchedPairs:new Set,hasUnmappedRows:!!n.prepare(Qp).get(wo),unmapped:null,upsertInd:n.prepare("INSERT OR REPLACE INTO individuals(id, ord, class, label, json) VALUES (?, ?, ?, ?, ?)"),upsertFact:n.prepare(gv),deleteInd:n.prepare("DELETE FROM individuals WHERE id = ?"),deleteFact:n.prepare("DELETE FROM facts WHERE id = ?"),getFact:n.prepare("SELECT triple_hash, subject, predicate FROM facts WHERE id = ?"),upsertRel:n.prepare("INSERT OR REPLACE INTO relations(prop, ord, predicate, count) VALUES (?, ?, ?, ?)"),edgesForProp:n.prepare("SELECT subject, object, subject_label, object_label, extra FROM edges WHERE prop = ?"),upsertEdge:n.prepare("INSERT OR REPLACE INTO edges(prop, subject, object, subject_label, object_label, extra) VALUES (?, ?, ?, ?, ?, ?)"),deleteEdge:n.prepare("DELETE FROM edges WHERE prop = ? AND subject = ? AND object = ?"),deleteGroupEdges:n.prepare("DELETE FROM edges WHERE prop = ?"),deleteRel:n.prepare("DELETE FROM relations WHERE prop = ?")}}function Nv(e){return e.unmapped||(e.db.exec(KL),e.hasUnmappedRows=!0,e.unmapped={upsert:e.db.prepare(`INSERT OR REPLACE INTO ${wo}(row_key, row_class, term, json, expires_at) VALUES (?, ?, ?, ?, ?)`),remove:e.db.prepare(`DELETE FROM ${wo} WHERE row_key = ?`)}),e.unmapped}function em(e,t){e.hasUnmappedRows&&Nv(e).remove.run(t)}function JL(e,{ord:t,individual:n,json:s}){e.upsertInd.run(n.id,t,n.class??null,n.label??null,s),n.class===Ze&&(e.upsertFact.run(...hv(n,s)),e.touchedGroups.add(zt(n.id)),e.touchedPairs.add(fa(ws(n,"subject"),ws(n,"predicate")))),em(e,String(n.id)),e.cache&&zL(e.cache,n)}function QL(e,{ord:t,group:n}){let s=new Map(e.edgesForProp.all(n.prop).map(a=>[`${a.subject}\0${a.object}`,a])),o=new Set,r=e.cache?UL(e.cache,n.prop):null;for(let a of n.examples||[]){let c=`${a.subject}\0${a.object}`;o.add(c);let l=Object.keys(a).filter(f=>!vv.has(f)),u=l.length?JSON.stringify(Object.fromEntries(l.map(f=>[f,a[f]]))):null,d=s.get(c);d&&(d.subject_label??null)===(a.subjectLabel??null)&&(d.object_label??null)===(a.objectLabel??null)&&(d.extra??null)===(u??null)||(e.upsertEdge.run(n.prop,a.subject,a.object,a.subjectLabel??null,a.objectLabel??null,u),r&&WL(r,a,l))}for(let a of s.keys()){if(o.has(a))continue;let[c,l]=a.split("\0");e.deleteEdge.run(n.prop,c,l)}r&&GL(r,o);let i=Number.isFinite(n.count)?n.count:(n.examples||[]).length;e.upsertRel.run(n.prop,t,n.predicate??null,i),em(e,`${bo}${n.prop}`),r&&(r.predicate=n.predicate??null,r.count=i)}function ZL(e,t){Nv(e).upsert.run(t.rowKey,t.rowClass,t.term,t.json,t.expiresAt??null)}function Lv(e,t,n=null){for(let s of t){let o=n?.get(s.rowKey)||XL(s);if(!o){ZL(e,s);continue}o.kind===sr?QL(e,o):JL(e,o)}}function Pv(e,t){let n=new Set,s=new Set;for(let o of t){if(o.startsWith(bo)){let r=o.slice(bo.length);e.deleteGroupEdges.run(r),e.deleteRel.run(r),s.add(r)}else{let r=e.getFact.get(o);r&&(e.touchedGroups.add(r.triple_hash),e.touchedPairs.add(fa(r.subject,r.predicate))),e.deleteInd.run(o),e.deleteFact.run(o),n.add(o)}em(e,o)}e.cache&&n.size&&BL(e.cache,n),e.cache&&s.size&&VL(e.cache,s)}function Pp(e,t,n){if(!e.touchedGroups.size)return;let s=Dl(t);$v(e.db,s,e.touchedGroups,n),vL(e.db,s,e.touchedPairs)}function e0(e,t){let n=e.db,s=hs(),o=e.cachedPayload||null;n.exec("BEGIN IMMEDIATE");try{let r=n.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)");r.run("generated_at",JSON.stringify(t.generated_at??s.generated_at)),r.run("memory",JSON.stringify(t.memory??s.memory)),r.run("prefixes",JSON.stringify(t.prefixes??s.prefixes)),r.run("vocabulary",JSON.stringify(t.vocabulary??s.vocabulary)),r.run("classes",JSON.stringify(t.classes??s.classes)),r.run("proseIndex",JSON.stringify(t.proseIndex??s.proseIndex)),o&&(o.generated_at=Mn(t.generated_at??s.generated_at),o.memory=Mn(t.memory??s.memory),o.prefixes=Mn(t.prefixes??s.prefixes),o.vocabulary=Mn(t.vocabulary??s.vocabulary),o.classes=Mn(t.classes??s.classes),o.proseIndex=Mn(t.proseIndex??s.proseIndex));let i=Ov(e,{cache:o}),a=Iv(e),{rows:c,partsByKey:l}=YL(t,a),{puts:u,deletes:d}=Ep(a,c);Lv(i,u,l),Pv(i,d),Pp(i,t,e.cachedFactHeads),n.exec("COMMIT")}catch(r){throw n.exec("ROLLBACK"),e.cachedPayload=void 0,e.cachedFactHeads=void 0,r}}function tm(e){if(!e.prepare(Qp).get(wo))return[];let t=Math.floor(Date.now()/1e3),n=[];for(let s of e.prepare(`SELECT row_key, row_class, term, json, expires_at FROM ${wo}`).all()){if(s.expires_at!==null&&s.expires_at<=t)continue;let o={rowKey:s.row_key,rowClass:s.row_class,term:s.term,json:s.json};s.expires_at!==null&&(o.expiresAt=s.expires_at),n.push(o)}return n}function iv(e,t){let n=e.db;n.exec("BEGIN IMMEDIATE");try{t(Ov(e)),n.exec("COMMIT")}catch(s){throw n.exec("ROLLBACK"),s}finally{e.cachedPayload=null,e.cachedFactHeads=null}}function n0(e){return Object.assign(e,{async readRows(){return[...Iv(e),...tm(e.db)]},async readRowsByTerm(t){return(await e.readRows()).filter(n=>n.term===t)},async putRows(t){let n=(t||[]).map(s=>ra(s));n.length&&iv(e,s=>{Lv(s,n),Pp(s,_l(e),null)})},async deleteRows(t){let n=[...t||[]];n.length&&iv(e,s=>{Pv(s,n),Pp(s,_l(e),null)})},async readMeta(t){let n=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(t);return n?n.v:null},async putMeta(t,n){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(t,String(n)),e.cachedPayload=null,e.cachedFactHeads=null},async deleteAll(){let t=e.db;t.exec("BEGIN IMMEDIATE");try{for(let n of t0)t.exec(`DELETE FROM ${n}`);t.prepare(Qp).get(wo)&&t.exec(`DELETE FROM ${wo}`),t.exec("COMMIT")}catch(n){throw t.exec("ROLLBACK"),n}finally{e.cachedPayload=null,e.cachedFactHeads=null}},async close(){Al(e)}})}function s0(e){let t=null,n=!1,s=()=>{if(n)throw new Jo("this row backend was closed and can no longer be used");return t=t||Hp(e),t},o=r=>async(...i)=>(await s())[r](...i);return{kind:ei,contractVersion:1,readRows:o("readRows"),readRowsByTerm:o("readRowsByTerm"),putRows:o("putRows"),deleteRows:o("deleteRows"),readMeta:o("readMeta"),putMeta:o("putMeta"),deleteAll:o("deleteAll"),async close(){let r=t?await t:null;n=!0,r&&Al(r)}}}async function Mv(e,t){let n=`${e}.tmp-${process.pid}-${Math.random().toString(36).slice(2,10)}`;await jr(n,t),await Ka(n,e)}async function Il(e,t){await Mv(e,JSON.stringify(t))}async function r0(e,{retentionVersions:t}={}){if(ri(e))throw new Error("snapshotMemory only supports the flat-JSON backend (Backend A) \u2014 a store handle has no on-disk graph.json to snapshot");let n=ua(e),s;try{s=await Ne(n,"utf8")}catch(u){if(u?.code==="ENOENT")return{skipped:!0,version:null,prunedVersion:null};throw u}let o=o0(e),r;try{r=JSON.parse(await Ne(o,"utf8"))}catch(u){if(u?.code!=="ENOENT")throw u;r={version:0,retentionVersions:t??Mp}}Number.isInteger(r.version)||(r.version=0),Number.isInteger(r.retentionVersions)||(r.retentionVersions=t??Mp);let i=r.version,a=ua(e,i);await Zn($e(a),{recursive:!0}),await Mv(a,s),r.version=i+1;let c=null,l=i-r.retentionVersions;if(l>=0)try{await sd(ua(e,l)),c=l}catch(u){if(u?.code!=="ENOENT")throw u}return await Il(o,r),{skipped:!1,version:i,prunedVersion:c}}async function ct(e){if(or(e))return tr(e.payload);if(ys(e))return tr(DL(e));if(Dn(e))return RL(e);let t;try{t=await Ne(Op(e),"utf8")}catch(n){if(n?.code==="ENOENT")return hs();throw n}return tr(JSON.parse(t))}function a0(e){if(!Array.isArray(e?.individuals))return e;let t=new Map;for(let s of e.individuals){if(s?.class!==Ze||!i0.test(s.id||""))continue;let o=i=>(s.attributes||[]).find(a=>a?.key===i)?.value||"",r=Ko(o("subject"),o("predicate"),o("object"));r!==s.id&&(t.set(s.id,r),s.id=r)}if(!t.size)return e;let n=s=>t.get(s)||s;for(let s of e.objectProperties||[])for(let o of s.examples||[])o&&(t.has(o.subject)&&(o.subject=t.get(o.subject)),t.has(o.object)&&(o.object=t.get(o.object)));for(let s of e.individuals){Array.isArray(s?.derived_from)&&s.derived_from.length&&(s.derived_from=s.derived_from.map(n));let o=(s?.attributes||[]).find(r=>r?.prop==="mgx:factJustification");o?.value&&(o.value=o.value.split(" | ").map(r=>r.split(" ").filter(Boolean).map(n).join(" ")).filter(Boolean).join(" | "))}return e}function c0(e){if(!Array.isArray(e?.individuals))return e;let t=(e.objectProperties||[]).find(c=>c?.prop===xn),n=new Map;for(let c of t?.examples||[]){if(!c?.subject)continue;let l=n.get(c.subject);l?l.push(c):n.set(c.subject,[c])}let s=new Set,o=new Map,r=[],i=[],a=[];for(let c of e.individuals){if(c?.class!==Ze||String(c.id||"").includes("@")){a.push(c);continue}let l=y=>(c.attributes||[]).find(v=>v?.prop===y)?.value||"",u=l("rdf:subject"),d=l("rdf:predicate"),p=l("rdf:object");if(!u||!d||!p){a.push(c);continue}let f=Ko(u,d,p),m=l(ut),h=l("mgx:factProvenance"),b=n.get(c.id)||[],g=h?mv(h):[];for(let y of b)g.some(v=>v.sourceId===y.object)||g.push({sourceId:y.object,sourceType:"",tags:[]});g.length||g.push({sourceId:Ws,sourceType:"",tags:[]});let w=[];for(let y of g){let v={id:`${f}@${y.sourceId}`,label:c.label,class:Ze,derived_from:Mn(c.derived_from)||[],mentions:Mn(c.mentions)||[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:u},{prop:"rdf:predicate",key:"predicate",value:d},{prop:"rdf:object",key:"object",value:p},{prop:ut,key:"createdAt",value:ga(y.tags,m,Math.min)||m||Gs()},{prop:nr,key:"sourceId",value:y.sourceId},...y.tags.length?[{prop:"mgx:factProvenance",key:"provenance",value:y.tags.join(" | ")}]:[],...l("mgx:hasProseTokens")?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:l("mgx:hasProseTokens")}]:[],...l("mgx:factQuantifier")?[{prop:"mgx:factQuantifier",key:"quantifier",value:l("mgx:factQuantifier")}]:[],...y.sourceType==="entailed"&&l("mgx:factJustification")?[{prop:"mgx:factJustification",key:"justification",value:l("mgx:factJustification")}]:[]]};if(a.push(v),r.push(v),w.push(v.id),y.sourceId!==Ws){let R=b.find(S=>S?.object===y.sourceId);i.push({...R||{},subject:v.id,object:y.sourceId,subjectLabel:v.label,objectLabel:im(y.sourceId)})}}s.add(c.id),o.set(c.id,w)}if(!s.size)return e;t?(t.examples=(t.examples||[]).filter(c=>!s.has(c?.subject)),t.examples.push(...i),t.count=t.examples.length):i.length&&(e.objectProperties=e.objectProperties||[],e.objectProperties.push({predicate:"statedBy",prop:xn,count:i.length,examples:i}));for(let c of e.objectProperties||[]){if(c?.prop===xn||!c?.examples?.length)continue;let l=[];for(let u of c.examples){let d=s.has(u?.subject)?o.get(u.subject)||[]:[u?.subject],p=s.has(u?.object)?o.get(u.object)||[]:[u?.object];for(let f of d)for(let m of p)l.push({...u,subject:f,object:m})}c.examples=l,c.count=l.length}e.individuals=a,Bv(e);for(let c of r)si(e,c);return $s(e),e}async function l0(e,t){if(pa(e),or(e)){e.payload=t;return}if(ys(e)){e0(e,t);return}if(Dn(e)){await AL(e,t);return}await Zn($e(Op(e)),{recursive:!0}),await Il(Op(e),t)}async function u0(e){if(or(e))return e.syllogiseState?structuredClone(e.syllogiseState):null;if(ys(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(Dv);return t?.v?JSON.parse(t.v):null}if(Dn(e))return kl(e,jv,null);try{return JSON.parse(await Ne(ne(e,nm),"utf8"))}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function d0(e,t){if(or(e)){e.syllogiseState=structuredClone(t);return}if(ys(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(Dv,JSON.stringify(t));return}if(Dn(e)){await e.impl.putMeta(jv,JSON.stringify(t));return}let n=ne(e,nm);await Zn($e(n),{recursive:!0}),await Il(n,t)}async function f0(e){if(or(e))return e.nodeId||null;if(ys(e)){let t=e.db.prepare("SELECT v FROM meta WHERE k = ?").get(zv);return t?.v&&JSON.parse(t.v).nodeId||null}if(Dn(e))return(await kl(e,kv,null))?.nodeId||null;try{return JSON.parse(await Ne(ne(e,sm),"utf8")).nodeId||null}catch(t){if(t?.code==="ENOENT")return null;throw t}}async function p0(e,t){if(or(e)){e.nodeId=t;return}if(ys(e)){e.db.prepare("INSERT OR REPLACE INTO meta(k, v) VALUES (?, ?)").run(zv,JSON.stringify({nodeId:t}));return}if(Dn(e)){await e.impl.putMeta(kv,JSON.stringify({nodeId:t}));return}let n=ne(e,sm);await Zn($e(n),{recursive:!0}),await Il(n,{nodeId:t})}function Bv(e){let t=new Map,n=new Map,s=new Map,o=new Map,r=new Map;for(let a of e.individuals||[])if(a?.id&&(t.set(a.id,a),a.class===ps&&n.set(a.id,a),a.class===qt&&Dp(r,a),a.class===Ze)){let c=zt(a.id),l=o.get(c);l?l.push(a.id):o.set(c,[a.id])}let i=(e.objectProperties||[]).find(a=>a?.prop===xn);for(let a of i?.examples||[]){if(!a?.subject)continue;let c=s.get(a.subject);c?c.push(a.object):s.set(a.subject,[a.object])}return e[Fp]={individualsById:t,sourcesById:n,statedByBySubject:s,factRecordsByGroup:o,retractionsByGroup:r},e[Fp]}function Dp(e,t){let n=zt(t.id),s=(e.get(n)||[]).filter(o=>o.id!==t.id);s.push(t),e.set(n,s)}function m0(e,t){let n=Bt(e);return n?n.retractionsByGroup.get(t)||[]:(e?.individuals||[]).filter(s=>s?.class===qt&&zt(s.id)===t)}async function Ks(e,t){let n=Dn(e),s=n?_L(await Yp(e)):await ct(e);pa(e);try{Bv(s);let o=await t(s)??s;return y0(o),v0(o),n||K$(o),await l0(e,o),n?e.cachedPayload:o}catch(o){throw Rv(e),o}}function om(e,t){return e?.attributes?.find(n=>n?.prop===ut)?.value||t||Gs()}function Fn(e,t,n,s){e.attributes=(e.attributes||[]).filter(o=>o?.prop!==t),e.attributes.push({prop:t,key:n,value:s})}function rm(e){switch(e?.kind){case"operator":return{id:e.sessionId?`${Sl}:${e.sessionId}`:Sl,type:"operator"};case"teach":return{id:e.sessionId?`${Ip}:${e.sessionId}`:Ip,type:"teach"};case"teachNode":return{id:`${lv}:${e.nodeId}`,type:"teach"};case"provider":return{id:`src:provider:${e.name}`,type:"provider"};case"corpus":return{id:`src:corpus:${e.name}`,type:"corpus"};case"corpusWeak":return{id:`src:corpus-weak:${e.name}`,type:"corpusWeak"};case"reference":return{id:`src:reference:${e.pack}`,type:"reference"};case"referenceLive":return{id:`src:reference:${e.pack}`,type:"referenceLive"};case"extracted":return{id:`src:extracted:${e.name}`,type:"extracted"};case"optimisticExtract":return{id:`src:optimistic-extract:${e.name}`,type:"optimisticExtract"};case"web":return{id:`src:learned:web:${Ki(String(e.url||""))}`,type:"web",url:String(e.url||"")};case"entailed":return{id:`src:entailed:${e.rule}`,type:"entailed",rule:String(e.rule||"")};default:return null}}function h0(e){return gd[e]||null}function g0(e,t,n){let s=rm(t);if(!s)return null;let o=Bt(e),r=o?o.individualsById.get(s.id):e.individuals.find(l=>l?.id===s.id),i=om(r,t?.createdAt||n),a={id:s.id,label:im(s.id),class:ps,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:sourceType",key:"sourceType",value:s.type},{prop:ut,key:"createdAt",value:i},...s.url?[{prop:"mgx:sourceUrl",key:"sourceUrl",value:s.url}]:[],...s.rule?[{prop:"mgx:sourceRule",key:"sourceRule",value:s.rule}]:[]]},c=Vs(e,a);return o&&o.sourcesById.set(s.id,c),s.id}function Nl(e){let t=Bt(e),n={};if(t){for(let[s,o]of t.sourcesById)n[s]=o;return n}for(let s of e.individuals)s?.class===ps&&(n[s.id]=s);return n}function Uv(e,t){let n=Bt(e);return n?(n.statedByBySubject.get(t)||[]).slice():(e.objectProperties.find(o=>o?.prop===xn)?.examples||[]).filter(o=>o?.subject===t).map(o=>o.object)}function b0(e,t,n=Date.now(),s={}){let o=Uv(e,t.id),r=(t.attributes||[]).find(c=>c?.prop===ut)?.value||"",{score:i,inputs:a}=Qg({sourceIds:o,createdAt:r},Nl(e),{now:n,...Array.isArray(s?.premiseTrusts)?{premiseTrusts:s.premiseTrusts}:{},...typeof s?.ruleConfidence=="number"?{ruleConfidence:s.ruleConfidence}:{}});Fn(t,Ir,"trustScore",String(i)),Fn(t,tc,"trustInputs",JSON.stringify(a)),Fn(t,Rs,"updatedAt",new Date(n).toISOString())}function w0(e,t,n=Date.now(),s={}){let[o]=Uv(e,t.id),r=o?Nl(e)[o]:null,i=(r?.attributes||[]).find(l=>l?.prop==="mgx:sourceType")?.value||"",a=nc(i,r);if(i==="entailed"&&Array.isArray(s?.premiseTrusts)&&s.premiseTrusts.length){let l=typeof s.ruleConfidence=="number"?s.ruleConfidence:1;a=Math.max(0,Math.min(1,Math.min(...s.premiseTrusts)*l))}let c=(t.attributes||[]).find(l=>l?.prop===ut)?.value||"";Fn(t,Ir,"trustScore",String(a)),Fn(t,tc,"trustInputs",JSON.stringify({sourceType:i,sourceId:o||"",createdAt:c})),Fn(t,Rs,"updatedAt",new Date(n).toISOString())}function Wv(e,t,n,s){t?.class===Ze?w0(e,t,n,s):b0(e,t,n,s)}function si(e,t,n=Date.now(),s={}){let o=(t.attributes||[]).find(i=>i?.prop==="mgx:factProvenance")?.value||"",r=(t.attributes||[]).find(i=>i?.prop===ut)?.value||new Date(n).toISOString();for(let i of o.split(" | ").filter(Boolean)){let a=An(i);if(!a)continue;let c=g0(e,a,r);c&&Tl(e,{predicate:"statedBy",prop:xn},{subject:t.id,object:c,subjectLabel:t.label,objectLabel:im(c)})}Wv(e,t,n,s)}function y0(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=e.objectProperties.find(r=>r?.prop===xn),n=new Set((t?.examples||[]).map(r=>r.subject)),s=!1,o=Date.now();for(let r of e.individuals)r?.class!==Ze||n.has(r.id)||!(r.attributes||[]).find(a=>a?.prop==="mgx:factProvenance")?.value||(si(e,r,o),s=!0);s&&$s(e)}function $0(e){let t=Bt(e);if(t){let i=!1;for(let a of t.sourcesById.keys())if(vl(a)){i=!0;break}if(!i)return null}let n=e.objectProperties.find(i=>i?.prop===xn),s=new Set;for(let i of n?.examples||[])vl(i?.object)&&s.add(i.subject);let o=new Set,r=new Set;for(let i of e.individuals){if(i?.class!==Ze||!(s.has(i.id)||Us(i.id)&&Zi(i).some(vl)))continue;o.add(zt(i.id));let c=ws(i,"subject");c&&r.add(fa(c,ws(i,"predicate")))}return o.size?{pairs:r,scopedGroups:o}:null}function v0(e){if(!Array.isArray(e?.individuals)||!Array.isArray(e?.objectProperties))return;let t=$0(e);if(!t)return;let n=eS(e,Dl(e,t)),s=new Set;for(let c of nS(e,{factRows:n}))for(let l of c)s.add(l.id);let o=new Map;for(let c of n)for(let l of c.sourceIds){if(!vl(l))continue;let u=o.get(l)||{factsAsserted:0,factsContradicted:0};u.factsAsserted+=1,s.has(c.id)&&(u.factsContradicted+=1),o.set(l,u)}if(!o.size)return;let r=Bt(e);for(let[c,l]of o){let u=r?r.individualsById.get(c):e.individuals.find(d=>d?.id===c);u&&(Fn(u,cv,"sourceReliability",String(eb(l))),Fn(u,Rs,"updatedAt",new Date().toISOString()))}let i=e.objectProperties.find(c=>c?.prop===xn),a=new Set;for(let c of i?.examples||[])o.has(c?.object)&&a.add(c.subject);for(let c of a){let l=r?r.individualsById.get(c):e.individuals.find(u=>u?.id===c);l&&Wv(e,l)}}function S0(e,t,n){if(!qc(n?.id))return n;let s=Qi(n.id);if(!s)return ap(t,n);let o=Nl(e);return ap(t,n,{priorFor:r=>nc(s,o[r])})}function av(e,t,n){return n?.class===qt?_$(t,n):S0(e,t,n)}function Vs(e,t){let n=Bt(e);if(n){let o=n.individualsById.get(t.id);if(o)return Object.assign(o,av(e,o,t)),o.class===qt&&Dp(n.retractionsByGroup,o),o;if(e.individuals.push(t),n.individualsById.set(t.id,t),t.class===qt&&Dp(n.retractionsByGroup,t),t.class===Ze){let r=zt(t.id),i=n.factRecordsByGroup.get(r);i?i.push(t.id):n.factRecordsByGroup.set(r,[t.id])}return t}let s=e.individuals.findIndex(o=>o?.id===t.id);return s>=0?(e.individuals[s]=av(e,e.individuals[s],t),e.individuals[s]):(e.individuals.push(t),t)}function Tl(e,{predicate:t,prop:n},s){let o=e.objectProperties.find(c=>c?.prop===n);o||(o={predicate:t,prop:n,count:0,examples:[]},e.objectProperties.push(o));let r=n===xn?Bt(e):null;if(r){let c=r.statedByBySubject.get(s.subject);if(!c||!c.includes(s.object)){o.examples.push({...s,createdAt:s.createdAt||Gs()}),o.count=o.examples.length,c?c.push(s.object):r.statedByBySubject.set(s.subject,[s.object]);return}}let a=(o.examples||[]).find(c=>c?.subject===s.subject&&c?.object===s.object)?.createdAt||s.createdAt||Gs();if(o.examples=(o.examples||[]).filter(c=>!(c?.subject===s.subject&&c?.object===s.object)),o.examples.push({...s,createdAt:a}),o.count=o.examples.length,r){let c=r.statedByBySubject.get(s.subject)||[];c.includes(s.object)||c.push(s.object),r.statedByBySubject.set(s.subject,c)}}function $s(e){let t=[Qo,go,Ze,ps,ms];e.classes=(e.classes||[]).filter(n=>!t.includes(n?.name));for(let n of t){let s=e.individuals.filter(o=>o?.class===n);s.length&&e.classes.push({name:n,count:s.length,sample:s.slice(0,3).map(o=>o.label)})}}function E0(e,t,n=""){let s=`session:${t}`;return e.individuals.some(o=>o?.id===s)||e.individuals.push({id:s,label:String(t).slice(0,8),class:Qo,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:ut,key:"createdAt",value:n||Gs()},...n?[{prop:"mgx:sessionStarted",key:"started",value:n}]:[]]}),s}function Gv(e,{role:t,text:n,ts:s,sessionId:o,sessionStarted:r="",parsed:i=null,replyTo:a=null,createdAt:c=""}){if(!dL.has(t))throw new Error(`utterance role must be "visitor" or "tmct", got ${JSON.stringify(t)}`);if(!o)throw new Error("utterance needs a sessionId");let l=String(s||""),u=as(n),d=`utt:${o}#${l}#${t}`,p=Ol(u)||(t==="visitor"?"a-visitor-said":"a-tmct-said"),f=ec({doc:u}),m=e.individuals.find(w=>w?.id===d),h=om(m,c||l),b={id:d,label:p,class:go,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:"mgx:utteranceRole",key:"role",value:t},{prop:"mgx:utteranceText",key:"text",value:u},{prop:"mgx:utteranceTs",key:"ts",value:l},{prop:ut,key:"createdAt",value:h},...i!=null?[{prop:"mgx:utteranceParsed",key:"parsed",value:JSON.stringify(i)}]:[],...f.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:f.join(" ")}]:[]]};Vs(e,b);let g=E0(e,o,r);if(Tl(e,{predicate:"saidInSession",prop:Bp},{subject:d,object:g,subjectLabel:p,objectLabel:String(o).slice(0,8)}),a){let w=e.individuals.find(y=>y?.id===a);w&&Tl(e,{predicate:"inReplyTo",prop:Up},{subject:d,object:a,subjectLabel:p,objectLabel:w.label})}return l&&l>String(e.generated_at||"")&&(e.generated_at=l),d}async function x0(e,t){let n;return await Ks(e,s=>{n=Gv(s,t),$s(s)}),{id:n}}async function Vv(e,t){let n=[];return t?.length?(await Ks(e,s=>{for(let o of t)n.push(Gv(s,o));$s(s)}),{ids:n}):{ids:n}}async function j0(e,t){t?.length&&await Ks(e,n=>{for(let s of t)for(let o of rr(n,s.factId))Tl(n,{predicate:"canonicalisedFrom",prop:Wp},{subject:o,object:s.uttId,subjectLabel:s.factLabel,objectLabel:s.uttLabel})})}function rr(e,t){let n=Bt(e);return n?(n.factRecordsByGroup.get(t)||[]).slice():(e?.individuals||[]).filter(s=>s?.class===Ze&&zt(s.id)===t).map(s=>s.id)}function Kv(e,t,n,s=""){let o=mv(n);if(o.length===1&&o[0].sourceId===Ws&&rr(e,t).length)return[];let r=m0(e,t);if(r.length&&(o=o.filter(a=>!Zc(r,`${t}@${a.sourceId}`,ga(a.tags,s))),!o.length))return o;let i=k0(e,t);return i.length?o.filter(a=>!x$(i,a.sourceId)):o}function k0(e,t){let n=Bt(e),s=n?n.factRecordsByGroup.get(t):rr(e,t),o=[];for(let r of s||[]){if(!Us(r))continue;let i=yo(e,r);i&&o.push(i)}return o}function Hv(e,t,{quantifier:n,environments:s}){let o=rr(e,t).map(i=>yo(e,i)).filter(i=>i&&!(i.attributes||[]).some(a=>a?.prop===ha)),r=new Set;if(s){let i=o.filter(a=>(a.attributes||[]).some(c=>c?.prop==="mgx:factJustification"));for(let a of i.length?i:o)Fn(a,"mgx:factJustification","justification",s.map(c=>c.join(" ")).join(" | ")),r.add(a.id)}if(n)for(let i of o)(i.attributes||[]).some(a=>a?.prop==="mgx:factQuantifier")||(Fn(i,"mgx:factQuantifier","quantifier",n),r.add(i.id));return[...r]}function R0(e){let t=0,n=(e.attributes||[]).find(s=>s?.prop===El)?.value||"";for(let s of n.split(" ").filter(Boolean)){let o=/#v([1-9][0-9]*)$/.exec(s);o&&(t=Math.max(t,Number(o[1])))}return t+1}function am(e){if(!Array.isArray(e))return[];let t=new Set;for(let n of e){let s=as(n);s&&t.add(s)}return[...t].sort()}function qv(e,t){let{groupId:n,s,p:o,o:r,label:i,tokens:a,group:c,createdAt:l,observedAt:u,quantifier:d,environments:p,extraction:f=[]}=t,m=`${n}@${c.sourceId}`,h=Bt(e),b=h?h.individualsById.get(m):e.individuals.find(T=>T?.id===m),g=T=>(b?.attributes||[]).find(C=>C?.prop===T)?.value||"",w=g("mgx:factProvenance").split(" | ").filter(Boolean),y={assertedAt:jl(c.tags),observedAt:u},v=null,R=c.tags,S=y.assertedAt||l||Gs(),j=u,I=[],x=d,_=f;if(b){let T={assertedAt:jl(w),observedAt:g(da)};hL(y,T)?(v={head:b,id:`${m}#v${R0(b)}`},I=[v.id]):(R=[...new Set([...w,...c.tags])],S=g(ut)||S,j=u||g(da),I=g(El).split(" ").filter(Boolean),_=am([...g(xl).split(" "),...f])),x=d||g("mgx:factQuantifier")}return{candidate:{id:m,label:i,class:Ze,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"rdf:Statement"},{prop:"rdf:subject",key:"subject",value:s},{prop:"rdf:predicate",key:"predicate",value:o},{prop:"rdf:object",key:"object",value:r},{prop:ut,key:"createdAt",value:S},{prop:nr,key:"sourceId",value:c.sourceId},...R.length?[{prop:"mgx:factProvenance",key:"provenance",value:R.join(" | ")}]:[],...j?[{prop:da,key:"observedAt",value:j}]:[],..._.length?[{prop:xl,key:"extraction",value:_.join(" ")}]:[],...a.length?[{prop:"mgx:hasProseTokens",key:"prose_tokens",value:a.join(" ")}]:[],...x?[{prop:"mgx:factQuantifier",key:"quantifier",value:x}]:[],...p?[{prop:"mgx:factJustification",key:"justification",value:p.map(T=>T.join(" ")).join(" | ")}]:[],...I.length?[{prop:El,key:"supersedes",value:I.join(" ")}]:[]]},demote:v}}function _0(e,t){let n=`${t}@${Ws}`,s=Bt(e);if((s?!s.individualsById.has(n):!e.individuals.some(r=>r?.id===n))||(e.individuals=e.individuals.filter(r=>r?.id!==n),!s))return;s.individualsById.delete(n);let o=(s.factRecordsByGroup.get(t)||[]).filter(r=>r!==n);o.length?s.factRecordsByGroup.set(t,o):s.factRecordsByGroup.delete(t)}function Yv(e,{candidate:t,demote:n}){let s=[];if(t.id.endsWith(`@${Ws}`)||_0(e,zt(t.id)),n){let o={...n.head,id:n.id,attributes:(n.head.attributes||[]).map(r=>({...r}))};Fn(o,ha,"supersededBy",t.id),Vs(e,o),s.push(o.id)}return Vs(e,t),s.push(t.id),s}function yo(e,t){let n=Bt(e);return n?n.individualsById.get(t):e.individuals.find(s=>s?.id===t)}function cm(e,t){let n=new Set(t);if(!n.size)return;e.individuals=(e.individuals||[]).filter(o=>!n.has(o?.id));for(let o of e.objectProperties||[]){let r=o.examples||[],i=r.filter(a=>!n.has(a?.subject)&&!n.has(a?.object));i.length!==r.length&&(o.examples=i,o.count=i.length)}let s=Bt(e);if(s)for(let o of n){s.individualsById.delete(o),s.statedByBySubject.delete(o);let r=zt(o),i=(s.factRecordsByGroup.get(r)||[]).filter(a=>a!==o);i.length?s.factRecordsByGroup.set(r,i):s.factRecordsByGroup.delete(r)}}function Xv(e,t){let n=Bt(e),s=(n?n.factRecordsByGroup.get(t):rr(e,t))||[];if(s.length<8)return[];let o=new Map,r=new Map,i=new Map,a=new Map;for(let u of s.slice()){let d=yo(e,u);if(!d)continue;let p=w=>(d.attributes||[]).find(y=>y?.prop===w)?.value||"";if(Us(u)){i.set(Qi(u),d);continue}if(Zr(u)){a.set(p(nr),d);continue}let f=p("mgx:factProvenance"),m=fv(f),h=f.split(" | ").filter(Boolean),b={id:u,sourceId:p(nr)||m.id,assertedAt:ga(h,p(ut)),record:d};if(p(ha)){let w=r.get(b.sourceId);w?w.push(b):r.set(b.sourceId,[b]);continue}if(!m.type)continue;let g=o.get(m.type);g?g.push(b):o.set(m.type,[b])}let c=Nl(e),l=[];for(let[u,d]of o){let p=S$({groupId:t,sourceType:u,heads:d,existing:i.get(u)||null,priorFor:f=>nc(u,c[f])});if(p){Vs(e,p.rollup),l.push(...p.absorbed);for(let f of p.absorbedSourceIds){for(let h of r.get(f)||[])l.push(h.id);r.delete(f);let m=a.get(f);m&&l.push(m.id),a.delete(f)}}}for(let[u,d]of r){let p=E$({groupId:t,sourceId:u,leaves:d,existing:a.get(u)||null});if(!p)continue;Vs(e,p.rollup),l.push(...p.absorbed);let f=yo(e,p.rewire);f&&Fn(f,El,"supersedes",p.rollup.id)}return l}async function T0(e,{subject:t,predicate:n,object:s,provenance:o="",createdAt:r="",observedAt:i="",quantifier:a="",extraction:c,premiseTrusts:l,ruleConfidence:u}={}){let d=V(t),p=cs(n),f=V(s);if(!d||!p||!f)throw new Error("a fact needs subject, predicate and object");let m=Ko(d,p,f),h=`${d} ${p} ${f}`,b=ec({doc:h}),g=as(a),w=am(c);return await Ks(e,async y=>{let v=Kv(y,m,as(o),r);for(let R of v.length?[]:Hv(y,m,{quantifier:g}))si(y,yo(y,R),void 0,{premiseTrusts:l,ruleConfidence:u});for(let R of v){let S=qv(y,{groupId:m,s:d,p,o:f,label:Ol(h),tokens:b,group:R,createdAt:r,observedAt:i,quantifier:g,extraction:w});await wp(S.candidate);for(let j of Yv(y,S))si(y,yo(y,j),void 0,j===S.candidate.id?{premiseTrusts:l,ruleConfidence:u}:void 0)}cm(y,Xv(y,m)),$s(y)}),{id:m}}function A0(e){if(!Array.isArray(e))return;let t=e.some(Array.isArray)?e.filter(Array.isArray):[e],n=[],s=new Set;for(let o of t){let r=o.filter(a=>typeof a=="string"&&a);if(!r.length)continue;let i=[...r].sort().join(" ");s.has(i)||(s.add(i),n.push(r))}return n.length?n:void 0}async function Yn(e,t){let n=[],s=0;for(let r of t||[]){let i=V(r?.subject),a=cs(r?.predicate),c=V(r?.object);if(!i||!a||!c){s+=1;continue}let l=`${i} ${a} ${c}`;n.push({id:Ko(i,a,c),s:i,p:a,o:c,text:l,tokens:ec({doc:l}),provenance:as(r?.provenance),createdAt:r?.createdAt||"",observedAt:r?.observedAt||"",quantifier:as(r?.quantifier),extraction:am(r?.extraction),premiseTrusts:Array.isArray(r?.premiseTrusts)?r.premiseTrusts:void 0,ruleConfidence:typeof r?.ruleConfidence=="number"?r.ruleConfidence:void 0,environments:A0(r?.justification)})}let o=[];return n.length?(await Ks(e,r=>{let i=[],a=new Set,c=new Map;for(let u of n){let d=Kv(r,u.id,u.provenance,u.createdAt);for(let p of d.length?[]:Hv(r,u.id,{quantifier:u.quantifier,environments:u.environments}))a.has(p)||(a.add(p),i.push(p)),(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(p,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence});for(let p of d){let f=qv(r,{groupId:u.id,s:u.s,p:u.p,o:u.o,label:Ol(u.text),tokens:u.tokens,group:p,createdAt:u.createdAt,observedAt:u.observedAt,quantifier:u.quantifier,environments:u.environments,extraction:u.extraction});for(let m of Yv(r,f))a.has(m)||(a.add(m),i.push(m));(u.premiseTrusts!==void 0||u.ruleConfidence!==void 0)&&c.set(f.candidate.id,{premiseTrusts:u.premiseTrusts,ruleConfidence:u.ruleConfidence})}o.push(u.id)}for(let u of i)si(r,yo(r,u),void 0,c.get(u));let l=[];for(let u of new Set(o))l.push(...Xv(r,u));cm(r,l),$s(r)}),{ids:o,appended:o.length,skipped:s}):{ids:o,appended:0,skipped:s}}async function Ml(e,{name:t,kind:n,slots:s,provenance:o="",createdAt:r=""}={}){let i=Jv[n];if(!i)throw new Error(`a rule kind must be one of ${C0.join(", ")}, got ${JSON.stringify(n)}`);let a=V(t);if(!a)throw new Error("a rule needs a name");let c=I0[n]||new Set,l=i.map(([f])=>V(s?.[f])),u=i.filter(([f],m)=>!c.has(f)&&!l[m]);if(u.length)throw new Error(`a ${n} rule needs ${u.map(([f])=>f).join(" + ")}`);if(n===ya){let f=l[i.findIndex(([h])=>h==="objectRole")],m=l[i.findIndex(([h])=>h==="value")];if(!f&&!m)throw new Error(`a ${n} rule needs an objectRole or a value`)}let d=O0(n,a,l),p=Ol(`${a} = ${n}(${l.join(", ")})`);return await Ks(e,async f=>{let m=f.individuals.find(y=>y?.id===d),h=m?.attributes?.find(y=>y?.prop==="mgx:factProvenance")?.value||"",b=[...new Set([...h.split(" | "),as(o)].filter(Boolean))],g=om(m,r),w={id:d,label:p,class:ms,derived_from:[],mentions:[],attributes:[{prop:"rdf:type",key:"type",value:"owl:NamedIndividual"},{prop:Pl,key:"ruleName",value:a},{prop:ii,key:"ruleKind",value:n},...i.map(([y,v],R)=>({prop:v,key:y,value:l[R],skip:!l[R]&&c.has(y)})).filter(y=>!y.skip).map(({skip:y,...v})=>v),{prop:ut,key:"createdAt",value:g},...b.length?[{prop:"mgx:factProvenance",key:"provenance",value:b.join(" | ")}]:[]]};await wp(w),Vs(f,w),si(f,f.individuals.find(y=>y?.id===d)),$s(f)}),{id:d}}function fm(e,t){let n=V(t);return(e?.individuals||[]).find(s=>s?.class===ms&&(s.attributes||[]).find(o=>o?.prop===Pl)?.value===n)}function N0(e,t){let n=V(t),s=o=>(o.attributes||[]).find(r=>r?.prop===ii)?.value||"";return(e?.individuals||[]).filter(o=>o?.class===ms&&(o.attributes||[]).find(r=>r?.prop===Pl)?.value===n).sort((o,r)=>s(o).localeCompare(s(r))||String(o.id).localeCompare(String(r.id)))}function Fl(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==ms)continue;let s=a=>(n.attributes||[]).find(c=>c?.prop===a)?.value,o=s(ii),r=Jv[o];if(!r)continue;let i={};for(let[a,c]of r)i[a]=s(c)??"";t.push({id:n.id,name:s(Pl)||"",kind:o,slots:i,provenance:s("mgx:factProvenance")||""})}return t.sort((n,s)=>n.name.localeCompare(s.name)||n.kind.localeCompare(s.kind)||String(n.id).localeCompare(String(s.id))),t}async function pm(e,t,n,s,o){let{relationFactsFor:r,renderFactLine:i,factPhrase:a,factTermVariants:c,byTrust:l,rows:u,HAS_PROPERTY_PREDICATE:d,findActionPath:p}=o,f=String(t||"").trim().toLowerCase(),m=c(V,n),h=c(V,s),b=r(f).filter(y=>m.has(y.fact.subject)&&h.has(y.fact.object));if(b.length){let y=b.slice().sort((v,R)=>l(v.fact,R.fact))[0];return{citation:[i(y.fact),...y.aliasFacts.map(v=>`${a(v)}${v.provenance?` (source: ${v.provenance})`:""}`)]}}let g=fm(e,f),w=g?.attributes?.find(y=>y.prop===ii)?.value;if(g&&w===ba){let y=g.attributes.find(C=>C.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(C=>C.prop==="mgx:ruleBase2")?.value,R=V(n),S=V(s);if(!y||!v||!R||!S)return null;let _=p({entity:R,hopsTaken:0},C=>C.hopsTaken===2&&C.entity===S,C=>{if(C.hopsTaken>=2)return[];let E=C.hopsTaken===0?y:v;return r(E).filter(k=>k.fact.subject===C.entity).map(k=>({action:k,nextState:{entity:k.fact.object,hopsTaken:C.hopsTaken+1}}))},{maxDepth:2,stateKey:C=>`${C.entity}#${C.hopsTaken}`});if(!_)return null;let $=new Set,T=[];for(let C of _.actions){T.push(i(C.fact));for(let E of C.aliasFacts){let k=E.id||`${E.subject}|${E.predicate}|${E.object}`;$.has(k)||($.add(k),T.push(`${a(E)}${E.provenance?` (source: ${E.provenance})`:""}`))}}return{citation:T}}if(g&&w===wa){let y=g.attributes.find(x=>x.prop==="mgx:ruleBase1")?.value,v=g.attributes.find(x=>x.prop==="mgx:ruleFilterProperty")?.value;if(!y||!v)return null;let R=await pm(e,y,n,s,o);if(!R)return null;let S=V(n),j=V(v),I=u.find(x=>x.predicate===d&&x.subject===S&&V(x.object)===j);return I?{citation:[...R.citation,i(I)]}:null}return null}async function Qv(e,t,n,s){let{relationFactsFor:o,renderFactLine:r,factPhrase:i,factTermVariants:a,byTrust:c,rows:l,HAS_PROPERTY_PREDICATE:u,findReachableSet:d}=s,p=String(t||"").trim().toLowerCase(),f=a(V,n),m=o(p).filter(g=>f.has(g.fact.object));if(m.length){let g=new Map;for(let w of m)g.has(w.fact.subject)||g.set(w.fact.subject,[]),g.get(w.fact.subject).push(w);return[...g.entries()].map(([w,y])=>{let v=y.slice().sort((R,S)=>c(R.fact,S.fact))[0];return{subject:w,citation:[r(v.fact),...v.aliasFacts.map(R=>`${i(R)}${R.provenance?` (source: ${R.provenance})`:""}`)]}})}let h=fm(e,p),b=h?.attributes?.find(g=>g.prop===ii)?.value;if(h&&b===ba){let g=h.attributes.find(j=>j.prop==="mgx:ruleBase1")?.value,w=h.attributes.find(j=>j.prop==="mgx:ruleBase2")?.value,y=V(n);return!g||!w||!y?[]:d({entity:y,hopsTaken:0},j=>{if(j.hopsTaken>=2)return[];let I=j.hopsTaken===0?w:g;return o(I).filter(x=>x.fact.object===j.entity).map(x=>({action:x,nextState:{entity:x.fact.subject,hopsTaken:j.hopsTaken+1}}))},{maxDepth:2,stateKey:j=>`${j.entity}#${j.hopsTaken}`}).filter(j=>j.node.hopsTaken===2).map(({node:j,path:I})=>{let x=new Set,_=[];for(let $ of I.actions.slice().reverse()){_.push(r($.fact));for(let T of $.aliasFacts){let C=T.id||`${T.subject}|${T.predicate}|${T.object}`;x.has(C)||(x.add(C),_.push(`${i(T)}${T.provenance?` (source: ${T.provenance})`:""}`))}}return{subject:j.entity,citation:_}})}if(h&&b===wa){let g=h.attributes.find(S=>S.prop==="mgx:ruleBase1")?.value,w=h.attributes.find(S=>S.prop==="mgx:ruleFilterProperty")?.value;if(!g||!w)return[];let y=await Qv(e,g,n,s),v=V(w),R=[];for(let S of y){let j=V(S.subject),I=l.find(x=>x.predicate===u&&x.subject===j&&V(x.object)===v);I&&R.push({subject:S.subject,citation:[...S.citation,r(I)]})}return R}return[]}function mt(e,t={}){return eS(e,Dl(e),t)}async function Zv(e){if(!ri(e))return mt(await ct(e));let t=e.storeWrites||0;if(e.heldFactRows&&e.heldFactRowsStamp===t)return e.heldFactRows;let n=mt(await ct(e));return(e.storeWrites||0)===t&&(e.heldFactRows=n,e.heldFactRowsStamp=t),n}function eS(e,t,n={}){let s=yv(e),o=[];for(let[r,i]of t.groups){let a=mm(r,i,t),c=s?.get(r);a.trust=sc(c?c.inputs:a.assertions,n).score,o.push(a)}return o}function Dl(e,{pairs:t=null,scopedGroups:n=new Set}={}){let s=e?.individuals||[],o=Bt(e),r=o?o.sourcesById:new Map(s.filter(b=>b?.class===ps).map(b=>[b.id,b])),i=o?.statedByBySubject;if(!i){let b=(e?.objectProperties||[]).find(g=>g?.prop===xn);i=new Map;for(let g of b?.examples||[])i.has(g.subject)||i.set(g.subject,[]),i.get(g.subject).push(g.object)}let a=t?new Set([...t].map(b=>b.slice(0,b.indexOf("\0")))):null,c=b=>{if(!t||n.has(zt(b.id)))return!1;let g=ws(b,"subject");return a.has(g)?!t.has(fa(g,ws(b,"predicate"))):!0},l=new Map,u=new Map;for(let b of s){if(b?.class===qt){let y=zt(b.id),v=u.get(y);v?v.push(b):u.set(y,[b]);continue}if(b?.class!==Ze||(b.attributes||[]).some(y=>y?.prop===ha)||Zr(b.id)||c(b))continue;let g=zt(b.id),w=l.get(g);w?w.push(b):l.set(g,[b])}for(let[b,g]of u){let w=l.get(b);if(!w)continue;let y=w.filter(v=>!Zc(g,v.id,ga(bs(v,"mgx:factProvenance").split(" | ").filter(Boolean),bs(v,ut))));y.length!==w.length&&(y.length?l.set(b,y):l.delete(b))}for(let b of l.values())b.sort((g,w)=>g.id<w.id?-1:g.id>w.id?1:0);let d=new Map,p=b=>{let g=d.get(b);return g===void 0&&(g=(r.get(b)?.attributes||[]).find(w=>w?.prop==="mgx:sourceType")?.value||"",d.set(b,g)),g},f=new Map,m=b=>{let g=f.get(b);return g===void 0&&(g=jl(b.split(" | ").filter(Boolean)),f.set(b,g)),g},h=null;return{groups:l,get groupsByPair(){if(h)return h;h=new Map;for(let[b,g]of l){let w=fa(ws(g[0],"subject"),ws(g[0],"predicate")),y=h.get(w);y?y.push(b):h.set(w,[b])}return h},statedByRecord:i,sourceTypeOf:p,embeddedTimestampOf:m}}function L0(e){let t="",n="",s="",o="",r="",i="",a="",c="";for(let l of e?.attributes||[]){switch(l?.prop){case"mgx:factProvenance":t=l.value||"";continue;case ut:n=l.value||"";continue;case da:s=l.value||"";continue;case xl:o=l.value||"";continue;case Ir:r=l.value||"";continue;case nr:i=l.value||"";continue;default:break}l?.key==="quantifier"?a=l.value||"":l?.key==="justification"&&(c=l.value||"")}return{provenance:t,createdAt:n,observedAt:s,extraction:o,trustScore:r,sourceId:i,quantifier:a,justification:c}}function mm(e,t,n){let{statedByRecord:s,sourceTypeOf:o}=n,r=bs,i=ws,a=[],c=[],l=[],u=new Set,d=new Set,p=[],f=new Set,m="";for(let g of t){if(Us(g.id)){let _=Qi(g.id),$=Zi(g);for(let T of $)c.includes(T)||(c.push(T),_&&l.push(_));a.push({id:g.id,sourceId:"",sourceType:_,provenance:"",createdAt:r(g,us),ownTrust:Number(r(g,Qr))||0,assertedAt:r(g,ds),rollup:{count:Number(r(g,Ji))||$.length,sourceIds:$,earliest:r(g,us),latest:r(g,ds)}});continue}let w=L0(g),y=w.provenance.split(" | ").filter(Boolean);for(let _ of y)u.add(_);let[v]=s.get(g.id)||[],R=v||w.sourceId,S=o(R);v&&!c.includes(v)&&(c.push(v),S&&l.push(S));let j=w.createdAt,I=w.observedAt,x=w.extraction?w.extraction.split(" ").filter(Boolean):[];for(let _ of x)d.add(_);a.push({id:g.id,sourceId:R,sourceType:S,provenance:y.join(" | "),createdAt:j,...I?{observedAt:I}:{},...x.length?{extraction:x}:{},ownTrust:Number(w.trustScore)||0,assertedAt:n.embeddedTimestampOf(w.provenance)||(Number.isFinite(Date.parse(j))?j:"")}),m=m||w.quantifier;for(let _ of w.justification.split(" | ")){let $=_.split(" ").filter(Boolean);if(!$.length)continue;let T=$.join(" ");f.has(T)||(f.add(T),p.push($))}}let h=[],b=new Set;for(let g of p)for(let w of g)b.has(w)||(b.add(w),h.push(w));return{id:e,subject:i(t[0],"subject"),predicate:i(t[0],"predicate"),object:i(t[0],"object"),provenance:[...u].sort().join(" | "),quantifier:m,sourceIds:c,sourceTypes:l,...d.size?{extraction:[...d].sort()}:{},environments:p,justification:h,assertions:a}}function P0(e){let t=bs(e,nr);if(t)return t;let n=String(e?.id||""),s=n.indexOf("@");if(s<0)return"";let o=n.slice(s+1),r=o.indexOf("#");return r<0?o:o.slice(0,r)}async function tS(e,t,{provenance:n="",retractedAt:s=""}={}){let o=new Set((t||[]).filter(Boolean)),r=[],i=[];if(!o.size)return{removed:r,records:i};let a=s||Gs();return await Ks(e,c=>{let l=new Set,u=new Set,d=new Map;c.individuals=(c.individuals||[]).filter(p=>{if(p?.class!==Ze)return!0;let f=zt(p.id),m=o.has(p.id)?p.id:o.has(f)?f:"";if(!m)return!0;u.add(m),l.add(p.id);let h=P0(p),b=`${f}\0${h}`,g=bs(p,"mgx:factProvenance"),w=d.get(b);return w?(w.ids.push(p.id),g&&w.tags.push(g)):d.set(b,{groupId:f,sourceId:h,ids:[p.id],tags:g?[g]:[],template:{label:p.label||"",subject:bs(p,"rdf:subject"),predicate:bs(p,"rdf:predicate"),object:bs(p,"rdf:object")}}),!1});for(let p of u)r.push(p);if(r.length){for(let p of l)i.push(p);for(let p of c.objectProperties||[]){let f=p.examples||[];p.examples=f.filter(m=>!l.has(m?.subject)&&!l.has(m?.object)),p.count=p.examples.length}for(let p of d.values()){let f=R$({groupId:p.groupId,sourceId:p.sourceId,recordIds:p.ids,retractedAt:a,template:p.template,provenance:[...p.tags,n].filter(Boolean).join(" | ")});f&&Vs(c,f)}$s(c)}}),{removed:r,records:i}}function M0(e){let t=[];for(let n of e?.individuals||[]){if(n?.class!==qt)continue;let s=el(n);s&&t.push(s)}return t.sort((n,s)=>n.id<s.id?-1:n.id>s.id?1:0)}async function F0(e,t){let n=[];for(let o of t||[]){let r=tl(o);r&&n.push(r)}let s=[];return n.length?(await Ks(e,o=>{let r=new Map;for(let a of n){let c=Vs(o,a),l=zt(c.id),u=r.get(l);u?u.push(c):r.set(l,[c])}let i=new Set;for(let[a,c]of r)for(let l of rr(o,a)){let u=yo(o,l);if(!u)continue;let d=bs(u,"mgx:factProvenance").split(" | ").filter(Boolean);Zc(c,l,ga(d,bs(u,ut)))&&i.add(l)}if(i.size){cm(o,i);for(let a of i)s.push(a)}$s(o)}),{merged:n.length,removed:s}):{merged:0,removed:s}}function D0(e,{self:t="",acknowledgedBy:n=null}={}){let s=nl(mt(e)),o=[];for(let r of e?.individuals||[])r?.class===qt&&r.id&&o.push(r.id);return{roster:s,retirable:sl({recordIds:o,roster:s,self:t,acknowledgedBy:n})}}async function z0(e,t){let n=new Set((t||[]).filter(Boolean)),s=[];return n.size?(await Ks(e,o=>{let r=new Set;if(o.individuals=(o.individuals||[]).filter(a=>a?.class!==qt||!n.has(a.id)?!0:(r.add(a.id),!1)),!r.size)return;for(let a of r)s.push(a);let i=Bt(o);if(i)for(let a of r){i.individualsById.delete(a);let c=zt(a),l=(i.retractionsByGroup.get(c)||[]).filter(u=>!r.has(u.id));l.length?i.retractionsByGroup.set(c,l):i.retractionsByGroup.delete(c)}$s(o)}),{retired:s}):{retired:s}}function nS(e,{floor:t=B0,factRows:n=null}={}){let s=(n||mt(e)).filter(i=>i.trust>=t),o=new Map;for(let i of s){if(Vc(i.predicate)===Qf)continue;let a=`${i.subject} ${i.predicate}`;o.has(a)||o.set(a,[]),o.get(a).push(i)}let r=[];for(let i of o.values()){if(new Set(i.map(c=>c.object)).size<2)continue;let a=Vc(i[0].predicate);a!==Zf&&!tp(i,a).contested||r.push(i.slice().sort((c,l)=>l.trust-c.trust||c.object.localeCompare(l.object)))}return r.sort((i,a)=>`${i[0].subject} ${i[0].predicate}`.localeCompare(`${a[0].subject} ${a[0].predicate}`))}var oi,zp,go,Ze,Qo,ps,ms,Bp,Up,uL,xn,Wp,cv,Sl,Ip,lv,dL,nv,fL,Op,Gp,Vp,uv,pL,Ws,da,nr,El,ha,xl,gv,bs,ws,fa,bv,yv,wL,vv,sv,Ev,xv,jv,kv,Mn,sr,bo,Jp,wo,KL,Qp,Zp,HL,t0,Fv,Mp,o0,tr,i0,nm,Dv,sm,zv,Fp,Bt,Ol,Gs,im,vl,ba,wa,lm,um,Ll,ya,dm,C0,Pl,ii,Jv,I0,O0,B0,ai,U0,W0,Ue=M(()=>{Lt();Qe();Kn();Ye();Ye();Cn();f$();Cn();Gc();cp();mp();bp();yp();ia();ia();xp();cp();mp();bp();yp();oi=ne(".tmct","memory"),zp=ne(oi,"graph.json"),go="Utterance",Ze="Fact",Qo="Session",ps="Source",ms="Rule",Bp="mgx:saidInSession",Up="mgx:inReplyTo",uL="mgx:derivedFrom",xn="mgx:statedBy",Wp="mgx:canonicalisedFrom",cv="mgx:sourceReliability",Sl="src:operator-chat",Ip="src:teach-chat",lv="src:teach-node",dL=new Set(["visitor","tmct"]),nv=48,fL=[{prop:"rdf:type",note:"rdf-ish typing attribute: owl:NamedIndividual (utterances/sessions) or rdf:Statement (reified facts)"},{prop:"mgx:utteranceRole",note:"who said it: visitor (an a-visitor-said item) or tmct (the response alongside it)"},{prop:"mgx:utteranceText",note:"the utterance's normalized text (capped)"},{prop:"mgx:utteranceTs",note:"when it was said, ISO-8601 (the chat turn timestamp)"},{prop:"mgx:utteranceParsed",note:"optional JSON of the parse the interpretation pipeline produced for this request"},{prop:Bp,predicate:"saidInSession",note:"Utterance \u2192 Session it was said in; runtime observation, owned (no SEON term)"},{prop:Up,predicate:"inReplyTo",note:"tmct Utterance \u2192 the visitor Utterance it answers (the Q/A pairing)"},{prop:"rdf:subject",note:"reified fact: the triple's subject term"},{prop:"rdf:predicate",note:"reified fact: the triple's predicate term"},{prop:"rdf:object",note:"reified fact: the triple's object term"},{prop:"mgx:factProvenance",note:"LEGACY COMPAT SHIM: the ' | '-joined provenance tag string a fact came from; the source-of-truth is now the mgx:statedBy edges derived from it"},{prop:"mgx:sourceId",note:"the assertion key a Fact record is filed under \u2014 the Source id of the ONE party asserting it, which is also the @-suffix of the record's own id. `src:none` when no tag names a Source, so every record has a key rather than a hole"},{prop:"mgx:observedAt",note:"OPTIONAL valid time: when the asserting party WITNESSED the claim, as against mgx:createdAt's transaction time (when this store recorded it). A stale article read today loses to an eyewitness report from yesterday. Stored only when a caller supplies one \u2014 never fabricated, never backfilled"},{prop:"mgx:extractionFinding",note:"OPTIONAL: the space-joined structural findings the extractor recorded about how THIS assertion's sentence was read, from the closed vocabulary identifier-token | clause-fallback | pronoun-carry | definitional-frame. Per assertion, never per triple: a later clean re-assertion of the same triple carries none. Absence means no findings were recorded, never that the sentence was checked and read cleanly"},{prop:"mgx:supersedes",note:"the record id(s) this one replaced when its own source re-asserted the triple with a newer embedded timestamp. A space-joined LIST; absent, never empty, until the first supersession"},{prop:"mgx:supersededBy",note:"the record id(s) that replaced this one. Its presence is what makes a record a demoted leaf rather than a live head, and the group fold skips it: a source's past belief is not a second vote for the present one. A LIST, because one source with two live replicas can fork before they sync"},{prop:"mgx:factQuantifier",note:"OPTIONAL: the quantifier word a plural class-membership teach used ('every'/'some'/'a few'), for literal recall by 'how many Xs are Ys' \u2014 never real cardinality counting"},{prop:"mgx:factJustification",note:"an entailed Fact's supporting premise fact ids: ' | '-separated environments, one space-separated premise-id list per independent derivation, capped by syllogise's maxEnvironments knob; a value with no ' | ' is a single environment"},{prop:"mgx:ruleName",note:"a taught Rule's own name (e.g. 'grandparent') \u2014 the query-dispatcher's lookup key, PLAN_TAUGHT_RELATIONS.md \xA72/\xA73"},{prop:"mgx:ruleKind",note:"a taught Rule's SHAPE tag \u2014 the closed vocabulary compose2 | filter | recursive (structural, like 'Fact'/'Rule' themselves, never a domain word)"},{prop:"mgx:ruleBase1",note:"compose2: the first hop's base relation name; filter: the base rule/relation being filtered (same 'base relation' role in both kinds, so the name is shared)"},{prop:"mgx:ruleBase2",note:"compose2 only: the second hop's base relation name"},{prop:"mgx:ruleFilterProperty",note:"filter only: the property literal candidates are filtered by (an mgx:hasProperty-shaped Fact lookup)"},{prop:"mgx:ruleBaseCase",note:"recursive only: the base-case relation name (hop zero)"},{prop:"mgx:ruleRecStep",note:"recursive only: the self-referential recursive-step relation name"},{prop:ut,note:"when an individual was FIRST written, ISO-8601 (first-write-wins on upsert); the audit 'when', the recency input to trust, the novelty signal"},{prop:Rs,note:"an audit / last-modified stamp: when an individual's OWN attributes were last mutated in place (upsertSession, recomputeFactTrust, recomputeSourceReliability) \u2014 most individuals never carry it at all. NOT transaction time: a mutable stamp cannot record when the previous version stopped being current, so tmct is not bitemporal"},{prop:uL,predicate:"derivedFrom",note:"umbrella: a Fact derived from a Source (or another Fact). ext ref prov:wasDerivedFrom (UNVERIFIED-pending-web-check)"},{prop:xn,predicate:"statedBy",note:"subPropertyOf derivedFrom: a Source directly asserts this Fact (one edge per independent source \u2014 replaces the factProvenance union)"},{prop:Wp,predicate:"canonicalisedFrom",note:"subPropertyOf derivedFrom: a canonical Fact cleaned from a raw Block/Source, never replacing it"},{prop:"mgx:sourceType",note:"a Source's kind: operator | teach | provider | corpus | corpusWeak | reference | referenceLive | extracted | optimisticExtract | web | entailed (the trust-prior key)"},{prop:"mgx:sourceUrl",note:"a web Source's URL"},{prop:"mgx:sourceRule",note:"an entailed Source's rule id"},{prop:"mgx:sourceReliability",note:"actor-level (session-scoped) trust nudge in [0.5,1.5], neutral 1.0 when absent \u2014 materialised by recomputeSourceReliability from a session's asserted-vs-contradicted track record (memory/trust.mjs's sessionReliabilityFrom); folds into computeTrust's per-source prior"},{prop:Ir,note:"materialised trust cache in [0,1] \u2014 pure function of a fact's Sources + createdAt (memory/trust.mjs); invalidated when a statedBy edge is added"},{prop:tc,note:"JSON of the inputs the trust score was computed from (source-type multiset, corroboration count, createdAt, recency) \u2014 makes the score auditable"},{prop:"mgx:hasProseTokens",note:"prose tokens (prose.mjs tokenizer) backing the payload's proseIndex"},{prop:"mgx:sessionStarted",note:"session anchor: when the session started, ISO-8601"},{prop:"rdf:predicate",prefix:zc,note:"a reified fact's predicate carries its POLARITY: mgxneg:capableOf is the negative twin of mgx:capableOf ('a penguin cannot fly'). Polarity cannot be a separate property \u2014 the fact id hashes (subject, predicate, object), so both polarities would share one id and union their statedBy edges (memory/capability.mjs)"}];Op=e=>ua(e),Gp="memory",Vp="sqlite",uv="row";pL=`
108
108
  CREATE TABLE IF NOT EXISTS meta (k TEXT PRIMARY KEY, v TEXT NOT NULL);
109
109
  CREATE TABLE IF NOT EXISTS individuals (id TEXT PRIMARY KEY, ord INTEGER NOT NULL, class TEXT, label TEXT, json TEXT NOT NULL);
110
110
  CREATE TABLE IF NOT EXISTS relations (prop TEXT PRIMARY KEY, ord INTEGER NOT NULL, predicate TEXT, count INTEGER);
@@ -143,93 +143,93 @@ CREATE TABLE IF NOT EXISTS fact_object_supersessions (
143
143
  recorded_at TEXT NOT NULL,
144
144
  PRIMARY KEY (subject, predicate, ord)
145
145
  );
146
- `,Bs="src:none",ca="mgx:observedAt",tr="mgx:sourceId",bl="mgx:supersedes",da="mgx:supersededBy",wl="mgx:extractionFinding";Z$="INSERT OR REPLACE INTO facts(id, triple_hash, subject, predicate, object, source_id, source_type, trust_score, created_at, observed_at, superseded_by, json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";ms=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",hs=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",la=(e,t)=>`${e}\0${t}`;ev=Symbol("materialised fact_heads index");nv=e=>e?.[ev]||null,JN="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";ov=new Set(["subject","object","subjectLabel","objectLabel"]),z$=!1;iv="memory",av="prefixes",cv="syllogiseState",lv="nodeId";Nn=e=>e===void 0?e:structuredClone(e);nr="edge-group",go="edge-group:",Vp=new Map([[et,"fact"],[us,"source"],[ho,"utterance"],[Jo,"session"],[ds,"rule"],[Yt,"retraction"]]),bo="unmapped_rows",jL=`CREATE TABLE IF NOT EXISTS ${bo} (
146
+ `,Ws="src:none",da="mgx:observedAt",nr="mgx:sourceId",El="mgx:supersedes",ha="mgx:supersededBy",xl="mgx:extractionFinding";gv="INSERT OR REPLACE INTO facts(id, triple_hash, subject, predicate, object, source_id, source_type, trust_score, created_at, observed_at, superseded_by, json) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";bs=(e,t)=>(e?.attributes||[]).find(n=>n?.prop===t)?.value||"",ws=(e,t)=>(e?.attributes||[]).find(n=>n?.key===t)?.value||"",fa=(e,t)=>`${e}\0${t}`;bv=Symbol("materialised fact_heads index");yv=e=>e?.[bv]||null,wL="INSERT OR REPLACE INTO fact_heads(triple_hash, trust_base, inputs_json, updated_at) VALUES (?, ?, ?, ?)";vv=new Set(["subject","object","subjectLabel","objectLabel"]),sv=!1;Ev="memory",xv="prefixes",jv="syllogiseState",kv="nodeId";Mn=e=>e===void 0?e:structuredClone(e);sr="edge-group",bo="edge-group:",Jp=new Map([[Ze,"fact"],[ps,"source"],[go,"utterance"],[Qo,"session"],[ms,"rule"],[qt,"retraction"]]),wo="unmapped_rows",KL=`CREATE TABLE IF NOT EXISTS ${wo} (
147
147
  row_key TEXT PRIMARY KEY, row_class TEXT NOT NULL, term TEXT NOT NULL, json TEXT NOT NULL, expires_at INTEGER
148
- )`,Kp="SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Hp=(e,t)=>`{"ord":${e},"individual":${t}}`,kL=/^\{"ord":(-?\d+),/;NL=Object.freeze(["meta","individuals","relations","edges","facts","fact_heads","fact_object_supersessions"]);vv=ne(ti,"manifest.json"),Cp=5,ML=e=>ne(e,vv);er=e=>BL(zL(e)),DL=/^fact:[0-9a-f]{8}$/;Xp=ne(ti,"syllogise-state.json"),Sv="syllogiseState";Jp=ne(ti,"node-id.json"),Ev="nodeId";Ip=Symbol("mutateMemory lookup index");Ut=e=>e?.[Ip]||null;_l=e=>e.length>D$?e.slice(0,D$-1)+"\u2026":e,Us=()=>new Date().toISOString();em=e=>String(e).replace(/^src:/,"");hl=e=>typeof e=="string"&&(e.startsWith(`${gl}:`)||e.startsWith(`${kp}:`)||e.startsWith(`${K$}:`));pa="compose2",ma="filter",sm="recursive",om="action-signature",Al="action-precond",ha="action-effect",rm="action-constraint",u0=Object.freeze([pa,ma,sm,om,Al,ha,rm]),Cl="mgx:ruleName",ni="mgx:ruleKind",Nv={[pa]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[ma]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[sm]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[om]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Al]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[ha]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[rm]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},d0={[Al]:new Set(["value","negate"]),[ha]:new Set(["objectRole","value"])},f0=(e,t,n)=>`rule:${Ui([e,t,...n].join("\0"))}`;$0=.5,si="mgx:hasA",v0="mgx:capableOf",S0=Hf});async function Mn(e,t=null){try{if(t)return St(await mt(t));let{dir:n,close:s}=await yo($e($e(e.graphFile)));try{return St(await mt(n))}finally{await s()}}catch{return[]}}function zv(e){let t=[...new Set(e.map(s=>s.provenance).filter(Boolean))];return t.length?`provenance: ${t.slice(0,2).join("; ")}${t.length>2?`, +${t.length-2} more source(s)`:""}`:"provenance: memory/corpus facts"}function Ll(e,t){let n=V(t),s=e.filter(a=>Dv.has(a.predicate)&&a.object===n);if(!s.length)return null;let o=[...new Set(s.map(a=>a.subject))].sort(),r=o.slice(0,rr),i=o.length>rr?`
149
- \u2026+${o.length-rr} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
148
+ )`,Qp="SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Zp=(e,t)=>`{"ord":${e},"individual":${t}}`,HL=/^\{"ord":(-?\d+),/;t0=Object.freeze(["meta","individuals","relations","edges","facts","fact_heads","fact_object_supersessions"]);Fv=ne(oi,"manifest.json"),Mp=5,o0=e=>ne(e,Fv);tr=e=>c0(a0(e)),i0=/^fact:[0-9a-f]{8}$/;nm=ne(oi,"syllogise-state.json"),Dv="syllogiseState";sm=ne(oi,"node-id.json"),zv="nodeId";Fp=Symbol("mutateMemory lookup index");Bt=e=>e?.[Fp]||null;Ol=e=>e.length>nv?e.slice(0,nv-1)+"\u2026":e,Gs=()=>new Date().toISOString();im=e=>String(e).replace(/^src:/,"");vl=e=>typeof e=="string"&&(e.startsWith(`${Sl}:`)||e.startsWith(`${Ip}:`)||e.startsWith(`${lv}:`));ba="compose2",wa="filter",lm="recursive",um="action-signature",Ll="action-precond",ya="action-effect",dm="action-constraint",C0=Object.freeze([ba,wa,lm,um,Ll,ya,dm]),Pl="mgx:ruleName",ii="mgx:ruleKind",Jv={[ba]:[["base1","mgx:ruleBase1"],["base2","mgx:ruleBase2"]],[wa]:[["base","mgx:ruleBase1"],["property","mgx:ruleFilterProperty"]],[lm]:[["baseCase","mgx:ruleBaseCase"],["recStep","mgx:ruleRecStep"]],[um]:[["subjectClass","mgx:ruleActionSubjectClass"],["targetClass","mgx:ruleActionTargetClass"]],[Ll]:[["shape","mgx:ruleActionPrecondShape"],["predicate","mgx:ruleActionPrecondPredicate"],["role","mgx:ruleActionPrecondRole"],["scope","mgx:ruleActionPrecondScope"],["value","mgx:ruleActionPrecondValue"],["negate","mgx:ruleActionPrecondNegate"]],[ya]:[["predicate","mgx:ruleActionEffectPredicate"],["subjectRole","mgx:ruleActionEffectSubject"],["objectRole","mgx:ruleActionEffectObject"],["value","mgx:ruleActionEffectValue"]],[dm]:[["left","mgx:ruleActionConstraintLeft"],["right","mgx:ruleActionConstraintRight"],["guard","mgx:ruleActionConstraintGuard"]]},I0={[Ll]:new Set(["value","negate"]),[ya]:new Set(["objectRole","value"])},O0=(e,t,n)=>`rule:${Ki([e,t,...n].join("\0"))}`;B0=.5,ai="mgx:hasA",U0="mgx:capableOf",W0=ep});async function zn(e,t=null){try{if(t)return mt(await ct(t));let{dir:n,close:s}=await $o($e($e(e.graphFile)));try{return mt(await ct(n))}finally{await s()}}catch{return[]}}function oS(e){let t=[...new Set(e.map(s=>s.provenance).filter(Boolean))];return t.length?`provenance: ${t.slice(0,2).join("; ")}${t.length>2?`, +${t.length-2} more source(s)`:""}`:"provenance: memory/corpus facts"}function zl(e,t){let n=V(t),s=e.filter(a=>sS.has(a.predicate)&&a.object===n);if(!s.length)return null;let o=[...new Set(s.map(a=>a.subject))].sort(),r=o.slice(0,ir),i=o.length>ir?`
149
+ \u2026+${o.length-ir} more`:"";return`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts. ${o.length} known subclass(es):
150
150
  ${r.join(`
151
151
  `)}${i}
152
- (${zv(s)})`}function Pl(e,t){let n=V(t),s=e.filter(a=>Dv.has(a.predicate)&&(a.subject===n||a.object===n));if(!s.length)return null;let o=[...new Set(s.filter(a=>a.subject===n).map(a=>a.object))],r=[...new Set(s.filter(a=>a.object===n).map(a=>a.subject))].sort(),i=[`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts.`];if(o.length&&i.push(`is a: ${o.slice(0,rr).join(", ")}`),r.length){let a=r.length>rr?`, +${r.length-rr} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,rr).join(", ")}${a}`)}return i.push(`(${zv(s)})`),i.join(`
153
- `)}var Dv,rr,ir=P(()=>{Qe();We();Dv=new Set(["rdfs:subClassOf","rdf:type"]),rr=40});async function Bv(e,{graph:t,svc:n,config:s}){let o=pt(e,"symbol"),{match:r,candidates:i}=wn(n.graph,o);if(r)return $d(t,r,{candidates:i});let a=Pl(await Mn(s),o);if(a)return a;Ft(n,o,"symbol")}var Uv=P(()=>{Fe();ir();ot()});async function Wv(e,{graph:t,svc:n,repoRoot:s}){let o=pt(e,"symbol"),{match:r,candidates:i}=Ft(n,o,"symbol"),a=Ht(r);if(!a)throw new Ne(`"${r.label}" (${r.class||"Entity"}) has no source span in the graph \u2014 it is likely a module. Use tmct_describe for its contents, then tmct_snippet one of the functions/classes it defines.`);let c;try{c=await Fs({readFile:Ie,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Bi})}catch(b){throw b instanceof Ne?b:new Ne(`could not read ${a.path} (${b?.code||b?.message||b})`)}let{text:l,truncated:u}=c,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,p=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,f=u?`
154
- \u2026 (truncated to ${Bi} lines; full span ${d})`:"",m=i.length?`
155
- (other matches: ${i.map(b=>b.label).join(", ")})`:"",h=Ed(t,r);return`${p}
152
+ (${oS(s)})`}function Bl(e,t){let n=V(t),s=e.filter(a=>sS.has(a.predicate)&&(a.subject===n||a.object===n));if(!s.length)return null;let o=[...new Set(s.filter(a=>a.subject===n).map(a=>a.object))],r=[...new Set(s.filter(a=>a.object===n).map(a=>a.subject))].sort(),i=[`"${t}" is not a code-map entity \u2014 answering from memory/corpus facts.`];if(o.length&&i.push(`is a: ${o.slice(0,ir).join(", ")}`),r.length){let a=r.length>ir?`, +${r.length-ir} more`:"";i.push(`known subclasses (${r.length}): ${r.slice(0,ir).join(", ")}${a}`)}return i.push(`(${oS(s)})`),i.join(`
153
+ `)}var sS,ir,ar=M(()=>{Qe();Ue();sS=new Set(["rdfs:subClassOf","rdf:type"]),ir=40});async function rS(e,{graph:t,svc:n,config:s}){let o=pt(e,"symbol"),{match:r,candidates:i}=$n(n.graph,o);if(r)return kd(t,r,{candidates:i});let a=Bl(await zn(s),o);if(a)return a;Mt(n,o,"symbol")}var iS=M(()=>{Me();ar();ot()});async function aS(e,{graph:t,svc:n,repoRoot:s}){let o=pt(e,"symbol"),{match:r,candidates:i}=Mt(n,o,"symbol"),a=Kt(r);if(!a)throw new Le(`"${r.label}" (${r.class||"Entity"}) has no source span in the graph \u2014 it is likely a module. Use tmct_describe for its contents, then tmct_snippet one of the functions/classes it defines.`);let c;try{c=await Ds({readFile:Ne,repoRoot:s,path:a.path,start:a.start,end:a.end,maxLines:Vi})}catch(b){throw b instanceof Le?b:new Le(`could not read ${a.path} (${b?.code||b?.message||b})`)}let{text:l,truncated:u}=c,d=a.end>a.start?`${a.start}-${a.end}`:`${a.start}`,p=`${r.label} \u2014 ${r.class||"Entity"} @ ${a.path}:${d}`,f=u?`
154
+ \u2026 (truncated to ${Vi} lines; full span ${d})`:"",m=i.length?`
155
+ (other matches: ${i.map(b=>b.label).join(", ")})`:"",h=Td(t,r);return`${p}
156
156
  ${l}${f}${h?`
157
- ${h}`:""}${m}`}var Gv=P(()=>{Pt();Qt();Tc();Fe();ot()});var Vv,Kv=P(()=>{Fe();ot();Vv=bt(Sb)});function Hv(e,{graph:t,svc:n}){let{match:s}=Ft(n,pt(e,"module"),"module");return db(t,s)}var qv=P(()=>{Fe();ot()});async function Yv(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Ne("query is required");let r=$b(t,s,{kind:o,decorator:String(e?.decorator||"").trim(),name:String(e?.name||"").trim(),toolNamePrefix:n?.toolNamePrefix});if(!o&&/^no module matches/.test(r)){let i=Pl(await Mn(n),s);if(i)return i}return r}var Xv=P(()=>{Qt();Fe();ir()});async function Jv(e,{graph:t,svc:n,config:s}){let o=pt(e,"class"),{match:r}=wn(n.graph,o);if(r)return vb(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=Ll(await Mn(s),o);if(i)return i;Ft(n,o,"class")}var Qv=P(()=>{Fe();ir();ot()});async function Zv(e,{graph:t,svc:n,config:s}){let o=pt(e,"class"),{match:r}=wn(n.graph,o);if(r)return Eb(t,r);let i=Ll(await Mn(s),o);if(i)return i;Ft(n,o,"class")}var eS=P(()=>{Fe();ir();ot()});function tS(e,{conceptBase:t="concept:",relationMap:n=x0}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=b=>{r.has(b)||r.set(b,b)},a=b=>{let g=b;for(;r.get(g)!==g;)g=r.get(g);for(;r.get(b)!==g;){let y=r.get(b);r.set(b,g),b=y}return g},c=(b,g)=>{let y=a(b),w=a(g);y!==w&&(y<w?r.set(w,y):r.set(y,w))},l=[];for(let b of e){let g=b.predicate;if(!s.has(g)&&!o.has(g))continue;let y=V(b.subject),w=V(b.object);!y||!w||(i(y),i(w),s.has(g)?c(y,w):l.push({s:y,o:w}))}let u=b=>t+b.replace(/ /g,"_"),d=new Map;for(let b of r.keys()){let g=a(b);d.has(g)||d.set(g,new Set),d.get(g).add(b)}let p=[];for(let[b,g]of d){let y=[...g].sort();p.push({id:u(b),prefLabel:b,altLabels:y.filter(w=>w!==b)})}p.sort((b,g)=>b.id<g.id?-1:b.id>g.id?1:0);let f=new Set,m=[];for(let{s:b,o:g}of l){let y=u(a(b)),w=u(a(g));if(y===w)continue;let E=y<w?`${y}\0${w}`:`${w}\0${y}`;f.has(E)||(f.add(E),m.push({subject:y,object:w}))}return m.sort((b,g)=>`${b.subject}${b.object}`<`${g.subject}${g.object}`?-1:1),{concepts:p,related:m,conceptIdForTerm:b=>{let g=V(b);return r.has(g)?u(a(g)):null},namespace:E0}}function lm(e,t,n={}){let s=tS(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=V(t),c=[i.prefLabel,...i.altLabels].filter(u=>u!==a),l=s.related.filter(u=>u.subject===o||u.object===o).map(u=>r.get(u.subject===o?u.object:u.subject)).filter(Boolean);return{conceptId:o,prefLabel:i.prefLabel,altLabels:i.altLabels,synonyms:c,related:l}}var E0,x0,Ml=P(()=>{Ze();E0="http://www.w3.org/2004/02/skos/core#",x0={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function um(e,{config:t,memoryBackend:n=null}){let s=pt(e,"term"),o=lm(await Mn(t,n),s);if(!o)throw new Ne(`no synonym or related facts for "${s}" in the memory graph. This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).`);let r=[`${o.prefLabel} [${o.conceptId}]`];return o.synonyms.length&&r.push(`synonyms (skos:altLabel): ${o.synonyms.join(", ")}`),o.related.length&&r.push(`related (skos:related): ${o.related.map(i=>i.prefLabel).join(", ")}`),r.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)"),po({content:r.join(`
158
- `),data:o})}var nS=P(()=>{Qt();Ml();ir();ot();um.ownsGraphLoad=!0});function F0(e,t){let n=[];for(let s of t||[])s?.predicate===j0&&V(s.subject)===e&&n.push(V(s.object));return n}function Fl(e,t){let n=V(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of F0(i,t))s.has(a)||o.push(a)}}return r}var j0,k0,R0,_0,T0,A0,C0,I0,O0,N0,L0,P0,M0,sS,dm=P(()=>{Ze();j0="rdfs:subClassOf",k0='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',R0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',_0='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',T0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',A0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',C0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',I0='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',O0='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',N0='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',L0='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',P0='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',M0='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',sS=Object.freeze({spider:k0,fly:R0,egg:_0,poodle:T0,dog:A0,animal:C0,room:I0,furniture:O0,portable:N0,person:L0,adventurer:P0,container:M0})});function D0(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function oS(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of D0(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var rS=P(()=>{});function z0(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function B0(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function lS(e){return B0(e).filter(t=>t?.property&&t.value!==void 0)}function U0(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function W0(e,t){let n=null,s=0;for(let o of e){let r=lS(o);r.length<=s||U0(r,t)&&(n=o,s=r.length)}return n}function G0(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function iS(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(c=>c.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,c.object));if(!i)continue;let a=G0(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function V0(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function aS(e,t){let n=t;for(let s of V0(e))n=n.split(s).join("");return n}function cS(e,t,n){let s=z0(e,n),o=W0(s,t);if(o&&!o.parameters)return o.svg;if(o)return aS(o,iS(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=iS(a,t);if(c)return c}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?aS(i,i.svg):null}function K0(e,t,n,s,o,r){for(let a of Fl(e,t)){let c=cS(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=cS(r,n,s);return i||o[r]}function uS(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=K0(e,t,n,s,o,r);return i?oS(a,i):a}var GV,VV,fm=P(()=>{dm();rS();GV=Object.freeze(["left","half-left","half-right","right"]),VV=Object.freeze(["moving"])});function ga(e){for(let t of e||[])if(t?.predicate===H0&&Object.prototype.hasOwnProperty.call(dS,t.object))return dS[t.object];return 1}var H0,dS,pm=P(()=>{H0="mgx:hasProperty",dS=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function fS(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},c=a.resolveSpriteAsset;if(typeof c!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let l=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],p=a.rootFallback||"animal",f=a.classAncestorChain,m=a.sizeScaleFor,h=a.expressionPalette,b=[];r&&b.push({predicate:n,object:r}),i&&b.push({predicate:s,object:i});let g={rootFallback:p};a.instanceKey&&(g.instanceKey=a.instanceKey);let y=c(o,d,b,l,u,g),w=T=>c(T,[],b,l,{},{rootFallback:T}),E=T=>Object.prototype.hasOwnProperty.call(u,T),R=(T,$)=>{let _=l.filter(j=>j&&Array.isArray(j.classes)&&j.classes.indexOf(T)>=0),S=_.find(j=>j.svg===$)||_.find(j=>!j.match&&j.parameters)||null;return S?{classes:S.classes.slice(),parameters:Object.keys(S.parameters||{}).sort(),match:S.match||null}:null},v=null,k=null;if(typeof f=="function"){v=[];for(let T of f(o,d)){let $=w(T);if(v.push({term:T,template:!!$,registry:E(T)}),$){k={term:T,via:"template",hops:v.length-1,root:!1,template:R(T,$)};break}if(E(T)){k={term:T,via:"registry",hops:v.length-1,root:!1,template:null};break}}if(!k){let T=w(p);v.push({term:p,template:!!T,registry:E(p),root:!0}),k={term:p,via:T?"template":"registry",hops:v.length-1,root:!0,template:T?R(p,T):null}}}let I=a.instanceKey?c(o,d,b,l,u,{rootFallback:p}):y,x=r?c(o,d,b.filter(T=>T.predicate!==n),l,u,{rootFallback:p}):null;return{class:o,expression:r||null,size:i||null,svg:y,scale:typeof m=="function"?m(b):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?I!==x:null,rootFallback:p,fellBackToRoot:k?!!k.root:null,chain:v,matched:k}}var pS=P(()=>{});var mS,hS,q0,XV,gS=P(()=>{fm();mS="icon tier",hS="sprite tier",q0=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),XV=Object.freeze(Object.values(q0).map(e=>e.predicate))});var bS,wS=P(()=>{bS=()=>[]});var yS,$S=P(()=>{yS=()=>[]});function Q0(){let e=yS();return e.length?{templates:e,tier:hS}:{templates:bS(),tier:mS}}function vS(e){return e.map(t=>t.term).join(" -> ")}async function mm(e,{config:t,memoryBackend:n=null}){let s=pt(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(no,o))throw new Ne(`"${o}" is not a sprite expression. The palette holds: ${X0().join(", ")}.`);if(r&&!J0(r))throw new Ne(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=Q0(),c=await Mn(t,n),l=fS({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:sS,resolveSpriteAsset:uS,classAncestorChain:Fl,sizeScaleFor:ga,expressionPalette:no});if(!l.svg||l.fellBackToRoot)throw new Ne(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${vS(l.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!l.expressionApplied)throw new Ne(`the ${a} draws "${s}" (matched at "${l.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,l.matched.hops===0?`matched at "${l.matched.term}", the class itself, via its own ${l.matched.via}`:`matched at "${l.matched.term}", ${l.matched.hops} hop(s) up the ancestor chain, via its ${l.matched.via}`,`ancestor chain walked: ${vS(l.chain)}`];return l.matched.template?.parameters.length&&d.push(`template parameters: ${l.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${l.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${l.svg.length} characters of SVG markup`),po({content:d.join(`
159
- `),data:{class:l.class,expression:l.expression,size:l.size,tier:a,scale:l.scale,svg:l.svg,chain:l.chain,matched:l.matched,expressionApplied:l.expressionApplied}})}var Y0,X0,J0,SS=P(()=>{Qt();dm();fm();qa();pm();pS();gS();wS();$S();ir();ot();Y0="mgx:hasProperty",X0=()=>Object.keys(no).sort(),J0=e=>!!e&&ga([{predicate:Y0,object:String(e)}])!==1;mm.ownsGraphLoad=!0});function ES(e,{graph:t}){return xb(t,{pkg:String(e?.package||"").trim()})}var xS=P(()=>{Fe()});function jS(e,{graph:t,svc:n}){let{match:s}=Ft(n,pt(e,"module"),"module");return Vb(t,s)}var kS=P(()=>{Fe();ot()});function RS(e,{graph:t,codeDomainActive:n=null}){return Rb(t,{codeDomainActive:n})}var _S=P(()=>{Fe()});function AS(e,t){return po({content:e,data:t,text:`${e}${TS}${JSON.stringify(t,null,2)}`})}function CS(e,{graph:t}){let{content:n,tmct_ask:s}=uo(t,pt(e,"query"));return AS(n,s)}var TS,Dl=P(()=>{ns();ot();TS=`
157
+ ${h}`:""}${m}`}var cS=M(()=>{Lt();Qt();Cc();Me();ot()});var lS,uS=M(()=>{Me();ot();lS=bt(_b)});function dS(e,{graph:t,svc:n}){let{match:s}=Mt(n,pt(e,"module"),"module");return bb(t,s)}var fS=M(()=>{Me();ot()});async function pS(e,{graph:t,config:n}){let s=String(e?.query||"").trim(),o=String(e?.kind||"").trim();if(!s&&!o)throw new Le("query is required");let r=kb(t,s,{kind:o,decorator:String(e?.decorator||"").trim(),name:String(e?.name||"").trim(),toolNamePrefix:n?.toolNamePrefix});if(!o&&/^no module matches/.test(r)){let i=Bl(await zn(n),s);if(i)return i}return r}var mS=M(()=>{Qt();Me();ar()});async function hS(e,{graph:t,svc:n,config:s}){let o=pt(e,"class"),{match:r}=$n(n.graph,o);if(r)return Rb(t,r,{toolNamePrefix:s?.toolNamePrefix});let i=zl(await zn(s),o);if(i)return i;Mt(n,o,"class")}var gS=M(()=>{Me();ar();ot()});async function bS(e,{graph:t,svc:n,config:s}){let o=pt(e,"class"),{match:r}=$n(n.graph,o);if(r)return Tb(t,r);let i=zl(await zn(s),o);if(i)return i;Mt(n,o,"class")}var wS=M(()=>{Me();ar();ot()});function yS(e,{conceptBase:t="concept:",relationMap:n=V0}={}){let s=new Set(n.synonym||[]),o=new Set(n.related||[]),r=new Map,i=b=>{r.has(b)||r.set(b,b)},a=b=>{let g=b;for(;r.get(g)!==g;)g=r.get(g);for(;r.get(b)!==g;){let w=r.get(b);r.set(b,g),b=w}return g},c=(b,g)=>{let w=a(b),y=a(g);w!==y&&(w<y?r.set(y,w):r.set(w,y))},l=[];for(let b of e){let g=b.predicate;if(!s.has(g)&&!o.has(g))continue;let w=V(b.subject),y=V(b.object);!w||!y||(i(w),i(y),s.has(g)?c(w,y):l.push({s:w,o:y}))}let u=b=>t+b.replace(/ /g,"_"),d=new Map;for(let b of r.keys()){let g=a(b);d.has(g)||d.set(g,new Set),d.get(g).add(b)}let p=[];for(let[b,g]of d){let w=[...g].sort();p.push({id:u(b),prefLabel:b,altLabels:w.filter(y=>y!==b)})}p.sort((b,g)=>b.id<g.id?-1:b.id>g.id?1:0);let f=new Set,m=[];for(let{s:b,o:g}of l){let w=u(a(b)),y=u(a(g));if(w===y)continue;let v=w<y?`${w}\0${y}`:`${y}\0${w}`;f.has(v)||(f.add(v),m.push({subject:w,object:y}))}return m.sort((b,g)=>`${b.subject}${b.object}`<`${g.subject}${g.object}`?-1:1),{concepts:p,related:m,conceptIdForTerm:b=>{let g=V(b);return r.has(g)?u(a(g)):null},namespace:G0}}function hm(e,t,n={}){let s=yS(e,n),o=s.conceptIdForTerm(t);if(!o)return null;let r=new Map(s.concepts.map(u=>[u.id,u])),i=r.get(o),a=V(t),c=[i.prefLabel,...i.altLabels].filter(u=>u!==a),l=s.related.filter(u=>u.subject===o||u.object===o).map(u=>r.get(u.subject===o?u.object:u.subject)).filter(Boolean);return{conceptId:o,prefLabel:i.prefLabel,altLabels:i.altLabels,synonyms:c,related:l}}var G0,V0,Ul=M(()=>{Ye();G0="http://www.w3.org/2004/02/skos/core#",V0={synonym:["mgx:synonym"],related:["mgx:relatedTo","mgx:similarTo"]}});async function gm(e,{config:t,memoryBackend:n=null}){let s=pt(e,"term"),o=hm(await zn(t,n),s);if(!o)throw new Le(`no synonym or related facts for "${s}" in the memory graph. This view answers where the store holds mgx:synonym / mgx:relatedTo facts (a corpus import seeds them).`);let r=[`${o.prefLabel} [${o.conceptId}]`];return o.synonyms.length&&r.push(`synonyms (skos:altLabel): ${o.synonyms.join(", ")}`),o.related.length&&r.push(`related (skos:related): ${o.related.map(i=>i.prefLabel).join(", ")}`),r.push("(from the memory graph's mgx:synonym / mgx:relatedTo / mgx:similarTo facts)"),mo({content:r.join(`
158
+ `),data:o})}var $S=M(()=>{Qt();Ul();ar();ot();gm.ownsGraphLoad=!0});function r1(e,t){let n=[];for(let s of t||[])s?.predicate===K0&&V(s.subject)===e&&n.push(V(s.object));return n}function Wl(e,t){let n=V(e),s=new Set,o=[n],r=[];for(;o.length;){let i=o.shift();if(!s.has(i)){s.add(i),r.push(i);for(let a of r1(i,t))s.has(a)||o.push(a)}}return r}var K0,H0,q0,Y0,X0,J0,Q0,Z0,e1,t1,n1,s1,o1,vS,bm=M(()=>{Ye();K0="rdfs:subClassOf",H0='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="10" r="3.4" fill="currentColor"/><circle cx="12" cy="15.6" r="4.6" fill="currentColor"/><g stroke="currentColor" stroke-width="1.1" fill="none" stroke-linecap="round"><path d="M9 8 L2 4"/><path d="M9 10 L1.5 9"/><path d="M9 12.5 L2 14"/><path d="M9 15.5 L3 19"/><path d="M15 8 L22 4"/><path d="M15 10 L22.5 9"/><path d="M15 12.5 L22 14"/><path d="M15 15.5 L21 19"/></g></svg>',q0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13.2" rx="3.2" ry="5" fill="currentColor"/><circle cx="12" cy="7" r="2.6" fill="currentColor"/><g fill="currentColor" opacity="0.55"><path d="M9 10 C3 6 2 4 3 2 C6 2 9 6 10.5 10 Z"/><path d="M15 10 C21 6 22 4 21 2 C18 2 15 6 13.5 10 Z"/></g></svg>',Y0='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2 C7 2 4 10 4 15.5 C4 20 7.6 22 12 22 C16.4 22 20 20 20 15.5 C20 10 17 2 12 2 Z" fill="currentColor"/></svg>',X0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.6" fill="currentColor"/><circle cx="7" cy="8.5" r="4" fill="currentColor"/><g fill="currentColor"><circle cx="4" cy="6" r="1.6"/><circle cx="7" cy="4.2" r="1.7"/><circle cx="10" cy="6" r="1.6"/></g><rect x="18.5" y="14" width="2.2" height="6" rx="1.1" fill="currentColor"/><circle cx="19.6" cy="13" r="1.5" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19.5" x2="9" y2="22"/><line x1="17" y1="19.5" x2="17" y2="22"/></g></svg>',J0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="13" cy="15" rx="6.4" ry="4.2" fill="currentColor"/><circle cx="7" cy="9" r="3.6" fill="currentColor"/><path d="M4.5 6.5 L2 3 L6 5 Z" fill="currentColor"/><path d="M19 13 C22 12 22.5 15 20 16 Z" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="9" y1="19" x2="9" y2="22"/><line x1="17" y1="19" x2="17" y2="22"/></g></svg>',Q0='<svg viewBox="0 0 24 24" aria-hidden="true"><ellipse cx="12" cy="13" rx="7" ry="4.4" fill="currentColor"/><circle cx="12" cy="7" r="3.4" fill="currentColor"/><g stroke="currentColor" stroke-width="1.6" stroke-linecap="round"><line x1="7" y1="17" x2="7" y2="21"/><line x1="17" y1="17" x2="17" y2="21"/></g></svg>',Z0='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="3" width="18" height="18" rx="1" fill="none" stroke="currentColor" stroke-width="1.6"/><path d="M9 21 L9 13 A3 3 0 0 1 15 13 L15 21" fill="none" stroke="currentColor" stroke-width="1.6"/></svg>',e1='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="4" y="5" width="16" height="3" rx="1" fill="currentColor"/><rect x="4" y="8" width="3" height="12" fill="currentColor"/><rect x="17" y="8" width="3" height="12" fill="currentColor"/></svg>',t1='<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 6 C7.5 6 5 9.4 5 13.4 C5 17.7 8.1 20 12 20 C15.9 20 19 17.7 19 13.4 C19 9.4 16.5 6 12 6 Z" fill="currentColor"/><path d="M9.4 6.4 C9.9 4.6 10.8 3.4 12 3.4 C13.2 3.4 14.1 4.6 14.6 6.4" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/><ellipse cx="9.8" cy="11.6" rx="1.6" ry="2.1" fill="currentColor" opacity="0.28"/></svg>',n1='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/></svg>',s1='<svg viewBox="0 0 24 24" aria-hidden="true"><circle cx="12" cy="6.5" r="3.2" fill="currentColor"/><path d="M6 21 C6 15.5 8.7 13 12 13 C15.3 13 18 15.5 18 21 Z" fill="currentColor"/><rect x="15.5" y="13.5" width="4.5" height="5" rx="1" fill="currentColor" opacity="0.6"/></svg>',o1='<svg viewBox="0 0 24 24" aria-hidden="true"><rect x="3" y="10" width="18" height="10" rx="1.2" fill="currentColor"/><path d="M3 10 L5 5 H19 L21 10 Z" fill="currentColor" opacity="0.7"/><rect x="10.6" y="9.4" width="2.8" height="2.2" rx="0.4" fill="currentColor" opacity="0.35"/></svg>',vS=Object.freeze({spider:H0,fly:q0,egg:Y0,poodle:X0,dog:J0,animal:Q0,room:Z0,furniture:e1,portable:t1,person:n1,adventurer:s1,container:o1})});function i1(e){return[...new Set([...e.matchAll(/\bid="([^"]+)"/g)].map(t=>t[1]))]}function SS(e,t){if(!t||typeof e!="string")return e;let n=String(t).replace(/[^a-zA-Z0-9_-]/g,"-"),s=e;for(let o of i1(e)){let r=`${o}-${n}`;s=s.split(`id="${o}"`).join(`id="${r}"`),s=s.split(`url(#${o})`).join(`url(#${r})`)}return s}var ES=M(()=>{});function a1(e,t){return(t||[]).filter(n=>Array.isArray(n?.classes)&&n.classes.includes(e))}function c1(e){let t=e?.match;return t?Array.isArray(t)?t:[t]:[]}function RS(e){return c1(e).filter(t=>t?.property&&t.value!==void 0)}function l1(e,t){return e.length?e.every(n=>(t||[]).some(s=>s.predicate===n.property&&s.object===n.value)):!1}function u1(e,t){let n=null,s=0;for(let o of e){let r=RS(o);r.length<=s||l1(r,t)&&(n=o,s=r.length)}return n}function d1(e,t,n){if(typeof n=="string"&&t.placeholder)return e.split(t.placeholder).join(n);if(n&&typeof n=="object"&&t.placeholders){let s=e;for(let[o,r]of Object.entries(t.placeholders)){if(!Object.prototype.hasOwnProperty.call(n,o))return null;s=s.split(r).join(n[o])}return s}return null}function xS(e,t){let n=e.svg,s=0;for(let o of Object.values(e.parameters||{})){let r=o?.values||{},i=(t||[]).find(c=>c.predicate===o.property&&Object.prototype.hasOwnProperty.call(r,c.object));if(!i)continue;let a=d1(n,o,r[i.object]);a&&(n=a,s+=1)}return s>0?n:null}function f1(e){let t=[];for(let n of Object.values(e.parameters||{})){n?.placeholder&&t.push(n.placeholder);for(let s of Object.values(n?.placeholders||{}))t.push(s)}return t}function jS(e,t){let n=t;for(let s of f1(e))n=n.split(s).join("");return n}function kS(e,t,n){let s=a1(e,n),o=u1(s,t);if(o&&!o.parameters)return o.svg;if(o)return jS(o,xS(o,t)||o.svg);for(let a of s){if(a.match||!a.parameters)continue;let c=xS(a,t);if(c)return c}let r=s.find(a=>!a.match&&!a.parameters);if(r)return r.svg;let i=s.find(a=>!a.match&&a.parameters);return i?jS(i,i.svg):null}function p1(e,t,n,s,o,r){for(let a of Wl(e,t)){let c=kS(a,n,s);if(c)return c;if(Object.prototype.hasOwnProperty.call(o,a))return o[a]}let i=kS(r,n,s);return i||o[r]}function _S(e,t,n,s,o,{rootFallback:r="animal",instanceKey:i}={}){let a=p1(e,t,n,s,o,r);return i?SS(a,i):a}var hK,gK,wm=M(()=>{bm();ES();hK=Object.freeze(["left","half-left","half-right","right"]),gK=Object.freeze(["moving"])});function $a(e){for(let t of e||[])if(t?.predicate===m1&&Object.prototype.hasOwnProperty.call(TS,t.object))return TS[t.object];return 1}var m1,TS,ym=M(()=>{m1="mgx:hasProperty",TS=Object.freeze({small:.8,large:1.3,long:1.2,tall:1.25})});function AS(e,t){let n="mgx:feels",s="mgx:hasProperty",o=String(e&&e.class||"").trim(),r=String(e&&e.expression||"").trim(),i=String(e&&e.size||"").trim(),a=t||{},c=a.resolveSpriteAsset;if(typeof c!="function")throw new TypeError("resolveSpriteRequest needs deps.resolveSpriteAsset");let l=a.templates||[],u=a.spriteRegistry||{},d=a.factRows||[],p=a.rootFallback||"animal",f=a.classAncestorChain,m=a.sizeScaleFor,h=a.expressionPalette,b=[];r&&b.push({predicate:n,object:r}),i&&b.push({predicate:s,object:i});let g={rootFallback:p};a.instanceKey&&(g.instanceKey=a.instanceKey);let w=c(o,d,b,l,u,g),y=_=>c(_,[],b,l,{},{rootFallback:_}),v=_=>Object.prototype.hasOwnProperty.call(u,_),R=(_,$)=>{let T=l.filter(k=>k&&Array.isArray(k.classes)&&k.classes.indexOf(_)>=0),E=T.find(k=>k.svg===$)||T.find(k=>!k.match&&k.parameters)||null;return E?{classes:E.classes.slice(),parameters:Object.keys(E.parameters||{}).sort(),match:E.match||null}:null},S=null,j=null;if(typeof f=="function"){S=[];for(let _ of f(o,d)){let $=y(_);if(S.push({term:_,template:!!$,registry:v(_)}),$){j={term:_,via:"template",hops:S.length-1,root:!1,template:R(_,$)};break}if(v(_)){j={term:_,via:"registry",hops:S.length-1,root:!1,template:null};break}}if(!j){let _=y(p);S.push({term:p,template:!!_,registry:v(p),root:!0}),j={term:p,via:_?"template":"registry",hops:S.length-1,root:!0,template:_?R(p,_):null}}}let I=a.instanceKey?c(o,d,b,l,u,{rootFallback:p}):w,x=r?c(o,d,b.filter(_=>_.predicate!==n),l,u,{rootFallback:p}):null;return{class:o,expression:r||null,size:i||null,svg:w,scale:typeof m=="function"?m(b):1,sizeKnown:i&&typeof m=="function"?m([{predicate:s,object:i}])!==1:null,expressionKnown:r&&h?Object.prototype.hasOwnProperty.call(h,r):null,expressionApplied:r?I!==x:null,rootFallback:p,fellBackToRoot:j?!!j.root:null,chain:S,matched:j}}var CS=M(()=>{});var IS,OS,h1,vK,NS=M(()=>{wm();IS="icon tier",OS="sprite tier",h1=Object.freeze({takeParameter:Object.freeze({predicate:"mgx:take-parameter",comment:"sprite class -> parameter name: a parameter that class's own templates declare."}),offerVariant:Object.freeze({predicate:"mgx:offer-variant",comment:"sprite class -> variant value: a hand-authored [match] constraint that class's templates offer."})}),vK=Object.freeze(Object.values(h1).map(e=>e.predicate))});var LS,PS=M(()=>{LS=()=>[]});var MS,FS=M(()=>{MS=()=>[]});function y1(){let e=MS();return e.length?{templates:e,tier:OS}:{templates:LS(),tier:IS}}function DS(e){return e.map(t=>t.term).join(" -> ")}async function $m(e,{config:t,memoryBackend:n=null}){let s=pt(e,"class").toLowerCase(),o=String(e?.expression||"").trim().toLowerCase(),r=String(e?.size||"").trim().toLowerCase();if(o&&!Object.hasOwn(so,o))throw new Le(`"${o}" is not a sprite expression. The palette holds: ${b1().join(", ")}.`);if(r&&!w1(r))throw new Le(`"${r}" is not a size the sprite scale recognises \u2014 it reads a taught mgx:hasProperty size word off the individual, and has no entry for this one.`);let{templates:i,tier:a}=y1(),c=await zn(t,n),l=AS({class:s,expression:o,size:r},{factRows:c,templates:i,spriteRegistry:vS,resolveSpriteAsset:_S,classAncestorChain:Wl,sizeScaleFor:$a,expressionPalette:so});if(!l.svg||l.fellBackToRoot)throw new Le(`no sprite for "${s}" \u2014 neither it nor any rdfs:subClassOf ancestor the memory graph knows (${DS(l.chain)}) carries one in the ${a}. Teach the class its superclass first, or ask for a class the catalog draws.`);if(o&&!l.expressionApplied)throw new Le(`the ${a} draws "${s}" (matched at "${l.matched.term}") but that template takes no expression, so "${o}" would not show. Ask for the plain sprite, or a class whose template carries an emotion parameter.`);let u=[o?`expression ${o}`:"",r?`size ${r}`:""].filter(Boolean),d=[`sprite for "${s}"${u.length?` (${u.join(", ")})`:""}, from the ${a}`,l.matched.hops===0?`matched at "${l.matched.term}", the class itself, via its own ${l.matched.via}`:`matched at "${l.matched.term}", ${l.matched.hops} hop(s) up the ancestor chain, via its ${l.matched.via}`,`ancestor chain walked: ${DS(l.chain)}`];return l.matched.template?.parameters.length&&d.push(`template parameters: ${l.matched.template.parameters.join(", ")}`),r&&d.push(`render scale: ${l.scale} (from the taught mgx:hasProperty "${r}")`),d.push(`${l.svg.length} characters of SVG markup`),mo({content:d.join(`
159
+ `),data:{class:l.class,expression:l.expression,size:l.size,tier:a,scale:l.scale,svg:l.svg,chain:l.chain,matched:l.matched,expressionApplied:l.expressionApplied}})}var g1,b1,w1,zS=M(()=>{Qt();bm();wm();Ja();ym();CS();NS();PS();FS();ar();ot();g1="mgx:hasProperty",b1=()=>Object.keys(so).sort(),w1=e=>!!e&&$a([{predicate:g1,object:String(e)}])!==1;$m.ownsGraphLoad=!0});function BS(e,{graph:t}){return Ab(t,{pkg:String(e?.package||"").trim()})}var US=M(()=>{Me()});function WS(e,{graph:t,svc:n}){let{match:s}=Mt(n,pt(e,"module"),"module");return Jb(t,s)}var GS=M(()=>{Me();ot()});function VS(e,{graph:t,codeDomainActive:n=null}){return Ob(t,{codeDomainActive:n})}var KS=M(()=>{Me()});function qS(e,t){return mo({content:e,data:t,text:`${e}${HS}${JSON.stringify(t,null,2)}`})}function YS(e,{graph:t}){let{content:n,tmct_ask:s}=fo(t,pt(e,"query"));return qS(n,s)}var HS,Gl=M(()=>{rs();ot();HS=`
160
160
 
161
161
  ---tmct_ask---
162
- `});var IS,OS=P(()=>{Fe();ot();IS=bt(kb)});var NS,LS=P(()=>{Fe();ot();NS=bt(_b)});var PS,MS=P(()=>{Fe();ot();PS=bt(Lb)});var FS,DS=P(()=>{Fe();ot();FS=bt(Mb)});var zS,BS=P(()=>{Fe();ot();zS=bt(Fb)});var US,WS=P(()=>{Fe();ot();US=bt(Ab)});var GS,VS=P(()=>{Fe();ot();GS=bt(Cb)});var KS,HS=P(()=>{Fe();ot();KS=bt(Ob)});var qS,YS=P(()=>{Fe();ot();qS=bt(Gb)});function Z0(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function e1(e){let t=(e||[]).map(Z0);return t.map(n=>JSON.stringify(n)).join(`
162
+ `});var XS,JS=M(()=>{Me();ot();XS=bt(Ib)});var QS,ZS=M(()=>{Me();ot();QS=bt(Nb)});var eE,tE=M(()=>{Me();ot();eE=bt(Bb)});var nE,sE=M(()=>{Me();ot();nE=bt(Wb)});var oE,rE=M(()=>{Me();ot();oE=bt(Gb)});var iE,aE=M(()=>{Me();ot();iE=bt(Pb)});var cE,lE=M(()=>{Me();ot();cE=bt(Mb)});var uE,dE=M(()=>{Me();ot();uE=bt(Db)});var fE,pE=M(()=>{Me();ot();fE=bt(Xb)});function $1(e){let t={subject:e.subject,predicate:e.predicate,object:e.object,provenance:e.provenance||""};return e.quantifier&&(t.quantifier=e.quantifier),t}function v1(e){let t=(e||[]).map($1);return t.map(n=>JSON.stringify(n)).join(`
163
163
  `)+(t.length?`
164
- `:"")}function XS(e){return e1(St(e))}var JS=P(()=>{We()});async function hm(e,{config:t,memoryBackend:n=null}){let s=n?null:await yo($e($e(t.graphFile))),o=n||s.dir;try{return XS(await mt(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var QS=P(()=>{JS();Qe();We();hm.ownsGraphLoad=!0});async function gm(e,{config:t,ingest:n}){let s=String(e?.text??"");if(!s.trim())return"(nothing to ingest \u2014 pass some text)";if(typeof n!="function")return"(ingest isn't wired into this context \u2014 invoke tmct_ingest through the CLI `cli` route or the chat surface)";let o=e?.optimistic===!0,{dir:r,close:i}=await yo($e($e(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0,findings:!0}),c=a.extracted.length+a.optimistic.length,l=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${c} fact(s) grounded.`;return po({content:c?`${l}
164
+ `:"")}function mE(e){return v1(mt(e))}var hE=M(()=>{Ue()});async function vm(e,{config:t,memoryBackend:n=null}){let s=n?null:await $o($e($e(t.graphFile))),o=n||s.dir;try{return mE(await ct(o))||"(the memory store holds no facts to export)"}finally{s&&await s.close()}}var gE=M(()=>{hE();Qe();Ue();vm.ownsGraphLoad=!0});async function Sm(e,{config:t,ingest:n}){let s=String(e?.text??"");if(!s.trim())return"(nothing to ingest \u2014 pass some text)";if(typeof n!="function")return"(ingest isn't wired into this context \u2014 invoke tmct_ingest through the CLI `cli` route or the chat surface)";let o=e?.optimistic===!0,{dir:r,close:i}=await $o($e($e(t.graphFile)));try{let a=await n(s,{memoryDir:r,config:t,sourceTag:"tool",optimistic:o,canonical:!0,findings:!0}),c=a.extracted.length+a.optimistic.length,l=`${a.sentences} sentence(s), ${a.recognized} recognized`+(o?`, ${a.optimistic.length} optimistic candidate(s)`:"")+`, ${a.skipped} skipped \u2014 ${c} fact(s) grounded.`;return mo({content:c?`${l}
165
165
  ${a.canonical.join(`
166
- `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var ZS=P(()=>{Qe();We();ot();gm.ownsGraphLoad=!0});var t1,eE=P(()=>{Rf();Ny();Uv();Gv();Kv();qv();Xv();Qv();eS();nS();SS();xS();kS();_S();Dl();OS();LS();MS();DS();BS();WS();VS();HS();YS();QS();ZS();t1=Object.freeze({tmct_context:kf,tmct_context_more:Oy,tmct_describe:Bv,tmct_snippet:Wv,tmct_signature:Vv,tmct_impact:Hv,tmct_search:Yv,tmct_members:Jv,tmct_subclasses:Zv,tmct_related:um,tmct_sprite:mm,tmct_architecture:ES,tmct_exports:jS,tmct_untested:RS,tmct_ask:CS,tmct_tests_for:IS,tmct_history:NS,tmct_file_history:PS,tmct_method_history:FS,tmct_class_history:zS,tmct_callers:US,tmct_callees:GS,tmct_calls:KS,tmct_cochanges:qS,tmct_export:hm,tmct_ingest:gm})});var bm=P(()=>{});var zl,wm=P(()=>{zl=()=>({relations:[],constructions:[]})});var tE,nE=P(()=>{Pt();Qe();_g();Qt();$i();ns();Ic();Oc();eE();Dl();ot();Mr();bc();bm();wm();Oc();Rf();Dl();wc(void 0);gc(zl);tE=Rg.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});function oE(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function ba(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:ss|zz|x|ch|sh|o)es$/i.test(t)?t.slice(0,-2):/[sz]es$/i.test(t)?t.slice(0,-1):t.replace(/s$/i,"")}function $m(e){let t=ba(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function sE(e){let t=String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").split(/\s+/)[0]?.toLowerCase()??"";return t?n1.has(t)?!0:s1.has(t)?!1:/[a-z]s$/.test(t)&&!/ss$/.test(t):!1}function Ul(e,t){if(Ks[e])return Ks[e];let n=String(e??"");if(n.startsWith("mgxneg:")){let c=Ul(`mgx:${n.slice(7)}`,t);if(c==="can")return"cannot";if(c==="can be")return"cannot be";if(c==="is"||c.startsWith("is "))return`is not${c.slice(2)}`;let[l,...u]=c.split(" ");return[sE(t)?"do not":"does not",ba(l),...u].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(n);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${Bl})-([a-z]+)$`,"i").exec(n);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(n);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(n);if(i)return`${sE(t)?i[1]:oE(i[1])}${i[2]?` ${i[2]}`:""}`;let a=n.indexOf(":");return a===-1?n:n.slice(a+1)}function rE(e){let t=typeof e=="string"?[e]:Array.isArray(e)?e:e?.extraction;if(!Array.isArray(t)||!t.length)return"";let n=new Set(t.map(s=>String(s)));return Object.entries(o1).filter(([s])=>n.has(s)).map(([,s])=>s).join(" ")}var Ks,Bl,n1,s1,o1,vm=P(()=>{Ks=Object.freeze({"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:nameFor":"is the name for","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in","mgx:pursues":"pursues","mgx:evades":"evades","mgx:consumes":"eats","mgx:vision-radius":"sees within","mgx:guards":"guards"}),Bl="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned";n1=new Set(["people","men","women","children","mice","geese","feet","teeth","oxen"]),s1=new Set(["news","physics","species","series","means","measles","mathematics","politics","economics"]);o1=Object.freeze({"clause-fallback":"(read from a clause fragment)","pronoun-carry":"(subject carried from the previous sentence)","identifier-token":"(identifier token)"})});var eq,tq,nq,Wl=P(()=>{eq=Object.freeze(["entity","set","event","measure"]),tq=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),nq=Object.freeze({it:Object.freeze(["entity","event","measure"]),this:Object.freeze(["entity","event","measure"]),that:Object.freeze(["entity","event","measure"]),"this one":Object.freeze(["entity","event","measure"]),"that one":Object.freeze(["entity","event","measure"]),those:Object.freeze(["set"]),them:Object.freeze(["set"]),these:Object.freeze(["set"]),here:Object.freeze(["entity"])})});var Gl=P(()=>{});var Et,rq,iq,aq,cq,lq,uq,dq,fq,pq,mq,hq,gq,bq,wq,yq,$q,Xt,vq,Sq,Eq,$o=P(()=>{Et=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},rq=Et("createRequire"),iq=Et("readFileSync"),aq=Et("access"),cq=Et("readFile"),lq=Et("writeFile"),uq=Et("appendFile"),dq=Et("mkdir"),fq=Et("mkdtemp"),pq=Et("rename"),mq=Et("unlink"),hq=Et("rm"),gq=Et("stat"),bq=Et("copyFile"),wq=Et("readdir"),yq=Et("createReadStream"),$q=Et("createWriteStream"),Xt=e=>String(e),vq=Et("randomBytes"),Sq=Et("spawnSync"),Eq=Et("createInterface")});var pE={};Lt(pE,{PHRASEBOOK_FILE:()=>cE,TECHNICAL_SLOTS:()=>Sm,TEMPLATES_FILE:()=>aE,flatten:()=>xm,loadPhrasebook:()=>c1,loadTemplates:()=>jm,loadTemplatesMerged:()=>a1,render:()=>fE,renderSegments:()=>dE,slotKind:()=>uE,slotsOf:()=>Em});function Em(e){let t=[];for(let n of String(e).matchAll(lE))t.includes(n[1])||t.push(n[1]);return t}function uE(e){return i1[e]||"entity"}function xm(e){let t="";for(let n of e)t+=n.text;return t}function dE(e,t={},n=wa){if(!n)throw new Error("renderSegments() before loadTemplates() \u2014 load the template library first");let s=n.get(e);if(!s)throw new Error(`unknown template id "${e}"`);let o=s.slots.filter(u=>t[u]===void 0||t[u]===null);if(o.length)throw new Error(`template "${e}" missing slot${o.length>1?"s":""}: ${o.join(", ")}`);let r=s.template,i=new RegExp(lE.source,"g"),a=[],c=0,l;for(;(l=i.exec(r))!==null;)l.index>c&&a.push({type:"prose",text:r.slice(c,l.index)}),a.push({type:uE(l[1]),text:String(t[l[1]])}),c=l.index+l[0].length;return c<r.length&&a.push({type:"prose",text:r.slice(c)}),a}async function jm(e=aE){let t=await Ie(e,"utf8"),n=new Map,s=t.split(`
167
- `);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(c){throw new Error(`${e}:${o+1}: not valid JSON: ${c.message}`)}for(let c of["id","class","template","register"])if(typeof i[c]!="string"||!i[c])throw new Error(`${e}:${o+1}: missing/empty "${c}"`);if(!r1.has(i.register))throw new Error(`${e}:${o+1}: register must be terse|friendly|technical, got "${i.register}"`);if(n.has(i.id))throw new Error(`${e}:${o+1}: duplicate template id "${i.id}"`);let a=Em(i.template);if(i.register==="technical"){let c=a.filter(l=>!Sm.has(l));if(c.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${c.length>1?"s":""}: ${c.join(", ")} (allowed: ${[...Sm].join(", ")})`);if(!a.includes("provenance"))throw new Error(`${e}:${o+1}: technical template "${i.id}" must carry a {provenance} fill (an advanced claim always shows its source)`)}n.set(i.id,{...i,slots:a})}return wa=n,n}async function a1(e=[]){let t=wa,n=new Map;try{for(let s of e){let o=await jm(s);for(let[r,i]of o){if(!r.includes(":"))throw new Error(`${s}: extension-pack template id "${r}" is not namespaced ("<packname>:<id>")`);if(n.has(r))throw new Error(`${s}: duplicate template id "${r}" already loaded from an earlier path`);n.set(r,i)}}}finally{wa=t}return n}function fE(e,t={},n=wa){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return xm(dE(e,t,n))}async function c1(e=cE){let t=await Ie(e,"utf8"),n=[],s=[],o=t.split(`
168
- `);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(c=>c.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:Em(i)})}}return{patterns:n,synonyms:s}}var l1,iE,aE,cE,r1,lE,Sm,i1,wa,Vl=P(()=>{Pt();$o();Qe();l1={},iE=ne($e(Xt(l1.url)),"..","..",".."),aE=ne(iE,"data","templates","responses.jsonl"),cE=ne(iE,"data","phrasebook","software-phrases.txt"),r1=new Set(["terse","friendly","technical"]),lE=/\{([A-Za-z][A-Za-z0-9]*)\}/g,Sm=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));i1={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};wa=null});function d1(e,t={}){let n=u1.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function f1(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>d1(s,t))):1}function lt(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:f1(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var u1,mE=P(()=>{u1=/^src:corpus:(.+)$/});var xt,Tq,ar,Aq,Cq,Iq,Oq,Nq,Lq,Pq,Mq,Fq,Dq,zq,Bq,hE,p1,Uq,Wq,Gq,cr=P(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},Tq=xt("createRequire"),ar=xt("readFileSync"),Aq=xt("access"),Cq=xt("readFile"),Iq=xt("writeFile"),Oq=xt("appendFile"),Nq=xt("mkdir"),Lq=xt("mkdtemp"),Pq=xt("rename"),Mq=xt("unlink"),Fq=xt("rm"),Dq=xt("stat"),zq=xt("copyFile"),Bq=xt("readdir"),hE=xt("createReadStream"),p1=xt("createWriteStream"),Uq=xt("randomBytes"),Wq=xt("spawnSync"),Gq=xt("createInterface")});function km(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function b1(e=h1){let t=Zo(ar(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Hl(){if(Kl===null)try{Kl=b1()}catch{Kl=[]}return Kl}var w1,m1,h1,g1,Jq,Kl,ql=P(()=>{cr();$o();Qe();dl();Vl();w1={},m1=$e(Xt(w1.url)),h1=ne(m1,"..","..","data","templates","grammar-rules.toml"),g1=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),Jq=Object.freeze(new Set(g1.filter(e=>e!=="prose")));Kl=null});function y1(){if(ya!==void 0)return ya;try{let e=gE?gE():$1();ya=e&&e.winkNLP&&e.model?e:null}catch{ya=null}return ya}function $1(){let e=process.getBuiltinModule("node:module").createRequire(v1.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function Yl(){if(oi!==void 0)return oi;let e=y1();if(!e)return oi=null,null;try{oi=e.winkNLP(e.model)}catch{oi=null}return oi}var v1,gE,ya,oi,Xl=P(()=>{v1={}});var Rm=P(()=>{Xl()});var wE,bE=P(()=>{wE={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var xE={};Lt(xE,{CODE_REF_SHAPE:()=>Ql,DETERMINERS:()=>Tm,OF_CLASSIFIER_HEADS:()=>Cm,OF_PARTITIVE_HEADS:()=>Im,QUANTIFIERS:()=>Am,classify:()=>Om,loadLexicon:()=>tn,lookupAdjective:()=>Sa,lookupNoun:()=>dn,lookupProperName:()=>ri,lookupVerb:()=>va,numberOf:()=>$a,predicateOf:()=>Jl,readsAsIndividualName:()=>Zl,thirdPerson:()=>vE,withProperNames:()=>EE});function $a(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):E1[t]??null}function vE(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function Jl(e,t=$E){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${vE(e.lemma)}${n}`}function SE(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function yE(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!x1.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!j1.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function tn(e,t=$E){if(!e&&_m.has(t))return _m.get(t);let n=wE,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return yE(s,n),e?(yE(s,e),s):(_m.set(t,s),s)}function EE(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function dn(e,t,n={}){return k1(e,t,n)[0]??null}function k1(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,c=l=>{l&&!a.has(l.lemma)&&(a.add(l.lemma),i.push(l))};if(r){let l=e.nouns.get(r)??null;return n.singularOnly&&o?(c(o),c(l)):(c(l),c(o)),i}for(let l of SE(s))c(e.nouns.get(l));return i}function va(e,t){return R1(e,t)[0]??null}function R1(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of SE(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function Sa(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function ri(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function Zl(e,t){let n=String(e??"");if(!n)return!1;if(ri(t,n)||Ql.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=dn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function Om(e,t=tn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(Tm[s])return{pos:"determiner",type:Tm[s]};if(Am[s])return{pos:"quantifier",type:Am[s]};let o=$a(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=ri(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=dn(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=va(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:Jl(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=Sa(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var $E,Tm,Am,Cm,Im,E1,x1,j1,_m,Ql,Hn=P(()=>{bE();$E="tmct:",Tm=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),Am=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),Cm=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Im=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),E1=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});x1=new Set(["data","object"]),j1=new Set(["subclass","data"]);_m=new Map;Ql=/[./\\#:@]/});var iY,aY,cY,_1,lY,uY,dY,jE=P(()=>{ns();Fe();iY=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),aY=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),cY=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),_1=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),lY=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),uY=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),dY=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function _E(e){return!!e&&typeof e=="object"&&typeof e.s=="string"&&T1.test(e.s)&&typeof e.t=="string"&&e.t.length>0&&Number.isInteger(e.r)&&e.r>0}function vo(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function tu(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function C1(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function RE(e,t){let n=dn(t,e);return n?V(n.lemma):e}function TE(e,t){let n=C1(String(e??"")).match(A1);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(I1.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),p=d&&RE(d,t);if(p&&(N1.has(p)||L1.has(p))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&O1.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=RE(i,t);if(kE.has(i)||kE.has(a))return null;let c=dn(t,i);if(!c)return null;let l=V(c.lemma);return s&&(!/s$/.test(i)||V(i)===l)?null:l}var T1,eu,A1,I1,kE,O1,N1,L1,lr=P(()=>{Ze();Hn();jE();T1=/^ref-[0-3][0-9a-f]$/;eu=400;A1=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;I1=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),kE=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),O1=new Set(["a","an","the"]),N1=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),L1=new Set(["either","one","each","both","any"])});var Ea,nu=P(()=>{Ea=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});function AE(e=process.env){return e?.TMCT_REFERENCE_PACK_DIR||ne(P1,"corpus","reference")}function CE(e){try{return Ea(ar(e))}catch{return null}}function Pm(e){if(Nm.has(e))return Nm.get(e);let t=null,n=CE(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return Nm.set(e,t),t}function M1(e,t){let n=`${e}\0${t}`;if(Lm.has(n))return Lm.get(n);let s=null,o=CE(ne(e,"shards",`${t}.jsonl.gz`));if(o){s=new Map;for(let r of o.toString("utf8").split(`
169
- `))if(r.trim())try{let i=JSON.parse(r);vo(i)&&s.set(i.term,i)}catch{}}return Lm.set(n,s),s}function Mm(e,t){let n=Pm(e);if(!n)return null;let s=n[String(t??"")];return _E(s)?M1(e,s.s)?.get(s.t)??null:null}var F1,P1,Nm,Lm,Fm=P(()=>{cr();nu();$o();Qe();lr();F1={},P1=ne($e(Xt(F1.url)),"..","..","..");Nm=new Map,Lm=new Map});function z1(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return D1.includes(e.predicate)}function IE(e){return vo(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(z1):!1}function ur(e,t){return`research:${e}:${V(t)}`}function ii(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");B1.set(e.name,{name:e.name,create:e.create})}var D1,B1,kY,RY,dr=P(()=>{Ze();lr();D1=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);B1=new Map;kY=Object.freeze(["wikipedia","wikidata","simple-wikipedia","simple-wikipedia-pack","wiktionary","dbpedia"]),RY=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia","simple-wikipedia-pack":"simple-wikipedia-pack",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function OE(e){let t=Number(e);return Number.isFinite(t)?t===408||t===429||t>=500:!1}var TY,su=P(()=>{TY=Object.freeze({failureThreshold:5,windowMs:6e4,cooldownMs:6e4})});function ja({fetchImpl:e,timeoutMs:t=ai,minIntervalMs:n=Jt,retryAfterFloorMs:s=U1,maxFetchesPerTurn:o=W1,userAgent:r,waitForSlot:i=!1,validators:a=null}={}){let c=e??((...S)=>globalThis.fetch(...S)),l=new Map,u=0,d=0,p=!1,f=0,m=0,h=0,b=!1,g=!1,y=()=>{if(!r)return null;let S={"Api-User-Agent":r};return typeof document>"u"&&(S["User-Agent"]=r),S};function w(S){let j=Number(S)*1e3;d=Date.now()+Math.max(j||0,s)}function E(S){let j=a?.get(S);if(!j)return null;let M={};return j.etag&&(M["If-None-Match"]=j.etag),j.lastModified&&(M["If-Modified-Since"]=j.lastModified),Object.keys(M).length?M:null}function R(S,j){if(!a)return;let M=j.headers?.get?.("etag")??"",z=j.headers?.get?.("last-modified")??"";if(!M&&!z)return;let K=a.get(S)??{};a.set(S,{etag:M||K.etag||"",lastModified:z||K.lastModified||""})}async function v(S,{asJson:j}){if(b&&h>=o)return g=!0,null;f+=1,h+=1;let M=typeof AbortController=="function"?new AbortController:null,z=M?setTimeout(()=>M.abort(),t):null;try{let K={};M&&(K.signal=M.signal);let Y={...y()??{},...E(S)??{}};Object.keys(Y).length&&(K.headers=Y);let X;try{X=await c(S,K)}catch{return m+=1,null}if(X.status===429)return w(X.headers?.get?.("retry-after")),m+=1,null;if(X.status===304)return a?{notModified:!0}:null;if(!X.ok)return OE(X.status)&&(m+=1),null;if(R(S,X),j){let L=await X.json();return L?.error?.code==="maxlag"?(w(X.headers?.get?.("retry-after")),m+=1,null):L}return await X.text()}catch{return M?.signal?.aborted&&(m+=1),null}finally{z!==null&&clearTimeout(z)}}async function k(S){return v(S,{asJson:!0})}async function I(S){return v(S,{asJson:!1})}let x=()=>Math.max(d,u+n);async function T(){for(;;){let S=Date.now();if(!p&&S>=x())return u=S,p=!0,!0;if(!i)return!1;await new Promise(j=>setTimeout(j,Math.max(x()-S,25)))}}async function $(S,j,{remember:M=!0}={}){if(l.has(S))return l.get(S);if(!await T())return null;let z=null;try{z=await j()}catch{z=null}finally{p=!1}return M&&l.set(S,z),z}function _(){b=!0,h=0,g=!1}function C(){return{fetches:f,systemicFailures:m,fetchesThisTurn:h,budgetExhausted:g}}return{fetchJson:k,fetchText:I,cachedFetch:$,beginTurn:_,stats:C}}var ai,Jt,U1,W1,xa,ka=P(()=>{su();ai=4e3,Jt=2e3,U1=5e3,W1=6,xa=5});function X1({fetchImpl:e,origin:t=G1,timeoutMs:n=ai,minIntervalMs:s=Jt,lexicon:o=null,userAgent:r=Y1,waitForSlot:i=!1,sourceName:a=K1,label:c=H1}={}){let l=ja({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function u(f,m){let h=Array.isArray(m?.[1])?m[1]:[];for(let b of h){let g=V(b);if(g===f||g.startsWith(f))return String(b)}return null}async function d(f,m){let h=await l.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(m.replace(/ /g,"_"))}`);if(!h)return null;let b=String(h.extract??""),g=Number(h.revision),y={term:f,title:String(h.title??m),text:b,summary:tu(b,eu),url:String(h.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(m.replace(/ /g,"_"))}`),revid:g},w=o;if(!w)try{w=tn()}catch{w=null}let E=w?TE(b,w):null;return E&&(y.isa=E),vo(y)?y:null}async function p(f){let m=await l.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${xa}&search=${encodeURIComponent(f)}&limit=3`),h=m?u(f,m):null;return h?d(f,h):null}return{name:a,origin:t,label:c,beginTurn(){l.beginTurn()},stats(){return l.stats()},provenanceTag(f){return ur(a,f)},async lookup(f){let m=String(f??"");return m?l.cachedFetch(m,()=>p(m)):null},async pageByTitle(f){let m=String(f??"").trim();return m?l.cachedFetch(`title\0${V(m)}`,()=>d(V(m),m)):null},async linkedTitles(f,{limit:m=25}={}){let h=String(f??"").trim();if(!h)return null;let b=await l.cachedFetch(`links\0${V(h)}`,async()=>{let y=(await l.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${xa}&prop=links&redirects=1&page=${encodeURIComponent(h)}&section=0`))?.parse?.links;if(!Array.isArray(y))return null;let w=new Set,E=[];for(let R of y){if(!R||R.ns!==0||R.exists===!1)continue;let v=String(R.title??R["*"]??"").trim(),k=V(v);!v||!k||w.has(k)||(w.add(k),E.push(v))}return E});return Array.isArray(b)?b.slice(0,Math.max(0,m)):null}}}function J1(e={}){return X1({origin:V1,sourceName:LE,label:q1,waitForSlot:!0,...e})}var G1,V1,K1,LE,H1,q1,Y1,PE=P(()=>{Ze();Hn();lr();dr();ka();G1="https://en.wikipedia.org",V1="https://simple.wikipedia.org",K1="wikipedia-live",LE="simple-wikipedia",H1="Wikipedia",q1="Simple English Wikipedia",Y1="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";ii({name:LE,create:J1})});function rP(e,t){let n=Array.isArray(t?.search)?t.search:[],s=null;for(let o of n){let r=String(o?.id??"");if(!DE.test(r))continue;let i=V(o?.label??"");if(i===e)return r;s===null&&i.startsWith(e)&&(s=r)}return s}function iP(e){let t=[];for(let[n,s]of Object.entries(tP)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=oP)return t;if(r>=sP)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");DE.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function aP(e,t,n){for(let s of nP)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function cP({fetchImpl:e,origin:t=Q1,timeoutMs:n=ai,minIntervalMs:s=Jt,userAgent:o=eP,waitForSlot:r=!1,sourceName:i=FE}={}){let a=ja({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),c=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(xa),...d})}`;async function l(d){let p=new Map;if(!d.length)return p;let f=await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[m,h]of Object.entries(f?.entities??{})){let b=V(h?.labels?.en?.value??"");b&&p.set(m,b)}return p}async function u(d){let p=await a.fetchJson(c({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),f=p?rP(d,p):null;if(!f)return null;let h=(await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:f})))?.entities?.[f];if(!h)return null;let b=iP(h),g=await l(b.map(I=>I.id)),y=ur(i,d),w=[],E=new Set;for(let I of b){let x=g.get(I.id);!x||x===d||E.has(`${I.predicate}\0${x}`)||(E.add(`${I.predicate}\0${x}`),w.push({subject:d,predicate:I.predicate,object:x,provenance:y}))}let R=String(h.descriptions?.en?.value??""),v={term:d,title:String(h.labels?.en?.value??""),text:R,summary:tu(R,eu),url:`${t}/wiki/${f}`,revid:Number(h.lastrevid),source:ME,licence:Z1},k=aP(b,g,d);return k&&(v.isa=k),w.length&&(v.facts=w),IE(v)?v:null}return{name:i,origin:t,label:ME,beginTurn(){a.beginTurn()},stats(){return a.stats()},provenanceTag(d){return ur(i,d)},async lookup(d){let p=V(d??"");return p?a.cachedFetch(p,()=>u(p)):null}}}function lP(e={}){return cP({waitForSlot:!0,...e})}var Q1,FE,ME,Z1,eP,tP,nP,sP,oP,DE,zE=P(()=>{Ze();lr();dr();ka();Q1="https://www.wikidata.org",FE="wikidata",ME="Wikidata",Z1="CC0 1.0",eP="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",tP=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),nP=["P279","P31"],sP=3,oP=12,DE=/^Q[1-9][0-9]*$/;ii({name:FE,create:lP})});function pP(e,t){let n=dn(t,e);return n?V(n.lemma):V(e)}function hP(e,t,n,s,o,r){if(!s||r<=0)return[];let i=new Set([n]),a=[];for(let c of String(t??"").matchAll(dP)){if(a.length>=r)break;let l=pP(c[0],o);!l||!Ng(l)||i.has(l)||!s[l]||(i.add(l),Mm(e,l)&&a.push(mP(l)))}return a}function gP({dir:e,lexicon:t=null,sourceName:n=BE}={}){let s=e||AE(),o=t;function r(){if(o)return o;try{o=tn()}catch{o=null}return o}function i(a){let c=V(a??"");if(!c)return null;let l=Mm(s,c);if(!l)return null;let u={...l,term:c};return vo(u)?u:null}return{name:n,origin:uP,provenanceTag(a){return ur(n,a)},async lookup(a){return i(a)},async pageByTitle(a){return i(a)},async linkedTitles(a,{limit:c=fP}={}){let l=i(a);if(!l)return null;let u=Pm(s);return hP(s,l.text,l.term,u,r(),Math.max(0,c))}}}var uP,BE,dP,fP,mP,UE=P(()=>{Ze();Hn();Wn();lr();Fm();dr();uP="https://simple.wikipedia.org",BE="simple-wikipedia-pack",dP=/[A-Za-z][A-Za-z'-]*/g,fP=25;mP=e=>e.charAt(0).toUpperCase()+e.slice(1);ii({name:BE,create:gP})});var bP,wP,s3,Dm=P(()=>{Ze();Hn();Mr();dr();bP=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),wP=["this","is","about","the"],s3=wP.length});var WE=P(()=>{Pt();Qe();wp();Ze();We()});var zm,ou,Ra=P(()=>{zm=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),ou=new Set([...zm,"property","concept","idea","content"])});var GE=P(()=>{Ze();vm();Ra();Ii();_n()});var VE=P(()=>{Ze()});var ru=P(()=>{Tn();Nr()});var KE=P(()=>{Ze()});var yP,HE,qE,YE,M3,XE=P(()=>{KE();ka();yP=250,HE=Object.freeze([{id:"wikimedia-featured",name:"Wikimedia featured feed",kind:"contemporary",format:"wikimedia-feed",url:"https://api.wikimedia.org/feed/v1/wikipedia/en/featured",homepage:"https://www.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"hacker-news",name:"Hacker News",kind:"contemporary",format:"hn",url:"https://hacker-news.firebaseio.com/v0",homepage:"https://news.ycombinator.com/",licence:"user-submitted, discussion linked",browserVerified:"2026-08-08",minIntervalMs:yP,enabledByDefault:!0},{id:"usgs-quakes",name:"USGS earthquakes",kind:"contemporary",format:"usgs",url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",homepage:"https://earthquake.usgs.gov/",licence:"US public domain",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"nyt-world",name:"NYT World News",kind:"contemporary",format:"rss",url:"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",homepage:"https://www.nytimes.com/section/world",licence:"personal use with attribution",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"wikinews-published",name:"Wikinews",kind:"contemporary",format:"mediawiki",url:"https://en.wikinews.org/w/api.php",homepage:"https://en.wikinews.org/",licence:"CC BY 2.5",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"simple-wikipedia",name:"Simple English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://simple.wikipedia.org",homepage:"https://simple.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"wikidata",name:"Wikidata",kind:"kb",format:"wikidata",url:"https://www.wikidata.org",homepage:"https://www.wikidata.org/",licence:"CC0 1.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"wiktionary",name:"Wiktionary",kind:"kb",format:"wiktionary",url:"https://en.wiktionary.org",homepage:"https://en.wiktionary.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!0},{id:"dbpedia-lookup",name:"DBpedia Lookup",kind:"kb",format:"dbpedia-lookup",url:"https://lookup.dbpedia.org",homepage:"https://www.dbpedia.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!1},{id:"english-wikipedia",name:"English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://en.wikipedia.org",homepage:"https://en.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Jt,enabledByDefault:!1}]),qE=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes","nyt-world","wikinews-published"]),YE=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),M3=new Map(HE.map(e=>[e.id,e]))});var jt,D3,z3,B3,U3,W3,G3,V3,K3,H3,q3,Y3,X3,J3,Q3,Z3,e5,t5,n5,s5,Bm=P(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},D3=jt("createRequire"),z3=jt("readFileSync"),B3=jt("access"),U3=jt("readFile"),W3=jt("writeFile"),G3=jt("appendFile"),V3=jt("mkdir"),K3=jt("mkdtemp"),H3=jt("rename"),q3=jt("unlink"),Y3=jt("rm"),X3=jt("stat"),J3=jt("copyFile"),Q3=jt("readdir"),Z3=jt("createReadStream"),e5=jt("createWriteStream"),t5=jt("randomBytes"),n5=jt("spawnSync"),s5=jt("createInterface")});var JE=P(()=>{});var QE=P(()=>{Pt();Bm();Qe();_a();ql();Rm();We();Qt();JE();_n();Ze();Wn();Xl();Hn()});var o4,r4,i4,a4,Wm=P(()=>{Ze();GE();VE();It();Hn();ru();_n();XE();ka();dr();su();QE();o4=Object.freeze({sources:qE,kbSources:YE,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),r4=6*36e5,i4=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),a4=Rs.teach});var Gm=P(()=>{Ze()});var kP,y4,ZE=P(()=>{cr();nu();$o();Qe();Gm();Ze();kP={},y4=ne($e(Xt(kP.url)),"..","..","..")});var v4,S4,E4,ex=P(()=>{v4=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),S4=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),E4=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var T4,_P,TP,tx,A4,C4,I4,O4,N4,nx=P(()=>{Tn();ru();T4=Object.freeze({inline:"inline",enumerated:"enumerated"}),_P=new Set(["in","on","at","for","with","from","of","into","onto"]),TP=new Set(["you","i","it","he","she","they","we","there","someone","something","one","him","her","them","who","himself","herself","itself","themselves","myself","yourself"]),tx=new Set([..._P,"to","behind","before","near","next","along","alongside","under","over","between","among","during","without","about","by","as","like","that","if","when","while","being","because","since","until","so","and","but","or","immediately","likely","usually","normally","currently","is","are","was","were","do","does","did","has","have","had","will","would","could","should","might","must","can"]),A4=new Set([...tx,"be","been"]),C4=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),I4=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),O4=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}]),N4=new Set([...TP,...tx,"a","an","the","some","any","few","many","several","more","most","my","your","his","its","our","their","what","which","where","when","why","how","find","found","put","get","keep","store","place","buy","locate","hide","wear","carry","use","take","open","cross","need","want"])});function Ta(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function iu(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let c=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(AP);if(!c.length)break;let l=o?c.filter(d=>d===o||Km(d,t).has(o)):[];a=(l.length?l:c)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function Km(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function Hm(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,Hm(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function CP(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function IP(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=Km(e,n),l=Km(t,n);if(c.has(t)||l.has(e))return{distinct:!1,reason:"subsumes",lcs:c.has(t)?t:e};if(s.size)for(let h of c){let b=s.get(h);if(b){for(let g of l)if(b.has(g))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...c].filter(h=>l.has(h));if(!u.length)return c.size<2||l.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=h=>Hm(h,n,o,new Set),p=u[0],f=d(p);for(let h of u){let b=d(h);(b>f||b===f&&h<p)&&(p=h,f=b)}if(f<=i)return{distinct:!0,reason:"root-subsumer",lcs:p};if(a){let h=a.get(p);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}return 2*f/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}function au(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],c=n||Ta(t),l=CP(s),u=new Map,d=new Map(a.map(y=>[y,y])),p=y=>{for(;d.get(y)!==y;)d.set(y,d.get(d.get(y))),y=d.get(y);return y},f=(y,w)=>{let E=p(y),R=p(w);E!==R&&d.set(E<R?R:E,E<R?E:R)},m=[];for(let y=0;y<a.length;y+=1)for(let w=y+1;w<a.length;w+=1){let E=IP(a[y],a[w],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[y],b:a[w],...E}),E.distinct||f(a[y],a[w])}let h=new Map;for(let y of a){let w=p(y);h.has(w)||h.set(w,[]),h.get(w).push(y)}let b=y=>Hm(y,c,u,new Set),g=[...h.values()].map(y=>{let w=[...y].sort(),E=w[0],R=b(E);for(let v of w){let k=b(v);k>R&&(R=k,E=v)}return{objects:w,label:E}}).sort((y,w)=>y.label.localeCompare(w.label));return{split:g.length>1,clusters:g,pairs:m}}var AP,cu=P(()=>{It();Ra();AP=(e,t)=>e<t?-1:e>t?1:0});var sx=P(()=>{});function ox(e,{pending:t=null}={}){return t?!0:String(e??"").split(`
170
- `).filter(n=>n.trim()!=="").length>1}var lu,W4,rx=P(()=>{sx();lu=Object.freeze({MEMORY_COUNT:"memory-count",MEMORY_CLASS:"memory-class",LETTER_WORDS:"letter-words",COLLECTION_CONTENTS:"collection-contents",TAUGHT_CLASS_COUNT:"taught-class-count",MEMBERSHIP_LIST:"membership-list",MEMBERSHIP_EXAMPLE:"membership-example",SKOS_NEIGHBOURHOOD:"skos-neighbourhood",WHAT_ELSE:"what-else",FACT_SET:"fact-set",FACT_READBACK:"fact-readback"}),W4=Object.freeze(Object.values(lu))});function qm(e){return typeof e=="string"&&OP.test(e)}function ix(e){return!!e&&typeof e=="object"&&fr(e.s)}function Ym(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&qm(e.world)&&fr(e.subject)&&fr(e.predicate)&&fr(e.object)}function Xm(e){if(!e||typeof e!="object"||e.kind!=="rule"||!qm(e.world)||!fr(e.name)||!LP.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(fr)}function Jm(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&qm(e.world)&&fr(e.opening)}function ax(e){return Ym(e)||Xm(e)||Jm(e)}function cx(e){let t=e||[],n=t.filter(l=>l.predicate===PP).sort((l,u)=>`${l.subject}\0${l.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(l=>l.predicate==="rdf:type").map(l=>l.subject)),o=new Map;for(let l of t)l.predicate==="mgx:located-in"&&o.set(l.subject,l.object);let r=(l,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===l&&o.get(d.subject)===u),i=t.find(l=>typeof l.world=="string"&&l.kind==="fact"),a=(l,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:l,predicate:u,object:d}),c=[];for(let l of n){let u=l.subject,d=l.object;if(r(d,u))continue;let p=d,f=1;for(;s.has(p);)f+=1,p=`${d}-${f}`;s.add(p),c.push(a(p,"rdf:type",d)),c.push(a(p,"rdf:type","portable")),c.push(a(p,"mgx:located-in",u))}return c.length?[...t,...c]:t}var OP,NP,LP,fr,PP,pr=P(()=>{OP=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,NP=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),LP=new Set(NP),fr=e=>typeof e=="string"&&e.trim()!=="";PP="mgx:default-contains"});var MP,FP,K4,Aa=P(()=>{MP=Object.freeze(["mgx:consumes","mgx:display-name","mgx:evades","mgx:guards","mgx:hasMass","mgx:is-predator","mgx:mass-drain-per-turn","mgx:model","mgx:pursues","mgx:vision-radius"]),FP=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),K4=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var uu=P(()=>{});var DP,zP,BP,UP,WP,GP,VP,KP,HP,qP,YP,XP,JP,QP,ZP,eM,tM,nM,sM,J4,oM,lx,Q4,Z4,ux=P(()=>{Hn();Nr();DP="subClassOf",zP="typeAssertion",BP="relation",UP="someValuesFrom",WP="cardinality",GP="disjointWith",VP="possessive",KP="adjective",HP="capability",qP="union",YP="complement",XP="negativeType",JP="enumeration",QP="differentFrom",ZP="bareExistential",eM="transitiveRole",tM="inverseRole",nM="universal",sM="subPropertyOf",J4=Object.freeze([DP,zP,BP,UP,WP,GP,VP,KP,HP,qP,YP,XP,JP,QP,ZP,eM,tM,nM,sM]),oM=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),lx=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),Q4=Math.max(...[...lx.keys()].map(e=>e.split(" ").length)),Z4=[...new Set([...oM,...[...lx.keys()].map(e=>e.split(" ")[0])])]});var mr=P(()=>{});var Qm=P(()=>{Fe();ns();mr()});function Gt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:So.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var rM,So,xe,iM,hr,ht,nn,fn,aM,dx,Wt,cM,lM,fx,iX,aX,cX,ci=P(()=>{rM=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),So=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),xe=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),iM=Object.freeze([xe.MemoryTerm]),hr=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ht=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:So.Parameter,name:e,kind:t,arg:n,required:s,note:o}),nn=()=>Object.freeze({type:So.Precondition,pred:hr.graphLoaded}),fn=(e,t)=>Object.freeze({type:So.Precondition,pred:hr.resolves,param:e,as:t}),aM=e=>Object.freeze({type:So.Precondition,pred:hr.anyPresent,params:Object.freeze([...e])}),dx=()=>Object.freeze({type:So.Precondition,pred:hr.memoryFacts}),Wt=(e,t=null)=>Object.freeze({type:So.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});cM=Object.freeze([Gt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ht("query",xe.Query,{required:!1,note:"required unless a kind filter is given"}),ht("kind",xe.Kind,{required:!1}),ht("name",xe.Query,{required:!1}),ht("decorator",xe.Query,{required:!1})],preconditions:[nn(),aM(["query","kind"])],add:[Wt("matches","query")]}),Gt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("description","symbol")]}),Gt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("signature","symbol")]}),Gt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ht("module",xe.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[nn(),fn("module",xe.Symbol)],add:[Wt("impact","module")]}),Gt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ht("class",xe.Class,{arg:"class"})],preconditions:[nn(),fn("class",xe.Class)],add:[Wt("members","class")]}),Gt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ht("class",xe.Class,{arg:"class"})],preconditions:[nn(),fn("class",xe.Class)],add:[Wt("subclasses","class")]}),Gt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ht("module",xe.Module)],preconditions:[nn(),fn("module",xe.Module)],add:[Wt("exports","module")]}),Gt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("callers","symbol")]}),Gt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("callees","symbol")]}),Gt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("calls","symbol")]}),Gt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("tests","symbol")]}),Gt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[nn()],add:[Wt("untested",null)]}),Gt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("history","symbol")]}),Gt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ht("symbol",xe.Symbol)],preconditions:[nn(),fn("symbol",xe.Symbol)],add:[Wt("cochanges","symbol")]}),Gt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ht("package",xe.Package,{required:!1})],preconditions:[nn()],add:[Wt("architecture","package")]}),Gt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[ht("term",xe.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[dx(),fn("term",xe.MemoryTerm)],add:[Wt("related","term")]}),Gt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[ht("class",xe.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),ht("expression",xe.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ht("size",xe.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[dx(),fn("class",xe.MemoryTerm)],add:[Wt("sprite","class")]})]),lM=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),fx=cM,iX=lM(fx),aX=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),cX=Object.freeze({prefixes:rM,vocab:So,kinds:xe,precond:hr,get capabilities(){return fx}})});var Zm=P(()=>{ci()});var du=P(()=>{_n()});var eh=P(()=>{ci()});function mM(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(no,n)&&(t.expression=n),!t.size&&ga([{predicate:pM,object:n}])!==1&&(t.size=n);return t}var AX,CX,IX,OX,pM,NX,th=P(()=>{ns();Zn();Ml();Ze();Fe();qa();pm();ci();eh();AX=new RegExp(`\\b(?:${Object.keys(Jn).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),CX=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),IX=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),OX=Object.freeze({}),pM="mgx:hasProperty";NX=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:mM},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var hx=P(()=>{});var gM,gx=P(()=>{th();ci();eh();hx();ns();gM=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var fu=P(()=>{uu();du();th();gx();ci();Zm()});function yM(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(wM,"corpus","worlds")}function bx(e){try{return Ea(ar(e))}catch{return null}}function wx(e){if(sh.has(e))return sh.get(e);let t=null,n=bx(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return sh.set(e,t),t}function $M(e,t){let n=wx(e);if(!n)return null;let s=n[String(t??"")];if(!ix(s))return null;let o=`${e}\0${t}`;if(oh.has(o))return oh.get(o);let r=null,i=bx(ne(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],c=[],l=null;for(let u of i.toString("utf8").split(`
171
- `))if(u.trim())try{let d=JSON.parse(u);if(!ax(d)||d.world!==t)continue;Ym(d)?a.push(d):Xm(d)?c.push(d):Jm(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:cx(a),rules:c,meta:l})}return oh.set(o,r),r}var SM,wM,sh,oh,vM,o8,pu=P(()=>{cr();nu();$o();Qe();pr();SM={},wM=ne($e(Xt(SM.url)),"..","..","..");sh=new Map,oh=new Map;vM=e=>({list:async()=>{let t=wx(e());return t?Object.keys(t).sort():null},load:async t=>$M(e(),t)}),o8=vM(()=>yM())});var p8,yx=P(()=>{Pt();Qe();Wn();vi();_n();We();p8=ne(".tmct","memory","blocks")});var $x=P(()=>{mr()});var Sx=P(()=>{Wn();vi();mr()});var rh=P(()=>{Wn();vi();mr()});var Ex=P(()=>{rh();Wn();_s();mr()});var xx=P(()=>{});var jx=P(()=>{$x();Sx();rh();Ex();xx();mr()});var kx=P(()=>{yx();We();Ic();ql();jx();Qm()});function li(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function hu(e){let t=n=>kM.map((s,o)=>`--${n}-t${o+1}: ${li(e[n],s)};`).join(" ");return[`--bg: ${e.bg}; --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --card: ${e.card};`,`--taught: ${e.taught}; --corpus: ${e.corpus}; --entail: ${e.entail}; --alert: ${e.alert};`,t("taught"),t("corpus"),t("entail"),`--taught-soft: ${li(e.taught,.12)}; --corpus-soft: ${li(e.corpus,.12)};`,`--entail-soft: ${li(e.entail,.14)}; --alert-soft: ${li(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${li(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var mu,kM,r6,ih=P(()=>{ru();mu=Object.freeze({light:Object.freeze({bg:"#F7F6F2",ink:"#23272B",muted:"#6E7168",line:"#DDD9D0",card:"#FFFFFF",taught:"#2E7D4F",corpus:"#5A80AC",entail:"#B07C2E",alert:"#B0503F",popRimAlpha:.66,popShadow:"0 1px 1.2px rgba(0, 0, 0, .30)"}),dark:Object.freeze({bg:"#15181C",ink:"#E7E5DF",muted:"#9A9E95",line:"#2B3036",card:"#1C2126",taught:"#5FBE8B",corpus:"#6C93BF",entail:"#D9A554",alert:"#D08070",popRimAlpha:.45,popShadow:"0 1px 1.4px rgba(0, 0, 0, .55)"})}),kM=[.35,.65,1];r6=`
172
- :root { color-scheme: light dark; ${hu(mu.light)} }
173
- @media (prefers-color-scheme: dark) { :root { ${hu(mu.dark)} } }
174
- :root[data-theme="dark"] { ${hu(mu.dark)} }
175
- :root[data-theme="light"] { ${hu(mu.light)} }
176
- `});var Rx=P(()=>{ih()});var _x=P(()=>{ih()});var Ax=P(()=>{We();pr();Tn();ui()});var Ix=P(()=>{_s();We();uu();fu();ui()});var ch,NM,LM,PM,MM,FM,DM,sJ,oJ,ui=P(()=>{pr();Aa();uu();ux();Hn();Wl();Qm();Zm();fu();du();pu();We();kx();Rx();_x();Ax();Ix();ch="mgx:world-epoch",NM=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),LM=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),PM="mgx:is-open",MM="mgx:hasMass",FM="mgx:knows-about",DM="mgx:display-name",sJ=new Set([...NM,...LM,PM,MM,FM,DM,"rdf:type",ch]),oJ=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var di,iJ,aJ,cJ,lJ,uJ,dJ,Eo=P(()=>{di=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),iJ=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),aJ=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),cJ=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),lJ=Object.freeze({teach:"teach"}),uJ=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),dJ=Object.freeze({max_depth:"maxDepth"})});var Lx,zM,bu,BM,UM,Px,Mx,WM,GM,mJ,VM,KM,Fx=P(()=>{Eo();Lx="spider-fly",zM=10,bu=Object.freeze({x:2,y:2}),BM=1,UM=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),Px=(e,t)=>`cell-${e}-${t}`,Mx=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),WM=(e,t)=>Mx(e,t,bu.x,bu.y)<=BM,GM=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),mJ=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),VM="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",KM=Object.freeze({name:Lx,gridSize:zM,opening:VM,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:WM,webHomeCell:Px(bu.x,bu.y)})});var Dx,Wx,bJ,wJ,yJ,lh,zx,Bx,Ux,uh,$J,vJ,wu=P(()=>{Eo();Dx=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),Wx=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),bJ=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),wJ=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),yJ=Object.freeze([Dx.spawnedFood,Dx.placedFood]),lh=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),zx=lh({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),Bx=lh({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),Ux=lh({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),uh=Object.freeze({[zx.name]:zx,[Bx.name]:Bx,[Ux.name]:Ux}),$J=Object.freeze(Object.keys(uh)),vJ=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var dh=P(()=>{});var Gx=P(()=>{});var Ia,HJ,tF,nF,sF,oF,rF,iF,aF,cF,lF,uF,dF,fF,pF,mF,hF,gF,bF,qJ,fh=P(()=>{wu();dh();_s();We();pr();Gx();Ze();Eo();Aa();ui();Ia=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),HJ=Object.freeze(["predator","prey"]),tF="mgx:currently-in",nF="mgx:hasMass",sF="mgx:feels",oF="mgx:facing",rF="mgx:driven-facing",iF="mgx:eaten-by",aF="mgx:starved",cF="mgx:placed-by",lF="mgx:model",uF="mgx:rotation",dF="mgx:carrying",fF="mgx:prey-eaten",pF="mgx:web-built-at-turn",mF="mgx:laid-at-turn",hF="mgx:hatched-into",gF="mgx:turn-played",bF=new Set([tF,nF,sF,oF,rF,iF,aF,cF,lF,uF,gF,dF,fF,pF,mF,hF,"rdf:type",ch]),qJ=Object.freeze([...bF].sort())});var f9,p9,Kx=P(()=>{Fx();wu();fh();pr();pu();We();Eo();f9=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),p9=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var W9,G9,V9,K9,H9,q9,Y9,vF,SF,EF,xF,Hx,qx,jF,X9,J9,Yx=P(()=>{wu();fh();ui();Tn();pr();pu();We();Eo();Aa();dh();du();_s();W9=Ia.predator.kind,G9=Ia.prey.kind,V9=Ia.food.spawnedKind,K9=Ia.food.placedKind,H9=Object.freeze(new Set(["river-crossing"])),q9=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),Y9=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),vF="mgx:currently-in",SF="mgx:hasMass",EF="mgx:feels",xF="mgx:facing",Hx="(fox|goblin|crumb|morsel)(?:-(\\d+))?",qx="(fox|goblin)(?:-(\\d+))?",jF="(crumb|morsel)(?:-(\\d+))?",X9=[{kind:"placement",predicate:vF,re:new RegExp(`^(?:the\\s+)?${Hx}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:SF,re:new RegExp(`^(?:the\\s+)?${Hx}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:EF,re:new RegExp(`^(?:the\\s+)?${qx}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:xF,re:new RegExp(`^(?:the\\s+)?${qx}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],J9=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${jF}\\s+there[.!\\s]*$`,"i")});var Xx=P(()=>{Aa()});var kt,oQ,rQ,iQ,aQ,cQ,lQ,uQ,dQ,fQ,pQ,mQ,hQ,gQ,bQ,wQ,yQ,$Q,vQ,kF,Jx=P(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},oQ=kt("createRequire"),rQ=kt("readFileSync"),iQ=kt("access"),aQ=kt("readFile"),cQ=kt("writeFile"),lQ=kt("appendFile"),uQ=kt("mkdir"),dQ=kt("mkdtemp"),fQ=kt("rename"),pQ=kt("unlink"),mQ=kt("rm"),hQ=kt("stat"),gQ=kt("copyFile"),bQ=kt("readdir"),wQ=kt("createReadStream"),yQ=kt("createWriteStream"),$Q=kt("randomBytes"),vQ=kt("spawnSync"),kF=kt("createInterface")});var Rt,EQ,xQ,jQ,kQ,RQ,_Q,TQ,AQ,CQ,IQ,OQ,NQ,LQ,PQ,MQ,FQ,DQ,Qx,zQ,ph=P(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},EQ=Rt("createRequire"),xQ=Rt("readFileSync"),jQ=Rt("access"),kQ=Rt("readFile"),RQ=Rt("writeFile"),_Q=Rt("appendFile"),TQ=Rt("mkdir"),AQ=Rt("mkdtemp"),CQ=Rt("rename"),IQ=Rt("unlink"),OQ=Rt("rm"),NQ=Rt("stat"),LQ=Rt("copyFile"),PQ=Rt("readdir"),MQ=Rt("createReadStream"),FQ=Rt("createWriteStream"),DQ=Rt("randomBytes"),Qx=Rt("spawnSync"),zQ=Rt("createInterface")});var Zx=P(()=>{ph();Qe();Pt();Qe();ia();Qt()});var ej=P(()=>{});var RF,tj=P(()=>{Pt();Qe();We();ej();RF=ne(".tmct","sessions")});var nj=P(()=>{Pt();Qe();Gl()});var sj,yu,oj=P(()=>{sj=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),yu=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var _t,a7,c7,l7,u7,d7,f7,p7,m7,h7,g7,b7,w7,y7,$7,v7,S7,E7,x7,rj,ij=P(()=>{_t=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},a7=_t("createRequire"),c7=_t("readFileSync"),l7=_t("access"),u7=_t("readFile"),d7=_t("writeFile"),f7=_t("appendFile"),p7=_t("mkdir"),m7=_t("mkdtemp"),h7=_t("rename"),g7=_t("unlink"),b7=_t("rm"),w7=_t("stat"),y7=_t("copyFile"),$7=_t("readdir"),v7=_t("createReadStream"),S7=_t("createWriteStream"),E7=_t("randomBytes"),x7=_t("spawnSync"),rj=_t("createInterface")});var dj={};Lt(dj,{CONTEXT_PASSAGE_PREDICATE:()=>cj,CO_OCCURS_PREDICATE:()=>$u,ingestUnknownFromAssertions:()=>AF,knownTermsFrom:()=>lj,passageFor:()=>uj});function lj(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==et)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(V(r)),i&&n.add(V(i))}for(let s of t||[])s?.subject&&n.add(V(s.subject)),s?.object&&n.add(V(s.object));return n}function uj(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=xo(e?.start),o=xo(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function TF(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<aj;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(_F.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=aj))break}return o}async function AF(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await mt(e),c=lj(a,s),l=new Set,u=[];for(let f of t){if(l.size>=i)break;let m=n.get(f.rel);if(!m||m.ace!=="none")continue;let h=xo(f.start),b=xo(f.end);if(!h||!b)continue;let g=V(h),y=V(b),w=!c.has(g),E=!c.has(y);if(!w&&!E)continue;let R=uj(f,m);if(!R)continue;let v=[[h,b,w],[b,h,E]];for(let[k,I,x]of v){if(!x||l.size>=i)continue;let T=V(k);if(l.has(T))continue;let $=`${r} ${f.rel}`;u.push({subject:k,predicate:cj,object:R,provenance:$}),u.push({subject:k,predicate:$u,object:I,provenance:$});let _=TF(R,c,new Set([g,y]));for(let C of _)u.push({subject:k,predicate:$u,object:C,provenance:$});l.add(T),c.add(T)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await Kn(e,u),p=u.filter(f=>f.predicate===$u).length;return{captured:l.size,linked:p,appended:d.appended,skipped:d.skipped}}var cj,$u,_F,aj,fj=P(()=>{We();vu();cj="mgx:contextPassage",$u="mgx:coOccursWith",_F=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),aj=3});var pj={};Lt(pj,{MAP_FILE:()=>Na,SEON_CONCEPTS_FILE:()=>Su,SEON_DEFINITIONS_FILE:()=>CF,SLICE_FILE:()=>Oa,TIER2_DIR:()=>ws,TIER2_MANIFEST_FILE:()=>IF,WORDNET_DIR:()=>La,loadMap:()=>xu,loadSlice:()=>Eu,seedMemory:()=>NF,termText:()=>xo,toFacts:()=>ju});async function Eu(e=Oa){let t=rj({input:hE(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function xu(e=Na){let n=Zo(await Ie(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!OF.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function ju(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=xo(o.start),a=xo(o.end);if(!i||!a)continue;let c=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${c} ${o.rel}`})}return s}async function NF(e,{limit:t,slicePath:n=Oa,mapPath:s=Na,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([Eu(n),xu(s)]),u=ju(c,l,r);if(Array.isArray(o)&&o.length){let y=new Map(o.map((w,E)=>[w,E]));u=u.slice().sort((w,E)=>(y.get(w.predicate)??o.length)-(y.get(E.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(y,w,E)=>`${V(y)} ${w} ${V(E)}`,p=new Set,f=await mt(e);for(let y of f.individuals||[]){if(y?.class!=="Fact")continue;let w=E=>(y.attributes||[]).find(R=>R.key===E)?.value;p.add(d(w("subject"),w("predicate"),w("object")))}let m=0,h=[];for(let y of u){let w=d(y.subject,y.predicate,y.object);if(p.has(w)){m+=1;continue}p.add(w),h.push(y)}let b=await Kn(e,h),g;if(i){let{ingestUnknownFromAssertions:y}=await Promise.resolve().then(()=>(fj(),dj));g=await y(e,{assertions:c,map:l,mappedFacts:u,memory:f,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:b.appended,skipped:m+b.skipped,total:u.length,...g?{unknown:g}:{}}}var LF,fi,Oa,Na,Su,CF,ws,IF,La,L7,OF,xo,vu=P(()=>{cr();Pt();ij();$o();Qe();dl();We();LF={},fi=ne($e(Xt(LF.url)),"..","..",".."),Oa=ne(fi,"corpus","conceptnet","slice.jsonl"),Na=ne(fi,"src","adapters","corpus","conceptnet-map.toml"),Su=ne(fi,"corpus","domains","code","concepts.jsonl"),CF=ne(fi,"corpus","domains","code","definitions.jsonl"),ws=ne(fi,"corpus","tier2"),IF=ne(ws,"manifest.json"),La=ne(fi,"corpus","wordnet"),L7=ne(La,"manifest.json"),OF=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);xo=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var yj={};Lt(yj,{BUILTIN_EXTENSIONS:()=>DF,EXTENSION_KINDS:()=>ku,activeDomainPacks:()=>wh,defaultCodeDomainPacks:()=>wj,defaultCodeLaneVocab:()=>bj,mergedLaneVocab:()=>bh,mergedLexiconExtra:()=>gj,resolveExtensions:()=>hj,seedActiveCorpusEntries:()=>UF,validateExtensionEntry:()=>mj,validateExtensionPack:()=>GF});function Ru(){return{seon:{kind:"corpus",active:!1,corpusPath:Su,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Su,provenancePrefix:"corpus:seon",vocabPath:MF,vocabData:sj,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:Oa,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:FF},human:{kind:"corpus",active:!0,corpusPath:ne(ws,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(ws,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(ws,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(ws,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:mh,vocabData:yu,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(ws,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:mh,vocabData:yu,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(ws,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:mh,vocabData:yu,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(ws,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(La,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(La,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(PF,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function mj(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!ku.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${ku.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function BF(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${ku.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=zF(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function hj(e,{configFile:t}={}){let n=e?await ml(e,t?{file:t}:{}):null,s=Ru(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let p of i){let f=BF(p,s[p]||null,o[p]||{},e||process.cwd());mj(p,f),a.set(p,f)}let c={};for(let[p,f]of Object.entries(r)){if(typeof f!="number"||!Number.isFinite(f))throw new Error(`[bias] "${p}": bias must be a finite number, got ${JSON.stringify(f)}`);c[p]=f}let u=["seon","conceptnet",...[...a.keys()].filter(p=>p!=="seon"&&p!=="conceptnet").sort()].filter(p=>a.has(p));return{entries:new Map(u.map(p=>[p,a.get(p)])),biasByBundle:c}}async function UF(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(vu(),pj)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,c=0,l=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let f=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:f.appended,skipped:f.skipped,total:f.total},a+=f.appended,c+=f.skipped,l+=f.total}catch(f){i[u]={appended:0,skipped:0,total:0,error:f&&f.message?f.message:String(f)}}return{appended:a,skipped:c,total:l,perBundle:i}}async function gj(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Ie(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function bh(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Ie(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function bj(){if(!hh){let e={...Ru().code,active:!0};hh=bh(new Map([["code",e]]),{})}return hh}async function WF(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Ie(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function wh(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await WF(o.name,o.entry));return s}function wj(){if(!gh){let e={...Ru().code,active:!0};gh=wh(new Map([["code",e]]),{})}return gh}async function GF(e,t){let n=[],s=o=>o&&(Xu(o)?o:Kt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await Eu(o),i=await xu(s(t.mapPath)||Na),a=ju(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(Hn(),xE)),i=JSON.parse(await Ie(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(Vl(),pE)),i=await r(o),a=[...i.keys()].filter(c=>!c.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Ie(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,c=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:c}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var yh,PF,MF,mh,ku,FF,DF,zF,hh,gh,$h=P(()=>{Qe();Pt();$o();oj();ia();vu();yh={},PF=ne($e(Xt(yh.url)),"..","..","corpus","namenet"),MF=ne($e(Xt(yh.url)),"..","..","corpus","domains","code","vocab.json"),mh=ne($e(Xt(yh.url)),"..","..","corpus","tier2","vocab-empty.json"),ku=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),FF=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];DF=Object.freeze(Ru());zF=(e,t)=>{if(t==null)return;let n=String(t);return Xu(n)?n:Kt(e,n)};hh=null;gh=null});var $j=P(()=>{});var vj=P(()=>{Qe();cr();Pt();Bm();Jx();ph();Qt();Zx();Fe();tj();Gl();nj();$i();$h();_a();Eo();Wl();fu();Dm();Wm();dr();$j()});var Sj={};Lt(Sj,{proseLemma:()=>HF});function HF(){if(gr!==void 0)return gr;try{let e=Yl();if(!e)return gr=null,gr;let t=e.its,n=new Map;gr=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{gr=null}return gr}var gr,Ej=P(()=>{Xl()});var xj={};Lt(xj,{digestTermFromRows:()=>XF,loadDigestStructureTable:()=>YF,readDigestStructures:()=>qF});var qF,YF,XF,jj=P(()=>{qF=()=>null,YF=()=>null,XF=()=>null});var _h={};Lt(_h,{DEFAULT_MODULE_HOPS:()=>xh,DEFAULT_PROVE_BRANCHES:()=>Nj,DEFAULT_PROVE_NODES:()=>Lj,DEFAULT_PROVE_STEPS:()=>Oj,MAX_PROVEN_CASES:()=>Mj,MAX_ROLE_ASSERTIONS:()=>Pj,TABLEAU_RULE_CONFIDENCE:()=>nD,buildTableauKb:()=>jD,canonicalKey:()=>Ke,extractTableauModule:()=>_D,findTableauViolations:()=>RD,isSatisfiable:()=>kh,moduleHasDlShape:()=>AD,proveEntailment:()=>vD,proveSubsumption:()=>SD,proveSubsumptionOfNegation:()=>ED,toNNF:()=>sn});function Ke(e){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("canonicalKey: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return"top";case"bot":return"bot";case"atom":return`atom(${e.name})`;case"nom":return`nom(${e.ind})`;case"not":return`not(${Ke(e.c)})`;case"and":return`and(${e.cs.map(Ke).sort().join(",")})`;case"or":return`or(${e.cs.map(Ke).sort().join(",")})`;case"some":return`some(${e.r},${Ke(e.c)})`;case"all":return`all(${e.r},${Ke(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${Ke(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${Ke(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function Pa(e,t){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("toNNF: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return t?{t:"bot"}:{t:"top"};case"bot":return t?{t:"top"}:{t:"bot"};case"atom":return t?{t:"not",c:{t:"atom",name:e.name}}:{t:"atom",name:e.name};case"nom":return t?{t:"not",c:{t:"nom",ind:e.ind}}:{t:"nom",ind:e.ind};case"not":return Pa(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>Pa(o,t));return s.sort((o,r)=>Ke(o).localeCompare(Ke(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=Pa(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=Pa(e.c,!1);return t?e.t==="atLeast"?{t:"atMost",n:e.n-1,r:e.r,c:n}:{t:"atLeast",n:e.n+1,r:e.r,c:n}:{t:e.t,n:e.n,r:e.r,c:n}}default:throw new TypeError(`toNNF: unknown expression tag "${e.t}"`)}}function sn(e){return Pa(e,!1)}function Vt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function Sh(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function ZF(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Ij(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function eD(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function tD(e,t){let n=(e||[]).map(([r,i])=>[vs(r),vs(i)]),s=eD(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=vs(r);o.set(i,new Set([i,...s(i)]))}return o}function kj(e,t,n){let s=vs(t),o=vs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Au(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&kj(t,r.r,s))o.push({to:r.to,fromFacts:r.fromFacts});else if(r.to===n){let i=t&&t.inverseOf?t.inverseOf.get(vs(r.r)):null;i&&kj(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function _u(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!sD.test(t)}function Ma(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function oD(e,t,n,s){if(t===n)return;let o=Ma(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,Vt(r?[...r,...s]:s))}function Fj(e,t,n,s){return n===s?!1:_u(t,n)&&_u(t,s)?!0:e.inequalityFrom.has(Ma(n,s))}function Dj(e,t,n){let s=e.inequalityFrom.get(Ma(t,n));return s?s.slice():[]}function rD(e,t,n){let s=_u(e,t),o=_u(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function zj(e,t,n,s){if(n===s)return n;let[o,r]=rD(t,n,s),i=e.nodes.get(o),a=e.nodes.get(r);if(!i||!a)return o;for(let[d,{expr:p,from:f}]of a.labels){let m=i.labels.get(d);i.labels.set(d,{expr:p,from:m?Vt([...m.from,...f]):f.slice()})}let c=[],l=new Map;for(let d of e.edges){let p=d.from===r?o:d.from,f=d.to===r?o:d.to,m=`${p}\u241F${d.r}\u241F${f}`,h=l.get(m);if(h)h.fromFacts=Vt([...h.fromFacts,...d.fromFacts]);else{let b={from:p,r:d.r,to:f,fromFacts:d.fromFacts.slice()};l.set(m,b),c.push(b)}}e.edges=c;for(let d of e.nodes.values())d.parent===r&&(d.parent=o);let u=new Map;for(let[d,p]of e.inequalityFrom){let[f,m]=d.split("\u241F"),h=f===r?o:f,b=m===r?o:m;if(h===b)continue;let g=Ma(h,b),y=u.get(g);u.set(g,y?Vt([...y,...p]):p)}return e.inequalityFrom=u,e.nodes.delete(r),o}function jh(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function qn(e,t,n){let s=Ke(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:Vt(n)}),!0)}function pi(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Tu(e){if(e.labels.has("bot"))return{nodeId:e.id,keyA:"bot",keyB:"bot",premises:e.labels.get("bot").from.slice()};let t=[...e.labels.keys()].sort();for(let n of t){let{expr:s,from:o}=e.labels.get(n),r=Ke(sn($s(s)));if(r<=n)continue;let i=e.labels.get(r);if(i)return{nodeId:e.id,keyA:n,keyB:r,premises:Vt([...o,...i.from])}}return null}function Rj(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function Bj(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?Rj(t,e.id):null,i=e.parent;for(;i;){let a=t.nodes.get(i);if(!a)break;if(s.length===a.labels.size&&s.every(c=>a.labels.has(c))){if(!o)return!0;let c=Rj(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function _j(e){let t=new Map;for(let[n,s]of e.nodes)t.set(n,{id:s.id,labels:new Map(s.labels),parent:s.parent,branchedOn:new Set(s.branchedOn),appliedAxioms:new Set(s.appliedAxioms),successorCount:s.successorCount});return{nodes:t,edges:e.edges.slice(),closed:!1,clash:null,inequalityFrom:new Map(e.inequalityFrom),choices:(e.choices||[]).slice()}}function iD(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of pi(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)qn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function aD(e,t){let n=new Map;for(let o of e.nodes.values())for(let r of o.labels.keys())r.startsWith("nom(")&&(n.has(r)||n.set(r,[]),n.get(r).push(o.id));let s=[...n.keys()].sort();for(let o of s){let r=[...new Set(n.get(o))].sort();if(r.length<2)continue;let[i,a]=r;if(Fj(e,t,i,a)){let c=e.nodes.get(i).labels.get(o)?.from||[],l=e.nodes.get(a).labels.get(o)?.from||[];return{kind:"clash",clash:{nodeId:i,keyA:o,keyB:`merge(${i},${a})`,premises:Vt([...c,...l,...Dj(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function cD(e,t){let n=t&&t.transitiveRoles instanceof Set?t.transitiveRoles:null;for(let s of e.nodes.values())for(let[,{expr:o,from:r}]of pi(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Au(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];qn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&qn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function lD(e,t){for(let n of e.nodes.values())for(let s=0;s<t.axioms.length;s+=1){if(n.appliedAxioms.has(s))continue;let o=t.axioms[s];if(n.appliedAxioms.add(s),qn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function uD(e,t){if(Ke(t)==="bot")return[];let n=Ke(sn($s(t))),s=e.labels.get(n);return s?s.from:null}function dD(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function fD(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of pi(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,p)=>Ke(d).localeCompare(Ke(p)));if(i.some(d=>n.labels.has(Ke(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:uD(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=dD(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:Ke(i[0]),keyB:Ke(sn($s(i[0]))),premises:Vt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),qn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function pD(e,t){for(let n of e.nodes.values())if(!Bj(n,e,t))for(let[,{expr:s,from:o}]of pi(n)){if(s.t!=="some")continue;let r=Ke(s.c);if(Au(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=jh(`${n.id}.${n.successorCount}`,n.id);return qn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()}),{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function mD(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of pi(n)){if(o.t!=="atMost")continue;let i=Ke(o.c),a=[...new Set(Au(e,t,n.id,o.r).map(u=>u.to))].filter(u=>e.nodes.get(u)?.labels.has(i)).sort();if(a.length<=o.n)continue;let c=[];for(let u=0;u<a.length;u+=1)for(let d=u+1;d<a.length;d+=1)c.push([a[u],a[d]]);if(c.length===0){let u=e.nodes.get(a[0])?.labels.get(i)?.from||[];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`witness(${a[0]})`,premises:Vt([...r,...u])}}}let l=c.filter(([u,d])=>!Fj(e,t,u,d));if(l.length===0){let[u,d]=c[0];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`merge(${u},${d})`,premises:Vt([...r,...Dj(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function hD(e,t){for(let n of e.nodes.values())if(!Bj(n,e,t))for(let[,{expr:s,from:o}]of pi(n)){if(s.t!=="atLeast")continue;let r=Ke(s.c),i=[...new Set(Au(e,t,n.id,s.r).map(c=>c.to))].filter(c=>e.nodes.get(c)?.labels.has(r)).sort();if(i.length>=s.n)continue;n.successorCount+=1;let a=jh(`${n.id}.${n.successorCount}`,n.id);qn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()});for(let c of i)oD(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function gD(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Tu(s);if(o)return o}return null}function br(e,t){let n=gD(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function bD(e,t){let n=iD(e);if(n.applied)return br(e,n.touched);let s=cD(e,t);if(s.applied)return br(e,s.touched);let o=aD(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=zj(e,t,o.a,o.b);return br(e,[u])}let r=lD(e,t);if(r.applied)return br(e,r.touched);let i=fD(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),br(e,i.touched);if(i.kind==="split")return i;let a=mD(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=hD(e,t);if(c.applied)return br(e,c.touched);let l=pD(e,t);return l.applied?br(e,l.touched):{kind:"done"}}function wD(e){let t=[...e.nodes.values()].map(s=>({id:s.id,parent:s.parent,labels:[...s.labels.entries()].sort((o,r)=>o[0].localeCompare(r[0])).map(([,{expr:o,from:r}])=>({expr:o,from:r}))})),n=e.edges.map(({from:s,r:o,to:r,fromFacts:i})=>({from:s,r:o,to:r,fromFacts:i.slice()}));return{nodes:t,edges:n}}function yD(e,t,n){let s=Sh(n.maxSteps,Oj),o=Sh(n.maxBranches,Nj),r=Sh(n.maxNodes,Lj),i=[e],a=0,c=1,l=[];for(;i.length;){let u=i.pop();if(u.closed){l.push(u.clash);continue}if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};for(;;){let d=bD(u,t);if(d.kind==="clash"){let p=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:p});break}if(d.kind==="applied"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};continue}if(d.kind==="split"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.disjuncts.map(f=>{let m=_j(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);qn(h,f,d.from);let b=Tu(h);return b&&(m.closed=!0,m.clash={...b,choices:m.choices.slice()}),m});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}if(d.kind==="split-merge"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.pairs.map(([f,m])=>{let h=_j(u),b=zj(h,t,f,m),g=h.nodes.get(b),y=g&&Tu(g);return y&&(h.closed=!0,h.clash={...y,choices:h.choices.slice()}),h});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}return{status:"satisfiable",model:wD(u),steps:a,branches:c}}if(c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c}}return{status:"unsatisfiable",clashes:l,steps:a,branches:c}}function $D(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,jh(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])qn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||qn(s(i.ind),sn(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])qn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=Ma(i.a,i.b),c=o.get(a);o.set(a,Vt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function kh(e,t=[],n={}){let s=$D(e,t);for(let r of s.nodes.values()){let i=Tu(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=yD(s,e,n);return o.status==="exhausted"?{satisfiable:null,exhausted:o.reason,steps:o.steps,branches:o.branches}:o.status==="satisfiable"?{satisfiable:!0,model:o.model,steps:o.steps,branches:o.branches}:{satisfiable:!1,closedClashes:o.clashes,steps:o.steps,branches:o.branches}}function Rh(e,t,n){let s=kh(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=Vt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(Ke(d),d);let i=[...r.keys()].sort(),a=i.slice(0,Mj).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function vD(e,t,n,s={}){return Rh(e,[{ind:t,expr:sn($s(n)),from:[]}],s)}function SD(e,t,n,s={}){let o=sn(Aj([De(t),$s(De(n))]));return Rh(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function ED(e,t,n,s={}){let o=sn(Aj([De(t),De(n)]));return Rh(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function xD(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function jD(e){let t=Array.isArray(e)?e.filter(L=>L&&L.subject&&L.predicate):[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=[],d=[],p=[],f=[],m=new Set,h=[],b=[],g=[],y=[],w=(L,H,W)=>{L.has(H)||L.set(H,[]),L.get(H).push(W)};for(let L of t){let H=String(L.predicate).trim().toLowerCase();H==="owl:onproperty"?n.set(L.subject,{object:L.object,id:L.id}):H==="owl:somevaluesfrom"?s.set(L.subject,{object:L.object,id:L.id}):H==="owl:allvaluesfrom"?o.set(L.subject,{object:L.object,id:L.id}):H==="owl:onclass"?r.set(L.subject,{object:L.object,id:L.id}):H==="owl:mincardinality"?i.set(L.subject,{kind:"min",n:Number(L.object),id:L.id}):H==="owl:maxcardinality"?i.set(L.subject,{kind:"max",n:Number(L.object),id:L.id}):H==="owl:cardinality"?i.set(L.subject,{kind:"exact",n:Number(L.object),id:L.id}):H==="rdfs:subclassof"?u.push(L):H==="owl:disjointwith"?d.push(L):H==="rdf:type"?(p.push(L),String(L.object||"").toLowerCase()==="transitiveproperty"&&m.add(L.subject)):H==="mgxneg:subclassof"?f.push(L):H==="owl:unionof"?w(a,L.subject,L):H==="owl:complementof"?c.set(L.subject,L):H==="rdfs:subpropertyof"?h.push(L):H==="owl:differentfrom"?b.push(L):H==="owl:oneof"?w(l,L.subject,L):H==="owl:inverseof"?g.push(L):y.push(L)}let E=new Set;for(let L of p){let H=String(L.object||"").toLowerCase();Eh.has(H)||E.add(L.subject)}let R=Ij(E,y),v=L=>R.has(L)||Cj.test(L),k=y.filter(L=>v(L.subject)&&v(L.object)).sort((L,H)=>L.subject.localeCompare(H.subject)||L.predicate.localeCompare(H.predicate)||L.object.localeCompare(H.object)).slice(0,Pj).map(L=>({a:L.subject,r:L.predicate,b:L.object,from:[L.id]})),I=(L,H,W)=>({sub:L,sup:H,from:Vt(W),disjunction:sn(vh([$s(L),H]))}),x=[],T=[];for(let L of u){let H=L.object;if(!n.has(H)){x.push(I(De(L.subject),De(H),[L.id]));continue}let W=n.get(H),O=s.get(H);if(O){x.push(I(De(L.subject),JF(W.object,De(O.object)),[L.id,W.id,O.id]));continue}let D=o.get(H);if(D){x.push(I(De(L.subject),QF(W.object,De(D.object)),[L.id,W.id,D.id]));continue}let N=i.get(H),F=r.get(H);if(N&&F){let B=[L.id,W.id,F.id,N.id];N.kind==="min"?x.push(I(De(L.subject),{t:"atLeast",n:N.n,r:W.object,c:De(F.object)},B)):N.kind==="max"?x.push(I(De(L.subject),{t:"atMost",n:N.n,r:W.object,c:De(F.object)},B)):N.kind==="exact"&&(x.push(I(De(L.subject),{t:"atLeast",n:N.n,r:W.object,c:De(F.object)},B)),x.push(I(De(L.subject),{t:"atMost",n:N.n,r:W.object,c:De(F.object)},B)))}}for(let L of d)v(L.subject)?T.push({ind:L.subject,expr:sn($s(De(L.object))),from:[L.id]}):x.push(I(De(L.subject),sn($s(De(L.object))),[L.id]));for(let L of p)Eh.has(String(L.object||"").toLowerCase())||T.push({ind:L.subject,expr:De(L.object),from:[L.id]});for(let L of f)T.push({ind:L.subject,expr:sn($s(De(L.object))),from:[L.id]});for(let[L,H]of a){let W=[...H].sort((F,B)=>String(F.object).localeCompare(String(B.object))),O=W.map(F=>De(F.object)),D=W.map(F=>F.id),N=sn(vh(O));x.push(I(De(L),N,D)),x.push(I(N,De(L),D))}for(let[L,H]of c){let W=sn($s(De(H.object)));x.push(I(De(L),W,[H.id])),x.push(I(W,De(L),[H.id]))}let $=new Map;for(let[L,H]of l){let W=[...H].sort((N,F)=>String(N.object).localeCompare(String(F.object))),O=W.map(N=>({t:"nom",ind:N.object})),D=W.map(N=>N.id);x.push(I(De(L),sn(vh(O)),D));for(let N of W){x.push(I({t:"nom",ind:N.object},De(L),[N.id]));let F=$.get(N.object);$.set(N.object,F?Vt([...F,N.id]):[N.id])}}let _=b.map(L=>({a:L.subject,b:L.object,from:[L.id]})).sort((L,H)=>L.a.localeCompare(H.a)||L.b.localeCompare(H.b)),C=new Map;for(let L of g)C.set(L.subject,L.object),C.has(L.object)||C.set(L.object,L.subject);let S=new Set;for(let{object:L}of n.values())S.add(L);for(let L of k)S.add(L.r);let j=h.map(L=>[L.subject,L.object]).sort((L,H)=>L[0].localeCompare(H[0])||L[1].localeCompare(H[1])),M=new Set([...S,...j.flat(),...C.keys(),...C.values()]),z=tD(j,M);x.sort((L,H)=>Ke(L.sub).localeCompare(Ke(H.sub))||Ke(L.sup).localeCompare(Ke(H.sup))||L.from.join(",").localeCompare(H.from.join(","))),T.sort((L,H)=>L.ind.localeCompare(H.ind)||Ke(L.expr).localeCompare(Ke(H.expr)));let K=[...new Set([...T.map(L=>L.ind),...k.flatMap(L=>[L.a,L.b])])].sort(),Y=new Set(K),X=new Set([...[...a.values()].flatMap(L=>L.map(H=>H.id)),...[...l.values()].flatMap(L=>L.map(H=>H.id))]);return{axioms:x,assertions:T,roles:[...S].sort(),individuals:K,transitiveRoles:m,roleClosure:z,namedIndividuals:Y,nominalIndividuals:$,differentFrom:_,inverseOf:C,roleAssertions:k,unionOrOneOfIds:X}}function kD(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function RD(e,t=null,n={}){let s=[...new Set(Array.isArray(t)&&t.length?t:e.individuals||[])].sort(),o=[];for(let r of s){let i=kD(e,r);if(!i.assertions.length)continue;let a=kh(i,[],n);if(a.satisfiable===null||a.satisfiable===!0)continue;let c=Vt(a.closedClashes.flatMap(l=>l?.premises||[]));o.push({subject:r,premises:c,kind:xD(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function ys(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function _D(e,t,{hops:n=xh}={}){let s=Array.isArray(e)?e.filter(j=>j&&j.subject&&j.predicate):[],o=ZF(n,xh),r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=new Map,b=[],g=new Map,y=new Set;for(let j of s){if(String(j.predicate).trim().toLowerCase()!=="rdf:type")continue;let M=String(j.object||"").toLowerCase();Eh.has(M)||y.add(j.subject)}let w=s.filter(j=>!Tj.has(String(j.predicate).trim().toLowerCase())),E=Ij(y,w),R=j=>E.has(j)||Cj.test(j);for(let j of s){let M=String(j.predicate).trim().toLowerCase();M==="rdfs:subclassof"?(ys(r,j.subject,j.object),ys(i,j.object,j.subject)):M==="owl:onproperty"?a.set(j.subject,j.object):M==="owl:somevaluesfrom"||M==="owl:allvaluesfrom"||M==="owl:onclass"?(c.set(j.subject,j.object),ys(l,j.object,j.subject)):M==="owl:unionof"?(ys(u,j.subject,j.object),ys(d,j.object,j.subject)):M==="owl:complementof"?(p.set(j.subject,j.object),ys(f,j.object,j.subject)):M==="owl:oneof"?(ys(m,j.subject,j.object),ys(h,j.object,j.subject)):!Tj.has(M)&&R(j.subject)&&R(j.object)&&(b.push(j),ys(g,j.subject,j.object),ys(g,j.object,j.subject))}let v=new Map;function k(j){let M=v.get(j);if(M)return M;let z=new Set,K=[...r.get(j)||[],...i.get(j)||[]];for(;K.length;){let Y=K.pop();if(!z.has(Y)){z.add(Y);for(let X of r.get(Y)||[])z.has(X)||K.push(X);for(let X of i.get(Y)||[])z.has(X)||K.push(X)}}v.set(j,z);for(let Y of z)v.has(Y)||v.set(Y,z);return z}let I=new Set,x=new Map,T=[];function $(j,M){if(!j)return;let z=x.get(j);z!==void 0&&z>=M||(x.set(j,M),T.push({term:j,hopsLeft:M}))}let _=[...new Set((Array.isArray(t)?t:[]).map(j=>V(j)).filter(Boolean))];for(let j of _)$(j,o);let C=0;for(;C<T.length;){let{term:j,hopsLeft:M}=T[C];if(C+=1,x.get(j)===M){I.add(j);for(let z of k(j))I.add(z),$(z,M);if(!(M<=0)){c.has(j)&&$(c.get(j),o);for(let z of l.get(j)||[])$(z,o);for(let z of u.get(j)||[])$(z,M-1);for(let z of d.get(j)||[])$(z,M-1);p.has(j)&&$(p.get(j),M-1);for(let z of f.get(j)||[])$(z,M-1);for(let z of m.get(j)||[])$(z,M-1);for(let z of h.get(j)||[])$(z,M-1);for(let z of g.get(j)||[])$(z,o)}}}let S=new Set;for(let[j,M]of a)I.has(j)&&S.add(vs(M));for(let j of b)(I.has(j.subject)||I.has(j.object))&&S.add(vs(j.predicate));return s.filter(j=>{if(I.has(j.subject)||I.has(j.object))return!0;let M=String(j.predicate).trim().toLowerCase();return M==="rdfs:subpropertyof"||M==="owl:inverseof"||M==="rdf:type"&&String(j.object).toLowerCase()==="transitiveproperty"?S.has(vs(j.subject)):!1})}function AD(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return TD.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var De,$s,Aj,vh,JF,QF,Cj,vs,Eh,Oj,Nj,Lj,nD,xh,Pj,Mj,sD,Tj,TD,Th=P(()=>{Ze();De=e=>({t:"atom",name:e}),$s=e=>({t:"not",c:e}),Aj=e=>({t:"and",cs:e}),vh=e=>({t:"or",cs:e}),JF=(e,t)=>({t:"some",r:e,c:t}),QF=(e,t)=>({t:"all",r:e,c:t});Cj=/[./\\#:@]/;vs=e=>V(e);Eh=new Set(["restriction","transitiveproperty","class"]),Oj=5e3,Nj=256,Lj=512,nD=.95,xh=4,Pj=256,Mj=6,sD=/\.\d+$/;Tj=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);TD=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var Hj={};Lt(Hj,{BOT:()=>pn,DEFAULT_EL_BUDGET:()=>Nh,DEFAULT_EL_ROUNDS:()=>Lh,EL_RESTRICTION_RULE:()=>Oh,EL_RULE_CONFIDENCE:()=>Ah,EL_SUBSUMPTION_RULE:()=>Ih,ENTAILED_EL_PROVENANCE:()=>Vj,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>Da,TOP:()=>jo,classifyEl:()=>VD,elGoalAxioms:()=>Wj,elGoalFor:()=>Gj,elUnsatisfiableClasses:()=>GD,normalizeElTBox:()=>Ch,proveElSubsumption:()=>WD,saturateEl:()=>Cu});function CD(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function ID(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Ch(e,{budget:t=500}={}){let s=[...(Array.isArray(e)?e:[]).filter($=>$&&$.id&&$.subject&&$.predicate&&$.object!==void 0&&$.object!==null)].sort(($,_)=>String($.id).localeCompare(String(_.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=$=>{$&&$!==jo&&$!==pn&&i.add($)},l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=[],b=[],g=new Map,y=[];for(let $ of r){if($.subject===jo||$.subject===pn||$.object===jo||$.object===pn)continue;let _=$.predicate;LD(_)?(l.set($.subject,$),c($.subject)):PD(_)?(u.set($.subject,$),c($.subject),c($.object)):MD(_)?d.set($.subject,$):FD(_)?(p.set($.subject,$),c($.subject),c($.object)):UD(_)?(f.set($.subject,$),c($.subject)):DD(_)?(m.has($.subject)||m.set($.subject,[]),m.get($.subject).push($),c($.subject),c($.object)):Uj(_)?(h.push($),c($.subject),c($.object)):ND(_)?(b.push($),c($.subject),c($.object)):OD(_)&&$.object==="transitiveproperty"?(g.has($.subject)||g.set($.subject,$),a.add($.subject)):zD(_)&&(y.push($),a.add($.subject),a.add($.object))}let w=new Set([...l.keys()].filter($=>u.has($))),E=new Set([...l.keys()].filter($=>d.has($)));for(let $ of E)i.delete($);let R=new Map;for(let $ of w)R.set($,{role:l.get($).object,filler:u.get($).object});let v=new Map;for(let $ of Mf(r))$.kind!=="min"&&$.kind!=="exactly"||$.n>=1&&(w.has($.restriction)||!l.has($.restriction)||!p.has($.restriction)||!f.has($.restriction)||(v.set($.restriction,$.onClass),R.set($.restriction,{role:"has",filler:$.onClass})));let k=new Set(m.keys()),I=[],x=new Map;for(let $ of h){let _=$.subject,C=$.object;if(k.has(_)){x.has(_)||x.set(_,$);continue}if(w.has(C)){let{role:S,filler:j}=R.get(C),M=l.get(C),z=u.get(C);I.push({form:"someRight",sub:_,role:S,filler:j,from:[$.id,M.id,z.id]}),I.push({form:"someLeft",role:S,filler:j,sup:C,from:[M.id,z.id]});continue}if(v.has(C)){let S=v.get(C),j=l.get(C),M=p.get(C),z=f.get(C);I.push({form:"someRight",sub:_,role:"has",filler:S,from:[$.id,j.id,M.id,z.id]}),I.push({form:"someLeft",role:"has",filler:S,sup:C,from:[j.id,M.id,z.id]});continue}E.has(C)||I.push({form:"sub",sub:_,sup:C,from:[$.id]})}for(let[$,_]of m){let C=x.get($);if(!C)continue;let S=new Map;for(let K of _)S.has(K.object)||S.set(K.object,K);let j=[...S.keys()].sort();if(j.length<2)continue;let M=j[0],z=[S.get(j[0]).id];for(let K=1;K<j.length;K+=1){let Y=j[K],X=K===j.length-1,L=X?C.object:`${M}-and-${Y}`,H=[M,Y].sort(),W=S.get(Y).id,O=X?[...z,W,C.id]:[...z,W];I.push({form:"and",subs:H,sup:L,from:O}),z=[...z,W],M=L}}for(let $ of b)I.push({form:"and",subs:[$.subject,$.object].sort(),sup:pn,from:[$.id]});let T=[];for(let $ of[...g.keys()].sort())T.push({kind:"transitive",role:$,from:[g.get($).id]});for(let $ of[...y].sort((_,C)=>`${_.subject}${ue}${_.object}`.localeCompare(`${C.subject}${ue}${C.object}`)))T.push({kind:"sub",sub:$.subject,sup:$.object,from:[$.id]});return{axioms:I,roleAxioms:T,concepts:i,roles:a,restrictionOf:R,truncated:o}}function Cu(e,{budget:t=2e3,rounds:n=64,focus:s=null}={}){let o=e?.axioms||[],r=e?.roleAxioms||[],i=[...e?.concepts||[]].sort(),a=s instanceof Set?s.size?s:null:ID(s),c=(...$)=>!a||$.some(_=>a.has(_)),l=new Map,u=new Map,d=new Map,p=new Map;for(let $ of o)if($.form==="sub")l.has($.sub)||l.set($.sub,[]),l.get($.sub).push({sup:$.sup,from:$.from});else if($.form==="and"){let[_,C]=$.subs;for(let[S,j]of[[_,C],[C,_]])u.has(S)||u.set(S,[]),u.get(S).push({other:j,sup:$.sup,from:$.from})}else if($.form==="someRight")d.has($.sub)||d.set($.sub,[]),d.get($.sub).push({role:$.role,filler:$.filler,from:$.from});else if($.form==="someLeft"){let _=`${$.role}${ue}${$.filler}`;p.has(_)||p.set(_,[]),p.get(_).push({sup:$.sup,from:$.from})}let f=new Map,m=new Set,h=new Map;for(let $ of r)$.kind==="sub"?(f.has($.sub)||f.set($.sub,[]),f.get($.sub).push({sup:$.sup,from:$.from})):$.kind==="transitive"&&(m.add($.role),h.has($.role)||h.set($.role,$.from));let b=new Map;for(let $ of i)b.set($,new Set([$,jo]));let g=new Map,y=new Map,w=new Map,E=($,_)=>$===_?[]:y.get(`${$}${ue}${_}`)||[],R=($,_)=>w.get(`${$}${ue}${_}`)||[],v=(...$)=>{let _=new Set,C=[];for(let S of $)for(let j of S||[])!j||_.has(j)||(_.add(j),C.push(j));return C},k=0,I=!1,x=0;for(let $=0;$<n;$+=1){x+=1;let _=[];for(let[S,j]of b)for(let M of j)for(let{sup:z,from:K}of l.get(M)||[])j.has(z)||c(S,M,z)&&_.push({kind:"sub",A:S,X:z,from:v(E(S,M),K),sortKey:`1${ue}${S}${ue}${z}${ue}${M}`});for(let[S,j]of b)for(let M of j)for(let{other:z,sup:K,from:Y}of u.get(M)||[])j.has(z)&&(j.has(K)||c(S,M,z,K)&&_.push({kind:"sub",A:S,X:K,from:v(E(S,M),E(S,z),Y),sortKey:`2${ue}${S}${ue}${K}${ue}${[M,z].sort().join(ue)}`}));for(let[S,j]of b)for(let M of j)for(let{role:z,filler:K,from:Y}of d.get(M)||[]){let X=`${S}${ue}${K}`;(g.get(z)||Fa).has(X)||c(S,M,K)&&_.push({kind:"role",role:z,A:S,B:K,from:v(E(S,M),Y),sortKey:`3${ue}${z}${ue}${S}${ue}${K}${ue}${M}`})}for(let[S,j]of g)for(let M of j){let[z,K]=M.split(ue),Y=b.get(K)||Fa;for(let X of Y)for(let{sup:L,from:H}of p.get(`${S}${ue}${X}`)||[]){let W=b.get(z);!W||W.has(L)||c(z,K,X,L)&&_.push({kind:"sub",A:z,X:L,from:v(R(S,M),E(K,X),H),sortKey:`4${ue}${z}${ue}${L}${ue}${S}${ue}${K}${ue}${X}`})}}for(let[S,j]of g)for(let M of j){let[z,K]=M.split(ue);if(!(b.get(K)||Fa).has(pn))continue;let Y=b.get(z);!Y||Y.has(pn)||c(z,K)&&_.push({kind:"sub",A:z,X:pn,from:v(R(S,M),E(K,pn)),sortKey:`5${ue}${z}${ue}${S}${ue}${K}`})}for(let[S,j]of g)for(let{sup:M,from:z}of f.get(S)||[])for(let K of j){if((g.get(M)||Fa).has(K))continue;let[Y,X]=K.split(ue);c(Y,X)&&_.push({kind:"role",role:M,A:Y,B:X,from:v(R(S,K),z),sortKey:`6${ue}${M}${ue}${Y}${ue}${X}${ue}${S}`})}for(let S of[...m].sort()){let j=g.get(S);if(j)for(let M of j){let[z,K]=M.split(ue);for(let Y of j){let[X,L]=Y.split(ue);if(X!==K)continue;let H=`${z}${ue}${L}`;j.has(H)||c(z,K,L)&&_.push({kind:"role",role:S,A:z,B:L,from:v(R(S,M),R(S,Y),h.get(S)),sortKey:`7${ue}${S}${ue}${z}${ue}${L}${ue}${K}`})}}}if(!_.length){I=!0;break}_.sort((S,j)=>S.sortKey<j.sortKey?-1:S.sortKey>j.sortKey?1:0);let C=!1;for(let S of _){if(k>=t)break;if(S.kind==="sub"){let j=b.get(S.A);if(!j||j.has(S.X))continue;j.add(S.X),y.set(`${S.A}${ue}${S.X}`,S.from),k+=1,C=!0}else{g.has(S.role)||g.set(S.role,new Set);let j=g.get(S.role),M=`${S.A}${ue}${S.B}`;if(j.has(M))continue;j.add(M),w.set(`${S.role}${ue}${M}`,S.from),k+=1,C=!0}}if(k>=t)break;if(!C){I=!0;break}}let T=[...b.entries()].filter(([,$])=>$.has(pn)).map(([$])=>$).sort();return{subsumers:b,roleEdges:g,unsatisfiable:T,derivationOf:y,rounds:x,truncated:!I}}function Wj(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${ue}${a.filler}${ue}${a.sub}`,u=`${c.role}${ue}${c.filler}${ue}${c.sub}`;return l<u?-1:l>u?1:0}),r=[],i=new Set;for(let a of o){let l=[...t?.get(a.filler)||new Set([a.filler,jo])].filter(u=>u!==jo&&u!==pn).sort();for(let u of l){let d=`some-${a.role}-${u}`;if(!i.has(d)&&(i.add(d),r.push({form:"someLeft",role:a.role,filler:u,sup:d,from:[]}),r.length>=n))return r}}return r}function Gj(e,t){let n=V(e),s=V(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function WD(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=V(t),a=Ch(e,{budget:o}),{axiom:c,name:l}=Gj(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},p=Cu(d,{budget:o,rounds:r});return(p.subsumers.get(i)||Fa).has(l)?{proved:!0,premises:p.derivationOf.get(`${i}${ue}${l}`)||[]}:{proved:!1,exhausted:p.truncated}}function Kj(e,{budget:t=Nh,rounds:n=Lh,focus:s=null}={}){let o=Ch(e,{budget:t}),r=Cu(o,{budget:t,rounds:n,focus:s}),i=Wj(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Cu(c,{budget:t,rounds:n,focus:s}),u=o.truncated||r.truncated||l.truncated;return{normalized:o,goals:i,goalInfo:a,finalPass:l,truncated:u}}function GD(e,t={}){let{finalPass:n,truncated:s}=Kj(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${ue}${pn}`)||[],truncated:s}}async function VD(e,{budget:t=Nh,rounds:n=Lh,focus:s=null,maxEnvironments:o=Vr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=CD(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:p,goalInfo:f,finalPass:m,truncated:h}=Kj(u,{budget:t,rounds:n,focus:s}),b=new Map;for(let T of u)b.set(`${T.subject}${ue}${T.predicate}${ue}${T.object}`,T.trust);let g=new Map(u.map(T=>[T.id,T])),y=T=>(T||[]).map($=>g.get($)?.trust).filter($=>typeof $=="number"),w=new Set(u.filter(T=>Uj(T.predicate)).map(T=>`${T.subject}${ue}${T.object}`)),E=[],R=[],v=new Set,k=[...m.subsumers.keys()].sort();for(let T of k){let $=m.subsumers.get(T);if($.has(pn))continue;let _=[...$].filter(C=>C!==T&&C!==jo&&C!==pn).sort();for(let C of _){let S=`${T}${ue}${C}`;if(w.has(S))continue;let j=m.derivationOf.get(S)||[],M=f.get(C);if(M){v.has(C)||(v.add(C),E.push({subject:C,predicate:Dt,object:"owl:Restriction",provenance:Da,justification:[j]}),E.push({subject:C,predicate:An,object:M.role,provenance:Da,justification:[j]}),E.push({subject:C,predicate:Cn,object:M.filler,provenance:Da,justification:[j]}));let z=y(j),K=E.length;E.push({subject:T,predicate:Be,object:C,provenance:Da,justification:[j],...z.length?{premiseTrusts:z,ruleConfidence:Ah}:{}}),R.push({toWriteIndex:K,subject:T,object:C,rule:Oh})}else if(d.concepts.has(C)){let z=y(j),K=E.length;E.push({subject:T,predicate:Be,object:C,provenance:Vj,justification:[j],...z.length?{premiseTrusts:z,ruleConfidence:Ah}:{}}),R.push({toWriteIndex:K,subject:T,object:C,rule:Ih})}}}let{ids:I}=await c(e,E),x=R.map(T=>({id:I[T.toWriteIndex],subject:T.subject,object:T.object,rule:T.rule}));return{derived:x,count:x.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:p.length}}var ue,jo,pn,Ss,Uj,OD,ND,LD,PD,MD,FD,DD,zD,BD,UD,Fa,Ih,Vj,Oh,Da,Ah,Nh,Lh,qj=P(()=>{Ze();It();ue="\u241F",jo="top",pn="bot";Ss=e=>String(e||"").trim().toLowerCase(),Uj=e=>Ss(e)==="rdfs:subclassof",OD=e=>Ss(e)==="rdf:type",ND=e=>Ss(e)==="owl:disjointwith",LD=e=>Ss(e)==="owl:onproperty",PD=e=>Ss(e)==="owl:somevaluesfrom",MD=e=>Ss(e)==="owl:allvaluesfrom",FD=e=>Ss(e)==="owl:onclass",DD=e=>Ss(e)==="owl:intersectionof",zD=e=>Ss(e)==="rdfs:subpropertyof",BD=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),UD=e=>BD.has(Ss(e));Fa=new Set;Ih="elSubsumption",Vj=`entailed:${Ih}`,Oh="elRestriction",Da=`entailed:${Oh}`,Ah=.95,Nh=2e3,Lh=64});var Yj={};Lt(Yj,{DEFAULT_REASONING_CONFIG:()=>Iu,resolveReasoningConfig:()=>XD});function qD(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function YD(e,t){return typeof e=="boolean"?e:t}function XD(e){let t=e?.reasoning||{},n={...Iu};for(let[s,o]of Object.entries(KD))t[s]!==void 0&&(n[o]=qD(t[s],Iu[o]));for(let[s,o]of Object.entries(HD))t[s]!==void 0&&(n[o]=YD(t[s],Iu[o]));return n}var Iu,KD,HD,Xj=P(()=>{Iu=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),KD=Object.freeze({syllogise_budget:"syllogiseBudget",syllogise_depth:"syllogiseDepth",classify_budget:"classifyBudget",classify_rounds:"classifyRounds",max_environments:"maxEnvironments",prove_steps:"proveSteps",prove_branches:"proveBranches",prove_nodes:"proveNodes",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),HD=Object.freeze({ask_prove_fallback:"askProveFallback"})});function Kh(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Ou(e.entityType)}`;if(t==="list")return`list/enumerate ${Ou(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Ou(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return Kh(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&Fn[o]?Fn[o]:`filter/traverse ${Ou(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&Fn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?Fn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function Zh(e){let t=new Map;for(let n of e)t.has(Zj(n))||t.set(Zj(n),n);return t}function Mh(e,t=yr){let n=[],s=[];for(let c of e)c.predicate===t&&(s.push([c.subject,c.object]),wr(c)&&n.push([c.subject,c.object]));let o=new Map,r=new Map,i=new Set,a=(c,l,u)=>{!l||!u||l===u||(c.has(l)||c.set(l,new Set),c.get(l).add(u))};for(let[c,l]of s)a(r,c,l),l&&i.add(l);for(let[c,l]of n)a(o,c,l);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function Fh(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function oz(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function rz(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Ej(),Sj)),s=n();return s?oz(t,s(t)):t}catch{return t}}function tg(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||iz.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function Du(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return si;if(t==="can")return"mgx:capableOf";try{let n=await rz(t);return n==="have"?si:rs(`mgx:${n}`)}catch{return rs(`mgx:${t}`)}}function pz(e,t){let n=String(t||"").match(fz);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function za(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(ns(),_y)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function nk(e){return e.predicate===nz&&e.object==="transitiveproperty"||e.predicate===jk}function Uh(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function $z(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of yz)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function Hh(e){return e.replace(/#node:[0-9a-f]+/g,"")}function sg(e){let t=rE(e),n=e.provenance?` (source: ${Hh(e.provenance)})`:"";return`${t?` ${t}`:""}${n}`}function Ro(e){return`${qs(e)}${sg(e)}`}function se(e){let t=sg(e);return e.predicate===jk?`${$m(e.subject)} implies ${$m(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${qs(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${qs(e)}${t}`:e.provenance.includes("corpus:")?`${qs(e)}${t}`:e.provenance.includes("reference:")?`${qs(e)}${t}`:`i learned: ${qs(e)}${t}`}function ok(e,t,n,{toward:s=null}={}){let o=se(e);if(!Dn.has(e.predicate)||!n.has(e.subject))return o;let r=iu(e.object,t,{cap:6,stopAt:ou,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=sg(e);return!a||!o.endsWith(a)?o+i:o.slice(0,o.length-a.length)+i+a}function rk(e,t,n,{indent:s=""}={}){let o=t.filter(R=>R.predicate===yr).map(R=>[R.subject,R.object]),r=Ta(o),i=e.map(R=>`${s}${ok(R,r,n)}`),a=e.filter(R=>Dn.has(R.predicate)&&n.has(R.subject)),c=[...new Set(a.map(R=>R.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(R=>R.predicate==="owl:disjointWith").map(R=>[R.subject,R.object]),{split:u,clusters:d}=au(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let p=a[0].subject,f=new Map;for(let R of d)for(let v of R.objects)f.set(v,R);let m=e.filter(R=>!(Dn.has(R.predicate)&&n.has(R.subject))),h=[],b=[],g=0,y=R=>{let v=ok(R,r,n);return g<_e?(g+=1,`${s}${v}`):(b.push(v),null)};for(let R of d){let v=a.filter(k=>f.get(k.object)===R).map(y).filter(Boolean);v.length&&h.push(`${s}${p}, the ${R.label}:
177
- ${v.join(`
178
- `)}`)}if(m.length){let R=m.map(y).filter(Boolean);R.length&&h.push(`${s}also about ${p}:
166
+ `)}`:l,data:{...a,grounded:c}})}finally{await i()}}var bE=M(()=>{Qe();Ue();ot();Sm.ownsGraphLoad=!0});var S1,wE=M(()=>{Of();zy();iS();cS();uS();fS();mS();gS();wS();$S();zS();US();GS();KS();Gl();JS();ZS();tE();sE();rE();aE();lE();dE();pE();gE();bE();S1=Object.freeze({tmct_context:If,tmct_context_more:Dy,tmct_describe:rS,tmct_snippet:aS,tmct_signature:lS,tmct_impact:dS,tmct_search:pS,tmct_members:hS,tmct_subclasses:bS,tmct_related:gm,tmct_sprite:$m,tmct_architecture:BS,tmct_exports:WS,tmct_untested:VS,tmct_ask:YS,tmct_tests_for:XS,tmct_history:QS,tmct_file_history:eE,tmct_method_history:nE,tmct_class_history:oE,tmct_callers:iE,tmct_callees:cE,tmct_calls:uE,tmct_cochanges:fE,tmct_export:vm,tmct_ingest:Sm})});var Em=M(()=>{});var Vl,xm=M(()=>{Vl=()=>({relations:[],constructions:[]})});var yE,$E=M(()=>{Lt();Qe();Ng();Qt();xi();rs();Nc();Lc();wE();Gl();ot();Dr();yc();Em();xm();Lc();Of();Gl();$c(void 0);wc(Vl);yE=Og.map(({name:e,agentDescription:t,inputSchema:n})=>({name:e,description:t,inputSchema:n}))});function SE(e){let t=String(e||"");return/^have$/i.test(t)?"has":/[a-z]y$/i.test(t)&&!/[aeiou]y$/i.test(t)?`${t.slice(0,-1)}ies`:/(?:s|x|z|ch|sh|o)$/i.test(t)?`${t}es`:`${t}s`}function va(e){let t=String(e||"");return/^has$/i.test(t)?"have":/[a-z]ies$/i.test(t)&&!/[aeiou]ies$/i.test(t)?`${t.slice(0,-3)}y`:/(?:ss|zz|x|ch|sh|o)es$/i.test(t)?t.slice(0,-2):/[sz]es$/i.test(t)?t.slice(0,-1):t.replace(/s$/i,"")}function km(e){let t=va(e);return/[^aeiou]e$/i.test(t)&&t.length>2?`${t.slice(0,-1)}ing`:`${t}ing`}function vE(e){let t=String(e||"").trim().replace(/^(?:the|a|an)\s+/i,"").split(/\s+/)[0]?.toLowerCase()??"";return t?E1.has(t)?!0:x1.has(t)?!1:/[a-z]s$/.test(t)&&!/ss$/.test(t):!1}function Hl(e,t){if(qs[e])return qs[e];let n=String(e??"");if(n.startsWith("mgxneg:")){let c=Hl(`mgx:${n.slice(7)}`,t);if(c==="can")return"cannot";if(c==="can be")return"cannot be";if(c==="is"||c.startsWith("is "))return`is not${c.slice(2)}`;let[l,...u]=c.split(" ");return[vE(t)?"do not":"does not",va(l),...u].join(" ")}let s=/^mgx:([a-z]+(?:-[a-z]+)*)-than$/i.exec(n);if(s)return`is ${s[1].replace(/-/g," ")} than`;let o=new RegExp(`^mgx:(${Kl})-([a-z]+)$`,"i").exec(n);if(o)return`is ${o[1].toLowerCase()} ${o[2].toLowerCase()}`;let r=/^mgx:same-([a-z]+)-as$/i.exec(n);if(r)return`has the same ${r[1].toLowerCase()} as`;let i=/^mgx:([a-z]+)(?:-([a-z]+))?$/i.exec(n);if(i)return`${vE(t)?i[1]:SE(i[1])}${i[2]?` ${i[2]}`:""}`;let a=n.indexOf(":");return a===-1?n:n.slice(a+1)}function EE(e){let t=typeof e=="string"?[e]:Array.isArray(e)?e:e?.extraction;if(!Array.isArray(t)||!t.length)return"";let n=new Set(t.map(s=>String(s)));return Object.entries(j1).filter(([s])=>n.has(s)).map(([,s])=>s).join(" ")}var qs,Kl,E1,x1,j1,Rm=M(()=>{qs=Object.freeze({"rdfs:subClassOf":"is a kind of","mgxneg:subClassOf":"is not a kind of","rdf:type":"is a","owl:disjointWith":"is not a","owl:unionOf":"is either","owl:complementOf":"is anything that is not","owl:oneOf":"includes exactly","owl:differentFrom":"is not the same as","mgx:partOf":"is part of","mgx:memberOf":"is a member of","mgx:collectionOf":"is a collection of","mgx:hasA":"has","mgx:usedFor":"is used for","mgx:capableOf":"can","mgx:atLocation":"is found in","mgx:causes":"causes","mgx:hasProperty":"is","mgx:madeOf":"is made of","mgx:receivesAction":"can be","mgx:createdBy":"is created by","mgx:mannerOf":"is a way to","mgx:desires":"wants","mgx:locatedNear":"is typically near","mgx:motivatedByGoal":"is motivated by","mgx:obstructedBy":"can be prevented by","mgx:causesDesire":"makes you want to","mgx:hasSubevent":"involves","mgx:hasFirstSubevent":"begins with","mgx:hasLastSubevent":"ends with","mgx:hasPrerequisite":"requires","mgx:ownedBy":"is owned by","mgx:rendersAs":"renders as","mgx:nameFor":"is the name for","mgx:synonym":"means the same as","mgx:antonym":"is the opposite of","mgx:similarTo":"is similar to","mgx:relatedTo":"is related to","mgx:symbolOf":"is a symbol of","mgx:currently-in":"is in","mgx:located-in":"is in","mgx:fixed-in":"is fixed in","mgx:stands-locked-in":"stands locked in","mgx:works-in":"works in","mgx:pursues":"pursues","mgx:evades":"evades","mgx:consumes":"eats","mgx:vision-radius":"sees within","mgx:guards":"guards"}),Kl="connected|related|associated|linked|based|derived|composed|made|used|known|located|found|involved|concerned";E1=new Set(["people","men","women","children","mice","geese","feet","teeth","oxen"]),x1=new Set(["news","physics","species","series","means","measles","mathematics","politics","economics"]);j1=Object.freeze({"clause-fallback":"(read from a clause fragment)","pronoun-carry":"(subject carried from the previous sentence)","identifier-token":"(identifier token)"})});var jq,kq,Rq,ql=M(()=>{jq=Object.freeze(["entity","set","event","measure"]),kq=Object.freeze(["date","count","op","pivot","metric","kind","provenance"]),Rq=Object.freeze({it:Object.freeze(["entity","event","measure"]),this:Object.freeze(["entity","event","measure"]),that:Object.freeze(["entity","event","measure"]),"this one":Object.freeze(["entity","event","measure"]),"that one":Object.freeze(["entity","event","measure"]),those:Object.freeze(["set"]),them:Object.freeze(["set"]),these:Object.freeze(["set"]),here:Object.freeze(["entity"])})});var Yl=M(()=>{});var St,Aq,Cq,Iq,Oq,Nq,Lq,Pq,Mq,Fq,Dq,zq,Bq,Uq,Wq,Gq,Vq,Yt,Kq,Hq,qq,vo=M(()=>{St=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},Aq=St("createRequire"),Cq=St("readFileSync"),Iq=St("access"),Oq=St("readFile"),Nq=St("writeFile"),Lq=St("appendFile"),Pq=St("mkdir"),Mq=St("mkdtemp"),Fq=St("rename"),Dq=St("unlink"),zq=St("rm"),Bq=St("stat"),Uq=St("copyFile"),Wq=St("readdir"),Gq=St("createReadStream"),Vq=St("createWriteStream"),Yt=e=>String(e),Kq=St("randomBytes"),Hq=St("spawnSync"),qq=St("createInterface")});var CE={};Nt(CE,{PHRASEBOOK_FILE:()=>kE,TECHNICAL_SLOTS:()=>_m,TEMPLATES_FILE:()=>jE,flatten:()=>Am,loadPhrasebook:()=>T1,loadTemplates:()=>Cm,loadTemplatesMerged:()=>_1,render:()=>AE,renderSegments:()=>TE,slotKind:()=>_E,slotsOf:()=>Tm});function Tm(e){let t=[];for(let n of String(e).matchAll(RE))t.includes(n[1])||t.push(n[1]);return t}function _E(e){return R1[e]||"entity"}function Am(e){let t="";for(let n of e)t+=n.text;return t}function TE(e,t={},n=Sa){if(!n)throw new Error("renderSegments() before loadTemplates() \u2014 load the template library first");let s=n.get(e);if(!s)throw new Error(`unknown template id "${e}"`);let o=s.slots.filter(u=>t[u]===void 0||t[u]===null);if(o.length)throw new Error(`template "${e}" missing slot${o.length>1?"s":""}: ${o.join(", ")}`);let r=s.template,i=new RegExp(RE.source,"g"),a=[],c=0,l;for(;(l=i.exec(r))!==null;)l.index>c&&a.push({type:"prose",text:r.slice(c,l.index)}),a.push({type:_E(l[1]),text:String(t[l[1]])}),c=l.index+l[0].length;return c<r.length&&a.push({type:"prose",text:r.slice(c)}),a}async function Cm(e=jE){let t=await Ne(e,"utf8"),n=new Map,s=t.split(`
167
+ `);for(let o=0;o<s.length;o+=1){let r=s[o].trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(c){throw new Error(`${e}:${o+1}: not valid JSON: ${c.message}`)}for(let c of["id","class","template","register"])if(typeof i[c]!="string"||!i[c])throw new Error(`${e}:${o+1}: missing/empty "${c}"`);if(!k1.has(i.register))throw new Error(`${e}:${o+1}: register must be terse|friendly|technical, got "${i.register}"`);if(n.has(i.id))throw new Error(`${e}:${o+1}: duplicate template id "${i.id}"`);let a=Tm(i.template);if(i.register==="technical"){let c=a.filter(l=>!_m.has(l));if(c.length)throw new Error(`${e}:${o+1}: technical template "${i.id}" uses non-mechanical slot${c.length>1?"s":""}: ${c.join(", ")} (allowed: ${[..._m].join(", ")})`);if(!a.includes("provenance"))throw new Error(`${e}:${o+1}: technical template "${i.id}" must carry a {provenance} fill (an advanced claim always shows its source)`)}n.set(i.id,{...i,slots:a})}return Sa=n,n}async function _1(e=[]){let t=Sa,n=new Map;try{for(let s of e){let o=await Cm(s);for(let[r,i]of o){if(!r.includes(":"))throw new Error(`${s}: extension-pack template id "${r}" is not namespaced ("<packname>:<id>")`);if(n.has(r))throw new Error(`${s}: duplicate template id "${r}" already loaded from an earlier path`);n.set(r,i)}}}finally{Sa=t}return n}function AE(e,t={},n=Sa){if(!n)throw new Error("render() before loadTemplates() \u2014 load the template library first");return Am(TE(e,t,n))}async function T1(e=kE){let t=await Ne(e,"utf8"),n=[],s=[],o=t.split(`
168
+ `);for(let r=0;r<o.length;r+=1){let i=o[r].trim();if(!(!i||i.startsWith("#"))){if(i.startsWith("~")){let a=i.slice(1).split(",").map(c=>c.trim().toLowerCase()).filter(Boolean);if(a.length<2)throw new Error(`${e}:${r+1}: a synonym family needs at least 2 entries`);s.push(a);continue}n.push({pattern:i,slots:Tm(i)})}}return{patterns:n,synonyms:s}}var A1,xE,jE,kE,k1,RE,_m,R1,Sa,Xl=M(()=>{Lt();vo();Qe();A1={},xE=ne($e(Yt(A1.url)),"..","..",".."),jE=ne(xE,"data","templates","responses.jsonl"),kE=ne(xE,"data","phrasebook","software-phrases.txt"),k1=new Set(["terse","friendly","technical"]),RE=/\{([A-Za-z][A-Za-z0-9]*)\}/g,_m=Object.freeze(new Set(["subject","count","noun","scope","comparison","metric","unit","superlative","provenance"]));R1={count:"number",when:"number",location:"path",commit:"path",provenance:"provenance"};Sa=null});function I1(e,t={}){let n=C1.exec(String(e||""));if(!n)return 1;let s=t?.[n[1]];return typeof s=="number"&&Number.isFinite(s)?s:1}function O1(e,t={}){let n=Array.isArray(e?.sourceIds)?e.sourceIds:[];return n.length?Math.max(...n.map(s=>I1(s,t))):1}function lt(e,t={}){return(Array.isArray(e)?e:[]).map((s,o)=>({row:s,index:o,bias:O1(s,t)})).sort((s,o)=>o.bias-s.bias||(o.row?.trust??0)-(s.row?.trust??0)||s.index-o.index).map(s=>s.row)}var C1,IE=M(()=>{C1=/^src:corpus:(.+)$/});var Et,eY,cr,tY,nY,sY,oY,rY,iY,aY,cY,lY,uY,dY,fY,OE,N1,pY,mY,hY,lr=M(()=>{Et=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},eY=Et("createRequire"),cr=Et("readFileSync"),tY=Et("access"),nY=Et("readFile"),sY=Et("writeFile"),oY=Et("appendFile"),rY=Et("mkdir"),iY=Et("mkdtemp"),aY=Et("rename"),cY=Et("unlink"),lY=Et("rm"),uY=Et("stat"),dY=Et("copyFile"),fY=Et("readdir"),OE=Et("createReadStream"),N1=Et("createWriteStream"),pY=Et("randomBytes"),mY=Et("spawnSync"),hY=Et("createInterface")});function Im(e,t){let n=String(e).toLowerCase().replace(/^[^a-z]+/,"");if(!n)return null;for(let o of t.vowel_sound_consonants||[])if(n.startsWith(o))return!0;for(let o of t.consonant_sound_vowels||[])if(n.startsWith(o))return!1;let s=n[0];return"aeiou".includes(s)?!0:/[a-z]/.test(s)?!1:null}function F1(e=P1){let t=er(cr(e,"utf8"));return Array.isArray(t.rule)?t.rule:[]}function Ql(){if(Jl===null)try{Jl=F1()}catch{Jl=[]}return Jl}var D1,L1,P1,M1,SY,Jl,Zl=M(()=>{lr();vo();Qe();bl();Xl();D1={},L1=$e(Yt(D1.url)),P1=ne(L1,"..","..","data","templates","grammar-rules.toml"),M1=Object.freeze(["prose","entity","path","number","code","provenance","receipt"]),SY=Object.freeze(new Set(M1.filter(e=>e!=="prose")));Jl=null});function z1(){if(Ea!==void 0)return Ea;try{let e=NE?NE():B1();Ea=e&&e.winkNLP&&e.model?e:null}catch{Ea=null}return Ea}function B1(){let e=process.getBuiltinModule("node:module").createRequire(U1.url);return{winkNLP:e("wink-nlp"),model:e("wink-eng-lite-web-model")}}function eu(){if(ci!==void 0)return ci;let e=z1();if(!e)return ci=null,null;try{ci=e.winkNLP(e.model)}catch{ci=null}return ci}var U1,NE,Ea,ci,tu=M(()=>{U1={}});var Om=M(()=>{tu()});var PE,LE=M(()=>{PE={comment:"tmct's starter lexicon, now covering BOTH the original software domain and the default 'human-world' persona's everyday people/places/objects/nature/time/body/mind vocabulary. Every word the ACE-OWL sub-fragment parser (src/domain/grammar/ace.mjs) is allowed to understand is DECLARED here \u2014 tmct never guesses a word's category. Nouns may declare a possessive property typing ('data' or 'object', pattern 7) or an irregular 'plural' (WordNet-sourced human nouns like 'man'/'child' need this \u2014 the morphology fold only handles regular -s/-ies/-es endings); adjectives MUST declare a type ('subclass' forms a class, 'data' asserts a boolean-ish datatype property, pattern 8); verbs may declare a preposition ('depend' + 'on' \u2192 dependsOn). The human-domain additions are flat and simple (breadth over depth \u2014 no gender/kinship taxonomy, no formal role hierarchy), matching corpus/tier2/generate.mjs's CORPUSES.human.lexicon sub-key, which --verify drift-checks against. Extend via loadLexicon(extra) with this same shape.",nouns:{module:{},class:{},function:{},method:{},attribute:{},variable:{},constant:{},test:{},suite:{},service:{},repository:{},branch:{},commit:{},tag:{},release:{},package:{},library:{},framework:{},api:{},endpoint:{},route:{},handler:{},controller:{},model:{},view:{},template:{},component:{},interface:{},type:{},category:{},kind:{},artifact:{},routine:{},part:{},helper:{},operation:{},change:{},schema:{},database:{},table:{},query:{},index:{plural:"indices"},cache:{},queue:{},worker:{},job:{},task:{},bug:{},defect:{},issue:{},ticket:{},feature:{},requirement:{},specification:{},document:{},developer:{},engineer:{},user:{},visitor:{},team:{},project:{},codebase:{},file:{},directory:{},folder:{},line:{},symbol:{},identifier:{},comment:{},docstring:{},string:{},number:{},list:{},array:{},graph:{},node:{},edge:{},triple:{},fact:{},ontology:{},lexicon:{},grammar:{},sentence:{},utterance:{},session:{},response:{},request:{},question:{},answer:{},error:{},exception:{},warning:{},log:{},metric:{},benchmark:{},pipeline:{},build:{},deployment:{},environment:{},config:{},configuration:{},setting:{},option:{},flag:{},argument:{},parameter:{},value:{},result:{},output:{},input:{},server:{},client:{},protocol:{},message:{},event:{},hook:{},plugin:{},script:{},tool:{},command:{},prompt:{},token:{},parser:{},compiler:{},linter:{},formatter:{},runtime:{},process:{},thread:{},loop:{},statement:{},expression:{},keyword:{},scope:{},callback:{},promise:{},iterator:{},generator:{},unit:{},risk:{},prototype:{},milestone:{},sprint:{},backlog:{},roadmap:{},phase:{},pattern:{},smell:{},coverage:{},mock:{},stub:{},fixture:{},assertion:{},snapshot:{},regression:{},migration:{},refactor:{},review:{},merge:{},license:{property:"data"},version:{property:"data"},name:{property:"data"},path:{property:"data"},size:{property:"data"},status:{property:"data"},language:{property:"data"},extension:{property:"data"},churn:{property:"data"},impact:{property:"data"},complexity:{property:"data"},latency:{property:"data"},duration:{property:"data"},frequency:{property:"data"},severity:{property:"data"},owner:{property:"object"},maintainer:{property:"object"},author:{property:"object"},reviewer:{property:"object"},parent:{property:"object"},dependency:{property:"object"},man:{plural:"men"},woman:{plural:"women"},person:{plural:"people"},child:{plural:"children"},boy:{},girl:{},baby:{},adult:{},friend:{},neighbor:{},stranger:{},guest:{},doctor:{},teacher:{},nurse:{},student:{},farmer:{},mother:{},father:{},brother:{},sister:{},family:{},king:{},queen:{},soldier:{},artist:{},writer:{},cook:{},group:{},crowd:{},audience:{},club:{},president:{},human:{},lawyer:{},driver:{},manager:{},officer:{},judge:{},priest:{},servant:{},butler:{},housekeeper:{},gardener:{},employee:{},boss:{},husband:{},wife:{plural:"wives"},son:{},daughter:{},grandmother:{},grandfather:{},citizen:{},customer:{},leader:{},champion:{},volunteer:{},resident:{},place:{},city:{},town:{},village:{},country:{},house:{},home:{},room:{},kitchen:{},bedroom:{},bathroom:{},school:{},hospital:{},shop:{},market:{},church:{},park:{},garden:{},street:{},road:{},bridge:{},farm:{},office:{},factory:{},museum:{},hotel:{},airport:{},castle:{},beach:{},forest:{},mountain:{},hat:{},shirt:{},coat:{},shoe:{},dress:{},clothing:{},chair:{},desk:{},lamp:{},portrait:{},bed:{},door:{},window:{},wall:{},roof:{},pen:{},paper:{},key:{},lock:{},box:{},car:{},bicycle:{},boat:{},train:{},wheel:{},knife:{plural:"knives"},spoon:{},fork:{},plate:{},cup:{},bottle:{},bag:{},money:{},coin:{},toy:{},machine:{},clock:{},phone:{},book:{},letter:{},umbrella:{},glove:{},sock:{},ring:{},watch:{},mirror:{},candle:{},ladder:{},hammer:{},basket:{},wallet:{},dog:{},cat:{},horse:{},cow:{},pig:{},sheep:{},bird:{},fish:{},mouse:{plural:"mice"},rabbit:{},rodent:{},bear:{},lion:{},tiger:{},elephant:{},snake:{},mole:{},groundhog:{},meerkat:{},tree:{},flower:{},grass:{},leaf:{plural:"leaves"},root:{},seed:{},fruit:{},water:{},air:{},fire:{},earth:{},stone:{},sand:{},gold:{},iron:{},rain:{},snow:{},wind:{},cloud:{},sun:{},moon:{},star:{},owl:{},wolf:{plural:"wolves"},frog:{},bee:{},ant:{},butterfly:{},spider:{},river:{},ocean:{},time:{},day:{},night:{},morning:{},evening:{},week:{},month:{},year:{},hour:{},minute:{},second:{},moment:{},season:{},spring:{},summer:{},winter:{},wedding:{},race:{},dozen:{},half:{plural:"halves"},amount:{},meeting:{},game:{},war:{},trip:{},birthday:{},holiday:{},autumn:{},century:{},body:{},head:{},hand:{},arm:{},leg:{},foot:{plural:"feet"},eye:{},ear:{},mouth:{},nose:{},hair:{},heart:{},blood:{},bone:{},skin:{},face:{},food:{},bread:{},meat:{},milk:{},egg:{},cheese:{},vegetable:{},meal:{},breakfast:{},dinner:{},drink:{},wine:{},tea:{},coffee:{},tongue:{},tooth:{plural:"teeth"},finger:{},toe:{},shoulder:{},knee:{},brain:{},lung:{},sugar:{},salt:{},word:{},story:{},news:{},idea:{},thought:{},mind:{},memory:{},dream:{},belief:{},love:{},hate:{},fear:{},joy:{},anger:{},hope:{},surprise:{},pride:{},song:{},music:{},sound:{},voice:{},picture:{},art:{},knowledge:{},opinion:{},reason:{},imagination:{},laughter:{},tear:{},smile:{},silence:{},object:{},location:{},quantity:{},organization:{},animal:{},plant:{},furniture:{},vehicle:{},insect:{},emotion:{},metal:{},liquid:{},weather:{},planet:{},jewelry:{},cutlery:{},government:{},material:{},draw:{},set:{},heavy:{},stand:{},free:{},pack:{},dead:{},pick:{},double:{},straight:{},cast:{},dry:{},bank:{},stamp:{},tender:{},fair:{},active:{},regular:{},blue:{},hack:{},band:{},brush:{},guard:{},master:{},transfer:{},firm:{},side:{},bull:{},mate:{},rank:{},board:{},brace:{},grade:{},better:{},course:{},natural:{},butt:{},camp:{},crop:{},date:{},fold:{},help:{},hunt:{},count:{},court:{},crush:{},major:{},march:{},tease:{},tough:{},flight:{},forward:{},division:{},commission:{},jam:{},rat:{},gray:{},hood:{},jerk:{},miss:{},pile:{},pool:{},rear:{},whip:{},bench:{},chain:{},cycle:{},grind:{},guide:{},stiff:{},troll:{},union:{},circle:{},carrier:{},defence:{},defense:{},radical:{},reserve:{},intimate:{},opposite:{},superior:{},grey:{},host:{},knot:{},left:{},lost:{},blind:{},crank:{},panel:{},rally:{},state:{},tramp:{},waver:{},clutch:{},living:{},runner:{},steady:{},stream:{},combine:{},company:{},convert:{},general:{},moderate:{},alternate:{},ace:{},crab:{},flop:{},fund:{},pair:{},rake:{},rock:{},sick:{},blade:{},cheat:{},sport:{},caller:{},column:{},couple:{},divine:{},pledge:{},simple:{},sponge:{},system:{},wanton:{},sleeper:{},business:{},associate:{},instrument:{},substitute:{},gun:{},sum:{},alto:{},best:{},buff:{},dear:{},mass:{},cream:{},creep:{},giant:{},labor:{},pilot:{},sneak:{},stack:{},staff:{},world:{},gutter:{},jumper:{},labour:{},lather:{},picket:{},reader:{},savage:{},captain:{},culture:{},monitor:{},neutral:{},unknown:{},utility:{},inferior:{},initiate:{},innocent:{},national:{},transpose:{},association:{},professional:{},bum:{},fan:{},law:{},deck:{},fool:{},join:{},kink:{},page:{},pink:{},stud:{},twin:{},clump:{},coach:{},dance:{},drone:{},extra:{},feast:{},fence:{},fleet:{},flock:{},ghost:{},clear:{},right:{},open:{},beat:{},back:{},block:{},see:{},keep:{},square:{},pitch:{},center:{},centre:{},top:{},post:{},field:{},spot:{},bar:{},end:{},frame:{},rough:{},address:{},quarter:{},position:{},land:{},bound:{},range:{},seat:{},dark:{},rail:{},cross:{},section:{},tip:{},plug:{},port:{},stall:{},corner:{},outside:{},dig:{},way:{},front:{},joint:{},patch:{},reach:{},thick:{},medium:{plural:"media"},dock:{},ruin:{},tack:{},floor:{},bottom:{},puddle:{},compound:{},retreat:{},mat:{},belt:{},dump:{},scene:{},space:{},border:{},common:{},cradle:{},inside:{},surface:{},lie:{},boot:{},clog:{},coil:{},nest:{},wire:{},yard:{},forge:{},limit:{},lodge:{},buffer:{},middle:{},capital:{},overhead:{},preserve:{},terminal:{},direction:{},hall:{},loft:{},plot:{},tape:{},grate:{},stoop:{},fringe:{},circuit:{},distance:{},derivation:{},bent:{},gate:{},mill:{},safe:{},sail:{},hedge:{},paint:{},parcel:{},sphere:{},bearing:{},profile:{},shelter:{},crossing:{},interior:{},reservation:{},area:{},bush:{},cork:{},dive:{},limb:{},raft:{},shed:{},zone:{},chase:{},cut:{},light:{},charge:{},check:{},work:{},stock:{},stick:{},flat:{},crack:{},press:{},settle:{},spread:{},wash:{},well:{},swing:{},fly:{},tap:{},stretch:{},shot:{},black:{},strip:{},separate:{},tie:{},rack:{},match:{},piece:{},shell:{},still:{},present:{},trim:{},spike:{},split:{},white:{},yield:{},squeeze:{},bolt:{},fret:{},choke:{},float:{},track:{},low:{},crown:{},screen:{},die:{plural:"dice"},pin:{},chip:{},mold:{},seal:{},draft:{},shade:{},shaft:{},stuff:{},switch:{},balance:{},reverse:{},subject:{},approach:{},beam:{},bill:{},card:{},link:{},sack:{},sink:{},trap:{},spare:{},credit:{},counter:{},express:{},positive:{},net:{},pay:{},ball:{},bond:{},bowl:{},horn:{},pole:{},wing:{},glass:{},grant:{},smack:{},collar:{},record:{},ruffle:{},silver:{},negative:{},cap:{},lap:{},pad:{},rag:{},rig:{},bend:{},clip:{},fine:{},flap:{},heel:{},pall:{},pump:{},gauge:{},image:{},plain:{},print:{},slick:{},spoil:{},clinch:{},gather:{},offset:{},pocket:{},relief:{},channel:{},whistle:{},irregular:{},transport:{},bat:{},ice:{},peg:{},pot:{},bust:{},grip:{},hole:{},nail:{},poke:{},slug:{},spat:{},stem:{},suit:{},yoke:{},flood:{},grand:{},gross:{},perch:{},slip:{},down:{},shoot:{},ground:{},discharge:{},solid:{},kill:{},slack:{},waste:{},rush:{},grain:{},shake:{},pit:{},mould:{},colour:{},render:{},mount:{},cutting:{},fill:{},flux:{},tail:{},plaster:{},swallow:{},concentrate:{},bay:{},gum:{},ray:{},slop:{},spur:{},extract:{},fat:{},hop:{},corn:{},rust:{},smut:{},label:{},stain:{},composition:{},gas:{},pip:{},duck:{},gall:{},lime:{},mint:{},tick:{},stalk:{},whiff:{},cement:{},rubber:{},conjugate:{},preparation:{},dun:{},dust:{},jade:{},mire:{},pulp:{},snag:{},bloom:{},caper:{},crude:{},fluid:{},frost:{},paste:{},rinse:{},steam:{},straw:{},corona:{},poison:{},refuse:{},savory:{},feather:{},ferment:{},organic:{},chestnut:{},mushroom:{},percolate:{},sublimate:{},synthetic:{},suspension:{},precipitate:{},cod:{},pet:{},rod:{},bunt:{},crow:{},hide:{},punk:{},vein:{},assay:{},goose:{plural:"geese"},olive:{},stray:{},trash:{},ginger:{},pepper:{},permit:{},polish:{},sorrel:{},blister:{},bristle:{},complex:{},filling:{},flicker:{},harvest:{},scollop:{},whiting:{},anteater:{},snowball:{},tincture:{},repellent:{},ink:{},lip:{},nag:{},rue:{},wad:{},acid:{},beak:{},bean:{},coal:{},dirt:{},fawn:{},fuel:{},lark:{},ling:{},mash:{},palm:{},pelt:{},plum:{},pony:{},pout:{},soil:{},stag:{},bream:{},brier:{},chalk:{},coral:{},fiber:{},fall:{},pass:{},lift:{},go:{},roll:{},drop:{},blow:{},return:{},strike:{},rise:{},snap:{},shift:{},twist:{},case:{},deal:{},start:{},deep:{},jump:{},step:{},stop:{},pound:{},advance:{},pop:{},flash:{},rest:{},crash:{},score:{},figure:{},leave:{},smash:{},stroke:{},first:{},sweep:{},even:{},flow:{},kick:{},heave:{},trace:{},opening:{},full:{},gain:{},jack:{},spin:{},wave:{},splash:{},bob:{},bang:{},dash:{},flick:{},hitch:{},prime:{},proof:{},passing:{},bit:{},click:{},knock:{},swell:{},trouble:{},collapse:{},movement:{},standard:{},variation:{},rap:{},boom:{},bump:{},clap:{},pace:{},peck:{},zero:{},blaze:{},speed:{},spell:{},treat:{},bounce:{},factor:{},little:{},plunge:{},scrape:{},single:{},ban:{},mix:{},one:{},mesh:{},roar:{},tilt:{},climb:{},flip:{},puff:{},bite:{},feed:{},bitter:{},chop:{},sour:{},special:{},crisp:{},tonic:{},scallop:{},mess:{},quick:{},smear:{},fillet:{},curl:{},malt:{},glaze:{},souse:{},breast:{},humour:{},draught:{},delicacy:{},dressing:{},transplant:{},hip:{},sop:{},kiss:{},mush:{},neck:{},belly:{},frank:{},jumble:{},junket:{},trifle:{},stomach:{},clot:{},shin:{},stew:{},tart:{},cheek:{},graft:{},molar:{},roast:{},spice:{},stout:{},sweat:{},groove:{},region:{},savoury:{},western:{},backbone:{},conserve:{},dominant:{},macerate:{},melancholy:{},cake:{},lens:{},loaf:{plural:"loaves"},menu:{},must:{},peel:{},pore:{},suds:{},butch:{},cling:{},curry:{},drool:{},honey:{},jerky:{},juice:{},mince:{},nasal:{},nerve:{},sauce:{},tract:{},dainty:{},entree:{},facial:{},relish:{},squash:{},brittle:{},caramel:{},cordial:{},fissure:{},oblique:{},adhesion:{},turnover:{},nonpareil:{},posterior:{},vegetation:{},ail:{},orb:{},pap:{},rum:{},brew:{},chew:{},hash:{},lard:{},rump:{},brine:{},dowdy:{},farce:{},flour:{},fudge:{},halal:{},icing:{},lunch:{},play:{},make:{},hold:{},close:{},mark:{},form:{},order:{},support:{},rule:{},sign:{},hang:{},drag:{},feel:{},find:{},shock:{},mean:{},offer:{},study:{},show:{},tone:{},flare:{},attack:{},act:{},life:{plural:"lives"},stay:{},think:{},secret:{},account:{},hurt:{},note:{},taste:{},report:{},measure:{},condition:{},cry:{},focus:{plural:"foci"},style:{},thing:{},title:{},recall:{},average:{},contract:{},dissolve:{},so:{},aim:{},bind:{},heat:{},know:{},stir:{},claim:{},power:{},demand:{},design:{},notice:{},source:{},upgrade:{},resolution:{},bid:{},skim:{},brand:{},curve:{},sight:{},smoke:{},digest:{},regard:{},passage:{},program:{},exposure:{},interest:{},character:{},projection:{},lay:{},curse:{},favor:{},remit:{},sense:{},slash:{},wedge:{},bubble:{},excuse:{},favour:{},invite:{},mantle:{},salute:{},stress:{},survey:{},temper:{},comfort:{},neglect:{},resolve:{},respect:{},torment:{},conflict:{},dispatch:{},standing:{},challenge:{},programme:{},background:{},conclusion:{},impression:{},particular:{},withdrawal:{},cite:{},echo:{},hail:{},rip:{},lot:{},great:{},relay:{},tenor:{},browse:{},bundle:{},chorus:{},cypher:{},fellow:{},litter:{},marine:{},native:{},occult:{},plague:{},rocker:{},scheme:{},series:{plural:"series"},social:{},streak:{},sucker:{},teaser:{},antique:{},battery:{},bracket:{},founder:{},gallery:{},liberal:{},starter:{},turnout:{},witness:{},diagonal:{},familiar:{},ordinary:{},prospect:{},sequence:{},aggregate:{},authority:{},community:{},dependent:{},desperate:{},patronage:{},primitive:{},principal:{},complement:{},engagement:{},foundation:{},generation:{},settlement:{},combination:{},lightweight:{},steamroller:{},subordinate:{},organisation:{},establishment:{},representative:{},con:{},fox:{},kid:{},pod:{},red:{},sex:{},spy:{},vet:{},aged:{},bore:{},diet:{},fare:{},gown:{},hawk:{},heap:{},herd:{},hive:{},lump:{},romp:{},sort:{},agent:{},alien:{},beard:{},brave:{},breed:{},brood:{},canon:{},craft:{},crazy:{},devil:{},dummy:{},equal:{},flake:{},groom:{},mound:{},organ:{},scrub:{},toast:{},troop:{},youth:{},colony:{},copper:{},cutter:{},escort:{},feeder:{},junior:{},maroon:{},matrix:{plural:"matrices"},modern:{},muscle:{},people:{},sector:{},shrink:{},tinker:{},topper:{},booster:{},gallant:{},hostile:{},marshal:{},network:{},nucleus:{plural:"nuclei"},premier:{},scourge:{},secular:{},sitting:{},snapper:{},suspect:{},swagger:{},traffic:{},variant:{},cardinal:{},derelict:{},domestic:{},favorite:{},finisher:{},graduate:{},humanist:{},infernal:{},magazine:{},manifold:{},minister:{},palatine:{},presence:{},receiver:{},relation:{},favourite:{},following:{},goldbrick:{},operative:{},sensitive:{},syndicate:{},complexion:{},mouthpiece:{},withdrawer:{},appointment:{},conjugation:{},constituent:{},heavyweight:{},incompetent:{},independent:{},replacement:{},underground:{},untouchable:{},conservative:{},administration:{},ape:{},gem:{},hob:{},sap:{},van:{},axis:{plural:"axes"},chap:{},char:{},crew:{},cult:{},duet:{},gang:{},hero:{},hire:{},lamb:{},lame:{},mute:{},nude:{},pawn:{},pill:{},sage:{},soul:{},tout:{},trio:{},ward:{},worm:{},bunch:{},crimp:{},dwarf:{},elect:{},flank:{},ideal:{},noble:{},octet:{},quack:{},saint:{},scrag:{},shark:{},shoal:{},silly:{},skunk:{},super:{},witch:{},zombi:{},agency:{},anchor:{},backup:{},batter:{},buster:{},canary:{},circus:{},dealer:{},domain:{},doomed:{},genius:{},gossip:{},herald:{},hoodoo:{},hopper:{},immune:{},jockey:{},legion:{},member:{},nature:{},orphan:{},parade:{},peanut:{},pillar:{},pirate:{},player:{},porter:{},pusher:{},putter:{},senior:{},septet:{},sestet:{},sextet:{},surety:{},tapper:{},tiller:{},zombie:{},adjunct:{},butcher:{},captive:{},cascade:{},chapter:{},charity:{},checker:{},chicane:{},chicken:{},climber:{},cognate:{},consort:{},cracker:{},dresser:{},gentile:{},invalid:{},knocker:{},lineage:{},mission:{},mixture:{},monster:{},offence:{},partner:{},pioneer:{},pitcher:{},quartet:{},quintet:{},recruit:{},referee:{},shooter:{},spoiler:{},sponsor:{},stemmer:{},steward:{},striker:{},terrace:{},alliance:{},castrate:{},designer:{},director:{},ensemble:{},faithful:{},friendly:{},mandarin:{},operator:{},romantic:{},accessory:{},annoyance:{},attendant:{},bourgeois:{},precedent:{},quadruple:{},reception:{},recession:{},religious:{},reprobate:{},satellite:{},selection:{},sensation:{},supporter:{},contingent:{},convention:{},expedition:{},incendiary:{},individual:{},masquerade:{},population:{},sweetheart:{},tubercular:{},confederate:{},cooperative:{},subdivision:{},territorial:{},transcriber:{},intelligence:{},registration:{},sophisticate:{},welterweight:{},revolutionary:{},ex:{},ass:{},cog:{},cub:{},den:{},dud:{},duo:{},ham:{},hog:{},mob:{},pro:{},deaf:{},dove:{},fate:{},five:{},folk:{},gull:{},jinx:{},mime:{},nark:{},nine:{},pest:{},prey:{},quad:{},rash:{},scab:{},sire:{},wisp:{},wood:{},zany:{},armor:{},batch:{},bogey:{},caste:{},chief:{},choir:{},clone:{},divan:{},drunk:{},elder:{},enemy:{},exile:{},faith:{},flirt:{},grunt:{},joker:{},lobby:{},louse:{plural:"lice"},pagan:{},pivot:{},racer:{},rebel:{},scout:{},siren:{},slave:{},swarm:{},timid:{},triad:{},tribe:{},armour:{},bearer:{},censor:{},choker:{},convoy:{},covert:{},damned:{},deputy:{},empire:{},goffer:{},gopher:{},huddle:{},killer:{},league:{},martyr:{},muster:{},mystic:{},outfit:{},packet:{},palace:{},passer:{},patrol:{},potter:{},quarry:{},rigger:{},ringer:{},rustic:{},scribe:{},sitter:{},slider:{},slouch:{},squire:{},squirt:{},stupid:{},summit:{},tailor:{},tenant:{},terror:{},tracer:{},turkey:{},turner:{},venter:{},voider:{},voodoo:{},walker:{},worthy:{},academy:{},agonist:{},amateur:{},ancient:{},banquet:{},cabinet:{},cashier:{},classic:{},commune:{},courser:{},crammer:{},current:{},divider:{},economy:{},edition:{},emperor:{},entrant:{},fireman:{},lookout:{},octette:{},orderly:{},painter:{},pervert:{},plotter:{},plunger:{},roaster:{},sampler:{},scanner:{},sellout:{},skimmer:{},skipper:{},society:{},soprano:{},spastic:{},spotter:{},stratum:{plural:"strata"},trimmer:{},tripper:{},trooper:{},tumbler:{},upstart:{},veteran:{},wheeler:{},academic:{},agnostic:{},aviation:{},backstop:{},baritone:{},calendar:{},casualty:{},colonial:{},divinity:{},fireball:{},homeless:{},huckster:{},marriage:{},militant:{},military:{},ministry:{},modifier:{},partisan:{},pedigree:{},possible:{},recorder:{},regiment:{},renegade:{},repeater:{},revenant:{},septette:{},sextette:{},shepherd:{},stalwart:{},stringer:{},stripper:{},whistler:{},affiliate:{},ascendant:{},bacchanal:{},canvasser:{},cockscomb:{},collector:{},comforter:{},commander:{},companion:{},conductor:{},crossover:{},eccentric:{},executive:{},fledgling:{},franchise:{},freelance:{},incumbent:{},mercenary:{},moderator:{},neighbour:{},newspaper:{},patriarch:{},patrician:{},portfolio:{},quartette:{},quintette:{},repertory:{},secretary:{},segregate:{},spearhead:{},stigmatic:{},summation:{},transient:{},trumpeter:{},voluntary:{},absolutism:{},anthropoid:{},apparition:{},assemblage:{},collective:{},contractor:{},delinquent:{},episcopate:{},exaltation:{},exposition:{},illiterate:{},judicature:{},leadership:{},lieutenant:{},minimalist:{},percussion:{},profligate:{},provincial:{},rendezvous:{},brotherhood:{},determinant:{},distributor:{},interpreter:{},stipendiary:{},analphabetic:{},antediluvian:{},civilisation:{},civilization:{},commonwealth:{},conglomerate:{},contemporary:{},cosmopolitan:{},humanitarian:{},neighborhood:{},thoroughbred:{},ultramontane:{},concatenation:{},featherweight:{},superordinate:{},classification:{},fundamentalist:{},cop:{},don:{},eon:{},gal:{},gob:{},god:{},hoe:{},kin:{},nan:{},pup:{},wag:{},wit:{},aeon:{},ally:{},bard:{},chum:{},clew:{},dean:{},fink:{},flak:{},geek:{},goof:{},hulk:{},idol:{},lady:{},loon:{},mace:{},para:{},ruck:{},seer:{},self:{plural:"selves"},adder:{},angel:{},augur:{},baron:{},blond:{},brick:{},brute:{},cabal:{},champ:{},comic:{},crier:{},decoy:{},demon:{},diner:{},diver:{},diwan:{},drove:{},envoy:{},fiend:{},flack:{},flier:{},flyer:{},freak:{},gaudy:{},harpy:{},horde:{},indie:{},jewel:{},leech:{},levee:{},liege:{},locus:{},loser:{},mimic:{},needy:{},nymph:{},oiler:{},poser:{},pupil:{},riser:{},roper:{},rummy:{},scold:{},squad:{},timer:{},tutor:{},usher:{},vicar:{},whale:{},wiper:{},affine:{},albino:{},angler:{},badass:{},baster:{},beggar:{},blonde:{},bomber:{},bowler:{},butter:{},carver:{},caster:{},chichi:{},clinic:{},closer:{},cohort:{},coiner:{},comber:{},cookie:{},cordon:{},corpus:{},cotter:{},cowboy:{},coyote:{},critic:{},dragon:{},drawer:{},drudge:{},eleven:{},ensign:{},estate:{},ethnic:{},exarch:{},finder:{},fodder:{},gaffer:{},gainer:{},galaxy:{},granny:{},hacker:{},hedger:{},heller:{},holder:{},honker:{},hooker:{},hotdog:{},inmate:{},intern:{},jungle:{},knight:{},kvetch:{},lineup:{},lovely:{},magpie:{},maiden:{},mailer:{},maniac:{},matron:{},miller:{},muller:{},nation:{},opener:{},ouster:{},packer:{},parrot:{},patron:{},peeler:{},peeper:{},polity:{},poster:{},powwow:{},punter:{},puppet:{},purdah:{},racist:{},rafter:{},ramrod:{},redact:{},regent:{},rusher:{},sailor:{},scorer:{},seeder:{},shaver:{},slaver:{},slicer:{},smoker:{},snitch:{},syntax:{},tacker:{},tagger:{},tanker:{},tartar:{},teller:{},thrush:{},trigon:{},troika:{},truant:{},tucker:{},tyrant:{},umpire:{},undoer:{},vestal:{},virgin:{},votary:{},warren:{},washer:{},wetter:{},winder:{},winner:{},wizard:{},admirer:{},amnesic:{},analyst:{},anomaly:{},aphasic:{},armorer:{},arrival:{},ascetic:{},auditor:{},baggage:{},bastion:{},biology:{},boarder:{},brahman:{},brahmin:{},breaker:{},caravan:{},clapper:{},cluster:{},coaster:{},cobbler:{},college:{},convict:{},council:{},counsel:{},coxcomb:{},crawler:{},creeper:{},crewman:{},crimper:{},darling:{},destiny:{},dragoon:{},dreamer:{},duality:{},echelon:{},ejector:{},fiddler:{},fighter:{},flasher:{},forbear:{},harrier:{},holdout:{},hostess:{},incubus:{},ingenue:{},justice:{},kachina:{},kindred:{},kingpin:{},macumba:{},manikin:{},marcher:{},married:{},newborn:{},notable:{},nursing:{},outpost:{},parvenu:{},patient:{},payroll:{},peasant:{},phalanx:{},phantom:{},planter:{},platoon:{},plodder:{},poacher:{},printer:{},prodigy:{},puncher:{},realist:{},redhead:{},revival:{},runaway:{},scholar:{},sharpie:{},skidder:{},slicker:{},slogger:{},smasher:{},snorter:{},snuffer:{},spinner:{},splicer:{},stalker:{},stamper:{},standby:{},stepper:{},striper:{},sweeper:{},thrower:{},triplet:{},utopian:{},utterer:{},voucher:{},washout:{},watcher:{},wiggler:{},wrecker:{},affluent:{},armourer:{},attender:{},bacchant:{},bachelor:{},bankrupt:{},bisexual:{},bondsman:{},cautious:{},congress:{},corporal:{},creature:{},decadent:{},defeated:{},delegate:{},diabetic:{},dictator:{},dyslexic:{},effector:{},exponent:{},flagging:{},freshman:{},fugitive:{},futurist:{},garrison:{},greyback:{},hangover:{},humanism:{},immortal:{},juvenile:{},lapidary:{},mainstay:{},mannikin:{},maverick:{},mechanic:{},minority:{},minstrel:{},mistress:{},monotype:{},mutation:{},nativist:{},neophyte:{},neurotic:{},newsroom:{},nobility:{},opponent:{},pacifier:{},pantheon:{},planting:{},probable:{},producer:{},recusant:{},referral:{},reminder:{},retainer:{},ruralism:{},scalawag:{},scrubber:{},searcher:{},sergeant:{},sociable:{},songster:{},splitter:{},squadron:{},straggle:{},strawman:{},survivor:{},taxonomy:{},treasury:{},vanguard:{},virtuoso:{},walloper:{},warhorse:{},yearling:{},alcoholic:{},anorectic:{},artificer:{},artillery:{},attracter:{},attractor:{},automaton:{},auxiliary:{},barbarian:{},bombshell:{},brokerage:{},coalition:{},concourse:{},contralto:{},counselor:{},crewwoman:{},cyberpunk:{},defaulter:{},deliverer:{},democracy:{},dependant:{},descender:{},dissident:{},dyspeptic:{},feudatory:{},firewoman:{},flyweight:{},incurable:{},institute:{},insurgent:{},intellect:{},introvert:{},mandatory:{},mendicant:{},middleman:{},navigator:{},organiser:{},organizer:{},pluralism:{},pluralist:{},pothunter:{},precursor:{},predictor:{},presenter:{},pretender:{},processor:{},proconsul:{},publisher:{},quintuple:{},registrar:{},regulator:{},scallywag:{},scavenger:{},scrambler:{},scratcher:{},serration:{},singleton:{},stargazer:{},stockpile:{},successor:{},surrogate:{},symbolism:{},temporary:{},throwback:{},trickster:{},warrantee:{},womanhood:{},antagonist:{},attendance:{},blackguard:{},bondswoman:{},chancellor:{},classifier:{},conference:{},conformist:{},counsellor:{},crossroads:{},descendant:{},descendent:{},doorkeeper:{},embodiment:{},expatriate:{},federation:{},fellowship:{},filibuster:{},forerunner:{},fratricide:{},grandstand:{},mastermind:{},minstrelsy:{},missionary:{},ordination:{},plantation:{},powerhouse:{},quadruplet:{},quintuplet:{},repatriate:{},republican:{},respondent:{},rubberneck:{},salamander:{},scholastic:{},separatism:{},sisterhood:{},subscriber:{},subsidiary:{},supplicant:{},suppresser:{},suppressor:{},timekeeper:{},translator:{},university:{},wallflower:{},abomination:{},academician:{},agriculture:{},anachronism:{},antiquarian:{},beneficiary:{},bureaucracy:{},clairvoyant:{},conditioner:{},confederacy:{},consumptive:{},deification:{},enlightened:{},incarnation:{},lilliputian:{},middlewoman:{},narcoleptic:{},nationalist:{},partnership:{},peacekeeper:{},peripatetic:{},pontificate:{},progression:{},prosecution:{},quarterback:{},recessional:{},romanticist:{},shipbuilder:{},transmitter:{},transsexual:{},underwriter:{},undesirable:{},utilitarian:{},acquaintance:{},bantamweight:{},collaborator:{},congregation:{},conservatory:{},countertenor:{},demonstrator:{},denomination:{},headquarters:{},illegitimate:{},investigator:{},metropolitan:{},middleweight:{},noncombatant:{},philharmonic:{},schoolmaster:{},sharpshooter:{},totalitarian:{},authoritarian:{},confederation:{},correspondent:{},reincarnation:{},schizophrenic:{},supernumerary:{},categorization:{},tatterdemalion:{},instrumentality:{},internationalist:{},bey:{},cox:{},cur:{},few:{},foe:{},hag:{},lad:{},mod:{},obi:{},sib:{},aide:{},amah:{},anti:{},army:{},beau:{},bevy:{},bogy:{},chit:{},clod:{},coon:{},czar:{},dada:{},dame:{},derp:{},dodo:{},dude:{},duke:{},dupe:{},gild:{},giro:{},goat:{},goon:{},grad:{},guru:{},heir:{},hobo:{},hunk:{},jilt:{},jock:{},jury:{},khan:{},maid:{},naif:{},navy:{},nerd:{},peri:{},pimp:{},putz:{},sect:{},suer:{},swot:{},tuft:{},adept:{},baker:{},basso:{},beast:{},bride:{},bunny:{},cadre:{},comer:{},cooky:{},corps:{},covey:{},deist:{},edger:{},elite:{},emcee:{},enate:{},faery:{},fatty:{},fauna:{},felon:{},filer:{},flora:{},folks:{},forum:{},genus:{plural:"genera"},ghoul:{},gipsy:{},giver:{},gnome:{},grove:{},gypsy:{},hajji:{},hakim:{},junky:{},knave:{},lefty:{},leper:{},loony:{},macho:{},madam:{},magus:{},medic:{},mezzo:{},miler:{},mooch:{},mufti:{},nabob:{},nexus:{},ninja:{},obeah:{},parer:{},pigmy:{},poilu:{},ponce:{},prior:{},proxy:{},puppy:{},pygmy:{},quint:{},raver:{},rover:{},satyr:{},scamp:{},sheik:{},shill:{},shrew:{},sibyl:{},sissy:{},slain:{},smith:{},snoop:{},sprog:{},stoic:{},sylph:{},taker:{},thane:{},toady:{},totem:{},trier:{},tryst:{},tuner:{},twirp:{},uncle:{},valet:{},vegan:{},vixen:{},waker:{},widow:{},wight:{},wirer:{},yenta:{},agnate:{},alexic:{},amazon:{},audile:{},avatar:{},avower:{},bagger:{},bagman:{},banker:{},barber:{},barker:{},bather:{},bawler:{},beater:{},beldam:{},bidder:{},boater:{},brewer:{},broker:{},brunet:{},bureau:{},caddie:{},camper:{},cantor:{},caucus:{},chaser:{},cherub:{},chosen:{},coeval:{},cooper:{},coquet:{},cottar:{},craven:{},cubist:{},daemon:{},deacon:{},digger:{},dodger:{},dowser:{},duette:{},dunker:{},egoist:{},eldest:{},eparch:{},erotic:{},eyeful:{},faller:{},fitter:{},flunky:{},forger:{},framer:{},gaggle:{},gagman:{},gamine:{},gasbag:{},gillie:{},goalie:{},gouger:{},grouch:{},gunman:{},gunner:{},hamlet:{},hanger:{},hawker:{},heaver:{},hermit:{},hitter:{},hummer:{},iceman:{},joiner:{},junkie:{},jurist:{},keeper:{},kelpie:{},kisser:{},lackey:{},lector:{},lifter:{},lister:{},lizard:{},loader:{},loaner:{},logjam:{},longer:{},lubber:{},lumper:{},lyceum:{},madcap:{},maenad:{},maimed:{},masher:{},medico:{},menial:{},midden:{},midget:{},minder:{},moiety:{},motile:{},nester:{},oblate:{},oilman:{},parish:{},paster:{},pelter:{},phylum:{},picker:{},plenum:{},police:{},pruner:{},psyche:{},puller:{},python:{},rabble:{},raider:{},raiser:{},ranger:{},ranker:{},rapper:{},reaper:{},redcap:{},reeler:{},regime:{},renter:{},rifler:{},romper:{},sachem:{},salter:{},sawyer:{},sealer:{},seeker:{},sender:{},sexist:{},shaker:{},shaper:{},sharpy:{},signer:{},silvan:{},sleuth:{},smiler:{},sorter:{},sphinx:{},stager:{},stater:{},supper:{},sylvan:{},talent:{},tanner:{},tester:{},theist:{},throng:{},tilter:{},tipper:{},toller:{},tosser:{},tourer:{},townie:{},trusty:{},varlet:{},vermin:{},vestry:{},victor:{},virago:{},voicer:{},waster:{},weasel:{},weaver:{},weeder:{},weeper:{},weirdo:{},whaler:{},winker:{},wraith:{},wretch:{},yakuza:{},yeoman:{},adapter:{},admiral:{},airhead:{},amalgam:{},animist:{},aphakic:{},applier:{},arbiter:{},armiger:{},atheist:{},attache:{},babbler:{},baffled:{},beldame:{},beloved:{},berserk:{},bondman:{},bounder:{},brigade:{},browser:{},buffoon:{},bulimic:{},burgher:{},caitiff:{},carload:{},catcher:{},cavalry:{},chachka:{},changer:{},charmer:{},chemist:{},cocotte:{},collage:{},compere:{},shadow:{},layer:{},north:{},orbit:{},trend:{},truss:{},vault:{},bunker:{},harbor:{},orient:{},origin:{},resort:{},safety:{},target:{},chamber:{},extreme:{},harbour:{},kingdom:{},mandate:{},outline:{},station:{},blockade:{},darkness:{},overlook:{},landscape:{},northeast:{},northwest:{},partition:{},southeast:{},southwest:{},structure:{},atmosphere:{},lug:{},tee:{},balk:{},burr:{},cage:{},drip:{},east:{},fort:{},hoop:{},west:{},cleat:{},fluke:{},scour:{},south:{},beacon:{},closet:{},duplex:{},radius:{plural:"radii"},vacuum:{},wattle:{},canteen:{},grounds:{},cloister:{},pinnacle:{},property:{},surround:{},terminus:{},anchorage:{},barricade:{},honeycomb:{},turnaround:{},institution:{},termination:{},cab:{},dam:{},brim:{},calk:{},dome:{},goal:{},hill:{},hull:{},knob:{},prop:{},seam:{},site:{},turf:{},apron:{},arena:{},baulk:{},cabin:{},grill:{},groin:{},haunt:{},lever:{},niche:{},privy:{},works:{},airway:{},barren:{},corral:{},dugout:{},fender:{},galley:{},hurdle:{},lounge:{},outlet:{},refuge:{},sconce:{},sprawl:{},temple:{},toilet:{},wicket:{},barrack:{},bulwark:{},buttery:{},cornice:{},grating:{},landing:{},leeward:{},maximum:{},pasture:{},salient:{},shingle:{},squinch:{},surgery:{},building:{},cylinder:{},downtown:{},fountain:{},landmark:{},munition:{},quadrant:{},rearward:{},sideline:{},windward:{},homestead:{},multiplex:{},perfumery:{},residence:{},stretcher:{},substrate:{},excavation:{},silhouette:{},convenience:{},culmination:{},declination:{},architecture:{},spa:{},aery:{},brow:{},bung:{},dike:{},flue:{},hell:{},tent:{},abbey:{},aisle:{},arbor:{},attic:{},booth:{},brink:{},disco:{},oxbow:{},oxeye:{},quoin:{},realm:{},salon:{},villa:{},whorl:{},barony:{},barrow:{},bazaar:{},billet:{},bustle:{},canton:{},casing:{},cellar:{},cooler:{},garage:{},ghetto:{},grille:{},hearth:{},locker:{},midway:{},muffle:{},oracle:{},remise:{},saloon:{},stocks:{},studio:{},tiptop:{},uptown:{},volute:{},arsenal:{},chassis:{},cockpit:{},commons:{},cubicle:{},dockage:{},fairway:{},fencing:{},gondola:{},heading:{},hotspot:{},lattice:{},lodging:{},minimum:{},moorage:{},pannier:{},rattrap:{},rootage:{},stowage:{},theater:{},theatre:{},vacuity:{},baseline:{},butchery:{},buttress:{},clearing:{},crosscut:{},domicile:{},erection:{},exterior:{},fanlight:{},fastness:{},firewall:{},foothold:{},frontier:{},lavatory:{},memorial:{},monument:{},mortuary:{},overhang:{},pedestal:{},scenario:{},solitude:{},sprocket:{},stockade:{},stoppage:{},vaulting:{},bombproof:{},cathedral:{},fundament:{},hindrance:{},panhandle:{},proximity:{},resonator:{},sanctuary:{},territory:{},watershed:{},confluence:{},department:{},encampment:{},flashpoint:{},groundwork:{},hinderance:{},quartering:{},substratum:{},underbelly:{},breadbasket:{},columbarium:{},destination:{},engineering:{},equinoctial:{},planetarium:{},penitentiary:{},circumference:{},confectionery:{},fortification:{},hub:{},hut:{},lee:{},sty:{},acme:{},apex:{},barn:{},brig:{},coop:{},digs:{},holy:{},jail:{},jook:{},juke:{},loge:{},mall:{},nook:{},pave:{},sash:{},silo:{},slum:{},tope:{},weir:{},abode:{},aerie:{},altar:{},bazar:{},detox:{},haven:{},heath:{},hutch:{},kraal:{},lager:{},manor:{},manse:{},navel:{},oasis:{plural:"oases"},opera:{},paddy:{},plaza:{},pylon:{},rodeo:{},shire:{},spile:{},sprag:{},venue:{},visor:{},apogee:{},arcade:{},ashram:{},asylum:{},atrium:{},bagnio:{},bailey:{},barrio:{},belfry:{},boards:{},casino:{},chapel:{},county:{},creche:{},cupola:{},deckle:{},fraise:{},haymow:{},hostel:{},kennel:{},lancet:{},larder:{},lockup:{},mihrab:{},parlor:{},plaque:{},prefab:{},prison:{},spigot:{},stacks:{},tampon:{},turret:{},vertex:{},zodiac:{},automat:{},balcony:{},batwing:{},benthos:{},borough:{},bubbler:{},bullpen:{},cabaret:{},caboose:{},chantry:{},convent:{},deanery:{},demesne:{},derrick:{},desktop:{},drydock:{},dukedom:{},dungeon:{},earldom:{},earplug:{},embassy:{},emirate:{},eparchy:{},equinox:{},fiefdom:{},florist:{},flyover:{},framing:{},funfair:{},grocery:{},hayrack:{},hospice:{},khanate:{},lunette:{},mansion:{},marquee:{},masonry:{},matting:{},midland:{},mooring:{},narthex:{},nirvana:{},obelisk:{},outback:{},parapet:{},parlour:{},pinhead:{},railing:{},rathole:{},redoubt:{},ribbing:{},rotunda:{},sanctum:{},sawmill:{},shipway:{},shoebox:{},stopple:{},tambour:{},transom:{},trellis:{},trestle:{},tribune:{},vantage:{},abutment:{},airspace:{},ambiance:{},ambience:{},backside:{},ballpark:{},basement:{},basilica:{},bioscope:{},bodywork:{},brattice:{},diggings:{},doghouse:{},dominion:{},entrepot:{},environs:{},extremum:{},farmland:{},fireside:{},hacienda:{},hideaway:{},imperium:{},jalousie:{},littoral:{},mantelet:{},mounting:{},nailhead:{},outdoors:{},palisade:{},pharmacy:{},porthole:{},province:{},revolver:{},seascape:{},sidewall:{},steerage:{},stopover:{},suburbia:{},sudatory:{},sweatbox:{},tailgate:{},turnpike:{},wellhead:{},backwater:{},bailiwick:{},beachhead:{},belvedere:{},caliphate:{},caparison:{},cellarage:{},chandlery:{},cloakroom:{},colonnade:{},cookhouse:{},couchette:{},crematory:{},crownwork:{},cubbyhole:{},dollhouse:{},dormitory:{},dripstone:{},fieldwork:{},fireguard:{},forefront:{},guardroom:{},hatchback:{},isoclinal:{},lazaretto:{},lineation:{},mezzanine:{},millinery:{},orphanage:{},outfitter:{},pleasance:{},princedom:{},revetment:{},roadblock:{},scrapheap:{},shrubbery:{},viewpoint:{},viscounty:{},workhouse:{},architrave:{},birthplace:{},borderline:{},bridgehead:{},brownstone:{},chokepoint:{},commissary:{},courthouse:{},escarpment:{},greenhouse:{},ironmonger:{},justiciary:{},laboratory:{},lamination:{},maisonette:{},metropolis:{},obstructor:{},panopticon:{},playground:{},prefecture:{},proscenium:{},quadrangle:{},rotisserie:{},sanatorium:{},suzerainty:{},tenderloin:{},triclinium:{},wellspring:{},wheelhouse:{},condominium:{},conventicle:{},crematorium:{},crenelation:{},demarcation:{},maisonnette:{},observatory:{},reformatory:{},superstrate:{},tobacconist:{},trusteeship:{},wainscoting:{},amphitheater:{},amphitheatre:{},chapterhouse:{},clotheshorse:{},delicatessen:{},fountainhead:{},haberdashery:{},municipality:{},packinghouse:{},patriarchate:{},retrenchment:{},substructure:{},superstratum:{},surroundings:{},wainscotting:{},juxtaposition:{},infrastructure:{},dec:{},inn:{},loo:{},pub:{},burg:{},cafe:{},deli:{},dorm:{},hank:{},iglu:{},kirk:{},lair:{},lawn:{},mart:{},nave:{},oast:{},rink:{},souk:{},tine:{},tipi:{},veld:{},ways:{},wold:{},yurt:{},apsis:{},burgh:{},condo:{},cubby:{},cuddy:{},dacha:{},duchy:{},duomo:{},eaves:{},flies:{},gable:{},glade:{},gulag:{},harem:{},hogan:{},igloo:{},lanai:{},layby:{},mecca:{},midst:{},motel:{},oriel:{},parts:{},patio:{},polls:{},qibla:{},roads:{},rooms:{},sauna:{},skein:{},socle:{},soddy:{},sodom:{},spire:{},stoep:{},stupa:{},tenon:{},tepee:{},tupek:{},tupik:{},veldt:{},weald:{},abatis:{},abbacy:{},alcove:{},apiary:{},arbour:{},aviary:{},bedsit:{},bethel:{},bodega:{},bounds:{},bowels:{},cabana:{},calkin:{},campus:{},carrel:{},casbah:{},casern:{},chalet:{},depths:{},dolmen:{},donjon:{},dormer:{},durbar:{},eatery:{},escarp:{},fipple:{},flange:{},flyway:{},friary:{},furket:{},gantry:{},garret:{},hangar:{},hareem:{},hayrig:{},imaret:{},isobar:{},isohel:{},isolex:{},kasbah:{},laager:{},locale:{},loggia:{},marina:{},masjid:{},meadow:{},medina:{},menhir:{},merlon:{},midair:{},morgue:{},mosque:{},mudhif:{},musjid:{},pagoda:{},paling:{},pantry:{},parvis:{},pelmet:{},piazza:{},pigsty:{},plinth:{},priory:{},pueblo:{},radome:{},setoff:{},skybox:{},skyway:{},stalls:{},storey:{},suburb:{},tenter:{},upside:{},volary:{},wigwam:{},wikiup:{},winery:{},abattis:{},airdock:{},airlock:{},alcazar:{},antapex:{},apadana:{},apojove:{},apolune:{},athanor:{},barroom:{},bascule:{},bedside:{},beeline:{},borstal:{},boudoir:{},brewery:{},brewpub:{},brothel:{},campong:{},cannery:{},capitol:{},carport:{},carrell:{},chancel:{},chateau:{},citadel:{},coaming:{},corncob:{},cottage:{},cowbarn:{},cowshed:{},cowtown:{},crinion:{},dinette:{},diocese:{},earshot:{},edifice:{},enclave:{},exurbia:{},eyeshot:{},fantail:{},feedlot:{},firebox:{},screw:{},share:{},sheet:{},slice:{},slide:{},spill:{},stage:{},stake:{},tread:{},paddle:{},weight:{},canvass:{},compact:{},undercut:{},representation:{},fin:{},gag:{},jet:{},tug:{},bark:{},bunk:{},drum:{},mask:{},pipe:{},reel:{},scan:{},blank:{},drill:{},plumb:{},plume:{},shank:{},sling:{},spray:{},pickup:{},saddle:{},trench:{},capsule:{},security:{},sacrifice:{},technical:{},can:{},jar:{},map:{},ply:{},rib:{},rim:{},web:{},bell:{},buck:{},claw:{},comb:{},copy:{},crib:{},dish:{},fake:{},foil:{},grab:{},kite:{},ramp:{},rent:{},slot:{},spit:{},tank:{},bosom:{},cable:{},charm:{},drain:{},grave:{},price:{},skirt:{},stool:{},strap:{},stump:{},trail:{},access:{},cannon:{},fiddle:{},formal:{},insert:{},launch:{},purple:{},reward:{},strand:{},tackle:{},display:{},floater:{},incline:{},limited:{},portion:{},torpedo:{},overcast:{},puncture:{},broadside:{},duplicate:{},submarine:{},surcharge:{},production:{},interchange:{},bus:{},due:{},gap:{},jaw:{},lag:{},nut:{},tin:{},win:{},arch:{},bail:{},cell:{},dope:{},fell:{},film:{},lace:{},lash:{},mail:{},pale:{},purl:{},rate:{},skid:{},sole:{},spar:{},tuck:{},vamp:{},vent:{},vest:{},brake:{},brass:{},chuck:{},cramp:{},crest:{},drape:{},elbow:{},habit:{},lease:{},lower:{},prize:{},roach:{},royal:{},scrap:{},slate:{},snare:{},snuff:{},total:{},trump:{},beaver:{},canvas:{},future:{},handle:{},header:{},jacket:{},motley:{},muzzle:{},quiver:{},rocket:{},roller:{},staple:{},wrench:{},compass:{},element:{},exhaust:{},frontal:{},thunder:{},transit:{},upstage:{},traverse:{},accession:{},allowance:{},guarantee:{},promenade:{},shipwreck:{},attachment:{},protection:{},perpendicular:{},aid:{},gig:{},gin:{},nap:{},oil:{},ram:{},bead:{},bulb:{},curb:{},dart:{},daub:{},dial:{},dose:{},exit:{},fuse:{},goad:{},item:{},knit:{},plan:{},rein:{},swag:{},veil:{},alarm:{},chart:{},cinch:{},clasp:{},eagle:{},entry:{},fluff:{},gouge:{},lance:{},meter:{},miter:{},pouch:{},probe:{},punch:{},purse:{},sable:{},scuff:{},shear:{},stern:{},taper:{},thumb:{},wharf:{},whisk:{},barrel:{},beetle:{},bronze:{},burden:{},congee:{},fleece:{},glossy:{},halter:{},limber:{},margin:{},mobile:{},needle:{},remote:{},shroud:{},sketch:{},splice:{},stripe:{},toggle:{},trough:{},volume:{},ballast:{},binding:{},blanket:{},costume:{},crackle:{},crystal:{},diamond:{},fitting:{},graphic:{},harness:{},premium:{},product:{},pyramid:{},sandbag:{},squelch:{},trammel:{},uniform:{},venture:{},warrant:{},wildcat:{},working:{},assembly:{},charcoal:{},discount:{},envelope:{},imperial:{},ligature:{},original:{},specific:{},treasure:{},vertical:{},deduction:{},distemper:{},inventory:{},objective:{},reversion:{},whitewash:{},supplement:{},contrivance:{},convertible:{},inspiration:{},intersection:{},counterbalance:{},bet:{},gel:{},gut:{},jag:{},jig:{},pan:{},pry:{},tab:{},tax:{},zip:{},bait:{},barb:{},bomb:{},cone:{},cuff:{},dado:{},disk:{},gear:{},gore:{},grid:{},harp:{},loom:{},main:{},pant:{},pike:{},prod:{},reef:{},ruff:{},sham:{},tare:{},tidy:{},tire:{},toll:{},award:{},basic:{},basin:{},baton:{},birch:{},braid:{},broom:{},clack:{},cloak:{},clout:{},crock:{},fagot:{},ferry:{},filet:{},forte:{},found:{},frail:{},jolly:{},motor:{},pedal:{},potty:{},radio:{},rivet:{},scarf:{},shore:{},shunt:{},sieve:{},splat:{},splay:{},stave:{},steal:{},steel:{},thong:{},tithe:{},torch:{},trunk:{},twine:{},upper:{},valve:{},weave:{},bridle:{},buckle:{},buffet:{},carpet:{},cotton:{},custom:{},devise:{},enamel:{},entail:{},furrow:{},girdle:{},hobble:{},mangle:{},mosaic:{},motive:{},pallet:{},pencil:{},pinion:{},powder:{},radial:{},rattle:{},rebate:{},rumble:{},shield:{},shimmy:{},shovel:{},sledge:{},sluice:{},tablet:{},throne:{},timber:{},tinsel:{},uplift:{},benefit:{},bombard:{},bootleg:{},console:{},default:{},forfeit:{},freight:{},gantlet:{},generic:{},grapple:{},journal:{},loading:{},molding:{},overlap:{},pigment:{},plastic:{},salvage:{},scooter:{},scuffle:{},spindle:{},steamer:{},stopper:{},upright:{},carriage:{},catapult:{},facility:{},laminate:{},medicine:{},offstage:{},overload:{},plastron:{},railroad:{},retrofit:{},strickle:{},throttle:{},whipping:{},wireless:{},automatic:{},blackjack:{},blackwash:{},foliation:{},interlock:{},roughcast:{},threshold:{},antiseptic:{},camouflage:{},incidental:{},intangible:{},preventive:{},reversible:{},watercolor:{},maintenance:{},watercolour:{},differential:{},prescription:{},preventative:{},prophylactic:{},reproduction:{},transcription:{},transportation:{},fob:{},guy:{},hem:{},jug:{},kit:{},saw:{},cane:{},cart:{},clam:{},coif:{},cosy:{},cozy:{},disc:{},felt:{},gash:{},hone:{},hose:{},keel:{},loot:{},luff:{},lure:{},mast:{},mend:{},mine:{},muff:{},nuke:{},plow:{},robe:{},ruby:{},snip:{},soap:{},spud:{},swab:{},tile:{},till:{},tram:{},vane:{},wand:{},weed:{},weld:{},welt:{},audio:{},audit:{},baste:{},bilge:{},brail:{},bugle:{},canal:{},chest:{},chock:{},conge:{},couch:{},crape:{},crepe:{},crook:{},flute:{},frill:{},frock:{},fusee:{},hoist:{},inset:{},kitty:{},leash:{},liner:{},mixer:{},noose:{},novel:{},pearl:{},piano:{},plait:{},quill:{},reset:{},roost:{},saber:{},sabre:{},scull:{},spear:{},squab:{},stilt:{},sulky:{},video:{},vomit:{},wagon:{},aerial:{},armory:{},baffle:{},banner:{},batten:{},binder:{},bodkin:{},bypass:{},canopy:{},chisel:{},clench:{},dollar:{},dredge:{},drogue:{},duster:{},engine:{},excise:{},facing:{},funnel:{},garner:{},hamper:{},joggle:{},kettle:{},lining:{},livery:{},lumber:{},marble:{},mortar:{},mousse:{},nickel:{},ocular:{},payoff:{},pestle:{},piping:{},pommel:{},profit:{},puzzle:{},ransom:{},ration:{},rental:{},ribbon:{},rotary:{},runway:{},saucer:{},seesaw:{},siphon:{},suture:{},tattoo:{},thatch:{},throat:{},tunnel:{},turtle:{},wealth:{},acrylic:{},armoury:{},balloon:{},bargain:{},beehive:{},blinker:{},bolster:{},caisson:{},casting:{},ceiling:{},chariot:{},chopper:{},clarion:{},clinker:{},clipper:{},cowhide:{},earnest:{},elastic:{},expense:{},festoon:{},fortune:{},garnish:{},gravure:{},grinder:{},killing:{},linkage:{},novelty:{},overall:{},overlay:{},pallium:{},perfume:{},pillory:{},pointer:{},ringlet:{},rosette:{},segment:{},shuttle:{},staging:{},trailer:{},trumpet:{},unction:{},barbecue:{},barbeque:{},disguise:{},electric:{},elevated:{},fraction:{},gauntlet:{},gossamer:{},heritage:{},homespun:{},ironclad:{},lifeline:{},lighting:{},mackinaw:{},moulding:{},pinpoint:{},pinwheel:{},poundage:{},sanguine:{},sapphire:{},scribble:{},triangle:{},underlay:{},upstairs:{},virginal:{},admission:{},amphibian:{},backstage:{},capillary:{},cartridge:{},cartwheel:{},cathartic:{},condenser:{},damascene:{},depiction:{},diaphragm:{},medallion:{},overdrive:{},pacemaker:{},reservoir:{},screening:{},sectional:{},solitaire:{},spotlight:{},undercoat:{},assessment:{},bottleneck:{},equatorial:{},overburden:{},pigeonhole:{},pocketbook:{},pontifical:{},refractory:{},reparation:{},roundabout:{},simulation:{},waterproof:{},accelerator:{},certificate:{},inheritance:{},installment:{},restorative:{},ventilation:{},modification:{},subscription:{},hospitalization:{},instrumentation:{},ax:{},axe:{},bib:{},bin:{},bur:{},cot:{},fee:{},fur:{},jib:{},lid:{},six:{},ten:{},tub:{},two:{},bath:{},bike:{},cash:{},coke:{},cope:{},cowl:{},cusp:{},darn:{},debt:{},dice:{},dory:{},duct:{},fore:{},four:{},gaff:{},gage:{},gong:{},helm:{},hemp:{},icon:{},iris:{},junk:{},kern:{},loan:{},maul:{},mink:{},pane:{},pier:{},quid:{},reed:{},rook:{},scum:{},semi:{},sump:{},swob:{},taxi:{},vice:{},ware:{},wool:{},yarn:{},yawl:{},annex:{},atlas:{},barge:{},bevel:{},chaff:{},chute:{},clamp:{},crane:{},crate:{},cubeb:{},dandy:{},dicky:{},dinky:{},dolly:{},dower:{},eight:{},fifty:{},flail:{},floss:{},folio:{},fuzee:{},genre:{},girth:{},gourd:{},grape:{},hinge:{},hobby:{},inlay:{},japan:{},ladle:{},latch:{},linen:{},means:{},mitre:{},motif:{},mulct:{},pique:{},quilt:{},quirk:{},quota:{},rifle:{},rotor:{},setup:{},seven:{},shred:{},skate:{},spade:{},spool:{},spout:{},strut:{},three:{},toner:{},trawl:{},truck:{},twill:{},virtu:{},alpaca:{},anklet:{},argyle:{},argyll:{},arnica:{},balsam:{},bender:{},birdie:{},bishop:{},blower:{},blowup:{},bolero:{},bonnet:{},bounty:{},budget:{},bullet:{},cachet:{},carbon:{},casket:{},castor:{},claxon:{},cobble:{},cobweb:{},collet:{},crenel:{},cutoff:{},cutout:{},damask:{},damper:{},dibble:{},dickey:{},dipper:{},domino:{},douche:{},dragee:{},equity:{},eyelet:{},fetish:{},foible:{},fresco:{},gaiter:{},gibbet:{},gusset:{},heckle:{},hooter:{},horror:{},hunter:{},intake:{},jigger:{},lacing:{},lappet:{},makeup:{},making:{},mallet:{},marker:{},patina:{},paving:{},platen:{},plough:{},poleax:{},portal:{},primer:{},rabbet:{},rattan:{},refill:{},retort:{},revere:{},screed:{},sheath:{},sinker:{},socket:{},splint:{},stereo:{},syphon:{},tamper:{},tandem:{},tarmac:{},tenure:{},ticker:{},trepan:{},twenty:{},velvet:{},veneer:{},vessel:{},vicuna:{},backing:{},bandage:{},bobsled:{},carving:{},central:{},chamfer:{},chequer:{},cistern:{},cleaner:{},cleanup:{},coinage:{},crochet:{},cruiser:{},curtain:{},dilator:{},distaff:{},emerald:{},etching:{},flannel:{},flounce:{},footing:{},gangway:{},garbage:{},garland:{},gauffer:{},gelatin:{},grizzle:{},hanging:{},haywire:{},lamella:{},laniard:{},lanyard:{},lashing:{},lockage:{},lounger:{},manakin:{},masking:{},meshing:{},mileage:{},mintage:{},mortice:{},mortise:{},movable:{},muffler:{},palette:{},pendant:{},pendent:{},pennant:{},pillbox:{},poleaxe:{},portage:{},pottery:{},priming:{},quarrel:{},readout:{},retread:{},roundel:{},rubbing:{},scupper:{},scuttle:{},serpent:{},shampoo:{},shellac:{},shutter:{},snaffle:{},snorkel:{},spangle:{},spouter:{},stabile:{},stinker:{},tankage:{},toehold:{},tracing:{},treadle:{},trefoil:{},truckle:{},trundle:{},vesture:{},webbing:{},whipsaw:{},wrapper:{},additive:{},adjuvant:{},aperture:{},aquatint:{},backdoor:{},basilisk:{},blowback:{},bludgeon:{},breakage:{},causeway:{},checkout:{},clincher:{},compress:{},corduroy:{},coupling:{},crossbar:{},currency:{},detector:{},dividend:{},dogtooth:{},downcast:{},followup:{},frontage:{},giveaway:{},goodwill:{},hardware:{},headgear:{},headshot:{},hypnotic:{},ignition:{},inhalant:{},lipstick:{},masthead:{},meniscus:{},metallic:{},modeling:{},nautilus:{},neckband:{},nightcap:{},ornament:{},outboard:{},partizan:{},pavement:{},pectoral:{},planking:{},plumbing:{},portable:{},pressing:{},radiator:{},remittal:{},residual:{},resource:{},roulette:{},scaffold:{},scapular:{},scissors:{plural:"scissors"},scrabble:{},springer:{},sunburst:{},tapestry:{},taxation:{},thrasher:{},tomahawk:{},totality:{},tympanum:{},valuable:{},vignette:{},wardrobe:{},widening:{},admixture:{},antiquity:{},aquaplane:{},bagatelle:{},bastinado:{},blindfold:{},blueprint:{},boomerang:{},carpetbag:{},crinoline:{},depressor:{},detergent:{},doodlebug:{},downstage:{},emergency:{},endowment:{},equalizer:{},exemption:{},extortion:{},extractor:{},facsimile:{},freewheel:{},gabardine:{},grotesque:{},hemstitch:{},horseshoe:{},invention:{},jackknife:{},microwave:{},millstone:{},miniature:{},modernism:{},nosepiece:{},ownership:{},packaging:{},pargeting:{},patchwork:{},pinstripe:{},polyester:{},potpourri:{},recording:{},refresher:{},semaphore:{},semblance:{},shielding:{},sideboard:{},skyrocket:{},slapstick:{},soporific:{},spectacle:{},starboard:{},telephone:{},telescope:{},treadmill:{},turntable:{},verdigris:{},videotape:{},whirligig:{},allocation:{},ambulatory:{},anesthetic:{},assistance:{},astringent:{},automation:{},cantilever:{},chinchilla:{},concertina:{},constraint:{},deductible:{},depilatory:{},disposable:{},elongation:{},escutcheon:{},featherbed:{},foreground:{},forfeiture:{},guillotine:{},hammerhead:{},hydroplane:{},innovation:{},intoxicant:{},knockabout:{},lithograph:{},monochrome:{},nonpayment:{},nutcracker:{},pargetting:{},peripheral:{},polychrome:{},redemption:{},stabilizer:{},stenograph:{},subvention:{},sustenance:{},technology:{},television:{},waterspout:{},anaesthetic:{},anamorphism:{},concealment:{},containment:{},copperplate:{},cornerstone:{},counterfeit:{},countersink:{},cryptograph:{},delineation:{},delinquency:{},encumbrance:{},fingerboard:{},fluorescent:{},incumbrance:{},perforation:{},pyrotechnic:{},retribution:{},subsistence:{},tensiometer:{},transporter:{},undercharge:{},withholding:{},dispensation:{},electrolytic:{},encrustation:{},inclinometer:{},incrustation:{},installation:{},intermixture:{},photogravure:{},straightaway:{},transparency:{},appropriation:{},embellishment:{},improvisation:{},merchandising:{},mystification:{},quadruplicate:{},semiautomatic:{},pharmaceutical:{},superannuation:{},aba:{},boa:{},dag:{},fax:{},gad:{},keg:{},nib:{},nog:{},pix:{},pyx:{},rep:{},ski:{},taw:{},urn:{},ante:{},arms:{},bale:{},berm:{},bier:{},bitt:{},bola:{},bolo:{},brad:{},cape:{},cask:{},cent:{},coax:{},coca:{},cosh:{},dime:{},dole:{},doll:{},garb:{},gilt:{},gyro:{},hasp:{},hypo:{},ikon:{},juju:{},lane:{},lint:{},luge:{},lute:{},maxi:{},maze:{},mini:{},mitt:{},mule:{},pail:{},perk:{},plat:{},pork:{},pouf:{},rung:{},scow:{},silk:{},sill:{},skep:{},sled:{},tamp:{},tapa:{},topi:{},trey:{},vape:{},wale:{},wick:{},adobe:{},aegis:{},aglet:{},album:{},alley:{},anode:{},anvil:{},arrow:{},auger:{},batik:{},bogie:{},bolus:{},bongo:{},borer:{},bribe:{},bulla:{},caddy:{},canoe:{},chime:{},coign:{},debit:{},denim:{},depot:{},diary:{},diode:{},drier:{},flask:{},flume:{},fount:{},frier:{},fryer:{},gauze:{},globe:{},golem:{},hijab:{},inlet:{},jimmy:{},jorum:{},kayak:{},khaki:{},lasso:{},latex:{},lisle:{},lorry:{},lucre:{},manta:{},mimeo:{},mizen:{},moire:{},mulch:{},newel:{},nylon:{},penny:{},piste:{},plush:{},poker:{},prism:{},pyxis:{},ranch:{},razor:{},relic:{},rouge:{},ruler:{},sabot:{},scape:{},sedan:{},seine:{},servo:{},shelf:{plural:"shelves"},slops:{},spoke:{},sprig:{},stele:{},steps:{},stoup:{},stove:{},strop:{},suede:{},swage:{},tammy:{},tanka:{},tappa:{},teddy:{},terms:{},toque:{},torus:{},towel:{},tunic:{},tweed:{},usury:{},verso:{},vizor:{},waist:{},winch:{},withe:{},xerox:{},yacht:{},abacus:{},afghan:{},aiglet:{},alidad:{},amends:{},arctic:{},artery:{},avenue:{},banger:{},bangle:{},banian:{},banyan:{},bauble:{},beaker:{},bicorn:{},blazon:{},boiler:{},bracer:{},broach:{},bumper:{},burner:{},buzzer:{},caftan:{},calash:{},camera:{},camion:{},camlet:{},capote:{},carton:{},casein:{},catgut:{},chaise:{},cheque:{},chiton:{},chukka:{},cither:{},cloaca:{},cloche:{},coffer:{},coffin:{},coigne:{},colors:{},corbel:{},corker:{},corset:{},crayon:{},crutch:{},dagger:{},daybed:{},detour:{},diaper:{},dickie:{},dipole:{},dirndl:{},discus:{},dogleg:{},dolman:{},dosage:{},duffel:{},duffle:{},eyecup:{},fabric:{},facade:{},falsie:{},fanjet:{},fascia:{},fetter:{},firkin:{},fizgig:{},floppy:{},frieze:{},garter:{},gimlet:{},goblet:{},guimpe:{},guinea:{},gunnel:{},harrow:{},helmet:{},hookup:{},hotbed:{},impost:{},instep:{},iodine:{},island:{},jersey:{},jetsam:{},jigsaw:{},juicer:{},kaftan:{},kibble:{},kirtle:{},lateen:{},laurel:{},ledger:{},linage:{},lunula:{},magnet:{},markup:{},miotic:{},mizzen:{},myotic:{},nipple:{},nozzle:{},onager:{},pajama:{},pavage:{},pellet:{},pennon:{},peplum:{},peyote:{},pincer:{},pipage:{},pomade:{},pompon:{},popper:{},pyjama:{},ragbag:{},reamer:{},remake:{},reseau:{},rudder:{},russet:{},scythe:{},settee:{},shades:{},shorts:{},siding:{},sleeve:{},sleigh:{},spinet:{},spline:{},stoker:{},stylus:{},sublet:{},subway:{},surtax:{},swathe:{},swivel:{},syrinx:{},taenia:{},talcum:{},tariff:{},teacup:{},teeter:{},tenner:{},tether:{},thwart:{},tocsin:{},trophy:{},trowel:{},turban:{},viewer:{},waggon:{},wampum:{},wherry:{},wicker:{},willow:{},wiring:{},woolen:{},yarder:{},zipper:{},acetate:{},aerosol:{},airline:{},alidade:{},ampulla:{},android:{},aneroid:{},annulet:{},anodyne:{},apanage:{},apparel:{},archive:{},armband:{},armilla:{},arrears:{},banding:{},basting:{},batting:{},bayonet:{},beading:{},bedding:{},bladder:{},blocker:{},blusher:{},bollock:{},bouquet:{},bracing:{},brocade:{},broiler:{},bullion:{},bunting:{},burthen:{},bushing:{},caleche:{},caliper:{},cathode:{},catwalk:{},cautery:{},charger:{},charnel:{},chemise:{},chevron:{},chimney:{},chlamys:{},circlet:{},colours:{},commode:{},cooling:{},cordage:{},coronet:{},corsair:{},crampon:{},cutaway:{},daybook:{},deadeye:{},decoder:{},diagram:{},doeskin:{},dogsled:{},doormat:{},dragger:{},dragnet:{},drapery:{},drawers:{},dustpan:{},escheat:{},eyehole:{},fixings:{},flatbed:{},flattop:{},flipper:{},foghorn:{},foliage:{},footage:{},foretop:{},forgery:{},frigate:{},funding:{},furring:{},fustian:{},garment:{},garotte:{},garrote:{},gouache:{},grapnel:{},griddle:{},hackney:{},hammock:{},harpoon:{},hassock:{},hatchel:{},hatchet:{},heating:{},hedging:{},hibachi:{},hobnail:{},holding:{},holster:{},hydrant:{},iceboat:{},igniter:{},impasse:{},ironing:{},jackpot:{},javelin:{},joinery:{},fibre:{},hazel:{},lemon:{},peach:{},plank:{},raven:{},snipe:{},spine:{},steer:{},stint:{},stunt:{},bleach:{},breath:{},callus:{},cherry:{},dimple:{},entire:{},ferret:{},filler:{},hybrid:{},jackal:{},marrow:{},orange:{},radish:{},spruce:{},stifle:{},winkle:{},endemic:{},vanilla:{},beefwood:{},calabash:{},concrete:{},emission:{},kingfish:{},solution:{},volatile:{},partridge:{},repellant:{},derivative:{},thickening:{},ash:{},bud:{},cob:{},hen:{},mew:{},mud:{},mum:{},paw:{},roe:{},sow:{},soy:{},wax:{},yam:{},beef:{},burl:{},calf:{plural:"calves"},chat:{},fowl:{},fuzz:{},gill:{},grub:{},hock:{},hoof:{},lobe:{},rose:{},scup:{},soup:{},swan:{},tint:{},tuna:{},tusk:{},alloy:{},briar:{},clove:{},coney:{},ebony:{},ether:{},filth:{},flesh:{},gumbo:{},homer:{},jelly:{},matte:{},mocha:{},reeve:{},wrack:{},annual:{},canine:{},carrot:{},cereal:{},cockle:{},feeler:{},fennel:{},flimsy:{},gargle:{},gravel:{},grouse:{},indigo:{},mammee:{},medlar:{},monkey:{},nebula:{},oyster:{},salmon:{plural:"salmon"},shiner:{},shrimp:{},sprout:{},stigma:{},blossom:{},blubber:{},buffalo:{},cabbage:{},calamus:{},catfish:{},caudate:{},caustic:{},chelate:{},chicory:{},ciliate:{},essence:{},griffon:{},hemlock:{},hydrate:{},incense:{},lighter:{},remount:{},sardine:{},stinger:{},vitriol:{},ambrosia:{},billfish:{},blackcap:{},crawfish:{},crayfish:{},earthnut:{},escallop:{},filament:{},flounder:{},infusion:{},ironwood:{},quandong:{},relative:{},ringtail:{},screamer:{},sycamore:{},alabaster:{},algarroba:{},broadbill:{},composite:{},fulminate:{},perennial:{},tangerine:{},bladderpod:{},granadilla:{},heartsease:{},periwinkle:{},tumbleweed:{},agglomerate:{},bittersweet:{},intermediate:{},dye:{},elk:{},fig:{},haw:{},oka:{},pea:{},pee:{},rye:{},sac:{},tar:{},yak:{},carp:{},clay:{},coma:{},cony:{},crud:{},cusk:{},dung:{},fang:{},foam:{},germ:{},glue:{},hare:{},hind:{},husk:{},kiwi:{},lake:{},mung:{},okra:{},pine:{},pith:{},puke:{},rice:{},roan:{},sloe:{},taro:{},teal:{},yellow:{},titi:{},twig:{},amber:{},anime:{},berry:{},boxer:{},carob:{},cedar:{},chine:{},guava:{},hound:{},husky:{},kauri:{},lemma:{},monad:{},ocher:{},ochre:{},onion:{},ounce:{},pansy:{},pecan:{},pewit:{},prawn:{},quail:{},shuck:{},sloth:{},slush:{},smelt:{},snail:{},snout:{},spawn:{},swift:{},tabby:{},thorn:{},topaz:{},umber:{},virus:{},wafer:{},wahoo:{},wheat:{},whelk:{},badger:{},bonito:{},broody:{},chrome:{},cirrus:{},cocoon:{},cowpea:{},cuckoo:{},elixir:{},grease:{},grubby:{},howler:{},jabiru:{},jargon:{},jujube:{},kernel:{},leaven:{},lentil:{},liquor:{},locust:{},manioc:{},mastic:{},mentum:{},mildew:{},mimosa:{},mullet:{},muscat:{},mutant:{},nectar:{},nettle:{},nodule:{},pawpaw:{},pecker:{},plasma:{},ruddle:{},sallow:{},shoddy:{},squill:{},starch:{},stroma:{},stucco:{},sunray:{},thorax:{},tissue:{},violet:{},walnut:{},warble:{},amyloid:{},antenna:{plural:"antennae"},apricot:{},aquatic:{},terrestrial:{},asphalt:{},avocado:{},beebalm:{},bobtail:{},builder:{},bulldog:{},caltrop:{},cayenne:{},chinook:{},coconut:{},cricket:{},cudweed:{},currant:{},cuticle:{},dasheen:{},gallfly:{},juniper:{},lacquer:{},leaflet:{},lettuce:{},macadam:{},mordant:{},mustard:{},packing:{},panther:{},papilla:{},papyrus:{},parsnip:{},pigweed:{},pollard:{},redfish:{},redwood:{},rubbish:{},saffron:{},salsify:{},shallot:{},slating:{},solvate:{},solvent:{},soybean:{},sunfish:{},truffle:{},whisker:{},abrasive:{},allspice:{},angelica:{},biennial:{},bilberry:{},bluebell:{},chickpea:{},cinnabar:{},cinnamon:{},congener:{},creosote:{},demerara:{},duckbill:{},firebird:{},fleabane:{},humanity:{},lavender:{},mahogany:{},monkfish:{},paraffin:{},peduncle:{},peroxide:{},plantain:{},rockfish:{},sandarac:{},sandwort:{},scammony:{},shamrock:{},skipjack:{},skullcap:{},snowbird:{},suckling:{},tubercle:{},alligator:{},angelfish:{},arachnoid:{},arrowroot:{},bearberry:{},blackfish:{},buckthorn:{},capitulum:{},carbonate:{},carnation:{},celluloid:{},chemistry:{},coriander:{},corrosive:{},crabapple:{},devilfish:{},emanation:{},groundnut:{},horseback:{},horsemint:{},injection:{},matchwood:{},mistletoe:{},offspring:{plural:"offspring"},pyrethrum:{},raspberry:{},razorback:{},satinwood:{},sheepskin:{},tomatillo:{},waxflower:{},whitefish:{},ammunition:{},bitterwood:{},blackberry:{},butterfish:{},chinquapin:{},coneflower:{},flagellate:{},flamboyant:{},fledgeling:{},insulation:{},peppermint:{},receptacle:{},strawberry:{},watercress:{},chittamwood:{},everlasting:{},fomentation:{},helleborine:{},honeysuckle:{},horseradish:{},huckleberry:{},salmonberry:{},shittimwood:{},strawflower:{},ultramarine:{},whitethroat:{},wintergreen:{},helmetflower:{},impregnation:{},quintessence:{},sternutatory:{},thimbleberry:{},contamination:{},extravasation:{},leatherjacket:{},pulverisation:{},pulverization:{},tortoiseshell:{},ti:{},ala:{},asp:{},eel:{},elm:{},fir:{},gar:{},neb:{},nit:{},oak:{},oat:{},sol:{},tom:{},yew:{},agar:{},akee:{},anil:{},atom:{},balm:{},bast:{},beet:{},boar:{},bole:{},bran:{},brit:{},cere:{},cero:{},chow:{},coho:{},dahl:{},dill:{},flax:{},foal:{},glop:{},gnat:{},hake:{},herb:{},hoar:{},homo:{},kaki:{},kino:{},leek:{},loin:{},mite:{},musk:{},parr:{},pear:{},poon:{},puka:{},rhea:{},saki:{},seta:{},shad:{},silt:{},slag:{},soda:{},soma:{},soot:{},soya:{},talc:{},teak:{},tufa:{},unai:{},unau:{},whey:{},woad:{},wort:{},yolk:{},zinc:{},abaca:{},alder:{},alula:{},amino:{},anise:{},apple:{},aroid:{},aster:{},balsa:{},basil:{},beech:{},betel:{},biddy:{},billy:{},biped:{},booby:{},britt:{},bruin:{},cairn:{},capon:{},caulk:{},chard:{},chess:{},chick:{},cisco:{},cohoe:{},comma:{},croup:{},cumin:{},dross:{},elver:{},epoxy:{},ergot:{},falls:{},flint:{},fossa:{},genip:{},grout:{},grume:{},henna:{},hilum:{},humus:{},hydra:{},icaco:{},ilama:{},imago:{},ivory:{},kapok:{},kenaf:{},lapin:{},larch:{},lilac:{},lotus:{},luffa:{},mahoe:{},maize:{},mamey:{},mango:{},manna:{},melon:{},moong:{},naiad:{},nanny:{},nopal:{},orris:{},osier:{},otter:{},ovary:{},ovule:{},pacer:{},panda:{},papaw:{},piggy:{},pilus:{},pinna:{},pixie:{},polyp:{},potto:{},putty:{},quira:{},robin:{},roble:{},rosin:{},scrod:{},sepia:{},sisal:{},slime:{},sorus:{},sprat:{},squid:{},stoma:{},sumac:{},swede:{},theca:{},thyme:{},trout:{plural:"trout"},tunny:{},vapor:{},velum:{},venom:{},vinyl:{},whelp:{},yeast:{},acetum:{},acinus:{},acumen:{},adduct:{},agaric:{},alkali:{},almond:{},anuran:{},archil:{},argent:{},balata:{},bamboo:{},bantam:{},barley:{},basset:{},beluga:{},bennet:{},bluing:{},bonduc:{},borage:{},capsid:{},cashew:{},cassia:{},caudex:{},celery:{},chives:{},cilium:{},citron:{},cobnut:{},cocker:{},cosmos:{},cowage:{},croton:{},cupule:{},cushaw:{},darter:{},dentin:{},dobson:{},dodder:{},donkey:{},durian:{},embryo:{},endive:{},ermine:{},falcon:{},feijoa:{},feline:{},fisher:{},fucoid:{},gadfly:{},garlic:{},glycol:{},hackle:{},haunch:{},herpes:{},hyssop:{},kaffir:{},kitten:{},lichee:{},limpet:{},linden:{},linnet:{},litchi:{},loofah:{},loquat:{},lovage:{},lupine:{},madder:{},maguey:{},manure:{},marang:{},mescal:{},mocker:{},mombin:{},mucoid:{},mudcat:{},munggo:{},murine:{},mussel:{},myrtle:{},nipper:{},nutmeg:{},obeche:{},orchil:{},orchis:{},oriole:{},padauk:{},paigle:{},papaya:{},parget:{},pasang:{},peewee:{},peewit:{},phenol:{},plaice:{},pomelo:{},poplar:{},possum:{},potato:{},pothos:{},pouter:{},puffer:{},pullet:{},pumice:{},pyrene:{},quahog:{},quartz:{},quince:{},rachis:{},raffia:{},ratter:{},relict:{},sabicu:{},saline:{},sapote:{},saurel:{},schrod:{},senega:{},septum:{},setter:{},sierra:{},simian:{},sludge:{},solder:{},spirea:{},stevia:{},sulfur:{},thrift:{},toetoe:{},tomato:{},tophus:{},triton:{},tupelo:{},turbot:{},turnip:{},vapour:{},vellum:{},wapiti:{},wasabi:{},acerola:{},actinon:{},aculeus:{},adamant:{},albumen:{},alewife:{},alfalfa:{},amboyna:{},anchovy:{},anemone:{},anionic:{},annelid:{},annulus:{},antacid:{},antlion:{},arsenic:{},aurochs:{},babbitt:{},barilla:{},beeswax:{},bimetal:{},biomass:{},bloomer:{},blotter:{},bluefin:{},blueing:{},boneset:{},boxwood:{},bracken:{},brocket:{},bromide:{},buckeye:{},bugbane:{},bugloss:{},bullock:{},bulrush:{},buzzard:{},cackler:{},cacodyl:{},caliche:{},calycle:{},cambium:{},capulin:{},caraway:{},cardoon:{},catbird:{},catechu:{},celtuce:{},ceriman:{},chalaza:{},chamois:{},chervil:{},chigger:{},citrate:{},cocoyam:{},codfish:{},comfrey:{},compost:{},cowslip:{},crappie:{},crawdad:{},crinoid:{},cyanide:{},cypress:{},dabbler:{},denizen:{},diploid:{},dogfish:{},dogwood:{},echidna:{},eelpout:{},enation:{},fallout:{},ferrite:{},fetlock:{},filaria:{},filbert:{},firebug:{},firefly:{},frijole:{},fuchsia:{},gamboge:{},ginseng:{},girasol:{},glutton:{},gobbler:{},grackle:{},grampus:{},granite:{},grizzly:{},grouper:{},grunter:{},gudgeon:{},haddock:{},halibut:{},haploid:{},haricot:{},heather:{},hepatic:{},herring:{},hickory:{},hogfish:{},honesty:{},hyaline:{},ignitor:{},inducer:{},jackass:{},jewfish:{},jonquil:{},kestrel:{},kingcup:{},kumquat:{},lactate:{},langsat:{},lanolin:{},lingcod:{},lobster:{},logwood:{},mahagua:{},majagua:{},malacca:{},mammoth:{},marabou:{},marasca:{},menthol:{},mercury:{},monarch:{},moneran:{},mongrel:{},moorhen:{},morello:{},muskrat:{},nervure:{},nitrate:{},octopus:{},oldwife:{},opossum:{},oregano:{},ostrich:{},oxheart:{},parsley:{},peacock:{},pigfish:{},pimento:{},piranha:{},plumcot:{},pollack:{},pollock:{},pompano:{},popcorn:{},poultry:{},pricket:{},puccoon:{},pulasan:{},pyrogen:{},quahaug:{},quassia:{},quetzal:{},raccoon:{},ragweed:{},ragwort:{},rattler:{},redbird:{},redpoll:{},redtail:{},reducer:{},redwing:{},remover:{},residue:{},retinal:{},rhubarb:{},rosebud:{},rostrum:{},satsuma:{},saurian:{},sequoia:{},seriema:{},skylark:{},sockeye:{},soursop:{},sparrow:{},spinach:{},spiraea:{},stentor:{},steroid:{},stubble:{},sulfate:{},sulphur:{},tangelo:{},taproot:{},tarweed:{},tarwood:{},tattler:{},taurine:{},teargas:{},timothy:{},tobacco:{},topknot:{},tortrix:{},trotter:{},varmint:{},verdure:{},viceroy:{},vinegar:{},viscose:{},vulture:{},walleye:{},waratah:{},warbler:{},waxwork:{},whooper:{},wilding:{},witloof:{},wryneck:{},abradant:{},absinthe:{},acceptor:{},actinoid:{},adhesive:{},adjutant:{},ageratum:{},agueweed:{},albacore:{},amarelle:{},amethyst:{},ammoniac:{},argonaut:{},armyworm:{},auricula:{},balancer:{},baldpate:{},barnacle:{},basswood:{},bayberry:{},bearskin:{},beetroot:{},birdlime:{},blackfly:{},blacktop:{},bluebird:{},bluefish:{},boarfish:{},bocconia:{},boxberry:{},brisling:{},broccoli:{},buckskin:{},bullhead:{},bullrush:{},canistel:{},capuchin:{},carangid:{},carbonyl:{},carboxyl:{},cardamom:{},cardamon:{},carinate:{},carnauba:{},carotene:{},cashmere:{},catalyst:{},catchfly:{},celeriac:{},cetacean:{},chimaera:{},chloride:{},cilantro:{},cinchona:{},citrange:{},cockspur:{},conodont:{},costmary:{},cowberry:{},cucumber:{},deadwood:{},detritus:{},dewberry:{},dilution:{},dolomite:{},duckling:{},ectozoan:{},eelgrass:{},effluent:{},eggplant:{},emulsion:{},estragon:{},filtrate:{},fireweed:{},flathead:{},flooring:{},forelock:{},galangal:{},garbanzo:{},grayback:{},guaiacum:{},hardtack:{},harebell:{},hawkweed:{},hazelnut:{},hedgehog:{},hepatica:{},hookworm:{},hornwort:{},horsefly:{},hyacinth:{},impurity:{},iodoform:{},jalapeno:{},jamberry:{},japonica:{},keurboom:{},kindling:{},kingwood:{},kinkajou:{},kohlrabi:{},labdanum:{},lambskin:{},locoweed:{},lovebird:{},magnolia:{},mahimahi:{},mandrake:{},margarin:{},marjoram:{},medusoid:{},mephitis:{},migrator:{},molecule:{},moonfish:{},mucilage:{},mulberry:{},nestling:{},omnivore:{},ovenbird:{},pandanus:{},pickerel:{},pilchard:{},pimiento:{},pitahaya:{},placenta:{},plumbago:{},predator:{},ptomaine:{},puffball:{},pulassan:{},purebred:{},pyrectic:{},quandang:{},quickset:{},rambotan:{},rambutan:{},redberry:{},redstart:{},reedbird:{},ricebird:{},richweed:{},ringdove:{},rockrose:{},rosefish:{},rosemary:{},rosewood:{},ruminant:{},rutabaga:{},sailfish:{},salsilla:{},saltwort:{},sandfish:{},scallion:{},seahorse:{},sealskin:{},sewerage:{},shoveler:{},siderite:{},silkworm:{},sparling:{},squealer:{},squirrel:{},stearate:{},stinkpot:{},superbug:{},surffish:{},sweetsop:{},tamarind:{},tarragon:{},teaberry:{},thresher:{},throstle:{},tilefish:{},tomentum:{},toxicant:{},turmeric:{},ungulate:{},univalve:{},urochord:{},vesicant:{},warragal:{},warrigal:{},watchdog:{},waxberry:{},weakfish:{},wolffish:{},woodbine:{},woodruff:{},wormcast:{},wriggler:{},zucchini:{},absorbent:{},adsorbate:{},adsorbent:{},albatross:{},almandine:{},andromeda:{},antiknock:{},apophysis:{},archangel:{},arsenical:{},artichoke:{},asparagus:{},aubergine:{},bacteroid:{},blackbird:{},blindworm:{},bluegrass:{},bluepoint:{},broadtail:{},brooklime:{},brookweed:{},brushwood:{},buckwheat:{},bugleweed:{},buteonine:{},butternut:{},caecilian:{},calyculus:{},candlenut:{},cantaloup:{},carambola:{},carbonado:{},carbuncle:{},cardboard:{},carnivore:{},catamount:{},celandine:{},chameleon:{},chatterer:{},chelonian:{},cherimoya:{},chickweed:{},chlamydia:{},clamshell:{},clapboard:{},coachwhip:{},cochineal:{},cocklebur:{},cocozelle:{},coltsfoot:{},commensal:{},courgette:{},crackling:{},cupflower:{},cyanamide:{},digestive:{},digitalis:{},driftfish:{},ecrevisse:{},ectoplasm:{},eiderdown:{},ephemeral:{},eutherian:{},evergreen:{},excretion:{},exudation:{},fenugreek:{},firebrand:{},firestone:{},flagellum:{},frostweed:{},funiculus:{},gladiolus:{},glasswort:{},goldeneye:{},goldfinch:{},grapevine:{},grenadier:{},hackberry:{},hamadryad:{},heartleaf:{},hellebore:{},hollyhock:{},horehound:{},horsebean:{},horsehair:{},horseweed:{},hortensia:{},hydroxide:{},jackfruit:{},jacksnipe:{},jellyfish:{},juneberry:{},lancewood:{},langouste:{},leavening:{},lemonwood:{},mammalian:{},manzanita:{},maravilla:{},marihuana:{},marijuana:{},moosewood:{},muscadine:{},muskmelon:{},nakedwood:{},nectarine:{},nighthawk:{},pasturage:{},patchouli:{},patchouly:{},pelecypod:{},pellitory:{},peregrine:{},peristome:{},persimmon:{},phosphate:{},pimpernel:{},pinchbeck:{},pineapple:{},pistachio:{},polyploid:{},probiotic:{},proboscis:{},protozoan:{},pureblood:{},quadruped:{},rauwolfia:{},recycling:{},reptilian:{},reticulum:{},rockcress:{},rootstock:{},rosinweed:{},sandpaper:{},sapodilla:{},sassafras:{},sheldrake:{},shingling:{},shoveller:{},siccative:{},sicklepod:{},snakeroot:{},snowflake:{},sourdough:{},spicebush:{},spirillum:{},stainless:{},stiffener:{},strangler:{},strawworm:{},sugarcane:{},swordfish:{},tamarindo:{},tarantula:{},topminnow:{},tulipwood:{},turquoise:{},twayblade:{},twinberry:{},wallpaper:{},whitebait:{},whiteface:{},wineberry:{},wolverine:{},workhorse:{},adulterant:{},amygdaloid:{},anopheline:{},aquamarine:{},belladonna:{},bellwether:{},bitterweed:{},blacksnake:{},blackthorn:{},bluebonnet:{},bluebottle:{},bottlenose:{},brachiopod:{},brazilwood:{},breadfruit:{},butterball:{},butterweed:{},candelilla:{},cantaloupe:{},catarrhine:{},cellulosic:{},chatterbox:{},chinaberry:{},cinquefoil:{},citronwood:{},clementine:{},condensate:{},copperhead:{},coralberry:{},cornflower:{},cottonweed:{},cottonwood:{},crossbreed:{},crustacean:{},deathwatch:{},demoiselle:{},dollarfish:{},elderberry:{},exhalation:{},feathertop:{},fetterbush:{},fiddlehead:{},flycatcher:{},fritillary:{},garambulla:{},goldenbush:{},gooseberry:{},grapefruit:{},jaboticaba:{},jackrabbit:{},ketembilla:{},kitembilla:{},lemongrass:{},littleneck:{},loganberry:{},loggerhead:{},mangosteen:{},marblewood:{},marguerite:{},massasauga:{},meerschaum:{},monoclonal:{},nasturtium:{},needlefish:{},nonstarter:{},ornamental:{},pacesetter:{},parenchyma:{},pennyroyal:{},pepperwort:{},plasmodium:{},princewood:{},propellant:{},propellent:{},pufferfish:{},pyrimidine:{},quercitron:{},restharrow:{},restrainer:{},ribbonfish:{},ribbonwood:{},rudderfish:{},sapphirine:{},scorzonera:{},sidewinder:{},silverbush:{},silverfish:{},silverweed:{},spiceberry:{},sticktight:{},sugarberry:{},superoxide:{},tarmacadam:{},turpentine:{},turtledove:{},velvetleaf:{},vertebrate:{},vesicatory:{},wandflower:{},watermelon:{},windowpane:{},witchgrass:{},yellowbird:{},yellowtail:{},yellowwood:{},adulterator:{},arthrospore:{},artiodactyl:{},bactericide:{},boysenberry:{},branchiopod:{},buffalofish:{},butcherbird:{},cauliflower:{},cherrystone:{},chittimwood:{},chokecherry:{},combustible:{},conspecific:{},digitigrade:{},dolphinfish:{},flameflower:{},gillyflower:{},groundberry:{},groundcover:{},heterocycle:{},honeyflower:{},insectivore:{},leatherleaf:{},leatherwood:{},lingonberry:{},liquidambar:{},loosestrife:{},muskellunge:{},plantigrade:{},platyrrhine:{},pomegranate:{},precipitant:{},prickleback:{},quicksilver:{},recombinant:{},refrigerant:{},shellflower:{},silversides:{},sleuthhound:{},swallowwort:{},unguiculate:{},waldmeister:{},archosaurian:{},distillation:{},heterocyclic:{},honeycreeper:{},instillation:{},invertebrate:{},nonsteroidal:{},placentation:{},sarsaparilla:{},serviceberry:{},squirrelfish:{},transudation:{},weatherboard:{},whortleberry:{},yellowhammer:{},branchiopodan:{},inflorescence:{},platyrrhinian:{},semiconductor:{},transactinide:{},vitrification:{},fructification:{},aa:{},ai:{},ani:{},auk:{},awn:{},bot:{},dak:{},daw:{},dew:{},doe:{},dug:{},eft:{},ern:{},ewe:{},gib:{},gnu:{},goo:{},ivy:{},jay:{},kea:{},kob:{},lac:{},lye:{},may:{},mei:{},moa:{},oca:{},ola:{},olm:{},pia:{},pug:{},teg:{},tup:{},acyl:{},agua:{},aloe:{},amyl:{},anoa:{},apar:{},aril:{},arui:{},atar:{},axil:{},barm:{},baya:{},bine:{},boll:{},bufo:{},buna:{},calx:{},cavy:{},chub:{},cleg:{},coco:{},colt:{},coot:{},corm:{},cows:{},craw:{},culm:{},cyme:{},dace:{},dalo:{},deer:{plural:"deer"},derv:{},dhak:{},dhal:{},dika:{},diol:{},disa:{},dita:{},dogy:{},doob:{},dopa:{},enol:{},erne:{},eyas:{},fern:{},fice:{},floc:{},fuji:{},gean:{},goby:{},guan:{},guar:{},guib:{},haem:{},halm:{},hart:{},heme:{},hogg:{},hops:{},hoya:{},ibex:{},ibis:{},inga:{},jird:{},jute:{},kali:{},kelp:{},kola:{},kudu:{},lily:{},lino:{},liza:{},loam:{},loir:{},lory:{},lynx:{},mako:{},mamo:{},mara:{},marl:{},merl:{},mica:{},milo:{},miro:{},mola:{},moss:{},munj:{},mutt:{},myna:{},nagi:{},napa:{},napu:{},neem:{},neon:{},olla:{},ombu:{},onyx:{},opah:{},opal:{},orca:{},oryx:{},paca:{},peat:{},peba:{},pika:{},pome:{},puku:{},puma:{},pupa:{},ragi:{},rimu:{},rudd:{},sago:{},salp:{},sang:{},sard:{},scut:{},sial:{},sika:{},sild:{},sima:{},skua:{},smew:{},sugi:{},tatu:{},teff:{},teju:{},tern:{},tipu:{},toad:{},tody:{},tolu:{},tuff:{},tung:{},urea:{},urus:{},vole:{},wasp:{},weka:{},blast:{},dinar:{},lapse:{},lurch:{},whirl:{},travel:{},capacity:{},encounter:{},conversion:{},separation:{},age:{},nip:{},now:{},halt:{},leap:{},mile:{},peak:{},peso:{},slam:{},term:{},wake:{},faint:{},scoop:{},surge:{},third:{},trick:{},bother:{},cackle:{},motion:{},chatter:{},reversal:{},elevation:{},experience:{},dab:{},pat:{},cube:{},howl:{},over:{},peep:{},span:{},cause:{},death:{},plump:{},plunk:{},poise:{},pulse:{},shame:{},spark:{},twang:{},wound:{},cipher:{},crunch:{},damage:{},fusion:{},period:{},racket:{},repeat:{},supply:{},wallow:{},wonder:{},dribble:{},failure:{},outrage:{},sparkle:{},backfire:{},campaign:{},delivery:{},increase:{},variance:{},explosion:{},correction:{},disturbance:{},translation:{},displacement:{},transposition:{},hum:{},mug:{},buzz:{},cord:{},dawn:{},fuss:{},hint:{},hiss:{},much:{},past:{},ping:{},rout:{},seek:{},tide:{},warp:{},birth:{},blend:{},crumb:{},delay:{},rupee:{},worst:{},climax:{},deluge:{},dirham:{},recoil:{},replay:{},rhythm:{},rising:{},descent:{},grumble:{},impulse:{},respite:{},scruple:{},triumph:{},addition:{},dogfight:{},eruption:{},occasion:{},progress:{},reprieve:{},shilling:{},stampede:{},accretion:{},induction:{},appearance:{},suggestion:{},circulation:{},irradiation:{},accommodation:{},precipitation:{},in:{},ebb:{},mil:{},zap:{},gush:{},honk:{},lull:{},plop:{},rave:{},ream:{},slap:{},then:{},zoom:{},fifth:{},final:{},gleam:{},reign:{},swash:{},throb:{},thump:{},tweet:{},wreck:{},wring:{},billow:{},breach:{},ending:{},fourth:{},gurgle:{},injury:{},nibble:{},parity:{},sunset:{},billion:{},history:{},instant:{},spatter:{},blackout:{},creation:{},decision:{},downhill:{},entrance:{},rational:{},trillion:{},hereafter:{},immersion:{},intrusion:{},millenary:{},remainder:{},saltation:{},adjustment:{},antecedent:{},dedication:{},deflection:{},impairment:{},limitation:{},outpouring:{},refinement:{},scattering:{},devastation:{},elaboration:{},fundamental:{},prohibition:{},retardation:{},interference:{},transmission:{},manifestation:{},scintillation:{},mi:{},kip:{},wee:{},yaw:{},bout:{},bray:{},doom:{},harm:{},haul:{},jolt:{},none:{},ooze:{},pity:{},sigh:{},surf:{},thaw:{},tour:{},alpha:{},carom:{},chunk:{},clink:{},colon:{},deuce:{},drama:{},glint:{},going:{},shtik:{},sixth:{},spurt:{},thrum:{},tinge:{},today:{},waltz:{},worth:{},bucket:{},egress:{},fathom:{},mutter:{},patter:{},picnic:{},quaver:{},ripple:{},rustle:{},shtick:{},sizzle:{},squawk:{},stride:{},tremor:{},whoosh:{},wobble:{},absence:{},allegro:{},andante:{},deficit:{},episode:{},heaving:{},raising:{},rebirth:{},roaring:{},rupture:{},screech:{},scrunch:{},seventh:{},success:{},sunrise:{},takeoff:{},trample:{},twinkle:{},cracking:{},deletion:{},incident:{},interval:{},isometry:{},overflow:{},rattling:{},skeleton:{},splatter:{},striking:{},twilight:{},upheaval:{},advantage:{},alignment:{},deflexion:{},diffusion:{},emergence:{},inflation:{},normality:{},remission:{},resultant:{},ruination:{},shakedown:{},vibration:{},yesterday:{},allegretto:{},conception:{},concoction:{},concretion:{},disruption:{},divergence:{},graduation:{},inflection:{},initiation:{},moderation:{},sprinkling:{},approaching:{},biquadratic:{},competition:{},compression:{},contraction:{},humiliation:{},permutation:{},constriction:{},ramification:{},accompaniment:{},embarrassment:{},mortification:{},rectification:{},coo:{},eve:{},gee:{},par:{},sea:{},sec:{},tot:{},won:{},yen:{},bash:{},beep:{},ding:{},dram:{},fete:{},gait:{},inch:{},lira:{},peal:{},pint:{},purr:{},rial:{},ting:{},toot:{},whiz:{},blare:{},bleat:{},brawl:{},cease:{},digit:{},dying:{},epoch:{},gravy:{},idyll:{},knell:{},metre:{},minim:{},ninth:{},plash:{},plonk:{},quake:{},quart:{},ravel:{},salvo:{},skirl:{},snore:{},spate:{},spirt:{},swish:{},tenth:{},unity:{},whack:{},whirr:{},years:{},ascent:{},bushel:{},curfew:{},drachm:{},eighth:{},enough:{},finale:{},fizzle:{},footer:{},gobble:{},jingle:{},marvel:{},myriad:{},octave:{},ravage:{},smudge:{},spritz:{},squeak:{},squeal:{},squish:{},swerve:{},tierce:{},usance:{},waxing:{},atrophy:{},banging:{},bending:{},blowout:{},centner:{},clangor:{},debacle:{},decimal:{},eclipse:{},glitter:{},kickoff:{},midterm:{},million:{},misfire:{},modulus:{},monsoon:{},ordinal:{},outflow:{},ringing:{},shimmer:{},sinking:{},smolder:{},torrent:{},twelfth:{},backwash:{},bouncing:{},downfall:{},dripping:{},drumbeat:{},eighties:{},eternity:{},exigency:{},footstep:{},furlough:{},gleaming:{},grinding:{},hardship:{},instance:{},invasion:{},majority:{},maturity:{},nineties:{},overtime:{},overture:{},pandemic:{},pounding:{},receding:{},recovery:{},rustling:{},scraping:{},sixtieth:{},smoulder:{},spoilage:{},spraying:{},tomorrow:{},touching:{},amplitude:{},ascension:{},athletics:{},avalanche:{},billionth:{},checkmate:{},clearance:{},collision:{},commotion:{},contagion:{},departure:{},fertility:{},formality:{},gestation:{},heartbeat:{},honeymoon:{},hundredth:{},interlude:{},irruption:{},lactation:{},millionth:{},multitude:{},onslaught:{},outgrowth:{},plurality:{},probation:{},pulsation:{},shrinkage:{},sixteenth:{},spreading:{},stalemate:{},throbbing:{},whistling:{},withering:{},affliction:{},alteration:{},betterment:{},dispersion:{},enervation:{},expiration:{},foreboding:{},incubation:{},incumbency:{},inevitable:{},irrational:{},jubilation:{},levitation:{},millennium:{plural:"millennia"},procession:{},repetition:{},revolution:{},sabbatical:{},solubility:{},subsidence:{},thousandth:{},undulation:{},visitation:{},accelerando:{},catastrophe:{},celebration:{},coincidence:{},consequence:{},continuance:{},deformation:{},dislocation:{},dissipation:{},expansivity:{},fluctuation:{},gravitation:{},oscillation:{},preliminary:{},punctuation:{},sufficiency:{},acceleration:{},augmentation:{},championship:{},commencement:{},conservation:{},deceleration:{},degeneration:{},encroachment:{},interlocking:{},reflectivity:{},consolidation:{},hundredweight:{},magnetisation:{},magnetization:{},regurgitation:{},sheepshearing:{},transmutation:{},conglomeration:{},materialisation:{},optic:{},patty:{},prune:{},saute:{},scalp:{},sinus:{},swill:{},bubbly:{},burgoo:{},choler:{},claret:{},cortex:{},crotch:{},drivel:{},frappe:{},hiatus:{},kosher:{},legume:{},macula:{},phlegm:{},pickle:{},stemma:{},thenar:{},tiptoe:{},adrenal:{},anatomy:{},confect:{},freckle:{},jugular:{},knuckle:{},mastoid:{},medulla:{},pudding:{},takeout:{},thyroid:{},tonsure:{},wassail:{},anterior:{},coloring:{},julienne:{},libation:{},rhomboid:{},sandwich:{},takeaway:{},appendage:{},chocolate:{},colouring:{},endocrine:{},hamstring:{},moonshine:{},permanent:{},recessive:{},turbinate:{},confection:{},hemisphere:{},ingredient:{},spatchcock:{},sweetening:{},convolution:{},pneumogastric:{},os:{},cos:{},cud:{},sup:{},caul:{},chaw:{},chin:{},chou:{},curd:{},cyst:{},fizz:{},jowl:{},mane:{},milt:{},perm:{},snot:{},sorb:{},sura:{},taco:{},booze:{},broth:{},caput:{},chili:{},cocoa:{},costa:{},cress:{},dough:{},eater:{},fanny:{},fondu:{},hyoid:{},loins:{},lolly:{},lumen:{},mamma:{},mummy:{},pasta:{},plasm:{},porgy:{},puree:{},quaff:{},quark:{},sinew:{},thigh:{},tripe:{},tummy:{},areola:{},banana:{},booger:{},bowleg:{},brunch:{},carpal:{},cervix:{},citrus:{},comfit:{},dactyl:{},dorsum:{},edible:{},flitch:{},fondue:{},fornix:{},gammon:{},herbal:{},lambda:{},malted:{},marcel:{},millet:{},monggo:{},noodle:{},paring:{},pastry:{},pelvis:{},simnel:{},spleen:{},tarsal:{},tensor:{},tipple:{},waffle:{},wonton:{},abdomen:{},adenoid:{},auricle:{},biscuit:{},brownie:{},clabber:{},criollo:{},croaker:{},cubitus:{},deltoid:{},dentine:{},dietary:{},eyeball:{},fistula:{},forearm:{},fritter:{},gherkin:{},haircut:{},headful:{},hyaloid:{},iceberg:{},isthmus:{},kneecap:{},lacteal:{},lasagna:{},lasagne:{},lozenge:{},marmite:{},midriff:{},oatmeal:{},ocellus:{},pageboy:{},paprika:{},pathway:{},pottage:{},prepuce:{},pumpkin:{},ramekin:{},ratafia:{},roulade:{},sausage:{},seltzer:{},serving:{},sidecar:{},slobber:{},sorghum:{},stirrup:{},sultana:{},teacake:{},timbale:{},toenail:{},topping:{},tostada:{},trachea:{},treacle:{},twister:{},vintage:{},abducent:{},abductor:{},afferent:{},alveolus:{},appendix:{plural:"appendices"},astragal:{},bicuspid:{},blowfish:{},blowhole:{},bouffant:{},capitate:{},chowchow:{},cobblers:{},cocktail:{},coquille:{},couscous:{},doughboy:{},doughnut:{},dumpling:{},efferent:{},eminence:{},exocrine:{},fascicle:{},flatfish:{},flatfoot:{},flummery:{},forehead:{},foreskin:{},hairline:{},honeydew:{},licorice:{},ligament:{},lollipop:{},macaroni:{},mackerel:{},marinade:{},membrane:{},monstera:{},mouthful:{},muscatel:{},pheasant:{},physique:{},potation:{},prostate:{},ramequin:{},receptor:{},sillabub:{},sinusoid:{},smoothie:{},specimen:{},streusel:{},stuffing:{},syllabub:{},teardrop:{},venation:{},windfall:{},abdominal:{},apparatus:{},blueberry:{},casserole:{},corpuscle:{},cranberry:{},demitasse:{},dentition:{},drinkable:{},drumstick:{},epiphysis:{},flageolet:{},fricassee:{},hamburger:{},labyrinth:{},lifeblood:{},lineament:{},liquorice:{},mastoidal:{},maxillary:{},navicular:{},pituitary:{},pompadour:{},provender:{},purulence:{},shellfish:{},spaghetti:{},spareribs:{},splayfoot:{},spoilable:{},sundowner:{},sweetener:{},trapezium:{},trapezoid:{},umbilical:{},ventricle:{},vestibule:{},zygomatic:{},applesauce:{},autoplasty:{},blackheart:{},breadstuff:{},cheesecake:{},comestible:{},gastronomy:{},hotchpotch:{},interstice:{},jawbreaker:{},kitambilla:{},maraschino:{},metacarpal:{},metatarsal:{},passageway:{},perishable:{},salmagundi:{},shortening:{},articulator:{},excrescence:{},grasshopper:{},griddlecake:{},intercostal:{},longanberry:{},nourishment:{},screwdriver:{},smorgasbord:{},spindlelegs:{},checkerberry:{},perspiration:{},spindleshanks:{},parasympathetic:{},ab:{},ade:{},ale:{},bap:{},bun:{},jak:{},lat:{},lox:{},pes:{},pie:{},poi:{},pud:{},pus:{},tum:{},vas:{},veg:{},anus:{},arak:{},axon:{},baba:{},bile:{},bleb:{},bleu:{},bock:{},bosc:{},choc:{},clit:{},cola:{},coxa:{},crus:{},cuke:{},duff:{},dura:{},edda:{},eggs:{},fist:{},flab:{},flan:{},fugu:{},genu:{},ghee:{},glia:{},grog:{},isaw:{},java:{},kava:{},marc:{},mayo:{},mead:{},miso:{},mons:{},naan:{},nape:{},nipa:{},oleo:{},orzo:{},ouzo:{},ovum:{},pecs:{},pita:{},pone:{},pons:{},porc:{},rete:{},rima:{},rind:{},roux:{},ruga:{},rusk:{},slaw:{},sops:{},suet:{},tofu:{},ugli:{},ulna:{},umbo:{},uvea:{},veal:{},veau:{},vena:{},vino:{},womb:{},ziti:{},zona:{},ackee:{},adobo:{},aioli:{},anjou:{},ankle:{},annon:{},aorta:{},arcus:{},aspic:{},atole:{},axone:{},babka:{},bacon:{},bagel:{},bialy:{},bigos:{},bitok:{},blanc:{},blini:{},bliny:{},boeuf:{},borsh:{},bowel:{},bursa:{},butty:{},cauda:{},cavum:{},cecum:{},celom:{},chips:{},chyle:{},cider:{},congo:{},copra:{},cornu:{},cuppa:{},cutis:{},cyder:{},cytol:{},decaf:{},donut:{},facia:{},femur:{},filum:{},flews:{},fovea:{},fries:{},gigot:{},gland:{},glans:{},gleet:{},glogg:{},glute:{},gonad:{},goody:{},grist:{},grits:{},gruel:{},gyrus:{},hilus:{},hoagy:{},hooch:{},hooks:{},hymen:{},hyson:{},ileum:{},ilium:{},incus:{},inion:{},jello:{},julep:{},kabob:{},kasha:{},kebab:{},knish:{},kumis:{},kvass:{},lansa:{},latke:{},latte:{},lichi:{},limpa:{},lymph:{},macon:{},manus:{},matzo:{},mucus:{},nacho:{},naris:{},nates:{},negus:{},offal:{},ootid:{},pekoe:{},penis:{},penne:{},perry:{},pesto:{},pilaf:{},pinky:{},pizza:{},plica:{},porta:{},pruno:{},psoas:{},pubis:{},quiff:{},raita:{},ramus:{},raphe:{},salmi:{},salsa:{},savoy:{},sebum:{},serum:{},sirup:{},skull:{},sperm:{},steak:{},sudor:{},sushi:{},taffy:{},tamal:{},tater:{},teeth:{},teres:{},tibia:{},titty:{},toddy:{},toffy:{},torso:{},torte:{},tress:{},uvula:{},vagus:{},viand:{},vodka:{},vomer:{},vulva:{},wrist:{},adnexa:{},afters:{},agnail:{},ananas:{},anlage:{},annexa:{},annona:{},antrum:{},armpit:{},arrack:{},axilla:{},baguet:{},beigel:{},biceps:{},bisque:{},blintz:{},bonbon:{},borsch:{},brazil:{},bregma:{},bulgur:{},burger:{},cachou:{},caecum:{},canape:{},canola:{},cardia:{},carina:{},carpus:{},casaba:{},catsup:{},caviar:{},chevre:{},chiasm:{},chilli:{},choana:{},coccyx:{},coelom:{},comedo:{},concha:{},confit:{},congou:{},corium:{},corpse:{},cupper:{},cuspid:{},cutlet:{},damson:{},danish:{},dermis:{},dewlap:{},dolmas:{},eclair:{},eggnog:{},eschar:{},eyelid:{},farina:{},fauces:{},fibula:{},finnan:{},flexor:{},fundus:{},gateau:{},geneva:{},giblet:{},glossa:{},gluten:{},goatee:{},gobbet:{},gonion:{},goober:{},graham:{},grappa:{},groats:{},gulyas:{},haggis:{},hairdo:{},hallah:{},hallux:{},hamate:{},haslet:{},hoagie:{},hominy:{},hommos:{},hootch:{},hotpot:{},huitre:{},hummus:{},inguen:{},intima:{},jambon:{},jugale:{},jumbal:{},karyon:{},kencur:{},kidney:{},kipper:{},kirsch:{},kishke:{},korlan:{},kummel:{},labium:{},lamina:{},lanseh:{},lanugo:{},larynx:{},lekvar:{},limbus:{},lingua:{},lobule:{},lochia:{},locule:{},lunule:{},matzoh:{},meatus:{},meninx:{},milium:{},mohawk:{},mouton:{},mucosa:{},muesli:{},muffin:{},murphy:{},mutton:{},nasion:{},nervus:{},neuron:{},nougat:{},oculus:{},omelet:{},onyxis:{},oocyte:{},oolong:{},operon:{},organs:{},paczki:{},paella:{},palate:{},paries:{},pastis:{},paunch:{},pectus:{},phyllo:{},pilaff:{},pinkie:{},pinole:{},pirogi:{},pleura:{},plexus:{},pollex:{},polony:{},posset:{},potage:{},poteen:{},potion:{},potpie:{},poulet:{},premix:{},pulque:{},purloo:{},quiche:{},rectum:{},rectus:{},repast:{},retina:{},rhaphe:{},ribier:{},rickey:{},rotgut:{},sacrum:{},salami:{},saliva:{},samosa:{},sapota:{},scampi:{},scampo:{},sclera:{},scruff:{},seckel:{},serosa:{},shandy:{},sherry:{},silage:{},skilly:{},smegma:{},soleus:{},sorbet:{},sputum:{},stapes:{},stodge:{},succus:{},sulcus:{},sundae:{},sutura:{},tahini:{},tamale:{},tarsus:{},tendon:{},testis:{},thymus:{},tidbit:{},tiffin:{},tisane:{},titbit:{},toffee:{},tonsil:{},tragus:{},troche:{},tubule:{},tunica:{},unguis:{},ureter:{},uterus:{},vagina:{},veggie:{},venula:{},venule:{},vermis:{},vesica:{},viscus:{},vitals:{},waters:{},whisky:{},wiener:{},yogurt:{},zaatar:{},zonula:{},zonule:{},zygoma:{},zygote:{},absinth:{},akvavit:{},aniseed:{},aquavit:{},arteria:{},ashcake:{},baklava:{},bannock:{},beignet:{},keen:{},rage:{},wish:{},aside:{},chafe:{},gloss:{},tense:{},whole:{},worry:{},effect:{},reject:{},riddle:{},snatch:{},speech:{},closure:{},collect:{},romance:{},flourish:{},classical:{},influence:{},substance:{},reflection:{},inclination:{},recognition:{},dot:{},nod:{},blur:{},itch:{},slur:{},solo:{},wink:{},abuse:{},acute:{},alert:{},angle:{},bluff:{},cheer:{},honor:{},humor:{},lyric:{},snarl:{},tally:{},accent:{},degree:{},detail:{},indent:{},matter:{},patent:{},rubric:{},thrill:{},abandon:{},bluster:{},concern:{},concord:{},formula:{plural:"formulae"},imprint:{},nominal:{},quality:{},reading:{},sputter:{},torture:{},wrinkle:{},contrast:{},estimate:{},harmonic:{},judgment:{},reaction:{},sanction:{},singular:{},straddle:{},construct:{},judgement:{},reflexion:{},rendering:{},universal:{},acceptance:{},discipline:{},irritation:{},regulation:{},relaxation:{},submission:{},application:{},replication:{},construction:{},introduction:{},presentation:{},cant:{},code:{},joke:{},pain:{},stab:{},trot:{},will:{},blame:{},brief:{},dodge:{},fancy:{},glide:{},grasp:{},guess:{},quote:{},scent:{},slant:{},snort:{},swoop:{},theme:{},trial:{},vocal:{},accord:{},affect:{},cancel:{},debate:{},desire:{},heroic:{},murmur:{},phrase:{},resume:{},scream:{},serial:{},tangle:{},closing:{},dissent:{},drawing:{},example:{},exhibit:{},fatigue:{},feeling:{},mention:{},partial:{},posture:{},protest:{},regress:{},telling:{},welcome:{},absolute:{},analysis:{plural:"analyses"},distress:{},pastoral:{},platform:{},temporal:{},agreement:{},attention:{},beginning:{},closeness:{},connexion:{},dimension:{},discourse:{},lightness:{},principle:{},surrender:{},assignment:{},coordinate:{},involution:{},abstraction:{},arrangement:{},conjunction:{},declaration:{},penetration:{},proposition:{},realisation:{},realization:{},condensation:{},consideration:{},no:{},cue:{},fun:{},rub:{},bias:{},gift:{},hoot:{},jazz:{},oral:{},snub:{},text:{},tune:{},urge:{},coast:{},craze:{},daily:{},debut:{},dowse:{},funny:{},logic:{},mercy:{},peace:{},rerun:{},samba:{},slang:{},taboo:{},verse:{},whine:{},words:{},aspect:{},babble:{},canker:{},choice:{},clamor:{},denial:{},device:{},esteem:{},format:{},lament:{},manual:{},menace:{},normal:{},pardon:{},regret:{},skinny:{},sorrow:{},tickle:{},twinge:{},vision:{},warmth:{},caution:{},charter:{},conceit:{},cunning:{},delight:{},dictate:{},discord:{},finance:{},harmony:{},keynote:{},knowing:{},leaning:{},lecture:{},mistake:{},musical:{},offense:{},palaver:{},preempt:{},purpose:{},pyrrhic:{},realism:{},sharing:{},texture:{},worship:{},writing:{},aspirate:{},biweekly:{},blessing:{},citation:{},despatch:{},dullness:{},feminine:{},flatness:{},geminate:{},manifest:{},personal:{},pleasure:{},politics:{},singsong:{},yielding:{},agitation:{},attrition:{},bimonthly:{},broadcast:{},confusion:{},deviation:{},disregard:{},education:{},faintness:{},heaviness:{},imitation:{},indenture:{},interview:{},isolation:{},isometric:{},minuscule:{},portrayal:{},predicate:{},provision:{},screaming:{},signature:{},spiritual:{},throwaway:{},tightness:{},accounting:{},aggression:{},assumption:{},attraction:{},commercial:{},compromise:{},confession:{},confidence:{},conformity:{},conveyance:{},detachment:{},difference:{},discretion:{},imperative:{},mellowness:{},modulation:{},tenderness:{},uneasiness:{},awkwardness:{},discernment:{},elimination:{},endorsement:{},examination:{},fabrication:{},familiarity:{},implication:{},indorsement:{},involvement:{},observation:{},obstruction:{},performance:{},requisition:{},sensitivity:{},testimonial:{},appreciation:{},articulation:{},condemnation:{},confirmation:{},deliberation:{},intervention:{},satisfaction:{},confrontation:{},decomposition:{},determination:{},reinforcement:{},understanding:{},characteristic:{},correspondence:{},sophistication:{},transformation:{},rationalisation:{},rationalization:{},dub:{},fog:{},bold:{},buoy:{},dare:{},daze:{},envy:{},gape:{},okay:{},plus:{},rasp:{},rime:{},role:{},tabu:{},yell:{},above:{},affix:{},agape:{},chord:{},croak:{},doubt:{},email:{},essay:{},folly:{},idiom:{},laugh:{},modal:{},panic:{},posit:{},rhyme:{},rider:{},rumba:{},scare:{},scorn:{},sneer:{},trill:{},truth:{},wince:{},adagio:{},binary:{},daring:{},defeat:{},dismay:{},docket:{},filing:{},flavor:{},giving:{},gospel:{},lesson:{},median:{},neuter:{},notion:{},parody:{},parole:{},plight:{},rebuff:{},rhumba:{},sample:{},shiver:{},solace:{},trance:{},unseen:{},vanity:{},vector:{},amnesty:{},anguish:{},arousal:{},bucolic:{},caption:{},catalog:{},contour:{},descant:{},disdain:{},dispute:{},fantasy:{},flavour:{},glimpse:{},insight:{},languor:{},licence:{},marking:{},overbid:{},prelude:{},probate:{},purport:{},pursuit:{},reality:{},receipt:{},recital:{},riposte:{},splurge:{},sticker:{},summons:{},wrangle:{},approval:{},buoyancy:{},converse:{},coolness:{},covenant:{},crotchet:{},devotion:{},dialogue:{},emphasis:{},esthetic:{},excision:{},fairness:{},fixation:{},forecast:{},hieratic:{},identity:{},illusion:{},integral:{},monotone:{},offering:{},paradigm:{},premiere:{},printing:{},referent:{},rescript:{},research:{},rhetoric:{},schedule:{},skimming:{},sleeping:{},speaking:{},splutter:{},streamer:{},tendency:{},topology:{},vexation:{},wildness:{},adjective:{},aesthetic:{},assurance:{},burlesque:{},catalogue:{},correlate:{},detection:{},discovery:{},dismissal:{},exclusion:{},exclusive:{},expansion:{},impromptu:{},inaugural:{},indicator:{},intensive:{},interdict:{},largeness:{},masculine:{},paragraph:{},partitive:{},pragmatic:{},prevision:{},quarterly:{},quotation:{},readiness:{},rendition:{},reverence:{},roundness:{},safeguard:{},suspicion:{},sweetness:{},thickness:{},trademark:{},antagonism:{},aspiration:{},bitterness:{},coarseness:{},collection:{},conjecture:{},deposition:{},estimation:{},excitement:{},gloominess:{},impossible:{},incitement:{},invocation:{},inwardness:{},literature:{},morphology:{},narrowness:{},nominative:{},observance:{},possessive:{},postmortem:{},preemption:{},preference:{},profession:{},profundity:{},recitation:{},redundancy:{},abnormality:{},acquisition:{},affirmation:{},affirmative:{},alternative:{},bombardment:{},commutation:{},concurrence:{},convergence:{},countenance:{},disposition:{},distinction:{},distraction:{},enlargement:{},expectation:{},fingerprint:{},indentation:{},instruction:{},nationalism:{},possibility:{},presumption:{},publication:{},spectacular:{},speculation:{},substantive:{},superlative:{},unconscious:{},unitisation:{},unitization:{},anticipation:{},apprehension:{},circumstance:{},continuation:{},coordination:{},countercheck:{},distribution:{},hieroglyphic:{},illustration:{},intimidation:{},misdirection:{},overestimate:{},precondition:{},renunciation:{},approximation:{},authorisation:{},authorization:{},certification:{},falsification:{},interrogative:{},nonconformity:{},reduplication:{},sensitiveness:{},sequestration:{},superposition:{},underestimate:{},capitalisation:{},capitalization:{},generalisation:{},generalization:{},perceptiveness:{},recapitulation:{},sensationalism:{},awe:{},bop:{},ego:{},hex:{},jot:{},lit:{},nub:{},vow:{},beta:{},brag:{},clue:{},cull:{},elan:{},epic:{},funk:{},fury:{},gibe:{},hymn:{},jibe:{},leer:{},lust:{},mood:{},oath:{},pang:{},plea:{},quip:{},rant:{},riff:{},visa:{},zeal:{},zest:{},alibi:{},badge:{},basis:{plural:"bases"},bravo:{},carol:{},chant:{},chaos:{},conga:{},delta:{},demur:{},dread:{},fable:{},flair:{},fugue:{},given:{},gloat:{},gloom:{},hunch:{},infix:{},irony:{},largo:{},least:{},libel:{},magic:{},moral:{},polka:{},reply:{},sally:{},spiel:{},spook:{},stymy:{},tango:{},usage:{},velar:{},vigil:{},whoop:{},affair:{},airing:{},ardour:{},ballot:{},bathos:{},beauty:{},bellow:{},bowing:{},curtsy:{},deceit:{},dental:{},dialog:{},gambit:{},gibber:{},grudge:{},halloo:{},insult:{},intent:{},italic:{},kowtow:{},labial:{},latest:{},manner:{},mumble:{},naming:{},outcry:{},pathos:{},piffle:{},plural:{},policy:{},praise:{},raving:{},rehash:{},revise:{},scalar:{},scroll:{},seeing:{},shriek:{},sonnet:{},stymie:{},tattle:{},theory:{},tingle:{},tumult:{},upbeat:{},urging:{},wangle:{},weekly:{},wheeze:{},yearly:{},acclaim:{},acidity:{},airmail:{},analogy:{},apology:{},barrage:{},barrier:{},bidding:{},bonding:{},buildup:{},cadence:{},cartoon:{},censure:{},clutter:{},concert:{},cruelty:{},despair:{},disgust:{},dodging:{},earmark:{},embargo:{},enquiry:{},erasure:{},eristic:{},fluency:{},gradual:{},gravity:{},initial:{},inquiry:{},lingual:{},loyalty:{},mastery:{},mimesis:{},monthly:{},numeral:{},omnibus:{},outlook:{},palatal:{},placard:{},polemic:{},posting:{},presage:{},preview:{},quibble:{},refrain:{},reissue:{},reorder:{},reprint:{},rewrite:{},roundup:{},singing:{},slander:{},sorting:{},tasting:{},tribute:{},turmoil:{},whisper:{},ablative:{},acridity:{},allegory:{},alveolar:{},ambition:{},ascender:{},audition:{},binomial:{},brandish:{},brooding:{},bundling:{},calculus:{},circular:{},clipping:{},coldness:{},courtesy:{},critique:{},daydream:{},defiance:{},delusion:{},demurrer:{},disfavor:{},disquiet:{},dynamism:{},easiness:{},equation:{},fondness:{},grasping:{},grouping:{},guidance:{},guttural:{},hornpipe:{},hysteria:{},idealism:{},intimacy:{},mistrust:{},monition:{},negation:{},nickname:{},nihilism:{},notation:{},ordinate:{},outburst:{},particle:{},passport:{},pedagogy:{},petition:{},phantasy:{},planning:{},playbook:{},proposal:{},revision:{},rhapsody:{},ridicule:{},sampling:{},serenade:{},slowness:{},sourness:{},subtitle:{},suspense:{},sympathy:{},tartness:{},teaching:{},theology:{},travesty:{},universe:{},acuteness:{},addiction:{},adoration:{},attending:{},autograph:{},constancy:{},crispness:{},cuneiform:{},deception:{},defensive:{},denseness:{},dialectic:{},dictation:{},digestion:{},diplomacy:{},disfavour:{},editorial:{},emulation:{},enactment:{},evocation:{},fecundity:{},footprint:{},formalism:{},formative:{},gradation:{},grievance:{},grumbling:{},guideline:{},immediacy:{},insurance:{},intention:{},intercept:{},invariant:{},itinerary:{},lassitude:{},majuscule:{},misgiving:{},monologue:{},morbidity:{},murmuring:{},narration:{},nutrition:{},ordinance:{},oversight:{},pictorial:{},pizzicato:{},prejudice:{},quadratic:{},quickness:{},quickstep:{},reckoning:{},reflexive:{},rejoicing:{},repulsion:{},retention:{},retrieval:{},revealing:{},saltiness:{},schooling:{},sentience:{},sulkiness:{},synthesis:{},testament:{},testimony:{},underline:{},undertone:{},accidental:{},accusative:{},adaptation:{},admiration:{},affixation:{},allurement:{},anatomical:{},antiphonal:{},asceticism:{},belittling:{},brightness:{},brilliance:{},chronology:{},classified:{},cleverness:{},clumsiness:{},cognizance:{},compliment:{},concession:{},conscience:{},conspiracy:{},contention:{},continuity:{},decoration:{},determiner:{},deterrence:{},digression:{},diminution:{},discontent:{},dissection:{},dissonance:{},divination:{},empiricism:{},enthusiasm:{},enticement:{},equivalent:{},execration:{},fortissimo:{},grogginess:{},hesitation:{},humbleness:{},hypostasis:{},hypothesis:{plural:"hypotheses"},impatience:{},infliction:{},insistence:{},instalment:{},intermezzo:{},jocularity:{},loneliness:{},neutrality:{},nomination:{},oppression:{},perfection:{},pestilence:{},philosophy:{},precaution:{},pretension:{},propensity:{},refutation:{},reputation:{},revelation:{},rumination:{},salutation:{},semiweekly:{},stigmatism:{},theatrical:{},triviality:{},underscore:{},unfairness:{},vernacular:{},vocabulary:{},whispering:{},acceptation:{},advancement:{},aggravation:{},appellative:{},benevolence:{},calculation:{},comparative:{},concordance:{},conjunctive:{},conjuration:{},correlation:{},correlative:{},countersign:{},denigration:{},designation:{},discourtesy:{},documentary:{},electricity:{},enchantment:{},engrossment:{},exclamation:{},explanation:{},exploration:{},foolishness:{},frustration:{},imperialism:{},infatuation:{},inscription:{},jactitation:{},obfuscation:{},outwardness:{},peculiarity:{},playfulness:{},presentment:{},propagation:{},provocation:{},rationalism:{},regionalism:{},repudiation:{},resignation:{},rotogravure:{},semimonthly:{},sensibility:{},seriousness:{},stipulation:{},strangeness:{},subcontract:{},supposition:{},syncopation:{},titillation:{},tranquility:{},unorthodoxy:{},unsoundness:{},valedictory:{},breakthrough:{},choreography:{},conciliation:{},constitution:{},consultation:{},counterpoint:{},covetousness:{},depreciation:{},faultfinding:{},heedlessness:{},helplessness:{},idealisation:{},idealization:{},impertinence:{},intoxication:{},irritability:{},mercifulness:{},notification:{},pacification:{},processional:{},promulgation:{},proportional:{},recollection:{},retroflexion:{},retroversion:{},significance:{},solicitation:{},spiritualism:{},stupefaction:{},supplication:{},transference:{},acculturation:{},attentiveness:{},communication:{},comprehensive:{},condescension:{},contradiction:{},demonstrative:{},determinative:{},documentation:{},hallucination:{},impersonation:{},individualism:{},interpolation:{},orchestration:{},preoccupation:{},prevarication:{},qualification:{},retentiveness:{},retroflection:{},structuralism:{},symbolisation:{},symbolization:{},versification:{},aggressiveness:{},categorisation:{},demoralisation:{},demoralization:{},farsightedness:{},predisposition:{},recommendation:{},reconstruction:{},sesquipedalian:{},simplification:{},traditionalism:{},conventionality:{},crystallization:{},personification:{},prognostication:{},characterization:{},predetermination:{},pi:{},xi:{},boo:{},bye:{},dit:{},fib:{},ire:{},ken:{},nay:{},pic:{},psi:{},pun:{},wai:{},woe:{},yea:{},blip:{},blog:{},deed:{},demo:{},epos:{},gist:{},grin:{},heed:{},idyl:{},iota:{},jive:{},moan:{},muse:{},norm:{},noun:{},nous:{},odor:{},pean:{},ploy:{},pomp:{},quiz:{},sass:{},sext:{},spam:{},sulk:{},surd:{},tale:{},trig:{},vlog:{},whim:{},yack:{},yoga:{},agony:{},alias:{},aroma:{},axiom:{},bebop:{},blues:{},bonus:{},canto:{},codex:{},creed:{},ditto:{},dogma:{},drawl:{},edict:{},ethic:{},facet:{},fever:{},frown:{},gamma:{},gamut:{},grief:{},groan:{},guilt:{},intro:{},kotow:{},macro:{},odour:{},omega:{},paean:{},pavan:{},peeve:{},prate:{},primo:{},prose:{},psalm:{},qualm:{},retro:{},rumor:{},savvy:{},scowl:{},shrug:{},skill:{},smirk:{},danger:{},push:{},refusal:{},tooling:{},trelvox:{}},verbs:{import:{},call:{},test:{},contain:{},extend:{},use:{},depend:{prep:"on"},rely:{prep:"on"},inherit:{prep:"from"},belong:{prep:"to",predicate:"mgx:partOf"},point:{prep:"to"},implement:{},override:{},export:{},define:{},declare:{},reference:{},invoke:{},wrap:{},mock:{},cover:{},document:{},describe:{},modify:{},touch:{},fix:{},break:{},introduce:{},deprecate:{},replace:{},own:{},maintain:{},review:{},merge:{},revert:{},deploy:{},run:{},execute:{},load:{},parse:{},emit:{},validate:{},log:{},throw:{},catch:{},create:{},delete:{},update:{},expose:{},consume:{},produce:{},generate:{},configure:{},install:{},publish:{},release:{},ship:{},watch:{},trigger:{},build:{},write:{},read:{},have:{},like:{},want:{},need:{},believe:{},trust:{},love:{},hate:{},fear:{},hope:{},teach:{},learn:{},drive:{},cook:{},sing:{},visit:{},care:{},grow:{},marry:{},wear:{},eat:{},sleep:{},walk:{},buy:{},sell:{},give:{},take:{},meet:{},ride:{},speak:{},duck:{}},adjectives:{legacy:{type:"subclass"},mock:{type:"subclass"},senior:{type:"subclass"},internal:{type:"subclass"},external:{type:"subclass"},public:{type:"subclass"},private:{type:"subclass"},abstract:{type:"subclass"},static:{type:"subclass"},async:{type:"subclass"},experimental:{type:"subclass"},stable:{type:"subclass"},core:{type:"subclass"},shared:{type:"subclass"},global:{type:"subclass"},local:{type:"subclass"},generated:{type:"subclass"},standalone:{type:"subclass"},primary:{type:"subclass"},secondary:{type:"subclass"},deprecated:{type:"data"},fast:{type:"data"},slow:{type:"data"},large:{type:"data"},small:{type:"data"},flaky:{type:"data"},tested:{type:"data"},documented:{type:"data"},buggy:{type:"data"},broken:{type:"data"},green:{type:"data"},deterministic:{type:"data"},pure:{type:"data"},empty:{type:"data"},stale:{type:"data"},male:{type:"data"},female:{type:"data"},young:{type:"data"},old:{type:"data"},hot:{type:"data"},cold:{type:"data"},sweet:{type:"data"},salty:{type:"data"},sharp:{type:"data"},round:{type:"data"},tall:{type:"data"},short:{type:"data"},happy:{type:"data"},sad:{type:"data"},angry:{type:"data"},afraid:{type:"data"},strong:{type:"data"},weak:{type:"data"},rich:{type:"data"},poor:{type:"data"},hard:{type:"data"},soft:{type:"data"},wild:{type:"data"},gentle:{type:"data"},colorful:{type:"data"},legitimate:{type:"data"},ranked:{type:"data"},related:{type:"data"},sacred:{type:"data"},unaffected:{type:"data"}},properNames:["tmct","Node","npm","JavaScript","TypeScript","Python","Java","Git","GitHub","GitLab","ESLint","Linux","macOS","Windows","Polycode","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]}});var UE={};Nt(UE,{CODE_REF_SHAPE:()=>su,DETERMINERS:()=>Lm,OF_CLASSIFIER_HEADS:()=>Mm,OF_PARTITIVE_HEADS:()=>Fm,QUANTIFIERS:()=>Pm,classify:()=>Dm,loadLexicon:()=>tn,lookupAdjective:()=>ka,lookupNoun:()=>pn,lookupProperName:()=>li,lookupVerb:()=>ja,numberOf:()=>xa,predicateOf:()=>nu,readsAsIndividualName:()=>ou,thirdPerson:()=>DE,withProperNames:()=>BE});function xa(e){let t=String(e??"").trim().toLowerCase();return/^\d+$/.test(t)?Number(t):G1[t]??null}function DE(e){let t=String(e);return t==="have"?"has":/[^aeiou]y$/.test(t)?`${t.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(t)?`${t}es`:`${t}s`}function nu(e,t=FE){if(e.predicate)return e.predicate;let n=e.prep?e.prep[0].toUpperCase()+e.prep.slice(1):"";return`${t}${DE(e.lemma)}${n}`}function zE(e){let t=String(e),n=[t];return t.length>4&&/[a-z]ies$/.test(t)&&n.push(`${t.slice(0,-3)}y`),/(ses|xes|zes|ches|shes)$/.test(t)&&n.push(t.slice(0,-2)),/[a-z]s$/.test(t)&&!/ss$/.test(t)&&n.push(t.slice(0,-1)),t==="has"&&n.push("have"),n}function ME(e,t={}){for(let[n,s]of Object.entries(t.nouns||{})){let o={lemma:n,...s||{}};if(o.property&&!V1.has(o.property))throw new Error(`lexicon noun "${n}": property must be "data" or "object", got ${JSON.stringify(o.property)}`);e.nouns.set(n,o),o.plural&&e.nounPlurals.set(o.plural,n)}for(let[n,s]of Object.entries(t.verbs||{}))e.verbs.set(n,{lemma:n,...s||{}});for(let[n,s]of Object.entries(t.adjectives||{})){let o={lemma:n,...s||{}};if(!K1.has(o.type))throw new Error(`lexicon adjective "${n}": type must be "subclass" or "data", got ${JSON.stringify(o.type)}`);e.adjectives.set(n,o)}for(let n of t.properNames||[])e.properNames.set(String(n).toLowerCase(),String(n))}function tn(e,t=FE){if(!e&&Nm.has(t))return Nm.get(t);let n=PE,s={nouns:new Map,nounPlurals:new Map,verbs:new Map,adjectives:new Map,properNames:new Map,ns:t};return ME(s,n),e?(ME(s,e),s):(Nm.set(t,s),s)}function BE(e,t){let n=new Map(e.properNames);for(let s of t)n.set(String(s).toLowerCase(),String(s));return{...e,properNames:n}}function pn(e,t,n={}){return H1(e,t,n)[0]??null}function H1(e,t,n={}){let s=String(t??"").toLowerCase(),o=e.nouns.get(s),r=e.nounPlurals.get(s),i=[],a=new Set,c=l=>{l&&!a.has(l.lemma)&&(a.add(l.lemma),i.push(l))};if(r){let l=e.nouns.get(r)??null;return n.singularOnly&&o?(c(o),c(l)):(c(l),c(o)),i}for(let l of zE(s))c(e.nouns.get(l));return i}function ja(e,t){return q1(e,t)[0]??null}function q1(e,t){let n=String(t??"").toLowerCase(),s=[],o=new Set;for(let r of zE(n)){let i=e.verbs.get(r);i&&!o.has(i.lemma)&&(o.add(i.lemma),s.push(i))}return s}function ka(e,t){return e.adjectives.get(String(t??"").toLowerCase())??null}function li(e,t){return e.properNames.get(String(t??"").toLowerCase())??null}function ou(e,t){let n=String(e??"");if(!n)return!1;if(li(t,n)||su.test(n)||/^[a-z][\w]*(?:-[\w]+)+$/i.test(n)||/^[A-Z]/.test(n))return!0;let s=pn(t,n);return s?s.lemma.toLowerCase()!==n.toLowerCase():!0}function Dm(e,t=tn()){let n=String(e??"").trim();if(!n)return null;let s=n.toLowerCase();if(Lm[s])return{pos:"determiner",type:Lm[s]};if(Pm[s])return{pos:"quantifier",type:Pm[s]};let o=xa(s);if(o!=null)return{pos:"number",type:"cardinal",value:o};let r=li(t,n);if(r)return{pos:"properName",type:"individual",canonical:r};let i=pn(t,s);if(i)return i.property?{pos:"noun",type:`${i.property}-property`,lemma:i.lemma,property:i.property}:{pos:"noun",type:"class",lemma:i.lemma};let a=ja(t,s);if(a)return{pos:"verb",type:"objectProperty",lemma:a.lemma,predicate:nu(a,t.ns),...a.prep?{prep:a.prep}:{}};let c=ka(t,s);return c?{pos:"adjective",type:c.type,lemma:c.lemma}:null}var FE,Lm,Pm,Mm,Fm,G1,V1,K1,Nm,su,Xn=M(()=>{LE();FE="tmct:",Lm=Object.freeze({every:"universal",a:"indefinite",an:"indefinite",the:"definite",no:"negative"}),Pm=Object.freeze({"at least":"owl:minCardinality","at most":"owl:maxCardinality",exactly:"owl:cardinality"}),Mm=Object.freeze(new Set(["type","kind","sort","form","class","variety","species","breed","genus"])),Fm=Object.freeze(new Set(["body","mass","group","collection","set","series","number","amount","piece","part","lot","pair","bunch","pile"])),G1=Object.freeze({one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10});V1=new Set(["data","object"]),K1=new Set(["subclass","data"]);Nm=new Map;su=/[./\\#:@]/});var CY,IY,OY,Y1,NY,LY,PY,WE=M(()=>{rs();Me();CY=Object.freeze({class:"Class",module:"Module",function:"Function",method:"Method",attribute:"Attribute",variable:"GlobalVariable",constant:"GlobalVariable",commit:"Commit"}),IY=Object.freeze({Class:["class","classes"],Module:["module","modules"],Function:["function","functions"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"]}),OY=Object.freeze({Class:[e=>`which classes inherit from ${e}`,e=>`what does ${e} contain`,e=>`where is ${e} defined`],Module:[e=>`what does ${e} import`,e=>`which modules import ${e}`,e=>`where is ${e} defined`],Function:[e=>`what calls ${e}`,e=>`what does ${e} call`,e=>`where is ${e} defined`],Method:[e=>`which class contains ${e}`,e=>`what calls ${e}`,e=>`where is ${e} defined`],Attribute:[e=>`which class contains ${e}`,e=>`where is ${e} defined`],GlobalVariable:[e=>`where is ${e} defined`,e=>`where is ${e} mentioned`],Commit:[e=>`what did commit ${e} touch`,e=>`when did ${e} change`]}),Y1=Object.freeze({import:"imports",imports:"imports",importing:"imports",imported:"imports",call:"calls",calls:"calls",calling:"calls",called:"calls",invoke:"calls",invokes:"calls",invoking:"calls",contain:"contains",contains:"contains",containing:"contains",containment:"contains",member:"contains",members:"contains",inherit:"inherits",inherits:"inherits",inheriting:"inherits",inheritance:"inherits",extend:"inherits",extends:"inherits",extending:"inherits",subclass:"inherits",subclasses:"inherits",subclassing:"inherits",test:"tests",tests:"tests",testing:"tests",tested:"tests",coverage:"tests",define:"defines",defines:"defines",defining:"defines",defined:"defines",definition:"defines",definitions:"defines",declaration:"defines",touch:"touches",touches:"touches",touching:"touches",touched:"touches",cochange:"cochange","co-change":"cochange","change-coupling":"cochange",coupled:"cochange",export:"reexports",exports:"reexports",exporting:"reexports",exported:"reexports",reexport:"reexports",reexports:"reexports",reexporting:"reexports","re-export":"reexports","re-exports":"reexports","re-exporting":"reexports",serve:"serves",serves:"serves",serving:"serves",served:"serves",denote:"denotes",denotes:"denotes",denoting:"denotes",denoted:"denotes"}),NY=Object.freeze({imports:["imports"],calls:["calls","callsSymbol"],contains:["contains"],inherits:["inherits"],tests:["tests"],defines:["defines"],touches:["touches","touchesSymbol"],cochange:["cochange"],reexports:["reexports"],serves:["serves"],denotes:["denotes"]}),LY=Object.freeze({imports:{verb:"imports",edgeNoun:"import"},calls:{verb:"calls",edgeNoun:"call"},contains:{verb:"contains",edgeNoun:"containment"},inherits:{verb:"inherits from",edgeNoun:"inheritance"},tests:{verb:"tests",edgeNoun:"test"},defines:{verb:"defines",edgeNoun:"definition"},touches:{verb:"touches",edgeNoun:"touch"},cochange:{verb:"changes together with",edgeNoun:"change-coupling"},reexports:{verb:"re-exports",edgeNoun:"re-export"},serves:{verb:"serves",edgeNoun:"service"},denotes:{verb:"denotes",edgeNoun:"denotation"}}),PY=Object.freeze({imports:[{side:"obj",make:e=>`which modules import ${e}`},{side:"subj",make:e=>`what does ${e} import`}],calls:[{side:"obj",make:e=>`what calls ${e}`},{side:"subj",make:e=>`what does ${e} call`}],contains:[{side:"subj",make:e=>`what does ${e} contain`},{side:"obj",make:e=>`which class contains ${e}`}],inherits:[{side:"obj",make:e=>`which classes inherit from ${e}`},{side:"subj",make:e=>`where is ${e} defined`}],tests:[{side:"obj",make:e=>`what tests ${e}`},{side:"obj",make:e=>`where is ${e} defined`}],defines:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`what does ${e} contain`}],touches:[{side:"obj",make:e=>`when did ${e} change`},{side:"subj",make:e=>`what did commit ${e} touch`}],cochange:[{side:"obj",make:e=>`where is ${e} defined`},{side:"subj",make:e=>`which modules import ${e}`}],reexports:[{side:"subj",make:e=>`what does ${e} export`},{side:"obj",make:e=>`where is ${e} defined`}],serves:[{side:"subj",make:e=>`what does ${e} serve`},{side:"obj",make:e=>`what serves ${e}`}],denotes:[{side:"subj",make:e=>`what does ${e} denote`},{side:"obj",make:e=>`what denotes ${e}`}]})});function KE(e){return!!e&&typeof e=="object"&&typeof e.s=="string"&&X1.test(e.s)&&typeof e.t=="string"&&e.t.length>0&&Number.isInteger(e.r)&&e.r>0}function So(e){if(!e||typeof e!="object")return!1;for(let t of["term","title","text","summary","url"])if(typeof e[t]!="string"||!e[t])return!1;if(!Number.isInteger(e.revid)||e.revid<=0)return!1;for(let t of["isa","source","licence"])if(e[t]!==void 0&&(typeof e[t]!="string"||!e[t]))return!1;return!0}function iu(e,t){let n=String(e??"").split(/(?<=[.!?])\s+/),s="";for(let o of n){let r=s?`${s} ${o}`:o;if(r.length>t)break;s=r}return s||String(e??"").slice(0,t)}function Q1(e){let t=e,n;do n=t,t=t.replace(/\s*\([^()]*\)/g,"");while(t!==n);return t}function VE(e,t){let n=pn(t,e);return n?V(n.lemma):e}function HE(e,t){let n=Q1(String(e??"")).match(J1);if(!n)return null;let s=!n[1],o=[];for(let u of n[2].trim().split(/\s+/))if(Z1.has(u)||(o.push(u),o.length>=6))break;let r=o;for(let u=r.indexOf("of");u>0;u=r.indexOf("of")){let d=r[u-1]?.split("-").pop(),p=d&&VE(d,t);if(p&&(tP.has(p)||nP.has(p))){r=r.slice(u+1);continue}r=r.slice(0,u);break}for(;r.length&&eP.has(r[0]);)r=r.slice(1);if(!r.length)return null;let i=r[r.length-1].split("-").pop();if(!i)return null;let a=VE(i,t);if(GE.has(i)||GE.has(a))return null;let c=pn(t,i);if(!c)return null;let l=V(c.lemma);return s&&(!/s$/.test(i)||V(i)===l)?null:l}var X1,ru,J1,Z1,GE,eP,tP,nP,ur=M(()=>{Ye();Xn();WE();X1=/^ref-[0-3][0-9a-f]$/;ru=400;J1=/^[A-Z][^.!?]*? (?:is|are) (?:(a|an|the) )?([a-z][a-z -]{1,60})/;Z1=new Set(["that","which","where","who","whose","whom","when","used","found","made","with","in","on","for","from","by","to","and","or"]),GE=new Set(["type","kind","sort","form","class","variety","group","part","piece","member","way","term","name","word","thing","example","family","genus","species","unit","series","set","list","number","amount","body","mass"]),eP=new Set(["a","an","the"]),tP=new Set(["type","kind","sort","form","class","variety","species","breed","genus","group","part","parts","piece","bunch","bit","name","set","way","unit","family","ability","color","series","mammal","practice","list","amount","mass","reworking","blockage","goddess","aura","development","consisting","announcement","messengers","subset","carrying","photograph","adding","use","science","songbird","symptom","accumulation","number","suborder","falling","management","evaluation","superorder","activity","interlacing","introduction"]),nP=new Set(["either","one","each","both","any"])});var Ra,au=M(()=>{Ra=()=>{throw new Error("gunzipSync unavailable in a browser bundle")}});function qE(e=process.env){return e?.TMCT_REFERENCE_PACK_DIR||ne(sP,"corpus","reference")}function YE(e){try{return Ra(cr(e))}catch{return null}}function Um(e){if(zm.has(e))return zm.get(e);let t=null,n=YE(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return zm.set(e,t),t}function oP(e,t){let n=`${e}\0${t}`;if(Bm.has(n))return Bm.get(n);let s=null,o=YE(ne(e,"shards",`${t}.jsonl.gz`));if(o){s=new Map;for(let r of o.toString("utf8").split(`
169
+ `))if(r.trim())try{let i=JSON.parse(r);So(i)&&s.set(i.term,i)}catch{}}return Bm.set(n,s),s}function Wm(e,t){let n=Um(e);if(!n)return null;let s=n[String(t??"")];return KE(s)?oP(e,s.s)?.get(s.t)??null:null}var rP,sP,zm,Bm,Gm=M(()=>{lr();au();vo();Qe();ur();rP={},sP=ne($e(Yt(rP.url)),"..","..","..");zm=new Map,Bm=new Map});function aP(e){if(!e||typeof e!="object")return!1;for(let t of["subject","predicate","object","provenance"])if(typeof e[t]!="string"||!e[t])return!1;return iP.includes(e.predicate)}function XE(e){return So(e)?e.facts===void 0?!0:Array.isArray(e.facts)&&e.facts.length>0&&e.facts.every(aP):!1}function dr(e,t){return`research:${e}:${V(t).replace(/ /g,"_")}`}function ui(e){if(!e||typeof e.name!="string"||!e.name||typeof e.create!="function")throw new Error("registerResearchSource: expected { name, create(options) }");cP.set(e.name,{name:e.name,create:e.create})}var iP,cP,JY,QY,fr=M(()=>{Ye();ur();iP=Object.freeze(["rdf:type","rdfs:subClassOf","mgx:partOf","mgx:hasA","mgx:usedFor","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:madeOf","mgx:createdBy","mgx:locatedNear","mgx:hasProperty"]);cP=new Map;JY=Object.freeze(["wikipedia","wikidata","simple-wikipedia","simple-wikipedia-pack","wiktionary","dbpedia"]),QY=Object.freeze({wikipedia:"simple-wikipedia",wikidata:"wikidata","simple-wikipedia":"simple-wikipedia","simple-wikipedia-pack":"simple-wikipedia-pack",wiktionary:"wiktionary",dbpedia:"dbpedia-lookup"})});function JE(e){let t=Number(e);return Number.isFinite(t)?t===408||t===429||t>=500:!1}var e3,cu=M(()=>{e3=Object.freeze({failureThreshold:5,windowMs:6e4,cooldownMs:6e4})});function Ta({fetchImpl:e,timeoutMs:t=di,minIntervalMs:n=Xt,retryAfterFloorMs:s=lP,maxFetchesPerTurn:o=uP,userAgent:r,waitForSlot:i=!1,validators:a=null}={}){let c=e??((...E)=>globalThis.fetch(...E)),l=new Map,u=0,d=0,p=!1,f=0,m=0,h=0,b=!1,g=!1,w=()=>{if(!r)return null;let E={"Api-User-Agent":r};return typeof document>"u"&&(E["User-Agent"]=r),E};function y(E){let k=Number(E)*1e3;d=Date.now()+Math.max(k||0,s)}function v(E){let k=a?.get(E);if(!k)return null;let P={};return k.etag&&(P["If-None-Match"]=k.etag),k.lastModified&&(P["If-Modified-Since"]=k.lastModified),Object.keys(P).length?P:null}function R(E,k){if(!a)return;let P=k.headers?.get?.("etag")??"",D=k.headers?.get?.("last-modified")??"";if(!P&&!D)return;let H=a.get(E)??{};a.set(E,{etag:P||H.etag||"",lastModified:D||H.lastModified||""})}async function S(E,{asJson:k}){if(b&&h>=o)return g=!0,null;f+=1,h+=1;let P=typeof AbortController=="function"?new AbortController:null,D=P?setTimeout(()=>P.abort(),t):null;try{let H={};P&&(H.signal=P.signal);let Y={...w()??{},...v(E)??{}};Object.keys(Y).length&&(H.headers=Y);let J;try{J=await c(E,H)}catch{return m+=1,null}if(J.status===429)return y(J.headers?.get?.("retry-after")),m+=1,null;if(J.status===304)return a?{notModified:!0}:null;if(!J.ok)return JE(J.status)&&(m+=1),null;if(R(E,J),k){let L=await J.json();return L?.error?.code==="maxlag"?(y(J.headers?.get?.("retry-after")),m+=1,null):L}return await J.text()}catch{return P?.signal?.aborted&&(m+=1),null}finally{D!==null&&clearTimeout(D)}}async function j(E){return S(E,{asJson:!0})}async function I(E){return S(E,{asJson:!1})}let x=()=>Math.max(d,u+n);async function _(){for(;;){let E=Date.now();if(!p&&E>=x())return u=E,p=!0,!0;if(!i)return!1;await new Promise(k=>setTimeout(k,Math.max(x()-E,25)))}}async function $(E,k,{remember:P=!0}={}){if(l.has(E))return l.get(E);if(!await _())return null;let D=null;try{D=await k()}catch{D=null}finally{p=!1}return P&&l.set(E,D),D}function T(){b=!0,h=0,g=!1}function C(){return{fetches:f,systemicFailures:m,fetchesThisTurn:h,budgetExhausted:g}}return{fetchJson:j,fetchText:I,cachedFetch:$,beginTurn:T,stats:C}}var di,Xt,lP,uP,_a,Aa=M(()=>{cu();di=4e3,Xt=2e3,lP=5e3,uP=6,_a=5});function bP({fetchImpl:e,origin:t=dP,timeoutMs:n=di,minIntervalMs:s=Xt,lexicon:o=null,userAgent:r=gP,waitForSlot:i=!1,sourceName:a=pP,label:c=mP}={}){let l=Ta({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:r,waitForSlot:i});function u(f,m){let h=Array.isArray(m?.[1])?m[1]:[];for(let b of h){let g=V(b);if(g===f||g.startsWith(f))return String(b)}return null}async function d(f,m){let h=await l.fetchJson(`${t}/api/rest_v1/page/summary/${encodeURIComponent(m.replace(/ /g,"_"))}`);if(!h)return null;let b=String(h.extract??""),g=Number(h.revision),w={term:f,title:String(h.title??m),text:b,summary:iu(b,ru),url:String(h.content_urls?.desktop?.page??`${t}/wiki/${encodeURIComponent(m.replace(/ /g,"_"))}`),revid:g},y=o;if(!y)try{y=tn()}catch{y=null}let v=y?HE(b,y):null;return v&&(w.isa=v),So(w)?w:null}async function p(f){let m=await l.fetchJson(`${t}/w/api.php?action=opensearch&format=json&origin=*&maxlag=${_a}&search=${encodeURIComponent(f)}&limit=3`),h=m?u(f,m):null;return h?d(f,h):null}return{name:a,origin:t,label:c,beginTurn(){l.beginTurn()},stats(){return l.stats()},provenanceTag(f){return dr(a,f)},async lookup(f){let m=String(f??"");return m?l.cachedFetch(m,()=>p(m)):null},async pageByTitle(f){let m=String(f??"").trim();return m?l.cachedFetch(`title\0${V(m)}`,()=>d(V(m),m)):null},async linkedTitles(f,{limit:m=25}={}){let h=String(f??"").trim();if(!h)return null;let b=await l.cachedFetch(`links\0${V(h)}`,async()=>{let w=(await l.fetchJson(`${t}/w/api.php?action=parse&format=json&formatversion=2&origin=*&maxlag=${_a}&prop=links&redirects=1&page=${encodeURIComponent(h)}&section=0`))?.parse?.links;if(!Array.isArray(w))return null;let y=new Set,v=[];for(let R of w){if(!R||R.ns!==0||R.exists===!1)continue;let S=String(R.title??R["*"]??"").trim(),j=V(S);!S||!j||y.has(j)||(y.add(j),v.push(S))}return v});return Array.isArray(b)?b.slice(0,Math.max(0,m)):null}}}function wP(e={}){return bP({origin:fP,sourceName:ZE,label:hP,waitForSlot:!0,...e})}var dP,fP,pP,ZE,mP,hP,gP,ex=M(()=>{Ye();Xn();ur();fr();Aa();dP="https://en.wikipedia.org",fP="https://simple.wikipedia.org",pP="wikipedia-live",ZE="simple-wikipedia",mP="Wikipedia",hP="Simple English Wikipedia",gP="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)";ui({name:ZE,create:wP})});function RP(e,t){let n=Array.isArray(t?.search)?t.search:[],s=[],o=[];for(let r of n){let i=String(r?.id??"");if(!sx.test(i))continue;let a=V(r?.label??"");a===e?s.push(i):a.startsWith(e)&&o.push(i)}return[...s,...o]}function _P(e){let t=[];for(let[n,s]of Object.entries(SP)){let o=e?.claims?.[n];if(!Array.isArray(o))continue;let r=0;for(let i of o){if(t.length>=kP)return t;if(r>=jP)break;let a=i?.mainsnak;if(a?.snaktype!=="value")continue;let c=String(a?.datavalue?.value?.id??"");sx.test(c)&&(t.push({property:n,predicate:s,id:c}),r+=1)}}return t}function TP(e,t,n){for(let s of EP)for(let o of e){if(o.property!==s)continue;let r=t.get(o.id);if(r&&r!==n)return r}return null}function AP({fetchImpl:e,origin:t=yP,timeoutMs:n=di,minIntervalMs:s=Xt,userAgent:o=vP,waitForSlot:r=!1,sourceName:i=nx}={}){let a=Ta({fetchImpl:e,timeoutMs:n,minIntervalMs:s,userAgent:o,waitForSlot:r}),c=d=>`${t}/w/api.php?${new URLSearchParams({format:"json",origin:"*",maxlag:String(_a),...d})}`;async function l(d){let p=new Map;if(!d.length)return p;let f=await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels",ids:d.join("|")}));for(let[m,h]of Object.entries(f?.entities??{})){let b=V(h?.labels?.en?.value??"");b&&p.set(m,b)}return p}async function u(d){let p=await a.fetchJson(c({action:"wbsearchentities",language:"en",uselang:"en",type:"item",limit:"5",search:d})),f=p?RP(d,p):[];for(let m of f){let b=(await a.fetchJson(c({action:"wbgetentities",languages:"en",props:"labels|descriptions|claims|info",ids:m})))?.entities?.[m];if(!b)continue;let g=_P(b),w=await l(g.map(x=>x.id)),y=TP(g,w,d);if(y&&xP.has(y))continue;let v=dr(i,d),R=[],S=new Set;for(let x of g){let _=w.get(x.id);!_||_===d||S.has(`${x.predicate}\0${_}`)||(S.add(`${x.predicate}\0${_}`),R.push({subject:d,predicate:x.predicate,object:_,provenance:v}))}let j=String(b.descriptions?.en?.value??""),I={term:d,title:String(b.labels?.en?.value??""),text:j,summary:iu(j,ru),url:`${t}/wiki/${m}`,revid:Number(b.lastrevid),source:tx,licence:$P};if(y&&(I.isa=y),R.length&&(I.facts=R),XE(I))return I}return null}return{name:i,origin:t,label:tx,beginTurn(){a.beginTurn()},stats(){return a.stats()},provenanceTag(d){return dr(i,d)},async lookup(d){let p=V(d??"");return p?a.cachedFetch(p,()=>u(p)):null}}}function CP(e={}){return AP({waitForSlot:!0,...e})}var yP,nx,tx,$P,vP,SP,EP,xP,jP,kP,sx,ox=M(()=>{Ye();ur();fr();Aa();yP="https://www.wikidata.org",nx="wikidata",tx="Wikidata",$P="CC0 1.0",vP="the-mechanical-code-talker (+https://tmct.polycode.co.uk/)",SP=Object.freeze({P31:"rdf:type",P279:"rdfs:subClassOf",P361:"mgx:partOf",P527:"mgx:hasA",P186:"mgx:madeOf",P366:"mgx:usedFor",P276:"mgx:atLocation",P1542:"mgx:causes",P170:"mgx:createdBy",P2670:"mgx:hasA"}),EP=["P279","P31"],xP=new Set(["scholarly article","album","song","single","film","television series","television series episode","band","musical group","video game","book","novel"]),jP=3,kP=12,sx=/^Q[1-9][0-9]*$/;ui({name:nx,create:CP})});function LP(e,t){let n=pn(t,e);return n?V(n.lemma):V(e)}function MP(e,t,n,s,o,r){if(!s||r<=0)return[];let i=new Set([n]),a=[];for(let c of String(t??"").matchAll(OP)){if(a.length>=r)break;let l=LP(c[0],o);!l||!zg(l)||i.has(l)||!s[l]||(i.add(l),Wm(e,l)&&a.push(PP(l)))}return a}function FP({dir:e,lexicon:t=null,sourceName:n=rx}={}){let s=e||qE(),o=t;function r(){if(o)return o;try{o=tn()}catch{o=null}return o}function i(a){let c=V(a??"");if(!c)return null;let l=Wm(s,c);if(!l)return null;let u={...l,term:c};return So(u)?u:null}return{name:n,origin:IP,provenanceTag(a){return dr(n,a)},async lookup(a){return i(a)},async pageByTitle(a){return i(a)},async linkedTitles(a,{limit:c=NP}={}){let l=i(a);if(!l)return null;let u=Um(s);return MP(s,l.text,l.term,u,r(),Math.max(0,c))}}}var IP,rx,OP,NP,PP,ix=M(()=>{Ye();Xn();Kn();ur();Gm();fr();IP="https://simple.wikipedia.org",rx="simple-wikipedia-pack",OP=/[A-Za-z][A-Za-z'-]*/g,NP=25;PP=e=>e.charAt(0).toUpperCase()+e.slice(1);ui({name:rx,create:FP})});var DP,zP,_3,Vm=M(()=>{Ye();Xn();Dr();fr();DP=Object.freeze({fanoutLimit:5,maxDepth:1,maxTopics:12,minIntervalMs:2e3,source:"wikipedia"}),zP=["this","is","about","the"],_3=zP.length});var ax=M(()=>{Lt();Qe();xp();Ye();Ue()});var Km,lu,Ca=M(()=>{Km=new Set(["person","place","object","event","time","quantity","organization","group","animal","plant","furniture","vehicle","insect","emotion","metal","liquid","weather","planet","jewelry","cutlery","government","material","artifact","location","structure","food","drink","clothing","body","language","mind","family","meal","season","number","entity","abstraction","physical_entity","attribute","state","act","communication","cognition","measure","unit"]),lu=new Set([...Km,"property","concept","idea","content"])});var cx=M(()=>{Ye();Rm();Ca();Pi();Cn()});var lx=M(()=>{Ye()});var uu=M(()=>{In();Pr()});var ux=M(()=>{Ye()});var BP,dx,fx,px,c5,mx=M(()=>{ux();Aa();BP=250,dx=Object.freeze([{id:"wikimedia-featured",name:"Wikimedia featured feed",kind:"contemporary",format:"wikimedia-feed",url:"https://api.wikimedia.org/feed/v1/wikipedia/en/featured",homepage:"https://www.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"hacker-news",name:"Hacker News",kind:"contemporary",format:"hn",url:"https://hacker-news.firebaseio.com/v0",homepage:"https://news.ycombinator.com/",licence:"user-submitted, discussion linked",browserVerified:"2026-08-08",minIntervalMs:BP,enabledByDefault:!0},{id:"usgs-quakes",name:"USGS earthquakes",kind:"contemporary",format:"usgs",url:"https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_day.geojson",homepage:"https://earthquake.usgs.gov/",licence:"US public domain",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"nyt-world",name:"NYT World News",kind:"contemporary",format:"rss",url:"https://rss.nytimes.com/services/xml/rss/nyt/World.xml",homepage:"https://www.nytimes.com/section/world",licence:"personal use with attribution",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"wikinews-published",name:"Wikinews",kind:"contemporary",format:"mediawiki",url:"https://en.wikinews.org/w/api.php",homepage:"https://en.wikinews.org/",licence:"CC BY 2.5",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"simple-wikipedia",name:"Simple English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://simple.wikipedia.org",homepage:"https://simple.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"wikidata",name:"Wikidata",kind:"kb",format:"wikidata",url:"https://www.wikidata.org",homepage:"https://www.wikidata.org/",licence:"CC0 1.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"wiktionary",name:"Wiktionary",kind:"kb",format:"wiktionary",url:"https://en.wiktionary.org",homepage:"https://en.wiktionary.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!0},{id:"dbpedia-lookup",name:"DBpedia Lookup",kind:"kb",format:"dbpedia-lookup",url:"https://lookup.dbpedia.org",homepage:"https://www.dbpedia.org/",licence:"CC BY-SA 3.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!1},{id:"english-wikipedia",name:"English Wikipedia",kind:"kb",format:"wikipedia-summary",url:"https://en.wikipedia.org",homepage:"https://en.wikipedia.org/",licence:"CC BY-SA 4.0",browserVerified:"2026-08-08",minIntervalMs:Xt,enabledByDefault:!1}]),fx=Object.freeze(["wikimedia-featured","hacker-news","usgs-quakes","nyt-world","wikinews-published"]),px=Object.freeze(["simple-wikipedia","wikidata","wiktionary"]),c5=new Map(dx.map(e=>[e.id,e]))});var xt,u5,d5,f5,p5,m5,h5,g5,b5,w5,y5,$5,v5,S5,E5,x5,j5,k5,R5,_5,Hm=M(()=>{xt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},u5=xt("createRequire"),d5=xt("readFileSync"),f5=xt("access"),p5=xt("readFile"),m5=xt("writeFile"),h5=xt("appendFile"),g5=xt("mkdir"),b5=xt("mkdtemp"),w5=xt("rename"),y5=xt("unlink"),$5=xt("rm"),v5=xt("stat"),S5=xt("copyFile"),E5=xt("readdir"),x5=xt("createReadStream"),j5=xt("createWriteStream"),k5=xt("randomBytes"),R5=xt("spawnSync"),_5=xt("createInterface")});var hx=M(()=>{});var gx=M(()=>{Lt();Hm();Qe();Ia();Zl();Om();Ue();Qt();hx();Cn();Ye();Kn();tu();Xn()});var A4,C4,I4,O4,Ym=M(()=>{Ye();cx();lx();Ct();Xn();uu();Cn();mx();Aa();fr();cu();gx();A4=Object.freeze({sources:fx,kbSources:px,extraSources:Object.freeze([]),pollMinutes:15,enrichMinutes:10,enrichTermsPerCycle:3,negativeCacheTtlHours:24,syllogismsPerIngest:12,itemCap:30,newsFactCap:4e3,feedTop:3,windowHours:48,minIntervalMs:0}),C4=6*36e5,I4=Object.freeze({"simple-wikipedia":"simple-wikipedia",wikidata:"wikidata",wiktionary:"wiktionary","dbpedia-lookup":"dbpedia"}),O4=_s.teach});var Xm=M(()=>{Ye()});var qP,V4,bx=M(()=>{lr();au();vo();Qe();Xm();Ye();qP={},V4=ne($e(Yt(qP.url)),"..","..","..")});var H4,q4,Y4,wx=M(()=>{H4=Object.freeze(["task","autoFeedback","alloFeedback","turnManagement","timeManagement","discourseStructuring","ownCommunicationManagement","partnerCommunicationManagement","socialObligationsManagement","contactManagement"]),q4=Object.freeze({propositionalQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question about whether a proposition holds ('does X import Y?')"}),checkQuestion:Object.freeze({dimension:"task",gloss:"a yes/no question whose asker already expects the answer yes ('..., right?')"}),setQuestion:Object.freeze({dimension:"task",gloss:"a wh-question asking for the members of a set ('what does X import?')"}),choiceQuestion:Object.freeze({dimension:"task",gloss:"a question asking which of the listed alternatives holds ('is X a module or a class?')"}),inform:Object.freeze({dimension:"task",gloss:"a declarative telling the addressee something (a teach turn; also tmct explaining its own function)"}),answer:Object.freeze({dimension:"task",gloss:"an inform that discharges a question just asked (an answer grounded in the graph)"}),confirm:Object.freeze({dimension:"task",gloss:"an answer 'yes' to a check question"}),disconfirm:Object.freeze({dimension:"task",gloss:"an answer 'no' to a check question"}),agreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be true"}),disagreement:Object.freeze({dimension:"task",gloss:"an inform stating that the speaker holds what the addressee just stated to be false"}),correction:Object.freeze({dimension:"task",gloss:"a disagreement that also supplies the replacement ('no, I meant Y')"}),request:Object.freeze({dimension:"task",gloss:"asks the addressee to perform an action ('solve it' \u2014 a goal turn)"}),instruct:Object.freeze({dimension:"task",gloss:"a request the addressee is expected to carry out without negotiation (a bare imperative)"}),suggestion:Object.freeze({dimension:"task",gloss:"puts an action forward as advisable without claiming authority over the addressee"}),offer:Object.freeze({dimension:"task",gloss:"commits the speaker to an action, conditional on the addressee wanting it"}),autoPositive:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn succeeded (an acknowledgement)"}),autoNegative:Object.freeze({dimension:"autoFeedback",gloss:"the sender reports its own processing of the previous turn failed \u2014 tmct's honest miss"}),initialGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"opens an exchange of greetings ('hi')"}),returnGreeting:Object.freeze({dimension:"socialObligationsManagement",gloss:"answers a greeting with a greeting"}),thanking:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses gratitude for something the addressee did"}),apology:Object.freeze({dimension:"socialObligationsManagement",gloss:"expresses regret for something the speaker did"})}),Y4=Object.freeze({teach:"inform","ask-set":"setQuestion","ask-propositional":"propositionalQuestion","ask-choice":"choiceQuestion",goal:"request",imperative:"instruct","honest-miss":"autoNegative",greeting:"initialGreeting",thanks:"thanking",help:"inform","game-answer":"answer","game-inform":"inform"})});var tX,XP,JP,yx,nX,sX,oX,rX,iX,$x=M(()=>{In();uu();tX=Object.freeze({inline:"inline",enumerated:"enumerated"}),XP=new Set(["in","on","at","for","with","from","of","into","onto"]),JP=new Set(["you","i","it","he","she","they","we","there","someone","something","one","him","her","them","who","himself","herself","itself","themselves","myself","yourself"]),yx=new Set([...XP,"to","behind","before","near","next","along","alongside","under","over","between","among","during","without","about","by","as","like","that","if","when","while","being","because","since","until","so","and","but","or","immediately","likely","usually","normally","currently","is","are","was","were","do","does","did","has","have","had","will","would","could","should","might","must","can"]),nX=new Set([...yx,"be","been"]),sX=new RegExp("^(?:in|at|on|from|by|with|for|of|to|off)\\s+(?:(?:what|which)\\s+[a-z][\\w'-]*|where|when|why|how|who)\\s+(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\s+(.+?)[?.!]*$","i"),oX=new RegExp("^(.*?)\\b(?:what|who|which|where|when|why|how)\\s+(?:i|you|he|she|it|we|they)?\\s*(?:is|are|was|were|do|does|did|can|could|should|would|will|has|have|might|must)\\b","i"),rX=Object.freeze([{family:"AtLocation",predicates:Object.freeze(["mgx:atLocation","mgx:locatedNear"]),cue:/\b(where|located|location)\b/i},{family:"IsA/Synonym/HasProperty",predicates:Object.freeze(["rdfs:subClassOf","mgx:synonym","mgx:hasProperty"]),cue:/\b(kind of|type of|another word for|same as|synonym)\b/i},{family:"HasPrerequisite/HasSubevent",predicates:Object.freeze(["mgx:hasPrerequisite","mgx:hasSubevent","mgx:hasFirstSubevent","mgx:hasLastSubevent"]),cue:/\b(before|after|first|next|then|once you|in order to)\b/i},{family:"Desires/MotivatedByGoal",predicates:Object.freeze(["mgx:desires","mgx:motivatedByGoal","mgx:causesDesire"]),cue:/\b(want\w*|desire\w*|motivat\w*)\b/i},{family:"Causes",predicates:Object.freeze(["mgx:causes","mgx:causesDesire"]),cue:/\b(cause\w*|result(?:s|ed)? in|leads? to|led to)\b/i},{family:"PartOf/HasA/MadeOf",predicates:Object.freeze(["mgx:partOf","mgx:hasA","mgx:madeOf"]),cue:/\b(part of|made of|has a|have a)\b/i},{family:"CapableOf",predicates:Object.freeze(["mgx:capableOf","mgxneg:capableOf"]),cue:/\b(capable of|able to)\b/i},{family:"UsedFor",predicates:Object.freeze(["mgx:usedFor"]),cue:/\b(used for|used to|use for)\b/i}]),iX=new Set([...JP,...yx,"a","an","the","some","any","few","many","several","more","most","my","your","his","its","our","their","what","which","where","when","why","how","find","found","put","get","keep","store","place","buy","locate","hide","wear","carry","use","take","open","cross","need","want"])});function Oa(e){let t=new Map;for(let[n,s]of e||[])!n||!s||n===s||(t.has(n)||t.set(n,new Set),t.get(n).add(s));return t}function du(e,t,{cap:n=6,stopAt:s=null,toward:o=null}={}){let r=[e],i=new Set([e]),a=e;for(;r.length<n&&!(o&&a===o);){let c=[...t.get(a)||[]].filter(d=>!i.has(d)).sort(QP);if(!c.length)break;let l=o?c.filter(d=>d===o||Qm(d,t).has(o)):[];a=(l.length?l:c)[0];let u=s&&s.has(a);if(u&&r.length>1||(i.add(a),r.push(a),u))break}return r}function Qm(e,t,{cap:n=64}={}){let s=new Set([e]),o=[e];for(;o.length&&s.size<n;){let r=o.shift();for(let i of t.get(r)||[])s.has(i)||(s.add(i),o.push(i))}return s}function Zm(e,t,n,s){if(n.has(e))return n.get(e);if(s.has(e))return 1;s.add(e);let o=t.get(e),r=1;if(o&&o.size){let i=0;for(let a of o)i=Math.max(i,Zm(a,t,n,s));r=i+1}return s.delete(e),n.set(e,r),r}function ZP(e){let t=new Map;for(let[n,s]of e||[])!n||!s||(t.has(n)||t.set(n,new Set),t.get(n).add(s),t.has(s)||t.set(s,new Set),t.get(s).add(n));return t}function eM(e,t,n,s,o,{threshold:r,rootDepth:i,icByTerm:a}){let c=Qm(e,n),l=Qm(t,n);if(c.has(t)||l.has(e))return{distinct:!1,reason:"subsumes",lcs:c.has(t)?t:e};if(s.size)for(let h of c){let b=s.get(h);if(b){for(let g of l)if(b.has(g))return{distinct:!0,reason:"disjoint",lcs:null}}}let u=[...c].filter(h=>l.has(h));if(!u.length)return c.size<2||l.size<2?{distinct:!1,reason:"inconclusive",lcs:null}:{distinct:!0,reason:"non-intersecting",lcs:null};let d=h=>Zm(h,n,o,new Set),p=u[0],f=d(p);for(let h of u){let b=d(h);(b>f||b===f&&h<p)&&(p=h,f=b)}if(f<=i)return{distinct:!0,reason:"root-subsumer",lcs:p};if(a){let h=a.get(p);return typeof h=="number"&&h<r?{distinct:!0,reason:"low-ic",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}return 2*f/(d(e)+d(t))<r?{distinct:!0,reason:"shallow-subsumer",lcs:p}:{distinct:!1,reason:"shared-lineage",lcs:p}}function fu(e,{subClassEdges:t=[],parents:n=null,disjointEdges:s=[],threshold:o=.5,rootDepth:r=1,icByTerm:i=null}={}){let a=[...new Set((e||[]).filter(Boolean))],c=n||Oa(t),l=ZP(s),u=new Map,d=new Map(a.map(w=>[w,w])),p=w=>{for(;d.get(w)!==w;)d.set(w,d.get(d.get(w))),w=d.get(w);return w},f=(w,y)=>{let v=p(w),R=p(y);v!==R&&d.set(v<R?R:v,v<R?v:R)},m=[];for(let w=0;w<a.length;w+=1)for(let y=w+1;y<a.length;y+=1){let v=eM(a[w],a[y],c,l,u,{threshold:o,rootDepth:r,icByTerm:i});m.push({a:a[w],b:a[y],...v}),v.distinct||f(a[w],a[y])}let h=new Map;for(let w of a){let y=p(w);h.has(y)||h.set(y,[]),h.get(y).push(w)}let b=w=>Zm(w,c,u,new Set),g=[...h.values()].map(w=>{let y=[...w].sort(),v=y[0],R=b(v);for(let S of y){let j=b(S);j>R&&(R=j,v=S)}return{objects:y,label:v}}).sort((w,y)=>w.label.localeCompare(y.label));return{split:g.length>1,clusters:g,pairs:m}}var QP,pu=M(()=>{Ct();Ca();QP=(e,t)=>e<t?-1:e>t?1:0});var vx=M(()=>{});function Sx(e,{pending:t=null}={}){return t?!0:String(e??"").split(`
170
+ `).filter(n=>n.trim()!=="").length>1}var mu,hX,Ex=M(()=>{vx();mu=Object.freeze({MEMORY_COUNT:"memory-count",MEMORY_CLASS:"memory-class",LETTER_WORDS:"letter-words",COLLECTION_CONTENTS:"collection-contents",TAUGHT_CLASS_COUNT:"taught-class-count",MEMBERSHIP_LIST:"membership-list",MEMBERSHIP_EXAMPLE:"membership-example",SKOS_NEIGHBOURHOOD:"skos-neighbourhood",WHAT_ELSE:"what-else",FACT_SET:"fact-set",FACT_READBACK:"fact-readback"}),hX=Object.freeze(Object.values(mu))});function eh(e){return typeof e=="string"&&tM.test(e)}function xx(e){return!!e&&typeof e=="object"&&pr(e.s)}function th(e){return!!e&&typeof e=="object"&&e.kind==="fact"&&eh(e.world)&&pr(e.subject)&&pr(e.predicate)&&pr(e.object)}function nh(e){if(!e||typeof e!="object"||e.kind!=="rule"||!eh(e.world)||!pr(e.name)||!sM.has(e.ruleKind)||!e.slots||typeof e.slots!="object"||Array.isArray(e.slots))return!1;let t=Object.values(e.slots);return t.length>0&&t.every(pr)}function sh(e){return!!e&&typeof e=="object"&&e.kind==="meta"&&eh(e.world)&&pr(e.opening)}function jx(e){return th(e)||nh(e)||sh(e)}function kx(e){let t=e||[],n=t.filter(l=>l.predicate===oM).sort((l,u)=>`${l.subject}\0${l.object}`.localeCompare(`${u.subject}\0${u.object}`));if(!n.length)return t;let s=new Set(t.filter(l=>l.predicate==="rdf:type").map(l=>l.subject)),o=new Map;for(let l of t)l.predicate==="mgx:located-in"&&o.set(l.subject,l.object);let r=(l,u)=>t.some(d=>d.predicate==="rdf:type"&&d.object===l&&o.get(d.subject)===u),i=t.find(l=>typeof l.world=="string"&&l.kind==="fact"),a=(l,u,d)=>({...i?{world:i.world,kind:"fact"}:{},subject:l,predicate:u,object:d}),c=[];for(let l of n){let u=l.subject,d=l.object;if(r(d,u))continue;let p=d,f=1;for(;s.has(p);)f+=1,p=`${d}-${f}`;s.add(p),c.push(a(p,"rdf:type",d)),c.push(a(p,"rdf:type","portable")),c.push(a(p,"mgx:located-in",u))}return c.length?[...t,...c]:t}var tM,nM,sM,pr,oM,mr=M(()=>{tM=/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/,nM=Object.freeze(["action-signature","action-precond","action-effect","action-constraint"]),sM=new Set(nM),pr=e=>typeof e=="string"&&e.trim()!=="";oM="mgx:default-contains"});var rM,iM,wX,Na=M(()=>{rM=Object.freeze(["mgx:consumes","mgx:display-name","mgx:evades","mgx:guards","mgx:hasMass","mgx:is-predator","mgx:mass-drain-per-turn","mgx:model","mgx:pursues","mgx:vision-radius"]),iM=Object.freeze(new Set(["mgx:consumes","mgx:evades","mgx:guards","mgx:pursues"])),wX=Object.freeze(["mgx:consumes","mgx:evades","mgx:pursues"])});var hu=M(()=>{});var aM,cM,lM,uM,dM,fM,pM,mM,hM,gM,bM,wM,yM,$M,vM,SM,EM,xM,jM,EX,kM,Rx,xX,jX,_x=M(()=>{Xn();Pr();aM="subClassOf",cM="typeAssertion",lM="relation",uM="someValuesFrom",dM="cardinality",fM="disjointWith",pM="possessive",mM="adjective",hM="capability",gM="union",bM="complement",wM="negativeType",yM="enumeration",$M="differentFrom",vM="bareExistential",SM="transitiveRole",EM="inverseRole",xM="universal",jM="subPropertyOf",EX=Object.freeze([aM,cM,lM,uM,dM,fM,pM,mM,hM,gM,bM,wM,yM,$M,vM,SM,EM,xM,jM]),kM=new Set(["go","take","drop","open","unlock","close","give","look","talk","examine","dig","eat","put"]),Rx=new Map([["pick up","take"],["pick","take"],["grab","take"],["put down","drop"],["set down","drop"],["leave","drop"],["talk to","talk"],["speak to","talk"],["speak with","talk"],["talk","talk"],["speak","talk"],["chat with","talk"],["converse with","talk"],["look at","examine"],["examine","examine"],["inspect","examine"],["have a look at","examine"],["take a look at","examine"],["check out","examine"],["shut","close"]]),xX=Math.max(...[...Rx.keys()].map(e=>e.split(" ").length)),jX=[...new Set([...kM,...[...Rx.keys()].map(e=>e.split(" ")[0])])]});var hr=M(()=>{});var oh=M(()=>{Me();rs();hr()});function Wt({name:e,label:t,question:n,params:s=[],preconditions:o=[],add:r=[],del:i=[]}){return Object.freeze({type:Eo.Capability,name:e,label:t,question:n,readOnly:!0,parameters:Object.freeze(s),preconditions:Object.freeze(o),effects:Object.freeze({add:Object.freeze(r),del:Object.freeze(i)})})}var RM,Eo,je,_M,gr,ht,nn,mn,TM,Tx,Ut,AM,CM,Ax,IX,OX,NX,fi=M(()=>{RM=Object.freeze({cap:"urn:tmct:cap#",taught:"urn:tmct:taught#",mgx:"urn:tmct:mgx#",seon:"http://se-on.org/ontologies/seon.owl#"}),Eo=Object.freeze({Capability:"cap:Capability",Parameter:"cap:Parameter",Precondition:"cap:Precondition",Effect:"cap:Effect"}),je=Object.freeze({Symbol:"seon:CodeEntity",Module:"mgx:Module",Class:"seon:ClassType",MemoryTerm:"mgx:MemoryTerm",Query:"cap:FreeText",Kind:"cap:KindFilter",Package:"cap:PackageName"}),_M=Object.freeze([je.MemoryTerm]),gr=Object.freeze({graphLoaded:"cap:graph-loaded",resolves:"cap:resolves",anyPresent:"cap:any-present",memoryFacts:"cap:memory-facts"}),ht=(e,t,{arg:n=e,required:s=!0,note:o=""}={})=>Object.freeze({type:Eo.Parameter,name:e,kind:t,arg:n,required:s,note:o}),nn=()=>Object.freeze({type:Eo.Precondition,pred:gr.graphLoaded}),mn=(e,t)=>Object.freeze({type:Eo.Precondition,pred:gr.resolves,param:e,as:t}),TM=e=>Object.freeze({type:Eo.Precondition,pred:gr.anyPresent,params:Object.freeze([...e])}),Tx=()=>Object.freeze({type:Eo.Precondition,pred:gr.memoryFacts}),Ut=(e,t=null)=>Object.freeze({type:Eo.Effect,pred:"cap:knows",topic:e,of:t?`?${t}`:null});AM=Object.freeze([Wt({name:"tmct_search",label:"search",question:"lexical search across the graph",params:[ht("query",je.Query,{required:!1,note:"required unless a kind filter is given"}),ht("kind",je.Kind,{required:!1}),ht("name",je.Query,{required:!1}),ht("decorator",je.Query,{required:!1})],preconditions:[nn(),TM(["query","kind"])],add:[Ut("matches","query")]}),Wt({name:"tmct_describe",label:"describe",question:"a symbol's definition, kind and relations",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("description","symbol")]}),Wt({name:"tmct_signature",label:"signature",question:"a symbol's signature only",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("signature","symbol")]}),Wt({name:"tmct_impact",label:"impact",question:"what a change to this module or symbol reaches (impact closure)",params:[ht("module",je.Symbol,{note:"a Module, or any sited symbol \u2014 a fine-grained seed walks callsSymbol dependents and coarsens them to module grain"})],preconditions:[nn(),mn("module",je.Symbol)],add:[Ut("impact","module")]}),Wt({name:"tmct_members",label:"members",question:"the methods/attributes of a class",params:[ht("class",je.Class,{arg:"class"})],preconditions:[nn(),mn("class",je.Class)],add:[Ut("members","class")]}),Wt({name:"tmct_subclasses",label:"subclasses",question:"the subclasses of a class",params:[ht("class",je.Class,{arg:"class"})],preconditions:[nn(),mn("class",je.Class)],add:[Ut("subclasses","class")]}),Wt({name:"tmct_exports",label:"exports",question:"a module's public exports",params:[ht("module",je.Module)],preconditions:[nn(),mn("module",je.Module)],add:[Ut("exports","module")]}),Wt({name:"tmct_callers",label:"callers",question:"functions that call this symbol",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("callers","symbol")]}),Wt({name:"tmct_callees",label:"callees",question:"functions this symbol calls",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("callees","symbol")]}),Wt({name:"tmct_calls",label:"calls",question:"the call edges out of this symbol/module",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("calls","symbol")]}),Wt({name:"tmct_tests_for",label:"tests",question:"the tests covering this symbol",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("tests","symbol")]}),Wt({name:"tmct_untested",label:"untested",question:"symbols with no covering test",params:[],preconditions:[nn()],add:[Ut("untested",null)]}),Wt({name:"tmct_history",label:"history",question:"the commit history of this symbol",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("history","symbol")]}),Wt({name:"tmct_cochanges",label:"cochanges",question:"symbols that change together with this one",params:[ht("symbol",je.Symbol)],preconditions:[nn(),mn("symbol",je.Symbol)],add:[Ut("cochanges","symbol")]}),Wt({name:"tmct_architecture",label:"arch",question:"the architecture overview (optional package filter)",params:[ht("package",je.Package,{required:!1})],preconditions:[nn()],add:[Ut("architecture","package")]}),Wt({name:"tmct_related",label:"related",question:"a term's synonyms and related concepts (the SKOS view over the conversational-memory graph)",params:[ht("term",je.MemoryTerm,{note:"a concept term, matched against memory relation facts rather than resolved in the code graph"})],preconditions:[Tx(),mn("term",je.MemoryTerm)],add:[Ut("related","term")]}),Wt({name:"tmct_sprite",label:"sprite",question:"the sprite for a class, with the expression and size asked for",params:[ht("class",je.MemoryTerm,{arg:"class",note:"a world class, matched against the memory graph's own fact rows rather than resolved in the code graph"}),ht("expression",je.Kind,{required:!1,note:"one of sprite-expressions.mjs's palette words, carried as an mgx:feels fact"}),ht("size",je.Kind,{required:!1,note:"a taught mgx:hasProperty size word, resolved to a render scale \u2014 not a template tier"})],preconditions:[Tx(),mn("class",je.MemoryTerm)],add:[Ut("sprite","class")]})]),CM=e=>Object.freeze(e.reduce((t,n)=>(t[n.name]=n,t),Object.create(null))),Ax=AM,IX=CM(Ax),OX=Object.freeze({tmct_context:"unbounded edit-context bundle (multi-file); needs a size/budget precondition",tmct_context_more:"unbounded context continuation; same as tmct_context",tmct_snippet:"raw source-file read (reads the filesystem); needs a file-read + span precondition",tmct_ask:"the plain-English question entry point itself \u2014 calls ask.mjs directly and bypasses the capability planner; not one of the planner's operators",tmct_export:"reads the memory store's whole fact set with no discriminating param and no resolver goal frame; needs NL-reachability wiring before it can join",tmct_ingest:"writes into the memory store (grounds facts); capability() only models read-only operators, so a write path needs its own precondition/effect design first",tmct_file_history:"a module-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_method_history:"a method-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet",tmct_class_history:"a class-grain cut of the same history edge tmct_history already models; no NL frame distinguishes the granularities yet"}),NX=Object.freeze({prefixes:RM,vocab:Eo,kinds:je,precond:gr,get capabilities(){return Ax}})});var rh=M(()=>{fi()});var gu=M(()=>{Cn()});var ih=M(()=>{fi()});function PM(e){let t={};for(let n of String(e).toLowerCase().match(/[a-z]+/g)||[])!t.expression&&Object.hasOwn(so,n)&&(t.expression=n),!t.size&&$a([{predicate:LM,object:n}])!==1&&(t.size=n);return t}var n8,s8,o8,r8,LM,i8,ah=M(()=>{rs();ns();Ul();Ye();Me();Ja();ym();fi();ih();n8=new RegExp(`\\b(?:${Object.keys(es).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s+")).join("|")})\\b`,"i"),s8=Object.freeze({"reverse:calls":{topic:"callers",arg:"symbol"},"forward:calls":{topic:"callees",arg:"symbol"},"reverse:tests":{topic:"tests",arg:"symbol"},"forward:tests":{topic:"tests",arg:"symbol"},"reverse:inherits":{topic:"subclasses",arg:"class"},"forward:reexports":{topic:"exports",arg:"module"},"forward:contains":{topic:"members",arg:"class"},"when:touches":{topic:"history",arg:"symbol"},"forward:cochange":{topic:"cochanges",arg:"symbol"},"reverse:cochange":{topic:"cochanges",arg:"symbol"}}),o8=Object.freeze({imports:"no importer/imports query tool in the registry (there is no tmct_imports); refusing beats mis-routing to calls",uses:"a query-side UNION (imports+calls+callsSymbol) with no single capability; a router that must emit ONE call cannot honour it \u2014 refuse",defines:"Module->symbol `defines` has no dedicated capability (tmct_members is Class-scoped `contains`); refuse rather than answer a different grain",serves:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool",denotes:"a provider-declared edge with no capability in the registry; the ask lane traverses it directly, so refusing here beats mis-routing to a code-grain tool"}),r8=Object.freeze({}),LM="mgx:hasProperty";i8=Object.freeze([{re:/\buntested\b|\bwithout\s+(?:a\s+)?tests?\b|\bhas\s+no\s+tests?\b|\bneeds?\s+(?:a\s+)?tests?\b/i,topic:"untested",noArg:!0,skipIfSuperlative:!0},{re:/\bblast\s*radius\b|\bimpacts?\b|\bimpacted\b|what\s+(?:a\s+)?change.*(?:reach|affect|touch)|what\s+(?:depends?\s+on|dependents?)\b/i,topic:"impact",arg:"module"},{re:/\bcall[\s-]*edges?\b|\bcall[\s-]*graph\b|\boutgoing\s+calls?\b|\bcall[\s-]*sites?\s+(?:of|in|out|from)\b/i,topic:"calls",arg:"symbol"},{re:/\bcallees?\b|wh(?:at|o)\s+does\s+\S+\s+call\b/i,topic:"callees",arg:"symbol"},{re:/\bcallers?\b|who\s+calls\b|what\s+calls\b/i,topic:"callers",arg:"symbol"},{re:/\btests?\b.*\b(?:for|cover|covering|of)\b|which\s+tests?\b|covers?\b|covered\b|test\s+coverage\b/i,topic:"tests",arg:"symbol"},{re:/\bcochang|change[- ]coupl/i,topic:"cochanges",arg:"symbol"},{re:/\bexports?\b|\bpublic\s+api\b/i,topic:"exports",arg:"module"},{re:/\bsubclasses?\b|children\s+of\b|\bextends?\b/i,topic:"subclasses",arg:"class"},{re:/\bmembers?\b|\bmethods?\s+of\b|\battributes?\s+of\b/i,topic:"members",arg:"class"},{re:/\bhistory\b|who\s+changed\b|commits?\s+(?:that\s+)?touch/i,topic:"history",arg:"symbol"},{re:/\bsignature\b/i,topic:"signature",arg:"symbol"},{re:/\bsynonyms?\b|\banother\s+word\s+for\b|\brelated\s+(?:words?|concepts?|to)\b/i,topic:"related",arg:"term"},{re:/\bsprite\b|\bicon\b|\bavatar\b|\bpicture\s+of\b|\bwhat\s+does\s+.+\s+look\s+like\b/i,topic:"sprite",arg:"class",slots:PM},{re:/\bdescribe\b|\bexplain\b|what\s+is\b|tell\s+me\s+about\b|definition\s+of\b/i,topic:"description",arg:"symbol"},{re:/\bsearch\b|\bfind\b|look\s+for\b/i,topic:"matches",arg:"query"}])});var Ox=M(()=>{});var FM,Nx=M(()=>{ah();fi();ih();Ox();rs();FM=Object.freeze([Object.freeze({id:"coverage-invariant",kind:"maintenance",invariant:"an impactful module must be tested",focusClass:"Module",modes:Object.freeze(["scoped","global"]),subGoals:Object.freeze(["impact","untested"]),priorityTopic:"impact",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"untested"}),b:Object.freeze({topic:"impact",of:"focus",withFocus:!0}),names:"the change's untested footprint",empty:"no coverage gap"}),achieves:"coverage-gap"}),Object.freeze({id:"cochange-risk-invariant",kind:"maintenance",invariant:"a module change-coupled with the focus must be tested",focusClass:"Module",modes:Object.freeze(["scoped"]),subGoals:Object.freeze(["cochanges","untested"]),priorityTopic:"cochanges",coverageTopic:"untested",compose:Object.freeze({op:"intersect",a:Object.freeze({topic:"cochanges",of:"focus"}),b:Object.freeze({topic:"untested"}),names:"the change-coupled untested set",empty:"every change-coupled module is tested"}),achieves:"cochange-risk"})])});var bu=M(()=>{hu();gu();ah();Nx();fi();rh()});function BM(e=process.env){return e?.TMCT_WORLDS_PACK_DIR||ne(zM,"corpus","worlds")}function Lx(e){try{return Ra(cr(e))}catch{return null}}function Px(e){if(lh.has(e))return lh.get(e);let t=null,n=Lx(ne(e,"index.json.gz"));if(n)try{let s=JSON.parse(n.toString("utf8"));s&&typeof s=="object"&&!Array.isArray(s)&&(t=s)}catch{}return lh.set(e,t),t}function UM(e,t){let n=Px(e);if(!n)return null;let s=n[String(t??"")];if(!xx(s))return null;let o=`${e}\0${t}`;if(uh.has(o))return uh.get(o);let r=null,i=Lx(ne(e,"shards",`${s.s}.jsonl.gz`));if(i){let a=[],c=[],l=null;for(let u of i.toString("utf8").split(`
171
+ `))if(u.trim())try{let d=JSON.parse(u);if(!jx(d)||d.world!==t)continue;th(d)?a.push(d):nh(d)?c.push(d):sh(d)&&!l&&(l=d)}catch{}(a.length||c.length||l)&&(r={name:t,facts:kx(a),rules:c,meta:l})}return uh.set(o,r),r}var GM,zM,lh,uh,WM,A8,wu=M(()=>{lr();au();vo();Qe();mr();GM={},zM=ne($e(Yt(GM.url)),"..","..","..");lh=new Map,uh=new Map;WM=e=>({list:async()=>{let t=Px(e());return t?Object.keys(t).sort():null},load:async t=>UM(e(),t)}),A8=WM(()=>BM())});var D8,Mx=M(()=>{Lt();Qe();Kn();ji();Cn();Ue();D8=ne(".tmct","memory","blocks")});var Fx=M(()=>{hr()});var zx=M(()=>{Kn();ji();hr()});var dh=M(()=>{Kn();ji();hr()});var Bx=M(()=>{dh();Kn();Ts();hr()});var Ux=M(()=>{});var Wx=M(()=>{Fx();zx();dh();Bx();Ux();hr()});var Gx=M(()=>{Mx();Ue();Nc();Zl();Wx();oh()});function pi(e,t){let n=parseInt(e.slice(1),16);return`rgba(${n>>16&255}, ${n>>8&255}, ${n&255}, ${t})`}function $u(e){let t=n=>qM.map((s,o)=>`--${n}-t${o+1}: ${pi(e[n],s)};`).join(" ");return[`--bg: ${e.bg}; --ink: ${e.ink}; --muted: ${e.muted}; --line: ${e.line}; --card: ${e.card};`,`--taught: ${e.taught}; --corpus: ${e.corpus}; --entail: ${e.entail}; --alert: ${e.alert};`,t("taught"),t("corpus"),t("entail"),`--taught-soft: ${pi(e.taught,.12)}; --corpus-soft: ${pi(e.corpus,.12)};`,`--entail-soft: ${pi(e.entail,.14)}; --alert-soft: ${pi(e.alert,.12)};`,`--sprite-pop: drop-shadow(0 0 .6px ${pi(e.ink,e.popRimAlpha)}) drop-shadow(${e.popShadow});`].join(" ")}var yu,qM,C6,fh=M(()=>{uu();yu=Object.freeze({light:Object.freeze({bg:"#F7F6F2",ink:"#23272B",muted:"#6E7168",line:"#DDD9D0",card:"#FFFFFF",taught:"#2E7D4F",corpus:"#5A80AC",entail:"#B07C2E",alert:"#B0503F",popRimAlpha:.66,popShadow:"0 1px 1.2px rgba(0, 0, 0, .30)"}),dark:Object.freeze({bg:"#15181C",ink:"#E7E5DF",muted:"#9A9E95",line:"#2B3036",card:"#1C2126",taught:"#5FBE8B",corpus:"#6C93BF",entail:"#D9A554",alert:"#D08070",popRimAlpha:.45,popShadow:"0 1px 1.4px rgba(0, 0, 0, .55)"})}),qM=[.35,.65,1];C6=`
172
+ :root { color-scheme: light dark; ${$u(yu.light)} }
173
+ @media (prefers-color-scheme: dark) { :root { ${$u(yu.dark)} } }
174
+ :root[data-theme="dark"] { ${$u(yu.dark)} }
175
+ :root[data-theme="light"] { ${$u(yu.light)} }
176
+ `});var Vx=M(()=>{fh()});var Kx=M(()=>{fh()});var qx=M(()=>{Ue();mr();In();mi()});var Xx=M(()=>{Ts();Ue();hu();bu();mi()});var mh,nF,sF,oF,rF,iF,aF,TJ,AJ,mi=M(()=>{mr();Na();hu();_x();Xn();ql();oh();rh();bu();gu();wu();Ue();Gx();Vx();Kx();qx();Xx();mh="mgx:world-epoch",nF=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:hidden-in"]),sF=new Set(["mgx:on-top-of","mgx:on-plane","mgx:under"]),oF="mgx:is-open",rF="mgx:hasMass",iF="mgx:knows-about",aF="mgx:display-name",TJ=new Set([...nF,...sF,oF,rF,iF,aF,"rdf:type",mh]),AJ=new RegExp("^(?:what\\s+foods?\\s+(?:do\\s+you\\s+know(?:\\s+about)?|have\\s+you\\s+(?:found|seen|heard\\s+(?:about|of))|do\\s+you\\s+know\\s+of)|what\\s+do\\s+you\\s+know\\s+about\\s+(?:any\\s+)?foods?|do\\s+you\\s+know\\s+(?:about|of)\\s+(?:any\\s+)?foods?|where\\s+is\\s+(?:the\\s+)?food)[?.!\\s]*$","i")});var hi,IJ,OJ,NJ,LJ,PJ,MJ,xo=M(()=>{hi=Object.freeze({spiderFly:Object.freeze({spiderInitialMass:15,spiderMassDecrementPerTurn:.5,flyInitialMass:10,flyMassDecrementPerTurn:1,spiderVisionRadius:4,flyVisionRadius:4,eggHatchDelayTurns:3,flySpawnIntervalTurns:3,eggLayMassThreshold:25,eggHatchCount:2,minHatchlingMass:3,webDurationTurns:10}),mud:Object.freeze({moleInitialMass:8,moleMassDecrementPerTurn:.06,moleSpeed:1,moleDigReach:1,voleInitialMass:6,voleMassDecrementPerTurn:.05,voleSpeed:1,voleDigReach:1,badgerInitialMass:20,badgerMassDecrementPerTurn:.08,badgerSpeed:2,badgerDigReach:2,groundhogInitialMass:12,groundhogMassDecrementPerTurn:.06,groundhogSpeed:2,groundhogDigReach:2,meerkatInitialMass:9,meerkatMassDecrementPerTurn:.05,meerkatSpeed:1,meerkatDigReach:1}),mudiii:Object.freeze({predatorInitialMass:20,predatorMassDecrementPerTurn:.08,predatorVisionRadius:4,preyInitialMass:8,preyMassDecrementPerTurn:.06,preyVisionRadius:3,preySpawnIntervalTurns:5,foodSpawnIntervalTurns:3,spawnedFoodMass:2,placedFoodMass:2,maxPreyPopulation:6,maxFoodItems:8,foodVisionGated:!0,blendPreyDecision:!1,preyThreatWeight:.5,teach:!1}),guessNumber:Object.freeze({defaultLo:1,defaultHi:100,maxBound:1e9}),adventure:Object.freeze({teach:!1}),planning:Object.freeze({maxDepth:300})}),IJ=Object.freeze({spider_initial_mass:"spiderInitialMass",spider_mass_decrement_per_turn:"spiderMassDecrementPerTurn",fly_initial_mass:"flyInitialMass",fly_mass_decrement_per_turn:"flyMassDecrementPerTurn",spider_vision_radius:"spiderVisionRadius",fly_vision_radius:"flyVisionRadius",egg_hatch_delay_turns:"eggHatchDelayTurns",fly_spawn_interval_turns:"flySpawnIntervalTurns",egg_lay_mass_threshold:"eggLayMassThreshold",egg_hatch_count:"eggHatchCount",min_hatchling_mass:"minHatchlingMass",web_duration_turns:"webDurationTurns"}),OJ=Object.freeze({mole_initial_mass:"moleInitialMass",mole_mass_decrement_per_turn:"moleMassDecrementPerTurn",mole_speed:"moleSpeed",mole_dig_reach:"moleDigReach",vole_initial_mass:"voleInitialMass",vole_mass_decrement_per_turn:"voleMassDecrementPerTurn",vole_speed:"voleSpeed",vole_dig_reach:"voleDigReach",badger_initial_mass:"badgerInitialMass",badger_mass_decrement_per_turn:"badgerMassDecrementPerTurn",badger_speed:"badgerSpeed",badger_dig_reach:"badgerDigReach",groundhog_initial_mass:"groundhogInitialMass",groundhog_mass_decrement_per_turn:"groundhogMassDecrementPerTurn",groundhog_speed:"groundhogSpeed",groundhog_dig_reach:"groundhogDigReach",meerkat_initial_mass:"meerkatInitialMass",meerkat_mass_decrement_per_turn:"meerkatMassDecrementPerTurn",meerkat_speed:"meerkatSpeed",meerkat_dig_reach:"meerkatDigReach"}),NJ=Object.freeze({predator_initial_mass:"predatorInitialMass",predator_mass_decrement_per_turn:"predatorMassDecrementPerTurn",predator_vision_radius:"predatorVisionRadius",prey_initial_mass:"preyInitialMass",prey_mass_decrement_per_turn:"preyMassDecrementPerTurn",prey_vision_radius:"preyVisionRadius",prey_spawn_interval_turns:"preySpawnIntervalTurns",food_spawn_interval_turns:"foodSpawnIntervalTurns",spawned_food_mass:"spawnedFoodMass",placed_food_mass:"placedFoodMass",max_prey_population:"maxPreyPopulation",max_food_items:"maxFoodItems",food_vision_gated:"foodVisionGated",blend_prey_decision:"blendPreyDecision",prey_threat_weight:"preyThreatWeight",teach:"teach"}),LJ=Object.freeze({teach:"teach"}),PJ=Object.freeze({default_lo:"defaultLo",default_hi:"defaultHi",max_bound:"maxBound"}),MJ=Object.freeze({max_depth:"maxDepth"})});var Zx,cF,Su,lF,uF,ej,tj,dF,fF,zJ,pF,mF,nj=M(()=>{xo();Zx="spider-fly",cF=10,Su=Object.freeze({x:2,y:2}),lF=1,uF=Object.freeze({predator:Object.freeze({role:"predator",kind:"spider",idPrefix:"spider",hunts:"prey"}),prey:Object.freeze({role:"prey",kind:"fly",idPrefix:"fly",hunts:null}),food:null}),ej=(e,t)=>`cell-${e}-${t}`,tj=(e,t,n,s)=>Math.max(Math.abs(e-n),Math.abs(t-s)),dF=(e,t)=>tj(e,t,Su.x,Su.y)<=lF,fF=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),zJ=Object.freeze([Object.freeze(["poodle","dog"]),Object.freeze(["sheepdog","dog"]),Object.freeze(["dog","animal"]),Object.freeze(["spider","arachnid"]),Object.freeze(["arachnid","animal"]),Object.freeze(["fly","insect"]),Object.freeze(["insect","animal"])]),pF="a spider waits in its web; a fly drifts in from the edge of the board. Neither is yours to move. Watch, or address one by name in chat.",mF=Object.freeze({name:Zx,gridSize:cF,opening:pF,boardNoun:"board",boardSubject:"board",cast:Object.freeze({predators:1,prey:1}),props:Object.freeze([]),staticWebAt:dF,webHomeCell:ej(Su.x,Su.y)})});var sj,aj,WJ,GJ,VJ,hh,oj,rj,ij,gh,KJ,HJ,Eu=M(()=>{xo();sj=Object.freeze({predator:"fox",prey:"goblin",spawnedFood:"crumb",placedFood:"morsel"}),aj=Object.freeze({north:Object.freeze({dx:0,dy:-1}),south:Object.freeze({dx:0,dy:1}),east:Object.freeze({dx:1,dy:0}),west:Object.freeze({dx:-1,dy:0})}),WJ=Object.freeze(["north","northeast","east","southeast","south","southwest","west","northwest"]),GJ=Object.freeze(["blacksmith","bush","cart","fence","house","inn","oak","stall","well"]),VJ=Object.freeze([sj.spawnedFood,sj.placedFood]),hh=e=>Object.freeze({...e,props:Object.freeze(e.props.map(t=>Object.freeze(t))),cast:Object.freeze(e.cast)}),oj=hh({name:"town-square",gridSize:12,opening:"a fox prowls the town square; goblins pick over the stalls for scraps. Neither is yours to move. Watch, or address one by name in chat.",cast:{predators:1,prey:3},props:[{id:"house-1",model:"house-1",cell:"cell-8-1",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-8-2",rotation:"180"},{id:"house-3",model:"house-3",cell:"cell-8-3",rotation:"180"},{id:"well-1",model:"well",cell:"cell-6-7",rotation:"0"},{id:"stall-1",model:"market-stall-1",cell:"cell-3-9",rotation:"90"},{id:"inn-1",model:"inn",cell:"cell-11-10",rotation:"270"}]}),rj=hh({name:"town-square-market",gridSize:10,opening:"market day in the town square: two rows of stalls, goblins working the lanes between them, and a fox somewhere among the crowd.",cast:{predators:1,prey:4},props:[{id:"stall-1",model:"market-stall-1",cell:"cell-2-4",rotation:"0"},{id:"stall-2",model:"market-stall-2",cell:"cell-3-4",rotation:"0"},{id:"stall-3",model:"market-stall-1",cell:"cell-4-4",rotation:"0"},{id:"stall-4",model:"market-stall-2",cell:"cell-6-4",rotation:"0"},{id:"stall-5",model:"market-stall-1",cell:"cell-7-4",rotation:"0"},{id:"stall-6",model:"market-stall-2",cell:"cell-8-4",rotation:"0"},{id:"stall-7",model:"market-stall-2",cell:"cell-2-7",rotation:"180"},{id:"stall-8",model:"market-stall-1",cell:"cell-3-7",rotation:"180"},{id:"stall-9",model:"market-stall-2",cell:"cell-4-7",rotation:"180"},{id:"stall-10",model:"market-stall-1",cell:"cell-6-7",rotation:"180"},{id:"stall-11",model:"market-stall-2",cell:"cell-7-7",rotation:"180"},{id:"stall-12",model:"market-stall-1",cell:"cell-8-7",rotation:"180"},{id:"well-1",model:"well",cell:"cell-5-5",rotation:"0"},{id:"blacksmith-1",model:"blacksmith",cell:"cell-10-5",rotation:"270"},{id:"cart-1",model:"cart",cell:"cell-1-1",rotation:"90"},{id:"cart-2",model:"cart",cell:"cell-10-10",rotation:"270"},{id:"bush-1",model:"bush",cell:"cell-10-1",rotation:"0"},{id:"bush-2",model:"bush",cell:"cell-1-10",rotation:"0"}]}),ij=hh({name:"town-square-chapel",gridSize:14,opening:"the chapel corner of the town square, fenced to the south and shaded by three oaks. Two foxes hunt here, and two goblins know it.",cast:{predators:2,prey:2},props:[{id:"inn-1",model:"inn",cell:"cell-2-2",rotation:"180"},{id:"house-1",model:"house-1",cell:"cell-3-2",rotation:"180"},{id:"house-2",model:"house-2",cell:"cell-2-3",rotation:"90"},{id:"fence-1",model:"fence",cell:"cell-7-11",rotation:"0"},{id:"fence-2",model:"fence",cell:"cell-8-11",rotation:"0"},{id:"fence-3",model:"fence",cell:"cell-9-11",rotation:"0"},{id:"oak-1",model:"oak-tree",cell:"cell-12-4",rotation:"0"},{id:"oak-2",model:"oak-tree",cell:"cell-12-12",rotation:"90"},{id:"oak-3",model:"oak-tree",cell:"cell-5-8",rotation:"180"}]}),gh=Object.freeze({[oj.name]:oj,[rj.name]:rj,[ij.name]:ij}),KJ=Object.freeze(Object.keys(gh)),HJ=Object.freeze([Object.freeze(["fox","canine"]),Object.freeze(["canine","animal"]),Object.freeze(["goblin","humanoid"]),Object.freeze(["humanoid","creature"]),Object.freeze(["creature","animal"]),Object.freeze(["crumb","food"]),Object.freeze(["morsel","food"]),Object.freeze(["food","thing"]),Object.freeze(["prop","thing"])])});var bh=M(()=>{});var cj=M(()=>{});var Pa,y9,EF,xF,jF,kF,RF,_F,TF,AF,CF,IF,OF,NF,LF,PF,MF,FF,DF,$9,wh=M(()=>{Eu();bh();Ts();Ue();mr();cj();Ye();xo();Na();mi();Pa=Object.freeze({predator:{role:"predator",kind:"fox",idPrefix:"fox",hunts:"prey"},prey:{role:"prey",kind:"goblin",idPrefix:"goblin",hunts:null},food:{spawnedKind:"crumb",placedKind:"morsel"}}),y9=Object.freeze(["predator","prey"]),EF="mgx:currently-in",xF="mgx:hasMass",jF="mgx:feels",kF="mgx:facing",RF="mgx:driven-facing",_F="mgx:eaten-by",TF="mgx:starved",AF="mgx:placed-by",CF="mgx:model",IF="mgx:rotation",OF="mgx:carrying",NF="mgx:prey-eaten",LF="mgx:web-built-at-turn",PF="mgx:laid-at-turn",MF="mgx:hatched-into",FF="mgx:turn-played",DF=new Set([EF,xF,jF,kF,RF,_F,TF,AF,CF,IF,FF,OF,NF,LF,PF,MF,"rdf:type",mh]),$9=Object.freeze([...DF].sort())});var F9,D9,uj=M(()=>{nj();Eu();wh();mr();wu();Ue();xo();F9=new RegExp("^@(spider|fly)(?:-(\\d+))?[,:]?\\s+the\\s+(spider|fly)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),D9=Object.freeze({"catch-prey":"caught","eat-agent":"eaten",starve:"starved","lay-egg":"laid","hatch-egg":"hatched","spawn-prey":"spawned"})});var hQ,gQ,bQ,wQ,yQ,$Q,vQ,WF,GF,VF,KF,dj,fj,HF,SQ,EQ,pj=M(()=>{Eu();wh();mi();In();mr();wu();Ue();xo();Na();bh();gu();Ts();hQ=Pa.predator.kind,gQ=Pa.prey.kind,bQ=Pa.food.spawnedKind,wQ=Pa.food.placedKind,yQ=Object.freeze(new Set(["river-crossing"])),$Q=new RegExp("^@(fox|goblin)(?:-(\\d+))?[,:]?\\s+the\\s+(fox|goblin|crumb|morsel)(?:-(\\d+))?\\s+is\\s+(?:(north|south|east|west)|at\\s+(cell-\\d+-\\d+))[.!?\\s]*$","i"),vQ=new RegExp("^who\\s+(?:put|placed|dropped)\\s+(?:(?:the\\s+)?(morsel|crumb)(?:-(\\d+))?|(?:(?:the\\s+)?(?:food|morsel|crumb|that|it)\\s+)?(?:at|on)\\s+(cell-\\d+-\\d+))(?:\\s+there)?[?.!\\s]*$","i"),WF="mgx:currently-in",GF="mgx:hasMass",VF="mgx:feels",KF="mgx:facing",dj="(fox|goblin|crumb|morsel)(?:-(\\d+))?",fj="(fox|goblin)(?:-(\\d+))?",HF="(crumb|morsel)(?:-(\\d+))?",SQ=[{kind:"placement",predicate:WF,re:new RegExp(`^(?:the\\s+)?${dj}\\s+is\\s+at\\s+(cell-\\d+-\\d+)[.!\\s]*$`,"i")},{kind:"mass",predicate:GF,re:new RegExp(`^(?:the\\s+)?${dj}\\s+weighs\\s+(\\d+(?:\\.\\d+)?)[.!\\s]*$`,"i")},{kind:"mood",predicate:VF,re:new RegExp(`^(?:the\\s+)?${fj}\\s+feels\\s+(calm|angry|scared|happy)[.!\\s]*$`,"i")},{kind:"facing",predicate:KF,re:new RegExp(`^(?:the\\s+)?${fj}\\s+faces\\s+(north|south|east|west)[.!\\s]*$`,"i")}],EQ=new RegExp(`^(?:the\\s+)?([a-z][a-z-]*)\\s+(?:put|placed|dropped)\\s+(?:the\\s+)?${HF}\\s+there[.!\\s]*$`,"i")});var mj=M(()=>{Na()});var jt,AQ,CQ,IQ,OQ,NQ,LQ,PQ,MQ,FQ,DQ,zQ,BQ,UQ,WQ,GQ,VQ,KQ,HQ,qF,hj=M(()=>{jt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},AQ=jt("createRequire"),CQ=jt("readFileSync"),IQ=jt("access"),OQ=jt("readFile"),NQ=jt("writeFile"),LQ=jt("appendFile"),PQ=jt("mkdir"),MQ=jt("mkdtemp"),FQ=jt("rename"),DQ=jt("unlink"),zQ=jt("rm"),BQ=jt("stat"),UQ=jt("copyFile"),WQ=jt("readdir"),GQ=jt("createReadStream"),VQ=jt("createWriteStream"),KQ=jt("randomBytes"),HQ=jt("spawnSync"),qF=jt("createInterface")});var kt,YQ,XQ,JQ,QQ,ZQ,e7,t7,n7,s7,o7,r7,i7,a7,c7,l7,u7,d7,gj,f7,yh=M(()=>{kt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},YQ=kt("createRequire"),XQ=kt("readFileSync"),JQ=kt("access"),QQ=kt("readFile"),ZQ=kt("writeFile"),e7=kt("appendFile"),t7=kt("mkdir"),n7=kt("mkdtemp"),s7=kt("rename"),o7=kt("unlink"),r7=kt("rm"),i7=kt("stat"),a7=kt("copyFile"),c7=kt("readdir"),l7=kt("createReadStream"),u7=kt("createWriteStream"),d7=kt("randomBytes"),gj=kt("spawnSync"),f7=kt("createInterface")});var bj=M(()=>{yh();Qe();Lt();Qe();la();Qt()});var wj=M(()=>{});var YF,yj=M(()=>{Lt();Qe();Ue();wj();YF=ne(".tmct","sessions")});var $j=M(()=>{Lt();Qe();Yl()});var vj,xu,Sj=M(()=>{vj=Object.freeze({countNouns:{class:"Class",classes:"Class",function:"Function",functions:"Function",func:"Function",funcs:"Function",module:"Module",modules:"Module",file:"Module",files:"Module",package:"Package",packages:"Package",method:"Method",methods:"Method",attribute:"Attribute",attributes:"Attribute",variable:"GlobalVariable",variables:"GlobalVariable",global:"GlobalVariable",globals:"GlobalVariable",commit:"Commit",commits:"Commit",session:"Session",sessions:"Session"},classLabels:{Class:["class","classes"],Function:["function","functions"],Module:["module","modules"],Package:["package","packages"],Method:["method","methods"],Attribute:["attribute","attributes"],GlobalVariable:["variable","variables"],Commit:["commit","commits"],Session:["session","sessions"]},helpRows:[["/find <query>","lexical search across the graph"],["/search <query>","alias of /find"],["/context <symbol>","the sized edit bundle for a symbol (start here to change code)"],["/snippet <symbol>","exact source of one function/class/method"],["/describe <symbol>","a symbol's definition, kind and relations"],["/signature <symbol>","a symbol's signature only"],["/members <class>","the methods/attributes of a class"],["/subclasses <class>","the subclasses of a class"],["/impact <module>","what a change to this module or symbol reaches (impact closure)"],["/callers <symbol>","functions that call this symbol"],["/callees <symbol>","functions this symbol calls"],["/tests <symbol>","the tests covering this symbol"],["/untested","symbols with no covering test"],["/history <symbol>","the commit history of this symbol"],["/exports <module>","a module's public exports"],["/arch [package]","the architecture overview (optional package filter)"]],missRecoveryPointer:"for code structure, index this repo with `tmct index`, or point me at a .tmct/graph.json with --repo <path> (or try `npm run example:mini`)."}),xu=Object.freeze({countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""})});var Rt,O7,N7,L7,P7,M7,F7,D7,z7,B7,U7,W7,G7,V7,K7,H7,q7,Y7,X7,Ej,xj=M(()=>{Rt=e=>()=>{throw new Error(e+" unavailable in the browser ask bundle")},O7=Rt("createRequire"),N7=Rt("readFileSync"),L7=Rt("access"),P7=Rt("readFile"),M7=Rt("writeFile"),F7=Rt("appendFile"),D7=Rt("mkdir"),z7=Rt("mkdtemp"),B7=Rt("rename"),U7=Rt("unlink"),W7=Rt("rm"),G7=Rt("stat"),V7=Rt("copyFile"),K7=Rt("readdir"),H7=Rt("createReadStream"),q7=Rt("createWriteStream"),Y7=Rt("randomBytes"),X7=Rt("spawnSync"),Ej=Rt("createInterface")});var Tj={};Nt(Tj,{CONTEXT_PASSAGE_PREDICATE:()=>kj,CO_OCCURS_PREDICATE:()=>ju,ingestUnknownFromAssertions:()=>QF,knownTermsFrom:()=>Rj,passageFor:()=>_j});function Rj(e,t){let n=new Set;for(let s of e?.individuals||[]){if(s?.class!==Ze)continue;let o=a=>(s.attributes||[]).find(c=>c?.key===a)?.value,r=o("subject"),i=o("object");r&&n.add(V(r)),i&&n.add(V(i))}for(let s of t||[])s?.subject&&n.add(V(s.subject)),s?.object&&n.add(V(s.object));return n}function _j(e,t){let n=e?.surfaceText;if(typeof n=="string"&&n.trim())return n.replace(/\[\[([^\]]+)\]\]/g,"$1").replace(/\s+/g," ").trim();let s=jo(e?.start),o=jo(e?.end);return t?.surface&&s&&o?t.surface.replace("{start}",s).replace("{end}",o):null}function JF(e,t,n){let s=String(e||"").toLowerCase().replace(/[^a-z0-9\s]/g," ").split(/\s+/).filter(Boolean),o=[],r=new Set;for(let i=0;i<s.length&&o.length<jj;i+=1){let a=[s[i]];i+1<s.length&&a.push(`${s[i]} ${s[i+1]}`);for(let c of a)if(!(XF.has(c)||r.has(c)||n.has(c))&&t.has(c)&&(o.push(c),r.add(c),o.length>=jj))break}return o}async function QF(e,{assertions:t,map:n,mappedFacts:s=[],memory:o,provenancePrefix:r="corpus:unknown",limit:i=500}={}){if(!Array.isArray(t)||!n)return{captured:0,linked:0,appended:0,skipped:0};let a=o||await ct(e),c=Rj(a,s),l=new Set,u=[];for(let f of t){if(l.size>=i)break;let m=n.get(f.rel);if(!m||m.ace!=="none")continue;let h=jo(f.start),b=jo(f.end);if(!h||!b)continue;let g=V(h),w=V(b),y=!c.has(g),v=!c.has(w);if(!y&&!v)continue;let R=_j(f,m);if(!R)continue;let S=[[h,b,y],[b,h,v]];for(let[j,I,x]of S){if(!x||l.size>=i)continue;let _=V(j);if(l.has(_))continue;let $=`${r} ${f.rel}`;u.push({subject:j,predicate:kj,object:R,provenance:$}),u.push({subject:j,predicate:ju,object:I,provenance:$});let T=JF(R,c,new Set([g,w]));for(let C of T)u.push({subject:j,predicate:ju,object:C,provenance:$});l.add(_),c.add(_)}}if(!u.length)return{captured:0,linked:0,appended:0,skipped:0};let d=await Yn(e,u),p=u.filter(f=>f.predicate===ju).length;return{captured:l.size,linked:p,appended:d.appended,skipped:d.skipped}}var kj,ju,XF,jj,Aj=M(()=>{Ue();ku();kj="mgx:contextPassage",ju="mgx:coOccursWith",XF=new Set(["a","an","the","is","are","was","were","be","being","been","to","of","for","in","on","at","with","by","as","and","or","that","this","it","its","you","your","related","kind","used"]),jj=3});var Cj={};Nt(Cj,{MAP_FILE:()=>Fa,SEON_CONCEPTS_FILE:()=>Ru,SEON_DEFINITIONS_FILE:()=>ZF,SLICE_FILE:()=>Ma,TIER2_DIR:()=>vs,TIER2_MANIFEST_FILE:()=>eD,WORDNET_DIR:()=>Da,loadMap:()=>Tu,loadSlice:()=>_u,seedMemory:()=>nD,termText:()=>jo,toFacts:()=>Au});async function _u(e=Ma){let t=Ej({input:OE(e,"utf8"),crlfDelay:1/0}),n=[],s=0;for await(let o of t){s+=1;let r=o.trim();if(!r)continue;let i;try{i=JSON.parse(r)}catch(a){throw new Error(`${e}:${s}: not valid JSON: ${a.message}`)}for(let a of["start","rel","end"])if(typeof i[a]!="string"||!i[a])throw new Error(`${e}:${s}: assertion missing "${a}"`);n.push(i)}return n}async function Tu(e=Fa){let n=er(await Ne(e,"utf8")).relation||[],s=new Map;for(let o of n){if(!o.rel)throw new Error(`${e}: a [[relation]] row is missing "rel"`);if(s.has(o.rel))throw new Error(`${e}: duplicate mapping for ${o.rel}`);if(!tD.has(o.ace))throw new Error(`${e}: ${o.rel} has unknown ace pattern ${JSON.stringify(o.ace)}`);if(o.ace!=="none"&&!o.predicate)throw new Error(`${e}: ${o.rel} maps to ${o.ace} but names no predicate URI`);s.set(o.rel,o)}return s}function Au(e,t,n="corpus:conceptnet"){let s=[];for(let o of e){let r=t.get(o.rel);if(!r)throw new Error(`slice/map drift: relation ${o.rel} has no row in conceptnet-map.toml`);if(r.ace==="none")continue;let i=jo(o.start),a=jo(o.end);if(!i||!a)continue;let c=r.predicate==="mgx:relatedTo"?n.replace(/^corpus:/,"corpus-weak:"):n;s.push({subject:i,predicate:r.predicate,object:a,provenance:`${c} ${o.rel}`})}return s}async function nD(e,{limit:t,slicePath:n=Ma,mapPath:s=Fa,prefer:o,provenancePrefix:r,captureUnknownContext:i=!1,unknownContextLimit:a}={}){let[c,l]=await Promise.all([_u(n),Tu(s)]),u=Au(c,l,r);if(Array.isArray(o)&&o.length){let w=new Map(o.map((y,v)=>[y,v]));u=u.slice().sort((y,v)=>(w.get(y.predicate)??o.length)-(w.get(v.predicate)??o.length))}t!==void 0&&(u=u.slice(0,t));let d=(w,y,v)=>`${V(w)} ${y} ${V(v)}`,p=new Set,f=await ct(e);for(let w of f.individuals||[]){if(w?.class!=="Fact")continue;let y=v=>(w.attributes||[]).find(R=>R.key===v)?.value;p.add(d(y("subject"),y("predicate"),y("object")))}let m=0,h=[];for(let w of u){let y=d(w.subject,w.predicate,w.object);if(p.has(y)){m+=1;continue}p.add(y),h.push(w)}let b=await Yn(e,h),g;if(i){let{ingestUnknownFromAssertions:w}=await Promise.resolve().then(()=>(Aj(),Tj));g=await w(e,{assertions:c,map:l,mappedFacts:u,memory:f,provenancePrefix:r?`${r}-unknown`:void 0,limit:a})}return{appended:b.appended,skipped:m+b.skipped,total:u.length,...g?{unknown:g}:{}}}var sD,gi,Ma,Fa,Ru,ZF,vs,eD,Da,aZ,tD,jo,ku=M(()=>{lr();Lt();xj();vo();Qe();bl();Ue();sD={},gi=ne($e(Yt(sD.url)),"..","..",".."),Ma=ne(gi,"corpus","conceptnet","slice.jsonl"),Fa=ne(gi,"src","adapters","corpus","conceptnet-map.toml"),Ru=ne(gi,"corpus","domains","code","concepts.jsonl"),ZF=ne(gi,"corpus","domains","code","definitions.jsonl"),vs=ne(gi,"corpus","tier2"),eD=ne(vs,"manifest.json"),Da=ne(gi,"corpus","wordnet"),aZ=ne(Da,"manifest.json"),tD=new Set(["subClassOf","type","ObjectProperty","someValuesFrom","disjointWith","property","none"]);jo=e=>{let t=/^\/c\/en\/([^/]+)/.exec(String(e||""));return t?t[1].replace(/_/g," "):null}});var Mj={};Nt(Mj,{BUILTIN_EXTENSIONS:()=>aD,EXTENSION_KINDS:()=>Cu,activeDomainPacks:()=>xh,defaultCodeDomainPacks:()=>Pj,defaultCodeLaneVocab:()=>Lj,mergedLaneVocab:()=>Eh,mergedLexiconExtra:()=>Nj,resolveExtensions:()=>Oj,seedActiveCorpusEntries:()=>uD,validateExtensionEntry:()=>Ij,validateExtensionPack:()=>fD});function Iu(){return{seon:{kind:"corpus",active:!1,corpusPath:Ru,provenancePrefix:"corpus:seon"},code:{kind:"pack",active:!1,corpusPath:Ru,provenancePrefix:"corpus:seon",vocabPath:rD,vocabData:vj,groundingKind:"extraction",groundingAdapter:"tmct index (the graphPaths provider seam)"},conceptnet:{kind:"corpus",active:!1,corpusPath:Ma,provenancePrefix:"corpus:conceptnet",limit:void 0,prefer:iD},human:{kind:"corpus",active:!0,corpusPath:ne(vs,"human.jsonl"),provenancePrefix:"corpus:human"},"human-medium":{kind:"corpus",active:!1,corpusPath:ne(vs,"human-medium.jsonl"),provenancePrefix:"corpus:human-medium"},"human-large":{kind:"corpus",active:!1,corpusPath:ne(vs,"human-large.jsonl"),provenancePrefix:"corpus:human-large"},"tier2-aws":{kind:"pack",active:!1,corpusPath:ne(vs,"aws.jsonl"),provenancePrefix:"corpus:tier2-aws",vocabPath:$h,vocabData:xu,groundingKind:"taught-only"},"tier2-python":{kind:"pack",active:!1,corpusPath:ne(vs,"python.jsonl"),provenancePrefix:"corpus:tier2-python",vocabPath:$h,vocabData:xu,groundingKind:"taught-only"},"tier2-java":{kind:"pack",active:!1,corpusPath:ne(vs,"java.jsonl"),provenancePrefix:"corpus:tier2-java",vocabPath:$h,vocabData:xu,groundingKind:"taught-only"},"tier2-general":{kind:"corpus",active:!1,corpusPath:ne(vs,"general.jsonl"),provenancePrefix:"corpus:tier2-general"},"wordnet-xl":{kind:"corpus",active:!1,corpusPath:ne(Da,"wordnet-xl.jsonl"),provenancePrefix:"corpus:wordnet-xl"},"wordnet-full":{kind:"corpus",active:!1,corpusPath:ne(Da,"wordnet-full.jsonl"),provenancePrefix:"corpus:wordnet-full"},namenet:{kind:"corpus",active:!1,corpusPath:ne(oD,"namenet.jsonl"),provenancePrefix:"corpus:namenet"}}}function Ij(e,t){if(!t||typeof t!="object")throw new Error(`extension "${e}": entry must be an object`);if(!Cu.includes(t.kind))throw new Error(`extension "${e}": unknown kind ${JSON.stringify(t.kind)} (must be one of ${Cu.join(", ")})`);if(t.active!==void 0&&typeof t.active!="boolean")throw new Error(`extension "${e}": "active" must be a boolean`);if(t.kind==="corpus"&&!t.corpusPath)throw new Error(`extension "${e}": a "corpus" entry needs corpus_path`);if(t.kind==="ontology"&&!t.corpusPath)throw new Error(`extension "${e}": an "ontology" entry needs ontology_path`);if(t.kind==="lexicon"&&!t.lexiconPath)throw new Error(`extension "${e}": a "lexicon" entry needs lexicon_path`);if(t.kind==="templates"&&!t.templatesPath)throw new Error(`extension "${e}": a "templates" entry needs templates_path`);if(t.kind==="pack"&&!t.corpusPath&&!t.lexiconPath&&!t.templatesPath&&!t.phrasebookPath)throw new Error(`extension "${e}": a "pack" entry needs at least one of corpus_path/lexicon_path/templates_path/phrasebook_path`);if(t.limit!==void 0&&!Number.isFinite(t.limit))throw new Error(`extension "${e}": "limit" must be a finite number`);if(t.prefer!==void 0&&!Array.isArray(t.prefer))throw new Error(`extension "${e}": "prefer" must be an array of predicate URIs`)}function lD(e,t,n,s){if(!t&&n.kind===void 0)throw new Error(`extension "${e}": an unrecognized extension needs a "kind" (one of ${Cu.join(", ")})`);let o={kind:n.kind!==void 0?n.kind:t?.kind,active:n.active!==void 0?!!n.active:!!t?.active},r=[["corpus_path","corpusPath"],["ontology_path","corpusPath"],["lexicon_path","lexiconPath"],["templates_path","templatesPath"],["phrasebook_path","phrasebookPath"],["map_path","mapPath"],["vocab_path","vocabPath"]];for(let[i,a]of r)n[i]!==void 0?o[a]=cD(s,n[i]):t?.[a]!==void 0&&(o[a]=t[a]);return o.provenancePrefix=n.provenance_prefix!==void 0?String(n.provenance_prefix):t?.provenancePrefix??`corpus:${e}`,n.limit!==void 0?o.limit=Number(n.limit):t?.limit!==void 0&&(o.limit=t.limit),n.prefer!==void 0?o.prefer=n.prefer:t?.prefer!==void 0&&(o.prefer=t.prefer),n.grounding_kind!==void 0?o.groundingKind=String(n.grounding_kind):t?.groundingKind!==void 0&&(o.groundingKind=t.groundingKind),n.grounding_adapter!==void 0?o.groundingAdapter=String(n.grounding_adapter):t?.groundingAdapter!==void 0&&(o.groundingAdapter=t.groundingAdapter),o}async function Oj(e,{configFile:t}={}){let n=e?await $l(e,t?{file:t}:{}):null,s=Iu(),o=n&&n.extensions&&typeof n.extensions=="object"?n.extensions:{},r=n&&n.bias&&typeof n.bias=="object"?n.bias:{},i=new Set([...Object.keys(s),...Object.keys(o)]),a=new Map;for(let p of i){let f=lD(p,s[p]||null,o[p]||{},e||process.cwd());Ij(p,f),a.set(p,f)}let c={};for(let[p,f]of Object.entries(r)){if(typeof f!="number"||!Number.isFinite(f))throw new Error(`[bias] "${p}": bias must be a finite number, got ${JSON.stringify(f)}`);c[p]=f}let u=["seon","conceptnet",...[...a.keys()].filter(p=>p!=="seon"&&p!=="conceptnet").sort()].filter(p=>a.has(p));return{entries:new Map(u.map(p=>[p,a.get(p)])),biasByBundle:c}}async function uD(e,t,n={}){let{seedMemory:s}=await Promise.resolve().then(()=>(ku(),Cj)),{captureUnknownContext:o,unknownContextLimit:r}=n,i={},a=0,c=0,l=0;for(let[u,d]of t instanceof Map?t:new Map)if(!(!d.active||!(d.kind==="corpus"||d.kind==="ontology"||d.kind==="pack"&&d.corpusPath)))try{let f=await s(e,{slicePath:d.corpusPath,mapPath:d.mapPath,provenancePrefix:d.provenancePrefix,limit:d.limit,prefer:d.prefer,captureUnknownContext:o,unknownContextLimit:r});i[u]={appended:f.appended,skipped:f.skipped,total:f.total},a+=f.appended,c+=f.skipped,l+=f.total}catch(f){i[u]={appended:0,skipped:0,total:0,error:f&&f.message?f.message:String(f)}}return{appended:a,skipped:c,total:l,perBundle:i}}async function Nj(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&(r.kind!=="lexicon"&&r.kind!=="pack"||r.lexiconPath&&n.push({name:o,path:r.lexiconPath,bias:t[o]??1}));if(!n.length)return null;n.sort((o,r)=>o.bias-r.bias);let s={nouns:{},verbs:{},adjectives:{},properNames:[]};for(let o of n){let r;try{r=JSON.parse(await Ne(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": lexicon file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}if(Object.assign(s.nouns,r.nouns||{}),Object.assign(s.verbs,r.verbs||{}),Object.assign(s.adjectives,r.adjectives||{}),Array.isArray(r.properNames))for(let i of r.properNames)s.properNames.includes(i)||s.properNames.push(i)}return s}async function Eh(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&(!r.vocabPath&&!r.vocabData||n.push({name:o,path:r.vocabPath,data:r.vocabData,bias:t[o]??1}));let s={countNouns:{},classLabels:{},helpRows:[],missRecoveryPointer:""};if(!n.length)return s;n.sort((o,r)=>o.bias-r.bias);for(let o of n){let r;if(o.data)r=o.data;else try{r=JSON.parse(await Ne(o.path,"utf8"))}catch(i){throw new Error(`extension "${o.name}": vocab file ${o.path} \u2014 ${i&&i.message?i.message:i}`)}Object.assign(s.countNouns,r.countNouns||{}),Object.assign(s.classLabels,r.classLabels||{}),Array.isArray(r.helpRows)&&s.helpRows.push(...r.helpRows),r.missRecoveryPointer&&(s.missRecoveryPointer=r.missRecoveryPointer)}return s}function Lj(){if(!vh){let e={...Iu().code,active:!0};vh=Eh(new Map([["code",e]]),{})}return vh}async function dD(e,t){let n={name:e,groundingKind:t.groundingKind||"",groundingAdapter:t.groundingAdapter||"",commandCount:0,countNounCount:0};if(!t.vocabPath)return n;try{let s=JSON.parse(await Ne(t.vocabPath,"utf8"));n.commandCount=Array.isArray(s.helpRows)?s.helpRows.length:0,n.countNounCount=Object.keys(s.countNouns||{}).length}catch{}return n}async function xh(e,t={}){let n=[];for(let[o,r]of e instanceof Map?e:new Map)r.active&&r.kind==="pack"&&n.push({name:o,entry:r,bias:t[o]??1});n.sort((o,r)=>o.bias-r.bias||o.name.localeCompare(r.name));let s=[];for(let o of n)s.push(await dD(o.name,o.entry));return s}function Pj(){if(!Sh){let e={...Iu().code,active:!0};Sh=xh(new Map([["code",e]]),{})}return Sh}async function fD(e,t){let n=[],s=o=>o&&(td(o)?o:Vt(e,o));if(t.corpusPath){let o=s(t.corpusPath);try{let r=await _u(o),i=await Tu(s(t.mapPath)||Fa),a=Au(r,i,t.provenancePrefix||"corpus:pack");n.push({kind:"corpus",path:o,ok:!0,counts:{assertions:r.length,facts:a.length}})}catch(r){n.push({kind:"corpus",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.lexiconPath){let o=s(t.lexiconPath);try{let{loadLexicon:r}=await Promise.resolve().then(()=>(Xn(),UE)),i=JSON.parse(await Ne(o,"utf8")),a=r(i);n.push({kind:"lexicon",path:o,ok:!0,counts:{nouns:a.nouns.size,verbs:a.verbs.size,adjectives:a.adjectives.size,properNames:a.properNames.size}})}catch(r){n.push({kind:"lexicon",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.templatesPath){let o=s(t.templatesPath);try{let{loadTemplates:r}=await Promise.resolve().then(()=>(Xl(),CE)),i=await r(o),a=[...i.keys()].filter(c=>!c.includes(":"));if(a.length)throw new Error(`template id${a.length>1?"s":""} not namespaced "<packname>:<id>": ${a.join(", ")}`);n.push({kind:"templates",path:o,ok:!0,counts:{templates:i.size}})}catch(r){n.push({kind:"templates",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.vocabPath){let o=s(t.vocabPath);try{let r=JSON.parse(await Ne(o,"utf8")),i=r.countNouns&&typeof r.countNouns=="object"?Object.keys(r.countNouns).length:0,a=r.classLabels&&typeof r.classLabels=="object"?Object.keys(r.classLabels).length:0,c=Array.isArray(r.helpRows)?r.helpRows.length:0;n.push({kind:"vocab",path:o,ok:!0,counts:{countNouns:i,classLabels:a,helpRows:c}})}catch(r){n.push({kind:"vocab",path:o,ok:!1,error:r&&r.message?r.message:String(r)})}}if(t.kind==="pack"){let o=t.groundingKind;o!=="extraction"&&o!=="taught-only"?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:`a "pack" entry needs "grounding_kind" of "extraction" or "taught-only" (got ${JSON.stringify(o??null)})`}):o==="extraction"&&!t.groundingAdapter?n.push({kind:"grounding",path:"(pack manifest)",ok:!1,error:'grounding_kind "extraction" needs "grounding_adapter" naming the adapter'}):n.push({kind:"grounding",path:"(pack manifest)",ok:!0,counts:o==="extraction"?{channel:o,adapter:t.groundingAdapter}:{channel:o}})}return{ok:n.length>0&&n.every(o=>o.ok),results:n}}var jh,oD,rD,$h,Cu,iD,aD,cD,vh,Sh,kh=M(()=>{Qe();Lt();vo();Sj();la();ku();jh={},oD=ne($e(Yt(jh.url)),"..","..","corpus","namenet"),rD=ne($e(Yt(jh.url)),"..","..","corpus","domains","code","vocab.json"),$h=ne($e(Yt(jh.url)),"..","..","corpus","tier2","vocab-empty.json"),Cu=Object.freeze(["corpus","lexicon","templates","pack","ontology"]),iD=["rdfs:subClassOf","rdf:type","mgx:usedFor","mgx:partOf","mgx:capableOf","mgx:atLocation","mgx:causes","mgx:desires","mgx:motivatedByGoal","mgx:hasSubevent"];aD=Object.freeze(Iu());cD=(e,t)=>{if(t==null)return;let n=String(t);return td(n)?n:Vt(e,n)};vh=null;Sh=null});var Fj=M(()=>{});var Dj=M(()=>{Qe();lr();Lt();Hm();hj();yh();Qt();bj();Me();yj();Yl();$j();xi();kh();Ia();xo();ql();bu();Vm();Ym();fr();Fj()});var zj={};Nt(zj,{proseLemma:()=>hD});function hD(){if(br!==void 0)return br;try{let e=eu();if(!e)return br=null,br;let t=e.its,n=new Map;br=s=>{let o=String(s||"");if(n.has(o))return n.get(o);let r;try{r=String(e.readDoc(o).tokens().out(t.lemma)[0]||o).toLowerCase()}catch{r=o.toLowerCase()}return n.set(o,r),r}}catch{br=null}return br}var br,Bj=M(()=>{tu()});var Uj={};Nt(Uj,{digestTermFromRows:()=>wD,loadDigestStructureTable:()=>bD,readDigestStructures:()=>gD});var gD,bD,wD,Wj=M(()=>{gD=()=>null,bD=()=>null,wD=()=>null});var Nh={};Nt(Nh,{DEFAULT_MODULE_HOPS:()=>Ah,DEFAULT_PROVE_BRANCHES:()=>Qj,DEFAULT_PROVE_NODES:()=>Zj,DEFAULT_PROVE_STEPS:()=>Jj,MAX_PROVEN_CASES:()=>tk,MAX_ROLE_ASSERTIONS:()=>ek,TABLEAU_RULE_CONFIDENCE:()=>xD,buildTableauKb:()=>HD,canonicalKey:()=>Ve,extractTableauModule:()=>XD,findTableauViolations:()=>YD,isSatisfiable:()=>Ih,moduleHasDlShape:()=>QD,proveEntailment:()=>WD,proveSubsumption:()=>GD,proveSubsumptionOfNegation:()=>VD,toNNF:()=>sn});function Ve(e){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("canonicalKey: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return"top";case"bot":return"bot";case"atom":return`atom(${e.name})`;case"nom":return`nom(${e.ind})`;case"not":return`not(${Ve(e.c)})`;case"and":return`and(${e.cs.map(Ve).sort().join(",")})`;case"or":return`or(${e.cs.map(Ve).sort().join(",")})`;case"some":return`some(${e.r},${Ve(e.c)})`;case"all":return`all(${e.r},${Ve(e.c)})`;case"atLeast":return`atLeast(${e.n},${e.r},${Ve(e.c)})`;case"atMost":return`atMost(${e.n},${e.r},${Ve(e.c)})`;default:throw new TypeError(`canonicalKey: unknown expression tag "${e.t}"`)}}function za(e,t){if(!e||typeof e!="object"||typeof e.t!="string")throw new TypeError("toNNF: expr must be a concept-expression object carrying a t tag");switch(e.t){case"top":return t?{t:"bot"}:{t:"top"};case"bot":return t?{t:"top"}:{t:"bot"};case"atom":return t?{t:"not",c:{t:"atom",name:e.name}}:{t:"atom",name:e.name};case"nom":return t?{t:"not",c:{t:"nom",ind:e.ind}}:{t:"nom",ind:e.ind};case"not":return za(e.c,!t);case"and":case"or":{let n=e.t==="and"?"or":"and",s=e.cs.map(o=>za(o,t));return s.sort((o,r)=>Ve(o).localeCompare(Ve(r))),{t:t?n:e.t,cs:s}}case"some":case"all":{let n=e.t==="some"?"all":"some",s=za(e.c,t);return{t:t?n:e.t,r:e.r,c:s}}case"atLeast":case"atMost":{let n=za(e.c,!1);return t?e.t==="atLeast"?{t:"atMost",n:e.n-1,r:e.r,c:n}:{t:"atLeast",n:e.n+1,r:e.r,c:n}:{t:e.t,n:e.n,r:e.r,c:n}}default:throw new TypeError(`toNNF: unknown expression tag "${e.t}"`)}}function sn(e){return za(e,!1)}function Gt(e){return[...new Set((Array.isArray(e)?e:[]).filter(Boolean))].sort()}function _h(e,t){let n=Number(e);return Number.isFinite(n)&&n>0?Math.floor(n):t}function vD(e,t){let n=Number(e);return Number.isFinite(n)&&n>=0?Math.floor(n):t}function Xj(e,t){let n=new Set(e),s=!0;for(;s;){s=!1;for(let o of t)n.has(o.subject)&&!n.has(o.object)&&(n.add(o.object),s=!0),n.has(o.object)&&!n.has(o.subject)&&(n.add(o.subject),s=!0)}return n}function SD(e){let t=new Map;for(let[s,o]of e||[])!s||!o||s===o||(t.has(s)||t.set(s,new Set),t.get(s).add(o));let n=new Map;return s=>{if(n.has(s))return n.get(s);let o=new Set,r=[...t.get(s)||[]];for(;r.length;){let i=r.pop();if(!o.has(i)){o.add(i);for(let a of t.get(i)||[])o.has(a)||r.push(a)}}return n.set(s,o),o}}function ED(e,t){let n=(e||[]).map(([r,i])=>[xs(r),xs(i)]),s=SD(n.map(([r,i])=>[i,r])),o=new Map;for(let r of t){let i=xs(r);o.set(i,new Set([i,...s(i)]))}return o}function Gj(e,t,n){let s=xs(t),o=xs(n);if(s===o)return!0;let r=e&&e.roleClosure?e.roleClosure.get(o):null;return r?r.has(s):!1}function Lu(e,t,n,s){let o=[];for(let r of e.edges)if(r.from===n&&Gj(t,r.r,s))o.push({to:r.to,fromFacts:r.fromFacts});else if(r.to===n){let i=t&&t.inverseOf?t.inverseOf.get(xs(r.r)):null;i&&Gj(t,i,s)&&o.push({to:r.from,fromFacts:r.fromFacts})}return o}function Ou(e,t){return t==="fresh-0"?!1:e&&e.namedIndividuals&&e.namedIndividuals.has(t)?!0:!jD.test(t)}function Ba(e,t){return e<t?`${e}\u241F${t}`:`${t}\u241F${e}`}function kD(e,t,n,s){if(t===n)return;let o=Ba(t,n),r=e.inequalityFrom.get(o);e.inequalityFrom.set(o,Gt(r?[...r,...s]:s))}function nk(e,t,n,s){return n===s?!1:Ou(t,n)&&Ou(t,s)?!0:e.inequalityFrom.has(Ba(n,s))}function sk(e,t,n){let s=e.inequalityFrom.get(Ba(t,n));return s?s.slice():[]}function RD(e,t,n){let s=Ou(e,t),o=Ou(e,n);return s&&!o?[t,n]:o&&!s?[n,t]:t<n?[t,n]:[n,t]}function ok(e,t,n,s){if(n===s)return n;let[o,r]=RD(t,n,s),i=e.nodes.get(o),a=e.nodes.get(r);if(!i||!a)return o;for(let[d,{expr:p,from:f}]of a.labels){let m=i.labels.get(d);i.labels.set(d,{expr:p,from:m?Gt([...m.from,...f]):f.slice()})}let c=[],l=new Map;for(let d of e.edges){let p=d.from===r?o:d.from,f=d.to===r?o:d.to,m=`${p}\u241F${d.r}\u241F${f}`,h=l.get(m);if(h)h.fromFacts=Gt([...h.fromFacts,...d.fromFacts]);else{let b={from:p,r:d.r,to:f,fromFacts:d.fromFacts.slice()};l.set(m,b),c.push(b)}}e.edges=c;for(let d of e.nodes.values())d.parent===r&&(d.parent=o);let u=new Map;for(let[d,p]of e.inequalityFrom){let[f,m]=d.split("\u241F"),h=f===r?o:f,b=m===r?o:m;if(h===b)continue;let g=Ba(h,b),w=u.get(g);u.set(g,w?Gt([...w,...p]):p)}return e.inequalityFrom=u,e.nodes.delete(r),o}function Ch(e,t){return{id:e,labels:new Map,parent:t??null,branchedOn:new Set,appliedAxioms:new Set,successorCount:0}}function Jn(e,t,n){let s=Ve(t);return e.labels.has(s)?!1:(e.labels.set(s,{expr:t,from:Gt(n)}),!0)}function bi(e){return[...e.labels.entries()].sort((t,n)=>t[0].localeCompare(n[0]))}function Nu(e){if(e.labels.has("bot"))return{nodeId:e.id,keyA:"bot",keyB:"bot",premises:e.labels.get("bot").from.slice()};let t=[...e.labels.keys()].sort();for(let n of t){let{expr:s,from:o}=e.labels.get(n),r=Ve(sn(Es(s)));if(r<=n)continue;let i=e.labels.get(r);if(i)return{nodeId:e.id,keyA:n,keyB:r,premises:Gt([...o,...i.from])}}return null}function Vj(e,t){let n=new Set;for(let s of e.edges)s.to===t&&n.add(s.r);return n}function rk(e,t,n){let s=[...e.labels.keys()],o=!!(n&&n.inverseOf&&n.inverseOf.size>0),r=o?Vj(t,e.id):null,i=e.parent;for(;i;){let a=t.nodes.get(i);if(!a)break;if(s.length===a.labels.size&&s.every(c=>a.labels.has(c))){if(!o)return!0;let c=Vj(t,a.id);if(r.size===c.size&&[...r].every(l=>c.has(l)))return!0}i=a.parent}return!1}function Kj(e){let t=new Map;for(let[n,s]of e.nodes)t.set(n,{id:s.id,labels:new Map(s.labels),parent:s.parent,branchedOn:new Set(s.branchedOn),appliedAxioms:new Set(s.appliedAxioms),successorCount:s.successorCount});return{nodes:t,edges:e.edges.slice(),closed:!1,clash:null,inequalityFrom:new Map(e.inequalityFrom),choices:(e.choices||[]).slice()}}function _D(e){for(let t of e.nodes.values())for(let[,{expr:n,from:s}]of bi(t)){if(n.t!=="and")continue;let o=!1;for(let r of n.cs)Jn(t,r,s)&&(o=!0);if(o)return{applied:!0,touched:[t.id]}}return{applied:!1,touched:[]}}function TD(e,t){let n=new Map;for(let o of e.nodes.values())for(let r of o.labels.keys())r.startsWith("nom(")&&(n.has(r)||n.set(r,[]),n.get(r).push(o.id));let s=[...n.keys()].sort();for(let o of s){let r=[...new Set(n.get(o))].sort();if(r.length<2)continue;let[i,a]=r;if(nk(e,t,i,a)){let c=e.nodes.get(i).labels.get(o)?.from||[],l=e.nodes.get(a).labels.get(o)?.from||[];return{kind:"clash",clash:{nodeId:i,keyA:o,keyB:`merge(${i},${a})`,premises:Gt([...c,...l,...sk(e,i,a)])}}}return{kind:"merge",a:i,b:a}}return{kind:"none"}}function AD(e,t){let n=t&&t.transitiveRoles instanceof Set?t.transitiveRoles:null;for(let s of e.nodes.values())for(let[,{expr:o,from:r}]of bi(s)){if(o.t!=="all")continue;let i=[];for(let{to:a,fromFacts:c}of Lu(e,t,s.id,o.r)){let l=e.nodes.get(a);if(!l)continue;let u=[...r,...c];Jn(l,o.c,u)&&i.push(l.id),n&&n.has(o.r)&&Jn(l,o,u)&&i.push(l.id)}if(i.length)return{applied:!0,touched:i}}return{applied:!1,touched:[]}}function CD(e,t){for(let n of e.nodes.values())for(let s=0;s<t.axioms.length;s+=1){if(n.appliedAxioms.has(s))continue;let o=t.axioms[s];if(n.appliedAxioms.add(s),Jn(n,o.disjunction,o.from))return{applied:!0,touched:[n.id]}}return{applied:!1,touched:[]}}function ID(e,t){if(Ve(t)==="bot")return[];let n=Ve(sn(Es(t))),s=e.labels.get(n);return s?s.from:null}function OD(e,t,n){return n.some(s=>e.unionOrOneOfIds&&e.unionOrOneOfIds.has(s))&&t.every(s=>s.t==="atom"||s.t==="nom")}function ND(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of bi(n)){if(o.t!=="or"||n.branchedOn.has(s))continue;let i=[...o.cs].sort((d,p)=>Ve(d).localeCompare(Ve(p)));if(i.some(d=>n.labels.has(Ve(d)))){n.branchedOn.add(s);continue}let a=i.map(d=>({c:d,clashFrom:ID(n,d)})),c=a.filter(d=>d.clashFrom===null).map(d=>d.c),l=a.filter(d=>d.clashFrom!==null).flatMap(d=>d.clashFrom),u=OD(t,i,r)?{cs:i,from:r}:null;return c.length===0?{kind:"clash",clash:{nodeId:n.id,keyA:Ve(i[0]),keyB:Ve(sn(Es(i[0]))),premises:Gt([...r,...l])},choice:u}:c.length===1?(n.branchedOn.add(s),Jn(n,c[0],[...r,...l]),{kind:"applied",touched:[n.id],choice:u}):(n.branchedOn.add(s),{kind:"split",node:n,from:r,disjuncts:c,choice:u})}return{kind:"none"}}function LD(e,t){for(let n of e.nodes.values())if(!rk(n,e,t))for(let[,{expr:s,from:o}]of bi(n)){if(s.t!=="some")continue;let r=Ve(s.c);if(Lu(e,t,n.id,s.r).some(c=>e.nodes.get(c.to)?.labels.has(r)))continue;n.successorCount+=1;let a=Ch(`${n.id}.${n.successorCount}`,n.id);return Jn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()}),{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function PD(e,t){for(let n of e.nodes.values())for(let[s,{expr:o,from:r}]of bi(n)){if(o.t!=="atMost")continue;let i=Ve(o.c),a=[...new Set(Lu(e,t,n.id,o.r).map(u=>u.to))].filter(u=>e.nodes.get(u)?.labels.has(i)).sort();if(a.length<=o.n)continue;let c=[];for(let u=0;u<a.length;u+=1)for(let d=u+1;d<a.length;d+=1)c.push([a[u],a[d]]);if(c.length===0){let u=e.nodes.get(a[0])?.labels.get(i)?.from||[];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`witness(${a[0]})`,premises:Gt([...r,...u])}}}let l=c.filter(([u,d])=>!nk(e,t,u,d));if(l.length===0){let[u,d]=c[0];return{kind:"clash",clash:{nodeId:n.id,keyA:s,keyB:`merge(${u},${d})`,premises:Gt([...r,...sk(e,u,d)])}}}return{kind:"split-merge",pairs:l}}return{kind:"none"}}function MD(e,t){for(let n of e.nodes.values())if(!rk(n,e,t))for(let[,{expr:s,from:o}]of bi(n)){if(s.t!=="atLeast")continue;let r=Ve(s.c),i=[...new Set(Lu(e,t,n.id,s.r).map(c=>c.to))].filter(c=>e.nodes.get(c)?.labels.has(r)).sort();if(i.length>=s.n)continue;n.successorCount+=1;let a=Ch(`${n.id}.${n.successorCount}`,n.id);Jn(a,s.c,o),e.nodes.set(a.id,a),e.edges.push({from:n.id,r:s.r,to:a.id,fromFacts:o.slice()});for(let c of i)kD(e,a.id,c,o);return{applied:!0,touched:[a.id]}}return{applied:!1,touched:[]}}function FD(e,t){for(let n of t){let s=e.nodes.get(n),o=s&&Nu(s);if(o)return o}return null}function wr(e,t){let n=FD(e,t);return n?{kind:"clash",clash:n}:{kind:"applied"}}function DD(e,t){let n=_D(e);if(n.applied)return wr(e,n.touched);let s=AD(e,t);if(s.applied)return wr(e,s.touched);let o=TD(e,t);if(o.kind==="clash")return o;if(o.kind==="merge"){let u=ok(e,t,o.a,o.b);return wr(e,[u])}let r=CD(e,t);if(r.applied)return wr(e,r.touched);let i=ND(e,t);if(i.kind==="clash")return i;if(i.kind==="applied")return i.choice&&e.choices.push(i.choice),wr(e,i.touched);if(i.kind==="split")return i;let a=PD(e,t);if(a.kind==="clash"||a.kind==="split-merge")return a;let c=MD(e,t);if(c.applied)return wr(e,c.touched);let l=LD(e,t);return l.applied?wr(e,l.touched):{kind:"done"}}function zD(e){let t=[...e.nodes.values()].map(s=>({id:s.id,parent:s.parent,labels:[...s.labels.entries()].sort((o,r)=>o[0].localeCompare(r[0])).map(([,{expr:o,from:r}])=>({expr:o,from:r}))})),n=e.edges.map(({from:s,r:o,to:r,fromFacts:i})=>({from:s,r:o,to:r,fromFacts:i.slice()}));return{nodes:t,edges:n}}function BD(e,t,n){let s=_h(n.maxSteps,Jj),o=_h(n.maxBranches,Qj),r=_h(n.maxNodes,Zj),i=[e],a=0,c=1,l=[];for(;i.length;){let u=i.pop();if(u.closed){l.push(u.clash);continue}if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};for(;;){let d=DD(u,t);if(d.kind==="clash"){let p=d.choice?[...u.choices,d.choice]:u.choices.slice();l.push({...d.clash,choices:p});break}if(d.kind==="applied"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};if(u.nodes.size>r)return{status:"exhausted",reason:"nodes",steps:a,branches:c};continue}if(d.kind==="split"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.disjuncts.map(f=>{let m=Kj(u);d.choice&&m.choices.push(d.choice);let h=m.nodes.get(d.node.id);Jn(h,f,d.from);let b=Nu(h);return b&&(m.closed=!0,m.clash={...b,choices:m.choices.slice()}),m});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}if(d.kind==="split-merge"){if(a+=1,a>s)return{status:"exhausted",reason:"steps",steps:a,branches:c};let p=d.pairs.map(([f,m])=>{let h=Kj(u),b=ok(h,t,f,m),g=h.nodes.get(b),w=g&&Nu(g);return w&&(h.closed=!0,h.clash={...w,choices:h.choices.slice()}),h});for(let f=p.length-1;f>=0;f-=1){if(c+=1,c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c};i.push(p[f])}break}return{status:"satisfiable",model:zD(u),steps:a,branches:c}}if(c>o)return{status:"exhausted",reason:"branches",steps:a,branches:c}}return{status:"unsatisfiable",clashes:l,steps:a,branches:c}}function UD(e,t){let n=new Map,s=i=>(n.has(i)||n.set(i,Ch(i,null)),n.get(i));for(let i of e.individuals||[])s(i);for(let i of e.assertions||[])Jn(s(i.ind),i.expr,i.from);for(let i of t||[])!i||!i.ind||!i.expr||Jn(s(i.ind),sn(i.expr),i.from||[]);for(let[i,a]of e.nominalIndividuals||[])Jn(s(i),{t:"nom",ind:i},a);let o=new Map;for(let i of e.differentFrom||[]){if(!i||!i.a||!i.b||i.a===i.b)continue;let a=Ba(i.a,i.b),c=o.get(a);o.set(a,Gt(c?[...c,...i.from]:i.from))}let r=[];for(let i of e.roleAssertions||[])s(i.a),s(i.b),r.push({from:i.a,r:i.r,to:i.b,fromFacts:i.from.slice()});return{nodes:n,edges:r,closed:!1,clash:null,inequalityFrom:o,choices:[]}}function Ih(e,t=[],n={}){let s=UD(e,t);for(let r of s.nodes.values()){let i=Nu(r);if(i){s.closed=!0,s.clash={...i,choices:[]};break}}let o=BD(s,e,n);return o.status==="exhausted"?{satisfiable:null,exhausted:o.reason,steps:o.steps,branches:o.branches}:o.status==="satisfiable"?{satisfiable:!0,model:o.model,steps:o.steps,branches:o.branches}:{satisfiable:!1,closedClashes:o.clashes,steps:o.steps,branches:o.branches}}function Oh(e,t,n){let s=Ih(e,t,n);if(s.satisfiable===null)return{status:"exhausted",reason:s.exhausted,steps:s.steps,branches:s.branches};if(s.satisfiable===!1){let o=Gt(s.closedClashes.flatMap(l=>l?.premises||[])),r=new Map;for(let l of s.closedClashes)for(let u of l?.choices||[])for(let d of u.cs)r.set(Ve(d),d);let i=[...r.keys()].sort(),a=i.slice(0,tk).map(l=>r.get(l)),c=i.length;return{status:"proved",premises:o,cases:a,casesTotal:c,steps:s.steps,branches:s.branches}}return{status:"disproved",model:s.model,steps:s.steps,branches:s.branches}}function WD(e,t,n,s={}){return Oh(e,[{ind:t,expr:sn(Es(n)),from:[]}],s)}function GD(e,t,n,s={}){let o=sn(qj([Fe(t),Es(Fe(n))]));return Oh(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function VD(e,t,n,s={}){let o=sn(qj([Fe(t),Fe(n)]));return Oh(e,[{ind:"fresh-0",expr:o,from:[]}],s)}function KD(e){return e?e.keyA==="bot"?"bottom":`complement:${e.keyA}~${e.keyB}`:"unsatisfiable"}function HD(e){let t=Array.isArray(e)?e.filter(L=>L&&L.subject&&L.predicate):[],n=new Map,s=new Map,o=new Map,r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=[],d=[],p=[],f=[],m=new Set,h=[],b=[],g=[],w=[],y=(L,K,W)=>{L.has(K)||L.set(K,[]),L.get(K).push(W)};for(let L of t){let K=String(L.predicate).trim().toLowerCase();K==="owl:onproperty"?n.set(L.subject,{object:L.object,id:L.id}):K==="owl:somevaluesfrom"?s.set(L.subject,{object:L.object,id:L.id}):K==="owl:allvaluesfrom"?o.set(L.subject,{object:L.object,id:L.id}):K==="owl:onclass"?r.set(L.subject,{object:L.object,id:L.id}):K==="owl:mincardinality"?i.set(L.subject,{kind:"min",n:Number(L.object),id:L.id}):K==="owl:maxcardinality"?i.set(L.subject,{kind:"max",n:Number(L.object),id:L.id}):K==="owl:cardinality"?i.set(L.subject,{kind:"exact",n:Number(L.object),id:L.id}):K==="rdfs:subclassof"?u.push(L):K==="owl:disjointwith"?d.push(L):K==="rdf:type"?(p.push(L),String(L.object||"").toLowerCase()==="transitiveproperty"&&m.add(L.subject)):K==="mgxneg:subclassof"?f.push(L):K==="owl:unionof"?y(a,L.subject,L):K==="owl:complementof"?c.set(L.subject,L):K==="rdfs:subpropertyof"?h.push(L):K==="owl:differentfrom"?b.push(L):K==="owl:oneof"?y(l,L.subject,L):K==="owl:inverseof"?g.push(L):w.push(L)}let v=new Set;for(let L of p){let K=String(L.object||"").toLowerCase();Th.has(K)||v.add(L.subject)}let R=Xj(v,w),S=L=>R.has(L)||Yj.test(L),j=w.filter(L=>S(L.subject)&&S(L.object)).sort((L,K)=>L.subject.localeCompare(K.subject)||L.predicate.localeCompare(K.predicate)||L.object.localeCompare(K.object)).slice(0,ek).map(L=>({a:L.subject,r:L.predicate,b:L.object,from:[L.id]})),I=(L,K,W)=>({sub:L,sup:K,from:Gt(W),disjunction:sn(Rh([Es(L),K]))}),x=[],_=[];for(let L of u){let K=L.object;if(!n.has(K)){x.push(I(Fe(L.subject),Fe(K),[L.id]));continue}let W=n.get(K),N=s.get(K);if(N){x.push(I(Fe(L.subject),yD(W.object,Fe(N.object)),[L.id,W.id,N.id]));continue}let F=o.get(K);if(F){x.push(I(Fe(L.subject),$D(W.object,Fe(F.object)),[L.id,W.id,F.id]));continue}let O=i.get(K),z=r.get(K);if(O&&z){let B=[L.id,W.id,z.id,O.id];O.kind==="min"?x.push(I(Fe(L.subject),{t:"atLeast",n:O.n,r:W.object,c:Fe(z.object)},B)):O.kind==="max"?x.push(I(Fe(L.subject),{t:"atMost",n:O.n,r:W.object,c:Fe(z.object)},B)):O.kind==="exact"&&(x.push(I(Fe(L.subject),{t:"atLeast",n:O.n,r:W.object,c:Fe(z.object)},B)),x.push(I(Fe(L.subject),{t:"atMost",n:O.n,r:W.object,c:Fe(z.object)},B)))}}for(let L of d)S(L.subject)?_.push({ind:L.subject,expr:sn(Es(Fe(L.object))),from:[L.id]}):x.push(I(Fe(L.subject),sn(Es(Fe(L.object))),[L.id]));for(let L of p)Th.has(String(L.object||"").toLowerCase())||_.push({ind:L.subject,expr:Fe(L.object),from:[L.id]});for(let L of f)_.push({ind:L.subject,expr:sn(Es(Fe(L.object))),from:[L.id]});for(let[L,K]of a){let W=[...K].sort((z,B)=>String(z.object).localeCompare(String(B.object))),N=W.map(z=>Fe(z.object)),F=W.map(z=>z.id),O=sn(Rh(N));x.push(I(Fe(L),O,F)),x.push(I(O,Fe(L),F))}for(let[L,K]of c){let W=sn(Es(Fe(K.object)));x.push(I(Fe(L),W,[K.id])),x.push(I(W,Fe(L),[K.id]))}let $=new Map;for(let[L,K]of l){let W=[...K].sort((O,z)=>String(O.object).localeCompare(String(z.object))),N=W.map(O=>({t:"nom",ind:O.object})),F=W.map(O=>O.id);x.push(I(Fe(L),sn(Rh(N)),F));for(let O of W){x.push(I({t:"nom",ind:O.object},Fe(L),[O.id]));let z=$.get(O.object);$.set(O.object,z?Gt([...z,O.id]):[O.id])}}let T=b.map(L=>({a:L.subject,b:L.object,from:[L.id]})).sort((L,K)=>L.a.localeCompare(K.a)||L.b.localeCompare(K.b)),C=new Map;for(let L of g)C.set(L.subject,L.object),C.has(L.object)||C.set(L.object,L.subject);let E=new Set;for(let{object:L}of n.values())E.add(L);for(let L of j)E.add(L.r);let k=h.map(L=>[L.subject,L.object]).sort((L,K)=>L[0].localeCompare(K[0])||L[1].localeCompare(K[1])),P=new Set([...E,...k.flat(),...C.keys(),...C.values()]),D=ED(k,P);x.sort((L,K)=>Ve(L.sub).localeCompare(Ve(K.sub))||Ve(L.sup).localeCompare(Ve(K.sup))||L.from.join(",").localeCompare(K.from.join(","))),_.sort((L,K)=>L.ind.localeCompare(K.ind)||Ve(L.expr).localeCompare(Ve(K.expr)));let H=[...new Set([..._.map(L=>L.ind),...j.flatMap(L=>[L.a,L.b])])].sort(),Y=new Set(H),J=new Set([...[...a.values()].flatMap(L=>L.map(K=>K.id)),...[...l.values()].flatMap(L=>L.map(K=>K.id))]);return{axioms:x,assertions:_,roles:[...E].sort(),individuals:H,transitiveRoles:m,roleClosure:D,namedIndividuals:Y,nominalIndividuals:$,differentFrom:T,inverseOf:C,roleAssertions:j,unionOrOneOfIds:J}}function qD(e,t){return{axioms:e.axioms,assertions:(e.assertions||[]).filter(n=>n.ind===t),roles:e.roles,individuals:[t],transitiveRoles:e.transitiveRoles,roleAssertions:e.roleAssertions,roleClosure:e.roleClosure,namedIndividuals:e.namedIndividuals,nominalIndividuals:e.nominalIndividuals,differentFrom:e.differentFrom,inverseOf:e.inverseOf,unionOrOneOfIds:e.unionOrOneOfIds}}function YD(e,t=null,n={}){let s=[...new Set(Array.isArray(t)&&t.length?t:e.individuals||[])].sort(),o=[];for(let r of s){let i=qD(e,r);if(!i.assertions.length)continue;let a=Ih(i,[],n);if(a.satisfiable===null||a.satisfiable===!0)continue;let c=Gt(a.closedClashes.flatMap(l=>l?.premises||[]));o.push({subject:r,premises:c,kind:KD(a.closedClashes[0])})}return o.sort((r,i)=>r.subject.localeCompare(i.subject)),o}function Ss(e,t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)}function XD(e,t,{hops:n=Ah}={}){let s=Array.isArray(e)?e.filter(k=>k&&k.subject&&k.predicate):[],o=vD(n,Ah),r=new Map,i=new Map,a=new Map,c=new Map,l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=new Map,b=[],g=new Map,w=new Set;for(let k of s){if(String(k.predicate).trim().toLowerCase()!=="rdf:type")continue;let P=String(k.object||"").toLowerCase();Th.has(P)||w.add(k.subject)}let y=s.filter(k=>!Hj.has(String(k.predicate).trim().toLowerCase())),v=Xj(w,y),R=k=>v.has(k)||Yj.test(k);for(let k of s){let P=String(k.predicate).trim().toLowerCase();P==="rdfs:subclassof"?(Ss(r,k.subject,k.object),Ss(i,k.object,k.subject)):P==="owl:onproperty"?a.set(k.subject,k.object):P==="owl:somevaluesfrom"||P==="owl:allvaluesfrom"||P==="owl:onclass"?(c.set(k.subject,k.object),Ss(l,k.object,k.subject)):P==="owl:unionof"?(Ss(u,k.subject,k.object),Ss(d,k.object,k.subject)):P==="owl:complementof"?(p.set(k.subject,k.object),Ss(f,k.object,k.subject)):P==="owl:oneof"?(Ss(m,k.subject,k.object),Ss(h,k.object,k.subject)):!Hj.has(P)&&R(k.subject)&&R(k.object)&&(b.push(k),Ss(g,k.subject,k.object),Ss(g,k.object,k.subject))}let S=new Map;function j(k){let P=S.get(k);if(P)return P;let D=new Set,H=[...r.get(k)||[],...i.get(k)||[]];for(;H.length;){let Y=H.pop();if(!D.has(Y)){D.add(Y);for(let J of r.get(Y)||[])D.has(J)||H.push(J);for(let J of i.get(Y)||[])D.has(J)||H.push(J)}}S.set(k,D);for(let Y of D)S.has(Y)||S.set(Y,D);return D}let I=new Set,x=new Map,_=[];function $(k,P){if(!k)return;let D=x.get(k);D!==void 0&&D>=P||(x.set(k,P),_.push({term:k,hopsLeft:P}))}let T=[...new Set((Array.isArray(t)?t:[]).map(k=>V(k)).filter(Boolean))];for(let k of T)$(k,o);let C=0;for(;C<_.length;){let{term:k,hopsLeft:P}=_[C];if(C+=1,x.get(k)===P){I.add(k);for(let D of j(k))I.add(D),$(D,P);if(!(P<=0)){c.has(k)&&$(c.get(k),o);for(let D of l.get(k)||[])$(D,o);for(let D of u.get(k)||[])$(D,P-1);for(let D of d.get(k)||[])$(D,P-1);p.has(k)&&$(p.get(k),P-1);for(let D of f.get(k)||[])$(D,P-1);for(let D of m.get(k)||[])$(D,P-1);for(let D of h.get(k)||[])$(D,P-1);for(let D of g.get(k)||[])$(D,o)}}}let E=new Set;for(let[k,P]of a)I.has(k)&&E.add(xs(P));for(let k of b)(I.has(k.subject)||I.has(k.object))&&E.add(xs(k.predicate));return s.filter(k=>{if(I.has(k.subject)||I.has(k.object))return!0;let P=String(k.predicate).trim().toLowerCase();return P==="rdfs:subpropertyof"||P==="owl:inverseof"||P==="rdf:type"&&String(k.object).toLowerCase()==="transitiveproperty"?E.has(xs(k.subject)):!1})}function QD(e){return(Array.isArray(e)?e:[]).some(n=>{let s=String(n?.predicate||"").trim().toLowerCase();return JD.has(s)?!0:s==="rdf:type"&&String(n?.object||"").toLowerCase()==="transitiveproperty"})}var Fe,Es,qj,Rh,yD,$D,Yj,xs,Th,Jj,Qj,Zj,xD,Ah,ek,tk,jD,Hj,JD,Lh=M(()=>{Ye();Fe=e=>({t:"atom",name:e}),Es=e=>({t:"not",c:e}),qj=e=>({t:"and",cs:e}),Rh=e=>({t:"or",cs:e}),yD=(e,t)=>({t:"some",r:e,c:t}),$D=(e,t)=>({t:"all",r:e,c:t});Yj=/[./\\#:@]/;xs=e=>V(e);Th=new Set(["restriction","transitiveproperty","class"]),Jj=5e3,Qj=256,Zj=512,xD=.95,Ah=4,ek=256,tk=6,jD=/\.\d+$/;Hj=new Set(["owl:onproperty","owl:somevaluesfrom","owl:allvaluesfrom","owl:onclass","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subclassof","owl:disjointwith","rdf:type","mgxneg:subclassof","owl:unionof","owl:complementof","rdfs:subpropertyof","owl:differentfrom","owl:oneof","owl:inverseof"]);JD=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"])});var dk={};Nt(dk,{BOT:()=>hn,DEFAULT_EL_BUDGET:()=>zh,DEFAULT_EL_ROUNDS:()=>Bh,EL_RESTRICTION_RULE:()=>Dh,EL_RULE_CONFIDENCE:()=>Ph,EL_SUBSUMPTION_RULE:()=>Fh,ENTAILED_EL_PROVENANCE:()=>lk,ENTAILED_EL_RESTRICTION_PROVENANCE:()=>Wa,TOP:()=>ko,classifyEl:()=>pz,elGoalAxioms:()=>ak,elGoalFor:()=>ck,elUnsatisfiableClasses:()=>fz,normalizeElTBox:()=>Mh,proveElSubsumption:()=>dz,saturateEl:()=>Pu});function ZD(e,t,n){for(let s of t)if(typeof e?.[s]!="function")throw new TypeError(`${n} needs a store option carrying { ${t.join(", ")} } (memory/core.mjs's read/write functions) \u2014 missing ${s}`);return e}function ez(e){if(!e)return null;let t=e instanceof Set?[...e]:Array.isArray(e)?e:[],n=new Set;for(let s of t){let o=V(s);o&&n.add(o)}return n.size?n:null}function Mh(e,{budget:t=500}={}){let s=[...(Array.isArray(e)?e:[]).filter($=>$&&$.id&&$.subject&&$.predicate&&$.object!==void 0&&$.object!==null)].sort(($,T)=>String($.id).localeCompare(String(T.id))),o=s.length>t,r=o?s.slice(0,t):s,i=new Set,a=new Set,c=$=>{$&&$!==ko&&$!==hn&&i.add($)},l=new Map,u=new Map,d=new Map,p=new Map,f=new Map,m=new Map,h=[],b=[],g=new Map,w=[];for(let $ of r){if($.subject===ko||$.subject===hn||$.object===ko||$.object===hn)continue;let T=$.predicate;sz(T)?(l.set($.subject,$),c($.subject)):oz(T)?(u.set($.subject,$),c($.subject),c($.object)):rz(T)?d.set($.subject,$):iz(T)?(p.set($.subject,$),c($.subject),c($.object)):uz(T)?(f.set($.subject,$),c($.subject)):az(T)?(m.has($.subject)||m.set($.subject,[]),m.get($.subject).push($),c($.subject),c($.object)):ik(T)?(h.push($),c($.subject),c($.object)):nz(T)?(b.push($),c($.subject),c($.object)):tz(T)&&$.object==="transitiveproperty"?(g.has($.subject)||g.set($.subject,$),a.add($.subject)):cz(T)&&(w.push($),a.add($.subject),a.add($.object))}let y=new Set([...l.keys()].filter($=>u.has($))),v=new Set([...l.keys()].filter($=>d.has($)));for(let $ of v)i.delete($);let R=new Map;for(let $ of y)R.set($,{role:l.get($).object,filler:u.get($).object});let S=new Map;for(let $ of Gf(r))$.kind!=="min"&&$.kind!=="exactly"||$.n>=1&&(y.has($.restriction)||!l.has($.restriction)||!p.has($.restriction)||!f.has($.restriction)||(S.set($.restriction,$.onClass),R.set($.restriction,{role:"has",filler:$.onClass})));let j=new Set(m.keys()),I=[],x=new Map;for(let $ of h){let T=$.subject,C=$.object;if(j.has(T)){x.has(T)||x.set(T,$);continue}if(y.has(C)){let{role:E,filler:k}=R.get(C),P=l.get(C),D=u.get(C);I.push({form:"someRight",sub:T,role:E,filler:k,from:[$.id,P.id,D.id]}),I.push({form:"someLeft",role:E,filler:k,sup:C,from:[P.id,D.id]});continue}if(S.has(C)){let E=S.get(C),k=l.get(C),P=p.get(C),D=f.get(C);I.push({form:"someRight",sub:T,role:"has",filler:E,from:[$.id,k.id,P.id,D.id]}),I.push({form:"someLeft",role:"has",filler:E,sup:C,from:[k.id,P.id,D.id]});continue}v.has(C)||I.push({form:"sub",sub:T,sup:C,from:[$.id]})}for(let[$,T]of m){let C=x.get($);if(!C)continue;let E=new Map;for(let H of T)E.has(H.object)||E.set(H.object,H);let k=[...E.keys()].sort();if(k.length<2)continue;let P=k[0],D=[E.get(k[0]).id];for(let H=1;H<k.length;H+=1){let Y=k[H],J=H===k.length-1,L=J?C.object:`${P}-and-${Y}`,K=[P,Y].sort(),W=E.get(Y).id,N=J?[...D,W,C.id]:[...D,W];I.push({form:"and",subs:K,sup:L,from:N}),D=[...D,W],P=L}}for(let $ of b)I.push({form:"and",subs:[$.subject,$.object].sort(),sup:hn,from:[$.id]});let _=[];for(let $ of[...g.keys()].sort())_.push({kind:"transitive",role:$,from:[g.get($).id]});for(let $ of[...w].sort((T,C)=>`${T.subject}${ue}${T.object}`.localeCompare(`${C.subject}${ue}${C.object}`)))_.push({kind:"sub",sub:$.subject,sup:$.object,from:[$.id]});return{axioms:I,roleAxioms:_,concepts:i,roles:a,restrictionOf:R,truncated:o}}function Pu(e,{budget:t=2e3,rounds:n=64,focus:s=null}={}){let o=e?.axioms||[],r=e?.roleAxioms||[],i=[...e?.concepts||[]].sort(),a=s instanceof Set?s.size?s:null:ez(s),c=(...$)=>!a||$.some(T=>a.has(T)),l=new Map,u=new Map,d=new Map,p=new Map;for(let $ of o)if($.form==="sub")l.has($.sub)||l.set($.sub,[]),l.get($.sub).push({sup:$.sup,from:$.from});else if($.form==="and"){let[T,C]=$.subs;for(let[E,k]of[[T,C],[C,T]])u.has(E)||u.set(E,[]),u.get(E).push({other:k,sup:$.sup,from:$.from})}else if($.form==="someRight")d.has($.sub)||d.set($.sub,[]),d.get($.sub).push({role:$.role,filler:$.filler,from:$.from});else if($.form==="someLeft"){let T=`${$.role}${ue}${$.filler}`;p.has(T)||p.set(T,[]),p.get(T).push({sup:$.sup,from:$.from})}let f=new Map,m=new Set,h=new Map;for(let $ of r)$.kind==="sub"?(f.has($.sub)||f.set($.sub,[]),f.get($.sub).push({sup:$.sup,from:$.from})):$.kind==="transitive"&&(m.add($.role),h.has($.role)||h.set($.role,$.from));let b=new Map;for(let $ of i)b.set($,new Set([$,ko]));let g=new Map,w=new Map,y=new Map,v=($,T)=>$===T?[]:w.get(`${$}${ue}${T}`)||[],R=($,T)=>y.get(`${$}${ue}${T}`)||[],S=(...$)=>{let T=new Set,C=[];for(let E of $)for(let k of E||[])!k||T.has(k)||(T.add(k),C.push(k));return C},j=0,I=!1,x=0;for(let $=0;$<n;$+=1){x+=1;let T=[];for(let[E,k]of b)for(let P of k)for(let{sup:D,from:H}of l.get(P)||[])k.has(D)||c(E,P,D)&&T.push({kind:"sub",A:E,X:D,from:S(v(E,P),H),sortKey:`1${ue}${E}${ue}${D}${ue}${P}`});for(let[E,k]of b)for(let P of k)for(let{other:D,sup:H,from:Y}of u.get(P)||[])k.has(D)&&(k.has(H)||c(E,P,D,H)&&T.push({kind:"sub",A:E,X:H,from:S(v(E,P),v(E,D),Y),sortKey:`2${ue}${E}${ue}${H}${ue}${[P,D].sort().join(ue)}`}));for(let[E,k]of b)for(let P of k)for(let{role:D,filler:H,from:Y}of d.get(P)||[]){let J=`${E}${ue}${H}`;(g.get(D)||Ua).has(J)||c(E,P,H)&&T.push({kind:"role",role:D,A:E,B:H,from:S(v(E,P),Y),sortKey:`3${ue}${D}${ue}${E}${ue}${H}${ue}${P}`})}for(let[E,k]of g)for(let P of k){let[D,H]=P.split(ue),Y=b.get(H)||Ua;for(let J of Y)for(let{sup:L,from:K}of p.get(`${E}${ue}${J}`)||[]){let W=b.get(D);!W||W.has(L)||c(D,H,J,L)&&T.push({kind:"sub",A:D,X:L,from:S(R(E,P),v(H,J),K),sortKey:`4${ue}${D}${ue}${L}${ue}${E}${ue}${H}${ue}${J}`})}}for(let[E,k]of g)for(let P of k){let[D,H]=P.split(ue);if(!(b.get(H)||Ua).has(hn))continue;let Y=b.get(D);!Y||Y.has(hn)||c(D,H)&&T.push({kind:"sub",A:D,X:hn,from:S(R(E,P),v(H,hn)),sortKey:`5${ue}${D}${ue}${E}${ue}${H}`})}for(let[E,k]of g)for(let{sup:P,from:D}of f.get(E)||[])for(let H of k){if((g.get(P)||Ua).has(H))continue;let[Y,J]=H.split(ue);c(Y,J)&&T.push({kind:"role",role:P,A:Y,B:J,from:S(R(E,H),D),sortKey:`6${ue}${P}${ue}${Y}${ue}${J}${ue}${E}`})}for(let E of[...m].sort()){let k=g.get(E);if(k)for(let P of k){let[D,H]=P.split(ue);for(let Y of k){let[J,L]=Y.split(ue);if(J!==H)continue;let K=`${D}${ue}${L}`;k.has(K)||c(D,H,L)&&T.push({kind:"role",role:E,A:D,B:L,from:S(R(E,P),R(E,Y),h.get(E)),sortKey:`7${ue}${E}${ue}${D}${ue}${L}${ue}${H}`})}}}if(!T.length){I=!0;break}T.sort((E,k)=>E.sortKey<k.sortKey?-1:E.sortKey>k.sortKey?1:0);let C=!1;for(let E of T){if(j>=t)break;if(E.kind==="sub"){let k=b.get(E.A);if(!k||k.has(E.X))continue;k.add(E.X),w.set(`${E.A}${ue}${E.X}`,E.from),j+=1,C=!0}else{g.has(E.role)||g.set(E.role,new Set);let k=g.get(E.role),P=`${E.A}${ue}${E.B}`;if(k.has(P))continue;k.add(P),y.set(`${E.role}${ue}${P}`,E.from),j+=1,C=!0}}if(j>=t)break;if(!C){I=!0;break}}let _=[...b.entries()].filter(([,$])=>$.has(hn)).map(([$])=>$).sort();return{subsumers:b,roleEdges:g,unsatisfiable:_,derivationOf:w,rounds:x,truncated:!I}}function ak(e,t,{budget:n=200}={}){let o=[...(e?.axioms||[]).filter(a=>a.form==="someRight")].sort((a,c)=>{let l=`${a.role}${ue}${a.filler}${ue}${a.sub}`,u=`${c.role}${ue}${c.filler}${ue}${c.sub}`;return l<u?-1:l>u?1:0}),r=[],i=new Set;for(let a of o){let l=[...t?.get(a.filler)||new Set([a.filler,ko])].filter(u=>u!==ko&&u!==hn).sort();for(let u of l){let d=`some-${a.role}-${u}`;if(!i.has(d)&&(i.add(d),r.push({form:"someLeft",role:a.role,filler:u,sup:d,from:[]}),r.length>=n))return r}}return r}function ck(e,t){let n=V(e),s=V(t),o=`some-${n}-${s}`;return{axiom:{form:"someLeft",role:n,filler:s,sup:o,from:[]},name:o}}function dz(e,t,{role:n,filler:s},{budget:o=2e3,rounds:r=64}={}){let i=V(t),a=Mh(e,{budget:o}),{axiom:c,name:l}=ck(n,s),u=new Set(a.concepts);u.add(i),u.add(c.filler);let d={...a,axioms:[...a.axioms,c],concepts:u},p=Pu(d,{budget:o,rounds:r});return(p.subsumers.get(i)||Ua).has(l)?{proved:!0,premises:p.derivationOf.get(`${i}${ue}${l}`)||[]}:{proved:!1,exhausted:p.truncated}}function uk(e,{budget:t=zh,rounds:n=Bh,focus:s=null}={}){let o=Mh(e,{budget:t}),r=Pu(o,{budget:t,rounds:n,focus:s}),i=ak(o,r.subsumers),a=new Map(i.map(d=>[d.sup,{role:d.role,filler:d.filler}])),c={...o,axioms:[...o.axioms,...i]},l=Pu(c,{budget:t,rounds:n,focus:s}),u=o.truncated||r.truncated||l.truncated;return{normalized:o,goals:i,goalInfo:a,finalPass:l,truncated:u}}function fz(e,t={}){let{finalPass:n,truncated:s}=uk(e,t);return{unsatisfiable:n.unsatisfiable,premisesOf:o=>n.derivationOf.get(`${o}${ue}${hn}`)||[],truncated:s}}async function pz(e,{budget:t=zh,rounds:n=Bh,focus:s=null,maxEnvironments:o=Hr,store:r}={}){let{loadMemory:i,readFactRows:a,appendFacts:c}=ZD(r,["loadMemory","readFactRows","appendFacts"],"classifyEl"),l=await i(e),u=a(l),{normalized:d,goals:p,goalInfo:f,finalPass:m,truncated:h}=uk(u,{budget:t,rounds:n,focus:s}),b=new Map;for(let _ of u)b.set(`${_.subject}${ue}${_.predicate}${ue}${_.object}`,_.trust);let g=new Map(u.map(_=>[_.id,_])),w=_=>(_||[]).map($=>g.get($)?.trust).filter($=>typeof $=="number"),y=new Set(u.filter(_=>ik(_.predicate)).map(_=>`${_.subject}${ue}${_.object}`)),v=[],R=[],S=new Set,j=[...m.subsumers.keys()].sort();for(let _ of j){let $=m.subsumers.get(_);if($.has(hn))continue;let T=[...$].filter(C=>C!==_&&C!==ko&&C!==hn).sort();for(let C of T){let E=`${_}${ue}${C}`;if(y.has(E))continue;let k=m.derivationOf.get(E)||[],P=f.get(C);if(P){S.has(C)||(S.add(C),v.push({subject:C,predicate:Ft,object:"owl:Restriction",provenance:Wa,justification:[k]}),v.push({subject:C,predicate:On,object:P.role,provenance:Wa,justification:[k]}),v.push({subject:C,predicate:Nn,object:P.filler,provenance:Wa,justification:[k]}));let D=w(k),H=v.length;v.push({subject:_,predicate:ze,object:C,provenance:Wa,justification:[k],...D.length?{premiseTrusts:D,ruleConfidence:Ph}:{}}),R.push({toWriteIndex:H,subject:_,object:C,rule:Dh})}else if(d.concepts.has(C)){let D=w(k),H=v.length;v.push({subject:_,predicate:ze,object:C,provenance:lk,justification:[k],...D.length?{premiseTrusts:D,ruleConfidence:Ph}:{}}),R.push({toWriteIndex:H,subject:_,object:C,rule:Fh})}}}let{ids:I}=await c(e,v),x=R.map(_=>({id:I[_.toWriteIndex],subject:_.subject,object:_.object,rule:_.rule}));return{derived:x,count:x.length,budget:t,rounds:n,truncated:h,unsatisfiable:m.unsatisfiable,goalCount:p.length}}var ue,ko,hn,js,ik,tz,nz,sz,oz,rz,iz,az,cz,lz,uz,Ua,Fh,lk,Dh,Wa,Ph,zh,Bh,fk=M(()=>{Ye();Ct();ue="\u241F",ko="top",hn="bot";js=e=>String(e||"").trim().toLowerCase(),ik=e=>js(e)==="rdfs:subclassof",tz=e=>js(e)==="rdf:type",nz=e=>js(e)==="owl:disjointwith",sz=e=>js(e)==="owl:onproperty",oz=e=>js(e)==="owl:somevaluesfrom",rz=e=>js(e)==="owl:allvaluesfrom",iz=e=>js(e)==="owl:onclass",az=e=>js(e)==="owl:intersectionof",cz=e=>js(e)==="rdfs:subpropertyof",lz=new Set(["owl:cardinality","owl:mincardinality","owl:maxcardinality"]),uz=e=>lz.has(js(e));Ua=new Set;Fh="elSubsumption",lk=`entailed:${Fh}`,Dh="elRestriction",Wa=`entailed:${Dh}`,Ph=.95,zh=2e3,Bh=64});var pk={};Nt(pk,{DEFAULT_REASONING_CONFIG:()=>Mu,resolveReasoningConfig:()=>wz});function gz(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function bz(e,t){return typeof e=="boolean"?e:t}function wz(e){let t=e?.reasoning||{},n={...Mu};for(let[s,o]of Object.entries(mz))t[s]!==void 0&&(n[o]=gz(t[s],Mu[o]));for(let[s,o]of Object.entries(hz))t[s]!==void 0&&(n[o]=bz(t[s],Mu[o]));return n}var Mu,mz,hz,mk=M(()=>{Mu=Object.freeze({syllogiseBudget:50,syllogiseDepth:32,classifyBudget:2e3,classifyRounds:64,maxEnvironments:4,proveSteps:5e3,proveBranches:256,proveNodes:512,askProveFallback:!0,askProveSteps:1e3,askProveBranches:64,askProveNodes:128}),mz=Object.freeze({syllogise_budget:"syllogiseBudget",syllogise_depth:"syllogiseDepth",classify_budget:"classifyBudget",classify_rounds:"classifyRounds",max_environments:"maxEnvironments",prove_steps:"proveSteps",prove_branches:"proveBranches",prove_nodes:"proveNodes",ask_prove_steps:"askProveSteps",ask_prove_branches:"askProveBranches",ask_prove_nodes:"askProveNodes"}),hz=Object.freeze({ask_prove_fallback:"askProveFallback"})});function Qh(e){if(!e)return null;let{node:t,shape:n,kind:s}=e;if(t==="find")return`locate a specific named entity ("${e.term}")`;if(t==="count")return`get a count of ${Fu(e.entityType)}`;if(t==="list")return`list/enumerate ${Fu(e.entityType)} matching a condition`;if(t==="superlative")return`rank/compare ${Fu(e.entityType)} by ${e.metricNoun||e.metric||"a metric"}`;if(t==="anaphora")return"follow up on the previous answer's result set (discourse anaphora)";if(t==="membership")return`understand "${e.term||"an entity"}"'s membership/relationship`;if(t==="clause")return Qh(e.clause);if(t==="miss")return null;if(t==="boolean"||t==="qualifier"||t==="reverseSet"||t==="forwardSet"||t==="allOfClass"||t==="temporal"){let o=s||e.inner?.kind;return o&&Bn[o]?Bn[o]:`filter/traverse ${Fu(e.entityType)} by a relationship`}return n==="meta"?`understand a vocabulary/definition term ("${e.object}")`:n==="where"?`locate where something is defined ("${e.object}")`:n==="when"?"understand when something last changed (history)":n==="whoLast"?"find who most recently touched something (history)":n==="mentions"?`find where something is mentioned in prose ("${e.object}")`:n==="ask"?s&&Bn[s]||"check a specific subject/object relationship":(n==="reverse"||n==="forward")&&s?Bn[s]||`understand a "${s}" relationship`:"understand a graph relationship"}function rg(e){let t=new Map;for(let n of e)t.has(bk(n))||t.set(bk(n),n);return t}function Wh(e,t=$r){let n=[],s=[];for(let c of e)c.predicate===t&&(s.push([c.subject,c.object]),yr(c)&&n.push([c.subject,c.object]));let o=new Map,r=new Map,i=new Set,a=(c,l,u)=>{!l||!u||l===u||(c.has(l)||c.set(l,new Set),c.get(l).add(u))};for(let[c,l]of s)a(r,c,l),l&&i.add(l);for(let[c,l]of n)a(o,c,l);return{strictEdges:n,broadEdges:s,strictSucc:o,broadSucc:r,reachableHeads:i}}function Gh(e,t,n,s,o){let r=s.reachableHeads,i=!1;for(let a of n)if(r.has(a)){i=!0;break}return i?e(t,n,[],s.strictSucc,o)||e(t,n,[],s.broadSucc,o):null}function kz(e,t){return!/ves$/i.test(e)||!/fe?$/i.test(t)?t:e.slice(0,-1)}async function Rz(e){let t=String(e||"").toLowerCase();try{let{proseLemma:n}=await Promise.resolve().then(()=>(Bj(),zj)),s=n();return s?kz(t,s(t)):t}catch{return t}}function ag(e){let t=String(e||"").trim();if(/[a-z]ies$/i.test(t))return`${t.slice(0,-3)}y`;if(/[a-z]ses$/i.test(t)){let n=t.slice(0,-2);return/ss$/i.test(n)||_z.has(n.toLowerCase())?n:t.slice(0,-1)}return/(xes|zes|ches|shes)$/i.test(t)?t.slice(0,-2):/[a-z]s$/i.test(t)&&!/(?:ss|ous)$/i.test(t)?t.slice(0,-1):t}async function Gu(e){let t=String(e||"").toLowerCase();if(t==="has"||t==="have")return ai;if(t==="can")return"mgx:capableOf";try{let n=await Rz(t);return n==="have"?ai:cs(`mgx:${n}`)}catch{return cs(`mgx:${t}`)}}function Lz(e,t){let n=String(t||"").match(Nz);return n&&/^mgx:[a-z]+$/.test(e)?{predicate:`${e}-${n[1].toLowerCase()}`,object:n[2].trim()}:{predicate:e,object:String(t||"").trim()}}async function Ga(e,t){if(!e||!t)return null;try{let{resolveObject:n}=await Promise.resolve().then(()=>(rs(),Ny)),s=n(e,t);if(s?.match?.id&&!s.ambiguous)return{id:s.match.id,label:s.match.label}}catch{}return null}function $k(e){return e.predicate===xz&&e.object==="transitiveproperty"||e.predicate===Wk}function qh(e){let t=/^mgx:([a-z][\w-]*)$/i.exec(String(e||""));return t?t[1].toLowerCase():null}function Uz(e){let t=String(e||"").trim(),n=t.toLowerCase();for(let{marker:s,predicate:o}of Bz)if(n!==s&&n.endsWith(` ${s}`)){let r=t.slice(0,t.length-s.length).trim();if(r)return{subject:r,predicate:o}}return{subject:t,predicate:null}}function Zh(e){return e.replace(/#node:[0-9a-f]+/g,"")}function lg(e){let t=EE(e),n=e.provenance?` (source: ${Zh(e.provenance)})`:"";return`${t?` ${t}`:""}${n}`}function _o(e){return`${Xs(e)}${lg(e)}`}function se(e){let t=lg(e);return e.predicate===Wk?`${km(e.subject)} implies ${km(e.object)}${t}`:e.provenance.includes("ace:chat")||e.provenance.includes("teach:chat")?`you told me: ${Xs(e)}${t}`:e.provenance.includes("corpus-weak:")?`possibly: ${Xs(e)}${t}`:e.provenance.includes("corpus:")?`${Xs(e)}${t}`:e.provenance.includes("reference:")?`${Xs(e)}${t}`:`i learned: ${Xs(e)}${t}`}function Sk(e,t,n,{toward:s=null}={}){let o=se(e);if(!Un.has(e.predicate)||!n.has(e.subject))return o;let r=du(e.object,t,{cap:6,stopAt:lu,toward:s});if(r.length<=1)return o;let i=` \u2192 ${r.slice(1).join(" \u2192 ")}`,a=lg(e);return!a||!o.endsWith(a)?o+i:o.slice(0,o.length-a.length)+i+a}function Ek(e,t,n,{indent:s=""}={}){let o=t.filter(R=>R.predicate===$r).map(R=>[R.subject,R.object]),r=Oa(o),i=e.map(R=>`${s}${Sk(R,r,n)}`),a=e.filter(R=>Un.has(R.predicate)&&n.has(R.subject)),c=[...new Set(a.map(R=>R.object))];if(c.length<2)return{lines:i,grouped:null};let l=t.filter(R=>R.predicate==="owl:disjointWith").map(R=>[R.subject,R.object]),{split:u,clusters:d}=fu(c,{parents:r,disjointEdges:l});if(!u)return{lines:i,grouped:null};let p=a[0].subject,f=new Map;for(let R of d)for(let S of R.objects)f.set(S,R);let m=e.filter(R=>!(Un.has(R.predicate)&&n.has(R.subject))),h=[],b=[],g=0,w=R=>{let S=Sk(R,r,n);return g<_e?(g+=1,`${s}${S}`):(b.push(S),null)};for(let R of d){let S=a.filter(j=>f.get(j.object)===R).map(w).filter(Boolean);S.length&&h.push(`${s}${p}, the ${R.label}:
177
+ ${S.join(`
178
+ `)}`)}if(m.length){let R=m.map(w).filter(Boolean);R.length&&h.push(`${s}also about ${p}:
179
179
  ${R.join(`
180
- `)}`)}let w=b.length?`
181
- ${s}\u2026and ${b.length} more \u2014 say 'more' to see them.`:"",E={text:h.join(`
182
- `)+w,replace:!0,...b.length?{pending:{items:b,noun:"facts"}}:{}};return{lines:i,grouped:E}}async function Sz(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(jj(),xj)))}catch{return null}let r;try{r=o(e,t,n)}catch{return null}if(!r||!r.paragraphs.length)return null;let i=[...new Set((r.sources||[]).map(u=>u.provenance).filter(Boolean))],a=i.length?`(sources: ${i.join("; ")})
180
+ `)}`)}let y=b.length?`
181
+ ${s}\u2026and ${b.length} more \u2014 say 'more' to see them.`:"",v={text:h.join(`
182
+ `)+y,replace:!0,...b.length?{pending:{items:b,noun:"facts"}}:{}};return{lines:i,grouped:v}}async function Gz(e,t,n,s){let o;try{({digestTermFromRows:o}=await Promise.resolve().then(()=>(Wj(),Uj)))}catch{return null}let r;try{r=o(e,t,n)}catch{return null}if(!r||!r.paragraphs.length)return null;let i=[...new Set((r.sources||[]).map(u=>u.provenance).filter(Boolean))],a=i.length?`(sources: ${i.join("; ")})
183
183
  `:"",c=`Say 'show the facts' for all ${s.length} stored facts.`;return{text:`${r.paragraphs.join(`
184
184
 
185
185
  `)}
186
186
 
187
- ${a}${c}`,pending:{items:s,noun:"facts"}}}function $r(e){let t=Hl().find(n=>n.kind==="article");return t&&km(String(e||""),t)?"an":"a"}function Ck(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${se(e)}; ${se(t)}. To settle it, say "forget that ${e.subject} is ${$r(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${se(t)}`,replace:!0}:e?{text:`yes \u2014 ${se(e)}`,replace:!0}:null}function Ez(e,t){return{text:`you've told me both ${Ro(e)} and ${Ro(t)} \u2014 together those contradict, and I won't derive an answer from an inconsistency. To settle it, say "forget that ${e.subject} is ${$r(e.object)} ${e.object}".`,replace:!0}}function Nu(e){let t=e[0],n=e[e.length-1];return`${e.map(s=>Ro(s)).join("; ")}; so ${t.subject} is a ${n.object}`}async function Lu(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(We(),Vs)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=a=>(o.attributes||[]).find(c=>c.key===a)?.value||"",i=r("extraction").split(" ").filter(Boolean);s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance"),...i.length?{extraction:i}:{}})}return s}catch{return[]}}async function rt(e,t=null){if(t?.rows)return t.rows;try{let{loadMemory:n,readFactRows:s}=await Promise.resolve().then(()=>(We(),Vs)),o=s(await n(e));return t&&(t.rows=o,t.reloads=(t.reloads||0)+1),o}catch{return[]}}function xz(e){if(!Pu)try{Pu=tn().nounPlurals}catch{Pu=new Map}return Pu.get(e)??null}function Bu(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return dn(tn(),t)?.lemma||t}catch{return t}}function jz(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Bu(e);let n=Bu(tg(t[1]));return`${$r(n)} ${n}`}function ee(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(kz,"").trim();r&&r!==n&&o.add(r);for(let i of o){s.add(i),i.endsWith("es")&&s.add(i.slice(0,-2)),i.endsWith("s")&&s.add(i.slice(0,-1));let a=xz(i);a&&s.add(e(a))}return s}function ik(e,t,n){for(let s of e)for(let o of t){let r=n(s,o);if(r)return r}return null}function Nk(e,t=null){let n=Uu(e),s=n.match(Rz);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(Tz);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function Yh(e){let t=String(e||"").replace(Iz,"");if(t!==e){let s=t.match(ko);if(s)return s}let n=String(e||"").match(Oz);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(ko):null}function Lz(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>Dn.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=ee(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=ee(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function Lk(e,t,n){if(t.has(n))return!0;for(let s of ee(e,n))if(t.has(s))return!0;return!1}function Pk(e,t,n,s){let o=a=>a.predicate===Fu&&s(a.object)===n||a.predicate===`tmct:${n}`&&a.object==="true",r=(a,c)=>Lk(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Dn.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function zz(e,t,n,s){let o=a=>a.predicate==="mgx:capableOf"&&n.has(s(a.object)),r=(a,c)=>Lk(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Dn.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function Bz(e){let t=String(e??"").trim().match(/^([\w-]+)\s+(\S.*)$/);if(!t)return null;let n=$a(t[1]);return n===null?null:{count:n,part:t[2]}}function zu(e){return String(e||"").replace(/^(?:can't|cannot|can not|cant)\s+/i,"can ").replace(/^(?:doesn't|does not)\s+/i,"does ").replace(/^(?:don't|do not)\s+/i,"do ").replace(/^(?:didn't|did not)\s+/i,"did ").replace(/\s+(?:not|never)\s+/i," ").replace(/\s+/g," ").trim()}function lk(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function tB(e,t){let n=(e||[]).map(s=>t.find(o=>o.predicate===s.predicate&&o.subject===s.subject&&o.object===s.object));return!n.length||!n.every(Boolean)?null:n.map(s=>Ro(s)).join("; ")}function dk(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=Dc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?tB(c,n):null;return l?` \u2014 via: ${l}`:""};if(i.verdict==="both")return{text:`I have both, at the same level of detail \u2014 my sources disagree, so I won't pick:
187
+ ${a}${c}`,pending:{items:s,noun:"facts"}}}function vr(e){let t=Ql().find(n=>n.kind==="article");return t&&Im(String(e||""),t)?"an":"a"}function Yk(e,t){return e&&t?{text:`you've told me both, and I won't pick between them \u2014 ${se(e)}; ${se(t)}. To settle it, say "forget that ${e.subject} is ${vr(e.object)} ${e.object}".`,replace:!0}:t?{text:`no \u2014 ${se(t)}`,replace:!0}:e?{text:`yes \u2014 ${se(e)}`,replace:!0}:null}function Vz(e,t){return{text:`you've told me both ${_o(e)} and ${_o(t)} \u2014 together those contradict, and I won't derive an answer from an inconsistency. To settle it, say "forget that ${e.subject} is ${vr(e.object)} ${e.object}".`,replace:!0}}function Du(e){let t=e[0],n=e[e.length-1];return`${e.map(s=>_o(s)).join("; ")}; so ${t.subject} is a ${n.object}`}async function zu(e){try{let{loadMemory:t}=await Promise.resolve().then(()=>(Ue(),Hs)),n=await t(e),s=[];for(let o of n.individuals||[]){if(o?.class!=="Fact")continue;let r=a=>(o.attributes||[]).find(c=>c.key===a)?.value||"",i=r("extraction").split(" ").filter(Boolean);s.push({subject:r("subject"),predicate:r("predicate"),object:r("object"),provenance:r("provenance"),...i.length?{extraction:i}:{}})}return s}catch{return[]}}async function rt(e,t=null){if(t?.rows)return t.rows;try{let{foldedFactRows:n}=await Promise.resolve().then(()=>(Ue(),Hs)),s=await n(e);return t&&(t.rows=s,t.reloads=(t.reloads||0)+1),s}catch{return[]}}function Kz(e){if(!Bu)try{Bu=tn().nounPlurals}catch{Bu=new Map}return Bu.get(e)??null}function Ku(e){let t=String(e||"").trim().toLowerCase();if(!t||/\s/.test(t))return t;try{return pn(tn(),t)?.lemma||t}catch{return t}}function Hz(e){let t=String(e||"").trim().match(/^(?:all|every|each|both|most|some)\s+([\w-]+)$/i);if(!t)return Ku(e);let n=Ku(ag(t[1]));return`${vr(n)} ${n}`}function ee(e,t){let n=e(t),s=new Set,o=new Set([n]),r=n.replace(qz,"").trim();r&&r!==n&&o.add(r);for(let i of o){s.add(i),i.endsWith("es")&&s.add(i.slice(0,-2)),i.endsWith("s")&&s.add(i.slice(0,-1));let a=Kz(i);a&&s.add(e(a))}return s}function xk(e,t,n){for(let s of e)for(let o of t){let r=n(s,o);if(r)return r}return null}function Qk(e,t=null){let n=Hu(e),s=n.match(Yz);if(s)return[s[0],s[2],s[1]];if(!t)return null;let o=n.match(Jz);return o&&t(o[1])?[o[0],o[2],o[1]]:null}function tg(e){let t=String(e||"").replace(eB,"");if(t!==e){let s=t.match(Ro);if(s)return s}let n=String(e||"").match(tB);return n?`is ${n[1].trim()} a ${n[2].trim()}`.match(Ro):null}function sB(e,t,n){let s=String(e||"").trim().split(/\s+/).filter(Boolean);if(s.length<2)return null;let o=t.filter(r=>Un.has(r.predicate));if(!o.length)return null;for(let r=1;r<s.length;r+=1){let i=ee(n,s.slice(0,r).join(" ")),a=s.slice(r).join(" "),c=ee(n,a);if(o.some(l=>c.has(l.subject)&&i.has(l.object)))return a}return null}function Zk(e,t,n){if(t.has(n))return!0;for(let s of ee(e,n))if(t.has(s))return!0;return!1}function eR(e,t,n,s){let o=a=>a.predicate===Wu&&s(a.object)===n||a.predicate===`tmct:${n}`&&a.object==="true",r=(a,c)=>Zk(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Un.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function cB(e,t,n,s){let o=a=>a.predicate==="mgx:capableOf"&&n.has(s(a.object)),r=(a,c)=>Zk(s,a,c.subject),i=e.find(a=>r(t,a)&&o(a));if(i)return[i];for(let a of e.filter(c=>Un.has(c.predicate)&&r(t,c))){let c=ee(s,a.object),l=e.find(u=>r(c,u)&&o(u));if(l)return[a,l]}return null}function lB(e){let t=String(e??"").trim().match(/^([\w-]+)\s+(\S.*)$/);if(!t)return null;let n=xa(t[1]);return n===null?null:{count:n,part:t[2]}}function Vu(e){return String(e||"").replace(/^(?:can't|cannot|can not|cant)\s+/i,"can ").replace(/^(?:doesn't|does not)\s+/i,"does ").replace(/^(?:don't|do not)\s+/i,"do ").replace(/^(?:didn't|did not)\s+/i,"did ").replace(/\s+(?:not|never)\s+/i," ").replace(/\s+/g," ").trim()}function Rk(e){let t=String(e.text||"").replace(/^(?:yes|no) — /i,"");return t===e.text?e:{...e,text:t}}function EB(e,t){let n=(e||[]).map(s=>t.find(o=>o.predicate===s.predicate&&o.subject===s.subject&&o.object===s.object));return!n.length||!n.every(Boolean)?null:n.map(s=>_o(s)).join("; ")}function Tk(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=Wc(o,r,n,{maxHops:s}),a=c=>{let l=c&&c.length?EB(c,n):null;return l?` \u2014 via: ${l}`:""};if(i.verdict==="both")return{text:`I have both, at the same level of detail \u2014 my sources disagree, so I won't pick:
188
188
  ${[...i.negative,...i.positive].map(se).join(`
189
- `)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let c=i.verdict==="no"?i.negative[0]:i.positive[0],l=`${i.verdict} \u2014 ${se(c)}${a(i.chain)}`;return i.overrides&&(l+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${se(i.overrides.fact)}`),{text:l,replace:!0}}return null}function fk(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=Wf(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,c=`I don't know if ${e} can ${t}.`;if(i.positive.length||i.negative.length){let u=[`${i.positive.length} can ${t}`,`${i.negative.length} cannot`,`${i.unknown.length} I have nothing on`].join(", "),d=[...i.positive,...i.negative].slice(0,Uf).map(p=>se(p.fact));return{text:`${c} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
189
+ `)}`,replace:!0,miss:!0};if(i.verdict==="yes"||i.verdict==="no"){let c=i.verdict==="no"?i.negative[0]:i.positive[0],l=`${i.verdict} \u2014 ${se(c)}${a(i.chain)}`;return i.overrides&&(l+=`. That overrides what I know about ${i.overrides.fact.subject} generally: ${se(i.overrides.fact)}`),{text:l,replace:!0}}return null}function Ak(e,t,n,{maxHops:s=3}={}){let o=ee(V,e),r=ee(V,t),i=Xf(o,r,n,{maxHops:s});if(!i)return null;let a=`${e} is a kind of ${i.klass}`,c=`I don't know if ${e} can ${t}.`;if(i.positive.length||i.negative.length){let u=[`${i.positive.length} can ${t}`,`${i.negative.length} cannot`,`${i.unknown.length} I have nothing on`].join(", "),d=[...i.positive,...i.negative].slice(0,Yf).map(p=>se(p.fact));return{text:`${c} ${a}, and of the ${i.kinds} kind${i.kinds===1?"":"s"} of ${i.klass} I know, ${u}.
190
190
  ${d.join(`
191
- `)}`,replace:!0,miss:!0}}let l=Gf(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,Uf),d=l.slice(u.length);return{text:`${c} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${l.length} thing${l.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
191
+ `)}`,replace:!0,miss:!0}}let l=Jf(r,n,{exclude:new Set([...o,i.klass])});if(l.length){let u=l.slice(0,Yf),d=l.slice(u.length);return{text:`${c} ${a}, and nothing I know about ${i.klass} says whether one can ${t}. I do know ${l.length} thing${l.length===1?"":"s"} that can ${t}${d.length?` (first ${u.length} shown)`:""}:
192
192
  ${u.map(se).join(`
193
- `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(se),noun:"facts"}}:{}}}return{text:`${c} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function oB(e){let t=String(e||"").toLowerCase().trim().replace(/\s+/g," ");if(t==="best")return"better";if(t==="worst")return"worse";let n=t.match(/^(most|least)\s+([a-z][\w-]*)$/);return n?`${n[1]==="most"?"more":"less"} ${n[2]}`:/[a-z]est$/.test(t)&&t.length>4?`${t.slice(0,-3)}er`:null}function En(e){let t=new Set,n=[];for(let s of e){let o=`${s.subject}|${s.predicate}|${s.object}`;t.has(o)||(t.add(o),n.push(s))}return n}async function Fk(e,t,n,s,o={},r=null,i=null){return Dk(zk(await gB(e,t,n,s,o,r,i),n,t),lu.FACT_SET)}function Dk(e,t){return!e||e.miss||typeof e.text!="string"||!ox(e.text,e)?e:{...e,enumerationLane:t}}function zk(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Kh(t?.parsed);if(!o&&e.generalVerbQuery&&(o=Jj),!o){let r=s.match(qh),i=r?null:Uu(s).match(Ok)||Nk(s),a=r?r[2]:i?i[1]:null;a&&!Xh.has(a.toLowerCase())&&(o=Jj)}if(!o){let r=s.match(Uk);r&&(o=Kh({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function Wh(e,t,n,s,o=null,r=[]){let{ON_PROPERTY_PREDICATE:i,SOME_VALUES_FROM_PREDICATE:a}=await Promise.resolve().then(()=>(It(),un)),c=await rt(e,t),l=new Map,u=new Map;for(let f of c)f.predicate===i?l.set(f.subject,f.object):f.predicate===a&&u.set(f.subject,f.object);let d=c.filter(f=>f.predicate===yr&&n.has(f.subject)&&l.has(f.object)&&u.has(f.object)),p=d.filter(f=>s.has(u.get(f.object))).sort((f,m)=>f.object.localeCompare(m.object))[0];if(p){let f=new Map(c.map(b=>[b.id,b])),m=(p.justification||[]).map(b=>f.get(b)).filter(b=>b&&b.predicate===yr),h=m.length?m:[p];return{text:`yes \u2014 ${[...r,...h].map(se).join("; ")}`,replace:!0}}return d.length&&o?{text:`I can't confirm that \u2014 nothing I remember composes to it yet. Run "/classify ${o}", then ask me again.`,replace:!0,miss:!0}:null}async function dB(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(Th(),_h)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(qj(),Hj)),a=e.filter(h=>h.predicate==="rdf:type"&&t.has(h.subject)).map(h=>h.object),c=[...new Set([...t,...a])],l=s(e,c),u=new Map(l.map(h=>[h.id,h])),d=o(l),p=d.individuals.filter(h=>t.has(h));if(p.length){let h={maxSteps:n.proveSteps,maxBranches:n.proveBranches,maxNodes:n.proveNodes},b=r(d,p,h)[0];if(b){let g=b.premises.map(y=>u.get(y)).filter(Boolean).map(se).join("; ");return`I can't answer that \u2014 what I've been told about ${b.subject} is inconsistent: ${g||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`}}let f=i(l,{budget:n.classifyBudget,rounds:n.classifyRounds,focus:new Set(c)}),m=f.unsatisfiable.find(h=>t.has(h)||a.includes(h));if(m){let h=f.premisesOf(m).map(b=>u.get(b)).filter(Boolean).map(se).join("; ");return`I can't answer that \u2014 "${m}" can never have any members: ${h||"its own subclass chain is unsatisfiable"}. I'd need one of those retracted before I can answer honestly.`}return null}function pB(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return fB.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function mB(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${$r(n)} ${n}`).join(" or ")}function mk(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${mB(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function hB(e,t,n,s,o,r,i){if(!pB(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:p,moduleHasDlShape:f}=await Promise.resolve().then(()=>(Th(),_h)),{normFactTerm:m}=await Promise.resolve().then(()=>(We(),Vs)),h=$k(o,n,m(s)),b=$k(r,n,m(i)),g=n.filter(C=>C.predicate==="rdf:type"&&o.has(C.subject)).map(C=>C.object),y=a(n,[h,b,...g]);if(!f(y))return null;let w=await Wk(e);if(!w.askProveFallback)return null;let E=c(y),R={maxSteps:w.askProveSteps,maxBranches:w.askProveBranches,maxNodes:w.askProveNodes},v=E.namedIndividuals.has(h),k=new Map(y.map(C=>[C.id,C]));if(v){let C=p(E,[h],R)[0];if(C){let S=C.premises.map(j=>k.get(j)).filter(Boolean).map(se).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${C.subject} is inconsistent: ${S||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let I=C=>C.premises.map(S=>k.get(S)).filter(Boolean).map(se).join("; "),x=v?l(E,h,{t:"atom",name:b},R):u(E,h,b,R);if(x.status==="proved"){let C=I(x),S=mk(x,s,i);return{text:`yes \u2014 ${C}; ${S}`,replace:!0}}if(x.status==="exhausted")return{budgetExhausted:!0};let T=v?l(E,h,{t:"not",c:{t:"atom",name:b}},R):d(E,h,b,R);if(T.status==="exhausted")return{budgetExhausted:!0};if(T.status!=="proved")return null;let $=I(T),_=mk(T,s,i,{negate:!0});return{text:`no \u2014 ${$}; ${_}`,replace:!0}}async function gB(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(We(),Vs)))}catch{return null}let l=String(t).trim(),u=l.match(Vz);if(u){let W=ee(a,u[1]),O=(await rt(e,r)).filter(D=>D.predicate==="mgx:usedFor"&&W.has(D.object));if(O.length){let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
194
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
195
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}for(let{predicate:W,re:O}of iB){let D=l.match(O);if(!D)continue;let N=ee(a,D[1]),F=(await rt(e,r)).filter(fe=>fe.predicate===W&&N.has(fe.object));if(!F.length)continue;let U=lt(En(F),o).map(se),G=U.slice(0,_e),Q=U.slice(_e),ie=Q.length?`
193
+ `)}`,replace:!0,miss:!0,...d.length?{pending:{items:d.map(se),noun:"facts"}}:{}}}return{text:`${c} ${a}, but nothing I remember says whether any kind of ${i.klass} can ${t}.`,replace:!0,miss:!0}}function kB(e){let t=String(e||"").toLowerCase().trim().replace(/\s+/g," ");if(t==="best")return"better";if(t==="worst")return"worse";let n=t.match(/^(most|least)\s+([a-z][\w-]*)$/);return n?`${n[1]==="most"?"more":"less"} ${n[2]}`:/[a-z]est$/.test(t)&&t.length>4?`${t.slice(0,-3)}er`:null}function jn(e){let t=new Set,n=[];for(let s of e){let o=`${s.subject}|${s.predicate}|${s.object}`;t.has(o)||(t.add(o),n.push(s))}return n}async function nR(e,t,n,s,o={},r=null,i=null){return sR(oR(await FB(e,t,n,s,o,r,i),n,t),mu.FACT_SET)}function sR(e,t){return!e||e.miss||typeof e.text!="string"||!Sx(e.text,e)?e:{...e,enumerationLane:t}}function oR(e,t,n){if(!e||e.goal!==void 0)return e;let s=String(n||"").trim(),o=Qh(t?.parsed);if(!o&&e.generalVerbQuery&&(o=hk),!o){let r=s.match(eg),i=r?null:Hu(s).match(Jk)||Qk(s),a=r?r[2]:i?i[1]:null;a&&!ng.has(a.toLowerCase())&&(o=hk)}if(!o){let r=s.match(iR);r&&(o=Qh({shape:"meta",object:r[1]}))}return o?{...e,goal:o}:e}async function Yh(e,t,n,s,o=null,r=[]){let{ON_PROPERTY_PREDICATE:i,SOME_VALUES_FROM_PREDICATE:a}=await Promise.resolve().then(()=>(Ct(),fn)),c=await rt(e,t),l=new Map,u=new Map;for(let f of c)f.predicate===i?l.set(f.subject,f.object):f.predicate===a&&u.set(f.subject,f.object);let d=c.filter(f=>f.predicate===$r&&n.has(f.subject)&&l.has(f.object)&&u.has(f.object)),p=d.filter(f=>s.has(u.get(f.object))).sort((f,m)=>f.object.localeCompare(m.object))[0];if(p){let f=new Map(c.map(b=>[b.id,b])),m=(p.justification||[]).map(b=>f.get(b)).filter(b=>b&&b.predicate===$r),h=m.length?m:[p];return{text:`yes \u2014 ${[...r,...h].map(se).join("; ")}`,replace:!0}}return d.length&&o?{text:`I can't confirm that \u2014 nothing I remember composes to it yet. Run "/classify ${o}", then ask me again.`,replace:!0,miss:!0}:null}async function OB(e,t,n){let{extractTableauModule:s,buildTableauKb:o,findTableauViolations:r}=await Promise.resolve().then(()=>(Lh(),Nh)),{elUnsatisfiableClasses:i}=await Promise.resolve().then(()=>(fk(),dk)),a=e.filter(h=>h.predicate==="rdf:type"&&t.has(h.subject)).map(h=>h.object),c=[...new Set([...t,...a])],l=s(e,c),u=new Map(l.map(h=>[h.id,h])),d=o(l),p=d.individuals.filter(h=>t.has(h));if(p.length){let h={maxSteps:n.proveSteps,maxBranches:n.proveBranches,maxNodes:n.proveNodes},b=r(d,p,h)[0];if(b){let g=b.premises.map(w=>u.get(w)).filter(Boolean).map(se).join("; ");return`I can't answer that \u2014 what I've been told about ${b.subject} is inconsistent: ${g||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`}}let f=i(l,{budget:n.classifyBudget,rounds:n.classifyRounds,focus:new Set(c)}),m=f.unsatisfiable.find(h=>t.has(h)||a.includes(h));if(m){let h=f.premisesOf(m).map(b=>u.get(b)).filter(Boolean).map(se).join("; ");return`I can't answer that \u2014 "${m}" can never have any members: ${h||"its own subclass chain is unsatisfiable"}. I'd need one of those retracted before I can answer honestly.`}return null}function LB(e){return e.some(t=>{let n=String(t?.predicate||"").trim().toLowerCase();return NB.has(n)?!0:n==="rdf:type"&&String(t?.object||"").toLowerCase()==="transitiveproperty"})}function PB(e,t){return t>e.length?`one of ${t} possibilities`:e.map(n=>n.t==="nom"?n.ind:n.name).map(n=>`${vr(n)} ${n}`).join(" or ")}function Ik(e,t,n,{negate:s=!1}={}){let o=s?`is not a ${n}`:`is a ${n}`;return!e.cases||!e.cases.length?`so ${t} ${o}.`:`in every case \u2014 ${PB(e.cases,e.casesTotal)} \u2014 ${t} ${o}.`}async function MB(e,t,n,s,o,r,i){if(!LB(n))return null;let{extractTableauModule:a,buildTableauKb:c,proveEntailment:l,proveSubsumption:u,proveSubsumptionOfNegation:d,findTableauViolations:p,moduleHasDlShape:f}=await Promise.resolve().then(()=>(Lh(),Nh)),{normFactTerm:m}=await Promise.resolve().then(()=>(Ue(),Hs)),h=Fk(o,n,m(s)),b=Fk(r,n,m(i)),g=n.filter(C=>C.predicate==="rdf:type"&&o.has(C.subject)).map(C=>C.object),w=a(n,[h,b,...g]);if(!f(w))return null;let y=await aR(e);if(!y.askProveFallback)return null;let v=c(w),R={maxSteps:y.askProveSteps,maxBranches:y.askProveBranches,maxNodes:y.askProveNodes},S=v.namedIndividuals.has(h),j=new Map(w.map(C=>[C.id,C]));if(S){let C=p(v,[h],R)[0];if(C){let E=C.premises.map(k=>j.get(k)).filter(Boolean).map(se).join("; ");return{text:`I can't answer that \u2014 what I've been told about ${C.subject} is inconsistent: ${E||"the facts I hold about it clash"}. I'd need one of those retracted before I can answer honestly.`,replace:!0}}}let I=C=>C.premises.map(E=>j.get(E)).filter(Boolean).map(se).join("; "),x=S?l(v,h,{t:"atom",name:b},R):u(v,h,b,R);if(x.status==="proved"){let C=I(x),E=Ik(x,s,i);return{text:`yes \u2014 ${C}; ${E}`,replace:!0}}if(x.status==="exhausted")return{budgetExhausted:!0};let _=S?l(v,h,{t:"not",c:{t:"atom",name:b}},R):d(v,h,b,R);if(_.status==="exhausted")return{budgetExhausted:!0};if(_.status!=="proved")return null;let $=I(_),T=Ik(_,s,i,{negate:!0});return{text:`no \u2014 ${$}; ${T}`,replace:!0}}async function FB(e,t,n,s,o={},r=null,i=null){let a,c;try{({normFactTerm:a,normFactPredicate:c}=await Promise.resolve().then(()=>(Ue(),Hs)))}catch{return null}let l=String(t).trim(),u=l.match(pB);if(u){let W=ee(a,u[1]),N=(await rt(e,r)).filter(F=>F.predicate==="mgx:usedFor"&&W.has(F.object));if(N.length){let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
194
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
195
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}for(let{predicate:W,re:N}of _B){let F=l.match(N);if(!F)continue;let O=ee(a,F[1]),z=(await rt(e,r)).filter(fe=>fe.predicate===W&&O.has(fe.object));if(!z.length)continue;let U=lt(jn(z),o).map(se),G=U.slice(0,_e),Q=U.slice(_e),ae=Q.length?`
196
196
  \u2026and ${Q.length} more \u2014 say 'more' to see them.`:"";return{text:G.join(`
197
- `)+ie,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}let d=l.match(nB),p=d?null:l.match(sB),f=d?d[1]:p?.[2],m=d?d[2]:p?.[1],h=f&&m?oB(m):null;if(h){let W=`mgx:${h.replace(/\s+/g,"-")}-than`,O=await rt(e,r),D=ee(a,f),N=[...D].sort((U,G)=>U.length-G.length)[0],F=U=>D.has(U)||U.startsWith(`${N}-`)||U.startsWith(`${N} `)||O.some(G=>Dn.has(G.predicate)&&G.subject===U&&D.has(G.object)),B=En(O.filter(U=>U.predicate===W&&wr(U))).filter(U=>U.subject!==U.object&&F(U.subject)&&F(U.object));if(B.length){let U=new Set,G=new Map;for(let Z of B)U.add(Z.subject),U.add(Z.object),G.set(Z.object,(G.get(Z.object)||0)+1),G.has(Z.subject)||G.set(Z.subject,G.get(Z.subject)||0);let Q=new Map(G),ie=[],fe=null;for(;Q.size;){let Z=[...Q.keys()].filter(te=>Q.get(te)===0);if(Z.length!==1){fe=Z.length===0?{text:`I can't order the ${N}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${N} from what I know \u2014 nothing compares ${Z[0]} and ${Z[1]}. Teach me, e.g. "${Z[0]} is ${h} than ${Z[1]}".`,replace:!0,miss:!0};break}let J=Z[0];ie.push(J),Q.delete(J);for(let te of B)te.subject===J&&Q.has(te.object)&&Q.set(te.object,Q.get(te.object)-1)}if(fe)return fe;let ae=ie.slice(0,-1).map((Z,J)=>B.find(te=>te.subject===Z&&te.object===ie[J+1]));if(ae.every(Boolean)){let Z=ae.map(J=>Ro(J)).join("; ");return{text:`${ie[0]} \u2014 ${Z}; so ${ie[0]} is the ${m} ${N}`,replace:!0}}}}let b=s?l.match(Kz)||l.match(Hz):null;if(b){let W=ee(a,b[1]),O=(await rt(e,r)).filter(D=>xr(D.predicate)!==null&&W.has(D.subject));if(O.length){let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
198
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
199
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}let g=l.match(qz);if(g){let W=g[1].toLowerCase(),O=ee(a,g[2].replace(/^(?:an?|the)\s+/i,"").trim()),D=(await rt(e,r)).filter(N=>xr(N.predicate)===W&&O.has(N.object));if(D.length){let F=lt(En(D),o).map(se),B=F.slice(0,_e),U=F.slice(_e),G=U.length?`
197
+ `)+ae,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}let d=l.match(xB),p=d?null:l.match(jB),f=d?d[1]:p?.[2],m=d?d[2]:p?.[1],h=f&&m?kB(m):null;if(h){let W=`mgx:${h.replace(/\s+/g,"-")}-than`,N=await rt(e,r),F=ee(a,f),O=[...F].sort((U,G)=>U.length-G.length)[0],z=U=>F.has(U)||U.startsWith(`${O}-`)||U.startsWith(`${O} `)||N.some(G=>Un.has(G.predicate)&&G.subject===U&&F.has(G.object)),B=jn(N.filter(U=>U.predicate===W&&yr(U))).filter(U=>U.subject!==U.object&&z(U.subject)&&z(U.object));if(B.length){let U=new Set,G=new Map;for(let Z of B)U.add(Z.subject),U.add(Z.object),G.set(Z.object,(G.get(Z.object)||0)+1),G.has(Z.subject)||G.set(Z.subject,G.get(Z.subject)||0);let Q=new Map(G),ae=[],fe=null;for(;Q.size;){let Z=[...Q.keys()].filter(te=>Q.get(te)===0);if(Z.length!==1){fe=Z.length===0?{text:`I can't order the ${O}s \u2014 the "${h} than" facts I have loop back on themselves, so no ${m} exists. /memory to inspect them.`,replace:!0,miss:!0}:{text:`I can't pick the ${m} ${O} from what I know \u2014 nothing compares ${Z[0]} and ${Z[1]}. Teach me, e.g. "${Z[0]} is ${h} than ${Z[1]}".`,replace:!0,miss:!0};break}let X=Z[0];ae.push(X),Q.delete(X);for(let te of B)te.subject===X&&Q.has(te.object)&&Q.set(te.object,Q.get(te.object)-1)}if(fe)return fe;let ie=ae.slice(0,-1).map((Z,X)=>B.find(te=>te.subject===Z&&te.object===ae[X+1]));if(ie.every(Boolean)){let Z=ie.map(X=>_o(X)).join("; ");return{text:`${ae[0]} \u2014 ${Z}; so ${ae[0]} is the ${m} ${O}`,replace:!0}}}}let b=s?l.match(mB)||l.match(hB):null;if(b){let W=ee(a,b[1]),N=(await rt(e,r)).filter(F=>kr(F.predicate)!==null&&W.has(F.subject));if(N.length){let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
198
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
199
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}let g=l.match(gB);if(g){let W=g[1].toLowerCase(),N=ee(a,g[2].replace(/^(?:an?|the)\s+/i,"").trim()),F=(await rt(e,r)).filter(O=>kr(O.predicate)===W&&N.has(O.object));if(F.length){let z=lt(jn(F),o).map(se),B=z.slice(0,_e),U=z.slice(_e),G=U.length?`
200
200
  \u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:B.join(`
201
- `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}{let W=l.match(Yz),O=W?W[2]:g&&["in","inside"].includes(g[1].toLowerCase())?g[2]:null;if(O!=null){let D=W&&W[1].toLowerCase()==="parts"?["mgx:partOf"]:bz,N=ee(a,O.replace(/^(?:an?|the)\s+/i,"").trim()),F=(await rt(e,r)).filter(B=>D.includes(B.predicate)&&N.has(B.object)).sort(ZD);if(F.length){let U=lt(En(F),o).map(se),G=U.slice(0,_e),Q=U.slice(_e),ie=Q.length?`
201
+ `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}{let W=l.match(bB),N=W?W[2]:g&&["in","inside"].includes(g[1].toLowerCase())?g[2]:null;if(N!=null){let F=W&&W[1].toLowerCase()==="parts"?["mgx:partOf"]:Dz,O=ee(a,N.replace(/^(?:an?|the)\s+/i,"").trim()),z=(await rt(e,r)).filter(B=>F.includes(B.predicate)&&O.has(B.object)).sort(vz);if(z.length){let U=lt(jn(z),o).map(se),G=U.slice(0,_e),Q=U.slice(_e),ae=Q.length?`
202
202
  \u2026and ${Q.length} more \u2014 say 'more' to see them.`:"";return{text:G.join(`
203
- `)+ie,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}}}let y=l.match(Xz);if(y){let W=y[3].toLowerCase(),O=ee(a,y[2]),D=new Set([...ee(a,y[1])].map(F=>c(`mgx:${W}-${F.replace(/\s+/g,"-")}`))),N=(await rt(e,r)).filter(F=>D.has(c(F.predicate))&&O.has(a(F.subject)));if(N.length){let B=lt(En(N),o).map(se),U=B.slice(0,_e),G=B.slice(_e),Q=G.length?`
203
+ `)+ae,replace:!0,...Q.length?{pending:{items:Q,noun:"facts"}}:{}}}}}let w=l.match(wB);if(w){let W=w[3].toLowerCase(),N=ee(a,w[2]),F=new Set([...ee(a,w[1])].map(z=>c(`mgx:${W}-${z.replace(/\s+/g,"-")}`))),O=(await rt(e,r)).filter(z=>F.has(c(z.predicate))&&N.has(a(z.subject)));if(O.length){let B=lt(jn(O),o).map(se),U=B.slice(0,_e),G=B.slice(_e),Q=G.length?`
204
204
  \u2026and ${G.length} more \u2014 say 'more' to see them.`:"";return{text:U.join(`
205
- `)+Q,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}let w=n?.parsed?.shape==="meta"?n.parsed.object:null,E=n?.parsed&&n.parsed.node!=="miss";if(!w&&s&&!E&&!pk.test(l)){let W=l.match(Uk)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);W&&(w=Zs(W[1]))}if(!w&&s){let W=l.match(OB);W&&(w=Zs(gn(W[1].trim())))}if(!w&&n?.ambiguous&&Array.isArray(n.candidateParses)){let W=n.candidateParses.find(O=>O?.shape==="meta"&&O.object);W&&(w=Zs(String(W.object)))}if(w){let W=$z(w),{predicate:O}=W,D=W.subject.replace(/^(?:the|an?)\s+/i,"").trim()||W.subject,N=!1;if(O&&Hs.test(D)){if(!i){let oe=String(Ks[O]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${D.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${oe?` ${oe}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}D=i,N=!0}let F=ee(a,D),B=await rt(e,r);if(!B.some(oe=>F.has(oe.subject)||F.has(oe.object))){let oe=Lz(D,B,a);oe&&(D=oe,F=ee(a,D))}let U=(await rt(e,r)).filter(oe=>F.has(oe.subject)&&!tk.has(oe.predicate)&&!nk(oe)&&!sk.has(oe.predicate)),G=O?U.filter(oe=>c(oe.predicate)===O):U;if(!O&&G.length&&!G.some(Gh)&&(G=[]),!G.length){if(O&&(U.length||N))return{text:`I don't have any "${Ks[O]}" facts about ${D}.`,replace:s,...U.length?{}:{miss:!0}};if(!O){let oe=lt((await rt(e,r)).filter(Ae=>F.has(Ae.object)),o);if(oe.length&&!oe.some(Gh)&&(oe=[]),oe.length){let Ae=oe.map(se),pe=Ae.slice(0,_e),je=Ae.slice(_e),Le=je.length?`
206
- \u2026and ${je.length} more \u2014 say 'more' to see them.`:"";return{text:pe.join(`
207
- `)+Le,replace:s,...je.length?{pending:{items:je,noun:"facts"}}:{}}}}return null}G=lt(G,o);let Q=await rt(e,r),{lines:ie,grouped:fe}=rk(G,Q,F),ae=!O&&ie.length>vz?await Sz(D,G,Q,ie):null;if(ae)return{...ae,replace:s};if(fe)return{...fe,replace:s};let Z=ie.slice(0,_e),J=ie.slice(_e),te=J.length?`
208
- \u2026and ${J.length} more \u2014 say 'more' to see them.`:"";return{text:Z.join(`
209
- `)+te,replace:s,...J.length?{pending:{items:J,noun:"facts"}}:{}}}if(!s)return null;let R=l.match(tz);if(R){let O=`mgx:${R[2].toLowerCase().replace(/\s+/g,"-")}-than`,D=await Lu(e),N=ae=>{let Z=ae.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Hs.test(Z)?i:Z},F=N(R[1]),B=N(R[3]),U=ee(a,F),G=ee(a,B),Q=D.find(ae=>ae.predicate===O&&U.has(ae.subject)&&G.has(ae.object));if(Q){let ae=D.find(J=>J.predicate===O&&U.has(J.object)&&G.has(J.subject)),Z=ae?` \u2014 though you also told me the opposite: ${se(ae)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${se(Q)}${Z}`,replace:!0}}let ie=D.filter(ae=>ae.predicate===O&&(U.has(ae.subject)||U.has(ae.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${ie.length?` I do know: ${ie.slice(0,3).map(se).join("; ")}.`:""} If it's true, teach me: "${F} is ${R[2].toLowerCase()} than ${B}".`,replace:!0,miss:!0}}let v=zu(l).match(Dz);if(v){let W=ee(a,v[1]),O=v[2].toLowerCase(),D=await rt(e,r),N=Pk(D,W,O,a)??zz(D,W,new Set([`be ${O}`,O]),a);if(N)return{text:`yes \u2014 ${N.map(se).join("; ")}`,replace:!0}}for(let{predicate:W,phrase:O,re:D}of lB){let N=l.match(D);if(!N)continue;let F=await Lu(e),B=ee(a,N[1]),U=ee(a,N[2]),G=F.find(Z=>Z.predicate===W&&B.has(Z.subject)&&U.has(Z.object));if(G)return{text:`yes \u2014 ${se(G)}`,replace:!0};let[Q]=O.split(" "),ie=await Du(ba(Q));if(ie!==W){let Z=ie.replace(/^mgx:/,"mgxneg:");if(F.some(J=>(J.predicate===ie||J.predicate===Z)&&B.has(J.subject)))continue}let fe=cB.has(W)?` If it's true, teach me: "${N[1]} ${O} ${N[2]}".`:"",ae=F.filter(Z=>Z.predicate===W&&B.has(Z.subject));if(ae.length){let Z=ae.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}. I do know: ${Z}.${fe}`,replace:!0,miss:!0}}if(!n?.parsed&&F.some(Z=>B.has(Z.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${N[1]} ${O} ${N[2]}.${fe}`,replace:!0,miss:!0};break}let k=l.match(ko)||Yh(l);if(k){let W=ee(a,k[1]),O=ee(a,k[2]),D=await rt(e,r),N=G=>W.has(G.subject)&&O.has(G.object),{DISJOINT_PREDICATE:F}=await Promise.resolve().then(()=>(It(),un)),B=G=>W.has(G.subject)||W.has(G.object)||O.has(G.subject)||O.has(G.object);return D.some(G=>G.predicate===F&&wr(G)&&B(G))?null:Ck(D.find(G=>Dn.has(G.predicate)&&N(G)),D.find(G=>G.predicate===Mc&&N(G)))}let I=zu(l),x=I.match(Pz);if(x){let W=await rt(e,r),O=x[1],D=dk(x[2],x[3],W);if(D&&I!==uk(l)&&(D=lk(D)),D&&O)return{text:`I can't speak for ${O.trim()} ${x[2]} \u2014 what I remember is generic, not universal. ${D.text}.`,replace:!0};if(D)return D;let N=ee(a,x[2]),F=W.filter(B=>B.predicate==="mgx:capableOf"&&N.has(B.subject));if(F.length){let B=F.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${x[2]} can ${x[3]}. I do know: ${B}. If it's true, teach me: "a ${F[0].subject} can ${x[3]}".`,replace:!0,miss:!0}}return fk(x[2],x[3],W)}let T=l.match(Fz);if(T){let W=ee(a,T[1]),O=ee(a,T[2]),N=(await Lu(e)).map(F=>({fact:F,quantified:ck.has(F.predicate)&&O.has(F.subject)?Bz(F.object):null})).find(({quantified:F})=>F&&[...ee(a,F.part)].some(B=>W.has(B)));if(N)return{text:`${N.quantified.count} \u2014 ${se(N.fact)}`,replace:!0}}let $=l.match(Mz);if($){let W=ee(a,$[1]),O=ee(a,$[2]),D=await Lu(e),N=G=>D.find(Q=>ck.has(Q.predicate)&&G.has(Q.subject)&&O.has(Q.object)),F=N(W);if(F)return{text:`yes \u2014 ${se(F)}`,replace:!0};let B=[{terms:W,chain:[]}],U=new Set;for(let G=0;G<4;G+=1){let Q=[];for(let{terms:ie,chain:fe}of B){let ae=D.filter(Z=>Dn.has(Z.predicate)&&ie.has(Z.subject)&&!U.has(Z.object));for(let Z of ae){if(U.has(Z.object))continue;U.add(Z.object);let J=[...fe,Z],te=ee(a,Z.object),oe=N(te);if(oe)return{text:`yes \u2014 ${[...J.map(se),se(oe)].join("; ")}`,replace:!0};let Ae=await Wh(e,r,te,O,null,J);if(Ae)return Ae;Q.push({terms:te,chain:J})}}if(!Q.length)break;B=Q}return Wh(e,r,W,O,$[1].trim())}let _=l.match(Uz);if(_){let W=ee(a,_[1]),O=ee(a,_[3]),D=await Wh(e,r,W,O,_[1].trim());if(D)return D}let C=zu(l),S=C.match(Jz);if(S){let W=await rt(e,r),O=!!S[1],D=ee(a,S[2]),N=ee(a,S[3]),F=dk(S[2],S[3],W);if(F&&C!==uk(l)&&(F=lk(F)),F&&O)return{text:`I can't speak for ${S[1].trim()} ${S[2]} \u2014 what I remember is generic, not universal. ${F.text}.`,replace:!0};if(F)return F;if(s){let B=W.filter(G=>G.predicate==="mgx:capableOf"&&D.has(G.subject));if(B.length){let G=B.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${S[2]} can ${S[3]}. I do know: ${G}. If it's true, teach me: "a ${B[0].subject} can ${S[3]}".`,replace:!0,miss:!0}}let U=fk(S[2],S[3],W);if(U)return U;if(!/\s/.test(S[2].trim())&&!W.some(G=>D.has(G.subject)||D.has(G.object))){let G=tg(Bu(S[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${S[2]}" yet. Teach me "a ${G} can ${S[3]}" (or "a ${G} cannot ${S[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let j=l.match(Wz);if(j){let W=ee(a,j[1]),O=(await rt(e,r)).filter(G=>(G.predicate==="mgx:capableOf"||G.predicate===Kr)&&W.has(G.subject));if(!O.length)return null;let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
210
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
211
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let M=l.match(eB);if(M){let W=ee(a,M[1]),O=ee(a,M[2]),D=await rt(e,r),N=En(D.filter(F=>F.predicate==="mgx:capableOf"&&O.has(F.object))).filter(F=>Dc(new Set([F.subject]),O,D).verdict==="yes");if(N.length){let{findIsaChain:F,buildSubClassSuccessors:B,SUBCLASS_PREDICATE:U,TYPE_PREDICATE:G}=await Promise.resolve().then(()=>(It(),un)),Q=D.filter(ce=>ce.predicate===U),ie=D.filter(ce=>ce.predicate===G),fe=Q.map(ce=>[ce.subject,ce.object]),ae=ie.map(ce=>[ce.subject,ce.object]),Z=B(fe),J=ce=>(ce.predicate===U?Q:ie).find(le=>le.subject===ce.subject&&le.object===ce.object),te=new Map,oe=N.filter(ce=>W.has(ce.subject)?!0:(te.has(ce.subject)||te.set(ce.subject,F(ce.subject,W,ae,Z,{maxHops:3})),!!te.get(ce.subject))),pe=lt(oe.length?oe:N,o).map(ce=>{let le=oe.length?te.get(ce.subject):null;if(!le||le.length<2)return se(ce);let me=le.map(J);if(!me.every(Boolean))return se(ce);let Je=me.map(Ot=>Ro(Ot)).join("; ");return`${se(ce)} \u2014 via: ${Je}`}),je=pe.slice(0,_e),Le=pe.slice(_e),ke=Le.length?`
212
- \u2026and ${Le.length} more \u2014 say 'more' to see them.`:"";return{text:(oe.length?"":`nothing I remember ties these to "${M[1]}", but:
213
- `)+je.join(`
214
- `)+ke,replace:!0,...Le.length?{pending:{items:Le,noun:"facts"}}:{}}}}let z=l.match(Zz);if(z&&z[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,z[1]),O=(await rt(e,r)).filter(D=>D.predicate==="mgxneg:capableOf"&&W.has(D.object));if(O.length){let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
215
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
216
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${z[1].trim()}.`,replace:!0,miss:!0}}let K=l.match(Qz);if(K&&K[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,K[1]),O=Gf(W,await rt(e,r));if(O.length){let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
217
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
218
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}let Y=l.match(Gz);if(Y&&!uB.has(Y[1].trim().split(/\s+/)[0]?.toLowerCase())){let W=ee(a,Y[1]),O=(await rt(e,r)).filter(G=>G.predicate==="mgx:hasA"&&W.has(G.object));if(!O.length)return null;let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
219
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
220
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let X=l.match(pk),L=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:X?.[1];if(L){let W=ee(a,L),O=(await rt(e,r)).filter(G=>Dn.has(G.predicate)&&W.has(G.object));if(!O.length)return null;let N=lt(En(O),o).map(se),F=N.slice(0,_e),B=N.slice(_e),U=B.length?`
221
- \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:F.join(`
222
- `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let H=l.match(Nz);if(H){let W=ee(a,H[1]),O=await rt(e,r),D=re=>!String(re.provenance||"").includes("corpus:")&&!String(re.provenance||"").includes("web:"),N=O.filter(re=>Dn.has(re.predicate)&&D(re)),F=new Set,B=W;for(let re=0;re<8&&B.size;re+=1){let Pe=new Set;for(let ze of N)B.has(ze.object)&&!F.has(ze.subject)&&Pe.add(ze.subject);if(!Pe.size)break;for(let ze of Pe)F.add(ze);let it=new Set;for(let ze of Pe)for(let Xs of ee(a,ze))it.add(Xs);B=it}let U=O.filter(re=>W.has(re.subject)||W.has(re.object)||F.has(re.subject));if(!U.length){let re=a(H[1]).split(/\s+/).filter(Pe=>Pe.length>=4&&!Ik.has(Pe));if(re.length){let Pe=ze=>new Set(String(ze||"").split(/\s+/)),it=ze=>{let Xs=Pe(ze);return re.some(A=>Xs.has(A))};U=O.filter(ze=>it(ze.subject)||it(ze.object))}}U=U.filter(re=>!tk.has(re.predicate)&&!nk(re)&&!sk.has(re.predicate));let G=U.length>0&&!U.some(Gh);if(!U.length)return null;let{findConsistencyViolations:Q,TYPE_PREDICATE:ie,SUBCLASS_PREDICATE:fe,DISJOINT_PREDICATE:ae}=await Promise.resolve().then(()=>(It(),un)),Z=re=>!re.provenance?.includes("corpus:")&&!re.provenance?.includes("web:"),J=O.filter(re=>re.predicate===ie&&Z(re)).map(re=>[re.subject,re.object]),te=O.filter(re=>re.predicate===fe&&Z(re)).map(re=>[re.subject,re.object]),oe=O.filter(re=>re.predicate===ae&&Z(re)).map(re=>[re.subject,re.object]);if(oe.length){let Pe=Q(J,te,oe,{focus:W,budget:5}).find(it=>W.has(it.subject));if(Pe)return{text:`I can't answer that \u2014 what I've been told about ${Pe.subject} is inconsistent: it's taught to be both ${Pe.classA} and ${Pe.classB}, but ${Pe.viaA} and ${Pe.viaB} are disjoint (${Pe.viaA} owl:disjointWith ${Pe.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let Ae=await Wk(e),pe=await dB(O,W,Ae);if(pe)return{text:pe,replace:!0};let je=U.find(re=>W.has(re.subject)||W.has(re.object)),Le=je?W.has(je.subject)?je.subject:je.object:H[1].trim(),ke=U.some(re=>F.has(re.subject)&&!W.has(re.subject)&&!W.has(re.object));U=lt(U,o);let Xe=`${U.length} remembered fact${U.length===1?"":"s"} about ${Le}${ke?" (including its known subtypes)":""}:`,{lines:ce,grouped:le}=rk(U,O,W,{indent:" "});if(le)return{...le,text:`${Xe}
223
- ${le.text}`,...G?{weakOnly:!0}:{}};let me=ce.slice(0,_e),Je=ce.slice(_e),Ot=Je.length?`
224
- \u2026and ${Je.length} more \u2014 say 'more' to see them.`:"";return{text:`${Xe}
225
- ${me.join(`
226
- `)}${Ot}`,replace:!0,...Je.length?{pending:{items:Je.map(re=>re.trim()),noun:"facts"}}:{},...G?{weakOnly:!0}:{}}}return null}async function _B(e,t){let n=await za(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(i=>i?.id===n.id))?.class;if(!s)return null;let{defaultCodeLaneVocab:o}=await Promise.resolve().then(()=>($h(),yj)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Mu(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<AB;r+=1){let i=null;for(let a of e.relations||[])if(TB.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(c=>c?.subject===o)||null,i))break;if(!i||s.has(i.object))break;s.add(i.object),n.push({id:i.object,label:i.objectLabel||i.object}),o=i.object}return n}async function Bk(e,t,n,s,o=null,r=null,i={},a=null){return Dk(zk(await CB(e,t,n,s,o,r,i,a),n,t),lu.FACT_READBACK)}async function CB(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(We(),Vs)))}catch{return null}let l=String(t).trim();if(o){let O=l.match(ko);if(O){let D=await za(o,O[1]);if(D){let N=ee(c,gn(O[2])),F=Mu(o,D.id).find(U=>[...ee(c,U.label)].some(G=>N.has(G)));if(F)return{text:`yes \u2014 the code graph says ${D.label} inherits ${F.label}.`,replace:!0};let B=await za(o,gn(O[2]));if(B&&Mu(o,B.id).some(U=>U.id===D.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${B.label} inherits ${D.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=l.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await rt(e,a);if(!d.length){if(!ko.test(u)&&!qh.test(u)){let D=u.match(gk);if(D){let N=D[1].trim(),F=Hs.test(N)?r||null:N;if(F&&!/^there\b/i.test(F)&&!n?.parsed&&!wk.test(N)&&!bk.test(N)&&!ek.test(D[2].trim()))return yk(F,D[2].trim().toLowerCase())}}let O=u.match(ko)||Yh(l);if(!(O&&!/^there\b/i.test(O[1].trim())||ak.test(l)))return null}let p=d.filter(O=>Dn.has(O.predicate)),f=(O,D)=>D.trust-O.trust,m=O=>{let D=O.map(se),N=D.slice(0,_e),F=D.slice(_e),B=F.length?`
227
- \u2026and ${F.length} more \u2014 say 'more' to see them.`:"";return{text:N.join(`
228
- `)+B,replace:!0,...F.length?{pending:{items:F,noun:"facts"}}:{}}};if(RB.test(l)){let O=lt(p.length?p:d,i);return O.length?m(O):null}let h=u.match(qh);if(h){let O=h[1].trim(),D=Hs.test(O)?r||null:O,N=h[2].trim().toLowerCase(),F=h[3].trim();if(D&&!Xh.has(N)){let B=Mh(d),{findIsaChain:U}=await Promise.resolve().then(()=>(It(),un)),G=Ae=>{let pe=String(Ae||"").trim().toLowerCase(),je=[];for(let Le of d){let ke=Uh(Le.predicate);if(!ke)continue;if(ke===pe){je.push({fact:Le,aliasFacts:[]});continue}let Xe=Fh(U,ke,new Set([pe]),B,{maxHops:2});if(!Xe)continue;let ce=Xe.map(le=>d.find(me=>me.predicate===yr&&me.subject===le.subject&&me.object===le.object));ce.every(Boolean)&&je.push({fact:Le,aliasFacts:ce})}return je},{loadMemory:Q,findRuleByName:ie,resolveRelationChase:fe}=await Promise.resolve().then(()=>(We(),Vs)),{findActionPath:ae}=await Promise.resolve().then(()=>(_s(),sc)),Z=await Q(e),te=await fe(Z,N,D,F,{relationFactsFor:G,renderFactLine:se,factPhrase:qs,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Fu,findActionPath:ae});return te?{text:`yes \u2014 ${te.citation.join("; ")}`,replace:!0}:G(N).length>0||!!ie(Z,N)?{text:`I know the '${N}' relation, but I can't confirm ${D} is the ${N} of ${F} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}let b=Uu(u).match(Ok)||Nk(u,O=>{let D=ee(c,O);return d.some(N=>D.has(N.subject)||D.has(N.object))});if(b){let O=b[1].trim().toLowerCase(),D=b[2].trim(),N=Hs.test(D)?r||null:D;if(N&&!Xh.has(O)){let F=Mh(d),{findIsaChain:B}=await Promise.resolve().then(()=>(It(),un)),U=Ae=>{let pe=String(Ae||"").trim().toLowerCase(),je=[];for(let Le of d){let ke=Uh(Le.predicate);if(!ke)continue;if(ke===pe){je.push({fact:Le,aliasFacts:[]});continue}let Xe=Fh(B,ke,new Set([pe]),F,{maxHops:2});if(!Xe)continue;let ce=Xe.map(le=>d.find(me=>me.predicate===yr&&me.subject===le.subject&&me.object===le.object));ce.every(Boolean)&&je.push({fact:Le,aliasFacts:ce})}return je},{loadMemory:G,findRuleByName:Q,resolveRelationChaseReverse:ie}=await Promise.resolve().then(()=>(We(),Vs)),fe=await G(e),{findReachableSet:ae}=await Promise.resolve().then(()=>(_s(),sc)),J=await ie(fe,O,N,{relationFactsFor:U,renderFactLine:se,factPhrase:qs,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Fu,findReachableSet:ae});return J.length?{text:J.map(pe=>`${pe.subject} \u2014 ${pe.citation.join("; ")}`).join(`
229
- `),replace:!0}:U(O).length>0||!!Q(fe,O)?{text:/^what\b/i.test(Uu(u))?`I don't know what the ${O} of ${N} is from what you've told me.`:`I don't know anyone who is the ${O} of ${N} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${O}' yet.`,replace:!0}}}{let O=u.match(IB);if(O){let D=ee(c,O[1]),N=lt(d.filter(F=>D.has(F.subject)||D.has(F.object)),i);if(N.length){let F=N.map(se),B=F.slice(0,_e),U=F.slice(_e),G=U.length?`
205
+ `)+Q,replace:!0,...G.length?{pending:{items:G,noun:"facts"}}:{}}}}let y=n?.parsed?.shape==="meta"?n.parsed.object:null,v=n?.parsed&&n.parsed.node!=="miss";if(!y&&s&&!v&&!Ck.test(l)){let W=l.match(iR)||l.match(/^what\s+(?:does|do)\s+(.+?)\s+means?[?.!\s]*$/i);W&&(y=eo(W[1]))}if(!y&&s){let W=l.match(tU);W&&(y=eo(wn(W[1].trim())))}if(!y&&n?.ambiguous&&Array.isArray(n.candidateParses)){let W=n.candidateParses.find(N=>N?.shape==="meta"&&N.object);W&&(y=eo(String(W.object)))}if(y){let W=Uz(y),{predicate:N}=W,F=W.subject.replace(/^(?:the|an?)\s+/i,"").trim()||W.subject,O=!1;if(N&&Ys.test(F)){if(!i){let oe=String(qs[N]||"").replace(/^(?:is|are)\s+/,"");return{text:`not sure what "${F.toLowerCase()}" refers to yet \u2014 name the subject directly, e.g. "what is a <name>${oe?` ${oe}`:""}".`,replace:s,miss:!0,selfContainedMiss:!0}}F=i,O=!0}let z=ee(a,F),B=await rt(e,r);if(!B.some(oe=>z.has(oe.subject)||z.has(oe.object))){let oe=sB(F,B,a);oe&&(F=oe,z=ee(a,F))}let U=(await rt(e,r)).filter(oe=>z.has(oe.subject)&&!yk.has(oe.predicate)&&!$k(oe)&&!vk.has(oe.predicate)),G=N?U.filter(oe=>c(oe.predicate)===N):U;if(!N&&G.length&&!G.some(Xh)&&(G=[]),!G.length){if(N&&(U.length||O))return{text:`I don't have any "${qs[N]}" facts about ${F}.`,replace:s,...U.length?{}:{miss:!0}};if(!N){let oe=lt((await rt(e,r)).filter(Ae=>z.has(Ae.object)),o);if(oe.length&&!oe.some(Xh)&&(oe=[]),oe.length){let Ae=oe.map(se),he=Ae.slice(0,_e),ke=Ae.slice(_e),Ce=ke.length?`
206
+ \u2026and ${ke.length} more \u2014 say 'more' to see them.`:"";return{text:he.join(`
207
+ `)+Ce,replace:s,...ke.length?{pending:{items:ke,noun:"facts"}}:{}}}}return null}G=lt(G,o);let Q=await rt(e,r),{lines:ae,grouped:fe}=Ek(G,Q,z),ie=!N&&ae.length>Wz?await Gz(F,G,Q,ae):null;if(ie)return{...ie,replace:s};if(fe)return{...fe,replace:s};let Z=ae.slice(0,_e),X=ae.slice(_e),te=X.length?`
208
+ \u2026and ${X.length} more \u2014 say 'more' to see them.`:"";return{text:Z.join(`
209
+ `)+te,replace:s,...X.length?{pending:{items:X,noun:"facts"}}:{}}}if(!s)return null;let R=l.match(Ez);if(R){let N=`mgx:${R[2].toLowerCase().replace(/\s+/g,"-")}-than`,F=await zu(e),O=ie=>{let Z=ie.replace(/^(?:an?|the)\s+/i,"").trim();return i&&Ys.test(Z)?i:Z},z=O(R[1]),B=O(R[3]),U=ee(a,z),G=ee(a,B),Q=F.find(ie=>ie.predicate===N&&U.has(ie.subject)&&G.has(ie.object));if(Q){let ie=F.find(X=>X.predicate===N&&U.has(X.object)&&G.has(X.subject)),Z=ie?` \u2014 though you also told me the opposite: ${se(ie)}. Both are stored; I won't silently pick one.`:"";return{text:`yes \u2014 ${se(Q)}${Z}`,replace:!0}}let ae=F.filter(ie=>ie.predicate===N&&(U.has(ie.subject)||U.has(ie.object)));return{text:`I can't confirm that \u2014 nothing I remember compares them that way.${ae.length?` I do know: ${ae.slice(0,3).map(se).join("; ")}.`:""} If it's true, teach me: "${z} is ${R[2].toLowerCase()} than ${B}".`,replace:!0,miss:!0}}let S=Vu(l).match(aB);if(S){let W=ee(a,S[1]),N=S[2].toLowerCase(),F=await rt(e,r),O=eR(F,W,N,a)??cB(F,W,new Set([`be ${N}`,N]),a);if(O)return{text:`yes \u2014 ${O.map(se).join("; ")}`,replace:!0}}for(let{predicate:W,phrase:N,re:F}of CB){let O=l.match(F);if(!O)continue;let z=await zu(e),B=ee(a,O[1]),U=ee(a,O[2]),G=z.find(Z=>Z.predicate===W&&B.has(Z.subject)&&U.has(Z.object));if(G)return{text:`yes \u2014 ${se(G)}`,replace:!0};let[Q]=N.split(" "),ae=await Gu(va(Q));if(ae!==W){let Z=ae.replace(/^mgx:/,"mgxneg:");if(z.some(X=>(X.predicate===ae||X.predicate===Z)&&B.has(X.subject)))continue}let fe=AB.has(W)?` If it's true, teach me: "${O[1]} ${N} ${O[2]}".`:"",ie=z.filter(Z=>Z.predicate===W&&B.has(Z.subject));if(ie.length){let Z=ie.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${O[1]} ${N} ${O[2]}. I do know: ${Z}.${fe}`,replace:!0,miss:!0}}if(!n?.parsed&&z.some(Z=>B.has(Z.subject)))return{text:`I can't confirm that \u2014 nothing I remember says ${O[1]} ${N} ${O[2]}.${fe}`,replace:!0,miss:!0};break}let j=l.match(Ro)||tg(l);if(j){let W=ee(a,j[1]),N=ee(a,j[2]),F=await rt(e,r),O=G=>W.has(G.subject)&&N.has(G.object),{DISJOINT_PREDICATE:z}=await Promise.resolve().then(()=>(Ct(),fn)),B=G=>W.has(G.subject)||W.has(G.object)||N.has(G.subject)||N.has(G.object);return F.some(G=>G.predicate===z&&yr(G)&&B(G))?null:Yk(F.find(G=>Un.has(G.predicate)&&O(G)),F.find(G=>G.predicate===Bc&&O(G)))}let I=Vu(l),x=I.match(oB);if(x){let W=await rt(e,r),N=x[1],F=Tk(x[2],x[3],W);if(F&&I!==_k(l)&&(F=Rk(F)),F&&N)return{text:`I can't speak for ${N.trim()} ${x[2]} \u2014 what I remember is generic, not universal. ${F.text}.`,replace:!0};if(F)return F;let O=ee(a,x[2]),z=W.filter(B=>B.predicate==="mgx:capableOf"&&O.has(B.subject));if(z.length){let B=z.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${x[2]} can ${x[3]}. I do know: ${B}. If it's true, teach me: "a ${z[0].subject} can ${x[3]}".`,replace:!0,miss:!0}}return Ak(x[2],x[3],W)}let _=l.match(iB);if(_){let W=ee(a,_[1]),N=ee(a,_[2]),O=(await zu(e)).map(z=>({fact:z,quantified:kk.has(z.predicate)&&N.has(z.subject)?lB(z.object):null})).find(({quantified:z})=>z&&[...ee(a,z.part)].some(B=>W.has(B)));if(O)return{text:`${O.quantified.count} \u2014 ${se(O.fact)}`,replace:!0}}let $=l.match(rB);if($){let W=ee(a,$[1]),N=ee(a,$[2]),F=await zu(e),O=G=>F.find(Q=>kk.has(Q.predicate)&&G.has(Q.subject)&&N.has(Q.object)),z=O(W);if(z)return{text:`yes \u2014 ${se(z)}`,replace:!0};let B=[{terms:W,chain:[]}],U=new Set;for(let G=0;G<4;G+=1){let Q=[];for(let{terms:ae,chain:fe}of B){let ie=F.filter(Z=>Un.has(Z.predicate)&&ae.has(Z.subject)&&!U.has(Z.object));for(let Z of ie){if(U.has(Z.object))continue;U.add(Z.object);let X=[...fe,Z],te=ee(a,Z.object),oe=O(te);if(oe)return{text:`yes \u2014 ${[...X.map(se),se(oe)].join("; ")}`,replace:!0};let Ae=await Yh(e,r,te,N,null,X);if(Ae)return Ae;Q.push({terms:te,chain:X})}}if(!Q.length)break;B=Q}return Yh(e,r,W,N,$[1].trim())}let T=l.match(uB);if(T){let W=ee(a,T[1]),N=ee(a,T[3]),F=await Yh(e,r,W,N,T[1].trim());if(F)return F}let C=Vu(l),E=C.match(yB);if(E){let W=await rt(e,r),N=!!E[1],F=ee(a,E[2]),O=ee(a,E[3]),z=Tk(E[2],E[3],W);if(z&&C!==_k(l)&&(z=Rk(z)),z&&N)return{text:`I can't speak for ${E[1].trim()} ${E[2]} \u2014 what I remember is generic, not universal. ${z.text}.`,replace:!0};if(z)return z;if(s){let B=W.filter(G=>G.predicate==="mgx:capableOf"&&F.has(G.subject));if(B.length){let G=B.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${E[2]} can ${E[3]}. I do know: ${G}. If it's true, teach me: "a ${B[0].subject} can ${E[3]}".`,replace:!0,miss:!0}}let U=Ak(E[2],E[3],W);if(U)return U;if(!/\s/.test(E[2].trim())&&!W.some(G=>F.has(G.subject)||F.has(G.object))){let G=ag(Ku(E[2]));return{text:`I can't confirm that \u2014 I don't know anything about "${E[2]}" yet. Teach me "a ${G} can ${E[3]}" (or "a ${G} cannot ${E[3]}") and I'll remember it.`,replace:!0,miss:!0}}}}let k=l.match(dB);if(k){let W=ee(a,k[1]),N=(await rt(e,r)).filter(G=>(G.predicate==="mgx:capableOf"||G.predicate===qr)&&W.has(G.subject));if(!N.length)return null;let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
210
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
211
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let P=l.match(SB);if(P){let W=ee(a,P[1]),N=ee(a,P[2]),F=await rt(e,r),O=jn(F.filter(z=>z.predicate==="mgx:capableOf"&&N.has(z.object))).filter(z=>Wc(new Set([z.subject]),N,F).verdict==="yes");if(O.length){let{findIsaChain:z,buildSubClassSuccessors:B,SUBCLASS_PREDICATE:U,TYPE_PREDICATE:G}=await Promise.resolve().then(()=>(Ct(),fn)),Q=F.filter(ce=>ce.predicate===U),ae=F.filter(ce=>ce.predicate===G),fe=Q.map(ce=>[ce.subject,ce.object]),ie=ae.map(ce=>[ce.subject,ce.object]),Z=B(fe),X=ce=>(ce.predicate===U?Q:ae).find(le=>le.subject===ce.subject&&le.object===ce.object),te=new Map,oe=O.filter(ce=>W.has(ce.subject)?!0:(te.has(ce.subject)||te.set(ce.subject,z(ce.subject,W,ie,Z,{maxHops:3})),!!te.get(ce.subject))),he=lt(oe.length?oe:O,o).map(ce=>{let le=oe.length?te.get(ce.subject):null;if(!le||le.length<2)return se(ce);let pe=le.map(X);if(!pe.every(Boolean))return se(ce);let et=pe.map(Jt=>_o(Jt)).join("; ");return`${se(ce)} \u2014 via: ${et}`}),ke=he.slice(0,_e),Ce=he.slice(_e),Ee=Ce.length?`
212
+ \u2026and ${Ce.length} more \u2014 say 'more' to see them.`:"";return{text:(oe.length?"":`nothing I remember ties these to "${P[1]}", but:
213
+ `)+ke.join(`
214
+ `)+Ee,replace:!0,...Ce.length?{pending:{items:Ce,noun:"facts"}}:{}}}}let D=l.match(vB);if(D&&D[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,D[1]),N=(await rt(e,r)).filter(F=>F.predicate==="mgxneg:capableOf"&&W.has(F.object));if(N.length){let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
215
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
216
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}return{text:`nothing I remember says anything cannot ${D[1].trim()}.`,replace:!0,miss:!0}}let H=l.match($B);if(H&&H[1].trim().split(/\s+/).at(-1)?.toLowerCase()!=="do"){let W=ee(a,H[1]),N=Jf(W,await rt(e,r));if(N.length){let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
217
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
218
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}}let Y=l.match(fB);if(Y&&!IB.has(Y[1].trim().split(/\s+/)[0]?.toLowerCase())){let W=ee(a,Y[1]),N=(await rt(e,r)).filter(G=>G.predicate==="mgx:hasA"&&W.has(G.object));if(!N.length)return null;let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
219
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
220
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let J=l.match(Ck),L=n?.parsed?.shape==="reverse"&&n.parsed.kind==="inherits"?n.parsed.object:J?.[1];if(L){let W=ee(a,L),N=(await rt(e,r)).filter(G=>Un.has(G.predicate)&&W.has(G.object));if(!N.length)return null;let O=lt(jn(N),o).map(se),z=O.slice(0,_e),B=O.slice(_e),U=B.length?`
221
+ \u2026and ${B.length} more \u2014 say 'more' to see them.`:"";return{text:z.join(`
222
+ `)+U,replace:!0,...B.length?{pending:{items:B,noun:"facts"}}:{}}}let K=l.match(nB);if(K){let W=ee(a,K[1]),N=await rt(e,r),F=re=>!String(re.provenance||"").includes("corpus:")&&!String(re.provenance||"").includes("web:"),O=N.filter(re=>Un.has(re.predicate)&&F(re)),z=new Set,B=W;for(let re=0;re<8&&B.size;re+=1){let De=new Set;for(let Je of O)B.has(Je.object)&&!z.has(Je.subject)&&De.add(Je.subject);if(!De.size)break;for(let Je of De)z.add(Je);let It=new Set;for(let Je of De)for(let on of ee(a,Je))It.add(on);B=It}let U=N.filter(re=>W.has(re.subject)||W.has(re.object)||z.has(re.subject));if(!U.length){let re=a(K[1]).split(/\s+/).filter(De=>De.length>=4&&!Xk.has(De));if(re.length){let De=Je=>new Set(String(Je||"").split(/\s+/)),It=Je=>{let on=De(Je);return re.some(rn=>on.has(rn))};U=N.filter(Je=>It(Je.subject)||It(Je.object))}}U=U.filter(re=>!yk.has(re.predicate)&&!$k(re)&&!vk.has(re.predicate));let G=U.length>0&&!U.some(Xh);if(!U.length)return null;let{findConsistencyViolations:Q,TYPE_PREDICATE:ae,SUBCLASS_PREDICATE:fe,DISJOINT_PREDICATE:ie}=await Promise.resolve().then(()=>(Ct(),fn)),Z=re=>!re.provenance?.includes("corpus:")&&!re.provenance?.includes("web:"),X=N.filter(re=>re.predicate===ae&&Z(re)).map(re=>[re.subject,re.object]),te=N.filter(re=>re.predicate===fe&&Z(re)).map(re=>[re.subject,re.object]),oe=N.filter(re=>re.predicate===ie&&Z(re)).map(re=>[re.subject,re.object]);if(oe.length){let De=Q(X,te,oe,{focus:W,budget:5}).find(It=>W.has(It.subject));if(De)return{text:`I can't answer that \u2014 what I've been told about ${De.subject} is inconsistent: it's taught to be both ${De.classA} and ${De.classB}, but ${De.viaA} and ${De.viaB} are disjoint (${De.viaA} owl:disjointWith ${De.viaB}). I'd need one of those retracted before I can answer honestly.`,replace:!0}}let Ae=await aR(e),he=await OB(N,W,Ae);if(he)return{text:he,replace:!0};let ke=U.find(re=>W.has(re.subject)||W.has(re.object)),Ce=ke?W.has(ke.subject)?ke.subject:ke.object:K[1].trim(),Ee=U.some(re=>z.has(re.subject)&&!W.has(re.subject)&&!W.has(re.object));U=lt(U,o);let Xe=`${U.length} remembered fact${U.length===1?"":"s"} about ${Ce}${Ee?" (including its known subtypes)":""}:`,{lines:ce,grouped:le}=Ek(U,N,W,{indent:" "});if(le)return{...le,text:`${Xe}
223
+ ${le.text}`,...G?{weakOnly:!0}:{}};let pe=ce.slice(0,_e),et=ce.slice(_e),Jt=et.length?`
224
+ \u2026and ${et.length} more \u2014 say 'more' to see them.`:"";return{text:`${Xe}
225
+ ${pe.join(`
226
+ `)}${Jt}`,replace:!0,...et.length?{pending:{items:et.map(re=>re.trim()),noun:"facts"}}:{},...G?{weakOnly:!0}:{}}}return null}async function XB(e,t){let n=await Ga(e,t);if(!n)return null;let s=(e?.byId?.get?.(n.id)||(e?.individuals||[]).find(i=>i?.id===n.id))?.class;if(!s)return null;let{defaultCodeLaneVocab:o}=await Promise.resolve().then(()=>(kh(),Mj)),{classLabels:r}=await o();return r[s]?r[s][0]:null}function Uu(e,t){let n=[];if(!e||!t)return n;let s=new Set([t]),o=t;for(let r=0;r<QB;r+=1){let i=null;for(let a of e.relations||[])if(JB.test(`${a?.prop||""} ${a?.predicate||""}`)&&(i=(a.edges||[]).find(c=>c?.subject===o)||null,i))break;if(!i||s.has(i.object))break;s.add(i.object),n.push({id:i.object,label:i.objectLabel||i.object}),o=i.object}return n}async function rR(e,t,n,s,o=null,r=null,i={},a=null){return sR(oR(await ZB(e,t,n,s,o,r,i,a),n,t),mu.FACT_READBACK)}async function ZB(e,t,n,s,o=null,r=null,i={},a=null){if(!s)return null;let c;try{({normFactTerm:c}=await Promise.resolve().then(()=>(Ue(),Hs)))}catch{return null}let l=String(t).trim();if(o){let N=l.match(Ro);if(N){let F=await Ga(o,N[1]);if(F){let O=ee(c,wn(N[2])),z=Uu(o,F.id).find(U=>[...ee(c,U.label)].some(G=>O.has(G)));if(z)return{text:`yes \u2014 the code graph says ${F.label} inherits ${z.label}.`,replace:!0};let B=await Ga(o,wn(N[2]));if(B&&Uu(o,B.id).some(U=>U.id===F.id))return{text:`I can't confirm that \u2014 the code graph's stored direction runs the other way: ${B.label} inherits ${F.label}. An inheritance doesn't reverse.`,replace:!0,miss:!0}}}}let u=l.replace(/^(?:actually|really|honestly|yeah\s+nah)\s*,?\s+/i,""),d=await rt(e,a);if(!d.length){if(!Ro.test(u)&&!eg.test(u)){let F=u.match(Nk);if(F){let O=F[1].trim(),z=Ys.test(O)?r||null:O;if(z&&!/^there\b/i.test(z)&&!n?.parsed&&!Pk.test(O)&&!Lk.test(O)&&!wk.test(F[2].trim()))return Mk(z,F[2].trim().toLowerCase())}}let N=u.match(Ro)||tg(l);if(!(N&&!/^there\b/i.test(N[1].trim())||jk.test(l)))return null}let p=d.filter(N=>Un.has(N.predicate)),f=(N,F)=>F.trust-N.trust,m=N=>{let F=N.map(se),O=F.slice(0,_e),z=F.slice(_e),B=z.length?`
227
+ \u2026and ${z.length} more \u2014 say 'more' to see them.`:"";return{text:O.join(`
228
+ `)+B,replace:!0,...z.length?{pending:{items:z,noun:"facts"}}:{}}};if(YB.test(l)){let N=lt(p.length?p:d,i);return N.length?m(N):null}let h=u.match(eg);if(h){let N=h[1].trim(),F=Ys.test(N)?r||null:N,O=h[2].trim().toLowerCase(),z=h[3].trim();if(F&&!ng.has(O)){let B=Wh(d),{findIsaChain:U}=await Promise.resolve().then(()=>(Ct(),fn)),G=Ae=>{let he=String(Ae||"").trim().toLowerCase(),ke=[];for(let Ce of d){let Ee=qh(Ce.predicate);if(!Ee)continue;if(Ee===he){ke.push({fact:Ce,aliasFacts:[]});continue}let Xe=Gh(U,Ee,new Set([he]),B,{maxHops:2});if(!Xe)continue;let ce=Xe.map(le=>d.find(pe=>pe.predicate===$r&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&ke.push({fact:Ce,aliasFacts:ce})}return ke},{loadMemory:Q,findRuleByName:ae,resolveRelationChase:fe}=await Promise.resolve().then(()=>(Ue(),Hs)),{findActionPath:ie}=await Promise.resolve().then(()=>(Ts(),rc)),Z=await Q(e),te=await fe(Z,O,F,z,{relationFactsFor:G,renderFactLine:se,factPhrase:Xs,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Wu,findActionPath:ie});return te?{text:`yes \u2014 ${te.citation.join("; ")}`,replace:!0}:G(O).length>0||!!ae(Z,O)?{text:`I know the '${O}' relation, but I can't confirm ${F} is the ${O} of ${z} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${O}' yet.`,replace:!0}}}let b=Hu(u).match(Jk)||Qk(u,N=>{let F=ee(c,N);return d.some(O=>F.has(O.subject)||F.has(O.object))});if(b){let N=b[1].trim().toLowerCase(),F=b[2].trim(),O=Ys.test(F)?r||null:F;if(O&&!ng.has(N)){let z=Wh(d),{findIsaChain:B}=await Promise.resolve().then(()=>(Ct(),fn)),U=Ae=>{let he=String(Ae||"").trim().toLowerCase(),ke=[];for(let Ce of d){let Ee=qh(Ce.predicate);if(!Ee)continue;if(Ee===he){ke.push({fact:Ce,aliasFacts:[]});continue}let Xe=Gh(B,Ee,new Set([he]),z,{maxHops:2});if(!Xe)continue;let ce=Xe.map(le=>d.find(pe=>pe.predicate===$r&&pe.subject===le.subject&&pe.object===le.object));ce.every(Boolean)&&ke.push({fact:Ce,aliasFacts:ce})}return ke},{loadMemory:G,findRuleByName:Q,resolveRelationChaseReverse:ae}=await Promise.resolve().then(()=>(Ue(),Hs)),fe=await G(e),{findReachableSet:ie}=await Promise.resolve().then(()=>(Ts(),rc)),X=await ae(fe,N,O,{relationFactsFor:U,renderFactLine:se,factPhrase:Xs,factTermVariants:ee,byTrust:f,rows:d,HAS_PROPERTY_PREDICATE:Wu,findReachableSet:ie});return X.length?{text:X.map(he=>`${he.subject} \u2014 ${he.citation.join("; ")}`).join(`
229
+ `),replace:!0}:U(N).length>0||!!Q(fe,N)?{text:/^what\b/i.test(Hu(u))?`I don't know what the ${N} of ${O} is from what you've told me.`:`I don't know anyone who is the ${N} of ${O} from what you've told me.`,replace:!0}:{text:`I don't know a relation or rule called '${N}' yet.`,replace:!0}}}{let N=u.match(eU);if(N){let F=ee(c,N[1]),O=lt(d.filter(z=>F.has(z.subject)||F.has(z.object)),i);if(O.length){let z=O.map(se),B=z.slice(0,_e),U=z.slice(_e),G=U.length?`
230
230
  \u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:B.join(`
231
- `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}}let g=u.match(Az);if(g){let O=tg(g[1].trim().toLowerCase()),D=g[2].trim(),N=Hs.test(D)?r||null:D;if(N){let{loadMemory:F,findRuleByName:B,RULE_KIND_PROP:U,RULE_KIND_RECURSIVE:G}=await Promise.resolve().then(()=>(We(),Vs)),Q=await F(e),ie=B(Q,O),fe=ie?.attributes?.find(ae=>ae.prop===U)?.value;if(ie&&fe===G){let ae=ie.attributes.find(te=>te.prop==="mgx:ruleBaseCase")?.value,Z=ie.attributes.find(te=>te.prop==="mgx:ruleRecStep")?.value,J=c(N);if(ae&&Z&&J){let te=Mh(d),{findIsaChain:oe}=await Promise.resolve().then(()=>(It(),un)),Ae=Xe=>{let ce=String(Xe||"").trim().toLowerCase(),le=[];for(let me of d){let Je=Uh(me.predicate);if(!Je)continue;if(Je===ce){le.push({fact:me,aliasFacts:[]});continue}let Ot=Fh(oe,Je,new Set([ce]),te,{maxHops:2});if(!Ot)continue;let re=Ot.map(Pe=>d.find(it=>it.predicate===yr&&it.subject===Pe.subject&&it.object===Pe.object));re.every(Boolean)&&le.push({fact:me,aliasFacts:re})}return le},{findReachableSet:pe}=await Promise.resolve().then(()=>(_s(),sc)),ke=pe({entity:J,hop:0},Xe=>{let ce=Xe.hop===0?ae:Z;return Ae(ce).filter(le=>le.fact.subject===Xe.entity).map(le=>({action:le,nextState:{entity:le.fact.object,hop:Xe.hop+1}}))},{maxDepth:20,stateKey:Xe=>Xe.entity});if(ke.length)return{text:ke.map(({node:ce,path:le})=>{let me=new Set,Je=[];for(let Ot of le.actions){Je.push(se(Ot.fact));for(let re of Ot.aliasFacts){let Pe=re.id||`${re.subject}|${re.predicate}|${re.object}`;me.has(Pe)||(me.add(Pe),Je.push(Ro(re)))}}return`${ce.entity} \u2014 ${Je.join("; ")}`}).join(`
232
- `),replace:!0}}}return null}}let y=l.match(ak),w=l.match(ko)||Yh(l)||y&&`is ${y[1].trim()} a ${y[2].trim()}`.match(ko);if(w){let O=ee(c,gn(w[2])),D=r&&Hs.test(w[1].trim())?r:w[1],N=new Set(ee(c,D));if([...N].some(q=>O.has(q))){let q=gn(w[2]).trim();return{text:`yes \u2014 ${$r(q)} ${q} is ${$r(q)} ${q}, trivially: every kind is a kind of itself.`,replace:!0}}let F=await _B(o,D);if(F)for(let q of ee(c,F))N.add(q);let{findIsaChain:B,buildSubClassSuccessors:U,deriveDisjointViolations:G,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ie,DISJOINT_PREDICATE:fe}=await Promise.resolve().then(()=>(It(),un)),ae=wr,Z=p.filter(q=>q.predicate===Q&&ae(q)),J=p.filter(q=>q.predicate===ie&&ae(q)),te=Z.map(q=>[q.subject,q.object]),oe=J.map(q=>[q.subject,q.object]),Ae=p.filter(q=>q.predicate===Q),pe=p.filter(q=>q.predicate===ie),je=pe.map(q=>[q.subject,q.object]),Le=Ae.map(q=>[q.subject,q.object]),ke=U(te),Xe=U(Le),ce=d.filter(q=>q.predicate===fe&&ae(q)),le=ce.map(q=>[q.subject,q.object]),me=ce.length?G(je.concat(Le),Le,le,{budget:20,focus:new Set([...N,...O])}):[],Je=q=>{let Ee=me.find(Ge=>Ge.subject===q&&O.has(Ge.object));if(!Ee)return null;let we=p.filter(Ge=>O.has(Ge.object)&&(Ge.subject===Ee.viaClass||Ge.subject===Ee.subject)).sort(f)[0],Re=ce.find(Ge=>Ge.subject===Ee.viaClass&&Ge.object===Ee.object||Ge.subject===Ee.object&&Ge.object===Ee.viaClass);return!we||!Re?null:Ez(we,Re)},Ot=p.filter(q=>N.has(q.subject)&&O.has(q.object)).sort(f)[0],re=d.filter(q=>q.predicate===Mc&&N.has(q.subject)&&O.has(q.object)).sort(f)[0],Pe=ce.find(q=>N.has(q.subject)&&O.has(q.object)||N.has(q.object)&&O.has(q.subject));if(Ot&&!re){let q=Je(Ot.subject);if(q)return q}let it=Ck(Ot,re||Pe);if(it)return it;if(ce.length){let q=Re=>{let Ge=new Set(Re),Nt=new Set(Re);for(let Me=0;Me<8&&Nt.size;Me+=1){let ye=new Set;for(let[He,_o]of Le)Nt.has(He)&&!Ge.has(_o)&&ye.add(_o);if(!ye.size)break;for(let He of ye)Ge.add(He);Nt=ye}return Ge},Ee=q(O),we=me.find(Re=>N.has(Re.subject)&&Ee.has(Re.object)&&!q([Re.viaClass]).has(Re.object)&&!q([Re.object]).has(Re.viaClass));if(we){let Re=p.filter(ye=>N.has(ye.subject)&&ye.object===we.viaClass).sort(f)[0],Ge=ce.find(ye=>ye.subject===we.viaClass&&ye.object===we.object||ye.subject===we.object&&ye.object===we.viaClass),Nt=!O.has(we.object),Me=Nt?p.filter(ye=>O.has(ye.subject)&&ye.object===we.object).sort(f)[0]:null;if(Re&&Ge&&(!Nt||Me)){let ye=gn(w[2]).trim();return{text:`no \u2014 ${[Re,...Me?[Me]:[]].map(se).join("; ")}; and ${Ro(Ge)} \u2014 so ${D} can never be ${$r(ye)} ${ye}.`,replace:!0}}}}let ze=await za(o,D);if(ze){let q=new Map;for(let we of Mu(o,ze.id))for(let Re of ee(c,we.label))!N.has(Re)&&!q.has(Re)&&q.set(Re,we.label);let Ee=p.filter(we=>q.has(we.subject)&&O.has(we.object)).sort(f)[0];if(Ee)return{text:`yes \u2014 the code graph says ${ze.label} inherits ${q.get(Ee.subject)}, and ${se(Ee)}`,replace:!0}}let Xs=q=>(q.predicate===Q?Z:J).find(Ee=>Ee.subject===q.subject&&Ee.object===q.object);for(let q of N){let Ee=B(q,O,oe,ke,{maxHops:2});if(!Ee)continue;let we=Je(q);if(we)return we;let Re=Ee.map(Xs);if(Re.every(Boolean))return{text:`yes \u2014 ${Nu(Re)}`,replace:!0}}let A=q=>(q.predicate===Q?Ae:pe).find(Ee=>Ee.subject===q.subject&&Ee.object===q.object);for(let q of N){let Ee=B(q,O,je,Xe,{maxHops:2});if(!Ee)continue;let we=Je(q);if(we)return we;let Re=Ee.map(A);if(Re.every(Boolean)&&Re.some(ae))return{text:`yes \u2014 ${Nu(Re)}`,replace:!0}}let ge=D.match(/^(.*\S)\s+not$/i),Oe=ge&&[ge[0],r&&Hs.test(ge[1].trim())?r:ge[1]];if(Oe){let q=ee(c,Oe[1]),Ee=O,we=p.filter(Me=>q.has(Me.subject)&&Ee.has(Me.object)).sort(f)[0];if(we)return{text:`no \u2014 ${se(we)}`,replace:!0};let Re=ce.find(Me=>q.has(Me.subject)&&Ee.has(Me.object)||q.has(Me.object)&&Ee.has(Me.subject));if(Re)return{text:`yes \u2014 ${se(Re)}`,replace:!0};let Ge=Oe[1].trim(),Nt=gn(w[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${Ge} and ${Nt}. If no ${Ge} is a ${Nt}, teach me: "no ${Ge} is a ${Nt}".`,replace:!0,miss:!0}}if(ce.length){let q=G(oe.concat(te),te,le,{budget:10});for(let Ee of N){let we=q.find(Me=>Me.subject===Ee&&O.has(Me.object));if(!we)continue;let Re=J.concat(Z).find(Me=>Me.subject===we.subject&&Me.object===we.viaType),Ge=ce.find(Me=>Me.subject===we.viaClass&&Me.object===we.object||Me.subject===we.object&&Me.object===we.viaClass),Nt=[Re,Ge].filter(Boolean).map(se);return{text:`no \u2014 ${Nt.length?Nt.join("; "):`${we.viaClass} and ${we.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:Es,ON_PROPERTY_PREDICATE:xs,SOME_VALUES_FROM_PREDICATE:Ba,deriveSomeValuesFromSubsumption:aR,ENTAILED_SCM_SVF_PROVENANCE:cR,SCM_SVF_RULE_CONFIDENCE:lR,entailedTrustFrom:rg}=await Promise.resolve().then(()=>(It(),un)),ig=d.filter(q=>q.predicate===xs&&ae(q)),ag=d.filter(q=>q.predicate===Ba&&ae(q));if(ig.length&&ag.length){let q=new Map(ag.map(ye=>[ye.subject,ye.object])),Ee=ig.map(ye=>({restriction:ye.subject,property:ye.object,target:q.get(ye.subject)})).filter(ye=>ye.target),we=new Set([Q,ie,fe,xs,Ba,"owl:intersectionOf"]),Re=d.filter(ye=>ae(ye)&&!we.has(ye.predicate)),Ge=Re.map(ye=>[ye.subject,ye.predicate,ye.object]),Nt=Es(Ge,oe,te,Ee,{budget:10});for(let ye of N){let He=Nt.find(zn=>zn.subject===ye&&O.has(zn.object));if(!He)continue;let _o=Re.find(zn=>zn.subject===He.subject&&zn.predicate===He.viaProperty&&zn.object===He.viaValue),To=J.find(zn=>zn.subject===He.viaValue&&zn.object===He.viaType),hi=[_o,To].filter(Boolean).map(se);return{text:`yes \u2014 ${hi.length?hi.join("; "):`${He.subject} ${He.viaProperty} ${He.viaValue}, and ${He.viaValue} is a ${He.viaType}.`}`,replace:!0}}let Me=Ee.length>1?aR(Ee,te,{budget:10}):[];if(Me.length){let ye=U(te.concat(Me.map(Ce=>[Ce.subject,Ce.object]))),He=new Map(Ee.map(Ce=>[Ce.restriction,Ce])),_o=new Map;for(let Ce of d)_o.set(`${Ce.subject}\0${Ce.predicate}\0${Ce.object}`,Ce.trust);let To=(Ce,Yn,on)=>_o.get(`${Ce}\0${Yn}\0${on}`),hi=new Map;for(let Ce of Me){let Yn=He.get(Ce.subject),on=He.get(Ce.object),mn=[Yn&&To(Ce.subject,xs,Yn.property),To(Ce.subject,Ba,Ce.viaY1),on&&To(Ce.object,xs,on.property),To(Ce.object,Ba,Ce.viaY2),To(Ce.viaY1,Q,Ce.viaY2)].filter(fR=>typeof fR=="number"),Ua=rg(mn,lR);Ua!==null&&hi.set(`${Ce.subject}\0${Ce.object}`,Ua)}let zn=Ce=>{if(Ce.predicate!==Q)return J.find(mn=>mn.subject===Ce.subject&&mn.object===Ce.object);let Yn=Z.find(mn=>mn.subject===Ce.subject&&mn.object===Ce.object);if(Yn)return Yn;let on=Me.find(mn=>mn.subject===Ce.subject&&mn.object===Ce.object);return on?{subject:on.subject,predicate:Q,object:on.object,provenance:cR,trust:hi.get(`${on.subject}\0${on.object}`)}:void 0};for(let Ce of N){let Yn=B(Ce,O,oe,ye,{maxHops:3});if(!Yn)continue;let on=Yn.map(zn);if(on.every(Boolean)){let mn=rg(on.map(Ua=>Ua.trust),1);return{text:`yes \u2014 ${Nu(on)}`,replace:!0,...mn!==null?{trust:mn}:{}}}}}}let uR=ee(c,D),Hu=p.filter(q=>uR.has(q.subject)).sort(f),xn=D.trim(),Js=gn(w[2]).trim(),dR=[...N].some(q=>B(q,O,oe,ke,{maxHops:Cz})),qu=await hB(e,a,d,xn,N,O,Js);if(qu?.text)return qu;let Yu=!!qu?.budgetExhausted;if(Hu.length){let q=Hu.slice(0,3).map(se).join("; "),{ON_PROPERTY_PREDICATE:Ee,SOME_VALUES_FROM_PREDICATE:we}=await Promise.resolve().then(()=>(It(),un)),Re=new Set,Ge=new Set;for(let He of d)He.predicate===Ee?Re.add(He.subject):He.predicate===we&&Ge.add(He.subject);let Nt=new Set([...Re].filter(He=>Ge.has(He))),ye=Hu.some(He=>Nt.has(He.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${xn}", then ask me again.`:dR?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${xn}", then ask me again.`:`If it's true, teach me: "${xn} is a kind of ${Js}". If it isn't, teach me: "no ${xn} is a ${Js}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${xn} is a ${Js}. I do know: ${q}. ${ye}`,replace:!0,miss:!0,...Yu?{budgetExhausted:!0}:{}}}let cg=p.filter(q=>N.has(q.object)&&O.has(q.subject)).sort(f)[0];return cg?{text:`I can't confirm that \u2014 what I know runs the other way: ${se(cg)}. A kind doesn't reverse. If it's true, teach me: "every ${xn} is a ${Js}". If it isn't, teach me: "no ${xn} is a ${Js}".`,replace:!0,miss:!0,...Yu?{budgetExhausted:!0}:{}}:!ze&&!F&&!JD(xn)&&!d.some(q=>N.has(q.subject)||N.has(q.object))?{text:`I can't confirm that \u2014 I don't know "${xn}" at all yet. If it's true, teach me: "${xn} is a kind of ${Js}". If it isn't, teach me: "no ${xn} is a ${Js}".`,replace:!0,miss:!0,...Yu?{budgetExhausted:!0}:{}}:null}let E=l.match(yB);if(E){let[,O,D,N]=E,{SUBCLASS_PREDICATE:F,ON_PROPERTY_PREDICATE:B,buildCardinalityRestrictions:U,proveCardinalityAtLeast:G,CARDINALITY_RULE_CONFIDENCE:Q,entailedTrustFrom:ie}=await Promise.resolve().then(()=>(It(),un)),fe=wr,ae=p.filter(te=>te.predicate===F&&fe(te)).map(te=>[te.subject,te.object]),Z=d.filter(te=>(te.predicate===B||hk.has(te.predicate))&&fe(te)),J=U(Z);if(J.length){let te=ee(c,O.trim()),oe=ee(c,N.trim()),Ae=Number(D),pe=ik(te,oe,(je,Le)=>G(ae,J,je,Le,Ae,{}));if(pe){let je=d.find(me=>me.predicate===F&&me.subject===pe.viaClass&&me.object===pe.viaRestriction),Le=je?.provenance?` (source: ${Hh(je.provenance)})`:"",ke=pe.kind==="exactly"?"exactly":"at least",Xe=(me,Je)=>`${me}${Je===1?"":"s"}`,ce=[je?.trust,...Z.filter(me=>me.subject===pe.viaRestriction).map(me=>me.trust),...pe.viaClass!==pe.subject?[p.find(me=>me.predicate===F&&me.subject===pe.subject&&me.object===pe.viaClass)?.trust]:[]].filter(me=>typeof me=="number"),le=ie(ce,Q);return{text:`yes \u2014 every ${pe.viaClass} has ${ke} ${pe.n} ${Xe(pe.object,pe.n)}${Le}, so at least ${Ae} follows.`,replace:!0,...le!==null?{trust:le}:{}}}}}let R=l.match($B);if(R){let[,O,D]=R,{SUBCLASS_PREDICATE:N,ON_PROPERTY_PREDICATE:F,buildCardinalityRestrictions:B,proveMaxCardinalityZeroDenial:U,CAX_MAXC0_RULE_CONFIDENCE:G,entailedTrustFrom:Q}=await Promise.resolve().then(()=>(It(),un)),ie=wr,fe=p.filter(J=>J.predicate===N&&ie(J)).map(J=>[J.subject,J.object]),ae=d.filter(J=>(J.predicate===F||hk.has(J.predicate))&&ie(J)),Z=B(ae);if(Z.length){let J=ee(c,O.trim()),te=ee(c,D.trim()),oe=ik(J,te,(Ae,pe)=>U(fe,Z,Ae,pe,{}));if(oe){let Ae=d.find(ke=>ke.predicate===N&&ke.subject===oe.viaClass&&ke.object===oe.viaRestriction),pe=Ae?.provenance?` (source: ${Hh(Ae.provenance)})`:"",je=[Ae?.trust,...ae.filter(ke=>ke.subject===oe.viaRestriction).map(ke=>ke.trust),...oe.viaClass!==oe.subject?[p.find(ke=>ke.predicate===N&&ke.subject===oe.subject&&ke.object===oe.viaClass)?.trust]:[]].filter(ke=>typeof ke=="number"),Le=Q(je,G);return{text:`no \u2014 every ${oe.viaClass} has at most 0 ${oe.object}${pe}.`,replace:!0,...Le!==null?{trust:Le}:{}}}}}let v=l.match(vB);if(v){let O=ee(c,v[1]),D=d.filter(N=>N.predicate===Ph&&O.has(N.subject)).sort(f);return D.length?m(D):null}let k=u.match(SB);if(k){let[,O,D]=k,N=ee(c,O.trim()),F=ee(c,D.replace(/^an?\s+/i,"").trim()),B=d.filter(U=>U.predicate===Ph&&F.has(U.subject)&&N.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} owns/maintains ${D.trim()}.`,replace:!0}}let I=u.match(EB);if(I){let[,O,D]=I,N=ee(c,O.replace(/^an?\s+/i,"").trim()),F=ee(c,D.trim()),B=d.filter(U=>U.predicate===Ph&&N.has(U.subject)&&F.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${O.trim().toLowerCase()} is owned by ${D.trim()}.`,replace:!0}}let x=u.match(xB);if(x){let[,O,D]=x,N=ee(c,O.trim()),F=ee(c,`${D.trim()} method`),B=d.filter(U=>U.predicate===si&&N.has(U.subject)&&F.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:null}let T=u.match(jB);if(T){let O=ee(c,T[1].trim()),D=d.filter(N=>N.predicate===si&&O.has(N.subject)&&/ method$/.test(N.object)).sort(f);return D.length?m(D):null}let $=u.match(gk);if($){let O=$[1].trim(),D=wk.test(O)||bk.test(O)?null:Hs.test(O)?r||null:O,N=$[2].trim().toLowerCase();if(D){let F=ee(c,D),B=new Map,U=null;if(o){let J=await za(o,D);if(U=J,J)for(let te of Mu(o,J.id))for(let oe of ee(c,te.label))!F.has(oe)&&!B.has(oe)&&B.set(oe,te.label),F.add(oe)}let G=J=>J.predicate===Fu&&c(J.object)===N||J.predicate===`tmct:${N}`&&J.object==="true",Q=c(D).split(/\s+/).filter(J=>J.length>=4&&!Ik.has(J)),ie=J=>Q.some(te=>new Set(String(J.subject||"").split(/\s+/)).has(te)),fe=J=>F.has(J.subject)||Q.length&&ie(J),ae=d.filter(J=>fe(J)&&G(J)).sort(f)[0];if(ae){let J=B.get(ae.subject);return{text:J?`yes \u2014 the code graph says ${U.label} inherits ${J}, and ${se(ae)}`:`yes \u2014 ${se(ae)}`,replace:!0}}let Z=Pk(d,F,N,c);if(Z)return{text:`yes \u2014 ${Z.map(se).join("; ")}`,replace:!0};{let{findIsaChain:J,SUBCLASS_PREDICATE:te,TYPE_PREDICATE:oe}=await Promise.resolve().then(()=>(It(),un)),Ae=wr,pe=d.filter(le=>le.predicate===te&&Ae(le)),je=d.filter(le=>le.predicate===oe&&Ae(le)),Le=pe.map(le=>[le.subject,le.object]),ke=je.map(le=>[le.subject,le.object]),Xe=le=>(le.predicate===te?pe:je).find(me=>me.subject===le.subject&&me.object===le.object),ce=ee(c,N);for(let le of F){let me=J(le,ce,ke,Le,{maxHops:2});if(!me)continue;let Je=me.map(Xe);if(Je.every(Boolean))return{text:`yes \u2014 ${Nu(Je)}`,replace:!0}}}if(d.some(fe)&&!n?.parsed)return/^there\b/i.test(D)||kB.test(N)?null:{text:`I don't have a fact saying ${jz(D)} is ${N}.`,replace:!0};if(!n?.parsed&&!ek.test(N))return yk(D,N)}}let _=zu(l).match(uz);if(_&&!zh.test(l)){let[,O,D,N]=_,F=D.toLowerCase();if(!Dh.test(F)&&!Bh.test(F)){let B=O.trim(),U=pz(await Du(F),N),G=U.object.replace(/^an?\s+/i,"").trim();if(B&&G){let Q=U.predicate,ie=ee(c,B),fe=ee(c,G),ae=[Q,qr(Q)],Z=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject)&&fe.has(te.object)).sort(f)[0];if(Z)return{text:`${Zy(Z.predicate)?"no":"yes"} \u2014 ${se(Z)}`,replace:!0,generalVerbQuery:!0};let J=d.filter(te=>ae.includes(te.predicate)&&ie.has(te.subject));if(J.length){let te=J.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${qs({subject:B,predicate:Q,object:G})}. I do know: ${te}.`,replace:!0,miss:!0}}return null}}}let C=l.match(dz);if(C&&!zh.test(l)){let[,O,D]=C,[N,F]=D.toLowerCase().split(/\s+/);if(!Dh.test(N)&&!Bh.test(N)){let B=O.trim();if(B){let U=await Du(N);F&&/^mgx:[a-z]+$/.test(U)&&(U=`${U}-${F}`);let G=ee(c,B),Q=[U,qr(U)],ie=lt(d.filter(fe=>Q.includes(fe.predicate)&&G.has(fe.subject)),i);if(ie.length)return{...m(ie),generalVerbQuery:!0}}}}let S=l.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(S&&!zh.test(l)){let[,O,D,N]=S,F=O.toLowerCase();if(!Dh.test(F)&&!Bh.test(F)&&!lz.test(F)){let B=await Du(F);/^mgx:[a-z]+$/.test(B)&&(B=`${B}-${D.toLowerCase()}`);let U=ee(c,N.replace(/^(?:an?|the)\s+/i,"").trim()),G=lt(d.filter(Q=>Q.predicate===B&&U.has(Q.object)),i);if(G.length)return{...m(G),generalVerbQuery:!0}}}let j=l.match(bB);if(j){let O=ee(c,j[1]),D=lt(d.filter(Q=>O.has(Q.subject)||O.has(Q.object)),i);if(!D.length)return null;let N=O.has(D[0].subject)?D[0].subject:D[0].object,F=D.map(Q=>` ${se(Q)}`),B=F.slice(0,_e),U=F.slice(_e),G=U.length?`
233
- \u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:`${D.length} remembered fact${D.length===1?"":"s"} about ${N}:
231
+ `)+G,replace:!0,...U.length?{pending:{items:U,noun:"facts"}}:{}}}}}let g=u.match(Qz);if(g){let N=ag(g[1].trim().toLowerCase()),F=g[2].trim(),O=Ys.test(F)?r||null:F;if(O){let{loadMemory:z,findRuleByName:B,RULE_KIND_PROP:U,RULE_KIND_RECURSIVE:G}=await Promise.resolve().then(()=>(Ue(),Hs)),Q=await z(e),ae=B(Q,N),fe=ae?.attributes?.find(ie=>ie.prop===U)?.value;if(ae&&fe===G){let ie=ae.attributes.find(te=>te.prop==="mgx:ruleBaseCase")?.value,Z=ae.attributes.find(te=>te.prop==="mgx:ruleRecStep")?.value,X=c(O);if(ie&&Z&&X){let te=Wh(d),{findIsaChain:oe}=await Promise.resolve().then(()=>(Ct(),fn)),Ae=Xe=>{let ce=String(Xe||"").trim().toLowerCase(),le=[];for(let pe of d){let et=qh(pe.predicate);if(!et)continue;if(et===ce){le.push({fact:pe,aliasFacts:[]});continue}let Jt=Gh(oe,et,new Set([ce]),te,{maxHops:2});if(!Jt)continue;let re=Jt.map(De=>d.find(It=>It.predicate===$r&&It.subject===De.subject&&It.object===De.object));re.every(Boolean)&&le.push({fact:pe,aliasFacts:re})}return le},{findReachableSet:he}=await Promise.resolve().then(()=>(Ts(),rc)),Ee=he({entity:X,hop:0},Xe=>{let ce=Xe.hop===0?ie:Z;return Ae(ce).filter(le=>le.fact.subject===Xe.entity).map(le=>({action:le,nextState:{entity:le.fact.object,hop:Xe.hop+1}}))},{maxDepth:20,stateKey:Xe=>Xe.entity});if(Ee.length)return{text:Ee.map(({node:ce,path:le})=>{let pe=new Set,et=[];for(let Jt of le.actions){et.push(se(Jt.fact));for(let re of Jt.aliasFacts){let De=re.id||`${re.subject}|${re.predicate}|${re.object}`;pe.has(De)||(pe.add(De),et.push(_o(re)))}}return`${ce.entity} \u2014 ${et.join("; ")}`}).join(`
232
+ `),replace:!0}}}return null}}let w=l.match(jk),y=l.match(Ro)||tg(l)||w&&`is ${w[1].trim()} a ${w[2].trim()}`.match(Ro);if(y){let N=ee(c,wn(y[2])),F=r&&Ys.test(y[1].trim())?r:y[1],O=new Set(ee(c,F));if([...O].some(q=>N.has(q))){let q=wn(y[2]).trim();return{text:`yes \u2014 ${vr(q)} ${q} is ${vr(q)} ${q}, trivially: every kind is a kind of itself.`,replace:!0}}let z=await XB(o,F);if(z)for(let q of ee(c,z))O.add(q);let{findIsaChain:B,buildSubClassSuccessors:U,deriveDisjointViolations:G,SUBCLASS_PREDICATE:Q,TYPE_PREDICATE:ae,DISJOINT_PREDICATE:fe}=await Promise.resolve().then(()=>(Ct(),fn)),ie=yr,Z=p.filter(q=>q.predicate===Q&&ie(q)),X=p.filter(q=>q.predicate===ae&&ie(q)),te=Z.map(q=>[q.subject,q.object]),oe=X.map(q=>[q.subject,q.object]),Ae=p.filter(q=>q.predicate===Q),he=p.filter(q=>q.predicate===ae),ke=he.map(q=>[q.subject,q.object]),Ce=Ae.map(q=>[q.subject,q.object]),Ee=U(te),Xe=U(Ce),ce=d.filter(q=>q.predicate===fe&&ie(q)),le=ce.map(q=>[q.subject,q.object]),pe=ce.length?G(ke.concat(Ce),Ce,le,{budget:20,focus:new Set([...O,...N])}):[],et=q=>{let xe=pe.find(We=>We.subject===q&&N.has(We.object));if(!xe)return null;let we=p.filter(We=>N.has(We.object)&&(We.subject===xe.viaClass||We.subject===xe.subject)).sort(f)[0],Re=ce.find(We=>We.subject===xe.viaClass&&We.object===xe.object||We.subject===xe.object&&We.object===xe.viaClass);return!we||!Re?null:Vz(we,Re)},Jt=p.filter(q=>O.has(q.subject)&&N.has(q.object)).sort(f)[0],re=d.filter(q=>q.predicate===Bc&&O.has(q.subject)&&N.has(q.object)).sort(f)[0],De=ce.find(q=>O.has(q.subject)&&N.has(q.object)||O.has(q.object)&&N.has(q.subject));if(Jt&&!re){let q=et(Jt.subject);if(q)return q}let It=Yk(Jt,re||De);if(It)return It;if(ce.length){let q=Re=>{let We=new Set(Re),Ot=new Set(Re);for(let Pe=0;Pe<8&&Ot.size;Pe+=1){let ye=new Set;for(let[Ke,Ao]of Ce)Ot.has(Ke)&&!We.has(Ao)&&ye.add(Ao);if(!ye.size)break;for(let Ke of ye)We.add(Ke);Ot=ye}return We},xe=q(N),we=pe.find(Re=>O.has(Re.subject)&&xe.has(Re.object)&&!q([Re.viaClass]).has(Re.object)&&!q([Re.object]).has(Re.viaClass));if(we){let Re=p.filter(ye=>O.has(ye.subject)&&ye.object===we.viaClass).sort(f)[0],We=ce.find(ye=>ye.subject===we.viaClass&&ye.object===we.object||ye.subject===we.object&&ye.object===we.viaClass),Ot=!N.has(we.object),Pe=Ot?p.filter(ye=>N.has(ye.subject)&&ye.object===we.object).sort(f)[0]:null;if(Re&&We&&(!Ot||Pe)){let ye=wn(y[2]).trim();return{text:`no \u2014 ${[Re,...Pe?[Pe]:[]].map(se).join("; ")}; and ${_o(We)} \u2014 so ${F} can never be ${vr(ye)} ${ye}.`,replace:!0}}}}let Je=await Ga(o,F);if(Je){let q=new Map;for(let we of Uu(o,Je.id))for(let Re of ee(c,we.label))!O.has(Re)&&!q.has(Re)&&q.set(Re,we.label);let xe=p.filter(we=>q.has(we.subject)&&N.has(we.object)).sort(f)[0];if(xe)return{text:`yes \u2014 the code graph says ${Je.label} inherits ${q.get(xe.subject)}, and ${se(xe)}`,replace:!0}}let on=q=>(q.predicate===Q?Z:X).find(xe=>xe.subject===q.subject&&xe.object===q.object);for(let q of O){let xe=B(q,N,oe,Ee,{maxHops:2});if(!xe)continue;let we=et(q);if(we)return we;let Re=xe.map(on);if(Re.every(Boolean))return{text:`yes \u2014 ${Du(Re)}`,replace:!0}}let rn=q=>(q.predicate===Q?Ae:he).find(xe=>xe.subject===q.subject&&xe.object===q.object);for(let q of O){let xe=B(q,N,ke,Xe,{maxHops:2});if(!xe)continue;let we=et(q);if(we)return we;let Re=xe.map(rn);if(Re.every(Boolean)&&Re.some(ie))return{text:`yes \u2014 ${Du(Re)}`,replace:!0}}let To=F.match(/^(.*\S)\s+not$/i),A=To&&[To[0],r&&Ys.test(To[1].trim())?r:To[1]];if(A){let q=ee(c,A[1]),xe=N,we=p.filter(Pe=>q.has(Pe.subject)&&xe.has(Pe.object)).sort(f)[0];if(we)return{text:`no \u2014 ${se(we)}`,replace:!0};let Re=ce.find(Pe=>q.has(Pe.subject)&&xe.has(Pe.object)||q.has(Pe.object)&&xe.has(Pe.subject));if(Re)return{text:`yes \u2014 ${se(Re)}`,replace:!0};let We=A[1].trim(),Ot=wn(y[2]).trim();return{text:`I can't confirm that either way \u2014 nothing I remember links ${We} and ${Ot}. If no ${We} is a ${Ot}, teach me: "no ${We} is a ${Ot}".`,replace:!0,miss:!0}}if(ce.length){let q=G(oe.concat(te),te,le,{budget:10});for(let xe of O){let we=q.find(Pe=>Pe.subject===xe&&N.has(Pe.object));if(!we)continue;let Re=X.concat(Z).find(Pe=>Pe.subject===we.subject&&Pe.object===we.viaType),We=ce.find(Pe=>Pe.subject===we.viaClass&&Pe.object===we.object||Pe.subject===we.object&&Pe.object===we.viaClass),Ot=[Re,We].filter(Boolean).map(se);return{text:`no \u2014 ${Ot.length?Ot.join("; "):`${we.viaClass} and ${we.object} are disjoint.`}`,replace:!0}}}let{deriveSomeValuesFromApplication:ge,ON_PROPERTY_PREDICATE:Ie,SOME_VALUES_FROM_PREDICATE:kn,deriveSomeValuesFromSubsumption:xr,ENTAILED_SCM_SVF_PROVENANCE:jR,SCM_SVF_RULE_CONFIDENCE:kR,entailedTrustFrom:dg}=await Promise.resolve().then(()=>(Ct(),fn)),fg=d.filter(q=>q.predicate===Ie&&ie(q)),pg=d.filter(q=>q.predicate===kn&&ie(q));if(fg.length&&pg.length){let q=new Map(pg.map(ye=>[ye.subject,ye.object])),xe=fg.map(ye=>({restriction:ye.subject,property:ye.object,target:q.get(ye.subject)})).filter(ye=>ye.target),we=new Set([Q,ae,fe,Ie,kn,"owl:intersectionOf"]),Re=d.filter(ye=>ie(ye)&&!we.has(ye.predicate)),We=Re.map(ye=>[ye.subject,ye.predicate,ye.object]),Ot=ge(We,oe,te,xe,{budget:10});for(let ye of O){let Ke=Ot.find(Wn=>Wn.subject===ye&&N.has(Wn.object));if(!Ke)continue;let Ao=Re.find(Wn=>Wn.subject===Ke.subject&&Wn.predicate===Ke.viaProperty&&Wn.object===Ke.viaValue),Co=X.find(Wn=>Wn.subject===Ke.viaValue&&Wn.object===Ke.viaType),yi=[Ao,Co].filter(Boolean).map(se);return{text:`yes \u2014 ${yi.length?yi.join("; "):`${Ke.subject} ${Ke.viaProperty} ${Ke.viaValue}, and ${Ke.viaValue} is a ${Ke.viaType}.`}`,replace:!0}}let Pe=xe.length>1?xr(xe,te,{budget:10}):[];if(Pe.length){let ye=U(te.concat(Pe.map(Oe=>[Oe.subject,Oe.object]))),Ke=new Map(xe.map(Oe=>[Oe.restriction,Oe])),Ao=new Map;for(let Oe of d)Ao.set(`${Oe.subject}\0${Oe.predicate}\0${Oe.object}`,Oe.trust);let Co=(Oe,Qn,an)=>Ao.get(`${Oe}\0${Qn}\0${an}`),yi=new Map;for(let Oe of Pe){let Qn=Ke.get(Oe.subject),an=Ke.get(Oe.object),gn=[Qn&&Co(Oe.subject,Ie,Qn.property),Co(Oe.subject,kn,Oe.viaY1),an&&Co(Oe.object,Ie,an.property),Co(Oe.object,kn,Oe.viaY2),Co(Oe.viaY1,Q,Oe.viaY2)].filter(TR=>typeof TR=="number"),Va=dg(gn,kR);Va!==null&&yi.set(`${Oe.subject}\0${Oe.object}`,Va)}let Wn=Oe=>{if(Oe.predicate!==Q)return X.find(gn=>gn.subject===Oe.subject&&gn.object===Oe.object);let Qn=Z.find(gn=>gn.subject===Oe.subject&&gn.object===Oe.object);if(Qn)return Qn;let an=Pe.find(gn=>gn.subject===Oe.subject&&gn.object===Oe.object);return an?{subject:an.subject,predicate:Q,object:an.object,provenance:jR,trust:yi.get(`${an.subject}\0${an.object}`)}:void 0};for(let Oe of O){let Qn=B(Oe,N,oe,ye,{maxHops:3});if(!Qn)continue;let an=Qn.map(Wn);if(an.every(Boolean)){let gn=dg(an.map(Va=>Va.trust),1);return{text:`yes \u2014 ${Du(an)}`,replace:!0,...gn!==null?{trust:gn}:{}}}}}}let RR=ee(c,F),Qu=p.filter(q=>RR.has(q.subject)).sort(f),Rn=F.trim(),Qs=wn(y[2]).trim(),_R=[...O].some(q=>B(q,N,oe,Ee,{maxHops:Zz})),Zu=await MB(e,a,d,Rn,O,N,Qs);if(Zu?.text)return Zu;let ed=!!Zu?.budgetExhausted;if(Qu.length){let q=Qu.slice(0,3).map(se).join("; "),{ON_PROPERTY_PREDICATE:xe,SOME_VALUES_FROM_PREDICATE:we}=await Promise.resolve().then(()=>(Ct(),fn)),Re=new Set,We=new Set;for(let Ke of d)Ke.predicate===xe?Re.add(Ke.subject):Ke.predicate===we&&We.add(Ke.subject);let Ot=new Set([...Re].filter(Ke=>We.has(Ke))),ye=Qu.some(Ke=>Ot.has(Ke.object))?`The facts to settle it are here, but reaching it means composing a restriction /syllogise doesn't follow. Run "/classify ${Rn}", then ask me again.`:_R?`The facts to settle it are here, but the chain is longer than I follow while answering. Run "/syllogise ${Rn}", then ask me again.`:`If it's true, teach me: "${Rn} is a kind of ${Qs}". If it isn't, teach me: "no ${Rn} is a ${Qs}".`;return{text:`I can't confirm that \u2014 nothing I remember says ${Rn} is a ${Qs}. I do know: ${q}. ${ye}`,replace:!0,miss:!0,...ed?{budgetExhausted:!0}:{}}}let mg=p.filter(q=>O.has(q.object)&&N.has(q.subject)).sort(f)[0];return mg?{text:`I can't confirm that \u2014 what I know runs the other way: ${se(mg)}. A kind doesn't reverse. If it's true, teach me: "every ${Rn} is a ${Qs}". If it isn't, teach me: "no ${Rn} is a ${Qs}".`,replace:!0,miss:!0,...ed?{budgetExhausted:!0}:{}}:!Je&&!z&&!yz(Rn)&&!d.some(q=>O.has(q.subject)||O.has(q.object))?{text:`I can't confirm that \u2014 I don't know "${Rn}" at all yet. If it's true, teach me: "${Rn} is a kind of ${Qs}". If it isn't, teach me: "no ${Rn} is a ${Qs}".`,replace:!0,miss:!0,...ed?{budgetExhausted:!0}:{}}:null}let v=l.match(BB);if(v){let[,N,F,O]=v,{SUBCLASS_PREDICATE:z,ON_PROPERTY_PREDICATE:B,buildCardinalityRestrictions:U,proveCardinalityAtLeast:G,CARDINALITY_RULE_CONFIDENCE:Q,entailedTrustFrom:ae}=await Promise.resolve().then(()=>(Ct(),fn)),fe=yr,ie=p.filter(te=>te.predicate===z&&fe(te)).map(te=>[te.subject,te.object]),Z=d.filter(te=>(te.predicate===B||Ok.has(te.predicate))&&fe(te)),X=U(Z);if(X.length){let te=ee(c,N.trim()),oe=ee(c,O.trim()),Ae=Number(F),he=xk(te,oe,(ke,Ce)=>G(ie,X,ke,Ce,Ae,{}));if(he){let ke=d.find(pe=>pe.predicate===z&&pe.subject===he.viaClass&&pe.object===he.viaRestriction),Ce=ke?.provenance?` (source: ${Zh(ke.provenance)})`:"",Ee=he.kind==="exactly"?"exactly":"at least",Xe=(pe,et)=>`${pe}${et===1?"":"s"}`,ce=[ke?.trust,...Z.filter(pe=>pe.subject===he.viaRestriction).map(pe=>pe.trust),...he.viaClass!==he.subject?[p.find(pe=>pe.predicate===z&&pe.subject===he.subject&&pe.object===he.viaClass)?.trust]:[]].filter(pe=>typeof pe=="number"),le=ae(ce,Q);return{text:`yes \u2014 every ${he.viaClass} has ${Ee} ${he.n} ${Xe(he.object,he.n)}${Ce}, so at least ${Ae} follows.`,replace:!0,...le!==null?{trust:le}:{}}}}}let R=l.match(UB);if(R){let[,N,F]=R,{SUBCLASS_PREDICATE:O,ON_PROPERTY_PREDICATE:z,buildCardinalityRestrictions:B,proveMaxCardinalityZeroDenial:U,CAX_MAXC0_RULE_CONFIDENCE:G,entailedTrustFrom:Q}=await Promise.resolve().then(()=>(Ct(),fn)),ae=yr,fe=p.filter(X=>X.predicate===O&&ae(X)).map(X=>[X.subject,X.object]),ie=d.filter(X=>(X.predicate===z||Ok.has(X.predicate))&&ae(X)),Z=B(ie);if(Z.length){let X=ee(c,N.trim()),te=ee(c,F.trim()),oe=xk(X,te,(Ae,he)=>U(fe,Z,Ae,he,{}));if(oe){let Ae=d.find(Ee=>Ee.predicate===O&&Ee.subject===oe.viaClass&&Ee.object===oe.viaRestriction),he=Ae?.provenance?` (source: ${Zh(Ae.provenance)})`:"",ke=[Ae?.trust,...ie.filter(Ee=>Ee.subject===oe.viaRestriction).map(Ee=>Ee.trust),...oe.viaClass!==oe.subject?[p.find(Ee=>Ee.predicate===O&&Ee.subject===oe.subject&&Ee.object===oe.viaClass)?.trust]:[]].filter(Ee=>typeof Ee=="number"),Ce=Q(ke,G);return{text:`no \u2014 every ${oe.viaClass} has at most 0 ${oe.object}${he}.`,replace:!0,...Ce!==null?{trust:Ce}:{}}}}}let S=l.match(WB);if(S){let N=ee(c,S[1]),F=d.filter(O=>O.predicate===Uh&&N.has(O.subject)).sort(f);return F.length?m(F):null}let j=u.match(GB);if(j){let[,N,F]=j,O=ee(c,N.trim()),z=ee(c,F.replace(/^an?\s+/i,"").trim()),B=d.filter(U=>U.predicate===Uh&&z.has(U.subject)&&O.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${N.trim().toLowerCase()} owns/maintains ${F.trim()}.`,replace:!0}}let I=u.match(VB);if(I){let[,N,F]=I,O=ee(c,N.replace(/^an?\s+/i,"").trim()),z=ee(c,F.trim()),B=d.filter(U=>U.predicate===Uh&&O.has(U.subject)&&z.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:{text:`no \u2014 no remembered fact says ${N.trim().toLowerCase()} is owned by ${F.trim()}.`,replace:!0}}let x=u.match(KB);if(x){let[,N,F]=x,O=ee(c,N.trim()),z=ee(c,`${F.trim()} method`),B=d.filter(U=>U.predicate===ai&&O.has(U.subject)&&z.has(U.object)).sort(f)[0];return B?{text:`yes \u2014 ${se(B)}`,replace:!0}:null}let _=u.match(HB);if(_){let N=ee(c,_[1].trim()),F=d.filter(O=>O.predicate===ai&&N.has(O.subject)&&/ method$/.test(O.object)).sort(f);return F.length?m(F):null}let $=u.match(Nk);if($){let N=$[1].trim(),F=Pk.test(N)||Lk.test(N)?null:Ys.test(N)?r||null:N,O=$[2].trim().toLowerCase();if(F){let z=ee(c,F),B=new Map,U=null;if(o){let X=await Ga(o,F);if(U=X,X)for(let te of Uu(o,X.id))for(let oe of ee(c,te.label))!z.has(oe)&&!B.has(oe)&&B.set(oe,te.label),z.add(oe)}let G=X=>X.predicate===Wu&&c(X.object)===O||X.predicate===`tmct:${O}`&&X.object==="true",Q=c(F).split(/\s+/).filter(X=>X.length>=4&&!Xk.has(X)),ae=X=>Q.some(te=>new Set(String(X.subject||"").split(/\s+/)).has(te)),fe=X=>z.has(X.subject)||Q.length&&ae(X),ie=d.filter(X=>fe(X)&&G(X)).sort(f)[0];if(ie){let X=B.get(ie.subject);return{text:X?`yes \u2014 the code graph says ${U.label} inherits ${X}, and ${se(ie)}`:`yes \u2014 ${se(ie)}`,replace:!0}}let Z=eR(d,z,O,c);if(Z)return{text:`yes \u2014 ${Z.map(se).join("; ")}`,replace:!0};{let{findIsaChain:X,SUBCLASS_PREDICATE:te,TYPE_PREDICATE:oe}=await Promise.resolve().then(()=>(Ct(),fn)),Ae=yr,he=d.filter(le=>le.predicate===te&&Ae(le)),ke=d.filter(le=>le.predicate===oe&&Ae(le)),Ce=he.map(le=>[le.subject,le.object]),Ee=ke.map(le=>[le.subject,le.object]),Xe=le=>(le.predicate===te?he:ke).find(pe=>pe.subject===le.subject&&pe.object===le.object),ce=ee(c,O);for(let le of z){let pe=X(le,ce,Ee,Ce,{maxHops:2});if(!pe)continue;let et=pe.map(Xe);if(et.every(Boolean))return{text:`yes \u2014 ${Du(et)}`,replace:!0}}}if(d.some(fe)&&!n?.parsed)return/^there\b/i.test(F)||qB.test(O)?null:{text:`I don't have a fact saying ${Hz(F)} is ${O}.`,replace:!0};if(!n?.parsed&&!wk.test(O))return Mk(F,O)}}let T=Vu(l).match(Iz);if(T&&!Kh.test(l)){let[,N,F,O]=T,z=F.toLowerCase();if(!Vh.test(z)&&!Hh.test(z)){let B=N.trim(),U=Lz(await Gu(z),O),G=U.object.replace(/^an?\s+/i,"").trim();if(B&&G){let Q=U.predicate,ae=ee(c,B),fe=ee(c,G),ie=[Q,Xr(Q)],Z=d.filter(te=>ie.includes(te.predicate)&&ae.has(te.subject)&&fe.has(te.object)).sort(f)[0];if(Z)return{text:`${c$(Z.predicate)?"no":"yes"} \u2014 ${se(Z)}`,replace:!0,generalVerbQuery:!0};let X=d.filter(te=>ie.includes(te.predicate)&&ae.has(te.subject));if(X.length){let te=X.slice(0,3).map(se).join("; ");return{text:`I can't confirm that \u2014 nothing I remember says ${Xs({subject:B,predicate:Q,object:G})}. I do know: ${te}.`,replace:!0,miss:!0}}return null}}}let C=l.match(Oz);if(C&&!Kh.test(l)){let[,N,F]=C,[O,z]=F.toLowerCase().split(/\s+/);if(!Vh.test(O)&&!Hh.test(O)){let B=N.trim();if(B){let U=await Gu(O);z&&/^mgx:[a-z]+$/.test(U)&&(U=`${U}-${z}`);let G=ee(c,B),Q=[U,Xr(U)],ae=lt(d.filter(fe=>Q.includes(fe.predicate)&&G.has(fe.subject)),i);if(ae.length)return{...m(ae),generalVerbQuery:!0}}}}let E=l.match(/^(?:what|who)\s+([a-z]+)\s+(on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside)\s+(.+?)[?.!\s]*$/i);if(E&&!Kh.test(l)){let[,N,F,O]=E,z=N.toLowerCase();if(!Vh.test(z)&&!Hh.test(z)&&!Cz.test(z)){let B=await Gu(z);/^mgx:[a-z]+$/.test(B)&&(B=`${B}-${F.toLowerCase()}`);let U=ee(c,O.replace(/^(?:an?|the)\s+/i,"").trim()),G=lt(d.filter(Q=>Q.predicate===B&&U.has(Q.object)),i);if(G.length)return{...m(G),generalVerbQuery:!0}}}let k=l.match(DB);if(k){let N=ee(c,k[1]),F=lt(d.filter(Q=>N.has(Q.subject)||N.has(Q.object)),i);if(!F.length)return null;let O=N.has(F[0].subject)?F[0].subject:F[0].object,z=F.map(Q=>` ${se(Q)}`),B=z.slice(0,_e),U=z.slice(_e),G=U.length?`
233
+ \u2026and ${U.length} more \u2014 say 'more' to see them.`:"";return{text:`${F.length} remembered fact${F.length===1?"":"s"} about ${O}:
234
234
  ${B.join(`
235
- `)}${G}`,replace:!0,...U.length?{pending:{items:U.map(Q=>Q.trim()),noun:"facts"}}:{}}}let M=n?.parsed?.shape==="meta"?n.parsed.object:null,z=!1,K=null,Y=l.match(wB);if(Y)K=Y[1]?Y[1].trim():null,M=Y[2],z=!0;else if(!M&&!n?.parsed){let O=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);O&&(M=O[1])}if(!M)return null;let X=ee(c,M),L=lt(p.filter(O=>X.has(O.subject)),i),H=lt(p.filter(O=>X.has(O.object)),i),W=z?L.length?L:H:H.length?H:L;if(!W.length)return null;if(K&&W===L){let O=ee(c,K),D=F=>p.find(B=>B.subject===F.object&&O.has(B.object)),N=W.map(F=>({hit:F,bridge:D(F)})).find(({bridge:F})=>F);if(N)return{text:`${se(N.hit)} \u2014 ${se(N.bridge)}`,replace:!0}}return m(W)}function Gh(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function Wk(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(Xj(),Yj));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(ia(),jp)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function $k(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var Qh,JD,Fn,Ou,Jj,vk,Ste,QD,Ete,Qj,ZD,xte,Sk,Ek,xk,ez,Zj,jte,kte,Rte,_te,Tte,eg,Ate,tz,Ye,Ph,Fu,yr,nz,jk,sz,wr,Cte,Ite,Ote,Nte,Lte,Pte,Mte,Fte,Dte,zte,Bte,Ute,Wte,Gte,Vte,Kte,Hte,qte,ek,iz,Wu,az,Yte,Xte,kk,Jte,Qte,Zte,ene,cz,tne,Dh,zh,lz,nne,uz,dz,Bh,fz,mz,sne,Rk,_k,hz,one,rne,Tk,ine,ane,cne,gz,lne,bz,mi,une,dne,fne,Ak,pne,mne,wz,hne,gne,bne,wne,tk,sk,ng,qs,yz,vz,Pu,kz,Ik,yne,qh,Ok,Rz,_z,Uu,Tz,Az,ko,Dn,Cz,Iz,Oz,Xh,ak,Nz,_e,Pz,Mz,Fz,ck,Dz,Uz,Wz,Gz,Vz,Kz,Hz,qz,Yz,Xz,Jz,Qz,Zz,eB,uk,Mk,nB,sB,rB,iB,aB,cB,lB,pk,uB,fB,bB,wB,yB,$B,hk,vB,SB,EB,xB,jB,gk,Hs,kB,bk,wk,yk,RB,TB,AB,$ne,Uk,IB,OB,vne,Vh,Jh,NB,Sne,Ene,Gk,xne,jne,kne,Rne,_ne,Gu,Tne,Ane,Cne,Ine,LB,One,Nne,_a=P(()=>{Qe();nE();Qt();Fe();ns();vm();Wl();Gl();$i();Vl();mE();We();na();zc();ql();Rm();Zn();Tn();Mr();bc();bm();wm();Nr();Hn();Ld();lr();Fm();PE();zE();UE();Dm();WE();Wm();Gm();ZE();ex();nx();cu();Ra();Ml();rx();su();ui();Kx();Yx();Xx();Eo();vj();wc(void 0);gc(zl);Qh=new Set(["it","this","that","here"]),JD=e=>Qh.has(String(e||"").trim().toLowerCase()),Fn={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Ou=e=>e?`${String(e).toLowerCase()}(s)`:"entities",Jj="look up a taught fact about a subject/verb/object";vk={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},Ste=new Set(["stats","memory","focus",...Object.keys(vk)]),QD=new Set(["have","has","holds","hold"]),Ete=new RegExp(`\\b(?:${[...Object.keys(he),...Object.keys(eo)].filter(e=>!QD.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),Qj=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,ZD=(e,t)=>{let n=Qj(e),s=Qj(t);return n<s?-1:n>s?1:0},xte=new Set([...tE.map(e=>e.name),...Object.values(vk).map(e=>e.tool)]),Sk=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),Ek=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),xk=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),ez=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),Zj=e=>e.replace(/(.)\1+/g,"$1");jte=Zh(Sk),kte=Zh(Ek),Rte=Zh(xk),_te=new RegExp(`^(?:${[...ez].map(at).join("|")})\\s+(.+)$`,"i"),Tte=[...Sk,...Ek,...xk,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],eg="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",Ate=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${eg})\\s+than\\s+(.+)$`,"i"),tz=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${eg})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),Ye="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Ph="mgx:ownedBy",Fu="mgx:hasProperty",yr="rdfs:subClassOf",nz="rdf:type",jk="rdfs:subPropertyOf",sz=new Set(["operator","teach","entailed"]),wr=e=>!!e.sourceTypes?.some(t=>sz.has(t));Cte=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Ite=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Ote=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Nte=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${eg})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Lte=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${Ye})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),Pte=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");Mte=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),Fte=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),Dte=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${Ye})\\s+([\\w-]+)[.!?]*$`,"i"),zte=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${Ye})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),Bte=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),Ute=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${Ye})\\s+([\\w-]+)[?.!]*$`,"i"),Wte=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${Ye})\\s+([\\w-]+)$`,"i"),Gte=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${Ye})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),Vte=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ye})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),Kte=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${Ye})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),Hte=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${Ye})\\s+(.+?)[?.!\\s]*$`,"i"),qte=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${Ye}))?[?.!\\s]*$`,"i"),ek=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,iz=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);Wu="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",az="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",Yte=new RegExp(`^(.+?)\\s+(${az})\\s+(.+)$`,"i"),Xte=new RegExp(`^([\\w'-]+)\\s+${Wu}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),kk="with|to|from|by|of|in|on|for|as|about|into",Jte=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${Wu}(${Bl})\\s+(${kk})\\s+(.+)$`,"i"),Qte=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Bl})\\s+(${kk})\\s+(.+)$`,"i"),Zte=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),ene=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),cz="(?:just\\s+)?(?:one|another)\\s+more|another",tne=new RegExp(`^(?:${cz})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${Ye})\\s+(.+?)[.!?]*$`,"i"),Dh=/^(?:is|are|am|owns|maintains)$/i,zh=/\b(?:is|are|am|owns|maintains)\b/i,lz=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),nne=new RegExp(`^(?:${Lo.filter(e=>!/\s/.test(e)).join("|")})$`,"i");uz=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${Wu}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),dz=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${Wu}([a-z]+(?:\\s+(?:${Ye}))?)[?.!\\s]*$`,"i"),Bh=/^(?:be|own|maintain)$/i,fz=new RegExp(`^(${Ye})\\s+(.+)$`,"i");mz=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],sne=new RegExp(`^(?:${mz.join("|")})\\b\\s*,?\\s+`,"i"),Rk=Object.freeze(["you","i","it","they","he","she","we"]),_k=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),hz=Object.freeze([..._k,...Rk]),one=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${hz.join("|")})\\s+\\S+`,"i"),rne=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${Rk.join("|")})\\s+(?:is|are|am|was|were)|(${_k.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),Tk="forget|unlearn|delete|remove",ine=new RegExp(`^(?:${Tk})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),ane=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),cne=new RegExp(`^(?:${Tk})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${Ye})\\s+([\\w-]+)$`,"i"),gz="collection|set|group|family",lne=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${gz})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),bz=Object.freeze(["mgx:memberOf","mgx:partOf"]),mi="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",une=new RegExp(`^what\\s+does\\s+(.+?)${mi}\\s+do${mi}\\??$`,"i"),dne=new RegExp(`^what\\s+(.+?)${mi}\\s+does${mi}\\??$`,"i"),fne=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${mi}\\s+do${mi}\\??$`,"i"),Ak="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",pne=new RegExp(`^who\\s+(?:is|was)\\s+${Ak}$`,"i"),mne=new RegExp(`^what\\s+(?:did|has)\\s+${Ak}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),wz="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",hne=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${wz}\\b`,"i"),gne=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),bne=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});wne=new Set([...Object.keys(he).flatMap(e=>e.split(/[\s-]+/)),...hn,...Bn,"owns","maintains"].filter(e=>e.length>=3)),tk=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);sk=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),ng=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]),qs=e=>`${e.subject} ${Ul(e.predicate)} ${e.object}`;yz=Object.entries(Ks).filter(([e])=>!ng.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);vz=8;Pu=null;kz=/^(?:every|each|all|any)\s+/i;Ik=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),yne=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),qh=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Ok=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Rz=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,_z=/^(who|what)'?s\s+/i,Uu=e=>String(e).replace(_z,(t,n)=>`${n} is `),Tz=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;Az=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,ko=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,Dn=new Set(["rdfs:subClassOf","rdf:type"]),Cz=6,Iz=/^why\s+(?=(?:is|are)\b)/i,Oz=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;Xh=new Set(["kind","sort","type","subclass","superclass"]),ak=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,Nz=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,_e=32;Pz=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,Mz=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,Fz=/^how\s+many\s+(.+?)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have[?.!\s]*$/i,ck=new Set(["mgx:hasA","tmct:has"]),Dz=/^(?:can|could)\s+(?:all\s+|every\s+)?(?:an?\s+|the\s+)?(.+?)\s+be\s+([a-z][\w-]*)[?.!\s]*$/i;Uz=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,Wz=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,Gz=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,Vz=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,Kz=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,Hz=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,qz=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${Ye})\\s+(.+?)\\s*[?.!]*$`,"i"),Yz=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,Xz=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,Jz=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,Qz=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,Zz=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,eB=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;uk=e=>String(e||"").replace(/\s+/g," ").trim();Mk="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",nB=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${Mk})[?.!\\s]*$`,"i"),sB=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${Mk})\\s+([\\w'-]+)[?.!\\s]*$`,"i");rB=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),iB=Object.entries(Ks).filter(([e])=>!rB.has(e)&&!ng.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${at(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),aB=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),cB=new Set(["mgx:partOf","mgx:memberOf"]),lB=Object.entries(Ks).filter(([e])=>!aB.has(e)&&!ng.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=at(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[ba(s),...o].map(at).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),pk=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,uB=new Set(["changed","change","changes","updated","modified","happened","occurred"]);fB=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);bB=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,wB=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,yB=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,$B=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,hk=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),vB=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,SB=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,EB=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,xB=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,jB=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,gk=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Hs=/^(?:it|this|that)$/i,kB=/^(?:it|them|this|that|in|on|of|to|at)$/i,bk=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,wk=/^(?:you|i|they|he|she|we)\b/i,yk=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Bu(e)} is ${t}".`,replace:!0}),RB=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;TB=/inherit|supertype|subclass|extend|specializ/i,AB=8;$ne=new RegExp(`\\b(?:${[...Qh].join("|")})\\b`,"i"),Uk=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,IB=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,OB=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;vne=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(nt).join("|")})$`,"i"),Vh="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",Jh="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",NB=`(?:\\s+${Jh})?`,Sne=[new RegExp(`^${Vh}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${NB}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Vh}architecture\\s+(?:${Jh}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Vh}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${Jh}(?:\\s+here)?\\??$`,"i")],Ene={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:Fn.contains,subclasses:Fn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:Fn.calls,callees:Fn.calls,tests:Fn.tests,untested:Fn.tests,history:Fn.touches,exports:Fn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it",news:"surface or work the news feed built over this graph"},Gk="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",xne=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${Gk}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),jne=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${Gk}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),kne=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Rne=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),_ne=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Gu="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",Tne=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Gu}\\s*\\??$`,"i"),Ane=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Gu}\\s*\\??$`,"i"),Cne=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Gu}\\s*\\??$`,"i"),Ine=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Gu}\\s*[.!]*$`,"i"),LB=Object.freeze([...Qh].filter(e=>e!=="here").concat("they")),One=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${LB.join("|")})\\b(\\s+\\S.*)?$`,"i"),Nne=ne(".tmct","memory","corpus-seed.json")});_a();We();_n();cu();var Vu={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var Hk=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),vr=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Ku=e=>Hk[e]||"other",MB=e=>Math.max(0,Math.min(1,e));function Vk(e){let t=(e.sourceTypes||[]).map(n=>Rs[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:Rs.entailed}function FB(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function Kk(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function qk(e,t,n={},s={}){let o={...Vu,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter(v=>v&&v.object&&v.object!==e),a=[],c=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,l=[];for(let v of i){if(Ku(v.predicate)==="isa"){let k=Kk(v.object,n);if(c&&k>o.uninformativeClassMaxShare){a.push({row:v,family:"isa",reason:"uninformative-class",share:k});continue}}l.push(v)}let u=l.filter(v=>Ku(v.predicate)==="isa").map(v=>v.object),d=au(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),p=new Map,f=new Map;for(let v of d.clusters){let k=0;for(let I of v.objects){f.set(I,v.label);let x=l.find(T=>T.object===I&&Ku(T.predicate)==="isa");k+=x?Vk(x):0}p.set(v.label,k)}let m=null,h=-1;for(let[v,k]of[...p].sort((I,x)=>I[0].localeCompare(x[0])))k>h&&(h=k,m=v);let b=[];for(let v of l){let k=Ku(v.predicate),I=Vk(v),x={provenance:I};if(FB(v)&&(I-=o.entailedDepthPenalty,x.entailed=!0),k==="isa"){let $=.6+.4*(1-Kk(v.object,n));I*=$,x.informativeness=$;let _=f.get(v.object);m&&_&&_!==m&&(I-=o.minoritySensePenalty,x.minoritySense=_)}I=MB(I),b.push({row:v,family:k,score:I,reasons:x})}let g=[];for(let v of b)v.score<o.minScore?a.push({row:v.row,family:v.family,reason:"below-floor",score:v.score}):g.push(v);let y=new Map;for(let v of g)y.has(v.family)||y.set(v.family,[]),y.get(v.family).push(v);for(let v of y.values())v.sort((k,I)=>I.score-k.score||k.row.object.localeCompare(I.row.object));let w=vr.filter(v=>y.has(v)).concat([...y.keys()].filter(v=>!vr.includes(v)).sort()),E=[],R=!1;for(;E.length<r&&!R;){R=!0;for(let v of w){let k=y.get(v);if(k&&k.length&&(E.push(k.shift()),R=!1,E.length>=r))break}}for(let v of w)for(let k of y.get(v)||[])a.push({row:k.row,family:k.family,reason:"over-budget",score:k.score});return E.sort((v,k)=>{let I=vr.indexOf(v.family),x=vr.indexOf(k.family);return I-x||k.score-v.score||v.row.object.localeCompare(k.row.object)}),{term:e,selected:E,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}Ii();Ze();var DB=new Set(["isa","location","partOf","capableOf","usedFor"]),zB=new Set(["single","several","chained","group","closer"]),Yk=(e,t)=>`${e}:${t}`;function og(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!DB.has(n.family)||typeof n.form!="string"||!zB.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=Yk(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var Sr=e=>`${Ns(e)} ${e}`;function BB(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Sr(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Ci(s.map(Sr))}`:n}function UB(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(c=>String(c||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:Fr(o),A_TERM:Sr(o),A_TERM_CAP:Fr(Sr(o)),TERMS:$c(o),TERMS_CAP:Fr($c(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Sr(a):"",OBJECT:i,A_OBJECT:i?Sr(i):"",OBJECTS_A:Ci(r.map(Sr)),OBJECTS_PLURAL:Ci(r.map($c)),OBJECTS_RAW:Ci(r),CHAIN:BB(n&&n.length?n:r.slice(0,1))}}function WB(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function Ys(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(Yk(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=Nc(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(f=>f.object),p=WB(c[u],UB(r,d,s.chain,s.parent));return p?{text:p,rows:o,family:t,form:i}:null}Ii();var GB=vr.filter(e=>e!=="isa"&&e!=="other");function VB(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function Xk(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function KB(e,t){let n=c=>(t?.[c.object]||[])[1]||null,s=new Map;for(let c of e||[]){let l=n(c);l&&s.set(l,(s.get(l)||0)+1)}let o=new Map,r=[],i=[];for(let c of e||[]){let l=n(c);l&&s.get(l)>=2?(o.has(l)||(o.set(l,[]),r.push(l)),o.get(l).push(c)):i.push(c)}let a=r.map(c=>({parent:c,rows:o.get(c)}));return i.length&&a.push({parent:null,rows:i}),a}function HB(e,t,n){let s=new Map,o=new Map;for(let c of t||[]){let l=e?.[c.object];if(!Array.isArray(l)||l.length<2)continue;let u=l[l.length-1];!u||u===c.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(c))}let r=[...s.keys()].sort((c,l)=>s.get(l)-s.get(c)||c.localeCompare(l)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let c of r)for(let l of o.get(c)||[])a.has(l.id)||(a.add(l.id),i.push(l));return{roots:r,rows:i}}function qB(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let p=t[e[0].object],f=p&&p.length>1?"chained":"single",m=Ys(s,"isa",e,{term:n,form:f,chain:p});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let p=Ys(s,"isa",e,{term:n,form:"several"});return p&&r.push({...p,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),c=Ys(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});c&&r.push({...c,role:"names-term",paragraph:"definition"});let l=[];for(let p of KB(a,t))for(let f of Xk(p.rows,o.maxObjectsPerBodySentence))l.push({parent:p.parent,rows:f});if(l.length>o.maxBodySentences){let p=l.slice(0,o.maxBodySentences),f=p[p.length-1];for(let m of l.slice(o.maxBodySentences))f.rows=f.rows.concat(m.rows);f.parent=null,l=p}for(let p of l){let f=p.parent?Ys(s,"isa",p.rows,{term:n,form:"group",parent:p.parent,variantSeed:p.parent}):Ys(s,"isa",p.rows,{term:n,form:"several",variantSeed:n});f&&r.push({...f,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=HB(t,e,o.closerRootCount);if(u.length){let p=Ys(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});p&&r.push({...p,role:"closes-isa",paragraph:"definition"})}return r}function YB(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=Fr(`${Ns(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function XB(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function Jk(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Vu,...n.config||{}},a=VB(e?.selected||[]),c=[];for(let u of qB(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of GB){let d=a.get(u);if(!(!d||!d.length))for(let p of Xk(d,i.maxObjectsPerBodySentence)){let f=Ys(t,u,p,{term:s});f&&c.push({...f,role:"describes",paragraph:"description"})}}YB(c,s);let l=new Map;for(let u of c)for(let d of u.rows)l.has(d.id)||l.set(d.id,d);return{term:s,sentences:c,paragraphs:XB(c,o),provenanceRows:[...l.values()]}}var JB=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function QB(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var ZB=Object.freeze({facts:"show the facts",chains:"show the chains"});function eU(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:ZB,facts:n.map(JB),factCount:n.length,chains:s}}function Qk(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:QB(t?.provenanceRows||[]),detail:eU(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function Zk(e,t,n={},s=new Map,o={}){let r=qk(e,t,n,o),i=Jk(r,s,o);return Qk(r,i,o)}cu();Ra();var eR=new Set(["rdfs:subClassOf","rdf:type"]);function tR(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(eR.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function nR(e,t,n=6){let s=Ta(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=iu(r,s,{cap:n,stopAt:ou});i.length>1&&(o[r]=i)}return o}function sR(e){let t=[],n=new Set;for(let s of e||[])!s||!eR.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}We();_a();function tU(e,t,n,s,o={}){let r=og(s||[]);if(!r||r.size===0)return null;let i=t||[],a=tR(n||i),c=nR(a.subClassEdges,sR(i));return Zk(e,i,a,r,{...o,chains:c})}function oR(e,t,n,s={}){let o=St(e||{individuals:[],objectProperties:[]}),r=ee(V,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=tU(t,i,o,n,s);return nU(a)}function nU(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var sU="no session is open on this page yet \u2014 await tmct.open() first",rR=Symbol.for("tmct.surface.fallback");function iR({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[rR])return a;let c=null,l=()=>{if(!c)throw new Error(sU);return c},u={async open(...d){return c=await e(...d),c},get session(){return c},async turn(d,p){let f=l();return s?s(d,p,f):typeof f.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:f.turn(d,p)},async ask(d,p){return t?t(d,p,l()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,p){return n?n(d,p,l()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[rR]=r,i.tmct=u,u}function oU({payload:e=null}={}){let t=ua();return e&&(t.payload=e),{memoryDir:t}}async function rU(e,t,n){let s=null;try{s=await Fk(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await Bk(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}iR({open:oU,ask:rU,page:{normFactTerm:V,digestTermFromPayloadBrowser:oR},fallback:!0});})();
235
+ `)}${G}`,replace:!0,...U.length?{pending:{items:U.map(Q=>Q.trim()),noun:"facts"}}:{}}}let P=n?.parsed?.shape==="meta"?n.parsed.object:null,D=!1,H=null,Y=l.match(zB);if(Y)H=Y[1]?Y[1].trim():null,P=Y[2],D=!0;else if(!P&&!n?.parsed){let N=l.match(/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i);N&&(P=N[1])}if(!P)return null;let J=ee(c,P),L=lt(p.filter(N=>J.has(N.subject)),i),K=lt(p.filter(N=>J.has(N.object)),i),W=D?L.length?L:K:K.length?K:L;if(!W.length)return null;if(H&&W===L){let N=ee(c,H),F=z=>p.find(B=>B.subject===z.object&&N.has(B.object)),O=W.map(z=>({hit:z,bridge:F(z)})).find(({bridge:z})=>z);if(O)return{text:`${se(O.hit)} \u2014 ${se(O.bridge)}`,replace:!0}}return m(W)}function Xh(e){let t=e.sourceTypes||[];return t.length===0||t.some(n=>n!=="corpusWeak")}async function aR(e){let{resolveReasoningConfig:t}=await Promise.resolve().then(()=>(mk(),pk));try{let{loadTomlConfig:n,normalizeConfig:s}=await Promise.resolve().then(()=>(la(),Cp)),o=await n(e),r=await s(o,{configDir:e});return t(r)}catch{return t(null)}}function Fk(e,t,n){for(let s of t){if(e.has(s.subject))return s.subject;if(e.has(s.object))return s.object}return n}var og,yz,Bn,Fu,hk,Dk,qte,$z,Yte,gk,vz,Xte,zk,Bk,Uk,Sz,bk,Jte,Qte,Zte,ene,tne,ig,nne,Ez,qe,Uh,Wu,$r,xz,Wk,jz,yr,sne,one,rne,ine,ane,cne,lne,une,dne,fne,pne,mne,hne,gne,bne,wne,yne,$ne,wk,_z,qu,Tz,vne,Sne,Gk,Ene,xne,jne,kne,Az,Rne,Vh,Kh,Cz,_ne,Iz,Oz,Hh,Nz,Pz,Tne,Vk,Kk,Mz,Ane,Cne,Hk,Ine,One,Nne,Fz,Lne,Dz,wi,Pne,Mne,Fne,qk,Dne,zne,zz,Bne,Une,Wne,Gne,yk,vk,cg,Xs,Bz,Wz,Bu,qz,Xk,Vne,eg,Jk,Yz,Xz,Hu,Jz,Qz,Ro,Un,Zz,eB,tB,ng,jk,nB,_e,oB,rB,iB,kk,aB,uB,dB,fB,pB,mB,hB,gB,bB,wB,yB,$B,vB,SB,_k,tR,xB,jB,RB,_B,TB,AB,CB,Ck,IB,NB,DB,zB,BB,UB,Ok,WB,GB,VB,KB,HB,Nk,Ys,qB,Lk,Pk,Mk,YB,JB,QB,Kne,iR,eU,tU,Hne,Jh,sg,nU,qne,Yne,cR,Xne,Jne,Qne,Zne,ese,Yu,tse,nse,sse,ose,sU,rse,ise,Ia=M(()=>{Qe();$E();Qt();Me();rs();Rm();ql();Yl();xi();Xl();IE();Ue();ia();Gc();Zl();Om();ns();In();Dr();yc();Em();xm();Pr();Xn();Bd();ur();Gm();ex();ox();ix();Vm();ax();Ym();Xm();bx();wx();$x();pu();Ca();Ul();Ex();cu();mi();uj();pj();mj();xo();Dj();$c(void 0);wc(Vl);og=new Set(["it","this","that","here"]),yz=e=>og.has(String(e||"").trim().toLowerCase()),Bn={imports:"understand a dependency/import relationship",uses:"understand a dependency/usage relationship (imports and/or calls)",calls:"understand a call relationship",callsSymbol:"understand a call relationship",defines:"locate what a module/class defines",contains:"understand class membership (methods/attributes)",tests:"assess test coverage",inherits:"understand a class hierarchy/inheritance relationship",touches:"understand commit/change history",touchesSymbol:"understand commit/change history",cochange:"understand change-coupling between modules",reexports:"understand a module's public exports/API surface",serves:"understand which component provides or backs another",denotes:"understand which vocabulary term names a code entity"},Fu=e=>e?`${String(e).toLowerCase()}(s)`:"entities",hk="look up a taught fact about a subject/verb/object";Dk={find:{tool:"tmct_search",arg:"query",help:"lexical search across the graph"},search:{tool:"tmct_search",arg:"query",help:"alias of /find"},context:{tool:"tmct_context",arg:"symbol",help:"the sized edit bundle for a symbol (start here to change code)"},snippet:{tool:"tmct_snippet",arg:"symbol",help:"exact source of one function/class/method"},describe:{tool:"tmct_describe",arg:"symbol",help:"a symbol's definition, kind and relations"},signature:{tool:"tmct_signature",arg:"symbol",help:"a symbol's signature only"},members:{tool:"tmct_members",arg:"class",help:"the methods/attributes of a class"},subclasses:{tool:"tmct_subclasses",arg:"class",help:"the subclasses of a class"},impact:{tool:"tmct_impact",arg:"module",help:"what a change to this module or symbol reaches (impact closure)"},callers:{tool:"tmct_callers",arg:"symbol",help:"functions that call this symbol"},callees:{tool:"tmct_callees",arg:"symbol",help:"functions this symbol calls"},tests:{tool:"tmct_tests_for",arg:"symbol",help:"the tests covering this symbol"},untested:{tool:"tmct_untested",arg:null,help:"symbols with no covering test"},history:{tool:"tmct_history",arg:"symbol",help:"the commit history of this symbol"},exports:{tool:"tmct_exports",arg:"module",help:"a module's public exports"},arch:{tool:"tmct_architecture",arg:"package",help:"the architecture overview (optional package filter)",optional:!0}},qte=new Set(["stats","memory","focus",...Object.keys(Dk)]),$z=new Set(["have","has","holds","hold"]),Yte=new RegExp(`\\b(?:${[...Object.keys(me),...Object.keys(to)].filter(e=>!$z.has(e)).sort((e,t)=>t.length-e.length).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|")})\\b`,"i"),gk=e=>`${e.subject} ${e.predicate} ${e.object} ${e.provenance||""}`,vz=(e,t)=>{let n=gk(e),s=gk(t);return n<s?-1:n>s?1:0},Xte=new Set([...yE.map(e=>e.name),...Object.values(Dk).map(e=>e.tool)]),zk=new Set(["hi","hello","hey","yo","hiya","howdy","sup","greetings","g'day","gday","hey there","hi there","hello there","good morning","good afternoon","good evening","morning","alright","you alright","alright mate","morning all","yeah nah","hey y'all","howdy there","hiya there","good day","good day to you","salutations","good to meet you","pleased to meet you","yo yo","ayy","wassup","sup fam","heya","hiya!","gm","ge"]),Bk=new Set(["thanks","thank you","thankyou","thx","ty","ta","cheers","nice one","much appreciated","cool thanks","many thanks","much obliged","ta very much","cheers mate","cheers for that","tks","sweet thanks","nice","brilliant","ta for that","cheers, that's everything for now, thanks","that's everything for now, thanks","that's all for now, thanks"]),Uk=new Set(["bye","goodbye","quit","exit","see ya","see you","cya","later","farewell","peace","peace out","im off","i'm off","gtg","gotta go","catch you later","farewell then"]),Sz=new Set(["ok","okay","cool","aight","fair enough","got it","gotcha","noted","sounds good","sure","cool cool","right","haha ok fair enough"]),bk=e=>e.replace(/(.)\1+/g,"$1");Jte=rg(zk),Qte=rg(Bk),Zte=rg(Uk),ene=new RegExp(`^(?:${[...Sz].map(it).join("|")})\\s+(.+)$`,"i"),tne=[...zk,...Bk,...Uk,"what can you do","what do you do","help","how do you work","who are you","what are you","what is your name"],ig="(?:[a-z]+er|better|worse|(?:more|less)\\s+[a-z]+)",nne=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+(${ig})\\s+than\\s+(.+)$`,"i"),Ez=new RegExp(`^(?:is|are)\\s+(.+?)\\s+(${ig})\\s+than\\s+(.+?)[?.!\\s]*$`,"i"),qe="on|in|at|onto|upon|under|over|beside|near|behind|above|below|inside|outside",Uh="mgx:ownedBy",Wu="mgx:hasProperty",$r="rdfs:subClassOf",xz="rdf:type",Wk="rdfs:subPropertyOf",jz=new Set(["operator","teach","entailed"]),yr=e=>!!e.sourceTypes?.some(t=>jz.has(t));sne=new RegExp(`^you\\s+(?:can|may)\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),one=new RegExp(`^an?\\s+([a-z][\\w-]*)\\s+(?:can|may)\\s+be\\s+([a-z]+)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)[.!?]*$`,"i"),rne=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*nothing\\s+may\\s+([a-z]+)\\s+(${qe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),ine=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+must\\s+be\\s+(${ig})\\s+than\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),ane=new RegExp(`^([a-z]+ing)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)\\s+makes\\s+(?:it|the\\s+([a-z][\\w-]*))\\s+([a-z]+)\\s+(${qe})\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i"),cne=new RegExp(`^to\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)\\s*,?\\s*the\\s+([a-z][\\w-]*)\\s+may\\s+not\\s+be\\s+with\\s+the\\s+([a-z][\\w-]*)\\s+without\\s+the\\s+([a-z][\\w-]*)[.!?]*$`,"i");lne=new RegExp(`^the\\s+goal\\s+is\\s+that\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${qe})\\s+([\\w-]+)[.!?]*$`,"i"),une=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+to\\s+([a-z]+)\\s+(${qe})\\s+([\\w-]+)[.!?]*$`,"i"),dne=new RegExp(`^(?:the\\s+goal\\s+is\\s+for|i\\s+want)\\s+(?:(every|each|all)\\s+)?([\\w-]+)\\s+(${qe})\\s+([\\w-]+)[.!?]*$`,"i"),fne=new RegExp(`^(?:can|could)\\s+you\\s+([a-z]+)\\s+an?\\s+([a-z][\\w-]*)\\s+(${qe})\\s+an?\\s+([a-z][\\w-]*)[?.!]*$`,"i"),pne=new RegExp(`^(?:get|put|place|stack)\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${qe})\\s+([\\w-]+)[?.!]*$`,"i"),mne=new RegExp(`^the\\s+goal\\s+is\\s+(?:(every|each|all|both)\\s+)?(?:the\\s+)?([\\w-]+?)\\s+(${qe})\\s+([\\w-]+)[?.!]*$`,"i"),hne=new RegExp(`^(?:(every|each|all)\\s+)?([\\w-]+)\\s+([a-z]+s)\\s+(${qe})\\s+([\\w-]+)$`,"i"),gne=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?what\\s+if\\s+([\\w-]+)\\s+(?:had\\s+)?(?:started|start|starts|begun|began|begins|was|were|is|had\\s+been|rested|rests|sat|sits|stood|stands|lay|lies|lain)(?:\\s+(?:out|off))?\\s+(?:${qe})\\s+([\\w-]+)(?:\\s+(?:instead|initially|to\\s+start\\s+with|at\\s+the\\s+start|from\\s+the\\s+start|at\\s+the\\s+beginning))?[?.!\\s]*$`,"i"),bne=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:did\\s+you\\s+|do\\s+you\\s+|would\\s+you\\s+)?(?:choose\\s+to\\s+|decide\\s+to\\s+)?([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${qe})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?|to\\s+begin(?:\\s+with)?))?\\s+(?:instead\\s+of|rather\\s+than|and\\s+not|not)\\s+([\\w-]+)[?.!\\s]*$`,"i"),wne=new RegExp(`^(?:and\\s+|so\\s+|but\\s+)?why\\s+(?:not|didn'?t\\s+you|did\\s+you\\s+not|couldn'?t\\s+you)\\s+([a-z]+)\\s+([\\w-]+)(?:\\s+(?:${qe})\\s+([\\w-]+))?(?:\\s+(?:first|initially|at\\s+the\\s+start|to\\s+start(?:\\s+with)?))?[?.!\\s]*$`,"i"),yne=new RegExp(`^(?:what|who)\\s+([a-z']+)\\s+(${qe})\\s+(.+?)[?.!\\s]*$`,"i"),$ne=new RegExp(`^what\\s+(?:does|do|is)\\s+([\\w-]+)\\s+([a-z]+)(?:\\s+(${qe}))?[?.!\\s]*$`,"i"),wk=/^(?:anywhere|everywhere|nowhere|somewhere)$/i,_z=new Set(["bus","gas","plus","minus","surplus","lens","bias","atlas","canvas","virus","bonus","campus","census","chorus","circus","focus","status","iris","genius","sinus","walrus","cactus","fungus","radius","nucleus","alias","crocus","abacus","syllabus","octopus","platypus"]);qu="(?:(?:usually|often|sometimes|rarely|always|typically|generally|occasionally|frequently|normally|regularly|commonly|mostly|currently|still|also|really|actually|closely|strongly|directly)\\s+)?",Tz="(?:cannot|can't|can not|does not|doesn't|do not|don't|never)",vne=new RegExp(`^(.+?)\\s+(${Tz})\\s+(.+)$`,"i"),Sne=new RegExp(`^([\\w'-]+)\\s+${qu}([a-z]+)\\s+(.+?)[.!?]*$`,"i"),Gk="with|to|from|by|of|in|on|for|as|about|into",Ene=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are|was|were)\\s+${qu}(${Kl})\\s+(${Gk})\\s+(.+)$`,"i"),xne=new RegExp(`^(the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(is|are|was|were)\\s+(?:an?\\s+)?([\\w'-]+)\\s+(${Kl})\\s+(${Gk})\\s+(.+)$`,"i"),jne=new RegExp(`^(?:the\\s+|an?\\s+)([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+([a-z]+)\\s+(${qe})\\s+(.+?)[.!?]*$`,"i"),kne=new RegExp(`^(every|each|all)\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${qe})\\s+(.+?)[.!?]*$`,"i"),Az="(?:just\\s+)?(?:one|another)\\s+more|another",Rne=new RegExp(`^(?:${Az})\\s+([\\w'-]+)\\s+([a-z]+)\\s+(${qe})\\s+(.+?)[.!?]*$`,"i"),Vh=/^(?:is|are|am|owns|maintains)$/i,Kh=/\b(?:is|are|am|owns|maintains)\b/i,Cz=new RegExp("^(?:i|me|you|he|him|she|her|it|we|us|they|them|my|your|his|its|our|their|mine|yours|hers|ours|theirs|this|that|these|those|a|an|the|every|each|all|some|any|no|both|either|neither|in|on|at|to|from|by|with|for|of|about|into|onto|over|under|near|before|after|during|through|up|down|off|out|above|below|between|among|against|without|within|along|across|behind|beyond|upon|toward|towards|per|and|but|or|if|because|although|though|while|when|since|unless|until|whether|so|nor|than|as|what|who|whom|whose|which|where|why|how)$","i"),_ne=new RegExp(`^(?:${Mo.filter(e=>!/\s/.test(e)).join("|")})$`,"i");Iz=new RegExp(`^(?:does|did)\\s+(?:(?:every|each|all|any)\\s+)?([\\w'-]+)\\s+${qu}([a-z]+)\\s+(.+?)[?.!\\s]*$`,"i"),Oz=new RegExp(`^what\\s+(?:does|did)\\s+([\\w'-]+)\\s+${qu}([a-z]+(?:\\s+(?:${qe}))?)[?.!\\s]*$`,"i"),Hh=/^(?:be|own|maintain)$/i,Nz=new RegExp(`^(${qe})\\s+(.+)$`,"i");Pz=["first","second","third","then","next","finally","later","meanwhile","afterward","afterwards"],Tne=new RegExp(`^(?:${Pz.join("|")})\\b\\s*,?\\s+`,"i"),Vk=Object.freeze(["you","i","it","they","he","she","we"]),Kk=Object.freeze(["you're","i'm","it's","they're","he's","she's","we're"]),Mz=Object.freeze([...Kk,...Vk]),Ane=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(${Mz.join("|")})\\s+\\S+`,"i"),Cne=new RegExp(`^(?:every\\s+|each\\s+|all\\s+|some\\s+|a few\\s+|a\\s+|an\\s+)?(?:(${Vk.join("|")})\\s+(?:is|are|am|was|were)|(${Kk.join("|")}))\\s+(?:an?\\s+)?[\\w'-]+[.!?]*$`,"i"),Hk="forget|unlearn|delete|remove",Ine=new RegExp(`^(?:${Hk})\\s+(?:that\\s+)?(?:a\\s+|an\\s+)?([\\w-]+(?:\\s+[\\w-]+)?)\\s+(?:is|are)\\s+(?:an?\\s+)?(?:(?:kind|type)\\s+of\\s+)?([\\w-]+)$`,"i"),One=new RegExp(`^([\\w-]+)\\s+([a-z]+)s\\s+(${qe})\\s+([\\w-]+)$`,"i"),Nne=new RegExp(`^(?:${Hk})\\s+(?:that\\s+)?([\\w-]+)\\s+([a-z]+)s\\s+(${qe})\\s+([\\w-]+)$`,"i"),Fz="collection|set|group|family",Lne=new RegExp(`^(?:the\\s+|an?\\s+)?([\\w'-]+(?:\\s+[\\w'-]+)?)\\s+(?:is|are)\\s+an?\\s+(?:${Fz})\\s+of\\s+(?:the\\s+)?([\\w'-]+)[.!?]*$`,"i"),Dz=Object.freeze(["mgx:memberOf","mgx:partOf"]),wi="(?:\\s+(?:exactly|really|actually|truly|anyway|internally|properly))?",Pne=new RegExp(`^what\\s+does\\s+(.+?)${wi}\\s+do${wi}\\??$`,"i"),Mne=new RegExp(`^what\\s+(.+?)${wi}\\s+does${wi}\\??$`,"i"),Fne=new RegExp(`^what(?:'s|s|\\s+is)\\s+(.+?)${wi}\\s+do${wi}\\??$`,"i"),qk="([A-Za-z][\\w'.-]*(?:\\s+[A-Za-z][\\w'.-]*){0,3})",Dne=new RegExp(`^who\\s+(?:is|was)\\s+${qk}$`,"i"),zne=new RegExp(`^what\\s+(?:did|has)\\s+${qk}\\s+(?:touch(?:ed)?|chang(?:e|ed)|work(?:ed)?\\s+on|commit(?:ted)?)$`,"i"),zz="(?:good|bad|clean|messy|ugly|nice|great|terrible|awful|solid|elegant|readable|maintainable|well[- ]written|well[- ]structured|spaghetti|ok|okay|decent|healthy)",Bne=new RegExp(`^is\\s+(?:this|the)\\s+code(?:base)?\\s+(?:any\\s+)?${zz}\\b`,"i"),Une=new RegExp("^(?:what\\s+time\\s+is\\s+it(?:\\s+(?:now|right\\s+now))?|what(?:'s|s|\\s+is)\\s+the\\s+time(?:\\s+(?:now|right\\s+now))?|what\\s+day\\s+is\\s+it(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+(?:the\\s+)?(?:day|date)(?:\\s+today)?|what(?:'s|s|\\s+is)\\s+today'?s\\s+date|what(?:'s|s|\\s+is)\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?|how'?s\\s+the\\s+weather(?:\\s+like)?(?:\\s+(?:today|outside))?)\\??$","i"),Wne=Object.freeze({game:["higher","lower","warmer","colder","hotter","up","down","guess"],spiderFly:["watch","step","tick","move","board","web"],adventure:["help","xyzzy","wait","hint","plugh"]});Gne=new Set([...Object.keys(me).flatMap(e=>e.split(/[\s-]+/)),...bn,...Gn,"owns","maintains"].filter(e=>e.length>=3)),yk=new Set(["mgx:hidden-in","mgx:is-objective","mgx:unlocks-with","mgx:is-npc","mgx:acts-on-turn","mgx:acts-toward","mgx:is-container","mgx:is-open"]);vk=new Set(["owl:onProperty","owl:someValuesFrom","owl:allValuesFrom"]),cg=new Set(["mgx:currently-in","mgx:located-in","mgx:fixed-in","mgx:stands-locked-in","mgx:works-in"]),Xs=e=>`${e.subject} ${Hl(e.predicate)} ${e.object}`;Bz=Object.entries(qs).filter(([e])=>!cg.has(e)).map(([e,t])=>{let n=/^(?:is|are)\s+(.+)$/i.exec(t);return n?{predicate:e,marker:n[1].trim().toLowerCase()}:null}).filter(e=>e&&e.marker.length>1).sort((e,t)=>t.marker.length-e.marker.length);Wz=8;Bu=null;qz=/^(?:every|each|all|any)\s+/i;Xk=new Set(["module","modules","class","classes","function","functions","method","methods","handler","handlers","controller","controllers","service","services","component","components","flow","flows","thing","things","item","items","object","objects","commit","commits"]),Vne=new Set([["interpreter","compiler"],["string","thread"],["heart","kernel"],["battalion","heap"],["bash","sock"],["command","skill"],["docker","longshoreman"],["name","list"],["list","number"]].map(([e,t])=>[e,t].sort().join("|"))),eg=/^(?:is|are|was|were)\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Jk=/^(?:who|what)\s+(?:is|are)\s+(?:the|an?)\s+([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Yz=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]+(?:\s+[A-Z][\w-]*)?)'s\s+([a-z][\w-]*)[?.!\s]*$/i,Xz=/^(who|what)'?s\s+/i,Hu=e=>String(e).replace(Xz,(t,n)=>`${n} is `),Jz=/^(?:who|what)\s+(?:is|are|was|were)\s+([\w-]{2,}?)s\s+([a-z][\w-]*)[?.!\s]*$/i;Qz=/^list\s+(?:the\s+|all\s+)?([a-z][\w-]*)\s+of\s+([\w'-]+(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,Ro=/^(?:is|are)\s+(?:an?\s+)?(.+?)\s+(?:a\s+kind\s+of|a\s+type\s+of|an?)\s+(.+?)[?.!\s]*$/i,Un=new Set(["rdfs:subClassOf","rdf:type"]),Zz=6,eB=/^why\s+(?=(?:is|are)\b)/i,tB=/^explain\s+how\s+you\s+know\s+(?:that\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i;ng=new Set(["kind","sort","type","subclass","superclass"]),jk=/^(?:so\s+)?(.+?)\s+(?:is|are)\s+(?:an?\s+)?(.+?)\s*,?\s*(?:now\s+)?(?:right|correct|yeah)\??$/i,nB=/^(?:what\s+do\s+you\s+know\s+about|what(?:'s|s|\s+is)\s+in\s+your\s+memory\s+about|what\s+do\s+you\s+remember\s+about)\s+(.+?)[?.!\s]*$/i,_e=32;oB=/^(?:can|could)\s+(all\s+|every\s+)?(?:an?\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z]+)[?.!\s]*$/i,rB=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,iB=/^how\s+many\s+(.+?)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+have[?.!\s]*$/i,kk=new Set(["mgx:hasA","tmct:has"]),aB=/^(?:can|could)\s+(?:all\s+|every\s+)?(?:an?\s+|the\s+)?(.+?)\s+be\s+([a-z][\w-]*)[?.!\s]*$/i;uB=/^(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z]+)\s+(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i,dB=/^what\s+can\s+(?:an?\s+)?(.+?)\s+do[?.!\s]*$/i,fB=/^what\s+has\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,pB=/^what\s+(?:(?:can\s+be|is)\s+used\s+for|is\s+for)\s+(.+?)[?.!\s]*$/i,mB=/^where(?:'s|\s+is|\s+are)\s+(.+?)(?:\s+now)?\s*[?.!]*$/i,hB=/^where\s+(?:does|do|did)\s+(.+?)\s+[a-z][a-z'-]*(?:\s+now)?\s*[?.!]*$/i,gB=new RegExp(`^what(?:'s|\\s+is|\\s+are)\\s+(${qe})\\s+(.+?)\\s*[?.!]*$`,"i"),bB=/^what(?:'s|\s+is|\s+are)\s+(?:the\s+)?(parts|members|contents)\s+of\s+(?:the\s+|an?\s+)?(.+?)\s*[?.!]*$/i,wB=/^what\s+([a-z][\w-]*)\s+(?:does|do)\s+(?:an?\s+|the\s+)?(.+?)\s+([a-z][a-z-]*)\s*[?.!]*$/i,yB=/^(?:do|does)\s+(all\s+|every\s+)?(?:an?\s+|the\s+)?([\w'-]+(?:\s+[\w'-]+)*?)\s+([a-z-]+)[?.!\s]*$/i,$B=/^what\s+can\s+(?!be\s)(.+?)[?.!\s]*$/i,vB=/^what\s+(?:cannot|can't|cant|can\s+not)\s+(.+?)[?.!\s]*$/i,SB=/^(?:which|what)\s+([\w'-]+(?:\s+[\w'-]+)*?)\s+can\s+(.+?)[?.!\s]*$/i;_k=e=>String(e||"").replace(/\s+/g," ").trim();tR="(?:most|least)\\s+[a-z][\\w-]*|[a-z][\\w-]*est|best|worst",xB=new RegExp(`^which\\s+([\\w'-]+)\\s+(?:is|are)\\s+(?:the\\s+)?(${tR})[?.!\\s]*$`,"i"),jB=new RegExp(`^what(?:'s|s|\\s+is)\\s+the\\s+(${tR})\\s+([\\w'-]+)[?.!\\s]*$`,"i");RB=new Set(["rdfs:subClassOf","rdf:type","mgx:hasA","mgx:capableOf","mgx:usedFor","mgx:ownedBy","owl:disjointWith","mgx:hasProperty","mgx:receivesAction"]),_B=Object.entries(qs).filter(([e])=>!RB.has(e)&&!cg.has(e)).map(([e,t])=>({predicate:e,re:new RegExp(`^what\\s+${it(t)}\\s+(.+?)[?.!\\s]*$`,"i")})).sort((e,t)=>t.re.source.length-e.re.source.length),TB=new Set(["rdfs:subClassOf","rdf:type","owl:disjointWith","mgx:hasProperty","mgx:hasA","mgx:capableOf","mgx:ownedBy"]),AB=new Set(["mgx:partOf","mgx:memberOf"]),CB=Object.entries(qs).filter(([e])=>!TB.has(e)&&!cg.has(e)).map(([e,t])=>{let n;if(t==="can be")n=new RegExp("^can\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+be\\s+(.+?)[?.!\\s]*$","i");else if(t.startsWith("is ")){let s=it(t.slice(3));n=new RegExp(`^(?:is|are)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${s}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}else{let[s,...o]=t.split(" "),r=[va(s),...o].map(it).join("\\s+");n=new RegExp(`^(?:does|do)\\s+(?:an?\\s+|the\\s+)?(.+?)\\s+${r}\\s+(?:an?\\s+|the\\s+)?(.+?)[?.!\\s]*$`,"i")}return{predicate:e,phrase:t,re:n}}).sort((e,t)=>t.re.source.length-e.re.source.length),Ck=/^what\s+(?:inherits?\s+(?:from\s+)?(?:an?\s+)?|is\s+(?:an?\s+)?(?:kind|sort|type)\s+of\s+|is\s+(?:an?\s+)?subclass\s+of\s+)(.+?)[?.!\s]*$/i,IB=new Set(["changed","change","changes","updated","modified","happened","occurred"]);NB=new Set(["owl:unionof","owl:complementof","owl:oneof","owl:allvaluesfrom","owl:mincardinality","owl:maxcardinality","owl:cardinality","rdfs:subpropertyof","owl:inverseof"]);DB=/^what\s+(?:did|have)\s+(?:i|we|you)\s+(?:told|tell|said|say)\s+(?:you|me|us)?\s*about\s+(.+?)[?.!\s]*$/i,zB=/^what\s+(?:kind|type)\s+of\s+(?:an?\s+)?([\w-]+(?:\s+[\w-]+)?)?\s*(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,BB=/^does\s+every\s+(.+?)\s+have\s+at\s+least\s+(\d+)\s+(.+?)[?.!\s]*$/i,UB=/^does\s+an?\s+(.+?)\s+have\s+an?\s+(.+?)[?.!\s]*$/i,Ok=new Set(["owl:cardinality","owl:minCardinality","owl:maxCardinality","owl:onClass"]),WB=/^who\s+(?:owns|maintains)\s+(.+?)[?.!\s]*$/i,GB=/^(?:does|did)\s+([\w'-]+)\s+(?:owns?|maintains?)\s+(.+?)[?.!\s]*$/i,VB=/^(?:is|are|was|were)\s+(.+?)\s+owned\s+by\s+([A-Za-z][\w'-]*(?:\s+[A-Z][\w'-]*)?)[?.!\s]*$/i,KB=/^(?:does|did)\s+([\w'-]+)\s+(?:has|have)\s+an?\s+([a-z][\w-]*)\s+method[?.!\s]*$/i,HB=/^what\s+methods\s+does\s+([\w'-]+)\s+have[?.!\s]*$/i,Nk=/^(?:is|are|was|were)\s+(.+?)\s+([A-Za-z][\w-]*)[?.!\s]*$/i,Ys=/^(?:it|this|that)$/i,qB=/^(?:it|them|this|that|in|on|of|to|at)$/i,Lk=/^(?:it|this|that)(?:\s+one)?\s+(?:before|after)\b/i,Pk=/^(?:you|i|they|he|she|we)\b/i,Mk=(e,t)=>({text:`I don't know anything about "${e}" yet \u2014 teach me directly, e.g. "remember that ${Ku(e)} is ${t}".`,replace:!0}),YB=/^(?:what\s+(?:did|have)\s+(?:i|we)\s+(?:told?|tell|said?|say)\s+(?:you|me|us)?(?:\s+(?:last\s+time|before|earlier|previously|already))?|what\s+facts?\s+do\s+you\s+(?:know|have|remember)|what\s+do\s+you\s+(?:know|remember)|what\s+have\s+you\s+(?:learned|learnt|remembered))[?.!\s]*$/i;JB=/inherit|supertype|subclass|extend|specializ/i,QB=8;Kne=new RegExp(`\\b(?:${[...og].join("|")})\\b`,"i"),iR=/^what\s+(?:is|are)\s+(?:an?\s+)?(.+?)[?.!\s]*$/i,eU=/^who\s+(?:is|are|was|were)\s+(?:an?\s+|the\s+)?([\w'-]+)[?.!\s]*$/i,tU=/^(?:please\s+|can\s+you\s+|could\s+you\s+)*(?:define|definition\s+of|give\s+me\s+the\s+definition\s+of)\s+(?:the\s+(?:term|word)\s+)?(?:an?\s+|the\s+)?(.+?)[?.!\s]*$/i;Hne=new RegExp(`^(?:(?:the|a|an)\\s+)?(.+?)\\s+(${Object.keys(nt).join("|")})$`,"i"),Jh="(?:(?:can|could|would)\\s+you\\s+(?:please\\s+)?)?(?:(?:show|give)\\s+(?:me|us)\\s+|describe\\s+|explain\\s+|what(?:'s|s|\\s+is)\\s+)?",sg="(?:of|for)\\s+(?:this|the)\\s+(?:app|codebase|repo|repository|project|code)",nU=`(?:\\s+${sg})?`,qne=[new RegExp(`^${Jh}the\\s+architecture(?:\\s+(?:overview|map|diagram))?${nU}(?:\\s+here)?\\??$`,"i"),new RegExp(`^${Jh}architecture\\s+(?:${sg}|overview|map|diagram)\\??$`,"i"),new RegExp(`^${Jh}(?:(?:an?|the)\\s+)?(?:overview|map|diagram)\\s+${sg}(?:\\s+here)?\\??$`,"i")],Yne={find:"locate a specific named entity",search:"locate a specific named entity",context:"gather the sized edit bundle for a symbol before changing code",snippet:"view a symbol's exact source",describe:"look up a symbol's definition and relations",signature:"view a symbol's signature",members:Bn.contains,subclasses:Bn.inherits,impact:"understand what a change to this module would reach (impact closure)",callers:Bn.calls,callees:Bn.calls,tests:Bn.tests,untested:Bn.tests,history:Bn.touches,exports:Bn.reexports,arch:"understand the overall architecture (package/module boundaries)",capabilities:"see what /plan can plan over \u2014 built-in query tools and taught actions",goals:"see the declared goals a trace is recognized against, and where each one came from",syllogise:"materialize the entailed facts that follow from what's remembered about one term",wiki:"toggle the live Wikipedia supplement for questions nothing local can answer",wikipedia:"choose which source the research lane fetches from",wikidata:"choose which source the research lane fetches from",export:"write the memory store to a file, in the standard JSONL shape",ingest:"read a local text file and store every fact the recognizer grounds from it",news:"surface or work the news feed built over this graph"},cR="(?:changed?|modif(?:y|ied)|edits?|edited|touch(?:es|ed)?|updates?|updated|alters?|altered|deletes?|deleted|removes?|removed|drops?|dropped)",Xne=new RegExp(`^what\\s+(?:would|will|might|could|does|do)?\\s*(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|is\\s+impacted|be\\s+impacted)\\s+if\\s+(?:i|we|you|one|someone)\\s+${cR}\\s+(?:the\\s+)?(.+?)[?.!\\s]*$`,"i"),Jne=new RegExp(`^if\\s+(?:i|we|you|one|someone)\\s+${cR}\\s+(?:the\\s+)?(.+?),?\\s+what\\s+(?:would\\s+|will\\s+|might\\s+|could\\s+|does\\s+|do\\s+)?(?:breaks?|fails?|happens?|stops?\\s+working|is\\s+affected|are\\s+affected|gets?\\s+affected|be\\s+affected|would\\s+break|will\\s+break)[?.!\\s]*$`,"i"),Qne=new RegExp("^what\\s+(?:is|are|gets?|would\\s+be|will\\s+be)\\s+(?:affected|impacted|broken)\\s+(?:by|when|if)\\s+(?:i\\s+|we\\s+|you\\s+)?(?:chang(?:e|es|ing)|edit(?:s|ing)?|modif(?:y|ies|ying)|touch(?:es|ing)?|updat(?:e|es|ing)|delet(?:e|es|ing)|remov(?:e|es|ing)|a\\s+change\\s+to)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Zne=new RegExp("^(?:(?:can|could)\\s+(?:i|we|you|one|someone)\\s+safely|is\\s+it\\s+safe\\s+to)\\s+(?:change|edit|modify|touch|update|alter|delete|remove|drop)\\s+(?:the\\s+)?(.+?)[?.!\\s]*$","i"),ese=new RegExp("^(?:what(?:'s|\\s+is)\\s+the\\s+)?(?:blast\\s+radius|impact)\\s+(?:of|for)\\s+(?:chang(?:ing|es)\\s+|editing\\s+|modifying\\s+|touching\\s+|updating\\s+|deleting\\s+|removing\\s+)?(?:the\\s+)?(.+?)[?.!\\s]*$","i"),Yu="as\\s+(?:its|the|an?)?\\s*(?:base\\s+class|parent\\s+class|base|parent)",tse=new RegExp(`^(.+?)\\s+uses?\\s+(?:which\\s+[\\w'-]+|what)\\s+${Yu}\\s*\\??$`,"i"),nse=new RegExp(`^what\\s+(?:does|do|did)\\s+(.+?)\\s+uses?\\s+${Yu}\\s*\\??$`,"i"),sse=new RegExp(`^(?:does|do|did)\\s+(.+?)\\s+uses?\\s+(.+?)\\s+${Yu}\\s*\\??$`,"i"),ose=new RegExp(`^(.+?)\\s+uses?\\s+(.+?)\\s+${Yu}\\s*[.!]*$`,"i"),sU=Object.freeze([...og].filter(e=>e!=="here").concat("they")),rse=new RegExp(`^((?:is|are|can|could|does|do)\\s+|what\\s+(?:is|are)\\s+)(${sU.join("|")})\\b(\\s+\\S.*)?$`,"i"),ise=ne(".tmct","memory","corpus-seed.json")});Ia();Ue();Cn();pu();var Xu={uninformativeClassMaxShare:.35,uninformativeClassMinSubjects:12,entailedDepthPenalty:.2,minoritySensePenalty:.5,minScore:.05,groupSplitThreshold:4,openerConceptCount:2,maxObjectsPerBodySentence:4,maxBodySentences:4,closerRootCount:2,budget:{chatReply:5,researchPanel:10,cliDigest:12,ledgerTerm:8}};var dR=Object.freeze({"rdfs:subClassOf":"isa","rdf:type":"isa","mgx:atLocation":"location","mgx:locatedNear":"location","mgx:partOf":"partOf","mgx:memberOf":"partOf","mgx:capableOf":"capableOf","mgx:usedFor":"usedFor"}),Sr=Object.freeze(["isa","location","partOf","capableOf","usedFor","other"]),Ju=e=>dR[e]||"other",rU=e=>Math.max(0,Math.min(1,e));function lR(e){let t=(e.sourceTypes||[]).map(n=>_s[n]??0);return t.length?Math.max(...t):typeof e.trust=="number"&&e.trust>0?e.trust:_s.entailed}function iU(e){return Array.isArray(e.environments)&&e.environments.length?!0:(e.sourceTypes||[]).includes("entailed")}function uR(e,t){let n=Number(t?.totalSubjects)||0;return n<=0?0:(Number(t?.classSubjectCounts?.[e])||0)/n}function fR(e,t,n={},s={}){let o={...Xu,...s.config||{}},r=Number.isInteger(s.budget)?s.budget:o.budget.chatReply,i=(t||[]).filter(S=>S&&S.object&&S.object!==e),a=[],c=(Number(n?.totalSubjects)||0)>=o.uninformativeClassMinSubjects,l=[];for(let S of i){if(Ju(S.predicate)==="isa"){let j=uR(S.object,n);if(c&&j>o.uninformativeClassMaxShare){a.push({row:S,family:"isa",reason:"uninformative-class",share:j});continue}}l.push(S)}let u=l.filter(S=>Ju(S.predicate)==="isa").map(S=>S.object),d=fu(u,{subClassEdges:n.subClassEdges||[],disjointEdges:n.disjointEdges||[]}),p=new Map,f=new Map;for(let S of d.clusters){let j=0;for(let I of S.objects){f.set(I,S.label);let x=l.find(_=>_.object===I&&Ju(_.predicate)==="isa");j+=x?lR(x):0}p.set(S.label,j)}let m=null,h=-1;for(let[S,j]of[...p].sort((I,x)=>I[0].localeCompare(x[0])))j>h&&(h=j,m=S);let b=[];for(let S of l){let j=Ju(S.predicate),I=lR(S),x={provenance:I};if(iU(S)&&(I-=o.entailedDepthPenalty,x.entailed=!0),j==="isa"){let $=.6+.4*(1-uR(S.object,n));I*=$,x.informativeness=$;let T=f.get(S.object);m&&T&&T!==m&&(I-=o.minoritySensePenalty,x.minoritySense=T)}I=rU(I),b.push({row:S,family:j,score:I,reasons:x})}let g=[];for(let S of b)S.score<o.minScore?a.push({row:S.row,family:S.family,reason:"below-floor",score:S.score}):g.push(S);let w=new Map;for(let S of g)w.has(S.family)||w.set(S.family,[]),w.get(S.family).push(S);for(let S of w.values())S.sort((j,I)=>I.score-j.score||j.row.object.localeCompare(I.row.object));let y=Sr.filter(S=>w.has(S)).concat([...w.keys()].filter(S=>!Sr.includes(S)).sort()),v=[],R=!1;for(;v.length<r&&!R;){R=!0;for(let S of y){let j=w.get(S);if(j&&j.length&&(v.push(j.shift()),R=!1,v.length>=r))break}}for(let S of y)for(let j of w.get(S)||[])a.push({row:j.row,family:j.family,reason:"over-budget",score:j.score});return v.sort((S,j)=>{let I=Sr.indexOf(S.family),x=Sr.indexOf(j.family);return I-x||j.score-S.score||S.row.object.localeCompare(j.row.object)}),{term:e,selected:v,cut:a,senses:{split:d.split,clusters:d.clusters,dominantLabel:m}}}Pi();Ye();var aU=new Set(["isa","location","partOf","capableOf","usedFor"]),cU=new Set(["single","several","chained","group","closer"]),pR=(e,t)=>`${e}:${t}`;function ug(e){let t=new Map;for(let n of e||[]){if(!n||typeof n.family!="string"||!aU.has(n.family)||typeof n.form!="string"||!cU.has(n.form)||typeof n.template!="string"||!n.template.trim())continue;let s=pR(n.family,n.form);t.has(s)||t.set(s,{family:n.family,form:n.form,templates:[]});let o=t.get(s);o.templates.includes(n.template)||o.templates.push(n.template)}return t}var Er=e=>`${Ls(e)} ${e}`;function lU(e){let t=(e||[]).map(o=>String(o||"").trim()).filter(Boolean);if(!t.length)return"";let n=Er(t[0]),s=t.slice(1);return s.length?`${n}, and so ${Li(s.map(Er))}`:n}function uU(e,t,n,s){let o=String(e||"").trim(),r=(t||[]).map(c=>String(c||"").trim()).filter(Boolean),i=r[0]||"",a=String(s||"").trim();return{TERM:o,TERM_CAP:zr(o),A_TERM:Er(o),A_TERM_CAP:zr(Er(o)),TERMS:Sc(o),TERMS_CAP:zr(Sc(o)),PRONOUN:"it",PRONOUN_CAP:"It",PARENT:a,A_PARENT:a?Er(a):"",OBJECT:i,A_OBJECT:i?Er(i):"",OBJECTS_A:Li(r.map(Er)),OBJECTS_PLURAL:Li(r.map(Sc)),OBJECTS_RAW:Li(r),CHAIN:lU(n&&n.length?n:r.slice(0,1))}}function dU(e,t){return String(e).replace(/\{([A-Z_]+)\}/g,(n,s)=>s in t?t[s]:"").replace(/\s+/g," ").replace(/\s+([.,;])/g,"$1").trim()}function Js(e,t,n,s={}){let o=(n||[]).filter(Boolean);if(!o.length)return null;let r=s.term??o[0].subject??"",i=s.form||(o.length>1?"several":"single"),a=e instanceof Map?e.get(pR(t,i)):null,c=a?a.templates:null;if(!c||!c.length)return null;let l=s.variantSeed??"",u=Pc(`${r}|${t}|${i}|${l}`)%c.length,d=s.objectsOverride||o.map(f=>f.object),p=dU(c[u],uU(r,d,s.chain,s.parent));return p?{text:p,rows:o,family:t,form:i}:null}Pi();var fU=Sr.filter(e=>e!=="isa"&&e!=="other");function pU(e){let t=new Map;for(let n of e||[])t.has(n.family)||t.set(n.family,[]),t.get(n.family).push(n.row);return t}function mR(e,t){let n=Math.max(1,Math.trunc(t)||1),s=[];for(let o=0;o<(e||[]).length;o+=n)s.push(e.slice(o,o+n));return s}function mU(e,t){let n=c=>(t?.[c.object]||[])[1]||null,s=new Map;for(let c of e||[]){let l=n(c);l&&s.set(l,(s.get(l)||0)+1)}let o=new Map,r=[],i=[];for(let c of e||[]){let l=n(c);l&&s.get(l)>=2?(o.has(l)||(o.set(l,[]),r.push(l)),o.get(l).push(c)):i.push(c)}let a=r.map(c=>({parent:c,rows:o.get(c)}));return i.length&&a.push({parent:null,rows:i}),a}function hU(e,t,n){let s=new Map,o=new Map;for(let c of t||[]){let l=e?.[c.object];if(!Array.isArray(l)||l.length<2)continue;let u=l[l.length-1];!u||u===c.object||(s.set(u,(s.get(u)||0)+1),o.has(u)||o.set(u,[]),o.get(u).push(c))}let r=[...s.keys()].sort((c,l)=>s.get(l)-s.get(c)||c.localeCompare(l)).slice(0,Math.max(0,n)),i=[],a=new Set;for(let c of r)for(let l of o.get(c)||[])a.has(l.id)||(a.add(l.id),i.push(l));return{roots:r,rows:i}}function gU(e,t,n,s,o){let r=[];if(!e.length)return r;if(e.length===1){let p=t[e[0].object],f=p&&p.length>1?"chained":"single",m=Js(s,"isa",e,{term:n,form:f,chain:p});return m&&r.push({...m,role:"names-term",paragraph:"definition"}),r}if(e.length<=o.groupSplitThreshold){let p=Js(s,"isa",e,{term:n,form:"several"});return p&&r.push({...p,role:"names-term",paragraph:"definition"}),r}let i=e.slice(0,o.openerConceptCount),a=e.slice(o.openerConceptCount),c=Js(s,"isa",i,{term:n,form:i.length>1?"several":"single",variantSeed:n});c&&r.push({...c,role:"names-term",paragraph:"definition"});let l=[];for(let p of mU(a,t))for(let f of mR(p.rows,o.maxObjectsPerBodySentence))l.push({parent:p.parent,rows:f});if(l.length>o.maxBodySentences){let p=l.slice(0,o.maxBodySentences),f=p[p.length-1];for(let m of l.slice(o.maxBodySentences))f.rows=f.rows.concat(m.rows);f.parent=null,l=p}for(let p of l){let f=p.parent?Js(s,"isa",p.rows,{term:n,form:"group",parent:p.parent,variantSeed:p.parent}):Js(s,"isa",p.rows,{term:n,form:"several",variantSeed:n});f&&r.push({...f,role:"describes-isa",paragraph:"definition"})}let{roots:u,rows:d}=hU(t,e,o.closerRootCount);if(u.length){let p=Js(s,"isa",d.length?d:e,{term:n,form:"closer",objectsOverride:u,variantSeed:n});p&&r.push({...p,role:"closes-isa",paragraph:"definition"})}return r}function bU(e,t){if(!e.length)return;let n=e[0];if(/\bnames-term\b/.test(n.role))return;let s=zr(`${Ls(t)} ${t}`);n.text=n.text.replace(/^It\b/,s),n.role="names-term"}function wU(e,t){let n=[],s=null,o=null;for(let r of e)(!s||r.paragraph!==o||s.length>=t)&&(s=[],o=r.paragraph,n.push(s)),s.push(r);return n.map(r=>({sentences:r,text:r.map(i=>i.text).join(" ")}))}function hR(e,t,n={}){let s=e?.term||"",o=Number.isInteger(n.maxSentencesPerParagraph)?n.maxSentencesPerParagraph:3,r=n.chains||{},i={...Xu,...n.config||{}},a=pU(e?.selected||[]),c=[];for(let u of gU(a.get("isa")||[],r,s,t,i))c.push(u);for(let u of fU){let d=a.get(u);if(!(!d||!d.length))for(let p of mR(d,i.maxObjectsPerBodySentence)){let f=Js(t,u,p,{term:s});f&&c.push({...f,role:"describes",paragraph:"description"})}}bU(c,s);let l=new Map;for(let u of c)for(let d of u.rows)l.has(d.id)||l.set(d.id,d);return{term:s,sentences:c,paragraphs:wU(c,o),provenanceRows:[...l.values()]}}var yU=e=>({subject:e.subject,predicate:e.predicate,object:e.object,sourceTypes:e.sourceTypes||[],provenance:e.provenance||""});function $U(e){let t=new Set,n=[];for(let s of e||[]){let o=s.provenance||(s.sourceTypes||[]).join(",");!o||t.has(o)||(t.add(o),n.push({provenance:s.provenance||"",sourceTypes:s.sourceTypes||[]}))}return n}var vU=Object.freeze({facts:"show the facts",chains:"show the chains"});function SU(e,t){let n=[...(e?.selected||[]).map(o=>o.row),...(e?.cut||[]).map(o=>o.row)].filter(Boolean),s=Object.entries(t||{}).filter(([,o])=>Array.isArray(o)&&o.length>1).map(([o,r])=>({object:o,chain:r}));return{escapes:vU,facts:n.map(yU),factCount:n.length,chains:s}}function gR(e,t,n={}){let s=t?.term||e?.term||"";return{kind:"term-article",term:s,headline:s,paragraphs:(t?.paragraphs||[]).map(o=>o.text).filter(Boolean),body:t?.paragraphs||[],sources:$U(t?.provenanceRows||[]),detail:SU(e,n.chains),provenanceRows:t?.provenanceRows||[]}}function bR(e,t,n={},s=new Map,o={}){let r=fR(e,t,n,o),i=hR(r,s,o);return gR(r,i,o)}pu();Ca();var wR=new Set(["rdfs:subClassOf","rdf:type"]);function yR(e){let t=new Map,n=new Set,s=[],o=[];for(let i of e||[])!i||!i.predicate||(wR.has(i.predicate)?(n.add(i.subject),t.has(i.object)||t.set(i.object,new Set),t.get(i.object).add(i.subject),s.push([i.subject,i.object])):i.predicate==="owl:disjointWith"&&o.push([i.subject,i.object]));let r={};for(let[i,a]of t)r[i]=a.size;return{classSubjectCounts:r,totalSubjects:n.size,subClassEdges:s,disjointEdges:o}}function $R(e,t,n=6){let s=Oa(e||[]),o={};for(let r of t||[]){if(r in o)continue;let i=du(r,s,{cap:n,stopAt:lu});i.length>1&&(o[r]=i)}return o}function vR(e){let t=[],n=new Set;for(let s of e||[])!s||!wR.has(s.predicate)||n.has(s.object)||(n.add(s.object),t.push(s.object));return t}Ue();Ia();function EU(e,t,n,s,o={}){let r=ug(s||[]);if(!r||r.size===0)return null;let i=t||[],a=yR(n||i),c=$R(a.subClassEdges,vR(i));return bR(e,i,a,r,{...o,chains:c})}function SR(e,t,n,s={}){let o=mt(e||{individuals:[],objectProperties:[]}),r=ee(V,t),i=o.filter(c=>r.has(c.subject));if(!i.length)return null;let a=EU(t,i,o,n,s);return xU(a)}function xU(e){if(!e||!Array.isArray(e.paragraphs)||!e.paragraphs.length)return null;let t=e.detail&&Array.isArray(e.detail.facts)?e.detail.facts:[];return{term:e.term||"",paragraphs:e.paragraphs.slice(),sources:[...new Set((e.sources||[]).map(n=>n.provenance).filter(Boolean))],facts:t,factCount:e.detail&&Number.isInteger(e.detail.factCount)?e.detail.factCount:t.length}}var jU="no session is open on this page yet \u2014 await tmct.open() first",ER=Symbol.for("tmct.surface.fallback");function xR({open:e,ask:t=null,plan:n=null,turn:s=null,page:o={},fallback:r=!1,target:i=globalThis}={}){if(typeof e!="function")throw new Error("publishTmctSurface: `open` must be this page's session factory");let a=i.tmct;if(r&&a&&!a[ER])return a;let c=null,l=()=>{if(!c)throw new Error(jU);return c},u={async open(...d){return c=await e(...d),c},get session(){return c},async turn(d,p){let f=l();return s?s(d,p,f):typeof f.turn!="function"?{answer:"this page runs no conversational turn \u2014 see tmct.session for what it does run",end:!1,record:null,plan:null,research:null}:f.turn(d,p)},async ask(d,p){return t?t(d,p,l()):{answer:"this page has no separate ask route \u2014 it answers questions through tmct.turn()",data:void 0,miss:!0}},async plan(d,p){return n?n(d,p,l()):{refused:!0,why:"this page's bundle carries no capability planner",driver:null,calls:[],composed:null,observed:null}},page:o,fallback:r};return u[ER]=r,i.tmct=u,u}function kU({payload:e=null}={}){let t=ma();return e&&(t.payload=e),{memoryDir:t}}async function RU(e,t,n){let s=null;try{s=await nR(n.memoryDir,e,null,!0,{})}catch{s=null}if(!(s&&s.text))try{s=await rR(n.memoryDir,e,null,!0,null)}catch{s=null}return s&&s.text?{answer:s.text,data:s,miss:!1}:{answer:null,data:null,miss:!0}}xR({open:kU,ask:RU,page:{normFactTerm:V,digestTermFromPayloadBrowser:SR},fallback:!0});})();