@kitelev/exocortex-cli 15.174.5 → 15.176.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +100 -100
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // @kitelev/exocortex-cli v15.174.5
2
+ // @kitelev/exocortex-cli v15.176.0
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -30,14 +30,14 @@ Expecting one of '${r.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
30
30
  Expecting one of '${r.join("', '")}'`);let i=`${e}Help`;return this.on(i,s=>{let o;typeof t=="function"?o=t({error:s.error,command:s.command}):o=t,o&&s.write(`${o}
31
31
  `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function h2(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let t,r="127.0.0.1",i="9229",s;return(s=e.match(/^(--inspect(-brk)?)$/))!==null?t=s[1]:(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=s[1],/^\d+$/.test(s[3])?i=s[3]:r=s[3]):(s=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=s[1],r=s[3],i=s[4]),t&&i!=="0"?`${t}=${r}:${parseInt(i)+1}`:e})}a(h2,"incrementNodeInspectorPort");function S0(){if(ot.env.NO_COLOR||ot.env.FORCE_COLOR==="0"||ot.env.FORCE_COLOR==="false")return!1;if(ot.env.FORCE_COLOR||ot.env.CLICOLOR_FORCE!==void 0)return!0}a(S0,"useColor");v0.Command=_0;v0.useColor=S0});var _2=S(Qn=>{var{Argument:m2}=rh(),{Command:b0}=p2(),{CommanderError:PL,InvalidArgumentError:g2}=Du(),{Help:OL}=f0(),{Option:y2}=m0();Qn.program=new b0;Qn.createCommand=n=>new b0(n);Qn.createOption=(n,e)=>new y2(n,e);Qn.createArgument=(n,e)=>new m2(n,e);Qn.Command=b0;Qn.Option=y2;Qn.Argument=m2;Qn.Help=OL;Qn.CommanderError=PL;Qn.InvalidArgumentError=g2;Qn.InvalidOptionArgumentError=g2});var Nu=S(ih=>{"use strict";Object.defineProperty(ih,"__esModule",{value:!0});ih.AssetClass=void 0;var v2;(function(n){n.AREA="ems__Area",n.TASK="ems__Task",n.PROJECT="ems__Project",n.MEETING="ems__Meeting",n.INITIATIVE="ems__Initiative",n.TASK_PROTOTYPE="ems__TaskPrototype",n.MEETING_PROTOTYPE="ems__MeetingPrototype",n.EVENT_PROTOTYPE="exo__EventPrototype",n.PROJECT_PROTOTYPE="ems__ProjectPrototype",n.EVENT="exo__Event",n.DAILY_NOTE="pn__DailyNote",n.CONCEPT="ims__Concept",n.SESSION_START_EVENT="ems__SessionStartEvent",n.SESSION_END_EVENT="ems__SessionEndEvent",n.PROTOTYPE="exo__Prototype",n.CLASS="exo__Class",n.FLEETING_NOTE="ztlk__FleetingNote",n.WORKFLOW="ems__Workflow",n.WORKFLOW_STATE="ems__WorkflowState",n.WORKFLOW_TRANSITION="ems__WorkflowTransition",n.COMMAND="exocmd__Command",n.PRECONDITION="exocmd__Precondition",n.GROUNDING="exocmd__Grounding",n.COMMAND_BINDING="exocmd__CommandBinding"})(v2||(ih.AssetClass=v2={}))});var Tc=S(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.EffortStatus=void 0;var b2;(function(n){n.DRAFT="ems__EffortStatusDraft",n.BACKLOG="ems__EffortStatusBacklog",n.ANALYSIS="ems__EffortStatusAnalysis",n.TODO="ems__EffortStatusToDo",n.DOING="ems__EffortStatusDoing",n.DONE="ems__EffortStatusDone",n.TRASHED="ems__EffortStatusTrashed"})(b2||(sh.EffortStatus=b2={}))});var w0=S(Qt=>{"use strict";Object.defineProperty(Qt,"__esModule",{value:!0});Qt.EFFORT_STATUS_OPTIONS=Qt.STATUS_NAME_TO_WIKILINK=Qt.STATUS_NAME_TO_ENUM=Qt.EFFORT_STATUS_CONFIG=void 0;Qt.normalizeEffortStatus=FL;Qt.isDoneStatus=DL;Qt.isTrashedStatus=NL;Qt.getEffortStatusLabel=LL;var os=Tc();Qt.EFFORT_STATUS_CONFIG=[{name:"Draft",status:os.EffortStatus.DRAFT,wikilink:"[[ems__EffortStatusDraft]]"},{name:"Backlog",status:os.EffortStatus.BACKLOG,wikilink:"[[ems__EffortStatusBacklog]]"},{name:"Analysis",status:os.EffortStatus.ANALYSIS,wikilink:"[[ems__EffortStatusAnalysis]]"},{name:"To Do",status:os.EffortStatus.TODO,wikilink:"[[ems__EffortStatusToDo]]"},{name:"Doing",status:os.EffortStatus.DOING,wikilink:"[[ems__EffortStatusDoing]]"},{name:"Done",status:os.EffortStatus.DONE,wikilink:"[[ems__EffortStatusDone]]"},{name:"Trashed",status:os.EffortStatus.TRASHED,wikilink:"[[ems__EffortStatusTrashed]]"}];Qt.STATUS_NAME_TO_ENUM=Object.fromEntries(Qt.EFFORT_STATUS_CONFIG.map(n=>[n.name,n.status]));Qt.STATUS_NAME_TO_WIKILINK=Object.fromEntries(Qt.EFFORT_STATUS_CONFIG.map(n=>[n.name,n.wikilink]));Qt.EFFORT_STATUS_OPTIONS=Qt.EFFORT_STATUS_CONFIG.map(n=>({value:n.wikilink,label:n.name}));function FL(n,e=os.EffortStatus.DRAFT){if(n.startsWith("ems__")){let r=Qt.EFFORT_STATUS_CONFIG.find(i=>i.status===n);return r?r.status:e}return Qt.STATUS_NAME_TO_ENUM[n]??e}a(FL,"normalizeEffortStatus");function DL(n){return n===os.EffortStatus.DONE}a(DL,"isDoneStatus");function NL(n){return n===os.EffortStatus.TRASHED}a(NL,"isTrashedStatus");function LL(n){if(!n)return"-";let e=String(n);if(e==="")return"-";for(let r of Qt.EFFORT_STATUS_CONFIG)if(r.wikilink===e||`[[${e}]]`===r.wikilink||r.status===e||r.name===e)return r.name;let t=e.toLowerCase();for(let r of Qt.EFFORT_STATUS_CONFIG)if(r.name.toLowerCase()===t)return r.name;return e}a(LL,"getEffortStatusLabel")});var Ac=S(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.GroundingType=void 0;var w2;(function(n){n.SPARQL_UPDATE="sparql_update",n.PROPERTY_DELETE="property_delete",n.PROPERTY_SET="property_set",n.COMPOSITE="composite",n.SERVICE_CALL="service_call",n.CREATE_INSTANCE="create_instance"})(w2||(oh.GroundingType=w2={}))});var E0=S(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.CommandBindingStyleProperty=Kn.CommandBindingProperty=Kn.GroundingProperty=Kn.PreconditionProperty=Kn.CommandProperty=void 0;Kn.CommandProperty={ICON:"exocmd__Command_icon",PRECONDITION:"exocmd__Command_precondition",GROUNDING:"exocmd__Command_grounding",CONFIRM_MESSAGE:"exocmd__Command_confirmMessage",SUCCESS_MESSAGE:"exocmd__Command_successMessage",CATEGORY:"exocmd__Command_category"};Kn.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};Kn.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",TARGET_VALUE:"exocmd__Grounding_targetValue",STEPS:"exocmd__Grounding_steps"};Kn.CommandBindingProperty={COMMAND:"exocmd__CommandBinding_command",TARGET_CLASS:"exocmd__CommandBinding_targetClass",TARGET_PROTOTYPE:"exocmd__CommandBinding_targetPrototype",TARGET_ASSET:"exocmd__CommandBinding_targetAsset",POSITION:"exocmd__CommandBinding_position",ORDER:"exocmd__CommandBinding_order",PRECONDITION:"exocmd__CommandBinding_precondition",STYLE:"exocmd__CommandBinding_style",VARIANT:"exocmd__CommandBinding_variant"};Kn.CommandBindingStyleProperty={VARIANT:"exocmd__CommandBindingStyle_variant",SHOW_ICON:"exocmd__CommandBindingStyle_showIcon",LABEL_CLASS:"exocmd__CommandBindingStyle_labelClass",ARIA_LABEL:"exocmd__CommandBindingStyle_ariaLabel",TOOLTIP:"exocmd__CommandBindingStyle_tooltip",KEYBOARD_SHORTCUT:"exocmd__CommandBindingStyle_keyboardShortcut",SOURCE:"exocmd__CommandBindingStyle_source"}});var T0=S(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.STYLE_SOURCE_VALUES=Tn.LABEL_CLASS_VALUES=Tn.COMMAND_VARIANT_VALUES=void 0;Tn.isCommandVariant=kL;Tn.isLabelClass=ML;Tn.isStyleSource=jL;Tn.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Tn.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Tn.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function kL(n){return typeof n=="string"&&Tn.COMMAND_VARIANT_VALUES.includes(n)}a(kL,"isCommandVariant");function ML(n){return typeof n=="string"&&Tn.LABEL_CLASS_VALUES.includes(n)}a(ML,"isLabelClass");function jL(n){return typeof n=="string"&&Tn.STYLE_SOURCE_VALUES.includes(n)}a(jL,"isStyleSource")});var E2=S(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.isCommandFrontmatter=$L;xc.isPreconditionFrontmatter=BL;xc.isGroundingFrontmatter=UL;xc.isCommandBindingFrontmatter=VL;function $L(n){return ah(n,"exocmd__Command")}a($L,"isCommandFrontmatter");function BL(n){return ah(n,"exocmd__Precondition")}a(BL,"isPreconditionFrontmatter");function UL(n){return ah(n,"exocmd__Grounding")}a(UL,"isGroundingFrontmatter");function VL(n){return ah(n,"exocmd__CommandBinding")}a(VL,"isCommandBindingFrontmatter");function ah(n,e){let t=n.exo__Instance_class;if(t==null)return!1;let r=Array.isArray(t)?t:[t];for(let i of r){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(ah,"hasInstanceClass")});var T2=S(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});ch.hasPosition=qL;ch.isFixed=WL;function qL(n){return typeof n.x=="number"&&typeof n.y=="number"}a(qL,"hasPosition");function WL(n){return n.fx!==null&&n.fx!==void 0&&n.fy!==null&&n.fy!==void 0}a(WL,"isFixed")});var A2=S(lh=>{"use strict";Object.defineProperty(lh,"__esModule",{value:!0});lh.createEmptyGraphData=GL;lh.mergeGraphData=zL;function GL(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(GL,"createEmptyGraphData");function zL(n,e){let t=new Map,r=new Set,i=[];for(let s of n.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of n.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;r.has(o)||(r.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(n.version??0,e.version??0)+1}}a(zL,"mergeGraphData")});var A0=S(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.createEdgeId=HL;uh.edgesEqual=QL;function HL(n,e,t,r){let i=r?`|${r}`:"";return`${n}->${e}:${t}${i}`}a(HL,"createEdgeId");function QL(n,e){return n.source===e.source&&n.target===e.target&&n.type===e.type&&n.predicate===e.predicate}a(QL,"edgesEqual")});var x0=S(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.BUILT_IN_EDGE_STYLES=Vt.BUILT_IN_NODE_STYLES=Vt.DEFAULT_EDGE_STYLE=Vt.DEFAULT_NODE_STYLE=Vt.RDF_TYPE_PREDICATES=void 0;Vt.mergeNodeStyles=KL;Vt.mergeEdgeStyles=YL;Vt.extractLocalName=XL;Vt.isClassType=JL;Vt.isTypePredicate=ZL;Vt.isSubClassPredicate=ek;Vt.RDF_TYPE_PREDICATES={RDF_TYPE:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",RDFS_CLASS:"http://www.w3.org/2000/01/rdf-schema#Class",OWL_CLASS:"http://www.w3.org/2002/07/owl#Class",RDFS_SUBCLASS_OF:"http://www.w3.org/2000/01/rdf-schema#subClassOf",OWL_EQUIVALENT_CLASS:"http://www.w3.org/2002/07/owl#equivalentClass",RDFS_LABEL:"http://www.w3.org/2000/01/rdf-schema#label",RDFS_COMMENT:"http://www.w3.org/2000/01/rdf-schema#comment"};Vt.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};Vt.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};Vt.BUILT_IN_NODE_STYLES={"http://www.w3.org/2000/01/rdf-schema#Class":{color:"#f59e0b",shape:"diamond",size:40},"http://www.w3.org/2002/07/owl#Class":{color:"#f59e0b",shape:"diamond",size:40},ems__Task:{color:"#22c55e",shape:"circle"},ems__Project:{color:"#3b82f6",shape:"square"},ems__Area:{color:"#8b5cf6",shape:"hexagon",size:40},ems__Meeting:{color:"#ec4899",shape:"circle"},exo__Class:{color:"#f59e0b",shape:"diamond"},ims__Person:{color:"#06b6d4",shape:"circle"}};Vt.BUILT_IN_EDGE_STYLES={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":{color:"#f59e0b",lineStyle:"dashed",arrow:"standard"},"http://www.w3.org/2000/01/rdf-schema#subClassOf":{color:"#8b5cf6",width:2,arrow:"triangle"},"https://exocortex.my/ontology/ems#Effort_parent":{color:"#6366f1",width:2,arrow:"standard"},"https://exocortex.my/ontology/exo#Asset_prototype":{color:"#f59e0b",lineStyle:"dashed",arrow:"circle"},"https://exocortex.my/ontology/exo#references":{color:"#22c55e",opacity:.4,arrow:"standard"}};function KL(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(KL,"mergeNodeStyles");function YL(n,e){return{...n,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(YL,"mergeEdgeStyles");function XL(n){let e=n.lastIndexOf("#"),t=n.lastIndexOf("/"),r=Math.max(e,t);return r>=0?n.substring(r+1):n}a(XL,"extractLocalName");function JL(n){return n===Vt.RDF_TYPE_PREDICATES.RDFS_CLASS||n===Vt.RDF_TYPE_PREDICATES.OWL_CLASS}a(JL,"isClassType");function ZL(n){return n===Vt.RDF_TYPE_PREDICATES.RDF_TYPE}a(ZL,"isTypePredicate");function ek(n){return n===Vt.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(ek,"isSubClassPredicate")});var C2=S(x2=>{"use strict";Object.defineProperty(x2,"__esModule",{value:!0})});var Ae=S(fh=>{"use strict";Object.defineProperty(fh,"__esModule",{value:!0});fh.IRI=void 0;var C0=class n{static{a(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!n.isValidIRI(t))throw new Error("Invalid IRI format");this._value=t}get value(){return this._value}equals(e){return this._value===e._value}toString(){return this._value}static isValidIRI(e){if(!e||e.trim().length===0||/\s/.test(e)||!/^[a-z][a-z0-9+.-]*:/i.test(e))return!1;let r=["http","https","ftp","ftps","file","mailto","tel","data","ws","wss","urn","obsidian"],i=e.match(/^([a-z][a-z0-9+.-]*?):/i);if(i){let s=i[1].toLowerCase();if(!r.includes(s))return!1}try{return new URL(e),!0}catch{return/^urn:[a-z0-9][a-z0-9-]{0,31}:[^\s]+$/i.test(e)}}};fh.IRI=C0});var Ne=S(ba=>{"use strict";Object.defineProperty(ba,"__esModule",{value:!0});ba.Literal=void 0;ba.parseLanguageTag=R2;ba.createDirectionalLiteral=rk;ba.createLiteralFromLanguageTag=nk;var tk="http://www.w3.org/2001/XMLSchema#string",Lu=class{static{a(this,"Literal")}constructor(e,t,r,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&r)throw new Error("Literal cannot have both datatype and language tag");if(i&&!r)throw new Error("Literal cannot have direction without language tag");if(i&&i!=="ltr"&&i!=="rtl")throw new Error('Direction must be "ltr" or "rtl"');this._value=e,this._datatype=t,this._language=r?r.toLowerCase():void 0,this._direction=i}get value(){return this._value}get datatype(){return this._datatype}get language(){return this._language}get direction(){return this._direction}hasDirection(){return this._direction!==void 0}equals(e){if(this._value!==e._value||this._language!==e._language||this._direction!==e._direction)return!1;let t=this.normalizedDatatype(),r=e.normalizedDatatype();return t===r}normalizedDatatype(){return!this._datatype||this._datatype.value===tk?null:this._datatype.value}toString(){let e=`"${this._value}"`;return this._datatype?e+=`^^<${this._datatype.value}>`:this._language&&(e+=`@${this._language}`,this._direction&&(e+=`--${this._direction}`)),e}};ba.Literal=Lu;function R2(n){let t=n.lastIndexOf("--");if(t===-1)return{language:n.toLowerCase()};let r=n.substring(t+2),i=n.substring(0,t);return r==="ltr"||r==="rtl"?{language:i.toLowerCase(),direction:r}:{language:n.toLowerCase()}}a(R2,"parseLanguageTag");function rk(n,e,t){return new Lu(n,void 0,e,t)}a(rk,"createDirectionalLiteral");function nk(n,e){let{language:t,direction:r}=R2(e);return new Lu(n,void 0,t,r)}a(nk,"createLiteralFromLanguageTag")});var qt=S(hh=>{"use strict";Object.defineProperty(hh,"__esModule",{value:!0});hh.BlankNode=void 0;var dh=class n{static{a(this,"BlankNode")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("BlankNode id cannot be empty");this._id=t}get id(){return this._id}equals(e){return this._id===e._id}toString(){return`_:${this._id}`}static generateId(){return`b${++n.counter}`}static create(){return new n(n.generateId())}};hh.BlankNode=dh;dh.counter=0});var lr=S(ph=>{"use strict";Object.defineProperty(ph,"__esModule",{value:!0});ph.Namespace=void 0;var I2=Ae(),Me=class n{static{a(this,"Namespace")}constructor(e,t){if(e.trim().length===0)throw new Error("Namespace prefix cannot be empty");this._prefix=e,this._iri=new I2.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new I2.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[r,i]=t;return r!==this._prefix?null:this.term(i)}static forPrefix(e){if(!/^[a-z][a-zA-Z0-9]*$/.test(e))return null;let t=n.KNOWN_NAMESPACES.find(r=>r.prefix===e);return t||new n(e,`${n.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=/^([a-z][a-zA-Z0-9]*)__(.+)$/.exec(e);if(!t)return null;let r=n.forPrefix(t[1]);return r?{namespace:r,localName:t[2]}:null}};ph.Namespace=Me;Me.RDF=new Me("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Me.RDFS=new Me("rdfs","http://www.w3.org/2000/01/rdf-schema#");Me.OWL=new Me("owl","http://www.w3.org/2002/07/owl#");Me.XSD=new Me("xsd","http://www.w3.org/2001/XMLSchema#");Me.EXO=new Me("exo","https://exocortex.my/ontology/exo#");Me.EMS=new Me("ems","https://exocortex.my/ontology/ems#");Me.EXOCMD=new Me("exocmd","https://exocortex.my/ontology/exocmd#");Me.IMS=new Me("ims","https://exocortex.my/ontology/ims#");Me.ZTLK=new Me("ztlk","https://exocortex.my/ontology/ztlk#");Me.PTMS=new Me("ptms","https://exocortex.my/ontology/ptms#");Me.LIT=new Me("lit","https://exocortex.my/ontology/lit#");Me.INBOX=new Me("inbox","https://exocortex.my/ontology/inbox#");Me.PMBOK=new Me("pmbok","https://exocortex.my/ontology/pmbok#");Me.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Me.KNOWN_NAMESPACES=[Me.EXO,Me.EMS,Me.EXOCMD,Me.IMS,Me.ZTLK,Me.PTMS,Me.LIT,Me.INBOX,Me.PMBOK]});var Yn=S(mh=>{"use strict";Object.defineProperty(mh,"__esModule",{value:!0});mh.Triple=void 0;var R0=Ae(),I0=Ne(),P0=qt(),O0=class{static{a(this,"Triple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof R0.IRI&&t instanceof R0.IRI||e instanceof P0.BlankNode&&t instanceof P0.BlankNode||e instanceof I0.Literal&&t instanceof I0.Literal||this.isQuotedTriple(e)&&this.isQuotedTriple(t)?e.equals(t):!1}isQuotedTriple(e){return typeof e=="object"&&e!==null&&"termType"in e&&e.termType==="QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`${e} ${t} ${r} .`}nodeToString(e){return e instanceof R0.IRI?`<${e.value}>`:e instanceof P0.BlankNode||e instanceof I0.Literal||this.isQuotedTriple(e)?e.toString():""}};mh.Triple=O0});var ku=S(gh=>{"use strict";Object.defineProperty(gh,"__esModule",{value:!0});gh.QuotedTriple=void 0;var F0=Ae(),D0=Ne(),N0=qt(),L0=class n{static{a(this,"QuotedTriple")}constructor(e,t,r){this._subject=e,this._predicate=t,this._object=r}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}equals(e){return!(!this.equalsNode(this._subject,e._subject)||!this._predicate.equals(e._predicate)||!this.equalsNode(this._object,e._object))}equalsNode(e,t){return e instanceof F0.IRI&&t instanceof F0.IRI||e instanceof N0.BlankNode&&t instanceof N0.BlankNode||e instanceof D0.Literal&&t instanceof D0.Literal||e instanceof n&&t instanceof n?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,r=this.nodeToString(this._object);return`<< ${e} ${t} ${r} >>`}nodeToString(e){return e instanceof F0.IRI?`<${e.value}>`:e instanceof N0.BlankNode||e instanceof D0.Literal||e instanceof n?e.toString():""}};gh.QuotedTriple=L0});var P2=S(tr=>{"use strict";Object.defineProperty(tr,"__esModule",{value:!0});tr.QuotedTriple=tr.Triple=tr.Namespace=tr.BlankNode=tr.createLiteralFromLanguageTag=tr.createDirectionalLiteral=tr.parseLanguageTag=tr.Literal=tr.IRI=void 0;var ik=Ae();Object.defineProperty(tr,"IRI",{enumerable:!0,get:a(function(){return ik.IRI},"get")});var yh=Ne();Object.defineProperty(tr,"Literal",{enumerable:!0,get:a(function(){return yh.Literal},"get")});Object.defineProperty(tr,"parseLanguageTag",{enumerable:!0,get:a(function(){return yh.parseLanguageTag},"get")});Object.defineProperty(tr,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return yh.createDirectionalLiteral},"get")});Object.defineProperty(tr,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return yh.createLiteralFromLanguageTag},"get")});var sk=qt();Object.defineProperty(tr,"BlankNode",{enumerable:!0,get:a(function(){return sk.BlankNode},"get")});var ok=lr();Object.defineProperty(tr,"Namespace",{enumerable:!0,get:a(function(){return ok.Namespace},"get")});var ak=Yn();Object.defineProperty(tr,"Triple",{enumerable:!0,get:a(function(){return ak.Triple},"get")});var ck=ku();Object.defineProperty(tr,"QuotedTriple",{enumerable:!0,get:a(function(){return ck.QuotedTriple},"get")})});var _h=S(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.UUID_URL_NAMESPACE=Jn.DEFAULT_LANGUAGE_TAG=Jn.REQUIRED_PROPERTIES=Jn.ALLOWED_PROPERTIES=Jn.Exo003MetadataType=void 0;var Xn;(function(n){n.Namespace="namespace",n.Anchor="anchor",n.BlankNode="blank_node",n.Statement="statement",n.Body="body"})(Xn||(Jn.Exo003MetadataType=Xn={}));Jn.ALLOWED_PROPERTIES={[Xn.Namespace]:["metadata","uri","aliases"],[Xn.Anchor]:["metadata","uri","aliases"],[Xn.BlankNode]:["metadata","uri","aliases"],[Xn.Statement]:["metadata","subject","predicate","object","aliases"],[Xn.Body]:["metadata","subject","predicate","aliases"]};Jn.REQUIRED_PROPERTIES={[Xn.Namespace]:["metadata","uri"],[Xn.Anchor]:["metadata","uri"],[Xn.BlankNode]:["metadata","uri"],[Xn.Statement]:["metadata","subject","predicate","object"],[Xn.Body]:["metadata","subject","predicate"]};Jn.DEFAULT_LANGUAGE_TAG="ru";Jn.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var O2=S(k0=>{"use strict";Object.defineProperty(k0,"__esModule",{value:!0});k0.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var F2=S(M0=>{"use strict";Object.defineProperty(M0,"__esModule",{value:!0});M0.default="00000000-0000-0000-0000-000000000000"});var D2=S(j0=>{"use strict";Object.defineProperty(j0,"__esModule",{value:!0});j0.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});var Mu=S($0=>{"use strict";Object.defineProperty($0,"__esModule",{value:!0});var lk=D2();function uk(n){return typeof n=="string"&&lk.default.test(n)}a(uk,"validate");$0.default=uk});var ju=S(B0=>{"use strict";Object.defineProperty(B0,"__esModule",{value:!0});var fk=Mu();function dk(n){if(!(0,fk.default)(n))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(n.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(n.slice(9,13),16))>>>8,e&255,(e=parseInt(n.slice(14,18),16))>>>8,e&255,(e=parseInt(n.slice(19,23),16))>>>8,e&255,(e=parseInt(n.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}a(dk,"parse");B0.default=dk});var Ws=S($u=>{"use strict";Object.defineProperty($u,"__esModule",{value:!0});$u.unsafeStringify=void 0;var hk=Mu(),Nr=[];for(let n=0;n<256;++n)Nr.push((n+256).toString(16).slice(1));function N2(n,e=0){return(Nr[n[e+0]]+Nr[n[e+1]]+Nr[n[e+2]]+Nr[n[e+3]]+"-"+Nr[n[e+4]]+Nr[n[e+5]]+"-"+Nr[n[e+6]]+Nr[n[e+7]]+"-"+Nr[n[e+8]]+Nr[n[e+9]]+"-"+Nr[n[e+10]]+Nr[n[e+11]]+Nr[n[e+12]]+Nr[n[e+13]]+Nr[n[e+14]]+Nr[n[e+15]]).toLowerCase()}a(N2,"unsafeStringify");$u.unsafeStringify=N2;function pk(n,e=0){let t=N2(n,e);if(!(0,hk.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(pk,"stringify");$u.default=pk});var bh=S(U0=>{"use strict";Object.defineProperty(U0,"__esModule",{value:!0});var mk=require("crypto"),vh=new Uint8Array(256),Sh=vh.length;function gk(){return Sh>vh.length-16&&((0,mk.randomFillSync)(vh),Sh=0),vh.slice(Sh,Sh+=16)}a(gk,"rng");U0.default=gk});var V0=S(Uu=>{"use strict";Object.defineProperty(Uu,"__esModule",{value:!0});Uu.updateV1State=void 0;var L2=bh(),yk=Ws(),Bu={};function _k(n,e,t){let r,i=n?._v6??!1;if(n){let s=Object.keys(n);s.length===1&&s[0]==="_v6"&&(n=void 0)}if(n)r=k2(n.random??n.rng?.()??(0,L2.default)(),n.msecs,n.nsecs,n.clockseq,n.node,e,t);else{let s=Date.now(),o=(0,L2.default)();M2(Bu,s,o),r=k2(o,Bu.msecs,Bu.nsecs,i?void 0:Bu.clockseq,i?void 0:Bu.node,e,t)}return e??(0,yk.unsafeStringify)(r)}a(_k,"v1");function M2(n,e,t){return n.msecs??=-1/0,n.nsecs??=0,e===n.msecs?(n.nsecs++,n.nsecs>=1e4&&(n.node=void 0,n.nsecs=0)):e>n.msecs?n.nsecs=0:e<n.msecs&&(n.node=void 0),n.node||(n.node=t.slice(10,16),n.node[0]|=1,n.clockseq=(t[8]<<8|t[9])&16383),n.msecs=e,n}a(M2,"updateV1State");Uu.updateV1State=M2;function k2(n,e,t,r,i,s,o=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!s)s=new Uint8Array(16),o=0;else if(o<0||o+16>s.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`);e??=Date.now(),t??=0,r??=(n[8]<<8|n[9])&16383,i??=n.slice(10,16),e+=122192928e5;let c=((e&268435455)*1e4+t)%4294967296;s[o++]=c>>>24&255,s[o++]=c>>>16&255,s[o++]=c>>>8&255,s[o++]=c&255;let l=e/4294967296*1e4&268435455;s[o++]=l>>>8&255,s[o++]=l&255,s[o++]=l>>>24&15|16,s[o++]=l>>>16&255,s[o++]=r>>>8|128,s[o++]=r&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(k2,"v1Bytes");Uu.default=_k});var W0=S(q0=>{"use strict";Object.defineProperty(q0,"__esModule",{value:!0});var Sk=ju(),vk=Ws();function bk(n){let e=typeof n=="string"?(0,Sk.default)(n):n,t=wk(e);return typeof n=="string"?(0,vk.unsafeStringify)(t):t}a(bk,"v1ToV6");q0.default=bk;function wk(n){return Uint8Array.of((n[6]&15)<<4|n[7]>>4&15,(n[7]&15)<<4|(n[4]&240)>>4,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,(n[1]&15)<<4|(n[2]&240)>>4,96|n[2]&15,n[3],n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}a(wk,"_v1ToV6")});var j2=S(G0=>{"use strict";Object.defineProperty(G0,"__esModule",{value:!0});var Ek=require("crypto");function Tk(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,Ek.createHash)("md5").update(n).digest()}a(Tk,"md5");G0.default=Tk});var Vu=S(Gs=>{"use strict";Object.defineProperty(Gs,"__esModule",{value:!0});Gs.URL=Gs.DNS=Gs.stringToBytes=void 0;var $2=ju(),Ak=Ws();function B2(n){n=unescape(encodeURIComponent(n));let e=new Uint8Array(n.length);for(let t=0;t<n.length;++t)e[t]=n.charCodeAt(t);return e}a(B2,"stringToBytes");Gs.stringToBytes=B2;Gs.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";Gs.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function xk(n,e,t,r,i,s){let o=typeof t=="string"?B2(t):t,c=typeof r=="string"?(0,$2.default)(r):r;if(typeof r=="string"&&(r=(0,$2.default)(r)),r?.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let l=new Uint8Array(16+o.length);if(l.set(c),l.set(o,c.length),l=e(l),l[6]=l[6]&15|n,l[8]=l[8]&63|128,i){s=s||0;for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,Ak.unsafeStringify)(l)}a(xk,"v35");Gs.default=xk});var V2=S(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.URL=wa.DNS=void 0;var Ck=j2(),z0=Vu(),U2=Vu();Object.defineProperty(wa,"DNS",{enumerable:!0,get:a(function(){return U2.DNS},"get")});Object.defineProperty(wa,"URL",{enumerable:!0,get:a(function(){return U2.URL},"get")});function H0(n,e,t,r){return(0,z0.default)(48,Ck.default,n,e,t,r)}a(H0,"v3");H0.DNS=z0.DNS;H0.URL=z0.URL;wa.default=H0});var q2=S(Q0=>{"use strict";Object.defineProperty(Q0,"__esModule",{value:!0});var Rk=require("crypto");Q0.default={randomUUID:Rk.randomUUID}});var G2=S(K0=>{"use strict";Object.defineProperty(K0,"__esModule",{value:!0});var W2=q2(),Ik=bh(),Pk=Ws();function Ok(n,e,t){if(W2.default.randomUUID&&!e&&!n)return W2.default.randomUUID();n=n||{};let r=n.random??n.rng?.()??(0,Ik.default)();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return(0,Pk.unsafeStringify)(r)}a(Ok,"v4");K0.default=Ok});var z2=S(Y0=>{"use strict";Object.defineProperty(Y0,"__esModule",{value:!0});var Fk=require("crypto");function Dk(n){return Array.isArray(n)?n=Buffer.from(n):typeof n=="string"&&(n=Buffer.from(n,"utf8")),(0,Fk.createHash)("sha1").update(n).digest()}a(Dk,"sha1");Y0.default=Dk});var Q2=S(Ea=>{"use strict";Object.defineProperty(Ea,"__esModule",{value:!0});Ea.URL=Ea.DNS=void 0;var Nk=z2(),X0=Vu(),H2=Vu();Object.defineProperty(Ea,"DNS",{enumerable:!0,get:a(function(){return H2.DNS},"get")});Object.defineProperty(Ea,"URL",{enumerable:!0,get:a(function(){return H2.URL},"get")});function J0(n,e,t,r){return(0,X0.default)(80,Nk.default,n,e,t,r)}a(J0,"v5");J0.DNS=X0.DNS;J0.URL=X0.URL;Ea.default=J0});var K2=S(Z0=>{"use strict";Object.defineProperty(Z0,"__esModule",{value:!0});var Lk=Ws(),kk=V0(),Mk=W0();function jk(n,e,t){n??={},t??=0;let r=(0,kk.default)({...n,_v6:!0},new Uint8Array(16));if(r=(0,Mk.default)(r),e){for(let i=0;i<16;i++)e[t+i]=r[i];return e}return(0,Lk.unsafeStringify)(r)}a(jk,"v6");Z0.default=jk});var Y2=S(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});var $k=ju(),Bk=Ws();function Uk(n){let e=typeof n=="string"?(0,$k.default)(n):n,t=Vk(e);return typeof n=="string"?(0,Bk.unsafeStringify)(t):t}a(Uk,"v6ToV1");e_.default=Uk;function Vk(n){return Uint8Array.of((n[3]&15)<<4|n[4]>>4&15,(n[4]&15)<<4|(n[5]&240)>>4,(n[5]&15)<<4|n[6]&15,n[7],(n[1]&15)<<4|(n[2]&240)>>4,(n[2]&15)<<4|(n[3]&240)>>4,16|(n[0]&240)>>4,(n[0]&15)<<4|(n[1]&240)>>4,n[8],n[9],n[10],n[11],n[12],n[13],n[14],n[15])}a(Vk,"_v6ToV1")});var eA=S(qu=>{"use strict";Object.defineProperty(qu,"__esModule",{value:!0});qu.updateV7State=void 0;var X2=bh(),qk=Ws(),t_={};function Wk(n,e,t){let r;if(n)r=J2(n.random??n.rng?.()??(0,X2.default)(),n.msecs,n.seq,e,t);else{let i=Date.now(),s=(0,X2.default)();Z2(t_,i,s),r=J2(s,t_.msecs,t_.seq,e,t)}return e??(0,qk.unsafeStringify)(r)}a(Wk,"v7");function Z2(n,e,t){return n.msecs??=-1/0,n.seq??=0,e>n.msecs?(n.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],n.msecs=e):(n.seq=n.seq+1|0,n.seq===0&&n.msecs++),n}a(Z2,"updateV7State");qu.updateV7State=Z2;function J2(n,e,t,r,i=0){if(n.length<16)throw new Error("Random bytes length must be >= 16");if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=n[6]*127<<24|n[7]<<16|n[8]<<8|n[9],r[i++]=e/1099511627776&255,r[i++]=e/4294967296&255,r[i++]=e/16777216&255,r[i++]=e/65536&255,r[i++]=e/256&255,r[i++]=e&255,r[i++]=112|t>>>28&15,r[i++]=t>>>20&255,r[i++]=128|t>>>14&63,r[i++]=t>>>6&255,r[i++]=t<<2&255|n[10]&3,r[i++]=n[11],r[i++]=n[12],r[i++]=n[13],r[i++]=n[14],r[i++]=n[15],r}a(J2,"v7Bytes");qu.default=Wk});var tA=S(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});var Gk=Mu();function zk(n){if(!(0,Gk.default)(n))throw TypeError("Invalid UUID");return parseInt(n.slice(14,15),16)}a(zk,"version");r_.default=zk});var An=S(lt=>{"use strict";Object.defineProperty(lt,"__esModule",{value:!0});lt.version=lt.validate=lt.v7=lt.v6ToV1=lt.v6=lt.v5=lt.v4=lt.v3=lt.v1ToV6=lt.v1=lt.stringify=lt.parse=lt.NIL=lt.MAX=void 0;var Hk=O2();Object.defineProperty(lt,"MAX",{enumerable:!0,get:a(function(){return Hk.default},"get")});var Qk=F2();Object.defineProperty(lt,"NIL",{enumerable:!0,get:a(function(){return Qk.default},"get")});var Kk=ju();Object.defineProperty(lt,"parse",{enumerable:!0,get:a(function(){return Kk.default},"get")});var Yk=Ws();Object.defineProperty(lt,"stringify",{enumerable:!0,get:a(function(){return Yk.default},"get")});var Xk=V0();Object.defineProperty(lt,"v1",{enumerable:!0,get:a(function(){return Xk.default},"get")});var Jk=W0();Object.defineProperty(lt,"v1ToV6",{enumerable:!0,get:a(function(){return Jk.default},"get")});var Zk=V2();Object.defineProperty(lt,"v3",{enumerable:!0,get:a(function(){return Zk.default},"get")});var eM=G2();Object.defineProperty(lt,"v4",{enumerable:!0,get:a(function(){return eM.default},"get")});var tM=Q2();Object.defineProperty(lt,"v5",{enumerable:!0,get:a(function(){return tM.default},"get")});var rM=K2();Object.defineProperty(lt,"v6",{enumerable:!0,get:a(function(){return rM.default},"get")});var nM=Y2();Object.defineProperty(lt,"v6ToV1",{enumerable:!0,get:a(function(){return nM.default},"get")});var iM=eA();Object.defineProperty(lt,"v7",{enumerable:!0,get:a(function(){return iM.default},"get")});var sM=Mu();Object.defineProperty(lt,"validate",{enumerable:!0,get:a(function(){return sM.default},"get")});var oM=tA();Object.defineProperty(lt,"version",{enumerable:!0,get:a(function(){return oM.default},"get")})});var s_=S(wh=>{"use strict";Object.defineProperty(wh,"__esModule",{value:!0});wh.Exo003UUIDGenerator=void 0;var n_=An(),rA=_h(),i_=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,n_.v5)(e,rA.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let r=this.generateNamespaceUUID(e);return(0,n_.v5)(t,r)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:r}=this.splitIRI(e);return r?this.generateAssetUUID(t,r):(0,n_.v5)(e,rA.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let r="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(r,i)}static generateStatementUUID(e,t,r){if(!e||!t||!r)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${r}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let r="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(r,i)}static splitIRI(e){let t=e.lastIndexOf("#");if(t!==-1&&t<e.length-1)return{namespace:e.substring(0,t+1),localName:e.substring(t+1)};let r=e.lastIndexOf("/"),i=e.indexOf("://");return r!==-1&&r>i+2&&r<e.length-1?{namespace:e.substring(0,r+1),localName:e.substring(r+1)}:{namespace:e,localName:""}}static isValidUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};wh.Exo003UUIDGenerator=i_});var iA=S(Th=>{"use strict";Object.defineProperty(Th,"__esModule",{value:!0});Th.Exo003Parser=void 0;var gt=_h(),Wu=s_(),Ro=Ae(),Eh=Ne(),nA=qt(),aM=Yn(),o_=class{static{a(this,"Exo003Parser")}static parse(e,t){let r=this.validate(e);if(!r.valid)return{success:!1,errors:r.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===gt.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],r=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:r};let i=e.metadata;if(!Object.values(gt.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(gt.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:r};let s=i,o=gt.ALLOWED_PROPERTIES[s],c=gt.REQUIRED_PROPERTIES[s];for(let l of c)(e[l]===void 0||e[l]===null)&&t.push(`Missing required property: ${l}`);for(let l of Object.keys(e))o.includes(l)||t.push(`Forbidden property for ${s}: ${l}`);switch(s){case gt.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case gt.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case gt.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case gt.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case gt.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,r);break}return{valid:t.length===0,errors:t,warnings:r}}static parseByType(e,t){let r={metadata:t,aliases:e.aliases};switch(t){case gt.Exo003MetadataType.Namespace:return{...r,metadata:gt.Exo003MetadataType.Namespace,uri:e.uri};case gt.Exo003MetadataType.Anchor:return{...r,metadata:gt.Exo003MetadataType.Anchor,uri:e.uri};case gt.Exo003MetadataType.BlankNode:return{...r,metadata:gt.Exo003MetadataType.BlankNode,uri:e.uri};case gt.Exo003MetadataType.Statement:return{...r,metadata:gt.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case gt.Exo003MetadataType.Body:return{...r,metadata:gt.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new Ro.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateAnchorMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r)try{new Ro.IRI(r)}catch{t.push(`uri is not a valid IRI: ${String(r)}`)}}static validateBlankNodeMetadata(e,t){let r=e.uri;if(r&&typeof r!="string")t.push("uri must be a string");else if(r){let i=r;if(!i.startsWith("_:"))try{new Ro.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(r)}`)}}}static validateStatementMetadata(e,t){let r=e.subject,i=e.predicate,s=e.object,o=[["subject",r],["predicate",i],["object",s]];for(let[c,l]of o)l&&typeof l!="string"&&t.push(`${c} must be a string`)}static validateBodyMetadata(e,t,r){let i=e.subject,s=e.predicate;i&&typeof i!="string"&&t.push("subject must be a string"),s&&typeof s!="string"&&t.push("predicate must be a string")}static toTriple(e,t,r){let i=t(e.subject),s;if(i.type==="iri")s=new Ro.IRI(i.value);else if(i.type==="blank")s=new nA.BlankNode(i.value);else throw new Error("Statement subject cannot be a literal");let o=t(e.predicate);if(o.type!=="iri")throw new Error("Statement predicate must be an IRI");let c=new Ro.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new Ro.IRI(l.value);else if(l.type==="blank")u=new nA.BlankNode(l.value);else{let f=r||l.value;if(l.datatype)u=new Eh.Literal(f,new Ro.IRI(l.datatype));else{let d=l.language||gt.DEFAULT_LANGUAGE_TAG;u=(0,Eh.createDirectionalLiteral)(f,d,l.direction)}}return new aM.Triple(s,c,u)}static toLiteral(e,t,r){if(r?.datatype)return new Eh.Literal(t,new Ro.IRI(r.datatype));let i=r?.language||gt.DEFAULT_LANGUAGE_TAG;return(0,Eh.createDirectionalLiteral)(t,i,r?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(gt.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case gt.Exo003MetadataType.Namespace:return Wu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case gt.Exo003MetadataType.Anchor:return Wu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case gt.Exo003MetadataType.BlankNode:return Wu.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case gt.Exo003MetadataType.Statement:{let r=e;return Wu.Exo003UUIDGenerator.generateStatementUUID(r.subject,r.predicate,r.object)}case gt.Exo003MetadataType.Body:{let r=e;return Wu.Exo003UUIDGenerator.generateBodyUUID(r.subject+"|"+r.predicate)}}}};Th.Exo003Parser=o_});var a_=S(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.Exo003Parser=Wr.Exo003UUIDGenerator=Wr.UUID_URL_NAMESPACE=Wr.DEFAULT_LANGUAGE_TAG=Wr.REQUIRED_PROPERTIES=Wr.ALLOWED_PROPERTIES=Wr.Exo003MetadataType=void 0;var Gu=_h();Object.defineProperty(Wr,"Exo003MetadataType",{enumerable:!0,get:a(function(){return Gu.Exo003MetadataType},"get")});Object.defineProperty(Wr,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return Gu.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Wr,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return Gu.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Wr,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return Gu.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Wr,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return Gu.UUID_URL_NAMESPACE},"get")});var cM=s_();Object.defineProperty(Wr,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return cM.Exo003UUIDGenerator},"get")});var lM=iA();Object.defineProperty(Wr,"Exo003Parser",{enumerable:!0,get:a(function(){return lM.Exo003Parser},"get")})});var zs=S(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.WikiLinkHelpers=void 0;var zu=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let r=t.indexOf("|");if(r===-1)return t;let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();return this.UUID_PATTERN.test(i)&&s||i}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(r=>this.normalize(r)).filter(r=>r.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let r=this.normalizeArray(e),i=this.normalize(t);return r.includes(i)}};Ah.WikiLinkHelpers=zu;zu.WIKI_LINK_PATTERN=/\[\[|\]\]/g;zu.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var jn=S(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.CommandBindingProperty=rt.GroundingProperty=rt.PreconditionProperty=rt.CommandProperty=rt.GroundingType=rt.getEffortStatusLabel=rt.isTrashedStatus=rt.isDoneStatus=rt.normalizeEffortStatus=rt.EFFORT_STATUS_OPTIONS=rt.STATUS_NAME_TO_WIKILINK=rt.STATUS_NAME_TO_ENUM=rt.EFFORT_STATUS_CONFIG=rt.EffortStatus=rt.AssetClass=void 0;var uM=Nu();Object.defineProperty(rt,"AssetClass",{enumerable:!0,get:a(function(){return uM.AssetClass},"get")});var fM=Tc();Object.defineProperty(rt,"EffortStatus",{enumerable:!0,get:a(function(){return fM.EffortStatus},"get")});var Io=w0();Object.defineProperty(rt,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:a(function(){return Io.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(rt,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:a(function(){return Io.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(rt,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:a(function(){return Io.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(rt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Io.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(rt,"normalizeEffortStatus",{enumerable:!0,get:a(function(){return Io.normalizeEffortStatus},"get")});Object.defineProperty(rt,"isDoneStatus",{enumerable:!0,get:a(function(){return Io.isDoneStatus},"get")});Object.defineProperty(rt,"isTrashedStatus",{enumerable:!0,get:a(function(){return Io.isTrashedStatus},"get")});Object.defineProperty(rt,"getEffortStatusLabel",{enumerable:!0,get:a(function(){return Io.getEffortStatusLabel},"get")});var dM=Ac();Object.defineProperty(rt,"GroundingType",{enumerable:!0,get:a(function(){return dM.GroundingType},"get")});var xh=E0();Object.defineProperty(rt,"CommandProperty",{enumerable:!0,get:a(function(){return xh.CommandProperty},"get")});Object.defineProperty(rt,"PreconditionProperty",{enumerable:!0,get:a(function(){return xh.PreconditionProperty},"get")});Object.defineProperty(rt,"GroundingProperty",{enumerable:!0,get:a(function(){return xh.GroundingProperty},"get")});Object.defineProperty(rt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return xh.CommandBindingProperty},"get")})});var xa=S(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.hasClass=Aa;Gr.isAreaOrProject=hM;Gr.isEffort=pM;Gr.hasStatus=mM;Gr.isAssetArchived=gM;Gr.hasEmptyProperties=yM;Gr.needsFolderRepair=_M;Gr.getTodayDateString=c_;Gr.isPlannedForToday=SM;Gr.hasPlannedStartTimestamp=vM;Gr.extractDailyNoteDate=bM;Gr.isCurrentDateGteDay=wM;Gr.inheritsFromPrototype=aA;Gr.isPrototypeClass=TM;var oA=zs(),Ta=jn();function Aa(n,e){return n?(Array.isArray(n)?n:[n]).some(r=>oA.WikiLinkHelpers.normalize(r)===e):!1}a(Aa,"hasClass");function hM(n){return Aa(n,Ta.AssetClass.AREA)||Aa(n,Ta.AssetClass.PROJECT)}a(hM,"isAreaOrProject");function pM(n){return Aa(n,Ta.AssetClass.TASK)||Aa(n,Ta.AssetClass.PROJECT)||Aa(n,Ta.AssetClass.MEETING)}a(pM,"isEffort");function mM(n,e){if(!n)return!1;let t=Array.isArray(n)?n[0]:n;return t?oA.WikiLinkHelpers.normalize(t)===e:!1}a(mM,"hasStatus");function gM(n){if(n===!0||n===1)return!0;if(typeof n=="string"){let e=n.toLowerCase();return e==="true"||e==="yes"}return!1}a(gM,"isAssetArchived");function yM(n){return!n||Object.keys(n).length===0?!1:Object.values(n).some(e=>!!(e==null||typeof e=="string"&&e.trim()===""||Array.isArray(e)&&e.length===0||typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0))}a(yM,"hasEmptyProperties");function _M(n,e){if(!e)return!1;let t=n.replace(/\/$/,""),r=e.replace(/\/$/,"");return t!==r}a(_M,"needsFolderRepair");function c_(){let n=new Date,e=n.getFullYear(),t=String(n.getMonth()+1).padStart(2,"0"),r=String(n.getDate()).padStart(2,"0");return`${e}-${t}-${r}`}a(c_,"getTodayDateString");function SM(n){let e=n.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=c_();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(SM,"isPlannedForToday");function vM(n){let e=n.ems__Effort_plannedStartTimestamp;return e?typeof e=="string"?e.trim().length>0:Array.isArray(e)&&e.length>0?String(e[0]).trim().length>0:!1:!1}a(vM,"hasPlannedStartTimestamp");function bM(n){let e=n.pn__DailyNote_day;if(!e)return null;if(typeof e=="string"){let t=e.match(/\[\[([^\[\]]+)\]\]/);return t?t[1]:e}if(Array.isArray(e)&&e.length>0){let t=String(e[0]),r=t.match(/\[\[([^\[\]]+)\]\]/);return r?r[1]:t}return null}a(bM,"extractDailyNoteDate");function wM(n){return c_()>=n}a(wM,"isCurrentDateGteDay");function sA(n){return n?n.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(sA,"normalizeWithQuotes");var EM=10;function aA(n,e=EM){let t=n.exo__Class_superClass;if(!t)return!1;let r=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=sA(o);c&&i.push({className:c,depth:0})}for(;i.length>0;){let o=i.shift();if(!o)continue;let{className:c,depth:l}=o;if(l>e)continue;if(c===Ta.AssetClass.PROTOTYPE)return!0;if(r.has(c))continue;r.add(c);let u=`${c}__exo__Class_superClass`,f=n[u];if(f){let d=Array.isArray(f)?f:[f];for(let h of d){let p=sA(h);p&&!r.has(p)&&i.push({className:p,depth:l+1})}}}return!1}a(aA,"inheritsFromPrototype");function TM(n,e){return Aa(n,Ta.AssetClass.CLASS)?aA(e):!1}a(TM,"isPrototypeClass")});var cA=S(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.canCreateTask=AM;Rc.canCreateRelatedTask=xM;Rc.canConvertTaskToProject=CM;Rc.canSetCriticalityZone=RM;var Cc=xa(),l_=jn();function AM(n){return(0,Cc.isAreaOrProject)(n.instanceClass)}a(AM,"canCreateTask");function xM(n){return!(!(0,Cc.hasClass)(n.instanceClass,l_.AssetClass.TASK)||(0,Cc.isAssetArchived)(n.isArchived))}a(xM,"canCreateRelatedTask");function CM(n){return(0,Cc.hasClass)(n.instanceClass,l_.AssetClass.TASK)}a(CM,"canConvertTaskToProject");function RM(n){return!(!(0,Cc.hasClass)(n.instanceClass,l_.AssetClass.TASK)||(0,Cc.isAssetArchived)(n.isArchived))}a(RM,"canSetCriticalityZone")});var lA=S(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.canCreateProject=IM;Ic.canMoveToAnalysis=PM;Ic.canMoveToToDo=OM;Ic.canConvertProjectToTask=FM;var Po=xa(),Oo=jn();function IM(n){return(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.AREA)||(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.INITIATIVE)||(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.PROJECT)}a(IM,"canCreateProject");function PM(n){return(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.PROJECT)?(0,Po.hasStatus)(n.currentStatus,Oo.EffortStatus.BACKLOG):!1}a(PM,"canMoveToAnalysis");function OM(n){return(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.PROJECT)?(0,Po.hasStatus)(n.currentStatus,Oo.EffortStatus.ANALYSIS):!1}a(OM,"canMoveToToDo");function FM(n){return(0,Po.hasClass)(n.instanceClass,Oo.AssetClass.PROJECT)}a(FM,"canConvertProjectToTask")});var dA=S(Ch=>{"use strict";Object.defineProperty(Ch,"__esModule",{value:!0});Ch.canCreateChildArea=DM;Ch.canSetActiveFocus=NM;var uA=xa(),fA=jn();function DM(n){return(0,uA.hasClass)(n.instanceClass,fA.AssetClass.AREA)}a(DM,"canCreateChildArea");function NM(n){return(0,uA.hasClass)(n.instanceClass,fA.AssetClass.AREA)}a(NM,"canSetActiveFocus")});var pA=S(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.canPlanOnToday=LM;un.canPlanForEvening=kM;un.canShiftDayBackward=MM;un.canShiftDayForward=jM;un.canSetDraftStatus=$M;un.canMoveToBacklog=BM;un.canStartEffort=UM;un.canMarkDone=VM;un.canTrashEffort=qM;un.canVoteOnEffort=WM;un.canRollbackStatus=GM;un.canArchiveTask=zM;un.canMarkReviewed=HM;var hA=zs(),ht=xa(),ln=jn();function LM(n){return!(!(0,ht.isEffort)(n.instanceClass)||(0,ht.isPlannedForToday)(n.metadata))}a(LM,"canPlanOnToday");function kM(n){return!(0,ht.hasClass)(n.instanceClass,ln.AssetClass.TASK)&&!(0,ht.hasClass)(n.instanceClass,ln.AssetClass.MEETING)?!1:(0,ht.hasStatus)(n.currentStatus,ln.EffortStatus.BACKLOG)}a(kM,"canPlanForEvening");function MM(n){return(0,ht.isEffort)(n.instanceClass)?(0,ht.hasPlannedStartTimestamp)(n.metadata):!1}a(MM,"canShiftDayBackward");function jM(n){return(0,ht.isEffort)(n.instanceClass)?(0,ht.hasPlannedStartTimestamp)(n.metadata):!1}a(jM,"canShiftDayForward");function $M(n){return(0,ht.isEffort)(n.instanceClass)?!n.currentStatus:!1}a($M,"canSetDraftStatus");function BM(n){return(0,ht.isEffort)(n.instanceClass)?(0,ht.hasStatus)(n.currentStatus,ln.EffortStatus.DRAFT):!1}a(BM,"canMoveToBacklog");function UM(n){return(0,ht.isEffort)(n.instanceClass)?(0,ht.hasClass)(n.instanceClass,ln.AssetClass.TASK)||(0,ht.hasClass)(n.instanceClass,ln.AssetClass.MEETING)?(0,ht.hasStatus)(n.currentStatus,ln.EffortStatus.BACKLOG):(0,ht.hasClass)(n.instanceClass,ln.AssetClass.PROJECT)?(0,ht.hasStatus)(n.currentStatus,ln.EffortStatus.TODO):!1:!1}a(UM,"canStartEffort");function VM(n){return(0,ht.isEffort)(n.instanceClass)?(0,ht.hasStatus)(n.currentStatus,ln.EffortStatus.DOING):!1}a(VM,"canMarkDone");function qM(n){return(0,ht.isEffort)(n.instanceClass)?n.currentStatus?!(Array.isArray(n.currentStatus)?n.currentStatus:[n.currentStatus]).some(r=>{let i=hA.WikiLinkHelpers.normalize(r);return i===ln.EffortStatus.TRASHED||i===ln.EffortStatus.DONE}):!0:!1}a(qM,"canTrashEffort");function WM(n){return!(!(0,ht.isEffort)(n.instanceClass)||(0,ht.isAssetArchived)(n.isArchived))}a(WM,"canVoteOnEffort");function GM(n){if(!(0,ht.isEffort)(n.instanceClass)||(0,ht.isAssetArchived)(n.isArchived)||!n.currentStatus)return!1;let e=Array.isArray(n.currentStatus)?n.currentStatus[0]:n.currentStatus;return!(!e||hA.WikiLinkHelpers.normalize(e)===ln.EffortStatus.TRASHED)}a(GM,"canRollbackStatus");function zM(n){return!(0,ht.isAssetArchived)(n.isArchived)}a(zM,"canArchiveTask");function HM(n){return!(!(0,ht.hasClass)(n.instanceClass,ln.AssetClass.TASK)&&!(0,ht.hasClass)(n.instanceClass,ln.AssetClass.PROJECT)||(0,ht.isAssetArchived)(n.isArchived))}a(HM,"canMarkReviewed")});var mA=S(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.canCreateEvent=YM;Zn.canCreateInstance=XM;Zn.canCleanProperties=JM;Zn.canRepairFolder=ZM;Zn.canRenameToUid=e4;Zn.canCopyLabelToAliases=t4;Zn.canCreateNarrowerConcept=r4;Zn.canCreateSubclass=n4;Zn.canCreateTaskForDailyNote=i4;Zn.canCopyFleetingNoteLabel=s4;var zr=xa(),Hs=jn(),QM="75302770-279e-4a59-ba85-09df29725713",KM="fca0a931-a01f-48e4-b72a-4af206c94bc7";function YM(n){return(0,zr.isAreaOrProject)(n.instanceClass)}a(YM,"canCreateEvent");function XM(n){return(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.TASK_PROTOTYPE)||(0,zr.hasClass)(n.instanceClass,QM)||(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.MEETING_PROTOTYPE)||(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.EVENT_PROTOTYPE)||(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.PROJECT_PROTOTYPE)||(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.PROTOTYPE)||n.classIsPrototype?!0:(0,zr.isPrototypeClass)(n.instanceClass,n.metadata)}a(XM,"canCreateInstance");function JM(n){return(0,zr.hasEmptyProperties)(n.metadata)}a(JM,"canCleanProperties");function ZM(n){return(0,zr.needsFolderRepair)(n.currentFolder,n.expectedFolder)}a(ZM,"canRepairFolder");function e4(n,e){let t=n.metadata.exo__Asset_uid;return t?e!==t:!1}a(e4,"canRenameToUid");function t4(n){let e=n.metadata.exo__Asset_label;if(!e||typeof e!="string"||e.trim()==="")return!1;let t=e.trim(),r=n.metadata.aliases;return!r||!Array.isArray(r)||r.length===0?!0:!r.some(i=>typeof i!="string"?!1:i.trim()===t)}a(t4,"canCopyLabelToAliases");function r4(n){return(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.CONCEPT)}a(r4,"canCreateNarrowerConcept");function n4(n){return(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.CLASS)}a(n4,"canCreateSubclass");function i4(n){return!(!(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.DAILY_NOTE)||n.isArchived||!(0,zr.extractDailyNoteDate)(n.metadata))}a(i4,"canCreateTaskForDailyNote");function s4(n){return(0,zr.hasClass)(n.instanceClass,Hs.AssetClass.FLEETING_NOTE)||(0,zr.hasClass)(n.instanceClass,KM)}a(s4,"canCopyFleetingNoteLabel")});var yA=S(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.canCopyFleetingNoteLabel=L.canCreateTaskForDailyNote=L.canCreateSubclass=L.canCreateNarrowerConcept=L.canCopyLabelToAliases=L.canRenameToUid=L.canRepairFolder=L.canCleanProperties=L.canCreateInstance=L.canCreateEvent=L.canMarkReviewed=L.canArchiveTask=L.canRollbackStatus=L.canVoteOnEffort=L.canTrashEffort=L.canMarkDone=L.canStartEffort=L.canMoveToBacklog=L.canSetDraftStatus=L.canShiftDayForward=L.canShiftDayBackward=L.canPlanForEvening=L.canPlanOnToday=L.canSetActiveFocus=L.canCreateChildArea=L.canConvertProjectToTask=L.canMoveToToDo=L.canMoveToAnalysis=L.canCreateProject=L.canSetCriticalityZone=L.canConvertTaskToProject=L.canCreateRelatedTask=L.canCreateTask=L.isPrototypeClass=L.inheritsFromPrototype=L.isCurrentDateGteDay=L.extractDailyNoteDate=L.hasPlannedStartTimestamp=L.isPlannedForToday=L.getTodayDateString=L.needsFolderRepair=L.hasEmptyProperties=L.isAssetArchived=L.hasStatus=L.isEffort=L.isAreaOrProject=L.hasClass=void 0;var xn=xa();Object.defineProperty(L,"hasClass",{enumerable:!0,get:a(function(){return xn.hasClass},"get")});Object.defineProperty(L,"isAreaOrProject",{enumerable:!0,get:a(function(){return xn.isAreaOrProject},"get")});Object.defineProperty(L,"isEffort",{enumerable:!0,get:a(function(){return xn.isEffort},"get")});Object.defineProperty(L,"hasStatus",{enumerable:!0,get:a(function(){return xn.hasStatus},"get")});Object.defineProperty(L,"isAssetArchived",{enumerable:!0,get:a(function(){return xn.isAssetArchived},"get")});Object.defineProperty(L,"hasEmptyProperties",{enumerable:!0,get:a(function(){return xn.hasEmptyProperties},"get")});Object.defineProperty(L,"needsFolderRepair",{enumerable:!0,get:a(function(){return xn.needsFolderRepair},"get")});Object.defineProperty(L,"getTodayDateString",{enumerable:!0,get:a(function(){return xn.getTodayDateString},"get")});Object.defineProperty(L,"isPlannedForToday",{enumerable:!0,get:a(function(){return xn.isPlannedForToday},"get")});Object.defineProperty(L,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return xn.hasPlannedStartTimestamp},"get")});Object.defineProperty(L,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return xn.extractDailyNoteDate},"get")});Object.defineProperty(L,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return xn.isCurrentDateGteDay},"get")});Object.defineProperty(L,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return xn.inheritsFromPrototype},"get")});Object.defineProperty(L,"isPrototypeClass",{enumerable:!0,get:a(function(){return xn.isPrototypeClass},"get")});var Rh=cA();Object.defineProperty(L,"canCreateTask",{enumerable:!0,get:a(function(){return Rh.canCreateTask},"get")});Object.defineProperty(L,"canCreateRelatedTask",{enumerable:!0,get:a(function(){return Rh.canCreateRelatedTask},"get")});Object.defineProperty(L,"canConvertTaskToProject",{enumerable:!0,get:a(function(){return Rh.canConvertTaskToProject},"get")});Object.defineProperty(L,"canSetCriticalityZone",{enumerable:!0,get:a(function(){return Rh.canSetCriticalityZone},"get")});var Ih=lA();Object.defineProperty(L,"canCreateProject",{enumerable:!0,get:a(function(){return Ih.canCreateProject},"get")});Object.defineProperty(L,"canMoveToAnalysis",{enumerable:!0,get:a(function(){return Ih.canMoveToAnalysis},"get")});Object.defineProperty(L,"canMoveToToDo",{enumerable:!0,get:a(function(){return Ih.canMoveToToDo},"get")});Object.defineProperty(L,"canConvertProjectToTask",{enumerable:!0,get:a(function(){return Ih.canConvertProjectToTask},"get")});var gA=dA();Object.defineProperty(L,"canCreateChildArea",{enumerable:!0,get:a(function(){return gA.canCreateChildArea},"get")});Object.defineProperty(L,"canSetActiveFocus",{enumerable:!0,get:a(function(){return gA.canSetActiveFocus},"get")});var $n=pA();Object.defineProperty(L,"canPlanOnToday",{enumerable:!0,get:a(function(){return $n.canPlanOnToday},"get")});Object.defineProperty(L,"canPlanForEvening",{enumerable:!0,get:a(function(){return $n.canPlanForEvening},"get")});Object.defineProperty(L,"canShiftDayBackward",{enumerable:!0,get:a(function(){return $n.canShiftDayBackward},"get")});Object.defineProperty(L,"canShiftDayForward",{enumerable:!0,get:a(function(){return $n.canShiftDayForward},"get")});Object.defineProperty(L,"canSetDraftStatus",{enumerable:!0,get:a(function(){return $n.canSetDraftStatus},"get")});Object.defineProperty(L,"canMoveToBacklog",{enumerable:!0,get:a(function(){return $n.canMoveToBacklog},"get")});Object.defineProperty(L,"canStartEffort",{enumerable:!0,get:a(function(){return $n.canStartEffort},"get")});Object.defineProperty(L,"canMarkDone",{enumerable:!0,get:a(function(){return $n.canMarkDone},"get")});Object.defineProperty(L,"canTrashEffort",{enumerable:!0,get:a(function(){return $n.canTrashEffort},"get")});Object.defineProperty(L,"canVoteOnEffort",{enumerable:!0,get:a(function(){return $n.canVoteOnEffort},"get")});Object.defineProperty(L,"canRollbackStatus",{enumerable:!0,get:a(function(){return $n.canRollbackStatus},"get")});Object.defineProperty(L,"canArchiveTask",{enumerable:!0,get:a(function(){return $n.canArchiveTask},"get")});Object.defineProperty(L,"canMarkReviewed",{enumerable:!0,get:a(function(){return $n.canMarkReviewed},"get")});var as=mA();Object.defineProperty(L,"canCreateEvent",{enumerable:!0,get:a(function(){return as.canCreateEvent},"get")});Object.defineProperty(L,"canCreateInstance",{enumerable:!0,get:a(function(){return as.canCreateInstance},"get")});Object.defineProperty(L,"canCleanProperties",{enumerable:!0,get:a(function(){return as.canCleanProperties},"get")});Object.defineProperty(L,"canRepairFolder",{enumerable:!0,get:a(function(){return as.canRepairFolder},"get")});Object.defineProperty(L,"canRenameToUid",{enumerable:!0,get:a(function(){return as.canRenameToUid},"get")});Object.defineProperty(L,"canCopyLabelToAliases",{enumerable:!0,get:a(function(){return as.canCopyLabelToAliases},"get")});Object.defineProperty(L,"canCreateNarrowerConcept",{enumerable:!0,get:a(function(){return as.canCreateNarrowerConcept},"get")});Object.defineProperty(L,"canCreateSubclass",{enumerable:!0,get:a(function(){return as.canCreateSubclass},"get")});Object.defineProperty(L,"canCreateTaskForDailyNote",{enumerable:!0,get:a(function(){return as.canCreateTaskForDailyNote},"get")});Object.defineProperty(L,"canCopyFleetingNoteLabel",{enumerable:!0,get:a(function(){return as.canCopyFleetingNoteLabel},"get")})});var _A=S(Ca=>{"use strict";var o4=Ca&&Ca.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),a4=Ca&&Ca.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&o4(e,n,t)};Object.defineProperty(Ca,"__esModule",{value:!0});a4(yA(),Ca)});var Ph=S(Hu=>{"use strict";Object.defineProperty(Hu,"__esModule",{value:!0});Hu.PropertyFieldType=void 0;Hu.rangeToFieldType=u4;var Lr;(function(n){n.Text="text",n.Number="number",n.Date="date",n.DateTime="datetime",n.Boolean="boolean",n.Reference="reference",n.Enum="enum",n.StatusSelect="status-select",n.SizeSelect="size-select",n.Wikilink="wikilink",n.Timestamp="timestamp",n.Unknown="unknown"})(Lr||(Hu.PropertyFieldType=Lr={}));var SA="http://www.w3.org/2001/XMLSchema#",c4="https://exocortex.my/ontology/exo#",l4="https://exocortex.my/ontology/ems#";function u4(n){if(!n)return Lr.Unknown;let e=n.trim();if(!e)return Lr.Unknown;if(e.startsWith(SA)){let t=e.substring(SA.length);return u_(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return u_(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),r=e.substring(t+10);return u_(r)}return e.startsWith(l4)||e.startsWith("ems:")?f4(e):e.startsWith(c4)||e.startsWith("exo:")||d4(e)?Lr.Reference:Lr.Text}a(u4,"rangeToFieldType");function u_(n){switch(n.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return Lr.Text;case"integer":case"int":case"long":case"short":case"byte":case"nonnegativeinteger":case"positiveinteger":case"nonpositiveinteger":case"negativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"decimal":case"float":case"double":return Lr.Number;case"date":return Lr.Date;case"datetime":case"datetimestamp":return Lr.DateTime;case"boolean":return Lr.Boolean;case"time":return Lr.Timestamp;default:return Lr.Text}}a(u_,"xsdTypeToFieldType");function f4(n){let e=n.toLowerCase();return e.includes("effortstatus")?Lr.StatusSelect:e.includes("tasksize")?Lr.SizeSelect:Lr.Reference}a(f4,"emsTypeToFieldType");function d4(n){let e=n.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(r=>e.includes(r))}a(d4,"isClassReference")});var f_=S(Qu=>{"use strict";Object.defineProperty(Qu,"__esModule",{value:!0});Qu.propertyNameToUri=h4;Qu.uriToPropertyName=vA;Qu.extractPropertyLabel=p4;function h4(n){return n.replace(/^([a-z]+)__/,"$1:")}a(h4,"propertyNameToUri");function vA(n){if(n.startsWith("http://")||n.startsWith("https://")){let e=n.match(/\/([a-z]+)#([A-Za-z0-9_]+)$/);if(e)return`${e[1]}__${e[2]}`;let t=n.lastIndexOf("#"),r=n.lastIndexOf("/"),i=Math.max(t,r);return i>=0?n.substring(i+1):n}return n.replace(/^([a-z]+):/,"$1__")}a(vA,"uriToPropertyName");function p4(n){let r=(n.includes(":")?vA(n):n).replace(/^[a-z]+__/,"").split("_");return(r.length>1?r.slice(1).join(" "):r[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,s=>s.toUpperCase())}a(p4,"extractPropertyLabel")});var Oh={};i0(Oh,{__assign:()=>h_,__asyncDelegator:()=>C4,__asyncGenerator:()=>x4,__asyncValues:()=>R4,__await:()=>Ku,__awaiter:()=>v4,__classPrivateFieldGet:()=>F4,__classPrivateFieldSet:()=>D4,__createBinding:()=>w4,__decorate:()=>y4,__exportStar:()=>E4,__extends:()=>m4,__generator:()=>b4,__importDefault:()=>O4,__importStar:()=>P4,__makeTemplateObject:()=>I4,__metadata:()=>S4,__param:()=>_4,__read:()=>bA,__rest:()=>g4,__spread:()=>T4,__spreadArrays:()=>A4,__values:()=>p_});function m4(n,e){d_(n,e);function t(){this.constructor=n}a(t,"__"),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function g4(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function y4(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function _4(n,e){return function(t,r){e(t,r,n)}}function S4(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function v4(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return a(i,"adopt"),new(t||(t=Promise))(function(s,o){function c(f){try{u(r.next(f))}catch(d){o(d)}}a(c,"fulfilled");function l(f){try{u(r.throw(f))}catch(d){o(d)}}a(l,"rejected");function u(f){f.done?s(f.value):i(f.value).then(c,l)}a(u,"step"),u((r=r.apply(n,e||[])).next())})}function b4(n,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},r,i,s,o;return o={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(u){return function(f){return l([u,f])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;t;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return t.label++,{value:u[1],done:!1};case 5:t.label++,i=u[1],u=[0];continue;case 7:u=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){t=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){t.label=u[1];break}if(u[0]===6&&t.label<s[1]){t.label=s[1],s=u;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(u);break}s[2]&&t.ops.pop(),t.trys.pop();continue}u=e.call(n,t)}catch(f){u=[6,f],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function w4(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]}function E4(n,e){for(var t in n)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=n[t])}function p_(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:a(function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function bA(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function T4(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(bA(arguments[e]));return n}function A4(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)r[i]=s[o];return r}function Ku(n){return this instanceof Ku?(this.v=n,this):new Ku(n)}function x4(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(h){r[h]&&(i[h]=function(p){return new Promise(function(y,v){s.push([h,p,y,v])>1||c(h,p)})})}function c(h,p){try{l(r[h](p))}catch(y){d(s[0][3],y)}}function l(h){h.value instanceof Ku?Promise.resolve(h.value.v).then(u,f):d(s[0][2],h)}function u(h){c("next",h)}function f(h){c("throw",h)}function d(h,p){h(p),s.shift(),s.length&&c(s[0][0],s[0][1])}}function C4(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:Ku(n[i](o)),done:i==="return"}:s?s(o):o}:s}}function R4(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof p_=="function"?p_(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(c,l){o=n[s](o),i(c,l,o.done,o.value)})}}function i(s,o,c,l){Promise.resolve(l).then(function(u){s({value:u,done:c})},o)}}function I4(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}function P4(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)Object.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e.default=n,e}function O4(n){return n&&n.__esModule?n:{default:n}}function F4(n,e){if(!e.has(n))throw new TypeError("attempted to get private field on non-instance");return e.get(n)}function D4(n,e,t){if(!e.has(n))throw new TypeError("attempted to set private field on non-instance");return e.set(n,t),t}var d_,h_,Fh=gL(()=>{d_=a(function(n,e){return d_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])},d_(n,e)},"extendStatics");a(m4,"__extends");h_=a(function(){return h_=Object.assign||a(function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),h_.apply(this,arguments)},"__assign");a(g4,"__rest");a(y4,"__decorate");a(_4,"__param");a(S4,"__metadata");a(v4,"__awaiter");a(b4,"__generator");a(w4,"__createBinding");a(E4,"__exportStar");a(p_,"__values");a(bA,"__read");a(T4,"__spread");a(A4,"__spreadArrays");a(Ku,"__await");a(x4,"__asyncGenerator");a(C4,"__asyncDelegator");a(R4,"__asyncValues");a(I4,"__makeTemplateObject");a(P4,"__importStar");a(O4,"__importDefault");a(F4,"__classPrivateFieldGet");a(D4,"__classPrivateFieldSet")});var y_=S(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});var m_;(function(n){n[n.Transient=0]="Transient",n[n.Singleton=1]="Singleton",n[n.ResolutionScoped=2]="ResolutionScoped",n[n.ContainerScoped=3]="ContainerScoped"})(m_||(m_={}));g_.default=m_});var wA=S(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});var N4=y_();Object.defineProperty(__,"Lifecycle",{enumerable:!0,get:a(function(){return N4.default},"get")})});var Ra=S(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.defineInjectionTokenMetadata=di.getParamInfo=di.INJECTION_TOKEN_METADATA_KEY=void 0;di.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function L4(n){let e=Reflect.getMetadata("design:paramtypes",n)||[],t=Reflect.getOwnMetadata(di.INJECTION_TOKEN_METADATA_KEY,n)||{};return Object.keys(t).forEach(r=>{e[+r]=t[r]}),e}a(L4,"getParamInfo");di.getParamInfo=L4;function k4(n,e){return function(t,r,i){let s=Reflect.getOwnMetadata(di.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:n,transform:e.transformToken,transformArgs:e.args||[]}:n,Reflect.defineMetadata(di.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(k4,"defineInjectionTokenMetadata");di.defineInjectionTokenMetadata=k4});var S_=S(Dh=>{"use strict";Object.defineProperty(Dh,"__esModule",{value:!0});Dh.isClassProvider=void 0;function M4(n){return!!n.useClass}a(M4,"isClassProvider");Dh.isClassProvider=M4});var v_=S(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.isFactoryProvider=void 0;function j4(n){return!!n.useFactory}a(j4,"isFactoryProvider");Nh.isFactoryProvider=j4});var kh=S(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.delay=Pc.DelayedConstructor=void 0;var Lh=class{static{a(this,"DelayedConstructor")}constructor(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}createProxy(e){let t={},r=!1,i,s=a(()=>(r||(i=e(this.wrap()),r=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},r=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(r),t}};Pc.DelayedConstructor=Lh;function $4(n){if(typeof n>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new Lh(n)}a($4,"delay");Pc.delay=$4});var Mh=S(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.isConstructorToken=cs.isTransformDescriptor=cs.isTokenDescriptor=cs.isNormalToken=void 0;var B4=kh();function U4(n){return typeof n=="string"||typeof n=="symbol"}a(U4,"isNormalToken");cs.isNormalToken=U4;function V4(n){return typeof n=="object"&&"token"in n&&"multiple"in n}a(V4,"isTokenDescriptor");cs.isTokenDescriptor=V4;function q4(n){return typeof n=="object"&&"token"in n&&"transform"in n}a(q4,"isTransformDescriptor");cs.isTransformDescriptor=q4;function W4(n){return typeof n=="function"||n instanceof B4.DelayedConstructor}a(W4,"isConstructorToken");cs.isConstructorToken=W4});var b_=S(jh=>{"use strict";Object.defineProperty(jh,"__esModule",{value:!0});jh.isTokenProvider=void 0;function G4(n){return!!n.useToken}a(G4,"isTokenProvider");jh.isTokenProvider=G4});var w_=S($h=>{"use strict";Object.defineProperty($h,"__esModule",{value:!0});$h.isValueProvider=void 0;function z4(n){return n.useValue!=null}a(z4,"isValueProvider");$h.isValueProvider=z4});var E_=S(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});var H4=S_();Object.defineProperty(Ia,"isClassProvider",{enumerable:!0,get:a(function(){return H4.isClassProvider},"get")});var Q4=v_();Object.defineProperty(Ia,"isFactoryProvider",{enumerable:!0,get:a(function(){return Q4.isFactoryProvider},"get")});var K4=Mh();Object.defineProperty(Ia,"isNormalToken",{enumerable:!0,get:a(function(){return K4.isNormalToken},"get")});var Y4=b_();Object.defineProperty(Ia,"isTokenProvider",{enumerable:!0,get:a(function(){return Y4.isTokenProvider},"get")});var X4=w_();Object.defineProperty(Ia,"isValueProvider",{enumerable:!0,get:a(function(){return X4.isValueProvider},"get")})});var EA=S(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.isProvider=void 0;var J4=S_(),Z4=w_(),ej=b_(),tj=v_();function rj(n){return J4.isClassProvider(n)||Z4.isValueProvider(n)||ej.isTokenProvider(n)||tj.isFactoryProvider(n)}a(rj,"isProvider");Bh.isProvider=rj});var x_=S(A_=>{"use strict";Object.defineProperty(A_,"__esModule",{value:!0});var T_=class{static{a(this,"RegistryBase")}constructor(){this._registryMap=new Map}entries(){return this._registryMap.entries()}getAll(e){return this.ensure(e),this._registryMap.get(e)}get(e){this.ensure(e);let t=this._registryMap.get(e);return t[t.length-1]||null}set(e,t){this.ensure(e),this._registryMap.get(e).push(t)}setAll(e,t){this._registryMap.set(e,t)}has(e){return this.ensure(e),this._registryMap.get(e).length>0}clear(){this._registryMap.clear()}ensure(e){this._registryMap.has(e)||this._registryMap.set(e,[])}};A_.default=T_});var TA=S(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});var nj=x_(),C_=class extends nj.default{static{a(this,"Registry")}};R_.default=C_});var AA=S(P_=>{"use strict";Object.defineProperty(P_,"__esModule",{value:!0});var I_=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};P_.default=I_});var O_=S(Uh=>{"use strict";Object.defineProperty(Uh,"__esModule",{value:!0});Uh.formatErrorCtor=void 0;function ij(n,e){return n===null?`at position #${e}`:`"${n.split(",")[e].trim()}" at position #${e}`}a(ij,"formatDependency");function sj(n,e,t=" "){return[n,...e.message.split(`
32
32
  `).map(r=>t+r)].join(`
33
- `)}a(sj,"composeErrorMessage");function oj(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=ij(r,e);return sj(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(oj,"formatErrorCtor");Uh.formatErrorCtor=oj});var xA=S(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isDisposable=void 0;function aj(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(aj,"isDisposable");Vh.isDisposable=aj});var RA=S(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.PostResolutionInterceptors=Pa.PreResolutionInterceptors=void 0;var CA=x_(),qh=class extends CA.default{static{a(this,"PreResolutionInterceptors")}};Pa.PreResolutionInterceptors=qh;var Wh=class extends CA.default{static{a(this,"PostResolutionInterceptors")}};Pa.PostResolutionInterceptors=Wh;var F_=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new qh,this.postResolution=new Wh}};Pa.default=F_});var Fo=S(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.instance=Qs.typeInfo=void 0;var cj=(Fh(),Zd(Oh)),fn=E_(),lj=EA(),Gh=Mh(),uj=TA(),Cn=y_(),zh=AA(),fj=O_(),dj=kh(),hj=xA(),pj=RA();Qs.typeInfo=new Map;var D_=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new uj.default,this.interceptors=new pj.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Cn.default.Transient}){this.ensureNotDisposed();let i;if(lj.isProvider(t)?i=t:i={useClass:t},fn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&fn.isTokenProvider(l.provider)?o=l.provider:o=null}}if((r.lifecycle===Cn.default.Singleton||r.lifecycle==Cn.default.ContainerScoped||r.lifecycle==Cn.default.ResolutionScoped)&&(fn.isValueProvider(i)||fn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Cn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),fn.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),fn.isNormalToken(e)){if(fn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Cn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Cn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!fn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Cn.default.Singleton})}resolve(e,t=new zh.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&fn.isNormalToken(e)){if(r)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Gh.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Cn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Cn.default.Singleton,i=e.options.lifecycle===Cn.default.ContainerScoped,s=r||i,o;return fn.isValueProvider(e.provider)?o=e.provider.useValue:fn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):fn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):fn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Cn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new zh.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&fn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!fn.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===Cn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Cn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return cj.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof dj.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Qs.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return hj.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Gh.isTokenDescriptor(r)?Gh.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new zh.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new zh.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Gh.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(fj.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Qs.instance=new D_;Qs.default=Qs.instance});var IA=S(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var mj=Ra(),Ks=Fo(),N_=Mh(),gj=O_();function yj(){return function(n){let e=mj.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return N_.isTokenDescriptor(r)?N_.isTransformDescriptor(r)?r.multiple?Ks.instance.resolve(r.transform).transform(Ks.instance.resolveAll(r.token),...r.transformArgs):Ks.instance.resolve(r.transform).transform(Ks.instance.resolve(r.token),...r.transformArgs):r.multiple?Ks.instance.resolveAll(r.token):Ks.instance.resolve(r.token):N_.isTransformDescriptor(r)?Ks.instance.resolve(r.transform).transform(Ks.instance.resolve(r.token),...r.transformArgs):Ks.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(gj.formatErrorCtor(n,o,s))}})))}}}}a(yj,"autoInjectable");L_.default=yj});var PA=S(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var _j=Ra();function Sj(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return _j.defineInjectionTokenMetadata(t)}a(Sj,"inject");k_.default=Sj});var Hh=S(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var vj=Ra(),bj=Fo(),OA=Fo();function wj(n){return function(e){bj.typeInfo.set(e,vj.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{OA.instance.register(t,e)}):OA.instance.register(n.token,e))}}a(wj,"injectable");M_.default=wj});var FA=S(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Ej=(Fh(),Zd(Oh)),Tj=Fo();function Aj(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=Ej.__rest(t,["token","options"]);return Tj.instance.register(r,s,i)}),e}}a(Aj,"registry");j_.default=Aj});var DA=S($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var xj=Hh(),Cj=Fo();function Rj(){return function(n){xj.default()(n),Cj.instance.registerSingleton(n)}}a(Rj,"singleton");$_.default=Rj});var NA=S(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var Ij=Ra();function Pj(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return Ij.defineInjectionTokenMetadata(t)}a(Pj,"injectAll");B_.default=Pj});var LA=S(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var Oj=Ra();function Fj(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return Oj.defineInjectionTokenMetadata(r)}a(Fj,"injectAllWithTransform");U_.default=Fj});var kA=S(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var Dj=Ra();function Nj(n,e,...t){return Dj.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(Nj,"injectWithTransform");V_.default=Nj});var MA=S(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var Lj=Hh(),kj=Fo();function Mj(n,e){return function(t){Lj.default()(t),kj.instance.register(e||t,t,{lifecycle:n})}}a(Mj,"scoped");q_.default=Mj});var jA=S(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});var jj=IA();Object.defineProperty(hi,"autoInjectable",{enumerable:!0,get:a(function(){return jj.default},"get")});var $j=PA();Object.defineProperty(hi,"inject",{enumerable:!0,get:a(function(){return $j.default},"get")});var Bj=Hh();Object.defineProperty(hi,"injectable",{enumerable:!0,get:a(function(){return Bj.default},"get")});var Uj=FA();Object.defineProperty(hi,"registry",{enumerable:!0,get:a(function(){return Uj.default},"get")});var Vj=DA();Object.defineProperty(hi,"singleton",{enumerable:!0,get:a(function(){return Vj.default},"get")});var qj=NA();Object.defineProperty(hi,"injectAll",{enumerable:!0,get:a(function(){return qj.default},"get")});var Wj=LA();Object.defineProperty(hi,"injectAllWithTransform",{enumerable:!0,get:a(function(){return Wj.default},"get")});var Gj=kA();Object.defineProperty(hi,"injectWithTransform",{enumerable:!0,get:a(function(){return Gj.default},"get")});var zj=MA();Object.defineProperty(hi,"scoped",{enumerable:!0,get:a(function(){return zj.default},"get")})});var $A=S(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});function Hj(n){let e;return t=>(e==null&&(e=n(t)),e)}a(Hj,"instanceCachingFactory");W_.default=Hj});var BA=S(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});function Qj(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(Qj,"instancePerContainerCachingFactory");G_.default=Qj});var UA=S(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});function Kj(n,e,t,r=!0){let i,s;return o=>{let c=n(o);return(!r||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(Kj,"predicateAwareClassFactory");z_.default=Kj});var VA=S(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});var Yj=$A();Object.defineProperty(Yu,"instanceCachingFactory",{enumerable:!0,get:a(function(){return Yj.default},"get")});var Xj=BA();Object.defineProperty(Yu,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return Xj.default},"get")});var Jj=UA();Object.defineProperty(Yu,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return Jj.default},"get")})});var fe=S(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var H_=(Fh(),Zd(Oh));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Zj=wA();Object.defineProperty(Do,"Lifecycle",{enumerable:!0,get:a(function(){return Zj.Lifecycle},"get")});H_.__exportStar(jA(),Do);H_.__exportStar(VA(),Do);H_.__exportStar(E_(),Do);var e9=kh();Object.defineProperty(Do,"delay",{enumerable:!0,get:a(function(){return e9.delay},"get")});var t9=Fo();Object.defineProperty(Do,"container",{enumerable:!0,get:a(function(){return t9.instance},"get")})});var Oc=S(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.NullLogger=void 0;Qh.NullLogger={debug(){},info(){},warn(){},error(){}}});var Q_=S((Pre,qA)=>{var Fc=class{static{a(this,"Wildcard")}constructor(){return r9||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(Fc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(Fc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var r9=new Fc;qA.exports.Wildcard=Fc});var GA=S((Fre,WA)=>{var n9=(function(){var n=a(function(R,C,P,N){for(P=P||{},N=R.length;N--;P[R[N]]=C);return P},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],y=[123,126],v=[1,67],b=[39,45,87],w=[13,16,45,197,224,308],T=[1,87],I=[2,281],$=[1,86],q=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ce=[6,28,29,53,63,70,73,81,83,85],B=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],V=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],F=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],k=[13,16,308],te=[112,132,327,334],Ye=[13,16,112,132,308],at=[1,111],Ft=[1,117],ct=[112,132,327,328,334],ut=[13,16,112,132,308,328],Xe=[28,29,45,53,87],ie=[1,138],W=[1,151],ft=[1,128],mt=[1,127],Q=[1,129],Ie=[1,140],qe=[1,141],re=[1,142],We=[1,143],Ge=[1,144],Be=[1,145],ze=[1,147],Ce=[1,148],Ue=[2,457],Pe=[1,158],Ve=[1,159],He=[1,160],de=[1,152],ge=[1,153],ye=[1,156],he=[1,171],pe=[1,172],me=[1,173],ue=[1,174],_e=[1,175],Se=[1,176],ve=[1,167],be=[1,168],ae=[1,169],we=[1,170],tt=[1,157],Qe=[1,166],$e=[1,161],E=[1,162],A=[1,163],x=[1,164],O=[1,165],Z=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],St=[1,195],Ct=[6,31,73,81,83,85],De=[2,285],G=[1,199],z=[1,201],K=[6,31,70,73,81,83,85],Y=[2,283],Re=[1,207],nt=[1,218],it=[1,223],Or=[1,219],wn=[1,225],Mn=[1,226],sn=[1,224],yT=[6,63,70,73,81,83,85],_T=[1,236],ST=[2,334],vT=[1,243],bT=[1,241],Fr=[6,193],Od=[2,349],wT=[2,339],Ao=[28,128],ET=[47,48,193,272],Fd=[47,48,193,242,272],hc=[47,48,193,242,246,272],pc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Sr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],TT=[1,271],AT=[1,270],Zt=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],xT=[1,281],CT=[1,280],on=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],wu=[45,89],Dd=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Nd=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Ld=[31,89],kd=[48,87],fa=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],es=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],RT=[1,313],mc=[6,85],My=[6,31,81,83,85],IT=[2,361],Ls=[2,353],da=[1,343],Eu=[31,112,335],ks=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],jy=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],PT=[6,109,193],ha=[31,112],er=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],$y=[1,390],By=[1,391],xo=[13,16,87,197,308,314],OT=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Md=[1,417],jd=[1,418],FT=[13,16,48,197,229,308],Co=[6,31,85],DT=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Uy=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],pa=[29,31,85,112,159,160,161,163,164],$d=[1,443],Bd=[1,444],NT=[1,449],ma=[31,112,193,232,318,335],Ud=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],LT=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Vy=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Tu=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Au=[31,45],kT=[1,507],MT=[1,508],jT=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],Vd=[29,31,85,112,159,160,161,163,164,335],ga=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],$T=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],BT=[2,352],qy=[13,16,197,308,314],UT=[1,565],gc=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],VT=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Ms=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],qT=[13,16,87,308],js=[2,364],yc=[29,31,85,112,159,160,161,163,164,193,232,318,335],qd=[31,112,193,232,272,318,335],$s=[2,359],WT=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Wd=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],GT=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],zT=[2,347],Wy={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:a(function(C,P,N,ne,Oe,g,cn){var _=g.length-1;switch(Oe){case 1:if(g[_-1]=g[_-1]||{},ke.base&&(g[_-1].base=ke.base),ke.base="",g[_-1].prefixes=ke.prefixes,ke.prefixes=null,ke.pathOnly){if(g[_-1].type==="path"||"termType"in g[_-1])return g[_-1];throw new Error("Received full SPARQL query in path only mode")}else if(g[_-1].type==="path"||"termType"in g[_-1])throw new Error("Received only path in full SPARQL mode");if(g[_-1].type==="update"){let vt={};for(let jt of g[_-1].updates)if(jt.updateType==="insert"){let st={};for(let dt of jt.insert)if(dt.type==="bgp"||dt.type==="graph")for(let En of dt.triples)En.subject.termType==="BlankNode"&&(st[En.subject.value]=!0),En.predicate.termType==="BlankNode"&&(st[En.predicate.value]=!0),En.object.termType==="BlankNode"&&(st[En.object.value]=!0);for(let dt of Object.keys(st)){if(vt[dt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");vt[dt]=!0}}}return g[_-1];case 2:this.$={...g[_-1],...g[_],type:"query"};break;case 4:ke.base=xu(g[_]);break;case 5:ke.prefixes||(ke.prefixes={}),g[_-1]=g[_-1].substr(0,g[_-1].length-1),g[_]=xu(g[_]),ke.prefixes[g[_-1]]=g[_];break;case 6:this.$={...g[_-3],...Sa(g[_-2]),...g[_-1],...g[_]};break;case 7:if(!ke.skipValidation&&(Jy(g[_-3].variables.map(jt=>Xy(jt.expression))).some(jt=>jt.aggregation==="count"&&!(jt.expression instanceof Gd))||g[_].group)){for(let jt of g[_-3].variables)if(jt.termType==="Variable"){if(!g[_].group||!g[_].group.map(st=>bc(st)).includes(bc(jt)))throw Error("Projection of ungrouped variable (?"+bc(jt)+")")}else if(Xy(jt.expression).length===0){let st=cL(jt.expression);for(let dt of st)if(!g[_].group||!g[_].group.map||!g[_].group.map(En=>bc(En)).includes(bc(dt)))throw Error("Use of ungrouped variable in projection of operation (?"+bc(dt)+")")}}let is=g[_-1].where.filter(vt=>vt.type==="query");if(is.length>0){let vt=g[_-3].variables.filter(st=>st.variable&&st.variable.value).map(st=>st.variable.value),jt=Jy(is.map(st=>st.variables)).map(st=>st.value||st.variable.value);for(let st of vt)if(jt.indexOf(st)>=0)throw Error("Target id of 'AS' (?"+st+") already used in subquery")}this.$=Ht(g[_-3],Sa(g[_-2]),g[_-1],g[_]);break;case 8:this.$=Ht({queryType:"CONSTRUCT",template:g[_-3]},Sa(g[_-2]),g[_-1],g[_]);break;case 9:this.$=Ht({queryType:"CONSTRUCT",template:g[_-2]=g[_-2]?g[_-2].triples:[]},Sa(g[_-5]),{where:[{type:"bgp",triples:_a([],g[_-2])}]},g[_]);break;case 10:this.$=Ht({queryType:"DESCRIBE",variables:g[_-3]==="*"?[new Gd]:g[_-3]},Sa(g[_-2]),g[_-1],g[_]);break;case 11:this.$=Ht({queryType:"ASK"},Sa(g[_-2]),g[_-1],g[_]);break;case 12:this.$=Ht(g[_-1],{variables:[new Gd]});break;case 13:let Ou=g[_].map(vt=>vt.value||vt.variable.value),wc=lL(Ou);if(wc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+wc[0]+")");this.$=Ht(g[_-1],{variables:g[_]});break;case 14:this.$=Ht({queryType:"SELECT"},g[_]&&(g[_-1]=an(g[_]),g[_]={},g[_][g[_-1]]=!0,g[_]));break;case 16:case 27:this.$=_c(g[_-3],{variable:g[_-1]});break;case 17:case 18:this.$=Ht(g[_-3],g[_-2],g[_-1],g[_],{type:"query"});break;case 19:case 58:this.$={iri:g[_],named:!!g[_-1]};break;case 20:this.$={where:g[_].patterns};break;case 21:this.$=Ht(g[_-1],g[_]);break;case 22:this.$=Ht(g[_-2],g[_-1],g[_]);break;case 23:this.$={group:g[_]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=_c(g[_]);break;case 26:this.$=_c(g[_-1]);break;case 29:this.$={having:g[_]};break;case 30:this.$={order:g[_]};break;case 32:this.$=_c(g[_],{descending:!0});break;case 35:this.$={limit:vc(g[_])};break;case 36:this.$={offset:vc(g[_])};break;case 37:this.$={limit:vc(g[_-2]),offset:vc(g[_])};break;case 38:this.$={limit:vc(g[_]),offset:vc(g[_-2])};break;case 39:case 43:this.$={type:"values",values:g[_]};break;case 40:case 84:this.$=g[_-1].map(vt=>({[g[_-3]]:vt}));break;case 41:case 85:this.$=g[_-1].map(()=>({}));break;case 42:case 86:var ns=g[_-4].length;g[_-4]=g[_-4].map(Gy),this.$=g[_-1].map(function(vt){if(vt.length!==ns)throw Error("Inconsistent VALUES length");for(var jt={},st=0;st<ns;st++)jt["?"+g[_-4][st].value]=vt[st];return jt});break;case 44:case 65:case 100:case 126:case 175:this.$=g[_-1];break;case 45:this.$={type:"update",updates:Bs(g[_-2],g[_-1])};break;case 46:this.$=Ht({type:"load",silent:!!g[_-2],source:g[_-1]},g[_]&&{destination:g[_]});break;case 47:this.$={type:an(g[_-2]),silent:!!g[_-1],graph:g[_]};break;case 48:this.$={type:an(g[_-4]),silent:!!g[_-3],source:g[_-2],destination:g[_]};break;case 49:this.$={type:"create",silent:!!g[_-2],graph:{type:"graph",name:g[_]}};break;case 50:this.$={updateType:"insert",insert:n2(g[_])};break;case 51:this.$={updateType:"delete",delete:t0(n2(g[_]))};break;case 52:this.$={updateType:"deletewhere",delete:t0(g[_])};break;case 53:this.$={updateType:"insertdelete",...g[_-4],...g[_-3],...Sa(g[_-2],"using"),where:g[_].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=g[_];break;case 55:this.$={delete:t0(g[_-1]),insert:g[_]||[]};break;case 56:this.$={delete:[],insert:g[_]};break;case 59:this.$={graph:g[_]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:g[_]};break;case 64:this.$={[an(g[_])]:!0};break;case 66:this.$=g[_-1]?ts(g[_],[g[_-1]]):ts(g[_]);break;case 67:var Iu=Ht(g[_-3]||{triples:[]},{type:"graph",name:g[_-5]});this.$=g[_]?[Iu,g[_]]:[Iu];break;case 68:case 73:this.$={type:"bgp",triples:ts(g[_-2],[g[_-1]])};break;case 69:this.$={type:"group",patterns:[g[_-1]]};break;case 70:for(let vt of g[_-1].filter(jt=>jt.type==="bind")){let jt=g[_-1].indexOf(vt),st=new Set;for(let dt of g[_-1].slice(0,jt))(dt.type==="group"||dt.type==="bgp")&&t2(dt).forEach(En=>st.add(En));if(st.has(vt.variable.value))throw Error("Variable used to bind is already bound (?"+vt.variable.value+")")}this.$={type:"group",patterns:g[_-1]};break;case 71:this.$=g[_-1]?ts([g[_-1]],g[_]):ts(g[_]);break;case 72:this.$=g[_]?[g[_-2],g[_]]:g[_-2];break;case 75:this.$=Ht(g[_],{type:"optional"});break;case 76:this.$=Ht(g[_],{type:"minus"});break;case 77:this.$=Ht(g[_],{type:"graph",name:g[_-1]});break;case 78:this.$=Ht(g[_],{type:"service",name:g[_-1],silent:!!g[_-2]});break;case 79:this.$={type:"filter",expression:g[_]};break;case 80:this.$={type:"bind",variable:g[_-1],expression:g[_-3]};break;case 89:this.$=Ru(g[_]);break;case 90:this.$=void 0;break;case 91:this.$=g[_-1].length?{type:"union",patterns:ts(g[_-1].map(Hy),[Hy(g[_])])}:g[_];break;case 95:this.$={...g[_],function:g[_-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Bs(g[_-2],g[_-1]),distinct:!!g[_-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=Bs(g[_-2],g[_-1]);break;case 101:this.$=ts(g[_-2],[g[_-1]]);break;case 102:case 112:this.$=e0(g[_].map(vt=>Ht(Us(g[_-1]),vt)));break;case 103:this.$=e0(_a(g[_].map(vt=>Ht(Us(g[_-1].entity),vt)),g[_-1].triples));break;case 105:this.$=ts([g[_-1]],g[_]);break;case 106:this.$=ts(g[_]);break;case 107:this.$=Yy(g[_-1],g[_]);break;case 109:case 237:this.$=ke.factory.namedNode(JN);break;case 110:case 118:this.$=Bs(g[_-1],g[_]);break;case 111:this.$=g[_]?{annotation:g[_],object:g[_-1]}:g[_-1];break;case 113:this.$=g[_]?e0(_a(g[_].map(vt=>Ht(Us(g[_-1].entity),vt)),g[_-1].triples)):g[_-1].triples;break;case 114:this.$=Yy(...g[_-1],g[_]);break;case 116:this.$=Yy(...g[_]);break;case 117:case 159:case 163:this.$=[g[_-1],g[_]];break;case 119:this.$=g[_]?{object:g[_-1],annotation:g[_]}:g[_-1];break;case 120:this.$=g[_-1].length?Sc("|",Bs(g[_-1],g[_])):g[_];break;case 121:this.$=g[_-1].length?Sc("/",Bs(g[_-1],g[_])):g[_];break;case 122:this.$=g[_]?Sc(g[_],[g[_-1]]):g[_-1];break;case 123:this.$=g[_-1]?Sc(g[_-1],[g[_]]):g[_];break;case 125:case 131:this.$=Sc(g[_-1],[g[_]]);break;case 129:this.$=Sc("|",Bs(g[_-2],g[_-1]));break;case 132:case 134:this.$=oL(g[_-1]);break;case 133:case 135:this.$=aL(g[_-1]);break;case 140:this.$={entity:g[_],triples:[]};break;case 145:this.$=Gy(g[_]);break;case 149:this.$=ke.factory.namedNode(HT);break;case 151:case 153:case 158:case 162:this.$=zy(g[_-1],g[_]);break;case 152:this.$=["||",g[_]];break;case 154:this.$=["&&",g[_]];break;case 156:this.$=Dr(g[_-1],[g[_-2],g[_]]);break;case 157:this.$=Dr(g[_-2]?"notin":"in",[g[_-3],g[_]]);break;case 160:this.$=["+",zy(g[_-1],g[_])];break;case 161:var Qd=rs(g[_-1].value.replace("-",""),g[_-1].datatype);this.$=["-",zy(Qd,g[_])];break;case 164:this.$=Dr("UPLUS",[g[_]]);break;case 165:this.$=Dr(g[_-1],[g[_]]);break;case 166:this.$=Dr("UMINUS",[g[_]]);break;case 177:this.$=Dr(an(g[_-1]));break;case 178:this.$=Dr(an(g[_-3]),[g[_-1]]);break;case 179:this.$=Ru(Dr(an(g[_-3]),[g[_-1]]));break;case 180:this.$=Dr(an(g[_-5]),[g[_-3],g[_-1]]);break;case 181:this.$=Dr(an(g[_-7]),[g[_-5],g[_-3],g[_-1]]);break;case 182:this.$=Ru(Dr(an(g[_-7]),[g[_-5],g[_-3],g[_-1]]));break;case 183:this.$=Dr(an(g[_-1]),g[_]);break;case 184:this.$=Dr("bound",[Gy(g[_-1])]);break;case 185:this.$=Dr(g[_-1],[]);break;case 186:this.$=Dr(g[_-3],[g[_-1]]);break;case 187:this.$=Dr(g[_-2]?"notexists":"exists",[Hy(g[_])]);break;case 188:case 189:this.$=_c(g[_-1],{type:"aggregate",aggregation:an(g[_-4]),distinct:!!g[_-2]});break;case 190:this.$=_c(g[_-2],{type:"aggregate",aggregation:an(g[_-5]),distinct:!!g[_-3],separator:typeof g[_-1]=="string"?g[_-1]:" "});break;case 192:this.$=rs(g[_]);break;case 193:this.$=rL(g[_-1],an(g[_].substr(1)));break;case 194:this.$=rs(g[_-2],g[_]);break;case 195:case 204:this.$=rs(g[_],QT);break;case 196:case 205:this.$=rs(g[_],KT);break;case 197:case 206:this.$=rs(an(g[_]),YT);break;case 200:this.$=rs(g[_].toLowerCase(),tL);break;case 201:this.$=rs(g[_].substr(1),QT);break;case 202:this.$=rs(g[_].substr(1),KT);break;case 203:this.$=rs(g[_].substr(1).toLowerCase(),YT);break;case 207:case 208:this.$=e2(g[_],1);break;case 209:case 210:this.$=e2(g[_],3);break;case 211:this.$=ke.factory.namedNode(xu(g[_]));break;case 213:var Kd=g[_].indexOf(":"),Pu=g[_].substr(0,Kd),Yd=ke.prefixes[Pu];if(!Yd)throw new Error("Unknown prefix: "+Pu);var Ut=xu(Yd+g[_].substr(Kd+1));this.$=ke.factory.namedNode(Ut);break;case 214:if(g[_]=g[_].substr(0,g[_].length-1),!(g[_]in ke.prefixes))throw new Error("Unknown prefix: "+g[_]);var Ut=xu(ke.prefixes[g[_]]);this.$=ke.factory.namedNode(Ut);break;case 215:this.$=Cu(g[_].replace(/^(_:)/,""));break;case 216:this.$=Cu();break;case 217:case 218:case 232:this.$=Ru(Qy(g[_-3],g[_-2],g[_-1]));break;case 230:case 231:this.$=Ru(g[_-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:g[_-1].push(g[_]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[g[_]];break;case 308:g[_-3].push(g[_-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:g[_-2].push(g[_-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:o},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:h,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(y,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:v,87:h},n(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(w,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:T,29:I,52:84,53:$,56:85},{19:88,28:T,29:I,52:89,53:$,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:$},n(q,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(ce,[2,263],{34:96}),n(ce,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(ce,[2,262]),n(B,[2,259]),n(V,[2,143]),n(V,[2,144]),n([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),n(F,[2,211]),n(F,[2,212]),n(F,[2,213]),n(F,[2,214]),{19:98,28:T,29:I,52:99,53:$,56:85},{6:[2,309],99:100,193:[1,101]},n(k,[2,311],{101:102,328:[1,103]}),n(te,[2,317],{104:104,328:[1,105]}),n(Ye,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:at,114:110},{29:at,114:112},{29:at,114:113},{118:114,123:[1,115],125:116,126:Ft},n(ct,[2,315]),n(ct,[2,316]),n(ut,[2,319]),n(ut,[2,320]),n(ut,[2,321]),n(y,[2,327]),{13:f,16:d,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:v,87:h}),n(Xe,[2,269]),n(Xe,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(Z,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},n(c,[2,410]),n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:d,45:[1,193],55:194,197:St,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(w,[2,419]),n(Ct,De,{20:196,59:197,69:198,70:G}),n(l,[2,250]),{29:z,57:200},n(k,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(K,Y,{23:204,58:205,62:206,63:Re}),n(l,[2,252]),{19:208,28:T,29:I,52:209,53:$,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,145:212,172:221,185:213,187:214,231:Or,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(yT,[2,265],{56:85,35:227,52:228,19:229,28:T,29:I,53:$}),n(B,[2,260]),n(K,Y,{58:205,62:206,23:230,63:Re}),n(l,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:p},n(k,[2,312]),{105:233,112:_T,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(te,[2,318]),n(k,ST,{108:240,133:242,112:vT,132:bT}),n(Ye,[2,323]),{112:[1,244]},{112:[2,325]},n(Fr,[2,50]),n(q,Od,{135:245,136:246,143:247,144:248,31:wT,112:wT}),n(Fr,[2,51]),n(Fr,[2,52]),n(Ao,[2,328],{119:249}),{29:at,114:250},n(Ao,[2,56]),{29:at,114:251},n(y,[2,59]),n(Xe,[2,270]),{47:[1,252]},n(ET,[2,150]),n(Fd,[2,428],{240:253}),n(hc,[2,430],{244:254}),n(hc,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),n(pc,[2,440],{252:264}),n(Sr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Sr,[2,167]),n(Sr,[2,168]),n(Sr,[2,169]),n(Sr,[2,170],{176:269,45:TT,89:AT}),n(Sr,[2,171]),n(Sr,[2,172]),n(Sr,[2,173]),n(Sr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:xT,89:CT,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(on,[2,192],{292:[1,286],293:[1,287]}),n(on,[2,195]),n(on,[2,196]),n(on,[2,197]),n(on,[2,198]),n(on,[2,199]),n(on,[2,200]),{13:f,16:d,44:39,55:40,82:W,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(wu,[2,452]),n(wu,[2,453]),n(wu,[2,454]),n(wu,[2,455]),n(wu,[2,456]),{279:[2,458]},n(Dd,[2,207]),n(Dd,[2,208]),n(Dd,[2,209]),n(Dd,[2,210]),n(on,[2,201]),n(on,[2,202]),n(on,[2,203]),n(on,[2,204]),n(on,[2,205]),n(on,[2,206]),n(e,[2,5]),n(Nd,[2,297],{88:295}),n(Ld,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(kd,[2,301]),n(Z,[2,43]),n(Z,[2,82]),n(Z,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n(fa,[2,123]),n(fa,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(es,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:St,223:312,225:308,226:309,229:RT,307:43,308:p},n(c,i,{215:10,214:314}),n(es,[2,236]),n(es,[2,237]),n(mc,[2,6]),n(My,[2,287],{60:315,72:316,73:[1,317]}),n(Ct,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n([6,31,63,70,73,81,83,85],[2,20]),n(q,IT,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Ls,31:Ls,85:Ls,112:Ls,159:Ls,160:Ls,161:Ls,163:Ls,164:Ls,41:s}),{13:f,16:d,55:331,307:43,308:p},n(k,[2,280]),n(mc,[2,7]),n(Ct,De,{59:197,69:198,20:332,70:G}),n(K,[2,284]),{64:[1,333]},n(K,Y,{58:205,62:206,23:334,63:Re}),n(l,[2,254]),n(q,Od,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:h,139:342,186:339,190:340,195:341,197:da,307:43,308:p},n(Eu,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:h,197:da,308:p}),n(ks,[2,227]),n(ks,[2,228]),n(ks,[2,229]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,172:221,185:351,187:350,200:348,230:347,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:da,307:43,308:p},n(ks,[2,146]),n(ks,[2,147]),n(ks,[2,148]),n(ks,[2,149]),{13:f,16:d,44:354,55:355,82:W,87:h,172:357,237:356,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:358,312:sn,313:353},n(jy,[2,215]),n(jy,[2,216]),n(K,Y,{58:205,62:206,23:359,63:Re}),n(ce,[2,264]),n(yT,[2,266]),n(mc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Fr,[2,313],{102:360,120:361,121:[1,362]}),n(Fr,[2,47]),n(Fr,[2,63]),n(Fr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(Fr,[2,336]),n(Fr,[2,337]),n(Fr,[2,338]),{109:[1,364]},n(PT,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(k,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(ha,[2,341],{137:368}),n(ha,[2,340]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,145:369,172:221,185:213,187:214,231:Or,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},{28:[1,370],127:371,128:[1,372]},n(Ao,[2,330],{124:373,125:374,126:Ft}),n(Ao,[2,57]),{44:375,87:h},n(ET,[2,151],{241:376,242:[1,377]}),n(Fd,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,247:380,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{250:[1,381]},n(er,[2,432]),n(er,[2,433]),n(er,[2,434]),n(er,[2,435]),n(er,[2,436]),n(er,[2,437]),{250:[2,439]},n([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:he,298:pe,299:me,300:ue,301:_e,302:Se}),n(pc,[2,162],{261:388,262:389,39:$y,338:By}),n(Sr,[2,164]),n(Sr,[2,165]),n(Sr,[2,166]),n(Zt,[2,95]),n(Zt,[2,96]),n(er,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Zt,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,183]),n(Zt,[2,98]),n(er,[2,381],{180:400}),{87:[1,401]},n(Zt,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{29:z,57:403},n(on,[2,193]),{13:f,16:d,55:404,307:43,308:p},{13:f,16:d,44:39,55:40,87:h,139:342,195:405,197:da,307:43,308:p},n(xo,[2,233]),n(xo,[2,234]),n(xo,[2,235]),n(OT,[2,459],{281:406,325:[1,407]}),n(er,[2,463],{284:408,325:[1,409]}),n(er,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:W,171:413,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,419],89:[1,420]},{29:[1,421]},n(kd,[2,302]),n(Nd,[2,367],{167:422}),n(Ld,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(kd,[2,371]),n(fa,[2,122]),n(fa,[2,417]),n(fa,[2,413]),n(fa,[2,414]),n(fa,[2,415]),n(es,[2,125]),n(es,[2,127]),n(es,[2,128]),n(FT,[2,420],{227:426}),n(es,[2,130]),{13:f,16:d,55:194,197:St,223:427,307:43,308:p},{48:[1,428]},n(Co,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(My,[2,288]),{64:[1,433]},n(Ct,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:ie,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(DT,[2,293]),n(Uy,[2,92]),n(Uy,[2,93]),n(Uy,[2,94]),{45:TT,89:AT,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:T,29:I,56:85},{19:438,28:T,29:I,56:85},n(pa,[2,355],{149:439}),n(pa,[2,354]),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,156:440,172:221,185:441,203:442,231:Bd,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(ce,[2,19]),n(Co,[2,21]),{13:f,16:d,44:450,45:NT,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(mc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(q,[2,386],{31:[2,388]}),n(Eu,[2,102]),n(ma,[2,391],{191:452}),n(q,[2,395],{196:453,198:454}),n(q,[2,108]),n(q,[2,109]),n(Eu,[2,103]),n(Eu,[2,104]),n(Eu,[2,390]),{13:f,16:d,44:215,45:nt,48:[1,455],55:220,82:W,87:h,89:it,172:221,185:351,187:350,200:456,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(Ud,[2,424]),n(LT,[2,136]),n(LT,[2,137]),n(Vy,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:da,307:43,308:p},n(xo,[2,219]),n(xo,[2,220]),n(xo,[2,221]),n(xo,[2,222]),n(xo,[2,223]),n(mc,[2,10]),n(Fr,[2,46]),n(Fr,[2,314]),{112:_T,122:459},n(Fr,[2,62]),n(k,ST,{133:242,108:460,112:vT,132:bT}),n(PT,[2,61]),n(Fr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(ha,[2,351],{146:463,335:[1,464]}),{29:z,57:465},n(Ao,[2,329]),n(k,[2,332],{129:466,327:[1,467]}),n(Ao,[2,55]),n(Ao,[2,331]),{48:[1,468]},n(Fd,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(hc,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,243:470,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(hc,[2,156]),{45:xT,89:CT,179:471},n(pc,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,251:472,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Sr,[2,444],{256:473}),n(Sr,[2,446],{258:474}),n(er,[2,442]),n(er,[2,443]),n(Sr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,255:154,257:155,259:475,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,450]),n(er,[2,451]),n(er,[2,379],{178:476}),n(er,[2,378]),n([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:d,44:136,45:ie,46:482,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{48:[1,483]},{48:[1,484]},n(Zt,[2,187]),n(on,[2,194]),{13:f,16:d,44:39,55:40,82:W,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,282:486,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(OT,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,466]),n(Z,[2,40]),n(Nd,[2,298]),n(Tu,[2,87]),n(Tu,[2,88]),n(Tu,[2,89]),n(Tu,[2,90]),{13:f,16:d,55:492,82:W,172:493,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,311:494,312:sn,315:491},n(Z,[2,41]),n(Ld,[2,300]),n(Au,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:W,171:497,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,498],89:[1,499]},{29:[1,500]},n(kd,[2,372]),{13:f,16:d,48:[2,422],55:194,197:St,223:312,226:502,228:501,229:RT,307:43,308:p},n(es,[2,131]),n(es,[2,126]),n(Co,[2,22]),n(Co,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:kT,77:320,78:MT,79:509,87:h,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(DT,[2,294]),n(jT,[2,69]),n(jT,[2,70]),n(Ct,De,{59:197,69:198,20:511,70:G}),n(K,Y,{58:205,62:206,23:512,63:Re}),{29:[2,375],31:[2,71],84:522,85:o,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(pa,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:h}),n(Vd,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:h}),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,172:221,185:351,203:536,212:534,231:Bd,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(K,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:NT,87:h,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(ga,[2,291]),n(ga,[2,24]),n(ga,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(ga,[2,28]),n(K,Y,{58:205,62:206,23:540,63:Re}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(ma,[2,107]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,172:221,185:351,187:350,199:543,200:544,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n($T,[2,132]),n(Ud,[2,425]),n($T,[2,133]),{13:f,16:d,44:354,55:355,82:W,87:h,172:357,237:356,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:358,312:sn,313:545},n(Fr,[2,54]),n(Fr,[2,48]),n(ha,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(ha,[2,68]),n(q,[2,350],{31:BT,112:BT}),n(Fr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(k,[2,333]),n(Xe,[2,16]),n(Fd,[2,152]),n(hc,[2,154]),n(hc,[2,157]),n(pc,[2,159]),n(pc,[2,160],{262:389,261:548,39:$y,338:By}),n(pc,[2,161],{262:389,261:549,39:$y,338:By}),n(Sr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,178]),n(Zt,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{48:[1,554],272:[1,555]},n(Zt,[2,184]),n(Zt,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:d,55:194,197:St,223:562,307:43,308:p},n(qy,[2,224]),n(qy,[2,225]),n(qy,[2,226]),{31:[1,563],45:UT,94:564},n(Z,[2,84]),n(Nd,[2,368]),n(Z,[2,85]),n(Ld,[2,370]),n(Au,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(Co,[2,35],{83:[1,569]}),n(Co,[2,36],{81:[1,570]}),n(My,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:d,45:ie,76:kT,78:MT,87:h,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(gc,[2,295]),{45:ie,77:572},{45:ie,77:573},n(gc,[2,33]),n(gc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(pa,[2,356]),n(VT,[2,357],{152:578,335:[1,579]}),n(Ms,[2,74]),{29:z,57:580},{29:z,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(qT,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},{45:[1,586]},n(Ms,[2,81]),{29:z,57:587},n(pa,[2,73]),n(q,[2,362],{29:js,31:js,85:js,112:js,159:js,160:js,161:js,163:js,164:js}),n(Vd,[2,112]),n(yc,[2,401],{206:588}),n(q,[2,405],{209:589,210:590}),n(q,[2,403]),n(q,[2,404]),n(Vd,[2,113]),n(Vd,[2,400]),{13:f,16:d,44:215,45:$d,48:[1,591],55:220,82:W,87:h,89:it,172:221,185:351,203:536,212:592,231:Bd,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(Ud,[2,426]),n(Vy,[2,138]),n(Vy,[2,139]),{232:[1,593]},n(ga,[2,292]),{47:[1,595],48:[1,594]},n(mc,[2,9]),n(ma,[2,392]),n(ma,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:da,308:p}),n(ma,[2,110],{272:[1,598]}),n(qd,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(Ao,[2,58]),n(Sr,[2,445]),n(Sr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Zt,[2,99]),n(er,[2,382]),n([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),n(Zt,[2,188]),n(Zt,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:W,172:493,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,311:494,312:sn,315:611},n(Z,[2,42]),n(Au,[2,304]),{13:f,16:d,55:414,82:W,95:612,171:613,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,614],45:UT,94:615},n(es,[2,129]),n(FT,[2,421]),{82:[1,616]},{82:[1,617]},n(gc,[2,296]),n(gc,[2,31]),n(gc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(q,IT,{155:330,153:618,154:619,29:$s,31:$s,85:$s,112:$s,159:$s,160:$s,161:$s,163:$s,164:$s}),n(VT,[2,358]),n(Ms,[2,75]),n(Ms,[2,76]),{29:z,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(qT,[2,366]),n(Ms,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Ms,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(yc,[2,117]),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,172:221,185:351,203:536,211:626,212:627,231:Bd,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(ks,[2,134]),n(Ud,[2,427]),n(ks,[2,135]),n(ga,[2,26]),{44:628,87:h},n(ma,[2,106]),n(ma,[2,394]),n(q,[2,396]),n(qd,[2,111]),n(qd,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:da,307:43,308:p},n(jy,[2,217]),n(q,Od,{144:248,140:630,143:631,31:[2,343]}),n(Zt,[2,97]),n(er,[2,380]),n(Zt,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:W,171:637,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},n(WT,[2,305]),n(Z,[2,86]),n(Au,[2,374]),n(Co,[2,37]),n(Co,[2,38]),n(pa,[2,72]),n(pa,[2,360]),n(Ms,[2,77]),{29:z,57:638},{47:[1,639]},{29:[2,376]},n(yc,[2,402]),n(yc,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:h}),n(yc,[2,118],{272:[1,641]}),n(Wd,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:ve,304:be,305:ae,306:we},n(Tu,[2,218]),n(Au,[2,44]),n(WT,[2,306]),n(Ms,[2,78]),{44:651,87:h},n(yc,[2,116]),n(q,[2,406]),n(Wd,[2,119]),n(Wd,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(ga,[2,27]),n(qd,[2,230]),n(GT,[2,345],{141:653,335:[1,654]}),n(Zt,[2,181]),n(Zt,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(q,Od,{144:248,142:657,143:658,31:zT,112:zT}),n(GT,[2,346]),n(Ms,[2,80]),n(Wd,[2,231]),n(ha,[2,67]),n(ha,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:a(function(C,P){if(P.recoverable)this.trace(C);else{var N=new Error(C);throw N.hash=P,N}},"parseError"),parse:a(function(C){var P=this,N=[0],ne=[],Oe=[null],g=[],cn=this.table,_="",ns=0,Iu=0,Qd=0,Kd=2,Pu=1,Yd=g.slice.call(arguments,1),Ut=Object.create(this.lexer),is={yy:{}};for(var Ou in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ou)&&(is.yy[Ou]=this.yy[Ou]);Ut.setInput(C,is.yy),is.yy.lexer=Ut,is.yy.parser=this,typeof Ut.yylloc>"u"&&(Ut.yylloc={});var wc=Ut.yylloc;g.push(wc);var vt=Ut.options&&Ut.options.ranges;typeof is.yy.parseError=="function"?this.parseError=is.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function jt(ss){N.length=N.length-2*ss,Oe.length=Oe.length-ss,g.length=g.length-ss}a(jt,"popStack");for(var st=a(function(){var ss;return ss=Ut.lex()||Pu,typeof ss!="number"&&(ss=P.symbols_[ss]||ss),ss},"lex"),dt,En,va,Hn,HJ,r0,Ec={},Xd,Vs,i2,Jd;;){if(va=N[N.length-1],this.defaultActions[va]?Hn=this.defaultActions[va]:((dt===null||typeof dt>"u")&&(dt=st()),Hn=cn[va]&&cn[va][dt]),typeof Hn>"u"||!Hn.length||!Hn[0]){var n0="";Jd=[];for(Xd in cn[va])this.terminals_[Xd]&&Xd>Kd&&Jd.push("'"+this.terminals_[Xd]+"'");Ut.showPosition?n0="Parse error on line "+(ns+1)+`:
33
+ `)}a(sj,"composeErrorMessage");function oj(n,e,t){let[,r=null]=n.toString().match(/constructor\(([\w, ]+)\)/)||[],i=ij(r,e);return sj(`Cannot inject the dependency ${i} of "${n.name}" constructor. Reason:`,t)}a(oj,"formatErrorCtor");Uh.formatErrorCtor=oj});var xA=S(Vh=>{"use strict";Object.defineProperty(Vh,"__esModule",{value:!0});Vh.isDisposable=void 0;function aj(n){return!(typeof n.dispose!="function"||n.dispose.length>0)}a(aj,"isDisposable");Vh.isDisposable=aj});var RA=S(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.PostResolutionInterceptors=Pa.PreResolutionInterceptors=void 0;var CA=x_(),qh=class extends CA.default{static{a(this,"PreResolutionInterceptors")}};Pa.PreResolutionInterceptors=qh;var Wh=class extends CA.default{static{a(this,"PostResolutionInterceptors")}};Pa.PostResolutionInterceptors=Wh;var F_=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new qh,this.postResolution=new Wh}};Pa.default=F_});var Fo=S(Qs=>{"use strict";Object.defineProperty(Qs,"__esModule",{value:!0});Qs.instance=Qs.typeInfo=void 0;var cj=(Fh(),Zd(Oh)),fn=E_(),lj=EA(),Gh=Mh(),uj=TA(),Cn=y_(),zh=AA(),fj=O_(),dj=kh(),hj=xA(),pj=RA();Qs.typeInfo=new Map;var D_=class n{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new uj.default,this.interceptors=new pj.default,this.disposed=!1,this.disposables=new Set}register(e,t,r={lifecycle:Cn.default.Transient}){this.ensureNotDisposed();let i;if(lj.isProvider(t)?i=t:i={useClass:t},fn.isTokenProvider(i)){let s=[e],o=i;for(;o!=null;){let c=o.useToken;if(s.includes(c))throw new Error(`Token registration cycle detected! ${[...s,c].join(" -> ")}`);s.push(c);let l=this._registry.get(c);l&&fn.isTokenProvider(l.provider)?o=l.provider:o=null}}if((r.lifecycle===Cn.default.Singleton||r.lifecycle==Cn.default.ContainerScoped||r.lifecycle==Cn.default.ResolutionScoped)&&(fn.isValueProvider(i)||fn.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Cn.default[r.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:r}),this}registerType(e,t){return this.ensureNotDisposed(),fn.isNormalToken(t)?this.register(e,{useToken:t}):this.register(e,{useClass:t})}registerInstance(e,t){return this.ensureNotDisposed(),this.register(e,{useValue:t})}registerSingleton(e,t){if(this.ensureNotDisposed(),fn.isNormalToken(e)){if(fn.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Cn.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Cn.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let r=e;return t&&!fn.isNormalToken(t)&&(r=t),this.register(e,{useClass:r},{lifecycle:Cn.default.Singleton})}resolve(e,t=new zh.default,r=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&fn.isNormalToken(e)){if(r)return;throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"Single"),i){let s=this.resolveRegistration(i,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(Gh.isConstructorToken(e)){let s=this.construct(e,t);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")}executePreResolutionInterceptor(e,t){if(this.interceptors.preResolution.has(e)){let r=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&r.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,r)}}executePostResolutionInterceptor(e,t,r){if(this.interceptors.postResolution.has(e)){let i=[];for(let s of this.interceptors.postResolution.getAll(e))s.options.frequency!="Once"&&i.push(s),s.callback(e,t,r);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Cn.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let r=e.options.lifecycle===Cn.default.Singleton,i=e.options.lifecycle===Cn.default.ContainerScoped,s=r||i,o;return fn.isValueProvider(e.provider)?o=e.provider.useValue:fn.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):fn.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):fn.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Cn.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new zh.default,r=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&fn.isNormalToken(e)){if(r)return[];throw new Error(`Attempted to resolve unregistered dependency token: "${e.toString()}"`)}if(this.executePreResolutionInterceptor(e,"All"),i){let o=i.map(c=>this.resolveRegistration(c,t));return this.executePostResolutionInterceptor(e,o,"All"),o}let s=[this.construct(e,t)];return this.executePostResolutionInterceptor(e,s,"All"),s}isRegistered(e,t=!1){return this.ensureNotDisposed(),this._registry.has(e)||t&&(this.parent||!1)&&this.parent.isRegistered(e,!0)}reset(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()}clearInstances(){this.ensureNotDisposed();for(let[e,t]of this._registry.entries())this._registry.setAll(e,t.filter(r=>!fn.isValueProvider(r.provider)).map(r=>(r.instance=void 0,r)))}createChildContainer(){this.ensureNotDisposed();let e=new n(this);for(let[t,r]of this._registry.entries())r.some(({options:i})=>i.lifecycle===Cn.default.ContainerScoped)&&e._registry.setAll(t,r.map(i=>i.options.lifecycle===Cn.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,r={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:r})}afterResolution(e,t,r={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:r})}dispose(){return cj.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let r=t.dispose();r&&e.push(r)}),yield Promise.all(e)})}getRegistration(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null}getAllRegistrations(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null}construct(e,t){if(e instanceof dj.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let r=(()=>{let i=Qs.typeInfo.get(e);if(!i||i.length===0){if(e.length===0)return new e;throw new Error(`TypeInfo not known for "${e.name}"`)}let s=i.map(this.resolveParams(t,e));return new e(...s)})();return hj.isDisposable(r)&&this.disposables.add(r),r}resolveParams(e,t){return(r,i)=>{try{return Gh.isTokenDescriptor(r)?Gh.isTransformDescriptor(r)?r.multiple?this.resolve(r.transform).transform(this.resolveAll(r.token,new zh.default,r.isOptional),...r.transformArgs):this.resolve(r.transform).transform(this.resolve(r.token,e,r.isOptional),...r.transformArgs):r.multiple?this.resolveAll(r.token,new zh.default,r.isOptional):this.resolve(r.token,e,r.isOptional):Gh.isTransformDescriptor(r)?this.resolve(r.transform,e).transform(this.resolve(r.token,e),...r.transformArgs):this.resolve(r,e)}catch(s){throw new Error(fj.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};Qs.instance=new D_;Qs.default=Qs.instance});var IA=S(L_=>{"use strict";Object.defineProperty(L_,"__esModule",{value:!0});var mj=Ra(),Ks=Fo(),N_=Mh(),gj=O_();function yj(){return function(n){let e=mj.getParamInfo(n);return class extends n{constructor(...t){super(...t.concat(e.slice(t.length).map((r,i)=>{try{return N_.isTokenDescriptor(r)?N_.isTransformDescriptor(r)?r.multiple?Ks.instance.resolve(r.transform).transform(Ks.instance.resolveAll(r.token),...r.transformArgs):Ks.instance.resolve(r.transform).transform(Ks.instance.resolve(r.token),...r.transformArgs):r.multiple?Ks.instance.resolveAll(r.token):Ks.instance.resolve(r.token):N_.isTransformDescriptor(r)?Ks.instance.resolve(r.transform).transform(Ks.instance.resolve(r.token),...r.transformArgs):Ks.instance.resolve(r)}catch(s){let o=i+t.length;throw new Error(gj.formatErrorCtor(n,o,s))}})))}}}}a(yj,"autoInjectable");L_.default=yj});var PA=S(k_=>{"use strict";Object.defineProperty(k_,"__esModule",{value:!0});var _j=Ra();function Sj(n,e){let t={token:n,multiple:!1,isOptional:e&&e.isOptional};return _j.defineInjectionTokenMetadata(t)}a(Sj,"inject");k_.default=Sj});var Hh=S(M_=>{"use strict";Object.defineProperty(M_,"__esModule",{value:!0});var vj=Ra(),bj=Fo(),OA=Fo();function wj(n){return function(e){bj.typeInfo.set(e,vj.getParamInfo(e)),n&&n.token&&(Array.isArray(n.token)?n.token.forEach(t=>{OA.instance.register(t,e)}):OA.instance.register(n.token,e))}}a(wj,"injectable");M_.default=wj});var FA=S(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});var Ej=(Fh(),Zd(Oh)),Tj=Fo();function Aj(n=[]){return function(e){return n.forEach(t=>{var{token:r,options:i}=t,s=Ej.__rest(t,["token","options"]);return Tj.instance.register(r,s,i)}),e}}a(Aj,"registry");j_.default=Aj});var DA=S($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});var xj=Hh(),Cj=Fo();function Rj(){return function(n){xj.default()(n),Cj.instance.registerSingleton(n)}}a(Rj,"singleton");$_.default=Rj});var NA=S(B_=>{"use strict";Object.defineProperty(B_,"__esModule",{value:!0});var Ij=Ra();function Pj(n,e){let t={token:n,multiple:!0,isOptional:e&&e.isOptional};return Ij.defineInjectionTokenMetadata(t)}a(Pj,"injectAll");B_.default=Pj});var LA=S(U_=>{"use strict";Object.defineProperty(U_,"__esModule",{value:!0});var Oj=Ra();function Fj(n,e,...t){let r={token:n,multiple:!0,transform:e,transformArgs:t};return Oj.defineInjectionTokenMetadata(r)}a(Fj,"injectAllWithTransform");U_.default=Fj});var kA=S(V_=>{"use strict";Object.defineProperty(V_,"__esModule",{value:!0});var Dj=Ra();function Nj(n,e,...t){return Dj.defineInjectionTokenMetadata(n,{transformToken:e,args:t})}a(Nj,"injectWithTransform");V_.default=Nj});var MA=S(q_=>{"use strict";Object.defineProperty(q_,"__esModule",{value:!0});var Lj=Hh(),kj=Fo();function Mj(n,e){return function(t){Lj.default()(t),kj.instance.register(e||t,t,{lifecycle:n})}}a(Mj,"scoped");q_.default=Mj});var jA=S(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});var jj=IA();Object.defineProperty(hi,"autoInjectable",{enumerable:!0,get:a(function(){return jj.default},"get")});var $j=PA();Object.defineProperty(hi,"inject",{enumerable:!0,get:a(function(){return $j.default},"get")});var Bj=Hh();Object.defineProperty(hi,"injectable",{enumerable:!0,get:a(function(){return Bj.default},"get")});var Uj=FA();Object.defineProperty(hi,"registry",{enumerable:!0,get:a(function(){return Uj.default},"get")});var Vj=DA();Object.defineProperty(hi,"singleton",{enumerable:!0,get:a(function(){return Vj.default},"get")});var qj=NA();Object.defineProperty(hi,"injectAll",{enumerable:!0,get:a(function(){return qj.default},"get")});var Wj=LA();Object.defineProperty(hi,"injectAllWithTransform",{enumerable:!0,get:a(function(){return Wj.default},"get")});var Gj=kA();Object.defineProperty(hi,"injectWithTransform",{enumerable:!0,get:a(function(){return Gj.default},"get")});var zj=MA();Object.defineProperty(hi,"scoped",{enumerable:!0,get:a(function(){return zj.default},"get")})});var $A=S(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});function Hj(n){let e;return t=>(e==null&&(e=n(t)),e)}a(Hj,"instanceCachingFactory");W_.default=Hj});var BA=S(G_=>{"use strict";Object.defineProperty(G_,"__esModule",{value:!0});function Qj(n){let e=new WeakMap;return t=>{let r=e.get(t);return r==null&&(r=n(t),e.set(t,r)),r}}a(Qj,"instancePerContainerCachingFactory");G_.default=Qj});var UA=S(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});function Kj(n,e,t,r=!0){let i,s;return o=>{let c=n(o);return(!r||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(Kj,"predicateAwareClassFactory");z_.default=Kj});var VA=S(Yu=>{"use strict";Object.defineProperty(Yu,"__esModule",{value:!0});var Yj=$A();Object.defineProperty(Yu,"instanceCachingFactory",{enumerable:!0,get:a(function(){return Yj.default},"get")});var Xj=BA();Object.defineProperty(Yu,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return Xj.default},"get")});var Jj=UA();Object.defineProperty(Yu,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return Jj.default},"get")})});var fe=S(Do=>{"use strict";Object.defineProperty(Do,"__esModule",{value:!0});var H_=(Fh(),Zd(Oh));if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Zj=wA();Object.defineProperty(Do,"Lifecycle",{enumerable:!0,get:a(function(){return Zj.Lifecycle},"get")});H_.__exportStar(jA(),Do);H_.__exportStar(VA(),Do);H_.__exportStar(E_(),Do);var e9=kh();Object.defineProperty(Do,"delay",{enumerable:!0,get:a(function(){return e9.delay},"get")});var t9=Fo();Object.defineProperty(Do,"container",{enumerable:!0,get:a(function(){return t9.instance},"get")})});var Oc=S(Qh=>{"use strict";Object.defineProperty(Qh,"__esModule",{value:!0});Qh.NullLogger=void 0;Qh.NullLogger={debug(){},info(){},warn(){},error(){}}});var Q_=S((Ore,qA)=>{var Fc=class{static{a(this,"Wildcard")}constructor(){return r9||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(Fc.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(Fc.prototype,"termType",{enumerable:!0,value:"Wildcard"});var r9=new Fc;qA.exports.Wildcard=Fc});var GA=S((Dre,WA)=>{var n9=(function(){var n=a(function(R,C,P,N){for(P=P||{},N=R.length;N--;P[R[N]]=C);return P},"o"),e=[6,12,13,15,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],t=[2,247],r=[100,110,113,115,116,123,126,131,329,330,331,332,333],i=[2,409],s=[1,18],o=[1,27],c=[13,16,45,197,224,229,308],l=[28,29,53],u=[28,53],f=[1,42],d=[1,45],h=[1,41],p=[1,44],y=[123,126],v=[1,67],b=[39,45,87],w=[13,16,45,197,224,308],T=[1,87],I=[2,281],$=[1,86],q=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],ce=[6,28,29,53,63,70,73,81,83,85],B=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],V=[6,13,16,28,29,45,53,63,70,73,81,82,83,85,87,89,197,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314],F=[6,13,16,28,29,31,39,45,47,48,53,63,70,73,81,82,83,85,87,89,109,112,121,123,126,128,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,337,338,340,341,342,343,344,345,346],k=[13,16,308],te=[112,132,327,334],Ye=[13,16,112,132,308],at=[1,111],Ft=[1,117],ct=[112,132,327,328,334],ut=[13,16,112,132,308,328],Xe=[28,29,45,53,87],ie=[1,138],W=[1,151],ft=[1,128],mt=[1,127],Q=[1,129],Ie=[1,140],qe=[1,141],re=[1,142],We=[1,143],Ge=[1,144],Be=[1,145],ze=[1,147],Ce=[1,148],Ue=[2,457],Pe=[1,158],Ve=[1,159],He=[1,160],de=[1,152],ge=[1,153],ye=[1,156],he=[1,171],pe=[1,172],me=[1,173],ue=[1,174],_e=[1,175],Se=[1,176],ve=[1,167],be=[1,168],ae=[1,169],we=[1,170],tt=[1,157],Qe=[1,166],$e=[1,161],E=[1,162],A=[1,163],x=[1,164],O=[1,165],Z=[6,13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],St=[1,195],Ct=[6,31,73,81,83,85],De=[2,285],G=[1,199],z=[1,201],K=[6,31,70,73,81,83,85],Y=[2,283],Re=[1,207],nt=[1,218],it=[1,223],Or=[1,219],wn=[1,225],Mn=[1,226],sn=[1,224],yT=[6,63,70,73,81,83,85],_T=[1,236],ST=[2,334],vT=[1,243],bT=[1,241],Fr=[6,193],Od=[2,349],wT=[2,339],Ao=[28,128],ET=[47,48,193,272],Fd=[47,48,193,242,272],hc=[47,48,193,242,246,272],pc=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Sr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],TT=[1,271],AT=[1,270],Zt=[6,13,16,29,31,39,45,47,48,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],xT=[1,281],CT=[1,280],on=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],wu=[45,89],Dd=[13,16,29,31,39,45,47,48,82,85,87,89,112,159,160,161,163,164,174,193,197,224,229,231,232,242,246,250,263,265,272,290,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346],Nd=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Ld=[31,89],kd=[48,87],fa=[6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338],es=[6,13,16,39,45,48,82,87,89,231,263,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337,338,340],RT=[1,313],mc=[6,85],My=[6,31,81,83,85],IT=[2,361],Ls=[2,353],da=[1,343],Eu=[31,112,335],ks=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],jy=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335],PT=[6,109,193],ha=[31,112],er=[13,16,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],$y=[1,390],By=[1,391],xo=[13,16,87,197,308,314],OT=[13,16,39,45,82,87,224,263,265,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312,346,347,348,349,350,351],Md=[1,417],jd=[1,418],FT=[13,16,48,197,229,308],Co=[6,31,85],DT=[6,13,16,31,45,73,81,83,85,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],Uy=[6,13,16,29,31,45,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,231,268,269,270,271,273,274,276,277,279,280,283,285,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,346,347,348,349,350,351],pa=[29,31,85,112,159,160,161,163,164],$d=[1,443],Bd=[1,444],NT=[1,449],ma=[31,112,193,232,318,335],Ud=[13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],LT=[13,16,31,45,48,82,87,89,112,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Vy=[13,16,29,31,45,48,82,85,87,89,112,159,160,161,163,164,193,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],Tu=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Au=[31,45],kT=[1,507],MT=[1,508],jT=[6,13,16,29,31,39,45,47,48,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,336,338,341,342,343,344,345,346,347,348,349,350,351],Vd=[29,31,85,112,159,160,161,163,164,335],ga=[6,13,16,31,45,70,73,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],$T=[13,16,31,45,48,82,87,89,112,193,197,231,232,272,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,317,318,335],BT=[2,352],qy=[13,16,197,308,314],UT=[1,565],gc=[6,13,16,31,45,76,78,81,83,85,87,268,269,270,271,273,274,276,277,279,280,283,285,308,346,347,348,349,350,351],VT=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],Ms=[13,16,29,31,45,82,85,87,89,112,159,160,161,163,164,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335],qT=[13,16,87,308],js=[2,364],yc=[29,31,85,112,159,160,161,163,164,193,232,318,335],qd=[31,112,193,232,272,318,335],$s=[2,359],WT=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Wd=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],GT=[13,16,31,45,82,87,89,112,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],zT=[2,347],Wy={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,QueryOrUpdate:3,Prologue:4,QueryOrUpdate_group0:5,EOF:6,Query:7,Qry:8,Query_option0:9,Prologue_repetition0:10,BaseDecl:11,BASE:12,IRIREF:13,PrefixDecl:14,PREFIX:15,PNAME_NS:16,SelectClauseWildcard:17,Qry_repetition0:18,WhereClause:19,SolutionModifierNoGroup:20,SelectClauseVars:21,Qry_repetition1:22,SolutionModifier:23,CONSTRUCT:24,ConstructTemplate:25,Qry_repetition2:26,Qry_repetition3:27,WHERE:28,"{":29,Qry_option0:30,"}":31,DESCRIBE:32,Qry_group0:33,Qry_repetition4:34,Qry_option1:35,ASK:36,Qry_repetition5:37,SelectClauseBase:38,"*":39,SelectClauseVars_repetition_plus0:40,SELECT:41,SelectClauseBase_option0:42,SelectClauseItem:43,Var:44,"(":45,Expression:46,AS:47,")":48,SubSelect:49,SubSelect_option0:50,SubSelect_option1:51,DatasetClause:52,FROM:53,DatasetClause_option0:54,iri:55,WhereClause_option0:56,GroupGraphPattern:57,SolutionModifier_option0:58,SolutionModifierNoGroup_option0:59,SolutionModifierNoGroup_option1:60,SolutionModifierNoGroup_option2:61,GroupClause:62,GROUP:63,BY:64,GroupClause_repetition_plus0:65,GroupCondition:66,BuiltInCall:67,FunctionCall:68,HavingClause:69,HAVING:70,HavingClause_repetition_plus0:71,OrderClause:72,ORDER:73,OrderClause_repetition_plus0:74,OrderCondition:75,ASC:76,BrackettedExpression:77,DESC:78,Constraint:79,LimitOffsetClauses:80,LIMIT:81,INTEGER:82,OFFSET:83,ValuesClause:84,VALUES:85,InlineData:86,VAR:87,InlineData_repetition0:88,NIL:89,InlineData_repetition1:90,InlineData_repetition_plus2:91,InlineData_repetition3:92,DataBlock:93,DataBlockValueList:94,DataBlockValueList_repetition_plus0:95,Update:96,Update_repetition0:97,Update1:98,Update_option0:99,LOAD:100,Update1_option0:101,Update1_option1:102,Update1_group0:103,Update1_option2:104,GraphRefAll:105,Update1_group1:106,Update1_option3:107,GraphOrDefault:108,TO:109,CREATE:110,Update1_option4:111,GRAPH:112,INSERTDATA:113,QuadPattern:114,DELETEDATA:115,DELETEWHERE:116,Update1_option5:117,InsertDeleteClause:118,Update1_repetition0:119,IntoGraphClause:120,INTO:121,GraphRef:122,DELETE:123,InsertDeleteClause_option0:124,InsertClause:125,INSERT:126,UsingClause:127,USING:128,UsingClause_option0:129,WithClause:130,WITH:131,DEFAULT:132,GraphOrDefault_option0:133,GraphRefAll_group0:134,Quads:135,Quads_option0:136,Quads_repetition0:137,QuadsNotTriples:138,VarOrIri:139,QuadsNotTriples_option0:140,QuadsNotTriples_option1:141,QuadsNotTriples_option2:142,TriplesTemplate:143,TriplesTemplate_repetition0:144,TriplesSameSubject:145,TriplesTemplate_option0:146,GroupGraphPatternSub:147,GroupGraphPatternSub_option0:148,GroupGraphPatternSub_repetition0:149,GroupGraphPatternSubTail:150,GraphPatternNotTriples:151,GroupGraphPatternSubTail_option0:152,GroupGraphPatternSubTail_option1:153,TriplesBlock:154,TriplesBlock_repetition0:155,TriplesSameSubjectPath:156,TriplesBlock_option0:157,GroupOrUnionGraphPattern:158,OPTIONAL:159,MINUS:160,SERVICE:161,GraphPatternNotTriples_option0:162,FILTER:163,BIND:164,InlineDataOneVar:165,InlineDataFull:166,InlineDataOneVar_repetition0:167,InlineDataFull_repetition0:168,InlineDataFull_repetition_plus1:169,InlineDataFull_repetition2:170,DataBlockValue:171,Literal:172,QuotedTriple:173,UNDEF:174,GroupOrUnionGraphPattern_repetition0:175,ArgList:176,ArgList_option0:177,ArgList_repetition0:178,ExpressionList:179,ExpressionList_repetition0:180,ConstructTemplate_option0:181,ConstructTriples:182,ConstructTriples_repetition0:183,ConstructTriples_option0:184,VarOrTermOrQuotedTP:185,PropertyListNotEmpty:186,TriplesNode:187,PropertyList:188,PropertyList_option0:189,VerbObjectList:190,PropertyListNotEmpty_repetition0:191,SemiOptionalVerbObjectList:192,";":193,SemiOptionalVerbObjectList_option0:194,Verb:195,ObjectList:196,a:197,ObjectList_repetition0:198,Object:199,GraphNode:200,Object_option0:201,PropertyListPathNotEmpty:202,TriplesNodePath:203,TriplesSameSubjectPath_option0:204,O:205,PropertyListPathNotEmpty_repetition0:206,PropertyListPathNotEmptyTail:207,O_group0:208,ObjectListPath:209,ObjectListPath_repetition0:210,ObjectPath:211,GraphNodePath:212,ObjectPath_option0:213,Path:214,Path_repetition0:215,PathSequence:216,PathSequence_repetition0:217,PathEltOrInverse:218,PathElt:219,PathPrimary:220,PathElt_option0:221,PathEltOrInverse_option0:222,IriOrA:223,"!":224,PathNegatedPropertySet:225,PathOneInPropertySet:226,PathNegatedPropertySet_repetition0:227,PathNegatedPropertySet_option0:228,"^":229,TriplesNode_repetition_plus0:230,"[":231,"]":232,TriplesNodePath_repetition_plus0:233,VarOrTermOrQuotedTPExpr:234,VarOrTerm:235,GraphTerm:236,BlankNode:237,ConditionalOrExpression:238,ConditionalAndExpression:239,ConditionalOrExpression_repetition0:240,ConditionalOrExpressionTail:241,"||":242,RelationalExpression:243,ConditionalAndExpression_repetition0:244,ConditionalAndExpressionTail:245,"&&":246,NumericExpression:247,RelationalExpression_group0:248,RelationalExpression_option0:249,IN:250,MultiplicativeExpression:251,NumericExpression_repetition0:252,AdditiveExpressionTail:253,AdditiveExpressionTail_group0:254,NumericLiteralPositive:255,AdditiveExpressionTail_repetition0:256,NumericLiteralNegative:257,AdditiveExpressionTail_repetition1:258,UnaryExpression:259,MultiplicativeExpression_repetition0:260,MultiplicativeExpressionTail:261,MultiplicativeExpressionTail_group0:262,"+":263,PrimaryExpression:264,"-":265,ExprQuotedTP:266,Aggregate:267,FUNC_ARITY0:268,FUNC_ARITY1:269,FUNC_ARITY1_SPARQL_STAR:270,FUNC_ARITY2:271,",":272,FUNC_ARITY3:273,FUNC_ARITY3_SPARQL_STAR:274,BuiltInCall_group0:275,BOUND:276,BNODE:277,BuiltInCall_option0:278,EXISTS:279,COUNT:280,Aggregate_option0:281,Aggregate_group0:282,FUNC_AGGREGATE:283,Aggregate_option1:284,GROUP_CONCAT:285,Aggregate_option2:286,Aggregate_option3:287,GroupConcatSeparator:288,SEPARATOR:289,"=":290,String:291,LANGTAG:292,"^^":293,DECIMAL:294,DOUBLE:295,BOOLEAN:296,INTEGER_POSITIVE:297,DECIMAL_POSITIVE:298,DOUBLE_POSITIVE:299,INTEGER_NEGATIVE:300,DECIMAL_NEGATIVE:301,DOUBLE_NEGATIVE:302,STRING_LITERAL1:303,STRING_LITERAL2:304,STRING_LITERAL_LONG1:305,STRING_LITERAL_LONG2:306,PrefixedName:307,PNAME_LN:308,BLANK_NODE_LABEL:309,ANON:310,QuotedTP:311,"<<":312,qtSubjectOrObject:313,">>":314,DataValueTerm:315,AnnotationPattern:316,"{|":317,"|}":318,AnnotationPatternPath:319,ExprVarOrTerm:320,QueryOrUpdate_group0_option0:321,Prologue_repetition0_group0:322,Qry_group0_repetition_plus0:323,SelectClauseBase_option0_group0:324,DISTINCT:325,REDUCED:326,NAMED:327,SILENT:328,CLEAR:329,DROP:330,ADD:331,MOVE:332,COPY:333,ALL:334,".":335,UNION:336,"|":337,"/":338,PathElt_option0_group0:339,"?":340,"!=":341,"<":342,">":343,"<=":344,">=":345,NOT:346,CONCAT:347,COALESCE:348,SUBSTR:349,REGEX:350,REPLACE:351,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",12:"BASE",13:"IRIREF",15:"PREFIX",16:"PNAME_NS",24:"CONSTRUCT",28:"WHERE",29:"{",31:"}",32:"DESCRIBE",36:"ASK",39:"*",41:"SELECT",45:"(",47:"AS",48:")",53:"FROM",63:"GROUP",64:"BY",70:"HAVING",73:"ORDER",76:"ASC",78:"DESC",81:"LIMIT",82:"INTEGER",83:"OFFSET",85:"VALUES",87:"VAR",89:"NIL",100:"LOAD",109:"TO",110:"CREATE",112:"GRAPH",113:"INSERTDATA",115:"DELETEDATA",116:"DELETEWHERE",121:"INTO",123:"DELETE",126:"INSERT",128:"USING",131:"WITH",132:"DEFAULT",159:"OPTIONAL",160:"MINUS",161:"SERVICE",163:"FILTER",164:"BIND",174:"UNDEF",193:";",197:"a",224:"!",229:"^",231:"[",232:"]",242:"||",246:"&&",250:"IN",263:"+",265:"-",268:"FUNC_ARITY0",269:"FUNC_ARITY1",270:"FUNC_ARITY1_SPARQL_STAR",271:"FUNC_ARITY2",272:",",273:"FUNC_ARITY3",274:"FUNC_ARITY3_SPARQL_STAR",276:"BOUND",277:"BNODE",279:"EXISTS",280:"COUNT",283:"FUNC_AGGREGATE",285:"GROUP_CONCAT",289:"SEPARATOR",290:"=",292:"LANGTAG",293:"^^",294:"DECIMAL",295:"DOUBLE",296:"BOOLEAN",297:"INTEGER_POSITIVE",298:"DECIMAL_POSITIVE",299:"DOUBLE_POSITIVE",300:"INTEGER_NEGATIVE",301:"DECIMAL_NEGATIVE",302:"DOUBLE_NEGATIVE",303:"STRING_LITERAL1",304:"STRING_LITERAL2",305:"STRING_LITERAL_LONG1",306:"STRING_LITERAL_LONG2",308:"PNAME_LN",309:"BLANK_NODE_LABEL",310:"ANON",312:"<<",314:">>",317:"{|",318:"|}",325:"DISTINCT",326:"REDUCED",327:"NAMED",328:"SILENT",329:"CLEAR",330:"DROP",331:"ADD",332:"MOVE",333:"COPY",334:"ALL",335:".",336:"UNION",337:"|",338:"/",340:"?",341:"!=",342:"<",343:">",344:"<=",345:">=",346:"NOT",347:"CONCAT",348:"COALESCE",349:"SUBSTR",350:"REGEX",351:"REPLACE"},productions_:[0,[3,3],[7,2],[4,1],[11,2],[14,3],[8,4],[8,4],[8,5],[8,7],[8,5],[8,4],[17,2],[21,2],[38,2],[43,1],[43,5],[49,4],[49,4],[52,3],[19,2],[23,2],[20,3],[62,3],[66,1],[66,1],[66,3],[66,5],[66,1],[69,2],[72,3],[75,2],[75,2],[75,1],[75,1],[80,2],[80,2],[80,4],[80,4],[84,2],[86,4],[86,4],[86,6],[86,2],[94,3],[96,3],[98,4],[98,3],[98,5],[98,4],[98,2],[98,2],[98,2],[98,5],[120,2],[118,3],[118,1],[125,2],[127,3],[130,2],[108,1],[108,2],[122,2],[105,1],[105,1],[114,3],[135,2],[138,7],[143,3],[57,3],[57,3],[147,2],[150,3],[154,3],[151,1],[151,2],[151,2],[151,3],[151,4],[151,2],[151,6],[151,1],[93,1],[93,1],[165,4],[166,4],[166,6],[171,1],[171,1],[171,1],[171,1],[158,2],[79,1],[79,1],[79,1],[68,2],[176,1],[176,5],[179,1],[179,4],[25,3],[182,3],[145,2],[145,2],[188,1],[186,2],[192,2],[190,2],[195,1],[195,1],[196,2],[199,2],[156,2],[156,2],[202,2],[207,1],[207,2],[205,2],[209,2],[211,2],[214,2],[216,2],[219,2],[218,2],[220,1],[220,2],[220,3],[225,1],[225,1],[225,4],[226,1],[226,2],[187,3],[187,3],[203,3],[203,3],[200,1],[200,1],[212,1],[212,1],[234,1],[235,1],[235,1],[139,1],[139,1],[44,1],[236,1],[236,1],[236,1],[236,1],[46,1],[238,2],[241,2],[239,2],[245,2],[243,1],[243,3],[243,4],[247,2],[253,2],[253,2],[253,2],[251,2],[261,2],[259,2],[259,2],[259,2],[259,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[264,1],[77,3],[67,1],[67,2],[67,4],[67,4],[67,6],[67,8],[67,8],[67,2],[67,4],[67,2],[67,4],[67,3],[267,5],[267,5],[267,6],[288,4],[172,1],[172,2],[172,3],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[255,1],[255,1],[255,1],[257,1],[257,1],[257,1],[291,1],[291,1],[291,1],[291,1],[55,1],[55,1],[307,1],[307,1],[237,1],[237,1],[311,5],[173,5],[313,1],[313,1],[313,1],[313,1],[313,1],[315,1],[315,1],[315,1],[185,1],[185,1],[185,1],[316,3],[319,3],[266,5],[320,1],[320,1],[320,1],[223,1],[223,1],[321,0],[321,1],[5,1],[5,1],[5,1],[9,0],[9,1],[322,1],[322,1],[10,0],[10,2],[18,0],[18,2],[22,0],[22,2],[26,0],[26,2],[27,0],[27,2],[30,0],[30,1],[323,1],[323,2],[33,1],[33,1],[34,0],[34,2],[35,0],[35,1],[37,0],[37,2],[40,1],[40,2],[324,1],[324,1],[42,0],[42,1],[50,0],[50,1],[51,0],[51,1],[54,0],[54,1],[56,0],[56,1],[58,0],[58,1],[59,0],[59,1],[60,0],[60,1],[61,0],[61,1],[65,1],[65,2],[71,1],[71,2],[74,1],[74,2],[88,0],[88,2],[90,0],[90,2],[91,1],[91,2],[92,0],[92,2],[95,1],[95,2],[97,0],[97,4],[99,0],[99,2],[101,0],[101,1],[102,0],[102,1],[103,1],[103,1],[104,0],[104,1],[106,1],[106,1],[106,1],[107,0],[107,1],[111,0],[111,1],[117,0],[117,1],[119,0],[119,2],[124,0],[124,1],[129,0],[129,1],[133,0],[133,1],[134,1],[134,1],[134,1],[136,0],[136,1],[137,0],[137,2],[140,0],[140,1],[141,0],[141,1],[142,0],[142,1],[144,0],[144,3],[146,0],[146,1],[148,0],[148,1],[149,0],[149,2],[152,0],[152,1],[153,0],[153,1],[155,0],[155,3],[157,0],[157,1],[162,0],[162,1],[167,0],[167,2],[168,0],[168,2],[169,1],[169,2],[170,0],[170,2],[175,0],[175,3],[177,0],[177,1],[178,0],[178,3],[180,0],[180,3],[181,0],[181,1],[183,0],[183,3],[184,0],[184,1],[189,0],[189,1],[191,0],[191,2],[194,0],[194,1],[198,0],[198,3],[201,0],[201,1],[204,0],[204,1],[206,0],[206,2],[208,1],[208,1],[210,0],[210,3],[213,0],[213,1],[215,0],[215,3],[217,0],[217,3],[339,1],[339,1],[339,1],[221,0],[221,1],[222,0],[222,1],[227,0],[227,3],[228,0],[228,1],[230,1],[230,2],[233,1],[233,2],[240,0],[240,2],[244,0],[244,2],[248,1],[248,1],[248,1],[248,1],[248,1],[248,1],[249,0],[249,1],[252,0],[252,2],[254,1],[254,1],[256,0],[256,2],[258,0],[258,2],[260,0],[260,2],[262,1],[262,1],[275,1],[275,1],[275,1],[275,1],[275,1],[278,0],[278,1],[281,0],[281,1],[282,1],[282,1],[284,0],[284,1],[286,0],[286,1],[287,0],[287,1]],performAction:a(function(C,P,N,ne,Oe,g,cn){var _=g.length-1;switch(Oe){case 1:if(g[_-1]=g[_-1]||{},ke.base&&(g[_-1].base=ke.base),ke.base="",g[_-1].prefixes=ke.prefixes,ke.prefixes=null,ke.pathOnly){if(g[_-1].type==="path"||"termType"in g[_-1])return g[_-1];throw new Error("Received full SPARQL query in path only mode")}else if(g[_-1].type==="path"||"termType"in g[_-1])throw new Error("Received only path in full SPARQL mode");if(g[_-1].type==="update"){let vt={};for(let jt of g[_-1].updates)if(jt.updateType==="insert"){let st={};for(let dt of jt.insert)if(dt.type==="bgp"||dt.type==="graph")for(let En of dt.triples)En.subject.termType==="BlankNode"&&(st[En.subject.value]=!0),En.predicate.termType==="BlankNode"&&(st[En.predicate.value]=!0),En.object.termType==="BlankNode"&&(st[En.object.value]=!0);for(let dt of Object.keys(st)){if(vt[dt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");vt[dt]=!0}}}return g[_-1];case 2:this.$={...g[_-1],...g[_],type:"query"};break;case 4:ke.base=xu(g[_]);break;case 5:ke.prefixes||(ke.prefixes={}),g[_-1]=g[_-1].substr(0,g[_-1].length-1),g[_]=xu(g[_]),ke.prefixes[g[_-1]]=g[_];break;case 6:this.$={...g[_-3],...Sa(g[_-2]),...g[_-1],...g[_]};break;case 7:if(!ke.skipValidation&&(Jy(g[_-3].variables.map(jt=>Xy(jt.expression))).some(jt=>jt.aggregation==="count"&&!(jt.expression instanceof Gd))||g[_].group)){for(let jt of g[_-3].variables)if(jt.termType==="Variable"){if(!g[_].group||!g[_].group.map(st=>bc(st)).includes(bc(jt)))throw Error("Projection of ungrouped variable (?"+bc(jt)+")")}else if(Xy(jt.expression).length===0){let st=cL(jt.expression);for(let dt of st)if(!g[_].group||!g[_].group.map||!g[_].group.map(En=>bc(En)).includes(bc(dt)))throw Error("Use of ungrouped variable in projection of operation (?"+bc(dt)+")")}}let is=g[_-1].where.filter(vt=>vt.type==="query");if(is.length>0){let vt=g[_-3].variables.filter(st=>st.variable&&st.variable.value).map(st=>st.variable.value),jt=Jy(is.map(st=>st.variables)).map(st=>st.value||st.variable.value);for(let st of vt)if(jt.indexOf(st)>=0)throw Error("Target id of 'AS' (?"+st+") already used in subquery")}this.$=Ht(g[_-3],Sa(g[_-2]),g[_-1],g[_]);break;case 8:this.$=Ht({queryType:"CONSTRUCT",template:g[_-3]},Sa(g[_-2]),g[_-1],g[_]);break;case 9:this.$=Ht({queryType:"CONSTRUCT",template:g[_-2]=g[_-2]?g[_-2].triples:[]},Sa(g[_-5]),{where:[{type:"bgp",triples:_a([],g[_-2])}]},g[_]);break;case 10:this.$=Ht({queryType:"DESCRIBE",variables:g[_-3]==="*"?[new Gd]:g[_-3]},Sa(g[_-2]),g[_-1],g[_]);break;case 11:this.$=Ht({queryType:"ASK"},Sa(g[_-2]),g[_-1],g[_]);break;case 12:this.$=Ht(g[_-1],{variables:[new Gd]});break;case 13:let Ou=g[_].map(vt=>vt.value||vt.variable.value),wc=lL(Ou);if(wc.length>0)throw Error("Two or more of the resulting columns have the same name (?"+wc[0]+")");this.$=Ht(g[_-1],{variables:g[_]});break;case 14:this.$=Ht({queryType:"SELECT"},g[_]&&(g[_-1]=an(g[_]),g[_]={},g[_][g[_-1]]=!0,g[_]));break;case 16:case 27:this.$=_c(g[_-3],{variable:g[_-1]});break;case 17:case 18:this.$=Ht(g[_-3],g[_-2],g[_-1],g[_],{type:"query"});break;case 19:case 58:this.$={iri:g[_],named:!!g[_-1]};break;case 20:this.$={where:g[_].patterns};break;case 21:this.$=Ht(g[_-1],g[_]);break;case 22:this.$=Ht(g[_-2],g[_-1],g[_]);break;case 23:this.$={group:g[_]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=_c(g[_]);break;case 26:this.$=_c(g[_-1]);break;case 29:this.$={having:g[_]};break;case 30:this.$={order:g[_]};break;case 32:this.$=_c(g[_],{descending:!0});break;case 35:this.$={limit:vc(g[_])};break;case 36:this.$={offset:vc(g[_])};break;case 37:this.$={limit:vc(g[_-2]),offset:vc(g[_])};break;case 38:this.$={limit:vc(g[_]),offset:vc(g[_-2])};break;case 39:case 43:this.$={type:"values",values:g[_]};break;case 40:case 84:this.$=g[_-1].map(vt=>({[g[_-3]]:vt}));break;case 41:case 85:this.$=g[_-1].map(()=>({}));break;case 42:case 86:var ns=g[_-4].length;g[_-4]=g[_-4].map(Gy),this.$=g[_-1].map(function(vt){if(vt.length!==ns)throw Error("Inconsistent VALUES length");for(var jt={},st=0;st<ns;st++)jt["?"+g[_-4][st].value]=vt[st];return jt});break;case 44:case 65:case 100:case 126:case 175:this.$=g[_-1];break;case 45:this.$={type:"update",updates:Bs(g[_-2],g[_-1])};break;case 46:this.$=Ht({type:"load",silent:!!g[_-2],source:g[_-1]},g[_]&&{destination:g[_]});break;case 47:this.$={type:an(g[_-2]),silent:!!g[_-1],graph:g[_]};break;case 48:this.$={type:an(g[_-4]),silent:!!g[_-3],source:g[_-2],destination:g[_]};break;case 49:this.$={type:"create",silent:!!g[_-2],graph:{type:"graph",name:g[_]}};break;case 50:this.$={updateType:"insert",insert:n2(g[_])};break;case 51:this.$={updateType:"delete",delete:t0(n2(g[_]))};break;case 52:this.$={updateType:"deletewhere",delete:t0(g[_])};break;case 53:this.$={updateType:"insertdelete",...g[_-4],...g[_-3],...Sa(g[_-2],"using"),where:g[_].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=g[_];break;case 55:this.$={delete:t0(g[_-1]),insert:g[_]||[]};break;case 56:this.$={delete:[],insert:g[_]};break;case 59:this.$={graph:g[_]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:g[_]};break;case 64:this.$={[an(g[_])]:!0};break;case 66:this.$=g[_-1]?ts(g[_],[g[_-1]]):ts(g[_]);break;case 67:var Iu=Ht(g[_-3]||{triples:[]},{type:"graph",name:g[_-5]});this.$=g[_]?[Iu,g[_]]:[Iu];break;case 68:case 73:this.$={type:"bgp",triples:ts(g[_-2],[g[_-1]])};break;case 69:this.$={type:"group",patterns:[g[_-1]]};break;case 70:for(let vt of g[_-1].filter(jt=>jt.type==="bind")){let jt=g[_-1].indexOf(vt),st=new Set;for(let dt of g[_-1].slice(0,jt))(dt.type==="group"||dt.type==="bgp")&&t2(dt).forEach(En=>st.add(En));if(st.has(vt.variable.value))throw Error("Variable used to bind is already bound (?"+vt.variable.value+")")}this.$={type:"group",patterns:g[_-1]};break;case 71:this.$=g[_-1]?ts([g[_-1]],g[_]):ts(g[_]);break;case 72:this.$=g[_]?[g[_-2],g[_]]:g[_-2];break;case 75:this.$=Ht(g[_],{type:"optional"});break;case 76:this.$=Ht(g[_],{type:"minus"});break;case 77:this.$=Ht(g[_],{type:"graph",name:g[_-1]});break;case 78:this.$=Ht(g[_],{type:"service",name:g[_-1],silent:!!g[_-2]});break;case 79:this.$={type:"filter",expression:g[_]};break;case 80:this.$={type:"bind",variable:g[_-1],expression:g[_-3]};break;case 89:this.$=Ru(g[_]);break;case 90:this.$=void 0;break;case 91:this.$=g[_-1].length?{type:"union",patterns:ts(g[_-1].map(Hy),[Hy(g[_])])}:g[_];break;case 95:this.$={...g[_],function:g[_-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:Bs(g[_-2],g[_-1]),distinct:!!g[_-3]};break;case 98:case 115:case 128:case 247:case 249:case 251:case 253:case 255:case 263:case 267:case 297:case 299:case 303:case 307:case 328:case 341:case 349:case 355:case 361:case 367:case 369:case 373:case 375:case 379:case 381:case 385:case 391:case 395:case 401:case 405:case 409:case 411:case 420:case 428:case 430:case 440:case 444:case 446:case 448:this.$=[];break;case 99:this.$=Bs(g[_-2],g[_-1]);break;case 101:this.$=ts(g[_-2],[g[_-1]]);break;case 102:case 112:this.$=e0(g[_].map(vt=>Ht(Us(g[_-1]),vt)));break;case 103:this.$=e0(_a(g[_].map(vt=>Ht(Us(g[_-1].entity),vt)),g[_-1].triples));break;case 105:this.$=ts([g[_-1]],g[_]);break;case 106:this.$=ts(g[_]);break;case 107:this.$=Yy(g[_-1],g[_]);break;case 109:case 237:this.$=ke.factory.namedNode(JN);break;case 110:case 118:this.$=Bs(g[_-1],g[_]);break;case 111:this.$=g[_]?{annotation:g[_],object:g[_-1]}:g[_-1];break;case 113:this.$=g[_]?e0(_a(g[_].map(vt=>Ht(Us(g[_-1].entity),vt)),g[_-1].triples)):g[_-1].triples;break;case 114:this.$=Yy(...g[_-1],g[_]);break;case 116:this.$=Yy(...g[_]);break;case 117:case 159:case 163:this.$=[g[_-1],g[_]];break;case 119:this.$=g[_]?{object:g[_-1],annotation:g[_]}:g[_-1];break;case 120:this.$=g[_-1].length?Sc("|",Bs(g[_-1],g[_])):g[_];break;case 121:this.$=g[_-1].length?Sc("/",Bs(g[_-1],g[_])):g[_];break;case 122:this.$=g[_]?Sc(g[_],[g[_-1]]):g[_-1];break;case 123:this.$=g[_-1]?Sc(g[_-1],[g[_]]):g[_];break;case 125:case 131:this.$=Sc(g[_-1],[g[_]]);break;case 129:this.$=Sc("|",Bs(g[_-2],g[_-1]));break;case 132:case 134:this.$=oL(g[_-1]);break;case 133:case 135:this.$=aL(g[_-1]);break;case 140:this.$={entity:g[_],triples:[]};break;case 145:this.$=Gy(g[_]);break;case 149:this.$=ke.factory.namedNode(HT);break;case 151:case 153:case 158:case 162:this.$=zy(g[_-1],g[_]);break;case 152:this.$=["||",g[_]];break;case 154:this.$=["&&",g[_]];break;case 156:this.$=Dr(g[_-1],[g[_-2],g[_]]);break;case 157:this.$=Dr(g[_-2]?"notin":"in",[g[_-3],g[_]]);break;case 160:this.$=["+",zy(g[_-1],g[_])];break;case 161:var Qd=rs(g[_-1].value.replace("-",""),g[_-1].datatype);this.$=["-",zy(Qd,g[_])];break;case 164:this.$=Dr("UPLUS",[g[_]]);break;case 165:this.$=Dr(g[_-1],[g[_]]);break;case 166:this.$=Dr("UMINUS",[g[_]]);break;case 177:this.$=Dr(an(g[_-1]));break;case 178:this.$=Dr(an(g[_-3]),[g[_-1]]);break;case 179:this.$=Ru(Dr(an(g[_-3]),[g[_-1]]));break;case 180:this.$=Dr(an(g[_-5]),[g[_-3],g[_-1]]);break;case 181:this.$=Dr(an(g[_-7]),[g[_-5],g[_-3],g[_-1]]);break;case 182:this.$=Ru(Dr(an(g[_-7]),[g[_-5],g[_-3],g[_-1]]));break;case 183:this.$=Dr(an(g[_-1]),g[_]);break;case 184:this.$=Dr("bound",[Gy(g[_-1])]);break;case 185:this.$=Dr(g[_-1],[]);break;case 186:this.$=Dr(g[_-3],[g[_-1]]);break;case 187:this.$=Dr(g[_-2]?"notexists":"exists",[Hy(g[_])]);break;case 188:case 189:this.$=_c(g[_-1],{type:"aggregate",aggregation:an(g[_-4]),distinct:!!g[_-2]});break;case 190:this.$=_c(g[_-2],{type:"aggregate",aggregation:an(g[_-5]),distinct:!!g[_-3],separator:typeof g[_-1]=="string"?g[_-1]:" "});break;case 192:this.$=rs(g[_]);break;case 193:this.$=rL(g[_-1],an(g[_].substr(1)));break;case 194:this.$=rs(g[_-2],g[_]);break;case 195:case 204:this.$=rs(g[_],QT);break;case 196:case 205:this.$=rs(g[_],KT);break;case 197:case 206:this.$=rs(an(g[_]),YT);break;case 200:this.$=rs(g[_].toLowerCase(),tL);break;case 201:this.$=rs(g[_].substr(1),QT);break;case 202:this.$=rs(g[_].substr(1),KT);break;case 203:this.$=rs(g[_].substr(1).toLowerCase(),YT);break;case 207:case 208:this.$=e2(g[_],1);break;case 209:case 210:this.$=e2(g[_],3);break;case 211:this.$=ke.factory.namedNode(xu(g[_]));break;case 213:var Kd=g[_].indexOf(":"),Pu=g[_].substr(0,Kd),Yd=ke.prefixes[Pu];if(!Yd)throw new Error("Unknown prefix: "+Pu);var Ut=xu(Yd+g[_].substr(Kd+1));this.$=ke.factory.namedNode(Ut);break;case 214:if(g[_]=g[_].substr(0,g[_].length-1),!(g[_]in ke.prefixes))throw new Error("Unknown prefix: "+g[_]);var Ut=xu(ke.prefixes[g[_]]);this.$=ke.factory.namedNode(Ut);break;case 215:this.$=Cu(g[_].replace(/^(_:)/,""));break;case 216:this.$=Cu();break;case 217:case 218:case 232:this.$=Ru(Qy(g[_-3],g[_-2],g[_-1]));break;case 230:case 231:this.$=Ru(g[_-1]);break;case 248:case 250:case 252:case 254:case 256:case 260:case 264:case 268:case 270:case 292:case 294:case 296:case 298:case 300:case 302:case 304:case 306:case 329:case 342:case 356:case 368:case 370:case 372:case 374:case 392:case 402:case 425:case 427:case 429:case 431:case 441:case 445:case 447:case 449:g[_-1].push(g[_]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[g[_]];break;case 308:g[_-3].push(g[_-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:g[_-2].push(g[_-1]);break}},"anonymous"),table:[n(e,t,{3:1,4:2,10:3}),{1:[3]},n(r,[2,307],{5:4,7:5,321:6,214:7,8:8,96:9,215:10,17:11,21:12,97:16,38:17,6:[2,238],13:i,16:i,45:i,197:i,224:i,229:i,308:i,24:[1,13],32:[1,14],36:[1,15],41:s}),n([6,13,16,24,32,36,41,45,100,110,113,115,116,123,126,131,197,224,229,308,329,330,331,332,333],[2,3],{322:19,11:20,14:21,12:[1,22],15:[1,23]}),{6:[1,24]},{6:[2,240]},{6:[2,241]},{6:[2,242]},{6:[2,243],9:25,84:26,85:o},{6:[2,239]},n(c,[2,411],{216:28,217:29}),n(l,[2,249],{18:30}),n(l,[2,251],{22:31}),n(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:h,139:38,307:43,308:p,323:36},n(l,[2,267],{37:46}),n(y,[2,326],{98:47,103:49,106:50,117:55,130:61,100:[1,48],110:[1,51],113:[1,52],115:[1,53],116:[1,54],131:[1,62],329:[1,56],330:[1,57],331:[1,58],332:[1,59],333:[1,60]}),{39:[1,63],40:64,43:65,44:66,45:v,87:h},n(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),n(e,[2,248]),n(e,[2,245]),n(e,[2,246]),{13:[1,72]},{16:[1,73]},{1:[2,1]},{6:[2,2]},{6:[2,244]},{45:[1,77],85:[1,78],86:74,87:[1,75],89:[1,76]},n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],[2,120],{337:[1,79]}),n(w,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:T,29:I,52:84,53:$,56:85},{19:88,28:T,29:I,52:89,53:$,56:85},n(l,[2,253],{26:90}),{28:[1,91],52:92,53:$},n(q,[2,385],{181:93,182:94,183:95,31:[2,383]}),n(ce,[2,263],{34:96}),n(ce,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:h,308:p}),n(ce,[2,262]),n(B,[2,259]),n(V,[2,143]),n(V,[2,144]),n([6,13,16,28,29,31,39,45,47,48,53,63,70,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,197,224,229,231,232,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,314,317,318,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,145]),n(F,[2,211]),n(F,[2,212]),n(F,[2,213]),n(F,[2,214]),{19:98,28:T,29:I,52:99,53:$,56:85},{6:[2,309],99:100,193:[1,101]},n(k,[2,311],{101:102,328:[1,103]}),n(te,[2,317],{104:104,328:[1,105]}),n(Ye,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:at,114:110},{29:at,114:112},{29:at,114:113},{118:114,123:[1,115],125:116,126:Ft},n(ct,[2,315]),n(ct,[2,316]),n(ut,[2,319]),n(ut,[2,320]),n(ut,[2,321]),n(y,[2,327]),{13:f,16:d,55:118,307:43,308:p},n(l,[2,12]),n(l,[2,13],{44:66,43:119,45:v,87:h}),n(Xe,[2,269]),n(Xe,[2,15]),{13:f,16:d,44:136,45:ie,46:120,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(b,[2,14]),n(b,[2,274]),n(b,[2,271]),n(b,[2,272]),n(e,[2,4]),{13:[1,177]},n(Z,[2,39]),{29:[1,178]},{29:[1,179]},{87:[1,181],91:180},{45:[1,187],87:[1,185],89:[1,186],93:182,165:183,166:184},n(c,[2,410]),n([6,13,16,45,48,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,337],[2,121],{338:[1,188]}),{13:f,16:d,45:[1,193],55:194,197:St,219:189,220:190,223:191,224:[1,192],307:43,308:p},n(w,[2,419]),n(Ct,De,{20:196,59:197,69:198,70:G}),n(l,[2,250]),{29:z,57:200},n(k,[2,279],{54:202,327:[1,203]}),{29:[2,282]},n(K,Y,{23:204,58:205,62:206,63:Re}),n(l,[2,252]),{19:208,28:T,29:I,52:209,53:$,56:85},{29:[1,210]},n(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,145:212,172:221,185:213,187:214,231:Or,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(yT,[2,265],{56:85,35:227,52:228,19:229,28:T,29:I,53:$}),n(B,[2,260]),n(K,Y,{58:205,62:206,23:230,63:Re}),n(l,[2,268]),{6:[2,45]},n(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:p},n(k,[2,312]),{105:233,112:_T,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},n(te,[2,318]),n(k,ST,{108:240,133:242,112:vT,132:bT}),n(Ye,[2,323]),{112:[1,244]},{112:[2,325]},n(Fr,[2,50]),n(q,Od,{135:245,136:246,143:247,144:248,31:wT,112:wT}),n(Fr,[2,51]),n(Fr,[2,52]),n(Ao,[2,328],{119:249}),{29:at,114:250},n(Ao,[2,56]),{29:at,114:251},n(y,[2,59]),n(Xe,[2,270]),{47:[1,252]},n(ET,[2,150]),n(Fd,[2,428],{240:253}),n(hc,[2,430],{244:254}),n(hc,[2,155],{248:255,249:256,250:[2,438],290:[1,257],341:[1,258],342:[1,259],343:[1,260],344:[1,261],345:[1,262],346:[1,263]}),n(pc,[2,440],{252:264}),n(Sr,[2,448],{260:265}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:266,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:267,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,255:154,257:155,264:268,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Sr,[2,167]),n(Sr,[2,168]),n(Sr,[2,169]),n(Sr,[2,170],{176:269,45:TT,89:AT}),n(Sr,[2,171]),n(Sr,[2,172]),n(Sr,[2,173]),n(Sr,[2,174]),{13:f,16:d,44:136,45:ie,46:272,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:xT,89:CT,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},n(on,[2,192],{292:[1,286],293:[1,287]}),n(on,[2,195]),n(on,[2,196]),n(on,[2,197]),n(on,[2,198]),n(on,[2,199]),n(on,[2,200]),{13:f,16:d,44:39,55:40,82:W,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},n(wu,[2,452]),n(wu,[2,453]),n(wu,[2,454]),n(wu,[2,455]),n(wu,[2,456]),{279:[2,458]},n(Dd,[2,207]),n(Dd,[2,208]),n(Dd,[2,209]),n(Dd,[2,210]),n(on,[2,201]),n(on,[2,202]),n(on,[2,203]),n(on,[2,204]),n(on,[2,205]),n(on,[2,206]),n(e,[2,5]),n(Nd,[2,297],{88:295}),n(Ld,[2,299],{90:296}),{48:[1,297],87:[1,298]},n(kd,[2,301]),n(Z,[2,43]),n(Z,[2,82]),n(Z,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},n(c,[2,412]),n(fa,[2,123]),n(fa,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),n(es,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:St,223:312,225:308,226:309,229:RT,307:43,308:p},n(c,i,{215:10,214:314}),n(es,[2,236]),n(es,[2,237]),n(mc,[2,6]),n(My,[2,287],{60:315,72:316,73:[1,317]}),n(Ct,[2,286]),{13:f,16:d,45:ie,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n([6,31,63,70,73,81,83,85],[2,20]),n(q,IT,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Ls,31:Ls,85:Ls,112:Ls,159:Ls,160:Ls,161:Ls,163:Ls,164:Ls,41:s}),{13:f,16:d,55:331,307:43,308:p},n(k,[2,280]),n(mc,[2,7]),n(Ct,De,{59:197,69:198,20:332,70:G}),n(K,[2,284]),{64:[1,333]},n(K,Y,{58:205,62:206,23:334,63:Re}),n(l,[2,254]),n(q,Od,{144:248,30:335,143:336,31:[2,257]}),n(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:h,139:342,186:339,190:340,195:341,197:da,307:43,308:p},n(Eu,[2,389],{44:39,55:40,307:43,190:340,195:341,139:342,188:344,189:345,186:346,13:f,16:d,87:h,197:da,308:p}),n(ks,[2,227]),n(ks,[2,228]),n(ks,[2,229]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,172:221,185:351,187:350,200:348,230:347,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},{13:f,16:d,44:39,55:40,87:h,139:342,186:352,190:340,195:341,197:da,307:43,308:p},n(ks,[2,146]),n(ks,[2,147]),n(ks,[2,148]),n(ks,[2,149]),{13:f,16:d,44:354,55:355,82:W,87:h,172:357,237:356,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:358,312:sn,313:353},n(jy,[2,215]),n(jy,[2,216]),n(K,Y,{58:205,62:206,23:359,63:Re}),n(ce,[2,264]),n(yT,[2,266]),n(mc,[2,11]),n(r,[2,308],{6:[2,310]}),n(Fr,[2,313],{102:360,120:361,121:[1,362]}),n(Fr,[2,47]),n(Fr,[2,63]),n(Fr,[2,64]),{13:f,16:d,55:363,307:43,308:p},n(Fr,[2,336]),n(Fr,[2,337]),n(Fr,[2,338]),{109:[1,364]},n(PT,[2,60]),{13:f,16:d,55:365,307:43,308:p},n(k,[2,335]),{13:f,16:d,55:366,307:43,308:p},{31:[1,367]},n(ha,[2,341],{137:368}),n(ha,[2,340]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,145:369,172:221,185:213,187:214,231:Or,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},{28:[1,370],127:371,128:[1,372]},n(Ao,[2,330],{124:373,125:374,126:Ft}),n(Ao,[2,57]),{44:375,87:h},n(ET,[2,151],{241:376,242:[1,377]}),n(Fd,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,247:380,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{250:[1,381]},n(er,[2,432]),n(er,[2,433]),n(er,[2,434]),n(er,[2,435]),n(er,[2,436]),n(er,[2,437]),{250:[2,439]},n([47,48,193,242,246,250,272,290,341,342,343,344,345,346],[2,158],{253:382,254:383,255:384,257:385,263:[1,386],265:[1,387],297:he,298:pe,299:me,300:ue,301:_e,302:Se}),n(pc,[2,162],{261:388,262:389,39:$y,338:By}),n(Sr,[2,164]),n(Sr,[2,165]),n(Sr,[2,166]),n(Zt,[2,95]),n(Zt,[2,96]),n(er,[2,377],{177:392,325:[1,393]}),{48:[1,394]},n(Zt,[2,177]),{13:f,16:d,44:136,45:ie,46:395,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:396,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:397,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:398,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:399,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,183]),n(Zt,[2,98]),n(er,[2,381],{180:400}),{87:[1,401]},n(Zt,[2,185]),{13:f,16:d,44:136,45:ie,46:402,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{29:z,57:403},n(on,[2,193]),{13:f,16:d,55:404,307:43,308:p},{13:f,16:d,44:39,55:40,87:h,139:342,195:405,197:da,307:43,308:p},n(xo,[2,233]),n(xo,[2,234]),n(xo,[2,235]),n(OT,[2,459],{281:406,325:[1,407]}),n(er,[2,463],{284:408,325:[1,409]}),n(er,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:W,171:413,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,419],89:[1,420]},{29:[1,421]},n(kd,[2,302]),n(Nd,[2,367],{167:422}),n(Ld,[2,369],{168:423}),{48:[1,424],87:[1,425]},n(kd,[2,371]),n(fa,[2,122]),n(fa,[2,417]),n(fa,[2,413]),n(fa,[2,414]),n(fa,[2,415]),n(es,[2,125]),n(es,[2,127]),n(es,[2,128]),n(FT,[2,420],{227:426}),n(es,[2,130]),{13:f,16:d,55:194,197:St,223:427,307:43,308:p},{48:[1,428]},n(Co,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),n(My,[2,288]),{64:[1,433]},n(Ct,[2,29],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:434,13:f,16:d,45:ie,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(DT,[2,293]),n(Uy,[2,92]),n(Uy,[2,93]),n(Uy,[2,94]),{45:TT,89:AT,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:T,29:I,56:85},{19:438,28:T,29:I,56:85},n(pa,[2,355],{149:439}),n(pa,[2,354]),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,156:440,172:221,185:441,203:442,231:Bd,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(ce,[2,19]),n(Co,[2,21]),{13:f,16:d,44:450,45:NT,55:323,65:445,66:446,67:447,68:448,87:h,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(mc,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},n(q,[2,386],{31:[2,388]}),n(Eu,[2,102]),n(ma,[2,391],{191:452}),n(q,[2,395],{196:453,198:454}),n(q,[2,108]),n(q,[2,109]),n(Eu,[2,103]),n(Eu,[2,104]),n(Eu,[2,390]),{13:f,16:d,44:215,45:nt,48:[1,455],55:220,82:W,87:h,89:it,172:221,185:351,187:350,200:456,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(Ud,[2,424]),n(LT,[2,136]),n(LT,[2,137]),n(Vy,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:h,139:342,195:458,197:da,307:43,308:p},n(xo,[2,219]),n(xo,[2,220]),n(xo,[2,221]),n(xo,[2,222]),n(xo,[2,223]),n(mc,[2,10]),n(Fr,[2,46]),n(Fr,[2,314]),{112:_T,122:459},n(Fr,[2,62]),n(k,ST,{133:242,108:460,112:vT,132:bT}),n(PT,[2,61]),n(Fr,[2,49]),n([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},n(ha,[2,351],{146:463,335:[1,464]}),{29:z,57:465},n(Ao,[2,329]),n(k,[2,332],{129:466,327:[1,467]}),n(Ao,[2,55]),n(Ao,[2,331]),{48:[1,468]},n(Fd,[2,429]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(hc,[2,431]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,243:470,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(hc,[2,156]),{45:xT,89:CT,179:471},n(pc,[2,441]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,251:472,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Sr,[2,444],{256:473}),n(Sr,[2,446],{258:474}),n(er,[2,442]),n(er,[2,443]),n(Sr,[2,449]),{13:f,16:d,44:136,45:ie,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,255:154,257:155,259:475,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,450]),n(er,[2,451]),n(er,[2,379],{178:476}),n(er,[2,378]),n([6,13,16,29,31,39,45,47,48,73,76,78,81,82,83,85,87,89,112,159,160,161,163,164,193,231,242,246,250,263,265,268,269,270,271,272,273,274,276,277,279,280,283,285,290,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312,335,338,341,342,343,344,345,346,347,348,349,350,351],[2,175]),{48:[1,477]},{48:[1,478]},{272:[1,479]},{272:[1,480]},{272:[1,481]},{13:f,16:d,44:136,45:ie,46:482,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{48:[1,483]},{48:[1,484]},n(Zt,[2,187]),n(on,[2,194]),{13:f,16:d,44:39,55:40,82:W,87:h,139:289,172:291,255:154,257:155,266:290,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,320:485},{13:f,16:d,39:[1,487],44:136,45:ie,46:488,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,282:486,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(OT,[2,460]),{13:f,16:d,44:136,45:ie,46:489,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,464]),{13:f,16:d,44:136,45:ie,46:490,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(er,[2,466]),n(Z,[2,40]),n(Nd,[2,298]),n(Tu,[2,87]),n(Tu,[2,88]),n(Tu,[2,89]),n(Tu,[2,90]),{13:f,16:d,55:492,82:W,172:493,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,311:494,312:sn,315:491},n(Z,[2,41]),n(Ld,[2,300]),n(Au,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:W,171:497,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,498],89:[1,499]},{29:[1,500]},n(kd,[2,372]),{13:f,16:d,48:[2,422],55:194,197:St,223:312,226:502,228:501,229:RT,307:43,308:p},n(es,[2,131]),n(es,[2,126]),n(Co,[2,22]),n(Co,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:ie,55:323,67:321,68:322,74:505,75:506,76:kT,77:320,78:MT,79:509,87:h,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(DT,[2,294]),n(jT,[2,69]),n(jT,[2,70]),n(Ct,De,{59:197,69:198,20:511,70:G}),n(K,Y,{58:205,62:206,23:512,63:Re}),{29:[2,375],31:[2,71],84:522,85:o,112:[1,518],150:513,151:514,158:515,159:[1,516],160:[1,517],161:[1,519],163:[1,520],164:[1,521],175:523},n(pa,[2,363],{157:524,335:[1,525]}),n(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:h}),n(Vd,[2,399],{215:10,205:527,208:528,214:529,44:530,204:531,202:532,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:h}),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,172:221,185:351,203:536,212:534,231:Bd,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:h}),n(K,[2,23],{307:43,267:139,275:146,278:149,55:323,67:447,68:448,44:450,66:538,13:f,16:d,45:NT,87:h,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(ga,[2,291]),n(ga,[2,24]),n(ga,[2,25]),{13:f,16:d,44:136,45:ie,46:539,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(ga,[2,28]),n(K,Y,{58:205,62:206,23:540,63:Re}),n([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),n(ma,[2,107]),{13:f,16:d,44:215,45:nt,55:220,82:W,87:h,89:it,172:221,185:351,187:350,199:543,200:544,231:Or,234:349,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n($T,[2,132]),n(Ud,[2,425]),n($T,[2,133]),{13:f,16:d,44:354,55:355,82:W,87:h,172:357,237:356,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:358,312:sn,313:545},n(Fr,[2,54]),n(Fr,[2,48]),n(ha,[2,342]),{13:f,16:d,44:39,55:40,87:h,139:546,307:43,308:p},n(ha,[2,68]),n(q,[2,350],{31:BT,112:BT}),n(Fr,[2,53]),{13:f,16:d,55:547,307:43,308:p},n(k,[2,333]),n(Xe,[2,16]),n(Fd,[2,152]),n(hc,[2,154]),n(hc,[2,157]),n(pc,[2,159]),n(pc,[2,160],{262:389,261:548,39:$y,338:By}),n(pc,[2,161],{262:389,261:549,39:$y,338:By}),n(Sr,[2,163]),{13:f,16:d,44:136,45:ie,46:550,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,178]),n(Zt,[2,179]),{13:f,16:d,44:136,45:ie,46:551,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:552,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:553,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{48:[1,554],272:[1,555]},n(Zt,[2,184]),n(Zt,[2,186]),{314:[1,556]},{48:[1,557]},{48:[2,461]},{48:[2,462]},{48:[1,558]},{48:[2,467],193:[1,561],287:559,288:560},{13:f,16:d,55:194,197:St,223:562,307:43,308:p},n(qy,[2,224]),n(qy,[2,225]),n(qy,[2,226]),{31:[1,563],45:UT,94:564},n(Z,[2,84]),n(Nd,[2,368]),n(Z,[2,85]),n(Ld,[2,370]),n(Au,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},n(Co,[2,35],{83:[1,569]}),n(Co,[2,36],{81:[1,570]}),n(My,[2,30],{307:43,267:139,275:146,278:149,77:320,67:321,68:322,55:323,79:509,44:510,75:571,13:f,16:d,45:ie,76:kT,78:MT,87:h,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,276:ze,277:Ce,279:Ue,280:Pe,283:Ve,285:He,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O}),n(gc,[2,295]),{45:ie,77:572},{45:ie,77:573},n(gc,[2,33]),n(gc,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},n(pa,[2,356]),n(VT,[2,357],{152:578,335:[1,579]}),n(Ms,[2,74]),{29:z,57:580},{29:z,57:581},{13:f,16:d,44:39,55:40,87:h,139:582,307:43,308:p},n(qT,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:ie,55:323,67:321,68:322,77:320,79:585,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,307:43,308:p,346:Qe,347:$e,348:E,349:A,350:x,351:O},{45:[1,586]},n(Ms,[2,81]),{29:z,57:587},n(pa,[2,73]),n(q,[2,362],{29:js,31:js,85:js,112:js,159:js,160:js,161:js,163:js,164:js}),n(Vd,[2,112]),n(yc,[2,401],{206:588}),n(q,[2,405],{209:589,210:590}),n(q,[2,403]),n(q,[2,404]),n(Vd,[2,113]),n(Vd,[2,400]),{13:f,16:d,44:215,45:$d,48:[1,591],55:220,82:W,87:h,89:it,172:221,185:351,203:536,212:592,231:Bd,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(Ud,[2,426]),n(Vy,[2,138]),n(Vy,[2,139]),{232:[1,593]},n(ga,[2,292]),{47:[1,595],48:[1,594]},n(mc,[2,9]),n(ma,[2,392]),n(ma,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:h,197:da,308:p}),n(ma,[2,110],{272:[1,598]}),n(qd,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},n(Ao,[2,58]),n(Sr,[2,445]),n(Sr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},n(Zt,[2,99]),n(er,[2,382]),n([13,16,39,47,48,87,193,197,242,246,250,263,265,272,290,297,298,299,300,301,302,308,314,338,341,342,343,344,345,346],[2,232]),n(Zt,[2,188]),n(Zt,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:W,172:493,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,311:494,312:sn,315:611},n(Z,[2,42]),n(Au,[2,304]),{13:f,16:d,55:414,82:W,95:612,171:613,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},{31:[1,614],45:UT,94:615},n(es,[2,129]),n(FT,[2,421]),{82:[1,616]},{82:[1,617]},n(gc,[2,296]),n(gc,[2,31]),n(gc,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},n(q,IT,{155:330,153:618,154:619,29:$s,31:$s,85:$s,112:$s,159:$s,160:$s,161:$s,163:$s,164:$s}),n(VT,[2,358]),n(Ms,[2,75]),n(Ms,[2,76]),{29:z,57:620},{13:f,16:d,44:39,55:40,87:h,139:621,307:43,308:p},n(qT,[2,366]),n(Ms,[2,79]),{13:f,16:d,44:136,45:ie,46:622,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Ms,[2,91],{336:[1,623]}),n([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),n(yc,[2,117]),{13:f,16:d,44:215,45:$d,55:220,82:W,87:h,89:it,172:221,185:351,203:536,211:626,212:627,231:Bd,234:535,236:216,237:222,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,309:wn,310:Mn,311:217,312:sn},n(ks,[2,134]),n(Ud,[2,427]),n(ks,[2,135]),n(ga,[2,26]),{44:628,87:h},n(ma,[2,106]),n(ma,[2,394]),n(q,[2,396]),n(qd,[2,111]),n(qd,[2,398]),{13:f,16:d,44:39,55:40,87:h,139:342,186:629,190:340,195:341,197:da,307:43,308:p},n(jy,[2,217]),n(q,Od,{144:248,140:630,143:631,31:[2,343]}),n(Zt,[2,97]),n(er,[2,380]),n(Zt,[2,180]),{13:f,16:d,44:136,45:ie,46:632,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},{13:f,16:d,44:136,45:ie,46:633,55:133,67:132,68:134,77:131,82:W,87:h,172:135,224:ft,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:mt,264:130,265:Q,266:137,267:139,268:Ie,269:qe,270:re,271:We,273:Ge,274:Be,275:146,276:ze,277:Ce,278:149,279:Ue,280:Pe,283:Ve,285:He,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:tt,346:Qe,347:$e,348:E,349:A,350:x,351:O},n(Zt,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:W,171:637,172:415,173:416,174:Md,255:154,257:155,291:150,294:de,295:ge,296:ye,297:he,298:pe,299:me,300:ue,301:_e,302:Se,303:ve,304:be,305:ae,306:we,307:43,308:p,312:jd},n(WT,[2,305]),n(Z,[2,86]),n(Au,[2,374]),n(Co,[2,37]),n(Co,[2,38]),n(pa,[2,72]),n(pa,[2,360]),n(Ms,[2,77]),{29:z,57:638},{47:[1,639]},{29:[2,376]},n(yc,[2,402]),n(yc,[2,115],{215:10,208:528,214:529,44:530,205:640,13:i,16:i,45:i,197:i,224:i,229:i,308:i,87:h}),n(yc,[2,118],{272:[1,641]}),n(Wd,[2,407],{213:642,319:643,317:[1,644]}),{48:[1,645]},{318:[1,646]},{31:[1,647]},{31:[2,344]},{48:[1,648]},{48:[1,649]},{291:650,303:ve,304:be,305:ae,306:we},n(Tu,[2,218]),n(Au,[2,44]),n(WT,[2,306]),n(Ms,[2,78]),{44:651,87:h},n(yc,[2,116]),n(q,[2,406]),n(Wd,[2,119]),n(Wd,[2,408]),n(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:h}),n(ga,[2,27]),n(qd,[2,230]),n(GT,[2,345],{141:653,335:[1,654]}),n(Zt,[2,181]),n(Zt,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},n(q,Od,{144:248,142:657,143:658,31:zT,112:zT}),n(GT,[2,346]),n(Ms,[2,80]),n(Wd,[2,231]),n(ha,[2,67]),n(ha,[2,348])],defaultActions:{5:[2,240],6:[2,241],7:[2,242],9:[2,239],24:[2,1],25:[2,2],26:[2,244],87:[2,282],94:[2,384],100:[2,45],109:[2,325],166:[2,458],263:[2,439],336:[2,258],337:[2,101],487:[2,461],488:[2,462],560:[2,468],574:[2,17],575:[2,276],576:[2,18],577:[2,278],623:[2,376],631:[2,344],650:[2,191]},parseError:a(function(C,P){if(P.recoverable)this.trace(C);else{var N=new Error(C);throw N.hash=P,N}},"parseError"),parse:a(function(C){var P=this,N=[0],ne=[],Oe=[null],g=[],cn=this.table,_="",ns=0,Iu=0,Qd=0,Kd=2,Pu=1,Yd=g.slice.call(arguments,1),Ut=Object.create(this.lexer),is={yy:{}};for(var Ou in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ou)&&(is.yy[Ou]=this.yy[Ou]);Ut.setInput(C,is.yy),is.yy.lexer=Ut,is.yy.parser=this,typeof Ut.yylloc>"u"&&(Ut.yylloc={});var wc=Ut.yylloc;g.push(wc);var vt=Ut.options&&Ut.options.ranges;typeof is.yy.parseError=="function"?this.parseError=is.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function jt(ss){N.length=N.length-2*ss,Oe.length=Oe.length-ss,g.length=g.length-ss}a(jt,"popStack");for(var st=a(function(){var ss;return ss=Ut.lex()||Pu,typeof ss!="number"&&(ss=P.symbols_[ss]||ss),ss},"lex"),dt,En,va,Hn,QJ,r0,Ec={},Xd,Vs,i2,Jd;;){if(va=N[N.length-1],this.defaultActions[va]?Hn=this.defaultActions[va]:((dt===null||typeof dt>"u")&&(dt=st()),Hn=cn[va]&&cn[va][dt]),typeof Hn>"u"||!Hn.length||!Hn[0]){var n0="";Jd=[];for(Xd in cn[va])this.terminals_[Xd]&&Xd>Kd&&Jd.push("'"+this.terminals_[Xd]+"'");Ut.showPosition?n0="Parse error on line "+(ns+1)+`:
34
34
  `+Ut.showPosition()+`
35
35
  Expecting `+Jd.join(", ")+", got '"+(this.terminals_[dt]||dt)+"'":n0="Parse error on line "+(ns+1)+": Unexpected "+(dt==Pu?"end of input":"'"+(this.terminals_[dt]||dt)+"'"),this.parseError(n0,{text:Ut.match,token:this.terminals_[dt]||dt,line:Ut.yylineno,loc:wc,expected:Jd})}if(Hn[0]instanceof Array&&Hn.length>1)throw new Error("Parse Error: multiple actions possible at state: "+va+", token: "+dt);switch(Hn[0]){case 1:N.push(dt),Oe.push(Ut.yytext),g.push(Ut.yylloc),N.push(Hn[1]),dt=null,En?(dt=En,En=null):(Iu=Ut.yyleng,_=Ut.yytext,ns=Ut.yylineno,wc=Ut.yylloc,Qd>0&&Qd--);break;case 2:if(Vs=this.productions_[Hn[1]][1],Ec.$=Oe[Oe.length-Vs],Ec._$={first_line:g[g.length-(Vs||1)].first_line,last_line:g[g.length-1].last_line,first_column:g[g.length-(Vs||1)].first_column,last_column:g[g.length-1].last_column},vt&&(Ec._$.range=[g[g.length-(Vs||1)].range[0],g[g.length-1].range[1]]),r0=this.performAction.apply(Ec,[_,Iu,ns,is.yy,Hn[1],Oe,g].concat(Yd)),typeof r0<"u")return r0;Vs&&(N=N.slice(0,-1*Vs*2),Oe=Oe.slice(0,-1*Vs),g=g.slice(0,-1*Vs)),N.push(this.productions_[Hn[1]][0]),Oe.push(Ec.$),g.push(Ec._$),i2=cn[N[N.length-2]][N[N.length-1]],N.push(i2);break;case 3:return!0}}return!0},"parse")},Gd=Q_().Wildcard,zd="http://www.w3.org/1999/02/22-rdf-syntax-ns#",JN=zd+"type",ZN=zd+"first",eL=zd+"rest",HT=zd+"nil",Hd="http://www.w3.org/2001/XMLSchema#",QT=Hd+"integer",KT=Hd+"decimal",YT=Hd+"double",tL=Hd+"boolean",ya="",XT="",JT="";function an(R){return R.toLowerCase()}a(an,"lowercase");function Bs(R,C){return R.push(C),R}a(Bs,"appendTo");function _a(R,C){return R.push.apply(R,C),R}a(_a,"appendAllTo");function Ht(R){R||(R={});for(var C=1,P=arguments.length,N;C<P&&(N=arguments[C]||{});C++)for(var ne in N)R[ne]=N[ne];return R}a(Ht,"extend");function ts(){for(var R=[],C=0,P=arguments.length;C<P;C++)R=R.concat.apply(R,arguments[C]);return R}a(ts,"unionAll");function xu(R){if(R[0]==="<"&&(R=R.substring(1,R.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(R))return R;if(!ke.base)throw new Error("Cannot resolve relative IRI "+R+" because no base IRI was set.");switch(ya!==ke.base&&(ya=ke.base,XT=ya.replace(/[^\/:]*$/,""),JT=ya.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),R[0]){case void 0:return ya;case"#":return ya+R;case"?":return ya.replace(/(?:\?.*)?$/,R);case"/":return JT+R;default:return XT+R}}a(xu,"resolveIRI");function Gy(R){if(R){var C=R[0];if(C==="?"||C==="$")return ke.factory.variable(R.substr(1))}return R}a(Gy,"toVar");function Dr(R,C){return{type:"operation",operator:R,args:C||[]}}a(Dr,"operation");function _c(R,C){var P={expression:R==="*"?new Gd:R};if(C)for(var N in C)P[N]=C[N];return P}a(_c,"expression");function Sc(R,C){return{type:"path",pathType:R,items:C}}a(Sc,"path");function zy(R,C){for(var P=0,N=C.length,ne;P<N&&(ne=C[P]);P++)R=Dr(ne[0],[R,ne[1]]);return R}a(zy,"createOperationTree");function Sa(R,C){var P=[],N=[],ne=R.length,Oe,g={};if(!ne)return null;for(var cn=0;cn<ne&&(Oe=R[cn]);cn++)(Oe.named?N:P).push(Oe.iri);return g[C||"from"]={default:P,named:N},g}a(Sa,"groupDatasets");function vc(R){return parseInt(R,10)}a(vc,"toInt");function Hy(R){return R.type==="group"&&R.patterns.length===1?R.patterns[0]:R}a(Hy,"degroupSingle");function rs(R,C){return C&&C.termType!=="NamedNode"&&(C=ke.factory.namedNode(C)),ke.factory.literal(R,C)}a(rs,"createTypedLiteral");function rL(R,C){return ke.factory.literal(R,C)}a(rL,"createLangLiteral");function Qy(R,C,P){if(!("termType"in C))throw new Error("Nested triples cannot contain paths");return ke.factory.quad(R,C,P)}a(Qy,"nestedTriple");function Us(R,C,P,N){var ne={};return R!=null&&(ne.subject=R),C!=null&&(ne.predicate=C),P!=null&&(ne.object=P),N!=null&&(ne.annotations=N),ne}a(Us,"triple");function Cu(R){return typeof R=="string"?R.startsWith("e_")?ke.factory.blankNode(R):ke.factory.blankNode("e_"+R):ke.factory.blankNode("g_"+ZT++)}a(Cu,"blank");var ZT=0;ke._resetBlanks=function(){ZT=0};var nL=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,iL={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
36
- `,r:"\r",f:"\f"},sL=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Ky=String.fromCharCode;function e2(R,C){R=R.substring(C,R.length-C);try{R=R.replace(nL,function(P,N,ne,Oe){var g;if(N){if(g=parseInt(N,16),isNaN(g))throw new Error;return Ky(g)}else if(ne){if(g=parseInt(ne,16),isNaN(g))throw new Error;return g<65535?Ky(g):Ky(55296+((g-=65536)>>10),56320+(g&1023))}else{var cn=iL[Oe];if(!cn)throw new Error;return cn}})}catch{return""}if(sL.exec(R))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+R);return R}a(e2,"unescapeString");function oL(R){var C=Cu(),P=C,N=[],ne,Oe=[];R.forEach(function(ns){N.push(ns.entity),_a(Oe,ns.triples)});for(var g=0,cn=0,_=N.length,ne=Array(_*2);g<_;)ne[cn++]=Us(P,ke.factory.namedNode(ZN),N[g]),ne[cn++]=Us(P,ke.factory.namedNode(eL),P=++g<_?Cu():ke.factory.namedNode(HT));return{entity:C,triples:_a(ne,Oe)}}a(oL,"createList");function aL(R){var C=Cu();return{entity:C,triples:R.map(function(P){return Ht(Us(C),P)})}}a(aL,"createAnonymousObject");function Yy(R,C,P){var N=[],ne=[];return C.forEach(function(Oe){let g=null;Oe.annotation&&(g=Oe.annotation,Oe=Oe.object),N.push(Us(null,R,Oe.entity,g)),_a(ne,Oe.triples)}),ts(N,P||[],ne)}a(Yy,"objectListToTriples");function GJ(R){for(var C=[],P,N=0,ne;ne=R[N];N++)switch(ne.type){case"bgp":ne.triples.length&&(P?_a(P.triples,ne.triples):Bs(C,P=ne));break;default:(!ne.patterns||ne.patterns.length>0)&&(Bs(C,ne),P=null)}return C}a(GJ,"mergeAdjacentBGPs");function bc(R){return R.variable?R.variable.value:R.value||R.expression.value}a(bc,"getExpressionId");function Xy(R){if(!R)return[];if(R.type==="aggregate")return[R];if(R.type==="operation"){let C=[];for(let P of R.args)C.push(...Xy(P));return C}return[]}a(Xy,"getAggregatesOfExpression");function cL(R){let C=new Set,P=a(function(N){N&&(N.termType==="Variable"?C.add(N):N.type==="operation"&&N.args.forEach(P))},"visitExpression");return P(R),C}a(cL,"getVariablesFromExpression");function Jy(R,C=1,P=[]){for(let N of R)C>0&&N instanceof Array?Jy(N,C-1,P):P.push(N);return P}a(Jy,"flatten");function Zy(R){return R.termType==="Variable"}a(Zy,"isVariable");function t2(R){if(R.triples){let C=[];for(let P of R.triples)Zy(P.subject)&&C.push(P.subject.value),Zy(P.predicate)&&C.push(P.predicate.value),Zy(P.object)&&C.push(P.object.value);return C}else if(R.patterns){let C=[];for(let P of R.patterns)C.push(...t2(P));return C}return[]}a(t2,"getBoundVarsFromGroupGraphPattern");function lL(R){let C=R.slice().sort(),P=[];for(let N=0;N<C.length-1;N++)C[N+1]==C[N]&&P.push(C[N]);return P}a(lL,"getDuplicatesInArray");function Ru(R){if(!ke.sparqlStar)throw new Error("SPARQL-star support is not enabled");return R}a(Ru,"ensureSparqlStar");function r2(R,C,P){for(let N of C){let ne=Us("subject"in N?N.subject:R,N.predicate,N.object);P.push(ne),N.annotations&&r2(Qy(R,N.predicate,N.object),N.annotations,P)}}a(r2,"_applyAnnotations");function e0(R){if(ke.sparqlStar){let C=[];return R.forEach(P=>{let N=Us(P.subject,P.predicate,P.object);C.push(N),P.annotations&&r2(Qy(P.subject,P.predicate,P.object),P.annotations,C)}),C}return R}a(e0,"applyAnnotations");function zJ(R){if(!ke.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return R}a(zJ,"ensureSparqlStarNestedQuads");function n2(R){for(let C of R){if(C.type==="graph"&&C.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(C.type==="bgp"||C.type==="graph"){for(let P of C.triples)if(P.subject.termType==="Variable"||P.predicate.termType==="Variable"||P.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return R}a(n2,"ensureNoVariables");function t0(R){for(let C of R)if(C.type==="bgp"){for(let P of C.triples)if(P.subject.termType==="BlankNode"||P.predicate.termType==="BlankNode"||P.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return R}a(t0,"ensureNoBnodes");var uL=(function(){var R={EOF:1,parseError:a(function(P,N){if(this.yy.parser)this.yy.parser.parseError(P,N);else throw new Error(P)},"parseError"),setInput:a(function(C,P){return this.yy=P||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var P=C.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:a(function(C){var P=C.length,N=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var ne=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var Oe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===ne.length?this.yylloc.first_column:0)+ne[ne.length-N.length].length-N[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[Oe[0],Oe[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
36
+ `,r:"\r",f:"\f"},sL=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,Ky=String.fromCharCode;function e2(R,C){R=R.substring(C,R.length-C);try{R=R.replace(nL,function(P,N,ne,Oe){var g;if(N){if(g=parseInt(N,16),isNaN(g))throw new Error;return Ky(g)}else if(ne){if(g=parseInt(ne,16),isNaN(g))throw new Error;return g<65535?Ky(g):Ky(55296+((g-=65536)>>10),56320+(g&1023))}else{var cn=iL[Oe];if(!cn)throw new Error;return cn}})}catch{return""}if(sL.exec(R))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+R);return R}a(e2,"unescapeString");function oL(R){var C=Cu(),P=C,N=[],ne,Oe=[];R.forEach(function(ns){N.push(ns.entity),_a(Oe,ns.triples)});for(var g=0,cn=0,_=N.length,ne=Array(_*2);g<_;)ne[cn++]=Us(P,ke.factory.namedNode(ZN),N[g]),ne[cn++]=Us(P,ke.factory.namedNode(eL),P=++g<_?Cu():ke.factory.namedNode(HT));return{entity:C,triples:_a(ne,Oe)}}a(oL,"createList");function aL(R){var C=Cu();return{entity:C,triples:R.map(function(P){return Ht(Us(C),P)})}}a(aL,"createAnonymousObject");function Yy(R,C,P){var N=[],ne=[];return C.forEach(function(Oe){let g=null;Oe.annotation&&(g=Oe.annotation,Oe=Oe.object),N.push(Us(null,R,Oe.entity,g)),_a(ne,Oe.triples)}),ts(N,P||[],ne)}a(Yy,"objectListToTriples");function zJ(R){for(var C=[],P,N=0,ne;ne=R[N];N++)switch(ne.type){case"bgp":ne.triples.length&&(P?_a(P.triples,ne.triples):Bs(C,P=ne));break;default:(!ne.patterns||ne.patterns.length>0)&&(Bs(C,ne),P=null)}return C}a(zJ,"mergeAdjacentBGPs");function bc(R){return R.variable?R.variable.value:R.value||R.expression.value}a(bc,"getExpressionId");function Xy(R){if(!R)return[];if(R.type==="aggregate")return[R];if(R.type==="operation"){let C=[];for(let P of R.args)C.push(...Xy(P));return C}return[]}a(Xy,"getAggregatesOfExpression");function cL(R){let C=new Set,P=a(function(N){N&&(N.termType==="Variable"?C.add(N):N.type==="operation"&&N.args.forEach(P))},"visitExpression");return P(R),C}a(cL,"getVariablesFromExpression");function Jy(R,C=1,P=[]){for(let N of R)C>0&&N instanceof Array?Jy(N,C-1,P):P.push(N);return P}a(Jy,"flatten");function Zy(R){return R.termType==="Variable"}a(Zy,"isVariable");function t2(R){if(R.triples){let C=[];for(let P of R.triples)Zy(P.subject)&&C.push(P.subject.value),Zy(P.predicate)&&C.push(P.predicate.value),Zy(P.object)&&C.push(P.object.value);return C}else if(R.patterns){let C=[];for(let P of R.patterns)C.push(...t2(P));return C}return[]}a(t2,"getBoundVarsFromGroupGraphPattern");function lL(R){let C=R.slice().sort(),P=[];for(let N=0;N<C.length-1;N++)C[N+1]==C[N]&&P.push(C[N]);return P}a(lL,"getDuplicatesInArray");function Ru(R){if(!ke.sparqlStar)throw new Error("SPARQL-star support is not enabled");return R}a(Ru,"ensureSparqlStar");function r2(R,C,P){for(let N of C){let ne=Us("subject"in N?N.subject:R,N.predicate,N.object);P.push(ne),N.annotations&&r2(Qy(R,N.predicate,N.object),N.annotations,P)}}a(r2,"_applyAnnotations");function e0(R){if(ke.sparqlStar){let C=[];return R.forEach(P=>{let N=Us(P.subject,P.predicate,P.object);C.push(N),P.annotations&&r2(Qy(P.subject,P.predicate,P.object),P.annotations,C)}),C}return R}a(e0,"applyAnnotations");function HJ(R){if(!ke.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return R}a(HJ,"ensureSparqlStarNestedQuads");function n2(R){for(let C of R){if(C.type==="graph"&&C.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(C.type==="bgp"||C.type==="graph"){for(let P of C.triples)if(P.subject.termType==="Variable"||P.predicate.termType==="Variable"||P.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return R}a(n2,"ensureNoVariables");function t0(R){for(let C of R)if(C.type==="bgp"){for(let P of C.triples)if(P.subject.termType==="BlankNode"||P.predicate.termType==="BlankNode"||P.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return R}a(t0,"ensureNoBnodes");var uL=(function(){var R={EOF:1,parseError:a(function(P,N){if(this.yy.parser)this.yy.parser.parseError(P,N);else throw new Error(P)},"parseError"),setInput:a(function(C,P){return this.yy=P||this.yy||{},this._input=C,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var C=this._input[0];this.yytext+=C,this.yyleng++,this.offset++,this.match+=C,this.matched+=C;var P=C.match(/(?:\r\n?|\n).*/g);return P?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),C},"input"),unput:a(function(C){var P=C.length,N=C.split(/(?:\r\n?|\n)/g);this._input=C+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-P),this.offset-=P;var ne=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),N.length-1&&(this.yylineno-=N.length-1);var Oe=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:N?(N.length===ne.length?this.yylloc.first_column:0)+ne[ne.length-N.length].length-N[0].length:this.yylloc.first_column-P},this.options.ranges&&(this.yylloc.range=[Oe[0],Oe[0]+this.yyleng-P]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
37
37
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(C){this.unput(this.match.slice(C))},"less"),pastInput:a(function(){var C=this.matched.substr(0,this.matched.length-this.match.length);return(C.length>20?"...":"")+C.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var C=this.match;return C.length<20&&(C+=this._input.substr(0,20-C.length)),(C.substr(0,20)+(C.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var C=this.pastInput(),P=new Array(C.length+1).join("-");return C+this.upcomingInput()+`
38
38
  `+P+"^"},"showPosition"),test_match:a(function(C,P){var N,ne,Oe;if(this.options.backtrack_lexer&&(Oe={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(Oe.yylloc.range=this.yylloc.range.slice(0))),ne=C[0].match(/(?:\r\n?|\n).*/g),ne&&(this.yylineno+=ne.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:ne?ne[ne.length-1].length-ne[ne.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+C[0].length},this.yytext+=C[0],this.match+=C[0],this.matches=C,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(C[0].length),this.matched+=C[0],N=this.performAction.call(this,this.yy,this,P,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),N)return N;if(this._backtrack){for(var g in Oe)this[g]=Oe[g];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var C,P,N,ne;this._more||(this.yytext="",this.match="");for(var Oe=this._currentRules(),g=0;g<Oe.length;g++)if(N=this._input.match(this.rules[Oe[g]]),N&&(!P||N[0].length>P[0].length)){if(P=N,ne=g,this.options.backtrack_lexer){if(C=this.test_match(N,Oe[g]),C!==!1)return C;if(this._backtrack){P=!1;continue}else return!1}else if(!this.options.flex)break}return P?(C=this.test_match(P,Oe[ne]),C!==!1?C:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
39
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var P=this.next();return P||this.lex()},"lex"),begin:a(function(P){this.conditionStack.push(P)},"begin"),popState:a(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:a(function(P){this.begin(P)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(P,N,ne,Oe){var g=Oe;switch(ne){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(N.yytext);break}},"anonymous"),rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};return R})();Wy.lexer=uL;function ke(){this.yy={}}return a(ke,"Parser"),ke.prototype=Wy,Wy.Parser=ke,new ke})();WA.exports=n9});var KA=S((Nre,QA)=>{var i9="http://www.w3.org/2001/XMLSchema#integer",s9="http://www.w3.org/2001/XMLSchema#string";function Rt(n){this._options=n=n||{};var e=n.prefixes||{};this._prefixByIri={};var t=[];for(var r in e){var i=e[r];Xu(i)&&(this._prefixByIri[i]=r,t.push(i))}var s=t.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+s+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=n.sparqlStar,this._indent=Xu(n.indent)?n.indent:" ",this._newline=Xu(n.newline)?n.newline:`
40
- `,this._explicitDatatype=!!n.explicitDatatype}a(Rt,"Generator");Rt.prototype.toQuery=function(n){var e="";return n.queryType&&(e+=n.queryType.toUpperCase()+" "),n.reduced&&(e+="REDUCED "),n.distinct&&(e+="DISTINCT "),n.variables?e+=Bn(n.variables,void 0,function(t){return/^[?$]/.test(t)?t:No(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Kh(t.variable)+")"},this)+" ":n.template&&(e+=this.group(n.template,!0)+this._newline),n.from&&(e+=this.graphs("FROM ",n.from.default)+this.graphs("FROM NAMED ",n.from.named)),n.where&&(e+="WHERE "+this.group(n.where,!0)+this._newline),n.updates&&(e+=Bn(n.updates,";"+this._newline,this.toUpdate,this)),n.group&&(e+="GROUP BY "+Bn(n.group,void 0,function(t){var r=No(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+r+" AS "+Kh(t.variable)+")":r},this)+this._newline),n.having&&(e+="HAVING ("+Bn(n.having,void 0,this.toExpression,this)+")"+this._newline),n.order&&(e+="ORDER BY "+Bn(n.order,void 0,function(t){var r="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+r:r},this)+this._newline),n.offset&&(e+="OFFSET "+n.offset+this._newline),n.limit&&(e+="LIMIT "+n.limit+this._newline),n.values&&(e+=this.values(n)),e=this.baseAndPrefixes(n)+e,e.trim()};Rt.prototype.baseAndPrefixes=function(n){var e=n.base?"BASE <"+n.base+">"+this._newline:"",t="";for(var r in n.prefixes)(this._options.allPrefixes||this._usedPrefixes[r])&&(t+="PREFIX "+r+": <"+n.prefixes[r]+">"+this._newline);return e+t};Rt.prototype.toPattern=function(n){var e=n.type||n instanceof Array&&"array"||(n.subject&&n.predicate&&n.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](n)};Rt.prototype.triple=function(n){return this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+"."};Rt.prototype.array=function(n){return Bn(n,this._newline,this.toPattern,this)};Rt.prototype.bgp=function(n){return this.encodeTriples(n.triples)};Rt.prototype.encodeTriples=function(n){if(!n.length)return"";for(var e=[],t=void 0,r=void 0,i=0;i<n.length;i++){var s=n[i];Oa(s.subject,t)?Oa(s.predicate,r)?e.push(","):(r=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(r))):(t&&e.push("."+this._newline),t=s.subject,r=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(r))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Rt.prototype.graph=function(n){return"GRAPH "+this.toEntity(n.name)+" "+this.group(n)};Rt.prototype.graphs=function(n,e){return!e||e.length===0?"":Bn(e,"",function(t){return n+this.toEntity(t)+this._newline},this)};Rt.prototype.group=function(n,e){return n=e!==!0?this.array(n.patterns||n.triples):this.toPattern(n.type!=="group"?n:n.patterns),n.indexOf(this._newline)===-1?"{ "+n+" }":"{"+this._newline+this.indent(n)+this._newline+"}"};Rt.prototype.query=function(n){return this.toQuery(n)};Rt.prototype.filter=function(n){return"FILTER("+this.toExpression(n.expression)+")"};Rt.prototype.bind=function(n){return"BIND("+this.toExpression(n.expression)+" AS "+Kh(n.variable)+")"};Rt.prototype.optional=function(n){return"OPTIONAL "+this.group(n)};Rt.prototype.union=function(n){return Bn(n.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Rt.prototype.minus=function(n){return"MINUS "+this.group(n)};Rt.prototype.values=function(n){var e=Object.keys(n.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,r;return e.length===1?t=r="":(t="(",r=")"),"VALUES "+t+e.join(" ")+r+" {"+this._newline+Bn(n.values,this._newline,function(i){return" "+t+Bn(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+r},this)+this._newline+"}"};Rt.prototype.service=function(n){return"SERVICE "+(n.silent?"SILENT ":"")+this.toEntity(n.name)+" "+this.group(n)};Rt.prototype.toExpression=function(n){if(No(n))return this.toEntity(n);switch(n.type.toLowerCase()){case"aggregate":return n.aggregation.toUpperCase()+"("+(n.distinct?"DISTINCT ":"")+this.toExpression(n.expression)+(typeof n.separator=="string"?'; SEPARATOR = "'+n.separator.replace(zA,HA)+'"':"")+")";case"functioncall":return this.toEntity(n.function)+"("+Bn(n.args,", ",this.toExpression,this)+")";case"operation":var e=n.operator.toUpperCase(),t=n.args||[];switch(n.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(No(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(No(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(Xu(t[1])?t[1]:Bn(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Bn(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+n.type)}};Rt.prototype.toEntity=function(n){if(No(n))switch(n.termType){case"Wildcard":return"*";case"Variable":return Kh(n);case"BlankNode":return"_:"+n.value;case"Literal":var e=n.value||"",t=n.language||"",r=n.datatype;if(n='"'+e.replace(zA,HA)+'"',t)n+="@"+t;else if(r){if(!this._explicitDatatype)switch(r.value){case s9:return n;case i9:if(/^\d+$/.test(e))return e+" "}n+="^^"+this.encodeIRI(r.value)}return n;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return n.graph&&n.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(n.graph)+" { "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" } >>":"<< "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" >>";default:return this.encodeIRI(n.value)}else{var i=n.items.map(this.toEntity,this),s=n.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var zA=/["\\\t\n\r\b\f]/g,HA=a(function(n){return o9[n]},"escapeReplacer"),o9={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Rt.prototype.encodeIRI=function(n){var e=this._prefixRegex.exec(n);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+n+">"};Rt.prototype.toUpdate=function(n){switch(n.type||n.updateType){case"load":return"LOAD"+(n.source?" "+this.toEntity(n.source):"")+(n.destination?" INTO GRAPH "+this.toEntity(n.destination):"");case"insert":return"INSERT DATA "+this.group(n.insert,!0);case"delete":return"DELETE DATA "+this.group(n.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(n.delete,!0);case"insertdelete":return(n.graph?"WITH "+this.toEntity(n.graph)+this._newline:"")+(n.delete.length?"DELETE "+this.group(n.delete,!0)+this._newline:"")+(n.insert.length?"INSERT "+this.group(n.insert,!0)+this._newline:"")+(n.using?this.graphs("USING ",n.using.default):"")+(n.using?this.graphs("USING NAMED ",n.using.named):"")+"WHERE "+this.group(n.where,!0);case"add":case"copy":case"move":return n.type.toUpperCase()+" "+(n.silent?"SILENT ":"")+(n.source.default?"DEFAULT":this.toEntity(n.source.name))+" TO "+this.toEntity(n.destination.name);case"create":case"clear":case"drop":return n.type.toUpperCase()+(n.silent?" SILENT ":" ")+(n.graph.default?"DEFAULT":n.graph.named?"NAMED":n.graph.all?"ALL":"GRAPH "+this.toEntity(n.graph.name));default:throw new Error("Unknown update query type: "+n.type)}};Rt.prototype.indent=function(n){return n.replace(/^/gm,this._indent)};function Kh(n){return"?"+n.value}a(Kh,"variableToString");function Xu(n){return typeof n=="string"}a(Xu,"isString");function No(n){return typeof n.termType=="string"}a(No,"isTerm");function Oa(n,e){if(!n||!No(n)||!e||!No(e)||n.termType!==e.termType)return!1;switch(n.termType){case"Literal":return n.value===e.value&&n.language===e.language&&Oa(n.datatype,e.datatype);case"Quad":return Oa(n.subject,e.subject)&&Oa(n.predicate,e.predicate)&&Oa(n.object,e.object)&&Oa(n.graph,e.graph);default:return n.value===e.value}}a(Oa,"equalTerms");function Bn(n,e,t,r){return n.map(t,r).join(Xu(e)?e:" ")}a(Bn,"mapJoin");function a9(n={}){return{stringify:a(function(e){var t=Object.create(n);return t.prefixes=e.prefixes,new Rt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Rt(n)},"createGenerator")}}a(a9,"_Generator");QA.exports={Generator:a9}});var Y_=S(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.BlankNode=void 0;var K_=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};Yh.BlankNode=K_});var X_=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.DefaultGraph=void 0;var Ju=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Xh.DefaultGraph=Ju;Ju.INSTANCE=new Ju});var Zh=S(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.NamedNode=void 0;var J_=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};Jh.NamedNode=J_});var Z_=S(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.Literal=void 0;var YA=Zh(),Zu=class n{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=n.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=n.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};ep.Literal=Zu;Zu.RDF_LANGUAGE_STRING=new YA.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");Zu.XSD_STRING=new YA.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var t1=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.Quad=void 0;var e1=class{static{a(this,"Quad")}constructor(e,t,r,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};tp.Quad=e1});var n1=S(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.Variable=void 0;var r1=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};rp.Variable=r1});var JA=S(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.DataFactory=void 0;var c9=Y_(),l9=X_(),XA=Z_(),u9=Zh(),f9=t1(),d9=n1(),h9=0,i1=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${h9++}_`}namedNode(e){return new u9.NamedNode(e)}blankNode(e){return new c9.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new XA.Literal(e,t)}variable(e){return new d9.Variable(e)}defaultGraph(){return l9.DefaultGraph.INSTANCE}quad(e,t,r,i){return new f9.Quad(e,t,r,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(XA.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};np.DataFactory=i1});var ZA=S(Un=>{"use strict";var p9=Un&&Un.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Fa=Un&&Un.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&p9(e,n,t)};Object.defineProperty(Un,"__esModule",{value:!0});Fa(Y_(),Un);Fa(JA(),Un);Fa(X_(),Un);Fa(Z_(),Un);Fa(Zh(),Un);Fa(t1(),Un);Fa(n1(),Un)});var tx=S((Jre,ex)=>{var{Parser:Ys}=GA(),{Generator:m9}=KA(),{Wildcard:g9}=Q_(),{DataFactory:y9}=ZA();function _9({prefixes:n,baseIRI:e,factory:t,pathOnly:r,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in n??{})c[u]=n[u];let l=new Ys;return l.parse=function(){return Ys.base=e||"",Ys.prefixes=Object.create(c),Ys.factory=t||new y9,Ys.sparqlStar=!!i,Ys.pathOnly=!!r,Ys.skipValidation=!!s||!!o,Ys.prototype.parse.apply(l,arguments)},l._resetBlanks=Ys._resetBlanks,l}a(_9,"_Parser");ex.exports={Parser:_9,Generator:m9,Wildcard:g9}});var o1=S(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.CaseWhenTransformerError=Dc.CaseWhenTransformer=void 0;var s1=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new Xs("Too many nested CASE expressions (max 100 iterations)");while(t!==r);return t}stripLineComments(e){let t="",r=0;for(;r<e.length;){let i=e[r];if(i==="'"||i==='"'){let s=i;for(t+=i,r++;r<e.length&&e[r]!==s;){if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++}r<e.length&&(t+=e[r],r++);continue}if(i==="<"){let s=e.indexOf(">",r),o=e.indexOf(`
39
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var P=this.next();return P||this.lex()},"lex"),begin:a(function(P){this.conditionStack.push(P)},"begin"),popState:a(function(){var P=this.conditionStack.length-1;return P>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(P){return P=this.conditionStack.length-1-Math.abs(P||0),P>=0?this.conditionStack[P]:"INITIAL"},"topState"),pushState:a(function(P){this.begin(P)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(P,N,ne,Oe){var g=Oe;switch(ne){case 0:break;case 1:return 12;case 2:return 15;case 3:return 41;case 4:return 325;case 5:return 326;case 6:return 45;case 7:return 47;case 8:return 48;case 9:return 39;case 10:return 24;case 11:return 28;case 12:return 29;case 13:return 31;case 14:return 32;case 15:return 36;case 16:return 53;case 17:return 327;case 18:return 63;case 19:return 64;case 20:return 70;case 21:return 73;case 22:return 76;case 23:return 78;case 24:return 81;case 25:return 83;case 26:return 85;case 27:return 193;case 28:return 100;case 29:return 328;case 30:return 121;case 31:return 329;case 32:return 330;case 33:return 110;case 34:return 331;case 35:return 109;case 36:return 332;case 37:return 333;case 38:return 113;case 39:return 115;case 40:return 116;case 41:return 131;case 42:return 123;case 43:return 126;case 44:return 128;case 45:return 132;case 46:return 112;case 47:return 334;case 48:return 335;case 49:return 159;case 50:return 161;case 51:return 164;case 52:return 174;case 53:return 160;case 54:return 336;case 55:return 163;case 56:return 312;case 57:return 314;case 58:return 317;case 59:return 318;case 60:return 272;case 61:return 197;case 62:return 337;case 63:return 338;case 64:return 229;case 65:return 340;case 66:return 263;case 67:return 224;case 68:return 231;case 69:return 232;case 70:return 242;case 71:return 246;case 72:return 290;case 73:return 341;case 74:return 342;case 75:return 343;case 76:return 344;case 77:return 345;case 78:return 250;case 79:return 346;case 80:return 265;case 81:return 276;case 82:return 277;case 83:return 268;case 84:return 269;case 85:return 270;case 86:return 271;case 87:return 347;case 88:return 348;case 89:return 273;case 90:return 274;case 91:return 350;case 92:return 349;case 93:return 351;case 94:return 279;case 95:return 280;case 96:return 283;case 97:return 285;case 98:return 289;case 99:return 293;case 100:return 296;case 101:return 13;case 102:return 16;case 103:return 308;case 104:return 309;case 105:return 87;case 106:return 292;case 107:return 82;case 108:return 294;case 109:return 295;case 110:return 297;case 111:return 298;case 112:return 299;case 113:return 300;case 114:return 301;case 115:return 302;case 116:return"EXPONENT";case 117:return 303;case 118:return 304;case 119:return 305;case 120:return 306;case 121:return 89;case 122:return 310;case 123:return 6;case 124:return"INVALID";case 125:console.log(N.yytext);break}},"anonymous"),rules:[/^(?:\s+|(#[^\n\r]*))/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)DATA)/i,/^(?:DELETE((\s+|(#[^\n\r]*)\n\r?)+)WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:<<)/i,/^(?:>>)/i,/^(?:\{\|)/i,/^(?:\|\})/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(SUBJECT|PREDICATE|OBJECT|isTRIPLE))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:TRIPLE)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true|false)/i,/^(?:(<(?:[^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:))/i,/^(?:(((([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?)?:)((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|:|((%([0-9A-Fa-f])([0-9A-Fa-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:(?:(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])|\.)*(((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040]))?))/i,/^(?:([\?\$]((?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(?:((?:([A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(?:-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(?:(?:[^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*'))/i,/^(?:("(?:(?:[^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])))*"))/i,/^(?:('''(?:(?:'|'')?(?:[^'\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*'''))/i,/^(?:("""(?:(?:"|"")?(?:[^\"\\]|(\\[tbnrf\\\"']|\\u([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])|\\U([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f])([0-9A-Fa-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],inclusive:!0}}};return R})();Wy.lexer=uL;function ke(){this.yy={}}return a(ke,"Parser"),ke.prototype=Wy,Wy.Parser=ke,new ke})();WA.exports=n9});var KA=S((Lre,QA)=>{var i9="http://www.w3.org/2001/XMLSchema#integer",s9="http://www.w3.org/2001/XMLSchema#string";function Rt(n){this._options=n=n||{};var e=n.prefixes||{};this._prefixByIri={};var t=[];for(var r in e){var i=e[r];Xu(i)&&(this._prefixByIri[i]=r,t.push(i))}var s=t.join("|").replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&");this._prefixRegex=new RegExp("^("+s+")([a-zA-Z][\\-_a-zA-Z0-9]*)$"),this._usedPrefixes={},this._sparqlStar=n.sparqlStar,this._indent=Xu(n.indent)?n.indent:" ",this._newline=Xu(n.newline)?n.newline:`
40
+ `,this._explicitDatatype=!!n.explicitDatatype}a(Rt,"Generator");Rt.prototype.toQuery=function(n){var e="";return n.queryType&&(e+=n.queryType.toUpperCase()+" "),n.reduced&&(e+="REDUCED "),n.distinct&&(e+="DISTINCT "),n.variables?e+=Bn(n.variables,void 0,function(t){return/^[?$]/.test(t)?t:No(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+Kh(t.variable)+")"},this)+" ":n.template&&(e+=this.group(n.template,!0)+this._newline),n.from&&(e+=this.graphs("FROM ",n.from.default)+this.graphs("FROM NAMED ",n.from.named)),n.where&&(e+="WHERE "+this.group(n.where,!0)+this._newline),n.updates&&(e+=Bn(n.updates,";"+this._newline,this.toUpdate,this)),n.group&&(e+="GROUP BY "+Bn(n.group,void 0,function(t){var r=No(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+r+" AS "+Kh(t.variable)+")":r},this)+this._newline),n.having&&(e+="HAVING ("+Bn(n.having,void 0,this.toExpression,this)+")"+this._newline),n.order&&(e+="ORDER BY "+Bn(n.order,void 0,function(t){var r="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+r:r},this)+this._newline),n.offset&&(e+="OFFSET "+n.offset+this._newline),n.limit&&(e+="LIMIT "+n.limit+this._newline),n.values&&(e+=this.values(n)),e=this.baseAndPrefixes(n)+e,e.trim()};Rt.prototype.baseAndPrefixes=function(n){var e=n.base?"BASE <"+n.base+">"+this._newline:"",t="";for(var r in n.prefixes)(this._options.allPrefixes||this._usedPrefixes[r])&&(t+="PREFIX "+r+": <"+n.prefixes[r]+">"+this._newline);return e+t};Rt.prototype.toPattern=function(n){var e=n.type||n instanceof Array&&"array"||(n.subject&&n.predicate&&n.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](n)};Rt.prototype.triple=function(n){return this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+"."};Rt.prototype.array=function(n){return Bn(n,this._newline,this.toPattern,this)};Rt.prototype.bgp=function(n){return this.encodeTriples(n.triples)};Rt.prototype.encodeTriples=function(n){if(!n.length)return"";for(var e=[],t=void 0,r=void 0,i=0;i<n.length;i++){var s=n[i];Oa(s.subject,t)?Oa(s.predicate,r)?e.push(","):(r=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(r))):(t&&e.push("."+this._newline),t=s.subject,r=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(r))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Rt.prototype.graph=function(n){return"GRAPH "+this.toEntity(n.name)+" "+this.group(n)};Rt.prototype.graphs=function(n,e){return!e||e.length===0?"":Bn(e,"",function(t){return n+this.toEntity(t)+this._newline},this)};Rt.prototype.group=function(n,e){return n=e!==!0?this.array(n.patterns||n.triples):this.toPattern(n.type!=="group"?n:n.patterns),n.indexOf(this._newline)===-1?"{ "+n+" }":"{"+this._newline+this.indent(n)+this._newline+"}"};Rt.prototype.query=function(n){return this.toQuery(n)};Rt.prototype.filter=function(n){return"FILTER("+this.toExpression(n.expression)+")"};Rt.prototype.bind=function(n){return"BIND("+this.toExpression(n.expression)+" AS "+Kh(n.variable)+")"};Rt.prototype.optional=function(n){return"OPTIONAL "+this.group(n)};Rt.prototype.union=function(n){return Bn(n.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Rt.prototype.minus=function(n){return"MINUS "+this.group(n)};Rt.prototype.values=function(n){var e=Object.keys(n.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,r;return e.length===1?t=r="":(t="(",r=")"),"VALUES "+t+e.join(" ")+r+" {"+this._newline+Bn(n.values,this._newline,function(i){return" "+t+Bn(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+r},this)+this._newline+"}"};Rt.prototype.service=function(n){return"SERVICE "+(n.silent?"SILENT ":"")+this.toEntity(n.name)+" "+this.group(n)};Rt.prototype.toExpression=function(n){if(No(n))return this.toEntity(n);switch(n.type.toLowerCase()){case"aggregate":return n.aggregation.toUpperCase()+"("+(n.distinct?"DISTINCT ":"")+this.toExpression(n.expression)+(typeof n.separator=="string"?'; SEPARATOR = "'+n.separator.replace(zA,HA)+'"':"")+")";case"functioncall":return this.toEntity(n.function)+"("+Bn(n.args,", ",this.toExpression,this)+")";case"operation":var e=n.operator.toUpperCase(),t=n.args||[];switch(n.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(No(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(No(t[1])?this.toEntity(t[1]):"("+this.toExpression(t[1])+")");case"!":return"!("+this.toExpression(t[0])+")";case"uplus":return"+("+this.toExpression(t[0])+")";case"uminus":return"-("+this.toExpression(t[0])+")";case"notin":e="NOT IN";case"in":return this.toExpression(t[0])+" "+e+"("+(Xu(t[1])?t[1]:Bn(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Bn(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+n.type)}};Rt.prototype.toEntity=function(n){if(No(n))switch(n.termType){case"Wildcard":return"*";case"Variable":return Kh(n);case"BlankNode":return"_:"+n.value;case"Literal":var e=n.value||"",t=n.language||"",r=n.datatype;if(n='"'+e.replace(zA,HA)+'"',t)n+="@"+t;else if(r){if(!this._explicitDatatype)switch(r.value){case s9:return n;case i9:if(/^\d+$/.test(e))return e+" "}n+="^^"+this.encodeIRI(r.value)}return n;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return n.graph&&n.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(n.graph)+" { "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" } >>":"<< "+this.toEntity(n.subject)+" "+this.toEntity(n.predicate)+" "+this.toEntity(n.object)+" >>";default:return this.encodeIRI(n.value)}else{var i=n.items.map(this.toEntity,this),s=n.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var zA=/["\\\t\n\r\b\f]/g,HA=a(function(n){return o9[n]},"escapeReplacer"),o9={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Rt.prototype.encodeIRI=function(n){var e=this._prefixRegex.exec(n);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+n+">"};Rt.prototype.toUpdate=function(n){switch(n.type||n.updateType){case"load":return"LOAD"+(n.source?" "+this.toEntity(n.source):"")+(n.destination?" INTO GRAPH "+this.toEntity(n.destination):"");case"insert":return"INSERT DATA "+this.group(n.insert,!0);case"delete":return"DELETE DATA "+this.group(n.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(n.delete,!0);case"insertdelete":return(n.graph?"WITH "+this.toEntity(n.graph)+this._newline:"")+(n.delete.length?"DELETE "+this.group(n.delete,!0)+this._newline:"")+(n.insert.length?"INSERT "+this.group(n.insert,!0)+this._newline:"")+(n.using?this.graphs("USING ",n.using.default):"")+(n.using?this.graphs("USING NAMED ",n.using.named):"")+"WHERE "+this.group(n.where,!0);case"add":case"copy":case"move":return n.type.toUpperCase()+" "+(n.silent?"SILENT ":"")+(n.source.default?"DEFAULT":this.toEntity(n.source.name))+" TO "+this.toEntity(n.destination.name);case"create":case"clear":case"drop":return n.type.toUpperCase()+(n.silent?" SILENT ":" ")+(n.graph.default?"DEFAULT":n.graph.named?"NAMED":n.graph.all?"ALL":"GRAPH "+this.toEntity(n.graph.name));default:throw new Error("Unknown update query type: "+n.type)}};Rt.prototype.indent=function(n){return n.replace(/^/gm,this._indent)};function Kh(n){return"?"+n.value}a(Kh,"variableToString");function Xu(n){return typeof n=="string"}a(Xu,"isString");function No(n){return typeof n.termType=="string"}a(No,"isTerm");function Oa(n,e){if(!n||!No(n)||!e||!No(e)||n.termType!==e.termType)return!1;switch(n.termType){case"Literal":return n.value===e.value&&n.language===e.language&&Oa(n.datatype,e.datatype);case"Quad":return Oa(n.subject,e.subject)&&Oa(n.predicate,e.predicate)&&Oa(n.object,e.object)&&Oa(n.graph,e.graph);default:return n.value===e.value}}a(Oa,"equalTerms");function Bn(n,e,t,r){return n.map(t,r).join(Xu(e)?e:" ")}a(Bn,"mapJoin");function a9(n={}){return{stringify:a(function(e){var t=Object.create(n);return t.prefixes=e.prefixes,new Rt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Rt(n)},"createGenerator")}}a(a9,"_Generator");QA.exports={Generator:a9}});var Y_=S(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0});Yh.BlankNode=void 0;var K_=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};Yh.BlankNode=K_});var X_=S(Xh=>{"use strict";Object.defineProperty(Xh,"__esModule",{value:!0});Xh.DefaultGraph=void 0;var Ju=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};Xh.DefaultGraph=Ju;Ju.INSTANCE=new Ju});var Zh=S(Jh=>{"use strict";Object.defineProperty(Jh,"__esModule",{value:!0});Jh.NamedNode=void 0;var J_=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};Jh.NamedNode=J_});var Z_=S(ep=>{"use strict";Object.defineProperty(ep,"__esModule",{value:!0});ep.Literal=void 0;var YA=Zh(),Zu=class n{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=n.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=n.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};ep.Literal=Zu;Zu.RDF_LANGUAGE_STRING=new YA.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");Zu.XSD_STRING=new YA.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var t1=S(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});tp.Quad=void 0;var e1=class{static{a(this,"Quad")}constructor(e,t,r,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=r,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}};tp.Quad=e1});var n1=S(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});rp.Variable=void 0;var r1=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};rp.Variable=r1});var JA=S(np=>{"use strict";Object.defineProperty(np,"__esModule",{value:!0});np.DataFactory=void 0;var c9=Y_(),l9=X_(),XA=Z_(),u9=Zh(),f9=t1(),d9=n1(),h9=0,i1=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${h9++}_`}namedNode(e){return new u9.NamedNode(e)}blankNode(e){return new c9.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new XA.Literal(e,t)}variable(e){return new d9.Variable(e)}defaultGraph(){return l9.DefaultGraph.INSTANCE}quad(e,t,r,i){return new f9.Quad(e,t,r,i||this.defaultGraph())}fromTerm(e){switch(e.termType){case"NamedNode":return this.namedNode(e.value);case"BlankNode":return this.blankNode(e.value);case"Literal":return e.language?this.literal(e.value,e.language):e.datatype.equals(XA.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case"Variable":return this.variable(e.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}};np.DataFactory=i1});var ZA=S(Un=>{"use strict";var p9=Un&&Un.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),Fa=Un&&Un.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&p9(e,n,t)};Object.defineProperty(Un,"__esModule",{value:!0});Fa(Y_(),Un);Fa(JA(),Un);Fa(X_(),Un);Fa(Z_(),Un);Fa(Zh(),Un);Fa(t1(),Un);Fa(n1(),Un)});var tx=S((Zre,ex)=>{var{Parser:Ys}=GA(),{Generator:m9}=KA(),{Wildcard:g9}=Q_(),{DataFactory:y9}=ZA();function _9({prefixes:n,baseIRI:e,factory:t,pathOnly:r,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in n??{})c[u]=n[u];let l=new Ys;return l.parse=function(){return Ys.base=e||"",Ys.prefixes=Object.create(c),Ys.factory=t||new y9,Ys.sparqlStar=!!i,Ys.pathOnly=!!r,Ys.skipValidation=!!s||!!o,Ys.prototype.parse.apply(l,arguments)},l._resetBlanks=Ys._resetBlanks,l}a(_9,"_Parser");ex.exports={Parser:_9,Generator:m9,Wildcard:g9}});var o1=S(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.CaseWhenTransformerError=Dc.CaseWhenTransformer=void 0;var s1=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new Xs("Too many nested CASE expressions (max 100 iterations)");while(t!==r);return t}stripLineComments(e){let t="",r=0;for(;r<e.length;){let i=e[r];if(i==="'"||i==='"'){let s=i;for(t+=i,r++;r<e.length&&e[r]!==s;){if(e[r]==="\\"&&r+1<e.length){t+=e[r]+e[r+1],r+=2;continue}t+=e[r],r++}r<e.length&&(t+=e[r],r++);continue}if(i==="<"){let s=e.indexOf(">",r),o=e.indexOf(`
41
41
  `,r);if(s!==-1&&(o===-1||s<o)){t+=e.substring(r,s+1),r=s+1;continue}}if(i==="#"){let s=e.indexOf(`
42
42
  `,r),o=s===-1?e.length:s;t+=" ".repeat(o-r),r=o;continue}t+=i,r++}return t}transformSinglePass(e){let t=this.findCasePositions(e);if(t.length===0)return e;let r=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractCaseExpression(r,s);if(o){let c=this.convertCaseToIf(o.content);r=r.substring(0,s)+c+r.substring(s+o.length)}}return r}findCasePositions(e){let t=[],r=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(r.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){t.push(i),i+=4;continue}i++}return t}extractCaseExpression(e,t){let r=1,i=t+4,s=e.toUpperCase();for(;i<e.length&&r>0;){if(e[i]==="'"||e[i]==='"'){let o=e[i];for(i++;i<e.length&&e[i]!==o;)e[i]==="\\"&&i++,i++;i++;continue}if(s.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){r++,i+=4;continue}if(s.substring(i,i+3)==="END"&&this.isWordBoundary(e,i,3)){if(r--,r===0){let o=e.substring(t,i+3);return{content:o,length:o.length}}i+=3;continue}i++}if(r>0)throw new Xs(`Unclosed CASE expression at position ${t}`);return null}isWordBoundary(e,t,r){let i=t>0?e[t-1]:"",s=t===0||!/[a-zA-Z0-9_?$]/.test(i),o=t+r<e.length?e[t+r]:"",c=t+r>=e.length||!/[a-zA-Z0-9_]/.test(o);return s&&c}convertCaseToIf(e){let t=this.extractWhenClauses(e),r=this.extractElseClause(e);if(t.length===0)throw new Xs("CASE expression must have at least one WHEN clause");let i=r!==null?r:'""';for(let s=t.length-1;s>=0;s--){let{condition:o,result:c}=t[s];i=`IF(${o}, ${c}, ${i})`}return i}extractWhenClauses(e){let t=[],r=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),i=this.findKeywordPositions(r,"WHEN"),s=this.findKeywordPositions(r,"ELSE"),o=s.length>0?s[0]:r.length;for(let c=0;c<i.length;c++){let l=i[c]+4,u=c+1<i.length?i[c+1]:o,f=r.substring(l,u).trim(),d=this.parseWhenClause(f);d&&t.push(d)}return t}findKeywordPositions(e,t){let r=[],i=e.toUpperCase(),s=0,o=0;for(;s<e.length;){let c=e[s];if(c==="'"||c==='"'){let l=c;for(s++;s<e.length&&e[s]!==l;)e[s]==="\\"&&s++,s++;s++;continue}if(c==="("){o++,s++;continue}if(c===")"){o--,s++;continue}if(o===0&&i.substring(s,s+t.length)===t&&this.isWordBoundary(e,s,t.length)){r.push(s),s+=t.length;continue}s++}return r}parseWhenClause(e){let t=this.findKeywordPositions(e,"THEN");if(t.length===0)throw new Xs(`WHEN clause missing THEN keyword: ${e.substring(0,50)}...`);let r=t[0],i=e.substring(0,r).trim(),s=e.substring(r+4).trim();if(!i)throw new Xs("WHEN clause has empty condition");if(!s)throw new Xs("WHEN clause has empty result");return{condition:i,result:s}}extractElseClause(e){let t=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),r=this.findKeywordPositions(t,"ELSE");if(r.length>0){let i=r[0];return t.substring(i+4).trim()}return null}};Dc.CaseWhenTransformer=s1;var Xs=class extends Error{static{a(this,"CaseWhenTransformerError")}constructor(e){super(`CASE WHEN transformation error: ${e}`),this.name="CaseWhenTransformerError"}};Dc.CaseWhenTransformerError=Xs});var a1=S(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.LateralTransformerError=Nc.LateralTransformer=void 0;var ip=class n{static{a(this,"LateralTransformer")}transform(e){let t=e,r,i=0,s=100;do if(r=t,t=this.transformSinglePass(t),i++,i>s)throw new Lo("Too many nested LATERAL joins (max 100 iterations)");while(t!==r);return t}hasLateral(e){return this.findLateralPositions(e).length>0}static isLateralJoin(e){if(e.type==="group"&&e.patterns){for(let t of e.patterns)if(t.type==="query"&&t.queryType==="SELECT"&&t.variables&&Array.isArray(t.variables)){for(let r of t.variables)if(r.termType==="Variable"&&r.value===n.LATERAL_MARKER)return!0}}if(e.type==="query"&&e.queryType==="SELECT"&&e.variables&&Array.isArray(e.variables)){for(let t of e.variables)if(t.termType==="Variable"&&t.value===n.LATERAL_MARKER)return!0}return!1}transformSinglePass(e){let t=this.findLateralPositions(e);if(t.length===0)return e;let r=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractLateralExpression(r,s);if(o){let c=this.transformLateral(o.content);r=r.substring(0,s)+c+r.substring(s+o.length)}}return r}findLateralPositions(e){let t=[],r=e.toUpperCase(),i=0;for(;i<e.length;){if(e[i]==="'"||e[i]==='"'){let s=e[i];for(i++;i<e.length&&e[i]!==s;)e[i]==="\\"&&i++,i++;i++;continue}if(e[i]==="#"){for(;i<e.length&&e[i]!==`
43
43
  `;)i++;continue}if(r.substring(i,i+7)==="LATERAL"&&this.isWordBoundary(e,i,7)){t.push(i),i+=7;continue}i++}return t}extractLateralExpression(e,t){let r=t+7;for(;r<e.length&&/\s/.test(e[r]);)r++;if(e[r]!=="{")throw new Lo(`Expected '{' after LATERAL keyword at position ${t}`);let i=1;for(r++;r<e.length&&i>0;){if(e[r]==="'"||e[r]==='"'){let s=e[r];for(r++;r<e.length&&e[r]!==s;)e[r]==="\\"&&r++,r++;r++;continue}if(e[r]==="#"){for(;r<e.length&&e[r]!==`
@@ -374,7 +374,7 @@ LIMIT ${this.config.defaultLimit}`,s="\u041D\u0435 \u0443\u0434\u0430\u043B\u043
374
374
  `,i=this.composePrefixes(t),s=this.serializePrefixes(i,r),o=this.nTriplesSerializer.serialize(e,{newline:r}).trimEnd();return s?o?`${s}${r}${r}${o}${r}`:`${s}${r}`:o?`${o}${r}`:""}serializePrefixes(e,t){let r=Object.entries(e);return r.length===0?"":r.map(([i,s])=>`@prefix ${i}: <${s}> .`).join(t)}composePrefixes(e){return e.includeDefaultPrefixes??!0?{...x$,...e.prefixes??{}}:{...e.prefixes??{}}}serializeTriplesOnly(e,t){return this.nTriplesSerializer.serializeChunk(e,t).trimEnd()}};vm.TurtleSerializer=zv});var iC=S(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.JSONLDSerializer=void 0;var rC=Ae(),nC=qt(),C$=Ne(),gl=lr(),R$={rdf:gl.Namespace.RDF.iri.value,rdfs:gl.Namespace.RDFS.iri.value,owl:gl.Namespace.OWL.iri.value,xsd:gl.Namespace.XSD.iri.value,exo:gl.Namespace.EXO.iri.value,ems:gl.Namespace.EMS.iri.value},Hv=class{static{a(this,"JSONLDSerializer")}toDocument(e,t={}){let r={...R$,...t.context??{}},i=new Map;for(let s of e){let o=this.subjectToId(s.subject),c=this.compactIri(s.predicate.value,r),l=this.objectToJSONLD(s.object,r),u=i.get(o)??{"@id":o},f=u[c];f===void 0?u[c]=l:Array.isArray(f)?f.push(l):u[c]=[f,l],i.set(o,u)}return{"@context":r,"@graph":Array.from(i.values())}}serialize(e,t={}){let r=this.toDocument(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}subjectToId(e){return e instanceof rC.IRI?e.value:e instanceof nC.BlankNode?`_:${e.id}`:String(e)}compactIri(e,t){for(let[r,i]of Object.entries(t))if(e.startsWith(i)){let s=e.slice(i.length);if(s.length>0)return`${r}:${s}`}return e}objectToJSONLD(e,t){if(e instanceof rC.IRI)return{"@id":e.value};if(e instanceof nC.BlankNode)return{"@id":`_:${e.id}`};if(e instanceof C$.Literal){let r={"@value":e.value};return e.datatype?r["@type"]=this.compactIri(e.datatype.value,t):e.language&&(r["@language"]=e.language,e.hasDirection()&&e.direction&&(r["@direction"]=e.direction)),r}return e}};bm.JSONLDSerializer=Hv});var Yv=S(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.NTriplesParser=void 0;var I$=Yn(),sC=Ae(),Qv=Ne(),P$=qt(),yl=lr(),O$={rdf:yl.Namespace.RDF.iri.value,rdfs:yl.Namespace.RDFS.iri.value,owl:yl.Namespace.OWL.iri.value,xsd:yl.Namespace.XSD.iri.value,exo:yl.Namespace.EXO.iri.value,ems:yl.Namespace.EMS.iri.value},Kv=class{static{a(this,"NTriplesParser")}parse(e,t={}){let r={prefixes:{...O$,...t.prefixes??{}},strict:t.strict??!1},i=[];return e.split(/\r?\n/).forEach((o,c)=>{let l=o.trim();!l||l.startsWith("#")||i.push(this.parseLine(l,c+1,r))}),i}parseLine(e,t,r){if(!e.endsWith("."))throw new Error(`Invalid RDF statement at line ${t}: missing '.' terminator`);let s=e.slice(0,-1).trim(),o=this.parseSubject(s,t,r);s=o.rest.trim();let c=this.parsePredicate(s,t,r);s=c.rest.trim();let l=this.parseObject(s,t,r);if(s=l.rest.trim(),s.length>0)throw new Error(`Unexpected tokens after object at line ${t}`);return new I$.Triple(o.node,c.node,l.node)}parseSubject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):this.consumePrefixedName(e,t,r)}parsePredicate(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):this.consumePrefixedName(e,t,r)}parseObject(e,t,r){return e.startsWith("<")?this.consumeIRI(e,t,r):e.startsWith("_:")?this.consumeBlankNode(e,t):e.startsWith('"')?this.consumeLiteral(e,t,r):this.consumePrefixedName(e,t,r)}consumePrefixedName(e,t,r){let i=e.match(/^([a-zA-Z_][\w-]*):([^\s]+)(?:\s+(.*))?$/);if(!i)throw new Error(`Invalid token at line ${t}: ${e}`);let[,s,o,c]=i,l=r.prefixes[s];if(!l)throw new Error(`Unknown prefix "${s}" at line ${t}`);return{node:new sC.IRI(`${l}${o}`),rest:(c??"").trimStart()}}consumeIRI(e,t,r){let i=this.findClosingBracket(e,"<",">");if(i===-1)throw new Error(`Invalid IRI at line ${t}`);let s=e.slice(1,i),o=new sC.IRI(s),c=e.slice(i+1).trimStart();return{node:o,rest:c}}consumeBlankNode(e,t){let r=e.match(/^_:(\w+)(?:\s+(.*))?$/);if(!r)throw new Error(`Invalid blank node identifier at line ${t}`);let[,i,s]=r;return{node:new P$.BlankNode(i),rest:(s??"").trimStart()}}consumeLiteral(e,t,r){let{value:i,rest:s}=this.consumeQuotedString(e,t),o=s.trimStart();if(o.startsWith("^^")){o=o.slice(2).trimStart();let c=o.startsWith("<")?this.consumeIRI(o,t,r):this.consumePrefixedName(o,t,r);return{node:new Qv.Literal(i,c.node),rest:c.rest}}if(o.startsWith("@")){let c=o.match(/^@([a-zA-Z-]+)(?:\s+(.*))?$/);if(!c)throw new Error(`Invalid language tag at line ${t}`);let[,l,u]=c;return{node:new Qv.Literal(i,void 0,l),rest:(u??"").trimStart()}}return{node:new Qv.Literal(i),rest:o}}consumeQuotedString(e,t){if(!e.startsWith('"'))throw new Error(`Expected quoted string at line ${t}`);let r="";for(let i=1;i<e.length;i++){let s=e[i];if(s==="\\"){if(i+1>=e.length)throw new Error(`Invalid escape sequence at line ${t}`);let o=e[i+1];switch(o){case"t":r+=" ",i+=1;break;case"b":r+="\b",i+=1;break;case"n":r+=`
375
375
  `,i+=1;break;case"r":r+="\r",i+=1;break;case"f":r+="\f",i+=1;break;case'"':r+='"',i+=1;break;case"\\":r+="\\",i+=1;break;case"u":{let c=e.slice(i+2,i+6);if(c.length!==4||!/^[0-9a-fA-F]{4}$/.test(c))throw new Error(`Invalid \\u escape at line ${t}`);r+=String.fromCharCode(parseInt(c,16)),i+=5;break}case"U":{let c=e.slice(i+2,i+10);if(c.length!==8||!/^[0-9a-fA-F]{8}$/.test(c))throw new Error(`Invalid \\U escape at line ${t}`);r+=String.fromCodePoint(parseInt(c,16)),i+=9;break}default:throw new Error(`Unknown escape sequence \\${o} at line ${t}`)}continue}if(s==='"'){let o=e.slice(i+1);return{value:r,rest:o}}r+=s}throw new Error(`Unterminated string literal at line ${t}`)}findClosingBracket(e,t,r){let i=0;for(let s=0;s<e.length;s++){let o=e[s];if(o===t){i++;continue}if(o===r&&(i--,i===0))return s}return-1}};wm.NTriplesParser=Kv});var oC=S(Em=>{"use strict";Object.defineProperty(Em,"__esModule",{value:!0});Em.TurtleParser=void 0;var _l=lr(),F$=Yv(),D$={rdf:_l.Namespace.RDF.iri.value,rdfs:_l.Namespace.RDFS.iri.value,owl:_l.Namespace.OWL.iri.value,xsd:_l.Namespace.XSD.iri.value,exo:_l.Namespace.EXO.iri.value,ems:_l.Namespace.EMS.iri.value},N$=/^@prefix\s+([a-zA-Z_][\w-]*):\s*<([^>]+)>\s*\.$/,Xv=class{static{a(this,"TurtleParser")}constructor(){this.nTriplesParser=new F$.NTriplesParser}parse(e,t={}){let r={...D$,...t.prefixes??{}},i=this.collectStatements(e),s=[];return i.forEach(({statement:o,lineNumber:c})=>{if(this.isPrefixStatement(o)){let u=o.match(N$);if(!u)throw new Error(`Invalid prefix declaration at line ${c}`);let[,f,d]=u;r[f]=d;return}if(o.includes(";")||o.includes(","))throw new Error(`Complex Turtle statements with ';' or ',' are not supported (line ${c})`);let l=this.normalizeShortcuts(o);s.push(this.nTriplesParser.parseLine(l,c,{prefixes:r,strict:!1}))}),s}collectStatements(e){let t=e.split(/\r?\n/),r=[],i="",s=0;if(t.forEach((o,c)=>{let l=o.trim();!l||l.startsWith("#")||(i||(s=c+1),i=i?`${i} ${l}`:l,l.endsWith(".")&&(r.push({statement:i,lineNumber:s}),i=""))}),i)throw new Error(`Unterminated Turtle statement near line ${s}`);return r}isPrefixStatement(e){return e.startsWith("@prefix")}normalizeShortcuts(e){return e.includes(" a ")?e.replace(/\sa\s/g," rdf:type "):e}};Em.TurtleParser=Xv});var aC=S(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.RDFSerializer=void 0;var Sl=Yn(),Ha=Ae(),Qa=Ne(),Jv=qt(),Ss=lr(),L$=tC(),k$=Gv(),M$=iC(),j$=oC(),$$=Yv(),B$=1024,U$=`
376
376
  `,V$={rdf:Ss.Namespace.RDF.iri.value,rdfs:Ss.Namespace.RDFS.iri.value,owl:Ss.Namespace.OWL.iri.value,xsd:Ss.Namespace.XSD.iri.value,exo:Ss.Namespace.EXO.iri.value,ems:Ss.Namespace.EMS.iri.value},Zv=class{static{a(this,"RDFSerializer")}constructor(e){this.store=e,this.turtleSerializer=new L$.TurtleSerializer,this.nTriplesSerializer=new k$.NTriplesSerializer,this.jsonldSerializer=new M$.JSONLDSerializer,this.turtleParser=new j$.TurtleParser,this.nTriplesParser=new $$.NTriplesParser}async serialize(e,t={}){let r=await this.store.match();return this.serializeTriples(r,e,t)}serializeTriples(e,t,r={}){switch(t){case"turtle":return this.turtleSerializer.serialize(e,{prefixes:r.prefixes,includeDefaultPrefixes:r.includeDefaultPrefixes,newline:r.newline});case"n-triples":return this.nTriplesSerializer.serialize(e,{newline:r.newline});case"json-ld":return this.jsonldSerializer.serialize(e,{context:r.prefixes,pretty:r.pretty,indent:r.indent});default:throw new Error(`Unsupported serialization format: ${t}`)}}stream(e,t={}){let r=t.newline??U$,i=t.batchSize??B$,s=t.includeDefaultPrefixes,o=t.prefixes,c=this,l=!1,u=[],f=[],d=0,h=a(async()=>{if(!l){if(f=await c.store.match(),e==="json-ld"){let y=c.jsonldSerializer.toDocument(f,{context:o,pretty:!1});u.push(...c.buildJsonLdChunks(y))}else if(e==="turtle"){let y=c.turtleSerializer.serializePrefixes(c.composePrefixes(o,s),r);y&&u.push(`${y}${r}${r}`)}l=!0}},"ensureInitialized");return{async next(){if(await h(),u.length>0)return{value:u.shift(),done:!1};if(e==="json-ld")return{value:void 0,done:!0};if(d>=f.length)return{value:void 0,done:!0};let y=f.slice(d,d+i);d+=y.length;let v="";if(e==="turtle"){let b=c.turtleSerializer.serializeTriplesOnly(y,r);b&&(v=`${b}${r}`)}else e==="n-triples"&&(v=c.nTriplesSerializer.serializeChunk(y,r));return v?{value:v,done:!1}:this.next()},async return(){return u=[],f=[],d=0,{value:void 0,done:!0}},[Symbol.asyncIterator](){return this}}}async load(e,t,r={}){let i=this.parse(e,t,r);return r.mode!=="append"&&await this.store.clear(),await this.store.addAll(i),i.length}parse(e,t,r={}){switch(t){case"turtle":return this.turtleParser.parse(e,this.buildTurtleParseOptions(r));case"n-triples":return this.nTriplesParser.parse(e,this.buildNTriplesParseOptions(r));case"json-ld":return this.parseJsonLd(e,r);default:throw new Error(`Unsupported serialization format: ${t}`)}}buildTurtleParseOptions(e){return{prefixes:this.composePrefixes(e.prefixes,!0),strict:e.strict}}buildNTriplesParseOptions(e){return{prefixes:this.composePrefixes(e.prefixes,!0),strict:e.strict}}composePrefixes(e,t){return t??!0?{...V$,...e??{}}:{...e??{}}}parseJsonLd(e,t){let r;try{r=JSON.parse(e)}catch(u){throw new Error(`Invalid JSON-LD document: ${u.message}`)}let i=this.composePrefixes(t.prefixes,!0),s=this.extractContext(r),o={...i,...s},c=this.extractGraph(r),l=[];return c.forEach((u,f)=>{if(!u||typeof u!="object"||Array.isArray(u))throw new Error(`Invalid JSON-LD node at index ${f}`);let d=this.parseSubjectFromNode(u,o,f),h=Object.entries(u);for(let[p,y]of h){if(p==="@id"||p==="@context")continue;if(p==="@type"){this.collectTypeTriples(d,y,l,o);continue}let v=this.expandTerm(p,o),b=new Ha.IRI(v);this.collectTriplesForValue(d,b,y,l,o)}}),l}extractContext(e){if(!e||typeof e!="object"||Array.isArray(e))return{};let t=e["@context"];if(!t||typeof t!="object"||Array.isArray(t))return{};let r={};return Object.entries(t).forEach(([i,s])=>{typeof s=="string"&&(r[i]=s)}),r}extractGraph(e){if(Array.isArray(e))return e;if(!e||typeof e!="object")return[];let t=e["@graph"];return Array.isArray(t)?t:[e]}parseSubjectFromNode(e,t,r){let i=e["@id"];if(typeof i=="string"){if(i.startsWith("_:"))return new Jv.BlankNode(i.slice(2));if(this.isAbsoluteIri(i))return new Ha.IRI(i);let s=this.expandTerm(i,t);return new Ha.IRI(s)}return new Jv.BlankNode(`jsonld_${r}`)}collectTypeTriples(e,t,r,i){let s=Ss.Namespace.RDF.term("type");(Array.isArray(t)?t:[t]).forEach(c=>{if(typeof c!="string")throw new Error("Invalid @type value in JSON-LD node");let l=this.expandTerm(c,i);r.push(new Sl.Triple(e,s,new Ha.IRI(l)))})}collectTriplesForValue(e,t,r,i,s){if(r!=null){if(Array.isArray(r)){r.forEach(o=>this.collectTriplesForValue(e,t,o,i,s));return}if(typeof r=="object"){let o=r;if(typeof o["@id"]=="string"){let c=this.parseIdNode(o["@id"],s);i.push(new Sl.Triple(e,t,c));return}if(o["@value"]!==void 0){let c=this.parseLiteralObject(o,s);i.push(new Sl.Triple(e,t,c));return}}if(typeof r=="string"){i.push(new Sl.Triple(e,t,new Qa.Literal(r)));return}if(typeof r=="number"){let o=Number.isInteger(r)?Ss.Namespace.XSD.term("integer"):Ss.Namespace.XSD.term("decimal");i.push(new Sl.Triple(e,t,new Qa.Literal(r.toString(),o)));return}if(typeof r=="boolean"){let o=Ss.Namespace.XSD.term("boolean");i.push(new Sl.Triple(e,t,new Qa.Literal(r.toString(),o)));return}throw new Error("Unsupported JSON-LD value encountered")}}parseIdNode(e,t){if(e.startsWith("_:"))return new Jv.BlankNode(e.slice(2));if(this.isAbsoluteIri(e))return new Ha.IRI(e);let r=this.expandTerm(e,t);return new Ha.IRI(r)}parseLiteralObject(e,t){let r=e["@value"];if(typeof r!="string")throw new Error("JSON-LD literal values must be strings");if(typeof e["@language"]=="string"){let i=e["@direction"];return i==="ltr"||i==="rtl"?new Qa.Literal(r,void 0,e["@language"],i):new Qa.Literal(r,void 0,e["@language"])}if(typeof e["@type"]=="string"){let i=this.expandTerm(e["@type"],t);return new Qa.Literal(r,new Ha.IRI(i))}return new Qa.Literal(r)}expandTerm(e,t){if(this.isAbsoluteIri(e))return e;let r=e.indexOf(":");if(r>0){let s=e.slice(0,r),o=e.slice(r+1),c=t[s];if(!c)throw new Error(`Unknown prefix "${s}" in JSON-LD document`);return`${c}${o}`}let i=t["@vocab"];if(i)return`${i}${e}`;throw new Error(`Unable to expand JSON-LD term "${e}"`)}isAbsoluteIri(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)}buildJsonLdChunks(e){let t=[],r=JSON.stringify(e["@context"]);return t.push(`{"@context":${r},"@graph":[`),e["@graph"].forEach((i,s)=>{let o=JSON.stringify(i);s>0?t.push(`,${o}`):t.push(o)}),t.push(`]}
377
- `),t}};Tm.RDFSerializer=Zv});var eb=S(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.OBSIDIAN_VAULT_SCHEME=void 0;vl.vaultPathToIRI=q$;vl.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function q$(n){let e=n.startsWith("./")?n.slice(2):n;return`${vl.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}a(q$,"vaultPathToIRI")});var rb=S(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.RDFVocabularyMapper=void 0;var rr=Yn(),cC=Ae(),J=lr(),tb=class{static{a(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",J.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",J.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",J.Namespace.RDFS.term("subClassOf")],["exo__Property_range",J.Namespace.RDFS.term("range")],["exo__Property_domain",J.Namespace.RDFS.term("domain")],["exo__Property_superProperty",J.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new rr.Triple(J.Namespace.EXO.term("Asset"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDFS.term("Resource"))),e.push(new rr.Triple(J.Namespace.EXO.term("Class"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDFS.term("Class"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDF.term("Property"))),e.push(new rr.Triple(J.Namespace.EMS.term("Task"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Project"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Area"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Workflow"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("WorkflowState"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("WorkflowTransition"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Command"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Precondition"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Grounding"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("CommandBinding"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new rr.Triple(J.Namespace.EXO.term("Instance_class"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDF.term("type"))),e.push(new rr.Triple(J.Namespace.EXO.term("Asset_isDefinedBy"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("isDefinedBy"))),e.push(new rr.Triple(J.Namespace.EXO.term("Class_superClass"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("subClassOf"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_range"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("range"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_domain"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("domain"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_superProperty"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof cC.IRI)s=r;else{let o=r.match(/^(ems|exo|exocmd)__(.+)$/);if(o){let[,c,l]=o;s=(c==="ems"?J.Namespace.EMS:c==="exocmd"?J.Namespace.EXOCMD:J.Namespace.EXO).term(l)}else s=new cC.IRI(r)}return new rr.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Am.RDFVocabularyMapper=tb});var lC=S(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.RDFSInferenceEngine=void 0;var W$=Yn(),xm=Ae(),nb=class{static{a(this,"RDFSInferenceEngine")}async materialize(e){let t=await e.predicates(),r=t.find(d=>d.value.includes("Class_superClass")),i=t.find(d=>d.value.includes("Instance_class"));if(!r||!i)return 0;let s=await this.buildDirectParentMap(e,r);if(s.size===0)return 0;let o=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof xm.IRI){let h=o.get(d.object.value);if(h)for(let p of h)u.push(new W$.Triple(d.subject,i,new xm.IRI(p)))}return u.length>0&&await e.addAll(u),await e.count()-c}async buildDirectParentMap(e,t){let r=await e.match(void 0,t),i=new Map;for(let s of r)if(s.subject instanceof xm.IRI&&s.object instanceof xm.IRI){let o=s.subject.value,c=s.object.value;i.has(o)||i.set(o,new Set),i.get(o).add(c)}return i}computeAllAncestors(e){let t=new Map;for(let r of e.keys())t.has(r)||t.set(r,this.computeAncestorsBFS(r,e));return t}computeAncestorsBFS(e,t){let r=new Set,i=new Set,s=[],o=t.get(e);if(o)for(let c of o)s.push(c);for(;s.length>0;){let c=s.shift();if(i.has(c))continue;i.add(c),r.add(c);let l=t.get(c);if(l)for(let u of l)i.has(u)||s.push(u)}return r}};Cm.RDFSInferenceEngine=nb});var ob=S(Ka=>{"use strict";var G$=Ka&&Ka.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.NonInheritablePropertyRegistry=void 0;var z$=fe(),uC=Ae(),fC=Ne(),ib=lr(),sb=class{static{a(this,"NonInheritablePropertyRegistry")}constructor(){this.nonInheritableIRIs=new Set,this.initialized=!1}async initialize(e){this.nonInheritableIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Instance_class"));if(!r){this.initialized=!0;return}let i=await this.findNonInheritableClassIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof fC.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.nonInheritableIRIs.add(d)}}}catch{}this.initialized=!0}isNonInheritable(e){return this.nonInheritableIRIs.has(e)}get size(){return this.nonInheritableIRIs.size}get isInitialized(){return this.initialized}async findNonInheritableClassIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new fC.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof uC.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof uC.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?ib.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?ib.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?ib.Namespace.EXOCMD.term(e.substring(8)).value:null}};Ka.NonInheritablePropertyRegistry=sb;Ka.NonInheritablePropertyRegistry=sb=G$([(0,z$.injectable)()],sb)});var lb=S(Ya=>{"use strict";var H$=Ya&&Ya.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.PropertyCardinalityRegistry=void 0;var Q$=fe(),dC=Ae(),hC=Ne(),ab=lr(),cb=class{static{a(this,"PropertyCardinalityRegistry")}constructor(){this.multiValuedIRIs=new Set,this.initialized=!1}async initialize(e){this.multiValuedIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Property_cardinality"));if(!r){this.initialized=!0;return}let i=await this.findMultipleCardinalityIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof hC.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.multiValuedIRIs.add(d)}}}catch{}this.initialized=!0}isMultiValued(e){return this.multiValuedIRIs.has(e)}get size(){return this.multiValuedIRIs.size}get isInitialized(){return this.initialized}async findMultipleCardinalityIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new hC.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof dC.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof dC.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?ab.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?ab.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?ab.Namespace.EXOCMD.term(e.substring(8)).value:null}};Ya.PropertyCardinalityRegistry=cb;Ya.PropertyCardinalityRegistry=cb=H$([(0,Q$.injectable)()],cb)});var db=S(br=>{"use strict";var K$=br&&br.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Y$=br&&br.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(br,"__esModule",{value:!0});br.PrototypeChainMaterializer=br.MAX_PROTOTYPE_DEPTH=br.INFERRED_GRAPH=void 0;br.inferredGraphForDepth=ub;var X$=fe(),pC=Yn(),Go=Ae(),J$=ob(),Z$=lb();br.INFERRED_GRAPH=new Go.IRI("https://exocortex.my/ontology/exo#inferred");var eB="https://exocortex.my/ontology/exo#inferred/";function ub(n){return new Go.IRI(`${eB}${n}`)}a(ub,"inferredGraphForDepth");br.MAX_PROTOTYPE_DEPTH=10;var fb=class{static{a(this,"PrototypeChainMaterializer")}constructor(e,t){this.registry=e,this.cardinalityRegistry=t??null}async materialize(e){let r=(await e.predicates()).find(c=>c.value.includes("Asset_prototype"));if(!r)return 0;let i=await e.match(void 0,r,void 0);if(i.length===0)return 0;let s=new Map;for(let c of i)if(c.subject instanceof Go.IRI&&c.object instanceof Go.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let o=0;for(let[c]of s){let l=new Go.IRI(c),u=this.resolveChain(c,s);if(u.length===0)continue;let f=await e.match(l,void 0,void 0),d=new Set,h=new Map;for(let p of f)if(d.add(p.predicate.value),this.isMultiValued(p.predicate.value)){let y=p.object instanceof Go.IRI?p.object.value:String(p.object),v=h.get(p.predicate.value);v||(v=new Set,h.set(p.predicate.value,v)),v.add(y)}for(let p=0;p<u.length;p++){let y=u[p],v=p+1,b=new Go.IRI(y),w=await e.match(b,void 0,void 0),T=new Set;if(e.matchInGraph){let I=await e.matchInGraph(b,void 0,void 0,br.INFERRED_GRAPH);for(let $ of I)T.add($.predicate.value)}for(let I of w){let $=I.predicate.value;if(this.registry.isNonInheritable($)||T.has($))continue;if(d.has($)&&this.isMultiValued($)){let ce=I.object instanceof Go.IRI?I.object.value:String(I.object);if(h.get($)?.has(ce))continue;let V=h.get($);V||(V=new Set,h.set($,V)),V.add(ce);let F=new pC.Triple(l,I.predicate,I.object);await e.add(F),e.addToGraph&&(await e.addToGraph(F,br.INFERRED_GRAPH),await e.addToGraph(F,ub(v))),o++;continue}if(d.has($))continue;let q=new pC.Triple(l,I.predicate,I.object);await e.add(q),e.addToGraph&&(await e.addToGraph(q,br.INFERRED_GRAPH),await e.addToGraph(q,ub(v))),d.add($),o++}}}return o}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],o=t.get(e);for(o&&s.push(o.value);s.length>0&&r.length<br.MAX_PROTOTYPE_DEPTH;){let c=s.shift();if(c===void 0)break;if(i.has(c))continue;i.add(c),r.push(c);let l=t.get(c);l&&!i.has(l.value)&&s.push(l.value)}return r}};br.PrototypeChainMaterializer=fb;br.PrototypeChainMaterializer=fb=K$([(0,X$.injectable)(),Y$("design:paramtypes",[J$.NonInheritablePropertyRegistry,Z$.PropertyCardinalityRegistry])],fb)});var pb=S(pr=>{"use strict";var tB=pr&&pr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},rB=pr&&pr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(pr,"__esModule",{value:!0});pr.SourceAnnotator=pr.DEPTH_VARIABLE=pr.SOURCE_VARIABLE=void 0;var nB=fe(),bl=Ne(),iB=Ae(),Rm=db();pr.SOURCE_VARIABLE="_source";pr.DEPTH_VARIABLE="_depth";var hb=class{static{a(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(o=>{let c=o.clone();return c.set(pr.SOURCE_VARIABLE,new bl.Literal("own")),c});let s=[];for(let o of e){let c=o.get(t),l=o.get(r),u=o.get(i),f=o.clone();if(!c||!l||!u)f.set(pr.SOURCE_VARIABLE,new bl.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(pr.SOURCE_VARIABLE,new bl.Literal(d))}s.push(f)}return s}async annotateSingle(e,t,r,i){return(await this.annotate([e],t,r,i))[0]}async determineSource(e,t,r){return this.tripleStore.matchInGraph&&(await this.tripleStore.matchInGraph(e,t,r,Rm.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=Rm.MAX_PROTOTYPE_DEPTH;i++){let s=(0,Rm.inferredGraphForDepth)(i);if((await this.tripleStore.matchInGraph(e,t,r,s)).length>0)return i}return 0}async annotateBySubject(e,t){if(!this.tripleStore.matchInGraph)return e.map(s=>{let o=s.clone();return o.set(pr.SOURCE_VARIABLE,new bl.Literal("own")),o});let r=[],i=new Map;for(let s of e){let o=s.get(t),c=s.clone();if(!o||!(o instanceof iB.IRI))c.set(pr.SOURCE_VARIABLE,new bl.Literal("own"));else{let l=o.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(o,void 0,void 0,Rm.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(pr.SOURCE_VARIABLE,new bl.Literal(u))}r.push(c)}return r}};pr.SourceAnnotator=hb;pr.SourceAnnotator=hb=tB([(0,nB.injectable)(),rB("design:paramtypes",[Object])],hb)});var gb=S(Bi=>{"use strict";var sB=Bi&&Bi.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},oB=Bi&&Bi.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},mC=Bi&&Bi.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.NoteToRDFConverter=void 0;var mb=fe(),mr=Yn(),zo=Ae(),mn=Ne(),gC=qt(),Kt=lr(),yC=Et(),aB=rb(),cB=Oc(),_C=eb(),Pn=a_(),wl=class{static{a(this,"NoteToRDFConverter")}constructor(e,t=cB.NullLogger){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.pendingExtraTriples=[],this.vocabularyMapper=new aB.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?Pn.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){this.pendingExtraTriples=[];let r=[],i=this.notePathToIRI(e.path),s=Kt.Namespace.EXO.term("Asset_fileName");r.push(new mr.Triple(i,s,new mn.Literal(e.basename)));for(let[f,d]of Object.entries(t)){if(!this.isExocortexProperty(f))continue;let h=this.propertyKeyToIRI(f),p=Array.isArray(d)?d:[d];for(let y of p)if(!(f==="exo__Asset_label"&&typeof y=="string"&&y.trim()===""))if(f==="exo__Instance_class"){let v=this.valueToClassURI(y);r.push(new mr.Triple(i,h,v))}else{let v=await this.valueToRDFObject(y,e,h);for(let b of v)if(r.push(new mr.Triple(i,h,b)),this.vocabularyMapper.hasMappingFor(f)&&b instanceof zo.IRI){let w=this.vocabularyMapper.generateMappedTriple(i,f,b);w&&r.push(w)}}if(f==="exo__Instance_class")for(let y of p){let v=this.valueToClassURI(y);if(v instanceof zo.IRI){let b=Kt.Namespace.RDF.term("type");r.push(new mr.Triple(i,b,v))}}if(f==="exo__Asset_label"){let y=Kt.Namespace.RDFS.term("label");for(let v of p)typeof v=="string"&&v.length>0&&r.push(new mr.Triple(i,y,new mn.Literal(v)))}}let o="exo__Instance_class"in t||"exo__Asset_uid"in t,c=t.exo__Asset_label,l="exo__Asset_label"in t&&c!==null&&c!==void 0&&!(typeof c=="string"&&c.trim()==="")&&!(Array.isArray(c)&&c.length===0);if(o&&!l){let f=Kt.Namespace.RDFS.term("label"),d=Kt.Namespace.EXO.term("Asset_label"),h=new mn.Literal(e.basename);r.push(new mr.Triple(i,f,h)),r.push(new mr.Triple(i,d,h))}r.push(...this.pendingExtraTriples),this.pendingExtraTriples=[];let u=await this.convertBodyWikilinks(e,i);return r.push(...u),r}async convertExo003Note(e,t){let r=Pn.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Pn.Exo003MetadataType.Namespace:break;case Pn.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Pn.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Pn.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Pn.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new zo.IRI(t.uri);return[new mr.Triple(r,Kt.Namespace.OWL.term("sameAs"),i),new mr.Triple(i,Kt.Namespace.OWL.term("sameAs"),r)]}convertExo003BlankNode(e,t){let r=this.notePathToIRI(e.path),i=t.uri.replace(/[^a-zA-Z0-9_-]/g,"_");return[new mr.Triple(r,Kt.Namespace.OWL.term("sameAs"),new gC.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Pn.Exo003Parser.toTriple(t,i);r.push(s);let o=this.notePathToIRI(e.path);r.push(new mr.Triple(o,Kt.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.createExo003ReferenceResolver(e),c=o(t.subject),l=o(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new zo.IRI(c.value):new gC.BlankNode(c.value),f=new zo.IRI(l.value),d=Pn.Exo003Parser.toLiteral(t,s.trim());r.push(new mr.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new mr.Triple(h,Kt.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let o=this.vault.getFrontmatter(s);if(o&&Pn.Exo003Parser.isExo003Format(o)){let c=Pn.Exo003Parser.parse(o);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Pn.Exo003MetadataType.Anchor||l.metadata===Pn.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Pn.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let o of t)try{let c=this.vault.getFrontmatter(o),l=c?this.validateExocortexAsset(c,o.basename):null;if(l){if(s)throw new Error(`Invariant violation in "${o.path}": ${l.message}`);i.push({path:o.path,reason:`Invariant violation: ${l.message}`}),this.logger.warn(`Skipping file with invariant violation: ${o.path}`,{code:l.code,property:l.property,reason:l.message});continue}let u=await this.convertNote(o);r.push(...u)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${o.path}": ${l}`);i.push({path:o.path,reason:`Invalid IRI: ${l}`}),this.logger.warn(`Skipping file with invalid IRI: ${o.path}`,{reason:l})}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}static inferLabelFromBasename(e){return Kt.Namespace.fromPropertyKey(e)!==null?e:null}validateExocortexAsset(e,t){let r=a(u=>u==null?!0:typeof u=="string"?u.trim()==="":Array.isArray(u)?u.length===0||u.every(r):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let s=["exo__Asset_uid","exo__Asset_isDefinedBy","exo__Instance_class"];for(let u of s){if(!(u in e))return{code:"MISSING_PROPERTY",property:u,message:`Required property "${u}" is missing`};if(r(e[u]))return{code:"EMPTY_PROPERTY",property:u,message:`Required property "${u}" is empty`}}let o=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let u of o)if(u in e&&r(e[u]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:u,message:`Optional property "${u}" is present but empty`};let c=e.exo__Instance_class,l=Array.isArray(c)?c:[c];for(let u of l){if(typeof u!="string")continue;let f=this.removeQuotes(u),h=(this.extractWikilink(f)??f).trim();if(/^[a-z][a-zA-Z0-9]*__/.test(h)&&/[\s()]/.test(h))return{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${u}"`}}return null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,_C.vaultPathToIRI)(r.path);zo.IRI.isValidIRI(i)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){return new zo.IRI((0,_C.vaultPathToIRI)(e))}isExocortexProperty(e){return Kt.Namespace.fromPropertyKey(e)!==null}propertyKeyToIRI(e){let t=Kt.Namespace.fromPropertyKey(e);if(!t)throw new Error(`Invalid property key: ${e}`);return t.namespace.term(t.localName)}emitTypeTripleForEnumInstance(e,t){let r=this.vault.getFrontmatter(t);if(!r)return;let i=r.exo__Instance_class,s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return;let o=this.valueToClassURI(s);o instanceof zo.IRI&&(this.pendingExtraTriples.push(new mr.Triple(e,Kt.Namespace.RDF.term("type"),o)),this.pendingExtraTriples.push(new mr.Triple(e,Kt.Namespace.EXO.term("Instance_class"),o)))}async valueToRDFObject(e,t,r){if(typeof e=="string"){let i=this.removeQuotes(e),s=this.extractWikilink(i);if(s){let o=this.vault.getFirstLinkpathDest(s,t.path);if(o){let l=this.notePathToIRI(o.path),u=s.includes("|")?s.split("|")[0]:s;if(this.isUUID(u)){let d=new mn.Literal(u),h=this.expandClassValue(o.basename);if(h)return this.emitTypeTripleForEnumInstance(h,o),[h];let p=this.vault.getFrontmatter(o);if(p){let v=p.exo__Asset_label;if(typeof v=="string"){let b=this.expandClassValue(v);if(b)return this.emitTypeTripleForEnumInstance(b,o),[b]}}return r?.value.endsWith("#Asset_prototype")||r?.value.endsWith("/Asset_prototype")?[l,d]:[l]}let f=this.expandClassValue(o.basename);return f?(this.emitTypeTripleForEnumInstance(f,o),[f]):[l]}if(this.isClassReference(s)){let l=this.expandClassValue(s);if(l)return[l]}let c=s.includes("|")?s.split("|")[0]:s;return this.isUUID(c)?[this.notePathToIRI(`${c}.md`)]:[new mn.Literal(i)]}if(this.isClassReference(i)){let o=this.expandClassValue(i);if(o)return[o]}return this.isISO8601DateTime(i)?[new mn.Literal(i,Kt.Namespace.XSD.term("dateTime"))]:[new mn.Literal(i)]}return typeof e=="boolean"?[new mn.Literal(e.toString())]:typeof e=="number"?[new mn.Literal(e.toString(),Kt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new mn.Literal(e.toISOString(),Kt.Namespace.XSD.term("dateTime"))]:[new mn.Literal(String(e))]}isISO8601DateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?$/.test(e)}removeQuotes(e){let t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.substring(1,t.length-1):e}extractWikilink(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1];return r.includes("|")?r.split("|")[0]:r}extractWikilinkAlias(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1],i=r.indexOf("|");return i>=0?r.substring(i+1).trim():null}valueToClassURI(e){if(typeof e!="string")return new mn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let o=this.extractWikilinkAlias(t);if(o){let c=this.expandClassValue(o);if(c)return c}if(this.isUUID(i)){let c=this.vault.getFirstLinkpathDest(i,"");if(c){let l=this.expandClassValue(c.basename);if(l)return l;let u=this.vault.getFrontmatter(c);if(u){let f=u.exo__Asset_label;if(typeof f=="string"){let d=this.expandClassValue(f);if(d)return d}}}}return new mn.Literal(t)}isClassReference(e){return/\s/.test(e)?!1:Kt.Namespace.fromPropertyKey(e)!==null}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e),r=Kt.Namespace.fromPropertyKey(t);return r?r.namespace.term(r.localName):null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.extractBodyWikilinks(s),c=Kt.Namespace.EXO.term("Asset_bodyLink");for(let l of o){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new mr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new mr.Triple(t,c,f)):r.push(new mr.Triple(t,c,new mn.Literal(l)))}else r.push(new mr.Triple(t,c,new mn.Literal(l)))}}catch{}return r}};Bi.NoteToRDFConverter=wl;wl.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};wl.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};wl.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};Bi.NoteToRDFConverter=wl=sB([(0,mb.injectable)(),mC(0,(0,mb.inject)(yC.DI_TOKENS.IVaultAdapter)),mC(1,(0,mb.inject)(yC.DI_TOKENS.ILogger)),oB("design:paramtypes",[Object,Object])],wl)});var _b=S(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.FilterContainsOptimizer=void 0;var lB=Ae(),uB=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,yb=class{static{a(this,"FilterContainsOptimizer")}constructor(){this.tripleStore=null,this.lastOptimizationHints=[]}setTripleStore(e){this.tripleStore=e}getLastOptimizationHints(){return this.lastOptimizationHints}clearHints(){this.lastOptimizationHints=[]}async optimize(e){return this.clearHints(),this.optimizeRecursive(e)}optimizeSync(e,t){return this.clearHints(),this.optimizeSyncRecursive(e,t)}async optimizeRecursive(e){return e.type==="filter"?this.optimizeFilter(e):e.type==="join"?{type:"join",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="leftjoin"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="union"?{type:"union",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="minus"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="project"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="orderby"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="slice"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="distinct"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="reduced"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="group"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="extend"?{...e,input:await this.optimizeRecursive(e.input)}:e}optimizeSyncRecursive(e,t){return e.type==="filter"?this.optimizeFilterSync(e,t):e.type==="join"?{type:"join",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="leftjoin"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="union"?{type:"union",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="minus"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="project"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="orderby"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="slice"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="distinct"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="reduced"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="group"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="extend"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e}async optimizeFilter(e){let t=this.detectContainsUUIDPattern(e.expression);if(!t)return{type:"filter",expression:e.expression,input:await this.optimizeRecursive(e.input)};let r=[];return this.tripleStore&&(r=await this.findSubjectsContainingUUID(t.uuid)),this.rewriteFilter(e,t,r)}optimizeFilterSync(e,t){let r=this.detectContainsUUIDPattern(e.expression);if(!r)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input,t)};let i=t?t.filter(s=>s.includes(r.uuid)):[];return this.rewriteFilter(e,r,i)}rewriteFilter(e,t,r){if(this.lastOptimizationHints.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${t.variable}), "${t.uuid}"))`,suggestedRewrite:r.length===1?`VALUES ?${t.variable} { <${r[0]}> }`:r.length>1?`VALUES ?${t.variable} { ${r.map(i=>`<${i}>`).join(" ")} }`:"No matching URIs found for UUID",estimatedSpeedup:r.length>0?"O(n) \u2192 O(1)":"N/A",matchedUri:r.length===1?r[0]:void 0}),r.length===0)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input)};if(r.length===1){let i=this.injectSubjectConstraint(e.input,t.variable,r[0]);if(i!==e.input)return i}return this.createValuesJoin(e,t,r)}detectContainsUUIDPattern(e){if(e.type==="function"||e.type==="functionCall"){let t=e;if((typeof t.function=="string"?t.function.toLowerCase():t.function?.value?.toLowerCase()??"")==="contains"&&t.args.length===2)return this.analyzeContainsArgs(t.args[0],t.args[1],e)}if(e.type==="logical"&&e.operator==="&&")for(let t of e.operands){let r=this.detectContainsUUIDPattern(t);if(r)return r}return null}analyzeContainsArgs(e,t,r){let i=null;if(e.type==="function"||e.type==="functionCall"){let s=e;if((typeof s.function=="string"?s.function.toLowerCase():s.function?.value?.toLowerCase()??"")==="str"&&s.args.length===1){let c=s.args[0];c.type==="variable"&&(i=c.name)}}if(!i&&e.type==="variable"&&(i=e.name),!i)return null;if(t.type==="literal"){let c=String(t.value).match(uB);if(c)return{variable:i,uuid:c[0].toLowerCase(),originalExpression:r}}return null}async findSubjectsContainingUUID(e){if(!this.tripleStore)return[];if(this.tripleStore.findSubjectsByUUID)return(await this.tripleStore.findSubjectsByUUID(e)).map(s=>s.value);let t=await this.tripleStore.subjects(),r=[];for(let i of t)i instanceof lB.IRI&&i.value.toLowerCase().includes(e.toLowerCase())&&r.push(i.value);return r}injectSubjectConstraint(e,t,r){if(e.type==="bgp"){let i=e.triples.map(o=>o.subject.type==="variable"&&o.subject.value===t?{...o,subject:{type:"iri",value:r}}:o);if(i.some((o,c)=>o.subject!==e.triples[c].subject))return{type:"bgp",triples:i}}if(e.type==="join"){let i=this.injectSubjectConstraint(e.left,t,r),s=this.injectSubjectConstraint(e.right,t,r);if(i!==e.left||s!==e.right)return{type:"join",left:i,right:s}}if(e.type==="filter"){let i=this.injectSubjectConstraint(e.input,t,r);if(i!==e.input)return{...e,input:i}}return e}createValuesJoin(e,t,r){return{type:"join",left:{type:"values",variables:[t.variable],bindings:r.map(o=>({[t.variable]:{type:"iri",value:o}}))},right:this.optimizeSyncRecursive(e.input)}}analyzeQuery(e){let t=[];return this.analyzeRecursive(e,t),t}analyzeRecursive(e,t){if(e.type==="filter"){let r=this.detectContainsUUIDPattern(e.expression);r&&t.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${r.variable}), "${r.uuid}"))`,suggestedRewrite:`Use --optimize flag or rewrite as VALUES ?${r.variable} { <uri-containing-uuid> }`,estimatedSpeedup:"O(n) \u2192 O(1) with UUID index lookup"}),this.analyzeRecursive(e.input,t);return}e.type==="join"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="leftjoin"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="union"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="minus"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="project"?this.analyzeRecursive(e.input,t):e.type==="orderby"?this.analyzeRecursive(e.input,t):e.type==="slice"?this.analyzeRecursive(e.input,t):e.type==="distinct"?this.analyzeRecursive(e.input,t):e.type==="reduced"?this.analyzeRecursive(e.input,t):e.type==="group"?this.analyzeRecursive(e.input,t):e.type==="extend"&&this.analyzeRecursive(e.input,t)}};Im.FilterContainsOptimizer=yb});var SC=S(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.AlgebraOptimizer=void 0;var fB=_b(),Sb=class{static{a(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new fB.FilterContainsOptimizer}setTripleStore(e){this.tripleStore=e,this.filterContainsOptimizer.setTripleStore(e)}getOptimizationHints(){return this.filterContainsOptimizer.getLastOptimizationHints()}analyzeQuery(e){return this.filterContainsOptimizer.analyzeQuery(e)}optimize(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),t=this.filterPushDown(t),t=this.joinReordering(t),t}async optimizeAsync(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),this.tripleStore&&(t=await this.filterContainsOptimizer.optimize(t)),t=this.filterPushDown(t),t=this.joinReordering(t),t}optimizeWithSubjects(e,t){let r=e;return r=this.eliminateEmptyBGPInFilterJoin(r),r=this.filterContainsOptimizer.optimizeSync(r,t),r=this.filterPushDown(r),r=this.joinReordering(r),r}eliminateEmptyBGPInFilterJoin(e){if(e.type==="join"){if(e.left.type==="filter"){let t=e.left;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.right)}}if(e.right.type==="filter"){let t=e.right;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.left)}}return{type:"join",left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}}return e.type==="filter"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="leftjoin"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="union"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="minus"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="project"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="orderby"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="slice"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="distinct"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e}filterPushDown(e){return e.type==="filter"?this.pushDownFilter(e):e.type==="join"?{type:"join",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="leftjoin"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="union"?{type:"union",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="minus"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="project"?{...e,input:this.filterPushDown(e.input)}:e.type==="orderby"?{...e,input:this.filterPushDown(e.input)}:e.type==="slice"?{...e,input:this.filterPushDown(e.input)}:e.type==="distinct"?{...e,input:this.filterPushDown(e.input)}:e}pushDownFilter(e){let t=e.input;if(t.type==="join"){let r=this.getFilterVariables(e.expression),i=this.getOperationVariables(t.left),s=this.getOperationVariables(t.right),o=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return o&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!o?{type:"join",left:this.filterPushDown(t.left),right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:{type:"join",left:this.filterPushDown(t.left),right:this.filterPushDown(t.right)}}}return t.type==="union"?{type:"union",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:this.filterPushDown(t)}}getFilterVariables(e){let t=[];if(e.type==="variable")t.push(e.name);else if(e.type==="comparison")t.push(...this.getFilterVariables(e.left)),t.push(...this.getFilterVariables(e.right));else if(e.type==="logical")for(let r of e.operands)t.push(...this.getFilterVariables(r));else if(e.type==="function")for(let r of e.args)t.push(...this.getFilterVariables(r));return Array.from(new Set(t))}getOperationVariables(e){let t=new Set;if(e.type==="bgp")for(let r of e.triples)r.subject.type==="variable"&&t.add(r.subject.value),r.predicate.type==="variable"&&t.add(r.predicate.value),r.object.type==="variable"&&t.add(r.object.value);else if(e.type==="join"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="filter")return this.getOperationVariables(e.input);if(e.type==="leftjoin"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else if(e.type==="union"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="minus")return this.getOperationVariables(e.left);if(e.type==="project")return new Set(e.variables)}}return t}joinReordering(e){return e.type==="join"?this.reorderJoin(e):e.type==="filter"?{...e,input:this.joinReordering(e.input)}:e.type==="leftjoin"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="union"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="minus"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="project"?{...e,input:this.joinReordering(e.input)}:e.type==="orderby"?{...e,input:this.joinReordering(e.input)}:e.type==="slice"?{...e,input:this.joinReordering(e.input)}:e.type==="distinct"?{...e,input:this.joinReordering(e.input)}:e}reorderJoin(e){let t=this.isConstrained(e.left),r=this.isConstrained(e.right);if(r&&!t)return{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)};if(t&&!r)return{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)};let i=this.estimateCost(e.left);return this.estimateCost(e.right)<i?{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)}:{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)}}isConstrained(e){return e.type==="values"?!0:e.type==="bgp"?e.triples.some(t=>t.object.type!=="variable"||t.subject.type!=="variable"):e.type==="filter"?this.isConstrained(e.input):e.type==="join"?this.isConstrained(e.left)||this.isConstrained(e.right):e.type==="union"?this.isConstrained(e.left)&&this.isConstrained(e.right):!1}estimateCost(e){if(e.type==="bgp"){let t=0;for(let r of e.triples){let i=10;r.subject.type==="variable"&&(i*=10),r.predicate.type==="variable"&&(i*=20),r.object.type==="variable"&&(i*=5),t+=i}return t}if(e.type==="filter")return this.estimateCost(e.input)*.3;if(e.type==="join"){let t=this.estimateCost(e.left),r=this.estimateCost(e.right);return e.left.type==="values"||e.right.type==="values"?Math.min(t,r)*2:t*r}if(e.type==="leftjoin")return this.estimateCost(e.left)+this.estimateCost(e.right)*.5;if(e.type==="union")return this.estimateCost(e.left)+this.estimateCost(e.right);if(e.type==="values"){let t=e.bindings;return Array.isArray(t)?t.length*5:10}return e.type==="minus"?this.estimateCost(e.left)+this.estimateCost(e.right)*.3:100}setStatistics(e,t){this.stats.set(e,t)}getStatistics(e){return this.stats.get(e)}};Pm.AlgebraOptimizer=Sb});var vC=S(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.AlgebraSerializer=void 0;var vb=class{static{a(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
377
+ `),t}};Tm.RDFSerializer=Zv});var eb=S(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});vl.OBSIDIAN_VAULT_SCHEME=void 0;vl.vaultPathToIRI=q$;vl.OBSIDIAN_VAULT_SCHEME="obsidian://vault/";function q$(n){let e=n.startsWith("./")?n.slice(2):n;return`${vl.OBSIDIAN_VAULT_SCHEME}${encodeURI(e)}`}a(q$,"vaultPathToIRI")});var rb=S(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.RDFVocabularyMapper=void 0;var rr=Yn(),cC=Ae(),J=lr(),tb=class{static{a(this,"RDFVocabularyMapper")}constructor(){this.propertyMappings=new Map([["exo__Instance_class",J.Namespace.RDF.term("type")],["exo__Asset_isDefinedBy",J.Namespace.RDFS.term("isDefinedBy")],["exo__Class_superClass",J.Namespace.RDFS.term("subClassOf")],["exo__Property_range",J.Namespace.RDFS.term("range")],["exo__Property_domain",J.Namespace.RDFS.term("domain")],["exo__Property_superProperty",J.Namespace.RDFS.term("subPropertyOf")]])}generateClassHierarchyTriples(){let e=[];return e.push(new rr.Triple(J.Namespace.EXO.term("Asset"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDFS.term("Resource"))),e.push(new rr.Triple(J.Namespace.EXO.term("Class"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDFS.term("Class"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.RDF.term("Property"))),e.push(new rr.Triple(J.Namespace.EMS.term("Task"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Project"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Area"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("Workflow"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("WorkflowState"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EMS.term("WorkflowTransition"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Command"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Precondition"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("Grounding"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e.push(new rr.Triple(J.Namespace.EXOCMD.term("CommandBinding"),J.Namespace.RDFS.term("subClassOf"),J.Namespace.EXO.term("Asset"))),e}generatePropertyHierarchyTriples(){let e=[];return e.push(new rr.Triple(J.Namespace.EXO.term("Instance_class"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDF.term("type"))),e.push(new rr.Triple(J.Namespace.EXO.term("Asset_isDefinedBy"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("isDefinedBy"))),e.push(new rr.Triple(J.Namespace.EXO.term("Class_superClass"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("subClassOf"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_range"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("range"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_domain"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("domain"))),e.push(new rr.Triple(J.Namespace.EXO.term("Property_superProperty"),J.Namespace.RDFS.term("subPropertyOf"),J.Namespace.RDFS.term("subPropertyOf"))),e}generateMappedTriple(e,t,r){let i=this.propertyMappings.get(t);if(!i)return null;let s;if(r instanceof cC.IRI)s=r;else{let o=r.match(/^(ems|exo|exocmd)__(.+)$/);if(o){let[,c,l]=o;s=(c==="ems"?J.Namespace.EMS:c==="exocmd"?J.Namespace.EXOCMD:J.Namespace.EXO).term(l)}else s=new cC.IRI(r)}return new rr.Triple(e,i,s)}hasMappingFor(e){return this.propertyMappings.has(e)}};Am.RDFVocabularyMapper=tb});var lC=S(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.RDFSInferenceEngine=void 0;var W$=Yn(),xm=Ae(),nb=class{static{a(this,"RDFSInferenceEngine")}async materialize(e){let t=await e.predicates(),r=t.find(d=>d.value.includes("Class_superClass")),i=t.find(d=>d.value.includes("Instance_class"));if(!r||!i)return 0;let s=await this.buildDirectParentMap(e,r);if(s.size===0)return 0;let o=this.computeAllAncestors(s),c=await e.count(),l=await e.match(void 0,i),u=[];for(let d of l)if(d.object instanceof xm.IRI){let h=o.get(d.object.value);if(h)for(let p of h)u.push(new W$.Triple(d.subject,i,new xm.IRI(p)))}return u.length>0&&await e.addAll(u),await e.count()-c}async buildDirectParentMap(e,t){let r=await e.match(void 0,t),i=new Map;for(let s of r)if(s.subject instanceof xm.IRI&&s.object instanceof xm.IRI){let o=s.subject.value,c=s.object.value;i.has(o)||i.set(o,new Set),i.get(o).add(c)}return i}computeAllAncestors(e){let t=new Map;for(let r of e.keys())t.has(r)||t.set(r,this.computeAncestorsBFS(r,e));return t}computeAncestorsBFS(e,t){let r=new Set,i=new Set,s=[],o=t.get(e);if(o)for(let c of o)s.push(c);for(;s.length>0;){let c=s.shift();if(i.has(c))continue;i.add(c),r.add(c);let l=t.get(c);if(l)for(let u of l)i.has(u)||s.push(u)}return r}};Cm.RDFSInferenceEngine=nb});var ob=S(Ka=>{"use strict";var G$=Ka&&Ka.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Ka,"__esModule",{value:!0});Ka.NonInheritablePropertyRegistry=void 0;var z$=fe(),uC=Ae(),fC=Ne(),ib=lr(),sb=class{static{a(this,"NonInheritablePropertyRegistry")}constructor(){this.nonInheritableIRIs=new Set,this.initialized=!1}async initialize(e){this.nonInheritableIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Instance_class"));if(!r){this.initialized=!0;return}let i=await this.findNonInheritableClassIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof fC.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.nonInheritableIRIs.add(d)}}}catch{}this.initialized=!0}isNonInheritable(e){return this.nonInheritableIRIs.has(e)}get size(){return this.nonInheritableIRIs.size}get isInitialized(){return this.initialized}async findNonInheritableClassIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new fC.Literal("exo__NonInheritableProperty"));if(i.length>0&&i[0].subject instanceof uC.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof uC.IRI&&c.object.value.includes("NonInheritableProperty"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?ib.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?ib.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?ib.Namespace.EXOCMD.term(e.substring(8)).value:null}};Ka.NonInheritablePropertyRegistry=sb;Ka.NonInheritablePropertyRegistry=sb=G$([(0,z$.injectable)()],sb)});var lb=S(Ya=>{"use strict";var H$=Ya&&Ya.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s};Object.defineProperty(Ya,"__esModule",{value:!0});Ya.PropertyCardinalityRegistry=void 0;var Q$=fe(),dC=Ae(),hC=Ne(),ab=lr(),cb=class{static{a(this,"PropertyCardinalityRegistry")}constructor(){this.multiValuedIRIs=new Set,this.initialized=!1}async initialize(e){this.multiValuedIRIs.clear();try{let t=await e.predicates(),r=t.find(c=>c.value.includes("Property_cardinality"));if(!r){this.initialized=!0;return}let i=await this.findMultipleCardinalityIRI(e,t);if(!i){this.initialized=!0;return}let s=await e.match(void 0,r,i);if(s.length===0){this.initialized=!0;return}let o=t.find(c=>c.value.includes("Asset_label"));if(!o){this.initialized=!0;return}for(let c of s){let l=await e.match(c.subject,o,void 0);for(let u of l)if(u.object instanceof hC.Literal){let f=u.object.value,d=this.propertyKeyToIRI(f);d&&this.multiValuedIRIs.add(d)}}}catch{}this.initialized=!0}isMultiValued(e){return this.multiValuedIRIs.has(e)}get size(){return this.multiValuedIRIs.size}get isInitialized(){return this.initialized}async findMultipleCardinalityIRI(e,t){let r=t.find(o=>o.value.includes("Asset_label"));if(!r)return null;let i=await e.match(void 0,r,new hC.Literal("exo__PropertyCardinalityMultiple"));if(i.length>0&&i[0].subject instanceof dC.IRI)return i[0].subject;let s=t.find(o=>o.value.includes("Instance_class"));if(s){let o=await e.match(void 0,s,void 0);for(let c of o)if(c.object instanceof dC.IRI&&c.object.value.includes("PropertyCardinalityMultiple"))return c.object}return null}propertyKeyToIRI(e){return e.startsWith("exo__")?ab.Namespace.EXO.term(e.substring(5)).value:e.startsWith("ems__")?ab.Namespace.EMS.term(e.substring(5)).value:e.startsWith("exocmd__")?ab.Namespace.EXOCMD.term(e.substring(8)).value:null}};Ya.PropertyCardinalityRegistry=cb;Ya.PropertyCardinalityRegistry=cb=H$([(0,Q$.injectable)()],cb)});var db=S(br=>{"use strict";var K$=br&&br.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},Y$=br&&br.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(br,"__esModule",{value:!0});br.PrototypeChainMaterializer=br.MAX_PROTOTYPE_DEPTH=br.INFERRED_GRAPH=void 0;br.inferredGraphForDepth=ub;var X$=fe(),pC=Yn(),Go=Ae(),J$=ob(),Z$=lb();br.INFERRED_GRAPH=new Go.IRI("https://exocortex.my/ontology/exo#inferred");var eB="https://exocortex.my/ontology/exo#inferred/";function ub(n){return new Go.IRI(`${eB}${n}`)}a(ub,"inferredGraphForDepth");br.MAX_PROTOTYPE_DEPTH=10;var fb=class{static{a(this,"PrototypeChainMaterializer")}constructor(e,t){this.registry=e,this.cardinalityRegistry=t??null}async materialize(e){let r=(await e.predicates()).find(c=>c.value.includes("Asset_prototype"));if(!r)return 0;let i=await e.match(void 0,r,void 0);if(i.length===0)return 0;let s=new Map;for(let c of i)if(c.subject instanceof Go.IRI&&c.object instanceof Go.IRI){let l=c.subject.value,u=c.object.value;l!==u&&s.set(l,c.object)}if(s.size===0)return 0;let o=0;for(let[c]of s){let l=new Go.IRI(c),u=this.resolveChain(c,s);if(u.length===0)continue;let f=await e.match(l,void 0,void 0),d=new Set,h=new Map;for(let p of f)if(d.add(p.predicate.value),this.isMultiValued(p.predicate.value)){let y=p.object instanceof Go.IRI?p.object.value:String(p.object),v=h.get(p.predicate.value);v||(v=new Set,h.set(p.predicate.value,v)),v.add(y)}for(let p=0;p<u.length;p++){let y=u[p],v=p+1,b=new Go.IRI(y),w=await e.match(b,void 0,void 0),T=new Set;if(e.matchInGraph){let I=await e.matchInGraph(b,void 0,void 0,br.INFERRED_GRAPH);for(let $ of I)T.add($.predicate.value)}for(let I of w){let $=I.predicate.value;if(this.registry.isNonInheritable($)||T.has($))continue;if(d.has($)&&this.isMultiValued($)){let ce=I.object instanceof Go.IRI?I.object.value:String(I.object);if(h.get($)?.has(ce))continue;let V=h.get($);V||(V=new Set,h.set($,V)),V.add(ce);let F=new pC.Triple(l,I.predicate,I.object);await e.add(F),e.addToGraph&&(await e.addToGraph(F,br.INFERRED_GRAPH),await e.addToGraph(F,ub(v))),o++;continue}if(d.has($))continue;let q=new pC.Triple(l,I.predicate,I.object);await e.add(q),e.addToGraph&&(await e.addToGraph(q,br.INFERRED_GRAPH),await e.addToGraph(q,ub(v))),d.add($),o++}}}return o}isMultiValued(e){return this.cardinalityRegistry?this.cardinalityRegistry.isMultiValued(e):!1}resolveChain(e,t){let r=[],i=new Set;i.add(e);let s=[],o=t.get(e);for(o&&s.push(o.value);s.length>0&&r.length<br.MAX_PROTOTYPE_DEPTH;){let c=s.shift();if(c===void 0)break;if(i.has(c))continue;i.add(c),r.push(c);let l=t.get(c);l&&!i.has(l.value)&&s.push(l.value)}return r}};br.PrototypeChainMaterializer=fb;br.PrototypeChainMaterializer=fb=K$([(0,X$.injectable)(),Y$("design:paramtypes",[J$.NonInheritablePropertyRegistry,Z$.PropertyCardinalityRegistry])],fb)});var pb=S(pr=>{"use strict";var tB=pr&&pr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},rB=pr&&pr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(pr,"__esModule",{value:!0});pr.SourceAnnotator=pr.DEPTH_VARIABLE=pr.SOURCE_VARIABLE=void 0;var nB=fe(),bl=Ne(),iB=Ae(),Rm=db();pr.SOURCE_VARIABLE="_source";pr.DEPTH_VARIABLE="_depth";var hb=class{static{a(this,"SourceAnnotator")}constructor(e){this.tripleStore=e}async annotate(e,t,r,i){if(!this.tripleStore.matchInGraph)return e.map(o=>{let c=o.clone();return c.set(pr.SOURCE_VARIABLE,new bl.Literal("own")),c});let s=[];for(let o of e){let c=o.get(t),l=o.get(r),u=o.get(i),f=o.clone();if(!c||!l||!u)f.set(pr.SOURCE_VARIABLE,new bl.Literal("own"));else{let d=await this.determineSource(c,l,u);f.set(pr.SOURCE_VARIABLE,new bl.Literal(d))}s.push(f)}return s}async annotateSingle(e,t,r,i){return(await this.annotate([e],t,r,i))[0]}async determineSource(e,t,r){return this.tripleStore.matchInGraph&&(await this.tripleStore.matchInGraph(e,t,r,Rm.INFERRED_GRAPH)).length>0?"inherited":"own"}async getInheritanceDepth(e,t,r){if(!this.tripleStore.matchInGraph)return 0;for(let i=1;i<=Rm.MAX_PROTOTYPE_DEPTH;i++){let s=(0,Rm.inferredGraphForDepth)(i);if((await this.tripleStore.matchInGraph(e,t,r,s)).length>0)return i}return 0}async annotateBySubject(e,t){if(!this.tripleStore.matchInGraph)return e.map(s=>{let o=s.clone();return o.set(pr.SOURCE_VARIABLE,new bl.Literal("own")),o});let r=[],i=new Map;for(let s of e){let o=s.get(t),c=s.clone();if(!o||!(o instanceof iB.IRI))c.set(pr.SOURCE_VARIABLE,new bl.Literal("own"));else{let l=o.value;if(!i.has(l)){let f=await this.tripleStore.matchInGraph(o,void 0,void 0,Rm.INFERRED_GRAPH);i.set(l,f.length>0?"inherited":"own")}let u=i.get(l)??"own";c.set(pr.SOURCE_VARIABLE,new bl.Literal(u))}r.push(c)}return r}};pr.SourceAnnotator=hb;pr.SourceAnnotator=hb=tB([(0,nB.injectable)(),rB("design:paramtypes",[Object])],hb)});var gb=S(Bi=>{"use strict";var sB=Bi&&Bi.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},oB=Bi&&Bi.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)},mC=Bi&&Bi.__param||function(n,e){return function(t,r){e(t,r,n)}};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.NoteToRDFConverter=void 0;var mb=fe(),mr=Yn(),zo=Ae(),mn=Ne(),gC=qt(),Kt=lr(),yC=Et(),aB=rb(),cB=Oc(),_C=eb(),Pn=a_(),lB=new Set(["archived","draft","pinned"]),wl=class{static{a(this,"NoteToRDFConverter")}constructor(e,t=cB.NullLogger){this.vault=e,this.logger=t,this.BODY_WIKILINK_PATTERN=/(?<!!)\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,this.pendingExtraTriples=[],this.vocabularyMapper=new aB.RDFVocabularyMapper}async convertNote(e){let t=this.vault.getFrontmatter(e);return t?Pn.Exo003Parser.isExo003Format(t)?this.convertExo003Note(e,t):this.convertLegacyNote(e,t):[]}async convertLegacyNote(e,t){this.pendingExtraTriples=[];let r=[],i=this.notePathToIRI(e.path),s=Kt.Namespace.EXO.term("Asset_fileName");r.push(new mr.Triple(i,s,new mn.Literal(e.basename)));for(let[f,d]of Object.entries(t)){let h=lB.has(f)?`exo__Asset_${f}`:f;if(!this.isExocortexProperty(h))continue;let p=this.propertyKeyToIRI(h),y=Array.isArray(d)?d:[d];for(let v of y)if(!(f==="exo__Asset_label"&&typeof v=="string"&&v.trim()===""))if(f==="exo__Instance_class"){let b=this.valueToClassURI(v);r.push(new mr.Triple(i,p,b))}else{let b=await this.valueToRDFObject(v,e,p);for(let w of b)if(r.push(new mr.Triple(i,p,w)),this.vocabularyMapper.hasMappingFor(f)&&w instanceof zo.IRI){let T=this.vocabularyMapper.generateMappedTriple(i,f,w);T&&r.push(T)}}if(f==="exo__Instance_class")for(let v of y){let b=this.valueToClassURI(v);if(b instanceof zo.IRI){let w=Kt.Namespace.RDF.term("type");r.push(new mr.Triple(i,w,b))}}if(f==="exo__Asset_label"){let v=Kt.Namespace.RDFS.term("label");for(let b of y)typeof b=="string"&&b.length>0&&r.push(new mr.Triple(i,v,new mn.Literal(b)))}}let o="exo__Instance_class"in t||"exo__Asset_uid"in t,c=t.exo__Asset_label,l="exo__Asset_label"in t&&c!==null&&c!==void 0&&!(typeof c=="string"&&c.trim()==="")&&!(Array.isArray(c)&&c.length===0);if(o&&!l){let f=Kt.Namespace.RDFS.term("label"),d=Kt.Namespace.EXO.term("Asset_label"),h=new mn.Literal(e.basename);r.push(new mr.Triple(i,f,h)),r.push(new mr.Triple(i,d,h))}r.push(...this.pendingExtraTriples),this.pendingExtraTriples=[];let u=await this.convertBodyWikilinks(e,i);return r.push(...u),r}async convertExo003Note(e,t){let r=Pn.Exo003Parser.parse(t);if(!r.success||!r.metadata)return[];let i=r.metadata,s=[];switch(i.metadata){case Pn.Exo003MetadataType.Namespace:break;case Pn.Exo003MetadataType.Anchor:s.push(...this.convertExo003Anchor(e,i));break;case Pn.Exo003MetadataType.BlankNode:s.push(...this.convertExo003BlankNode(e,i));break;case Pn.Exo003MetadataType.Statement:s.push(...this.convertExo003Statement(e,i));break;case Pn.Exo003MetadataType.Body:s.push(...await this.convertExo003Body(e,i));break}return s}convertExo003Anchor(e,t){let r=this.notePathToIRI(e.path),i=new zo.IRI(t.uri);return[new mr.Triple(r,Kt.Namespace.OWL.term("sameAs"),i),new mr.Triple(i,Kt.Namespace.OWL.term("sameAs"),r)]}convertExo003BlankNode(e,t){let r=this.notePathToIRI(e.path),i=t.uri.replace(/[^a-zA-Z0-9_-]/g,"_");return[new mr.Triple(r,Kt.Namespace.OWL.term("sameAs"),new gC.BlankNode(i))]}convertExo003Statement(e,t){let r=[];try{let i=this.createExo003ReferenceResolver(e),s=Pn.Exo003Parser.toTriple(t,i);r.push(s);let o=this.notePathToIRI(e.path);r.push(new mr.Triple(o,Kt.Namespace.RDF.term("value"),s.subject))}catch{}return r}async convertExo003Body(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.createExo003ReferenceResolver(e),c=o(t.subject),l=o(t.predicate);if(c.type==="literal")throw new Error("Body subject cannot be a literal");if(l.type!=="iri")throw new Error("Body predicate must be an IRI");let u=c.type==="iri"?new zo.IRI(c.value):new gC.BlankNode(c.value),f=new zo.IRI(l.value),d=Pn.Exo003Parser.toLiteral(t,s.trim());r.push(new mr.Triple(u,f,d));let h=this.notePathToIRI(e.path);r.push(new mr.Triple(h,Kt.Namespace.RDF.term("value"),u))}catch{}return r}createExo003ReferenceResolver(e){return t=>{let r=this.extractWikilink(t),i=r||t,s=this.vault.getFirstLinkpathDest(i,e.path);if(s){let o=this.vault.getFrontmatter(s);if(o&&Pn.Exo003Parser.isExo003Format(o)){let c=Pn.Exo003Parser.parse(o);if(c.success&&c.metadata){let l=c.metadata;if(l.metadata===Pn.Exo003MetadataType.Anchor||l.metadata===Pn.Exo003MetadataType.Namespace)return{type:"iri",value:l.uri};if(l.metadata===Pn.Exo003MetadataType.BlankNode)return{type:"blank",value:l.uri.replace(/[^a-zA-Z0-9_-]/g,"_")}}}return{type:"iri",value:this.notePathToIRI(s.path).value}}return!r&&t.includes("://")?{type:"iri",value:t}:{type:"literal",value:t}}}async convertVault(){return(await this.convertVaultWithValidation({strict:!1})).triples}async convertVaultWithValidation(e={}){let t=this.vault.getAllFiles(),r=[],i=[],s=e.strict??!1;for(let o of t)try{let c=this.vault.getFrontmatter(o),l=c?this.validateExocortexAsset(c,o.basename):null;if(l){if(s)throw new Error(`Invariant violation in "${o.path}": ${l.message}`);i.push({path:o.path,reason:`Invariant violation: ${l.message}`}),this.logger.warn(`Skipping file with invariant violation: ${o.path}`,{code:l.code,property:l.property,reason:l.message});continue}let u=await this.convertNote(o);r.push(...u)}catch(c){let l=c instanceof Error?c.message:String(c);if(s)throw new Error(`Invalid IRI for file "${o.path}": ${l}`);i.push({path:o.path,reason:`Invalid IRI: ${l}`}),this.logger.warn(`Skipping file with invalid IRI: ${o.path}`,{reason:l})}return{triples:r,skippedFiles:i,summary:{total:t.length,indexed:t.length-i.length,skipped:i.length}}}static inferLabelFromBasename(e){return Kt.Namespace.fromPropertyKey(e)!==null?e:null}validateExocortexAsset(e,t){let r=a(u=>u==null?!0:typeof u=="string"?u.trim()==="":Array.isArray(u)?u.length===0||u.every(r):!1,"isEmpty");if(!("exo__Instance_class"in e||"exo__Asset_uid"in e))return null;let s=["exo__Asset_uid","exo__Asset_isDefinedBy","exo__Instance_class"];for(let u of s){if(!(u in e))return{code:"MISSING_PROPERTY",property:u,message:`Required property "${u}" is missing`};if(r(e[u]))return{code:"EMPTY_PROPERTY",property:u,message:`Required property "${u}" is empty`}}let o=["ems__Effort_status","ems__Effort_parent","ems__Effort_lockedBy","ems__Effort_lockExpires","exo__Asset_updatedAt","ems__Effort_startTimestamp"];for(let u of o)if(u in e&&r(e[u]))return{code:"EMPTY_OPTIONAL_PROPERTY",property:u,message:`Optional property "${u}" is present but empty`};let c=e.exo__Instance_class,l=Array.isArray(c)?c:[c];for(let u of l){if(typeof u!="string")continue;let f=this.removeQuotes(u),h=(this.extractWikilink(f)??f).trim();if(/^[a-z][a-zA-Z0-9]*__/.test(h)&&/[\s()]/.test(h))return{code:"INVALID_INSTANCE_CLASS_IRI",property:"exo__Instance_class",message:`Invalid Instance_class IRI: "${u}"`}}return null}async validateVault(){let e=this.vault.getAllFiles(),t=[];for(let r of e){let i=(0,_C.vaultPathToIRI)(r.path);zo.IRI.isValidIRI(i)||t.push({path:r.path,reason:`Path "${r.path}" cannot be converted to a valid IRI`})}return t}notePathToIRI(e){return new zo.IRI((0,_C.vaultPathToIRI)(e))}isExocortexProperty(e){return Kt.Namespace.fromPropertyKey(e)!==null}propertyKeyToIRI(e){let t=Kt.Namespace.fromPropertyKey(e);if(!t)throw new Error(`Invalid property key: ${e}`);return t.namespace.term(t.localName)}emitTypeTripleForEnumInstance(e,t){let r=this.vault.getFrontmatter(t);if(!r)return;let i=r.exo__Instance_class,s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return;let o=this.valueToClassURI(s);o instanceof zo.IRI&&(this.pendingExtraTriples.push(new mr.Triple(e,Kt.Namespace.RDF.term("type"),o)),this.pendingExtraTriples.push(new mr.Triple(e,Kt.Namespace.EXO.term("Instance_class"),o)))}async valueToRDFObject(e,t,r){if(typeof e=="string"){let i=this.removeQuotes(e),s=this.extractWikilink(i);if(s){let o=this.vault.getFirstLinkpathDest(s,t.path);if(o){let l=this.notePathToIRI(o.path),u=s.includes("|")?s.split("|")[0]:s;if(this.isUUID(u)){let d=new mn.Literal(u),h=this.expandClassValue(o.basename);if(h)return this.emitTypeTripleForEnumInstance(h,o),[h];let p=this.vault.getFrontmatter(o);if(p){let v=p.exo__Asset_label;if(typeof v=="string"){let b=this.expandClassValue(v);if(b)return this.emitTypeTripleForEnumInstance(b,o),[b]}}return r?.value.endsWith("#Asset_prototype")||r?.value.endsWith("/Asset_prototype")?[l,d]:[l]}let f=this.expandClassValue(o.basename);return f?(this.emitTypeTripleForEnumInstance(f,o),[f]):[l]}if(this.isClassReference(s)){let l=this.expandClassValue(s);if(l)return[l]}let c=s.includes("|")?s.split("|")[0]:s;return this.isUUID(c)?[this.notePathToIRI(`${c}.md`)]:[new mn.Literal(i)]}if(this.isClassReference(i)){let o=this.expandClassValue(i);if(o)return[o]}return this.isISO8601DateTime(i)?[new mn.Literal(i,Kt.Namespace.XSD.term("dateTime"))]:[new mn.Literal(i)]}return typeof e=="boolean"?[new mn.Literal(e.toString())]:typeof e=="number"?[new mn.Literal(e.toString(),Kt.Namespace.XSD.term("decimal"))]:e instanceof Date?[new mn.Literal(e.toISOString(),Kt.Namespace.XSD.term("dateTime"))]:[new mn.Literal(String(e))]}isISO8601DateTime(e){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{1,3})?(Z|[+-]\d{2}:\d{2})?$/.test(e)}removeQuotes(e){let t=e.trim();return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.substring(1,t.length-1):e}extractWikilink(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1];return r.includes("|")?r.split("|")[0]:r}extractWikilinkAlias(e){let t=e.match(/^\[\[([^\]]+)\]\]$/);if(!t)return null;let r=t[1],i=r.indexOf("|");return i>=0?r.substring(i+1).trim():null}valueToClassURI(e){if(typeof e!="string")return new mn.Literal(String(e));let t=this.removeQuotes(e),i=this.extractWikilink(t)||t,s=this.expandClassValue(i);if(s)return s;let o=this.extractWikilinkAlias(t);if(o){let c=this.expandClassValue(o);if(c)return c}if(this.isUUID(i)){let c=this.vault.getFirstLinkpathDest(i,"");if(c){let l=this.expandClassValue(c.basename);if(l)return l;let u=this.vault.getFrontmatter(c);if(u){let f=u.exo__Asset_label;if(typeof f=="string"){let d=this.expandClassValue(f);if(d)return d}}}}return new mn.Literal(t)}isClassReference(e){return/\s/.test(e)?!1:Kt.Namespace.fromPropertyKey(e)!==null}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}expandClassValue(e){let t=this.removeQuotes(e),r=Kt.Namespace.fromPropertyKey(t);return r?r.namespace.term(r.localName):null}extractBodyContent(e){let t=/^---\r?\n[\s\S]*?\r?\n---\r?\n?/;return e.replace(t,"")}extractBodyWikilinks(e){let t=new Set,r,i=new RegExp(this.BODY_WIKILINK_PATTERN.source,"g");for(;(r=i.exec(e))!==null;)r[1]&&t.add(r[1]);return Array.from(t)}async convertBodyWikilinks(e,t){let r=[];try{let i=await this.vault.read(e),s=this.extractBodyContent(i),o=this.extractBodyWikilinks(s),c=Kt.Namespace.EXO.term("Asset_bodyLink");for(let l of o){let u=this.vault.getFirstLinkpathDest(l,e.path);if(u){let f=this.notePathToIRI(u.path);r.push(new mr.Triple(t,c,f))}else if(this.isClassReference(l)){let f=this.expandClassValue(l);f?r.push(new mr.Triple(t,c,f)):r.push(new mr.Triple(t,c,new mn.Literal(l)))}else r.push(new mr.Triple(t,c,new mn.Literal(l)))}}catch{}return r}};Bi.NoteToRDFConverter=wl;wl.SkippedFileInfo=class{constructor(n,e){this.path=n,this.reason=e}};wl.VaultValidationResult=class{constructor(n,e,t){this.triples=n,this.skippedFiles=e,this.summary=t}};wl.VaultValidationOptions=class{constructor(n=!1){this.strict=n}};Bi.NoteToRDFConverter=wl=sB([(0,mb.injectable)(),mC(0,(0,mb.inject)(yC.DI_TOKENS.IVaultAdapter)),mC(1,(0,mb.inject)(yC.DI_TOKENS.ILogger)),oB("design:paramtypes",[Object,Object])],wl)});var _b=S(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.FilterContainsOptimizer=void 0;var uB=Ae(),fB=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i,yb=class{static{a(this,"FilterContainsOptimizer")}constructor(){this.tripleStore=null,this.lastOptimizationHints=[]}setTripleStore(e){this.tripleStore=e}getLastOptimizationHints(){return this.lastOptimizationHints}clearHints(){this.lastOptimizationHints=[]}async optimize(e){return this.clearHints(),this.optimizeRecursive(e)}optimizeSync(e,t){return this.clearHints(),this.optimizeSyncRecursive(e,t)}async optimizeRecursive(e){return e.type==="filter"?this.optimizeFilter(e):e.type==="join"?{type:"join",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="leftjoin"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="union"?{type:"union",left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="minus"?{...e,left:await this.optimizeRecursive(e.left),right:await this.optimizeRecursive(e.right)}:e.type==="project"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="orderby"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="slice"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="distinct"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="reduced"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="group"?{...e,input:await this.optimizeRecursive(e.input)}:e.type==="extend"?{...e,input:await this.optimizeRecursive(e.input)}:e}optimizeSyncRecursive(e,t){return e.type==="filter"?this.optimizeFilterSync(e,t):e.type==="join"?{type:"join",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="leftjoin"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="union"?{type:"union",left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="minus"?{...e,left:this.optimizeSyncRecursive(e.left,t),right:this.optimizeSyncRecursive(e.right,t)}:e.type==="project"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="orderby"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="slice"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="distinct"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="reduced"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="group"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e.type==="extend"?{...e,input:this.optimizeSyncRecursive(e.input,t)}:e}async optimizeFilter(e){let t=this.detectContainsUUIDPattern(e.expression);if(!t)return{type:"filter",expression:e.expression,input:await this.optimizeRecursive(e.input)};let r=[];return this.tripleStore&&(r=await this.findSubjectsContainingUUID(t.uuid)),this.rewriteFilter(e,t,r)}optimizeFilterSync(e,t){let r=this.detectContainsUUIDPattern(e.expression);if(!r)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input,t)};let i=t?t.filter(s=>s.includes(r.uuid)):[];return this.rewriteFilter(e,r,i)}rewriteFilter(e,t,r){if(this.lastOptimizationHints.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${t.variable}), "${t.uuid}"))`,suggestedRewrite:r.length===1?`VALUES ?${t.variable} { <${r[0]}> }`:r.length>1?`VALUES ?${t.variable} { ${r.map(i=>`<${i}>`).join(" ")} }`:"No matching URIs found for UUID",estimatedSpeedup:r.length>0?"O(n) \u2192 O(1)":"N/A",matchedUri:r.length===1?r[0]:void 0}),r.length===0)return{type:"filter",expression:e.expression,input:this.optimizeSyncRecursive(e.input)};if(r.length===1){let i=this.injectSubjectConstraint(e.input,t.variable,r[0]);if(i!==e.input)return i}return this.createValuesJoin(e,t,r)}detectContainsUUIDPattern(e){if(e.type==="function"||e.type==="functionCall"){let t=e;if((typeof t.function=="string"?t.function.toLowerCase():t.function?.value?.toLowerCase()??"")==="contains"&&t.args.length===2)return this.analyzeContainsArgs(t.args[0],t.args[1],e)}if(e.type==="logical"&&e.operator==="&&")for(let t of e.operands){let r=this.detectContainsUUIDPattern(t);if(r)return r}return null}analyzeContainsArgs(e,t,r){let i=null;if(e.type==="function"||e.type==="functionCall"){let s=e;if((typeof s.function=="string"?s.function.toLowerCase():s.function?.value?.toLowerCase()??"")==="str"&&s.args.length===1){let c=s.args[0];c.type==="variable"&&(i=c.name)}}if(!i&&e.type==="variable"&&(i=e.name),!i)return null;if(t.type==="literal"){let c=String(t.value).match(fB);if(c)return{variable:i,uuid:c[0].toLowerCase(),originalExpression:r}}return null}async findSubjectsContainingUUID(e){if(!this.tripleStore)return[];if(this.tripleStore.findSubjectsByUUID)return(await this.tripleStore.findSubjectsByUUID(e)).map(s=>s.value);let t=await this.tripleStore.subjects(),r=[];for(let i of t)i instanceof uB.IRI&&i.value.toLowerCase().includes(e.toLowerCase())&&r.push(i.value);return r}injectSubjectConstraint(e,t,r){if(e.type==="bgp"){let i=e.triples.map(o=>o.subject.type==="variable"&&o.subject.value===t?{...o,subject:{type:"iri",value:r}}:o);if(i.some((o,c)=>o.subject!==e.triples[c].subject))return{type:"bgp",triples:i}}if(e.type==="join"){let i=this.injectSubjectConstraint(e.left,t,r),s=this.injectSubjectConstraint(e.right,t,r);if(i!==e.left||s!==e.right)return{type:"join",left:i,right:s}}if(e.type==="filter"){let i=this.injectSubjectConstraint(e.input,t,r);if(i!==e.input)return{...e,input:i}}return e}createValuesJoin(e,t,r){return{type:"join",left:{type:"values",variables:[t.variable],bindings:r.map(o=>({[t.variable]:{type:"iri",value:o}}))},right:this.optimizeSyncRecursive(e.input)}}analyzeQuery(e){let t=[];return this.analyzeRecursive(e,t),t}analyzeRecursive(e,t){if(e.type==="filter"){let r=this.detectContainsUUIDPattern(e.expression);r&&t.push({type:"uuid-index-lookup",originalPattern:`FILTER(CONTAINS(STR(?${r.variable}), "${r.uuid}"))`,suggestedRewrite:`Use --optimize flag or rewrite as VALUES ?${r.variable} { <uri-containing-uuid> }`,estimatedSpeedup:"O(n) \u2192 O(1) with UUID index lookup"}),this.analyzeRecursive(e.input,t);return}e.type==="join"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="leftjoin"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="union"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="minus"?(this.analyzeRecursive(e.left,t),this.analyzeRecursive(e.right,t)):e.type==="project"?this.analyzeRecursive(e.input,t):e.type==="orderby"?this.analyzeRecursive(e.input,t):e.type==="slice"?this.analyzeRecursive(e.input,t):e.type==="distinct"?this.analyzeRecursive(e.input,t):e.type==="reduced"?this.analyzeRecursive(e.input,t):e.type==="group"?this.analyzeRecursive(e.input,t):e.type==="extend"&&this.analyzeRecursive(e.input,t)}};Im.FilterContainsOptimizer=yb});var SC=S(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.AlgebraOptimizer=void 0;var dB=_b(),Sb=class{static{a(this,"AlgebraOptimizer")}constructor(){this.stats=new Map,this.tripleStore=null,this.filterContainsOptimizer=new dB.FilterContainsOptimizer}setTripleStore(e){this.tripleStore=e,this.filterContainsOptimizer.setTripleStore(e)}getOptimizationHints(){return this.filterContainsOptimizer.getLastOptimizationHints()}analyzeQuery(e){return this.filterContainsOptimizer.analyzeQuery(e)}optimize(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),t=this.filterPushDown(t),t=this.joinReordering(t),t}async optimizeAsync(e){let t=e;return t=this.eliminateEmptyBGPInFilterJoin(t),this.tripleStore&&(t=await this.filterContainsOptimizer.optimize(t)),t=this.filterPushDown(t),t=this.joinReordering(t),t}optimizeWithSubjects(e,t){let r=e;return r=this.eliminateEmptyBGPInFilterJoin(r),r=this.filterContainsOptimizer.optimizeSync(r,t),r=this.filterPushDown(r),r=this.joinReordering(r),r}eliminateEmptyBGPInFilterJoin(e){if(e.type==="join"){if(e.left.type==="filter"){let t=e.left;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.right)}}if(e.right.type==="filter"){let t=e.right;if(t.input.type==="bgp"&&t.input.triples.length===0)return{type:"filter",expression:t.expression,input:this.eliminateEmptyBGPInFilterJoin(e.left)}}return{type:"join",left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}}return e.type==="filter"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="leftjoin"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="union"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="minus"?{...e,left:this.eliminateEmptyBGPInFilterJoin(e.left),right:this.eliminateEmptyBGPInFilterJoin(e.right)}:e.type==="project"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="orderby"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="slice"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e.type==="distinct"?{...e,input:this.eliminateEmptyBGPInFilterJoin(e.input)}:e}filterPushDown(e){return e.type==="filter"?this.pushDownFilter(e):e.type==="join"?{type:"join",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="leftjoin"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="union"?{type:"union",left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="minus"?{...e,left:this.filterPushDown(e.left),right:this.filterPushDown(e.right)}:e.type==="project"?{...e,input:this.filterPushDown(e.input)}:e.type==="orderby"?{...e,input:this.filterPushDown(e.input)}:e.type==="slice"?{...e,input:this.filterPushDown(e.input)}:e.type==="distinct"?{...e,input:this.filterPushDown(e.input)}:e}pushDownFilter(e){let t=e.input;if(t.type==="join"){let r=this.getFilterVariables(e.expression),i=this.getOperationVariables(t.left),s=this.getOperationVariables(t.right),o=r.every(l=>i.has(l)),c=r.every(l=>s.has(l));return o&&!c?{type:"join",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:this.filterPushDown(t.right)}:c&&!o?{type:"join",left:this.filterPushDown(t.left),right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:{type:"join",left:this.filterPushDown(t.left),right:this.filterPushDown(t.right)}}}return t.type==="union"?{type:"union",left:{type:"filter",expression:e.expression,input:this.filterPushDown(t.left)},right:{type:"filter",expression:e.expression,input:this.filterPushDown(t.right)}}:{type:"filter",expression:e.expression,input:this.filterPushDown(t)}}getFilterVariables(e){let t=[];if(e.type==="variable")t.push(e.name);else if(e.type==="comparison")t.push(...this.getFilterVariables(e.left)),t.push(...this.getFilterVariables(e.right));else if(e.type==="logical")for(let r of e.operands)t.push(...this.getFilterVariables(r));else if(e.type==="function")for(let r of e.args)t.push(...this.getFilterVariables(r));return Array.from(new Set(t))}getOperationVariables(e){let t=new Set;if(e.type==="bgp")for(let r of e.triples)r.subject.type==="variable"&&t.add(r.subject.value),r.predicate.type==="variable"&&t.add(r.predicate.value),r.object.type==="variable"&&t.add(r.object.value);else if(e.type==="join"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="filter")return this.getOperationVariables(e.input);if(e.type==="leftjoin"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else if(e.type==="union"){let r=this.getOperationVariables(e.left),i=this.getOperationVariables(e.right);return new Set([...r,...i])}else{if(e.type==="minus")return this.getOperationVariables(e.left);if(e.type==="project")return new Set(e.variables)}}return t}joinReordering(e){return e.type==="join"?this.reorderJoin(e):e.type==="filter"?{...e,input:this.joinReordering(e.input)}:e.type==="leftjoin"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="union"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="minus"?{...e,left:this.joinReordering(e.left),right:this.joinReordering(e.right)}:e.type==="project"?{...e,input:this.joinReordering(e.input)}:e.type==="orderby"?{...e,input:this.joinReordering(e.input)}:e.type==="slice"?{...e,input:this.joinReordering(e.input)}:e.type==="distinct"?{...e,input:this.joinReordering(e.input)}:e}reorderJoin(e){let t=this.isConstrained(e.left),r=this.isConstrained(e.right);if(r&&!t)return{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)};if(t&&!r)return{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)};let i=this.estimateCost(e.left);return this.estimateCost(e.right)<i?{type:"join",left:this.joinReordering(e.right),right:this.joinReordering(e.left)}:{type:"join",left:this.joinReordering(e.left),right:this.joinReordering(e.right)}}isConstrained(e){return e.type==="values"?!0:e.type==="bgp"?e.triples.some(t=>t.object.type!=="variable"||t.subject.type!=="variable"):e.type==="filter"?this.isConstrained(e.input):e.type==="join"?this.isConstrained(e.left)||this.isConstrained(e.right):e.type==="union"?this.isConstrained(e.left)&&this.isConstrained(e.right):!1}estimateCost(e){if(e.type==="bgp"){let t=0;for(let r of e.triples){let i=10;r.subject.type==="variable"&&(i*=10),r.predicate.type==="variable"&&(i*=20),r.object.type==="variable"&&(i*=5),t+=i}return t}if(e.type==="filter")return this.estimateCost(e.input)*.3;if(e.type==="join"){let t=this.estimateCost(e.left),r=this.estimateCost(e.right);return e.left.type==="values"||e.right.type==="values"?Math.min(t,r)*2:t*r}if(e.type==="leftjoin")return this.estimateCost(e.left)+this.estimateCost(e.right)*.5;if(e.type==="union")return this.estimateCost(e.left)+this.estimateCost(e.right);if(e.type==="values"){let t=e.bindings;return Array.isArray(t)?t.length*5:10}return e.type==="minus"?this.estimateCost(e.left)+this.estimateCost(e.right)*.3:100}setStatistics(e,t){this.stats.set(e,t)}getStatistics(e){return this.stats.get(e)}};Pm.AlgebraOptimizer=Sb});var vC=S(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.AlgebraSerializer=void 0;var vb=class{static{a(this,"AlgebraSerializer")}toString(e,t=0){let r=" ".repeat(t);switch(e.type){case"bgp":return`${r}BGP [
378
378
  ${e.triples.map(u=>`${r} ${this.tripleToString(u)}`).join(`
379
379
  `)}
380
380
  ${r}]`;case"filter":return`${r}Filter(
@@ -406,92 +406,92 @@ ${r})`;case"extend":return`${r}Extend (?${e.variable} = ${this.expressionToStrin
406
406
  ${this.toString(e.input,t+1)}
407
407
  ${r})`;case"subquery":return`${r}Subquery(
408
408
  ${this.toString(e.query,t+1)}
409
- ${r})`;default:return`${r}Unknown(${e.type})`}}tripleToString(e){return`${this.elementToString(e.subject)} ${this.predicateToString(e.predicate)} ${this.elementToString(e.object)}`}predicateToString(e){return this.isPropertyPath(e)?this.propertyPathToString(e):this.elementToString(e)}isPropertyPath(e){return e.type==="path"}propertyPathToString(e){let t=e.items.map(r=>r.type==="path"?`(${this.propertyPathToString(r)})`:`<${r.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}elementToString(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":let t=`"${e.value}"`;return e.language&&(t+=`@${e.language}`),e.datatype&&(t+=`^^<${e.datatype}>`),t;case"blank":return`_:${e.value}`;default:return String(e)}}expressionToString(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value}"`:String(e.value);case"comparison":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"logical":return e.operator==="!"?`!(${this.expressionToString(e.operands[0])})`:`(${e.operands.map(t=>this.expressionToString(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"function":return`${e.function}(${e.args.map(t=>this.expressionToString(t)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.toString(e.pattern,0)} }`;default:return"unknown"}}toJSON(e){return JSON.stringify(e,null,2)}};Om.AlgebraSerializer=vb});var wC=S(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.DescribeExecutor=void 0;var bC=Ae(),bb=class{static{a(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,o=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,o,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,o,c){let l=e.toString();if(c.has(l)||(c.add(l),t!==void 0&&r>t))return;let u=[],f=await this.tripleStore.match(e,void 0,void 0);if(u.push(...f),i){let h=await this.tripleStore.match(void 0,void 0,e);u.push(...h)}let d=[];for(let h of u){let p=`${h.subject.toString()}|${h.predicate.toString()}|${h.object.toString()}`;o.has(p)||(o.add(p),s.push(h),(t===void 0||r<t)&&(this.isIRI(h.subject)&&h.subject.toString()!==l&&d.push(h.subject),this.isIRI(h.object)&&h.object.toString()!==l&&d.push(h.object)))}for(let h of d)await this.describeResourceWithDepth(h,t,r+1,i,s,o,c)}isIRI(e){if(!e||typeof e!="object")return!1;let t=e;return e instanceof bC.IRI||t.termType==="NamedNode"||typeof t.value=="string"&&t.value.startsWith("http")}async describeByIRI(e,t){let r=new bC.IRI(e);return this.execute([r],t)}};Fm.DescribeExecutor=bb});var TC=S(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.UpdateExecutor=Tl.UpdateExecutorError=void 0;var dB=Yn(),El=Ae(),wb=Ne(),EC=qt(),Xr=class extends Error{static{a(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};Tl.UpdateExecutorError=Xr;var Eb=class{static{a(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new Xr("Expected UPDATE request");let t=[];for(let r of e.updates){let i=await this.executeOperation(r);t.push(i)}return t}async executeOperation(e){if("updateType"in e)switch(e.updateType){case"insert":return this.executeInsertData(e);case"delete":return this.executeDeleteData(e);case"insertdelete":throw new Xr("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new Xr("DELETE WHERE not yet implemented");default:throw new Xr(`Unknown update type: ${e.updateType}`)}if("type"in e)switch(e.type){case"clear":case"drop":case"load":case"create":case"copy":case"move":case"add":throw new Xr(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new Xr(`Unknown operation type: ${e.type}`)}throw new Xr("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new Xr("Expected INSERT DATA operation");let t=e,r=0;for(let i of t.insert)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.insertTriples(i.triples,s)}else if(i.type==="graph"){let s=i,o=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,o)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new Xr("Expected DELETE DATA operation");let t=e,r=0;for(let i of t.delete)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.deleteTriples(i.triples,s)}else if(i.type==="graph"){let s=i,o=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,o)}return{type:"delete",deleted:r,success:!0}}async insertTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i);t&&this.tripleStore.addToGraph?await this.tripleStore.addToGraph(s,t):await this.tripleStore.add(s),r++}return r}async deleteTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i),o;t&&this.tripleStore.removeFromGraph?o=await this.tripleStore.removeFromGraph(s,t):o=await this.tripleStore.remove(s),o&&r++}return r}convertTriple(e){return new dB.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new El.IRI(e.value);if(e.termType==="BlankNode")return new EC.BlankNode(e.value);throw new Xr(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new El.IRI(e.value);throw new Xr("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new El.IRI(e.value);if(e.termType==="BlankNode")return new EC.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new wb.Literal(t.value,void 0,t.language):t.datatype?new wb.Literal(t.value,new El.IRI(t.datatype.value)):new wb.Literal(t.value)}throw new Xr(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new El.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new Xr("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new El.IRI(e.value)}};Tl.UpdateExecutor=Eb});var xC=S(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.AggregateFunctions=void 0;var Tb=Ne(),AC=Ae(),Ab=class{static{a(this,"AggregateFunctions")}static count(e,t){if(!t)return e.length;let r=0;for(let i of e)i.has(t)&&r++;return r}static countDistinct(e,t){let r=new Set;for(let i of e){let s=i.get(t);s&&r.add(s.toString())}return r.size}static sum(e,t){let r=0;for(let i of e){let s=i.get(t);if(s instanceof Tb.Literal){let o=this.toNumber(s);isNaN(o)||(r+=o)}}return r}static avg(e,t){let r=this.sum(e,t),i=this.count(e,t);return i>0?r/i:0}static min(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o<r)&&(r=o)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o>r)&&(r=o)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let o=s.get(t);o&&(o instanceof Tb.Literal||o instanceof AC.IRI?i.push(o.value):i.push(o.toString()))}return i.join(r)}static sample(e,t){for(let r of e){let i=r.get(t);if(i)return this.toComparable(i)}return null}static sampleDistinct(e,t){return this.sample(e,t)}static toNumber(e){let t=e.datatype?.value;return t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double"),parseFloat(e.value)}static toComparable(e){if(e instanceof Tb.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof AC.IRI?e.value:String(e)}};Dm.AggregateFunctions=Ab});var CC=S(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.QueryPlanCache=void 0;var hB=om(),xb=class{static{a(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new hB.LRUCache(e)}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r!==void 0?this.hits++:this.misses++,r}set(e,t){let r=this.normalizeQuery(e);this.cache.set(r,t)}has(e){let t=this.normalizeQuery(e);return this.cache.get(t)!==void 0}clear(){this.cache.clear()}getStats(){let e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0,size:this.cache.size()}}resetStats(){this.hits=0,this.misses=0}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}};Nm.QueryPlanCache=xb});var RC=S(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.SPARQLResultCache=void 0;_f.createSPARQLResultCache=gB;var pB=om(),mB={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Lm=class{static{a(this,"SPARQLResultCache")}constructor(e={}){this.fileToQueries=new Map,this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0},this.avgQueryTimeMs=100,this.options={...mB,...e},this.cache=new pB.LRUCache(this.options.maxSize)}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}hashResult(e){return this.isTripleArray(e)?`T:${e.length}`:`S:${e.length}`}isTripleArray(e){return e.length>0&&"subject"in e[0]}estimateResultSize(e){return this.isTripleArray(e)?e.length*300:e.length*200}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);if(r===void 0){this.stats.misses++;return}if(Date.now()-r.timestamp>this.options.ttlMs){this.cache.set(t,void 0),this.stats.ttlInvalidations++,this.stats.misses++;return}return this.stats.hits++,this.stats.totalTimeSavedMs+=this.avgQueryTimeMs,r.result}set(e,t,r,i){if(this.estimateResultSize(t)>this.options.maxResultSizeBytes)return;i!==void 0&&(this.avgQueryTimeMs=(this.avgQueryTimeMs+i)/2);let o=this.normalizeQuery(e),c=r??new Set,l={result:t,timestamp:Date.now(),affectedFiles:c,resultHash:this.hashResult(t)};if(this.cache.size()>=this.options.maxSize&&this.stats.evictions++,this.cache.set(o,l),this.options.enableFileInvalidation)for(let f of c){let d=this.fileToQueries.get(f);d||(d=new Set,this.fileToQueries.set(f,d)),d.add(o)}}has(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r===void 0?!1:Date.now()-r.timestamp<=this.options.ttlMs}invalidateByFile(e){if(!this.options.enableFileInvalidation)return 0;let t=this.fileToQueries.get(e);if(!t)return 0;let r=0;for(let i of t)this.cache.set(i,void 0),r++,this.stats.fileInvalidations++;return this.fileToQueries.delete(e),r}clear(){this.cache.clear(),this.fileToQueries.clear()}getStats(){let e=this.stats.hits+this.stats.misses,t=e>0?this.stats.hits/e:0;return{hits:this.stats.hits,misses:this.stats.misses,hitRate:t,size:this.cache.size(),maxSize:this.options.maxSize,evictions:this.stats.evictions,ttlInvalidations:this.stats.ttlInvalidations,fileInvalidations:this.stats.fileInvalidations,avgTimeSavedMs:this.stats.hits>0?this.stats.totalTimeSavedMs/this.stats.hits:0}}resetStats(){this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0}}size(){return this.cache.size()}pruneExpired(){return 0}};_f.SPARQLResultCache=Lm;function gB(n){return new Lm(n)}a(gB,"createSPARQLResultCache")});var IC=S(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.IncrementalIndexer=void 0;Sf.createIncrementalIndexer=SB;var yB=Uo(),_B={throttleMs:500,maxBatchSize:100,useContentHashing:!1},km=class{static{a(this,"IncrementalIndexer")}constructor(e={}){this.fileMetadata=new Map,this.pendingChanges=[],this.throttleTimer=null,this.invalidateCallbacks=[],this.lastIndexTime=0,this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]},this.options={..._B,...e}}recordChange(e){this.pendingChanges.push(e),this.stats.totalChanges++,this.throttleTimer===null&&(this.throttleTimer=setTimeout(()=>{this.processPendingChanges(),this.throttleTimer=null},this.options.throttleMs))}processPendingChanges(){if(this.pendingChanges.length===0)return;let e=performance.now(),t=new Map;for(let o of this.pendingChanges)t.set(o.path,o);let r=Array.from(t.values()),i=[];for(let o of r)switch(o.type){case"deleted":this.fileMetadata.delete(o.path),i.push(o);break;case"renamed":o.oldPath&&this.fileMetadata.delete(o.oldPath),i.push(o);break;case"created":case"modified":i.push(o);break}if(i.length>0){this.stats.invalidations+=i.length;for(let o of this.invalidateCallbacks)try{o(i)}catch(c){yB.LoggingService.error("IncrementalIndexer: Error in invalidation callback",c instanceof Error?c:new Error(String(c)))}}let s=performance.now()-e;this.stats.indexDurations.push(s),this.stats.indexDurations.length>100&&this.stats.indexDurations.shift(),this.lastIndexTime=Date.now(),this.pendingChanges=[]}flush(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.processPendingChanges()}updateMetadata(e,t,r,i){this.fileMetadata.set(e,{mtime:t,size:r,contentHash:i})}hasChanged(e,t,r){let i=this.fileMetadata.get(e);return i===void 0||i.mtime!==t||r!==void 0&&i.size!==r}getChangedFiles(e){let t=[];for(let[r,i]of this.fileMetadata.entries())i.mtime>e&&t.push(r);return t}onInvalidate(e){return this.invalidateCallbacks.push(e),()=>{let t=this.invalidateCallbacks.indexOf(e);t!==-1&&this.invalidateCallbacks.splice(t,1)}}getStats(){let e=this.stats.indexDurations,t=e.length>0?e.reduce((i,s)=>i+s,0)/e.length:0,r=e.length>0?e[e.length-1]:0;return{trackedFiles:this.fileMetadata.size,totalChanges:this.stats.totalChanges,invalidations:this.stats.invalidations,noOpChanges:this.stats.noOpChanges,lastIndexDurationMs:r,avgIndexDurationMs:t,lastIndexTime:this.lastIndexTime}}resetStats(){this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]}}clear(){this.fileMetadata.clear(),this.pendingChanges=[],this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null)}size(){return this.fileMetadata.size}isTracked(e){return this.fileMetadata.has(e)}getMetadata(e){return this.fileMetadata.get(e)}dispose(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.invalidateCallbacks=[],this.pendingChanges=[],this.fileMetadata.clear()}};Sf.IncrementalIndexer=km;function SB(n){return new km(n)}a(SB,"createIncrementalIndexer")});var PC=S(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.ResultSerializer=void 0;var Mm=Ne(),jm=Ae(),$m=qt(),Cb=class{static{a(this,"ResultSerializer")}serialize(e,t,r={}){switch(t){case"json":return this.serializeJSON(e,r);case"xml":return this.serializeXML(e,r);case"csv":return this.serializeCSV(e,r);case"turtle":return this.serializeTurtle(e,r);default:throw new Error(`Unsupported result format: ${t}`)}}serializeJSON(e,t={}){let r=this.toJSONResultSet(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}toJSONResultSet(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(o=>{let c={};for(let l of i){let u=o.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof jm.IRI?{type:"uri",value:e.value}:e instanceof $m.BlankNode?{type:"bnode",value:e.id}:e instanceof Mm.Literal?this.literalToJSONBinding(e):{type:"literal",value:String(e)}}literalToJSONBinding(e){let t={type:"literal",value:e.value};return e.datatype?t.datatype=e.datatype.value:e.language&&(t["xml:lang"]=e.language,e.hasDirection()&&e.direction&&(t.direction=e.direction)),t}serializeXML(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=['<?xml version="1.0"?>','<sparql xmlns="http://www.w3.org/2005/sparql-results#">'," <head>"];for(let o of i)s.push(` <variable name="${this.escapeXML(o)}"/>`);s.push(" </head>"),s.push(" <results>");for(let o of e){s.push(" <result>");for(let c of i){let l=o.get(c);l!==void 0&&(s.push(` <binding name="${this.escapeXML(c)}">`),s.push(" "+this.termToXML(l)),s.push(" </binding>"))}s.push(" </result>")}return s.push(" </results>"),s.push("</sparql>"),s.join(`
409
+ ${r})`;default:return`${r}Unknown(${e.type})`}}tripleToString(e){return`${this.elementToString(e.subject)} ${this.predicateToString(e.predicate)} ${this.elementToString(e.object)}`}predicateToString(e){return this.isPropertyPath(e)?this.propertyPathToString(e):this.elementToString(e)}isPropertyPath(e){return e.type==="path"}propertyPathToString(e){let t=e.items.map(r=>r.type==="path"?`(${this.propertyPathToString(r)})`:`<${r.value}>`);switch(e.pathType){case"/":return t.join("/");case"|":return t.join("|");case"^":return`^${t[0]}`;case"+":return`${t[0]}+`;case"*":return`${t[0]}*`;case"?":return`${t[0]}?`}}elementToString(e){switch(e.type){case"variable":return`?${e.value}`;case"iri":return`<${e.value}>`;case"literal":let t=`"${e.value}"`;return e.language&&(t+=`@${e.language}`),e.datatype&&(t+=`^^<${e.datatype}>`),t;case"blank":return`_:${e.value}`;default:return String(e)}}expressionToString(e){switch(e.type){case"variable":return`?${e.name}`;case"literal":return typeof e.value=="string"?`"${e.value}"`:String(e.value);case"comparison":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"logical":return e.operator==="!"?`!(${this.expressionToString(e.operands[0])})`:`(${e.operands.map(t=>this.expressionToString(t)).join(` ${e.operator} `)})`;case"arithmetic":return`(${this.expressionToString(e.left)} ${e.operator} ${this.expressionToString(e.right)})`;case"function":return`${e.function}(${e.args.map(t=>this.expressionToString(t)).join(", ")})`;case"exists":return`${e.negated?"NOT EXISTS":"EXISTS"} { ${this.toString(e.pattern,0)} }`;default:return"unknown"}}toJSON(e){return JSON.stringify(e,null,2)}};Om.AlgebraSerializer=vb});var wC=S(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.DescribeExecutor=void 0;var bC=Ae(),bb=class{static{a(this,"DescribeExecutor")}constructor(e){this.tripleStore=e}async execute(e,t){let r=[],i=new Set,s=new Set,o=t?.depth;for(let c of e)await this.describeResourceWithDepth(c,o,1,t?.symmetric??!0,r,i,s);return r}async describeResourceWithDepth(e,t,r,i,s,o,c){let l=e.toString();if(c.has(l)||(c.add(l),t!==void 0&&r>t))return;let u=[],f=await this.tripleStore.match(e,void 0,void 0);if(u.push(...f),i){let h=await this.tripleStore.match(void 0,void 0,e);u.push(...h)}let d=[];for(let h of u){let p=`${h.subject.toString()}|${h.predicate.toString()}|${h.object.toString()}`;o.has(p)||(o.add(p),s.push(h),(t===void 0||r<t)&&(this.isIRI(h.subject)&&h.subject.toString()!==l&&d.push(h.subject),this.isIRI(h.object)&&h.object.toString()!==l&&d.push(h.object)))}for(let h of d)await this.describeResourceWithDepth(h,t,r+1,i,s,o,c)}isIRI(e){if(!e||typeof e!="object")return!1;let t=e;return e instanceof bC.IRI||t.termType==="NamedNode"||typeof t.value=="string"&&t.value.startsWith("http")}async describeByIRI(e,t){let r=new bC.IRI(e);return this.execute([r],t)}};Fm.DescribeExecutor=bb});var TC=S(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.UpdateExecutor=Tl.UpdateExecutorError=void 0;var hB=Yn(),El=Ae(),wb=Ne(),EC=qt(),Xr=class extends Error{static{a(this,"UpdateExecutorError")}constructor(e,t){super(e,t?{cause:t}:void 0),this.name="UpdateExecutorError"}};Tl.UpdateExecutorError=Xr;var Eb=class{static{a(this,"UpdateExecutor")}constructor(e){this.tripleStore=e}async execute(e){if(e.type!=="update")throw new Xr("Expected UPDATE request");let t=[];for(let r of e.updates){let i=await this.executeOperation(r);t.push(i)}return t}async executeOperation(e){if("updateType"in e)switch(e.updateType){case"insert":return this.executeInsertData(e);case"delete":return this.executeDeleteData(e);case"insertdelete":throw new Xr("INSERT/DELETE with WHERE clause not yet implemented");case"deletewhere":throw new Xr("DELETE WHERE not yet implemented");default:throw new Xr(`Unknown update type: ${e.updateType}`)}if("type"in e)switch(e.type){case"clear":case"drop":case"load":case"create":case"copy":case"move":case"add":throw new Xr(`${e.type.toUpperCase()} operation not yet implemented`);default:throw new Xr(`Unknown operation type: ${e.type}`)}throw new Xr("Unknown update operation structure")}async executeInsertData(e){if(e.updateType!=="insert")throw new Xr("Expected INSERT DATA operation");let t=e,r=0;for(let i of t.insert)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.insertTriples(i.triples,s)}else if(i.type==="graph"){let s=i,o=this.parseGraphName(s.name);r+=await this.insertTriples(s.triples,o)}return{type:"insert",inserted:r,success:!0}}async executeDeleteData(e){if(e.updateType!=="delete")throw new Xr("Expected DELETE DATA operation");let t=e,r=0;for(let i of t.delete)if(i.type==="bgp"){let s=this.resolveGraphName(t.graph);r+=await this.deleteTriples(i.triples,s)}else if(i.type==="graph"){let s=i,o=this.parseGraphName(s.name);r+=await this.deleteTriples(s.triples,o)}return{type:"delete",deleted:r,success:!0}}async insertTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i);t&&this.tripleStore.addToGraph?await this.tripleStore.addToGraph(s,t):await this.tripleStore.add(s),r++}return r}async deleteTriples(e,t){let r=0;for(let i of e){let s=this.convertTriple(i),o;t&&this.tripleStore.removeFromGraph?o=await this.tripleStore.removeFromGraph(s,t):o=await this.tripleStore.remove(s),o&&r++}return r}convertTriple(e){return new hB.Triple(this.convertSubject(e.subject),this.convertPredicate(e.predicate),this.convertObject(e.object))}convertSubject(e){if(e.termType==="NamedNode")return new El.IRI(e.value);if(e.termType==="BlankNode")return new EC.BlankNode(e.value);throw new Xr(`Invalid subject term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}convertPredicate(e){if("termType"in e&&e.termType==="NamedNode")return new El.IRI(e.value);throw new Xr("Invalid predicate term type. Only IRIs are allowed in INSERT DATA.")}convertObject(e){if(e.termType==="NamedNode")return new El.IRI(e.value);if(e.termType==="BlankNode")return new EC.BlankNode(e.value);if(e.termType==="Literal"){let t=e;return t.language?new wb.Literal(t.value,void 0,t.language):t.datatype?new wb.Literal(t.value,new El.IRI(t.datatype.value)):new wb.Literal(t.value)}throw new Xr(`Invalid object term type: ${e.termType}. Variables are not allowed in INSERT DATA.`)}resolveGraphName(e){if(e&&!e.default&&e.name)return new El.IRI(e.name.value)}parseGraphName(e){if(e.termType==="Variable")throw new Xr("Variables are not allowed as graph names in INSERT DATA / DELETE DATA.");return new El.IRI(e.value)}};Tl.UpdateExecutor=Eb});var xC=S(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.AggregateFunctions=void 0;var Tb=Ne(),AC=Ae(),Ab=class{static{a(this,"AggregateFunctions")}static count(e,t){if(!t)return e.length;let r=0;for(let i of e)i.has(t)&&r++;return r}static countDistinct(e,t){let r=new Set;for(let i of e){let s=i.get(t);s&&r.add(s.toString())}return r.size}static sum(e,t){let r=0;for(let i of e){let s=i.get(t);if(s instanceof Tb.Literal){let o=this.toNumber(s);isNaN(o)||(r+=o)}}return r}static avg(e,t){let r=this.sum(e,t),i=this.count(e,t);return i>0?r/i:0}static min(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o<r)&&(r=o)}return r}static max(e,t){let r=null;for(let i of e){let s=i.get(t);if(!s)continue;let o=this.toComparable(s);(r===null||o>r)&&(r=o)}return r}static groupConcat(e,t,r=" "){let i=[];for(let s of e){let o=s.get(t);o&&(o instanceof Tb.Literal||o instanceof AC.IRI?i.push(o.value):i.push(o.toString()))}return i.join(r)}static sample(e,t){for(let r of e){let i=r.get(t);if(i)return this.toComparable(i)}return null}static sampleDistinct(e,t){return this.sample(e,t)}static toNumber(e){let t=e.datatype?.value;return t?.includes("#integer")||t?.includes("#decimal")||t?.includes("#double"),parseFloat(e.value)}static toComparable(e){if(e instanceof Tb.Literal){let t=this.toNumber(e);return isNaN(t)?e.value:t}return e instanceof AC.IRI?e.value:String(e)}};Dm.AggregateFunctions=Ab});var CC=S(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.QueryPlanCache=void 0;var pB=om(),xb=class{static{a(this,"QueryPlanCache")}constructor(e=100){this.hits=0,this.misses=0,this.cache=new pB.LRUCache(e)}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r!==void 0?this.hits++:this.misses++,r}set(e,t){let r=this.normalizeQuery(e);this.cache.set(r,t)}has(e){let t=this.normalizeQuery(e);return this.cache.get(t)!==void 0}clear(){this.cache.clear()}getStats(){let e=this.hits+this.misses;return{hits:this.hits,misses:this.misses,hitRate:e>0?this.hits/e:0,size:this.cache.size()}}resetStats(){this.hits=0,this.misses=0}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}};Nm.QueryPlanCache=xb});var RC=S(_f=>{"use strict";Object.defineProperty(_f,"__esModule",{value:!0});_f.SPARQLResultCache=void 0;_f.createSPARQLResultCache=yB;var mB=om(),gB={maxSize:500,ttlMs:300*1e3,enableFileInvalidation:!0,maxResultSizeBytes:10*1024*1024},Lm=class{static{a(this,"SPARQLResultCache")}constructor(e={}){this.fileToQueries=new Map,this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0},this.avgQueryTimeMs=100,this.options={...gB,...e},this.cache=new mB.LRUCache(this.options.maxSize)}normalizeQuery(e){return e.replace(/\s+/g," ").trim()}hashResult(e){return this.isTripleArray(e)?`T:${e.length}`:`S:${e.length}`}isTripleArray(e){return e.length>0&&"subject"in e[0]}estimateResultSize(e){return this.isTripleArray(e)?e.length*300:e.length*200}get(e){let t=this.normalizeQuery(e),r=this.cache.get(t);if(r===void 0){this.stats.misses++;return}if(Date.now()-r.timestamp>this.options.ttlMs){this.cache.set(t,void 0),this.stats.ttlInvalidations++,this.stats.misses++;return}return this.stats.hits++,this.stats.totalTimeSavedMs+=this.avgQueryTimeMs,r.result}set(e,t,r,i){if(this.estimateResultSize(t)>this.options.maxResultSizeBytes)return;i!==void 0&&(this.avgQueryTimeMs=(this.avgQueryTimeMs+i)/2);let o=this.normalizeQuery(e),c=r??new Set,l={result:t,timestamp:Date.now(),affectedFiles:c,resultHash:this.hashResult(t)};if(this.cache.size()>=this.options.maxSize&&this.stats.evictions++,this.cache.set(o,l),this.options.enableFileInvalidation)for(let f of c){let d=this.fileToQueries.get(f);d||(d=new Set,this.fileToQueries.set(f,d)),d.add(o)}}has(e){let t=this.normalizeQuery(e),r=this.cache.get(t);return r===void 0?!1:Date.now()-r.timestamp<=this.options.ttlMs}invalidateByFile(e){if(!this.options.enableFileInvalidation)return 0;let t=this.fileToQueries.get(e);if(!t)return 0;let r=0;for(let i of t)this.cache.set(i,void 0),r++,this.stats.fileInvalidations++;return this.fileToQueries.delete(e),r}clear(){this.cache.clear(),this.fileToQueries.clear()}getStats(){let e=this.stats.hits+this.stats.misses,t=e>0?this.stats.hits/e:0;return{hits:this.stats.hits,misses:this.stats.misses,hitRate:t,size:this.cache.size(),maxSize:this.options.maxSize,evictions:this.stats.evictions,ttlInvalidations:this.stats.ttlInvalidations,fileInvalidations:this.stats.fileInvalidations,avgTimeSavedMs:this.stats.hits>0?this.stats.totalTimeSavedMs/this.stats.hits:0}}resetStats(){this.stats={hits:0,misses:0,evictions:0,ttlInvalidations:0,fileInvalidations:0,totalTimeSavedMs:0}}size(){return this.cache.size()}pruneExpired(){return 0}};_f.SPARQLResultCache=Lm;function yB(n){return new Lm(n)}a(yB,"createSPARQLResultCache")});var IC=S(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.IncrementalIndexer=void 0;Sf.createIncrementalIndexer=vB;var _B=Uo(),SB={throttleMs:500,maxBatchSize:100,useContentHashing:!1},km=class{static{a(this,"IncrementalIndexer")}constructor(e={}){this.fileMetadata=new Map,this.pendingChanges=[],this.throttleTimer=null,this.invalidateCallbacks=[],this.lastIndexTime=0,this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]},this.options={...SB,...e}}recordChange(e){this.pendingChanges.push(e),this.stats.totalChanges++,this.throttleTimer===null&&(this.throttleTimer=setTimeout(()=>{this.processPendingChanges(),this.throttleTimer=null},this.options.throttleMs))}processPendingChanges(){if(this.pendingChanges.length===0)return;let e=performance.now(),t=new Map;for(let o of this.pendingChanges)t.set(o.path,o);let r=Array.from(t.values()),i=[];for(let o of r)switch(o.type){case"deleted":this.fileMetadata.delete(o.path),i.push(o);break;case"renamed":o.oldPath&&this.fileMetadata.delete(o.oldPath),i.push(o);break;case"created":case"modified":i.push(o);break}if(i.length>0){this.stats.invalidations+=i.length;for(let o of this.invalidateCallbacks)try{o(i)}catch(c){_B.LoggingService.error("IncrementalIndexer: Error in invalidation callback",c instanceof Error?c:new Error(String(c)))}}let s=performance.now()-e;this.stats.indexDurations.push(s),this.stats.indexDurations.length>100&&this.stats.indexDurations.shift(),this.lastIndexTime=Date.now(),this.pendingChanges=[]}flush(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.processPendingChanges()}updateMetadata(e,t,r,i){this.fileMetadata.set(e,{mtime:t,size:r,contentHash:i})}hasChanged(e,t,r){let i=this.fileMetadata.get(e);return i===void 0||i.mtime!==t||r!==void 0&&i.size!==r}getChangedFiles(e){let t=[];for(let[r,i]of this.fileMetadata.entries())i.mtime>e&&t.push(r);return t}onInvalidate(e){return this.invalidateCallbacks.push(e),()=>{let t=this.invalidateCallbacks.indexOf(e);t!==-1&&this.invalidateCallbacks.splice(t,1)}}getStats(){let e=this.stats.indexDurations,t=e.length>0?e.reduce((i,s)=>i+s,0)/e.length:0,r=e.length>0?e[e.length-1]:0;return{trackedFiles:this.fileMetadata.size,totalChanges:this.stats.totalChanges,invalidations:this.stats.invalidations,noOpChanges:this.stats.noOpChanges,lastIndexDurationMs:r,avgIndexDurationMs:t,lastIndexTime:this.lastIndexTime}}resetStats(){this.stats={totalChanges:0,invalidations:0,noOpChanges:0,indexDurations:[]}}clear(){this.fileMetadata.clear(),this.pendingChanges=[],this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null)}size(){return this.fileMetadata.size}isTracked(e){return this.fileMetadata.has(e)}getMetadata(e){return this.fileMetadata.get(e)}dispose(){this.throttleTimer!==null&&(clearTimeout(this.throttleTimer),this.throttleTimer=null),this.invalidateCallbacks=[],this.pendingChanges=[],this.fileMetadata.clear()}};Sf.IncrementalIndexer=km;function vB(n){return new km(n)}a(vB,"createIncrementalIndexer")});var PC=S(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.ResultSerializer=void 0;var Mm=Ne(),jm=Ae(),$m=qt(),Cb=class{static{a(this,"ResultSerializer")}serialize(e,t,r={}){switch(t){case"json":return this.serializeJSON(e,r);case"xml":return this.serializeXML(e,r);case"csv":return this.serializeCSV(e,r);case"turtle":return this.serializeTurtle(e,r);default:throw new Error(`Unsupported result format: ${t}`)}}serializeJSON(e,t={}){let r=this.toJSONResultSet(e,t),i=t.pretty?t.indent??2:void 0;return JSON.stringify(r,null,i)}toJSONResultSet(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=e.map(o=>{let c={};for(let l of i){let u=o.get(l);u!==void 0&&(c[l]=this.termToJSONBinding(u))}return c});return{head:{vars:i},results:{bindings:s}}}termToJSONBinding(e){return e instanceof jm.IRI?{type:"uri",value:e.value}:e instanceof $m.BlankNode?{type:"bnode",value:e.id}:e instanceof Mm.Literal?this.literalToJSONBinding(e):{type:"literal",value:String(e)}}literalToJSONBinding(e){let t={type:"literal",value:e.value};return e.datatype?t.datatype=e.datatype.value:e.language&&(t["xml:lang"]=e.language,e.hasDirection()&&e.direction&&(t.direction=e.direction)),t}serializeXML(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=['<?xml version="1.0"?>','<sparql xmlns="http://www.w3.org/2005/sparql-results#">'," <head>"];for(let o of i)s.push(` <variable name="${this.escapeXML(o)}"/>`);s.push(" </head>"),s.push(" <results>");for(let o of e){s.push(" <result>");for(let c of i){let l=o.get(c);l!==void 0&&(s.push(` <binding name="${this.escapeXML(c)}">`),s.push(" "+this.termToXML(l)),s.push(" </binding>"))}s.push(" </result>")}return s.push(" </results>"),s.push("</sparql>"),s.join(`
410
410
  `)}termToXML(e){return e instanceof jm.IRI?`<uri>${this.escapeXML(e.value)}</uri>`:e instanceof $m.BlankNode?`<bnode>${this.escapeXML(e.id)}</bnode>`:e instanceof Mm.Literal?this.literalToXML(e):`<literal>${this.escapeXML(String(e))}</literal>`}literalToXML(e){let t=this.escapeXML(e.value);if(e.datatype)return`<literal datatype="${this.escapeXML(e.datatype.value)}">${t}</literal>`;if(e.language){let r=`xml:lang="${this.escapeXML(e.language)}"`;return e.hasDirection()&&e.direction&&(r+=` direction="${e.direction}"`),`<literal ${r}>${t}</literal>`}return`<literal>${t}</literal>`}serializeCSV(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(i.map(o=>this.escapeCSV(o)).join(","));for(let o of e){let c=i.map(l=>{let u=o.get(l);return u===void 0?"":this.escapeCSV(this.termToCSV(u))});s.push(c.join(","))}return s.join(`
411
411
  `)}termToCSV(e){return e instanceof jm.IRI?e.value:e instanceof $m.BlankNode?`_:${e.id}`:e instanceof Mm.Literal?this.literalToCSV(e):String(e)}literalToCSV(e){if(e.datatype)return`${e.value}^^<${e.datatype.value}>`;if(e.language){let t=e.language;return e.hasDirection()&&e.direction&&(t+=`--${e.direction}`),`${e.value}@${t}`}return e.value}serializeTurtle(e,t={}){let r=new Set;for(let o of e)for(let c of o.variables())r.add(c);let i=t.variables??Array.from(r).sort(),s=[];s.push(`# SPARQL Results - ${e.length} solution(s)`),s.push(`# Variables: ${i.join(", ")}`),s.push("");for(let o=0;o<e.length;o++){let c=e[o];s.push(`# Solution ${o+1}`);for(let l of i){let u=c.get(l);u!==void 0&&s.push(`?${l} = ${this.termToTurtle(u)}`)}s.push("")}return s.join(`
412
412
  `).trimEnd()}termToTurtle(e){return e instanceof jm.IRI?`<${e.value}>`:e instanceof $m.BlankNode?`_:${e.id}`:e instanceof Mm.Literal?e.toString():`"${String(e)}"`}escapeXML(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;")}escapeCSV(e){return e.includes(",")||e.includes('"')||e.includes(`
413
- `)?`"${e.replace(/"/g,'""')}"`:e}};Bm.ResultSerializer=Cb});var OC=S(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.FileAlreadyExistsError=Al.FileNotFoundError=void 0;var Rb=class extends Error{static{a(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};Al.FileNotFoundError=Rb;var Ib=class extends Error{static{a(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};Al.FileAlreadyExistsError=Ib});var Ob=S(wr=>{"use strict";var vB=wr&&wr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},bB=wr&&wr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(wr,"__esModule",{value:!0});wr.VaultSettings=wr.DEFAULT_FLEETING_NOTE_CLASS_UID=wr.DEFAULT_INBOX_FOLDER=wr.DEFAULT_OWNER_IDENTITY=void 0;var wB=fe();wr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';wr.DEFAULT_INBOX_FOLDER="01 Inbox";wr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var Pb=class{static{a(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??wr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??wr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??wr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};wr.VaultSettings=Pb;wr.VaultSettings=Pb=vB([(0,wB.injectable)(),bB("design:paramtypes",[Object])],Pb)});var FC=S(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.container=void 0;Ho.registerCoreServices=HB;Ho.createChildContainer=QB;Ho.getContainer=KB;Ho.resetContainer=YB;eh();var vf=fe();Object.defineProperty(Ho,"container",{enumerable:!0,get:a(function(){return vf.container},"get")});var It=Et(),EB=hv(),TB=mv(),AB=nv(),xB=MS(),CB=DS(),RB=um(),IB=dm(),PB=JS(),OB=ev(),FB=sv(),DB=YS(),NB=yv(),LB=Av(),kB=wv(),MB=US(),jB=qS(),$B=fv(),BB=cv(),UB=gb(),VB=$S(),qB=Rv(),WB=Pv(),GB=Vv(),zB=Ob();function HB(n){let e=n||vf.container;e.registerSingleton(It.DI_TOKENS.DynamicFrontmatterGenerator,EB.DynamicFrontmatterGenerator),e.registerSingleton(It.DI_TOKENS.AlgorithmExtractor,TB.AlgorithmExtractor),e.isRegistered(It.DI_TOKENS.IVaultSettings)||e.register(It.DI_TOKENS.IVaultSettings,{useValue:new zB.VaultSettings}),e.registerSingleton(It.DI_TOKENS.EffortStatusWorkflow,RB.EffortStatusWorkflow),e.registerSingleton(It.DI_TOKENS.StatusTimestampService,IB.StatusTimestampService),e.registerSingleton(It.DI_TOKENS.TaskStatusService,CB.TaskStatusService),e.registerSingleton(It.DI_TOKENS.AreaCreationService,xB.AreaCreationService),e.registerSingleton(It.DI_TOKENS.ClassCreationService,MB.ClassCreationService),e.registerSingleton(It.DI_TOKENS.ConceptCreationService,jB.ConceptCreationService),e.registerSingleton(It.DI_TOKENS.FleetingNoteCreationService,$B.FleetingNoteCreationService),e.registerSingleton(It.DI_TOKENS.SupervisionCreationService,BB.SupervisionCreationService),e.registerSingleton(It.DI_TOKENS.GenericAssetCreationService,WB.GenericAssetCreationService),e.registerSingleton(It.DI_TOKENS.PropertyCleanupService,AB.PropertyCleanupService),e.registerSingleton(It.DI_TOKENS.FolderRepairService,PB.FolderRepairService),e.registerSingleton(It.DI_TOKENS.LabelToAliasService,OB.LabelToAliasService),e.registerSingleton(It.DI_TOKENS.RenameToUidService,FB.RenameToUidService),e.registerSingleton(It.DI_TOKENS.PlanningService,NB.PlanningService),e.registerSingleton(It.DI_TOKENS.EffortVotingService,DB.EffortVotingService),e.registerSingleton(It.DI_TOKENS.SessionEventService,LB.SessionEventService),e.registerSingleton(It.DI_TOKENS.AssetConversionService,kB.AssetConversionService),e.registerSingleton(It.DI_TOKENS.NoteToRDFConverter,UB.NoteToRDFConverter),e.registerSingleton(It.DI_TOKENS.AreaHierarchyBuilder,VB.AreaHierarchyBuilder),e.registerSingleton(It.DI_TOKENS.URIConstructionService,qB.URIConstructionService),e.registerSingleton(It.DI_TOKENS.CriticalityZoneService,GB.CriticalityZoneService)}a(HB,"registerCoreServices");function QB(){return vf.container.createChildContainer()}a(QB,"createChildContainer");function KB(){return vf.container}a(KB,"getContainer");function YB(){vf.container.reset()}a(YB,"resetContainer")});var Fb=S(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.DEFAULT_COLORS=xl.NODE_FLAGS=void 0;xl.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};xl.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var Nb=S(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.StringTable=void 0;var Db=class n{static{a(this,"StringTable")}constructor(e){if(this.stringToIndex=new Map,this.strings=[],this.memoryBytes=0,e)for(let t of e)this.intern(t)}intern(e){let t=this.stringToIndex.get(e);if(t!==void 0)return t;let r=this.strings.length;return this.strings.push(e),this.stringToIndex.set(e,r),this.memoryBytes+=e.length*2+50,r}getIndex(e){return this.stringToIndex.get(e)??-1}getString(e){if(e<0||e>=this.strings.length)throw new RangeError(`StringTable index out of bounds: ${e}`);return this.strings[e]}has(e){return this.stringToIndex.has(e)}hasIndex(e){return e>=0&&e<this.strings.length}get size(){return this.strings.length}getMemoryBytes(){return this.memoryBytes}*entries(){for(let e=0;e<this.strings.length;e++)yield[e,this.strings[e]]}*values(){for(let e of this.strings)yield e}toArray(){return[...this.strings]}clear(){this.stringToIndex.clear(),this.strings=[],this.memoryBytes=0}static fromJSON(e){return new n(e)}toJSON(){return this.strings}internAll(e){return e.map(t=>this.intern(t))}getStrings(e){return e.map(t=>this.getString(t))}search(e){let t=typeof e=="string"?new RegExp(e):e,r=[];for(let i=0;i<this.strings.length;i++)t.test(this.strings[i])&&r.push([i,this.strings[i]]);return r}getStats(){let e=this.strings.reduce((t,r)=>t+r.length,0);return{count:this.strings.length,memoryBytes:this.memoryBytes,avgStringLength:this.strings.length>0?e/this.strings.length:0}}};Um.StringTable=Db});var DC=S(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.CompactGraphStore=void 0;var Vm=Nb(),On=Fb(),XB={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function Lb(n,e){if(n===void 0)return e;if(typeof n=="number")return n;if(n.startsWith("#")){let t=n.slice(1);if(t.length===6)return parseInt(t,16)<<8|255;if(t.length===8)return parseInt(t,16)}return e}a(Lb,"parseColor");var kb=class{static{a(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...XB,...e},this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity),this.uriTable=new Vm.StringTable,this.labelTable=new Vm.StringTable,this.typeTable=new Vm.StringTable,this.predicateTable=new Vm.StringTable}allocateNodeArrays(e){return{positions:new Float32Array(e*2),radii:new Float32Array(e),colors:new Uint32Array(e),types:new Uint16Array(e),flags:new Uint8Array(e)}}allocateEdgeArrays(e){return{sourceIndices:new Uint32Array(e),targetIndices:new Uint32Array(e),predicateIndices:new Uint16Array(e),widths:new Float32Array(e),colors:new Uint32Array(e)}}resizeNodeArrays(e){if(e<=this.nodeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateNodeArrays(e);t.positions.set(this.nodes.positions.subarray(0,this.nodeCount*2)),t.radii.set(this.nodes.radii.subarray(0,this.nodeCount)),t.colors.set(this.nodes.colors.subarray(0,this.nodeCount)),t.types.set(this.nodes.types.subarray(0,this.nodeCount)),t.flags.set(this.nodes.flags.subarray(0,this.nodeCount)),this.nodes=t,this.nodeCapacity=e}resizeEdgeArrays(e){if(e<=this.edgeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateEdgeArrays(e);t.sourceIndices.set(this.edges.sourceIndices.subarray(0,this.edgeCount)),t.targetIndices.set(this.edges.targetIndices.subarray(0,this.edgeCount)),t.predicateIndices.set(this.edges.predicateIndices.subarray(0,this.edgeCount)),t.widths.set(this.edges.widths.subarray(0,this.edgeCount)),t.colors.set(this.edges.colors.subarray(0,this.edgeCount)),this.edges=t,this.edgeCapacity=e}ensureNodeCapacity(e){let t=this.nodeCount+e;if(t>this.nodeCapacity){let r=Math.max(t,Math.floor(this.nodeCapacity*this.config.growthFactor));this.resizeNodeArrays(r)}}ensureEdgeCapacity(e){let t=this.edgeCount+e;if(t>this.edgeCapacity){let r=Math.max(t,Math.floor(this.edgeCapacity*this.config.growthFactor));this.resizeEdgeArrays(r)}}addNode(e){let t=this.nodeIdToIndex.get(e.id);if(t!==void 0)return this.updateNodeAt(t,e),t;this.ensureNodeCapacity(1);let r=this.nodeCount++,i=r*2;this.nodes.positions[i]=e.x??Math.random()*1e3-500,this.nodes.positions[i+1]=e.y??Math.random()*1e3-500,this.nodes.radii[r]=e.radius??8,this.nodes.colors[r]=Lb(e.color,On.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=On.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=On.NODE_FLAGS.PINNED),e.isArchived&&(s|=On.NODE_FLAGS.ARCHIVED),this.nodes.flags[r]=s,this.nodeIdToIndex.set(e.id,r),this.indexToNodeId[r]=e.id,this.uriTable.intern(e.id),e.label&&this.labelTable.intern(e.label),r}updateNodeAt(e,t){let r=e*2;t.x!==void 0&&(this.nodes.positions[r]=t.x),t.y!==void 0&&(this.nodes.positions[r+1]=t.y),t.radius!==void 0&&(this.nodes.radii[e]=t.radius),t.color!==void 0&&(this.nodes.colors[e]=Lb(t.color,On.DEFAULT_COLORS.NODE)),t.assetClass!==void 0&&(this.nodes.types[e]=this.typeTable.intern(t.assetClass));let i=this.nodes.flags[e];t.isPinned!==void 0&&(i=t.isPinned?i|On.NODE_FLAGS.PINNED:i&~On.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|On.NODE_FLAGS.ARCHIVED:i&~On.NODE_FLAGS.ARCHIVED),this.nodes.flags[e]=i}addEdge(e){let t=this.nodeIdToIndex.get(e.sourceId),r=this.nodeIdToIndex.get(e.targetId);if(t===void 0||r===void 0)return-1;let i=`${e.sourceId}->${e.targetId}:${e.predicate??"link"}`,s=this.edgeIdToIndex.get(i);if(s!==void 0)return s;this.ensureEdgeCapacity(1);let o=this.edgeCount++;return this.edges.sourceIndices[o]=t,this.edges.targetIndices[o]=r,this.edges.widths[o]=e.width??1,this.edges.colors[o]=Lb(e.color,On.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[o]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[o]=0,this.edgeIdToIndex.set(i,o),o}addNodes(e){return this.ensureNodeCapacity(e.length),e.map(t=>this.addNode(t))}addEdges(e){return this.ensureEdgeCapacity(e.length),e.map(t=>this.addEdge(t))}loadChunk(e){let r=this.addNodes(e.nodes).filter(o=>o>=0).length,s=this.addEdges(e.edges).filter(o=>o>=0).length;return{nodesAdded:r,edgesAdded:s}}getNodePosition(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return null;let r=t*2;return{x:this.nodes.positions[r],y:this.nodes.positions[r+1]}}getNodePositionByIndex(e){let t=e*2;return{x:this.nodes.positions[t],y:this.nodes.positions[t+1]}}setNodePosition(e,t,r){let i=this.nodeIdToIndex.get(e);if(i===void 0)return!1;let s=i*2;return this.nodes.positions[s]=t,this.nodes.positions[s+1]=r,!0}setNodePositionByIndex(e,t,r){let i=e*2;this.nodes.positions[i]=t,this.nodes.positions[i+1]=r}updateNodePositions(e){let t=0;for(let[r,i]of e)this.setNodePosition(r,i.x,i.y)&&t++;return t}applyNodeUpdates(e){let t=performance.now(),r=0;for(let i of e){let s=i.index;if(!(s<0||s>=this.nodeCount)){if(i.x!==void 0||i.y!==void 0){let o=s*2;i.x!==void 0&&(this.nodes.positions[o]=i.x),i.y!==void 0&&(this.nodes.positions[o+1]=i.y)}i.radius!==void 0&&(this.nodes.radii[s]=i.radius),i.color!==void 0&&(this.nodes.colors[s]=i.color),i.setFlags!==void 0&&(this.nodes.flags[s]|=i.setFlags),i.clearFlags!==void 0&&(this.nodes.flags[s]&=~i.clearFlags),r++}}return{nodesUpdated:r,edgesUpdated:0,timeMs:performance.now()-t}}getNodeFlags(e){let t=this.nodeIdToIndex.get(e);return t===void 0?0:this.nodes.flags[t]}setNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]|=t,!0)}clearNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]&=~t,!0)}hasNodeFlag(e,t){return(this.getNodeFlags(e)&t)!==0}selectNode(e){return this.setNodeFlag(e,On.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,On.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~On.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&On.NODE_FLAGS.SELECTED&&e.push(this.indexToNodeId[t]);return e}getNodeId(e){return this.indexToNodeId[e]}getNodeIndex(e){return this.nodeIdToIndex.get(e)}hasNode(e){return this.nodeIdToIndex.has(e)}getNodeCount(){return this.nodeCount}getEdgeCount(){return this.edgeCount}getNodeEdges(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=[];for(let i=0;i<this.edgeCount;i++)this.edges.sourceIndices[i]===t?r.push({edgeIndex:i,isSource:!0}):this.edges.targetIndices[i]===t&&r.push({edgeIndex:i,isSource:!1});return r}getNeighbors(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=new Set;for(let i=0;i<this.edgeCount;i++)if(this.edges.sourceIndices[i]===t){let s=this.edges.targetIndices[i];r.add(this.indexToNodeId[s])}else if(this.edges.targetIndices[i]===t){let s=this.edges.sourceIndices[i];r.add(this.indexToNodeId[s])}return Array.from(r)}getRawArrays(){return{nodes:this.nodes,edges:this.edges,nodeCount:this.nodeCount,edgeCount:this.edgeCount}}getPositionsArray(){return this.nodes.positions.subarray(0,this.nodeCount*2)}getMemoryStats(){let e=this.nodeCapacity*2*4+this.nodeCapacity*4+this.nodeCapacity*4+this.nodeCapacity*2+this.nodeCapacity,t=this.edgeCapacity*4+this.edgeCapacity*4+this.edgeCapacity*2+this.edgeCapacity*4+this.edgeCapacity*4,r=this.uriTable.getMemoryBytes()+this.labelTable.getMemoryBytes()+this.typeTable.getMemoryBytes()+this.predicateTable.getMemoryBytes();return{nodeCount:this.nodeCount,edgeCount:this.edgeCount,nodeCapacity:this.nodeCapacity,edgeCapacity:this.edgeCapacity,nodeMemoryBytes:e,edgeMemoryBytes:t,stringTableBytes:r,totalBytes:e+t+r,internedStringCount:this.uriTable.size+this.labelTable.size+this.typeTable.size+this.predicateTable.size}}clear(){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex.clear(),this.indexToNodeId=[],this.edgeIdToIndex.clear(),this.uriTable.clear(),this.labelTable.clear(),this.typeTable.clear(),this.predicateTable.clear(),this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity)}getTypeTable(){return this.typeTable}getLabelTable(){return this.labelTable}getUriTable(){return this.uriTable}getPredicateTable(){return this.predicateTable}};qm.CompactGraphStore=kb});var NC=S(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.MemoryPool=void 0;Rl.getGlobalPool=ZB;Rl.resetGlobalPool=eU;var JB={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},Wm=class{static{a(this,"MemoryPool")}constructor(e){this.float32Pool=new Map,this.uint32Pool=new Map,this.uint16Pool=new Map,this.uint8Pool=new Map,this.stats={poolHits:0,poolMisses:0,pooledArrays:0,pooledMemory:0,returned:0,rejected:0},this.config={...JB,...e};for(let t of this.config.sizeBuckets)this.float32Pool.set(t,[]),this.uint32Pool.set(t,[]),this.uint16Pool.set(t,[]),this.uint8Pool.set(t,[])}getBucketSize(e){for(let t of this.config.sizeBuckets)if(t>=e)return t;return e}getFloat32(e){let t=this.getBucketSize(e),r=this.float32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Float32Array(t)}getUint32(e){let t=this.getBucketSize(e),r=this.uint32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint32Array(t)}getUint16(e){let t=this.getBucketSize(e),r=this.uint16Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*2;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint16Array(t)}getUint8(e){let t=this.getBucketSize(e),r=this.uint8Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint8Array(t)}releaseFloat32(e){this.releaseToPool(this.float32Pool,e,4)}releaseUint32(e){this.releaseToPool(this.uint32Pool,e,4)}releaseUint16(e){this.releaseToPool(this.uint16Pool,e,2)}releaseUint8(e){this.releaseToPool(this.uint8Pool,e,1)}releaseToPool(e,t,r){let i=t.length,s=e.get(i);if(s&&s.length<this.config.maxPooledArrays){if(this.config.autoCleanup&&this.stats.pooledMemory+i*r>this.config.maxPoolMemory){this.stats.rejected++;return}s.push(t),this.stats.returned++,this.stats.pooledArrays++,this.stats.pooledMemory+=i*r}else this.stats.rejected++}getStats(){return{...this.stats}}getHitRatio(){let e=this.stats.poolHits+this.stats.poolMisses;return e>0?this.stats.poolHits/e:0}clear(){for(let e of this.float32Pool.values())e.length=0;for(let e of this.uint32Pool.values())e.length=0;for(let e of this.uint16Pool.values())e.length=0;for(let e of this.uint8Pool.values())e.length=0;this.stats.pooledArrays=0,this.stats.pooledMemory=0}cleanup(e){if(this.stats.pooledMemory<=e)return;let t=[...this.config.sizeBuckets].sort((r,i)=>i-r);for(let r of t){if(this.stats.pooledMemory<=e)break;for(let[i,s]of[[this.float32Pool,4],[this.uint32Pool,4],[this.uint16Pool,2],[this.uint8Pool,1]]){let o=i.get(r);if(o)for(;o.length>0&&this.stats.pooledMemory>e;)o.pop(),this.stats.pooledArrays--,this.stats.pooledMemory-=r*s}}}resetStats(){this.stats.poolHits=0,this.stats.poolMisses=0,this.stats.returned=0,this.stats.rejected=0}};Rl.MemoryPool=Wm;var Cl=null;function ZB(){return Cl||(Cl=new Wm),Cl}a(ZB,"getGlobalPool");function eU(){Cl&&Cl.clear(),Cl=null}a(eU,"resetGlobalPool")});var LC=S(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.StreamingLoader=void 0;bf.createStreamingSource=rU;var tU={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},Mb=class{static{a(this,"StreamingLoader")}constructor(e,t){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.progressCallbacks=[],this.abortController=null,this.store=e,this.config={...tU,...t}}getState(){return this.state}getProgress(){let e=this.totalChunks!==void 0&&this.totalChunks>0?this.chunksProcessed/this.totalChunks:0;return{currentChunk:this.chunksProcessed,totalChunks:this.totalChunks,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,progress:e,isComplete:this.state==="completed"}}onProgress(e){return this.progressCallbacks.push(e),()=>{let t=this.progressCallbacks.indexOf(e);t>=0&&this.progressCallbacks.splice(t,1)}}notifyProgress(){let e=this.getProgress();for(let t of this.progressCallbacks)t(e)}loadChunk(e){if(this.state==="error")throw new Error("Loader is in error state");this.state="loading",e.totalChunks!==void 0&&(this.totalChunks=e.totalChunks);for(let t of e.nodes)this.store.addNode(t),this.nodesLoaded++;for(let t of e.edges)this.store.addEdge(t)>=0?this.edgesLoaded++:this.pendingEdges.push(t);this.chunksProcessed++,e.isLast&&this.finishLoading(),this.notifyProgress()}finishLoading(){if(this.config.autoResolveEdges&&this.pendingEdges.length>0){for(let e of this.pendingEdges)this.store.addEdge(e)>=0&&this.edgesLoaded++;this.pendingEdges=[]}this.state="completed",this.notifyProgress()}async loadFromIterator(e){this.reset(),this.state="loading",this.abortController=new AbortController;try{for await(let r of e){if(this.abortController.signal.aborted){this.state="paused";return}this.loadChunk(r),this.config.chunkDelay>0&&await this.delay(this.config.chunkDelay)}this.state!=="completed"&&this.finishLoading()}catch(t){throw this.state="error",t}finally{this.abortController=null}}async loadFromArrays(e,t){let r=this.createChunks(e,t);await this.loadFromIterator(this.arrayToAsyncIterator(r))}createChunks(e,t){let r=[],{chunkSize:i}=this.config,s=Math.ceil(e.length/i),o=Array(s).fill(null).map(()=>[]);for(let c of t){let l=e.findIndex(u=>u.id===c.sourceId);if(l>=0){let u=Math.floor(l/i);o[u].push(c)}}for(let c=0;c<s;c++){let l=c*i,u=Math.min(l+i,e.length);r.push({chunkIndex:c,totalChunks:s,nodes:e.slice(l,u),edges:o[c],isLast:c===s-1})}return r}async*arrayToAsyncIterator(e){for(let t of e)yield t}delay(e){return new Promise(t=>setTimeout(t,e))}cancel(){this.abortController&&this.abortController.abort(),this.state="paused"}reset(){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.totalChunks=void 0,this.abortController=null}getPendingEdgeCount(){return this.pendingEdges.length}getStats(){return{state:this.state,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,chunksProcessed:this.chunksProcessed,totalChunks:this.totalChunks,pendingEdges:this.pendingEdges.length,storeStats:this.store.getMemoryStats()}}};bf.StreamingLoader=Mb;async function*rU(n,e,t=1e3){let r=0,i=0,s;for(;;){let o=await e(n,r,t);if(o.totalCount!==void 0&&s===void 0&&(s=Math.ceil(o.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:o.nodes,edges:o.edges,isLast:!o.hasMore},!o.hasMore)break;r+=t,i++}}a(rU,"createStreamingSource")});var jC=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.createStreamingSource=nr.StreamingLoader=nr.resetGlobalPool=nr.getGlobalPool=nr.MemoryPool=nr.CompactGraphStore=nr.StringTable=nr.DEFAULT_COLORS=nr.NODE_FLAGS=void 0;var kC=Fb();Object.defineProperty(nr,"NODE_FLAGS",{enumerable:!0,get:a(function(){return kC.NODE_FLAGS},"get")});Object.defineProperty(nr,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return kC.DEFAULT_COLORS},"get")});var nU=Nb();Object.defineProperty(nr,"StringTable",{enumerable:!0,get:a(function(){return nU.StringTable},"get")});var iU=DC();Object.defineProperty(nr,"CompactGraphStore",{enumerable:!0,get:a(function(){return iU.CompactGraphStore},"get")});var jb=NC();Object.defineProperty(nr,"MemoryPool",{enumerable:!0,get:a(function(){return jb.MemoryPool},"get")});Object.defineProperty(nr,"getGlobalPool",{enumerable:!0,get:a(function(){return jb.getGlobalPool},"get")});Object.defineProperty(nr,"resetGlobalPool",{enumerable:!0,get:a(function(){return jb.resetGlobalPool},"get")});var MC=LC();Object.defineProperty(nr,"StreamingLoader",{enumerable:!0,get:a(function(){return MC.StreamingLoader},"get")});Object.defineProperty(nr,"createStreamingSource",{enumerable:!0,get:a(function(){return MC.createStreamingSource},"get")})});var $C=S(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.ExoQLError=ir.ExoQL=ir.ExoQLBudgetExceededError=ir.ExoQLCycleError=ir.ExoQLEvalDisabledError=ir.ExoQLForbiddenKeywordError=ir.DEFAULT_EVAL_CONFIG=ir.validateExoQLAllowlist=ir.evaluateWithExoEval=void 0;var sU=Uc(),oU=qc(),aU=ll(),$b=pb(),cU=Ne(),lU=mS();Object.defineProperty(ir,"evaluateWithExoEval",{enumerable:!0,get:a(function(){return lU.evaluateWithExoEval},"get")});var uU=dS();Object.defineProperty(ir,"validateExoQLAllowlist",{enumerable:!0,get:a(function(){return uU.validateExoQLAllowlist},"get")});var fU=hS();Object.defineProperty(ir,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:a(function(){return fU.DEFAULT_EVAL_CONFIG},"get")});var Gm=sf();Object.defineProperty(ir,"ExoQLForbiddenKeywordError",{enumerable:!0,get:a(function(){return Gm.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(ir,"ExoQLEvalDisabledError",{enumerable:!0,get:a(function(){return Gm.ExoQLEvalDisabledError},"get")});Object.defineProperty(ir,"ExoQLCycleError",{enumerable:!0,get:a(function(){return Gm.ExoQLCycleError},"get")});Object.defineProperty(ir,"ExoQLBudgetExceededError",{enumerable:!0,get:a(function(){return Gm.ExoQLBudgetExceededError},"get")});var Bb=class n{static{a(this,"ExoQL")}static async query(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);return s.executeAll(i)}static async ask(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isAskQuery(i))throw new wf("ExoQL.ask() requires an ASK query");return s.executeAsk(i)}static async construct(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isConstructQuery(i))throw new wf("ExoQL.construct() requires a CONSTRUCT query");return s.executeConstruct(i)}static async queryOwn(e,t,r,i){let s=await n.query(e,t,i);if(s.length===0)return[];let o=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new $b.SourceAnnotator(t).annotate(s,o,c,l)).filter(d=>{let h=d.get($b.SOURCE_VARIABLE);return h instanceof cU.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new $b.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new sU.ExoQLParser,s=new oU.ExoQLAlgebraTranslator,o=i.parse(e),c=s.translate(o),l=new aU.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};ir.ExoQL=Bb;var wf=class extends Error{static{a(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};ir.ExoQLError=wf});var Ef=S(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.RELATION_COLUMN_SET_CLASS_UID=ni.RELATION_COLUMN_SET_CLASS_IRI=void 0;ni.normalizeRef=Ub;ni.createRelationColumnSetFromFrontmatter=hU;ni.isRelationColumnSet=pU;ni.isRelationColumnSetFrontmatter=gU;var BC=zs();function Ub(n){if(typeof n!="string")return null;let e=BC.WikiLinkHelpers.normalize(n);return e.length>0?e:null}a(Ub,"normalizeRef");function Vb(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(Vb,"toStringArray");function dU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(dU,"basenameFromPath");function hU(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`RelationColumnSet: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`RelationColumnSet: exo__Asset_uid missing at ${r}`),null;let o=Vb(n.ui__RelationColumnSet_targetClass),c=[];for(let b of o){let w=Ub(b);w!==null&&c.push(w)}let l=c.length>0?c:null,u=Ub(n.ui__RelationColumnSet_referencingProperty);if(l===null&&u===null)return t(`RelationColumnSet ${s}: at least one of targetClass / referencingProperty required (${r})`),null;let f=Vb(n.ui__RelationColumnSet_columns),d=[];for(let b of f){let w=BC.WikiLinkHelpers.normalize(b);w.length>0&&d.push(w)}if(d.length===0)return t(`RelationColumnSet ${s}: columns array must contain at least one entry (${r})`),null;let h=n.ui__RelationColumnSet_label,p=typeof h=="string"&&h.trim().length>0?h.trim():dU(r),y=n.ui__RelationColumnSet_priority,v=0;if(typeof y=="number"&&Number.isFinite(y))v=y;else if(typeof y=="string"){let b=Number.parseFloat(y);Number.isFinite(b)&&(v=b)}return{uid:s,label:p,targetClasses:l,referencingProperty:u,columns:d,priority:v,sourcePath:r}}a(hU,"createRelationColumnSetFromFrontmatter");function pU(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||e.targetClasses!==null&&(!Array.isArray(e.targetClasses)||e.targetClasses.some(t=>typeof t!="string"))||e.referencingProperty!==null&&typeof e.referencingProperty!="string"||!Array.isArray(e.columns)||e.columns.length===0||e.columns.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.sourcePath!="string")}a(pU,"isRelationColumnSet");ni.RELATION_COLUMN_SET_CLASS_IRI="ui__RelationColumnSet";ni.RELATION_COLUMN_SET_CLASS_UID="97fc9862-c886-4d86-9a60-e0cf9d778575";function mU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(s=>s.trim()).filter(s=>s.length>0)}a(mU,"extractClassIdentifiers");function gU(n){if(!n)return!1;let e=n.exo__Instance_class,t=Vb(e);for(let r of t)for(let i of mU(r))if(i===ni.RELATION_COLUMN_SET_CLASS_IRI||i===ni.RELATION_COLUMN_SET_CLASS_UID)return!0;return!1}a(gU,"isRelationColumnSetFrontmatter")});var VC=S(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LAYOUT_CLASS_UID=Ui.LAYOUT_CLASS_IRI=void 0;Ui.createLayoutFromFrontmatter=wU;Ui.isLayout=EU;Ui.isLayoutFrontmatter=AU;var yU=zs(),_U=Ef();Ui.LAYOUT_CLASS_IRI="exo__Layout";Ui.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function UC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(UC,"toStringArray");function SU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(SU,"basenameFromPath");function vU(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(vU,"parseBoolean");function bU(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);if(Number.isFinite(e))return e}return 0}a(bU,"parsePriority");function wU(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`Layout: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`Layout: exo__Asset_uid missing at ${r}`),null;let o=(0,_U.normalizeRef)(n.exo__Layout_targetClass);if(o===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=UC(n.exo__Layout_blocks),l=[];for(let p of c){let y=yU.WikiLinkHelpers.normalize(p);y.length>0&&l.push(y)}if(l.length===0)return t(`Layout ${s}: exo__Layout_blocks must contain at least one block (${r})`),null;let u=n.exo__Asset_label,f=typeof u=="string"&&u.trim().length>0?u.trim():SU(r),d=bU(n.exo__Layout_priority),h=vU(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:o,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}a(wU,"createLayoutFromFrontmatter");function EU(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||typeof e.targetClass!="string"||e.targetClass.length===0||!Array.isArray(e.blocks)||e.blocks.length===0||e.blocks.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.coexistsWithDefault!="boolean"||typeof e.sourcePath!="string")}a(EU,"isLayout");function TU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(TU,"extractClassIdentifiers");function AU(n){if(!n)return!1;let e=UC(n.exo__Instance_class);for(let t of e)for(let r of TU(t))if(r===Ui.LAYOUT_CLASS_IRI||r===Ui.LAYOUT_CLASS_UID)return!0;return!1}a(AU,"isLayoutFrontmatter")});var GC=S(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Wt.PROPERTIES_BLOCK_CLASS_UID=Wt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Wt.createLayoutBlockFromFrontmatter=OU;Wt.isLayoutBlockFrontmatter=FU;Wt.isPropertiesBlock=DU;Wt.isBacklinksTableBlock=NU;var xU=zs(),qb=Ef();Wt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Wt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function qC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(qC,"toStringArray");function CU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(CU,"basenameFromPath");function WC(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(WC,"parseBoolean");function RU(n){if(typeof n=="number"&&Number.isFinite(n)&&Number.isInteger(n))return n;if(typeof n=="string"){let e=Number.parseInt(n,10);if(Number.isFinite(e))return e}return null}a(RU,"parseInteger");function IU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(IU,"extractClassIdentifiers");function zm(n,e,t){let r=qC(n.exo__Instance_class);for(let i of r)for(let s of IU(i))if(s===e||s===t)return!0;return!1}a(zm,"classOf");function PU(n,e){let t=e.warn??(()=>{}),r=n.exo__Asset_uid,i=typeof r=="string"?r.trim():"";if(i.length===0)return t(`LayoutBlock: exo__Asset_uid missing at ${e.sourcePath}`),null;let s=n.exo__LayoutBlock_title,o=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof o=="string"&&o.trim().length>0?o.trim():CU(e.sourcePath),l=WC(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}a(PU,"extractBase");function OU(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=PU(n,e);if(r===null)return null;if(zm(n,Wt.PROPERTIES_BLOCK_CLASS_IRI,Wt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(zm(n,Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let o=qC(n.exo__BacklinksTableBlock_columns),c=[];for(let p of o){let y=xU.WikiLinkHelpers.normalize(p);y.length>0&&c.push(y)}let l=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=RU(n.exo__BacklinksTableBlock_limit),h=WC(n.exo__BacklinksTableBlock_showArchived,!1);return{...r,kind:"backlinks-table",rowClass:i,referencingProperty:s,columns:c,sortBy:l,sortOrder:f,limit:d,showArchived:h}}return t(`LayoutBlock ${r.uid}: unknown block class at ${e.sourcePath} \u2014 expected exo__PropertiesBlock or exo__BacklinksTableBlock`),null}a(OU,"createLayoutBlockFromFrontmatter");function FU(n){return n?zm(n,Wt.PROPERTIES_BLOCK_CLASS_IRI,Wt.PROPERTIES_BLOCK_CLASS_UID)||zm(n,Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}a(FU,"isLayoutBlockFrontmatter");function DU(n){return n.kind==="properties"}a(DU,"isPropertiesBlock");function NU(n){return n.kind==="backlinks-table"}a(NU,"isBacklinksTableBlock")});var Hm=S(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isPropertiesBlock=je.isLayoutBlockFrontmatter=je.isBacklinksTableBlock=je.createLayoutBlockFromFrontmatter=je.PROPERTIES_BLOCK_CLASS_UID=je.PROPERTIES_BLOCK_CLASS_IRI=je.BACKLINKS_TABLE_BLOCK_CLASS_UID=je.BACKLINKS_TABLE_BLOCK_CLASS_IRI=je.isLayoutFrontmatter=je.isLayout=je.createLayoutFromFrontmatter=je.LAYOUT_CLASS_UID=je.LAYOUT_CLASS_IRI=je.normalizeRef=je.isRelationColumnSetFrontmatter=je.isRelationColumnSet=je.createRelationColumnSetFromFrontmatter=je.RELATION_COLUMN_SET_CLASS_UID=je.RELATION_COLUMN_SET_CLASS_IRI=void 0;var Il=Ef();Object.defineProperty(je,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:a(function(){return Il.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(je,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:a(function(){return Il.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(je,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:a(function(){return Il.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(je,"isRelationColumnSet",{enumerable:!0,get:a(function(){return Il.isRelationColumnSet},"get")});Object.defineProperty(je,"isRelationColumnSetFrontmatter",{enumerable:!0,get:a(function(){return Il.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(je,"normalizeRef",{enumerable:!0,get:a(function(){return Il.normalizeRef},"get")});var Tf=VC();Object.defineProperty(je,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Tf.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(je,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Tf.LAYOUT_CLASS_UID},"get")});Object.defineProperty(je,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Tf.createLayoutFromFrontmatter},"get")});Object.defineProperty(je,"isLayout",{enumerable:!0,get:a(function(){return Tf.isLayout},"get")});Object.defineProperty(je,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Tf.isLayoutFrontmatter},"get")});var Qo=GC();Object.defineProperty(je,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Qo.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(je,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Qo.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(je,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Qo.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(je,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Qo.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(je,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Qo.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(je,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Qo.isBacklinksTableBlock},"get")});Object.defineProperty(je,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Qo.isLayoutBlockFrontmatter},"get")});Object.defineProperty(je,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Qo.isPropertiesBlock},"get")})});var HC=S(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.RelationColumnSetResolver=void 0;var zC=Ef(),LU={warn:a(()=>{},"warn")},Wb=class{static{a(this,"RelationColumnSetResolver")}constructor(e,t={}){this.provider=e,this.logger=t.logger??LU}resolve(e,t){if(!e||e.length===0)return null;let r=t!=null?(0,zC.normalizeRef)(t):null,i=this.provider();if(i.length===0)return null;for(let s of e){let o=(0,zC.normalizeRef)(s);if(o===null)continue;if(r!==null){let l=this.filterTier1(i,o,r);if(l.length>0)return this.tiebreak(l,1)}let c=this.filterTier2(i,o);if(c.length>0)return this.tiebreak(c,2);if(r!==null){let l=this.filterTier3(i,r);if(l.length>0)return this.tiebreak(l,3)}}return null}filterTier1(e,t,r){let i=[];for(let s of e)s.targetClasses!==null&&s.referencingProperty===r&&s.targetClasses.includes(t)&&i.push(s);return i}filterTier2(e,t){let r=[];for(let i of e)i.targetClasses!==null&&i.referencingProperty===null&&i.targetClasses.includes(t)&&r.push(i);return r}filterTier3(e,t){let r=[];for(let i of e)i.targetClasses===null&&i.referencingProperty===t&&r.push(i);return r}tiebreak(e,t){let r=e.slice().sort((s,o)=>{let c=o.priority-s.priority;return c!==0?c:s.uid.localeCompare(o.uid)}),i=r[0];if(r.length>1){let s=i.priority,o=r.filter(c=>c.priority===s);if(o.length>1){let c=o.slice(1).map(l=>l.uid).join(", ");this.logger.warn(`RelationColumnSetResolver: tier=${t} priority=${s} collision \u2014 selected ${i.uid}; tied losers: ${c}`)}}return i}};Qm.RelationColumnSetResolver=Wb});var QC=S(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.RelationColumnSetResolver=void 0;var kU=HC();Object.defineProperty(Km,"RelationColumnSetResolver",{enumerable:!0,get:a(function(){return kU.RelationColumnSetResolver},"get")})});var YC=S(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.LayoutSelector=void 0;Af.selectByPriority=KC;var MU=zs(),Gb=class{static{a(this,"LayoutSelector")}constructor(e){this.source=e}resolve(e){if(!Array.isArray(e)||e.length===0)return null;let t=this.source.all;if(t.length===0)return null;for(let r of e){if(typeof r!="string")continue;let i=MU.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(o=>o.targetClass===i);if(s.length!==0)return KC(s)}return null}};Af.LayoutSelector=Gb;function KC(n){if(n.length===0)throw new Error("selectByPriority: expected at least one candidate");return n.length===1?n[0]:[...n].sort((t,r)=>t.priority!==r.priority?r.priority-t.priority:t.uid<r.uid?-1:t.uid>r.uid?1:0)[0]}a(KC,"selectByPriority")});var vs=S(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.ErrorCode=void 0;var XC;(function(n){n[n.INVALID_INPUT=1e3]="INVALID_INPUT",n[n.INVALID_FORMAT=1001]="INVALID_FORMAT",n[n.MISSING_REQUIRED_FIELD=1002]="MISSING_REQUIRED_FIELD",n[n.INVALID_SCHEMA=1003]="INVALID_SCHEMA",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.REQUEST_TIMEOUT=2001]="REQUEST_TIMEOUT",n[n.CONNECTION_FAILED=2002]="CONNECTION_FAILED",n[n.FILE_READ_ERROR=2003]="FILE_READ_ERROR",n[n.FILE_WRITE_ERROR=2004]="FILE_WRITE_ERROR",n[n.INVALID_STATE=3e3]="INVALID_STATE",n[n.INVALID_TRANSITION=3001]="INVALID_TRANSITION",n[n.OPERATION_FAILED=3002]="OPERATION_FAILED",n[n.CONCURRENT_MODIFICATION=3003]="CONCURRENT_MODIFICATION",n[n.PERMISSION_DENIED=4e3]="PERMISSION_DENIED",n[n.UNAUTHORIZED=4001]="UNAUTHORIZED",n[n.FORBIDDEN=4003]="FORBIDDEN",n[n.NOT_FOUND=5e3]="NOT_FOUND",n[n.RESOURCE_EXHAUSTED=5001]="RESOURCE_EXHAUSTED",n[n.ALREADY_EXISTS=5002]="ALREADY_EXISTS",n[n.UNKNOWN_ERROR=9e3]="UNKNOWN_ERROR",n[n.INTERNAL_ERROR=9001]="INTERNAL_ERROR"})(XC||(Ym.ErrorCode=XC={}))});var bs=S(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.ApplicationError=void 0;var zb=class extends Error{static{a(this,"ApplicationError")}constructor(e,t){super(e),this.name=this.constructor.name,this.context=t,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}format(){let e=`\u274C ${this.name}: ${this.message}`;if(this.guidance&&(e+=`
413
+ `)?`"${e.replace(/"/g,'""')}"`:e}};Bm.ResultSerializer=Cb});var OC=S(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.FileAlreadyExistsError=Al.FileNotFoundError=void 0;var Rb=class extends Error{static{a(this,"FileNotFoundError")}constructor(e){super(`File not found: ${e}`),this.name="FileNotFoundError"}};Al.FileNotFoundError=Rb;var Ib=class extends Error{static{a(this,"FileAlreadyExistsError")}constructor(e){super(`File already exists: ${e}`),this.name="FileAlreadyExistsError"}};Al.FileAlreadyExistsError=Ib});var Ob=S(wr=>{"use strict";var bB=wr&&wr.__decorate||function(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var c=n.length-1;c>=0;c--)(o=n[c])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s},wB=wr&&wr.__metadata||function(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)};Object.defineProperty(wr,"__esModule",{value:!0});wr.VaultSettings=wr.DEFAULT_FLEETING_NOTE_CLASS_UID=wr.DEFAULT_INBOX_FOLDER=wr.DEFAULT_OWNER_IDENTITY=void 0;var EB=fe();wr.DEFAULT_OWNER_IDENTITY='"[[!kitelev]]"';wr.DEFAULT_INBOX_FOLDER="01 Inbox";wr.DEFAULT_FLEETING_NOTE_CLASS_UID="fca0a931-a01f-48e4-b72a-4af206c94bc7";var Pb=class{static{a(this,"VaultSettings")}constructor(e){this.ownerIdentity=e?.ownerIdentity??wr.DEFAULT_OWNER_IDENTITY,this.defaultInboxFolder=e?.defaultInboxFolder??wr.DEFAULT_INBOX_FOLDER,this.fleetingNoteClassUID=e?.fleetingNoteClassUID??wr.DEFAULT_FLEETING_NOTE_CLASS_UID}getOwnerIdentity(){return this.ownerIdentity}getDefaultInboxFolder(){return this.defaultInboxFolder}getFleetingNoteClassUID(){return this.fleetingNoteClassUID}};wr.VaultSettings=Pb;wr.VaultSettings=Pb=bB([(0,EB.injectable)(),wB("design:paramtypes",[Object])],Pb)});var FC=S(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.container=void 0;Ho.registerCoreServices=QB;Ho.createChildContainer=KB;Ho.getContainer=YB;Ho.resetContainer=XB;eh();var vf=fe();Object.defineProperty(Ho,"container",{enumerable:!0,get:a(function(){return vf.container},"get")});var It=Et(),TB=hv(),AB=mv(),xB=nv(),CB=MS(),RB=DS(),IB=um(),PB=dm(),OB=JS(),FB=ev(),DB=sv(),NB=YS(),LB=yv(),kB=Av(),MB=wv(),jB=US(),$B=qS(),BB=fv(),UB=cv(),VB=gb(),qB=$S(),WB=Rv(),GB=Pv(),zB=Vv(),HB=Ob();function QB(n){let e=n||vf.container;e.registerSingleton(It.DI_TOKENS.DynamicFrontmatterGenerator,TB.DynamicFrontmatterGenerator),e.registerSingleton(It.DI_TOKENS.AlgorithmExtractor,AB.AlgorithmExtractor),e.isRegistered(It.DI_TOKENS.IVaultSettings)||e.register(It.DI_TOKENS.IVaultSettings,{useValue:new HB.VaultSettings}),e.registerSingleton(It.DI_TOKENS.EffortStatusWorkflow,IB.EffortStatusWorkflow),e.registerSingleton(It.DI_TOKENS.StatusTimestampService,PB.StatusTimestampService),e.registerSingleton(It.DI_TOKENS.TaskStatusService,RB.TaskStatusService),e.registerSingleton(It.DI_TOKENS.AreaCreationService,CB.AreaCreationService),e.registerSingleton(It.DI_TOKENS.ClassCreationService,jB.ClassCreationService),e.registerSingleton(It.DI_TOKENS.ConceptCreationService,$B.ConceptCreationService),e.registerSingleton(It.DI_TOKENS.FleetingNoteCreationService,BB.FleetingNoteCreationService),e.registerSingleton(It.DI_TOKENS.SupervisionCreationService,UB.SupervisionCreationService),e.registerSingleton(It.DI_TOKENS.GenericAssetCreationService,GB.GenericAssetCreationService),e.registerSingleton(It.DI_TOKENS.PropertyCleanupService,xB.PropertyCleanupService),e.registerSingleton(It.DI_TOKENS.FolderRepairService,OB.FolderRepairService),e.registerSingleton(It.DI_TOKENS.LabelToAliasService,FB.LabelToAliasService),e.registerSingleton(It.DI_TOKENS.RenameToUidService,DB.RenameToUidService),e.registerSingleton(It.DI_TOKENS.PlanningService,LB.PlanningService),e.registerSingleton(It.DI_TOKENS.EffortVotingService,NB.EffortVotingService),e.registerSingleton(It.DI_TOKENS.SessionEventService,kB.SessionEventService),e.registerSingleton(It.DI_TOKENS.AssetConversionService,MB.AssetConversionService),e.registerSingleton(It.DI_TOKENS.NoteToRDFConverter,VB.NoteToRDFConverter),e.registerSingleton(It.DI_TOKENS.AreaHierarchyBuilder,qB.AreaHierarchyBuilder),e.registerSingleton(It.DI_TOKENS.URIConstructionService,WB.URIConstructionService),e.registerSingleton(It.DI_TOKENS.CriticalityZoneService,zB.CriticalityZoneService)}a(QB,"registerCoreServices");function KB(){return vf.container.createChildContainer()}a(KB,"createChildContainer");function YB(){return vf.container}a(YB,"getContainer");function XB(){vf.container.reset()}a(XB,"resetContainer")});var Fb=S(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});xl.DEFAULT_COLORS=xl.NODE_FLAGS=void 0;xl.NODE_FLAGS={PINNED:1,VISIBLE:2,SELECTED:4,HOVERED:8,ARCHIVED:16,SEARCH_MATCH:32,HIGHLIGHTED:64};xl.DEFAULT_COLORS={NODE:1251006975,NODE_SELECTED:4290840575,NODE_HOVERED:1723558655,EDGE:2576980479,EDGE_SELECTED:4288151807,EDGE_HIERARCHY:2619846911}});var Nb=S(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.StringTable=void 0;var Db=class n{static{a(this,"StringTable")}constructor(e){if(this.stringToIndex=new Map,this.strings=[],this.memoryBytes=0,e)for(let t of e)this.intern(t)}intern(e){let t=this.stringToIndex.get(e);if(t!==void 0)return t;let r=this.strings.length;return this.strings.push(e),this.stringToIndex.set(e,r),this.memoryBytes+=e.length*2+50,r}getIndex(e){return this.stringToIndex.get(e)??-1}getString(e){if(e<0||e>=this.strings.length)throw new RangeError(`StringTable index out of bounds: ${e}`);return this.strings[e]}has(e){return this.stringToIndex.has(e)}hasIndex(e){return e>=0&&e<this.strings.length}get size(){return this.strings.length}getMemoryBytes(){return this.memoryBytes}*entries(){for(let e=0;e<this.strings.length;e++)yield[e,this.strings[e]]}*values(){for(let e of this.strings)yield e}toArray(){return[...this.strings]}clear(){this.stringToIndex.clear(),this.strings=[],this.memoryBytes=0}static fromJSON(e){return new n(e)}toJSON(){return this.strings}internAll(e){return e.map(t=>this.intern(t))}getStrings(e){return e.map(t=>this.getString(t))}search(e){let t=typeof e=="string"?new RegExp(e):e,r=[];for(let i=0;i<this.strings.length;i++)t.test(this.strings[i])&&r.push([i,this.strings[i]]);return r}getStats(){let e=this.strings.reduce((t,r)=>t+r.length,0);return{count:this.strings.length,memoryBytes:this.memoryBytes,avgStringLength:this.strings.length>0?e/this.strings.length:0}}};Um.StringTable=Db});var DC=S(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.CompactGraphStore=void 0;var Vm=Nb(),On=Fb(),JB={initialNodeCapacity:1e4,initialEdgeCapacity:5e4,growthFactor:2,maxCapacity:1e6};function Lb(n,e){if(n===void 0)return e;if(typeof n=="number")return n;if(n.startsWith("#")){let t=n.slice(1);if(t.length===6)return parseInt(t,16)<<8|255;if(t.length===8)return parseInt(t,16)}return e}a(Lb,"parseColor");var kb=class{static{a(this,"CompactGraphStore")}constructor(e){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex=new Map,this.indexToNodeId=[],this.edgeIdToIndex=new Map,this.config={...JB,...e},this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity),this.uriTable=new Vm.StringTable,this.labelTable=new Vm.StringTable,this.typeTable=new Vm.StringTable,this.predicateTable=new Vm.StringTable}allocateNodeArrays(e){return{positions:new Float32Array(e*2),radii:new Float32Array(e),colors:new Uint32Array(e),types:new Uint16Array(e),flags:new Uint8Array(e)}}allocateEdgeArrays(e){return{sourceIndices:new Uint32Array(e),targetIndices:new Uint32Array(e),predicateIndices:new Uint16Array(e),widths:new Float32Array(e),colors:new Uint32Array(e)}}resizeNodeArrays(e){if(e<=this.nodeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateNodeArrays(e);t.positions.set(this.nodes.positions.subarray(0,this.nodeCount*2)),t.radii.set(this.nodes.radii.subarray(0,this.nodeCount)),t.colors.set(this.nodes.colors.subarray(0,this.nodeCount)),t.types.set(this.nodes.types.subarray(0,this.nodeCount)),t.flags.set(this.nodes.flags.subarray(0,this.nodeCount)),this.nodes=t,this.nodeCapacity=e}resizeEdgeArrays(e){if(e<=this.edgeCapacity)return;if(e>this.config.maxCapacity)throw new Error(`Cannot resize beyond max capacity (${this.config.maxCapacity})`);let t=this.allocateEdgeArrays(e);t.sourceIndices.set(this.edges.sourceIndices.subarray(0,this.edgeCount)),t.targetIndices.set(this.edges.targetIndices.subarray(0,this.edgeCount)),t.predicateIndices.set(this.edges.predicateIndices.subarray(0,this.edgeCount)),t.widths.set(this.edges.widths.subarray(0,this.edgeCount)),t.colors.set(this.edges.colors.subarray(0,this.edgeCount)),this.edges=t,this.edgeCapacity=e}ensureNodeCapacity(e){let t=this.nodeCount+e;if(t>this.nodeCapacity){let r=Math.max(t,Math.floor(this.nodeCapacity*this.config.growthFactor));this.resizeNodeArrays(r)}}ensureEdgeCapacity(e){let t=this.edgeCount+e;if(t>this.edgeCapacity){let r=Math.max(t,Math.floor(this.edgeCapacity*this.config.growthFactor));this.resizeEdgeArrays(r)}}addNode(e){let t=this.nodeIdToIndex.get(e.id);if(t!==void 0)return this.updateNodeAt(t,e),t;this.ensureNodeCapacity(1);let r=this.nodeCount++,i=r*2;this.nodes.positions[i]=e.x??Math.random()*1e3-500,this.nodes.positions[i+1]=e.y??Math.random()*1e3-500,this.nodes.radii[r]=e.radius??8,this.nodes.colors[r]=Lb(e.color,On.DEFAULT_COLORS.NODE),e.assetClass?this.nodes.types[r]=this.typeTable.intern(e.assetClass):this.nodes.types[r]=0;let s=On.NODE_FLAGS.VISIBLE;return e.isPinned&&(s|=On.NODE_FLAGS.PINNED),e.isArchived&&(s|=On.NODE_FLAGS.ARCHIVED),this.nodes.flags[r]=s,this.nodeIdToIndex.set(e.id,r),this.indexToNodeId[r]=e.id,this.uriTable.intern(e.id),e.label&&this.labelTable.intern(e.label),r}updateNodeAt(e,t){let r=e*2;t.x!==void 0&&(this.nodes.positions[r]=t.x),t.y!==void 0&&(this.nodes.positions[r+1]=t.y),t.radius!==void 0&&(this.nodes.radii[e]=t.radius),t.color!==void 0&&(this.nodes.colors[e]=Lb(t.color,On.DEFAULT_COLORS.NODE)),t.assetClass!==void 0&&(this.nodes.types[e]=this.typeTable.intern(t.assetClass));let i=this.nodes.flags[e];t.isPinned!==void 0&&(i=t.isPinned?i|On.NODE_FLAGS.PINNED:i&~On.NODE_FLAGS.PINNED),t.isArchived!==void 0&&(i=t.isArchived?i|On.NODE_FLAGS.ARCHIVED:i&~On.NODE_FLAGS.ARCHIVED),this.nodes.flags[e]=i}addEdge(e){let t=this.nodeIdToIndex.get(e.sourceId),r=this.nodeIdToIndex.get(e.targetId);if(t===void 0||r===void 0)return-1;let i=`${e.sourceId}->${e.targetId}:${e.predicate??"link"}`,s=this.edgeIdToIndex.get(i);if(s!==void 0)return s;this.ensureEdgeCapacity(1);let o=this.edgeCount++;return this.edges.sourceIndices[o]=t,this.edges.targetIndices[o]=r,this.edges.widths[o]=e.width??1,this.edges.colors[o]=Lb(e.color,On.DEFAULT_COLORS.EDGE),e.predicate?this.edges.predicateIndices[o]=this.predicateTable.intern(e.predicate):this.edges.predicateIndices[o]=0,this.edgeIdToIndex.set(i,o),o}addNodes(e){return this.ensureNodeCapacity(e.length),e.map(t=>this.addNode(t))}addEdges(e){return this.ensureEdgeCapacity(e.length),e.map(t=>this.addEdge(t))}loadChunk(e){let r=this.addNodes(e.nodes).filter(o=>o>=0).length,s=this.addEdges(e.edges).filter(o=>o>=0).length;return{nodesAdded:r,edgesAdded:s}}getNodePosition(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return null;let r=t*2;return{x:this.nodes.positions[r],y:this.nodes.positions[r+1]}}getNodePositionByIndex(e){let t=e*2;return{x:this.nodes.positions[t],y:this.nodes.positions[t+1]}}setNodePosition(e,t,r){let i=this.nodeIdToIndex.get(e);if(i===void 0)return!1;let s=i*2;return this.nodes.positions[s]=t,this.nodes.positions[s+1]=r,!0}setNodePositionByIndex(e,t,r){let i=e*2;this.nodes.positions[i]=t,this.nodes.positions[i+1]=r}updateNodePositions(e){let t=0;for(let[r,i]of e)this.setNodePosition(r,i.x,i.y)&&t++;return t}applyNodeUpdates(e){let t=performance.now(),r=0;for(let i of e){let s=i.index;if(!(s<0||s>=this.nodeCount)){if(i.x!==void 0||i.y!==void 0){let o=s*2;i.x!==void 0&&(this.nodes.positions[o]=i.x),i.y!==void 0&&(this.nodes.positions[o+1]=i.y)}i.radius!==void 0&&(this.nodes.radii[s]=i.radius),i.color!==void 0&&(this.nodes.colors[s]=i.color),i.setFlags!==void 0&&(this.nodes.flags[s]|=i.setFlags),i.clearFlags!==void 0&&(this.nodes.flags[s]&=~i.clearFlags),r++}}return{nodesUpdated:r,edgesUpdated:0,timeMs:performance.now()-t}}getNodeFlags(e){let t=this.nodeIdToIndex.get(e);return t===void 0?0:this.nodes.flags[t]}setNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]|=t,!0)}clearNodeFlag(e,t){let r=this.nodeIdToIndex.get(e);return r===void 0?!1:(this.nodes.flags[r]&=~t,!0)}hasNodeFlag(e,t){return(this.getNodeFlags(e)&t)!==0}selectNode(e){return this.setNodeFlag(e,On.NODE_FLAGS.SELECTED)}deselectNode(e){return this.clearNodeFlag(e,On.NODE_FLAGS.SELECTED)}clearSelection(){for(let e=0;e<this.nodeCount;e++)this.nodes.flags[e]&=~On.NODE_FLAGS.SELECTED}getSelectedNodeIds(){let e=[];for(let t=0;t<this.nodeCount;t++)this.nodes.flags[t]&On.NODE_FLAGS.SELECTED&&e.push(this.indexToNodeId[t]);return e}getNodeId(e){return this.indexToNodeId[e]}getNodeIndex(e){return this.nodeIdToIndex.get(e)}hasNode(e){return this.nodeIdToIndex.has(e)}getNodeCount(){return this.nodeCount}getEdgeCount(){return this.edgeCount}getNodeEdges(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=[];for(let i=0;i<this.edgeCount;i++)this.edges.sourceIndices[i]===t?r.push({edgeIndex:i,isSource:!0}):this.edges.targetIndices[i]===t&&r.push({edgeIndex:i,isSource:!1});return r}getNeighbors(e){let t=this.nodeIdToIndex.get(e);if(t===void 0)return[];let r=new Set;for(let i=0;i<this.edgeCount;i++)if(this.edges.sourceIndices[i]===t){let s=this.edges.targetIndices[i];r.add(this.indexToNodeId[s])}else if(this.edges.targetIndices[i]===t){let s=this.edges.sourceIndices[i];r.add(this.indexToNodeId[s])}return Array.from(r)}getRawArrays(){return{nodes:this.nodes,edges:this.edges,nodeCount:this.nodeCount,edgeCount:this.edgeCount}}getPositionsArray(){return this.nodes.positions.subarray(0,this.nodeCount*2)}getMemoryStats(){let e=this.nodeCapacity*2*4+this.nodeCapacity*4+this.nodeCapacity*4+this.nodeCapacity*2+this.nodeCapacity,t=this.edgeCapacity*4+this.edgeCapacity*4+this.edgeCapacity*2+this.edgeCapacity*4+this.edgeCapacity*4,r=this.uriTable.getMemoryBytes()+this.labelTable.getMemoryBytes()+this.typeTable.getMemoryBytes()+this.predicateTable.getMemoryBytes();return{nodeCount:this.nodeCount,edgeCount:this.edgeCount,nodeCapacity:this.nodeCapacity,edgeCapacity:this.edgeCapacity,nodeMemoryBytes:e,edgeMemoryBytes:t,stringTableBytes:r,totalBytes:e+t+r,internedStringCount:this.uriTable.size+this.labelTable.size+this.typeTable.size+this.predicateTable.size}}clear(){this.nodeCount=0,this.edgeCount=0,this.nodeIdToIndex.clear(),this.indexToNodeId=[],this.edgeIdToIndex.clear(),this.uriTable.clear(),this.labelTable.clear(),this.typeTable.clear(),this.predicateTable.clear(),this.nodeCapacity=this.config.initialNodeCapacity,this.edgeCapacity=this.config.initialEdgeCapacity,this.nodes=this.allocateNodeArrays(this.nodeCapacity),this.edges=this.allocateEdgeArrays(this.edgeCapacity)}getTypeTable(){return this.typeTable}getLabelTable(){return this.labelTable}getUriTable(){return this.uriTable}getPredicateTable(){return this.predicateTable}};qm.CompactGraphStore=kb});var NC=S(Rl=>{"use strict";Object.defineProperty(Rl,"__esModule",{value:!0});Rl.MemoryPool=void 0;Rl.getGlobalPool=eU;Rl.resetGlobalPool=tU;var ZB={maxPooledArrays:16,sizeBuckets:[64,256,1024,4096,16384,65536,262144],autoCleanup:!0,maxPoolMemory:50*1024*1024},Wm=class{static{a(this,"MemoryPool")}constructor(e){this.float32Pool=new Map,this.uint32Pool=new Map,this.uint16Pool=new Map,this.uint8Pool=new Map,this.stats={poolHits:0,poolMisses:0,pooledArrays:0,pooledMemory:0,returned:0,rejected:0},this.config={...ZB,...e};for(let t of this.config.sizeBuckets)this.float32Pool.set(t,[]),this.uint32Pool.set(t,[]),this.uint16Pool.set(t,[]),this.uint8Pool.set(t,[])}getBucketSize(e){for(let t of this.config.sizeBuckets)if(t>=e)return t;return e}getFloat32(e){let t=this.getBucketSize(e),r=this.float32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Float32Array(t)}getUint32(e){let t=this.getBucketSize(e),r=this.uint32Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*4;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint32Array(t)}getUint16(e){let t=this.getBucketSize(e),r=this.uint16Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t*2;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint16Array(t)}getUint8(e){let t=this.getBucketSize(e),r=this.uint8Pool.get(t);if(r&&r.length>0){this.stats.poolHits++,this.stats.pooledArrays--,this.stats.pooledMemory-=t;let i=r.pop();return i.fill(0),i}return this.stats.poolMisses++,new Uint8Array(t)}releaseFloat32(e){this.releaseToPool(this.float32Pool,e,4)}releaseUint32(e){this.releaseToPool(this.uint32Pool,e,4)}releaseUint16(e){this.releaseToPool(this.uint16Pool,e,2)}releaseUint8(e){this.releaseToPool(this.uint8Pool,e,1)}releaseToPool(e,t,r){let i=t.length,s=e.get(i);if(s&&s.length<this.config.maxPooledArrays){if(this.config.autoCleanup&&this.stats.pooledMemory+i*r>this.config.maxPoolMemory){this.stats.rejected++;return}s.push(t),this.stats.returned++,this.stats.pooledArrays++,this.stats.pooledMemory+=i*r}else this.stats.rejected++}getStats(){return{...this.stats}}getHitRatio(){let e=this.stats.poolHits+this.stats.poolMisses;return e>0?this.stats.poolHits/e:0}clear(){for(let e of this.float32Pool.values())e.length=0;for(let e of this.uint32Pool.values())e.length=0;for(let e of this.uint16Pool.values())e.length=0;for(let e of this.uint8Pool.values())e.length=0;this.stats.pooledArrays=0,this.stats.pooledMemory=0}cleanup(e){if(this.stats.pooledMemory<=e)return;let t=[...this.config.sizeBuckets].sort((r,i)=>i-r);for(let r of t){if(this.stats.pooledMemory<=e)break;for(let[i,s]of[[this.float32Pool,4],[this.uint32Pool,4],[this.uint16Pool,2],[this.uint8Pool,1]]){let o=i.get(r);if(o)for(;o.length>0&&this.stats.pooledMemory>e;)o.pop(),this.stats.pooledArrays--,this.stats.pooledMemory-=r*s}}}resetStats(){this.stats.poolHits=0,this.stats.poolMisses=0,this.stats.returned=0,this.stats.rejected=0}};Rl.MemoryPool=Wm;var Cl=null;function eU(){return Cl||(Cl=new Wm),Cl}a(eU,"getGlobalPool");function tU(){Cl&&Cl.clear(),Cl=null}a(tU,"resetGlobalPool")});var LC=S(bf=>{"use strict";Object.defineProperty(bf,"__esModule",{value:!0});bf.StreamingLoader=void 0;bf.createStreamingSource=nU;var rU={chunkSize:1e3,chunkDelay:0,autoResolveEdges:!0,maxConcurrency:1},Mb=class{static{a(this,"StreamingLoader")}constructor(e,t){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.progressCallbacks=[],this.abortController=null,this.store=e,this.config={...rU,...t}}getState(){return this.state}getProgress(){let e=this.totalChunks!==void 0&&this.totalChunks>0?this.chunksProcessed/this.totalChunks:0;return{currentChunk:this.chunksProcessed,totalChunks:this.totalChunks,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,progress:e,isComplete:this.state==="completed"}}onProgress(e){return this.progressCallbacks.push(e),()=>{let t=this.progressCallbacks.indexOf(e);t>=0&&this.progressCallbacks.splice(t,1)}}notifyProgress(){let e=this.getProgress();for(let t of this.progressCallbacks)t(e)}loadChunk(e){if(this.state==="error")throw new Error("Loader is in error state");this.state="loading",e.totalChunks!==void 0&&(this.totalChunks=e.totalChunks);for(let t of e.nodes)this.store.addNode(t),this.nodesLoaded++;for(let t of e.edges)this.store.addEdge(t)>=0?this.edgesLoaded++:this.pendingEdges.push(t);this.chunksProcessed++,e.isLast&&this.finishLoading(),this.notifyProgress()}finishLoading(){if(this.config.autoResolveEdges&&this.pendingEdges.length>0){for(let e of this.pendingEdges)this.store.addEdge(e)>=0&&this.edgesLoaded++;this.pendingEdges=[]}this.state="completed",this.notifyProgress()}async loadFromIterator(e){this.reset(),this.state="loading",this.abortController=new AbortController;try{for await(let r of e){if(this.abortController.signal.aborted){this.state="paused";return}this.loadChunk(r),this.config.chunkDelay>0&&await this.delay(this.config.chunkDelay)}this.state!=="completed"&&this.finishLoading()}catch(t){throw this.state="error",t}finally{this.abortController=null}}async loadFromArrays(e,t){let r=this.createChunks(e,t);await this.loadFromIterator(this.arrayToAsyncIterator(r))}createChunks(e,t){let r=[],{chunkSize:i}=this.config,s=Math.ceil(e.length/i),o=Array(s).fill(null).map(()=>[]);for(let c of t){let l=e.findIndex(u=>u.id===c.sourceId);if(l>=0){let u=Math.floor(l/i);o[u].push(c)}}for(let c=0;c<s;c++){let l=c*i,u=Math.min(l+i,e.length);r.push({chunkIndex:c,totalChunks:s,nodes:e.slice(l,u),edges:o[c],isLast:c===s-1})}return r}async*arrayToAsyncIterator(e){for(let t of e)yield t}delay(e){return new Promise(t=>setTimeout(t,e))}cancel(){this.abortController&&this.abortController.abort(),this.state="paused"}reset(){this.state="idle",this.pendingEdges=[],this.nodesLoaded=0,this.edgesLoaded=0,this.chunksProcessed=0,this.totalChunks=void 0,this.abortController=null}getPendingEdgeCount(){return this.pendingEdges.length}getStats(){return{state:this.state,nodesLoaded:this.nodesLoaded,edgesLoaded:this.edgesLoaded,chunksProcessed:this.chunksProcessed,totalChunks:this.totalChunks,pendingEdges:this.pendingEdges.length,storeStats:this.store.getMemoryStats()}}};bf.StreamingLoader=Mb;async function*nU(n,e,t=1e3){let r=0,i=0,s;for(;;){let o=await e(n,r,t);if(o.totalCount!==void 0&&s===void 0&&(s=Math.ceil(o.totalCount/t)),yield{chunkIndex:i,totalChunks:s,nodes:o.nodes,edges:o.edges,isLast:!o.hasMore},!o.hasMore)break;r+=t,i++}}a(nU,"createStreamingSource")});var jC=S(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.createStreamingSource=nr.StreamingLoader=nr.resetGlobalPool=nr.getGlobalPool=nr.MemoryPool=nr.CompactGraphStore=nr.StringTable=nr.DEFAULT_COLORS=nr.NODE_FLAGS=void 0;var kC=Fb();Object.defineProperty(nr,"NODE_FLAGS",{enumerable:!0,get:a(function(){return kC.NODE_FLAGS},"get")});Object.defineProperty(nr,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return kC.DEFAULT_COLORS},"get")});var iU=Nb();Object.defineProperty(nr,"StringTable",{enumerable:!0,get:a(function(){return iU.StringTable},"get")});var sU=DC();Object.defineProperty(nr,"CompactGraphStore",{enumerable:!0,get:a(function(){return sU.CompactGraphStore},"get")});var jb=NC();Object.defineProperty(nr,"MemoryPool",{enumerable:!0,get:a(function(){return jb.MemoryPool},"get")});Object.defineProperty(nr,"getGlobalPool",{enumerable:!0,get:a(function(){return jb.getGlobalPool},"get")});Object.defineProperty(nr,"resetGlobalPool",{enumerable:!0,get:a(function(){return jb.resetGlobalPool},"get")});var MC=LC();Object.defineProperty(nr,"StreamingLoader",{enumerable:!0,get:a(function(){return MC.StreamingLoader},"get")});Object.defineProperty(nr,"createStreamingSource",{enumerable:!0,get:a(function(){return MC.createStreamingSource},"get")})});var $C=S(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.ExoQLError=ir.ExoQL=ir.ExoQLBudgetExceededError=ir.ExoQLCycleError=ir.ExoQLEvalDisabledError=ir.ExoQLForbiddenKeywordError=ir.DEFAULT_EVAL_CONFIG=ir.validateExoQLAllowlist=ir.evaluateWithExoEval=void 0;var oU=Uc(),aU=qc(),cU=ll(),$b=pb(),lU=Ne(),uU=mS();Object.defineProperty(ir,"evaluateWithExoEval",{enumerable:!0,get:a(function(){return uU.evaluateWithExoEval},"get")});var fU=dS();Object.defineProperty(ir,"validateExoQLAllowlist",{enumerable:!0,get:a(function(){return fU.validateExoQLAllowlist},"get")});var dU=hS();Object.defineProperty(ir,"DEFAULT_EVAL_CONFIG",{enumerable:!0,get:a(function(){return dU.DEFAULT_EVAL_CONFIG},"get")});var Gm=sf();Object.defineProperty(ir,"ExoQLForbiddenKeywordError",{enumerable:!0,get:a(function(){return Gm.ExoQLForbiddenKeywordError},"get")});Object.defineProperty(ir,"ExoQLEvalDisabledError",{enumerable:!0,get:a(function(){return Gm.ExoQLEvalDisabledError},"get")});Object.defineProperty(ir,"ExoQLCycleError",{enumerable:!0,get:a(function(){return Gm.ExoQLCycleError},"get")});Object.defineProperty(ir,"ExoQLBudgetExceededError",{enumerable:!0,get:a(function(){return Gm.ExoQLBudgetExceededError},"get")});var Bb=class n{static{a(this,"ExoQL")}static async query(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);return s.executeAll(i)}static async ask(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isAskQuery(i))throw new wf("ExoQL.ask() requires an ASK query");return s.executeAsk(i)}static async construct(e,t,r){let{algebra:i,executor:s}=n.prepare(e,t,r);if(!s.isConstructQuery(i))throw new wf("ExoQL.construct() requires a CONSTRUCT query");return s.executeConstruct(i)}static async queryOwn(e,t,r,i){let s=await n.query(e,t,i);if(s.length===0)return[];let o=r?.subjectVar??"s",c=r?.predicateVar??"p",l=r?.objectVar??"o";return(await new $b.SourceAnnotator(t).annotate(s,o,c,l)).filter(d=>{let h=d.get($b.SOURCE_VARIABLE);return h instanceof lU.Literal&&h.value==="own"})}static async isOwn(e,t,r,i){return await new $b.SourceAnnotator(i).determineSource(e,t,r)==="own"}static prepare(e,t,r){let i=new oU.ExoQLParser,s=new aU.ExoQLAlgebraTranslator,o=i.parse(e),c=s.translate(o),l=new cU.ExoQLQueryExecutor(t,r);return{algebra:c,executor:l}}};ir.ExoQL=Bb;var wf=class extends Error{static{a(this,"ExoQLError")}constructor(e){super(e),this.name="ExoQLError"}};ir.ExoQLError=wf});var Ef=S(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.RELATION_COLUMN_SET_CLASS_UID=ni.RELATION_COLUMN_SET_CLASS_IRI=void 0;ni.normalizeRef=Ub;ni.createRelationColumnSetFromFrontmatter=pU;ni.isRelationColumnSet=mU;ni.isRelationColumnSetFrontmatter=yU;var BC=zs();function Ub(n){if(typeof n!="string")return null;let e=BC.WikiLinkHelpers.normalize(n);return e.length>0?e:null}a(Ub,"normalizeRef");function Vb(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(Vb,"toStringArray");function hU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(hU,"basenameFromPath");function pU(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`RelationColumnSet: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`RelationColumnSet: exo__Asset_uid missing at ${r}`),null;let o=Vb(n.ui__RelationColumnSet_targetClass),c=[];for(let b of o){let w=Ub(b);w!==null&&c.push(w)}let l=c.length>0?c:null,u=Ub(n.ui__RelationColumnSet_referencingProperty);if(l===null&&u===null)return t(`RelationColumnSet ${s}: at least one of targetClass / referencingProperty required (${r})`),null;let f=Vb(n.ui__RelationColumnSet_columns),d=[];for(let b of f){let w=BC.WikiLinkHelpers.normalize(b);w.length>0&&d.push(w)}if(d.length===0)return t(`RelationColumnSet ${s}: columns array must contain at least one entry (${r})`),null;let h=n.ui__RelationColumnSet_label,p=typeof h=="string"&&h.trim().length>0?h.trim():hU(r),y=n.ui__RelationColumnSet_priority,v=0;if(typeof y=="number"&&Number.isFinite(y))v=y;else if(typeof y=="string"){let b=Number.parseFloat(y);Number.isFinite(b)&&(v=b)}return{uid:s,label:p,targetClasses:l,referencingProperty:u,columns:d,priority:v,sourcePath:r}}a(pU,"createRelationColumnSetFromFrontmatter");function mU(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||e.targetClasses!==null&&(!Array.isArray(e.targetClasses)||e.targetClasses.some(t=>typeof t!="string"))||e.referencingProperty!==null&&typeof e.referencingProperty!="string"||!Array.isArray(e.columns)||e.columns.length===0||e.columns.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.sourcePath!="string")}a(mU,"isRelationColumnSet");ni.RELATION_COLUMN_SET_CLASS_IRI="ui__RelationColumnSet";ni.RELATION_COLUMN_SET_CLASS_UID="97fc9862-c886-4d86-9a60-e0cf9d778575";function gU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(s=>s.trim()).filter(s=>s.length>0)}a(gU,"extractClassIdentifiers");function yU(n){if(!n)return!1;let e=n.exo__Instance_class,t=Vb(e);for(let r of t)for(let i of gU(r))if(i===ni.RELATION_COLUMN_SET_CLASS_IRI||i===ni.RELATION_COLUMN_SET_CLASS_UID)return!0;return!1}a(yU,"isRelationColumnSetFrontmatter")});var VC=S(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.LAYOUT_CLASS_UID=Ui.LAYOUT_CLASS_IRI=void 0;Ui.createLayoutFromFrontmatter=EU;Ui.isLayout=TU;Ui.isLayoutFrontmatter=xU;var _U=zs(),SU=Ef();Ui.LAYOUT_CLASS_IRI="exo__Layout";Ui.LAYOUT_CLASS_UID="08d00289-a5c8-4df1-8885-40a00a014004";function UC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(UC,"toStringArray");function vU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(vU,"basenameFromPath");function bU(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(bU,"parseBoolean");function wU(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"){let e=Number.parseFloat(n);if(Number.isFinite(e))return e}return 0}a(wU,"parsePriority");function EU(n,e){let t=e.warn??(()=>{}),r=e.sourcePath;if(!n||typeof n!="object")return t(`Layout: missing frontmatter at ${r}`),null;let i=n.exo__Asset_uid,s=typeof i=="string"?i.trim():"";if(s.length===0)return t(`Layout: exo__Asset_uid missing at ${r}`),null;let o=(0,SU.normalizeRef)(n.exo__Layout_targetClass);if(o===null)return t(`Layout ${s}: exo__Layout_targetClass required (${r})`),null;let c=UC(n.exo__Layout_blocks),l=[];for(let p of c){let y=_U.WikiLinkHelpers.normalize(p);y.length>0&&l.push(y)}if(l.length===0)return t(`Layout ${s}: exo__Layout_blocks must contain at least one block (${r})`),null;let u=n.exo__Asset_label,f=typeof u=="string"&&u.trim().length>0?u.trim():vU(r),d=wU(n.exo__Layout_priority),h=bU(n.exo__Layout_coexistsWithDefault,!1);return{uid:s,label:f,targetClass:o,blocks:l,priority:d,coexistsWithDefault:h,sourcePath:r}}a(EU,"createLayoutFromFrontmatter");function TU(n){if(!n||typeof n!="object")return!1;let e=n;return!(typeof e.uid!="string"||e.uid.length===0||typeof e.label!="string"||typeof e.targetClass!="string"||e.targetClass.length===0||!Array.isArray(e.blocks)||e.blocks.length===0||e.blocks.some(t=>typeof t!="string")||typeof e.priority!="number"||!Number.isFinite(e.priority)||typeof e.coexistsWithDefault!="boolean"||typeof e.sourcePath!="string")}a(TU,"isLayout");function AU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(AU,"extractClassIdentifiers");function xU(n){if(!n)return!1;let e=UC(n.exo__Instance_class);for(let t of e)for(let r of AU(t))if(r===Ui.LAYOUT_CLASS_IRI||r===Ui.LAYOUT_CLASS_UID)return!0;return!1}a(xU,"isLayoutFrontmatter")});var GC=S(Wt=>{"use strict";Object.defineProperty(Wt,"__esModule",{value:!0});Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID=Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI=Wt.PROPERTIES_BLOCK_CLASS_UID=Wt.PROPERTIES_BLOCK_CLASS_IRI=void 0;Wt.createLayoutBlockFromFrontmatter=FU;Wt.isLayoutBlockFrontmatter=DU;Wt.isPropertiesBlock=NU;Wt.isBacklinksTableBlock=LU;var CU=zs(),qb=Ef();Wt.PROPERTIES_BLOCK_CLASS_IRI="exo__PropertiesBlock";Wt.PROPERTIES_BLOCK_CLASS_UID="fd039b3c-ed2b-41c2-a42e-bbfcdd074bfe";Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI="exo__BacklinksTableBlock";Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID="2e868956-d81e-43fd-9817-1addde9cb311";function qC(n){return n==null?[]:Array.isArray(n)?n.filter(e=>typeof e=="string"):typeof n=="string"?[n]:[]}a(qC,"toStringArray");function RU(n){let e=n.lastIndexOf("/"),t=e>=0?n.slice(e+1):n,r=t.lastIndexOf(".");return r>=0?t.slice(0,r):t}a(RU,"basenameFromPath");function WC(n,e){if(typeof n=="boolean")return n;if(typeof n=="string"){let t=n.trim().toLowerCase();if(t==="true")return!0;if(t==="false")return!1}return e}a(WC,"parseBoolean");function IU(n){if(typeof n=="number"&&Number.isFinite(n)&&Number.isInteger(n))return n;if(typeof n=="string"){let e=Number.parseInt(n,10);if(Number.isFinite(e))return e}return null}a(IU,"parseInteger");function PU(n){let e=n.trim();if(e.length===0)return[];let t=e.match(/^\[\[([^\]]+)\]\]$/);return(t?t[1]:e).split("|").map(i=>i.trim()).filter(i=>i.length>0)}a(PU,"extractClassIdentifiers");function zm(n,e,t){let r=qC(n.exo__Instance_class);for(let i of r)for(let s of PU(i))if(s===e||s===t)return!0;return!1}a(zm,"classOf");function OU(n,e){let t=e.warn??(()=>{}),r=n.exo__Asset_uid,i=typeof r=="string"?r.trim():"";if(i.length===0)return t(`LayoutBlock: exo__Asset_uid missing at ${e.sourcePath}`),null;let s=n.exo__LayoutBlock_title,o=n.exo__Asset_label,c=typeof s=="string"&&s.trim().length>0?s.trim():typeof o=="string"&&o.trim().length>0?o.trim():RU(e.sourcePath),l=WC(n.exo__LayoutBlock_collapsed,!1);return{uid:i,title:c,collapsed:l,sourcePath:e.sourcePath}}a(OU,"extractBase");function FU(n,e){let t=e.warn??(()=>{});if(!n||typeof n!="object")return t(`LayoutBlock: missing frontmatter at ${e.sourcePath}`),null;let r=OU(n,e);if(r===null)return null;if(zm(n,Wt.PROPERTIES_BLOCK_CLASS_IRI,Wt.PROPERTIES_BLOCK_CLASS_UID))return{...r,kind:"properties"};if(zm(n,Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID)){let i=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_rowClass),s=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_referencingProperty);if(i===null||s===null)return t(`BacklinksTableBlock ${r.uid}: rowClass and referencingProperty required (${e.sourcePath})`),null;let o=qC(n.exo__BacklinksTableBlock_columns),c=[];for(let p of o){let y=CU.WikiLinkHelpers.normalize(p);y.length>0&&c.push(y)}let l=(0,qb.normalizeRef)(n.exo__BacklinksTableBlock_sortBy),u=n.exo__BacklinksTableBlock_sortOrder,f=typeof u=="string"&&u.trim().toLowerCase()==="desc"?"desc":"asc",d=IU(n.exo__BacklinksTableBlock_limit),h=WC(n.exo__BacklinksTableBlock_showArchived,!1);return{...r,kind:"backlinks-table",rowClass:i,referencingProperty:s,columns:c,sortBy:l,sortOrder:f,limit:d,showArchived:h}}return t(`LayoutBlock ${r.uid}: unknown block class at ${e.sourcePath} \u2014 expected exo__PropertiesBlock or exo__BacklinksTableBlock`),null}a(FU,"createLayoutBlockFromFrontmatter");function DU(n){return n?zm(n,Wt.PROPERTIES_BLOCK_CLASS_IRI,Wt.PROPERTIES_BLOCK_CLASS_UID)||zm(n,Wt.BACKLINKS_TABLE_BLOCK_CLASS_IRI,Wt.BACKLINKS_TABLE_BLOCK_CLASS_UID):!1}a(DU,"isLayoutBlockFrontmatter");function NU(n){return n.kind==="properties"}a(NU,"isPropertiesBlock");function LU(n){return n.kind==="backlinks-table"}a(LU,"isBacklinksTableBlock")});var Hm=S(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isPropertiesBlock=je.isLayoutBlockFrontmatter=je.isBacklinksTableBlock=je.createLayoutBlockFromFrontmatter=je.PROPERTIES_BLOCK_CLASS_UID=je.PROPERTIES_BLOCK_CLASS_IRI=je.BACKLINKS_TABLE_BLOCK_CLASS_UID=je.BACKLINKS_TABLE_BLOCK_CLASS_IRI=je.isLayoutFrontmatter=je.isLayout=je.createLayoutFromFrontmatter=je.LAYOUT_CLASS_UID=je.LAYOUT_CLASS_IRI=je.normalizeRef=je.isRelationColumnSetFrontmatter=je.isRelationColumnSet=je.createRelationColumnSetFromFrontmatter=je.RELATION_COLUMN_SET_CLASS_UID=je.RELATION_COLUMN_SET_CLASS_IRI=void 0;var Il=Ef();Object.defineProperty(je,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:a(function(){return Il.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(je,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:a(function(){return Il.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(je,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:a(function(){return Il.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(je,"isRelationColumnSet",{enumerable:!0,get:a(function(){return Il.isRelationColumnSet},"get")});Object.defineProperty(je,"isRelationColumnSetFrontmatter",{enumerable:!0,get:a(function(){return Il.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(je,"normalizeRef",{enumerable:!0,get:a(function(){return Il.normalizeRef},"get")});var Tf=VC();Object.defineProperty(je,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return Tf.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(je,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return Tf.LAYOUT_CLASS_UID},"get")});Object.defineProperty(je,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return Tf.createLayoutFromFrontmatter},"get")});Object.defineProperty(je,"isLayout",{enumerable:!0,get:a(function(){return Tf.isLayout},"get")});Object.defineProperty(je,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return Tf.isLayoutFrontmatter},"get")});var Qo=GC();Object.defineProperty(je,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Qo.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(je,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Qo.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(je,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Qo.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(je,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Qo.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(je,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Qo.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(je,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Qo.isBacklinksTableBlock},"get")});Object.defineProperty(je,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Qo.isLayoutBlockFrontmatter},"get")});Object.defineProperty(je,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Qo.isPropertiesBlock},"get")})});var HC=S(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.RelationColumnSetResolver=void 0;var zC=Ef(),kU={warn:a(()=>{},"warn")},Wb=class{static{a(this,"RelationColumnSetResolver")}constructor(e,t={}){this.provider=e,this.logger=t.logger??kU}resolve(e,t){if(!e||e.length===0)return null;let r=t!=null?(0,zC.normalizeRef)(t):null,i=this.provider();if(i.length===0)return null;for(let s of e){let o=(0,zC.normalizeRef)(s);if(o===null)continue;if(r!==null){let l=this.filterTier1(i,o,r);if(l.length>0)return this.tiebreak(l,1)}let c=this.filterTier2(i,o);if(c.length>0)return this.tiebreak(c,2);if(r!==null){let l=this.filterTier3(i,r);if(l.length>0)return this.tiebreak(l,3)}}return null}filterTier1(e,t,r){let i=[];for(let s of e)s.targetClasses!==null&&s.referencingProperty===r&&s.targetClasses.includes(t)&&i.push(s);return i}filterTier2(e,t){let r=[];for(let i of e)i.targetClasses!==null&&i.referencingProperty===null&&i.targetClasses.includes(t)&&r.push(i);return r}filterTier3(e,t){let r=[];for(let i of e)i.targetClasses===null&&i.referencingProperty===t&&r.push(i);return r}tiebreak(e,t){let r=e.slice().sort((s,o)=>{let c=o.priority-s.priority;return c!==0?c:s.uid.localeCompare(o.uid)}),i=r[0];if(r.length>1){let s=i.priority,o=r.filter(c=>c.priority===s);if(o.length>1){let c=o.slice(1).map(l=>l.uid).join(", ");this.logger.warn(`RelationColumnSetResolver: tier=${t} priority=${s} collision \u2014 selected ${i.uid}; tied losers: ${c}`)}}return i}};Qm.RelationColumnSetResolver=Wb});var QC=S(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.RelationColumnSetResolver=void 0;var MU=HC();Object.defineProperty(Km,"RelationColumnSetResolver",{enumerable:!0,get:a(function(){return MU.RelationColumnSetResolver},"get")})});var YC=S(Af=>{"use strict";Object.defineProperty(Af,"__esModule",{value:!0});Af.LayoutSelector=void 0;Af.selectByPriority=KC;var jU=zs(),Gb=class{static{a(this,"LayoutSelector")}constructor(e){this.source=e}resolve(e){if(!Array.isArray(e)||e.length===0)return null;let t=this.source.all;if(t.length===0)return null;for(let r of e){if(typeof r!="string")continue;let i=jU.WikiLinkHelpers.normalize(r);if(i.length===0)continue;let s=t.filter(o=>o.targetClass===i);if(s.length!==0)return KC(s)}return null}};Af.LayoutSelector=Gb;function KC(n){if(n.length===0)throw new Error("selectByPriority: expected at least one candidate");return n.length===1?n[0]:[...n].sort((t,r)=>t.priority!==r.priority?r.priority-t.priority:t.uid<r.uid?-1:t.uid>r.uid?1:0)[0]}a(KC,"selectByPriority")});var vs=S(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.ErrorCode=void 0;var XC;(function(n){n[n.INVALID_INPUT=1e3]="INVALID_INPUT",n[n.INVALID_FORMAT=1001]="INVALID_FORMAT",n[n.MISSING_REQUIRED_FIELD=1002]="MISSING_REQUIRED_FIELD",n[n.INVALID_SCHEMA=1003]="INVALID_SCHEMA",n[n.NETWORK_ERROR=2e3]="NETWORK_ERROR",n[n.REQUEST_TIMEOUT=2001]="REQUEST_TIMEOUT",n[n.CONNECTION_FAILED=2002]="CONNECTION_FAILED",n[n.FILE_READ_ERROR=2003]="FILE_READ_ERROR",n[n.FILE_WRITE_ERROR=2004]="FILE_WRITE_ERROR",n[n.INVALID_STATE=3e3]="INVALID_STATE",n[n.INVALID_TRANSITION=3001]="INVALID_TRANSITION",n[n.OPERATION_FAILED=3002]="OPERATION_FAILED",n[n.CONCURRENT_MODIFICATION=3003]="CONCURRENT_MODIFICATION",n[n.PERMISSION_DENIED=4e3]="PERMISSION_DENIED",n[n.UNAUTHORIZED=4001]="UNAUTHORIZED",n[n.FORBIDDEN=4003]="FORBIDDEN",n[n.NOT_FOUND=5e3]="NOT_FOUND",n[n.RESOURCE_EXHAUSTED=5001]="RESOURCE_EXHAUSTED",n[n.ALREADY_EXISTS=5002]="ALREADY_EXISTS",n[n.UNKNOWN_ERROR=9e3]="UNKNOWN_ERROR",n[n.INTERNAL_ERROR=9001]="INTERNAL_ERROR"})(XC||(Ym.ErrorCode=XC={}))});var bs=S(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.ApplicationError=void 0;var zb=class extends Error{static{a(this,"ApplicationError")}constructor(e,t){super(e),this.name=this.constructor.name,this.context=t,this.timestamp=new Date,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}format(){let e=`\u274C ${this.name}: ${this.message}`;if(this.guidance&&(e+=`
414
414
 
415
415
  \u{1F4A1} ${this.guidance}`),this.context&&Object.keys(this.context).length>0){e+=`
416
416
 
417
417
  \u{1F4CB} Context:`;for(let[t,r]of Object.entries(this.context))e+=`
418
- ${t}: ${JSON.stringify(r)}`}return e}toJSON(){return{name:this.name,message:this.message,code:this.code,retriable:this.retriable,timestamp:this.timestamp.toISOString(),context:this.context,stack:this.stack}}};Xm.ApplicationError=zb});var JC=S(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.ValidationError=void 0;var jU=bs(),$U=vs(),Hb=class extends jU.ApplicationError{static{a(this,"ValidationError")}constructor(e,t){super(e,t),this.code=$U.ErrorCode.INVALID_INPUT,this.retriable=!1,this.guidance=`Check the input data for correctness.
418
+ ${t}: ${JSON.stringify(r)}`}return e}toJSON(){return{name:this.name,message:this.message,code:this.code,retriable:this.retriable,timestamp:this.timestamp.toISOString(),context:this.context,stack:this.stack}}};Xm.ApplicationError=zb});var JC=S(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.ValidationError=void 0;var $U=bs(),BU=vs(),Hb=class extends $U.ApplicationError{static{a(this,"ValidationError")}constructor(e,t){super(e,t),this.code=BU.ErrorCode.INVALID_INPUT,this.retriable=!1,this.guidance=`Check the input data for correctness.
419
419
  Common issues:
420
420
  \u2022 Missing required fields
421
421
  \u2022 Invalid data format or type
422
422
  \u2022 Values outside allowed range
423
- \u2022 Schema validation failed`}};Jm.ValidationError=Hb});var ZC=S(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.NetworkError=void 0;var BU=bs(),UU=vs(),Qb=class extends BU.ApplicationError{static{a(this,"NetworkError")}constructor(e,t){super(e,t),this.code=UU.ErrorCode.NETWORK_ERROR,this.retriable=!0,this.guidance=`This is typically a transient network issue.
423
+ \u2022 Schema validation failed`}};Jm.ValidationError=Hb});var ZC=S(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.NetworkError=void 0;var UU=bs(),VU=vs(),Qb=class extends UU.ApplicationError{static{a(this,"NetworkError")}constructor(e,t){super(e,t),this.code=VU.ErrorCode.NETWORK_ERROR,this.retriable=!0,this.guidance=`This is typically a transient network issue.
424
424
  To resolve:
425
425
  \u2022 Check your internet connection
426
426
  \u2022 Retry the operation
427
427
  \u2022 Verify external services are available
428
- \u2022 Check firewall/proxy settings`}};Zm.NetworkError=Qb});var eR=S(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.StateTransitionError=void 0;var VU=bs(),qU=vs(),Kb=class extends VU.ApplicationError{static{a(this,"StateTransitionError")}constructor(e,t){super(e,t),this.code=qU.ErrorCode.INVALID_TRANSITION,this.retriable=!1,this.guidance=`The requested state transition is not allowed.
428
+ \u2022 Check firewall/proxy settings`}};Zm.NetworkError=Qb});var eR=S(eg=>{"use strict";Object.defineProperty(eg,"__esModule",{value:!0});eg.StateTransitionError=void 0;var qU=bs(),WU=vs(),Kb=class extends qU.ApplicationError{static{a(this,"StateTransitionError")}constructor(e,t){super(e,t),this.code=WU.ErrorCode.INVALID_TRANSITION,this.retriable=!1,this.guidance=`The requested state transition is not allowed.
429
429
  To fix:
430
430
  \u2022 Check the current state of the resource
431
431
  \u2022 Verify the transition is valid for this workflow
432
432
  \u2022 Review state machine documentation
433
- \u2022 Ensure no concurrent modifications occurred`}};eg.StateTransitionError=Kb});var tR=S(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.PermissionError=void 0;var WU=bs(),GU=vs(),Yb=class extends WU.ApplicationError{static{a(this,"PermissionError")}constructor(e,t){super(e,t),this.code=GU.ErrorCode.PERMISSION_DENIED,this.retriable=!1,this.guidance=`You don't have permission to perform this operation.
433
+ \u2022 Ensure no concurrent modifications occurred`}};eg.StateTransitionError=Kb});var tR=S(tg=>{"use strict";Object.defineProperty(tg,"__esModule",{value:!0});tg.PermissionError=void 0;var GU=bs(),zU=vs(),Yb=class extends GU.ApplicationError{static{a(this,"PermissionError")}constructor(e,t){super(e,t),this.code=zU.ErrorCode.PERMISSION_DENIED,this.retriable=!1,this.guidance=`You don't have permission to perform this operation.
434
434
  To resolve:
435
435
  \u2022 Check file/directory permissions
436
436
  \u2022 Verify you're authenticated
437
437
  \u2022 Ensure you have sufficient privileges
438
- \u2022 Contact administrator if access is needed`}};tg.PermissionError=Yb});var rR=S(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.NotFoundError=void 0;var zU=bs(),HU=vs(),Xb=class extends zU.ApplicationError{static{a(this,"NotFoundError")}constructor(e,t){super(e,t),this.code=HU.ErrorCode.NOT_FOUND,this.retriable=!1,this.guidance=`The requested resource could not be found.
438
+ \u2022 Contact administrator if access is needed`}};tg.PermissionError=Yb});var rR=S(rg=>{"use strict";Object.defineProperty(rg,"__esModule",{value:!0});rg.NotFoundError=void 0;var HU=bs(),QU=vs(),Xb=class extends HU.ApplicationError{static{a(this,"NotFoundError")}constructor(e,t){super(e,t),this.code=QU.ErrorCode.NOT_FOUND,this.retriable=!1,this.guidance=`The requested resource could not be found.
439
439
  To resolve:
440
440
  \u2022 Verify the resource path/ID is correct
441
441
  \u2022 Check the resource exists
442
442
  \u2022 Ensure proper file extension (.md for notes)
443
- \u2022 Verify resource hasn't been deleted`}};rg.NotFoundError=Xb});var nR=S(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ResourceExhaustedError=void 0;var QU=bs(),KU=vs(),Jb=class extends QU.ApplicationError{static{a(this,"ResourceExhaustedError")}constructor(e,t){super(e,t),this.code=KU.ErrorCode.RESOURCE_EXHAUSTED,this.retriable=!0,this.guidance=`A resource limit has been exceeded.
443
+ \u2022 Verify resource hasn't been deleted`}};rg.NotFoundError=Xb});var nR=S(ng=>{"use strict";Object.defineProperty(ng,"__esModule",{value:!0});ng.ResourceExhaustedError=void 0;var KU=bs(),YU=vs(),Jb=class extends KU.ApplicationError{static{a(this,"ResourceExhaustedError")}constructor(e,t){super(e,t),this.code=YU.ErrorCode.RESOURCE_EXHAUSTED,this.retriable=!0,this.guidance=`A resource limit has been exceeded.
444
444
  To resolve:
445
445
  \u2022 Free up system resources (memory, disk space)
446
446
  \u2022 Reduce the size of your request
447
447
  \u2022 Wait and retry (for rate limits)
448
448
  \u2022 Close unused files/connections
449
- \u2022 Paginate large queries`}};ng.ResourceExhaustedError=Jb});var iR=S(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.ServiceError=void 0;var YU=bs(),XU=vs(),Zb=class extends YU.ApplicationError{static{a(this,"ServiceError")}constructor(e,t){super(e,t),this.code=XU.ErrorCode.INTERNAL_ERROR,this.retriable=!1,this.guidance=`This is an internal service error.
449
+ \u2022 Paginate large queries`}};ng.ResourceExhaustedError=Jb});var iR=S(ig=>{"use strict";Object.defineProperty(ig,"__esModule",{value:!0});ig.ServiceError=void 0;var XU=bs(),JU=vs(),Zb=class extends XU.ApplicationError{static{a(this,"ServiceError")}constructor(e,t){super(e,t),this.code=JU.ErrorCode.INTERNAL_ERROR,this.retriable=!1,this.guidance=`This is an internal service error.
450
450
  To resolve:
451
451
  \u2022 Check service initialization parameters
452
452
  \u2022 Verify all required dependencies are available
453
453
  \u2022 Review service logs for detailed error information
454
- \u2022 Contact support if the issue persists`}};ig.ServiceError=Zb});var sR=S(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.ServiceError=sr.ResourceExhaustedError=sr.NotFoundError=sr.PermissionError=sr.StateTransitionError=sr.NetworkError=sr.ValidationError=sr.ApplicationError=sr.ErrorCode=void 0;var JU=vs();Object.defineProperty(sr,"ErrorCode",{enumerable:!0,get:a(function(){return JU.ErrorCode},"get")});var ZU=bs();Object.defineProperty(sr,"ApplicationError",{enumerable:!0,get:a(function(){return ZU.ApplicationError},"get")});var eV=JC();Object.defineProperty(sr,"ValidationError",{enumerable:!0,get:a(function(){return eV.ValidationError},"get")});var tV=ZC();Object.defineProperty(sr,"NetworkError",{enumerable:!0,get:a(function(){return tV.NetworkError},"get")});var rV=eR();Object.defineProperty(sr,"StateTransitionError",{enumerable:!0,get:a(function(){return rV.StateTransitionError},"get")});var nV=tR();Object.defineProperty(sr,"PermissionError",{enumerable:!0,get:a(function(){return nV.PermissionError},"get")});var iV=rR();Object.defineProperty(sr,"NotFoundError",{enumerable:!0,get:a(function(){return iV.NotFoundError},"get")});var sV=nR();Object.defineProperty(sr,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return sV.ResourceExhaustedError},"get")});var oV=iR();Object.defineProperty(sr,"ServiceError",{enumerable:!0,get:a(function(){return oV.ServiceError},"get")})});var tw=S(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.ShapeRegistry=void 0;var ew=class{static{a(this,"ShapeRegistry")}constructor(){this.shapes=new Map}get(e){return this.shapes.get(e)}register(e){this.shapes.set(e.propertyIRI,e)}getAll(){return Array.from(this.shapes.values())}get size(){return this.shapes.size}};sg.ShapeRegistry=ew});var ow=S(ws=>{"use strict";var aV=ws&&ws.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),cV=ws&&ws.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),rw=ws&&ws.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&aV(t,e,r[i]);return cV(t,e),t}})();Object.defineProperty(ws,"__esModule",{value:!0});ws.ShapeLoader=void 0;var nw=tw(),Pl=Ae(),iw=Ne(),Fn=lr(),og="http://www.w3.org/ns/shacl#",lV="http://www.w3.org/2001/XMLSchema#",Ple=[["exo__",Fn.Namespace.EXO],["ems__",Fn.Namespace.EMS],["exocmd__",Fn.Namespace.EXOCMD],["ims__",Fn.Namespace.IMS],["ztlk__",Fn.Namespace.ZTLK],["ptms__",Fn.Namespace.PTMS],["lit__",Fn.Namespace.LIT],["inbox__",Fn.Namespace.INBOX],["pmbok__",Fn.Namespace.PMBOK]],sw=class n{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:r}=await Promise.resolve().then(()=>rw(require("fs/promises"))),i=await Promise.resolve().then(()=>rw(require("path"))),s=new nw.ShapeRegistry;return await n.scanDir(e,s,{readdir:t,readFile:r,path:i}),s}static async loadFromRDFGraph(e){let t=new nw.ShapeRegistry,r=Fn.Namespace.EXO,i=Fn.Namespace.RDFS,s=Fn.Namespace.RDF,[o,c]=await Promise.all([e.match(void 0,s.term("type"),r.term("ObjectProperty")),e.match(void 0,s.term("type"),r.term("Property"))]),l=new Set;for(let u of[...o,...c])u.subject instanceof Pl.IRI&&l.add(u.subject.value);for(let u of l){let f=new Pl.IRI(u),[d,h,p,y,v,b]=await Promise.all([e.match(f,i.term("domain"),void 0),e.match(f,i.term("range"),void 0),e.match(f,r.term("Property_cardinality"),void 0),e.match(f,r.term("Property_severity"),void 0),e.match(f,r.term("Asset_label"),void 0),e.match(f,r.term("Property_minCount"),void 0)]);if(d.length===0)continue;let w=v[0]?.object;if(!(w instanceof iw.Literal))continue;let T=n.labelToIRI(w.value);if(!T)continue;let I=d.map(k=>k.object instanceof Pl.IRI?k.object.value:null).filter(k=>k!==null),$=h.map(k=>k.object instanceof Pl.IRI?k.object.value:null).filter(k=>k!==null),q=n.cardinalityFromIRI(p[0]?.object instanceof Pl.IRI?p[0].object.value:void 0),ce=n.severityFromValue(y[0]?.object instanceof iw.Literal||y[0]?.object instanceof Pl.IRI?y[0].object.value:void 0),B=b[0]?.object,V=B instanceof iw.Literal?parseInt(B.value,10):NaN,F=isNaN(V)?void 0:V;t.register({propertyIRI:T,domain:I,range:$.length>0?$:void 0,cardinality:q,severity:ce,minCount:F})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>rw(require("fs/promises"))),r=await t(e,"utf-8"),i=JSON.parse(r),s=new nw.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static async scanDir(e,t,r){let i;try{i=await r.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=r.path.join(e,s.name);if(s.isDirectory())await n.scanDir(o,t,r);else if(s.isFile()&&s.name.endsWith(".md"))try{await n.processFile(o,t,r.readFile,r.path)}catch{}}}static async processFile(e,t,r,i){let s;try{s=await r(e,"utf-8")}catch{return}let o=n.parseFrontmatter(s);if(!o||!n.asArray(o.exo__Instance_class).some(B=>{let V=n.extractWikilinkRef(B);return V==="exo__Property"||V==="exo__ObjectProperty"||V?.includes("|exo__Property")||V?.includes("|exo__ObjectProperty")}))return;let u=null,f=o.exo__Asset_label;if(typeof f=="string"&&f.trim().length>0)u=f.trim();else if(i){let B=i.basename(e,".md");Fn.Namespace.fromPropertyKey(B)&&(u=B)}if(!u)return;let d=n.labelToIRI(u);if(!d)return;let h=o.exo__Property_domain,p=o.exo__Property_range,y=o.exo__Property_cardinality,v=o.exo__Property_severity,b=o.exo__Property_minCount,w=n.asArray(h).map(B=>n.wikilinkToIRI(B)).filter(B=>B!==null);if(w.length===0)return;let T=n.asArray(p).map(B=>n.wikilinkToIRI(B)).filter(B=>B!==null),I=n.cardinalityFromLabel(typeof y=="string"?y:void 0),$=n.severityFromValue(typeof v=="string"?v:void 0),q=typeof b=="string"?parseInt(b,10):void 0,ce=q!==void 0&&!isNaN(q)?q:void 0;t.register({propertyIRI:d,domain:w,range:T.length>0?T:void 0,cardinality:I,severity:$,minCount:ce})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let r=t[1],i={},s=r.split(/\r?\n/),o=null,c=null;for(let l of s){let u=/^ {2}- (.*)$/.exec(l);if(u){o&&c&&c.push(u[1].trim());continue}o&&c&&(i[o]=c,o=null,c=null);let f=/^([^:]+):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),h=f[2].trim();h===""?(o=d,c=[]):i[d]=h}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Fn.Namespace.fromPropertyKey(e);return t?t.namespace.term(t.localName).value:null}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),r=/\[\[([^\]]+)\]\]/.exec(t);return r?r[1]:t}static wikilinkToIRI(e){let t=n.extractWikilinkRef(e);if(!t)return null;let r=t.split("|"),i=r.length>1?[r[1],r[0]]:[r[0]];for(let s of i){let o=n.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?og+t.substring(3):t.startsWith("xsd:")?lV+t.substring(4):null}static asArray(e){return Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[]}static cardinalityFromIRI(e){if(e){if(e.endsWith("PropertyCardinalitySingle"))return"Single";if(e.endsWith("PropertyCardinalityMultiple"))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=n.extractWikilinkRef(e)??e,r=t.split("|").pop()??t;if(r.includes("Single"))return"Single";if(r.includes("Multiple"))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===og+"Violation"?"sh:Violation":e.includes("Warning")||e===og+"Warning"?"sh:Warning":e.includes("Info")||e===og+"Info"?"sh:Info":"sh:Violation"}};ws.ShapeLoader=sw});var cw=S(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.ShapeRegistry=void 0;xf.validate=mV;var aw=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(r=>[r.propertyIRI,r])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};xf.ShapeRegistry=aw;var uV="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",fV=["http://www.w3.org/2001/XMLSchema#","http://www.w3.org/1999/02/22-rdf-syntax-ns#","http://www.w3.org/2000/01/rdf-schema#","http://www.w3.org/2002/07/owl#","http://www.w3.org/2004/02/skos/core#","http://purl.org/dc/elements/1.1/","http://purl.org/dc/terms/","http://xmlns.com/foaf/0.1/","https://schema.org/","https://exocortex.my/ontology/xsd#","https://exocortex.my/ontology/rdf#","https://exocortex.my/ontology/rdfs#","https://exocortex.my/ontology/owl#","https://exocortex.my/ontology/skos#"];function dV(n){return fV.some(e=>n.startsWith(e))}a(dV,"isExternalOntologyIRI");var hV=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function pV(n){return hV.some(e=>n.startsWith(e))}a(pV,"isXSDDatatypeIRI");function mV(n,e,t,r){let i=new Map,s=new Map;for(let l of n){let{subject:u,predicate:f,object:d}=l;if(u.type!=="iri"||f.type!=="iri"||d.type!=="iri"&&d.type!=="literal")continue;let h=u.value,p=f.value,y=d;if(p===e.typePredicateIRI||p===uV){if(y.type==="iri"){let b=i.get(h)??[];b.push(y.value),i.set(h,b)}}else{let b=s.get(h);b||(b=new Map,s.set(h,b));let w=b.get(p)??[];w.push(y),b.set(p,w)}}let o=[],c=new Set([...i.keys(),...s.keys()]);for(let l of c){let u=i.get(l)??[],f=s.get(l)??new Map;for(let d of e.getAllShapes()){if(!(d.domain.length===0||d.domain.some(y=>u.some(v=>v===y||t.isSubClassOf(v,y)))))continue;let p=f.get(d.propertyIRI)??[];if(d.minCount!==void 0&&d.minCount>0&&p.length<d.minCount){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:minCount violation: expected at least ${d.minCount} value(s) for <${d.propertyIRI}>`});continue}if(p.length!==0){if(d.cardinality==="Single"&&p.length>1){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:maxCount violation: expected at most 1 value for <${d.propertyIRI}>, got ${p.length}`});continue}if(d.range&&d.range.length>0){for(let y of p)if(y.type==="iri"){if(dV(y.value))continue;let v=i.get(y.value)??[];d.range.some(w=>v.some(T=>T===w||t.isSubClassOf(T,w)))||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:class violation: <${y.value}> does not conform to expected class ${d.range.join(" | ")}`,actualValue:y.value,expectedRange:d.range.join(" | ")})}else if(y.type==="literal"){let v=d.range.filter(T=>pV(T));if(v.length===0)continue;let b=y.datatype??"http://www.w3.org/2001/XMLSchema#string";v.some(T=>T===b)||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:datatype violation: literal "${y.value}" has datatype <${b}>, expected ${v.join(" | ")}`,actualValue:y.value,expectedRange:v.join(" | ")})}}}}}if(r?.closedWorldMode)for(let l of c){let u=s.get(l)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:l,propertyPath:f,severity:"sh:Warning",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((l,u)=>{let f=l.focusNode.localeCompare(u.focusNode);return f!==0?f:l.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(l=>l.severity==="sh:Violation"),violations:o}}a(mV,"validate")});var oR=S(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.ApplicationErrorHandler=void 0;var lw=bs(),gV=vs(),yV=Uo(),uw=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof lw.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends lw.ApplicationError{constructor(){super(...arguments),this.code=i.code,this.retriable=i.retriable,this.guidance=i.guidance}}(e.message,s)}return e}return new class extends lw.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=gV.ErrorCode.UNKNOWN_ERROR,this.retriable=!1,this.guidance="An unexpected error occurred"}}(e.message,e)}formatError(e){let t=[];return t.push(`\u274C ${e.name}: ${e.message}`),e.guidance&&t.push(`\u{1F4A1} ${e.guidance}`),e.context&&Object.keys(e.context).length>0&&t.push(`Context: ${JSON.stringify(e.context,null,2)}`),t.join(`
455
- `)}calculateDelay(e){let t=this.retryConfig.initialDelayMs*Math.pow(this.retryConfig.backoffMultiplier,e);return Math.min(t,this.retryConfig.maxDelayMs)}sleep(e){return new Promise(t=>setTimeout(t,e))}callTelemetryHooks(e,...t){for(let r of this.telemetryHooks)try{let i=r[e];i&&i.apply(r,t)}catch(i){yV.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};ag.ApplicationErrorHandler=uw});var aR=S(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.ApplicationErrorHandler=void 0;var _V=oR();Object.defineProperty(cg,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return _V.ApplicationErrorHandler},"get")})});var dw=S(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.ClassHierarchy=void 0;var SV="http://www.w3.org/2000/01/rdf-schema#subClassOf",fw=class{static{a(this,"ClassHierarchy")}constructor(e){this.adjacency=new Map;for(let t of e){if(t.predicate.type!=="iri"||t.predicate.value!==SV||t.subject.type!=="iri"||t.object.type!=="iri")continue;let r=t.subject.value,i=t.object.value,s=this.adjacency.get(r);s||(s=new Set,this.adjacency.set(r,s)),s.add(i)}}isSubClassOf(e,t){if(e===t)return!0;let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o){if(c===t)return!0;r.has(c)||i.push(c)}}return!1}getAncestors(e){let t=new Set,r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o)t.add(c),r.has(c)||i.push(c)}return t}};lg.ClassHierarchy=fw});var lR=S(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.ValidatorDaemon=Es.IDLE_TIMEOUT_MS=Es.DEFAULT_SOCKET_PATH=void 0;var cR=cw(),vV=ow(),bV=dw();Es.DEFAULT_SOCKET_PATH=`${process.env.HOME??process.env.USERPROFILE??"/tmp"}/.cache/exocortex/validator.sock`;Es.IDLE_TIMEOUT_MS=300*1e3;var hw=class{static{a(this,"ValidatorDaemon")}constructor(e=Es.DEFAULT_SOCKET_PATH,t=Es.IDLE_TIMEOUT_MS){this.registryCache=new Map,this.server=null,this.idleTimer=null,this.socketPath=e,this.idleTimeoutMs=t}async start(){let e=require("net"),t=require("fs/promises"),r=require("path");await t.mkdir(r.dirname(this.socketPath),{recursive:!0});try{await t.unlink(this.socketPath)}catch{}this.server=e.createServer(o=>{this.handleConnection(o)});let i=this.server;await new Promise((o,c)=>{i.on("error",c),i.listen(this.socketPath,o)}),this.resetIdleTimer();let s=a(()=>{this.stop()},"handleSignal");process.once("SIGTERM",s),process.once("SIGINT",s)}async stop(){if(this.idleTimer!==null&&(clearTimeout(this.idleTimer),this.idleTimer=null),!this.server)return;let e=this.server;this.server=null,await new Promise(t=>{e.close(()=>t())})}resetIdleTimer(){this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{process.exit(0)},this.idleTimeoutMs)}handleConnection(e){let t="";e.setEncoding("utf-8"),e.on("data",r=>{t+=r;let i=t.split(`
456
- `);t=i.pop()??"";for(let s of i){let o=s.trim();o&&this.handleRequest(o,e)}}),e.on("error",()=>{e.destroy()})}async handleRequest(e,t){this.resetIdleTimer();let r;try{let i=JSON.parse(e),s=await this.getRegistry(i.registryPath),o=new bV.ClassHierarchy(i.subclassTriples??[]);r={report:(0,cR.validate)(i.triples,s,o,{closedWorldMode:i.closedWorldMode})}}catch(i){r={error:i instanceof Error?i.message:String(i)}}t.destroyed||t.write(JSON.stringify(r)+`
457
- `)}async getRegistry(e){let t=this.registryCache.get(e);if(t)return t;let r=await vV.ShapeLoader.loadFromShapeJSON(e),i=new cR.ShapeRegistry(r.getAll());return this.registryCache.set(e,i),i}};Es.ValidatorDaemon=hw});var Pt=S(m=>{"use strict";var wV=m&&m.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ii=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&wV(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.LabelToAliasService=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.ServiceRegistry=m.GroundingExecutor=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=m.isCommandBindingFrontmatter=m.isGroundingFrontmatter=m.isPreconditionFrontmatter=m.isCommandFrontmatter=m.isStyleSource=m.isLabelClass=m.isCommandVariant=m.STYLE_SOURCE_VALUES=m.LABEL_CLASS_VALUES=m.COMMAND_VARIANT_VALUES=m.CommandBindingStyleProperty=m.CommandBindingProperty=m.GroundingProperty=m.PreconditionProperty=m.CommandProperty=m.GroundingType=m.getEffortStatusLabel=m.isTrashedStatus=m.isDoneStatus=m.normalizeEffortStatus=m.EFFORT_STATUS_OPTIONS=m.STATUS_NAME_TO_WIKILINK=m.STATUS_NAME_TO_ENUM=m.EFFORT_STATUS_CONFIG=void 0;m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=m.vaultPathToIRI=m.NullLogger=m.RDFSerializer=m.FilenameValidator=m.EffortSortingHelpers=m.MetadataExtractor=m.MetadataHelpers=m.WikiLinkHelpers=m.DateFormatter=m.FrontmatterService=m.CriticalityZoneUUIDs=m.CriticalityZoneService=m.DailyReviewService=m.DEFAULT_AUTOCOMPLETE_CONFIG=m.AutocompleteService=m.TrendDetectionService=m.AnalyticsService=m.getTemplateByName=m.validateParameters=m.fillTemplate=m.findMatchingTemplates=m.findClassByTerm=m.KNOWN_CLASSES=m.KNOWN_PROTOTYPES=m.EFFORT_STATUSES=m.ASSET_CLASSES=m.PREDICATES=m.SPARQL_PREFIXES=m.SPARQL_TEMPLATES=m.DEFAULT_NL_TO_SPARQL_CONFIG=m.NLToSPARQLService=m.TypeRegistry=m.GraphQueryService=m.FixMissingLabelService=m.ArchiveAssetService=m.GenericAssetCreationService=m.URIConstructionService=m.SessionEventService=m.AssetConversionService=m.EnumValueResolver=m.ClassHierarchyResolver=m.PropertySchemaResolver=m.PlanningService=m.AlgorithmExtractor=m.DynamicFrontmatterGenerator=m.FleetingNoteCreationService=m.SupervisionCreationService=m.StatusTimestampService=void 0;m.createSPARQLResultCache=m.SPARQLResultCache=m.QueryPlanCache=m.createDoubleLiteral=m.createDecimalLiteral=m.getNumericValue=m.createPercentileAggregate=m.modeAggregate=m.stddevAggregate=m.varianceAggregate=m.medianAggregate=m.EXO_AGGREGATE_NS=m.BUILT_IN_AGGREGATES=m.CustomAggregateError=m.CustomAggregateRegistry=m.AggregateFunctions=m.BuiltInFunctions=m.SolutionMapping=m.UpdateExecutorError=m.UpdateExecutor=m.QueryExecutor=m.ExoQLQueryExecutor=m.DescribeExecutor=m.ConstructExecutor=m.UnionExecutor=m.OptionalExecutor=m.FilterExecutor=m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=m.DomainTriple=m.DomainBlankNode=m.DomainLiteral=m.DomainIRI=void 0;m.createLayoutBlockFromFrontmatter=m.PROPERTIES_BLOCK_CLASS_UID=m.PROPERTIES_BLOCK_CLASS_IRI=m.BACKLINKS_TABLE_BLOCK_CLASS_UID=m.BACKLINKS_TABLE_BLOCK_CLASS_IRI=m.isLayoutFrontmatter=m.isLayout=m.createLayoutFromFrontmatter=m.LAYOUT_CLASS_UID=m.LAYOUT_CLASS_IRI=m.RelationColumnSetResolver=m.normalizeRelationColumnSetRef=m.isRelationColumnSetFrontmatter=m.isRelationColumnSet=m.createRelationColumnSetFromFrontmatter=m.RELATION_COLUMN_SET_CLASS_UID=m.RELATION_COLUMN_SET_CLASS_IRI=m.ExoQLError=m.ExoQL=m.createStreamingSource=m.StreamingLoader=m.resetGlobalPool=m.getGlobalPool=m.MemoryPool=m.CompactGraphStore=m.StringTable=m.DEFAULT_COLORS=m.NODE_FLAGS=m.container=m.resetContainer=m.getContainer=m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=m.CaseWhenTransformer=m.ResultSerializer=m.createIncrementalIndexer=m.IncrementalIndexer=void 0;m.TripleClassHierarchy=m.IDLE_TIMEOUT_MS=m.DEFAULT_SOCKET_PATH=m.ValidatorDaemon=m.ShaclShapeRegistry=m.shaclValidate=m.Namespace=m.ShapeRegistry=m.ShapeLoader=m.selectByPriority=m.LayoutSelector=m.isPropertiesBlock=m.isLayoutBlockFrontmatter=m.isBacklinksTableBlock=void 0;ii(Nu(),m);ii(Tc(),m);var Ko=w0();Object.defineProperty(m,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:a(function(){return Ko.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(m,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:a(function(){return Ko.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(m,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:a(function(){return Ko.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Ko.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(m,"normalizeEffortStatus",{enumerable:!0,get:a(function(){return Ko.normalizeEffortStatus},"get")});Object.defineProperty(m,"isDoneStatus",{enumerable:!0,get:a(function(){return Ko.isDoneStatus},"get")});Object.defineProperty(m,"isTrashedStatus",{enumerable:!0,get:a(function(){return Ko.isTrashedStatus},"get")});Object.defineProperty(m,"getEffortStatusLabel",{enumerable:!0,get:a(function(){return Ko.getEffortStatusLabel},"get")});var EV=Ac();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:a(function(){return EV.GroundingType},"get")});var Cf=E0();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:a(function(){return Cf.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:a(function(){return Cf.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:a(function(){return Cf.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Cf.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return Cf.CommandBindingStyleProperty},"get")});var Ol=T0();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return Ol.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return Ol.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return Ol.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:a(function(){return Ol.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:a(function(){return Ol.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:a(function(){return Ol.isStyleSource},"get")});var ug=E2();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return ug.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return ug.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return ug.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return ug.isCommandBindingFrontmatter},"get")});ii(T2(),m);ii(A2(),m);ii(A0(),m);ii(x0(),m);ii(C2(),m);ii(P2(),m);ii(a_(),m);ii(_A(),m);var uR=Ph();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:a(function(){return uR.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:a(function(){return uR.rangeToFieldType},"get")});var pw=f_();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:a(function(){return pw.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:a(function(){return pw.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:a(function(){return pw.extractPropertyLabel},"get")});var TV=Hx();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:a(function(){return TV.CommandResolver},"get")});var AV=Kx();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return AV.PreconditionEvaluator},"get")});var fR=Xx();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:a(function(){return fR.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:a(function(){return fR.ServiceRegistry},"get")});var xV=DS();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:a(function(){return xV.TaskStatusService},"get")});var CV=MS();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:a(function(){return CV.AreaCreationService},"get")});var RV=$S();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return RV.AreaHierarchyBuilder},"get")});var IV=US();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:a(function(){return IV.ClassCreationService},"get")});var PV=qS();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:a(function(){return PV.ConceptCreationService},"get")});var OV=um();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return OV.EffortStatusWorkflow},"get")});var FV=ff();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:a(function(){return FV.WorkflowEngine},"get")});var DV=bS();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:a(function(){return DV.WorkflowResolver},"get")});var NV=f3();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return NV.InstantiationRuleResolver},"get")});var LV=d3();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:a(function(){return LV.VisibilityGenerator},"get")});var kV=h3();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return kV.WorkflowCommandAdapter},"get")});var MV=YS();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:a(function(){return MV.EffortVotingService},"get")});var jV=JS();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:a(function(){return jV.FolderRepairService},"get")});var $V=ev();Object.defineProperty(m,"LabelToAliasService",{enumerable:!0,get:a(function(){return $V.LabelToAliasService},"get")});var BV=Uo();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:a(function(){return BV.LoggingService},"get")});var UV=nv();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:a(function(){return UV.PropertyCleanupService},"get")});var VV=sv();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:a(function(){return VV.RenameToUidService},"get")});var qV=dm();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:a(function(){return qV.StatusTimestampService},"get")});var WV=cv();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:a(function(){return WV.SupervisionCreationService},"get")});var GV=fv();Object.defineProperty(m,"FleetingNoteCreationService",{enumerable:!0,get:a(function(){return GV.FleetingNoteCreationService},"get")});var zV=hv();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return zV.DynamicFrontmatterGenerator},"get")});var HV=mv();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return HV.AlgorithmExtractor},"get")});var QV=yv();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:a(function(){return QV.PlanningService},"get")});var KV=x3();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return KV.PropertySchemaResolver},"get")});var YV=C3();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return YV.ClassHierarchyResolver},"get")});var XV=R3();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:a(function(){return XV.EnumValueResolver},"get")});var JV=wv();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:a(function(){return JV.AssetConversionService},"get")});var ZV=Av();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:a(function(){return ZV.SessionEventService},"get")});var eq=Rv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:a(function(){return eq.URIConstructionService},"get")});var tq=Pv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return tq.GenericAssetCreationService},"get")});var rq=j3();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:a(function(){return rq.ArchiveAssetService},"get")});var nq=B3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:a(function(){return nq.FixMissingLabelService},"get")});var iq=U3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:a(function(){return iq.GraphQueryService},"get")});var sq=q3();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:a(function(){return sq.TypeRegistry},"get")});var dR=W3();Object.defineProperty(m,"NLToSPARQLService",{enumerable:!0,get:a(function(){return dR.NLToSPARQLService},"get")});Object.defineProperty(m,"DEFAULT_NL_TO_SPARQL_CONFIG",{enumerable:!0,get:a(function(){return dR.DEFAULT_NL_TO_SPARQL_CONFIG},"get")});var si=Lv();Object.defineProperty(m,"SPARQL_TEMPLATES",{enumerable:!0,get:a(function(){return si.SPARQL_TEMPLATES},"get")});Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return si.SPARQL_PREFIXES},"get")});Object.defineProperty(m,"PREDICATES",{enumerable:!0,get:a(function(){return si.PREDICATES},"get")});Object.defineProperty(m,"ASSET_CLASSES",{enumerable:!0,get:a(function(){return si.ASSET_CLASSES},"get")});Object.defineProperty(m,"EFFORT_STATUSES",{enumerable:!0,get:a(function(){return si.EFFORT_STATUSES},"get")});Object.defineProperty(m,"KNOWN_PROTOTYPES",{enumerable:!0,get:a(function(){return si.KNOWN_PROTOTYPES},"get")});Object.defineProperty(m,"KNOWN_CLASSES",{enumerable:!0,get:a(function(){return si.KNOWN_CLASSES},"get")});Object.defineProperty(m,"findClassByTerm",{enumerable:!0,get:a(function(){return si.findClassByTerm},"get")});Object.defineProperty(m,"findMatchingTemplates",{enumerable:!0,get:a(function(){return si.findMatchingTemplates},"get")});Object.defineProperty(m,"fillTemplate",{enumerable:!0,get:a(function(){return si.fillTemplate},"get")});Object.defineProperty(m,"validateParameters",{enumerable:!0,get:a(function(){return si.validateParameters},"get")});Object.defineProperty(m,"getTemplateByName",{enumerable:!0,get:a(function(){return si.getTemplateByName},"get")});var oq=z3();Object.defineProperty(m,"AnalyticsService",{enumerable:!0,get:a(function(){return oq.AnalyticsService},"get")});var aq=H3();Object.defineProperty(m,"TrendDetectionService",{enumerable:!0,get:a(function(){return aq.TrendDetectionService},"get")});var hR=K3();Object.defineProperty(m,"AutocompleteService",{enumerable:!0,get:a(function(){return hR.AutocompleteService},"get")});Object.defineProperty(m,"DEFAULT_AUTOCOMPLETE_CONFIG",{enumerable:!0,get:a(function(){return hR.DEFAULT_AUTOCOMPLETE_CONFIG},"get")});var cq=X3();Object.defineProperty(m,"DailyReviewService",{enumerable:!0,get:a(function(){return cq.DailyReviewService},"get")});var pR=Vv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:a(function(){return pR.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return pR.CriticalityZoneUUIDs},"get")});var lq=ei();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:a(function(){return lq.FrontmatterService},"get")});var uq=Qr();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:a(function(){return uq.DateFormatter},"get")});var fq=zs();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return fq.WikiLinkHelpers},"get")});var dq=ms();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:a(function(){return dq.MetadataHelpers},"get")});var hq=LS();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:a(function(){return hq.MetadataExtractor},"get")});var pq=Z3();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return pq.EffortSortingHelpers},"get")});var mq=eC();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:a(function(){return mq.FilenameValidator},"get")});var gq=aC();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:a(function(){return gq.RDFSerializer},"get")});var yq=Oc();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:a(function(){return yq.NullLogger},"get")});var mR=eb();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:a(function(){return mR.vaultPathToIRI},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return mR.OBSIDIAN_VAULT_SCHEME},"get")});var _q=IS();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return _q.InMemoryTripleStore},"get")});var Sq=Ae();Object.defineProperty(m,"DomainIRI",{enumerable:!0,get:a(function(){return Sq.IRI},"get")});var vq=Ne();Object.defineProperty(m,"DomainLiteral",{enumerable:!0,get:a(function(){return vq.Literal},"get")});var bq=qt();Object.defineProperty(m,"DomainBlankNode",{enumerable:!0,get:a(function(){return bq.BlankNode},"get")});var wq=Yn();Object.defineProperty(m,"DomainTriple",{enumerable:!0,get:a(function(){return wq.Triple},"get")});var Eq=rb();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return Eq.RDFVocabularyMapper},"get")});var Tq=lC();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return Tq.RDFSInferenceEngine},"get")});var Aq=ob();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return Aq.NonInheritablePropertyRegistry},"get")});var xq=lb();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return xq.PropertyCardinalityRegistry},"get")});var gR=db();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return gR.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return gR.INFERRED_GRAPH},"get")});var yR=pb();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:a(function(){return yR.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return yR.SOURCE_VARIABLE},"get")});var Cq=gb();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return Cq.NoteToRDFConverter},"get")});var mw=Uc();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:a(function(){return mw.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:a(function(){return mw.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:a(function(){return mw.SPARQLParseError},"get")});var _R=l1();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return _R.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return _R.DescribeOptionsTransformerError},"get")});var SR=qc();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return SR.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:a(function(){return SR.AlgebraTranslator},"get")});var Rq=SC();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return Rq.AlgebraOptimizer},"get")});var Iq=vC();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:a(function(){return Iq.AlgebraSerializer},"get")});var Pq=C1();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:a(function(){return Pq.BGPExecutor},"get")});var Oq=jp();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:a(function(){return Oq.FilterExecutor},"get")});var Fq=z1();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:a(function(){return Fq.OptionalExecutor},"get")});var Dq=Q1();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:a(function(){return Dq.UnionExecutor},"get")});var Nq=iS();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:a(function(){return Nq.ConstructExecutor},"get")});var Lq=wC();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:a(function(){return Lq.DescribeExecutor},"get")});var vR=ll();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return vR.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:a(function(){return vR.QueryExecutor},"get")});var bR=TC();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:a(function(){return bR.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:a(function(){return bR.UpdateExecutorError},"get")});var kq=us();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:a(function(){return kq.SolutionMapping},"get")});var Mq=Mp();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:a(function(){return Mq.BuiltInFunctions},"get")});var jq=xC();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:a(function(){return jq.AggregateFunctions},"get")});var wR=X1();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return wR.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:a(function(){return wR.CustomAggregateError},"get")});var Ts=J1();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return Ts.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return Ts.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:a(function(){return Ts.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:a(function(){return Ts.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:a(function(){return Ts.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:a(function(){return Ts.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:a(function(){return Ts.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:a(function(){return Ts.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:a(function(){return Ts.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:a(function(){return Ts.createDoubleLiteral},"get")});var $q=CC();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:a(function(){return $q.QueryPlanCache},"get")});var ER=RC();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:a(function(){return ER.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return ER.createSPARQLResultCache},"get")});var TR=IC();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:a(function(){return TR.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return TR.createIncrementalIndexer},"get")});var Bq=PC();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:a(function(){return Bq.ResultSerializer},"get")});var AR=o1();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return AR.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return AR.CaseWhenTransformerError},"get")});var Uq=h1();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return Uq.VaultPrefixTransformer},"get")});var Vq=_b();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return Vq.FilterContainsOptimizer},"get")});var xR=OC();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:a(function(){return xR.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return xR.FileAlreadyExistsError},"get")});var gw=AS();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return gw.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:a(function(){return gw.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:a(function(){return gw.TransactionError},"get")});var fg=Ob();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:a(function(){return fg.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return fg.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return fg.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return fg.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var qq=Et();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:a(function(){return qq.DI_TOKENS},"get")});var Rf=FC();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:a(function(){return Rf.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:a(function(){return Rf.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:a(function(){return Rf.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:a(function(){return Rf.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:a(function(){return Rf.container},"get")});var ho=jC();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:a(function(){return ho.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return ho.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:a(function(){return ho.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:a(function(){return ho.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:a(function(){return ho.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:a(function(){return ho.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:a(function(){return ho.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:a(function(){return ho.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:a(function(){return ho.createStreamingSource},"get")});var CR=$C();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:a(function(){return CR.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:a(function(){return CR.ExoQLError},"get")});var Fl=Hm();Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:a(function(){return Fl.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:a(function(){return Fl.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(m,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:a(function(){return Fl.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(m,"isRelationColumnSet",{enumerable:!0,get:a(function(){return Fl.isRelationColumnSet},"get")});Object.defineProperty(m,"isRelationColumnSetFrontmatter",{enumerable:!0,get:a(function(){return Fl.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(m,"normalizeRelationColumnSetRef",{enumerable:!0,get:a(function(){return Fl.normalizeRef},"get")});var Wq=QC();Object.defineProperty(m,"RelationColumnSetResolver",{enumerable:!0,get:a(function(){return Wq.RelationColumnSetResolver},"get")});var If=Hm();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return If.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return If.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return If.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:a(function(){return If.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return If.isLayoutFrontmatter},"get")});var Yo=Hm();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Yo.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Yo.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Yo.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Yo.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Yo.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Yo.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Yo.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Yo.isPropertiesBlock},"get")});var RR=YC();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:a(function(){return RR.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:a(function(){return RR.selectByPriority},"get")});ii(sR(),m);var Gq=ow();Object.defineProperty(m,"ShapeLoader",{enumerable:!0,get:a(function(){return Gq.ShapeLoader},"get")});var zq=tw();Object.defineProperty(m,"ShapeRegistry",{enumerable:!0,get:a(function(){return zq.ShapeRegistry},"get")});var Hq=lr();Object.defineProperty(m,"Namespace",{enumerable:!0,get:a(function(){return Hq.Namespace},"get")});var IR=cw();Object.defineProperty(m,"shaclValidate",{enumerable:!0,get:a(function(){return IR.validate},"get")});Object.defineProperty(m,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return IR.ShapeRegistry},"get")});ii(aR(),m);var yw=lR();Object.defineProperty(m,"ValidatorDaemon",{enumerable:!0,get:a(function(){return yw.ValidatorDaemon},"get")});Object.defineProperty(m,"DEFAULT_SOCKET_PATH",{enumerable:!0,get:a(function(){return yw.DEFAULT_SOCKET_PATH},"get")});Object.defineProperty(m,"IDLE_TIMEOUT_MS",{enumerable:!0,get:a(function(){return yw.IDLE_TIMEOUT_MS},"get")});var Qq=dw();Object.defineProperty(m,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return Qq.ClassHierarchy},"get")})});var Er=S(_w=>{"use strict";_w.fromCallback=function(n){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")n.apply(this,e);else return new Promise((t,r)=>{e.push((i,s)=>i!=null?r(i):t(s)),n.apply(this,e)})},"name",{value:n.name})};_w.fromPromise=function(n){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return n.apply(this,e);e.pop(),n.apply(this,e).then(r=>t(null,r),t)},"name",{value:n.name})}});var OR=S((Qle,PR)=>{var Xo=require("constants"),Kq=process.cwd,dg=null,Yq=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return dg||(dg=Kq.call(process)),dg};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Sw=process.chdir,process.chdir=function(n){dg=null,Sw.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Sw));var Sw;PR.exports=Xq;function Xq(n){Xo.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=o(n.chownSync),n.fchownSync=o(n.fchownSync),n.lchownSync=o(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=c(n.stat),n.fstat=c(n.fstat),n.lstat=c(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,d,h){h&&process.nextTick(h)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,d,h,p){p&&process.nextTick(p)},n.lchownSync=function(){}),Yq==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,y){var v=Date.now(),b=0;f(h,p,a(function w(T){if(T&&(T.code==="EACCES"||T.code==="EPERM"||T.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){n.stat(p,function(I,$){I&&I.code==="ENOENT"?f(h,p,w):y(T)})},b),b<100&&(b+=10);return}y&&y(T)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function d(h,p,y,v,b,w){var T;if(w&&typeof w=="function"){var I=0;T=a(function($,q,ce){if($&&$.code==="EAGAIN"&&I<10)return I++,f.call(n,h,p,y,v,b,T);w.apply(this,arguments)},"callback")}return f.call(n,h,p,y,v,b,T)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(d,h,p,y,v){for(var b=0;;)try{return f.call(n,d,h,p,y,v)}catch(w){if(w.code==="EAGAIN"&&b<10){b++;continue}throw w}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Xo.O_WRONLY|Xo.O_SYMLINK,h,function(y,v){if(y){p&&p(y);return}f.fchmod(v,h,function(b){f.close(v,function(w){p&&p(b||w)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Xo.O_WRONLY|Xo.O_SYMLINK,h),y=!0,v;try{v=f.fchmodSync(p,h),y=!1}finally{if(y)try{f.closeSync(p)}catch{}else f.closeSync(p)}return v}}a(e,"patchLchmod");function t(f){Xo.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,y){f.open(d,Xo.O_SYMLINK,function(v,b){if(v){y&&y(v);return}f.futimes(b,h,p,function(w){f.close(b,function(T){y&&y(w||T)})})})},f.lutimesSync=function(d,h,p){var y=f.openSync(d,Xo.O_SYMLINK),v,b=!0;try{v=f.futimesSync(y,h,p),b=!1}finally{if(b)try{f.closeSync(y)}catch{}else f.closeSync(y)}return v}):f.futimes&&(f.lutimes=function(d,h,p,y){y&&process.nextTick(y)},f.lutimesSync=function(){})}a(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(y){u(y)&&(y=null),p&&p.apply(this,arguments)})}}a(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}a(i,"chmodFixSync");function s(f){return f&&function(d,h,p,y){return f.call(n,d,h,p,function(v){u(v)&&(v=null),y&&y.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(y){if(!u(y))throw y}}}a(o,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function y(v,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),p&&p.apply(this,arguments)}return a(y,"callback"),h?f.call(n,d,h,y):f.call(n,d,y)}}a(c,"statFix");function l(f){return f&&function(d,h){var p=h?f.call(n,d,h):f.call(n,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(Xq,"patch")});var NR=S((Yle,DR)=>{var FR=require("stream").Stream;DR.exports=Jq;function Jq(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);FR.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}n.open(this.path,this.flags,this.mode,function(f,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(r,i){if(!(this instanceof t))return new t(r,i);FR.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,c=s.length;o<c;o++){var l=s[o];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Jq,"legacy")});var kR=S((Jle,LR)=>{"use strict";LR.exports=eW;var Zq=Object.getPrototypeOf||function(n){return n.__proto__};function eW(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:Zq(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}a(eW,"clone")});var Nl=S((eue,ww)=>{var Bt=require("fs"),tW=OR(),rW=NR(),nW=kR(),hg=require("util"),$r,mg;typeof Symbol=="function"&&typeof Symbol.for=="function"?($r=Symbol.for("graceful-fs.queue"),mg=Symbol.for("graceful-fs.previous")):($r="___graceful-fs.queue",mg="___graceful-fs.previous");function iW(){}a(iW,"noop");function $R(n,e){Object.defineProperty(n,$r,{get:a(function(){return e},"get")})}a($R,"publishQueue");var Xa=iW;hg.debuglog?Xa=hg.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Xa=a(function(){var n=hg.format.apply(hg,arguments);n="GFS4: "+n.split(/\n/).join(`
458
- GFS4: `),console.error(n)},"debug"));Bt[$r]||(MR=global[$r]||[],$R(Bt,MR),Bt.close=(function(n){function e(t,r){return n.call(Bt,t,function(i){i||jR(),typeof r=="function"&&r.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,mg,{value:n}),e})(Bt.close),Bt.closeSync=(function(n){function e(t){n.apply(Bt,arguments),jR()}return a(e,"closeSync"),Object.defineProperty(e,mg,{value:n}),e})(Bt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Xa(Bt[$r]),require("assert").equal(Bt[$r].length,0)}));var MR;global[$r]||$R(global,Bt[$r]);ww.exports=vw(nW(Bt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Bt.__patched&&(ww.exports=vw(Bt),Bt.__patched=!0);function vw(n){tW(n),n.gracefulify=vw,n.createReadStream=q,n.createWriteStream=ce;var e=n.readFile;n.readFile=t;function t(F,k,te){return typeof k=="function"&&(te=k,k=null),Ye(F,k,te);function Ye(at,Ft,ct,ut){return e(at,Ft,function(Xe){Xe&&(Xe.code==="EMFILE"||Xe.code==="ENFILE")?Dl([Ye,[at,Ft,ct],Xe,ut||Date.now(),Date.now()]):typeof ct=="function"&&ct.apply(this,arguments)})}a(Ye,"go$readFile")}a(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return r(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$writeFile")}a(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=o);function o(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return s(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$appendFile")}a(o,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=0),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return c(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$copyFile")}a(l,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(F,k,te){typeof k=="function"&&(te=k,k=null);var Ye=f.test(process.version)?a(function(ct,ut,Xe,ie){return u(ct,at(ct,ut,Xe,ie))},"go$readdir"):a(function(ct,ut,Xe,ie){return u(ct,ut,at(ct,ut,Xe,ie))},"go$readdir");return Ye(F,k,te);function at(Ft,ct,ut,Xe){return function(ie,W){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Dl([Ye,[Ft,ct,ut],ie,Xe||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof ut=="function"&&ut.call(this,ie,W))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var h=rW(n);w=h.ReadStream,I=h.WriteStream}var p=n.ReadStream;p&&(w.prototype=Object.create(p.prototype),w.prototype.open=T);var y=n.WriteStream;y&&(I.prototype=Object.create(y.prototype),I.prototype.open=$),Object.defineProperty(n,"ReadStream",{get:a(function(){return w},"get"),set:a(function(F){w=F},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:a(function(){return I},"get"),set:a(function(F){I=F},"set"),enumerable:!0,configurable:!0});var v=w;Object.defineProperty(n,"FileReadStream",{get:a(function(){return v},"get"),set:a(function(F){v=F},"set"),enumerable:!0,configurable:!0});var b=I;Object.defineProperty(n,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(F){b=F},"set"),enumerable:!0,configurable:!0});function w(F,k){return this instanceof w?(p.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}a(w,"ReadStream");function T(){var F=this;V(F.path,F.flags,F.mode,function(k,te){k?(F.autoClose&&F.destroy(),F.emit("error",k)):(F.fd=te,F.emit("open",te),F.read())})}a(T,"ReadStream$open");function I(F,k){return this instanceof I?(y.apply(this,arguments),this):I.apply(Object.create(I.prototype),arguments)}a(I,"WriteStream");function $(){var F=this;V(F.path,F.flags,F.mode,function(k,te){k?(F.destroy(),F.emit("error",k)):(F.fd=te,F.emit("open",te))})}a($,"WriteStream$open");function q(F,k){return new n.ReadStream(F,k)}a(q,"createReadStream");function ce(F,k){return new n.WriteStream(F,k)}a(ce,"createWriteStream");var B=n.open;n.open=V;function V(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return B(Ft,ct,ut,function(W,ft){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$open")}return a(V,"open"),n}a(vw,"patch");function Dl(n){Xa("ENQUEUE",n[0].name,n[1]),Bt[$r].push(n),bw()}a(Dl,"enqueue");var pg;function jR(){for(var n=Date.now(),e=0;e<Bt[$r].length;++e)Bt[$r][e].length>2&&(Bt[$r][e][3]=n,Bt[$r][e][4]=n);bw()}a(jR,"resetQueue");function bw(){if(clearTimeout(pg),pg=void 0,Bt[$r].length!==0){var n=Bt[$r].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Xa("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Xa("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Xa("RETRY",e.name,t),e.apply(null,t.concat([i]))):Bt[$r].push(n)}pg===void 0&&(pg=setTimeout(bw,0))}}a(bw,"retry")});var yn=S(po=>{"use strict";var BR=Er().fromCallback,gn=Nl(),sW=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(n=>typeof gn[n]=="function");Object.assign(po,gn);sW.forEach(n=>{po[n]=BR(gn[n])});po.exists=function(n,e){return typeof e=="function"?gn.exists(n,e):new Promise(t=>gn.exists(n,t))};po.read=function(n,e,t,r,i,s){return typeof s=="function"?gn.read(n,e,t,r,i,s):new Promise((o,c)=>{gn.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};po.write=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.write(n,e,...t):new Promise((r,i)=>{gn.write(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffer:c})})})};po.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.readv(n,e,...t):new Promise((r,i)=>{gn.readv(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesRead:o,buffers:c})})})};po.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.writev(n,e,...t):new Promise((r,i)=>{gn.writev(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffers:c})})})};typeof gn.realpath.native=="function"?po.realpath.native=BR(gn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var VR=S((nue,UR)=>{"use strict";var oW=require("path");UR.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(oW.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var zR=S((sue,Ew)=>{"use strict";var qR=yn(),{checkPath:WR}=VR(),GR=a(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");Ew.exports.makeDir=async(n,e)=>(WR(n),qR.mkdir(n,{mode:GR(e),recursive:!0}));Ew.exports.makeDirSync=(n,e)=>(WR(n),qR.mkdirSync(n,{mode:GR(e),recursive:!0}))});var Vi=S((aue,HR)=>{"use strict";var aW=Er().fromPromise,{makeDir:cW,makeDirSync:Tw}=zR(),Aw=aW(cW);HR.exports={mkdirs:Aw,mkdirsSync:Tw,mkdirp:Aw,mkdirpSync:Tw,ensureDir:Aw,ensureDirSync:Tw}});var Jo=S((cue,KR)=>{"use strict";var lW=Er().fromPromise,QR=yn();function uW(n){return QR.access(n).then(()=>!0).catch(()=>!1)}a(uW,"pathExists");KR.exports={pathExists:lW(uW),pathExistsSync:QR.existsSync}});var xw=S((uue,YR)=>{"use strict";var Ll=yn(),fW=Er().fromPromise;async function dW(n,e,t){let r=await Ll.open(n,"r+"),i=null;try{await Ll.futimes(r,e,t)}finally{try{await Ll.close(r)}catch(s){i=s}}if(i)throw i}a(dW,"utimesMillis");function hW(n,e,t){let r=Ll.openSync(n,"r+");return Ll.futimesSync(r,e,t),Ll.closeSync(r)}a(hW,"utimesMillisSync");YR.exports={utimesMillis:fW(dW),utimesMillisSync:hW}});var Ja=S((due,eI)=>{"use strict";var kl=yn(),Tr=require("path"),XR=Er().fromPromise;function pW(n,e,t){let r=t.dereference?i=>kl.stat(i,{bigint:!0}):i=>kl.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(pW,"getStats");function mW(n,e,t){let r,i=t.dereference?o=>kl.statSync(o,{bigint:!0}):o=>kl.lstatSync(o,{bigint:!0}),s=i(n);try{r=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:r}}a(mW,"getStatsSync");async function gW(n,e,t,r){let{srcStat:i,destStat:s}=await pW(n,e,r);if(s){if(Pf(i,s)){let o=Tr.basename(n),c=Tr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&Cw(n,e))throw new Error(gg(n,e,t));return{srcStat:i,destStat:s}}a(gW,"checkPaths");function yW(n,e,t,r){let{srcStat:i,destStat:s}=mW(n,e,r);if(s){if(Pf(i,s)){let o=Tr.basename(n),c=Tr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&Cw(n,e))throw new Error(gg(n,e,t));return{srcStat:i,destStat:s}}a(yW,"checkPathsSync");async function JR(n,e,t,r){let i=Tr.resolve(Tr.dirname(n)),s=Tr.resolve(Tr.dirname(t));if(s===i||s===Tr.parse(s).root)return;let o;try{o=await kl.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Pf(e,o))throw new Error(gg(n,t,r));return JR(n,e,s,r)}a(JR,"checkParentPaths");function ZR(n,e,t,r){let i=Tr.resolve(Tr.dirname(n)),s=Tr.resolve(Tr.dirname(t));if(s===i||s===Tr.parse(s).root)return;let o;try{o=kl.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Pf(e,o))throw new Error(gg(n,t,r));return ZR(n,e,s,r)}a(ZR,"checkParentPathsSync");function Pf(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}a(Pf,"areIdentical");function Cw(n,e){let t=Tr.resolve(n).split(Tr.sep).filter(i=>i),r=Tr.resolve(e).split(Tr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}a(Cw,"isSrcSubdir");function gg(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}a(gg,"errMsg");eI.exports={checkPaths:XR(gW),checkPathsSync:yW,checkParentPaths:XR(JR),checkParentPathsSync:ZR,isSrcSubdir:Cw,areIdentical:Pf}});var rI=S((pue,tI)=>{"use strict";async function _W(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}a(_W,"asyncIteratorConcurrentProcess");tI.exports={asyncIteratorConcurrentProcess:_W}});var aI=S((gue,oI)=>{"use strict";var Jr=yn(),Of=require("path"),{mkdirs:SW}=Vi(),{pathExists:vW}=Jo(),{utimesMillis:bW}=xw(),Ff=Ja(),{asyncIteratorConcurrentProcess:wW}=rI();async function EW(n,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
454
+ \u2022 Contact support if the issue persists`}};ig.ServiceError=Zb});var sR=S(sr=>{"use strict";Object.defineProperty(sr,"__esModule",{value:!0});sr.ServiceError=sr.ResourceExhaustedError=sr.NotFoundError=sr.PermissionError=sr.StateTransitionError=sr.NetworkError=sr.ValidationError=sr.ApplicationError=sr.ErrorCode=void 0;var ZU=vs();Object.defineProperty(sr,"ErrorCode",{enumerable:!0,get:a(function(){return ZU.ErrorCode},"get")});var eV=bs();Object.defineProperty(sr,"ApplicationError",{enumerable:!0,get:a(function(){return eV.ApplicationError},"get")});var tV=JC();Object.defineProperty(sr,"ValidationError",{enumerable:!0,get:a(function(){return tV.ValidationError},"get")});var rV=ZC();Object.defineProperty(sr,"NetworkError",{enumerable:!0,get:a(function(){return rV.NetworkError},"get")});var nV=eR();Object.defineProperty(sr,"StateTransitionError",{enumerable:!0,get:a(function(){return nV.StateTransitionError},"get")});var iV=tR();Object.defineProperty(sr,"PermissionError",{enumerable:!0,get:a(function(){return iV.PermissionError},"get")});var sV=rR();Object.defineProperty(sr,"NotFoundError",{enumerable:!0,get:a(function(){return sV.NotFoundError},"get")});var oV=nR();Object.defineProperty(sr,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return oV.ResourceExhaustedError},"get")});var aV=iR();Object.defineProperty(sr,"ServiceError",{enumerable:!0,get:a(function(){return aV.ServiceError},"get")})});var tw=S(sg=>{"use strict";Object.defineProperty(sg,"__esModule",{value:!0});sg.ShapeRegistry=void 0;var ew=class{static{a(this,"ShapeRegistry")}constructor(){this.shapes=new Map}get(e){return this.shapes.get(e)}register(e){this.shapes.set(e.propertyIRI,e)}getAll(){return Array.from(this.shapes.values())}get size(){return this.shapes.size}};sg.ShapeRegistry=ew});var ow=S(ws=>{"use strict";var cV=ws&&ws.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),lV=ws&&ws.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),rw=ws&&ws.__importStar||(function(){var n=a(function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&cV(t,e,r[i]);return lV(t,e),t}})();Object.defineProperty(ws,"__esModule",{value:!0});ws.ShapeLoader=void 0;var nw=tw(),Pl=Ae(),iw=Ne(),Fn=lr(),og="http://www.w3.org/ns/shacl#",uV="http://www.w3.org/2001/XMLSchema#",Ole=[["exo__",Fn.Namespace.EXO],["ems__",Fn.Namespace.EMS],["exocmd__",Fn.Namespace.EXOCMD],["ims__",Fn.Namespace.IMS],["ztlk__",Fn.Namespace.ZTLK],["ptms__",Fn.Namespace.PTMS],["lit__",Fn.Namespace.LIT],["inbox__",Fn.Namespace.INBOX],["pmbok__",Fn.Namespace.PMBOK]],sw=class n{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e){let{readdir:t,readFile:r}=await Promise.resolve().then(()=>rw(require("fs/promises"))),i=await Promise.resolve().then(()=>rw(require("path"))),s=new nw.ShapeRegistry;return await n.scanDir(e,s,{readdir:t,readFile:r,path:i}),s}static async loadFromRDFGraph(e){let t=new nw.ShapeRegistry,r=Fn.Namespace.EXO,i=Fn.Namespace.RDFS,s=Fn.Namespace.RDF,[o,c]=await Promise.all([e.match(void 0,s.term("type"),r.term("ObjectProperty")),e.match(void 0,s.term("type"),r.term("Property"))]),l=new Set;for(let u of[...o,...c])u.subject instanceof Pl.IRI&&l.add(u.subject.value);for(let u of l){let f=new Pl.IRI(u),[d,h,p,y,v,b]=await Promise.all([e.match(f,i.term("domain"),void 0),e.match(f,i.term("range"),void 0),e.match(f,r.term("Property_cardinality"),void 0),e.match(f,r.term("Property_severity"),void 0),e.match(f,r.term("Asset_label"),void 0),e.match(f,r.term("Property_minCount"),void 0)]);if(d.length===0)continue;let w=v[0]?.object;if(!(w instanceof iw.Literal))continue;let T=n.labelToIRI(w.value);if(!T)continue;let I=d.map(k=>k.object instanceof Pl.IRI?k.object.value:null).filter(k=>k!==null),$=h.map(k=>k.object instanceof Pl.IRI?k.object.value:null).filter(k=>k!==null),q=n.cardinalityFromIRI(p[0]?.object instanceof Pl.IRI?p[0].object.value:void 0),ce=n.severityFromValue(y[0]?.object instanceof iw.Literal||y[0]?.object instanceof Pl.IRI?y[0].object.value:void 0),B=b[0]?.object,V=B instanceof iw.Literal?parseInt(B.value,10):NaN,F=isNaN(V)?void 0:V;t.register({propertyIRI:T,domain:I,range:$.length>0?$:void 0,cardinality:q,severity:ce,minCount:F})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>rw(require("fs/promises"))),r=await t(e,"utf-8"),i=JSON.parse(r),s=new nw.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static async scanDir(e,t,r){let i;try{i=await r.readdir(e,{withFileTypes:!0})}catch{return}for(let s of i){let o=r.path.join(e,s.name);if(s.isDirectory())await n.scanDir(o,t,r);else if(s.isFile()&&s.name.endsWith(".md"))try{await n.processFile(o,t,r.readFile,r.path)}catch{}}}static async processFile(e,t,r,i){let s;try{s=await r(e,"utf-8")}catch{return}let o=n.parseFrontmatter(s);if(!o||!n.asArray(o.exo__Instance_class).some(B=>{let V=n.extractWikilinkRef(B);return V==="exo__Property"||V==="exo__ObjectProperty"||V?.includes("|exo__Property")||V?.includes("|exo__ObjectProperty")}))return;let u=null,f=o.exo__Asset_label;if(typeof f=="string"&&f.trim().length>0)u=f.trim();else if(i){let B=i.basename(e,".md");Fn.Namespace.fromPropertyKey(B)&&(u=B)}if(!u)return;let d=n.labelToIRI(u);if(!d)return;let h=o.exo__Property_domain,p=o.exo__Property_range,y=o.exo__Property_cardinality,v=o.exo__Property_severity,b=o.exo__Property_minCount,w=n.asArray(h).map(B=>n.wikilinkToIRI(B)).filter(B=>B!==null);if(w.length===0)return;let T=n.asArray(p).map(B=>n.wikilinkToIRI(B)).filter(B=>B!==null),I=n.cardinalityFromLabel(typeof y=="string"?y:void 0),$=n.severityFromValue(typeof v=="string"?v:void 0),q=typeof b=="string"?parseInt(b,10):void 0,ce=q!==void 0&&!isNaN(q)?q:void 0;t.register({propertyIRI:d,domain:w,range:T.length>0?T:void 0,cardinality:I,severity:$,minCount:ce})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let r=t[1],i={},s=r.split(/\r?\n/),o=null,c=null;for(let l of s){let u=/^ {2}- (.*)$/.exec(l);if(u){o&&c&&c.push(u[1].trim());continue}o&&c&&(i[o]=c,o=null,c=null);let f=/^([^:]+):\s*(.*)$/.exec(l);if(!f)continue;let d=f[1].trim(),h=f[2].trim();h===""?(o=d,c=[]):i[d]=h}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Fn.Namespace.fromPropertyKey(e);return t?t.namespace.term(t.localName).value:null}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),r=/\[\[([^\]]+)\]\]/.exec(t);return r?r[1]:t}static wikilinkToIRI(e){let t=n.extractWikilinkRef(e);if(!t)return null;let r=t.split("|"),i=r.length>1?[r[1],r[0]]:[r[0]];for(let s of i){let o=n.labelToIRI(s.trim());if(o)return o}return t.startsWith("http")?t:t.startsWith("sh:")?og+t.substring(3):t.startsWith("xsd:")?uV+t.substring(4):null}static asArray(e){return Array.isArray(e)?e.map(String):typeof e=="string"?[e]:[]}static cardinalityFromIRI(e){if(e){if(e.endsWith("PropertyCardinalitySingle"))return"Single";if(e.endsWith("PropertyCardinalityMultiple"))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=n.extractWikilinkRef(e)??e,r=t.split("|").pop()??t;if(r.includes("Single"))return"Single";if(r.includes("Multiple"))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===og+"Violation"?"sh:Violation":e.includes("Warning")||e===og+"Warning"?"sh:Warning":e.includes("Info")||e===og+"Info"?"sh:Info":"sh:Violation"}};ws.ShapeLoader=sw});var cw=S(xf=>{"use strict";Object.defineProperty(xf,"__esModule",{value:!0});xf.ShapeRegistry=void 0;xf.validate=gV;var aw=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(r=>[r.propertyIRI,r])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};xf.ShapeRegistry=aw;var fV="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",dV=["http://www.w3.org/2001/XMLSchema#","http://www.w3.org/1999/02/22-rdf-syntax-ns#","http://www.w3.org/2000/01/rdf-schema#","http://www.w3.org/2002/07/owl#","http://www.w3.org/2004/02/skos/core#","http://purl.org/dc/elements/1.1/","http://purl.org/dc/terms/","http://xmlns.com/foaf/0.1/","https://schema.org/","https://exocortex.my/ontology/xsd#","https://exocortex.my/ontology/rdf#","https://exocortex.my/ontology/rdfs#","https://exocortex.my/ontology/owl#","https://exocortex.my/ontology/skos#"];function hV(n){return dV.some(e=>n.startsWith(e))}a(hV,"isExternalOntologyIRI");var pV=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function mV(n){return pV.some(e=>n.startsWith(e))}a(mV,"isXSDDatatypeIRI");function gV(n,e,t,r){let i=new Map,s=new Map;for(let l of n){let{subject:u,predicate:f,object:d}=l;if(u.type!=="iri"||f.type!=="iri"||d.type!=="iri"&&d.type!=="literal")continue;let h=u.value,p=f.value,y=d;if(p===e.typePredicateIRI||p===fV){if(y.type==="iri"){let b=i.get(h)??[];b.push(y.value),i.set(h,b)}}else{let b=s.get(h);b||(b=new Map,s.set(h,b));let w=b.get(p)??[];w.push(y),b.set(p,w)}}let o=[],c=new Set([...i.keys(),...s.keys()]);for(let l of c){let u=i.get(l)??[],f=s.get(l)??new Map;for(let d of e.getAllShapes()){if(!(d.domain.length===0||d.domain.some(y=>u.some(v=>v===y||t.isSubClassOf(v,y)))))continue;let p=f.get(d.propertyIRI)??[];if(d.minCount!==void 0&&d.minCount>0&&p.length<d.minCount){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:minCount violation: expected at least ${d.minCount} value(s) for <${d.propertyIRI}>`});continue}if(p.length!==0){if(d.cardinality==="Single"&&p.length>1){o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:maxCount violation: expected at most 1 value for <${d.propertyIRI}>, got ${p.length}`});continue}if(d.range&&d.range.length>0){for(let y of p)if(y.type==="iri"){if(hV(y.value))continue;let v=i.get(y.value)??[];d.range.some(w=>v.some(T=>T===w||t.isSubClassOf(T,w)))||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:class violation: <${y.value}> does not conform to expected class ${d.range.join(" | ")}`,actualValue:y.value,expectedRange:d.range.join(" | ")})}else if(y.type==="literal"){let v=d.range.filter(T=>mV(T));if(v.length===0)continue;let b=y.datatype??"http://www.w3.org/2001/XMLSchema#string";v.some(T=>T===b)||o.push({focusNode:l,propertyPath:d.propertyIRI,severity:d.severity,message:d.message??`sh:datatype violation: literal "${y.value}" has datatype <${b}>, expected ${v.join(" | ")}`,actualValue:y.value,expectedRange:v.join(" | ")})}}}}}if(r?.closedWorldMode)for(let l of c){let u=s.get(l)??new Map;for(let f of u.keys())e.hasShape(f)||o.push({focusNode:l,propertyPath:f,severity:"sh:Warning",message:`Unknown property: <${f}> has no registered shape`})}return o.sort((l,u)=>{let f=l.focusNode.localeCompare(u.focusNode);return f!==0?f:l.propertyPath.localeCompare(u.propertyPath)}),{conforms:!o.some(l=>l.severity==="sh:Violation"),violations:o}}a(gV,"validate")});var oR=S(ag=>{"use strict";Object.defineProperty(ag,"__esModule",{value:!0});ag.ApplicationErrorHandler=void 0;var lw=bs(),yV=vs(),_V=Uo(),uw=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,r){this.logger=t,this.notifier=r,this.telemetryHooks=new Set,this.retryConfig={maxRetries:e.maxRetries??3,initialDelayMs:e.initialDelayMs??1e3,backoffMultiplier:e.backoffMultiplier??2,maxDelayMs:e.maxDelayMs??1e4}}handle(e,t){let r=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(r.message),this.callTelemetryHooks("onError",r,t),this.formatError(r)}async executeWithRetry(e,t){let r,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(r=this.ensureApplicationError(s,t),!r.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",r,t),i>=this.retryConfig.maxRetries&&r.retriable&&this.callTelemetryHooks("onRetryExhausted",r,i+1),r;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",r,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw r}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof lw.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends lw.ApplicationError{constructor(){super(...arguments),this.code=i.code,this.retriable=i.retriable,this.guidance=i.guidance}}(e.message,s)}return e}return new class extends lw.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=yV.ErrorCode.UNKNOWN_ERROR,this.retriable=!1,this.guidance="An unexpected error occurred"}}(e.message,e)}formatError(e){let t=[];return t.push(`\u274C ${e.name}: ${e.message}`),e.guidance&&t.push(`\u{1F4A1} ${e.guidance}`),e.context&&Object.keys(e.context).length>0&&t.push(`Context: ${JSON.stringify(e.context,null,2)}`),t.join(`
455
+ `)}calculateDelay(e){let t=this.retryConfig.initialDelayMs*Math.pow(this.retryConfig.backoffMultiplier,e);return Math.min(t,this.retryConfig.maxDelayMs)}sleep(e){return new Promise(t=>setTimeout(t,e))}callTelemetryHooks(e,...t){for(let r of this.telemetryHooks)try{let i=r[e];i&&i.apply(r,t)}catch(i){_V.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};ag.ApplicationErrorHandler=uw});var aR=S(cg=>{"use strict";Object.defineProperty(cg,"__esModule",{value:!0});cg.ApplicationErrorHandler=void 0;var SV=oR();Object.defineProperty(cg,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return SV.ApplicationErrorHandler},"get")})});var dw=S(lg=>{"use strict";Object.defineProperty(lg,"__esModule",{value:!0});lg.ClassHierarchy=void 0;var vV="http://www.w3.org/2000/01/rdf-schema#subClassOf",fw=class{static{a(this,"ClassHierarchy")}constructor(e){this.adjacency=new Map;for(let t of e){if(t.predicate.type!=="iri"||t.predicate.value!==vV||t.subject.type!=="iri"||t.object.type!=="iri")continue;let r=t.subject.value,i=t.object.value,s=this.adjacency.get(r);s||(s=new Set,this.adjacency.set(r,s)),s.add(i)}}isSubClassOf(e,t){if(e===t)return!0;let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o){if(c===t)return!0;r.has(c)||i.push(c)}}return!1}getAncestors(e){let t=new Set,r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===void 0)break;if(r.has(s))continue;r.add(s);let o=this.adjacency.get(s);if(o)for(let c of o)t.add(c),r.has(c)||i.push(c)}return t}};lg.ClassHierarchy=fw});var lR=S(Es=>{"use strict";Object.defineProperty(Es,"__esModule",{value:!0});Es.ValidatorDaemon=Es.IDLE_TIMEOUT_MS=Es.DEFAULT_SOCKET_PATH=void 0;var cR=cw(),bV=ow(),wV=dw();Es.DEFAULT_SOCKET_PATH=`${process.env.HOME??process.env.USERPROFILE??"/tmp"}/.cache/exocortex/validator.sock`;Es.IDLE_TIMEOUT_MS=300*1e3;var hw=class{static{a(this,"ValidatorDaemon")}constructor(e=Es.DEFAULT_SOCKET_PATH,t=Es.IDLE_TIMEOUT_MS){this.registryCache=new Map,this.server=null,this.idleTimer=null,this.socketPath=e,this.idleTimeoutMs=t}async start(){let e=require("net"),t=require("fs/promises"),r=require("path");await t.mkdir(r.dirname(this.socketPath),{recursive:!0});try{await t.unlink(this.socketPath)}catch{}this.server=e.createServer(o=>{this.handleConnection(o)});let i=this.server;await new Promise((o,c)=>{i.on("error",c),i.listen(this.socketPath,o)}),this.resetIdleTimer();let s=a(()=>{this.stop()},"handleSignal");process.once("SIGTERM",s),process.once("SIGINT",s)}async stop(){if(this.idleTimer!==null&&(clearTimeout(this.idleTimer),this.idleTimer=null),!this.server)return;let e=this.server;this.server=null,await new Promise(t=>{e.close(()=>t())})}resetIdleTimer(){this.idleTimer!==null&&clearTimeout(this.idleTimer),this.idleTimer=setTimeout(()=>{process.exit(0)},this.idleTimeoutMs)}handleConnection(e){let t="";e.setEncoding("utf-8"),e.on("data",r=>{t+=r;let i=t.split(`
456
+ `);t=i.pop()??"";for(let s of i){let o=s.trim();o&&this.handleRequest(o,e)}}),e.on("error",()=>{e.destroy()})}async handleRequest(e,t){this.resetIdleTimer();let r;try{let i=JSON.parse(e),s=await this.getRegistry(i.registryPath),o=new wV.ClassHierarchy(i.subclassTriples??[]);r={report:(0,cR.validate)(i.triples,s,o,{closedWorldMode:i.closedWorldMode})}}catch(i){r={error:i instanceof Error?i.message:String(i)}}t.destroyed||t.write(JSON.stringify(r)+`
457
+ `)}async getRegistry(e){let t=this.registryCache.get(e);if(t)return t;let r=await bV.ShapeLoader.loadFromShapeJSON(e),i=new cR.ShapeRegistry(r.getAll());return this.registryCache.set(e,i),i}};Es.ValidatorDaemon=hw});var Pt=S(m=>{"use strict";var EV=m&&m.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:a(function(){return e[t]},"get")}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),ii=m&&m.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&EV(e,n,t)};Object.defineProperty(m,"__esModule",{value:!0});m.RenameToUidService=m.PropertyCleanupService=m.LoggingService=m.LabelToAliasService=m.FolderRepairService=m.EffortVotingService=m.WorkflowCommandAdapter=m.VisibilityGenerator=m.InstantiationRuleResolver=m.WorkflowResolver=m.WorkflowEngine=m.EffortStatusWorkflow=m.ConceptCreationService=m.ClassCreationService=m.AreaHierarchyBuilder=m.AreaCreationService=m.TaskStatusService=m.ServiceRegistry=m.GroundingExecutor=m.PreconditionEvaluator=m.CommandResolver=m.extractPropertyLabel=m.uriToPropertyName=m.propertyNameToUri=m.rangeToFieldType=m.PropertyFieldType=m.isCommandBindingFrontmatter=m.isGroundingFrontmatter=m.isPreconditionFrontmatter=m.isCommandFrontmatter=m.isStyleSource=m.isLabelClass=m.isCommandVariant=m.STYLE_SOURCE_VALUES=m.LABEL_CLASS_VALUES=m.COMMAND_VARIANT_VALUES=m.CommandBindingStyleProperty=m.CommandBindingProperty=m.GroundingProperty=m.PreconditionProperty=m.CommandProperty=m.GroundingType=m.getEffortStatusLabel=m.isTrashedStatus=m.isDoneStatus=m.normalizeEffortStatus=m.EFFORT_STATUS_OPTIONS=m.STATUS_NAME_TO_WIKILINK=m.STATUS_NAME_TO_ENUM=m.EFFORT_STATUS_CONFIG=void 0;m.InMemoryTripleStore=m.OBSIDIAN_VAULT_SCHEME=m.vaultPathToIRI=m.NullLogger=m.RDFSerializer=m.FilenameValidator=m.EffortSortingHelpers=m.MetadataExtractor=m.MetadataHelpers=m.WikiLinkHelpers=m.DateFormatter=m.FrontmatterService=m.CriticalityZoneUUIDs=m.CriticalityZoneService=m.DailyReviewService=m.DEFAULT_AUTOCOMPLETE_CONFIG=m.AutocompleteService=m.TrendDetectionService=m.AnalyticsService=m.getTemplateByName=m.validateParameters=m.fillTemplate=m.findMatchingTemplates=m.findClassByTerm=m.KNOWN_CLASSES=m.KNOWN_PROTOTYPES=m.EFFORT_STATUSES=m.ASSET_CLASSES=m.PREDICATES=m.SPARQL_PREFIXES=m.SPARQL_TEMPLATES=m.DEFAULT_NL_TO_SPARQL_CONFIG=m.NLToSPARQLService=m.TypeRegistry=m.GraphQueryService=m.FixMissingLabelService=m.ArchiveAssetService=m.GenericAssetCreationService=m.URIConstructionService=m.SessionEventService=m.AssetConversionService=m.EnumValueResolver=m.ClassHierarchyResolver=m.PropertySchemaResolver=m.PlanningService=m.AlgorithmExtractor=m.DynamicFrontmatterGenerator=m.FleetingNoteCreationService=m.SupervisionCreationService=m.StatusTimestampService=void 0;m.createSPARQLResultCache=m.SPARQLResultCache=m.QueryPlanCache=m.createDoubleLiteral=m.createDecimalLiteral=m.getNumericValue=m.createPercentileAggregate=m.modeAggregate=m.stddevAggregate=m.varianceAggregate=m.medianAggregate=m.EXO_AGGREGATE_NS=m.BUILT_IN_AGGREGATES=m.CustomAggregateError=m.CustomAggregateRegistry=m.AggregateFunctions=m.BuiltInFunctions=m.SolutionMapping=m.UpdateExecutorError=m.UpdateExecutor=m.QueryExecutor=m.ExoQLQueryExecutor=m.DescribeExecutor=m.ConstructExecutor=m.UnionExecutor=m.OptionalExecutor=m.FilterExecutor=m.BGPExecutor=m.AlgebraSerializer=m.AlgebraOptimizer=m.AlgebraTranslator=m.ExoQLAlgebraTranslator=m.DescribeOptionsTransformerError=m.DescribeOptionsTransformer=m.SPARQLParseError=m.SPARQLParser=m.ExoQLParser=m.NoteToRDFConverter=m.SOURCE_VARIABLE=m.SourceAnnotator=m.INFERRED_GRAPH=m.PrototypeChainMaterializer=m.PropertyCardinalityRegistry=m.NonInheritablePropertyRegistry=m.RDFSInferenceEngine=m.RDFVocabularyMapper=m.DomainTriple=m.DomainBlankNode=m.DomainLiteral=m.DomainIRI=void 0;m.createLayoutBlockFromFrontmatter=m.PROPERTIES_BLOCK_CLASS_UID=m.PROPERTIES_BLOCK_CLASS_IRI=m.BACKLINKS_TABLE_BLOCK_CLASS_UID=m.BACKLINKS_TABLE_BLOCK_CLASS_IRI=m.isLayoutFrontmatter=m.isLayout=m.createLayoutFromFrontmatter=m.LAYOUT_CLASS_UID=m.LAYOUT_CLASS_IRI=m.RelationColumnSetResolver=m.normalizeRelationColumnSetRef=m.isRelationColumnSetFrontmatter=m.isRelationColumnSet=m.createRelationColumnSetFromFrontmatter=m.RELATION_COLUMN_SET_CLASS_UID=m.RELATION_COLUMN_SET_CLASS_IRI=m.ExoQLError=m.ExoQL=m.createStreamingSource=m.StreamingLoader=m.resetGlobalPool=m.getGlobalPool=m.MemoryPool=m.CompactGraphStore=m.StringTable=m.DEFAULT_COLORS=m.NODE_FLAGS=m.container=m.resetContainer=m.getContainer=m.createChildContainer=m.registerCoreServices=m.DI_TOKENS=m.DEFAULT_FLEETING_NOTE_CLASS_UID=m.DEFAULT_INBOX_FOLDER=m.DEFAULT_OWNER_IDENTITY=m.VaultSettings=m.TransactionError=m.TripleNotFoundError=m.TripleAlreadyExistsError=m.FileAlreadyExistsError=m.FileNotFoundError=m.FilterContainsOptimizer=m.VaultPrefixTransformer=m.CaseWhenTransformerError=m.CaseWhenTransformer=m.ResultSerializer=m.createIncrementalIndexer=m.IncrementalIndexer=void 0;m.TripleClassHierarchy=m.IDLE_TIMEOUT_MS=m.DEFAULT_SOCKET_PATH=m.ValidatorDaemon=m.ShaclShapeRegistry=m.shaclValidate=m.Namespace=m.ShapeRegistry=m.ShapeLoader=m.selectByPriority=m.LayoutSelector=m.isPropertiesBlock=m.isLayoutBlockFrontmatter=m.isBacklinksTableBlock=void 0;ii(Nu(),m);ii(Tc(),m);var Ko=w0();Object.defineProperty(m,"EFFORT_STATUS_CONFIG",{enumerable:!0,get:a(function(){return Ko.EFFORT_STATUS_CONFIG},"get")});Object.defineProperty(m,"STATUS_NAME_TO_ENUM",{enumerable:!0,get:a(function(){return Ko.STATUS_NAME_TO_ENUM},"get")});Object.defineProperty(m,"STATUS_NAME_TO_WIKILINK",{enumerable:!0,get:a(function(){return Ko.STATUS_NAME_TO_WIKILINK},"get")});Object.defineProperty(m,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Ko.EFFORT_STATUS_OPTIONS},"get")});Object.defineProperty(m,"normalizeEffortStatus",{enumerable:!0,get:a(function(){return Ko.normalizeEffortStatus},"get")});Object.defineProperty(m,"isDoneStatus",{enumerable:!0,get:a(function(){return Ko.isDoneStatus},"get")});Object.defineProperty(m,"isTrashedStatus",{enumerable:!0,get:a(function(){return Ko.isTrashedStatus},"get")});Object.defineProperty(m,"getEffortStatusLabel",{enumerable:!0,get:a(function(){return Ko.getEffortStatusLabel},"get")});var TV=Ac();Object.defineProperty(m,"GroundingType",{enumerable:!0,get:a(function(){return TV.GroundingType},"get")});var Cf=E0();Object.defineProperty(m,"CommandProperty",{enumerable:!0,get:a(function(){return Cf.CommandProperty},"get")});Object.defineProperty(m,"PreconditionProperty",{enumerable:!0,get:a(function(){return Cf.PreconditionProperty},"get")});Object.defineProperty(m,"GroundingProperty",{enumerable:!0,get:a(function(){return Cf.GroundingProperty},"get")});Object.defineProperty(m,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Cf.CommandBindingProperty},"get")});Object.defineProperty(m,"CommandBindingStyleProperty",{enumerable:!0,get:a(function(){return Cf.CommandBindingStyleProperty},"get")});var Ol=T0();Object.defineProperty(m,"COMMAND_VARIANT_VALUES",{enumerable:!0,get:a(function(){return Ol.COMMAND_VARIANT_VALUES},"get")});Object.defineProperty(m,"LABEL_CLASS_VALUES",{enumerable:!0,get:a(function(){return Ol.LABEL_CLASS_VALUES},"get")});Object.defineProperty(m,"STYLE_SOURCE_VALUES",{enumerable:!0,get:a(function(){return Ol.STYLE_SOURCE_VALUES},"get")});Object.defineProperty(m,"isCommandVariant",{enumerable:!0,get:a(function(){return Ol.isCommandVariant},"get")});Object.defineProperty(m,"isLabelClass",{enumerable:!0,get:a(function(){return Ol.isLabelClass},"get")});Object.defineProperty(m,"isStyleSource",{enumerable:!0,get:a(function(){return Ol.isStyleSource},"get")});var ug=E2();Object.defineProperty(m,"isCommandFrontmatter",{enumerable:!0,get:a(function(){return ug.isCommandFrontmatter},"get")});Object.defineProperty(m,"isPreconditionFrontmatter",{enumerable:!0,get:a(function(){return ug.isPreconditionFrontmatter},"get")});Object.defineProperty(m,"isGroundingFrontmatter",{enumerable:!0,get:a(function(){return ug.isGroundingFrontmatter},"get")});Object.defineProperty(m,"isCommandBindingFrontmatter",{enumerable:!0,get:a(function(){return ug.isCommandBindingFrontmatter},"get")});ii(T2(),m);ii(A2(),m);ii(A0(),m);ii(x0(),m);ii(C2(),m);ii(P2(),m);ii(a_(),m);ii(_A(),m);var uR=Ph();Object.defineProperty(m,"PropertyFieldType",{enumerable:!0,get:a(function(){return uR.PropertyFieldType},"get")});Object.defineProperty(m,"rangeToFieldType",{enumerable:!0,get:a(function(){return uR.rangeToFieldType},"get")});var pw=f_();Object.defineProperty(m,"propertyNameToUri",{enumerable:!0,get:a(function(){return pw.propertyNameToUri},"get")});Object.defineProperty(m,"uriToPropertyName",{enumerable:!0,get:a(function(){return pw.uriToPropertyName},"get")});Object.defineProperty(m,"extractPropertyLabel",{enumerable:!0,get:a(function(){return pw.extractPropertyLabel},"get")});var AV=Hx();Object.defineProperty(m,"CommandResolver",{enumerable:!0,get:a(function(){return AV.CommandResolver},"get")});var xV=Kx();Object.defineProperty(m,"PreconditionEvaluator",{enumerable:!0,get:a(function(){return xV.PreconditionEvaluator},"get")});var fR=Xx();Object.defineProperty(m,"GroundingExecutor",{enumerable:!0,get:a(function(){return fR.GroundingExecutor},"get")});Object.defineProperty(m,"ServiceRegistry",{enumerable:!0,get:a(function(){return fR.ServiceRegistry},"get")});var CV=DS();Object.defineProperty(m,"TaskStatusService",{enumerable:!0,get:a(function(){return CV.TaskStatusService},"get")});var RV=MS();Object.defineProperty(m,"AreaCreationService",{enumerable:!0,get:a(function(){return RV.AreaCreationService},"get")});var IV=$S();Object.defineProperty(m,"AreaHierarchyBuilder",{enumerable:!0,get:a(function(){return IV.AreaHierarchyBuilder},"get")});var PV=US();Object.defineProperty(m,"ClassCreationService",{enumerable:!0,get:a(function(){return PV.ClassCreationService},"get")});var OV=qS();Object.defineProperty(m,"ConceptCreationService",{enumerable:!0,get:a(function(){return OV.ConceptCreationService},"get")});var FV=um();Object.defineProperty(m,"EffortStatusWorkflow",{enumerable:!0,get:a(function(){return FV.EffortStatusWorkflow},"get")});var DV=ff();Object.defineProperty(m,"WorkflowEngine",{enumerable:!0,get:a(function(){return DV.WorkflowEngine},"get")});var NV=bS();Object.defineProperty(m,"WorkflowResolver",{enumerable:!0,get:a(function(){return NV.WorkflowResolver},"get")});var LV=f3();Object.defineProperty(m,"InstantiationRuleResolver",{enumerable:!0,get:a(function(){return LV.InstantiationRuleResolver},"get")});var kV=d3();Object.defineProperty(m,"VisibilityGenerator",{enumerable:!0,get:a(function(){return kV.VisibilityGenerator},"get")});var MV=h3();Object.defineProperty(m,"WorkflowCommandAdapter",{enumerable:!0,get:a(function(){return MV.WorkflowCommandAdapter},"get")});var jV=YS();Object.defineProperty(m,"EffortVotingService",{enumerable:!0,get:a(function(){return jV.EffortVotingService},"get")});var $V=JS();Object.defineProperty(m,"FolderRepairService",{enumerable:!0,get:a(function(){return $V.FolderRepairService},"get")});var BV=ev();Object.defineProperty(m,"LabelToAliasService",{enumerable:!0,get:a(function(){return BV.LabelToAliasService},"get")});var UV=Uo();Object.defineProperty(m,"LoggingService",{enumerable:!0,get:a(function(){return UV.LoggingService},"get")});var VV=nv();Object.defineProperty(m,"PropertyCleanupService",{enumerable:!0,get:a(function(){return VV.PropertyCleanupService},"get")});var qV=sv();Object.defineProperty(m,"RenameToUidService",{enumerable:!0,get:a(function(){return qV.RenameToUidService},"get")});var WV=dm();Object.defineProperty(m,"StatusTimestampService",{enumerable:!0,get:a(function(){return WV.StatusTimestampService},"get")});var GV=cv();Object.defineProperty(m,"SupervisionCreationService",{enumerable:!0,get:a(function(){return GV.SupervisionCreationService},"get")});var zV=fv();Object.defineProperty(m,"FleetingNoteCreationService",{enumerable:!0,get:a(function(){return zV.FleetingNoteCreationService},"get")});var HV=hv();Object.defineProperty(m,"DynamicFrontmatterGenerator",{enumerable:!0,get:a(function(){return HV.DynamicFrontmatterGenerator},"get")});var QV=mv();Object.defineProperty(m,"AlgorithmExtractor",{enumerable:!0,get:a(function(){return QV.AlgorithmExtractor},"get")});var KV=yv();Object.defineProperty(m,"PlanningService",{enumerable:!0,get:a(function(){return KV.PlanningService},"get")});var YV=x3();Object.defineProperty(m,"PropertySchemaResolver",{enumerable:!0,get:a(function(){return YV.PropertySchemaResolver},"get")});var XV=C3();Object.defineProperty(m,"ClassHierarchyResolver",{enumerable:!0,get:a(function(){return XV.ClassHierarchyResolver},"get")});var JV=R3();Object.defineProperty(m,"EnumValueResolver",{enumerable:!0,get:a(function(){return JV.EnumValueResolver},"get")});var ZV=wv();Object.defineProperty(m,"AssetConversionService",{enumerable:!0,get:a(function(){return ZV.AssetConversionService},"get")});var eq=Av();Object.defineProperty(m,"SessionEventService",{enumerable:!0,get:a(function(){return eq.SessionEventService},"get")});var tq=Rv();Object.defineProperty(m,"URIConstructionService",{enumerable:!0,get:a(function(){return tq.URIConstructionService},"get")});var rq=Pv();Object.defineProperty(m,"GenericAssetCreationService",{enumerable:!0,get:a(function(){return rq.GenericAssetCreationService},"get")});var nq=j3();Object.defineProperty(m,"ArchiveAssetService",{enumerable:!0,get:a(function(){return nq.ArchiveAssetService},"get")});var iq=B3();Object.defineProperty(m,"FixMissingLabelService",{enumerable:!0,get:a(function(){return iq.FixMissingLabelService},"get")});var sq=U3();Object.defineProperty(m,"GraphQueryService",{enumerable:!0,get:a(function(){return sq.GraphQueryService},"get")});var oq=q3();Object.defineProperty(m,"TypeRegistry",{enumerable:!0,get:a(function(){return oq.TypeRegistry},"get")});var dR=W3();Object.defineProperty(m,"NLToSPARQLService",{enumerable:!0,get:a(function(){return dR.NLToSPARQLService},"get")});Object.defineProperty(m,"DEFAULT_NL_TO_SPARQL_CONFIG",{enumerable:!0,get:a(function(){return dR.DEFAULT_NL_TO_SPARQL_CONFIG},"get")});var si=Lv();Object.defineProperty(m,"SPARQL_TEMPLATES",{enumerable:!0,get:a(function(){return si.SPARQL_TEMPLATES},"get")});Object.defineProperty(m,"SPARQL_PREFIXES",{enumerable:!0,get:a(function(){return si.SPARQL_PREFIXES},"get")});Object.defineProperty(m,"PREDICATES",{enumerable:!0,get:a(function(){return si.PREDICATES},"get")});Object.defineProperty(m,"ASSET_CLASSES",{enumerable:!0,get:a(function(){return si.ASSET_CLASSES},"get")});Object.defineProperty(m,"EFFORT_STATUSES",{enumerable:!0,get:a(function(){return si.EFFORT_STATUSES},"get")});Object.defineProperty(m,"KNOWN_PROTOTYPES",{enumerable:!0,get:a(function(){return si.KNOWN_PROTOTYPES},"get")});Object.defineProperty(m,"KNOWN_CLASSES",{enumerable:!0,get:a(function(){return si.KNOWN_CLASSES},"get")});Object.defineProperty(m,"findClassByTerm",{enumerable:!0,get:a(function(){return si.findClassByTerm},"get")});Object.defineProperty(m,"findMatchingTemplates",{enumerable:!0,get:a(function(){return si.findMatchingTemplates},"get")});Object.defineProperty(m,"fillTemplate",{enumerable:!0,get:a(function(){return si.fillTemplate},"get")});Object.defineProperty(m,"validateParameters",{enumerable:!0,get:a(function(){return si.validateParameters},"get")});Object.defineProperty(m,"getTemplateByName",{enumerable:!0,get:a(function(){return si.getTemplateByName},"get")});var aq=z3();Object.defineProperty(m,"AnalyticsService",{enumerable:!0,get:a(function(){return aq.AnalyticsService},"get")});var cq=H3();Object.defineProperty(m,"TrendDetectionService",{enumerable:!0,get:a(function(){return cq.TrendDetectionService},"get")});var hR=K3();Object.defineProperty(m,"AutocompleteService",{enumerable:!0,get:a(function(){return hR.AutocompleteService},"get")});Object.defineProperty(m,"DEFAULT_AUTOCOMPLETE_CONFIG",{enumerable:!0,get:a(function(){return hR.DEFAULT_AUTOCOMPLETE_CONFIG},"get")});var lq=X3();Object.defineProperty(m,"DailyReviewService",{enumerable:!0,get:a(function(){return lq.DailyReviewService},"get")});var pR=Vv();Object.defineProperty(m,"CriticalityZoneService",{enumerable:!0,get:a(function(){return pR.CriticalityZoneService},"get")});Object.defineProperty(m,"CriticalityZoneUUIDs",{enumerable:!0,get:a(function(){return pR.CriticalityZoneUUIDs},"get")});var uq=ei();Object.defineProperty(m,"FrontmatterService",{enumerable:!0,get:a(function(){return uq.FrontmatterService},"get")});var fq=Qr();Object.defineProperty(m,"DateFormatter",{enumerable:!0,get:a(function(){return fq.DateFormatter},"get")});var dq=zs();Object.defineProperty(m,"WikiLinkHelpers",{enumerable:!0,get:a(function(){return dq.WikiLinkHelpers},"get")});var hq=ms();Object.defineProperty(m,"MetadataHelpers",{enumerable:!0,get:a(function(){return hq.MetadataHelpers},"get")});var pq=LS();Object.defineProperty(m,"MetadataExtractor",{enumerable:!0,get:a(function(){return pq.MetadataExtractor},"get")});var mq=Z3();Object.defineProperty(m,"EffortSortingHelpers",{enumerable:!0,get:a(function(){return mq.EffortSortingHelpers},"get")});var gq=eC();Object.defineProperty(m,"FilenameValidator",{enumerable:!0,get:a(function(){return gq.FilenameValidator},"get")});var yq=aC();Object.defineProperty(m,"RDFSerializer",{enumerable:!0,get:a(function(){return yq.RDFSerializer},"get")});var _q=Oc();Object.defineProperty(m,"NullLogger",{enumerable:!0,get:a(function(){return _q.NullLogger},"get")});var mR=eb();Object.defineProperty(m,"vaultPathToIRI",{enumerable:!0,get:a(function(){return mR.vaultPathToIRI},"get")});Object.defineProperty(m,"OBSIDIAN_VAULT_SCHEME",{enumerable:!0,get:a(function(){return mR.OBSIDIAN_VAULT_SCHEME},"get")});var Sq=IS();Object.defineProperty(m,"InMemoryTripleStore",{enumerable:!0,get:a(function(){return Sq.InMemoryTripleStore},"get")});var vq=Ae();Object.defineProperty(m,"DomainIRI",{enumerable:!0,get:a(function(){return vq.IRI},"get")});var bq=Ne();Object.defineProperty(m,"DomainLiteral",{enumerable:!0,get:a(function(){return bq.Literal},"get")});var wq=qt();Object.defineProperty(m,"DomainBlankNode",{enumerable:!0,get:a(function(){return wq.BlankNode},"get")});var Eq=Yn();Object.defineProperty(m,"DomainTriple",{enumerable:!0,get:a(function(){return Eq.Triple},"get")});var Tq=rb();Object.defineProperty(m,"RDFVocabularyMapper",{enumerable:!0,get:a(function(){return Tq.RDFVocabularyMapper},"get")});var Aq=lC();Object.defineProperty(m,"RDFSInferenceEngine",{enumerable:!0,get:a(function(){return Aq.RDFSInferenceEngine},"get")});var xq=ob();Object.defineProperty(m,"NonInheritablePropertyRegistry",{enumerable:!0,get:a(function(){return xq.NonInheritablePropertyRegistry},"get")});var Cq=lb();Object.defineProperty(m,"PropertyCardinalityRegistry",{enumerable:!0,get:a(function(){return Cq.PropertyCardinalityRegistry},"get")});var gR=db();Object.defineProperty(m,"PrototypeChainMaterializer",{enumerable:!0,get:a(function(){return gR.PrototypeChainMaterializer},"get")});Object.defineProperty(m,"INFERRED_GRAPH",{enumerable:!0,get:a(function(){return gR.INFERRED_GRAPH},"get")});var yR=pb();Object.defineProperty(m,"SourceAnnotator",{enumerable:!0,get:a(function(){return yR.SourceAnnotator},"get")});Object.defineProperty(m,"SOURCE_VARIABLE",{enumerable:!0,get:a(function(){return yR.SOURCE_VARIABLE},"get")});var Rq=gb();Object.defineProperty(m,"NoteToRDFConverter",{enumerable:!0,get:a(function(){return Rq.NoteToRDFConverter},"get")});var mw=Uc();Object.defineProperty(m,"ExoQLParser",{enumerable:!0,get:a(function(){return mw.ExoQLParser},"get")});Object.defineProperty(m,"SPARQLParser",{enumerable:!0,get:a(function(){return mw.SPARQLParser},"get")});Object.defineProperty(m,"SPARQLParseError",{enumerable:!0,get:a(function(){return mw.SPARQLParseError},"get")});var _R=l1();Object.defineProperty(m,"DescribeOptionsTransformer",{enumerable:!0,get:a(function(){return _R.DescribeOptionsTransformer},"get")});Object.defineProperty(m,"DescribeOptionsTransformerError",{enumerable:!0,get:a(function(){return _R.DescribeOptionsTransformerError},"get")});var SR=qc();Object.defineProperty(m,"ExoQLAlgebraTranslator",{enumerable:!0,get:a(function(){return SR.ExoQLAlgebraTranslator},"get")});Object.defineProperty(m,"AlgebraTranslator",{enumerable:!0,get:a(function(){return SR.AlgebraTranslator},"get")});var Iq=SC();Object.defineProperty(m,"AlgebraOptimizer",{enumerable:!0,get:a(function(){return Iq.AlgebraOptimizer},"get")});var Pq=vC();Object.defineProperty(m,"AlgebraSerializer",{enumerable:!0,get:a(function(){return Pq.AlgebraSerializer},"get")});var Oq=C1();Object.defineProperty(m,"BGPExecutor",{enumerable:!0,get:a(function(){return Oq.BGPExecutor},"get")});var Fq=jp();Object.defineProperty(m,"FilterExecutor",{enumerable:!0,get:a(function(){return Fq.FilterExecutor},"get")});var Dq=z1();Object.defineProperty(m,"OptionalExecutor",{enumerable:!0,get:a(function(){return Dq.OptionalExecutor},"get")});var Nq=Q1();Object.defineProperty(m,"UnionExecutor",{enumerable:!0,get:a(function(){return Nq.UnionExecutor},"get")});var Lq=iS();Object.defineProperty(m,"ConstructExecutor",{enumerable:!0,get:a(function(){return Lq.ConstructExecutor},"get")});var kq=wC();Object.defineProperty(m,"DescribeExecutor",{enumerable:!0,get:a(function(){return kq.DescribeExecutor},"get")});var vR=ll();Object.defineProperty(m,"ExoQLQueryExecutor",{enumerable:!0,get:a(function(){return vR.ExoQLQueryExecutor},"get")});Object.defineProperty(m,"QueryExecutor",{enumerable:!0,get:a(function(){return vR.QueryExecutor},"get")});var bR=TC();Object.defineProperty(m,"UpdateExecutor",{enumerable:!0,get:a(function(){return bR.UpdateExecutor},"get")});Object.defineProperty(m,"UpdateExecutorError",{enumerable:!0,get:a(function(){return bR.UpdateExecutorError},"get")});var Mq=us();Object.defineProperty(m,"SolutionMapping",{enumerable:!0,get:a(function(){return Mq.SolutionMapping},"get")});var jq=Mp();Object.defineProperty(m,"BuiltInFunctions",{enumerable:!0,get:a(function(){return jq.BuiltInFunctions},"get")});var $q=xC();Object.defineProperty(m,"AggregateFunctions",{enumerable:!0,get:a(function(){return $q.AggregateFunctions},"get")});var wR=X1();Object.defineProperty(m,"CustomAggregateRegistry",{enumerable:!0,get:a(function(){return wR.CustomAggregateRegistry},"get")});Object.defineProperty(m,"CustomAggregateError",{enumerable:!0,get:a(function(){return wR.CustomAggregateError},"get")});var Ts=J1();Object.defineProperty(m,"BUILT_IN_AGGREGATES",{enumerable:!0,get:a(function(){return Ts.BUILT_IN_AGGREGATES},"get")});Object.defineProperty(m,"EXO_AGGREGATE_NS",{enumerable:!0,get:a(function(){return Ts.EXO_AGGREGATE_NS},"get")});Object.defineProperty(m,"medianAggregate",{enumerable:!0,get:a(function(){return Ts.medianAggregate},"get")});Object.defineProperty(m,"varianceAggregate",{enumerable:!0,get:a(function(){return Ts.varianceAggregate},"get")});Object.defineProperty(m,"stddevAggregate",{enumerable:!0,get:a(function(){return Ts.stddevAggregate},"get")});Object.defineProperty(m,"modeAggregate",{enumerable:!0,get:a(function(){return Ts.modeAggregate},"get")});Object.defineProperty(m,"createPercentileAggregate",{enumerable:!0,get:a(function(){return Ts.createPercentileAggregate},"get")});Object.defineProperty(m,"getNumericValue",{enumerable:!0,get:a(function(){return Ts.getNumericValue},"get")});Object.defineProperty(m,"createDecimalLiteral",{enumerable:!0,get:a(function(){return Ts.createDecimalLiteral},"get")});Object.defineProperty(m,"createDoubleLiteral",{enumerable:!0,get:a(function(){return Ts.createDoubleLiteral},"get")});var Bq=CC();Object.defineProperty(m,"QueryPlanCache",{enumerable:!0,get:a(function(){return Bq.QueryPlanCache},"get")});var ER=RC();Object.defineProperty(m,"SPARQLResultCache",{enumerable:!0,get:a(function(){return ER.SPARQLResultCache},"get")});Object.defineProperty(m,"createSPARQLResultCache",{enumerable:!0,get:a(function(){return ER.createSPARQLResultCache},"get")});var TR=IC();Object.defineProperty(m,"IncrementalIndexer",{enumerable:!0,get:a(function(){return TR.IncrementalIndexer},"get")});Object.defineProperty(m,"createIncrementalIndexer",{enumerable:!0,get:a(function(){return TR.createIncrementalIndexer},"get")});var Uq=PC();Object.defineProperty(m,"ResultSerializer",{enumerable:!0,get:a(function(){return Uq.ResultSerializer},"get")});var AR=o1();Object.defineProperty(m,"CaseWhenTransformer",{enumerable:!0,get:a(function(){return AR.CaseWhenTransformer},"get")});Object.defineProperty(m,"CaseWhenTransformerError",{enumerable:!0,get:a(function(){return AR.CaseWhenTransformerError},"get")});var Vq=h1();Object.defineProperty(m,"VaultPrefixTransformer",{enumerable:!0,get:a(function(){return Vq.VaultPrefixTransformer},"get")});var qq=_b();Object.defineProperty(m,"FilterContainsOptimizer",{enumerable:!0,get:a(function(){return qq.FilterContainsOptimizer},"get")});var xR=OC();Object.defineProperty(m,"FileNotFoundError",{enumerable:!0,get:a(function(){return xR.FileNotFoundError},"get")});Object.defineProperty(m,"FileAlreadyExistsError",{enumerable:!0,get:a(function(){return xR.FileAlreadyExistsError},"get")});var gw=AS();Object.defineProperty(m,"TripleAlreadyExistsError",{enumerable:!0,get:a(function(){return gw.TripleAlreadyExistsError},"get")});Object.defineProperty(m,"TripleNotFoundError",{enumerable:!0,get:a(function(){return gw.TripleNotFoundError},"get")});Object.defineProperty(m,"TransactionError",{enumerable:!0,get:a(function(){return gw.TransactionError},"get")});var fg=Ob();Object.defineProperty(m,"VaultSettings",{enumerable:!0,get:a(function(){return fg.VaultSettings},"get")});Object.defineProperty(m,"DEFAULT_OWNER_IDENTITY",{enumerable:!0,get:a(function(){return fg.DEFAULT_OWNER_IDENTITY},"get")});Object.defineProperty(m,"DEFAULT_INBOX_FOLDER",{enumerable:!0,get:a(function(){return fg.DEFAULT_INBOX_FOLDER},"get")});Object.defineProperty(m,"DEFAULT_FLEETING_NOTE_CLASS_UID",{enumerable:!0,get:a(function(){return fg.DEFAULT_FLEETING_NOTE_CLASS_UID},"get")});var Wq=Et();Object.defineProperty(m,"DI_TOKENS",{enumerable:!0,get:a(function(){return Wq.DI_TOKENS},"get")});var Rf=FC();Object.defineProperty(m,"registerCoreServices",{enumerable:!0,get:a(function(){return Rf.registerCoreServices},"get")});Object.defineProperty(m,"createChildContainer",{enumerable:!0,get:a(function(){return Rf.createChildContainer},"get")});Object.defineProperty(m,"getContainer",{enumerable:!0,get:a(function(){return Rf.getContainer},"get")});Object.defineProperty(m,"resetContainer",{enumerable:!0,get:a(function(){return Rf.resetContainer},"get")});Object.defineProperty(m,"container",{enumerable:!0,get:a(function(){return Rf.container},"get")});var ho=jC();Object.defineProperty(m,"NODE_FLAGS",{enumerable:!0,get:a(function(){return ho.NODE_FLAGS},"get")});Object.defineProperty(m,"DEFAULT_COLORS",{enumerable:!0,get:a(function(){return ho.DEFAULT_COLORS},"get")});Object.defineProperty(m,"StringTable",{enumerable:!0,get:a(function(){return ho.StringTable},"get")});Object.defineProperty(m,"CompactGraphStore",{enumerable:!0,get:a(function(){return ho.CompactGraphStore},"get")});Object.defineProperty(m,"MemoryPool",{enumerable:!0,get:a(function(){return ho.MemoryPool},"get")});Object.defineProperty(m,"getGlobalPool",{enumerable:!0,get:a(function(){return ho.getGlobalPool},"get")});Object.defineProperty(m,"resetGlobalPool",{enumerable:!0,get:a(function(){return ho.resetGlobalPool},"get")});Object.defineProperty(m,"StreamingLoader",{enumerable:!0,get:a(function(){return ho.StreamingLoader},"get")});Object.defineProperty(m,"createStreamingSource",{enumerable:!0,get:a(function(){return ho.createStreamingSource},"get")});var CR=$C();Object.defineProperty(m,"ExoQL",{enumerable:!0,get:a(function(){return CR.ExoQL},"get")});Object.defineProperty(m,"ExoQLError",{enumerable:!0,get:a(function(){return CR.ExoQLError},"get")});var Fl=Hm();Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_IRI",{enumerable:!0,get:a(function(){return Fl.RELATION_COLUMN_SET_CLASS_IRI},"get")});Object.defineProperty(m,"RELATION_COLUMN_SET_CLASS_UID",{enumerable:!0,get:a(function(){return Fl.RELATION_COLUMN_SET_CLASS_UID},"get")});Object.defineProperty(m,"createRelationColumnSetFromFrontmatter",{enumerable:!0,get:a(function(){return Fl.createRelationColumnSetFromFrontmatter},"get")});Object.defineProperty(m,"isRelationColumnSet",{enumerable:!0,get:a(function(){return Fl.isRelationColumnSet},"get")});Object.defineProperty(m,"isRelationColumnSetFrontmatter",{enumerable:!0,get:a(function(){return Fl.isRelationColumnSetFrontmatter},"get")});Object.defineProperty(m,"normalizeRelationColumnSetRef",{enumerable:!0,get:a(function(){return Fl.normalizeRef},"get")});var Gq=QC();Object.defineProperty(m,"RelationColumnSetResolver",{enumerable:!0,get:a(function(){return Gq.RelationColumnSetResolver},"get")});var If=Hm();Object.defineProperty(m,"LAYOUT_CLASS_IRI",{enumerable:!0,get:a(function(){return If.LAYOUT_CLASS_IRI},"get")});Object.defineProperty(m,"LAYOUT_CLASS_UID",{enumerable:!0,get:a(function(){return If.LAYOUT_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutFromFrontmatter",{enumerable:!0,get:a(function(){return If.createLayoutFromFrontmatter},"get")});Object.defineProperty(m,"isLayout",{enumerable:!0,get:a(function(){return If.isLayout},"get")});Object.defineProperty(m,"isLayoutFrontmatter",{enumerable:!0,get:a(function(){return If.isLayoutFrontmatter},"get")});var Yo=Hm();Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Yo.BACKLINKS_TABLE_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"BACKLINKS_TABLE_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Yo.BACKLINKS_TABLE_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_IRI",{enumerable:!0,get:a(function(){return Yo.PROPERTIES_BLOCK_CLASS_IRI},"get")});Object.defineProperty(m,"PROPERTIES_BLOCK_CLASS_UID",{enumerable:!0,get:a(function(){return Yo.PROPERTIES_BLOCK_CLASS_UID},"get")});Object.defineProperty(m,"createLayoutBlockFromFrontmatter",{enumerable:!0,get:a(function(){return Yo.createLayoutBlockFromFrontmatter},"get")});Object.defineProperty(m,"isBacklinksTableBlock",{enumerable:!0,get:a(function(){return Yo.isBacklinksTableBlock},"get")});Object.defineProperty(m,"isLayoutBlockFrontmatter",{enumerable:!0,get:a(function(){return Yo.isLayoutBlockFrontmatter},"get")});Object.defineProperty(m,"isPropertiesBlock",{enumerable:!0,get:a(function(){return Yo.isPropertiesBlock},"get")});var RR=YC();Object.defineProperty(m,"LayoutSelector",{enumerable:!0,get:a(function(){return RR.LayoutSelector},"get")});Object.defineProperty(m,"selectByPriority",{enumerable:!0,get:a(function(){return RR.selectByPriority},"get")});ii(sR(),m);var zq=ow();Object.defineProperty(m,"ShapeLoader",{enumerable:!0,get:a(function(){return zq.ShapeLoader},"get")});var Hq=tw();Object.defineProperty(m,"ShapeRegistry",{enumerable:!0,get:a(function(){return Hq.ShapeRegistry},"get")});var Qq=lr();Object.defineProperty(m,"Namespace",{enumerable:!0,get:a(function(){return Qq.Namespace},"get")});var IR=cw();Object.defineProperty(m,"shaclValidate",{enumerable:!0,get:a(function(){return IR.validate},"get")});Object.defineProperty(m,"ShaclShapeRegistry",{enumerable:!0,get:a(function(){return IR.ShapeRegistry},"get")});ii(aR(),m);var yw=lR();Object.defineProperty(m,"ValidatorDaemon",{enumerable:!0,get:a(function(){return yw.ValidatorDaemon},"get")});Object.defineProperty(m,"DEFAULT_SOCKET_PATH",{enumerable:!0,get:a(function(){return yw.DEFAULT_SOCKET_PATH},"get")});Object.defineProperty(m,"IDLE_TIMEOUT_MS",{enumerable:!0,get:a(function(){return yw.IDLE_TIMEOUT_MS},"get")});var Kq=dw();Object.defineProperty(m,"TripleClassHierarchy",{enumerable:!0,get:a(function(){return Kq.ClassHierarchy},"get")})});var Er=S(_w=>{"use strict";_w.fromCallback=function(n){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")n.apply(this,e);else return new Promise((t,r)=>{e.push((i,s)=>i!=null?r(i):t(s)),n.apply(this,e)})},"name",{value:n.name})};_w.fromPromise=function(n){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return n.apply(this,e);e.pop(),n.apply(this,e).then(r=>t(null,r),t)},"name",{value:n.name})}});var OR=S((Kle,PR)=>{var Xo=require("constants"),Yq=process.cwd,dg=null,Xq=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return dg||(dg=Yq.call(process)),dg};try{process.cwd()}catch{}typeof process.chdir=="function"&&(Sw=process.chdir,process.chdir=function(n){dg=null,Sw.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Sw));var Sw;PR.exports=Jq;function Jq(n){Xo.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=s(n.chown),n.fchown=s(n.fchown),n.lchown=s(n.lchown),n.chmod=r(n.chmod),n.fchmod=r(n.fchmod),n.lchmod=r(n.lchmod),n.chownSync=o(n.chownSync),n.fchownSync=o(n.fchownSync),n.lchownSync=o(n.lchownSync),n.chmodSync=i(n.chmodSync),n.fchmodSync=i(n.fchmodSync),n.lchmodSync=i(n.lchmodSync),n.stat=c(n.stat),n.fstat=c(n.fstat),n.lstat=c(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.chmod&&!n.lchmod&&(n.lchmod=function(f,d,h){h&&process.nextTick(h)},n.lchmodSync=function(){}),n.chown&&!n.lchown&&(n.lchown=function(f,d,h,p){p&&process.nextTick(p)},n.lchownSync=function(){}),Xq==="win32"&&(n.rename=typeof n.rename!="function"?n.rename:(function(f){function d(h,p,y){var v=Date.now(),b=0;f(h,p,a(function w(T){if(T&&(T.code==="EACCES"||T.code==="EPERM"||T.code==="EBUSY")&&Date.now()-v<6e4){setTimeout(function(){n.stat(p,function(I,$){I&&I.code==="ENOENT"?f(h,p,w):y(T)})},b),b<100&&(b+=10);return}y&&y(T)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.rename)),n.read=typeof n.read!="function"?n.read:(function(f){function d(h,p,y,v,b,w){var T;if(w&&typeof w=="function"){var I=0;T=a(function($,q,ce){if($&&$.code==="EAGAIN"&&I<10)return I++,f.call(n,h,p,y,v,b,T);w.apply(this,arguments)},"callback")}return f.call(n,h,p,y,v,b,T)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(n.read),n.readSync=typeof n.readSync!="function"?n.readSync:(function(f){return function(d,h,p,y,v){for(var b=0;;)try{return f.call(n,d,h,p,y,v)}catch(w){if(w.code==="EAGAIN"&&b<10){b++;continue}throw w}}})(n.readSync);function e(f){f.lchmod=function(d,h,p){f.open(d,Xo.O_WRONLY|Xo.O_SYMLINK,h,function(y,v){if(y){p&&p(y);return}f.fchmod(v,h,function(b){f.close(v,function(w){p&&p(b||w)})})})},f.lchmodSync=function(d,h){var p=f.openSync(d,Xo.O_WRONLY|Xo.O_SYMLINK,h),y=!0,v;try{v=f.fchmodSync(p,h),y=!1}finally{if(y)try{f.closeSync(p)}catch{}else f.closeSync(p)}return v}}a(e,"patchLchmod");function t(f){Xo.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,h,p,y){f.open(d,Xo.O_SYMLINK,function(v,b){if(v){y&&y(v);return}f.futimes(b,h,p,function(w){f.close(b,function(T){y&&y(w||T)})})})},f.lutimesSync=function(d,h,p){var y=f.openSync(d,Xo.O_SYMLINK),v,b=!0;try{v=f.futimesSync(y,h,p),b=!1}finally{if(b)try{f.closeSync(y)}catch{}else f.closeSync(y)}return v}):f.futimes&&(f.lutimes=function(d,h,p,y){y&&process.nextTick(y)},f.lutimesSync=function(){})}a(t,"patchLutimes");function r(f){return f&&function(d,h,p){return f.call(n,d,h,function(y){u(y)&&(y=null),p&&p.apply(this,arguments)})}}a(r,"chmodFix");function i(f){return f&&function(d,h){try{return f.call(n,d,h)}catch(p){if(!u(p))throw p}}}a(i,"chmodFixSync");function s(f){return f&&function(d,h,p,y){return f.call(n,d,h,p,function(v){u(v)&&(v=null),y&&y.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,h,p){try{return f.call(n,d,h,p)}catch(y){if(!u(y))throw y}}}a(o,"chownFixSync");function c(f){return f&&function(d,h,p){typeof h=="function"&&(p=h,h=null);function y(v,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),p&&p.apply(this,arguments)}return a(y,"callback"),h?f.call(n,d,h,y):f.call(n,d,y)}}a(c,"statFix");function l(f){return f&&function(d,h){var p=h?f.call(n,d,h):f.call(n,d);return p&&(p.uid<0&&(p.uid+=4294967296),p.gid<0&&(p.gid+=4294967296)),p}}a(l,"statFixSync");function u(f){if(!f||f.code==="ENOSYS")return!0;var d=!process.getuid||process.getuid()!==0;return!!(d&&(f.code==="EINVAL"||f.code==="EPERM"))}a(u,"chownErOk")}a(Jq,"patch")});var NR=S((Xle,DR)=>{var FR=require("stream").Stream;DR.exports=Zq;function Zq(n){return{ReadStream:e,WriteStream:t};function e(r,i){if(!(this instanceof e))return new e(r,i);FR.call(this);var s=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),c=0,l=o.length;c<l;c++){var u=o[c];this[u]=i[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){s._read()});return}n.open(this.path,this.flags,this.mode,function(f,d){if(f){s.emit("error",f),s.readable=!1;return}s.fd=d,s.emit("open",d),s._read()})}function t(r,i){if(!(this instanceof t))return new t(r,i);FR.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,c=s.length;o<c;o++){var l=s[o];this[l]=i[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=n.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(Zq,"legacy")});var kR=S((Zle,LR)=>{"use strict";LR.exports=tW;var eW=Object.getPrototypeOf||function(n){return n.__proto__};function tW(n){if(n===null||typeof n!="object")return n;if(n instanceof Object)var e={__proto__:eW(n)};else var e=Object.create(null);return Object.getOwnPropertyNames(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}),e}a(tW,"clone")});var Nl=S((tue,ww)=>{var Bt=require("fs"),rW=OR(),nW=NR(),iW=kR(),hg=require("util"),$r,mg;typeof Symbol=="function"&&typeof Symbol.for=="function"?($r=Symbol.for("graceful-fs.queue"),mg=Symbol.for("graceful-fs.previous")):($r="___graceful-fs.queue",mg="___graceful-fs.previous");function sW(){}a(sW,"noop");function $R(n,e){Object.defineProperty(n,$r,{get:a(function(){return e},"get")})}a($R,"publishQueue");var Xa=sW;hg.debuglog?Xa=hg.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Xa=a(function(){var n=hg.format.apply(hg,arguments);n="GFS4: "+n.split(/\n/).join(`
458
+ GFS4: `),console.error(n)},"debug"));Bt[$r]||(MR=global[$r]||[],$R(Bt,MR),Bt.close=(function(n){function e(t,r){return n.call(Bt,t,function(i){i||jR(),typeof r=="function"&&r.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,mg,{value:n}),e})(Bt.close),Bt.closeSync=(function(n){function e(t){n.apply(Bt,arguments),jR()}return a(e,"closeSync"),Object.defineProperty(e,mg,{value:n}),e})(Bt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Xa(Bt[$r]),require("assert").equal(Bt[$r].length,0)}));var MR;global[$r]||$R(global,Bt[$r]);ww.exports=vw(iW(Bt));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Bt.__patched&&(ww.exports=vw(Bt),Bt.__patched=!0);function vw(n){rW(n),n.gracefulify=vw,n.createReadStream=q,n.createWriteStream=ce;var e=n.readFile;n.readFile=t;function t(F,k,te){return typeof k=="function"&&(te=k,k=null),Ye(F,k,te);function Ye(at,Ft,ct,ut){return e(at,Ft,function(Xe){Xe&&(Xe.code==="EMFILE"||Xe.code==="ENFILE")?Dl([Ye,[at,Ft,ct],Xe,ut||Date.now(),Date.now()]):typeof ct=="function"&&ct.apply(this,arguments)})}a(Ye,"go$readFile")}a(t,"readFile");var r=n.writeFile;n.writeFile=i;function i(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return r(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$writeFile")}a(i,"writeFile");var s=n.appendFile;s&&(n.appendFile=o);function o(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return s(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$appendFile")}a(o,"appendFile");var c=n.copyFile;c&&(n.copyFile=l);function l(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=0),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return c(Ft,ct,ut,function(W){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$copyFile")}a(l,"copyFile");var u=n.readdir;n.readdir=d;var f=/^v[0-5]\./;function d(F,k,te){typeof k=="function"&&(te=k,k=null);var Ye=f.test(process.version)?a(function(ct,ut,Xe,ie){return u(ct,at(ct,ut,Xe,ie))},"go$readdir"):a(function(ct,ut,Xe,ie){return u(ct,ut,at(ct,ut,Xe,ie))},"go$readdir");return Ye(F,k,te);function at(Ft,ct,ut,Xe){return function(ie,W){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Dl([Ye,[Ft,ct,ut],ie,Xe||Date.now(),Date.now()]):(W&&W.sort&&W.sort(),typeof ut=="function"&&ut.call(this,ie,W))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var h=nW(n);w=h.ReadStream,I=h.WriteStream}var p=n.ReadStream;p&&(w.prototype=Object.create(p.prototype),w.prototype.open=T);var y=n.WriteStream;y&&(I.prototype=Object.create(y.prototype),I.prototype.open=$),Object.defineProperty(n,"ReadStream",{get:a(function(){return w},"get"),set:a(function(F){w=F},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:a(function(){return I},"get"),set:a(function(F){I=F},"set"),enumerable:!0,configurable:!0});var v=w;Object.defineProperty(n,"FileReadStream",{get:a(function(){return v},"get"),set:a(function(F){v=F},"set"),enumerable:!0,configurable:!0});var b=I;Object.defineProperty(n,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(F){b=F},"set"),enumerable:!0,configurable:!0});function w(F,k){return this instanceof w?(p.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}a(w,"ReadStream");function T(){var F=this;V(F.path,F.flags,F.mode,function(k,te){k?(F.autoClose&&F.destroy(),F.emit("error",k)):(F.fd=te,F.emit("open",te),F.read())})}a(T,"ReadStream$open");function I(F,k){return this instanceof I?(y.apply(this,arguments),this):I.apply(Object.create(I.prototype),arguments)}a(I,"WriteStream");function $(){var F=this;V(F.path,F.flags,F.mode,function(k,te){k?(F.destroy(),F.emit("error",k)):(F.fd=te,F.emit("open",te))})}a($,"WriteStream$open");function q(F,k){return new n.ReadStream(F,k)}a(q,"createReadStream");function ce(F,k){return new n.WriteStream(F,k)}a(ce,"createWriteStream");var B=n.open;n.open=V;function V(F,k,te,Ye){return typeof te=="function"&&(Ye=te,te=null),at(F,k,te,Ye);function at(Ft,ct,ut,Xe,ie){return B(Ft,ct,ut,function(W,ft){W&&(W.code==="EMFILE"||W.code==="ENFILE")?Dl([at,[Ft,ct,ut,Xe],W,ie||Date.now(),Date.now()]):typeof Xe=="function"&&Xe.apply(this,arguments)})}a(at,"go$open")}return a(V,"open"),n}a(vw,"patch");function Dl(n){Xa("ENQUEUE",n[0].name,n[1]),Bt[$r].push(n),bw()}a(Dl,"enqueue");var pg;function jR(){for(var n=Date.now(),e=0;e<Bt[$r].length;++e)Bt[$r][e].length>2&&(Bt[$r][e][3]=n,Bt[$r][e][4]=n);bw()}a(jR,"resetQueue");function bw(){if(clearTimeout(pg),pg=void 0,Bt[$r].length!==0){var n=Bt[$r].shift(),e=n[0],t=n[1],r=n[2],i=n[3],s=n[4];if(i===void 0)Xa("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){Xa("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,r)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(Xa("RETRY",e.name,t),e.apply(null,t.concat([i]))):Bt[$r].push(n)}pg===void 0&&(pg=setTimeout(bw,0))}}a(bw,"retry")});var yn=S(po=>{"use strict";var BR=Er().fromCallback,gn=Nl(),oW=["access","appendFile","chmod","chown","close","copyFile","cp","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","glob","lchmod","lchown","lutimes","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","utimes","writeFile"].filter(n=>typeof gn[n]=="function");Object.assign(po,gn);oW.forEach(n=>{po[n]=BR(gn[n])});po.exists=function(n,e){return typeof e=="function"?gn.exists(n,e):new Promise(t=>gn.exists(n,t))};po.read=function(n,e,t,r,i,s){return typeof s=="function"?gn.read(n,e,t,r,i,s):new Promise((o,c)=>{gn.read(n,e,t,r,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};po.write=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.write(n,e,...t):new Promise((r,i)=>{gn.write(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffer:c})})})};po.readv=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.readv(n,e,...t):new Promise((r,i)=>{gn.readv(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesRead:o,buffers:c})})})};po.writev=function(n,e,...t){return typeof t[t.length-1]=="function"?gn.writev(n,e,...t):new Promise((r,i)=>{gn.writev(n,e,...t,(s,o,c)=>{if(s)return i(s);r({bytesWritten:o,buffers:c})})})};typeof gn.realpath.native=="function"?po.realpath.native=BR(gn.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var VR=S((iue,UR)=>{"use strict";var aW=require("path");UR.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(aW.parse(e).root,""))){let r=new Error(`Path contains invalid characters: ${e}`);throw r.code="EINVAL",r}},"checkPath")});var zR=S((oue,Ew)=>{"use strict";var qR=yn(),{checkPath:WR}=VR(),GR=a(n=>{let e={mode:511};return typeof n=="number"?n:{...e,...n}.mode},"getMode");Ew.exports.makeDir=async(n,e)=>(WR(n),qR.mkdir(n,{mode:GR(e),recursive:!0}));Ew.exports.makeDirSync=(n,e)=>(WR(n),qR.mkdirSync(n,{mode:GR(e),recursive:!0}))});var Vi=S((cue,HR)=>{"use strict";var cW=Er().fromPromise,{makeDir:lW,makeDirSync:Tw}=zR(),Aw=cW(lW);HR.exports={mkdirs:Aw,mkdirsSync:Tw,mkdirp:Aw,mkdirpSync:Tw,ensureDir:Aw,ensureDirSync:Tw}});var Jo=S((lue,KR)=>{"use strict";var uW=Er().fromPromise,QR=yn();function fW(n){return QR.access(n).then(()=>!0).catch(()=>!1)}a(fW,"pathExists");KR.exports={pathExists:uW(fW),pathExistsSync:QR.existsSync}});var xw=S((fue,YR)=>{"use strict";var Ll=yn(),dW=Er().fromPromise;async function hW(n,e,t){let r=await Ll.open(n,"r+"),i=null;try{await Ll.futimes(r,e,t)}finally{try{await Ll.close(r)}catch(s){i=s}}if(i)throw i}a(hW,"utimesMillis");function pW(n,e,t){let r=Ll.openSync(n,"r+");return Ll.futimesSync(r,e,t),Ll.closeSync(r)}a(pW,"utimesMillisSync");YR.exports={utimesMillis:dW(hW),utimesMillisSync:pW}});var Ja=S((hue,eI)=>{"use strict";var kl=yn(),Tr=require("path"),XR=Er().fromPromise;function mW(n,e,t){let r=t.dereference?i=>kl.stat(i,{bigint:!0}):i=>kl.lstat(i,{bigint:!0});return Promise.all([r(n),r(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(mW,"getStats");function gW(n,e,t){let r,i=t.dereference?o=>kl.statSync(o,{bigint:!0}):o=>kl.lstatSync(o,{bigint:!0}),s=i(n);try{r=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:r}}a(gW,"getStatsSync");async function yW(n,e,t,r){let{srcStat:i,destStat:s}=await mW(n,e,r);if(s){if(Pf(i,s)){let o=Tr.basename(n),c=Tr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&Cw(n,e))throw new Error(gg(n,e,t));return{srcStat:i,destStat:s}}a(yW,"checkPaths");function _W(n,e,t,r){let{srcStat:i,destStat:s}=gW(n,e,r);if(s){if(Pf(i,s)){let o=Tr.basename(n),c=Tr.basename(e);if(t==="move"&&o!==c&&o.toLowerCase()===c.toLowerCase())return{srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${n}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${n}'.`)}if(i.isDirectory()&&Cw(n,e))throw new Error(gg(n,e,t));return{srcStat:i,destStat:s}}a(_W,"checkPathsSync");async function JR(n,e,t,r){let i=Tr.resolve(Tr.dirname(n)),s=Tr.resolve(Tr.dirname(t));if(s===i||s===Tr.parse(s).root)return;let o;try{o=await kl.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Pf(e,o))throw new Error(gg(n,t,r));return JR(n,e,s,r)}a(JR,"checkParentPaths");function ZR(n,e,t,r){let i=Tr.resolve(Tr.dirname(n)),s=Tr.resolve(Tr.dirname(t));if(s===i||s===Tr.parse(s).root)return;let o;try{o=kl.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return;throw c}if(Pf(e,o))throw new Error(gg(n,t,r));return ZR(n,e,s,r)}a(ZR,"checkParentPathsSync");function Pf(n,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===n.ino&&e.dev===n.dev}a(Pf,"areIdentical");function Cw(n,e){let t=Tr.resolve(n).split(Tr.sep).filter(i=>i),r=Tr.resolve(e).split(Tr.sep).filter(i=>i);return t.every((i,s)=>r[s]===i)}a(Cw,"isSrcSubdir");function gg(n,e,t){return`Cannot ${t} '${n}' to a subdirectory of itself, '${e}'.`}a(gg,"errMsg");eI.exports={checkPaths:XR(yW),checkPathsSync:_W,checkParentPaths:XR(JR),checkParentPathsSync:ZR,isSrcSubdir:Cw,areIdentical:Pf}});var rI=S((mue,tI)=>{"use strict";async function SW(n,e){let t=[];for await(let r of n)t.push(e(r).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(r=>r.then(i=>{if(i!==null)throw i})))}a(SW,"asyncIteratorConcurrentProcess");tI.exports={asyncIteratorConcurrentProcess:SW}});var aI=S((yue,oI)=>{"use strict";var Jr=yn(),Of=require("path"),{mkdirs:vW}=Vi(),{pathExists:bW}=Jo(),{utimesMillis:wW}=xw(),Ff=Ja(),{asyncIteratorConcurrentProcess:EW}=rI();async function TW(n,e,t={}){typeof t=="function"&&(t={filter:t}),t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
459
459
 
460
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await Ff.checkPaths(n,e,"copy",t);if(await Ff.checkParentPaths(n,r,e,"copy"),!await iI(n,e,t))return;let o=Of.dirname(e);await vW(o)||await SW(o),await sI(i,n,e,t)}a(EW,"copy");async function iI(n,e,t){return t.filter?t.filter(n,e):!0}a(iI,"runFilter");async function sI(n,e,t,r){let s=await(r.dereference?Jr.stat:Jr.lstat)(e);if(s.isDirectory())return CW(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return TW(s,n,e,t,r);if(s.isSymbolicLink())return RW(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(sI,"getStatsAndPerformCopy");async function TW(n,e,t,r,i){if(!e)return nI(n,t,r,i);if(i.overwrite)return await Jr.unlink(r),nI(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}a(TW,"onFile");async function nI(n,e,t,r){if(await Jr.copyFile(e,t),r.preserveTimestamps){AW(n.mode)&&await xW(t,n.mode);let i=await Jr.stat(e);await bW(t,i.atime,i.mtime)}return Jr.chmod(t,n.mode)}a(nI,"copyFile");function AW(n){return(n&128)===0}a(AW,"fileIsNotWritable");function xW(n,e){return Jr.chmod(n,e|128)}a(xW,"makeFileWritable");async function CW(n,e,t,r,i){e||await Jr.mkdir(r),await wW(await Jr.opendir(t),async s=>{let o=Of.join(t,s.name),c=Of.join(r,s.name);if(await iI(o,c,i)){let{destStat:u}=await Ff.checkPaths(o,c,"copy",i);await sI(u,o,c,i)}}),e||await Jr.chmod(r,n.mode)}a(CW,"onDir");async function RW(n,e,t,r){let i=await Jr.readlink(e);if(r.dereference&&(i=Of.resolve(process.cwd(),i)),!n)return Jr.symlink(i,t);let s=null;try{s=await Jr.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Jr.symlink(i,t);throw o}if(r.dereference&&(s=Of.resolve(process.cwd(),s)),Ff.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ff.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Jr.unlink(t),Jr.symlink(i,t)}a(RW,"onLink");oI.exports=EW});var dI=S((_ue,fI)=>{"use strict";var _n=Nl(),Df=require("path"),IW=Vi().mkdirsSync,PW=xw().utimesMillisSync,Nf=Ja();function OW(n,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
460
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:r,destStat:i}=await Ff.checkPaths(n,e,"copy",t);if(await Ff.checkParentPaths(n,r,e,"copy"),!await iI(n,e,t))return;let o=Of.dirname(e);await bW(o)||await vW(o),await sI(i,n,e,t)}a(TW,"copy");async function iI(n,e,t){return t.filter?t.filter(n,e):!0}a(iI,"runFilter");async function sI(n,e,t,r){let s=await(r.dereference?Jr.stat:Jr.lstat)(e);if(s.isDirectory())return RW(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return AW(s,n,e,t,r);if(s.isSymbolicLink())return IW(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(sI,"getStatsAndPerformCopy");async function AW(n,e,t,r,i){if(!e)return nI(n,t,r,i);if(i.overwrite)return await Jr.unlink(r),nI(n,t,r,i);if(i.errorOnExist)throw new Error(`'${r}' already exists`)}a(AW,"onFile");async function nI(n,e,t,r){if(await Jr.copyFile(e,t),r.preserveTimestamps){xW(n.mode)&&await CW(t,n.mode);let i=await Jr.stat(e);await wW(t,i.atime,i.mtime)}return Jr.chmod(t,n.mode)}a(nI,"copyFile");function xW(n){return(n&128)===0}a(xW,"fileIsNotWritable");function CW(n,e){return Jr.chmod(n,e|128)}a(CW,"makeFileWritable");async function RW(n,e,t,r,i){e||await Jr.mkdir(r),await EW(await Jr.opendir(t),async s=>{let o=Of.join(t,s.name),c=Of.join(r,s.name);if(await iI(o,c,i)){let{destStat:u}=await Ff.checkPaths(o,c,"copy",i);await sI(u,o,c,i)}}),e||await Jr.chmod(r,n.mode)}a(RW,"onDir");async function IW(n,e,t,r){let i=await Jr.readlink(e);if(r.dereference&&(i=Of.resolve(process.cwd(),i)),!n)return Jr.symlink(i,t);let s=null;try{s=await Jr.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Jr.symlink(i,t);throw o}if(r.dereference&&(s=Of.resolve(process.cwd(),s)),Ff.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Ff.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Jr.unlink(t),Jr.symlink(i,t)}a(IW,"onLink");oI.exports=TW});var dI=S((Sue,fI)=>{"use strict";var _n=Nl(),Df=require("path"),PW=Vi().mkdirsSync,OW=xw().utimesMillisSync,Nf=Ja();function FW(n,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
461
461
 
462
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=Nf.checkPathsSync(n,e,"copy",t);if(Nf.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=Df.dirname(e);return _n.existsSync(s)||IW(s),cI(i,n,e,t)}a(OW,"copySync");function cI(n,e,t,r){let s=(r.dereference?_n.statSync:_n.lstatSync)(e);if(s.isDirectory())return jW(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return FW(s,n,e,t,r);if(s.isSymbolicLink())return UW(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(cI,"getStats");function FW(n,e,t,r,i){return e?DW(n,t,r,i):lI(n,t,r,i)}a(FW,"onFile");function DW(n,e,t,r){if(r.overwrite)return _n.unlinkSync(t),lI(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}a(DW,"mayCopyFile");function lI(n,e,t,r){return _n.copyFileSync(e,t),r.preserveTimestamps&&NW(n.mode,e,t),Rw(t,n.mode)}a(lI,"copyFile");function NW(n,e,t){return LW(n)&&kW(t,n),MW(e,t)}a(NW,"handleTimestamps");function LW(n){return(n&128)===0}a(LW,"fileIsNotWritable");function kW(n,e){return Rw(n,e|128)}a(kW,"makeFileWritable");function Rw(n,e){return _n.chmodSync(n,e)}a(Rw,"setDestMode");function MW(n,e){let t=_n.statSync(n);return PW(e,t.atime,t.mtime)}a(MW,"setDestTimestamps");function jW(n,e,t,r,i){return e?uI(t,r,i):$W(n.mode,t,r,i)}a(jW,"onDir");function $W(n,e,t,r){return _n.mkdirSync(t),uI(e,t,r),Rw(t,n)}a($W,"mkDirAndCopy");function uI(n,e,t){let r=_n.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)BW(i.name,n,e,t)}finally{r.closeSync()}}a(uI,"copyDir");function BW(n,e,t,r){let i=Df.join(e,n),s=Df.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:o}=Nf.checkPathsSync(i,s,"copy",r);return cI(o,i,s,r)}a(BW,"copyDirItem");function UW(n,e,t,r){let i=_n.readlinkSync(e);if(r.dereference&&(i=Df.resolve(process.cwd(),i)),n){let s;try{s=_n.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return _n.symlinkSync(i,t);throw o}if(r.dereference&&(s=Df.resolve(process.cwd(),s)),Nf.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Nf.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return VW(i,t)}else return _n.symlinkSync(i,t)}a(UW,"onLink");function VW(n,e){return _n.unlinkSync(e),_n.symlinkSync(n,e)}a(VW,"copyLink");fI.exports=OW});var yg=S((vue,hI)=>{"use strict";var qW=Er().fromPromise;hI.exports={copy:qW(aI()),copySync:dI()}});var Lf=S((bue,mI)=>{"use strict";var pI=Nl(),WW=Er().fromCallback;function GW(n,e){pI.rm(n,{recursive:!0,force:!0},e)}a(GW,"remove");function zW(n){pI.rmSync(n,{recursive:!0,force:!0})}a(zW,"removeSync");mI.exports={remove:WW(GW),removeSync:zW}});var EI=S((Eue,wI)=>{"use strict";var HW=Er().fromPromise,_I=yn(),SI=require("path"),vI=Vi(),bI=Lf(),gI=HW(a(async function(e){let t;try{t=await _I.readdir(e)}catch{return vI.mkdirs(e)}return Promise.all(t.map(r=>bI.remove(SI.join(e,r))))},"emptyDir"));function yI(n){let e;try{e=_I.readdirSync(n)}catch{return vI.mkdirsSync(n)}e.forEach(t=>{t=SI.join(n,t),bI.removeSync(t)})}a(yI,"emptyDirSync");wI.exports={emptyDirSync:yI,emptydirSync:yI,emptyDir:gI,emptydir:gI}});var CI=S((Aue,xI)=>{"use strict";var QW=Er().fromPromise,TI=require("path"),mo=yn(),AI=Vi();async function KW(n){let e;try{e=await mo.stat(n)}catch{}if(e&&e.isFile())return;let t=TI.dirname(n),r=null;try{r=await mo.stat(t)}catch(i){if(i.code==="ENOENT"){await AI.mkdirs(t),await mo.writeFile(n,"");return}else throw i}r.isDirectory()?await mo.writeFile(n,""):await mo.readdir(t)}a(KW,"createFile");function YW(n){let e;try{e=mo.statSync(n)}catch{}if(e&&e.isFile())return;let t=TI.dirname(n);try{mo.statSync(t).isDirectory()||mo.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")AI.mkdirsSync(t);else throw r}mo.writeFileSync(n,"")}a(YW,"createFileSync");xI.exports={createFile:QW(KW),createFileSync:YW}});var FI=S((Cue,OI)=>{"use strict";var XW=Er().fromPromise,RI=require("path"),Zo=yn(),II=Vi(),{pathExists:JW}=Jo(),{areIdentical:PI}=Ja();async function ZW(n,e){let t;try{t=await Zo.lstat(e)}catch{}let r;try{r=await Zo.lstat(n)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&PI(r,t))return;let i=RI.dirname(e);await JW(i)||await II.mkdirs(i),await Zo.link(n,e)}a(ZW,"createLink");function eG(n,e){let t;try{t=Zo.lstatSync(e)}catch{}try{let s=Zo.lstatSync(n);if(t&&PI(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=RI.dirname(e);return Zo.existsSync(r)||II.mkdirsSync(r),Zo.linkSync(n,e)}a(eG,"createLinkSync");OI.exports={createLink:XW(ZW),createLinkSync:eG}});var NI=S((Iue,DI)=>{"use strict";var ea=require("path"),kf=yn(),{pathExists:tG}=Jo(),rG=Er().fromPromise;async function nG(n,e){if(ea.isAbsolute(n)){try{await kf.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=ea.dirname(e),r=ea.join(t,n);if(await tG(r))return{toCwd:r,toDst:n};try{await kf.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:ea.relative(t,n)}}a(nG,"symlinkPaths");function iG(n,e){if(ea.isAbsolute(n)){if(!kf.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=ea.dirname(e),r=ea.join(t,n);if(kf.existsSync(r))return{toCwd:r,toDst:n};if(!kf.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:ea.relative(t,n)}}a(iG,"symlinkPathsSync");DI.exports={symlinkPaths:rG(nG),symlinkPathsSync:iG}});var MI=S((Oue,kI)=>{"use strict";var LI=yn(),sG=Er().fromPromise;async function oG(n,e){if(e)return e;let t;try{t=await LI.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(oG,"symlinkType");function aG(n,e){if(e)return e;let t;try{t=LI.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(aG,"symlinkTypeSync");kI.exports={symlinkType:sG(oG),symlinkTypeSync:aG}});var UI=S((Due,BI)=>{"use strict";var cG=Er().fromPromise,jI=require("path"),As=yn(),{mkdirs:lG,mkdirsSync:uG}=Vi(),{symlinkPaths:fG,symlinkPathsSync:dG}=NI(),{symlinkType:hG,symlinkTypeSync:pG}=MI(),{pathExists:mG}=Jo(),{areIdentical:$I}=Ja();async function gG(n,e,t){let r;try{r=await As.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([As.stat(n),As.stat(e)]);if($I(c,l))return}let i=await fG(n,e);n=i.toDst;let s=await hG(i.toCwd,t),o=jI.dirname(e);return await mG(o)||await lG(o),As.symlink(n,e,s)}a(gG,"createSymlink");function yG(n,e,t){let r;try{r=As.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=As.statSync(n),l=As.statSync(e);if($I(c,l))return}let i=dG(n,e);n=i.toDst,t=pG(i.toCwd,t);let s=jI.dirname(e);return As.existsSync(s)||uG(s),As.symlinkSync(n,e,t)}a(yG,"createSymlinkSync");BI.exports={createSymlink:cG(gG),createSymlinkSync:yG}});var KI=S((Lue,QI)=>{"use strict";var{createFile:VI,createFileSync:qI}=CI(),{createLink:WI,createLinkSync:GI}=FI(),{createSymlink:zI,createSymlinkSync:HI}=UI();QI.exports={createFile:VI,createFileSync:qI,ensureFile:VI,ensureFileSync:qI,createLink:WI,createLinkSync:GI,ensureLink:WI,ensureLinkSync:GI,createSymlink:zI,createSymlinkSync:HI,ensureSymlink:zI,ensureSymlinkSync:HI}});var _g=S((kue,YI)=>{function _G(n,{EOL:e=`
463
- `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}a(_G,"stringify");function SG(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}a(SG,"stripBom");YI.exports={stringify:_G,stripBom:SG}});var eP=S((jue,ZI)=>{var Ml;try{Ml=Nl()}catch{Ml=require("fs")}var Sg=Er(),{stringify:XI,stripBom:JI}=_g();async function vG(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ml,r="throws"in e?e.throws:!0,i=await Sg.fromCallback(t.readFile)(n,e);i=JI(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(r)throw o.message=`${n}: ${o.message}`,o;return null}return s}a(vG,"_readFile");var bG=Sg.fromPromise(vG);function wG(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ml,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=JI(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}a(wG,"readFileSync");async function EG(n,e,t={}){let r=t.fs||Ml,i=XI(e,t);await Sg.fromCallback(r.writeFile)(n,i,t)}a(EG,"_writeFile");var TG=Sg.fromPromise(EG);function AG(n,e,t={}){let r=t.fs||Ml,i=XI(e,t);return r.writeFileSync(n,i,t)}a(AG,"writeFileSync");ZI.exports={readFile:bG,readFileSync:wG,writeFile:TG,writeFileSync:AG}});var rP=S((Bue,tP)=>{"use strict";var vg=eP();tP.exports={readJson:vg.readFile,readJsonSync:vg.readFileSync,writeJson:vg.writeFile,writeJsonSync:vg.writeFileSync}});var bg=S((Uue,sP)=>{"use strict";var xG=Er().fromPromise,Iw=yn(),nP=require("path"),iP=Vi(),CG=Jo().pathExists;async function RG(n,e,t="utf-8"){let r=nP.dirname(n);return await CG(r)||await iP.mkdirs(r),Iw.writeFile(n,e,t)}a(RG,"outputFile");function IG(n,...e){let t=nP.dirname(n);Iw.existsSync(t)||iP.mkdirsSync(t),Iw.writeFileSync(n,...e)}a(IG,"outputFileSync");sP.exports={outputFile:xG(RG),outputFileSync:IG}});var aP=S((que,oP)=>{"use strict";var{stringify:PG}=_g(),{outputFile:OG}=bg();async function FG(n,e,t={}){let r=PG(e,t);await OG(n,r,t)}a(FG,"outputJson");oP.exports=FG});var lP=S((Gue,cP)=>{"use strict";var{stringify:DG}=_g(),{outputFileSync:NG}=bg();function LG(n,e,t){let r=DG(e,t);NG(n,r,t)}a(LG,"outputJsonSync");cP.exports=LG});var fP=S((Hue,uP)=>{"use strict";var kG=Er().fromPromise,Sn=rP();Sn.outputJson=kG(aP());Sn.outputJsonSync=lP();Sn.outputJSON=Sn.outputJson;Sn.outputJSONSync=Sn.outputJsonSync;Sn.writeJSON=Sn.writeJson;Sn.writeJSONSync=Sn.writeJsonSync;Sn.readJSON=Sn.readJson;Sn.readJSONSync=Sn.readJsonSync;uP.exports=Sn});var gP=S((Que,mP)=>{"use strict";var MG=yn(),dP=require("path"),{copy:jG}=yg(),{remove:pP}=Lf(),{mkdirp:$G}=Vi(),{pathExists:BG}=Jo(),hP=Ja();async function UG(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await hP.checkPaths(n,e,"move",t);await hP.checkParentPaths(n,i,e,"move");let o=dP.dirname(e);return dP.parse(o).root!==o&&await $G(o),VG(n,e,r,s)}a(UG,"move");async function VG(n,e,t,r){if(!r){if(t)await pP(e);else if(await BG(e))throw new Error("dest already exists.")}try{await MG.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await qG(n,e,t)}}a(VG,"doRename");async function qG(n,e,t){return await jG(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),pP(n)}a(qG,"moveAcrossDevice");mP.exports=UG});var bP=S((Yue,vP)=>{"use strict";var _P=Nl(),Ow=require("path"),WG=yg().copySync,SP=Lf().removeSync,GG=Vi().mkdirpSync,yP=Ja();function zG(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=yP.checkPathsSync(n,e,"move",t);return yP.checkParentPathsSync(n,i,e,"move"),HG(e)||GG(Ow.dirname(e)),QG(n,e,r,s)}a(zG,"moveSync");function HG(n){let e=Ow.dirname(n);return Ow.parse(e).root===e}a(HG,"isParentRoot");function QG(n,e,t,r){if(r)return Pw(n,e,t);if(t)return SP(e),Pw(n,e,t);if(_P.existsSync(e))throw new Error("dest already exists.");return Pw(n,e,t)}a(QG,"doRename");function Pw(n,e,t){try{_P.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return KG(n,e,t)}}a(Pw,"rename");function KG(n,e,t){return WG(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),SP(n)}a(KG,"moveAcrossDevice");vP.exports=zG});var EP=S((Jue,wP)=>{"use strict";var YG=Er().fromPromise;wP.exports={move:YG(gP()),moveSync:bP()}});var go=S((Zue,TP)=>{"use strict";TP.exports={...yn(),...yg(),...EI(),...KI(),...fP(),...Vi(),...EP(),...bg(),...Jo(),...Lf()}});var FO=S((rfe,OO)=>{"use strict";OO.exports=IO;function IO(n,e,t){n instanceof RegExp&&(n=RO(n,t)),e instanceof RegExp&&(e=RO(e,t));var r=PO(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}a(IO,"balanced");function RO(n,e){var t=e.match(n);return t?t[0]:null}a(RO,"maybeMatch");IO.range=PO;function PO(n,e,t){var r,i,s,o,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,o=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,o])}return c}a(PO,"range")});var BO=S((ife,$O)=>{var DO=FO();$O.exports=_Q;var NO="\0SLASH"+Math.random()+"\0",LO="\0OPEN"+Math.random()+"\0",Hw="\0CLOSE"+Math.random()+"\0",kO="\0COMMA"+Math.random()+"\0",MO="\0PERIOD"+Math.random()+"\0";function zw(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}a(zw,"numeric");function gQ(n){return n.split("\\\\").join(NO).split("\\{").join(LO).split("\\}").join(Hw).split("\\,").join(kO).split("\\.").join(MO)}a(gQ,"escapeBraces");function yQ(n){return n.split(NO).join("\\").split(LO).join("{").split(Hw).join("}").split(kO).join(",").split(MO).join(".")}a(yQ,"unescapeBraces");function jO(n){if(!n)return[""];var e=[],t=DO("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var c=jO(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}a(jO,"parseCommaParts");function _Q(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Vf(gQ(n),!0).map(yQ)):[]}a(_Q,"expandTop");function SQ(n){return"{"+n+"}"}a(SQ,"embrace");function vQ(n){return/^-?0\d/.test(n)}a(vQ,"isPadded");function bQ(n,e){return n<=e}a(bQ,"lte");function wQ(n,e){return n>=e}a(wQ,"gte");function Vf(n,e){var t=[],r=DO("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?Vf(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var c=i+"{"+r.body+"}"+s[o];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,d=r.body.indexOf(",")>=0;if(!f&&!d)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+Hw+r.post,Vf(n)):[n];var h;if(f)h=r.body.split(/\.\./);else if(h=jO(r.body),h.length===1&&(h=Vf(h[0],!1).map(SQ),h.length===1))return s.map(function(k){return r.pre+h[0]+k});var p;if(f){var y=zw(h[0]),v=zw(h[1]),b=Math.max(h[0].length,h[1].length),w=h.length==3?Math.max(Math.abs(zw(h[2])),1):1,T=bQ,I=v<y;I&&(w*=-1,T=wQ);var $=h.some(vQ);p=[];for(var q=y;T(q,v);q+=w){var ce;if(u)ce=String.fromCharCode(q),ce==="\\"&&(ce="");else if(ce=String(q),$){var B=b-ce.length;if(B>0){var V=new Array(B+1).join("0");q<0?ce="-"+V+ce.slice(1):ce=V+ce}}p.push(ce)}}else{p=[];for(var F=0;F<h.length;F++)p.push.apply(p,Vf(h[F],!1))}for(var F=0;F<p.length;F++)for(var o=0;o<s.length;o++){var c=i+p[F]+s[o];(!e||f||c)&&t.push(c)}}return t}a(Vf,"expand")});var pN=S(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.createPathBasedTargetResolver=To;kn.createCreateRelatedTaskService=VX;kn.createCreateRelatedProjectService=qX;kn.createArchiveAssetService=WX;kn.createCleanPropertiesService=GX;kn.createFixMissingLabelService=zX;kn.createRenameToUidService=HX;kn.createRepairFolderService=QX;kn.createPlanForEveningService=KX;kn.createUpdatePropertyService=YX;kn.createRemovePropertyService=XX;kn.createSetStatusService=JX;function To(n){return{resolveFile(e){let t=n.getAbstractFileByPath(`${e}.md`);if(!t||!("basename"in t))throw new Error(`Cannot resolve target file for IRI: ${e}`);return t}}}a(To,"createPathBasedTargetResolver");function VX(n,e,t=To(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedTask requires userInput.label");let o=t.resolveFile(r),c=n.getFrontmatter(o)??{},l=o.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&o.basename&&(u[f]=`"[[${o.basename}]]"`),await e.createAsset({className:"ems__Task",label:s,folderPath:l,propertyValues:u,parentFile:o,parentMetadata:c})}}}a(VX,"createCreateRelatedTaskService");function qX(n,e,t=To(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedProject requires userInput.label");let o=t.resolveFile(r),c=n.getFrontmatter(o)??{},l=o.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&o.basename&&(u[f]=`"[[${o.basename}]]"`),await e.createAsset({className:"ems__Project",label:s,folderPath:l,propertyValues:u,parentFile:o,parentMetadata:c})}}}a(qX,"createCreateRelatedProjectService");function WX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.archiveAsset(i)}}}a(WX,"createArchiveAssetService");function GX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.cleanEmptyProperties(i)}}}a(GX,"createCleanPropertiesService");function zX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.fixMissingLabel(i)}}}a(zX,"createFixMissingLabelService");function HX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}a(HX,"createRenameToUidService");function QX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{},o=await e.getExpectedFolder(i,s);if(o===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(i.parent?.path??"")!==o&&await e.repairFolder(i,o)}}}a(QX,"createRepairFolderService");function KX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.planForEvening(i)}}}a(KX,"createPlanForEveningService");function YX(n,e,t){return{async execute(r,i){let s=i?.property,o=i?.value;if(!s)throw new Error("updateProperty requires userInput.property");if(o===void 0)throw new Error("updateProperty requires userInput.value");let c=await t.resolveTargetPath(r),l=await n.readFile(c),u=e.updateProperty(l,s,o);await n.updateFile(c,u)}}}a(YX,"createUpdatePropertyService");function XX(n,e,t){return{async execute(r,i){let s=i?.property;if(!s)throw new Error("removeProperty requires userInput.property");let o=await t.resolveTargetPath(r),c=await n.readFile(o),l=e.removeProperty(c,s);await n.updateFile(o,l)}}}a(XX,"createRemovePropertyService");function JX(n,e,t){return{async execute(r,i){let s=i?.statusUID;if(!s)throw new Error("setStatus requires userInput.statusUID");let o=await t.resolveTargetPath(r),c=await n.readFile(o),l=e.updateProperty(c,"ems__Effort_status",`"[[${s}]]"`);await n.updateFile(o,l)}}}a(JX,"createSetStatusService")});var mN=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.createPathBasedTargetResolver=xt.createSetStatusService=xt.createRemovePropertyService=xt.createUpdatePropertyService=xt.createPlanForEveningService=xt.createRepairFolderService=xt.createRenameToUidService=xt.createFixMissingLabelService=xt.createCleanPropertiesService=xt.createArchiveAssetService=xt.createCreateRelatedProjectService=xt.createCreateRelatedTaskService=void 0;var fi=pN();Object.defineProperty(xt,"createCreateRelatedTaskService",{enumerable:!0,get:a(function(){return fi.createCreateRelatedTaskService},"get")});Object.defineProperty(xt,"createCreateRelatedProjectService",{enumerable:!0,get:a(function(){return fi.createCreateRelatedProjectService},"get")});Object.defineProperty(xt,"createArchiveAssetService",{enumerable:!0,get:a(function(){return fi.createArchiveAssetService},"get")});Object.defineProperty(xt,"createCleanPropertiesService",{enumerable:!0,get:a(function(){return fi.createCleanPropertiesService},"get")});Object.defineProperty(xt,"createFixMissingLabelService",{enumerable:!0,get:a(function(){return fi.createFixMissingLabelService},"get")});Object.defineProperty(xt,"createRenameToUidService",{enumerable:!0,get:a(function(){return fi.createRenameToUidService},"get")});Object.defineProperty(xt,"createRepairFolderService",{enumerable:!0,get:a(function(){return fi.createRepairFolderService},"get")});Object.defineProperty(xt,"createPlanForEveningService",{enumerable:!0,get:a(function(){return fi.createPlanForEveningService},"get")});Object.defineProperty(xt,"createUpdatePropertyService",{enumerable:!0,get:a(function(){return fi.createUpdatePropertyService},"get")});Object.defineProperty(xt,"createRemovePropertyService",{enumerable:!0,get:a(function(){return fi.createRemovePropertyService},"get")});Object.defineProperty(xt,"createSetStatusService",{enumerable:!0,get:a(function(){return fi.createSetStatusService},"get")});Object.defineProperty(xt,"createPathBasedTargetResolver",{enumerable:!0,get:a(function(){return fi.createPathBasedTargetResolver},"get")})});var WJ={};i0(WJ,{createProgram:()=>XN});module.exports=Zd(WJ);var Fve=H(eh());var S2=H(_2(),1),{program:fZ,createCommand:dZ,createArgument:hZ,createOption:pZ,CommanderError:mZ,InvalidArgumentError:gZ,InvalidOptionArgumentError:yZ,Command:se,Argument:_Z,Option:SZ,Help:vZ}=S2.default;var cu=require("fs"),Sd=require("path"),Gt=H(Pt());var cr=H(go()),Jt=H(require("path"));function BP(n){return typeof n>"u"||n===null}a(BP,"isNothing");function XG(n){return typeof n=="object"&&n!==null}a(XG,"isObject");function JG(n){return Array.isArray(n)?n:BP(n)?[]:[n]}a(JG,"toArray");function ZG(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}a(ZG,"extend");function ez(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}a(ez,"repeat");function tz(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}a(tz,"isNegativeZero");var rz=BP,nz=XG,iz=JG,sz=ez,oz=tz,az=ZG,gr={isNothing:rz,isObject:nz,toArray:iz,repeat:sz,isNegativeZero:oz,extend:az};function UP(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
462
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:r,destStat:i}=Nf.checkPathsSync(n,e,"copy",t);if(Nf.checkParentPathsSync(n,r,e,"copy"),t.filter&&!t.filter(n,e))return;let s=Df.dirname(e);return _n.existsSync(s)||PW(s),cI(i,n,e,t)}a(FW,"copySync");function cI(n,e,t,r){let s=(r.dereference?_n.statSync:_n.lstatSync)(e);if(s.isDirectory())return $W(s,n,e,t,r);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return DW(s,n,e,t,r);if(s.isSymbolicLink())return VW(n,e,t,r);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}a(cI,"getStats");function DW(n,e,t,r,i){return e?NW(n,t,r,i):lI(n,t,r,i)}a(DW,"onFile");function NW(n,e,t,r){if(r.overwrite)return _n.unlinkSync(t),lI(n,e,t,r);if(r.errorOnExist)throw new Error(`'${t}' already exists`)}a(NW,"mayCopyFile");function lI(n,e,t,r){return _n.copyFileSync(e,t),r.preserveTimestamps&&LW(n.mode,e,t),Rw(t,n.mode)}a(lI,"copyFile");function LW(n,e,t){return kW(n)&&MW(t,n),jW(e,t)}a(LW,"handleTimestamps");function kW(n){return(n&128)===0}a(kW,"fileIsNotWritable");function MW(n,e){return Rw(n,e|128)}a(MW,"makeFileWritable");function Rw(n,e){return _n.chmodSync(n,e)}a(Rw,"setDestMode");function jW(n,e){let t=_n.statSync(n);return OW(e,t.atime,t.mtime)}a(jW,"setDestTimestamps");function $W(n,e,t,r,i){return e?uI(t,r,i):BW(n.mode,t,r,i)}a($W,"onDir");function BW(n,e,t,r){return _n.mkdirSync(t),uI(e,t,r),Rw(t,n)}a(BW,"mkDirAndCopy");function uI(n,e,t){let r=_n.opendirSync(n);try{let i;for(;(i=r.readSync())!==null;)UW(i.name,n,e,t)}finally{r.closeSync()}}a(uI,"copyDir");function UW(n,e,t,r){let i=Df.join(e,n),s=Df.join(t,n);if(r.filter&&!r.filter(i,s))return;let{destStat:o}=Nf.checkPathsSync(i,s,"copy",r);return cI(o,i,s,r)}a(UW,"copyDirItem");function VW(n,e,t,r){let i=_n.readlinkSync(e);if(r.dereference&&(i=Df.resolve(process.cwd(),i)),n){let s;try{s=_n.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return _n.symlinkSync(i,t);throw o}if(r.dereference&&(s=Df.resolve(process.cwd(),s)),Nf.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Nf.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return qW(i,t)}else return _n.symlinkSync(i,t)}a(VW,"onLink");function qW(n,e){return _n.unlinkSync(e),_n.symlinkSync(n,e)}a(qW,"copyLink");fI.exports=FW});var yg=S((bue,hI)=>{"use strict";var WW=Er().fromPromise;hI.exports={copy:WW(aI()),copySync:dI()}});var Lf=S((wue,mI)=>{"use strict";var pI=Nl(),GW=Er().fromCallback;function zW(n,e){pI.rm(n,{recursive:!0,force:!0},e)}a(zW,"remove");function HW(n){pI.rmSync(n,{recursive:!0,force:!0})}a(HW,"removeSync");mI.exports={remove:GW(zW),removeSync:HW}});var EI=S((Tue,wI)=>{"use strict";var QW=Er().fromPromise,_I=yn(),SI=require("path"),vI=Vi(),bI=Lf(),gI=QW(a(async function(e){let t;try{t=await _I.readdir(e)}catch{return vI.mkdirs(e)}return Promise.all(t.map(r=>bI.remove(SI.join(e,r))))},"emptyDir"));function yI(n){let e;try{e=_I.readdirSync(n)}catch{return vI.mkdirsSync(n)}e.forEach(t=>{t=SI.join(n,t),bI.removeSync(t)})}a(yI,"emptyDirSync");wI.exports={emptyDirSync:yI,emptydirSync:yI,emptyDir:gI,emptydir:gI}});var CI=S((xue,xI)=>{"use strict";var KW=Er().fromPromise,TI=require("path"),mo=yn(),AI=Vi();async function YW(n){let e;try{e=await mo.stat(n)}catch{}if(e&&e.isFile())return;let t=TI.dirname(n),r=null;try{r=await mo.stat(t)}catch(i){if(i.code==="ENOENT"){await AI.mkdirs(t),await mo.writeFile(n,"");return}else throw i}r.isDirectory()?await mo.writeFile(n,""):await mo.readdir(t)}a(YW,"createFile");function XW(n){let e;try{e=mo.statSync(n)}catch{}if(e&&e.isFile())return;let t=TI.dirname(n);try{mo.statSync(t).isDirectory()||mo.readdirSync(t)}catch(r){if(r&&r.code==="ENOENT")AI.mkdirsSync(t);else throw r}mo.writeFileSync(n,"")}a(XW,"createFileSync");xI.exports={createFile:KW(YW),createFileSync:XW}});var FI=S((Rue,OI)=>{"use strict";var JW=Er().fromPromise,RI=require("path"),Zo=yn(),II=Vi(),{pathExists:ZW}=Jo(),{areIdentical:PI}=Ja();async function eG(n,e){let t;try{t=await Zo.lstat(e)}catch{}let r;try{r=await Zo.lstat(n)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&PI(r,t))return;let i=RI.dirname(e);await ZW(i)||await II.mkdirs(i),await Zo.link(n,e)}a(eG,"createLink");function tG(n,e){let t;try{t=Zo.lstatSync(e)}catch{}try{let s=Zo.lstatSync(n);if(t&&PI(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let r=RI.dirname(e);return Zo.existsSync(r)||II.mkdirsSync(r),Zo.linkSync(n,e)}a(tG,"createLinkSync");OI.exports={createLink:JW(eG),createLinkSync:tG}});var NI=S((Pue,DI)=>{"use strict";var ea=require("path"),kf=yn(),{pathExists:rG}=Jo(),nG=Er().fromPromise;async function iG(n,e){if(ea.isAbsolute(n)){try{await kf.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:n}}let t=ea.dirname(e),r=ea.join(t,n);if(await rG(r))return{toCwd:r,toDst:n};try{await kf.lstat(n)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:n,toDst:ea.relative(t,n)}}a(iG,"symlinkPaths");function sG(n,e){if(ea.isAbsolute(n)){if(!kf.existsSync(n))throw new Error("absolute srcpath does not exist");return{toCwd:n,toDst:n}}let t=ea.dirname(e),r=ea.join(t,n);if(kf.existsSync(r))return{toCwd:r,toDst:n};if(!kf.existsSync(n))throw new Error("relative srcpath does not exist");return{toCwd:n,toDst:ea.relative(t,n)}}a(sG,"symlinkPathsSync");DI.exports={symlinkPaths:nG(iG),symlinkPathsSync:sG}});var MI=S((Fue,kI)=>{"use strict";var LI=yn(),oG=Er().fromPromise;async function aG(n,e){if(e)return e;let t;try{t=await LI.lstat(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(aG,"symlinkType");function cG(n,e){if(e)return e;let t;try{t=LI.lstatSync(n)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(cG,"symlinkTypeSync");kI.exports={symlinkType:oG(aG),symlinkTypeSync:cG}});var UI=S((Nue,BI)=>{"use strict";var lG=Er().fromPromise,jI=require("path"),As=yn(),{mkdirs:uG,mkdirsSync:fG}=Vi(),{symlinkPaths:dG,symlinkPathsSync:hG}=NI(),{symlinkType:pG,symlinkTypeSync:mG}=MI(),{pathExists:gG}=Jo(),{areIdentical:$I}=Ja();async function yG(n,e,t){let r;try{r=await As.lstat(e)}catch{}if(r&&r.isSymbolicLink()){let[c,l]=await Promise.all([As.stat(n),As.stat(e)]);if($I(c,l))return}let i=await dG(n,e);n=i.toDst;let s=await pG(i.toCwd,t),o=jI.dirname(e);return await gG(o)||await uG(o),As.symlink(n,e,s)}a(yG,"createSymlink");function _G(n,e,t){let r;try{r=As.lstatSync(e)}catch{}if(r&&r.isSymbolicLink()){let c=As.statSync(n),l=As.statSync(e);if($I(c,l))return}let i=hG(n,e);n=i.toDst,t=mG(i.toCwd,t);let s=jI.dirname(e);return As.existsSync(s)||fG(s),As.symlinkSync(n,e,t)}a(_G,"createSymlinkSync");BI.exports={createSymlink:lG(yG),createSymlinkSync:_G}});var KI=S((kue,QI)=>{"use strict";var{createFile:VI,createFileSync:qI}=CI(),{createLink:WI,createLinkSync:GI}=FI(),{createSymlink:zI,createSymlinkSync:HI}=UI();QI.exports={createFile:VI,createFileSync:qI,ensureFile:VI,ensureFileSync:qI,createLink:WI,createLinkSync:GI,ensureLink:WI,ensureLinkSync:GI,createSymlink:zI,createSymlinkSync:HI,ensureSymlink:zI,ensureSymlinkSync:HI}});var _g=S((Mue,YI)=>{function SG(n,{EOL:e=`
463
+ `,finalEOL:t=!0,replacer:r=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(n,r,i).replace(/\n/g,e)+s}a(SG,"stringify");function vG(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}a(vG,"stripBom");YI.exports={stringify:SG,stripBom:vG}});var eP=S(($ue,ZI)=>{var Ml;try{Ml=Nl()}catch{Ml=require("fs")}var Sg=Er(),{stringify:XI,stripBom:JI}=_g();async function bG(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ml,r="throws"in e?e.throws:!0,i=await Sg.fromCallback(t.readFile)(n,e);i=JI(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(r)throw o.message=`${n}: ${o.message}`,o;return null}return s}a(bG,"_readFile");var wG=Sg.fromPromise(bG);function EG(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ml,r="throws"in e?e.throws:!0;try{let i=t.readFileSync(n,e);return i=JI(i),JSON.parse(i,e.reviver)}catch(i){if(r)throw i.message=`${n}: ${i.message}`,i;return null}}a(EG,"readFileSync");async function TG(n,e,t={}){let r=t.fs||Ml,i=XI(e,t);await Sg.fromCallback(r.writeFile)(n,i,t)}a(TG,"_writeFile");var AG=Sg.fromPromise(TG);function xG(n,e,t={}){let r=t.fs||Ml,i=XI(e,t);return r.writeFileSync(n,i,t)}a(xG,"writeFileSync");ZI.exports={readFile:wG,readFileSync:EG,writeFile:AG,writeFileSync:xG}});var rP=S((Uue,tP)=>{"use strict";var vg=eP();tP.exports={readJson:vg.readFile,readJsonSync:vg.readFileSync,writeJson:vg.writeFile,writeJsonSync:vg.writeFileSync}});var bg=S((Vue,sP)=>{"use strict";var CG=Er().fromPromise,Iw=yn(),nP=require("path"),iP=Vi(),RG=Jo().pathExists;async function IG(n,e,t="utf-8"){let r=nP.dirname(n);return await RG(r)||await iP.mkdirs(r),Iw.writeFile(n,e,t)}a(IG,"outputFile");function PG(n,...e){let t=nP.dirname(n);Iw.existsSync(t)||iP.mkdirsSync(t),Iw.writeFileSync(n,...e)}a(PG,"outputFileSync");sP.exports={outputFile:CG(IG),outputFileSync:PG}});var aP=S((Wue,oP)=>{"use strict";var{stringify:OG}=_g(),{outputFile:FG}=bg();async function DG(n,e,t={}){let r=OG(e,t);await FG(n,r,t)}a(DG,"outputJson");oP.exports=DG});var lP=S((zue,cP)=>{"use strict";var{stringify:NG}=_g(),{outputFileSync:LG}=bg();function kG(n,e,t){let r=NG(e,t);LG(n,r,t)}a(kG,"outputJsonSync");cP.exports=kG});var fP=S((Que,uP)=>{"use strict";var MG=Er().fromPromise,Sn=rP();Sn.outputJson=MG(aP());Sn.outputJsonSync=lP();Sn.outputJSON=Sn.outputJson;Sn.outputJSONSync=Sn.outputJsonSync;Sn.writeJSON=Sn.writeJson;Sn.writeJSONSync=Sn.writeJsonSync;Sn.readJSON=Sn.readJson;Sn.readJSONSync=Sn.readJsonSync;uP.exports=Sn});var gP=S((Kue,mP)=>{"use strict";var jG=yn(),dP=require("path"),{copy:$G}=yg(),{remove:pP}=Lf(),{mkdirp:BG}=Vi(),{pathExists:UG}=Jo(),hP=Ja();async function VG(n,e,t={}){let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await hP.checkPaths(n,e,"move",t);await hP.checkParentPaths(n,i,e,"move");let o=dP.dirname(e);return dP.parse(o).root!==o&&await BG(o),qG(n,e,r,s)}a(VG,"move");async function qG(n,e,t,r){if(!r){if(t)await pP(e);else if(await UG(e))throw new Error("dest already exists.")}try{await jG.rename(n,e)}catch(i){if(i.code!=="EXDEV")throw i;await WG(n,e,t)}}a(qG,"doRename");async function WG(n,e,t){return await $G(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),pP(n)}a(WG,"moveAcrossDevice");mP.exports=VG});var bP=S((Xue,vP)=>{"use strict";var _P=Nl(),Ow=require("path"),GG=yg().copySync,SP=Lf().removeSync,zG=Vi().mkdirpSync,yP=Ja();function HG(n,e,t){t=t||{};let r=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=yP.checkPathsSync(n,e,"move",t);return yP.checkParentPathsSync(n,i,e,"move"),QG(e)||zG(Ow.dirname(e)),KG(n,e,r,s)}a(HG,"moveSync");function QG(n){let e=Ow.dirname(n);return Ow.parse(e).root===e}a(QG,"isParentRoot");function KG(n,e,t,r){if(r)return Pw(n,e,t);if(t)return SP(e),Pw(n,e,t);if(_P.existsSync(e))throw new Error("dest already exists.");return Pw(n,e,t)}a(KG,"doRename");function Pw(n,e,t){try{_P.renameSync(n,e)}catch(r){if(r.code!=="EXDEV")throw r;return YG(n,e,t)}}a(Pw,"rename");function YG(n,e,t){return GG(n,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),SP(n)}a(YG,"moveAcrossDevice");vP.exports=HG});var EP=S((Zue,wP)=>{"use strict";var XG=Er().fromPromise;wP.exports={move:XG(gP()),moveSync:bP()}});var go=S((efe,TP)=>{"use strict";TP.exports={...yn(),...yg(),...EI(),...KI(),...fP(),...Vi(),...EP(),...bg(),...Jo(),...Lf()}});var FO=S((nfe,OO)=>{"use strict";OO.exports=IO;function IO(n,e,t){n instanceof RegExp&&(n=RO(n,t)),e instanceof RegExp&&(e=RO(e,t));var r=PO(n,e,t);return r&&{start:r[0],end:r[1],pre:t.slice(0,r[0]),body:t.slice(r[0]+n.length,r[1]),post:t.slice(r[1]+e.length)}}a(IO,"balanced");function RO(n,e){var t=e.match(n);return t?t[0]:null}a(RO,"maybeMatch");IO.range=PO;function PO(n,e,t){var r,i,s,o,c,l=t.indexOf(n),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(n===e)return[l,u];for(r=[],s=t.length;f>=0&&!c;)f==l?(r.push(f),l=t.indexOf(n,f+1)):r.length==1?c=[r.pop(),u]:(i=r.pop(),i<s&&(s=i,o=u),u=t.indexOf(e,f+1)),f=l<u&&l>=0?l:u;r.length&&(c=[s,o])}return c}a(PO,"range")});var BO=S((sfe,$O)=>{var DO=FO();$O.exports=SQ;var NO="\0SLASH"+Math.random()+"\0",LO="\0OPEN"+Math.random()+"\0",Hw="\0CLOSE"+Math.random()+"\0",kO="\0COMMA"+Math.random()+"\0",MO="\0PERIOD"+Math.random()+"\0";function zw(n){return parseInt(n,10)==n?parseInt(n,10):n.charCodeAt(0)}a(zw,"numeric");function yQ(n){return n.split("\\\\").join(NO).split("\\{").join(LO).split("\\}").join(Hw).split("\\,").join(kO).split("\\.").join(MO)}a(yQ,"escapeBraces");function _Q(n){return n.split(NO).join("\\").split(LO).join("{").split(Hw).join("}").split(kO).join(",").split(MO).join(".")}a(_Q,"unescapeBraces");function jO(n){if(!n)return[""];var e=[],t=DO("{","}",n);if(!t)return n.split(",");var r=t.pre,i=t.body,s=t.post,o=r.split(",");o[o.length-1]+="{"+i+"}";var c=jO(s);return s.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),e.push.apply(e,o),e}a(jO,"parseCommaParts");function SQ(n){return n?(n.substr(0,2)==="{}"&&(n="\\{\\}"+n.substr(2)),Vf(yQ(n),!0).map(_Q)):[]}a(SQ,"expandTop");function vQ(n){return"{"+n+"}"}a(vQ,"embrace");function bQ(n){return/^-?0\d/.test(n)}a(bQ,"isPadded");function wQ(n,e){return n<=e}a(wQ,"lte");function EQ(n,e){return n>=e}a(EQ,"gte");function Vf(n,e){var t=[],r=DO("{","}",n);if(!r)return[n];var i=r.pre,s=r.post.length?Vf(r.post,!1):[""];if(/\$$/.test(r.pre))for(var o=0;o<s.length;o++){var c=i+"{"+r.body+"}"+s[o];t.push(c)}else{var l=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),f=l||u,d=r.body.indexOf(",")>=0;if(!f&&!d)return r.post.match(/,(?!,).*\}/)?(n=r.pre+"{"+r.body+Hw+r.post,Vf(n)):[n];var h;if(f)h=r.body.split(/\.\./);else if(h=jO(r.body),h.length===1&&(h=Vf(h[0],!1).map(vQ),h.length===1))return s.map(function(k){return r.pre+h[0]+k});var p;if(f){var y=zw(h[0]),v=zw(h[1]),b=Math.max(h[0].length,h[1].length),w=h.length==3?Math.max(Math.abs(zw(h[2])),1):1,T=wQ,I=v<y;I&&(w*=-1,T=EQ);var $=h.some(bQ);p=[];for(var q=y;T(q,v);q+=w){var ce;if(u)ce=String.fromCharCode(q),ce==="\\"&&(ce="");else if(ce=String(q),$){var B=b-ce.length;if(B>0){var V=new Array(B+1).join("0");q<0?ce="-"+V+ce.slice(1):ce=V+ce}}p.push(ce)}}else{p=[];for(var F=0;F<h.length;F++)p.push.apply(p,Vf(h[F],!1))}for(var F=0;F<p.length;F++)for(var o=0;o<s.length;o++){var c=i+p[F]+s[o];(!e||f||c)&&t.push(c)}}return t}a(Vf,"expand")});var pN=S(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.createPathBasedTargetResolver=To;kn.createCreateRelatedTaskService=qX;kn.createCreateRelatedProjectService=WX;kn.createArchiveAssetService=GX;kn.createCleanPropertiesService=zX;kn.createFixMissingLabelService=HX;kn.createRenameToUidService=QX;kn.createRepairFolderService=KX;kn.createPlanForEveningService=YX;kn.createUpdatePropertyService=XX;kn.createRemovePropertyService=JX;kn.createSetStatusService=ZX;function To(n){return{resolveFile(e){let t=n.getAbstractFileByPath(`${e}.md`);if(!t||!("basename"in t))throw new Error(`Cannot resolve target file for IRI: ${e}`);return t}}}a(To,"createPathBasedTargetResolver");function qX(n,e,t=To(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedTask requires userInput.label");let o=t.resolveFile(r),c=n.getFrontmatter(o)??{},l=o.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&o.basename&&(u[f]=`"[[${o.basename}]]"`),await e.createAsset({className:"ems__Task",label:s,folderPath:l,propertyValues:u,parentFile:o,parentMetadata:c})}}}a(qX,"createCreateRelatedTaskService");function WX(n,e,t=To(n)){return{async execute(r,i){let s=i?.label;if(!s)throw new Error("createRelatedProject requires userInput.label");let o=t.resolveFile(r),c=n.getFrontmatter(o)??{},l=o.parent?.path||"",u={ems__Effort_status:'"[[ems__EffortStatusDraft]]"'},f=i?.parentProperty;f&&o.basename&&(u[f]=`"[[${o.basename}]]"`),await e.createAsset({className:"ems__Project",label:s,folderPath:l,propertyValues:u,parentFile:o,parentMetadata:c})}}}a(WX,"createCreateRelatedProjectService");function GX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.archiveAsset(i)}}}a(GX,"createArchiveAssetService");function zX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.cleanEmptyProperties(i)}}}a(zX,"createCleanPropertiesService");function HX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.fixMissingLabel(i)}}}a(HX,"createFixMissingLabelService");function QX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}a(QX,"createRenameToUidService");function KX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r),s=n.getFrontmatter(i)??{},o=await e.getExpectedFolder(i,s);if(o===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(i.parent?.path??"")!==o&&await e.repairFolder(i,o)}}}a(KX,"createRepairFolderService");function YX(n,e,t=To(n)){return{async execute(r){let i=t.resolveFile(r);await e.planForEvening(i)}}}a(YX,"createPlanForEveningService");function XX(n,e,t){return{async execute(r,i){let s=i?.property,o=i?.value;if(!s)throw new Error("updateProperty requires userInput.property");if(o===void 0)throw new Error("updateProperty requires userInput.value");let c=await t.resolveTargetPath(r),l=await n.readFile(c),u=e.updateProperty(l,s,o);await n.updateFile(c,u)}}}a(XX,"createUpdatePropertyService");function JX(n,e,t){return{async execute(r,i){let s=i?.property;if(!s)throw new Error("removeProperty requires userInput.property");let o=await t.resolveTargetPath(r),c=await n.readFile(o),l=e.removeProperty(c,s);await n.updateFile(o,l)}}}a(JX,"createRemovePropertyService");function ZX(n,e,t){return{async execute(r,i){let s=i?.statusUID;if(!s)throw new Error("setStatus requires userInput.statusUID");let o=await t.resolveTargetPath(r),c=await n.readFile(o),l=e.updateProperty(c,"ems__Effort_status",`"[[${s}]]"`);await n.updateFile(o,l)}}}a(ZX,"createSetStatusService")});var mN=S(xt=>{"use strict";Object.defineProperty(xt,"__esModule",{value:!0});xt.createPathBasedTargetResolver=xt.createSetStatusService=xt.createRemovePropertyService=xt.createUpdatePropertyService=xt.createPlanForEveningService=xt.createRepairFolderService=xt.createRenameToUidService=xt.createFixMissingLabelService=xt.createCleanPropertiesService=xt.createArchiveAssetService=xt.createCreateRelatedProjectService=xt.createCreateRelatedTaskService=void 0;var fi=pN();Object.defineProperty(xt,"createCreateRelatedTaskService",{enumerable:!0,get:a(function(){return fi.createCreateRelatedTaskService},"get")});Object.defineProperty(xt,"createCreateRelatedProjectService",{enumerable:!0,get:a(function(){return fi.createCreateRelatedProjectService},"get")});Object.defineProperty(xt,"createArchiveAssetService",{enumerable:!0,get:a(function(){return fi.createArchiveAssetService},"get")});Object.defineProperty(xt,"createCleanPropertiesService",{enumerable:!0,get:a(function(){return fi.createCleanPropertiesService},"get")});Object.defineProperty(xt,"createFixMissingLabelService",{enumerable:!0,get:a(function(){return fi.createFixMissingLabelService},"get")});Object.defineProperty(xt,"createRenameToUidService",{enumerable:!0,get:a(function(){return fi.createRenameToUidService},"get")});Object.defineProperty(xt,"createRepairFolderService",{enumerable:!0,get:a(function(){return fi.createRepairFolderService},"get")});Object.defineProperty(xt,"createPlanForEveningService",{enumerable:!0,get:a(function(){return fi.createPlanForEveningService},"get")});Object.defineProperty(xt,"createUpdatePropertyService",{enumerable:!0,get:a(function(){return fi.createUpdatePropertyService},"get")});Object.defineProperty(xt,"createRemovePropertyService",{enumerable:!0,get:a(function(){return fi.createRemovePropertyService},"get")});Object.defineProperty(xt,"createSetStatusService",{enumerable:!0,get:a(function(){return fi.createSetStatusService},"get")});Object.defineProperty(xt,"createPathBasedTargetResolver",{enumerable:!0,get:a(function(){return fi.createPathBasedTargetResolver},"get")})});var GJ={};i0(GJ,{createProgram:()=>XN});module.exports=Zd(GJ);var Dve=H(eh());var S2=H(_2(),1),{program:dZ,createCommand:hZ,createArgument:pZ,createOption:mZ,CommanderError:gZ,InvalidArgumentError:yZ,InvalidOptionArgumentError:_Z,Command:se,Argument:SZ,Option:vZ,Help:bZ}=S2.default;var cu=require("fs"),Sd=require("path"),Gt=H(Pt());var cr=H(go()),Jt=H(require("path"));function BP(n){return typeof n>"u"||n===null}a(BP,"isNothing");function JG(n){return typeof n=="object"&&n!==null}a(JG,"isObject");function ZG(n){return Array.isArray(n)?n:BP(n)?[]:[n]}a(ZG,"toArray");function ez(n,e){var t,r,i,s;if(e)for(s=Object.keys(e),t=0,r=s.length;t<r;t+=1)i=s[t],n[i]=e[i];return n}a(ez,"extend");function tz(n,e){var t="",r;for(r=0;r<e;r+=1)t+=n;return t}a(tz,"repeat");function rz(n){return n===0&&Number.NEGATIVE_INFINITY===1/n}a(rz,"isNegativeZero");var nz=BP,iz=JG,sz=ZG,oz=tz,az=rz,cz=ez,gr={isNothing:nz,isObject:iz,toArray:sz,repeat:oz,isNegativeZero:az,extend:cz};function UP(n,e){var t="",r=n.reason||"(unknown reason)";return n.mark?(n.mark.name&&(t+='in "'+n.mark.name+'" '),t+="("+(n.mark.line+1)+":"+(n.mark.column+1)+")",!e&&n.mark.snippet&&(t+=`
464
464
 
465
- `+n.mark.snippet),r+" "+t):r}a(UP,"formatError");function jf(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=UP(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(jf,"YAMLException$1");jf.prototype=Object.create(Error.prototype);jf.prototype.constructor=jf;jf.prototype.toString=a(function(e){return this.name+": "+UP(this,e)},"toString");var vn=jf;function Fw(n,e,t,r,i){var s="",o="",c=Math.floor(i/2)-1;return r-e>c&&(s=" ... ",e=r-c+s.length),t-r>c&&(o=" ...",t=r+c-o.length),{str:s+n.slice(e,t).replace(/\t/g,"\u2192")+o,pos:r-e+s.length}}a(Fw,"getLine");function Dw(n,e){return gr.repeat(" ",e-n.length)+n}a(Dw,"padStart");function cz(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=t.exec(n.buffer);)i.push(s.index),r.push(s.index+s[0].length),n.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c="",l,u,f=Math.min(n.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=Fw(n.buffer,r[o-l],i[o-l],n.position-(r[o]-r[o-l]),d),c=gr.repeat(" ",e.indent)+Dw((n.line-l+1).toString(),f)+" | "+u.str+`
465
+ `+n.mark.snippet),r+" "+t):r}a(UP,"formatError");function jf(n,e){Error.call(this),this.name="YAMLException",this.reason=n,this.mark=e,this.message=UP(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}a(jf,"YAMLException$1");jf.prototype=Object.create(Error.prototype);jf.prototype.constructor=jf;jf.prototype.toString=a(function(e){return this.name+": "+UP(this,e)},"toString");var vn=jf;function Fw(n,e,t,r,i){var s="",o="",c=Math.floor(i/2)-1;return r-e>c&&(s=" ... ",e=r-c+s.length),t-r>c&&(o=" ...",t=r+c-o.length),{str:s+n.slice(e,t).replace(/\t/g,"\u2192")+o,pos:r-e+s.length}}a(Fw,"getLine");function Dw(n,e){return gr.repeat(" ",e-n.length)+n}a(Dw,"padStart");function lz(n,e){if(e=Object.create(e||null),!n.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],s,o=-1;s=t.exec(n.buffer);)i.push(s.index),r.push(s.index+s[0].length),n.position<=s.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var c="",l,u,f=Math.min(n.line+e.linesAfter,i.length).toString().length,d=e.maxLength-(e.indent+f+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)u=Fw(n.buffer,r[o-l],i[o-l],n.position-(r[o]-r[o-l]),d),c=gr.repeat(" ",e.indent)+Dw((n.line-l+1).toString(),f)+" | "+u.str+`
466
466
  `+c;for(u=Fw(n.buffer,r[o],i[o],n.position,d),c+=gr.repeat(" ",e.indent)+Dw((n.line+1).toString(),f)+" | "+u.str+`
467
467
  `,c+=gr.repeat("-",e.indent+f+3+u.pos)+`^
468
468
  `,l=1;l<=e.linesAfter&&!(o+l>=i.length);l++)u=Fw(n.buffer,r[o+l],i[o+l],n.position-(r[o]-r[o+l]),d),c+=gr.repeat(" ",e.indent)+Dw((n.line+l+1).toString(),f)+" | "+u.str+`
469
- `;return c.replace(/\n$/,"")}a(cz,"makeSnippet");var lz=cz,uz=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],fz=["scalar","sequence","mapping"];function dz(n){var e={};return n!==null&&Object.keys(n).forEach(function(t){n[t].forEach(function(r){e[String(r)]=t})}),e}a(dz,"compileStyleAliases");function hz(n,e){if(e=e||{},Object.keys(e).forEach(function(t){if(uz.indexOf(t)===-1)throw new vn('Unknown option "'+t+'" is met in definition of "'+n+'" YAML type.')}),this.options=e,this.tag=n,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=dz(e.styleAliases||null),fz.indexOf(this.kind)===-1)throw new vn('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}a(hz,"Type$1");var Br=hz;function AP(n,e){var t=[];return n[e].forEach(function(r){var i=t.length;t.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),t[i]=r}),t}a(AP,"compileList");function pz(){var n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function r(i){i.multi?(n.multi[i.kind].push(i),n.multi.fallback.push(i)):n[i.kind][i.tag]=n.fallback[i.tag]=i}for(a(r,"collectType"),e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}a(pz,"compileMap");function Lw(n){return this.extend(n)}a(Lw,"Schema$1");Lw.prototype.extend=a(function(e){var t=[],r=[];if(e instanceof Br)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new vn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof Br))throw new vn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new vn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new vn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof Br))throw new vn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Lw.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=AP(i,"implicit"),i.compiledExplicit=AP(i,"explicit"),i.compiledTypeMap=pz(i.compiledImplicit,i.compiledExplicit),i},"extend");var VP=Lw,qP=new Br("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(n){return n!==null?n:""},"construct")}),WP=new Br("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(n){return n!==null?n:[]},"construct")}),GP=new Br("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(n){return n!==null?n:{}},"construct")}),zP=new VP({explicit:[qP,WP,GP]});function mz(n){if(n===null)return!0;var e=n.length;return e===1&&n==="~"||e===4&&(n==="null"||n==="Null"||n==="NULL")}a(mz,"resolveYamlNull");function gz(){return null}a(gz,"constructYamlNull");function yz(n){return n===null}a(yz,"isNull");var HP=new Br("tag:yaml.org,2002:null",{kind:"scalar",resolve:mz,construct:gz,predicate:yz,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"});function _z(n){if(n===null)return!1;var e=n.length;return e===4&&(n==="true"||n==="True"||n==="TRUE")||e===5&&(n==="false"||n==="False"||n==="FALSE")}a(_z,"resolveYamlBoolean");function Sz(n){return n==="true"||n==="True"||n==="TRUE"}a(Sz,"constructYamlBoolean");function vz(n){return Object.prototype.toString.call(n)==="[object Boolean]"}a(vz,"isBoolean");var QP=new Br("tag:yaml.org,2002:bool",{kind:"scalar",resolve:_z,construct:Sz,predicate:vz,represent:{lowercase:a(function(n){return n?"true":"false"},"lowercase"),uppercase:a(function(n){return n?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(n){return n?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function bz(n){return 48<=n&&n<=57||65<=n&&n<=70||97<=n&&n<=102}a(bz,"isHexCode");function wz(n){return 48<=n&&n<=55}a(wz,"isOctCode");function Ez(n){return 48<=n&&n<=57}a(Ez,"isDecCode");function Tz(n){if(n===null)return!1;var e=n.length,t=0,r=!1,i;if(!e)return!1;if(i=n[t],(i==="-"||i==="+")&&(i=n[++t]),i==="0"){if(t+1===e)return!0;if(i=n[++t],i==="b"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!bz(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!wz(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=n[t],i!=="_"){if(!Ez(n.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}a(Tz,"resolveYamlInteger");function Az(n){var e=n,t=1,r;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),r=e[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),e=e.slice(1),r=e[0]),e==="0")return 0;if(r==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}a(Az,"constructYamlInteger");function xz(n){return Object.prototype.toString.call(n)==="[object Number]"&&n%1===0&&!gr.isNegativeZero(n)}a(xz,"isInteger");var KP=new Br("tag:yaml.org,2002:int",{kind:"scalar",resolve:Tz,construct:Az,predicate:xz,represent:{binary:a(function(n){return n>=0?"0b"+n.toString(2):"-0b"+n.toString(2).slice(1)},"binary"),octal:a(function(n){return n>=0?"0o"+n.toString(8):"-0o"+n.toString(8).slice(1)},"octal"),decimal:a(function(n){return n.toString(10)},"decimal"),hexadecimal:a(function(n){return n>=0?"0x"+n.toString(16).toUpperCase():"-0x"+n.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Cz=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Rz(n){return!(n===null||!Cz.test(n)||n[n.length-1]==="_")}a(Rz,"resolveYamlFloat");function Iz(n){var e,t;return e=n.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}a(Iz,"constructYamlFloat");var Pz=/^[-+]?[0-9]+e/;function Oz(n,e){var t;if(isNaN(n))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===n)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===n)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(gr.isNegativeZero(n))return"-0.0";return t=n.toString(10),Pz.test(t)?t.replace("e",".e"):t}a(Oz,"representYamlFloat");function Fz(n){return Object.prototype.toString.call(n)==="[object Number]"&&(n%1!==0||gr.isNegativeZero(n))}a(Fz,"isFloat");var YP=new Br("tag:yaml.org,2002:float",{kind:"scalar",resolve:Rz,construct:Iz,predicate:Fz,represent:Oz,defaultStyle:"lowercase"}),XP=zP.extend({implicit:[HP,QP,KP,YP]}),JP=XP,ZP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),eO=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Dz(n){return n===null?!1:ZP.exec(n)!==null||eO.exec(n)!==null}a(Dz,"resolveYamlTimestamp");function Nz(n){var e,t,r,i,s,o,c,l=0,u=null,f,d,h;if(e=ZP.exec(n),e===null&&(e=eO.exec(n)),e===null)throw new Error("Date resolve error");if(t=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,r,i));if(s=+e[4],o=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(f=+e[10],d=+(e[11]||0),u=(f*60+d)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(t,r,i,s,o,c,l)),u&&h.setTime(h.getTime()-u),h}a(Nz,"constructYamlTimestamp");function Lz(n){return n.toISOString()}a(Lz,"representYamlTimestamp");var tO=new Br("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Dz,construct:Nz,instanceOf:Date,represent:Lz});function kz(n){return n==="<<"||n===null}a(kz,"resolveYamlMerge");var rO=new Br("tag:yaml.org,2002:merge",{kind:"scalar",resolve:kz}),Bw=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
470
- \r`;function Mz(n){if(n===null)return!1;var e,t,r=0,i=n.length,s=Bw;for(t=0;t<i;t++)if(e=s.indexOf(n.charAt(t)),!(e>64)){if(e<0)return!1;r+=6}return r%8===0}a(Mz,"resolveYamlBinary");function jz(n){var e,t,r=n.replace(/[\r\n=]/g,""),i=r.length,s=Bw,o=0,c=[];for(e=0;e<i;e++)e%4===0&&e&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return t=i%4*6,t===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):t===18?(c.push(o>>10&255),c.push(o>>2&255)):t===12&&c.push(o>>4&255),new Uint8Array(c)}a(jz,"constructYamlBinary");function $z(n){var e="",t=0,r,i,s=n.length,o=Bw;for(r=0;r<s;r++)r%3===0&&r&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+n[r];return i=s%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}a($z,"representYamlBinary");function Bz(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}a(Bz,"isBinary");var nO=new Br("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Mz,construct:jz,predicate:Bz,represent:$z}),Uz=Object.prototype.hasOwnProperty,Vz=Object.prototype.toString;function qz(n){if(n===null)return!0;var e=[],t,r,i,s,o,c=n;for(t=0,r=c.length;t<r;t+=1){if(i=c[t],o=!1,Vz.call(i)!=="[object Object]")return!1;for(s in i)if(Uz.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}a(qz,"resolveYamlOmap");function Wz(n){return n!==null?n:[]}a(Wz,"constructYamlOmap");var iO=new Br("tag:yaml.org,2002:omap",{kind:"sequence",resolve:qz,construct:Wz}),Gz=Object.prototype.toString;function zz(n){if(n===null)return!0;var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(r=o[e],Gz.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}a(zz,"resolveYamlPairs");function Hz(n){if(n===null)return[];var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)r=o[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}a(Hz,"constructYamlPairs");var sO=new Br("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:zz,construct:Hz}),Qz=Object.prototype.hasOwnProperty;function Kz(n){if(n===null)return!0;var e,t=n;for(e in t)if(Qz.call(t,e)&&t[e]!==null)return!1;return!0}a(Kz,"resolveYamlSet");function Yz(n){return n!==null?n:{}}a(Yz,"constructYamlSet");var oO=new Br("tag:yaml.org,2002:set",{kind:"mapping",resolve:Kz,construct:Yz}),Uw=JP.extend({implicit:[tO,rO],explicit:[nO,iO,sO,oO]}),ra=Object.prototype.hasOwnProperty,wg=1,aO=2,cO=3,Eg=4,Nw=1,Xz=2,xP=3,Jz=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Zz=/[\x85\u2028\u2029]/,eH=/[,\[\]\{\}]/,lO=/^(?:!|!!|![a-z\-]+!)$/i,uO=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function CP(n){return Object.prototype.toString.call(n)}a(CP,"_class");function xs(n){return n===10||n===13}a(xs,"is_EOL");function ec(n){return n===9||n===32}a(ec,"is_WHITE_SPACE");function Dn(n){return n===9||n===32||n===10||n===13}a(Dn,"is_WS_OR_EOL");function $l(n){return n===44||n===91||n===93||n===123||n===125}a($l,"is_FLOW_INDICATOR");function tH(n){var e;return 48<=n&&n<=57?n-48:(e=n|32,97<=e&&e<=102?e-97+10:-1)}a(tH,"fromHexCode");function rH(n){return n===120?2:n===117?4:n===85?8:0}a(rH,"escapedHexLen");function nH(n){return 48<=n&&n<=57?n-48:-1}a(nH,"fromDecimalCode");function RP(n){return n===48?"\0":n===97?"\x07":n===98?"\b":n===116||n===9?" ":n===110?`
471
- `:n===118?"\v":n===102?"\f":n===114?"\r":n===101?"\x1B":n===32?" ":n===34?'"':n===47?"/":n===92?"\\":n===78?"\x85":n===95?"\xA0":n===76?"\u2028":n===80?"\u2029":""}a(RP,"simpleEscapeSequence");function iH(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}a(iH,"charFromCodepoint");function fO(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}a(fO,"setProperty");var dO=new Array(256),hO=new Array(256);for(Za=0;Za<256;Za++)dO[Za]=RP(Za)?1:0,hO[Za]=RP(Za);var Za;function sH(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||Uw,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=n.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(sH,"State$1");function pO(n,e){var t={name:n.filename,buffer:n.input.slice(0,-1),position:n.position,line:n.line,column:n.position-n.lineStart};return t.snippet=lz(t),new vn(e,t)}a(pO,"generateError");function oe(n,e){throw pO(n,e)}a(oe,"throwError");function Tg(n,e){n.onWarning&&n.onWarning.call(null,pO(n,e))}a(Tg,"throwWarning");var IP={YAML:a(function(e,t,r){var i,s,o;e.version!==null&&oe(e,"duplication of %YAML directive"),r.length!==1&&oe(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&oe(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&oe(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Tg(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,t,r){var i,s;r.length!==2&&oe(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],lO.test(i)||oe(e,"ill-formed tag handle (first argument) of the TAG directive"),ra.call(e.tagMap,i)&&oe(e,'there is a previously declared suffix for "'+i+'" tag handle'),uO.test(s)||oe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{oe(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function ta(n,e,t,r){var i,s,o,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||oe(n,"expected valid JSON character");else Jz.test(c)&&oe(n,"the stream contains non-printable characters");n.result+=c}}a(ta,"captureSegment");function PP(n,e,t,r){var i,s,o,c;for(gr.isObject(t)||oe(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,c=i.length;o<c;o+=1)s=i[o],ra.call(e,s)||(fO(e,s,t[s]),r[s]=!0)}a(PP,"mergeMappings");function Bl(n,e,t,r,i,s,o,c,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&oe(n,"nested arrays are not supported inside keys"),typeof i=="object"&&CP(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&CP(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)PP(n,e,s[u],t);else PP(n,e,s,t);else!n.json&&!ra.call(t,i)&&ra.call(e,i)&&(n.line=o||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,oe(n,"duplicated mapping key")),fO(e,i,s),delete t[i];return e}a(Bl,"storeMappingPair");function Vw(n){var e;e=n.input.charCodeAt(n.position),e===10?n.position++:e===13?(n.position++,n.input.charCodeAt(n.position)===10&&n.position++):oe(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}a(Vw,"readLineBreak");function or(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;ec(i);)i===9&&n.firstTabInLine===-1&&(n.firstTabInLine=n.position),i=n.input.charCodeAt(++n.position);if(e&&i===35)do i=n.input.charCodeAt(++n.position);while(i!==10&&i!==13&&i!==0);if(xs(i))for(Vw(n),i=n.input.charCodeAt(n.position),r++,n.lineIndent=0;i===32;)n.lineIndent++,i=n.input.charCodeAt(++n.position);else break}return t!==-1&&r!==0&&n.lineIndent<t&&Tg(n,"deficient indentation"),r}a(or,"skipSeparationSpace");function Cg(n){var e=n.position,t;return t=n.input.charCodeAt(e),!!((t===45||t===46)&&t===n.input.charCodeAt(e+1)&&t===n.input.charCodeAt(e+2)&&(e+=3,t=n.input.charCodeAt(e),t===0||Dn(t)))}a(Cg,"testDocumentSeparator");function qw(n,e){e===1?n.result+=" ":e>1&&(n.result+=gr.repeat(`
472
- `,e-1))}a(qw,"writeFoldedLines");function oH(n,e,t){var r,i,s,o,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),Dn(p)||$l(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=n.input.charCodeAt(n.position+1),Dn(i)||t&&$l(i)))return!1;for(n.kind="scalar",n.result="",s=o=n.position,c=!1;p!==0;){if(p===58){if(i=n.input.charCodeAt(n.position+1),Dn(i)||t&&$l(i))break}else if(p===35){if(r=n.input.charCodeAt(n.position-1),Dn(r))break}else{if(n.position===n.lineStart&&Cg(n)||t&&$l(p))break;if(xs(p))if(l=n.line,u=n.lineStart,f=n.lineIndent,or(n,!1,-1),n.lineIndent>=e){c=!0,p=n.input.charCodeAt(n.position);continue}else{n.position=o,n.line=l,n.lineStart=u,n.lineIndent=f;break}}c&&(ta(n,s,o,!1),qw(n,n.line-l),s=o=n.position,c=!1),ec(p)||(o=n.position+1),p=n.input.charCodeAt(++n.position)}return ta(n,s,o,!1),n.result?!0:(n.kind=d,n.result=h,!1)}a(oH,"readPlainScalar");function aH(n,e){var t,r,i;if(t=n.input.charCodeAt(n.position),t!==39)return!1;for(n.kind="scalar",n.result="",n.position++,r=i=n.position;(t=n.input.charCodeAt(n.position))!==0;)if(t===39)if(ta(n,r,n.position,!0),t=n.input.charCodeAt(++n.position),t===39)r=n.position,n.position++,i=n.position;else return!0;else xs(t)?(ta(n,r,i,!0),qw(n,or(n,!1,e)),r=i=n.position):n.position===n.lineStart&&Cg(n)?oe(n,"unexpected end of the document within a single quoted scalar"):(n.position++,i=n.position);oe(n,"unexpected end of the stream within a single quoted scalar")}a(aH,"readSingleQuotedScalar");function cH(n,e){var t,r,i,s,o,c;if(c=n.input.charCodeAt(n.position),c!==34)return!1;for(n.kind="scalar",n.result="",n.position++,t=r=n.position;(c=n.input.charCodeAt(n.position))!==0;){if(c===34)return ta(n,t,n.position,!0),n.position++,!0;if(c===92){if(ta(n,t,n.position,!0),c=n.input.charCodeAt(++n.position),xs(c))or(n,!1,e);else if(c<256&&dO[c])n.result+=hO[c],n.position++;else if((o=rH(c))>0){for(i=o,s=0;i>0;i--)c=n.input.charCodeAt(++n.position),(o=tH(c))>=0?s=(s<<4)+o:oe(n,"expected hexadecimal character");n.result+=iH(s),n.position++}else oe(n,"unknown escape sequence");t=r=n.position}else xs(c)?(ta(n,t,r,!0),qw(n,or(n,!1,e)),t=r=n.position):n.position===n.lineStart&&Cg(n)?oe(n,"unexpected end of the document within a double quoted scalar"):(n.position++,r=n.position)}oe(n,"unexpected end of the stream within a double quoted scalar")}a(cH,"readDoubleQuotedScalar");function lH(n,e){var t=!0,r,i,s,o=n.tag,c,l=n.anchor,u,f,d,h,p,y=Object.create(null),v,b,w,T;if(T=n.input.charCodeAt(n.position),T===91)f=93,p=!1,c=[];else if(T===123)f=125,p=!0,c={};else return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=c),T=n.input.charCodeAt(++n.position);T!==0;){if(or(n,!0,e),T=n.input.charCodeAt(n.position),T===f)return n.position++,n.tag=o,n.anchor=l,n.kind=p?"mapping":"sequence",n.result=c,!0;t?T===44&&oe(n,"expected the node content, but found ','"):oe(n,"missed comma between flow collection entries"),b=v=w=null,d=h=!1,T===63&&(u=n.input.charCodeAt(n.position+1),Dn(u)&&(d=h=!0,n.position++,or(n,!0,e))),r=n.line,i=n.lineStart,s=n.position,Ul(n,e,wg,!1,!0),b=n.tag,v=n.result,or(n,!0,e),T=n.input.charCodeAt(n.position),(h||n.line===r)&&T===58&&(d=!0,T=n.input.charCodeAt(++n.position),or(n,!0,e),Ul(n,e,wg,!1,!0),w=n.result),p?Bl(n,c,y,b,v,w,r,i,s):d?c.push(Bl(n,null,y,b,v,w,r,i,s)):c.push(v),or(n,!0,e),T=n.input.charCodeAt(n.position),T===44?(t=!0,T=n.input.charCodeAt(++n.position)):t=!1}oe(n,"unexpected end of the stream within a flow collection")}a(lH,"readFlowCollection");function uH(n,e){var t,r,i=Nw,s=!1,o=!1,c=e,l=0,u=!1,f,d;if(d=n.input.charCodeAt(n.position),d===124)r=!1;else if(d===62)r=!0;else return!1;for(n.kind="scalar",n.result="";d!==0;)if(d=n.input.charCodeAt(++n.position),d===43||d===45)Nw===i?i=d===43?xP:Xz:oe(n,"repeat of a chomping mode identifier");else if((f=nH(d))>=0)f===0?oe(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?oe(n,"repeat of an indentation width identifier"):(c=e+f-1,o=!0);else break;if(ec(d)){do d=n.input.charCodeAt(++n.position);while(ec(d));if(d===35)do d=n.input.charCodeAt(++n.position);while(!xs(d)&&d!==0)}for(;d!==0;){for(Vw(n),n.lineIndent=0,d=n.input.charCodeAt(n.position);(!o||n.lineIndent<c)&&d===32;)n.lineIndent++,d=n.input.charCodeAt(++n.position);if(!o&&n.lineIndent>c&&(c=n.lineIndent),xs(d)){l++;continue}if(n.lineIndent<c){i===xP?n.result+=gr.repeat(`
469
+ `;return c.replace(/\n$/,"")}a(lz,"makeSnippet");var uz=lz,fz=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],dz=["scalar","sequence","mapping"];function hz(n){var e={};return n!==null&&Object.keys(n).forEach(function(t){n[t].forEach(function(r){e[String(r)]=t})}),e}a(hz,"compileStyleAliases");function pz(n,e){if(e=e||{},Object.keys(e).forEach(function(t){if(fz.indexOf(t)===-1)throw new vn('Unknown option "'+t+'" is met in definition of "'+n+'" YAML type.')}),this.options=e,this.tag=n,this.kind=e.kind||null,this.resolve=e.resolve||function(){return!0},this.construct=e.construct||function(t){return t},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||!1,this.styleAliases=hz(e.styleAliases||null),dz.indexOf(this.kind)===-1)throw new vn('Unknown kind "'+this.kind+'" is specified for "'+n+'" YAML type.')}a(pz,"Type$1");var Br=pz;function AP(n,e){var t=[];return n[e].forEach(function(r){var i=t.length;t.forEach(function(s,o){s.tag===r.tag&&s.kind===r.kind&&s.multi===r.multi&&(i=o)}),t[i]=r}),t}a(AP,"compileList");function mz(){var n={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,t;function r(i){i.multi?(n.multi[i.kind].push(i),n.multi.fallback.push(i)):n[i.kind][i.tag]=n.fallback[i.tag]=i}for(a(r,"collectType"),e=0,t=arguments.length;e<t;e+=1)arguments[e].forEach(r);return n}a(mz,"compileMap");function Lw(n){return this.extend(n)}a(Lw,"Schema$1");Lw.prototype.extend=a(function(e){var t=[],r=[];if(e instanceof Br)r.push(e);else if(Array.isArray(e))r=r.concat(e);else if(e&&(Array.isArray(e.implicit)||Array.isArray(e.explicit)))e.implicit&&(t=t.concat(e.implicit)),e.explicit&&(r=r.concat(e.explicit));else throw new vn("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(s){if(!(s instanceof Br))throw new vn("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(s.loadKind&&s.loadKind!=="scalar")throw new vn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(s.multi)throw new vn("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(s){if(!(s instanceof Br))throw new vn("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(Lw.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=AP(i,"implicit"),i.compiledExplicit=AP(i,"explicit"),i.compiledTypeMap=mz(i.compiledImplicit,i.compiledExplicit),i},"extend");var VP=Lw,qP=new Br("tag:yaml.org,2002:str",{kind:"scalar",construct:a(function(n){return n!==null?n:""},"construct")}),WP=new Br("tag:yaml.org,2002:seq",{kind:"sequence",construct:a(function(n){return n!==null?n:[]},"construct")}),GP=new Br("tag:yaml.org,2002:map",{kind:"mapping",construct:a(function(n){return n!==null?n:{}},"construct")}),zP=new VP({explicit:[qP,WP,GP]});function gz(n){if(n===null)return!0;var e=n.length;return e===1&&n==="~"||e===4&&(n==="null"||n==="Null"||n==="NULL")}a(gz,"resolveYamlNull");function yz(){return null}a(yz,"constructYamlNull");function _z(n){return n===null}a(_z,"isNull");var HP=new Br("tag:yaml.org,2002:null",{kind:"scalar",resolve:gz,construct:yz,predicate:_z,represent:{canonical:a(function(){return"~"},"canonical"),lowercase:a(function(){return"null"},"lowercase"),uppercase:a(function(){return"NULL"},"uppercase"),camelcase:a(function(){return"Null"},"camelcase"),empty:a(function(){return""},"empty")},defaultStyle:"lowercase"});function Sz(n){if(n===null)return!1;var e=n.length;return e===4&&(n==="true"||n==="True"||n==="TRUE")||e===5&&(n==="false"||n==="False"||n==="FALSE")}a(Sz,"resolveYamlBoolean");function vz(n){return n==="true"||n==="True"||n==="TRUE"}a(vz,"constructYamlBoolean");function bz(n){return Object.prototype.toString.call(n)==="[object Boolean]"}a(bz,"isBoolean");var QP=new Br("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Sz,construct:vz,predicate:bz,represent:{lowercase:a(function(n){return n?"true":"false"},"lowercase"),uppercase:a(function(n){return n?"TRUE":"FALSE"},"uppercase"),camelcase:a(function(n){return n?"True":"False"},"camelcase")},defaultStyle:"lowercase"});function wz(n){return 48<=n&&n<=57||65<=n&&n<=70||97<=n&&n<=102}a(wz,"isHexCode");function Ez(n){return 48<=n&&n<=55}a(Ez,"isOctCode");function Tz(n){return 48<=n&&n<=57}a(Tz,"isDecCode");function Az(n){if(n===null)return!1;var e=n.length,t=0,r=!1,i;if(!e)return!1;if(i=n[t],(i==="-"||i==="+")&&(i=n[++t]),i==="0"){if(t+1===e)return!0;if(i=n[++t],i==="b"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!wz(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<e;t++)if(i=n[t],i!=="_"){if(!Ez(n.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<e;t++)if(i=n[t],i!=="_"){if(!Tz(n.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}a(Az,"resolveYamlInteger");function xz(n){var e=n,t=1,r;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),r=e[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),e=e.slice(1),r=e[0]),e==="0")return 0;if(r==="0"){if(e[1]==="b")return t*parseInt(e.slice(2),2);if(e[1]==="x")return t*parseInt(e.slice(2),16);if(e[1]==="o")return t*parseInt(e.slice(2),8)}return t*parseInt(e,10)}a(xz,"constructYamlInteger");function Cz(n){return Object.prototype.toString.call(n)==="[object Number]"&&n%1===0&&!gr.isNegativeZero(n)}a(Cz,"isInteger");var KP=new Br("tag:yaml.org,2002:int",{kind:"scalar",resolve:Az,construct:xz,predicate:Cz,represent:{binary:a(function(n){return n>=0?"0b"+n.toString(2):"-0b"+n.toString(2).slice(1)},"binary"),octal:a(function(n){return n>=0?"0o"+n.toString(8):"-0o"+n.toString(8).slice(1)},"octal"),decimal:a(function(n){return n.toString(10)},"decimal"),hexadecimal:a(function(n){return n>=0?"0x"+n.toString(16).toUpperCase():"-0x"+n.toString(16).toUpperCase().slice(1)},"hexadecimal")},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Rz=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Iz(n){return!(n===null||!Rz.test(n)||n[n.length-1]==="_")}a(Iz,"resolveYamlFloat");function Pz(n){var e,t;return e=n.replace(/_/g,"").toLowerCase(),t=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:t*parseFloat(e,10)}a(Pz,"constructYamlFloat");var Oz=/^[-+]?[0-9]+e/;function Fz(n,e){var t;if(isNaN(n))switch(e){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===n)switch(e){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===n)switch(e){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(gr.isNegativeZero(n))return"-0.0";return t=n.toString(10),Oz.test(t)?t.replace("e",".e"):t}a(Fz,"representYamlFloat");function Dz(n){return Object.prototype.toString.call(n)==="[object Number]"&&(n%1!==0||gr.isNegativeZero(n))}a(Dz,"isFloat");var YP=new Br("tag:yaml.org,2002:float",{kind:"scalar",resolve:Iz,construct:Pz,predicate:Dz,represent:Fz,defaultStyle:"lowercase"}),XP=zP.extend({implicit:[HP,QP,KP,YP]}),JP=XP,ZP=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),eO=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Nz(n){return n===null?!1:ZP.exec(n)!==null||eO.exec(n)!==null}a(Nz,"resolveYamlTimestamp");function Lz(n){var e,t,r,i,s,o,c,l=0,u=null,f,d,h;if(e=ZP.exec(n),e===null&&(e=eO.exec(n)),e===null)throw new Error("Date resolve error");if(t=+e[1],r=+e[2]-1,i=+e[3],!e[4])return new Date(Date.UTC(t,r,i));if(s=+e[4],o=+e[5],c=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l}return e[9]&&(f=+e[10],d=+(e[11]||0),u=(f*60+d)*6e4,e[9]==="-"&&(u=-u)),h=new Date(Date.UTC(t,r,i,s,o,c,l)),u&&h.setTime(h.getTime()-u),h}a(Lz,"constructYamlTimestamp");function kz(n){return n.toISOString()}a(kz,"representYamlTimestamp");var tO=new Br("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Nz,construct:Lz,instanceOf:Date,represent:kz});function Mz(n){return n==="<<"||n===null}a(Mz,"resolveYamlMerge");var rO=new Br("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Mz}),Bw=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
470
+ \r`;function jz(n){if(n===null)return!1;var e,t,r=0,i=n.length,s=Bw;for(t=0;t<i;t++)if(e=s.indexOf(n.charAt(t)),!(e>64)){if(e<0)return!1;r+=6}return r%8===0}a(jz,"resolveYamlBinary");function $z(n){var e,t,r=n.replace(/[\r\n=]/g,""),i=r.length,s=Bw,o=0,c=[];for(e=0;e<i;e++)e%4===0&&e&&(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)),o=o<<6|s.indexOf(r.charAt(e));return t=i%4*6,t===0?(c.push(o>>16&255),c.push(o>>8&255),c.push(o&255)):t===18?(c.push(o>>10&255),c.push(o>>2&255)):t===12&&c.push(o>>4&255),new Uint8Array(c)}a($z,"constructYamlBinary");function Bz(n){var e="",t=0,r,i,s=n.length,o=Bw;for(r=0;r<s;r++)r%3===0&&r&&(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]),t=(t<<8)+n[r];return i=s%3,i===0?(e+=o[t>>18&63],e+=o[t>>12&63],e+=o[t>>6&63],e+=o[t&63]):i===2?(e+=o[t>>10&63],e+=o[t>>4&63],e+=o[t<<2&63],e+=o[64]):i===1&&(e+=o[t>>2&63],e+=o[t<<4&63],e+=o[64],e+=o[64]),e}a(Bz,"representYamlBinary");function Uz(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}a(Uz,"isBinary");var nO=new Br("tag:yaml.org,2002:binary",{kind:"scalar",resolve:jz,construct:$z,predicate:Uz,represent:Bz}),Vz=Object.prototype.hasOwnProperty,qz=Object.prototype.toString;function Wz(n){if(n===null)return!0;var e=[],t,r,i,s,o,c=n;for(t=0,r=c.length;t<r;t+=1){if(i=c[t],o=!1,qz.call(i)!=="[object Object]")return!1;for(s in i)if(Vz.call(i,s))if(!o)o=!0;else return!1;if(!o)return!1;if(e.indexOf(s)===-1)e.push(s);else return!1}return!0}a(Wz,"resolveYamlOmap");function Gz(n){return n!==null?n:[]}a(Gz,"constructYamlOmap");var iO=new Br("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Wz,construct:Gz}),zz=Object.prototype.toString;function Hz(n){if(n===null)return!0;var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1){if(r=o[e],zz.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;s[e]=[i[0],r[i[0]]]}return!0}a(Hz,"resolveYamlPairs");function Qz(n){if(n===null)return[];var e,t,r,i,s,o=n;for(s=new Array(o.length),e=0,t=o.length;e<t;e+=1)r=o[e],i=Object.keys(r),s[e]=[i[0],r[i[0]]];return s}a(Qz,"constructYamlPairs");var sO=new Br("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Hz,construct:Qz}),Kz=Object.prototype.hasOwnProperty;function Yz(n){if(n===null)return!0;var e,t=n;for(e in t)if(Kz.call(t,e)&&t[e]!==null)return!1;return!0}a(Yz,"resolveYamlSet");function Xz(n){return n!==null?n:{}}a(Xz,"constructYamlSet");var oO=new Br("tag:yaml.org,2002:set",{kind:"mapping",resolve:Yz,construct:Xz}),Uw=JP.extend({implicit:[tO,rO],explicit:[nO,iO,sO,oO]}),ra=Object.prototype.hasOwnProperty,wg=1,aO=2,cO=3,Eg=4,Nw=1,Jz=2,xP=3,Zz=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,eH=/[\x85\u2028\u2029]/,tH=/[,\[\]\{\}]/,lO=/^(?:!|!!|![a-z\-]+!)$/i,uO=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function CP(n){return Object.prototype.toString.call(n)}a(CP,"_class");function xs(n){return n===10||n===13}a(xs,"is_EOL");function ec(n){return n===9||n===32}a(ec,"is_WHITE_SPACE");function Dn(n){return n===9||n===32||n===10||n===13}a(Dn,"is_WS_OR_EOL");function $l(n){return n===44||n===91||n===93||n===123||n===125}a($l,"is_FLOW_INDICATOR");function rH(n){var e;return 48<=n&&n<=57?n-48:(e=n|32,97<=e&&e<=102?e-97+10:-1)}a(rH,"fromHexCode");function nH(n){return n===120?2:n===117?4:n===85?8:0}a(nH,"escapedHexLen");function iH(n){return 48<=n&&n<=57?n-48:-1}a(iH,"fromDecimalCode");function RP(n){return n===48?"\0":n===97?"\x07":n===98?"\b":n===116||n===9?" ":n===110?`
471
+ `:n===118?"\v":n===102?"\f":n===114?"\r":n===101?"\x1B":n===32?" ":n===34?'"':n===47?"/":n===92?"\\":n===78?"\x85":n===95?"\xA0":n===76?"\u2028":n===80?"\u2029":""}a(RP,"simpleEscapeSequence");function sH(n){return n<=65535?String.fromCharCode(n):String.fromCharCode((n-65536>>10)+55296,(n-65536&1023)+56320)}a(sH,"charFromCodepoint");function fO(n,e,t){e==="__proto__"?Object.defineProperty(n,e,{configurable:!0,enumerable:!0,writable:!0,value:t}):n[e]=t}a(fO,"setProperty");var dO=new Array(256),hO=new Array(256);for(Za=0;Za<256;Za++)dO[Za]=RP(Za)?1:0,hO[Za]=RP(Za);var Za;function oH(n,e){this.input=n,this.filename=e.filename||null,this.schema=e.schema||Uw,this.onWarning=e.onWarning||null,this.legacy=e.legacy||!1,this.json=e.json||!1,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=n.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}a(oH,"State$1");function pO(n,e){var t={name:n.filename,buffer:n.input.slice(0,-1),position:n.position,line:n.line,column:n.position-n.lineStart};return t.snippet=uz(t),new vn(e,t)}a(pO,"generateError");function oe(n,e){throw pO(n,e)}a(oe,"throwError");function Tg(n,e){n.onWarning&&n.onWarning.call(null,pO(n,e))}a(Tg,"throwWarning");var IP={YAML:a(function(e,t,r){var i,s,o;e.version!==null&&oe(e,"duplication of %YAML directive"),r.length!==1&&oe(e,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&oe(e,"ill-formed argument of the YAML directive"),s=parseInt(i[1],10),o=parseInt(i[2],10),s!==1&&oe(e,"unacceptable YAML version of the document"),e.version=r[0],e.checkLineBreaks=o<2,o!==1&&o!==2&&Tg(e,"unsupported YAML version of the document")},"handleYamlDirective"),TAG:a(function(e,t,r){var i,s;r.length!==2&&oe(e,"TAG directive accepts exactly two arguments"),i=r[0],s=r[1],lO.test(i)||oe(e,"ill-formed tag handle (first argument) of the TAG directive"),ra.call(e.tagMap,i)&&oe(e,'there is a previously declared suffix for "'+i+'" tag handle'),uO.test(s)||oe(e,"ill-formed tag prefix (second argument) of the TAG directive");try{s=decodeURIComponent(s)}catch{oe(e,"tag prefix is malformed: "+s)}e.tagMap[i]=s},"handleTagDirective")};function ta(n,e,t,r){var i,s,o,c;if(e<t){if(c=n.input.slice(e,t),r)for(i=0,s=c.length;i<s;i+=1)o=c.charCodeAt(i),o===9||32<=o&&o<=1114111||oe(n,"expected valid JSON character");else Zz.test(c)&&oe(n,"the stream contains non-printable characters");n.result+=c}}a(ta,"captureSegment");function PP(n,e,t,r){var i,s,o,c;for(gr.isObject(t)||oe(n,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,c=i.length;o<c;o+=1)s=i[o],ra.call(e,s)||(fO(e,s,t[s]),r[s]=!0)}a(PP,"mergeMappings");function Bl(n,e,t,r,i,s,o,c,l){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&oe(n,"nested arrays are not supported inside keys"),typeof i=="object"&&CP(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&CP(i)==="[object Object]"&&(i="[object Object]"),i=String(i),e===null&&(e={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(s))for(u=0,f=s.length;u<f;u+=1)PP(n,e,s[u],t);else PP(n,e,s,t);else!n.json&&!ra.call(t,i)&&ra.call(e,i)&&(n.line=o||n.line,n.lineStart=c||n.lineStart,n.position=l||n.position,oe(n,"duplicated mapping key")),fO(e,i,s),delete t[i];return e}a(Bl,"storeMappingPair");function Vw(n){var e;e=n.input.charCodeAt(n.position),e===10?n.position++:e===13?(n.position++,n.input.charCodeAt(n.position)===10&&n.position++):oe(n,"a line break is expected"),n.line+=1,n.lineStart=n.position,n.firstTabInLine=-1}a(Vw,"readLineBreak");function or(n,e,t){for(var r=0,i=n.input.charCodeAt(n.position);i!==0;){for(;ec(i);)i===9&&n.firstTabInLine===-1&&(n.firstTabInLine=n.position),i=n.input.charCodeAt(++n.position);if(e&&i===35)do i=n.input.charCodeAt(++n.position);while(i!==10&&i!==13&&i!==0);if(xs(i))for(Vw(n),i=n.input.charCodeAt(n.position),r++,n.lineIndent=0;i===32;)n.lineIndent++,i=n.input.charCodeAt(++n.position);else break}return t!==-1&&r!==0&&n.lineIndent<t&&Tg(n,"deficient indentation"),r}a(or,"skipSeparationSpace");function Cg(n){var e=n.position,t;return t=n.input.charCodeAt(e),!!((t===45||t===46)&&t===n.input.charCodeAt(e+1)&&t===n.input.charCodeAt(e+2)&&(e+=3,t=n.input.charCodeAt(e),t===0||Dn(t)))}a(Cg,"testDocumentSeparator");function qw(n,e){e===1?n.result+=" ":e>1&&(n.result+=gr.repeat(`
472
+ `,e-1))}a(qw,"writeFoldedLines");function aH(n,e,t){var r,i,s,o,c,l,u,f,d=n.kind,h=n.result,p;if(p=n.input.charCodeAt(n.position),Dn(p)||$l(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=n.input.charCodeAt(n.position+1),Dn(i)||t&&$l(i)))return!1;for(n.kind="scalar",n.result="",s=o=n.position,c=!1;p!==0;){if(p===58){if(i=n.input.charCodeAt(n.position+1),Dn(i)||t&&$l(i))break}else if(p===35){if(r=n.input.charCodeAt(n.position-1),Dn(r))break}else{if(n.position===n.lineStart&&Cg(n)||t&&$l(p))break;if(xs(p))if(l=n.line,u=n.lineStart,f=n.lineIndent,or(n,!1,-1),n.lineIndent>=e){c=!0,p=n.input.charCodeAt(n.position);continue}else{n.position=o,n.line=l,n.lineStart=u,n.lineIndent=f;break}}c&&(ta(n,s,o,!1),qw(n,n.line-l),s=o=n.position,c=!1),ec(p)||(o=n.position+1),p=n.input.charCodeAt(++n.position)}return ta(n,s,o,!1),n.result?!0:(n.kind=d,n.result=h,!1)}a(aH,"readPlainScalar");function cH(n,e){var t,r,i;if(t=n.input.charCodeAt(n.position),t!==39)return!1;for(n.kind="scalar",n.result="",n.position++,r=i=n.position;(t=n.input.charCodeAt(n.position))!==0;)if(t===39)if(ta(n,r,n.position,!0),t=n.input.charCodeAt(++n.position),t===39)r=n.position,n.position++,i=n.position;else return!0;else xs(t)?(ta(n,r,i,!0),qw(n,or(n,!1,e)),r=i=n.position):n.position===n.lineStart&&Cg(n)?oe(n,"unexpected end of the document within a single quoted scalar"):(n.position++,i=n.position);oe(n,"unexpected end of the stream within a single quoted scalar")}a(cH,"readSingleQuotedScalar");function lH(n,e){var t,r,i,s,o,c;if(c=n.input.charCodeAt(n.position),c!==34)return!1;for(n.kind="scalar",n.result="",n.position++,t=r=n.position;(c=n.input.charCodeAt(n.position))!==0;){if(c===34)return ta(n,t,n.position,!0),n.position++,!0;if(c===92){if(ta(n,t,n.position,!0),c=n.input.charCodeAt(++n.position),xs(c))or(n,!1,e);else if(c<256&&dO[c])n.result+=hO[c],n.position++;else if((o=nH(c))>0){for(i=o,s=0;i>0;i--)c=n.input.charCodeAt(++n.position),(o=rH(c))>=0?s=(s<<4)+o:oe(n,"expected hexadecimal character");n.result+=sH(s),n.position++}else oe(n,"unknown escape sequence");t=r=n.position}else xs(c)?(ta(n,t,r,!0),qw(n,or(n,!1,e)),t=r=n.position):n.position===n.lineStart&&Cg(n)?oe(n,"unexpected end of the document within a double quoted scalar"):(n.position++,r=n.position)}oe(n,"unexpected end of the stream within a double quoted scalar")}a(lH,"readDoubleQuotedScalar");function uH(n,e){var t=!0,r,i,s,o=n.tag,c,l=n.anchor,u,f,d,h,p,y=Object.create(null),v,b,w,T;if(T=n.input.charCodeAt(n.position),T===91)f=93,p=!1,c=[];else if(T===123)f=125,p=!0,c={};else return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=c),T=n.input.charCodeAt(++n.position);T!==0;){if(or(n,!0,e),T=n.input.charCodeAt(n.position),T===f)return n.position++,n.tag=o,n.anchor=l,n.kind=p?"mapping":"sequence",n.result=c,!0;t?T===44&&oe(n,"expected the node content, but found ','"):oe(n,"missed comma between flow collection entries"),b=v=w=null,d=h=!1,T===63&&(u=n.input.charCodeAt(n.position+1),Dn(u)&&(d=h=!0,n.position++,or(n,!0,e))),r=n.line,i=n.lineStart,s=n.position,Ul(n,e,wg,!1,!0),b=n.tag,v=n.result,or(n,!0,e),T=n.input.charCodeAt(n.position),(h||n.line===r)&&T===58&&(d=!0,T=n.input.charCodeAt(++n.position),or(n,!0,e),Ul(n,e,wg,!1,!0),w=n.result),p?Bl(n,c,y,b,v,w,r,i,s):d?c.push(Bl(n,null,y,b,v,w,r,i,s)):c.push(v),or(n,!0,e),T=n.input.charCodeAt(n.position),T===44?(t=!0,T=n.input.charCodeAt(++n.position)):t=!1}oe(n,"unexpected end of the stream within a flow collection")}a(uH,"readFlowCollection");function fH(n,e){var t,r,i=Nw,s=!1,o=!1,c=e,l=0,u=!1,f,d;if(d=n.input.charCodeAt(n.position),d===124)r=!1;else if(d===62)r=!0;else return!1;for(n.kind="scalar",n.result="";d!==0;)if(d=n.input.charCodeAt(++n.position),d===43||d===45)Nw===i?i=d===43?xP:Jz:oe(n,"repeat of a chomping mode identifier");else if((f=iH(d))>=0)f===0?oe(n,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?oe(n,"repeat of an indentation width identifier"):(c=e+f-1,o=!0);else break;if(ec(d)){do d=n.input.charCodeAt(++n.position);while(ec(d));if(d===35)do d=n.input.charCodeAt(++n.position);while(!xs(d)&&d!==0)}for(;d!==0;){for(Vw(n),n.lineIndent=0,d=n.input.charCodeAt(n.position);(!o||n.lineIndent<c)&&d===32;)n.lineIndent++,d=n.input.charCodeAt(++n.position);if(!o&&n.lineIndent>c&&(c=n.lineIndent),xs(d)){l++;continue}if(n.lineIndent<c){i===xP?n.result+=gr.repeat(`
473
473
  `,s?1+l:l):i===Nw&&s&&(n.result+=`
474
474
  `);break}for(r?ec(d)?(u=!0,n.result+=gr.repeat(`
475
475
  `,s?1+l:l)):u?(u=!1,n.result+=gr.repeat(`
476
476
  `,l+1)):l===0?s&&(n.result+=" "):n.result+=gr.repeat(`
477
477
  `,l):n.result+=gr.repeat(`
478
- `,s?1+l:l),s=!0,o=!0,l=0,t=n.position;!xs(d)&&d!==0;)d=n.input.charCodeAt(++n.position);ta(n,t,n.position,!1)}return!0}a(uH,"readBlockScalar");function OP(n,e){var t,r=n.tag,i=n.anchor,s=[],o,c=!1,l;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=s),l=n.input.charCodeAt(n.position);l!==0&&(n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,oe(n,"tab characters must not be used in indentation")),!(l!==45||(o=n.input.charCodeAt(n.position+1),!Dn(o))));){if(c=!0,n.position++,or(n,!0,-1)&&n.lineIndent<=e){s.push(null),l=n.input.charCodeAt(n.position);continue}if(t=n.line,Ul(n,e,cO,!1,!0),s.push(n.result),or(n,!0,-1),l=n.input.charCodeAt(n.position),(n.line===t||n.lineIndent>e)&&l!==0)oe(n,"bad indentation of a sequence entry");else if(n.lineIndent<e)break}return c?(n.tag=r,n.anchor=i,n.kind="sequence",n.result=s,!0):!1}a(OP,"readBlockSequence");function fH(n,e,t){var r,i,s,o,c,l,u=n.tag,f=n.anchor,d={},h=Object.create(null),p=null,y=null,v=null,b=!1,w=!1,T;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=d),T=n.input.charCodeAt(n.position);T!==0;){if(!b&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,oe(n,"tab characters must not be used in indentation")),r=n.input.charCodeAt(n.position+1),s=n.line,(T===63||T===58)&&Dn(r))T===63?(b&&(Bl(n,d,h,p,y,null,o,c,l),p=y=v=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):oe(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,T=r;else{if(o=n.line,c=n.lineStart,l=n.position,!Ul(n,t,aO,!1,!0))break;if(n.line===s){for(T=n.input.charCodeAt(n.position);ec(T);)T=n.input.charCodeAt(++n.position);if(T===58)T=n.input.charCodeAt(++n.position),Dn(T)||oe(n,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Bl(n,d,h,p,y,null,o,c,l),p=y=v=null),w=!0,b=!1,i=!1,p=n.tag,y=n.result;else if(w)oe(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=u,n.anchor=f,!0}else if(w)oe(n,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.tag=u,n.anchor=f,!0}if((n.line===s||n.lineIndent>e)&&(b&&(o=n.line,c=n.lineStart,l=n.position),Ul(n,e,Eg,!0,i)&&(b?y=n.result:v=n.result),b||(Bl(n,d,h,p,y,v,o,c,l),p=y=v=null),or(n,!0,-1),T=n.input.charCodeAt(n.position)),(n.line===s||n.lineIndent>e)&&T!==0)oe(n,"bad indentation of a mapping entry");else if(n.lineIndent<e)break}return b&&Bl(n,d,h,p,y,null,o,c,l),w&&(n.tag=u,n.anchor=f,n.kind="mapping",n.result=d),w}a(fH,"readBlockMapping");function dH(n){var e,t=!1,r=!1,i,s,o;if(o=n.input.charCodeAt(n.position),o!==33)return!1;if(n.tag!==null&&oe(n,"duplication of a tag property"),o=n.input.charCodeAt(++n.position),o===60?(t=!0,o=n.input.charCodeAt(++n.position)):o===33?(r=!0,i="!!",o=n.input.charCodeAt(++n.position)):i="!",e=n.position,t){do o=n.input.charCodeAt(++n.position);while(o!==0&&o!==62);n.position<n.length?(s=n.input.slice(e,n.position),o=n.input.charCodeAt(++n.position)):oe(n,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Dn(o);)o===33&&(r?oe(n,"tag suffix cannot contain exclamation marks"):(i=n.input.slice(e-1,n.position+1),lO.test(i)||oe(n,"named tag handle cannot contain such characters"),r=!0,e=n.position+1)),o=n.input.charCodeAt(++n.position);s=n.input.slice(e,n.position),eH.test(s)&&oe(n,"tag suffix cannot contain flow indicator characters")}s&&!uO.test(s)&&oe(n,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{oe(n,"tag name is malformed: "+s)}return t?n.tag=s:ra.call(n.tagMap,i)?n.tag=n.tagMap[i]+s:i==="!"?n.tag="!"+s:i==="!!"?n.tag="tag:yaml.org,2002:"+s:oe(n,'undeclared tag handle "'+i+'"'),!0}a(dH,"readTagProperty");function hH(n){var e,t;if(t=n.input.charCodeAt(n.position),t!==38)return!1;for(n.anchor!==null&&oe(n,"duplication of an anchor property"),t=n.input.charCodeAt(++n.position),e=n.position;t!==0&&!Dn(t)&&!$l(t);)t=n.input.charCodeAt(++n.position);return n.position===e&&oe(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(e,n.position),!0}a(hH,"readAnchorProperty");function pH(n){var e,t,r;if(r=n.input.charCodeAt(n.position),r!==42)return!1;for(r=n.input.charCodeAt(++n.position),e=n.position;r!==0&&!Dn(r)&&!$l(r);)r=n.input.charCodeAt(++n.position);return n.position===e&&oe(n,"name of an alias node must contain at least one character"),t=n.input.slice(e,n.position),ra.call(n.anchorMap,t)||oe(n,'unidentified alias "'+t+'"'),n.result=n.anchorMap[t],or(n,!0,-1),!0}a(pH,"readAlias");function Ul(n,e,t,r,i){var s,o,c,l=1,u=!1,f=!1,d,h,p,y,v,b;if(n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null,s=o=c=Eg===t||cO===t,r&&or(n,!0,-1)&&(u=!0,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)),l===1)for(;dH(n)||hH(n);)or(n,!0,-1)?(u=!0,c=s,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)):c=!1;if(c&&(c=u||i),(l===1||Eg===t)&&(wg===t||aO===t?v=e:v=e+1,b=n.position-n.lineStart,l===1?c&&(OP(n,b)||fH(n,b,v))||lH(n,v)?f=!0:(o&&uH(n,v)||aH(n,v)||cH(n,v)?f=!0:pH(n)?(f=!0,(n.tag!==null||n.anchor!==null)&&oe(n,"alias node should not have any properties")):oH(n,v,wg===t)&&(f=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):l===0&&(f=c&&OP(n,b))),n.tag===null)n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);else if(n.tag==="?"){for(n.result!==null&&n.kind!=="scalar"&&oe(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"'),d=0,h=n.implicitTypes.length;d<h;d+=1)if(y=n.implicitTypes[d],y.resolve(n.result)){n.result=y.construct(n.result),n.tag=y.tag,n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);break}}else if(n.tag!=="!"){if(ra.call(n.typeMap[n.kind||"fallback"],n.tag))y=n.typeMap[n.kind||"fallback"][n.tag];else for(y=null,p=n.typeMap.multi[n.kind||"fallback"],d=0,h=p.length;d<h;d+=1)if(n.tag.slice(0,p[d].tag.length)===p[d].tag){y=p[d];break}y||oe(n,"unknown tag !<"+n.tag+">"),n.result!==null&&y.kind!==n.kind&&oe(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+y.kind+'", not "'+n.kind+'"'),y.resolve(n.result,n.tag)?(n.result=y.construct(n.result,n.tag),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):oe(n,"cannot resolve a node with !<"+n.tag+"> explicit tag")}return n.listener!==null&&n.listener("close",n),n.tag!==null||n.anchor!==null||f}a(Ul,"composeNode");function mH(n){var e=n.position,t,r,i,s=!1,o;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(o=n.input.charCodeAt(n.position))!==0&&(or(n,!0,-1),o=n.input.charCodeAt(n.position),!(n.lineIndent>0||o!==37));){for(s=!0,o=n.input.charCodeAt(++n.position),t=n.position;o!==0&&!Dn(o);)o=n.input.charCodeAt(++n.position);for(r=n.input.slice(t,n.position),i=[],r.length<1&&oe(n,"directive name must not be less than one character in length");o!==0;){for(;ec(o);)o=n.input.charCodeAt(++n.position);if(o===35){do o=n.input.charCodeAt(++n.position);while(o!==0&&!xs(o));break}if(xs(o))break;for(t=n.position;o!==0&&!Dn(o);)o=n.input.charCodeAt(++n.position);i.push(n.input.slice(t,n.position))}o!==0&&Vw(n),ra.call(IP,r)?IP[r](n,r,i):Tg(n,'unknown document directive "'+r+'"')}if(or(n,!0,-1),n.lineIndent===0&&n.input.charCodeAt(n.position)===45&&n.input.charCodeAt(n.position+1)===45&&n.input.charCodeAt(n.position+2)===45?(n.position+=3,or(n,!0,-1)):s&&oe(n,"directives end mark is expected"),Ul(n,n.lineIndent-1,Eg,!1,!0),or(n,!0,-1),n.checkLineBreaks&&Zz.test(n.input.slice(e,n.position))&&Tg(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&Cg(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,or(n,!0,-1));return}if(n.position<n.length-1)oe(n,"end of the stream or a document separator is expected");else return}a(mH,"readDocument");function mO(n,e){n=String(n),e=e||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
479
- `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new sH(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,oe(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)mH(t);return t.documents}a(mO,"loadDocuments");function gH(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=mO(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}a(gH,"loadAll$1");function yH(n,e){var t=mO(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new vn("expected a single document in the stream, but found more")}}a(yH,"load$1");var _H=gH,SH=yH,gO={loadAll:_H,load:SH},yO=Object.prototype.toString,_O=Object.prototype.hasOwnProperty,Ww=65279,vH=9,$f=10,bH=13,wH=32,EH=33,TH=34,kw=35,AH=37,xH=38,CH=39,RH=42,SO=44,IH=45,Ag=58,PH=61,OH=62,FH=63,DH=64,vO=91,bO=93,NH=96,wO=123,LH=124,EO=125,Zr={};Zr[0]="\\0";Zr[7]="\\a";Zr[8]="\\b";Zr[9]="\\t";Zr[10]="\\n";Zr[11]="\\v";Zr[12]="\\f";Zr[13]="\\r";Zr[27]="\\e";Zr[34]='\\"';Zr[92]="\\\\";Zr[133]="\\N";Zr[160]="\\_";Zr[8232]="\\L";Zr[8233]="\\P";var kH=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],MH=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function jH(n,e){var t,r,i,s,o,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)o=r[i],c=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=n.compiledTypeMap.fallback[o],l&&_O.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[o]=c;return t}a(jH,"compileStyleMap");function $H(n){var e,t,r;if(e=n.toString(16).toUpperCase(),n<=255)t="x",r=2;else if(n<=65535)t="u",r=4;else if(n<=4294967295)t="U",r=8;else throw new vn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+gr.repeat("0",r-e.length)+e}a($H,"encodeHex");var BH=1,Bf=2;function UH(n){this.schema=n.schema||Uw,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=gr.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=jH(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?Bf:BH,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(UH,"State");function FP(n,e){for(var t=gr.repeat(" ",e),r=0,i=-1,s="",o,c=n.length;r<c;)i=n.indexOf(`
478
+ `,s?1+l:l),s=!0,o=!0,l=0,t=n.position;!xs(d)&&d!==0;)d=n.input.charCodeAt(++n.position);ta(n,t,n.position,!1)}return!0}a(fH,"readBlockScalar");function OP(n,e){var t,r=n.tag,i=n.anchor,s=[],o,c=!1,l;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=s),l=n.input.charCodeAt(n.position);l!==0&&(n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,oe(n,"tab characters must not be used in indentation")),!(l!==45||(o=n.input.charCodeAt(n.position+1),!Dn(o))));){if(c=!0,n.position++,or(n,!0,-1)&&n.lineIndent<=e){s.push(null),l=n.input.charCodeAt(n.position);continue}if(t=n.line,Ul(n,e,cO,!1,!0),s.push(n.result),or(n,!0,-1),l=n.input.charCodeAt(n.position),(n.line===t||n.lineIndent>e)&&l!==0)oe(n,"bad indentation of a sequence entry");else if(n.lineIndent<e)break}return c?(n.tag=r,n.anchor=i,n.kind="sequence",n.result=s,!0):!1}a(OP,"readBlockSequence");function dH(n,e,t){var r,i,s,o,c,l,u=n.tag,f=n.anchor,d={},h=Object.create(null),p=null,y=null,v=null,b=!1,w=!1,T;if(n.firstTabInLine!==-1)return!1;for(n.anchor!==null&&(n.anchorMap[n.anchor]=d),T=n.input.charCodeAt(n.position);T!==0;){if(!b&&n.firstTabInLine!==-1&&(n.position=n.firstTabInLine,oe(n,"tab characters must not be used in indentation")),r=n.input.charCodeAt(n.position+1),s=n.line,(T===63||T===58)&&Dn(r))T===63?(b&&(Bl(n,d,h,p,y,null,o,c,l),p=y=v=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):oe(n,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),n.position+=1,T=r;else{if(o=n.line,c=n.lineStart,l=n.position,!Ul(n,t,aO,!1,!0))break;if(n.line===s){for(T=n.input.charCodeAt(n.position);ec(T);)T=n.input.charCodeAt(++n.position);if(T===58)T=n.input.charCodeAt(++n.position),Dn(T)||oe(n,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Bl(n,d,h,p,y,null,o,c,l),p=y=v=null),w=!0,b=!1,i=!1,p=n.tag,y=n.result;else if(w)oe(n,"can not read an implicit mapping pair; a colon is missed");else return n.tag=u,n.anchor=f,!0}else if(w)oe(n,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.tag=u,n.anchor=f,!0}if((n.line===s||n.lineIndent>e)&&(b&&(o=n.line,c=n.lineStart,l=n.position),Ul(n,e,Eg,!0,i)&&(b?y=n.result:v=n.result),b||(Bl(n,d,h,p,y,v,o,c,l),p=y=v=null),or(n,!0,-1),T=n.input.charCodeAt(n.position)),(n.line===s||n.lineIndent>e)&&T!==0)oe(n,"bad indentation of a mapping entry");else if(n.lineIndent<e)break}return b&&Bl(n,d,h,p,y,null,o,c,l),w&&(n.tag=u,n.anchor=f,n.kind="mapping",n.result=d),w}a(dH,"readBlockMapping");function hH(n){var e,t=!1,r=!1,i,s,o;if(o=n.input.charCodeAt(n.position),o!==33)return!1;if(n.tag!==null&&oe(n,"duplication of a tag property"),o=n.input.charCodeAt(++n.position),o===60?(t=!0,o=n.input.charCodeAt(++n.position)):o===33?(r=!0,i="!!",o=n.input.charCodeAt(++n.position)):i="!",e=n.position,t){do o=n.input.charCodeAt(++n.position);while(o!==0&&o!==62);n.position<n.length?(s=n.input.slice(e,n.position),o=n.input.charCodeAt(++n.position)):oe(n,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Dn(o);)o===33&&(r?oe(n,"tag suffix cannot contain exclamation marks"):(i=n.input.slice(e-1,n.position+1),lO.test(i)||oe(n,"named tag handle cannot contain such characters"),r=!0,e=n.position+1)),o=n.input.charCodeAt(++n.position);s=n.input.slice(e,n.position),tH.test(s)&&oe(n,"tag suffix cannot contain flow indicator characters")}s&&!uO.test(s)&&oe(n,"tag name cannot contain such characters: "+s);try{s=decodeURIComponent(s)}catch{oe(n,"tag name is malformed: "+s)}return t?n.tag=s:ra.call(n.tagMap,i)?n.tag=n.tagMap[i]+s:i==="!"?n.tag="!"+s:i==="!!"?n.tag="tag:yaml.org,2002:"+s:oe(n,'undeclared tag handle "'+i+'"'),!0}a(hH,"readTagProperty");function pH(n){var e,t;if(t=n.input.charCodeAt(n.position),t!==38)return!1;for(n.anchor!==null&&oe(n,"duplication of an anchor property"),t=n.input.charCodeAt(++n.position),e=n.position;t!==0&&!Dn(t)&&!$l(t);)t=n.input.charCodeAt(++n.position);return n.position===e&&oe(n,"name of an anchor node must contain at least one character"),n.anchor=n.input.slice(e,n.position),!0}a(pH,"readAnchorProperty");function mH(n){var e,t,r;if(r=n.input.charCodeAt(n.position),r!==42)return!1;for(r=n.input.charCodeAt(++n.position),e=n.position;r!==0&&!Dn(r)&&!$l(r);)r=n.input.charCodeAt(++n.position);return n.position===e&&oe(n,"name of an alias node must contain at least one character"),t=n.input.slice(e,n.position),ra.call(n.anchorMap,t)||oe(n,'unidentified alias "'+t+'"'),n.result=n.anchorMap[t],or(n,!0,-1),!0}a(mH,"readAlias");function Ul(n,e,t,r,i){var s,o,c,l=1,u=!1,f=!1,d,h,p,y,v,b;if(n.listener!==null&&n.listener("open",n),n.tag=null,n.anchor=null,n.kind=null,n.result=null,s=o=c=Eg===t||cO===t,r&&or(n,!0,-1)&&(u=!0,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)),l===1)for(;hH(n)||pH(n);)or(n,!0,-1)?(u=!0,c=s,n.lineIndent>e?l=1:n.lineIndent===e?l=0:n.lineIndent<e&&(l=-1)):c=!1;if(c&&(c=u||i),(l===1||Eg===t)&&(wg===t||aO===t?v=e:v=e+1,b=n.position-n.lineStart,l===1?c&&(OP(n,b)||dH(n,b,v))||uH(n,v)?f=!0:(o&&fH(n,v)||cH(n,v)||lH(n,v)?f=!0:mH(n)?(f=!0,(n.tag!==null||n.anchor!==null)&&oe(n,"alias node should not have any properties")):aH(n,v,wg===t)&&(f=!0,n.tag===null&&(n.tag="?")),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):l===0&&(f=c&&OP(n,b))),n.tag===null)n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);else if(n.tag==="?"){for(n.result!==null&&n.kind!=="scalar"&&oe(n,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+n.kind+'"'),d=0,h=n.implicitTypes.length;d<h;d+=1)if(y=n.implicitTypes[d],y.resolve(n.result)){n.result=y.construct(n.result),n.tag=y.tag,n.anchor!==null&&(n.anchorMap[n.anchor]=n.result);break}}else if(n.tag!=="!"){if(ra.call(n.typeMap[n.kind||"fallback"],n.tag))y=n.typeMap[n.kind||"fallback"][n.tag];else for(y=null,p=n.typeMap.multi[n.kind||"fallback"],d=0,h=p.length;d<h;d+=1)if(n.tag.slice(0,p[d].tag.length)===p[d].tag){y=p[d];break}y||oe(n,"unknown tag !<"+n.tag+">"),n.result!==null&&y.kind!==n.kind&&oe(n,"unacceptable node kind for !<"+n.tag+'> tag; it should be "'+y.kind+'", not "'+n.kind+'"'),y.resolve(n.result,n.tag)?(n.result=y.construct(n.result,n.tag),n.anchor!==null&&(n.anchorMap[n.anchor]=n.result)):oe(n,"cannot resolve a node with !<"+n.tag+"> explicit tag")}return n.listener!==null&&n.listener("close",n),n.tag!==null||n.anchor!==null||f}a(Ul,"composeNode");function gH(n){var e=n.position,t,r,i,s=!1,o;for(n.version=null,n.checkLineBreaks=n.legacy,n.tagMap=Object.create(null),n.anchorMap=Object.create(null);(o=n.input.charCodeAt(n.position))!==0&&(or(n,!0,-1),o=n.input.charCodeAt(n.position),!(n.lineIndent>0||o!==37));){for(s=!0,o=n.input.charCodeAt(++n.position),t=n.position;o!==0&&!Dn(o);)o=n.input.charCodeAt(++n.position);for(r=n.input.slice(t,n.position),i=[],r.length<1&&oe(n,"directive name must not be less than one character in length");o!==0;){for(;ec(o);)o=n.input.charCodeAt(++n.position);if(o===35){do o=n.input.charCodeAt(++n.position);while(o!==0&&!xs(o));break}if(xs(o))break;for(t=n.position;o!==0&&!Dn(o);)o=n.input.charCodeAt(++n.position);i.push(n.input.slice(t,n.position))}o!==0&&Vw(n),ra.call(IP,r)?IP[r](n,r,i):Tg(n,'unknown document directive "'+r+'"')}if(or(n,!0,-1),n.lineIndent===0&&n.input.charCodeAt(n.position)===45&&n.input.charCodeAt(n.position+1)===45&&n.input.charCodeAt(n.position+2)===45?(n.position+=3,or(n,!0,-1)):s&&oe(n,"directives end mark is expected"),Ul(n,n.lineIndent-1,Eg,!1,!0),or(n,!0,-1),n.checkLineBreaks&&eH.test(n.input.slice(e,n.position))&&Tg(n,"non-ASCII line breaks are interpreted as content"),n.documents.push(n.result),n.position===n.lineStart&&Cg(n)){n.input.charCodeAt(n.position)===46&&(n.position+=3,or(n,!0,-1));return}if(n.position<n.length-1)oe(n,"end of the stream or a document separator is expected");else return}a(gH,"readDocument");function mO(n,e){n=String(n),e=e||{},n.length!==0&&(n.charCodeAt(n.length-1)!==10&&n.charCodeAt(n.length-1)!==13&&(n+=`
479
+ `),n.charCodeAt(0)===65279&&(n=n.slice(1)));var t=new oH(n,e),r=n.indexOf("\0");for(r!==-1&&(t.position=r,oe(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)gH(t);return t.documents}a(mO,"loadDocuments");function yH(n,e,t){e!==null&&typeof e=="object"&&typeof t>"u"&&(t=e,e=null);var r=mO(n,t);if(typeof e!="function")return r;for(var i=0,s=r.length;i<s;i+=1)e(r[i])}a(yH,"loadAll$1");function _H(n,e){var t=mO(n,e);if(t.length!==0){if(t.length===1)return t[0];throw new vn("expected a single document in the stream, but found more")}}a(_H,"load$1");var SH=yH,vH=_H,gO={loadAll:SH,load:vH},yO=Object.prototype.toString,_O=Object.prototype.hasOwnProperty,Ww=65279,bH=9,$f=10,wH=13,EH=32,TH=33,AH=34,kw=35,xH=37,CH=38,RH=39,IH=42,SO=44,PH=45,Ag=58,OH=61,FH=62,DH=63,NH=64,vO=91,bO=93,LH=96,wO=123,kH=124,EO=125,Zr={};Zr[0]="\\0";Zr[7]="\\a";Zr[8]="\\b";Zr[9]="\\t";Zr[10]="\\n";Zr[11]="\\v";Zr[12]="\\f";Zr[13]="\\r";Zr[27]="\\e";Zr[34]='\\"';Zr[92]="\\\\";Zr[133]="\\N";Zr[160]="\\_";Zr[8232]="\\L";Zr[8233]="\\P";var MH=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],jH=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function $H(n,e){var t,r,i,s,o,c,l;if(e===null)return{};for(t={},r=Object.keys(e),i=0,s=r.length;i<s;i+=1)o=r[i],c=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=n.compiledTypeMap.fallback[o],l&&_O.call(l.styleAliases,c)&&(c=l.styleAliases[c]),t[o]=c;return t}a($H,"compileStyleMap");function BH(n){var e,t,r;if(e=n.toString(16).toUpperCase(),n<=255)t="x",r=2;else if(n<=65535)t="u",r=4;else if(n<=4294967295)t="U",r=8;else throw new vn("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+gr.repeat("0",r-e.length)+e}a(BH,"encodeHex");var UH=1,Bf=2;function VH(n){this.schema=n.schema||Uw,this.indent=Math.max(1,n.indent||2),this.noArrayIndent=n.noArrayIndent||!1,this.skipInvalid=n.skipInvalid||!1,this.flowLevel=gr.isNothing(n.flowLevel)?-1:n.flowLevel,this.styleMap=$H(this.schema,n.styles||null),this.sortKeys=n.sortKeys||!1,this.lineWidth=n.lineWidth||80,this.noRefs=n.noRefs||!1,this.noCompatMode=n.noCompatMode||!1,this.condenseFlow=n.condenseFlow||!1,this.quotingType=n.quotingType==='"'?Bf:UH,this.forceQuotes=n.forceQuotes||!1,this.replacer=typeof n.replacer=="function"?n.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}a(VH,"State");function FP(n,e){for(var t=gr.repeat(" ",e),r=0,i=-1,s="",o,c=n.length;r<c;)i=n.indexOf(`
480
480
  `,r),i===-1?(o=n.slice(r),r=c):(o=n.slice(r,i+1),r=i+1),o.length&&o!==`
481
481
  `&&(s+=t),s+=o;return s}a(FP,"indentString");function Mw(n,e){return`
482
- `+gr.repeat(" ",n.indent*e)}a(Mw,"generateNextLine");function VH(n,e){var t,r,i;for(t=0,r=n.implicitTypes.length;t<r;t+=1)if(i=n.implicitTypes[t],i.resolve(e))return!0;return!1}a(VH,"testImplicitResolving");function xg(n){return n===wH||n===vH}a(xg,"isWhitespace");function Uf(n){return 32<=n&&n<=126||161<=n&&n<=55295&&n!==8232&&n!==8233||57344<=n&&n<=65533&&n!==Ww||65536<=n&&n<=1114111}a(Uf,"isPrintable");function DP(n){return Uf(n)&&n!==Ww&&n!==bH&&n!==$f}a(DP,"isNsCharOrWhitespace");function NP(n,e,t){var r=DP(n),i=r&&!xg(n);return(t?r:r&&n!==SO&&n!==vO&&n!==bO&&n!==wO&&n!==EO)&&n!==kw&&!(e===Ag&&!i)||DP(e)&&!xg(e)&&n===kw||e===Ag&&i}a(NP,"isPlainSafe");function qH(n){return Uf(n)&&n!==Ww&&!xg(n)&&n!==IH&&n!==FH&&n!==Ag&&n!==SO&&n!==vO&&n!==bO&&n!==wO&&n!==EO&&n!==kw&&n!==xH&&n!==RH&&n!==EH&&n!==LH&&n!==PH&&n!==OH&&n!==CH&&n!==TH&&n!==AH&&n!==DH&&n!==NH}a(qH,"isPlainSafeFirst");function WH(n){return!xg(n)&&n!==Ag}a(WH,"isPlainSafeLast");function Mf(n,e){var t=n.charCodeAt(e),r;return t>=55296&&t<=56319&&e+1<n.length&&(r=n.charCodeAt(e+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}a(Mf,"codePointAt");function TO(n){var e=/^\n* /;return e.test(n)}a(TO,"needIndentIndicator");var AO=1,jw=2,xO=3,CO=4,jl=5;function GH(n,e,t,r,i,s,o,c){var l,u=0,f=null,d=!1,h=!1,p=r!==-1,y=-1,v=qH(Mf(n,0))&&WH(Mf(n,n.length-1));if(e||o)for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Mf(n,l),!Uf(u))return jl;v=v&&NP(u,f,c),f=u}else{for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Mf(n,l),u===$f)d=!0,p&&(h=h||l-y-1>r&&n[y+1]!==" ",y=l);else if(!Uf(u))return jl;v=v&&NP(u,f,c),f=u}h=h||p&&l-y-1>r&&n[y+1]!==" "}return!d&&!h?v&&!o&&!i(n)?AO:s===Bf?jl:jw:t>9&&TO(n)?jl:o?s===Bf?jl:jw:h?CO:xO}a(GH,"chooseScalarStyle");function zH(n,e,t,r,i){n.dump=(function(){if(e.length===0)return n.quotingType===Bf?'""':"''";if(!n.noCompatMode&&(kH.indexOf(e)!==-1||MH.test(e)))return n.quotingType===Bf?'"'+e+'"':"'"+e+"'";var s=n.indent*Math.max(1,t),o=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-s),c=r||n.flowLevel>-1&&t>=n.flowLevel;function l(u){return VH(n,u)}switch(a(l,"testAmbiguity"),GH(e,c,n.indent,o,l,n.quotingType,n.forceQuotes&&!r,i)){case AO:return e;case jw:return"'"+e.replace(/'/g,"''")+"'";case xO:return"|"+LP(e,n.indent)+kP(FP(e,s));case CO:return">"+LP(e,n.indent)+kP(FP(HH(e,o),s));case jl:return'"'+QH(e)+'"';default:throw new vn("impossible error: invalid scalar style")}})()}a(zH,"writeScalar");function LP(n,e){var t=TO(n)?String(e):"",r=n[n.length-1]===`
482
+ `+gr.repeat(" ",n.indent*e)}a(Mw,"generateNextLine");function qH(n,e){var t,r,i;for(t=0,r=n.implicitTypes.length;t<r;t+=1)if(i=n.implicitTypes[t],i.resolve(e))return!0;return!1}a(qH,"testImplicitResolving");function xg(n){return n===EH||n===bH}a(xg,"isWhitespace");function Uf(n){return 32<=n&&n<=126||161<=n&&n<=55295&&n!==8232&&n!==8233||57344<=n&&n<=65533&&n!==Ww||65536<=n&&n<=1114111}a(Uf,"isPrintable");function DP(n){return Uf(n)&&n!==Ww&&n!==wH&&n!==$f}a(DP,"isNsCharOrWhitespace");function NP(n,e,t){var r=DP(n),i=r&&!xg(n);return(t?r:r&&n!==SO&&n!==vO&&n!==bO&&n!==wO&&n!==EO)&&n!==kw&&!(e===Ag&&!i)||DP(e)&&!xg(e)&&n===kw||e===Ag&&i}a(NP,"isPlainSafe");function WH(n){return Uf(n)&&n!==Ww&&!xg(n)&&n!==PH&&n!==DH&&n!==Ag&&n!==SO&&n!==vO&&n!==bO&&n!==wO&&n!==EO&&n!==kw&&n!==CH&&n!==IH&&n!==TH&&n!==kH&&n!==OH&&n!==FH&&n!==RH&&n!==AH&&n!==xH&&n!==NH&&n!==LH}a(WH,"isPlainSafeFirst");function GH(n){return!xg(n)&&n!==Ag}a(GH,"isPlainSafeLast");function Mf(n,e){var t=n.charCodeAt(e),r;return t>=55296&&t<=56319&&e+1<n.length&&(r=n.charCodeAt(e+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}a(Mf,"codePointAt");function TO(n){var e=/^\n* /;return e.test(n)}a(TO,"needIndentIndicator");var AO=1,jw=2,xO=3,CO=4,jl=5;function zH(n,e,t,r,i,s,o,c){var l,u=0,f=null,d=!1,h=!1,p=r!==-1,y=-1,v=WH(Mf(n,0))&&GH(Mf(n,n.length-1));if(e||o)for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Mf(n,l),!Uf(u))return jl;v=v&&NP(u,f,c),f=u}else{for(l=0;l<n.length;u>=65536?l+=2:l++){if(u=Mf(n,l),u===$f)d=!0,p&&(h=h||l-y-1>r&&n[y+1]!==" ",y=l);else if(!Uf(u))return jl;v=v&&NP(u,f,c),f=u}h=h||p&&l-y-1>r&&n[y+1]!==" "}return!d&&!h?v&&!o&&!i(n)?AO:s===Bf?jl:jw:t>9&&TO(n)?jl:o?s===Bf?jl:jw:h?CO:xO}a(zH,"chooseScalarStyle");function HH(n,e,t,r,i){n.dump=(function(){if(e.length===0)return n.quotingType===Bf?'""':"''";if(!n.noCompatMode&&(MH.indexOf(e)!==-1||jH.test(e)))return n.quotingType===Bf?'"'+e+'"':"'"+e+"'";var s=n.indent*Math.max(1,t),o=n.lineWidth===-1?-1:Math.max(Math.min(n.lineWidth,40),n.lineWidth-s),c=r||n.flowLevel>-1&&t>=n.flowLevel;function l(u){return qH(n,u)}switch(a(l,"testAmbiguity"),zH(e,c,n.indent,o,l,n.quotingType,n.forceQuotes&&!r,i)){case AO:return e;case jw:return"'"+e.replace(/'/g,"''")+"'";case xO:return"|"+LP(e,n.indent)+kP(FP(e,s));case CO:return">"+LP(e,n.indent)+kP(FP(QH(e,o),s));case jl:return'"'+KH(e)+'"';default:throw new vn("impossible error: invalid scalar style")}})()}a(HH,"writeScalar");function LP(n,e){var t=TO(n)?String(e):"",r=n[n.length-1]===`
483
483
  `,i=r&&(n[n.length-2]===`
484
484
  `||n===`
485
485
  `),s=i?"+":r?"":"-";return t+s+`
486
486
  `}a(LP,"blockHeader");function kP(n){return n[n.length-1]===`
487
- `?n.slice(0,-1):n}a(kP,"dropEndingNewline");function HH(n,e){for(var t=/(\n+)([^\n]*)/g,r=(function(){var u=n.indexOf(`
487
+ `?n.slice(0,-1):n}a(kP,"dropEndingNewline");function QH(n,e){for(var t=/(\n+)([^\n]*)/g,r=(function(){var u=n.indexOf(`
488
488
  `);return u=u!==-1?u:n.length,t.lastIndex=u,MP(n.slice(0,u),e)})(),i=n[0]===`
489
489
  `||n[0]===" ",s,o;o=t.exec(n);){var c=o[1],l=o[2];s=l[0]===" ",r+=c+(!i&&!s&&l!==""?`
490
- `:"")+MP(l,e),i=s}return r}a(HH,"foldString");function MP(n,e){if(n===""||n[0]===" ")return n;for(var t=/ [^ ]/g,r,i=0,s,o=0,c=0,l="";r=t.exec(n);)c=r.index,c-i>e&&(s=o>i?o:c,l+=`
490
+ `:"")+MP(l,e),i=s}return r}a(QH,"foldString");function MP(n,e){if(n===""||n[0]===" ")return n;for(var t=/ [^ ]/g,r,i=0,s,o=0,c=0,l="";r=t.exec(n);)c=r.index,c-i>e&&(s=o>i?o:c,l+=`
491
491
  `+n.slice(i,s),i=s+1),o=c;return l+=`
492
492
  `,n.length-i>e&&o>i?l+=n.slice(i,o)+`
493
- `+n.slice(o+1):l+=n.slice(i),l.slice(1)}a(MP,"foldLine");function QH(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=Mf(n,i),r=Zr[t],!r&&Uf(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||$H(t);return e}a(QH,"escapeString");function KH(n,e,t){var r="",i=n.tag,s,o,c;for(s=0,o=t.length;s<o;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(yo(n,e,c,!1,!1)||typeof c>"u"&&yo(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}a(KH,"writeFlowSequence");function jP(n,e,t,r){var i="",s=n.tag,o,c,l;for(o=0,c=t.length;o<c;o+=1)l=t[o],n.replacer&&(l=n.replacer.call(t,String(o),l)),(yo(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&yo(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Mw(n,e)),n.dump&&$f===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}a(jP,"writeBlockSequence");function YH(n,e,t){var r="",i=n.tag,s=Object.keys(t),o,c,l,u,f;for(o=0,c=s.length;o<c;o+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[o],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),yo(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),yo(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}a(YH,"writeFlowMapping");function XH(n,e,t,r){var i="",s=n.tag,o=Object.keys(t),c,l,u,f,d,h;if(n.sortKeys===!0)o.sort();else if(typeof n.sortKeys=="function")o.sort(n.sortKeys);else if(n.sortKeys)throw new vn("sortKeys must be a boolean or a function");for(c=0,l=o.length;c<l;c+=1)h="",(!r||i!=="")&&(h+=Mw(n,e)),u=o[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),yo(n,e+1,u,!0,!0,!0)&&(d=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,d&&(n.dump&&$f===n.dump.charCodeAt(0)?h+="?":h+="? "),h+=n.dump,d&&(h+=Mw(n,e)),yo(n,e+1,f,!0,d)&&(n.dump&&$f===n.dump.charCodeAt(0)?h+=":":h+=": ",h+=n.dump,i+=h));n.tag=s,n.dump=i||"{}"}a(XH,"writeBlockMapping");function $P(n,e,t){var r,i,s,o,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,o=i.length;s<o;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof e=="object"&&e instanceof c.instanceOf)&&(!c.predicate||c.predicate(e))){if(t?c.multi&&c.representName?n.tag=c.representName(e):n.tag=c.tag:n.tag="?",c.represent){if(l=n.styleMap[c.tag]||c.defaultStyle,yO.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(_O.call(c.represent,l))r=c.represent[l](e,l);else throw new vn("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}a($P,"detectType");function yo(n,e,t,r,i,s,o){n.tag=null,n.dump=t,$P(n,t,!1)||$P(n,t,!0);var c=yO.call(n.dump),l=r,u;r&&(r=n.flowLevel<0||n.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",d,h;if(f&&(d=n.duplicates.indexOf(t),h=d!==-1),(n.tag!==null&&n.tag!=="?"||h||n.indent!==2&&e>0)&&(i=!1),h&&n.usedDuplicates[d])n.dump="*ref_"+d;else{if(f&&h&&!n.usedDuplicates[d]&&(n.usedDuplicates[d]=!0),c==="[object Object]")r&&Object.keys(n.dump).length!==0?(XH(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(YH(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!o&&e>0?jP(n,e-1,n.dump,i):jP(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(KH(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&zH(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new vn("unacceptable kind of an object to dump "+c)}n.tag!==null&&n.tag!=="?"&&(u=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",n.dump=u+" "+n.dump)}return!0}a(yo,"writeNode");function JH(n,e){var t=[],r=[],i,s;for($w(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}a(JH,"getDuplicateReferences");function $w(n,e,t){var r,i,s;if(n!==null&&typeof n=="object")if(i=e.indexOf(n),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(n),Array.isArray(n))for(i=0,s=n.length;i<s;i+=1)$w(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)$w(n[r[i]],e,t)}a($w,"inspectNode");function ZH(n,e){e=e||{};var t=new UH(e);t.noRefs||JH(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),yo(t,0,r,!0,!0)?t.dump+`
494
- `:""}a(ZH,"dump$1");var eQ=ZH,tQ={dump:eQ};function Gw(n,e){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}a(Gw,"renamed");var rQ=Br,nQ=VP,iQ=zP,sQ=XP,oQ=JP,aQ=Uw,cQ=gO.load,lQ=gO.loadAll,uQ=tQ.dump,fQ=vn,dQ={binary:nO,float:YP,map:GP,null:HP,pairs:sO,set:oO,timestamp:tO,bool:QP,int:KP,merge:rO,omap:iO,seq:WP,str:qP},hQ=Gw("safeLoad","load"),pQ=Gw("safeLoadAll","loadAll"),mQ=Gw("safeDump","dump"),ar={Type:rQ,Schema:nQ,FAILSAFE_SCHEMA:iQ,JSON_SCHEMA:sQ,CORE_SCHEMA:oQ,DEFAULT_SCHEMA:aQ,load:cQ,loadAll:lQ,dump:uQ,YAMLException:fQ,types:dQ,safeLoad:hQ,safeLoadAll:pQ,safeDump:mQ};var dE=H(go()),ic=H(require("path"));var KO=H(BO(),1);var qf=a(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var EQ={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Wf=a(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),TQ=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),UO=a(n=>n.join(""),"rangesToString"),VO=a((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let v=n.charAt(s);if((v==="!"||v==="^")&&s===t+1){u=!0,s++;continue}if(v==="]"&&o&&!l){f=s+1;break}if(o=!0,v==="\\"&&!l){l=!0,s++;continue}if(v==="["&&!l){for(let[b,[w,T,I]]of Object.entries(EQ))if(n.startsWith(b,s)){if(d)return["$.",!1,n.length-t,!0];s+=b.length,I?i.push(w):r.push(w),c=c||T;continue e}}if(l=!1,d){v>d?r.push(Wf(d)+"-"+Wf(v)):v===d&&r.push(Wf(v)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Wf(v+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=v,s+=2;continue}r.push(Wf(v)),s++}if(f<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let v=r[0].length===2?r[0].slice(-1):r[0];return[TQ(v),!1,f-t,!1]}let h="["+(u?"^":"")+UO(r)+"]",p="["+(u?"":"^")+UO(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var qi=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Nn,AQ=new Set(["!","?","+","*","@"]),Qw=a(n=>AQ.has(n),"isExtglobType"),qO=a(n=>Qw(n.type),"isExtglobAST"),xQ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),CQ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),RQ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),WO=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),IQ="(?!(?:^|/)\\.\\.?(?:$|/))",Rg="(?!\\.)",PQ=new Set(["[","."]),OQ=new Set(["..","."]),FQ=new Set("().*{}+?[]^$\\!"),DQ=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Kw="[^/]",GO=Kw+"*?",zO=Kw+"+?",tc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,r=t.#c;for(;r;){for(let i=t.#_+1;!r.type&&i<r.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}t=r,r=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Nn&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let r=e.#t[t];if(!(r instanceof Nn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Nn(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let v=r,b="";for(;v<e.length;){let w=e.charAt(v++);if(c||w==="\\"){c=!c,b+=w;continue}if(l){v===u+1?(w==="^"||w==="!")&&(f=!0):w==="]"&&!(v===u+2&&f)&&(l=!1),b+=w;continue}else if(w==="["){l=!0,u=v,f=!1,b+=w;continue}if(!i.noext&&Qw(w)&&e.charAt(v)==="("&&s<=o){t.push(b),b="";let I=new Nn(w,t);v=Nn.#g(e,I,v,i,s+1),t.push(I);continue}b+=w}return t.push(b),v}let d=r+1,h=new Nn(null,t),p=[],y="";for(;d<e.length;){let v=e.charAt(d++);if(c||v==="\\"){c=!c,y+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(f=!0):v==="]"&&!(d===u+2&&f)&&(l=!1),y+=v;continue}else if(v==="["){l=!0,u=d,f=!1,y+=v;continue}if(Qw(v)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(v))){let w=t&&t.#y(v)?0:1;h.push(y),y="";let T=new Nn(v,h);h.push(T),d=Nn.#g(e,T,d,i,s+w);continue}if(v==="|"){h.push(y),y="",p.push(h),h=new Nn(null,t);continue}if(v===")")return y===""&&t.#t.length===0&&(t.#o=!0),h.push(y),y="",t.push(...p,h),d;y+=v}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,CQ)}#m(e,t=xQ){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let r=e.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,t)}#y(e,t=RQ){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Nn(null,r,this.options);i.#t.push(""),r.push(i),this.#E(e,t)}#E(e,t){let r=e.#t[0];this.#t.splice(t,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!WO.get(this.type)?.has(e)}#S(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=WO.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#o=!1}#v(){if(qO(this)){let e=0,t=!1;do{t=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#v(),this.#m(i)?(t=!1,this.#E(i,r)):this.#d(i)?(t=!1,this.#f(i,r)):this.#S(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#v();this.#l=void 0}static fromGlob(e,t={}){let r=new Nn(null,void 0,t);return Nn.#g(e,r,0,t,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#v(),this.#p()),!qO(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[y,v,b,w]=typeof p=="string"?Nn.#x(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||b,this.#r=this.#r||w,y}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&OQ.has(this.#t[0]))){let y=PQ,v=t&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),b=!t&&!e&&y.has(u.charAt(0));f=v?IQ:b?Rg:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,qi(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,qi(this.toString()),!1,!1]}let o=!r||e||t||!Rg?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Rg:"")+zO;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Rg:"")+GO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,qi(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#x(e,t,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(FQ.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=VO(e,l);if(h){s+=f,o=o||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?zO:GO,t=!0;continue}else c=!1;if(u==="?"){s+=Kw,t=!0;continue}s+=DQ(u)}return[s,qi(e),!!t,o]}};Nn=tc;var Vl=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Ur=a((n,e,t={})=>(qf(e),!t.nocomment&&e.charAt(0)==="#"?!1:new qn(e,t).match(n)),"minimatch"),NQ=/^\*+([^+@!?\*\[\(]*)$/,LQ=a(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),kQ=a(n=>e=>e.endsWith(n),"starDotExtTestDot"),MQ=a(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),jQ=a(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),$Q=/^\*+\.\*+$/,BQ=a(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),UQ=a(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),VQ=/^\.\*+$/,qQ=a(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),WQ=/^\*+$/,GQ=a(n=>n.length!==0&&!n.startsWith("."),"starTest"),zQ=a(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),HQ=/^\?+([^+@!?\*\[\(]*)?$/,QQ=a(([n,e=""])=>{let t=YO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),KQ=a(([n,e=""])=>{let t=XO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),YQ=a(([n,e=""])=>{let t=XO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),XQ=a(([n,e=""])=>{let t=YO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),YO=a(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),XO=a(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),JO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",HO={win32:{sep:"\\"},posix:{sep:"/"}},JQ=JO==="win32"?HO.win32.sep:HO.posix.sep;Ur.sep=JQ;var Yt=Symbol("globstar **");Ur.GLOBSTAR=Yt;var ZQ="[^/]",eK=ZQ+"*?",tK="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",rK="(?:(?!(?:\\/|^)\\.).)*?",nK=a((n,e={})=>t=>Ur(t,n,e),"filter");Ur.filter=nK;var oi=a((n,e={})=>Object.assign({},n,e),"ext"),iK=a(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Ur;let e=Ur;return Object.assign(a((r,i,s={})=>e(r,i,oi(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,oi(n,s))}static defaults(i){return e.defaults(oi(n,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,oi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,oi(n,s))}},unescape:a((r,i={})=>e.unescape(r,oi(n,i)),"unescape"),escape:a((r,i={})=>e.escape(r,oi(n,i)),"escape"),filter:a((r,i={})=>e.filter(r,oi(n,i)),"filter"),defaults:a(r=>e.defaults(oi(n,r)),"defaults"),makeRe:a((r,i={})=>e.makeRe(r,oi(n,i)),"makeRe"),braceExpand:a((r,i={})=>e.braceExpand(r,oi(n,i)),"braceExpand"),match:a((r,i,s={})=>e.match(r,i,oi(n,s)),"match"),sep:e.sep,GLOBSTAR:Yt})},"defaults");Ur.defaults=iK;var ZO=a((n,e={})=>(qf(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,KO.default)(n)),"braceExpand");Ur.braceExpand=ZO;var sK=a((n,e={})=>new qn(n,e).makeRe(),"makeRe");Ur.makeRe=sK;var oK=a((n,e,t={})=>{let r=new qn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");Ur.match=oK;var QO=/[?*]|[+@!]\(.*?\)|\[|\]/,aK=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),qn=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){qf(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||JO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!QO.test(s[2]))&&!QO.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,y]=[e[d],t[h]];p.toLowerCase()===y.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Yt)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let o=t.indexOf(Yt,s),c=t.lastIndexOf(Yt),[l,u,f]=r?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let T=e.slice(i,i+l.length);if(!this.#r(T,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let T=e.length-f.length;if(this.#r(e,f,r,T,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(T--,!this.#r(e,f,r,T,0)))return!1;d=f.length+1}}if(!u.length){let T=!!d;for(let I=i;I<e.length-d;I++){let $=String(e[I]);if(T=!0,$==="."||$===".."||!this.options.dot&&$.startsWith("."))return!1}return r||T}let h=[[[],0]],p=h[0],y=0,v=[0];for(let T of u)T===Yt?(v.push(y),p=[[],0],h.push(p)):(p[0].push(T),y++);let b=h.length-1,w=e.length-d;for(let T of h)T[1]=w-(v[b--]+T[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,o,c){let l=t[i];if(!l){for(let d=r;d<e.length;d++){c=!0;let h=e[d];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return c}let[u,f]=l;for(;r<=f;){if(this.#r(e.slice(0,r+u.length),u,s,r,0)&&o<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,o+1,c);if(p!==!1)return p}let h=e[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===Yt)return!1;let h;if(typeof f=="string"?(h=d===f,this.debug("string match",f,d,h)):(h=f.test(d),this.debug("pattern match",f,d,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return ZO(this.pattern,this.options)}parse(e){qf(e);let t=this.options;if(e==="**")return Yt;if(e==="")return"";let r,i=null;(r=e.match(WQ))?i=t.dot?zQ:GQ:(r=e.match(NQ))?i=(t.nocase?t.dot?jQ:MQ:t.dot?kQ:LQ)(r[1]):(r=e.match(HQ))?i=(t.nocase?t.dot?KQ:QQ:t.dot?YQ:XQ)(r):(r=e.match($Q))?i=t.dot?UQ:BQ:(r=e.match(VQ))&&(i=qQ);let s=tc.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?eK:t.dot?tK:rK,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?aK(f):f===Yt?Yt:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==Yt||p===Yt||(p===void 0?h!==void 0&&h!==Yt?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==Yt&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=Yt))}),u.filter(f=>f!==Yt).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Ur.defaults(e).Minimatch}};Ur.AST=tc;Ur.Minimatch=qn;Ur.escape=Vl;Ur.unescape=qi;var EF=require("node:url");var ql=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tF=new Set,Yw=typeof process=="object"&&process?process:{},rF=a((n,e,t,r)=>{typeof Yw.emitWarning=="function"?Yw.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),Ig=globalThis.AbortController,eF=globalThis.AbortSignal;if(typeof Ig>"u"){eF=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Ig=class{static{a(this,"AbortController")}constructor(){e()}signal=new eF;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let n=Yw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{n&&(n=!1,rF("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var cK=a(n=>!tF.has(n),"shouldWarn");var na=a(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),nF=a(n=>na(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Wl:null:null,"getUintArray"),Wl=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Xw=class n{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=nF(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Gf=class n{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;#E;#T;#S;#w;#v;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:a(t=>e.#B(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#I(t),"rindexes"),isStale:a(t=>e.#A(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:y=0,sizeCalculation:v,fetchMethod:b,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:q,ignoreFetchAbort:ce}=e;if(t!==0&&!na(t))throw new TypeError("max option must be a nonnegative integer");let B=t?nF(t):Array;if(!B)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=y||this.#n,this.sizeCalculation=v,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=w,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=b,this.#v=!!b,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#p=new B(t),this.#g=new B(t),this.#d=0,this.#m=0,this.#y=Xw.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!q,this.ignoreFetchAbort=!!ce,this.maxEntrySize!==0){if(this.#n!==0&&!na(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!na(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=na(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!na(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let V="LRU_CACHE_UNBOUNDED";cK(V)&&(tF.add(V),rF("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",V,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#x(){let e=new Wl(this.#e),t=new Wl(this.#e);this.#S=e,this.#T=t,this.#F=(s,o,c=ql.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#O(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?ql.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=a(()=>{let s=ql.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(r||i())-o>c}}#C=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#F=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#P(){let e=new Wl(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#h(r))return 0;if(!na(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!na(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=a(e=>{},"#removeItemSize");#N=a((e,t,r)=>{},"#addItemSize");#L=a((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#p[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#I())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#I())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#I()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#A(t)&&(this.#O(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#o[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let o=this.#S[t],c=this.#T[t];if(o&&c){let l=o-(ql.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#R({allowStale:!0})){let r=this.#l[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#S&&this.#T){o.ttl=this.#S[t];let c=ql.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=ql.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#N(d,f,l),l&&(l.set="add"),u=!1;else{this.#B(d);let h=this.#o[d];if(t!==h){if(this.#v&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!o&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else o||(this.#w&&this.#r?.(h,e,"set"),this.#b&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#N(d,f,l),this.#o[d]=t,l){l.set="replace";let p=h&&this.#h(h)?h.__staleWhileFetching:h;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#S&&this.#x(),this.#S&&(u||this.#F(d,i,s),l&&this.#a(l,d)),!o&&this.#b&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#b&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,r=this.#l[t],i=this.#o[t];return this.#v&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=this.#p[t],this.#s.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#a(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#A(i))return;let s=this.#o[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new Ig,{signal:c}=r;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:i},u=a((v,b=!1)=>{let{aborted:w}=o.signal,T=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(w&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!T&&!b)return d(o.signal.reason);let I=p;return this.#o[t]===p&&(v===void 0?I.__staleWhileFetching?this.#o[t]=I.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},"cb"),f=a(v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),d(v)),"eb"),d=a(v=>{let{aborted:b}=o.signal,w=b&&r.allowStaleOnFetchAbort,T=w||r.allowStaleOnFetchRejection,I=T||r.noDeleteOnFetchRejection,$=p;if(this.#o[t]===p&&(!I||$.__staleWhileFetching===void 0?this.#O(e,"fetch"):w||(this.#o[t]=$.__staleWhileFetching)),T)return r.status&&$.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw v},"fetchFail"),h=a((v,b)=>{let w=this.#c?.(e,s,l);w&&w instanceof Promise&&w.then(T=>v(T===void 0?void 0:T),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=a(T=>u(T,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),y=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,y,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=y,y}#h(e){if(!this.#v)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ig}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:w,signal:T}=t;if(!this.#v)return w&&(w.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let I={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:w,signal:T},$=this.#s.get(e);if($===void 0){w&&(w.fetch="miss");let q=this.#j(e,$,I,v);return q.__returned=q}else{let q=this.#o[$];if(this.#h(q)){let k=r&&q.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",k&&(w.returnedStale=!0)),k?q.__staleWhileFetching:q.__returned=q}let ce=this.#A($);if(!b&&!ce)return w&&(w.fetch="hit"),this.#B($),i&&this.#C($),w&&this.#a(w,$),q;let B=this.#j(e,$,I,v),F=B.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=ce?"stale":"refresh",F&&ce&&(w.returnedStale=!0)),F?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=r(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#h(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&r&&(o.returnedStale=!0),r?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#B(c),i&&this.#C(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#B(e){e!==this.#m&&(e===this.#d?this.#d=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let r=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.#U(t);else{this.#D(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let o=this.#g[i];this.#p[o]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#U("delete")}#U(e){for(let t of this.#I({allowStale:!0})){let r=this.#o[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#T&&(this.#S.fill(0),this.#T.fill(0)),this.#E&&this.#E.fill(0),this.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Hl=require("node:path"),hF=require("node:url"),Is=require("fs"),_K=H(require("node:fs"),1),oa=require("node:fs/promises");var kg=require("node:events"),iE=H(require("node:stream"),1),cF=require("node:string_decoder");var iF=typeof process=="object"&&process?process:{stdout:null,stderr:null},lK=a(n=>!!n&&typeof n=="object"&&(n instanceof sa||n instanceof iE.default||uK(n)||fK(n)),"isStream"),uK=a(n=>!!n&&typeof n=="object"&&n instanceof kg.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==iE.default.Writable.prototype.pipe,"isReadable"),fK=a(n=>!!n&&typeof n=="object"&&n instanceof kg.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),_o=Symbol("EOF"),So=Symbol("maybeEmitEnd"),ia=Symbol("emittedEnd"),Pg=Symbol("emittingEnd"),zf=Symbol("emittedError"),Og=Symbol("closed"),sF=Symbol("read"),Fg=Symbol("flush"),oF=Symbol("flushChunk"),Wi=Symbol("encoding"),Gl=Symbol("decoder"),Ar=Symbol("flowing"),Hf=Symbol("paused"),zl=Symbol("resume"),xr=Symbol("buffer"),bn=Symbol("pipes"),Cr=Symbol("bufferLength"),Jw=Symbol("bufferPush"),Dg=Symbol("bufferShift"),en=Symbol("objectMode"),Xt=Symbol("destroyed"),Zw=Symbol("error"),eE=Symbol("emitData"),aF=Symbol("emitEnd"),tE=Symbol("emitEnd2"),Cs=Symbol("async"),rE=Symbol("abort"),Ng=Symbol("aborted"),Qf=Symbol("signal"),rc=Symbol("dataListeners"),Wn=Symbol("discarded"),Kf=a(n=>Promise.resolve().then(n),"defer"),dK=a(n=>n(),"nodefer"),hK=a(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),pK=a(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),mK=a(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),Lg=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[zl](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},nE=class extends Lg{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},gK=a(n=>!!n.objectMode,"isObjectModeOptions"),yK=a(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),sa=class extends kg.EventEmitter{static{a(this,"Minipass")}[Ar]=!1;[Hf]=!1;[bn]=[];[xr]=[];[en];[Wi];[Cs];[Gl];[_o]=!1;[ia]=!1;[Pg]=!1;[Og]=!1;[zf]=null;[Cr]=0;[Xt]=!1;[Qf];[Ng]=!1;[rc]=0;[Wn]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");gK(t)?(this[en]=!0,this[Wi]=null):yK(t)?(this[Wi]=t.encoding,this[en]=!1):(this[en]=!1,this[Wi]=null),this[Cs]=!!t.async,this[Gl]=this[Wi]?new cF.StringDecoder(this[Wi]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[xr],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[bn],"get")});let{signal:r}=t;r&&(this[Qf]=r,r.aborted?this[rE]():r.addEventListener("abort",()=>this[rE]()))}get bufferLength(){return this[Cr]}get encoding(){return this[Wi]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[en]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Cs]}set async(e){this[Cs]=this[Cs]||!!e}[rE](){this[Ng]=!0,this.emit("abort",this[Qf]?.reason),this.destroy(this[Qf]?.reason)}get aborted(){return this[Ng]}set aborted(e){}write(e,t,r){if(this[Ng])return!1;if(this[_o])throw new Error("write after end");if(this[Xt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[Cs]?Kf:dK;if(!this[en]&&!Buffer.isBuffer(e)){if(mK(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(pK(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[en]?(this[Ar]&&this[Cr]!==0&&this[Fg](!0),this[Ar]?this.emit("data",e):this[Jw](e),this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar]):e.length?(typeof e=="string"&&!(t===this[Wi]&&!this[Gl]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Wi]&&(e=this[Gl].write(e)),this[Ar]&&this[Cr]!==0&&this[Fg](!0),this[Ar]?this.emit("data",e):this[Jw](e),this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar]):(this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar])}read(e){if(this[Xt])return null;if(this[Wn]=!1,this[Cr]===0||e===0||e&&e>this[Cr])return this[So](),null;this[en]&&(e=null),this[xr].length>1&&!this[en]&&(this[xr]=[this[Wi]?this[xr].join(""):Buffer.concat(this[xr],this[Cr])]);let t=this[sF](e||null,this[xr][0]);return this[So](),t}[sF](e,t){if(this[en])this[Dg]();else{let r=t;e===r.length||e===null?this[Dg]():typeof r=="string"?(this[xr][0]=r.slice(e),t=r.slice(0,e),this[Cr]-=e):(this[xr][0]=r.subarray(e),t=r.subarray(0,e),this[Cr]-=e)}return this.emit("data",t),!this[xr].length&&!this[_o]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[_o]=!0,this.writable=!1,(this[Ar]||!this[Hf])&&this[So](),this}[zl](){this[Xt]||(!this[rc]&&!this[bn].length&&(this[Wn]=!0),this[Hf]=!1,this[Ar]=!0,this.emit("resume"),this[xr].length?this[Fg]():this[_o]?this[So]():this.emit("drain"))}resume(){return this[zl]()}pause(){this[Ar]=!1,this[Hf]=!0,this[Wn]=!1}get destroyed(){return this[Xt]}get flowing(){return this[Ar]}get paused(){return this[Hf]}[Jw](e){this[en]?this[Cr]+=1:this[Cr]+=e.length,this[xr].push(e)}[Dg](){return this[en]?this[Cr]-=1:this[Cr]-=this[xr][0].length,this[xr].shift()}[Fg](e=!1){do;while(this[oF](this[Dg]())&&this[xr].length);!e&&!this[xr].length&&!this[_o]&&this.emit("drain")}[oF](e){return this.emit("data",e),this[Ar]}pipe(e,t){if(this[Xt])return e;this[Wn]=!1;let r=this[ia];return t=t||{},e===iF.stdout||e===iF.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[bn].push(t.proxyErrors?new nE(this,e,t):new Lg(this,e,t)),this[Cs]?Kf(()=>this[zl]()):this[zl]()),e}unpipe(e){let t=this[bn].find(r=>r.dest===e);t&&(this[bn].length===1?(this[Ar]&&this[rc]===0&&(this[Ar]=!1),this[bn]=[]):this[bn].splice(this[bn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Wn]=!1,this[rc]++,!this[bn].length&&!this[Ar]&&this[zl]();else if(e==="readable"&&this[Cr]!==0)super.emit("readable");else if(hK(e)&&this[ia])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[zf]){let i=t;this[Cs]?Kf(()=>i.call(this,this[zf])):i.call(this,this[zf])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[rc]=this.listeners("data").length,this[rc]===0&&!this[Wn]&&!this[bn].length&&(this[Ar]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[rc]=0,!this[Wn]&&!this[bn].length&&(this[Ar]=!1)),t}get emittedEnd(){return this[ia]}[So](){!this[Pg]&&!this[ia]&&!this[Xt]&&this[xr].length===0&&this[_o]&&(this[Pg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Og]&&this.emit("close"),this[Pg]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==Xt&&this[Xt])return!1;if(e==="data")return!this[en]&&!r?!1:this[Cs]?(Kf(()=>this[eE](r)),!0):this[eE](r);if(e==="end")return this[aF]();if(e==="close"){if(this[Og]=!0,!this[ia]&&!this[Xt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[zf]=r,super.emit(Zw,r);let s=!this[Qf]||this.listeners("error").length?super.emit("error",r):!1;return this[So](),s}else if(e==="resume"){let s=super.emit("resume");return this[So](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[So](),i}[eE](e){for(let r of this[bn])r.dest.write(e)===!1&&this.pause();let t=this[Wn]?!1:super.emit("data",e);return this[So](),t}[aF](){return this[ia]?!1:(this[ia]=!0,this.readable=!1,this[Cs]?(Kf(()=>this[tE]()),!0):this[tE]())}[tE](){if(this[Gl]){let t=this[Gl].end();if(t){for(let r of this[bn])r.dest.write(t);this[Wn]||super.emit("data",t)}}for(let t of this[bn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[en]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[en]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[en])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Wi]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Xt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Wn]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[_o])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Xt,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Xt,f),this.pause(),s({value:d,done:!!this[_o]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Xt,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{o=h,s=d,this.once(Xt,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Wn]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Zw,t),this.off(Xt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Zw,t),this.once(Xt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Xt])return e?this.emit("error",e):this.emit(Xt),this;this[Xt]=!0,this[Wn]=!0,this[xr].length=0,this[Cr]=0;let t=this;return typeof t.close=="function"&&!this[Og]&&t.close(),e?this.emit("error",e):this.emit(Xt),this}static get isStream(){return lK}};var SK=Is.realpathSync.native,Xf={lstatSync:Is.lstatSync,readdir:Is.readdir,readdirSync:Is.readdirSync,readlinkSync:Is.readlinkSync,realpathSync:SK,promises:{lstat:oa.lstat,readdir:oa.readdir,readlink:oa.readlink,realpath:oa.realpath}},pF=a(n=>!n||n===Xf||n===_K?Xf:{...Xf,...n,promises:{...Xf.promises,...n.promises||{}}},"fsFromOption"),mF=/^\\\\\?\\([a-z]:)\\?$/i,vK=a(n=>n.replace(/\//g,"\\").replace(mF,"$1\\"),"uncToDrive"),bK=/[\\\/]/,ci=0,gF=1,yF=2,Rs=4,_F=6,SF=8,nc=10,vF=12,ai=15,Yf=~ai,sE=16,lF=32,Jf=64,Gi=128,Mg=256,$g=512,uF=Jf|Gi|$g,wK=1023,oE=a(n=>n.isFile()?SF:n.isDirectory()?Rs:n.isSymbolicLink()?nc:n.isCharacterDevice()?yF:n.isBlockDevice()?_F:n.isSocket()?vF:n.isFIFO()?gF:ci,"entToType"),fF=new Map,Zf=a(n=>{let e=fF.get(n);if(e)return e;let t=n.normalize("NFKD");return fF.set(n,t),t},"normalize"),dF=new Map,jg=a(n=>{let e=dF.get(n);if(e)return e;let t=Zf(n.toLowerCase());return dF.set(n,t),t},"normalizeNocase"),Bg=class extends Gf{static{a(this,"ResolveCache")}constructor(){super({max:256})}},aE=class extends Gf{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},bF=Symbol("PathScurry setAsCwd"),tn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#E;get ctime(){return this.#E}#T;get birthtime(){return this.#T}#S;#w;#v;#b;#x;#C;#a;#F;#A;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ci,r,i,s,o,c){this.name=e,this.#S=s?jg(e):Zf(e),this.#a=t&wK,this.nocase=s,this.roots=i,this.root=r||this,this.#F=o,this.#v=c.fullpath,this.#x=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=pF(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#a&=~sE,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?jg(e):Zf(e);for(let l of r)if(l.#S===i)return l;let s=this.parent?this.sep:"",o=this.#v?this.#v+s+e:void 0,c=this.newChild(e,ci,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=Gi),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#v=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#a&ai)===ci}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#a&ai)===SF}isDirectory(){return(this.#a&ai)===Rs}isCharacterDevice(){return(this.#a&ai)===yF}isBlockDevice(){return(this.#a&ai)===_F}isFIFO(){return(this.#a&ai)===gF}isSocket(){return(this.#a&ai)===vF}isSymbolicLink(){return(this.#a&nc)===nc}lstatCached(){return this.#a&lF?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#P}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&ai;return!(e!==ci&&e!==nc||this.#a&Mg||this.#a&Gi)}calledReaddir(){return!!(this.#a&sE)}isENOENT(){return!!(this.#a&Gi)}isNamed(e){return this.nocase?this.#S===jg(e):this.#S===Zf(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#A=r}catch(t){this.#h(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#A=r}catch(t){this.#h(t.code);return}}#N(e){this.#a|=sE;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#a&Gi||(this.#a=(this.#a|Gi)&Yf,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#I(){this.#a|=$g,this.#k()}#k(){if(this.#a&Jf)return;let e=this.#a;(e&ai)===Rs&&(e&=Yf),this.#a=e|Jf,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#L()}#h(e=""){let t=this.#a;t|=Mg,e==="ENOENT"&&(t|=Gi),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Yf),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#O(e,t)||this.#B(e,t)}#B(e,t){let r=oE(e),i=this.newChild(e.name,r,{parent:this}),s=i.#a&ai;return s!==Rs&&s!==nc&&s!==ci&&(i.#a|=Jf),t.unshift(i),t.provisional++,i}#O(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?jg(e.name):Zf(e.name))===i.#S)return this.#U(e,i,r,t)}}#U(e,t,r,i){let s=t.name;return t.#a=t.#a&Yf|oE(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#a&Gi)===0)try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&Gi)===0)try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:y,mtimeMs:v,nlink:b,rdev:w,size:T,uid:I}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#E=l,this.#d=u,this.#n=f,this.#_=d,this.#s=h,this.#r=p,this.#f=y,this.#g=v,this.#t=b,this.#i=w,this.#l=T,this.#c=I;let $=oE(e);this.#a=this.#a&Yf|$|lF,$!==ci&&$!==Rs&&$!==nc&&(this.#a|=Jf)}#q=[];#W=!1;#z(e){this.#W=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#W)return;this.#W=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of o)this.#$(c,r);this.#N(r)}this.#z(r.slice(0,r.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let r=a(()=>{},"resolve");this.#V=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&uF)return!1;let e=ai&this.#a;return e===ci||e===Rs||e===nc}shouldWalk(e,t){return(this.#a&Rs)===Rs&&!(this.#a&uF)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!(($g|Mg|Gi)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#I()}}realpathSync(){if(this.#P)return this.#P;if(!(($g|Mg|Gi)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#I()}}[bF](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#x=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#x=void 0,i.#C=void 0,i=i.parent}},Ug=class n extends tn{static{a(this,"PathWin32")}sep="\\";splitSep=bK;constructor(e,t=ci,r,i,s,o,c){super(e,t,r,i,s,o,c)}newChild(e,t=ci,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Hl.win32.parse(e).root}getRoot(e){if(e=vK(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Ql(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(mF,"$1\\"),e===t}},Vg=class n extends tn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ci,r,i,s,o,c){super(e,t,r,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ci,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},qg=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Xf}={}){this.#t=pF(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,hF.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Bg,this.#n=new Bg,this.#r=new aE(s);let l=c.substring(this.rootPath.length).split(r);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,h=this.rootPath,p=!1;for(let y of l){let v=f--;u=u.child(y,{relative:new Array(v).fill("..").join(d),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(p?"":d)+y}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=a((d,h)=>{l.add(d),d.readdirCB((p,y)=>{if(p)return h(p);let v=y.length;if(!v)return h();let b=a(()=>{--v===0&&h()},"next");for(let w of y)(!s||s(w))&&c.push(r?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(l,o)?u(T,b):b()):w.shouldWalk(l,o)?u(w,b):b()},!0)},"walk"),f=e;return new Promise((d,h)=>{u(f,p=>{if(p)return h(p);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(r?d:d.fullpath());let h=d;if(d.isSymbolicLink()){if(!(i&&(h=d.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,o)&&l.add(h)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new sa({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let y=a((b,w,T=!1)=>{if(b)return c.emit("error",b);if(i&&!T){let I=[];for(let $ of w)$.isSymbolicLink()&&I.push($.realpath().then(q=>q?.isUnknown()?q.lstat():q));if(I.length){Promise.all(I).then(()=>y(null,w,!0));return}}for(let I of w)I&&(!s||s(I))&&(c.write(r?I:I.fullpath())||(h=!0));f--;for(let I of w){let $=I.realpathCached()||I;$.shouldWalk(l,o)&&u.push($)}h&&!c.flowing?c.once("drain",d):v||d()},"onReaddir"),v=!0;p.readdirCB(y,!0),v=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new sa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let y=p.readdirSync();for(let v of y)(!s||s(v))&&(c.write(r?v:v.fullpath())||(h=!0));f--;for(let v of y){let b=v;if(v.isSymbolicLink()){if(!(i&&(b=v.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}h&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[bF](t)}},Ql=class extends qg{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Hl.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Hl.win32.parse(e).root.toUpperCase()}newRoot(e){return new Ug(this.rootPath,Rs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Kl=class extends qg{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Hl.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Vg(this.rootPath,Rs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ed=class extends Kl{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},Mfe=process.platform==="win32"?Ug:Vg,wF=process.platform==="win32"?Ql:process.platform==="darwin"?ed:Kl;var EK=a(n=>n.length>=1,"isPatternList"),TK=a(n=>n.length>=1,"isGlobList"),Yl=class n{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!EK(e))throw new TypeError("empty pattern list");if(!TK(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#e,[f,d,h,p,...y]=this.#n;u[0]===""&&(u.shift(),y.shift());let v=[s,o,c,l,""].join("/"),b=[f,d,h,p,""].join("/");this.#e=[v,...u],this.#n=[b,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Yt}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new n(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var AK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Xl=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:o=AK}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new qn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Yl(i,s,0,this.platform),c=new qn(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var cE=class n{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},lE=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},uE=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},td=class n{static{a(this,"Processor")}hasWalkedCache;matches=new lE;subwalks=new uE;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new cE}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===Yt){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),h=u?.rest();if(!u||(d===""||d===".")&&!h)this.matches.add(i,c,d===""||d===".");else if(d===".."){let p=i.parent||i;h?this.hasWalkedCache.hasWalked(p,h)||this.subwalks.add(p,h):this.matches.add(p,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of r){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Yt?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var xK=a((n,e)=>typeof n=="string"?new Xl([n],e):Array.isArray(n)?new Xl(n,e):n,"makeIgnore"),Wg=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=xK(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new td(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,o):c.readdirCB((u,f)=>this.walkCB3(c,f,r,o),!0)}o()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new td(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,o)}o()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),o);o()}},rd=class extends Wg{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},nd=class extends Wg{static{a(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new sa({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var CK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",zi=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,EF.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||CK,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Ql:t.platform==="darwin"?ed:t.platform?Kl:wF;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new qn(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Yl(l,f,0,this.platform)})}async walk(){return[...await new rd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new rd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new nd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new nd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var fE=a((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new qn(t,e).hasMagic())return!0;return!1},"hasMagic");function Gg(n,e={}){return new zi(n,e).streamSync()}a(Gg,"globStreamSync");function AF(n,e={}){return new zi(n,e).stream()}a(AF,"globStream");function xF(n,e={}){return new zi(n,e).walkSync()}a(xF,"globSync");async function TF(n,e={}){return new zi(n,e).walk()}a(TF,"glob_");function zg(n,e={}){return new zi(n,e).iterateSync()}a(zg,"globIterateSync");function CF(n,e={}){return new zi(n,e).iterate()}a(CF,"globIterate");var RK=Gg,IK=Object.assign(AF,{sync:Gg}),PK=zg,OK=Object.assign(CF,{sync:zg}),FK=Object.assign(xF,{stream:Gg,iterate:zg}),Jl=Object.assign(TF,{glob:TF,globSync:xF,sync:FK,globStream:AF,stream:IK,globStreamSync:Gg,streamSync:RK,globIterate:CF,iterate:OK,globIterateSync:zg,iterateSync:PK,Glob:zi,hasMagic:fE,escape:Vl,unescape:qi});Jl.glob=Jl;async function id(n,e,t,r={}){let{dryRun:i=!1,excludeRelPath:s}=r,o=ic.default.join(n,"**/*.md"),c=await Jl(o,{nodir:!0,ignore:[ic.default.join(n,".obsidian/**"),ic.default.join(n,".trash/**"),ic.default.join(n,"**/.obsidian/**"),ic.default.join(n,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=ic.default.relative(n,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await dE.default.readFile(u,"utf-8")}catch{continue}let{updated:h,replacements:p}=DK(d,e,t);p>0&&(l.filesModified+=1,l.replacements+=p,l.modifiedFiles.push(f),i||await dE.default.writeFile(u,h,"utf-8"))}return l}a(id,"rewriteInboundWikilinks");function DK(n,e,t){let r=n.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=r[s],c=NK(o,e,t);i+=c.replacements,r[s]=c.updated}return{updated:r.join(""),replacements:i}}a(DK,"rewriteContent");function NK(n,e,t){let r=n.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=LK(r[s],e,t);i+=o.replacements,r[s]=o.updated}return{updated:r.join(""),replacements:i}}a(NK,"rewriteProseSegment");function LK(n,e,t){let r=/(?<!!)\[\[([^\[\]\n|#]+)(#[^\[\]\n|]*)?(\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:n.replace(r,(o,c,l,u)=>{if(c.trim()!==e)return o;i+=1;let d=l??"",h;return u?h=u:d?h=`|${e}`:h=`|${e}`,`[[${t}${d}${h}]]`}),replacements:i}}a(LK,"replaceWikilinks");var kK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Nt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await cr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return cr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await cr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await cr.default.ensureDir(Jt.default.dirname(r)),await cr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await cr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await cr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await cr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await cr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return cr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=cr.default.statSync(t);if(r.isFile())return this.createFileObject(e);if(r.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let r=Jt.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=cr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),o=this.replaceFrontmatter(r,s);await this.modify(e,o)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await cr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await cr.default.ensureDir(Jt.default.dirname(i)),await cr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await cr.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(kK.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let u=r.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=Jt.default.dirname(this.resolvePath(t)),s;if(Jt.default.isAbsolute(r)?s=this.resolvePath(r):s=Jt.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),cr.default.existsSync(s)){let u=Jt.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=r.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=Jt.default.relative(this.rootPath,e),r=Jt.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=cr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=Jt.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(r){let i=r[1].toLowerCase(),s=Jt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){let i=Jt.default.basename(t,".md");await id(this.rootPath,r,i,{excludeRelPath:e})}resolvePath(e){return Jt.default.isAbsolute(e)?e:Jt.default.join(this.rootPath,e)}createFileObject(e){let t=Jt.default.basename(e),r=Jt.default.basename(e,Jt.default.extname(e)),i=Jt.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Jt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=ar.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=ar.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
493
+ `+n.slice(o+1):l+=n.slice(i),l.slice(1)}a(MP,"foldLine");function KH(n){for(var e="",t=0,r,i=0;i<n.length;t>=65536?i+=2:i++)t=Mf(n,i),r=Zr[t],!r&&Uf(t)?(e+=n[i],t>=65536&&(e+=n[i+1])):e+=r||BH(t);return e}a(KH,"escapeString");function YH(n,e,t){var r="",i=n.tag,s,o,c;for(s=0,o=t.length;s<o;s+=1)c=t[s],n.replacer&&(c=n.replacer.call(t,String(s),c)),(yo(n,e,c,!1,!1)||typeof c>"u"&&yo(n,e,null,!1,!1))&&(r!==""&&(r+=","+(n.condenseFlow?"":" ")),r+=n.dump);n.tag=i,n.dump="["+r+"]"}a(YH,"writeFlowSequence");function jP(n,e,t,r){var i="",s=n.tag,o,c,l;for(o=0,c=t.length;o<c;o+=1)l=t[o],n.replacer&&(l=n.replacer.call(t,String(o),l)),(yo(n,e+1,l,!0,!0,!1,!0)||typeof l>"u"&&yo(n,e+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=Mw(n,e)),n.dump&&$f===n.dump.charCodeAt(0)?i+="-":i+="- ",i+=n.dump);n.tag=s,n.dump=i||"[]"}a(jP,"writeBlockSequence");function XH(n,e,t){var r="",i=n.tag,s=Object.keys(t),o,c,l,u,f;for(o=0,c=s.length;o<c;o+=1)f="",r!==""&&(f+=", "),n.condenseFlow&&(f+='"'),l=s[o],u=t[l],n.replacer&&(u=n.replacer.call(t,l,u)),yo(n,e,l,!1,!1)&&(n.dump.length>1024&&(f+="? "),f+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),yo(n,e,u,!1,!1)&&(f+=n.dump,r+=f));n.tag=i,n.dump="{"+r+"}"}a(XH,"writeFlowMapping");function JH(n,e,t,r){var i="",s=n.tag,o=Object.keys(t),c,l,u,f,d,h;if(n.sortKeys===!0)o.sort();else if(typeof n.sortKeys=="function")o.sort(n.sortKeys);else if(n.sortKeys)throw new vn("sortKeys must be a boolean or a function");for(c=0,l=o.length;c<l;c+=1)h="",(!r||i!=="")&&(h+=Mw(n,e)),u=o[c],f=t[u],n.replacer&&(f=n.replacer.call(t,u,f)),yo(n,e+1,u,!0,!0,!0)&&(d=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,d&&(n.dump&&$f===n.dump.charCodeAt(0)?h+="?":h+="? "),h+=n.dump,d&&(h+=Mw(n,e)),yo(n,e+1,f,!0,d)&&(n.dump&&$f===n.dump.charCodeAt(0)?h+=":":h+=": ",h+=n.dump,i+=h));n.tag=s,n.dump=i||"{}"}a(JH,"writeBlockMapping");function $P(n,e,t){var r,i,s,o,c,l;for(i=t?n.explicitTypes:n.implicitTypes,s=0,o=i.length;s<o;s+=1)if(c=i[s],(c.instanceOf||c.predicate)&&(!c.instanceOf||typeof e=="object"&&e instanceof c.instanceOf)&&(!c.predicate||c.predicate(e))){if(t?c.multi&&c.representName?n.tag=c.representName(e):n.tag=c.tag:n.tag="?",c.represent){if(l=n.styleMap[c.tag]||c.defaultStyle,yO.call(c.represent)==="[object Function]")r=c.represent(e,l);else if(_O.call(c.represent,l))r=c.represent[l](e,l);else throw new vn("!<"+c.tag+'> tag resolver accepts not "'+l+'" style');n.dump=r}return!0}return!1}a($P,"detectType");function yo(n,e,t,r,i,s,o){n.tag=null,n.dump=t,$P(n,t,!1)||$P(n,t,!0);var c=yO.call(n.dump),l=r,u;r&&(r=n.flowLevel<0||n.flowLevel>e);var f=c==="[object Object]"||c==="[object Array]",d,h;if(f&&(d=n.duplicates.indexOf(t),h=d!==-1),(n.tag!==null&&n.tag!=="?"||h||n.indent!==2&&e>0)&&(i=!1),h&&n.usedDuplicates[d])n.dump="*ref_"+d;else{if(f&&h&&!n.usedDuplicates[d]&&(n.usedDuplicates[d]=!0),c==="[object Object]")r&&Object.keys(n.dump).length!==0?(JH(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(XH(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object Array]")r&&n.dump.length!==0?(n.noArrayIndent&&!o&&e>0?jP(n,e-1,n.dump,i):jP(n,e,n.dump,i),h&&(n.dump="&ref_"+d+n.dump)):(YH(n,e,n.dump),h&&(n.dump="&ref_"+d+" "+n.dump));else if(c==="[object String]")n.tag!=="?"&&HH(n,n.dump,e,s,l);else{if(c==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new vn("unacceptable kind of an object to dump "+c)}n.tag!==null&&n.tag!=="?"&&(u=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?u="!"+u:u.slice(0,18)==="tag:yaml.org,2002:"?u="!!"+u.slice(18):u="!<"+u+">",n.dump=u+" "+n.dump)}return!0}a(yo,"writeNode");function ZH(n,e){var t=[],r=[],i,s;for($w(n,t,r),i=0,s=r.length;i<s;i+=1)e.duplicates.push(t[r[i]]);e.usedDuplicates=new Array(s)}a(ZH,"getDuplicateReferences");function $w(n,e,t){var r,i,s;if(n!==null&&typeof n=="object")if(i=e.indexOf(n),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(e.push(n),Array.isArray(n))for(i=0,s=n.length;i<s;i+=1)$w(n[i],e,t);else for(r=Object.keys(n),i=0,s=r.length;i<s;i+=1)$w(n[r[i]],e,t)}a($w,"inspectNode");function eQ(n,e){e=e||{};var t=new VH(e);t.noRefs||ZH(n,t);var r=n;return t.replacer&&(r=t.replacer.call({"":r},"",r)),yo(t,0,r,!0,!0)?t.dump+`
494
+ `:""}a(eQ,"dump$1");var tQ=eQ,rQ={dump:tQ};function Gw(n,e){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+e+" instead, which is now safe by default.")}}a(Gw,"renamed");var nQ=Br,iQ=VP,sQ=zP,oQ=XP,aQ=JP,cQ=Uw,lQ=gO.load,uQ=gO.loadAll,fQ=rQ.dump,dQ=vn,hQ={binary:nO,float:YP,map:GP,null:HP,pairs:sO,set:oO,timestamp:tO,bool:QP,int:KP,merge:rO,omap:iO,seq:WP,str:qP},pQ=Gw("safeLoad","load"),mQ=Gw("safeLoadAll","loadAll"),gQ=Gw("safeDump","dump"),ar={Type:nQ,Schema:iQ,FAILSAFE_SCHEMA:sQ,JSON_SCHEMA:oQ,CORE_SCHEMA:aQ,DEFAULT_SCHEMA:cQ,load:lQ,loadAll:uQ,dump:fQ,YAMLException:dQ,types:hQ,safeLoad:pQ,safeLoadAll:mQ,safeDump:gQ};var dE=H(go()),ic=H(require("path"));var KO=H(BO(),1);var qf=a(n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern");var TQ={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Wf=a(n=>n.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),AQ=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),UO=a(n=>n.join(""),"rangesToString"),VO=a((n,e)=>{let t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");let r=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<n.length;){let v=n.charAt(s);if((v==="!"||v==="^")&&s===t+1){u=!0,s++;continue}if(v==="]"&&o&&!l){f=s+1;break}if(o=!0,v==="\\"&&!l){l=!0,s++;continue}if(v==="["&&!l){for(let[b,[w,T,I]]of Object.entries(TQ))if(n.startsWith(b,s)){if(d)return["$.",!1,n.length-t,!0];s+=b.length,I?i.push(w):r.push(w),c=c||T;continue e}}if(l=!1,d){v>d?r.push(Wf(d)+"-"+Wf(v)):v===d&&r.push(Wf(v)),d="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Wf(v+"-")),s+=2;continue}if(n.startsWith("-",s+1)){d=v,s+=2;continue}r.push(Wf(v)),s++}if(f<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let v=r[0].length===2?r[0].slice(-1):r[0];return[AQ(v),!1,f-t,!1]}let h="["+(u?"^":"")+UO(r)+"]",p="["+(u?"":"^")+UO(i)+"]";return[r.length&&i.length?"("+h+"|"+p+")":r.length?h:p,c,f-t,!0]},"parseClass");var qi=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),"unescape");var Nn,xQ=new Set(["!","?","+","*","@"]),Qw=a(n=>xQ.has(n),"isExtglobType"),qO=a(n=>Qw(n.type),"isExtglobAST"),CQ=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),RQ=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),IQ=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),WO=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),PQ="(?!(?:^|/)\\.\\.?(?:$|/))",Rg="(?!\\.)",OQ=new Set(["[","."]),FQ=new Set(["..","."]),DQ=new Set("().*{}+?[]^$\\!"),NQ=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Kw="[^/]",GO=Kw+"*?",zO=Kw+"+?",tc=class{static{a(this,"AST")}type;#e;#n;#r=!1;#t=[];#c;#_;#i;#u=!1;#s;#l;#o=!1;constructor(e,t,r={}){this.type=e,e&&(this.#n=!0),this.#c=t,this.#e=this.#c?this.#c.#e:this,this.#s=this.#e===this?r:this.#e.#s,this.#i=this.#e===this?[]:this.#e.#i,e==="!"&&!this.#e.#u&&this.#i.push(this),this.#_=this.#c?this.#c.#t.length:0}get hasMagic(){if(this.#n!==void 0)return this.#n;for(let e of this.#t)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#n=!0;return this.#n}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#t.map(e=>String(e)).join("|")+")":this.#l=this.#t.map(e=>String(e)).join("")}#p(){if(this!==this.#e)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#i.pop();){if(e.type!=="!")continue;let t=e,r=t.#c;for(;r;){for(let i=t.#_+1;!r.type&&i<r.#t.length;i++)for(let s of e.#t){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#t[i])}t=r,r=t.#c}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Nn&&t.#c===this))throw new Error("invalid part: "+t);this.#t.push(t)}}toJSON(){let e=this.type===null?this.#t.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#t.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#e||this.#e.#u&&this.#c?.type==="!")&&e.push({}),e}isStart(){if(this.#e===this)return!0;if(!this.#c?.isStart())return!1;if(this.#_===0)return!0;let e=this.#c;for(let t=0;t<this.#_;t++){let r=e.#t[t];if(!(r instanceof Nn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#e===this||this.#c?.type==="!")return!0;if(!this.#c?.isEnd())return!1;if(!this.type)return this.#c?.isEnd();let e=this.#c?this.#c.#t.length:0;return this.#_===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Nn(this.type,e);for(let r of this.#t)t.copyIn(r);return t}static#g(e,t,r,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let v=r,b="";for(;v<e.length;){let w=e.charAt(v++);if(c||w==="\\"){c=!c,b+=w;continue}if(l){v===u+1?(w==="^"||w==="!")&&(f=!0):w==="]"&&!(v===u+2&&f)&&(l=!1),b+=w;continue}else if(w==="["){l=!0,u=v,f=!1,b+=w;continue}if(!i.noext&&Qw(w)&&e.charAt(v)==="("&&s<=o){t.push(b),b="";let I=new Nn(w,t);v=Nn.#g(e,I,v,i,s+1),t.push(I);continue}b+=w}return t.push(b),v}let d=r+1,h=new Nn(null,t),p=[],y="";for(;d<e.length;){let v=e.charAt(d++);if(c||v==="\\"){c=!c,y+=v;continue}if(l){d===u+1?(v==="^"||v==="!")&&(f=!0):v==="]"&&!(d===u+2&&f)&&(l=!1),y+=v;continue}else if(v==="["){l=!0,u=d,f=!1,y+=v;continue}if(Qw(v)&&e.charAt(d)==="("&&(s<=o||t&&t.#y(v))){let w=t&&t.#y(v)?0:1;h.push(y),y="";let T=new Nn(v,h);h.push(T),d=Nn.#g(e,T,d,i,s+w);continue}if(v==="|"){h.push(y),y="",p.push(h),h=new Nn(null,t);continue}if(v===")")return y===""&&t.#t.length===0&&(t.#o=!0),h.push(y),y="",t.push(...p,h),d;y+=v}return t.type=null,t.#n=void 0,t.#t=[e.substring(r-1)],d}#d(e){return this.#m(e,RQ)}#m(e,t=CQ){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null)return!1;let r=e.#t[0];return!r||typeof r!="object"||r.type===null?!1:this.#y(r.type,t)}#y(e,t=IQ){return!!t.get(this.type)?.includes(e)}#f(e,t){let r=e.#t[0],i=new Nn(null,r,this.options);i.#t.push(""),r.push(i),this.#E(e,t)}#E(e,t){let r=e.#t[0];this.#t.splice(t,1,...r.#t);for(let i of r.#t)typeof i=="object"&&(i.#c=this);this.#l=void 0}#T(e){return!!WO.get(this.type)?.has(e)}#S(e){if(!e||typeof e!="object"||e.type!==null||e.#t.length!==1||this.type===null||this.#t.length!==1)return!1;let t=e.#t[0];return!t||typeof t!="object"||t.type===null?!1:this.#T(t.type)}#w(e){let t=WO.get(this.type),r=e.#t[0],i=t?.get(r.type);if(!i)return!1;this.#t=r.#t;for(let s of this.#t)typeof s=="object"&&(s.#c=this);this.type=i,this.#l=void 0,this.#o=!1}#v(){if(qO(this)){let e=0,t=!1;do{t=!0;for(let r=0;r<this.#t.length;r++){let i=this.#t[r];typeof i=="object"&&(i.#v(),this.#m(i)?(t=!1,this.#E(i,r)):this.#d(i)?(t=!1,this.#f(i,r)):this.#S(i)&&(t=!1,this.#w(i)))}}while(!t&&++e<10)}else for(let e of this.#t)typeof e=="object"&&e.#v();this.#l=void 0}static fromGlob(e,t={}){let r=new Nn(null,void 0,t);return Nn.#g(e,r,0,t,0),r}toMMPattern(){if(this!==this.#e)return this.#e.toMMPattern();let e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#n||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let c=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#s}toRegExpSource(e){let t=e??!!this.#s.dot;if(this.#e===this&&(this.#v(),this.#p()),!qO(this)){let l=this.isStart()&&this.isEnd(),u=this.#t.map(p=>{let[y,v,b,w]=typeof p=="string"?Nn.#x(p,this.#n,l):p.toRegExpSource(e);return this.#n=this.#n||b,this.#r=this.#r||w,y}).join(""),f="";if(this.isStart()&&typeof this.#t[0]=="string"&&!(this.#t.length===1&&FQ.has(this.#t[0]))){let y=OQ,v=t&&y.has(u.charAt(0))||u.startsWith("\\.")&&y.has(u.charAt(2))||u.startsWith("\\.\\.")&&y.has(u.charAt(4)),b=!t&&!e&&y.has(u.charAt(0));f=v?PQ:b?Rg:""}let d="";return this.isEnd()&&this.#e.#u&&this.#c?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,qi(u),this.#n=!!this.#n,this.#r]}let r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#b(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let l=this.toString(),u=this;return u.#t=[l],u.type=null,u.#n=void 0,[l,qi(this.toString()),!1,!1]}let o=!r||e||t||!Rg?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#o)c=(this.isStart()&&!t?Rg:"")+zO;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?Rg:"")+GO+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,qi(s),this.#n=!!this.#n,this.#r]}#b(e){return this.#t.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[r,i,s,o]=t.toRegExpSource(e);return this.#r=this.#r||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#x(e,t,r=!1){let i=!1,s="",o=!1,c=!1;for(let l=0;l<e.length;l++){let u=e.charAt(l);if(i){i=!1,s+=(DQ.has(u)?"\\":"")+u,c=!1;continue}if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,h,p]=VO(e,l);if(h){s+=f,o=o||d,l+=h-1,t=t||p,c=!1;continue}}if(u==="*"){if(c)continue;c=!0,s+=r&&/^[*]+$/.test(e)?zO:GO,t=!0;continue}else c=!1;if(u==="?"){s+=Kw,t=!0;continue}s+=NQ(u)}return[s,qi(e),!!t,o]}};Nn=tc;var Vl=a((n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&"),"escape");var Ur=a((n,e,t={})=>(qf(e),!t.nocomment&&e.charAt(0)==="#"?!1:new qn(e,t).match(n)),"minimatch"),LQ=/^\*+([^+@!?\*\[\(]*)$/,kQ=a(n=>e=>!e.startsWith(".")&&e.endsWith(n),"starDotExtTest"),MQ=a(n=>e=>e.endsWith(n),"starDotExtTestDot"),jQ=a(n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),"starDotExtTestNocase"),$Q=a(n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),"starDotExtTestNocaseDot"),BQ=/^\*+\.\*+$/,UQ=a(n=>!n.startsWith(".")&&n.includes("."),"starDotStarTest"),VQ=a(n=>n!=="."&&n!==".."&&n.includes("."),"starDotStarTestDot"),qQ=/^\.\*+$/,WQ=a(n=>n!=="."&&n!==".."&&n.startsWith("."),"dotStarTest"),GQ=/^\*+$/,zQ=a(n=>n.length!==0&&!n.startsWith("."),"starTest"),HQ=a(n=>n.length!==0&&n!=="."&&n!=="..","starTestDot"),QQ=/^\?+([^+@!?\*\[\(]*)?$/,KQ=a(([n,e=""])=>{let t=YO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),YQ=a(([n,e=""])=>{let t=XO([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),XQ=a(([n,e=""])=>{let t=XO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTestDot"),JQ=a(([n,e=""])=>{let t=YO([n]);return e?r=>t(r)&&r.endsWith(e):t},"qmarksTest"),YO=a(([n])=>{let e=n.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),XO=a(([n])=>{let e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),JO=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",HO={win32:{sep:"\\"},posix:{sep:"/"}},ZQ=JO==="win32"?HO.win32.sep:HO.posix.sep;Ur.sep=ZQ;var Yt=Symbol("globstar **");Ur.GLOBSTAR=Yt;var eK="[^/]",tK=eK+"*?",rK="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",nK="(?:(?!(?:\\/|^)\\.).)*?",iK=a((n,e={})=>t=>Ur(t,n,e),"filter");Ur.filter=iK;var oi=a((n,e={})=>Object.assign({},n,e),"ext"),sK=a(n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return Ur;let e=Ur;return Object.assign(a((r,i,s={})=>e(r,i,oi(n,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,oi(n,s))}static defaults(i){return e.defaults(oi(n,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,oi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,oi(n,s))}},unescape:a((r,i={})=>e.unescape(r,oi(n,i)),"unescape"),escape:a((r,i={})=>e.escape(r,oi(n,i)),"escape"),filter:a((r,i={})=>e.filter(r,oi(n,i)),"filter"),defaults:a(r=>e.defaults(oi(n,r)),"defaults"),makeRe:a((r,i={})=>e.makeRe(r,oi(n,i)),"makeRe"),braceExpand:a((r,i={})=>e.braceExpand(r,oi(n,i)),"braceExpand"),match:a((r,i,s={})=>e.match(r,i,oi(n,s)),"match"),sep:e.sep,GLOBSTAR:Yt})},"defaults");Ur.defaults=sK;var ZO=a((n,e={})=>(qf(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:(0,KO.default)(n)),"braceExpand");Ur.braceExpand=ZO;var oK=a((n,e={})=>new qn(n,e).makeRe(),"makeRe");Ur.makeRe=oK;var aK=a((n,e,t={})=>{let r=new qn(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n},"match");Ur.match=aK;var QO=/[?*]|[+@!]\(.*?\)|\[|\]/,cK=a(n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),qn=class{static{a(this,"Minimatch")}options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,t={}){qf(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||JO,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let l=s[0]===""&&s[1]===""&&(s[2]==="?"||!QO.test(s[2]))&&!QO.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(l)return[...s.slice(0,4),...s.slice(4).map(f=>this.parse(f))];if(u)return[s[0],...s.slice(1).map(f=>this.parse(f))]}return s.map(l=>this.parse(l))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");let{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{let s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){let s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let c=r[i+1],l=r[i+2],u=r[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,r.splice(i,1);let f=r.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){let c=r[o];o===1&&c===""&&r[0]===""||(c==="."||c==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...l),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){let i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,o=[],c="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(c==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(c==="b")return!1;c="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(c==="a")return!1;c="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;let e=this.pattern,t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){let i=0,s=0;if(this.isWindows){let c=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),l=!c&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),f=!u&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),d=l?3:c?0:void 0,h=f?3:u?0:void 0;if(typeof d=="number"&&typeof h=="number"){let[p,y]=[e[d],t[h]];p.toLowerCase()===y.toLowerCase()&&(t[h]=p,s=h,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Yt)?this.#e(e,t,r,i,s):this.#r(e,t,r,i,s)}#e(e,t,r,i,s){let o=t.indexOf(Yt,s),c=t.lastIndexOf(Yt),[l,u,f]=r?[t.slice(s,o),t.slice(o+1),[]]:[t.slice(s,o),t.slice(o+1,c),t.slice(c+1)];if(l.length){let T=e.slice(i,i+l.length);if(!this.#r(T,l,r,0,0))return!1;i+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let T=e.length-f.length;if(this.#r(e,f,r,T,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(T--,!this.#r(e,f,r,T,0)))return!1;d=f.length+1}}if(!u.length){let T=!!d;for(let I=i;I<e.length-d;I++){let $=String(e[I]);if(T=!0,$==="."||$===".."||!this.options.dot&&$.startsWith("."))return!1}return r||T}let h=[[[],0]],p=h[0],y=0,v=[0];for(let T of u)T===Yt?(v.push(y),p=[[],0],h.push(p)):(p[0].push(T),y++);let b=h.length-1,w=e.length-d;for(let T of h)T[1]=w-(v[b--]+T[0].length);return!!this.#n(e,h,i,0,r,0,!!d)}#n(e,t,r,i,s,o,c){let l=t[i];if(!l){for(let d=r;d<e.length;d++){c=!0;let h=e[d];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1}return c}let[u,f]=l;for(;r<=f;){if(this.#r(e.slice(0,r+u.length),u,s,r,0)&&o<this.maxGlobstarRecursion){let p=this.#n(e,t,r+u.length,i+1,s,o+1,c);if(p!==!1)return p}let h=e[r];if(h==="."||h===".."||!this.options.dot&&h.startsWith("."))return!1;r++}return s||null}#r(e,t,r,i,s){let o,c,l,u;for(o=i,c=s,u=e.length,l=t.length;o<u&&c<l;o++,c++){this.debug("matchOne loop");let f=t[c],d=e[o];if(this.debug(t,f,d),f===!1||f===Yt)return!1;let h;if(typeof f=="string"?(h=d===f,this.debug("string match",f,d,h)):(h=f.test(d),this.debug("pattern match",f,d,h)),!h)return!1}if(o===u&&c===l)return!0;if(o===u)return r;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return ZO(this.pattern,this.options)}parse(e){qf(e);let t=this.options;if(e==="**")return Yt;if(e==="")return"";let r,i=null;(r=e.match(GQ))?i=t.dot?HQ:zQ:(r=e.match(LQ))?i=(t.nocase?t.dot?$Q:jQ:t.dot?MQ:kQ)(r[1]):(r=e.match(QQ))?i=(t.nocase?t.dot?YQ:KQ:t.dot?XQ:JQ)(r):(r=e.match(BQ))?i=t.dot?VQ:UQ:(r=e.match(qQ))&&(i=WQ);let s=tc.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,r=t.noglobstar?tK:t.dot?rK:nK,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(f=>{if(f instanceof RegExp)for(let d of f.flags.split(""))i.add(d);return typeof f=="string"?cK(f):f===Yt?Yt:f._src});return u.forEach((f,d)=>{let h=u[d+1],p=u[d-1];f!==Yt||p===Yt||(p===void 0?h!==void 0&&h!==Yt?u[d+1]="(?:\\/|"+r+"\\/)?"+h:u[d]=r:h===void 0?u[d-1]=p+"(?:\\/|"+r+")?":h!==Yt&&(u[d-1]=p+"(?:\\/|\\/"+r+"\\/)"+h,u[d+1]=Yt))}),u.filter(f=>f!==Yt).join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let i=this.slashSplit(e);this.debug(this.pattern,"split",i);let s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let c=i.length-2;!o&&c>=0;c--)o=i[c];for(let c=0;c<s.length;c++){let l=s[c],u=i;if(r.matchBase&&l.length===1&&(u=[o]),this.matchOne(u,l,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return Ur.defaults(e).Minimatch}};Ur.AST=tc;Ur.Minimatch=qn;Ur.escape=Vl;Ur.unescape=qi;var EF=require("node:url");var ql=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,tF=new Set,Yw=typeof process=="object"&&process?process:{},rF=a((n,e,t,r)=>{typeof Yw.emitWarning=="function"?Yw.emitWarning(n,e,t,r):console.error(`[${t}] ${e}: ${n}`)},"emitWarning"),Ig=globalThis.AbortController,eF=globalThis.AbortSignal;if(typeof Ig>"u"){eF=class{static{a(this,"AbortSignal")}onabort;_onabort=[];reason;aborted=!1;addEventListener(r,i){this._onabort.push(i)}},Ig=class{static{a(this,"AbortController")}constructor(){e()}signal=new eF;abort(r){if(!this.signal.aborted){this.signal.reason=r,this.signal.aborted=!0;for(let i of this.signal._onabort)i(r);this.signal.onabort?.(r)}}};let n=Yw.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=a(()=>{n&&(n=!1,rF("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))},"warnACPolyfill")}var lK=a(n=>!tF.has(n),"shouldWarn");var na=a(n=>n&&n===Math.floor(n)&&n>0&&isFinite(n),"isPosInt"),nF=a(n=>na(n)?n<=Math.pow(2,8)?Uint8Array:n<=Math.pow(2,16)?Uint16Array:n<=Math.pow(2,32)?Uint32Array:n<=Number.MAX_SAFE_INTEGER?Wl:null:null,"getUintArray"),Wl=class extends Array{static{a(this,"ZeroArray")}constructor(e){super(e),this.fill(0)}},Xw=class n{static{a(this,"Stack")}heap;length;static#e=!1;static create(e){let t=nF(e);if(!t)return[];n.#e=!0;let r=new n(e,t);return n.#e=!1,r}constructor(e,t){if(!n.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Gf=class n{static{a(this,"LRUCache")}#e;#n;#r;#t;#c;#_;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;#E;#T;#S;#w;#v;#b;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#S,sizes:e.#E,keyMap:e.#s,keyList:e.#l,valList:e.#o,next:e.#p,prev:e.#g,get head(){return e.#d},get tail(){return e.#m},free:e.#y,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,r,i,s)=>e.#j(t,r,i,s),"backgroundFetch"),moveToTail:a(t=>e.#B(t),"moveToTail"),indexes:a(t=>e.#R(t),"indexes"),rindexes:a(t=>e.#I(t),"rindexes"),isStale:a(t=>e.#A(t),"isStale")}}get max(){return this.#e}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#i}get fetchMethod(){return this.#c}get memoMethod(){return this.#_}get dispose(){return this.#r}get disposeAfter(){return this.#t}constructor(e){let{max:t=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,disposeAfter:f,noDisposeOnSet:d,noUpdateTTL:h,maxSize:p=0,maxEntrySize:y=0,sizeCalculation:v,fetchMethod:b,memoMethod:w,noDeleteOnFetchRejection:T,noDeleteOnStaleGet:I,allowStaleOnFetchRejection:$,allowStaleOnFetchAbort:q,ignoreFetchAbort:ce}=e;if(t!==0&&!na(t))throw new TypeError("max option must be a nonnegative integer");let B=t?nF(t):Array;if(!B)throw new Error("invalid max value: "+t);if(this.#e=t,this.#n=p,this.maxEntrySize=y||this.#n,this.sizeCalculation=v,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(w!==void 0&&typeof w!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#_=w,b!==void 0&&typeof b!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#c=b,this.#v=!!b,this.#s=new Map,this.#l=new Array(t).fill(void 0),this.#o=new Array(t).fill(void 0),this.#p=new B(t),this.#g=new B(t),this.#d=0,this.#m=0,this.#y=Xw.create(t),this.#i=0,this.#u=0,typeof u=="function"&&(this.#r=u),typeof f=="function"?(this.#t=f,this.#f=[]):(this.#t=void 0,this.#f=void 0),this.#w=!!this.#r,this.#b=!!this.#t,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!T,this.allowStaleOnFetchRejection=!!$,this.allowStaleOnFetchAbort=!!q,this.ignoreFetchAbort=!!ce,this.maxEntrySize!==0){if(this.#n!==0&&!na(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!na(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!I,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=na(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||0,this.ttl){if(!na(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#e===0&&this.ttl===0&&this.#n===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#n){let V="LRU_CACHE_UNBOUNDED";lK(V)&&(tF.add(V),rF("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",V,n))}}getRemainingTTL(e){return this.#s.has(e)?1/0:0}#x(){let e=new Wl(this.#e),t=new Wl(this.#e);this.#S=e,this.#T=t,this.#F=(s,o,c=ql.now())=>{if(t[s]=o!==0?c:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#A(s)&&this.#O(this.#l[s],"expire")},o+1);l.unref&&l.unref()}},this.#C=s=>{t[s]=e[s]!==0?ql.now():0},this.#a=(s,o)=>{if(e[o]){let c=e[o],l=t[o];if(!c||!l)return;s.ttl=c,s.start=l,s.now=r||i();let u=s.now-l;s.remainingTTL=c-u}};let r=0,i=a(()=>{let s=ql.now();if(this.ttlResolution>0){r=s;let o=setTimeout(()=>r=0,this.ttlResolution);o.unref&&o.unref()}return s},"getNow");this.getRemainingTTL=s=>{let o=this.#s.get(s);if(o===void 0)return 0;let c=e[o],l=t[o];if(!c||!l)return 1/0;let u=(r||i())-l;return c-u},this.#A=s=>{let o=t[s],c=e[s];return!!c&&!!o&&(r||i())-o>c}}#C=a(()=>{},"#updateItemAge");#a=a(()=>{},"#statusTTL");#F=a(()=>{},"#setItemTTL");#A=a(()=>!1,"#isStale");#P(){let e=new Wl(this.#e);this.#u=0,this.#E=e,this.#D=t=>{this.#u-=e[t],e[t]=0},this.#L=(t,r,i,s)=>{if(this.#h(r))return 0;if(!na(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(r,t),!na(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#N=(t,r,i)=>{if(e[t]=r,this.#n){let s=this.#n-e[t];for(;this.#u>s;)this.#M(!0)}this.#u+=e[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#u)}}#D=a(e=>{},"#removeItemSize");#N=a((e,t,r)=>{},"#addItemSize");#L=a((e,t,r,i)=>{if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#requireSize");*#R({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#m;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#d));)t=this.#g[t]}*#I({allowStale:e=this.allowStale}={}){if(this.#i)for(let t=this.#d;!(!this.#k(t)||((e||!this.#A(t))&&(yield t),t===this.#m));)t=this.#p[t]}#k(e){return e!==void 0&&this.#s.get(this.#l[e])===e}*entries(){for(let e of this.#R())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*rentries(){for(let e of this.#I())this.#o[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#l[e],this.#o[e]])}*keys(){for(let e of this.#R()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#I()){let t=this.#l[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#R())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#I())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#l[r],this))return this.get(this.#l[r],t)}}forEach(e,t=this){for(let r of this.#R()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}rforEach(e,t=this){for(let r of this.#I()){let i=this.#o[r],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#l[r],this)}}purgeStale(){let e=!1;for(let t of this.#I({allowStale:!0}))this.#A(t)&&(this.#O(this.#l[t],"expire"),e=!0);return e}info(e){let t=this.#s.get(e);if(t===void 0)return;let r=this.#o[t],i=this.#h(r)?r.__staleWhileFetching:r;if(i===void 0)return;let s={value:i};if(this.#S&&this.#T){let o=this.#S[t],c=this.#T[t];if(o&&c){let l=o-(ql.now()-c);s.ttl=l,s.start=Date.now()}}return this.#E&&(s.size=this.#E[t]),s}dump(){let e=[];for(let t of this.#R({allowStale:!0})){let r=this.#l[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||r===void 0)continue;let o={value:s};if(this.#S&&this.#T){o.ttl=this.#S[t];let c=ql.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#E&&(o.size=this.#E[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let i=Date.now()-r.start;r.start=ql.now()-i}this.set(t,r.value,r)}}set(e,t,r={}){if(t===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:c=this.sizeCalculation,status:l}=r,{noUpdateTTL:u=this.noUpdateTTL}=r,f=this.#L(e,t,r.size||0,c);if(this.maxEntrySize&&f>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.#O(e,"set"),this;let d=this.#i===0?void 0:this.#s.get(e);if(d===void 0)d=this.#i===0?this.#m:this.#y.length!==0?this.#y.pop():this.#i===this.#e?this.#M(!1):this.#i,this.#l[d]=e,this.#o[d]=t,this.#s.set(e,d),this.#p[this.#m]=d,this.#g[d]=this.#m,this.#m=d,this.#i++,this.#N(d,f,l),l&&(l.set="add"),u=!1;else{this.#B(d);let h=this.#o[d];if(t!==h){if(this.#v&&this.#h(h)){h.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:p}=h;p!==void 0&&!o&&(this.#w&&this.#r?.(p,e,"set"),this.#b&&this.#f?.push([p,e,"set"]))}else o||(this.#w&&this.#r?.(h,e,"set"),this.#b&&this.#f?.push([h,e,"set"]));if(this.#D(d),this.#N(d,f,l),this.#o[d]=t,l){l.set="replace";let p=h&&this.#h(h)?h.__staleWhileFetching:h;p!==void 0&&(l.oldValue=p)}}else l&&(l.set="update")}if(i!==0&&!this.#S&&this.#x(),this.#S&&(u||this.#F(d,i,s),l&&this.#a(l,d)),!o&&this.#b&&this.#f){let h=this.#f,p;for(;p=h?.shift();)this.#t?.(...p)}return this}pop(){try{for(;this.#i;){let e=this.#o[this.#d];if(this.#M(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#b&&this.#f){let e=this.#f,t;for(;t=e?.shift();)this.#t?.(...t)}}}#M(e){let t=this.#d,r=this.#l[t],i=this.#o[t];return this.#v&&this.#h(i)?i.__abortController.abort(new Error("evicted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(i,r,"evict"),this.#b&&this.#f?.push([i,r,"evict"])),this.#D(t),e&&(this.#l[t]=void 0,this.#o[t]=void 0,this.#y.push(t)),this.#i===1?(this.#d=this.#m=0,this.#y.length=0):this.#d=this.#p[t],this.#s.delete(r),this.#i--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:i}=t,s=this.#s.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#A(s))i&&(i.has="stale",this.#a(i,s));else return r&&this.#C(s),i&&(i.has="hit",this.#a(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,i=this.#s.get(e);if(i===void 0||!r&&this.#A(i))return;let s=this.#o[i];return this.#h(s)?s.__staleWhileFetching:s}#j(e,t,r,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new Ig,{signal:c}=r;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:r,context:i},u=a((v,b=!1)=>{let{aborted:w}=o.signal,T=r.ignoreFetchAbort&&v!==void 0;if(r.status&&(w&&!b?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,T&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),w&&!T&&!b)return d(o.signal.reason);let I=p;return this.#o[t]===p&&(v===void 0?I.__staleWhileFetching?this.#o[t]=I.__staleWhileFetching:this.#O(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,v,l.options))),v},"cb"),f=a(v=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=v),d(v)),"eb"),d=a(v=>{let{aborted:b}=o.signal,w=b&&r.allowStaleOnFetchAbort,T=w||r.allowStaleOnFetchRejection,I=T||r.noDeleteOnFetchRejection,$=p;if(this.#o[t]===p&&(!I||$.__staleWhileFetching===void 0?this.#O(e,"fetch"):w||(this.#o[t]=$.__staleWhileFetching)),T)return r.status&&$.__staleWhileFetching!==void 0&&(r.status.returnedStale=!0),$.__staleWhileFetching;if($.__returned===$)throw v},"fetchFail"),h=a((v,b)=>{let w=this.#c?.(e,s,l);w&&w instanceof Promise&&w.then(T=>v(T===void 0?void 0:T),b),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(v(void 0),r.allowStaleOnFetchAbort&&(v=a(T=>u(T,!0),"res")))})},"pcall");r.status&&(r.status.fetchDispatched=!0);let p=new Promise(h).then(u,f),y=Object.assign(p,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.set(e,y,{...l.options,status:void 0}),t=this.#s.get(e)):this.#o[t]=y,y}#h(e){if(!this.#v)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Ig}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:c=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:v,forceRefresh:b=!1,status:w,signal:T}=t;if(!this.#v)return w&&(w.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:w});let I={allowStale:r,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:y,ignoreFetchAbort:p,status:w,signal:T},$=this.#s.get(e);if($===void 0){w&&(w.fetch="miss");let q=this.#j(e,$,I,v);return q.__returned=q}else{let q=this.#o[$];if(this.#h(q)){let k=r&&q.__staleWhileFetching!==void 0;return w&&(w.fetch="inflight",k&&(w.returnedStale=!0)),k?q.__staleWhileFetching:q.__returned=q}let ce=this.#A($);if(!b&&!ce)return w&&(w.fetch="hit"),this.#B($),i&&this.#C($),w&&this.#a(w,$),q;let B=this.#j(e,$,I,v),F=B.__staleWhileFetching!==void 0&&r;return w&&(w.fetch=ce?"stale":"refresh",F&&ce&&(w.returnedStale=!0)),F?B.__staleWhileFetching:B.__returned=B}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(r===void 0)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#_;if(!r)throw new Error("no memoMethod provided to constructor");let{context:i,forceRefresh:s,...o}=t,c=this.get(e,o);if(!s&&c!==void 0)return c;let l=r(e,c,{options:o,context:i});return this.set(e,l,o),l}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#s.get(e);if(c!==void 0){let l=this.#o[c],u=this.#h(l);return o&&this.#a(o,c),this.#A(c)?(o&&(o.get="stale"),u?(o&&r&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),r?l.__staleWhileFetching:void 0):(s||this.#O(e,"expire"),o&&r&&(o.returnedStale=!0),r?l:void 0)):(o&&(o.get="hit"),u?l.__staleWhileFetching:(this.#B(c),i&&this.#C(c),l))}else o&&(o.get="miss")}#$(e,t){this.#g[t]=e,this.#p[e]=t}#B(e){e!==this.#m&&(e===this.#d?this.#d=this.#p[e]:this.#$(this.#g[e],this.#p[e]),this.#$(this.#m,e),this.#m=e)}delete(e){return this.#O(e,"delete")}#O(e,t){let r=!1;if(this.#i!==0){let i=this.#s.get(e);if(i!==void 0)if(r=!0,this.#i===1)this.#U(t);else{this.#D(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#b)&&(this.#w&&this.#r?.(s,e,t),this.#b&&this.#f?.push([s,e,t])),this.#s.delete(e),this.#l[i]=void 0,this.#o[i]=void 0,i===this.#m)this.#m=this.#g[i];else if(i===this.#d)this.#d=this.#p[i];else{let o=this.#g[i];this.#p[o]=this.#p[i];let c=this.#p[i];this.#g[c]=this.#g[i]}this.#i--,this.#y.push(i)}}if(this.#b&&this.#f?.length){let i=this.#f,s;for(;s=i?.shift();)this.#t?.(...s)}return r}clear(){return this.#U("delete")}#U(e){for(let t of this.#I({allowStale:!0})){let r=this.#o[t];if(this.#h(r))r.__abortController.abort(new Error("deleted"));else{let i=this.#l[t];this.#w&&this.#r?.(r,i,e),this.#b&&this.#f?.push([r,i,e])}}if(this.#s.clear(),this.#o.fill(void 0),this.#l.fill(void 0),this.#S&&this.#T&&(this.#S.fill(0),this.#T.fill(0)),this.#E&&this.#E.fill(0),this.#d=0,this.#m=0,this.#y.length=0,this.#u=0,this.#i=0,this.#b&&this.#f){let t=this.#f,r;for(;r=t?.shift();)this.#t?.(...r)}}};var Hl=require("node:path"),hF=require("node:url"),Is=require("fs"),SK=H(require("node:fs"),1),oa=require("node:fs/promises");var kg=require("node:events"),iE=H(require("node:stream"),1),cF=require("node:string_decoder");var iF=typeof process=="object"&&process?process:{stdout:null,stderr:null},uK=a(n=>!!n&&typeof n=="object"&&(n instanceof sa||n instanceof iE.default||fK(n)||dK(n)),"isStream"),fK=a(n=>!!n&&typeof n=="object"&&n instanceof kg.EventEmitter&&typeof n.pipe=="function"&&n.pipe!==iE.default.Writable.prototype.pipe,"isReadable"),dK=a(n=>!!n&&typeof n=="object"&&n instanceof kg.EventEmitter&&typeof n.write=="function"&&typeof n.end=="function","isWritable"),_o=Symbol("EOF"),So=Symbol("maybeEmitEnd"),ia=Symbol("emittedEnd"),Pg=Symbol("emittingEnd"),zf=Symbol("emittedError"),Og=Symbol("closed"),sF=Symbol("read"),Fg=Symbol("flush"),oF=Symbol("flushChunk"),Wi=Symbol("encoding"),Gl=Symbol("decoder"),Ar=Symbol("flowing"),Hf=Symbol("paused"),zl=Symbol("resume"),xr=Symbol("buffer"),bn=Symbol("pipes"),Cr=Symbol("bufferLength"),Jw=Symbol("bufferPush"),Dg=Symbol("bufferShift"),en=Symbol("objectMode"),Xt=Symbol("destroyed"),Zw=Symbol("error"),eE=Symbol("emitData"),aF=Symbol("emitEnd"),tE=Symbol("emitEnd2"),Cs=Symbol("async"),rE=Symbol("abort"),Ng=Symbol("aborted"),Qf=Symbol("signal"),rc=Symbol("dataListeners"),Wn=Symbol("discarded"),Kf=a(n=>Promise.resolve().then(n),"defer"),hK=a(n=>n(),"nodefer"),pK=a(n=>n==="end"||n==="finish"||n==="prefinish","isEndish"),mK=a(n=>n instanceof ArrayBuffer||!!n&&typeof n=="object"&&n.constructor&&n.constructor.name==="ArrayBuffer"&&n.byteLength>=0,"isArrayBufferLike"),gK=a(n=>!Buffer.isBuffer(n)&&ArrayBuffer.isView(n),"isArrayBufferView"),Lg=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,r){this.src=e,this.dest=t,this.opts=r,this.ondrain=()=>e[zl](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},nE=class extends Lg{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,r){super(e,t,r),this.proxyErrors=i=>t.emit("error",i),e.on("error",this.proxyErrors)}},yK=a(n=>!!n.objectMode,"isObjectModeOptions"),_K=a(n=>!n.objectMode&&!!n.encoding&&n.encoding!=="buffer","isEncodingOptions"),sa=class extends kg.EventEmitter{static{a(this,"Minipass")}[Ar]=!1;[Hf]=!1;[bn]=[];[xr]=[];[en];[Wi];[Cs];[Gl];[_o]=!1;[ia]=!1;[Pg]=!1;[Og]=!1;[zf]=null;[Cr]=0;[Xt]=!1;[Qf];[Ng]=!1;[rc]=0;[Wn]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");yK(t)?(this[en]=!0,this[Wi]=null):_K(t)?(this[Wi]=t.encoding,this[en]=!1):(this[en]=!1,this[Wi]=null),this[Cs]=!!t.async,this[Gl]=this[Wi]?new cF.StringDecoder(this[Wi]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[xr],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[bn],"get")});let{signal:r}=t;r&&(this[Qf]=r,r.aborted?this[rE]():r.addEventListener("abort",()=>this[rE]()))}get bufferLength(){return this[Cr]}get encoding(){return this[Wi]}set encoding(e){throw new Error("Encoding must be set at instantiation time")}setEncoding(e){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[en]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[Cs]}set async(e){this[Cs]=this[Cs]||!!e}[rE](){this[Ng]=!0,this.emit("abort",this[Qf]?.reason),this.destroy(this[Qf]?.reason)}get aborted(){return this[Ng]}set aborted(e){}write(e,t,r){if(this[Ng])return!1;if(this[_o])throw new Error("write after end");if(this[Xt])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(r=t,t="utf8"),t||(t="utf8");let i=this[Cs]?Kf:hK;if(!this[en]&&!Buffer.isBuffer(e)){if(gK(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(mK(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[en]?(this[Ar]&&this[Cr]!==0&&this[Fg](!0),this[Ar]?this.emit("data",e):this[Jw](e),this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar]):e.length?(typeof e=="string"&&!(t===this[Wi]&&!this[Gl]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Wi]&&(e=this[Gl].write(e)),this[Ar]&&this[Cr]!==0&&this[Fg](!0),this[Ar]?this.emit("data",e):this[Jw](e),this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar]):(this[Cr]!==0&&this.emit("readable"),r&&i(r),this[Ar])}read(e){if(this[Xt])return null;if(this[Wn]=!1,this[Cr]===0||e===0||e&&e>this[Cr])return this[So](),null;this[en]&&(e=null),this[xr].length>1&&!this[en]&&(this[xr]=[this[Wi]?this[xr].join(""):Buffer.concat(this[xr],this[Cr])]);let t=this[sF](e||null,this[xr][0]);return this[So](),t}[sF](e,t){if(this[en])this[Dg]();else{let r=t;e===r.length||e===null?this[Dg]():typeof r=="string"?(this[xr][0]=r.slice(e),t=r.slice(0,e),this[Cr]-=e):(this[xr][0]=r.subarray(e),t=r.subarray(0,e),this[Cr]-=e)}return this.emit("data",t),!this[xr].length&&!this[_o]&&this.emit("drain"),t}end(e,t,r){return typeof e=="function"&&(r=e,e=void 0),typeof t=="function"&&(r=t,t="utf8"),e!==void 0&&this.write(e,t),r&&this.once("end",r),this[_o]=!0,this.writable=!1,(this[Ar]||!this[Hf])&&this[So](),this}[zl](){this[Xt]||(!this[rc]&&!this[bn].length&&(this[Wn]=!0),this[Hf]=!1,this[Ar]=!0,this.emit("resume"),this[xr].length?this[Fg]():this[_o]?this[So]():this.emit("drain"))}resume(){return this[zl]()}pause(){this[Ar]=!1,this[Hf]=!0,this[Wn]=!1}get destroyed(){return this[Xt]}get flowing(){return this[Ar]}get paused(){return this[Hf]}[Jw](e){this[en]?this[Cr]+=1:this[Cr]+=e.length,this[xr].push(e)}[Dg](){return this[en]?this[Cr]-=1:this[Cr]-=this[xr][0].length,this[xr].shift()}[Fg](e=!1){do;while(this[oF](this[Dg]())&&this[xr].length);!e&&!this[xr].length&&!this[_o]&&this.emit("drain")}[oF](e){return this.emit("data",e),this[Ar]}pipe(e,t){if(this[Xt])return e;this[Wn]=!1;let r=this[ia];return t=t||{},e===iF.stdout||e===iF.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,r?t.end&&e.end():(this[bn].push(t.proxyErrors?new nE(this,e,t):new Lg(this,e,t)),this[Cs]?Kf(()=>this[zl]()):this[zl]()),e}unpipe(e){let t=this[bn].find(r=>r.dest===e);t&&(this[bn].length===1?(this[Ar]&&this[rc]===0&&(this[Ar]=!1),this[bn]=[]):this[bn].splice(this[bn].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let r=super.on(e,t);if(e==="data")this[Wn]=!1,this[rc]++,!this[bn].length&&!this[Ar]&&this[zl]();else if(e==="readable"&&this[Cr]!==0)super.emit("readable");else if(pK(e)&&this[ia])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[zf]){let i=t;this[Cs]?Kf(()=>i.call(this,this[zf])):i.call(this,this[zf])}return r}removeListener(e,t){return this.off(e,t)}off(e,t){let r=super.off(e,t);return e==="data"&&(this[rc]=this.listeners("data").length,this[rc]===0&&!this[Wn]&&!this[bn].length&&(this[Ar]=!1)),r}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[rc]=0,!this[Wn]&&!this[bn].length&&(this[Ar]=!1)),t}get emittedEnd(){return this[ia]}[So](){!this[Pg]&&!this[ia]&&!this[Xt]&&this[xr].length===0&&this[_o]&&(this[Pg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Og]&&this.emit("close"),this[Pg]=!1)}emit(e,...t){let r=t[0];if(e!=="error"&&e!=="close"&&e!==Xt&&this[Xt])return!1;if(e==="data")return!this[en]&&!r?!1:this[Cs]?(Kf(()=>this[eE](r)),!0):this[eE](r);if(e==="end")return this[aF]();if(e==="close"){if(this[Og]=!0,!this[ia]&&!this[Xt])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[zf]=r,super.emit(Zw,r);let s=!this[Qf]||this.listeners("error").length?super.emit("error",r):!1;return this[So](),s}else if(e==="resume"){let s=super.emit("resume");return this[So](),s}else if(e==="finish"||e==="prefinish"){let s=super.emit(e);return this.removeAllListeners(e),s}let i=super.emit(e,...t);return this[So](),i}[eE](e){for(let r of this[bn])r.dest.write(e)===!1&&this.pause();let t=this[Wn]?!1:super.emit("data",e);return this[So](),t}[aF](){return this[ia]?!1:(this[ia]=!0,this.readable=!1,this[Cs]?(Kf(()=>this[tE]()),!0):this[tE]())}[tE](){if(this[Gl]){let t=this[Gl].end();if(t){for(let r of this[bn])r.dest.write(t);this[Wn]||super.emit("data",t)}}for(let t of this[bn])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[en]||(e.dataLength=0);let t=this.promise();return this.on("data",r=>{e.push(r),this[en]||(e.dataLength+=r.length)}),await t,e}async concat(){if(this[en])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[Wi]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Xt,()=>t(new Error("stream destroyed"))),this.on("error",r=>t(r)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Wn]=!1;let e=!1,t=a(async()=>(this.pause(),e=!0,{value:void 0,done:!0}),"stop");return{next:a(()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[_o])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Xt,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Xt,f),this.pause(),s({value:d,done:!!this[_o]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Xt,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,h)=>{o=h,s=d,this.once(Xt,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[Wn]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Zw,t),this.off(Xt,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),r=a(()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},"next");return this.once("end",t),this.once(Zw,t),this.once(Xt,t),{next:r,throw:t,return:t,[Symbol.iterator](){return this}}}destroy(e){if(this[Xt])return e?this.emit("error",e):this.emit(Xt),this;this[Xt]=!0,this[Wn]=!0,this[xr].length=0,this[Cr]=0;let t=this;return typeof t.close=="function"&&!this[Og]&&t.close(),e?this.emit("error",e):this.emit(Xt),this}static get isStream(){return uK}};var vK=Is.realpathSync.native,Xf={lstatSync:Is.lstatSync,readdir:Is.readdir,readdirSync:Is.readdirSync,readlinkSync:Is.readlinkSync,realpathSync:vK,promises:{lstat:oa.lstat,readdir:oa.readdir,readlink:oa.readlink,realpath:oa.realpath}},pF=a(n=>!n||n===Xf||n===SK?Xf:{...Xf,...n,promises:{...Xf.promises,...n.promises||{}}},"fsFromOption"),mF=/^\\\\\?\\([a-z]:)\\?$/i,bK=a(n=>n.replace(/\//g,"\\").replace(mF,"$1\\"),"uncToDrive"),wK=/[\\\/]/,ci=0,gF=1,yF=2,Rs=4,_F=6,SF=8,nc=10,vF=12,ai=15,Yf=~ai,sE=16,lF=32,Jf=64,Gi=128,Mg=256,$g=512,uF=Jf|Gi|$g,EK=1023,oE=a(n=>n.isFile()?SF:n.isDirectory()?Rs:n.isSymbolicLink()?nc:n.isCharacterDevice()?yF:n.isBlockDevice()?_F:n.isSocket()?vF:n.isFIFO()?gF:ci,"entToType"),fF=new Map,Zf=a(n=>{let e=fF.get(n);if(e)return e;let t=n.normalize("NFKD");return fF.set(n,t),t},"normalize"),dF=new Map,jg=a(n=>{let e=dF.get(n);if(e)return e;let t=Zf(n.toLowerCase());return dF.set(n,t),t},"normalizeNocase"),Bg=class extends Gf{static{a(this,"ResolveCache")}constructor(){super({max:256})}},aE=class extends Gf{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},bF=Symbol("PathScurry setAsCwd"),tn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#e;#n;get dev(){return this.#n}#r;get mode(){return this.#r}#t;get nlink(){return this.#t}#c;get uid(){return this.#c}#_;get gid(){return this.#_}#i;get rdev(){return this.#i}#u;get blksize(){return this.#u}#s;get ino(){return this.#s}#l;get size(){return this.#l}#o;get blocks(){return this.#o}#p;get atimeMs(){return this.#p}#g;get mtimeMs(){return this.#g}#d;get ctimeMs(){return this.#d}#m;get birthtimeMs(){return this.#m}#y;get atime(){return this.#y}#f;get mtime(){return this.#f}#E;get ctime(){return this.#E}#T;get birthtime(){return this.#T}#S;#w;#v;#b;#x;#C;#a;#F;#A;#P;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ci,r,i,s,o,c){this.name=e,this.#S=s?jg(e):Zf(e),this.#a=t&EK,this.nocase=s,this.roots=i,this.root=r||this,this.#F=o,this.#v=c.fullpath,this.#x=c.relative,this.#C=c.relativePosix,this.parent=c.parent,this.parent?this.#e=this.parent.#e:this.#e=pF(c.fs)}depth(){return this.#w!==void 0?this.#w:this.parent?this.#w=this.parent.depth()+1:this.#w=0}childrenCache(){return this.#F}resolve(e){if(!e)return this;let t=this.getRootString(e),i=e.substring(t.length).split(this.splitSep);return t?this.getRoot(t).#D(i):this.#D(i)}#D(e){let t=this;for(let r of e)t=t.child(r);return t}children(){let e=this.#F.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#F.set(this,t),this.#a&=~sE,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let r=this.children(),i=this.nocase?jg(e):Zf(e);for(let l of r)if(l.#S===i)return l;let s=this.parent?this.sep:"",o=this.#v?this.#v+s+e:void 0,c=this.newChild(e,ci,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#a|=Gi),r.push(c),c}relative(){if(this.isCWD)return"";if(this.#x!==void 0)return this.#x;let e=this.name,t=this.parent;if(!t)return this.#x=this.name;let r=t.relative();return r+(!r||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#C!==void 0)return this.#C;let e=this.name,t=this.parent;if(!t)return this.#C=this.fullpathPosix();let r=t.relativePosix();return r+(!r||!t.parent?"":"/")+e}fullpath(){if(this.#v!==void 0)return this.#v;let e=this.name,t=this.parent;if(!t)return this.#v=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#v=i}fullpathPosix(){if(this.#b!==void 0)return this.#b;if(this.sep==="/")return this.#b=this.fullpath();if(!this.parent){let i=this.fullpath().replace(/\\/g,"/");return/^[a-z]:\//i.test(i)?this.#b=`//?/${i}`:this.#b=i}let e=this.parent,t=e.fullpathPosix(),r=t+(!t||!e.parent?"":"/")+this.name;return this.#b=r}isUnknown(){return(this.#a&ai)===ci}isType(e){return this[`is${e}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#a&ai)===SF}isDirectory(){return(this.#a&ai)===Rs}isCharacterDevice(){return(this.#a&ai)===yF}isBlockDevice(){return(this.#a&ai)===_F}isFIFO(){return(this.#a&ai)===gF}isSocket(){return(this.#a&ai)===vF}isSymbolicLink(){return(this.#a&nc)===nc}lstatCached(){return this.#a&lF?this:void 0}readlinkCached(){return this.#A}realpathCached(){return this.#P}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#A)return!0;if(!this.parent)return!1;let e=this.#a&ai;return!(e!==ci&&e!==nc||this.#a&Mg||this.#a&Gi)}calledReaddir(){return!!(this.#a&sE)}isENOENT(){return!!(this.#a&Gi)}isNamed(e){return this.nocase?this.#S===jg(e):this.#S===Zf(e)}async readlink(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#e.promises.readlink(this.fullpath()),r=(await this.parent.realpath())?.resolve(t);if(r)return this.#A=r}catch(t){this.#h(t.code);return}}readlinkSync(){let e=this.#A;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#e.readlinkSync(this.fullpath()),r=this.parent.realpathSync()?.resolve(t);if(r)return this.#A=r}catch(t){this.#h(t.code);return}}#N(e){this.#a|=sE;for(let t=e.provisional;t<e.length;t++){let r=e[t];r&&r.#L()}}#L(){this.#a&Gi||(this.#a=(this.#a|Gi)&Yf,this.#R())}#R(){let e=this.children();e.provisional=0;for(let t of e)t.#L()}#I(){this.#a|=$g,this.#k()}#k(){if(this.#a&Jf)return;let e=this.#a;(e&ai)===Rs&&(e&=Yf),this.#a=e|Jf,this.#R()}#M(e=""){e==="ENOTDIR"||e==="EPERM"?this.#k():e==="ENOENT"?this.#L():this.children().provisional=0}#j(e=""){e==="ENOTDIR"?this.parent.#k():e==="ENOENT"&&this.#L()}#h(e=""){let t=this.#a;t|=Mg,e==="ENOENT"&&(t|=Gi),(e==="EINVAL"||e==="UNKNOWN")&&(t&=Yf),this.#a=t,e==="ENOTDIR"&&this.parent&&this.parent.#k()}#$(e,t){return this.#O(e,t)||this.#B(e,t)}#B(e,t){let r=oE(e),i=this.newChild(e.name,r,{parent:this}),s=i.#a&ai;return s!==Rs&&s!==nc&&s!==ci&&(i.#a|=Jf),t.unshift(i),t.provisional++,i}#O(e,t){for(let r=t.provisional;r<t.length;r++){let i=t[r];if((this.nocase?jg(e.name):Zf(e.name))===i.#S)return this.#U(e,i,r,t)}}#U(e,t,r,i){let s=t.name;return t.#a=t.#a&Yf|oE(e),s!==e.name&&(t.name=e.name),r!==i.provisional&&(r===i.length-1?i.pop():i.splice(r,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#a&Gi)===0)try{return this.#G(await this.#e.promises.lstat(this.fullpath())),this}catch(e){this.#j(e.code)}}lstatSync(){if((this.#a&Gi)===0)try{return this.#G(this.#e.lstatSync(this.fullpath())),this}catch(e){this.#j(e.code)}}#G(e){let{atime:t,atimeMs:r,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:h,mode:p,mtime:y,mtimeMs:v,nlink:b,rdev:w,size:T,uid:I}=e;this.#y=t,this.#p=r,this.#T=i,this.#m=s,this.#u=o,this.#o=c,this.#E=l,this.#d=u,this.#n=f,this.#_=d,this.#s=h,this.#r=p,this.#f=y,this.#g=v,this.#t=b,this.#i=w,this.#l=T,this.#c=I;let $=oE(e);this.#a=this.#a&Yf|$|lF,$!==ci&&$!==Rs&&$!==nc&&(this.#a|=Jf)}#q=[];#W=!1;#z(e){this.#W=!1;let t=this.#q.slice();this.#q.length=0,t.forEach(r=>r(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let r=this.children();if(this.calledReaddir()){let s=r.slice(0,r.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#q.push(e),this.#W)return;this.#W=!0;let i=this.fullpath();this.#e.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#M(s.code),r.provisional=0;else{for(let c of o)this.#$(c,r);this.#N(r)}this.#z(r.slice(0,r.provisional))})}#V;async readdir(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();if(this.#V)await this.#V;else{let r=a(()=>{},"resolve");this.#V=new Promise(i=>r=i);try{for(let i of await this.#e.promises.readdir(t,{withFileTypes:!0}))this.#$(i,e);this.#N(e)}catch(i){this.#M(i.code),e.provisional=0}this.#V=void 0,r()}return e.slice(0,e.provisional)}readdirSync(){if(!this.canReaddir())return[];let e=this.children();if(this.calledReaddir())return e.slice(0,e.provisional);let t=this.fullpath();try{for(let r of this.#e.readdirSync(t,{withFileTypes:!0}))this.#$(r,e);this.#N(e)}catch(r){this.#M(r.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#a&uF)return!1;let e=ai&this.#a;return e===ci||e===Rs||e===nc}shouldWalk(e,t){return(this.#a&Rs)===Rs&&!(this.#a&uF)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#P)return this.#P;if(!(($g|Mg|Gi)&this.#a))try{let e=await this.#e.promises.realpath(this.fullpath());return this.#P=this.resolve(e)}catch{this.#I()}}realpathSync(){if(this.#P)return this.#P;if(!(($g|Mg|Gi)&this.#a))try{let e=this.#e.realpathSync(this.fullpath());return this.#P=this.resolve(e)}catch{this.#I()}}[bF](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),r=[],i=this;for(;i&&i.parent;)t.add(i),i.#x=r.join(this.sep),i.#C=r.join("/"),i=i.parent,r.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#x=void 0,i.#C=void 0,i=i.parent}},Ug=class n extends tn{static{a(this,"PathWin32")}sep="\\";splitSep=wK;constructor(e,t=ci,r,i,s,o,c){super(e,t,r,i,s,o,c)}newChild(e,t=ci,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}getRootString(e){return Hl.win32.parse(e).root}getRoot(e){if(e=bK(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,r]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=r;return this.roots[e]=new Ql(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(mF,"$1\\"),e===t}},Vg=class n extends tn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ci,r,i,s,o,c){super(e,t,r,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ci,r={}){return new n(e,t,this.root,this.roots,this.nocase,this.childrenCache(),r)}},qg=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#e;#n;#r;nocase;#t;constructor(e=process.cwd(),t,r,{nocase:i,childrenCacheSize:s=16*1024,fs:o=Xf}={}){this.#t=pF(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,hF.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#e=new Bg,this.#n=new Bg,this.#r=new aE(s);let l=c.substring(this.rootPath.length).split(r);if(l.length===1&&!l[0]&&l.pop(),i===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=i,this.root=this.newRoot(this.#t),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,h=this.rootPath,p=!1;for(let y of l){let v=f--;u=u.child(y,{relative:new Array(v).fill("..").join(d),relativePosix:new Array(v).fill("..").join("/"),fullpath:h+=(p?"":d)+y}),p=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#r}resolve(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#e.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpath();return this.#e.set(t,i),i}resolvePosix(...e){let t="";for(let s=e.length-1;s>=0;s--){let o=e[s];if(!(!o||o===".")&&(t=t?`${o}/${t}`:o,this.isAbsolute(o)))break}let r=this.#n.get(t);if(r!==void 0)return r;let i=this.cwd.resolve(t).fullpathPosix();return this.#n.set(t,i),i}relative(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relative()}relativePosix(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.relativePosix()}basename(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.name}dirname(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),(e.parent||e).fullpath()}async readdir(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r}=t;if(e.canReaddir()){let i=await e.readdir();return r?i:i.map(s=>s.name)}else return[]}readdirSync(e=this.cwd,t={withFileTypes:!0}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0}=t;return e.canReaddir()?r?e.readdirSync():e.readdirSync().map(i=>i.name):[]}async lstat(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstat()}lstatSync(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.lstatSync()}async readlink(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=await e.readlink();return t?r:r?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=e.readlinkSync();return t?r:r?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=await e.realpath();return t?r:r?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e.withFileTypes,e=this.cwd);let r=e.realpathSync();return t?r:r?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set,u=a((d,h)=>{l.add(d),d.readdirCB((p,y)=>{if(p)return h(p);let v=y.length;if(!v)return h();let b=a(()=>{--v===0&&h()},"next");for(let w of y)(!s||s(w))&&c.push(r?w:w.fullpath()),i&&w.isSymbolicLink()?w.realpath().then(T=>T?.isUnknown()?T.lstat():T).then(T=>T?.shouldWalk(l,o)?u(T,b):b()):w.shouldWalk(l,o)?u(w,b):b()},!0)},"walk"),f=e;return new Promise((d,h)=>{u(f,p=>{if(p)return h(p);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(r?e:e.fullpath());let l=new Set([e]);for(let u of l){let f=u.readdirSync();for(let d of f){(!s||s(d))&&c.push(r?d:d.fullpath());let h=d;if(d.isSymbolicLink()){if(!(i&&(h=d.realpathSync())))continue;h.isUnknown()&&h.lstatSync()}h.shouldWalk(l,o)&&l.add(h)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd),this.stream(e,t)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield r?e:e.fullpath());let c=new Set([e]);for(let l of c){let u=l.readdirSync();for(let f of u){(!s||s(f))&&(yield r?f:f.fullpath());let d=f;if(f.isSymbolicLink()){if(!(i&&(d=f.realpathSync())))continue;d.isUnknown()&&d.lstatSync()}d.shouldWalk(c,o)&&c.add(d)}}}stream(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new sa({objectMode:!0});(!s||s(e))&&c.write(r?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let y=a((b,w,T=!1)=>{if(b)return c.emit("error",b);if(i&&!T){let I=[];for(let $ of w)$.isSymbolicLink()&&I.push($.realpath().then(q=>q?.isUnknown()?q.lstat():q));if(I.length){Promise.all(I).then(()=>y(null,w,!0));return}}for(let I of w)I&&(!s||s(I))&&(c.write(r?I:I.fullpath())||(h=!0));f--;for(let I of w){let $=I.realpathCached()||I;$.shouldWalk(l,o)&&u.push($)}h&&!c.flowing?c.once("drain",d):v||d()},"onReaddir"),v=!0;p.readdirCB(y,!0),v=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof tn||(t=e,e=this.cwd);let{withFileTypes:r=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new sa({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(r?e:e.fullpath());let u=[e],f=0,d=a(()=>{let h=!1;for(;!h;){let p=u.shift();if(!p){f===0&&c.end();return}f++,l.add(p);let y=p.readdirSync();for(let v of y)(!s||s(v))&&(c.write(r?v:v.fullpath())||(h=!0));f--;for(let v of y){let b=v;if(v.isSymbolicLink()){if(!(i&&(b=v.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}h&&!c.flowing&&c.once("drain",d)},"process");return d(),c}chdir(e=this.cwd){let t=this.cwd;this.cwd=typeof e=="string"?this.cwd.resolve(e):e,this.cwd[bF](t)}},Ql=class extends qg{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,Hl.win32,"\\",{...t,nocase:r}),this.nocase=r;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Hl.win32.parse(e).root.toUpperCase()}newRoot(e){return new Ug(this.rootPath,Rs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Kl=class extends qg{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:r=!1}=t;super(e,Hl.posix,"/",{...t,nocase:r}),this.nocase=r}parseRootPath(e){return"/"}newRoot(e){return new Vg(this.rootPath,Rs,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},ed=class extends Kl{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:r=!0}=t;super(e,{...t,nocase:r})}},jfe=process.platform==="win32"?Ug:Vg,wF=process.platform==="win32"?Ql:process.platform==="darwin"?ed:Kl;var TK=a(n=>n.length>=1,"isPatternList"),AK=a(n=>n.length>=1,"isGlobList"),Yl=class n{static{a(this,"Pattern")}#e;#n;#r;length;#t;#c;#_;#i;#u;#s;#l=!0;constructor(e,t,r,i){if(!TK(e))throw new TypeError("empty pattern list");if(!AK(t))throw new TypeError("empty glob list");if(t.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,r<0||r>=this.length)throw new TypeError("index out of range");if(this.#e=e,this.#n=t,this.#r=r,this.#t=i,this.#r===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#e,[f,d,h,p,...y]=this.#n;u[0]===""&&(u.shift(),y.shift());let v=[s,o,c,l,""].join("/"),b=[f,d,h,p,""].join("/");this.#e=[v,...u],this.#n=[b,...y],this.length=this.#e.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#e,[c,...l]=this.#n;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#e=[u,...o],this.#n=[f,...l],this.length=this.#e.length}}}pattern(){return this.#e[this.#r]}isString(){return typeof this.#e[this.#r]=="string"}isGlobstar(){return this.#e[this.#r]===Yt}isRegExp(){return this.#e[this.#r]instanceof RegExp}globString(){return this.#_=this.#_||(this.#r===0?this.isAbsolute()?this.#n[0]+this.#n.slice(1).join("/"):this.#n.join("/"):this.#n.slice(this.#r).join("/"))}hasMore(){return this.length>this.#r+1}rest(){return this.#c!==void 0?this.#c:this.hasMore()?(this.#c=new n(this.#e,this.#n,this.#r+1,this.#t),this.#c.#s=this.#s,this.#c.#u=this.#u,this.#c.#i=this.#i,this.#c):this.#c=null}isUNC(){let e=this.#e;return this.#u!==void 0?this.#u:this.#u=this.#t==="win32"&&this.#r===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#e;return this.#i!==void 0?this.#i:this.#i=this.#t==="win32"&&this.#r===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#e;return this.#s!==void 0?this.#s:this.#s=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#e[0];return typeof e=="string"&&this.isAbsolute()&&this.#r===0?e:""}checkFollowGlobstar(){return!(this.#r===0||!this.isGlobstar()||!this.#l)}markFollowGlobstar(){return this.#r===0||!this.isGlobstar()||!this.#l?!1:(this.#l=!1,!0)}};var xK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Xl=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:r,noext:i,noglobstar:s,platform:o=xK}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:r,noext:i,noglobstar:s,optimizationLevel:2,platform:o,nocomment:!0,nonegate:!0};for(let c of e)this.add(c)}add(e){let t=new qn(e,this.mmopts);for(let r=0;r<t.set.length;r++){let i=t.set[r],s=t.globParts[r];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Yl(i,s,0,this.platform),c=new qn(o.globString(),this.mmopts),l=s[s.length-1]==="**",u=o.isAbsolute();u?this.absolute.push(c):this.relative.push(c),l&&(u?this.absoluteChildren.push(c):this.relativeChildren.push(c))}}ignored(e){let t=e.fullpath(),r=`${t}/`,i=e.relative()||".",s=`${i}/`;for(let o of this.relative)if(o.match(i)||o.match(s))return!0;for(let o of this.absolute)if(o.match(t)||o.match(r))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",r=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(r))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}};var cE=class n{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new n(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let r=e.fullpath(),i=this.store.get(r);i?i.add(t.globString()):this.store.set(r,new Set([t.globString()]))}},lE=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,r){let i=(t?2:0)|(r?1:0),s=this.store.get(e);this.store.set(e,s===void 0?i:i&s)}entries(){return[...this.store.entries()].map(([e,t])=>[e,!!(t&2),!!(t&1)])}},uE=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let r=this.store.get(e);r?r.find(i=>i.globString()===t.globString())||r.push(t):this.store.set(e,[t])}get(e){let t=this.store.get(e);if(!t)throw new Error("attempting to walk unknown path");return t}entries(){return this.keys().map(e=>[e,this.store.get(e)])}keys(){return[...this.store.keys()].filter(e=>e.canReaddir())}},td=class n{static{a(this,"Processor")}hasWalkedCache;matches=new lE;subwalks=new uE;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new cE}processPatterns(e,t){this.patterns=t;let r=t.map(i=>[e,i]);for(let[i,s]of r){this.hasWalkedCache.storeWalked(i,s);let o=s.root(),c=s.isAbsolute()&&this.opts.absolute!==!1;if(o){i=i.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let d=s.rest();if(d)s=d;else{this.matches.add(i,!0,!1);continue}}if(i.isENOENT())continue;let l,u,f=!1;for(;typeof(l=s.pattern())=="string"&&(u=s.rest());)i=i.resolve(l),s=u,f=!0;if(l=s.pattern(),u=s.rest(),f){if(this.hasWalkedCache.hasWalked(i,s))continue;this.hasWalkedCache.storeWalked(i,s)}if(typeof l=="string"){let d=l===".."||l===""||l===".";this.matches.add(i.resolve(l),c,d);continue}else if(l===Yt){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),h=u?.rest();if(!u||(d===""||d===".")&&!h)this.matches.add(i,c,d===""||d===".");else if(d===".."){let p=i.parent||i;h?this.hasWalkedCache.hasWalked(p,h)||this.subwalks.add(p,h):this.matches.add(p,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new n(this.opts,this.hasWalkedCache)}filterEntries(e,t){let r=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of r){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Yt?i.testGlobstar(s,o,u,c):l instanceof RegExp?i.testRegExp(s,l,u,c):i.testString(s,l,u,c)}return i}testGlobstar(e,t,r,i){if((this.dot||!e.name.startsWith("."))&&(t.hasMore()||this.matches.add(e,i,!1),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,t):e.isSymbolicLink()&&(r&&t.checkFollowGlobstar()?this.subwalks.add(e,r):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),r){let s=r.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,r.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,r)}else s instanceof RegExp&&this.testRegExp(e,s,r.rest(),i)}}testRegExp(e,t,r,i){t.test(e.name)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}testString(e,t,r,i){e.isNamed(t)&&(r?this.subwalks.add(e,r):this.matches.add(e,i,!1))}};var CK=a((n,e)=>typeof n=="string"?new Xl([n],e):Array.isArray(n)?new Xl(n,e):n,"makeIgnore"),Wg=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#e=[];#n;#r;signal;maxDepth;includeChildMatches;constructor(e,t,r){if(this.patterns=e,this.path=t,this.opts=r,this.#r=!r.posix&&r.platform==="win32"?"\\":"/",this.includeChildMatches=r.includeChildMatches!==!1,(r.ignore||!this.includeChildMatches)&&(this.#n=CK(r.ignore??[],r),!this.includeChildMatches&&typeof this.#n.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=r.maxDepth||1/0,r.signal&&(this.signal=r.signal,this.signal.addEventListener("abort",()=>{this.#e.length=0}))}#t(e){return this.seen.has(e)||!!this.#n?.ignored?.(e)}#c(e){return!!this.#n?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#e.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#e.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||await e.realpath(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?await e.lstat():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=await s.realpath();o&&(o.isUnknown()||this.opts.stat)&&await o.lstat()}return this.matchCheckTest(s,t)}matchCheckTest(e,t){return e&&(this.maxDepth===1/0||e.depth()<=this.maxDepth)&&(!t||e.canReaddir())&&(!this.opts.nodir||!e.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!e.isSymbolicLink()||!e.realpathCached()?.isDirectory())&&!this.#t(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let r;if(this.opts.realpath){if(r=e.realpathCached()||e.realpathSync(),!r)return;e=r}let s=e.isUnknown()||this.opts.stat?e.lstatSync():e;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let o=s.realpathSync();o&&(o?.isUnknown()||this.opts.stat)&&o.lstatSync()}return this.matchCheckTest(s,t)}matchFinish(e,t){if(this.#t(e))return;if(!this.includeChildMatches&&this.#n?.add){let s=`${e.relativePosix()}/**`;this.#n.add(s)}let r=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#r:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(r){let s=this.opts.posix?e.fullpathPosix():e.fullpath();this.matchEmit(s+i)}else{let s=this.opts.posix?e.relativePosix():e.relative(),o=this.opts.dotRelative&&!s.startsWith(".."+this.#r)?"."+this.#r:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,r){let i=await this.matchCheck(e,r);i&&this.matchFinish(i,t)}matchSync(e,t,r){let i=this.matchCheckSync(e,r);i&&this.matchFinish(i,t)}walkCB(e,t,r){this.signal?.aborted&&r(),this.walkCB2(e,t,new td(this.opts),r)}walkCB2(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,r,o):c.readdirCB((u,f)=>this.walkCB3(c,f,r,o),!0)}o()}walkCB3(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of r.subwalks.entries())s++,this.walkCB2(c,l,r.child(),o);o()}walkCBSync(e,t,r){this.signal?.aborted&&r(),this.walkCB2Sync(e,t,new td(this.opts),r)}walkCB2Sync(e,t,r,i){if(this.#c(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,r,i));return}r.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let c of r.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,r,o)}o()}walkCB3Sync(e,t,r,i){r=r.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of r.matches.entries())this.#t(c)||this.matchSync(c,l,u);for(let[c,l]of r.subwalks.entries())s++,this.walkCB2Sync(c,l,r.child(),o);o()}},rd=class extends Wg{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,r){super(e,t,r)}matchEmit(e){this.matches.add(e)}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((e,t)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?t(this.signal.reason):e(this.matches)})}),this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>{if(this.signal?.aborted)throw this.signal.reason}),this.matches}},nd=class extends Wg{static{a(this,"GlobStream")}results;constructor(e,t,r){super(e,t,r),this.results=new sa({signal:this.signal,objectMode:!0}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume())}matchEmit(e){this.results.write(e),this.results.flowing||this.pause()}stream(){let e=this.path;return e.isUnknown()?e.lstat().then(()=>{this.walkCB(e,this.patterns,()=>this.results.end())}):this.walkCB(e,this.patterns,()=>this.results.end()),this.results}streamSync(){return this.path.isUnknown()&&this.path.lstatSync(),this.walkCBSync(this.path,this.patterns,()=>this.results.end()),this.results}};var RK=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",zi=class{static{a(this,"Glob")}absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(e,t){if(!t)throw new TypeError("glob options required");if(this.withFileTypes=!!t.withFileTypes,this.signal=t.signal,this.follow=!!t.follow,this.dot=!!t.dot,this.dotRelative=!!t.dotRelative,this.nodir=!!t.nodir,this.mark=!!t.mark,t.cwd?(t.cwd instanceof URL||t.cwd.startsWith("file://"))&&(t.cwd=(0,EF.fileURLToPath)(t.cwd)):this.cwd="",this.cwd=t.cwd||"",this.root=t.root,this.magicalBraces=!!t.magicalBraces,this.nobrace=!!t.nobrace,this.noext=!!t.noext,this.realpath=!!t.realpath,this.absolute=t.absolute,this.includeChildMatches=t.includeChildMatches!==!1,this.noglobstar=!!t.noglobstar,this.matchBase=!!t.matchBase,this.maxDepth=typeof t.maxDepth=="number"?t.maxDepth:1/0,this.stat=!!t.stat,this.ignore=t.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof e=="string"&&(e=[e]),this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(e=e.map(l=>l.replace(/\\/g,"/"))),this.matchBase){if(t.noglobstar)throw new TypeError("base matching requires globstar");e=e.map(l=>l.includes("/")?l:`./**/${l}`)}if(this.pattern=e,this.platform=t.platform||RK,this.opts={...t,platform:this.platform},t.scurry){if(this.scurry=t.scurry,t.nocase!==void 0&&t.nocase!==t.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else{let l=t.platform==="win32"?Ql:t.platform==="darwin"?ed:t.platform?Kl:wF;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let r=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:r,nocomment:!0,noext:this.noext,nonegate:!0,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},s=this.pattern.map(l=>new qn(l,i)),[o,c]=s.reduce((l,u)=>(l[0].push(...u.set),l[1].push(...u.globParts),l),[[],[]]);this.patterns=o.map((l,u)=>{let f=c[u];if(!f)throw new Error("invalid pattern object");return new Yl(l,f,0,this.platform)})}async walk(){return[...await new rd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new rd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new nd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new nd(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==1/0?this.maxDepth+this.scurry.cwd.depth():1/0,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}};var fE=a((n,e={})=>{Array.isArray(n)||(n=[n]);for(let t of n)if(new qn(t,e).hasMagic())return!0;return!1},"hasMagic");function Gg(n,e={}){return new zi(n,e).streamSync()}a(Gg,"globStreamSync");function AF(n,e={}){return new zi(n,e).stream()}a(AF,"globStream");function xF(n,e={}){return new zi(n,e).walkSync()}a(xF,"globSync");async function TF(n,e={}){return new zi(n,e).walk()}a(TF,"glob_");function zg(n,e={}){return new zi(n,e).iterateSync()}a(zg,"globIterateSync");function CF(n,e={}){return new zi(n,e).iterate()}a(CF,"globIterate");var IK=Gg,PK=Object.assign(AF,{sync:Gg}),OK=zg,FK=Object.assign(CF,{sync:zg}),DK=Object.assign(xF,{stream:Gg,iterate:zg}),Jl=Object.assign(TF,{glob:TF,globSync:xF,sync:DK,globStream:AF,stream:PK,globStreamSync:Gg,streamSync:IK,globIterate:CF,iterate:FK,globIterateSync:zg,iterateSync:OK,Glob:zi,hasMagic:fE,escape:Vl,unescape:qi});Jl.glob=Jl;async function id(n,e,t,r={}){let{dryRun:i=!1,excludeRelPath:s}=r,o=ic.default.join(n,"**/*.md"),c=await Jl(o,{nodir:!0,ignore:[ic.default.join(n,".obsidian/**"),ic.default.join(n,".trash/**"),ic.default.join(n,"**/.obsidian/**"),ic.default.join(n,"**/.trash/**")]}),l={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let u of c){let f=ic.default.relative(n,u);if(s&&f===s)continue;l.filesScanned+=1;let d;try{d=await dE.default.readFile(u,"utf-8")}catch{continue}let{updated:h,replacements:p}=NK(d,e,t);p>0&&(l.filesModified+=1,l.replacements+=p,l.modifiedFiles.push(f),i||await dE.default.writeFile(u,h,"utf-8"))}return l}a(id,"rewriteInboundWikilinks");function NK(n,e,t){let r=n.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=r[s],c=LK(o,e,t);i+=c.replacements,r[s]=c.updated}return{updated:r.join(""),replacements:i}}a(NK,"rewriteContent");function LK(n,e,t){let r=n.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<r.length;s++){if(s%2===1)continue;let o=kK(r[s],e,t);i+=o.replacements,r[s]=o.updated}return{updated:r.join(""),replacements:i}}a(LK,"rewriteProseSegment");function kK(n,e,t){let r=/(?<!!)\[\[([^\[\]\n|#]+)(#[^\[\]\n|]*)?(\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:n.replace(r,(o,c,l,u)=>{if(c.trim()!==e)return o;i+=1;let d=l??"",h;return u?h=u:d?h=`|${e}`:h=`|${e}`,`[[${t}${d}${h}]]`}),replacements:i}}a(kK,"replaceWikilinks");var MK=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Nt=class{constructor(e){this.rootPath=e;this.uuidIndex=null;this.basenameIndex=null;this.aliasIndex=null}static{a(this,"FileSystemVaultAdapter")}async read(e){let t=this.resolvePath(e.path);if(!await cr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return cr.default.readFile(t,"utf-8")}async create(e,t){let r=this.resolvePath(e);if(await cr.default.pathExists(r))throw new Error(`File already exists: ${e}`);return await cr.default.ensureDir(Jt.default.dirname(r)),await cr.default.writeFile(r,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let r=this.resolvePath(e.path);if(!await cr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await cr.default.writeFile(r,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await cr.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await cr.default.remove(t)}async exists(e){let t=this.resolvePath(e);return cr.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let r=cr.default.statSync(t);if(r.isFile())return this.createFileObject(e);if(r.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let r=Jt.default.relative(this.rootPath,t);e.push(this.createFileObject(r))}}),e}getFrontmatter(e){try{let t=cr.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}async updateFrontmatter(e,t){let r=await this.read(e),i=this.extractFrontmatter(r)||{},s=t(i),o=this.replaceFrontmatter(r,s);await this.modify(e,o)}async rename(e,t){let r=this.resolvePath(e.path),i=this.resolvePath(t);if(!await cr.default.pathExists(r))throw new Error(`File not found: ${e.path}`);await cr.default.ensureDir(Jt.default.dirname(i)),await cr.default.move(r,i)}async createFolder(e){let t=this.resolvePath(e);await cr.default.ensureDir(t)}getFirstLinkpathDest(e,t){let r=e.split("|")[0].trim();if(!r)return null;if(MK.test(r)){this.uuidIndex===null&&this.buildUuidIndex();let u=r.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let i=Jt.default.dirname(this.resolvePath(t)),s;if(Jt.default.isAbsolute(r)?s=this.resolvePath(r):s=Jt.default.resolve(i,r),r.endsWith(".md")||(s+=".md"),cr.default.existsSync(s)){let u=Jt.default.relative(this.rootPath,s);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let o=r.toLowerCase(),c=this.basenameIndex.get(o);if(c)return this.createFileObject(c);let l=this.aliasIndex.get(o);return l?this.createFileObject(l):null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=Jt.default.relative(this.rootPath,e),r=Jt.default.basename(e,".md").toLowerCase();this.basenameIndex.has(r)||this.basenameIndex.set(r,t);let i;try{i=cr.default.readFileSync(e,"utf-8")}catch{return}let s=this.extractFrontmatter(i);if(!s)return;let o=s.aliases,c=Array.isArray(o)?o:typeof o=="string"?[o]:[];for(let l of c){if(typeof l!="string")continue;let u=l.trim().toLowerCase();u&&(this.aliasIndex.has(u)||this.aliasIndex.set(u,t))}})}buildUuidIndex(){this.uuidIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(e.endsWith(".md")){let r=Jt.default.basename(e,".md").match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);if(r){let i=r[1].toLowerCase(),s=Jt.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let r=await this.read(e),i=t(r);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,r){let i=Jt.default.basename(t,".md");await id(this.rootPath,r,i,{excludeRelPath:e})}resolvePath(e){return Jt.default.isAbsolute(e)?e:Jt.default.join(this.rootPath,e)}createFileObject(e){let t=Jt.default.basename(e),r=Jt.default.basename(e,Jt.default.extname(e)),i=Jt.default.dirname(e);return{path:e,basename:r,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:Jt.default.basename(e)}}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return null;try{let i=ar.load(r[1]);return typeof i=="object"&&i!==null?i:null}catch{return null}}replaceFrontmatter(e,t){let r=ar.dump(t,{lineWidth:-1,noRefs:!0,quotingType:'"'}),i=/^---\n([\s\S]*?)\n---/;return e.match(i)?e.replace(i,`---
495
495
  ${r.trim()}
496
496
  ---`):`---
497
497
  ${r.trim()}
@@ -526,19 +526,19 @@ To fix this:
526
526
  3. Simplify query: reduce WHERE clauses or add LIMIT
527
527
  4. Use cache: --use-cache for faster vault loading${i!==void 0?`
528
528
 
529
- Partial results: ${i} result(s) were collected before timeout.`:""}`}static{a(this,"QueryTimeoutError")}};var cd=H(require("path")),rn=H(go()),Ir=H(Pt());var Gn=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=cd.default.resolve(e),this.cachePath=cd.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{a(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await rn.default.pathExists(this.cachePath))return!1;let e=await rn.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await rn.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await rn.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),r=new Nt(this.vaultPath),s=await new Ir.NoteToRDFConverter(r).convertVaultWithValidation({strict:e.strict??!1}),o=await rn.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:o.mtimeMs},triples:c};return await rn.default.ensureDir(cd.default.dirname(this.cachePath)),await rn.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new Nt(this.vaultPath);return new Ir.NoteToRDFConverter(e).validateVault()}async invalidate(){await rn.default.pathExists(this.cachePath)&&await rn.default.remove(this.cachePath)}async getCacheStats(){try{if(!await rn.default.pathExists(this.cachePath))return null;let e=await rn.default.readJson(this.cachePath),t=await rn.default.stat(this.cachePath),r=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:r,sizeBytes:t.size}}catch{return null}}async saveTriples(e){let t=await rn.default.stat(this.vaultPath),r=e.map(this.serializeTriple),i={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:e.length,vaultMtime:t.mtimeMs},triples:r};await rn.default.ensureDir(cd.default.dirname(this.cachePath)),await rn.default.writeJson(this.cachePath,i,{spaces:0})}serializeTriple(e){return{subject:hE(e.subject),predicate:hE(e.predicate),object:hE(e.object)}}deserializeTriple(e){return new Ir.Triple(pE(e.subject),pE(e.predicate),pE(e.object))}};function hE(n){if(n instanceof Ir.IRI)return{type:"IRI",value:n.value};if(n instanceof Ir.Literal){let e={type:"Literal",value:n.value};return n.datatype&&(e.datatype=n.datatype.value),n.language&&(e.language=n.language),e}return n instanceof Ir.BlankNode?{type:"BlankNode",value:n.value}:{type:"IRI",value:String(n)}}a(hE,"serializeNode");function pE(n){switch(n.type){case"IRI":return new Ir.IRI(n.value);case"Literal":return n.datatype?new Ir.Literal(n.value,new Ir.IRI(n.datatype)):n.language?new Ir.Literal(n.value,void 0,n.language):new Ir.Literal(n.value);case"BlankNode":return new Ir.BlankNode(n.value);default:return new Ir.IRI(n.value)}}a(pE,"deserializeNode");var PF=H(require("crypto")),ld=H(require("path")),OF=H(require("os")),zn=H(go());var ru=class{static{a(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??ld.default.join(OF.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return PF.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let r=this.getCacheKey(e),i=this.getCachePath(r);try{if(!await zn.default.pathExists(i))return null;let s=await zn.default.readJson(i),o=Date.now()-s.timestamp,c=t*1e3;return o>c?(await zn.default.remove(i),null):s.result}catch{return null}}async set(e,t,r){let i=this.getCacheKey(e),s=this.getCachePath(i);await zn.default.ensureDir(this.cacheDir);let o={timestamp:Date.now(),result:t};await zn.default.writeJson(s,o,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),r=this.getCachePath(t);try{await zn.default.remove(r)}catch{}}async clear(){try{if(await zn.default.pathExists(this.cacheDir)){let e=await zn.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>zn.default.remove(ld.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await zn.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await zn.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),r=0;for(let i of t){let s=await zn.default.stat(ld.default.join(this.cacheDir,i));r+=s.size}return{entryCount:t.length,totalSizeBytes:r}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return ld.default.join(this.cacheDir,`${e}.json`)}};var gd=H(require("node:process"),1);var FF=a((n=0)=>e=>`\x1B[${e+n}m`,"wrapAnsi16"),DF=a((n=0)=>e=>`\x1B[${38+n};5;${e}m`,"wrapAnsi256"),NF=a((n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,"wrapAnsi16m"),Lt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Xhe=Object.keys(Lt.modifier),MK=Object.keys(Lt.color),jK=Object.keys(Lt.bgColor),Jhe=[...MK,...jK];function $K(){let n=new Map;for(let[e,t]of Object.entries(Lt)){for(let[r,i]of Object.entries(t))Lt[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=Lt[r],n.set(i[0],i[1]);Object.defineProperty(Lt,e,{value:t,enumerable:!1})}return Object.defineProperty(Lt,"codes",{value:n,enumerable:!1}),Lt.color.close="\x1B[39m",Lt.bgColor.close="\x1B[49m",Lt.color.ansi=FF(),Lt.color.ansi256=DF(),Lt.color.ansi16m=NF(),Lt.bgColor.ansi=FF(10),Lt.bgColor.ansi256=DF(10),Lt.bgColor.ansi16m=NF(10),Object.defineProperties(Lt,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Lt.rgbToAnsi256(...Lt.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,i;if(e>=232)t=((e-232)*10+8)/255,r=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,r)=>Lt.ansi256ToAnsi(Lt.rgbToAnsi256(e,t,r)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Lt.ansi256ToAnsi(Lt.hexToAnsi256(e)),"value"),enumerable:!1}}),Lt}a($K,"assembleStyles");var BK=$K(),Hi=BK;var Kg=H(require("node:process"),1),kF=H(require("node:os"),1),mE=H(require("node:tty"),1);function ui(n,e=globalThis.Deno?globalThis.Deno.args:Kg.default.argv){let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}a(ui,"hasFlag");var{env:kt}=Kg.default,Qg;ui("no-color")||ui("no-colors")||ui("color=false")||ui("color=never")?Qg=0:(ui("color")||ui("colors")||ui("color=true")||ui("color=always"))&&(Qg=1);function UK(){if("FORCE_COLOR"in kt)return kt.FORCE_COLOR==="true"?1:kt.FORCE_COLOR==="false"?0:kt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(kt.FORCE_COLOR,10),3)}a(UK,"envForceColor");function VK(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}a(VK,"translateLevel");function qK(n,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=UK();r!==void 0&&(Qg=r);let i=t?Qg:r;if(i===0)return 0;if(t){if(ui("color=16m")||ui("color=full")||ui("color=truecolor"))return 3;if(ui("color=256"))return 2}if("TF_BUILD"in kt&&"AGENT_NAME"in kt)return 1;if(n&&!e&&i===void 0)return 0;let s=i||0;if(kt.TERM==="dumb")return s;if(Kg.default.platform==="win32"){let o=kF.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in kt)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in kt)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in kt)||kt.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if(kt.COLORTERM==="truecolor"||kt.TERM==="xterm-kitty"||kt.TERM==="xterm-ghostty"||kt.TERM==="wezterm")return 3;if("TERM_PROGRAM"in kt){let o=Number.parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:s}a(qK,"_supportsColor");function LF(n,e={}){let t=qK(n,{streamIsTTY:n&&n.isTTY,...e});return VK(t)}a(LF,"createSupportsColor");var WK={stdout:LF({isTTY:mE.default.isatty(1)}),stderr:LF({isTTY:mE.default.isatty(2)})},MF=WK;function jF(n,e,t){let r=n.indexOf(e);if(r===-1)return n;let i=e.length,s=0,o="";do o+=n.slice(s,r)+e+t,s=r+i,r=n.indexOf(e,s);while(r!==-1);return o+=n.slice(s),o}a(jF,"stringReplaceAll");function $F(n,e,t,r){let i=0,s="";do{let o=n[r-1]==="\r";s+=n.slice(i,o?r-1:r)+e+(o?`\r
529
+ Partial results: ${i} result(s) were collected before timeout.`:""}`}static{a(this,"QueryTimeoutError")}};var cd=H(require("path")),rn=H(go()),Ir=H(Pt());var Gn=class{constructor(e){this.cliVersion="1.0.0";this.vaultPath=cd.default.resolve(e),this.cachePath=cd.default.join(this.vaultPath,".exocortex","cache","triples.json")}static{a(this,"CacheManager")}getCachePath(){return this.cachePath}async isCacheValid(){try{if(!await rn.default.pathExists(this.cachePath))return!1;let e=await rn.default.readJson(this.cachePath);return!(!e.metadata||typeof e.metadata.vaultMtime!="number"||typeof e.metadata.tripleCount!="number"||(await rn.default.stat(this.vaultPath)).mtimeMs!==e.metadata.vaultMtime)}catch{return!1}}async loadOrBuild(){let e=Date.now();if(await this.isCacheValid())return{triples:await this.loadFromCache(),cacheHit:!0,durationMs:Date.now()-e};let{tripleCount:t}=await this.buildCache();return{triples:await this.loadFromCache(),cacheHit:!1,durationMs:Date.now()-e}}async loadFromCache(){return(await rn.default.readJson(this.cachePath)).triples.map(this.deserializeTriple)}async buildCache(){let e=await this.buildCacheWithValidation({strict:!1});return{tripleCount:e.tripleCount,durationMs:e.durationMs}}async buildCacheWithValidation(e={}){let t=Date.now(),r=new Nt(this.vaultPath),s=await new Ir.NoteToRDFConverter(r).convertVaultWithValidation({strict:e.strict??!1}),o=await rn.default.stat(this.vaultPath),c=s.triples.map(this.serializeTriple),l={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:s.triples.length,vaultMtime:o.mtimeMs},triples:c};return await rn.default.ensureDir(cd.default.dirname(this.cachePath)),await rn.default.writeJson(this.cachePath,l,{spaces:0}),{tripleCount:s.triples.length,durationMs:Date.now()-t,skippedFiles:s.skippedFiles,summary:s.summary}}async validateVault(){let e=new Nt(this.vaultPath);return new Ir.NoteToRDFConverter(e).validateVault()}async invalidate(){await rn.default.pathExists(this.cachePath)&&await rn.default.remove(this.cachePath)}async getCacheStats(){try{if(!await rn.default.pathExists(this.cachePath))return null;let e=await rn.default.readJson(this.cachePath),t=await rn.default.stat(this.cachePath),r=await this.isCacheValid();return{tripleCount:e.metadata.tripleCount,createdAt:new Date(e.metadata.timestamp),isValid:r,sizeBytes:t.size}}catch{return null}}async saveTriples(e){let t=await rn.default.stat(this.vaultPath),r=e.map(this.serializeTriple),i={metadata:{version:this.cliVersion,timestamp:Date.now(),vaultPath:this.vaultPath,tripleCount:e.length,vaultMtime:t.mtimeMs},triples:r};await rn.default.ensureDir(cd.default.dirname(this.cachePath)),await rn.default.writeJson(this.cachePath,i,{spaces:0})}serializeTriple(e){return{subject:hE(e.subject),predicate:hE(e.predicate),object:hE(e.object)}}deserializeTriple(e){return new Ir.Triple(pE(e.subject),pE(e.predicate),pE(e.object))}};function hE(n){if(n instanceof Ir.IRI)return{type:"IRI",value:n.value};if(n instanceof Ir.Literal){let e={type:"Literal",value:n.value};return n.datatype&&(e.datatype=n.datatype.value),n.language&&(e.language=n.language),e}return n instanceof Ir.BlankNode?{type:"BlankNode",value:n.value}:{type:"IRI",value:String(n)}}a(hE,"serializeNode");function pE(n){switch(n.type){case"IRI":return new Ir.IRI(n.value);case"Literal":return n.datatype?new Ir.Literal(n.value,new Ir.IRI(n.datatype)):n.language?new Ir.Literal(n.value,void 0,n.language):new Ir.Literal(n.value);case"BlankNode":return new Ir.BlankNode(n.value);default:return new Ir.IRI(n.value)}}a(pE,"deserializeNode");var PF=H(require("crypto")),ld=H(require("path")),OF=H(require("os")),zn=H(go());var ru=class{static{a(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??ld.default.join(OF.default.homedir(),".exocortex","cache","query-results")}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return PF.default.createHash("sha256").update(t).digest("hex")}async get(e,t){let r=this.getCacheKey(e),i=this.getCachePath(r);try{if(!await zn.default.pathExists(i))return null;let s=await zn.default.readJson(i),o=Date.now()-s.timestamp,c=t*1e3;return o>c?(await zn.default.remove(i),null):s.result}catch{return null}}async set(e,t,r){let i=this.getCacheKey(e),s=this.getCachePath(i);await zn.default.ensureDir(this.cacheDir);let o={timestamp:Date.now(),result:t};await zn.default.writeJson(s,o,{spaces:0})}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),r=this.getCachePath(t);try{await zn.default.remove(r)}catch{}}async clear(){try{if(await zn.default.pathExists(this.cacheDir)){let e=await zn.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>zn.default.remove(ld.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await zn.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await zn.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),r=0;for(let i of t){let s=await zn.default.stat(ld.default.join(this.cacheDir,i));r+=s.size}return{entryCount:t.length,totalSizeBytes:r}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return ld.default.join(this.cacheDir,`${e}.json`)}};var gd=H(require("node:process"),1);var FF=a((n=0)=>e=>`\x1B[${e+n}m`,"wrapAnsi16"),DF=a((n=0)=>e=>`\x1B[${38+n};5;${e}m`,"wrapAnsi256"),NF=a((n=0)=>(e,t,r)=>`\x1B[${38+n};2;${e};${t};${r}m`,"wrapAnsi16m"),Lt={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},Jhe=Object.keys(Lt.modifier),jK=Object.keys(Lt.color),$K=Object.keys(Lt.bgColor),Zhe=[...jK,...$K];function BK(){let n=new Map;for(let[e,t]of Object.entries(Lt)){for(let[r,i]of Object.entries(t))Lt[r]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[r]=Lt[r],n.set(i[0],i[1]);Object.defineProperty(Lt,e,{value:t,enumerable:!1})}return Object.defineProperty(Lt,"codes",{value:n,enumerable:!1}),Lt.color.close="\x1B[39m",Lt.bgColor.close="\x1B[49m",Lt.color.ansi=FF(),Lt.color.ansi256=DF(),Lt.color.ansi16m=NF(),Lt.bgColor.ansi=FF(10),Lt.bgColor.ansi256=DF(10),Lt.bgColor.ansi16m=NF(10),Object.defineProperties(Lt,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let i=Number.parseInt(r,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>Lt.rgbToAnsi256(...Lt.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,i;if(e>=232)t=((e-232)*10+8)/255,r=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,r=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,r,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,r)=>Lt.ansi256ToAnsi(Lt.rgbToAnsi256(e,t,r)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>Lt.ansi256ToAnsi(Lt.hexToAnsi256(e)),"value"),enumerable:!1}}),Lt}a(BK,"assembleStyles");var UK=BK(),Hi=UK;var Kg=H(require("node:process"),1),kF=H(require("node:os"),1),mE=H(require("node:tty"),1);function ui(n,e=globalThis.Deno?globalThis.Deno.args:Kg.default.argv){let t=n.startsWith("-")?"":n.length===1?"-":"--",r=e.indexOf(t+n),i=e.indexOf("--");return r!==-1&&(i===-1||r<i)}a(ui,"hasFlag");var{env:kt}=Kg.default,Qg;ui("no-color")||ui("no-colors")||ui("color=false")||ui("color=never")?Qg=0:(ui("color")||ui("colors")||ui("color=true")||ui("color=always"))&&(Qg=1);function VK(){if("FORCE_COLOR"in kt)return kt.FORCE_COLOR==="true"?1:kt.FORCE_COLOR==="false"?0:kt.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(kt.FORCE_COLOR,10),3)}a(VK,"envForceColor");function qK(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}a(qK,"translateLevel");function WK(n,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=VK();r!==void 0&&(Qg=r);let i=t?Qg:r;if(i===0)return 0;if(t){if(ui("color=16m")||ui("color=full")||ui("color=truecolor"))return 3;if(ui("color=256"))return 2}if("TF_BUILD"in kt&&"AGENT_NAME"in kt)return 1;if(n&&!e&&i===void 0)return 0;let s=i||0;if(kt.TERM==="dumb")return s;if(Kg.default.platform==="win32"){let o=kF.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in kt)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in kt)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in kt)||kt.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in kt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(kt.TEAMCITY_VERSION)?1:0;if(kt.COLORTERM==="truecolor"||kt.TERM==="xterm-kitty"||kt.TERM==="xterm-ghostty"||kt.TERM==="wezterm")return 3;if("TERM_PROGRAM"in kt){let o=Number.parseInt((kt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(kt.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(kt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(kt.TERM)||"COLORTERM"in kt?1:s}a(WK,"_supportsColor");function LF(n,e={}){let t=WK(n,{streamIsTTY:n&&n.isTTY,...e});return qK(t)}a(LF,"createSupportsColor");var GK={stdout:LF({isTTY:mE.default.isatty(1)}),stderr:LF({isTTY:mE.default.isatty(2)})},MF=GK;function jF(n,e,t){let r=n.indexOf(e);if(r===-1)return n;let i=e.length,s=0,o="";do o+=n.slice(s,r)+e+t,s=r+i,r=n.indexOf(e,s);while(r!==-1);return o+=n.slice(s),o}a(jF,"stringReplaceAll");function $F(n,e,t,r){let i=0,s="";do{let o=n[r-1]==="\r";s+=n.slice(i,o?r-1:r)+e+(o?`\r
530
530
  `:`
531
531
  `)+t,i=r+1,r=n.indexOf(`
532
- `,i)}while(r!==-1);return s+=n.slice(i),s}a($F,"stringEncaseCRLFWithFirstIndex");var{stdout:BF,stderr:UF}=MF,gE=Symbol("GENERATOR"),nu=Symbol("STYLER"),ud=Symbol("IS_EMPTY"),VF=["ansi","ansi","ansi256","ansi16m"],iu=Object.create(null),GK=a((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=BF?BF.level:0;n.level=e.level===void 0?t:e.level},"applyOptions");var zK=a(n=>{let e=a((...t)=>t.join(" "),"chalk");return GK(e,n),Object.setPrototypeOf(e,fd.prototype),e},"chalkFactory");function fd(n){return zK(n)}a(fd,"createChalk");Object.setPrototypeOf(fd.prototype,Function.prototype);for(let[n,e]of Object.entries(Hi))iu[n]={get(){let t=Yg(this,_E(e.open,e.close,this[nu]),this[ud]);return Object.defineProperty(this,n,{value:t}),t}};iu.visible={get(){let n=Yg(this,this[nu],!0);return Object.defineProperty(this,"visible",{value:n}),n}};var yE=a((n,e,t,...r)=>n==="rgb"?e==="ansi16m"?Hi[t].ansi16m(...r):e==="ansi256"?Hi[t].ansi256(Hi.rgbToAnsi256(...r)):Hi[t].ansi(Hi.rgbToAnsi(...r)):n==="hex"?yE("rgb",e,t,...Hi.hexToRgb(...r)):Hi[t][n](...r),"getModelAnsi"),HK=["rgb","hex","ansi256"];for(let n of HK){iu[n]={get(){let{level:t}=this;return function(...r){let i=_E(yE(n,VF[t],"color",...r),Hi.color.close,this[nu]);return Yg(this,i,this[ud])}}};let e="bg"+n[0].toUpperCase()+n.slice(1);iu[e]={get(){let{level:t}=this;return function(...r){let i=_E(yE(n,VF[t],"bgColor",...r),Hi.bgColor.close,this[nu]);return Yg(this,i,this[ud])}}}}var QK=Object.defineProperties(()=>{},{...iu,level:{enumerable:!0,get(){return this[gE].level},set(n){this[gE].level=n}}}),_E=a((n,e,t)=>{let r,i;return t===void 0?(r=n,i=e):(r=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:r,closeAll:i,parent:t}},"createStyler"),Yg=a((n,e,t)=>{let r=a((...i)=>KK(r,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(r,QK),r[gE]=n,r[nu]=e,r[ud]=t,r},"createBuilder"),KK=a((n,e)=>{if(n.level<=0||!e)return n[ud]?"":e;let t=n[nu];if(t===void 0)return e;let{openAll:r,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=jF(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
533
- `);return s!==-1&&(e=$F(e,i,r,s)),r+e+i},"applyStyle");Object.defineProperties(fd.prototype,iu);var YK=fd(),cpe=fd({level:UF?UF.level:0});var qF=YK;var xE=H(require("node:process"),1);var dd=H(require("node:process"),1);var XK=a((n,e,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(n,t),s=Object.getOwnPropertyDescriptor(e,t);!JK(i,s)&&r||Object.defineProperty(n,t,s)},"copyProperty"),JK=a(function(n,e){return n===void 0||n.configurable||n.writable===e.writable&&n.enumerable===e.enumerable&&n.configurable===e.configurable&&(n.writable||n.value===e.value)},"canCopyProperty"),ZK=a((n,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,t)},"changePrototype"),eY=a((n,e)=>`/* Wrapped ${n}*/
534
- ${e}`,"wrappedToString"),tY=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),rY=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),nY=a((n,e,t)=>{let r=t===""?"":`with ${t.trim()}() `,i=eY.bind(null,r,e.toString());Object.defineProperty(i,"name",rY);let{writable:s,enumerable:o,configurable:c}=tY;Object.defineProperty(n,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function SE(n,e,{ignoreNonConfigurable:t=!1}={}){let{name:r}=n;for(let i of Reflect.ownKeys(e))XK(n,e,i,t);return ZK(n,e),nY(n,e,r),n}a(SE,"mimicFunction");var Xg=new WeakMap,WF=a((n,e={})=>{if(typeof n!="function")throw new TypeError("Expected a function");let t,r=0,i=n.displayName||n.name||"<anonymous>",s=a(function(...o){if(Xg.set(s,++r),r===1)t=n.apply(this,o),n=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return SE(s,n),Xg.set(s,r),s},"onetime");WF.callCount=n=>{if(!Xg.has(n))throw new Error(`The given function \`${n.name}\` is not wrapped by the \`onetime\` package`);return Xg.get(n)};var GF=WF;var sc=[];sc.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&sc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&sc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Jg=a(n=>!!n&&typeof n=="object"&&typeof n.removeListener=="function"&&typeof n.emit=="function"&&typeof n.reallyExit=="function"&&typeof n.listeners=="function"&&typeof n.kill=="function"&&typeof n.pid=="number"&&typeof n.on=="function","processOk"),vE=Symbol.for("signal-exit emitter"),bE=globalThis,iY=Object.defineProperty.bind(Object),wE=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(bE[vE])return bE[vE];iY(bE,vE,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],i=r.indexOf(t);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,r)||i),i}},Zg=class{static{a(this,"SignalExitBase")}},sY=a(n=>({onExit(e,t){return n.onExit(e,t)},load(){return n.load()},unload(){return n.unload()}}),"signalExitWrap"),EE=class extends Zg{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},TE=class extends Zg{static{a(this,"SignalExit")}#e=AE.platform==="win32"?"SIGINT":"SIGHUP";#n=new wE;#r;#t;#c;#_={};#i=!1;constructor(e){super(),this.#r=e,this.#_={};for(let t of sc)this.#_[t]=()=>{let r=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();let o=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!Jg(this.#r))return()=>{};this.#i===!1&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#n.on(r,e),()=>{this.#n.removeListener(r,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of sc)try{let t=this.#_[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,sc.forEach(e=>{let t=this.#_[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return Jg(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let r=this.#t;if(e==="exit"&&Jg(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=r.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return r.call(this.#r,e,...t)}},AE=globalThis.process,{onExit:zF,load:_pe,unload:Spe}=sY(Jg(AE)?new TE(AE):new EE);var HF=dd.default.stderr.isTTY?dd.default.stderr:dd.default.stdout.isTTY?dd.default.stdout:void 0,oY=HF?GF(()=>{zF(()=>{HF.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},QF=oY;var ey=!1,su={};su.show=(n=xE.default.stderr)=>{n.isTTY&&(ey=!1,n.write("\x1B[?25h"))};su.hide=(n=xE.default.stderr)=>{n.isTTY&&(QF(),ey=!0,n.write("\x1B[?25l"))};su.toggle=(n,e)=>{n!==void 0&&(ey=n),ey?su.show(e):su.hide(e)};var CE=su;var RE={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var hd=RE,Ipe=Object.keys(RE);var oc={};i0(oc,{error:()=>dY,info:()=>lY,success:()=>uY,warning:()=>fY});var KF=H(require("node:tty"),1);var cY=KF.default?.WriteStream?.prototype?.hasColors?.()??!1,Le=a((n,e)=>{if(!cY)return i=>i;let t=`\x1B[${n}m`,r=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(r);if(o===-1)return t+s+r;let c=t,l=0,f=(e===22?r:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+r.length,o=s.indexOf(r,l);return c+=s.slice(l)+r,c}},"format"),Fpe=Le(0,0),Dpe=Le(1,22),Npe=Le(2,22),Lpe=Le(3,23),kpe=Le(4,24),Mpe=Le(53,55),jpe=Le(7,27),$pe=Le(8,28),Bpe=Le(9,29),Upe=Le(30,39),YF=Le(31,39),XF=Le(32,39),JF=Le(33,39),ZF=Le(34,39),Vpe=Le(35,39),qpe=Le(36,39),Wpe=Le(37,39),Gpe=Le(90,39),zpe=Le(40,49),Hpe=Le(41,49),Qpe=Le(42,49),Kpe=Le(43,49),Ype=Le(44,49),Xpe=Le(45,49),Jpe=Le(46,49),Zpe=Le(47,49),eme=Le(100,49),tme=Le(91,39),rme=Le(92,39),nme=Le(93,39),ime=Le(94,39),sme=Le(95,39),ome=Le(96,39),ame=Le(97,39),cme=Le(101,49),lme=Le(102,49),ume=Le(103,49),fme=Le(104,49),dme=Le(105,49),hme=Le(106,49),pme=Le(107,49);var IE=H(require("node:process"),1);function pd(){let{env:n}=IE.default,{TERM:e,TERM_PROGRAM:t}=n;return IE.default.platform!=="win32"?e!=="linux":!!n.WT_SESSION||!!n.TERMINUS_SUBLIME||n.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||n.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(pd,"isUnicodeSupported");var ty=pd(),lY=ZF(ty?"\u2139":"i"),uY=XF(ty?"\u2714":"\u221A"),fY=JF(ty?"\u26A0":"\u203C"),dY=YF(ty?"\u2716":"\xD7");function PE({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}a(PE,"ansiRegex");var hY=PE();function md(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return n.replace(hY,"")}a(md,"stripAnsi");function eD(n){return n===161||n===164||n===167||n===168||n===170||n===173||n===174||n>=176&&n<=180||n>=182&&n<=186||n>=188&&n<=191||n===198||n===208||n===215||n===216||n>=222&&n<=225||n===230||n>=232&&n<=234||n===236||n===237||n===240||n===242||n===243||n>=247&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||n===294||n===295||n===299||n>=305&&n<=307||n===312||n>=319&&n<=322||n===324||n>=328&&n<=331||n===333||n===338||n===339||n===358||n===359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||n>=713&&n<=715||n===717||n===720||n>=728&&n<=731||n===733||n===735||n>=768&&n<=879||n>=913&&n<=929||n>=931&&n<=937||n>=945&&n<=961||n>=963&&n<=969||n===1025||n>=1040&&n<=1103||n===1105||n===8208||n>=8211&&n<=8214||n===8216||n===8217||n===8220||n===8221||n>=8224&&n<=8226||n>=8228&&n<=8231||n===8240||n===8242||n===8243||n===8245||n===8251||n===8254||n===8308||n===8319||n>=8321&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||n===8481||n===8482||n===8486||n===8491||n===8531||n===8532||n>=8539&&n<=8542||n>=8544&&n<=8555||n>=8560&&n<=8569||n===8585||n>=8592&&n<=8601||n===8632||n===8633||n===8658||n===8660||n===8679||n===8704||n===8706||n===8707||n===8711||n===8712||n===8715||n===8719||n===8721||n===8725||n===8730||n>=8733&&n<=8736||n===8739||n===8741||n>=8743&&n<=8748||n===8750||n>=8756&&n<=8759||n===8764||n===8765||n===8776||n===8780||n===8786||n===8800||n===8801||n>=8804&&n<=8807||n===8810||n===8811||n===8814||n===8815||n===8834||n===8835||n===8838||n===8839||n===8853||n===8857||n===8869||n===8895||n===8978||n>=9312&&n<=9449||n>=9451&&n<=9547||n>=9552&&n<=9587||n>=9600&&n<=9615||n>=9618&&n<=9621||n===9632||n===9633||n>=9635&&n<=9641||n===9650||n===9651||n===9654||n===9655||n===9660||n===9661||n===9664||n===9665||n>=9670&&n<=9672||n===9675||n>=9678&&n<=9681||n>=9698&&n<=9701||n===9711||n===9733||n===9734||n===9737||n===9742||n===9743||n===9756||n===9758||n===9792||n===9794||n===9824||n===9825||n>=9827&&n<=9829||n>=9831&&n<=9834||n===9836||n===9837||n===9839||n===9886||n===9887||n===9919||n>=9926&&n<=9933||n>=9935&&n<=9939||n>=9941&&n<=9953||n===9955||n===9960||n===9961||n>=9963&&n<=9969||n===9972||n>=9974&&n<=9977||n===9979||n===9980||n===9982||n===9983||n===10045||n>=10102&&n<=10111||n>=11094&&n<=11097||n>=12872&&n<=12879||n>=57344&&n<=63743||n>=65024&&n<=65039||n===65533||n>=127232&&n<=127242||n>=127248&&n<=127277||n>=127280&&n<=127337||n>=127344&&n<=127373||n===127375||n===127376||n>=127387&&n<=127404||n>=917760&&n<=917999||n>=983040&&n<=1048573||n>=1048576&&n<=1114109}a(eD,"isAmbiguous");function tD(n){return n===12288||n>=65281&&n<=65376||n>=65504&&n<=65510}a(tD,"isFullWidth");function rD(n){return n>=4352&&n<=4447||n===8986||n===8987||n===9001||n===9002||n>=9193&&n<=9196||n===9200||n===9203||n===9725||n===9726||n===9748||n===9749||n>=9776&&n<=9783||n>=9800&&n<=9811||n===9855||n>=9866&&n<=9871||n===9875||n===9889||n===9898||n===9899||n===9917||n===9918||n===9924||n===9925||n===9934||n===9940||n===9962||n===9970||n===9971||n===9973||n===9978||n===9981||n===9989||n===9994||n===9995||n===10024||n===10060||n===10062||n>=10067&&n<=10069||n===10071||n>=10133&&n<=10135||n===10160||n===10175||n===11035||n===11036||n===11088||n===11093||n>=11904&&n<=11929||n>=11931&&n<=12019||n>=12032&&n<=12245||n>=12272&&n<=12287||n>=12289&&n<=12350||n>=12353&&n<=12438||n>=12441&&n<=12543||n>=12549&&n<=12591||n>=12593&&n<=12686||n>=12688&&n<=12773||n>=12783&&n<=12830||n>=12832&&n<=12871||n>=12880&&n<=42124||n>=42128&&n<=42182||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65106||n>=65108&&n<=65126||n>=65128&&n<=65131||n>=94176&&n<=94180||n>=94192&&n<=94198||n>=94208&&n<=101589||n>=101631&&n<=101662||n>=101760&&n<=101874||n>=110576&&n<=110579||n>=110581&&n<=110587||n===110589||n===110590||n>=110592&&n<=110882||n===110898||n>=110928&&n<=110930||n===110933||n>=110948&&n<=110951||n>=110960&&n<=111355||n>=119552&&n<=119638||n>=119648&&n<=119670||n===126980||n===127183||n===127374||n>=127377&&n<=127386||n>=127488&&n<=127490||n>=127504&&n<=127547||n>=127552&&n<=127560||n===127568||n===127569||n>=127584&&n<=127589||n>=127744&&n<=127776||n>=127789&&n<=127797||n>=127799&&n<=127868||n>=127870&&n<=127891||n>=127904&&n<=127946||n>=127951&&n<=127955||n>=127968&&n<=127984||n===127988||n>=127992&&n<=128062||n===128064||n>=128066&&n<=128252||n>=128255&&n<=128317||n>=128331&&n<=128334||n>=128336&&n<=128359||n===128378||n===128405||n===128406||n===128420||n>=128507&&n<=128591||n>=128640&&n<=128709||n===128716||n>=128720&&n<=128722||n>=128725&&n<=128728||n>=128732&&n<=128735||n===128747||n===128748||n>=128756&&n<=128764||n>=128992&&n<=129003||n===129008||n>=129292&&n<=129338||n>=129340&&n<=129349||n>=129351&&n<=129535||n>=129648&&n<=129660||n>=129664&&n<=129674||n>=129678&&n<=129734||n===129736||n>=129741&&n<=129756||n>=129759&&n<=129770||n>=129775&&n<=129784||n>=131072&&n<=196605||n>=196608&&n<=262141}a(rD,"isWide");function pY(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}a(pY,"validate");function OE(n,{ambiguousAsWide:e=!1}={}){return pY(n),tD(n)||rD(n)||e&&eD(n)?2:1}a(OE,"eastAsianWidth");var mY=new Intl.Segmenter,gY=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),yY=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),_Y=new RegExp("^\\p{RGI_Emoji}$","v");function SY(n){return n.replace(yY,"")}a(SY,"baseVisible");function vY(n){return gY.test(n)}a(vY,"isZeroWidthCluster");function bY(n,e){let t=0;if(n.length>1)for(let r of n.slice(1))r>="\uFF00"&&r<="\uFFEF"&&(t+=OE(r.codePointAt(0),e));return t}a(bY,"trailingHalfwidthWidth");function FE(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(r||(i=md(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of mY.segment(i)){if(vY(c))continue;if(_Y.test(c)){s+=2;continue}let l=SY(c).codePointAt(0);s+=OE(l,o),s+=bY(c,o)}return s}a(FE,"stringWidth");function DE({stream:n=process.stdout}={}){return!!(n&&n.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(DE,"isInteractive");var Qi=H(require("node:process"),1);var wY=3,NE=class{static{a(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){Qi.default.platform==="win32"||!Qi.default.stdin.isTTY||(Qi.default.stdin.setRawMode(!0),Qi.default.stdin.on("data",this.#t),Qi.default.stdin.resume())}#r(){Qi.default.stdin.isTTY&&(Qi.default.stdin.off("data",this.#t),Qi.default.stdin.pause(),Qi.default.stdin.setRawMode(!1))}#t(e){e[0]===wY&&Qi.default.emit("SIGINT")}},EY=new NE,LE=EY;var kE=class{static{a(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#_=0;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:gd.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#o=this.#i.interval,this.#s=this.#i.stream,this.#p=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:DE({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,gd.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#p,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#v()}get interval(){return this.#o??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#o=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!pd())this.#u=hd.line;else if(e===void 0)this.#u=hd.dots;else if(e!=="default"&&hd[e])this.#u=hd[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#v()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#v()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#v()}get isSpinning(){return this.#l!==void 0}#E(e,t,r=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?r?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#E(e,t,!1)}#S(e=this.#f,t=" "){return this.#E(e,t,!0)}#w(e,t){let r=0;for(let i of md(e).split(`
532
+ `,i)}while(r!==-1);return s+=n.slice(i),s}a($F,"stringEncaseCRLFWithFirstIndex");var{stdout:BF,stderr:UF}=MF,gE=Symbol("GENERATOR"),nu=Symbol("STYLER"),ud=Symbol("IS_EMPTY"),VF=["ansi","ansi","ansi256","ansi16m"],iu=Object.create(null),zK=a((n,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=BF?BF.level:0;n.level=e.level===void 0?t:e.level},"applyOptions");var HK=a(n=>{let e=a((...t)=>t.join(" "),"chalk");return zK(e,n),Object.setPrototypeOf(e,fd.prototype),e},"chalkFactory");function fd(n){return HK(n)}a(fd,"createChalk");Object.setPrototypeOf(fd.prototype,Function.prototype);for(let[n,e]of Object.entries(Hi))iu[n]={get(){let t=Yg(this,_E(e.open,e.close,this[nu]),this[ud]);return Object.defineProperty(this,n,{value:t}),t}};iu.visible={get(){let n=Yg(this,this[nu],!0);return Object.defineProperty(this,"visible",{value:n}),n}};var yE=a((n,e,t,...r)=>n==="rgb"?e==="ansi16m"?Hi[t].ansi16m(...r):e==="ansi256"?Hi[t].ansi256(Hi.rgbToAnsi256(...r)):Hi[t].ansi(Hi.rgbToAnsi(...r)):n==="hex"?yE("rgb",e,t,...Hi.hexToRgb(...r)):Hi[t][n](...r),"getModelAnsi"),QK=["rgb","hex","ansi256"];for(let n of QK){iu[n]={get(){let{level:t}=this;return function(...r){let i=_E(yE(n,VF[t],"color",...r),Hi.color.close,this[nu]);return Yg(this,i,this[ud])}}};let e="bg"+n[0].toUpperCase()+n.slice(1);iu[e]={get(){let{level:t}=this;return function(...r){let i=_E(yE(n,VF[t],"bgColor",...r),Hi.bgColor.close,this[nu]);return Yg(this,i,this[ud])}}}}var KK=Object.defineProperties(()=>{},{...iu,level:{enumerable:!0,get(){return this[gE].level},set(n){this[gE].level=n}}}),_E=a((n,e,t)=>{let r,i;return t===void 0?(r=n,i=e):(r=t.openAll+n,i=e+t.closeAll),{open:n,close:e,openAll:r,closeAll:i,parent:t}},"createStyler"),Yg=a((n,e,t)=>{let r=a((...i)=>YK(r,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(r,KK),r[gE]=n,r[nu]=e,r[ud]=t,r},"createBuilder"),YK=a((n,e)=>{if(n.level<=0||!e)return n[ud]?"":e;let t=n[nu];if(t===void 0)return e;let{openAll:r,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=jF(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
533
+ `);return s!==-1&&(e=$F(e,i,r,s)),r+e+i},"applyStyle");Object.defineProperties(fd.prototype,iu);var XK=fd(),lpe=fd({level:UF?UF.level:0});var qF=XK;var xE=H(require("node:process"),1);var dd=H(require("node:process"),1);var JK=a((n,e,t,r)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(n,t),s=Object.getOwnPropertyDescriptor(e,t);!ZK(i,s)&&r||Object.defineProperty(n,t,s)},"copyProperty"),ZK=a(function(n,e){return n===void 0||n.configurable||n.writable===e.writable&&n.enumerable===e.enumerable&&n.configurable===e.configurable&&(n.writable||n.value===e.value)},"canCopyProperty"),eY=a((n,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(n)&&Object.setPrototypeOf(n,t)},"changePrototype"),tY=a((n,e)=>`/* Wrapped ${n}*/
534
+ ${e}`,"wrappedToString"),rY=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),nY=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),iY=a((n,e,t)=>{let r=t===""?"":`with ${t.trim()}() `,i=tY.bind(null,r,e.toString());Object.defineProperty(i,"name",nY);let{writable:s,enumerable:o,configurable:c}=rY;Object.defineProperty(n,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function SE(n,e,{ignoreNonConfigurable:t=!1}={}){let{name:r}=n;for(let i of Reflect.ownKeys(e))JK(n,e,i,t);return eY(n,e),iY(n,e,r),n}a(SE,"mimicFunction");var Xg=new WeakMap,WF=a((n,e={})=>{if(typeof n!="function")throw new TypeError("Expected a function");let t,r=0,i=n.displayName||n.name||"<anonymous>",s=a(function(...o){if(Xg.set(s,++r),r===1)t=n.apply(this,o),n=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return SE(s,n),Xg.set(s,r),s},"onetime");WF.callCount=n=>{if(!Xg.has(n))throw new Error(`The given function \`${n.name}\` is not wrapped by the \`onetime\` package`);return Xg.get(n)};var GF=WF;var sc=[];sc.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&sc.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&sc.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Jg=a(n=>!!n&&typeof n=="object"&&typeof n.removeListener=="function"&&typeof n.emit=="function"&&typeof n.reallyExit=="function"&&typeof n.listeners=="function"&&typeof n.kill=="function"&&typeof n.pid=="number"&&typeof n.on=="function","processOk"),vE=Symbol.for("signal-exit emitter"),bE=globalThis,sY=Object.defineProperty.bind(Object),wE=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(bE[vE])return bE[vE];sY(bE,vE,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let r=this.listeners[e],i=r.indexOf(t);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,t,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,r)||i),i}},Zg=class{static{a(this,"SignalExitBase")}},oY=a(n=>({onExit(e,t){return n.onExit(e,t)},load(){return n.load()},unload(){return n.unload()}}),"signalExitWrap"),EE=class extends Zg{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},TE=class extends Zg{static{a(this,"SignalExit")}#e=AE.platform==="win32"?"SIGINT":"SIGHUP";#n=new wE;#r;#t;#c;#_={};#i=!1;constructor(e){super(),this.#r=e,this.#_={};for(let t of sc)this.#_[t]=()=>{let r=this.#r.listeners(t),{count:i}=this.#n,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();let o=this.#n.emit("exit",null,t),c=t==="SIGHUP"?this.#e:t;o||e.kill(e.pid,c)}};this.#c=e.reallyExit,this.#t=e.emit}onExit(e,t){if(!Jg(this.#r))return()=>{};this.#i===!1&&this.load();let r=t?.alwaysLast?"afterExit":"exit";return this.#n.on(r,e),()=>{this.#n.removeListener(r,e),this.#n.listeners.exit.length===0&&this.#n.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#i){this.#i=!0,this.#n.count+=1;for(let e of sc)try{let t=this.#_[e];t&&this.#r.on(e,t)}catch{}this.#r.emit=(e,...t)=>this.#s(e,...t),this.#r.reallyExit=e=>this.#u(e)}}unload(){this.#i&&(this.#i=!1,sc.forEach(e=>{let t=this.#_[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#r.removeListener(e,t)}catch{}}),this.#r.emit=this.#t,this.#r.reallyExit=this.#c,this.#n.count-=1)}#u(e){return Jg(this.#r)?(this.#r.exitCode=e||0,this.#n.emit("exit",this.#r.exitCode,null),this.#c.call(this.#r,this.#r.exitCode)):0}#s(e,...t){let r=this.#t;if(e==="exit"&&Jg(this.#r)){typeof t[0]=="number"&&(this.#r.exitCode=t[0]);let i=r.call(this.#r,e,...t);return this.#n.emit("exit",this.#r.exitCode,null),i}else return r.call(this.#r,e,...t)}},AE=globalThis.process,{onExit:zF,load:Spe,unload:vpe}=oY(Jg(AE)?new TE(AE):new EE);var HF=dd.default.stderr.isTTY?dd.default.stderr:dd.default.stdout.isTTY?dd.default.stdout:void 0,aY=HF?GF(()=>{zF(()=>{HF.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},QF=aY;var ey=!1,su={};su.show=(n=xE.default.stderr)=>{n.isTTY&&(ey=!1,n.write("\x1B[?25h"))};su.hide=(n=xE.default.stderr)=>{n.isTTY&&(QF(),ey=!0,n.write("\x1B[?25l"))};su.toggle=(n,e)=>{n!==void 0&&(ey=n),ey?su.show(e):su.hide(e)};var CE=su;var RE={dots:{interval:80,frames:["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"]},dots2:{interval:80,frames:["\u28FE","\u28FD","\u28FB","\u28BF","\u287F","\u28DF","\u28EF","\u28F7"]},dots3:{interval:80,frames:["\u280B","\u2819","\u281A","\u281E","\u2816","\u2826","\u2834","\u2832","\u2833","\u2813"]},dots4:{interval:80,frames:["\u2804","\u2806","\u2807","\u280B","\u2819","\u2838","\u2830","\u2820","\u2830","\u2838","\u2819","\u280B","\u2807","\u2806"]},dots5:{interval:80,frames:["\u280B","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B"]},dots6:{interval:80,frames:["\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2834","\u2832","\u2812","\u2802","\u2802","\u2812","\u281A","\u2819","\u2809","\u2801"]},dots7:{interval:80,frames:["\u2808","\u2809","\u280B","\u2813","\u2812","\u2810","\u2810","\u2812","\u2816","\u2826","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808"]},dots8:{interval:80,frames:["\u2801","\u2801","\u2809","\u2819","\u281A","\u2812","\u2802","\u2802","\u2812","\u2832","\u2834","\u2824","\u2804","\u2804","\u2824","\u2820","\u2820","\u2824","\u2826","\u2816","\u2812","\u2810","\u2810","\u2812","\u2813","\u280B","\u2809","\u2808","\u2808"]},dots9:{interval:80,frames:["\u28B9","\u28BA","\u28BC","\u28F8","\u28C7","\u2867","\u2857","\u284F"]},dots10:{interval:80,frames:["\u2884","\u2882","\u2881","\u2841","\u2848","\u2850","\u2860"]},dots11:{interval:100,frames:["\u2801","\u2802","\u2804","\u2840","\u2880","\u2820","\u2810","\u2808"]},dots12:{interval:80,frames:["\u2880\u2800","\u2840\u2800","\u2804\u2800","\u2882\u2800","\u2842\u2800","\u2805\u2800","\u2883\u2800","\u2843\u2800","\u280D\u2800","\u288B\u2800","\u284B\u2800","\u280D\u2801","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2888\u2829","\u2840\u2899","\u2804\u2859","\u2882\u2829","\u2842\u2898","\u2805\u2858","\u2883\u2828","\u2843\u2890","\u280D\u2850","\u288B\u2820","\u284B\u2880","\u280D\u2841","\u288B\u2801","\u284B\u2801","\u280D\u2809","\u280B\u2809","\u280B\u2809","\u2809\u2819","\u2809\u2819","\u2809\u2829","\u2808\u2899","\u2808\u2859","\u2808\u2829","\u2800\u2899","\u2800\u2859","\u2800\u2829","\u2800\u2898","\u2800\u2858","\u2800\u2828","\u2800\u2890","\u2800\u2850","\u2800\u2820","\u2800\u2880","\u2800\u2840"]},dots13:{interval:80,frames:["\u28FC","\u28F9","\u28BB","\u283F","\u285F","\u28CF","\u28E7","\u28F6"]},dots14:{interval:80,frames:["\u2809\u2809","\u2808\u2819","\u2800\u2839","\u2800\u28B8","\u2800\u28F0","\u2880\u28E0","\u28C0\u28C0","\u28C4\u2840","\u28C6\u2800","\u2847\u2800","\u280F\u2800","\u280B\u2801"]},dots8Bit:{interval:80,frames:["\u2800","\u2801","\u2802","\u2803","\u2804","\u2805","\u2806","\u2807","\u2840","\u2841","\u2842","\u2843","\u2844","\u2845","\u2846","\u2847","\u2808","\u2809","\u280A","\u280B","\u280C","\u280D","\u280E","\u280F","\u2848","\u2849","\u284A","\u284B","\u284C","\u284D","\u284E","\u284F","\u2810","\u2811","\u2812","\u2813","\u2814","\u2815","\u2816","\u2817","\u2850","\u2851","\u2852","\u2853","\u2854","\u2855","\u2856","\u2857","\u2818","\u2819","\u281A","\u281B","\u281C","\u281D","\u281E","\u281F","\u2858","\u2859","\u285A","\u285B","\u285C","\u285D","\u285E","\u285F","\u2820","\u2821","\u2822","\u2823","\u2824","\u2825","\u2826","\u2827","\u2860","\u2861","\u2862","\u2863","\u2864","\u2865","\u2866","\u2867","\u2828","\u2829","\u282A","\u282B","\u282C","\u282D","\u282E","\u282F","\u2868","\u2869","\u286A","\u286B","\u286C","\u286D","\u286E","\u286F","\u2830","\u2831","\u2832","\u2833","\u2834","\u2835","\u2836","\u2837","\u2870","\u2871","\u2872","\u2873","\u2874","\u2875","\u2876","\u2877","\u2838","\u2839","\u283A","\u283B","\u283C","\u283D","\u283E","\u283F","\u2878","\u2879","\u287A","\u287B","\u287C","\u287D","\u287E","\u287F","\u2880","\u2881","\u2882","\u2883","\u2884","\u2885","\u2886","\u2887","\u28C0","\u28C1","\u28C2","\u28C3","\u28C4","\u28C5","\u28C6","\u28C7","\u2888","\u2889","\u288A","\u288B","\u288C","\u288D","\u288E","\u288F","\u28C8","\u28C9","\u28CA","\u28CB","\u28CC","\u28CD","\u28CE","\u28CF","\u2890","\u2891","\u2892","\u2893","\u2894","\u2895","\u2896","\u2897","\u28D0","\u28D1","\u28D2","\u28D3","\u28D4","\u28D5","\u28D6","\u28D7","\u2898","\u2899","\u289A","\u289B","\u289C","\u289D","\u289E","\u289F","\u28D8","\u28D9","\u28DA","\u28DB","\u28DC","\u28DD","\u28DE","\u28DF","\u28A0","\u28A1","\u28A2","\u28A3","\u28A4","\u28A5","\u28A6","\u28A7","\u28E0","\u28E1","\u28E2","\u28E3","\u28E4","\u28E5","\u28E6","\u28E7","\u28A8","\u28A9","\u28AA","\u28AB","\u28AC","\u28AD","\u28AE","\u28AF","\u28E8","\u28E9","\u28EA","\u28EB","\u28EC","\u28ED","\u28EE","\u28EF","\u28B0","\u28B1","\u28B2","\u28B3","\u28B4","\u28B5","\u28B6","\u28B7","\u28F0","\u28F1","\u28F2","\u28F3","\u28F4","\u28F5","\u28F6","\u28F7","\u28B8","\u28B9","\u28BA","\u28BB","\u28BC","\u28BD","\u28BE","\u28BF","\u28F8","\u28F9","\u28FA","\u28FB","\u28FC","\u28FD","\u28FE","\u28FF"]},dotsCircle:{interval:80,frames:["\u288E ","\u280E\u2801","\u280A\u2811","\u2808\u2831"," \u2871","\u2880\u2870","\u2884\u2860","\u2886\u2840"]},sand:{interval:80,frames:["\u2801","\u2802","\u2804","\u2840","\u2848","\u2850","\u2860","\u28C0","\u28C1","\u28C2","\u28C4","\u28CC","\u28D4","\u28E4","\u28E5","\u28E6","\u28EE","\u28F6","\u28F7","\u28FF","\u287F","\u283F","\u289F","\u281F","\u285B","\u281B","\u282B","\u288B","\u280B","\u280D","\u2849","\u2809","\u2811","\u2821","\u2881"]},line:{interval:130,frames:["-","\\","|","/"]},line2:{interval:100,frames:["\u2802","-","\u2013","\u2014","\u2013","-"]},rollingLine:{interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},pipe:{interval:100,frames:["\u2524","\u2518","\u2534","\u2514","\u251C","\u250C","\u252C","\u2510"]},simpleDots:{interval:400,frames:[". ",".. ","..."," "]},simpleDotsScrolling:{interval:200,frames:[". ",".. ","..."," .."," ."," "]},star:{interval:70,frames:["\u2736","\u2738","\u2739","\u273A","\u2739","\u2737"]},star2:{interval:80,frames:["+","x","*"]},flip:{interval:70,frames:["_","_","_","-","`","`","'","\xB4","-","_","_","_"]},hamburger:{interval:100,frames:["\u2631","\u2632","\u2634"]},growVertical:{interval:120,frames:["\u2581","\u2583","\u2584","\u2585","\u2586","\u2587","\u2586","\u2585","\u2584","\u2583"]},growHorizontal:{interval:120,frames:["\u258F","\u258E","\u258D","\u258C","\u258B","\u258A","\u2589","\u258A","\u258B","\u258C","\u258D","\u258E"]},balloon:{interval:140,frames:[" ",".","o","O","@","*"," "]},balloon2:{interval:120,frames:[".","o","O","\xB0","O","o","."]},noise:{interval:100,frames:["\u2593","\u2592","\u2591"]},bounce:{interval:120,frames:["\u2801","\u2802","\u2804","\u2802"]},boxBounce:{interval:120,frames:["\u2596","\u2598","\u259D","\u2597"]},boxBounce2:{interval:100,frames:["\u258C","\u2580","\u2590","\u2584"]},triangle:{interval:50,frames:["\u25E2","\u25E3","\u25E4","\u25E5"]},binary:{interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},arc:{interval:100,frames:["\u25DC","\u25E0","\u25DD","\u25DE","\u25E1","\u25DF"]},circle:{interval:120,frames:["\u25E1","\u2299","\u25E0"]},squareCorners:{interval:180,frames:["\u25F0","\u25F3","\u25F2","\u25F1"]},circleQuarters:{interval:120,frames:["\u25F4","\u25F7","\u25F6","\u25F5"]},circleHalves:{interval:50,frames:["\u25D0","\u25D3","\u25D1","\u25D2"]},squish:{interval:100,frames:["\u256B","\u256A"]},toggle:{interval:250,frames:["\u22B6","\u22B7"]},toggle2:{interval:80,frames:["\u25AB","\u25AA"]},toggle3:{interval:120,frames:["\u25A1","\u25A0"]},toggle4:{interval:100,frames:["\u25A0","\u25A1","\u25AA","\u25AB"]},toggle5:{interval:100,frames:["\u25AE","\u25AF"]},toggle6:{interval:300,frames:["\u101D","\u1040"]},toggle7:{interval:80,frames:["\u29BE","\u29BF"]},toggle8:{interval:100,frames:["\u25CD","\u25CC"]},toggle9:{interval:100,frames:["\u25C9","\u25CE"]},toggle10:{interval:100,frames:["\u3282","\u3280","\u3281"]},toggle11:{interval:50,frames:["\u29C7","\u29C6"]},toggle12:{interval:120,frames:["\u2617","\u2616"]},toggle13:{interval:80,frames:["=","*","-"]},arrow:{interval:100,frames:["\u2190","\u2196","\u2191","\u2197","\u2192","\u2198","\u2193","\u2199"]},arrow2:{interval:80,frames:["\u2B06\uFE0F ","\u2197\uFE0F ","\u27A1\uFE0F ","\u2198\uFE0F ","\u2B07\uFE0F ","\u2199\uFE0F ","\u2B05\uFE0F ","\u2196\uFE0F "]},arrow3:{interval:120,frames:["\u25B9\u25B9\u25B9\u25B9\u25B9","\u25B8\u25B9\u25B9\u25B9\u25B9","\u25B9\u25B8\u25B9\u25B9\u25B9","\u25B9\u25B9\u25B8\u25B9\u25B9","\u25B9\u25B9\u25B9\u25B8\u25B9","\u25B9\u25B9\u25B9\u25B9\u25B8"]},bouncingBar:{interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},bouncingBall:{interval:80,frames:["( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF)","( \u25CF )","( \u25CF )","( \u25CF )","( \u25CF )","(\u25CF )"]},smiley:{interval:200,frames:["\u{1F604} ","\u{1F61D} "]},monkey:{interval:300,frames:["\u{1F648} ","\u{1F648} ","\u{1F649} ","\u{1F64A} "]},hearts:{interval:100,frames:["\u{1F49B} ","\u{1F499} ","\u{1F49C} ","\u{1F49A} ","\u{1F497} "]},clock:{interval:100,frames:["\u{1F55B} ","\u{1F550} ","\u{1F551} ","\u{1F552} ","\u{1F553} ","\u{1F554} ","\u{1F555} ","\u{1F556} ","\u{1F557} ","\u{1F558} ","\u{1F559} ","\u{1F55A} "]},earth:{interval:180,frames:["\u{1F30D} ","\u{1F30E} ","\u{1F30F} "]},material:{interval:17,frames:["\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2588","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581","\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581\u2581"]},moon:{interval:80,frames:["\u{1F311} ","\u{1F312} ","\u{1F313} ","\u{1F314} ","\u{1F315} ","\u{1F316} ","\u{1F317} ","\u{1F318} "]},runner:{interval:140,frames:["\u{1F6B6} ","\u{1F3C3} "]},pong:{interval:80,frames:["\u2590\u2802 \u258C","\u2590\u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802\u258C","\u2590 \u2820\u258C","\u2590 \u2840\u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590 \u2820 \u258C","\u2590 \u2802 \u258C","\u2590 \u2808 \u258C","\u2590 \u2802 \u258C","\u2590 \u2820 \u258C","\u2590 \u2840 \u258C","\u2590\u2820 \u258C"]},shark:{interval:120,frames:["\u2590|\\____________\u258C","\u2590_|\\___________\u258C","\u2590__|\\__________\u258C","\u2590___|\\_________\u258C","\u2590____|\\________\u258C","\u2590_____|\\_______\u258C","\u2590______|\\______\u258C","\u2590_______|\\_____\u258C","\u2590________|\\____\u258C","\u2590_________|\\___\u258C","\u2590__________|\\__\u258C","\u2590___________|\\_\u258C","\u2590____________|\\\u258C","\u2590____________/|\u258C","\u2590___________/|_\u258C","\u2590__________/|__\u258C","\u2590_________/|___\u258C","\u2590________/|____\u258C","\u2590_______/|_____\u258C","\u2590______/|______\u258C","\u2590_____/|_______\u258C","\u2590____/|________\u258C","\u2590___/|_________\u258C","\u2590__/|__________\u258C","\u2590_/|___________\u258C","\u2590/|____________\u258C"]},dqpb:{interval:100,frames:["d","q","p","b"]},weather:{interval:100,frames:["\u2600\uFE0F ","\u2600\uFE0F ","\u2600\uFE0F ","\u{1F324} ","\u26C5\uFE0F ","\u{1F325} ","\u2601\uFE0F ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u26C8 ","\u{1F328} ","\u{1F327} ","\u{1F328} ","\u2601\uFE0F ","\u{1F325} ","\u26C5\uFE0F ","\u{1F324} ","\u2600\uFE0F ","\u2600\uFE0F "]},christmas:{interval:400,frames:["\u{1F332}","\u{1F384}"]},grenade:{interval:80,frames:["\u060C ","\u2032 "," \xB4 "," \u203E "," \u2E0C"," \u2E0A"," |"," \u204E"," \u2055"," \u0DF4 "," \u2053"," "," "," "]},point:{interval:125,frames:["\u2219\u2219\u2219","\u25CF\u2219\u2219","\u2219\u25CF\u2219","\u2219\u2219\u25CF","\u2219\u2219\u2219"]},layer:{interval:150,frames:["-","=","\u2261"]},betaWave:{interval:80,frames:["\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1\u03B2","\u03B2\u03B2\u03B2\u03B2\u03B2\u03B2\u03C1"]},fingerDance:{interval:160,frames:["\u{1F918} ","\u{1F91F} ","\u{1F596} ","\u270B ","\u{1F91A} ","\u{1F446} "]},fistBump:{interval:80,frames:["\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u{1F91C}\u3000\u3000\u3000\u3000\u{1F91B} ","\u3000\u{1F91C}\u3000\u3000\u{1F91B}\u3000 ","\u3000\u3000\u{1F91C}\u{1F91B}\u3000\u3000 ","\u3000\u{1F91C}\u2728\u{1F91B}\u3000\u3000 ","\u{1F91C}\u3000\u2728\u3000\u{1F91B}\u3000 "]},soccerHeader:{interval:80,frames:[" \u{1F9D1}\u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F\u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} ","\u{1F9D1} \u26BD\uFE0F \u{1F9D1} "]},mindblown:{interval:160,frames:["\u{1F610} ","\u{1F610} ","\u{1F62E} ","\u{1F62E} ","\u{1F626} ","\u{1F626} ","\u{1F627} ","\u{1F627} ","\u{1F92F} ","\u{1F4A5} ","\u2728 ","\u3000 ","\u3000 ","\u3000 "]},speaker:{interval:160,frames:["\u{1F508} ","\u{1F509} ","\u{1F50A} ","\u{1F509} "]},orangePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} "]},bluePulse:{interval:100,frames:["\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},orangeBluePulse:{interval:100,frames:["\u{1F538} ","\u{1F536} ","\u{1F7E0} ","\u{1F7E0} ","\u{1F536} ","\u{1F539} ","\u{1F537} ","\u{1F535} ","\u{1F535} ","\u{1F537} "]},timeTravel:{interval:100,frames:["\u{1F55B} ","\u{1F55A} ","\u{1F559} ","\u{1F558} ","\u{1F557} ","\u{1F556} ","\u{1F555} ","\u{1F554} ","\u{1F553} ","\u{1F552} ","\u{1F551} ","\u{1F550} "]},aesthetic:{interval:80,frames:["\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B1","\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0\u25B0","\u25B0\u25B1\u25B1\u25B1\u25B1\u25B1\u25B1"]},dwarfFortress:{interval:80,frames:[" \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A\u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 ","\u263A \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\u2588\xA3\xA3\xA3 "," \u263A \u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2588\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2593\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2592\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A\u2591\u2588\xA3\xA3\xA3 "," \u263A \u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2588\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2592\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A\u2591\xA3\xA3\xA3 "," \u263A \xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\xA3\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2593\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2592\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A\u2591\xA3\xA3 "," \u263A \xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\xA3\xA3 "," \u263A\u2593\xA3 "," \u263A\u2593\xA3 "," \u263A\u2592\xA3 "," \u263A\u2592\xA3 "," \u263A\u2591\xA3 "," \u263A\u2591\xA3 "," \u263A \xA3 "," \u263A\xA3 "," \u263A\xA3 "," \u263A\u2593 "," \u263A\u2593 "," \u263A\u2592 "," \u263A\u2592 "," \u263A\u2591 "," \u263A\u2591 "," \u263A "," \u263A &"," \u263A \u263C&"," \u263A \u263C &"," \u263A\u263C &"," \u263A\u263C & "," \u203C & "," \u263A & "," \u203C & "," \u263A & "," \u203C & "," \u263A & ","\u203C & "," & "," & "," & \u2591 "," & \u2592 "," & \u2593 "," & \xA3 "," & \u2591\xA3 "," & \u2592\xA3 "," & \u2593\xA3 "," & \xA3\xA3 "," & \u2591\xA3\xA3 "," & \u2592\xA3\xA3 ","& \u2593\xA3\xA3 ","& \xA3\xA3\xA3 "," \u2591\xA3\xA3\xA3 "," \u2592\xA3\xA3\xA3 "," \u2593\xA3\xA3\xA3 "," \u2588\xA3\xA3\xA3 "," \u2591\u2588\xA3\xA3\xA3 "," \u2592\u2588\xA3\xA3\xA3 "," \u2593\u2588\xA3\xA3\xA3 "," \u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2591\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2592\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2593\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "," \u2588\u2588\u2588\u2588\u2588\u2588\xA3\xA3\xA3 "]}};var hd=RE,Ppe=Object.keys(RE);var oc={};i0(oc,{error:()=>hY,info:()=>uY,success:()=>fY,warning:()=>dY});var KF=H(require("node:tty"),1);var lY=KF.default?.WriteStream?.prototype?.hasColors?.()??!1,Le=a((n,e)=>{if(!lY)return i=>i;let t=`\x1B[${n}m`,r=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(r);if(o===-1)return t+s+r;let c=t,l=0,f=(e===22?r:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+r.length,o=s.indexOf(r,l);return c+=s.slice(l)+r,c}},"format"),Dpe=Le(0,0),Npe=Le(1,22),Lpe=Le(2,22),kpe=Le(3,23),Mpe=Le(4,24),jpe=Le(53,55),$pe=Le(7,27),Bpe=Le(8,28),Upe=Le(9,29),Vpe=Le(30,39),YF=Le(31,39),XF=Le(32,39),JF=Le(33,39),ZF=Le(34,39),qpe=Le(35,39),Wpe=Le(36,39),Gpe=Le(37,39),zpe=Le(90,39),Hpe=Le(40,49),Qpe=Le(41,49),Kpe=Le(42,49),Ype=Le(43,49),Xpe=Le(44,49),Jpe=Le(45,49),Zpe=Le(46,49),eme=Le(47,49),tme=Le(100,49),rme=Le(91,39),nme=Le(92,39),ime=Le(93,39),sme=Le(94,39),ome=Le(95,39),ame=Le(96,39),cme=Le(97,39),lme=Le(101,49),ume=Le(102,49),fme=Le(103,49),dme=Le(104,49),hme=Le(105,49),pme=Le(106,49),mme=Le(107,49);var IE=H(require("node:process"),1);function pd(){let{env:n}=IE.default,{TERM:e,TERM_PROGRAM:t}=n;return IE.default.platform!=="win32"?e!=="linux":!!n.WT_SESSION||!!n.TERMINUS_SUBLIME||n.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||n.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(pd,"isUnicodeSupported");var ty=pd(),uY=ZF(ty?"\u2139":"i"),fY=XF(ty?"\u2714":"\u221A"),dY=JF(ty?"\u26A0":"\u203C"),hY=YF(ty?"\u2716":"\xD7");function PE({onlyFirst:n=!1}={}){let i="(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";return new RegExp(i,n?void 0:"g")}a(PE,"ansiRegex");var pY=PE();function md(n){if(typeof n!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof n}\``);return n.replace(pY,"")}a(md,"stripAnsi");function eD(n){return n===161||n===164||n===167||n===168||n===170||n===173||n===174||n>=176&&n<=180||n>=182&&n<=186||n>=188&&n<=191||n===198||n===208||n===215||n===216||n>=222&&n<=225||n===230||n>=232&&n<=234||n===236||n===237||n===240||n===242||n===243||n>=247&&n<=250||n===252||n===254||n===257||n===273||n===275||n===283||n===294||n===295||n===299||n>=305&&n<=307||n===312||n>=319&&n<=322||n===324||n>=328&&n<=331||n===333||n===338||n===339||n===358||n===359||n===363||n===462||n===464||n===466||n===468||n===470||n===472||n===474||n===476||n===593||n===609||n===708||n===711||n>=713&&n<=715||n===717||n===720||n>=728&&n<=731||n===733||n===735||n>=768&&n<=879||n>=913&&n<=929||n>=931&&n<=937||n>=945&&n<=961||n>=963&&n<=969||n===1025||n>=1040&&n<=1103||n===1105||n===8208||n>=8211&&n<=8214||n===8216||n===8217||n===8220||n===8221||n>=8224&&n<=8226||n>=8228&&n<=8231||n===8240||n===8242||n===8243||n===8245||n===8251||n===8254||n===8308||n===8319||n>=8321&&n<=8324||n===8364||n===8451||n===8453||n===8457||n===8467||n===8470||n===8481||n===8482||n===8486||n===8491||n===8531||n===8532||n>=8539&&n<=8542||n>=8544&&n<=8555||n>=8560&&n<=8569||n===8585||n>=8592&&n<=8601||n===8632||n===8633||n===8658||n===8660||n===8679||n===8704||n===8706||n===8707||n===8711||n===8712||n===8715||n===8719||n===8721||n===8725||n===8730||n>=8733&&n<=8736||n===8739||n===8741||n>=8743&&n<=8748||n===8750||n>=8756&&n<=8759||n===8764||n===8765||n===8776||n===8780||n===8786||n===8800||n===8801||n>=8804&&n<=8807||n===8810||n===8811||n===8814||n===8815||n===8834||n===8835||n===8838||n===8839||n===8853||n===8857||n===8869||n===8895||n===8978||n>=9312&&n<=9449||n>=9451&&n<=9547||n>=9552&&n<=9587||n>=9600&&n<=9615||n>=9618&&n<=9621||n===9632||n===9633||n>=9635&&n<=9641||n===9650||n===9651||n===9654||n===9655||n===9660||n===9661||n===9664||n===9665||n>=9670&&n<=9672||n===9675||n>=9678&&n<=9681||n>=9698&&n<=9701||n===9711||n===9733||n===9734||n===9737||n===9742||n===9743||n===9756||n===9758||n===9792||n===9794||n===9824||n===9825||n>=9827&&n<=9829||n>=9831&&n<=9834||n===9836||n===9837||n===9839||n===9886||n===9887||n===9919||n>=9926&&n<=9933||n>=9935&&n<=9939||n>=9941&&n<=9953||n===9955||n===9960||n===9961||n>=9963&&n<=9969||n===9972||n>=9974&&n<=9977||n===9979||n===9980||n===9982||n===9983||n===10045||n>=10102&&n<=10111||n>=11094&&n<=11097||n>=12872&&n<=12879||n>=57344&&n<=63743||n>=65024&&n<=65039||n===65533||n>=127232&&n<=127242||n>=127248&&n<=127277||n>=127280&&n<=127337||n>=127344&&n<=127373||n===127375||n===127376||n>=127387&&n<=127404||n>=917760&&n<=917999||n>=983040&&n<=1048573||n>=1048576&&n<=1114109}a(eD,"isAmbiguous");function tD(n){return n===12288||n>=65281&&n<=65376||n>=65504&&n<=65510}a(tD,"isFullWidth");function rD(n){return n>=4352&&n<=4447||n===8986||n===8987||n===9001||n===9002||n>=9193&&n<=9196||n===9200||n===9203||n===9725||n===9726||n===9748||n===9749||n>=9776&&n<=9783||n>=9800&&n<=9811||n===9855||n>=9866&&n<=9871||n===9875||n===9889||n===9898||n===9899||n===9917||n===9918||n===9924||n===9925||n===9934||n===9940||n===9962||n===9970||n===9971||n===9973||n===9978||n===9981||n===9989||n===9994||n===9995||n===10024||n===10060||n===10062||n>=10067&&n<=10069||n===10071||n>=10133&&n<=10135||n===10160||n===10175||n===11035||n===11036||n===11088||n===11093||n>=11904&&n<=11929||n>=11931&&n<=12019||n>=12032&&n<=12245||n>=12272&&n<=12287||n>=12289&&n<=12350||n>=12353&&n<=12438||n>=12441&&n<=12543||n>=12549&&n<=12591||n>=12593&&n<=12686||n>=12688&&n<=12773||n>=12783&&n<=12830||n>=12832&&n<=12871||n>=12880&&n<=42124||n>=42128&&n<=42182||n>=43360&&n<=43388||n>=44032&&n<=55203||n>=63744&&n<=64255||n>=65040&&n<=65049||n>=65072&&n<=65106||n>=65108&&n<=65126||n>=65128&&n<=65131||n>=94176&&n<=94180||n>=94192&&n<=94198||n>=94208&&n<=101589||n>=101631&&n<=101662||n>=101760&&n<=101874||n>=110576&&n<=110579||n>=110581&&n<=110587||n===110589||n===110590||n>=110592&&n<=110882||n===110898||n>=110928&&n<=110930||n===110933||n>=110948&&n<=110951||n>=110960&&n<=111355||n>=119552&&n<=119638||n>=119648&&n<=119670||n===126980||n===127183||n===127374||n>=127377&&n<=127386||n>=127488&&n<=127490||n>=127504&&n<=127547||n>=127552&&n<=127560||n===127568||n===127569||n>=127584&&n<=127589||n>=127744&&n<=127776||n>=127789&&n<=127797||n>=127799&&n<=127868||n>=127870&&n<=127891||n>=127904&&n<=127946||n>=127951&&n<=127955||n>=127968&&n<=127984||n===127988||n>=127992&&n<=128062||n===128064||n>=128066&&n<=128252||n>=128255&&n<=128317||n>=128331&&n<=128334||n>=128336&&n<=128359||n===128378||n===128405||n===128406||n===128420||n>=128507&&n<=128591||n>=128640&&n<=128709||n===128716||n>=128720&&n<=128722||n>=128725&&n<=128728||n>=128732&&n<=128735||n===128747||n===128748||n>=128756&&n<=128764||n>=128992&&n<=129003||n===129008||n>=129292&&n<=129338||n>=129340&&n<=129349||n>=129351&&n<=129535||n>=129648&&n<=129660||n>=129664&&n<=129674||n>=129678&&n<=129734||n===129736||n>=129741&&n<=129756||n>=129759&&n<=129770||n>=129775&&n<=129784||n>=131072&&n<=196605||n>=196608&&n<=262141}a(rD,"isWide");function mY(n){if(!Number.isSafeInteger(n))throw new TypeError(`Expected a code point, got \`${typeof n}\`.`)}a(mY,"validate");function OE(n,{ambiguousAsWide:e=!1}={}){return mY(n),tD(n)||rD(n)||e&&eD(n)?2:1}a(OE,"eastAsianWidth");var gY=new Intl.Segmenter,yY=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),_Y=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),SY=new RegExp("^\\p{RGI_Emoji}$","v");function vY(n){return n.replace(_Y,"")}a(vY,"baseVisible");function bY(n){return yY.test(n)}a(bY,"isZeroWidthCluster");function wY(n,e){let t=0;if(n.length>1)for(let r of n.slice(1))r>="\uFF00"&&r<="\uFFEF"&&(t+=OE(r.codePointAt(0),e));return t}a(wY,"trailingHalfwidthWidth");function FE(n,e={}){if(typeof n!="string"||n.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:r=!1}=e,i=n;if(r||(i=md(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of gY.segment(i)){if(bY(c))continue;if(SY.test(c)){s+=2;continue}let l=vY(c).codePointAt(0);s+=OE(l,o),s+=wY(c,o)}return s}a(FE,"stringWidth");function DE({stream:n=process.stdout}={}){return!!(n&&n.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(DE,"isInteractive");var Qi=H(require("node:process"),1);var EY=3,NE=class{static{a(this,"StdinDiscarder")}#e=0;start(){this.#e++,this.#e===1&&this.#n()}stop(){if(this.#e<=0)throw new Error("`stop` called more times than `start`");this.#e--,this.#e===0&&this.#r()}#n(){Qi.default.platform==="win32"||!Qi.default.stdin.isTTY||(Qi.default.stdin.setRawMode(!0),Qi.default.stdin.on("data",this.#t),Qi.default.stdin.resume())}#r(){Qi.default.stdin.isTTY&&(Qi.default.stdin.off("data",this.#t),Qi.default.stdin.pause(),Qi.default.stdin.setRawMode(!1))}#t(e){e[0]===EY&&Qi.default.emit("SIGINT")}},TY=new NE,LE=TY;var kE=class{static{a(this,"Ora")}#e=0;#n=!1;#r=0;#t=-1;#c=0;#_=0;#i;#u;#s;#l;#o;#p;#g;#d;#m;#y;#f;color;constructor(e){typeof e=="string"&&(e={text:e}),this.#i={color:"cyan",stream:gd.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#i.color,this.spinner=this.#i.spinner,this.#o=this.#i.interval,this.#s=this.#i.stream,this.#p=typeof this.#i.isEnabled=="boolean"?this.#i.isEnabled:DE({stream:this.#s}),this.#g=typeof this.#i.isSilent=="boolean"?this.#i.isSilent:!1,this.text=this.#i.text,this.prefixText=this.#i.prefixText,this.suffixText=this.#i.suffixText,this.indent=this.#i.indent,gd.default.env.NODE_ENV==="test"&&(this._stream=this.#s,this._isEnabled=this.#p,Object.defineProperty(this,"_linesToClear",{get(){return this.#e},set(t){this.#e=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#t}}),Object.defineProperty(this,"_lineCount",{get(){return this.#r}}))}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw new Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#v()}get interval(){return this.#o??this.#u.interval??100}get spinner(){return this.#u}set spinner(e){if(this.#t=-1,this.#o=void 0,typeof e=="object"){if(!Array.isArray(e.frames)||e.frames.length===0||e.frames.some(t=>typeof t!="string"))throw new Error("The given spinner must have a non-empty `frames` array of strings");if(e.interval!==void 0&&!(Number.isInteger(e.interval)&&e.interval>0))throw new Error("`spinner.interval` must be a positive integer if provided");this.#u=e}else if(!pd())this.#u=hd.line;else if(e===void 0)this.#u=hd.dots;else if(e!=="default"&&hd[e])this.#u=hd[e];else throw new Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#m}set text(e=""){this.#m=e,this.#v()}get prefixText(){return this.#y}set prefixText(e=""){this.#y=e,this.#v()}get suffixText(){return this.#f}set suffixText(e=""){this.#f=e,this.#v()}get isSpinning(){return this.#l!==void 0}#E(e,t,r=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?r?t+i:i+t:""}#T(e=this.#y,t=" "){return this.#E(e,t,!1)}#S(e=this.#f,t=" "){return this.#E(e,t,!0)}#w(e,t){let r=0;for(let i of md(e).split(`
535
535
  `))r+=Math.max(1,Math.ceil(FE(i)/t));return r}#v(){let e=this.#s.columns??80,t=typeof this.#y=="function"?"":this.#y,r=typeof this.#f=="function"?"":this.#f,i=typeof t=="string"&&t!==""?t+" ":"",s=typeof r=="string"&&r!==""?" "+r:"",c=" ".repeat(this.#d)+i+"-"+(typeof this.#m=="string"?" "+this.#m:"")+s;this.#r=this.#w(c,e)}get isEnabled(){return this.#p&&!this.#g}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#p=e}get isSilent(){return this.#g}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#g=e}frame(){let e=Date.now();(this.#t===-1||e-this.#c>=this.interval)&&(this.#t=++this.#t%this.#u.frames.length,this.#c=e);let{frames:t}=this.#u,r=t[this.#t];this.color&&(r=qF[this.color](r));let i=this.#T(this.#y," "),s=typeof this.text=="string"?" "+this.text:"",o=this.#S(this.#f," ");return i+r+s+o}clear(){if(!this.#p||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#e;e++)e>0&&this.#s.moveCursor(0,-1),this.#s.clearLine(1);return(this.#d||this.#_!==this.#d)&&this.#s.cursorTo(this.#d),this.#_=this.#d,this.#e=0,this}render(){if(!this.#p||this.#g)return this;this.clear();let e=this.frame(),t=this.#s.columns??80,r=this.#w(e,t),i=this.#s.rows;if(i&&i>1&&r>i){let s=e.split(`
536
536
  `),o=i-1;e=[...s.slice(0,o),"... (content truncated to fit terminal)"].join(`
537
537
  `)}return this.#s.write(e),this.#e=this.#w(e,t),this}start(e){if(e&&(this.text=e),this.#g)return this;if(!this.#p){let t=" ".repeat(this.#d)+this.#T(this.#y," ")+(this.text?`- ${this.text}`:"")+this.#S(this.#f," ");return t.trim()!==""&&this.#s.write(t+`
538
538
  `),this}return this.isSpinning?this:(this.#i.hideCursor&&CE.hide(this.#s),this.#i.discardStdin&&gd.default.stdin.isTTY&&(this.#n=!0,LE.start()),this.render(),this.#l=setInterval(this.render.bind(this),this.interval),this)}stop(){return clearInterval(this.#l),this.#l=void 0,this.#t=0,this.#p&&(this.clear(),this.#i.hideCursor&&CE.show(this.#s)),this.#i.discardStdin&&gd.default.stdin.isTTY&&this.#n&&(LE.stop(),this.#n=!1),this}succeed(e){return this.stopAndPersist({symbol:oc.success,text:e})}fail(e){return this.stopAndPersist({symbol:oc.error,text:e})}warn(e){return this.stopAndPersist({symbol:oc.warning,text:e})}info(e){return this.stopAndPersist({symbol:oc.info,text:e})}stopAndPersist(e={}){if(this.#g)return this;let t=e.prefixText??this.#y,r=this.#T(t," "),i=e.symbol??" ",s=e.text??this.text,c=typeof s=="string"?(i?" ":"")+s:"",l=e.suffixText??this.#f,u=this.#S(l," "),f=r+i+c+u+`
539
539
  `;return this.stop(),this.#s.write(f),this}};function ME(n){return new kE(n)}a(ME,"ora");var ry=class{constructor(e,t={}){this.delayTimeout=null;this.updateInterval=null;this.startTime=0;this.isSpinnerVisible=!1;this.message=e,this.delayMs=t.delayMs??2e3,this.isTTY=!!process.stdout.isTTY,this.spinner=ME({text:e,isEnabled:this.isTTY})}static{a(this,"ProgressIndicator")}start(){this.isTTY&&(this.startTime=Date.now(),this.delayTimeout=setTimeout(()=>{this.showSpinner()},this.delayMs))}showSpinner(){!this.isTTY||this.isSpinnerVisible||(this.isSpinnerVisible=!0,this.updateSpinnerText(),this.spinner.start(),this.updateInterval=setInterval(()=>{this.updateSpinnerText()},1e3))}updateSpinnerText(){let e=Date.now()-this.startTime,t=this.formatElapsedTime(e);this.spinner.text=`${this.message} (${t})`}formatElapsedTime(e){let t=Math.floor(e/1e3),r=Math.floor(t/60),i=t%60;return r>0?`${r}m ${i}s`:`${i}s`}cleanup(){this.delayTimeout&&(clearTimeout(this.delayTimeout),this.delayTimeout=null),this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null)}succeed(e){this.cleanup(),this.isSpinnerVisible&&this.spinner.succeed(e),this.isSpinnerVisible=!1}fail(e){this.cleanup(),this.isSpinnerVisible&&this.spinner.fail(e),this.isSpinnerVisible=!1}stop(){this.cleanup(),this.isSpinnerVisible&&this.spinner.stop(),this.isSpinnerVisible=!1}async wrap(e,t){this.start();try{let r=await e();return this.succeed(t),r}catch(r){let i=r instanceof Error?r.message:"Operation failed";throw this.fail(i),r}}};var Ps=H(Pt());var ny=class{static{a(this,"QueryAnalyzer")}constructor(){this.parser=new Ps.ExoQLParser,this.translator=new Ps.ExoQLAlgebraTranslator,this.optimizer=new Ps.AlgebraOptimizer,this.serializer=new Ps.AlgebraSerializer}async analyze(e,t={}){try{let r=this.parser.parse(e),i={valid:!0,queryType:this.extractQueryType(r),prefixes:this.extractPrefixes(r),variables:this.extractVariables(r),triplePatternCount:this.countTriplePatterns(r),hasFilter:this.hasPatternType(r,"filter"),hasUnion:this.hasPatternType(r,"union"),hasOptional:this.hasPatternType(r,"optional")};if(i.complexity=this.estimateComplexity(i),t.includeAlgebraPlan){let s=this.translator.translate(r);t.optimize!==!1&&(s.type==="construct"?s={...s,where:this.optimizer.optimize(s.where)}:s=this.optimizer.optimize(s)),i.algebraPlan=this.serializer.toString(s)}return i}catch(r){return this.handleParseError(r)}}formatAnalysis(e,t){if(t==="json")return JSON.stringify(e,null,2);if(!e.valid)return this.formatError(e.error);let r=[];if(r.push(`Query Type: ${e.queryType}`),r.push(""),e.prefixes&&e.prefixes.length>0){r.push("Prefixes:");for(let s of e.prefixes)r.push(` ${s.prefix}: <${s.iri}>`);r.push("")}e.variables&&(r.push("Variables:"),e.variables.length===1&&e.variables[0]==="*"?r.push(" * (all variables)"):r.push(` ${e.variables.join(", ")}`),r.push("")),r.push(`Triple Patterns: ${e.triplePatternCount??0}`),r.push("");let i=[];return e.hasFilter&&i.push("FILTER"),e.hasUnion&&i.push("UNION"),e.hasOptional&&i.push("OPTIONAL"),i.length>0&&(r.push(`Features: ${i.join(", ")}`),r.push("")),r.push(`Complexity: ${e.complexity}`),e.algebraPlan&&(r.push(""),r.push("Query Plan:"),r.push(e.algebraPlan)),r.join(`
540
540
  `)}extractQueryType(e){return e.type==="update"?"UPDATE":"queryType"in e?e.queryType:"UNKNOWN"}extractPrefixes(e){let t=[];if(e.prefixes&&typeof e.prefixes=="object")for(let[r,i]of Object.entries(e.prefixes))t.push({prefix:r,iri:i});return t}extractVariables(e){return e.variables?Array.isArray(e.variables)?e.variables.length===1&&e.variables[0]==="*"?["*"]:e.variables.map(t=>typeof t=="string"?t:t.termType==="Variable"?`?${t.value}`:t.variable&&t.variable.termType==="Variable"?`?${t.variable.value}`:String(t)):[]:[]}countTriplePatterns(e){let t=e.where||[];return this.countTriplesInPatterns(t)}countTriplesInPatterns(e){let t=0;for(let r of e)r&&(r.type==="bgp"&&Array.isArray(r.triples)?t+=r.triples.length:r.patterns&&Array.isArray(r.patterns)&&(t+=this.countTriplesInPatterns(r.patterns)));return t}hasPatternType(e,t){let r=e.where||[];return this.containsPatternType(r,t)}containsPatternType(e,t){for(let r of e)if(r&&(r.type===t||r.patterns&&this.containsPatternType(r.patterns,t)))return!0;return!1}estimateComplexity(e){let t=0,r=e.triplePatternCount??0;return r<=3?t+=1:r<=7?t+=2:t+=3,e.hasOptional&&(t+=1),e.hasUnion&&(t+=2),e.hasFilter&&(t+=.5),t<=2?"low":t<=4?"medium":"high"}handleParseError(e){return e instanceof Ps.SPARQLParseError?{valid:!1,error:{message:e.message,line:e.line,column:e.column,suggestions:this.generateSuggestions(e.message)}}:e instanceof Error?{valid:!1,error:{message:e.message,suggestions:this.generateSuggestions(e.message)}}:{valid:!1,error:{message:String(e)}}}generateSuggestions(e){let t=[],r=e.toLowerCase();if(r.includes("unknown prefix")||r.includes("prefix")){let i=e.match(/prefix[:\s]+(\w+)/i);if(i){let s=i[1].toLowerCase(),o={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",xsd:"http://www.w3.org/2001/XMLSchema#",owl:"http://www.w3.org/2002/07/owl#",ems:"http://exocortex.local/ems#",exo:"http://exocortex.local/exo#",ims:"http://exocortex.local/ims#"};o[s]?t.push(`Add prefix declaration: PREFIX ${s}: <${o[s]}>`):t.push(`Add a PREFIX declaration for '${s}' at the start of your query`)}}return(r.includes("where")||r.includes("expected"))&&t.push("Ensure your query has a WHERE clause: SELECT ?s WHERE { ... }"),(r.includes("bracket")||r.includes("brace")||r.includes("{")||r.includes("}"))&&t.push("Check that all braces { } are properly balanced"),(r.includes("variable")||r.includes("?"))&&t.push("Variables must start with '?' (e.g., ?subject, ?predicate, ?object)"),t.length===0&&t.push("Check SPARQL syntax - see https://www.w3.org/TR/sparql11-query/"),t}formatError(e){let t=[];if(t.push("Syntax Error:"),e.line!==void 0){let r=e.column!==void 0?`line ${e.line}, column ${e.column}`:`line ${e.line}`;t.push(` Position: ${r}`)}if(t.push(` ${e.message}`),e.suggestions&&e.suggestions.length>0){t.push(""),t.push("Suggestions:");for(let r of e.suggestions)t.push(` - ${r}`)}return t.join(`
541
- `)}};var jE=class extends Error{static{a(this,"TemplateNotFoundError")}constructor(e){super(`Template not found: "${e}". Use --list-templates to see available templates.`),this.name="TemplateNotFoundError"}},$E=class extends Error{static{a(this,"InvalidParameterError")}constructor(e,t,r){super(`Invalid parameter "${e}" for template "${t}". Valid parameters: ${r.length>0?r.join(", "):"none"}`),this.name="InvalidParameterError"}},BE=class extends Error{static{a(this,"MissingParameterError")}constructor(e,t){super(`Missing required parameter(s) for template "${t}": ${e.join(", ")}. Use --param to provide values.`),this.name="MissingParameterError"}},iy=class extends Error{static{a(this,"InvalidParamFormatError")}constructor(e){super(`Invalid parameter format: "${e}". Use format: key=value or key1=value1,key2=value2`),this.name="InvalidParamFormatError"}},TY=[{name:"tasks-by-date",description:"Find tasks scheduled for a specific date",query:`PREFIX ems: <http://example.org/ems#>
541
+ `)}};var jE=class extends Error{static{a(this,"TemplateNotFoundError")}constructor(e){super(`Template not found: "${e}". Use --list-templates to see available templates.`),this.name="TemplateNotFoundError"}},$E=class extends Error{static{a(this,"InvalidParameterError")}constructor(e,t,r){super(`Invalid parameter "${e}" for template "${t}". Valid parameters: ${r.length>0?r.join(", "):"none"}`),this.name="InvalidParameterError"}},BE=class extends Error{static{a(this,"MissingParameterError")}constructor(e,t){super(`Missing required parameter(s) for template "${t}": ${e.join(", ")}. Use --param to provide values.`),this.name="MissingParameterError"}},iy=class extends Error{static{a(this,"InvalidParamFormatError")}constructor(e){super(`Invalid parameter format: "${e}". Use format: key=value or key1=value1,key2=value2`),this.name="InvalidParamFormatError"}},AY=[{name:"tasks-by-date",description:"Find tasks scheduled for a specific date",query:`PREFIX ems: <http://example.org/ems#>
542
542
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
543
543
  PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
544
544
 
@@ -594,33 +594,33 @@ SELECT ?task ?label ?start ?end WHERE {
594
594
  OPTIONAL { ?task ems:Effort_endTimestamp ?end }
595
595
  }
596
596
  ORDER BY DESC(?start)
597
- LIMIT 30`,parameters:[],examples:{}}],ou=class{static{a(this,"TemplateRegistry")}constructor(){this.templates=new Map;for(let e of TY)this.templates.set(e.name,e)}listTemplates(){return Array.from(this.templates.values())}getTemplate(e){let t=this.templates.get(e);if(!t)throw new jE(e);return t}applyTemplate(e,t){let r=this.getTemplate(e),i=this.validateParameters(e,t);if(!i.valid){if(i.missing.length>0)throw new BE(i.missing,e);if(i.unknown.length>0)throw new $E(i.unknown[0],e,r.parameters)}let s=r.query;for(let o of r.parameters){let c=t[o],l=this.escapeValue(c);s=s.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),l)}return s}validateParameters(e,t){let r=this.getTemplate(e),i=Object.keys(t),s=r.parameters,o=s.filter(l=>!(l in t)||t[l]===void 0),c=i.filter(l=>!s.includes(l));return{valid:o.length===0&&c.length===0,missing:o,unknown:c}}parseParamString(e){let t=e.trim();if(t==="")return{};let r={},i=t.split(",");for(let s of i){let o=s.indexOf("=");if(o===-1)throw new iy(e);let c=s.slice(0,o).trim(),l=s.slice(o+1).trim();if(c==="")throw new iy(e);r[c]=l}return r}escapeValue(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}registerTemplate(e){this.templates.set(e.name,e)}hasTemplate(e){return this.templates.has(e)}formatList(e="text"){let t=this.listTemplates();if(e==="json")return JSON.stringify(t,null,2);let r=[];r.push("Available SPARQL Templates:"),r.push("=".repeat(50)),r.push("");for(let i of t){if(r.push(`\u{1F4CB} ${i.name}`),r.push(` ${i.description}`),i.parameters.length>0){if(r.push(` Parameters: ${i.parameters.join(", ")}`),i.examples&&Object.keys(i.examples).length>0){let s=Object.entries(i.examples).map(([o,c])=>`${o}=${c}`).join(", ");r.push(` Example: --param "${s}"`)}}else r.push(" Parameters: (none)");r.push("")}return r.join(`
598
- `)}};function AY(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;let t=[];for(let r=0;r<=n.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=n.length;r++)for(let i=1;i<=e.length;i++){let s=n[r-1]===e[i-1]?0:1;t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+s)}return t[n.length][e.length]}a(AY,"levenshteinDistance");function xY(n,e,t=3,r=3){return e.map(s=>({prefix:s,distance:AY(n.toLowerCase(),s.toLowerCase())})).filter(({distance:s})=>s<=r).sort((s,o)=>s.distance-o.distance).slice(0,t).map(({prefix:s})=>s)}a(xY,"findSimilarPrefixes");function CY(n,e,t=2,r){let i=n.split(`
599
- `),s=i.length,o=Math.max(1,e-t),c=Math.min(s,e+t),l=[];for(let u=o;u<=c;u++)l.push({number:u,content:i[u-1],isError:u===e});return{startLine:o,endLine:c,errorLine:e,errorColumn:r,lines:l}}a(CY,"getQueryContext");function RY(n){let e=/PREFIX\s+(\w+):\s*</gi,t=[],r;for(;(r=e.exec(n))!==null;)t.push(r[1]);return t}a(RY,"extractDeclaredPrefixes");function IY(n){let e=[/unknown prefix[:\s]+['"]?(\w+)['"]?/i,/prefix\s+['"]?(\w+)['"]?\s+not\s+defined/i,/undefined\s+prefix[:\s]+['"]?(\w+)['"]?/i];for(let t of e){let r=n.match(t);if(r)return r[1]}return null}a(IY,"extractUnknownPrefix");function PY(n){let e=[/line\s+(\d+),?\s*column\s+(\d+)/i,/line\s+(\d+):(\d+)/i,/at\s+(\d+):(\d+)/i,/\((\d+),\s*(\d+)\)/];for(let r of e){let i=n.match(r);if(i)return{line:parseInt(i[1],10),column:parseInt(i[2],10)}}let t=n.match(/line\s+(\d+)/i);return t?{line:parseInt(t[1],10)}:{}}a(PY,"extractPosition");function OY(n){let e=[/timeout[^\d]*(\d+)\s*ms/i,/timeout[^\d]*(\d+)\s*milliseconds/i,/(\d+)\s*ms\s*timeout/i,/exceeded[^\d]*(\d+)\s*ms/i];for(let t of e){let r=n.match(t);if(r)return parseInt(r[1],10)}return null}a(OY,"extractTimeoutDuration");var sy=class{constructor(){this.wellKnownPrefixes={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",xsd:"http://www.w3.org/2001/XMLSchema#",owl:"http://www.w3.org/2002/07/owl#",ems:"http://exocortex.local/ems#",exo:"http://exocortex.local/exo#",ims:"http://exocortex.local/ims#"}}static{a(this,"SPARQLErrorEnhancer")}classifyError(e){let t=e.message.toLowerCase();return t.includes("unknown prefix")||t.includes("prefix")&&(t.includes("not defined")||t.includes("undefined"))?"unknown_prefix":t.includes("parse error")||t.includes("syntax error")||t.includes("unexpected")||t.includes("expected")?"syntax":t.includes("timeout")||t.includes("timed out")||t.includes("exceeded")?"timeout":t.includes("econnrefused")||t.includes("connection refused")||t.includes("network")||t.includes("connect")?"connection":"unknown"}enhanceError(e,t){switch(this.classifyError(e)){case"unknown_prefix":return this.enhanceUnknownPrefixError(e,t);case"syntax":return this.enhanceSyntaxError(e,t);case"timeout":return this.enhanceTimeoutError(e,t);case"connection":return this.enhanceConnectionError(e,t);default:return this.enhanceUnknownError(e,t)}}enhanceUnknownPrefixError(e,t){let r=IY(e.message),i=RY(t),s=[...new Set([...i,...Object.keys(this.wellKnownPrefixes)])],o,c=[];if(r){let l=xY(r,s);l.length>0?(o=`Unknown prefix '${r}'. Did you mean: ${l.join(", ")}?`,c.push(`Replace '${r}:' with '${l[0]}:'`)):o=`Unknown prefix '${r}'.`;let u=i.length>0?i.join(", "):Object.keys(this.wellKnownPrefixes).join(", ");o+=`
597
+ LIMIT 30`,parameters:[],examples:{}}],ou=class{static{a(this,"TemplateRegistry")}constructor(){this.templates=new Map;for(let e of AY)this.templates.set(e.name,e)}listTemplates(){return Array.from(this.templates.values())}getTemplate(e){let t=this.templates.get(e);if(!t)throw new jE(e);return t}applyTemplate(e,t){let r=this.getTemplate(e),i=this.validateParameters(e,t);if(!i.valid){if(i.missing.length>0)throw new BE(i.missing,e);if(i.unknown.length>0)throw new $E(i.unknown[0],e,r.parameters)}let s=r.query;for(let o of r.parameters){let c=t[o],l=this.escapeValue(c);s=s.replace(new RegExp(`\\{\\{${o}\\}\\}`,"g"),l)}return s}validateParameters(e,t){let r=this.getTemplate(e),i=Object.keys(t),s=r.parameters,o=s.filter(l=>!(l in t)||t[l]===void 0),c=i.filter(l=>!s.includes(l));return{valid:o.length===0&&c.length===0,missing:o,unknown:c}}parseParamString(e){let t=e.trim();if(t==="")return{};let r={},i=t.split(",");for(let s of i){let o=s.indexOf("=");if(o===-1)throw new iy(e);let c=s.slice(0,o).trim(),l=s.slice(o+1).trim();if(c==="")throw new iy(e);r[c]=l}return r}escapeValue(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/'/g,"\\'").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}registerTemplate(e){this.templates.set(e.name,e)}hasTemplate(e){return this.templates.has(e)}formatList(e="text"){let t=this.listTemplates();if(e==="json")return JSON.stringify(t,null,2);let r=[];r.push("Available SPARQL Templates:"),r.push("=".repeat(50)),r.push("");for(let i of t){if(r.push(`\u{1F4CB} ${i.name}`),r.push(` ${i.description}`),i.parameters.length>0){if(r.push(` Parameters: ${i.parameters.join(", ")}`),i.examples&&Object.keys(i.examples).length>0){let s=Object.entries(i.examples).map(([o,c])=>`${o}=${c}`).join(", ");r.push(` Example: --param "${s}"`)}}else r.push(" Parameters: (none)");r.push("")}return r.join(`
598
+ `)}};function xY(n,e){if(n.length===0)return e.length;if(e.length===0)return n.length;let t=[];for(let r=0;r<=n.length;r++)t[r]=[r];for(let r=0;r<=e.length;r++)t[0][r]=r;for(let r=1;r<=n.length;r++)for(let i=1;i<=e.length;i++){let s=n[r-1]===e[i-1]?0:1;t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+s)}return t[n.length][e.length]}a(xY,"levenshteinDistance");function CY(n,e,t=3,r=3){return e.map(s=>({prefix:s,distance:xY(n.toLowerCase(),s.toLowerCase())})).filter(({distance:s})=>s<=r).sort((s,o)=>s.distance-o.distance).slice(0,t).map(({prefix:s})=>s)}a(CY,"findSimilarPrefixes");function RY(n,e,t=2,r){let i=n.split(`
599
+ `),s=i.length,o=Math.max(1,e-t),c=Math.min(s,e+t),l=[];for(let u=o;u<=c;u++)l.push({number:u,content:i[u-1],isError:u===e});return{startLine:o,endLine:c,errorLine:e,errorColumn:r,lines:l}}a(RY,"getQueryContext");function IY(n){let e=/PREFIX\s+(\w+):\s*</gi,t=[],r;for(;(r=e.exec(n))!==null;)t.push(r[1]);return t}a(IY,"extractDeclaredPrefixes");function PY(n){let e=[/unknown prefix[:\s]+['"]?(\w+)['"]?/i,/prefix\s+['"]?(\w+)['"]?\s+not\s+defined/i,/undefined\s+prefix[:\s]+['"]?(\w+)['"]?/i];for(let t of e){let r=n.match(t);if(r)return r[1]}return null}a(PY,"extractUnknownPrefix");function OY(n){let e=[/line\s+(\d+),?\s*column\s+(\d+)/i,/line\s+(\d+):(\d+)/i,/at\s+(\d+):(\d+)/i,/\((\d+),\s*(\d+)\)/];for(let r of e){let i=n.match(r);if(i)return{line:parseInt(i[1],10),column:parseInt(i[2],10)}}let t=n.match(/line\s+(\d+)/i);return t?{line:parseInt(t[1],10)}:{}}a(OY,"extractPosition");function FY(n){let e=[/timeout[^\d]*(\d+)\s*ms/i,/timeout[^\d]*(\d+)\s*milliseconds/i,/(\d+)\s*ms\s*timeout/i,/exceeded[^\d]*(\d+)\s*ms/i];for(let t of e){let r=n.match(t);if(r)return parseInt(r[1],10)}return null}a(FY,"extractTimeoutDuration");var sy=class{constructor(){this.wellKnownPrefixes={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",xsd:"http://www.w3.org/2001/XMLSchema#",owl:"http://www.w3.org/2002/07/owl#",ems:"http://exocortex.local/ems#",exo:"http://exocortex.local/exo#",ims:"http://exocortex.local/ims#"}}static{a(this,"SPARQLErrorEnhancer")}classifyError(e){let t=e.message.toLowerCase();return t.includes("unknown prefix")||t.includes("prefix")&&(t.includes("not defined")||t.includes("undefined"))?"unknown_prefix":t.includes("parse error")||t.includes("syntax error")||t.includes("unexpected")||t.includes("expected")?"syntax":t.includes("timeout")||t.includes("timed out")||t.includes("exceeded")?"timeout":t.includes("econnrefused")||t.includes("connection refused")||t.includes("network")||t.includes("connect")?"connection":"unknown"}enhanceError(e,t){switch(this.classifyError(e)){case"unknown_prefix":return this.enhanceUnknownPrefixError(e,t);case"syntax":return this.enhanceSyntaxError(e,t);case"timeout":return this.enhanceTimeoutError(e,t);case"connection":return this.enhanceConnectionError(e,t);default:return this.enhanceUnknownError(e,t)}}enhanceUnknownPrefixError(e,t){let r=PY(e.message),i=IY(t),s=[...new Set([...i,...Object.keys(this.wellKnownPrefixes)])],o,c=[];if(r){let l=CY(r,s);l.length>0?(o=`Unknown prefix '${r}'. Did you mean: ${l.join(", ")}?`,c.push(`Replace '${r}:' with '${l[0]}:'`)):o=`Unknown prefix '${r}'.`;let u=i.length>0?i.join(", "):Object.keys(this.wellKnownPrefixes).join(", ");o+=`
600
600
 
601
- Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <${this.wellKnownPrefixes[r]}>`)}else o=e.message;return{type:"unknown_prefix",message:o,originalMessage:e.message,originalStack:e.stack,suggestions:c.length>0?c:void 0}}enhanceSyntaxError(e,t){let r=e,i=r.line!==void 0?{line:r.line,column:r.column}:PY(e.message),s,o;i.line?(s=`Syntax error at line ${i.line}`,i.column&&(s+=`, column ${i.column}`),s+=`: ${e.message.replace(/.*line\s+\d+.*?:\s*/i,"")}`,o=CY(t,i.line,2,i.column)):s=`Syntax error: ${e.message}`;let c=this.generateSyntaxSuggestions(e.message);return{type:"syntax",message:s,originalMessage:e.message,originalStack:e.stack,suggestions:c.length>0?c:void 0,context:o,line:i.line,column:i.column}}generateSyntaxSuggestions(e){let t=[],r=e.toLowerCase();return(r.includes("where")||r.includes("expected"))&&t.push("Ensure your query has a WHERE clause: SELECT ?s WHERE { ... }"),(r.includes("{")||r.includes("}")||r.includes("brace")||r.includes("bracket"))&&t.push("Check that all braces { } are properly balanced"),(r.includes("variable")||r.includes("?"))&&t.push("Variables must start with '?' (e.g., ?subject, ?predicate, ?object)"),(r.includes("end of input")||r.includes("eof"))&&t.push("Query may be incomplete - check for missing closing braces or statements"),r.includes("prefix")&&t.push("Add PREFIX declarations at the start of your query"),t.length===0&&t.push("Check SPARQL syntax reference: https://www.w3.org/TR/sparql11-query/"),t}enhanceTimeoutError(e,t){let r=OY(e.message),i=r?Math.round(r/1e3):null,s;i?s=`Query timed out after ${i} second${i!==1?"s":""}`:s="Query timed out";let o=["Try limiting results with LIMIT (e.g., LIMIT 100)","Add more specific FILTER conditions to reduce result set","Use more selective triple patterns","Consider using OPTIONAL sparingly (it can be expensive)"];return/\bLIMIT\b/i.test(t)||o.unshift("Add LIMIT clause to restrict result count"),/SELECT\s+\*/i.test(t)&&o.push("Replace SELECT * with specific variables to reduce data transfer"),{type:"timeout",message:s,originalMessage:e.message,originalStack:e.stack,suggestions:o}}enhanceConnectionError(e,t){let r="Connection failed to SPARQL endpoint",i=["Check that the SPARQL endpoint is running","Verify network connectivity","Check firewall settings"];return{type:"connection",message:r,originalMessage:e.message,originalStack:e.stack,suggestions:i}}enhanceUnknownError(e,t){return{type:"unknown",message:e.message,originalMessage:e.message,originalStack:e.stack,suggestions:["Check query syntax and try again"]}}formatForText(e){let t=[];if(t.push(`\u274C ${e.message}`),e.context){t.push(""),t.push("Context:");for(let r of e.context.lines){let i=r.isError?">>> ":" ";if(t.push(`${i}${r.number.toString().padStart(3)}: ${r.content}`),r.isError&&e.context.errorColumn){let s=" ".repeat(8+r.number.toString().length+e.context.errorColumn-1)+"^";t.push(s)}}}if(e.suggestions&&e.suggestions.length>0){t.push(""),t.push("Suggestions:");for(let r of e.suggestions)t.push(` \u2022 ${r}`)}return t.join(`
602
- `)}formatForJSON(e){return{type:e.type,message:e.message,originalMessage:e.originalMessage,suggestions:e.suggestions,line:e.line,column:e.column,context:e.context?{startLine:e.context.startLine,endLine:e.context.endLine,errorLine:e.context.errorLine,errorColumn:e.context.errorColumn,lines:e.context.lines.map(t=>({number:t.number,content:t.content,isError:t.isError}))}:void 0}}};var oy=class n{static{a(this,"NTriplesFormatter")}static escapeString(e){let t=e.replace(/\\/g,"\\\\");return t=t.replace(/"/g,'\\"'),t=t.replace(/\n/g,"\\n"),t=t.replace(/\r/g,"\\r"),t=t.replace(/\t/g,"\\t"),t}static formatObject(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:")?`<${e}>`:`"${n.escapeString(e)}"`}};var ac=require("fs"),UE=require("path");function yd(n){let e=new Map,t="obsidian://vault/",r;try{r=(0,ac.readdirSync)(n)}catch{return e}for(let i of r){let s=(0,UE.join)(n,i);if(i.startsWith("."))continue;let o;try{o=(0,ac.statSync)(s)}catch{continue}if(!o.isDirectory())continue;let c;try{c=(0,ac.readdirSync)(s)}catch{continue}for(let l of c){let u=(0,UE.join)(s,l);if(l.startsWith("."))continue;let f;try{f=(0,ac.statSync)(u)}catch{continue}if(!f.isDirectory())continue;let d=!1;try{d=(0,ac.readdirSync)(u).some(p=>p.endsWith(".md"))}catch{continue}if(d){let h=`${i}/${l}`,p=encodeURI(h),y=`${t}${p}/`;/^[a-zA-Z][a-zA-Z0-9_]*$/.test(l)&&e.set(l,y)}}}return e}a(yd,"scanVaultNamespaces");var nD=H(Pt());var FY="https://exocortex.my/ontology/",DY=/^[a-z][a-zA-Z0-9]*$/,iD=new Set(["exo","ems","ims","gtd","period","lit","inbox","rdf","rdfs","owl","xsd"]),NY=/(<)([a-zA-Z][a-zA-Z0-9]*)__([a-zA-Z][a-zA-Z0-9_]*)(>)/g;function au(n){let e=new Set,t=/PREFIX\s+(\w+)\s*:/gi,r;for(;(r=t.exec(n))!==null;)e.add(r[1].toLowerCase());let i=nD.SPARQL_PREFIXES.split(`
603
- `).filter(f=>f.trim().length>0),s=[];for(let f of i){let d=/PREFIX\s+(\w+)\s*:/i.exec(f);d&&!e.has(d[1].toLowerCase())&&s.push(f)}let o=/(?<![:\w])([a-z][a-zA-Z0-9]*):[a-zA-Z_]/g,c=new Set,l;for(;(l=o.exec(n))!==null;)c.add(l[1]);let u=new Set(e);for(let f of s){let d=/PREFIX\s+(\w+)\s*:/i.exec(f);d&&u.add(d[1].toLowerCase())}for(let f of c)u.has(f.toLowerCase())||DY.test(f)&&(s.push(`PREFIX ${f}: <${FY}${f}#>`),u.add(f.toLowerCase()));return s.length===0?n:s.join(`
601
+ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <${this.wellKnownPrefixes[r]}>`)}else o=e.message;return{type:"unknown_prefix",message:o,originalMessage:e.message,originalStack:e.stack,suggestions:c.length>0?c:void 0}}enhanceSyntaxError(e,t){let r=e,i=r.line!==void 0?{line:r.line,column:r.column}:OY(e.message),s,o;i.line?(s=`Syntax error at line ${i.line}`,i.column&&(s+=`, column ${i.column}`),s+=`: ${e.message.replace(/.*line\s+\d+.*?:\s*/i,"")}`,o=RY(t,i.line,2,i.column)):s=`Syntax error: ${e.message}`;let c=this.generateSyntaxSuggestions(e.message);return{type:"syntax",message:s,originalMessage:e.message,originalStack:e.stack,suggestions:c.length>0?c:void 0,context:o,line:i.line,column:i.column}}generateSyntaxSuggestions(e){let t=[],r=e.toLowerCase();return(r.includes("where")||r.includes("expected"))&&t.push("Ensure your query has a WHERE clause: SELECT ?s WHERE { ... }"),(r.includes("{")||r.includes("}")||r.includes("brace")||r.includes("bracket"))&&t.push("Check that all braces { } are properly balanced"),(r.includes("variable")||r.includes("?"))&&t.push("Variables must start with '?' (e.g., ?subject, ?predicate, ?object)"),(r.includes("end of input")||r.includes("eof"))&&t.push("Query may be incomplete - check for missing closing braces or statements"),r.includes("prefix")&&t.push("Add PREFIX declarations at the start of your query"),t.length===0&&t.push("Check SPARQL syntax reference: https://www.w3.org/TR/sparql11-query/"),t}enhanceTimeoutError(e,t){let r=FY(e.message),i=r?Math.round(r/1e3):null,s;i?s=`Query timed out after ${i} second${i!==1?"s":""}`:s="Query timed out";let o=["Try limiting results with LIMIT (e.g., LIMIT 100)","Add more specific FILTER conditions to reduce result set","Use more selective triple patterns","Consider using OPTIONAL sparingly (it can be expensive)"];return/\bLIMIT\b/i.test(t)||o.unshift("Add LIMIT clause to restrict result count"),/SELECT\s+\*/i.test(t)&&o.push("Replace SELECT * with specific variables to reduce data transfer"),{type:"timeout",message:s,originalMessage:e.message,originalStack:e.stack,suggestions:o}}enhanceConnectionError(e,t){let r="Connection failed to SPARQL endpoint",i=["Check that the SPARQL endpoint is running","Verify network connectivity","Check firewall settings"];return{type:"connection",message:r,originalMessage:e.message,originalStack:e.stack,suggestions:i}}enhanceUnknownError(e,t){return{type:"unknown",message:e.message,originalMessage:e.message,originalStack:e.stack,suggestions:["Check query syntax and try again"]}}formatForText(e){let t=[];if(t.push(`\u274C ${e.message}`),e.context){t.push(""),t.push("Context:");for(let r of e.context.lines){let i=r.isError?">>> ":" ";if(t.push(`${i}${r.number.toString().padStart(3)}: ${r.content}`),r.isError&&e.context.errorColumn){let s=" ".repeat(8+r.number.toString().length+e.context.errorColumn-1)+"^";t.push(s)}}}if(e.suggestions&&e.suggestions.length>0){t.push(""),t.push("Suggestions:");for(let r of e.suggestions)t.push(` \u2022 ${r}`)}return t.join(`
602
+ `)}formatForJSON(e){return{type:e.type,message:e.message,originalMessage:e.originalMessage,suggestions:e.suggestions,line:e.line,column:e.column,context:e.context?{startLine:e.context.startLine,endLine:e.context.endLine,errorLine:e.context.errorLine,errorColumn:e.context.errorColumn,lines:e.context.lines.map(t=>({number:t.number,content:t.content,isError:t.isError}))}:void 0}}};var oy=class n{static{a(this,"NTriplesFormatter")}static escapeString(e){let t=e.replace(/\\/g,"\\\\");return t=t.replace(/"/g,'\\"'),t=t.replace(/\n/g,"\\n"),t=t.replace(/\r/g,"\\r"),t=t.replace(/\t/g,"\\t"),t}static formatObject(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("urn:")?`<${e}>`:`"${n.escapeString(e)}"`}};var ac=require("fs"),UE=require("path");function yd(n){let e=new Map,t="obsidian://vault/",r;try{r=(0,ac.readdirSync)(n)}catch{return e}for(let i of r){let s=(0,UE.join)(n,i);if(i.startsWith("."))continue;let o;try{o=(0,ac.statSync)(s)}catch{continue}if(!o.isDirectory())continue;let c;try{c=(0,ac.readdirSync)(s)}catch{continue}for(let l of c){let u=(0,UE.join)(s,l);if(l.startsWith("."))continue;let f;try{f=(0,ac.statSync)(u)}catch{continue}if(!f.isDirectory())continue;let d=!1;try{d=(0,ac.readdirSync)(u).some(p=>p.endsWith(".md"))}catch{continue}if(d){let h=`${i}/${l}`,p=encodeURI(h),y=`${t}${p}/`;/^[a-zA-Z][a-zA-Z0-9_]*$/.test(l)&&e.set(l,y)}}}return e}a(yd,"scanVaultNamespaces");var nD=H(Pt());var DY="https://exocortex.my/ontology/",NY=/^[a-z][a-zA-Z0-9]*$/,iD=new Set(["exo","ems","ims","gtd","period","lit","inbox","rdf","rdfs","owl","xsd"]),LY=/(<)([a-zA-Z][a-zA-Z0-9]*)__([a-zA-Z][a-zA-Z0-9_]*)(>)/g;function au(n){let e=new Set,t=/PREFIX\s+(\w+)\s*:/gi,r;for(;(r=t.exec(n))!==null;)e.add(r[1].toLowerCase());let i=nD.SPARQL_PREFIXES.split(`
603
+ `).filter(f=>f.trim().length>0),s=[];for(let f of i){let d=/PREFIX\s+(\w+)\s*:/i.exec(f);d&&!e.has(d[1].toLowerCase())&&s.push(f)}let o=/(?<![:\w])([a-z][a-zA-Z0-9]*):[a-zA-Z_]/g,c=new Set,l;for(;(l=o.exec(n))!==null;)c.add(l[1]);let u=new Set(e);for(let f of s){let d=/PREFIX\s+(\w+)\s*:/i.exec(f);d&&u.add(d[1].toLowerCase())}for(let f of c)u.has(f.toLowerCase())||NY.test(f)&&(s.push(`PREFIX ${f}: <${DY}${f}#>`),u.add(f.toLowerCase()));return s.length===0?n:s.join(`
604
604
  `)+`
605
- `+n}a(au,"injectExocortexPrefixes");function ay(n){return n.replace(NY,(e,t,r,i,s)=>iD.has(r.toLowerCase())?`${r}:${i}`:e)}a(ay,"transformShorthandNotation");function _d(n){let e=new Map(n);for(let t of iD)e.delete(t);return e}a(_d,"filterOntologyPrefixes");var LY=300,sD=3e4,kY="EXOCORTEX_SPARQL_TIMEOUT";function MY(){let n=process.env[kY];if(!n)return sD;try{let e=jY(n);if(e!==null&&e>0)return e}catch{}return sD}a(MY,"getDefaultTimeout");function jY(n){let e=n.trim().toLowerCase();if(!e)return null;if(e.endsWith("ms")){let r=parseInt(e.slice(0,-2),10);return isNaN(r)||r<=0?null:r}if(e.endsWith("s")){let r=parseInt(e.slice(0,-1),10);return isNaN(r)||r<=0?null:r*1e3}let t=parseInt(e,10);return isNaN(t)||t<=0?null:t*1e3}a(jY,"parseTimeoutSafe");function $Y(n){if(!n)return LY;let e=parseInt(n.trim(),10);if(isNaN(e)||e<=0)throw new Ke(`Invalid cache TTL: "${n}". Must be a positive number (seconds).`,'exocortex sparql query --cache-ttl 600 "SELECT * WHERE { ?s ?p ?o }"');return e}a($Y,"parseCacheTtl");function BY(n){let e=n.trim().toLowerCase();if(e.endsWith("ms")){let r=parseInt(e.slice(0,-2),10);if(isNaN(r)||r<=0)throw new Ke(`Invalid timeout format: "${n}". Value must be a positive number.`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return r}if(e.endsWith("s")){let r=parseInt(e.slice(0,-1),10);if(isNaN(r)||r<=0)throw new Ke(`Invalid timeout format: "${n}". Value must be a positive number.`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return r*1e3}let t=parseInt(e,10);if(isNaN(t)||t<=0)throw new Ke(`Invalid timeout format: "${n}". Use formats like "30s", "5000ms", or just a number (seconds).`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return t*1e3}a(BY,"parseTimeout");async function VE(n,e,t=Date.now()){let r,i=new Promise((s,o)=>{r=setTimeout(()=>{let c=Date.now()-t;o(new ad(e,c))},e),r&&typeof r=="object"&&"unref"in r&&r.unref()});return Promise.race([n,i])}a(VE,"executeWithTimeout");function UY(n,e){return e.concat([n])}a(UY,"collectAlso");function aD(){return new se("query").description("Execute SPARQL query against Obsidian vault").argument("[query]","SPARQL query string or path to .sparql file (optional if --template is used)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--also <path>","Additional vault to include in query (repeatable)",UY,[]).option("--format <type>","Output format: table|json|csv|ntriples","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--timeout <duration>","Query timeout (e.g., 30s, 5000ms)","30s").option("--dry-run","Validate query syntax without executing (no vault loading)").option("--explain","Show optimized query plan").option("--stats","Show execution statistics").option("--no-optimize","Disable query optimization").option("--use-cache","Use persistent triple cache (faster vault loading)").option("--cache-ttl <seconds>","Query result cache TTL in seconds (default: 300)").option("--no-cache","Bypass query result cache").option("--template <name>","Use a predefined query template").option("--param <params>","Template parameters (format: key=value,key2=value2)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);let r="";try{let i=Date.now(),s=e.timeout?BY(e.timeout):MY(),o=$Y(e.cacheTtl),c=e.cache!==!1;if(e.template){let B=new ou,V=e.param?B.parseParamString(e.param):{};if(r=B.applyTemplate(e.template,V),t==="text"){let F=B.getTemplate(e.template);console.log(`\u{1F4CB} Using template: ${e.template}`),Object.keys(V).length>0&&console.log(` Parameters: ${Object.entries(V).map(([k,te])=>`${k}=${te}`).join(", ")}`),console.log()}}else if(n)r=VY(n);else throw new Ke("Either a query argument or --template flag is required.",'exocortex sparql query "SELECT * WHERE { ?s ?p ?o }" or exocortex sparql query --template tasks-by-date --param date=2024-01-15');if(e.dryRun){await qY(r,e,t);return}let l=(0,Sd.resolve)(e.vault);if(c){let V=await new ru().get(r,o);if(V!==null){let F=Date.now()-i;if(t==="json"){let k=X.success(V,{durationMs:F,itemCount:V.count||0,queryResultCacheHit:!0});console.log(JSON.stringify(k,null,2))}else{console.log(`\u{1F4E6} (cached) Query result loaded from cache in ${F}ms
605
+ `+n}a(au,"injectExocortexPrefixes");function ay(n){return n.replace(LY,(e,t,r,i,s)=>iD.has(r.toLowerCase())?`${r}:${i}`:e)}a(ay,"transformShorthandNotation");function _d(n){let e=new Map(n);for(let t of iD)e.delete(t);return e}a(_d,"filterOntologyPrefixes");var kY=300,sD=3e4,MY="EXOCORTEX_SPARQL_TIMEOUT";function jY(){let n=process.env[MY];if(!n)return sD;try{let e=$Y(n);if(e!==null&&e>0)return e}catch{}return sD}a(jY,"getDefaultTimeout");function $Y(n){let e=n.trim().toLowerCase();if(!e)return null;if(e.endsWith("ms")){let r=parseInt(e.slice(0,-2),10);return isNaN(r)||r<=0?null:r}if(e.endsWith("s")){let r=parseInt(e.slice(0,-1),10);return isNaN(r)||r<=0?null:r*1e3}let t=parseInt(e,10);return isNaN(t)||t<=0?null:t*1e3}a($Y,"parseTimeoutSafe");function BY(n){if(!n)return kY;let e=parseInt(n.trim(),10);if(isNaN(e)||e<=0)throw new Ke(`Invalid cache TTL: "${n}". Must be a positive number (seconds).`,'exocortex sparql query --cache-ttl 600 "SELECT * WHERE { ?s ?p ?o }"');return e}a(BY,"parseCacheTtl");function UY(n){let e=n.trim().toLowerCase();if(e.endsWith("ms")){let r=parseInt(e.slice(0,-2),10);if(isNaN(r)||r<=0)throw new Ke(`Invalid timeout format: "${n}". Value must be a positive number.`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return r}if(e.endsWith("s")){let r=parseInt(e.slice(0,-1),10);if(isNaN(r)||r<=0)throw new Ke(`Invalid timeout format: "${n}". Value must be a positive number.`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return r*1e3}let t=parseInt(e,10);if(isNaN(t)||t<=0)throw new Ke(`Invalid timeout format: "${n}". Use formats like "30s", "5000ms", or just a number (seconds).`,'exocortex sparql query --timeout "30s" or --timeout "5000ms"');return t*1e3}a(UY,"parseTimeout");async function VE(n,e,t=Date.now()){let r,i=new Promise((s,o)=>{r=setTimeout(()=>{let c=Date.now()-t;o(new ad(e,c))},e),r&&typeof r=="object"&&"unref"in r&&r.unref()});return Promise.race([n,i])}a(VE,"executeWithTimeout");function VY(n,e){return e.concat([n])}a(VY,"collectAlso");function aD(){return new se("query").description("Execute SPARQL query against Obsidian vault").argument("[query]","SPARQL query string or path to .sparql file (optional if --template is used)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--also <path>","Additional vault to include in query (repeatable)",VY,[]).option("--format <type>","Output format: table|json|csv|ntriples","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--timeout <duration>","Query timeout (e.g., 30s, 5000ms)","30s").option("--dry-run","Validate query syntax without executing (no vault loading)").option("--explain","Show optimized query plan").option("--stats","Show execution statistics").option("--no-optimize","Disable query optimization").option("--use-cache","Use persistent triple cache (faster vault loading)").option("--cache-ttl <seconds>","Query result cache TTL in seconds (default: 300)").option("--no-cache","Bypass query result cache").option("--template <name>","Use a predefined query template").option("--param <params>","Template parameters (format: key=value,key2=value2)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);let r="";try{let i=Date.now(),s=e.timeout?UY(e.timeout):jY(),o=BY(e.cacheTtl),c=e.cache!==!1;if(e.template){let B=new ou,V=e.param?B.parseParamString(e.param):{};if(r=B.applyTemplate(e.template,V),t==="text"){let F=B.getTemplate(e.template);console.log(`\u{1F4CB} Using template: ${e.template}`),Object.keys(V).length>0&&console.log(` Parameters: ${Object.entries(V).map(([k,te])=>`${k}=${te}`).join(", ")}`),console.log()}}else if(n)r=qY(n);else throw new Ke("Either a query argument or --template flag is required.",'exocortex sparql query "SELECT * WHERE { ?s ?p ?o }" or exocortex sparql query --template tasks-by-date --param date=2024-01-15');if(e.dryRun){await WY(r,e,t);return}let l=(0,Sd.resolve)(e.vault);if(c){let V=await new ru().get(r,o);if(V!==null){let F=Date.now()-i;if(t==="json"){let k=X.success(V,{durationMs:F,itemCount:V.count||0,queryResultCacheHit:!0});console.log(JSON.stringify(k,null,2))}else{console.log(`\u{1F4E6} (cached) Query result loaded from cache in ${F}ms
606
606
  `);let k=V;k.type==="select"&&k.bindings?(console.log(`\u2705 Found ${k.bindings.length} result(s)
607
- `),zY(k.bindings,e.format)):k.type==="construct"&&k.triples&&(console.log(`\u2705 Generated ${k.triples.length} triple(s)
608
- `),HY(k.triples,e.format))}return}}if(!(0,cu.existsSync)(l))throw new Te(l);t==="text"&&console.log(`\u{1F4E6} Loading vault: ${l}...`);let u=Date.now(),f,d=!1;if(e.useCache){let V=await new Gn(l).loadOrBuild();f=V.triples,d=V.cacheHit,t==="text"&&d&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let B=new Nt(l);f=await new Gt.NoteToRDFConverter(B).convertVault()}let h=e.also||[];for(let B of h){let V=(0,Sd.resolve)(B);if(!(0,cu.existsSync)(V))throw new Te(V);t==="text"&&console.log(`\u{1F4E6} Loading additional vault: ${V}...`);let F=new Nt(V),te=await new Gt.NoteToRDFConverter(F).convertVault();f=f.concat(te),t==="text"&&console.log(` \u2795 Added ${te.length} triples from ${V}`)}let p=new Gt.InMemoryTripleStore;await p.addAll(f);let y=Date.now()-u;if(t==="text"){let B=d?" (from cache)":"",V=h.length>0?` (${h.length+1} vaults)`:"";console.log(`\u2705 Loaded ${f.length} triples in ${y}ms${B}${V}
609
- `),console.log("\u{1F50D} Parsing SPARQL query...")}let v=new Gt.ExoQLParser;r=ay(r),r=au(r);let b=_d(yd(l));for(let B of h){let V=_d(yd((0,Sd.resolve)(B)));for(let[F,k]of V)b.has(F)||b.set(F,k)}b.size>0&&v.setVaultPrefixes(b);let w=v.parse(r);if(w.type==="update"){t==="text"&&console.log("\u{1F504} Executing SPARQL UPDATE...");let B=Date.now(),V=new Gt.UpdateExecutor(p),F=await VE(V.execute(w),s,B),k=Date.now()-B,te=Date.now()-i;if(t==="json"){let Ye=X.success({query:r,type:"update",results:F},{durationMs:te,itemCount:F.length,loadDurationMs:y,execDurationMs:k,triplesScanned:f.length,cacheHit:d});console.log(JSON.stringify(Ye,null,2))}else KY(F,e.format),console.log(),console.log("\u26A0\uFE0F Changes applied to in-memory store only (not persisted to vault files)"),e.stats&&(console.log(`
607
+ `),HY(k.bindings,e.format)):k.type==="construct"&&k.triples&&(console.log(`\u2705 Generated ${k.triples.length} triple(s)
608
+ `),QY(k.triples,e.format))}return}}if(!(0,cu.existsSync)(l))throw new Te(l);t==="text"&&console.log(`\u{1F4E6} Loading vault: ${l}...`);let u=Date.now(),f,d=!1;if(e.useCache){let V=await new Gn(l).loadOrBuild();f=V.triples,d=V.cacheHit,t==="text"&&d&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let B=new Nt(l);f=await new Gt.NoteToRDFConverter(B).convertVault()}let h=e.also||[];for(let B of h){let V=(0,Sd.resolve)(B);if(!(0,cu.existsSync)(V))throw new Te(V);t==="text"&&console.log(`\u{1F4E6} Loading additional vault: ${V}...`);let F=new Nt(V),te=await new Gt.NoteToRDFConverter(F).convertVault();f=f.concat(te),t==="text"&&console.log(` \u2795 Added ${te.length} triples from ${V}`)}let p=new Gt.InMemoryTripleStore;await p.addAll(f);let y=Date.now()-u;if(t==="text"){let B=d?" (from cache)":"",V=h.length>0?` (${h.length+1} vaults)`:"";console.log(`\u2705 Loaded ${f.length} triples in ${y}ms${B}${V}
609
+ `),console.log("\u{1F50D} Parsing SPARQL query...")}let v=new Gt.ExoQLParser;r=ay(r),r=au(r);let b=_d(yd(l));for(let B of h){let V=_d(yd((0,Sd.resolve)(B)));for(let[F,k]of V)b.has(F)||b.set(F,k)}b.size>0&&v.setVaultPrefixes(b);let w=v.parse(r);if(w.type==="update"){t==="text"&&console.log("\u{1F504} Executing SPARQL UPDATE...");let B=Date.now(),V=new Gt.UpdateExecutor(p),F=await VE(V.execute(w),s,B),k=Date.now()-B,te=Date.now()-i;if(t==="json"){let Ye=X.success({query:r,type:"update",results:F},{durationMs:te,itemCount:F.length,loadDurationMs:y,execDurationMs:k,triplesScanned:f.length,cacheHit:d});console.log(JSON.stringify(Ye,null,2))}else YY(F,e.format),console.log(),console.log("\u26A0\uFE0F Changes applied to in-memory store only (not persisted to vault files)"),e.stats&&(console.log(`
610
610
  \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${y}ms${d?" (from cache)":""}`),console.log(` Query execution: ${k}ms`),console.log(` Total time: ${te}ms`),console.log(` Triples scanned: ${f.length}`));return}t==="text"&&console.log("\u{1F504} Translating to algebra...");let I=new Gt.ExoQLAlgebraTranslator().translate(w);if(!e.noOptimize&&I.type!=="construct")I=new Gt.AlgebraOptimizer().optimize(I);else if(!e.noOptimize&&I.type==="construct"){let B=new Gt.AlgebraOptimizer,V=I;I={...V,where:B.optimize(V.where)}}if(e.explain&&t==="text"){console.log("\u{1F4CA} Query Plan:");let B=new Gt.AlgebraSerializer;if(I.type==="construct"){let V=I;console.log("CONSTRUCT Template:"),console.log(" (template patterns)"),console.log("WHERE:"),console.log(B.toString(V.where))}else console.log(B.toString(I));console.log()}let $=Date.now(),q=new Gt.ExoQLQueryExecutor(p);typeof q.setTimeout=="function"&&q.setTimeout(s);let ce=t==="text"?new ry("Executing query",{delayMs:2e3}):null;if(q.isConstructQuery(I)){ce?.start();let B=await VE(q.executeConstruct(I),s,$),V=Date.now()-$;ce?.stop();let F=Date.now()-i;if(c){let k=new tu,te={type:"construct",count:B.length,triples:JSON.parse(k.formatJson(B))};await new ru().set(r,te,o)}if(t==="json"){let k=new tu,te={query:r,count:B.length,triples:JSON.parse(k.formatJson(B))},Ye=X.success(te,{durationMs:F,itemCount:B.length,loadDurationMs:y,execDurationMs:V,triplesScanned:f.length,cacheHit:d,queryResultCacheHit:!1});console.log(JSON.stringify(Ye,null,2))}else console.log(`\u2705 Generated ${B.length} triple(s) in ${V}ms
611
- `),B.length>0?GY(B,e.format):console.log("No triples generated."),e.stats&&(console.log(`
611
+ `),B.length>0?zY(B,e.format):console.log("No triples generated."),e.stats&&(console.log(`
612
612
  \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${y}ms${d?" (from cache)":""}`),console.log(` Query execution: ${V}ms`),console.log(` Total time: ${F}ms`),console.log(` Triples scanned: ${f.length}`),console.log(` Triples generated: ${B.length}`),e.useCache&&console.log(` Triple cache: ${d?"HIT":"MISS (rebuilt)"}`),c&&console.log(" Query result cache: MISS (cached for next run)"))}else{ce?.start();let B=await VE(q.executeAll(I),s,$),V=Date.now()-$;ce?.stop();let F=Date.now()-i,k=B.map(te=>te.toJSON());if(c){let te={type:"select",count:B.length,bindings:k};await new ru().set(r,te,o)}if(t==="json"){let te={query:r,count:B.length,bindings:k},Ye=X.success(te,{durationMs:F,itemCount:B.length,loadDurationMs:y,execDurationMs:V,triplesScanned:f.length,cacheHit:d,queryResultCacheHit:!1});console.log(JSON.stringify(Ye,null,2))}else console.log(`\u2705 Found ${B.length} result(s) in ${V}ms
613
- `),B.length>0?WY(B,e.format):console.log("No results found."),e.stats&&(console.log(`
614
- \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${y}ms${d?" (from cache)":""}`),console.log(` Query execution: ${V}ms`),console.log(` Total time: ${F}ms`),console.log(` Triples scanned: ${f.length}`),console.log(` Results returned: ${B.length}`),e.useCache&&console.log(` Triple cache: ${d?"HIT":"MISS (rebuilt)"}`),c&&console.log(" Query result cache: MISS (cached for next run)"))}}catch(i){cD(i,r,t)}})}a(aD,"sparqlQueryCommand");function cD(n,e,t){let r=new sy;if(r.classifyError(n)!=="unknown"){let s=r.enhanceError(n,e);if(t==="json"){let o=X.error("VALIDATION_INVALID_FORMAT",s.message,2,{context:{errorType:s.type,suggestions:s.suggestions,line:s.line,column:s.column,queryContext:s.context?{startLine:s.context.startLine,endLine:s.context.endLine,errorLine:s.context.errorLine}:void 0},recovery:{message:s.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(o,null,2)),process.exit(2)}else console.error(r.formatForText(s)),process.exit(2)}D.handle(n)}a(cD,"handleSparqlError");function VY(n){if(n.includes("SELECT")||n.includes("CONSTRUCT")||n.includes("INSERT")||n.includes("DELETE"))return n;let e=(0,Sd.resolve)(n);return(0,cu.existsSync)(e)?(0,cu.readFileSync)(e,"utf-8"):n}a(VY,"loadQuery");async function qY(n,e,t){if(e.explain){let i=new ny,s=await i.analyze(n,{includeAlgebraPlan:!0,optimize:!e.noOptimize});if(t==="json"){let o=X.success(s);console.log(JSON.stringify(o,null,2))}else s.valid?(console.log(`\u2705 Query syntax is valid
615
- `),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let r=new Gt.ExoQLParser;try{let i=r.parse(n);if(i.type!=="update"){let o=new Gt.ExoQLAlgebraTranslator().translate(i);if(!e.noOptimize&&o.type!=="construct")o=new Gt.AlgebraOptimizer().optimize(o);else if(!e.noOptimize&&o.type==="construct"){let c=new Gt.AlgebraOptimizer,l=o;o={...l,where:c.optimize(l.where)}}}if(t==="json"){let s=X.success({valid:!0,queryType:oD(i),message:"Query syntax is valid"});console.log(JSON.stringify(s,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${oD(i)}`)}catch(i){cD(i,n,t)}}a(qY,"executeDryRun");function oD(n){return n.type==="update"?"UPDATE":"queryType"in n?n.queryType:"UNKNOWN"}a(oD,"getQueryType");function WY(n,e){switch(e){case"json":let t=new eu;console.log(t.format(n));break;case"csv":let r=new Hg;console.log(r.format(n));break;case"table":default:let i=new Zl;console.log(i.format(n));break}}a(WY,"formatSelectResults");function GY(n,e){let t=new tu;switch(e){case"json":console.log(t.formatJson(n));break;case"ntriples":console.log(t.formatNTriples(n));break;case"table":default:console.log(t.formatTable(n));break}}a(GY,"formatConstructResults");function zY(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"csv":if(n.length===0){console.log("");return}let t=Object.keys(n[0]);console.log(t.join(","));for(let i of n){let s=t.map(o=>{let c=i[o];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(n.length===0){console.log("No results.");return}let r=Object.keys(n[0]);console.log(r.join(" ")),console.log(r.map(()=>"---").join(" "));for(let i of n){let s=r.map(o=>String(i[o]??""));console.log(s.join(" "))}break}}a(zY,"formatCachedSelectResults");function HY(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"ntriples":for(let t of n)console.log(`<${t.subject}> <${t.predicate}> ${QY(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of n)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}a(HY,"formatCachedConstructResults");function QY(n){return oy.formatObject(n)}a(QY,"formatNTriplesObject");function KY(n,e){for(let t of n){let r=[`${t.type.toUpperCase()}`];switch(t.inserted!==void 0&&r.push(`inserted: ${t.inserted}`),t.deleted!==void 0&&r.push(`deleted: ${t.deleted}`),r.push(t.success?"OK":"FAILED"),e){case"json":console.log(JSON.stringify(t,null,2));break;case"csv":n.indexOf(t)===0&&console.log("type,inserted,deleted,success"),console.log(`${t.type},${t.inserted??""},${t.deleted??""},${t.success}`);break;case"table":default:console.log(`\u2705 ${r.join(" | ")}`);break}}}a(KY,"formatUpdateResults");var lD=require("fs"),uD=require("path"),Os=H(Pt());function fD(){return new se("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").option("--no-inference","Disable RDFS subClassOf inference materialization").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,uD.resolve)(n.vault);if(!(0,lD.existsSync)(t))throw new Te(t);let r=new Gn(t),i=r.getCachePath();n.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await r.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),o=await r.buildCacheWithValidation({strict:n.strict??!1}),c=0;if(n.inference!==!1){let{triples:u}=await r.loadOrBuild(),f=new Os.InMemoryTripleStore;await f.addAll(u),c=await new Os.RDFSInferenceEngine().materialize(f);let h=new Os.NonInheritablePropertyRegistry;await h.initialize(f);let p=new Os.PropertyCardinalityRegistry;await p.initialize(f);let v=await new Os.PrototypeChainMaterializer(h,p).materialize(f);if(c+=v,c>0){let b=await f.match();await r.saveTriples(b),o.tripleCount+=c}e==="text"&&c>0&&console.log(`\u{1F9E0} Materialized ${c} inferred triples (RDFS + prototype chain)`)}let l=Date.now()-s;if(e==="json"){let u={action:"build",cachePath:i,tripleCount:o.tripleCount,durationMs:o.durationMs},f={summary:o.summary,skippedFiles:o.skippedFiles};if(n.stats){let d=await r.getCacheStats();if(d){let h={tripleCount:d.tripleCount,createdAt:d.createdAt.toISOString(),isValid:d.isValid,sizeBytes:d.sizeBytes,cachePath:i},p=X.success({cache:u,stats:h,validation:f},{durationMs:l});console.log(JSON.stringify(p,null,2))}}else{let d=X.success({cache:u,validation:f},{durationMs:l});console.log(JSON.stringify(d,null,2))}}else{if(o.skippedFiles.length>0){console.log(`
613
+ `),B.length>0?GY(B,e.format):console.log("No results found."),e.stats&&(console.log(`
614
+ \u{1F4CA} Execution Statistics:`),console.log(` Vault loading: ${y}ms${d?" (from cache)":""}`),console.log(` Query execution: ${V}ms`),console.log(` Total time: ${F}ms`),console.log(` Triples scanned: ${f.length}`),console.log(` Results returned: ${B.length}`),e.useCache&&console.log(` Triple cache: ${d?"HIT":"MISS (rebuilt)"}`),c&&console.log(" Query result cache: MISS (cached for next run)"))}}catch(i){cD(i,r,t)}})}a(aD,"sparqlQueryCommand");function cD(n,e,t){let r=new sy;if(r.classifyError(n)!=="unknown"){let s=r.enhanceError(n,e);if(t==="json"){let o=X.error("VALIDATION_INVALID_FORMAT",s.message,2,{context:{errorType:s.type,suggestions:s.suggestions,line:s.line,column:s.column,queryContext:s.context?{startLine:s.context.startLine,endLine:s.context.endLine,errorLine:s.context.errorLine}:void 0},recovery:{message:s.suggestions?.[0]||"Check query syntax"}});console.log(JSON.stringify(o,null,2)),process.exit(2)}else console.error(r.formatForText(s)),process.exit(2)}D.handle(n)}a(cD,"handleSparqlError");function qY(n){if(n.includes("SELECT")||n.includes("CONSTRUCT")||n.includes("INSERT")||n.includes("DELETE"))return n;let e=(0,Sd.resolve)(n);return(0,cu.existsSync)(e)?(0,cu.readFileSync)(e,"utf-8"):n}a(qY,"loadQuery");async function WY(n,e,t){if(e.explain){let i=new ny,s=await i.analyze(n,{includeAlgebraPlan:!0,optimize:!e.noOptimize});if(t==="json"){let o=X.success(s);console.log(JSON.stringify(o,null,2))}else s.valid?(console.log(`\u2705 Query syntax is valid
615
+ `),console.log(i.formatAnalysis(s,"text"))):(console.log(i.formatAnalysis(s,"text")),process.exit(2));return}let r=new Gt.ExoQLParser;try{let i=r.parse(n);if(i.type!=="update"){let o=new Gt.ExoQLAlgebraTranslator().translate(i);if(!e.noOptimize&&o.type!=="construct")o=new Gt.AlgebraOptimizer().optimize(o);else if(!e.noOptimize&&o.type==="construct"){let c=new Gt.AlgebraOptimizer,l=o;o={...l,where:c.optimize(l.where)}}}if(t==="json"){let s=X.success({valid:!0,queryType:oD(i),message:"Query syntax is valid"});console.log(JSON.stringify(s,null,2))}else console.log("\u2705 Query syntax is valid"),console.log(` Query type: ${oD(i)}`)}catch(i){cD(i,n,t)}}a(WY,"executeDryRun");function oD(n){return n.type==="update"?"UPDATE":"queryType"in n?n.queryType:"UNKNOWN"}a(oD,"getQueryType");function GY(n,e){switch(e){case"json":let t=new eu;console.log(t.format(n));break;case"csv":let r=new Hg;console.log(r.format(n));break;case"table":default:let i=new Zl;console.log(i.format(n));break}}a(GY,"formatSelectResults");function zY(n,e){let t=new tu;switch(e){case"json":console.log(t.formatJson(n));break;case"ntriples":console.log(t.formatNTriples(n));break;case"table":default:console.log(t.formatTable(n));break}}a(zY,"formatConstructResults");function HY(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"csv":if(n.length===0){console.log("");return}let t=Object.keys(n[0]);console.log(t.join(","));for(let i of n){let s=t.map(o=>{let c=i[o];return c==null?"":String(c).includes(",")?`"${c}"`:String(c)});console.log(s.join(","))}break;case"table":default:if(n.length===0){console.log("No results.");return}let r=Object.keys(n[0]);console.log(r.join(" ")),console.log(r.map(()=>"---").join(" "));for(let i of n){let s=r.map(o=>String(i[o]??""));console.log(s.join(" "))}break}}a(HY,"formatCachedSelectResults");function QY(n,e){switch(e){case"json":console.log(JSON.stringify(n,null,2));break;case"ntriples":for(let t of n)console.log(`<${t.subject}> <${t.predicate}> ${KY(t.object)} .`);break;case"table":default:console.log("Subject Predicate Object"),console.log("--- --- ---");for(let t of n)console.log(`${t.subject} ${t.predicate} ${t.object}`);break}}a(QY,"formatCachedConstructResults");function KY(n){return oy.formatObject(n)}a(KY,"formatNTriplesObject");function YY(n,e){for(let t of n){let r=[`${t.type.toUpperCase()}`];switch(t.inserted!==void 0&&r.push(`inserted: ${t.inserted}`),t.deleted!==void 0&&r.push(`deleted: ${t.deleted}`),r.push(t.success?"OK":"FAILED"),e){case"json":console.log(JSON.stringify(t,null,2));break;case"csv":n.indexOf(t)===0&&console.log("type,inserted,deleted,success"),console.log(`${t.type},${t.inserted??""},${t.deleted??""},${t.success}`);break;case"table":default:console.log(`\u2705 ${r.join(" | ")}`);break}}}a(YY,"formatUpdateResults");var lD=require("fs"),uD=require("path"),Os=H(Pt());function fD(){return new se("index").description("Build or refresh the triple cache for faster SPARQL queries").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--stats","Show cache statistics after building").option("--force","Force rebuild even if cache is valid").option("--strict","Fail on first invalid IRI instead of skipping").option("--no-inference","Disable RDFS subClassOf inference materialization").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,uD.resolve)(n.vault);if(!(0,lD.existsSync)(t))throw new Te(t);let r=new Gn(t),i=r.getCachePath();n.force&&(e==="text"&&console.log("\u{1F5D1}\uFE0F Invalidating existing cache..."),await r.invalidate()),e==="text"&&console.log(`\u{1F4E6} Building triple cache for: ${t}...`);let s=Date.now(),o=await r.buildCacheWithValidation({strict:n.strict??!1}),c=0;if(n.inference!==!1){let{triples:u}=await r.loadOrBuild(),f=new Os.InMemoryTripleStore;await f.addAll(u),c=await new Os.RDFSInferenceEngine().materialize(f);let h=new Os.NonInheritablePropertyRegistry;await h.initialize(f);let p=new Os.PropertyCardinalityRegistry;await p.initialize(f);let v=await new Os.PrototypeChainMaterializer(h,p).materialize(f);if(c+=v,c>0){let b=await f.match();await r.saveTriples(b),o.tripleCount+=c}e==="text"&&c>0&&console.log(`\u{1F9E0} Materialized ${c} inferred triples (RDFS + prototype chain)`)}let l=Date.now()-s;if(e==="json"){let u={action:"build",cachePath:i,tripleCount:o.tripleCount,durationMs:o.durationMs},f={summary:o.summary,skippedFiles:o.skippedFiles};if(n.stats){let d=await r.getCacheStats();if(d){let h={tripleCount:d.tripleCount,createdAt:d.createdAt.toISOString(),isValid:d.isValid,sizeBytes:d.sizeBytes,cachePath:i},p=X.success({cache:u,stats:h,validation:f},{durationMs:l});console.log(JSON.stringify(p,null,2))}}else{let d=X.success({cache:u,validation:f},{durationMs:l});console.log(JSON.stringify(d,null,2))}}else{if(o.skippedFiles.length>0){console.log(`
616
616
  \u26A0\uFE0F Files skipped due to IRI issues:`);for(let u of o.skippedFiles)console.log(` - ${u.path}`),console.log(` ${u.reason}`);console.log("")}if(console.log(`\u2705 Indexed ${o.summary.indexed} files, skipped ${o.summary.skipped} (total: ${o.summary.total})`),console.log(`\u{1F4CA} Created cache with ${o.tripleCount.toLocaleString()} triples at ${i}`),console.log(`\u23F1\uFE0F Build time: ${o.durationMs}ms`),n.stats){let u=await r.getCacheStats();u&&(console.log(`
617
- \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${YY(u.sizeBytes)}`))}}}catch(t){D.handle(t)}})}a(fD,"sparqlIndexCommand");function YY(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}a(YY,"formatBytes");function dD(){return new se("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=new ou,r=t.listTemplates();if(e==="json"){let i=X.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){D.handle(t)}})}a(dD,"sparqlTemplatesCommand");var SD=require("path");var _r=H(go()),aa=H(require("path"));var cc=H(Pt());var Ot=class{constructor(e){this.rootPath=e}static{a(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await _r.default.pathExists(t))throw new cc.FileNotFoundError(e);return _r.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return _r.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await _r.default.pathExists(r))throw new cc.FileAlreadyExistsError(e);return await _r.default.ensureDir(aa.default.dirname(r)),await _r.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await _r.default.pathExists(r))throw new cc.FileNotFoundError(e);await _r.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await _r.default.ensureDir(aa.default.dirname(r)),await _r.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await _r.default.pathExists(t))throw new cc.FileNotFoundError(e);await _r.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await _r.default.pathExists(r))throw new cc.FileNotFoundError(e);await _r.default.ensureDir(aa.default.dirname(i)),await _r.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await _r.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await _r.default.pathExists(t)?(await _r.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=aa.default.join(t,"**/*.md");return(await Jl(r,{nodir:!0})).map(o=>aa.default.relative(this.rootPath,o))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return aa.default.isAbsolute(e)?e:aa.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=ar.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(o=>this.normalizeValue(o)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var vd=H(require("path")),qE=H(go());var lu=class{constructor(e){this.vaultRoot=e}static{a(this,"PathResolver")}resolve(e){if(!vd.default.isAbsolute(e))return vd.default.resolve(this.vaultRoot,e);let t=vd.default.resolve(e),r=vd.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Ke(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!qE.default.existsSync(e))throw new sd(e);if(!qE.default.statSync(e).isFile())throw new Ke(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Ke(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var _D=H(Pt());var hD=H(Pt());var Ki=class{static{a(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return hD.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
617
+ \u{1F4CA} Cache Statistics:`),console.log(` Triples: ${u.tripleCount.toLocaleString()}`),console.log(` Created: ${u.createdAt.toISOString()}`),console.log(` Valid: ${u.isValid?"\u2705 Yes":"\u274C No"}`),console.log(` Size: ${XY(u.sizeBytes)}`))}}}catch(t){D.handle(t)}})}a(fD,"sparqlIndexCommand");function XY(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}a(XY,"formatBytes");function dD(){return new se("templates").description("List available SPARQL query templates").option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=new ou,r=t.listTemplates();if(e==="json"){let i=X.success({templates:r,count:r.length});console.log(JSON.stringify(i,null,2))}else console.log(t.formatList("text"))}catch(t){D.handle(t)}})}a(dD,"sparqlTemplatesCommand");var SD=require("path");var _r=H(go()),aa=H(require("path"));var cc=H(Pt());var Ot=class{constructor(e){this.rootPath=e}static{a(this,"NodeFsAdapter")}async readFile(e){let t=this.resolvePath(e);if(!await _r.default.pathExists(t))throw new cc.FileNotFoundError(e);return _r.default.readFile(t,"utf-8")}async fileExists(e){let t=this.resolvePath(e);return _r.default.pathExists(t)}async getFileMetadata(e){let t=await this.readFile(e);return this.extractFrontmatter(t)}async createFile(e,t){let r=this.resolvePath(e);if(await _r.default.pathExists(r))throw new cc.FileAlreadyExistsError(e);return await _r.default.ensureDir(aa.default.dirname(r)),await _r.default.writeFile(r,t,"utf-8"),e}async updateFile(e,t){let r=this.resolvePath(e);if(!await _r.default.pathExists(r))throw new cc.FileNotFoundError(e);await _r.default.writeFile(r,t,"utf-8")}async writeFile(e,t){let r=this.resolvePath(e);await _r.default.ensureDir(aa.default.dirname(r)),await _r.default.writeFile(r,t,"utf-8")}async deleteFile(e){let t=this.resolvePath(e);if(!await _r.default.pathExists(t))throw new cc.FileNotFoundError(e);await _r.default.remove(t)}async renameFile(e,t){let r=this.resolvePath(e),i=this.resolvePath(t);if(!await _r.default.pathExists(r))throw new cc.FileNotFoundError(e);await _r.default.ensureDir(aa.default.dirname(i)),await _r.default.move(r,i)}async createDirectory(e){let t=this.resolvePath(e);await _r.default.ensureDir(t)}async directoryExists(e){let t=this.resolvePath(e);return await _r.default.pathExists(t)?(await _r.default.stat(t)).isDirectory():!1}async getMarkdownFiles(e){let t=e?this.resolvePath(e):this.rootPath,r=aa.default.join(t,"**/*.md");return(await Jl(r,{nodir:!0})).map(o=>aa.default.relative(this.rootPath,o))}async findFilesByMetadata(e){let t=await this.getMarkdownFiles(),r=[];for(let i of t)try{let s=await this.getFileMetadata(i);this.matchesQuery(s,e)&&r.push(i)}catch{continue}return r}async findFileByUID(e){let t=await this.findFilesByMetadata({exo__Asset_uid:e});return t.length>0?t[0]:null}resolvePath(e){return aa.default.isAbsolute(e)?e:aa.default.join(this.rootPath,e)}extractFrontmatter(e){let t=/^---\n([\s\S]*?)\n---/,r=e.match(t);if(!r)return{};try{let i=ar.load(r[1]);return typeof i=="object"&&i!==null?i:{}}catch{return{}}}matchesQuery(e,t){for(let[r,i]of Object.entries(t)){let s=e[r];if(Array.isArray(s)){if(!s.some(o=>this.normalizeValue(o)===this.normalizeValue(i)))return!1}else if(this.normalizeValue(s)!==this.normalizeValue(i))return!1}return!0}normalizeValue(e){return e==null?"":String(e).replace(/["'[\]]/g,"").trim()}};var vd=H(require("path")),qE=H(go());var lu=class{constructor(e){this.vaultRoot=e}static{a(this,"PathResolver")}resolve(e){if(!vd.default.isAbsolute(e))return vd.default.resolve(this.vaultRoot,e);let t=vd.default.resolve(e),r=vd.default.resolve(this.vaultRoot);if(!t.startsWith(r))throw new Ke(`File path ${e} is outside vault root ${this.vaultRoot}`,"Provide a file path within the vault directory.",{filepath:e,vaultRoot:this.vaultRoot});return t}validate(e){if(!qE.default.existsSync(e))throw new sd(e);if(!qE.default.statSync(e).isFile())throw new Ke(`Not a file: ${e}`,"Provide a path to a file, not a directory.",{filepath:e});if(!e.endsWith(".md"))throw new Ke(`Not a Markdown file: ${e}`,"Provide a path to a .md file.",{filepath:e})}getVaultRoot(){return this.vaultRoot}};var _D=H(Pt());var hD=H(Pt());var Ki=class{static{a(this,"BaseCommandExecutor")}constructor(e){this.pathResolver=e.pathResolver,this.fsAdapter=e.fsAdapter,this.frontmatterService=e.frontmatterService,this.dryRun=e.dryRun}resolveAndValidate(e){let t=this.pathResolver.resolve(e);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");return{resolvedPath:t,relativePath:r}}getCurrentTimestamp(){return hD.DateFormatter.toLocalTimestamp(new Date)}isAssetArchived(e){if(e?.exo__Asset_isArchived===!0)return!0;let t=e?.archived;if(t==null)return!1;if(typeof t=="boolean")return t;if(typeof t=="number")return t!==0;if(typeof t=="string"){let r=t.toLowerCase().trim();return r==="true"||r==="yes"||r==="1"}return!1}extractAliasesFromFrontmatter(e){let t=e.match(/aliases:\s*\n((?: - .*\n?)*)/);return t?t[1].split(`
618
618
  `).filter(i=>i.trim()).map(i=>i.replace(/^\s*-\s*/,"").trim()):[]}};var bd=class extends Ki{static{a(this,"StatusCommandExecutor")}constructor(e){super(e)}async executeStart(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=this.getCurrentTimestamp();this.dryRun&&(console.log(`[dry-run] Would start: ${e}`),console.log('[dry-run] ems__Effort_status: "[[ems__EffortStatusDoing]]"'),console.log(`[dry-run] ems__Effort_startTimestamp: ${r}`),console.log(`
619
619
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0));let i=await this.fsAdapter.readFile(t),s=this.frontmatterService.updateProperty(i,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",r),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Started: ${e}`),console.log(" Status: Doing"),console.log(` Start time: ${r}`),process.exit(0)}catch(t){D.handle(t)}}async executeComplete(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=this.getCurrentTimestamp();this.dryRun&&(console.log(`[dry-run] Would complete: ${e}`),console.log('[dry-run] ems__Effort_status: "[[ems__EffortStatusDone]]"'),console.log(`[dry-run] ems__Effort_endTimestamp: ${r}`),console.log(`[dry-run] ems__Effort_resolutionTimestamp: ${r}`),console.log(`
620
620
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0));let i=await this.fsAdapter.readFile(t),s=this.frontmatterService.updateProperty(i,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",r),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",r),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Completed: ${e}`),console.log(" Status: Done"),console.log(` Completion time: ${r}`),process.exit(0)}catch(t){D.handle(t)}}async executeTrash(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=this.getCurrentTimestamp();this.dryRun&&(console.log(`[dry-run] Would trash: ${e}`),console.log('[dry-run] ems__Effort_status: "[[ems__EffortStatusTrashed]]"'),console.log(`[dry-run] ems__Effort_resolutionTimestamp: ${r}`),console.log(`
621
621
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0));let i=await this.fsAdapter.readFile(t),s=this.frontmatterService.updateProperty(i,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",r),await this.fsAdapter.updateFile(t,s),console.log(`\u2705 Trashed: ${e}`),console.log(" Status: Trashed"),console.log(` Resolution time: ${r}`),process.exit(0)}catch(t){D.handle(t)}}async executeArchive(e){try{let{relativePath:t}=this.resolveAndValidate(e);this.dryRun&&(console.log(`[dry-run] Would archive: ${e}`),console.log("[dry-run] archived: true"),console.log("[dry-run] aliases: removed"),console.log(`
622
622
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0));let r=await this.fsAdapter.readFile(t),i=this.frontmatterService.updateProperty(r,"archived","true");i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(t,i),console.log(`\u2705 Archived: ${e}`),console.log(" Archived: true"),console.log(" Aliases removed"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToBacklog(e){try{await this.updateStatus(e,"ems__EffortStatusBacklog","Backlog"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToAnalysis(e){try{await this.updateStatus(e,"ems__EffortStatusAnalysis","Analysis"),process.exit(0)}catch(t){D.handle(t)}}async executeMoveToToDo(e){try{await this.updateStatus(e,"ems__EffortStatusToDo","ToDo"),process.exit(0)}catch(t){D.handle(t)}}async updateStatus(e,t,r){let{relativePath:i}=this.resolveAndValidate(e);if(this.dryRun){console.log(`[dry-run] Would move to ${r}: ${e}`),console.log(`[dry-run] ems__Effort_status: "[[${t}]]"`),console.log(`
623
- \u{1F4A1} Run without --dry-run to apply changes`);return}let s=await this.fsAdapter.readFile(i),o=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${t}]]"`);await this.fsAdapter.updateFile(i,o),console.log(`\u2705 Moved to ${r}: ${e}`),console.log(` Status: ${r}`)}};var Vr=[];for(let n=0;n<256;++n)Vr.push((n+256).toString(16).slice(1));function pD(n,e=0){return(Vr[n[e+0]]+Vr[n[e+1]]+Vr[n[e+2]]+Vr[n[e+3]]+"-"+Vr[n[e+4]]+Vr[n[e+5]]+"-"+Vr[n[e+6]]+Vr[n[e+7]]+"-"+Vr[n[e+8]]+Vr[n[e+9]]+"-"+Vr[n[e+10]]+Vr[n[e+11]]+Vr[n[e+12]]+Vr[n[e+13]]+Vr[n[e+14]]+Vr[n[e+15]]).toLowerCase()}a(pD,"unsafeStringify");var mD=require("node:crypto");var ly=new Uint8Array(256),cy=ly.length;function WE(){return cy>ly.length-16&&((0,mD.randomFillSync)(ly),cy=0),ly.slice(cy,cy+=16)}a(WE,"rng");var gD=require("node:crypto"),GE={randomUUID:gD.randomUUID};function XY(n,e,t){n=n||{};let r=n.random??n.rng?.()??WE();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return pD(r)}a(XY,"_v4");function JY(n,e,t){return GE.randomUUID&&!e&&!n?GE.randomUUID():XY(n,e,t)}a(JY,"v4");var wd=JY;var uu=H(Pt());var Ed=class extends Ki{static{a(this,"AssetCreationExecutor")}constructor(e){super(e)}async executeCreateTask(e,t,r={}){try{await this.createAsset(e,t,"ems__Task",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateMeeting(e,t,r={}){try{await this.createAsset(e,t,"ems__Meeting",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateProject(e,t,r={}){try{await this.createAsset(e,t,"ems__Project",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateArea(e,t,r={}){try{await this.createAsset(e,t,"ems__Area",r),process.exit(0)}catch(i){D.handle(i)}}async createAsset(e,t,r,i={}){if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let s=t.trim(),{relativePath:o}=this.resolveAndValidate(e);if(await this.fsAdapter.fileExists(o))throw new uu.FileAlreadyExistsError(e);let l=wd(),u=this.buildAssetFrontmatter(r,l,s,i),f=uu.MetadataHelpers.buildFileContent(u);if(this.dryRun){console.log(`[dry-run] Would create ${this.getAssetTypeName(r)}: ${e}`),console.log(`[dry-run] UID: ${l}`),console.log(`[dry-run] Label: ${s}`),console.log(`[dry-run] Class: ${r}`),console.log(`
623
+ \u{1F4A1} Run without --dry-run to apply changes`);return}let s=await this.fsAdapter.readFile(i),o=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${t}]]"`);await this.fsAdapter.updateFile(i,o),console.log(`\u2705 Moved to ${r}: ${e}`),console.log(` Status: ${r}`)}};var Vr=[];for(let n=0;n<256;++n)Vr.push((n+256).toString(16).slice(1));function pD(n,e=0){return(Vr[n[e+0]]+Vr[n[e+1]]+Vr[n[e+2]]+Vr[n[e+3]]+"-"+Vr[n[e+4]]+Vr[n[e+5]]+"-"+Vr[n[e+6]]+Vr[n[e+7]]+"-"+Vr[n[e+8]]+Vr[n[e+9]]+"-"+Vr[n[e+10]]+Vr[n[e+11]]+Vr[n[e+12]]+Vr[n[e+13]]+Vr[n[e+14]]+Vr[n[e+15]]).toLowerCase()}a(pD,"unsafeStringify");var mD=require("node:crypto");var ly=new Uint8Array(256),cy=ly.length;function WE(){return cy>ly.length-16&&((0,mD.randomFillSync)(ly),cy=0),ly.slice(cy,cy+=16)}a(WE,"rng");var gD=require("node:crypto"),GE={randomUUID:gD.randomUUID};function JY(n,e,t){n=n||{};let r=n.random??n.rng?.()??WE();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let i=0;i<16;++i)e[t+i]=r[i];return e}return pD(r)}a(JY,"_v4");function ZY(n,e,t){return GE.randomUUID&&!e&&!n?GE.randomUUID():JY(n,e,t)}a(ZY,"v4");var wd=ZY;var uu=H(Pt());var Ed=class extends Ki{static{a(this,"AssetCreationExecutor")}constructor(e){super(e)}async executeCreateTask(e,t,r={}){try{await this.createAsset(e,t,"ems__Task",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateMeeting(e,t,r={}){try{await this.createAsset(e,t,"ems__Meeting",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateProject(e,t,r={}){try{await this.createAsset(e,t,"ems__Project",r),process.exit(0)}catch(i){D.handle(i)}}async executeCreateArea(e,t,r={}){try{await this.createAsset(e,t,"ems__Area",r),process.exit(0)}catch(i){D.handle(i)}}async createAsset(e,t,r,i={}){if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let s=t.trim(),{relativePath:o}=this.resolveAndValidate(e);if(await this.fsAdapter.fileExists(o))throw new uu.FileAlreadyExistsError(e);let l=wd(),u=this.buildAssetFrontmatter(r,l,s,i),f=uu.MetadataHelpers.buildFileContent(u);if(this.dryRun){console.log(`[dry-run] Would create ${this.getAssetTypeName(r)}: ${e}`),console.log(`[dry-run] UID: ${l}`),console.log(`[dry-run] Label: ${s}`),console.log(`[dry-run] Class: ${r}`),console.log(`
624
624
  \u{1F4A1} Run without --dry-run to apply changes`);return}await this.fsAdapter.createFile(o,f),console.log(`\u2705 Created ${this.getAssetTypeName(r)}: ${e}`),console.log(` UID: ${l}`),console.log(` Label: ${s}`),console.log(` Class: ${r}`)}buildAssetFrontmatter(e,t,r,i={}){let s=uu.DateFormatter.toLocalTimestamp(new Date),o={exo__Asset_isDefinedBy:'"[[Ontology/EMS]]"',exo__Asset_uid:t,exo__Asset_label:r,exo__Asset_createdAt:s,exo__Instance_class:[`"[[${e}]]"`],aliases:[r]};return(e==="ems__Task"||e==="ems__Project"||e==="ems__Meeting")&&(o.ems__Effort_status='"[[ems__EffortStatusDraft]]"'),i.prototype&&(o.exo__Asset_prototype=`"[[${i.prototype}]]"`),i.area&&(o.ems__Effort_area=`"[[${i.area}]]"`),i.parent&&(o.ems__Effort_parent=`"[[${i.parent}]]"`),o}getAssetTypeName(e){return{ems__Task:"task",ems__Meeting:"meeting",ems__Project:"project",ems__Area:"area"}[e]||"asset"}};var zE=H(require("path"));var yD=H(Pt());var Td=class extends Ki{static{a(this,"PropertyCommandExecutor")}constructor(e){super(e)}async executeRenameToUid(e){try{let{relativePath:t}=this.resolveAndValidate(e),r=await this.fsAdapter.getFileMetadata(t);if(!r.exo__Asset_uid)throw new Error("Asset missing exo__Asset_uid property");let i=zE.default.basename(t,".md"),s=r.exo__Asset_uid;i===s&&(console.log(`\u2705 Already renamed: ${e}`),console.log(` Current filename matches UID: ${s}.md`),process.exit(0));let o=!r.exo__Asset_label||r.exo__Asset_label.trim()==="",c=this.isAssetArchived(r),l=zE.default.dirname(t),u=l!=="."?`${l}/${s}.md`:`${s}.md`;if(this.dryRun){o&&(console.log(`[dry-run] Would update label: "${i}"`),c||console.log(`[dry-run] Would add alias: "${i}"`)),console.log(`[dry-run] Would rename: ${t} -> ${u}`);let d=await id(this.pathResolver.getVaultRoot(),i,s,{dryRun:!0,excludeRelPath:t});console.log(`[dry-run] Would update links in ${d.filesModified} file(s)`+(d.filesModified>0?` (${d.replacements} replacement(s))`:"")),console.log(`
625
625
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0)}if(o){let d=await this.fsAdapter.readFile(t),h=this.frontmatterService.updateProperty(d,"exo__Asset_label",i),p=h;c||(p=this.frontmatterService.updateProperty(h,"aliases",`
626
626
  - ${i}`)),await this.fsAdapter.updateFile(t,p),console.log(` Updated label: "${i}"`)}let f=await id(this.pathResolver.getVaultRoot(),i,s,{dryRun:!1,excludeRelPath:t});await this.fsAdapter.renameFile(t,u),console.log("\u2705 Renamed to UID format"),console.log(` Old: ${t}`),console.log(` New: ${u}`),console.log(` Updated links in ${f.filesModified} file(s)`+(f.filesModified>0?` (${f.replacements} replacement(s))`:"")),process.exit(0)}catch(t){D.handle(t)}}async executeUpdateLabel(e,t){try{if(!t||t.trim().length===0)throw new Error("Label cannot be empty");let r=t.trim(),{relativePath:i}=this.resolveAndValidate(e),s=await this.fsAdapter.readFile(i),o=this.frontmatterService.updateProperty(s,"exo__Asset_label",r),c=this.frontmatterService.parse(o),l=this.extractAliasesFromFrontmatter(c.content);if(l.includes(r)||(l.length===0?o=this.frontmatterService.updateProperty(o,"aliases",`
@@ -630,27 +630,27 @@ Available prefixes: ${u}`,this.wellKnownPrefixes[r]&&c.push(`Add: PREFIX ${r}: <
630
630
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0)}await this.fsAdapter.updateFile(i,o),console.log("\u2705 Updated label"),console.log(` File: ${e}`),console.log(` New label: "${r}"`),console.log(" Aliases synchronized"),process.exit(0)}catch(r){D.handle(r)}}async executeSchedule(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedStartTimestamp"),process.exit(0)}catch(r){D.handle(r)}}async executeSetDeadline(e,t){try{await this.updatePlannedTimestamp(e,t,"ems__Effort_plannedEndTimestamp"),process.exit(0)}catch(r){D.handle(r)}}async updatePlannedTimestamp(e,t,r){let{relativePath:i}=this.resolveAndValidate(e);if(!await this.fsAdapter.fileExists(i))throw new Error(`File not found: ${e}`);if(!/^\d{4}-\d{2}-\d{2}$/.test(t))throw new Error(`Invalid date format: ${t}. Expected YYYY-MM-DD (e.g., 2025-11-25)`);let o=yD.DateFormatter.toTimestampAtStartOfDay(t),c=r==="ems__Effort_plannedStartTimestamp"?"Scheduled":"Set deadline for";if(this.dryRun){console.log(`[dry-run] Would ${c==="Scheduled"?"schedule":"set deadline for"}: ${e}`),console.log(`[dry-run] ${r}: ${o}`),console.log(`
631
631
  \u{1F4A1} Run without --dry-run to apply changes`);return}let l=await this.fsAdapter.readFile(i),u=this.frontmatterService.updateProperty(l,r,o);await this.fsAdapter.writeFile(i,u),console.log(`\u2705 ${c}: ${e}`),console.log(` Date: ${t}`),console.log(` Timestamp: ${o}`)}};var ca=H(require("path"));var Ad=class extends Ki{static{a(this,"FolderRepairExecutor")}constructor(e){super(e)}async executeRepairFolder(e){try{let{relativePath:t}=this.resolveAndValidate(e),i=(await this.fsAdapter.getFileMetadata(t))?.exo__Asset_isDefinedBy;if(!i)throw new Error("Cannot determine expected folder: missing exo__Asset_isDefinedBy");let s=this.extractReference(i);if(!s)throw new Error("Cannot determine expected folder: invalid exo__Asset_isDefinedBy format");let o=await this.findReferencedFile(s,t);if(!o)throw new Error(`Cannot determine expected folder: referenced asset not found: ${s}`);let c=ca.default.dirname(o),l=c==="."?"":c,u=ca.default.dirname(t),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return console.log("\u2705 Already in correct folder"),console.log(` File: ${e}`),console.log(` Folder: ${l||"(root)"}`),process.exit(0),{moved:!1,oldPath:t,newPath:t,expectedFolder:l};if(this.dryRun){let y=ca.default.basename(t),v=l?`${l}/${y}`:y;return console.log("\u{1F50D} DRY RUN: Preview of changes (not applied)"),console.log(` File: ${e}`),console.log(` Current folder: ${f||"(root)"}`),console.log(` Expected folder: ${l||"(root)"}`),console.log(` Would move to: ${v}`),console.log(`
632
632
  \u{1F4A1} Run without --dry-run to apply changes`),process.exit(0),{moved:!1,oldPath:t,newPath:v,expectedFolder:l}}let d=ca.default.basename(t),h=l?`${l}/${d}`:d;if(await this.fsAdapter.fileExists(h))throw new Error(`Cannot move file: ${h} already exists`);return l&&(await this.fsAdapter.directoryExists(l)||await this.fsAdapter.createDirectory(l)),await this.fsAdapter.renameFile(t,h),console.log("\u2705 Moved to correct folder"),console.log(` Old path: ${t}`),console.log(` New path: ${h}`),console.log(` Expected folder: ${l||"(root)"}`),process.exit(0),{moved:!0,oldPath:t,newPath:h,expectedFolder:l}}catch(t){D.handle(t)}}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=ca.default.dirname(t),s=i?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let d=ca.default.basename(f,".md"),h=ca.default.basename(r,".md");return d===h})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};var uy=class{static{a(this,"CommandExecutor")}constructor(e,t=!1){this.context={pathResolver:new lu(e),fsAdapter:new Ot(e),frontmatterService:new _D.FrontmatterService,dryRun:t},this.statusExecutor=new bd(this.context),this.creationExecutor=new Ed(this.context),this.propertyExecutor=new Td(this.context),this.folderRepairExecutor=new Ad(this.context)}async execute(e,t,r){try{let i=this.context.pathResolver.resolve(t);this.context.pathResolver.validate(i),await this.context.fsAdapter.readFile(i.replace(this.context.pathResolver.getVaultRoot()+"/","")),console.log("\u2705 Command infrastructure verified"),console.log(` Command: ${e}`),console.log(` File: ${i}`),console.log(` Vault: ${this.context.pathResolver.getVaultRoot()}`),Object.keys(r).length>0&&console.log(` Options: ${JSON.stringify(r,null,2)}`),console.log(`
633
- \u{1F4DD} Note: Actual command execution will be implemented in follow-up issues.`),console.log(" This PR establishes the infrastructure foundation."),process.exit(0)}catch(i){D.handle(i)}}getVaultRoot(){return this.context.pathResolver.getVaultRoot()}async executeStart(e){return this.statusExecutor.executeStart(e)}async executeComplete(e){return this.statusExecutor.executeComplete(e)}async executeTrash(e){return this.statusExecutor.executeTrash(e)}async executeArchive(e){return this.statusExecutor.executeArchive(e)}async executeMoveToBacklog(e){return this.statusExecutor.executeMoveToBacklog(e)}async executeMoveToAnalysis(e){return this.statusExecutor.executeMoveToAnalysis(e)}async executeMoveToToDo(e){return this.statusExecutor.executeMoveToToDo(e)}async executeCreateTask(e,t,r={}){return this.creationExecutor.executeCreateTask(e,t,r)}async executeCreateMeeting(e,t,r={}){return this.creationExecutor.executeCreateMeeting(e,t,r)}async executeCreateProject(e,t,r={}){return this.creationExecutor.executeCreateProject(e,t,r)}async executeCreateArea(e,t,r={}){return this.creationExecutor.executeCreateArea(e,t,r)}async executeRenameToUid(e){return this.propertyExecutor.executeRenameToUid(e)}async executeUpdateLabel(e,t){return this.propertyExecutor.executeUpdateLabel(e,t)}async executeSchedule(e,t){return this.propertyExecutor.executeSchedule(e,t)}async executeSetDeadline(e,t){return this.propertyExecutor.executeSetDeadline(e,t)}async executeRepairFolder(e){return this.folderRepairExecutor.executeRepairFolder(e)}};function qr(n,e,t,r,i){if(n==="json"){let s={command:e,filepath:t,action:r,...i&&{changes:i}},o=X.success(s);console.log(JSON.stringify(o,null,2))}else console.log(`\u2705 ${r}`)}a(qr,"outputResult");function lc(n,e,t,r){let i=new Ke(`--${e} option is required for ${t} command`,r,{command:t,missingOption:e});D.handle(i)}a(lc,"handleMissingOption");function vD(){return new se("command").description("Execute plugin command on single asset").argument("<command-name>","Command to execute (rename-to-uid, start, complete, schedule, set-deadline, etc.)").argument("<filepath>","Path to asset file (relative to vault root or absolute)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--label <value>","Asset label (required for update-label and creation commands)").option("--prototype <uid>","Prototype UID for inheritance (creation commands)").option("--area <uid>","Area UID for effort linkage (creation commands)").option("--parent <uid>","Parent UID for effort linkage (creation commands)").option("--date <value>","Date in YYYY-MM-DD format (required for schedule and set-deadline commands)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async(n,e,t)=>{let r=t.format||"text";D.setFormat(r),n==="start"&&console.error("\u26A0\uFE0F DEPRECATED: `command start <path>` is deprecated. Use `dyncommand exec <uid>` instead. `command start <path>` will be removed in 2 minor releases (T7.3).");try{let i=(0,SD.resolve)(t.vault),s=new uy(i,t.dryRun);switch(n){case"rename-to-uid":await s.executeRenameToUid(e),qr(r,n,e,"Renamed file to UID-based name");break;case"update-label":t.label||lc(r,"label","update-label",'exocortex command update-label <filepath> --label "<value>"'),await s.executeUpdateLabel(e,t.label),qr(r,n,e,`Updated label to "${t.label}"`,{label:t.label});break;case"start":await s.executeStart(e),qr(r,n,e,"Started task");break;case"complete":await s.executeComplete(e),qr(r,n,e,"Completed task");break;case"trash":await s.executeTrash(e),qr(r,n,e,"Moved task to trash");break;case"archive":await s.executeArchive(e),qr(r,n,e,"Archived task");break;case"move-to-backlog":await s.executeMoveToBacklog(e),qr(r,n,e,"Moved task to backlog");break;case"move-to-analysis":await s.executeMoveToAnalysis(e),qr(r,n,e,"Moved task to analysis");break;case"move-to-todo":await s.executeMoveToToDo(e),qr(r,n,e,"Moved task to todo");break;case"create-task":t.label||lc(r,"label","create-task",'exocortex command create-task <filepath> --label "<value>"'),await s.executeCreateTask(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created task "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-meeting":t.label||lc(r,"label","create-meeting",'exocortex command create-meeting <filepath> --label "<value>"'),await s.executeCreateMeeting(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created meeting "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-project":t.label||lc(r,"label","create-project",'exocortex command create-project <filepath> --label "<value>"'),await s.executeCreateProject(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created project "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-area":t.label||lc(r,"label","create-area",'exocortex command create-area <filepath> --label "<value>"'),await s.executeCreateArea(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created area "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"schedule":t.date||lc(r,"date","schedule",'exocortex command schedule <filepath> --date "YYYY-MM-DD"'),await s.executeSchedule(e,t.date),qr(r,n,e,`Scheduled task for ${t.date}`,{date:t.date});break;case"set-deadline":t.date||lc(r,"date","set-deadline",'exocortex command set-deadline <filepath> --date "YYYY-MM-DD"'),await s.executeSetDeadline(e,t.date),qr(r,n,e,`Set deadline to ${t.date}`,{date:t.date});break;case"repair-folder":{let o=await s.executeRepairFolder(e);qr(r,n,e,o.moved?`Moved to correct folder: ${o.newPath}`:"Already in correct folder",{moved:o.moved,oldPath:o.oldPath,newPath:o.newPath,expectedFolder:o.expectedFolder});break}default:await s.execute(n,e,t),qr(r,n,e,`Executed ${n}`);break}}catch(i){D.handle(i)}})}a(vD,"commandCommand");var wD=require("path");var vo=H(require("fs")),HE=H(require("path")),bD=require("events");var ZY={watch:vo.default.watch.bind(vo.default),existsSync:vo.default.existsSync.bind(vo.default),statSync:vo.default.statSync.bind(vo.default),readFileSync:vo.default.readFileSync.bind(vo.default)},fy=class extends bD.EventEmitter{constructor(t,r={}){super();this.watcher=null;this.debounceTimers=new Map;this.isRunning=!1;this.vaultPath=HE.default.resolve(t),this.fsAdapter=r.fsAdapter??ZY,this.options={pattern:r.pattern??"**/*.md",assetType:r.assetType??"",debounceMs:r.debounceMs??100,recursive:r.recursive??!0}}static{a(this,"FileSystemWatcher")}start(){this.isRunning||(this.watcher=this.fsAdapter.watch(this.vaultPath,{recursive:this.options.recursive},(t,r)=>{r&&this.handleFileEvent(t,r.toString())}),this.watcher.on("error",t=>{this.emit("error",t)}),this.isRunning=!0,this.emit("started"))}stop(){if(this.isRunning){for(let t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear(),this.watcher&&(this.watcher.close(),this.watcher=null),this.isRunning=!1,this.emit("stopped")}}isWatching(){return this.isRunning}handleFileEvent(t,r){let i=HE.default.join(this.vaultPath,r),s=r;if(!this.matchesPattern(s))return;let o=this.debounceTimers.get(i);o&&clearTimeout(o);let c=setTimeout(()=>{this.debounceTimers.delete(i),this.processFileEvent(i,s)},this.options.debounceMs);this.debounceTimers.set(i,c)}processFileEvent(t,r){let i=this.fsAdapter.existsSync(t),s;if(!i)s="delete";else{let l=this.fsAdapter.statSync(t);s=Date.now()-l.birthtimeMs<1e3?"create":"modify"}let o;if(i&&t.endsWith(".md")&&(o=this.extractAssetType(t)),this.options.assetType&&o!==this.options.assetType)return;let c={type:s,path:t,relativePath:r,timestamp:new Date().toISOString(),assetType:o};this.emit("change",c)}matchesPattern(t){return this.options.pattern?Ur(t,this.options.pattern):!0}extractAssetType(t){try{let i=this.fsAdapter.readFileSync(t,"utf-8").match(/^---\n([\s\S]*?)\n---/);if(!i)return;let o=i[1].match(/exo__Instance_class:\s*(?:\[?"?\[\[([^\]]+)\]\]"?\]?|"?\[\[([^\]]+)\]\]"?)/);return o?o[1]||o[2]:void 0}catch{return}}};var QE=H(require("fs"));function ED(){return new se("watch").description("Watch vault for file changes and emit NDJSON events").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--pattern <glob>","Glob pattern to filter files (e.g., '*.md', 'tasks/**')").option("--asset-type <type>","Filter by asset type (e.g., 'ems__Task', 'ems__Project')").option("--debounce <ms>","Debounce interval in milliseconds","100").action(async n=>{D.setFormat("json");try{let e=(0,wD.resolve)(n.vault);if(!QE.default.existsSync(e))throw new Te(e);if(!QE.default.statSync(e).isDirectory())throw new Ke(`Vault path is not a directory: ${e}`,"Provide a path to a directory, not a file",{vaultPath:e});let t=parseInt(n.debounce?.toString()??"100",10);if(isNaN(t)||t<0)throw new Ke("--debounce must be a non-negative integer","Use a positive integer value for debounce",{debounce:n.debounce});let r=new fy(e,{pattern:n.pattern,assetType:n.assetType,debounceMs:t});r.on("change",s=>{console.log(JSON.stringify(s))}),r.on("error",s=>{let o=X.error("INTERNAL_OPERATION_FAILED",s.message,5,{recovery:{message:"Check file permissions and vault access",suggestion:"Ensure the vault directory is accessible"}});console.log(JSON.stringify(o))});let i=a(()=>{r.stop(),process.exit(0)},"shutdown");process.on("SIGINT",i),process.on("SIGTERM",i),console.error(`Watching vault: ${e}`),n.pattern&&console.error(` Pattern filter: ${n.pattern}`),n.assetType&&console.error(` Asset type filter: ${n.assetType}`),console.error(` Debounce: ${t}ms`),console.error("Press Ctrl+C to stop"),r.start()}catch(e){D.handle(e)}})}a(ED,"watchCommand");var YE=require("path"),XE=H(go());var uc=H(require("path"));var fu=H(Pt());var Yi=H(go()),KE=H(require("crypto"));var dy=class{constructor(){this.backups=new Map;this.fileHashes=new Map}static{a(this,"TransactionManager")}async begin(e){if(!Yi.default.existsSync(e))throw new Error(`Cannot backup non-existent file: ${e}`);let t=await Yi.default.readFile(e,"utf-8"),r=KE.default.createHash("sha256").update(t).digest("hex");this.fileHashes.set(e,r);let i=`${e}.backup.${Date.now()}`;await Yi.default.writeFile(i,t,"utf-8"),this.backups.set(e,i)}async verify(e){let t=this.fileHashes.get(e);if(!t)return!0;if(!Yi.default.existsSync(e))return!1;let r=await Yi.default.readFile(e,"utf-8");return KE.default.createHash("sha256").update(r).digest("hex")===t}async commit(){for(let e of this.backups.values())Yi.default.existsSync(e)&&await Yi.default.remove(e);this.backups.clear(),this.fileHashes.clear()}async rollback(){for(let[e,t]of this.backups.entries())Yi.default.existsSync(t)&&(await Yi.default.copy(t,e,{overwrite:!0}),await Yi.default.remove(t));this.backups.clear(),this.fileHashes.clear()}getTrackedFiles(){return Array.from(this.backups.keys())}};var fc=class{static{a(this,"BatchExecutor")}constructor(e,t=!1){this.pathResolver=new lu(e),this.fsAdapter=new Ot(e),this.frontmatterService=new fu.FrontmatterService,this.transactionManager=new dy,this.dryRun=t}async executeBatch(e,t=!1){let r=Date.now(),i=[],s=0,o=0;if(e.length===0)return{success:!0,total:0,succeeded:0,failed:0,results:[],durationMs:Date.now()-r,atomic:t};if(t&&!this.dryRun)try{await this.backupAllFiles(e)}catch(l){return{success:!1,total:e.length,succeeded:0,failed:e.length,results:e.map(u=>({success:!1,command:u.command,filepath:u.filepath,error:`Backup failed: ${l.message}`})),durationMs:Date.now()-r,atomic:t}}for(let l of e){let u=await this.executeSingleOperation(l);if(i.push(u),u.success)s++;else if(o++,t&&!this.dryRun){await this.transactionManager.rollback();let f=i.length;for(let d=f;d<e.length;d++)i.push({success:!1,command:e[d].command,filepath:e[d].filepath,error:"Not executed due to atomic rollback"}),o++;return{success:!1,total:e.length,succeeded:0,failed:e.length,results:i,durationMs:Date.now()-r,atomic:t,rolledBack:!0}}}return t&&!this.dryRun&&await this.transactionManager.commit(),{success:o===0,total:e.length,succeeded:s,failed:o,results:i,durationMs:Date.now()-r,atomic:t,...t&&{rolledBack:!1}}}static parseInput(e){try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Ke("Batch input must be a JSON array of operations",`exo batch --input '[{"command":"start","filepath":"task.md"}]'`);for(let r of t){if(!r.command||typeof r.command!="string")throw new Ke('Each operation must have a "command" string property','{"command":"start","filepath":"task.md"}');if(!r.filepath||typeof r.filepath!="string")throw new Ke('Each operation must have a "filepath" string property','{"command":"start","filepath":"task.md"}')}return t}catch(t){throw t instanceof Ke?t:new Ke(`Failed to parse batch input: ${t.message}`,`exo batch --input '[{"command":"start","filepath":"task.md"}]'`)}}async backupAllFiles(e){let t=new Set;for(let r of e){let i=this.pathResolver.resolve(r.filepath);t.add(i)}for(let r of t)await this.transactionManager.begin(r)}async executeSingleOperation(e){try{let t=this.pathResolver.resolve(e.filepath);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");if(await this.fsAdapter.readFile(r),this.dryRun)return{success:!0,command:e.command,filepath:e.filepath,action:`Would execute ${e.command} (dry-run)`};switch(e.command){case"start":return await this.executeStart(r,e);case"complete":return await this.executeComplete(r,e);case"trash":return await this.executeTrash(r,e);case"archive":return await this.executeArchive(r,e);case"move-to-backlog":return await this.executeStatusUpdate(r,e,"ems__EffortStatusBacklog","Moved to backlog");case"move-to-analysis":return await this.executeStatusUpdate(r,e,"ems__EffortStatusAnalysis","Moved to analysis");case"move-to-todo":return await this.executeStatusUpdate(r,e,"ems__EffortStatusToDo","Moved to todo");case"update-label":return await this.executeUpdateLabel(r,e);case"schedule":return await this.executeSchedule(r,e);case"set-deadline":return await this.executeSetDeadline(r,e);case"repair-folder":return await this.executeRepairFolder(r,e);default:return{success:!1,command:e.command,filepath:e.filepath,error:`Unknown command: ${e.command}`}}}catch(t){return{success:!1,command:e.command,filepath:e.filepath,error:t.message}}}getCurrentTimestamp(){return fu.DateFormatter.toLocalTimestamp(new Date)}async executeStart(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Started task",changes:{status:"Doing",startTimestamp:i}}}async executeComplete(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Completed task",changes:{status:"Done",endTimestamp:i,resolutionTimestamp:i}}}async executeTrash(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Trashed task",changes:{status:"Trashed",resolutionTimestamp:i}}}async executeArchive(e,t){let r=await this.fsAdapter.readFile(e),i=this.frontmatterService.updateProperty(r,"archived","true");return i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(e,i),{success:!0,command:t.command,filepath:t.filepath,action:"Archived task",changes:{archived:!0,aliasesRemoved:!0}}}async executeStatusUpdate(e,t,r,i){let s=await this.fsAdapter.readFile(e),o=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${r}]]"`);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:i,changes:{status:r.replace("ems__EffortStatus","")}}}async executeUpdateLabel(e,t){let r=t.options?.label;if(!r||r.trim()==="")return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "label"'};let i=r.trim(),s=await this.fsAdapter.readFile(e),o=this.frontmatterService.updateProperty(s,"exo__Asset_label",`"${i}"`);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Updated label to "${i}"`,changes:{label:i}}}async executeSchedule(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=fu.DateFormatter.toTimestampAtStartOfDay(r),o=this.frontmatterService.updateProperty(i,"ems__Effort_scheduledTimestamp",s);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Scheduled for ${r}`,changes:{scheduledTimestamp:s}}}async executeSetDeadline(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=fu.DateFormatter.toTimestampAtStartOfDay(r),o=this.frontmatterService.updateProperty(i,"ems__Effort_deadlineTimestamp",s);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Set deadline to ${r}`,changes:{deadlineTimestamp:s}}}async executeRepairFolder(e,t){let i=(await this.fsAdapter.getFileMetadata(e))?.exo__Asset_isDefinedBy;if(!i)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: missing exo__Asset_isDefinedBy"};let s=this.extractReference(i);if(!s)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: invalid exo__Asset_isDefinedBy format"};let o=await this.findReferencedFile(s,e);if(!o)return{success:!1,command:t.command,filepath:t.filepath,error:`Cannot determine expected folder: referenced asset not found: ${s}`};let c=uc.default.dirname(o),l=c==="."?"":c,u=uc.default.dirname(e),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return{success:!0,command:t.command,filepath:t.filepath,action:"Already in correct folder",changes:{moved:!1,folder:l||"(root)"}};let d=uc.default.basename(e),h=l?`${l}/${d}`:d;return await this.fsAdapter.fileExists(h)?{success:!1,command:t.command,filepath:t.filepath,error:`Cannot move file: ${h} already exists`}:(await this.fsAdapter.renameFile(e,h),{success:!0,command:t.command,filepath:t.filepath,action:`Moved to ${l||"(root)"}`,changes:{moved:!0,oldPath:e,newPath:h,expectedFolder:l||"(root)"}})}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=uc.default.dirname(t),s=i!=="."?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let d=uc.default.basename(f,".md"),h=uc.default.basename(r,".md");return d===h})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};function eX(n,e){if(n==="json"){let t=X.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
633
+ \u{1F4DD} Note: Actual command execution will be implemented in follow-up issues.`),console.log(" This PR establishes the infrastructure foundation."),process.exit(0)}catch(i){D.handle(i)}}getVaultRoot(){return this.context.pathResolver.getVaultRoot()}async executeStart(e){return this.statusExecutor.executeStart(e)}async executeComplete(e){return this.statusExecutor.executeComplete(e)}async executeTrash(e){return this.statusExecutor.executeTrash(e)}async executeArchive(e){return this.statusExecutor.executeArchive(e)}async executeMoveToBacklog(e){return this.statusExecutor.executeMoveToBacklog(e)}async executeMoveToAnalysis(e){return this.statusExecutor.executeMoveToAnalysis(e)}async executeMoveToToDo(e){return this.statusExecutor.executeMoveToToDo(e)}async executeCreateTask(e,t,r={}){return this.creationExecutor.executeCreateTask(e,t,r)}async executeCreateMeeting(e,t,r={}){return this.creationExecutor.executeCreateMeeting(e,t,r)}async executeCreateProject(e,t,r={}){return this.creationExecutor.executeCreateProject(e,t,r)}async executeCreateArea(e,t,r={}){return this.creationExecutor.executeCreateArea(e,t,r)}async executeRenameToUid(e){return this.propertyExecutor.executeRenameToUid(e)}async executeUpdateLabel(e,t){return this.propertyExecutor.executeUpdateLabel(e,t)}async executeSchedule(e,t){return this.propertyExecutor.executeSchedule(e,t)}async executeSetDeadline(e,t){return this.propertyExecutor.executeSetDeadline(e,t)}async executeRepairFolder(e){return this.folderRepairExecutor.executeRepairFolder(e)}};function qr(n,e,t,r,i){if(n==="json"){let s={command:e,filepath:t,action:r,...i&&{changes:i}},o=X.success(s);console.log(JSON.stringify(o,null,2))}else console.log(`\u2705 ${r}`)}a(qr,"outputResult");function lc(n,e,t,r){let i=new Ke(`--${e} option is required for ${t} command`,r,{command:t,missingOption:e});D.handle(i)}a(lc,"handleMissingOption");function vD(){return new se("command").description("Execute plugin command on single asset").argument("<command-name>","Command to execute (rename-to-uid, start, complete, schedule, set-deadline, etc.)").argument("<filepath>","Path to asset file (relative to vault root or absolute)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--label <value>","Asset label (required for update-label and creation commands)").option("--prototype <uid>","Prototype UID for inheritance (creation commands)").option("--area <uid>","Area UID for effort linkage (creation commands)").option("--parent <uid>","Parent UID for effort linkage (creation commands)").option("--date <value>","Date in YYYY-MM-DD format (required for schedule and set-deadline commands)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async(n,e,t)=>{let r=t.format||"text";D.setFormat(r),n==="start"&&console.error("\u26A0\uFE0F DEPRECATED: `command start <path>` is deprecated. Use `dyncommand exec <uid>` instead. `command start <path>` will be removed in 2 minor releases (T7.3).");try{let i=(0,SD.resolve)(t.vault),s=new uy(i,t.dryRun);switch(n){case"rename-to-uid":await s.executeRenameToUid(e),qr(r,n,e,"Renamed file to UID-based name");break;case"update-label":t.label||lc(r,"label","update-label",'exocortex command update-label <filepath> --label "<value>"'),await s.executeUpdateLabel(e,t.label),qr(r,n,e,`Updated label to "${t.label}"`,{label:t.label});break;case"start":await s.executeStart(e),qr(r,n,e,"Started task");break;case"complete":await s.executeComplete(e),qr(r,n,e,"Completed task");break;case"trash":await s.executeTrash(e),qr(r,n,e,"Moved task to trash");break;case"archive":await s.executeArchive(e),qr(r,n,e,"Archived task");break;case"move-to-backlog":await s.executeMoveToBacklog(e),qr(r,n,e,"Moved task to backlog");break;case"move-to-analysis":await s.executeMoveToAnalysis(e),qr(r,n,e,"Moved task to analysis");break;case"move-to-todo":await s.executeMoveToToDo(e),qr(r,n,e,"Moved task to todo");break;case"create-task":t.label||lc(r,"label","create-task",'exocortex command create-task <filepath> --label "<value>"'),await s.executeCreateTask(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created task "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-meeting":t.label||lc(r,"label","create-meeting",'exocortex command create-meeting <filepath> --label "<value>"'),await s.executeCreateMeeting(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created meeting "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-project":t.label||lc(r,"label","create-project",'exocortex command create-project <filepath> --label "<value>"'),await s.executeCreateProject(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created project "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"create-area":t.label||lc(r,"label","create-area",'exocortex command create-area <filepath> --label "<value>"'),await s.executeCreateArea(e,t.label,{prototype:t.prototype,area:t.area,parent:t.parent}),qr(r,n,e,`Created area "${t.label}"`,{label:t.label,prototype:t.prototype,area:t.area,parent:t.parent});break;case"schedule":t.date||lc(r,"date","schedule",'exocortex command schedule <filepath> --date "YYYY-MM-DD"'),await s.executeSchedule(e,t.date),qr(r,n,e,`Scheduled task for ${t.date}`,{date:t.date});break;case"set-deadline":t.date||lc(r,"date","set-deadline",'exocortex command set-deadline <filepath> --date "YYYY-MM-DD"'),await s.executeSetDeadline(e,t.date),qr(r,n,e,`Set deadline to ${t.date}`,{date:t.date});break;case"repair-folder":{let o=await s.executeRepairFolder(e);qr(r,n,e,o.moved?`Moved to correct folder: ${o.newPath}`:"Already in correct folder",{moved:o.moved,oldPath:o.oldPath,newPath:o.newPath,expectedFolder:o.expectedFolder});break}default:await s.execute(n,e,t),qr(r,n,e,`Executed ${n}`);break}}catch(i){D.handle(i)}})}a(vD,"commandCommand");var wD=require("path");var vo=H(require("fs")),HE=H(require("path")),bD=require("events");var eX={watch:vo.default.watch.bind(vo.default),existsSync:vo.default.existsSync.bind(vo.default),statSync:vo.default.statSync.bind(vo.default),readFileSync:vo.default.readFileSync.bind(vo.default)},fy=class extends bD.EventEmitter{constructor(t,r={}){super();this.watcher=null;this.debounceTimers=new Map;this.isRunning=!1;this.vaultPath=HE.default.resolve(t),this.fsAdapter=r.fsAdapter??eX,this.options={pattern:r.pattern??"**/*.md",assetType:r.assetType??"",debounceMs:r.debounceMs??100,recursive:r.recursive??!0}}static{a(this,"FileSystemWatcher")}start(){this.isRunning||(this.watcher=this.fsAdapter.watch(this.vaultPath,{recursive:this.options.recursive},(t,r)=>{r&&this.handleFileEvent(t,r.toString())}),this.watcher.on("error",t=>{this.emit("error",t)}),this.isRunning=!0,this.emit("started"))}stop(){if(this.isRunning){for(let t of this.debounceTimers.values())clearTimeout(t);this.debounceTimers.clear(),this.watcher&&(this.watcher.close(),this.watcher=null),this.isRunning=!1,this.emit("stopped")}}isWatching(){return this.isRunning}handleFileEvent(t,r){let i=HE.default.join(this.vaultPath,r),s=r;if(!this.matchesPattern(s))return;let o=this.debounceTimers.get(i);o&&clearTimeout(o);let c=setTimeout(()=>{this.debounceTimers.delete(i),this.processFileEvent(i,s)},this.options.debounceMs);this.debounceTimers.set(i,c)}processFileEvent(t,r){let i=this.fsAdapter.existsSync(t),s;if(!i)s="delete";else{let l=this.fsAdapter.statSync(t);s=Date.now()-l.birthtimeMs<1e3?"create":"modify"}let o;if(i&&t.endsWith(".md")&&(o=this.extractAssetType(t)),this.options.assetType&&o!==this.options.assetType)return;let c={type:s,path:t,relativePath:r,timestamp:new Date().toISOString(),assetType:o};this.emit("change",c)}matchesPattern(t){return this.options.pattern?Ur(t,this.options.pattern):!0}extractAssetType(t){try{let i=this.fsAdapter.readFileSync(t,"utf-8").match(/^---\n([\s\S]*?)\n---/);if(!i)return;let o=i[1].match(/exo__Instance_class:\s*(?:\[?"?\[\[([^\]]+)\]\]"?\]?|"?\[\[([^\]]+)\]\]"?)/);return o?o[1]||o[2]:void 0}catch{return}}};var QE=H(require("fs"));function ED(){return new se("watch").description("Watch vault for file changes and emit NDJSON events").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--pattern <glob>","Glob pattern to filter files (e.g., '*.md', 'tasks/**')").option("--asset-type <type>","Filter by asset type (e.g., 'ems__Task', 'ems__Project')").option("--debounce <ms>","Debounce interval in milliseconds","100").action(async n=>{D.setFormat("json");try{let e=(0,wD.resolve)(n.vault);if(!QE.default.existsSync(e))throw new Te(e);if(!QE.default.statSync(e).isDirectory())throw new Ke(`Vault path is not a directory: ${e}`,"Provide a path to a directory, not a file",{vaultPath:e});let t=parseInt(n.debounce?.toString()??"100",10);if(isNaN(t)||t<0)throw new Ke("--debounce must be a non-negative integer","Use a positive integer value for debounce",{debounce:n.debounce});let r=new fy(e,{pattern:n.pattern,assetType:n.assetType,debounceMs:t});r.on("change",s=>{console.log(JSON.stringify(s))}),r.on("error",s=>{let o=X.error("INTERNAL_OPERATION_FAILED",s.message,5,{recovery:{message:"Check file permissions and vault access",suggestion:"Ensure the vault directory is accessible"}});console.log(JSON.stringify(o))});let i=a(()=>{r.stop(),process.exit(0)},"shutdown");process.on("SIGINT",i),process.on("SIGTERM",i),console.error(`Watching vault: ${e}`),n.pattern&&console.error(` Pattern filter: ${n.pattern}`),n.assetType&&console.error(` Asset type filter: ${n.assetType}`),console.error(` Debounce: ${t}ms`),console.error("Press Ctrl+C to stop"),r.start()}catch(e){D.handle(e)}})}a(ED,"watchCommand");var YE=require("path"),XE=H(go());var uc=H(require("path"));var fu=H(Pt());var Yi=H(go()),KE=H(require("crypto"));var dy=class{constructor(){this.backups=new Map;this.fileHashes=new Map}static{a(this,"TransactionManager")}async begin(e){if(!Yi.default.existsSync(e))throw new Error(`Cannot backup non-existent file: ${e}`);let t=await Yi.default.readFile(e,"utf-8"),r=KE.default.createHash("sha256").update(t).digest("hex");this.fileHashes.set(e,r);let i=`${e}.backup.${Date.now()}`;await Yi.default.writeFile(i,t,"utf-8"),this.backups.set(e,i)}async verify(e){let t=this.fileHashes.get(e);if(!t)return!0;if(!Yi.default.existsSync(e))return!1;let r=await Yi.default.readFile(e,"utf-8");return KE.default.createHash("sha256").update(r).digest("hex")===t}async commit(){for(let e of this.backups.values())Yi.default.existsSync(e)&&await Yi.default.remove(e);this.backups.clear(),this.fileHashes.clear()}async rollback(){for(let[e,t]of this.backups.entries())Yi.default.existsSync(t)&&(await Yi.default.copy(t,e,{overwrite:!0}),await Yi.default.remove(t));this.backups.clear(),this.fileHashes.clear()}getTrackedFiles(){return Array.from(this.backups.keys())}};var fc=class{static{a(this,"BatchExecutor")}constructor(e,t=!1){this.pathResolver=new lu(e),this.fsAdapter=new Ot(e),this.frontmatterService=new fu.FrontmatterService,this.transactionManager=new dy,this.dryRun=t}async executeBatch(e,t=!1){let r=Date.now(),i=[],s=0,o=0;if(e.length===0)return{success:!0,total:0,succeeded:0,failed:0,results:[],durationMs:Date.now()-r,atomic:t};if(t&&!this.dryRun)try{await this.backupAllFiles(e)}catch(l){return{success:!1,total:e.length,succeeded:0,failed:e.length,results:e.map(u=>({success:!1,command:u.command,filepath:u.filepath,error:`Backup failed: ${l.message}`})),durationMs:Date.now()-r,atomic:t}}for(let l of e){let u=await this.executeSingleOperation(l);if(i.push(u),u.success)s++;else if(o++,t&&!this.dryRun){await this.transactionManager.rollback();let f=i.length;for(let d=f;d<e.length;d++)i.push({success:!1,command:e[d].command,filepath:e[d].filepath,error:"Not executed due to atomic rollback"}),o++;return{success:!1,total:e.length,succeeded:0,failed:e.length,results:i,durationMs:Date.now()-r,atomic:t,rolledBack:!0}}}return t&&!this.dryRun&&await this.transactionManager.commit(),{success:o===0,total:e.length,succeeded:s,failed:o,results:i,durationMs:Date.now()-r,atomic:t,...t&&{rolledBack:!1}}}static parseInput(e){try{let t=JSON.parse(e);if(!Array.isArray(t))throw new Ke("Batch input must be a JSON array of operations",`exo batch --input '[{"command":"start","filepath":"task.md"}]'`);for(let r of t){if(!r.command||typeof r.command!="string")throw new Ke('Each operation must have a "command" string property','{"command":"start","filepath":"task.md"}');if(!r.filepath||typeof r.filepath!="string")throw new Ke('Each operation must have a "filepath" string property','{"command":"start","filepath":"task.md"}')}return t}catch(t){throw t instanceof Ke?t:new Ke(`Failed to parse batch input: ${t.message}`,`exo batch --input '[{"command":"start","filepath":"task.md"}]'`)}}async backupAllFiles(e){let t=new Set;for(let r of e){let i=this.pathResolver.resolve(r.filepath);t.add(i)}for(let r of t)await this.transactionManager.begin(r)}async executeSingleOperation(e){try{let t=this.pathResolver.resolve(e.filepath);this.pathResolver.validate(t);let r=t.replace(this.pathResolver.getVaultRoot()+"/","");if(await this.fsAdapter.readFile(r),this.dryRun)return{success:!0,command:e.command,filepath:e.filepath,action:`Would execute ${e.command} (dry-run)`};switch(e.command){case"start":return await this.executeStart(r,e);case"complete":return await this.executeComplete(r,e);case"trash":return await this.executeTrash(r,e);case"archive":return await this.executeArchive(r,e);case"move-to-backlog":return await this.executeStatusUpdate(r,e,"ems__EffortStatusBacklog","Moved to backlog");case"move-to-analysis":return await this.executeStatusUpdate(r,e,"ems__EffortStatusAnalysis","Moved to analysis");case"move-to-todo":return await this.executeStatusUpdate(r,e,"ems__EffortStatusToDo","Moved to todo");case"update-label":return await this.executeUpdateLabel(r,e);case"schedule":return await this.executeSchedule(r,e);case"set-deadline":return await this.executeSetDeadline(r,e);case"repair-folder":return await this.executeRepairFolder(r,e);default:return{success:!1,command:e.command,filepath:e.filepath,error:`Unknown command: ${e.command}`}}}catch(t){return{success:!1,command:e.command,filepath:e.filepath,error:t.message}}}getCurrentTimestamp(){return fu.DateFormatter.toLocalTimestamp(new Date)}async executeStart(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDoing]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_startTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Started task",changes:{status:"Doing",startTimestamp:i}}}async executeComplete(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusDone]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_endTimestamp",i),s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Completed task",changes:{status:"Done",endTimestamp:i,resolutionTimestamp:i}}}async executeTrash(e,t){let r=await this.fsAdapter.readFile(e),i=this.getCurrentTimestamp(),s=this.frontmatterService.updateProperty(r,"ems__Effort_status",'"[[ems__EffortStatusTrashed]]"');return s=this.frontmatterService.updateProperty(s,"ems__Effort_resolutionTimestamp",i),await this.fsAdapter.updateFile(e,s),{success:!0,command:t.command,filepath:t.filepath,action:"Trashed task",changes:{status:"Trashed",resolutionTimestamp:i}}}async executeArchive(e,t){let r=await this.fsAdapter.readFile(e),i=this.frontmatterService.updateProperty(r,"archived","true");return i=this.frontmatterService.removeProperty(i,"aliases"),await this.fsAdapter.updateFile(e,i),{success:!0,command:t.command,filepath:t.filepath,action:"Archived task",changes:{archived:!0,aliasesRemoved:!0}}}async executeStatusUpdate(e,t,r,i){let s=await this.fsAdapter.readFile(e),o=this.frontmatterService.updateProperty(s,"ems__Effort_status",`"[[${r}]]"`);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:i,changes:{status:r.replace("ems__EffortStatus","")}}}async executeUpdateLabel(e,t){let r=t.options?.label;if(!r||r.trim()==="")return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "label"'};let i=r.trim(),s=await this.fsAdapter.readFile(e),o=this.frontmatterService.updateProperty(s,"exo__Asset_label",`"${i}"`);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Updated label to "${i}"`,changes:{label:i}}}async executeSchedule(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=fu.DateFormatter.toTimestampAtStartOfDay(r),o=this.frontmatterService.updateProperty(i,"ems__Effort_scheduledTimestamp",s);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Scheduled for ${r}`,changes:{scheduledTimestamp:s}}}async executeSetDeadline(e,t){let r=t.options?.date;if(!r)return{success:!1,command:t.command,filepath:t.filepath,error:'Missing required option: "date"'};if(!/^\d{4}-\d{2}-\d{2}$/.test(r))return{success:!1,command:t.command,filepath:t.filepath,error:`Invalid date format: ${r}. Expected YYYY-MM-DD`};let i=await this.fsAdapter.readFile(e),s=fu.DateFormatter.toTimestampAtStartOfDay(r),o=this.frontmatterService.updateProperty(i,"ems__Effort_deadlineTimestamp",s);return await this.fsAdapter.updateFile(e,o),{success:!0,command:t.command,filepath:t.filepath,action:`Set deadline to ${r}`,changes:{deadlineTimestamp:s}}}async executeRepairFolder(e,t){let i=(await this.fsAdapter.getFileMetadata(e))?.exo__Asset_isDefinedBy;if(!i)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: missing exo__Asset_isDefinedBy"};let s=this.extractReference(i);if(!s)return{success:!1,command:t.command,filepath:t.filepath,error:"Cannot determine expected folder: invalid exo__Asset_isDefinedBy format"};let o=await this.findReferencedFile(s,e);if(!o)return{success:!1,command:t.command,filepath:t.filepath,error:`Cannot determine expected folder: referenced asset not found: ${s}`};let c=uc.default.dirname(o),l=c==="."?"":c,u=uc.default.dirname(e),f=u==="."?"":u;if(this.normalizePath(f)===this.normalizePath(l))return{success:!0,command:t.command,filepath:t.filepath,action:"Already in correct folder",changes:{moved:!1,folder:l||"(root)"}};let d=uc.default.basename(e),h=l?`${l}/${d}`:d;return await this.fsAdapter.fileExists(h)?{success:!1,command:t.command,filepath:t.filepath,error:`Cannot move file: ${h} already exists`}:(await this.fsAdapter.renameFile(e,h),{success:!0,command:t.command,filepath:t.filepath,action:`Moved to ${l||"(root)"}`,changes:{moved:!0,oldPath:e,newPath:h,expectedFolder:l||"(root)"}})}extractReference(e){if(typeof e!="string")return null;let t=e.trim().replace(/^["']|["']$/g,"");return t=t.replace(/^\[\[|\]\]$/g,""),t||null}async findReferencedFile(e,t){let r=e.endsWith(".md")?e:`${e}.md`;if(e.includes("/")&&await this.fsAdapter.fileExists(r))return r;let i=uc.default.dirname(t),s=i!=="."?`${i}/${r}`:r;if(await this.fsAdapter.fileExists(s))return s;let c=await this.fsAdapter.findFileByUID(e);return c||(await this.fsAdapter.getMarkdownFiles()).find(f=>{let d=uc.default.basename(f,".md"),h=uc.default.basename(r,".md");return d===h})||null}normalizePath(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/$/,"")}};function tX(n,e){if(n==="json"){let t=X.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
634
634
  \u{1F4E6} Batch Execution ${e.success?"Complete":"Failed"}`),console.log(` Total: ${e.total} operations`),console.log(` \u2705 Succeeded: ${e.succeeded}`),console.log(` \u274C Failed: ${e.failed}`),console.log(` \u23F1\uFE0F Duration: ${e.durationMs}ms`),e.atomic&&console.log(` \u{1F512} Atomic mode: ${e.rolledBack?"Rolled back":"Committed"}`),e.failed>0){console.log(`
635
635
  \u{1F4CB} Failed Operations:`);for(let t of e.results.filter(r=>!r.success))console.log(` \u274C ${t.command} ${t.filepath}: ${t.error}`)}if(e.succeeded>0&&n==="text"){console.log(`
636
- \u{1F4CB} Successful Operations:`);for(let t of e.results.filter(r=>r.success))console.log(` \u2705 ${t.command} ${t.filepath}: ${t.action}`)}}}a(eX,"outputResult");function TD(){return new se("batch").description("Execute multiple operations in a single CLI invocation").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>","JSON array of operations to execute").option("--file <path>","Path to JSON file containing operations").option("--atomic","All-or-nothing execution (rollback on any failure)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async n=>{let e=n.format||"text";D.setFormat(e);try{let t=(0,YE.resolve)(n.vault),r;if(n.input)r=n.input;else if(n.file){let c=(0,YE.resolve)(n.file);if(!XE.default.existsSync(c))throw new Ke(`Batch file not found: ${c}`,"exocortex batch --file operations.json");r=await XE.default.readFile(c,"utf-8")}else throw new Ke("Either --input or --file option is required",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]' or exocortex batch --file operations.json`);let i=fc.parseInput(r);if(i.length===0)throw new Ke("Batch input contains no operations",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]'`);let o=await new fc(t,n.dryRun).executeBatch(i,n.atomic);eX(e,o),process.exit(o.success?0:5)}catch(t){D.handle(t)}})}a(TD,"batchCommand");var AD=require("path");function tX(n,e){if(n==="json"){let t=X.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
636
+ \u{1F4CB} Successful Operations:`);for(let t of e.results.filter(r=>r.success))console.log(` \u2705 ${t.command} ${t.filepath}: ${t.action}`)}}}a(tX,"outputResult");function TD(){return new se("batch").description("Execute multiple operations in a single CLI invocation").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>","JSON array of operations to execute").option("--file <path>","Path to JSON file containing operations").option("--atomic","All-or-nothing execution (rollback on any failure)").option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").action(async n=>{let e=n.format||"text";D.setFormat(e);try{let t=(0,YE.resolve)(n.vault),r;if(n.input)r=n.input;else if(n.file){let c=(0,YE.resolve)(n.file);if(!XE.default.existsSync(c))throw new Ke(`Batch file not found: ${c}`,"exocortex batch --file operations.json");r=await XE.default.readFile(c,"utf-8")}else throw new Ke("Either --input or --file option is required",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]' or exocortex batch --file operations.json`);let i=fc.parseInput(r);if(i.length===0)throw new Ke("Batch input contains no operations",`exocortex batch --input '[{"command":"start","filepath":"task.md"}]'`);let o=await new fc(t,n.dryRun).executeBatch(i,n.atomic);tX(e,o),process.exit(o.success?0:5)}catch(t){D.handle(t)}})}a(TD,"batchCommand");var AD=require("path");function rX(n,e){if(n==="json"){let t=X.success(e,{durationMs:e.durationMs,itemCount:e.total});console.log(JSON.stringify(t,null,2))}else{if(console.log(`
637
637
  \u{1F4E6} Batch Repair ${e.success?"Complete":"Completed with Errors"}`),console.log(` Total files: ${e.total}`),console.log(` \u{1F4C1} Moved: ${e.movedCount}`),console.log(` \u2705 Already correct: ${e.alreadyCorrectCount}`),console.log(` \u274C Errors: ${e.errorCount}`),console.log(` \u23F1\uFE0F Duration: ${e.durationMs}ms`),e.errorCount>0){console.log(`
638
638
  \u{1F4CB} Failed Files:`);for(let t of e.results.filter(r=>!r.success))console.log(` \u274C ${t.filepath}: ${t.error}`)}if(e.movedCount>0&&n==="text"){console.log(`
639
- \u{1F4CB} Moved Files:`);for(let t of e.results.filter(r=>r.success&&r.changes?.moved))console.log(` \u{1F4C1} ${t.filepath} \u2192 ${t.changes?.newPath}`)}}}a(tX,"outputResult");function xD(){return new se("batch-repair").description("Batch repair folder locations for all markdown files in a directory").argument("<directory>","Directory to process (relative to vault root)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").option("--progress","Show progress during processing (default: true)",!0).option("--no-progress","Disable progress output").action(async(n,e)=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,AD.resolve)(e.vault),i=new Ot(r),s=n;if(!await i.directoryExists(s))throw new Ke(`Directory not found: ${s}`,"exocortex batch-repair <existing-directory>");let c=await i.getMarkdownFiles(s);if(c.length===0){if(t==="json"){let w=X.success({success:!0,total:0,movedCount:0,alreadyCorrectCount:0,errorCount:0,results:[],durationMs:0,atomic:!1});console.log(JSON.stringify(w,null,2))}else console.log(`
639
+ \u{1F4CB} Moved Files:`);for(let t of e.results.filter(r=>r.success&&r.changes?.moved))console.log(` \u{1F4C1} ${t.filepath} \u2192 ${t.changes?.newPath}`)}}}a(rX,"outputResult");function xD(){return new se("batch-repair").description("Batch repair folder locations for all markdown files in a directory").argument("<directory>","Directory to process (relative to vault root)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview changes without modifying files").option("--format <type>","Output format: text|json (default: text)","text").option("--progress","Show progress during processing (default: true)",!0).option("--no-progress","Disable progress output").action(async(n,e)=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,AD.resolve)(e.vault),i=new Ot(r),s=n;if(!await i.directoryExists(s))throw new Ke(`Directory not found: ${s}`,"exocortex batch-repair <existing-directory>");let c=await i.getMarkdownFiles(s);if(c.length===0){if(t==="json"){let w=X.success({success:!0,total:0,movedCount:0,alreadyCorrectCount:0,errorCount:0,results:[],durationMs:0,atomic:!1});console.log(JSON.stringify(w,null,2))}else console.log(`
640
640
  \u{1F4C2} No markdown files found in ${s}`);process.exit(0)}let l=c.map(w=>({command:"repair-folder",filepath:w})),u=e.progress!==!1&&t==="text",f=0;u&&console.log(`
641
- \u{1F50D} Processing ${c.length} files in ${s}...`);let h=await new fc(r,e.dryRun).executeBatch(l,!1),p=0,y=0,v=0;for(let w of h.results)if(w.success?w.changes?.moved?p++:y++:v++,u&&!e.dryRun){f++;let T=Math.round(f/c.length*100);process.stdout.write(`\r Processing ${f}/${c.length} (${T}%)...`)}u&&process.stdout.write("\r"+" ".repeat(60)+"\r");let b={...h,movedCount:p,alreadyCorrectCount:y,errorCount:v};tX(t,b),process.exit(b.success?0:5)}catch(r){D.handle(r)}})}a(xD,"batchRepairCommand");var hy=require("fs"),Xi=require("path");function CD(){return new se("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now();if(!rX(n))throw new Ke(`Invalid UUID format: ${n}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:n});let i=(0,Xi.resolve)(e.vault);if(!(0,hy.existsSync)(i))throw new Te(i);let s=nX(i,n,e.partial??!1),o=Date.now()-r;if(s.length===0){if(t==="json"){let c=X.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${n}`,3,{context:{uuid:n}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${n}`);process.exit(1)}e.partial||s.length>1?sX(s,i,e.format,t,n,o):iX(s[0],i,e.format,t,n,o)}catch(r){D.handle(r)}})}a(CD,"resolveCommand");function rX(n){if(n.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(n)||t.test(n)}a(rX,"isValidUuidFormat");function nX(n,e,t){let r=[],i=e.toLowerCase();function s(o){let c=(0,hy.readdirSync)(o,{withFileTypes:!0});for(let l of c){let u=(0,Xi.join)(o,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&r.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&r.push(u)}}}return a(s,"walk"),s(n),r}a(nX,"findFilesWithUuid");function RD(n){return`obsidian://vault/${encodeURI(n)}`}a(RD,"pathToObsidianUri");function ID(n){let e=n.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,Xi.basename)(n,".md")}a(ID,"extractUuidFromFilename");function iX(n,e,t,r,i,s){let o=(0,Xi.relative)(e,n),c=RD(o),l=ID((0,Xi.basename)(n));if(r==="json"){let u={uuid:l,path:o,absolutePath:n,uri:c},f=X.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(n);break;case"json":console.log(JSON.stringify({uuid:l,path:o,absolutePath:n,uri:c},null,2));break;case"uri":default:console.log(c);break}}a(iX,"outputSingleResult");function sX(n,e,t,r,i,s){let o=n.map(c=>{let l=(0,Xi.relative)(e,c),u=RD(l);return{uuid:ID((0,Xi.basename)(c)),path:l,absolutePath:c,uri:u}});if(r==="json"){let c=X.success({matches:o,count:o.length},{durationMs:s,searchUuid:i,itemCount:o.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of o)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(o,null,2));break;case"uri":default:for(let c of o)console.log(c.uri);break}}a(sX,"outputMultipleResults");var PD=require("fs"),OD=require("path"),Ln=H(Pt());function FD(){return new se("ask").description("Ask a question in natural language about your vault").argument("<question>","Question in natural language (Russian or English)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--show-query","Show the generated SPARQL query").option("--explain","Show explanation of the query conversion").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now(),i=(0,OD.resolve)(e.vault);if(!(0,PD.existsSync)(i))throw new Te(i);let s=new Ln.NLToSPARQLService;t==="text"&&console.log(`\u{1F9E0} Analyzing question: "${n}"
641
+ \u{1F50D} Processing ${c.length} files in ${s}...`);let h=await new fc(r,e.dryRun).executeBatch(l,!1),p=0,y=0,v=0;for(let w of h.results)if(w.success?w.changes?.moved?p++:y++:v++,u&&!e.dryRun){f++;let T=Math.round(f/c.length*100);process.stdout.write(`\r Processing ${f}/${c.length} (${T}%)...`)}u&&process.stdout.write("\r"+" ".repeat(60)+"\r");let b={...h,movedCount:p,alreadyCorrectCount:y,errorCount:v};rX(t,b),process.exit(b.success?0:5)}catch(r){D.handle(r)}})}a(xD,"batchRepairCommand");var hy=require("fs"),Xi=require("path");function CD(){return new se("resolve").description("Resolve UUID to file path").argument("<uuid>","Full or partial UUID to resolve").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: uri|path|json (default: uri)","uri").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--partial","Match partial UUIDs (returns all matches)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now();if(!nX(n))throw new Ke(`Invalid UUID format: ${n}`,"exocortex resolve <uuid> [--format uri|path|json] [--partial]",{uuid:n});let i=(0,Xi.resolve)(e.vault);if(!(0,hy.existsSync)(i))throw new Te(i);let s=iX(i,n,e.partial??!1),o=Date.now()-r;if(s.length===0){if(t==="json"){let c=X.error("VALIDATION_FILE_NOT_FOUND",`UUID not found: ${n}`,3,{context:{uuid:n}});console.log(JSON.stringify(c,null,2))}else console.error(`UUID not found: ${n}`);process.exit(1)}e.partial||s.length>1?oX(s,i,e.format,t,n,o):sX(s[0],i,e.format,t,n,o)}catch(r){D.handle(r)}})}a(CD,"resolveCommand");function nX(n){if(n.length<4)return!1;let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,t=/^[0-9a-f-]+$/i;return e.test(n)||t.test(n)}a(nX,"isValidUuidFormat");function iX(n,e,t){let r=[],i=e.toLowerCase();function s(o){let c=(0,hy.readdirSync)(o,{withFileTypes:!0});for(let l of c){let u=(0,Xi.join)(o,l.name);if(l.isDirectory())!l.name.startsWith(".")&&l.name!=="node_modules"&&s(u);else if(l.isFile()&&l.name.endsWith(".md")){let f=l.name.toLowerCase();t?f.includes(i)&&r.push(u):(f.startsWith(i+".md")||f.startsWith(i+" ")||f.startsWith(i+"-"))&&r.push(u)}}}return a(s,"walk"),s(n),r}a(iX,"findFilesWithUuid");function RD(n){return`obsidian://vault/${encodeURI(n)}`}a(RD,"pathToObsidianUri");function ID(n){let e=n.match(/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i);return e?e[1]:(0,Xi.basename)(n,".md")}a(ID,"extractUuidFromFilename");function sX(n,e,t,r,i,s){let o=(0,Xi.relative)(e,n),c=RD(o),l=ID((0,Xi.basename)(n));if(r==="json"){let u={uuid:l,path:o,absolutePath:n,uri:c},f=X.success(u,{durationMs:s,searchUuid:i});console.log(JSON.stringify(f,null,2))}else switch(t){case"path":console.log(n);break;case"json":console.log(JSON.stringify({uuid:l,path:o,absolutePath:n,uri:c},null,2));break;case"uri":default:console.log(c);break}}a(sX,"outputSingleResult");function oX(n,e,t,r,i,s){let o=n.map(c=>{let l=(0,Xi.relative)(e,c),u=RD(l);return{uuid:ID((0,Xi.basename)(c)),path:l,absolutePath:c,uri:u}});if(r==="json"){let c=X.success({matches:o,count:o.length},{durationMs:s,searchUuid:i,itemCount:o.length});console.log(JSON.stringify(c,null,2))}else switch(t){case"path":for(let c of o)console.log(c.absolutePath);break;case"json":console.log(JSON.stringify(o,null,2));break;case"uri":default:for(let c of o)console.log(c.uri);break}}a(oX,"outputMultipleResults");var PD=require("fs"),OD=require("path"),Ln=H(Pt());function FD(){return new se("ask").description("Ask a question in natural language about your vault").argument("<question>","Question in natural language (Russian or English)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--show-query","Show the generated SPARQL query").option("--explain","Show explanation of the query conversion").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now(),i=(0,OD.resolve)(e.vault);if(!(0,PD.existsSync)(i))throw new Te(i);let s=new Ln.NLToSPARQLService;t==="text"&&console.log(`\u{1F9E0} Analyzing question: "${n}"
642
642
  `);let o=s.convert(n);e.showQuery&&t==="text"&&(console.log("\u{1F4DD} Generated SPARQL Query:"),console.log("\u2500".repeat(50)),console.log(o.query),console.log("\u2500".repeat(50)),console.log()),e.explain&&t==="text"&&(console.log(`\u{1F4D6} Explanation: ${o.explanation}`),console.log(`\u{1F3AF} Confidence: ${(o.confidence*100).toFixed(0)}%`),o.templateName&&console.log(`\u{1F4CB} Template: ${o.templateName}`),o.isFallback&&console.log("\u26A0\uFE0F Using fallback generic search query"),console.log()),t==="text"&&console.log(`\u{1F4E6} Loading vault: ${i}...`);let c=Date.now(),l=new Nt(i),f=await new Ln.NoteToRDFConverter(l).convertVault(),d=new Ln.InMemoryTripleStore;await d.addAll(f);let h=Date.now()-c;t==="text"&&console.log(`\u2705 Loaded ${f.length} triples in ${h}ms
643
643
  `);let p=o.query;p=ay(p),p=au(p);let y=new Ln.ExoQLParser,v=_d(yd(i));v.size>0&&y.setVaultPrefixes(v);let b=y.parse(p),T=new Ln.ExoQLAlgebraTranslator().translate(b);T=new Ln.AlgebraOptimizer().optimize(T);let $=Date.now(),ce=await new Ln.ExoQLQueryExecutor(d).executeAll(T),B=Date.now()-$,V=Date.now()-r,F=s.getSuggestions(n);if(t==="json"){let k=ce.map(at=>at.toJSON()),te={question:n,query:o.query,template:o.templateName,parameters:o.parameters,confidence:o.confidence,explanation:o.explanation,count:ce.length,bindings:k,suggestions:F.length>0?F:void 0},Ye=X.success(te,{durationMs:V,itemCount:ce.length,loadDurationMs:h,execDurationMs:B,triplesScanned:f.length});console.log(JSON.stringify(Ye,null,2))}else{if(console.log(`\u2705 Found ${ce.length} result(s) in ${B}ms
644
- `),ce.length>0?oX(ce,e.format):console.log("No results found."),F.length>0){console.log(`
644
+ `),ce.length>0?aX(ce,e.format):console.log("No results found."),F.length>0){console.log(`
645
645
  \u{1F4A1} Suggestions:`);for(let k of F)console.log(` \u2022 ${k}`)}if(o.confidence<.6&&o.alternatives.length>0){console.log(`
646
646
  \u{1F504} Alternative queries that might work better:`);for(let k=0;k<Math.min(2,o.alternatives.length);k++)console.log(` ${k+1}. ${o.alternatives[k].split(`
647
- `).slice(-3)[0]?.trim()||"..."}`)}}}catch(r){D.handle(r)}})}a(FD,"askCommand");function oX(n,e){let t=n;switch(e){case"json":let r=new eu;console.log(r.format(t));break;case"table":default:let i=new Zl;console.log(i.format(t));break}}a(oX,"formatResults");var hu=require("path"),pu=require("fs"),dc=H(fe()),la=H(Pt());var S_e=H(eh()),du=H(fe()),xd=H(Pt());var py=class{constructor(e="exocortex-cli"){this.appName=e}static{a(this,"NodeLogger")}debug(e,t){console.debug(`[${this.appName}]`,e,t||"")}info(e,t){console.info(`[${this.appName}]`,e,t||"")}warn(e,t){console.warn(`[${this.appName}]`,e,t||"")}error(e,t,r){console.error(`[${this.appName}]`,e,t||"",r||""),t?.stack&&console.error(t.stack)}};var my=class{constructor(){this.handlers=new Map}static{a(this,"NodeEventBus")}publish(e,t){let r=this.handlers.get(e);r&&r.forEach(i=>{try{i(t)}catch(s){console.error(`[EventBus] Error in handler for event "${e}":`,s)}})}subscribe(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let r=this.handlers.get(e);r&&(r.delete(t),r.size===0&&this.handlers.delete(e))}};var yy=H(require("fs/promises")),DD=H(require("path")),ND=H(require("os"));var gy=class{constructor(e=".exocortexrc"){this.config={};this.configPath=DD.join(ND.homedir(),e)}static{a(this,"NodeConfiguration")}async load(){try{let e=await yy.readFile(this.configPath,"utf-8");this.config=JSON.parse(e)}catch{this.config={}}}get(e){let t=e.split("."),r=this.config;for(let i of t)if(r&&typeof r=="object"&&i in r)r=r[i];else return;return r}async set(e,t){let r=e.split("."),i=r.pop(),s=this.config;for(let o of r)(!s[o]||typeof s[o]!="object")&&(s[o]={}),s=s[o];s[i]=t,await this.save()}getAll(){return{...this.config}}async save(){await yy.writeFile(this.configPath,JSON.stringify(this.config,null,2),"utf-8")}};var LD=H(require("readline"));var _y=class{static{a(this,"NodeNotificationService")}info(e,t){console.log(`\u2139 ${e}`)}success(e,t){console.log(`\u2713 ${e}`)}error(e,t){console.error(`\u2717 ${e}`)}warn(e,t){console.warn(`\u26A0 ${e}`)}async confirm(e,t){let r=LD.createInterface({input:process.stdin,output:process.stdout});return new Promise(i=>{r.question(`${e}
647
+ `).slice(-3)[0]?.trim()||"..."}`)}}}catch(r){D.handle(r)}})}a(FD,"askCommand");function aX(n,e){let t=n;switch(e){case"json":let r=new eu;console.log(r.format(t));break;case"table":default:let i=new Zl;console.log(i.format(t));break}}a(aX,"formatResults");var hu=require("path"),pu=require("fs"),dc=H(fe()),la=H(Pt());var v_e=H(eh()),du=H(fe()),xd=H(Pt());var py=class{constructor(e="exocortex-cli"){this.appName=e}static{a(this,"NodeLogger")}debug(e,t){console.debug(`[${this.appName}]`,e,t||"")}info(e,t){console.info(`[${this.appName}]`,e,t||"")}warn(e,t){console.warn(`[${this.appName}]`,e,t||"")}error(e,t,r){console.error(`[${this.appName}]`,e,t||"",r||""),t?.stack&&console.error(t.stack)}};var my=class{constructor(){this.handlers=new Map}static{a(this,"NodeEventBus")}publish(e,t){let r=this.handlers.get(e);r&&r.forEach(i=>{try{i(t)}catch(s){console.error(`[EventBus] Error in handler for event "${e}":`,s)}})}subscribe(e,t){return this.handlers.has(e)||this.handlers.set(e,new Set),this.handlers.get(e).add(t),()=>this.unsubscribe(e,t)}unsubscribe(e,t){let r=this.handlers.get(e);r&&(r.delete(t),r.size===0&&this.handlers.delete(e))}};var yy=H(require("fs/promises")),DD=H(require("path")),ND=H(require("os"));var gy=class{constructor(e=".exocortexrc"){this.config={};this.configPath=DD.join(ND.homedir(),e)}static{a(this,"NodeConfiguration")}async load(){try{let e=await yy.readFile(this.configPath,"utf-8");this.config=JSON.parse(e)}catch{this.config={}}}get(e){let t=e.split("."),r=this.config;for(let i of t)if(r&&typeof r=="object"&&i in r)r=r[i];else return;return r}async set(e,t){let r=e.split("."),i=r.pop(),s=this.config;for(let o of r)(!s[o]||typeof s[o]!="object")&&(s[o]={}),s=s[o];s[i]=t,await this.save()}getAll(){return{...this.config}}async save(){await yy.writeFile(this.configPath,JSON.stringify(this.config,null,2),"utf-8")}};var LD=H(require("readline"));var _y=class{static{a(this,"NodeNotificationService")}info(e,t){console.log(`\u2139 ${e}`)}success(e,t){console.log(`\u2713 ${e}`)}error(e,t){console.error(`\u2717 ${e}`)}warn(e,t){console.warn(`\u26A0 ${e}`)}async confirm(e,t){let r=LD.createInterface({input:process.stdin,output:process.stdout});return new Promise(i=>{r.question(`${e}
648
648
  ${t}
649
- Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes")})})}};var Sy=class{static{a(this,"CLIContainer")}static setup(){du.container.register(xd.DI_TOKENS.ILogger,{useFactory:a(()=>new py("exocortex-cli"),"useFactory")}),du.container.register(xd.DI_TOKENS.IEventBus,{useClass:my}),du.container.register(xd.DI_TOKENS.IConfiguration,{useClass:gy}),du.container.register(xd.DI_TOKENS.INotificationService,{useClass:_y})}static reset(){du.container.clearInstances()}};function Cd(n){Sy.setup(),dc.container.register(la.DI_TOKENS.IVaultAdapter,{useFactory:a(()=>new Nt(n),"useFactory")})}a(Cd,"setupContainer");function aX(n){if(n.length===0)return"No practices found.";let e=[];for(let t of n){let r="\u2B1C";t.doneToday?r="\u2705":t.inProgressToday&&(r="\u{1F504}");let i=t.estimatedDuration?` (${t.estimatedDuration}m)`:"";e.push(`${r} ${t.label}${i}`)}return e.join(`
650
- `)}a(aX,"formatPractices");function cX(n){let e=[`\u{1F4C5} Daily Review: ${n.date}`,"","\u{1F4CA} Tasks:",` Planned: ${n.plannedCount}`,` Completed: ${n.completedCount}`,` In Progress: ${n.inProgressCount}`,` Progress: ${n.completionPercentage}%`,"",`\u23F1\uFE0F Total time: ${Math.round(n.totalTimeMinutes)} minutes`];if(n.practicesDue.length>0){e.push(""),e.push(`\u{1F4CB} Practices due (${n.practicesDue.length}):`);for(let t of n.practicesDue){let r=t.estimatedDuration?` (${t.estimatedDuration}m)`:"";e.push(` \u2B1C ${t.label}${r}`)}}return e.join(`
651
- `)}a(cX,"formatSummary");function kD(){let n=new se("daily").description("Daily review operations for mobile-friendly workflow");return n.command("practices").description("List today's practices (recurring tasks)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async e=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,hu.resolve)(e.vault);if(!(0,pu.existsSync)(r))throw new Te(r);Cd(r);let s=await dc.container.resolve(la.DailyReviewService).getPractices();if(t==="json"){let o=X.success({practices:s,count:s.length});console.log(JSON.stringify(o,null,2))}else console.log(aX(s))}catch(r){D.handle(r)}}),n.command("summary").description("Show today's daily review summary").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").option("--date <value>","Date in YYYY-MM-DD format (default: today)").action(async e=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,hu.resolve)(e.vault);if(!(0,pu.existsSync)(r))throw new Te(r);Cd(r);let i=dc.container.resolve(la.DailyReviewService),s;if(e.date&&(s=new Date(e.date),isNaN(s.getTime())))throw new Ke(`Invalid date format: ${e.date}`,"exocortex daily summary --date YYYY-MM-DD",{date:e.date});let o=await i.getDailyReviewSummary(s);if(t==="json"){let c=X.success(o);console.log(JSON.stringify(c,null,2))}else console.log(cX(o))}catch(r){D.handle(r)}}),n.command("log").description("Quick capture an activity").argument("<label>","Activity label/description").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").option("--start","Start the task immediately (default: true)").option("--no-start","Don't start the task immediately").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);Cd(i);let s=dc.container.resolve(la.DailyReviewService),o=t.start!==!1,c=await s.quickCapture(e,o);if(r==="json"){let l=X.success(c);console.log(JSON.stringify(l,null,2))}else{let l=c.started?"\u{1F504}":"\u2B1C";console.log(`${l} Created: ${c.label}`),console.log(` Path: ${c.path}`)}}catch(i){D.handle(i)}}),n.command("start").description("Start a practice (create task instance from prototype)").argument("<prototype-uid>","Practice/prototype UID to start").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);Cd(i);let o=await dc.container.resolve(la.DailyReviewService).createFromPractice({prototypeUid:e,startImmediately:!0});if(r==="json"){let c=X.success(o);console.log(JSON.stringify(c,null,2))}else console.log(`\u{1F504} Started: ${o.label}`),console.log(` Path: ${o.path}`)}catch(i){D.handle(i)}}),n.command("done").description("Mark a practice as done").argument("<prototype-uid>","Practice/prototype UID to mark as done").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);if(Cd(i),await dc.container.resolve(la.DailyReviewService).markPracticeDone(e),r==="json"){let o=X.success({prototypeUid:e,status:"done"});console.log(JSON.stringify(o,null,2))}else console.log(`\u2705 Marked as done: ${e}`)}catch(i){D.handle(i)}}),n}a(kD,"dailyReviewCommand");var HD=require("fs"),QD=require("path");var bo=require("fs"),ua=require("path"),MD=require("child_process"),Je=H(Pt());var lX=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),ZE=new Map([["exo__","https://exocortex.my/ontology/exo#"],["ems__","https://exocortex.my/ontology/ems#"],["exocmd__","https://exocortex.my/ontology/exocmd#"],["ims__","https://exocortex.my/ontology/ims#"],["ztlk__","https://exocortex.my/ontology/ztlk#"],["ptms__","https://exocortex.my/ontology/ptms#"],["lit__","https://exocortex.my/ontology/lit#"],["inbox__","https://exocortex.my/ontology/inbox#"],["place__","https://exocortex.my/ontology/place#"],["exoob__","https://exocortex.my/ontology/exoob#"],["pn__","https://exocortex.my/ontology/pn#"],["period__","https://exocortex.my/ontology/period#"],["rdf__","http://www.w3.org/1999/02/22-rdf-syntax-ns#"],["rdfs__","http://www.w3.org/2000/01/rdf-schema#"],["owl__","http://www.w3.org/2002/07/owl#"]]);function uX(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return n.match(/^---\r?\n---/)?{}:null;let t=e[1].split(`
652
- `),r={};for(let i of t){let s=i.match(/^(\w[\w]*):\s*(.*)$/);s&&(r[s[1]]=!0)}return r}a(uX,"extractFrontmatter");function jD(n){for(let e of ZE.keys())if(n.startsWith(e))return!0;return!1}a(jD,"hasKnownPrefix");function $D(n){for(let[e,t]of ZE)if(n.startsWith(e))return t+n.substring(e.length);return null}a($D,"keyToURI");function fX(n){let e=[],t=[];for(let r of n)lX.has(r)||(jD(r)?e.push(r):t.push(r));return{toValidate:e,unknownPrefix:t}}a(fX,"classifyKeys");function dX(n){try{return(0,MD.execSync)("git diff --cached --name-only",{cwd:n,encoding:"utf-8"}).split(`
653
- `).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(dX,"getStagedMdFiles");function hX(n){let e=[];function t(r){let i=(0,bo.readdirSync)(r);for(let s of i){if(s.startsWith(".")||s==="node_modules")continue;let o=(0,ua.join)(r,s);(0,bo.statSync)(o).isDirectory()?t(o):s.endsWith(".md")&&e.push((0,ua.relative)(n,o))}}return a(t,"walk"),t(n),e}a(hX,"collectMdFiles");function pX(n){let e=n.lastIndexOf("/");if(e===-1)return null;let t=decodeURIComponent(n.substring(e+1));return t.endsWith(".md")&&(t=t.slice(0,-3)),jD(t)?t:null}a(pX,"extractPropertyNameFromURI");async function mX(n){let e=new Je.InMemoryTripleStore;await e.addAll(n);let t=new Je.ExoQLParser,r=au(`SELECT ?s ?label WHERE {
649
+ Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes")})})}};var Sy=class{static{a(this,"CLIContainer")}static setup(){du.container.register(xd.DI_TOKENS.ILogger,{useFactory:a(()=>new py("exocortex-cli"),"useFactory")}),du.container.register(xd.DI_TOKENS.IEventBus,{useClass:my}),du.container.register(xd.DI_TOKENS.IConfiguration,{useClass:gy}),du.container.register(xd.DI_TOKENS.INotificationService,{useClass:_y})}static reset(){du.container.clearInstances()}};function Cd(n){Sy.setup(),dc.container.register(la.DI_TOKENS.IVaultAdapter,{useFactory:a(()=>new Nt(n),"useFactory")})}a(Cd,"setupContainer");function cX(n){if(n.length===0)return"No practices found.";let e=[];for(let t of n){let r="\u2B1C";t.doneToday?r="\u2705":t.inProgressToday&&(r="\u{1F504}");let i=t.estimatedDuration?` (${t.estimatedDuration}m)`:"";e.push(`${r} ${t.label}${i}`)}return e.join(`
650
+ `)}a(cX,"formatPractices");function lX(n){let e=[`\u{1F4C5} Daily Review: ${n.date}`,"","\u{1F4CA} Tasks:",` Planned: ${n.plannedCount}`,` Completed: ${n.completedCount}`,` In Progress: ${n.inProgressCount}`,` Progress: ${n.completionPercentage}%`,"",`\u23F1\uFE0F Total time: ${Math.round(n.totalTimeMinutes)} minutes`];if(n.practicesDue.length>0){e.push(""),e.push(`\u{1F4CB} Practices due (${n.practicesDue.length}):`);for(let t of n.practicesDue){let r=t.estimatedDuration?` (${t.estimatedDuration}m)`:"";e.push(` \u2B1C ${t.label}${r}`)}}return e.join(`
651
+ `)}a(lX,"formatSummary");function kD(){let n=new se("daily").description("Daily review operations for mobile-friendly workflow");return n.command("practices").description("List today's practices (recurring tasks)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async e=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,hu.resolve)(e.vault);if(!(0,pu.existsSync)(r))throw new Te(r);Cd(r);let s=await dc.container.resolve(la.DailyReviewService).getPractices();if(t==="json"){let o=X.success({practices:s,count:s.length});console.log(JSON.stringify(o,null,2))}else console.log(cX(s))}catch(r){D.handle(r)}}),n.command("summary").description("Show today's daily review summary").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").option("--date <value>","Date in YYYY-MM-DD format (default: today)").action(async e=>{let t=e.format||"text";D.setFormat(t);try{let r=(0,hu.resolve)(e.vault);if(!(0,pu.existsSync)(r))throw new Te(r);Cd(r);let i=dc.container.resolve(la.DailyReviewService),s;if(e.date&&(s=new Date(e.date),isNaN(s.getTime())))throw new Ke(`Invalid date format: ${e.date}`,"exocortex daily summary --date YYYY-MM-DD",{date:e.date});let o=await i.getDailyReviewSummary(s);if(t==="json"){let c=X.success(o);console.log(JSON.stringify(c,null,2))}else console.log(lX(o))}catch(r){D.handle(r)}}),n.command("log").description("Quick capture an activity").argument("<label>","Activity label/description").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").option("--start","Start the task immediately (default: true)").option("--no-start","Don't start the task immediately").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);Cd(i);let s=dc.container.resolve(la.DailyReviewService),o=t.start!==!1,c=await s.quickCapture(e,o);if(r==="json"){let l=X.success(c);console.log(JSON.stringify(l,null,2))}else{let l=c.started?"\u{1F504}":"\u2B1C";console.log(`${l} Created: ${c.label}`),console.log(` Path: ${c.path}`)}}catch(i){D.handle(i)}}),n.command("start").description("Start a practice (create task instance from prototype)").argument("<prototype-uid>","Practice/prototype UID to start").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);Cd(i);let o=await dc.container.resolve(la.DailyReviewService).createFromPractice({prototypeUid:e,startImmediately:!0});if(r==="json"){let c=X.success(o);console.log(JSON.stringify(c,null,2))}else console.log(`\u{1F504} Started: ${o.label}`),console.log(` Path: ${o.path}`)}catch(i){D.handle(i)}}),n.command("done").description("Mark a practice as done").argument("<prototype-uid>","Practice/prototype UID to mark as done").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: text|json","text").action(async(e,t)=>{let r=t.format||"text";D.setFormat(r);try{let i=(0,hu.resolve)(t.vault);if(!(0,pu.existsSync)(i))throw new Te(i);if(Cd(i),await dc.container.resolve(la.DailyReviewService).markPracticeDone(e),r==="json"){let o=X.success({prototypeUid:e,status:"done"});console.log(JSON.stringify(o,null,2))}else console.log(`\u2705 Marked as done: ${e}`)}catch(i){D.handle(i)}}),n}a(kD,"dailyReviewCommand");var HD=require("fs"),QD=require("path");var bo=require("fs"),ua=require("path"),MD=require("child_process"),Je=H(Pt());var uX=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),ZE=new Map([["exo__","https://exocortex.my/ontology/exo#"],["ems__","https://exocortex.my/ontology/ems#"],["exocmd__","https://exocortex.my/ontology/exocmd#"],["ims__","https://exocortex.my/ontology/ims#"],["ztlk__","https://exocortex.my/ontology/ztlk#"],["ptms__","https://exocortex.my/ontology/ptms#"],["lit__","https://exocortex.my/ontology/lit#"],["inbox__","https://exocortex.my/ontology/inbox#"],["place__","https://exocortex.my/ontology/place#"],["exoob__","https://exocortex.my/ontology/exoob#"],["pn__","https://exocortex.my/ontology/pn#"],["period__","https://exocortex.my/ontology/period#"],["rdf__","http://www.w3.org/1999/02/22-rdf-syntax-ns#"],["rdfs__","http://www.w3.org/2000/01/rdf-schema#"],["owl__","http://www.w3.org/2002/07/owl#"]]);function fX(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return n.match(/^---\r?\n---/)?{}:null;let t=e[1].split(`
652
+ `),r={};for(let i of t){let s=i.match(/^(\w[\w]*):\s*(.*)$/);s&&(r[s[1]]=!0)}return r}a(fX,"extractFrontmatter");function jD(n){for(let e of ZE.keys())if(n.startsWith(e))return!0;return!1}a(jD,"hasKnownPrefix");function $D(n){for(let[e,t]of ZE)if(n.startsWith(e))return t+n.substring(e.length);return null}a($D,"keyToURI");function dX(n){let e=[],t=[];for(let r of n)uX.has(r)||(jD(r)?e.push(r):t.push(r));return{toValidate:e,unknownPrefix:t}}a(dX,"classifyKeys");function hX(n){try{return(0,MD.execSync)("git diff --cached --name-only",{cwd:n,encoding:"utf-8"}).split(`
653
+ `).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(hX,"getStagedMdFiles");function pX(n){let e=[];function t(r){let i=(0,bo.readdirSync)(r);for(let s of i){if(s.startsWith(".")||s==="node_modules")continue;let o=(0,ua.join)(r,s);(0,bo.statSync)(o).isDirectory()?t(o):s.endsWith(".md")&&e.push((0,ua.relative)(n,o))}}return a(t,"walk"),t(n),e}a(pX,"collectMdFiles");function mX(n){let e=n.lastIndexOf("/");if(e===-1)return null;let t=decodeURIComponent(n.substring(e+1));return t.endsWith(".md")&&(t=t.slice(0,-3)),jD(t)?t:null}a(mX,"extractPropertyNameFromURI");async function gX(n){let e=new Je.InMemoryTripleStore;await e.addAll(n);let t=new Je.ExoQLParser,r=au(`SELECT ?s ?label WHERE {
654
654
  {
655
655
  ?s a ?type .
656
656
  FILTER(CONTAINS(STR(?type), "Property"))
@@ -667,19 +667,19 @@ Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes
667
667
  FILTER(!CONTAINS(STR(?class), "PropertyCardinality"))
668
668
  }
669
669
  OPTIONAL { ?s exo:Asset_label ?label }
670
- }`),i=t.parse(r),o=new Je.ExoQLAlgebraTranslator().translate(i);o=new Je.AlgebraOptimizer().optimize(o);let u=await new Je.ExoQLQueryExecutor(e).executeAll(o),f=new Set;for(let d of u){let h=d.toJSON(),p=h.s;if(typeof p=="string"){let v=pX(p);if(v){let b=$D(v);b&&f.add(b)}}let y=h.label;typeof y=="string"&&y.startsWith("https://exocortex.my/ontology/")&&f.add(y)}return f}a(mX,"loadDeclaredProperties");function gX(n,e,t){let r=[],i;try{i=(0,bo.readFileSync)(n,"utf-8")}catch{return[]}let s=uX(i);if(!s)return[];let o=Object.keys(s),{toValidate:c,unknownPrefix:l}=fX(o);for(let u of l)r.push({file:e,property:u,reason:`Unknown namespace prefix in "${u}"`});for(let u of c){let f=$D(u);f&&!t.has(f)&&r.push({file:e,property:u,reason:`Property "${u}" is not declared in the ontology`})}return r}a(gX,"validateFile");var yX="http://www.w3.org/2000/01/rdf-schema#subClassOf",_X="https://exocortex.my/ontology/exo#Class_superClass",SX="http://www.w3.org/2000/01/rdf-schema#label";function BD(n){let e=n.indexOf("__");if(e===-1)return null;let t=n.slice(0,e+2),r=n.slice(e+2),i=ZE.get(t);return!i||!r?null:i+r}a(BD,"labelToOntologyIRI");function vX(n){let e=decodeURIComponent(n),t=e.lastIndexOf("/");if(t===-1)return null;let r=e.slice(t+1),i=r.endsWith(".md")?r.slice(0,-3):r;return BD(i)}a(vX,"fileIriToOntologyURIFromFilename");function bX(n){let e=a(r=>{if(r instanceof Je.DomainIRI)return{type:"iri",value:r.value};if(r instanceof Je.DomainLiteral){let i={type:"literal",value:r.value};return r.datatype&&(i.datatype=r.datatype.value),r.language&&(i.language=r.language),i}return null},"mapNode"),t=[];for(let r of n){let i=e(r.subject),s=e(r.predicate),o=e(r.object);i&&s&&o&&t.push({subject:i,predicate:s,object:o})}return t}a(bX,"domainToAlgebraTriples");var JE=class{constructor(e){this.subClassMap=new Map;let t=new Map,r=new Set,i=a(s=>s===yX||s===_X,"isSubClassPredicate");for(let s of e)s.predicate instanceof Je.DomainIRI&&i(s.predicate.value)&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainIRI&&(r.add(s.subject.value),r.add(s.object.value));for(let s of e)if(s.predicate instanceof Je.DomainIRI&&s.predicate.value===SX&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainLiteral){let o=BD(s.object.value);o&&t.set(s.subject.value,o)}for(let s of r)if(!t.has(s)){let o=vX(s);o&&t.set(s,o)}for(let[s,o]of t){let c=this.subClassMap.get(s)??new Set;c.add(o),this.subClassMap.set(s,c)}for(let s of e)if(s.predicate instanceof Je.DomainIRI&&i(s.predicate.value)&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainIRI){let o=s.subject.value,c=s.object.value,l=this.subClassMap.get(o)??new Set;l.add(c),this.subClassMap.set(o,l);let u=t.get(o),f=c.startsWith("obsidian://")?t.get(c):c;if(u&&f){let d=this.subClassMap.get(u)??new Set;d.add(f),this.subClassMap.set(u,d)}}}static{a(this,"TripleClassHierarchy")}isSubClassOf(e,t){let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===t)return!0;if(r.has(s))continue;r.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)i.push(c)}return!1}};function wX(n,e){let t=`file://${n}`,r="https://exocortex.my/cli/shacl-validator",i={earl:"http://www.w3.org/ns/earl#",dc:"http://purl.org/dc/terms/",xsd:"http://www.w3.org/2001/XMLSchema#",sh:"http://www.w3.org/ns/shacl#"},s=[{"@type":"earl:Assertor","@id":r,"dc:title":"Exocortex CLI SHACL-lite Validator"},{"@type":"earl:TestSubject","@id":t,"dc:title":n}];if(e.violations.length===0)s.push({"@type":"earl:Assertion","earl:assertedBy":{"@id":r},"earl:subject":{"@id":t},"earl:result":{"@type":"earl:TestResult","earl:outcome":{"@id":"earl:passed"},"dc:description":"All nodes conform to shapes"}});else for(let o of e.violations)s.push({"@type":"earl:Assertion","earl:assertedBy":{"@id":r},"earl:subject":{"@id":t},"earl:test":{"@id":o.propertyPath},"earl:result":{"@type":"earl:TestResult","earl:outcome":{"@id":"earl:failed"},"dc:description":o.message,"sh:focusNode":o.focusNode,"sh:resultPath":o.propertyPath,"sh:resultSeverity":{"@id":`sh:${o.severity.replace("sh:","")}`},...o.actualValue!==void 0?{"sh:value":o.actualValue}:{}}});return{"@context":i,"@graph":s}}a(wX,"buildEARLReport");var EX="https://exocortex.my/ontology/exo#Asset_legacyValidationException";function TX(n,e){let t=new Set(n.filter(i=>i.predicate instanceof Je.DomainIRI&&i.predicate.value===EX).map(i=>i.subject instanceof Je.DomainIRI?i.subject.value:null).filter(i=>i!==null));if(t.size===0)return e;let r=e.violations.filter(i=>!t.has(i.focusNode));return{conforms:r.every(i=>i.severity!=="sh:Violation"),violations:r}}a(TX,"applyLegacyExceptionFilter");async function AX(n,e){let r=(await Je.ShapeLoader.loadFromVaultFS(n)).getAll(),i=new Je.ShaclShapeRegistry(r),s=new JE(e),o=bX(e);return(0,Je.shaclValidate)(o,i,s)}a(AX,"runShapesValidation");async function xX(n){let e=n.format||"text";try{let t=(0,ua.resolve)(n.vault);if(!(0,bo.existsSync)(t))throw new Te(t);e==="text"&&console.log(`\u{1F4E6} Loading vault (shapes-mode): ${t}...`);let r;if(n.useCache){let c=await new Gn(t).loadOrBuild();r=c.triples,e==="text"&&c.cacheHit&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let o=new Nt(t);r=await new Je.NoteToRDFConverter(o).convertVault()}e==="text"&&(console.log(`\u2705 Loaded ${r.length} triples`),console.log("\u{1F50D} Running SHACL-lite validation..."));let i=await AX(t,r),s=TX(r,i);if(e==="earl"){let o=wX(t,s);console.log(JSON.stringify(o,null,2))}else if(e==="json"){let o=X.success({vaultPath:t,conforms:s.conforms,violationCount:s.violations.length,violations:s.violations});console.log(JSON.stringify(o,null,2))}else if(s.conforms)console.log(`\u2705 Vault conforms to all shapes (${s.violations.length===0?"no violations":`${s.violations.length} warning(s)`}).`);else{let o=new Map;for(let c of s.violations){let l=o.get(c.focusNode)??[];l.push(c),o.set(c.focusNode,l)}console.log(`\u26A0\uFE0F Found ${s.violations.length} SHACL violation(s) in ${o.size} node(s):
671
- `);for(let[c,l]of o){console.log(` \u274C ${c}`);for(let u of l){let f=u.severity.replace("sh:","");console.log(` [${f}] ${u.message}`)}}}s.conforms||(process.exitCode=1)}catch(t){D.handle(t)}}a(xX,"runShapesModeAction");function UD(){return new se("schema").description("Check frontmatter properties against ontology (Issue #2713)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--staged","Only validate git-staged .md files (for pre-commit hooks)").option("--use-cache","Use persistent triple cache (faster vault loading)").option("--shapes-mode","Run SHACL-lite shapes validation instead of schema linting").option("--format <type>","Output format for shapes-mode: text|json|earl","text").action(async n=>{let e=n.output||"text";if(D.setFormat(e),n.shapesMode){await xX(n);return}try{let t=(0,ua.resolve)(n.vault);if(!(0,bo.existsSync)(t))throw new Te(t);let r;if(n.staged){if(r=dX(t),r.length===0){if(e==="json"){let l=X.success({vaultPath:t,filesChecked:0,violations:[],healthy:!0});console.log(JSON.stringify(l,null,2))}else console.log("\u2705 No staged .md files to validate.");return}}else r=hX(t);e==="text"&&console.log(`\u{1F4E6} Loading vault: ${t}...`);let i;if(n.useCache){let u=await new Gn(t).loadOrBuild();i=u.triples,e==="text"&&u.cacheHit&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let l=new Nt(t);i=await new Je.NoteToRDFConverter(l).convertVault()}e==="text"&&(console.log(`\u2705 Loaded ${i.length} triples`),console.log("\u{1F50D} Querying ontology for declared properties..."));let s=await mX(i);e==="text"&&(console.log(`\u{1F4CB} Found ${s.size} declared properties in ontology`),console.log(`\u{1F50D} Validating ${r.length} file(s)...
672
- `));let o=[];for(let l of r){let u=(0,ua.resolve)(t,l),f=gX(u,l,s);o.push(...f)}let c={vaultPath:t,filesChecked:r.length,violations:o,healthy:o.length===0};if(e==="json"){let l=X.success(c);console.log(JSON.stringify(l,null,2))}else if(o.length===0)console.log(`\u2705 All ${r.length} file(s) pass schema validation.`);else{let l=new Map;for(let u of o){let f=l.get(u.file)||[];f.push(u),l.set(u.file,f)}console.log(`\u26A0\uFE0F Found ${o.length} schema violation(s) in ${l.size} file(s):
670
+ }`),i=t.parse(r),o=new Je.ExoQLAlgebraTranslator().translate(i);o=new Je.AlgebraOptimizer().optimize(o);let u=await new Je.ExoQLQueryExecutor(e).executeAll(o),f=new Set;for(let d of u){let h=d.toJSON(),p=h.s;if(typeof p=="string"){let v=mX(p);if(v){let b=$D(v);b&&f.add(b)}}let y=h.label;typeof y=="string"&&y.startsWith("https://exocortex.my/ontology/")&&f.add(y)}return f}a(gX,"loadDeclaredProperties");function yX(n,e,t){let r=[],i;try{i=(0,bo.readFileSync)(n,"utf-8")}catch{return[]}let s=fX(i);if(!s)return[];let o=Object.keys(s),{toValidate:c,unknownPrefix:l}=dX(o);for(let u of l)r.push({file:e,property:u,reason:`Unknown namespace prefix in "${u}"`});for(let u of c){let f=$D(u);f&&!t.has(f)&&r.push({file:e,property:u,reason:`Property "${u}" is not declared in the ontology`})}return r}a(yX,"validateFile");var _X="http://www.w3.org/2000/01/rdf-schema#subClassOf",SX="https://exocortex.my/ontology/exo#Class_superClass",vX="http://www.w3.org/2000/01/rdf-schema#label";function BD(n){let e=n.indexOf("__");if(e===-1)return null;let t=n.slice(0,e+2),r=n.slice(e+2),i=ZE.get(t);return!i||!r?null:i+r}a(BD,"labelToOntologyIRI");function bX(n){let e=decodeURIComponent(n),t=e.lastIndexOf("/");if(t===-1)return null;let r=e.slice(t+1),i=r.endsWith(".md")?r.slice(0,-3):r;return BD(i)}a(bX,"fileIriToOntologyURIFromFilename");function wX(n){let e=a(r=>{if(r instanceof Je.DomainIRI)return{type:"iri",value:r.value};if(r instanceof Je.DomainLiteral){let i={type:"literal",value:r.value};return r.datatype&&(i.datatype=r.datatype.value),r.language&&(i.language=r.language),i}return null},"mapNode"),t=[];for(let r of n){let i=e(r.subject),s=e(r.predicate),o=e(r.object);i&&s&&o&&t.push({subject:i,predicate:s,object:o})}return t}a(wX,"domainToAlgebraTriples");var JE=class{constructor(e){this.subClassMap=new Map;let t=new Map,r=new Set,i=a(s=>s===_X||s===SX,"isSubClassPredicate");for(let s of e)s.predicate instanceof Je.DomainIRI&&i(s.predicate.value)&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainIRI&&(r.add(s.subject.value),r.add(s.object.value));for(let s of e)if(s.predicate instanceof Je.DomainIRI&&s.predicate.value===vX&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainLiteral){let o=BD(s.object.value);o&&t.set(s.subject.value,o)}for(let s of r)if(!t.has(s)){let o=bX(s);o&&t.set(s,o)}for(let[s,o]of t){let c=this.subClassMap.get(s)??new Set;c.add(o),this.subClassMap.set(s,c)}for(let s of e)if(s.predicate instanceof Je.DomainIRI&&i(s.predicate.value)&&s.subject instanceof Je.DomainIRI&&s.object instanceof Je.DomainIRI){let o=s.subject.value,c=s.object.value,l=this.subClassMap.get(o)??new Set;l.add(c),this.subClassMap.set(o,l);let u=t.get(o),f=c.startsWith("obsidian://")?t.get(c):c;if(u&&f){let d=this.subClassMap.get(u)??new Set;d.add(f),this.subClassMap.set(u,d)}}}static{a(this,"TripleClassHierarchy")}isSubClassOf(e,t){let r=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===t)return!0;if(r.has(s))continue;r.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)i.push(c)}return!1}};function EX(n,e){let t=`file://${n}`,r="https://exocortex.my/cli/shacl-validator",i={earl:"http://www.w3.org/ns/earl#",dc:"http://purl.org/dc/terms/",xsd:"http://www.w3.org/2001/XMLSchema#",sh:"http://www.w3.org/ns/shacl#"},s=[{"@type":"earl:Assertor","@id":r,"dc:title":"Exocortex CLI SHACL-lite Validator"},{"@type":"earl:TestSubject","@id":t,"dc:title":n}];if(e.violations.length===0)s.push({"@type":"earl:Assertion","earl:assertedBy":{"@id":r},"earl:subject":{"@id":t},"earl:result":{"@type":"earl:TestResult","earl:outcome":{"@id":"earl:passed"},"dc:description":"All nodes conform to shapes"}});else for(let o of e.violations)s.push({"@type":"earl:Assertion","earl:assertedBy":{"@id":r},"earl:subject":{"@id":t},"earl:test":{"@id":o.propertyPath},"earl:result":{"@type":"earl:TestResult","earl:outcome":{"@id":"earl:failed"},"dc:description":o.message,"sh:focusNode":o.focusNode,"sh:resultPath":o.propertyPath,"sh:resultSeverity":{"@id":`sh:${o.severity.replace("sh:","")}`},...o.actualValue!==void 0?{"sh:value":o.actualValue}:{}}});return{"@context":i,"@graph":s}}a(EX,"buildEARLReport");var TX="https://exocortex.my/ontology/exo#Asset_legacyValidationException";function AX(n,e){let t=new Set(n.filter(i=>i.predicate instanceof Je.DomainIRI&&i.predicate.value===TX).map(i=>i.subject instanceof Je.DomainIRI?i.subject.value:null).filter(i=>i!==null));if(t.size===0)return e;let r=e.violations.filter(i=>!t.has(i.focusNode));return{conforms:r.every(i=>i.severity!=="sh:Violation"),violations:r}}a(AX,"applyLegacyExceptionFilter");async function xX(n,e){let r=(await Je.ShapeLoader.loadFromVaultFS(n)).getAll(),i=new Je.ShaclShapeRegistry(r),s=new JE(e),o=wX(e);return(0,Je.shaclValidate)(o,i,s)}a(xX,"runShapesValidation");async function CX(n){let e=n.format||"text";try{let t=(0,ua.resolve)(n.vault);if(!(0,bo.existsSync)(t))throw new Te(t);e==="text"&&console.log(`\u{1F4E6} Loading vault (shapes-mode): ${t}...`);let r;if(n.useCache){let c=await new Gn(t).loadOrBuild();r=c.triples,e==="text"&&c.cacheHit&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let o=new Nt(t);r=await new Je.NoteToRDFConverter(o).convertVault()}e==="text"&&(console.log(`\u2705 Loaded ${r.length} triples`),console.log("\u{1F50D} Running SHACL-lite validation..."));let i=await xX(t,r),s=AX(r,i);if(e==="earl"){let o=EX(t,s);console.log(JSON.stringify(o,null,2))}else if(e==="json"){let o=X.success({vaultPath:t,conforms:s.conforms,violationCount:s.violations.length,violations:s.violations});console.log(JSON.stringify(o,null,2))}else if(s.conforms)console.log(`\u2705 Vault conforms to all shapes (${s.violations.length===0?"no violations":`${s.violations.length} warning(s)`}).`);else{let o=new Map;for(let c of s.violations){let l=o.get(c.focusNode)??[];l.push(c),o.set(c.focusNode,l)}console.log(`\u26A0\uFE0F Found ${s.violations.length} SHACL violation(s) in ${o.size} node(s):
671
+ `);for(let[c,l]of o){console.log(` \u274C ${c}`);for(let u of l){let f=u.severity.replace("sh:","");console.log(` [${f}] ${u.message}`)}}}s.conforms||(process.exitCode=1)}catch(t){D.handle(t)}}a(CX,"runShapesModeAction");function UD(){return new se("schema").description("Check frontmatter properties against ontology (Issue #2713)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--staged","Only validate git-staged .md files (for pre-commit hooks)").option("--use-cache","Use persistent triple cache (faster vault loading)").option("--shapes-mode","Run SHACL-lite shapes validation instead of schema linting").option("--format <type>","Output format for shapes-mode: text|json|earl","text").action(async n=>{let e=n.output||"text";if(D.setFormat(e),n.shapesMode){await CX(n);return}try{let t=(0,ua.resolve)(n.vault);if(!(0,bo.existsSync)(t))throw new Te(t);let r;if(n.staged){if(r=hX(t),r.length===0){if(e==="json"){let l=X.success({vaultPath:t,filesChecked:0,violations:[],healthy:!0});console.log(JSON.stringify(l,null,2))}else console.log("\u2705 No staged .md files to validate.");return}}else r=pX(t);e==="text"&&console.log(`\u{1F4E6} Loading vault: ${t}...`);let i;if(n.useCache){let u=await new Gn(t).loadOrBuild();i=u.triples,e==="text"&&u.cacheHit&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let l=new Nt(t);i=await new Je.NoteToRDFConverter(l).convertVault()}e==="text"&&(console.log(`\u2705 Loaded ${i.length} triples`),console.log("\u{1F50D} Querying ontology for declared properties..."));let s=await gX(i);e==="text"&&(console.log(`\u{1F4CB} Found ${s.size} declared properties in ontology`),console.log(`\u{1F50D} Validating ${r.length} file(s)...
672
+ `));let o=[];for(let l of r){let u=(0,ua.resolve)(t,l),f=yX(u,l,s);o.push(...f)}let c={vaultPath:t,filesChecked:r.length,violations:o,healthy:o.length===0};if(e==="json"){let l=X.success(c);console.log(JSON.stringify(l,null,2))}else if(o.length===0)console.log(`\u2705 All ${r.length} file(s) pass schema validation.`);else{let l=new Map;for(let u of o){let f=l.get(u.file)||[];f.push(u),l.set(u.file,f)}console.log(`\u26A0\uFE0F Found ${o.length} schema violation(s) in ${l.size} file(s):
673
673
  `);for(let[u,f]of l){console.log(` \u274C ${u}`);for(let d of f)console.log(` \u2022 ${d.reason}`)}console.log(`
674
- \u{1F4DD} To fix these issues:`),console.log(" - Remove undeclared properties from frontmatter"),console.log(" - Or declare them in the ontology as Property instances")}o.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(UD,"validateSchemaCommand");var VD=require("fs"),qD=require("path"),WD=require("child_process"),GD=H(Pt());var CX={exo__Asset_uid:"add `exo__Asset_uid: <uuid>` to frontmatter",exo__Asset_isDefinedBy:'add `exo__Asset_isDefinedBy: "[[!kitelev]]"` (or your own ontology marker) to frontmatter',exo__Asset_label:'add `exo__Asset_label: "<short label>"` to frontmatter',exo__Instance_class:'add `exo__Instance_class: ["[[<ClassName>]]"]` to frontmatter'};function RX(n,e){switch(e.code){case"MISSING_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:CX[e.property]??`add \`${e.property}: <value>\` to frontmatter`};case"EMPTY_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`set a non-empty value for \`${e.property}\` (or remove the asset markers if this file is not an Exocortex asset)`};case"EMPTY_OPTIONAL_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`remove \`${e.property}\` from frontmatter or fill it with a non-empty value`};case"INVALID_INSTANCE_CLASS_IRI":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`fix the \`${e.property}\` wikilink target \u2014 namespaced classes (e.g. \`ems__\`, \`exo__\`) cannot contain whitespace or parentheses, otherwise they expand into invalid IRIs`}}}a(RX,"violationToError");function IX(n){try{return(0,WD.execSync)("git diff --cached --name-only",{cwd:n,encoding:"utf-8"}).split(`
675
- `).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(IX,"getStagedMdFiles");function zD(){return new se("frontmatter").description("Check vault frontmatter for missing/empty properties and malformed IRIs (Issue #2997 Phase 4)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--staged","Only validate git-staged .md files (for pre-commit hooks)").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,qD.resolve)(n.vault);if(!(0,VD.existsSync)(t))throw new Te(t);let r=new Nt(t),i=new GD.NoteToRDFConverter(r),s=r.getAllFiles();if(n.staged){let l=new Set(IX(t));s=s.filter(u=>l.has(u.path))}let o=[];for(let l of s){let u=r.getFrontmatter(l);if(u){let f=i.validateExocortexAsset(u);f&&o.push(RX(l.path,f))}try{i.notePathToIRI(l.path)}catch(f){let d=f instanceof Error?f.message:String(f);o.push({file:l.path,code:"INVALID_PATH_IRI",reason:`Invalid IRI format for vault path: ${d}`,hint:`rename the file \u2014 its path \`${l.path}\` cannot be encoded into a valid \`obsidian://vault/...\` IRI (avoid raw whitespace, control characters, and angle brackets)`})}}let c={vaultPath:t,filesChecked:s.length,errors:o,healthy:o.length===0};if(e==="json")console.log(JSON.stringify(X.success(c),null,2));else if(o.length===0)console.log(`\u2705 All ${s.length} file(s) pass frontmatter validation.`);else{console.log(`\u26A0\uFE0F Found ${o.length} frontmatter error(s) in ${new Set(o.map(l=>l.file)).size} file(s):
674
+ \u{1F4DD} To fix these issues:`),console.log(" - Remove undeclared properties from frontmatter"),console.log(" - Or declare them in the ontology as Property instances")}o.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(UD,"validateSchemaCommand");var VD=require("fs"),qD=require("path"),WD=require("child_process"),GD=H(Pt());var RX={exo__Asset_uid:"add `exo__Asset_uid: <uuid>` to frontmatter",exo__Asset_isDefinedBy:'add `exo__Asset_isDefinedBy: "[[!kitelev]]"` (or your own ontology marker) to frontmatter',exo__Asset_label:'add `exo__Asset_label: "<short label>"` to frontmatter',exo__Instance_class:'add `exo__Instance_class: ["[[<ClassName>]]"]` to frontmatter'};function IX(n,e){switch(e.code){case"MISSING_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:RX[e.property]??`add \`${e.property}: <value>\` to frontmatter`};case"EMPTY_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`set a non-empty value for \`${e.property}\` (or remove the asset markers if this file is not an Exocortex asset)`};case"EMPTY_OPTIONAL_PROPERTY":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`remove \`${e.property}\` from frontmatter or fill it with a non-empty value`};case"INVALID_INSTANCE_CLASS_IRI":return{file:n,code:e.code,property:e.property,reason:e.message,hint:`fix the \`${e.property}\` wikilink target \u2014 namespaced classes (e.g. \`ems__\`, \`exo__\`) cannot contain whitespace or parentheses, otherwise they expand into invalid IRIs`}}}a(IX,"violationToError");function PX(n){try{return(0,WD.execSync)("git diff --cached --name-only",{cwd:n,encoding:"utf-8"}).split(`
675
+ `).filter(t=>t.endsWith(".md")&&t.trim().length>0)}catch{return[]}}a(PX,"getStagedMdFiles");function zD(){return new se("frontmatter").description("Check vault frontmatter for missing/empty properties and malformed IRIs (Issue #2997 Phase 4)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").option("--staged","Only validate git-staged .md files (for pre-commit hooks)").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,qD.resolve)(n.vault);if(!(0,VD.existsSync)(t))throw new Te(t);let r=new Nt(t),i=new GD.NoteToRDFConverter(r),s=r.getAllFiles();if(n.staged){let l=new Set(PX(t));s=s.filter(u=>l.has(u.path))}let o=[];for(let l of s){let u=r.getFrontmatter(l);if(u){let f=i.validateExocortexAsset(u);f&&o.push(IX(l.path,f))}try{i.notePathToIRI(l.path)}catch(f){let d=f instanceof Error?f.message:String(f);o.push({file:l.path,code:"INVALID_PATH_IRI",reason:`Invalid IRI format for vault path: ${d}`,hint:`rename the file \u2014 its path \`${l.path}\` cannot be encoded into a valid \`obsidian://vault/...\` IRI (avoid raw whitespace, control characters, and angle brackets)`})}}let c={vaultPath:t,filesChecked:s.length,errors:o,healthy:o.length===0};if(e==="json")console.log(JSON.stringify(X.success(c),null,2));else if(o.length===0)console.log(`\u2705 All ${s.length} file(s) pass frontmatter validation.`);else{console.log(`\u26A0\uFE0F Found ${o.length} frontmatter error(s) in ${new Set(o.map(l=>l.file)).size} file(s):
676
676
  `);for(let l of o)console.log(` \u274C ${l.file}`),console.log(` ${l.reason}`),console.log(` \u{1F4A1} ${l.hint}`);console.log(`
677
- \u{1F4DD} These shapes prevented the file from loading into the SPARQL store (Issue #2997 Phase 2). Fix them so the asset can be indexed.`)}o.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(zD,"validateFrontmatterCommand");function PX(){return new se("iri").description("Check vault files for IRI issues (Issue #2205)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,QD.resolve)(n.vault);if(!(0,HD.existsSync)(t))throw new Te(t);let r=new Gn(t);e==="text"&&console.log(`\u{1F50D} Validating vault: ${t}...`);let i=await r.validateVault();if(e==="json"){let s=X.success({vaultPath:t,issueCount:i.length,issues:i,healthy:i.length===0});console.log(JSON.stringify(s,null,2))}else if(i.length===0)console.log("\u2705 Vault is healthy! No IRI issues found.");else{console.log(`
677
+ \u{1F4DD} These shapes prevented the file from loading into the SPARQL store (Issue #2997 Phase 2). Fix them so the asset can be indexed.`)}o.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(zD,"validateFrontmatterCommand");function OX(){return new se("iri").description("Check vault files for IRI issues (Issue #2205)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=(0,QD.resolve)(n.vault);if(!(0,HD.existsSync)(t))throw new Te(t);let r=new Gn(t);e==="text"&&console.log(`\u{1F50D} Validating vault: ${t}...`);let i=await r.validateVault();if(e==="json"){let s=X.success({vaultPath:t,issueCount:i.length,issues:i,healthy:i.length===0});console.log(JSON.stringify(s,null,2))}else if(i.length===0)console.log("\u2705 Vault is healthy! No IRI issues found.");else{console.log(`
678
678
  \u26A0\uFE0F Found ${i.length} file(s) with IRI issues:
679
679
  `);for(let s of i)console.log(` \u274C ${s.path}`),console.log(` ${s.reason}`);console.log(`
680
680
  \u{1F4DD} To fix these issues:`),console.log(" - Rename files to remove spaces and special characters"),console.log(" - Use dashes (-) or underscores (_) instead of spaces"),console.log(" - Avoid angle brackets (<>) and other special characters"),console.log(`
681
- \u{1F4A1} Run 'exocortex sparql index --strict' to fail on first issue`)}i.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(PX,"validateIriCommand");function KD(){let n=new se("validate").description("Validate vault files (IRI checks, schema linting, frontmatter shapes)");return n.addCommand(PX()),n.addCommand(UD()),n.addCommand(zD()),n}a(KD,"validateCommand");var YD=require("fs"),XD=require("path"),Pr=H(Pt());function JD(){return new se("classes").description("List RDF classes in Obsidian vault or show class details").argument("[class-name]","Optional class name to show details (e.g., ems__Task)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--use-cache","Use persistent cache (faster for repeated queries)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now(),i=(0,XD.resolve)(e.vault);if(!(0,YD.existsSync)(i))throw new Te(i);t==="text"&&console.log(`\u{1F4E6} Loading vault: ${i}...`);let s,o=!1;if(e.useCache){let f=await new Gn(i).loadOrBuild();s=f.triples,o=f.cacheHit,t==="text"&&o&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let u=new Nt(i);s=await new Pr.NoteToRDFConverter(u).convertVault()}let c=new Pr.InMemoryTripleStore;await c.addAll(s);let l=Date.now()-r;if(t==="text"){let u=o?" (from cache)":"";console.log(`\u2705 Loaded ${s.length} triples in ${l}ms${u}
682
- `)}n?await FX(c,n,e,t):await OX(c,e,t)}catch(r){D.handle(r)}})}a(JD,"classesCommand");async function OX(n,e,t){let s=new Pr.ExoQLParser().parse(`
681
+ \u{1F4A1} Run 'exocortex sparql index --strict' to fail on first issue`)}i.length>0&&(process.exitCode=1)}catch(t){D.handle(t)}})}a(OX,"validateIriCommand");function KD(){let n=new se("validate").description("Validate vault files (IRI checks, schema linting, frontmatter shapes)");return n.addCommand(OX()),n.addCommand(UD()),n.addCommand(zD()),n}a(KD,"validateCommand");var YD=require("fs"),XD=require("path"),Pr=H(Pt());function JD(){return new se("classes").alias("describe-class").description("List RDF classes in vault, or describe a class (predicates + counts). Alias `describe-class` is provided per #3043 RFC \xA7B (schema introspection).").argument("[class-name]","Optional class name to show details (e.g., ems__Task)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--format <type>","Output format: table|json","table").option("--output <type>","Response format: text|json (for MCP tools)","text").option("--use-cache","Use persistent cache (faster for repeated queries)").action(async(n,e)=>{let t=e.output||"text";D.setFormat(t);try{let r=Date.now(),i=(0,XD.resolve)(e.vault);if(!(0,YD.existsSync)(i))throw new Te(i);t==="text"&&console.log(`\u{1F4E6} Loading vault: ${i}...`);let s,o=!1;if(e.useCache){let f=await new Gn(i).loadOrBuild();s=f.triples,o=f.cacheHit,t==="text"&&o&&console.log("\u{1F680} Cache hit! Loading from persistent cache...")}else{let u=new Nt(i);s=await new Pr.NoteToRDFConverter(u).convertVault()}let c=new Pr.InMemoryTripleStore;await c.addAll(s);let l=Date.now()-r;if(t==="text"){let u=o?" (from cache)":"";console.log(`\u2705 Loaded ${s.length} triples in ${l}ms${u}
682
+ `)}n?await DX(c,n,e,t):await FX(c,e,t)}catch(r){D.handle(r)}})}a(JD,"classesCommand");async function FX(n,e,t){let s=new Pr.ExoQLParser().parse(`
683
683
  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
684
684
  SELECT ?class (COUNT(?instance) AS ?count)
685
685
  WHERE {
@@ -688,7 +688,7 @@ Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes
688
688
  GROUP BY ?class
689
689
  ORDER BY DESC(?count)
690
690
  `),c=new Pr.ExoQLAlgebraTranslator().translate(s);c=new Pr.AlgebraOptimizer().optimize(c);let d=(await new Pr.ExoQLQueryExecutor(n).executeAll(c)).map(h=>{let p=h.get("class"),y=h.get("count");return{name:p?ZD(p.toString()):"unknown",count:y?parseInt(y.toString(),10):0}});if(t==="json"||e.format==="json"){let h=X.success({classes:d,totalClasses:d.length});console.log(JSON.stringify(h,null,2))}else{if(console.log(`\u{1F4CA} Found ${d.length} RDF class(es):
691
- `),d.length===0){console.log("No classes found in vault.");return}let h=Math.max(...d.map(p=>p.name.length),10);console.log("\u250C"+"\u2500".repeat(h+2)+"\u252C"+"\u2500".repeat(12)+"\u2510"),console.log("\u2502 "+"Class".padEnd(h)+" \u2502 "+"Instances".padEnd(10)+" \u2502"),console.log("\u251C"+"\u2500".repeat(h+2)+"\u253C"+"\u2500".repeat(12)+"\u2524");for(let p of d)console.log("\u2502 "+p.name.padEnd(h)+" \u2502 "+p.count.toString().padStart(10)+" \u2502");console.log("\u2514"+"\u2500".repeat(h+2)+"\u2534"+"\u2500".repeat(12)+"\u2518")}}a(OX,"listAllClasses");async function FX(n,e,t,r){let i=`
691
+ `),d.length===0){console.log("No classes found in vault.");return}let h=Math.max(...d.map(p=>p.name.length),10);console.log("\u250C"+"\u2500".repeat(h+2)+"\u252C"+"\u2500".repeat(12)+"\u2510"),console.log("\u2502 "+"Class".padEnd(h)+" \u2502 "+"Instances".padEnd(10)+" \u2502"),console.log("\u251C"+"\u2500".repeat(h+2)+"\u253C"+"\u2500".repeat(12)+"\u2524");for(let p of d)console.log("\u2502 "+p.name.padEnd(h)+" \u2502 "+p.count.toString().padStart(10)+" \u2502");console.log("\u2514"+"\u2500".repeat(h+2)+"\u2534"+"\u2500".repeat(12)+"\u2518")}}a(FX,"listAllClasses");async function DX(n,e,t,r){let i=`
692
692
  PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
693
693
  SELECT (COUNT(?instance) AS ?count)
694
694
  WHERE {
@@ -708,16 +708,16 @@ Continue? (y/n): `,s=>{r.close(),i(s.toLowerCase()==="y"||s.toLowerCase()==="yes
708
708
  ORDER BY DESC(?usageCount)
709
709
  `;o=s.parse(p),c=new Pr.ExoQLAlgebraTranslator,l=c.translate(o),u=new Pr.AlgebraOptimizer,l=u.optimize(l);let v=(await f.executeAll(l)).map(w=>{let T=w.get("property"),I=w.get("usageCount");return{name:T?ZD(T.toString()):"unknown",usageCount:I?parseInt(I.toString(),10):0}}),b={name:e,instanceCount:h,properties:v};if(r==="json"||t.format==="json"){let w=X.success(b);console.log(JSON.stringify(w,null,2))}else{if(console.log(`\u{1F4CB} Class: ${e}
710
710
  `),console.log(` Instances: ${h}`),console.log(` Properties: ${v.length}
711
- `),v.length===0){console.log(" No properties found.");return}let w=Math.max(...v.map(T=>T.name.length),10);console.log(" \u250C"+"\u2500".repeat(w+2)+"\u252C"+"\u2500".repeat(10)+"\u2510"),console.log(" \u2502 "+"Property".padEnd(w)+" \u2502 "+"Usage".padEnd(8)+" \u2502"),console.log(" \u251C"+"\u2500".repeat(w+2)+"\u253C"+"\u2500".repeat(10)+"\u2524");for(let T of v)console.log(" \u2502 "+T.name.padEnd(w)+" \u2502 "+T.usageCount.toString().padStart(8)+" \u2502");console.log(" \u2514"+"\u2500".repeat(w+2)+"\u2534"+"\u2500".repeat(10)+"\u2518")}}a(FX,"showClassDetails");function ZD(n){let e=n.replace(/^<|>$/g,""),t=e.lastIndexOf("#");if(t!==-1)return e.substring(t+1);let r=e.lastIndexOf("/");return r!==-1?e.substring(r+1):e}a(ZD,"extractLocalName");var eN=require("path"),rT=require("fs"),tN=require("fs"),rN=H(Pt());var eT=class extends Error{static{a(this,"ClassNotFoundError")}constructor(e,t){let r=`Class '${e}' not found in vault`;t&&t.length>0&&(r+=`
712
- Available classes: ${t.join(", ")}`),super(r),this.name="ClassNotFoundError"}},mu=class{constructor(e){this.fsAdapter=e;this.cache=new Map}static{a(this,"ClassResolverService")}async resolve(e,t){if(this.isUUID(t))return t;let r=await this.getOrBuildIndex(e),i=r.get(t);if(!i){let s=Array.from(r.keys()).filter(o=>!this.isUUID(o));throw new eT(t,s)}return i}async listClasses(e){let t=await this.getOrBuildIndex(e);return Array.from(t.keys())}async getOrBuildIndex(e){if(this.cache.has(e))return this.cache.get(e);let t=await this.buildIndex(e);return this.cache.set(e,t),t}async buildIndex(e){let t=new Map,r=await this.fsAdapter.getMarkdownFiles();for(let i of r)try{let s=await this.fsAdapter.getFileMetadata(i);if(!this.isClassDefinition(s))continue;let o=this.getBasename(i),c=s.exo__Asset_uid;if(!c&&this.isUUID(o)&&(c=o),!c)continue;let l=String(c);o&&t.set(o,l);let u=s.exo__Asset_label;u&&typeof u=="string"&&u!==o&&t.set(u,l)}catch{continue}return t}isClassDefinition(e){let t=e.exo__Instance_class;return t?(Array.isArray(t)?t:[t]).some(i=>{let s=String(i);return s.includes("ims__Class")||s.includes("exo__Class")}):!1}getBasename(e){let t=e.split("/");return t[t.length-1].replace(/\.md$/,"")}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var tT=class extends Error{static{a(this,"WikilinkNotFoundError")}constructor(e,t){let r=t?`|${t}`:"";super(`Wikilink [[${e}${r}]] \u2014 file not found in vault`),this.name="WikilinkNotFoundError"}},vy=class{constructor(e){this.fsAdapter=e}static{a(this,"WikilinkValidator")}static{this.WIKILINK_PATTERN=/\[\[([^\]|]+)(?:\|[^\]]*)?]]/g}async validatePropertyValues(e){for(let[,t]of Object.entries(e))await this.validateValue(t)}async validateValue(e){let t=this.extractWikilinks(e);for(let r of t)await this.validateWikilink(r.uuid,r.label)}extractWikilinks(e){let t=[],r=/\[\[([^\]|]+)(?:\|([^\]]*))?\]\]/g,i;for(;(i=r.exec(e))!==null;)t.push({uuid:i[1].trim(),label:i[2]?.trim()});return t}async validateWikilink(e,t){if(!this.looksLikeUUID(e))return;if(!await this.fsAdapter.fileExists(`${e}.md`)&&!await this.fsAdapter.findFileByUID(e))throw new tT(e,t)}looksLikeUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var wy=H(Pt());var DX="de20a3f1-7483-4714-ab28-b45f5cf02c76",NX="Asia/Almaty",by=class{constructor(e,t,r,i){this.fsAdapter=e;this.classResolver=t;this.wikilinkValidator=r;this.shapeRegistry=i}static{a(this,"AssetCreationService")}async create(e){if(!e.label||e.label.trim().length===0)throw new Error("Label cannot be empty");let t=e.label.trim(),r=await this.classResolver.resolve(e.vault,e.classShortName);e.properties&&!e.skipWikilinkValidation&&await this.wikilinkValidator.validatePropertyValues(e.properties);let i=wd(),s=this.generateTimestamp(e.timezone),o=this.buildFrontmatter({assetUuid:i,classShortName:e.classShortName,classUuid:r,label:t,aliases:e.aliases,properties:e.properties,createdBy:e.createdBy||DX,timestamp:s}),c=wy.MetadataHelpers.buildFileContent(o,e.body),l=`01 Inbox/${i}.md`;return e.dryRun||await this.fsAdapter.createFile(l,c),{uuid:i,path:l,label:t,frontmatter:o}}buildFrontmatter(e){let t={};t.exo__Asset_uid=e.assetUuid,t.exo__Asset_label=e.label,t.exo__Asset_createdAt=e.timestamp,t.exo__Asset_createdBy=`"[[${e.createdBy}]]"`,t.exo__Instance_class=[`"[[${e.classUuid}|${e.classShortName}]]"`];let r=[e.label];if(e.aliases&&e.aliases.length>0)for(let i of e.aliases)r.includes(i)||r.push(i);if(t.aliases=r,e.properties)for(let[i,s]of Object.entries(e.properties))i==="exo__Asset_uid"||i==="exo__Asset_label"||i==="exo__Asset_createdAt"||i==="exo__Asset_createdBy"||i==="exo__Instance_class"||i==="aliases"||(t[i]=this.formatPropertyValue(i,s));return t}formatPropertyValue(e,t){if(!t.includes("[["))return t;let r=t.startsWith('"')&&t.endsWith('"')?t:`"${t}"`;return this.isSingleValued(e)?r:[r]}isSingleValued(e){if(!this.shapeRegistry)return!1;let t=wy.Namespace.fromPropertyKey(e);if(!t)return!1;let r=t.namespace.term(t.localName).value;return this.shapeRegistry.get(r)?.cardinality==="Single"}generateTimestamp(e){let t=e||NX,r=new Date,s=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),o=a(c=>s.find(l=>l.type===c)?.value||"00","get");return`${o("year")}-${o("month")}-${o("day")}T${o("hour")}:${o("minute")}:${o("second")}`}};function LX(n){if(!n||n.length===0)return{};let e={};for(let t of n){let r=t.indexOf("=");if(r===-1)throw new Error(`Invalid property format: "${t}". Expected "key=value" format.`);let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();if(!i)throw new Error(`Invalid property format: "${t}". Key cannot be empty.`);e[i]=s}return e}a(LX,"parseProperties");async function kX(n){if(n.bodyFile){if(!(0,rT.existsSync)(n.bodyFile))throw new Error(`Body file not found: ${n.bodyFile}`);return(0,tN.readFileSync)(n.bodyFile,"utf-8")}if(n.body==="-")return MX(3e4);if(n.body)return n.body}a(kX,"resolveBody");function MX(n){return new Promise((e,t)=>{let r=[],i=setTimeout(()=>{process.stdin.removeAllListeners(),process.stdin.destroy(),t(new Error(`Stdin read timed out after ${n}ms. Ensure you pipe content to stdin or close the pipe.`))},n);process.stdin.on("data",s=>{r.push(s)}),process.stdin.on("end",()=>{clearTimeout(i),e(Buffer.concat(r).toString("utf-8"))}),process.stdin.on("error",s=>{clearTimeout(i),t(s)}),process.stdin.isTTY&&(clearTimeout(i),e("")),process.stdin.resume()})}a(MX,"readStdin");function nN(){return new se("create").description("Create a new vault asset with auto-generated UUID, timestamp, and frontmatter").requiredOption("--class <name>","Class short name (e.g. ztlk__PermanentNote) or UUID").requiredOption("--label <text>","Human-readable label for the asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--aliases <names...>","Additional aliases for the asset").option("--property <key=value...>","Property key-value pairs (repeatable)",jX,[]).option("--body <text>","Markdown body content (use '-' to read from stdin)").option("--body-file <path>","Read body content from file").option("--dry-run","Preview frontmatter without writing file").option("--created-by <uuid>","Creator UUID (defaults to ExoAssistant)").option("--timezone <tz>","Timezone for timestamps (defaults to Asia/Almaty)").option("--skip-wikilink-validation","Skip wikilink existence validation").action(async n=>{try{let e=(0,eN.resolve)(n.vault);if(!(0,rT.existsSync)(e))throw new Te(e);let t=LX(n.property),r=await kX(n);r&&(r=r.replace(/\\n/g,`
713
- `));let i=new Ot(e),s=new mu(i),o=new vy(i),c;try{c=await rN.ShapeLoader.loadFromVaultFS(e)}catch{c=void 0}let u=await new by(i,s,o,c).create({classShortName:n.class,label:n.label,aliases:n.aliases,properties:Object.keys(t).length>0?t:void 0,body:r,vault:e,dryRun:n.dryRun,createdBy:n.createdBy,timezone:n.timezone,skipWikilinkValidation:n.skipWikilinkValidation});if(n.dryRun){let d=$X(u.frontmatter,r);process.stderr.write(d+`
711
+ `),v.length===0){console.log(" No properties found.");return}let w=Math.max(...v.map(T=>T.name.length),10);console.log(" \u250C"+"\u2500".repeat(w+2)+"\u252C"+"\u2500".repeat(10)+"\u2510"),console.log(" \u2502 "+"Property".padEnd(w)+" \u2502 "+"Usage".padEnd(8)+" \u2502"),console.log(" \u251C"+"\u2500".repeat(w+2)+"\u253C"+"\u2500".repeat(10)+"\u2524");for(let T of v)console.log(" \u2502 "+T.name.padEnd(w)+" \u2502 "+T.usageCount.toString().padStart(8)+" \u2502");console.log(" \u2514"+"\u2500".repeat(w+2)+"\u2534"+"\u2500".repeat(10)+"\u2518")}}a(DX,"showClassDetails");function ZD(n){let e=n.replace(/^<|>$/g,""),t=e.lastIndexOf("#");if(t!==-1)return e.substring(t+1);let r=e.lastIndexOf("/");return r!==-1?e.substring(r+1):e}a(ZD,"extractLocalName");var eN=require("path"),rT=require("fs"),tN=require("fs"),rN=H(Pt());var eT=class extends Error{static{a(this,"ClassNotFoundError")}constructor(e,t){let r=`Class '${e}' not found in vault`;t&&t.length>0&&(r+=`
712
+ Available classes: ${t.join(", ")}`),super(r),this.name="ClassNotFoundError"}},mu=class{constructor(e){this.fsAdapter=e;this.cache=new Map}static{a(this,"ClassResolverService")}async resolve(e,t){if(this.isUUID(t))return t;let r=await this.getOrBuildIndex(e),i=r.get(t);if(!i){let s=Array.from(r.keys()).filter(o=>!this.isUUID(o));throw new eT(t,s)}return i}async listClasses(e){let t=await this.getOrBuildIndex(e);return Array.from(t.keys())}async getOrBuildIndex(e){if(this.cache.has(e))return this.cache.get(e);let t=await this.buildIndex(e);return this.cache.set(e,t),t}async buildIndex(e){let t=new Map,r=await this.fsAdapter.getMarkdownFiles();for(let i of r)try{let s=await this.fsAdapter.getFileMetadata(i);if(!this.isClassDefinition(s))continue;let o=this.getBasename(i),c=s.exo__Asset_uid;if(!c&&this.isUUID(o)&&(c=o),!c)continue;let l=String(c);o&&t.set(o,l);let u=s.exo__Asset_label;u&&typeof u=="string"&&u!==o&&t.set(u,l)}catch{continue}return t}isClassDefinition(e){let t=e.exo__Instance_class;return t?(Array.isArray(t)?t:[t]).some(i=>{let s=String(i);return s.includes("ims__Class")||s.includes("exo__Class")}):!1}getBasename(e){let t=e.split("/");return t[t.length-1].replace(/\.md$/,"")}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var tT=class extends Error{static{a(this,"WikilinkNotFoundError")}constructor(e,t){let r=t?`|${t}`:"";super(`Wikilink [[${e}${r}]] \u2014 file not found in vault`),this.name="WikilinkNotFoundError"}},vy=class{constructor(e){this.fsAdapter=e}static{a(this,"WikilinkValidator")}static{this.WIKILINK_PATTERN=/\[\[([^\]|]+)(?:\|[^\]]*)?]]/g}async validatePropertyValues(e){for(let[,t]of Object.entries(e))await this.validateValue(t)}async validateValue(e){let t=this.extractWikilinks(e);for(let r of t)await this.validateWikilink(r.uuid,r.label)}extractWikilinks(e){let t=[],r=/\[\[([^\]|]+)(?:\|([^\]]*))?\]\]/g,i;for(;(i=r.exec(e))!==null;)t.push({uuid:i[1].trim(),label:i[2]?.trim()});return t}async validateWikilink(e,t){if(!this.looksLikeUUID(e))return;if(!await this.fsAdapter.fileExists(`${e}.md`)&&!await this.fsAdapter.findFileByUID(e))throw new tT(e,t)}looksLikeUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var wy=H(Pt());var NX="de20a3f1-7483-4714-ab28-b45f5cf02c76",LX="Asia/Almaty",by=class{constructor(e,t,r,i){this.fsAdapter=e;this.classResolver=t;this.wikilinkValidator=r;this.shapeRegistry=i}static{a(this,"AssetCreationService")}async create(e){if(!e.label||e.label.trim().length===0)throw new Error("Label cannot be empty");let t=e.label.trim(),r=await this.classResolver.resolve(e.vault,e.classShortName);e.properties&&!e.skipWikilinkValidation&&await this.wikilinkValidator.validatePropertyValues(e.properties);let i=wd(),s=this.generateTimestamp(e.timezone),o=this.buildFrontmatter({assetUuid:i,classShortName:e.classShortName,classUuid:r,label:t,aliases:e.aliases,properties:e.properties,createdBy:e.createdBy||NX,timestamp:s}),c=wy.MetadataHelpers.buildFileContent(o,e.body),l=`01 Inbox/${i}.md`;return e.dryRun||await this.fsAdapter.createFile(l,c),{uuid:i,path:l,label:t,frontmatter:o}}buildFrontmatter(e){let t={};t.exo__Asset_uid=e.assetUuid,t.exo__Asset_label=e.label,t.exo__Asset_createdAt=e.timestamp,t.exo__Asset_createdBy=`"[[${e.createdBy}]]"`,t.exo__Instance_class=[`"[[${e.classUuid}|${e.classShortName}]]"`];let r=[e.label];if(e.aliases&&e.aliases.length>0)for(let i of e.aliases)r.includes(i)||r.push(i);if(t.aliases=r,e.properties)for(let[i,s]of Object.entries(e.properties))i==="exo__Asset_uid"||i==="exo__Asset_label"||i==="exo__Asset_createdAt"||i==="exo__Asset_createdBy"||i==="exo__Instance_class"||i==="aliases"||(t[i]=this.formatPropertyValue(i,s));return t}formatPropertyValue(e,t){if(!t.includes("[["))return t;let r=t.startsWith('"')&&t.endsWith('"')?t:`"${t}"`;return this.isSingleValued(e)?r:[r]}isSingleValued(e){if(!this.shapeRegistry)return!1;let t=wy.Namespace.fromPropertyKey(e);if(!t)return!1;let r=t.namespace.term(t.localName).value;return this.shapeRegistry.get(r)?.cardinality==="Single"}generateTimestamp(e){let t=e||LX,r=new Date,s=new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),o=a(c=>s.find(l=>l.type===c)?.value||"00","get");return`${o("year")}-${o("month")}-${o("day")}T${o("hour")}:${o("minute")}:${o("second")}`}};function kX(n){if(!n||n.length===0)return{};let e={};for(let t of n){let r=t.indexOf("=");if(r===-1)throw new Error(`Invalid property format: "${t}". Expected "key=value" format.`);let i=t.substring(0,r).trim(),s=t.substring(r+1).trim();if(!i)throw new Error(`Invalid property format: "${t}". Key cannot be empty.`);e[i]=s}return e}a(kX,"parseProperties");async function MX(n){if(n.bodyFile){if(!(0,rT.existsSync)(n.bodyFile))throw new Error(`Body file not found: ${n.bodyFile}`);return(0,tN.readFileSync)(n.bodyFile,"utf-8")}if(n.body==="-")return jX(3e4);if(n.body)return n.body}a(MX,"resolveBody");function jX(n){return new Promise((e,t)=>{let r=[],i=setTimeout(()=>{process.stdin.removeAllListeners(),process.stdin.destroy(),t(new Error(`Stdin read timed out after ${n}ms. Ensure you pipe content to stdin or close the pipe.`))},n);process.stdin.on("data",s=>{r.push(s)}),process.stdin.on("end",()=>{clearTimeout(i),e(Buffer.concat(r).toString("utf-8"))}),process.stdin.on("error",s=>{clearTimeout(i),t(s)}),process.stdin.isTTY&&(clearTimeout(i),e("")),process.stdin.resume()})}a(jX,"readStdin");function nN(){return new se("create").description("Create a new vault asset with auto-generated UUID, timestamp, and frontmatter").requiredOption("--class <name>","Class short name (e.g. ztlk__PermanentNote) or UUID").requiredOption("--label <text>","Human-readable label for the asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--aliases <names...>","Additional aliases for the asset").option("--property <key=value...>","Property key-value pairs (repeatable)",$X,[]).option("--body <text>","Markdown body content (use '-' to read from stdin)").option("--body-file <path>","Read body content from file").option("--dry-run","Preview frontmatter without writing file").option("--created-by <uuid>","Creator UUID (defaults to ExoAssistant)").option("--timezone <tz>","Timezone for timestamps (defaults to Asia/Almaty)").option("--skip-wikilink-validation","Skip wikilink existence validation").action(async n=>{try{let e=(0,eN.resolve)(n.vault);if(!(0,rT.existsSync)(e))throw new Te(e);let t=kX(n.property),r=await MX(n);r&&(r=r.replace(/\\n/g,`
713
+ `));let i=new Ot(e),s=new mu(i),o=new vy(i),c;try{c=await rN.ShapeLoader.loadFromVaultFS(e)}catch{c=void 0}let u=await new by(i,s,o,c).create({classShortName:n.class,label:n.label,aliases:n.aliases,properties:Object.keys(t).length>0?t:void 0,body:r,vault:e,dryRun:n.dryRun,createdBy:n.createdBy,timezone:n.timezone,skipWikilinkValidation:n.skipWikilinkValidation});if(n.dryRun){let d=BX(u.frontmatter,r);process.stderr.write(d+`
714
714
  `)}let f={uuid:u.uuid,path:u.path,label:u.label};process.stdout.write(JSON.stringify(f)+`
715
- `),process.exit(0)}catch(e){D.handle(e)}})}a(nN,"createCommand");function jX(n,e){return e.concat([n])}a(jX,"collect");function $X(n,e){let t=["--- DRY RUN PREVIEW ---","---"];for(let[r,i]of Object.entries(n))if(Array.isArray(i)){t.push(`${r}:`);for(let s of i)t.push(` - ${s}`)}else t.push(`${r}: ${i}`);return t.push("---"),e&&(t.push(""),t.push(e)),t.push("--- END PREVIEW ---"),t.join(`
716
- `)}a($X,"formatFrontmatterPreview");var sT=require("path"),oT=require("fs");var iN=H(require("path"));var Ey=class{constructor(e,t,r){this.activeFs=e;this.archiveFs=t;this.classResolver=r}static{a(this,"ArchiveService")}async archive(e){let t=await this.resolveClasses(e.vaultPath,e.classes),r=await this.activeFs.getMarkdownFiles(),i=[],s=[];for(let f of r)try{let d=await this.activeFs.readFile(f),h=this.extractFrontmatter(d);if(this.isCandidate(h,t,e.year)){let p=this.extractUUID(f,h);p&&i.push({relativePath:f,uuid:p,metadata:h,content:d})}else h.archived===!0||s.push(d)}catch{continue}let o=this.buildReferenceSet(s),c=[],l=[];for(let f of i)if(e.noReferenced&&o.has(f.uuid)){let d=this.findReferencingFiles(f.uuid,s);c.push({uuid:f.uuid,file:f.relativePath,status:"blocked",reason:"Referenced by non-archived assets",blockedBy:d})}else l.push(f);let u=0;if(e.dryRun){u=await this.countArchiveOntologies(l,e.vaultPath,e.archiveVaultPath);for(let f of l)c.push({uuid:f.uuid,file:f.relativePath,status:"moved",reason:"dry-run: would be moved"})}else{u=await this.createArchiveOntologies(l,e.vaultPath,e.archiveVaultPath);for(let f of l)await this.transferFile(f,e.archiveVaultPath),c.push({uuid:f.uuid,file:f.relativePath,status:"moved"})}return{moved:l.length,blocked:c.filter(f=>f.status==="blocked").length,skipped:0,ontologies_created:u,details:c}}async resolveClasses(e,t){let r=new Set;for(let i of t)try{let s=await this.classResolver.resolve(e,i);r.add(s),r.add(i)}catch{r.add(i)}return r}isCandidate(e,t,r){return!(e.archived!==!0||!this.matchesClass(e,t)||!this.matchesYear(e,r))}matchesClass(e,t){let r=e.exo__Instance_class;return r?(Array.isArray(r)?r:[r]).some(s=>{let o=String(s).replace(/["'[\]]/g,"").trim();return t.has(o)}):!1}matchesYear(e,t){let r=[e.ems__Effort_resolutionTimestamp,e.ems__Effort_endTimestamp];for(let i of r)if(i&&this.extractYear(i)===t)return!0;return!1}extractYear(e){if(e instanceof Date)return e.getFullYear();let r=String(e).match(/^(\d{4})/);return r?parseInt(r[1],10):null}extractUUID(e,t){let r=t.exo__Asset_uid;if(r)return String(r);let i=iN.default.basename(e,".md");return this.isUUID(i)?i:null}buildReferenceSet(e){let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,r=new Set;for(let i of e){let s=i.match(t);if(s)for(let o of s)r.add(o.toLowerCase())}return r}findReferencingFiles(e,t){return["referenced in active vault"]}async createArchiveOntologies(e,t,r){let i=this.collectOntologies(e),s=0;for(let[o,c]of i.entries()){let l=this.getArchiveOntologyName(o),u=l+".md";if(!await this.archiveFs.fileExists(u))try{let d=await this.activeFs.readFile(o+".md"),h=this.extractFrontmatter(d),p=h.exo__Ontology_url;if(p){let y=String(p).replace(/#$/,"")+"/archive#",v=this.buildOntologyFile(l,y,h);await this.archiveFs.writeFile(u,v),s++}}catch{continue}}return s}async countArchiveOntologies(e,t,r){let i=this.collectOntologies(e),s=0;for(let[o,c]of i.entries()){let u=this.getArchiveOntologyName(o)+".md";if(!await this.archiveFs.fileExists(u))try{let d=await this.activeFs.readFile(o+".md");this.extractFrontmatter(d).exo__Ontology_url&&s++}catch{continue}}return s}collectOntologies(e){let t=new Map;for(let r of e){let i=r.metadata.exo__Asset_isDefinedBy;if(!i)continue;let s=this.extractWikilinkTarget(String(i));if(!s)continue;let o=t.get(s)||[];o.push(r),t.set(s,o)}return t}getArchiveOntologyName(e){return e+"_archive"}buildOntologyFile(e,t,r){let i={exo__Instance_class:r.exo__Instance_class||"exo__Ontology",exo__Asset_label:`${r.exo__Asset_label||e} (Archive)`,exo__Ontology_url:t};return`---
715
+ `),process.exit(0)}catch(e){D.handle(e)}})}a(nN,"createCommand");function $X(n,e){return e.concat([n])}a($X,"collect");function BX(n,e){let t=["--- DRY RUN PREVIEW ---","---"];for(let[r,i]of Object.entries(n))if(Array.isArray(i)){t.push(`${r}:`);for(let s of i)t.push(` - ${s}`)}else t.push(`${r}: ${i}`);return t.push("---"),e&&(t.push(""),t.push(e)),t.push("--- END PREVIEW ---"),t.join(`
716
+ `)}a(BX,"formatFrontmatterPreview");var sT=require("path"),oT=require("fs");var iN=H(require("path"));var Ey=class{constructor(e,t,r){this.activeFs=e;this.archiveFs=t;this.classResolver=r}static{a(this,"ArchiveService")}async archive(e){let t=await this.resolveClasses(e.vaultPath,e.classes),r=await this.activeFs.getMarkdownFiles(),i=[],s=[];for(let f of r)try{let d=await this.activeFs.readFile(f),h=this.extractFrontmatter(d);if(this.isCandidate(h,t,e.year)){let p=this.extractUUID(f,h);p&&i.push({relativePath:f,uuid:p,metadata:h,content:d})}else h.archived===!0||s.push(d)}catch{continue}let o=this.buildReferenceSet(s),c=[],l=[];for(let f of i)if(e.noReferenced&&o.has(f.uuid)){let d=this.findReferencingFiles(f.uuid,s);c.push({uuid:f.uuid,file:f.relativePath,status:"blocked",reason:"Referenced by non-archived assets",blockedBy:d})}else l.push(f);let u=0;if(e.dryRun){u=await this.countArchiveOntologies(l,e.vaultPath,e.archiveVaultPath);for(let f of l)c.push({uuid:f.uuid,file:f.relativePath,status:"moved",reason:"dry-run: would be moved"})}else{u=await this.createArchiveOntologies(l,e.vaultPath,e.archiveVaultPath);for(let f of l)await this.transferFile(f,e.archiveVaultPath),c.push({uuid:f.uuid,file:f.relativePath,status:"moved"})}return{moved:l.length,blocked:c.filter(f=>f.status==="blocked").length,skipped:0,ontologies_created:u,details:c}}async resolveClasses(e,t){let r=new Set;for(let i of t)try{let s=await this.classResolver.resolve(e,i);r.add(s),r.add(i)}catch{r.add(i)}return r}isCandidate(e,t,r){return!(e.archived!==!0||!this.matchesClass(e,t)||!this.matchesYear(e,r))}matchesClass(e,t){let r=e.exo__Instance_class;return r?(Array.isArray(r)?r:[r]).some(s=>{let o=String(s).replace(/["'[\]]/g,"").trim();return t.has(o)}):!1}matchesYear(e,t){let r=[e.ems__Effort_resolutionTimestamp,e.ems__Effort_endTimestamp];for(let i of r)if(i&&this.extractYear(i)===t)return!0;return!1}extractYear(e){if(e instanceof Date)return e.getFullYear();let r=String(e).match(/^(\d{4})/);return r?parseInt(r[1],10):null}extractUUID(e,t){let r=t.exo__Asset_uid;if(r)return String(r);let i=iN.default.basename(e,".md");return this.isUUID(i)?i:null}buildReferenceSet(e){let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,r=new Set;for(let i of e){let s=i.match(t);if(s)for(let o of s)r.add(o.toLowerCase())}return r}findReferencingFiles(e,t){return["referenced in active vault"]}async createArchiveOntologies(e,t,r){let i=this.collectOntologies(e),s=0;for(let[o,c]of i.entries()){let l=this.getArchiveOntologyName(o),u=l+".md";if(!await this.archiveFs.fileExists(u))try{let d=await this.activeFs.readFile(o+".md"),h=this.extractFrontmatter(d),p=h.exo__Ontology_url;if(p){let y=String(p).replace(/#$/,"")+"/archive#",v=this.buildOntologyFile(l,y,h);await this.archiveFs.writeFile(u,v),s++}}catch{continue}}return s}async countArchiveOntologies(e,t,r){let i=this.collectOntologies(e),s=0;for(let[o,c]of i.entries()){let u=this.getArchiveOntologyName(o)+".md";if(!await this.archiveFs.fileExists(u))try{let d=await this.activeFs.readFile(o+".md");this.extractFrontmatter(d).exo__Ontology_url&&s++}catch{continue}}return s}collectOntologies(e){let t=new Map;for(let r of e){let i=r.metadata.exo__Asset_isDefinedBy;if(!i)continue;let s=this.extractWikilinkTarget(String(i));if(!s)continue;let o=t.get(s)||[];o.push(r),t.set(s,o)}return t}getArchiveOntologyName(e){return e+"_archive"}buildOntologyFile(e,t,r){let i={exo__Instance_class:r.exo__Instance_class||"exo__Ontology",exo__Asset_label:`${r.exo__Asset_label||e} (Archive)`,exo__Ontology_url:t};return`---
717
717
  ${ar.dump(i,{lineWidth:-1})}---
718
718
  `}async transferFile(e,t){let r=e.content,i=e.metadata.exo__Asset_isDefinedBy;if(i){let o=this.extractWikilinkTarget(String(i));if(o){let c=this.getArchiveOntologyName(o);r=r.replace(String(i),String(i).replace(o,c))}}let s=e.uuid+".md";await this.archiveFs.writeFile(s,r),await this.activeFs.deleteFile(e.relativePath)}extractWikilinkTarget(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/);return t?t[1]:null}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var nT=H(require("path"));var Ty=class{constructor(e,t){this.activeFs=e;this.archiveFs=t}static{a(this,"ArchiveVerifyService")}async verify(){let e=await this.activeFs.getMarkdownFiles(),t=await this.archiveFs.getMarkdownFiles(),r=new Set;for(let l of t){let u=nT.default.basename(l,".md");this.isUUID(u)&&r.add(u.toLowerCase())}let i=[],s=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi;for(let l of e)try{let u=await this.activeFs.readFile(l);if(this.extractFrontmatter(u).archived===!0)continue;let d=u.match(s);if(d){let h=new Set;for(let p of d){let y=p.toLowerCase();r.has(y)&&!h.has(y)&&(h.add(y),i.push({uuid:y,referenced_from:l}))}}}catch{continue}let o=await this.checkArchiveOntologies(t),c=i.length===0&&o.length===0;return{broken_links:i.length,broken_link_details:i,missing_ontologies:o,stats:{active_files:e.length,archive_files:t.length},ok:c}}async checkArchiveOntologies(e){let t=new Set;for(let i of e)if(!nT.default.basename(i,".md").startsWith("!"))try{let o=await this.archiveFs.readFile(i),l=this.extractFrontmatter(o).exo__Asset_isDefinedBy;if(l){let u=this.extractWikilinkTarget(String(l));if(u&&u.startsWith("!")){let f=u.endsWith("_archive")?u:u+"_archive";t.add(f)}}}catch{continue}let r=[];for(let i of t){let s=i+".md";await this.archiveFs.fileExists(s)||r.push(i)}return r.sort()}extractWikilinkTarget(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/);return t?t[1]:null}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var sN=H(require("path"));var iT=100,Ay=class{constructor(e,t){this.activeFs=e;this.archiveFs=t}static{a(this,"ArchiveCascadeService")}async cascade(e){let t={iterations:0,total_moved:0,still_blocked:0,iterations_detail:[]};for(let r=0;r<iT;r++){let i=await this.activeFs.getMarkdownFiles(),s=await this.readAllFiles(i),o=s.filter(d=>d.isArchived&&d.uuid),c=s.filter(d=>!d.isArchived);if(o.length===0)break;let l=this.buildReferenceSet(c.map(d=>d.content)),u=o.filter(d=>!l.has(d.uuid.toLowerCase()));if(u.length===0){t.still_blocked=o.length;break}let f=[];if(e.dryRun)for(let d of u)f.push(d.uuid);else{await this.createArchiveOntologies(u);for(let d of u)await this.transferFile(d),f.push(d.uuid)}if(t.iterations++,t.total_moved+=f.length,t.iterations_detail.push({iteration:t.iterations,moved:f}),e.dryRun){let d=o.length-u.length;t.still_blocked=d;break}}if(t.iterations>=iT)throw new Error(`MAX_ITERATIONS (${iT}) exceeded during cascade archive. This likely indicates a bug. Moved ${t.total_moved} assets before stopping.`);if(t.iterations>0&&t.still_blocked===0&&!e.dryRun){let r=await this.activeFs.getMarkdownFiles(),i=await this.readAllFiles(r);t.still_blocked=i.filter(s=>s.isArchived&&s.uuid).length}return t}async readAllFiles(e){let t=[];for(let r of e)try{let i=await this.activeFs.readFile(r),s=this.extractFrontmatter(i),o=s.archived===!0,c=this.extractUUID(r,s);t.push({relativePath:r,uuid:c||"",metadata:s,content:i,isArchived:o})}catch{continue}return t}buildReferenceSet(e){let t=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,r=new Set;for(let i of e){let s=i.match(t);if(s)for(let o of s)r.add(o.toLowerCase())}return r}async createArchiveOntologies(e){let t=this.collectOntologies(e),r=0;for(let[i]of t.entries()){let s=i+"_archive",o=s+".md";if(!await this.archiveFs.fileExists(o))try{let l=await this.activeFs.readFile(i+".md"),u=this.extractFrontmatter(l),f=u.exo__Ontology_url;if(f){let d=String(f).replace(/#$/,"")+"/archive#",h=this.buildOntologyFile(s,d,u);await this.archiveFs.writeFile(o,h),r++}}catch{continue}}return r}collectOntologies(e){let t=new Map;for(let r of e){let i=r.metadata.exo__Asset_isDefinedBy;if(!i)continue;let s=this.extractWikilinkTarget(String(i));if(!s)continue;let o=t.get(s)||[];o.push(r),t.set(s,o)}return t}buildOntologyFile(e,t,r){let i={exo__Instance_class:r.exo__Instance_class||"exo__Ontology",exo__Asset_label:`${r.exo__Asset_label||e} (Archive)`,exo__Ontology_url:t};return`---
719
719
  ${ar.dump(i,{lineWidth:-1})}---
720
- `}async transferFile(e){let t=e.content,r=e.metadata.exo__Asset_isDefinedBy;if(r){let s=this.extractWikilinkTarget(String(r));if(s){let o=s+"_archive";t=t.replace(String(r),String(r).replace(s,o))}}let i=e.uuid+".md";await this.archiveFs.writeFile(i,t),await this.activeFs.deleteFile(e.relativePath)}extractWikilinkTarget(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/);return t?t[1]:null}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}extractUUID(e,t){let r=t.exo__Asset_uid;if(r)return String(r);let i=sN.default.basename(e,".md");return this.isUUID(i)?i:null}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var xy=class{constructor(e){this.fs=e}static{a(this,"ArchiveStatsService")}async collect(){let e=await this.fs.getMarkdownFiles(),t={total:0,by_class:{},by_year:{},cross:{}};for(let r of e)try{let i=await this.fs.readFile(r),s=this.extractFrontmatter(i);t.total++;let o=this.extractClass(s);t.by_class[o]=(t.by_class[o]??0)+1;let c=this.extractYear(s);t.by_year[c]=(t.by_year[c]??0)+1,t.cross[o]||(t.cross[o]={}),t.cross[o][c]=(t.cross[o][c]??0)+1}catch{continue}return t}extractClass(e){let t=e.exo__Instance_class;if(!t)return"unknown";let r=Array.isArray(t)?t[0]:t,i=String(r).replace(/^"|"$/g,""),s=i.match(/\[\[[^\]|]+\|([^\]]+)\]\]/);if(s)return s[1];let o=i.match(/\[\[([^\]]+)\]\]/);return o?o[1]:i||"unknown"}extractYear(e){let t=e.ems__Effort_resolutionTimestamp??e.ems__Effort_endTimestamp;if(!t)return"unknown";if(t instanceof Date){let s=t.getFullYear();return isNaN(s)?"unknown":s.toString()}let i=String(t).match(/^(\d{4})/);return i?i[1]:"unknown"}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}};function oN(){return new se("archive").description("Archive assets from active vault to archive vault (automated asset archival)").requiredOption("--vault <path>","Path to the active vault").requiredOption("--archive-vault <path>","Path to the archive vault").option("--class <names>","Comma-separated class short names or UUIDs (e.g. ems__Task,ems__Meeting)").option("--year <year>","Filter by resolution/end timestamp year (e.g. 2025)").option("--dry-run","Preview without writing files",!1).option("--no-referenced","Skip assets referenced by non-archived (default: true)").option("--verify","Verify archive integrity instead of archiving (read-only)",!1).option("--cascade","Iteratively resolve archived-to-archived chains (no --class/--year needed)",!1).option("--stats","Print archive vault statistics by class and year (read-only)",!1).action(async n=>{try{let e=(0,sT.resolve)(n.vault);if(!(0,oT.existsSync)(e))throw new Te(e);let t=(0,sT.resolve)(n.archiveVault);if(!(0,oT.existsSync)(t))throw new Te(t);if(n.stats){let h=new Ot(t),y=await new xy(h).collect();process.stderr.write(BX(y)),process.stdout.write(JSON.stringify(y)+`
720
+ `}async transferFile(e){let t=e.content,r=e.metadata.exo__Asset_isDefinedBy;if(r){let s=this.extractWikilinkTarget(String(r));if(s){let o=s+"_archive";t=t.replace(String(r),String(r).replace(s,o))}}let i=e.uuid+".md";await this.archiveFs.writeFile(i,t),await this.activeFs.deleteFile(e.relativePath)}extractWikilinkTarget(e){let t=e.match(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/);return t?t[1]:null}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}extractUUID(e,t){let r=t.exo__Asset_uid;if(r)return String(r);let i=sN.default.basename(e,".md");return this.isUUID(i)?i:null}isUUID(e){return/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e)}};var xy=class{constructor(e){this.fs=e}static{a(this,"ArchiveStatsService")}async collect(){let e=await this.fs.getMarkdownFiles(),t={total:0,by_class:{},by_year:{},cross:{}};for(let r of e)try{let i=await this.fs.readFile(r),s=this.extractFrontmatter(i);t.total++;let o=this.extractClass(s);t.by_class[o]=(t.by_class[o]??0)+1;let c=this.extractYear(s);t.by_year[c]=(t.by_year[c]??0)+1,t.cross[o]||(t.cross[o]={}),t.cross[o][c]=(t.cross[o][c]??0)+1}catch{continue}return t}extractClass(e){let t=e.exo__Instance_class;if(!t)return"unknown";let r=Array.isArray(t)?t[0]:t,i=String(r).replace(/^"|"$/g,""),s=i.match(/\[\[[^\]|]+\|([^\]]+)\]\]/);if(s)return s[1];let o=i.match(/\[\[([^\]]+)\]\]/);return o?o[1]:i||"unknown"}extractYear(e){let t=e.ems__Effort_resolutionTimestamp??e.ems__Effort_endTimestamp;if(!t)return"unknown";if(t instanceof Date){let s=t.getFullYear();return isNaN(s)?"unknown":s.toString()}let i=String(t).match(/^(\d{4})/);return i?i[1]:"unknown"}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}};function oN(){return new se("archive").description("Archive assets from active vault to archive vault (automated asset archival)").requiredOption("--vault <path>","Path to the active vault").requiredOption("--archive-vault <path>","Path to the archive vault").option("--class <names>","Comma-separated class short names or UUIDs (e.g. ems__Task,ems__Meeting)").option("--year <year>","Filter by resolution/end timestamp year (e.g. 2025)").option("--dry-run","Preview without writing files",!1).option("--no-referenced","Skip assets referenced by non-archived (default: true)").option("--verify","Verify archive integrity instead of archiving (read-only)",!1).option("--cascade","Iteratively resolve archived-to-archived chains (no --class/--year needed)",!1).option("--stats","Print archive vault statistics by class and year (read-only)",!1).action(async n=>{try{let e=(0,sT.resolve)(n.vault);if(!(0,oT.existsSync)(e))throw new Te(e);let t=(0,sT.resolve)(n.archiveVault);if(!(0,oT.existsSync)(t))throw new Te(t);if(n.stats){let h=new Ot(t),y=await new xy(h).collect();process.stderr.write(UX(y)),process.stdout.write(JSON.stringify(y)+`
721
721
  `),process.exit(0)}if(n.verify){let h=new Ot(e),p=new Ot(t),v=await new Ty(h,p).verify();process.stdout.write(JSON.stringify(v,null,2)+`
722
722
  `),process.exit(v.ok?0:1)}if(n.cascade){let h=new Ot(e),p=new Ot(t),v=await new Ay(h,p).cascade({vaultPath:e,archiveVaultPath:t,dryRun:n.dryRun||!1});n.dryRun&&(process.stderr.write(`--- CASCADE DRY RUN PREVIEW ---
723
723
  `),process.stderr.write(`Would move: ${v.total_moved} assets
@@ -732,9 +732,9 @@ ${ar.dump(i,{lineWidth:-1})}---
732
732
  `),process.stderr.write(`Would create: ${f.ontologies_created} archive ontologies
733
733
  `),process.stderr.write(`--- END PREVIEW ---
734
734
  `)),process.stdout.write(JSON.stringify(d)+`
735
- `),process.exit(0)}catch(e){D.handle(e)}})}a(oN,"archiveCommand");function BX(n){let e=["--- ARCHIVE STATS ---"];if(e.push(`Total assets: ${n.total}`),Object.keys(n.by_class).length>0){e.push(""),e.push("By class:");let t=Object.entries(n.by_class).sort((r,i)=>i[1]-r[1]);for(let[r,i]of t)e.push(` ${r}: ${i}`)}if(Object.keys(n.by_year).length>0){e.push(""),e.push("By year:");let t=Object.entries(n.by_year).sort((r,i)=>r[0].localeCompare(i[0]));for(let[r,i]of t)e.push(` ${r}: ${i}`)}return e.push("--- END STATS ---"),e.join(`
735
+ `),process.exit(0)}catch(e){D.handle(e)}})}a(oN,"archiveCommand");function UX(n){let e=["--- ARCHIVE STATS ---"];if(e.push(`Total assets: ${n.total}`),Object.keys(n.by_class).length>0){e.push(""),e.push("By class:");let t=Object.entries(n.by_class).sort((r,i)=>i[1]-r[1]);for(let[r,i]of t)e.push(` ${r}: ${i}`)}if(Object.keys(n.by_year).length>0){e.push(""),e.push("By year:");let t=Object.entries(n.by_year).sort((r,i)=>r[0].localeCompare(i[0]));for(let[r,i]of t)e.push(` ${r}: ${i}`)}return e.push("--- END STATS ---"),e.join(`
736
736
  `)+`
737
- `}a(BX,"formatStatsSummary");var cT=require("path"),lT=require("fs");var aT=H(require("path"));var Cy=class{constructor(e,t){this.activeFs=e;this.archiveFs=t}static{a(this,"UnarchiveService")}async unarchive(e){let{uuid:t,dryRun:r}=e,i=await this.findAssetByUUID(t);if(!i)return{success:!1,uuid:t,error:`UUID ${t} not found in archive vault`};let s=await this.archiveFs.readFile(i),c=this.extractFrontmatter(s).exo__Asset_isDefinedBy,l=c?this.resolveActiveOntology(String(c)):null,u=aT.default.join("03 Knowledge","inbox",aT.default.basename(i));if(r)return{success:!0,uuid:t,movedTo:u,isDefinedBy:l||void 0};let f=s;return c&&l&&(f=f.replace(String(c),l)),await this.activeFs.writeFile(u,f),await this.archiveFs.deleteFile(i),{success:!0,uuid:t,movedTo:u,isDefinedBy:l||void 0}}async findAssetByUUID(e){let t=e+".md";if(await this.archiveFs.fileExists(t))return t;let i=await this.archiveFs.getMarkdownFiles();for(let s of i)try{let o=await this.archiveFs.readFile(s),l=this.extractFrontmatter(o).exo__Asset_uid;if(l&&String(l).toLowerCase()===e.toLowerCase())return s}catch{continue}return null}resolveActiveOntology(e){let t=e.match(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/);if(!t)return null;let r=t[1],i=t[2];if(!r.endsWith("_archive"))return e;let s=r.replace(/_archive$/,"");if(i){let o=i.replace(/\s*\(Archive\)$/,"");return`[[${s}|${o}]]`}return`[[${s}]]`}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}};function aN(){return new se("unarchive").description("Restore asset from archive vault to active vault (reverse of archive)").requiredOption("--uuid <uuid>","UUID of the asset to restore").requiredOption("--vault <path>","Path to the active vault").requiredOption("--archive-vault <path>","Path to the archive vault").option("--dry-run","Preview without writing files",!1).action(async n=>{try{let e=(0,cT.resolve)(n.vault);if(!(0,lT.existsSync)(e))throw new Te(e);let t=(0,cT.resolve)(n.archiveVault);if(!(0,lT.existsSync)(t))throw new Te(t);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n.uuid))throw new Error(`Invalid UUID format: ${n.uuid}. Expected format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);let i=new Ot(e),s=new Ot(t),c=await new Cy(i,s).unarchive({uuid:n.uuid,vaultPath:e,archiveVaultPath:t,dryRun:n.dryRun||!1});c.success||(process.stdout.write(JSON.stringify({error:c.error})+`
737
+ `}a(UX,"formatStatsSummary");var cT=require("path"),lT=require("fs");var aT=H(require("path"));var Cy=class{constructor(e,t){this.activeFs=e;this.archiveFs=t}static{a(this,"UnarchiveService")}async unarchive(e){let{uuid:t,dryRun:r}=e,i=await this.findAssetByUUID(t);if(!i)return{success:!1,uuid:t,error:`UUID ${t} not found in archive vault`};let s=await this.archiveFs.readFile(i),c=this.extractFrontmatter(s).exo__Asset_isDefinedBy,l=c?this.resolveActiveOntology(String(c)):null,u=aT.default.join("03 Knowledge","inbox",aT.default.basename(i));if(r)return{success:!0,uuid:t,movedTo:u,isDefinedBy:l||void 0};let f=s;return c&&l&&(f=f.replace(String(c),l)),await this.activeFs.writeFile(u,f),await this.archiveFs.deleteFile(i),{success:!0,uuid:t,movedTo:u,isDefinedBy:l||void 0}}async findAssetByUUID(e){let t=e+".md";if(await this.archiveFs.fileExists(t))return t;let i=await this.archiveFs.getMarkdownFiles();for(let s of i)try{let o=await this.archiveFs.readFile(s),l=this.extractFrontmatter(o).exo__Asset_uid;if(l&&String(l).toLowerCase()===e.toLowerCase())return s}catch{continue}return null}resolveActiveOntology(e){let t=e.match(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/);if(!t)return null;let r=t[1],i=t[2];if(!r.endsWith("_archive"))return e;let s=r.replace(/_archive$/,"");if(i){let o=i.replace(/\s*\(Archive\)$/,"");return`[[${s}|${o}]]`}return`[[${s}]]`}extractFrontmatter(e){let t=e.match(/^---\n([\s\S]*?)\n---/);if(!t)return{};try{let r=ar.load(t[1]);return typeof r=="object"&&r!==null?r:{}}catch{return{}}}};function aN(){return new se("unarchive").description("Restore asset from archive vault to active vault (reverse of archive)").requiredOption("--uuid <uuid>","UUID of the asset to restore").requiredOption("--vault <path>","Path to the active vault").requiredOption("--archive-vault <path>","Path to the archive vault").option("--dry-run","Preview without writing files",!1).action(async n=>{try{let e=(0,cT.resolve)(n.vault);if(!(0,lT.existsSync)(e))throw new Te(e);let t=(0,cT.resolve)(n.archiveVault);if(!(0,lT.existsSync)(t))throw new Te(t);if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n.uuid))throw new Error(`Invalid UUID format: ${n.uuid}. Expected format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`);let i=new Ot(e),s=new Ot(t),c=await new Cy(i,s).unarchive({uuid:n.uuid,vaultPath:e,archiveVaultPath:t,dryRun:n.dryRun||!1});c.success||(process.stdout.write(JSON.stringify({error:c.error})+`
738
738
  `),process.exit(1)),n.dryRun&&(process.stderr.write(`--- DRY RUN PREVIEW ---
739
739
  `),process.stderr.write(`Would restore: ${c.uuid}
740
740
  `),process.stderr.write(`Target: ${c.movedTo}
@@ -748,8 +748,8 @@ ${ar.dump(i,{lineWidth:-1})}---
748
748
  `),console.log(` ID: ${s.id}`),console.log(` Target class: ${s.targetClass}`),console.log(` Initial state: ${s.initialState}`),console.log(` Terminal states: ${s.terminalStates.join(", ")}`),console.log(` Default: ${s.isDefault?"yes":"no"}`),console.log(`
749
749
  States (${s.states.length}):`);for(let o of s.states){let c=o.optional?" (optional)":"",l=o.timestampOnEnter.length>0?` [timestamps: ${o.timestampOnEnter.join(", ")}]`:"";console.log(` ${o.order}. ${o.status}${c}${l}`)}console.log(`
750
750
  Transitions (${s.transitions.length}):`);for(let o of s.transitions){let c=o.isRollback?" (rollback)":"";console.log(` ${o.label}: ${o.from} \u2192 ${o.to}${c}`)}}}catch(i){D.handle(i)}}),n.command("validate").description("Validate a workflow definition").argument("<uid>","UID of the workflow asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").action(async(e,t)=>{let r=t.output||"text";D.setFormat(r);try{let i=(0,yu.resolve)(t.vault);if(!(0,Eo.existsSync)(i))throw new Te(i);let s=cN(i,e);if(!s){if(r==="json"){let l=X.success({error:`Workflow with UID "${e}" not found`});console.log(JSON.stringify(l,null,2))}else console.log(`\u274C Workflow with UID "${e}" not found.`);process.exitCode=1;return}let c=new Ji.WorkflowEngine(s).validate();if(r==="json"){let l=X.success({workflow:s.name,uid:s.id,...c});console.log(JSON.stringify(l,null,2))}else if(c.valid)console.log(`\u2705 Workflow "${s.name}" is valid.`);else{console.log(`\u274C Workflow "${s.name}" has ${c.errors.length} error(s):
751
- `);for(let l of c.errors)console.log(` \u2022 ${l}`);process.exitCode=1}}catch(i){D.handle(i)}}),n}a(lN,"workflowCommand");var uN=new Ji.FrontmatterService;function fN(n){let e=[],t=[];dN(n,t);for(let{filePath:r,fm:i}of t){let s=i.exo__Instance_class;if(!s||!(Array.isArray(s)?s.some(p=>p.includes("ems__Workflow")&&!p.includes("WorkflowState")&&!p.includes("WorkflowTransition")):typeof s=="string"&&s.includes("ems__Workflow")&&!s.includes("WorkflowState")&&!s.includes("WorkflowTransition")))continue;let c=i.exo__Asset_uid??"",l=i.exo__Asset_label??UX(r),u=wo(i.ems__Workflow_targetClass??"ems__Task"),f=i.ems__Workflow_isDefault===!0||i.ems__Workflow_isDefault==="true",d=0,h=0;for(let{fm:p}of t){let y=p.exo__Instance_class;if(!wo(p.ems__WorkflowState_workflow??p.ems__WorkflowTransition_workflow??"").includes(c))continue;let w=Array.isArray(y)?y.some(I=>I.includes("ems__WorkflowState")):typeof y=="string"&&y.includes("ems__WorkflowState"),T=Array.isArray(y)?y.some(I=>I.includes("ems__WorkflowTransition")):typeof y=="string"&&y.includes("ems__WorkflowTransition");w&&d++,T&&h++}e.push({filePath:r,uid:c,label:l,targetClass:u,isDefault:f,stateCount:d,transitionCount:h})}return e}a(fN,"scanWorkflows");function dN(n,e){let t;try{t=(0,Eo.readdirSync)(n,{withFileTypes:!0})}catch{return}for(let r of t){let i=(0,yu.join)(n,r.name);if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;dN(i,e)}else if(r.name.endsWith(".md"))try{let s=(0,Eo.readFileSync)(i,"utf-8"),o=uN.parse(s);o.exists&&e.push({filePath:i,fm:hN(o.content)})}catch{}}}a(dN,"collectParsedFiles");function cN(n,e){let r=fN(n).find(i=>i.uid===e);if(!r)return null;try{let i=(0,Eo.readFileSync)(r.filePath,"utf-8"),s=uN.parse(i);if(!s.exists)return null;let o=hN(s.content),c=wo(o.ems__Workflow_targetClass??"ems__Task"),l=wo(o.ems__Workflow_initialState??"ems__EffortStatusDraft"),u=gu(l)??Ji.EffortStatus.DRAFT,d=(Array.isArray(o.ems__Workflow_terminalStates)?o.ems__Workflow_terminalStates.map(w=>wo(w)):[]).map(gu).filter(w=>w!==null),h=o.ems__Workflow_isDefault===!0||o.ems__Workflow_isDefault==="true",y=(Array.isArray(o.ems__Workflow_states)?o.ems__Workflow_states:[]).map((w,T)=>typeof w=="string"?{status:gu(wo(w))??Ji.EffortStatus.DRAFT,order:T+1,optional:!1,timestampOnEnter:[]}:{status:gu(wo(w.status??""))??Ji.EffortStatus.DRAFT,order:w.order??T+1,optional:w.optional===!0||w.optional==="true",timestampOnEnter:Array.isArray(w.timestampOnEnter)?w.timestampOnEnter:[],badgeColor:w.badgeColor}),b=(Array.isArray(o.ems__Workflow_transitions)?o.ems__Workflow_transitions:[]).map(w=>{let T=gu(wo(w.from??"")),I=gu(wo(w.to??""));return!T||!I?null:{from:T,to:I,label:w.label??`${T} \u2192 ${I}`,icon:w.icon,isRollback:w.isRollback===!0||w.isRollback==="true"}}).filter(w=>w!==null);return{id:e,name:r.label,targetClass:c,states:y,transitions:b,initialState:u,terminalStates:d.length>0?d:[Ji.EffortStatus.DONE,Ji.EffortStatus.TRASHED],isDefault:h}}catch{return null}}a(cN,"loadWorkflowByUid");function hN(n){let e={},t=n.split(`
752
- `),r="",i=null;for(let s of t){if(s.match(/^\s+-\s+/)&&r){let c=s.replace(/^\s+-\s+/,"").trim();i||(i=[]),i.push(c),e[r]=i;continue}let o=s.match(/^([a-zA-Z0-9_]+):\s*(.*)/);if(o){r=o[1],i=null;let c=o[2].trim();if((c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),c===""){e[r]=[],i=e[r];continue}e[r]=c}}return e}a(hN,"parseYamlFrontmatter");function wo(n){return typeof n!="string"?"":n.replace(/["'[\]]/g,"").trim()}a(wo,"normalizeWikilink");function UX(n){let e=n.split("/");return e[e.length-1].replace(/\.md$/,"")}a(UX,"extractLabelFromFilename");function gu(n){return Object.values(Ji.EffortStatus).includes(n)?n:null}a(gu,"resolveEffortStatus");var Fs=require("fs"),Ds=require("path"),Fe=H(Pt());var _N=H(Pt()),zt=H(mN());var gN="obsidian://vault/";function ZX(n){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return{async resolveTargetPath(t){if(!t)throw new Error("Cannot resolve empty targetIRI to a vault path");let r=t;if(r.startsWith(gN))r=decodeURI(r.slice(gN.length));else if(e.test(r)){let i=await n.findFileByUID(r);if(!i)throw new Error(`No vault file found for UID: ${r}`);r=i}if(r.endsWith(".md")||(r=`${r}.md`),!await n.fileExists(r))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${r}")`);return r}}}a(ZX,"createCliPathResolver");var eJ=["createAsset","openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],uT=class extends Error{constructor(t){super(`Service "${t}" is not implemented in the CLI (no-op stub). dyncommand exec on this service_call grounding cannot change vault state. See CLI parity issues #2865-#2868 for port status.`);this.serviceId=t;this.name="CliServiceNotImplementedError"}static{a(this,"CliServiceNotImplementedError")}};function yN(n){return{async execute(){throw new uT(n)}}}a(yN,"notImplementedService");function SN(n,e){for(let t of eJ)n.register(t,yN(t));for(let t of["updateProperty","removeProperty","setStatus"])n.register(t,yN(t));if(e){if(e.fsAdapter){let t=new _N.FrontmatterService,r=ZX(e.fsAdapter);n.register("updateProperty",(0,zt.createUpdatePropertyService)(e.fsAdapter,t,r)),n.register("removeProperty",(0,zt.createRemovePropertyService)(e.fsAdapter,t,r)),n.register("setStatus",(0,zt.createSetStatusService)(e.fsAdapter,t,r))}n.register("createRelatedTask",(0,zt.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("createRelatedProject",(0,zt.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("archiveAsset",(0,zt.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),n.register("planForEvening",(0,zt.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),n.register("cleanProperties",(0,zt.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),n.register("renameToUid",(0,zt.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),n.register("repairFolder",(0,zt.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),n.register("fixMissingLabel",(0,zt.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(SN,"populateCliServiceRegistry");var tJ=new Fe.FrontmatterService;function vN(){let n=new se("dyncommand").description("Manage vault-defined dynamic commands (RFC-009)");return n.command("list").description("List all dynamic commands defined in vault").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").option("--target <iri>","Filter commands applicable to a specific asset IRI").action(async e=>{let t=e.output||"text";D.setFormat(t);try{let r=(0,Ds.resolve)(e.vault);if(!(0,Fs.existsSync)(r))throw new Te(r);let i;if(e.target?i=await nJ(r,e.target):i=rJ(r),t==="json"){let s=X.success({commands:i,totalCommands:i.length,...e.target&&{target:e.target}});console.log(JSON.stringify(s,null,2))}else{if(i.length===0){console.log("No dynamic commands found in vault.");return}let s=e.target?` for target ${e.target}`:"";console.log(`
751
+ `);for(let l of c.errors)console.log(` \u2022 ${l}`);process.exitCode=1}}catch(i){D.handle(i)}}),n}a(lN,"workflowCommand");var uN=new Ji.FrontmatterService;function fN(n){let e=[],t=[];dN(n,t);for(let{filePath:r,fm:i}of t){let s=i.exo__Instance_class;if(!s||!(Array.isArray(s)?s.some(p=>p.includes("ems__Workflow")&&!p.includes("WorkflowState")&&!p.includes("WorkflowTransition")):typeof s=="string"&&s.includes("ems__Workflow")&&!s.includes("WorkflowState")&&!s.includes("WorkflowTransition")))continue;let c=i.exo__Asset_uid??"",l=i.exo__Asset_label??VX(r),u=wo(i.ems__Workflow_targetClass??"ems__Task"),f=i.ems__Workflow_isDefault===!0||i.ems__Workflow_isDefault==="true",d=0,h=0;for(let{fm:p}of t){let y=p.exo__Instance_class;if(!wo(p.ems__WorkflowState_workflow??p.ems__WorkflowTransition_workflow??"").includes(c))continue;let w=Array.isArray(y)?y.some(I=>I.includes("ems__WorkflowState")):typeof y=="string"&&y.includes("ems__WorkflowState"),T=Array.isArray(y)?y.some(I=>I.includes("ems__WorkflowTransition")):typeof y=="string"&&y.includes("ems__WorkflowTransition");w&&d++,T&&h++}e.push({filePath:r,uid:c,label:l,targetClass:u,isDefault:f,stateCount:d,transitionCount:h})}return e}a(fN,"scanWorkflows");function dN(n,e){let t;try{t=(0,Eo.readdirSync)(n,{withFileTypes:!0})}catch{return}for(let r of t){let i=(0,yu.join)(n,r.name);if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;dN(i,e)}else if(r.name.endsWith(".md"))try{let s=(0,Eo.readFileSync)(i,"utf-8"),o=uN.parse(s);o.exists&&e.push({filePath:i,fm:hN(o.content)})}catch{}}}a(dN,"collectParsedFiles");function cN(n,e){let r=fN(n).find(i=>i.uid===e);if(!r)return null;try{let i=(0,Eo.readFileSync)(r.filePath,"utf-8"),s=uN.parse(i);if(!s.exists)return null;let o=hN(s.content),c=wo(o.ems__Workflow_targetClass??"ems__Task"),l=wo(o.ems__Workflow_initialState??"ems__EffortStatusDraft"),u=gu(l)??Ji.EffortStatus.DRAFT,d=(Array.isArray(o.ems__Workflow_terminalStates)?o.ems__Workflow_terminalStates.map(w=>wo(w)):[]).map(gu).filter(w=>w!==null),h=o.ems__Workflow_isDefault===!0||o.ems__Workflow_isDefault==="true",y=(Array.isArray(o.ems__Workflow_states)?o.ems__Workflow_states:[]).map((w,T)=>typeof w=="string"?{status:gu(wo(w))??Ji.EffortStatus.DRAFT,order:T+1,optional:!1,timestampOnEnter:[]}:{status:gu(wo(w.status??""))??Ji.EffortStatus.DRAFT,order:w.order??T+1,optional:w.optional===!0||w.optional==="true",timestampOnEnter:Array.isArray(w.timestampOnEnter)?w.timestampOnEnter:[],badgeColor:w.badgeColor}),b=(Array.isArray(o.ems__Workflow_transitions)?o.ems__Workflow_transitions:[]).map(w=>{let T=gu(wo(w.from??"")),I=gu(wo(w.to??""));return!T||!I?null:{from:T,to:I,label:w.label??`${T} \u2192 ${I}`,icon:w.icon,isRollback:w.isRollback===!0||w.isRollback==="true"}}).filter(w=>w!==null);return{id:e,name:r.label,targetClass:c,states:y,transitions:b,initialState:u,terminalStates:d.length>0?d:[Ji.EffortStatus.DONE,Ji.EffortStatus.TRASHED],isDefault:h}}catch{return null}}a(cN,"loadWorkflowByUid");function hN(n){let e={},t=n.split(`
752
+ `),r="",i=null;for(let s of t){if(s.match(/^\s+-\s+/)&&r){let c=s.replace(/^\s+-\s+/,"").trim();i||(i=[]),i.push(c),e[r]=i;continue}let o=s.match(/^([a-zA-Z0-9_]+):\s*(.*)/);if(o){r=o[1],i=null;let c=o[2].trim();if((c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),c===""){e[r]=[],i=e[r];continue}e[r]=c}}return e}a(hN,"parseYamlFrontmatter");function wo(n){return typeof n!="string"?"":n.replace(/["'[\]]/g,"").trim()}a(wo,"normalizeWikilink");function VX(n){let e=n.split("/");return e[e.length-1].replace(/\.md$/,"")}a(VX,"extractLabelFromFilename");function gu(n){return Object.values(Ji.EffortStatus).includes(n)?n:null}a(gu,"resolveEffortStatus");var Fs=require("fs"),Ds=require("path"),Fe=H(Pt());var _N=H(Pt()),zt=H(mN());var gN="obsidian://vault/";function eJ(n){let e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;return{async resolveTargetPath(t){if(!t)throw new Error("Cannot resolve empty targetIRI to a vault path");let r=t;if(r.startsWith(gN))r=decodeURI(r.slice(gN.length));else if(e.test(r)){let i=await n.findFileByUID(r);if(!i)throw new Error(`No vault file found for UID: ${r}`);r=i}if(r.endsWith(".md")||(r=`${r}.md`),!await n.fileExists(r))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${r}")`);return r}}}a(eJ,"createCliPathResolver");var tJ=["createAsset","openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],uT=class extends Error{constructor(t){super(`Service "${t}" is not implemented in the CLI (no-op stub). dyncommand exec on this service_call grounding cannot change vault state. See CLI parity issues #2865-#2868 for port status.`);this.serviceId=t;this.name="CliServiceNotImplementedError"}static{a(this,"CliServiceNotImplementedError")}};function yN(n){return{async execute(){throw new uT(n)}}}a(yN,"notImplementedService");function SN(n,e){for(let t of tJ)n.register(t,yN(t));for(let t of["updateProperty","removeProperty","setStatus"])n.register(t,yN(t));if(e){if(e.fsAdapter){let t=new _N.FrontmatterService,r=eJ(e.fsAdapter);n.register("updateProperty",(0,zt.createUpdatePropertyService)(e.fsAdapter,t,r)),n.register("removeProperty",(0,zt.createRemovePropertyService)(e.fsAdapter,t,r)),n.register("setStatus",(0,zt.createSetStatusService)(e.fsAdapter,t,r))}n.register("createRelatedTask",(0,zt.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("createRelatedProject",(0,zt.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),n.register("archiveAsset",(0,zt.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),n.register("planForEvening",(0,zt.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),n.register("cleanProperties",(0,zt.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),n.register("renameToUid",(0,zt.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),n.register("repairFolder",(0,zt.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),n.register("fixMissingLabel",(0,zt.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(SN,"populateCliServiceRegistry");var rJ=new Fe.FrontmatterService;function vN(){let n=new se("dyncommand").description("Manage vault-defined dynamic commands (RFC-009)");return n.command("list").description("List all dynamic commands defined in vault").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").option("--target <iri>","Filter commands applicable to a specific asset IRI").action(async e=>{let t=e.output||"text";D.setFormat(t);try{let r=(0,Ds.resolve)(e.vault);if(!(0,Fs.existsSync)(r))throw new Te(r);let i;if(e.target?i=await iJ(r,e.target):i=nJ(r),t==="json"){let s=X.success({commands:i,totalCommands:i.length,...e.target&&{target:e.target}});console.log(JSON.stringify(s,null,2))}else{if(i.length===0){console.log("No dynamic commands found in vault.");return}let s=e.target?` for target ${e.target}`:"";console.log(`
753
753
  \u{1F4CB} Found ${i.length} dynamic command(s)${s}:
754
754
  `);let o=Math.max(...i.map(l=>l.label.length),4),c=Math.max(...i.map(l=>(l.category??"").length),8);console.log("\u250C"+"\u2500".repeat(o+2)+"\u252C"+"\u2500".repeat(c+2)+"\u252C"+"\u2500".repeat(14)+"\u252C"+"\u2500".repeat(14)+"\u2510"),console.log("\u2502 "+"Name".padEnd(o)+" \u2502 "+"Category".padEnd(c)+" \u2502 "+"Precondition".padEnd(12)+" \u2502 "+"Grounding".padEnd(12)+" \u2502"),console.log("\u251C"+"\u2500".repeat(o+2)+"\u253C"+"\u2500".repeat(c+2)+"\u253C"+"\u2500".repeat(14)+"\u253C"+"\u2500".repeat(14)+"\u2524");for(let l of i)console.log("\u2502 "+l.label.padEnd(o)+" \u2502 "+(l.category??"").padEnd(c)+" \u2502 "+(l.hasPrecondition?" yes ":" no ")+" \u2502 "+(l.groundingType??"").padEnd(12)+" \u2502");console.log("\u2514"+"\u2500".repeat(o+2)+"\u2534"+"\u2500".repeat(c+2)+"\u2534"+"\u2500".repeat(14)+"\u2534"+"\u2500".repeat(14)+"\u2518")}}catch(r){D.handle(r)}}),n.command("show").description("Show full details of a dynamic command").argument("<uid>","UID of the command asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").action(async(e,t)=>{let r=t.output||"text";D.setFormat(r);try{let i=(0,Ds.resolve)(t.vault);if(!(0,Fs.existsSync)(i))throw new Te(i);let{tripleStore:s}=await dT(i),o=new Fe.CommandResolver(s),c=await o.loadCommand(e);if(!c){if(r==="json"){let f=X.success({error:`Command with UID "${e}" not found`});console.log(JSON.stringify(f,null,2))}else console.log(`\u274C Command with UID "${e}" not found.`);process.exitCode=3;return}let u=(await o.findBindings()).filter(f=>f.commandRef===e);if(r==="json"){let f=X.success({command:c,bindings:u});console.log(JSON.stringify(f,null,2))}else if(console.log(`
755
755
  \u{1F4CB} Command: ${c.name}
@@ -760,12 +760,12 @@ ${ar.dump(i,{lineWidth:-1})}---
760
760
  Bindings (${u.length}):`);for(let f of u){let d=[];f.targetClass&&d.push(`class=${f.targetClass}`),f.targetPrototype&&d.push(`prototype=${f.targetPrototype}`),f.targetAsset&&d.push(`asset=${f.targetAsset}`),console.log(` \u2022 ${f.label||f.id}: ${d.join(", ")}`)}}else console.log(`
761
761
  Bindings: none`)}catch(i){D.handle(i)}}),n.command("exec").description("Execute a dynamic command on a target asset").argument("<uid>","UID of the command to execute").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--target <filepath>","Path to target asset file (relative to vault)").option("--output <type>","Response format: text|json","text").option("--dry-run","Preview changes without modifying files").option("--input <json>",`JSON userInput for service_call groundings, e.g. '{"label":"Task name"}'`).action(async(e,t)=>{let r=t.output||"text";D.setFormat(r);try{let i=(0,Ds.resolve)(t.vault);if(!(0,Fs.existsSync)(i))throw new Te(i);if(!t.target){console.error("\u274C --target option is required for exec command"),process.exitCode=2;return}let s=(0,Ds.resolve)(i,t.target);if(!(0,Fs.existsSync)(s)){console.error(`\u274C Target file not found: ${t.target}`),process.exitCode=3;return}let{tripleStore:o}=await dT(i),l=await new Fe.CommandResolver(o).loadCommand(e);if(!l){if(r==="json"){let F=X.success({error:`Command with UID "${e}" not found`});console.log(JSON.stringify(F,null,2))}else console.log(`\u274C Command with UID "${e}" not found.`);process.exitCode=3;return}let u=(0,Fe.vaultPathToIRI)(t.target);if(!await new Fe.PreconditionEvaluator(o).evaluate(l.precondition,u)){if(r==="json"){let F=X.success({command:l.name,target:t.target,preconditionPassed:!1,executed:!1,reason:"Precondition not satisfied"});console.log(JSON.stringify(F,null,2))}else console.log(`\u274C Precondition not satisfied for command "${l.name}" on target "${t.target}".`),l.precondition&&(console.log(` Precondition: ${l.precondition.label}`),console.log(` SPARQL ASK: ${l.precondition.sparqlAsk}`));process.exitCode=5;return}if(t.dryRun){if(r==="json"){let F=X.success({command:l.name,target:t.target,preconditionPassed:!0,dryRun:!0,grounding:l.grounding});console.log(JSON.stringify(F,null,2))}else console.log(`
762
762
  \u{1F50D} Dry-run: command "${l.name}" on "${t.target}"
763
- `),console.log(" Precondition: passed \u2705"),console.log(" Grounding (would execute):"),hT(l.grounding," ");return}let h=new Fe.ServiceRegistry,p=new Nt(i),y=new Fe.GenericAssetCreationService(p),v=new Fe.ArchiveAssetService(p),b=new Fe.PropertyCleanupService(p),w=new Fe.FixMissingLabelService(p),T=new Fe.RenameToUidService(p),I=new Fe.FolderRepairService(p),$=new Fe.TaskStatusService(p,new Fe.EffortStatusWorkflow,new Fe.StatusTimestampService(p)),q=new Ot(i);SN(h,{vaultAdapter:p,fsAdapter:q,genericAssetCreationService:y,archiveAssetService:v,taskStatusService:$,propertyCleanupService:b,fixMissingLabelService:w,renameToUidService:T,folderRepairService:I});let ce=new Fe.GroundingExecutor(q,q,h),B;if(t.input)try{let F=JSON.parse(t.input);if(typeof F!="object"||F===null||Array.isArray(F))throw new Error("must be a JSON object");B=F}catch(F){let k=F instanceof Error?F.message:String(F);console.error(`\u274C --input: invalid JSON object (${k})`),process.exitCode=2;return}let V=await ce.execute(l.grounding,u,t.target,B);if(r==="json"){let F=X.success({command:l.name,target:t.target,preconditionPassed:!0,executed:!0,success:V.success,...V.error&&{error:V.error},...l.successMessage&&V.success&&{message:l.successMessage}});console.log(JSON.stringify(F,null,2))}else if(V.success){let F=l.successMessage??`Command "${l.name}" executed successfully.`;console.log(`\u2705 ${F}`)}else console.log(`\u274C Command "${l.name}" failed: ${V.error}`),process.exitCode=5}catch(i){D.handle(i)}}),n.command("validate").description("Validate all dynamic command definitions in vault").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").action(async e=>{let t=e.output||"text";D.setFormat(t);try{let r=(0,Ds.resolve)(e.vault);if(!(0,Fs.existsSync)(r))throw new Te(r);let i=[];pT(r,i);let s=iJ(i),o=aJ(i);if(t==="json"){let c=X.success({totalCommands:fT(i).length,totalIssues:s.reduce((l,u)=>l+u.issues.length,0),commandsWithIssues:s.length,issues:s,duplicateUidWarnings:o});console.log(JSON.stringify(c,null,2))}else{let c=fT(i);if(s.length===0)console.log(`\u2705 All ${c.length} dynamic command(s) are valid.`);else{let l=s.reduce((u,f)=>u+f.issues.length,0);console.log(`\u274C Found ${l} issue(s) in ${s.length} command(s) out of ${c.length} total:
763
+ `),console.log(" Precondition: passed \u2705"),console.log(" Grounding (would execute):"),hT(l.grounding," ");return}let h=new Fe.ServiceRegistry,p=new Nt(i),y=new Fe.GenericAssetCreationService(p),v=new Fe.ArchiveAssetService(p),b=new Fe.PropertyCleanupService(p),w=new Fe.FixMissingLabelService(p),T=new Fe.RenameToUidService(p),I=new Fe.FolderRepairService(p),$=new Fe.TaskStatusService(p,new Fe.EffortStatusWorkflow,new Fe.StatusTimestampService(p)),q=new Ot(i);SN(h,{vaultAdapter:p,fsAdapter:q,genericAssetCreationService:y,archiveAssetService:v,taskStatusService:$,propertyCleanupService:b,fixMissingLabelService:w,renameToUidService:T,folderRepairService:I});let ce=new Fe.GroundingExecutor(q,q,h),B;if(t.input)try{let F=JSON.parse(t.input);if(typeof F!="object"||F===null||Array.isArray(F))throw new Error("must be a JSON object");B=F}catch(F){let k=F instanceof Error?F.message:String(F);console.error(`\u274C --input: invalid JSON object (${k})`),process.exitCode=2;return}let V=await ce.execute(l.grounding,u,t.target,B);if(r==="json"){let F=X.success({command:l.name,target:t.target,preconditionPassed:!0,executed:!0,success:V.success,...V.error&&{error:V.error},...l.successMessage&&V.success&&{message:l.successMessage}});console.log(JSON.stringify(F,null,2))}else if(V.success){let F=l.successMessage??`Command "${l.name}" executed successfully.`;console.log(`\u2705 ${F}`)}else console.log(`\u274C Command "${l.name}" failed: ${V.error}`),process.exitCode=5}catch(i){D.handle(i)}}),n.command("validate").description("Validate all dynamic command definitions in vault").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format: text|json","text").action(async e=>{let t=e.output||"text";D.setFormat(t);try{let r=(0,Ds.resolve)(e.vault);if(!(0,Fs.existsSync)(r))throw new Te(r);let i=[];pT(r,i);let s=sJ(i),o=cJ(i);if(t==="json"){let c=X.success({totalCommands:fT(i).length,totalIssues:s.reduce((l,u)=>l+u.issues.length,0),commandsWithIssues:s.length,issues:s,duplicateUidWarnings:o});console.log(JSON.stringify(c,null,2))}else{let c=fT(i);if(s.length===0)console.log(`\u2705 All ${c.length} dynamic command(s) are valid.`);else{let l=s.reduce((u,f)=>u+f.issues.length,0);console.log(`\u274C Found ${l} issue(s) in ${s.length} command(s) out of ${c.length} total:
764
764
  `);for(let u of s){console.log(` \u{1F4C4} ${u.label} (${u.uid}):`);for(let f of u.issues)console.log(` \u2022 ${f}`);console.log()}process.exitCode=5}if(o.length>0){console.log(`\u26A0\uFE0F Found ${o.length} duplicate exo__Asset_uid value(s) (structural defect \u2014 see docs/RCA_DYNCOMMAND_SHOW_VS_EXEC.md \xA7H1):
765
- `);for(let l of o){console.log(` \u2022 ${l.uid}`);for(let u of l.filePaths)console.log(` ${u}`)}console.log("\n Hint: rename one of the duplicates to a fresh UID, or delete the stale copy. Duplicates make `dyncommand show` and `dyncommand exec` non-deterministic.")}}}catch(r){D.handle(r)}}),n}a(vN,"dynamicCommandCommand");function rJ(n){let e=[];return pT(n,e),fT(e)}a(rJ,"scanCommands");function fT(n){let e=[],t=bN(n);for(let{filePath:r,fm:i}of n){if(!_u(i,"exocmd__Command",t))continue;let s=i.exo__Asset_uid??"",o=i.exo__Asset_label??wN(r),c=i.exocmd__Command_category,l=i.exocmd__Command_icon,u=!!i.exocmd__Command_precondition,f=i.exocmd__Command_grounding,d;if(f){let h=Ry(String(f)),p=n.find(y=>y.fm.exo__Asset_uid===h&&_u(y.fm,"exocmd__Grounding",t));p&&(d=p.fm.exocmd__Grounding_type)}e.push({filePath:r,uid:s,label:o,category:c,icon:l,hasPrecondition:u,groundingType:d})}return e}a(fT,"scanCommandsFromFiles");async function nJ(n,e){let{tripleStore:t}=await dT(n),r=new Fe.CommandResolver(t),i=await r.findBindings(),s=new Set;for(let c of i)s.add(c.commandRef);let o=[];for(let c of s){let l=await r.loadCommand(c);l&&o.push({filePath:"",uid:l.id,label:l.name,category:l.category,icon:l.icon,hasPrecondition:!!l.precondition,groundingType:l.grounding.type})}return o}a(nJ,"listCommandsForTarget");function iJ(n){let e=[],t=bN(n),r=new Map;for(let i of n){let s=i.fm.exo__Asset_uid;s&&r.set(s,i)}for(let{filePath:i,fm:s}of n){if(!_u(s,"exocmd__Command",t))continue;let o=s.exo__Asset_uid??"",c=s.exo__Asset_label??wN(i),l=[];o||l.push("Missing exo__Asset_uid"),s.exo__Asset_label||l.push("Missing exo__Asset_label");let u=s.exocmd__Command_grounding;if(!u)l.push("Missing exocmd__Command_grounding (required)");else{let h=Ry(String(u)),p=r.get(h);if(!p)l.push(`Grounding reference "${h}" not found in vault`);else if(!_u(p.fm,"exocmd__Grounding",t))l.push(`Grounding reference "${h}" is not an exocmd__Grounding asset`);else{let y=p.fm,v=y.exocmd__Grounding_type;v?(Object.values(Fe.GroundingType).includes(v)||l.push(`Grounding "${h}" has invalid type "${v}"`),(v===Fe.GroundingType.PROPERTY_SET||v===Fe.GroundingType.PROPERTY_DELETE)&&!y.exocmd__Grounding_targetProperty&&l.push(`Grounding "${h}" (${v}) missing targetProperty`),v===Fe.GroundingType.PROPERTY_SET&&!y.exocmd__Grounding_targetValue&&l.push(`Grounding "${h}" (property_set) missing targetValue`),v===Fe.GroundingType.SERVICE_CALL&&((y.exocmd__Grounding_serviceId??y.exocmd__Grounding_targetProperty)||l.push(`Grounding "${h}" (service_call) missing serviceId and targetProperty`))):l.push(`Grounding "${h}" missing exocmd__Grounding_type`)}}let f=s.exocmd__Command_precondition;if(f){let h=Ry(String(f)),p=r.get(h);if(!p)l.push(`Precondition reference "${h}" not found in vault`);else if(!_u(p.fm,"exocmd__Precondition",t))l.push(`Precondition reference "${h}" is not an exocmd__Precondition asset`);else{let y=p.fm.exocmd__Precondition_sparqlAsk,v=p.fm.exocmd__Precondition_hostFunction;!y&&!v&&l.push(`Precondition "${h}" missing both sparqlAsk and hostFunction`)}}n.some(h=>_u(h.fm,"exocmd__CommandBinding",t)?Ry(String(h.fm.exocmd__CommandBinding_command??""))===o:!1)||l.push("No CommandBinding references this command (command will be unused)"),l.length>0&&e.push({uid:o,label:c,filePath:i,issues:l})}return e}a(iJ,"validateCommandsFromFiles");async function dT(n){let e=new Nt(n),r=await new Fe.NoteToRDFConverter(e).convertVault(),i=new Fe.InMemoryTripleStore;return await i.addAll(r),{tripleStore:i}}a(dT,"buildTripleStore");function hT(n,e){if(console.log(`${e}ID: ${n.id}`),console.log(`${e}Label: ${n.label}`),console.log(`${e}Type: ${n.type}`),n.targetProperty&&console.log(`${e}Target property: ${n.targetProperty}`),n.targetValue!==void 0&&console.log(`${e}Target value: ${n.targetValue}`),n.sparqlUpdate&&console.log(`${e}SPARQL UPDATE: ${n.sparqlUpdate}`),n.steps&&n.steps.length>0){console.log(`${e}Steps (${n.steps.length}):`);for(let t=0;t<n.steps.length;t++)console.log(`${e} Step ${t+1}:`),hT(n.steps[t],e+" ")}}a(hT,"printGrounding");function pT(n,e){let t;try{t=(0,Fs.readdirSync)(n,{withFileTypes:!0})}catch{return}for(let r of t){let i=(0,Ds.join)(n,r.name);if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;pT(i,e)}else if(r.name.endsWith(".md"))try{let s=(0,Fs.readFileSync)(i,"utf-8"),o=tJ.parse(s);o.exists&&e.push({filePath:i,fm:sJ(o.content)})}catch{}}}a(pT,"collectParsedFiles");function sJ(n){let e={},t=n.split(`
766
- `),r="",i=null;for(let s of t){if(s.match(/^\s+-\s+/)&&r){let c=s.replace(/^\s+-\s+/,"").trim();i||(i=[]),i.push(c),e[r]=i;continue}let o=s.match(/^([a-zA-Z0-9_]+):\s*(.*)/);if(o){r=o[1],i=null;let c=o[2].trim();if((c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),c===""){e[r]=[],i=e[r];continue}e[r]=c}}return e}a(sJ,"parseYamlFrontmatter");var oJ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function bN(n){let e=new Map;for(let{fm:t}of n){let r=t.exo__Asset_uid,i=t.exo__Asset_label;typeof r=="string"&&typeof i=="string"&&e.set(r,i)}return e}a(bN,"buildClassLabelIndex");function _u(n,e,t){let r=n.exo__Instance_class;if(!r)return!1;let i=Array.isArray(r)?r:[r];for(let s of i){if(typeof s!="string")continue;let o=s.match(/\[\[([^|\]]+)/),c=o?o[1]:s;if(c===e||t&&oJ.test(c)&&t.get(c)===e)return!0}return!1}a(_u,"hasClass");function Ry(n){if(typeof n!="string")return"";let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.substring(0,t).trim():e}a(Ry,"normalizeWikilink");function wN(n){return(0,Ds.basename)(n,".md")}a(wN,"extractLabelFromFilename");function aJ(n){let e=new Map;for(let{filePath:r,fm:i}of n){let s=i.exo__Asset_uid;if(typeof s!="string"||s.length===0)continue;let o=e.get(s);o?o.push(r):e.set(s,[r])}let t=[];for(let[r,i]of e.entries())i.length>1&&t.push({uid:r,filePaths:[...i].sort()});return t.sort((r,i)=>r.uid.localeCompare(i.uid)),t}a(aJ,"findDuplicateUIDs");var Su=require("fs"),Rd=require("path"),Mt=H(Pt());var cJ={turtle:"turtle",ntriples:"n-triples",jsonld:"json-ld"},lJ=new Mt.IRI(`${Mt.Namespace.RDF.iri.value}type`),EN=[Mt.Namespace.RDF,Mt.Namespace.RDFS,Mt.Namespace.OWL,Mt.Namespace.XSD,Mt.Namespace.EXO,Mt.Namespace.EMS,Mt.Namespace.EXOCMD,Mt.Namespace.IMS,Mt.Namespace.ZTLK,Mt.Namespace.PTMS,Mt.Namespace.LIT,Mt.Namespace.INBOX];function uJ(n){let e=n.trim();if(e.startsWith("http://")||e.startsWith("https://"))return new Mt.IRI(e);let t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)__(.+)$/);if(t){let[,i,s]=t,o=EN.find(c=>c.prefix===i);if(o)return o.term(s)}let r=e.match(/^([a-zA-Z][a-zA-Z0-9]*):(.+)$/);if(r){let[,i,s]=r,o=EN.find(c=>c.prefix===i);if(o)return o.term(s)}throw new Ke(`Unable to resolve class filter "${n}" to an IRI.`,'Use shorthand like "ems__Task", prefixed like "ems:Task", or a full IRI.')}a(uJ,"resolveClassIri");function fJ(n,e){let t=new Set;for(let r of n)r.predicate.equals(lJ)&&r.object instanceof Mt.IRI&&r.object.equals(e)&&t.add(r.subject.toString());return t.size===0?[]:n.filter(r=>t.has(r.subject.toString()))}a(fJ,"filterByClass");function TN(){return new se("convert").description("Dump vault graph as RDF (Turtle/N-Triples/JSON-LD)").option("--format <type>","Serialization format: turtle|ntriples|jsonld","turtle").option("--out <path>","Write serialized output to file (default: stdout)").option("--filter <class>","Keep only instances of the given class (e.g. ems__Task, ems:Task, or full IRI)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format for errors: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=cJ[n.format];if(!t)throw new Ke(`Unknown format: "${n.format}". Expected one of turtle|ntriples|jsonld.`,"exocortex convert --format turtle --out vault.ttl");let r=(0,Rd.resolve)(n.vault);if(!(0,Su.existsSync)(r))throw new Te(r);e==="text"&&!n.out||e==="text"&&console.error(`\u{1F4E6} Loading vault: ${r}...`);let i=new Nt(r),o=await new Mt.NoteToRDFConverter(i).convertVault();if(n.filter){let f=uJ(n.filter);o=fJ(o,f)}let c=new Mt.InMemoryTripleStore;await c.addAll(o);let u=new Mt.RDFSerializer(c).serializeTriples(o,t,{pretty:t==="json-ld",indent:2});if(n.out){let f=(0,Rd.resolve)(n.out);try{(0,Su.mkdirSync)((0,Rd.dirname)(f),{recursive:!0}),(0,Su.writeFileSync)(f,u,"utf-8")}catch(d){throw new od("convert",`failed to write output to ${f}: ${d.message}`,"Check destination directory exists and is writable.",{outPath:f})}e==="text"&&console.error(`\u2705 Wrote ${o.length} triple(s) to ${f} (${n.format}).`)}else process.stdout.write(u),u.endsWith(`
765
+ `);for(let l of o){console.log(` \u2022 ${l.uid}`);for(let u of l.filePaths)console.log(` ${u}`)}console.log("\n Hint: rename one of the duplicates to a fresh UID, or delete the stale copy. Duplicates make `dyncommand show` and `dyncommand exec` non-deterministic.")}}}catch(r){D.handle(r)}}),n}a(vN,"dynamicCommandCommand");function nJ(n){let e=[];return pT(n,e),fT(e)}a(nJ,"scanCommands");function fT(n){let e=[],t=bN(n);for(let{filePath:r,fm:i}of n){if(!_u(i,"exocmd__Command",t))continue;let s=i.exo__Asset_uid??"",o=i.exo__Asset_label??wN(r),c=i.exocmd__Command_category,l=i.exocmd__Command_icon,u=!!i.exocmd__Command_precondition,f=i.exocmd__Command_grounding,d;if(f){let h=Ry(String(f)),p=n.find(y=>y.fm.exo__Asset_uid===h&&_u(y.fm,"exocmd__Grounding",t));p&&(d=p.fm.exocmd__Grounding_type)}e.push({filePath:r,uid:s,label:o,category:c,icon:l,hasPrecondition:u,groundingType:d})}return e}a(fT,"scanCommandsFromFiles");async function iJ(n,e){let{tripleStore:t}=await dT(n),r=new Fe.CommandResolver(t),i=await r.findBindings(),s=new Set;for(let c of i)s.add(c.commandRef);let o=[];for(let c of s){let l=await r.loadCommand(c);l&&o.push({filePath:"",uid:l.id,label:l.name,category:l.category,icon:l.icon,hasPrecondition:!!l.precondition,groundingType:l.grounding.type})}return o}a(iJ,"listCommandsForTarget");function sJ(n){let e=[],t=bN(n),r=new Map;for(let i of n){let s=i.fm.exo__Asset_uid;s&&r.set(s,i)}for(let{filePath:i,fm:s}of n){if(!_u(s,"exocmd__Command",t))continue;let o=s.exo__Asset_uid??"",c=s.exo__Asset_label??wN(i),l=[];o||l.push("Missing exo__Asset_uid"),s.exo__Asset_label||l.push("Missing exo__Asset_label");let u=s.exocmd__Command_grounding;if(!u)l.push("Missing exocmd__Command_grounding (required)");else{let h=Ry(String(u)),p=r.get(h);if(!p)l.push(`Grounding reference "${h}" not found in vault`);else if(!_u(p.fm,"exocmd__Grounding",t))l.push(`Grounding reference "${h}" is not an exocmd__Grounding asset`);else{let y=p.fm,v=y.exocmd__Grounding_type;v?(Object.values(Fe.GroundingType).includes(v)||l.push(`Grounding "${h}" has invalid type "${v}"`),(v===Fe.GroundingType.PROPERTY_SET||v===Fe.GroundingType.PROPERTY_DELETE)&&!y.exocmd__Grounding_targetProperty&&l.push(`Grounding "${h}" (${v}) missing targetProperty`),v===Fe.GroundingType.PROPERTY_SET&&!y.exocmd__Grounding_targetValue&&l.push(`Grounding "${h}" (property_set) missing targetValue`),v===Fe.GroundingType.SERVICE_CALL&&((y.exocmd__Grounding_serviceId??y.exocmd__Grounding_targetProperty)||l.push(`Grounding "${h}" (service_call) missing serviceId and targetProperty`))):l.push(`Grounding "${h}" missing exocmd__Grounding_type`)}}let f=s.exocmd__Command_precondition;if(f){let h=Ry(String(f)),p=r.get(h);if(!p)l.push(`Precondition reference "${h}" not found in vault`);else if(!_u(p.fm,"exocmd__Precondition",t))l.push(`Precondition reference "${h}" is not an exocmd__Precondition asset`);else{let y=p.fm.exocmd__Precondition_sparqlAsk,v=p.fm.exocmd__Precondition_hostFunction;!y&&!v&&l.push(`Precondition "${h}" missing both sparqlAsk and hostFunction`)}}n.some(h=>_u(h.fm,"exocmd__CommandBinding",t)?Ry(String(h.fm.exocmd__CommandBinding_command??""))===o:!1)||l.push("No CommandBinding references this command (command will be unused)"),l.length>0&&e.push({uid:o,label:c,filePath:i,issues:l})}return e}a(sJ,"validateCommandsFromFiles");async function dT(n){let e=new Nt(n),r=await new Fe.NoteToRDFConverter(e).convertVault(),i=new Fe.InMemoryTripleStore;return await i.addAll(r),{tripleStore:i}}a(dT,"buildTripleStore");function hT(n,e){if(console.log(`${e}ID: ${n.id}`),console.log(`${e}Label: ${n.label}`),console.log(`${e}Type: ${n.type}`),n.targetProperty&&console.log(`${e}Target property: ${n.targetProperty}`),n.targetValue!==void 0&&console.log(`${e}Target value: ${n.targetValue}`),n.sparqlUpdate&&console.log(`${e}SPARQL UPDATE: ${n.sparqlUpdate}`),n.steps&&n.steps.length>0){console.log(`${e}Steps (${n.steps.length}):`);for(let t=0;t<n.steps.length;t++)console.log(`${e} Step ${t+1}:`),hT(n.steps[t],e+" ")}}a(hT,"printGrounding");function pT(n,e){let t;try{t=(0,Fs.readdirSync)(n,{withFileTypes:!0})}catch{return}for(let r of t){let i=(0,Ds.join)(n,r.name);if(r.isDirectory()){if(r.name.startsWith(".")||r.name==="node_modules")continue;pT(i,e)}else if(r.name.endsWith(".md"))try{let s=(0,Fs.readFileSync)(i,"utf-8"),o=rJ.parse(s);o.exists&&e.push({filePath:i,fm:oJ(o.content)})}catch{}}}a(pT,"collectParsedFiles");function oJ(n){let e={},t=n.split(`
766
+ `),r="",i=null;for(let s of t){if(s.match(/^\s+-\s+/)&&r){let c=s.replace(/^\s+-\s+/,"").trim();i||(i=[]),i.push(c),e[r]=i;continue}let o=s.match(/^([a-zA-Z0-9_]+):\s*(.*)/);if(o){r=o[1],i=null;let c=o[2].trim();if((c.startsWith('"')&&c.endsWith('"')||c.startsWith("'")&&c.endsWith("'"))&&(c=c.slice(1,-1)),c==="true"?c=!0:c==="false"&&(c=!1),c===""){e[r]=[],i=e[r];continue}e[r]=c}}return e}a(oJ,"parseYamlFrontmatter");var aJ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function bN(n){let e=new Map;for(let{fm:t}of n){let r=t.exo__Asset_uid,i=t.exo__Asset_label;typeof r=="string"&&typeof i=="string"&&e.set(r,i)}return e}a(bN,"buildClassLabelIndex");function _u(n,e,t){let r=n.exo__Instance_class;if(!r)return!1;let i=Array.isArray(r)?r:[r];for(let s of i){if(typeof s!="string")continue;let o=s.match(/\[\[([^|\]]+)/),c=o?o[1]:s;if(c===e||t&&aJ.test(c)&&t.get(c)===e)return!0}return!1}a(_u,"hasClass");function Ry(n){if(typeof n!="string")return"";let e=n.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.substring(0,t).trim():e}a(Ry,"normalizeWikilink");function wN(n){return(0,Ds.basename)(n,".md")}a(wN,"extractLabelFromFilename");function cJ(n){let e=new Map;for(let{filePath:r,fm:i}of n){let s=i.exo__Asset_uid;if(typeof s!="string"||s.length===0)continue;let o=e.get(s);o?o.push(r):e.set(s,[r])}let t=[];for(let[r,i]of e.entries())i.length>1&&t.push({uid:r,filePaths:[...i].sort()});return t.sort((r,i)=>r.uid.localeCompare(i.uid)),t}a(cJ,"findDuplicateUIDs");var Su=require("fs"),Rd=require("path"),Mt=H(Pt());var lJ={turtle:"turtle",ntriples:"n-triples",jsonld:"json-ld"},uJ=new Mt.IRI(`${Mt.Namespace.RDF.iri.value}type`),EN=[Mt.Namespace.RDF,Mt.Namespace.RDFS,Mt.Namespace.OWL,Mt.Namespace.XSD,Mt.Namespace.EXO,Mt.Namespace.EMS,Mt.Namespace.EXOCMD,Mt.Namespace.IMS,Mt.Namespace.ZTLK,Mt.Namespace.PTMS,Mt.Namespace.LIT,Mt.Namespace.INBOX];function fJ(n){let e=n.trim();if(e.startsWith("http://")||e.startsWith("https://"))return new Mt.IRI(e);let t=e.match(/^([a-zA-Z][a-zA-Z0-9]*)__(.+)$/);if(t){let[,i,s]=t,o=EN.find(c=>c.prefix===i);if(o)return o.term(s)}let r=e.match(/^([a-zA-Z][a-zA-Z0-9]*):(.+)$/);if(r){let[,i,s]=r,o=EN.find(c=>c.prefix===i);if(o)return o.term(s)}throw new Ke(`Unable to resolve class filter "${n}" to an IRI.`,'Use shorthand like "ems__Task", prefixed like "ems:Task", or a full IRI.')}a(fJ,"resolveClassIri");function dJ(n,e){let t=new Set;for(let r of n)r.predicate.equals(uJ)&&r.object instanceof Mt.IRI&&r.object.equals(e)&&t.add(r.subject.toString());return t.size===0?[]:n.filter(r=>t.has(r.subject.toString()))}a(dJ,"filterByClass");function TN(){return new se("convert").description("Dump vault graph as RDF (Turtle/N-Triples/JSON-LD)").option("--format <type>","Serialization format: turtle|ntriples|jsonld","turtle").option("--out <path>","Write serialized output to file (default: stdout)").option("--filter <class>","Keep only instances of the given class (e.g. ems__Task, ems:Task, or full IRI)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--output <type>","Response format for errors: text|json (for MCP tools)","text").action(async n=>{let e=n.output||"text";D.setFormat(e);try{let t=lJ[n.format];if(!t)throw new Ke(`Unknown format: "${n.format}". Expected one of turtle|ntriples|jsonld.`,"exocortex convert --format turtle --out vault.ttl");let r=(0,Rd.resolve)(n.vault);if(!(0,Su.existsSync)(r))throw new Te(r);e==="text"&&!n.out||e==="text"&&console.error(`\u{1F4E6} Loading vault: ${r}...`);let i=new Nt(r),o=await new Mt.NoteToRDFConverter(i).convertVault();if(n.filter){let f=fJ(n.filter);o=dJ(o,f)}let c=new Mt.InMemoryTripleStore;await c.addAll(o);let u=new Mt.RDFSerializer(c).serializeTriples(o,t,{pretty:t==="json-ld",indent:2});if(n.out){let f=(0,Rd.resolve)(n.out);try{(0,Su.mkdirSync)((0,Rd.dirname)(f),{recursive:!0}),(0,Su.writeFileSync)(f,u,"utf-8")}catch(d){throw new od("convert",`failed to write output to ${f}: ${d.message}`,"Check destination directory exists and is writable.",{outPath:f})}e==="text"&&console.error(`\u2705 Wrote ${o.length} triple(s) to ${f} (${n.format}).`)}else process.stdout.write(u),u.endsWith(`
767
767
  `)||process.stdout.write(`
768
- `)}catch(t){D.handle(t)}})}a(TN,"convertCommand");var IN=require("path"),PN=require("fs");var xN=require("node:crypto");function Id(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0)return null;let t=e.match(/^\[\[([^|\]]+)(?:\|[^\]]*)?\]\]$/);return t?t[1].trim():e}a(Id,"wikilinkInner");function dJ(n){if(!Array.isArray(n))return[];let e=[];for(let t of n)typeof t=="string"&&t.trim().length>0&&e.push(t.trim());return e}a(dJ,"normaliseColumns");function hJ(n){if(Array.isArray(n))return n.map(e=>typeof e=="string"?Id(e):null).filter(e=>e!==null);if(typeof n=="string"){let e=Id(n);return e?[e]:[]}return[]}a(hJ,"normaliseInstanceClass");function CN(n){let e=hJ(n.exo__Instance_class);for(let t of e)if(t==="ui__RelationColumnSet"||t==="97fc9862-c886-4d86-9a60-e0cf9d778575"||t.includes("ui__RelationColumnSet"))return!0;return!1}a(CN,"isRelColSetFrontmatter");function RN(n,e){let t=e.exo__Asset_uid;if(typeof t!="string"||t.trim().length===0)return null;let r=e.exo__Asset_label,i=typeof r=="string"&&r.trim().length>0?r.trim():null,s=e.ui__RelationColumnSet_targetClass,o=Array.isArray(s)?Id(s[0]):Id(s),c=Id(e.ui__RelationColumnSet_referencingProperty),l=dJ(e.ui__RelationColumnSet_columns),u=e.ui__RelationColumnSet_priority,f=typeof u=="number"?u:typeof u=="string"&&u.trim()!==""?Number.parseInt(u,10):null;return{uid:t.trim(),path:n,label:i,targetClass:o,referencingProperty:c,columns:l,priority:f!==null&&Number.isNaN(f)?null:f}}a(RN,"extractRelColSetConfig");function AN(n){if(n===null||n.trim().length===0)return"";let e=n.trim();return e.startsWith("[[")&&e.endsWith("]]")?e:`[[${e}]]`}a(AN,"wikilinkOf");function pJ(n,e){let t=(0,xN.createHash)("sha256").update(`${n}:${e}:exo-layout-migration-v1`).digest("hex");return t.slice(0,8)+"-"+t.slice(8,12)+"-4"+t.slice(13,16)+"-8"+t.slice(17,20)+"-"+t.slice(20,32)}a(pJ,"defaultUidFor");var Iy=class{static{a(this,"RelColSetToExoLayoutMigratorService")}constructor(e={}){this.uidFor=e.uidFor??pJ}migrate(e){let t=[],r=[];for(let i of e){if(i.targetClass===null&&i.referencingProperty===null){r.push({sourcePath:i.path,reason:"RelColSet lacks both targetClass and referencingProperty \u2014 nothing to migrate"});continue}t.push(this.migrateOne(i))}return{pairs:t,skipped:r}}migrateOne(e){let t=this.uidFor(e.uid,"layout"),r=this.uidFor(e.uid,"block"),i=[],s=e.label??e.uid,o=`Migrated layout (from ${s})`,c=`Migrated backlinks table (from ${s})`,l=AN(e.targetClass),u=AN(e.referencingProperty);e.targetClass===null&&i.push("RelColSet has no targetClass \u2014 using placeholder; set exo__Layout_targetClass and exo__BacklinksTableBlock_rowClass manually."),e.referencingProperty===null&&i.push("RelColSet has no referencingProperty \u2014 set exo__BacklinksTableBlock_referencingProperty manually."),i.push("RelColSet is additive (appends to Name/InstanceClass); exo__BacklinksTableBlock is replacing. The generated block renders only the configured columns."),i.push("exo__Layout.targetClass is the class of the PAGE the layout renders on. RelColSet encodes the row class, not the page class. Review and adjust before --apply.");let f=e.columns.length===0?"[]":`
768
+ `)}catch(t){D.handle(t)}})}a(TN,"convertCommand");var IN=require("path"),PN=require("fs");var xN=require("node:crypto");function Id(n){if(typeof n!="string")return null;let e=n.trim();if(e.length===0)return null;let t=e.match(/^\[\[([^|\]]+)(?:\|[^\]]*)?\]\]$/);return t?t[1].trim():e}a(Id,"wikilinkInner");function hJ(n){if(!Array.isArray(n))return[];let e=[];for(let t of n)typeof t=="string"&&t.trim().length>0&&e.push(t.trim());return e}a(hJ,"normaliseColumns");function pJ(n){if(Array.isArray(n))return n.map(e=>typeof e=="string"?Id(e):null).filter(e=>e!==null);if(typeof n=="string"){let e=Id(n);return e?[e]:[]}return[]}a(pJ,"normaliseInstanceClass");function CN(n){let e=pJ(n.exo__Instance_class);for(let t of e)if(t==="ui__RelationColumnSet"||t==="97fc9862-c886-4d86-9a60-e0cf9d778575"||t.includes("ui__RelationColumnSet"))return!0;return!1}a(CN,"isRelColSetFrontmatter");function RN(n,e){let t=e.exo__Asset_uid;if(typeof t!="string"||t.trim().length===0)return null;let r=e.exo__Asset_label,i=typeof r=="string"&&r.trim().length>0?r.trim():null,s=e.ui__RelationColumnSet_targetClass,o=Array.isArray(s)?Id(s[0]):Id(s),c=Id(e.ui__RelationColumnSet_referencingProperty),l=hJ(e.ui__RelationColumnSet_columns),u=e.ui__RelationColumnSet_priority,f=typeof u=="number"?u:typeof u=="string"&&u.trim()!==""?Number.parseInt(u,10):null;return{uid:t.trim(),path:n,label:i,targetClass:o,referencingProperty:c,columns:l,priority:f!==null&&Number.isNaN(f)?null:f}}a(RN,"extractRelColSetConfig");function AN(n){if(n===null||n.trim().length===0)return"";let e=n.trim();return e.startsWith("[[")&&e.endsWith("]]")?e:`[[${e}]]`}a(AN,"wikilinkOf");function mJ(n,e){let t=(0,xN.createHash)("sha256").update(`${n}:${e}:exo-layout-migration-v1`).digest("hex");return t.slice(0,8)+"-"+t.slice(8,12)+"-4"+t.slice(13,16)+"-8"+t.slice(17,20)+"-"+t.slice(20,32)}a(mJ,"defaultUidFor");var Iy=class{static{a(this,"RelColSetToExoLayoutMigratorService")}constructor(e={}){this.uidFor=e.uidFor??mJ}migrate(e){let t=[],r=[];for(let i of e){if(i.targetClass===null&&i.referencingProperty===null){r.push({sourcePath:i.path,reason:"RelColSet lacks both targetClass and referencingProperty \u2014 nothing to migrate"});continue}t.push(this.migrateOne(i))}return{pairs:t,skipped:r}}migrateOne(e){let t=this.uidFor(e.uid,"layout"),r=this.uidFor(e.uid,"block"),i=[],s=e.label??e.uid,o=`Migrated layout (from ${s})`,c=`Migrated backlinks table (from ${s})`,l=AN(e.targetClass),u=AN(e.referencingProperty);e.targetClass===null&&i.push("RelColSet has no targetClass \u2014 using placeholder; set exo__Layout_targetClass and exo__BacklinksTableBlock_rowClass manually."),e.referencingProperty===null&&i.push("RelColSet has no referencingProperty \u2014 set exo__BacklinksTableBlock_referencingProperty manually."),i.push("RelColSet is additive (appends to Name/InstanceClass); exo__BacklinksTableBlock is replacing. The generated block renders only the configured columns."),i.push("exo__Layout.targetClass is the class of the PAGE the layout renders on. RelColSet encodes the row class, not the page class. Review and adjust before --apply.");let f=e.columns.length===0?"[]":`
769
769
  `+e.columns.map(y=>` - "${y}"`).join(`
770
770
  `),d=e.priority===null?"":`exo__Layout_priority: ${e.priority}
771
771
  `,h=`---
@@ -791,8 +791,8 @@ exo__BacklinksTableBlock_referencingProperty: "${u}"
791
791
  exo__BacklinksTableBlock_columns:${f==="[]"?" []":f}
792
792
  # Migrated from ui__RelationColumnSet ${e.uid} (${e.path}).
793
793
  ---
794
- `;return{sourceUid:e.uid,sourcePath:e.path,layout:{uid:t,filename:`${t}.md`,content:h},block:{uid:r,filename:`${r}.md`,content:p},warnings:i}}};function ON(){return new se("migrate-relcolset-to-exolayout").description("Generate exo__Layout + exo__BacklinksTableBlock pairs from existing ui__RelationColumnSet configs (dry-run by default; --apply to write)").requiredOption("--vault <path>","Path to the source vault").option("--out-dir <path>","Vault-relative folder where generated Layout+Block files land on --apply","exo-layout-migrated").option("--apply","Write generated files to the vault (default: dry-run, prints to stderr)",!1).option("--json","Emit the migration report as JSON to stdout",!1).action(async n=>{try{let e=(0,IN.resolve)(n.vault);if(!(0,PN.existsSync)(e))throw new Te(e);let t=new Ot(e),r=new Iy,i=await t.getMarkdownFiles(),s=[];for(let c of i)try{let l=await t.getFileMetadata(c);if(!CN(l))continue;let u=RN(c,l);u!==null&&s.push(u)}catch{}let o=r.migrate(s);n.apply?await mJ(t,o,n.outDir):gJ(o),n.json?process.stdout.write(JSON.stringify(_J(o,n),null,2)+`
795
- `):process.stderr.write(yJ(o,n)),process.exit(0)}catch(e){D.handle(e)}})}a(ON,"migrateRelColSetToExoLayoutCommand");async function mJ(n,e,t){for(let r of e.pairs){let i=`${t}/${r.layout.filename}`,s=`${t}/${r.block.filename}`;await n.writeFile(i,r.layout.content),await n.writeFile(s,r.block.content)}}a(mJ,"writePairs");function gJ(n){process.stderr.write(`--- DRY RUN PREVIEW ---
794
+ `;return{sourceUid:e.uid,sourcePath:e.path,layout:{uid:t,filename:`${t}.md`,content:h},block:{uid:r,filename:`${r}.md`,content:p},warnings:i}}};function ON(){return new se("migrate-relcolset-to-exolayout").description("Generate exo__Layout + exo__BacklinksTableBlock pairs from existing ui__RelationColumnSet configs (dry-run by default; --apply to write)").requiredOption("--vault <path>","Path to the source vault").option("--out-dir <path>","Vault-relative folder where generated Layout+Block files land on --apply","exo-layout-migrated").option("--apply","Write generated files to the vault (default: dry-run, prints to stderr)",!1).option("--json","Emit the migration report as JSON to stdout",!1).action(async n=>{try{let e=(0,IN.resolve)(n.vault);if(!(0,PN.existsSync)(e))throw new Te(e);let t=new Ot(e),r=new Iy,i=await t.getMarkdownFiles(),s=[];for(let c of i)try{let l=await t.getFileMetadata(c);if(!CN(l))continue;let u=RN(c,l);u!==null&&s.push(u)}catch{}let o=r.migrate(s);n.apply?await gJ(t,o,n.outDir):yJ(o),n.json?process.stdout.write(JSON.stringify(SJ(o,n),null,2)+`
795
+ `):process.stderr.write(_J(o,n)),process.exit(0)}catch(e){D.handle(e)}})}a(ON,"migrateRelColSetToExoLayoutCommand");async function gJ(n,e,t){for(let r of e.pairs){let i=`${t}/${r.layout.filename}`,s=`${t}/${r.block.filename}`;await n.writeFile(i,r.layout.content),await n.writeFile(s,r.block.content)}}a(gJ,"writePairs");function yJ(n){process.stderr.write(`--- DRY RUN PREVIEW ---
796
796
  `);for(let e of n.pairs)if(process.stderr.write(`
797
797
  # from ${e.sourcePath}
798
798
  `),process.stderr.write(`## Layout (${e.layout.filename})
@@ -803,17 +803,17 @@ exo__BacklinksTableBlock_columns:${f==="[]"?" []":f}
803
803
  `);for(let t of e.warnings)process.stderr.write(`- ${t}
804
804
  `)}process.stderr.write(`
805
805
  --- END PREVIEW ---
806
- `)}a(gJ,"printDryRunReport");function yJ(n,e){let r=[`--- MIGRATION ${e.apply?"APPLY":"DRY RUN"} ---`,`Migrated pairs: ${n.pairs.length}`,`Skipped configs: ${n.skipped.length}`];e.apply&&(r.push(`Files written to: ${e.outDir}/ (relative to vault root)`),r.push(`Total files written: ${n.pairs.length*2} (${n.pairs.length} Layout + ${n.pairs.length} Block)`));for(let i of n.skipped)r.push(` SKIPPED: ${i.sourcePath} \u2014 ${i.reason}`);return r.push(`--- END SUMMARY ---
806
+ `)}a(yJ,"printDryRunReport");function _J(n,e){let r=[`--- MIGRATION ${e.apply?"APPLY":"DRY RUN"} ---`,`Migrated pairs: ${n.pairs.length}`,`Skipped configs: ${n.skipped.length}`];e.apply&&(r.push(`Files written to: ${e.outDir}/ (relative to vault root)`),r.push(`Total files written: ${n.pairs.length*2} (${n.pairs.length} Layout + ${n.pairs.length} Block)`));for(let i of n.skipped)r.push(` SKIPPED: ${i.sourcePath} \u2014 ${i.reason}`);return r.push(`--- END SUMMARY ---
807
807
  `),r.join(`
808
- `)}a(yJ,"formatSummary");function _J(n,e){return{mode:e.apply?"apply":"dry-run",outDir:e.outDir,pairsCount:n.pairs.length,skippedCount:n.skipped.length,pairs:n.pairs.map(t=>({sourceUid:t.sourceUid,sourcePath:t.sourcePath,layoutUid:t.layout.uid,blockUid:t.block.uid,warnings:t.warnings})),skipped:n.skipped}}a(_J,"summariseResult");var vu=H(Pt());function SJ(){return new se("start").description("Start the ValidatorDaemon process (long-running, Unix socket)").option("--socket <path>","Unix socket path",vu.DEFAULT_SOCKET_PATH).option("--idle-timeout <seconds>","Exit after N seconds of inactivity",String(Math.floor(vu.IDLE_TIMEOUT_MS/1e3))).action(async n=>{let e=n.socket,t=Number(n.idleTimeout)*1e3;await new vu.ValidatorDaemon(e,t).start()})}a(SJ,"daemonStartCommand");function FN(){let n=new se("daemon").description("Manage the ValidatorDaemon background process");return n.addCommand(SJ()),n}a(FN,"daemonCommand");var nn=require("fs"),NN=require("os"),Ns=require("path");var vJ=new Set(["class","state","error","phase","development","multi","asset","version","limit","flow","single","universal","loop","time","function","document","system","driven","commitment","false","true","alert","positive","backup","tool","user"]);function Py(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let t={},r=e[1].split(`
809
- `);for(let i of r){let s=i.match(/^([\w]+):\s*"?([^"]*)"?\s*$/);s&&(t[s[1]]=s[2])}return t}a(Py,"parseFrontmatterRaw");function mT(n){return n.replace(/^---[\s\S]*?---\r?\n/,"").replace(/```[\s\S]*?```/g," ").replace(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,"$1").replace(/#+\s/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`]/g,"").toLowerCase()}a(mT,"extractBodyText");function LN(n,e){return n.exo__Asset_label?n.exo__Asset_label:e.split("/").pop()?.replace(/\.md$/,"")??""}a(LN,"extractLabel");function bJ(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return[];let t=[],r=e[1].split(`
810
- `),i=!1;for(let s of r){if(s.match(/^aliases:\s*$/)){i=!0;continue}if(i){let c=s.match(/^\s+-\s+"?([^"]*)"?\s*$/);c?t.push(c[1].trim()):!s.startsWith(" ")&&!s.startsWith(" ")&&(i=!1)}let o=s.match(/^aliases:\s+"?([^"\n]+)"?\s*$/);o&&o[1].trim()&&t.push(o[1].trim())}return t.filter(Boolean)}a(bJ,"extractAliases");function wJ(n,e){return n.includes("/concepts/")}a(wJ,"isConceptFile");function Pd(n){let e=[],t=(0,nn.readdirSync)(n);for(let r of t){if(r.startsWith(".")||r==="node_modules")continue;let i=(0,Ns.join)(n,r);(0,nn.statSync)(i).isDirectory()?e.push(...Pd(i)):r.endsWith(".md")&&e.push(i)}return e}a(Pd,"walkMdFiles");function EJ(n){let e=new Map,t;try{t=(0,nn.readdirSync)(n)}catch{return e}for(let r of t){if(!r.endsWith(".md"))continue;let i;try{i=(0,nn.readFileSync)((0,Ns.join)(n,r),"utf-8")}catch{continue}let s=i.match(/^aiKnow__Memory_aboutConcept:\s*"?\[\[([0-9a-f-]+)\|/m);if(s){let o=s[1];e.set(o,(e.get(o)??0)+1)}}return e}a(EJ,"countConceptFrequencies");function gT(n){let e=Pd(n),t=[];for(let r of e){let i;try{i=(0,nn.readFileSync)(r,"utf-8")}catch{continue}if(!wJ(r,i))continue;let s=Py(i),o=s.exo__Asset_uid??"";if(!o)continue;let c=LN(s,r),l=bJ(i);t.push({uid:o,label:c,aliases:l,filePath:r})}return t}a(gT,"loadConcepts");var kN=4,TJ=new Set(["the","and","for","but","with","this","that","from","have","been","are","was","will","can","not","all","any","both","each","few","more","most","other","some","such","than","then","when","where","which","while","who","how","its","into","over"]);function AJ(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(AJ,"escapeRegex");function DN(n,e){return e.length<kN||TJ.has(e.toLowerCase())?!1:new RegExp(`\\b${AJ(e)}\\b`,"i").test(n)}a(DN,"matchesWordBoundary");function bu(n,e){let t=n.toLowerCase(),r=e.toLowerCase();return r?t===r?1:r.length>=kN&&t.includes(r)?.85:0:0}a(bu,"scoreMatch");function xJ(n){let e=n.trim().split(/\s+/);return e.length!==1?!1:vJ.has(e[0].toLowerCase())}a(xJ,"isConceptStopListed");function CJ(n,e,t,r,i){let s=n.toLowerCase(),o=e.toLowerCase(),c=t,l=[];for(let u of r){if(xJ(u.label)||i?.has(u.uid))continue;let f=0,d="body_substring",h=bu(s,u.label);if(h>f&&(f=h,d=h===1?"label_exact":"label_substring"),f<1){(DN(c,u.label)||DN(o,u.label))&&.9>f&&(f=.9,d="body_word_exact");let p=bu(o,u.label),y=p===1?.75:p>0?.65:0;y>f&&(f=y,d=p===1?"description_exact":"description_substring");let v=bu(c,u.label),b=v===1?.6:v>0?.5:0;b>f&&(f=b,d=v===1?"body_exact":"body_substring")}for(let p of u.aliases){let y=bu(s,p);if(y>0){let w=y*.9;w>f&&(f=w,d=y===1?"alias_label_exact":"alias_label_substring")}let v=bu(o,p);if(v>0){let w=v===1?.675:v*.65*.9;w>f&&(f=w,d="alias_description_substring")}let b=bu(c,p);if(b>0){let w=b===1?.54:b*.5*.9;w>f&&(f=w,d="alias_body_substring")}}f>0&&l.push({concept_uid:u.uid,concept_label:u.label,concept_file:u.filePath,confidence:Math.round(f*100)/100,match_type:d})}return l.sort((u,f)=>f.confidence-u.confidence),l.slice(0,3)}a(CJ,"computeCandidates");function RJ(n,e){return n.confidence>=e&&(n.match_type==="label_exact"||n.match_type==="alias_label_exact"||n.match_type==="body_word_exact")}a(RJ,"isAutoApproved");async function IJ(n){let e=(0,Ns.resolve)(n.aiKnowDir),t=(0,Ns.resolve)(n.vault??(0,Ns.join)(e,"..","..","..")),r=n.autoThreshold??.8,i=n.frequencyCap??100,s=gT(t),o=EJ(e),c=new Set([...o.entries()].filter(([,f])=>f>=i).map(([f])=>f)),l=Pd(e),u=[];for(let f of l){let d;try{d=(0,nn.readFileSync)(f,"utf-8")}catch{continue}let h=Py(d),p=h.exo__Asset_uid??"";if(!p)continue;let y=LN(h,f),v=h.exo__Asset_description??"",b=mT(d),w=CJ(y,v,b,s,c),T=w[0],I=T?RJ(T,r):!1;u.push({aiKnow_uid:p,aiKnow_label:y,aiKnow_file:f,candidates:w,auto_approved:I,...I?{auto_approved_candidate:T}:{}})}return u}a(IJ,"runBackfillSuggest");function PJ(n,e){let t=e.substring(0,e.lastIndexOf("/"));(0,nn.existsSync)(t)||(0,nn.mkdirSync)(t,{recursive:!0});let r=n.map(i=>JSON.stringify(i)).join(`
811
- `);(0,nn.writeFileSync)(e,r,"utf-8")}a(PJ,"writeJsonl");function MN(){let n=(0,Ns.join)((0,NN.homedir)(),".cache","exocortex","backfill-candidates.jsonl");return new se("suggest").description("Suggest concept backfill candidates for aiKnow assets").requiredOption("--aiKnow-dir <path>","Path to aiKnow assets directory").option("--vault <path>","Path to Obsidian vault (for finding concepts)").option("--output <path>","Output JSONL path",n).option("--auto-threshold <number>","Auto-approve confidence threshold","0.8").option("--frequency-cap <number>","Skip concepts with \u2265N existing stamps in aiKnow dir","100").option("--dry-run","Dry-run mode: output JSONL but do not write to vault (default)",!0).action(async e=>{let t=parseFloat(e.autoThreshold);if(isNaN(t)||t<0||t>1){console.error("\u274C --auto-threshold must be a number between 0 and 1"),process.exitCode=1;return}let r=parseInt(e.frequencyCap,10);if(isNaN(r)||r<1){console.error("\u274C --frequency-cap must be a positive integer"),process.exitCode=1;return}let i=(0,Ns.resolve)(e.aiKnowDir);if(!(0,nn.existsSync)(i)){console.error(`\u274C aiKnow directory not found: ${i}`),process.exitCode=1;return}console.log("\u{1F50D} Loading concepts from vault...");let s=e.vault?(0,Ns.resolve)(e.vault):void 0,o=Date.now(),c=await IJ({aiKnowDir:i,vault:s,output:e.output,autoThreshold:t,frequencyCap:r,dryRun:e.dryRun}),l=((Date.now()-o)/1e3).toFixed(2),u=c.filter(d=>d.auto_approved).length,f=c.filter(d=>d.candidates.length>0).length;PJ(c,e.output),console.log(`\u2705 Processed ${c.length} aiKnow assets in ${l}s`),console.log(` ${f} assets have concept candidates`),console.log(` ${u} assets auto-approved (confidence \u2265 ${t})`),console.log(`\u{1F4DD} Output: ${e.output}`),e.dryRun&&console.log("\u2139\uFE0F Dry-run mode: no writes to vault")})}a(MN,"backfillSuggestCommand");var Fy=require("fs"),Oy=require("path");var OJ=new Set(["about","above","after","again","against","also","always","another","around","back","been","before","being","below","between","both","came","change","could","data","does","done","down","each","every","file","first","fixed","from","full","func","given","have","help","here","high","hook","html","http","https","info","into","issue","just","keep","know","last","like","line","list","load","look","made","make","many","more","most","much","must","need","next","none","note","null","only","open","over","page","part","pass","path","plan","plus","port","post","prev","prop","push","read","real","repo","rest","return","rule","runs","same","save","self","send","sets","show","side","size","slow","some","sort","step","such","sure","take","than","that","them","then","there","these","they","this","time","todo","true","type","under","used","user","uses","using","uuid","very","view","wait","want","ways","well","were","what","when","where","which","while","will","with","work","your","zero","eto","eto","pri","kak","tak","vse","dlya","pro"]);function FJ(n){return n.toLowerCase().split(/[^a-z0-9_-]+/).filter(e=>e.length>=4&&!OJ.has(e)&&/[a-z]/.test(e))}a(FJ,"tokenize");function DJ(n){let e=new Set;for(let t of n){e.add(t.label.toLowerCase());for(let r of t.aliases)e.add(r.toLowerCase())}return e}a(DJ,"buildConceptTermSet");function NJ(n,e,t){let r=Pd(n),i=new Map;for(let s of r){let o;try{o=(0,Fy.readFileSync)(s,"utf-8")}catch{continue}let l=Py(o).exo__Asset_uid??"";if(!l)continue;let u=mT(o),f=FJ(u),d=new Set;for(let h of f){if(d.has(h)||(d.add(h),e.has(h)))continue;let p=i.get(h)??{count:0,uids:[]};p.count++,p.uids.length<3&&p.uids.push(l),i.set(h,p)}}return Array.from(i.entries()).map(([s,{count:o,uids:c}])=>({term:s,frequency:o,sample_uids:c})).sort((s,o)=>o.frequency-s.frequency).slice(0,t)}a(NJ,"extractOrphanTerms");function jN(){return new se("orphan-terms").description("Extract high-frequency terms from aiKnow assets that have no matching ims__Concept").requiredOption("--aiKnow-dir <path>","Path to aiKnow assets directory").option("--vault <path>","Path to Obsidian vault (for finding concepts)").option("--top <number>","Number of top orphan terms to return","20").action(n=>{let e=parseInt(n.top,10);if(isNaN(e)||e<1){console.error("\u274C --top must be a positive integer"),process.exitCode=1;return}let t=(0,Oy.resolve)(n.aiKnowDir);if(!(0,Fy.existsSync)(t)){console.error(`\u274C aiKnow directory not found: ${t}`),process.exitCode=1;return}let r=n.vault?(0,Oy.resolve)(n.vault):(0,Oy.resolve)(t,"..","..","..");console.log("\u{1F50D} Loading concepts from vault...");let i=gT(r),s=DJ(i);console.log(` ${i.length} concepts loaded (${s.size} unique terms/aliases)`),console.log("\u{1F4D6} Scanning aiKnow assets for orphan terms...");let o=Date.now(),c=NJ(t,s,e),l=((Date.now()-o)/1e3).toFixed(2);console.log(`
808
+ `)}a(_J,"formatSummary");function SJ(n,e){return{mode:e.apply?"apply":"dry-run",outDir:e.outDir,pairsCount:n.pairs.length,skippedCount:n.skipped.length,pairs:n.pairs.map(t=>({sourceUid:t.sourceUid,sourcePath:t.sourcePath,layoutUid:t.layout.uid,blockUid:t.block.uid,warnings:t.warnings})),skipped:n.skipped}}a(SJ,"summariseResult");var vu=H(Pt());function vJ(){return new se("start").description("Start the ValidatorDaemon process (long-running, Unix socket)").option("--socket <path>","Unix socket path",vu.DEFAULT_SOCKET_PATH).option("--idle-timeout <seconds>","Exit after N seconds of inactivity",String(Math.floor(vu.IDLE_TIMEOUT_MS/1e3))).action(async n=>{let e=n.socket,t=Number(n.idleTimeout)*1e3;await new vu.ValidatorDaemon(e,t).start()})}a(vJ,"daemonStartCommand");function FN(){let n=new se("daemon").description("Manage the ValidatorDaemon background process");return n.addCommand(vJ()),n}a(FN,"daemonCommand");var nn=require("fs"),NN=require("os"),Ns=require("path");var bJ=new Set(["class","state","error","phase","development","multi","asset","version","limit","flow","single","universal","loop","time","function","document","system","driven","commitment","false","true","alert","positive","backup","tool","user"]);function Py(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return{};let t={},r=e[1].split(`
809
+ `);for(let i of r){let s=i.match(/^([\w]+):\s*"?([^"]*)"?\s*$/);s&&(t[s[1]]=s[2])}return t}a(Py,"parseFrontmatterRaw");function mT(n){return n.replace(/^---[\s\S]*?---\r?\n/,"").replace(/```[\s\S]*?```/g," ").replace(/\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g,"$1").replace(/#+\s/g," ").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").replace(/[*_`]/g,"").toLowerCase()}a(mT,"extractBodyText");function LN(n,e){return n.exo__Asset_label?n.exo__Asset_label:e.split("/").pop()?.replace(/\.md$/,"")??""}a(LN,"extractLabel");function wJ(n){let e=n.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(!e)return[];let t=[],r=e[1].split(`
810
+ `),i=!1;for(let s of r){if(s.match(/^aliases:\s*$/)){i=!0;continue}if(i){let c=s.match(/^\s+-\s+"?([^"]*)"?\s*$/);c?t.push(c[1].trim()):!s.startsWith(" ")&&!s.startsWith(" ")&&(i=!1)}let o=s.match(/^aliases:\s+"?([^"\n]+)"?\s*$/);o&&o[1].trim()&&t.push(o[1].trim())}return t.filter(Boolean)}a(wJ,"extractAliases");function EJ(n,e){return n.includes("/concepts/")}a(EJ,"isConceptFile");function Pd(n){let e=[],t=(0,nn.readdirSync)(n);for(let r of t){if(r.startsWith(".")||r==="node_modules")continue;let i=(0,Ns.join)(n,r);(0,nn.statSync)(i).isDirectory()?e.push(...Pd(i)):r.endsWith(".md")&&e.push(i)}return e}a(Pd,"walkMdFiles");function TJ(n){let e=new Map,t;try{t=(0,nn.readdirSync)(n)}catch{return e}for(let r of t){if(!r.endsWith(".md"))continue;let i;try{i=(0,nn.readFileSync)((0,Ns.join)(n,r),"utf-8")}catch{continue}let s=i.match(/^aiKnow__Memory_aboutConcept:\s*"?\[\[([0-9a-f-]+)\|/m);if(s){let o=s[1];e.set(o,(e.get(o)??0)+1)}}return e}a(TJ,"countConceptFrequencies");function gT(n){let e=Pd(n),t=[];for(let r of e){let i;try{i=(0,nn.readFileSync)(r,"utf-8")}catch{continue}if(!EJ(r,i))continue;let s=Py(i),o=s.exo__Asset_uid??"";if(!o)continue;let c=LN(s,r),l=wJ(i);t.push({uid:o,label:c,aliases:l,filePath:r})}return t}a(gT,"loadConcepts");var kN=4,AJ=new Set(["the","and","for","but","with","this","that","from","have","been","are","was","will","can","not","all","any","both","each","few","more","most","other","some","such","than","then","when","where","which","while","who","how","its","into","over"]);function xJ(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(xJ,"escapeRegex");function DN(n,e){return e.length<kN||AJ.has(e.toLowerCase())?!1:new RegExp(`\\b${xJ(e)}\\b`,"i").test(n)}a(DN,"matchesWordBoundary");function bu(n,e){let t=n.toLowerCase(),r=e.toLowerCase();return r?t===r?1:r.length>=kN&&t.includes(r)?.85:0:0}a(bu,"scoreMatch");function CJ(n){let e=n.trim().split(/\s+/);return e.length!==1?!1:bJ.has(e[0].toLowerCase())}a(CJ,"isConceptStopListed");function RJ(n,e,t,r,i){let s=n.toLowerCase(),o=e.toLowerCase(),c=t,l=[];for(let u of r){if(CJ(u.label)||i?.has(u.uid))continue;let f=0,d="body_substring",h=bu(s,u.label);if(h>f&&(f=h,d=h===1?"label_exact":"label_substring"),f<1){(DN(c,u.label)||DN(o,u.label))&&.9>f&&(f=.9,d="body_word_exact");let p=bu(o,u.label),y=p===1?.75:p>0?.65:0;y>f&&(f=y,d=p===1?"description_exact":"description_substring");let v=bu(c,u.label),b=v===1?.6:v>0?.5:0;b>f&&(f=b,d=v===1?"body_exact":"body_substring")}for(let p of u.aliases){let y=bu(s,p);if(y>0){let w=y*.9;w>f&&(f=w,d=y===1?"alias_label_exact":"alias_label_substring")}let v=bu(o,p);if(v>0){let w=v===1?.675:v*.65*.9;w>f&&(f=w,d="alias_description_substring")}let b=bu(c,p);if(b>0){let w=b===1?.54:b*.5*.9;w>f&&(f=w,d="alias_body_substring")}}f>0&&l.push({concept_uid:u.uid,concept_label:u.label,concept_file:u.filePath,confidence:Math.round(f*100)/100,match_type:d})}return l.sort((u,f)=>f.confidence-u.confidence),l.slice(0,3)}a(RJ,"computeCandidates");function IJ(n,e){return n.confidence>=e&&(n.match_type==="label_exact"||n.match_type==="alias_label_exact"||n.match_type==="body_word_exact")}a(IJ,"isAutoApproved");async function PJ(n){let e=(0,Ns.resolve)(n.aiKnowDir),t=(0,Ns.resolve)(n.vault??(0,Ns.join)(e,"..","..","..")),r=n.autoThreshold??.8,i=n.frequencyCap??100,s=gT(t),o=TJ(e),c=new Set([...o.entries()].filter(([,f])=>f>=i).map(([f])=>f)),l=Pd(e),u=[];for(let f of l){let d;try{d=(0,nn.readFileSync)(f,"utf-8")}catch{continue}let h=Py(d),p=h.exo__Asset_uid??"";if(!p)continue;let y=LN(h,f),v=h.exo__Asset_description??"",b=mT(d),w=RJ(y,v,b,s,c),T=w[0],I=T?IJ(T,r):!1;u.push({aiKnow_uid:p,aiKnow_label:y,aiKnow_file:f,candidates:w,auto_approved:I,...I?{auto_approved_candidate:T}:{}})}return u}a(PJ,"runBackfillSuggest");function OJ(n,e){let t=e.substring(0,e.lastIndexOf("/"));(0,nn.existsSync)(t)||(0,nn.mkdirSync)(t,{recursive:!0});let r=n.map(i=>JSON.stringify(i)).join(`
811
+ `);(0,nn.writeFileSync)(e,r,"utf-8")}a(OJ,"writeJsonl");function MN(){let n=(0,Ns.join)((0,NN.homedir)(),".cache","exocortex","backfill-candidates.jsonl");return new se("suggest").description("Suggest concept backfill candidates for aiKnow assets").requiredOption("--aiKnow-dir <path>","Path to aiKnow assets directory").option("--vault <path>","Path to Obsidian vault (for finding concepts)").option("--output <path>","Output JSONL path",n).option("--auto-threshold <number>","Auto-approve confidence threshold","0.8").option("--frequency-cap <number>","Skip concepts with \u2265N existing stamps in aiKnow dir","100").option("--dry-run","Dry-run mode: output JSONL but do not write to vault (default)",!0).action(async e=>{let t=parseFloat(e.autoThreshold);if(isNaN(t)||t<0||t>1){console.error("\u274C --auto-threshold must be a number between 0 and 1"),process.exitCode=1;return}let r=parseInt(e.frequencyCap,10);if(isNaN(r)||r<1){console.error("\u274C --frequency-cap must be a positive integer"),process.exitCode=1;return}let i=(0,Ns.resolve)(e.aiKnowDir);if(!(0,nn.existsSync)(i)){console.error(`\u274C aiKnow directory not found: ${i}`),process.exitCode=1;return}console.log("\u{1F50D} Loading concepts from vault...");let s=e.vault?(0,Ns.resolve)(e.vault):void 0,o=Date.now(),c=await PJ({aiKnowDir:i,vault:s,output:e.output,autoThreshold:t,frequencyCap:r,dryRun:e.dryRun}),l=((Date.now()-o)/1e3).toFixed(2),u=c.filter(d=>d.auto_approved).length,f=c.filter(d=>d.candidates.length>0).length;OJ(c,e.output),console.log(`\u2705 Processed ${c.length} aiKnow assets in ${l}s`),console.log(` ${f} assets have concept candidates`),console.log(` ${u} assets auto-approved (confidence \u2265 ${t})`),console.log(`\u{1F4DD} Output: ${e.output}`),e.dryRun&&console.log("\u2139\uFE0F Dry-run mode: no writes to vault")})}a(MN,"backfillSuggestCommand");var Fy=require("fs"),Oy=require("path");var FJ=new Set(["about","above","after","again","against","also","always","another","around","back","been","before","being","below","between","both","came","change","could","data","does","done","down","each","every","file","first","fixed","from","full","func","given","have","help","here","high","hook","html","http","https","info","into","issue","just","keep","know","last","like","line","list","load","look","made","make","many","more","most","much","must","need","next","none","note","null","only","open","over","page","part","pass","path","plan","plus","port","post","prev","prop","push","read","real","repo","rest","return","rule","runs","same","save","self","send","sets","show","side","size","slow","some","sort","step","such","sure","take","than","that","them","then","there","these","they","this","time","todo","true","type","under","used","user","uses","using","uuid","very","view","wait","want","ways","well","were","what","when","where","which","while","will","with","work","your","zero","eto","eto","pri","kak","tak","vse","dlya","pro"]);function DJ(n){return n.toLowerCase().split(/[^a-z0-9_-]+/).filter(e=>e.length>=4&&!FJ.has(e)&&/[a-z]/.test(e))}a(DJ,"tokenize");function NJ(n){let e=new Set;for(let t of n){e.add(t.label.toLowerCase());for(let r of t.aliases)e.add(r.toLowerCase())}return e}a(NJ,"buildConceptTermSet");function LJ(n,e,t){let r=Pd(n),i=new Map;for(let s of r){let o;try{o=(0,Fy.readFileSync)(s,"utf-8")}catch{continue}let l=Py(o).exo__Asset_uid??"";if(!l)continue;let u=mT(o),f=DJ(u),d=new Set;for(let h of f){if(d.has(h)||(d.add(h),e.has(h)))continue;let p=i.get(h)??{count:0,uids:[]};p.count++,p.uids.length<3&&p.uids.push(l),i.set(h,p)}}return Array.from(i.entries()).map(([s,{count:o,uids:c}])=>({term:s,frequency:o,sample_uids:c})).sort((s,o)=>o.frequency-s.frequency).slice(0,t)}a(LJ,"extractOrphanTerms");function jN(){return new se("orphan-terms").description("Extract high-frequency terms from aiKnow assets that have no matching ims__Concept").requiredOption("--aiKnow-dir <path>","Path to aiKnow assets directory").option("--vault <path>","Path to Obsidian vault (for finding concepts)").option("--top <number>","Number of top orphan terms to return","20").action(n=>{let e=parseInt(n.top,10);if(isNaN(e)||e<1){console.error("\u274C --top must be a positive integer"),process.exitCode=1;return}let t=(0,Oy.resolve)(n.aiKnowDir);if(!(0,Fy.existsSync)(t)){console.error(`\u274C aiKnow directory not found: ${t}`),process.exitCode=1;return}let r=n.vault?(0,Oy.resolve)(n.vault):(0,Oy.resolve)(t,"..","..","..");console.log("\u{1F50D} Loading concepts from vault...");let i=gT(r),s=NJ(i);console.log(` ${i.length} concepts loaded (${s.size} unique terms/aliases)`),console.log("\u{1F4D6} Scanning aiKnow assets for orphan terms...");let o=Date.now(),c=LJ(t,s,e),l=((Date.now()-o)/1e3).toFixed(2);console.log(`
812
812
  \u2705 Top ${c.length} orphan terms (${l}s):
813
- `),console.log(`${"Rank".padEnd(6)}${"Term".padEnd(30)}${"Freq".padEnd(8)}Sample UIDs`),console.log("-".repeat(90)),c.forEach((u,f)=>{let d=`#${f+1}`.padEnd(6),h=u.term.padEnd(30),p=String(u.frequency).padEnd(8),y=u.sample_uids.join(", ");console.log(`${d}${h}${p}${y}`)})})}a(jN,"backfillOrphanTermsCommand");function $N(){let n=new se("backfill").description("Concept backfill tools for aiKnow assets");return n.addCommand(MN()),n.addCommand(jN()),n}a($N,"backfillCommand");var ky=require("path"),HN=require("fs"),QN=require("os");var Ny=require("child_process"),Ly=require("fs"),qN=require("path");var Zi=require("fs"),Dy=H(require("path")),UN=require("crypto");var LJ=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n([\s\S]*))?$/;function BN(n){let e=n.match(LJ);if(!e)return null;let[,t,r=""]=e,i=ar.load(t);if(i==null)return{frontmatter:{},body:r};if(typeof i!="object"||Array.isArray(i))throw new Error("frontmatter is not a YAML mapping");return{frontmatter:i,body:r}}a(BN,"parseFile");function kJ(n,e){let t=ar.dump(n,{lineWidth:-1,quotingType:'"',forceQuotes:!1,noRefs:!0}),r=e.length>0?e:"";return`---
813
+ `),console.log(`${"Rank".padEnd(6)}${"Term".padEnd(30)}${"Freq".padEnd(8)}Sample UIDs`),console.log("-".repeat(90)),c.forEach((u,f)=>{let d=`#${f+1}`.padEnd(6),h=u.term.padEnd(30),p=String(u.frequency).padEnd(8),y=u.sample_uids.join(", ");console.log(`${d}${h}${p}${y}`)})})}a(jN,"backfillOrphanTermsCommand");function $N(){let n=new se("backfill").description("Concept backfill tools for aiKnow assets");return n.addCommand(MN()),n.addCommand(jN()),n}a($N,"backfillCommand");var ky=require("path"),HN=require("fs"),QN=require("os");var Ny=require("child_process"),Ly=require("fs"),qN=require("path");var Zi=require("fs"),Dy=H(require("path")),UN=require("crypto");var kJ=/^---\s*\r?\n([\s\S]*?)\r?\n---\s*(?:\r?\n([\s\S]*))?$/;function BN(n){let e=n.match(kJ);if(!e)return null;let[,t,r=""]=e,i=ar.load(t);if(i==null)return{frontmatter:{},body:r};if(typeof i!="object"||Array.isArray(i))throw new Error("frontmatter is not a YAML mapping");return{frontmatter:i,body:r}}a(BN,"parseFile");function MJ(n,e){let t=ar.dump(n,{lineWidth:-1,quotingType:'"',forceQuotes:!1,noRefs:!0}),r=e.length>0?e:"";return`---
814
814
  ${t}---
815
- ${r}`}a(kJ,"serializeFile");function VN(n,e,t={}){let r=Dy.default.dirname(n),i=Dy.default.basename(n),s=Dy.default.join(r,`.${i}.tmp.${process.pid}.${(0,UN.randomBytes)(6).toString("hex")}`);try{let o=(0,Zi.readFileSync)(n,"utf8"),c;try{c=BN(o)}catch(f){return{success:!1,verified:!1,reason:"parse-error",error:f.message}}if(!c)return{success:!1,verified:!1,reason:"no-frontmatter"};let l={...c.frontmatter,...e},u=kJ(l,c.body);if((0,Zi.writeFileSync)(s,u,"utf8"),(0,Zi.renameSync)(s,n),t.verifyKey!==void 0){let f=(0,Zi.readFileSync)(n,"utf8"),d;try{d=BN(f)}catch(p){return{success:!1,verified:!1,reason:"parse-error",error:p.message}}if(!d)return{success:!1,verified:!1,reason:"no-frontmatter"};let h=d.frontmatter[t.verifyKey];return h!==t.verifyValue?{success:!1,verified:!1,reason:"verify-mismatch",error:`expected ${t.verifyKey}=${String(t.verifyValue)}, got ${String(h)}`}:{success:!0,verified:!0}}return{success:!0,verified:!0}}catch(o){if((0,Zi.existsSync)(s))try{(0,Zi.unlinkSync)(s)}catch{}return{success:!1,verified:!1,reason:"fs-error",error:o.message}}}a(VN,"atomicUpdateFrontmatter");var MJ=/^claude-child-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,jJ=/^claude-child-([0-9a-f]{8})-(\d+)$/,$J="EffortStatusDoing";function WN(n){return e=>new Promise((t,r)=>{n(e,(i,s,o)=>{i?r(Object.assign(i,{stdout:s,stderr:o})):t(s)})})}a(WN,"makeExecPromise");async function BJ(n=Ny.exec){let e=WN(n),t;try{t=await e("tmux list-sessions -F '#{session_name}' 2>/dev/null")}catch{return[]}let r=[];for(let i of t.split(`
816
- `).map(s=>s.trim()).filter(Boolean)){let s=MJ.exec(i);if(s){r.push({sessionName:i,uuid:s[1],type:"full"});continue}let o=jJ.exec(i);o&&r.push({sessionName:i,uuid:o[1],type:"short"})}return r}a(BJ,"listClaudeChildSessions");function UJ(n,e,t){let r=null,i=e.toLowerCase();function s(o){if(r)return;let c;try{c=(0,Ly.readdirSync)(o,{withFileTypes:!0})}catch{return}for(let l of c){if(r)return;if(l.name.startsWith(".")||l.name==="node_modules")continue;let u=(0,qN.join)(o,l.name);if(l.isDirectory())s(u);else if(l.name.endsWith(".md")){let f=l.name.slice(0,-3).toLowerCase();(t==="full"&&f===i||t==="short"&&f.startsWith(i))&&(r=u)}}}return a(s,"walk"),s(n),r}a(UJ,"findVaultFile");function VJ(n,e){try{let i=(e??(s=>(0,Ly.readFileSync)(s,"utf8")))(n).match(/ems__Effort_status\s*:.*\[\[([^\]]+)\]\]/);return i?i[1].includes($J):!1}catch{return!1}}a(VJ,"isTaskDoing");async function GN(n,e=Ny.exec,t){let r=await BJ(e),i=[];for(let s of r){let o=UJ(n,s.uuid,s.type);if(!o){i.push({sessionName:s.sessionName,taskUuid:s.uuid,taskFilePath:null,reason:"vault task not found"});continue}VJ(o,t)||i.push({sessionName:s.sessionName,taskUuid:s.uuid,taskFilePath:o,reason:"vault task status != Doing"})}return i}a(GN,"detectOrphans");async function zN(n,e,t=Ny.exec,r=VN){let i=WN(t);if(e)return{ok:!0};let s=new Date().toISOString();if(n.taskFilePath)try{r(n.taskFilePath,{ems__Effort_status:"[[ems__EffortStatusFailed]]",aiTask__Task_lastError:`orphan recovery: ${n.reason}`,exo__Asset_updatedAt:s})}catch(o){return{ok:!1,error:`vault update failed: ${o.message}`}}try{await i(`tmux kill-session -t ${JSON.stringify(n.sessionName)}`)}catch{}return{ok:!0}}a(zN,"recoverOrphan");function qJ(){return process.env.EXOCORTEX_VAULT??(0,ky.join)((0,QN.homedir)(),"vault-2025")}a(qJ,"defaultVault");function KN(){return new se("recover").description("Detect and recover orphaned claude-child tmux sessions. A session is orphaned when the corresponding vault task is not in Doing status. Default mode: dry-run (no changes). Use --apply to perform recovery.").option("--vault <path>","Path to Obsidian vault",qJ()).option("--dry-run","List orphans without applying changes (default)",!1).option("--apply","Apply orphan recovery: set Failed + kill tmux session",!1).action(async n=>{let e=(0,ky.resolve)(n.vault);if(!(0,HN.existsSync)(e)){console.error(`[recover] vault not found: ${e}`),process.exitCode=1;return}let t=!n.apply;console.log(`[recover] vault=${e} mode=${t?"dry-run":"apply"}`);let r=await GN(e);if(r.length===0){console.log("[recover] No orphaned claude-child sessions found.");return}console.log(`[recover] Found ${r.length} orphan(s):`);for(let o of r){let c=o.taskFilePath??"(not found in vault)";console.log(` session=${o.sessionName} uuid=${o.taskUuid} reason=${o.reason}`),console.log(` file=${c}`)}if(t){console.log("[recover] Dry-run mode: no changes applied. Use --apply to recover.");return}let i=0,s=0;for(let o of r){let c=await zN(o,!1);c.ok?(i++,console.log(`[recover] RECOVERED: ${o.sessionName}`)):(s++,console.error(`[recover] ERROR recovering ${o.sessionName}: ${c.error}`))}console.log(`[recover] Done: recovered=${i} errors=${s}`),s>0&&(process.exitCode=1)})}a(KN,"recoverCommand");function YN(n){n.addCommand(aD()),n.addCommand(fD()),n.addCommand(dD())}a(YN,"addQuerySubcommands");function XN(n){let e=new se;e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"15.174.5");let t=e.command("exoql").description("ExoQL query execution and cache management");YN(t);let r=e.command("sparql").description("(deprecated) Use 'exoql' instead");return YN(r),r.hook("preAction",()=>{console.error('\u26A0\uFE0F "sparql" is deprecated. Use "exoql" instead.')}),e.addCommand(vD()),e.addCommand(ED()),e.addCommand(TD()),e.addCommand(xD()),e.addCommand(CD()),e.addCommand(FD()),e.addCommand(kD()),e.addCommand(KD()),e.addCommand(JD()),e.addCommand(nN()),e.addCommand(oN()),e.addCommand(aN()),e.addCommand(lN()),e.addCommand(vN()),e.addCommand(TN()),e.addCommand(ON()),e.addCommand(FN()),e.addCommand($N()),e.addCommand(KN()),e}a(XN,"createProgram");XN().parse();0&&(module.exports={createProgram});
815
+ ${r}`}a(MJ,"serializeFile");function VN(n,e,t={}){let r=Dy.default.dirname(n),i=Dy.default.basename(n),s=Dy.default.join(r,`.${i}.tmp.${process.pid}.${(0,UN.randomBytes)(6).toString("hex")}`);try{let o=(0,Zi.readFileSync)(n,"utf8"),c;try{c=BN(o)}catch(f){return{success:!1,verified:!1,reason:"parse-error",error:f.message}}if(!c)return{success:!1,verified:!1,reason:"no-frontmatter"};let l={...c.frontmatter,...e},u=MJ(l,c.body);if((0,Zi.writeFileSync)(s,u,"utf8"),(0,Zi.renameSync)(s,n),t.verifyKey!==void 0){let f=(0,Zi.readFileSync)(n,"utf8"),d;try{d=BN(f)}catch(p){return{success:!1,verified:!1,reason:"parse-error",error:p.message}}if(!d)return{success:!1,verified:!1,reason:"no-frontmatter"};let h=d.frontmatter[t.verifyKey];return h!==t.verifyValue?{success:!1,verified:!1,reason:"verify-mismatch",error:`expected ${t.verifyKey}=${String(t.verifyValue)}, got ${String(h)}`}:{success:!0,verified:!0}}return{success:!0,verified:!0}}catch(o){if((0,Zi.existsSync)(s))try{(0,Zi.unlinkSync)(s)}catch{}return{success:!1,verified:!1,reason:"fs-error",error:o.message}}}a(VN,"atomicUpdateFrontmatter");var jJ=/^claude-child-([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/,$J=/^claude-child-([0-9a-f]{8})-(\d+)$/,BJ="EffortStatusDoing";function WN(n){return e=>new Promise((t,r)=>{n(e,(i,s,o)=>{i?r(Object.assign(i,{stdout:s,stderr:o})):t(s)})})}a(WN,"makeExecPromise");async function UJ(n=Ny.exec){let e=WN(n),t;try{t=await e("tmux list-sessions -F '#{session_name}' 2>/dev/null")}catch{return[]}let r=[];for(let i of t.split(`
816
+ `).map(s=>s.trim()).filter(Boolean)){let s=jJ.exec(i);if(s){r.push({sessionName:i,uuid:s[1],type:"full"});continue}let o=$J.exec(i);o&&r.push({sessionName:i,uuid:o[1],type:"short"})}return r}a(UJ,"listClaudeChildSessions");function VJ(n,e,t){let r=null,i=e.toLowerCase();function s(o){if(r)return;let c;try{c=(0,Ly.readdirSync)(o,{withFileTypes:!0})}catch{return}for(let l of c){if(r)return;if(l.name.startsWith(".")||l.name==="node_modules")continue;let u=(0,qN.join)(o,l.name);if(l.isDirectory())s(u);else if(l.name.endsWith(".md")){let f=l.name.slice(0,-3).toLowerCase();(t==="full"&&f===i||t==="short"&&f.startsWith(i))&&(r=u)}}}return a(s,"walk"),s(n),r}a(VJ,"findVaultFile");function qJ(n,e){try{let i=(e??(s=>(0,Ly.readFileSync)(s,"utf8")))(n).match(/ems__Effort_status\s*:.*\[\[([^\]]+)\]\]/);return i?i[1].includes(BJ):!1}catch{return!1}}a(qJ,"isTaskDoing");async function GN(n,e=Ny.exec,t){let r=await UJ(e),i=[];for(let s of r){let o=VJ(n,s.uuid,s.type);if(!o){i.push({sessionName:s.sessionName,taskUuid:s.uuid,taskFilePath:null,reason:"vault task not found"});continue}qJ(o,t)||i.push({sessionName:s.sessionName,taskUuid:s.uuid,taskFilePath:o,reason:"vault task status != Doing"})}return i}a(GN,"detectOrphans");async function zN(n,e,t=Ny.exec,r=VN){let i=WN(t);if(e)return{ok:!0};let s=new Date().toISOString();if(n.taskFilePath)try{r(n.taskFilePath,{ems__Effort_status:"[[ems__EffortStatusFailed]]",aiTask__Task_lastError:`orphan recovery: ${n.reason}`,exo__Asset_updatedAt:s})}catch(o){return{ok:!1,error:`vault update failed: ${o.message}`}}try{await i(`tmux kill-session -t ${JSON.stringify(n.sessionName)}`)}catch{}return{ok:!0}}a(zN,"recoverOrphan");function WJ(){return process.env.EXOCORTEX_VAULT??(0,ky.join)((0,QN.homedir)(),"vault-2025")}a(WJ,"defaultVault");function KN(){return new se("recover").description("Detect and recover orphaned claude-child tmux sessions. A session is orphaned when the corresponding vault task is not in Doing status. Default mode: dry-run (no changes). Use --apply to perform recovery.").option("--vault <path>","Path to Obsidian vault",WJ()).option("--dry-run","List orphans without applying changes (default)",!1).option("--apply","Apply orphan recovery: set Failed + kill tmux session",!1).action(async n=>{let e=(0,ky.resolve)(n.vault);if(!(0,HN.existsSync)(e)){console.error(`[recover] vault not found: ${e}`),process.exitCode=1;return}let t=!n.apply;console.log(`[recover] vault=${e} mode=${t?"dry-run":"apply"}`);let r=await GN(e);if(r.length===0){console.log("[recover] No orphaned claude-child sessions found.");return}console.log(`[recover] Found ${r.length} orphan(s):`);for(let o of r){let c=o.taskFilePath??"(not found in vault)";console.log(` session=${o.sessionName} uuid=${o.taskUuid} reason=${o.reason}`),console.log(` file=${c}`)}if(t){console.log("[recover] Dry-run mode: no changes applied. Use --apply to recover.");return}let i=0,s=0;for(let o of r){let c=await zN(o,!1);c.ok?(i++,console.log(`[recover] RECOVERED: ${o.sessionName}`)):(s++,console.error(`[recover] ERROR recovering ${o.sessionName}: ${c.error}`))}console.log(`[recover] Done: recovered=${i} errors=${s}`),s>0&&(process.exitCode=1)})}a(KN,"recoverCommand");function YN(n){n.addCommand(aD()),n.addCommand(fD()),n.addCommand(dD())}a(YN,"addQuerySubcommands");function XN(n){let e=new se;e.name("exocortex").description("CLI tool for Exocortex knowledge management system").version(n??"15.176.0");let t=e.command("exoql").description("ExoQL query execution and cache management");YN(t);let r=e.command("sparql").description("(deprecated) Use 'exoql' instead");return YN(r),r.hook("preAction",()=>{console.error('\u26A0\uFE0F "sparql" is deprecated. Use "exoql" instead.')}),e.addCommand(vD()),e.addCommand(ED()),e.addCommand(TD()),e.addCommand(xD()),e.addCommand(CD()),e.addCommand(FD()),e.addCommand(kD()),e.addCommand(KD()),e.addCommand(JD()),e.addCommand(nN()),e.addCommand(oN()),e.addCommand(aN()),e.addCommand(lN()),e.addCommand(vN()),e.addCommand(TN()),e.addCommand(ON()),e.addCommand(FN()),e.addCommand($N()),e.addCommand(KN()),e}a(XN,"createProgram");XN().parse();0&&(module.exports={createProgram});
817
817
  /*! Bundled license information:
818
818
 
819
819
  reflect-metadata/Reflect.js: