@kitelev/exocortex-cli 17.7.48 → 17.7.49

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 +48 -48
  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 v17.7.48
2
+ // @kitelev/exocortex-cli v17.7.49
3
3
  // CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more
4
4
  // License: MIT
5
5
 
@@ -28,7 +28,7 @@ Expecting one of '${n.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
28
28
  `),this.outputHelp({error:!0}));let n=t||{},i=n.exitCode||1,s=n.code||"commander.error";this._exit(i,s,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in wt.default.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,wt.default.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new ly(this.options),t=a(n=>this.getOptionValue(n)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(n)),"hasCustomOptionValue");this.options.filter(n=>n.implied!==void 0&&t(n.attributeName())&&e.valueFromOption(this.getOptionValue(n.attributeName()),n)).forEach(n=>{Object.keys(n.implied).filter(i=>!t(i)).forEach(i=>{this.setOptionValueWithSource(i,n.implied[i],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let n=a(o=>{let c=o.attributeName(),l=this.getOptionValue(c),u=this.options.find(d=>d.negate&&c===d.attributeName()),f=this.options.find(d=>!d.negate&&c===d.attributeName());return u&&(u.presetArg===void 0&&l===!1||u.presetArg!==void 0&&l===u.presetArg)?u:f||o},"findBestOptionFromValue"),i=a(o=>{let c=n(o),l=c.attributeName();return this.getOptionValueSource(l)==="env"?`environment variable '${c.envVar}'`:`option '${c.flags}'`},"getErrorMessage"),s=`error: ${i(e)} cannot be used with ${i(t)}`;this.error(s,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let i=[],s=this;do{let o=s.createHelp().visibleOptions(s).filter(c=>c.long).map(c=>c.long);i=i.concat(o),s=s.parent}while(s&&!s._enablePositionalOptions);t=Nv(e,i)}let n=`error: unknown option '${e}'${t}`;this.error(n,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,n=t===1?"":"s",i=e.length,s=this.parent?` for '${this.name()}'`:"",o=e.join(", "),c=`error: too many arguments${s}. Expected ${t} argument${n} but got ${i}: ${o}.`;this.error(c,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let i=[];this.createHelp().visibleCommands(this).forEach(s=>{i.push(s.name()),s.alias()&&i.push(s.alias())}),t=Nv(e,i)}let n=`error: unknown command '${e}'${t}`;this.error(n,{code:"commander.unknownCommand"})}version(e,t,n){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",n=n||"output the version number";let i=this.createOption(t,n);return this._versionOptionName=i.attributeName(),this._registerOption(i),this.on("option:"+i.name(),()=>{this._outputConfiguration.writeOut(`${e}
29
29
  `),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let n=this.parent?._findCommand(e);if(n){let i=[n.name()].concat(n.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${i}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(n=>ay(n));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}helpGroup(e){return e===void 0?this._helpGroupHeading??"":(this._helpGroupHeading=e,this)}commandsGroup(e){return e===void 0?this._defaultCommandGroup??"":(this._defaultCommandGroup=e,this)}optionsGroup(e){return e===void 0?this._defaultOptionGroup??"":(this._defaultOptionGroup=e,this)}_initOptionGroup(e){this._defaultOptionGroup&&!e.helpGroupHeading&&e.helpGroup(this._defaultOptionGroup)}_initCommandGroup(e){this._defaultCommandGroup&&!e.helpGroup()&&e.helpGroup(this._defaultCommandGroup)}nameFromFilename(e){return this._name=ho.default.basename(e,ho.default.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp(),n=this._getOutputContext(e);t.prepareContext({error:n.error,helpWidth:n.helpWidth,outputHasColors:n.hasColors});let i=t.formatHelp(this,t);return n.hasColors?i:this._outputConfiguration.stripColor(i)}_getOutputContext(e){e=e||{};let t=!!e.error,n,i,s;return t?(n=a(c=>this._outputConfiguration.writeErr(c),"baseWrite"),i=this._outputConfiguration.getErrHasColors(),s=this._outputConfiguration.getErrHelpWidth()):(n=a(c=>this._outputConfiguration.writeOut(c),"baseWrite"),i=this._outputConfiguration.getOutHasColors(),s=this._outputConfiguration.getOutHelpWidth()),{error:t,write:a(c=>(i||(c=this._outputConfiguration.stripColor(c)),n(c)),"write"),hasColors:i,helpWidth:s}}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let n=this._getOutputContext(e),i={error:n.error,write:n.write,command:this};this._getCommandAndAncestors().reverse().forEach(o=>o.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let s=this.helpInformation({error:n.error});if(t&&(s=t(s),typeof s!="string"&&!Buffer.isBuffer(s)))throw new Error("outputHelp callback must return a string or a Buffer");n.write(s),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(o=>o.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?(this._helpOption===null&&(this._helpOption=void 0),this._defaultOptionGroup&&this._initOptionGroup(this._getHelpOption())):this._helpOption=null,this):(this._helpOption=this.createOption(e??"-h, --help",t??"display help for command"),(e||t)&&this._initOptionGroup(this._helpOption),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this._initOptionGroup(e),this}help(e){this.outputHelp(e);let t=Number(wt.default.exitCode??0);t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let n=["beforeAll","before","after","afterAll"];if(!n.includes(e))throw new Error(`Unexpected value for position to addHelpText.
30
30
  Expecting one of '${n.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
- `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};a(OD,"incrementNodeInspectorPort");a(xD,"useColor")});var fTe,ut=$e(()=>{cy();DD();Bp();Dv();Lv();fTe=new de});var El=T(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.AssetClass=void 0;var LD;(function(r){r.AREA="ems__Area",r.TASK="ems__Task",r.PROJECT="ems__Project",r.ACTION="ems__Action",r.MEETING="ems__Meeting",r.INITIATIVE="ems__Initiative",r.TASK_PROTOTYPE="ems__TaskPrototype",r.MEETING_PROTOTYPE="ems__MeetingPrototype",r.EVENT_PROTOTYPE="exo__EventPrototype",r.PROJECT_PROTOTYPE="ems__ProjectPrototype",r.EVENT="exo__Event",r.DAILY_NOTE="pn__DailyNote",r.CONCEPT="concept__Concept",r.SESSION_START_EVENT="ems__SessionStartEvent",r.SESSION_END_EVENT="ems__SessionEndEvent",r.PROTOTYPE="exo__Prototype",r.CLASS="exo__Class",r.FLEETING_NOTE="ztlk__FleetingNote",r.WORKFLOW="ems__Workflow",r.WORKFLOW_STATE="ems__WorkflowState",r.WORKFLOW_TRANSITION="ems__WorkflowTransition",r.COMMAND="exocmd__Command",r.PRECONDITION="exocmd__Precondition",r.GROUNDING="exocmd__Grounding",r.COMMAND_BINDING="exocmd__CommandBinding"})(LD||(fy.AssetClass=LD={}))});var vl=T(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.EffortStatus=void 0;var ND;(function(r){r.DRAFT="ems__EffortStatusDraft",r.BACKLOG="ems__EffortStatusBacklog",r.DOING="ems__EffortStatusDoing",r.WAITING="ems__EffortStatusWaiting",r.DONE="ems__EffortStatusDone",r.TRASHED="ems__EffortStatusTrashed"})(ND||(dy.EffortStatus=ND={}))});var Ju=T(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.EFFORT_STATUS_BY_UID=oa.EFFORT_STATUS_UID=void 0;oa.normalizeEffortStatus=jq;var Qu=vl();oa.EFFORT_STATUS_UID={[Qu.EffortStatus.DRAFT]:"c42245d0-01de-4c35-bfcf-d910445ea28e",[Qu.EffortStatus.BACKLOG]:"753a44d5-846c-4b82-9196-4fd9a4d48777",[Qu.EffortStatus.DOING]:"027e78f4-6e16-4b36-b8fb-5510507d5745",[Qu.EffortStatus.WAITING]:"0610947c-6a62-41c8-9d44-7863d3ba3a8e",[Qu.EffortStatus.DONE]:"7b9b3116-7c3c-438c-9618-94fe301320a6",[Qu.EffortStatus.TRASHED]:"5d14f18d-db2b-4847-9ac1-144cb93b2541"};oa.EFFORT_STATUS_BY_UID=Object.freeze(Object.fromEntries(Object.entries(oa.EFFORT_STATUS_UID).map(([r,e])=>[e,r])));var kv=/^ems__EffortStatus[A-Za-z]+$/,Mq=/\s+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$q=/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function jq(r){let e=r;if(e==null)return null;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}let t=String(e).trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"").trim();if(!t)return null;if(kv.test(t))return t;let n=t.indexOf("|"),i=n===-1?t:t.slice(0,n).trim();if(n!==-1){let c=t.slice(n+1).trim();if(kv.test(c))return c}let s=i.replace(Mq,"").trim();if(kv.test(s))return s;let o=i.match($q);return o?oa.EFFORT_STATUS_BY_UID[o[1].toLowerCase()]??null:null}a(jq,"normalizeEffortStatus")});var Mv=T(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.EFFORT_STATUS_OPTIONS=void 0;var Bq=Ju();py.EFFORT_STATUS_OPTIONS=Object.freeze(Object.keys(Bq.EFFORT_STATUS_UID).map(r=>Object.freeze({value:`[[${r}]]`,label:r.replace(/^ems__EffortStatus/,"")})))});var dc=T(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.GroundingType=void 0;var kD;(function(r){r.SPARQL_UPDATE="sparql_update",r.PROPERTY_DELETE="property_delete",r.PROPERTY_SET="property_set",r.COMPOSITE="composite",r.SERVICE_CALL="service_call",r.CREATE_INSTANCE="create_instance",r.PROPERTY_APPEND="property_append",r.PROPERTY_REPLACE="property_replace",r.PROPERTY_INCREMENT="property_increment",r.PROPERTY_SHIFT="property_shift",r.WORKFLOW_TRANSITION="workflow_transition",r.BODY_TEMPLATE="body_template"})(kD||(hy.GroundingType=kD={}))});var qp=T(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.GROUNDING_TYPE_IRI_TO_ENUM=wi.GROUNDING_TYPE_UID_TO_ENUM=wi.GROUNDING_TYPE_UIDS=void 0;wi.resolveGroundingTypeFromIRI=Vq;wi.resolveGroundingTypeFromWikilinkLiteral=Gq;var er=dc();wi.GROUNDING_TYPE_UIDS={[er.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[er.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[er.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[er.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[er.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[er.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[er.GroundingType.PROPERTY_REPLACE]:"c8582746-6476-47f7-b0cc-e582c2754d84",[er.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[er.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[er.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[er.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[er.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};wi.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries(wi.GROUNDING_TYPE_UIDS).map(([r,e])=>[e,r])));var ts="https://exocortex.my/ontology/exocmd#";wi.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${ts}GroundingTypePropertySet`]:er.GroundingType.PROPERTY_SET,[`${ts}GroundingTypePropertyDelete`]:er.GroundingType.PROPERTY_DELETE,[`${ts}GroundingTypeComposite`]:er.GroundingType.COMPOSITE,[`${ts}GroundingTypeServiceCall`]:er.GroundingType.SERVICE_CALL,[`${ts}GroundingTypeCreateInstance`]:er.GroundingType.CREATE_INSTANCE,[`${ts}GroundingTypePropertyAppend`]:er.GroundingType.PROPERTY_APPEND,[`${ts}GroundingTypePropertyReplace`]:er.GroundingType.PROPERTY_REPLACE,[`${ts}GroundingTypePropertyIncrement`]:er.GroundingType.PROPERTY_INCREMENT,[`${ts}GroundingTypePropertyShift`]:er.GroundingType.PROPERTY_SHIFT,[`${ts}GroundingTypeSparqlUpdate`]:er.GroundingType.SPARQL_UPDATE,[`${ts}GroundingTypeWorkflowTransition`]:er.GroundingType.WORKFLOW_TRANSITION,[`${ts}GroundingTypeBodyTemplate`]:er.GroundingType.BODY_TEMPLATE});var Uq=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function Vq(r){let e=wi.GROUNDING_TYPE_IRI_TO_ENUM[r];if(e!==void 0)return e;let t=r.match(Uq);return t?wi.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(Vq,"resolveGroundingTypeFromIRI");function Gq(r){let e=r.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return e?wi.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(Gq,"resolveGroundingTypeFromWikilinkLiteral")});var $v=T(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.CommandBindingStyleProperty=rs.CommandBindingProperty=rs.GroundingProperty=rs.PreconditionProperty=rs.CommandProperty=void 0;rs.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",OPEN_IN_SAME_TAB:"exocmd__Command_openInSameTab"};rs.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};rs.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",STEPS:"exocmd__Grounding_steps",IS_DEFINED_BY:"exocmd__Grounding_isDefinedBy",LABEL_TEMPLATE:"exocmd__Grounding_labelTemplate"};rs.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"};rs.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 jv=T(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.STYLE_SOURCE_VALUES=Ei.LABEL_CLASS_VALUES=Ei.COMMAND_VARIANT_VALUES=void 0;Ei.isCommandVariant=qq;Ei.isLabelClass=Wq;Ei.isStyleSource=zq;Ei.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Ei.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Ei.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function qq(r){return typeof r=="string"&&Ei.COMMAND_VARIANT_VALUES.includes(r)}a(qq,"isCommandVariant");function Wq(r){return typeof r=="string"&&Ei.LABEL_CLASS_VALUES.includes(r)}a(Wq,"isLabelClass");function zq(r){return typeof r=="string"&&Ei.STYLE_SOURCE_VALUES.includes(r)}a(zq,"isStyleSource")});var MD=T(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.isCommandFrontmatter=Kq;Zu.isPreconditionFrontmatter=Hq;Zu.isGroundingFrontmatter=Yq;Zu.isCommandBindingFrontmatter=Xq;function Kq(r){return my(r,"exocmd__Command")}a(Kq,"isCommandFrontmatter");function Hq(r){return my(r,"exocmd__Precondition")}a(Hq,"isPreconditionFrontmatter");function Yq(r){return my(r,"exocmd__Grounding")}a(Yq,"isGroundingFrontmatter");function Xq(r){return my(r,"exocmd__CommandBinding")}a(Xq,"isCommandBindingFrontmatter");function my(r,e){let t=r.exo__Instance_class;if(t==null)return!1;let n=Array.isArray(t)?t:[t];for(let i of n){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(my,"hasInstanceClass")});var $D=T(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});Bv.parseGroundingDefinitionFromFrontmatter=Jq;var Qq=qp();function gy(r){if(typeof r!="string")return"";let e=r.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(gy,"normalizeGroundingRef");function Jq(r,e,t){let n=e.exocmd__Grounding_type,i=(()=>{if(typeof n!="string")return n;let w=(0,Qq.resolveGroundingTypeFromWikilinkLiteral)(n);if(w!==null)return w;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${n}' for exocmd__Grounding_type in fixture ${r}. Migrate to wikilink form per RFC 9d20c91f Phase 3.`)})(),s=i==="service_call"?e.exocmd__Grounding_serviceId??e.exocmd__Grounding_targetProperty:e.exocmd__Grounding_targetProperty,o;if(i==="composite"){let w=e.exocmd__Grounding_steps;Array.isArray(w)&&(o=w.map(R=>t(gy(R))))}let c=e.exocmd__Grounding_incrementBy,l;if(c!=null&&c!==""){let w=Number.parseInt(String(c),10);Number.isFinite(w)&&(l=w)}let u=e.exocmd__Grounding_targetValueRef,f=u?gy(u):void 0,d=e.exocmd__Grounding_templateRef,p=d?gy(d):void 0,h=e.exocmd__Grounding_cloneTargetBody,g=h===!0||h==="true",m=e.exocmd__Grounding_targetsCreatedInstance,b=m===!0||m==="true",S=e.exocmd__Grounding_omitLabel,_=S===!0||S==="true",A=e.exocmd__Grounding_targetQuery,E=A?gy(A):void 0;return{id:r,label:e.exo__Asset_label??"",type:i,targetProperty:s,targetValueRef:f,targetValueLiteral:e.exocmd__Grounding_targetValueLiteral,targetValueSubstitution:e.exocmd__Grounding_targetValueSubstitution,serviceCallPayload:e.exocmd__Grounding_serviceCallPayload,appendExpression:e.exocmd__Grounding_appendExpression,replaceFromExpression:e.exocmd__Grounding_replaceFromExpression,replaceToExpression:e.exocmd__Grounding_replaceToExpression,targetClass:e.exocmd__Grounding_targetClass,targetPrototype:e.exocmd__Grounding_targetPrototype,targetFolder:e.exocmd__Grounding_targetFolder,shiftDelta:e.exocmd__Grounding_shiftDelta,incrementBy:l,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:p,cloneTargetBody:g,targetsCreatedInstance:b,omitLabel:_,targetQuery:E,steps:o}}a(Jq,"parseGroundingDefinitionFromFrontmatter")});var jD=T(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.hasPosition=Zq;yy.isFixed=eW;function Zq(r){return typeof r.x=="number"&&typeof r.y=="number"}a(Zq,"hasPosition");function eW(r){return r.fx!==null&&r.fx!==void 0&&r.fy!==null&&r.fy!==void 0}a(eW,"isFixed")});var BD=T(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.createEmptyGraphData=tW;by.mergeGraphData=rW;function tW(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(tW,"createEmptyGraphData");function rW(r,e){let t=new Map,n=new Set,i=[];for(let s of r.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of r.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(r.version??0,e.version??0)+1}}a(rW,"mergeGraphData")});var Uv=T(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.createEdgeId=nW;_y.edgesEqual=iW;function nW(r,e,t,n){let i=n?`|${n}`:"";return`${r}->${e}:${t}${i}`}a(nW,"createEdgeId");function iW(r,e){return r.source===e.source&&r.target===e.target&&r.type===e.type&&r.predicate===e.predicate}a(iW,"edgesEqual")});var Vv=T(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.BUILT_IN_EDGE_STYLES=mr.BUILT_IN_NODE_STYLES=mr.DEFAULT_EDGE_STYLE=mr.DEFAULT_NODE_STYLE=mr.RDF_TYPE_PREDICATES=void 0;mr.mergeNodeStyles=sW;mr.mergeEdgeStyles=oW;mr.extractLocalName=aW;mr.isClassType=cW;mr.isTypePredicate=lW;mr.isSubClassPredicate=uW;mr.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"};mr.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};mr.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};mr.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"},person__Person:{color:"#06b6d4",shape:"circle"},ims__Person:{color:"#06b6d4",shape:"circle"}};mr.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 sW(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(sW,"mergeNodeStyles");function oW(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(oW,"mergeEdgeStyles");function aW(r){let e=r.lastIndexOf("#"),t=r.lastIndexOf("/"),n=Math.max(e,t);return n>=0?r.substring(n+1):r}a(aW,"extractLocalName");function cW(r){return r===mr.RDF_TYPE_PREDICATES.RDFS_CLASS||r===mr.RDF_TYPE_PREDICATES.OWL_CLASS}a(cW,"isClassType");function lW(r){return r===mr.RDF_TYPE_PREDICATES.RDF_TYPE}a(lW,"isTypePredicate");function uW(r){return r===mr.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(uW,"isSubClassPredicate")});var VD=T(UD=>{"use strict";Object.defineProperty(UD,"__esModule",{value:!0})});var Le=T(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IRI=void 0;var Gv=class r{static{a(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!r.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 n=["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(!n.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)}}};Sy.IRI=Gv});var Ye=T(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.Literal=void 0;Tl.parseLanguageTag=GD;Tl.createDirectionalLiteral=dW;Tl.createLiteralFromLanguageTag=pW;var fW="http://www.w3.org/2001/XMLSchema#string",Wp=class{static{a(this,"Literal")}constructor(e,t,n,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&n)throw new Error("Literal cannot have both datatype and language tag");if(i&&!n)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=n?n.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(),n=e.normalizedDatatype();return t===n}normalizedDatatype(){return!this._datatype||this._datatype.value===fW?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}};Tl.Literal=Wp;function GD(r){let t=r.lastIndexOf("--");if(t===-1)return{language:r.toLowerCase()};let n=r.substring(t+2),i=r.substring(0,t);return n==="ltr"||n==="rtl"?{language:i.toLowerCase(),direction:n}:{language:r.toLowerCase()}}a(GD,"parseLanguageTag");function dW(r,e,t){return new Wp(r,void 0,e,t)}a(dW,"createDirectionalLiteral");function pW(r,e){let{language:t,direction:n}=GD(e);return new Wp(r,void 0,t,n)}a(pW,"createLiteralFromLanguageTag")});var cr=T(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.BlankNode=void 0;var wy=class r{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${++r.counter}`}static create(){return new r(r.generateId())}};Ey.BlankNode=wy;wy.counter=0});var Rt=T(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.Namespace=void 0;var qD=Le(),Ke=class r{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 qD.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new qD.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[n,i]=t;return n!==this._prefix?null:this.term(i)}static isValidPrefix(e){return r.PREFIX_RE.test(e)}static forPrefix(e){if(!r.isValidPrefix(e))return null;let t=r.KNOWN_NAMESPACES.find(n=>n.prefix===e);return t||new r(e,`${r.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=r.PROPERTY_KEY_RE.exec(e);if(!t)return null;let n=r.forPrefix(t[1]);return n?{namespace:n,localName:t[2]}:null}static fromTermIRI(e){if(typeof e!="string"||e.length===0)return null;let t=a(l=>r.isCleanLocalName(l)?l:null,"cleanLocal");for(let l of r.KNOWN_NAMESPACES){let u=l.iri.value;if(e.startsWith(u)){let f=t(e.slice(u.length));return f===null?null:{namespace:l,localName:f}}}if(!e.startsWith(r.EXOCORTEX_ONTOLOGY_BASE))return null;let n=e.slice(r.EXOCORTEX_ONTOLOGY_BASE.length),i=n.indexOf("#");if(i<=0)return null;let s=n.slice(0,i);if(!r.isValidPrefix(s))return null;let o=t(n.slice(i+1));if(o===null)return null;let c=r.forPrefix(s);return c?{namespace:c,localName:o}:null}static isCleanLocalName(e){return e.length>0&&!e.includes("#")&&!e.includes("/")}static knownNamespaces(){return r.KNOWN_NAMESPACES}};vy.Namespace=Ke;Ke.RDF=new Ke("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Ke.RDFS=new Ke("rdfs","http://www.w3.org/2000/01/rdf-schema#");Ke.OWL=new Ke("owl","http://www.w3.org/2002/07/owl#");Ke.XSD=new Ke("xsd","http://www.w3.org/2001/XMLSchema#");Ke.SHACL=new Ke("sh","http://www.w3.org/ns/shacl#");Ke.EXO=new Ke("exo","https://exocortex.my/ontology/exo#");Ke.EMS=new Ke("ems","https://exocortex.my/ontology/ems#");Ke.EXOCMD=new Ke("exocmd","https://exocortex.my/ontology/exocmd#");Ke.IMS=new Ke("ims","https://exocortex.my/ontology/ims#");Ke.ZTLK=new Ke("ztlk","https://exocortex.my/ontology/ztlk#");Ke.PTMS=new Ke("ptms","https://exocortex.my/ontology/ptms#");Ke.LIT=new Ke("lit","https://exocortex.my/ontology/lit#");Ke.INBOX=new Ke("inbox","https://exocortex.my/ontology/inbox#");Ke.PMBOK=new Ke("pmbok","https://exocortex.my/ontology/pmbok#");Ke.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Ke.KNOWN_NAMESPACES=[Ke.EXO,Ke.EMS,Ke.EXOCMD,Ke.IMS,Ke.ZTLK,Ke.PTMS,Ke.LIT,Ke.INBOX,Ke.PMBOK,Ke.RDF,Ke.RDFS,Ke.OWL,Ke.XSD,Ke.SHACL];Ke.PREFIX_PATTERN_SOURCE="[a-z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*";Ke.PREFIX_RE=new RegExp(`^${Ke.PREFIX_PATTERN_SOURCE}$`);Ke.PROPERTY_KEY_RE=new RegExp(`^(${Ke.PREFIX_PATTERN_SOURCE})__(.+)$`)});var vi=T(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.Triple=void 0;var qv=Le(),Wv=Ye(),zv=cr(),Kv=class{static{a(this,"Triple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}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 qv.IRI&&t instanceof qv.IRI||e instanceof zv.BlankNode&&t instanceof zv.BlankNode||e instanceof Wv.Literal&&t instanceof Wv.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}>`,n=this.nodeToString(this._object);return`${e} ${t} ${n} .`}nodeToString(e){return e instanceof qv.IRI?`<${e.value}>`:e instanceof zv.BlankNode||e instanceof Wv.Literal||this.isQuotedTriple(e)?e.toString():""}};Ty.Triple=Kv});var zp=T(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.QuotedTriple=void 0;var Hv=Le(),Yv=Ye(),Xv=cr(),Qv=class r{static{a(this,"QuotedTriple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}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 Hv.IRI&&t instanceof Hv.IRI||e instanceof Xv.BlankNode&&t instanceof Xv.BlankNode||e instanceof Yv.Literal&&t instanceof Yv.Literal||e instanceof r&&t instanceof r?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,n=this.nodeToString(this._object);return`<< ${e} ${t} ${n} >>`}nodeToString(e){return e instanceof Hv.IRI?`<${e.value}>`:e instanceof Xv.BlankNode||e instanceof Yv.Literal||e instanceof r?e.toString():""}};Ay.QuotedTriple=Qv});var WD=T(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.QuotedTriple=Dr.Triple=Dr.Namespace=Dr.BlankNode=Dr.createLiteralFromLanguageTag=Dr.createDirectionalLiteral=Dr.parseLanguageTag=Dr.Literal=Dr.IRI=void 0;var hW=Le();Object.defineProperty(Dr,"IRI",{enumerable:!0,get:a(function(){return hW.IRI},"get")});var Iy=Ye();Object.defineProperty(Dr,"Literal",{enumerable:!0,get:a(function(){return Iy.Literal},"get")});Object.defineProperty(Dr,"parseLanguageTag",{enumerable:!0,get:a(function(){return Iy.parseLanguageTag},"get")});Object.defineProperty(Dr,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return Iy.createDirectionalLiteral},"get")});Object.defineProperty(Dr,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return Iy.createLiteralFromLanguageTag},"get")});var mW=cr();Object.defineProperty(Dr,"BlankNode",{enumerable:!0,get:a(function(){return mW.BlankNode},"get")});var gW=Rt();Object.defineProperty(Dr,"Namespace",{enumerable:!0,get:a(function(){return gW.Namespace},"get")});var yW=vi();Object.defineProperty(Dr,"Triple",{enumerable:!0,get:a(function(){return yW.Triple},"get")});var bW=zp();Object.defineProperty(Dr,"QuotedTriple",{enumerable:!0,get:a(function(){return bW.QuotedTriple},"get")})});var Ry=T(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.UUID_URL_NAMESPACE=is.DEFAULT_LANGUAGE_TAG=is.REQUIRED_PROPERTIES=is.ALLOWED_PROPERTIES=is.Exo003MetadataType=void 0;var ns;(function(r){r.Namespace="namespace",r.Anchor="anchor",r.BlankNode="blank_node",r.Statement="statement",r.Body="body"})(ns||(is.Exo003MetadataType=ns={}));is.ALLOWED_PROPERTIES={[ns.Namespace]:["metadata","uri","aliases"],[ns.Anchor]:["metadata","uri","aliases"],[ns.BlankNode]:["metadata","uri","aliases"],[ns.Statement]:["metadata","subject","predicate","object","aliases"],[ns.Body]:["metadata","subject","predicate","aliases"]};is.REQUIRED_PROPERTIES={[ns.Namespace]:["metadata","uri"],[ns.Anchor]:["metadata","uri"],[ns.BlankNode]:["metadata","uri"],[ns.Statement]:["metadata","subject","predicate","object"],[ns.Body]:["metadata","subject","predicate"]};is.DEFAULT_LANGUAGE_TAG="ru";is.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var zD=T(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var KD=T(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});Zv.default="00000000-0000-0000-0000-000000000000"});var HD=T(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.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 Kp=T(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var _W=HD();function SW(r){return typeof r=="string"&&_W.default.test(r)}a(SW,"validate");tT.default=SW});var Hp=T(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var wW=Kp();function EW(r){if(!(0,wW.default)(r))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(r.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(r.slice(9,13),16))>>>8,e&255,(e=parseInt(r.slice(14,18),16))>>>8,e&255,(e=parseInt(r.slice(19,23),16))>>>8,e&255,(e=parseInt(r.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}a(EW,"parse");rT.default=EW});var aa=T(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.unsafeStringify=void 0;var vW=Kp(),gn=[];for(let r=0;r<256;++r)gn.push((r+256).toString(16).slice(1));function YD(r,e=0){return(gn[r[e+0]]+gn[r[e+1]]+gn[r[e+2]]+gn[r[e+3]]+"-"+gn[r[e+4]]+gn[r[e+5]]+"-"+gn[r[e+6]]+gn[r[e+7]]+"-"+gn[r[e+8]]+gn[r[e+9]]+"-"+gn[r[e+10]]+gn[r[e+11]]+gn[r[e+12]]+gn[r[e+13]]+gn[r[e+14]]+gn[r[e+15]]).toLowerCase()}a(YD,"unsafeStringify");Yp.unsafeStringify=YD;function TW(r,e=0){let t=YD(r,e);if(!(0,vW.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(TW,"stringify");Yp.default=TW});var xy=T(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var AW=require("crypto"),Oy=new Uint8Array(256),Cy=Oy.length;function IW(){return Cy>Oy.length-16&&((0,AW.randomFillSync)(Oy),Cy=0),Oy.slice(Cy,Cy+=16)}a(IW,"rng");nT.default=IW});var iT=T(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.updateV1State=void 0;var XD=xy(),RW=aa(),Xp={};function CW(r,e,t){let n,i=r?._v6??!1;if(r){let s=Object.keys(r);s.length===1&&s[0]==="_v6"&&(r=void 0)}if(r)n=QD(r.random??r.rng?.()??(0,XD.default)(),r.msecs,r.nsecs,r.clockseq,r.node,e,t);else{let s=Date.now(),o=(0,XD.default)();JD(Xp,s,o),n=QD(o,Xp.msecs,Xp.nsecs,i?void 0:Xp.clockseq,i?void 0:Xp.node,e,t)}return e??(0,RW.unsafeStringify)(n)}a(CW,"v1");function JD(r,e,t){return r.msecs??=-1/0,r.nsecs??=0,e===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):e>r.msecs?r.nsecs=0:e<r.msecs&&(r.node=void 0),r.node||(r.node=t.slice(10,16),r.node[0]|=1,r.clockseq=(t[8]<<8|t[9])&16383),r.msecs=e,r}a(JD,"updateV1State");Qp.updateV1State=JD;function QD(r,e,t,n,i,s,o=0){if(r.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,n??=(r[8]<<8|r[9])&16383,i??=r.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++]=n>>>8|128,s[o++]=n&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(QD,"v1Bytes");Qp.default=CW});var oT=T(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var OW=Hp(),xW=aa();function PW(r){let e=typeof r=="string"?(0,OW.default)(r):r,t=FW(e);return typeof r=="string"?(0,xW.unsafeStringify)(t):t}a(PW,"v1ToV6");sT.default=PW;function FW(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(FW,"_v1ToV6")});var ZD=T(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var DW=require("crypto");function LW(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,DW.createHash)("md5").update(r).digest()}a(LW,"md5");aT.default=LW});var Jp=T(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.URL=ca.DNS=ca.stringToBytes=void 0;var eL=Hp(),NW=aa();function tL(r){r=unescape(encodeURIComponent(r));let e=new Uint8Array(r.length);for(let t=0;t<r.length;++t)e[t]=r.charCodeAt(t);return e}a(tL,"stringToBytes");ca.stringToBytes=tL;ca.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ca.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function kW(r,e,t,n,i,s){let o=typeof t=="string"?tL(t):t,c=typeof n=="string"?(0,eL.default)(n):n;if(typeof n=="string"&&(n=(0,eL.default)(n)),n?.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|r,l[8]=l[8]&63|128,i){if(s=s||0,s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,NW.unsafeStringify)(l)}a(kW,"v35");ca.default=kW});var nL=T(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.URL=Al.DNS=void 0;var MW=ZD(),cT=Jp(),rL=Jp();Object.defineProperty(Al,"DNS",{enumerable:!0,get:a(function(){return rL.DNS},"get")});Object.defineProperty(Al,"URL",{enumerable:!0,get:a(function(){return rL.URL},"get")});function lT(r,e,t,n){return(0,cT.default)(48,MW.default,r,e,t,n)}a(lT,"v3");lT.DNS=cT.DNS;lT.URL=cT.URL;Al.default=lT});var iL=T(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var $W=require("crypto");uT.default={randomUUID:$W.randomUUID}});var oL=T(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var sL=iL(),jW=xy(),BW=aa();function UW(r,e,t){if(sL.default.randomUUID&&!e&&!r)return sL.default.randomUUID();r=r||{};let n=r.random??r.rng?.()??(0,jW.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[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]=n[i];return e}return(0,BW.unsafeStringify)(n)}a(UW,"v4");fT.default=UW});var aL=T(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});var VW=require("crypto");function GW(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,VW.createHash)("sha1").update(r).digest()}a(GW,"sha1");dT.default=GW});var lL=T(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.URL=Il.DNS=void 0;var qW=aL(),pT=Jp(),cL=Jp();Object.defineProperty(Il,"DNS",{enumerable:!0,get:a(function(){return cL.DNS},"get")});Object.defineProperty(Il,"URL",{enumerable:!0,get:a(function(){return cL.URL},"get")});function hT(r,e,t,n){return(0,pT.default)(80,qW.default,r,e,t,n)}a(hT,"v5");hT.DNS=pT.DNS;hT.URL=pT.URL;Il.default=hT});var uL=T(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});var WW=aa(),zW=iT(),KW=oT();function HW(r,e,t){r??={},t??=0;let n=(0,zW.default)({...r,_v6:!0},new Uint8Array(16));if(n=(0,KW.default)(n),e){if(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]=n[i];return e}return(0,WW.unsafeStringify)(n)}a(HW,"v6");mT.default=HW});var fL=T(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var YW=Hp(),XW=aa();function QW(r){let e=typeof r=="string"?(0,YW.default)(r):r,t=JW(e);return typeof r=="string"?(0,XW.unsafeStringify)(t):t}a(QW,"v6ToV1");gT.default=QW;function JW(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(JW,"_v6ToV1")});var mL=T(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.updateV7State=void 0;var dL=xy(),ZW=aa(),yT={};function ez(r,e,t){let n;if(r)n=pL(r.random??r.rng?.()??(0,dL.default)(),r.msecs,r.seq,e,t);else{let i=Date.now(),s=(0,dL.default)();hL(yT,i,s),n=pL(s,yT.msecs,yT.seq,e,t)}return e??(0,ZW.unsafeStringify)(n)}a(ez,"v7");function hL(r,e,t){return r.msecs??=-1/0,r.seq??=0,e>r.msecs?(r.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],r.msecs=e):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}a(hL,"updateV7State");Zp.updateV7State=hL;function pL(r,e,t,n,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],n[i++]=e/1099511627776&255,n[i++]=e/4294967296&255,n[i++]=e/16777216&255,n[i++]=e/65536&255,n[i++]=e/256&255,n[i++]=e&255,n[i++]=112|t>>>28&15,n[i++]=t>>>20&255,n[i++]=128|t>>>14&63,n[i++]=t>>>6&255,n[i++]=t<<2&255|r[10]&3,n[i++]=r[11],n[i++]=r[12],n[i++]=r[13],n[i++]=r[14],n[i++]=r[15],n}a(pL,"v7Bytes");Zp.default=ez});var gL=T(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});var tz=Kp();function rz(r){if(!(0,tz.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}a(rz,"version");bT.default=rz});var ef=T(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.version=Pt.validate=Pt.v7=Pt.v6ToV1=Pt.v6=Pt.v5=Pt.v4=Pt.v3=Pt.v1ToV6=Pt.v1=Pt.stringify=Pt.parse=Pt.NIL=Pt.MAX=void 0;var nz=zD();Object.defineProperty(Pt,"MAX",{enumerable:!0,get:a(function(){return nz.default},"get")});var iz=KD();Object.defineProperty(Pt,"NIL",{enumerable:!0,get:a(function(){return iz.default},"get")});var sz=Hp();Object.defineProperty(Pt,"parse",{enumerable:!0,get:a(function(){return sz.default},"get")});var oz=aa();Object.defineProperty(Pt,"stringify",{enumerable:!0,get:a(function(){return oz.default},"get")});var az=iT();Object.defineProperty(Pt,"v1",{enumerable:!0,get:a(function(){return az.default},"get")});var cz=oT();Object.defineProperty(Pt,"v1ToV6",{enumerable:!0,get:a(function(){return cz.default},"get")});var lz=nL();Object.defineProperty(Pt,"v3",{enumerable:!0,get:a(function(){return lz.default},"get")});var uz=oL();Object.defineProperty(Pt,"v4",{enumerable:!0,get:a(function(){return uz.default},"get")});var fz=lL();Object.defineProperty(Pt,"v5",{enumerable:!0,get:a(function(){return fz.default},"get")});var dz=uL();Object.defineProperty(Pt,"v6",{enumerable:!0,get:a(function(){return dz.default},"get")});var pz=fL();Object.defineProperty(Pt,"v6ToV1",{enumerable:!0,get:a(function(){return pz.default},"get")});var hz=mL();Object.defineProperty(Pt,"v7",{enumerable:!0,get:a(function(){return hz.default},"get")});var mz=Kp();Object.defineProperty(Pt,"validate",{enumerable:!0,get:a(function(){return mz.default},"get")});var gz=gL();Object.defineProperty(Pt,"version",{enumerable:!0,get:a(function(){return gz.default},"get")})});var wT=T(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.Exo003UUIDGenerator=void 0;var _T=ef(),yL=Ry(),ST=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,_T.v5)(e,yL.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let n=this.generateNamespaceUUID(e);return(0,_T.v5)(t,n)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:n}=this.splitIRI(e);return n?this.generateAssetUUID(t,n):(0,_T.v5)(e,yL.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let n="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(n,i)}static generateStatementUUID(e,t,n){if(!e||!t||!n)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${n}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let n="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(n,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 n=e.lastIndexOf("/"),i=e.indexOf("://");return n!==-1&&n>i+2&&n<e.length-1?{namespace:e.substring(0,n+1),localName:e.substring(n+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)}};Py.Exo003UUIDGenerator=ST});var _L=T(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.Exo003Parser=void 0;var Ut=Ry(),eh=wT(),pc=Le(),Fy=Ye(),bL=cr(),yz=vi(),ET=class{static{a(this,"Exo003Parser")}static parse(e,t){let n=this.validate(e);if(!n.valid)return{success:!1,errors:n.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===Ut.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],n=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:n};let i=e.metadata;if(!Object.values(Ut.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(Ut.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:n};let s=i,o=Ut.ALLOWED_PROPERTIES[s],c=Ut.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 Ut.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case Ut.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case Ut.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case Ut.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case Ut.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,n);break}return{valid:t.length===0,errors:t,warnings:n}}static parseByType(e,t){let n={metadata:t,aliases:e.aliases};switch(t){case Ut.Exo003MetadataType.Namespace:return{...n,metadata:Ut.Exo003MetadataType.Namespace,uri:e.uri};case Ut.Exo003MetadataType.Anchor:return{...n,metadata:Ut.Exo003MetadataType.Anchor,uri:e.uri};case Ut.Exo003MetadataType.BlankNode:return{...n,metadata:Ut.Exo003MetadataType.BlankNode,uri:e.uri};case Ut.Exo003MetadataType.Statement:return{...n,metadata:Ut.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case Ut.Exo003MetadataType.Body:return{...n,metadata:Ut.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pc.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateAnchorMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pc.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateBlankNodeMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n){let i=n;if(!i.startsWith("_:"))try{new pc.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(n)}`)}}}static validateStatementMetadata(e,t){let n=e.subject,i=e.predicate,s=e.object,o=[["subject",n],["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,n){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,n){let i=t(e.subject),s;if(i.type==="iri")s=new pc.IRI(i.value);else if(i.type==="blank")s=new bL.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 pc.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new pc.IRI(l.value);else if(l.type==="blank")u=new bL.BlankNode(l.value);else{let f=n||l.value;if(l.datatype)u=new Fy.Literal(f,new pc.IRI(l.datatype));else{let d=l.language||Ut.DEFAULT_LANGUAGE_TAG;u=(0,Fy.createDirectionalLiteral)(f,d,l.direction)}}return new yz.Triple(s,c,u)}static toLiteral(e,t,n){if(n?.datatype)return new Fy.Literal(t,new pc.IRI(n.datatype));let i=n?.language||Ut.DEFAULT_LANGUAGE_TAG;return(0,Fy.createDirectionalLiteral)(t,i,n?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(Ut.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case Ut.Exo003MetadataType.Namespace:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.Anchor:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.BlankNode:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.Statement:{let n=e;return eh.Exo003UUIDGenerator.generateStatementUUID(n.subject,n.predicate,n.object)}case Ut.Exo003MetadataType.Body:{let n=e;return eh.Exo003UUIDGenerator.generateBodyUUID(n.subject+"|"+n.predicate)}}}};Dy.Exo003Parser=ET});var vT=T(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.Exo003Parser=Nn.Exo003UUIDGenerator=Nn.UUID_URL_NAMESPACE=Nn.DEFAULT_LANGUAGE_TAG=Nn.REQUIRED_PROPERTIES=Nn.ALLOWED_PROPERTIES=Nn.Exo003MetadataType=void 0;var th=Ry();Object.defineProperty(Nn,"Exo003MetadataType",{enumerable:!0,get:a(function(){return th.Exo003MetadataType},"get")});Object.defineProperty(Nn,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return th.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Nn,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return th.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Nn,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return th.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Nn,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return th.UUID_URL_NAMESPACE},"get")});var bz=wT();Object.defineProperty(Nn,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return bz.Exo003UUIDGenerator},"get")});var _z=_L();Object.defineProperty(Nn,"Exo003Parser",{enumerable:!0,get:a(function(){return _z.Exo003Parser},"get")})});var mo=T(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.WikiLinkHelpers=void 0;var rh=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let n=t.indexOf("|");if(n===-1)return t;let i=t.substring(0,n).trim(),s=t.substring(n+1).trim();return this.UUID_PATTERN.test(i)&&s||i}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(n=>this.normalize(n)).filter(n=>n.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let n=this.normalizeArray(e),i=this.normalize(t);return n.includes(i)}static resolveSymbolic(e,t){let n=this.normalize(e);if(!n)return"";if(this.UUID_PATTERN.test(n)){let i=t(n);return i&&i.length>0?i:n}return n}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};Ly.WikiLinkHelpers=rh;rh.WIKI_LINK_PATTERN=/\[\[|\]\]/g;rh.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var ky=T(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CommandBindingProperty=dt.GroundingProperty=dt.PreconditionProperty=dt.CommandProperty=dt.resolveGroundingTypeFromWikilinkLiteral=dt.resolveGroundingTypeFromIRI=dt.GROUNDING_TYPE_IRI_TO_ENUM=dt.GROUNDING_TYPE_UID_TO_ENUM=dt.GROUNDING_TYPE_UIDS=dt.GroundingType=dt.EFFORT_STATUS_OPTIONS=dt.normalizeEffortStatus=dt.EFFORT_STATUS_BY_UID=dt.EFFORT_STATUS_UID=dt.EffortStatus=dt.AssetClass=void 0;var Sz=El();Object.defineProperty(dt,"AssetClass",{enumerable:!0,get:a(function(){return Sz.AssetClass},"get")});var wz=vl();Object.defineProperty(dt,"EffortStatus",{enumerable:!0,get:a(function(){return wz.EffortStatus},"get")});var TT=Ju();Object.defineProperty(dt,"EFFORT_STATUS_UID",{enumerable:!0,get:a(function(){return TT.EFFORT_STATUS_UID},"get")});Object.defineProperty(dt,"EFFORT_STATUS_BY_UID",{enumerable:!0,get:a(function(){return TT.EFFORT_STATUS_BY_UID},"get")});Object.defineProperty(dt,"normalizeEffortStatus",{enumerable:!0,get:a(function(){return TT.normalizeEffortStatus},"get")});var Ez=Mv();Object.defineProperty(dt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Ez.EFFORT_STATUS_OPTIONS},"get")});var vz=dc();Object.defineProperty(dt,"GroundingType",{enumerable:!0,get:a(function(){return vz.GroundingType},"get")});var nh=qp();Object.defineProperty(dt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(dt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(dt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(dt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return nh.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(dt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return nh.resolveGroundingTypeFromWikilinkLiteral},"get")});var Ny=$v();Object.defineProperty(dt,"CommandProperty",{enumerable:!0,get:a(function(){return Ny.CommandProperty},"get")});Object.defineProperty(dt,"PreconditionProperty",{enumerable:!0,get:a(function(){return Ny.PreconditionProperty},"get")});Object.defineProperty(dt,"GroundingProperty",{enumerable:!0,get:a(function(){return Ny.GroundingProperty},"get")});Object.defineProperty(dt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Ny.CommandBindingProperty},"get")})});var vL=T(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.hasClass=Cl;kn.isAreaOrProject=Tz;kn.isEffort=Az;kn.hasStatus=Iz;kn.isAssetArchived=Rz;kn.hasEmptyProperties=Cz;kn.needsFolderRepair=Oz;kn.getTodayDateString=AT;kn.isPlannedForToday=xz;kn.hasPlannedStartTimestamp=Pz;kn.extractDailyNoteDate=Fz;kn.isCurrentDateGteDay=Dz;kn.inheritsFromPrototype=EL;kn.isPrototypeClass=Nz;var wL=mo(),Rl=ky();function Cl(r,e){return r?(Array.isArray(r)?r:[r]).some(n=>wL.WikiLinkHelpers.normalize(n)===e):!1}a(Cl,"hasClass");function Tz(r){return Cl(r,Rl.AssetClass.AREA)||Cl(r,Rl.AssetClass.PROJECT)}a(Tz,"isAreaOrProject");function Az(r){return Cl(r,Rl.AssetClass.TASK)||Cl(r,Rl.AssetClass.PROJECT)||Cl(r,Rl.AssetClass.MEETING)}a(Az,"isEffort");function Iz(r,e){if(!r)return!1;let t=Array.isArray(r)?r[0]:r;return t?wL.WikiLinkHelpers.normalize(t)===e:!1}a(Iz,"hasStatus");function Rz(r){if(r===!0||r===1)return!0;if(typeof r=="string"){let e=r.toLowerCase();return e==="true"||e==="yes"}return!1}a(Rz,"isAssetArchived");function Cz(r){if(!r||Object.keys(r).length===0)return!1;let e=a(t=>t==null||t==="","isEmptyArrayItem");return Object.values(r).some(t=>t==null?!0:typeof t=="string"?t==="":Array.isArray(t)?t.length===0||t.every(e):typeof t=="object"&&Object.keys(t).length===0)}a(Cz,"hasEmptyProperties");function Oz(r,e){if(!e)return!1;let t=r.replace(/\/$/,""),n=e.replace(/\/$/,"");return t!==n}a(Oz,"needsFolderRepair");function AT(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}a(AT,"getTodayDateString");function xz(r){let e=r.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=AT();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(xz,"isPlannedForToday");function Pz(r){let e=r.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(Pz,"hasPlannedStartTimestamp");function Fz(r){let e=r.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]),n=t.match(/\[\[([^\[\]]+)\]\]/);return n?n[1]:t}return null}a(Fz,"extractDailyNoteDate");function Dz(r){return AT()>=r}a(Dz,"isCurrentDateGteDay");function SL(r){return r?r.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(SL,"normalizeWithQuotes");var Lz=10;function EL(r,e=Lz){let t=r.exo__Class_superClass;if(!t)return!1;let n=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=SL(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===Rl.AssetClass.PROTOTYPE)return!0;if(n.has(c))continue;n.add(c);let u=`${c}__exo__Class_superClass`,f=r[u];if(f){let d=Array.isArray(f)?f:[f];for(let p of d){let h=SL(p);h&&!n.has(h)&&i.push({className:h,depth:l+1})}}}return!1}a(EL,"inheritsFromPrototype");function Nz(r,e){return Cl(r,Rl.AssetClass.CLASS)?EL(e):!1}a(Nz,"isPrototypeClass")});var TL=T(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.isPrototypeClass=Ft.inheritsFromPrototype=Ft.isCurrentDateGteDay=Ft.extractDailyNoteDate=Ft.hasPlannedStartTimestamp=Ft.isPlannedForToday=Ft.getTodayDateString=Ft.needsFolderRepair=Ft.hasEmptyProperties=Ft.isAssetArchived=Ft.hasStatus=Ft.isEffort=Ft.isAreaOrProject=Ft.hasClass=void 0;var Ti=vL();Object.defineProperty(Ft,"hasClass",{enumerable:!0,get:a(function(){return Ti.hasClass},"get")});Object.defineProperty(Ft,"isAreaOrProject",{enumerable:!0,get:a(function(){return Ti.isAreaOrProject},"get")});Object.defineProperty(Ft,"isEffort",{enumerable:!0,get:a(function(){return Ti.isEffort},"get")});Object.defineProperty(Ft,"hasStatus",{enumerable:!0,get:a(function(){return Ti.hasStatus},"get")});Object.defineProperty(Ft,"isAssetArchived",{enumerable:!0,get:a(function(){return Ti.isAssetArchived},"get")});Object.defineProperty(Ft,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Ti.hasEmptyProperties},"get")});Object.defineProperty(Ft,"needsFolderRepair",{enumerable:!0,get:a(function(){return Ti.needsFolderRepair},"get")});Object.defineProperty(Ft,"getTodayDateString",{enumerable:!0,get:a(function(){return Ti.getTodayDateString},"get")});Object.defineProperty(Ft,"isPlannedForToday",{enumerable:!0,get:a(function(){return Ti.isPlannedForToday},"get")});Object.defineProperty(Ft,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Ti.hasPlannedStartTimestamp},"get")});Object.defineProperty(Ft,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Ti.extractDailyNoteDate},"get")});Object.defineProperty(Ft,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Ti.isCurrentDateGteDay},"get")});Object.defineProperty(Ft,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Ti.inheritsFromPrototype},"get")});Object.defineProperty(Ft,"isPrototypeClass",{enumerable:!0,get:a(function(){return Ti.isPrototypeClass},"get")})});var AL=T(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.TsFloorViolationError=Dt.CATALOG_KEEP_NAMESPACES=Dt.PLUGIN_UI_FLOOR=Dt.SDK_FLOOR=Dt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=Dt.SDK_FLOOR_ASSETSPACE_UIDS=Dt.TS_FLOOR_AS_UID_SHARED_IDENTITIES=Dt.TS_FLOOR_AS_UID_EXOCMD=Dt.TS_FLOOR_AS_UID_EXO=void 0;Dt.assertTsFloor=kz;Dt.assertTsFloorReconciled=Mz;Dt.isTsFloorAssetSpace=$z;Dt.isTsFloorMountPath=jz;Dt.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";Dt.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";Dt.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";Dt.SDK_FLOOR_ASSETSPACE_UIDS=new Set([Dt.TS_FLOOR_AS_UID_EXO]);Dt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([Dt.TS_FLOOR_AS_UID_EXO]);Dt.SDK_FLOOR=[{uid:Dt.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];Dt.PLUGIN_UI_FLOOR=Dt.SDK_FLOOR;Dt.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var ih=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};Dt.TsFloorViolationError=ih;function kz(r,e){let t=[];for(let n of e)r.has(n)||t.push(n);if(t.length>0)throw new ih(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(kz,"assertTsFloor");function Mz(r,e,t){let n=[];for(let i of t)r.has(i.uid)||e.has(i.namespace)||n.push(`${i.namespace} (${i.uid})`);if(n.length>0)throw new ih(`Target profile's declared set excludes TS-floor AssetSpace(s): ${n.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(Mz,"assertTsFloorReconciled");function $z(r,e,t=Dt.SDK_FLOOR){return t.some(n=>r.length>0&&n.uid===r||e.length>0&&n.namespace===e)}a($z,"isTsFloorAssetSpace");function jz(r,e=Dt.SDK_FLOOR){let t=r.replace(/\/+$/,""),n=t.slice(t.lastIndexOf("/")+1),i=n.startsWith("exoas-")?n.slice(6):n;return i.length===0?!1:e.some(s=>s.namespace===i)}a(jz,"isTsFloorMountPath")});var IL=T(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});IT.transitiveDependsOnClosure=Bz;function Bz(r,e){let t=new Set,n=[];for(let i of r)t.has(i)||(t.add(i),n.push(i));for(;n.length>0;){let i=n.shift();if(i===void 0)break;let s=e.get(i);if(s!==void 0)for(let o of s)t.has(o)||(t.add(o),n.push(o))}return t}a(Bz,"transitiveDependsOnClosure")});var RT=T(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.PARKED_ROOT=Ai.DEPENDENCY_KIND_REFERENCE_UID=Ai.DEPENDENCY_KIND_TBOX_UID=void 0;Ai.resolveDependencyKind=CL;Ai.parkedPathFor=Vz;Ai.classifyMountTransition=Gz;Ai.DEPENDENCY_KIND_TBOX_UID="e1d7fb5c-d334-448d-935b-953b7b033e78";Ai.DEPENDENCY_KIND_REFERENCE_UID="fe529085-5370-4ac0-bbe4-1c7351242dee";var Uz="dependencykindreference";function CL(r){let e=Array.isArray(r)?r[0]:r;if(typeof e!="string")return"tbox";let t=e.toLowerCase();return t.includes(Ai.DEPENDENCY_KIND_TBOX_UID)?"tbox":t.includes(Ai.DEPENDENCY_KIND_REFERENCE_UID)||t.includes(Uz)?"reference":"tbox"}a(CL,"resolveDependencyKind");Ai.PARKED_ROOT=".exocortex/parked";var RL="assetspaces/";function Vz(r){let e=r.split("/");if(r.length===0||!r.startsWith(RL)||e.some(t=>t.length===0||t==="."||t===".."))throw new Error(`parkedPathFor: refusing unsafe mount folder "${r}"`);return`${Ai.PARKED_ROOT}/${r.slice(RL.length)}`}a(Vz,"parkedPathFor");function Gz(r){let{state:e,inEffectiveSet:t,dependsOnKind:n,canPark:i=!0}=r;switch(e){case"active":return t?"none":i&&CL(n)==="reference"?"park":"destroy";case"parked":return t?"unpark":"none";case"absent":return t?"materialize":"none"}}a(Gz,"classifyMountTransition")});var PL=T(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.ParkedAssetIndex=void 0;var OL=RT();function qz(r){let t=r.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim().split("#")[0].trim();return(t.split("/").pop()??t).replace(/\.md$/i,"")}a(qz,"normalizeLinkTarget");function xL(r){let e=r.match(/^---\r?\n([\s\S]*?)\r?\n---/);return e===null?null:e[1]}a(xL,"frontmatterOf");function Wz(r){let e=xL(r);if(e===null)return!1;let t=e.match(/^exo__Asset_uid:[ \t]*(.+)$/m);return t!==null&&t[1].trim().length>0}a(Wz,"hasAssetUid");function zz(r){let e=xL(r);if(e===null)return null;let t=e.match(/^exo__Asset_label:[ \t]*(.+)$/m);if(t===null)return null;let n=t[1].trim();return n.length<1?null:n.length>=2&&n.startsWith('"')&&n.endsWith('"')?CT(n.slice(1,-1).replace(/\\(["\\ntr])/g,(i,s)=>s==="n"?`
31
+ `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(i=>t.is(i))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};a(OD,"incrementNodeInspectorPort");a(xD,"useColor")});var dTe,ut=$e(()=>{cy();DD();Bp();Dv();Lv();dTe=new de});var El=T(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.AssetClass=void 0;var LD;(function(r){r.AREA="ems__Area",r.TASK="ems__Task",r.PROJECT="ems__Project",r.ACTION="ems__Action",r.MEETING="ems__Meeting",r.INITIATIVE="ems__Initiative",r.TASK_PROTOTYPE="ems__TaskPrototype",r.MEETING_PROTOTYPE="ems__MeetingPrototype",r.EVENT_PROTOTYPE="exo__EventPrototype",r.PROJECT_PROTOTYPE="ems__ProjectPrototype",r.EVENT="exo__Event",r.DAILY_NOTE="pn__DailyNote",r.CONCEPT="concept__Concept",r.SESSION_START_EVENT="ems__SessionStartEvent",r.SESSION_END_EVENT="ems__SessionEndEvent",r.PROTOTYPE="exo__Prototype",r.CLASS="exo__Class",r.FLEETING_NOTE="ztlk__FleetingNote",r.WORKFLOW="ems__Workflow",r.WORKFLOW_STATE="ems__WorkflowState",r.WORKFLOW_TRANSITION="ems__WorkflowTransition",r.COMMAND="exocmd__Command",r.PRECONDITION="exocmd__Precondition",r.GROUNDING="exocmd__Grounding",r.COMMAND_BINDING="exocmd__CommandBinding"})(LD||(fy.AssetClass=LD={}))});var vl=T(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});dy.EffortStatus=void 0;var ND;(function(r){r.DRAFT="ems__EffortStatusDraft",r.BACKLOG="ems__EffortStatusBacklog",r.DOING="ems__EffortStatusDoing",r.WAITING="ems__EffortStatusWaiting",r.DONE="ems__EffortStatusDone",r.TRASHED="ems__EffortStatusTrashed"})(ND||(dy.EffortStatus=ND={}))});var Ju=T(oa=>{"use strict";Object.defineProperty(oa,"__esModule",{value:!0});oa.EFFORT_STATUS_BY_UID=oa.EFFORT_STATUS_UID=void 0;oa.normalizeEffortStatus=jq;var Qu=vl();oa.EFFORT_STATUS_UID={[Qu.EffortStatus.DRAFT]:"c42245d0-01de-4c35-bfcf-d910445ea28e",[Qu.EffortStatus.BACKLOG]:"753a44d5-846c-4b82-9196-4fd9a4d48777",[Qu.EffortStatus.DOING]:"027e78f4-6e16-4b36-b8fb-5510507d5745",[Qu.EffortStatus.WAITING]:"0610947c-6a62-41c8-9d44-7863d3ba3a8e",[Qu.EffortStatus.DONE]:"7b9b3116-7c3c-438c-9618-94fe301320a6",[Qu.EffortStatus.TRASHED]:"5d14f18d-db2b-4847-9ac1-144cb93b2541"};oa.EFFORT_STATUS_BY_UID=Object.freeze(Object.fromEntries(Object.entries(oa.EFFORT_STATUS_UID).map(([r,e])=>[e,r])));var kv=/^ems__EffortStatus[A-Za-z]+$/,Mq=/\s+[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,$q=/^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function jq(r){let e=r;if(e==null)return null;if(Array.isArray(e)){if(e.length!==1)return null;e=e[0]}let t=String(e).trim().replace(/^["']/,"").replace(/["']$/,"").replace(/^\[\[/,"").replace(/\]\]$/,"").trim();if(!t)return null;if(kv.test(t))return t;let n=t.indexOf("|"),i=n===-1?t:t.slice(0,n).trim();if(n!==-1){let c=t.slice(n+1).trim();if(kv.test(c))return c}let s=i.replace(Mq,"").trim();if(kv.test(s))return s;let o=i.match($q);return o?oa.EFFORT_STATUS_BY_UID[o[1].toLowerCase()]??null:null}a(jq,"normalizeEffortStatus")});var Mv=T(py=>{"use strict";Object.defineProperty(py,"__esModule",{value:!0});py.EFFORT_STATUS_OPTIONS=void 0;var Bq=Ju();py.EFFORT_STATUS_OPTIONS=Object.freeze(Object.keys(Bq.EFFORT_STATUS_UID).map(r=>Object.freeze({value:`[[${r}]]`,label:r.replace(/^ems__EffortStatus/,"")})))});var dc=T(hy=>{"use strict";Object.defineProperty(hy,"__esModule",{value:!0});hy.GroundingType=void 0;var kD;(function(r){r.SPARQL_UPDATE="sparql_update",r.PROPERTY_DELETE="property_delete",r.PROPERTY_SET="property_set",r.COMPOSITE="composite",r.SERVICE_CALL="service_call",r.CREATE_INSTANCE="create_instance",r.PROPERTY_APPEND="property_append",r.PROPERTY_REPLACE="property_replace",r.PROPERTY_INCREMENT="property_increment",r.PROPERTY_SHIFT="property_shift",r.WORKFLOW_TRANSITION="workflow_transition",r.BODY_TEMPLATE="body_template"})(kD||(hy.GroundingType=kD={}))});var qp=T(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.GROUNDING_TYPE_IRI_TO_ENUM=wi.GROUNDING_TYPE_UID_TO_ENUM=wi.GROUNDING_TYPE_UIDS=void 0;wi.resolveGroundingTypeFromIRI=Vq;wi.resolveGroundingTypeFromWikilinkLiteral=Gq;var er=dc();wi.GROUNDING_TYPE_UIDS={[er.GroundingType.PROPERTY_SET]:"cf3bb923-f1f1-40be-b728-782844402426",[er.GroundingType.PROPERTY_DELETE]:"4bdf1d0b-e9da-4d96-bafe-c5aaef8c2bd5",[er.GroundingType.COMPOSITE]:"8f9a57db-3865-4886-92fb-c5ab7f3c3fa3",[er.GroundingType.SERVICE_CALL]:"9bf9fc99-ac37-4e51-b9f5-bd920099947c",[er.GroundingType.CREATE_INSTANCE]:"4367e2d6-6c92-450a-becb-abce1fb07682",[er.GroundingType.PROPERTY_APPEND]:"572f7e69-a8a1-42f6-8113-5aa65cc4b552",[er.GroundingType.PROPERTY_REPLACE]:"c8582746-6476-47f7-b0cc-e582c2754d84",[er.GroundingType.PROPERTY_INCREMENT]:"afc29f90-45eb-4f94-9fe2-2ce738759161",[er.GroundingType.PROPERTY_SHIFT]:"f4e5266f-f3cc-49fd-a5a5-ce1e8b7847a4",[er.GroundingType.SPARQL_UPDATE]:"79c3e709-8d1d-4694-bcc6-b9ff07d59b86",[er.GroundingType.WORKFLOW_TRANSITION]:"5c1a2552-d576-496d-8823-563573dd1e2f",[er.GroundingType.BODY_TEMPLATE]:"6093bfcb-cf9b-4565-86c3-ff74d8bc11c0"};wi.GROUNDING_TYPE_UID_TO_ENUM=Object.freeze(Object.fromEntries(Object.entries(wi.GROUNDING_TYPE_UIDS).map(([r,e])=>[e,r])));var ts="https://exocortex.my/ontology/exocmd#";wi.GROUNDING_TYPE_IRI_TO_ENUM=Object.freeze({[`${ts}GroundingTypePropertySet`]:er.GroundingType.PROPERTY_SET,[`${ts}GroundingTypePropertyDelete`]:er.GroundingType.PROPERTY_DELETE,[`${ts}GroundingTypeComposite`]:er.GroundingType.COMPOSITE,[`${ts}GroundingTypeServiceCall`]:er.GroundingType.SERVICE_CALL,[`${ts}GroundingTypeCreateInstance`]:er.GroundingType.CREATE_INSTANCE,[`${ts}GroundingTypePropertyAppend`]:er.GroundingType.PROPERTY_APPEND,[`${ts}GroundingTypePropertyReplace`]:er.GroundingType.PROPERTY_REPLACE,[`${ts}GroundingTypePropertyIncrement`]:er.GroundingType.PROPERTY_INCREMENT,[`${ts}GroundingTypePropertyShift`]:er.GroundingType.PROPERTY_SHIFT,[`${ts}GroundingTypeSparqlUpdate`]:er.GroundingType.SPARQL_UPDATE,[`${ts}GroundingTypeWorkflowTransition`]:er.GroundingType.WORKFLOW_TRANSITION,[`${ts}GroundingTypeBodyTemplate`]:er.GroundingType.BODY_TEMPLATE});var Uq=/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;function Vq(r){let e=wi.GROUNDING_TYPE_IRI_TO_ENUM[r];if(e!==void 0)return e;let t=r.match(Uq);return t?wi.GROUNDING_TYPE_UID_TO_ENUM[t[1].toLowerCase()]??null:null}a(Vq,"resolveGroundingTypeFromIRI");function Gq(r){let e=r.match(/^\[\[([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})(?:\|[^\]]*)?\]\]$/i);return e?wi.GROUNDING_TYPE_UID_TO_ENUM[e[1].toLowerCase()]??null:null}a(Gq,"resolveGroundingTypeFromWikilinkLiteral")});var $v=T(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.CommandBindingStyleProperty=rs.CommandBindingProperty=rs.GroundingProperty=rs.PreconditionProperty=rs.CommandProperty=void 0;rs.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",OPEN_IN_SAME_TAB:"exocmd__Command_openInSameTab"};rs.PreconditionProperty={SPARQL_ASK:"exocmd__Precondition_sparqlAsk",QUERY:"exocmd__Precondition_query"};rs.GroundingProperty={TYPE:"exocmd__Grounding_type",SPARQL_UPDATE:"exocmd__Grounding_sparqlUpdate",TARGET_PROPERTY:"exocmd__Grounding_targetProperty",STEPS:"exocmd__Grounding_steps",IS_DEFINED_BY:"exocmd__Grounding_isDefinedBy",LABEL_TEMPLATE:"exocmd__Grounding_labelTemplate"};rs.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"};rs.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 jv=T(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.STYLE_SOURCE_VALUES=Ei.LABEL_CLASS_VALUES=Ei.COMMAND_VARIANT_VALUES=void 0;Ei.isCommandVariant=qq;Ei.isLabelClass=Wq;Ei.isStyleSource=zq;Ei.COMMAND_VARIANT_VALUES=Object.freeze(["primary","secondary","success","warning","danger","muted"]);Ei.LABEL_CLASS_VALUES=Object.freeze(["muted","bold","uppercase","compact"]);Ei.STYLE_SOURCE_VALUES=Object.freeze(["vendor","user"]);function qq(r){return typeof r=="string"&&Ei.COMMAND_VARIANT_VALUES.includes(r)}a(qq,"isCommandVariant");function Wq(r){return typeof r=="string"&&Ei.LABEL_CLASS_VALUES.includes(r)}a(Wq,"isLabelClass");function zq(r){return typeof r=="string"&&Ei.STYLE_SOURCE_VALUES.includes(r)}a(zq,"isStyleSource")});var MD=T(Zu=>{"use strict";Object.defineProperty(Zu,"__esModule",{value:!0});Zu.isCommandFrontmatter=Kq;Zu.isPreconditionFrontmatter=Hq;Zu.isGroundingFrontmatter=Yq;Zu.isCommandBindingFrontmatter=Xq;function Kq(r){return my(r,"exocmd__Command")}a(Kq,"isCommandFrontmatter");function Hq(r){return my(r,"exocmd__Precondition")}a(Hq,"isPreconditionFrontmatter");function Yq(r){return my(r,"exocmd__Grounding")}a(Yq,"isGroundingFrontmatter");function Xq(r){return my(r,"exocmd__CommandBinding")}a(Xq,"isCommandBindingFrontmatter");function my(r,e){let t=r.exo__Instance_class;if(t==null)return!1;let n=Array.isArray(t)?t:[t];for(let i of n){if(typeof i!="string")continue;let s=i.match(/\[\[([^|\]]+)/);if((s?s[1]:i)===e)return!0}return!1}a(my,"hasInstanceClass")});var $D=T(Bv=>{"use strict";Object.defineProperty(Bv,"__esModule",{value:!0});Bv.parseGroundingDefinitionFromFrontmatter=Jq;var Qq=qp();function gy(r){if(typeof r!="string")return"";let e=r.replace(/["'[\]]/g,"").trim(),t=e.indexOf("|");return t>=0?e.slice(0,t).trim():e}a(gy,"normalizeGroundingRef");function Jq(r,e,t){let n=e.exocmd__Grounding_type,i=(()=>{if(typeof n!="string")return n;let w=(0,Qq.resolveGroundingTypeFromWikilinkLiteral)(n);if(w!==null)return w;throw new Error(`[exocmd-grounding-type-literal-form] legacy literal-string '${n}' for exocmd__Grounding_type in fixture ${r}. Migrate to wikilink form per RFC 9d20c91f Phase 3.`)})(),s=i==="service_call"?e.exocmd__Grounding_serviceId??e.exocmd__Grounding_targetProperty:e.exocmd__Grounding_targetProperty,o;if(i==="composite"){let w=e.exocmd__Grounding_steps;Array.isArray(w)&&(o=w.map(R=>t(gy(R))))}let c=e.exocmd__Grounding_incrementBy,l;if(c!=null&&c!==""){let w=Number.parseInt(String(c),10);Number.isFinite(w)&&(l=w)}let u=e.exocmd__Grounding_targetValueRef,f=u?gy(u):void 0,d=e.exocmd__Grounding_templateRef,p=d?gy(d):void 0,h=e.exocmd__Grounding_cloneTargetBody,g=h===!0||h==="true",m=e.exocmd__Grounding_targetsCreatedInstance,b=m===!0||m==="true",S=e.exocmd__Grounding_omitLabel,_=S===!0||S==="true",A=e.exocmd__Grounding_targetQuery,E=A?gy(A):void 0;return{id:r,label:e.exo__Asset_label??"",type:i,targetProperty:s,targetValueRef:f,targetValueLiteral:e.exocmd__Grounding_targetValueLiteral,targetValueSubstitution:e.exocmd__Grounding_targetValueSubstitution,serviceCallPayload:e.exocmd__Grounding_serviceCallPayload,appendExpression:e.exocmd__Grounding_appendExpression,replaceFromExpression:e.exocmd__Grounding_replaceFromExpression,replaceToExpression:e.exocmd__Grounding_replaceToExpression,targetClass:e.exocmd__Grounding_targetClass,targetPrototype:e.exocmd__Grounding_targetPrototype,targetFolder:e.exocmd__Grounding_targetFolder,shiftDelta:e.exocmd__Grounding_shiftDelta,incrementBy:l,linkBackProperty:e.exocmd__Grounding_linkBackProperty,bodyTemplate:e.exocmd__Grounding_bodyTemplate,templateRef:p,cloneTargetBody:g,targetsCreatedInstance:b,omitLabel:_,targetQuery:E,steps:o}}a(Jq,"parseGroundingDefinitionFromFrontmatter")});var jD=T(yy=>{"use strict";Object.defineProperty(yy,"__esModule",{value:!0});yy.hasPosition=Zq;yy.isFixed=eW;function Zq(r){return typeof r.x=="number"&&typeof r.y=="number"}a(Zq,"hasPosition");function eW(r){return r.fx!==null&&r.fx!==void 0&&r.fy!==null&&r.fy!==void 0}a(eW,"isFixed")});var BD=T(by=>{"use strict";Object.defineProperty(by,"__esModule",{value:!0});by.createEmptyGraphData=tW;by.mergeGraphData=rW;function tW(){return{nodes:[],edges:[],lastUpdated:Date.now(),version:0}}a(tW,"createEmptyGraphData");function rW(r,e){let t=new Map,n=new Set,i=[];for(let s of r.nodes)t.set(s.id,s);for(let s of e.nodes)t.set(s.id,s);for(let s of r.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}for(let s of e.edges){let o=`${s.source}->${s.target}:${s.type}`;n.has(o)||(n.add(o),i.push(s))}return{nodes:Array.from(t.values()),edges:i,lastUpdated:Date.now(),version:Math.max(r.version??0,e.version??0)+1}}a(rW,"mergeGraphData")});var Uv=T(_y=>{"use strict";Object.defineProperty(_y,"__esModule",{value:!0});_y.createEdgeId=nW;_y.edgesEqual=iW;function nW(r,e,t,n){let i=n?`|${n}`:"";return`${r}->${e}:${t}${i}`}a(nW,"createEdgeId");function iW(r,e){return r.source===e.source&&r.target===e.target&&r.type===e.type&&r.predicate===e.predicate}a(iW,"edgesEqual")});var Vv=T(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.BUILT_IN_EDGE_STYLES=mr.BUILT_IN_NODE_STYLES=mr.DEFAULT_EDGE_STYLE=mr.DEFAULT_NODE_STYLE=mr.RDF_TYPE_PREDICATES=void 0;mr.mergeNodeStyles=sW;mr.mergeEdgeStyles=oW;mr.extractLocalName=aW;mr.isClassType=cW;mr.isTypePredicate=lW;mr.isSubClassPredicate=uW;mr.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"};mr.DEFAULT_NODE_STYLE={color:"#6366f1",borderColor:"#4f46e5",borderWidth:2,size:30,shape:"circle",icon:"",opacity:1,shadow:!1,animation:"none"};mr.DEFAULT_EDGE_STYLE={color:"#9ca3af",width:1,lineStyle:"solid",arrow:"standard",curvature:0,opacity:.6,showLabel:!1,labelPosition:.5};mr.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"},person__Person:{color:"#06b6d4",shape:"circle"},ims__Person:{color:"#06b6d4",shape:"circle"}};mr.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 sW(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(sW,"mergeNodeStyles");function oW(r,e){return{...r,...Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}}a(oW,"mergeEdgeStyles");function aW(r){let e=r.lastIndexOf("#"),t=r.lastIndexOf("/"),n=Math.max(e,t);return n>=0?r.substring(n+1):r}a(aW,"extractLocalName");function cW(r){return r===mr.RDF_TYPE_PREDICATES.RDFS_CLASS||r===mr.RDF_TYPE_PREDICATES.OWL_CLASS}a(cW,"isClassType");function lW(r){return r===mr.RDF_TYPE_PREDICATES.RDF_TYPE}a(lW,"isTypePredicate");function uW(r){return r===mr.RDF_TYPE_PREDICATES.RDFS_SUBCLASS_OF}a(uW,"isSubClassPredicate")});var VD=T(UD=>{"use strict";Object.defineProperty(UD,"__esModule",{value:!0})});var Le=T(Sy=>{"use strict";Object.defineProperty(Sy,"__esModule",{value:!0});Sy.IRI=void 0;var Gv=class r{static{a(this,"IRI")}constructor(e){let t=e.trim();if(t.length===0)throw new Error("IRI cannot be empty");if(!r.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 n=["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(!n.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)}}};Sy.IRI=Gv});var Ye=T(Tl=>{"use strict";Object.defineProperty(Tl,"__esModule",{value:!0});Tl.Literal=void 0;Tl.parseLanguageTag=GD;Tl.createDirectionalLiteral=dW;Tl.createLiteralFromLanguageTag=pW;var fW="http://www.w3.org/2001/XMLSchema#string",Wp=class{static{a(this,"Literal")}constructor(e,t,n,i){if(e.length===0)throw new Error("Literal value cannot be empty");if(t&&n)throw new Error("Literal cannot have both datatype and language tag");if(i&&!n)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=n?n.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(),n=e.normalizedDatatype();return t===n}normalizedDatatype(){return!this._datatype||this._datatype.value===fW?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}};Tl.Literal=Wp;function GD(r){let t=r.lastIndexOf("--");if(t===-1)return{language:r.toLowerCase()};let n=r.substring(t+2),i=r.substring(0,t);return n==="ltr"||n==="rtl"?{language:i.toLowerCase(),direction:n}:{language:r.toLowerCase()}}a(GD,"parseLanguageTag");function dW(r,e,t){return new Wp(r,void 0,e,t)}a(dW,"createDirectionalLiteral");function pW(r,e){let{language:t,direction:n}=GD(e);return new Wp(r,void 0,t,n)}a(pW,"createLiteralFromLanguageTag")});var cr=T(Ey=>{"use strict";Object.defineProperty(Ey,"__esModule",{value:!0});Ey.BlankNode=void 0;var wy=class r{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${++r.counter}`}static create(){return new r(r.generateId())}};Ey.BlankNode=wy;wy.counter=0});var Rt=T(vy=>{"use strict";Object.defineProperty(vy,"__esModule",{value:!0});vy.Namespace=void 0;var qD=Le(),Ke=class r{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 qD.IRI(t)}get prefix(){return this._prefix}get iri(){return this._iri}term(e){return new qD.IRI(`${this._iri.value}${e}`)}expand(e){let t=e.split(":");if(t.length!==2)return null;let[n,i]=t;return n!==this._prefix?null:this.term(i)}static isValidPrefix(e){return r.PREFIX_RE.test(e)}static forPrefix(e){if(!r.isValidPrefix(e))return null;let t=r.KNOWN_NAMESPACES.find(n=>n.prefix===e);return t||new r(e,`${r.EXOCORTEX_ONTOLOGY_BASE}${e}#`)}static fromPropertyKey(e){let t=r.PROPERTY_KEY_RE.exec(e);if(!t)return null;let n=r.forPrefix(t[1]);return n?{namespace:n,localName:t[2]}:null}static fromTermIRI(e){if(typeof e!="string"||e.length===0)return null;let t=a(l=>r.isCleanLocalName(l)?l:null,"cleanLocal");for(let l of r.KNOWN_NAMESPACES){let u=l.iri.value;if(e.startsWith(u)){let f=t(e.slice(u.length));return f===null?null:{namespace:l,localName:f}}}if(!e.startsWith(r.EXOCORTEX_ONTOLOGY_BASE))return null;let n=e.slice(r.EXOCORTEX_ONTOLOGY_BASE.length),i=n.indexOf("#");if(i<=0)return null;let s=n.slice(0,i);if(!r.isValidPrefix(s))return null;let o=t(n.slice(i+1));if(o===null)return null;let c=r.forPrefix(s);return c?{namespace:c,localName:o}:null}static isCleanLocalName(e){return e.length>0&&!e.includes("#")&&!e.includes("/")}static knownNamespaces(){return r.KNOWN_NAMESPACES}};vy.Namespace=Ke;Ke.RDF=new Ke("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");Ke.RDFS=new Ke("rdfs","http://www.w3.org/2000/01/rdf-schema#");Ke.OWL=new Ke("owl","http://www.w3.org/2002/07/owl#");Ke.XSD=new Ke("xsd","http://www.w3.org/2001/XMLSchema#");Ke.SHACL=new Ke("sh","http://www.w3.org/ns/shacl#");Ke.EXO=new Ke("exo","https://exocortex.my/ontology/exo#");Ke.EMS=new Ke("ems","https://exocortex.my/ontology/ems#");Ke.EXOCMD=new Ke("exocmd","https://exocortex.my/ontology/exocmd#");Ke.IMS=new Ke("ims","https://exocortex.my/ontology/ims#");Ke.ZTLK=new Ke("ztlk","https://exocortex.my/ontology/ztlk#");Ke.PTMS=new Ke("ptms","https://exocortex.my/ontology/ptms#");Ke.LIT=new Ke("lit","https://exocortex.my/ontology/lit#");Ke.INBOX=new Ke("inbox","https://exocortex.my/ontology/inbox#");Ke.PMBOK=new Ke("pmbok","https://exocortex.my/ontology/pmbok#");Ke.EXOCORTEX_ONTOLOGY_BASE="https://exocortex.my/ontology/";Ke.KNOWN_NAMESPACES=[Ke.EXO,Ke.EMS,Ke.EXOCMD,Ke.IMS,Ke.ZTLK,Ke.PTMS,Ke.LIT,Ke.INBOX,Ke.PMBOK,Ke.RDF,Ke.RDFS,Ke.OWL,Ke.XSD,Ke.SHACL];Ke.PREFIX_PATTERN_SOURCE="[a-z][a-zA-Z0-9]*(?:-[a-zA-Z0-9]+)*";Ke.PREFIX_RE=new RegExp(`^${Ke.PREFIX_PATTERN_SOURCE}$`);Ke.PROPERTY_KEY_RE=new RegExp(`^(${Ke.PREFIX_PATTERN_SOURCE})__(.+)$`)});var vi=T(Ty=>{"use strict";Object.defineProperty(Ty,"__esModule",{value:!0});Ty.Triple=void 0;var qv=Le(),Wv=Ye(),zv=cr(),Kv=class{static{a(this,"Triple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}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 qv.IRI&&t instanceof qv.IRI||e instanceof zv.BlankNode&&t instanceof zv.BlankNode||e instanceof Wv.Literal&&t instanceof Wv.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}>`,n=this.nodeToString(this._object);return`${e} ${t} ${n} .`}nodeToString(e){return e instanceof qv.IRI?`<${e.value}>`:e instanceof zv.BlankNode||e instanceof Wv.Literal||this.isQuotedTriple(e)?e.toString():""}};Ty.Triple=Kv});var zp=T(Ay=>{"use strict";Object.defineProperty(Ay,"__esModule",{value:!0});Ay.QuotedTriple=void 0;var Hv=Le(),Yv=Ye(),Xv=cr(),Qv=class r{static{a(this,"QuotedTriple")}constructor(e,t,n){this._subject=e,this._predicate=t,this._object=n}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 Hv.IRI&&t instanceof Hv.IRI||e instanceof Xv.BlankNode&&t instanceof Xv.BlankNode||e instanceof Yv.Literal&&t instanceof Yv.Literal||e instanceof r&&t instanceof r?e.equals(t):!1}get termType(){return"QuotedTriple"}toString(){let e=this.nodeToString(this._subject),t=`<${this._predicate.value}>`,n=this.nodeToString(this._object);return`<< ${e} ${t} ${n} >>`}nodeToString(e){return e instanceof Hv.IRI?`<${e.value}>`:e instanceof Xv.BlankNode||e instanceof Yv.Literal||e instanceof r?e.toString():""}};Ay.QuotedTriple=Qv});var WD=T(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.QuotedTriple=Dr.Triple=Dr.Namespace=Dr.BlankNode=Dr.createLiteralFromLanguageTag=Dr.createDirectionalLiteral=Dr.parseLanguageTag=Dr.Literal=Dr.IRI=void 0;var hW=Le();Object.defineProperty(Dr,"IRI",{enumerable:!0,get:a(function(){return hW.IRI},"get")});var Iy=Ye();Object.defineProperty(Dr,"Literal",{enumerable:!0,get:a(function(){return Iy.Literal},"get")});Object.defineProperty(Dr,"parseLanguageTag",{enumerable:!0,get:a(function(){return Iy.parseLanguageTag},"get")});Object.defineProperty(Dr,"createDirectionalLiteral",{enumerable:!0,get:a(function(){return Iy.createDirectionalLiteral},"get")});Object.defineProperty(Dr,"createLiteralFromLanguageTag",{enumerable:!0,get:a(function(){return Iy.createLiteralFromLanguageTag},"get")});var mW=cr();Object.defineProperty(Dr,"BlankNode",{enumerable:!0,get:a(function(){return mW.BlankNode},"get")});var gW=Rt();Object.defineProperty(Dr,"Namespace",{enumerable:!0,get:a(function(){return gW.Namespace},"get")});var yW=vi();Object.defineProperty(Dr,"Triple",{enumerable:!0,get:a(function(){return yW.Triple},"get")});var bW=zp();Object.defineProperty(Dr,"QuotedTriple",{enumerable:!0,get:a(function(){return bW.QuotedTriple},"get")})});var Ry=T(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.UUID_URL_NAMESPACE=is.DEFAULT_LANGUAGE_TAG=is.REQUIRED_PROPERTIES=is.ALLOWED_PROPERTIES=is.Exo003MetadataType=void 0;var ns;(function(r){r.Namespace="namespace",r.Anchor="anchor",r.BlankNode="blank_node",r.Statement="statement",r.Body="body"})(ns||(is.Exo003MetadataType=ns={}));is.ALLOWED_PROPERTIES={[ns.Namespace]:["metadata","uri","aliases"],[ns.Anchor]:["metadata","uri","aliases"],[ns.BlankNode]:["metadata","uri","aliases"],[ns.Statement]:["metadata","subject","predicate","object","aliases"],[ns.Body]:["metadata","subject","predicate","aliases"]};is.REQUIRED_PROPERTIES={[ns.Namespace]:["metadata","uri"],[ns.Anchor]:["metadata","uri"],[ns.BlankNode]:["metadata","uri"],[ns.Statement]:["metadata","subject","predicate","object"],[ns.Body]:["metadata","subject","predicate"]};is.DEFAULT_LANGUAGE_TAG="ru";is.UUID_URL_NAMESPACE="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var zD=T(Jv=>{"use strict";Object.defineProperty(Jv,"__esModule",{value:!0});Jv.default="ffffffff-ffff-ffff-ffff-ffffffffffff"});var KD=T(Zv=>{"use strict";Object.defineProperty(Zv,"__esModule",{value:!0});Zv.default="00000000-0000-0000-0000-000000000000"});var HD=T(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.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 Kp=T(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});var _W=HD();function SW(r){return typeof r=="string"&&_W.default.test(r)}a(SW,"validate");tT.default=SW});var Hp=T(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});var wW=Kp();function EW(r){if(!(0,wW.default)(r))throw TypeError("Invalid UUID");let e;return Uint8Array.of((e=parseInt(r.slice(0,8),16))>>>24,e>>>16&255,e>>>8&255,e&255,(e=parseInt(r.slice(9,13),16))>>>8,e&255,(e=parseInt(r.slice(14,18),16))>>>8,e&255,(e=parseInt(r.slice(19,23),16))>>>8,e&255,(e=parseInt(r.slice(24,36),16))/1099511627776&255,e/4294967296&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255)}a(EW,"parse");rT.default=EW});var aa=T(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});Yp.unsafeStringify=void 0;var vW=Kp(),gn=[];for(let r=0;r<256;++r)gn.push((r+256).toString(16).slice(1));function YD(r,e=0){return(gn[r[e+0]]+gn[r[e+1]]+gn[r[e+2]]+gn[r[e+3]]+"-"+gn[r[e+4]]+gn[r[e+5]]+"-"+gn[r[e+6]]+gn[r[e+7]]+"-"+gn[r[e+8]]+gn[r[e+9]]+"-"+gn[r[e+10]]+gn[r[e+11]]+gn[r[e+12]]+gn[r[e+13]]+gn[r[e+14]]+gn[r[e+15]]).toLowerCase()}a(YD,"unsafeStringify");Yp.unsafeStringify=YD;function TW(r,e=0){let t=YD(r,e);if(!(0,vW.default)(t))throw TypeError("Stringified UUID is invalid");return t}a(TW,"stringify");Yp.default=TW});var xy=T(nT=>{"use strict";Object.defineProperty(nT,"__esModule",{value:!0});var AW=require("crypto"),Oy=new Uint8Array(256),Cy=Oy.length;function IW(){return Cy>Oy.length-16&&((0,AW.randomFillSync)(Oy),Cy=0),Oy.slice(Cy,Cy+=16)}a(IW,"rng");nT.default=IW});var iT=T(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.updateV1State=void 0;var XD=xy(),RW=aa(),Xp={};function CW(r,e,t){let n,i=r?._v6??!1;if(r){let s=Object.keys(r);s.length===1&&s[0]==="_v6"&&(r=void 0)}if(r)n=QD(r.random??r.rng?.()??(0,XD.default)(),r.msecs,r.nsecs,r.clockseq,r.node,e,t);else{let s=Date.now(),o=(0,XD.default)();JD(Xp,s,o),n=QD(o,Xp.msecs,Xp.nsecs,i?void 0:Xp.clockseq,i?void 0:Xp.node,e,t)}return e??(0,RW.unsafeStringify)(n)}a(CW,"v1");function JD(r,e,t){return r.msecs??=-1/0,r.nsecs??=0,e===r.msecs?(r.nsecs++,r.nsecs>=1e4&&(r.node=void 0,r.nsecs=0)):e>r.msecs?r.nsecs=0:e<r.msecs&&(r.node=void 0),r.node||(r.node=t.slice(10,16),r.node[0]|=1,r.clockseq=(t[8]<<8|t[9])&16383),r.msecs=e,r}a(JD,"updateV1State");Qp.updateV1State=JD;function QD(r,e,t,n,i,s,o=0){if(r.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,n??=(r[8]<<8|r[9])&16383,i??=r.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++]=n>>>8|128,s[o++]=n&255;for(let u=0;u<6;++u)s[o++]=i[u];return s}a(QD,"v1Bytes");Qp.default=CW});var oT=T(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});var OW=Hp(),xW=aa();function PW(r){let e=typeof r=="string"?(0,OW.default)(r):r,t=FW(e);return typeof r=="string"?(0,xW.unsafeStringify)(t):t}a(PW,"v1ToV6");sT.default=PW;function FW(r){return Uint8Array.of((r[6]&15)<<4|r[7]>>4&15,(r[7]&15)<<4|(r[4]&240)>>4,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,(r[1]&15)<<4|(r[2]&240)>>4,96|r[2]&15,r[3],r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(FW,"_v1ToV6")});var ZD=T(aT=>{"use strict";Object.defineProperty(aT,"__esModule",{value:!0});var DW=require("crypto");function LW(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,DW.createHash)("md5").update(r).digest()}a(LW,"md5");aT.default=LW});var Jp=T(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.URL=ca.DNS=ca.stringToBytes=void 0;var eL=Hp(),NW=aa();function tL(r){r=unescape(encodeURIComponent(r));let e=new Uint8Array(r.length);for(let t=0;t<r.length;++t)e[t]=r.charCodeAt(t);return e}a(tL,"stringToBytes");ca.stringToBytes=tL;ca.DNS="6ba7b810-9dad-11d1-80b4-00c04fd430c8";ca.URL="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function kW(r,e,t,n,i,s){let o=typeof t=="string"?tL(t):t,c=typeof n=="string"?(0,eL.default)(n):n;if(typeof n=="string"&&(n=(0,eL.default)(n)),n?.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|r,l[8]=l[8]&63|128,i){if(s=s||0,s<0||s+16>i.length)throw new RangeError(`UUID byte range ${s}:${s+15} is out of buffer bounds`);for(let u=0;u<16;++u)i[s+u]=l[u];return i}return(0,NW.unsafeStringify)(l)}a(kW,"v35");ca.default=kW});var nL=T(Al=>{"use strict";Object.defineProperty(Al,"__esModule",{value:!0});Al.URL=Al.DNS=void 0;var MW=ZD(),cT=Jp(),rL=Jp();Object.defineProperty(Al,"DNS",{enumerable:!0,get:a(function(){return rL.DNS},"get")});Object.defineProperty(Al,"URL",{enumerable:!0,get:a(function(){return rL.URL},"get")});function lT(r,e,t,n){return(0,cT.default)(48,MW.default,r,e,t,n)}a(lT,"v3");lT.DNS=cT.DNS;lT.URL=cT.URL;Al.default=lT});var iL=T(uT=>{"use strict";Object.defineProperty(uT,"__esModule",{value:!0});var $W=require("crypto");uT.default={randomUUID:$W.randomUUID}});var oL=T(fT=>{"use strict";Object.defineProperty(fT,"__esModule",{value:!0});var sL=iL(),jW=xy(),BW=aa();function UW(r,e,t){if(sL.default.randomUUID&&!e&&!r)return sL.default.randomUUID();r=r||{};let n=r.random??r.rng?.()??(0,jW.default)();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[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]=n[i];return e}return(0,BW.unsafeStringify)(n)}a(UW,"v4");fT.default=UW});var aL=T(dT=>{"use strict";Object.defineProperty(dT,"__esModule",{value:!0});var VW=require("crypto");function GW(r){return Array.isArray(r)?r=Buffer.from(r):typeof r=="string"&&(r=Buffer.from(r,"utf8")),(0,VW.createHash)("sha1").update(r).digest()}a(GW,"sha1");dT.default=GW});var lL=T(Il=>{"use strict";Object.defineProperty(Il,"__esModule",{value:!0});Il.URL=Il.DNS=void 0;var qW=aL(),pT=Jp(),cL=Jp();Object.defineProperty(Il,"DNS",{enumerable:!0,get:a(function(){return cL.DNS},"get")});Object.defineProperty(Il,"URL",{enumerable:!0,get:a(function(){return cL.URL},"get")});function hT(r,e,t,n){return(0,pT.default)(80,qW.default,r,e,t,n)}a(hT,"v5");hT.DNS=pT.DNS;hT.URL=pT.URL;Il.default=hT});var uL=T(mT=>{"use strict";Object.defineProperty(mT,"__esModule",{value:!0});var WW=aa(),zW=iT(),KW=oT();function HW(r,e,t){r??={},t??=0;let n=(0,zW.default)({...r,_v6:!0},new Uint8Array(16));if(n=(0,KW.default)(n),e){if(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]=n[i];return e}return(0,WW.unsafeStringify)(n)}a(HW,"v6");mT.default=HW});var fL=T(gT=>{"use strict";Object.defineProperty(gT,"__esModule",{value:!0});var YW=Hp(),XW=aa();function QW(r){let e=typeof r=="string"?(0,YW.default)(r):r,t=JW(e);return typeof r=="string"?(0,XW.unsafeStringify)(t):t}a(QW,"v6ToV1");gT.default=QW;function JW(r){return Uint8Array.of((r[3]&15)<<4|r[4]>>4&15,(r[4]&15)<<4|(r[5]&240)>>4,(r[5]&15)<<4|r[6]&15,r[7],(r[1]&15)<<4|(r[2]&240)>>4,(r[2]&15)<<4|(r[3]&240)>>4,16|(r[0]&240)>>4,(r[0]&15)<<4|(r[1]&240)>>4,r[8],r[9],r[10],r[11],r[12],r[13],r[14],r[15])}a(JW,"_v6ToV1")});var mL=T(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.updateV7State=void 0;var dL=xy(),ZW=aa(),yT={};function ez(r,e,t){let n;if(r)n=pL(r.random??r.rng?.()??(0,dL.default)(),r.msecs,r.seq,e,t);else{let i=Date.now(),s=(0,dL.default)();hL(yT,i,s),n=pL(s,yT.msecs,yT.seq,e,t)}return e??(0,ZW.unsafeStringify)(n)}a(ez,"v7");function hL(r,e,t){return r.msecs??=-1/0,r.seq??=0,e>r.msecs?(r.seq=t[6]<<23|t[7]<<16|t[8]<<8|t[9],r.msecs=e):(r.seq=r.seq+1|0,r.seq===0&&r.msecs++),r}a(hL,"updateV7State");Zp.updateV7State=hL;function pL(r,e,t,n,i=0){if(r.length<16)throw new Error("Random bytes length must be >= 16");if(!n)n=new Uint8Array(16),i=0;else if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return e??=Date.now(),t??=r[6]*127<<24|r[7]<<16|r[8]<<8|r[9],n[i++]=e/1099511627776&255,n[i++]=e/4294967296&255,n[i++]=e/16777216&255,n[i++]=e/65536&255,n[i++]=e/256&255,n[i++]=e&255,n[i++]=112|t>>>28&15,n[i++]=t>>>20&255,n[i++]=128|t>>>14&63,n[i++]=t>>>6&255,n[i++]=t<<2&255|r[10]&3,n[i++]=r[11],n[i++]=r[12],n[i++]=r[13],n[i++]=r[14],n[i++]=r[15],n}a(pL,"v7Bytes");Zp.default=ez});var gL=T(bT=>{"use strict";Object.defineProperty(bT,"__esModule",{value:!0});var tz=Kp();function rz(r){if(!(0,tz.default)(r))throw TypeError("Invalid UUID");return parseInt(r.slice(14,15),16)}a(rz,"version");bT.default=rz});var ef=T(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.version=Pt.validate=Pt.v7=Pt.v6ToV1=Pt.v6=Pt.v5=Pt.v4=Pt.v3=Pt.v1ToV6=Pt.v1=Pt.stringify=Pt.parse=Pt.NIL=Pt.MAX=void 0;var nz=zD();Object.defineProperty(Pt,"MAX",{enumerable:!0,get:a(function(){return nz.default},"get")});var iz=KD();Object.defineProperty(Pt,"NIL",{enumerable:!0,get:a(function(){return iz.default},"get")});var sz=Hp();Object.defineProperty(Pt,"parse",{enumerable:!0,get:a(function(){return sz.default},"get")});var oz=aa();Object.defineProperty(Pt,"stringify",{enumerable:!0,get:a(function(){return oz.default},"get")});var az=iT();Object.defineProperty(Pt,"v1",{enumerable:!0,get:a(function(){return az.default},"get")});var cz=oT();Object.defineProperty(Pt,"v1ToV6",{enumerable:!0,get:a(function(){return cz.default},"get")});var lz=nL();Object.defineProperty(Pt,"v3",{enumerable:!0,get:a(function(){return lz.default},"get")});var uz=oL();Object.defineProperty(Pt,"v4",{enumerable:!0,get:a(function(){return uz.default},"get")});var fz=lL();Object.defineProperty(Pt,"v5",{enumerable:!0,get:a(function(){return fz.default},"get")});var dz=uL();Object.defineProperty(Pt,"v6",{enumerable:!0,get:a(function(){return dz.default},"get")});var pz=fL();Object.defineProperty(Pt,"v6ToV1",{enumerable:!0,get:a(function(){return pz.default},"get")});var hz=mL();Object.defineProperty(Pt,"v7",{enumerable:!0,get:a(function(){return hz.default},"get")});var mz=Kp();Object.defineProperty(Pt,"validate",{enumerable:!0,get:a(function(){return mz.default},"get")});var gz=gL();Object.defineProperty(Pt,"version",{enumerable:!0,get:a(function(){return gz.default},"get")})});var wT=T(Py=>{"use strict";Object.defineProperty(Py,"__esModule",{value:!0});Py.Exo003UUIDGenerator=void 0;var _T=ef(),yL=Ry(),ST=class{static{a(this,"Exo003UUIDGenerator")}static generateNamespaceUUID(e){if(!e||e.trim().length===0)throw new Error("Namespace URI cannot be empty");return(0,_T.v5)(e,yL.UUID_URL_NAMESPACE)}static generateAssetUUID(e,t){if(!t||t.trim().length===0)throw new Error("Local identifier cannot be empty");let n=this.generateNamespaceUUID(e);return(0,_T.v5)(t,n)}static generateFromIRI(e){if(!e||e.trim().length===0)throw new Error("IRI cannot be empty");let{namespace:t,localName:n}=this.splitIRI(e);return n?this.generateAssetUUID(t,n):(0,_T.v5)(e,yL.UUID_URL_NAMESPACE)}static generateBlankNodeUUID(e,t){if(!e||e.trim().length===0)throw new Error("Blank node ID cannot be empty");let n="urn:exocortex:blank-node:",i=t?`${t}#${e}`:e;return this.generateAssetUUID(n,i)}static generateStatementUUID(e,t,n){if(!e||!t||!n)throw new Error("Subject, predicate, and object cannot be empty");let i="urn:exocortex:statement:",s=`${e} ${t} ${n}`;return this.generateAssetUUID(i,s)}static generateBodyUUID(e,t){let n="urn:exocortex:body:",i=e;return t?.datatype?i+=`^^${t.datatype}`:t?.language&&(i+=`@${t.language}`,t.direction&&(i+=`--${t.direction}`)),this.generateAssetUUID(n,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 n=e.lastIndexOf("/"),i=e.indexOf("://");return n!==-1&&n>i+2&&n<e.length-1?{namespace:e.substring(0,n+1),localName:e.substring(n+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)}};Py.Exo003UUIDGenerator=ST});var _L=T(Dy=>{"use strict";Object.defineProperty(Dy,"__esModule",{value:!0});Dy.Exo003Parser=void 0;var Ut=Ry(),eh=wT(),pc=Le(),Fy=Ye(),bL=cr(),yz=vi(),ET=class{static{a(this,"Exo003Parser")}static parse(e,t){let n=this.validate(e);if(!n.valid)return{success:!1,errors:n.errors};let i=e.metadata;try{return{success:!0,metadata:this.parseByType(e,i),bodyContent:i===Ut.Exo003MetadataType.Body?t:void 0}}catch(s){return{success:!1,errors:[s instanceof Error?s.message:String(s)]}}}static validate(e){let t=[],n=[];if(!e.metadata)return t.push("Missing required property: metadata"),{valid:!1,errors:t,warnings:n};let i=e.metadata;if(!Object.values(Ut.Exo003MetadataType).includes(i))return t.push(`Invalid metadata: ${i}. Valid types: ${Object.values(Ut.Exo003MetadataType).join(", ")}`),{valid:!1,errors:t,warnings:n};let s=i,o=Ut.ALLOWED_PROPERTIES[s],c=Ut.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 Ut.Exo003MetadataType.Namespace:this.validateNamespaceMetadata(e,t);break;case Ut.Exo003MetadataType.Anchor:this.validateAnchorMetadata(e,t);break;case Ut.Exo003MetadataType.BlankNode:this.validateBlankNodeMetadata(e,t);break;case Ut.Exo003MetadataType.Statement:this.validateStatementMetadata(e,t);break;case Ut.Exo003MetadataType.Body:this.validateBodyMetadata(e,t,n);break}return{valid:t.length===0,errors:t,warnings:n}}static parseByType(e,t){let n={metadata:t,aliases:e.aliases};switch(t){case Ut.Exo003MetadataType.Namespace:return{...n,metadata:Ut.Exo003MetadataType.Namespace,uri:e.uri};case Ut.Exo003MetadataType.Anchor:return{...n,metadata:Ut.Exo003MetadataType.Anchor,uri:e.uri};case Ut.Exo003MetadataType.BlankNode:return{...n,metadata:Ut.Exo003MetadataType.BlankNode,uri:e.uri};case Ut.Exo003MetadataType.Statement:return{...n,metadata:Ut.Exo003MetadataType.Statement,subject:e.subject,predicate:e.predicate,object:e.object};case Ut.Exo003MetadataType.Body:return{...n,metadata:Ut.Exo003MetadataType.Body,subject:e.subject,predicate:e.predicate}}}static validateNamespaceMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pc.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateAnchorMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n)try{new pc.IRI(n)}catch{t.push(`uri is not a valid IRI: ${String(n)}`)}}static validateBlankNodeMetadata(e,t){let n=e.uri;if(n&&typeof n!="string")t.push("uri must be a string");else if(n){let i=n;if(!i.startsWith("_:"))try{new pc.IRI(i)}catch{t.push(`uri is not a valid IRI or blank node identifier: ${String(n)}`)}}}static validateStatementMetadata(e,t){let n=e.subject,i=e.predicate,s=e.object,o=[["subject",n],["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,n){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,n){let i=t(e.subject),s;if(i.type==="iri")s=new pc.IRI(i.value);else if(i.type==="blank")s=new bL.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 pc.IRI(o.value),l=t(e.object),u;if(l.type==="iri")u=new pc.IRI(l.value);else if(l.type==="blank")u=new bL.BlankNode(l.value);else{let f=n||l.value;if(l.datatype)u=new Fy.Literal(f,new pc.IRI(l.datatype));else{let d=l.language||Ut.DEFAULT_LANGUAGE_TAG;u=(0,Fy.createDirectionalLiteral)(f,d,l.direction)}}return new yz.Triple(s,c,u)}static toLiteral(e,t,n){if(n?.datatype)return new Fy.Literal(t,new pc.IRI(n.datatype));let i=n?.language||Ut.DEFAULT_LANGUAGE_TAG;return(0,Fy.createDirectionalLiteral)(t,i,n?.direction)}static isExo003Format(e){let t=e.metadata;return typeof t=="string"&&Object.values(Ut.Exo003MetadataType).includes(t)}static generateUUID(e,t){switch(e.metadata){case Ut.Exo003MetadataType.Namespace:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.Anchor:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.BlankNode:return eh.Exo003UUIDGenerator.generateNamespaceUUID(e.uri);case Ut.Exo003MetadataType.Statement:{let n=e;return eh.Exo003UUIDGenerator.generateStatementUUID(n.subject,n.predicate,n.object)}case Ut.Exo003MetadataType.Body:{let n=e;return eh.Exo003UUIDGenerator.generateBodyUUID(n.subject+"|"+n.predicate)}}}};Dy.Exo003Parser=ET});var vT=T(Nn=>{"use strict";Object.defineProperty(Nn,"__esModule",{value:!0});Nn.Exo003Parser=Nn.Exo003UUIDGenerator=Nn.UUID_URL_NAMESPACE=Nn.DEFAULT_LANGUAGE_TAG=Nn.REQUIRED_PROPERTIES=Nn.ALLOWED_PROPERTIES=Nn.Exo003MetadataType=void 0;var th=Ry();Object.defineProperty(Nn,"Exo003MetadataType",{enumerable:!0,get:a(function(){return th.Exo003MetadataType},"get")});Object.defineProperty(Nn,"ALLOWED_PROPERTIES",{enumerable:!0,get:a(function(){return th.ALLOWED_PROPERTIES},"get")});Object.defineProperty(Nn,"REQUIRED_PROPERTIES",{enumerable:!0,get:a(function(){return th.REQUIRED_PROPERTIES},"get")});Object.defineProperty(Nn,"DEFAULT_LANGUAGE_TAG",{enumerable:!0,get:a(function(){return th.DEFAULT_LANGUAGE_TAG},"get")});Object.defineProperty(Nn,"UUID_URL_NAMESPACE",{enumerable:!0,get:a(function(){return th.UUID_URL_NAMESPACE},"get")});var bz=wT();Object.defineProperty(Nn,"Exo003UUIDGenerator",{enumerable:!0,get:a(function(){return bz.Exo003UUIDGenerator},"get")});var _z=_L();Object.defineProperty(Nn,"Exo003Parser",{enumerable:!0,get:a(function(){return _z.Exo003Parser},"get")})});var mo=T(Ly=>{"use strict";Object.defineProperty(Ly,"__esModule",{value:!0});Ly.WikiLinkHelpers=void 0;var rh=class{static{a(this,"WikiLinkHelpers")}static normalize(e){if(!e)return"";let t=e.replace(this.WIKI_LINK_PATTERN,"").trim();if(!t)return"";let n=t.indexOf("|");if(n===-1)return t;let i=t.substring(0,n).trim(),s=t.substring(n+1).trim();return this.UUID_PATTERN.test(i)&&s||i}static normalizeArray(e){return e?(Array.isArray(e)?e:[e]).map(n=>this.normalize(n)).filter(n=>n.length>0):[]}static equals(e,t){return this.normalize(e)===this.normalize(t)}static includes(e,t){let n=this.normalizeArray(e),i=this.normalize(t);return n.includes(i)}static resolveSymbolic(e,t){let n=this.normalize(e);if(!n)return"";if(this.UUID_PATTERN.test(n)){let i=t(n);return i&&i.length>0?i:n}return n}static resolveSymbolicArray(e,t){return e?(Array.isArray(e)?e:[e]).map(i=>this.resolveSymbolic(i,t)).filter(i=>i.length>0):[]}};Ly.WikiLinkHelpers=rh;rh.WIKI_LINK_PATTERN=/\[\[|\]\]/g;rh.UUID_PATTERN=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});var ky=T(dt=>{"use strict";Object.defineProperty(dt,"__esModule",{value:!0});dt.CommandBindingProperty=dt.GroundingProperty=dt.PreconditionProperty=dt.CommandProperty=dt.resolveGroundingTypeFromWikilinkLiteral=dt.resolveGroundingTypeFromIRI=dt.GROUNDING_TYPE_IRI_TO_ENUM=dt.GROUNDING_TYPE_UID_TO_ENUM=dt.GROUNDING_TYPE_UIDS=dt.GroundingType=dt.EFFORT_STATUS_OPTIONS=dt.normalizeEffortStatus=dt.EFFORT_STATUS_BY_UID=dt.EFFORT_STATUS_UID=dt.EffortStatus=dt.AssetClass=void 0;var Sz=El();Object.defineProperty(dt,"AssetClass",{enumerable:!0,get:a(function(){return Sz.AssetClass},"get")});var wz=vl();Object.defineProperty(dt,"EffortStatus",{enumerable:!0,get:a(function(){return wz.EffortStatus},"get")});var TT=Ju();Object.defineProperty(dt,"EFFORT_STATUS_UID",{enumerable:!0,get:a(function(){return TT.EFFORT_STATUS_UID},"get")});Object.defineProperty(dt,"EFFORT_STATUS_BY_UID",{enumerable:!0,get:a(function(){return TT.EFFORT_STATUS_BY_UID},"get")});Object.defineProperty(dt,"normalizeEffortStatus",{enumerable:!0,get:a(function(){return TT.normalizeEffortStatus},"get")});var Ez=Mv();Object.defineProperty(dt,"EFFORT_STATUS_OPTIONS",{enumerable:!0,get:a(function(){return Ez.EFFORT_STATUS_OPTIONS},"get")});var vz=dc();Object.defineProperty(dt,"GroundingType",{enumerable:!0,get:a(function(){return vz.GroundingType},"get")});var nh=qp();Object.defineProperty(dt,"GROUNDING_TYPE_UIDS",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_UIDS},"get")});Object.defineProperty(dt,"GROUNDING_TYPE_UID_TO_ENUM",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_UID_TO_ENUM},"get")});Object.defineProperty(dt,"GROUNDING_TYPE_IRI_TO_ENUM",{enumerable:!0,get:a(function(){return nh.GROUNDING_TYPE_IRI_TO_ENUM},"get")});Object.defineProperty(dt,"resolveGroundingTypeFromIRI",{enumerable:!0,get:a(function(){return nh.resolveGroundingTypeFromIRI},"get")});Object.defineProperty(dt,"resolveGroundingTypeFromWikilinkLiteral",{enumerable:!0,get:a(function(){return nh.resolveGroundingTypeFromWikilinkLiteral},"get")});var Ny=$v();Object.defineProperty(dt,"CommandProperty",{enumerable:!0,get:a(function(){return Ny.CommandProperty},"get")});Object.defineProperty(dt,"PreconditionProperty",{enumerable:!0,get:a(function(){return Ny.PreconditionProperty},"get")});Object.defineProperty(dt,"GroundingProperty",{enumerable:!0,get:a(function(){return Ny.GroundingProperty},"get")});Object.defineProperty(dt,"CommandBindingProperty",{enumerable:!0,get:a(function(){return Ny.CommandBindingProperty},"get")})});var vL=T(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.hasClass=Cl;kn.isAreaOrProject=Tz;kn.isEffort=Az;kn.hasStatus=Iz;kn.isAssetArchived=Rz;kn.hasEmptyProperties=Cz;kn.needsFolderRepair=Oz;kn.getTodayDateString=AT;kn.isPlannedForToday=xz;kn.hasPlannedStartTimestamp=Pz;kn.extractDailyNoteDate=Fz;kn.isCurrentDateGteDay=Dz;kn.inheritsFromPrototype=EL;kn.isPrototypeClass=Nz;var wL=mo(),Rl=ky();function Cl(r,e){return r?(Array.isArray(r)?r:[r]).some(n=>wL.WikiLinkHelpers.normalize(n)===e):!1}a(Cl,"hasClass");function Tz(r){return Cl(r,Rl.AssetClass.AREA)||Cl(r,Rl.AssetClass.PROJECT)}a(Tz,"isAreaOrProject");function Az(r){return Cl(r,Rl.AssetClass.TASK)||Cl(r,Rl.AssetClass.PROJECT)||Cl(r,Rl.AssetClass.MEETING)}a(Az,"isEffort");function Iz(r,e){if(!r)return!1;let t=Array.isArray(r)?r[0]:r;return t?wL.WikiLinkHelpers.normalize(t)===e:!1}a(Iz,"hasStatus");function Rz(r){if(r===!0||r===1)return!0;if(typeof r=="string"){let e=r.toLowerCase();return e==="true"||e==="yes"}return!1}a(Rz,"isAssetArchived");function Cz(r){if(!r||Object.keys(r).length===0)return!1;let e=a(t=>t==null||t==="","isEmptyArrayItem");return Object.values(r).some(t=>t==null?!0:typeof t=="string"?t==="":Array.isArray(t)?t.length===0||t.every(e):typeof t=="object"&&Object.keys(t).length===0)}a(Cz,"hasEmptyProperties");function Oz(r,e){if(!e)return!1;let t=r.replace(/\/$/,""),n=e.replace(/\/$/,"");return t!==n}a(Oz,"needsFolderRepair");function AT(){let r=new Date,e=r.getFullYear(),t=String(r.getMonth()+1).padStart(2,"0"),n=String(r.getDate()).padStart(2,"0");return`${e}-${t}-${n}`}a(AT,"getTodayDateString");function xz(r){let e=r.ems__Effort_plannedStartTimestamp;if(!e)return!1;let t=AT();return typeof e=="string"?e.split("T")[0]===t:Array.isArray(e)&&e.length>0?String(e[0]).split("T")[0]===t:!1}a(xz,"isPlannedForToday");function Pz(r){let e=r.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(Pz,"hasPlannedStartTimestamp");function Fz(r){let e=r.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]),n=t.match(/\[\[([^\[\]]+)\]\]/);return n?n[1]:t}return null}a(Fz,"extractDailyNoteDate");function Dz(r){return AT()>=r}a(Dz,"isCurrentDateGteDay");function SL(r){return r?r.replace(/^["']|["']$/g,"").replace(/\[\[|\]\]/g,"").trim():""}a(SL,"normalizeWithQuotes");var Lz=10;function EL(r,e=Lz){let t=r.exo__Class_superClass;if(!t)return!1;let n=new Set,i=[],s=Array.isArray(t)?t:[t];for(let o of s){let c=SL(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===Rl.AssetClass.PROTOTYPE)return!0;if(n.has(c))continue;n.add(c);let u=`${c}__exo__Class_superClass`,f=r[u];if(f){let d=Array.isArray(f)?f:[f];for(let p of d){let h=SL(p);h&&!n.has(h)&&i.push({className:h,depth:l+1})}}}return!1}a(EL,"inheritsFromPrototype");function Nz(r,e){return Cl(r,Rl.AssetClass.CLASS)?EL(e):!1}a(Nz,"isPrototypeClass")});var TL=T(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.isPrototypeClass=Ft.inheritsFromPrototype=Ft.isCurrentDateGteDay=Ft.extractDailyNoteDate=Ft.hasPlannedStartTimestamp=Ft.isPlannedForToday=Ft.getTodayDateString=Ft.needsFolderRepair=Ft.hasEmptyProperties=Ft.isAssetArchived=Ft.hasStatus=Ft.isEffort=Ft.isAreaOrProject=Ft.hasClass=void 0;var Ti=vL();Object.defineProperty(Ft,"hasClass",{enumerable:!0,get:a(function(){return Ti.hasClass},"get")});Object.defineProperty(Ft,"isAreaOrProject",{enumerable:!0,get:a(function(){return Ti.isAreaOrProject},"get")});Object.defineProperty(Ft,"isEffort",{enumerable:!0,get:a(function(){return Ti.isEffort},"get")});Object.defineProperty(Ft,"hasStatus",{enumerable:!0,get:a(function(){return Ti.hasStatus},"get")});Object.defineProperty(Ft,"isAssetArchived",{enumerable:!0,get:a(function(){return Ti.isAssetArchived},"get")});Object.defineProperty(Ft,"hasEmptyProperties",{enumerable:!0,get:a(function(){return Ti.hasEmptyProperties},"get")});Object.defineProperty(Ft,"needsFolderRepair",{enumerable:!0,get:a(function(){return Ti.needsFolderRepair},"get")});Object.defineProperty(Ft,"getTodayDateString",{enumerable:!0,get:a(function(){return Ti.getTodayDateString},"get")});Object.defineProperty(Ft,"isPlannedForToday",{enumerable:!0,get:a(function(){return Ti.isPlannedForToday},"get")});Object.defineProperty(Ft,"hasPlannedStartTimestamp",{enumerable:!0,get:a(function(){return Ti.hasPlannedStartTimestamp},"get")});Object.defineProperty(Ft,"extractDailyNoteDate",{enumerable:!0,get:a(function(){return Ti.extractDailyNoteDate},"get")});Object.defineProperty(Ft,"isCurrentDateGteDay",{enumerable:!0,get:a(function(){return Ti.isCurrentDateGteDay},"get")});Object.defineProperty(Ft,"inheritsFromPrototype",{enumerable:!0,get:a(function(){return Ti.inheritsFromPrototype},"get")});Object.defineProperty(Ft,"isPrototypeClass",{enumerable:!0,get:a(function(){return Ti.isPrototypeClass},"get")})});var AL=T(Dt=>{"use strict";Object.defineProperty(Dt,"__esModule",{value:!0});Dt.TsFloorViolationError=Dt.CATALOG_KEEP_NAMESPACES=Dt.PLUGIN_UI_FLOOR=Dt.SDK_FLOOR=Dt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=Dt.SDK_FLOOR_ASSETSPACE_UIDS=Dt.TS_FLOOR_AS_UID_SHARED_IDENTITIES=Dt.TS_FLOOR_AS_UID_EXOCMD=Dt.TS_FLOOR_AS_UID_EXO=void 0;Dt.assertTsFloor=kz;Dt.assertTsFloorReconciled=Mz;Dt.isTsFloorAssetSpace=$z;Dt.isTsFloorMountPath=jz;Dt.TS_FLOOR_AS_UID_EXO="49fd2e56-4656-4ca7-a789-f472b16ea260";Dt.TS_FLOOR_AS_UID_EXOCMD="c9c65b0f-1e01-47c1-a1f9-1bf70b11df6a";Dt.TS_FLOOR_AS_UID_SHARED_IDENTITIES="0cde1557-6320-4bd0-a7c4-8b72afc38720";Dt.SDK_FLOOR_ASSETSPACE_UIDS=new Set([Dt.TS_FLOOR_AS_UID_EXO]);Dt.PLUGIN_UI_FLOOR_ASSETSPACE_UIDS=new Set([Dt.TS_FLOOR_AS_UID_EXO]);Dt.SDK_FLOOR=[{uid:Dt.TS_FLOOR_AS_UID_EXO,namespace:"exo"}];Dt.PLUGIN_UI_FLOOR=Dt.SDK_FLOOR;Dt.CATALOG_KEEP_NAMESPACES=new Set(["registry","profiles"]);var ih=class extends Error{static{a(this,"TsFloorViolationError")}constructor(e){super(e),this.name="TsFloorViolationError"}};Dt.TsFloorViolationError=ih;function kz(r,e){let t=[];for(let n of e)r.has(n)||t.push(n);if(t.length>0)throw new ih(`Target profile's declared set excludes TS-floor AssetSpace UID(s): ${t.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(kz,"assertTsFloor");function Mz(r,e,t){let n=[];for(let i of t)r.has(i.uid)||e.has(i.namespace)||n.push(`${i.namespace} (${i.uid})`);if(n.length>0)throw new ih(`Target profile's declared set excludes TS-floor AssetSpace(s): ${n.join(", ")}. Profile switch aborted to prevent runtime self-brick (R24).`)}a(Mz,"assertTsFloorReconciled");function $z(r,e,t=Dt.SDK_FLOOR){return t.some(n=>r.length>0&&n.uid===r||e.length>0&&n.namespace===e)}a($z,"isTsFloorAssetSpace");function jz(r,e=Dt.SDK_FLOOR){let t=r.replace(/\/+$/,""),n=t.slice(t.lastIndexOf("/")+1),i=n.startsWith("exoas-")?n.slice(6):n;return i.length===0?!1:e.some(s=>s.namespace===i)}a(jz,"isTsFloorMountPath")});var IL=T(IT=>{"use strict";Object.defineProperty(IT,"__esModule",{value:!0});IT.transitiveDependsOnClosure=Bz;function Bz(r,e){let t=new Set,n=[];for(let i of r)t.has(i)||(t.add(i),n.push(i));for(;n.length>0;){let i=n.shift();if(i===void 0)break;let s=e.get(i);if(s!==void 0)for(let o of s)t.has(o)||(t.add(o),n.push(o))}return t}a(Bz,"transitiveDependsOnClosure")});var RT=T(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.PARKED_ROOT=Ai.DEPENDENCY_KIND_REFERENCE_UID=Ai.DEPENDENCY_KIND_TBOX_UID=void 0;Ai.resolveDependencyKind=CL;Ai.parkedPathFor=Vz;Ai.classifyMountTransition=Gz;Ai.DEPENDENCY_KIND_TBOX_UID="e1d7fb5c-d334-448d-935b-953b7b033e78";Ai.DEPENDENCY_KIND_REFERENCE_UID="fe529085-5370-4ac0-bbe4-1c7351242dee";var Uz="dependencykindreference";function CL(r){let e=Array.isArray(r)?r[0]:r;if(typeof e!="string")return"tbox";let t=e.toLowerCase();return t.includes(Ai.DEPENDENCY_KIND_TBOX_UID)?"tbox":t.includes(Ai.DEPENDENCY_KIND_REFERENCE_UID)||t.includes(Uz)?"reference":"tbox"}a(CL,"resolveDependencyKind");Ai.PARKED_ROOT=".exocortex/parked";var RL="assetspaces/";function Vz(r){let e=r.split("/");if(r.length===0||!r.startsWith(RL)||e.some(t=>t.length===0||t==="."||t===".."))throw new Error(`parkedPathFor: refusing unsafe mount folder "${r}"`);return`${Ai.PARKED_ROOT}/${r.slice(RL.length)}`}a(Vz,"parkedPathFor");function Gz(r){let{state:e,inEffectiveSet:t,dependsOnKind:n,canPark:i=!0}=r;switch(e){case"active":return t?"none":i&&CL(n)==="reference"?"park":"destroy";case"parked":return t?"unpark":"none";case"absent":return t?"materialize":"none"}}a(Gz,"classifyMountTransition")});var PL=T(My=>{"use strict";Object.defineProperty(My,"__esModule",{value:!0});My.ParkedAssetIndex=void 0;var OL=RT();function qz(r){let t=r.replace(/^\[\[|\]\]$/g,"").replace(/^"|"$/g,"").trim().split("#")[0].trim();return(t.split("/").pop()??t).replace(/\.md$/i,"")}a(qz,"normalizeLinkTarget");function xL(r){let e=r.match(/^---\r?\n([\s\S]*?)\r?\n---/);return e===null?null:e[1]}a(xL,"frontmatterOf");function Wz(r){let e=xL(r);if(e===null)return!1;let t=e.match(/^exo__Asset_uid:[ \t]*(.+)$/m);return t!==null&&t[1].trim().length>0}a(Wz,"hasAssetUid");function zz(r){let e=xL(r);if(e===null)return null;let t=e.match(/^exo__Asset_label:[ \t]*(.+)$/m);if(t===null)return null;let n=t[1].trim();return n.length<1?null:n.length>=2&&n.startsWith('"')&&n.endsWith('"')?CT(n.slice(1,-1).replace(/\\(["\\ntr])/g,(i,s)=>s==="n"?`
32
32
  `:s==="t"?" ":s==="r"?"\r":s)):n.length>=2&&n.startsWith("'")&&n.endsWith("'")?CT(n.slice(1,-1).replace(/''/g,"'")):CT(n)}a(zz,"extractLabel");function CT(r){return r.length===0?null:r}a(CT,"orNull");var OT=class{static{a(this,"ParkedAssetIndex")}constructor(e){this.index=null,this.building=null,this.generation=0,this.reader=e}invalidate(){this.index=null,this.building=null,this.generation+=1}async lookup(e){let t=qz(e);if(t.length===0)return null;let i=(await this.ensureIndex()).get(t);if(i===void 0)return null;let s=Kz(i);if(s===null)return null;let o;try{o=await this.reader.read(i)}catch{return null}return Wz(o)?{path:i,assetSpace:s,label:zz(o)}:null}async ensureIndex(){if(this.index!==null)return this.index;let e=this.generation;this.building===null&&(this.building=this.buildIndex());let t=this.building,n=await t;return e!==this.generation?(this.building===t&&(this.building=null),this.ensureIndex()):(this.index=n,this.building===t&&(this.building=null),n)}async buildIndex(){let e=new Map;return await this.walk(OL.PARKED_ROOT,e),e}async walk(e,t){let n;try{if(!await this.reader.exists(e))return;n=await this.reader.list(e)}catch{return}for(let i of n.files){if(!i.toLowerCase().endsWith(".md"))continue;let s=(i.split("/").pop()??i).replace(/\.md$/i,"");s.length===0||t.has(s)||t.set(s,i)}for(let i of n.folders)(i.split("/").pop()??i).startsWith(".")||await this.walk(i,t)}};My.ParkedAssetIndex=OT;function Kz(r){let e=`${OL.PARKED_ROOT}/`;if(!r.startsWith(e))return null;let t=r.slice(e.length).split("/");if(t.length<3)return null;let[n,i]=t;return n.length===0||i.length===0?null:`${n}/${i}`}a(Kz,"assetSpaceOf")});var $y=T(sh=>{"use strict";Object.defineProperty(sh,"__esModule",{value:!0});sh.PropertyFieldType=void 0;sh.rangeToFieldType=Xz;var yn;(function(r){r.Text="text",r.Number="number",r.Date="date",r.DateTime="datetime",r.Boolean="boolean",r.Reference="reference",r.Enum="enum",r.StatusSelect="status-select",r.SizeSelect="size-select",r.Wikilink="wikilink",r.Timestamp="timestamp",r.Unknown="unknown"})(yn||(sh.PropertyFieldType=yn={}));var FL="http://www.w3.org/2001/XMLSchema#",Hz="https://exocortex.my/ontology/exo#",Yz="https://exocortex.my/ontology/ems#";function Xz(r){if(!r)return yn.Unknown;let e=r.trim();if(!e)return yn.Unknown;if(e.startsWith(FL)){let t=e.substring(FL.length);return xT(t)}if(e.startsWith("xsd:")){let t=e.substring(4);return xT(t)}if(e.includes("XMLSchema#")){let t=e.indexOf("XMLSchema#"),n=e.substring(t+10);return xT(n)}return e.startsWith(Yz)||e.startsWith("ems:")?Qz(e):e.startsWith(Hz)||e.startsWith("exo:")||Jz(e)?yn.Reference:yn.Text}a(Xz,"rangeToFieldType");function xT(r){switch(r.toLowerCase()){case"string":case"normalizedstring":case"token":case"language":case"nmtoken":case"name":case"ncname":case"anyuri":return yn.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 yn.Number;case"date":return yn.Date;case"datetime":case"datetimestamp":return yn.DateTime;case"boolean":return yn.Boolean;case"time":return yn.Timestamp;default:return yn.Text}}a(xT,"xsdTypeToFieldType");function Qz(r){let e=r.toLowerCase();return e.includes("effortstatus")?yn.StatusSelect:e.includes("tasksize")?yn.SizeSelect:yn.Reference}a(Qz,"emsTypeToFieldType");function Jz(r){let e=r.toLowerCase();return e.includes("exocortex.my/ontology")?!0:["asset","task","project","area","effort","class","property","concept"].some(n=>e.includes(n))}a(Jz,"isClassReference")});var PT=T(oh=>{"use strict";Object.defineProperty(oh,"__esModule",{value:!0});oh.propertyNameToUri=Zz;oh.uriToPropertyName=DL;oh.extractPropertyLabel=tK;var jy=Rt();function Zz(r){let e=jy.Namespace.fromPropertyKey(r);return e?`${e.namespace.prefix}:${e.localName}`:r}a(Zz,"propertyNameToUri");var eK=new RegExp(`^(${jy.Namespace.PREFIX_PATTERN_SOURCE}):`);function DL(r){if(r.startsWith("http://")||r.startsWith("https://")){let e=jy.Namespace.fromTermIRI(r);if(e)return`${e.namespace.prefix}__${e.localName}`;let t=r.lastIndexOf("#"),n=r.lastIndexOf("/"),i=Math.max(t,n);return i>=0?r.substring(i+1):r}return r.replace(eK,"$1__")}a(DL,"uriToPropertyName");function tK(r){let e=r.includes(":")?DL(r):r,t=jy.Namespace.fromPropertyKey(e),i=(t?t.localName:e).split("_");return(i.length>1?i.slice(1).join(" "):i[0]).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,o=>o.toUpperCase())}a(tK,"extractPropertyLabel")});var By={};Yu(By,{__assign:()=>DT,__asyncDelegator:()=>hK,__asyncGenerator:()=>pK,__asyncValues:()=>mK,__await:()=>ah,__awaiter:()=>aK,__classPrivateFieldGet:()=>_K,__classPrivateFieldSet:()=>SK,__createBinding:()=>lK,__decorate:()=>iK,__exportStar:()=>uK,__extends:()=>rK,__generator:()=>cK,__importDefault:()=>bK,__importStar:()=>yK,__makeTemplateObject:()=>gK,__metadata:()=>oK,__param:()=>sK,__read:()=>LL,__rest:()=>nK,__spread:()=>fK,__spreadArrays:()=>dK,__values:()=>LT});function rK(r,e){FT(r,e);function t(){this.constructor=r}a(t,"__"),r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function nK(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function iK(r,e,t,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,n);else for(var c=r.length-1;c>=0;c--)(o=r[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 sK(r,e){return function(t,n){e(t,n,r)}}function oK(r,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(r,e)}function aK(r,e,t,n){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(n.next(f))}catch(d){o(d)}}a(c,"fulfilled");function l(f){try{u(n.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((n=n.apply(r,e||[])).next())})}function cK(r,e){var t={label:0,sent:a(function(){if(s[0]&1)throw s[1];return s[1]},"sent"),trys:[],ops:[]},n,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(n)throw new TypeError("Generator is already executing.");for(;t;)try{if(n=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(r,t)}catch(f){u=[6,f],i=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function lK(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}function uK(r,e){for(var t in r)t!=="default"&&!e.hasOwnProperty(t)&&(e[t]=r[t])}function LT(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:a(function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function LL(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(c){o={error:c}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return s}function fK(){for(var r=[],e=0;e<arguments.length;e++)r=r.concat(LL(arguments[e]));return r}function dK(){for(var r=0,e=0,t=arguments.length;e<t;e++)r+=arguments[e].length;for(var n=Array(r),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,c=s.length;o<c;o++,i++)n[i]=s[o];return n}function ah(r){return this instanceof ah?(this.v=r,this):new ah(r)}function pK(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(p){n[p]&&(i[p]=function(h){return new Promise(function(g,m){s.push([p,h,g,m])>1||c(p,h)})})}function c(p,h){try{l(n[p](h))}catch(g){d(s[0][3],g)}}function l(p){p.value instanceof ah?Promise.resolve(p.value.v).then(u,f):d(s[0][2],p)}function u(p){c("next",p)}function f(p){c("throw",p)}function d(p,h){p(h),s.shift(),s.length&&c(s[0][0],s[0][1])}}function hK(r){var e,t;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=r[i]?function(o){return(t=!t)?{value:ah(r[i](o)),done:i==="return"}:s?s(o):o}:s}}function mK(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof LT=="function"?LT(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(s){t[s]=r[s]&&function(o){return new Promise(function(c,l){o=r[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 gK(r,e){return Object.defineProperty?Object.defineProperty(r,"raw",{value:e}):r.raw=e,r}function yK(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)Object.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e.default=r,e}function bK(r){return r&&r.__esModule?r:{default:r}}function _K(r,e){if(!e.has(r))throw new TypeError("attempted to get private field on non-instance");return e.get(r)}function SK(r,e,t){if(!e.has(r))throw new TypeError("attempted to set private field on non-instance");return e.set(r,t),t}var FT,DT,Uy=$e(()=>{FT=a(function(r,e){return FT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])},FT(r,e)},"extendStatics");a(rK,"__extends");DT=a(function(){return DT=Object.assign||a(function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},"__assign"),DT.apply(this,arguments)},"__assign");a(nK,"__rest");a(iK,"__decorate");a(sK,"__param");a(oK,"__metadata");a(aK,"__awaiter");a(cK,"__generator");a(lK,"__createBinding");a(uK,"__exportStar");a(LT,"__values");a(LL,"__read");a(fK,"__spread");a(dK,"__spreadArrays");a(ah,"__await");a(pK,"__asyncGenerator");a(hK,"__asyncDelegator");a(mK,"__asyncValues");a(gK,"__makeTemplateObject");a(yK,"__importStar");a(bK,"__importDefault");a(_K,"__classPrivateFieldGet");a(SK,"__classPrivateFieldSet")});var MT=T(kT=>{"use strict";Object.defineProperty(kT,"__esModule",{value:!0});var NT;(function(r){r[r.Transient=0]="Transient",r[r.Singleton=1]="Singleton",r[r.ResolutionScoped=2]="ResolutionScoped",r[r.ContainerScoped=3]="ContainerScoped"})(NT||(NT={}));kT.default=NT});var NL=T($T=>{"use strict";Object.defineProperty($T,"__esModule",{value:!0});var wK=MT();Object.defineProperty($T,"Lifecycle",{enumerable:!0,get:a(function(){return wK.default},"get")})});var Ol=T(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.defineInjectionTokenMetadata=Ss.getParamInfo=Ss.INJECTION_TOKEN_METADATA_KEY=void 0;Ss.INJECTION_TOKEN_METADATA_KEY="injectionTokens";function EK(r){let e=Reflect.getMetadata("design:paramtypes",r)||[],t=Reflect.getOwnMetadata(Ss.INJECTION_TOKEN_METADATA_KEY,r)||{};return Object.keys(t).forEach(n=>{e[+n]=t[n]}),e}a(EK,"getParamInfo");Ss.getParamInfo=EK;function vK(r,e){return function(t,n,i){let s=Reflect.getOwnMetadata(Ss.INJECTION_TOKEN_METADATA_KEY,t)||{};s[i]=e?{token:r,transform:e.transformToken,transformArgs:e.args||[]}:r,Reflect.defineMetadata(Ss.INJECTION_TOKEN_METADATA_KEY,s,t)}}a(vK,"defineInjectionTokenMetadata");Ss.defineInjectionTokenMetadata=vK});var jT=T(Vy=>{"use strict";Object.defineProperty(Vy,"__esModule",{value:!0});Vy.isClassProvider=void 0;function TK(r){return!!r.useClass}a(TK,"isClassProvider");Vy.isClassProvider=TK});var BT=T(Gy=>{"use strict";Object.defineProperty(Gy,"__esModule",{value:!0});Gy.isFactoryProvider=void 0;function AK(r){return!!r.useFactory}a(AK,"isFactoryProvider");Gy.isFactoryProvider=AK});var Wy=T(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.delay=tf.DelayedConstructor=void 0;var qy=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={},n=!1,i,s=a(()=>(n||(i=e(this.wrap()),n=!0),i),"delayedObject");return new Proxy(t,this.createHandler(s))}createHandler(e){let t={},n=a(i=>{t[i]=(...s)=>{s[0]=e();let o=Reflect[i];return o(...s)}},"install");return this.reflectMethods.forEach(n),t}};tf.DelayedConstructor=qy;function IK(r){if(typeof r>"u")throw new Error("Attempt to `delay` undefined. Constructor must be wrapped in a callback");return new qy(r)}a(IK,"delay");tf.delay=IK});var zy=T(go=>{"use strict";Object.defineProperty(go,"__esModule",{value:!0});go.isConstructorToken=go.isTransformDescriptor=go.isTokenDescriptor=go.isNormalToken=void 0;var RK=Wy();function CK(r){return typeof r=="string"||typeof r=="symbol"}a(CK,"isNormalToken");go.isNormalToken=CK;function OK(r){return typeof r=="object"&&"token"in r&&"multiple"in r}a(OK,"isTokenDescriptor");go.isTokenDescriptor=OK;function xK(r){return typeof r=="object"&&"token"in r&&"transform"in r}a(xK,"isTransformDescriptor");go.isTransformDescriptor=xK;function PK(r){return typeof r=="function"||r instanceof RK.DelayedConstructor}a(PK,"isConstructorToken");go.isConstructorToken=PK});var UT=T(Ky=>{"use strict";Object.defineProperty(Ky,"__esModule",{value:!0});Ky.isTokenProvider=void 0;function FK(r){return!!r.useToken}a(FK,"isTokenProvider");Ky.isTokenProvider=FK});var VT=T(Hy=>{"use strict";Object.defineProperty(Hy,"__esModule",{value:!0});Hy.isValueProvider=void 0;function DK(r){return r.useValue!=null}a(DK,"isValueProvider");Hy.isValueProvider=DK});var GT=T(xl=>{"use strict";Object.defineProperty(xl,"__esModule",{value:!0});var LK=jT();Object.defineProperty(xl,"isClassProvider",{enumerable:!0,get:a(function(){return LK.isClassProvider},"get")});var NK=BT();Object.defineProperty(xl,"isFactoryProvider",{enumerable:!0,get:a(function(){return NK.isFactoryProvider},"get")});var kK=zy();Object.defineProperty(xl,"isNormalToken",{enumerable:!0,get:a(function(){return kK.isNormalToken},"get")});var MK=UT();Object.defineProperty(xl,"isTokenProvider",{enumerable:!0,get:a(function(){return MK.isTokenProvider},"get")});var $K=VT();Object.defineProperty(xl,"isValueProvider",{enumerable:!0,get:a(function(){return $K.isValueProvider},"get")})});var kL=T(Yy=>{"use strict";Object.defineProperty(Yy,"__esModule",{value:!0});Yy.isProvider=void 0;var jK=jT(),BK=VT(),UK=UT(),VK=BT();function GK(r){return jK.isClassProvider(r)||BK.isValueProvider(r)||UK.isTokenProvider(r)||VK.isFactoryProvider(r)}a(GK,"isProvider");Yy.isProvider=GK});var zT=T(WT=>{"use strict";Object.defineProperty(WT,"__esModule",{value:!0});var qT=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,[])}};WT.default=qT});var ML=T(HT=>{"use strict";Object.defineProperty(HT,"__esModule",{value:!0});var qK=zT(),KT=class extends qK.default{static{a(this,"Registry")}};HT.default=KT});var $L=T(XT=>{"use strict";Object.defineProperty(XT,"__esModule",{value:!0});var YT=class{static{a(this,"ResolutionContext")}constructor(){this.scopedResolutions=new Map}};XT.default=YT});var QT=T(Xy=>{"use strict";Object.defineProperty(Xy,"__esModule",{value:!0});Xy.formatErrorCtor=void 0;function WK(r,e){return r===null?`at position #${e}`:`"${r.split(",")[e].trim()}" at position #${e}`}a(WK,"formatDependency");function zK(r,e,t=" "){return[r,...e.message.split(`
33
33
  `).map(n=>t+n)].join(`
34
34
  `)}a(zK,"composeErrorMessage");function KK(r,e,t){let[,n=null]=r.toString().match(/constructor\(([\w, ]+)\)/)||[],i=WK(n,e);return zK(`Cannot inject the dependency ${i} of "${r.name}" constructor. Reason:`,t)}a(KK,"formatErrorCtor");Xy.formatErrorCtor=KK});var jL=T(Qy=>{"use strict";Object.defineProperty(Qy,"__esModule",{value:!0});Qy.isDisposable=void 0;function HK(r){return!(typeof r.dispose!="function"||r.dispose.length>0)}a(HK,"isDisposable");Qy.isDisposable=HK});var UL=T(Pl=>{"use strict";Object.defineProperty(Pl,"__esModule",{value:!0});Pl.PostResolutionInterceptors=Pl.PreResolutionInterceptors=void 0;var BL=zT(),Jy=class extends BL.default{static{a(this,"PreResolutionInterceptors")}};Pl.PreResolutionInterceptors=Jy;var Zy=class extends BL.default{static{a(this,"PostResolutionInterceptors")}};Pl.PostResolutionInterceptors=Zy;var JT=class{static{a(this,"Interceptors")}constructor(){this.preResolution=new Jy,this.postResolution=new Zy}};Pl.default=JT});var hc=T(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.instance=la.typeInfo=void 0;var YK=(Uy(),oy(By)),ei=GT(),XK=kL(),e0=zy(),QK=ML(),Ii=MT(),t0=$L(),JK=QT(),ZK=Wy(),eH=jL(),tH=UL();la.typeInfo=new Map;var ZT=class r{static{a(this,"InternalDependencyContainer")}constructor(e){this.parent=e,this._registry=new QK.default,this.interceptors=new tH.default,this.disposed=!1,this.disposables=new Set}register(e,t,n={lifecycle:Ii.default.Transient}){this.ensureNotDisposed();let i;if(XK.isProvider(t)?i=t:i={useClass:t},ei.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&&ei.isTokenProvider(l.provider)?o=l.provider:o=null}}if((n.lifecycle===Ii.default.Singleton||n.lifecycle==Ii.default.ContainerScoped||n.lifecycle==Ii.default.ResolutionScoped)&&(ei.isValueProvider(i)||ei.isFactoryProvider(i)))throw new Error(`Cannot use lifecycle "${Ii.default[n.lifecycle]}" with ValueProviders or FactoryProviders`);return this._registry.set(e,{provider:i,options:n}),this}registerType(e,t){return this.ensureNotDisposed(),ei.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(),ei.isNormalToken(e)){if(ei.isNormalToken(t))return this.register(e,{useToken:t},{lifecycle:Ii.default.Singleton});if(t)return this.register(e,{useClass:t},{lifecycle:Ii.default.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}let n=e;return t&&!ei.isNormalToken(t)&&(n=t),this.register(e,{useClass:n},{lifecycle:Ii.default.Singleton})}resolve(e,t=new t0.default,n=!1){this.ensureNotDisposed();let i=this.getRegistration(e);if(!i&&ei.isNormalToken(e)){if(n)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(e0.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 n=[];for(let i of this.interceptors.preResolution.getAll(e))i.options.frequency!="Once"&&n.push(i),i.callback(e,t);this.interceptors.preResolution.setAll(e,n)}}executePostResolutionInterceptor(e,t,n){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,n);this.interceptors.postResolution.setAll(e,i)}}resolveRegistration(e,t){if(this.ensureNotDisposed(),e.options.lifecycle===Ii.default.ResolutionScoped&&t.scopedResolutions.has(e))return t.scopedResolutions.get(e);let n=e.options.lifecycle===Ii.default.Singleton,i=e.options.lifecycle===Ii.default.ContainerScoped,s=n||i,o;return ei.isValueProvider(e.provider)?o=e.provider.useValue:ei.isTokenProvider(e.provider)?o=s?e.instance||(e.instance=this.resolve(e.provider.useToken,t)):this.resolve(e.provider.useToken,t):ei.isClassProvider(e.provider)?o=s?e.instance||(e.instance=this.construct(e.provider.useClass,t)):this.construct(e.provider.useClass,t):ei.isFactoryProvider(e.provider)?o=e.provider.useFactory(this):o=this.construct(e.provider,t),e.options.lifecycle===Ii.default.ResolutionScoped&&t.scopedResolutions.set(e,o),o}resolveAll(e,t=new t0.default,n=!1){this.ensureNotDisposed();let i=this.getAllRegistrations(e);if(!i&&ei.isNormalToken(e)){if(n)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(n=>!ei.isValueProvider(n.provider)).map(n=>(n.instance=void 0,n)))}createChildContainer(){this.ensureNotDisposed();let e=new r(this);for(let[t,n]of this._registry.entries())n.some(({options:i})=>i.lifecycle===Ii.default.ContainerScoped)&&e._registry.setAll(t,n.map(i=>i.options.lifecycle===Ii.default.ContainerScoped?{provider:i.provider,options:i.options}:i));return e}beforeResolution(e,t,n={frequency:"Always"}){this.interceptors.preResolution.set(e,{callback:t,options:n})}afterResolution(e,t,n={frequency:"Always"}){this.interceptors.postResolution.set(e,{callback:t,options:n})}dispose(){return YK.__awaiter(this,void 0,void 0,function*(){this.disposed=!0;let e=[];this.disposables.forEach(t=>{let n=t.dispose();n&&e.push(n)}),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 ZK.DelayedConstructor)return e.createProxy(i=>this.resolve(i,t));let n=(()=>{let i=la.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 eH.isDisposable(n)&&this.disposables.add(n),n}resolveParams(e,t){return(n,i)=>{try{return e0.isTokenDescriptor(n)?e0.isTransformDescriptor(n)?n.multiple?this.resolve(n.transform).transform(this.resolveAll(n.token,new t0.default,n.isOptional),...n.transformArgs):this.resolve(n.transform).transform(this.resolve(n.token,e,n.isOptional),...n.transformArgs):n.multiple?this.resolveAll(n.token,new t0.default,n.isOptional):this.resolve(n.token,e,n.isOptional):e0.isTransformDescriptor(n)?this.resolve(n.transform,e).transform(this.resolve(n.token,e),...n.transformArgs):this.resolve(n,e)}catch(s){throw new Error(JK.formatErrorCtor(t,i,s))}}}ensureNotDisposed(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")}};la.instance=new ZT;la.default=la.instance});var VL=T(t1=>{"use strict";Object.defineProperty(t1,"__esModule",{value:!0});var rH=Ol(),ua=hc(),e1=zy(),nH=QT();function iH(){return function(r){let e=rH.getParamInfo(r);return class extends r{constructor(...t){super(...t.concat(e.slice(t.length).map((n,i)=>{try{return e1.isTokenDescriptor(n)?e1.isTransformDescriptor(n)?n.multiple?ua.instance.resolve(n.transform).transform(ua.instance.resolveAll(n.token),...n.transformArgs):ua.instance.resolve(n.transform).transform(ua.instance.resolve(n.token),...n.transformArgs):n.multiple?ua.instance.resolveAll(n.token):ua.instance.resolve(n.token):e1.isTransformDescriptor(n)?ua.instance.resolve(n.transform).transform(ua.instance.resolve(n.token),...n.transformArgs):ua.instance.resolve(n)}catch(s){let o=i+t.length;throw new Error(nH.formatErrorCtor(r,o,s))}})))}}}}a(iH,"autoInjectable");t1.default=iH});var GL=T(r1=>{"use strict";Object.defineProperty(r1,"__esModule",{value:!0});var sH=Ol();function oH(r,e){let t={token:r,multiple:!1,isOptional:e&&e.isOptional};return sH.defineInjectionTokenMetadata(t)}a(oH,"inject");r1.default=oH});var r0=T(n1=>{"use strict";Object.defineProperty(n1,"__esModule",{value:!0});var aH=Ol(),cH=hc(),qL=hc();function lH(r){return function(e){cH.typeInfo.set(e,aH.getParamInfo(e)),r&&r.token&&(Array.isArray(r.token)?r.token.forEach(t=>{qL.instance.register(t,e)}):qL.instance.register(r.token,e))}}a(lH,"injectable");n1.default=lH});var WL=T(i1=>{"use strict";Object.defineProperty(i1,"__esModule",{value:!0});var uH=(Uy(),oy(By)),fH=hc();function dH(r=[]){return function(e){return r.forEach(t=>{var{token:n,options:i}=t,s=uH.__rest(t,["token","options"]);return fH.instance.register(n,s,i)}),e}}a(dH,"registry");i1.default=dH});var zL=T(s1=>{"use strict";Object.defineProperty(s1,"__esModule",{value:!0});var pH=r0(),hH=hc();function mH(){return function(r){pH.default()(r),hH.instance.registerSingleton(r)}}a(mH,"singleton");s1.default=mH});var KL=T(o1=>{"use strict";Object.defineProperty(o1,"__esModule",{value:!0});var gH=Ol();function yH(r,e){let t={token:r,multiple:!0,isOptional:e&&e.isOptional};return gH.defineInjectionTokenMetadata(t)}a(yH,"injectAll");o1.default=yH});var HL=T(a1=>{"use strict";Object.defineProperty(a1,"__esModule",{value:!0});var bH=Ol();function _H(r,e,...t){let n={token:r,multiple:!0,transform:e,transformArgs:t};return bH.defineInjectionTokenMetadata(n)}a(_H,"injectAllWithTransform");a1.default=_H});var YL=T(c1=>{"use strict";Object.defineProperty(c1,"__esModule",{value:!0});var SH=Ol();function wH(r,e,...t){return SH.defineInjectionTokenMetadata(r,{transformToken:e,args:t})}a(wH,"injectWithTransform");c1.default=wH});var XL=T(l1=>{"use strict";Object.defineProperty(l1,"__esModule",{value:!0});var EH=r0(),vH=hc();function TH(r,e){return function(t){EH.default()(t),vH.instance.register(e||t,t,{lifecycle:r})}}a(TH,"scoped");l1.default=TH});var QL=T(ws=>{"use strict";Object.defineProperty(ws,"__esModule",{value:!0});var AH=VL();Object.defineProperty(ws,"autoInjectable",{enumerable:!0,get:a(function(){return AH.default},"get")});var IH=GL();Object.defineProperty(ws,"inject",{enumerable:!0,get:a(function(){return IH.default},"get")});var RH=r0();Object.defineProperty(ws,"injectable",{enumerable:!0,get:a(function(){return RH.default},"get")});var CH=WL();Object.defineProperty(ws,"registry",{enumerable:!0,get:a(function(){return CH.default},"get")});var OH=zL();Object.defineProperty(ws,"singleton",{enumerable:!0,get:a(function(){return OH.default},"get")});var xH=KL();Object.defineProperty(ws,"injectAll",{enumerable:!0,get:a(function(){return xH.default},"get")});var PH=HL();Object.defineProperty(ws,"injectAllWithTransform",{enumerable:!0,get:a(function(){return PH.default},"get")});var FH=YL();Object.defineProperty(ws,"injectWithTransform",{enumerable:!0,get:a(function(){return FH.default},"get")});var DH=XL();Object.defineProperty(ws,"scoped",{enumerable:!0,get:a(function(){return DH.default},"get")})});var JL=T(u1=>{"use strict";Object.defineProperty(u1,"__esModule",{value:!0});function LH(r){let e;return t=>(e==null&&(e=r(t)),e)}a(LH,"instanceCachingFactory");u1.default=LH});var ZL=T(f1=>{"use strict";Object.defineProperty(f1,"__esModule",{value:!0});function NH(r){let e=new WeakMap;return t=>{let n=e.get(t);return n==null&&(n=r(t),e.set(t,n)),n}}a(NH,"instancePerContainerCachingFactory");f1.default=NH});var eN=T(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});function kH(r,e,t,n=!0){let i,s;return o=>{let c=r(o);return(!n||s!==c)&&((s=c)?i=o.resolve(e):i=o.resolve(t)),i}}a(kH,"predicateAwareClassFactory");d1.default=kH});var tN=T(ch=>{"use strict";Object.defineProperty(ch,"__esModule",{value:!0});var MH=JL();Object.defineProperty(ch,"instanceCachingFactory",{enumerable:!0,get:a(function(){return MH.default},"get")});var $H=ZL();Object.defineProperty(ch,"instancePerContainerCachingFactory",{enumerable:!0,get:a(function(){return $H.default},"get")});var jH=eN();Object.defineProperty(ch,"predicateAwareClassFactory",{enumerable:!0,get:a(function(){return jH.default},"get")})});var ft=T(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});var p1=(Uy(),oy(By));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 BH=NL();Object.defineProperty(mc,"Lifecycle",{enumerable:!0,get:a(function(){return BH.Lifecycle},"get")});p1.__exportStar(QL(),mc);p1.__exportStar(tN(),mc);p1.__exportStar(GT(),mc);var UH=Wy();Object.defineProperty(mc,"delay",{enumerable:!0,get:a(function(){return UH.delay},"get")});var VH=hc();Object.defineProperty(mc,"container",{enumerable:!0,get:a(function(){return VH.instance},"get")})});var lh=T(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.NullLogger=void 0;n0.NullLogger={debug(){},info(){},warn(){},error(){}}});var g0=T(_e=>{Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"});var pt=Symbol("NOT_RESOLVED");function _n(r,e){var t,n,i,s,o;return{tagName:r,nodeKind:"scalar",implicit:(t=e.implicit)!==null&&t!==void 0?t:!1,matchByTagPrefix:(n=e.matchByTagPrefix)!==null&&n!==void 0?n:!1,implicitFirstChars:(i=e.implicitFirstChars)!==null&&i!==void 0?i:null,resolve:e.resolve,identify:e.identify,represent:(s=e.represent)!==null&&s!==void 0?s:(c=>String(c)),representTagName:(o=e.representTagName)!==null&&o!==void 0?o:(()=>r)}}a(_n,"defineScalarTag");function f0(r,e){var t,n,i,s;let o=e.finalize===void 0;return{tagName:r,nodeKind:"sequence",implicit:!1,matchByTagPrefix:(t=e.matchByTagPrefix)!==null&&t!==void 0?t:!1,create:e.create,addItem:e.addItem,finalize:(n=e.finalize)!==null&&n!==void 0?n:(c=>c),carrierIsResult:o,identify:e.identify,represent:(i=e.represent)!==null&&i!==void 0?i:(c=>c),representTagName:(s=e.representTagName)!==null&&s!==void 0?s:(()=>r)}}a(f0,"defineSequenceTag");function mh(r,e){var t,n,i,s;let o=e.finalize===void 0;return{tagName:r,nodeKind:"mapping",implicit:!1,matchByTagPrefix:(t=e.matchByTagPrefix)!==null&&t!==void 0?t:!1,create:e.create,addPair:e.addPair,has:e.has,keys:e.keys,get:e.get,finalize:(n=e.finalize)!==null&&n!==void 0?n:(c=>c),carrierIsResult:o,identify:e.identify,represent:(i=e.represent)!==null&&i!==void 0?i:(c=>c),representTagName:(s=e.representTagName)!==null&&s!==void 0?s:(()=>r)}}a(mh,"defineMappingTag");var bN=_n("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),GH=["","~","null","Null","NULL"],_N=_n("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>GH.indexOf(r)!==-1?null:pt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),SN=_n("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:pt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),qH=["","~","null","Null","NULL"],wN=_n("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>qH.indexOf(r)!==-1?null:pt,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),WH=["true","True","TRUE"],zH=["false","False","FALSE"],EN=_n("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>WH.indexOf(r)!==-1?!0:zH.indexOf(r)!==-1?!1:pt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),KH=["true"],HH=["false"],vN=_n("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>KH.indexOf(r)!==-1?!0:HH.indexOf(r)!==-1?!1:pt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),YH=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],XH=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],TN=_n("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>YH.indexOf(r)!==-1?!0:XH.indexOf(r)!==-1?!1:pt,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),QH=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),JH=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function ZH(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}a(ZH,"parseYamlInteger$2");function eY(r,e){if(e){if(!JH.test(r))return pt}else if(!QH.test(r))return pt;let t=ZH(r);return Number.isFinite(t)?t:pt}a(eY,"resolveYamlInteger$2");var D1=_n("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:eY,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),tY=new RegExp("^-?(?:0|[1-9][0-9]*)$"),rY=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function nY(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}a(nY,"parseYamlInteger$1");function iY(r,e){if(e){if(!rY.test(r))return pt}else if(!tY.test(r))return pt;let t=nY(r);return Number.isFinite(t)?t:pt}a(iY,"resolveYamlInteger$1");var AN=_n("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:iY,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),sY=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function oY(r){let e=r.replace(/_/g,""),t=1;if((e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b"))return t*parseInt(e.slice(2),2);if(e.startsWith("0x"))return t*parseInt(e.slice(2),16);if(e.includes(":")){let n=0;for(let i of e.split(":"))n=n*60+Number(i);return t*n}return e!=="0"&&e[0]==="0"?t*parseInt(e,8):t*parseInt(e,10)}a(oY,"parseYamlInteger");function aY(r){if(!sY.test(r))return pt;let e=oY(r);return Number.isFinite(e)?e:pt}a(aY,"resolveYamlInteger");var s0=_n("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:aY,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),cY=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),lY=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function uY(r){if(!cY.test(r))return pt;let e=r.toLowerCase(),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=t*parseFloat(e);return Number.isFinite(n)||lY.test(r)?n:pt}a(uY,"resolveYamlFloat$2");function fY(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}a(fY,"representYamlFloat$2");var L1=_n("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:uY,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:fY}),dY=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),pY=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function hY(r,e){if(e){if(!pY.test(r))return pt;let n=r.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:pt}if(!dY.test(r))return pt;let t=Number(r);return Number.isFinite(t)?t:pt}a(hY,"resolveYamlFloat$1");function mY(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}a(mY,"representYamlFloat$1");var IN=_n("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:hY,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:mY}),gY=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),yY=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function bY(r){if(!gY.test(r))return pt;let e=r.toLowerCase().replace(/_/g,""),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=0;if(e.includes(":")){for(let i of e.split(":"))n=n*60+Number(i);n*=t}else n=t*parseFloat(e);return Number.isFinite(n)||yY.test(r)?n:pt}a(bY,"resolveYamlFloat");function _Y(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}a(_Y,"representYamlFloat");var o0=_n("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:bY,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:_Y}),RN=_n("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":pt,"resolve"),identify:a(()=>!1,"identify")}),SY=/^[A-Za-z0-9+/]*={0,2}$/;function wY(r){let e=r.replace(/\s/g,"");if(e.length%4!==0||!SY.test(e))return pt;let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}a(wY,"resolveYamlBinary");function EY(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}a(EY,"representYamlBinary");var CN=_n("tag:yaml.org,2002:binary",{resolve:wY,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:EY}),vY=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),TY=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 rN(r,e,t,n=0,i=0,s=0,o=0){let c=new Date(Date.UTC(r,e,t,n,i,s,o));return c.setUTCFullYear(r,e,t),c}a(rN,"makeUtcDate");function AY(r){let e=vY.exec(r);if(e===null&&(e=TY.exec(r)),e===null)return pt;let t=+e[1],n=+e[2]-1,i=+e[3];if(!e[4]){let f=rN(t,n,i);return f.getUTCFullYear()!==t||f.getUTCMonth()!==n||f.getUTCDate()!==i?pt:f}let s=+e[4],o=+e[5],c=+e[6],l=0;if(s>23||o>59||c>59)return pt;if(e[7]){let f=e[7].slice(0,3);for(;f.length<3;)f+="0";l=+f}let u=rN(t,n,i,s,o,c,l);if(u.getUTCFullYear()!==t||u.getUTCMonth()!==n||u.getUTCDate()!==i)return pt;if(e[9]){let f=+e[10],d=+(e[11]||0);if(f>23||d>59)return pt;let p=(f*60+d)*6e4;u.setTime(u.getTime()-(e[9]==="-"?-p:p))}return u}a(AY,"resolveYamlTimestamp");var ON=_n("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:AY,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),xN=f0("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});function d0(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}a(d0,"isPlainObject");function w1(r,e){let t={};for(let n of e)r[n]!==void 0&&(t[n]=r[n]);return t}a(w1,"pick");var PN=f0("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(d0(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),FN=f0("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),DN=mh("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:d0,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),LN=mh("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});function hh(r){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hh(r)}a(hh,"_typeof");function IY(r,e){if(hh(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}a(IY,"toPrimitive");function RY(r){var e=IY(r,"string");return hh(e)=="symbol"?e:e+""}a(RY,"toPropertyKey");function ss(r,e,t){return(e=RY(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}a(ss,"_defineProperty");function nN(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}a(nN,"ownKeys");function Vt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nN(Object(t),!0).forEach(function(n){ss(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):nN(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}a(Vt,"_objectSpread2");function CY(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}a(CY,"createTagDefinitionMap");function OY(){return{scalar:[],sequence:[],mapping:[]}}a(OY,"createTagDefinitionListMap");function xY(r){let e=[];for(let t of r){let n=e.length;for(let i=0;i<e.length;i++){let s=e[i];if(s.nodeKind===t.nodeKind&&s.tagName===t.tagName&&s.matchByTagPrefix===t.matchByTagPrefix){n=i;break}}e[n]=t}return e}a(xY,"compileTags");var gh=class NN{static{a(this,"Schema")}constructor(e){ss(this,"tags",void 0),ss(this,"implicitScalarTags",void 0),ss(this,"implicitScalarByFirstChar",void 0),ss(this,"implicitScalarAnyFirstChar",void 0),ss(this,"defaultScalarTag",void 0),ss(this,"defaultSequenceTag",void 0),ss(this,"defaultMappingTag",void 0),ss(this,"exact",void 0),ss(this,"prefix",void 0);let t=xY(e),n=[],i=CY(),s=OY();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){var t;let n=(t=this.implicitScalarByFirstChar.get(e.charAt(0)))!==null&&t!==void 0?t:this.implicitScalarAnyFirstChar;for(let s of n){let o=s.resolve(e,!1,s.tagName);if(o!==pt)return{value:o,tag:s}}let i=this.defaultScalarTag;return{value:i.resolve(e,!1,i.tagName),tag:i}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new NN([...this.tags,...t])}},p0=new gh([bN,xN,DN]),PY=new gh([...p0.tags,SN,vN,AN,IN]),kN=new gh([...p0.tags,_N,EN,D1,L1]),MN=new gh([...p0.tags,wN,TN,s0,o0,ON,RN,CN,PN,FN,LN]),$N=MN.withTags(Vt(Vt({},s0),{},{resolve:a((r,e,t)=>{let n=s0.resolve(r,e,t);return n===pt?D1.resolve(r,e,t):n},"resolve")}),Vt(Vt({},o0),{},{resolve:a((r,e,t)=>{let n=o0.resolve(r,e,t);return n===pt?L1.resolve(r,e,t):n},"resolve")})),FY=mh("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||d0(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});function iN(r){if(Array.isArray(r)){let e=Array.prototype.slice.call(r);for(let t=0;t<e.length;t++){if(Array.isArray(e[t]))return null;typeof e[t]=="object"&&Object.prototype.toString.call(e[t])==="[object Object]"&&(e[t]="[object Object]")}return String(e)}return typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"?"[object Object]":String(r)}a(iN,"normalizeKey");var DY=mh("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:d0,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=iN(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=iN(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),LY={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function h1(r,e,t,n,i){let s="",o="",c=Math.floor(i/2)-1;return n-e>c&&(s=" ... ",e=n-c+s.length),t-n>c&&(o=" ...",t=n+c-o.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}a(h1,"getLine");function m1(r,e){return" ".repeat(Math.max(e-r.length,0))+r}a(m1,"padStart");function NY(r,e){if(!r.buffer)return null;let t=Vt(Vt({},LY),e),n=/\r?\n|\r|\0/g,i=[0],s=[],o,c=-1;for(;o=n.exec(r.buffer);)s.push(o.index),i.push(o.index+o[0].length),r.position<=o.index&&c<0&&(c=i.length-2);c<0&&(c=i.length-1);let l="",u=Math.min(r.line+t.linesAfter,s.length).toString().length,f=t.maxLength-(t.indent+u+3);for(let p=1;p<=t.linesBefore&&!(c-p<0);p++){let h=h1(r.buffer,i[c-p],s[c-p],r.position-(i[c]-i[c-p]),f);l=`${" ".repeat(t.indent)}${m1((r.line-p+1).toString(),u)} | ${h.str}
@@ -85,14 +85,14 @@ ${" ".repeat(r.indent*e)}`}a(P1,"generateNextLine");function dQ(r,e,t,n,i,s){ret
85
85
  `?e+="\\n":n==="\r"?e+="\\r":n===" "?e+="\\t":i<32||i>=127&&i<=159?e+="\\x"+i.toString(16).toUpperCase().padStart(2,"0"):i===65534||i===65535?e+="\\u"+i.toString(16).toUpperCase():i>=55296&&i<=56319&&t+1<r.length&&r.charCodeAt(t+1)>=56320&&r.charCodeAt(t+1)<=57343?(e+=n+r[t+1],t++):i>=55296&&i<=57343?e+="\\u"+i.toString(16).toUpperCase():e+=n}return`"${e}"`}a(R3,"quoteYamlString");function oJ(r){if(r.length<2||!r.startsWith("'")||!r.endsWith("'"))return!1;let e=r.slice(1,-1);for(let t=0;t<e.length;t++)if(e[t]==="'"){if(e[t+1]!=="'")return!1;t++}return!0}a(oJ,"isCompleteSingleQuotedScalar");Jt.YAML_BLOCK_SCALAR_HEADER=/^[|>](?:[1-9][-+]?|[-+][1-9]?)?$/;function _0(r){let e=r.indexOf(`
86
86
  `),t=e===-1?r:r.slice(0,e);return Jt.YAML_BLOCK_SCALAR_HEADER.test(t)}a(_0,"isBlockScalarRaw");function W1(r,e=!1){if(!_0(r)||e&&/^[|>][^\n]*[1-9]/.test(r))return r;try{let t=b0.load(`k: ${r}`);return typeof t?.k=="string"?t.k:r}catch{return r}}a(W1,"decodeYamlBlockScalar");function aJ(r){return _0(r)?W1(r,!0):C3(r)}a(aJ,"decodeYamlSequenceItem");function cJ(r){if(!_0(r))return r;let[e,...t]=r.split(`
87
87
  `);return[e,...t.map(n=>n===""?n:` ${n}`)].join(`
88
- `)}a(cJ,"blockScalarAsSequenceItem");function C3(r){if(_0(r))return W1(r);if(!q1(r)&&!oJ(r))return r;try{let e=b0.load(r);return typeof e=="string"?e:r}catch{return r}}a(C3,"decodeYamlQuotedScalar");function lJ(r,e=!1,t){return typeof r!="string"?String(r):I3(r,e,t)?R3(r):r}a(lJ,"serializeYamlScalar");function uJ(r){return/^\[\[[\s\S]*\]\]$/.test(r.trim())}a(uJ,"isUnquotedWikilink");function O3(r){if(r==="")return'an empty string (writes a junk `prop: ""` key)';if(r===null)return"null (writes `prop: null`, which a YAML reader sees as null)";if(Array.isArray(r)&&r.length===0)return"an empty list (writes a BARE `prop:` key, which a YAML reader sees as null)"}a(O3,"emptyPropertyValueForm");function fJ(r){return O3(r)!==void 0}a(fJ,"isEmptyPropertyValue")});var Ml=T(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.bytesToBase64=P3;lf.base64ToBytes=F3;lf.base64ToUtf8=dJ;lf.utf8ToBase64=pJ;var x3=32768;function P3(r){let e="";for(let t=0;t<r.length;t+=x3)e+=String.fromCharCode(...r.subarray(t,t+x3));return btoa(e)}a(P3,"bytesToBase64");function F3(r){let e=r.replace(/\s/g,""),t=e.length%4,n=t===2||t===3?e+"=".repeat(4-t):e,i=atob(n),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(F3,"base64ToBytes");function dJ(r){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(F3(r))}a(dJ,"base64ToUtf8");function pJ(r){return P3(new TextEncoder().encode(r))}a(pJ,"utf8ToBase64")});var yc=T(z1=>{"use strict";Object.defineProperty(z1,"__esModule",{value:!0});z1.iriToObsidianName=mJ;var hJ=Rt();function mJ(r){let e=hJ.Namespace.fromTermIRI(r);if(e)return`${e.namespace.prefix}__${e.localName}`;let t=r.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(mJ,"iriToObsidianName")});var E0=T(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.findUidByAssetLabel=gJ;w0.labelTermBearers=N3;var D3=Le(),L3=Ye(),S0=Rt();async function gJ(r,e){let t=S0.Namespace.EXO.term("Asset_label"),n=yJ(e);if(n){let[i]=await N3(r,n);if(i)return i.uid}for(let i of await r.match(void 0,t,void 0))if(i.object instanceof L3.Literal&&i.object.value===e&&i.subject instanceof D3.IRI){let s=await k3(r,i.subject);if(s)return s}return null}a(gJ,"findUidByAssetLabel");async function N3(r,e){let t=[],n=new Set;for(let i of await r.match(void 0,S0.Namespace.EXO.term("Asset_label"),e)){if(!(i.subject instanceof D3.IRI))continue;let s=await k3(r,i.subject);!s||n.has(s)||(n.add(s),t.push({subject:i.subject,uid:s}))}return t}a(N3,"labelTermBearers");function yJ(r){if(/\s/.test(r))return null;let e=S0.Namespace.fromPropertyKey(r);if(!e||/[\s()]/.test(e.localName))return null;try{return e.namespace.term(e.localName)}catch{return null}}a(yJ,"labelTermIRI");async function k3(r,e){let t=await r.match(e,S0.Namespace.EXO.term("Asset_uid"),void 0);return t.length>0&&t[0].object instanceof L3.Literal?t[0].object.value:null}a(k3,"uidOf")});var M3=T(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});v0.mergePropertyDefaults=bJ;v0.mergeInheritanceRules=_J;function bJ(r,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.propertyName);o?(n.push(o),i.add(o.propertyName)):n.push(s)}for(let s of e)i.has(s.propertyName)||n.push(s);return n}a(bJ,"mergePropertyDefaults");function _J(r,e){let t=new Map;for(let s of e){let o=t.get(s.targetPropertyName);o?o.push(s):t.set(s.targetPropertyName,[s])}let n=[],i=new Set;for(let s of r){let o=t.get(s.targetPropertyName);o?i.has(s.targetPropertyName)||(n.push(...o),i.add(s.targetPropertyName)):n.push(s)}for(let s of e)i.has(s.targetPropertyName)||n.push(s);return n}a(_J,"mergeInheritanceRules")});var K1=T((MIe,$3)=>{var uf=class{static{a(this,"Wildcard")}constructor(){return SJ||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(uf.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(uf.prototype,"termType",{enumerable:!0,value:"Wildcard"});var SJ=new uf;$3.exports.Wildcard=uf});var B3=T((jIe,j3)=>{var wJ=(function(){var r=a(function(M,L,W,ne){for(W=W||{},ne=M.length;ne--;W[M[ne]]=L);return W},"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],n=[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],p=[1,41],h=[1,44],g=[123,126],m=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],_=[1,87],A=[2,281],E=[1,86],w=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],R=[6,28,29,53,63,70,73,81,83,85],O=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],P=[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],N=[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],j=[13,16,308],U=[112,132,327,334],G=[13,16,112,132,308],$=[1,111],k=[1,117],te=[112,132,327,328,334],Z=[13,16,112,132,308,328],re=[28,29,45,53,87],V=[1,138],K=[1,151],he=[1,128],He=[1,127],ce=[1,129],ee=[1,140],H=[1,141],Y=[1,142],ie=[1,143],Ce=[1,144],B=[1,145],fe=[1,147],ae=[1,148],Ie=[2,457],ye=[1,158],Te=[1,159],Re=[1,160],pe=[1,152],q=[1,153],F=[1,156],J=[1,171],ue=[1,172],Se=[1,173],Oe=[1,174],We=[1,175],Ne=[1,176],ke=[1,167],ze=[1,168],xe=[1,169],Ve=[1,170],rt=[1,157],ot=[1,166],nt=[1,161],C=[1,162],x=[1,163],D=[1,164],z=[1,165],ve=[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],Wt=[1,195],Qt=[6,31,73,81,83,85],it=[2,285],me=[1,199],ge=[1,201],be=[6,31,70,73,81,83,85],we=[2,283],Ze=[1,207],Tt=[1,218],At=[1,223],pn=[1,219],_i=[1,225],Ui=[1,226],Xn=[1,224],kF=[6,63,70,73,81,83,85],MF=[1,236],$F=[2,334],jF=[1,243],BF=[1,241],hn=[6,193],$g=[2,349],UF=[2,339],cc=[28,128],VF=[47,48,193,272],jg=[47,48,193,242,272],$u=[47,48,193,242,246,272],ju=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Zr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],GF=[1,271],qF=[1,270],Pr=[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],WF=[1,281],zF=[1,280],Qn=[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],Op=[45,89],Bg=[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],Ug=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Vg=[31,89],Gg=[48,87],fl=[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],ao=[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],KF=[1,313],Bu=[6,85],fv=[6,31,81,83,85],HF=[2,361],Jo=[2,353],dl=[1,343],xp=[31,112,335],Zo=[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],dv=[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],YF=[6,109,193],pl=[31,112],Fr=[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],pv=[1,390],hv=[1,391],lc=[13,16,87,197,308,314],XF=[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],qg=[1,417],Wg=[1,418],QF=[13,16,48,197,229,308],uc=[6,31,85],JF=[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],mv=[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],hl=[29,31,85,112,159,160,161,163,164],zg=[1,443],Kg=[1,444],ZF=[1,449],ml=[31,112,193,232,318,335],Hg=[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],eD=[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],gv=[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],Pp=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Fp=[31,45],tD=[1,507],rD=[1,508],nD=[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],Yg=[29,31,85,112,159,160,161,163,164,335],gl=[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],iD=[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],sD=[2,352],yv=[13,16,197,308,314],oD=[1,565],Uu=[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],aD=[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],ea=[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],cD=[13,16,87,308],ta=[2,364],Vu=[29,31,85,112,159,160,161,163,164,193,232,318,335],Xg=[31,112,193,232,272,318,335],ra=[2,359],lD=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Qg=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],uD=[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],fD=[2,347],bv={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(L,W,ne,De,tt,v,Zn){var I=v.length-1;switch(tt){case 1:if(v[I-1]=v[I-1]||{},at.base&&(v[I-1].base=at.base),at.base="",v[I-1].prefixes=at.prefixes,at.prefixes=null,at.pathOnly){if(v[I-1].type==="path"||"termType"in v[I-1])return v[I-1];throw new Error("Received full SPARQL query in path only mode")}else if(v[I-1].type==="path"||"termType"in v[I-1])throw new Error("Received only path in full SPARQL mode");if(v[I-1].type==="update"){let zt={};for(let ar of v[I-1].updates)if(ar.updateType==="insert"){let It={};for(let kt of ar.insert)if(kt.type==="bgp"||kt.type==="graph")for(let Si of kt.triples)Si.subject.termType==="BlankNode"&&(It[Si.subject.value]=!0),Si.predicate.termType==="BlankNode"&&(It[Si.predicate.value]=!0),Si.object.termType==="BlankNode"&&(It[Si.object.value]=!0);for(let kt of Object.keys(It)){if(zt[kt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");zt[kt]=!0}}}return v[I-1];case 2:this.$={...v[I-1],...v[I],type:"query"};break;case 4:at.base=Dp(v[I]);break;case 5:at.prefixes||(at.prefixes={}),v[I-1]=v[I-1].substr(0,v[I-1].length-1),v[I]=Dp(v[I]),at.prefixes[v[I-1]]=v[I];break;case 6:this.$={...v[I-3],..._l(v[I-2]),...v[I-1],...v[I]};break;case 7:if(!at.skipValidation&&(Iv(v[I-3].variables.map(ar=>Av(ar.expression))).some(ar=>ar.aggregation==="count"&&!(ar.expression instanceof Jg))||v[I].group)){for(let ar of v[I-3].variables)if(ar.termType==="Variable"){if(!v[I].group||!v[I].group.map(It=>zu(It)).includes(zu(ar)))throw Error("Projection of ungrouped variable (?"+zu(ar)+")")}else if(Av(ar.expression).length===0){let It=Rq(ar.expression);for(let kt of It)if(!v[I].group||!v[I].group.map||!v[I].group.map(Si=>zu(Si)).includes(zu(kt)))throw Error("Use of ungrouped variable in projection of operation (?"+zu(kt)+")")}}let fo=v[I-1].where.filter(zt=>zt.type==="query");if(fo.length>0){let zt=v[I-3].variables.filter(It=>It.variable&&It.variable.value).map(It=>It.variable.value),ar=Iv(fo.map(It=>It.variables)).map(It=>It.value||It.variable.value);for(let It of zt)if(ar.indexOf(It)>=0)throw Error("Target id of 'AS' (?"+It+") already used in subquery")}this.$=vr(v[I-3],_l(v[I-2]),v[I-1],v[I]);break;case 8:this.$=vr({queryType:"CONSTRUCT",template:v[I-3]},_l(v[I-2]),v[I-1],v[I]);break;case 9:this.$=vr({queryType:"CONSTRUCT",template:v[I-2]=v[I-2]?v[I-2].triples:[]},_l(v[I-5]),{where:[{type:"bgp",triples:bl([],v[I-2])}]},v[I]);break;case 10:this.$=vr({queryType:"DESCRIBE",variables:v[I-3]==="*"?[new Jg]:v[I-3]},_l(v[I-2]),v[I-1],v[I]);break;case 11:this.$=vr({queryType:"ASK"},_l(v[I-2]),v[I-1],v[I]);break;case 12:this.$=vr(v[I-1],{variables:[new Jg]});break;case 13:let $p=v[I].map(zt=>zt.value||zt.variable.value),Ku=Cq($p);if(Ku.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Ku[0]+")");this.$=vr(v[I-1],{variables:v[I]});break;case 14:this.$=vr({queryType:"SELECT"},v[I]&&(v[I-1]=Jn(v[I]),v[I]={},v[I][v[I-1]]=!0,v[I]));break;case 16:case 27:this.$=Gu(v[I-3],{variable:v[I-1]});break;case 17:case 18:this.$=vr(v[I-3],v[I-2],v[I-1],v[I],{type:"query"});break;case 19:case 58:this.$={iri:v[I],named:!!v[I-1]};break;case 20:this.$={where:v[I].patterns};break;case 21:this.$=vr(v[I-1],v[I]);break;case 22:this.$=vr(v[I-2],v[I-1],v[I]);break;case 23:this.$={group:v[I]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Gu(v[I]);break;case 26:this.$=Gu(v[I-1]);break;case 29:this.$={having:v[I]};break;case 30:this.$={order:v[I]};break;case 32:this.$=Gu(v[I],{descending:!0});break;case 35:this.$={limit:Wu(v[I])};break;case 36:this.$={offset:Wu(v[I])};break;case 37:this.$={limit:Wu(v[I-2]),offset:Wu(v[I])};break;case 38:this.$={limit:Wu(v[I]),offset:Wu(v[I-2])};break;case 39:case 43:this.$={type:"values",values:v[I]};break;case 40:case 84:this.$=v[I-1].map(zt=>({[v[I-3]]:zt}));break;case 41:case 85:this.$=v[I-1].map(()=>({}));break;case 42:case 86:var uo=v[I-4].length;v[I-4]=v[I-4].map(_v),this.$=v[I-1].map(function(zt){if(zt.length!==uo)throw Error("Inconsistent VALUES length");for(var ar={},It=0;It<uo;It++)ar["?"+v[I-4][It].value]=zt[It];return ar});break;case 44:case 65:case 100:case 126:case 175:this.$=v[I-1];break;case 45:this.$={type:"update",updates:na(v[I-2],v[I-1])};break;case 46:this.$=vr({type:"load",silent:!!v[I-2],source:v[I-1]},v[I]&&{destination:v[I]});break;case 47:this.$={type:Jn(v[I-2]),silent:!!v[I-1],graph:v[I]};break;case 48:this.$={type:Jn(v[I-4]),silent:!!v[I-3],source:v[I-2],destination:v[I]};break;case 49:this.$={type:"create",silent:!!v[I-2],graph:{type:"graph",name:v[I]}};break;case 50:this.$={updateType:"insert",insert:ED(v[I])};break;case 51:this.$={updateType:"delete",delete:Ov(ED(v[I]))};break;case 52:this.$={updateType:"deletewhere",delete:Ov(v[I])};break;case 53:this.$={updateType:"insertdelete",...v[I-4],...v[I-3],..._l(v[I-2],"using"),where:v[I].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=v[I];break;case 55:this.$={delete:Ov(v[I-1]),insert:v[I]||[]};break;case 56:this.$={delete:[],insert:v[I]};break;case 59:this.$={graph:v[I]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:v[I]};break;case 64:this.$={[Jn(v[I])]:!0};break;case 66:this.$=v[I-1]?co(v[I],[v[I-1]]):co(v[I]);break;case 67:var kp=vr(v[I-3]||{triples:[]},{type:"graph",name:v[I-5]});this.$=v[I]?[kp,v[I]]:[kp];break;case 68:case 73:this.$={type:"bgp",triples:co(v[I-2],[v[I-1]])};break;case 69:this.$={type:"group",patterns:[v[I-1]]};break;case 70:for(let zt of v[I-1].filter(ar=>ar.type==="bind")){let ar=v[I-1].indexOf(zt),It=new Set;for(let kt of v[I-1].slice(0,ar))(kt.type==="group"||kt.type==="bgp")&&SD(kt).forEach(Si=>It.add(Si));if(It.has(zt.variable.value))throw Error("Variable used to bind is already bound (?"+zt.variable.value+")")}this.$={type:"group",patterns:v[I-1]};break;case 71:this.$=v[I-1]?co([v[I-1]],v[I]):co(v[I]);break;case 72:this.$=v[I]?[v[I-2],v[I]]:v[I-2];break;case 75:this.$=vr(v[I],{type:"optional"});break;case 76:this.$=vr(v[I],{type:"minus"});break;case 77:this.$=vr(v[I],{type:"graph",name:v[I-1]});break;case 78:this.$=vr(v[I],{type:"service",name:v[I-1],silent:!!v[I-2]});break;case 79:this.$={type:"filter",expression:v[I]};break;case 80:this.$={type:"bind",variable:v[I-1],expression:v[I-3]};break;case 89:this.$=Np(v[I]);break;case 90:this.$=void 0;break;case 91:this.$=v[I-1].length?{type:"union",patterns:co(v[I-1].map(wv),[wv(v[I])])}:v[I];break;case 95:this.$={...v[I],function:v[I-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:na(v[I-2],v[I-1]),distinct:!!v[I-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.$=na(v[I-2],v[I-1]);break;case 101:this.$=co(v[I-2],[v[I-1]]);break;case 102:case 112:this.$=Cv(v[I].map(zt=>vr(ia(v[I-1]),zt)));break;case 103:this.$=Cv(bl(v[I].map(zt=>vr(ia(v[I-1].entity),zt)),v[I-1].triples));break;case 105:this.$=co([v[I-1]],v[I]);break;case 106:this.$=co(v[I]);break;case 107:this.$=Tv(v[I-1],v[I]);break;case 109:case 237:this.$=at.factory.namedNode(yq);break;case 110:case 118:this.$=na(v[I-1],v[I]);break;case 111:this.$=v[I]?{annotation:v[I],object:v[I-1]}:v[I-1];break;case 113:this.$=v[I]?Cv(bl(v[I].map(zt=>vr(ia(v[I-1].entity),zt)),v[I-1].triples)):v[I-1].triples;break;case 114:this.$=Tv(...v[I-1],v[I]);break;case 116:this.$=Tv(...v[I]);break;case 117:case 159:case 163:this.$=[v[I-1],v[I]];break;case 119:this.$=v[I]?{object:v[I-1],annotation:v[I]}:v[I-1];break;case 120:this.$=v[I-1].length?qu("|",na(v[I-1],v[I])):v[I];break;case 121:this.$=v[I-1].length?qu("/",na(v[I-1],v[I])):v[I];break;case 122:this.$=v[I]?qu(v[I],[v[I-1]]):v[I-1];break;case 123:this.$=v[I-1]?qu(v[I-1],[v[I]]):v[I];break;case 125:case 131:this.$=qu(v[I-1],[v[I]]);break;case 129:this.$=qu("|",na(v[I-2],v[I-1]));break;case 132:case 134:this.$=Aq(v[I-1]);break;case 133:case 135:this.$=Iq(v[I-1]);break;case 140:this.$={entity:v[I],triples:[]};break;case 145:this.$=_v(v[I]);break;case 149:this.$=at.factory.namedNode(dD);break;case 151:case 153:case 158:case 162:this.$=Sv(v[I-1],v[I]);break;case 152:this.$=["||",v[I]];break;case 154:this.$=["&&",v[I]];break;case 156:this.$=mn(v[I-1],[v[I-2],v[I]]);break;case 157:this.$=mn(v[I-2]?"notin":"in",[v[I-3],v[I]]);break;case 160:this.$=["+",Sv(v[I-1],v[I])];break;case 161:var ty=lo(v[I-1].value.replace("-",""),v[I-1].datatype);this.$=["-",Sv(ty,v[I])];break;case 164:this.$=mn("UPLUS",[v[I]]);break;case 165:this.$=mn(v[I-1],[v[I]]);break;case 166:this.$=mn("UMINUS",[v[I]]);break;case 177:this.$=mn(Jn(v[I-1]));break;case 178:this.$=mn(Jn(v[I-3]),[v[I-1]]);break;case 179:this.$=Np(mn(Jn(v[I-3]),[v[I-1]]));break;case 180:this.$=mn(Jn(v[I-5]),[v[I-3],v[I-1]]);break;case 181:this.$=mn(Jn(v[I-7]),[v[I-5],v[I-3],v[I-1]]);break;case 182:this.$=Np(mn(Jn(v[I-7]),[v[I-5],v[I-3],v[I-1]]));break;case 183:this.$=mn(Jn(v[I-1]),v[I]);break;case 184:this.$=mn("bound",[_v(v[I-1])]);break;case 185:this.$=mn(v[I-1],[]);break;case 186:this.$=mn(v[I-3],[v[I-1]]);break;case 187:this.$=mn(v[I-2]?"notexists":"exists",[wv(v[I])]);break;case 188:case 189:this.$=Gu(v[I-1],{type:"aggregate",aggregation:Jn(v[I-4]),distinct:!!v[I-2]});break;case 190:this.$=Gu(v[I-2],{type:"aggregate",aggregation:Jn(v[I-5]),distinct:!!v[I-3],separator:typeof v[I-1]=="string"?v[I-1]:" "});break;case 192:this.$=lo(v[I]);break;case 193:this.$=wq(v[I-1],Jn(v[I].substr(1)));break;case 194:this.$=lo(v[I-2],v[I]);break;case 195:case 204:this.$=lo(v[I],pD);break;case 196:case 205:this.$=lo(v[I],hD);break;case 197:case 206:this.$=lo(Jn(v[I]),mD);break;case 200:this.$=lo(v[I].toLowerCase(),Sq);break;case 201:this.$=lo(v[I].substr(1),pD);break;case 202:this.$=lo(v[I].substr(1),hD);break;case 203:this.$=lo(v[I].substr(1).toLowerCase(),mD);break;case 207:case 208:this.$=_D(v[I],1);break;case 209:case 210:this.$=_D(v[I],3);break;case 211:this.$=at.factory.namedNode(Dp(v[I]));break;case 213:var ry=v[I].indexOf(":"),Mp=v[I].substr(0,ry),ny=at.prefixes[Mp];if(!ny)throw new Error("Unknown prefix: "+Mp);var hr=Dp(ny+v[I].substr(ry+1));this.$=at.factory.namedNode(hr);break;case 214:if(v[I]=v[I].substr(0,v[I].length-1),!(v[I]in at.prefixes))throw new Error("Unknown prefix: "+v[I]);var hr=Dp(at.prefixes[v[I]]);this.$=at.factory.namedNode(hr);break;case 215:this.$=Lp(v[I].replace(/^(_:)/,""));break;case 216:this.$=Lp();break;case 217:case 218:case 232:this.$=Np(Ev(v[I-3],v[I-2],v[I-1]));break;case 230:case 231:this.$=Np(v[I-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:v[I-1].push(v[I]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[v[I]];break;case 308:v[I-3].push(v[I-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:v[I-2].push(v[I-1]);break}},"anonymous"),table:[r(e,t,{3:1,4:2,10:3}),{1:[3]},r(n,[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}),r([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]},r(c,[2,411],{216:28,217:29}),r(l,[2,249],{18:30}),r(l,[2,251],{22:31}),r(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:p,139:38,307:43,308:h,323:36},r(l,[2,267],{37:46}),r(g,[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:m,87:p},r(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),r(e,[2,248]),r(e,[2,245]),r(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]},r([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]}),r(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:_,29:A,52:84,53:E,56:85},{19:88,28:_,29:A,52:89,53:E,56:85},r(l,[2,253],{26:90}),{28:[1,91],52:92,53:E},r(w,[2,385],{181:93,182:94,183:95,31:[2,383]}),r(R,[2,263],{34:96}),r(R,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),r(R,[2,262]),r(O,[2,259]),r(P,[2,143]),r(P,[2,144]),r([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]),r(N,[2,211]),r(N,[2,212]),r(N,[2,213]),r(N,[2,214]),{19:98,28:_,29:A,52:99,53:E,56:85},{6:[2,309],99:100,193:[1,101]},r(j,[2,311],{101:102,328:[1,103]}),r(U,[2,317],{104:104,328:[1,105]}),r(G,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:$,114:110},{29:$,114:112},{29:$,114:113},{118:114,123:[1,115],125:116,126:k},r(te,[2,315]),r(te,[2,316]),r(Z,[2,319]),r(Z,[2,320]),r(Z,[2,321]),r(g,[2,327]),{13:f,16:d,55:118,307:43,308:h},r(l,[2,12]),r(l,[2,13],{44:66,43:119,45:m,87:p}),r(re,[2,269]),r(re,[2,15]),{13:f,16:d,44:136,45:V,46:120,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(b,[2,14]),r(b,[2,274]),r(b,[2,271]),r(b,[2,272]),r(e,[2,4]),{13:[1,177]},r(ve,[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},r(c,[2,410]),r([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:Wt,219:189,220:190,223:191,224:[1,192],307:43,308:h},r(S,[2,419]),r(Qt,it,{20:196,59:197,69:198,70:me}),r(l,[2,250]),{29:ge,57:200},r(j,[2,279],{54:202,327:[1,203]}),{29:[2,282]},r(be,we,{23:204,58:205,62:206,63:Ze}),r(l,[2,252]),{19:208,28:_,29:A,52:209,53:E,56:85},{29:[1,210]},r(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,145:212,172:221,185:213,187:214,231:pn,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(kF,[2,265],{56:85,35:227,52:228,19:229,28:_,29:A,53:E}),r(O,[2,260]),r(be,we,{58:205,62:206,23:230,63:Ze}),r(l,[2,268]),{6:[2,45]},r(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},r(j,[2,312]),{105:233,112:MF,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},r(U,[2,318]),r(j,$F,{108:240,133:242,112:jF,132:BF}),r(G,[2,323]),{112:[1,244]},{112:[2,325]},r(hn,[2,50]),r(w,$g,{135:245,136:246,143:247,144:248,31:UF,112:UF}),r(hn,[2,51]),r(hn,[2,52]),r(cc,[2,328],{119:249}),{29:$,114:250},r(cc,[2,56]),{29:$,114:251},r(g,[2,59]),r(re,[2,270]),{47:[1,252]},r(VF,[2,150]),r(jg,[2,428],{240:253}),r($u,[2,430],{244:254}),r($u,[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]}),r(ju,[2,440],{252:264}),r(Zr,[2,448],{260:265}),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Zr,[2,167]),r(Zr,[2,168]),r(Zr,[2,169]),r(Zr,[2,170],{176:269,45:GF,89:qF}),r(Zr,[2,171]),r(Zr,[2,172]),r(Zr,[2,173]),r(Zr,[2,174]),{13:f,16:d,44:136,45:V,46:272,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:WF,89:zF,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},r(Qn,[2,192],{292:[1,286],293:[1,287]}),r(Qn,[2,195]),r(Qn,[2,196]),r(Qn,[2,197]),r(Qn,[2,198]),r(Qn,[2,199]),r(Qn,[2,200]),{13:f,16:d,44:39,55:40,82:K,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},r(Op,[2,452]),r(Op,[2,453]),r(Op,[2,454]),r(Op,[2,455]),r(Op,[2,456]),{279:[2,458]},r(Bg,[2,207]),r(Bg,[2,208]),r(Bg,[2,209]),r(Bg,[2,210]),r(Qn,[2,201]),r(Qn,[2,202]),r(Qn,[2,203]),r(Qn,[2,204]),r(Qn,[2,205]),r(Qn,[2,206]),r(e,[2,5]),r(Ug,[2,297],{88:295}),r(Vg,[2,299],{90:296}),{48:[1,297],87:[1,298]},r(Gg,[2,301]),r(ve,[2,43]),r(ve,[2,82]),r(ve,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},r(c,[2,412]),r(fl,[2,123]),r(fl,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),r(ao,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:Wt,223:312,225:308,226:309,229:KF,307:43,308:h},r(c,i,{215:10,214:314}),r(ao,[2,236]),r(ao,[2,237]),r(Bu,[2,6]),r(fv,[2,287],{60:315,72:316,73:[1,317]}),r(Qt,[2,286]),{13:f,16:d,45:V,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r([6,31,63,70,73,81,83,85],[2,20]),r(w,HF,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Jo,31:Jo,85:Jo,112:Jo,159:Jo,160:Jo,161:Jo,163:Jo,164:Jo,41:s}),{13:f,16:d,55:331,307:43,308:h},r(j,[2,280]),r(Bu,[2,7]),r(Qt,it,{59:197,69:198,20:332,70:me}),r(be,[2,284]),{64:[1,333]},r(be,we,{58:205,62:206,23:334,63:Ze}),r(l,[2,254]),r(w,$g,{144:248,30:335,143:336,31:[2,257]}),r(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:p,139:342,186:339,190:340,195:341,197:dl,307:43,308:h},r(xp,[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:p,197:dl,308:h}),r(Zo,[2,227]),r(Zo,[2,228]),r(Zo,[2,229]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,172:221,185:351,187:350,200:348,230:347,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:dl,307:43,308:h},r(Zo,[2,146]),r(Zo,[2,147]),r(Zo,[2,148]),r(Zo,[2,149]),{13:f,16:d,44:354,55:355,82:K,87:p,172:357,237:356,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:358,312:Xn,313:353},r(dv,[2,215]),r(dv,[2,216]),r(be,we,{58:205,62:206,23:359,63:Ze}),r(R,[2,264]),r(kF,[2,266]),r(Bu,[2,11]),r(n,[2,308],{6:[2,310]}),r(hn,[2,313],{102:360,120:361,121:[1,362]}),r(hn,[2,47]),r(hn,[2,63]),r(hn,[2,64]),{13:f,16:d,55:363,307:43,308:h},r(hn,[2,336]),r(hn,[2,337]),r(hn,[2,338]),{109:[1,364]},r(YF,[2,60]),{13:f,16:d,55:365,307:43,308:h},r(j,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},r(pl,[2,341],{137:368}),r(pl,[2,340]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,145:369,172:221,185:213,187:214,231:pn,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},{28:[1,370],127:371,128:[1,372]},r(cc,[2,330],{124:373,125:374,126:k}),r(cc,[2,57]),{44:375,87:p},r(VF,[2,151],{241:376,242:[1,377]}),r(jg,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,247:380,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{250:[1,381]},r(Fr,[2,432]),r(Fr,[2,433]),r(Fr,[2,434]),r(Fr,[2,435]),r(Fr,[2,436]),r(Fr,[2,437]),{250:[2,439]},r([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:J,298:ue,299:Se,300:Oe,301:We,302:Ne}),r(ju,[2,162],{261:388,262:389,39:pv,338:hv}),r(Zr,[2,164]),r(Zr,[2,165]),r(Zr,[2,166]),r(Pr,[2,95]),r(Pr,[2,96]),r(Fr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},r(Pr,[2,177]),{13:f,16:d,44:136,45:V,46:395,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:396,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:397,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:398,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:399,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,183]),r(Pr,[2,98]),r(Fr,[2,381],{180:400}),{87:[1,401]},r(Pr,[2,185]),{13:f,16:d,44:136,45:V,46:402,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{29:ge,57:403},r(Qn,[2,193]),{13:f,16:d,55:404,307:43,308:h},{13:f,16:d,44:39,55:40,87:p,139:342,195:405,197:dl,307:43,308:h},r(lc,[2,233]),r(lc,[2,234]),r(lc,[2,235]),r(XF,[2,459],{281:406,325:[1,407]}),r(Fr,[2,463],{284:408,325:[1,409]}),r(Fr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:K,171:413,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,419],89:[1,420]},{29:[1,421]},r(Gg,[2,302]),r(Ug,[2,367],{167:422}),r(Vg,[2,369],{168:423}),{48:[1,424],87:[1,425]},r(Gg,[2,371]),r(fl,[2,122]),r(fl,[2,417]),r(fl,[2,413]),r(fl,[2,414]),r(fl,[2,415]),r(ao,[2,125]),r(ao,[2,127]),r(ao,[2,128]),r(QF,[2,420],{227:426}),r(ao,[2,130]),{13:f,16:d,55:194,197:Wt,223:427,307:43,308:h},{48:[1,428]},r(uc,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),r(fv,[2,288]),{64:[1,433]},r(Qt,[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:V,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(JF,[2,293]),r(mv,[2,92]),r(mv,[2,93]),r(mv,[2,94]),{45:GF,89:qF,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:_,29:A,56:85},{19:438,28:_,29:A,56:85},r(hl,[2,355],{149:439}),r(hl,[2,354]),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,156:440,172:221,185:441,203:442,231:Kg,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(R,[2,19]),r(uc,[2,21]),{13:f,16:d,44:450,45:ZF,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Bu,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},r(w,[2,386],{31:[2,388]}),r(xp,[2,102]),r(ml,[2,391],{191:452}),r(w,[2,395],{196:453,198:454}),r(w,[2,108]),r(w,[2,109]),r(xp,[2,103]),r(xp,[2,104]),r(xp,[2,390]),{13:f,16:d,44:215,45:Tt,48:[1,455],55:220,82:K,87:p,89:At,172:221,185:351,187:350,200:456,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Hg,[2,424]),r(eD,[2,136]),r(eD,[2,137]),r(gv,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:dl,307:43,308:h},r(lc,[2,219]),r(lc,[2,220]),r(lc,[2,221]),r(lc,[2,222]),r(lc,[2,223]),r(Bu,[2,10]),r(hn,[2,46]),r(hn,[2,314]),{112:MF,122:459},r(hn,[2,62]),r(j,$F,{133:242,108:460,112:jF,132:BF}),r(YF,[2,61]),r(hn,[2,49]),r([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},r(pl,[2,351],{146:463,335:[1,464]}),{29:ge,57:465},r(cc,[2,329]),r(j,[2,332],{129:466,327:[1,467]}),r(cc,[2,55]),r(cc,[2,331]),{48:[1,468]},r(jg,[2,429]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r($u,[2,431]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,243:470,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r($u,[2,156]),{45:WF,89:zF,179:471},r(ju,[2,441]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,251:472,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Zr,[2,444],{256:473}),r(Zr,[2,446],{258:474}),r(Fr,[2,442]),r(Fr,[2,443]),r(Zr,[2,449]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,255:154,257:155,259:475,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,450]),r(Fr,[2,451]),r(Fr,[2,379],{178:476}),r(Fr,[2,378]),r([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:V,46:482,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{48:[1,483]},{48:[1,484]},r(Pr,[2,187]),r(Qn,[2,194]),{13:f,16:d,44:39,55:40,82:K,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,320:485},{13:f,16:d,39:[1,487],44:136,45:V,46:488,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,282:486,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(XF,[2,460]),{13:f,16:d,44:136,45:V,46:489,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,464]),{13:f,16:d,44:136,45:V,46:490,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,466]),r(ve,[2,40]),r(Ug,[2,298]),r(Pp,[2,87]),r(Pp,[2,88]),r(Pp,[2,89]),r(Pp,[2,90]),{13:f,16:d,55:492,82:K,172:493,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,311:494,312:Xn,315:491},r(ve,[2,41]),r(Vg,[2,300]),r(Fp,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:K,171:497,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,498],89:[1,499]},{29:[1,500]},r(Gg,[2,372]),{13:f,16:d,48:[2,422],55:194,197:Wt,223:312,226:502,228:501,229:KF,307:43,308:h},r(ao,[2,131]),r(ao,[2,126]),r(uc,[2,22]),r(uc,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:V,55:323,67:321,68:322,74:505,75:506,76:tD,77:320,78:rD,79:509,87:p,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r(JF,[2,294]),r(nD,[2,69]),r(nD,[2,70]),r(Qt,it,{59:197,69:198,20:511,70:me}),r(be,we,{58:205,62:206,23:512,63:Ze}),{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},r(hl,[2,363],{157:524,335:[1,525]}),r(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),r(Yg,[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:p}),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,172:221,185:351,203:536,212:534,231:Kg,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),r(be,[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:ZF,87:p,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(gl,[2,291]),r(gl,[2,24]),r(gl,[2,25]),{13:f,16:d,44:136,45:V,46:539,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(gl,[2,28]),r(be,we,{58:205,62:206,23:540,63:Ze}),r([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),r(ml,[2,107]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,172:221,185:351,187:350,199:543,200:544,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(iD,[2,132]),r(Hg,[2,425]),r(iD,[2,133]),{13:f,16:d,44:354,55:355,82:K,87:p,172:357,237:356,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:358,312:Xn,313:545},r(hn,[2,54]),r(hn,[2,48]),r(pl,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},r(pl,[2,68]),r(w,[2,350],{31:sD,112:sD}),r(hn,[2,53]),{13:f,16:d,55:547,307:43,308:h},r(j,[2,333]),r(re,[2,16]),r(jg,[2,152]),r($u,[2,154]),r($u,[2,157]),r(ju,[2,159]),r(ju,[2,160],{262:389,261:548,39:pv,338:hv}),r(ju,[2,161],{262:389,261:549,39:pv,338:hv}),r(Zr,[2,163]),{13:f,16:d,44:136,45:V,46:550,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,178]),r(Pr,[2,179]),{13:f,16:d,44:136,45:V,46:551,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:552,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:553,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{48:[1,554],272:[1,555]},r(Pr,[2,184]),r(Pr,[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:Wt,223:562,307:43,308:h},r(yv,[2,224]),r(yv,[2,225]),r(yv,[2,226]),{31:[1,563],45:oD,94:564},r(ve,[2,84]),r(Ug,[2,368]),r(ve,[2,85]),r(Vg,[2,370]),r(Fp,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},r(uc,[2,35],{83:[1,569]}),r(uc,[2,36],{81:[1,570]}),r(fv,[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:V,76:tD,78:rD,87:p,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(Uu,[2,295]),{45:V,77:572},{45:V,77:573},r(Uu,[2,33]),r(Uu,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},r(hl,[2,356]),r(aD,[2,357],{152:578,335:[1,579]}),r(ea,[2,74]),{29:ge,57:580},{29:ge,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},r(cD,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:V,55:323,67:321,68:322,77:320,79:585,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},{45:[1,586]},r(ea,[2,81]),{29:ge,57:587},r(hl,[2,73]),r(w,[2,362],{29:ta,31:ta,85:ta,112:ta,159:ta,160:ta,161:ta,163:ta,164:ta}),r(Yg,[2,112]),r(Vu,[2,401],{206:588}),r(w,[2,405],{209:589,210:590}),r(w,[2,403]),r(w,[2,404]),r(Yg,[2,113]),r(Yg,[2,400]),{13:f,16:d,44:215,45:zg,48:[1,591],55:220,82:K,87:p,89:At,172:221,185:351,203:536,212:592,231:Kg,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Hg,[2,426]),r(gv,[2,138]),r(gv,[2,139]),{232:[1,593]},r(gl,[2,292]),{47:[1,595],48:[1,594]},r(Bu,[2,9]),r(ml,[2,392]),r(ml,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:dl,308:h}),r(ml,[2,110],{272:[1,598]}),r(Xg,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},r(cc,[2,58]),r(Zr,[2,445]),r(Zr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},r(Pr,[2,99]),r(Fr,[2,382]),r([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]),r(Pr,[2,188]),r(Pr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:K,172:493,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,311:494,312:Xn,315:611},r(ve,[2,42]),r(Fp,[2,304]),{13:f,16:d,55:414,82:K,95:612,171:613,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,614],45:oD,94:615},r(ao,[2,129]),r(QF,[2,421]),{82:[1,616]},{82:[1,617]},r(Uu,[2,296]),r(Uu,[2,31]),r(Uu,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},r(w,HF,{155:330,153:618,154:619,29:ra,31:ra,85:ra,112:ra,159:ra,160:ra,161:ra,163:ra,164:ra}),r(aD,[2,358]),r(ea,[2,75]),r(ea,[2,76]),{29:ge,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},r(cD,[2,366]),r(ea,[2,79]),{13:f,16:d,44:136,45:V,46:622,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(ea,[2,91],{336:[1,623]}),r([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),r(Vu,[2,117]),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,172:221,185:351,203:536,211:626,212:627,231:Kg,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Zo,[2,134]),r(Hg,[2,427]),r(Zo,[2,135]),r(gl,[2,26]),{44:628,87:p},r(ml,[2,106]),r(ml,[2,394]),r(w,[2,396]),r(Xg,[2,111]),r(Xg,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:dl,307:43,308:h},r(dv,[2,217]),r(w,$g,{144:248,140:630,143:631,31:[2,343]}),r(Pr,[2,97]),r(Fr,[2,380]),r(Pr,[2,180]),{13:f,16:d,44:136,45:V,46:632,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:633,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:K,171:637,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},r(lD,[2,305]),r(ve,[2,86]),r(Fp,[2,374]),r(uc,[2,37]),r(uc,[2,38]),r(hl,[2,72]),r(hl,[2,360]),r(ea,[2,77]),{29:ge,57:638},{47:[1,639]},{29:[2,376]},r(Vu,[2,402]),r(Vu,[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:p}),r(Vu,[2,118],{272:[1,641]}),r(Qg,[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:ke,304:ze,305:xe,306:Ve},r(Pp,[2,218]),r(Fp,[2,44]),r(lD,[2,306]),r(ea,[2,78]),{44:651,87:p},r(Vu,[2,116]),r(w,[2,406]),r(Qg,[2,119]),r(Qg,[2,408]),r(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),r(gl,[2,27]),r(Xg,[2,230]),r(uD,[2,345],{141:653,335:[1,654]}),r(Pr,[2,181]),r(Pr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},r(w,$g,{144:248,142:657,143:658,31:fD,112:fD}),r(uD,[2,346]),r(ea,[2,80]),r(Qg,[2,231]),r(pl,[2,67]),r(pl,[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(L,W){if(W.recoverable)this.trace(L);else{var ne=new Error(L);throw ne.hash=W,ne}},"parseError"),parse:a(function(L){var W=this,ne=[0],De=[],tt=[null],v=[],Zn=this.table,I="",uo=0,kp=0,ty=0,ry=2,Mp=1,ny=v.slice.call(arguments,1),hr=Object.create(this.lexer),fo={yy:{}};for(var $p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$p)&&(fo.yy[$p]=this.yy[$p]);hr.setInput(L,fo.yy),fo.yy.lexer=hr,fo.yy.parser=this,typeof hr.yylloc>"u"&&(hr.yylloc={});var Ku=hr.yylloc;v.push(Ku);var zt=hr.options&&hr.options.ranges;typeof fo.yy.parseError=="function"?this.parseError=fo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ar(po){ne.length=ne.length-2*po,tt.length=tt.length-po,v.length=v.length-po}a(ar,"popStack");for(var It=a(function(){var po;return po=hr.lex()||Mp,typeof po!="number"&&(po=W.symbols_[po]||po),po},"lex"),kt,Si,Sl,es,Nve,xv,Hu={},iy,sa,vD,sy;;){if(Sl=ne[ne.length-1],this.defaultActions[Sl]?es=this.defaultActions[Sl]:((kt===null||typeof kt>"u")&&(kt=It()),es=Zn[Sl]&&Zn[Sl][kt]),typeof es>"u"||!es.length||!es[0]){var Pv="";sy=[];for(iy in Zn[Sl])this.terminals_[iy]&&iy>ry&&sy.push("'"+this.terminals_[iy]+"'");hr.showPosition?Pv="Parse error on line "+(uo+1)+`:
88
+ `)}a(cJ,"blockScalarAsSequenceItem");function C3(r){if(_0(r))return W1(r);if(!q1(r)&&!oJ(r))return r;try{let e=b0.load(r);return typeof e=="string"?e:r}catch{return r}}a(C3,"decodeYamlQuotedScalar");function lJ(r,e=!1,t){return typeof r!="string"?String(r):I3(r,e,t)?R3(r):r}a(lJ,"serializeYamlScalar");function uJ(r){return/^\[\[[\s\S]*\]\]$/.test(r.trim())}a(uJ,"isUnquotedWikilink");function O3(r){if(r==="")return'an empty string (writes a junk `prop: ""` key)';if(r===null)return"null (writes `prop: null`, which a YAML reader sees as null)";if(Array.isArray(r)&&r.length===0)return"an empty list (writes a BARE `prop:` key, which a YAML reader sees as null)"}a(O3,"emptyPropertyValueForm");function fJ(r){return O3(r)!==void 0}a(fJ,"isEmptyPropertyValue")});var Ml=T(lf=>{"use strict";Object.defineProperty(lf,"__esModule",{value:!0});lf.bytesToBase64=P3;lf.base64ToBytes=F3;lf.base64ToUtf8=dJ;lf.utf8ToBase64=pJ;var x3=32768;function P3(r){let e="";for(let t=0;t<r.length;t+=x3)e+=String.fromCharCode(...r.subarray(t,t+x3));return btoa(e)}a(P3,"bytesToBase64");function F3(r){let e=r.replace(/\s/g,""),t=e.length%4,n=t===2||t===3?e+"=".repeat(4-t):e,i=atob(n),s=new Uint8Array(i.length);for(let o=0;o<i.length;o++)s[o]=i.charCodeAt(o);return s}a(F3,"base64ToBytes");function dJ(r){return new TextDecoder("utf-8",{ignoreBOM:!0}).decode(F3(r))}a(dJ,"base64ToUtf8");function pJ(r){return P3(new TextEncoder().encode(r))}a(pJ,"utf8ToBase64")});var yc=T(z1=>{"use strict";Object.defineProperty(z1,"__esModule",{value:!0});z1.iriToObsidianName=mJ;var hJ=Rt();function mJ(r){let e=hJ.Namespace.fromTermIRI(r);if(e)return`${e.namespace.prefix}__${e.localName}`;let t=r.match(/\/([^/]+)\.md$/);return t?t[1]:null}a(mJ,"iriToObsidianName")});var E0=T(w0=>{"use strict";Object.defineProperty(w0,"__esModule",{value:!0});w0.findUidByAssetLabel=gJ;w0.labelTermBearers=N3;var D3=Le(),L3=Ye(),S0=Rt();async function gJ(r,e){let t=S0.Namespace.EXO.term("Asset_label"),n=yJ(e);if(n){let[i]=await N3(r,n);if(i)return i.uid}for(let i of await r.match(void 0,t,void 0))if(i.object instanceof L3.Literal&&i.object.value===e&&i.subject instanceof D3.IRI){let s=await k3(r,i.subject);if(s)return s}return null}a(gJ,"findUidByAssetLabel");async function N3(r,e){let t=[],n=new Set;for(let i of await r.match(void 0,S0.Namespace.EXO.term("Asset_label"),e)){if(!(i.subject instanceof D3.IRI))continue;let s=await k3(r,i.subject);!s||n.has(s)||(n.add(s),t.push({subject:i.subject,uid:s}))}return t}a(N3,"labelTermBearers");function yJ(r){if(/\s/.test(r))return null;let e=S0.Namespace.fromPropertyKey(r);if(!e||/[\s()]/.test(e.localName))return null;try{return e.namespace.term(e.localName)}catch{return null}}a(yJ,"labelTermIRI");async function k3(r,e){let t=await r.match(e,S0.Namespace.EXO.term("Asset_uid"),void 0);return t.length>0&&t[0].object instanceof L3.Literal?t[0].object.value:null}a(k3,"uidOf")});var M3=T(v0=>{"use strict";Object.defineProperty(v0,"__esModule",{value:!0});v0.mergePropertyDefaults=bJ;v0.mergeInheritanceRules=_J;function bJ(r,e){let t=new Map;for(let s of e)t.set(s.propertyName,s);let n=[],i=new Set;for(let s of r){let o=t.get(s.propertyName);o?(n.push(o),i.add(o.propertyName)):n.push(s)}for(let s of e)i.has(s.propertyName)||n.push(s);return n}a(bJ,"mergePropertyDefaults");function _J(r,e){let t=new Map;for(let s of e){let o=t.get(s.targetPropertyName);o?o.push(s):t.set(s.targetPropertyName,[s])}let n=[],i=new Set;for(let s of r){let o=t.get(s.targetPropertyName);o?i.has(s.targetPropertyName)||(n.push(...o),i.add(s.targetPropertyName)):n.push(s)}for(let s of e)i.has(s.targetPropertyName)||n.push(s);return n}a(_J,"mergeInheritanceRules")});var K1=T(($Ie,$3)=>{var uf=class{static{a(this,"Wildcard")}constructor(){return SJ||this}equals(e){return e&&this.termType===e.termType}};Object.defineProperty(uf.prototype,"value",{enumerable:!0,value:"*"});Object.defineProperty(uf.prototype,"termType",{enumerable:!0,value:"Wildcard"});var SJ=new uf;$3.exports.Wildcard=uf});var B3=T((BIe,j3)=>{var wJ=(function(){var r=a(function(M,L,W,ne){for(W=W||{},ne=M.length;ne--;W[M[ne]]=L);return W},"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],n=[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],p=[1,41],h=[1,44],g=[123,126],m=[1,67],b=[39,45,87],S=[13,16,45,197,224,308],_=[1,87],A=[2,281],E=[1,86],w=[13,16,45,82,87,89,231,294,295,296,297,298,299,300,301,302,303,304,305,306,308,309,310,312],R=[6,28,29,53,63,70,73,81,83,85],O=[6,13,16,28,29,53,63,70,73,81,83,85,87,308],P=[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],N=[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],j=[13,16,308],U=[112,132,327,334],G=[13,16,112,132,308],$=[1,111],k=[1,117],te=[112,132,327,328,334],Z=[13,16,112,132,308,328],re=[28,29,45,53,87],V=[1,138],K=[1,151],he=[1,128],He=[1,127],ce=[1,129],ee=[1,140],H=[1,141],Y=[1,142],ie=[1,143],Ce=[1,144],B=[1,145],fe=[1,147],ae=[1,148],Ie=[2,457],ye=[1,158],Te=[1,159],Re=[1,160],pe=[1,152],q=[1,153],F=[1,156],J=[1,171],ue=[1,172],Se=[1,173],Oe=[1,174],We=[1,175],Ne=[1,176],ke=[1,167],ze=[1,168],xe=[1,169],Ve=[1,170],rt=[1,157],ot=[1,166],nt=[1,161],C=[1,162],x=[1,163],D=[1,164],z=[1,165],ve=[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],Wt=[1,195],Qt=[6,31,73,81,83,85],it=[2,285],me=[1,199],ge=[1,201],be=[6,31,70,73,81,83,85],we=[2,283],Ze=[1,207],Tt=[1,218],At=[1,223],pn=[1,219],_i=[1,225],Ui=[1,226],Xn=[1,224],kF=[6,63,70,73,81,83,85],MF=[1,236],$F=[2,334],jF=[1,243],BF=[1,241],hn=[6,193],$g=[2,349],UF=[2,339],cc=[28,128],VF=[47,48,193,272],jg=[47,48,193,242,272],$u=[47,48,193,242,246,272],ju=[47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,341,342,343,344,345,346],Zr=[39,47,48,193,242,246,250,263,265,272,290,297,298,299,300,301,302,338,341,342,343,344,345,346],GF=[1,271],qF=[1,270],Pr=[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],WF=[1,281],zF=[1,280],Qn=[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],Op=[45,89],Bg=[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],Ug=[13,16,31,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Vg=[31,89],Gg=[48,87],fl=[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],ao=[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],KF=[1,313],Bu=[6,85],fv=[6,31,81,83,85],HF=[2,361],Jo=[2,353],dl=[1,343],xp=[31,112,335],Zo=[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],dv=[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],YF=[6,109,193],pl=[31,112],Fr=[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],pv=[1,390],hv=[1,391],lc=[13,16,87,197,308,314],XF=[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],qg=[1,417],Wg=[1,418],QF=[13,16,48,197,229,308],uc=[6,31,85],JF=[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],mv=[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],hl=[29,31,85,112,159,160,161,163,164],zg=[1,443],Kg=[1,444],ZF=[1,449],ml=[31,112,193,232,318,335],Hg=[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],eD=[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],gv=[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],Pp=[13,16,31,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Fp=[31,45],tD=[1,507],rD=[1,508],nD=[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],Yg=[29,31,85,112,159,160,161,163,164,335],gl=[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],iD=[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],sD=[2,352],yv=[13,16,197,308,314],oD=[1,565],Uu=[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],aD=[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],ea=[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],cD=[13,16,87,308],ta=[2,364],Vu=[29,31,85,112,159,160,161,163,164,193,232,318,335],Xg=[31,112,193,232,272,318,335],ra=[2,359],lD=[13,16,48,82,174,294,295,296,297,298,299,300,301,302,303,304,305,306,308,312],Qg=[29,31,85,112,159,160,161,163,164,193,232,272,318,335],uD=[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],fD=[2,347],bv={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(L,W,ne,De,tt,v,Zn){var I=v.length-1;switch(tt){case 1:if(v[I-1]=v[I-1]||{},at.base&&(v[I-1].base=at.base),at.base="",v[I-1].prefixes=at.prefixes,at.prefixes=null,at.pathOnly){if(v[I-1].type==="path"||"termType"in v[I-1])return v[I-1];throw new Error("Received full SPARQL query in path only mode")}else if(v[I-1].type==="path"||"termType"in v[I-1])throw new Error("Received only path in full SPARQL mode");if(v[I-1].type==="update"){let zt={};for(let ar of v[I-1].updates)if(ar.updateType==="insert"){let It={};for(let kt of ar.insert)if(kt.type==="bgp"||kt.type==="graph")for(let Si of kt.triples)Si.subject.termType==="BlankNode"&&(It[Si.subject.value]=!0),Si.predicate.termType==="BlankNode"&&(It[Si.predicate.value]=!0),Si.object.termType==="BlankNode"&&(It[Si.object.value]=!0);for(let kt of Object.keys(It)){if(zt[kt])throw new Error("Detected reuse blank node across different INSERT DATA clauses");zt[kt]=!0}}}return v[I-1];case 2:this.$={...v[I-1],...v[I],type:"query"};break;case 4:at.base=Dp(v[I]);break;case 5:at.prefixes||(at.prefixes={}),v[I-1]=v[I-1].substr(0,v[I-1].length-1),v[I]=Dp(v[I]),at.prefixes[v[I-1]]=v[I];break;case 6:this.$={...v[I-3],..._l(v[I-2]),...v[I-1],...v[I]};break;case 7:if(!at.skipValidation&&(Iv(v[I-3].variables.map(ar=>Av(ar.expression))).some(ar=>ar.aggregation==="count"&&!(ar.expression instanceof Jg))||v[I].group)){for(let ar of v[I-3].variables)if(ar.termType==="Variable"){if(!v[I].group||!v[I].group.map(It=>zu(It)).includes(zu(ar)))throw Error("Projection of ungrouped variable (?"+zu(ar)+")")}else if(Av(ar.expression).length===0){let It=Rq(ar.expression);for(let kt of It)if(!v[I].group||!v[I].group.map||!v[I].group.map(Si=>zu(Si)).includes(zu(kt)))throw Error("Use of ungrouped variable in projection of operation (?"+zu(kt)+")")}}let fo=v[I-1].where.filter(zt=>zt.type==="query");if(fo.length>0){let zt=v[I-3].variables.filter(It=>It.variable&&It.variable.value).map(It=>It.variable.value),ar=Iv(fo.map(It=>It.variables)).map(It=>It.value||It.variable.value);for(let It of zt)if(ar.indexOf(It)>=0)throw Error("Target id of 'AS' (?"+It+") already used in subquery")}this.$=vr(v[I-3],_l(v[I-2]),v[I-1],v[I]);break;case 8:this.$=vr({queryType:"CONSTRUCT",template:v[I-3]},_l(v[I-2]),v[I-1],v[I]);break;case 9:this.$=vr({queryType:"CONSTRUCT",template:v[I-2]=v[I-2]?v[I-2].triples:[]},_l(v[I-5]),{where:[{type:"bgp",triples:bl([],v[I-2])}]},v[I]);break;case 10:this.$=vr({queryType:"DESCRIBE",variables:v[I-3]==="*"?[new Jg]:v[I-3]},_l(v[I-2]),v[I-1],v[I]);break;case 11:this.$=vr({queryType:"ASK"},_l(v[I-2]),v[I-1],v[I]);break;case 12:this.$=vr(v[I-1],{variables:[new Jg]});break;case 13:let $p=v[I].map(zt=>zt.value||zt.variable.value),Ku=Cq($p);if(Ku.length>0)throw Error("Two or more of the resulting columns have the same name (?"+Ku[0]+")");this.$=vr(v[I-1],{variables:v[I]});break;case 14:this.$=vr({queryType:"SELECT"},v[I]&&(v[I-1]=Jn(v[I]),v[I]={},v[I][v[I-1]]=!0,v[I]));break;case 16:case 27:this.$=Gu(v[I-3],{variable:v[I-1]});break;case 17:case 18:this.$=vr(v[I-3],v[I-2],v[I-1],v[I],{type:"query"});break;case 19:case 58:this.$={iri:v[I],named:!!v[I-1]};break;case 20:this.$={where:v[I].patterns};break;case 21:this.$=vr(v[I-1],v[I]);break;case 22:this.$=vr(v[I-2],v[I-1],v[I]);break;case 23:this.$={group:v[I]};break;case 24:case 25:case 28:case 31:case 33:case 34:this.$=Gu(v[I]);break;case 26:this.$=Gu(v[I-1]);break;case 29:this.$={having:v[I]};break;case 30:this.$={order:v[I]};break;case 32:this.$=Gu(v[I],{descending:!0});break;case 35:this.$={limit:Wu(v[I])};break;case 36:this.$={offset:Wu(v[I])};break;case 37:this.$={limit:Wu(v[I-2]),offset:Wu(v[I])};break;case 38:this.$={limit:Wu(v[I]),offset:Wu(v[I-2])};break;case 39:case 43:this.$={type:"values",values:v[I]};break;case 40:case 84:this.$=v[I-1].map(zt=>({[v[I-3]]:zt}));break;case 41:case 85:this.$=v[I-1].map(()=>({}));break;case 42:case 86:var uo=v[I-4].length;v[I-4]=v[I-4].map(_v),this.$=v[I-1].map(function(zt){if(zt.length!==uo)throw Error("Inconsistent VALUES length");for(var ar={},It=0;It<uo;It++)ar["?"+v[I-4][It].value]=zt[It];return ar});break;case 44:case 65:case 100:case 126:case 175:this.$=v[I-1];break;case 45:this.$={type:"update",updates:na(v[I-2],v[I-1])};break;case 46:this.$=vr({type:"load",silent:!!v[I-2],source:v[I-1]},v[I]&&{destination:v[I]});break;case 47:this.$={type:Jn(v[I-2]),silent:!!v[I-1],graph:v[I]};break;case 48:this.$={type:Jn(v[I-4]),silent:!!v[I-3],source:v[I-2],destination:v[I]};break;case 49:this.$={type:"create",silent:!!v[I-2],graph:{type:"graph",name:v[I]}};break;case 50:this.$={updateType:"insert",insert:ED(v[I])};break;case 51:this.$={updateType:"delete",delete:Ov(ED(v[I]))};break;case 52:this.$={updateType:"deletewhere",delete:Ov(v[I])};break;case 53:this.$={updateType:"insertdelete",...v[I-4],...v[I-3],..._l(v[I-2],"using"),where:v[I].patterns};break;case 54:case 57:case 62:case 167:case 191:case 236:this.$=v[I];break;case 55:this.$={delete:Ov(v[I-1]),insert:v[I]||[]};break;case 56:this.$={delete:[],insert:v[I]};break;case 59:this.$={graph:v[I]};break;case 60:this.$={type:"graph",default:!0};break;case 61:case 63:this.$={type:"graph",name:v[I]};break;case 64:this.$={[Jn(v[I])]:!0};break;case 66:this.$=v[I-1]?co(v[I],[v[I-1]]):co(v[I]);break;case 67:var kp=vr(v[I-3]||{triples:[]},{type:"graph",name:v[I-5]});this.$=v[I]?[kp,v[I]]:[kp];break;case 68:case 73:this.$={type:"bgp",triples:co(v[I-2],[v[I-1]])};break;case 69:this.$={type:"group",patterns:[v[I-1]]};break;case 70:for(let zt of v[I-1].filter(ar=>ar.type==="bind")){let ar=v[I-1].indexOf(zt),It=new Set;for(let kt of v[I-1].slice(0,ar))(kt.type==="group"||kt.type==="bgp")&&SD(kt).forEach(Si=>It.add(Si));if(It.has(zt.variable.value))throw Error("Variable used to bind is already bound (?"+zt.variable.value+")")}this.$={type:"group",patterns:v[I-1]};break;case 71:this.$=v[I-1]?co([v[I-1]],v[I]):co(v[I]);break;case 72:this.$=v[I]?[v[I-2],v[I]]:v[I-2];break;case 75:this.$=vr(v[I],{type:"optional"});break;case 76:this.$=vr(v[I],{type:"minus"});break;case 77:this.$=vr(v[I],{type:"graph",name:v[I-1]});break;case 78:this.$=vr(v[I],{type:"service",name:v[I-1],silent:!!v[I-2]});break;case 79:this.$={type:"filter",expression:v[I]};break;case 80:this.$={type:"bind",variable:v[I-1],expression:v[I-3]};break;case 89:this.$=Np(v[I]);break;case 90:this.$=void 0;break;case 91:this.$=v[I-1].length?{type:"union",patterns:co(v[I-1].map(wv),[wv(v[I])])}:v[I];break;case 95:this.$={...v[I],function:v[I-1]};break;case 96:this.$={type:"functionCall",args:[]};break;case 97:this.$={type:"functionCall",args:na(v[I-2],v[I-1]),distinct:!!v[I-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.$=na(v[I-2],v[I-1]);break;case 101:this.$=co(v[I-2],[v[I-1]]);break;case 102:case 112:this.$=Cv(v[I].map(zt=>vr(ia(v[I-1]),zt)));break;case 103:this.$=Cv(bl(v[I].map(zt=>vr(ia(v[I-1].entity),zt)),v[I-1].triples));break;case 105:this.$=co([v[I-1]],v[I]);break;case 106:this.$=co(v[I]);break;case 107:this.$=Tv(v[I-1],v[I]);break;case 109:case 237:this.$=at.factory.namedNode(yq);break;case 110:case 118:this.$=na(v[I-1],v[I]);break;case 111:this.$=v[I]?{annotation:v[I],object:v[I-1]}:v[I-1];break;case 113:this.$=v[I]?Cv(bl(v[I].map(zt=>vr(ia(v[I-1].entity),zt)),v[I-1].triples)):v[I-1].triples;break;case 114:this.$=Tv(...v[I-1],v[I]);break;case 116:this.$=Tv(...v[I]);break;case 117:case 159:case 163:this.$=[v[I-1],v[I]];break;case 119:this.$=v[I]?{object:v[I-1],annotation:v[I]}:v[I-1];break;case 120:this.$=v[I-1].length?qu("|",na(v[I-1],v[I])):v[I];break;case 121:this.$=v[I-1].length?qu("/",na(v[I-1],v[I])):v[I];break;case 122:this.$=v[I]?qu(v[I],[v[I-1]]):v[I-1];break;case 123:this.$=v[I-1]?qu(v[I-1],[v[I]]):v[I];break;case 125:case 131:this.$=qu(v[I-1],[v[I]]);break;case 129:this.$=qu("|",na(v[I-2],v[I-1]));break;case 132:case 134:this.$=Aq(v[I-1]);break;case 133:case 135:this.$=Iq(v[I-1]);break;case 140:this.$={entity:v[I],triples:[]};break;case 145:this.$=_v(v[I]);break;case 149:this.$=at.factory.namedNode(dD);break;case 151:case 153:case 158:case 162:this.$=Sv(v[I-1],v[I]);break;case 152:this.$=["||",v[I]];break;case 154:this.$=["&&",v[I]];break;case 156:this.$=mn(v[I-1],[v[I-2],v[I]]);break;case 157:this.$=mn(v[I-2]?"notin":"in",[v[I-3],v[I]]);break;case 160:this.$=["+",Sv(v[I-1],v[I])];break;case 161:var ty=lo(v[I-1].value.replace("-",""),v[I-1].datatype);this.$=["-",Sv(ty,v[I])];break;case 164:this.$=mn("UPLUS",[v[I]]);break;case 165:this.$=mn(v[I-1],[v[I]]);break;case 166:this.$=mn("UMINUS",[v[I]]);break;case 177:this.$=mn(Jn(v[I-1]));break;case 178:this.$=mn(Jn(v[I-3]),[v[I-1]]);break;case 179:this.$=Np(mn(Jn(v[I-3]),[v[I-1]]));break;case 180:this.$=mn(Jn(v[I-5]),[v[I-3],v[I-1]]);break;case 181:this.$=mn(Jn(v[I-7]),[v[I-5],v[I-3],v[I-1]]);break;case 182:this.$=Np(mn(Jn(v[I-7]),[v[I-5],v[I-3],v[I-1]]));break;case 183:this.$=mn(Jn(v[I-1]),v[I]);break;case 184:this.$=mn("bound",[_v(v[I-1])]);break;case 185:this.$=mn(v[I-1],[]);break;case 186:this.$=mn(v[I-3],[v[I-1]]);break;case 187:this.$=mn(v[I-2]?"notexists":"exists",[wv(v[I])]);break;case 188:case 189:this.$=Gu(v[I-1],{type:"aggregate",aggregation:Jn(v[I-4]),distinct:!!v[I-2]});break;case 190:this.$=Gu(v[I-2],{type:"aggregate",aggregation:Jn(v[I-5]),distinct:!!v[I-3],separator:typeof v[I-1]=="string"?v[I-1]:" "});break;case 192:this.$=lo(v[I]);break;case 193:this.$=wq(v[I-1],Jn(v[I].substr(1)));break;case 194:this.$=lo(v[I-2],v[I]);break;case 195:case 204:this.$=lo(v[I],pD);break;case 196:case 205:this.$=lo(v[I],hD);break;case 197:case 206:this.$=lo(Jn(v[I]),mD);break;case 200:this.$=lo(v[I].toLowerCase(),Sq);break;case 201:this.$=lo(v[I].substr(1),pD);break;case 202:this.$=lo(v[I].substr(1),hD);break;case 203:this.$=lo(v[I].substr(1).toLowerCase(),mD);break;case 207:case 208:this.$=_D(v[I],1);break;case 209:case 210:this.$=_D(v[I],3);break;case 211:this.$=at.factory.namedNode(Dp(v[I]));break;case 213:var ry=v[I].indexOf(":"),Mp=v[I].substr(0,ry),ny=at.prefixes[Mp];if(!ny)throw new Error("Unknown prefix: "+Mp);var hr=Dp(ny+v[I].substr(ry+1));this.$=at.factory.namedNode(hr);break;case 214:if(v[I]=v[I].substr(0,v[I].length-1),!(v[I]in at.prefixes))throw new Error("Unknown prefix: "+v[I]);var hr=Dp(at.prefixes[v[I]]);this.$=at.factory.namedNode(hr);break;case 215:this.$=Lp(v[I].replace(/^(_:)/,""));break;case 216:this.$=Lp();break;case 217:case 218:case 232:this.$=Np(Ev(v[I-3],v[I-2],v[I-1]));break;case 230:case 231:this.$=Np(v[I-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:v[I-1].push(v[I]);break;case 259:case 269:case 291:case 293:case 295:case 301:case 305:case 371:case 424:case 426:this.$=[v[I]];break;case 308:v[I-3].push(v[I-2]);break;case 350:case 362:case 376:case 380:case 382:case 386:case 396:case 406:case 410:case 412:case 421:v[I-2].push(v[I-1]);break}},"anonymous"),table:[r(e,t,{3:1,4:2,10:3}),{1:[3]},r(n,[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}),r([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]},r(c,[2,411],{216:28,217:29}),r(l,[2,249],{18:30}),r(l,[2,251],{22:31}),r(u,[2,255],{25:32,27:33,29:[1,34]}),{13:f,16:d,33:35,39:[1,37],44:39,55:40,87:p,139:38,307:43,308:h,323:36},r(l,[2,267],{37:46}),r(g,[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:m,87:p},r(b,[2,273],{42:68,324:69,325:[1,70],326:[1,71]}),r(e,[2,248]),r(e,[2,245]),r(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]},r([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]}),r(S,[2,418],{218:80,222:81,229:[1,82]}),{19:83,28:_,29:A,52:84,53:E,56:85},{19:88,28:_,29:A,52:89,53:E,56:85},r(l,[2,253],{26:90}),{28:[1,91],52:92,53:E},r(w,[2,385],{181:93,182:94,183:95,31:[2,383]}),r(R,[2,263],{34:96}),r(R,[2,261],{44:39,55:40,307:43,139:97,13:f,16:d,87:p,308:h}),r(R,[2,262]),r(O,[2,259]),r(P,[2,143]),r(P,[2,144]),r([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]),r(N,[2,211]),r(N,[2,212]),r(N,[2,213]),r(N,[2,214]),{19:98,28:_,29:A,52:99,53:E,56:85},{6:[2,309],99:100,193:[1,101]},r(j,[2,311],{101:102,328:[1,103]}),r(U,[2,317],{104:104,328:[1,105]}),r(G,[2,322],{107:106,328:[1,107]}),{111:108,112:[2,324],328:[1,109]},{29:$,114:110},{29:$,114:112},{29:$,114:113},{118:114,123:[1,115],125:116,126:k},r(te,[2,315]),r(te,[2,316]),r(Z,[2,319]),r(Z,[2,320]),r(Z,[2,321]),r(g,[2,327]),{13:f,16:d,55:118,307:43,308:h},r(l,[2,12]),r(l,[2,13],{44:66,43:119,45:m,87:p}),r(re,[2,269]),r(re,[2,15]),{13:f,16:d,44:136,45:V,46:120,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(b,[2,14]),r(b,[2,274]),r(b,[2,271]),r(b,[2,272]),r(e,[2,4]),{13:[1,177]},r(ve,[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},r(c,[2,410]),r([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:Wt,219:189,220:190,223:191,224:[1,192],307:43,308:h},r(S,[2,419]),r(Qt,it,{20:196,59:197,69:198,70:me}),r(l,[2,250]),{29:ge,57:200},r(j,[2,279],{54:202,327:[1,203]}),{29:[2,282]},r(be,we,{23:204,58:205,62:206,63:Ze}),r(l,[2,252]),{19:208,28:_,29:A,52:209,53:E,56:85},{29:[1,210]},r(u,[2,256]),{31:[1,211]},{31:[2,384]},{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,145:212,172:221,185:213,187:214,231:pn,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(kF,[2,265],{56:85,35:227,52:228,19:229,28:_,29:A,53:E}),r(O,[2,260]),r(be,we,{58:205,62:206,23:230,63:Ze}),r(l,[2,268]),{6:[2,45]},r(e,t,{10:3,4:231}),{13:f,16:d,55:232,307:43,308:h},r(j,[2,312]),{105:233,112:MF,122:234,132:[1,237],134:235,327:[1,238],334:[1,239]},r(U,[2,318]),r(j,$F,{108:240,133:242,112:jF,132:BF}),r(G,[2,323]),{112:[1,244]},{112:[2,325]},r(hn,[2,50]),r(w,$g,{135:245,136:246,143:247,144:248,31:UF,112:UF}),r(hn,[2,51]),r(hn,[2,52]),r(cc,[2,328],{119:249}),{29:$,114:250},r(cc,[2,56]),{29:$,114:251},r(g,[2,59]),r(re,[2,270]),{47:[1,252]},r(VF,[2,150]),r(jg,[2,428],{240:253}),r($u,[2,430],{244:254}),r($u,[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]}),r(ju,[2,440],{252:264}),r(Zr,[2,448],{260:265}),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:266,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:267,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,255:154,257:155,264:268,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Zr,[2,167]),r(Zr,[2,168]),r(Zr,[2,169]),r(Zr,[2,170],{176:269,45:GF,89:qF}),r(Zr,[2,171]),r(Zr,[2,172]),r(Zr,[2,173]),r(Zr,[2,174]),{13:f,16:d,44:136,45:V,46:272,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,176]),{89:[1,273]},{45:[1,274]},{45:[1,275]},{45:[1,276]},{45:[1,277]},{45:[1,278]},{45:WF,89:zF,179:279},{45:[1,282]},{45:[1,284],89:[1,283]},{279:[1,285]},r(Qn,[2,192],{292:[1,286],293:[1,287]}),r(Qn,[2,195]),r(Qn,[2,196]),r(Qn,[2,197]),r(Qn,[2,198]),r(Qn,[2,199]),r(Qn,[2,200]),{13:f,16:d,44:39,55:40,82:K,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,320:288},{45:[1,292]},{45:[1,293]},{45:[1,294]},r(Op,[2,452]),r(Op,[2,453]),r(Op,[2,454]),r(Op,[2,455]),r(Op,[2,456]),{279:[2,458]},r(Bg,[2,207]),r(Bg,[2,208]),r(Bg,[2,209]),r(Bg,[2,210]),r(Qn,[2,201]),r(Qn,[2,202]),r(Qn,[2,203]),r(Qn,[2,204]),r(Qn,[2,205]),r(Qn,[2,206]),r(e,[2,5]),r(Ug,[2,297],{88:295}),r(Vg,[2,299],{90:296}),{48:[1,297],87:[1,298]},r(Gg,[2,301]),r(ve,[2,43]),r(ve,[2,82]),r(ve,[2,83]),{29:[1,299]},{29:[1,300]},{87:[1,302],169:301},r(c,[2,412]),r(fl,[2,123]),r(fl,[2,416],{221:303,339:304,39:[1,306],263:[1,307],340:[1,305]}),r(ao,[2,124]),{13:f,16:d,45:[1,311],55:194,89:[1,310],197:Wt,223:312,225:308,226:309,229:KF,307:43,308:h},r(c,i,{215:10,214:314}),r(ao,[2,236]),r(ao,[2,237]),r(Bu,[2,6]),r(fv,[2,287],{60:315,72:316,73:[1,317]}),r(Qt,[2,286]),{13:f,16:d,45:V,55:323,67:321,68:322,71:318,77:320,79:319,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r([6,31,63,70,73,81,83,85],[2,20]),r(w,HF,{38:17,49:324,147:325,17:326,21:327,148:328,154:329,155:330,29:Jo,31:Jo,85:Jo,112:Jo,159:Jo,160:Jo,161:Jo,163:Jo,164:Jo,41:s}),{13:f,16:d,55:331,307:43,308:h},r(j,[2,280]),r(Bu,[2,7]),r(Qt,it,{59:197,69:198,20:332,70:me}),r(be,[2,284]),{64:[1,333]},r(be,we,{58:205,62:206,23:334,63:Ze}),r(l,[2,254]),r(w,$g,{144:248,30:335,143:336,31:[2,257]}),r(l,[2,100]),{31:[2,387],184:337,335:[1,338]},{13:f,16:d,44:39,55:40,87:p,139:342,186:339,190:340,195:341,197:dl,307:43,308:h},r(xp,[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:p,197:dl,308:h}),r(Zo,[2,227]),r(Zo,[2,228]),r(Zo,[2,229]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,172:221,185:351,187:350,200:348,230:347,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},{13:f,16:d,44:39,55:40,87:p,139:342,186:352,190:340,195:341,197:dl,307:43,308:h},r(Zo,[2,146]),r(Zo,[2,147]),r(Zo,[2,148]),r(Zo,[2,149]),{13:f,16:d,44:354,55:355,82:K,87:p,172:357,237:356,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:358,312:Xn,313:353},r(dv,[2,215]),r(dv,[2,216]),r(be,we,{58:205,62:206,23:359,63:Ze}),r(R,[2,264]),r(kF,[2,266]),r(Bu,[2,11]),r(n,[2,308],{6:[2,310]}),r(hn,[2,313],{102:360,120:361,121:[1,362]}),r(hn,[2,47]),r(hn,[2,63]),r(hn,[2,64]),{13:f,16:d,55:363,307:43,308:h},r(hn,[2,336]),r(hn,[2,337]),r(hn,[2,338]),{109:[1,364]},r(YF,[2,60]),{13:f,16:d,55:365,307:43,308:h},r(j,[2,335]),{13:f,16:d,55:366,307:43,308:h},{31:[1,367]},r(pl,[2,341],{137:368}),r(pl,[2,340]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,145:369,172:221,185:213,187:214,231:pn,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},{28:[1,370],127:371,128:[1,372]},r(cc,[2,330],{124:373,125:374,126:k}),r(cc,[2,57]),{44:375,87:p},r(VF,[2,151],{241:376,242:[1,377]}),r(jg,[2,153],{245:378,246:[1,379]}),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,247:380,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{250:[1,381]},r(Fr,[2,432]),r(Fr,[2,433]),r(Fr,[2,434]),r(Fr,[2,435]),r(Fr,[2,436]),r(Fr,[2,437]),{250:[2,439]},r([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:J,298:ue,299:Se,300:Oe,301:We,302:Ne}),r(ju,[2,162],{261:388,262:389,39:pv,338:hv}),r(Zr,[2,164]),r(Zr,[2,165]),r(Zr,[2,166]),r(Pr,[2,95]),r(Pr,[2,96]),r(Fr,[2,377],{177:392,325:[1,393]}),{48:[1,394]},r(Pr,[2,177]),{13:f,16:d,44:136,45:V,46:395,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:396,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:397,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:398,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:399,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,183]),r(Pr,[2,98]),r(Fr,[2,381],{180:400}),{87:[1,401]},r(Pr,[2,185]),{13:f,16:d,44:136,45:V,46:402,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{29:ge,57:403},r(Qn,[2,193]),{13:f,16:d,55:404,307:43,308:h},{13:f,16:d,44:39,55:40,87:p,139:342,195:405,197:dl,307:43,308:h},r(lc,[2,233]),r(lc,[2,234]),r(lc,[2,235]),r(XF,[2,459],{281:406,325:[1,407]}),r(Fr,[2,463],{284:408,325:[1,409]}),r(Fr,[2,465],{286:410,325:[1,411]}),{13:f,16:d,31:[1,412],55:414,82:K,171:413,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,419],89:[1,420]},{29:[1,421]},r(Gg,[2,302]),r(Ug,[2,367],{167:422}),r(Vg,[2,369],{168:423}),{48:[1,424],87:[1,425]},r(Gg,[2,371]),r(fl,[2,122]),r(fl,[2,417]),r(fl,[2,413]),r(fl,[2,414]),r(fl,[2,415]),r(ao,[2,125]),r(ao,[2,127]),r(ao,[2,128]),r(QF,[2,420],{227:426}),r(ao,[2,130]),{13:f,16:d,55:194,197:Wt,223:427,307:43,308:h},{48:[1,428]},r(uc,[2,289],{61:429,80:430,81:[1,431],83:[1,432]}),r(fv,[2,288]),{64:[1,433]},r(Qt,[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:V,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(JF,[2,293]),r(mv,[2,92]),r(mv,[2,93]),r(mv,[2,94]),{45:GF,89:qF,176:269},{31:[1,435]},{31:[1,436]},{19:437,28:_,29:A,56:85},{19:438,28:_,29:A,56:85},r(hl,[2,355],{149:439}),r(hl,[2,354]),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,156:440,172:221,185:441,203:442,231:Kg,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(R,[2,19]),r(uc,[2,21]),{13:f,16:d,44:450,45:ZF,55:323,65:445,66:446,67:447,68:448,87:p,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Bu,[2,8]),{31:[1,451]},{31:[2,258]},{31:[2,101]},r(w,[2,386],{31:[2,388]}),r(xp,[2,102]),r(ml,[2,391],{191:452}),r(w,[2,395],{196:453,198:454}),r(w,[2,108]),r(w,[2,109]),r(xp,[2,103]),r(xp,[2,104]),r(xp,[2,390]),{13:f,16:d,44:215,45:Tt,48:[1,455],55:220,82:K,87:p,89:At,172:221,185:351,187:350,200:456,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Hg,[2,424]),r(eD,[2,136]),r(eD,[2,137]),r(gv,[2,140]),{232:[1,457]},{13:f,16:d,44:39,55:40,87:p,139:342,195:458,197:dl,307:43,308:h},r(lc,[2,219]),r(lc,[2,220]),r(lc,[2,221]),r(lc,[2,222]),r(lc,[2,223]),r(Bu,[2,10]),r(hn,[2,46]),r(hn,[2,314]),{112:MF,122:459},r(hn,[2,62]),r(j,$F,{133:242,108:460,112:jF,132:BF}),r(YF,[2,61]),r(hn,[2,49]),r([6,28,126,128,193],[2,65]),{31:[2,66],112:[1,462],138:461},r(pl,[2,351],{146:463,335:[1,464]}),{29:ge,57:465},r(cc,[2,329]),r(j,[2,332],{129:466,327:[1,467]}),r(cc,[2,55]),r(cc,[2,331]),{48:[1,468]},r(jg,[2,429]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,239:469,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r($u,[2,431]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,243:470,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r($u,[2,156]),{45:WF,89:zF,179:471},r(ju,[2,441]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,251:472,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Zr,[2,444],{256:473}),r(Zr,[2,446],{258:474}),r(Fr,[2,442]),r(Fr,[2,443]),r(Zr,[2,449]),{13:f,16:d,44:136,45:V,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,255:154,257:155,259:475,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,450]),r(Fr,[2,451]),r(Fr,[2,379],{178:476}),r(Fr,[2,378]),r([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:V,46:482,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{48:[1,483]},{48:[1,484]},r(Pr,[2,187]),r(Qn,[2,194]),{13:f,16:d,44:39,55:40,82:K,87:p,139:289,172:291,255:154,257:155,266:290,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,320:485},{13:f,16:d,39:[1,487],44:136,45:V,46:488,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,282:486,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(XF,[2,460]),{13:f,16:d,44:136,45:V,46:489,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,464]),{13:f,16:d,44:136,45:V,46:490,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Fr,[2,466]),r(ve,[2,40]),r(Ug,[2,298]),r(Pp,[2,87]),r(Pp,[2,88]),r(Pp,[2,89]),r(Pp,[2,90]),{13:f,16:d,55:492,82:K,172:493,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,311:494,312:Xn,315:491},r(ve,[2,41]),r(Vg,[2,300]),r(Fp,[2,303],{92:495}),{13:f,16:d,31:[1,496],55:414,82:K,171:497,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,498],89:[1,499]},{29:[1,500]},r(Gg,[2,372]),{13:f,16:d,48:[2,422],55:194,197:Wt,223:312,226:502,228:501,229:KF,307:43,308:h},r(ao,[2,131]),r(ao,[2,126]),r(uc,[2,22]),r(uc,[2,290]),{82:[1,503]},{82:[1,504]},{13:f,16:d,44:510,45:V,55:323,67:321,68:322,74:505,75:506,76:tD,77:320,78:rD,79:509,87:p,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},r(JF,[2,294]),r(nD,[2,69]),r(nD,[2,70]),r(Qt,it,{59:197,69:198,20:511,70:me}),r(be,we,{58:205,62:206,23:512,63:Ze}),{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},r(hl,[2,363],{157:524,335:[1,525]}),r(c,i,{215:10,202:526,205:527,208:528,214:529,44:530,87:p}),r(Yg,[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:p}),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,172:221,185:351,203:536,212:534,231:Kg,233:533,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(c,i,{215:10,205:527,208:528,214:529,44:530,202:537,87:p}),r(be,[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:ZF,87:p,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(gl,[2,291]),r(gl,[2,24]),r(gl,[2,25]),{13:f,16:d,44:136,45:V,46:539,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(gl,[2,28]),r(be,we,{58:205,62:206,23:540,63:Ze}),r([31,112,232,318,335],[2,105],{192:541,193:[1,542]}),r(ml,[2,107]),{13:f,16:d,44:215,45:Tt,55:220,82:K,87:p,89:At,172:221,185:351,187:350,199:543,200:544,231:pn,234:349,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(iD,[2,132]),r(Hg,[2,425]),r(iD,[2,133]),{13:f,16:d,44:354,55:355,82:K,87:p,172:357,237:356,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:358,312:Xn,313:545},r(hn,[2,54]),r(hn,[2,48]),r(pl,[2,342]),{13:f,16:d,44:39,55:40,87:p,139:546,307:43,308:h},r(pl,[2,68]),r(w,[2,350],{31:sD,112:sD}),r(hn,[2,53]),{13:f,16:d,55:547,307:43,308:h},r(j,[2,333]),r(re,[2,16]),r(jg,[2,152]),r($u,[2,154]),r($u,[2,157]),r(ju,[2,159]),r(ju,[2,160],{262:389,261:548,39:pv,338:hv}),r(ju,[2,161],{262:389,261:549,39:pv,338:hv}),r(Zr,[2,163]),{13:f,16:d,44:136,45:V,46:550,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,178]),r(Pr,[2,179]),{13:f,16:d,44:136,45:V,46:551,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:552,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:553,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{48:[1,554],272:[1,555]},r(Pr,[2,184]),r(Pr,[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:Wt,223:562,307:43,308:h},r(yv,[2,224]),r(yv,[2,225]),r(yv,[2,226]),{31:[1,563],45:oD,94:564},r(ve,[2,84]),r(Ug,[2,368]),r(ve,[2,85]),r(Vg,[2,370]),r(Fp,[2,373],{170:566}),{48:[1,567]},{48:[2,423],337:[1,568]},r(uc,[2,35],{83:[1,569]}),r(uc,[2,36],{81:[1,570]}),r(fv,[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:V,76:tD,78:rD,87:p,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,276:fe,277:ae,279:Ie,280:ye,283:Te,285:Re,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z}),r(Uu,[2,295]),{45:V,77:572},{45:V,77:573},r(Uu,[2,33]),r(Uu,[2,34]),{31:[2,275],50:574,84:575,85:o},{31:[2,277],51:576,84:577,85:o},r(hl,[2,356]),r(aD,[2,357],{152:578,335:[1,579]}),r(ea,[2,74]),{29:ge,57:580},{29:ge,57:581},{13:f,16:d,44:39,55:40,87:p,139:582,307:43,308:h},r(cD,[2,365],{162:583,328:[1,584]}),{13:f,16:d,45:V,55:323,67:321,68:322,77:320,79:585,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,307:43,308:h,346:ot,347:nt,348:C,349:x,350:D,351:z},{45:[1,586]},r(ea,[2,81]),{29:ge,57:587},r(hl,[2,73]),r(w,[2,362],{29:ta,31:ta,85:ta,112:ta,159:ta,160:ta,161:ta,163:ta,164:ta}),r(Yg,[2,112]),r(Vu,[2,401],{206:588}),r(w,[2,405],{209:589,210:590}),r(w,[2,403]),r(w,[2,404]),r(Yg,[2,113]),r(Yg,[2,400]),{13:f,16:d,44:215,45:zg,48:[1,591],55:220,82:K,87:p,89:At,172:221,185:351,203:536,212:592,231:Kg,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Hg,[2,426]),r(gv,[2,138]),r(gv,[2,139]),{232:[1,593]},r(gl,[2,292]),{47:[1,595],48:[1,594]},r(Bu,[2,9]),r(ml,[2,392]),r(ml,[2,393],{44:39,55:40,307:43,195:341,139:342,194:596,190:597,13:f,16:d,87:p,197:dl,308:h}),r(ml,[2,110],{272:[1,598]}),r(Xg,[2,397],{201:599,316:600,317:[1,601]}),{314:[1,602]},{29:[1,603]},r(cc,[2,58]),r(Zr,[2,445]),r(Zr,[2,447]),{48:[1,604],272:[1,605]},{48:[1,606]},{272:[1,607]},{272:[1,608]},r(Pr,[2,99]),r(Fr,[2,382]),r([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]),r(Pr,[2,188]),r(Pr,[2,189]),{48:[1,609]},{48:[2,468]},{289:[1,610]},{13:f,16:d,55:492,82:K,172:493,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,311:494,312:Xn,315:611},r(ve,[2,42]),r(Fp,[2,304]),{13:f,16:d,55:414,82:K,95:612,171:613,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},{31:[1,614],45:oD,94:615},r(ao,[2,129]),r(QF,[2,421]),{82:[1,616]},{82:[1,617]},r(Uu,[2,296]),r(Uu,[2,31]),r(Uu,[2,32]),{31:[2,17]},{31:[2,276]},{31:[2,18]},{31:[2,278]},r(w,HF,{155:330,153:618,154:619,29:ra,31:ra,85:ra,112:ra,159:ra,160:ra,161:ra,163:ra,164:ra}),r(aD,[2,358]),r(ea,[2,75]),r(ea,[2,76]),{29:ge,57:620},{13:f,16:d,44:39,55:40,87:p,139:621,307:43,308:h},r(cD,[2,366]),r(ea,[2,79]),{13:f,16:d,44:136,45:V,46:622,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(ea,[2,91],{336:[1,623]}),r([29,31,85,112,159,160,161,163,164,232,318,335],[2,114],{207:624,193:[1,625]}),r(Vu,[2,117]),{13:f,16:d,44:215,45:zg,55:220,82:K,87:p,89:At,172:221,185:351,203:536,211:626,212:627,231:Kg,234:535,236:216,237:222,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,309:_i,310:Ui,311:217,312:Xn},r(Zo,[2,134]),r(Hg,[2,427]),r(Zo,[2,135]),r(gl,[2,26]),{44:628,87:p},r(ml,[2,106]),r(ml,[2,394]),r(w,[2,396]),r(Xg,[2,111]),r(Xg,[2,398]),{13:f,16:d,44:39,55:40,87:p,139:342,186:629,190:340,195:341,197:dl,307:43,308:h},r(dv,[2,217]),r(w,$g,{144:248,140:630,143:631,31:[2,343]}),r(Pr,[2,97]),r(Fr,[2,380]),r(Pr,[2,180]),{13:f,16:d,44:136,45:V,46:632,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},{13:f,16:d,44:136,45:V,46:633,55:133,67:132,68:134,77:131,82:K,87:p,172:135,224:he,238:121,239:122,243:123,247:124,251:125,255:154,257:155,259:126,263:He,264:130,265:ce,266:137,267:139,268:ee,269:H,270:Y,271:ie,273:Ce,274:B,275:146,276:fe,277:ae,278:149,279:Ie,280:ye,283:Te,285:Re,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:rt,346:ot,347:nt,348:C,349:x,350:D,351:z},r(Pr,[2,190]),{290:[1,634]},{314:[1,635]},{13:f,16:d,48:[1,636],55:414,82:K,171:637,172:415,173:416,174:qg,255:154,257:155,291:150,294:pe,295:q,296:F,297:J,298:ue,299:Se,300:Oe,301:We,302:Ne,303:ke,304:ze,305:xe,306:Ve,307:43,308:h,312:Wg},r(lD,[2,305]),r(ve,[2,86]),r(Fp,[2,374]),r(uc,[2,37]),r(uc,[2,38]),r(hl,[2,72]),r(hl,[2,360]),r(ea,[2,77]),{29:ge,57:638},{47:[1,639]},{29:[2,376]},r(Vu,[2,402]),r(Vu,[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:p}),r(Vu,[2,118],{272:[1,641]}),r(Qg,[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:ke,304:ze,305:xe,306:Ve},r(Pp,[2,218]),r(Fp,[2,44]),r(lD,[2,306]),r(ea,[2,78]),{44:651,87:p},r(Vu,[2,116]),r(w,[2,406]),r(Qg,[2,119]),r(Qg,[2,408]),r(c,i,{215:10,205:527,208:528,214:529,44:530,202:652,87:p}),r(gl,[2,27]),r(Xg,[2,230]),r(uD,[2,345],{141:653,335:[1,654]}),r(Pr,[2,181]),r(Pr,[2,182]),{48:[2,191]},{48:[1,655]},{318:[1,656]},r(w,$g,{144:248,142:657,143:658,31:fD,112:fD}),r(uD,[2,346]),r(ea,[2,80]),r(Qg,[2,231]),r(pl,[2,67]),r(pl,[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(L,W){if(W.recoverable)this.trace(L);else{var ne=new Error(L);throw ne.hash=W,ne}},"parseError"),parse:a(function(L){var W=this,ne=[0],De=[],tt=[null],v=[],Zn=this.table,I="",uo=0,kp=0,ty=0,ry=2,Mp=1,ny=v.slice.call(arguments,1),hr=Object.create(this.lexer),fo={yy:{}};for(var $p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,$p)&&(fo.yy[$p]=this.yy[$p]);hr.setInput(L,fo.yy),fo.yy.lexer=hr,fo.yy.parser=this,typeof hr.yylloc>"u"&&(hr.yylloc={});var Ku=hr.yylloc;v.push(Ku);var zt=hr.options&&hr.options.ranges;typeof fo.yy.parseError=="function"?this.parseError=fo.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ar(po){ne.length=ne.length-2*po,tt.length=tt.length-po,v.length=v.length-po}a(ar,"popStack");for(var It=a(function(){var po;return po=hr.lex()||Mp,typeof po!="number"&&(po=W.symbols_[po]||po),po},"lex"),kt,Si,Sl,es,kve,xv,Hu={},iy,sa,vD,sy;;){if(Sl=ne[ne.length-1],this.defaultActions[Sl]?es=this.defaultActions[Sl]:((kt===null||typeof kt>"u")&&(kt=It()),es=Zn[Sl]&&Zn[Sl][kt]),typeof es>"u"||!es.length||!es[0]){var Pv="";sy=[];for(iy in Zn[Sl])this.terminals_[iy]&&iy>ry&&sy.push("'"+this.terminals_[iy]+"'");hr.showPosition?Pv="Parse error on line "+(uo+1)+`:
89
89
  `+hr.showPosition()+`
90
90
  Expecting `+sy.join(", ")+", got '"+(this.terminals_[kt]||kt)+"'":Pv="Parse error on line "+(uo+1)+": Unexpected "+(kt==Mp?"end of input":"'"+(this.terminals_[kt]||kt)+"'"),this.parseError(Pv,{text:hr.match,token:this.terminals_[kt]||kt,line:hr.yylineno,loc:Ku,expected:sy})}if(es[0]instanceof Array&&es.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Sl+", token: "+kt);switch(es[0]){case 1:ne.push(kt),tt.push(hr.yytext),v.push(hr.yylloc),ne.push(es[1]),kt=null,Si?(kt=Si,Si=null):(kp=hr.yyleng,I=hr.yytext,uo=hr.yylineno,Ku=hr.yylloc,ty>0&&ty--);break;case 2:if(sa=this.productions_[es[1]][1],Hu.$=tt[tt.length-sa],Hu._$={first_line:v[v.length-(sa||1)].first_line,last_line:v[v.length-1].last_line,first_column:v[v.length-(sa||1)].first_column,last_column:v[v.length-1].last_column},zt&&(Hu._$.range=[v[v.length-(sa||1)].range[0],v[v.length-1].range[1]]),xv=this.performAction.apply(Hu,[I,kp,uo,fo.yy,es[1],tt,v].concat(ny)),typeof xv<"u")return xv;sa&&(ne=ne.slice(0,-1*sa*2),tt=tt.slice(0,-1*sa),v=v.slice(0,-1*sa)),ne.push(this.productions_[es[1]][0]),tt.push(Hu.$),v.push(Hu._$),vD=Zn[ne[ne.length-2]][ne[ne.length-1]],ne.push(vD);break;case 3:return!0}}return!0},"parse")},Jg=K1().Wildcard,Zg="http://www.w3.org/1999/02/22-rdf-syntax-ns#",yq=Zg+"type",bq=Zg+"first",_q=Zg+"rest",dD=Zg+"nil",ey="http://www.w3.org/2001/XMLSchema#",pD=ey+"integer",hD=ey+"decimal",mD=ey+"double",Sq=ey+"boolean",yl="",gD="",yD="";function Jn(M){return M.toLowerCase()}a(Jn,"lowercase");function na(M,L){return M.push(L),M}a(na,"appendTo");function bl(M,L){return M.push.apply(M,L),M}a(bl,"appendAllTo");function vr(M){M||(M={});for(var L=1,W=arguments.length,ne;L<W&&(ne=arguments[L]||{});L++)for(var De in ne)M[De]=ne[De];return M}a(vr,"extend");function co(){for(var M=[],L=0,W=arguments.length;L<W;L++)M=M.concat.apply(M,arguments[L]);return M}a(co,"unionAll");function Dp(M){if(M[0]==="<"&&(M=M.substring(1,M.length-1)),/^[a-z][a-z0-9.+-]*:/i.test(M))return M;if(!at.base)throw new Error("Cannot resolve relative IRI "+M+" because no base IRI was set.");switch(yl!==at.base&&(yl=at.base,gD=yl.replace(/[^\/:]*$/,""),yD=yl.match(/^(?:[a-z]+:\/*)?[^\/]*/)[0]),M[0]){case void 0:return yl;case"#":return yl+M;case"?":return yl.replace(/(?:\?.*)?$/,M);case"/":return yD+M;default:return gD+M}}a(Dp,"resolveIRI");function _v(M){if(M){var L=M[0];if(L==="?"||L==="$")return at.factory.variable(M.substr(1))}return M}a(_v,"toVar");function mn(M,L){return{type:"operation",operator:M,args:L||[]}}a(mn,"operation");function Gu(M,L){var W={expression:M==="*"?new Jg:M};if(L)for(var ne in L)W[ne]=L[ne];return W}a(Gu,"expression");function qu(M,L){return{type:"path",pathType:M,items:L}}a(qu,"path");function Sv(M,L){for(var W=0,ne=L.length,De;W<ne&&(De=L[W]);W++)M=mn(De[0],[M,De[1]]);return M}a(Sv,"createOperationTree");function _l(M,L){var W=[],ne=[],De=M.length,tt,v={};if(!De)return null;for(var Zn=0;Zn<De&&(tt=M[Zn]);Zn++)(tt.named?ne:W).push(tt.iri);return v[L||"from"]={default:W,named:ne},v}a(_l,"groupDatasets");function Wu(M){return parseInt(M,10)}a(Wu,"toInt");function wv(M){return M.type==="group"&&M.patterns.length===1?M.patterns[0]:M}a(wv,"degroupSingle");function lo(M,L){return L&&L.termType!=="NamedNode"&&(L=at.factory.namedNode(L)),at.factory.literal(M,L)}a(lo,"createTypedLiteral");function wq(M,L){return at.factory.literal(M,L)}a(wq,"createLangLiteral");function Ev(M,L,W){if(!("termType"in L))throw new Error("Nested triples cannot contain paths");return at.factory.quad(M,L,W)}a(Ev,"nestedTriple");function ia(M,L,W,ne){var De={};return M!=null&&(De.subject=M),L!=null&&(De.predicate=L),W!=null&&(De.object=W),ne!=null&&(De.annotations=ne),De}a(ia,"triple");function Lp(M){return typeof M=="string"?M.startsWith("e_")?at.factory.blankNode(M):at.factory.blankNode("e_"+M):at.factory.blankNode("g_"+bD++)}a(Lp,"blank");var bD=0;at._resetBlanks=function(){bD=0};var Eq=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,vq={"\\":"\\","'":"'",'"':'"',t:" ",b:"\b",n:`
91
- `,r:"\r",f:"\f"},Tq=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,vv=String.fromCharCode;function _D(M,L){M=M.substring(L,M.length-L);try{M=M.replace(Eq,function(W,ne,De,tt){var v;if(ne){if(v=parseInt(ne,16),isNaN(v))throw new Error;return vv(v)}else if(De){if(v=parseInt(De,16),isNaN(v))throw new Error;return v<65535?vv(v):vv(55296+((v-=65536)>>10),56320+(v&1023))}else{var Zn=vq[tt];if(!Zn)throw new Error;return Zn}})}catch{return""}if(Tq.exec(M))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+M);return M}a(_D,"unescapeString");function Aq(M){var L=Lp(),W=L,ne=[],De,tt=[];M.forEach(function(uo){ne.push(uo.entity),bl(tt,uo.triples)});for(var v=0,Zn=0,I=ne.length,De=Array(I*2);v<I;)De[Zn++]=ia(W,at.factory.namedNode(bq),ne[v]),De[Zn++]=ia(W,at.factory.namedNode(_q),W=++v<I?Lp():at.factory.namedNode(dD));return{entity:L,triples:bl(De,tt)}}a(Aq,"createList");function Iq(M){var L=Lp();return{entity:L,triples:M.map(function(W){return vr(ia(L),W)})}}a(Iq,"createAnonymousObject");function Tv(M,L,W){var ne=[],De=[];return L.forEach(function(tt){let v=null;tt.annotation&&(v=tt.annotation,tt=tt.object),ne.push(ia(null,M,tt.entity,v)),bl(De,tt.triples)}),co(ne,W||[],De)}a(Tv,"objectListToTriples");function Dve(M){for(var L=[],W,ne=0,De;De=M[ne];ne++)De.type==="bgp"?De.triples.length&&(W?bl(W.triples,De.triples):na(L,W=De)):(!De.patterns||De.patterns.length>0)&&(na(L,De),W=null);return L}a(Dve,"mergeAdjacentBGPs");function zu(M){return M.variable?M.variable.value:M.value||M.expression.value}a(zu,"getExpressionId");function Av(M){if(!M)return[];if(M.type==="aggregate")return[M];if(M.type==="operation"){let L=[];for(let W of M.args)L.push(...Av(W));return L}return[]}a(Av,"getAggregatesOfExpression");function Rq(M){let L=new Set,W=a(function(ne){ne&&(ne.termType==="Variable"?L.add(ne):ne.type==="operation"&&ne.args.forEach(W))},"visitExpression");return W(M),L}a(Rq,"getVariablesFromExpression");function Iv(M,L=1,W=[]){for(let ne of M)L>0&&ne instanceof Array?Iv(ne,L-1,W):W.push(ne);return W}a(Iv,"flatten");function Rv(M){return M.termType==="Variable"}a(Rv,"isVariable");function SD(M){if(M.triples){let L=[];for(let W of M.triples)Rv(W.subject)&&L.push(W.subject.value),Rv(W.predicate)&&L.push(W.predicate.value),Rv(W.object)&&L.push(W.object.value);return L}else if(M.patterns){let L=[];for(let W of M.patterns)L.push(...SD(W));return L}return[]}a(SD,"getBoundVarsFromGroupGraphPattern");function Cq(M){let L=M.slice().sort(),W=[];for(let ne=0;ne<L.length-1;ne++)L[ne+1]==L[ne]&&W.push(L[ne]);return W}a(Cq,"getDuplicatesInArray");function Np(M){if(!at.sparqlStar)throw new Error("SPARQL-star support is not enabled");return M}a(Np,"ensureSparqlStar");function wD(M,L,W){for(let ne of L){let De=ia("subject"in ne?ne.subject:M,ne.predicate,ne.object);W.push(De),ne.annotations&&wD(Ev(M,ne.predicate,ne.object),ne.annotations,W)}}a(wD,"_applyAnnotations");function Cv(M){if(at.sparqlStar){let L=[];return M.forEach(W=>{let ne=ia(W.subject,W.predicate,W.object);L.push(ne),W.annotations&&wD(Ev(W.subject,W.predicate,W.object),W.annotations,L)}),L}return M}a(Cv,"applyAnnotations");function Lve(M){if(!at.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return M}a(Lve,"ensureSparqlStarNestedQuads");function ED(M){for(let L of M){if(L.type==="graph"&&L.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(L.type==="bgp"||L.type==="graph"){for(let W of L.triples)if(W.subject.termType==="Variable"||W.predicate.termType==="Variable"||W.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return M}a(ED,"ensureNoVariables");function Ov(M){for(let L of M)if(L.type==="bgp"){for(let W of L.triples)if(W.subject.termType==="BlankNode"||W.predicate.termType==="BlankNode"||W.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return M}a(Ov,"ensureNoBnodes");var Oq=(function(){var M={EOF:1,parseError:a(function(W,ne){if(this.yy.parser)this.yy.parser.parseError(W,ne);else throw new Error(W)},"parseError"),setInput:a(function(L,W){return this.yy=W||this.yy||{},this._input=L,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 L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var W=L.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),L},"input"),unput:a(function(L){var W=L.length,ne=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var De=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),ne.length-1&&(this.yylineno-=ne.length-1);var tt=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:ne?(ne.length===De.length?this.yylloc.first_column:0)+De[De.length-ne.length].length-ne[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[tt[0],tt[0]+this.yyleng-W]),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).
91
+ `,r:"\r",f:"\f"},Tq=/[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/,vv=String.fromCharCode;function _D(M,L){M=M.substring(L,M.length-L);try{M=M.replace(Eq,function(W,ne,De,tt){var v;if(ne){if(v=parseInt(ne,16),isNaN(v))throw new Error;return vv(v)}else if(De){if(v=parseInt(De,16),isNaN(v))throw new Error;return v<65535?vv(v):vv(55296+((v-=65536)>>10),56320+(v&1023))}else{var Zn=vq[tt];if(!Zn)throw new Error;return Zn}})}catch{return""}if(Tq.exec(M))throw new Error("Invalid unicode codepoint of surrogate pair without corresponding codepoint in "+M);return M}a(_D,"unescapeString");function Aq(M){var L=Lp(),W=L,ne=[],De,tt=[];M.forEach(function(uo){ne.push(uo.entity),bl(tt,uo.triples)});for(var v=0,Zn=0,I=ne.length,De=Array(I*2);v<I;)De[Zn++]=ia(W,at.factory.namedNode(bq),ne[v]),De[Zn++]=ia(W,at.factory.namedNode(_q),W=++v<I?Lp():at.factory.namedNode(dD));return{entity:L,triples:bl(De,tt)}}a(Aq,"createList");function Iq(M){var L=Lp();return{entity:L,triples:M.map(function(W){return vr(ia(L),W)})}}a(Iq,"createAnonymousObject");function Tv(M,L,W){var ne=[],De=[];return L.forEach(function(tt){let v=null;tt.annotation&&(v=tt.annotation,tt=tt.object),ne.push(ia(null,M,tt.entity,v)),bl(De,tt.triples)}),co(ne,W||[],De)}a(Tv,"objectListToTriples");function Lve(M){for(var L=[],W,ne=0,De;De=M[ne];ne++)De.type==="bgp"?De.triples.length&&(W?bl(W.triples,De.triples):na(L,W=De)):(!De.patterns||De.patterns.length>0)&&(na(L,De),W=null);return L}a(Lve,"mergeAdjacentBGPs");function zu(M){return M.variable?M.variable.value:M.value||M.expression.value}a(zu,"getExpressionId");function Av(M){if(!M)return[];if(M.type==="aggregate")return[M];if(M.type==="operation"){let L=[];for(let W of M.args)L.push(...Av(W));return L}return[]}a(Av,"getAggregatesOfExpression");function Rq(M){let L=new Set,W=a(function(ne){ne&&(ne.termType==="Variable"?L.add(ne):ne.type==="operation"&&ne.args.forEach(W))},"visitExpression");return W(M),L}a(Rq,"getVariablesFromExpression");function Iv(M,L=1,W=[]){for(let ne of M)L>0&&ne instanceof Array?Iv(ne,L-1,W):W.push(ne);return W}a(Iv,"flatten");function Rv(M){return M.termType==="Variable"}a(Rv,"isVariable");function SD(M){if(M.triples){let L=[];for(let W of M.triples)Rv(W.subject)&&L.push(W.subject.value),Rv(W.predicate)&&L.push(W.predicate.value),Rv(W.object)&&L.push(W.object.value);return L}else if(M.patterns){let L=[];for(let W of M.patterns)L.push(...SD(W));return L}return[]}a(SD,"getBoundVarsFromGroupGraphPattern");function Cq(M){let L=M.slice().sort(),W=[];for(let ne=0;ne<L.length-1;ne++)L[ne+1]==L[ne]&&W.push(L[ne]);return W}a(Cq,"getDuplicatesInArray");function Np(M){if(!at.sparqlStar)throw new Error("SPARQL-star support is not enabled");return M}a(Np,"ensureSparqlStar");function wD(M,L,W){for(let ne of L){let De=ia("subject"in ne?ne.subject:M,ne.predicate,ne.object);W.push(De),ne.annotations&&wD(Ev(M,ne.predicate,ne.object),ne.annotations,W)}}a(wD,"_applyAnnotations");function Cv(M){if(at.sparqlStar){let L=[];return M.forEach(W=>{let ne=ia(W.subject,W.predicate,W.object);L.push(ne),W.annotations&&wD(Ev(W.subject,W.predicate,W.object),W.annotations,L)}),L}return M}a(Cv,"applyAnnotations");function Nve(M){if(!at.sparqlStarNestedQuads)throw new Error("Lenient SPARQL-star support with nested quads is not enabled");return M}a(Nve,"ensureSparqlStarNestedQuads");function ED(M){for(let L of M){if(L.type==="graph"&&L.name.termType==="Variable")throw new Error("Detected illegal variable in GRAPH");if(L.type==="bgp"||L.type==="graph"){for(let W of L.triples)if(W.subject.termType==="Variable"||W.predicate.termType==="Variable"||W.object.termType==="Variable")throw new Error("Detected illegal variable in BGP")}}return M}a(ED,"ensureNoVariables");function Ov(M){for(let L of M)if(L.type==="bgp"){for(let W of L.triples)if(W.subject.termType==="BlankNode"||W.predicate.termType==="BlankNode"||W.object.termType==="BlankNode")throw new Error("Detected illegal blank node in BGP")}return M}a(Ov,"ensureNoBnodes");var Oq=(function(){var M={EOF:1,parseError:a(function(W,ne){if(this.yy.parser)this.yy.parser.parseError(W,ne);else throw new Error(W)},"parseError"),setInput:a(function(L,W){return this.yy=W||this.yy||{},this._input=L,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 L=this._input[0];this.yytext+=L,this.yyleng++,this.offset++,this.match+=L,this.matched+=L;var W=L.match(/(?:\r\n?|\n).*/g);return W?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),L},"input"),unput:a(function(L){var W=L.length,ne=L.split(/(?:\r\n?|\n)/g);this._input=L+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-W),this.offset-=W;var De=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),ne.length-1&&(this.yylineno-=ne.length-1);var tt=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:ne?(ne.length===De.length?this.yylloc.first_column:0)+De[De.length-ne.length].length-ne[0].length:this.yylloc.first_column-W},this.options.ranges&&(this.yylloc.range=[tt[0],tt[0]+this.yyleng-W]),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).
92
92
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(L){this.unput(this.match.slice(L))},"less"),pastInput:a(function(){var L=this.matched.substr(0,this.matched.length-this.match.length);return(L.length>20?"...":"")+L.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var L=this.match;return L.length<20&&(L+=this._input.substr(0,20-L.length)),(L.substr(0,20)+(L.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var L=this.pastInput(),W=new Array(L.length+1).join("-");return L+this.upcomingInput()+`
93
93
  `+W+"^"},"showPosition"),test_match:a(function(L,W){var ne,De,tt;if(this.options.backtrack_lexer&&(tt={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&&(tt.yylloc.range=this.yylloc.range.slice(0))),De=L[0].match(/(?:\r\n?|\n).*/g),De&&(this.yylineno+=De.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:De?De[De.length-1].length-De[De.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+L[0].length},this.yytext+=L[0],this.match+=L[0],this.matches=L,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(L[0].length),this.matched+=L[0],ne=this.performAction.call(this,this.yy,this,W,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),ne)return ne;if(this._backtrack){for(var v in tt)this[v]=tt[v];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var L,W,ne,De;this._more||(this.yytext="",this.match="");for(var tt=this._currentRules(),v=0;v<tt.length;v++)if(ne=this._input.match(this.rules[tt[v]]),ne&&(!W||ne[0].length>W[0].length)){if(W=ne,De=v,this.options.backtrack_lexer){if(L=this.test_match(ne,tt[v]),L!==!1)return L;if(this._backtrack){W=!1;continue}else return!1}else if(!this.options.flex)break}return W?(L=this.test_match(W,tt[De]),L!==!1?L:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
94
- `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var W=this.next();return W||this.lex()},"lex"),begin:a(function(W){this.conditionStack.push(W)},"begin"),popState:a(function(){var W=this.conditionStack.length-1;return W>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(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:a(function(W){this.begin(W)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(W,ne,De,tt){var v=tt;switch(De){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(ne.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 M})();bv.lexer=Oq;function at(){this.yy={}}return a(at,"Parser"),at.prototype=bv,bv.Parser=at,new at})();j3.exports=wJ});var q3=T((UIe,G3)=>{var EJ="http://www.w3.org/2001/XMLSchema#integer",vJ="http://www.w3.org/2001/XMLSchema#string";function Zt(r){this._options=r=r||{};var e=r.prefixes||{};this._prefixByIri={};var t=[];for(var n in e){var i=e[n];yh(i)&&(this._prefixByIri[i]=n,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=r.sparqlStar,this._indent=yh(r.indent)?r.indent:" ",this._newline=yh(r.newline)?r.newline:`
95
- `,this._explicitDatatype=!!r.explicitDatatype}a(Zt,"Generator");Zt.prototype.toQuery=function(r){var e="";return r.queryType&&(e+=r.queryType.toUpperCase()+" "),r.reduced&&(e+="REDUCED "),r.distinct&&(e+="DISTINCT "),r.variables?e+=Vi(r.variables,void 0,function(t){return/^[?$]/.test(t)?t:bc(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+T0(t.variable)+")"},this)+" ":r.template&&(e+=this.group(r.template,!0)+this._newline),r.from&&(e+=this.graphs("FROM ",r.from.default)+this.graphs("FROM NAMED ",r.from.named)),r.where&&(e+="WHERE "+this.group(r.where,!0)+this._newline),r.updates&&(e+=Vi(r.updates,";"+this._newline,this.toUpdate,this)),r.group&&(e+="GROUP BY "+Vi(r.group,void 0,function(t){var n=bc(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+n+" AS "+T0(t.variable)+")":n},this)+this._newline),r.having&&(e+="HAVING ("+Vi(r.having,void 0,this.toExpression,this)+")"+this._newline),r.order&&(e+="ORDER BY "+Vi(r.order,void 0,function(t){var n="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+n:n},this)+this._newline),Number.isInteger(r.offset)&&(e+="OFFSET "+r.offset+this._newline),Number.isInteger(r.limit)&&(e+="LIMIT "+r.limit+this._newline),r.values&&(e+=this.values(r)),e=this.baseAndPrefixes(r)+e,e.trim()};Zt.prototype.baseAndPrefixes=function(r){var e=r.base?"BASE <"+r.base+">"+this._newline:"",t="";for(var n in r.prefixes)(this._options.allPrefixes||this._usedPrefixes[n])&&(t+="PREFIX "+n+": <"+r.prefixes[n]+">"+this._newline);return e+t};Zt.prototype.toPattern=function(r){var e=r.type||r instanceof Array&&"array"||(r.subject&&r.predicate&&r.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](r)};Zt.prototype.triple=function(r){return this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+"."};Zt.prototype.array=function(r){return Vi(r,this._newline,this.toPattern,this)};Zt.prototype.bgp=function(r){return this.encodeTriples(r.triples)};Zt.prototype.encodeTriples=function(r){if(!r.length)return"";for(var e=[],t=void 0,n=void 0,i=0;i<r.length;i++){var s=r[i];$l(s.subject,t)?$l(s.predicate,n)?e.push(","):(n=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(n))):(t&&e.push("."+this._newline),t=s.subject,n=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(n))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Zt.prototype.graph=function(r){return"GRAPH "+this.toEntity(r.name)+" "+this.group(r)};Zt.prototype.graphs=function(r,e){return!e||e.length===0?"":Vi(e,"",function(t){return r+this.toEntity(t)+this._newline},this)};Zt.prototype.group=function(r,e){return r=e!==!0?this.array(r.patterns||r.triples):this.toPattern(r.type!=="group"?r:r.patterns),r.indexOf(this._newline)===-1?"{ "+r+" }":"{"+this._newline+this.indent(r)+this._newline+"}"};Zt.prototype.query=function(r){return this.toQuery(r)};Zt.prototype.filter=function(r){return"FILTER("+this.toExpression(r.expression)+")"};Zt.prototype.bind=function(r){return"BIND("+this.toExpression(r.expression)+" AS "+T0(r.variable)+")"};Zt.prototype.optional=function(r){return"OPTIONAL "+this.group(r)};Zt.prototype.union=function(r){return Vi(r.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Zt.prototype.minus=function(r){return"MINUS "+this.group(r)};Zt.prototype.values=function(r){var e=Object.keys(r.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,n;return e.length===1?t=n="":(t="(",n=")"),"VALUES "+t+e.join(" ")+n+" {"+this._newline+Vi(r.values,this._newline,function(i){return" "+t+Vi(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+n},this)+this._newline+"}"};Zt.prototype.service=function(r){return"SERVICE "+(r.silent?"SILENT ":"")+this.toEntity(r.name)+" "+this.group(r)};Zt.prototype.toExpression=function(r){if(bc(r))return this.toEntity(r);switch(r.type.toLowerCase()){case"aggregate":return r.aggregation.toUpperCase()+"("+(r.distinct?"DISTINCT ":"")+this.toExpression(r.expression)+(typeof r.separator=="string"?'; SEPARATOR = "'+r.separator.replace(U3,V3)+'"':"")+")";case"functioncall":return this.toEntity(r.function)+"("+Vi(r.args,", ",this.toExpression,this)+")";case"operation":var e=r.operator.toUpperCase(),t=r.args||[];switch(r.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(bc(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(bc(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+"("+(yh(t[1])?t[1]:Vi(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Vi(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+r.type)}};Zt.prototype.toEntity=function(r){if(bc(r))switch(r.termType){case"Wildcard":return"*";case"Variable":return T0(r);case"BlankNode":return"_:"+r.value;case"Literal":var e=r.value||"",t=r.language||"",n=r.datatype;if(r='"'+e.replace(U3,V3)+'"',t)r+="@"+t;else if(n){if(!this._explicitDatatype)switch(n.value){case vJ:return r;case EJ:if(/^\d+$/.test(e))return e+" "}r+="^^"+this.encodeIRI(n.value)}return r;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return r.graph&&r.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(r.graph)+" { "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" } >>":"<< "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" >>";default:return this.encodeIRI(r.value)}else{var i=r.items.map(this.toEntity,this),s=r.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var U3=/["\\\t\n\r\b\f]/g,V3=a(function(r){return TJ[r]},"escapeReplacer"),TJ={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Zt.prototype.encodeIRI=function(r){var e=this._prefixRegex.exec(r);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+r+">"};Zt.prototype.toUpdate=function(r){switch(r.type||r.updateType){case"load":return"LOAD"+(r.source?" "+this.toEntity(r.source):"")+(r.destination?" INTO GRAPH "+this.toEntity(r.destination):"");case"insert":return"INSERT DATA "+this.group(r.insert,!0);case"delete":return"DELETE DATA "+this.group(r.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(r.delete,!0);case"insertdelete":return(r.graph?"WITH "+this.toEntity(r.graph)+this._newline:"")+(r.delete.length?"DELETE "+this.group(r.delete,!0)+this._newline:"")+(r.insert.length?"INSERT "+this.group(r.insert,!0)+this._newline:"")+(r.using?this.graphs("USING ",r.using.default):"")+(r.using?this.graphs("USING NAMED ",r.using.named):"")+"WHERE "+this.group(r.where,!0);case"add":case"copy":case"move":return r.type.toUpperCase()+" "+(r.silent?"SILENT ":"")+(r.source.default?"DEFAULT":this.toEntity(r.source.name))+" TO "+this.toEntity(r.destination.name);case"create":case"clear":case"drop":return r.type.toUpperCase()+(r.silent?" SILENT ":" ")+(r.graph.default?"DEFAULT":r.graph.named?"NAMED":r.graph.all?"ALL":"GRAPH "+this.toEntity(r.graph.name));default:throw new Error("Unknown update query type: "+r.type)}};Zt.prototype.indent=function(r){return r.replace(/^/gm,this._indent)};function T0(r){return"?"+r.value}a(T0,"variableToString");function yh(r){return typeof r=="string"}a(yh,"isString");function bc(r){return typeof r.termType=="string"}a(bc,"isTerm");function $l(r,e){if(!r||!bc(r)||!e||!bc(e)||r.termType!==e.termType)return!1;switch(r.termType){case"Literal":return r.value===e.value&&r.language===e.language&&$l(r.datatype,e.datatype);case"Quad":return $l(r.subject,e.subject)&&$l(r.predicate,e.predicate)&&$l(r.object,e.object)&&$l(r.graph,e.graph);default:return r.value===e.value}}a($l,"equalTerms");function Vi(r,e,t,n){return r.map(t,n).join(yh(e)?e:" ")}a(Vi,"mapJoin");function AJ(r={}){return{stringify:a(function(e){var t=Object.create(r);return t.prefixes=e.prefixes,new Zt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Zt(r)},"createGenerator")}}a(AJ,"_Generator");G3.exports={Generator:AJ}});var Y1=T(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.BlankNode=void 0;var H1=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};A0.BlankNode=H1});var X1=T(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.DefaultGraph=void 0;var bh=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};I0.DefaultGraph=bh;bh.INSTANCE=new bh});var C0=T(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.NamedNode=void 0;var Q1=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};R0.NamedNode=Q1});var J1=T(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.Literal=void 0;var W3=C0(),_h=class r{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=r.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=r.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};O0.Literal=_h;_h.RDF_LANGUAGE_STRING=new W3.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");_h.XSD_STRING=new W3.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var eA=T(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.Quad=void 0;var Z1=class{static{a(this,"Quad")}constructor(e,t,n,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,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)}};x0.Quad=Z1});var rA=T(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.Variable=void 0;var tA=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};P0.Variable=tA});var K3=T(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});F0.DataFactory=void 0;var IJ=Y1(),RJ=X1(),z3=J1(),CJ=C0(),OJ=eA(),xJ=rA(),PJ=0,nA=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${PJ++}_`}namedNode(e){return new CJ.NamedNode(e)}blankNode(e){return new IJ.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new z3.Literal(e,t)}variable(e){return new xJ.Variable(e)}defaultGraph(){return RJ.DefaultGraph.INSTANCE}quad(e,t,n,i){return new OJ.Quad(e,t,n,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(z3.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}};F0.DataFactory=nA});var H3=T(Gi=>{"use strict";var FJ=Gi&&Gi.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),jl=Gi&&Gi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&FJ(e,r,t)};Object.defineProperty(Gi,"__esModule",{value:!0});jl(Y1(),Gi);jl(K3(),Gi);jl(X1(),Gi);jl(J1(),Gi);jl(C0(),Gi);jl(eA(),Gi);jl(rA(),Gi)});var X3=T((sRe,Y3)=>{var{Parser:ha}=B3(),{Generator:DJ}=q3(),{Wildcard:LJ}=K1(),{DataFactory:NJ}=H3();function kJ({prefixes:r,baseIRI:e,factory:t,pathOnly:n,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in r??{})c[u]=r[u];let l=new ha;return l.parse=function(){return ha.base=e||"",ha.prefixes=Object.create(c),ha.factory=t||new NJ,ha.sparqlStar=!!i,ha.pathOnly=!!n,ha.skipValidation=!!s||!!o,ha.prototype.parse.apply(l,arguments)},l._resetBlanks=ha._resetBlanks,l}a(kJ,"_Parser");Y3.exports={Parser:kJ,Generator:DJ,Wildcard:LJ}});var sA=T(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.CaseWhenTransformerError=ff.CaseWhenTransformer=void 0;var iA=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new ma("Too many nested CASE expressions (max 100 iterations)");while(t!==n);return t}stripLineComments(e){let t="",n=0;for(;n<e.length;){let i=e[n];if(i==="'"||i==='"'){let s=i;for(t+=i,n++;n<e.length&&e[n]!==s;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++}n<e.length&&(t+=e[n],n++);continue}if(i==="<"){let s=e.indexOf(">",n),o=e.indexOf(`
94
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var W=this.next();return W||this.lex()},"lex"),begin:a(function(W){this.conditionStack.push(W)},"begin"),popState:a(function(){var W=this.conditionStack.length-1;return W>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(W){return W=this.conditionStack.length-1-Math.abs(W||0),W>=0?this.conditionStack[W]:"INITIAL"},"topState"),pushState:a(function(W){this.begin(W)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{flex:!0,"case-insensitive":!0},performAction:a(function(W,ne,De,tt){var v=tt;switch(De){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(ne.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 M})();bv.lexer=Oq;function at(){this.yy={}}return a(at,"Parser"),at.prototype=bv,bv.Parser=at,new at})();j3.exports=wJ});var q3=T((VIe,G3)=>{var EJ="http://www.w3.org/2001/XMLSchema#integer",vJ="http://www.w3.org/2001/XMLSchema#string";function Zt(r){this._options=r=r||{};var e=r.prefixes||{};this._prefixByIri={};var t=[];for(var n in e){var i=e[n];yh(i)&&(this._prefixByIri[i]=n,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=r.sparqlStar,this._indent=yh(r.indent)?r.indent:" ",this._newline=yh(r.newline)?r.newline:`
95
+ `,this._explicitDatatype=!!r.explicitDatatype}a(Zt,"Generator");Zt.prototype.toQuery=function(r){var e="";return r.queryType&&(e+=r.queryType.toUpperCase()+" "),r.reduced&&(e+="REDUCED "),r.distinct&&(e+="DISTINCT "),r.variables?e+=Vi(r.variables,void 0,function(t){return/^[?$]/.test(t)?t:bc(t)?this.toEntity(t):"("+this.toExpression(t.expression)+" AS "+T0(t.variable)+")"},this)+" ":r.template&&(e+=this.group(r.template,!0)+this._newline),r.from&&(e+=this.graphs("FROM ",r.from.default)+this.graphs("FROM NAMED ",r.from.named)),r.where&&(e+="WHERE "+this.group(r.where,!0)+this._newline),r.updates&&(e+=Vi(r.updates,";"+this._newline,this.toUpdate,this)),r.group&&(e+="GROUP BY "+Vi(r.group,void 0,function(t){var n=bc(t.expression)?this.toEntity(t.expression):"("+this.toExpression(t.expression)+")";return t.variable?"("+n+" AS "+T0(t.variable)+")":n},this)+this._newline),r.having&&(e+="HAVING ("+Vi(r.having,void 0,this.toExpression,this)+")"+this._newline),r.order&&(e+="ORDER BY "+Vi(r.order,void 0,function(t){var n="("+this.toExpression(t.expression)+")";return t.descending?"DESC "+n:n},this)+this._newline),Number.isInteger(r.offset)&&(e+="OFFSET "+r.offset+this._newline),Number.isInteger(r.limit)&&(e+="LIMIT "+r.limit+this._newline),r.values&&(e+=this.values(r)),e=this.baseAndPrefixes(r)+e,e.trim()};Zt.prototype.baseAndPrefixes=function(r){var e=r.base?"BASE <"+r.base+">"+this._newline:"",t="";for(var n in r.prefixes)(this._options.allPrefixes||this._usedPrefixes[n])&&(t+="PREFIX "+n+": <"+r.prefixes[n]+">"+this._newline);return e+t};Zt.prototype.toPattern=function(r){var e=r.type||r instanceof Array&&"array"||(r.subject&&r.predicate&&r.object?"triple":"");if(!(e in this))throw new Error("Unknown entry type: "+e);return this[e](r)};Zt.prototype.triple=function(r){return this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+"."};Zt.prototype.array=function(r){return Vi(r,this._newline,this.toPattern,this)};Zt.prototype.bgp=function(r){return this.encodeTriples(r.triples)};Zt.prototype.encodeTriples=function(r){if(!r.length)return"";for(var e=[],t=void 0,n=void 0,i=0;i<r.length;i++){var s=r[i];$l(s.subject,t)?$l(s.predicate,n)?e.push(","):(n=s.predicate,e.push(";"+this._newline,this._indent,this.toEntity(n))):(t&&e.push("."+this._newline),t=s.subject,n=s.predicate,e.push(this.toEntity(t)," ",this.toEntity(n))),e.push(" ",this.toEntity(s.object))}return e.push("."),e.join("")};Zt.prototype.graph=function(r){return"GRAPH "+this.toEntity(r.name)+" "+this.group(r)};Zt.prototype.graphs=function(r,e){return!e||e.length===0?"":Vi(e,"",function(t){return r+this.toEntity(t)+this._newline},this)};Zt.prototype.group=function(r,e){return r=e!==!0?this.array(r.patterns||r.triples):this.toPattern(r.type!=="group"?r:r.patterns),r.indexOf(this._newline)===-1?"{ "+r+" }":"{"+this._newline+this.indent(r)+this._newline+"}"};Zt.prototype.query=function(r){return this.toQuery(r)};Zt.prototype.filter=function(r){return"FILTER("+this.toExpression(r.expression)+")"};Zt.prototype.bind=function(r){return"BIND("+this.toExpression(r.expression)+" AS "+T0(r.variable)+")"};Zt.prototype.optional=function(r){return"OPTIONAL "+this.group(r)};Zt.prototype.union=function(r){return Vi(r.patterns,this._newline+"UNION"+this._newline,function(e){return this.group(e,!0)},this)};Zt.prototype.minus=function(r){return"MINUS "+this.group(r)};Zt.prototype.values=function(r){var e=Object.keys(r.values.reduce(function(i,s){for(var o in s)i[o]=!0;return i},{})),t,n;return e.length===1?t=n="":(t="(",n=")"),"VALUES "+t+e.join(" ")+n+" {"+this._newline+Vi(r.values,this._newline,function(i){return" "+t+Vi(e,void 0,function(s){return i[s]?this.toEntity(i[s]):"UNDEF"},this)+n},this)+this._newline+"}"};Zt.prototype.service=function(r){return"SERVICE "+(r.silent?"SILENT ":"")+this.toEntity(r.name)+" "+this.group(r)};Zt.prototype.toExpression=function(r){if(bc(r))return this.toEntity(r);switch(r.type.toLowerCase()){case"aggregate":return r.aggregation.toUpperCase()+"("+(r.distinct?"DISTINCT ":"")+this.toExpression(r.expression)+(typeof r.separator=="string"?'; SEPARATOR = "'+r.separator.replace(U3,V3)+'"':"")+")";case"functioncall":return this.toEntity(r.function)+"("+Vi(r.args,", ",this.toExpression,this)+")";case"operation":var e=r.operator.toUpperCase(),t=r.args||[];switch(r.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(bc(t[0])?this.toEntity(t[0]):"("+this.toExpression(t[0])+")")+" "+e+" "+(bc(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+"("+(yh(t[1])?t[1]:Vi(t[1],", ",this.toExpression,this))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+this.group(t[0],!0);default:return e+"("+Vi(t,", ",this.toExpression,this)+")"}default:throw new Error("Unknown expression type: "+r.type)}};Zt.prototype.toEntity=function(r){if(bc(r))switch(r.termType){case"Wildcard":return"*";case"Variable":return T0(r);case"BlankNode":return"_:"+r.value;case"Literal":var e=r.value||"",t=r.language||"",n=r.datatype;if(r='"'+e.replace(U3,V3)+'"',t)r+="@"+t;else if(n){if(!this._explicitDatatype)switch(n.value){case vJ:return r;case EJ:if(/^\d+$/.test(e))return e+" "}r+="^^"+this.encodeIRI(n.value)}return r;case"Quad":if(!this._sparqlStar)throw new Error("SPARQL* support is not enabled");return r.graph&&r.graph.termType!=="DefaultGraph"?"<< GRAPH "+this.toEntity(r.graph)+" { "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" } >>":"<< "+this.toEntity(r.subject)+" "+this.toEntity(r.predicate)+" "+this.toEntity(r.object)+" >>";default:return this.encodeIRI(r.value)}else{var i=r.items.map(this.toEntity,this),s=r.pathType;switch(s){case"^":case"!":return s+i[0];case"*":case"+":case"?":return"("+i[0]+s+")";default:return"("+i.join(s)+")"}}};var U3=/["\\\t\n\r\b\f]/g,V3=a(function(r){return TJ[r]},"escapeReplacer"),TJ={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};Zt.prototype.encodeIRI=function(r){var e=this._prefixRegex.exec(r);if(e){var t=this._prefixByIri[e[1]];return this._usedPrefixes[t]=!0,t+":"+e[2]}return"<"+r+">"};Zt.prototype.toUpdate=function(r){switch(r.type||r.updateType){case"load":return"LOAD"+(r.source?" "+this.toEntity(r.source):"")+(r.destination?" INTO GRAPH "+this.toEntity(r.destination):"");case"insert":return"INSERT DATA "+this.group(r.insert,!0);case"delete":return"DELETE DATA "+this.group(r.delete,!0);case"deletewhere":return"DELETE WHERE "+this.group(r.delete,!0);case"insertdelete":return(r.graph?"WITH "+this.toEntity(r.graph)+this._newline:"")+(r.delete.length?"DELETE "+this.group(r.delete,!0)+this._newline:"")+(r.insert.length?"INSERT "+this.group(r.insert,!0)+this._newline:"")+(r.using?this.graphs("USING ",r.using.default):"")+(r.using?this.graphs("USING NAMED ",r.using.named):"")+"WHERE "+this.group(r.where,!0);case"add":case"copy":case"move":return r.type.toUpperCase()+" "+(r.silent?"SILENT ":"")+(r.source.default?"DEFAULT":this.toEntity(r.source.name))+" TO "+this.toEntity(r.destination.name);case"create":case"clear":case"drop":return r.type.toUpperCase()+(r.silent?" SILENT ":" ")+(r.graph.default?"DEFAULT":r.graph.named?"NAMED":r.graph.all?"ALL":"GRAPH "+this.toEntity(r.graph.name));default:throw new Error("Unknown update query type: "+r.type)}};Zt.prototype.indent=function(r){return r.replace(/^/gm,this._indent)};function T0(r){return"?"+r.value}a(T0,"variableToString");function yh(r){return typeof r=="string"}a(yh,"isString");function bc(r){return typeof r.termType=="string"}a(bc,"isTerm");function $l(r,e){if(!r||!bc(r)||!e||!bc(e)||r.termType!==e.termType)return!1;switch(r.termType){case"Literal":return r.value===e.value&&r.language===e.language&&$l(r.datatype,e.datatype);case"Quad":return $l(r.subject,e.subject)&&$l(r.predicate,e.predicate)&&$l(r.object,e.object)&&$l(r.graph,e.graph);default:return r.value===e.value}}a($l,"equalTerms");function Vi(r,e,t,n){return r.map(t,n).join(yh(e)?e:" ")}a(Vi,"mapJoin");function AJ(r={}){return{stringify:a(function(e){var t=Object.create(r);return t.prefixes=e.prefixes,new Zt(t).toQuery(e)},"stringify"),createGenerator:a(function(){return new Zt(r)},"createGenerator")}}a(AJ,"_Generator");G3.exports={Generator:AJ}});var Y1=T(A0=>{"use strict";Object.defineProperty(A0,"__esModule",{value:!0});A0.BlankNode=void 0;var H1=class{static{a(this,"BlankNode")}constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&e.termType==="BlankNode"&&e.value===this.value}};A0.BlankNode=H1});var X1=T(I0=>{"use strict";Object.defineProperty(I0,"__esModule",{value:!0});I0.DefaultGraph=void 0;var bh=class{static{a(this,"DefaultGraph")}constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&e.termType==="DefaultGraph"}};I0.DefaultGraph=bh;bh.INSTANCE=new bh});var C0=T(R0=>{"use strict";Object.defineProperty(R0,"__esModule",{value:!0});R0.NamedNode=void 0;var Q1=class{static{a(this,"NamedNode")}constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&e.termType==="NamedNode"&&e.value===this.value}};R0.NamedNode=Q1});var J1=T(O0=>{"use strict";Object.defineProperty(O0,"__esModule",{value:!0});O0.Literal=void 0;var W3=C0(),_h=class r{static{a(this,"Literal")}constructor(e,t){this.termType="Literal",this.value=e,typeof t=="string"?(this.language=t,this.datatype=r.RDF_LANGUAGE_STRING):t?(this.language="",this.datatype=t):(this.language="",this.datatype=r.XSD_STRING)}equals(e){return!!e&&e.termType==="Literal"&&e.value===this.value&&e.language===this.language&&this.datatype.equals(e.datatype)}};O0.Literal=_h;_h.RDF_LANGUAGE_STRING=new W3.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString");_h.XSD_STRING=new W3.NamedNode("http://www.w3.org/2001/XMLSchema#string")});var eA=T(x0=>{"use strict";Object.defineProperty(x0,"__esModule",{value:!0});x0.Quad=void 0;var Z1=class{static{a(this,"Quad")}constructor(e,t,n,i){this.termType="Quad",this.value="",this.subject=e,this.predicate=t,this.object=n,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)}};x0.Quad=Z1});var rA=T(P0=>{"use strict";Object.defineProperty(P0,"__esModule",{value:!0});P0.Variable=void 0;var tA=class{static{a(this,"Variable")}constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&e.termType==="Variable"&&e.value===this.value}};P0.Variable=tA});var K3=T(F0=>{"use strict";Object.defineProperty(F0,"__esModule",{value:!0});F0.DataFactory=void 0;var IJ=Y1(),RJ=X1(),z3=J1(),CJ=C0(),OJ=eA(),xJ=rA(),PJ=0,nA=class{static{a(this,"DataFactory")}constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${PJ++}_`}namedNode(e){return new CJ.NamedNode(e)}blankNode(e){return new IJ.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new z3.Literal(e,t)}variable(e){return new xJ.Variable(e)}defaultGraph(){return RJ.DefaultGraph.INSTANCE}quad(e,t,n,i){return new OJ.Quad(e,t,n,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(z3.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}};F0.DataFactory=nA});var H3=T(Gi=>{"use strict";var FJ=Gi&&Gi.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),jl=Gi&&Gi.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&FJ(e,r,t)};Object.defineProperty(Gi,"__esModule",{value:!0});jl(Y1(),Gi);jl(K3(),Gi);jl(X1(),Gi);jl(J1(),Gi);jl(C0(),Gi);jl(eA(),Gi);jl(rA(),Gi)});var X3=T((oRe,Y3)=>{var{Parser:ha}=B3(),{Generator:DJ}=q3(),{Wildcard:LJ}=K1(),{DataFactory:NJ}=H3();function kJ({prefixes:r,baseIRI:e,factory:t,pathOnly:n,sparqlStar:i,skipValidation:s,skipUngroupedVariableCheck:o}={}){let c={};for(let u in r??{})c[u]=r[u];let l=new ha;return l.parse=function(){return ha.base=e||"",ha.prefixes=Object.create(c),ha.factory=t||new NJ,ha.sparqlStar=!!i,ha.pathOnly=!!n,ha.skipValidation=!!s||!!o,ha.prototype.parse.apply(l,arguments)},l._resetBlanks=ha._resetBlanks,l}a(kJ,"_Parser");Y3.exports={Parser:kJ,Generator:DJ,Wildcard:LJ}});var sA=T(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.CaseWhenTransformerError=ff.CaseWhenTransformer=void 0;var iA=class{static{a(this,"CaseWhenTransformer")}transform(e){let t=this.stripLineComments(e),n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new ma("Too many nested CASE expressions (max 100 iterations)");while(t!==n);return t}stripLineComments(e){let t="",n=0;for(;n<e.length;){let i=e[n];if(i==="'"||i==='"'){let s=i;for(t+=i,n++;n<e.length&&e[n]!==s;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}t+=e[n],n++}n<e.length&&(t+=e[n],n++);continue}if(i==="<"){let s=e.indexOf(">",n),o=e.indexOf(`
96
96
  `,n);if(s!==-1&&(o===-1||s<o)){t+=e.substring(n,s+1),n=s+1;continue}}if(i==="#"){let s=e.indexOf(`
97
97
  `,n),o=s===-1?e.length:s;t+=" ".repeat(o-n),n=o;continue}t+=i,n++}return t}transformSinglePass(e){let t=this.findCasePositions(e);if(t.length===0)return e;let n=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractCaseExpression(n,s);if(o){let c=this.convertCaseToIf(o.content);n=n.substring(0,s)+c+n.substring(s+o.length)}}return n}findCasePositions(e){let t=[],n=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(n.substring(i,i+4)==="CASE"&&this.isWordBoundary(e,i,4)){t.push(i),i+=4;continue}i++}return t}extractCaseExpression(e,t){let n=1,i=t+4,s=e.toUpperCase();for(;i<e.length&&n>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)){n++,i+=4;continue}if(s.substring(i,i+3)==="END"&&this.isWordBoundary(e,i,3)){if(n--,n===0){let o=e.substring(t,i+3);return{content:o,length:o.length}}i+=3;continue}i++}if(n>0)throw new ma(`Unclosed CASE expression at position ${t}`);return null}isWordBoundary(e,t,n){let i=t>0?e[t-1]:"",s=t===0||!/[a-zA-Z0-9_?$]/.test(i),o=t+n<e.length?e[t+n]:"",c=t+n>=e.length||!/[a-zA-Z0-9_]/.test(o);return s&&c}convertCaseToIf(e){let t=this.extractWhenClauses(e),n=this.extractElseClause(e);if(t.length===0)throw new ma("CASE expression must have at least one WHEN clause");let i=n!==null?n:'""';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=[],n=e.replace(/^\s*CASE\s+/i,"").replace(/\s*END\s*$/i,""),i=this.findKeywordPositions(n,"WHEN"),s=this.findKeywordPositions(n,"ELSE"),o=s.length>0?s[0]:n.length;for(let c=0;c<i.length;c++){let l=i[c]+4,u=c+1<i.length?i[c+1]:o,f=n.substring(l,u).trim(),d=this.parseWhenClause(f);d&&t.push(d)}return t}findKeywordPositions(e,t){let n=[],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)){n.push(s),s+=t.length;continue}s++}return n}parseWhenClause(e){let t=this.findKeywordPositions(e,"THEN");if(t.length===0)throw new ma(`WHEN clause missing THEN keyword: ${e.substring(0,50)}...`);let n=t[0],i=e.substring(0,n).trim(),s=e.substring(n+4).trim();if(!i)throw new ma("WHEN clause has empty condition");if(!s)throw new ma("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,""),n=this.findKeywordPositions(t,"ELSE");if(n.length>0){let i=n[0];return t.substring(i+4).trim()}return null}};ff.CaseWhenTransformer=iA;var ma=class extends Error{static{a(this,"CaseWhenTransformerError")}constructor(e){super(`CASE WHEN transformation error: ${e}`),this.name="CaseWhenTransformerError"}};ff.CaseWhenTransformerError=ma});var oA=T(df=>{"use strict";Object.defineProperty(df,"__esModule",{value:!0});df.LateralTransformerError=df.LateralTransformer=void 0;var D0=class r{static{a(this,"LateralTransformer")}transform(e){let t=e,n,i=0,s=100;do if(n=t,t=this.transformSinglePass(t),i++,i>s)throw new _c("Too many nested LATERAL joins (max 100 iterations)");while(t!==n);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 n of t.variables)if(n.termType==="Variable"&&n.value===r.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===r.LATERAL_MARKER)return!0}return!1}transformSinglePass(e){let t=this.findLateralPositions(e);if(t.length===0)return e;let n=e;for(let i=t.length-1;i>=0;i--){let s=t[i],o=this.extractLateralExpression(n,s);if(o){let c=this.transformLateral(o.content);n=n.substring(0,s)+c+n.substring(s+o.length)}}return n}findLateralPositions(e){let t=[],n=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]!==`
98
98
  `;)i++;continue}if(n.substring(i,i+7)==="LATERAL"&&this.isWordBoundary(e,i,7)){t.push(i),i+=7;continue}i++}return t}extractLateralExpression(e,t){let n=t+7;for(;n<e.length&&/\s/.test(e[n]);)n++;if(e[n]!=="{")throw new _c(`Expected '{' after LATERAL keyword at position ${t}`);let i=1;for(n++;n<e.length&&i>0;){if(e[n]==="'"||e[n]==='"'){let s=e[n];for(n++;n<e.length&&e[n]!==s;)e[n]==="\\"&&n++,n++;n++;continue}if(e[n]==="#"){for(;n<e.length&&e[n]!==`
@@ -329,7 +329,7 @@ To resolve:
329
329
  \u2022 Check service initialization parameters
330
330
  \u2022 Verify all required dependencies are available
331
331
  \u2022 Review service logs for detailed error information
332
- \u2022 Contact support if the issue persists`}};oS.ServiceError=k2});var Bj=T($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.ServiceError=$r.ResourceExhaustedError=$r.NotFoundError=$r.PermissionError=$r.StateTransitionError=$r.NetworkError=$r.ValidationError=$r.ApplicationError=$r.ErrorCode=void 0;var Voe=Oo();Object.defineProperty($r,"ErrorCode",{enumerable:!0,get:a(function(){return Voe.ErrorCode},"get")});var Goe=xo();Object.defineProperty($r,"ApplicationError",{enumerable:!0,get:a(function(){return Goe.ApplicationError},"get")});var qoe=Dj();Object.defineProperty($r,"ValidationError",{enumerable:!0,get:a(function(){return qoe.ValidationError},"get")});var Woe=Lj();Object.defineProperty($r,"NetworkError",{enumerable:!0,get:a(function(){return Woe.NetworkError},"get")});var zoe=Nj();Object.defineProperty($r,"StateTransitionError",{enumerable:!0,get:a(function(){return zoe.StateTransitionError},"get")});var Koe=kj();Object.defineProperty($r,"PermissionError",{enumerable:!0,get:a(function(){return Koe.PermissionError},"get")});var Hoe=Mj();Object.defineProperty($r,"NotFoundError",{enumerable:!0,get:a(function(){return Hoe.NotFoundError},"get")});var Yoe=$j();Object.defineProperty($r,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return Yoe.ResourceExhaustedError},"get")});var Xoe=jj();Object.defineProperty($r,"ServiceError",{enumerable:!0,get:a(function(){return Xoe.ServiceError},"get")})});var $2=T(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.ShapeRegistry=void 0;var M2=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}};aS.ShapeRegistry=M2});var Vj=T(Po=>{"use strict";var Qoe=Po&&Po.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Joe=Po&&Po.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),j2=Po&&Po.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Qoe(t,e,n[i]);return Joe(t,e),t}})();Object.defineProperty(Po,"__esModule",{value:!0});Po.ShapeLoader=void 0;var B2=$2(),Us=Le(),Zh=Ye(),Ar=Rt(),Zoe=y0(),Uj=NI(),cS="http://www.w3.org/ns/shacl#",LFe=[["exo__",Ar.Namespace.EXO],["ems__",Ar.Namespace.EMS],["exocmd__",Ar.Namespace.EXOCMD],["ims__",Ar.Namespace.IMS],["ztlk__",Ar.Namespace.ZTLK],["ptms__",Ar.Namespace.PTMS],["lit__",Ar.Namespace.LIT],["inbox__",Ar.Namespace.INBOX],["pmbok__",Ar.Namespace.PMBOK]],$a=class r{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e,t){let{readdir:n,readFile:i}=await Promise.resolve().then(()=>j2(require("fs/promises"))),s=await Promise.resolve().then(()=>j2(require("path"))),o=new B2.ShapeRegistry,c={classEdges:[],candidates:[],uidToLabel:new Map},l=t?.scanFilter?await t.scanFilter():void 0;await r.scanDir(e,c,{readdir:n,readFile:t?.readFile??i,path:s,shouldRead:l});let u=r.propertyClassKeysFromEdges(c.classEdges);for(let f of c.candidates)try{r.registerCandidate(f,o,u,s,c.uidToLabel)}catch{}return o}static async loadFromRDFGraph(e){let t=new B2.ShapeRegistry,n=Ar.Namespace.EXO,i=Ar.Namespace.RDFS,s=Ar.Namespace.RDF,o=await r.buildUidClassIndex(e),c=await r.collectPropertyClassIRIs(e,o),l=await Promise.all([...c].map(async f=>{try{return await e.match(void 0,s.term("type"),new Us.IRI(f))}catch{return[]}})),u=new Set;for(let f of l.flat())f.subject instanceof Us.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new Us.IRI(f)}catch{continue}let[p,h,g,m,b,S,_,A,E]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,n.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,n.term("Property_range"),void 0),e.match(d,n.term("Property_cardinality"),void 0),e.match(d,n.term("Property_severity"),void 0),e.match(d,n.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,n.term("Property_minCount"),void 0)]),w=[..._,...A],R=[...p,...h],O=[...g,...m];if(R.length===0)continue;let P=null;for(let Z of w)if(Z.object instanceof Zh.Literal&&(P=r.labelToIRI(Z.object.value),P))break;if(!P)continue;let N=await Promise.all(R.map(async Z=>Z.object instanceof Us.IRI?await r.resolveClassIRI(Z.object.value,e,o):null)),j=Array.from(new Set(N.filter(Z=>Z!==null))),U=await Promise.all(O.map(async Z=>Z.object instanceof Us.IRI?await r.resolveClassIRI(Z.object.value,e,o):Z.object instanceof Zh.Literal?r.datatypeRangeToIRI(Z.object.value):null)),G=Array.from(new Set(U.filter(Z=>Z!==null))),$=r.cardinalityFromIRI(b[0]?.object instanceof Us.IRI?b[0].object.value:void 0),k=r.severityFromValue(S[0]?.object instanceof Zh.Literal||S[0]?.object instanceof Us.IRI?S[0].object.value:void 0),te=(0,Uj.parseMinCount)(E.map(Z=>Z.object));t.register({propertyIRI:P,domain:j,range:G.length>0?G:void 0,cardinality:$,severity:k,minCount:te})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>j2(require("fs/promises"))),n=await t(e,"utf-8"),i=JSON.parse(n),s=new B2.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=r.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=Ar.Namespace.RDFS,n=Ar.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,n.term("Asset_label"),void 0)]),o=new Map;for(let c of[...i,...s]){if(!(c.subject instanceof Us.IRI)||!(c.object instanceof Zh.Literal))continue;let l=r.extractUidFromFileIRI(c.subject.value);if(!l||o.has(l))continue;let u=c.object.value.trim();if(/\s/.test(u))continue;let f=r.labelToIRI(u);f&&o.set(l,f)}return o}static async collectPropertyClassIRIs(e,t){let n=Ar.Namespace.EXO,i=Ar.Namespace.RDFS,[s,o]=await Promise.all([e.match(void 0,n.term("Class_superClass"),void 0),e.match(void 0,i.term("subClassOf"),void 0)]),c=new Map,l=a(async p=>{let h=c.get(p);return h===void 0&&(h=await r.resolveClassIRI(p,e,t),c.set(p,h)),h},"canon"),u=new Map;for(let p of[...s,...o]){if(!(p.subject instanceof Us.IRI)||!(p.object instanceof Us.IRI))continue;let[h,g]=await Promise.all([l(p.subject.value),l(p.object.value)]);if(!h||!g||h===g)continue;let m=u.get(g)??new Set;m.add(h),u.set(g,m)}let f=new Set([n.term("Property").value,n.term("ObjectProperty").value]),d=[...f];for(;d.length>0;){let p=d.shift();for(let h of u.get(p)??[])f.has(h)||(f.add(h),d.push(h))}return f}static async resolveClassIRI(e,t,n){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new Us.IRI(e)}catch{return null}let s=Ar.Namespace.RDFS,o=Ar.Namespace.EXO,[c,l]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...c,...l])if(u.object instanceof Zh.Literal){let f=r.labelToIRI(u.object.value);if(f)return f}if(n){let u=r.extractUidFromFileIRI(e);if(u){let f=n.get(u);if(f)return f}}return e}static propertyClassKeysFromEdges(e){let t=["exo__Property",r.EXO_PROPERTY_UID,"exo__ObjectProperty",r.EXO_OBJECT_PROPERTY_UID],n=new Set(t),i=[...t];for(;i.length>0;){let s=i.shift();for(let o of e)if(o.parentKeys.includes(s)&&!o.childKeys.some(c=>n.has(c)))for(let c of o.childKeys)n.add(c),i.push(c)}return n}static wikilinkClassKeys(e){let t=r.extractWikilinkRef(e);if(!t)return[];let n=[t.trim()];for(let i of t.split("|")){let s=i.trim();s.length>0&&n.push(s)}return n}static async scanDir(e,t,n){let i;try{i=await n.readdir(e,{withFileTypes:!0})}catch{return}i.sort((s,o)=>s.name<o.name?-1:s.name>o.name?1:0);for(let s of i){let o=n.path.join(e,s.name);if(s.isDirectory())await r.scanDir(o,t,n);else if(s.isFile()&&s.name.endsWith(".md")){if(n.shouldRead&&!n.shouldRead(o))continue;try{await r.collectFile(o,t,n.readFile,n.path)}catch{}}}}static async collectFile(e,t,n,i){let s;try{s=await n(e,"utf-8")}catch{return}let o=r.parseFrontmatter(s);if(!o)return;r.indexUidLabel(e,o,t.uidToLabel,i);let c=r.asArray(o.exo__Class_superClass);if(c.length>0){let l=[i.basename(e,".md")],u=o.exo__Asset_uid;typeof u=="string"&&u.trim().length>0&&l.push(u.trim().replace(/^["']|["']$/g,""));let f=o.exo__Asset_label;typeof f=="string"&&f.trim().length>0&&l.push(f.trim().replace(/^["']|["']$/g,"")),t.classEdges.push({childKeys:l,parentKeys:c.flatMap(d=>r.wikilinkClassKeys(d))})}r.asArray(o.exo__Property_domain).length>0&&t.candidates.push({filePath:e,fm:o})}static indexUidLabel(e,t,n,i){let s=t.exo__Asset_label;if(typeof s!="string")return;let o=s.trim().replace(/^["']|["']$/g,"");if(o.length===0||/\s/.test(o)||!Ar.Namespace.fromPropertyKey(o))return;let c=t.exo__Asset_uid,l=[typeof c=="string"?c.trim().replace(/^["']|["']$/g,""):"",i.basename(e,".md")];for(let u of l){if(!r.BARE_UID_RE.test(u))continue;let f=u.toLowerCase();n.has(f)||n.set(f,o)}}static registerCandidate(e,t,n,i,s){let{filePath:o,fm:c}=e;if(!r.asArray(c.exo__Instance_class).some(O=>r.wikilinkClassKeys(O).some(P=>n.has(P))))return;let f=null,d=c.exo__Asset_label;if(typeof d=="string"&&d.trim().length>0)f=d.trim().replace(/^["']|["']$/g,"");else{let O=i.basename(o,".md");Ar.Namespace.fromPropertyKey(O)&&(f=O)}if(!f)return;let p=r.labelToIRI(f);if(!p)return;let h=c.exo__Property_domain,g=c.exo__Property_range,m=c.exo__Property_cardinality,b=c.exo__Property_severity,S=c.exo__Property_minCount,_=r.asArray(h).map(O=>r.wikilinkToIRI(O,s)).filter(O=>O!==null);if(_.length===0)return;let A=r.asArray(g).map(O=>r.wikilinkToIRI(O,s)).filter(O=>O!==null),E=r.cardinalityFromLabel(typeof m=="string"?m:void 0),w=r.severityFromValue(typeof b=="string"?b:void 0),R=(0,Uj.parseMinCount)(S);t.register({propertyIRI:p,domain:_,range:A.length>0?A:void 0,cardinality:E,severity:w,minCount:R})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let n=t[1],i={},s=n.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(),p=f[2].trim();p===""?(o=d,c=[]):i[d]=p}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Ar.Namespace.fromPropertyKey(e);if(!t)return null;try{return t.namespace.term(t.localName).value}catch{return null}}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),n=/\[\[([^\]]+)\]\]/.exec(t);return n?n[1]:t}static wikilinkToIRI(e,t){let n=r.extractWikilinkRef(e);if(!n)return null;let i=n.split("|"),s=i.length>1?[i[1],i[0]]:[i[0]];for(let c of s){let l=r.labelToIRI(c.trim());if(l)return l}let o=r.datatypeRangeToIRI(n);if(o)return o;if(n.startsWith("sh:"))return cS+n.substring(3);if(t)for(let c of s){let l=t.get(c.trim().toLowerCase());if(l===void 0)continue;let u=r.labelToIRI(l);if(u)return u}return null}static datatypeRangeToIRI(e){return e.startsWith("http://")||e.startsWith("https://")?e:(0,Zoe.xsdDatatypeIRI)(e)}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";if(e.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=r.extractWikilinkRef(e)??e,n=t.split("|").pop()??t;if(n.includes("Single"))return"Single";if(n.includes("Multiple"))return"Multiple";if(t.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===cS+"Violation"?"sh:Violation":e.includes("Warning")||e===cS+"Warning"?"sh:Warning":e.includes("Info")||e===cS+"Info"?"sh:Info":"sh:Violation"}};Po.ShapeLoader=$a;$a.FILE_IRI_UID_RE=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;$a.BARE_UID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;$a.EXO_PROPERTY_UID="38277bfa-d7f9-4a75-b856-b23276ab0db3";$a.EXO_OBJECT_PROPERTY_UID="9a1cf31c-9d41-4ef3-9023-584a8d087d16";$a.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";$a.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var G2=T(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.ShapeRegistry=void 0;gd.extractUidFromIRI=V2;gd.validate=dae;var eae=Le(),U2=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(n=>[n.propertyIRI,n])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};gd.ShapeRegistry=U2;var tae="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",rae=["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/ns/shacl#","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 nae(r){return rae.some(e=>r.startsWith(e))}a(nae,"isExternalOntologyIRI");var zj=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function Gj(r){return zj.some(e=>r.startsWith(e))}a(Gj,"isXSDDatatypeIRI");function iae(r){for(let e of zj)if(r.startsWith(e))return r.substring(e.length);return null}a(iae,"xsdLocalName");var sae="http://www.w3.org/2001/XMLSchema#decimal",oae="http://www.w3.org/2001/XMLSchema#integer",qj="http://www.w3.org/2001/XMLSchema#string",em=/^[+-]?\d+$/,tm=/^\+?\d+$/,aae=/^[+-]?(\d+(\.\d*)?|\.\d+)$/,Wj=/^([+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?|[+-]?INF|NaN)$/,cae={integer:em,long:em,int:em,short:em,byte:em,nonNegativeInteger:tm,unsignedLong:tm,unsignedInt:tm,unsignedShort:tm,unsignedByte:tm,positiveInteger:/^\+?0*[1-9]\d*$/,nonPositiveInteger:/^(-\d+|\+?0+)$/,negativeInteger:/^-0*[1-9]\d*$/,decimal:aae,float:Wj,double:Wj,gYear:/^-?\d{4,}(Z|[+-]\d{2}:\d{2})?$/},lae=/^(true|false)$/;function uae(r,e,t){if(e===t)return!0;let n=iae(t);if(n===null)return!1;if(e===sae||e===oae){let i=cae[n];return i!==void 0&&i.test(r)}return e===qj&&n==="boolean"?lae.test(r):e===qj&&n==="anyURI"?eae.IRI.isValidIRI(r):!1}a(uae,"literalConformsToDatatype");var fae=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function V2(r){let e=fae.exec(r);return e?e[1].toLowerCase():null}a(V2,"extractUidFromIRI");function dae(r,e,t,n){let i=new Map,s=new Map;for(let d of r){let{subject:p,predicate:h,object:g}=d;if(p.type!=="iri"||h.type!=="iri"||g.type!=="iri"&&g.type!=="literal")continue;let m=p.value,b=h.value,S=g;if(b===e.typePredicateIRI||b===tae){if(S.type==="iri"){let A=i.get(m)??[];A.push(S.value),i.set(m,A);let E=V2(m);if(E){let w=`uid:${E}`,R=i.get(w)??[];R.push(S.value),i.set(w,R)}}}else{let A=s.get(m);A||(A=new Map,s.set(m,A));let E=A.get(b)??[];E.push(S),A.set(b,E)}}let o=[],c=new Set([...i.keys(),...s.keys()]),l=e.getAllShapes(),u=new Map,f=a(d=>{let p=[...new Set(d)].sort().map(m=>`${m.length}:${m}`).join(""),h=u.get(p);if(h!==void 0)return h;let g=l.filter(m=>m.domain.length===0||m.domain.some(b=>d.some(S=>S===b||t.isSubClassOf(S,b))));return u.set(p,g),g},"applicableShapesFor");for(let d of c){if(d.startsWith("uid:"))continue;let p=i.get(d)??[],h=s.get(d)??new Map;for(let g of f(p)){let m=h.get(g.propertyIRI)??[];if(g.minCount!==void 0&&g.minCount>0&&m.length<g.minCount){o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"minCount",message:g.message??`sh:minCount violation: expected at least ${g.minCount} value(s) for <${g.propertyIRI}>`});continue}if(m.length!==0){if(g.cardinality==="Single"&&m.length>1){o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"maxCount",message:g.message??`sh:maxCount violation: expected at most 1 value for <${g.propertyIRI}>, got ${m.length}`});continue}if(g.range&&g.range.length>0){for(let b of m)if(b.type==="iri"){if(nae(b.value))continue;let S=g.range.filter(E=>!Gj(E));if(S.length===0)continue;let _=i.get(b.value)??[];if(_.length===0){let E=V2(b.value);E&&(_=i.get(`uid:${E}`)??[])}if(!S.some(E=>_.some(w=>w===E||t.isSubClassOf(w,E)))){let E=_.length===0;o.push({focusNode:d,propertyPath:g.propertyIRI,severity:E?"sh:Warning":g.severity,constraint:"class",message:E?`sh:class unresolvable-ref: <${b.value}> has no resolvable type in this vault (cross-vault, symbolic, or external reference); not validated against ${S.join(" | ")}`:g.message??`sh:class violation: <${b.value}> does not conform to expected class ${S.join(" | ")}`,actualValue:b.value,expectedRange:S.join(" | ")})}}else if(b.type==="literal"){let S=g.range.filter(E=>Gj(E));if(S.length===0)continue;let _=b.datatype??"http://www.w3.org/2001/XMLSchema#string";S.some(E=>uae(b.value,_,E))||o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"datatype",message:g.message??`sh:datatype violation: literal "${b.value}" has datatype <${_}>, expected ${S.join(" | ")}`,actualValue:b.value,expectedRange:S.join(" | ")})}}}}}if(n?.closedWorldMode)for(let d of c){let p=s.get(d)??new Map;for(let h of p.keys())e.hasShape(h)||o.push({focusNode:d,propertyPath:h,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${h}> has no registered shape`})}return o.sort((d,p)=>{let h=d.focusNode.localeCompare(p.focusNode);return h!==0?h:d.propertyPath.localeCompare(p.propertyPath)}),{conforms:!o.some(d=>d.severity==="sh:Violation"),violations:o}}a(dae,"validate")});var Kj=T(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});lS.ApplicationErrorHandler=void 0;var q2=xo(),pae=Oo(),hae=Zl(),W2=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,n){this.logger=t,this.notifier=n,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 n=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(n.message),this.callTelemetryHooks("onError",n,t),this.formatError(n)}async executeWithRetry(e,t){let n,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(n=this.ensureApplicationError(s,t),!n.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",n,t),i>=this.retryConfig.maxRetries&&n.retriable&&this.callTelemetryHooks("onRetryExhausted",n,i+1),n;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",n,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw n}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof q2.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends q2.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 q2.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=pae.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(`
332
+ \u2022 Contact support if the issue persists`}};oS.ServiceError=k2});var Bj=T($r=>{"use strict";Object.defineProperty($r,"__esModule",{value:!0});$r.ServiceError=$r.ResourceExhaustedError=$r.NotFoundError=$r.PermissionError=$r.StateTransitionError=$r.NetworkError=$r.ValidationError=$r.ApplicationError=$r.ErrorCode=void 0;var Voe=Oo();Object.defineProperty($r,"ErrorCode",{enumerable:!0,get:a(function(){return Voe.ErrorCode},"get")});var Goe=xo();Object.defineProperty($r,"ApplicationError",{enumerable:!0,get:a(function(){return Goe.ApplicationError},"get")});var qoe=Dj();Object.defineProperty($r,"ValidationError",{enumerable:!0,get:a(function(){return qoe.ValidationError},"get")});var Woe=Lj();Object.defineProperty($r,"NetworkError",{enumerable:!0,get:a(function(){return Woe.NetworkError},"get")});var zoe=Nj();Object.defineProperty($r,"StateTransitionError",{enumerable:!0,get:a(function(){return zoe.StateTransitionError},"get")});var Koe=kj();Object.defineProperty($r,"PermissionError",{enumerable:!0,get:a(function(){return Koe.PermissionError},"get")});var Hoe=Mj();Object.defineProperty($r,"NotFoundError",{enumerable:!0,get:a(function(){return Hoe.NotFoundError},"get")});var Yoe=$j();Object.defineProperty($r,"ResourceExhaustedError",{enumerable:!0,get:a(function(){return Yoe.ResourceExhaustedError},"get")});var Xoe=jj();Object.defineProperty($r,"ServiceError",{enumerable:!0,get:a(function(){return Xoe.ServiceError},"get")})});var $2=T(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.ShapeRegistry=void 0;var M2=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}};aS.ShapeRegistry=M2});var Vj=T(Po=>{"use strict";var Qoe=Po&&Po.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=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(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),Joe=Po&&Po.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),j2=Po&&Po.__importStar||(function(){var r=a(function(e){return r=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},r(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=r(e),i=0;i<n.length;i++)n[i]!=="default"&&Qoe(t,e,n[i]);return Joe(t,e),t}})();Object.defineProperty(Po,"__esModule",{value:!0});Po.ShapeLoader=void 0;var B2=$2(),Us=Le(),Zh=Ye(),Ar=Rt(),Zoe=y0(),Uj=NI(),cS="http://www.w3.org/ns/shacl#",NFe=[["exo__",Ar.Namespace.EXO],["ems__",Ar.Namespace.EMS],["exocmd__",Ar.Namespace.EXOCMD],["ims__",Ar.Namespace.IMS],["ztlk__",Ar.Namespace.ZTLK],["ptms__",Ar.Namespace.PTMS],["lit__",Ar.Namespace.LIT],["inbox__",Ar.Namespace.INBOX],["pmbok__",Ar.Namespace.PMBOK]],$a=class r{static{a(this,"ShapeLoader")}static async loadFromVaultFS(e,t){let{readdir:n,readFile:i}=await Promise.resolve().then(()=>j2(require("fs/promises"))),s=await Promise.resolve().then(()=>j2(require("path"))),o=new B2.ShapeRegistry,c={classEdges:[],candidates:[],uidToLabel:new Map},l=t?.scanFilter?await t.scanFilter():void 0;await r.scanDir(e,c,{readdir:n,readFile:t?.readFile??i,path:s,shouldRead:l});let u=r.propertyClassKeysFromEdges(c.classEdges);for(let f of c.candidates)try{r.registerCandidate(f,o,u,s,c.uidToLabel)}catch{}return o}static async loadFromRDFGraph(e){let t=new B2.ShapeRegistry,n=Ar.Namespace.EXO,i=Ar.Namespace.RDFS,s=Ar.Namespace.RDF,o=await r.buildUidClassIndex(e),c=await r.collectPropertyClassIRIs(e,o),l=await Promise.all([...c].map(async f=>{try{return await e.match(void 0,s.term("type"),new Us.IRI(f))}catch{return[]}})),u=new Set;for(let f of l.flat())f.subject instanceof Us.IRI&&u.add(f.subject.value);for(let f of u){let d;try{d=new Us.IRI(f)}catch{continue}let[p,h,g,m,b,S,_,A,E]=await Promise.all([e.match(d,i.term("domain"),void 0),e.match(d,n.term("Property_domain"),void 0),e.match(d,i.term("range"),void 0),e.match(d,n.term("Property_range"),void 0),e.match(d,n.term("Property_cardinality"),void 0),e.match(d,n.term("Property_severity"),void 0),e.match(d,n.term("Asset_label"),void 0),e.match(d,i.term("label"),void 0),e.match(d,n.term("Property_minCount"),void 0)]),w=[..._,...A],R=[...p,...h],O=[...g,...m];if(R.length===0)continue;let P=null;for(let Z of w)if(Z.object instanceof Zh.Literal&&(P=r.labelToIRI(Z.object.value),P))break;if(!P)continue;let N=await Promise.all(R.map(async Z=>Z.object instanceof Us.IRI?await r.resolveClassIRI(Z.object.value,e,o):null)),j=Array.from(new Set(N.filter(Z=>Z!==null))),U=await Promise.all(O.map(async Z=>Z.object instanceof Us.IRI?await r.resolveClassIRI(Z.object.value,e,o):Z.object instanceof Zh.Literal?r.datatypeRangeToIRI(Z.object.value):null)),G=Array.from(new Set(U.filter(Z=>Z!==null))),$=r.cardinalityFromIRI(b[0]?.object instanceof Us.IRI?b[0].object.value:void 0),k=r.severityFromValue(S[0]?.object instanceof Zh.Literal||S[0]?.object instanceof Us.IRI?S[0].object.value:void 0),te=(0,Uj.parseMinCount)(E.map(Z=>Z.object));t.register({propertyIRI:P,domain:j,range:G.length>0?G:void 0,cardinality:$,severity:k,minCount:te})}return t}static async loadFromShapeJSON(e){let{readFile:t}=await Promise.resolve().then(()=>j2(require("fs/promises"))),n=await t(e,"utf-8"),i=JSON.parse(n),s=new B2.ShapeRegistry;for(let o of Object.values(i.shapes))s.register(o);return s}static extractUidFromFileIRI(e){let t=r.FILE_IRI_UID_RE.exec(e);return t?t[1].toLowerCase():null}static async buildUidClassIndex(e){let t=Ar.Namespace.RDFS,n=Ar.Namespace.EXO,[i,s]=await Promise.all([e.match(void 0,t.term("label"),void 0),e.match(void 0,n.term("Asset_label"),void 0)]),o=new Map;for(let c of[...i,...s]){if(!(c.subject instanceof Us.IRI)||!(c.object instanceof Zh.Literal))continue;let l=r.extractUidFromFileIRI(c.subject.value);if(!l||o.has(l))continue;let u=c.object.value.trim();if(/\s/.test(u))continue;let f=r.labelToIRI(u);f&&o.set(l,f)}return o}static async collectPropertyClassIRIs(e,t){let n=Ar.Namespace.EXO,i=Ar.Namespace.RDFS,[s,o]=await Promise.all([e.match(void 0,n.term("Class_superClass"),void 0),e.match(void 0,i.term("subClassOf"),void 0)]),c=new Map,l=a(async p=>{let h=c.get(p);return h===void 0&&(h=await r.resolveClassIRI(p,e,t),c.set(p,h)),h},"canon"),u=new Map;for(let p of[...s,...o]){if(!(p.subject instanceof Us.IRI)||!(p.object instanceof Us.IRI))continue;let[h,g]=await Promise.all([l(p.subject.value),l(p.object.value)]);if(!h||!g||h===g)continue;let m=u.get(g)??new Set;m.add(h),u.set(g,m)}let f=new Set([n.term("Property").value,n.term("ObjectProperty").value]),d=[...f];for(;d.length>0;){let p=d.shift();for(let h of u.get(p)??[])f.has(h)||(f.add(h),d.push(h))}return f}static async resolveClassIRI(e,t,n){if(e.startsWith("https://exocortex.my/ontology/")||e.startsWith("http://www.w3.org/"))return e;let i;try{i=new Us.IRI(e)}catch{return null}let s=Ar.Namespace.RDFS,o=Ar.Namespace.EXO,[c,l]=await Promise.all([t.match(i,s.term("label"),void 0),t.match(i,o.term("Asset_label"),void 0)]);for(let u of[...c,...l])if(u.object instanceof Zh.Literal){let f=r.labelToIRI(u.object.value);if(f)return f}if(n){let u=r.extractUidFromFileIRI(e);if(u){let f=n.get(u);if(f)return f}}return e}static propertyClassKeysFromEdges(e){let t=["exo__Property",r.EXO_PROPERTY_UID,"exo__ObjectProperty",r.EXO_OBJECT_PROPERTY_UID],n=new Set(t),i=[...t];for(;i.length>0;){let s=i.shift();for(let o of e)if(o.parentKeys.includes(s)&&!o.childKeys.some(c=>n.has(c)))for(let c of o.childKeys)n.add(c),i.push(c)}return n}static wikilinkClassKeys(e){let t=r.extractWikilinkRef(e);if(!t)return[];let n=[t.trim()];for(let i of t.split("|")){let s=i.trim();s.length>0&&n.push(s)}return n}static async scanDir(e,t,n){let i;try{i=await n.readdir(e,{withFileTypes:!0})}catch{return}i.sort((s,o)=>s.name<o.name?-1:s.name>o.name?1:0);for(let s of i){let o=n.path.join(e,s.name);if(s.isDirectory())await r.scanDir(o,t,n);else if(s.isFile()&&s.name.endsWith(".md")){if(n.shouldRead&&!n.shouldRead(o))continue;try{await r.collectFile(o,t,n.readFile,n.path)}catch{}}}}static async collectFile(e,t,n,i){let s;try{s=await n(e,"utf-8")}catch{return}let o=r.parseFrontmatter(s);if(!o)return;r.indexUidLabel(e,o,t.uidToLabel,i);let c=r.asArray(o.exo__Class_superClass);if(c.length>0){let l=[i.basename(e,".md")],u=o.exo__Asset_uid;typeof u=="string"&&u.trim().length>0&&l.push(u.trim().replace(/^["']|["']$/g,""));let f=o.exo__Asset_label;typeof f=="string"&&f.trim().length>0&&l.push(f.trim().replace(/^["']|["']$/g,"")),t.classEdges.push({childKeys:l,parentKeys:c.flatMap(d=>r.wikilinkClassKeys(d))})}r.asArray(o.exo__Property_domain).length>0&&t.candidates.push({filePath:e,fm:o})}static indexUidLabel(e,t,n,i){let s=t.exo__Asset_label;if(typeof s!="string")return;let o=s.trim().replace(/^["']|["']$/g,"");if(o.length===0||/\s/.test(o)||!Ar.Namespace.fromPropertyKey(o))return;let c=t.exo__Asset_uid,l=[typeof c=="string"?c.trim().replace(/^["']|["']$/g,""):"",i.basename(e,".md")];for(let u of l){if(!r.BARE_UID_RE.test(u))continue;let f=u.toLowerCase();n.has(f)||n.set(f,o)}}static registerCandidate(e,t,n,i,s){let{filePath:o,fm:c}=e;if(!r.asArray(c.exo__Instance_class).some(O=>r.wikilinkClassKeys(O).some(P=>n.has(P))))return;let f=null,d=c.exo__Asset_label;if(typeof d=="string"&&d.trim().length>0)f=d.trim().replace(/^["']|["']$/g,"");else{let O=i.basename(o,".md");Ar.Namespace.fromPropertyKey(O)&&(f=O)}if(!f)return;let p=r.labelToIRI(f);if(!p)return;let h=c.exo__Property_domain,g=c.exo__Property_range,m=c.exo__Property_cardinality,b=c.exo__Property_severity,S=c.exo__Property_minCount,_=r.asArray(h).map(O=>r.wikilinkToIRI(O,s)).filter(O=>O!==null);if(_.length===0)return;let A=r.asArray(g).map(O=>r.wikilinkToIRI(O,s)).filter(O=>O!==null),E=r.cardinalityFromLabel(typeof m=="string"?m:void 0),w=r.severityFromValue(typeof b=="string"?b:void 0),R=(0,Uj.parseMinCount)(S);t.register({propertyIRI:p,domain:_,range:A.length>0?A:void 0,cardinality:E,severity:w,minCount:R})}static parseFrontmatter(e){let t=/^---\r?\n([\s\S]*?)\r?\n---/.exec(e);if(!t)return null;let n=t[1],i={},s=n.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(),p=f[2].trim();p===""?(o=d,c=[]):i[d]=p}return o&&c&&(i[o]=c),i}static labelToIRI(e){let t=Ar.Namespace.fromPropertyKey(e);if(!t)return null;try{return t.namespace.term(t.localName).value}catch{return null}}static extractWikilinkRef(e){let t=e.replace(/^["']|["']$/g,""),n=/\[\[([^\]]+)\]\]/.exec(t);return n?n[1]:t}static wikilinkToIRI(e,t){let n=r.extractWikilinkRef(e);if(!n)return null;let i=n.split("|"),s=i.length>1?[i[1],i[0]]:[i[0]];for(let c of s){let l=r.labelToIRI(c.trim());if(l)return l}let o=r.datatypeRangeToIRI(n);if(o)return o;if(n.startsWith("sh:"))return cS+n.substring(3);if(t)for(let c of s){let l=t.get(c.trim().toLowerCase());if(l===void 0)continue;let u=r.labelToIRI(l);if(u)return u}return null}static datatypeRangeToIRI(e){return e.startsWith("http://")||e.startsWith("https://")?e:(0,Zoe.xsdDatatypeIRI)(e)}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";if(e.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(e.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}}static cardinalityFromLabel(e){if(!e)return;let t=r.extractWikilinkRef(e)??e,n=t.split("|").pop()??t;if(n.includes("Single"))return"Single";if(n.includes("Multiple"))return"Multiple";if(t.includes(r.CARDINALITY_SINGLE_UID))return"Single";if(t.includes(r.CARDINALITY_MULTIPLE_UID))return"Multiple"}static severityFromValue(e){return!e||e.includes("Violation")||e===cS+"Violation"?"sh:Violation":e.includes("Warning")||e===cS+"Warning"?"sh:Warning":e.includes("Info")||e===cS+"Info"?"sh:Info":"sh:Violation"}};Po.ShapeLoader=$a;$a.FILE_IRI_UID_RE=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;$a.BARE_UID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;$a.EXO_PROPERTY_UID="38277bfa-d7f9-4a75-b856-b23276ab0db3";$a.EXO_OBJECT_PROPERTY_UID="9a1cf31c-9d41-4ef3-9023-584a8d087d16";$a.CARDINALITY_SINGLE_UID="c93c4b2f-b43d-4cc9-8dd0-31514d608da2";$a.CARDINALITY_MULTIPLE_UID="59a37aa7-ffbe-4e0d-ba60-06ae370d880f"});var G2=T(gd=>{"use strict";Object.defineProperty(gd,"__esModule",{value:!0});gd.ShapeRegistry=void 0;gd.extractUidFromIRI=V2;gd.validate=dae;var eae=Le(),U2=class{static{a(this,"ShapeRegistry")}constructor(e=[],t="https://exocortex.my/ontology/exo#Instance_class"){this.shapeMap=new Map(e.map(n=>[n.propertyIRI,n])),this.typePredicateIRI=t}getShape(e){return this.shapeMap.get(e)}getAllShapes(){return Array.from(this.shapeMap.values())}hasShape(e){return this.shapeMap.has(e)}};gd.ShapeRegistry=U2;var tae="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",rae=["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/ns/shacl#","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 nae(r){return rae.some(e=>r.startsWith(e))}a(nae,"isExternalOntologyIRI");var zj=["http://www.w3.org/2001/XMLSchema#","https://exocortex.my/ontology/xsd#"];function Gj(r){return zj.some(e=>r.startsWith(e))}a(Gj,"isXSDDatatypeIRI");function iae(r){for(let e of zj)if(r.startsWith(e))return r.substring(e.length);return null}a(iae,"xsdLocalName");var sae="http://www.w3.org/2001/XMLSchema#decimal",oae="http://www.w3.org/2001/XMLSchema#integer",qj="http://www.w3.org/2001/XMLSchema#string",em=/^[+-]?\d+$/,tm=/^\+?\d+$/,aae=/^[+-]?(\d+(\.\d*)?|\.\d+)$/,Wj=/^([+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?|[+-]?INF|NaN)$/,cae={integer:em,long:em,int:em,short:em,byte:em,nonNegativeInteger:tm,unsignedLong:tm,unsignedInt:tm,unsignedShort:tm,unsignedByte:tm,positiveInteger:/^\+?0*[1-9]\d*$/,nonPositiveInteger:/^(-\d+|\+?0+)$/,negativeInteger:/^-0*[1-9]\d*$/,decimal:aae,float:Wj,double:Wj,gYear:/^-?\d{4,}(Z|[+-]\d{2}:\d{2})?$/},lae=/^(true|false)$/;function uae(r,e,t){if(e===t)return!0;let n=iae(t);if(n===null)return!1;if(e===sae||e===oae){let i=cae[n];return i!==void 0&&i.test(r)}return e===qj&&n==="boolean"?lae.test(r):e===qj&&n==="anyURI"?eae.IRI.isValidIRI(r):!1}a(uae,"literalConformsToDatatype");var fae=/\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i;function V2(r){let e=fae.exec(r);return e?e[1].toLowerCase():null}a(V2,"extractUidFromIRI");function dae(r,e,t,n){let i=new Map,s=new Map;for(let d of r){let{subject:p,predicate:h,object:g}=d;if(p.type!=="iri"||h.type!=="iri"||g.type!=="iri"&&g.type!=="literal")continue;let m=p.value,b=h.value,S=g;if(b===e.typePredicateIRI||b===tae){if(S.type==="iri"){let A=i.get(m)??[];A.push(S.value),i.set(m,A);let E=V2(m);if(E){let w=`uid:${E}`,R=i.get(w)??[];R.push(S.value),i.set(w,R)}}}else{let A=s.get(m);A||(A=new Map,s.set(m,A));let E=A.get(b)??[];E.push(S),A.set(b,E)}}let o=[],c=new Set([...i.keys(),...s.keys()]),l=e.getAllShapes(),u=new Map,f=a(d=>{let p=[...new Set(d)].sort().map(m=>`${m.length}:${m}`).join(""),h=u.get(p);if(h!==void 0)return h;let g=l.filter(m=>m.domain.length===0||m.domain.some(b=>d.some(S=>S===b||t.isSubClassOf(S,b))));return u.set(p,g),g},"applicableShapesFor");for(let d of c){if(d.startsWith("uid:"))continue;let p=i.get(d)??[],h=s.get(d)??new Map;for(let g of f(p)){let m=h.get(g.propertyIRI)??[];if(g.minCount!==void 0&&g.minCount>0&&m.length<g.minCount){o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"minCount",message:g.message??`sh:minCount violation: expected at least ${g.minCount} value(s) for <${g.propertyIRI}>`});continue}if(m.length!==0){if(g.cardinality==="Single"&&m.length>1){o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"maxCount",message:g.message??`sh:maxCount violation: expected at most 1 value for <${g.propertyIRI}>, got ${m.length}`});continue}if(g.range&&g.range.length>0){for(let b of m)if(b.type==="iri"){if(nae(b.value))continue;let S=g.range.filter(E=>!Gj(E));if(S.length===0)continue;let _=i.get(b.value)??[];if(_.length===0){let E=V2(b.value);E&&(_=i.get(`uid:${E}`)??[])}if(!S.some(E=>_.some(w=>w===E||t.isSubClassOf(w,E)))){let E=_.length===0;o.push({focusNode:d,propertyPath:g.propertyIRI,severity:E?"sh:Warning":g.severity,constraint:"class",message:E?`sh:class unresolvable-ref: <${b.value}> has no resolvable type in this vault (cross-vault, symbolic, or external reference); not validated against ${S.join(" | ")}`:g.message??`sh:class violation: <${b.value}> does not conform to expected class ${S.join(" | ")}`,actualValue:b.value,expectedRange:S.join(" | ")})}}else if(b.type==="literal"){let S=g.range.filter(E=>Gj(E));if(S.length===0)continue;let _=b.datatype??"http://www.w3.org/2001/XMLSchema#string";S.some(E=>uae(b.value,_,E))||o.push({focusNode:d,propertyPath:g.propertyIRI,severity:g.severity,constraint:"datatype",message:g.message??`sh:datatype violation: literal "${b.value}" has datatype <${_}>, expected ${S.join(" | ")}`,actualValue:b.value,expectedRange:S.join(" | ")})}}}}}if(n?.closedWorldMode)for(let d of c){let p=s.get(d)??new Map;for(let h of p.keys())e.hasShape(h)||o.push({focusNode:d,propertyPath:h,severity:"sh:Warning",constraint:"unknown-property",message:`Unknown property: <${h}> has no registered shape`})}return o.sort((d,p)=>{let h=d.focusNode.localeCompare(p.focusNode);return h!==0?h:d.propertyPath.localeCompare(p.propertyPath)}),{conforms:!o.some(d=>d.severity==="sh:Violation"),violations:o}}a(dae,"validate")});var Kj=T(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});lS.ApplicationErrorHandler=void 0;var q2=xo(),pae=Oo(),hae=Zl(),W2=class{static{a(this,"ApplicationErrorHandler")}constructor(e={},t,n){this.logger=t,this.notifier=n,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 n=this.ensureApplicationError(e,t);return this.notifier&&this.notifier.error(n.message),this.callTelemetryHooks("onError",n,t),this.formatError(n)}async executeWithRetry(e,t){let n,i=0;for(;i<=this.retryConfig.maxRetries;)try{return await e()}catch(s){if(n=this.ensureApplicationError(s,t),!n.retriable||i>=this.retryConfig.maxRetries)throw this.callTelemetryHooks("onError",n,t),i>=this.retryConfig.maxRetries&&n.retriable&&this.callTelemetryHooks("onRetryExhausted",n,i+1),n;let o=this.calculateDelay(i);this.callTelemetryHooks("onRetry",n,i+1,o),this.logger?.debug(`Retrying after ${o}ms (attempt ${i+1}/${this.retryConfig.maxRetries})`),await this.sleep(o),i++}throw n}registerTelemetryHook(e){this.telemetryHooks.add(e)}unregisterTelemetryHook(e){this.telemetryHooks.delete(e)}ensureApplicationError(e,t){if(e instanceof q2.ApplicationError){if(t){let i=e,s={...e.context,...t};return new class extends q2.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 q2.ApplicationError{static{a(this,"UnknownError")}constructor(s,o){super(s,{originalError:o.name,...t}),this.code=pae.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(`
333
333
  `)}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 n of this.telemetryHooks)try{let i=n[e];i&&i.apply(n,t)}catch(i){hae.LoggingService.error("Error in telemetry hook",i instanceof Error?i:new Error(String(i)))}}};lS.ApplicationErrorHandler=W2});var Hj=T(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});uS.ApplicationErrorHandler=void 0;var mae=Kj();Object.defineProperty(uS,"ApplicationErrorHandler",{enumerable:!0,get:a(function(){return mae.ApplicationErrorHandler},"get")})});var z2=T(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.parseTarball=Qj;fS.parseTarballGzip=wae;var gae={0:"file",1:"hardLink",2:"symbolicLink",3:"characterDevice",4:"blockDevice",5:"directory",6:"fifo",7:"contiguousFile",g:"globalExtendedHeader",x:"extendedHeader",D:"gnuDirectory",I:"gnuInodeMetadata",K:"gnuLongLinkName",L:"gnuLongFileName",N:"gnuOldLongFileName",M:"gnuMultiVolume",S:"gnuSparseFile",E:"gnuExtendedSparse"},yae=new Set(["extendedHeader","globalExtendedHeader","gnuLongFileName","gnuOldLongFileName","gnuLongLinkName"]),Yj;function Xj(){return Yj??(Yj=new TextDecoder)}a(Xj,"getDecoder");function rm(r,e,t){let n=r.subarray(e,e+t),i=n.indexOf(0);return Xj().decode(i===-1?n:n.subarray(0,i))}a(rm,"readString");function bae(r,e,t){let n="";for(let s=0;s<t;s++)n+=String.fromCodePoint(r[e+s]);let i=Number.parseInt(n,8);return Number.isNaN(i)?0:i}a(bae,"readNumber");function _ae(r){let e=Xj().decode(r),t={};for(let n of e.split(`
334
334
  `)){let i=n.indexOf("=");if(i===-1)continue;let s=n.slice(n.indexOf(" ")+1,i),o=n.slice(i+1);s&&(t[s]=o)}return t}a(_ae,"parseExtendedHeaders");function Sae(r){let e=r.replace(/\\/g,"/");e=e.replace(/^[a-zA-Z]:\//,""),e=e.replace(/^\/+/,"");let t=e.startsWith("./"),n=e.split("/"),i=[];for(let o of n)o===".."?i.pop():o!=="."&&o!==""&&i.push(o);let s=i.join("/");return t&&!s.startsWith("./")&&(s="./"+s),r.endsWith("/")&&!s.endsWith("/")&&(s+="/"),s}a(Sae,"sanitizePath");function Qj(r){let e=r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r:r.slice(),t=[],n=0,i,s;for(;n+512<=e.byteLength;){let o=rm(e,n,100);if(o.length===0)break;let c=!1;if(i){let h=i.path??i.linkpath;h&&(o=h,c=!0)}let l=bae(e,n+124,12),u=512+512*Math.trunc(l/512)+(l%512?512:0),f=rm(e,n+156,1)||"0",d=gae[f]??f;if(d==="extendedHeader"||d==="globalExtendedHeader"){let h=_ae(e.subarray(n+512,n+512+l));d==="extendedHeader"?i=h:(i=void 0,s={...s,...h}),n+=u;continue}if(yae.has(d)){i={path:rm(e,n+512,l)},n+=u;continue}if(!c&&rm(e,n+257,6).startsWith("ustar")){let g=rm(e,n+345,155);g.length>0&&(o=`${g}/${o}`)}o=Sae(o);let p=l===0?void 0:e.subarray(n+512,n+512+l);t.push({name:o,type:d,size:l,data:p}),i=void 0,n+=u}return t}a(Qj,"parseTarball");async function wae(r){let e=new Uint8Array(r instanceof Uint8Array?r:new Uint8Array(r)),t=new DecompressionStream("gzip"),n=t.writable.getWriter(),[,i]=await Promise.all([n.write(e).then(()=>n.close()),new Response(t.readable).arrayBuffer()]);return Qj(new Uint8Array(i))}a(wae,"parseTarballGzip")});var pS=T(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.isBinaryPayload=H2;dS.restCreateCommit=vae;function H2(r){return typeof r!="string"}a(H2,"isBinaryPayload");var Eae="https://api.github.com";function Jj(r){if(r!==null&&typeof r=="object"&&"object"in r){let e=r.object;if(e!==null&&typeof e=="object"&&"sha"in e){let t=e.sha;return typeof t=="string"?t:void 0}}}a(Jj,"readObjectSha");function K2(r){if(r!==null&&typeof r=="object"&&"sha"in r){let e=r.sha;return typeof e=="string"?e:void 0}}a(K2,"readSha");async function vae(r,e){let{owner:t,repo:n,branch:i,files:s,message:o}=e,c=e.deletions??[],l=(e.baseURL??Eae).replace(/\/$/,""),u=e.redact??(P=>P);if(typeof t!="string"||t.length===0)throw new Error("restCreateCommit: owner is required");if(typeof n!="string"||n.length===0)throw new Error("restCreateCommit: repo is required");if(typeof i!="string"||i.length===0)throw new Error("GitHub createCommit: branch is required");if(!(s instanceof Map)||s.size===0&&c.length===0)throw new Error("GitHub createCommit: files map must be non-empty (unless deletions are provided)");let f=new Set;for(let P of c){if(typeof P!="string"||P.length===0)throw new Error("GitHub createCommit: deletion path must be a non-empty string");if(s.has(P))throw new Error(u(`GitHub createCommit: path ${P} is both written and deleted \u2014 ambiguous`));f.add(P)}if(typeof o!="string"||o.length===0)throw new Error("GitHub createCommit: message is required");let d=encodeURIComponent(t),p=encodeURIComponent(n),h=encodeURIComponent(i),g=await r({method:"GET",url:`${l}/repos/${d}/${p}/git/refs/heads/${h}`}),m=Jj(g?.json);if(typeof m!="string"||m.length===0)throw new Error(u(`GitHub createCommit: missing object.sha for ref heads/${i}`));if(e.expectedHeadSha!==void 0&&m!==e.expectedHeadSha)throw new Error(u(`GitHub createCommit: head heads/${i} moved since the caller's check (expected ${e.expectedHeadSha}, found ${m}) \u2014 refusing to avoid overwriting a concurrent change`));let b=new Map;for(let[P,N]of s){if(!H2(N))continue;let j=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/blobs`,contentType:"application/json",body:JSON.stringify({content:N.base64,encoding:"base64"})}),U=K2(j?.json);if(typeof U!="string"||U.length===0)throw new Error(u(`GitHub createCommit: blob create returned no sha for ${P}`));b.set(P,U)}let S=Array.from(s.entries()).map(([P,N])=>H2(N)?{path:P,mode:"100644",type:"blob",sha:b.get(P)}:{path:P,mode:"100644",type:"blob",content:N});for(let P of f)S.push({path:P,mode:"100644",type:"blob",sha:null});let _=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/trees`,contentType:"application/json",body:JSON.stringify({base_tree:m,tree:S})}),A=K2(_?.json);if(typeof A!="string"||A.length===0)throw new Error(u("GitHub createCommit: tree create returned no sha"));let E=await r({method:"POST",url:`${l}/repos/${d}/${p}/git/commits`,contentType:"application/json",body:JSON.stringify({message:o,tree:A,parents:[m]})}),w=K2(E?.json);if(typeof w!="string"||w.length===0)throw new Error(u("GitHub createCommit: commit create returned no sha"));let R=await r({method:"PATCH",url:`${l}/repos/${d}/${p}/git/refs/heads/${h}`,contentType:"application/json",body:JSON.stringify({sha:w,force:!1})}),O=Jj(R?.json);if(O!==w)throw new Error(u(`GitHub createCommit: ref update mismatch (expected ${w}, got ${O})`));return w}a(vae,"restCreateCommit")});var t4=T(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MATERIALIZE_PROGRESS_MIN_FILES=Di.MATERIALIZE_PROGRESS_INTERVAL=void 0;Di.discoverWrapperDir=Zj;Di.extractShaFromWrapper=e4;Di.mountAssetSpaceFiles=Iae;Di.escapeGitmodulesRegex=X2;Di.appendGitmodulesEntry=Rae;Di.stripGitmodulesEntry=Cae;var Tae=z2(),Y2=new Set(["globalExtendedHeader","extendedHeader"]);function hS(r){let e=r.replace(/\\/g,"/").replace(/\/+/g,"/");for(;e.startsWith("./");)e=e.slice(2);return e}a(hS,"normalizeEntryPath");function Zj(r){let e=r.find(s=>!Y2.has(s.type)&&hS(s.name).includes("/"));if(e===void 0)throw new Error("discoverWrapperDir: no wrapper-bearing entry in tarball");let t=hS(e.name),n=t.slice(0,t.indexOf("/"));if(n.length===0)throw new Error(`discoverWrapperDir: empty wrapper segment in entry "${e.name}"`);let i=n+"/";for(let s of r){if(Y2.has(s.type))continue;let o=hS(s.name);if(!(o===n||o===i)&&!o.startsWith(i))throw new Error(`discoverWrapperDir: entry "${s.name}" not under wrapper "${n}"`)}return n}a(Zj,"discoverWrapperDir");function e4(r){let e=r.match(/-([0-9a-fA-F]{7,40})$/);if(e===null)throw new Error(`extractShaFromWrapper: wrapper "${r}" does not match expected GitHub pattern <owner>-<repo>-<sha>`);return e[1].toLowerCase()}a(e4,"extractShaFromWrapper");function Aae(r,e){let t=e+"/",n=[];for(let i of r){if(i.type==="symbolicLink"||i.type==="hardLink")throw new Error(`${i.type} entry "${i.name}" rejected for security`);if(Y2.has(i.type)||i.type==="directory")continue;let s=hS(i.name);if(s===e||s===t)continue;if(!s.startsWith(t))throw new Error(`entry "${i.name}" not under wrapper "${e}"`);let o=s.slice(t.length);if(o.length!==0){if(o.split("/").some(c=>c===".."))throw new Error(`path traversal detected for entry "${i.name}"`);i.data!==void 0&&n.push({relPath:o,content:i.data})}}return n}a(Aae,"buildMountFiles");Di.MATERIALIZE_PROGRESS_INTERVAL=200;Di.MATERIALIZE_PROGRESS_MIN_FILES=500;async function Iae(r){let{http:e,fs:t,owner:n,repo:i,ref:s,targetPath:o}=r,c=a((b,S)=>{if(r.onProgress!==void 0)try{r.onProgress(b,S)}catch{}},"emit");c("fetch");let l=await e.fetchTarball(n,i,s);c("extract");let u=await(0,Tae.parseTarballGzip)(l);if(u.length===0)throw new Error(`tarball empty for ${n}/${i}@${s}`);let f=Zj(u),d=e4(f),p=Aae(u,f);c("materialize");let h=p.length,g=r.onProgress!==void 0&&h>Di.MATERIALIZE_PROGRESS_MIN_FILES,m=await t.materialize(o,p,g?b=>{b%Di.MATERIALIZE_PROGRESS_INTERVAL===0&&b<h&&c("materialize",{processed:b,total:h})}:void 0);return{sha:d,fileCount:m}}a(Iae,"mountAssetSpaceFiles");function X2(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(X2,"escapeGitmodulesRegex");function Rae(r,e,t){let n=new RegExp(`^\\s*\\[submodule\\s+"${X2(e)}"\\]`,"m");if(r.length>0&&n.test(r))return{content:r,added:!1};let i=r.length===0||r.endsWith(`
335
335
  `)?"":`
@@ -376,13 +376,13 @@ To fix this:
376
376
  Partial results: ${i} result(s) were collected before timeout.`:""}`}static{a(this,"QueryTimeoutError")}}});var Pm,wO=$e(()=>{"use strict";ir();zi();Ir();Pm=class extends jr{constructor(t,n){let i=n.length>0?` Did you mean '${n[0]}'?`:"",s=`Unknown property '${t}' \u2014 not in the mounted TBox.${i}`;super(s,{unknown:t,suggestions:n},{message:n.length>0?`Use '${n[0]}' (or another property that exists in the mounted TBox).`:"Use a property name that exists in the mounted TBox.",suggestion:"New properties are authored through the TBox (a new exo__Property asset), not via create."});this.exitCode=2;this.errorCode="VALIDATION_INVALID_ARGUMENTS";this.unknown=t,this.suggestions=n,this.guidance="The property name does not exist in the mounted TBox. Fix the spelling"+(n.length>0?` (e.g. '${n[0]}')`:"")+", or author the new property through the TBox path \u2014 `create` does not mint properties."}static{a(this,"UnknownPropertyError")}}});var Fm,L9=$e(()=>{"use strict";ir();zi();Ir();Fm=class extends jr{constructor(t,n){let i=n.map(o=>` \u2022 ${o.propertyPath} (${o.constraint}): ${o.message}`+(o.expectedRange?` [expected: ${o.expectedRange}]`:"")+(o.actualValue?` [actual: ${o.actualValue}]`:"")).join(`
377
377
  `),s=`SHACL-lite validation failed for the new asset \u2014 nothing was written.
378
378
  ${n.length} violation(s) in ${t}:
379
- ${i}`;super(s,{path:t,violations:n},{message:"Fix the frontmatter so the asset satisfies its class shapes, then re-run create.",suggestion:"Run `validate schema --shapes-mode` on the vault to see the same shapes the gate applied."});this.exitCode=2;this.errorCode="VALIDATION_INVALID_FORMAT";this.assetPath=t,this.violations=n,this.guidance="The asset does not conform to the SHACL-lite shapes declared for its class. Add the missing required properties (or correct the offending value's class/datatype) and re-run `create --validate`. Omitting `--validate` skips the gate entirely."}static{a(this,"ShaclConformanceError")}}});var Nt=$e(()=>{"use strict";zi();I9();R9();C9();O9();x9();P9();F9();D9();wO();L9()});var sn=T(EO=>{"use strict";EO.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,n)=>{e.push((i,s)=>i!=null?n(i):t(s)),r.apply(this,e)})},"name",{value:r.name})};EO.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);e.pop(),r.apply(this,e).then(n=>t(null,n),t)},"name",{value:r.name})}});var k9=T((x3e,N9)=>{var Vc=require("constants"),rde=process.cwd,QS=null,nde=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return QS||(QS=rde.call(process)),QS};try{process.cwd()}catch{}typeof process.chdir=="function"&&(vO=process.chdir,process.chdir=function(r){QS=null,vO.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,vO));var vO;N9.exports=ide;function ide(r){Vc.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=n(r.chmod),r.fchmod=n(r.fchmod),r.lchmod=n(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=i(r.chmodSync),r.fchmodSync=i(r.fchmodSync),r.lchmodSync=i(r.lchmodSync),r.stat=c(r.stat),r.fstat=c(r.fstat),r.lstat=c(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(f,d,p){p&&process.nextTick(p)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(f,d,p,h){h&&process.nextTick(h)},r.lchownSync=function(){}),nde==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:(function(f){function d(p,h,g){var m=Date.now(),b=0;f(p,h,a(function S(_){if(_&&(_.code==="EACCES"||_.code==="EPERM"||_.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){r.stat(h,function(A,E){A&&A.code==="ENOENT"?f(p,h,S):g(_)})},b),b<100&&(b+=10);return}g&&g(_)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.rename)),r.read=typeof r.read!="function"?r.read:(function(f){function d(p,h,g,m,b,S){var _;if(S&&typeof S=="function"){var A=0;_=a(function(E,w,R){if(E&&E.code==="EAGAIN"&&A<10)return A++,f.call(r,p,h,g,m,b,_);S.apply(this,arguments)},"callback")}return f.call(r,p,h,g,m,b,_)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:(function(f){return function(d,p,h,g,m){for(var b=0;;)try{return f.call(r,d,p,h,g,m)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(r.readSync);function e(f){f.lchmod=function(d,p,h){f.open(d,Vc.O_WRONLY|Vc.O_SYMLINK,p,function(g,m){if(g){h&&h(g);return}f.fchmod(m,p,function(b){f.close(m,function(S){h&&h(b||S)})})})},f.lchmodSync=function(d,p){var h=f.openSync(d,Vc.O_WRONLY|Vc.O_SYMLINK,p),g=!0,m;try{m=f.fchmodSync(h,p),g=!1}finally{if(g)try{f.closeSync(h)}catch{}else f.closeSync(h)}return m}}a(e,"patchLchmod");function t(f){Vc.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,h,g){f.open(d,Vc.O_SYMLINK,function(m,b){if(m){g&&g(m);return}f.futimes(b,p,h,function(S){f.close(b,function(_){g&&g(S||_)})})})},f.lutimesSync=function(d,p,h){var g=f.openSync(d,Vc.O_SYMLINK),m,b=!0;try{m=f.futimesSync(g,p,h),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return m}):f.futimes&&(f.lutimes=function(d,p,h,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}a(t,"patchLutimes");function n(f){return f&&function(d,p,h){return f.call(r,d,p,function(g){u(g)&&(g=null),h&&h.apply(this,arguments)})}}a(n,"chmodFix");function i(f){return f&&function(d,p){try{return f.call(r,d,p)}catch(h){if(!u(h))throw h}}}a(i,"chmodFixSync");function s(f){return f&&function(d,p,h,g){return f.call(r,d,p,h,function(m){u(m)&&(m=null),g&&g.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,p,h){try{return f.call(r,d,p,h)}catch(g){if(!u(g))throw g}}}a(o,"chownFixSync");function c(f){return f&&function(d,p,h){typeof p=="function"&&(h=p,p=null);function g(m,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),h&&h.apply(this,arguments)}return a(g,"callback"),p?f.call(r,d,p,g):f.call(r,d,g)}}a(c,"statFix");function l(f){return f&&function(d,p){var h=p?f.call(r,d,p):f.call(r,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}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(ide,"patch")});var j9=T((F3e,$9)=>{var M9=require("stream").Stream;$9.exports=sde;function sde(r){return{ReadStream:e,WriteStream:t};function e(n,i){if(!(this instanceof e))return new e(n,i);M9.call(this);var s=this;this.path=n,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}r.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(n,i){if(!(this instanceof t))return new t(n,i);M9.call(this),this.path=n,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=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(sde,"legacy")});var U9=T((L3e,B9)=>{"use strict";B9.exports=ade;var ode=Object.getPrototypeOf||function(r){return r.__proto__};function ade(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:ode(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}a(ade,"clone")});var Nd=T((k3e,IO)=>{var dr=require("fs"),cde=k9(),lde=j9(),ude=U9(),JS=require("util"),On,ew;typeof Symbol=="function"&&typeof Symbol.for=="function"?(On=Symbol.for("graceful-fs.queue"),ew=Symbol.for("graceful-fs.previous")):(On="___graceful-fs.queue",ew="___graceful-fs.previous");function fde(){}a(fde,"noop");function q9(r,e){Object.defineProperty(r,On,{get:a(function(){return e},"get")})}a(q9,"publishQueue");var pu=fde;JS.debuglog?pu=JS.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(pu=a(function(){var r=JS.format.apply(JS,arguments);r="GFS4: "+r.split(/\n/).join(`
380
- GFS4: `),console.error(r)},"debug"));dr[On]||(V9=global[On]||[],q9(dr,V9),dr.close=(function(r){function e(t,n){return r.call(dr,t,function(i){i||G9(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,ew,{value:r}),e})(dr.close),dr.closeSync=(function(r){function e(t){r.apply(dr,arguments),G9()}return a(e,"closeSync"),Object.defineProperty(e,ew,{value:r}),e})(dr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){pu(dr[On]),require("assert").equal(dr[On].length,0)}));var V9;global[On]||q9(global,dr[On]);IO.exports=TO(ude(dr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!dr.__patched&&(IO.exports=TO(dr),dr.__patched=!0);function TO(r){cde(r),r.gracefulify=TO,r.createReadStream=w,r.createWriteStream=R;var e=r.readFile;r.readFile=t;function t(N,j,U){return typeof j=="function"&&(U=j,j=null),G(N,j,U);function G($,k,te,Z){return e($,k,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?Ld([G,[$,k,te],re,Z||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments)})}a(G,"go$readFile")}a(t,"readFile");var n=r.writeFile;r.writeFile=i;function i(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return n(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$writeFile")}a(i,"writeFile");var s=r.appendFile;s&&(r.appendFile=o);function o(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return s(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$appendFile")}a(o,"appendFile");var c=r.copyFile;c&&(r.copyFile=l);function l(N,j,U,G){return typeof U=="function"&&(G=U,U=0),$(N,j,U,G);function $(k,te,Z,re,V){return c(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$copyFile")}a(l,"copyFile");var u=r.readdir;r.readdir=d;var f=/^v[0-5]\./;function d(N,j,U){typeof j=="function"&&(U=j,j=null);var G=f.test(process.version)?a(function(te,Z,re,V){return u(te,$(te,Z,re,V))},"go$readdir"):a(function(te,Z,re,V){return u(te,Z,$(te,Z,re,V))},"go$readdir");return G(N,j,U);function $(k,te,Z,re){return function(V,K){V&&(V.code==="EMFILE"||V.code==="ENFILE")?Ld([G,[k,te,Z],V,re||Date.now(),Date.now()]):(K&&K.sort&&K.sort(),typeof Z=="function"&&Z.call(this,V,K))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=lde(r);S=p.ReadStream,A=p.WriteStream}var h=r.ReadStream;h&&(S.prototype=Object.create(h.prototype),S.prototype.open=_);var g=r.WriteStream;g&&(A.prototype=Object.create(g.prototype),A.prototype.open=E),Object.defineProperty(r,"ReadStream",{get:a(function(){return S},"get"),set:a(function(N){S=N},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:a(function(){return A},"get"),set:a(function(N){A=N},"set"),enumerable:!0,configurable:!0});var m=S;Object.defineProperty(r,"FileReadStream",{get:a(function(){return m},"get"),set:a(function(N){m=N},"set"),enumerable:!0,configurable:!0});var b=A;Object.defineProperty(r,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(N){b=N},"set"),enumerable:!0,configurable:!0});function S(N,j){return this instanceof S?(h.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"ReadStream");function _(){var N=this;P(N.path,N.flags,N.mode,function(j,U){j?(N.autoClose&&N.destroy(),N.emit("error",j)):(N.fd=U,N.emit("open",U),N.read())})}a(_,"ReadStream$open");function A(N,j){return this instanceof A?(g.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}a(A,"WriteStream");function E(){var N=this;P(N.path,N.flags,N.mode,function(j,U){j?(N.destroy(),N.emit("error",j)):(N.fd=U,N.emit("open",U))})}a(E,"WriteStream$open");function w(N,j){return new r.ReadStream(N,j)}a(w,"createReadStream");function R(N,j){return new r.WriteStream(N,j)}a(R,"createWriteStream");var O=r.open;r.open=P;function P(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return O(k,te,Z,function(K,he){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$open")}return a(P,"open"),r}a(TO,"patch");function Ld(r){pu("ENQUEUE",r[0].name,r[1]),dr[On].push(r),AO()}a(Ld,"enqueue");var ZS;function G9(){for(var r=Date.now(),e=0;e<dr[On].length;++e)dr[On][e].length>2&&(dr[On][e][3]=r,dr[On][e][4]=r);AO()}a(G9,"resetQueue");function AO(){if(clearTimeout(ZS),ZS=void 0,dr[On].length!==0){var r=dr[On].shift(),e=r[0],t=r[1],n=r[2],i=r[3],s=r[4];if(i===void 0)pu("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){pu("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,n)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(pu("RETRY",e.name,t),e.apply(null,t.concat([i]))):dr[On].push(r)}ZS===void 0&&(ZS=setTimeout(AO,0))}}a(AO,"retry")});var ci=T(Ga=>{"use strict";var W9=sn().fromCallback,ai=Nd(),dde=["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(r=>typeof ai[r]=="function");Object.assign(Ga,ai);dde.forEach(r=>{Ga[r]=W9(ai[r])});Ga.exists=function(r,e){return typeof e=="function"?ai.exists(r,e):new Promise(t=>ai.exists(r,t))};Ga.read=function(r,e,t,n,i,s){return typeof s=="function"?ai.read(r,e,t,n,i,s):new Promise((o,c)=>{ai.read(r,e,t,n,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};Ga.write=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.write(r,e,...t):new Promise((n,i)=>{ai.write(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};Ga.readv=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.readv(r,e,...t):new Promise((n,i)=>{ai.readv(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesRead:o,buffers:c})})})};Ga.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.writev(r,e,...t):new Promise((n,i)=>{ai.writev(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})};typeof ai.realpath.native=="function"?Ga.realpath.native=W9(ai.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var K9=T((j3e,z9)=>{"use strict";var pde=require("path");z9.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(pde.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var Q9=T((U3e,RO)=>{"use strict";var H9=ci(),{checkPath:Y9}=K9(),X9=a(r=>{let e={mode:511};return typeof r=="number"?r:{...e,...r}.mode},"getMode");RO.exports.makeDir=async(r,e)=>(Y9(r),H9.mkdir(r,{mode:X9(e),recursive:!0}));RO.exports.makeDirSync=(r,e)=>(Y9(r),H9.mkdirSync(r,{mode:X9(e),recursive:!0}))});var Gs=T((G3e,J9)=>{"use strict";var hde=sn().fromPromise,{makeDir:mde,makeDirSync:CO}=Q9(),OO=hde(mde);J9.exports={mkdirs:OO,mkdirsSync:CO,mkdirp:OO,mkdirpSync:CO,ensureDir:OO,ensureDirSync:CO}});var Gc=T((q3e,eU)=>{"use strict";var gde=sn().fromPromise,Z9=ci();function yde(r){return Z9.access(r).then(()=>!0).catch(()=>!1)}a(yde,"pathExists");eU.exports={pathExists:gde(yde),pathExistsSync:Z9.existsSync}});var xO=T((z3e,tU)=>{"use strict";var kd=ci(),bde=sn().fromPromise;async function _de(r,e,t){let n=await kd.open(r,"r+"),i=null;try{await kd.futimes(n,e,t)}catch(s){i=s}finally{try{await kd.close(n)}catch(s){i||(i=s)}}if(i)throw i}a(_de,"utimesMillis");function Sde(r,e,t){let n=kd.openSync(r,"r+"),i=null;try{kd.futimesSync(n,e,t)}catch(s){i=s}finally{try{kd.closeSync(n)}catch(s){i||(i=s)}}if(i)throw i}a(Sde,"utimesMillisSync");tU.exports={utimesMillis:bde(_de),utimesMillisSync:Sde}});var hu=T((H3e,iU)=>{"use strict";var Md=ci(),on=require("path"),rU=sn().fromPromise;function wde(r,e,t){let n=t.dereference?i=>Md.stat(i,{bigint:!0}):i=>Md.lstat(i,{bigint:!0});return Promise.all([n(r),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(wde,"getStats");function Ede(r,e,t){let n,i=t.dereference?o=>Md.statSync(o,{bigint:!0}):o=>Md.lstatSync(o,{bigint:!0}),s=i(r);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}a(Ede,"getStatsSync");async function vde(r,e,t,n){let{srcStat:i,destStat:s}=await wde(r,e,n);if(s){if(Dm(i,s)){let o=on.basename(r),c=on.basename(e);if(t==="move"&&o!==c&&nU(o,c))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 '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&DO(r,e))throw new Error(tw(r,e,t));return{srcStat:i,destStat:s}}a(vde,"checkPaths");function Tde(r,e,t,n){let{srcStat:i,destStat:s}=Ede(r,e,n);if(s){if(Dm(i,s)){let o=on.basename(r),c=on.basename(e);if(t==="move"&&o!==c&&nU(o,c))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 '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&DO(r,e))throw new Error(tw(r,e,t));return{srcStat:i,destStat:s}}a(Tde,"checkPathsSync");function nU(r,e){return r.toLowerCase().normalize("NFC")===e.toLowerCase().normalize("NFC")}a(nU,"isCosmeticRename");async function PO(r,e,t,n){let i=on.resolve(on.dirname(r)),s=on.resolve(on.dirname(t));if(s===i||s===on.parse(s).root)return;let o;try{o=await Md.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return PO(r,e,s,n);throw c}if(Dm(e,o))throw new Error(tw(r,t,n));return PO(r,e,s,n)}a(PO,"checkParentPaths");function FO(r,e,t,n){let i=on.resolve(on.dirname(r)),s=on.resolve(on.dirname(t));if(s===i||s===on.parse(s).root)return;let o;try{o=Md.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return FO(r,e,s,n);throw c}if(Dm(e,o))throw new Error(tw(r,t,n));return FO(r,e,s,n)}a(FO,"checkParentPathsSync");function Dm(r,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===r.ino&&e.dev===r.dev}a(Dm,"areIdentical");function DO(r,e){let t=on.resolve(r).split(on.sep).filter(i=>i),n=on.resolve(e).split(on.sep).filter(i=>i);return t.every((i,s)=>n[s]===i)}a(DO,"isSrcSubdir");function tw(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}a(tw,"errMsg");iU.exports={checkPaths:rU(vde),checkPathsSync:Tde,checkParentPaths:rU(PO),checkParentPathsSync:FO,isSrcSubdir:DO,areIdentical:Dm}});var oU=T((X3e,sU)=>{"use strict";async function Ade(r,e){let t=[];for await(let n of r)t.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(n=>n.then(i=>{if(i!==null)throw i})))}a(Ade,"asyncIteratorConcurrentProcess");sU.exports={asyncIteratorConcurrentProcess:Ade}});var fU=T((J3e,uU)=>{"use strict";var qn=ci(),Lm=require("path"),{mkdirs:Ide}=Gs(),{pathExists:Rde}=Gc(),{utimesMillis:Cde}=xO(),Nm=hu(),{asyncIteratorConcurrentProcess:Ode}=oU();async function xde(r,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;
379
+ ${i}`;super(s,{path:t,violations:n},{message:"Fix the frontmatter so the asset satisfies its class shapes, then re-run create.",suggestion:"Run `validate schema --shapes-mode` on the vault to see the same shapes the gate applied."});this.exitCode=2;this.errorCode="VALIDATION_INVALID_FORMAT";this.assetPath=t,this.violations=n,this.guidance="The asset does not conform to the SHACL-lite shapes declared for its class. Add the missing required properties (or correct the offending value's class/datatype) and re-run `create --validate`. Omitting `--validate` skips the gate entirely."}static{a(this,"ShaclConformanceError")}}});var Nt=$e(()=>{"use strict";zi();I9();R9();C9();O9();x9();P9();F9();D9();wO();L9()});var sn=T(EO=>{"use strict";EO.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,n)=>{e.push((i,s)=>i!=null?n(i):t(s)),r.apply(this,e)})},"name",{value:r.name})};EO.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);e.pop(),r.apply(this,e).then(n=>t(null,n),t)},"name",{value:r.name})}});var k9=T((P3e,N9)=>{var Vc=require("constants"),rde=process.cwd,QS=null,nde=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return QS||(QS=rde.call(process)),QS};try{process.cwd()}catch{}typeof process.chdir=="function"&&(vO=process.chdir,process.chdir=function(r){QS=null,vO.call(process,r)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,vO));var vO;N9.exports=ide;function ide(r){Vc.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=s(r.chown),r.fchown=s(r.fchown),r.lchown=s(r.lchown),r.chmod=n(r.chmod),r.fchmod=n(r.fchmod),r.lchmod=n(r.lchmod),r.chownSync=o(r.chownSync),r.fchownSync=o(r.fchownSync),r.lchownSync=o(r.lchownSync),r.chmodSync=i(r.chmodSync),r.fchmodSync=i(r.fchmodSync),r.lchmodSync=i(r.lchmodSync),r.stat=c(r.stat),r.fstat=c(r.fstat),r.lstat=c(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.chmod&&!r.lchmod&&(r.lchmod=function(f,d,p){p&&process.nextTick(p)},r.lchmodSync=function(){}),r.chown&&!r.lchown&&(r.lchown=function(f,d,p,h){h&&process.nextTick(h)},r.lchownSync=function(){}),nde==="win32"&&(r.rename=typeof r.rename!="function"?r.rename:(function(f){function d(p,h,g){var m=Date.now(),b=0;f(p,h,a(function S(_){if(_&&(_.code==="EACCES"||_.code==="EPERM"||_.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){r.stat(h,function(A,E){A&&A.code==="ENOENT"?f(p,h,S):g(_)})},b),b<100&&(b+=10);return}g&&g(_)},"CB"))}return a(d,"rename"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.rename)),r.read=typeof r.read!="function"?r.read:(function(f){function d(p,h,g,m,b,S){var _;if(S&&typeof S=="function"){var A=0;_=a(function(E,w,R){if(E&&E.code==="EAGAIN"&&A<10)return A++,f.call(r,p,h,g,m,b,_);S.apply(this,arguments)},"callback")}return f.call(r,p,h,g,m,b,_)}return a(d,"read"),Object.setPrototypeOf&&Object.setPrototypeOf(d,f),d})(r.read),r.readSync=typeof r.readSync!="function"?r.readSync:(function(f){return function(d,p,h,g,m){for(var b=0;;)try{return f.call(r,d,p,h,g,m)}catch(S){if(S.code==="EAGAIN"&&b<10){b++;continue}throw S}}})(r.readSync);function e(f){f.lchmod=function(d,p,h){f.open(d,Vc.O_WRONLY|Vc.O_SYMLINK,p,function(g,m){if(g){h&&h(g);return}f.fchmod(m,p,function(b){f.close(m,function(S){h&&h(b||S)})})})},f.lchmodSync=function(d,p){var h=f.openSync(d,Vc.O_WRONLY|Vc.O_SYMLINK,p),g=!0,m;try{m=f.fchmodSync(h,p),g=!1}finally{if(g)try{f.closeSync(h)}catch{}else f.closeSync(h)}return m}}a(e,"patchLchmod");function t(f){Vc.hasOwnProperty("O_SYMLINK")&&f.futimes?(f.lutimes=function(d,p,h,g){f.open(d,Vc.O_SYMLINK,function(m,b){if(m){g&&g(m);return}f.futimes(b,p,h,function(S){f.close(b,function(_){g&&g(S||_)})})})},f.lutimesSync=function(d,p,h){var g=f.openSync(d,Vc.O_SYMLINK),m,b=!0;try{m=f.futimesSync(g,p,h),b=!1}finally{if(b)try{f.closeSync(g)}catch{}else f.closeSync(g)}return m}):f.futimes&&(f.lutimes=function(d,p,h,g){g&&process.nextTick(g)},f.lutimesSync=function(){})}a(t,"patchLutimes");function n(f){return f&&function(d,p,h){return f.call(r,d,p,function(g){u(g)&&(g=null),h&&h.apply(this,arguments)})}}a(n,"chmodFix");function i(f){return f&&function(d,p){try{return f.call(r,d,p)}catch(h){if(!u(h))throw h}}}a(i,"chmodFixSync");function s(f){return f&&function(d,p,h,g){return f.call(r,d,p,h,function(m){u(m)&&(m=null),g&&g.apply(this,arguments)})}}a(s,"chownFix");function o(f){return f&&function(d,p,h){try{return f.call(r,d,p,h)}catch(g){if(!u(g))throw g}}}a(o,"chownFixSync");function c(f){return f&&function(d,p,h){typeof p=="function"&&(h=p,p=null);function g(m,b){b&&(b.uid<0&&(b.uid+=4294967296),b.gid<0&&(b.gid+=4294967296)),h&&h.apply(this,arguments)}return a(g,"callback"),p?f.call(r,d,p,g):f.call(r,d,g)}}a(c,"statFix");function l(f){return f&&function(d,p){var h=p?f.call(r,d,p):f.call(r,d);return h&&(h.uid<0&&(h.uid+=4294967296),h.gid<0&&(h.gid+=4294967296)),h}}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(ide,"patch")});var j9=T((D3e,$9)=>{var M9=require("stream").Stream;$9.exports=sde;function sde(r){return{ReadStream:e,WriteStream:t};function e(n,i){if(!(this instanceof e))return new e(n,i);M9.call(this);var s=this;this.path=n,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}r.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(n,i){if(!(this instanceof t))return new t(n,i);M9.call(this),this.path=n,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=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}a(sde,"legacy")});var U9=T((N3e,B9)=>{"use strict";B9.exports=ade;var ode=Object.getPrototypeOf||function(r){return r.__proto__};function ade(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:ode(r)};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}a(ade,"clone")});var Nd=T((M3e,IO)=>{var dr=require("fs"),cde=k9(),lde=j9(),ude=U9(),JS=require("util"),On,ew;typeof Symbol=="function"&&typeof Symbol.for=="function"?(On=Symbol.for("graceful-fs.queue"),ew=Symbol.for("graceful-fs.previous")):(On="___graceful-fs.queue",ew="___graceful-fs.previous");function fde(){}a(fde,"noop");function q9(r,e){Object.defineProperty(r,On,{get:a(function(){return e},"get")})}a(q9,"publishQueue");var pu=fde;JS.debuglog?pu=JS.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(pu=a(function(){var r=JS.format.apply(JS,arguments);r="GFS4: "+r.split(/\n/).join(`
380
+ GFS4: `),console.error(r)},"debug"));dr[On]||(V9=global[On]||[],q9(dr,V9),dr.close=(function(r){function e(t,n){return r.call(dr,t,function(i){i||G9(),typeof n=="function"&&n.apply(this,arguments)})}return a(e,"close"),Object.defineProperty(e,ew,{value:r}),e})(dr.close),dr.closeSync=(function(r){function e(t){r.apply(dr,arguments),G9()}return a(e,"closeSync"),Object.defineProperty(e,ew,{value:r}),e})(dr.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){pu(dr[On]),require("assert").equal(dr[On].length,0)}));var V9;global[On]||q9(global,dr[On]);IO.exports=TO(ude(dr));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!dr.__patched&&(IO.exports=TO(dr),dr.__patched=!0);function TO(r){cde(r),r.gracefulify=TO,r.createReadStream=w,r.createWriteStream=R;var e=r.readFile;r.readFile=t;function t(N,j,U){return typeof j=="function"&&(U=j,j=null),G(N,j,U);function G($,k,te,Z){return e($,k,function(re){re&&(re.code==="EMFILE"||re.code==="ENFILE")?Ld([G,[$,k,te],re,Z||Date.now(),Date.now()]):typeof te=="function"&&te.apply(this,arguments)})}a(G,"go$readFile")}a(t,"readFile");var n=r.writeFile;r.writeFile=i;function i(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return n(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$writeFile")}a(i,"writeFile");var s=r.appendFile;s&&(r.appendFile=o);function o(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return s(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$appendFile")}a(o,"appendFile");var c=r.copyFile;c&&(r.copyFile=l);function l(N,j,U,G){return typeof U=="function"&&(G=U,U=0),$(N,j,U,G);function $(k,te,Z,re,V){return c(k,te,Z,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$copyFile")}a(l,"copyFile");var u=r.readdir;r.readdir=d;var f=/^v[0-5]\./;function d(N,j,U){typeof j=="function"&&(U=j,j=null);var G=f.test(process.version)?a(function(te,Z,re,V){return u(te,$(te,Z,re,V))},"go$readdir"):a(function(te,Z,re,V){return u(te,Z,$(te,Z,re,V))},"go$readdir");return G(N,j,U);function $(k,te,Z,re){return function(V,K){V&&(V.code==="EMFILE"||V.code==="ENFILE")?Ld([G,[k,te,Z],V,re||Date.now(),Date.now()]):(K&&K.sort&&K.sort(),typeof Z=="function"&&Z.call(this,V,K))}}}if(a(d,"readdir"),process.version.substr(0,4)==="v0.8"){var p=lde(r);S=p.ReadStream,A=p.WriteStream}var h=r.ReadStream;h&&(S.prototype=Object.create(h.prototype),S.prototype.open=_);var g=r.WriteStream;g&&(A.prototype=Object.create(g.prototype),A.prototype.open=E),Object.defineProperty(r,"ReadStream",{get:a(function(){return S},"get"),set:a(function(N){S=N},"set"),enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:a(function(){return A},"get"),set:a(function(N){A=N},"set"),enumerable:!0,configurable:!0});var m=S;Object.defineProperty(r,"FileReadStream",{get:a(function(){return m},"get"),set:a(function(N){m=N},"set"),enumerable:!0,configurable:!0});var b=A;Object.defineProperty(r,"FileWriteStream",{get:a(function(){return b},"get"),set:a(function(N){b=N},"set"),enumerable:!0,configurable:!0});function S(N,j){return this instanceof S?(h.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}a(S,"ReadStream");function _(){var N=this;P(N.path,N.flags,N.mode,function(j,U){j?(N.autoClose&&N.destroy(),N.emit("error",j)):(N.fd=U,N.emit("open",U),N.read())})}a(_,"ReadStream$open");function A(N,j){return this instanceof A?(g.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}a(A,"WriteStream");function E(){var N=this;P(N.path,N.flags,N.mode,function(j,U){j?(N.destroy(),N.emit("error",j)):(N.fd=U,N.emit("open",U))})}a(E,"WriteStream$open");function w(N,j){return new r.ReadStream(N,j)}a(w,"createReadStream");function R(N,j){return new r.WriteStream(N,j)}a(R,"createWriteStream");var O=r.open;r.open=P;function P(N,j,U,G){return typeof U=="function"&&(G=U,U=null),$(N,j,U,G);function $(k,te,Z,re,V){return O(k,te,Z,function(K,he){K&&(K.code==="EMFILE"||K.code==="ENFILE")?Ld([$,[k,te,Z,re],K,V||Date.now(),Date.now()]):typeof re=="function"&&re.apply(this,arguments)})}a($,"go$open")}return a(P,"open"),r}a(TO,"patch");function Ld(r){pu("ENQUEUE",r[0].name,r[1]),dr[On].push(r),AO()}a(Ld,"enqueue");var ZS;function G9(){for(var r=Date.now(),e=0;e<dr[On].length;++e)dr[On][e].length>2&&(dr[On][e][3]=r,dr[On][e][4]=r);AO()}a(G9,"resetQueue");function AO(){if(clearTimeout(ZS),ZS=void 0,dr[On].length!==0){var r=dr[On].shift(),e=r[0],t=r[1],n=r[2],i=r[3],s=r[4];if(i===void 0)pu("RETRY",e.name,t),e.apply(null,t);else if(Date.now()-i>=6e4){pu("TIMEOUT",e.name,t);var o=t.pop();typeof o=="function"&&o.call(null,n)}else{var c=Date.now()-s,l=Math.max(s-i,1),u=Math.min(l*1.2,100);c>=u?(pu("RETRY",e.name,t),e.apply(null,t.concat([i]))):dr[On].push(r)}ZS===void 0&&(ZS=setTimeout(AO,0))}}a(AO,"retry")});var ci=T(Ga=>{"use strict";var W9=sn().fromCallback,ai=Nd(),dde=["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(r=>typeof ai[r]=="function");Object.assign(Ga,ai);dde.forEach(r=>{Ga[r]=W9(ai[r])});Ga.exists=function(r,e){return typeof e=="function"?ai.exists(r,e):new Promise(t=>ai.exists(r,t))};Ga.read=function(r,e,t,n,i,s){return typeof s=="function"?ai.read(r,e,t,n,i,s):new Promise((o,c)=>{ai.read(r,e,t,n,i,(l,u,f)=>{if(l)return c(l);o({bytesRead:u,buffer:f})})})};Ga.write=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.write(r,e,...t):new Promise((n,i)=>{ai.write(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffer:c})})})};Ga.readv=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.readv(r,e,...t):new Promise((n,i)=>{ai.readv(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesRead:o,buffers:c})})})};Ga.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?ai.writev(r,e,...t):new Promise((n,i)=>{ai.writev(r,e,...t,(s,o,c)=>{if(s)return i(s);n({bytesWritten:o,buffers:c})})})};typeof ai.realpath.native=="function"?Ga.realpath.native=W9(ai.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")});var K9=T((B3e,z9)=>{"use strict";var pde=require("path");z9.exports.checkPath=a(function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(pde.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}},"checkPath")});var Q9=T((V3e,RO)=>{"use strict";var H9=ci(),{checkPath:Y9}=K9(),X9=a(r=>{let e={mode:511};return typeof r=="number"?r:{...e,...r}.mode},"getMode");RO.exports.makeDir=async(r,e)=>(Y9(r),H9.mkdir(r,{mode:X9(e),recursive:!0}));RO.exports.makeDirSync=(r,e)=>(Y9(r),H9.mkdirSync(r,{mode:X9(e),recursive:!0}))});var Gs=T((q3e,J9)=>{"use strict";var hde=sn().fromPromise,{makeDir:mde,makeDirSync:CO}=Q9(),OO=hde(mde);J9.exports={mkdirs:OO,mkdirsSync:CO,mkdirp:OO,mkdirpSync:CO,ensureDir:OO,ensureDirSync:CO}});var Gc=T((W3e,eU)=>{"use strict";var gde=sn().fromPromise,Z9=ci();function yde(r){return Z9.access(r).then(()=>!0).catch(()=>!1)}a(yde,"pathExists");eU.exports={pathExists:gde(yde),pathExistsSync:Z9.existsSync}});var xO=T((K3e,tU)=>{"use strict";var kd=ci(),bde=sn().fromPromise;async function _de(r,e,t){let n=await kd.open(r,"r+"),i=null;try{await kd.futimes(n,e,t)}catch(s){i=s}finally{try{await kd.close(n)}catch(s){i||(i=s)}}if(i)throw i}a(_de,"utimesMillis");function Sde(r,e,t){let n=kd.openSync(r,"r+"),i=null;try{kd.futimesSync(n,e,t)}catch(s){i=s}finally{try{kd.closeSync(n)}catch(s){i||(i=s)}}if(i)throw i}a(Sde,"utimesMillisSync");tU.exports={utimesMillis:bde(_de),utimesMillisSync:Sde}});var hu=T((Y3e,iU)=>{"use strict";var Md=ci(),on=require("path"),rU=sn().fromPromise;function wde(r,e,t){let n=t.dereference?i=>Md.stat(i,{bigint:!0}):i=>Md.lstat(i,{bigint:!0});return Promise.all([n(r),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}a(wde,"getStats");function Ede(r,e,t){let n,i=t.dereference?o=>Md.statSync(o,{bigint:!0}):o=>Md.lstatSync(o,{bigint:!0}),s=i(r);try{n=i(e)}catch(o){if(o.code==="ENOENT")return{srcStat:s,destStat:null};throw o}return{srcStat:s,destStat:n}}a(Ede,"getStatsSync");async function vde(r,e,t,n){let{srcStat:i,destStat:s}=await wde(r,e,n);if(s){if(Dm(i,s)){let o=on.basename(r),c=on.basename(e);if(t==="move"&&o!==c&&nU(o,c))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 '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&DO(r,e))throw new Error(tw(r,e,t));return{srcStat:i,destStat:s}}a(vde,"checkPaths");function Tde(r,e,t,n){let{srcStat:i,destStat:s}=Ede(r,e,n);if(s){if(Dm(i,s)){let o=on.basename(r),c=on.basename(e);if(t==="move"&&o!==c&&nU(o,c))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 '${r}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${r}'.`)}if(i.isDirectory()&&DO(r,e))throw new Error(tw(r,e,t));return{srcStat:i,destStat:s}}a(Tde,"checkPathsSync");function nU(r,e){return r.toLowerCase().normalize("NFC")===e.toLowerCase().normalize("NFC")}a(nU,"isCosmeticRename");async function PO(r,e,t,n){let i=on.resolve(on.dirname(r)),s=on.resolve(on.dirname(t));if(s===i||s===on.parse(s).root)return;let o;try{o=await Md.stat(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return PO(r,e,s,n);throw c}if(Dm(e,o))throw new Error(tw(r,t,n));return PO(r,e,s,n)}a(PO,"checkParentPaths");function FO(r,e,t,n){let i=on.resolve(on.dirname(r)),s=on.resolve(on.dirname(t));if(s===i||s===on.parse(s).root)return;let o;try{o=Md.statSync(s,{bigint:!0})}catch(c){if(c.code==="ENOENT")return FO(r,e,s,n);throw c}if(Dm(e,o))throw new Error(tw(r,t,n));return FO(r,e,s,n)}a(FO,"checkParentPathsSync");function Dm(r,e){return e.ino!==void 0&&e.dev!==void 0&&e.ino===r.ino&&e.dev===r.dev}a(Dm,"areIdentical");function DO(r,e){let t=on.resolve(r).split(on.sep).filter(i=>i),n=on.resolve(e).split(on.sep).filter(i=>i);return t.every((i,s)=>n[s]===i)}a(DO,"isSrcSubdir");function tw(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}a(tw,"errMsg");iU.exports={checkPaths:rU(vde),checkPathsSync:Tde,checkParentPaths:rU(PO),checkParentPathsSync:FO,isSrcSubdir:DO,areIdentical:Dm}});var oU=T((Q3e,sU)=>{"use strict";async function Ade(r,e){let t=[];for await(let n of r)t.push(e(n).then(()=>null,i=>i??new Error("unknown error")));await Promise.all(t.map(n=>n.then(i=>{if(i!==null)throw i})))}a(Ade,"asyncIteratorConcurrentProcess");sU.exports={asyncIteratorConcurrentProcess:Ade}});var fU=T((Z3e,uU)=>{"use strict";var qn=ci(),Lm=require("path"),{mkdirs:Ide}=Gs(),{pathExists:Rde}=Gc(),{utimesMillis:Cde}=xO(),Nm=hu(),{asyncIteratorConcurrentProcess:Ode}=oU();async function xde(r,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;
381
381
 
382
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Nm.checkPaths(r,e,"copy",t);if(await Nm.checkParentPaths(r,n,e,"copy"),!await cU(r,e,t))return;let o=Lm.dirname(e);await Rde(o)||await Ide(o),await lU(i,r,e,t)}a(xde,"copy");async function cU(r,e,t){return t.filter?t.filter(r,e):!0}a(cU,"runFilter");async function lU(r,e,t,n){let s=await(n.dereference?qn.stat:qn.lstat)(e);if(s.isDirectory())return Lde(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Pde(s,r,e,t,n);if(s.isSymbolicLink())return Nde(r,e,t,n);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(lU,"getStatsAndPerformCopy");async function Pde(r,e,t,n,i){if(!e)return aU(r,t,n,i);if(i.overwrite)return await qn.unlink(n),aU(r,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}a(Pde,"onFile");async function aU(r,e,t,n){if(await qn.copyFile(e,t),n.preserveTimestamps){Fde(r.mode)&&await Dde(t,r.mode);let i=await qn.stat(e);await Cde(t,i.atime,i.mtime)}return qn.chmod(t,r.mode)}a(aU,"copyFile");function Fde(r){return(r&128)===0}a(Fde,"fileIsNotWritable");function Dde(r,e){return qn.chmod(r,e|128)}a(Dde,"makeFileWritable");async function Lde(r,e,t,n,i){e||await qn.mkdir(n),await Ode(await qn.opendir(t),async s=>{let o=Lm.join(t,s.name),c=Lm.join(n,s.name);if(await cU(o,c,i)){let{destStat:u}=await Nm.checkPaths(o,c,"copy",i);await lU(u,o,c,i)}}),e||await qn.chmod(n,r.mode)}a(Lde,"onDir");async function Nde(r,e,t,n){let i=await qn.readlink(e);if(n.dereference&&(i=Lm.resolve(process.cwd(),i)),!r)return qn.symlink(i,t);let s=null;try{s=await qn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return qn.symlink(i,t);throw o}if(n.dereference&&(s=Lm.resolve(process.cwd(),s)),i!==s){if(Nm.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Nm.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`)}return await qn.unlink(t),qn.symlink(i,t)}a(Nde,"onLink");uU.exports=xde});var gU=T((eke,mU)=>{"use strict";var li=Nd(),km=require("path"),kde=Gs().mkdirsSync,Mde=xO().utimesMillisSync,Mm=hu();function $de(r,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;
382
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Nm.checkPaths(r,e,"copy",t);if(await Nm.checkParentPaths(r,n,e,"copy"),!await cU(r,e,t))return;let o=Lm.dirname(e);await Rde(o)||await Ide(o),await lU(i,r,e,t)}a(xde,"copy");async function cU(r,e,t){return t.filter?t.filter(r,e):!0}a(cU,"runFilter");async function lU(r,e,t,n){let s=await(n.dereference?qn.stat:qn.lstat)(e);if(s.isDirectory())return Lde(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Pde(s,r,e,t,n);if(s.isSymbolicLink())return Nde(r,e,t,n);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(lU,"getStatsAndPerformCopy");async function Pde(r,e,t,n,i){if(!e)return aU(r,t,n,i);if(i.overwrite)return await qn.unlink(n),aU(r,t,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}a(Pde,"onFile");async function aU(r,e,t,n){if(await qn.copyFile(e,t),n.preserveTimestamps){Fde(r.mode)&&await Dde(t,r.mode);let i=await qn.stat(e);await Cde(t,i.atime,i.mtime)}return qn.chmod(t,r.mode)}a(aU,"copyFile");function Fde(r){return(r&128)===0}a(Fde,"fileIsNotWritable");function Dde(r,e){return qn.chmod(r,e|128)}a(Dde,"makeFileWritable");async function Lde(r,e,t,n,i){e||await qn.mkdir(n),await Ode(await qn.opendir(t),async s=>{let o=Lm.join(t,s.name),c=Lm.join(n,s.name);if(await cU(o,c,i)){let{destStat:u}=await Nm.checkPaths(o,c,"copy",i);await lU(u,o,c,i)}}),e||await qn.chmod(n,r.mode)}a(Lde,"onDir");async function Nde(r,e,t,n){let i=await qn.readlink(e);if(n.dereference&&(i=Lm.resolve(process.cwd(),i)),!r)return qn.symlink(i,t);let s=null;try{s=await qn.readlink(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return qn.symlink(i,t);throw o}if(n.dereference&&(s=Lm.resolve(process.cwd(),s)),i!==s){if(Nm.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Nm.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`)}return await qn.unlink(t),qn.symlink(i,t)}a(Nde,"onLink");uU.exports=xde});var gU=T((tke,mU)=>{"use strict";var li=Nd(),km=require("path"),kde=Gs().mkdirsSync,Mde=xO().utimesMillisSync,Mm=hu();function $de(r,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;
383
383
 
384
- see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Mm.checkPathsSync(r,e,"copy",t);if(Mm.checkParentPathsSync(r,n,e,"copy"),t.filter&&!t.filter(r,e))return;let s=km.dirname(e);return li.existsSync(s)||kde(s),dU(i,r,e,t)}a($de,"copySync");function dU(r,e,t,n){let s=(n.dereference?li.statSync:li.lstatSync)(e);if(s.isDirectory())return Wde(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return jde(s,r,e,t,n);if(s.isSymbolicLink())return Hde(r,e,t,n);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(dU,"getStats");function jde(r,e,t,n,i){return e?Bde(r,t,n,i):pU(r,t,n,i)}a(jde,"onFile");function Bde(r,e,t,n){if(n.overwrite)return li.unlinkSync(t),pU(r,e,t,n);if(n.errorOnExist)throw new Error(`'${t}' already exists`)}a(Bde,"mayCopyFile");function pU(r,e,t,n){return li.copyFileSync(e,t),n.preserveTimestamps&&Ude(r.mode,e,t),LO(t,r.mode)}a(pU,"copyFile");function Ude(r,e,t){return Vde(r)&&Gde(t,r),qde(e,t)}a(Ude,"handleTimestamps");function Vde(r){return(r&128)===0}a(Vde,"fileIsNotWritable");function Gde(r,e){return LO(r,e|128)}a(Gde,"makeFileWritable");function LO(r,e){return li.chmodSync(r,e)}a(LO,"setDestMode");function qde(r,e){let t=li.statSync(r);return Mde(e,t.atime,t.mtime)}a(qde,"setDestTimestamps");function Wde(r,e,t,n,i){return e?hU(t,n,i):zde(r.mode,t,n,i)}a(Wde,"onDir");function zde(r,e,t,n){return li.mkdirSync(t),hU(e,t,n),LO(t,r)}a(zde,"mkDirAndCopy");function hU(r,e,t){let n=li.opendirSync(r);try{let i;for(;(i=n.readSync())!==null;)Kde(i.name,r,e,t)}finally{n.closeSync()}}a(hU,"copyDir");function Kde(r,e,t,n){let i=km.join(e,r),s=km.join(t,r);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=Mm.checkPathsSync(i,s,"copy",n);return dU(o,i,s,n)}a(Kde,"copyDirItem");function Hde(r,e,t,n){let i=li.readlinkSync(e);if(n.dereference&&(i=km.resolve(process.cwd(),i)),r){let s;try{s=li.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return li.symlinkSync(i,t);throw o}if(n.dereference&&(s=km.resolve(process.cwd(),s)),i!==s){if(Mm.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Mm.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`)}return Yde(i,t)}else return li.symlinkSync(i,t)}a(Hde,"onLink");function Yde(r,e){return li.unlinkSync(e),li.symlinkSync(r,e)}a(Yde,"copyLink");mU.exports=$de});var rw=T((rke,yU)=>{"use strict";var Xde=sn().fromPromise;yU.exports={copy:Xde(fU()),copySync:gU()}});var $m=T((nke,_U)=>{"use strict";var bU=Nd(),Qde=sn().fromCallback;function Jde(r,e){bU.rm(r,{recursive:!0,force:!0},e)}a(Jde,"remove");function Zde(r){bU.rmSync(r,{recursive:!0,force:!0})}a(Zde,"removeSync");_U.exports={remove:Qde(Jde),removeSync:Zde}});var RU=T((ske,IU)=>{"use strict";var epe=sn().fromPromise,EU=ci(),vU=require("path"),TU=Gs(),AU=$m(),SU=epe(a(async function(e){let t;try{t=await EU.readdir(e)}catch(n){if(n.code!=="ENOENT")throw n;return TU.mkdirs(e)}return Promise.all(t.map(n=>AU.remove(vU.join(e,n))))},"emptyDir"));function wU(r){let e;try{e=EU.readdirSync(r)}catch(t){if(t.code!=="ENOENT")throw t;return TU.mkdirsSync(r)}e.forEach(t=>{t=vU.join(r,t),AU.removeSync(t)})}a(wU,"emptyDirSync");IU.exports={emptyDirSync:wU,emptydirSync:wU,emptyDir:SU,emptydir:SU}});var PU=T((ake,xU)=>{"use strict";var tpe=sn().fromPromise,CU=require("path"),qa=ci(),OU=Gs();async function rpe(r){let e;try{e=await qa.stat(r)}catch{}if(e&&e.isFile())return;let t=CU.dirname(r),n=null;try{n=await qa.stat(t)}catch(i){if(i.code==="ENOENT"){await OU.mkdirs(t),await qa.writeFile(r,"");return}else throw i}n.isDirectory()?await qa.writeFile(r,""):await qa.readdir(t)}a(rpe,"createFile");function npe(r){let e;try{e=qa.statSync(r)}catch{}if(e&&e.isFile())return;let t=CU.dirname(r);try{qa.statSync(t).isDirectory()||qa.readdirSync(t)}catch(n){if(n&&n.code==="ENOENT")OU.mkdirsSync(t);else throw n}qa.writeFileSync(r,"")}a(npe,"createFileSync");xU.exports={createFile:tpe(rpe),createFileSync:npe}});var kU=T((lke,NU)=>{"use strict";var ipe=sn().fromPromise,FU=require("path"),qc=ci(),DU=Gs(),{pathExists:spe}=Gc(),{areIdentical:LU}=hu();async function ope(r,e){let t;try{t=await qc.lstat(e,{bigint:!0})}catch{}let n;try{n=await qc.lstat(r,{bigint:!0})}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&LU(n,t))return;let i=FU.dirname(e);await spe(i)||await DU.mkdirs(i),await qc.link(r,e)}a(ope,"createLink");function ape(r,e){let t;try{t=qc.lstatSync(e,{bigint:!0})}catch{}try{let s=qc.lstatSync(r,{bigint:!0});if(t&&LU(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=FU.dirname(e);return qc.existsSync(n)||DU.mkdirsSync(n),qc.linkSync(r,e)}a(ape,"createLinkSync");NU.exports={createLink:ipe(ope),createLinkSync:ape}});var $U=T((fke,MU)=>{"use strict";var Wc=require("path"),jm=ci(),{pathExists:cpe}=Gc(),lpe=sn().fromPromise;async function upe(r,e){if(Wc.isAbsolute(r)){try{await jm.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:r}}let t=Wc.dirname(e),n=Wc.join(t,r);if(await cpe(n))return{toCwd:n,toDst:r};try{await jm.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:Wc.relative(t,r)}}a(upe,"symlinkPaths");function fpe(r,e){if(Wc.isAbsolute(r)){if(!jm.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}let t=Wc.dirname(e),n=Wc.join(t,r);if(jm.existsSync(n))return{toCwd:n,toDst:r};if(!jm.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:Wc.relative(t,r)}}a(fpe,"symlinkPathsSync");MU.exports={symlinkPaths:lpe(upe),symlinkPathsSync:fpe}});var UU=T((pke,BU)=>{"use strict";var jU=ci(),dpe=sn().fromPromise;async function ppe(r,e){if(e)return e;let t;try{t=await jU.lstat(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(ppe,"symlinkType");function hpe(r,e){if(e)return e;let t;try{t=jU.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(hpe,"symlinkTypeSync");BU.exports={symlinkType:dpe(ppe),symlinkTypeSync:hpe}});var qU=T((mke,GU)=>{"use strict";var mpe=sn().fromPromise,zc=require("path"),Ni=ci(),{mkdirs:gpe,mkdirsSync:ype}=Gs(),{symlinkPaths:bpe,symlinkPathsSync:_pe}=$U(),{symlinkType:Spe,symlinkTypeSync:wpe}=UU(),{pathExists:Epe}=Gc(),{areIdentical:VU}=hu();async function vpe(r,e,t){let n;try{n=await Ni.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let c;if(zc.isAbsolute(r))c=await Ni.stat(r,{bigint:!0});else{let u=zc.dirname(e),f=zc.join(u,r);try{c=await Ni.stat(f,{bigint:!0})}catch{c=await Ni.stat(r,{bigint:!0})}}let l;try{l=await Ni.stat(e,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(l&&VU(c,l))return}let i=await bpe(r,e);r=i.toDst;let s=await Spe(i.toCwd,t),o=zc.dirname(e);return await Epe(o)||await gpe(o),Ni.symlink(r,e,s)}a(vpe,"createSymlink");function Tpe(r,e,t){let n;try{n=Ni.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let c;if(zc.isAbsolute(r))c=Ni.statSync(r,{bigint:!0});else{let u=zc.dirname(e),f=zc.join(u,r);try{c=Ni.statSync(f,{bigint:!0})}catch{c=Ni.statSync(r,{bigint:!0})}}let l;try{l=Ni.statSync(e,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(l&&VU(c,l))return}let i=_pe(r,e);r=i.toDst,t=wpe(i.toCwd,t);let s=zc.dirname(e);return Ni.existsSync(s)||ype(s),Ni.symlinkSync(r,e,t)}a(Tpe,"createSymlinkSync");GU.exports={createSymlink:mpe(vpe),createSymlinkSync:Tpe}});var JU=T((yke,QU)=>{"use strict";var{createFile:WU,createFileSync:zU}=PU(),{createLink:KU,createLinkSync:HU}=kU(),{createSymlink:YU,createSymlinkSync:XU}=qU();QU.exports={createFile:WU,createFileSync:zU,ensureFile:WU,ensureFileSync:zU,createLink:KU,createLinkSync:HU,ensureLink:KU,ensureLinkSync:HU,createSymlink:YU,createSymlinkSync:XU,ensureSymlink:YU,ensureSymlinkSync:XU}});var nw=T((bke,ZU)=>{function Ape(r,{EOL:e=`
385
- `,finalEOL:t=!0,replacer:n=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(r,n,i).replace(/\n/g,e)+s}a(Ape,"stringify");function Ipe(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}a(Ipe,"stripBom");ZU.exports={stringify:Ape,stripBom:Ipe}});var n5=T((Ske,r5)=>{var $d;try{$d=Nd()}catch{$d=require("fs")}var iw=sn(),{stringify:e5,stripBom:t5}=nw();async function Rpe(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||$d,n="throws"in e?e.throws:!0,i=await iw.fromCallback(t.readFile)(r,e);i=t5(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${r}: ${o.message}`,o;return null}return s}a(Rpe,"_readFile");var Cpe=iw.fromPromise(Rpe);function Ope(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||$d,n="throws"in e?e.throws:!0;try{let i=t.readFileSync(r,e);return i=t5(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${r}: ${i.message}`,i;return null}}a(Ope,"readFileSync");async function xpe(r,e,t={}){let n=t.fs||$d,i=e5(e,t);await iw.fromCallback(n.writeFile)(r,i,t)}a(xpe,"_writeFile");var Ppe=iw.fromPromise(xpe);function Fpe(r,e,t={}){let n=t.fs||$d,i=e5(e,t);return n.writeFileSync(r,i,t)}a(Fpe,"writeFileSync");r5.exports={readFile:Cpe,readFileSync:Ope,writeFile:Ppe,writeFileSync:Fpe}});var s5=T((Eke,i5)=>{"use strict";var sw=n5();i5.exports={readJson:sw.readFile,readJsonSync:sw.readFileSync,writeJson:sw.writeFile,writeJsonSync:sw.writeFileSync}});var ow=T((vke,c5)=>{"use strict";var Dpe=sn().fromPromise,NO=ci(),o5=require("path"),a5=Gs(),Lpe=Gc().pathExists;async function Npe(r,e,t="utf-8"){let n=o5.dirname(r);return await Lpe(n)||await a5.mkdirs(n),NO.writeFile(r,e,t)}a(Npe,"outputFile");function kpe(r,...e){let t=o5.dirname(r);NO.existsSync(t)||a5.mkdirsSync(t),NO.writeFileSync(r,...e)}a(kpe,"outputFileSync");c5.exports={outputFile:Dpe(Npe),outputFileSync:kpe}});var u5=T((Ake,l5)=>{"use strict";var{stringify:Mpe}=nw(),{outputFile:$pe}=ow();async function jpe(r,e,t={}){let n=Mpe(e,t);await $pe(r,n,t)}a(jpe,"outputJson");l5.exports=jpe});var d5=T((Rke,f5)=>{"use strict";var{stringify:Bpe}=nw(),{outputFileSync:Upe}=ow();function Vpe(r,e,t){let n=Bpe(e,t);Upe(r,n,t)}a(Vpe,"outputJsonSync");f5.exports=Vpe});var h5=T((Oke,p5)=>{"use strict";var Gpe=sn().fromPromise,ui=s5();ui.outputJson=Gpe(u5());ui.outputJsonSync=d5();ui.outputJSON=ui.outputJson;ui.outputJSONSync=ui.outputJsonSync;ui.writeJSON=ui.writeJson;ui.writeJSONSync=ui.writeJsonSync;ui.readJSON=ui.readJson;ui.readJSONSync=ui.readJsonSync;p5.exports=ui});var _5=T((xke,b5)=>{"use strict";var qpe=ci(),m5=require("path"),{copy:Wpe}=rw(),{remove:y5}=$m(),{mkdirp:zpe}=Gs(),{pathExists:Kpe}=Gc(),g5=hu();async function Hpe(r,e,t={}){let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await g5.checkPaths(r,e,"move",t);await g5.checkParentPaths(r,i,e,"move");let o=m5.dirname(e);return m5.parse(o).root!==o&&await zpe(o),Ype(r,e,n,s)}a(Hpe,"move");async function Ype(r,e,t,n){if(!n){if(t)await y5(e);else if(await Kpe(e))throw new Error("dest already exists.")}try{await qpe.rename(r,e)}catch(i){if(i.code!=="EXDEV")throw i;await Xpe(r,e,t)}}a(Ype,"doRename");async function Xpe(r,e,t){return await Wpe(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),y5(r)}a(Xpe,"moveAcrossDevice");b5.exports=Hpe});var T5=T((Fke,v5)=>{"use strict";var w5=Nd(),MO=require("path"),Qpe=rw().copySync,E5=$m().removeSync,Jpe=Gs().mkdirpSync,S5=hu();function Zpe(r,e,t){t=t||{};let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=S5.checkPathsSync(r,e,"move",t);return S5.checkParentPathsSync(r,i,e,"move"),ehe(e)||Jpe(MO.dirname(e)),the(r,e,n,s)}a(Zpe,"moveSync");function ehe(r){let e=MO.dirname(r);return MO.parse(e).root===e}a(ehe,"isParentRoot");function the(r,e,t,n){if(n)return kO(r,e,t);if(t)return E5(e),kO(r,e,t);if(w5.existsSync(e))throw new Error("dest already exists.");return kO(r,e,t)}a(the,"doRename");function kO(r,e,t){try{w5.renameSync(r,e)}catch(n){if(n.code!=="EXDEV")throw n;return rhe(r,e,t)}}a(kO,"rename");function rhe(r,e,t){return Qpe(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),E5(r)}a(rhe,"moveAcrossDevice");v5.exports=Zpe});var I5=T((Lke,A5)=>{"use strict";var nhe=sn().fromPromise;A5.exports={move:nhe(_5()),moveSync:T5()}});var $o=T((Nke,R5)=>{"use strict";R5.exports={...ci(),...rw(),...RU(),...JU(),...h5(),...Gs(),...I5(),...ow(),...Gc(),...$m()}});function zn(r,e){return{tagName:r,nodeKind:"scalar",implicit:e.implicit??!1,matchByTagPrefix:e.matchByTagPrefix??!1,implicitFirstChars:e.implicitFirstChars??null,resolve:e.resolve,identify:e.identify,represent:e.represent??(t=>String(t)),representTagName:e.representTagName??(()=>r)}}function rx(r,e){let t=e.finalize===void 0;return{tagName:r,nodeKind:"sequence",implicit:!1,matchByTagPrefix:e.matchByTagPrefix??!1,create:e.create,addItem:e.addItem,finalize:e.finalize??(n=>n),carrierIsResult:t,identify:e.identify,represent:e.represent??(n=>n),representTagName:e.representTagName??(()=>r)}}function dw(r,e){let t=e.finalize===void 0;return{tagName:r,nodeKind:"mapping",implicit:!1,matchByTagPrefix:e.matchByTagPrefix??!1,create:e.create,addPair:e.addPair,has:e.has,keys:e.keys,get:e.get,finalize:e.finalize??(n=>n),carrierIsResult:t,identify:e.identify,represent:e.represent??(n=>n),representTagName:e.representTagName??(()=>r)}}function whe(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}function Ehe(r,e){if(e){if(!She.test(r))return St}else if(!_he.test(r))return St;let t=whe(r);return Number.isFinite(t)?t:St}function Ahe(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}function Ihe(r,e){if(e){if(!The.test(r))return St}else if(!vhe.test(r))return St;let t=Ahe(r);return Number.isFinite(t)?t:St}function Ohe(r){let e=r.replace(/_/g,""),t=1;if((e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b"))return t*parseInt(e.slice(2),2);if(e.startsWith("0x"))return t*parseInt(e.slice(2),16);if(e.includes(":")){let n=0;for(let i of e.split(":"))n=n*60+Number(i);return t*n}return e!=="0"&&e[0]==="0"?t*parseInt(e,8):t*parseInt(e,10)}function xhe(r){if(!Che.test(r))return St;let e=Ohe(r);return Number.isFinite(e)?e:St}function Dhe(r){if(!Phe.test(r))return St;let e=r.toLowerCase(),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=t*parseFloat(e);return Number.isFinite(n)||Fhe.test(r)?n:St}function Lhe(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function Mhe(r,e){if(e){if(!khe.test(r))return St;let n=r.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:St}if(!Nhe.test(r))return St;let t=Number(r);return Number.isFinite(t)?t:St}function $he(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function Vhe(r){if(!Bhe.test(r))return St;let e=r.toLowerCase().replace(/_/g,""),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=0;if(e.includes(":")){for(let i of e.split(":"))n=n*60+Number(i);n*=t}else n=t*parseFloat(e);return Number.isFinite(n)||Uhe.test(r)?n:St}function Ghe(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function zhe(r){let e=r.replace(/\s/g,"");if(e.length%4!==0||!Whe.test(e))return St;let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Khe(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function C5(r,e,t,n=0,i=0,s=0,o=0){let c=new Date(Date.UTC(r,e,t,n,i,s,o));return c.setUTCFullYear(r,e,t),c}function Qhe(r){let e=Yhe.exec(r);if(e===null&&(e=Xhe.exec(r)),e===null)return St;let t=+e[1],n=+e[2]-1,i=+e[3];if(!e[4]){let f=C5(t,n,i);return f.getUTCFullYear()!==t||f.getUTCMonth()!==n||f.getUTCDate()!==i?St:f}let s=+e[4],o=+e[5],c=+e[6],l=0;if(s>23||o>59||c>59)return St;if(e[7]){let f=e[7].slice(0,3);for(;f.length<3;)f+="0";l=+f}let u=C5(t,n,i,s,o,c,l);if(u.getUTCFullYear()!==t||u.getUTCMonth()!==n||u.getUTCDate()!==i)return St;if(e[9]){let f=+e[10],d=+(e[11]||0);if(f>23||d>59)return St;let p=(f*60+d)*6e4;u.setTime(u.getTime()-(e[9]==="-"?-p:p))}return u}function pw(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function zO(r,e){let t={};for(let n of e)r[n]!==void 0&&(t[n]=r[n]);return t}function ime(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function sme(){return{scalar:[],sequence:[],mapping:[]}}function ome(r){let e=[];for(let t of r){let n=e.length;for(let i=0;i<e.length;i++){let s=e[i];if(s.nodeKind===t.nodeKind&&s.tagName===t.tagName&&s.matchByTagPrefix===t.matchByTagPrefix){n=i;break}}e[n]=t}return e}function O5(r){if(Array.isArray(r)){let e=Array.prototype.slice.call(r);for(let t=0;t<e.length;t++){if(Array.isArray(e[t]))return null;typeof e[t]=="object"&&Object.prototype.toString.call(e[t])==="[object Object]"&&(e[t]="[object Object]")}return String(e)}return typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"?"[object Object]":String(r)}function $O(r,e,t,n,i){let s="",o="",c=Math.floor(i/2)-1;return n-e>c&&(s=" ... ",e=n-c+s.length),t-n>c&&(o=" ...",t=n+c-o.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function jO(r,e){return" ".repeat(Math.max(e-r.length,0))+r}function lme(r,e){if(!r.buffer)return null;let t={...cme,...e},n=/\r?\n|\r|\0/g,i=[0],s=[],o,c=-1;for(;o=n.exec(r.buffer);)s.push(o.index),i.push(o.index+o[0].length),r.position<=o.index&&c<0&&(c=i.length-2);c<0&&(c=i.length-1);let l="",u=Math.min(r.line+t.linesAfter,s.length).toString().length,f=t.maxLength-(t.indent+u+3);for(let p=1;p<=t.linesBefore&&!(c-p<0);p++){let h=$O(r.buffer,i[c-p],s[c-p],r.position-(i[c]-i[c-p]),f);l=`${" ".repeat(t.indent)}${jO((r.line-p+1).toString(),u)} | ${h.str}
384
+ see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Mm.checkPathsSync(r,e,"copy",t);if(Mm.checkParentPathsSync(r,n,e,"copy"),t.filter&&!t.filter(r,e))return;let s=km.dirname(e);return li.existsSync(s)||kde(s),dU(i,r,e,t)}a($de,"copySync");function dU(r,e,t,n){let s=(n.dereference?li.statSync:li.lstatSync)(e);if(s.isDirectory())return Wde(s,r,e,t,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return jde(s,r,e,t,n);if(s.isSymbolicLink())return Hde(r,e,t,n);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(dU,"getStats");function jde(r,e,t,n,i){return e?Bde(r,t,n,i):pU(r,t,n,i)}a(jde,"onFile");function Bde(r,e,t,n){if(n.overwrite)return li.unlinkSync(t),pU(r,e,t,n);if(n.errorOnExist)throw new Error(`'${t}' already exists`)}a(Bde,"mayCopyFile");function pU(r,e,t,n){return li.copyFileSync(e,t),n.preserveTimestamps&&Ude(r.mode,e,t),LO(t,r.mode)}a(pU,"copyFile");function Ude(r,e,t){return Vde(r)&&Gde(t,r),qde(e,t)}a(Ude,"handleTimestamps");function Vde(r){return(r&128)===0}a(Vde,"fileIsNotWritable");function Gde(r,e){return LO(r,e|128)}a(Gde,"makeFileWritable");function LO(r,e){return li.chmodSync(r,e)}a(LO,"setDestMode");function qde(r,e){let t=li.statSync(r);return Mde(e,t.atime,t.mtime)}a(qde,"setDestTimestamps");function Wde(r,e,t,n,i){return e?hU(t,n,i):zde(r.mode,t,n,i)}a(Wde,"onDir");function zde(r,e,t,n){return li.mkdirSync(t),hU(e,t,n),LO(t,r)}a(zde,"mkDirAndCopy");function hU(r,e,t){let n=li.opendirSync(r);try{let i;for(;(i=n.readSync())!==null;)Kde(i.name,r,e,t)}finally{n.closeSync()}}a(hU,"copyDir");function Kde(r,e,t,n){let i=km.join(e,r),s=km.join(t,r);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=Mm.checkPathsSync(i,s,"copy",n);return dU(o,i,s,n)}a(Kde,"copyDirItem");function Hde(r,e,t,n){let i=li.readlinkSync(e);if(n.dereference&&(i=km.resolve(process.cwd(),i)),r){let s;try{s=li.readlinkSync(t)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return li.symlinkSync(i,t);throw o}if(n.dereference&&(s=km.resolve(process.cwd(),s)),i!==s){if(Mm.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Mm.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`)}return Yde(i,t)}else return li.symlinkSync(i,t)}a(Hde,"onLink");function Yde(r,e){return li.unlinkSync(e),li.symlinkSync(r,e)}a(Yde,"copyLink");mU.exports=$de});var rw=T((nke,yU)=>{"use strict";var Xde=sn().fromPromise;yU.exports={copy:Xde(fU()),copySync:gU()}});var $m=T((ike,_U)=>{"use strict";var bU=Nd(),Qde=sn().fromCallback;function Jde(r,e){bU.rm(r,{recursive:!0,force:!0},e)}a(Jde,"remove");function Zde(r){bU.rmSync(r,{recursive:!0,force:!0})}a(Zde,"removeSync");_U.exports={remove:Qde(Jde),removeSync:Zde}});var RU=T((oke,IU)=>{"use strict";var epe=sn().fromPromise,EU=ci(),vU=require("path"),TU=Gs(),AU=$m(),SU=epe(a(async function(e){let t;try{t=await EU.readdir(e)}catch(n){if(n.code!=="ENOENT")throw n;return TU.mkdirs(e)}return Promise.all(t.map(n=>AU.remove(vU.join(e,n))))},"emptyDir"));function wU(r){let e;try{e=EU.readdirSync(r)}catch(t){if(t.code!=="ENOENT")throw t;return TU.mkdirsSync(r)}e.forEach(t=>{t=vU.join(r,t),AU.removeSync(t)})}a(wU,"emptyDirSync");IU.exports={emptyDirSync:wU,emptydirSync:wU,emptyDir:SU,emptydir:SU}});var PU=T((cke,xU)=>{"use strict";var tpe=sn().fromPromise,CU=require("path"),qa=ci(),OU=Gs();async function rpe(r){let e;try{e=await qa.stat(r)}catch{}if(e&&e.isFile())return;let t=CU.dirname(r),n=null;try{n=await qa.stat(t)}catch(i){if(i.code==="ENOENT"){await OU.mkdirs(t),await qa.writeFile(r,"");return}else throw i}n.isDirectory()?await qa.writeFile(r,""):await qa.readdir(t)}a(rpe,"createFile");function npe(r){let e;try{e=qa.statSync(r)}catch{}if(e&&e.isFile())return;let t=CU.dirname(r);try{qa.statSync(t).isDirectory()||qa.readdirSync(t)}catch(n){if(n&&n.code==="ENOENT")OU.mkdirsSync(t);else throw n}qa.writeFileSync(r,"")}a(npe,"createFileSync");xU.exports={createFile:tpe(rpe),createFileSync:npe}});var kU=T((uke,NU)=>{"use strict";var ipe=sn().fromPromise,FU=require("path"),qc=ci(),DU=Gs(),{pathExists:spe}=Gc(),{areIdentical:LU}=hu();async function ope(r,e){let t;try{t=await qc.lstat(e,{bigint:!0})}catch{}let n;try{n=await qc.lstat(r,{bigint:!0})}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(t&&LU(n,t))return;let i=FU.dirname(e);await spe(i)||await DU.mkdirs(i),await qc.link(r,e)}a(ope,"createLink");function ape(r,e){let t;try{t=qc.lstatSync(e,{bigint:!0})}catch{}try{let s=qc.lstatSync(r,{bigint:!0});if(t&&LU(s,t))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=FU.dirname(e);return qc.existsSync(n)||DU.mkdirsSync(n),qc.linkSync(r,e)}a(ape,"createLinkSync");NU.exports={createLink:ipe(ope),createLinkSync:ape}});var $U=T((dke,MU)=>{"use strict";var Wc=require("path"),jm=ci(),{pathExists:cpe}=Gc(),lpe=sn().fromPromise;async function upe(r,e){if(Wc.isAbsolute(r)){try{await jm.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:r}}let t=Wc.dirname(e),n=Wc.join(t,r);if(await cpe(n))return{toCwd:n,toDst:r};try{await jm.lstat(r)}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return{toCwd:r,toDst:Wc.relative(t,r)}}a(upe,"symlinkPaths");function fpe(r,e){if(Wc.isAbsolute(r)){if(!jm.existsSync(r))throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}let t=Wc.dirname(e),n=Wc.join(t,r);if(jm.existsSync(n))return{toCwd:n,toDst:r};if(!jm.existsSync(r))throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:Wc.relative(t,r)}}a(fpe,"symlinkPathsSync");MU.exports={symlinkPaths:lpe(upe),symlinkPathsSync:fpe}});var UU=T((hke,BU)=>{"use strict";var jU=ci(),dpe=sn().fromPromise;async function ppe(r,e){if(e)return e;let t;try{t=await jU.lstat(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(ppe,"symlinkType");function hpe(r,e){if(e)return e;let t;try{t=jU.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}a(hpe,"symlinkTypeSync");BU.exports={symlinkType:dpe(ppe),symlinkTypeSync:hpe}});var qU=T((gke,GU)=>{"use strict";var mpe=sn().fromPromise,zc=require("path"),Ni=ci(),{mkdirs:gpe,mkdirsSync:ype}=Gs(),{symlinkPaths:bpe,symlinkPathsSync:_pe}=$U(),{symlinkType:Spe,symlinkTypeSync:wpe}=UU(),{pathExists:Epe}=Gc(),{areIdentical:VU}=hu();async function vpe(r,e,t){let n;try{n=await Ni.lstat(e)}catch{}if(n&&n.isSymbolicLink()){let c;if(zc.isAbsolute(r))c=await Ni.stat(r,{bigint:!0});else{let u=zc.dirname(e),f=zc.join(u,r);try{c=await Ni.stat(f,{bigint:!0})}catch{c=await Ni.stat(r,{bigint:!0})}}let l;try{l=await Ni.stat(e,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(l&&VU(c,l))return}let i=await bpe(r,e);r=i.toDst;let s=await Spe(i.toCwd,t),o=zc.dirname(e);return await Epe(o)||await gpe(o),Ni.symlink(r,e,s)}a(vpe,"createSymlink");function Tpe(r,e,t){let n;try{n=Ni.lstatSync(e)}catch{}if(n&&n.isSymbolicLink()){let c;if(zc.isAbsolute(r))c=Ni.statSync(r,{bigint:!0});else{let u=zc.dirname(e),f=zc.join(u,r);try{c=Ni.statSync(f,{bigint:!0})}catch{c=Ni.statSync(r,{bigint:!0})}}let l;try{l=Ni.statSync(e,{bigint:!0})}catch(u){if(u.code!=="ENOENT")throw u}if(l&&VU(c,l))return}let i=_pe(r,e);r=i.toDst,t=wpe(i.toCwd,t);let s=zc.dirname(e);return Ni.existsSync(s)||ype(s),Ni.symlinkSync(r,e,t)}a(Tpe,"createSymlinkSync");GU.exports={createSymlink:mpe(vpe),createSymlinkSync:Tpe}});var JU=T((bke,QU)=>{"use strict";var{createFile:WU,createFileSync:zU}=PU(),{createLink:KU,createLinkSync:HU}=kU(),{createSymlink:YU,createSymlinkSync:XU}=qU();QU.exports={createFile:WU,createFileSync:zU,ensureFile:WU,ensureFileSync:zU,createLink:KU,createLinkSync:HU,ensureLink:KU,ensureLinkSync:HU,createSymlink:YU,createSymlinkSync:XU,ensureSymlink:YU,ensureSymlinkSync:XU}});var nw=T((_ke,ZU)=>{function Ape(r,{EOL:e=`
385
+ `,finalEOL:t=!0,replacer:n=null,spaces:i}={}){let s=t?e:"";return JSON.stringify(r,n,i).replace(/\n/g,e)+s}a(Ape,"stringify");function Ipe(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}a(Ipe,"stripBom");ZU.exports={stringify:Ape,stripBom:Ipe}});var n5=T((wke,r5)=>{var $d;try{$d=Nd()}catch{$d=require("fs")}var iw=sn(),{stringify:e5,stripBom:t5}=nw();async function Rpe(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||$d,n="throws"in e?e.throws:!0,i=await iw.fromCallback(t.readFile)(r,e);i=t5(i);let s;try{s=JSON.parse(i,e?e.reviver:null)}catch(o){if(n)throw o.message=`${r}: ${o.message}`,o;return null}return s}a(Rpe,"_readFile");var Cpe=iw.fromPromise(Rpe);function Ope(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||$d,n="throws"in e?e.throws:!0;try{let i=t.readFileSync(r,e);return i=t5(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${r}: ${i.message}`,i;return null}}a(Ope,"readFileSync");async function xpe(r,e,t={}){let n=t.fs||$d,i=e5(e,t);await iw.fromCallback(n.writeFile)(r,i,t)}a(xpe,"_writeFile");var Ppe=iw.fromPromise(xpe);function Fpe(r,e,t={}){let n=t.fs||$d,i=e5(e,t);return n.writeFileSync(r,i,t)}a(Fpe,"writeFileSync");r5.exports={readFile:Cpe,readFileSync:Ope,writeFile:Ppe,writeFileSync:Fpe}});var s5=T((vke,i5)=>{"use strict";var sw=n5();i5.exports={readJson:sw.readFile,readJsonSync:sw.readFileSync,writeJson:sw.writeFile,writeJsonSync:sw.writeFileSync}});var ow=T((Tke,c5)=>{"use strict";var Dpe=sn().fromPromise,NO=ci(),o5=require("path"),a5=Gs(),Lpe=Gc().pathExists;async function Npe(r,e,t="utf-8"){let n=o5.dirname(r);return await Lpe(n)||await a5.mkdirs(n),NO.writeFile(r,e,t)}a(Npe,"outputFile");function kpe(r,...e){let t=o5.dirname(r);NO.existsSync(t)||a5.mkdirsSync(t),NO.writeFileSync(r,...e)}a(kpe,"outputFileSync");c5.exports={outputFile:Dpe(Npe),outputFileSync:kpe}});var u5=T((Ike,l5)=>{"use strict";var{stringify:Mpe}=nw(),{outputFile:$pe}=ow();async function jpe(r,e,t={}){let n=Mpe(e,t);await $pe(r,n,t)}a(jpe,"outputJson");l5.exports=jpe});var d5=T((Cke,f5)=>{"use strict";var{stringify:Bpe}=nw(),{outputFileSync:Upe}=ow();function Vpe(r,e,t){let n=Bpe(e,t);Upe(r,n,t)}a(Vpe,"outputJsonSync");f5.exports=Vpe});var h5=T((xke,p5)=>{"use strict";var Gpe=sn().fromPromise,ui=s5();ui.outputJson=Gpe(u5());ui.outputJsonSync=d5();ui.outputJSON=ui.outputJson;ui.outputJSONSync=ui.outputJsonSync;ui.writeJSON=ui.writeJson;ui.writeJSONSync=ui.writeJsonSync;ui.readJSON=ui.readJson;ui.readJSONSync=ui.readJsonSync;p5.exports=ui});var _5=T((Pke,b5)=>{"use strict";var qpe=ci(),m5=require("path"),{copy:Wpe}=rw(),{remove:y5}=$m(),{mkdirp:zpe}=Gs(),{pathExists:Kpe}=Gc(),g5=hu();async function Hpe(r,e,t={}){let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await g5.checkPaths(r,e,"move",t);await g5.checkParentPaths(r,i,e,"move");let o=m5.dirname(e);return m5.parse(o).root!==o&&await zpe(o),Ype(r,e,n,s)}a(Hpe,"move");async function Ype(r,e,t,n){if(!n){if(t)await y5(e);else if(await Kpe(e))throw new Error("dest already exists.")}try{await qpe.rename(r,e)}catch(i){if(i.code!=="EXDEV")throw i;await Xpe(r,e,t)}}a(Ype,"doRename");async function Xpe(r,e,t){return await Wpe(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),y5(r)}a(Xpe,"moveAcrossDevice");b5.exports=Hpe});var T5=T((Dke,v5)=>{"use strict";var w5=Nd(),MO=require("path"),Qpe=rw().copySync,E5=$m().removeSync,Jpe=Gs().mkdirpSync,S5=hu();function Zpe(r,e,t){t=t||{};let n=t.overwrite||t.clobber||!1,{srcStat:i,isChangingCase:s=!1}=S5.checkPathsSync(r,e,"move",t);return S5.checkParentPathsSync(r,i,e,"move"),ehe(e)||Jpe(MO.dirname(e)),the(r,e,n,s)}a(Zpe,"moveSync");function ehe(r){let e=MO.dirname(r);return MO.parse(e).root===e}a(ehe,"isParentRoot");function the(r,e,t,n){if(n)return kO(r,e,t);if(t)return E5(e),kO(r,e,t);if(w5.existsSync(e))throw new Error("dest already exists.");return kO(r,e,t)}a(the,"doRename");function kO(r,e,t){try{w5.renameSync(r,e)}catch(n){if(n.code!=="EXDEV")throw n;return rhe(r,e,t)}}a(kO,"rename");function rhe(r,e,t){return Qpe(r,e,{overwrite:t,errorOnExist:!0,preserveTimestamps:!0}),E5(r)}a(rhe,"moveAcrossDevice");v5.exports=Zpe});var I5=T((Nke,A5)=>{"use strict";var nhe=sn().fromPromise;A5.exports={move:nhe(_5()),moveSync:T5()}});var $o=T((kke,R5)=>{"use strict";R5.exports={...ci(),...rw(),...RU(),...JU(),...h5(),...Gs(),...I5(),...ow(),...Gc(),...$m()}});function zn(r,e){return{tagName:r,nodeKind:"scalar",implicit:e.implicit??!1,matchByTagPrefix:e.matchByTagPrefix??!1,implicitFirstChars:e.implicitFirstChars??null,resolve:e.resolve,identify:e.identify,represent:e.represent??(t=>String(t)),representTagName:e.representTagName??(()=>r)}}function rx(r,e){let t=e.finalize===void 0;return{tagName:r,nodeKind:"sequence",implicit:!1,matchByTagPrefix:e.matchByTagPrefix??!1,create:e.create,addItem:e.addItem,finalize:e.finalize??(n=>n),carrierIsResult:t,identify:e.identify,represent:e.represent??(n=>n),representTagName:e.representTagName??(()=>r)}}function dw(r,e){let t=e.finalize===void 0;return{tagName:r,nodeKind:"mapping",implicit:!1,matchByTagPrefix:e.matchByTagPrefix??!1,create:e.create,addPair:e.addPair,has:e.has,keys:e.keys,get:e.get,finalize:e.finalize??(n=>n),carrierIsResult:t,identify:e.identify,represent:e.represent??(n=>n),representTagName:e.representTagName??(()=>r)}}function whe(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}function Ehe(r,e){if(e){if(!She.test(r))return St}else if(!_he.test(r))return St;let t=whe(r);return Number.isFinite(t)?t:St}function Ahe(r){let e=r,t=1;return(e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b")?t*parseInt(e.slice(2),2):e.startsWith("0o")?t*parseInt(e.slice(2),8):e.startsWith("0x")?t*parseInt(e.slice(2),16):t*parseInt(e,10)}function Ihe(r,e){if(e){if(!The.test(r))return St}else if(!vhe.test(r))return St;let t=Ahe(r);return Number.isFinite(t)?t:St}function Ohe(r){let e=r.replace(/_/g,""),t=1;if((e[0]==="-"||e[0]==="+")&&(e[0]==="-"&&(t=-1),e=e.slice(1)),e.startsWith("0b"))return t*parseInt(e.slice(2),2);if(e.startsWith("0x"))return t*parseInt(e.slice(2),16);if(e.includes(":")){let n=0;for(let i of e.split(":"))n=n*60+Number(i);return t*n}return e!=="0"&&e[0]==="0"?t*parseInt(e,8):t*parseInt(e,10)}function xhe(r){if(!Che.test(r))return St;let e=Ohe(r);return Number.isFinite(e)?e:St}function Dhe(r){if(!Phe.test(r))return St;let e=r.toLowerCase(),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=t*parseFloat(e);return Number.isFinite(n)||Fhe.test(r)?n:St}function Lhe(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function Mhe(r,e){if(e){if(!khe.test(r))return St;let n=r.toLowerCase(),i=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;let s=i*parseFloat(n);return Number.isFinite(s)?s:St}if(!Nhe.test(r))return St;let t=Number(r);return Number.isFinite(t)?t:St}function $he(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function Vhe(r){if(!Bhe.test(r))return St;let e=r.toLowerCase().replace(/_/g,""),t=e[0]==="-"?-1:1;if("+-".includes(e[0])&&(e=e.slice(1)),e===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(e===".nan")return NaN;let n=0;if(e.includes(":")){for(let i of e.split(":"))n=n*60+Number(i);n*=t}else n=t*parseFloat(e);return Number.isFinite(n)||Uhe.test(r)?n:St}function Ghe(r){if(isNaN(r))return".nan";if(r===Number.POSITIVE_INFINITY)return".inf";if(r===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(r,-0))return"-0.0";let e=r.toString(10);return/^[-+]?[0-9]+e/.test(e)?e.replace("e",".e"):e}function zhe(r){let e=r.replace(/\s/g,"");if(e.length%4!==0||!Whe.test(e))return St;let t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n}function Khe(r){let e="";for(let t=0;t<r.length;t++)e+=String.fromCharCode(r[t]);return btoa(e)}function C5(r,e,t,n=0,i=0,s=0,o=0){let c=new Date(Date.UTC(r,e,t,n,i,s,o));return c.setUTCFullYear(r,e,t),c}function Qhe(r){let e=Yhe.exec(r);if(e===null&&(e=Xhe.exec(r)),e===null)return St;let t=+e[1],n=+e[2]-1,i=+e[3];if(!e[4]){let f=C5(t,n,i);return f.getUTCFullYear()!==t||f.getUTCMonth()!==n||f.getUTCDate()!==i?St:f}let s=+e[4],o=+e[5],c=+e[6],l=0;if(s>23||o>59||c>59)return St;if(e[7]){let f=e[7].slice(0,3);for(;f.length<3;)f+="0";l=+f}let u=C5(t,n,i,s,o,c,l);if(u.getUTCFullYear()!==t||u.getUTCMonth()!==n||u.getUTCDate()!==i)return St;if(e[9]){let f=+e[10],d=+(e[11]||0);if(f>23||d>59)return St;let p=(f*60+d)*6e4;u.setTime(u.getTime()-(e[9]==="-"?-p:p))}return u}function pw(r){if(r===null||typeof r!="object"||Array.isArray(r))return!1;let e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function zO(r,e){let t={};for(let n of e)r[n]!==void 0&&(t[n]=r[n]);return t}function ime(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function sme(){return{scalar:[],sequence:[],mapping:[]}}function ome(r){let e=[];for(let t of r){let n=e.length;for(let i=0;i<e.length;i++){let s=e[i];if(s.nodeKind===t.nodeKind&&s.tagName===t.tagName&&s.matchByTagPrefix===t.matchByTagPrefix){n=i;break}}e[n]=t}return e}function O5(r){if(Array.isArray(r)){let e=Array.prototype.slice.call(r);for(let t=0;t<e.length;t++){if(Array.isArray(e[t]))return null;typeof e[t]=="object"&&Object.prototype.toString.call(e[t])==="[object Object]"&&(e[t]="[object Object]")}return String(e)}return typeof r=="object"&&Object.prototype.toString.call(r)==="[object Object]"?"[object Object]":String(r)}function $O(r,e,t,n,i){let s="",o="",c=Math.floor(i/2)-1;return n-e>c&&(s=" ... ",e=n-c+s.length),t-n>c&&(o=" ...",t=n+c-o.length),{str:s+r.slice(e,t).replace(/\t/g,"\u2192")+o,pos:n-e+s.length}}function jO(r,e){return" ".repeat(Math.max(e-r.length,0))+r}function lme(r,e){if(!r.buffer)return null;let t={...cme,...e},n=/\r?\n|\r|\0/g,i=[0],s=[],o,c=-1;for(;o=n.exec(r.buffer);)s.push(o.index),i.push(o.index+o[0].length),r.position<=o.index&&c<0&&(c=i.length-2);c<0&&(c=i.length-1);let l="",u=Math.min(r.line+t.linesAfter,s.length).toString().length,f=t.maxLength-(t.indent+u+3);for(let p=1;p<=t.linesBefore&&!(c-p<0);p++){let h=$O(r.buffer,i[c-p],s[c-p],r.position-(i[c]-i[c-p]),f);l=`${" ".repeat(t.indent)}${jO((r.line-p+1).toString(),u)} | ${h.str}
386
386
  ${l}`}let d=$O(r.buffer,i[c],s[c],r.position,f);l+=`${" ".repeat(t.indent)}${jO((r.line+1).toString(),u)} | ${d.str}
387
387
  `,l+=`${"-".repeat(t.indent+u+3+d.pos)}^
388
388
  `;for(let p=1;p<=t.linesAfter&&!(c+p>=s.length);p++){let h=$O(r.buffer,i[c+p],s[c+p],r.position-(i[c]-i[c+p]),f);l+=`${" ".repeat(t.indent)}${jO((r.line+p+1).toString(),u)} | ${h.str}
@@ -432,7 +432,7 @@ ${" ".repeat(r.indent*e)}`}function qge(r,e,t,n,i,s){return{node:e,parent:t,leve
432
432
  `:" ";n+=`---${d}${f}
433
433
  `}else n+=za(t,0,o.contents,null,{block:!0,compact:!0}).text+`
434
434
  `;i=o.explicitEnd||t.openEnded,i&&(n+=`...
435
- `)}return n}function Jge(r,e){let t=String(r),n=String(e);return t<n?-1:t>n?1:0}function Wd(r,e={}){let t={...Qge,...e},n=Jme(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});if(t.flowLevel>=0&&B5(n,(i,s)=>{if(!(s.depth<t.flowLevel))return(i.kind==="sequence"||i.kind==="mapping")&&(i.style=ki.FLOW),a6}),t.sortKeys){let i=t.sortKeys===!0?Jge:t.sortKeys;B5(n,s=>{s.kind==="mapping"&&s.items.sort((o,c)=>i(o.key.kind==="scalar"?o.key.value:"",c.key.kind==="scalar"?c.key.value:""))})}return t.transform(n),Xge(n,{...zO(t,Object.keys(ux)),schema:t.schema})}var St,ihe,she,ohe,ahe,che,lhe,uhe,fhe,dhe,phe,hhe,mhe,ghe,yhe,bhe,_he,She,q5,vhe,The,Rhe,Che,qO,Phe,Fhe,W5,Nhe,khe,jhe,Bhe,Uhe,WO,qhe,Whe,Hhe,Yhe,Xhe,Jhe,Zhe,eme,tme,rme,nme,hw,nx,kke,Su,Gm,ame,Mke,$ke,cme,Kc,Sr,qe,ki,Ki,ume,H5,Y5,bme,jd,_me,sx,vt,e6,Vd,KO,t6,lw,Ame,Ime,r6,HO,n6,Rme,Cme,Ome,ox,Hme,mu,Zme,a6,U5,age,cge,lge,cx,l6,gw,u6,f6,uge,QO,JO,fge,dge,d6,p6,h6,m6,g6,y6,pge,hge,mge,gge,yge,bge,_ge,Sge,wge,Ege,vge,Tge,Age,Ige,lx,jge,fw,ux,Qge,jke,Bke,Uke,Vke,Gke,qke,Wke,zke,Kke,Hke,Yke,Xke,Qke,Jke,Zke,eMe,qm=$e(()=>{St=Symbol("NOT_RESOLVED");a(zn,"defineScalarTag");a(rx,"defineSequenceTag");a(dw,"defineMappingTag");ihe=zn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),she=["","~","null","Null","NULL"],ohe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>she.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),ahe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),che=["","~","null","Null","NULL"],lhe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>che.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),uhe=["true","True","TRUE"],fhe=["false","False","FALSE"],dhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>uhe.indexOf(r)!==-1?!0:fhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),phe=["true"],hhe=["false"],mhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>phe.indexOf(r)!==-1?!0:hhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),ghe=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],yhe=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],bhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>ghe.indexOf(r)!==-1?!0:yhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),_he=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),She=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(whe,"parseYamlInteger$2");a(Ehe,"resolveYamlInteger$2");q5=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Ehe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),vhe=new RegExp("^-?(?:0|[1-9][0-9]*)$"),The=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(Ahe,"parseYamlInteger$1");a(Ihe,"resolveYamlInteger$1");Rhe=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Ihe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Che=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Ohe,"parseYamlInteger");a(xhe,"resolveYamlInteger");qO=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:xhe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Phe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Fhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Dhe,"resolveYamlFloat$2");a(Lhe,"representYamlFloat$2");W5=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Dhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Lhe}),Nhe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),khe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Mhe,"resolveYamlFloat$1");a($he,"representYamlFloat$1");jhe=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Mhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:$he}),Bhe=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Uhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Vhe,"resolveYamlFloat");a(Ghe,"representYamlFloat");WO=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Vhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Ghe}),qhe=zn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":St,"resolve"),identify:a(()=>!1,"identify")}),Whe=/^[A-Za-z0-9+/]*={0,2}$/;a(zhe,"resolveYamlBinary");a(Khe,"representYamlBinary");Hhe=zn("tag:yaml.org,2002:binary",{resolve:zhe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:Khe}),Yhe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Xhe=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]))?))?$");a(C5,"makeUtcDate");a(Qhe,"resolveYamlTimestamp");Jhe=zn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Qhe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Zhe=rx("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(pw,"isPlainObject");a(zO,"pick");eme=rx("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(pw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),tme=rx("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),rme=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),nme=dw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(ime,"createTagDefinitionMap");a(sme,"createTagDefinitionListMap");a(ome,"compileTags");hw=class z5{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ome(e),n=[],i=ime(),s=sme();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==St)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new z5([...this.tags,...t])}},nx=new hw([ihe,Zhe,rme]),kke=new hw([...nx.tags,ahe,mhe,Rhe,jhe]),Su=new hw([...nx.tags,ohe,dhe,q5,W5]),Gm=new hw([...nx.tags,lhe,bhe,qO,WO,Jhe,qhe,Hhe,eme,tme,nme]),ame=Gm.withTags({...qO,resolve:a((r,e,t)=>{let n=qO.resolve(r,e,t);return n===St?q5.resolve(r,e,t):n},"resolve")},{...WO,resolve:a((r,e,t)=>{let n=WO.resolve(r,e,t);return n===St?W5.resolve(r,e,t):n},"resolve")}),Mke=dw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||pw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(O5,"normalizeKey");$ke=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=O5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=O5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),cme={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a($O,"getLine");a(jO,"padStart");a(lme,"makeSnippet");a(x5,"formatError");Kc=class K5 extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=x5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${x5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=lme(c),new K5(n,c)}},Sr={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},qe={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},ki={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},ume=-1;a(P5,"simpleEscapeSequence");H5=new Array(256),Y5=new Array(256);for(let r=0;r<256;r++)H5[r]=P5(r)?1:0,Y5[r]=P5(r);a(fme,"charFromCodepoint");a(dme,"fromHexCode$1");a(pme,"escapedHexLen$1");a(cw,"skipFoldedBreaks");a(ix,"foldedBreaks");a(hme,"getPlainValue");a(mme,"getSingleQuotedValue");a(gme,"getDoubleQuotedValue");a(F5,"getBlockValue");a(yme,"getScalarValue");bme=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(BO,"tagPercentEncode");a(X5,"tagNameFull");a(Q5,"tagNameShort");jd=-1,_me="tag:yaml.org,2002:merge",sx={filename:"",schema:Su,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(Sme,"eventPosition$1");a(xn,"throwError$1");a(J5,"finalizeCollection");a(wme,"constructScalar");a(D5,"collectionTagName");a(Z5,"isMappingTag");a(L5,"chargeMergeWork");a(N5,"mergeKeys");a(Eme,"mergeSource");a(vme,"addMappingValue");a(UO,"addValue");a(VO,"storeAnchor");a(Tme,"constructFromEvents");vt=-1,e6=Object.prototype.hasOwnProperty,Vd=1,KO=2,t6=3,lw=4,Ame=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ime=/[,\[\]{}]/,r6=/^(?:!|!!|![0-9A-Za-z-]+!)$/,HO=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,n6=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Rme=new RegExp(`^(?:${HO})*$`),Cme=new RegExp(`^(?:${n6})+$`),Ome=new RegExp(`^(?:!(?:${HO})*|${n6}(?:${HO})*)$`),ox={filename:"",maxDepth:100};a(xme,"addDocumentEvent");a(i6,"addSequenceEvent");a(YO,"addMappingEvent");a(k5,"insertFlowPairMappingEvent");a(qd,"addScalarEvent");a(Pme,"addAliasEvent");a(Bd,"addPopEvent");a(fi,"addEmptyScalarEvent");a(M5,"emptyProperties");a(Ud,"snapshotState");a(gu,"restoreState");a(Ue,"throwError");a(an,"isEol");a(bu,"isWhiteSpace");a(qs,"isWsOrEol");a(Wa,"isWsOrEolOrEnd");a(_u,"isFlowIndicator");a(Fme,"fromDecimalCode");a(Dme,"fromHexCode");a(Lme,"escapedHexLen");a(Nme,"isSimpleEscape");a(uw,"consumeLineBreak");a(Wn,"skipSeparationSpace");a(Gd,"testDocumentSeparator");a(s6,"skipByteOrderMark");a(ax,"testDocumentBoundary");a($5,"skipUntilLineEnd");a(o6,"checkPrintable");a(kme,"readTagProperty");a(Mme,"readAnchorProperty");a($me,"readAlias");a(XO,"readFlowScalarBreak");a(jme,"readSingleQuotedScalar");a(Bme,"readDoubleQuotedScalar");a(Ume,"readBlockScalar");a(Vme,"canStartPlainScalar");a(Gme,"readPlainScalar");a(Bm,"skipFlowSeparationSpace");a(qme,"readFlowCollection");a(j5,"readBlockSequence");a(GO,"readBlockMapping");a(yu,"parseNode");a(Wme,"readDirective");a(zme,"readDocument");a(Kme,"parseEvents");Hme={...ox,...sx};a(Yme,"loadDocuments");a(Hc,"load");mu=Symbol("INVALID");a(Xme,"buildRepresentTypes");a(Qme,"matchTag");a(Vm,"build");a(Jme,"jsToAst");Zme=Symbol("visit:break"),a6=Symbol("visit:skip");a(aw,"visitNode");a(B5,"visit");a(mw,"hasBit");U5={applyQuoteFlowKeysOption:ege,doubleQuoteForInvisibles:tge,doubleQuoteWhitespaceOnly:rge,applyForceQuotesOption:nge,tryLongOrMultilineAsBlock:ige,quoteInvalidPlain:sge,fallbackToDoubleQuoted:oge};a(c6,"_preferredQuotedStyle");a(ege,"applyQuoteFlowKeysOption");a(tge,"doubleQuoteForInvisibles");a(rge,"doubleQuoteWhitespaceOnly");a(nge,"applyForceQuotesOption");a(ige,"tryLongOrMultilineAsBlock");a(sge,"quoteInvalidPlain");a(oge,"fallbackToDoubleQuoted");a(Um,"setBit");age="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",cge="[\\n\\r]",lge="\\uFEFF",cx="[ \\t]",l6=`(?:(?!(?:${cge}|${lge}))${age})`,gw=`(?:(?!${cx})${l6})`,u6="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",f6="[-?:,\\[\\]{}#&*!|>'\"%@`]",uge="[,\\[\\]{}]",QO=gw,JO=`(?:(?!${uge})${gw})`,fge=`(?:(?:(?!${f6})${gw})|[?:-](?=${QO}))`,dge=`(?:(?:(?!${f6})${gw})|[?:-](?=${JO}))`,d6=`(?:(?:(?![:#])${QO})|:(?=${QO}))#*`,p6=`(?:(?:(?![:#])${JO})|:(?=${JO}))#*`,h6=`(?:${cx}*${d6})*`,m6=`(?:${cx}*${p6})*`,g6=`${fge}#*${h6}`,y6=`${dge}#*${m6}`,pge=g6,hge=y6,mge=`\\n+${d6}${h6}`,gge=`\\n+${p6}${m6}`,yge=`${g6}(?:${mge})*`,bge=`${y6}(?:${gge})*`,_ge=new RegExp(`^(?:${yge})$`,"u"),Sge=new RegExp(`^(?:${bge})$`,"u"),wge=new RegExp(`^(?:${pge})$`,"u"),Ege=new RegExp(`^(?:${hge})$`,"u"),vge=new RegExp(`^(?:${u6})*$`,"u"),Tge=new RegExp(`^(?:${u6}|\\n)*$`,"u"),Age=new RegExp(`^(?:${l6}|\\n)*$`,"u"),Ige=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,lx=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;a(Rge,"canUsePlain");a(Cge,"canUseSingleQuoted");a(Oge,"canUseBlock");a(xge,"detectAllowedStyles");a(Pge,"renderScalar");a(Fge,"renderPlain");a(Dge,"renderSingleQuoted");a(Lge,"renderLiteralBlock");a(Nge,"renderFoldedBlock");a(kge,"renderDoubleQuoted");a(b6,"encodeFlowBreaks");a(_6,"indentString");a(Mge,"needIndentIndicator");a(S6,"blockHeader");a(w6,"dropEndingNewline");a(ZO,"isMoreIndented");a(V5,"foldLine");a($ge,"foldBlockScalar");jge=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;a(Bge,"escapeCharacter");a(Uge,"escapeString");fw=10,ux={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(U5).map(r=>Reflect.get(U5,r)),tagBeforeAnchor:!1};a(Vge,"nodeTagShort");a(Gge,"createPresenterState");a(ex,"generateNextLine");a(qge,"scalarLayout");a(Wge,"writeFlowSequence");a(G5,"writeBlockSequence");a(zge,"writeFlowMapping");a(Kge,"writeBlockMapping");a(tx,"cannotBeCompact");a(za,"writeNode");a(Hge,"rootStartsOwnLine");a(Yge,"writeDocumentDirectives");a(Xge,"present");Qge={...ux,schema:ame,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:a(()=>{},"transform")};a(Jge,"defaultCompareFn");a(Wd,"dump");jke=Sr.DOCUMENT,Bke=Sr.SEQUENCE,Uke=Sr.MAPPING,Vke=Sr.SCALAR,Gke=Sr.ALIAS,qke=Sr.POP,Wke=qe.PLAIN,zke=qe.SINGLE_QUOTED,Kke=qe.DOUBLE_QUOTED,Hke=qe.LITERAL_BLOCK,Yke=qe.FOLDED_BLOCK,Xke=ki.BLOCK,Qke=ki.FLOW,Jke=Ki.CLIP,Zke=Ki.STRIP,eMe=Ki.KEEP});var fx,E6,Zge,v6=$e(()=>{fx=a((r,e,t)=>{let n=r instanceof RegExp?E6(r,t):r,i=e instanceof RegExp?E6(e,t):e,s=n!==null&&i!=null&&Zge(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),E6=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),Zge=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function dx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function hye(r){return r.replace(sye,T6).replace(oye,A6).replace(aye,mx).replace(cye,I6).replace(lye,R6)}function mye(r){return r.replace(eye,"\\").replace(tye,"{").replace(rye,"}").replace(nye,",").replace(iye,".")}function px(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function gye(r){let e=[],t="";for(;;){let n=fx("{","}",r);if(!n){let l=r.split(",");return l[0]=t+l[0],px(e,l),e}let{pre:i,body:s,post:o}=n,c=i.split(",");if(c[0]=t+c[0],c[c.length-1]+="{"+s+"}",!o.length)return px(e,c),e;t=c.pop(),px(e,c),r=o}}function C6(r,e={}){if(!r)return[];let{max:t=uye,maxLength:n=fye,maxDepth:i=dye,maxRewrites:s=pye}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),hx(hye(r),t,n,i,0,s,!0).map(mye)}function yye(r){return"{"+r+"}"}function bye(r){return/^-?0\d/.test(r)}function _ye(r,e){return r<=e}function Sye(r,e){return r>=e}function Wm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function wye(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=dx(i[0]),c=dx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(dx(i[2])),1):1,f=_ye;c<o&&(u*=-1,f=Sye);let p=i.some(bye),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let S=new Array(b+1).join("0");g<0?m="-"+S+m.slice(1):m=S+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function hx(r,e,t,n,i,s,o){if(i>n)return[r];let c=[""],l=0,u=!1,f=!0;for(;;){let d=fx("{","}",r);if(!d)return Wm(c,r,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(c=Wm(c,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),f=!1,!d.post.length)break;r=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||g,b=d.body.indexOf(",")>=0;if(!m&&!b){if(l<s&&d.post.match(/,(?!,).*\}/)){l++,r=d.pre+"{"+d.body+mx+d.post,o=!0;continue}return Wm(c,p+"{"+d.body+"}"+d.post,[""],e,t,u)}f&&(u=o&&!m,f=!1);let S;if(m)S=wye(d.body,g,e,t);else{let _=gye(d.body);if(_.length===1&&_[0]!==void 0&&(_=hx(_[0],e,t,n,i+1,s,!1).map(yye),_.length===1)){if(c=Wm(c,p+_[0],[""],e,t,u&&!d.post.length),!d.post.length)break;r=d.post;continue}let A=u&&!d.post.length&&!p;for(let w=0;A&&w<c.length;w++)c[w]&&(A=!1);S=[];let E=0;e:for(let w=0;w<_.length;w++){let R=hx(_[w],e,t,n,i+1,s,!1);for(let O=0;O<R.length;O++){let P=R[O];if(!(A&&!P)){if(S.length>=e||E+P.length>t)break e;S.push(P),E+=P.length}}}}if(c=Wm(c,p,S,e,t,u&&!d.post.length),!d.post.length)break;r=d.post}return c}var T6,A6,mx,I6,R6,eye,tye,rye,nye,iye,sye,oye,aye,cye,lye,uye,fye,dye,pye,O6=$e(()=>{v6();T6="\0SLASH"+Math.random()+"\0",A6="\0OPEN"+Math.random()+"\0",mx="\0CLOSE"+Math.random()+"\0",I6="\0COMMA"+Math.random()+"\0",R6="\0PERIOD"+Math.random()+"\0",eye=new RegExp(T6,"g"),tye=new RegExp(A6,"g"),rye=new RegExp(mx,"g"),nye=new RegExp(I6,"g"),iye=new RegExp(R6,"g"),sye=/\\\\/g,oye=/\\{/g,aye=/\\}/g,cye=/\\,/g,lye=/\\\./g,uye=1e5,fye=4e6,dye=1e3,pye=1e3;a(dx,"numeric");a(hye,"escapeBraces");a(mye,"unescapeBraces");a(px,"pushAll");a(gye,"parseCommaParts");a(C6,"expand");a(yye,"embrace");a(bye,"isPadded");a(_ye,"lte");a(Sye,"gte");a(Wm,"combine");a(wye,"expandSequence");a(hx,"expand_")});var zm,x6=$e(()=>{zm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Eye,Km,vye,P6,F6,D6=$e(()=>{Eye={"[: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]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),P6=a(r=>r.join(""),"rangesToString"),F6=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[S,_,A]]of Object.entries(Eye))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,A?i.push(S):n.push(S),c=c||_;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[vye(m),!1,f-t,!1]}let p="["+(u?"^":"")+P6(n)+"]",h="["+(u?"":"^")+P6(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var Ws,bw=$e(()=>{Ws=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Tye,gx,L6,Aye,Iye,Rye,N6,Cye,_w,Oye,xye,Pye,Fye,yx,k6,M6,Dye,wu,bx=$e(()=>{D6();bw();Tye=new Set(["!","?","+","*","@"]),gx=a(r=>Tye.has(r),"isExtglobType"),L6=a(r=>gx(r.type),"isExtglobAST"),Aye=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Iye=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rye=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),N6=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cye="(?!(?:^|/)\\.\\.?(?:$|/))",_w="(?!\\.)",Oye=new Set(["[","."]),xye=new Set(["..","."]),Pye=new Set("().*{}+?[]^$\\!"),Fye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yx="[^/]",k6=yx+"*?",M6=yx+"+?",Dye=0,wu=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Dye;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let S=e.charAt(m++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){m===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(m===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=m,f=!1,b+=S;continue}if(!i.noext&&gx(S)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let A=new Mi(S,t);m=Mi.#o(e,A,m,i,s+1),t.push(A);continue}b+=S}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&gx(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let S=t&&t.#_(m)?0:1;p.push(g),g="";let _=new Mi(m,p);p.push(_),d=Mi.#o(e,_,d,i,s+S);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Iye)}#E(e,t=Aye){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Rye){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!N6.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=N6.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!L6(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,S]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||S,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&xye.has(this.#e[0]))){let g=Oye,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Cye:b?_w:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Ws(u),this.#r=!!this.#r,this.#n]}let n=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.#e=[l],u.type=null,u.#r=void 0,[l,Ws(this.toString()),!1,!1]}let o=!n||e||t||!_w?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?_w:"")+M6;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?_w:"")+k6+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,Ws(s),this.#r=!!this.#r,this.#n]}#m(){if(L6(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!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+=(Pye.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?M6:k6,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=F6(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=yx,t=!0;continue}s+=Fye(u)}return[s,Ws(e),!!t,o]}};Mi=wu});var zd,_x=$e(()=>{zd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var di,Lye,Nye,kye,Mye,$ye,jye,Bye,Uye,Vye,Gye,qye,Wye,zye,Kye,Hye,Yye,Xye,Qye,B6,U6,V6,$6,Jye,Rr,Zye,e0e,t0e,r0e,n0e,fs,i0e,G6,s0e,o0e,j6,a0e,Hi,Yc=$e(()=>{O6();x6();bx();_x();bw();bx();_x();bw();di=a((r,e,t={})=>(zm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Hi(e,t).match(r)),"minimatch"),Lye=/^\*+([^+@!?*[(]*)$/,Nye=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),kye=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Mye=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),$ye=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),jye=/^\*+\.\*+$/,Bye=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Uye=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Vye=/^\.\*+$/,Gye=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),qye=/^\*+$/,Wye=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),zye=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Kye=/^\?+([^+@!?*[(]*)?$/,Hye=a(([r,e=""])=>{let t=B6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Yye=a(([r,e=""])=>{let t=U6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Xye=a(([r,e=""])=>{let t=U6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Qye=a(([r,e=""])=>{let t=B6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),B6=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),U6=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),V6=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$6={win32:{sep:"\\"},posix:{sep:"/"}},Jye=V6==="win32"?$6.win32.sep:$6.posix.sep;di.sep=Jye;Rr=Symbol("globstar **");di.GLOBSTAR=Rr;Zye="[^/]",e0e=Zye+"*?",t0e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",r0e="(?:(?!(?:\\/|^)\\.).)*?",n0e=a((r,e={})=>t=>di(t,r,e),"filter");di.filter=n0e;fs=a((r,e={})=>Object.assign({},r,e),"ext"),i0e=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return di;let e=di;return Object.assign(a((n,i,s={})=>e(n,i,fs(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,fs(r,s))}static defaults(i){return e.defaults(fs(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,fs(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fs(r,s))}},unescape:a((n,i={})=>e.unescape(n,fs(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,fs(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,fs(r,i)),"filter"),defaults:a(n=>e.defaults(fs(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,fs(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,fs(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,fs(r,s)),"match"),sep:e.sep,GLOBSTAR:Rr})},"defaults");di.defaults=i0e;G6=a((r,e={})=>(zm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:C6(r,{max:e.braceExpandMax})),"braceExpand");di.braceExpand=G6;s0e=a((r,e={})=>new Hi(r,e).makeRe(),"makeRe");di.makeRe=s0e;o0e=a((r,e,t={})=>{let n=new Hi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");di.match=o0e;j6=/[?*]|[+@!]\(.*?\)|\[|\]/,a0e=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hi=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={}){zm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||V6,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!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 n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),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]==="?"||!j6.test(s[2]))&&!j6.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 n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[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 n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),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 n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!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(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&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,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!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,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Rr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(Rr,s),c=t.lastIndexOf(Rr),[l,u,f]=n?[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 _=e.slice(i,i+l.length);if(!this.#n(_,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let _=e.length-f.length;if(this.#n(e,f,n,_,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(_--,!this.#n(e,f,n,_,0)))return!1;d=f.length+1}}if(!u.length){let _=!!d;for(let A=i;A<e.length-d;A++){let E=String(e[A]);if(_=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||_}let p=[[[],0]],h=p[0],g=0,m=[0];for(let _ of u)_===Rr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(_),g++);let b=p.length-1,S=e.length-d;for(let _ of p)_[1]=S-(m[b--]+_[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,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===Rr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return G6(this.pattern,this.options)}parse(e){zm(e);let t=this.options;if(e==="**")return Rr;if(e==="")return"";let n,i=null;(n=e.match(qye))?i=t.dot?zye:Wye:(n=e.match(Lye))?i=(t.nocase?t.dot?$ye:Mye:t.dot?kye:Nye)(n[1]):(n=e.match(Kye))?i=(t.nocase?t.dot?Yye:Hye:t.dot?Xye:Qye)(n):(n=e.match(jye))?i=t.dot?Uye:Bye:(n=e.match(Vye))&&(i=Gye);let s=wu.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,n=t.noglobstar?e0e:t.dot?t0e:r0e,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?a0e(d):d===Rr?Rr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==Rr||g===Rr||(g===void 0?h!==void 0&&h!==Rr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==Rr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=Rr))});let f=u.filter(d=>d!==Rr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+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 n=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 of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return di.defaults(e).Minimatch}};di.AST=wu;di.Minimatch=Hi;di.escape=zd;di.unescape=Ws});var ww,Pn,Hm,c0e,Sx,W6,q6,l0e,u0e,Xc,z6,Sw,f0e,Xm,H6=$e(()=>{ww=require("node:diagnostics_channel"),Pn=(0,ww.channel)("lru-cache:metrics"),Hm=(0,ww.tracingChannel)("lru-cache"),c0e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sx=a(()=>Pn.hasSubscribers||Hm.hasSubscribers,"R"),W6=new Set,q6=typeof process=="object"&&process?process:{},l0e=a((r,e,t,n)=>{typeof q6.emitWarning=="function"?q6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),u0e=a(r=>!W6.has(r),"H"),Xc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),z6=a(r=>Xc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Sw:null:null,"j"),Sw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},f0e=class Ym{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=z6(e);if(!t)return[];Ym.#t=!0;let n=new Ym(e,t);return Ym.#t=!1,n}constructor(e,t){if(!Ym.#t)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]}},Xm=class K6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#O;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#H(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:S,memoMethod:_,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:O,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??c0e,t!==0&&!Xc(t))throw new TypeError("max option must be a nonnegative integer");let j=t?z6(t):Array;if(!j)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=_,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#R=!!S,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new j(t),this.#E=new j(t),this.#_=0,this.#S=0,this.#A=f0e.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#O=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#r!==0&&!Xc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Xc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Xc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Xc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let U="LRU_CACHE_UNBOUNDED";u0e(U)&&(W6.add(U),l0e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,K6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){let e=new Sw(this.#t),t=new Sw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#j=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#$(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#j=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new Sw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#B=(t,n,i,s)=>{if(!Xc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Xc(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.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#B=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#U(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())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 n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#K(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#$(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Pn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Pn.hasSubscribers&&Pn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#B(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#$(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#O&&!f&&this.#e?.(t,e,"add");else{this.#H(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#x(),this.#m&&(d||this.#j(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=Sx()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&m!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!b)return d(o.signal.reason,A);let E=h,w=this.#o[t];return(w===h||w===void 0&&_&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:S}=o.signal,_=S&&n.allowStaleOnFetchAbort,A=_||n.allowStaleOnFetchRejection,E=A||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#$(e,"fetch"):_||(this.#o[t]=w.__staleWhileFetching)),A)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let S=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(_=>u(_,!0),"f")))}),S&&S instanceof Promise?S.then(_=>m(_===void 0?void 0:_),b):S!==void 0&&m(S)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=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:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:S,signal:_}=t;if(S&&(S.op="fetch",S.key=e,b&&(S.forceRefresh=!0),S.cache=this),!this.#R)return S&&(S.fetch="get"),this.#K(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:S,signal:_},E=this.#l.get(e);if(E===void 0){S&&(S.fetch="miss");let w=this.#M(e,E,A,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",N&&(S.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return S&&(S.fetch="hit"),this.#H(E),i&&this.#C(E),S&&this.#D(S,E),w;let O=this.#M(e,E,A,m),P=O.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?O.__staleWhileFetching:O.__returned=O}}forceFetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#K(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#K(e,t);return n&&(i!==void 0&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n)),i}#K(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#$(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#H(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#H(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#$(e,"delete")}#$(e,t){Pn.hasSubscribers&&Pn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var Cw,Rx,Z6,Y6,d0e,p0e,h0e,Ka,Ha,Qc,Ew,Qm,vw,X6,Tw,Q6,zs,Kd,cn,Jm,Hd,ln,pi,un,wx,Aw,Kn,Cr,Ex,vx,J6,Tx,jo,Ax,Iw,Zm,Eu,Yi,eg,m0e,g0e,y0e,b0e,Rw,Ix,_0e,S0e,Jc,Cx=$e(()=>{Cw=require("node:events"),Rx=Q(require("node:stream"),1),Z6=require("node:string_decoder"),Y6=typeof process=="object"&&process?process:{stdout:null,stderr:null},d0e=a(r=>!!r&&typeof r=="object"&&(r instanceof Jc||r instanceof Rx.default||p0e(r)||h0e(r)),"isStream"),p0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Rx.default.Writable.prototype.pipe,"isReadable"),h0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Ka=Symbol("EOF"),Ha=Symbol("maybeEmitEnd"),Qc=Symbol("emittedEnd"),Ew=Symbol("emittingEnd"),Qm=Symbol("emittedError"),vw=Symbol("closed"),X6=Symbol("read"),Tw=Symbol("flush"),Q6=Symbol("flushChunk"),zs=Symbol("encoding"),Kd=Symbol("decoder"),cn=Symbol("flowing"),Jm=Symbol("paused"),Hd=Symbol("resume"),ln=Symbol("buffer"),pi=Symbol("pipes"),un=Symbol("bufferLength"),wx=Symbol("bufferPush"),Aw=Symbol("bufferShift"),Kn=Symbol("objectMode"),Cr=Symbol("destroyed"),Ex=Symbol("error"),vx=Symbol("emitData"),J6=Symbol("emitEnd"),Tx=Symbol("emitEnd2"),jo=Symbol("async"),Ax=Symbol("abort"),Iw=Symbol("aborted"),Zm=Symbol("signal"),Eu=Symbol("dataListeners"),Yi=Symbol("discarded"),eg=a(r=>Promise.resolve().then(r),"defer"),m0e=a(r=>r(),"nodefer"),g0e=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),y0e=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),b0e=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),Rw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Hd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ix=class extends Rw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>this.dest.emit("error",i),e.on("error",this.proxyErrors)}},_0e=a(r=>!!r.objectMode,"isObjectModeOptions"),S0e=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Jc=class extends Cw.EventEmitter{static{a(this,"Minipass")}[cn]=!1;[Jm]=!1;[pi]=[];[ln]=[];[Kn];[zs];[jo];[Kd];[Ka]=!1;[Qc]=!1;[Ew]=!1;[vw]=!1;[Qm]=null;[un]=0;[Cr]=!1;[Zm];[Iw]=!1;[Eu]=0;[Yi]=!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");_0e(t)?(this[Kn]=!0,this[zs]=null):S0e(t)?(this[zs]=t.encoding,this[Kn]=!1):(this[Kn]=!1,this[zs]=null),this[jo]=!!t.async,this[Kd]=this[zs]?new Z6.StringDecoder(this[zs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[ln],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[pi],"get")});let{signal:n}=t;n&&(this[Zm]=n,n.aborted?this[Ax]():n.addEventListener("abort",()=>this[Ax]()))}get bufferLength(){return this[un]}get encoding(){return this[zs]}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[Kn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[jo]}set async(e){this[jo]=this[jo]||!!e}[Ax](){this[Iw]=!0,this.emit("abort",this[Zm]?.reason),this.destroy(this[Zm]?.reason)}get aborted(){return this[Iw]}set aborted(e){}write(e,t,n){if(this[Iw])return!1;if(this[Ka])throw new Error("write after end");if(this[Cr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[jo]?eg:m0e;if(!this[Kn]&&!Buffer.isBuffer(e)){if(b0e(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(y0e(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Kn]?(this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):e.length?(typeof e=="string"&&!(t===this[zs]&&!this[Kd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zs]&&(e=this[Kd].write(e)),this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):(this[un]!==0&&this.emit("readable"),n&&i(n),this[cn])}read(e){if(this[Cr])return null;if(this[Yi]=!1,this[un]===0||e===0||e&&e>this[un])return this[Ha](),null;this[Kn]&&(e=null),this[ln].length>1&&!this[Kn]&&(this[ln]=[this[zs]?this[ln].join(""):Buffer.concat(this[ln],this[un])]);let t=this[X6](e||null,this[ln][0]);return this[Ha](),t}[X6](e,t){if(this[Kn])this[Aw]();else{let n=t;e===n.length||e===null?this[Aw]():typeof n=="string"?(this[ln][0]=n.slice(e),t=n.slice(0,e),this[un]-=e):(this[ln][0]=n.subarray(e),t=n.subarray(0,e),this[un]-=e)}return this.emit("data",t),!this[ln].length&&!this[Ka]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Ka]=!0,this.writable=!1,(this[cn]||!this[Jm])&&this[Ha](),this}[Hd](){this[Cr]||(!this[Eu]&&!this[pi].length&&(this[Yi]=!0),this[Jm]=!1,this[cn]=!0,this.emit("resume"),this[ln].length?this[Tw]():this[Ka]?this[Ha]():this.emit("drain"))}resume(){return this[Hd]()}pause(){this[cn]=!1,this[Jm]=!0,this[Yi]=!1}get destroyed(){return this[Cr]}get flowing(){return this[cn]}get paused(){return this[Jm]}[wx](e){this[Kn]?this[un]+=1:this[un]+=e.length,this[ln].push(e)}[Aw](){return this[Kn]?this[un]-=1:this[un]-=this[ln][0].length,this[ln].shift()}[Tw](e=!1){do;while(this[Q6](this[Aw]())&&this[ln].length);!e&&!this[ln].length&&!this[Ka]&&this.emit("drain")}[Q6](e){return this.emit("data",e),this[cn]}pipe(e,t){if(this[Cr])return e;this[Yi]=!1;let n=this[Qc];return t=t||{},e===Y6.stdout||e===Y6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[pi].push(t.proxyErrors?new Ix(this,e,t):new Rw(this,e,t)),this[jo]?eg(()=>this[Hd]()):this[Hd]()),e}unpipe(e){let t=this[pi].find(n=>n.dest===e);t&&(this[pi].length===1?(this[cn]&&this[Eu]===0&&(this[cn]=!1),this[pi]=[]):this[pi].splice(this[pi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Yi]=!1,this[Eu]++,!this[pi].length&&!this[cn]&&this[Hd]();else if(e==="readable"&&this[un]!==0)super.emit("readable");else if(g0e(e)&&this[Qc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Qm]){let i=t;this[jo]?eg(()=>i.call(this,this[Qm])):i.call(this,this[Qm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Eu]=this.listeners("data").length,this[Eu]===0&&!this[Yi]&&!this[pi].length&&(this[cn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Eu]=0,!this[Yi]&&!this[pi].length&&(this[cn]=!1)),t}get emittedEnd(){return this[Qc]}[Ha](){!this[Ew]&&!this[Qc]&&!this[Cr]&&this[ln].length===0&&this[Ka]&&(this[Ew]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[vw]&&this.emit("close"),this[Ew]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Cr&&this[Cr])return!1;if(e==="data")return!this[Kn]&&!n?!1:this[jo]?(eg(()=>this[vx](n)),!0):this[vx](n);if(e==="end")return this[J6]();if(e==="close"){if(this[vw]=!0,!this[Qc]&&!this[Cr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Qm]=n,super.emit(Ex,n);let s=!this[Zm]||this.listeners("error").length?super.emit("error",n):!1;return this[Ha](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ha](),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[Ha](),i}[vx](e){for(let n of this[pi])n.dest.write(e)===!1&&this.pause();let t=this[Yi]?!1:super.emit("data",e);return this[Ha](),t}[J6](){return this[Qc]?!1:(this[Qc]=!0,this.readable=!1,this[jo]?(eg(()=>this[Tx]()),!0):this[Tx]())}[Tx](){if(this[Kd]){let t=this[Kd].end();if(t){for(let n of this[pi])n.dest.write(t);this[Yi]||super.emit("data",t)}}for(let t of this[pi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Kn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Kn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Kn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[zs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Cr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Yi]=!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[Ka])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Cr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Cr,f),this.pause(),s({value:d,done:!!this[Ka]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Cr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Cr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Yi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Ex,t),this.off(Cr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=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(Ex,t),this.once(Cr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[Cr])return e?this.emit("error",e):this.emit(Cr),this;this[Cr]=!0,this[Yi]=!0,this[ln].length=0,this[un]=0;let t=this;return typeof t.close=="function"&&!this[vw]&&t.close(),e?this.emit("error",e):this.emit(Cr),this}static get isStream(){return d0e}}});var Yd,i8,Uo,w0e,Zc,E0e,rg,s8,o8,v0e,T0e,ps,a8,c8,Bo,l8,u8,vu,f8,ds,tg,Ox,e8,ng,Ks,Ow,Pw,t8,A0e,xx,r8,ig,n8,xw,Fw,Px,d8,Hn,Dw,Lw,Nw,Xd,Qd,sg,$Me,p8,h8=$e(()=>{H6();Yd=require("node:path"),i8=require("node:url"),Uo=require("fs"),w0e=Q(require("node:fs"),1),Zc=require("node:fs/promises");Cx();E0e=Uo.realpathSync.native,rg={lstatSync:Uo.lstatSync,readdir:Uo.readdir,readdirSync:Uo.readdirSync,readlinkSync:Uo.readlinkSync,realpathSync:E0e,promises:{lstat:Zc.lstat,readdir:Zc.readdir,readlink:Zc.readlink,realpath:Zc.realpath}},s8=a(r=>!r||r===rg||r===w0e?rg:{...rg,...r,promises:{...rg.promises,...r.promises||{}}},"fsFromOption"),o8=/^\\\\\?\\([a-z]:)\\?$/i,v0e=a(r=>r.replace(/\//g,"\\").replace(o8,"$1\\"),"uncToDrive"),T0e=/[\\\/]/,ps=0,a8=1,c8=2,Bo=4,l8=6,u8=8,vu=10,f8=12,ds=15,tg=~ds,Ox=16,e8=32,ng=64,Ks=128,Ow=256,Pw=512,t8=ng|Ks|Pw,A0e=1023,xx=a(r=>r.isFile()?u8:r.isDirectory()?Bo:r.isSymbolicLink()?vu:r.isCharacterDevice()?c8:r.isBlockDevice()?l8:r.isSocket()?f8:r.isFIFO()?a8:ps,"entToType"),r8=new Xm({max:2**12}),ig=a(r=>{let e=r8.get(r);if(e)return e;let t=r.normalize("NFKD");return r8.set(r,t),t},"normalize"),n8=new Xm({max:2**12}),xw=a(r=>{let e=n8.get(r);if(e)return e;let t=ig(r.toLowerCase());return n8.set(r,t),t},"normalizeNocase"),Fw=class extends Xm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},Px=class extends Xm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},d8=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#O;#x;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ps,n,i,s,o,c){this.name=e,this.#v=s?xw(e):ig(e),this.#s=t&A0e,this.nocase=s,this.roots=i,this.root=n||this,this.#O=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=s8(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#O}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 n of e)t=t.child(n);return t}children(){let e=this.#O.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#O.set(this,t),this.#s&=~Ox,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?xw(e):ig(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ps,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=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(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&ds)===ps}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.#s&ds)===u8}isDirectory(){return(this.#s&ds)===Bo}isCharacterDevice(){return(this.#s&ds)===c8}isBlockDevice(){return(this.#s&ds)===l8}isFIFO(){return(this.#s&ds)===a8}isSocket(){return(this.#s&ds)===f8}isSymbolicLink(){return(this.#s&vu)===vu}lstatCached(){return this.#s&e8?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#s&ds;return!(e!==ps&&e!==vu||this.#s&Ow||this.#s&Ks)}calledReaddir(){return!!(this.#s&Ox)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===xw(e):this.#v===ig(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}#j(e){this.#s|=Ox;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&tg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=Pw,this.#L()}#L(){if(this.#s&ng)return;let e=this.#s;(e&ds)===Bo&&(e&=tg),this.#s=e|ng,this.#q()}#B(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=Ow,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=tg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#U(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=xx(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&ds;return s!==Bo&&s!==vu&&s!==ps&&(i.#s|=ng),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?xw(e.name):ig(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&tg|xx(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:S,size:_,uid:A}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=S,this.#f=_,this.#i=A;let E=xx(e);this.#s=this.#s&tg|E|e8,E!==ps&&E!==Bo&&E!==vu&&(this.#s|=ng)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#B(s.code),n.provisional=0;else{for(let c of o)this.#U(c,n);this.#j(n)}this.#z(n.slice(0,n.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 n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#U(i,e);this.#j(e)}catch(i){this.#B(i.code),e.provisional=0}this.#V=void 0,n()}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 n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#U(n,e);this.#j(e)}catch(n){this.#B(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&t8)return!1;let e=ds&this.#s;return e===ps||e===Bo||e===vu}shouldWalk(e,t){return(this.#s&Bo)===Bo&&!(this.#s&t8)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[d8](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Dw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=T0e;constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Yd.win32.parse(e).root}getRoot(e){if(e=v0e(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Xd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(o8,"$1\\"),e===t}},Lw=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Nw=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=rg}={}){this.#e=s8(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,i8.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Fw,this.#r=new Fw,this.#n=new Px(s);let l=c.substring(this.rootPath.length).split(n);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.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}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 n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.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 n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.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 Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?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 Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let S of g)(!s||s(S))&&c.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(l,o)?u(_,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?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(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?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 n?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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Jc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,S,_=!1)=>{if(b)return c.emit("error",b);if(i&&!_){let A=[];for(let E of S)E.isSymbolicLink()&&A.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(A.length){Promise.all(A).then(()=>g(null,S,!0));return}}for(let A of S)A&&(!s||s(A))&&(c.write(n?A:A.fullpath())||(p=!0));f--;for(let A of S){let E=A.realpathCached()||A;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Jc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!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[d8](t)}},Xd=class extends Nw{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Yd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Yd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Dw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Qd=class extends Nw{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Yd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Lw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},sg=class extends Qd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},$Me=process.platform==="win32"?Dw:Lw,p8=process.platform==="win32"?Xd:process.platform==="darwin"?sg:Qd});var I0e,R0e,Jd,Fx=$e(()=>{Yc();I0e=a(r=>r.length>=1,"isPatternList"),R0e=a(r=>r.length>=1,"isGlobList"),Jd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!I0e(e))throw new TypeError("empty pattern list");if(!R0e(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,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===Rr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var C0e,Zd,Dx=$e(()=>{Yc();Fx();C0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Zd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=C0e}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,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 Hi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Jd(i,s,0,this.platform),c=new Hi(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(),n=`${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(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var Lx,Nx,kx,og,m8=$e(()=>{Yc();Lx=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Nx=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?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)])}},kx=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.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())}},og=class r{static{a(this,"Processor")}hasWalkedCache;matches=new Nx;subwalks=new kx;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Lx}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){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===Rr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Rr?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,n,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()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var O0e,kw,ag,cg,g8=$e(()=>{Cx();Dx();m8();O0e=a((r,e)=>typeof r=="string"?new Zd([r],e):Array.isArray(r)?new Zd(r,e):r,"makeIgnore"),kw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=O0e(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){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.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new og(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new og(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},ag=class extends kw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}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}},cg=class extends kw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Jc({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 y8,x0e,Hs,Mx=$e(()=>{Yc();y8=require("node:url");h8();Fx();g8();x0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hs=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,y8.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||x0e,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"?Xd:t.platform==="darwin"?sg:t.platform?Qd:p8;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Hi(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 Jd(l,f,0,this.platform)})}async walk(){return[...await new ag(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 ag(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 cg(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 cg(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 $x,jx=$e(()=>{Yc();$x=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Hi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Mw(r,e={}){return new Hs(r,e).streamSync()}function _8(r,e={}){return new Hs(r,e).stream()}function S8(r,e={}){return new Hs(r,e).walkSync()}async function b8(r,e={}){return new Hs(r,e).walk()}function $w(r,e={}){return new Hs(r,e).iterateSync()}function w8(r,e={}){return new Hs(r,e).iterate()}var P0e,F0e,D0e,L0e,N0e,ep,Bx=$e(()=>{Yc();Mx();jx();Yc();Mx();jx();Dx();a(Mw,"globStreamSync");a(_8,"globStream");a(S8,"globSync");a(b8,"glob_");a($w,"globIterateSync");a(w8,"globIterate");P0e=Mw,F0e=Object.assign(_8,{sync:Mw}),D0e=$w,L0e=Object.assign(w8,{sync:$w}),N0e=Object.assign(S8,{stream:Mw,iterate:$w}),ep=Object.assign(b8,{glob:b8,globSync:S8,sync:N0e,globStream:_8,stream:F0e,globStreamSync:Mw,streamSync:P0e,globIterate:w8,iterate:L0e,globIterateSync:$w,iterateSync:D0e,Glob:Hs,hasMagic:$x,escape:zd,unescape:Ws});ep.glob=ep});async function v8(r,e,t,n={}){let{excludeRelPath:i}=n,s=Tu.default.join(r,"**/*.md"),o=await ep(s,{nodir:!0,ignore:[Tu.default.join(r,".obsidian/**"),Tu.default.join(r,".trash/**"),Tu.default.join(r,"**/.obsidian/**"),Tu.default.join(r,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let l of o){let u=Tu.default.relative(r,l);if(i&&u===i)continue;c.filesScanned+=1;let f;try{f=await Ux.default.readFile(l,"utf-8")}catch{continue}let{updated:d,replacements:p}=k0e(f,e,t);p>0&&(c.filesModified+=1,c.replacements+=p,c.modifiedFiles.push(u),await Ux.default.writeFile(l,d,"utf-8"))}return c}function k0e(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=M0e(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function M0e(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=$0e(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function $0e(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var Ux,Tu,T8=$e(()=>{"use strict";Ux=Q($o()),Tu=Q(require("path"));Bx();a(v8,"rewriteInboundWikilinks");a(k0e,"rewriteContent");a(M0e,"rewriteProseSegment");a($0e,"replaceWikilinks")});var Or,pr,Ys,j0e,Yt,Xs=$e(()=>{"use strict";Or=Q($o()),pr=Q(require("path"));qm();Ys=Q(Pe());T8();j0e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Yt=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 Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Or.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Or.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Or.default.ensureDir(pr.default.dirname(n)),await Or.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Or.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Or.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Or.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=pr.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}getFrontmatterParseFailure(e){let t;try{t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8")}catch{return null}let n=(0,Ys.matchFrontmatterBlock)(t)?.body;if(n===void 0)return null;let i=/^[ \t]*(#.*)?\r?$/;if(!n.split(`
435
+ `)}return n}function Jge(r,e){let t=String(r),n=String(e);return t<n?-1:t>n?1:0}function Wd(r,e={}){let t={...Qge,...e},n=Jme(r,t.schema,{noRefs:t.noRefs,skipInvalid:t.skipInvalid});if(t.flowLevel>=0&&B5(n,(i,s)=>{if(!(s.depth<t.flowLevel))return(i.kind==="sequence"||i.kind==="mapping")&&(i.style=ki.FLOW),a6}),t.sortKeys){let i=t.sortKeys===!0?Jge:t.sortKeys;B5(n,s=>{s.kind==="mapping"&&s.items.sort((o,c)=>i(o.key.kind==="scalar"?o.key.value:"",c.key.kind==="scalar"?c.key.value:""))})}return t.transform(n),Xge(n,{...zO(t,Object.keys(ux)),schema:t.schema})}var St,ihe,she,ohe,ahe,che,lhe,uhe,fhe,dhe,phe,hhe,mhe,ghe,yhe,bhe,_he,She,q5,vhe,The,Rhe,Che,qO,Phe,Fhe,W5,Nhe,khe,jhe,Bhe,Uhe,WO,qhe,Whe,Hhe,Yhe,Xhe,Jhe,Zhe,eme,tme,rme,nme,hw,nx,Mke,Su,Gm,ame,$ke,jke,cme,Kc,Sr,qe,ki,Ki,ume,H5,Y5,bme,jd,_me,sx,vt,e6,Vd,KO,t6,lw,Ame,Ime,r6,HO,n6,Rme,Cme,Ome,ox,Hme,mu,Zme,a6,U5,age,cge,lge,cx,l6,gw,u6,f6,uge,QO,JO,fge,dge,d6,p6,h6,m6,g6,y6,pge,hge,mge,gge,yge,bge,_ge,Sge,wge,Ege,vge,Tge,Age,Ige,lx,jge,fw,ux,Qge,Bke,Uke,Vke,Gke,qke,Wke,zke,Kke,Hke,Yke,Xke,Qke,Jke,Zke,eMe,tMe,qm=$e(()=>{St=Symbol("NOT_RESOLVED");a(zn,"defineScalarTag");a(rx,"defineSequenceTag");a(dw,"defineMappingTag");ihe=zn("tag:yaml.org,2002:str",{resolve:a(r=>r,"resolve"),identify:a(r=>typeof r=="string","identify")}),she=["","~","null","Null","NULL"],ohe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>she.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),ahe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:a((r,e)=>r==="null"||e&&r===""?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),che=["","~","null","Null","NULL"],lhe=zn("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:a(r=>che.indexOf(r)!==-1?null:St,"resolve"),identify:a(r=>r===null,"identify"),represent:a(()=>"null","represent")}),uhe=["true","True","TRUE"],fhe=["false","False","FALSE"],dhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:a(r=>uhe.indexOf(r)!==-1?!0:fhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),phe=["true"],hhe=["false"],mhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:a(r=>phe.indexOf(r)!==-1?!0:hhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),ghe=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],yhe=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],bhe=zn("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:a(r=>ghe.indexOf(r)!==-1?!0:yhe.indexOf(r)!==-1?!1:St,"resolve"),identify:a(r=>Object.prototype.toString.call(r)==="[object Boolean]","identify"),represent:a(r=>r?"true":"false","represent")}),_he=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),She=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(whe,"parseYamlInteger$2");a(Ehe,"resolveYamlInteger$2");q5=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Ehe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),vhe=new RegExp("^-?(?:0|[1-9][0-9]*)$"),The=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");a(Ahe,"parseYamlInteger$1");a(Ihe,"resolveYamlInteger$1");Rhe=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Ihe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Che=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");a(Ohe,"parseYamlInteger");a(xhe,"resolveYamlInteger");qO=zn("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:xhe,identify:a(r=>Number.isInteger(r)&&!Object.is(r,-0)&&r.toString(10).indexOf("e")<0,"identify"),represent:a(r=>r.toString(10),"represent")}),Phe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Fhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Dhe,"resolveYamlFloat$2");a(Lhe,"representYamlFloat$2");W5=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Dhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Lhe}),Nhe=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),khe=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Mhe,"resolveYamlFloat$1");a($he,"representYamlFloat$1");jhe=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Mhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:$he}),Bhe=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),Uhe=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");a(Vhe,"resolveYamlFloat");a(Ghe,"representYamlFloat");WO=zn("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:Vhe,identify:a(r=>typeof r=="number"&&(!Number.isInteger(r)||Object.is(r,-0)||r.toString(10).indexOf("e")>=0),"identify"),represent:Ghe}),qhe=zn("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:a((r,e)=>r==="<<"||e&&r===""?"<<":St,"resolve"),identify:a(()=>!1,"identify")}),Whe=/^[A-Za-z0-9+/]*={0,2}$/;a(zhe,"resolveYamlBinary");a(Khe,"representYamlBinary");Hhe=zn("tag:yaml.org,2002:binary",{resolve:zhe,identify:a(r=>Object.prototype.toString.call(r)==="[object Uint8Array]","identify"),represent:Khe}),Yhe=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Xhe=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]))?))?$");a(C5,"makeUtcDate");a(Qhe,"resolveYamlTimestamp");Jhe=zn("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:Qhe,identify:a(r=>r instanceof Date,"identify"),represent:a(r=>r.toISOString(),"represent")}),Zhe=rx("tag:yaml.org,2002:seq",{create:a(()=>[],"create"),addItem:a((r,e)=>{r.push(e)},"addItem"),identify:Array.isArray});a(pw,"isPlainObject");a(zO,"pick");eme=rx("tag:yaml.org,2002:omap",{create:a(()=>({list:[],seen:new Set}),"create"),addItem:a((r,e)=>{let t;if(e instanceof Map){if(e.size!==1)return"cannot resolve an ordered map item";t=e.keys().next().value}else if(pw(e)){let n=Object.keys(e);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return r.seen.has(t)?"duplicate key in ordered map":(r.seen.add(t),r.list.push(e),"")},"addItem"),finalize:a(r=>r.list,"finalize"),identify:a(()=>!1,"identify")}),tme=rx("tag:yaml.org,2002:pairs",{create:a(()=>[],"create"),addItem:a((r,e)=>{if(e instanceof Map)return e.size!==1?"cannot resolve a pairs item":(r.push(e.entries().next().value),"");if(Object.prototype.toString.call(e)!=="[object Object]")return"cannot resolve a pairs item";let t=e,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(r.push([n[0],t[n[0]]]),"")},"addItem"),identify:a(()=>!1,"identify")}),rme=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{if(e!==null&&typeof e=="object")return"object-based map does not support complex keys";let n=String(e);return n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,""},"addPair"),has:a((r,e)=>e!==null&&typeof e=="object"?!1:Object.prototype.hasOwnProperty.call(r,String(e)),"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),nme=dw("tag:yaml.org,2002:set",{create:a(()=>new Set,"create"),identify:a(r=>r instanceof Set,"identify"),represent:a(r=>{let e=new Map;for(let t of r)e.set(t,null);return e},"represent"),addPair:a((r,e,t)=>t!==null?"cannot resolve a set item":(r.add(e),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a(()=>null,"get")});a(ime,"createTagDefinitionMap");a(sme,"createTagDefinitionListMap");a(ome,"compileTags");hw=class z5{static{a(this,"Schema")}tags;implicitScalarTags;implicitScalarByFirstChar;implicitScalarAnyFirstChar;defaultScalarTag;defaultSequenceTag;defaultMappingTag;exact;prefix;constructor(e){let t=ome(e),n=[],i=ime(),s=sme();for(let f of t){if(f.nodeKind==="scalar"&&f.implicit){if(f.matchByTagPrefix)throw new Error("Implicit scalar tags cannot match by tag prefix");n.push(f)}switch(f.nodeKind){case"scalar":f.matchByTagPrefix?s.scalar.push(f):i.scalar[f.tagName]=f;break;case"sequence":f.matchByTagPrefix?s.sequence.push(f):i.sequence[f.tagName]=f;break;case"mapping":f.matchByTagPrefix?s.mapping.push(f):i.mapping[f.tagName]=f;break}}let o=n.filter(f=>f.implicitFirstChars===null),c=new Set;for(let f of n)if(f.implicitFirstChars!==null)for(let d of f.implicitFirstChars)c.add(d);let l=new Map;for(let f of c)l.set(f,n.filter(d=>d.implicitFirstChars===null||d.implicitFirstChars.indexOf(f)!==-1));let u=i.scalar["tag:yaml.org,2002:str"];if(!u)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=l,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=u,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=s}lookupScalarTag(e){let t=this.exact.scalar[e];if(t)return t;for(let n of this.prefix.scalar)if(e.startsWith(n.tagName))return n}lookupSequenceTag(e){let t=this.exact.sequence[e];if(t)return t;for(let n of this.prefix.sequence)if(e.startsWith(n.tagName))return n}lookupMappingTag(e){let t=this.exact.mapping[e];if(t)return t;for(let n of this.prefix.mapping)if(e.startsWith(n.tagName))return n}resolveImplicitScalarTag(e){let t=this.implicitScalarByFirstChar.get(e.charAt(0))??this.implicitScalarAnyFirstChar;for(let i of t){let s=i.resolve(e,!1,i.tagName);if(s!==St)return{value:s,tag:i}}let n=this.defaultScalarTag;return{value:n.resolve(e,!1,n.tagName),tag:n}}withTags(...e){let t=[];for(let n of e)t=t.concat(n);return new z5([...this.tags,...t])}},nx=new hw([ihe,Zhe,rme]),Mke=new hw([...nx.tags,ahe,mhe,Rhe,jhe]),Su=new hw([...nx.tags,ohe,dhe,q5,W5]),Gm=new hw([...nx.tags,lhe,bhe,qO,WO,Jhe,qhe,Hhe,eme,tme,nme]),ame=Gm.withTags({...qO,resolve:a((r,e,t)=>{let n=qO.resolve(r,e,t);return n===St?q5.resolve(r,e,t):n},"resolve")},{...WO,resolve:a((r,e,t)=>{let n=WO.resolve(r,e,t);return n===St?W5.resolve(r,e,t):n},"resolve")}),$ke=dw("tag:yaml.org,2002:map",{create:a(()=>new Map,"create"),addPair:a((r,e,t)=>(r.set(e,t),""),"addPair"),has:a((r,e)=>r.has(e),"has"),keys:a(r=>r.keys(),"keys"),get:a((r,e)=>r.get(e),"get"),identify:a(r=>r instanceof Map||pw(r),"identify"),represent:a(r=>{if(r instanceof Map)return r;let e=new Map,t=r;for(let n of Object.keys(t))e.set(n,t[n]);return e},"represent")});a(O5,"normalizeKey");jke=dw("tag:yaml.org,2002:map",{create:a(()=>({}),"create"),identify:pw,represent:a(r=>{let e=new Map;for(let t of Object.keys(r))e.set(t,r[t]);return e},"represent"),addPair:a((r,e,t)=>{let n=O5(e);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(r,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[n]=t,"")},"addPair"),has:a((r,e)=>{let t=O5(e);return t!==null&&Object.prototype.hasOwnProperty.call(r,t)},"has"),keys:a(r=>Object.keys(r),"keys"),get:a((r,e)=>{let t=String(e);return Object.prototype.hasOwnProperty.call(r,t)?r[t]:null},"get")}),cme={maxLength:79,indent:1,linesBefore:3,linesAfter:2};a($O,"getLine");a(jO,"padStart");a(lme,"makeSnippet");a(x5,"formatError");Kc=class K5 extends Error{static{a(this,"YAMLException")}reason;mark;constructor(e,t){super(),this.name="YAMLException",this.reason=e,this.mark=t,this.message=x5(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(e){return`${this.name}: ${x5(this,e)}`}static throwAt(e,t,n,i=""){let s=0,o=0;for(let l=0;l<t;l++){let u=e.charCodeAt(l);u===10?(s++,o=l+1):u===13&&(s++,e.charCodeAt(l+1)===10&&l++,o=l+1)}let c={name:i,buffer:e,position:t,line:s,column:t-o};throw c.snippet=lme(c),new K5(n,c)}},Sr={DOCUMENT:1,SEQUENCE:2,MAPPING:3,SCALAR:4,ALIAS:5,POP:6},qe={PLAIN:1,SINGLE_QUOTED:2,DOUBLE_QUOTED:3,LITERAL_BLOCK:4,FOLDED_BLOCK:5},ki={BLOCK:1,FLOW:2},Ki={CLIP:1,STRIP:2,KEEP:3},ume=-1;a(P5,"simpleEscapeSequence");H5=new Array(256),Y5=new Array(256);for(let r=0;r<256;r++)H5[r]=P5(r)?1:0,Y5[r]=P5(r);a(fme,"charFromCodepoint");a(dme,"fromHexCode$1");a(pme,"escapedHexLen$1");a(cw,"skipFoldedBreaks");a(ix,"foldedBreaks");a(hme,"getPlainValue");a(mme,"getSingleQuotedValue");a(gme,"getDoubleQuotedValue");a(F5,"getBlockValue");a(yme,"getScalarValue");bme=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});a(BO,"tagPercentEncode");a(X5,"tagNameFull");a(Q5,"tagNameShort");jd=-1,_me="tag:yaml.org,2002:merge",sx={filename:"",schema:Su,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};a(Sme,"eventPosition$1");a(xn,"throwError$1");a(J5,"finalizeCollection");a(wme,"constructScalar");a(D5,"collectionTagName");a(Z5,"isMappingTag");a(L5,"chargeMergeWork");a(N5,"mergeKeys");a(Eme,"mergeSource");a(vme,"addMappingValue");a(UO,"addValue");a(VO,"storeAnchor");a(Tme,"constructFromEvents");vt=-1,e6=Object.prototype.hasOwnProperty,Vd=1,KO=2,t6=3,lw=4,Ame=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ime=/[,\[\]{}]/,r6=/^(?:!|!!|![0-9A-Za-z-]+!)$/,HO=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]])`,n6=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Rme=new RegExp(`^(?:${HO})*$`),Cme=new RegExp(`^(?:${n6})+$`),Ome=new RegExp(`^(?:!(?:${HO})*|${n6}(?:${HO})*)$`),ox={filename:"",maxDepth:100};a(xme,"addDocumentEvent");a(i6,"addSequenceEvent");a(YO,"addMappingEvent");a(k5,"insertFlowPairMappingEvent");a(qd,"addScalarEvent");a(Pme,"addAliasEvent");a(Bd,"addPopEvent");a(fi,"addEmptyScalarEvent");a(M5,"emptyProperties");a(Ud,"snapshotState");a(gu,"restoreState");a(Ue,"throwError");a(an,"isEol");a(bu,"isWhiteSpace");a(qs,"isWsOrEol");a(Wa,"isWsOrEolOrEnd");a(_u,"isFlowIndicator");a(Fme,"fromDecimalCode");a(Dme,"fromHexCode");a(Lme,"escapedHexLen");a(Nme,"isSimpleEscape");a(uw,"consumeLineBreak");a(Wn,"skipSeparationSpace");a(Gd,"testDocumentSeparator");a(s6,"skipByteOrderMark");a(ax,"testDocumentBoundary");a($5,"skipUntilLineEnd");a(o6,"checkPrintable");a(kme,"readTagProperty");a(Mme,"readAnchorProperty");a($me,"readAlias");a(XO,"readFlowScalarBreak");a(jme,"readSingleQuotedScalar");a(Bme,"readDoubleQuotedScalar");a(Ume,"readBlockScalar");a(Vme,"canStartPlainScalar");a(Gme,"readPlainScalar");a(Bm,"skipFlowSeparationSpace");a(qme,"readFlowCollection");a(j5,"readBlockSequence");a(GO,"readBlockMapping");a(yu,"parseNode");a(Wme,"readDirective");a(zme,"readDocument");a(Kme,"parseEvents");Hme={...ox,...sx};a(Yme,"loadDocuments");a(Hc,"load");mu=Symbol("INVALID");a(Xme,"buildRepresentTypes");a(Qme,"matchTag");a(Vm,"build");a(Jme,"jsToAst");Zme=Symbol("visit:break"),a6=Symbol("visit:skip");a(aw,"visitNode");a(B5,"visit");a(mw,"hasBit");U5={applyQuoteFlowKeysOption:ege,doubleQuoteForInvisibles:tge,doubleQuoteWhitespaceOnly:rge,applyForceQuotesOption:nge,tryLongOrMultilineAsBlock:ige,quoteInvalidPlain:sge,fallbackToDoubleQuoted:oge};a(c6,"_preferredQuotedStyle");a(ege,"applyQuoteFlowKeysOption");a(tge,"doubleQuoteForInvisibles");a(rge,"doubleQuoteWhitespaceOnly");a(nge,"applyForceQuotesOption");a(ige,"tryLongOrMultilineAsBlock");a(sge,"quoteInvalidPlain");a(oge,"fallbackToDoubleQuoted");a(Um,"setBit");age="[\\x09\\x0A\\x0D\\x20-\\x7E\\x85\\xA0-\\uD7FF\\uE000-\\uFFFD\\u{10000}-\\u{10FFFF}]",cge="[\\n\\r]",lge="\\uFEFF",cx="[ \\t]",l6=`(?:(?!(?:${cge}|${lge}))${age})`,gw=`(?:(?!${cx})${l6})`,u6="[\\x09\\x20-\\uD7FF\\uE000-\\uFFFF\\u{10000}-\\u{10FFFF}]",f6="[-?:,\\[\\]{}#&*!|>'\"%@`]",uge="[,\\[\\]{}]",QO=gw,JO=`(?:(?!${uge})${gw})`,fge=`(?:(?:(?!${f6})${gw})|[?:-](?=${QO}))`,dge=`(?:(?:(?!${f6})${gw})|[?:-](?=${JO}))`,d6=`(?:(?:(?![:#])${QO})|:(?=${QO}))#*`,p6=`(?:(?:(?![:#])${JO})|:(?=${JO}))#*`,h6=`(?:${cx}*${d6})*`,m6=`(?:${cx}*${p6})*`,g6=`${fge}#*${h6}`,y6=`${dge}#*${m6}`,pge=g6,hge=y6,mge=`\\n+${d6}${h6}`,gge=`\\n+${p6}${m6}`,yge=`${g6}(?:${mge})*`,bge=`${y6}(?:${gge})*`,_ge=new RegExp(`^(?:${yge})$`,"u"),Sge=new RegExp(`^(?:${bge})$`,"u"),wge=new RegExp(`^(?:${pge})$`,"u"),Ege=new RegExp(`^(?:${hge})$`,"u"),vge=new RegExp(`^(?:${u6})*$`,"u"),Tge=new RegExp(`^(?:${u6}|\\n)*$`,"u"),Age=new RegExp(`^(?:${l6}|\\n)*$`,"u"),Ige=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/,lx=/^(?:---|\.\.\.)(?=$|[ \t\n\r])/m;a(Rge,"canUsePlain");a(Cge,"canUseSingleQuoted");a(Oge,"canUseBlock");a(xge,"detectAllowedStyles");a(Pge,"renderScalar");a(Fge,"renderPlain");a(Dge,"renderSingleQuoted");a(Lge,"renderLiteralBlock");a(Nge,"renderFoldedBlock");a(kge,"renderDoubleQuoted");a(b6,"encodeFlowBreaks");a(_6,"indentString");a(Mge,"needIndentIndicator");a(S6,"blockHeader");a(w6,"dropEndingNewline");a(ZO,"isMoreIndented");a(V5,"foldLine");a($ge,"foldBlockScalar");jge=/["\\\x00-\x1F\x7F-\xA0\u2028\u2029\uD800-\uDFFF\uFEFF\uFFFE\uFFFF]/gu;a(Bge,"escapeCharacter");a(Uge,"escapeString");fw=10,ux={indent:2,seqNoIndent:!1,seqInlineFirst:!0,lineWidth:80,flowBracketPadding:!1,flowSkipCommaSpace:!1,flowSkipColonSpace:!1,quoteFlowKeys:!1,quoteStyle:"single",forceQuotes:!1,scalarStyleRules:Object.keys(U5).map(r=>Reflect.get(U5,r)),tagBeforeAnchor:!1};a(Vge,"nodeTagShort");a(Gge,"createPresenterState");a(ex,"generateNextLine");a(qge,"scalarLayout");a(Wge,"writeFlowSequence");a(G5,"writeBlockSequence");a(zge,"writeFlowMapping");a(Kge,"writeBlockMapping");a(tx,"cannotBeCompact");a(za,"writeNode");a(Hge,"rootStartsOwnLine");a(Yge,"writeDocumentDirectives");a(Xge,"present");Qge={...ux,schema:ame,skipInvalid:!1,noRefs:!1,flowLevel:-1,sortKeys:!1,transform:a(()=>{},"transform")};a(Jge,"defaultCompareFn");a(Wd,"dump");Bke=Sr.DOCUMENT,Uke=Sr.SEQUENCE,Vke=Sr.MAPPING,Gke=Sr.SCALAR,qke=Sr.ALIAS,Wke=Sr.POP,zke=qe.PLAIN,Kke=qe.SINGLE_QUOTED,Hke=qe.DOUBLE_QUOTED,Yke=qe.LITERAL_BLOCK,Xke=qe.FOLDED_BLOCK,Qke=ki.BLOCK,Jke=ki.FLOW,Zke=Ki.CLIP,eMe=Ki.STRIP,tMe=Ki.KEEP});var fx,E6,Zge,v6=$e(()=>{fx=a((r,e,t)=>{let n=r instanceof RegExp?E6(r,t):r,i=e instanceof RegExp?E6(e,t):e,s=n!==null&&i!=null&&Zge(n,i,t);return s&&{start:s[0],end:s[1],pre:t.slice(0,s[0]),body:t.slice(s[0]+n.length,s[1]),post:t.slice(s[1]+i.length)}},"balanced"),E6=a((r,e)=>{let t=e.match(r);return t?t[0]:null},"maybeMatch"),Zge=a((r,e,t)=>{let n,i,s,o,c,l=t.indexOf(r),u=t.indexOf(e,l+1),f=l;if(l>=0&&u>0){if(r===e)return[l,u];for(n=[],s=t.length;f>=0&&!c;){if(f===l)n.push(f),l=t.indexOf(r,f+1);else if(n.length===1){let d=n.pop();d!==void 0&&(c=[d,u])}else i=n.pop(),i!==void 0&&i<s&&(s=i,o=u),u=t.indexOf(e,f+1);f=l<u&&l>=0?l:u}n.length&&o!==void 0&&(c=[s,o])}return c},"range")});function dx(r){return isNaN(r)?r.charCodeAt(0):parseInt(r,10)}function hye(r){return r.replace(sye,T6).replace(oye,A6).replace(aye,mx).replace(cye,I6).replace(lye,R6)}function mye(r){return r.replace(eye,"\\").replace(tye,"{").replace(rye,"}").replace(nye,",").replace(iye,".")}function px(r,e){for(let t=0;t<e.length;t++)r.push(e[t])}function gye(r){let e=[],t="";for(;;){let n=fx("{","}",r);if(!n){let l=r.split(",");return l[0]=t+l[0],px(e,l),e}let{pre:i,body:s,post:o}=n,c=i.split(",");if(c[0]=t+c[0],c[c.length-1]+="{"+s+"}",!o.length)return px(e,c),e;t=c.pop(),px(e,c),r=o}}function C6(r,e={}){if(!r)return[];let{max:t=uye,maxLength:n=fye,maxDepth:i=dye,maxRewrites:s=pye}=e;return r.slice(0,2)==="{}"&&(r="\\{\\}"+r.slice(2)),hx(hye(r),t,n,i,0,s,!0).map(mye)}function yye(r){return"{"+r+"}"}function bye(r){return/^-?0\d/.test(r)}function _ye(r,e){return r<=e}function Sye(r,e){return r>=e}function Wm(r,e,t,n,i,s){let o=[],c=0;for(let l=0;l<r.length;l++)for(let u=0;u<t.length;u++){if(o.length>=n)return o;let f=r[l]+e+t[u];if(!(s&&!f)){if(c+f.length>i)return o;o.push(f),c+=f.length}}return o}function wye(r,e,t,n){let i=r.split(/\.\./),s=[];if(i[0]===void 0||i[1]===void 0)return s;let o=dx(i[0]),c=dx(i[1]),l=Math.max(i[0].length,i[1].length),u=i.length===3&&i[2]!==void 0?Math.max(Math.abs(dx(i[2])),1):1,f=_ye;c<o&&(u*=-1,f=Sye);let p=i.some(bye),h=0;for(let g=o;f(g,c)&&s.length<t;g+=u){let m;if(e)m=String.fromCharCode(g),m==="\\"&&(m="");else if(m=String(g),p){let b=l-m.length;if(b>0){let S=new Array(b+1).join("0");g<0?m="-"+S+m.slice(1):m=S+m}}if(h+m.length>n)break;s.push(m),h+=m.length}return s}function hx(r,e,t,n,i,s,o){if(i>n)return[r];let c=[""],l=0,u=!1,f=!0;for(;;){let d=fx("{","}",r);if(!d)return Wm(c,r,[""],e,t,u);let p=d.pre;if(/\$$/.test(p)){if(c=Wm(c,p+"{"+d.body+"}",[""],e,t,u&&!d.post.length),f=!1,!d.post.length)break;r=d.post;continue}let h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(d.body),g=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(d.body),m=h||g,b=d.body.indexOf(",")>=0;if(!m&&!b){if(l<s&&d.post.match(/,(?!,).*\}/)){l++,r=d.pre+"{"+d.body+mx+d.post,o=!0;continue}return Wm(c,p+"{"+d.body+"}"+d.post,[""],e,t,u)}f&&(u=o&&!m,f=!1);let S;if(m)S=wye(d.body,g,e,t);else{let _=gye(d.body);if(_.length===1&&_[0]!==void 0&&(_=hx(_[0],e,t,n,i+1,s,!1).map(yye),_.length===1)){if(c=Wm(c,p+_[0],[""],e,t,u&&!d.post.length),!d.post.length)break;r=d.post;continue}let A=u&&!d.post.length&&!p;for(let w=0;A&&w<c.length;w++)c[w]&&(A=!1);S=[];let E=0;e:for(let w=0;w<_.length;w++){let R=hx(_[w],e,t,n,i+1,s,!1);for(let O=0;O<R.length;O++){let P=R[O];if(!(A&&!P)){if(S.length>=e||E+P.length>t)break e;S.push(P),E+=P.length}}}}if(c=Wm(c,p,S,e,t,u&&!d.post.length),!d.post.length)break;r=d.post}return c}var T6,A6,mx,I6,R6,eye,tye,rye,nye,iye,sye,oye,aye,cye,lye,uye,fye,dye,pye,O6=$e(()=>{v6();T6="\0SLASH"+Math.random()+"\0",A6="\0OPEN"+Math.random()+"\0",mx="\0CLOSE"+Math.random()+"\0",I6="\0COMMA"+Math.random()+"\0",R6="\0PERIOD"+Math.random()+"\0",eye=new RegExp(T6,"g"),tye=new RegExp(A6,"g"),rye=new RegExp(mx,"g"),nye=new RegExp(I6,"g"),iye=new RegExp(R6,"g"),sye=/\\\\/g,oye=/\\{/g,aye=/\\}/g,cye=/\\,/g,lye=/\\\./g,uye=1e5,fye=4e6,dye=1e3,pye=1e3;a(dx,"numeric");a(hye,"escapeBraces");a(mye,"unescapeBraces");a(px,"pushAll");a(gye,"parseCommaParts");a(C6,"expand");a(yye,"embrace");a(bye,"isPadded");a(_ye,"lte");a(Sye,"gte");a(Wm,"combine");a(wye,"expandSequence");a(hx,"expand_")});var zm,x6=$e(()=>{zm=a(r=>{if(typeof r!="string")throw new TypeError("invalid pattern");if(r.length>65536)throw new TypeError("pattern is too long")},"assertValidPattern")});var Eye,Km,vye,P6,F6,D6=$e(()=>{Eye={"[: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]},Km=a(r=>r.replace(/[[\]\\-]/g,"\\$&"),"braceEscape"),vye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regexpEscape"),P6=a(r=>r.join(""),"rangesToString"),F6=a((r,e)=>{let t=e;if(r.charAt(t)!=="[")throw new Error("not in a brace expression");let n=[],i=[],s=t+1,o=!1,c=!1,l=!1,u=!1,f=t,d="";e:for(;s<r.length;){let m=r.charAt(s);if((m==="!"||m==="^")&&s===t+1){u=!0,s++;continue}if(m==="]"&&o&&!l){f=s+1;break}if(o=!0,m==="\\"&&!l){l=!0,s++;continue}if(m==="["&&!l){for(let[b,[S,_,A]]of Object.entries(Eye))if(r.startsWith(b,s)){if(d)return["$.",!1,r.length-t,!0];s+=b.length,A?i.push(S):n.push(S),c=c||_;continue e}}if(l=!1,d){m>d?n.push(Km(d)+"-"+Km(m)):m===d&&n.push(Km(m)),d="",s++;continue}if(r.startsWith("-]",s+1)){n.push(Km(m+"-")),s+=2;continue}if(r.startsWith("-",s+1)){d=m,s+=2;continue}n.push(Km(m)),s++}if(f<s)return["",!1,0,!1];if(!n.length&&!i.length)return["$.",!1,r.length-t,!0];if(i.length===0&&n.length===1&&/^\\?.$/.test(n[0])&&!u){let m=n[0].length===2?n[0].slice(-1):n[0];return[vye(m),!1,f-t,!1]}let p="["+(u?"^":"")+P6(n)+"]",h="["+(u?"":"^")+P6(i)+"]";return[n.length&&i.length?"("+p+"|"+h+")":n.length?p:h,c,f-t,!0]},"parseClass")});var Ws,bw=$e(()=>{Ws=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!0}={})=>t?e?r.replace(/\[([^/\\])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\])\]/g,"$1$2").replace(/\\([^/])/g,"$1"):e?r.replace(/\[([^/\\{}])\]/g,"$1"):r.replace(/((?!\\).|^)\[([^/\\{}])\]/g,"$1$2").replace(/\\([^/{}])/g,"$1"),"unescape")});var Mi,Tye,gx,L6,Aye,Iye,Rye,N6,Cye,_w,Oye,xye,Pye,Fye,yx,k6,M6,Dye,wu,bx=$e(()=>{D6();bw();Tye=new Set(["!","?","+","*","@"]),gx=a(r=>Tye.has(r),"isExtglobType"),L6=a(r=>gx(r.type),"isExtglobAST"),Aye=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),Iye=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),Rye=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),N6=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),Cye="(?!(?:^|/)\\.\\.?(?:$|/))",_w="(?!\\.)",Oye=new Set(["[","."]),xye=new Set(["..","."]),Pye=new Set("().*{}+?[]^$\\!"),Fye=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),yx="[^/]",k6=yx+"*?",M6=yx+"+?",Dye=0,wu=class{static{a(this,"AST")}type;#t;#r;#n=!1;#e=[];#i;#a;#p;#u=!1;#c;#f;#l=!1;id=++Dye;get depth(){return(this.#i?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#t.id,parent:this.#i?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(e,t,n={}){this.type=e,e&&(this.#r=!0),this.#i=t,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#p=this.#t===this?[]:this.#t.#p,e==="!"&&!this.#t.#u&&this.#p.push(this),this.#a=this.#i?this.#i.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#f!==void 0?this.#f:this.type?this.#f=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#f=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let e;for(;e=this.#p.pop();){if(e.type!=="!")continue;let t=e,n=t.#i;for(;n;){for(let i=t.#a+1;!n.type&&i<n.#e.length;i++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(n.#e[i])}t=n,n=t.#i}}return this}push(...e){for(let t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Mi&&t.#i===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){let e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#i?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(this.#a===0)return!0;let e=this.#i;for(let t=0;t<this.#a;t++){let n=e.#e[t];if(!(n instanceof Mi&&n.type==="!"))return!1}return!0}isEnd(){if(this.#t===this||this.#i?.type==="!")return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();let e=this.#i?this.#i.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let t=new Mi(this.type,e);for(let n of this.#e)t.copyIn(n);return t}static#o(e,t,n,i,s){let o=i.maxExtglobRecursion??2,c=!1,l=!1,u=-1,f=!1;if(t.type===null){let m=n,b="";for(;m<e.length;){let S=e.charAt(m++);if(c||S==="\\"){c=!c,b+=S;continue}if(l){m===u+1?(S==="^"||S==="!")&&(f=!0):S==="]"&&!(m===u+2&&f)&&(l=!1),b+=S;continue}else if(S==="["){l=!0,u=m,f=!1,b+=S;continue}if(!i.noext&&gx(S)&&e.charAt(m)==="("&&s<=o){t.push(b),b="";let A=new Mi(S,t);m=Mi.#o(e,A,m,i,s+1),t.push(A);continue}b+=S}return t.push(b),m}let d=n+1,p=new Mi(null,t),h=[],g="";for(;d<e.length;){let m=e.charAt(d++);if(c||m==="\\"){c=!c,g+=m;continue}if(l){d===u+1?(m==="^"||m==="!")&&(f=!0):m==="]"&&!(d===u+2&&f)&&(l=!1),g+=m;continue}else if(m==="["){l=!0,u=d,f=!1,g+=m;continue}if(!i.noext&&gx(m)&&e.charAt(d)==="("&&(s<=o||t&&t.#_(m))){let S=t&&t.#_(m)?0:1;p.push(g),g="";let _=new Mi(m,p);p.push(_),d=Mi.#o(e,_,d,i,s+S);continue}if(m==="|"){p.push(g),g="",h.push(p),p=new Mi(null,t);continue}if(m===")")return g===""&&t.#e.length===0&&(t.#l=!0),p.push(g),g="",t.push(...h,p),d;g+=m}return t.type=null,t.#r=void 0,t.#e=[e.substring(n-1)],d}#g(e){return this.#E(e,Iye)}#E(e,t=Aye){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#_(n.type,t)}#_(e,t=Rye){return!!t.get(this.type)?.includes(e)}#S(e,t){let n=e.#e[0],i=new Mi(null,n,this.options);i.#e.push(""),n.push(i),this.#A(e,t)}#A(e,t){let n=e.#e[0];this.#e.splice(t,1,...n.#e);for(let i of n.#e)typeof i=="object"&&(i.#i=this);this.#f=void 0}#y(e){return!!N6.get(this.type)?.has(e)}#v(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let t=e.#e[0];return!t||typeof t!="object"||t.type===null?!1:this.#y(t.type)}#T(e){let t=N6.get(this.type),n=e.#e[0],i=t?.get(n.type);if(!i)return!1;this.#e=n.#e;for(let s of this.#e)typeof s=="object"&&(s.#i=this);this.type=i,this.#f=void 0,this.#l=!1}static fromGlob(e,t={}){let n=new Mi(null,void 0,t);return Mi.#o(e,n,0,t,0),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[t,n,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#c.nocase&&!this.#c.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return n;let c=(this.#c.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,c),{_src:t,_glob:e})}get options(){return this.#c}toRegExpSource(e){let t=e??!!this.#c.dot;if(this.#t===this&&(this.#m(),this.#d()),!L6(this)){let l=this.isStart()&&this.isEnd()&&!this.#e.some(h=>typeof h!="string"),u=this.#e.map(h=>{let[g,m,b,S]=typeof h=="string"?Mi.#w(h,this.#r,l):h.toRegExpSource(e);return this.#r=this.#r||b,this.#n=this.#n||S,g}).join(""),f="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&xye.has(this.#e[0]))){let g=Oye,m=t&&g.has(u.charAt(0))||u.startsWith("\\.")&&g.has(u.charAt(2))||u.startsWith("\\.\\.")&&g.has(u.charAt(4)),b=!t&&!e&&g.has(u.charAt(0));f=m?Cye:b?_w:""}let d="";return this.isEnd()&&this.#t.#u&&this.#i?.type==="!"&&(d="(?:$|\\/)"),[f+u+d,Ws(u),this.#r=!!this.#r,this.#n]}let n=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.#e=[l],u.type=null,u.#r=void 0,[l,Ws(this.toString()),!1,!1]}let o=!n||e||t||!_w?"":this.#b(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!t?_w:"")+M6;else{let l=this.type==="!"?"))"+(this.isStart()&&!t&&!e?_w:"")+k6+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;c=i+s+l}return[c,Ws(s),this.#r=!!this.#r,this.#n]}#m(){if(L6(this)){let e=0,t=!1;do{t=!0;for(let n=0;n<this.#e.length;n++){let i=this.#e[n];typeof i=="object"&&(i.#m(),this.#E(i)?(t=!1,this.#A(i,n)):this.#g(i)?(t=!1,this.#S(i,n)):this.#v(i)&&(t=!1,this.#T(i)))}}while(!t&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#m();this.#f=void 0}#b(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");let[n,i,s,o]=t.toRegExpSource(e);return this.#n=this.#n||o,n}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#w(e,t,n=!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+=(Pye.has(u)?"\\":"")+u;continue}if(u==="*"){if(c)continue;c=!0,s+=n&&/^[*]+$/.test(e)?M6:k6,t=!0;continue}else c=!1;if(u==="\\"){l===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){let[f,d,p,h]=F6(e,l);if(p){s+=f,o=o||d,l+=p-1,t=t||h;continue}}if(u==="?"){s+=yx,t=!0;continue}s+=Fye(u)}return[s,Ws(e),!!t,o]}};Mi=wu});var zd,_x=$e(()=>{zd=a((r,{windowsPathsNoEscape:e=!1,magicalBraces:t=!1}={})=>t?e?r.replace(/[?*()[\]{}]/g,"[$&]"):r.replace(/[?*()[\]\\{}]/g,"\\$&"):e?r.replace(/[?*()[\]]/g,"[$&]"):r.replace(/[?*()[\]\\]/g,"\\$&"),"escape")});var di,Lye,Nye,kye,Mye,$ye,jye,Bye,Uye,Vye,Gye,qye,Wye,zye,Kye,Hye,Yye,Xye,Qye,B6,U6,V6,$6,Jye,Rr,Zye,e0e,t0e,r0e,n0e,fs,i0e,G6,s0e,o0e,j6,a0e,Hi,Yc=$e(()=>{O6();x6();bx();_x();bw();bx();_x();bw();di=a((r,e,t={})=>(zm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new Hi(e,t).match(r)),"minimatch"),Lye=/^\*+([^+@!?*[(]*)$/,Nye=a(r=>e=>!e.startsWith(".")&&e.endsWith(r),"starDotExtTest"),kye=a(r=>e=>e.endsWith(r),"starDotExtTestDot"),Mye=a(r=>(r=r.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(r)),"starDotExtTestNocase"),$ye=a(r=>(r=r.toLowerCase(),e=>e.toLowerCase().endsWith(r)),"starDotExtTestNocaseDot"),jye=/^\*+\.\*+$/,Bye=a(r=>!r.startsWith(".")&&r.includes("."),"starDotStarTest"),Uye=a(r=>r!=="."&&r!==".."&&r.includes("."),"starDotStarTestDot"),Vye=/^\.\*+$/,Gye=a(r=>r!=="."&&r!==".."&&r.startsWith("."),"dotStarTest"),qye=/^\*+$/,Wye=a(r=>r.length!==0&&!r.startsWith("."),"starTest"),zye=a(r=>r.length!==0&&r!=="."&&r!=="..","starTestDot"),Kye=/^\?+([^+@!?*[(]*)?$/,Hye=a(([r,e=""])=>{let t=B6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocase"),Yye=a(([r,e=""])=>{let t=U6([r]);return e?(e=e.toLowerCase(),n=>t(n)&&n.toLowerCase().endsWith(e)):t},"qmarksTestNocaseDot"),Xye=a(([r,e=""])=>{let t=U6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTestDot"),Qye=a(([r,e=""])=>{let t=B6([r]);return e?n=>t(n)&&n.endsWith(e):t},"qmarksTest"),B6=a(([r])=>{let e=r.length;return t=>t.length===e&&!t.startsWith(".")},"qmarksTestNoExt"),U6=a(([r])=>{let e=r.length;return t=>t.length===e&&t!=="."&&t!==".."},"qmarksTestNoExtDot"),V6=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$6={win32:{sep:"\\"},posix:{sep:"/"}},Jye=V6==="win32"?$6.win32.sep:$6.posix.sep;di.sep=Jye;Rr=Symbol("globstar **");di.GLOBSTAR=Rr;Zye="[^/]",e0e=Zye+"*?",t0e="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",r0e="(?:(?!(?:\\/|^)\\.).)*?",n0e=a((r,e={})=>t=>di(t,r,e),"filter");di.filter=n0e;fs=a((r,e={})=>Object.assign({},r,e),"ext"),i0e=a(r=>{if(!r||typeof r!="object"||!Object.keys(r).length)return di;let e=di;return Object.assign(a((n,i,s={})=>e(n,i,fs(r,s)),"m"),{Minimatch:class extends e.Minimatch{static{a(this,"Minimatch")}constructor(i,s={}){super(i,fs(r,s))}static defaults(i){return e.defaults(fs(r,i)).Minimatch}},AST:class extends e.AST{static{a(this,"AST")}constructor(i,s,o={}){super(i,s,fs(r,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,fs(r,s))}},unescape:a((n,i={})=>e.unescape(n,fs(r,i)),"unescape"),escape:a((n,i={})=>e.escape(n,fs(r,i)),"escape"),filter:a((n,i={})=>e.filter(n,fs(r,i)),"filter"),defaults:a(n=>e.defaults(fs(r,n)),"defaults"),makeRe:a((n,i={})=>e.makeRe(n,fs(r,i)),"makeRe"),braceExpand:a((n,i={})=>e.braceExpand(n,fs(r,i)),"braceExpand"),match:a((n,i,s={})=>e.match(n,i,fs(r,s)),"match"),sep:e.sep,GLOBSTAR:Rr})},"defaults");di.defaults=i0e;G6=a((r,e={})=>(zm(r),e.nobrace||!/\{(?:(?!\{).)*\}/.test(r)?[r]:C6(r,{max:e.braceExpandMax})),"braceExpand");di.braceExpand=G6;s0e=a((r,e={})=>new Hi(r,e).makeRe(),"makeRe");di.makeRe=s0e;o0e=a((r,e,t={})=>{let n=new Hi(e,t);return r=r.filter(i=>n.match(i)),n.options.nonull&&!r.length&&r.push(e),r},"match");di.match=o0e;j6=/[?*]|[+@!]\(.*?\)|\[|\]/,a0e=a(r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"regExpEscape"),Hi=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={}){zm(e),t=t||{},this.options=t,this.maxGlobstarRecursion=t.maxGlobstarRecursion??200,this.pattern=e,this.platform=t.platform||V6,this.isWindows=this.platform==="win32";let n="allowWindowsEscape";this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t[n]===!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 n=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(n),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]==="?"||!j6.test(s[2]))&&!j6.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 n of e)for(let i=0;i<n.length;i++)n[i]==="**"&&(n[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 n=-1;for(;(n=t.indexOf("**",n+1))!==-1;){let i=n;for(;t[i+1]==="**";)i++;i!==n&&t.splice(n,i-n)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((n,i)=>{let s=n[n.length-1];return i==="**"&&s==="**"?n:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(n.pop(),n):(n.push(i),n)},[]),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 n=0;for(;(n=e.indexOf("..",n+1))!==-1;){let i=e[n-1];i&&i!=="."&&i!==".."&&i!=="**"&&!(this.isWindows&&/^[a-z]:$/i.test(i))&&(t=!0,e.splice(n-1,2),n-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let n of e){let i=-1;for(;(i=n.indexOf("**",i+1))!==-1;){let o=i;for(;n[o+1]==="**";)o++;o>i&&n.splice(i+1,o-i);let c=n[i+1],l=n[i+2],u=n[i+3];if(c!==".."||!l||l==="."||l===".."||!u||u==="."||u==="..")continue;t=!0,n.splice(i,1);let f=n.slice(0);f[i]="**",e.push(f),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<n.length-1;o++){let c=n[o];o===1&&c===""&&n[0]===""||(c==="."||c==="")&&(t=!0,n.splice(o,1),o--)}n[0]==="."&&n.length===2&&(n[1]==="."||n[1]==="")&&(t=!0,n.pop())}let s=0;for(;(s=n.indexOf("..",s+1))!==-1;){let o=n[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;let l=s===1&&n[s+1]==="**"?["."]:[];n.splice(s-1,2,...l),n.length===0&&n.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let n=t+1;n<e.length;n++){let i=this.partsMatch(e[t],e[n],!this.preserveMultipleSlashes);if(i){e[t]=[],e[n]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,n=!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(n&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(n&&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,n=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,n++;n&&(this.pattern=e.slice(n)),this.negate=t}matchOne(e,t,n=!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,p=f?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[h,g]=[e[d],t[p]];h.toLowerCase()===g.toLowerCase()&&(t[p]=h,s=p,i=d)}}let{optimizationLevel:o=1}=this.options;return o>=2&&(e=this.levelTwoFileOptimize(e)),t.includes(Rr)?this.#t(e,t,n,i,s):this.#n(e,t,n,i,s)}#t(e,t,n,i,s){let o=t.indexOf(Rr,s),c=t.lastIndexOf(Rr),[l,u,f]=n?[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 _=e.slice(i,i+l.length);if(!this.#n(_,l,n,0,0))return!1;i+=l.length,s+=l.length}let d=0;if(f.length){if(f.length+i>e.length)return!1;let _=e.length-f.length;if(this.#n(e,f,n,_,0))d=f.length;else{if(e[e.length-1]!==""||i+f.length===e.length||(_--,!this.#n(e,f,n,_,0)))return!1;d=f.length+1}}if(!u.length){let _=!!d;for(let A=i;A<e.length-d;A++){let E=String(e[A]);if(_=!0,E==="."||E===".."||!this.options.dot&&E.startsWith("."))return!1}return n||_}let p=[[[],0]],h=p[0],g=0,m=[0];for(let _ of u)_===Rr?(m.push(g),h=[[],0],p.push(h)):(h[0].push(_),g++);let b=p.length-1,S=e.length-d;for(let _ of p)_[1]=S-(m[b--]+_[0].length);return!!this.#r(e,p,i,0,n,0,!!d)}#r(e,t,n,i,s,o,c){let l=t[i];if(!l){for(let d=n;d<e.length;d++){c=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return c}let[u,f]=l;for(;n<=f;){if(this.#n(e.slice(0,n+u.length),u,s,n,0)&&o<this.maxGlobstarRecursion){let h=this.#r(e,t,n+u.length,i+1,s,o+1,c);if(h!==!1)return h}let p=e[n];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;n++}return s||null}#n(e,t,n,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===Rr)return!1;let p;if(typeof f=="string"?(p=d===f,this.debug("string match",f,d,p)):(p=f.test(d),this.debug("pattern match",f,d,p)),!p)return!1}if(o===u&&c===l)return!0;if(o===u)return n;if(c===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return G6(this.pattern,this.options)}parse(e){zm(e);let t=this.options;if(e==="**")return Rr;if(e==="")return"";let n,i=null;(n=e.match(qye))?i=t.dot?zye:Wye:(n=e.match(Lye))?i=(t.nocase?t.dot?$ye:Mye:t.dot?kye:Nye)(n[1]):(n=e.match(Kye))?i=(t.nocase?t.dot?Yye:Hye:t.dot?Xye:Qye)(n):(n=e.match(jye))?i=t.dot?Uye:Bye:(n=e.match(Vye))&&(i=Gye);let s=wu.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,n=t.noglobstar?e0e:t.dot?t0e:r0e,i=new Set(t.nocase?["i"]:[]),s=e.map(l=>{let u=l.map(d=>{if(d instanceof RegExp)for(let p of d.flags.split(""))i.add(p);return typeof d=="string"?a0e(d):d===Rr?Rr:d._src});u.forEach((d,p)=>{let h=u[p+1],g=u[p-1];d!==Rr||g===Rr||(g===void 0?h!==void 0&&h!==Rr?u[p+1]="(?:\\/|"+n+"\\/)?"+h:u[p]=n:h===void 0?u[p-1]=g+"(?:\\/|\\/"+n+")?":h!==Rr&&(u[p-1]=g+"(?:\\/|\\/"+n+"\\/)"+h,u[p+1]=Rr))});let f=u.filter(d=>d!==Rr);if(this.partial&&f.length>=1){let d=[];for(let p=1;p<=f.length;p++)d.push(f.slice(0,p).join("/"));return"(?:"+d.join("|")+")"}return f.join("/")}).join("|"),[o,c]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+c+"$",this.partial&&(s="^(?:\\/|"+o+s.slice(1,-1)+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 n=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 of s){let l=i;if(n.matchBase&&c.length===1&&(l=[o]),this.matchOne(l,c,t))return n.flipNegate?!0:!this.negate}return n.flipNegate?!1:this.negate}static defaults(e){return di.defaults(e).Minimatch}};di.AST=wu;di.Minimatch=Hi;di.escape=zd;di.unescape=Ws});var ww,Pn,Hm,c0e,Sx,W6,q6,l0e,u0e,Xc,z6,Sw,f0e,Xm,H6=$e(()=>{ww=require("node:diagnostics_channel"),Pn=(0,ww.channel)("lru-cache:metrics"),Hm=(0,ww.tracingChannel)("lru-cache"),c0e=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Sx=a(()=>Pn.hasSubscribers||Hm.hasSubscribers,"R"),W6=new Set,q6=typeof process=="object"&&process?process:{},l0e=a((r,e,t,n)=>{typeof q6.emitWarning=="function"?q6.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)},"k"),u0e=a(r=>!W6.has(r),"H"),Xc=a(r=>!!r&&r===Math.floor(r)&&r>0&&isFinite(r),"T"),z6=a(r=>Xc(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Sw:null:null,"j"),Sw=class extends Array{static{a(this,"O")}constructor(r){super(r),this.fill(0)}},f0e=class Ym{static{a(this,"d")}heap;length;static#t=!1;static create(e){let t=z6(e);if(!t)return[];Ym.#t=!0;let n=new Ym(e,t);return Ym.#t=!1,n}constructor(e,t){if(!Ym.#t)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]}},Xm=class K6{static{a(this,"d")}#t;#r;#n;#e;#i;#a;#p;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#c;#f;#l;#d;#o;#g;#E;#_;#S;#A;#y;#v;#T;#m;#b;#w;#R;#s;#O;static unsafeExposeInternals(e){return{starts:e.#T,ttls:e.#m,autopurgeTimers:e.#b,sizes:e.#v,keyMap:e.#l,keyList:e.#d,valList:e.#o,next:e.#g,prev:e.#E,get head(){return e.#_},get tail(){return e.#S},free:e.#A,isBackgroundFetch:a(t=>e.#h(t),"isBackgroundFetch"),backgroundFetch:a((t,n,i,s)=>e.#M(t,n,i,s),"backgroundFetch"),moveToTail:a(t=>e.#H(t),"moveToTail"),indexes:a(t=>e.#P(t),"indexes"),rindexes:a(t=>e.#F(t),"rindexes"),isStale:a(t=>e.#I(t),"isStale")}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#f}get size(){return this.#c}get fetchMethod(){return this.#a}get memoMethod(){return this.#p}get dispose(){return this.#n}get onInsert(){return this.#e}get disposeAfter(){return this.#i}constructor(e){let{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:c,allowStale:l,dispose:u,onInsert:f,disposeAfter:d,noDisposeOnSet:p,noUpdateTTL:h,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:S,memoMethod:_,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:R,ignoreFetchAbort:O,backgroundFetchSize:P=1,perf:N}=e;if(this.backgroundFetchSize=P,N!==void 0&&typeof N?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=N??c0e,t!==0&&!Xc(t))throw new TypeError("max option must be a nonnegative integer");let j=t?z6(t):Array;if(!j)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=g,this.maxEntrySize=m||this.#r,this.sizeCalculation=b,this.sizeCalculation){if(!this.#r&&!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(_!==void 0&&typeof _!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#p=_,S!==void 0&&typeof S!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#a=S,this.#R=!!S,this.#l=new Map,this.#d=Array.from({length:t}).fill(void 0),this.#o=Array.from({length:t}).fill(void 0),this.#g=new j(t),this.#E=new j(t),this.#_=0,this.#S=0,this.#A=f0e.create(t),this.#c=0,this.#f=0,typeof u=="function"&&(this.#n=u),typeof f=="function"&&(this.#e=f),typeof d=="function"?(this.#i=d,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#w=!!this.#n,this.#O=!!this.#e,this.#s=!!this.#i,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!w,this.allowStaleOnFetchAbort=!!R,this.ignoreFetchAbort=!!O,this.maxEntrySize!==0){if(this.#r!==0&&!Xc(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!Xc(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#q()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!c,this.ttlResolution=Xc(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!Xc(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(this.#t===0&&this.ttl===0&&this.#r===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){let U="LRU_CACHE_UNBOUNDED";u0e(U)&&(W6.add(U),l0e("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,K6))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){let e=new Sw(this.#t),t=new Sw(this.#t);this.#m=e,this.#T=t;let n=this.ttlAutopurge?Array.from({length:this.#t}):void 0;this.#b=n,this.#j=(l,u,f=this.#u.now())=>{t[l]=u!==0?f:0,e[l]=u,i(l,u)},this.#C=l=>{t[l]=e[l]!==0?this.#u.now():0,i(l,e[l])};let i=this.ttlAutopurge?(l,u)=>{if(n?.[l]&&(clearTimeout(n[l]),n[l]=void 0),u&&u!==0&&n){let f=setTimeout(()=>{this.#I(l)?(this.#$(this.#d[l],"expire"),n[l]=void 0):i(l,c(l))},u+1);f.unref&&f.unref(),n[l]=f}}:()=>{};this.#D=(l,u)=>{if(e[u]){let f=e[u],d=t[u];if(!f||!d)return;l.ttl=f,l.start=d,l.now=s||o();let p=l.now-d;l.remainingTTL=f-p}};let s=0,o=a(()=>{let l=this.#u.now();if(this.ttlResolution>0){s=l;let u=setTimeout(()=>s=0,this.ttlResolution);u.unref&&u.unref()}return l},"o");this.getRemainingTTL=l=>{let u=this.#l.get(l);return u===void 0?0:c(u)};let c=a(l=>{let u=e[l],f=t[l];if(!u||!f)return 1/0;let d=(s||o())-f;return u-d},"l");this.#I=l=>{let u=t[l],f=e[l];return!!f&&!!u&&(s||o())-u>f}}#C=a(()=>{},"#R");#D=a(()=>{},"#v");#j=a(()=>{},"#H");#I=a(()=>!1,"#p");#q(){let e=new Sw(this.#t);this.#f=0,this.#v=e,this.#N=t=>{this.#f-=e[t],e[t]=0},this.#B=(t,n,i,s)=>{if(!Xc(i)){if(this.#h(n))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,t),!Xc(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.#L=(t,n,i)=>{if(e[t]=n,this.#r){let s=this.#r-e[t];for(;this.#f>s;)this.#G(!0)}this.#f+=e[t],i&&(i.entrySize=n,i.totalCalculatedSize=this.#f)}}#N=a(e=>{},"#x");#L=a((e,t,n)=>{},"#j");#B=a((e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0},"#N");*#P({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#S;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#_);)t=this.#E[t]}*#F({allowStale:e=this.allowStale}={}){if(this.#c)for(let t=this.#_;this.#U(t)&&((e||!this.#I(t))&&(yield t),t!==this.#S);)t=this.#g[t]}#U(e){return e!==void 0&&this.#l.get(this.#d[e])===e}*entries(){for(let e of this.#P())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*rentries(){for(let e of this.#F())this.#o[e]!==void 0&&this.#d[e]!==void 0&&!this.#h(this.#o[e])&&(yield[this.#d[e],this.#o[e]])}*keys(){for(let e of this.#P()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*rkeys(){for(let e of this.#F()){let t=this.#d[e];t!==void 0&&!this.#h(this.#o[e])&&(yield t)}}*values(){for(let e of this.#P())this.#o[e]!==void 0&&!this.#h(this.#o[e])&&(yield this.#o[e])}*rvalues(){for(let e of this.#F())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 n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#d[n],this))return this.#K(this.#d[n],t)}}forEach(e,t=this){for(let n of this.#P()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}rforEach(e,t=this){for(let n of this.#F()){let i=this.#o[n],s=this.#h(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(t,s,this.#d[n],this)}}purgeStale(){let e=!1;for(let t of this.#F({allowStale:!0}))this.#I(t)&&(this.#$(this.#d[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(t===void 0)return;let n=this.#o[t],i=this.#h(n)?n.__staleWhileFetching:n;if(i===void 0)return;let s={value:i};if(this.#m&&this.#T){let o=this.#m[t],c=this.#T[t];if(o&&c){let l=o-(this.#u.now()-c);s.ttl=l,s.start=Date.now()}}return this.#v&&(s.size=this.#v[t]),s}dump(){let e=[];for(let t of this.#P({allowStale:!0})){let n=this.#d[t],i=this.#o[t],s=this.#h(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#m&&this.#T){o.ttl=this.#m[t];let c=this.#u.now()-this.#T[t];o.start=Math.floor(Date.now()-c)}this.#v&&(o.size=this.#v[t]),e.unshift([n,o])}return e}load(e){this.clear();for(let[t,n]of e){if(n.start){let i=Date.now()-n.start;n.start=this.#u.now()-i}this.#k(t,n.value,n)}}set(e,t,n={}){let{status:i=Pn.hasSubscribers?{}:void 0}=n;n.status=i,i&&(i.op="set",i.key=e,t!==void 0&&(i.value=t),i.cache=this);let s=this.#k(e,t,n);return i&&Pn.hasSubscribers&&Pn.publish(i),s}#k(e,t,n,i){let{ttl:s=this.ttl,start:o,noDisposeOnSet:c=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=n,f=this.#h(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:d=this.noUpdateTTL}=n;u&&!f&&(u.value=t);let p=this.#B(e,t,n.size||0,l,u);if(this.maxEntrySize&&p>this.maxEntrySize)return this.#$(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let h=this.#c===0?void 0:this.#l.get(e);if(h===void 0)h=this.#c===0?this.#S:this.#A.length!==0?this.#A.pop():this.#c===this.#t?this.#G(!1):this.#c,this.#d[h]=e,this.#o[h]=t,this.#l.set(e,h),this.#g[this.#S]=h,this.#E[h]=this.#S,this.#S=h,this.#c++,this.#L(h,p,u),u&&(u.set="add"),d=!1,this.#O&&!f&&this.#e?.(t,e,"add");else{this.#H(h);let g=this.#o[h];if(t!==g){if(!c)if(this.#h(g)){g!==i&&g.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=g;m!==void 0&&m!==t&&(this.#w&&this.#n?.(m,e,"set"),this.#s&&this.#y?.push([m,e,"set"]))}else this.#w&&this.#n?.(g,e,"set"),this.#s&&this.#y?.push([g,e,"set"]);if(this.#N(h),this.#L(h,p,u),this.#o[h]=t,!f){let m=g&&this.#h(g)?g.__staleWhileFetching:g,b=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=b,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,b)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#m&&this.#x(),this.#m&&(d||this.#j(h,s,o),u&&this.#D(u,h)),!c&&this.#s&&this.#y){let g=this.#y,m;for(;m=g?.shift();)this.#i?.(...m)}return this}pop(){try{for(;this.#c;){let e=this.#o[this.#_];if(this.#G(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#s&&this.#y){let e=this.#y,t;for(;t=e?.shift();)this.#i?.(...t)}}}#G(e){let t=this.#_,n=this.#d[t],i=this.#o[t],s=this.#h(i);s&&i.__abortController.abort(new Error("evicted"));let o=s?i.__staleWhileFetching:i;return(this.#w||this.#s)&&o!==void 0&&(this.#w&&this.#n?.(o,n,"evict"),this.#s&&this.#y?.push([o,n,"evict"])),this.#N(t),this.#b?.[t]&&(clearTimeout(this.#b[t]),this.#b[t]=void 0),e&&(this.#d[t]=void 0,this.#o[t]=void 0,this.#A.push(t)),this.#c===1?(this.#_=this.#S=0,this.#A.length=0):this.#_=this.#g[t],this.#l.delete(n),this.#c--,t}has(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="has",n.key=e,n.cache=this);let i=this.#Y(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#Y(e,t={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,s=this.#l.get(e);if(s!==void 0){let o=this.#o[s];if(this.#h(o)&&o.__staleWhileFetching===void 0)return!1;if(this.#I(s))i&&(i.has="stale",this.#D(i,s));else return n&&this.#C(s),i&&(i.has="hit",this.#D(i,s)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){let{status:n=Sx()?{}:void 0}=t;n&&(n.op="peek",n.key=e,n.cache=this),t.status=n;let i=this.#W(e,t);return Pn.hasSubscribers&&Pn.publish(n),i}#W(e,t){let{status:n,allowStale:i=this.allowStale}=t,s=this.#l.get(e);if(s===void 0||!i&&this.#I(s)){n&&(n.peek=s===void 0?"miss":"stale");return}let o=this.#o[s],c=this.#h(o)?o.__staleWhileFetching:o;return n&&(c!==void 0?(n.peek="hit",n.value=c):n.peek="miss"),c}#M(e,t,n,i){let s=t===void 0?void 0:this.#o[t];if(this.#h(s))return s;let o=new AbortController,{signal:c}=n;c?.addEventListener("abort",()=>o.abort(c.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},u=a((m,b=!1)=>{let{aborted:S}=o.signal,_=n.ignoreFetchAbort&&m!==void 0,A=n.ignoreFetchAbort||!!(n.allowStaleOnFetchAbort&&m!==void 0);if(n.status&&(S&&!b?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,_&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),S&&!_&&!b)return d(o.signal.reason,A);let E=h,w=this.#o[t];return(w===h||w===void 0&&_&&b)&&(m===void 0?E.__staleWhileFetching!==void 0?this.#o[t]=E.__staleWhileFetching:this.#$(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.#k(e,m,l.options,E))),m},"r"),f=a(m=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=m),d(m,!1)),"c"),d=a((m,b)=>{let{aborted:S}=o.signal,_=S&&n.allowStaleOnFetchAbort,A=_||n.allowStaleOnFetchRejection,E=A||n.noDeleteOnFetchRejection,w=h;if(this.#o[t]===h&&(!E||!b&&w.__staleWhileFetching===void 0?this.#$(e,"fetch"):_||(this.#o[t]=w.__staleWhileFetching)),A)return n.status&&w.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),w.__staleWhileFetching;if(w.__returned===w)throw m},"m"),p=a((m,b)=>{let S=this.#a?.(e,s,l);o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(m(void 0),n.allowStaleOnFetchAbort&&(m=a(_=>u(_,!0),"f")))}),S&&S instanceof Promise?S.then(_=>m(_===void 0?void 0:_),b):S!==void 0&&m(S)},"_");n.status&&(n.status.fetchDispatched=!0);let h=new Promise(p).then(u,f),g=Object.assign(h,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#k(e,g,{...l.options,status:void 0}),t=this.#l.get(e)):this.#o[t]=g,g}#h(e){if(!this.#R)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#z(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#z(e,t={}){let{allowStale:n=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:p=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=!1,status:S,signal:_}=t;if(S&&(S.op="fetch",S.key=e,b&&(S.forceRefresh=!0),S.cache=this),!this.#R)return S&&(S.fetch="get"),this.#K(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:S});let A={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:c,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:g,ignoreFetchAbort:h,status:S,signal:_},E=this.#l.get(e);if(E===void 0){S&&(S.fetch="miss");let w=this.#M(e,E,A,m);return w.__returned=w}else{let w=this.#o[E];if(this.#h(w)){let N=n&&w.__staleWhileFetching!==void 0;return S&&(S.fetch="inflight",N&&(S.returnedStale=!0)),N?w.__staleWhileFetching:w.__returned=w}let R=this.#I(E);if(!b&&!R)return S&&(S.fetch="hit"),this.#H(E),i&&this.#C(E),S&&this.#D(S,E),w;let O=this.#M(e,E,A,m),P=O.__staleWhileFetching!==void 0&&n;return S&&(S.fetch=R?"stale":"refresh",P&&R&&(S.returnedStale=!0)),P?O.__staleWhileFetching:O.__returned=O}}forceFetch(e,t={}){let n=Hm.hasSubscribers,{status:i=Sx()?{}:void 0}=t;t.status=i,i&&t.context&&(i.context=t.context);let s=this.#V(e,t);return i&&n&&(i.trace=!0,Hm.tracePromise(()=>s,i).catch(()=>{})),s}async#V(e,t={}){let n=await this.#z(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="memo",n.key=e,t.context&&(n.context=t.context),n.cache=this);let i=this.#J(e,t);return n&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n),i}#J(e,t={}){let n=this.#p;if(!n)throw new Error("no memoMethod provided to constructor");let{context:i,status:s,forceRefresh:o,...c}=t;s&&o&&(s.forceRefresh=!0);let l=this.#K(e,c),u=o||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=n(e,l,{options:c,context:i});return s&&(s.value=f),this.#k(e,f,c),f}get(e,t={}){let{status:n=Pn.hasSubscribers?{}:void 0}=t;t.status=n,n&&(n.op="get",n.key=e,n.cache=this);let i=this.#K(e,t);return n&&(i!==void 0&&(n.value=i),Pn.hasSubscribers&&Pn.publish(n)),i}#K(e,t={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=t,c=this.#l.get(e);if(c===void 0){o&&(o.get="miss");return}let l=this.#o[c],u=this.#h(l);return o&&this.#D(o,c),this.#I(c)?u?(o&&(o.get="stale-fetching"),n&&l.__staleWhileFetching!==void 0?(o&&(o.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#$(e,"expire"),o&&(o.get="stale"),n?(o&&(o.returnedStale=!0),l):void 0):(o&&(o.get=u?"fetching":"hit"),this.#H(c),i&&this.#C(c),u?l.__staleWhileFetching:l)}#X(e,t){this.#E[t]=e,this.#g[e]=t}#H(e){e!==this.#S&&(e===this.#_?this.#_=this.#g[e]:this.#X(this.#E[e],this.#g[e]),this.#X(this.#S,e),this.#S=e)}delete(e){return this.#$(e,"delete")}#$(e,t){Pn.hasSubscribers&&Pn.publish({op:"delete",delete:t,key:e,cache:this});let n=!1;if(this.#c!==0){let i=this.#l.get(e);if(i!==void 0)if(this.#b?.[i]&&(clearTimeout(this.#b[i]),this.#b[i]=void 0),n=!0,this.#c===1)this.#Q(t);else{this.#N(i);let s=this.#o[i];if(this.#h(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#s)&&(this.#w&&this.#n?.(s,e,t),this.#s&&this.#y?.push([s,e,t])),this.#l.delete(e),this.#d[i]=void 0,this.#o[i]=void 0,i===this.#S)this.#S=this.#E[i];else if(i===this.#_)this.#_=this.#g[i];else{let o=this.#E[i];this.#g[o]=this.#g[i];let c=this.#g[i];this.#E[c]=this.#E[i]}this.#c--,this.#A.push(i)}}if(this.#s&&this.#y?.length){let i=this.#y,s;for(;s=i?.shift();)this.#i?.(...s)}return n}clear(){return this.#Q("delete")}#Q(e){for(let t of this.#F({allowStale:!0})){let n=this.#o[t];if(this.#h(n))n.__abortController.abort(new Error("deleted"));else{let i=this.#d[t];this.#w&&this.#n?.(n,i,e),this.#s&&this.#y?.push([n,i,e])}}if(this.#l.clear(),this.#o.fill(void 0),this.#d.fill(void 0),this.#m&&this.#T){this.#m.fill(0),this.#T.fill(0);for(let t of this.#b??[])t!==void 0&&clearTimeout(t);this.#b?.fill(void 0)}if(this.#v&&this.#v.fill(0),this.#_=0,this.#S=0,this.#A.length=0,this.#f=0,this.#c=0,this.#s&&this.#y){let t=this.#y,n;for(;n=t?.shift();)this.#i?.(...n)}}}});var Cw,Rx,Z6,Y6,d0e,p0e,h0e,Ka,Ha,Qc,Ew,Qm,vw,X6,Tw,Q6,zs,Kd,cn,Jm,Hd,ln,pi,un,wx,Aw,Kn,Cr,Ex,vx,J6,Tx,jo,Ax,Iw,Zm,Eu,Yi,eg,m0e,g0e,y0e,b0e,Rw,Ix,_0e,S0e,Jc,Cx=$e(()=>{Cw=require("node:events"),Rx=Q(require("node:stream"),1),Z6=require("node:string_decoder"),Y6=typeof process=="object"&&process?process:{stdout:null,stderr:null},d0e=a(r=>!!r&&typeof r=="object"&&(r instanceof Jc||r instanceof Rx.default||p0e(r)||h0e(r)),"isStream"),p0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.pipe=="function"&&r.pipe!==Rx.default.Writable.prototype.pipe,"isReadable"),h0e=a(r=>!!r&&typeof r=="object"&&r instanceof Cw.EventEmitter&&typeof r.write=="function"&&typeof r.end=="function","isWritable"),Ka=Symbol("EOF"),Ha=Symbol("maybeEmitEnd"),Qc=Symbol("emittedEnd"),Ew=Symbol("emittingEnd"),Qm=Symbol("emittedError"),vw=Symbol("closed"),X6=Symbol("read"),Tw=Symbol("flush"),Q6=Symbol("flushChunk"),zs=Symbol("encoding"),Kd=Symbol("decoder"),cn=Symbol("flowing"),Jm=Symbol("paused"),Hd=Symbol("resume"),ln=Symbol("buffer"),pi=Symbol("pipes"),un=Symbol("bufferLength"),wx=Symbol("bufferPush"),Aw=Symbol("bufferShift"),Kn=Symbol("objectMode"),Cr=Symbol("destroyed"),Ex=Symbol("error"),vx=Symbol("emitData"),J6=Symbol("emitEnd"),Tx=Symbol("emitEnd2"),jo=Symbol("async"),Ax=Symbol("abort"),Iw=Symbol("aborted"),Zm=Symbol("signal"),Eu=Symbol("dataListeners"),Yi=Symbol("discarded"),eg=a(r=>Promise.resolve().then(r),"defer"),m0e=a(r=>r(),"nodefer"),g0e=a(r=>r==="end"||r==="finish"||r==="prefinish","isEndish"),y0e=a(r=>r instanceof ArrayBuffer||!!r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,"isArrayBufferLike"),b0e=a(r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r),"isArrayBufferView"),Rw=class{static{a(this,"Pipe")}src;dest;opts;ondrain;constructor(e,t,n){this.src=e,this.dest=t,this.opts=n,this.ondrain=()=>e[Hd](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},Ix=class extends Rw{static{a(this,"PipeProxyErrors")}unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,n){super(e,t,n),this.proxyErrors=i=>this.dest.emit("error",i),e.on("error",this.proxyErrors)}},_0e=a(r=>!!r.objectMode,"isObjectModeOptions"),S0e=a(r=>!r.objectMode&&!!r.encoding&&r.encoding!=="buffer","isEncodingOptions"),Jc=class extends Cw.EventEmitter{static{a(this,"Minipass")}[cn]=!1;[Jm]=!1;[pi]=[];[ln]=[];[Kn];[zs];[jo];[Kd];[Ka]=!1;[Qc]=!1;[Ew]=!1;[vw]=!1;[Qm]=null;[un]=0;[Cr]=!1;[Zm];[Iw]=!1;[Eu]=0;[Yi]=!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");_0e(t)?(this[Kn]=!0,this[zs]=null):S0e(t)?(this[zs]=t.encoding,this[Kn]=!1):(this[Kn]=!1,this[zs]=null),this[jo]=!!t.async,this[Kd]=this[zs]?new Z6.StringDecoder(this[zs]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:a(()=>this[ln],"get")}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:a(()=>this[pi],"get")});let{signal:n}=t;n&&(this[Zm]=n,n.aborted?this[Ax]():n.addEventListener("abort",()=>this[Ax]()))}get bufferLength(){return this[un]}get encoding(){return this[zs]}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[Kn]}set objectMode(e){throw new Error("objectMode must be set at instantiation time")}get async(){return this[jo]}set async(e){this[jo]=this[jo]||!!e}[Ax](){this[Iw]=!0,this.emit("abort",this[Zm]?.reason),this.destroy(this[Zm]?.reason)}get aborted(){return this[Iw]}set aborted(e){}write(e,t,n){if(this[Iw])return!1;if(this[Ka])throw new Error("write after end");if(this[Cr])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(n=t,t="utf8"),t||(t="utf8");let i=this[jo]?eg:m0e;if(!this[Kn]&&!Buffer.isBuffer(e)){if(b0e(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(y0e(e))e=Buffer.from(e);else if(typeof e!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[Kn]?(this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):e.length?(typeof e=="string"&&!(t===this[zs]&&!this[Kd]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[zs]&&(e=this[Kd].write(e)),this[cn]&&this[un]!==0&&this[Tw](!0),this[cn]?this.emit("data",e):this[wx](e),this[un]!==0&&this.emit("readable"),n&&i(n),this[cn]):(this[un]!==0&&this.emit("readable"),n&&i(n),this[cn])}read(e){if(this[Cr])return null;if(this[Yi]=!1,this[un]===0||e===0||e&&e>this[un])return this[Ha](),null;this[Kn]&&(e=null),this[ln].length>1&&!this[Kn]&&(this[ln]=[this[zs]?this[ln].join(""):Buffer.concat(this[ln],this[un])]);let t=this[X6](e||null,this[ln][0]);return this[Ha](),t}[X6](e,t){if(this[Kn])this[Aw]();else{let n=t;e===n.length||e===null?this[Aw]():typeof n=="string"?(this[ln][0]=n.slice(e),t=n.slice(0,e),this[un]-=e):(this[ln][0]=n.subarray(e),t=n.subarray(0,e),this[un]-=e)}return this.emit("data",t),!this[ln].length&&!this[Ka]&&this.emit("drain"),t}end(e,t,n){return typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t="utf8"),e!==void 0&&this.write(e,t),n&&this.once("end",n),this[Ka]=!0,this.writable=!1,(this[cn]||!this[Jm])&&this[Ha](),this}[Hd](){this[Cr]||(!this[Eu]&&!this[pi].length&&(this[Yi]=!0),this[Jm]=!1,this[cn]=!0,this.emit("resume"),this[ln].length?this[Tw]():this[Ka]?this[Ha]():this.emit("drain"))}resume(){return this[Hd]()}pause(){this[cn]=!1,this[Jm]=!0,this[Yi]=!1}get destroyed(){return this[Cr]}get flowing(){return this[cn]}get paused(){return this[Jm]}[wx](e){this[Kn]?this[un]+=1:this[un]+=e.length,this[ln].push(e)}[Aw](){return this[Kn]?this[un]-=1:this[un]-=this[ln][0].length,this[ln].shift()}[Tw](e=!1){do;while(this[Q6](this[Aw]())&&this[ln].length);!e&&!this[ln].length&&!this[Ka]&&this.emit("drain")}[Q6](e){return this.emit("data",e),this[cn]}pipe(e,t){if(this[Cr])return e;this[Yi]=!1;let n=this[Qc];return t=t||{},e===Y6.stdout||e===Y6.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,n?t.end&&e.end():(this[pi].push(t.proxyErrors?new Ix(this,e,t):new Rw(this,e,t)),this[jo]?eg(()=>this[Hd]()):this[Hd]()),e}unpipe(e){let t=this[pi].find(n=>n.dest===e);t&&(this[pi].length===1?(this[cn]&&this[Eu]===0&&(this[cn]=!1),this[pi]=[]):this[pi].splice(this[pi].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let n=super.on(e,t);if(e==="data")this[Yi]=!1,this[Eu]++,!this[pi].length&&!this[cn]&&this[Hd]();else if(e==="readable"&&this[un]!==0)super.emit("readable");else if(g0e(e)&&this[Qc])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Qm]){let i=t;this[jo]?eg(()=>i.call(this,this[Qm])):i.call(this,this[Qm])}return n}removeListener(e,t){return this.off(e,t)}off(e,t){let n=super.off(e,t);return e==="data"&&(this[Eu]=this.listeners("data").length,this[Eu]===0&&!this[Yi]&&!this[pi].length&&(this[cn]=!1)),n}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[Eu]=0,!this[Yi]&&!this[pi].length&&(this[cn]=!1)),t}get emittedEnd(){return this[Qc]}[Ha](){!this[Ew]&&!this[Qc]&&!this[Cr]&&this[ln].length===0&&this[Ka]&&(this[Ew]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[vw]&&this.emit("close"),this[Ew]=!1)}emit(e,...t){let n=t[0];if(e!=="error"&&e!=="close"&&e!==Cr&&this[Cr])return!1;if(e==="data")return!this[Kn]&&!n?!1:this[jo]?(eg(()=>this[vx](n)),!0):this[vx](n);if(e==="end")return this[J6]();if(e==="close"){if(this[vw]=!0,!this[Qc]&&!this[Cr])return!1;let s=super.emit("close");return this.removeAllListeners("close"),s}else if(e==="error"){this[Qm]=n,super.emit(Ex,n);let s=!this[Zm]||this.listeners("error").length?super.emit("error",n):!1;return this[Ha](),s}else if(e==="resume"){let s=super.emit("resume");return this[Ha](),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[Ha](),i}[vx](e){for(let n of this[pi])n.dest.write(e)===!1&&this.pause();let t=this[Yi]?!1:super.emit("data",e);return this[Ha](),t}[J6](){return this[Qc]?!1:(this[Qc]=!0,this.readable=!1,this[jo]?(eg(()=>this[Tx]()),!0):this[Tx]())}[Tx](){if(this[Kd]){let t=this[Kd].end();if(t){for(let n of this[pi])n.dest.write(t);this[Yi]||super.emit("data",t)}}for(let t of this[pi])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[Kn]||(e.dataLength=0);let t=this.promise();return this.on("data",n=>{e.push(n),this[Kn]||(e.dataLength+=n.length)}),await t,e}async concat(){if(this[Kn])throw new Error("cannot concat in objectMode");let e=await this.collect();return this[zs]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(Cr,()=>t(new Error("stream destroyed"))),this.on("error",n=>t(n)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[Yi]=!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[Ka])return t();let s,o,c=a(d=>{this.off("data",l),this.off("end",u),this.off(Cr,f),t(),o(d)},"onerr"),l=a(d=>{this.off("error",c),this.off("end",u),this.off(Cr,f),this.pause(),s({value:d,done:!!this[Ka]})},"ondata"),u=a(()=>{this.off("error",c),this.off("data",l),this.off(Cr,f),t(),s({done:!0,value:void 0})},"onend"),f=a(()=>c(new Error("stream destroyed")),"ondestroy");return new Promise((d,p)=>{o=p,s=d,this.once(Cr,f),this.once("error",c),this.once("end",u),this.once("data",l)})},"next"),throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[Yi]=!1;let e=!1,t=a(()=>(this.pause(),this.off(Ex,t),this.off(Cr,t),this.off("end",t),e=!0,{done:!0,value:void 0}),"stop"),n=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(Ex,t),this.once(Cr,t),{next:n,throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[Cr])return e?this.emit("error",e):this.emit(Cr),this;this[Cr]=!0,this[Yi]=!0,this[ln].length=0,this[un]=0;let t=this;return typeof t.close=="function"&&!this[vw]&&t.close(),e?this.emit("error",e):this.emit(Cr),this}static get isStream(){return d0e}}});var Yd,i8,Uo,w0e,Zc,E0e,rg,s8,o8,v0e,T0e,ps,a8,c8,Bo,l8,u8,vu,f8,ds,tg,Ox,e8,ng,Ks,Ow,Pw,t8,A0e,xx,r8,ig,n8,xw,Fw,Px,d8,Hn,Dw,Lw,Nw,Xd,Qd,sg,jMe,p8,h8=$e(()=>{H6();Yd=require("node:path"),i8=require("node:url"),Uo=require("fs"),w0e=Q(require("node:fs"),1),Zc=require("node:fs/promises");Cx();E0e=Uo.realpathSync.native,rg={lstatSync:Uo.lstatSync,readdir:Uo.readdir,readdirSync:Uo.readdirSync,readlinkSync:Uo.readlinkSync,realpathSync:E0e,promises:{lstat:Zc.lstat,readdir:Zc.readdir,readlink:Zc.readlink,realpath:Zc.realpath}},s8=a(r=>!r||r===rg||r===w0e?rg:{...rg,...r,promises:{...rg.promises,...r.promises||{}}},"fsFromOption"),o8=/^\\\\\?\\([a-z]:)\\?$/i,v0e=a(r=>r.replace(/\//g,"\\").replace(o8,"$1\\"),"uncToDrive"),T0e=/[\\\/]/,ps=0,a8=1,c8=2,Bo=4,l8=6,u8=8,vu=10,f8=12,ds=15,tg=~ds,Ox=16,e8=32,ng=64,Ks=128,Ow=256,Pw=512,t8=ng|Ks|Pw,A0e=1023,xx=a(r=>r.isFile()?u8:r.isDirectory()?Bo:r.isSymbolicLink()?vu:r.isCharacterDevice()?c8:r.isBlockDevice()?l8:r.isSocket()?f8:r.isFIFO()?a8:ps,"entToType"),r8=new Xm({max:2**12}),ig=a(r=>{let e=r8.get(r);if(e)return e;let t=r.normalize("NFKD");return r8.set(r,t),t},"normalize"),n8=new Xm({max:2**12}),xw=a(r=>{let e=n8.get(r);if(e)return e;let t=ig(r.toLowerCase());return n8.set(r,t),t},"normalizeNocase"),Fw=class extends Xm{static{a(this,"ResolveCache")}constructor(){super({max:256})}},Px=class extends Xm{static{a(this,"ChildrenCache")}constructor(e=16*1024){super({maxSize:e,sizeCalculation:a(t=>t.length+1,"sizeCalculation")})}},d8=Symbol("PathScurry setAsCwd"),Hn=class{static{a(this,"PathBase")}name;root;roots;parent;nocase;isCWD=!1;#t;#r;get dev(){return this.#r}#n;get mode(){return this.#n}#e;get nlink(){return this.#e}#i;get uid(){return this.#i}#a;get gid(){return this.#a}#p;get rdev(){return this.#p}#u;get blksize(){return this.#u}#c;get ino(){return this.#c}#f;get size(){return this.#f}#l;get blocks(){return this.#l}#d;get atimeMs(){return this.#d}#o;get mtimeMs(){return this.#o}#g;get ctimeMs(){return this.#g}#E;get birthtimeMs(){return this.#E}#_;get atime(){return this.#_}#S;get mtime(){return this.#S}#A;get ctime(){return this.#A}#y;get birthtime(){return this.#y}#v;#T;#m;#b;#w;#R;#s;#O;#x;#C;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(e,t=ps,n,i,s,o,c){this.name=e,this.#v=s?xw(e):ig(e),this.#s=t&A0e,this.nocase=s,this.roots=i,this.root=n||this,this.#O=o,this.#m=c.fullpath,this.#w=c.relative,this.#R=c.relativePosix,this.parent=c.parent,this.parent?this.#t=this.parent.#t:this.#t=s8(c.fs)}depth(){return this.#T!==void 0?this.#T:this.parent?this.#T=this.parent.depth()+1:this.#T=0}childrenCache(){return this.#O}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 n of e)t=t.child(n);return t}children(){let e=this.#O.get(this);if(e)return e;let t=Object.assign([],{provisional:0});return this.#O.set(this,t),this.#s&=~Ox,t}child(e,t){if(e===""||e===".")return this;if(e==="..")return this.parent||this;let n=this.children(),i=this.nocase?xw(e):ig(e);for(let l of n)if(l.#v===i)return l;let s=this.parent?this.sep:"",o=this.#m?this.#m+s+e:void 0,c=this.newChild(e,ps,{...t,parent:this,fullpath:o});return this.canReaddir()||(c.#s|=Ks),n.push(c),c}relative(){if(this.isCWD)return"";if(this.#w!==void 0)return this.#w;let e=this.name,t=this.parent;if(!t)return this.#w=this.name;let n=t.relative();return n+(!n||!t.parent?"":this.sep)+e}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#R!==void 0)return this.#R;let e=this.name,t=this.parent;if(!t)return this.#R=this.fullpathPosix();let n=t.relativePosix();return n+(!n||!t.parent?"":"/")+e}fullpath(){if(this.#m!==void 0)return this.#m;let e=this.name,t=this.parent;if(!t)return this.#m=this.name;let i=t.fullpath()+(t.parent?this.sep:"")+e;return this.#m=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(),n=t+(!t||!e.parent?"":"/")+this.name;return this.#b=n}isUnknown(){return(this.#s&ds)===ps}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.#s&ds)===u8}isDirectory(){return(this.#s&ds)===Bo}isCharacterDevice(){return(this.#s&ds)===c8}isBlockDevice(){return(this.#s&ds)===l8}isFIFO(){return(this.#s&ds)===a8}isSocket(){return(this.#s&ds)===f8}isSymbolicLink(){return(this.#s&vu)===vu}lstatCached(){return this.#s&e8?this:void 0}readlinkCached(){return this.#x}realpathCached(){return this.#C}readdirCached(){let e=this.children();return e.slice(0,e.provisional)}canReadlink(){if(this.#x)return!0;if(!this.parent)return!1;let e=this.#s&ds;return!(e!==ps&&e!==vu||this.#s&Ow||this.#s&Ks)}calledReaddir(){return!!(this.#s&Ox)}isENOENT(){return!!(this.#s&Ks)}isNamed(e){return this.nocase?this.#v===xw(e):this.#v===ig(e)}async readlink(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=await this.#t.promises.readlink(this.fullpath()),n=(await this.parent.realpath())?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}readlinkSync(){let e=this.#x;if(e)return e;if(this.canReadlink()&&this.parent)try{let t=this.#t.readlinkSync(this.fullpath()),n=this.parent.realpathSync()?.resolve(t);if(n)return this.#x=n}catch(t){this.#F(t.code);return}}#j(e){this.#s|=Ox;for(let t=e.provisional;t<e.length;t++){let n=e[t];n&&n.#I()}}#I(){this.#s&Ks||(this.#s=(this.#s|Ks)&tg,this.#q())}#q(){let e=this.children();e.provisional=0;for(let t of e)t.#I()}#N(){this.#s|=Pw,this.#L()}#L(){if(this.#s&ng)return;let e=this.#s;(e&ds)===Bo&&(e&=tg),this.#s=e|ng,this.#q()}#B(e=""){e==="ENOTDIR"||e==="EPERM"?this.#L():e==="ENOENT"?this.#I():this.children().provisional=0}#P(e=""){e==="ENOTDIR"?this.parent.#L():e==="ENOENT"&&this.#I()}#F(e=""){let t=this.#s;t|=Ow,e==="ENOENT"&&(t|=Ks),(e==="EINVAL"||e==="UNKNOWN")&&(t&=tg),this.#s=t,e==="ENOTDIR"&&this.parent&&this.parent.#L()}#U(e,t){return this.#G(e,t)||this.#k(e,t)}#k(e,t){let n=xx(e),i=this.newChild(e.name,n,{parent:this}),s=i.#s&ds;return s!==Bo&&s!==vu&&s!==ps&&(i.#s|=ng),t.unshift(i),t.provisional++,i}#G(e,t){for(let n=t.provisional;n<t.length;n++){let i=t[n];if((this.nocase?xw(e.name):ig(e.name))===i.#v)return this.#Y(e,i,n,t)}}#Y(e,t,n,i){let s=t.name;return t.#s=t.#s&tg|xx(e),s!==e.name&&(t.name=e.name),n!==i.provisional&&(n===i.length-1?i.pop():i.splice(n,1),i.unshift(t)),i.provisional++,t}async lstat(){if((this.#s&Ks)===0)try{return this.#W(await this.#t.promises.lstat(this.fullpath())),this}catch(e){this.#P(e.code)}}lstatSync(){if((this.#s&Ks)===0)try{return this.#W(this.#t.lstatSync(this.fullpath())),this}catch(e){this.#P(e.code)}}#W(e){let{atime:t,atimeMs:n,birthtime:i,birthtimeMs:s,blksize:o,blocks:c,ctime:l,ctimeMs:u,dev:f,gid:d,ino:p,mode:h,mtime:g,mtimeMs:m,nlink:b,rdev:S,size:_,uid:A}=e;this.#_=t,this.#d=n,this.#y=i,this.#E=s,this.#u=o,this.#l=c,this.#A=l,this.#g=u,this.#r=f,this.#a=d,this.#c=p,this.#n=h,this.#S=g,this.#o=m,this.#e=b,this.#p=S,this.#f=_,this.#i=A;let E=xx(e);this.#s=this.#s&tg|E|e8,E!==ps&&E!==Bo&&E!==vu&&(this.#s|=ng)}#M=[];#h=!1;#z(e){this.#h=!1;let t=this.#M.slice();this.#M.length=0,t.forEach(n=>n(null,e))}readdirCB(e,t=!1){if(!this.canReaddir()){t?e(null,[]):queueMicrotask(()=>e(null,[]));return}let n=this.children();if(this.calledReaddir()){let s=n.slice(0,n.provisional);t?e(null,s):queueMicrotask(()=>e(null,s));return}if(this.#M.push(e),this.#h)return;this.#h=!0;let i=this.fullpath();this.#t.readdir(i,{withFileTypes:!0},(s,o)=>{if(s)this.#B(s.code),n.provisional=0;else{for(let c of o)this.#U(c,n);this.#j(n)}this.#z(n.slice(0,n.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 n=a(()=>{},"resolve");this.#V=new Promise(i=>n=i);try{for(let i of await this.#t.promises.readdir(t,{withFileTypes:!0}))this.#U(i,e);this.#j(e)}catch(i){this.#B(i.code),e.provisional=0}this.#V=void 0,n()}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 n of this.#t.readdirSync(t,{withFileTypes:!0}))this.#U(n,e);this.#j(e)}catch(n){this.#B(n.code),e.provisional=0}return e.slice(0,e.provisional)}canReaddir(){if(this.#s&t8)return!1;let e=ds&this.#s;return e===ps||e===Bo||e===vu}shouldWalk(e,t){return(this.#s&Bo)===Bo&&!(this.#s&t8)&&!e.has(this)&&(!t||t(this))}async realpath(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=await this.#t.promises.realpath(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}realpathSync(){if(this.#C)return this.#C;if(!((Pw|Ow|Ks)&this.#s))try{let e=this.#t.realpathSync(this.fullpath());return this.#C=this.resolve(e)}catch{this.#N()}}[d8](e){if(e===this)return;e.isCWD=!1,this.isCWD=!0;let t=new Set([]),n=[],i=this;for(;i&&i.parent;)t.add(i),i.#w=n.join(this.sep),i.#R=n.join("/"),i=i.parent,n.push("..");for(i=e;i&&i.parent&&!t.has(i);)i.#w=void 0,i.#R=void 0,i=i.parent}},Dw=class r extends Hn{static{a(this,"PathWin32")}sep="\\";splitSep=T0e;constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}getRootString(e){return Yd.win32.parse(e).root}getRoot(e){if(e=v0e(e.toUpperCase()),e===this.root.name)return this.root;for(let[t,n]of Object.entries(this.roots))if(this.sameRoot(e,t))return this.roots[e]=n;return this.roots[e]=new Xd(e,this).root}sameRoot(e,t=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(o8,"$1\\"),e===t}},Lw=class r extends Hn{static{a(this,"PathPosix")}splitSep="/";sep="/";constructor(e,t=ps,n,i,s,o,c){super(e,t,n,i,s,o,c)}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,t=ps,n={}){return new r(e,t,this.root,this.roots,this.nocase,this.childrenCache(),n)}},Nw=class{static{a(this,"PathScurryBase")}root;rootPath;roots;cwd;#t;#r;#n;nocase;#e;constructor(e=process.cwd(),t,n,{nocase:i,childrenCacheSize:s=16*1024,fs:o=rg}={}){this.#e=s8(o),(e instanceof URL||e.startsWith("file://"))&&(e=(0,i8.fileURLToPath)(e));let c=t.resolve(e);this.roots=Object.create(null),this.rootPath=this.parseRootPath(c),this.#t=new Fw,this.#r=new Fw,this.#n=new Px(s);let l=c.substring(this.rootPath.length).split(n);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.#e),this.roots[this.rootPath]=this.root;let u=this.root,f=l.length-1,d=t.sep,p=this.rootPath,h=!1;for(let g of l){let m=f--;u=u.child(g,{relative:new Array(m).fill("..").join(d),relativePosix:new Array(m).fill("..").join("/"),fullpath:p+=(h?"":d)+g}),h=!0}this.cwd=u}depth(e=this.cwd){return typeof e=="string"&&(e=this.cwd.resolve(e)),e.depth()}childrenCache(){return this.#n}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 n=this.#t.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpath();return this.#t.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 n=this.#r.get(t);if(n!==void 0)return n;let i=this.cwd.resolve(t).fullpathPosix();return this.#r.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 Hn||(t=e,e=this.cwd);let{withFileTypes:n}=t;if(e.canReaddir()){let i=await e.readdir();return n?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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0}=t;return e.canReaddir()?n?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 Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.readlink();return t?n:n?.fullpath()}readlinkSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.readlinkSync();return t?n:n?.fullpath()}async realpath(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=await e.realpath();return t?n:n?.fullpath()}realpathSync(e=this.cwd,{withFileTypes:t}={withFileTypes:!1}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e.withFileTypes,e=this.cwd);let n=e.realpathSync();return t?n:n?.fullpath()}async walk(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?e:e.fullpath());let l=new Set,u=a((d,p)=>{l.add(d),d.readdirCB((h,g)=>{if(h)return p(h);let m=g.length;if(!m)return p();let b=a(()=>{--m===0&&p()},"next");for(let S of g)(!s||s(S))&&c.push(n?S:S.fullpath()),i&&S.isSymbolicLink()?S.realpath().then(_=>_?.isUnknown()?_.lstat():_).then(_=>_?.shouldWalk(l,o)?u(_,b):b()):S.shouldWalk(l,o)?u(S,b):b()},!0)},"walk"),f=e;return new Promise((d,p)=>{u(f,h=>{if(h)return p(h);d(c)})})}walkSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=[];(!s||s(e))&&c.push(n?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(n?d:d.fullpath());let p=d;if(d.isSymbolicLink()){if(!(i&&(p=d.realpathSync())))continue;p.isUnknown()&&p.lstatSync()}p.shouldWalk(l,o)&&l.add(p)}}return c}[Symbol.asyncIterator](){return this.iterate()}iterate(e=this.cwd,t={}){return typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t;(!s||s(e))&&(yield n?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 n?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 Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Jc({objectMode:!0});(!s||s(e))&&c.write(n?e:e.fullpath());let l=new Set,u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=a((b,S,_=!1)=>{if(b)return c.emit("error",b);if(i&&!_){let A=[];for(let E of S)E.isSymbolicLink()&&A.push(E.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(A.length){Promise.all(A).then(()=>g(null,S,!0));return}}for(let A of S)A&&(!s||s(A))&&(c.write(n?A:A.fullpath())||(p=!0));f--;for(let A of S){let E=A.realpathCached()||A;E.shouldWalk(l,o)&&u.push(E)}p&&!c.flowing?c.once("drain",d):m||d()},"onReaddir"),m=!0;h.readdirCB(g,!0),m=!1}},"process");return d(),c}streamSync(e=this.cwd,t={}){typeof e=="string"?e=this.cwd.resolve(e):e instanceof Hn||(t=e,e=this.cwd);let{withFileTypes:n=!0,follow:i=!1,filter:s,walkFilter:o}=t,c=new Jc({objectMode:!0}),l=new Set;(!s||s(e))&&c.write(n?e:e.fullpath());let u=[e],f=0,d=a(()=>{let p=!1;for(;!p;){let h=u.shift();if(!h){f===0&&c.end();return}f++,l.add(h);let g=h.readdirSync();for(let m of g)(!s||s(m))&&(c.write(n?m:m.fullpath())||(p=!0));f--;for(let m of g){let b=m;if(m.isSymbolicLink()){if(!(i&&(b=m.realpathSync())))continue;b.isUnknown()&&b.lstatSync()}b.shouldWalk(l,o)&&u.push(b)}}p&&!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[d8](t)}},Xd=class extends Nw{static{a(this,"PathScurryWin32")}sep="\\";constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,Yd.win32,"\\",{...t,nocase:n}),this.nocase=n;for(let i=this.cwd;i;i=i.parent)i.nocase=this.nocase}parseRootPath(e){return Yd.win32.parse(e).root.toUpperCase()}newRoot(e){return new Dw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")||e.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(e)}},Qd=class extends Nw{static{a(this,"PathScurryPosix")}sep="/";constructor(e=process.cwd(),t={}){let{nocase:n=!1}=t;super(e,Yd.posix,"/",{...t,nocase:n}),this.nocase=n}parseRootPath(e){return"/"}newRoot(e){return new Lw(this.rootPath,Bo,void 0,this.roots,this.nocase,this.childrenCache(),{fs:e})}isAbsolute(e){return e.startsWith("/")}},sg=class extends Qd{static{a(this,"PathScurryDarwin")}constructor(e=process.cwd(),t={}){let{nocase:n=!0}=t;super(e,{...t,nocase:n})}},jMe=process.platform==="win32"?Dw:Lw,p8=process.platform==="win32"?Xd:process.platform==="darwin"?sg:Qd});var I0e,R0e,Jd,Fx=$e(()=>{Yc();I0e=a(r=>r.length>=1,"isPatternList"),R0e=a(r=>r.length>=1,"isGlobList"),Jd=class r{static{a(this,"Pattern")}#t;#r;#n;length;#e;#i;#a;#p;#u;#c;#f=!0;constructor(e,t,n,i){if(!I0e(e))throw new TypeError("empty pattern list");if(!R0e(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,n<0||n>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#r=t,this.#n=n,this.#e=i,this.#n===0){if(this.isUNC()){let[s,o,c,l,...u]=this.#t,[f,d,p,h,...g]=this.#r;u[0]===""&&(u.shift(),g.shift());let m=[s,o,c,l,""].join("/"),b=[f,d,p,h,""].join("/");this.#t=[m,...u],this.#r=[b,...g],this.length=this.#t.length}else if(this.isDrive()||this.isAbsolute()){let[s,...o]=this.#t,[c,...l]=this.#r;o[0]===""&&(o.shift(),l.shift());let u=s+"/",f=c+"/";this.#t=[u,...o],this.#r=[f,...l],this.length=this.#t.length}}}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===Rr}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#a=this.#a||(this.#n===0?this.isAbsolute()?this.#r[0]+this.#r.slice(1).join("/"):this.#r.join("/"):this.#r.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#i!==void 0?this.#i:this.hasMore()?(this.#i=new r(this.#t,this.#r,this.#n+1,this.#e),this.#i.#c=this.#c,this.#i.#u=this.#u,this.#i.#p=this.#p,this.#i):this.#i=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#e==="win32"&&this.#n===0&&e[0]===""&&e[1]===""&&typeof e[2]=="string"&&!!e[2]&&typeof e[3]=="string"&&!!e[3]}isDrive(){let e=this.#t;return this.#p!==void 0?this.#p:this.#p=this.#e==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#c!==void 0?this.#c:this.#c=e[0]===""&&e.length>1||this.isDrive()||this.isUNC()}root(){let e=this.#t[0];return typeof e=="string"&&this.isAbsolute()&&this.#n===0?e:""}checkFollowGlobstar(){return!(this.#n===0||!this.isGlobstar()||!this.#f)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#f?!1:(this.#f=!1,!0)}}});var C0e,Zd,Dx=$e(()=>{Yc();Fx();C0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Zd=class{static{a(this,"Ignore")}relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(e,{nobrace:t,nocase:n,noext:i,noglobstar:s,platform:o=C0e}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=o,this.mmopts={dot:!0,nobrace:t,nocase:n,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 Hi(e,this.mmopts);for(let n=0;n<t.set.length;n++){let i=t.set[n],s=t.globParts[n];if(!i||!s)throw new Error("invalid pattern object");for(;i[0]==="."&&s[0]===".";)i.shift(),s.shift();let o=new Jd(i,s,0,this.platform),c=new Hi(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(),n=`${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(n))return!0;return!1}childrenIgnored(e){let t=e.fullpath()+"/",n=(e.relative()||".")+"/";for(let i of this.relativeChildren)if(i.match(n))return!0;for(let i of this.absoluteChildren)if(i.match(t))return!0;return!1}}});var Lx,Nx,kx,og,m8=$e(()=>{Yc();Lx=class r{static{a(this,"HasWalkedCache")}store;constructor(e=new Map){this.store=e}copy(){return new r(new Map(this.store))}hasWalked(e,t){return this.store.get(e.fullpath())?.has(t.globString())}storeWalked(e,t){let n=e.fullpath(),i=this.store.get(n);i?i.add(t.globString()):this.store.set(n,new Set([t.globString()]))}},Nx=class{static{a(this,"MatchRecord")}store=new Map;add(e,t,n){let i=(t?2:0)|(n?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)])}},kx=class{static{a(this,"SubWalks")}store=new Map;add(e,t){if(!e.canReaddir())return;let n=this.store.get(e);n?n.find(i=>i.globString()===t.globString())||n.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())}},og=class r{static{a(this,"Processor")}hasWalkedCache;matches=new Nx;subwalks=new kx;patterns;follow;dot;opts;constructor(e,t){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=t?t.copy():new Lx}processPatterns(e,t){this.patterns=t;let n=t.map(i=>[e,i]);for(let[i,s]of n){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===Rr){(!i.isSymbolicLink()||this.follow||s.checkFollowGlobstar())&&this.subwalks.add(i,s);let d=u?.pattern(),p=u?.rest();if(!u||(d===""||d===".")&&!p)this.matches.add(i,c,d===""||d===".");else if(d===".."){let h=i.parent||i;p?this.hasWalkedCache.hasWalked(h,p)||this.subwalks.add(h,p):this.matches.add(h,c,!0)}}else l instanceof RegExp&&this.subwalks.add(i,s)}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new r(this.opts,this.hasWalkedCache)}filterEntries(e,t){let n=this.subwalks.get(e),i=this.child();for(let s of t)for(let o of n){let c=o.isAbsolute(),l=o.pattern(),u=o.rest();l===Rr?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,n,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()&&(n&&t.checkFollowGlobstar()?this.subwalks.add(e,n):t.markFollowGlobstar()&&this.subwalks.add(e,t)))),n){let s=n.pattern();if(typeof s=="string"&&s!==".."&&s!==""&&s!==".")this.testString(e,s,n.rest(),i);else if(s===".."){let o=e.parent||e;this.subwalks.add(o,n)}else s instanceof RegExp&&this.testRegExp(e,s,n.rest(),i)}}testRegExp(e,t,n,i){t.test(e.name)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}testString(e,t,n,i){e.isNamed(t)&&(n?this.subwalks.add(e,n):this.matches.add(e,i,!1))}}});var O0e,kw,ag,cg,g8=$e(()=>{Cx();Dx();m8();O0e=a((r,e)=>typeof r=="string"?new Zd([r],e):Array.isArray(r)?new Zd(r,e):r,"makeIgnore"),kw=class{static{a(this,"GlobUtil")}path;patterns;opts;seen=new Set;paused=!1;aborted=!1;#t=[];#r;#n;signal;maxDepth;includeChildMatches;constructor(e,t,n){if(this.patterns=e,this.path=t,this.opts=n,this.#n=!n.posix&&n.platform==="win32"?"\\":"/",this.includeChildMatches=n.includeChildMatches!==!1,(n.ignore||!this.includeChildMatches)&&(this.#r=O0e(n.ignore??[],n),!this.includeChildMatches&&typeof this.#r.add!="function")){let i="cannot ignore child matches, ignore lacks add() method.";throw new Error(i)}this.maxDepth=n.maxDepth||1/0,n.signal&&(this.signal=n.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0}))}#e(e){return this.seen.has(e)||!!this.#r?.ignored?.(e)}#i(e){return!!this.#r?.childrenIgnored?.(e)}pause(){this.paused=!0}resume(){if(this.signal?.aborted)return;this.paused=!1;let e;for(;!this.paused&&(e=this.#t.shift());)e()}onResume(e){this.signal?.aborted||(this.paused?this.#t.push(e):e())}async matchCheck(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||await e.realpath(),!n)return;e=n}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.#e(e)?e:void 0}matchCheckSync(e,t){if(t&&this.opts.nodir)return;let n;if(this.opts.realpath){if(n=e.realpathCached()||e.realpathSync(),!n)return;e=n}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.#e(e))return;if(!this.includeChildMatches&&this.#r?.add){let s=`${e.relativePosix()}/**`;this.#r.add(s)}let n=this.opts.absolute===void 0?t:this.opts.absolute;this.seen.add(e);let i=this.opts.mark&&e.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(e);else if(n){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.#n)?"."+this.#n:"";this.matchEmit(s?o+s+i:"."+i)}}async match(e,t,n){let i=await this.matchCheck(e,n);i&&this.matchFinish(i,t)}matchSync(e,t,n){let i=this.matchCheckSync(e,n);i&&this.matchFinish(i,t)}walkCB(e,t,n){this.signal?.aborted&&n(),this.walkCB2(e,t,new og(this.opts),n)}walkCB2(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirCached();c.calledReaddir()?this.walkCB3(c,l,n,o):c.readdirCB((u,f)=>this.walkCB3(c,f,n,o),!0)}o()}walkCB3(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||(s++,this.match(c,l,u).then(()=>o()));for(let[c,l]of n.subwalks.entries())s++,this.walkCB2(c,l,n.child(),o);o()}walkCBSync(e,t,n){this.signal?.aborted&&n(),this.walkCB2Sync(e,t,new og(this.opts),n)}walkCB2Sync(e,t,n,i){if(this.#i(e))return i();if(this.signal?.aborted&&i(),this.paused){this.onResume(()=>this.walkCB2Sync(e,t,n,i));return}n.processPatterns(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let c of n.subwalkTargets()){if(this.maxDepth!==1/0&&c.depth()>=this.maxDepth)continue;s++;let l=c.readdirSync();this.walkCB3Sync(c,l,n,o)}o()}walkCB3Sync(e,t,n,i){n=n.filterEntries(e,t);let s=1,o=a(()=>{--s===0&&i()},"next");for(let[c,l,u]of n.matches.entries())this.#e(c)||this.matchSync(c,l,u);for(let[c,l]of n.subwalks.entries())s++,this.walkCB2Sync(c,l,n.child(),o);o()}},ag=class extends kw{static{a(this,"GlobWalker")}matches=new Set;constructor(e,t,n){super(e,t,n)}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}},cg=class extends kw{static{a(this,"GlobStream")}results;constructor(e,t,n){super(e,t,n),this.results=new Jc({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 y8,x0e,Hs,Mx=$e(()=>{Yc();y8=require("node:url");h8();Fx();g8();x0e=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Hs=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,y8.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||x0e,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"?Xd:t.platform==="darwin"?sg:t.platform?Qd:p8;this.scurry=new l(this.cwd,{nocase:t.nocase,fs:t.fs})}this.nocase=this.scurry.nocase;let n=this.platform==="darwin"||this.platform==="win32",i={...t,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:n,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 Hi(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 Jd(l,f,0,this.platform)})}async walk(){return[...await new ag(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 ag(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 cg(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 cg(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 $x,jx=$e(()=>{Yc();$x=a((r,e={})=>{Array.isArray(r)||(r=[r]);for(let t of r)if(new Hi(t,e).hasMagic())return!0;return!1},"hasMagic")});function Mw(r,e={}){return new Hs(r,e).streamSync()}function _8(r,e={}){return new Hs(r,e).stream()}function S8(r,e={}){return new Hs(r,e).walkSync()}async function b8(r,e={}){return new Hs(r,e).walk()}function $w(r,e={}){return new Hs(r,e).iterateSync()}function w8(r,e={}){return new Hs(r,e).iterate()}var P0e,F0e,D0e,L0e,N0e,ep,Bx=$e(()=>{Yc();Mx();jx();Yc();Mx();jx();Dx();a(Mw,"globStreamSync");a(_8,"globStream");a(S8,"globSync");a(b8,"glob_");a($w,"globIterateSync");a(w8,"globIterate");P0e=Mw,F0e=Object.assign(_8,{sync:Mw}),D0e=$w,L0e=Object.assign(w8,{sync:$w}),N0e=Object.assign(S8,{stream:Mw,iterate:$w}),ep=Object.assign(b8,{glob:b8,globSync:S8,sync:N0e,globStream:_8,stream:F0e,globStreamSync:Mw,streamSync:P0e,globIterate:w8,iterate:L0e,globIterateSync:$w,iterateSync:D0e,Glob:Hs,hasMagic:$x,escape:zd,unescape:Ws});ep.glob=ep});async function v8(r,e,t,n={}){let{excludeRelPath:i}=n,s=Tu.default.join(r,"**/*.md"),o=await ep(s,{nodir:!0,ignore:[Tu.default.join(r,".obsidian/**"),Tu.default.join(r,".trash/**"),Tu.default.join(r,"**/.obsidian/**"),Tu.default.join(r,"**/.trash/**")]}),c={filesScanned:0,filesModified:0,replacements:0,modifiedFiles:[]};for(let l of o){let u=Tu.default.relative(r,l);if(i&&u===i)continue;c.filesScanned+=1;let f;try{f=await Ux.default.readFile(l,"utf-8")}catch{continue}let{updated:d,replacements:p}=k0e(f,e,t);p>0&&(c.filesModified+=1,c.replacements+=p,c.modifiedFiles.push(u),await Ux.default.writeFile(l,d,"utf-8"))}return c}function k0e(r,e,t){let n=r.split(/(^```[\s\S]*?^```)/m),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=n[s],c=M0e(o,e,t);i+=c.replacements,n[s]=c.updated}return{updated:n.join(""),replacements:i}}function M0e(r,e,t){let n=r.split(/(`[^`\n]*`)/),i=0;for(let s=0;s<n.length;s++){if(s%2===1)continue;let o=$0e(n[s],e,t);i+=o.replacements,n[s]=o.updated}return{updated:n.join(""),replacements:i}}function $0e(r,e,t){let n=/(?<!!)\[\[([^\[\]\n|#^]+)((?:[#^][^\[\]\n|]*)?)(?:\|[^\[\]\n]*)?\]\]/g,i=0;return{updated:r.replace(n,(o,c,l)=>c.trim()!==e?o:(i+=1,`[[${t}${l}]]`)),replacements:i}}var Ux,Tu,T8=$e(()=>{"use strict";Ux=Q($o()),Tu=Q(require("path"));Bx();a(v8,"rewriteInboundWikilinks");a(k0e,"rewriteContent");a(M0e,"rewriteProseSegment");a($0e,"replaceWikilinks")});var Or,pr,Ys,j0e,Yt,Xs=$e(()=>{"use strict";Or=Q($o()),pr=Q(require("path"));qm();Ys=Q(Pe());T8();j0e=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Yt=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 Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);return Or.default.readFile(t,"utf-8")}async create(e,t){let n=this.resolvePath(e);if(await Or.default.pathExists(n))throw new Error(`File already exists: ${e}`);return await Or.default.ensureDir(pr.default.dirname(n)),await Or.default.writeFile(n,t,"utf-8"),this.createFileObject(e)}async modify(e,t){let n=this.resolvePath(e.path);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.writeFile(n,t,"utf-8")}async delete(e){let t=this.resolvePath(e.path);if(!await Or.default.pathExists(t))throw new Error(`File not found: ${e.path}`);await Or.default.remove(t)}async exists(e){let t=this.resolvePath(e);return Or.default.pathExists(t)}getAbstractFileByPath(e){let t=this.resolvePath(e);try{let n=Or.default.statSync(t);if(n.isFile())return this.createFileObject(e);if(n.isDirectory())return this.createFolderObject(e)}catch{return null}return null}getAllFiles(){let e=[];return this.walkDirectory(this.rootPath,t=>{if(t.endsWith(".md")){let n=pr.default.relative(this.rootPath,t);e.push(this.createFileObject(n))}}),e}getFrontmatter(e){try{let t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8");return this.extractFrontmatter(t)}catch{return null}}getFrontmatterParseFailure(e){let t;try{t=Or.default.readFileSync(this.resolvePath(e.path),"utf-8")}catch{return null}let n=(0,Ys.matchFrontmatterBlock)(t)?.body;if(n===void 0)return null;let i=/^[ \t]*(#.*)?\r?$/;if(!n.split(`
436
436
  `).some(o=>!i.test(o))||this.extractFrontmatter(t)!==null)return null;try{return Hc(n,{schema:Gm}),{reason:"frontmatter is not a mapping with string keys"}}catch(o){return{reason:o instanceof Error?o.message.split(`
437
437
  `)[0]:String(o)}}}async updateFrontmatter(e,t){let n=await this.read(e),i=this.extractFrontmatter(n),s=(0,Ys.matchFrontmatterBlock)(n)?.body;if(i===null&&s!==void 0&&s.trim()!=="")throw new Error(`updateFrontmatter: frontmatter of ${e.path} is not parseable \u2014 refusing to patch (re-serialising would overwrite the unreadable block)`);let o=i??{},c=t({...o});Ys.FrontmatterService.applyPatch(o,c);let l=this.replaceFrontmatter(n,o);await this.modify(e,l)}async rename(e,t){let n=this.resolvePath(e.path),i=this.resolvePath(t);if(!await Or.default.pathExists(n))throw new Error(`File not found: ${e.path}`);await Or.default.ensureDir(pr.default.dirname(i)),await Or.default.move(n,i)}async createFolder(e){let t=this.resolvePath(e);await Or.default.ensureDir(t)}getFirstLinkpathDest(e,t,n){let i=e.split("|")[0].trim();if(!i)return null;if(j0e.test(i)){this.uuidIndex===null&&this.buildUuidIndex();let u=i.toLowerCase(),f=this.uuidIndex.get(u);return f?this.createFileObject(f):null}let s=pr.default.dirname(this.resolvePath(t)),o;if(pr.default.isAbsolute(i)?o=this.resolvePath(i):o=pr.default.resolve(s,i),i.endsWith(".md")||(o+=".md"),Or.default.existsSync(o)){let u=pr.default.relative(this.rootPath,o);return this.createFileObject(u)}(this.basenameIndex===null||this.aliasIndex===null)&&this.buildLinkpathIndex();let c=i.toLowerCase(),l=this.basenameIndex.get(c);if(l)return this.createFileObject(l);if(n?.allowAliasFallback!==!1){let u=this.aliasIndex.get(c);if(u)return this.createFileObject(u)}return null}buildLinkpathIndex(){this.basenameIndex=new Map,this.aliasIndex=new Map,this.walkDirectory(this.rootPath,e=>{if(!e.endsWith(".md"))return;let t=pr.default.relative(this.rootPath,e),n=pr.default.basename(e,".md").toLowerCase();this.basenameIndex.has(n)||this.basenameIndex.set(n,t);let i;try{i=Or.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 n=pr.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(n){let i=n[1].toLowerCase(),s=pr.default.relative(this.rootPath,e);this.uuidIndex.set(i,s)}}})}async process(e,t){let n=await this.read(e),i=t(n);return await this.modify(e,i),i}getDefaultNewFileParent(){return{path:"",name:""}}async updateLinks(e,t,n){let i=pr.default.basename(t,".md");await v8(this.rootPath,n,i,{excludeRelPath:e})}resolvePath(e){if(pr.default.isAbsolute(e))return e;let t=this.rootPath.replace(/[/\\]+$/,""),n=pr.default.sep+e;return n===t||n.startsWith(t+pr.default.sep)?n:pr.default.join(this.rootPath,e)}createFileObject(e){let t=pr.default.basename(e),n=pr.default.basename(e,pr.default.extname(e)),i=pr.default.dirname(e);return{path:e,basename:n,name:t,parent:i!=="."?this.createFolderObject(i):null}}createFolderObject(e){return{path:e,name:pr.default.basename(e)}}extractFrontmatter(e){let t=(0,Ys.matchFrontmatterBlock)(e);return t?(0,Ys.parseYamlFrontmatterTolerant)(t.body):null}replaceFrontmatter(e,t){let i=`---
438
438
  ${Wd(t,{lineWidth:-1,noRefs:!0,quoteStyle:"double"}).trim()}
@@ -466,20 +466,20 @@ ${Wd(t,{lineWidth:-1,noRefs:!0,quoteStyle:"double"}).trim()}
466
466
  \u2139\uFE0F ${p.length} warning(s)`+(h>0?` (${h} unresolvable class/symbolic ref(s) \u2014 not validated)`:"")+" \u2014 these do not affect the exit code.");let b=rSe(p),S=Math.max(...b.map(_=>String(_.count).length));console.log(` Breakdown by reason (${p.length} total):`);for(let _ of b)console.log(` ${String(_.count).padStart(S)} ${_.reason}`);if(g>0){console.log(` \u26A0\uFE0F ${m.size} term-IRI collision(s) \u2014 one IRI emitted by several assets (${g} entr${g===1?"y":"ies"}):`);for(let _ of[...m].sort())console.log(` \u2022 ${_}`);console.log(" Run with --format json for the emitting assets.")}}}u.conforms||(process.exitCode=1)}catch(i){le.handle(i)}}function iSe(r,e,t){let n=F7(e),i=n.length>0?{...r,violations:[...r.violations,...n]}:r,s=BP(e,i);return t&&(s=VP(s,t)),s}function V7(){return new de("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").option("--class <iri>","Only validate assets whose exo__Instance_class matches this IRI/slug (RFC 8e83442b T1.4)").action(async r=>{let e=r.output||"text";if(le.setFormat(e),r.shapesMode){await nSe(r);return}try{let t=(0,Ja.resolve)(r.vault);if(!(0,qo.existsSync)(t))throw new Fe(t);let n;if(r.staged){if(n=j7(t),n.length===0){if(e==="json"){let f=mt.success({vaultPath:t,filesChecked:0,violations:[],healthy:!0});console.log(JSON.stringify(f,null,2))}else console.log("\u2705 No staged .md files to validate.");return}}else n=L_e(t);if(r.class){let f=r.class;n=n.filter(d=>{try{let p=(0,qo.readFileSync)((0,Ja.resolve)(t,d),"utf-8"),h=k7(p);return P_e(h,f)}catch{return!1}})}e==="text"&&console.log(`\u{1F4E6} Loading vault: ${t}...`);let{triples:i,cacheHit:s}=await N7(t,!!r.useCache),o=i;e==="text"&&s&&console.log("\u{1F680} Cache hit! Loading from persistent cache..."),e==="text"&&(console.log(`\u2705 Loaded ${o.length} triples`),console.log("\u{1F50D} Querying ontology for declared properties..."));let c=await k_e(o);e==="text"&&(console.log(`\u{1F4CB} Found ${c.size} declared properties in ontology`),console.log(`\u{1F50D} Validating ${n.length} file(s)...
467
467
  `));let l=[];for(let f of n){let d=(0,Ja.resolve)(t,f),p=$_e(d,f,c);l.push(...p)}let u={vaultPath:t,filesChecked:n.length,violations:l,healthy:l.length===0};if(e==="json"){let f=mt.success(u);console.log(JSON.stringify(f,null,2))}else if(l.length===0)console.log(`\u2705 All ${n.length} file(s) pass schema validation.`);else{let f=new Map;for(let d of l){let p=f.get(d.file)||[];p.push(d),f.set(d.file,p)}console.log(`\u26A0\uFE0F Found ${l.length} schema violation(s) in ${f.size} file(s):
468
468
  `);for(let[d,p]of f){console.log(` \u274C ${d}`);for(let h of p)console.log(` \u2022 ${h.reason}`)}console.log(`
469
- \u{1F4DD} To fix these issues:`),console.log(" - Remove undeclared properties from frontmatter"),console.log(" - Or declare them in the ontology as Property instances")}l.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}var qo,Ja,L7,lt,x_e,jP,F_e,j_e,B_e,U_e,$P,q_e,z_e,H_e,Y_e,X_e,Q_e,J_e,Z_e,GP=$e(()=>{"use strict";ut();qo=require("fs"),Ja=require("path"),L7=require("child_process");qm();lt=Q(Pe());_t();D7();Nt();Ir();Xa();lE();Au();x_e=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),jP=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#"],["exoql__","https://exocortex.my/ontology/exoql#"],["query__","https://exocortex.my/ontology/query#"],["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#"],["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#"],["xsd__","http://www.w3.org/2001/XMLSchema#"],["sh__","http://www.w3.org/ns/shacl#"]]);a(P_e,"frontmatterMatchesClass");a(N7,"loadTriplesFromAllVaults");F_e="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";a(k7,"extractFrontmatter");a(M7,"hasKnownPrefix");a($7,"keyToURI");a(D_e,"classifyKeys");a(j7,"getStagedMdFiles");a(L_e,"collectMdFiles");a(N_e,"extractPropertyNameFromURI");a(k_e,"loadDeclaredProperties");a(M_e,"detectUnparseableFrontmatter");a($_e,"validateFile");j_e="http://www.w3.org/2000/01/rdf-schema#subClassOf",B_e="https://exocortex.my/ontology/exo#Class_superClass",U_e="http://www.w3.org/2000/01/rdf-schema#label";a(B7,"labelToOntologyIRI");a(V_e,"fileIriToOntologyURIFromFilename");a(G_e,"domainToAlgebraTriples");$P=class{constructor(e){this.subClassMap=new Map;this.subClassMemo=new Map;let t=new Map,n=new Set,i=a(o=>o===j_e||o===B_e,"isSubClassPredicate");for(let o of e)o.predicate instanceof lt.DomainIRI&&i(o.predicate.value)&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI&&(n.add(o.subject.value),n.add(o.object.value));for(let o of e)if(o.predicate instanceof lt.DomainIRI&&o.predicate.value===U_e&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainLiteral){let c=B7(o.object.value);c&&t.set(o.subject.value,c)}for(let o of n)if(!t.has(o)){let c=V_e(o);c&&t.set(o,c)}for(let[o,c]of t){let l=this.subClassMap.get(o)??new Set;l.add(c),this.subClassMap.set(o,l)}for(let o of e)if(o.predicate instanceof lt.DomainIRI&&i(o.predicate.value)&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI){let c=o.subject.value,l=o.object.value,u=this.subClassMap.get(c)??new Set;u.add(l),this.subClassMap.set(c,u);let f=t.get(c),d=l.startsWith("obsidian://")?t.get(l):l;if(f&&d){let p=this.subClassMap.get(f)??new Set;p.add(d),this.subClassMap.set(f,p)}}let s=e.filter(o=>o.predicate instanceof lt.DomainIRI&&o.predicate.value===F_e&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI);for(let o of s){let c=o.subject.value,l=o.object.value,u=this.collectAncestors(l);for(let d of u){if(c===d)continue;let p=this.subClassMap.get(c)??new Set;p.add(d),this.subClassMap.set(c,p)}let f=t.get(c);if(f)for(let d of u){let p=d.startsWith("obsidian://")?t.get(d):d;if(!p||f===p)continue;let h=this.subClassMap.get(f)??new Set;h.add(p),this.subClassMap.set(f,h)}}}static{a(this,"TripleClassHierarchy")}collectAncestors(e){let t=new Set,n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(n.has(s))continue;n.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)c!==e&&(t.add(c),n.has(c)||i.push(c))}return t}isSubClassOf(e,t){let n=this.subClassMemo.get(e);if(n){let s=n.get(t);if(s!==void 0)return s}else n=new Map,this.subClassMemo.set(e,n);let i=this.walkIsSubClassOf(e,t);return n.set(t,i),i}walkIsSubClassOf(e,t){let n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===t)return!0;if(n.has(s))continue;n.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)i.push(c)}return!1}},q_e=new Set(["sh:Warning","sh:Info"]);a(W_e,"earlOutcomeFor");a(U7,"buildEARLReport");z_e="https://exocortex.my/ontology/exo#Asset_legacyValidationException";a(BP,"applyLegacyExceptionFilter");a(UP,"runShapesValidation");a(VP,"filterReportToStagedFocusNodes");a(K_e,"emitEmptyStagedShapesResult");H_e="class target IRI has no path segment under obsidian://vault/",Y_e="class target IRI has a path segment under obsidian://vault/",X_e="class target IRI is not under obsidian://vault/ (symbolic term IRI)",Q_e="term-IRI collision (one IRI emitted by several assets)",J_e="unknown property (no registered shape)",Z_e="class constraint with no target recorded (nothing to classify by)";a(eSe,"targetHasPathSegment");a(tSe,"classifyWarningReason");a(rSe,"summarizeWarningReasons");a(nSe,"runShapesModeAction");a(iSe,"assembleShapesReport");a(V7,"validateSchemaCommand")});var bV={};Yu(bV,{CandidateShaclValidator:()=>rF});function PSe(r){let e=r.match(/^https:\/\/exocortex\.my\/ontology\/([A-Za-z][A-Za-z0-9_]*(?:-[A-Za-z0-9_]+)*)#(.+)$/);return e?`${e[1]}__${e[2]}`:r}function FSe(r){let e=(0,Eg.basename)(r);return{path:r,basename:(0,Eg.basename)(r,(0,Eg.extname)(r)),name:e,parent:null}}function DSe(r){let e=(0,dp.frontmatterBlockBody)(r);return e===null?null:(0,dp.parseYamlFrontmatterTolerant)(e)}var Eg,dp,rF,_V=$e(()=>{"use strict";Eg=require("path"),dp=Q(Pe());Xs();GP();Xa();rF=class{constructor(e,t={}){this.vaultPath=e;this.options=t}static{a(this,"CandidateShaclValidator")}async validateCandidate(e,t){let n=new Yt(this.vaultPath),i=new dp.NoteToRDFConverter(n),s=FSe(e),o=DSe(t),c=o?i.validateExocortexAsset(o,s.basename):null;if(c)return{violations:[{propertyPath:c.property,propertyIri:c.property,constraint:c.code,message:`${c.message} \u2014 the asset would be SKIPPED by the indexer (no triples emitted), making it invisible to every query, layout and graph relation.`}],warnings:[]};let l=this.options.useCache??!1,u=await mi(this.vaultPath,{useCache:l,cacheManager:this.options.cacheManager,vaultAdapter:n});l&&this.options.log?.(Ru(u));let f=u.triples,d;try{d=await i.convertNoteFromFrontmatter(s,o)}catch(_){return{violations:[{propertyPath:e,propertyIri:e,constraint:"indexability",message:`The asset could not be converted to RDF (${_ instanceof Error?_.message:String(_)}) \u2014 the indexer would SKIP it, making it invisible to every query, layout and graph relation.`}],warnings:[]}}let p=[...f,...d],h=await UP(this.vaultPath,p),g=BP(p,h),m=VP(g,new Set([e])),b=[],S=[];for(let _ of m.violations){let A={propertyPath:PSe(_.propertyPath),propertyIri:_.propertyPath,constraint:String(_.constraint),message:_.message,..._.actualValue!==void 0?{actualValue:_.actualValue}:{},..._.expectedRange!==void 0?{expectedRange:_.expectedRange}:{}};_.severity==="sh:Violation"?b.push(A):S.push(A)}return{violations:b,warnings:S}}};a(PSe,"iriToFrontmatterKey");a(FSe,"syntheticFile");a(DSe,"extractFrontmatter")});var BV=T(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.createPathBasedTargetResolver=io;Ln.createCreateRelatedTaskService=ywe;Ln.createCreateRelatedProjectService=bwe;Ln.createCreateAssetService=_we;Ln.createArchiveAssetService=Swe;Ln.createCleanPropertiesService=wwe;Ln.createFixMissingLabelService=Ewe;Ln.createRenameToUidService=vwe;Ln.createRepairFolderService=Awe;Ln.createPlanForEveningService=Iwe;Ln.createUpdatePropertyService=Rwe;Ln.createRemovePropertyService=Cwe;Ln.createSetStatusService=Owe;Ln.createDuplicateAssetService=xwe;Ln.rewriteFrontmatterScalars=jV;var Ko=Pe();function io(r){return{resolveFile(e){let t=(0,Ko.iriToVaultPath)(e)??e,n=t.endsWith(".md")?t:`${t}.md`,i=r.getAbstractFileByPath(n);if(!i||!("basename"in i))throw new Error(`Cannot resolve target file for IRI: ${e}`);return i}}}a(io,"createPathBasedTargetResolver");var dF=a(()=>null,"NULL_CLASS_RESOLVER");function $E(r){return r.startsWith('"[[')&&r.endsWith(']]"')?r:r.startsWith("[[")&&r.endsWith("]]")?`"${r}"`:`"[[${r}]]"`}a($E,"toQuotedWikilink");function ywe(r,e,t=io(r),n,i=dF){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedTask requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Task",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(ywe,"createCreateRelatedTaskService");function bwe(r,e,t=io(r),n,i=dF){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedProject requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Project",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(bwe,"createCreateRelatedProjectService");function _we(r,e,t=dF,n=io(r)){return{async execute(i,s){let o=s?.prototypeUID??s?.prototype,c=s?.label,l=s?.folder,u=s?.ownerIdentity,f=s?.isDefinedBy;if(!o)throw new Error("createAsset requires userInput.prototypeUID");if(!c)throw new Error("createAsset requires userInput.label");let d,p;if(i)try{let w=n.resolveFile(i);d=w.path,p=r.getFrontmatter(w)??void 0}catch{}if(!l&&d){let w=d.lastIndexOf("/");l=w>=0?d.substring(0,w):""}if(l===void 0)throw new Error("createAsset requires userInput.folder");let h=o.endsWith("Prototype")?o.slice(0,-9):o,g=crypto.randomUUID(),m=Ko.DateFormatter.toISOTimestamp(new Date),b=`${g}.md`,S=l?`${l}/${b}`:b,_=["---",`exo__Asset_uid: ${g}`,`exo__Asset_createdAt: ${m}`,`exo__Asset_label: ${c}`,`exo__Asset_prototype: "[[${o}]]"`,"exo__Instance_class:",` - "[[${h}]]"`],A=!1;if(f&&(_.push(`exo__Asset_isDefinedBy: ${$E(f)}`),A=!0),p){let w=p.exo__Instance_class,O=(Array.isArray(w)?w:w!=null?[w]:[]).some(N=>Ko.WikiLinkHelpers.resolveSymbolic(String(N),t).includes("Area")),P=d?d.substring(d.lastIndexOf("/")+1).replace(/\.md$/,""):void 0;if(P){let N=O?"ems__Effort_area":"ems__Effort_parent";_.push(`${N}: "[[${P}]]"`)}!O&&p.ems__Effort_area&&_.push(`ems__Effort_area: ${$E(String(p.ems__Effort_area))}`),_.push('ems__Effort_status: "[[753a44d5-846c-4b82-9196-4fd9a4d48777]]"'),!A&&p.exo__Asset_isDefinedBy&&(_.push(`exo__Asset_isDefinedBy: ${$E(String(p.exo__Asset_isDefinedBy))}`),A=!0)}!A&&u&&_.push(`exo__Asset_isDefinedBy: ${$E(u)}`),_.push("---","");let E=_.join(`
470
- `);await e.createFile(S,E)}}}a(_we,"createCreateAssetService");function Swe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.archiveAsset(i)}}}a(Swe,"createArchiveAssetService");function wwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.cleanEmptyProperties(i)}}}a(wwe,"createCleanPropertiesService");function Ewe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.fixMissingLabel(i)}}}a(Ewe,"createFixMissingLabelService");function vwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n),s=r.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}a(vwe,"createRenameToUidService");async function Twe(r,e,t){try{let n=await r.read(t),i=e.parseObject(n);if(i)return i}catch{}return r.getFrontmatter(t)??{}}a(Twe,"readFreshFrontmatter");function Awe(r,e,t=io(r)){let n=new Ko.FrontmatterService;return{async execute(i){let s=t.resolveFile(i),o=await Twe(r,n,s),c=await e.getExpectedFolder(s,o);if(c===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(s.parent?.path??"")!==c&&await e.repairFolder(s,c)}}}a(Awe,"createRepairFolderService");function Iwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.planForEvening(i)}}}a(Iwe,"createPlanForEveningService");function Rwe(r,e,t){return{async execute(n,i){let s=i?.property,o=i?.value;if(!s)throw new Error(`updateProperty requires userInput.property \u2014 pass it via --input '{"property":"<name>","value":"<value>"}'`);if(o===void 0)throw new Error(`updateProperty requires userInput.value \u2014 pass it via --input '{"value":"<value>"}' (e.g. set-planned-start: --input '{"value":"2026-07-25T09:00:00"}')`);let c=(0,Ko.emptyPropertyValueForm)(o);if(c!==void 0)throw new Error(`updateProperty: the value for ${s} is ${c} \u2014 refusing rather than writing a junk key that looks like a cleared property. To clear it, use the removeProperty service_call (or the remove-property CLI verb).`);if(typeof o=="string"&&(0,Ko.isUnquotedWikilink)(o))throw new Error(`updateProperty: the value for ${s} is ${o} \u2014 an UNQUOTED wikilink. YAML reads it as a flow sequence, so the graph would receive a literal instead of a link (silent data loss). Pass the QUOTED form (the quotes are part of the string, e.g. --input '{"value":"\\"[[<uid>]]\\""}').`);let l=typeof o=="string"?(0,Ko.serializeYamlScalar)(o):o,u=await t.resolveTargetPath(n),f=await r.readFile(u),d=e.updateProperty(f,s,l);await r.updateFile(u,d)}}}a(Rwe,"createUpdatePropertyService");function Cwe(r,e,t){return{async execute(n,i){let s=i?.property;if(!s)throw new Error("removeProperty requires userInput.property");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.removeProperty(c,s);await r.updateFile(o,l)}}}a(Cwe,"createRemovePropertyService");function Owe(r,e,t){return{async execute(n,i){let s=i?.statusUID;if(!s)throw new Error("setStatus requires userInput.statusUID");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.updateProperty(c,"ems__Effort_status",`"[[${s}]]"`);await r.updateFile(o,l)}}}a(Owe,"createSetStatusService");function xwe(r,e=io(r),t){return{async execute(n){if(!n)throw new Error("duplicateAsset requires an active target \u2014 open an Exocortex asset before invoking");let i=e.resolveFile(n),s=await r.read(i),o=crypto.randomUUID(),c=Ko.DateFormatter.toLocalTimestamp(new Date),l=jV(s,{exo__Asset_uid:o,exo__Asset_createdAt:c}),u=i.parent?.path??"",f=u?`${u}/${o}.md`:`${o}.md`,d=await r.create(f,l);t&&await t(d)}}}a(xwe,"createDuplicateAssetService");var Pwe=/\r\n|\r|\n/;function jV(r,e){let t=(0,Ko.matchFrontmatterBlock)(r),n=Ko.FrontmatterService.leadingBlock(r);if(!t)throw new Error("duplicateAsset: source file has no YAML frontmatter block");let i=n.eol,s=new Map(Object.entries(e)),o=t.body.split(Pwe).map(u=>{let f=u.match(/^([A-Za-z_][A-Za-z0-9_]*):/);if(!f)return u;let d=f[1],p=s.get(d);return p===void 0?u:(s.delete(d),`${d}: ${p}`)});for(let[u,f]of s)o.push(`${u}: ${f}`);let c=t.blockStart+3+i.length,l=c+t.body.length;return r.slice(0,c)+o.join(i)+r.slice(l)}a(jV,"rewriteFrontmatterScalars")});var UV=T(pF=>{"use strict";Object.defineProperty(pF,"__esModule",{value:!0});pF.createInstantiatePrototypeSubtreeService=Mwe;var ic=Pe(),Fwe="753a44d5-846c-4b82-9196-4fd9a4d48777",Dwe="ems__EffortPrototype_parentEffortPrototype",Lwe="8619c4fc-64f1-4869-b17e-e34186cacca9";function Nwe(r){if(typeof r!="string")return;let e=r.match(/\[\[[^\]|]+\|([^\]]+)\]\]/);return e?e[1].trim():void 0}a(Nwe,"extractAlias");function jE(r){let e=String(sc(r)??""),t=e.match(/^"(.*)"$|^'(.*)'$/);return t?t[1]??t[2]??"":e}a(jE,"plainScalar");function sc(r){return Array.isArray(r)?r[0]:r}a(sc,"firstValue");function kwe(r){let e=r.replace(/\.md$/,""),t=e.substring(e.lastIndexOf("/")+1);return decodeURIComponent(t)}a(kwe,"uidFromIRI");function Mwe(r,e){return{async execute(t,n){let i=new Map;for(let E of r.getAllFiles()){let w=r.getFrontmatter(E);if(!w)continue;let R=w.exo__Asset_uid??E.basename;i.set(R,{file:E,fm:w,uid:R})}let s=a(E=>{let w=Nwe(sc(E));if(w)return w;let R=(0,ic.extractAssetReference)(sc(E));if(!R)return;let O=i.get(R);return O?jE(O.fm.exo__Asset_label):R},"classLabel"),o=a(E=>{for(let[w,R]of i){if(jE(R.fm.exo__Asset_label)!==E)continue;if((0,ic.extractAssetReference)(sc(R.fm.exo__Instance_class))===Lwe)return w}},"classUidByLabel"),c=kwe(t);if(!i.get(c))throw new Error(`instantiatePrototypeSubtree: root prototype not found for target "${t}" (uid ${c})`);let u=new Set([c]),f=!0;for(;f;){f=!1;for(let[E,w]of i){if(u.has(E))continue;let R=(0,ic.extractAssetReference)(sc(w.fm[Dwe]));R&&u.has(R)&&(u.add(E),f=!0)}}let d=new Map;for(let E of u)d.set(E,crypto.randomUUID());let p={},h=[],g;for(let[E,w]of Object.entries(n??{})){if(w==null||E==="label"||E==="body")continue;let R=(0,ic.extractAssetReference)(sc(w)),O=R?i.get(R):void 0;if(O){let P=O.fm.exo__Asset_label?jE(O.fm.exo__Asset_label):void 0;p[E]=P??String(w),(s(O.fm.exo__Instance_class)??"").includes("Project")?g||(g=R??void 0):h.push(R)}else p[E]=String(w)}let m=a(E=>{let w=String(E??"");for(let[R,O]of Object.entries(p))w=w.split(`{{${R}}}`).join(O);return w},"substitute"),b=new Set(h);for(let E of i.values()){if((0,ic.extractAssetReference)(sc(E.fm.exo__Asset_prototype))!==c)continue;let R=E.fm.exo__Asset_relates,O=new Set((Array.isArray(R)?R:R!=null?[R]:[]).map(P=>(0,ic.extractAssetReference)(P)).filter(P=>P!=null));if(O.size===b.size&&[...b].every(P=>O.has(P)))throw new Error(`instantiatePrototypeSubtree: already deployed \u2014 an instance of prototype ${c} with the same ref-params [${[...b].join(", ")}] already exists (${E.file.path}). Refusing to duplicate the subgraph.`)}let S=new Map;for(let E of u){let w=i.get(E);if(!w)continue;let R=s(w.fm.exo__Instance_class),O=R&&R.endsWith("Prototype")?R.slice(0,-9):R;if(!O)throw new Error(`instantiatePrototypeSubtree: cannot resolve instance class for subtree node ${E} (${w.file.path}) \u2014 its exo__Instance_class is missing or unresolvable. Aborting so no asset is written with a dangling [[undefined]] class.`);let P=o(O);if(!P)throw new Error(`instantiatePrototypeSubtree: cannot resolve class UID for instance class \xAB${O}\xBB (subtree node ${E}, ${w.file.path}) \u2014 no class-definition asset with that label is loaded. Aborting so no asset is written with a dangling [[${O}]] class wikilink.`);S.set(E,`[[${P}|${O}]]`)}let _=ic.DateFormatter.toISOTimestamp(new Date),A=[c,...[...u].filter(E=>E!==c)];for(let E of A){let w=i.get(E);if(!w)continue;let{file:R,fm:O}=w,P=d.get(E),N=S.get(E),j=m(jE(O.exo__Asset_label)),U=["---",`exo__Asset_uid: ${P}`];O.exo__Asset_isDefinedBy&&U.push(`exo__Asset_isDefinedBy: "[[${(0,ic.extractAssetReference)(sc(O.exo__Asset_isDefinedBy))}]]"`),U.push(`exo__Asset_createdAt: ${_}`,`exo__Asset_updatedAt: ${_}`,"exo__Instance_class:",` - "${N}"`,`exo__Asset_label: ${JSON.stringify(j)}`,"aliases:",` - ${JSON.stringify(j)}`,`exo__Asset_prototype: "[[${E}]]"`,`ems__Effort_status: "[[${Fwe}]]"`);let G=(0,ic.extractAssetReference)(sc(O.ems__Effort_blocker));if(G){let re=d.get(G)??G;U.push(`ems__Effort_blocker: "[[${re}]]"`)}if(E===c){if(h.length>0){U.push("exo__Asset_relates:");for(let re of h)U.push(` - "[[${re}]]"`)}g&&U.push(`ems__Effort_parent: "[[${g}]]"`)}else U.push(`ems__Effort_parent: "[[${d.get(c)}]]"`);U.push("---","");let $=U.join(`
471
- `),k=R.path.lastIndexOf("/"),te=k>=0?R.path.substring(0,k):"",Z=te?`${te}/${P}.md`:`${P}.md`;await e.createFile(Z,$)}}}}a(Mwe,"createInstantiatePrototypeSubtreeService")});var VV=T(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createInstantiatePrototypeSubtreeService=gt.createPathBasedTargetResolver=gt.rewriteFrontmatterScalars=gt.createDuplicateAssetService=gt.createSetStatusService=gt.createRemovePropertyService=gt.createUpdatePropertyService=gt.createPlanForEveningService=gt.createRepairFolderService=gt.createRenameToUidService=gt.createFixMissingLabelService=gt.createCleanPropertiesService=gt.createArchiveAssetService=gt.createCreateRelatedProjectService=gt.createCreateRelatedTaskService=gt.createCreateAssetService=void 0;var yi=BV();Object.defineProperty(gt,"createCreateAssetService",{enumerable:!0,get:a(function(){return yi.createCreateAssetService},"get")});Object.defineProperty(gt,"createCreateRelatedTaskService",{enumerable:!0,get:a(function(){return yi.createCreateRelatedTaskService},"get")});Object.defineProperty(gt,"createCreateRelatedProjectService",{enumerable:!0,get:a(function(){return yi.createCreateRelatedProjectService},"get")});Object.defineProperty(gt,"createArchiveAssetService",{enumerable:!0,get:a(function(){return yi.createArchiveAssetService},"get")});Object.defineProperty(gt,"createCleanPropertiesService",{enumerable:!0,get:a(function(){return yi.createCleanPropertiesService},"get")});Object.defineProperty(gt,"createFixMissingLabelService",{enumerable:!0,get:a(function(){return yi.createFixMissingLabelService},"get")});Object.defineProperty(gt,"createRenameToUidService",{enumerable:!0,get:a(function(){return yi.createRenameToUidService},"get")});Object.defineProperty(gt,"createRepairFolderService",{enumerable:!0,get:a(function(){return yi.createRepairFolderService},"get")});Object.defineProperty(gt,"createPlanForEveningService",{enumerable:!0,get:a(function(){return yi.createPlanForEveningService},"get")});Object.defineProperty(gt,"createUpdatePropertyService",{enumerable:!0,get:a(function(){return yi.createUpdatePropertyService},"get")});Object.defineProperty(gt,"createRemovePropertyService",{enumerable:!0,get:a(function(){return yi.createRemovePropertyService},"get")});Object.defineProperty(gt,"createSetStatusService",{enumerable:!0,get:a(function(){return yi.createSetStatusService},"get")});Object.defineProperty(gt,"createDuplicateAssetService",{enumerable:!0,get:a(function(){return yi.createDuplicateAssetService},"get")});Object.defineProperty(gt,"rewriteFrontmatterScalars",{enumerable:!0,get:a(function(){return yi.rewriteFrontmatterScalars},"get")});Object.defineProperty(gt,"createPathBasedTargetResolver",{enumerable:!0,get:a(function(){return yi.createPathBasedTargetResolver},"get")});var $we=UV();Object.defineProperty(gt,"createInstantiatePrototypeSubtreeService",{enumerable:!0,get:a(function(){return $we.createInstantiatePrototypeSubtreeService},"get")})});var Fve={};Yu(Fve,{createProgram:()=>uv});module.exports=oy(Fve);var PGe=Q(Fv());ut();ut();var bg=require("fs"),DP=require("path"),Xr=Q(Pe());var Fd=class{static{a(this,"TableFormatter")}format(e){if(e.length===0)return"No results";let t=this.getAllVariables(e),n=e.map(i=>this.solutionToRow(i,t));return this.renderTable(t,n)}getAllVariables(e){let t=new Set;for(let n of e)for(let i of n.variables())t.add(i);return Array.from(t).sort()}solutionToRow(e,t){return t.map(n=>{let i=e.get(n);return i?this.formatValue(i.toString()):""})}formatValue(e){return e.length>50?e.substring(0,47)+"...":e}renderTable(e,t){let n=e.map((s,o)=>{let c=s.length+1,l=Math.max(...t.map(u=>u[o]?.length||0));return Math.max(c,l,10)}),i=[];i.push(this.renderSeparator(n,"top")),i.push(this.renderRow(e.map(s=>`?${s}`),n)),i.push(this.renderSeparator(n,"mid"));for(let s of t)i.push(this.renderRow(s,n));return i.push(this.renderSeparator(n,"bottom")),i.join(`
469
+ \u{1F4DD} To fix these issues:`),console.log(" - Remove undeclared properties from frontmatter"),console.log(" - Or declare them in the ontology as Property instances")}l.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}var qo,Ja,L7,lt,x_e,jP,F_e,j_e,B_e,U_e,$P,q_e,z_e,H_e,Y_e,X_e,Q_e,J_e,Z_e,GP=$e(()=>{"use strict";ut();qo=require("fs"),Ja=require("path"),L7=require("child_process");qm();lt=Q(Pe());_t();D7();Nt();Ir();Xa();lE();Au();x_e=new Set(["aliases","archived","tags","cssclasses","publish","permalink","description","image","cover","banner","title","share","share_link","share_updated","metadata","uri"]),jP=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#"],["exoql__","https://exocortex.my/ontology/exoql#"],["query__","https://exocortex.my/ontology/query#"],["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#"],["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#"],["xsd__","http://www.w3.org/2001/XMLSchema#"],["sh__","http://www.w3.org/ns/shacl#"]]);a(P_e,"frontmatterMatchesClass");a(N7,"loadTriplesFromAllVaults");F_e="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";a(k7,"extractFrontmatter");a(M7,"hasKnownPrefix");a($7,"keyToURI");a(D_e,"classifyKeys");a(j7,"getStagedMdFiles");a(L_e,"collectMdFiles");a(N_e,"extractPropertyNameFromURI");a(k_e,"loadDeclaredProperties");a(M_e,"detectUnparseableFrontmatter");a($_e,"validateFile");j_e="http://www.w3.org/2000/01/rdf-schema#subClassOf",B_e="https://exocortex.my/ontology/exo#Class_superClass",U_e="http://www.w3.org/2000/01/rdf-schema#label";a(B7,"labelToOntologyIRI");a(V_e,"fileIriToOntologyURIFromFilename");a(G_e,"domainToAlgebraTriples");$P=class{constructor(e){this.subClassMap=new Map;this.subClassMemo=new Map;let t=new Map,n=new Set,i=a(o=>o===j_e||o===B_e,"isSubClassPredicate");for(let o of e)o.predicate instanceof lt.DomainIRI&&i(o.predicate.value)&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI&&(n.add(o.subject.value),n.add(o.object.value));for(let o of e)if(o.predicate instanceof lt.DomainIRI&&o.predicate.value===U_e&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainLiteral){let c=B7(o.object.value);c&&t.set(o.subject.value,c)}for(let o of n)if(!t.has(o)){let c=V_e(o);c&&t.set(o,c)}for(let[o,c]of t){let l=this.subClassMap.get(o)??new Set;l.add(c),this.subClassMap.set(o,l)}for(let o of e)if(o.predicate instanceof lt.DomainIRI&&i(o.predicate.value)&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI){let c=o.subject.value,l=o.object.value,u=this.subClassMap.get(c)??new Set;u.add(l),this.subClassMap.set(c,u);let f=t.get(c),d=l.startsWith("obsidian://")?t.get(l):l;if(f&&d){let p=this.subClassMap.get(f)??new Set;p.add(d),this.subClassMap.set(f,p)}}let s=e.filter(o=>o.predicate instanceof lt.DomainIRI&&o.predicate.value===F_e&&o.subject instanceof lt.DomainIRI&&o.object instanceof lt.DomainIRI);for(let o of s){let c=o.subject.value,l=o.object.value,u=this.collectAncestors(l);for(let d of u){if(c===d)continue;let p=this.subClassMap.get(c)??new Set;p.add(d),this.subClassMap.set(c,p)}let f=t.get(c);if(f)for(let d of u){let p=d.startsWith("obsidian://")?t.get(d):d;if(!p||f===p)continue;let h=this.subClassMap.get(f)??new Set;h.add(p),this.subClassMap.set(f,h)}}}static{a(this,"TripleClassHierarchy")}collectAncestors(e){let t=new Set,n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(n.has(s))continue;n.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)c!==e&&(t.add(c),n.has(c)||i.push(c))}return t}isSubClassOf(e,t){let n=this.subClassMemo.get(e);if(n){let s=n.get(t);if(s!==void 0)return s}else n=new Map,this.subClassMemo.set(e,n);let i=this.walkIsSubClassOf(e,t);return n.set(t,i),i}walkIsSubClassOf(e,t){let n=new Set,i=[e];for(;i.length>0;){let s=i.shift();if(s===t)return!0;if(n.has(s))continue;n.add(s);let o=this.subClassMap.get(s);if(o)for(let c of o)i.push(c)}return!1}},q_e=new Set(["sh:Warning","sh:Info"]);a(W_e,"earlOutcomeFor");a(U7,"buildEARLReport");z_e="https://exocortex.my/ontology/exo#Asset_legacyValidationException";a(BP,"applyLegacyExceptionFilter");a(UP,"runShapesValidation");a(VP,"filterReportToStagedFocusNodes");a(K_e,"emitEmptyStagedShapesResult");H_e="class target IRI has no path segment under obsidian://vault/",Y_e="class target IRI has a path segment under obsidian://vault/",X_e="class target IRI is not under obsidian://vault/ (symbolic term IRI)",Q_e="term-IRI collision (one IRI emitted by several assets)",J_e="unknown property (no registered shape)",Z_e="class constraint with no target recorded (nothing to classify by)";a(eSe,"targetHasPathSegment");a(tSe,"classifyWarningReason");a(rSe,"summarizeWarningReasons");a(nSe,"runShapesModeAction");a(iSe,"assembleShapesReport");a(V7,"validateSchemaCommand")});var bV={};Yu(bV,{CandidateShaclValidator:()=>rF});function PSe(r){let e=r.match(/^https:\/\/exocortex\.my\/ontology\/([A-Za-z][A-Za-z0-9_]*(?:-[A-Za-z0-9_]+)*)#(.+)$/);return e?`${e[1]}__${e[2]}`:r}function FSe(r){let e=(0,Eg.basename)(r);return{path:r,basename:(0,Eg.basename)(r,(0,Eg.extname)(r)),name:e,parent:null}}function DSe(r){let e=(0,dp.frontmatterBlockBody)(r);return e===null?null:(0,dp.parseYamlFrontmatterTolerant)(e)}var Eg,dp,rF,_V=$e(()=>{"use strict";Eg=require("path"),dp=Q(Pe());Xs();GP();Xa();rF=class{constructor(e,t={}){this.vaultPath=e;this.options=t}static{a(this,"CandidateShaclValidator")}async validateCandidate(e,t){let n=new Yt(this.vaultPath),i=new dp.NoteToRDFConverter(n),s=FSe(e),o=DSe(t),c=o?i.validateExocortexAsset(o,s.basename):null;if(c)return{violations:[{propertyPath:c.property,propertyIri:c.property,constraint:c.code,message:`${c.message} \u2014 the asset would be SKIPPED by the indexer (no triples emitted), making it invisible to every query, layout and graph relation.`}],warnings:[]};let l=this.options.useCache??!1,u=await mi(this.vaultPath,{useCache:l,cacheManager:this.options.cacheManager,vaultAdapter:n});l&&this.options.log?.(Ru(u));let f=u.triples,d;try{d=await i.convertNoteFromFrontmatter(s,o)}catch(_){return{violations:[{propertyPath:e,propertyIri:e,constraint:"indexability",message:`The asset could not be converted to RDF (${_ instanceof Error?_.message:String(_)}) \u2014 the indexer would SKIP it, making it invisible to every query, layout and graph relation.`}],warnings:[]}}let p=[...f,...d],h=await UP(this.vaultPath,p),g=BP(p,h),m=VP(g,new Set([e])),b=[],S=[];for(let _ of m.violations){let A={propertyPath:PSe(_.propertyPath),propertyIri:_.propertyPath,constraint:String(_.constraint),message:_.message,..._.actualValue!==void 0?{actualValue:_.actualValue}:{},..._.expectedRange!==void 0?{expectedRange:_.expectedRange}:{}};_.severity==="sh:Violation"?b.push(A):S.push(A)}return{violations:b,warnings:S}}};a(PSe,"iriToFrontmatterKey");a(FSe,"syntheticFile");a(DSe,"extractFrontmatter")});var BV=T(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.createPathBasedTargetResolver=io;Ln.createCreateRelatedTaskService=ywe;Ln.createCreateRelatedProjectService=bwe;Ln.createCreateAssetService=_we;Ln.createArchiveAssetService=Swe;Ln.createCleanPropertiesService=wwe;Ln.createFixMissingLabelService=Ewe;Ln.createRenameToUidService=vwe;Ln.createRepairFolderService=Awe;Ln.createPlanForEveningService=Iwe;Ln.createUpdatePropertyService=Cwe;Ln.createRemovePropertyService=Owe;Ln.createSetStatusService=xwe;Ln.createDuplicateAssetService=Pwe;Ln.rewriteFrontmatterScalars=jV;var Ko=Pe();function io(r){return{resolveFile(e){let t=(0,Ko.iriToVaultPath)(e)??e,n=t.endsWith(".md")?t:`${t}.md`,i=r.getAbstractFileByPath(n);if(!i||!("basename"in i))throw new Error(`Cannot resolve target file for IRI: ${e}`);return i}}}a(io,"createPathBasedTargetResolver");var dF=a(()=>null,"NULL_CLASS_RESOLVER");function $E(r){return r.startsWith('"[[')&&r.endsWith(']]"')?r:r.startsWith("[[")&&r.endsWith("]]")?`"${r}"`:`"[[${r}]]"`}a($E,"toQuotedWikilink");function ywe(r,e,t=io(r),n,i=dF){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedTask requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Task",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(ywe,"createCreateRelatedTaskService");function bwe(r,e,t=io(r),n,i=dF){return{async execute(s,o){let c=o?.label;if(!c)throw new Error("createRelatedProject requires userInput.label");let l=t.resolveFile(s),u=r.getFrontmatter(l)??{},f=l.parent?.path||"",d={ems__Effort_status:'"[[c42245d0-01de-4c35-bfcf-d910445ea28e]]"'},p=o?.parentProperty;p&&l.basename&&(d[p]=`"[[${l.basename}]]"`);let h=await e.createAsset({className:"ems__Project",label:c,folderPath:f,propertyValues:d,parentFile:l,parentMetadata:u,classResolver:i});n&&await n(h)}}}a(bwe,"createCreateRelatedProjectService");function _we(r,e,t=dF,n=io(r)){return{async execute(i,s){let o=s?.prototypeUID??s?.prototype,c=s?.label,l=s?.folder,u=s?.ownerIdentity,f=s?.isDefinedBy;if(!o)throw new Error("createAsset requires userInput.prototypeUID");if(!c)throw new Error("createAsset requires userInput.label");let d,p;if(i)try{let w=n.resolveFile(i);d=w.path,p=r.getFrontmatter(w)??void 0}catch{}if(!l&&d){let w=d.lastIndexOf("/");l=w>=0?d.substring(0,w):""}if(l===void 0)throw new Error("createAsset requires userInput.folder");let h=o.endsWith("Prototype")?o.slice(0,-9):o,g=crypto.randomUUID(),m=Ko.DateFormatter.toISOTimestamp(new Date),b=`${g}.md`,S=l?`${l}/${b}`:b,_=["---",`exo__Asset_uid: ${g}`,`exo__Asset_createdAt: ${m}`,`exo__Asset_label: ${c}`,`exo__Asset_prototype: "[[${o}]]"`,"exo__Instance_class:",` - "[[${h}]]"`],A=!1;if(f&&(_.push(`exo__Asset_isDefinedBy: ${$E(f)}`),A=!0),p){let w=p.exo__Instance_class,O=(Array.isArray(w)?w:w!=null?[w]:[]).some(N=>Ko.WikiLinkHelpers.resolveSymbolic(String(N),t).includes("Area")),P=d?d.substring(d.lastIndexOf("/")+1).replace(/\.md$/,""):void 0;if(P){let N=O?"ems__Effort_area":"ems__Effort_parent";_.push(`${N}: "[[${P}]]"`)}!O&&p.ems__Effort_area&&_.push(`ems__Effort_area: ${$E(String(p.ems__Effort_area))}`),_.push('ems__Effort_status: "[[753a44d5-846c-4b82-9196-4fd9a4d48777]]"'),!A&&p.exo__Asset_isDefinedBy&&(_.push(`exo__Asset_isDefinedBy: ${$E(String(p.exo__Asset_isDefinedBy))}`),A=!0)}!A&&u&&_.push(`exo__Asset_isDefinedBy: ${$E(u)}`),_.push("---","");let E=_.join(`
470
+ `);await e.createFile(S,E)}}}a(_we,"createCreateAssetService");function Swe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.archiveAsset(i)}}}a(Swe,"createArchiveAssetService");function wwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.cleanEmptyProperties(i)}}}a(wwe,"createCleanPropertiesService");function Ewe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.fixMissingLabel(i)}}}a(Ewe,"createFixMissingLabelService");function vwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n),s=r.getFrontmatter(i)??{};await e.renameToUid(i,s)}}}a(vwe,"createRenameToUidService");async function Twe(r,e,t){try{let n=await r.read(t),i=e.parseObject(n);if(i)return i}catch{}return r.getFrontmatter(t)??{}}a(Twe,"readFreshFrontmatter");function Awe(r,e,t=io(r)){let n=new Ko.FrontmatterService;return{async execute(i){let s=t.resolveFile(i),o=await Twe(r,n,s),c=await e.getExpectedFolder(s,o);if(c===null)throw new Error("repairFolder: cannot determine expected folder (missing exo__Asset_isDefinedBy or referenced asset not found)");(s.parent?.path??"")!==c&&await e.repairFolder(s,c)}}}a(Awe,"createRepairFolderService");function Iwe(r,e,t=io(r)){return{async execute(n){let i=t.resolveFile(n);await e.planForEvening(i)}}}a(Iwe,"createPlanForEveningService");function Rwe(r){let e=a(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean","isScalar");if(e(r))return;if(Array.isArray(r))return r.every(e)?void 0:"an array with a non-scalar element";if(r===null)return"null";let t=typeof r;return t==="object"?"an object":`a ${t}`}a(Rwe,"nonScalarValueForm");function Cwe(r,e,t){return{async execute(n,i){let s=i?.property,o=i?.value;if(!s)throw new Error(`updateProperty requires userInput.property \u2014 pass it via --input '{"property":"<name>","value":"<value>"}'`);if(o===void 0)throw new Error(`updateProperty requires userInput.value \u2014 pass it via --input '{"value":"<value>"}' (e.g. set-planned-start: --input '{"value":"2026-07-25T09:00:00"}')`);let c=(0,Ko.emptyPropertyValueForm)(o);if(c!==void 0)throw new Error(`updateProperty: the value for ${s} is ${c} \u2014 refusing rather than writing a junk key that looks like a cleared property. To clear it, use the removeProperty service_call (or the remove-property CLI verb).`);let l=Rwe(o);if(l!==void 0)throw new Error(`updateProperty: the value for ${s} is ${l} \u2014 refusing rather than CORRUPTING the key. A non-scalar is stringified on the way out, so the file would carry the literal "[object Object]" (or a silently flattened list) and the data passed here would be gone. Pass a scalar (string/number/boolean) or an array of scalars.`);if(typeof o=="string"&&(0,Ko.isUnquotedWikilink)(o))throw new Error(`updateProperty: the value for ${s} is ${o} \u2014 an UNQUOTED wikilink. YAML reads it as a flow sequence, so the graph would receive a literal instead of a link (silent data loss). Pass the QUOTED form (the quotes are part of the string, e.g. --input '{"value":"\\"[[<uid>]]\\""}').`);let u=typeof o=="string"?(0,Ko.serializeYamlScalar)(o):o,f=await t.resolveTargetPath(n),d=await r.readFile(f),p=e.updateProperty(d,s,u);await r.updateFile(f,p)}}}a(Cwe,"createUpdatePropertyService");function Owe(r,e,t){return{async execute(n,i){let s=i?.property;if(!s)throw new Error("removeProperty requires userInput.property");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.removeProperty(c,s);await r.updateFile(o,l)}}}a(Owe,"createRemovePropertyService");function xwe(r,e,t){return{async execute(n,i){let s=i?.statusUID;if(!s)throw new Error("setStatus requires userInput.statusUID");let o=await t.resolveTargetPath(n),c=await r.readFile(o),l=e.updateProperty(c,"ems__Effort_status",`"[[${s}]]"`);await r.updateFile(o,l)}}}a(xwe,"createSetStatusService");function Pwe(r,e=io(r),t){return{async execute(n){if(!n)throw new Error("duplicateAsset requires an active target \u2014 open an Exocortex asset before invoking");let i=e.resolveFile(n),s=await r.read(i),o=crypto.randomUUID(),c=Ko.DateFormatter.toLocalTimestamp(new Date),l=jV(s,{exo__Asset_uid:o,exo__Asset_createdAt:c}),u=i.parent?.path??"",f=u?`${u}/${o}.md`:`${o}.md`,d=await r.create(f,l);t&&await t(d)}}}a(Pwe,"createDuplicateAssetService");var Fwe=/\r\n|\r|\n/;function jV(r,e){let t=(0,Ko.matchFrontmatterBlock)(r),n=Ko.FrontmatterService.leadingBlock(r);if(!t)throw new Error("duplicateAsset: source file has no YAML frontmatter block");let i=n.eol,s=new Map(Object.entries(e)),o=t.body.split(Fwe).map(u=>{let f=u.match(/^([A-Za-z_][A-Za-z0-9_]*):/);if(!f)return u;let d=f[1],p=s.get(d);return p===void 0?u:(s.delete(d),`${d}: ${p}`)});for(let[u,f]of s)o.push(`${u}: ${f}`);let c=t.blockStart+3+i.length,l=c+t.body.length;return r.slice(0,c)+o.join(i)+r.slice(l)}a(jV,"rewriteFrontmatterScalars")});var UV=T(pF=>{"use strict";Object.defineProperty(pF,"__esModule",{value:!0});pF.createInstantiatePrototypeSubtreeService=$we;var ic=Pe(),Dwe="753a44d5-846c-4b82-9196-4fd9a4d48777",Lwe="ems__EffortPrototype_parentEffortPrototype",Nwe="8619c4fc-64f1-4869-b17e-e34186cacca9";function kwe(r){if(typeof r!="string")return;let e=r.match(/\[\[[^\]|]+\|([^\]]+)\]\]/);return e?e[1].trim():void 0}a(kwe,"extractAlias");function jE(r){let e=String(sc(r)??""),t=e.match(/^"(.*)"$|^'(.*)'$/);return t?t[1]??t[2]??"":e}a(jE,"plainScalar");function sc(r){return Array.isArray(r)?r[0]:r}a(sc,"firstValue");function Mwe(r){let e=r.replace(/\.md$/,""),t=e.substring(e.lastIndexOf("/")+1);return decodeURIComponent(t)}a(Mwe,"uidFromIRI");function $we(r,e){return{async execute(t,n){let i=new Map;for(let E of r.getAllFiles()){let w=r.getFrontmatter(E);if(!w)continue;let R=w.exo__Asset_uid??E.basename;i.set(R,{file:E,fm:w,uid:R})}let s=a(E=>{let w=kwe(sc(E));if(w)return w;let R=(0,ic.extractAssetReference)(sc(E));if(!R)return;let O=i.get(R);return O?jE(O.fm.exo__Asset_label):R},"classLabel"),o=a(E=>{for(let[w,R]of i){if(jE(R.fm.exo__Asset_label)!==E)continue;if((0,ic.extractAssetReference)(sc(R.fm.exo__Instance_class))===Nwe)return w}},"classUidByLabel"),c=Mwe(t);if(!i.get(c))throw new Error(`instantiatePrototypeSubtree: root prototype not found for target "${t}" (uid ${c})`);let u=new Set([c]),f=!0;for(;f;){f=!1;for(let[E,w]of i){if(u.has(E))continue;let R=(0,ic.extractAssetReference)(sc(w.fm[Lwe]));R&&u.has(R)&&(u.add(E),f=!0)}}let d=new Map;for(let E of u)d.set(E,crypto.randomUUID());let p={},h=[],g;for(let[E,w]of Object.entries(n??{})){if(w==null||E==="label"||E==="body")continue;let R=(0,ic.extractAssetReference)(sc(w)),O=R?i.get(R):void 0;if(O){let P=O.fm.exo__Asset_label?jE(O.fm.exo__Asset_label):void 0;p[E]=P??String(w),(s(O.fm.exo__Instance_class)??"").includes("Project")?g||(g=R??void 0):h.push(R)}else p[E]=String(w)}let m=a(E=>{let w=String(E??"");for(let[R,O]of Object.entries(p))w=w.split(`{{${R}}}`).join(O);return w},"substitute"),b=new Set(h);for(let E of i.values()){if((0,ic.extractAssetReference)(sc(E.fm.exo__Asset_prototype))!==c)continue;let R=E.fm.exo__Asset_relates,O=new Set((Array.isArray(R)?R:R!=null?[R]:[]).map(P=>(0,ic.extractAssetReference)(P)).filter(P=>P!=null));if(O.size===b.size&&[...b].every(P=>O.has(P)))throw new Error(`instantiatePrototypeSubtree: already deployed \u2014 an instance of prototype ${c} with the same ref-params [${[...b].join(", ")}] already exists (${E.file.path}). Refusing to duplicate the subgraph.`)}let S=new Map;for(let E of u){let w=i.get(E);if(!w)continue;let R=s(w.fm.exo__Instance_class),O=R&&R.endsWith("Prototype")?R.slice(0,-9):R;if(!O)throw new Error(`instantiatePrototypeSubtree: cannot resolve instance class for subtree node ${E} (${w.file.path}) \u2014 its exo__Instance_class is missing or unresolvable. Aborting so no asset is written with a dangling [[undefined]] class.`);let P=o(O);if(!P)throw new Error(`instantiatePrototypeSubtree: cannot resolve class UID for instance class \xAB${O}\xBB (subtree node ${E}, ${w.file.path}) \u2014 no class-definition asset with that label is loaded. Aborting so no asset is written with a dangling [[${O}]] class wikilink.`);S.set(E,`[[${P}|${O}]]`)}let _=ic.DateFormatter.toISOTimestamp(new Date),A=[c,...[...u].filter(E=>E!==c)];for(let E of A){let w=i.get(E);if(!w)continue;let{file:R,fm:O}=w,P=d.get(E),N=S.get(E),j=m(jE(O.exo__Asset_label)),U=["---",`exo__Asset_uid: ${P}`];O.exo__Asset_isDefinedBy&&U.push(`exo__Asset_isDefinedBy: "[[${(0,ic.extractAssetReference)(sc(O.exo__Asset_isDefinedBy))}]]"`),U.push(`exo__Asset_createdAt: ${_}`,`exo__Asset_updatedAt: ${_}`,"exo__Instance_class:",` - "${N}"`,`exo__Asset_label: ${JSON.stringify(j)}`,"aliases:",` - ${JSON.stringify(j)}`,`exo__Asset_prototype: "[[${E}]]"`,`ems__Effort_status: "[[${Dwe}]]"`);let G=(0,ic.extractAssetReference)(sc(O.ems__Effort_blocker));if(G){let re=d.get(G)??G;U.push(`ems__Effort_blocker: "[[${re}]]"`)}if(E===c){if(h.length>0){U.push("exo__Asset_relates:");for(let re of h)U.push(` - "[[${re}]]"`)}g&&U.push(`ems__Effort_parent: "[[${g}]]"`)}else U.push(`ems__Effort_parent: "[[${d.get(c)}]]"`);U.push("---","");let $=U.join(`
471
+ `),k=R.path.lastIndexOf("/"),te=k>=0?R.path.substring(0,k):"",Z=te?`${te}/${P}.md`:`${P}.md`;await e.createFile(Z,$)}}}}a($we,"createInstantiatePrototypeSubtreeService")});var VV=T(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.createInstantiatePrototypeSubtreeService=gt.createPathBasedTargetResolver=gt.rewriteFrontmatterScalars=gt.createDuplicateAssetService=gt.createSetStatusService=gt.createRemovePropertyService=gt.createUpdatePropertyService=gt.createPlanForEveningService=gt.createRepairFolderService=gt.createRenameToUidService=gt.createFixMissingLabelService=gt.createCleanPropertiesService=gt.createArchiveAssetService=gt.createCreateRelatedProjectService=gt.createCreateRelatedTaskService=gt.createCreateAssetService=void 0;var yi=BV();Object.defineProperty(gt,"createCreateAssetService",{enumerable:!0,get:a(function(){return yi.createCreateAssetService},"get")});Object.defineProperty(gt,"createCreateRelatedTaskService",{enumerable:!0,get:a(function(){return yi.createCreateRelatedTaskService},"get")});Object.defineProperty(gt,"createCreateRelatedProjectService",{enumerable:!0,get:a(function(){return yi.createCreateRelatedProjectService},"get")});Object.defineProperty(gt,"createArchiveAssetService",{enumerable:!0,get:a(function(){return yi.createArchiveAssetService},"get")});Object.defineProperty(gt,"createCleanPropertiesService",{enumerable:!0,get:a(function(){return yi.createCleanPropertiesService},"get")});Object.defineProperty(gt,"createFixMissingLabelService",{enumerable:!0,get:a(function(){return yi.createFixMissingLabelService},"get")});Object.defineProperty(gt,"createRenameToUidService",{enumerable:!0,get:a(function(){return yi.createRenameToUidService},"get")});Object.defineProperty(gt,"createRepairFolderService",{enumerable:!0,get:a(function(){return yi.createRepairFolderService},"get")});Object.defineProperty(gt,"createPlanForEveningService",{enumerable:!0,get:a(function(){return yi.createPlanForEveningService},"get")});Object.defineProperty(gt,"createUpdatePropertyService",{enumerable:!0,get:a(function(){return yi.createUpdatePropertyService},"get")});Object.defineProperty(gt,"createRemovePropertyService",{enumerable:!0,get:a(function(){return yi.createRemovePropertyService},"get")});Object.defineProperty(gt,"createSetStatusService",{enumerable:!0,get:a(function(){return yi.createSetStatusService},"get")});Object.defineProperty(gt,"createDuplicateAssetService",{enumerable:!0,get:a(function(){return yi.createDuplicateAssetService},"get")});Object.defineProperty(gt,"rewriteFrontmatterScalars",{enumerable:!0,get:a(function(){return yi.rewriteFrontmatterScalars},"get")});Object.defineProperty(gt,"createPathBasedTargetResolver",{enumerable:!0,get:a(function(){return yi.createPathBasedTargetResolver},"get")});var jwe=UV();Object.defineProperty(gt,"createInstantiatePrototypeSubtreeService",{enumerable:!0,get:a(function(){return jwe.createInstantiatePrototypeSubtreeService},"get")})});var Dve={};Yu(Dve,{createProgram:()=>uv});module.exports=oy(Dve);var FGe=Q(Fv());ut();ut();var bg=require("fs"),DP=require("path"),Xr=Q(Pe());var Fd=class{static{a(this,"TableFormatter")}format(e){if(e.length===0)return"No results";let t=this.getAllVariables(e),n=e.map(i=>this.solutionToRow(i,t));return this.renderTable(t,n)}getAllVariables(e){let t=new Set;for(let n of e)for(let i of n.variables())t.add(i);return Array.from(t).sort()}solutionToRow(e,t){return t.map(n=>{let i=e.get(n);return i?this.formatValue(i.toString()):""})}formatValue(e){return e.length>50?e.substring(0,47)+"...":e}renderTable(e,t){let n=e.map((s,o)=>{let c=s.length+1,l=Math.max(...t.map(u=>u[o]?.length||0));return Math.max(c,l,10)}),i=[];i.push(this.renderSeparator(n,"top")),i.push(this.renderRow(e.map(s=>`?${s}`),n)),i.push(this.renderSeparator(n,"mid"));for(let s of t)i.push(this.renderRow(s,n));return i.push(this.renderSeparator(n,"bottom")),i.join(`
472
472
  `)}renderRow(e,t){return`\u2502 ${e.map((i,s)=>i.padEnd(t[s])).join(" \u2502 ")} \u2502`}renderSeparator(e,t){let n=t==="top"?"\u250C":t==="mid"?"\u251C":"\u2514",i=t==="top"?"\u2510":t==="mid"?"\u2524":"\u2518",o=t==="mid"?"\u2500\u253C\u2500":"\u2500"+(t==="mid"?"\u253C":"\u2500")+"\u2500",c=e.map(l=>"\u2500".repeat(l+2));return`${n}${c.join(o)}${i}`}};var YS=class{static{a(this,"JsonFormatter")}format(e){let t=e.map(n=>n.toJSON());return JSON.stringify(t,null,2)}};var XS=class{static{a(this,"CsvFormatter")}format(e){if(e.length===0)return"";let t=this.getAllVariables(e),n=[];n.push(t.join(","));for(let i of e){let s=t.map(o=>{let c=i.get(o);return c?this.escapeValue(c.toString()):""});n.push(s.join(","))}return n.join(`
473
473
  `)}getAllVariables(e){let t=new Set;for(let n of e)for(let i of n.variables())t.add(i);return Array.from(t).sort()}escapeValue(e){return e.includes(",")||e.includes('"')||e.includes(`
474
474
  `)||e.includes("\r")?`"${e.replace(/"/g,'""')}"`:e}};var Dd=class{static{a(this,"TriplesFormatter")}formatNTriples(e){return e.map(t=>t.toString()).join(`
475
475
  `)}formatTable(e){if(e.length===0)return"No triples generated.";let t=[];t.push("Subject | Predicate | Object"),t.push("------- | --------- | ------");for(let n of e){let i=this.formatNode(n.subject),s=this.formatNode(n.predicate),o=this.formatNode(n.object);t.push(`${i} | ${s} | ${o}`)}return t.join(`
476
476
  `)}formatJson(e){let t=e.map(n=>({subject:this.nodeToJson(n.subject),predicate:this.nodeToJson(n.predicate),object:this.nodeToJson(n.object)}));return JSON.stringify(t,null,2)}formatNode(e){return e.value!==void 0?String(e.value):String(e)}nodeToJson(e){return"datatype"in e||"language"in e?{type:"literal",value:String(e.value),...e.datatype&&{datatype:e.datatype.value||String(e.datatype)},...e.language&&{language:e.language}}:"id"in e&&String(e.id).startsWith("_:")?{type:"bnode",value:String(e.id)}:{type:"uri",value:String(e.value)}}};_t();Nt();Ir();ir();Xa();var B8=Q(require("crypto")),Ou=Q(require("path")),U8=Q(require("os")),fn=Q($o());var ebe=500,tbe=50*1024*1024,Qa=class{static{a(this,"QueryResultCache")}constructor(e={}){this.cacheDir=e.cacheDir??Ou.default.join(U8.default.homedir(),".exocortex","cache","query-results"),this.maxEntries=e.maxEntries??ebe,this.maxSizeBytes=e.maxSizeBytes??tbe}getCacheDir(){return this.cacheDir}getCacheKey(e){let t=e.trim().replace(/\s+/g," ");return B8.default.createHash("sha256").update(t).digest("hex")}async get(e,t,n){let i=this.getCacheKey(e),s=this.getCachePath(i);try{if(!await fn.default.pathExists(s))return null;let o=await fn.default.readJson(s),c=Date.now()-o.timestamp,l=t*1e3;return c>l?(await fn.default.remove(s),null):n&&o.vaultSignature&&o.vaultSignature!==n?(await fn.default.remove(s),null):o.result}catch{return null}}async set(e,t,n,i){let s=this.getCacheKey(e),o=this.getCachePath(s);await fn.default.ensureDir(this.cacheDir);let c={timestamp:Date.now(),result:t,...i?{vaultSignature:i}:{}};await fn.default.writeJson(o,c,{spaces:0}),await this.prune(s)}async prune(e){try{let t=Number.isFinite(this.maxEntries)&&this.maxEntries>0,n=Number.isFinite(this.maxSizeBytes)&&this.maxSizeBytes>0;if(!t&&!n)return;let s=(await fn.default.readdir(this.cacheDir)).filter(d=>d.endsWith(".json")),o=[],c=0,l=`${e}.json`;for(let d of s){if(d===l){try{let p=await fn.default.stat(Ou.default.join(this.cacheDir,d));c+=p.size}catch{}continue}try{let p=Ou.default.join(this.cacheDir,d),h=await fn.default.stat(p);o.push({path:p,mtimeMs:h.mtimeMs,size:h.size}),c+=h.size}catch{}}let u=o.length+1,f=a(()=>t&&u>this.maxEntries||n&&c>this.maxSizeBytes,"overCap");if(!f())return;o.sort((d,p)=>d.mtimeMs-p.mtimeMs);for(let d of o){if(!f())break;try{await fn.default.remove(d.path),u--,c-=d.size}catch{}}}catch{}}async isCached(e,t){return await this.get(e,t)!==null}async invalidate(e){let t=this.getCacheKey(e),n=this.getCachePath(t);try{await fn.default.remove(n)}catch{}}async clear(){try{if(await fn.default.pathExists(this.cacheDir)){let e=await fn.default.readdir(this.cacheDir);await Promise.all(e.filter(t=>t.endsWith(".json")).map(t=>fn.default.remove(Ou.default.join(this.cacheDir,t))))}}catch{}}async getCacheStats(){try{if(!await fn.default.pathExists(this.cacheDir))return{entryCount:0,totalSizeBytes:0};let t=(await fn.default.readdir(this.cacheDir)).filter(i=>i.endsWith(".json")),n=0;for(let i of t){let s=await fn.default.stat(Ou.default.join(this.cacheDir,i));n+=s.size}return{entryCount:t.length,totalSizeBytes:n}}catch{return{entryCount:0,totalSizeBytes:0}}}getCachePath(e){return Ou.default.join(this.cacheDir,`${e}.json`)}};var rP=Q($o()),nP=Q(require("path")),V8=Q(require("crypto"));async function G8(r){let e=[],t=a(async n=>{let i;try{i=await rP.default.readdir(n,{withFileTypes:!0})}catch{return}for(let s of i){let o=nP.default.join(n,s.name);if(s.isDirectory()){if(s.name===".git"||s.name==="node_modules"||s.name===".exocortex")continue;await t(o)}else if(s.name.endsWith(".md"))try{let c=await rP.default.stat(o);e.push(`${nP.default.relative(r,o)}:${c.mtimeMs}`)}catch{}}},"walk");try{await t(r)}catch{return null}return e.length===0?null:(e.sort(),V8.default.createHash("sha256").update(e.join(`
477
- `)).digest("hex"))}a(G8,"computeVaultSignature");var sp=Q(require("node:process"),1),m7=require("node:util");var q8=a((r=0)=>e=>`\x1B[${e+r}m`,"wrapAnsi16"),W8=a((r=0)=>e=>`\x1B[${38+r};5;${e}m`,"wrapAnsi256"),z8=a((r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,"wrapAnsi16m"),sr={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]}},H$e=Object.keys(sr.modifier),rbe=Object.keys(sr.color),nbe=Object.keys(sr.bgColor),Y$e=[...rbe,...nbe];function ibe(){let r=new Map;for(let[e,t]of Object.entries(sr)){for(let[n,i]of Object.entries(t))sr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=sr[n],r.set(i[0],i[1]);Object.defineProperty(sr,e,{value:t,enumerable:!1})}return Object.defineProperty(sr,"codes",{value:r,enumerable:!1}),sr.color.close="\x1B[39m",sr.bgColor.close="\x1B[49m",sr.color.ansi=q8(),sr.color.ansi256=W8(),sr.color.ansi16m=z8(),sr.bgColor.ansi=q8(10),sr.bgColor.ansi256=W8(10),sr.bgColor.ansi16m=z8(10),Object.defineProperties(sr,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?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(n/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[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>sr.rgbToAnsi256(...sr.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,n)=>sr.ansi256ToAnsi(sr.rgbToAnsi256(e,t,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>sr.ansi256ToAnsi(sr.hexToAnsi256(e)),"value"),enumerable:!1}}),sr}a(ibe,"assembleStyles");var sbe=ibe(),Qs=sbe;var Ww=Q(require("node:process"),1),H8=Q(require("node:os"),1),iP=Q(require("node:tty"),1);function ms(r,e=globalThis.Deno?globalThis.Deno.args:Ww.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}a(ms,"hasFlag");var{env:or}=Ww.default,qw;ms("no-color")||ms("no-colors")||ms("color=false")||ms("color=never")?qw=0:(ms("color")||ms("colors")||ms("color=true")||ms("color=always"))&&(qw=1);function obe(){if("FORCE_COLOR"in or)return or.FORCE_COLOR==="true"?1:or.FORCE_COLOR==="false"?0:or.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(or.FORCE_COLOR,10),3)}a(obe,"envForceColor");function abe(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}a(abe,"translateLevel");function cbe(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=obe();n!==void 0&&(qw=n);let i=t?qw:n;if(i===0)return 0;if(t){if(ms("color=16m")||ms("color=full")||ms("color=truecolor"))return 3;if(ms("color=256"))return 2}if("TF_BUILD"in or&&"AGENT_NAME"in or)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(or.TERM==="dumb")return s;if(Ww.default.platform==="win32"){let o=H8.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in or)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in or)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in or)||or.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in or)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(or.TEAMCITY_VERSION)?1:0;if(or.COLORTERM==="truecolor"||or.TERM==="xterm-kitty"||or.TERM==="xterm-ghostty"||or.TERM==="wezterm")return 3;if("TERM_PROGRAM"in or){let o=Number.parseInt((or.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(or.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(or.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(or.TERM)||"COLORTERM"in or?1:s}a(cbe,"_supportsColor");function K8(r,e={}){let t=cbe(r,{streamIsTTY:r&&r.isTTY,...e});return abe(t)}a(K8,"createSupportsColor");var lbe={stdout:K8({isTTY:iP.default.isatty(1)}),stderr:K8({isTTY:iP.default.isatty(2)})},Y8=lbe;function X8(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}a(X8,"stringReplaceAll");function Q8(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
477
+ `)).digest("hex"))}a(G8,"computeVaultSignature");var sp=Q(require("node:process"),1),m7=require("node:util");var q8=a((r=0)=>e=>`\x1B[${e+r}m`,"wrapAnsi16"),W8=a((r=0)=>e=>`\x1B[${38+r};5;${e}m`,"wrapAnsi256"),z8=a((r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,"wrapAnsi16m"),sr={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]}},Y$e=Object.keys(sr.modifier),rbe=Object.keys(sr.color),nbe=Object.keys(sr.bgColor),X$e=[...rbe,...nbe];function ibe(){let r=new Map;for(let[e,t]of Object.entries(sr)){for(let[n,i]of Object.entries(t))sr[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=sr[n],r.set(i[0],i[1]);Object.defineProperty(sr,e,{value:t,enumerable:!1})}return Object.defineProperty(sr,"codes",{value:r,enumerable:!1}),sr.color.close="\x1B[39m",sr.bgColor.close="\x1B[49m",sr.color.ansi=q8(),sr.color.ansi256=W8(),sr.color.ansi16m=z8(),sr.bgColor.ansi=q8(10),sr.bgColor.ansi256=W8(10),sr.bgColor.ansi16m=z8(10),Object.defineProperties(sr,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?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(n/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[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:a(e=>sr.rgbToAnsi256(...sr.hexToRgb(e)),"value"),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let c=e%36;t=Math.floor(e/36)/5,n=Math.floor(c/6)/5,i=c%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:a((e,t,n)=>sr.ansi256ToAnsi(sr.rgbToAnsi256(e,t,n)),"value"),enumerable:!1},hexToAnsi:{value:a(e=>sr.ansi256ToAnsi(sr.hexToAnsi256(e)),"value"),enumerable:!1}}),sr}a(ibe,"assembleStyles");var sbe=ibe(),Qs=sbe;var Ww=Q(require("node:process"),1),H8=Q(require("node:os"),1),iP=Q(require("node:tty"),1);function ms(r,e=globalThis.Deno?globalThis.Deno.args:Ww.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}a(ms,"hasFlag");var{env:or}=Ww.default,qw;ms("no-color")||ms("no-colors")||ms("color=false")||ms("color=never")?qw=0:(ms("color")||ms("colors")||ms("color=true")||ms("color=always"))&&(qw=1);function obe(){if("FORCE_COLOR"in or)return or.FORCE_COLOR==="true"?1:or.FORCE_COLOR==="false"?0:or.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(or.FORCE_COLOR,10),3)}a(obe,"envForceColor");function abe(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}a(abe,"translateLevel");function cbe(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=obe();n!==void 0&&(qw=n);let i=t?qw:n;if(i===0)return 0;if(t){if(ms("color=16m")||ms("color=full")||ms("color=truecolor"))return 3;if(ms("color=256"))return 2}if("TF_BUILD"in or&&"AGENT_NAME"in or)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(or.TERM==="dumb")return s;if(Ww.default.platform==="win32"){let o=H8.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in or)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in or)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in or)||or.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in or)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(or.TEAMCITY_VERSION)?1:0;if(or.COLORTERM==="truecolor"||or.TERM==="xterm-kitty"||or.TERM==="xterm-ghostty"||or.TERM==="wezterm")return 3;if("TERM_PROGRAM"in or){let o=Number.parseInt((or.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(or.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(or.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(or.TERM)||"COLORTERM"in or?1:s}a(cbe,"_supportsColor");function K8(r,e={}){let t=cbe(r,{streamIsTTY:r&&r.isTTY,...e});return abe(t)}a(K8,"createSupportsColor");var lbe={stdout:K8({isTTY:iP.default.isatty(1)}),stderr:K8({isTTY:iP.default.isatty(2)})},Y8=lbe;function X8(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}a(X8,"stringReplaceAll");function Q8(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
478
478
  `:`
479
479
  `)+t,i=n+1,n=r.indexOf(`
480
480
  `,i)}while(n!==-1);return s+=r.slice(i),s}a(Q8,"stringEncaseCRLFWithFirstIndex");var{stdout:J8,stderr:Z8}=Y8,sP=Symbol("GENERATOR"),rp=Symbol("STYLER"),dg=Symbol("IS_EMPTY"),e7=["ansi","ansi","ansi256","ansi16m"],np=Object.create(null),ube=a((r,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=J8?J8.level:0;r.level=e.level===void 0?t:e.level},"applyOptions");var fbe=a(r=>{let e=a((...t)=>t.join(" "),"chalk");return ube(e,r),Object.setPrototypeOf(e,pg.prototype),e},"chalkFactory");function pg(r){return fbe(r)}a(pg,"createChalk");Object.setPrototypeOf(pg.prototype,Function.prototype);for(let[r,e]of Object.entries(Qs))np[r]={get(){let t=zw(this,aP(e.open,e.close,this[rp]),this[dg]);return Object.defineProperty(this,r,{value:t}),t}};np.visible={get(){let r=zw(this,this[rp],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var oP=a((r,e,t,...n)=>r==="rgb"?e==="ansi16m"?Qs[t].ansi16m(...n):e==="ansi256"?Qs[t].ansi256(Qs.rgbToAnsi256(...n)):Qs[t].ansi(Qs.rgbToAnsi(...n)):r==="hex"?oP("rgb",e,t,...Qs.hexToRgb(...n)):Qs[t][r](...n),"getModelAnsi"),dbe=["rgb","hex","ansi256"];for(let r of dbe){np[r]={get(){let{level:t}=this;return function(...n){let i=aP(oP(r,e7[t],"color",...n),Qs.color.close,this[rp]);return zw(this,i,this[dg])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);np[e]={get(){let{level:t}=this;return function(...n){let i=aP(oP(r,e7[t],"bgColor",...n),Qs.bgColor.close,this[rp]);return zw(this,i,this[dg])}}}}var pbe=Object.defineProperties(()=>{},{...np,level:{enumerable:!0,get(){return this[sP].level},set(r){this[sP].level=r}}}),aP=a((r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},"createStyler"),zw=a((r,e,t)=>{let n=a((...i)=>hbe(n,i.length===1?""+i[0]:i.join(" ")),"builder");return Object.setPrototypeOf(n,pbe),n[sP]=r,n[rp]=e,n[dg]=t,n},"createBuilder"),hbe=a((r,e)=>{if(r.level<=0||!e)return r[dg]?"":e;let t=r[rp];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=X8(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
481
- `);return s!==-1&&(e=Q8(e,i,n,s)),n+e+i},"applyStyle");Object.defineProperties(pg.prototype,np);var mbe=pg(),sje=pg({level:Z8?Z8.level:0});var t7=mbe;var mP=Q(require("node:process"),1);var hg=Q(require("node:process"),1);var gbe=a((r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(r,t),s=Object.getOwnPropertyDescriptor(e,t);!ybe(i,s)&&n||Object.defineProperty(r,t,s)},"copyProperty"),ybe=a(function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},"canCopyProperty"),bbe=a((r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},"changePrototype"),_be=a((r,e)=>`/* Wrapped ${r}*/
482
- ${e}`,"wrappedToString"),Sbe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),wbe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ebe=a((r,e,t)=>{let n=t===""?"":`with ${t.trim()}() `,i=_be.bind(null,n,e.toString());Object.defineProperty(i,"name",wbe);let{writable:s,enumerable:o,configurable:c}=Sbe;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function cP(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:n}=r;for(let i of Reflect.ownKeys(e))gbe(r,e,i,t);return bbe(r,e),Ebe(r,e,n),r}a(cP,"mimicFunction");var Kw=new WeakMap,r7=a((r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",s=a(function(...o){if(Kw.set(s,++n),n===1)t=r.apply(this,o),r=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return cP(s,r),Kw.set(s,n),s},"onetime");r7.callCount=r=>{if(!Kw.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return Kw.get(r)};var n7=r7;var xu=[];xu.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&xu.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&xu.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Hw=a(r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function","processOk"),lP=Symbol.for("signal-exit emitter"),uP=globalThis,vbe=Object.defineProperty.bind(Object),fP=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(uP[lP])return uP[lP];vbe(uP,lP,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],i=n.indexOf(t);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,n)||i),i}},Yw=class{static{a(this,"SignalExitBase")}},Tbe=a(r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),"signalExitWrap"),dP=class extends Yw{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},pP=class extends Yw{static{a(this,"SignalExit")}#t=hP.platform==="win32"?"SIGINT":"SIGHUP";#r=new fP;#n;#e;#i;#a={};#p=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of xu)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:i}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#r.emit("exit",null,t),c=t==="SIGHUP"?this.#t:t;o||e.kill(e.pid,c)}};this.#i=e.reallyExit,this.#e=e.emit}onExit(e,t){if(!Hw(this.#n))return()=>{};this.#p===!1&&this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#p){this.#p=!0,this.#r.count+=1;for(let e of xu)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#u(e)}}unload(){this.#p&&(this.#p=!1,xu.forEach(e=>{let t=this.#a[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#e,this.#n.reallyExit=this.#i,this.#r.count-=1)}#u(e){return Hw(this.#n)?(this.#n.exitCode=e||0,this.#r.emit("exit",this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#e;if(e==="exit"&&Hw(this.#n)){typeof t[0]=="number"&&(this.#n.exitCode=t[0]);let i=n.call(this.#n,e,...t);return this.#r.emit("exit",this.#n.exitCode,null),i}else return n.call(this.#n,e,...t)}},hP=globalThis.process,{onExit:i7,load:mje,unload:gje}=Tbe(Hw(hP)?new pP(hP):new dP);var s7=hg.default.stderr.isTTY?hg.default.stderr:hg.default.stdout.isTTY?hg.default.stdout:void 0,Abe=s7?n7(()=>{i7(()=>{s7.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},o7=Abe;var Xw=!1,ip={};ip.show=(r=mP.default.stderr)=>{r.isTTY&&(Xw=!1,r.write("\x1B[?25h"))};ip.hide=(r=mP.default.stderr)=>{r.isTTY&&(o7(),Xw=!0,r.write("\x1B[?25l"))};ip.toggle=(r,e)=>{r!==void 0&&(Xw=r),Xw?ip.show(e):ip.hide(e)};var gP=ip;var yP={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 mg=yP,Ije=Object.keys(yP);var Pu={};Yu(Pu,{error:()=>Pbe,info:()=>Cbe,success:()=>Obe,warning:()=>xbe});var a7=Q(require("node:tty"),1);var Rbe=a7.default?.WriteStream?.prototype?.hasColors?.()??!1,st=a((r,e)=>{if(!Rbe)return i=>i;let t=`\x1B[${r}m`,n=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(n);if(o===-1)return t+s+n;let c=t,l=0,f=(e===22?n:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+n.length,o=s.indexOf(n,l);return c+=s.slice(l)+n,c}},"format"),Oje=st(0,0),xje=st(1,22),Pje=st(2,22),Fje=st(3,23),Dje=st(4,24),Lje=st(53,55),Nje=st(7,27),kje=st(8,28),Mje=st(9,29),$je=st(30,39),c7=st(31,39),l7=st(32,39),u7=st(33,39),f7=st(34,39),jje=st(35,39),Bje=st(36,39),Uje=st(37,39),Vje=st(90,39),Gje=st(40,49),qje=st(41,49),Wje=st(42,49),zje=st(43,49),Kje=st(44,49),Hje=st(45,49),Yje=st(46,49),Xje=st(47,49),Qje=st(100,49),Jje=st(91,39),Zje=st(92,39),e4e=st(93,39),t4e=st(94,39),r4e=st(95,39),n4e=st(96,39),i4e=st(97,39),s4e=st(101,49),o4e=st(102,49),a4e=st(103,49),c4e=st(104,49),l4e=st(105,49),u4e=st(106,49),f4e=st(107,49);var bP=Q(require("node:process"),1);function gg(){let{env:r}=bP.default,{TERM:e,TERM_PROGRAM:t}=r;return bP.default.platform!=="win32"?e!=="linux":!!r.WT_SESSION||!!r.TERMINUS_SUBLIME||r.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(gg,"isUnicodeSupported");var Qw=gg(),Cbe=f7(Qw?"\u2139":"i"),Obe=l7(Qw?"\u2714":"\u221A"),xbe=u7(Qw?"\u26A0":"\u203C"),Pbe=c7(Qw?"\u2716":"\xD7");function _P({onlyFirst:r=!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,r?void 0:"g")}a(_P,"ansiRegex");var Fbe=_P();function SP(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Fbe,"")}a(SP,"stripAnsi");function d7(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}a(d7,"isAmbiguous");function p7(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}a(p7,"isFullWidth");function h7(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r>=94192&&r<=94198||r>=94208&&r<=101589||r>=101631&&r<=101662||r>=101760&&r<=101874||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128728||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129674||r>=129678&&r<=129734||r===129736||r>=129741&&r<=129756||r>=129759&&r<=129770||r>=129775&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}a(h7,"isWide");function Dbe(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}a(Dbe,"validate");function wP(r,{ambiguousAsWide:e=!1}={}){return Dbe(r),p7(r)||h7(r)||e&&d7(r)?2:1}a(wP,"eastAsianWidth");var Lbe=new Intl.Segmenter,Nbe=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),kbe=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),Mbe=new RegExp("^\\p{RGI_Emoji}$","v");function $be(r){return r.replace(kbe,"")}a($be,"baseVisible");function jbe(r){return Nbe.test(r)}a(jbe,"isZeroWidthCluster");function Bbe(r,e){let t=0;if(r.length>1)for(let n of r.slice(1))n>="\uFF00"&&n<="\uFFEF"&&(t+=wP(n.codePointAt(0),e));return t}a(Bbe,"trailingHalfwidthWidth");function EP(r,e={}){if(typeof r!="string"||r.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:n=!1}=e,i=r;if(n||(i=SP(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of Lbe.segment(i)){if(jbe(c))continue;if(Mbe.test(c)){s+=2;continue}let l=$be(c).codePointAt(0);s+=wP(l,o),s+=Bbe(c,o)}return s}a(EP,"stringWidth");function vP({stream:r=process.stdout}={}){return!!(r&&r.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(vP,"isInteractive");var yg=Q(require("node:process"),1);var Ube=3,TP=class{static{a(this,"StdinDiscarder")}#t=0;#r;#n=!1;#e=!1;#i=a(e=>{if(!e?.length)return;(typeof e=="string"?e.codePointAt(0):e[0])===Ube&&yg.default.kill(yg.default.pid,"SIGINT")},"#handleInputBound");start(){this.#t++,this.#t===1&&this.#a()}stop(){this.#t!==0&&--this.#t===0&&this.#p()}#a(){let{stdin:e}=yg.default;if(yg.default.platform==="win32"||!e?.isTTY||typeof e.setRawMode!="function"){this.#r=void 0;return}this.#r=e,this.#n=e.isPaused(),this.#e=!!e.isRaw,e.setRawMode(!0),e.prependListener("data",this.#i),this.#n&&e.resume()}#p(){if(!this.#r)return;let e=this.#r;e.off("data",this.#i),e.isTTY&&e.setRawMode?.(this.#e),this.#n&&e.pause(),this.#r=void 0,this.#n=!1,this.#e=!1}},Vbe=new TP,AP=Object.freeze(Vbe);var Gbe=200,qbe="\x1B[?2026h",Wbe="\x1B[?2026l",Jw=new Map,zbe=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"]),IP=class{static{a(this,"Ora")}#t=0;#r=-1;#n=0;#e;#i;#a;#p;#u=new Map;#c=!1;#f;#l;#d=!1;#o;#g(e){this.#c=!0;try{return e()}finally{this.#c=!1}}#E(){this.isSpinning&&this.render()}#_(e,t){if(e==null)return"";if(typeof e=="string")return e;if(Buffer.isBuffer(e)||ArrayBuffer.isView(e)){let n=typeof t=="string"&&t&&t!=="buffer"?t:"utf8";return Buffer.from(e).toString(n)}return String(e)}#S(e){if(!e)return!1;let t=e.at(-1);return t===`
481
+ `);return s!==-1&&(e=Q8(e,i,n,s)),n+e+i},"applyStyle");Object.defineProperties(pg.prototype,np);var mbe=pg(),oje=pg({level:Z8?Z8.level:0});var t7=mbe;var mP=Q(require("node:process"),1);var hg=Q(require("node:process"),1);var gbe=a((r,e,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;let i=Object.getOwnPropertyDescriptor(r,t),s=Object.getOwnPropertyDescriptor(e,t);!ybe(i,s)&&n||Object.defineProperty(r,t,s)},"copyProperty"),ybe=a(function(r,e){return r===void 0||r.configurable||r.writable===e.writable&&r.enumerable===e.enumerable&&r.configurable===e.configurable&&(r.writable||r.value===e.value)},"canCopyProperty"),bbe=a((r,e)=>{let t=Object.getPrototypeOf(e);t!==Object.getPrototypeOf(r)&&Object.setPrototypeOf(r,t)},"changePrototype"),_be=a((r,e)=>`/* Wrapped ${r}*/
482
+ ${e}`,"wrappedToString"),Sbe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),wbe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ebe=a((r,e,t)=>{let n=t===""?"":`with ${t.trim()}() `,i=_be.bind(null,n,e.toString());Object.defineProperty(i,"name",wbe);let{writable:s,enumerable:o,configurable:c}=Sbe;Object.defineProperty(r,"toString",{value:i,writable:s,enumerable:o,configurable:c})},"changeToString");function cP(r,e,{ignoreNonConfigurable:t=!1}={}){let{name:n}=r;for(let i of Reflect.ownKeys(e))gbe(r,e,i,t);return bbe(r,e),Ebe(r,e,n),r}a(cP,"mimicFunction");var Kw=new WeakMap,r7=a((r,e={})=>{if(typeof r!="function")throw new TypeError("Expected a function");let t,n=0,i=r.displayName||r.name||"<anonymous>",s=a(function(...o){if(Kw.set(s,++n),n===1)t=r.apply(this,o),r=void 0;else if(e.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return t},"onetime");return cP(s,r),Kw.set(s,n),s},"onetime");r7.callCount=r=>{if(!Kw.has(r))throw new Error(`The given function \`${r.name}\` is not wrapped by the \`onetime\` package`);return Kw.get(r)};var n7=r7;var xu=[];xu.push("SIGHUP","SIGINT","SIGTERM");process.platform!=="win32"&&xu.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&xu.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var Hw=a(r=>!!r&&typeof r=="object"&&typeof r.removeListener=="function"&&typeof r.emit=="function"&&typeof r.reallyExit=="function"&&typeof r.listeners=="function"&&typeof r.kill=="function"&&typeof r.pid=="number"&&typeof r.on=="function","processOk"),lP=Symbol.for("signal-exit emitter"),uP=globalThis,vbe=Object.defineProperty.bind(Object),fP=class{static{a(this,"Emitter")}emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(uP[lP])return uP[lP];vbe(uP,lP,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],i=n.indexOf(t);i!==-1&&(i===0&&n.length===1?n.length=0:n.splice(i,1))}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(let s of this.listeners[e])i=s(t,n)===!0||i;return e==="exit"&&(i=this.emit("afterExit",t,n)||i),i}},Yw=class{static{a(this,"SignalExitBase")}},Tbe=a(r=>({onExit(e,t){return r.onExit(e,t)},load(){return r.load()},unload(){return r.unload()}}),"signalExitWrap"),dP=class extends Yw{static{a(this,"SignalExitFallback")}onExit(){return()=>{}}load(){}unload(){}},pP=class extends Yw{static{a(this,"SignalExit")}#t=hP.platform==="win32"?"SIGINT":"SIGHUP";#r=new fP;#n;#e;#i;#a={};#p=!1;constructor(e){super(),this.#n=e,this.#a={};for(let t of xu)this.#a[t]=()=>{let n=this.#n.listeners(t),{count:i}=this.#r,s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),n.length===i){this.unload();let o=this.#r.emit("exit",null,t),c=t==="SIGHUP"?this.#t:t;o||e.kill(e.pid,c)}};this.#i=e.reallyExit,this.#e=e.emit}onExit(e,t){if(!Hw(this.#n))return()=>{};this.#p===!1&&this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#r.on(n,e),()=>{this.#r.removeListener(n,e),this.#r.listeners.exit.length===0&&this.#r.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#p){this.#p=!0,this.#r.count+=1;for(let e of xu)try{let t=this.#a[e];t&&this.#n.on(e,t)}catch{}this.#n.emit=(e,...t)=>this.#c(e,...t),this.#n.reallyExit=e=>this.#u(e)}}unload(){this.#p&&(this.#p=!1,xu.forEach(e=>{let t=this.#a[e];if(!t)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,t)}catch{}}),this.#n.emit=this.#e,this.#n.reallyExit=this.#i,this.#r.count-=1)}#u(e){return Hw(this.#n)?(this.#n.exitCode=e||0,this.#r.emit("exit",this.#n.exitCode,null),this.#i.call(this.#n,this.#n.exitCode)):0}#c(e,...t){let n=this.#e;if(e==="exit"&&Hw(this.#n)){typeof t[0]=="number"&&(this.#n.exitCode=t[0]);let i=n.call(this.#n,e,...t);return this.#r.emit("exit",this.#n.exitCode,null),i}else return n.call(this.#n,e,...t)}},hP=globalThis.process,{onExit:i7,load:gje,unload:yje}=Tbe(Hw(hP)?new pP(hP):new dP);var s7=hg.default.stderr.isTTY?hg.default.stderr:hg.default.stdout.isTTY?hg.default.stdout:void 0,Abe=s7?n7(()=>{i7(()=>{s7.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},o7=Abe;var Xw=!1,ip={};ip.show=(r=mP.default.stderr)=>{r.isTTY&&(Xw=!1,r.write("\x1B[?25h"))};ip.hide=(r=mP.default.stderr)=>{r.isTTY&&(o7(),Xw=!0,r.write("\x1B[?25l"))};ip.toggle=(r,e)=>{r!==void 0&&(Xw=r),Xw?ip.show(e):ip.hide(e)};var gP=ip;var yP={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 mg=yP,Rje=Object.keys(yP);var Pu={};Yu(Pu,{error:()=>Pbe,info:()=>Cbe,success:()=>Obe,warning:()=>xbe});var a7=Q(require("node:tty"),1);var Rbe=a7.default?.WriteStream?.prototype?.hasColors?.()??!1,st=a((r,e)=>{if(!Rbe)return i=>i;let t=`\x1B[${r}m`,n=`\x1B[${e}m`;return i=>{let s=i+"",o=s.indexOf(n);if(o===-1)return t+s+n;let c=t,l=0,f=(e===22?n:"")+t;for(;o!==-1;)c+=s.slice(l,o)+f,l=o+n.length,o=s.indexOf(n,l);return c+=s.slice(l)+n,c}},"format"),xje=st(0,0),Pje=st(1,22),Fje=st(2,22),Dje=st(3,23),Lje=st(4,24),Nje=st(53,55),kje=st(7,27),Mje=st(8,28),$je=st(9,29),jje=st(30,39),c7=st(31,39),l7=st(32,39),u7=st(33,39),f7=st(34,39),Bje=st(35,39),Uje=st(36,39),Vje=st(37,39),Gje=st(90,39),qje=st(40,49),Wje=st(41,49),zje=st(42,49),Kje=st(43,49),Hje=st(44,49),Yje=st(45,49),Xje=st(46,49),Qje=st(47,49),Jje=st(100,49),Zje=st(91,39),e4e=st(92,39),t4e=st(93,39),r4e=st(94,39),n4e=st(95,39),i4e=st(96,39),s4e=st(97,39),o4e=st(101,49),a4e=st(102,49),c4e=st(103,49),l4e=st(104,49),u4e=st(105,49),f4e=st(106,49),d4e=st(107,49);var bP=Q(require("node:process"),1);function gg(){let{env:r}=bP.default,{TERM:e,TERM_PROGRAM:t}=r;return bP.default.platform!=="win32"?e!=="linux":!!r.WT_SESSION||!!r.TERMINUS_SUBLIME||r.ConEmuTask==="{cmd::Cmder}"||t==="Terminus-Sublime"||t==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||r.TERMINAL_EMULATOR==="JetBrains-JediTerm"}a(gg,"isUnicodeSupported");var Qw=gg(),Cbe=f7(Qw?"\u2139":"i"),Obe=l7(Qw?"\u2714":"\u221A"),xbe=u7(Qw?"\u26A0":"\u203C"),Pbe=c7(Qw?"\u2716":"\xD7");function _P({onlyFirst:r=!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,r?void 0:"g")}a(_P,"ansiRegex");var Fbe=_P();function SP(r){if(typeof r!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof r}\``);return r.replace(Fbe,"")}a(SP,"stripAnsi");function d7(r){return r===161||r===164||r===167||r===168||r===170||r===173||r===174||r>=176&&r<=180||r>=182&&r<=186||r>=188&&r<=191||r===198||r===208||r===215||r===216||r>=222&&r<=225||r===230||r>=232&&r<=234||r===236||r===237||r===240||r===242||r===243||r>=247&&r<=250||r===252||r===254||r===257||r===273||r===275||r===283||r===294||r===295||r===299||r>=305&&r<=307||r===312||r>=319&&r<=322||r===324||r>=328&&r<=331||r===333||r===338||r===339||r===358||r===359||r===363||r===462||r===464||r===466||r===468||r===470||r===472||r===474||r===476||r===593||r===609||r===708||r===711||r>=713&&r<=715||r===717||r===720||r>=728&&r<=731||r===733||r===735||r>=768&&r<=879||r>=913&&r<=929||r>=931&&r<=937||r>=945&&r<=961||r>=963&&r<=969||r===1025||r>=1040&&r<=1103||r===1105||r===8208||r>=8211&&r<=8214||r===8216||r===8217||r===8220||r===8221||r>=8224&&r<=8226||r>=8228&&r<=8231||r===8240||r===8242||r===8243||r===8245||r===8251||r===8254||r===8308||r===8319||r>=8321&&r<=8324||r===8364||r===8451||r===8453||r===8457||r===8467||r===8470||r===8481||r===8482||r===8486||r===8491||r===8531||r===8532||r>=8539&&r<=8542||r>=8544&&r<=8555||r>=8560&&r<=8569||r===8585||r>=8592&&r<=8601||r===8632||r===8633||r===8658||r===8660||r===8679||r===8704||r===8706||r===8707||r===8711||r===8712||r===8715||r===8719||r===8721||r===8725||r===8730||r>=8733&&r<=8736||r===8739||r===8741||r>=8743&&r<=8748||r===8750||r>=8756&&r<=8759||r===8764||r===8765||r===8776||r===8780||r===8786||r===8800||r===8801||r>=8804&&r<=8807||r===8810||r===8811||r===8814||r===8815||r===8834||r===8835||r===8838||r===8839||r===8853||r===8857||r===8869||r===8895||r===8978||r>=9312&&r<=9449||r>=9451&&r<=9547||r>=9552&&r<=9587||r>=9600&&r<=9615||r>=9618&&r<=9621||r===9632||r===9633||r>=9635&&r<=9641||r===9650||r===9651||r===9654||r===9655||r===9660||r===9661||r===9664||r===9665||r>=9670&&r<=9672||r===9675||r>=9678&&r<=9681||r>=9698&&r<=9701||r===9711||r===9733||r===9734||r===9737||r===9742||r===9743||r===9756||r===9758||r===9792||r===9794||r===9824||r===9825||r>=9827&&r<=9829||r>=9831&&r<=9834||r===9836||r===9837||r===9839||r===9886||r===9887||r===9919||r>=9926&&r<=9933||r>=9935&&r<=9939||r>=9941&&r<=9953||r===9955||r===9960||r===9961||r>=9963&&r<=9969||r===9972||r>=9974&&r<=9977||r===9979||r===9980||r===9982||r===9983||r===10045||r>=10102&&r<=10111||r>=11094&&r<=11097||r>=12872&&r<=12879||r>=57344&&r<=63743||r>=65024&&r<=65039||r===65533||r>=127232&&r<=127242||r>=127248&&r<=127277||r>=127280&&r<=127337||r>=127344&&r<=127373||r===127375||r===127376||r>=127387&&r<=127404||r>=917760&&r<=917999||r>=983040&&r<=1048573||r>=1048576&&r<=1114109}a(d7,"isAmbiguous");function p7(r){return r===12288||r>=65281&&r<=65376||r>=65504&&r<=65510}a(p7,"isFullWidth");function h7(r){return r>=4352&&r<=4447||r===8986||r===8987||r===9001||r===9002||r>=9193&&r<=9196||r===9200||r===9203||r===9725||r===9726||r===9748||r===9749||r>=9776&&r<=9783||r>=9800&&r<=9811||r===9855||r>=9866&&r<=9871||r===9875||r===9889||r===9898||r===9899||r===9917||r===9918||r===9924||r===9925||r===9934||r===9940||r===9962||r===9970||r===9971||r===9973||r===9978||r===9981||r===9989||r===9994||r===9995||r===10024||r===10060||r===10062||r>=10067&&r<=10069||r===10071||r>=10133&&r<=10135||r===10160||r===10175||r===11035||r===11036||r===11088||r===11093||r>=11904&&r<=11929||r>=11931&&r<=12019||r>=12032&&r<=12245||r>=12272&&r<=12287||r>=12289&&r<=12350||r>=12353&&r<=12438||r>=12441&&r<=12543||r>=12549&&r<=12591||r>=12593&&r<=12686||r>=12688&&r<=12773||r>=12783&&r<=12830||r>=12832&&r<=12871||r>=12880&&r<=42124||r>=42128&&r<=42182||r>=43360&&r<=43388||r>=44032&&r<=55203||r>=63744&&r<=64255||r>=65040&&r<=65049||r>=65072&&r<=65106||r>=65108&&r<=65126||r>=65128&&r<=65131||r>=94176&&r<=94180||r>=94192&&r<=94198||r>=94208&&r<=101589||r>=101631&&r<=101662||r>=101760&&r<=101874||r>=110576&&r<=110579||r>=110581&&r<=110587||r===110589||r===110590||r>=110592&&r<=110882||r===110898||r>=110928&&r<=110930||r===110933||r>=110948&&r<=110951||r>=110960&&r<=111355||r>=119552&&r<=119638||r>=119648&&r<=119670||r===126980||r===127183||r===127374||r>=127377&&r<=127386||r>=127488&&r<=127490||r>=127504&&r<=127547||r>=127552&&r<=127560||r===127568||r===127569||r>=127584&&r<=127589||r>=127744&&r<=127776||r>=127789&&r<=127797||r>=127799&&r<=127868||r>=127870&&r<=127891||r>=127904&&r<=127946||r>=127951&&r<=127955||r>=127968&&r<=127984||r===127988||r>=127992&&r<=128062||r===128064||r>=128066&&r<=128252||r>=128255&&r<=128317||r>=128331&&r<=128334||r>=128336&&r<=128359||r===128378||r===128405||r===128406||r===128420||r>=128507&&r<=128591||r>=128640&&r<=128709||r===128716||r>=128720&&r<=128722||r>=128725&&r<=128728||r>=128732&&r<=128735||r===128747||r===128748||r>=128756&&r<=128764||r>=128992&&r<=129003||r===129008||r>=129292&&r<=129338||r>=129340&&r<=129349||r>=129351&&r<=129535||r>=129648&&r<=129660||r>=129664&&r<=129674||r>=129678&&r<=129734||r===129736||r>=129741&&r<=129756||r>=129759&&r<=129770||r>=129775&&r<=129784||r>=131072&&r<=196605||r>=196608&&r<=262141}a(h7,"isWide");function Dbe(r){if(!Number.isSafeInteger(r))throw new TypeError(`Expected a code point, got \`${typeof r}\`.`)}a(Dbe,"validate");function wP(r,{ambiguousAsWide:e=!1}={}){return Dbe(r),p7(r)||h7(r)||e&&d7(r)?2:1}a(wP,"eastAsianWidth");var Lbe=new Intl.Segmenter,Nbe=new RegExp("^(?:\\p{Default_Ignorable_Code_Point}|\\p{Control}|\\p{Mark}|\\p{Surrogate})+$","v"),kbe=new RegExp("^[\\p{Default_Ignorable_Code_Point}\\p{Control}\\p{Format}\\p{Mark}\\p{Surrogate}]+","v"),Mbe=new RegExp("^\\p{RGI_Emoji}$","v");function $be(r){return r.replace(kbe,"")}a($be,"baseVisible");function jbe(r){return Nbe.test(r)}a(jbe,"isZeroWidthCluster");function Bbe(r,e){let t=0;if(r.length>1)for(let n of r.slice(1))n>="\uFF00"&&n<="\uFFEF"&&(t+=wP(n.codePointAt(0),e));return t}a(Bbe,"trailingHalfwidthWidth");function EP(r,e={}){if(typeof r!="string"||r.length===0)return 0;let{ambiguousIsNarrow:t=!0,countAnsiEscapeCodes:n=!1}=e,i=r;if(n||(i=SP(i)),i.length===0)return 0;let s=0,o={ambiguousAsWide:!t};for(let{segment:c}of Lbe.segment(i)){if(jbe(c))continue;if(Mbe.test(c)){s+=2;continue}let l=$be(c).codePointAt(0);s+=wP(l,o),s+=Bbe(c,o)}return s}a(EP,"stringWidth");function vP({stream:r=process.stdout}={}){return!!(r&&r.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}a(vP,"isInteractive");var yg=Q(require("node:process"),1);var Ube=3,TP=class{static{a(this,"StdinDiscarder")}#t=0;#r;#n=!1;#e=!1;#i=a(e=>{if(!e?.length)return;(typeof e=="string"?e.codePointAt(0):e[0])===Ube&&yg.default.kill(yg.default.pid,"SIGINT")},"#handleInputBound");start(){this.#t++,this.#t===1&&this.#a()}stop(){this.#t!==0&&--this.#t===0&&this.#p()}#a(){let{stdin:e}=yg.default;if(yg.default.platform==="win32"||!e?.isTTY||typeof e.setRawMode!="function"){this.#r=void 0;return}this.#r=e,this.#n=e.isPaused(),this.#e=!!e.isRaw,e.setRawMode(!0),e.prependListener("data",this.#i),this.#n&&e.resume()}#p(){if(!this.#r)return;let e=this.#r;e.off("data",this.#i),e.isTTY&&e.setRawMode?.(this.#e),this.#n&&e.pause(),this.#r=void 0,this.#n=!1,this.#e=!1}},Vbe=new TP,AP=Object.freeze(Vbe);var Gbe=200,qbe="\x1B[?2026h",Wbe="\x1B[?2026l",Jw=new Map,zbe=new Set(["black","red","green","yellow","blue","magenta","cyan","white","gray"]),IP=class{static{a(this,"Ora")}#t=0;#r=-1;#n=0;#e;#i;#a;#p;#u=new Map;#c=!1;#f;#l;#d=!1;#o;#g(e){this.#c=!0;try{return e()}finally{this.#c=!1}}#E(){this.isSpinning&&this.render()}#_(e,t){if(e==null)return"";if(typeof e=="string")return e;if(Buffer.isBuffer(e)||ArrayBuffer.isView(e)){let n=typeof t=="string"&&t&&t!=="buffer"?t:"utf8";return Buffer.from(e).toString(n)}return String(e)}#S(e){if(!e)return!1;let t=e.at(-1);return t===`
483
483
  `||t==="\r"}#A(){this.#l||(this.#l=setTimeout(()=>{this.#l=void 0,this.isSpinning&&this.#E()},Gbe),typeof this.#l?.unref=="function"&&this.#l.unref())}#y(){this.#l&&(clearTimeout(this.#l),this.#l=void 0)}#v(e,t,n,i){let s=this.#m(n," "),c=typeof t=="string"?(e?" ":"")+t:"",l=this.#b(i," ");return s+e+c+l}constructor(e){if(typeof e=="string"&&(e={text:e}),this.#e={color:"cyan",stream:sp.default.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#e.color,this.#a=this.#e.stream,typeof this.#e.isEnabled!="boolean"&&(this.#e.isEnabled=vP({stream:this.#a})),typeof this.#e.isSilent!="boolean"&&(this.#e.isSilent=!1),this.#e.interval!==void 0&&!(Number.isInteger(this.#e.interval)&&this.#e.interval>0))throw new Error("The `interval` option must be a positive integer");let t=this.#e.interval;this.spinner=this.#e.spinner,this.#e.interval=t,this.text=this.#e.text,this.prefixText=this.#e.prefixText,this.suffixText=this.#e.suffixText,this.indent=this.#e.indent,sp.default.env.NODE_ENV==="test"&&(this._stream=this.#a,this._isEnabled=this.#e.isEnabled,Object.defineProperty(this,"_linesToClear",{get(){return this.#t},set(n){this.#t=n}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#r}}),Object.defineProperty(this,"_lineCount",{get(){let n=this.#a.columns??80,i=typeof this.#e.prefixText=="function"?"":this.#e.prefixText,s=typeof this.#e.suffixText=="function"?"":this.#e.suffixText,o=typeof i=="string"&&i!==""?i+" ":"",c=typeof s=="string"&&s!==""?" "+s:"",u=" ".repeat(this.#e.indent)+o+"-"+(typeof this.#e.text=="string"?" "+this.#e.text:"")+c;return this.#w(u,n)}}))}get indent(){return this.#e.indent}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.#e.indent=e}get interval(){return this.#e.interval??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#r=-1,this.#e.interval=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.#i=e}else if(!gg())this.#i=mg.line;else if(e===void 0)this.#i=mg.dots;else if(e!=="default"&&mg[e])this.#i=mg[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.#e.text}set text(e=""){this.#e.text=e}get prefixText(){return this.#e.prefixText}set prefixText(e=""){this.#e.prefixText=e}get suffixText(){return this.#e.suffixText}set suffixText(e=""){this.#e.suffixText=e}get isSpinning(){return this.#p!==void 0}#T(e,t,n=!1){let i=typeof e=="function"?e():e;return typeof i=="string"&&i!==""?n?t+i:i+t:""}#m(e=this.#e.prefixText,t=" "){return this.#T(e,t,!1)}#b(e=this.#e.suffixText,t=" "){return this.#T(e,t,!0)}#w(e,t){let n=0;for(let i of(0,m7.stripVTControlCharacters)(e).split(`
484
484
  `))n+=Math.max(1,Math.ceil(EP(i)/t));return n}get color(){return this.#o}set color(e){if(e!==void 0&&e!==!1&&!zbe.has(e))throw new Error("The `color` option must be a valid color or `false` to disable");this.#o=e}get isEnabled(){return this.#e.isEnabled&&!this.#e.isSilent}set isEnabled(e){if(typeof e!="boolean")throw new TypeError("The `isEnabled` option must be a boolean");this.#e.isEnabled=e}get isSilent(){return this.#e.isSilent}set isSilent(e){if(typeof e!="boolean")throw new TypeError("The `isSilent` option must be a boolean");this.#e.isSilent=e}frame(){let e=Date.now();(this.#r===-1||e-this.#n>=this.interval)&&(this.#r=(this.#r+1)%this.#i.frames.length,this.#n=e);let{frames:t}=this.#i,n=t[this.#r];this.#o&&(n=t7[this.#o](n));let i=this.#m(this.#e.prefixText," "),s=typeof this.text=="string"?" "+this.text:"",o=this.#b(this.#e.suffixText," ");return i+n+s+o}clear(){return!this.isEnabled||!this.#a.isTTY?this:(this.#g(()=>{this.#a.cursorTo(0);for(let e=0;e<this.#t;e++)e>0&&this.#a.moveCursor(0,-1),this.#a.clearLine(1);this.#e.indent&&this.#a.cursorTo(this.#e.indent)}),this.#t=0,this)}#R(e){if(!e||this.#u.has(e)||!e.isTTY||typeof e.write!="function")return;Jw.has(e)&&console.warn("[ora] Multiple concurrent spinners detected. This may cause visual corruption. Use one spinner at a time.");let t=e.write;this.#u.set(e,t),Jw.set(e,this),e.write=(n,i,s)=>this.#x(e,t,n,i,s)}#s(){if(!this.isEnabled||this.#u.size>0)return;let e=new Set([this.#a,sp.default.stdout,sp.default.stderr]);for(let t of e)this.#R(t)}#O(){for(let[e,t]of this.#u)e.write=t,Jw.get(e)===this&&Jw.delete(e);this.#u.clear()}#x(e,t,n,i,s){if(typeof i=="function"&&(s=i,i=void 0),this.#c)return t.call(e,n,i,s);this.clear();let o=this.#_(n,i),c=this.#S(o),l=t.call(e,n,i,s);return c?this.#y():o.length>0&&this.#A(),this.isSpinning&&!this.#l&&this.render(),l}render(){if(!this.isEnabled||this.#f||this.#l)return this;let e=this.#a.isTTY,t=!1;try{e&&(this.#g(()=>this.#a.write(qbe)),t=!0),this.clear();let n=this.frame(),i=this.#a.columns??80,s=this.#w(n,i),o=this.#a.rows;if(o&&o>1&&s>o){let l=n.split(`
485
485
  `),u=o-1;n=[...l.slice(0,u),"... (content truncated to fit terminal)"].join(`
@@ -605,7 +605,7 @@ ${_.content}--- END PREVIEW ---
605
605
  `+S.map(E=>` - ${E.path}
606
606
  `).join("")),await Ig(5);return}process.stdout.write(JSON.stringify(S)+`
607
607
  `),await Ig(0)}catch(t){if(t instanceof il){process.stderr.write(`\u274C create-batch: ${t.message}
608
- `),await Ig(2);return}le.handle(t)}})}a(RV,"createBatchCommand");function AV(r,e,t){return new sl.GenericAssetCreationService(r).withDeterminism({uidGenerator:{next:a(()=>e,"next")},clock:{now:a(()=>new Date(t.getTime()),"now")}})}a(AV,"pinnedService");ut();var no=require("path"),hp=require("fs"),zo=Q(Pe());_t();Nt();var Cg=Q(Pe());var ol="Asia/Almaty",Za="exo__Asset_updatedAt";var aF={ems__Effort_status:{commands:["mark-done","move-to-backlog","rollback-to-backlog","start-effort","set-draft-status"]},ems__Task_zone:{commands:["set-criticality-high","set-criticality-medium","set-criticality-low"]},ems__Effort_parent:{commands:["set-parent"],argSuffix:`--input '{"parent":"<uid>"}'`},exo__Asset_label:{commands:["set-label"],argSuffix:`--input '{"label":"<text>"}'`},exo__Instance_class:{commands:["convert-to-task","convert-to-project","append-instance-class","replace-instance-class"],note:`reclassing is a semantic operation with a precondition; append/replace take --input '{"class":"[[<uid>]]"}' \u2014 append ADDS a second class (dual-type deprecation), the others replace`},ems__Effort_startTimestamp:{commands:["start-effort","rollback-to-backlog","park-waiting"],clearedBy:["rollback-to-backlog","park-waiting"],note:"start-effort sets it; the others clear it as a side effect of the status change"},ems__Effort_endTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_resolutionTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_plannedStartTimestamp:{commands:["set-planned-start","plan-on-today","plan-for-evening","shift-day-forward","shift-day-backward"]},ems__Effort_plannedEndTimestamp:{commands:["set-planned-end"]},ems__Effort_scheduledDate:{commands:["set-scheduled-date"]},ems__Effort_votes:{commands:["vote-on-effort"]},archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]},exo__Asset_archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]}};function Og(r){return Object.prototype.hasOwnProperty.call(aF,r)?aF[r]:void 0}a(Og,"guardedRouteFor");function PE(r,e){if(e.size===0)return cF(r);let t=r.commands.filter(n=>e.has(n));return t.length===0?`apply ${r.commands.join("|")} <path> (\u26D4 none of these resolve in this vault \u2014 the owning assetspace looks unmounted)`:cF({...r,commands:t})}a(PE,"renderGuardedRouteResolved");function cF(r){let e=`apply ${r.commands.join("|")} <path>`,t=r.argSuffix?`${e} ${r.argSuffix}`:e;return r.note?`${t} (${r.note})`:t}a(cF,"renderGuardedRoute");var U5e=Object.fromEntries(Object.entries(aF).map(([r,e])=>[r,cF(e)])),FE={exo__Asset_uid:"the asset identity \u2014 changing it breaks UID-canon filenames and every inbound [[uid]] wikilink",[Za]:"auto-managed (bumped on every mutation)"};function CV(r){let e=Og(r);if(e===void 0)return;let t=e.clearedBy??[];if(t.length===0)return;let{note:n,...i}=e;return{...i,commands:t}}a(CV,"clearingRouteFor");function OV(r){return`Refusing to remove "${r}" via remove-property \u2014 it is guarded, and no dedicated command clears it (the ones that own it assign a value). If dropping the facet is intended, say so explicitly: --force --reason "<why>"`}a(OV,"renderNoClearingPathRefusal");function DE(r,e,t,n){return`Refusing to ${r} "${t}" via ${e} \u2014 it has a dedicated guarded command so the state machine / precondition is not bypassed. Use: exocortex ${n} --vault <v>`}a(DE,"renderGuardRefusal");function LE(r,e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}a(LE,"guardedReason");function al(r,e){let n=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),i=a(s=>n.find(o=>o.type===s)?.value??"00","get");return`${i("year")}-${i("month")}-${i("day")}T${i("hour")}:${i("minute")}:${i("second")}`}a(al,"stampTimestamp");var JSe=/^\s*exocmd__Command_cliName:\s*(.+?)\s*$/gm;function ZSe(r){let e=r.trim();return e.length>=2&&(e[0]==='"'||e[0]==="'")&&e[e.length-1]===e[0]?e.slice(1,-1).trim():e}a(ZSe,"unquote");var pp=class{constructor(e){this.vaultPath=e}static{a(this,"CommandNameRegistry")}async collect(){if(this.cache)return this.cache;let{readdir:e,readFile:t}=await import("fs/promises"),n=new Set,i=a(async s=>{let o;try{o=await e(s,{withFileTypes:!0})}catch{return}for(let c of o){let l=`${s}/${c.name}`;if(c.isDirectory()){if(c.name===".git"||c.name==="node_modules")continue;await i(l)}else if(c.isFile()&&c.name.endsWith(".md")){let u;try{u=await t(l,"utf-8")}catch{continue}for(let f of u.matchAll(JSe)){let d=ZSe(f[1]);d&&n.add(d)}}}},"walk");return await i(this.vaultPath),this.cache=n,n}};var xV="exo__Asset_isDefinedBy";function ewe(r){let e=a(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean","isScalar");if(e(r)||Array.isArray(r)&&r.every(e))return;let t=r===null?"null":Array.isArray(r)?"an array with non-scalar elements":typeof r;throw new Error(`--input.value must be a scalar (string/number/boolean) or an array of scalars, not ${t}`)}a(ewe,"assertScalarOrScalarArray");function twe(r,e){let t=(0,zo.emptyPropertyValueForm)(e);if(t!==void 0)throw new Error(`Refusing to set "${r}" to an EMPTY value \u2014 ${t} rather than clearing the property. To delete it use: exocortex remove-property <path> --property ${r} --vault <v>`)}a(twe,"assertNonEmptyValue");function rwe(r){let e=r.input!==void 0,t=r.property!==void 0;if(e&&t)throw new Qe("Pass --input OR --property/--value, not both.",`set-property <path> --input '{"property":"<name>","value":<v>}'`);if(e){let n;try{n=JSON.parse(r.input)}catch(o){let c=o instanceof Error?o.message:String(o);throw new Error(`--input: invalid JSON (${c})`)}if(typeof n!="object"||n===null||Array.isArray(n))throw new Error('--input must be a JSON object of the form {"property":"<name>","value":<v>}');let i=n,s=i.property;if(typeof s!="string"||s.trim().length===0)throw new Error("--input.property must be a non-empty string");if(!("value"in i))throw new Error("--input.value is required");return{property:s.trim(),value:i.value}}if(t){if(r.value===void 0)throw new Error("--property requires --value (or use --input for a typed/array value)");return{property:r.property.trim(),value:r.value}}throw new Qe("No property provided.",`set-property <path> --input '{"property":"<name>","value":<v>}' OR set-property <path> --property <name> --value <string>`)}a(rwe,"resolvePropertyAndValue");function nwe(r,e,t){let n=zo.STRING_SCALAR_PROPERTIES.has(e);return Array.isArray(r)?r.map(i=>(0,zo.serializeYamlScalar)(i,n,t)):(0,zo.serializeYamlScalar)(r,n,t)}a(nwe,"serializeForWrite");function PV(){return new de("set-property").description("Set an arbitrary non-guarded frontmatter property on an existing vault asset (bumps exo__Asset_updatedAt only when the value actually changed; a no-op leaves the file byte-identical). Refuses state-machine-guarded properties (status/zone/parent/label/fact-timestamps) \u2014 those keep their dedicated `apply` commands. Issues #3795 / #3848.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>",'JSON {"property":"<name>","value":<v>} \u2014 value is JSON-typed (boolean/number/string/array). Primary form.').option("--property <name>","Property name (string-value convenience form; pair with --value; use --input for boolean/number/array values)").option("--value <value>","Property value as a string (pair with --property; use --input for typed/array values)").option("--skip-wikilink-validation","Skip [[...]] wikilink existence validation").option("--timezone <tz>","Timezone for the exo__Asset_updatedAt bump (defaults to Asia/Almaty)").option("--frozen-clock <iso>","Freeze the updatedAt clock to an ISO timestamp for test/replay").option("--dry-run","Preview the resulting frontmatter without writing").option("--yes","Accepted for symmetry with the apply/create subcommands (set-property is non-interactive; no-op)").action(async(r,e)=>{Wo();try{let t=(0,no.resolve)(e.vault);if(!(0,hp.existsSync)(t))throw new Fe(t);let n=(0,no.resolve)(t,r),i=(0,no.relative)(t,n);if(i===".."||i.startsWith(`..${no.sep}`)||(0,no.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,hp.readFileSync)(n,"utf-8")}catch(w){throw w.code==="ENOENT"?new Error(`Target file not found: ${r}`):w}if(!/^\s*exo__Asset_uid:/m.test(s))throw new Error(`Not a vault asset (no exo__Asset_uid): ${i}. set-property only mutates existing assets.`);let{property:o,value:c}=rwe(e),l=zo.FrontmatterService.normalizeIRI(o),u=LE(FE,l);if(u!==void 0)throw new Error(`Refusing to set "${l}" \u2014 ${u}.`);let f=Og(l);if(f!==void 0){let w=await new pp(t).collect();throw new Error(DE("set","set-property",l,PE(f,w)))}let d=new nl(t,{warn:a(w=>process.stderr.write(`\u26A0 ${w}
608
+ `),await Ig(2);return}le.handle(t)}})}a(RV,"createBatchCommand");function AV(r,e,t){return new sl.GenericAssetCreationService(r).withDeterminism({uidGenerator:{next:a(()=>e,"next")},clock:{now:a(()=>new Date(t.getTime()),"now")}})}a(AV,"pinnedService");ut();var no=require("path"),hp=require("fs"),zo=Q(Pe());_t();Nt();var Cg=Q(Pe());var ol="Asia/Almaty",Za="exo__Asset_updatedAt";var aF={ems__Effort_status:{commands:["mark-done","move-to-backlog","rollback-to-backlog","start-effort","set-draft-status"]},ems__Task_zone:{commands:["set-criticality-high","set-criticality-medium","set-criticality-low"]},ems__Effort_parent:{commands:["set-parent"],argSuffix:`--input '{"parent":"<uid>"}'`},exo__Asset_label:{commands:["set-label"],argSuffix:`--input '{"label":"<text>"}'`},exo__Instance_class:{commands:["convert-to-task","convert-to-project","append-instance-class","replace-instance-class"],note:`reclassing is a semantic operation with a precondition; append/replace take --input '{"class":"[[<uid>]]"}' \u2014 append ADDS a second class (dual-type deprecation), the others replace`},ems__Effort_startTimestamp:{commands:["start-effort","rollback-to-backlog","park-waiting"],clearedBy:["rollback-to-backlog","park-waiting"],note:"start-effort sets it; the others clear it as a side effect of the status change"},ems__Effort_endTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_resolutionTimestamp:{commands:["mark-done","re-open"],clearedBy:["re-open"],note:"mark-done sets it; re-open clears it as a side effect of the status change"},ems__Effort_plannedStartTimestamp:{commands:["set-planned-start","plan-on-today","plan-for-evening","shift-day-forward","shift-day-backward"]},ems__Effort_plannedEndTimestamp:{commands:["set-planned-end"]},ems__Effort_scheduledDate:{commands:["set-scheduled-date"]},ems__Effort_votes:{commands:["vote-on-effort"]},archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]},exo__Asset_archived:{commands:["archive","archive-ontologically","un-archive"],clearedBy:["un-archive"]}};function Og(r){return Object.prototype.hasOwnProperty.call(aF,r)?aF[r]:void 0}a(Og,"guardedRouteFor");function PE(r,e){if(e.size===0)return cF(r);let t=r.commands.filter(n=>e.has(n));return t.length===0?`apply ${r.commands.join("|")} <path> (\u26D4 none of these resolve in this vault \u2014 the owning assetspace looks unmounted)`:cF({...r,commands:t})}a(PE,"renderGuardedRouteResolved");function cF(r){let e=`apply ${r.commands.join("|")} <path>`,t=r.argSuffix?`${e} ${r.argSuffix}`:e;return r.note?`${t} (${r.note})`:t}a(cF,"renderGuardedRoute");var V5e=Object.fromEntries(Object.entries(aF).map(([r,e])=>[r,cF(e)])),FE={exo__Asset_uid:"the asset identity \u2014 changing it breaks UID-canon filenames and every inbound [[uid]] wikilink",[Za]:"auto-managed (bumped on every mutation)"};function CV(r){let e=Og(r);if(e===void 0)return;let t=e.clearedBy??[];if(t.length===0)return;let{note:n,...i}=e;return{...i,commands:t}}a(CV,"clearingRouteFor");function OV(r){return`Refusing to remove "${r}" via remove-property \u2014 it is guarded, and no dedicated command clears it (the ones that own it assign a value). If dropping the facet is intended, say so explicitly: --force --reason "<why>"`}a(OV,"renderNoClearingPathRefusal");function DE(r,e,t,n){return`Refusing to ${r} "${t}" via ${e} \u2014 it has a dedicated guarded command so the state machine / precondition is not bypassed. Use: exocortex ${n} --vault <v>`}a(DE,"renderGuardRefusal");function LE(r,e){return Object.prototype.hasOwnProperty.call(r,e)?r[e]:void 0}a(LE,"guardedReason");function al(r,e){let n=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(r),i=a(s=>n.find(o=>o.type===s)?.value??"00","get");return`${i("year")}-${i("month")}-${i("day")}T${i("hour")}:${i("minute")}:${i("second")}`}a(al,"stampTimestamp");var JSe=/^\s*exocmd__Command_cliName:\s*(.+?)\s*$/gm;function ZSe(r){let e=r.trim();return e.length>=2&&(e[0]==='"'||e[0]==="'")&&e[e.length-1]===e[0]?e.slice(1,-1).trim():e}a(ZSe,"unquote");var pp=class{constructor(e){this.vaultPath=e}static{a(this,"CommandNameRegistry")}async collect(){if(this.cache)return this.cache;let{readdir:e,readFile:t}=await import("fs/promises"),n=new Set,i=a(async s=>{let o;try{o=await e(s,{withFileTypes:!0})}catch{return}for(let c of o){let l=`${s}/${c.name}`;if(c.isDirectory()){if(c.name===".git"||c.name==="node_modules")continue;await i(l)}else if(c.isFile()&&c.name.endsWith(".md")){let u;try{u=await t(l,"utf-8")}catch{continue}for(let f of u.matchAll(JSe)){let d=ZSe(f[1]);d&&n.add(d)}}}},"walk");return await i(this.vaultPath),this.cache=n,n}};var xV="exo__Asset_isDefinedBy";function ewe(r){let e=a(n=>typeof n=="string"||typeof n=="number"||typeof n=="boolean","isScalar");if(e(r)||Array.isArray(r)&&r.every(e))return;let t=r===null?"null":Array.isArray(r)?"an array with non-scalar elements":typeof r;throw new Error(`--input.value must be a scalar (string/number/boolean) or an array of scalars, not ${t}`)}a(ewe,"assertScalarOrScalarArray");function twe(r,e){let t=(0,zo.emptyPropertyValueForm)(e);if(t!==void 0)throw new Error(`Refusing to set "${r}" to an EMPTY value \u2014 ${t} rather than clearing the property. To delete it use: exocortex remove-property <path> --property ${r} --vault <v>`)}a(twe,"assertNonEmptyValue");function rwe(r){let e=r.input!==void 0,t=r.property!==void 0;if(e&&t)throw new Qe("Pass --input OR --property/--value, not both.",`set-property <path> --input '{"property":"<name>","value":<v>}'`);if(e){let n;try{n=JSON.parse(r.input)}catch(o){let c=o instanceof Error?o.message:String(o);throw new Error(`--input: invalid JSON (${c})`)}if(typeof n!="object"||n===null||Array.isArray(n))throw new Error('--input must be a JSON object of the form {"property":"<name>","value":<v>}');let i=n,s=i.property;if(typeof s!="string"||s.trim().length===0)throw new Error("--input.property must be a non-empty string");if(!("value"in i))throw new Error("--input.value is required");return{property:s.trim(),value:i.value}}if(t){if(r.value===void 0)throw new Error("--property requires --value (or use --input for a typed/array value)");return{property:r.property.trim(),value:r.value}}throw new Qe("No property provided.",`set-property <path> --input '{"property":"<name>","value":<v>}' OR set-property <path> --property <name> --value <string>`)}a(rwe,"resolvePropertyAndValue");function nwe(r,e,t){let n=zo.STRING_SCALAR_PROPERTIES.has(e);return Array.isArray(r)?r.map(i=>(0,zo.serializeYamlScalar)(i,n,t)):(0,zo.serializeYamlScalar)(r,n,t)}a(nwe,"serializeForWrite");function PV(){return new de("set-property").description("Set an arbitrary non-guarded frontmatter property on an existing vault asset (bumps exo__Asset_updatedAt only when the value actually changed; a no-op leaves the file byte-identical). Refuses state-machine-guarded properties (status/zone/parent/label/fact-timestamps) \u2014 those keep their dedicated `apply` commands. Issues #3795 / #3848.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--input <json>",'JSON {"property":"<name>","value":<v>} \u2014 value is JSON-typed (boolean/number/string/array). Primary form.').option("--property <name>","Property name (string-value convenience form; pair with --value; use --input for boolean/number/array values)").option("--value <value>","Property value as a string (pair with --property; use --input for typed/array values)").option("--skip-wikilink-validation","Skip [[...]] wikilink existence validation").option("--timezone <tz>","Timezone for the exo__Asset_updatedAt bump (defaults to Asia/Almaty)").option("--frozen-clock <iso>","Freeze the updatedAt clock to an ISO timestamp for test/replay").option("--dry-run","Preview the resulting frontmatter without writing").option("--yes","Accepted for symmetry with the apply/create subcommands (set-property is non-interactive; no-op)").action(async(r,e)=>{Wo();try{let t=(0,no.resolve)(e.vault);if(!(0,hp.existsSync)(t))throw new Fe(t);let n=(0,no.resolve)(t,r),i=(0,no.relative)(t,n);if(i===".."||i.startsWith(`..${no.sep}`)||(0,no.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,hp.readFileSync)(n,"utf-8")}catch(w){throw w.code==="ENOENT"?new Error(`Target file not found: ${r}`):w}if(!/^\s*exo__Asset_uid:/m.test(s))throw new Error(`Not a vault asset (no exo__Asset_uid): ${i}. set-property only mutates existing assets.`);let{property:o,value:c}=rwe(e),l=zo.FrontmatterService.normalizeIRI(o),u=LE(FE,l);if(u!==void 0)throw new Error(`Refusing to set "${l}" \u2014 ${u}.`);let f=Og(l);if(f!==void 0){let w=await new pp(t).collect();throw new Error(DE("set","set-property",l,PE(f,w)))}let d=new nl(t,{warn:a(w=>process.stderr.write(`\u26A0 ${w}
609
609
  `),"warn")});if(await d.validate([l]),ewe(c),twe(o,c),!e.skipWikilinkValidation){let w=new rl(new Yn(t)),R=Array.isArray(c)?c:[c];for(let O of R)typeof O=="string"&&await w.validateValue(O)}l===xV&&await OE(c,new Yn(t),i,"set-property");let p=new zo.FrontmatterService,h=(0,Cg.canonicalYamlKey)(l),g=await d.declaredRange(l),m=p.updateProperty(s,h,nwe(c,h,g)),b=m!==s,S=m,_;if(b){let w=e.frozenClock?new Date(e.frozenClock):new Date,R=e.timezone??ol;_=al(w,R),S=p.updateProperty(m,Za,_)}let A;if(l===xV){let w=Array.isArray(c)?c[0]:c,R=await fV(new Yn(t),w);if(R!==null){let O=(0,no.dirname)(i),P=O==="."?"":O;P!==R&&(A=`\u26A0 co-location: exo__Asset_isDefinedBy now points at "${R||"<vault root>"}" but the file is in "${P||"<vault root>"}". Move it to match: exocortex apply repair-folder ${i} --vault <v>`)}}e.dryRun?process.stderr.write(`--- DRY RUN PREVIEW ---
610
610
  ${S}
611
611
  --- END PREVIEW ---
@@ -630,43 +630,43 @@ ${m}
630
630
  `,o=n.split(/\r?\n/),c=[];for(let g of o){let m=cwe.exec(g);m?c.push({key:m[1],lines:[g]}):c.length>0?c[c.length-1].lines.push(g):c.push({key:null,lines:[g]})}let l=new Map,u=new Map;c.forEach((g,m)=>{g.key!==null&&(l.set(g.key,(l.get(g.key)??0)+1),u.set(g.key,m))});let f=new Map,d=c.filter((g,m)=>g.key===null||(l.get(g.key)??0)<=1||m===u.get(g.key)?!0:(f.set(g.key,(f.get(g.key)??0)+1),!1));if(f.size===0)return{changed:!1,content:r,removed:[]};let p=d.map(g=>g.lines.join(s)).join(s);return{changed:!0,content:`${t}${p}${i}`+r.slice(e[0].length),removed:[...f.entries()].map(([g,m])=>({key:g,removedOccurrences:m}))}}a(lwe,"dedupeFrontmatterKeys");function uwe(r,e){let t=a(c=>{let l=c.match(/^---\r?\n([\s\S]*?)\r?\n---/);return l?l[1].split(/\r?\n/):[]},"block"),n=t(r),i=t(e),s=new Set(i),o=new Set(n);return[...n.filter(c=>!s.has(c)).map(c=>`- ${c}`),...i.filter(c=>!o.has(c)).map(c=>`+ ${c}`)]}a(uwe,"frontmatterLineDiff");function NV(){return new de("repair-frontmatter").description("Remove duplicated top-level YAML frontmatter keys (keep-last) \u2014 the dogfood-clean repair for the invisible/unrepairable duplicate-key class (#3800). Operates on raw text, so it fixes a file the parser itself cannot read. With --canonicalize-keys also rewrites legacy physical keys to their TBox-declared spelling (bare `archived:` \u2192 `exo__Asset_archived:`, req 960d7a3f) and bumps exo__Asset_updatedAt.").argument("<path>","Vault-relative path to the target asset").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview the dedupe diff without writing").option("--canonicalize-keys","Rewrite legacy physical keys to their canonical spelling (bare `archived:` \u2192 `exo__Asset_archived:`); value preserved, exo__Asset_updatedAt bumped; idempotent").option("--timezone <tz>","Timezone for the exo__Asset_updatedAt bump (defaults to Asia/Almaty)").option("--frozen-clock <iso>","Freeze the updatedAt clock to an ISO timestamp for test/replay").option("--yes","Accepted for symmetry with the apply/create subcommands (repair-frontmatter is non-interactive; no-op)").action(async(r,e)=>{try{let t=(0,nc.resolve)(e.vault);if(!(0,gp.existsSync)(t))throw new Fe(t);let n=(0,nc.resolve)(t,r),i=(0,nc.relative)(t,n);if(i===".."||i.startsWith(`..${nc.sep}`)||(0,nc.isAbsolute)(i))throw new Error(`Target is outside the vault: ${r} (vault: ${t})`);let s;try{s=(0,gp.readFileSync)(n,"utf-8")}catch(d){throw d.code==="ENOENT"?new Error(`Target file not found: ${r}`):d}let o=lwe(s),c=o.content,l=[],u;if(e.canonicalizeKeys){let d=awe(c);if(l=d.canonicalized,d.changed){let p=e.frozenClock?new Date(e.frozenClock):new Date;u=al(p,e.timezone??ol),c=new xg.FrontmatterService().updateProperty(d.content,Za,u)}}if(!(o.changed||l.length>0)){process.stdout.write(JSON.stringify({path:i,changed:!1,dryRun:!!e.dryRun,removed:[],...e.canonicalizeKeys?{canonicalized:[]}:{}})+`
631
631
  `);return}e.dryRun||(0,gp.writeFileSync)(n,c,"utf-8"),process.stdout.write(JSON.stringify({path:i,changed:!0,dryRun:!!e.dryRun,removed:o.removed,...e.canonicalizeKeys?{canonicalized:l}:{},...u?{updatedAt:u}:{},...e.dryRun?{diff:uwe(s,c)}:{}})+`
632
632
  `)}catch(t){le.handle(t)}})}a(NV,"repairFrontmatterCommand");ut();var kV=require("fs"),MV=require("path"),bs=Q(Pe());Xs();_t();Nt();ir();lE();Au();var fwe="https://exocortex.my/ontology/find#Alias_sparql",dwe="https://exocortex.my/ontology/exo#Asset_label";function yp(r){if(r&&typeof r=="object"&&"value"in r){let e=r.value;return typeof e=="string"?e:String(e)}return String(r)}a(yp,"nodeValue");async function pwe(r,e){let t=await r.match(void 0,void 0,void 0),n=[];for(let s of t)yp(s.predicate)!==dwe||yp(s.object)!==e||n.push(yp(s.subject));if(n.length===0)return null;let i=[];for(let s of n)for(let o of t)yp(o.predicate)===fwe&&yp(o.subject)===s&&i.push(yp(o.object));if(i.length===0)return null;if(i.length>1)throw new Qe(`Ambiguous find__Alias "${e}" \u2014 ${i.length} instances define a sparql fragment`,`Ensure exactly one find__Alias asset has exo:Asset_label "${e}"`);return i[0]}a(pwe,"resolveAliasFragment");var hwe=new RegExp(`^(${hs})__([A-Za-z0-9_]+)$`),mwe="https://exocortex.my/ontology/";function gwe(r,e){let t=hwe.exec(e);if(t){let i=`<${mwe}${t[1]}#${t[2]}>`;return r.replace(/\?value\b/g,i)}let n=e.replace(/\\/g,"\\\\").replace(/"/g,'\\"');return r.replace(/\?value\b/g,`"${n}"`)}a(gwe,"bindValueLiteral");function $V(){return new de("find").description("Find vault assets via SPARQL \u2014 outputs file paths one per line (RFC 8e83442b T1.1)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--sparql <query>","SPARQL SELECT query (must bind ?path)").option("--class <value>","Filter by class label via find__Alias 'class' (e.g. ems__Task)").action(async r=>{le.setFormat("text");try{if(r.sparql&&r.class)throw new Qe("--sparql and --class are mutually exclusive","Pass either a raw --sparql query or a find__Alias-backed flag like --class");if(!r.sparql&&!r.class)throw new Qe("one of --sparql <query> or --class <value> is required",'exocortex find --class ems__Task OR exocortex find --sparql "SELECT ?path WHERE { ... }"');let e=(0,MV.resolve)(r.vault);if(!(0,kV.existsSync)(e))throw new Fe(e);let t=new Yt(e),i=await new bs.NoteToRDFConverter(t).convertVault(),s=new bs.InMemoryTripleStore;await s.addAll(i);let o;if(r.class){let b=await pwe(s,"class");if(b===null)throw new Qe('No find__Alias with exo:Asset_label "class" was found in the vault',"Seed a find__Alias asset (label=class) or fall back to exocortex find --sparql");o=`SELECT ?path WHERE { ${gwe(b,r.class)} }`}else o=r.sparql;let c=aE(o);c=op(c);let l=new bs.ExoQLParser,u=cE(oE(e));u.size>0&&l.setVaultPrefixes(u);let f=l.parse(c),p=new bs.ExoQLAlgebraTranslator().translate(f);p.type!=="construct"&&(p=new bs.AlgebraOptimizer().optimize(p));let g=await new bs.ExoQLQueryExecutor(s).executeAll(p),m="obsidian://vault/";for(let b of g){let _=b.toJSON().path;if(typeof _!="string"||!_.startsWith(m))continue;let A=_.slice(m.length),E;try{E=decodeURIComponent(A)}catch{E=A}process.stdout.write(E+`
633
- `)}}catch(e){le.handle(e),process.exit(5)}})}a($V,"findCommand");ut();var KV=Q(Pe()),mF=require("fs"),so=require("path"),Ee=Q(Pe());_t();Nt();ir();Xs();var Dn=Q(Pe());var kE=new Map([["exo__Asset_uid",Dn.Namespace.EXO.term("Asset_uid").value],["exo__Asset_label",Dn.Namespace.EXO.term("Asset_label").value],["aliases",Dn.Namespace.EXO.term("Asset_aliases").value]]),ME=class r extends Yn{constructor(t,n){super(t);this.source=n;this.indexPromise=null;this.pathKeys=new Map;this.stats={indexedLookups:0,scanFallbacks:0,candidateReads:0,zeroTripleReads:0}}static{a(this,"TripleStoreIndexedFsAdapter")}async findFilesByMetadata(t){let n=Object.entries(t);if(!(n.length>0&&n.every(([u,f])=>kE.has(u)&&this.normalizeValue(f).length>0)))return this.stats.scanFallbacks++,super.findFilesByMetadata(t);let s=await this.ensureIndex();this.stats.indexedLookups++;let o=null;for(let[u,f]of n){let d=s.get(u)?.get(this.normalizeValue(f))??[];if(o=o===null?[...d]:o.filter(p=>d.includes(p)),o.length===0)return[]}let c=[...o??[]].filter(u=>!r.hasDotSegment(u)).sort(),l=[];for(let u of c){this.stats.candidateReads++;try{let f=await this.getFileMetadata(u);this.matchesQuery(f,t)&&l.push(u)}catch{continue}}return l}async createFile(t,n){let i=await super.createFile(t,n);return await this.reindexOwnWrite(t,n),i}async updateFile(t,n){await super.updateFile(t,n),await this.reindexOwnWrite(t,n)}async writeFile(t,n){await super.writeFile(t,n),await this.reindexOwnWrite(t,n)}async deleteFile(t){await super.deleteFile(t),this.forget(await this.ensureIndex(),r.rel(t))}async renameFile(t,n){await super.renameFile(t,n);let i=await this.ensureIndex(),s=r.rel(t),o=[...this.pathKeys.get(s)??[]];this.forget(i,s);let c=r.rel(n);for(let[l,u]of o)this.addKey(i,l,u,c)}async reindexOwnWrite(t,n){let i=await this.ensureIndex(),s=r.rel(t);this.forget(i,s);let o;try{o=this.extractFrontmatter(n)}catch{return}this.indexFrontmatter(i,s,o)}static rel(t){return t.replace(/\\/g,"/").replace(/^\.\//,"")}static hasDotSegment(t){return t.split("/").some(n=>n.startsWith("."))}async ensureIndex(){return this.indexPromise===null&&(this.indexPromise=this.buildIndex()),this.indexPromise}async buildIndex(){let t=new Map;for(let u of kE.keys())t.set(u,new Map);let n=new Map;for(let[u,f]of kE)n.set(f,u);let i=new Map,s=new Map,o=new Map,c=[];for(let u of this.source.explicitTriples){let f=n.get(u.predicate.value);if(f===void 0)continue;let d=r.subjectToPath(u);if(d===null)continue;c.push([f,d,u.object]);let p=u.object;if(f==="exo__Asset_uid"){p instanceof Dn.Literal&&!i.has(d)&&i.set(d,p.value);continue}if(p instanceof Dn.Literal)r.push(s,d,p.value);else if(p instanceof Dn.IRI){let h=Dn.Namespace.fromTermIRI(p.value);h&&(r.push(s,d,`${h.namespace.prefix}__${h.localName}`),f==="exo__Asset_label"&&r.push(o,p.value,d))}}let l=new Map;for(let[u,f]of o)l.set(u,f.map(d=>i.get(d)).filter(d=>d!==void 0));for(let[u,f,d]of c){let p=r.keysForObject(d,l,s);for(let h of p)this.addKey(t,u,this.normalizeValue(h),f)}for(let u of this.source.zeroTriplePaths){this.stats.zeroTripleReads++;try{this.indexFrontmatter(t,u,await this.getFileMetadata(u))}catch{continue}}return t}indexFrontmatter(t,n,i){for(let s of kE.keys()){let o=i[s],c=Array.isArray(o)?o:[o];for(let l of c)this.addKey(t,s,this.normalizeValue(l),n)}}addKey(t,n,i,s){if(i.length===0)return;let o=t.get(n);if(o===void 0)return;let c=o.get(i);c===void 0?o.set(i,[s]):c.includes(s)||c.push(s),r.push(this.pathKeys,s,[n,i])}forget(t,n){let i=this.pathKeys.get(n);if(i){for(let[s,o]of i){let c=t.get(s)?.get(o);if(!c)continue;let l=c.indexOf(n);l>=0&&c.splice(l,1)}this.pathKeys.delete(n)}}static push(t,n,i){let s=t.get(n);s===void 0?t.set(n,[i]):s.push(i)}static subjectToPath(t){let n=t.subject;if(!(n instanceof Dn.IRI))return null;let i=(0,Dn.iriToVaultPath)(n.value);return i===null||i.startsWith("/")||i.startsWith("..")||i.includes("/../")?null:i}static keysForObject(t,n,i){if(t instanceof Dn.Literal)return[t.value];if(!(t instanceof Dn.IRI))return[];let s=Dn.Namespace.fromTermIRI(t.value);if(s)return[`${s.namespace.prefix}__${s.localName}`,...n.get(t.value)??[]];let o=(0,Dn.iriToVaultPath)(t.value);if(o!==null){let c=o.lastIndexOf("/"),l=c===-1?o:o.slice(c+1);return[l.endsWith(".md")?l.slice(0,-3):l,...i.get(o)??[]]}return[t.value]}};var WV=Q(Pe()),Xt=Q(VV());var GV="obsidian://vault/";function jwe(r){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 n=t;if(n.startsWith(GV))n=decodeURI(n.slice(GV.length));else if(e.test(n)){let i=await r.findFileByUID(n);if(!i)throw new Error(`No vault file found for UID: ${n}`);n=i}if(n.endsWith(".md")||(n=`${n}.md`),!await r.fileExists(n))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${n}")`);return n}}}a(jwe,"createCliPathResolver");var Bwe=["openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],hF=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 qV(r){return{async execute(){throw new hF(r)}}}a(qV,"notImplementedService");function Uwe(r){return e=>{let t=r.getFirstLinkpathDest(e,"");if(!t||!("basename"in t))return null;let i=r.getFrontmatter(t)?.exo__Asset_label;return typeof i=="string"&&i.length>0?i:null}}a(Uwe,"createCliClassResolver");function zV(r,e){for(let t of Bwe)r.register(t,qV(t));for(let t of["updateProperty","removeProperty","setStatus","createAsset"])r.register(t,qV(t));if(e){if(e.fsAdapter){let t=new WV.FrontmatterService,n=jwe(e.fsAdapter);r.register("updateProperty",(0,Xt.createUpdatePropertyService)(e.fsAdapter,t,n)),r.register("removeProperty",(0,Xt.createRemovePropertyService)(e.fsAdapter,t,n)),r.register("setStatus",(0,Xt.createSetStatusService)(e.fsAdapter,t,n)),r.register("createAsset",(0,Xt.createCreateAssetService)(e.vaultAdapter,e.fsAdapter,Uwe(e.vaultAdapter))),r.register("instantiatePrototypeSubtree",(0,Xt.createInstantiatePrototypeSubtreeService)(e.vaultAdapter,e.fsAdapter))}r.register("createRelatedTask",(0,Xt.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("createRelatedProject",(0,Xt.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("archiveAsset",(0,Xt.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),r.register("planForEvening",(0,Xt.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),r.register("cleanProperties",(0,Xt.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),r.register("renameToUid",(0,Xt.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),r.register("repairFolder",(0,Xt.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),r.register("fixMissingLabel",(0,Xt.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(zV,"populateCliServiceRegistry");Xa();function Vwe(r,e){let t=r.getAbstractFileByPath(e),n=t!==null&&"basename"in t?t:null,i=n?r.getFrontmatter(n):null,s=i&&typeof i=="object"?i.exo__Asset_label:void 0;return{uuid:n?.basename??e.replace(/^.*\//,"").replace(/\.md$/,""),path:e,label:typeof s=="string"?s:""}}a(Vwe,"buildCreatedAsset");var Gwe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function qwe(){if(process.stdin.isTTY)return[];let r=[];for await(let t of process.stdin)r.push(t);return Buffer.concat(r).toString("utf-8").split(`
634
- `).map(t=>t.trim()).filter(t=>t.length>0)}a(qwe,"readStdinLines");function BE(r){if(r&&typeof r=="object"&&"value"in r){let e=r.value;return typeof e=="string"?e:String(e)}return String(r)}a(BE,"nodeValue");async function Wwe(r,e){let t=new Ee.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),n=await r.match(void 0,t,void 0),i=[];for(let s of n)if(BE(s.object)===e){let l=BE(s.subject).match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i);l&&i.push(l[1])}if(i.length===0)return null;if(i.length>1)throw new Qe(`Ambiguous cliName "${e}" \u2014 resolves to ${i.length} commands: ${i.join(", ")}`,"Use the UUID directly: exocortex apply <uuid> <path>");return i[0]}a(Wwe,"resolveSlugToUuid");async function zwe(r,e){let t=new Ee.IRI("https://exocortex.my/ontology/exocmd#Command_destructive"),n=await r.match(void 0,t,void 0);for(let i of n)if(BE(i.subject).includes(e)){let o=BE(i.object);if(o==="true"||o==="True")return!0}return!1}a(zwe,"isDestructive");async function Kwe(r,e,t,n,i,s,o,c,l){let u={ok:!1,created:[],executed:!1},f=(0,so.resolve)(r,s);if(!(0,mF.existsSync)(f))return console.error(`\u274C Target file not found: ${s}`),u;let d=(0,so.relative)(r,f);if(d===".."||d.startsWith(`..${so.sep}`)||(0,so.isAbsolute)(d))return console.error(`\u274C Target is outside the vault: ${s} (vault: ${r})`),u;let p=new Ee.CommandResolver(e,hE),h=await p.loadCommand(i);if(!h)return console.error(`\u274C Command with UID "${i}" not found.`),u;if(await zwe(e,i)&&!o.dryRun&&!o.yes)return console.error(`\u274C Command "${h.name}" is marked destructive. Add --dry-run to preview, or --yes to apply.`),u;let m=(0,Ee.vaultPathToIRI)(d),b=new Yt(r),S=new Ee.FolderRepairService(b),_=new Ee.PreconditionEvaluator(e,void 0,{clock:c});(0,Ee.registerDefaultHostFunctions)(_),_.registerHostFunction("isInWrongFolder",fE(b,S)),_.registerHostFunction("hasObsoleteProperties",dE(b));let A=b.getAbstractFileByPath(d),E=A!==null&&"basename"in A?A:null,w=E?b.getFrontmatter(E):null,R=w&&typeof w=="object"?w.exo__Asset_uid:void 0,O=await e.match(void 0,KV.Namespace.EXOCMD.term("CommandBinding_command"),void 0),P=!1,N=[];for(let H of O){if(String(H.object).includes(i)){P=!0;break}if(H.object instanceof Ee.IRI){let Y=await(0,Ee.labelTermBearers)(e,H.object);if(Y.some(ie=>ie.uid===i)){P=!0,Y.length>1&&(N=Y.map(ie=>ie.uid));break}}}if(P){let H=NP(w),Y=await kP(e,m),ie=[...new Set([...H,...Y])];if(ie.length>0){let Ce=mE(w?.exo__Asset_prototype);if(!(await p.resolveForAssetMulti(m,ie,Ce??void 0)).some(fe=>fe.command.id===i))return console.error(`\u274C "${h.name}" is not bound to the target's class on "${d}".`),console.error(` Declared classes: ${ie.join(", ")}.`),N.length>0&&console.error(` The command's label is ambiguous \u2014 borne by ${N.join(", ")} \u2014 so its binding reference cannot be resolved.`),u}}let j={targetIRI:m,filePath:d,fileBasename:E?.basename,assetUid:typeof R=="string"?R:void 0};if(!await _.evaluate(h.precondition,m,j))return console.error(`\u274C Precondition not satisfied for "${h.name}" on "${d}".`),u;let G;if(o.input)try{let H=JSON.parse(o.input);if(typeof H!="object"||H===null||Array.isArray(H))throw new Error("must be a JSON object");G=H}catch(H){let Y=H instanceof Error?H.message:String(H);return console.error(`\u274C --input: invalid JSON object (${Y})`),u}let $=(0,Ee.findInputSchemaViolation)(h.grounding,G);if($!==null)return console.error(`\u274C "${h.name}" cannot run on "${d}": ${$}`),u;if(o.dryRun){let H=(0,Ee.findMissingInput)(h.grounding,G);return H!==null?(console.error(`\u274C "${h.name}" cannot run on "${d}": ${(0,Ee.missingInputError)(H)}`),u):(o.json||console.log(`\u{1F50D} Dry-run: would apply "${h.name}" to "${d}" (precondition passed).`),{ok:!0,created:[],executed:!1})}let k=new Ee.ServiceRegistry,te=new Ee.GenericAssetCreationService(b).withDeterminism({clock:c,uidGenerator:l}),Z=new Ee.ArchiveAssetService(b),re=new Ee.PropertyCleanupService(b),V=new Ee.FixMissingLabelService(b),K=new Ee.RenameToUidService(b),he=new Ee.TaskStatusService(b,new Ee.EffortStatusWorkflow,new Ee.StatusTimestampService(b));zV(k,{vaultAdapter:b,fsAdapter:n,genericAssetCreationService:te,archiveAssetService:Z,taskStatusService:he,propertyCleanupService:re,fixMissingLabelService:V,renameToUidService:K,folderRepairService:S});let He=new Ee.NamedQueryRunner(new cp(e,n),e),ee=await new Ee.GroundingExecutor(n,n,k,(0,Ee.createVaultFrontmatterClassLabelResolver)(n),{clock:c,uidGenerator:l,workflowResolver:t,groundingLoader:a(H=>p.loadGroundingByUid(H),"groundingLoader"),templateLoader:a(async H=>{let Y=await n.findFileByUID(H);return Y?(0,Ee.stripTemplateFrontmatter)(await n.readFile(Y)):null},"templateLoader"),namedQueryRunner:He,refToFolder:(0,Ee.createVaultFrontmatterRefToFolderResolver)(n),refToFrontmatter:(0,Ee.createVaultFrontmatterRefToFrontmatterResolver)(n),declaredRanges:(0,Ee.createTripleStoreDeclaredRanges)(e)}).execute(h.grounding,m,d,G);if(ee.success){let H=[];ee.openPath&&H.push(ee.openPath),ee.createdPaths&&H.push(...ee.createdPaths);let Y=[],ie=new Set;for(let Ce of H)ie.has(Ce)||(ie.add(Ce),Y.push(Vwe(b,Ce)));if(!o.json){let Ce=h.successMessage??`Applied "${h.name}" to "${d}".`,B=ee.openPath??ee.createdPaths?.[0],fe=B?` \u2192 ${B}`:"";console.log(`\u2705 ${Ce}${fe}`)}return{ok:!0,created:Y,executed:!0}}else return console.error(`\u274C "${h.name}" failed on "${d}": ${ee.error}`),{ok:!1,created:[],executed:!0}}a(Kwe,"executeOnTarget");function HV(){return new de("apply").description("Apply an exocmd__Command to one or more vault assets (RFC 8e83442b T1.2). Pass a path arg or pipe paths via stdin.").argument("<cmd>","Command UUID or cliName slug").argument("[path]","Vault-relative path to target asset (omit to read paths from stdin)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview without writing").option("--yes","Skip destructive-command confirmation").option("--input <json>",`JSON userInput for a grounding. Value-setting commands need a value key, e.g. set-planned-start / set-scheduled-date: --input '{"value":"<ISO>"}'. A command whose grounding declares its own input key uses THAT key: set-label: --input '{"label":"New label"}' (set-label-keep-alias, which also keeps the previous label as an alias, takes the same key). Asset-reference inputs (set-parent: --input '{"parent":"<uid>"}'; set-blocker: --input '{"blocker":"<uid>"}'; set-ontology: --input '{"ontology":"<uid>"}') take a BARE uid; a copied [[uid]] or [[uid|alias]] is accepted and unwrapped, anything else that still looks like a link is refused. The required key is named in the error if omitted.`).option("--seed <uuid>","Deterministic UID seed for test/replay (uses seededUidGenerator)").option("--frozen-clock <iso>","Freeze clock to ISO timestamp for test/replay (uses frozenClock)").option("--json","Emit a machine-readable JSON result ({command,target,created:[{uuid,path,label}]}) instead of human-readable output").option("--use-cache","Use the persistent triple cache (hit / delta / rebuild) instead of a full vault parse; a mutation is picked up by the NEXT --use-cache process as a delta unless --write-through is also given").option("--write-through","With --use-cache: after a grounding executed, fold the mutation into the persistent cache in this process, so the next --use-cache process is a plain hit (the delta is paid by this writer instead of the next reader). Refused without --use-cache").action(async(r,e,t)=>{if(le.setFormat("text"),t.writeThrough&&!t.useCache){process.stderr.write(`\u274C --write-through requires --use-cache (there is no cache to write through to without it); nothing was applied
633
+ `)}}catch(e){le.handle(e),process.exit(5)}})}a($V,"findCommand");ut();var KV=Q(Pe()),mF=require("fs"),so=require("path"),Ee=Q(Pe());_t();Nt();ir();Xs();var Dn=Q(Pe());var kE=new Map([["exo__Asset_uid",Dn.Namespace.EXO.term("Asset_uid").value],["exo__Asset_label",Dn.Namespace.EXO.term("Asset_label").value],["aliases",Dn.Namespace.EXO.term("Asset_aliases").value]]),ME=class r extends Yn{constructor(t,n){super(t);this.source=n;this.indexPromise=null;this.pathKeys=new Map;this.stats={indexedLookups:0,scanFallbacks:0,candidateReads:0,zeroTripleReads:0}}static{a(this,"TripleStoreIndexedFsAdapter")}async findFilesByMetadata(t){let n=Object.entries(t);if(!(n.length>0&&n.every(([u,f])=>kE.has(u)&&this.normalizeValue(f).length>0)))return this.stats.scanFallbacks++,super.findFilesByMetadata(t);let s=await this.ensureIndex();this.stats.indexedLookups++;let o=null;for(let[u,f]of n){let d=s.get(u)?.get(this.normalizeValue(f))??[];if(o=o===null?[...d]:o.filter(p=>d.includes(p)),o.length===0)return[]}let c=[...o??[]].filter(u=>!r.hasDotSegment(u)).sort(),l=[];for(let u of c){this.stats.candidateReads++;try{let f=await this.getFileMetadata(u);this.matchesQuery(f,t)&&l.push(u)}catch{continue}}return l}async createFile(t,n){let i=await super.createFile(t,n);return await this.reindexOwnWrite(t,n),i}async updateFile(t,n){await super.updateFile(t,n),await this.reindexOwnWrite(t,n)}async writeFile(t,n){await super.writeFile(t,n),await this.reindexOwnWrite(t,n)}async deleteFile(t){await super.deleteFile(t),this.forget(await this.ensureIndex(),r.rel(t))}async renameFile(t,n){await super.renameFile(t,n);let i=await this.ensureIndex(),s=r.rel(t),o=[...this.pathKeys.get(s)??[]];this.forget(i,s);let c=r.rel(n);for(let[l,u]of o)this.addKey(i,l,u,c)}async reindexOwnWrite(t,n){let i=await this.ensureIndex(),s=r.rel(t);this.forget(i,s);let o;try{o=this.extractFrontmatter(n)}catch{return}this.indexFrontmatter(i,s,o)}static rel(t){return t.replace(/\\/g,"/").replace(/^\.\//,"")}static hasDotSegment(t){return t.split("/").some(n=>n.startsWith("."))}async ensureIndex(){return this.indexPromise===null&&(this.indexPromise=this.buildIndex()),this.indexPromise}async buildIndex(){let t=new Map;for(let u of kE.keys())t.set(u,new Map);let n=new Map;for(let[u,f]of kE)n.set(f,u);let i=new Map,s=new Map,o=new Map,c=[];for(let u of this.source.explicitTriples){let f=n.get(u.predicate.value);if(f===void 0)continue;let d=r.subjectToPath(u);if(d===null)continue;c.push([f,d,u.object]);let p=u.object;if(f==="exo__Asset_uid"){p instanceof Dn.Literal&&!i.has(d)&&i.set(d,p.value);continue}if(p instanceof Dn.Literal)r.push(s,d,p.value);else if(p instanceof Dn.IRI){let h=Dn.Namespace.fromTermIRI(p.value);h&&(r.push(s,d,`${h.namespace.prefix}__${h.localName}`),f==="exo__Asset_label"&&r.push(o,p.value,d))}}let l=new Map;for(let[u,f]of o)l.set(u,f.map(d=>i.get(d)).filter(d=>d!==void 0));for(let[u,f,d]of c){let p=r.keysForObject(d,l,s);for(let h of p)this.addKey(t,u,this.normalizeValue(h),f)}for(let u of this.source.zeroTriplePaths){this.stats.zeroTripleReads++;try{this.indexFrontmatter(t,u,await this.getFileMetadata(u))}catch{continue}}return t}indexFrontmatter(t,n,i){for(let s of kE.keys()){let o=i[s],c=Array.isArray(o)?o:[o];for(let l of c)this.addKey(t,s,this.normalizeValue(l),n)}}addKey(t,n,i,s){if(i.length===0)return;let o=t.get(n);if(o===void 0)return;let c=o.get(i);c===void 0?o.set(i,[s]):c.includes(s)||c.push(s),r.push(this.pathKeys,s,[n,i])}forget(t,n){let i=this.pathKeys.get(n);if(i){for(let[s,o]of i){let c=t.get(s)?.get(o);if(!c)continue;let l=c.indexOf(n);l>=0&&c.splice(l,1)}this.pathKeys.delete(n)}}static push(t,n,i){let s=t.get(n);s===void 0?t.set(n,[i]):s.push(i)}static subjectToPath(t){let n=t.subject;if(!(n instanceof Dn.IRI))return null;let i=(0,Dn.iriToVaultPath)(n.value);return i===null||i.startsWith("/")||i.startsWith("..")||i.includes("/../")?null:i}static keysForObject(t,n,i){if(t instanceof Dn.Literal)return[t.value];if(!(t instanceof Dn.IRI))return[];let s=Dn.Namespace.fromTermIRI(t.value);if(s)return[`${s.namespace.prefix}__${s.localName}`,...n.get(t.value)??[]];let o=(0,Dn.iriToVaultPath)(t.value);if(o!==null){let c=o.lastIndexOf("/"),l=c===-1?o:o.slice(c+1);return[l.endsWith(".md")?l.slice(0,-3):l,...i.get(o)??[]]}return[t.value]}};var WV=Q(Pe()),Xt=Q(VV());var GV="obsidian://vault/";function Bwe(r){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 n=t;if(n.startsWith(GV))n=decodeURI(n.slice(GV.length));else if(e.test(n)){let i=await r.findFileByUID(n);if(!i)throw new Error(`No vault file found for UID: ${n}`);n=i}if(n.endsWith(".md")||(n=`${n}.md`),!await r.fileExists(n))throw new Error(`Cannot resolve target file for IRI "${t}" (tried "${n}")`);return n}}}a(Bwe,"createCliPathResolver");var Uwe=["openFile","sparqlSelect","getActiveFileIRI","getActiveFilePath","trashFile","duplicateFile"],hF=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 qV(r){return{async execute(){throw new hF(r)}}}a(qV,"notImplementedService");function Vwe(r){return e=>{let t=r.getFirstLinkpathDest(e,"");if(!t||!("basename"in t))return null;let i=r.getFrontmatter(t)?.exo__Asset_label;return typeof i=="string"&&i.length>0?i:null}}a(Vwe,"createCliClassResolver");function zV(r,e){for(let t of Uwe)r.register(t,qV(t));for(let t of["updateProperty","removeProperty","setStatus","createAsset"])r.register(t,qV(t));if(e){if(e.fsAdapter){let t=new WV.FrontmatterService,n=Bwe(e.fsAdapter);r.register("updateProperty",(0,Xt.createUpdatePropertyService)(e.fsAdapter,t,n)),r.register("removeProperty",(0,Xt.createRemovePropertyService)(e.fsAdapter,t,n)),r.register("setStatus",(0,Xt.createSetStatusService)(e.fsAdapter,t,n)),r.register("createAsset",(0,Xt.createCreateAssetService)(e.vaultAdapter,e.fsAdapter,Vwe(e.vaultAdapter))),r.register("instantiatePrototypeSubtree",(0,Xt.createInstantiatePrototypeSubtreeService)(e.vaultAdapter,e.fsAdapter))}r.register("createRelatedTask",(0,Xt.createCreateRelatedTaskService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("createRelatedProject",(0,Xt.createCreateRelatedProjectService)(e.vaultAdapter,e.genericAssetCreationService)),r.register("archiveAsset",(0,Xt.createArchiveAssetService)(e.vaultAdapter,e.archiveAssetService)),r.register("planForEvening",(0,Xt.createPlanForEveningService)(e.vaultAdapter,e.taskStatusService)),r.register("cleanProperties",(0,Xt.createCleanPropertiesService)(e.vaultAdapter,e.propertyCleanupService)),r.register("renameToUid",(0,Xt.createRenameToUidService)(e.vaultAdapter,e.renameToUidService)),r.register("repairFolder",(0,Xt.createRepairFolderService)(e.vaultAdapter,e.folderRepairService)),r.register("fixMissingLabel",(0,Xt.createFixMissingLabelService)(e.vaultAdapter,e.fixMissingLabelService))}}a(zV,"populateCliServiceRegistry");Xa();function Gwe(r,e){let t=r.getAbstractFileByPath(e),n=t!==null&&"basename"in t?t:null,i=n?r.getFrontmatter(n):null,s=i&&typeof i=="object"?i.exo__Asset_label:void 0;return{uuid:n?.basename??e.replace(/^.*\//,"").replace(/\.md$/,""),path:e,label:typeof s=="string"?s:""}}a(Gwe,"buildCreatedAsset");var qwe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function Wwe(){if(process.stdin.isTTY)return[];let r=[];for await(let t of process.stdin)r.push(t);return Buffer.concat(r).toString("utf-8").split(`
634
+ `).map(t=>t.trim()).filter(t=>t.length>0)}a(Wwe,"readStdinLines");function BE(r){if(r&&typeof r=="object"&&"value"in r){let e=r.value;return typeof e=="string"?e:String(e)}return String(r)}a(BE,"nodeValue");async function zwe(r,e){let t=new Ee.IRI("https://exocortex.my/ontology/exocmd#Command_cliName"),n=await r.match(void 0,t,void 0),i=[];for(let s of n)if(BE(s.object)===e){let l=BE(s.subject).match(/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\.md$/i);l&&i.push(l[1])}if(i.length===0)return null;if(i.length>1)throw new Qe(`Ambiguous cliName "${e}" \u2014 resolves to ${i.length} commands: ${i.join(", ")}`,"Use the UUID directly: exocortex apply <uuid> <path>");return i[0]}a(zwe,"resolveSlugToUuid");async function Kwe(r,e){let t=new Ee.IRI("https://exocortex.my/ontology/exocmd#Command_destructive"),n=await r.match(void 0,t,void 0);for(let i of n)if(BE(i.subject).includes(e)){let o=BE(i.object);if(o==="true"||o==="True")return!0}return!1}a(Kwe,"isDestructive");async function Hwe(r,e,t,n,i,s,o,c,l){let u={ok:!1,created:[],executed:!1},f=(0,so.resolve)(r,s);if(!(0,mF.existsSync)(f))return console.error(`\u274C Target file not found: ${s}`),u;let d=(0,so.relative)(r,f);if(d===".."||d.startsWith(`..${so.sep}`)||(0,so.isAbsolute)(d))return console.error(`\u274C Target is outside the vault: ${s} (vault: ${r})`),u;let p=new Ee.CommandResolver(e,hE),h=await p.loadCommand(i);if(!h)return console.error(`\u274C Command with UID "${i}" not found.`),u;if(await Kwe(e,i)&&!o.dryRun&&!o.yes)return console.error(`\u274C Command "${h.name}" is marked destructive. Add --dry-run to preview, or --yes to apply.`),u;let m=(0,Ee.vaultPathToIRI)(d),b=new Yt(r),S=new Ee.FolderRepairService(b),_=new Ee.PreconditionEvaluator(e,void 0,{clock:c});(0,Ee.registerDefaultHostFunctions)(_),_.registerHostFunction("isInWrongFolder",fE(b,S)),_.registerHostFunction("hasObsoleteProperties",dE(b));let A=b.getAbstractFileByPath(d),E=A!==null&&"basename"in A?A:null,w=E?b.getFrontmatter(E):null,R=w&&typeof w=="object"?w.exo__Asset_uid:void 0,O=await e.match(void 0,KV.Namespace.EXOCMD.term("CommandBinding_command"),void 0),P=!1,N=[];for(let H of O){if(String(H.object).includes(i)){P=!0;break}if(H.object instanceof Ee.IRI){let Y=await(0,Ee.labelTermBearers)(e,H.object);if(Y.some(ie=>ie.uid===i)){P=!0,Y.length>1&&(N=Y.map(ie=>ie.uid));break}}}if(P){let H=NP(w),Y=await kP(e,m),ie=[...new Set([...H,...Y])];if(ie.length>0){let Ce=mE(w?.exo__Asset_prototype);if(!(await p.resolveForAssetMulti(m,ie,Ce??void 0)).some(fe=>fe.command.id===i))return console.error(`\u274C "${h.name}" is not bound to the target's class on "${d}".`),console.error(` Declared classes: ${ie.join(", ")}.`),N.length>0&&console.error(` The command's label is ambiguous \u2014 borne by ${N.join(", ")} \u2014 so its binding reference cannot be resolved.`),u}}let j={targetIRI:m,filePath:d,fileBasename:E?.basename,assetUid:typeof R=="string"?R:void 0};if(!await _.evaluate(h.precondition,m,j))return console.error(`\u274C Precondition not satisfied for "${h.name}" on "${d}".`),u;let G;if(o.input)try{let H=JSON.parse(o.input);if(typeof H!="object"||H===null||Array.isArray(H))throw new Error("must be a JSON object");G=H}catch(H){let Y=H instanceof Error?H.message:String(H);return console.error(`\u274C --input: invalid JSON object (${Y})`),u}let $=(0,Ee.findInputSchemaViolation)(h.grounding,G);if($!==null)return console.error(`\u274C "${h.name}" cannot run on "${d}": ${$}`),u;if(o.dryRun){let H=(0,Ee.findMissingInput)(h.grounding,G);return H!==null?(console.error(`\u274C "${h.name}" cannot run on "${d}": ${(0,Ee.missingInputError)(H)}`),u):(o.json||console.log(`\u{1F50D} Dry-run: would apply "${h.name}" to "${d}" (precondition passed).`),{ok:!0,created:[],executed:!1})}let k=new Ee.ServiceRegistry,te=new Ee.GenericAssetCreationService(b).withDeterminism({clock:c,uidGenerator:l}),Z=new Ee.ArchiveAssetService(b),re=new Ee.PropertyCleanupService(b),V=new Ee.FixMissingLabelService(b),K=new Ee.RenameToUidService(b),he=new Ee.TaskStatusService(b,new Ee.EffortStatusWorkflow,new Ee.StatusTimestampService(b));zV(k,{vaultAdapter:b,fsAdapter:n,genericAssetCreationService:te,archiveAssetService:Z,taskStatusService:he,propertyCleanupService:re,fixMissingLabelService:V,renameToUidService:K,folderRepairService:S});let He=new Ee.NamedQueryRunner(new cp(e,n),e),ee=await new Ee.GroundingExecutor(n,n,k,(0,Ee.createVaultFrontmatterClassLabelResolver)(n),{clock:c,uidGenerator:l,workflowResolver:t,groundingLoader:a(H=>p.loadGroundingByUid(H),"groundingLoader"),templateLoader:a(async H=>{let Y=await n.findFileByUID(H);return Y?(0,Ee.stripTemplateFrontmatter)(await n.readFile(Y)):null},"templateLoader"),namedQueryRunner:He,refToFolder:(0,Ee.createVaultFrontmatterRefToFolderResolver)(n),refToFrontmatter:(0,Ee.createVaultFrontmatterRefToFrontmatterResolver)(n),declaredRanges:(0,Ee.createTripleStoreDeclaredRanges)(e)}).execute(h.grounding,m,d,G);if(ee.success){let H=[];ee.openPath&&H.push(ee.openPath),ee.createdPaths&&H.push(...ee.createdPaths);let Y=[],ie=new Set;for(let Ce of H)ie.has(Ce)||(ie.add(Ce),Y.push(Gwe(b,Ce)));if(!o.json){let Ce=h.successMessage??`Applied "${h.name}" to "${d}".`,B=ee.openPath??ee.createdPaths?.[0],fe=B?` \u2192 ${B}`:"";console.log(`\u2705 ${Ce}${fe}`)}return{ok:!0,created:Y,executed:!0}}else return console.error(`\u274C "${h.name}" failed on "${d}": ${ee.error}`),{ok:!1,created:[],executed:!0}}a(Hwe,"executeOnTarget");function HV(){return new de("apply").description("Apply an exocmd__Command to one or more vault assets (RFC 8e83442b T1.2). Pass a path arg or pipe paths via stdin.").argument("<cmd>","Command UUID or cliName slug").argument("[path]","Vault-relative path to target asset (omit to read paths from stdin)").option("--vault <path>","Path to Obsidian vault",process.cwd()).option("--dry-run","Preview without writing").option("--yes","Skip destructive-command confirmation").option("--input <json>",`JSON userInput for a grounding. Value-setting commands need a value key, e.g. set-planned-start / set-scheduled-date: --input '{"value":"<ISO>"}'. A command whose grounding declares its own input key uses THAT key: set-label: --input '{"label":"New label"}' (set-label-keep-alias, which also keeps the previous label as an alias, takes the same key). Asset-reference inputs (set-parent: --input '{"parent":"<uid>"}'; set-blocker: --input '{"blocker":"<uid>"}'; set-ontology: --input '{"ontology":"<uid>"}') take a BARE uid; a copied [[uid]] or [[uid|alias]] is accepted and unwrapped, anything else that still looks like a link is refused. The required key is named in the error if omitted.`).option("--seed <uuid>","Deterministic UID seed for test/replay (uses seededUidGenerator)").option("--frozen-clock <iso>","Freeze clock to ISO timestamp for test/replay (uses frozenClock)").option("--json","Emit a machine-readable JSON result ({command,target,created:[{uuid,path,label}]}) instead of human-readable output").option("--use-cache","Use the persistent triple cache (hit / delta / rebuild) instead of a full vault parse; a mutation is picked up by the NEXT --use-cache process as a delta unless --write-through is also given").option("--write-through","With --use-cache: after a grounding executed, fold the mutation into the persistent cache in this process, so the next --use-cache process is a plain hit (the delta is paid by this writer instead of the next reader). Refused without --use-cache").action(async(r,e,t)=>{if(le.setFormat("text"),t.writeThrough&&!t.useCache){process.stderr.write(`\u274C --write-through requires --use-cache (there is no cache to write through to without it); nothing was applied
635
635
  `),process.exit(2);return}try{let n=(0,so.resolve)(t.vault);if(!(0,mF.existsSync)(n))throw new Fe(n);up(n);let i=t.frozenClock?(0,Ee.frozenClock)(t.frozenClock):(0,Ee.liveClock)(),s=t.seed?(0,Ee.seededUidGenerator)(t.seed):(0,Ee.liveUidGenerator)(),o=t.useCache??!1,c=await mi(n,{useCache:o});o&&process.stderr.write(`${Ru(c)}
636
636
  `);let l=Cu(c);l!==null&&process.stderr.write(`${l}
637
- `);let u=new Ee.InMemoryTripleStore;await u.addAll(c.triples);let f=new ME(n,{explicitTriples:c.triples.slice(0,c.explicitCount),zeroTriplePaths:c.zeroTriplePaths}),d=new Ee.WorkflowResolver(u),p;if(Gwe.test(r))p=r;else{let _=await Wwe(u,r);_||(console.error(`\u274C No command found with UUID or cliName "${r}".`),process.exit(3)),p=_}let h;if(e)h=[e];else if(h=await qwe(),h.length===0)throw new Qe("No target path provided and stdin is empty.","exocortex apply <uuid> <path> OR exocortex find ... | exocortex apply <uuid>");let g=0,m=0,b=!1,S=[];for(let _ of h){let A=fg(c,(0,so.relative)(n,(0,so.resolve)(n,_)));A!==null&&process.stderr.write(`${A}
638
- `);let E=await Kwe(n,u,d,f,p,_,t,i,s);E.ok?g++:m++,E.executed&&(b=!0),S.push(...E.created)}if(o&&t.writeThrough&&b&&c.cacheManager){let _=await eP(c.cacheManager);process.stderr.write(`${tP(_)}
637
+ `);let u=new Ee.InMemoryTripleStore;await u.addAll(c.triples);let f=new ME(n,{explicitTriples:c.triples.slice(0,c.explicitCount),zeroTriplePaths:c.zeroTriplePaths}),d=new Ee.WorkflowResolver(u),p;if(qwe.test(r))p=r;else{let _=await zwe(u,r);_||(console.error(`\u274C No command found with UUID or cliName "${r}".`),process.exit(3)),p=_}let h;if(e)h=[e];else if(h=await Wwe(),h.length===0)throw new Qe("No target path provided and stdin is empty.","exocortex apply <uuid> <path> OR exocortex find ... | exocortex apply <uuid>");let g=0,m=0,b=!1,S=[];for(let _ of h){let A=fg(c,(0,so.relative)(n,(0,so.resolve)(n,_)));A!==null&&process.stderr.write(`${A}
638
+ `);let E=await Hwe(n,u,d,f,p,_,t,i,s);E.ok?g++:m++,E.executed&&(b=!0),S.push(...E.created)}if(o&&t.writeThrough&&b&&c.cacheManager){let _=await eP(c.cacheManager);process.stderr.write(`${tP(_)}
639
639
  `)}if(h.length>1&&!t.json&&console.log(`
640
640
  \u{1F4CA} Applied to ${g}/${h.length} target(s) (${m} failed).`),t.json){let _={command:r,created:S};e?_.target=e:_.targets=h,process.stdout.write(JSON.stringify(_)+`
641
- `)}m>0&&process.exit(5)}catch(n){le.handle(n),process.exit(5)}})}a(HV,"applyCommand");ut();ut();var Sp=require("fs"),wF=require("path"),HE=Q(Pe());var UE=Q($o()),VE=Q(require("path")),ll=Q(Pe()),qE=Q(Pe());var Hwe=ll.SDK_FLOOR_ASSETSPACE_UIDS,Du="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",gF="3de846cd-1f0e-4f98-8613-b8587aa15174",Ywe=5,GE=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[VE.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??Ywe,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,ll.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of Hwe)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,n,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)n.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,n,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,n=new Map;for(let i of this.vaultPaths){if(!await UE.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=Ji(o.frontmatter.exo__Instance_class);if(c.some(l=>l===Du)){let l=Qwe(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,ll.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=Ji(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&n.set(o.uid,f)}if(c.some(l=>l===gF)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:Ji(o.frontmatter.exo__Profile_includes),extends:Ji(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:n}}async walkVault(e){let t=[],n=[e];for(;n.length>0;){let i=n.pop(),s;try{s=await UE.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=VE.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;n.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await UE.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,ll.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function Ji(r){if(r==null)return[];let e=Array.isArray(r)?r:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=Xwe(n);i!==null&&t.push(i)}return t}a(Ji,"parseWikilinkArray");function Xwe(r){let e=r.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(Xwe,"extractUidFromWikilink");function Qwe(r,e){let t=VE.default.relative(e,r).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let n=t.slice(12),i=n.indexOf("/");return i<0?"":`assetspaces/${n.slice(0,i)}`}a(Qwe,"parentFolderRelative");var WE=Q($o()),yF=Q(require("path")),_p=Q(Pe());var zE=class{static{a(this,"RegistryDependencyResolver")}constructor(e={}){this.warn=e.warn??(()=>{})}async resolve(e,t){let n=await this.scanRegistry(e),i=this.matchSelf(n,t);if(i===null)return{outcome:"self-not-found",selfIdentifier:t,descriptorCount:n.size};let s=new Map;for(let m of n.values())m.dependsOn.length>0&&s.set(m.uid,m.dependsOn);let o=(0,_p.transitiveDependsOnClosure)([i.uid],s);o.delete(i.uid);let c=[],l=new Set,u=new Set([i.uid]),f=[...i.dependsOn];for(;f.length>0;){let m=f.shift();if(m===void 0||u.has(m))continue;u.add(m),o.has(m)&&!l.has(m)&&(c.push(m),l.add(m));let b=n.get(m);if(b!==void 0)for(let S of b.dependsOn)u.has(S)||f.push(S)}for(let m of o)l.has(m)||(c.push(m),l.add(m));let d=[],p=[];for(let m of c){let b=n.get(m);b===void 0?p.push(m):d.push(b)}let h=d.filter(m=>m.source===null||m.source.length===0),g=d.filter(m=>m.source!==null&&m.source.length>0&&!Jwe(m.source));return{outcome:"resolved",self:i,dependencies:d,missingDescriptors:p,sourceless:h,unsafeSources:g}}matchSelf(e,t){let n=bp(t);if(n!==null)for(let i of e.values()){if(i.source===null)continue;let s=bp(i.source);if(s!==null&&s===n)return i}for(let i of e.values())if(i.namespace!==null&&i.namespace===t)return i;return null}async scanRegistry(e){let t=new Map,n=yF.default.resolve(e);if(!await WE.default.pathExists(n))return this.warn(`[RegistryDependencyResolver] registry path does not exist: ${n}`),t;let i=[n];for(;i.length>0;){let s=i.pop(),o;try{o=await WE.default.readdir(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=yF.default.join(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||c.name==="node_modules"||c.name===".obsidian"||c.name===".exocortex")continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=await this.tryReadFrontmatter(l);if(u===null||!Ji(u.exo__Instance_class).some(m=>m===Du))continue;let d=u.exo__Asset_uid;if(typeof d!="string"||d.length===0)continue;let p=typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:null,h=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:null,g=Ji(u.exo__AssetSpace_dependsOn);t.has(d)&&this.warn(`[RegistryDependencyResolver] duplicate AssetSpace descriptor for uid=${d} \u2014 last wins (${l})`),t.set(d,{uid:d,namespace:h,source:p,dependsOn:g})}}return t}async tryReadFrontmatter(e){let t;try{t=await WE.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,_p.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function bp(r){let e=r.trim();if(e.length===0)return null;let t=(0,_p.derivePath)(e);if(t!==null)return t.replace(/^assetspaces\//,"").toLowerCase();if(!e.includes("://")&&!e.includes("@")){let i=e.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").filter(s=>s.length>0);if(i.length===2)return`${i[0]}/${i[1]}`.toLowerCase()}return null}a(bp,"ownerRepoSlug");function Jwe(r){return typeof r!="string"||r.length===0||/[\s\x00-\x1f]/.test(r)||r.startsWith("-")||/^(ext|file|fd|ftp|ftps)::/i.test(r)?!1:!!(/^https?:\/\/[^\s]+$/i.test(r)||/^ssh:\/\/[^\s]+$/i.test(r)||/^git:\/\/[^\s]+$/i.test(r)||/^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+:[^\s]+$/.test(r))}a(Jwe,"isSafeCloneUrl");_t();Nt();var QV=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Zwe=/^[A-Za-z][A-Za-z0-9-]*__[A-Za-z0-9_-]+$/,eEe=/^assetspaces\/([^/]+)\/([^/]+)\//,JV=["exo__Ontology_imports","exo__Ontology_admits","exo__Property_range","exo__Property_domain","exo__Class_superClass","exo__Property_superProperty","exo__Property_cardinality","exo__Property_minCount"],tEe="e1d7fb5c-d334-448d-935b-953b7b033e78",rEe="fe529085-5370-4ac0-bbe4-1c7351242dee",nEe=5,bF=200;function KE(r){let e=eEe.exec(r.replace(/\\/g,"/"));return e?`${e[1]}/${e[2]}`.toLowerCase():null}a(KE,"assetspaceOfPath");var SF=class{constructor(){this.assets=[];this.uidToPath=new Map;this.pathSet=new Set;this.labelToPaths=new Map;this.basenameToPaths=new Map}static{a(this,"VaultIndex")}add(e){let t=e.path.replace(/\\/g,"/");this.assets.push({...e,path:t}),this.pathSet.add(t);let n=e.metadata.exo__Asset_uid;for(let c of Array.isArray(n)?n:[n])if(typeof c=="string"){let l=c.trim().toLowerCase();l.length>0&&!this.uidToPath.has(l)&&this.uidToPath.set(l,t)}let i=t.slice(t.lastIndexOf("/")+1).replace(/\.md$/,"");_F(this.basenameToPaths,i,t);let s=e.metadata.exo__Asset_label;typeof s=="string"&&s.trim().length>0&&_F(this.labelToPaths,s.trim(),t);let o=e.metadata.aliases;for(let c of Array.isArray(o)?o:[o])typeof c=="string"&&c.trim().length>0&&_F(this.labelToPaths,c.trim(),t)}resolve(e){let t=this.candidates(e);return t.length===0?null:t.length===1?t[0]:"ambiguous"}candidates(e){let t=e;if(QV.test(t)){let i=this.uidToPath.get(t.toLowerCase());return i===void 0?[]:[i]}if(t.includes("/")){let i=t.replace(/^\//,""),s=i.endsWith(".md")?i:`${i}.md`;if(this.pathSet.has(s))return[s];t=i.slice(i.lastIndexOf("/")+1)}t.endsWith(".md")&&(t=t.slice(0,-3));let n=this.distinctByUid(this.labelToPaths.get(t));return n.length>0?n:this.distinctByUid(this.basenameToPaths.get(t))}distinctByUid(e){if(!e||e.size===0)return[];let t=new Set,n=[];for(let i of e){let s=this.assets.find(l=>l.path===i),o=s?s.metadata.exo__Asset_uid:void 0,c=typeof o=="string"?o.trim().toLowerCase():`path:${i}`;t.has(c)||(t.add(c),n.push(i))}return n}};function _F(r,e,t){let n=r.get(e);n?n.add(t):r.set(e,new Set([t]))}a(_F,"addTo");function Pg(r){if(Array.isArray(r)){let e=r.find(t=>typeof t=="string");return typeof e=="string"?e:null}return typeof r=="string"?r:null}a(Pg,"firstString");function iEe(r){let e=Ji(r);if(e.length===0)return"unkinded";let t=e[0].toLowerCase();return t===tEe?"TBox":t===rEe?"Reference":"unknown"}a(iEe,"kindOf");function sEe(r){return r==null?0:(Array.isArray(r)?r:[r]).filter(t=>typeof t=="object"&&t!==null).length}a(sEe,"countStructuredItems");function oEe(r){let e=Array.isArray(r)?r:r==null?[]:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=n.trim().replace(/^["']|["']$/g,""),s=i.startsWith("[[")&&i.endsWith("]]"),o=(0,HE.extractAssetReference)(i);if(!o)continue;let c=o.split("#")[0].trim();c.length!==0&&(s||QV.test(c)||Zwe.test(c))&&t.push(c)}return t}a(oEe,"referencesOf");function YV(r){let e=new Map;for(let t of r){if(Qi(t.path)||gi(t.path)||!Ji(t.metadata.exo__Instance_class).some(c=>c.toLowerCase()===Du))continue;let i=Pg(t.metadata.exo__Asset_uid);if(!i)continue;let s=i.trim().toLowerCase();if(e.has(s))continue;let o=Pg(t.metadata.exo__AssetSpace_source)??Pg(t.metadata.exo__AssetSpace_git);e.set(s,{uid:s,slug:o?bp(o):null,label:Pg(t.metadata.exo__Asset_label)??t.path,path:t.path,dependsOn:Ji(t.metadata.exo__AssetSpace_dependsOn).map(c=>c.toLowerCase()),kind:iEe(t.metadata.exo__AssetSpace_dependsOnKind)})}return e}a(YV,"collectDescriptors");async function aEe(r){let e=new SF,t=new Set,n=new Fn(r.vault,{cacheContent:!1});for(let F of await n.indexedAssets()){if(Qi(F.path)||gi(F.path))continue;let J=Pg(F.metadata.exo__Asset_uid),ue=J?J.trim().toLowerCase():`path:${F.path}`;t.has(ue)||(t.add(ue),e.add(F))}let i,s;if(r.registry){let F=new Fn(r.registry,{cacheContent:!1});s=YV(await F.indexedAssets()),i=r.registry}else s=YV(e.assets),i="vault";let o=new Map,c=[],l=new Map;for(let F of s.values()){if(F.slug===null){c.push(F.label);continue}o.set(F.uid,F.slug);let J=l.get(F.slug);J?J.push(F.uid):l.set(F.slug,[F.uid])}let u=[...l.entries()].filter(([,F])=>F.length>1).map(([F,J])=>({slug:F,uids:J})),f=new Map;for(let F of s.values())F.slug&&f.set(F.slug,F.kind);let d=new Map,p=[],h=0,g=new Set;for(let F of s.values())if(F.slug!==null)for(let J of F.dependsOn){let ue=o.get(J);if(ue===void 0){p.push({source:F.slug,ref:J});continue}if(ue===F.slug)continue;let Se=d.get(F.slug);Se||(Se=[],d.set(F.slug,Se)),Se.includes(ue)||(Se.push(ue),h++,g.add(ue))}let m=null;r.self!==void 0&&(m=bp(r.self),m===null&&(m=r.self.trim().toLowerCase()));let b=new Map,S=a(F=>{let J=b.get(F);if(J!==void 0)return J;let ue=(0,HE.transitiveDependsOnClosure)([F],d);return b.set(F,ue),ue},"closureOf"),_=r.missingDeps??[];if(_.length>0&&m===null)throw new Qe("--missing-dep / --missing-deps-file require --self: in vault mode unresolved refs are already fail-open, so the inputs would be a silent no-op","Pass --self <owner/repo> (the per-repo CI mode) together with the missing deps");let A=[...new Set(_.map(F=>bp(F)??F.trim().toLowerCase()).filter(F=>F.length>0&&F!==m))].sort(),E=m!==null?S(m):new Set,w=new Set;for(let F of e.assets){let J=KE(F.path);J!==null&&w.add(J)}let R=A.filter(F=>w.has(F)),O=A.filter(F=>E.has(F)&&!w.has(F)),P=A.filter(F=>!E.has(F)&&!w.has(F)),N=r.strictUnresolved===!0,j=m!==null&&!N&&O.length>0,U=new Map,G=[],$=0,k=[],te=0,Z=0,re=0,V=[],K=0,he=0,He=0,ce=0;for(let F of e.assets){let J=KE(F.path);if(J!==null&&!(m!==null&&J!==m)){He++;for(let ue of JV){let Se=F.metadata[ue],Oe=sEe(Se);Oe>0&&(K+=Oe,V.length<bF&&V.push({sourcePath:F.path,predicate:ue}));let We=oEe(Se);for(let Ne of We){let ke=e.candidates(Ne);if(ke.length===0){$++,G.length<bF&&G.push({source:J,sourcePath:F.path,predicate:ue,ref:Ne,reason:"not-found"});continue}if(ke.length>1){let ot=[...new Set(ke.map(x=>KE(x)??"<outside assetspaces/>"))].sort(),nt=S(J),C=ot.every(x=>x===J||nt.has(x));te++,C?Z++:re++,k.length<bF&&k.push({source:J,sourcePath:F.path,predicate:ue,ref:Ne,candidates:ot,coveredByClosure:C});continue}let ze=ke[0],xe=KE(ze);if(xe===null){he++;continue}if(xe===J)continue;ce++;let Ve=`${J} ${xe}`,rt=U.get(Ve);rt||(rt={source:J,target:xe,occurrences:0,predicates:{},examples:[],coveredDirect:d.get(J)?.includes(xe)??!1,coveredByClosure:S(J).has(xe)},U.set(Ve,rt)),rt.occurrences++,rt.predicates[ue]=(rt.predicates[ue]??0)+1,rt.examples.length<nEe&&rt.examples.push(`${F.path} --${ue}--> ${Ne}`)}}}}let ee=[...U.values()].sort((F,J)=>Number(F.coveredByClosure)-Number(J.coveredByClosure)||Number(F.coveredDirect)-Number(J.coveredDirect)||F.source.localeCompare(J.source)||F.target.localeCompare(J.target)),H=ee.filter(F=>F.coveredByClosure).length,Y=ee.filter(F=>!F.coveredDirect).length,ie=m!==null,Ce=m!==null&&!j,B=j?$:0,fe=ee.filter(F=>!F.coveredByClosure).length+(ie?re:0)+(Ce?$:0),ae=new Set(ee.map(F=>`${F.source} ${F.target}`)),Ie=[],ye={TBox:0,unkinded:0,unknown:0},Te=0;for(let[F,J]of d)if(!(m!==null&&F!==m))for(let ue of J){let Se=f.get(ue)??"unknown";if(Se==="Reference"){Te++;continue}let Oe=ae.has(`${F} ${ue}`);Oe||(Ie.push({source:F,target:ue,targetKind:Se,hasFact:Oe}),ye[Se]++)}Ie.sort((F,J)=>F.source.localeCompare(J.source)||F.target.localeCompare(J.target));let Re=[...g].filter(F=>(f.get(F)??"unknown")==="unkinded").sort(),pe,q=null;return s.size===0?(pe="BROKEN",q=`no exo__AssetSpace descriptor found (registry: ${i}) \u2014 nothing to judge against`):m!==null&&!l.has(m)?(pe="BROKEN",q=`--self '${r.self}' (${m}) is not a registered AssetSpace (${s.size} descriptor(s) scanned)`):m!==null&&He===0?(pe="BROKEN",q=`--self '${m}': no asset under assetspaces/${m}/ in the vault \u2014 the self content was not merged`):m===null&&ee.length===0?(pe="BROKEN",q="zero definition-tier cross-AssetSpace fact edges \u2014 an empty population cannot be declared covered"):pe=fe===0?"OK":"FAIL",{vaultPath:r.vault,registrySource:i,self:m,verdict:pe,brokenReason:q,descriptors:{count:s.size,sourceless:c,duplicateSlugs:u,declaredEdgeCount:h,carriers:d.size,targets:g.size,danglingDeclarations:p},facts:{edgeCount:ee.length,occurrences:ce,sources:new Set(ee.map(F=>F.source)).size,targets:new Set(ee.map(F=>F.target)).size,coveredByClosure:H,uncoveredDirect:Y,uncoveredByClosure:fe,edges:ee},unresolved:{count:$,countedAsUncovered:Ce,excusedWhileDepsMissing:B,refs:G},degraded:{active:j,strict:N,missingDeps:A,missingDepsInClosure:O,missingDepsOutsideClosure:P,missingDepsPresentInVault:R,unresolvedExcused:B},ambiguous:{count:te,coveredByClosure:Z,uncovered:re,countedAsUncovered:ie,refs:k},nonStringValues:{count:K,sites:V},targetsOutsideAssetspaces:he,scannedSources:He,declaredWithoutFact:{total:Ie.length,byKind:ye,edges:Ie},packaging:Te,targetsWithoutKind:Re,clean:pe==="OK"}}a(aEe,"scanAssetSpaceDepends");function cEe(r){return Object.entries(r).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${e.replace(/^exo__/,"")}\xD7${t}`).join(", ")}a(cEe,"formatPredicates");function lEe(r){let e=r.verdict==="OK"?console.log:console.error,n=`[${r.vaultPath.replace(/\/+$/,"").split("/").pop()??r.vaultPath}${r.self?`, self=${r.self}`:""}, tier=definitions]`,i=r.degraded.active?` (DEGRADED: declared deps absent from merged vault: ${r.degraded.missingDepsInClosure.join(", ")})`:"";e(`${r.verdict}${i} ${r.vaultPath}: assetspace-depends audit ${n} \u2014 uncovered by CLOSURE: ${r.facts.uncoveredByClosure} (verdict), uncovered DIRECTLY: ${r.facts.uncoveredDirect} (informational, not a criterion), ambiguous refs: ${r.ambiguous.count} (covered ${r.ambiguous.coveredByClosure} / uncovered ${r.ambiguous.uncovered}${r.ambiguous.countedAsUncovered?", counted in the verdict":", listed only"}), non-string values under definition-tier predicates: ${r.nonStringValues.count} (skipped, not judged)`),r.brokenReason&&e(`\u26D4 BROKEN: ${r.brokenReason}`),e(`Registry (${r.registrySource}): ${r.descriptors.count} descriptor(s), declared dependsOn edges: ${r.descriptors.declaredEdgeCount} (carriers ${r.descriptors.carriers} \u2192 targets ${r.descriptors.targets}), dangling: ${r.descriptors.danglingDeclarations.length}, sourceless: ${r.descriptors.sourceless.length}, duplicate owner/repo: ${r.descriptors.duplicateSlugs.length}`),e(`Facts (definition tier, ${JV.length} predicates): ${r.facts.edgeCount} cross-AssetSpace edge(s) / ${r.facts.occurrences} occurrence(s) (sources ${r.facts.sources} \u2192 targets ${r.facts.targets}, scanned ${r.scannedSources} source asset(s)); canary covered-by-closure = ${r.facts.coveredByClosure}`);let s=r.degraded.active?`(--self, DEGRADED: NOT counted \u2014 declared deps absent from the merged vault: ${r.degraded.missingDepsInClosure.join(", ")})`:r.unresolved.countedAsUncovered?r.degraded.strict&&r.degraded.missingDeps.length>0?`(--self --strict-unresolved: counted as uncovered despite declared missing deps ${r.degraded.missingDeps.join(", ")})`:"(--self: counted as uncovered \u2014 target absent from the merged vault)":"(fail-open, listed, NOT counted \u2014 validate-wikilinks territory)";e(`Unresolved definition-tier refs: ${r.unresolved.count} ${s}; targets outside assetspaces/: ${r.targetsOutsideAssetspaces}`),r.degraded.active&&e(`\u26A0 unresolved refs excused: ${r.degraded.unresolvedExcused} \u2014 may include refs into undeclared absent AssetSpaces; coverage NOT proven for them (DEGRADED \u2260 proven coverage)`),r.degraded.missingDepsOutsideClosure.length>0&&e(`\u26A0 --missing-dep outside closure(self) \u2014 excuses nothing: ${r.degraded.missingDepsOutsideClosure.join(", ")}`),r.degraded.missingDepsPresentInVault.length>0&&e(`\u26A0 --missing-dep named but PRESENT in the vault (assets found under its assetspaces/ folder) \u2014 ignored, excuses nothing: ${r.degraded.missingDepsPresentInVault.join(", ")}`),e(`Declared without a definition-tier fact (one-sided, never a violation; Reference-kind targets excluded): ${r.declaredWithoutFact.total} \u2014 TBox: ${r.declaredWithoutFact.byKind.TBox}, unkinded: ${r.declaredWithoutFact.byKind.unkinded}, unknown-kind: ${r.declaredWithoutFact.byKind.unknown}; packaging declarations (Reference-kind targets, frame p.4): ${r.packaging}`),e(`Declared targets without exo__AssetSpace_dependsOnKind: ${r.targetsWithoutKind.length}`+(r.targetsWithoutKind.length>0?` \u2014 ${r.targetsWithoutKind.join(", ")}`:"")),e("Declared-graph cycles are NOT judged by this verb (dependsOn = packaging, RFC 306dcb5c frame p.1); facts-graph acyclicity is the scheduled detector's job.");let o=r.facts.edges.filter(l=>!l.coveredByClosure);if(o.length>0){console.error(`
642
- UNCOVERED by closure (src \u2192 tgt, occurrences, predicates):`);for(let l of o){console.error(` ${l.source} \u2192 ${l.target}: ${l.occurrences} [${cEe(l.predicates)}]`);for(let u of l.examples)console.error(` ${u}`)}}if(r.unresolved.refs.length>0){let l=r.unresolved.countedAsUncovered?console.error:e;l(`
641
+ `)}m>0&&process.exit(5)}catch(n){le.handle(n),process.exit(5)}})}a(HV,"applyCommand");ut();ut();var Sp=require("fs"),wF=require("path"),HE=Q(Pe());var UE=Q($o()),VE=Q(require("path")),ll=Q(Pe()),qE=Q(Pe());var Ywe=ll.SDK_FLOOR_ASSETSPACE_UIDS,Du="73bd00e4-ccc0-4f3f-b20d-c4388c4588fb",gF="3de846cd-1f0e-4f98-8613-b8587aa15174",Xwe=5,GE=class{static{a(this,"CliProfileResolver")}constructor(e){this.vaultPaths=[VE.default.resolve(e.vaultPath)],this.maxExtendsDepth=e.maxExtendsDepth??Xwe,this.warn=e.warn??(()=>{})}async resolveFilter(e){if(e==null||e==="")return{outcome:"no-profile"};let t;try{t=await this.scanAllVaults()}catch(f){let d=`[CliProfileResolver] vault scan threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}if(t.profiles.get(e)===void 0)return this.warn(`[CliProfileResolver] profileUid=${e} not found in any scanned vault \u2014 falling back to no-filter (full vault).`),{outcome:"missing-profile",profileUid:e};let i=new Set;try{this.walkProfileChain(e,t.profiles,i,new Set,0)}catch(f){let d=`[CliProfileResolver] profile chain walk threw \u2014 ${String(f)}`;return this.warn(d),{outcome:"error",reason:d}}let s=(0,ll.transitiveDependsOnClosure)(i,t.dependsOn),o=new Set(t.folderMap.values()),c=new Set,l=[];for(let f of s){if(o.has(f)){c.add(f);continue}l.push(f)}for(let f of Ywe)c.add(f);if(!Array.from(c).some(f=>o.has(f))){let f=`[CliProfileResolver] profileUid=${e} produced effective set with zero AssetSpace folder overlap (${c.size} AS UIDs incl. floor; ${t.folderMap.size} folders known). Likely cause: profile declares AssetSpace UIDs not present as descriptors, or vault has no scanned AssetSpaces. Falling back to no-filter (full vault indexed).`;return this.warn(f),{outcome:"degraded",reason:f}}return{outcome:"engaged",result:{effective:c,folderMap:t.folderMap,declaredOntologies:s,untranslated:l}}}walkProfileChain(e,t,n,i,s){if(s>this.maxExtendsDepth)throw new Error(`Profile chain exceeds max depth ${this.maxExtendsDepth} at ${e} \u2014 possible cycle`);if(i.has(e))return;i.add(e);let o=t.get(e);if(o!==void 0){for(let c of o.includes)n.add(c);typeof o.extends=="string"&&o.extends.length>0&&this.walkProfileChain(o.extends,t,n,i,s+1)}}async scanAllVaults(){let e=new Map,t=new Map,n=new Map;for(let i of this.vaultPaths){if(!await UE.default.pathExists(i)){this.warn(`[CliProfileResolver] vault path does not exist: ${i} \u2014 skipping.`);continue}let s=await this.walkVault(i);for(let o of s){let c=Ji(o.frontmatter.exo__Instance_class);if(c.some(l=>l===Du)){let l=Jwe(o.filePath,o.vaultRoot);l.length>0&&!e.has(l)&&e.set(l,o.uid);let u=typeof o.frontmatter.exo__AssetSpace_source=="string"?o.frontmatter.exo__AssetSpace_source:typeof o.frontmatter.exo__AssetSpace_git=="string"?o.frontmatter.exo__AssetSpace_git:"";if(u.length>0){let d=(0,ll.derivePath)(u);d!==null&&e.set(d,o.uid)}let f=Ji(o.frontmatter.exo__AssetSpace_dependsOn);f.length>0&&n.set(o.uid,f)}if(c.some(l=>l===gF)){let l={uid:o.uid,label:typeof o.frontmatter.exo__Asset_label=="string"?o.frontmatter.exo__Asset_label:void 0,includes:Ji(o.frontmatter.exo__Profile_includes),extends:Ji(o.frontmatter.exo__Profile_imports)[0]??null};t.set(o.uid,l)}}}return{folderMap:e,profiles:t,dependsOn:n}}async walkVault(e){let t=[],n=[e];for(;n.length>0;){let i=n.pop(),s;try{s=await UE.default.readdir(i,{withFileTypes:!0})}catch{continue}for(let o of s){let c=VE.default.join(i,o.name);if(o.isDirectory()){if(o.name.startsWith(".")||o.name==="node_modules"||o.name===".obsidian"||o.name===".exocortex")continue;n.push(c);continue}if(!o.isFile()||!o.name.endsWith(".md"))continue;let l=await this.tryReadFrontmatter(c);if(l===null)continue;let u=l.exo__Asset_uid;typeof u!="string"||u.length===0||t.push({uid:u,filePath:c,vaultRoot:e,frontmatter:l})}}return t}async tryReadFrontmatter(e){let t;try{t=await UE.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,ll.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function Ji(r){if(r==null)return[];let e=Array.isArray(r)?r:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=Qwe(n);i!==null&&t.push(i)}return t}a(Ji,"parseWikilinkArray");function Qwe(r){let e=r.trim().replace(/^\[\[/,"").replace(/\]\]$/,"").split("|")[0].trim();return e.length===0?null:e}a(Qwe,"extractUidFromWikilink");function Jwe(r,e){let t=VE.default.relative(e,r).replace(/\\/g,"/");if(!t.startsWith("assetspaces/"))return"";let n=t.slice(12),i=n.indexOf("/");return i<0?"":`assetspaces/${n.slice(0,i)}`}a(Jwe,"parentFolderRelative");var WE=Q($o()),yF=Q(require("path")),_p=Q(Pe());var zE=class{static{a(this,"RegistryDependencyResolver")}constructor(e={}){this.warn=e.warn??(()=>{})}async resolve(e,t){let n=await this.scanRegistry(e),i=this.matchSelf(n,t);if(i===null)return{outcome:"self-not-found",selfIdentifier:t,descriptorCount:n.size};let s=new Map;for(let m of n.values())m.dependsOn.length>0&&s.set(m.uid,m.dependsOn);let o=(0,_p.transitiveDependsOnClosure)([i.uid],s);o.delete(i.uid);let c=[],l=new Set,u=new Set([i.uid]),f=[...i.dependsOn];for(;f.length>0;){let m=f.shift();if(m===void 0||u.has(m))continue;u.add(m),o.has(m)&&!l.has(m)&&(c.push(m),l.add(m));let b=n.get(m);if(b!==void 0)for(let S of b.dependsOn)u.has(S)||f.push(S)}for(let m of o)l.has(m)||(c.push(m),l.add(m));let d=[],p=[];for(let m of c){let b=n.get(m);b===void 0?p.push(m):d.push(b)}let h=d.filter(m=>m.source===null||m.source.length===0),g=d.filter(m=>m.source!==null&&m.source.length>0&&!Zwe(m.source));return{outcome:"resolved",self:i,dependencies:d,missingDescriptors:p,sourceless:h,unsafeSources:g}}matchSelf(e,t){let n=bp(t);if(n!==null)for(let i of e.values()){if(i.source===null)continue;let s=bp(i.source);if(s!==null&&s===n)return i}for(let i of e.values())if(i.namespace!==null&&i.namespace===t)return i;return null}async scanRegistry(e){let t=new Map,n=yF.default.resolve(e);if(!await WE.default.pathExists(n))return this.warn(`[RegistryDependencyResolver] registry path does not exist: ${n}`),t;let i=[n];for(;i.length>0;){let s=i.pop(),o;try{o=await WE.default.readdir(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=yF.default.join(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||c.name==="node_modules"||c.name===".obsidian"||c.name===".exocortex")continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=await this.tryReadFrontmatter(l);if(u===null||!Ji(u.exo__Instance_class).some(m=>m===Du))continue;let d=u.exo__Asset_uid;if(typeof d!="string"||d.length===0)continue;let p=typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:null,h=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:null,g=Ji(u.exo__AssetSpace_dependsOn);t.has(d)&&this.warn(`[RegistryDependencyResolver] duplicate AssetSpace descriptor for uid=${d} \u2014 last wins (${l})`),t.set(d,{uid:d,namespace:h,source:p,dependsOn:g})}}return t}async tryReadFrontmatter(e){let t;try{t=await WE.default.readFile(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,_p.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function bp(r){let e=r.trim();if(e.length===0)return null;let t=(0,_p.derivePath)(e);if(t!==null)return t.replace(/^assetspaces\//,"").toLowerCase();if(!e.includes("://")&&!e.includes("@")){let i=e.replace(/\.git$/i,"").replace(/\/+$/,"").split("/").filter(s=>s.length>0);if(i.length===2)return`${i[0]}/${i[1]}`.toLowerCase()}return null}a(bp,"ownerRepoSlug");function Zwe(r){return typeof r!="string"||r.length===0||/[\s\x00-\x1f]/.test(r)||r.startsWith("-")||/^(ext|file|fd|ftp|ftps)::/i.test(r)?!1:!!(/^https?:\/\/[^\s]+$/i.test(r)||/^ssh:\/\/[^\s]+$/i.test(r)||/^git:\/\/[^\s]+$/i.test(r)||/^[A-Za-z0-9._-]+@[A-Za-z0-9._-]+:[^\s]+$/.test(r))}a(Zwe,"isSafeCloneUrl");_t();Nt();var QV=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,eEe=/^[A-Za-z][A-Za-z0-9-]*__[A-Za-z0-9_-]+$/,tEe=/^assetspaces\/([^/]+)\/([^/]+)\//,JV=["exo__Ontology_imports","exo__Ontology_admits","exo__Property_range","exo__Property_domain","exo__Class_superClass","exo__Property_superProperty","exo__Property_cardinality","exo__Property_minCount"],rEe="e1d7fb5c-d334-448d-935b-953b7b033e78",nEe="fe529085-5370-4ac0-bbe4-1c7351242dee",iEe=5,bF=200;function KE(r){let e=tEe.exec(r.replace(/\\/g,"/"));return e?`${e[1]}/${e[2]}`.toLowerCase():null}a(KE,"assetspaceOfPath");var SF=class{constructor(){this.assets=[];this.uidToPath=new Map;this.pathSet=new Set;this.labelToPaths=new Map;this.basenameToPaths=new Map}static{a(this,"VaultIndex")}add(e){let t=e.path.replace(/\\/g,"/");this.assets.push({...e,path:t}),this.pathSet.add(t);let n=e.metadata.exo__Asset_uid;for(let c of Array.isArray(n)?n:[n])if(typeof c=="string"){let l=c.trim().toLowerCase();l.length>0&&!this.uidToPath.has(l)&&this.uidToPath.set(l,t)}let i=t.slice(t.lastIndexOf("/")+1).replace(/\.md$/,"");_F(this.basenameToPaths,i,t);let s=e.metadata.exo__Asset_label;typeof s=="string"&&s.trim().length>0&&_F(this.labelToPaths,s.trim(),t);let o=e.metadata.aliases;for(let c of Array.isArray(o)?o:[o])typeof c=="string"&&c.trim().length>0&&_F(this.labelToPaths,c.trim(),t)}resolve(e){let t=this.candidates(e);return t.length===0?null:t.length===1?t[0]:"ambiguous"}candidates(e){let t=e;if(QV.test(t)){let i=this.uidToPath.get(t.toLowerCase());return i===void 0?[]:[i]}if(t.includes("/")){let i=t.replace(/^\//,""),s=i.endsWith(".md")?i:`${i}.md`;if(this.pathSet.has(s))return[s];t=i.slice(i.lastIndexOf("/")+1)}t.endsWith(".md")&&(t=t.slice(0,-3));let n=this.distinctByUid(this.labelToPaths.get(t));return n.length>0?n:this.distinctByUid(this.basenameToPaths.get(t))}distinctByUid(e){if(!e||e.size===0)return[];let t=new Set,n=[];for(let i of e){let s=this.assets.find(l=>l.path===i),o=s?s.metadata.exo__Asset_uid:void 0,c=typeof o=="string"?o.trim().toLowerCase():`path:${i}`;t.has(c)||(t.add(c),n.push(i))}return n}};function _F(r,e,t){let n=r.get(e);n?n.add(t):r.set(e,new Set([t]))}a(_F,"addTo");function Pg(r){if(Array.isArray(r)){let e=r.find(t=>typeof t=="string");return typeof e=="string"?e:null}return typeof r=="string"?r:null}a(Pg,"firstString");function sEe(r){let e=Ji(r);if(e.length===0)return"unkinded";let t=e[0].toLowerCase();return t===rEe?"TBox":t===nEe?"Reference":"unknown"}a(sEe,"kindOf");function oEe(r){return r==null?0:(Array.isArray(r)?r:[r]).filter(t=>typeof t=="object"&&t!==null).length}a(oEe,"countStructuredItems");function aEe(r){let e=Array.isArray(r)?r:r==null?[]:[r],t=[];for(let n of e){if(typeof n!="string")continue;let i=n.trim().replace(/^["']|["']$/g,""),s=i.startsWith("[[")&&i.endsWith("]]"),o=(0,HE.extractAssetReference)(i);if(!o)continue;let c=o.split("#")[0].trim();c.length!==0&&(s||QV.test(c)||eEe.test(c))&&t.push(c)}return t}a(aEe,"referencesOf");function YV(r){let e=new Map;for(let t of r){if(Qi(t.path)||gi(t.path)||!Ji(t.metadata.exo__Instance_class).some(c=>c.toLowerCase()===Du))continue;let i=Pg(t.metadata.exo__Asset_uid);if(!i)continue;let s=i.trim().toLowerCase();if(e.has(s))continue;let o=Pg(t.metadata.exo__AssetSpace_source)??Pg(t.metadata.exo__AssetSpace_git);e.set(s,{uid:s,slug:o?bp(o):null,label:Pg(t.metadata.exo__Asset_label)??t.path,path:t.path,dependsOn:Ji(t.metadata.exo__AssetSpace_dependsOn).map(c=>c.toLowerCase()),kind:sEe(t.metadata.exo__AssetSpace_dependsOnKind)})}return e}a(YV,"collectDescriptors");async function cEe(r){let e=new SF,t=new Set,n=new Fn(r.vault,{cacheContent:!1});for(let F of await n.indexedAssets()){if(Qi(F.path)||gi(F.path))continue;let J=Pg(F.metadata.exo__Asset_uid),ue=J?J.trim().toLowerCase():`path:${F.path}`;t.has(ue)||(t.add(ue),e.add(F))}let i,s;if(r.registry){let F=new Fn(r.registry,{cacheContent:!1});s=YV(await F.indexedAssets()),i=r.registry}else s=YV(e.assets),i="vault";let o=new Map,c=[],l=new Map;for(let F of s.values()){if(F.slug===null){c.push(F.label);continue}o.set(F.uid,F.slug);let J=l.get(F.slug);J?J.push(F.uid):l.set(F.slug,[F.uid])}let u=[...l.entries()].filter(([,F])=>F.length>1).map(([F,J])=>({slug:F,uids:J})),f=new Map;for(let F of s.values())F.slug&&f.set(F.slug,F.kind);let d=new Map,p=[],h=0,g=new Set;for(let F of s.values())if(F.slug!==null)for(let J of F.dependsOn){let ue=o.get(J);if(ue===void 0){p.push({source:F.slug,ref:J});continue}if(ue===F.slug)continue;let Se=d.get(F.slug);Se||(Se=[],d.set(F.slug,Se)),Se.includes(ue)||(Se.push(ue),h++,g.add(ue))}let m=null;r.self!==void 0&&(m=bp(r.self),m===null&&(m=r.self.trim().toLowerCase()));let b=new Map,S=a(F=>{let J=b.get(F);if(J!==void 0)return J;let ue=(0,HE.transitiveDependsOnClosure)([F],d);return b.set(F,ue),ue},"closureOf"),_=r.missingDeps??[];if(_.length>0&&m===null)throw new Qe("--missing-dep / --missing-deps-file require --self: in vault mode unresolved refs are already fail-open, so the inputs would be a silent no-op","Pass --self <owner/repo> (the per-repo CI mode) together with the missing deps");let A=[...new Set(_.map(F=>bp(F)??F.trim().toLowerCase()).filter(F=>F.length>0&&F!==m))].sort(),E=m!==null?S(m):new Set,w=new Set;for(let F of e.assets){let J=KE(F.path);J!==null&&w.add(J)}let R=A.filter(F=>w.has(F)),O=A.filter(F=>E.has(F)&&!w.has(F)),P=A.filter(F=>!E.has(F)&&!w.has(F)),N=r.strictUnresolved===!0,j=m!==null&&!N&&O.length>0,U=new Map,G=[],$=0,k=[],te=0,Z=0,re=0,V=[],K=0,he=0,He=0,ce=0;for(let F of e.assets){let J=KE(F.path);if(J!==null&&!(m!==null&&J!==m)){He++;for(let ue of JV){let Se=F.metadata[ue],Oe=oEe(Se);Oe>0&&(K+=Oe,V.length<bF&&V.push({sourcePath:F.path,predicate:ue}));let We=aEe(Se);for(let Ne of We){let ke=e.candidates(Ne);if(ke.length===0){$++,G.length<bF&&G.push({source:J,sourcePath:F.path,predicate:ue,ref:Ne,reason:"not-found"});continue}if(ke.length>1){let ot=[...new Set(ke.map(x=>KE(x)??"<outside assetspaces/>"))].sort(),nt=S(J),C=ot.every(x=>x===J||nt.has(x));te++,C?Z++:re++,k.length<bF&&k.push({source:J,sourcePath:F.path,predicate:ue,ref:Ne,candidates:ot,coveredByClosure:C});continue}let ze=ke[0],xe=KE(ze);if(xe===null){he++;continue}if(xe===J)continue;ce++;let Ve=`${J} ${xe}`,rt=U.get(Ve);rt||(rt={source:J,target:xe,occurrences:0,predicates:{},examples:[],coveredDirect:d.get(J)?.includes(xe)??!1,coveredByClosure:S(J).has(xe)},U.set(Ve,rt)),rt.occurrences++,rt.predicates[ue]=(rt.predicates[ue]??0)+1,rt.examples.length<iEe&&rt.examples.push(`${F.path} --${ue}--> ${Ne}`)}}}}let ee=[...U.values()].sort((F,J)=>Number(F.coveredByClosure)-Number(J.coveredByClosure)||Number(F.coveredDirect)-Number(J.coveredDirect)||F.source.localeCompare(J.source)||F.target.localeCompare(J.target)),H=ee.filter(F=>F.coveredByClosure).length,Y=ee.filter(F=>!F.coveredDirect).length,ie=m!==null,Ce=m!==null&&!j,B=j?$:0,fe=ee.filter(F=>!F.coveredByClosure).length+(ie?re:0)+(Ce?$:0),ae=new Set(ee.map(F=>`${F.source} ${F.target}`)),Ie=[],ye={TBox:0,unkinded:0,unknown:0},Te=0;for(let[F,J]of d)if(!(m!==null&&F!==m))for(let ue of J){let Se=f.get(ue)??"unknown";if(Se==="Reference"){Te++;continue}let Oe=ae.has(`${F} ${ue}`);Oe||(Ie.push({source:F,target:ue,targetKind:Se,hasFact:Oe}),ye[Se]++)}Ie.sort((F,J)=>F.source.localeCompare(J.source)||F.target.localeCompare(J.target));let Re=[...g].filter(F=>(f.get(F)??"unknown")==="unkinded").sort(),pe,q=null;return s.size===0?(pe="BROKEN",q=`no exo__AssetSpace descriptor found (registry: ${i}) \u2014 nothing to judge against`):m!==null&&!l.has(m)?(pe="BROKEN",q=`--self '${r.self}' (${m}) is not a registered AssetSpace (${s.size} descriptor(s) scanned)`):m!==null&&He===0?(pe="BROKEN",q=`--self '${m}': no asset under assetspaces/${m}/ in the vault \u2014 the self content was not merged`):m===null&&ee.length===0?(pe="BROKEN",q="zero definition-tier cross-AssetSpace fact edges \u2014 an empty population cannot be declared covered"):pe=fe===0?"OK":"FAIL",{vaultPath:r.vault,registrySource:i,self:m,verdict:pe,brokenReason:q,descriptors:{count:s.size,sourceless:c,duplicateSlugs:u,declaredEdgeCount:h,carriers:d.size,targets:g.size,danglingDeclarations:p},facts:{edgeCount:ee.length,occurrences:ce,sources:new Set(ee.map(F=>F.source)).size,targets:new Set(ee.map(F=>F.target)).size,coveredByClosure:H,uncoveredDirect:Y,uncoveredByClosure:fe,edges:ee},unresolved:{count:$,countedAsUncovered:Ce,excusedWhileDepsMissing:B,refs:G},degraded:{active:j,strict:N,missingDeps:A,missingDepsInClosure:O,missingDepsOutsideClosure:P,missingDepsPresentInVault:R,unresolvedExcused:B},ambiguous:{count:te,coveredByClosure:Z,uncovered:re,countedAsUncovered:ie,refs:k},nonStringValues:{count:K,sites:V},targetsOutsideAssetspaces:he,scannedSources:He,declaredWithoutFact:{total:Ie.length,byKind:ye,edges:Ie},packaging:Te,targetsWithoutKind:Re,clean:pe==="OK"}}a(cEe,"scanAssetSpaceDepends");function lEe(r){return Object.entries(r).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e,t])=>`${e.replace(/^exo__/,"")}\xD7${t}`).join(", ")}a(lEe,"formatPredicates");function uEe(r){let e=r.verdict==="OK"?console.log:console.error,n=`[${r.vaultPath.replace(/\/+$/,"").split("/").pop()??r.vaultPath}${r.self?`, self=${r.self}`:""}, tier=definitions]`,i=r.degraded.active?` (DEGRADED: declared deps absent from merged vault: ${r.degraded.missingDepsInClosure.join(", ")})`:"";e(`${r.verdict}${i} ${r.vaultPath}: assetspace-depends audit ${n} \u2014 uncovered by CLOSURE: ${r.facts.uncoveredByClosure} (verdict), uncovered DIRECTLY: ${r.facts.uncoveredDirect} (informational, not a criterion), ambiguous refs: ${r.ambiguous.count} (covered ${r.ambiguous.coveredByClosure} / uncovered ${r.ambiguous.uncovered}${r.ambiguous.countedAsUncovered?", counted in the verdict":", listed only"}), non-string values under definition-tier predicates: ${r.nonStringValues.count} (skipped, not judged)`),r.brokenReason&&e(`\u26D4 BROKEN: ${r.brokenReason}`),e(`Registry (${r.registrySource}): ${r.descriptors.count} descriptor(s), declared dependsOn edges: ${r.descriptors.declaredEdgeCount} (carriers ${r.descriptors.carriers} \u2192 targets ${r.descriptors.targets}), dangling: ${r.descriptors.danglingDeclarations.length}, sourceless: ${r.descriptors.sourceless.length}, duplicate owner/repo: ${r.descriptors.duplicateSlugs.length}`),e(`Facts (definition tier, ${JV.length} predicates): ${r.facts.edgeCount} cross-AssetSpace edge(s) / ${r.facts.occurrences} occurrence(s) (sources ${r.facts.sources} \u2192 targets ${r.facts.targets}, scanned ${r.scannedSources} source asset(s)); canary covered-by-closure = ${r.facts.coveredByClosure}`);let s=r.degraded.active?`(--self, DEGRADED: NOT counted \u2014 declared deps absent from the merged vault: ${r.degraded.missingDepsInClosure.join(", ")})`:r.unresolved.countedAsUncovered?r.degraded.strict&&r.degraded.missingDeps.length>0?`(--self --strict-unresolved: counted as uncovered despite declared missing deps ${r.degraded.missingDeps.join(", ")})`:"(--self: counted as uncovered \u2014 target absent from the merged vault)":"(fail-open, listed, NOT counted \u2014 validate-wikilinks territory)";e(`Unresolved definition-tier refs: ${r.unresolved.count} ${s}; targets outside assetspaces/: ${r.targetsOutsideAssetspaces}`),r.degraded.active&&e(`\u26A0 unresolved refs excused: ${r.degraded.unresolvedExcused} \u2014 may include refs into undeclared absent AssetSpaces; coverage NOT proven for them (DEGRADED \u2260 proven coverage)`),r.degraded.missingDepsOutsideClosure.length>0&&e(`\u26A0 --missing-dep outside closure(self) \u2014 excuses nothing: ${r.degraded.missingDepsOutsideClosure.join(", ")}`),r.degraded.missingDepsPresentInVault.length>0&&e(`\u26A0 --missing-dep named but PRESENT in the vault (assets found under its assetspaces/ folder) \u2014 ignored, excuses nothing: ${r.degraded.missingDepsPresentInVault.join(", ")}`),e(`Declared without a definition-tier fact (one-sided, never a violation; Reference-kind targets excluded): ${r.declaredWithoutFact.total} \u2014 TBox: ${r.declaredWithoutFact.byKind.TBox}, unkinded: ${r.declaredWithoutFact.byKind.unkinded}, unknown-kind: ${r.declaredWithoutFact.byKind.unknown}; packaging declarations (Reference-kind targets, frame p.4): ${r.packaging}`),e(`Declared targets without exo__AssetSpace_dependsOnKind: ${r.targetsWithoutKind.length}`+(r.targetsWithoutKind.length>0?` \u2014 ${r.targetsWithoutKind.join(", ")}`:"")),e("Declared-graph cycles are NOT judged by this verb (dependsOn = packaging, RFC 306dcb5c frame p.1); facts-graph acyclicity is the scheduled detector's job.");let o=r.facts.edges.filter(l=>!l.coveredByClosure);if(o.length>0){console.error(`
642
+ UNCOVERED by closure (src \u2192 tgt, occurrences, predicates):`);for(let l of o){console.error(` ${l.source} \u2192 ${l.target}: ${l.occurrences} [${lEe(l.predicates)}]`);for(let u of l.examples)console.error(` ${u}`)}}if(r.unresolved.refs.length>0){let l=r.unresolved.countedAsUncovered?console.error:e;l(`
643
643
  Unresolved definition-tier references (${r.unresolved.count}${r.degraded.active?"; excused \u2014 DEGRADED, coverage NOT proven":""}):`);for(let u of r.unresolved.refs.slice(0,50))l(` ${u.source}: ${u.sourcePath} --${u.predicate}--> ${u.ref} (${u.reason})`);r.unresolved.count>50&&l(` \u2026 ${r.unresolved.count-50} more`)}if(r.ambiguous.refs.length>0){let l=r.ambiguous.countedAsUncovered?console.error:e;l(`
644
644
  Ambiguous definition-tier references (${r.ambiguous.count}; \u22652 distinct UIDs under one label \u2014 covered only when EVERY candidate's AssetSpace is in the source's closure):`);for(let u of r.ambiguous.refs.slice(0,50))l(` ${u.coveredByClosure?"covered ":"UNCOVERED"} ${u.source}: ${u.sourcePath} --${u.predicate}--> ${u.ref} \u2192 {${u.candidates.join(", ")}}`);r.ambiguous.count>50&&l(` \u2026 ${r.ambiguous.count-50} more`)}if(r.nonStringValues.sites.length>0){e(`
645
645
  Non-string values under definition-tier predicates (${r.nonStringValues.count}; unquoted [[uid]] parses to a nested array \u2014 not readable, not judged):`);for(let l of r.nonStringValues.sites.slice(0,50))e(` ${l.sourcePath} --${l.predicate}`)}let c=r.facts.edges.filter(l=>l.coveredByClosure&&!l.coveredDirect);if(c.length>0){e(`
646
646
  Covered transitively only (informational \u2014 not required, not forbidden):`);for(let l of c)e(` ${l.source} \u2192 ${l.target}: ${l.occurrences}`)}if(r.declaredWithoutFact.edges.length>0){e(`
647
647
  Declared without a definition-tier fact (informational):`);for(let l of r.declaredWithoutFact.edges)e(` ${l.source} \u2192 ${l.target} [${l.targetKind}]`)}if(r.descriptors.danglingDeclarations.length>0){e(`
648
- Dangling dependsOn declarations (no descriptor for the target UID):`);for(let l of r.descriptors.danglingDeclarations)e(` ${l.source} \u2192 ${l.ref}`)}}a(lEe,"printText");function uEe(r){let e=(0,wF.resolve)(r),t;try{t=(0,Sp.readFileSync)(e,"utf-8")}catch(i){let s=i.code;throw s==="ENOENT"||s==="EISDIR"||s==="ENOTDIR"?new Qe(`--missing-deps-file: not found or not a readable file: ${e}`,"The CI step writes it to $RUNNER_TEMP/missing-deps.txt from its failed clones; pass an existing file (one owner/repo per line) or omit the flag",{path:e,code:s}):i}let n=[];for(let i of t.split(/\r?\n/)){let s=i.replace(/#.*$/,"").trim();s.length>0&&n.push(s)}return n}a(uEe,"readMissingDepsFile");function XV(r){let e=(0,wF.resolve)(r);if(!(0,Sp.existsSync)(e)||!(0,Sp.statSync)(e).isDirectory())throw new Fe(e);return e}a(XV,"assertDirectory");function ZV(){return new de("assetspace-depends").description("Coverage gate for exo__AssetSpace_dependsOn (RFC 306dcb5c): every definition-tier cross-AssetSpace reference must have its target in the source AssetSpace's declared transitive closure. Prints uncovered-by-closure (verdict) AND uncovered-directly (informational); one-sided (declarations without facts are never violations); no cycle check on the declared graph; BROKEN (exit 2) on an empty population. --self <owner/repo> = per-repo CI mode (unresolvable targets count as uncovered \u2014 unless --missing-dep / --missing-deps-file name a declared dep absent from the merged vault, then they are EXCUSED into an OK (DEGRADED \u2026) verdict with the blind spot printed; req 8d432214).").requiredOption("--vault <path>","The ONE vault root measured (a canonical vault, or the CI merged vault) \u2014 every number carries it as its scope label").option("--registry <path>","Registry checkout holding the exo__AssetSpace descriptors (default: descriptors found in the vault(s))").option("--self <owner/repo>","Per-repo mode: judge only fact edges whose source is this AssetSpace (github.repository form); unresolvable definition-tier refs count as uncovered (unless a missing dep is named)").option("--missing-dep <owner/repo>","Declared dependsOn target that could NOT be materialised into the merged vault (repeatable; owner/repo or clone URL, keyed exactly like --self). With --self and the dep inside self's closure: unresolved refs are EXCUSED into an OK (DEGRADED \u2026) verdict, exit 0, and the blind spot is printed. Requires --self.",(r,e)=>[...e,r],[]).option("--missing-deps-file <path>","File with one missing dep per line (# comments and blank lines ignored) \u2014 same semantics as --missing-dep; the CI step writes it from its failed clones. Requires --self.").option("--strict-unresolved","Count unresolved refs as uncovered even when missing deps are named (the strict --self behaviour of req 04208713)").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=XV(r.vault),n=r.registry?XV(r.registry):void 0;if(((r.missingDep?.length??0)>0||r.missingDepsFile!==void 0)&&r.self===void 0)throw new Qe("--missing-dep / --missing-deps-file require --self: in vault mode unresolved refs are already fail-open, so the inputs would be a silent no-op","Pass --self <owner/repo> (the per-repo CI mode) together with the missing deps");let s=[...r.missingDep??[],...r.missingDepsFile?uEe(r.missingDepsFile):[]],o=await aEe({vault:t,registry:n,self:r.self,missingDeps:s,strictUnresolved:r.strictUnresolved===!0});e==="json"?console.log(JSON.stringify(o,null,2)):lEe(o),o.verdict==="BROKEN"?process.exitCode=2:o.verdict==="FAIL"&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(ZV,"auditAssetSpaceDependsCommand");ut();var YE=require("fs"),vF=Q(require("path")),eG=require("path"),tG=Q(Pe());_t();Nt();var fEe=5;function EF(r,e,t){r[e].length<fEe&&r[e].push(t)}a(EF,"addExample");async function dEe(r){let e=new Fn(r),t=await e.indexedAssets(),n=[],i={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0},s={"empty-isDefinedBy":[],"bang-prefix":[],unresolvable:[]},o=0;for(let{path:c,metadata:l}of t){if(c.split("/").includes("node_modules")||gi(c))continue;let u=l.exo__Asset_isDefinedBy,f=(0,tG.extractAssetReference)(u);if(!f){i["empty-isDefinedBy"]++,EF(s,"empty-isDefinedBy",c);continue}if(f.startsWith("!")){i["bang-prefix"]++,EF(s,"bang-prefix",c);continue}let d=await ro(e,f,c);if(!d){i.unresolvable++,EF(s,"unresolvable",c);continue}o++;let p=QP(vF.default.dirname(d)),h=QP(vF.default.dirname(c));p!==h&&n.push({path:c,isDefinedBy:f,expectedFolder:p,actualFolder:h})}return{vaultPath:r,totalFiles:t.length,checked:o,violations:n,skips:i,skipExamples:s}}a(dEe,"scanVaultForCoLocation");function rG(){return new de("co-location").description("Detect asset\u2013ontology co-location violations: any asset not in the folder of its exo__Asset_isDefinedBy ontology file (fail-open, skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,eG.resolve)(r.vault);if(!(0,YE.existsSync)(t)||!(0,YE.statSync)(t).isDirectory())throw new Fe(t);let n=await dEe(t),i=n.skips["empty-isDefinedBy"]+n.skips["bang-prefix"]+n.skips.unresolvable;if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 co-location violations (${n.checked}/${n.totalFiles} checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} co-location violation(s) (${n.checked}/${n.totalFiles} checked):`);for(let s of n.violations)console.error(` ${s.path}
648
+ Dangling dependsOn declarations (no descriptor for the target UID):`);for(let l of r.descriptors.danglingDeclarations)e(` ${l.source} \u2192 ${l.ref}`)}}a(uEe,"printText");function fEe(r){let e=(0,wF.resolve)(r),t;try{t=(0,Sp.readFileSync)(e,"utf-8")}catch(i){let s=i.code;throw s==="ENOENT"||s==="EISDIR"||s==="ENOTDIR"?new Qe(`--missing-deps-file: not found or not a readable file: ${e}`,"The CI step writes it to $RUNNER_TEMP/missing-deps.txt from its failed clones; pass an existing file (one owner/repo per line) or omit the flag",{path:e,code:s}):i}let n=[];for(let i of t.split(/\r?\n/)){let s=i.replace(/#.*$/,"").trim();s.length>0&&n.push(s)}return n}a(fEe,"readMissingDepsFile");function XV(r){let e=(0,wF.resolve)(r);if(!(0,Sp.existsSync)(e)||!(0,Sp.statSync)(e).isDirectory())throw new Fe(e);return e}a(XV,"assertDirectory");function ZV(){return new de("assetspace-depends").description("Coverage gate for exo__AssetSpace_dependsOn (RFC 306dcb5c): every definition-tier cross-AssetSpace reference must have its target in the source AssetSpace's declared transitive closure. Prints uncovered-by-closure (verdict) AND uncovered-directly (informational); one-sided (declarations without facts are never violations); no cycle check on the declared graph; BROKEN (exit 2) on an empty population. --self <owner/repo> = per-repo CI mode (unresolvable targets count as uncovered \u2014 unless --missing-dep / --missing-deps-file name a declared dep absent from the merged vault, then they are EXCUSED into an OK (DEGRADED \u2026) verdict with the blind spot printed; req 8d432214).").requiredOption("--vault <path>","The ONE vault root measured (a canonical vault, or the CI merged vault) \u2014 every number carries it as its scope label").option("--registry <path>","Registry checkout holding the exo__AssetSpace descriptors (default: descriptors found in the vault(s))").option("--self <owner/repo>","Per-repo mode: judge only fact edges whose source is this AssetSpace (github.repository form); unresolvable definition-tier refs count as uncovered (unless a missing dep is named)").option("--missing-dep <owner/repo>","Declared dependsOn target that could NOT be materialised into the merged vault (repeatable; owner/repo or clone URL, keyed exactly like --self). With --self and the dep inside self's closure: unresolved refs are EXCUSED into an OK (DEGRADED \u2026) verdict, exit 0, and the blind spot is printed. Requires --self.",(r,e)=>[...e,r],[]).option("--missing-deps-file <path>","File with one missing dep per line (# comments and blank lines ignored) \u2014 same semantics as --missing-dep; the CI step writes it from its failed clones. Requires --self.").option("--strict-unresolved","Count unresolved refs as uncovered even when missing deps are named (the strict --self behaviour of req 04208713)").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=XV(r.vault),n=r.registry?XV(r.registry):void 0;if(((r.missingDep?.length??0)>0||r.missingDepsFile!==void 0)&&r.self===void 0)throw new Qe("--missing-dep / --missing-deps-file require --self: in vault mode unresolved refs are already fail-open, so the inputs would be a silent no-op","Pass --self <owner/repo> (the per-repo CI mode) together with the missing deps");let s=[...r.missingDep??[],...r.missingDepsFile?fEe(r.missingDepsFile):[]],o=await cEe({vault:t,registry:n,self:r.self,missingDeps:s,strictUnresolved:r.strictUnresolved===!0});e==="json"?console.log(JSON.stringify(o,null,2)):uEe(o),o.verdict==="BROKEN"?process.exitCode=2:o.verdict==="FAIL"&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(ZV,"auditAssetSpaceDependsCommand");ut();var YE=require("fs"),vF=Q(require("path")),eG=require("path"),tG=Q(Pe());_t();Nt();var dEe=5;function EF(r,e,t){r[e].length<dEe&&r[e].push(t)}a(EF,"addExample");async function pEe(r){let e=new Fn(r),t=await e.indexedAssets(),n=[],i={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0},s={"empty-isDefinedBy":[],"bang-prefix":[],unresolvable:[]},o=0;for(let{path:c,metadata:l}of t){if(c.split("/").includes("node_modules")||gi(c))continue;let u=l.exo__Asset_isDefinedBy,f=(0,tG.extractAssetReference)(u);if(!f){i["empty-isDefinedBy"]++,EF(s,"empty-isDefinedBy",c);continue}if(f.startsWith("!")){i["bang-prefix"]++,EF(s,"bang-prefix",c);continue}let d=await ro(e,f,c);if(!d){i.unresolvable++,EF(s,"unresolvable",c);continue}o++;let p=QP(vF.default.dirname(d)),h=QP(vF.default.dirname(c));p!==h&&n.push({path:c,isDefinedBy:f,expectedFolder:p,actualFolder:h})}return{vaultPath:r,totalFiles:t.length,checked:o,violations:n,skips:i,skipExamples:s}}a(pEe,"scanVaultForCoLocation");function rG(){return new de("co-location").description("Detect asset\u2013ontology co-location violations: any asset not in the folder of its exo__Asset_isDefinedBy ontology file (fail-open, skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,eG.resolve)(r.vault);if(!(0,YE.existsSync)(t)||!(0,YE.statSync)(t).isDirectory())throw new Fe(t);let n=await pEe(t),i=n.skips["empty-isDefinedBy"]+n.skips["bang-prefix"]+n.skips.unresolvable;if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 co-location violations (${n.checked}/${n.totalFiles} checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} co-location violation(s) (${n.checked}/${n.totalFiles} checked):`);for(let s of n.violations)console.error(` ${s.path}
649
649
  isDefinedBy=${s.isDefinedBy} expected=${s.expectedFolder}/ actual=${s.actualFolder}/`)}console.error(`
650
- Skipped (fail-open, NOT verified): ${i} \u2014 empty-isDefinedBy=${n.skips["empty-isDefinedBy"]}, bang-prefix=${n.skips["bang-prefix"]}, unresolvable(cross-vault/missing)=${n.skips.unresolvable}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(rG,"auditCoLocationCommand");ut();var QE=require("fs"),hG=require("path"),IF=Q(Pe());function nG(r,e){let t=new Map,n=new Map,i=new Set,s=[],o=[],c=0;for(let l of r){if(t.has(l))continue;let u=[],f=a(d=>{t.set(d,c),n.set(d,c),c++,s.push(d),i.add(d),u.push([d,(e.get(d)??new Set).values()])},"pushNode");for(f(l);u.length>0;){let[d,p]=u[u.length-1],h=p.next();if(h.done){if(u.pop(),u.length>0){let g=u[u.length-1][0];n.set(g,Math.min(n.get(g),n.get(d)))}if(n.get(d)===t.get(d)){let g=[],m;do m=s.pop(),i.delete(m),g.push(m);while(m!==d);o.push(g)}}else{let g=h.value;t.has(g)?i.has(g)&&n.set(d,Math.min(n.get(d),t.get(g))):f(g)}}}return o}a(nG,"stronglyConnectedComponents");function iG(r,e){return nG(r,e).filter(t=>t.length>=2)}a(iG,"tarjanSCC");function XE(r,e){let t=new Map;for(let n of r){let i=new Set,s=[...e.get(n)??[]];for(;s.length>0;){let o=s.shift();if(!i.has(o)){i.add(o);for(let c of e.get(o)??[])i.has(c)||s.push(c)}}t.set(n,i)}return t}a(XE,"transitiveClosure");function sG(r,e){let t=nG(r,e),n=new Map;t.forEach((s,o)=>{for(let c of s)n.set(c,o)});let i=new Map;for(let[s,o]of e){let c=n.get(s);if(c!==void 0)for(let l of o){let u=n.get(l);if(u===void 0||c===u)continue;let f=i.get(c);f||(f=new Set,i.set(c,f)),f.add(u)}}return{components:t,componentOf:n,condensedEdges:i}}a(sG,"condense");function oG(r,e){let t=XE(r,e),n=new Map;for(let[i,s]of e)for(let o of s){let c=!1;for(let l of s)if(l!==o&&t.get(l)?.has(o)){c=!0;break}if(!c){let l=n.get(i);l||(l=new Set,n.set(i,l)),l.add(o)}}return n}a(oG,"transitiveReduction");function aG(r,e){let t=new Map,n=new Map;for(let p of r)t.set(p,new Map),n.set(p,new Map);for(let p of e){if(p.source===p.target)continue;let h=t.get(p.source),g=n.get(p.target);!h||!g||(h.set(p.target,(h.get(p.target)??0)+p.weight),g.set(p.source,(g.get(p.source)??0)+p.weight))}let i=new Set(r),s=[],o=[],c=a(p=>{i.delete(p);for(let h of t.get(p).keys())n.get(h)?.delete(p);for(let h of n.get(p).keys())t.get(h)?.delete(p);t.get(p).clear(),n.get(p).clear()},"removeNode"),l=a(p=>{let h=0;for(let g of p.values())h+=g;return h},"sumWeights"),u=a(()=>[...i].sort(),"sortedRemaining");for(;i.size>0;){let p=!0;for(;p;){p=!1;for(let h of u())i.has(h)&&t.get(h).size===0&&(o.unshift(h),c(h),p=!0);for(let h of u())i.has(h)&&n.get(h).size===0&&(s.push(h),c(h),p=!0)}if(i.size>0){let h=null,g=-1/0;for(let m of u()){let b=l(t.get(m))-l(n.get(m));b>g&&(g=b,h=m)}h!==null&&(s.push(h),c(h))}}let f=[...s,...o],d=new Map(f.map((p,h)=>[p,h]));return e.filter(p=>{if(p.source===p.target)return!1;let h=d.get(p.source),g=d.get(p.target);return h===void 0||g===void 0?!1:h>g})}a(aG,"greedyFeedbackArcSet");var uG=Q(Pe());var cG=/\[\[([^\]]+)\]\]/g;function pEe(r){let e=r.split(`
650
+ Skipped (fail-open, NOT verified): ${i} \u2014 empty-isDefinedBy=${n.skips["empty-isDefinedBy"]}, bang-prefix=${n.skips["bang-prefix"]}, unresolvable(cross-vault/missing)=${n.skips.unresolvable}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(rG,"auditCoLocationCommand");ut();var QE=require("fs"),hG=require("path"),IF=Q(Pe());function nG(r,e){let t=new Map,n=new Map,i=new Set,s=[],o=[],c=0;for(let l of r){if(t.has(l))continue;let u=[],f=a(d=>{t.set(d,c),n.set(d,c),c++,s.push(d),i.add(d),u.push([d,(e.get(d)??new Set).values()])},"pushNode");for(f(l);u.length>0;){let[d,p]=u[u.length-1],h=p.next();if(h.done){if(u.pop(),u.length>0){let g=u[u.length-1][0];n.set(g,Math.min(n.get(g),n.get(d)))}if(n.get(d)===t.get(d)){let g=[],m;do m=s.pop(),i.delete(m),g.push(m);while(m!==d);o.push(g)}}else{let g=h.value;t.has(g)?i.has(g)&&n.set(d,Math.min(n.get(d),t.get(g))):f(g)}}}return o}a(nG,"stronglyConnectedComponents");function iG(r,e){return nG(r,e).filter(t=>t.length>=2)}a(iG,"tarjanSCC");function XE(r,e){let t=new Map;for(let n of r){let i=new Set,s=[...e.get(n)??[]];for(;s.length>0;){let o=s.shift();if(!i.has(o)){i.add(o);for(let c of e.get(o)??[])i.has(c)||s.push(c)}}t.set(n,i)}return t}a(XE,"transitiveClosure");function sG(r,e){let t=nG(r,e),n=new Map;t.forEach((s,o)=>{for(let c of s)n.set(c,o)});let i=new Map;for(let[s,o]of e){let c=n.get(s);if(c!==void 0)for(let l of o){let u=n.get(l);if(u===void 0||c===u)continue;let f=i.get(c);f||(f=new Set,i.set(c,f)),f.add(u)}}return{components:t,componentOf:n,condensedEdges:i}}a(sG,"condense");function oG(r,e){let t=XE(r,e),n=new Map;for(let[i,s]of e)for(let o of s){let c=!1;for(let l of s)if(l!==o&&t.get(l)?.has(o)){c=!0;break}if(!c){let l=n.get(i);l||(l=new Set,n.set(i,l)),l.add(o)}}return n}a(oG,"transitiveReduction");function aG(r,e){let t=new Map,n=new Map;for(let p of r)t.set(p,new Map),n.set(p,new Map);for(let p of e){if(p.source===p.target)continue;let h=t.get(p.source),g=n.get(p.target);!h||!g||(h.set(p.target,(h.get(p.target)??0)+p.weight),g.set(p.source,(g.get(p.source)??0)+p.weight))}let i=new Set(r),s=[],o=[],c=a(p=>{i.delete(p);for(let h of t.get(p).keys())n.get(h)?.delete(p);for(let h of n.get(p).keys())t.get(h)?.delete(p);t.get(p).clear(),n.get(p).clear()},"removeNode"),l=a(p=>{let h=0;for(let g of p.values())h+=g;return h},"sumWeights"),u=a(()=>[...i].sort(),"sortedRemaining");for(;i.size>0;){let p=!0;for(;p;){p=!1;for(let h of u())i.has(h)&&t.get(h).size===0&&(o.unshift(h),c(h),p=!0);for(let h of u())i.has(h)&&n.get(h).size===0&&(s.push(h),c(h),p=!0)}if(i.size>0){let h=null,g=-1/0;for(let m of u()){let b=l(t.get(m))-l(n.get(m));b>g&&(g=b,h=m)}h!==null&&(s.push(h),c(h))}}let f=[...s,...o],d=new Map(f.map((p,h)=>[p,h]));return e.filter(p=>{if(p.source===p.target)return!1;let h=d.get(p.source),g=d.get(p.target);return h===void 0||g===void 0?!1:h>g})}a(aG,"greedyFeedbackArcSet");var uG=Q(Pe());var cG=/\[\[([^\]]+)\]\]/g;function hEe(r){let e=r.split(`
651
651
  `),t=[],n=null;for(let i of e){let s=i.match(/^[ \t]*(`{3,}|~{3,})/),o=s&&(s[1][0]==="~"||!i.slice(i.indexOf(s[1])+s[1].length).includes("`"));n===null?o?n=s[1]:t.push(i):s&&s[1][0]===n[0]&&s[1].length>=n.length&&/^[ \t]*(?:`{3,}|~{3,})[ \t]*$/.test(i)&&(n=null)}return t.join(`
652
- `)}a(pEe,"stripFencedCodeBlocks");function lG(r){let e=[],t;for(cG.lastIndex=0;(t=cG.exec(r))!==null;){let n=t[1],i=n.indexOf("|");i!==-1&&(n=n.slice(0,i));let s=n.indexOf("#");s!==-1&&(n=n.slice(0,s));let o=n.trim();o.length>0&&e.push(o)}return e}a(lG,"extractWikilinkTargets");function TF(r){return typeof r=="string"?[r]:Array.isArray(r)?r.flatMap(TF):r!==null&&typeof r=="object"?Object.values(r).flatMap(TF):[]}a(TF,"collectFrontmatterStrings");function hEe(r){let e=(0,uG.matchFrontmatterBlock)(r);return e?r.slice(e.blockEnd):r}a(hEe,"bodyOf");function fG(r,e,t){let n=[];for(let[s,o]of Object.entries(r))if(!t?.has(s))for(let c of TF(o))for(let l of lG(c))n.push(l);let i=lG(pEe(hEe(e)));return[...n,...i]}a(fG,"extractFileWikilinkTargets");var mEe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function dG(r,e){if(e.includes("/")){let n=e.replace(/^\//,""),i=n.endsWith(".md")?n:`${n}.md`;if(await r.hasIndexedPath(i))return i;e=n.slice(n.lastIndexOf("/")+1)}if(e.endsWith(".md")&&(e=e.slice(0,-3)),mEe.test(e)){let n=await r.findFileByUID(e);if(n)return n}let t=await r.findPathsByBasename(e);return t.length===1?t[0]:t.length>1?new Set(t).size===1?t[0]:"ambiguous":null}a(dG,"resolveTargetPath");_t();Nt();var gEe="\0",yEe="829b9b3b-6fc3-4276-be6a-27d3398c012e",bEe=["exo__Asset_relates","concept__Concept_related","concept__Concept_broader","concept__Concept_synonym","exo__Asset_createdBy"],_Ee=5,SEe=10,wEe=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif","pdf","mp3","wav","m4a","ogg","flac","mp4","mov","webm","avi","mkv","zip","gz","tar","canvas","base","json","css","js","ts","html"]);function EEe(r){let e=r.lastIndexOf(".");if(e===-1||e===r.length-1)return!1;let t=r.slice(e+1).toLowerCase();return wEe.has(t)}a(EEe,"nonMarkdownExtension");function AF(r){if(Array.isArray(r)){let e=r.filter(t=>typeof t=="string");return{value:e[0]??null,multiple:e.length>1}}return{value:typeof r=="string"?r:null,multiple:!1}}a(AF,"firstString");function pG(r){let e=Array.isArray(r)?r:r==null?[]:[r],t=[];for(let n of e){let i=(0,IF.extractAssetReference)(n);i&&t.push(i)}return t}a(pG,"asRefList");function Fg(r,e,t=_Ee){r.length<t&&r.push(e)}a(Fg,"pushExample");async function vEe(r,e={}){let t=new Fn(r,{cacheContent:!0}),n=await t.indexedAssets(),i=new Set(e.excludePredicates??[]),s=new Map,o=new Map,c=new Map,l=[];for(let B of n){if(Qi(B.path)||gi(B.path)||!pG(B.metadata.exo__Instance_class).includes(yEe))continue;let{value:ae}=AF(B.metadata.exo__Asset_uid);if(!ae){l.push(B.path);continue}let{value:Ie}=AF(B.metadata.exo__Asset_label),ye=Ie??B.path,Te=c.get(ae);Te?Te.push(B.path):c.set(ae,[B.path]),s.set(B.path,ae),o.has(ae)||o.set(ae,{uid:ae,label:ye,path:B.path,metadata:B.metadata})}let u=[...c.entries()].filter(([,B])=>B.length>1).map(([B,fe])=>({uid:B,paths:fe})),f=new Map,d={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0,"not-an-ontology":0},p=[],h=0,g=0,m=new Map,b=0,S=a((B,fe)=>{f.set(B,null),d[fe]++,h++,Fg(p,`${B} (${fe})`,SEe)},"markNoOntology");for(let B of n){if(Qi(B.path)||gi(B.path))continue;b++;let fe=B.metadata.exo__Asset_isDefinedBy,{value:ae,multiple:Ie}=AF(fe);Ie&&g++;let ye=(0,IF.extractAssetReference)(ae);if(!ye){S(B.path,"empty-isDefinedBy");continue}if(ye.startsWith("!")){S(B.path,"bang-prefix");continue}let Te=await ro(t,ye,B.path);if(!Te){S(B.path,"unresolvable");continue}let Re=s.get(Te);if(!Re){S(B.path,"not-an-ontology");continue}f.set(B.path,Re),m.set(Re,(m.get(Re)??0)+1)}let _=[...o.keys()],A=new Map,E=[],w=new Map,R=new Map,O=0;for(let B of _){let fe=o.get(B),ae=pG(fe.metadata.exo__Ontology_imports),Ie=[],ye=[],Te=!1;for(let Re of ae){let pe=null;if(o.has(Re))pe=Re;else{let q=await ro(t,Re,fe.path);pe=q?s.get(q)??null:null}if(pe===null)ye.push(Re);else if(pe===B)Te=!0;else{Ie.push(pe);let q=A.get(B);q||(q=new Set,A.set(B,q)),q.has(pe)||(q.add(pe),O++)}}w.set(B,Ie),R.set(B,ye),Te&&E.push(B)}let P=iG(_,A),N=XE(_,A),j={total:0,internal:0,crossOntologyValid:0,crossOntologyViolation:0,crossVault:0,noOntology:0},U={broken:0,"dup-basename":0,"non-markdown":0},G={broken:[],"dup-basename":[],"non-markdown":[]},$=new Map,k=new Map,te=new Map,Z=new Map,re=new Map,V=new Map,K=a(B=>{let fe=o.get(B);return fe?{uid:fe.uid,label:fe.label,path:fe.path}:{uid:B,label:B,path:""}},"toRef");for(let B of n){if(Qi(B.path)||gi(B.path))continue;let fe=f.get(B.path)??null,ae=fG(B.metadata,B.content??"",i);for(let Ie of ae){if(j.total++,EEe(Ie)){U["non-markdown"]++,Fg(G["non-markdown"],`${B.path} \u2192 ${Ie}`);continue}let ye=await dG(t,Ie);if(ye==="ambiguous"){U["dup-basename"]++,Fg(G["dup-basename"],`${B.path} \u2192 ${Ie}`);continue}if(ye===null){U.broken++,Fg(G.broken,`${B.path} \u2192 ${Ie}`);continue}let Te=f.get(ye)??s.get(ye)??null;if(fe===null||Te===null){j.noOntology++;continue}if(fe===Te){j.internal++,te.set(fe,(te.get(fe)??0)+1);continue}let Re=N.get(fe)?.has(Te)??!1,pe=`${fe}${gEe}${Te}`,q=$.get(pe);if(q?q.occurrences++:$.set(pe,{source:fe,target:Te,occurrences:1,valid:Re}),Z.set(fe,(Z.get(fe)??0)+1),re.set(Te,(re.get(Te)??0)+1),Re)j.crossOntologyValid++;else{j.crossOntologyViolation++,V.set(fe,(V.get(fe)??0)+1);let F=k.get(pe);F?(F.occurrences++,Fg(F.examples,B.path)):k.set(pe,{source:fe,target:Te,occurrences:1,examples:[B.path]})}}}let he=[...$.values()].sort((B,fe)=>fe.occurrences-B.occurrences),He=new Map,ce=new Map;for(let B of he)ce.set(B.source,(ce.get(B.source)??0)+1),He.set(B.target,(He.get(B.target)??0)+1);let ee=_.map(B=>({...K(B),declaredImports:w.get(B)??[],unresolvedImports:R.get(B)??[],selfImport:E.includes(B),assetCount:m.get(B)??0,inDegree:He.get(B)??0,outDegree:ce.get(B)??0,internalLinks:te.get(B)??0,externalLinksOut:Z.get(B)??0,externalLinksIn:re.get(B)??0,violatingOut:V.get(B)??0})).sort((B,fe)=>B.label.localeCompare(fe.label)),H=[...k.values()].map(B=>({source:K(B.source),target:K(B.target),occurrences:B.occurrences,examples:B.examples})).sort((B,fe)=>fe.occurrences-B.occurrences),Y=[],ie=P.length===0,Ce=H.length===0&&j.crossVault===0&&ie&&u.length===0;return{vaultPath:r,totalFiles:n.length,scannedFiles:b,ontologies:ee,duplicateOntologyUids:u,declared:{edgeCount:O,sccs:P,acyclic:ie},derivedEdges:he,violations:H,crossVault:Y,linkCounts:j,skips:U,skipExamples:G,noOntologyAssets:{count:h,byReason:d,examples:p},warnings:{selfImports:E,multipleIsDefinedBy:g,ontologiesWithoutUid:l},clean:Ce,...i.size>0?{excludedPredicates:[...i]}:{}}}a(vEe,"scanVaultForOntologyImports");function TEe(r){let e=r.ontologies.map(w=>w.uid),t=new Map;for(let w of r.ontologies)t.set(w.uid,{uid:w.uid,label:w.label,path:w.path});let n=a(w=>t.get(w)??{uid:w,label:w,path:""},"refOf"),i=new Map;for(let w of r.ontologies)w.declaredImports.length>0&&i.set(w.uid,new Set(w.declaredImports));let s=new Map,o=new Map;for(let w of r.derivedEdges){let R=s.get(w.source);R||(R=new Set,s.set(w.source,R)),R.add(w.target),o.set(`${w.source} ${w.target}`,w.occurrences)}let{components:c,componentOf:l}=sG(e,s),u=[],f=new Map,d=0;for(let w of r.derivedEdges){let R=l.get(w.source),O=l.get(w.target);if(R!==void 0&&O!==void 0&&R===O){let N=f.get(R);N||(N=[],f.set(R,N)),N.push({source:w.source,target:w.target,weight:w.occurrences})}else u.push({source:w.source,target:w.target,occurrences:w.occurrences}),w.valid&&d++}let p=a((w,R,O)=>{if(w===R)return!0;let P=[...O.get(w)??[]],N=new Set;for(;P.length>0;){let j=P.shift();if(j===R)return!0;if(!N.has(j)){N.add(j);for(let U of O.get(j)??[])P.push(U)}}return!1},"reaches"),h=new Map;for(let[w,R]of i)h.set(w,new Set(R));let g=[],m=[...u].sort((w,R)=>w.source===R.source?w.target.localeCompare(R.target):w.source.localeCompare(R.source));for(let w of m)if(p(w.target,w.source,h))g.push({source:n(w.source),target:n(w.target),occurrences:w.occurrences});else{let R=h.get(w.source);R||(R=new Set,h.set(w.source,R)),R.add(w.target)}let b=oG(e,h),S=[];for(let[w,R]of b)for(let O of R)i.get(w)?.has(O)||S.push({source:n(w),target:n(O),occurrences:o.get(`${w} ${O}`)??0});S.sort((w,R)=>R.occurrences-w.occurrences||w.source.uid.localeCompare(R.source.uid)||w.target.uid.localeCompare(R.target.uid));let _=[];for(let[w,R]of f){let O=c[w],N=aG(O,R).map(j=>({source:n(j.source),target:n(j.target),occurrences:j.weight})).sort((j,U)=>j.occurrences-U.occurrences||j.source.uid.localeCompare(U.source.uid)||j.target.uid.localeCompare(U.target.uid));_.push({ontologies:O.map(n).sort((j,U)=>j.label.localeCompare(U.label)),edgeCount:R.length,occurrenceCount:R.reduce((j,U)=>j+U.weight,0),suggestedCuts:N})}_.sort((w,R)=>R.ontologies.length-w.ontologies.length||R.occurrenceCount-w.occurrenceCount);let A=XE(e,i),E=[];for(let[w,R]of i)for(let O of R){let P=!1;for(let N of R)if(N!==O&&A.get(N)?.has(O)){P=!0;break}P&&E.push({source:n(w),target:n(O),occurrences:o.get(`${w} ${O}`)??0})}return{additions:S,acyclicEdgeCount:u.length,alreadyCovered:d,conflicts:g,intraScc:_,redundantDeclared:E}}a(TEe,"computeImportProposal");function oo(r){return`${r.uid}|${r.label}|${r.path}`}a(oo,"formatRef");function AEe(r){let e=r.ontologies.filter(i=>i.declaredImports.length>0||i.unresolvedImports.length>0).length,t=r.clean?console.log:console.error;if(t(`${r.clean?"OK":"FAIL"} ${r.vaultPath}: ontology-imports audit \u2014 ${r.linkCounts.crossOntologyViolation} violating occurrence(s) in ${r.violations.length} pair(s)`),t(`Ontologies: ${r.ontologies.length} (${e} with imports declared), declared graph: ${r.declared.edgeCount} edge(s), `+(r.declared.acyclic?"acyclic":`NOT ACYCLIC \u2014 ${r.declared.sccs.length} SCC(s)`)),r.excludedPredicates&&r.excludedPredicates.length>0&&t(`Structural-only mode (VL#30): excluded ${r.excludedPredicates.length} associative predicate(s) from edge extraction \u2014 ${r.excludedPredicates.join(", ")}`),r.duplicateOntologyUids.length>0){console.error(`
652
+ `)}a(hEe,"stripFencedCodeBlocks");function lG(r){let e=[],t;for(cG.lastIndex=0;(t=cG.exec(r))!==null;){let n=t[1],i=n.indexOf("|");i!==-1&&(n=n.slice(0,i));let s=n.indexOf("#");s!==-1&&(n=n.slice(0,s));let o=n.trim();o.length>0&&e.push(o)}return e}a(lG,"extractWikilinkTargets");function TF(r){return typeof r=="string"?[r]:Array.isArray(r)?r.flatMap(TF):r!==null&&typeof r=="object"?Object.values(r).flatMap(TF):[]}a(TF,"collectFrontmatterStrings");function mEe(r){let e=(0,uG.matchFrontmatterBlock)(r);return e?r.slice(e.blockEnd):r}a(mEe,"bodyOf");function fG(r,e,t){let n=[];for(let[s,o]of Object.entries(r))if(!t?.has(s))for(let c of TF(o))for(let l of lG(c))n.push(l);let i=lG(hEe(mEe(e)));return[...n,...i]}a(fG,"extractFileWikilinkTargets");var gEe=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;async function dG(r,e){if(e.includes("/")){let n=e.replace(/^\//,""),i=n.endsWith(".md")?n:`${n}.md`;if(await r.hasIndexedPath(i))return i;e=n.slice(n.lastIndexOf("/")+1)}if(e.endsWith(".md")&&(e=e.slice(0,-3)),gEe.test(e)){let n=await r.findFileByUID(e);if(n)return n}let t=await r.findPathsByBasename(e);return t.length===1?t[0]:t.length>1?new Set(t).size===1?t[0]:"ambiguous":null}a(dG,"resolveTargetPath");_t();Nt();var yEe="\0",bEe="829b9b3b-6fc3-4276-be6a-27d3398c012e",_Ee=["exo__Asset_relates","concept__Concept_related","concept__Concept_broader","concept__Concept_synonym","exo__Asset_createdBy"],SEe=5,wEe=10,EEe=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif","pdf","mp3","wav","m4a","ogg","flac","mp4","mov","webm","avi","mkv","zip","gz","tar","canvas","base","json","css","js","ts","html"]);function vEe(r){let e=r.lastIndexOf(".");if(e===-1||e===r.length-1)return!1;let t=r.slice(e+1).toLowerCase();return EEe.has(t)}a(vEe,"nonMarkdownExtension");function AF(r){if(Array.isArray(r)){let e=r.filter(t=>typeof t=="string");return{value:e[0]??null,multiple:e.length>1}}return{value:typeof r=="string"?r:null,multiple:!1}}a(AF,"firstString");function pG(r){let e=Array.isArray(r)?r:r==null?[]:[r],t=[];for(let n of e){let i=(0,IF.extractAssetReference)(n);i&&t.push(i)}return t}a(pG,"asRefList");function Fg(r,e,t=SEe){r.length<t&&r.push(e)}a(Fg,"pushExample");async function TEe(r,e={}){let t=new Fn(r,{cacheContent:!0}),n=await t.indexedAssets(),i=new Set(e.excludePredicates??[]),s=new Map,o=new Map,c=new Map,l=[];for(let B of n){if(Qi(B.path)||gi(B.path)||!pG(B.metadata.exo__Instance_class).includes(bEe))continue;let{value:ae}=AF(B.metadata.exo__Asset_uid);if(!ae){l.push(B.path);continue}let{value:Ie}=AF(B.metadata.exo__Asset_label),ye=Ie??B.path,Te=c.get(ae);Te?Te.push(B.path):c.set(ae,[B.path]),s.set(B.path,ae),o.has(ae)||o.set(ae,{uid:ae,label:ye,path:B.path,metadata:B.metadata})}let u=[...c.entries()].filter(([,B])=>B.length>1).map(([B,fe])=>({uid:B,paths:fe})),f=new Map,d={"empty-isDefinedBy":0,"bang-prefix":0,unresolvable:0,"not-an-ontology":0},p=[],h=0,g=0,m=new Map,b=0,S=a((B,fe)=>{f.set(B,null),d[fe]++,h++,Fg(p,`${B} (${fe})`,wEe)},"markNoOntology");for(let B of n){if(Qi(B.path)||gi(B.path))continue;b++;let fe=B.metadata.exo__Asset_isDefinedBy,{value:ae,multiple:Ie}=AF(fe);Ie&&g++;let ye=(0,IF.extractAssetReference)(ae);if(!ye){S(B.path,"empty-isDefinedBy");continue}if(ye.startsWith("!")){S(B.path,"bang-prefix");continue}let Te=await ro(t,ye,B.path);if(!Te){S(B.path,"unresolvable");continue}let Re=s.get(Te);if(!Re){S(B.path,"not-an-ontology");continue}f.set(B.path,Re),m.set(Re,(m.get(Re)??0)+1)}let _=[...o.keys()],A=new Map,E=[],w=new Map,R=new Map,O=0;for(let B of _){let fe=o.get(B),ae=pG(fe.metadata.exo__Ontology_imports),Ie=[],ye=[],Te=!1;for(let Re of ae){let pe=null;if(o.has(Re))pe=Re;else{let q=await ro(t,Re,fe.path);pe=q?s.get(q)??null:null}if(pe===null)ye.push(Re);else if(pe===B)Te=!0;else{Ie.push(pe);let q=A.get(B);q||(q=new Set,A.set(B,q)),q.has(pe)||(q.add(pe),O++)}}w.set(B,Ie),R.set(B,ye),Te&&E.push(B)}let P=iG(_,A),N=XE(_,A),j={total:0,internal:0,crossOntologyValid:0,crossOntologyViolation:0,crossVault:0,noOntology:0},U={broken:0,"dup-basename":0,"non-markdown":0},G={broken:[],"dup-basename":[],"non-markdown":[]},$=new Map,k=new Map,te=new Map,Z=new Map,re=new Map,V=new Map,K=a(B=>{let fe=o.get(B);return fe?{uid:fe.uid,label:fe.label,path:fe.path}:{uid:B,label:B,path:""}},"toRef");for(let B of n){if(Qi(B.path)||gi(B.path))continue;let fe=f.get(B.path)??null,ae=fG(B.metadata,B.content??"",i);for(let Ie of ae){if(j.total++,vEe(Ie)){U["non-markdown"]++,Fg(G["non-markdown"],`${B.path} \u2192 ${Ie}`);continue}let ye=await dG(t,Ie);if(ye==="ambiguous"){U["dup-basename"]++,Fg(G["dup-basename"],`${B.path} \u2192 ${Ie}`);continue}if(ye===null){U.broken++,Fg(G.broken,`${B.path} \u2192 ${Ie}`);continue}let Te=f.get(ye)??s.get(ye)??null;if(fe===null||Te===null){j.noOntology++;continue}if(fe===Te){j.internal++,te.set(fe,(te.get(fe)??0)+1);continue}let Re=N.get(fe)?.has(Te)??!1,pe=`${fe}${yEe}${Te}`,q=$.get(pe);if(q?q.occurrences++:$.set(pe,{source:fe,target:Te,occurrences:1,valid:Re}),Z.set(fe,(Z.get(fe)??0)+1),re.set(Te,(re.get(Te)??0)+1),Re)j.crossOntologyValid++;else{j.crossOntologyViolation++,V.set(fe,(V.get(fe)??0)+1);let F=k.get(pe);F?(F.occurrences++,Fg(F.examples,B.path)):k.set(pe,{source:fe,target:Te,occurrences:1,examples:[B.path]})}}}let he=[...$.values()].sort((B,fe)=>fe.occurrences-B.occurrences),He=new Map,ce=new Map;for(let B of he)ce.set(B.source,(ce.get(B.source)??0)+1),He.set(B.target,(He.get(B.target)??0)+1);let ee=_.map(B=>({...K(B),declaredImports:w.get(B)??[],unresolvedImports:R.get(B)??[],selfImport:E.includes(B),assetCount:m.get(B)??0,inDegree:He.get(B)??0,outDegree:ce.get(B)??0,internalLinks:te.get(B)??0,externalLinksOut:Z.get(B)??0,externalLinksIn:re.get(B)??0,violatingOut:V.get(B)??0})).sort((B,fe)=>B.label.localeCompare(fe.label)),H=[...k.values()].map(B=>({source:K(B.source),target:K(B.target),occurrences:B.occurrences,examples:B.examples})).sort((B,fe)=>fe.occurrences-B.occurrences),Y=[],ie=P.length===0,Ce=H.length===0&&j.crossVault===0&&ie&&u.length===0;return{vaultPath:r,totalFiles:n.length,scannedFiles:b,ontologies:ee,duplicateOntologyUids:u,declared:{edgeCount:O,sccs:P,acyclic:ie},derivedEdges:he,violations:H,crossVault:Y,linkCounts:j,skips:U,skipExamples:G,noOntologyAssets:{count:h,byReason:d,examples:p},warnings:{selfImports:E,multipleIsDefinedBy:g,ontologiesWithoutUid:l},clean:Ce,...i.size>0?{excludedPredicates:[...i]}:{}}}a(TEe,"scanVaultForOntologyImports");function AEe(r){let e=r.ontologies.map(w=>w.uid),t=new Map;for(let w of r.ontologies)t.set(w.uid,{uid:w.uid,label:w.label,path:w.path});let n=a(w=>t.get(w)??{uid:w,label:w,path:""},"refOf"),i=new Map;for(let w of r.ontologies)w.declaredImports.length>0&&i.set(w.uid,new Set(w.declaredImports));let s=new Map,o=new Map;for(let w of r.derivedEdges){let R=s.get(w.source);R||(R=new Set,s.set(w.source,R)),R.add(w.target),o.set(`${w.source} ${w.target}`,w.occurrences)}let{components:c,componentOf:l}=sG(e,s),u=[],f=new Map,d=0;for(let w of r.derivedEdges){let R=l.get(w.source),O=l.get(w.target);if(R!==void 0&&O!==void 0&&R===O){let N=f.get(R);N||(N=[],f.set(R,N)),N.push({source:w.source,target:w.target,weight:w.occurrences})}else u.push({source:w.source,target:w.target,occurrences:w.occurrences}),w.valid&&d++}let p=a((w,R,O)=>{if(w===R)return!0;let P=[...O.get(w)??[]],N=new Set;for(;P.length>0;){let j=P.shift();if(j===R)return!0;if(!N.has(j)){N.add(j);for(let U of O.get(j)??[])P.push(U)}}return!1},"reaches"),h=new Map;for(let[w,R]of i)h.set(w,new Set(R));let g=[],m=[...u].sort((w,R)=>w.source===R.source?w.target.localeCompare(R.target):w.source.localeCompare(R.source));for(let w of m)if(p(w.target,w.source,h))g.push({source:n(w.source),target:n(w.target),occurrences:w.occurrences});else{let R=h.get(w.source);R||(R=new Set,h.set(w.source,R)),R.add(w.target)}let b=oG(e,h),S=[];for(let[w,R]of b)for(let O of R)i.get(w)?.has(O)||S.push({source:n(w),target:n(O),occurrences:o.get(`${w} ${O}`)??0});S.sort((w,R)=>R.occurrences-w.occurrences||w.source.uid.localeCompare(R.source.uid)||w.target.uid.localeCompare(R.target.uid));let _=[];for(let[w,R]of f){let O=c[w],N=aG(O,R).map(j=>({source:n(j.source),target:n(j.target),occurrences:j.weight})).sort((j,U)=>j.occurrences-U.occurrences||j.source.uid.localeCompare(U.source.uid)||j.target.uid.localeCompare(U.target.uid));_.push({ontologies:O.map(n).sort((j,U)=>j.label.localeCompare(U.label)),edgeCount:R.length,occurrenceCount:R.reduce((j,U)=>j+U.weight,0),suggestedCuts:N})}_.sort((w,R)=>R.ontologies.length-w.ontologies.length||R.occurrenceCount-w.occurrenceCount);let A=XE(e,i),E=[];for(let[w,R]of i)for(let O of R){let P=!1;for(let N of R)if(N!==O&&A.get(N)?.has(O)){P=!0;break}P&&E.push({source:n(w),target:n(O),occurrences:o.get(`${w} ${O}`)??0})}return{additions:S,acyclicEdgeCount:u.length,alreadyCovered:d,conflicts:g,intraScc:_,redundantDeclared:E}}a(AEe,"computeImportProposal");function oo(r){return`${r.uid}|${r.label}|${r.path}`}a(oo,"formatRef");function IEe(r){let e=r.ontologies.filter(i=>i.declaredImports.length>0||i.unresolvedImports.length>0).length,t=r.clean?console.log:console.error;if(t(`${r.clean?"OK":"FAIL"} ${r.vaultPath}: ontology-imports audit \u2014 ${r.linkCounts.crossOntologyViolation} violating occurrence(s) in ${r.violations.length} pair(s)`),t(`Ontologies: ${r.ontologies.length} (${e} with imports declared), declared graph: ${r.declared.edgeCount} edge(s), `+(r.declared.acyclic?"acyclic":`NOT ACYCLIC \u2014 ${r.declared.sccs.length} SCC(s)`)),r.excludedPredicates&&r.excludedPredicates.length>0&&t(`Structural-only mode (VL#30): excluded ${r.excludedPredicates.length} associative predicate(s) from edge extraction \u2014 ${r.excludedPredicates.join(", ")}`),r.duplicateOntologyUids.length>0){console.error(`
653
653
  HARD ERRORS \u2014 duplicate ontology UIDs (R7):`);for(let i of r.duplicateOntologyUids)console.error(` ${i.uid}: ${i.paths.join(", ")}`)}if(!r.declared.acyclic){console.error(`
654
- Declared-graph cycles (must be a DAG):`);for(let i of r.declared.sccs)console.error(` SCC[${i.length}]: ${i.map(s=>oo(IEe(r,s))).join(" \u21C4 ")}`)}if(r.violations.length>0){console.error(`
654
+ Declared-graph cycles (must be a DAG):`);for(let i of r.declared.sccs)console.error(` SCC[${i.length}]: ${i.map(s=>oo(REe(r,s))).join(" \u21C4 ")}`)}if(r.violations.length>0){console.error(`
655
655
  Violating pairs (src \u2192 tgt, occurrences desc):`);for(let i of r.violations)console.error(` ${oo(i.source)} \u2192 ${oo(i.target)}: ${i.occurrences}`)}let n=r.ontologies.reduce((i,s)=>i+s.unresolvedImports.length,0);t(`
656
- Links: total=${r.linkCounts.total}, internal=${r.linkCounts.internal}, cross-ontology-valid=${r.linkCounts.crossOntologyValid}, cross-ontology-violation=${r.linkCounts.crossOntologyViolation}, cross-vault=${r.linkCounts.crossVault}, no-ontology=${r.linkCounts.noOntology}`),t(`Skipped (fail-open, NOT verified): broken=${r.skips.broken}, dup-basename=${r.skips["dup-basename"]}, non-markdown=${r.skips["non-markdown"]}`),t(`No-ontology assets (Phase-4 data gap): ${r.noOntologyAssets.count} \u2014 empty=${r.noOntologyAssets.byReason["empty-isDefinedBy"]}, bang-prefix=${r.noOntologyAssets.byReason["bang-prefix"]}, unresolvable=${r.noOntologyAssets.byReason.unresolvable}, not-an-ontology=${r.noOntologyAssets.byReason["not-an-ontology"]}`),(r.warnings.selfImports.length>0||r.warnings.multipleIsDefinedBy>0||r.warnings.ontologiesWithoutUid.length>0||n>0)&&t(`Warnings: self-imports=${r.warnings.selfImports.length}, unresolved-imports=${n}, multiple-isDefinedBy=${r.warnings.multipleIsDefinedBy}, ontologies-without-uid=${r.warnings.ontologiesWithoutUid.length}`)}a(AEe,"printText");function IEe(r,e){return r.ontologies.find(t=>t.uid===e)??{uid:e,label:e,path:""}}a(IEe,"toRefSafe");function REe(r){if(console.log(`
656
+ Links: total=${r.linkCounts.total}, internal=${r.linkCounts.internal}, cross-ontology-valid=${r.linkCounts.crossOntologyValid}, cross-ontology-violation=${r.linkCounts.crossOntologyViolation}, cross-vault=${r.linkCounts.crossVault}, no-ontology=${r.linkCounts.noOntology}`),t(`Skipped (fail-open, NOT verified): broken=${r.skips.broken}, dup-basename=${r.skips["dup-basename"]}, non-markdown=${r.skips["non-markdown"]}`),t(`No-ontology assets (Phase-4 data gap): ${r.noOntologyAssets.count} \u2014 empty=${r.noOntologyAssets.byReason["empty-isDefinedBy"]}, bang-prefix=${r.noOntologyAssets.byReason["bang-prefix"]}, unresolvable=${r.noOntologyAssets.byReason.unresolvable}, not-an-ontology=${r.noOntologyAssets.byReason["not-an-ontology"]}`),(r.warnings.selfImports.length>0||r.warnings.multipleIsDefinedBy>0||r.warnings.ontologiesWithoutUid.length>0||n>0)&&t(`Warnings: self-imports=${r.warnings.selfImports.length}, unresolved-imports=${n}, multiple-isDefinedBy=${r.warnings.multipleIsDefinedBy}, ontologies-without-uid=${r.warnings.ontologiesWithoutUid.length}`)}a(IEe,"printText");function REe(r,e){return r.ontologies.find(t=>t.uid===e)??{uid:e,label:e,path:""}}a(REe,"toRefSafe");function CEe(r){if(console.log(`
657
657
  === Import proposal (--propose-imports) ===
658
658
  Acyclic part: ${r.acyclicEdgeCount} cross-SCC derived edge(s), ${r.alreadyCovered} already covered by declared closure.`),console.log(`
659
659
  Additions (minimal \u2014 transitive reduction of the condensation), ${r.additions.length} edge(s):`),r.additions.length===0)console.log(" (none \u2014 acyclic part already covered)");else for(let e of r.additions)console.log(` + ${oo(e.source)} imports ${oo(e.target)} (${e.occurrences} occ)`);if(r.conflicts.length>0){console.log(`
660
660
  Conflicts \u2014 derived edges that would create a declared-graph cycle (need Phase-3 re-home, not an import), ${r.conflicts.length}:`);for(let e of r.conflicts)console.log(` ! ${oo(e.source)} \u2192 ${oo(e.target)} (${e.occurrences} occ)`)}if(r.intraScc.length>0){console.log(`
661
661
  Intra-SCC cycles (require Phase 3 \u2014 imports cannot legitimize a cycle), ${r.intraScc.length} component(s):`);for(let e of r.intraScc){console.log(` SCC[${e.ontologies.length}] ${e.edgeCount} edge(s) / ${e.occurrenceCount} occ \u2014 members: ${e.ontologies.map(t=>t.label).join(", ")}`),console.log(` suggested feedback-arc-set to cut (cheapest first), ${e.suggestedCuts.length} edge(s):`);for(let t of e.suggestedCuts)console.log(` \u2702 ${oo(t.source)} \u2192 ${oo(t.target)} (${t.occurrences} occ)`)}}if(r.redundantDeclared.length>0){console.log(`
662
- Redundant declared imports (informational, R8 \u2014 never auto-removed), ${r.redundantDeclared.length}:`);for(let e of r.redundantDeclared)console.log(` ~ ${oo(e.source)} imports ${oo(e.target)} (reachable without the direct edge)`)}}a(REe,"printProposal");function mG(){return new de("ontology-imports").description("Detect cross-ontology wikilinks not covered by the declared exo__Ontology_imports transitive closure (DAG check, per-pair grouping, fail-open skip-accounting); --propose-imports suggests minimal import additions").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").option("--propose-imports","Emit a minimal additions-only import proposal (SCC condensation + transitive reduction + suggested feedback-arc-set)").option("--structural-only","Exclude curated associative predicates (exo__Asset_relates, concept__Concept_related/broader/synonym, exo__Asset_createdBy) from edge extraction to measure the structural backbone import-DAG (EKA Phase B, Vision VL#30). Default: every wikilink counts.").option("--exclude-predicate <name>","Additional frontmatter predicate (top-level key) to exclude from edge extraction (repeatable; combines with --structural-only)",CEe,[]).action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,hG.resolve)(r.vault);if(!(0,QE.existsSync)(t)||!(0,QE.statSync)(t).isDirectory())throw new Fe(t);let n=[...r.structuralOnly?bEe:[],...r.excludePredicate??[]],i=await vEe(t,{excludePredicates:n});r.proposeImports&&(i.proposal=TEe(i)),e==="json"?console.log(JSON.stringify(i,null,2)):(AEe(i),i.proposal&&REe(i.proposal)),i.clean||(process.exitCode=1)}catch(t){le.handle(t)}})}a(mG,"auditOntologyImportsCommand");function CEe(r,e){return e.concat([r])}a(CEe,"collectExcludePredicate");ut();var JE=require("fs"),gG=require("path");_t();Nt();var OEe="exocortex.my",xEe=5;function PEe(r){return Array.isArray(r)?r.find(t=>typeof t=="string")??null:typeof r=="string"?r:null}a(PEe,"firstString");function FEe(r){try{return new URL(r).host}catch{return null}}a(FEe,"urlHost");function DEe(r){return`${r.replace(/\/+$/,"")}#`}a(DEe,"expectedCanonicalForm");async function LEe(r){let t=await new Fn(r).indexedAssets(),n=[],i={"foreign-vocab":0,"unparseable-url":0},s={"foreign-vocab":[],"unparseable-url":[]},o=0,c=0,l=a((u,f)=>{s[u].length<xEe&&s[u].push(f)},"addExample");for(let{path:u,metadata:f}of t){if(Qi(u)||gi(u))continue;let d=PEe(f.exo__Ontology_url);if(!d)continue;o++;let p=FEe(d);if(p===null){i["unparseable-url"]++,l("unparseable-url",u);continue}if(p!==OEe){i["foreign-vocab"]++,l("foreign-vocab",u);continue}c++,d.endsWith("#")||n.push({path:u,url:d,expected:DEe(d)})}return{vaultPath:r,totalFiles:t.length,ontologiesFound:o,checked:c,violations:n,skips:i,skipExamples:s}}a(LEe,"scanVaultForOntologyUrl");function yG(){return new de("ontology-url").description("Detect exocortex.my ontologies whose exo__Ontology_url lacks the canonical trailing '#' separator (foreign vocabularies skipped, path hierarchy preserved, fail-open + skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,gG.resolve)(r.vault);if(!(0,JE.existsSync)(t)||!(0,JE.statSync)(t).isDirectory())throw new Fe(t);let n=await LEe(t),i=n.skips["foreign-vocab"]+n.skips["unparseable-url"];if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,ontologiesFound:n.ontologiesFound,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 ontology-url violations (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} ontology-url violation(s) (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked):`);for(let s of n.violations)console.error(` ${s.path}
662
+ Redundant declared imports (informational, R8 \u2014 never auto-removed), ${r.redundantDeclared.length}:`);for(let e of r.redundantDeclared)console.log(` ~ ${oo(e.source)} imports ${oo(e.target)} (reachable without the direct edge)`)}}a(CEe,"printProposal");function mG(){return new de("ontology-imports").description("Detect cross-ontology wikilinks not covered by the declared exo__Ontology_imports transitive closure (DAG check, per-pair grouping, fail-open skip-accounting); --propose-imports suggests minimal import additions").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").option("--propose-imports","Emit a minimal additions-only import proposal (SCC condensation + transitive reduction + suggested feedback-arc-set)").option("--structural-only","Exclude curated associative predicates (exo__Asset_relates, concept__Concept_related/broader/synonym, exo__Asset_createdBy) from edge extraction to measure the structural backbone import-DAG (EKA Phase B, Vision VL#30). Default: every wikilink counts.").option("--exclude-predicate <name>","Additional frontmatter predicate (top-level key) to exclude from edge extraction (repeatable; combines with --structural-only)",OEe,[]).action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,hG.resolve)(r.vault);if(!(0,QE.existsSync)(t)||!(0,QE.statSync)(t).isDirectory())throw new Fe(t);let n=[...r.structuralOnly?_Ee:[],...r.excludePredicate??[]],i=await TEe(t,{excludePredicates:n});r.proposeImports&&(i.proposal=AEe(i)),e==="json"?console.log(JSON.stringify(i,null,2)):(IEe(i),i.proposal&&CEe(i.proposal)),i.clean||(process.exitCode=1)}catch(t){le.handle(t)}})}a(mG,"auditOntologyImportsCommand");function OEe(r,e){return e.concat([r])}a(OEe,"collectExcludePredicate");ut();var JE=require("fs"),gG=require("path");_t();Nt();var xEe="exocortex.my",PEe=5;function FEe(r){return Array.isArray(r)?r.find(t=>typeof t=="string")??null:typeof r=="string"?r:null}a(FEe,"firstString");function DEe(r){try{return new URL(r).host}catch{return null}}a(DEe,"urlHost");function LEe(r){return`${r.replace(/\/+$/,"")}#`}a(LEe,"expectedCanonicalForm");async function NEe(r){let t=await new Fn(r).indexedAssets(),n=[],i={"foreign-vocab":0,"unparseable-url":0},s={"foreign-vocab":[],"unparseable-url":[]},o=0,c=0,l=a((u,f)=>{s[u].length<PEe&&s[u].push(f)},"addExample");for(let{path:u,metadata:f}of t){if(Qi(u)||gi(u))continue;let d=FEe(f.exo__Ontology_url);if(!d)continue;o++;let p=DEe(d);if(p===null){i["unparseable-url"]++,l("unparseable-url",u);continue}if(p!==xEe){i["foreign-vocab"]++,l("foreign-vocab",u);continue}c++,d.endsWith("#")||n.push({path:u,url:d,expected:LEe(d)})}return{vaultPath:r,totalFiles:t.length,ontologiesFound:o,checked:c,violations:n,skips:i,skipExamples:s}}a(NEe,"scanVaultForOntologyUrl");function yG(){return new de("ontology-url").description("Detect exocortex.my ontologies whose exo__Ontology_url lacks the canonical trailing '#' separator (foreign vocabularies skipped, path hierarchy preserved, fail-open + skip-accounted)").requiredOption("--vault <path>","Vault root directory").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,gG.resolve)(r.vault);if(!(0,JE.existsSync)(t)||!(0,JE.statSync)(t).isDirectory())throw new Fe(t);let n=await NEe(t),i=n.skips["foreign-vocab"]+n.skips["unparseable-url"];if(e==="json")console.log(JSON.stringify({vaultPath:n.vaultPath,totalFiles:n.totalFiles,ontologiesFound:n.ontologiesFound,checked:n.checked,violationCount:n.violations.length,violations:n.violations,skips:n.skips,skipTotal:i,skipExamples:n.skipExamples,clean:n.violations.length===0},null,2));else{if(n.violations.length===0)console.log(`OK ${t}: 0 ontology-url violations (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked)`);else{console.error(`FAIL ${t}: ${n.violations.length} ontology-url violation(s) (${n.checked}/${n.ontologiesFound} exocortex.my ontologies checked):`);for(let s of n.violations)console.error(` ${s.path}
663
663
  url=${s.url} expected=${s.expected}`)}console.error(`
664
- Skipped (fail-open, NOT verified): ${i} \u2014 foreign-vocab=${n.skips["foreign-vocab"]}, unparseable-url=${n.skips["unparseable-url"]}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(yG,"auditOntologyUrlCommand");function bG(){let r=new de("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return r.addCommand(ZV()),r.addCommand(rG()),r.addCommand(mG()),r.addCommand(gV()),r.addCommand(yG()),r}a(bG,"auditCommand");ut();var ZE=require("fs"),_G=require("fs/promises"),SG=require("crypto"),Lu=require("path"),Ho=Q(Pe());_t();Nt();var NEe="35cf35fb-935f-4d35-a150-939f29109aec",kEe=[{checkId:Ho.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",value:!0},{checkId:Ho.CHECK_ID_CO_LOCATION,label:"co-location",value:!1},{checkId:Ho.CHECK_ID_SHACL,label:"shacl",value:!1},{checkId:Ho.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",value:!1}];function MEe(r,e,t,n,i,s){return`---
664
+ Skipped (fail-open, NOT verified): ${i} \u2014 foreign-vocab=${n.skips["foreign-vocab"]}, unparseable-url=${n.skips["unparseable-url"]}`)}n.violations.length>0&&(process.exitCode=1)}catch(t){le.handle(t)}})}a(yG,"auditOntologyUrlCommand");function bG(){let r=new de("audit").description("Audit vault for regression patterns (RFC cutover detectors)");return r.addCommand(ZV()),r.addCommand(rG()),r.addCommand(mG()),r.addCommand(gV()),r.addCommand(yG()),r}a(bG,"auditCommand");ut();var ZE=require("fs"),_G=require("fs/promises"),SG=require("crypto"),Lu=require("path"),Ho=Q(Pe());_t();Nt();var kEe="35cf35fb-935f-4d35-a150-939f29109aec",MEe=[{checkId:Ho.CHECK_ID_UID_UNIQUENESS,label:"uid-uniqueness",value:!0},{checkId:Ho.CHECK_ID_CO_LOCATION,label:"co-location",value:!1},{checkId:Ho.CHECK_ID_SHACL,label:"shacl",value:!1},{checkId:Ho.CHECK_ID_DAG_ONTOLOGY_IMPORTS,label:"dag-ontology-imports",value:!1}];function $Ee(r,e,t,n,i,s){return`---
665
665
  exo__Asset_uid: ${r}
666
666
  exo__Asset_isDefinedBy: "[[${e}]]"
667
667
  exo__Asset_createdAt: ${s}
668
668
  exo__Instance_class:
669
- - "[[${NEe}]]"
669
+ - "[[${kEe}]]"
670
670
  exo__Asset_label: "Validation check: ${n} (${i?"enabled":"disabled"})"
671
671
  setting__Setting_key: "[[${t}]]"
672
672
  setting__Setting_value: ${i}
@@ -675,13 +675,13 @@ setting__Setting_value: ${i}
675
675
  # Validation check: ${n}
676
676
 
677
677
  Homoiconic validation-check setting (RFC f402002b, M1.5). \`Exocortex: Validate vault\` reads this instance's \`setting__Setting_value\` to decide whether to run the **${n}** check (key \`[[${t}]]\`). Scaffolded default \u2014 edit \`setting__Setting_value\` to toggle.
678
- `}a(MEe,"settingAsset");function wG(){return new de("scaffold").description("Scaffold homoiconic configuration assets").addCommand($Ee())}a(wG,"scaffoldCommand");function $Ee(){return new de("validation-settings").description("Scaffold the 4 validation-check setting__Setting instances (uid-uniqueness=true, rest=false) co-located in the chosen ontology").requiredOption("--vault <path>","Vault root directory").requiredOption("--ontology <uid>","UID of the ontology whose folder the check settings are co-located in").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,Lu.resolve)(r.vault);if(!(0,ZE.existsSync)(t)||!(0,ZE.statSync)(t).isDirectory())throw new Fe(t);let s=(await new Fn(t).indexedAssets()).find(u=>(0,Ho.readUid)(u.metadata)===r.ontology);if(!s)throw new Error(`Ontology UID "${r.ontology}" not found in vault ${t} (its folder is where the check settings co-locate).`);let o=(0,Lu.join)(t,(0,Lu.dirname)(s.path)),c=new Date().toISOString().slice(0,19),l=[];for(let u of kEe){let f=(0,SG.randomUUID)(),d=(0,Lu.join)(o,`${f}.md`);await(0,_G.writeFile)(d,MEe(f,r.ontology,u.checkId,u.label,u.value,c),"utf-8"),l.push(d)}if(e==="json")console.log(JSON.stringify({vaultPath:t,ontology:r.ontology,targetDir:o,created:l},null,2));else{console.log(`OK: scaffolded ${l.length} validation-check setting(s) in ${o}`);for(let u of l)console.log(` ${u}`);console.log(`
679
- Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){le.handle(t)}})}a($Ee,"scaffoldValidationCommand");ut();var WG=require("fs"),zG=require("path");var ul=require("node:fs"),Nu=require("node:path"),Ur=Q(Pe());var yt=require("node:fs"),vG=require("node:fs/promises"),TG=require("node:os"),dn=require("node:path"),_s=Q(Pe());var jEe=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,EG=50*1024*1024,ji=class r{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(jEe);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=r.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,n){let{owner:i,repo:s}=r.parseGitHubURL(e);if((0,yt.existsSync)(n)&&(0,yt.readdirSync)(n).length>0)throw new Error(`pullAssetSpace: target ${n} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,_s.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:n});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${_s.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,n=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(n(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),p=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||p!=null){let h=p!=null?new Date(Number(p)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${h}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(n(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(n(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>EG)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${EG})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,yt.existsSync)(e)},async read(e){return(0,yt.readFileSync)(e,"utf8")},async write(e,t){(0,yt.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,yt.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,n){let i=await(0,vG.mkdtemp)((0,dn.join)((0,TG.tmpdir)(),`exo-bootstrap-${(0,dn.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,dn.resolve)(i,c);if(l!==i&&!l.startsWith(i+dn.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,yt.mkdirSync)((0,dn.dirname)(l),{recursive:!0}),(0,yt.writeFileSync)(l,o.content),s++,n?.(s)}(0,yt.mkdirSync)((0,dn.dirname)(e),{recursive:!0});try{(0,yt.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,yt.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,yt.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,n){let i=(0,dn.join)(e,".gitmodules"),s="";try{s=(0,yt.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,_s.appendGitmodulesEntry)(s,t,n);return c?((0,yt.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let n=(0,dn.join)(e,".gitmodules"),i;try{i=(0,yt.readFileSync)(n,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,_s.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,yt.writeFileSync)(n,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,_s.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"unmountAssetSpace");this.removeGitmodulesEntry(e,t),(0,yt.existsSync)(n)&&(0,yt.rmSync)(n,{recursive:!0,force:!0})}parkAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"parkAssetSpace"),i=(0,_s.parkedPathFor)(t),s=this.assertSafeVaultTarget(e,i,"parkAssetSpace",{requireAssetspacesRoot:!1});if((0,yt.existsSync)(n)){if((0,yt.existsSync)(s))throw new Error(`parkAssetSpace: refusing to park "${t}" \u2014 a parked copy already exists at "${i}". Resolve by hand: one of the two holds work the other does not.`);this.removeGitmodulesEntry(e,t),(0,yt.mkdirSync)((0,dn.dirname)(s),{recursive:!0}),(0,yt.renameSync)(n,s)}}unparkAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"unparkAssetSpace"),i=(0,_s.parkedPathFor)(t),s=this.assertSafeVaultTarget(e,i,"unparkAssetSpace",{requireAssetspacesRoot:!1});if(!(0,yt.existsSync)(s))throw new Error(`unparkAssetSpace: nothing parked at "${i}" for "${t}"`);if((0,yt.existsSync)(n))throw new Error(`unparkAssetSpace: refusing to unpark onto existing mount "${t}"`);(0,yt.mkdirSync)((0,dn.dirname)(n),{recursive:!0}),(0,yt.renameSync)(s,n)}assertSafeVaultTarget(e,t,n,i={}){let s=i.requireAssetspacesRoot??!0,o=t.split("/");if(t.length===0||s&&!t.startsWith("assetspaces/")||o.some(u=>u.length===0||u==="."||u===".."))throw new Error(`${n}: refusing unsafe submodulePath "${t}"`);let c=(0,dn.resolve)(e),l=(0,dn.resolve)(c,t);if(l===c||!l.startsWith(c+dn.sep))throw new Error(`${n}: target "${l}" escapes vault root "${c}"`);return l}};function BEe(r){let e=(0,Ur.derivePath)(r);return e===null?r:(0,Ur.deriveUrl)(e)??r}a(BEe,"toHttpsGitHubUrl");var UEe=new Set(["node_modules",".obsidian",".exocortex",".git"]),wp=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new ji,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,n=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,ul.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Nu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||UEe.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=Ji(u.exo__Instance_class);if(d.includes(Du)){if(n.has(f))continue;let h=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(h.length===0)continue;let g=(0,Ur.derivePath)(h);if(g===null)continue;let m=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",b=m||GEe(g)||f.slice(0,8),S=u.exo__AssetSpace_dependsOnKind,_=typeof S=="string"?S:Array.isArray(S)&&typeof S[0]=="string"?S[0]:void 0;n.add(f),e.push({uid:f,git:h,folderName:g,label:b,namespace:m,dependsOnKind:_})}if(d.includes(gF)){let p=u.exo__Asset_label;typeof p=="string"&&p.length>0&&t.set(f,p)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,Ur.assertTsFloorReconciled)(e,t,Ur.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let w of c)l.set(w.uid,w);let u=new Set(l.keys()),f=new Set,d=new Set;for(let w of o.declaredOntologies)if(u.has(w)){f.add(w);let R=l.get(w)?.namespace;R!==void 0&&R.length>0&&d.add(R)}this.assertTsFloor(f,d);let p=new Set([...o.effective,...f]),h=new Map;for(let w of c){let R=(0,ul.existsSync)((0,Nu.join)(this.vaultPath,w.folderName))?"active":(0,ul.existsSync)((0,Nu.join)(this.vaultPath,(0,Ur.parkedPathFor)(w.folderName)))?"parked":"absent";h.set(w.uid,R)}let g=new Set([...h].filter(([,w])=>w==="active").map(([w])=>w));for(let w of c)Ur.CATALOG_KEEP_NAMESPACES.has(w.namespace)&&g.has(w.uid)&&p.add(w.uid);let m=[],b=[],S=[];for(let w of c){let R=(0,Ur.classifyMountTransition)({state:h.get(w.uid)??"absent",inEffectiveSet:p.has(w.uid),dependsOnKind:w.dependsOnKind});switch(R){case"none":break;case"destroy":m.push({asUid:w.uid,folderName:w.folderName,label:w.label,files:this.enumerateFilesUnder(w.folderName)});break;case"park":b.push({asUid:w.uid,folderName:w.folderName,label:w.label,files:this.enumerateFilesUnder(w.folderName)});break;case"unpark":case"materialize":S.push({asUid:w.uid,folderName:w.folderName,httpsUrl:BEe(w.git),label:w.label,source:R==="unpark"?"unpark":"pull"});break}}let _=new Map;for(let w of m)_.set(w.asUid,w.files);let A=new Set(S.filter(w=>w.source==="unpark").map(w=>w.asUid)),E={targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:_,assetSpacesBeingTornDown:m.map(w=>({asUid:w.asUid,asLabel:w.label,fileCount:w.files.length})),assetSpacesBeingParked:b.map(w=>({asUid:w.asUid,asLabel:w.label,fileCount:w.files.length})),assetSpacesBeingMaterialized:S.map(w=>({asUid:w.asUid,asLabel:w.label})),assetSpacesBeingUnparked:S.filter(w=>A.has(w.asUid)).map(w=>({asUid:w.asUid,asLabel:w.label}))};return{toDestroy:m,toPark:b,toMaterialize:S,plan:E}}async execute(e){let t=[],n=[],i=[];for(let s of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,s.folderName),t.push(s.asUid);for(let s of e.toPark)this.mount.parkAssetSpace(this.vaultPath,s.folderName),n.push(s.asUid);for(let s of e.toMaterialize){if(s.source==="unpark")this.mount.unparkAssetSpace(this.vaultPath,s.folderName);else{let o=(0,Nu.join)(this.vaultPath,s.folderName);await this.mount.pullAssetSpace(s.httpsUrl,this.ref,o)}this.mount.ensureGitmodulesEntry(this.vaultPath,s.folderName,s.httpsUrl),i.push(s.asUid)}return{destroyed:t,parked:n,materialized:i}}enumerateFilesUnder(e){let t=[],i=[(0,Nu.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,ul.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Nu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(VEe(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,ul.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,Ur.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function VEe(r,e){let t=e.endsWith("/")?e:e+"/";return(r.startsWith(t)?r.slice(t.length):r).split("\\").join("/")}a(VEe,"relativeVaultPath");function GEe(r){let e=r.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(GEe,"lastSegment");ut();var Jr=require("node:fs"),UG=require("node:crypto"),VG=require("node:child_process"),GG=require("node:util"),Vr=Q(require("node:path"));qm();var et=Q(Pe());ut();var Qo=require("node:fs"),NG=require("node:crypto"),Bi=Q(require("node:path"));qm();var wr=Q(Pe());Xs();var AG=require("node:child_process"),ev=Q(Pe());var qEe=6e4,Yo=class r{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,AG.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),n;try{n=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(r.PAT_REGEX,"***REDACTED***"))}let i=n.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}async push(e,t,n,i,s){return(0,ev.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:n,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,n=a(i=>this.redact(i),"redact");return async i=>{let s={...i.headers??{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(qEe)})}catch(f){throw new Error(n(`GitHub request failed: ${WEe(f)}`))}let c=a(f=>o.headers?.get?.(f)??void 0,"headerGetter");if(o.status===304&&i.acceptNotModified===!0)return{status:304,headers:c};let l=await o.text().catch(()=>"");if(o.status<200||o.status>=300){let f=c;throw(0,ev.enrichRateLimitError)(new Error(zEe(n(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${l}`),512)),f)}let u;try{u=l.length>0?JSON.parse(l):void 0}catch{u=void 0}return{status:o.status,json:u,text:l,headers:c}}}};function WEe(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}a(WEe,"errMsg");function zEe(r,e){return r.length>e?r.slice(0,e)+"...":r}a(zEe,"truncate");var RF=require("node:fs"),tv=Q(require("node:path"));var KEe="exosync-runs.local.jsonl";function Dg(r,e){return tv.join(r,e,"plugins","exocortex",KEe)}a(Dg,"runLogPathFor");async function Lg(r,e,t={}){let n=t.appendFile??RF.promises.appendFile,i=t.mkdir??RF.promises.mkdir;try{return await i(tv.dirname(r),{recursive:!0}),await n(r,`${JSON.stringify(e)}
680
- `,"utf-8"),!0}catch{return!1}}a(Lg,"appendSyncRunLog");function Ng(r){let e=(r.now??(()=>new Date))();return{ts:HEe(e),command:r.command,vault:r.vault,restCalls:r.restCalls,limit:r.quota?.limit??null,remaining:r.quota?.remaining??null,used:r.quota?.used??null,resetEpoch:r.quota?.resetEpoch??null,exitCode:r.exitCode}}a(Ng,"runLogEntry");function HEe(r){let e=a(s=>String(s).padStart(2,"0"),"p"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-",i=Math.abs(t);return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.floor(i/60))}${e(i%60)}`}a(HEe,"localIso");var IG=require("node:crypto"),kg=Q(require("node:fs/promises")),RG=Q(require("node:path")),rv=Q(Pe());function Ep(r){return{async read(){try{return await kg.default.readFile(r,"utf-8")}catch(e){let t=e.code;if(t==="ENOENT"||t==="EISDIR"||t==="ENOTDIR")return null;throw e}},async writeAtomic(e){await kg.default.mkdir(RG.default.dirname(r),{recursive:!0});let t=`${r}.${process.pid}-${(0,IG.randomUUID)()}.tmp`;await kg.default.writeFile(t,e,"utf-8"),await kg.default.rename(t,r)}}}a(Ep,"nodeConditionalStoreIO");function YEe(r){let e=r.EXOCORTEX_EXOSYNC_CONDITIONAL;return e==="0"||e==="false"||e==="off"}a(YEe,"envDisables");function vp(r,e){let t=e.env??process.env;if(e.enabled===!1||YEe(t))return{transport:r,cache:null};let n=new rv.ConditionalRequestCache({io:e.io});return{transport:(0,rv.withConditionalRequests)(r,n),cache:n}}a(vp,"wireConditionalRequests");var iv=Q(Pe());var CG=require("node:crypto"),Xo=Q(require("node:fs/promises")),OG=Q(require("node:os")),oc=Q(require("node:path"));function xG(r=process.env){let e=r.EXOCORTEX_EXOSYNC_CACHE_DIR;if(e!==void 0&&e.length>0)return e;let t=r.XDG_CACHE_HOME;return t!==void 0&&t.length>0?oc.default.join(t,"exocortex","exosync-objects"):oc.default.join(OG.default.homedir(),".cache","exocortex","exosync-objects")}a(xG,"resolveObjectCacheRoot");function PG(r=process.env){let e=r.EXOCORTEX_EXOSYNC_CACHE_MAX_BYTES;if(e===void 0||e.length===0)return;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}a(PG,"resolveObjectCacheMaxBytes");function nv(r,e){return`${oc.default.join(r,...e.split("/"))}.json`}a(nv,"keyToPath");function XEe(r,e){let t=oc.default.relative(r,e);return t.startsWith("..")||oc.default.isAbsolute(t)||!t.endsWith(".json")?null:t.slice(0,-5).split(oc.default.sep).join("/")}a(XEe,"pathToKey");async function*FG(r){let e;try{e=await Xo.default.readdir(r)}catch{return}for(let t of e){let n=oc.default.join(r,t),i;try{i=(await Xo.default.stat(n)).isDirectory()}catch{continue}i?yield*FG(n):yield n}}a(FG,"walk");function DG(r){return{async read(e){try{return await Xo.default.readFile(nv(r,e),"utf-8")}catch(t){let n=t.code;if(n==="ENOENT"||n==="EISDIR"||n==="ENOTDIR")return null;throw t}},async write(e,t){let n=nv(r,e);await Xo.default.mkdir(oc.default.dirname(n),{recursive:!0});let i=`${n}.${process.pid}-${(0,CG.randomUUID)()}.tmp`;await Xo.default.writeFile(i,t,"utf-8"),await Xo.default.rename(i,n)},async remove(e){await Xo.default.rm(nv(r,e),{force:!0})},async list(){let e=[];for await(let t of FG(r)){if(t.endsWith(".tmp"))continue;let n=XEe(r,t);if(n!==null)try{let i=await Xo.default.stat(t);e.push({key:n,size:i.size,lastUsedMs:i.mtimeMs})}catch{continue}}return e},async markUsed(e){let t=new Date;await Xo.default.utimes(nv(r,e),t,t)}}}a(DG,"nodeObjectCacheIO");function QEe(r){let e=r.EXOCORTEX_EXOSYNC_CACHE;return e==="0"||e==="false"||e==="off"}a(QEe,"envDisables");function Tp(r,e){let t=e.env??process.env;if(e.enabled===!1||QEe(t))return{transport:r,cache:null};let n=PG(t),i=new iv.ImmutableObjectCache({io:e.io??DG(xG(t)),sha1:e.sha1,...n!==void 0?{maxBytes:n}:{}});return{transport:(0,iv.withImmutableObjectCache)(r,i),cache:i}}a(Tp,"wireObjectCache");_t();var LG=a(async r=>{let e=await NG.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),JEe={parse:a(r=>Hc(r,{schema:Su}),"parse"),stringify:a(r=>Wd(r,{schema:Su,lineWidth:-1}),"stringify")};function ZEe(r,e){if(r.tokenFromGh===!0)return Yo.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(ZEe,"resolveToken");function eve(r){let e=a(n=>Bi.join(r,n),"abs"),t=a(async(n,i)=>{let s;try{s=await Qo.promises.readdir(n,{withFileTypes:!0})}catch{return}for(let o of s){let c=Bi.join(n,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Bi.relative(r,c).split(Bi.sep).join("/"))}},"walk");return{async list(){let n=[];return(0,Qo.existsSync)(r)&&await t(r,n),n},read:a(n=>Qo.promises.readFile(e(n),"utf-8"),"read"),async readBinary(n){return new Uint8Array(await Qo.promises.readFile(e(n)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(eve,"nodeLocalFilesPort");function tve(r,e){let t;try{t=(0,wr.parkedPathFor)(e)}catch{return!1}return(0,Qo.existsSync)(Bi.join(r,t))}a(tve,"isParked");function Ap(r){let e=new Yt(r),t=new wr.SpaceSpecAccumulator,n=[];for(let i of e.getAllFiles()){let s=e.getFrontmatter(i);if(!s)continue;let o=(0,wr.classifySpaceDeclaration)(s,i.path);if(o.kind==="not-space"||(o.warning!==void 0&&t.warnings.push(o.warning),o.kind==="skip"))continue;let c=t.offer(o.candidate);if(c!==null){if(!(0,Qo.existsSync)(Bi.join(r,c.localPath))){tve(r,c.localPath)&&n.push(c);continue}t.commit(o.candidate)}}return{specs:t.specs,parked:n,warnings:t.warnings}}a(Ap,"collectVaultSpecs");function rve(r,e){for(let t of r.repos){let n=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${n}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,wr.summarizeParityRound)(r))}a(rve,"printHumanReport");function nve(r,e){if(r.length!==0){e(`Parked AssetSpaces (frozen on this device, not synced): ${r.length}`);for(let t of r){let n=t.lastSyncedSha!==null?t.lastSyncedSha.slice(0,7):"never",i=t.remoteHeadSha!==null?t.remoteHeadSha.slice(0,7):"unread";switch(t.freshness){case"behind":e(` ${t.repoKey}: BEHIND \u2014 parked at ${n}, remote head is ${i}`);break;case"current":e(` ${t.repoKey}: current \u2014 parked at ${n}, matches the remote head`);break;case"unknown":e(` ${t.repoKey}: unknown \u2014 ${t.reason??"no verdict"}`);break}}}}a(nve,"printParkedSection");async function ive(r,e={}){let t=e.out??(G=>console.log(G)),n=Bi.resolve(r.vault);if(!(0,Qo.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let i=ZEe(r,e),s=new Yo({token:i,...r.apiBase!==void 0?{apiBase:r.apiBase}:{}}),o=e.transportFactory?.(i,r.apiBase)??s.transport(),{specs:c,parked:l,warnings:u}=Ap(n);for(let G of u)t(`warn: ${G}`);let f=r.configDir??".obsidian",d=Bi.join(n,f,"plugins","exocortex",wr.WATERMARK_STORE_FILENAME),p=Bi.join(n,f,"plugins","exocortex",wr.CONDITIONAL_STORE_FILENAME),{transport:h,cache:g}=vp(o,{...r.conditionalRequests!==void 0?{enabled:r.conditionalRequests}:{},io:Ep(p)}),{transport:m,cache:b}=Tp(h,{...r.objectCache!==void 0?{enabled:r.objectCache}:{},sha1:LG}),S=new wr.SyncPhaseTimer(()=>Date.now()),_=a(async G=>{S.bumpRest();let $=await m(G);return S.observeQuota($.headers),$},"countedTransport"),A=a(()=>{let G=S.snapshot();t(`[ExoSync quota] ${G.counts.restCalls} REST | ${(0,wr.formatQuota)(G.quota)}`)},"reportQuota"),E=a(async G=>{let $=S.snapshot();await Lg(Dg(n,f),Ng({command:"parity",vault:n,restCalls:$.counts.restCalls,quota:$.quota,exitCode:G}))},"journalRun"),w=new wr.FileWatermarkStore({read:a(async()=>{try{return await Qo.promises.readFile(d,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),R=[];for(let G of l)R.push(await(0,wr.checkParkedStaleness)(G,{transport:_,watermarks:{get:a($=>w.get($),"get")},redact:a($=>s.redact($),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}}));if(r.json!==!0&&nve(R,t),c.length===0)return r.json===!0&&R.length>0&&t(JSON.stringify({parked:R},null,2)),t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),A(),await E(2),2;let O=new wr.ParityValidator({transport:_,sha1:LG,localFilesFor:a(G=>eve(Bi.join(n,G.localPath)),"localFilesFor"),watermarks:{get:a(G=>w.get(G),"get")},yaml:JEe,redact:a(G=>s.redact(G),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${n}`);let P=a(()=>{let G=b?.stats();G===void 0||G.hits+G.stores===0||t(`[ExoSync objects] ${G.hits} served from cache, ${G.misses} fetched, ${G.stores} stored${G.evictions>0?`, ${G.evictions} evicted`:""}`)},"reportObjectCache"),N=a(()=>{let G=g?.stats();G===void 0||G.conditional+G.stored===0||t(`[ExoSync conditional] ${G.notModified} not modified (304 \u2014 primary quota not spent) of ${G.conditional} validated, ${G.stored} validator(s) stored`)},"reportConditional"),j=await O.runRound(c,{trigger:"standalone"});r.json===!0?t(JSON.stringify({...j,parked:R},null,2)):rve(j,t),P(),N(),A();let U=j.vacuous?2:j.ok?0:1;return await E(U),U}a(ive,"runExosyncParity");function kG(){return new de("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").option("--no-conditional-requests","Do not send If-None-Match on Git Data reads (a 304 costs no primary quota)").option("--no-object-cache","Do not serve immutable git objects (commits/trees/blobs) from the local cache").action(async r=>{try{process.exitCode=await ive(r)}catch(e){le.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(kG,"exosyncParityCommand");ut();var Zi=require("node:fs"),xF=require("node:crypto"),bi=Q(require("node:path")),Er=Q(Pe());_t();var sve="exosync-watermarks.local.json";function $G(r,e,t){let n=FF(e,t),i=new Yo({token:n,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(n,e.apiBase)??i.transport(),{specs:o,warnings:c}=Ap(r),l=e.configDir??".obsidian",u=bi.join(r,l,"plugins","exocortex",Er.CONDITIONAL_STORE_FILENAME),{transport:f}=vp(s,{...e.conditionalRequests!==void 0?{enabled:e.conditionalRequests}:{},io:Ep(u)}),{transport:d}=Tp(f,{...e.objectCache!==void 0?{enabled:e.objectCache}:{},sha1:Mg}),p=bi.join(r,l,"plugins","exocortex",sve),h=bi.join(r,l,"plugins","exocortex",Er.CONFLICT_CACHE_STORE_FILENAME),g=new Er.LocalConflictCacheStore({io:ac(h)}),m=bi.join(r,l,"plugins","exocortex",Er.OUTBOX_STORE_FILENAME),b=new Er.LocalOutboxStore({io:ac(m)});return{resolver:new Er.QuarantineResolver({transport:d,watermarkStore:new Er.FileWatermarkStore(ac(p)),localFilesFor:a(_=>sv(bi.join(r,_.localPath)),"localFilesFor"),sha1:Mg,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(_=>i.redact(_),"redact"),conflictCache:g,outbox:b}),specs:o,warnings:c}}a($G,"buildResolver");async function ove(r,e={}){let t=e.out??(u=>console.log(u)),n=bi.resolve(r.vault);if(!(0,Zi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{resolver:i,specs:s,warnings:o}=$G(n,r,e);for(let u of o)t(`warn: ${u}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let{conflicts:c,pinned:l}=await i.classifyPins(s);if(r.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),MG(l,n,t),0;t(`${c.length} open conflict(s):`);for(let u of c){let f=`${u.hasLocal?"local":"(no local)"} vs ${u.hasRemote?"remote":"(no remote)"}`;t(` ${u.repoKey} ${u.path} [${f}]${u.uid?` uid=${u.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file --vault <vault> --token-from-gh"),t(" (--take file also needs --file <merged-content-path>)"),MG(l,n,t),0}a(ove,"runQuarantineList");var CF={"remote-pending":"remote change not applied here yet \u2014 this copy is behind","local-withheld":"local change, not pushed yet \u2014 the next push or sync delivers it",converged:"converged, clears on the next sync",unclassified:"unclassified (remote tree unavailable, or a file-mode space)"};function MG(r,e,t){if(r.length!==0){t(""),t(`${r.length} pinned path(s) are not conflicts:`);for(let n of Object.keys(CF)){let i=r.filter(s=>s.kind===n).length;i>0&&t(` ${String(i).padStart(5)} ${CF[n]}`)}for(let n of r.filter(i=>i.kind==="local-withheld"))t(` ${n.repoKey} ${n.path} [${CF["local-withheld"]}]`);t(`Clear with: exosync sync --vault ${e} --token-from-gh`)}}a(MG,"printPinnedNotConflicting");async function ave(r,e,t={}){let n=t.out??(_=>console.log(_)),i=bi.resolve(e.vault);if(!(0,Zi.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await Zi.promises.readFile(bi.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=$G(i,e,t);for(let _ of u)n(`warn: ${_}`);if(l.length===0)return n("No materialized AssetSpaces with a GitHub source found in this vault."),1;let f=await c.listOpenConflicts(l),d=e.repo,p=f.filter(_=>_.path===r),h=d===void 0?p:p.filter(_=>_.repoKey===d);if(h.length===0){if(f.length===0)n("No open conflicts in any mounted assetspace \u2014 nothing to resolve.");else if(d!==void 0&&p.length>0){n(`"${r}" is an open conflict, but not in "${d}" \u2014 a repoKey carries the sync branch (owner/repo#branch). It conflicts in:`);for(let _ of p)n(` --repo ${_.repoKey}`)}else{let _=d===void 0?f:f.filter(A=>A.repoKey===d);n(`"${r}" is not among the ${_.length} open conflict(s)`+(d===void 0?"":` in "${d}"`)+" \u2014 the path is repo-relative, exactly as `exosync quarantine list` prints it:");for(let A of _)n(d===void 0?` ${A.repoKey} ${A.path}`:` ${A.path}`)}return 1}if(h.length>1){n(`"${r}" conflicts in ${h.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let _ of h)n(` --repo ${_.repoKey}`);return 1}let g=h[0],m=l.find(_=>_.repoKey===g.repoKey),b=await c.resolve(m,g.path,o),S=b.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":b.pushedSha!==void 0?` \u2014 pushed @${b.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return n(`Resolved ${g.path} (${b.resolvedTo}) in ${g.repoKey}${S}.`),b.discardedLocalBackupPath!==void 0&&(n(` \u21B3 your discarded local version is preserved at ${m.localPath}/${b.discardedLocalBackupPath}`),n(" it stays on this device only \u2014 '.conflict.' paths are excluded from BOTH sync predicates, so the backup never reaches the remote. Delete it yourself once you have checked you do not need the discarded version.")),0}a(ave,"runQuarantineResolve");function PF(r){return r.replace(/\r\n?/g,`
681
- `).replace(/\n+$/,"")}a(PF,"normalizeForCompare");function cve(r,e,t){let n=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of n){let c=PF(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:r}):s.push({action:"reuuid",path:o.path,fromUid:r,toUid:t()})}return s}a(cve,"planDedupGroup");async function lve(r,e={}){let t=e.out??(f=>console.log(f)),n=bi.resolve(r.vault);if(!(0,Zi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{specs:i,warnings:s}=Ap(n);for(let f of s)t(`warn: ${f}`);let o=[];for(let f of i){let d=bi.join(n,f.localPath);if(!(0,Zi.existsSync)(d))continue;let p=sv(d);for(let h of await p.list())if(h.endsWith(".md"))try{o.push({path:bi.join(d,h),content:await p.read(h)})}catch{continue}}let c=(0,Er.findDuplicateUidGroups)(o).map(f=>[f.uid,[...f.paths]]);if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>bi.relative(n,f),"rel");if(r.auto===!0){let f=[];for(let[b,S]of c){let _=[],A=new Map;for(let E of S){let w=await Zi.promises.readFile(E,"utf-8");_.push({path:E,content:w}),A.set(E,w)}f.push({uid:b,decisions:cve(b,_,xF.randomUUID),snap:A})}let d=0,p=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:b,decisions:S}of f){t(` ${b}:`);for(let _ of S)_.action==="keep"?t(` KEEP ${l(_.path)} (keeps uid ${b})`):_.action==="reuuid"?(p++,t(` RE-UUID ${l(_.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(_.path)} (identical content \u2192 ${l(_.identicalTo)}; zero-loss)`))}if(r.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${p} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let h=0,g=0,m=0;for(let{decisions:b,snap:S}of f){for(let _ of b){if(_.action!=="delete")continue;let A;try{A=await Zi.promises.readFile(_.path,"utf-8")}catch{continue}if(PF(A)!==PF(S.get(_.path)??"")){t(` ! skipped delete ${l(_.path)} (changed since scan \u2014 re-run dedup-uids)`),m++;continue}await Zi.promises.rm(_.path,{force:!0}),t(` deleted ${l(_.path)} (identical to ${l(_.identicalTo)})`),h++}for(let _ of b){if(_.action!=="reuuid")continue;let A;try{A=await Zi.promises.readFile(_.path,"utf-8")}catch{continue}if((0,Er.extractAssetUid)(A)!==_.fromUid){t(` ! skipped re-uuid ${l(_.path)} (uid changed since scan \u2014 re-run dedup-uids)`),m++;continue}let E=(0,Er.rewriteAssetUid)(A,_.toUid);E!==A&&(await Zi.promises.writeFile(_.path,E,"utf-8"),t(` re-uuid ${l(_.path)} \u2192 uid=${_.toUid} (content differs from kept copy)`),g++)}}return t(`Resolved: deleted ${h} identical copy(ies), re-uuid ${g} differing variant(s).${m>0?` ${m} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),m>0?1:0}r.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let p of d)t(` ${l(p)}`)}if(r.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let f of(0,Er.planDuplicateUidFix)(o,xF.randomUUID))await Zi.promises.writeFile(f.path,f.content,"utf-8"),t(` fixed ${l(f.path)} \u2192 uid=${f.toUid}`),u++;return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(lve,"runDedupUids");function OF(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(OF,"withQuarantineOptions");function jG(r){let e=new de("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");OF(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await ove(t)}catch(n){le.handle(n,{command:"exosync quarantine list"}),process.exitCode=1}}),OF(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,n)=>{try{process.exitCode=await ave(t,n)}catch(i){le.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),r.addCommand(e),OF(r.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await lve(t)}catch(n){le.handle(n,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(jG,"registerQuarantineCommands");_t();var uve=["GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG","GIT_OBJECT_DIRECTORY","GIT_DIR","GIT_WORK_TREE","GIT_IMPLICIT_WORK_TREE","GIT_GRAFT_FILE","GIT_INDEX_FILE","GIT_NO_REPLACE_OBJECTS","GIT_REPLACE_REF_BASE","GIT_PREFIX","GIT_INTERNAL_SUPER_PREFIX","GIT_SHALLOW_FILE","GIT_COMMON_DIR"];function BG(r){let e={...r};for(let t of uve)delete e[t];return e}a(BG,"repoIsolatedGitEnv");var Mg=a(async r=>{let e=await UG.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),fve={parse:a(r=>Hc(r,{schema:Su}),"parse"),stringify:a(r=>Wd(r,{schema:Su,lineWidth:-1}),"stringify")};function FF(r,e){if(r.tokenFromGh===!0)return Yo.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(FF,"resolveToken");function sv(r){let e=a(i=>Vr.join(r,i),"abs"),t=a(async(i,s)=>{let o;try{o=await Jr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Vr.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Vr.relative(r,l).split(Vr.sep).join("/"))}},"walk"),n=a(async(i,s)=>{let o=Vr.dirname(i);await Jr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await Jr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,Jr.existsSync)(r)&&await t(r,i),i},read:a(i=>Jr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await n(e(i),o=>Jr.promises.writeFile(o,s,"utf-8"))},async delete(i){await Jr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await Jr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await n(e(i),c=>Jr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await Jr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(sv,"nodeLocalFilesPort");function ac(r){return{async read(){try{return await Jr.promises.readFile(r,"utf-8")}catch{return null}},async writeAtomic(e){await Jr.promises.mkdir(Vr.dirname(r),{recursive:!0});let t=`${r}.local.tmp`;await Jr.promises.writeFile(t,e,"utf-8"),await Jr.promises.rename(t,r)}}}a(ac,"nodeWatermarkFileIO");function ku(r,e=".obsidian"){let t=Vr.join(r,e,"plugins","exocortex",et.MOUNT_BASE_STORE_FILENAME);return new et.FileMountBaseStore(ac(t))}a(ku,"nodeMountBaseStore");var dve=(0,GG.promisify)(VG.execFile);function pve(r){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await dve("git",["-C",r,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304,env:BG(process.env)}),n=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return n?n[1]:null}catch{return null}}}a(pve,"nodeLocalBaseShaProvider");function hve(r){return{async check(e){let t=Vr.join(r,e.localPath);if(!(0,Jr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let n=0;try{n=(await Jr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return n===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(hve,"nodeMaterializationCheck");function mve(r,e){let t=r.pushedSha!==void 0?` \u2192@${r.pushedSha.slice(0,7)}`:"",n=(r.outboxPushedCount??0)>0?`, pushed ${r.outboxPushedCount} resolved`:"",i=(r.outboxReconflictedCount??0)>0?`, ${r.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${r.repoKey}${t}: ${r.status} \u2014 pulled ${r.pulledCount}, pushed ${r.pushedCount}, merged ${r.mergedCount}, quarantined ${r.quarantinedCount}${(r.pushedDeletes?.length??0)>0?`, deleted ${r.pushedDeletes.length}`:""}${n}${i}`),r.detail!==void 0&&e(` ${r.detail}`);for(let s of r.warnings)e(` warn: ${s}`);(r.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${r.quarantinedPaths.join(", ")}`),(r.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${r.deferredPaths.join(", ")}`),(r.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${r.deferredDeletes.join(", ")}`),r.timings!==void 0&&(0,et.totalMs)(r.timings)>0&&e(` ${(0,et.formatRepoTimings)(r.repoKey,r.timings)}`)}a(mve,"printRepoResult");function gve(r){return r==="conflict"||r==="full-conflict"||r==="retry-exhausted"||r==="busy"||r==="auth-required"||r==="error"}a(gve,"isFailureStatus");async function yve(r,e,t={}){let n=t.out??($=>console.log($)),i=Vr.resolve(e.vault);if(!(0,Jr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=FF(e,t),o=new Yo({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Ap(i);for(let $ of u)n(`warn: ${$}`);if(l.length===0)return n("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),await Lg(Dg(i,e.configDir??".obsidian"),Ng({command:"sync",vault:i,restCalls:0,quota:void 0,exitCode:2})),2;let f=e.configDir??".obsidian",d=Vr.join(i,f,"plugins","exocortex",et.WATERMARK_STORE_FILENAME),p=Vr.join(i,f,"plugins","exocortex",et.LOCAL_MANIFEST_STORE_FILENAME),h=Vr.join(i,f,"plugins","exocortex",et.CONFLICT_CACHE_STORE_FILENAME),g=new et.LocalConflictCacheStore({io:ac(h)}),m=Vr.join(i,f,"plugins","exocortex",et.OUTBOX_STORE_FILENAME),b=new et.LocalOutboxStore({io:ac(m)}),S=g,_=new et.FileWatermarkStore(ac(d)),{transport:A,cache:E}=vp(c,{...e.conditionalRequests!==void 0?{enabled:e.conditionalRequests}:{},io:Ep(Vr.join(i,f,"plugins","exocortex",et.CONDITIONAL_STORE_FILENAME))}),{transport:w,cache:R}=Tp(A,{...e.objectCache!==void 0?{enabled:e.objectCache}:{},sha1:Mg}),O=new et.SyncEngine({transport:w,watermarkStore:_,localManifestStore:new et.FileLocalManifestStore(ac(p)),mountBaseStore:ku(i,f),localBaseShaProvider:pve(i),materializationCheck:hve(i),localFilesFor:a($=>sv(Vr.join(i,$.localPath)),"localFilesFor"),sha1:Mg,redact:a($=>o.redact($),"redact"),commitMessage:a(($,k,te=0)=>`exosync: ${k} change(s)${te>0?`, ${te} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new et.GatedStructuredMerger(new et.StructuredMerger(fve)),quarantine:S,outbox:b,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});n(`ExoSync ${r}: ${l.length} repo(s), vault ${i}`);let P=(0,et.orderChildrenFirst)(l),N=e.json===!0?void 0:$=>{n(`[ExoSync] ${$.repoKey}: ${(0,et.syncProgressPhaseText)($)}`)},j=await O.syncAll(P,r,N),U=(0,et.aggregateTimings)(j);if(e.json===!0)n(JSON.stringify(j,null,2));else{for(let K of j)mve(K,n);let $=j.reduce((K,he)=>({pulled:K.pulled+he.pulledCount,pushed:K.pushed+he.pushedCount,merged:K.merged+he.mergedCount,quarantined:K.quarantined+he.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0}),k=await _.getAll(),te=0;for(let K of l)te+=k[K.repoKey]?.pinnedPaths?.length??0;let Z=te>0?`, pinned ${te} (incl. conflicts; see \`exosync quarantine list\`)`:"";n(`Summary: ${j.length} repo(s) \u2014 pulled ${$.pulled}, pushed ${$.pushed}, merged ${$.merged}, quarantined ${$.quarantined}${Z}`),(0,et.totalMs)(U)>0&&n((0,et.formatTimingsLine)(U));let re=R?.stats();re!==void 0&&re.hits+re.stores>0&&n(`[ExoSync objects] ${re.hits} served from cache, ${re.misses} fetched, ${re.stores} stored${re.evictions>0?`, ${re.evictions} evicted`:""}`);let V=E?.stats();V!==void 0&&V.conditional+V.stored>0&&n(`[ExoSync conditional] ${V.notModified} not modified (304 \u2014 primary quota not spent) of ${V.conditional} validated, ${V.stored} validator(s) stored`),n(`[ExoSync quota] ${U.counts.restCalls} REST | ${(0,et.formatQuota)(U.quota)}`)}let G=j.some($=>gve($.status))?1:0;return await Lg(Dg(i,f),Ng({command:"sync",vault:i,restCalls:U.counts.restCalls,quota:U.quota,exitCode:G})),G}a(yve,"runExosyncSync");function DF(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)").option("--no-conditional-requests","Do not send If-None-Match on Git Data reads (a 304 costs no primary quota)").option("--no-object-cache","Do not serve immutable git objects (commits/trees/blobs) from the local cache")}a(DF,"withSyncOptions");function LF(r){return async e=>{try{process.exitCode=await yve(r,e)}catch(t){le.handle(t,{command:`exosync ${r}`}),process.exitCode=1}}}a(LF,"makeDirectionAction");function qG(){let r=new de("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return DF(r.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(LF("sync")),DF(r.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(LF("pull")),DF(r.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(LF("push")),jG(r),r}a(qG,"exosyncCommand");var bve=a(r=>{process.stderr.write(`${r}
682
- `)},"DEFAULT_LOG"),ov=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??bve}async confirmApply(e){if(this.verbose){let t=Array.from(e.filesToDestroy.values()).reduce((n,i)=>n+i.length,0);if(this.log(`[apply-profile] Target: ${e.targetProfileLabel} (${e.targetProfileUid})`),this.log(`[apply-profile] Source: ${e.sourceProfileLabel}`),this.log(`[apply-profile] ${t} files to remove, ${e.assetSpacesBeingTornDown.length} AS to tear down, ${e.assetSpacesBeingMaterialized.length} AS to materialize`),e.assetSpacesBeingParked.length>0){let n=e.assetSpacesBeingParked.reduce((i,s)=>i+s.fileCount,0);this.log(`[apply-profile] ${n} files to park (moved to .exocortex/parked, NOT removed), ${e.assetSpacesBeingParked.length} AS to park`)}e.assetSpacesBeingUnparked.length>0&&this.log(`[apply-profile] ${e.assetSpacesBeingUnparked.length} AS to unpark (restored from .exocortex/parked, no download)`)}return this.yes?!0:(this.log("[apply-profile] Refused: --yes flag required for headless mode (Decision #2 safety)."),!1)}};_t();Nt();ir();async function _ve(r,e,t={}){let n=[],i=[],s=t.out??(R=>process.stdout.write(`${R}
678
+ `}a($Ee,"settingAsset");function wG(){return new de("scaffold").description("Scaffold homoiconic configuration assets").addCommand(jEe())}a(wG,"scaffoldCommand");function jEe(){return new de("validation-settings").description("Scaffold the 4 validation-check setting__Setting instances (uid-uniqueness=true, rest=false) co-located in the chosen ontology").requiredOption("--vault <path>","Vault root directory").requiredOption("--ontology <uid>","UID of the ontology whose folder the check settings are co-located in").option("--output <type>","Response format: text|json","text").action(async r=>{let e=r.output??"text";le.setFormat(e);try{let t=(0,Lu.resolve)(r.vault);if(!(0,ZE.existsSync)(t)||!(0,ZE.statSync)(t).isDirectory())throw new Fe(t);let s=(await new Fn(t).indexedAssets()).find(u=>(0,Ho.readUid)(u.metadata)===r.ontology);if(!s)throw new Error(`Ontology UID "${r.ontology}" not found in vault ${t} (its folder is where the check settings co-locate).`);let o=(0,Lu.join)(t,(0,Lu.dirname)(s.path)),c=new Date().toISOString().slice(0,19),l=[];for(let u of MEe){let f=(0,SG.randomUUID)(),d=(0,Lu.join)(o,`${f}.md`);await(0,_G.writeFile)(d,$Ee(f,r.ontology,u.checkId,u.label,u.value,c),"utf-8"),l.push(d)}if(e==="json")console.log(JSON.stringify({vaultPath:t,ontology:r.ontology,targetDir:o,created:l},null,2));else{console.log(`OK: scaffolded ${l.length} validation-check setting(s) in ${o}`);for(let u of l)console.log(` ${u}`);console.log(`
679
+ Defaults: uid-uniqueness=true, co-location/shacl/dag=false. Run 'exocortex validate vault --vault <path>'.`)}}catch(t){le.handle(t)}})}a(jEe,"scaffoldValidationCommand");ut();var WG=require("fs"),zG=require("path");var ul=require("node:fs"),Nu=require("node:path"),Ur=Q(Pe());var yt=require("node:fs"),vG=require("node:fs/promises"),TG=require("node:os"),dn=require("node:path"),_s=Q(Pe());var BEe=/^https:\/\/github\.com\/([a-zA-Z0-9_-]+)\/([a-zA-Z0-9_.-]+?)(?:\.git)?$/,EG=50*1024*1024,ji=class r{static{a(this,"BootstrapAssetSpaceService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.mountBaseStore=e.mountBaseStore}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}static parseGitHubURL(e){let t=e.match(BEe);if(t===null)throw new Error(`parseGitHubURL: invalid URL shape \u2014 expected https://github.com/<owner>/<repo>, got: ${e}`);return{owner:t[1],repo:t[2]}}static deriveFolderName(e){let{repo:t}=r.parseGitHubURL(e);return t.startsWith("exoas-")?t.slice(6):t}async pullAssetSpace(e,t,n){let{owner:i,repo:s}=r.parseGitHubURL(e);if((0,yt.existsSync)(n)&&(0,yt.readdirSync)(n).length>0)throw new Error(`pullAssetSpace: target ${n} exists \u0438 not empty \u2014 refusing \u043A overwrite`);let o=await(0,_s.mountAssetSpaceFiles)({http:this.httpPort(),fs:this.fsPort(),owner:i,repo:s,ref:t,targetPath:n});if(this.mountBaseStore!==void 0)try{await this.mountBaseStore.set(`${i}/${s}#${_s.SYNC_BRANCH}`,o.sha)}catch{}return o}httpPort(){let e=this.fetchImpl,t=this.token,n=a(i=>this.redact(i),"redact");return{async fetchTarball(i,s,o){let c=`https://api.github.com/repos/${i}/${s}/tarball/${o}`,l={signal:AbortSignal.timeout(6e4)};t.length>0&&(l.headers={Authorization:`Bearer ${t}`,"User-Agent":"exocortex-cli","X-GitHub-Api-Version":"2022-11-28"});let u;try{u=await e(c,l)}catch(d){throw new Error(n(`pullAssetSpace: fetch error for ${c}: ${d instanceof Error?d.message:String(d)}`))}if(!u.ok){if(u.status===403){let d=u.headers?.get?.("x-ratelimit-remaining"),p=u.headers?.get?.("x-ratelimit-reset");if(d==="0"||p!=null){let h=p!=null?new Date(Number(p)*1e3).toISOString():"unknown";throw new Error(`pullAssetSpace: GitHub anonymous API rate-limit exceeded (60 req/hour). Reset at ${h}. Wait or use authenticated CLI.`)}}if(u.status===404){let d=t.length>0?"repo not found, or the provided token lacks access to it":"if this is a private repo, pass --token <pat> (or set GITHUB_TOKEN / GH_TOKEN)";throw new Error(n(`pullAssetSpace: fetch failed (404 Not Found) for ${c} \u2014 ${d}`))}throw new Error(n(`pullAssetSpace: fetch failed (${u.status} ${u.statusText}) for ${c}`))}let f=await u.arrayBuffer();if(f.byteLength>EG)throw new Error(`pullAssetSpace: tarball too large (${f.byteLength} bytes > ${EG})`);return new Uint8Array(f)}}}fsPort(){return{async exists(e){return(0,yt.existsSync)(e)},async read(e){return(0,yt.readFileSync)(e,"utf8")},async write(e,t){(0,yt.writeFileSync)(e,t,{encoding:"utf8"})},async removeDir(e){(0,yt.rmSync)(e,{recursive:!0,force:!0})},async materialize(e,t,n){let i=await(0,vG.mkdtemp)((0,dn.join)((0,TG.tmpdir)(),`exo-bootstrap-${(0,dn.basename)(e)}-`)),s=0;try{for(let o of t){let c=o.relPath;if(c.split("/").some(u=>u===".."))throw new Error(`pullAssetSpace: path traversal detected for entry "${c}"`);let l=(0,dn.resolve)(i,c);if(l!==i&&!l.startsWith(i+dn.sep))throw new Error(`pullAssetSpace: zip-slip detected for entry "${c}"`);(0,yt.mkdirSync)((0,dn.dirname)(l),{recursive:!0}),(0,yt.writeFileSync)(l,o.content),s++,n?.(s)}(0,yt.mkdirSync)((0,dn.dirname)(e),{recursive:!0});try{(0,yt.renameSync)(i,e)}catch(o){if(o.code==="EXDEV"){let{cpSync:c}=await import("node:fs");c(i,e,{recursive:!0}),(0,yt.rmSync)(i,{recursive:!0,force:!0})}else throw o}}catch(o){throw(0,yt.rmSync)(i,{recursive:!0,force:!0}),o}return s}}}ensureGitmodulesEntry(e,t,n){let i=(0,dn.join)(e,".gitmodules"),s="";try{s=(0,yt.readFileSync)(i,"utf8")}catch(l){if(l.code!=="ENOENT")throw l}let{content:o,added:c}=(0,_s.appendGitmodulesEntry)(s,t,n);return c?((0,yt.appendFileSync)(i,o.slice(s.length),{encoding:"utf8"}),{added:!0}):{added:!1}}removeGitmodulesEntry(e,t){let n=(0,dn.join)(e,".gitmodules"),i;try{i=(0,yt.readFileSync)(n,"utf8")}catch(o){if(o.code==="ENOENT")return{removed:!1};throw o}let s=(0,_s.stripGitmodulesEntry)(i,t);return s===i?{removed:!1}:((0,yt.writeFileSync)(n,s,{encoding:"utf8"}),{removed:!0})}static stripGitmodulesEntry(e,t){return(0,_s.stripGitmodulesEntry)(e,t)}unmountAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"unmountAssetSpace");this.removeGitmodulesEntry(e,t),(0,yt.existsSync)(n)&&(0,yt.rmSync)(n,{recursive:!0,force:!0})}parkAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"parkAssetSpace"),i=(0,_s.parkedPathFor)(t),s=this.assertSafeVaultTarget(e,i,"parkAssetSpace",{requireAssetspacesRoot:!1});if((0,yt.existsSync)(n)){if((0,yt.existsSync)(s))throw new Error(`parkAssetSpace: refusing to park "${t}" \u2014 a parked copy already exists at "${i}". Resolve by hand: one of the two holds work the other does not.`);this.removeGitmodulesEntry(e,t),(0,yt.mkdirSync)((0,dn.dirname)(s),{recursive:!0}),(0,yt.renameSync)(n,s)}}unparkAssetSpace(e,t){let n=this.assertSafeVaultTarget(e,t,"unparkAssetSpace"),i=(0,_s.parkedPathFor)(t),s=this.assertSafeVaultTarget(e,i,"unparkAssetSpace",{requireAssetspacesRoot:!1});if(!(0,yt.existsSync)(s))throw new Error(`unparkAssetSpace: nothing parked at "${i}" for "${t}"`);if((0,yt.existsSync)(n))throw new Error(`unparkAssetSpace: refusing to unpark onto existing mount "${t}"`);(0,yt.mkdirSync)((0,dn.dirname)(n),{recursive:!0}),(0,yt.renameSync)(s,n)}assertSafeVaultTarget(e,t,n,i={}){let s=i.requireAssetspacesRoot??!0,o=t.split("/");if(t.length===0||s&&!t.startsWith("assetspaces/")||o.some(u=>u.length===0||u==="."||u===".."))throw new Error(`${n}: refusing unsafe submodulePath "${t}"`);let c=(0,dn.resolve)(e),l=(0,dn.resolve)(c,t);if(l===c||!l.startsWith(c+dn.sep))throw new Error(`${n}: target "${l}" escapes vault root "${c}"`);return l}};function UEe(r){let e=(0,Ur.derivePath)(r);return e===null?r:(0,Ur.deriveUrl)(e)??r}a(UEe,"toHttpsGitHubUrl");var VEe=new Set(["node_modules",".obsidian",".exocortex",".git"]),wp=class{static{a(this,"CliApplyProfileService")}constructor(e){this.vaultPath=e.vaultPath,this.mount=e.mount??new ji,this.ref=e.ref??"main"}scanVault(){let e=[],t=new Map,n=new Set,i=[this.vaultPath];for(;i.length>0;){let s=i.pop(),o;try{o=(0,ul.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Nu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith(".")||VEe.has(c.name))continue;i.push(l);continue}if(!c.isFile()||!c.name.endsWith(".md"))continue;let u=this.readFrontmatter(l);if(u===null)continue;let f=u.exo__Asset_uid;if(typeof f!="string"||f.length===0)continue;let d=Ji(u.exo__Instance_class);if(d.includes(Du)){if(n.has(f))continue;let h=(typeof u.exo__AssetSpace_source=="string"?u.exo__AssetSpace_source:"")||(typeof u.exo__AssetSpace_git=="string"?u.exo__AssetSpace_git:"");if(h.length===0)continue;let g=(0,Ur.derivePath)(h);if(g===null)continue;let m=typeof u.exo__AssetSpace_namespace=="string"?u.exo__AssetSpace_namespace:"",b=m||qEe(g)||f.slice(0,8),S=u.exo__AssetSpace_dependsOnKind,_=typeof S=="string"?S:Array.isArray(S)&&typeof S[0]=="string"?S[0]:void 0;n.add(f),e.push({uid:f,git:h,folderName:g,label:b,namespace:m,dependsOnKind:_})}if(d.includes(gF)){let p=u.exo__Asset_label;typeof p=="string"&&p.length>0&&t.set(f,p)}}}return{infos:e,profileLabels:t}}assertTsFloor(e,t){(0,Ur.assertTsFloorReconciled)(e,t,Ur.SDK_FLOOR)}buildDiff(e){let{targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,result:o,infos:c}=e,l=new Map;for(let w of c)l.set(w.uid,w);let u=new Set(l.keys()),f=new Set,d=new Set;for(let w of o.declaredOntologies)if(u.has(w)){f.add(w);let R=l.get(w)?.namespace;R!==void 0&&R.length>0&&d.add(R)}this.assertTsFloor(f,d);let p=new Set([...o.effective,...f]),h=new Map;for(let w of c){let R=(0,ul.existsSync)((0,Nu.join)(this.vaultPath,w.folderName))?"active":(0,ul.existsSync)((0,Nu.join)(this.vaultPath,(0,Ur.parkedPathFor)(w.folderName)))?"parked":"absent";h.set(w.uid,R)}let g=new Set([...h].filter(([,w])=>w==="active").map(([w])=>w));for(let w of c)Ur.CATALOG_KEEP_NAMESPACES.has(w.namespace)&&g.has(w.uid)&&p.add(w.uid);let m=[],b=[],S=[];for(let w of c){let R=(0,Ur.classifyMountTransition)({state:h.get(w.uid)??"absent",inEffectiveSet:p.has(w.uid),dependsOnKind:w.dependsOnKind});switch(R){case"none":break;case"destroy":m.push({asUid:w.uid,folderName:w.folderName,label:w.label,files:this.enumerateFilesUnder(w.folderName)});break;case"park":b.push({asUid:w.uid,folderName:w.folderName,label:w.label,files:this.enumerateFilesUnder(w.folderName)});break;case"unpark":case"materialize":S.push({asUid:w.uid,folderName:w.folderName,httpsUrl:UEe(w.git),label:w.label,source:R==="unpark"?"unpark":"pull"});break}}let _=new Map;for(let w of m)_.set(w.asUid,w.files);let A=new Set(S.filter(w=>w.source==="unpark").map(w=>w.asUid)),E={targetProfileUid:t,targetProfileLabel:n,sourceProfileUid:i,sourceProfileLabel:s,filesToDestroy:_,assetSpacesBeingTornDown:m.map(w=>({asUid:w.asUid,asLabel:w.label,fileCount:w.files.length})),assetSpacesBeingParked:b.map(w=>({asUid:w.asUid,asLabel:w.label,fileCount:w.files.length})),assetSpacesBeingMaterialized:S.map(w=>({asUid:w.asUid,asLabel:w.label})),assetSpacesBeingUnparked:S.filter(w=>A.has(w.asUid)).map(w=>({asUid:w.asUid,asLabel:w.label}))};return{toDestroy:m,toPark:b,toMaterialize:S,plan:E}}async execute(e){let t=[],n=[],i=[];for(let s of e.toDestroy)this.mount.unmountAssetSpace(this.vaultPath,s.folderName),t.push(s.asUid);for(let s of e.toPark)this.mount.parkAssetSpace(this.vaultPath,s.folderName),n.push(s.asUid);for(let s of e.toMaterialize){if(s.source==="unpark")this.mount.unparkAssetSpace(this.vaultPath,s.folderName);else{let o=(0,Nu.join)(this.vaultPath,s.folderName);await this.mount.pullAssetSpace(s.httpsUrl,this.ref,o)}this.mount.ensureGitmodulesEntry(this.vaultPath,s.folderName,s.httpsUrl),i.push(s.asUid)}return{destroyed:t,parked:n,materialized:i}}enumerateFilesUnder(e){let t=[],i=[(0,Nu.join)(this.vaultPath,e)];for(;i.length>0;){let s=i.pop(),o;try{o=(0,ul.readdirSync)(s,{withFileTypes:!0})}catch{continue}for(let c of o){let l=(0,Nu.join)(s,c.name);if(c.isDirectory()){if(c.name.startsWith("."))continue;i.push(l);continue}c.isFile()&&t.push(GEe(l,this.vaultPath))}}return t}readFrontmatter(e){let t;try{t=(0,ul.readFileSync)(e,"utf-8")}catch{return null}if(!t.startsWith("---"))return null;let n=t.match(/^---\r?\n([\s\S]*?)\r?\n---/);if(n===null)return null;try{let i=(0,Ur.parseYamlFrontmatterTolerant)(n[1],e);return i&&typeof i=="object"&&!Array.isArray(i)?i:null}catch{return null}}};function GEe(r,e){let t=e.endsWith("/")?e:e+"/";return(r.startsWith(t)?r.slice(t.length):r).split("\\").join("/")}a(GEe,"relativeVaultPath");function qEe(r){let e=r.split("/").filter(t=>t.length>0);return e.length>0?e[e.length-1]:""}a(qEe,"lastSegment");ut();var Jr=require("node:fs"),UG=require("node:crypto"),VG=require("node:child_process"),GG=require("node:util"),Vr=Q(require("node:path"));qm();var et=Q(Pe());ut();var Qo=require("node:fs"),NG=require("node:crypto"),Bi=Q(require("node:path"));qm();var wr=Q(Pe());Xs();var AG=require("node:child_process"),ev=Q(Pe());var WEe=6e4,Yo=class r{static{a(this,"RestPushService")}static{this.PAT_REGEX=/(?:gh[pousr]_[A-Za-z0-9_]{36,}|github_pat_[A-Za-z0-9_]{22,}_[A-Za-z0-9_]{59,})/g}constructor(e={}){this.fetchImpl=e.fetchImpl??globalThis.fetch,this.token=e.token??"",this.apiBase=(e.apiBase??"https://api.github.com").replace(/\/$/,"")}static resolveGhToken(e){let t=e??(()=>(0,AG.execFileSync)("gh",["auth","token"],{encoding:"utf8",timeout:15e3})),n;try{n=t()}catch(s){let o=s instanceof Error?s.message:String(s);throw new Error(`RestPushService: \`gh auth token\` failed \u2014 is GitHub CLI installed and authenticated? (run \`gh auth login\`). Underlying: ${o}`.replace(r.PAT_REGEX,"***REDACTED***"))}let i=n.trim();if(i.length===0)throw new Error("RestPushService: `gh auth token` returned empty output \u2014 not authenticated. Run `gh auth login`.");return i}redact(e){return(typeof e=="string"?e:String(e)).replace(r.PAT_REGEX,"***REDACTED***")}async push(e,t,n,i,s){return(0,ev.restCreateCommit)(this.buildTransport(),{owner:e,repo:t,branch:n,files:i,message:s,baseURL:this.apiBase,redact:a(o=>this.redact(o),"redact")})}transport(){return this.buildTransport()}buildTransport(){let e=this.token,t=this.fetchImpl,n=a(i=>this.redact(i),"redact");return async i=>{let s={...i.headers??{},Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28","User-Agent":"exocortex-cli"};e.length>0&&(s.Authorization=`Bearer ${e}`),i.contentType&&(s["Content-Type"]=i.contentType);let o;try{o=await t(i.url,{method:i.method,headers:s,body:i.body,signal:AbortSignal.timeout(WEe)})}catch(f){throw new Error(n(`GitHub request failed: ${zEe(f)}`))}let c=a(f=>o.headers?.get?.(f)??void 0,"headerGetter");if(o.status===304&&i.acceptNotModified===!0)return{status:304,headers:c};let l=await o.text().catch(()=>"");if(o.status<200||o.status>=300){let f=c;throw(0,ev.enrichRateLimitError)(new Error(KEe(n(`GitHub request ${i.method} ${i.url} \u2192 HTTP ${o.status}: ${l}`),512)),f)}let u;try{u=l.length>0?JSON.parse(l):void 0}catch{u=void 0}return{status:o.status,json:u,text:l,headers:c}}}};function zEe(r){if(r instanceof Error)return r.message;if(typeof r=="string")return r;try{return JSON.stringify(r)}catch{return String(r)}}a(zEe,"errMsg");function KEe(r,e){return r.length>e?r.slice(0,e)+"...":r}a(KEe,"truncate");var RF=require("node:fs"),tv=Q(require("node:path"));var HEe="exosync-runs.local.jsonl";function Dg(r,e){return tv.join(r,e,"plugins","exocortex",HEe)}a(Dg,"runLogPathFor");async function Lg(r,e,t={}){let n=t.appendFile??RF.promises.appendFile,i=t.mkdir??RF.promises.mkdir;try{return await i(tv.dirname(r),{recursive:!0}),await n(r,`${JSON.stringify(e)}
680
+ `,"utf-8"),!0}catch{return!1}}a(Lg,"appendSyncRunLog");function Ng(r){let e=(r.now??(()=>new Date))();return{ts:YEe(e),command:r.command,vault:r.vault,restCalls:r.restCalls,limit:r.quota?.limit??null,remaining:r.quota?.remaining??null,used:r.quota?.used??null,resetEpoch:r.quota?.resetEpoch??null,exitCode:r.exitCode}}a(Ng,"runLogEntry");function YEe(r){let e=a(s=>String(s).padStart(2,"0"),"p"),t=-r.getTimezoneOffset(),n=t>=0?"+":"-",i=Math.abs(t);return`${r.getFullYear()}-${e(r.getMonth()+1)}-${e(r.getDate())}T${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}${n}${e(Math.floor(i/60))}${e(i%60)}`}a(YEe,"localIso");var IG=require("node:crypto"),kg=Q(require("node:fs/promises")),RG=Q(require("node:path")),rv=Q(Pe());function Ep(r){return{async read(){try{return await kg.default.readFile(r,"utf-8")}catch(e){let t=e.code;if(t==="ENOENT"||t==="EISDIR"||t==="ENOTDIR")return null;throw e}},async writeAtomic(e){await kg.default.mkdir(RG.default.dirname(r),{recursive:!0});let t=`${r}.${process.pid}-${(0,IG.randomUUID)()}.tmp`;await kg.default.writeFile(t,e,"utf-8"),await kg.default.rename(t,r)}}}a(Ep,"nodeConditionalStoreIO");function XEe(r){let e=r.EXOCORTEX_EXOSYNC_CONDITIONAL;return e==="0"||e==="false"||e==="off"}a(XEe,"envDisables");function vp(r,e){let t=e.env??process.env;if(e.enabled===!1||XEe(t))return{transport:r,cache:null};let n=new rv.ConditionalRequestCache({io:e.io});return{transport:(0,rv.withConditionalRequests)(r,n),cache:n}}a(vp,"wireConditionalRequests");var iv=Q(Pe());var CG=require("node:crypto"),Xo=Q(require("node:fs/promises")),OG=Q(require("node:os")),oc=Q(require("node:path"));function xG(r=process.env){let e=r.EXOCORTEX_EXOSYNC_CACHE_DIR;if(e!==void 0&&e.length>0)return e;let t=r.XDG_CACHE_HOME;return t!==void 0&&t.length>0?oc.default.join(t,"exocortex","exosync-objects"):oc.default.join(OG.default.homedir(),".cache","exocortex","exosync-objects")}a(xG,"resolveObjectCacheRoot");function PG(r=process.env){let e=r.EXOCORTEX_EXOSYNC_CACHE_MAX_BYTES;if(e===void 0||e.length===0)return;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}a(PG,"resolveObjectCacheMaxBytes");function nv(r,e){return`${oc.default.join(r,...e.split("/"))}.json`}a(nv,"keyToPath");function QEe(r,e){let t=oc.default.relative(r,e);return t.startsWith("..")||oc.default.isAbsolute(t)||!t.endsWith(".json")?null:t.slice(0,-5).split(oc.default.sep).join("/")}a(QEe,"pathToKey");async function*FG(r){let e;try{e=await Xo.default.readdir(r)}catch{return}for(let t of e){let n=oc.default.join(r,t),i;try{i=(await Xo.default.stat(n)).isDirectory()}catch{continue}i?yield*FG(n):yield n}}a(FG,"walk");function DG(r){return{async read(e){try{return await Xo.default.readFile(nv(r,e),"utf-8")}catch(t){let n=t.code;if(n==="ENOENT"||n==="EISDIR"||n==="ENOTDIR")return null;throw t}},async write(e,t){let n=nv(r,e);await Xo.default.mkdir(oc.default.dirname(n),{recursive:!0});let i=`${n}.${process.pid}-${(0,CG.randomUUID)()}.tmp`;await Xo.default.writeFile(i,t,"utf-8"),await Xo.default.rename(i,n)},async remove(e){await Xo.default.rm(nv(r,e),{force:!0})},async list(){let e=[];for await(let t of FG(r)){if(t.endsWith(".tmp"))continue;let n=QEe(r,t);if(n!==null)try{let i=await Xo.default.stat(t);e.push({key:n,size:i.size,lastUsedMs:i.mtimeMs})}catch{continue}}return e},async markUsed(e){let t=new Date;await Xo.default.utimes(nv(r,e),t,t)}}}a(DG,"nodeObjectCacheIO");function JEe(r){let e=r.EXOCORTEX_EXOSYNC_CACHE;return e==="0"||e==="false"||e==="off"}a(JEe,"envDisables");function Tp(r,e){let t=e.env??process.env;if(e.enabled===!1||JEe(t))return{transport:r,cache:null};let n=PG(t),i=new iv.ImmutableObjectCache({io:e.io??DG(xG(t)),sha1:e.sha1,...n!==void 0?{maxBytes:n}:{}});return{transport:(0,iv.withImmutableObjectCache)(r,i),cache:i}}a(Tp,"wireObjectCache");_t();var LG=a(async r=>{let e=await NG.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),ZEe={parse:a(r=>Hc(r,{schema:Su}),"parse"),stringify:a(r=>Wd(r,{schema:Su,lineWidth:-1}),"stringify")};function eve(r,e){if(r.tokenFromGh===!0)return Yo.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 without one). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(eve,"resolveToken");function tve(r){let e=a(n=>Bi.join(r,n),"abs"),t=a(async(n,i)=>{let s;try{s=await Qo.promises.readdir(n,{withFileTypes:!0})}catch{return}for(let o of s){let c=Bi.join(n,o.name);if(o.isDirectory()){if(o.name===".git")continue;await t(c,i)}else o.isFile()&&i.push(Bi.relative(r,c).split(Bi.sep).join("/"))}},"walk");return{async list(){let n=[];return(0,Qo.existsSync)(r)&&await t(r,n),n},read:a(n=>Qo.promises.readFile(e(n),"utf-8"),"read"),async readBinary(n){return new Uint8Array(await Qo.promises.readFile(e(n)))},async write(){throw new Error("exosync-parity is read-only \u2014 write refused")},async delete(){throw new Error("exosync-parity is read-only \u2014 delete refused")}}}a(tve,"nodeLocalFilesPort");function rve(r,e){let t;try{t=(0,wr.parkedPathFor)(e)}catch{return!1}return(0,Qo.existsSync)(Bi.join(r,t))}a(rve,"isParked");function Ap(r){let e=new Yt(r),t=new wr.SpaceSpecAccumulator,n=[];for(let i of e.getAllFiles()){let s=e.getFrontmatter(i);if(!s)continue;let o=(0,wr.classifySpaceDeclaration)(s,i.path);if(o.kind==="not-space"||(o.warning!==void 0&&t.warnings.push(o.warning),o.kind==="skip"))continue;let c=t.offer(o.candidate);if(c!==null){if(!(0,Qo.existsSync)(Bi.join(r,c.localPath))){rve(r,c.localPath)&&n.push(c);continue}t.commit(o.candidate)}}return{specs:t.specs,parked:n,warnings:t.warnings}}a(Ap,"collectVaultSpecs");function nve(r,e){for(let t of r.repos){let n=t.headSha!==void 0?` @${t.headSha.slice(0,7)}`:"";e(`${t.repoKey}${n}: ${t.status} \u2014 ${t.inParity}/${t.filesChecked} in parity, M2 diffs ${t.m2SemanticDiffs}, accounted ${t.accountedCount}, M1 violations ${t.m1Violations.length}${t.attachmentHashSetIdentical!==void 0?`, attachment hash-set ${t.attachmentHashSetIdentical?"identical":"DIFFERS"}`:""}`),t.detail!==void 0&&e(` ${t.detail}`);for(let i of t.warnings)e(` warn: ${i}`);for(let i of t.discrepancies)e(` ${i.cls}: ${i.path}${i.detail!==void 0?` (${i.detail})`:""}`);for(let i of t.m1Violations)e(` M1 VIOLATION: ${i.path} \u2014 ${i.detail}`)}e((0,wr.summarizeParityRound)(r))}a(nve,"printHumanReport");function ive(r,e){if(r.length!==0){e(`Parked AssetSpaces (frozen on this device, not synced): ${r.length}`);for(let t of r){let n=t.lastSyncedSha!==null?t.lastSyncedSha.slice(0,7):"never",i=t.remoteHeadSha!==null?t.remoteHeadSha.slice(0,7):"unread";switch(t.freshness){case"behind":e(` ${t.repoKey}: BEHIND \u2014 parked at ${n}, remote head is ${i}`);break;case"current":e(` ${t.repoKey}: current \u2014 parked at ${n}, matches the remote head`);break;case"unknown":e(` ${t.repoKey}: unknown \u2014 ${t.reason??"no verdict"}`);break}}}}a(ive,"printParkedSection");async function sve(r,e={}){let t=e.out??(G=>console.log(G)),n=Bi.resolve(r.vault);if(!(0,Qo.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let i=eve(r,e),s=new Yo({token:i,...r.apiBase!==void 0?{apiBase:r.apiBase}:{}}),o=e.transportFactory?.(i,r.apiBase)??s.transport(),{specs:c,parked:l,warnings:u}=Ap(n);for(let G of u)t(`warn: ${G}`);let f=r.configDir??".obsidian",d=Bi.join(n,f,"plugins","exocortex",wr.WATERMARK_STORE_FILENAME),p=Bi.join(n,f,"plugins","exocortex",wr.CONDITIONAL_STORE_FILENAME),{transport:h,cache:g}=vp(o,{...r.conditionalRequests!==void 0?{enabled:r.conditionalRequests}:{},io:Ep(p)}),{transport:m,cache:b}=Tp(h,{...r.objectCache!==void 0?{enabled:r.objectCache}:{},sha1:LG}),S=new wr.SyncPhaseTimer(()=>Date.now()),_=a(async G=>{S.bumpRest();let $=await m(G);return S.observeQuota($.headers),$},"countedTransport"),A=a(()=>{let G=S.snapshot();t(`[ExoSync quota] ${G.counts.restCalls} REST | ${(0,wr.formatQuota)(G.quota)}`)},"reportQuota"),E=a(async G=>{let $=S.snapshot();await Lg(Dg(n,f),Ng({command:"parity",vault:n,restCalls:$.counts.restCalls,quota:$.quota,exitCode:G}))},"journalRun"),w=new wr.FileWatermarkStore({read:a(async()=>{try{return await Qo.promises.readFile(d,"utf-8")}catch{return null}},"read"),writeAtomic:a(async()=>{throw new Error("exosync-parity: watermark access is read-only by contract")},"writeAtomic")}),R=[];for(let G of l)R.push(await(0,wr.checkParkedStaleness)(G,{transport:_,watermarks:{get:a($=>w.get($),"get")},redact:a($=>s.redact($),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}}));if(r.json!==!0&&ive(R,t),c.length===0)return r.json===!0&&R.length>0&&t(JSON.stringify({parked:R},null,2)),t("Nothing to check \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),A(),await E(2),2;let O=new wr.ParityValidator({transport:_,sha1:LG,localFilesFor:a(G=>tve(Bi.join(n,G.localPath)),"localFilesFor"),watermarks:{get:a(G=>w.get(G),"get")},yaml:ZEe,redact:a(G=>s.redact(G),"redact"),...r.apiBase!==void 0?{baseURL:r.apiBase}:{}});t(`ExoSync parity check: ${c.length} repo(s), vault ${n}`);let P=a(()=>{let G=b?.stats();G===void 0||G.hits+G.stores===0||t(`[ExoSync objects] ${G.hits} served from cache, ${G.misses} fetched, ${G.stores} stored${G.evictions>0?`, ${G.evictions} evicted`:""}`)},"reportObjectCache"),N=a(()=>{let G=g?.stats();G===void 0||G.conditional+G.stored===0||t(`[ExoSync conditional] ${G.notModified} not modified (304 \u2014 primary quota not spent) of ${G.conditional} validated, ${G.stored} validator(s) stored`)},"reportConditional"),j=await O.runRound(c,{trigger:"standalone"});r.json===!0?t(JSON.stringify({...j,parked:R},null,2)):nve(j,t),P(),N(),A();let U=j.vacuous?2:j.ok?0:1;return await E(U),U}a(sve,"runExosyncParity");function kG(){return new de("exosync-parity").description("ExoSync M1/M2 parity report: compare materialized sync units against their remote heads (read-only; RFC 4e4dc453 Phase E)").requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--json","Print the full round record as JSON").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--api-base <url>","GitHub API base (testing)").option("--no-conditional-requests","Do not send If-None-Match on Git Data reads (a 304 costs no primary quota)").option("--no-object-cache","Do not serve immutable git objects (commits/trees/blobs) from the local cache").action(async r=>{try{process.exitCode=await sve(r)}catch(e){le.handle(e,{command:"exosync-parity"}),process.exitCode=1}})}a(kG,"exosyncParityCommand");ut();var Zi=require("node:fs"),xF=require("node:crypto"),bi=Q(require("node:path")),Er=Q(Pe());_t();var ove="exosync-watermarks.local.json";function $G(r,e,t){let n=FF(e,t),i=new Yo({token:n,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),s=t.transportFactory?.(n,e.apiBase)??i.transport(),{specs:o,warnings:c}=Ap(r),l=e.configDir??".obsidian",u=bi.join(r,l,"plugins","exocortex",Er.CONDITIONAL_STORE_FILENAME),{transport:f}=vp(s,{...e.conditionalRequests!==void 0?{enabled:e.conditionalRequests}:{},io:Ep(u)}),{transport:d}=Tp(f,{...e.objectCache!==void 0?{enabled:e.objectCache}:{},sha1:Mg}),p=bi.join(r,l,"plugins","exocortex",ove),h=bi.join(r,l,"plugins","exocortex",Er.CONFLICT_CACHE_STORE_FILENAME),g=new Er.LocalConflictCacheStore({io:ac(h)}),m=bi.join(r,l,"plugins","exocortex",Er.OUTBOX_STORE_FILENAME),b=new Er.LocalOutboxStore({io:ac(m)});return{resolver:new Er.QuarantineResolver({transport:d,watermarkStore:new Er.FileWatermarkStore(ac(p)),localFilesFor:a(_=>sv(bi.join(r,_.localPath)),"localFilesFor"),sha1:Mg,...e.apiBase!==void 0?{baseURL:e.apiBase}:{},redact:a(_=>i.redact(_),"redact"),conflictCache:g,outbox:b}),specs:o,warnings:c}}a($G,"buildResolver");async function ave(r,e={}){let t=e.out??(u=>console.log(u)),n=bi.resolve(r.vault);if(!(0,Zi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{resolver:i,specs:s,warnings:o}=$G(n,r,e);for(let u of o)t(`warn: ${u}`);if(s.length===0)return t("No materialized AssetSpaces with a GitHub source found in this vault."),0;let{conflicts:c,pinned:l}=await i.classifyPins(s);if(r.json===!0)return t(JSON.stringify(c,null,2)),0;if(c.length===0)return t("No open conflicts \u2014 nothing to resolve. \u2705"),MG(l,n,t),0;t(`${c.length} open conflict(s):`);for(let u of c){let f=`${u.hasLocal?"local":"(no local)"} vs ${u.hasRemote?"remote":"(no remote)"}`;t(` ${u.repoKey} ${u.path} [${f}]${u.uid?` uid=${u.uid}`:""}`)}return t(""),t("Resolve with: exosync quarantine resolve <path> --take local|remote|file --vault <vault> --token-from-gh"),t(" (--take file also needs --file <merged-content-path>)"),MG(l,n,t),0}a(ave,"runQuarantineList");var CF={"remote-pending":"remote change not applied here yet \u2014 this copy is behind","local-withheld":"local change, not pushed yet \u2014 the next push or sync delivers it",converged:"converged, clears on the next sync",unclassified:"unclassified (remote tree unavailable, or a file-mode space)"};function MG(r,e,t){if(r.length!==0){t(""),t(`${r.length} pinned path(s) are not conflicts:`);for(let n of Object.keys(CF)){let i=r.filter(s=>s.kind===n).length;i>0&&t(` ${String(i).padStart(5)} ${CF[n]}`)}for(let n of r.filter(i=>i.kind==="local-withheld"))t(` ${n.repoKey} ${n.path} [${CF["local-withheld"]}]`);t(`Clear with: exosync sync --vault ${e} --token-from-gh`)}}a(MG,"printPinnedNotConflicting");async function cve(r,e,t={}){let n=t.out??(_=>console.log(_)),i=bi.resolve(e.vault);if(!(0,Zi.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=(e.take??"").trim();if(s!=="local"&&s!=="remote"&&s!=="file")throw new Error("resolve requires --take local | remote | file (with --file <path> for the merged content)");let o;if(s==="file"){if(e.file===void 0||e.file.length===0)throw new Error("--take file requires --file <path> to the merged content");o={take:"merged",content:await Zi.promises.readFile(bi.resolve(e.file),"utf-8")}}else o={take:s};let{resolver:c,specs:l,warnings:u}=$G(i,e,t);for(let _ of u)n(`warn: ${_}`);if(l.length===0)return n("No materialized AssetSpaces with a GitHub source found in this vault."),1;let f=await c.listOpenConflicts(l),d=e.repo,p=f.filter(_=>_.path===r),h=d===void 0?p:p.filter(_=>_.repoKey===d);if(h.length===0){if(f.length===0)n("No open conflicts in any mounted assetspace \u2014 nothing to resolve.");else if(d!==void 0&&p.length>0){n(`"${r}" is an open conflict, but not in "${d}" \u2014 a repoKey carries the sync branch (owner/repo#branch). It conflicts in:`);for(let _ of p)n(` --repo ${_.repoKey}`)}else{let _=d===void 0?f:f.filter(A=>A.repoKey===d);n(`"${r}" is not among the ${_.length} open conflict(s)`+(d===void 0?"":` in "${d}"`)+" \u2014 the path is repo-relative, exactly as `exosync quarantine list` prints it:");for(let A of _)n(d===void 0?` ${A.repoKey} ${A.path}`:` ${A.path}`)}return 1}if(h.length>1){n(`"${r}" conflicts in ${h.length} repos \u2014 disambiguate with --repo <repoKey>:`);for(let _ of h)n(` --repo ${_.repoKey}`);return 1}let g=h[0],m=l.find(_=>_.repoKey===g.repoKey),b=await c.resolve(m,g.path,o),S=b.awaitingPush===!0?" \u2014 awaiting push (run `exosync sync` to push it)":b.pushedSha!==void 0?` \u2014 pushed @${b.pushedSha.slice(0,7)}`:" \u2014 remote already matched";return n(`Resolved ${g.path} (${b.resolvedTo}) in ${g.repoKey}${S}.`),b.discardedLocalBackupPath!==void 0&&(n(` \u21B3 your discarded local version is preserved at ${m.localPath}/${b.discardedLocalBackupPath}`),n(" it stays on this device only \u2014 '.conflict.' paths are excluded from BOTH sync predicates, so the backup never reaches the remote. Delete it yourself once you have checked you do not need the discarded version.")),0}a(cve,"runQuarantineResolve");function PF(r){return r.replace(/\r\n?/g,`
681
+ `).replace(/\n+$/,"")}a(PF,"normalizeForCompare");function lve(r,e,t){let n=[...e].sort((o,c)=>o.path.localeCompare(c.path)),i=[],s=[];for(let o of n){let c=PF(o.content),l=i.find(u=>u.norm===c);if(l!==void 0){s.push({action:"delete",path:o.path,identicalTo:l.path});continue}i.push({path:o.path,norm:c}),i.length===1?s.push({action:"keep",path:o.path,uid:r}):s.push({action:"reuuid",path:o.path,fromUid:r,toUid:t()})}return s}a(lve,"planDedupGroup");async function uve(r,e={}){let t=e.out??(f=>console.log(f)),n=bi.resolve(r.vault);if(!(0,Zi.existsSync)(n))throw new Error(`Vault path does not exist: ${n}`);let{specs:i,warnings:s}=Ap(n);for(let f of s)t(`warn: ${f}`);let o=[];for(let f of i){let d=bi.join(n,f.localPath);if(!(0,Zi.existsSync)(d))continue;let p=sv(d);for(let h of await p.list())if(h.endsWith(".md"))try{o.push({path:bi.join(d,h),content:await p.read(h)})}catch{continue}}let c=(0,Er.findDuplicateUidGroups)(o).map(f=>[f.uid,[...f.paths]]);if(c.length===0)return t("No duplicate uids on disk. \u2705"),0;let l=a(f=>bi.relative(n,f),"rel");if(r.auto===!0){let f=[];for(let[b,S]of c){let _=[],A=new Map;for(let E of S){let w=await Zi.promises.readFile(E,"utf-8");_.push({path:E,content:w}),A.set(E,w)}f.push({uid:b,decisions:lve(b,_,xF.randomUUID),snap:A})}let d=0,p=0;t(`${c.length} duplicate uid(s) on disk \u2014 zero-loss plan:`);for(let{uid:b,decisions:S}of f){t(` ${b}:`);for(let _ of S)_.action==="keep"?t(` KEEP ${l(_.path)} (keeps uid ${b})`):_.action==="reuuid"?(p++,t(` RE-UUID ${l(_.path)} (content differs \u2192 fresh uid; both survive, zero-loss)`)):(d++,t(` DELETE ${l(_.path)} (identical content \u2192 ${l(_.identicalTo)}; zero-loss)`))}if(r.apply!==!0)return t(""),t(`Plan: delete ${d} identical copy(ies), re-uuid ${p} differing variant(s).`),t("DRY-RUN \u2014 nothing changed. Re-run with `--auto --apply` to execute (a deleted copy's content always survives in the kept file; if previously synced it is also recoverable from the git remote)."),1;let h=0,g=0,m=0;for(let{decisions:b,snap:S}of f){for(let _ of b){if(_.action!=="delete")continue;let A;try{A=await Zi.promises.readFile(_.path,"utf-8")}catch{continue}if(PF(A)!==PF(S.get(_.path)??"")){t(` ! skipped delete ${l(_.path)} (changed since scan \u2014 re-run dedup-uids)`),m++;continue}await Zi.promises.rm(_.path,{force:!0}),t(` deleted ${l(_.path)} (identical to ${l(_.identicalTo)})`),h++}for(let _ of b){if(_.action!=="reuuid")continue;let A;try{A=await Zi.promises.readFile(_.path,"utf-8")}catch{continue}if((0,Er.extractAssetUid)(A)!==_.fromUid){t(` ! skipped re-uuid ${l(_.path)} (uid changed since scan \u2014 re-run dedup-uids)`),m++;continue}let E=(0,Er.rewriteAssetUid)(A,_.toUid);E!==A&&(await Zi.promises.writeFile(_.path,E,"utf-8"),t(` re-uuid ${l(_.path)} \u2192 uid=${_.toUid} (content differs from kept copy)`),g++)}}return t(`Resolved: deleted ${h} identical copy(ies), re-uuid ${g} differing variant(s).${m>0?` ${m} skipped (re-run).`:""} Run \`exosync sync\` to propagate.`),m>0?1:0}r.apply===!0&&t("Note: --apply only applies with --auto; running in report mode."),t(`${c.length} duplicate uid(s) on disk:`);for(let[f,d]of c){t(` ${f} \u2014 ${d.length} files:`);for(let p of d)t(` ${l(p)}`)}if(r.fix!==!0)return t(""),t("Re-run with --fix to assign a fresh uuid to every duplicate but the first (frontmatter rewrite only \u2014 never renames the file)."),1;let u=0;for(let f of(0,Er.planDuplicateUidFix)(o,xF.randomUUID))await Zi.promises.writeFile(f.path,f.content,"utf-8"),t(` fixed ${l(f.path)} \u2192 uid=${f.toUid}`),u++;return t(`Reassigned ${u} uid(s). Run \`exosync sync\` to propagate.`),0}a(uve,"runDedupUids");function OF(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Machine-readable output").option("--api-base <url>","GitHub API base (testing)")}a(OF,"withQuarantineOptions");function jG(r){let e=new de("quarantine").description("Inspect and resolve ExoSync conflicts (quarantine resolver; RFC 4e4dc453, finding a0a3d1d6)");OF(e.command("list").description("List open conflicts that need a manual choice")).action(async t=>{try{process.exitCode=await ave(t)}catch(n){le.handle(n,{command:"exosync quarantine list"}),process.exitCode=1}}),OF(e.command("resolve <path>").description("Resolve one conflict: --take local | remote | file <path> (merged)").option("--take <choice>","local | remote | file").option("--file <path>","Merged content file (with --take file)").option("--repo <repoKey>","Disambiguate a cross-repo path collision")).action(async(t,n)=>{try{process.exitCode=await cve(t,n)}catch(i){le.handle(i,{command:"exosync quarantine resolve"}),process.exitCode=1}}),r.addCommand(e),OF(r.command("dedup-uids").description("Report duplicate exo__Asset_uid on disk (#3477); --fix re-uuids all but the first; --auto zero-loss auto-resolve (identical\u2192delete, differing\u2192re-uuid; dry-run unless --apply)").option("--fix","Assign a fresh uuid to every duplicate but the first").option("--auto","Zero-loss auto-resolve: delete identical copies, re-uuid distinct variants (DRY-RUN unless --apply). Supersedes --fix.").option("--apply","Execute the --auto plan (without it --auto is a dry-run; a deleted copy's content always survives in the kept file, and if previously synced is recoverable from the git remote)")).action(async t=>{try{process.exitCode=await uve(t)}catch(n){le.handle(n,{command:"exosync dedup-uids"}),process.exitCode=1}})}a(jG,"registerQuarantineCommands");_t();var fve=["GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_CONFIG","GIT_OBJECT_DIRECTORY","GIT_DIR","GIT_WORK_TREE","GIT_IMPLICIT_WORK_TREE","GIT_GRAFT_FILE","GIT_INDEX_FILE","GIT_NO_REPLACE_OBJECTS","GIT_REPLACE_REF_BASE","GIT_PREFIX","GIT_INTERNAL_SUPER_PREFIX","GIT_SHALLOW_FILE","GIT_COMMON_DIR"];function BG(r){let e={...r};for(let t of fve)delete e[t];return e}a(BG,"repoIsolatedGitEnv");var Mg=a(async r=>{let e=await UG.webcrypto.subtle.digest("SHA-1",r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));return[...new Uint8Array(e)].map(t=>t.toString(16).padStart(2,"0")).join("")},"nodeSha1"),dve={parse:a(r=>Hc(r,{schema:Su}),"parse"),stringify:a(r=>Wd(r,{schema:Su,lineWidth:-1}),"stringify")};function FF(r,e){if(r.tokenFromGh===!0)return Yo.resolveGhToken(e.ghTokenRunner);let t=e.env??process.env,n=r.token||t.GITHUB_TOKEN||t.GH_TOKEN||"";if(n.length===0)throw new Error("A GitHub token is required (private sync units read as 404 and push needs write scope). Use --token-from-gh, --token <pat>, or set GITHUB_TOKEN / GH_TOKEN.");return n}a(FF,"resolveToken");function sv(r){let e=a(i=>Vr.join(r,i),"abs"),t=a(async(i,s)=>{let o;try{o=await Jr.promises.readdir(i,{withFileTypes:!0})}catch{return}for(let c of o){let l=Vr.join(i,c.name);if(c.isDirectory()){if(c.name===".git")continue;await t(l,s)}else c.isFile()&&s.push(Vr.relative(r,l).split(Vr.sep).join("/"))}},"walk"),n=a(async(i,s)=>{let o=Vr.dirname(i);await Jr.promises.mkdir(o,{recursive:!0});let c=`${i}.local.tmp`;await s(c),await Jr.promises.rename(c,i)},"writeAtomic");return{async list(){let i=[];return(0,Jr.existsSync)(r)&&await t(r,i),i},read:a(i=>Jr.promises.readFile(e(i),"utf-8"),"read"),async write(i,s){await n(e(i),o=>Jr.promises.writeFile(o,s,"utf-8"))},async delete(i){await Jr.promises.rm(e(i),{force:!0})},async readBinary(i){return new Uint8Array(await Jr.promises.readFile(e(i)))},async writeBinary(i,s){let o=s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength);await n(e(i),c=>Jr.promises.writeFile(c,Buffer.from(o)))},async stat(i){try{let s=await Jr.promises.stat(e(i));return{mtimeMs:s.mtimeMs,size:s.size}}catch{return null}}}}a(sv,"nodeLocalFilesPort");function ac(r){return{async read(){try{return await Jr.promises.readFile(r,"utf-8")}catch{return null}},async writeAtomic(e){await Jr.promises.mkdir(Vr.dirname(r),{recursive:!0});let t=`${r}.local.tmp`;await Jr.promises.writeFile(t,e,"utf-8"),await Jr.promises.rename(t,r)}}}a(ac,"nodeWatermarkFileIO");function ku(r,e=".obsidian"){let t=Vr.join(r,e,"plugins","exocortex",et.MOUNT_BASE_STORE_FILENAME);return new et.FileMountBaseStore(ac(t))}a(ku,"nodeMountBaseStore");var pve=(0,GG.promisify)(VG.execFile);function hve(r){return async e=>{if(e.localPath.length===0||e.localPath.startsWith("-"))return null;try{let{stdout:t}=await pve("git",["-C",r,"submodule","status",e.localPath],{timeout:3e4,maxBuffer:4194304,env:BG(process.env)}),n=t.match(/^[ +\-U]?([0-9a-f]{40})\b/m);return n?n[1]:null}catch{return null}}}a(hve,"nodeLocalBaseShaProvider");function mve(r){return{async check(e){let t=Vr.join(r,e.localPath);if(!(0,Jr.existsSync)(t))return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} does not exist`};let n=0;try{n=(await Jr.promises.readdir(t)).length}catch{return{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is not readable`}}return n===0&&e.spaceKind!=="file"?{fullyMaterialized:!1,reason:`mount folder ${e.localPath} is empty (mid-mount?)`}:{fullyMaterialized:!0}}}}a(mve,"nodeMaterializationCheck");function gve(r,e){let t=r.pushedSha!==void 0?` \u2192@${r.pushedSha.slice(0,7)}`:"",n=(r.outboxPushedCount??0)>0?`, pushed ${r.outboxPushedCount} resolved`:"",i=(r.outboxReconflictedCount??0)>0?`, ${r.outboxReconflictedCount} re-conflicted (remote moved)`:"";e(`${r.repoKey}${t}: ${r.status} \u2014 pulled ${r.pulledCount}, pushed ${r.pushedCount}, merged ${r.mergedCount}, quarantined ${r.quarantinedCount}${(r.pushedDeletes?.length??0)>0?`, deleted ${r.pushedDeletes.length}`:""}${n}${i}`),r.detail!==void 0&&e(` ${r.detail}`);for(let s of r.warnings)e(` warn: ${s}`);(r.quarantinedPaths?.length??0)>0&&e(` quarantined (\u2192 exosync quarantine resolve): ${r.quarantinedPaths.join(", ")}`),(r.deferredPaths?.length??0)>0&&e(` deferred (\u2192 full sync): ${r.deferredPaths.join(", ")}`),(r.deferredDeletes?.length??0)>0&&e(` deferred deletes: ${r.deferredDeletes.join(", ")}`),r.timings!==void 0&&(0,et.totalMs)(r.timings)>0&&e(` ${(0,et.formatRepoTimings)(r.repoKey,r.timings)}`)}a(gve,"printRepoResult");function yve(r){return r==="conflict"||r==="full-conflict"||r==="retry-exhausted"||r==="busy"||r==="auth-required"||r==="error"}a(yve,"isFailureStatus");async function bve(r,e,t={}){let n=t.out??($=>console.log($)),i=Vr.resolve(e.vault);if(!(0,Jr.existsSync)(i))throw new Error(`Vault path does not exist: ${i}`);let s=FF(e,t),o=new Yo({token:s,...e.apiBase!==void 0?{apiBase:e.apiBase}:{}}),c=t.transportFactory?.(s,e.apiBase)??o.transport(),{specs:l,warnings:u}=Ap(i);for(let $ of u)n(`warn: ${$}`);if(l.length===0)return n("Nothing to sync \u2014 no materialized AssetSpaces with a GitHub source found in this vault."),await Lg(Dg(i,e.configDir??".obsidian"),Ng({command:"sync",vault:i,restCalls:0,quota:void 0,exitCode:2})),2;let f=e.configDir??".obsidian",d=Vr.join(i,f,"plugins","exocortex",et.WATERMARK_STORE_FILENAME),p=Vr.join(i,f,"plugins","exocortex",et.LOCAL_MANIFEST_STORE_FILENAME),h=Vr.join(i,f,"plugins","exocortex",et.CONFLICT_CACHE_STORE_FILENAME),g=new et.LocalConflictCacheStore({io:ac(h)}),m=Vr.join(i,f,"plugins","exocortex",et.OUTBOX_STORE_FILENAME),b=new et.LocalOutboxStore({io:ac(m)}),S=g,_=new et.FileWatermarkStore(ac(d)),{transport:A,cache:E}=vp(c,{...e.conditionalRequests!==void 0?{enabled:e.conditionalRequests}:{},io:Ep(Vr.join(i,f,"plugins","exocortex",et.CONDITIONAL_STORE_FILENAME))}),{transport:w,cache:R}=Tp(A,{...e.objectCache!==void 0?{enabled:e.objectCache}:{},sha1:Mg}),O=new et.SyncEngine({transport:w,watermarkStore:_,localManifestStore:new et.FileLocalManifestStore(ac(p)),mountBaseStore:ku(i,f),localBaseShaProvider:hve(i),materializationCheck:mve(i),localFilesFor:a($=>sv(Vr.join(i,$.localPath)),"localFilesFor"),sha1:Mg,redact:a($=>o.redact($),"redact"),commitMessage:a(($,k,te=0)=>`exosync: ${k} change(s)${te>0?`, ${te} deletion(s)`:""} (CLI)`,"commitMessage"),mergeLayer:new et.GatedStructuredMerger(new et.StructuredMerger(dve)),quarantine:S,outbox:b,...e.apiBase!==void 0?{baseURL:e.apiBase}:{}});n(`ExoSync ${r}: ${l.length} repo(s), vault ${i}`);let P=(0,et.orderChildrenFirst)(l),N=e.json===!0?void 0:$=>{n(`[ExoSync] ${$.repoKey}: ${(0,et.syncProgressPhaseText)($)}`)},j=await O.syncAll(P,r,N),U=(0,et.aggregateTimings)(j);if(e.json===!0)n(JSON.stringify(j,null,2));else{for(let K of j)gve(K,n);let $=j.reduce((K,he)=>({pulled:K.pulled+he.pulledCount,pushed:K.pushed+he.pushedCount,merged:K.merged+he.mergedCount,quarantined:K.quarantined+he.quarantinedCount}),{pulled:0,pushed:0,merged:0,quarantined:0}),k=await _.getAll(),te=0;for(let K of l)te+=k[K.repoKey]?.pinnedPaths?.length??0;let Z=te>0?`, pinned ${te} (incl. conflicts; see \`exosync quarantine list\`)`:"";n(`Summary: ${j.length} repo(s) \u2014 pulled ${$.pulled}, pushed ${$.pushed}, merged ${$.merged}, quarantined ${$.quarantined}${Z}`),(0,et.totalMs)(U)>0&&n((0,et.formatTimingsLine)(U));let re=R?.stats();re!==void 0&&re.hits+re.stores>0&&n(`[ExoSync objects] ${re.hits} served from cache, ${re.misses} fetched, ${re.stores} stored${re.evictions>0?`, ${re.evictions} evicted`:""}`);let V=E?.stats();V!==void 0&&V.conditional+V.stored>0&&n(`[ExoSync conditional] ${V.notModified} not modified (304 \u2014 primary quota not spent) of ${V.conditional} validated, ${V.stored} validator(s) stored`),n(`[ExoSync quota] ${U.counts.restCalls} REST | ${(0,et.formatQuota)(U.quota)}`)}let G=j.some($=>yve($.status))?1:0;return await Lg(Dg(i,f),Ng({command:"sync",vault:i,restCalls:U.counts.restCalls,quota:U.quota,exitCode:G})),G}a(bve,"runExosyncSync");function DF(r){return r.requiredOption("--vault <path>","Vault root path").option("--config-dir <name>","Obsidian config dir name (watermark location)",".obsidian").option("--token <pat>","GitHub PAT (or env GITHUB_TOKEN / GH_TOKEN). Prefer --token-from-gh.").option("--token-from-gh","Resolve the PAT via `gh auth token`").option("--json","Print the full per-repo result array as JSON").option("--api-base <url>","GitHub API base (testing)").option("--no-conditional-requests","Do not send If-None-Match on Git Data reads (a 304 costs no primary quota)").option("--no-object-cache","Do not serve immutable git objects (commits/trees/blobs) from the local cache")}a(DF,"withSyncOptions");function LF(r){return async e=>{try{process.exitCode=await bve(r,e)}catch(t){le.handle(t,{command:`exosync ${r}`}),process.exitCode=1}}}a(LF,"makeDirectionAction");function qG(){let r=new de("exosync").description("ExoSync over the GitHub REST API: sync/pull/push the materialized AssetSpace set (CLI parity with the plugin; RFC 4e4dc453 Phase B). Read-only divergence check: `exosync-parity`.");return DF(r.command("sync").description("Full pull\u2192merge\u2192push cycle for every materialized repo")).action(LF("sync")),DF(r.command("pull").description("Apply remote changes only (nothing leaves the device; local changes re-derive)")).action(LF("pull")),DF(r.command("push").description("Send the local delta only (remote changes are pinned to re-derive on the next pull/sync)")).action(LF("push")),jG(r),r}a(qG,"exosyncCommand");var _ve=a(r=>{process.stderr.write(`${r}
682
+ `)},"DEFAULT_LOG"),ov=class{static{a(this,"HeadlessConfirmGate")}constructor(e){this.yes=e.yes,this.verbose=e.verbose??!1,this.log=e.log??_ve}async confirmApply(e){if(this.verbose){let t=Array.from(e.filesToDestroy.values()).reduce((n,i)=>n+i.length,0);if(this.log(`[apply-profile] Target: ${e.targetProfileLabel} (${e.targetProfileUid})`),this.log(`[apply-profile] Source: ${e.sourceProfileLabel}`),this.log(`[apply-profile] ${t} files to remove, ${e.assetSpacesBeingTornDown.length} AS to tear down, ${e.assetSpacesBeingMaterialized.length} AS to materialize`),e.assetSpacesBeingParked.length>0){let n=e.assetSpacesBeingParked.reduce((i,s)=>i+s.fileCount,0);this.log(`[apply-profile] ${n} files to park (moved to .exocortex/parked, NOT removed), ${e.assetSpacesBeingParked.length} AS to park`)}e.assetSpacesBeingUnparked.length>0&&this.log(`[apply-profile] ${e.assetSpacesBeingUnparked.length} AS to unpark (restored from .exocortex/parked, no download)`)}return this.yes?!0:(this.log("[apply-profile] Refused: --yes flag required for headless mode (Decision #2 safety)."),!1)}};_t();Nt();ir();async function Sve(r,e,t={}){let n=[],i=[],s=t.out??(R=>process.stdout.write(`${R}
683
683
  `)),o=t.err??(R=>process.stderr.write(`${R}
684
- `)),c=a(R=>{n.push(R),s(R)},"out"),l=a(R=>{i.push(R),o(R)},"err");if(!e.vault)throw new Qe("--vault is required");let u=(0,zG.resolve)(e.vault);if(!(0,WG.existsSync)(u))throw new Fe(u);if(!r||r.length===0)throw new Qe("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new GE({vaultPath:u,warn:a(R=>l(R),"warn")})).resolveFilter(r);if(d.outcome==="missing-profile")throw new Qe(`Profile not found: ${r}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:n,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:n,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:n,stderr:i};let p=d.result,h=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,g=t.applyServiceFactory?.(e,u)??new wp({vaultPath:u,ref:e.ref??"main",mount:new ji({token:h,mountBaseStore:ku(u)})}),{infos:m,profileLabels:b}=g.scanVault(),S=b.get(r)??r,_;try{_=g.buildDiff({targetProfileUid:r,targetProfileLabel:S,sourceProfileUid:null,sourceProfileLabel:"<unknown>",result:p,infos:m})}catch(R){if(R instanceof Ur.TsFloorViolationError)return l(`[apply-profile] Refused: ${R.message}`),{exitCode:5,stdout:n,stderr:i};throw R}if(!await(t.confirmGate??new ov({yes:e.yes??!1,verbose:e.verbose??!1,log:a(R=>l(R),"log")})).confirmApply(_.plan))return{exitCode:0,stdout:n,stderr:i};if(_.toDestroy.length===0&&_.toMaterialize.length===0)return c(`[apply-profile] Already in target mount-state for ${S} \u2014 no-op.`),{exitCode:0,stdout:n,stderr:i};let w;try{w=await g.execute(_)}catch(R){return l(`[apply-profile] Execution failed: ${R instanceof Error?R.message:String(R)}`),{exitCode:5,stdout:n,stderr:i}}return c(`[apply-profile] Switched to ${S}: ${w.destroyed.length} AssetSpace(s) torn down, ${w.materialized.length} materialized.`),{exitCode:0,stdout:n,stderr:i}}a(_ve,"runApplyProfile");function KG(){return new de("apply-profile").description("Apply the specified Profile (mount-state filesystem mutation). Requires --yes for headless mode.").argument("<profile-uid>","Target Profile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm apply (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).option("--ref <branch>","Git ref to pull when materialising AssetSpaces","main").option("--token <pat>","GitHub PAT for private-repo materialisation (or env GITHUB_TOKEN / GH_TOKEN)").action(async(e,t)=>{try{let n=await _ve(e,t);process.exit(n.exitCode)}catch(n){le.handle(n)}})}a(KG,"applyProfileCommand");ut();var Ip=require("node:path"),Mu=require("node:fs"),HG=Q(Pe());_t();Nt();function YG(){return new de("bootstrap").description("Bootstrap a vault with the SDK floor AssetSpace (exo). Pulls a tarball from a public GitHub repo, extracts \u043A assetspaces/, writes .gitmodules. Only --exo is required \u2014 bootstrap installs only the SDK platform. exocmd (the optional UI-command library) and any other AssetSpace are added afterwards via `exocortex assetspace add`. Example URL: https://github.com/kitelev/exoas-exo.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--exo <url>","Public GitHub URL \u0434\u043B\u044F exo TBox AssetSpace (e.g. https://github.com/kitelev/exoas-exo)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new Qe("--vault is required");let e=(0,Ip.resolve)(r.vault);(0,Mu.mkdirSync)(e,{recursive:!0});let t=(0,Ip.join)(e,".gitmodules"),n=(0,Ip.join)(e,"assetspaces");if((0,Mu.existsSync)(t))throw new Qe(`Vault ${e} already has .gitmodules \u2014 refusing \u043A re-bootstrap. Use \`assetspace add\` \u0434\u043B\u044F individual AS.`);if((0,Mu.existsSync)(n)&&(0,Mu.readdirSync)(n).length>0)throw new Qe(`Vault ${e}/assetspaces/ already has content \u2014 refusing \u043A re-bootstrap.`);let i=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,s=new ji({token:i,mountBaseStore:ku(e)}),o=r.ref??"main",c=[],l=(0,HG.derivePath)(r.exo)??"assetspaces/exo",u=(0,Ip.join)(e,l);process.stderr.write(`[bootstrap] Pulling ${r.exo}@${o} \u2192 ${l}/...
684
+ `)),c=a(R=>{n.push(R),s(R)},"out"),l=a(R=>{i.push(R),o(R)},"err");if(!e.vault)throw new Qe("--vault is required");let u=(0,zG.resolve)(e.vault);if(!(0,WG.existsSync)(u))throw new Fe(u);if(!r||r.length===0)throw new Qe("profile-uid argument is required","exocortex apply-profile <profile-uid> --vault <path>");let d=await(t.resolverFactory?.(e)??new GE({vaultPath:u,warn:a(R=>l(R),"warn")})).resolveFilter(r);if(d.outcome==="missing-profile")throw new Qe(`Profile not found: ${r}`,"Run `exocortex find --class exo__Profile` to list available profiles");if(d.outcome==="error")return l(`[apply-profile] Resolver error: ${d.reason}`),{exitCode:5,stdout:n,stderr:i};if(d.outcome==="degraded")return l(`[apply-profile] Refused: profile resolution degraded \u2014 ${d.reason}. Apply aborted to prevent vault corruption.`),{exitCode:5,stdout:n,stderr:i};if(d.outcome!=="engaged")return l(`[apply-profile] Unexpected resolver outcome: ${d.outcome}`),{exitCode:5,stdout:n,stderr:i};let p=d.result,h=e.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,g=t.applyServiceFactory?.(e,u)??new wp({vaultPath:u,ref:e.ref??"main",mount:new ji({token:h,mountBaseStore:ku(u)})}),{infos:m,profileLabels:b}=g.scanVault(),S=b.get(r)??r,_;try{_=g.buildDiff({targetProfileUid:r,targetProfileLabel:S,sourceProfileUid:null,sourceProfileLabel:"<unknown>",result:p,infos:m})}catch(R){if(R instanceof Ur.TsFloorViolationError)return l(`[apply-profile] Refused: ${R.message}`),{exitCode:5,stdout:n,stderr:i};throw R}if(!await(t.confirmGate??new ov({yes:e.yes??!1,verbose:e.verbose??!1,log:a(R=>l(R),"log")})).confirmApply(_.plan))return{exitCode:0,stdout:n,stderr:i};if(_.toDestroy.length===0&&_.toMaterialize.length===0)return c(`[apply-profile] Already in target mount-state for ${S} \u2014 no-op.`),{exitCode:0,stdout:n,stderr:i};let w;try{w=await g.execute(_)}catch(R){return l(`[apply-profile] Execution failed: ${R instanceof Error?R.message:String(R)}`),{exitCode:5,stdout:n,stderr:i}}return c(`[apply-profile] Switched to ${S}: ${w.destroyed.length} AssetSpace(s) torn down, ${w.materialized.length} materialized.`),{exitCode:0,stdout:n,stderr:i}}a(Sve,"runApplyProfile");function KG(){return new de("apply-profile").description("Apply the specified Profile (mount-state filesystem mutation). Requires --yes for headless mode.").argument("<profile-uid>","Target Profile UID").requiredOption("--vault <path>","Path to Obsidian vault").option("--yes","Confirm apply (headless mode safety override per RFC 22b50a17 Decision #2)",!1).option("--verbose","Print plan summary to stderr before deciding",!1).option("--ref <branch>","Git ref to pull when materialising AssetSpaces","main").option("--token <pat>","GitHub PAT for private-repo materialisation (or env GITHUB_TOKEN / GH_TOKEN)").action(async(e,t)=>{try{let n=await Sve(e,t);process.exit(n.exitCode)}catch(n){le.handle(n)}})}a(KG,"applyProfileCommand");ut();var Ip=require("node:path"),Mu=require("node:fs"),HG=Q(Pe());_t();Nt();function YG(){return new de("bootstrap").description("Bootstrap a vault with the SDK floor AssetSpace (exo). Pulls a tarball from a public GitHub repo, extracts \u043A assetspaces/, writes .gitmodules. Only --exo is required \u2014 bootstrap installs only the SDK platform. exocmd (the optional UI-command library) and any other AssetSpace are added afterwards via `exocortex assetspace add`. Example URL: https://github.com/kitelev/exoas-exo.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--exo <url>","Public GitHub URL \u0434\u043B\u044F exo TBox AssetSpace (e.g. https://github.com/kitelev/exoas-exo)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new Qe("--vault is required");let e=(0,Ip.resolve)(r.vault);(0,Mu.mkdirSync)(e,{recursive:!0});let t=(0,Ip.join)(e,".gitmodules"),n=(0,Ip.join)(e,"assetspaces");if((0,Mu.existsSync)(t))throw new Qe(`Vault ${e} already has .gitmodules \u2014 refusing \u043A re-bootstrap. Use \`assetspace add\` \u0434\u043B\u044F individual AS.`);if((0,Mu.existsSync)(n)&&(0,Mu.readdirSync)(n).length>0)throw new Qe(`Vault ${e}/assetspaces/ already has content \u2014 refusing \u043A re-bootstrap.`);let i=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,s=new ji({token:i,mountBaseStore:ku(e)}),o=r.ref??"main",c=[],l=(0,HG.derivePath)(r.exo)??"assetspaces/exo",u=(0,Ip.join)(e,l);process.stderr.write(`[bootstrap] Pulling ${r.exo}@${o} \u2192 ${l}/...
685
685
  `);let f=await s.pullAssetSpace(r.exo,o,u);if(s.ensureGitmodulesEntry(e,l,r.exo),c.push({folder:l,url:r.exo,sha:f.sha,fileCount:f.fileCount}),r.json)process.stdout.write(JSON.stringify({vault:e,materialized:c},null,2)+`
686
686
  `);else{process.stdout.write(`
687
687
  \u2713 Bootstrap complete
@@ -693,7 +693,7 @@ Next steps:
693
693
  `),process.stdout.write(` 2. git add . && git commit -m "feat: bootstrap vault"
694
694
  `),process.stdout.write(` 3. (optional) Add the exocmd UI-command library: \`exocortex assetspace add --vault ${e} --url https://github.com/kitelev/exoas-exocmd\`
695
695
  `),process.stdout.write(` 4. Add additional AssetSpaces via \`exocortex assetspace add --vault ${e} --url <github-url>\`
696
- `)}process.exit(0)}catch(e){le.handle(e)}})}a(YG,"bootstrapCommand");ut();var av=require("node:path"),XG=require("node:fs"),QG=Q(Pe());_t();Nt();function Sve(r,e){return e!==void 0&&e.length>0?`assetspaces/${e}`:(0,QG.derivePath)(r)??`assetspaces/${ji.deriveFolderName(r)}`}a(Sve,"resolveAddAssetSpacePath");function JG(){return new de("assetspace-add").description("Phase 6.3: add single AssetSpace \u043A existing vault by public GitHub URL. Pulls tarball, extracts \u043A assetspaces/<folder>/, updates .gitmodules.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--url <url>","Public GitHub URL \u0434\u043B\u044F the AssetSpace (e.g. https://github.com/kitelev/exoas-pmbok-ontology)").option("--folder <name>","Local folder name \u043F\u043E\u0434 assetspaces/. Defaults \u043A URL-derived (strips exoas- prefix)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new Qe("--vault is required");if(!r.url)throw new Qe("--url is required");let e=(0,av.resolve)(r.vault);if(!(0,XG.existsSync)(e))throw new Fe(e);let t=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,n=new ji({token:t,mountBaseStore:ku(e)}),i=r.ref??"main",s=Sve(r.url,r.folder),o=(0,av.join)(e,s);process.stderr.write(`[assetspace-add] Pulling ${r.url}@${i} \u2192 ${s}/...
696
+ `)}process.exit(0)}catch(e){le.handle(e)}})}a(YG,"bootstrapCommand");ut();var av=require("node:path"),XG=require("node:fs"),QG=Q(Pe());_t();Nt();function wve(r,e){return e!==void 0&&e.length>0?`assetspaces/${e}`:(0,QG.derivePath)(r)??`assetspaces/${ji.deriveFolderName(r)}`}a(wve,"resolveAddAssetSpacePath");function JG(){return new de("assetspace-add").description("Phase 6.3: add single AssetSpace \u043A existing vault by public GitHub URL. Pulls tarball, extracts \u043A assetspaces/<folder>/, updates .gitmodules.").requiredOption("--vault <path>","Path \u043A target vault").requiredOption("--url <url>","Public GitHub URL \u0434\u043B\u044F the AssetSpace (e.g. https://github.com/kitelev/exoas-pmbok-ontology)").option("--folder <name>","Local folder name \u043F\u043E\u0434 assetspaces/. Defaults \u043A URL-derived (strips exoas- prefix)").option("--ref <branch>","Branch ref \u043A pull from","main").option("--token <pat>","GitHub PAT for private repos (or env GITHUB_TOKEN / GH_TOKEN). Optional \u2014 anonymous for public repos.").option("--json","Emit result as JSON",!1).action(async r=>{try{if(!r.vault)throw new Qe("--vault is required");if(!r.url)throw new Qe("--url is required");let e=(0,av.resolve)(r.vault);if(!(0,XG.existsSync)(e))throw new Fe(e);let t=r.token||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,n=new ji({token:t,mountBaseStore:ku(e)}),i=r.ref??"main",s=wve(r.url,r.folder),o=(0,av.join)(e,s);process.stderr.write(`[assetspace-add] Pulling ${r.url}@${i} \u2192 ${s}/...
697
697
  `);let c=await n.pullAssetSpace(r.url,i,o),l=n.ensureGitmodulesEntry(e,s,r.url);r.json?process.stdout.write(JSON.stringify({vault:e,folder:s,url:r.url,sha:c.sha,fileCount:c.fileCount,gitmodulesEntryAdded:l.added},null,2)+`
698
698
  `):(process.stdout.write(`
699
699
  \u2713 AssetSpace added
@@ -701,17 +701,17 @@ Next steps:
701
701
  `),process.stdout.write(` URL: ${r.url}
702
702
  `),process.stdout.write(` SHA: ${c.sha} (${c.fileCount} files)
703
703
  `),process.stdout.write(` .gitmodules: ${l.added?"entry added":"entry already present"}
704
- `)),process.exit(0)}catch(e){le.handle(e)}})}a(JG,"assetSpaceAddCommand");ut();var cv=require("node:path"),NF=require("node:fs"),Rp=Q(Pe());_t();Nt();ir();function wve(r){if(r.folder!==void 0&&r.folder.length>0)return r.folder.startsWith("assetspaces/")?r.folder:`assetspaces/${r.folder}`;if(r.url!==void 0&&r.url.length>0)return(0,Rp.derivePath)(r.url)??`assetspaces/${ji.deriveFolderName(r.url)}`;throw new Qe("either --folder or --url is required","exocortex assetspace-remove --vault <path> (--folder <mount-path> | --url <url>)")}a(wve,"resolveRemoveAssetSpacePath");async function Eve(r,e={}){let t=[],n=[],i=a(h=>{t.push(h),(e.out??(g=>process.stdout.write(`${g}
704
+ `)),process.exit(0)}catch(e){le.handle(e)}})}a(JG,"assetSpaceAddCommand");ut();var cv=require("node:path"),NF=require("node:fs"),Rp=Q(Pe());_t();Nt();ir();function Eve(r){if(r.folder!==void 0&&r.folder.length>0)return r.folder.startsWith("assetspaces/")?r.folder:`assetspaces/${r.folder}`;if(r.url!==void 0&&r.url.length>0)return(0,Rp.derivePath)(r.url)??`assetspaces/${ji.deriveFolderName(r.url)}`;throw new Qe("either --folder or --url is required","exocortex assetspace-remove --vault <path> (--folder <mount-path> | --url <url>)")}a(Eve,"resolveRemoveAssetSpacePath");async function vve(r,e={}){let t=[],n=[],i=a(h=>{t.push(h),(e.out??(g=>process.stdout.write(`${g}
705
705
  `)))(h)},"out"),s=a(h=>{n.push(h),(e.err??(g=>process.stderr.write(`${g}
706
- `)))(h)},"err");if(!r.vault)throw new Qe("--vault is required");let o=(0,cv.resolve)(r.vault);if(!(0,NF.existsSync)(o))throw new Fe(o);let c=wve(r),u=(e.scanInfos?.(o)??new wp({vaultPath:o}).scanVault().infos).find(h=>h.folderName===c);if(u!==void 0&&(0,Rp.isTsFloorAssetSpace)(u.uid,u.namespace)||(0,Rp.isTsFloorMountPath)(c)){let h=u?.label??c,g=u?`${u.namespace||u.uid}`:"path resolves to a floor namespace";return s(`[assetspace-remove] Refused: \xAB${h}\xBB (${g}) is a TS-floor AssetSpace \u2014 unmounting it would self-brick the runtime (R24). Aborted, no changes made.`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}let d=(0,NF.existsSync)((0,cv.join)(o,c)),p=e.unmount??((h,g)=>new ji().unmountAssetSpace(h,g));try{p(o,c)}catch(h){return s(`[assetspace-remove] Unmount failed: ${h instanceof Error?h.message:String(h)}`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}return r.json?i(JSON.stringify({vault:o,folder:c,existedBefore:d,unmounted:!0},null,2)):d?(i(`
706
+ `)))(h)},"err");if(!r.vault)throw new Qe("--vault is required");let o=(0,cv.resolve)(r.vault);if(!(0,NF.existsSync)(o))throw new Fe(o);let c=Eve(r),u=(e.scanInfos?.(o)??new wp({vaultPath:o}).scanVault().infos).find(h=>h.folderName===c);if(u!==void 0&&(0,Rp.isTsFloorAssetSpace)(u.uid,u.namespace)||(0,Rp.isTsFloorMountPath)(c)){let h=u?.label??c,g=u?`${u.namespace||u.uid}`:"path resolves to a floor namespace";return s(`[assetspace-remove] Refused: \xAB${h}\xBB (${g}) is a TS-floor AssetSpace \u2014 unmounting it would self-brick the runtime (R24). Aborted, no changes made.`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}let d=(0,NF.existsSync)((0,cv.join)(o,c)),p=e.unmount??((h,g)=>new ji().unmountAssetSpace(h,g));try{p(o,c)}catch(h){return s(`[assetspace-remove] Unmount failed: ${h instanceof Error?h.message:String(h)}`),{exitCode:5,stdout:t,stderr:n,removed:!1,folder:c}}return r.json?i(JSON.stringify({vault:o,folder:c,existedBefore:d,unmounted:!0},null,2)):d?(i(`
707
707
  \u2713 AssetSpace unmounted`),i(` Folder: ${c} (removed from vault + .gitmodules)`)):(i(`
708
- \u2713 AssetSpace already absent \u2014 .gitmodules stanza stripped (no-op)`),i(` Folder: ${c}`)),{exitCode:0,stdout:t,stderr:n,removed:!0,folder:c}}a(Eve,"runAssetSpaceRemove");function ZG(){return new de("assetspace-remove").description("Unmount a single AssetSpace (inverse of assetspace-add). Strips its .gitmodules stanza and deletes the mount folder. TS-floor AssetSpaces ({exo}) are refused.").requiredOption("--vault <path>","Path to target vault").option("--folder <path>","Vault-relative mount path to unmount (e.g. assetspaces/kitelev/exoas-pmbok-ontology). Takes precedence over --url.").option("--url <url>","Public GitHub URL of the AssetSpace \u2014 derives the canonical mount path (parity with assetspace-add).").option("--json","Emit result as JSON",!1).action(async r=>{try{let e=await Eve(r);process.exit(e.exitCode)}catch(e){le.handle(e)}})}a(ZG,"assetSpaceRemoveCommand");ut();var eq=require("node:path"),tq=require("node:fs");_t();Nt();async function vve(r,e={}){let t=e.out??(l=>process.stdout.write(`${l}
708
+ \u2713 AssetSpace already absent \u2014 .gitmodules stanza stripped (no-op)`),i(` Folder: ${c}`)),{exitCode:0,stdout:t,stderr:n,removed:!0,folder:c}}a(vve,"runAssetSpaceRemove");function ZG(){return new de("assetspace-remove").description("Unmount a single AssetSpace (inverse of assetspace-add). Strips its .gitmodules stanza and deletes the mount folder. TS-floor AssetSpaces ({exo}) are refused.").requiredOption("--vault <path>","Path to target vault").option("--folder <path>","Vault-relative mount path to unmount (e.g. assetspaces/kitelev/exoas-pmbok-ontology). Takes precedence over --url.").option("--url <url>","Public GitHub URL of the AssetSpace \u2014 derives the canonical mount path (parity with assetspace-add).").option("--json","Emit result as JSON",!1).action(async r=>{try{let e=await vve(r);process.exit(e.exitCode)}catch(e){le.handle(e)}})}a(ZG,"assetSpaceRemoveCommand");ut();var eq=require("node:path"),tq=require("node:fs");_t();Nt();async function Tve(r,e={}){let t=e.out??(l=>process.stdout.write(`${l}
709
709
  `)),n=e.err??(l=>process.stderr.write(`${l}
710
- `));if(!r.registry)throw new Qe("--registry <path> is required");if(!r.self)throw new Qe("--self <owner/repo | git-url | namespace> is required");let i=(0,eq.resolve)(r.registry);if(!(0,tq.existsSync)(i))throw new Qe(`Registry path does not exist: ${i}`,"Clone kitelev/exoas-registry first, then pass --registry <path>");let o=await new zE({warn:a(l=>n(l),"warn")}).resolve(i,r.self),c=r.format??"urls";if(o.outcome==="self-not-found"){let l=`[resolve-deps] self '${r.self}' not found among ${o.descriptorCount} registry descriptor(s) \u2014 validating standalone (no dependencies to materialise).`;return r.strict?(n(`[resolve-deps] STRICT: self '${r.self}' not registered. Add an exo__AssetSpace descriptor to kitelev/exoas-registry.`),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:2,outcome:o}):(n(l),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:0,outcome:o})}if(o.missingDescriptors.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.missingDescriptors.length} dangling dependsOn edge(s) (no descriptor in registry): `+o.missingDescriptors.join(", ")),o.sourceless.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.sourceless.length} dependency descriptor(s) have no source URL (cannot clone): `+o.sourceless.map(l=>l.namespace??l.uid).join(", ")),o.unsafeSources.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.unsafeSources.length} dependency source(s) rejected as unsafe git-clone targets (option/transport injection) \u2014 NOT emitted: `+o.unsafeSources.map(l=>`${l.namespace??l.uid}=${l.source}`).join(", ")),c==="json")t(JSON.stringify(o,null,2));else{let l=new Set(o.unsafeSources.map(u=>u.uid));for(let u of o.dependencies)u.source&&u.source.length>0&&!l.has(u.uid)&&t(u.source)}return{exitCode:0,outcome:o}}a(vve,"runResolveDeps");function rq(){return new de("resolve-deps").description("Resolve an AssetSpace repo's transitive dependsOn closure from the central registry and print dependency clone URLs (issue #3513). Used by the per-AssetSpace SHACL CI gate to materialise dependent TBox.").requiredOption("--registry <path>","Path to a checked-out central registry (kitelev/exoas-registry)").requiredOption("--self <id>","Identity of the calling repo: an owner/repo slug (e.g. kitelev/exoas-exo, matches GitHub's github.repository), a full git URL, or a bare namespace").option("--format <type>","Output format: urls (one clone URL per line) | json (full diagnostics)","urls").option("--strict","Exit non-zero (2) when self is not registered, instead of validating standalone",!1).action(async r=>{try{let{exitCode:e}=await vve(r);process.exit(e)}catch(e){le.handle(e)}})}a(rq,"resolveDepsCommand");ut();function nq(){let r=new de("cache").description("SPARQL query-result cache maintenance (clear / stats). For read-after-write, prefer `query --no-cache` or a short `--cache-ttl`.");return r.addCommand(Tve()),r.addCommand(Ave()),r}a(nq,"cacheCommand");function Tve(){return new de("clear").description("Remove all cached SPARQL query results from disk").option("--output <format>","Output format: text | json","text").action(async r=>{let e=new Qa,t=await e.getCacheStats();if(await e.clear(),r.output==="json"){console.log(JSON.stringify({success:!0,data:{action:"clear",cacheDir:e.getCacheDir(),clearedEntries:t.entryCount,freedBytes:t.totalSizeBytes}}));return}console.log(`\u{1F5D1}\uFE0F Cleared ${t.entryCount} cached query result(s) (${iq(t.totalSizeBytes)} freed) from ${e.getCacheDir()}`)})}a(Tve,"cacheClearCommand");function Ave(){return new de("stats").description("Show query-result cache entry count and total size").option("--output <format>","Output format: text | json","text").action(async r=>{let e=new Qa,t=await e.getCacheStats();if(r.output==="json"){console.log(JSON.stringify({success:!0,data:{cacheDir:e.getCacheDir(),entryCount:t.entryCount,totalSizeBytes:t.totalSizeBytes}}));return}console.log(`\u{1F4CA} SPARQL query-result cache: ${e.getCacheDir()}`),console.log(` Entries: ${t.entryCount.toLocaleString()}`),console.log(` Size: ${iq(t.totalSizeBytes)}`)})}a(Ave,"cacheStatsCommand");function iq(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}a(iq,"formatBytes");ut();var mq=require("readline");function sq(r){let e=r.aliases;if(e!==void 0&&(!Array.isArray(e)||e.some(n=>typeof n!="string")))return"`aliases` must be an array of strings";if(r.body!==void 0&&typeof r.body!="string")return"`body` must be a string";if(r.status!==void 0&&typeof r.status!="string"&&r.status!==!1)return"`status` must be a status name or false";let t=r.properties;if(t!==void 0){if(typeof t!="object"||t===null||Array.isArray(t))return"`properties` must be an object";for(let[n,i]of Object.entries(t))if((Array.isArray(i)?i:[i]).some(o=>typeof o!="string"))return`property \`${n}\` must be a string or an array of strings`}return null}a(sq,"invalidCreateAssetShape");function oq(r){let e=["create","--vault",r.vault,"--class",r.class,"--label",r.label];for(let t of r.aliases??[])e.push("--aliases",t);for(let[t,n]of Object.entries(r.properties??{})){let i=Array.isArray(n)?n:[n];for(let s of i)e.push("--property",`${t}=${s}`)}return r.body!==void 0&&e.push("--body",r.body),r.status===!1?e.push("--no-status"):typeof r.status=="string"&&e.push("--status",r.status),r.validate!==!1&&e.push("--validate"),r.dryRun&&e.push("--dry-run"),e}a(oq,"buildCreateAssetArgs");function aq(r){let e=["apply",r.command,r.target,"--vault",r.vault,"--json","--yes"];return r.input!==void 0&&e.push("--input",JSON.stringify(r.input)),r.dryRun&&e.push("--dry-run"),e}a(aq,"buildCreateEffortArgs");var Ive={oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},cq=[{name:"create_asset",description:"Create a vault asset through the Exocortex creation pipeline (co-location by exo__Asset_isDefinedBy, dangling-wikilink rejection, unknown-property-name rejection and \u2014 by default \u2014 SHACL-lite conformance validation before the file is written). Values are passed as an argument vector, so labels, bodies and property values containing $, backticks, quotes, parentheses or newlines are preserved byte-identically.",inputSchema:{type:"object",properties:{vault:{type:"string",description:"Path to the Obsidian vault."},class:{type:"string",description:"Class UUID or short name (e.g. ems__Task)."},label:{type:"string",description:"exo__Asset_label for the new asset."},properties:{type:"object",description:"Frontmatter properties. A string sets one value; an array of strings sets a multi-value (YAML array) property.",additionalProperties:Ive},aliases:{type:"array",items:{type:"string"},description:"Additional aliases."},body:{type:"string",description:"Markdown body of the asset."},status:{type:["string","boolean"],description:"ems__Effort_status name for a status-bearing class (e.g. Backlog, Doing). Pass false to create a status-less asset. Omit for the CLI default."},validate:{type:"boolean",default:!0,description:"Run the pre-write SHACL-lite conformance gate. Defaults to true; pass false to skip it."},dryRun:{type:"boolean",description:"Preview without writing the file."}},required:["vault","class","label"],additionalProperties:!1}},{name:"create_effort",description:"Create an effort (Task / Project / Area / \u2026) by applying a homoiconic Exocortex command to a target asset \u2014 the canonical effort-creation path. Returns the {command,target,created:[{uuid,path,label}]} envelope.",inputSchema:{type:"object",properties:{vault:{type:"string",description:"Path to the Obsidian vault."},command:{type:"string",description:"Command cliName slug (e.g. create-task) or command UUID."},target:{type:"string",description:"Vault-relative path to the target asset the command is applied to."},input:{type:"object",description:`userInput for the command's grounding (serialised as JSON), e.g. {"value":"New label"}.`},dryRun:{type:"boolean",description:"Preview without writing."}},required:["vault","command","target"],additionalProperties:!1}}];var Rve="2024-11-05",fq=-32700,lq=-32600,Cve=-32601,dq=-32603;function Cp(r,e=!1){return e?{content:[{type:"text",text:r}],isError:!0}:{content:[{type:"text",text:r}]}}a(Cp,"textResult");function Ove(r){let e=r.split(`
711
- `).map(n=>n.trim()).filter(n=>n.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(Ove,"parseLastJsonLine");function uq(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(uq,"missingStringFields");var lv=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:lq,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,n=t===void 0;if(typeof e.method!="string")return n?null:{jsonrpc:"2.0",id:t??null,error:{code:lq,message:"Invalid request: missing method"}};if(n)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:Rve,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:cq}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Cve,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=uq(n,["vault","class","label"]);if(c.length>0)return Cp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=sq(n);if(l!==null)return Cp(`create_asset: ${l}`,!0);i=oq(n)}else if(t==="create_effort"){let c=uq(n,["vault","command","target"]);if(c.length>0)return Cp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=aq(n)}else return Cp(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let c=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return Cp(`exocortex-cli exited ${s.exitCode}
712
- ${c}`,!0)}let o=Ove(s.stdout);return Cp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var pq=require("child_process");var xve=32*1024*1024;function hq(r){return e=>new Promise(t=>{(0,pq.execFile)(process.execPath,[r,...e],{maxBuffer:xve},(n,i,s)=>{let o=0;if(n){let c=n.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(hq,"createSelfCliRunner");async function Pve(r,e,t){let n=(0,mq.createInterface)({input:e,crlfDelay:1/0});for await(let i of n){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:fq,message:"Parse error: invalid JSON"}})+`
710
+ `));if(!r.registry)throw new Qe("--registry <path> is required");if(!r.self)throw new Qe("--self <owner/repo | git-url | namespace> is required");let i=(0,eq.resolve)(r.registry);if(!(0,tq.existsSync)(i))throw new Qe(`Registry path does not exist: ${i}`,"Clone kitelev/exoas-registry first, then pass --registry <path>");let o=await new zE({warn:a(l=>n(l),"warn")}).resolve(i,r.self),c=r.format??"urls";if(o.outcome==="self-not-found"){let l=`[resolve-deps] self '${r.self}' not found among ${o.descriptorCount} registry descriptor(s) \u2014 validating standalone (no dependencies to materialise).`;return r.strict?(n(`[resolve-deps] STRICT: self '${r.self}' not registered. Add an exo__AssetSpace descriptor to kitelev/exoas-registry.`),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:2,outcome:o}):(n(l),c==="json"&&t(JSON.stringify(o,null,2)),{exitCode:0,outcome:o})}if(o.missingDescriptors.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.missingDescriptors.length} dangling dependsOn edge(s) (no descriptor in registry): `+o.missingDescriptors.join(", ")),o.sourceless.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.sourceless.length} dependency descriptor(s) have no source URL (cannot clone): `+o.sourceless.map(l=>l.namespace??l.uid).join(", ")),o.unsafeSources.length>0&&n(`[resolve-deps] \u26A0\uFE0F ${o.unsafeSources.length} dependency source(s) rejected as unsafe git-clone targets (option/transport injection) \u2014 NOT emitted: `+o.unsafeSources.map(l=>`${l.namespace??l.uid}=${l.source}`).join(", ")),c==="json")t(JSON.stringify(o,null,2));else{let l=new Set(o.unsafeSources.map(u=>u.uid));for(let u of o.dependencies)u.source&&u.source.length>0&&!l.has(u.uid)&&t(u.source)}return{exitCode:0,outcome:o}}a(Tve,"runResolveDeps");function rq(){return new de("resolve-deps").description("Resolve an AssetSpace repo's transitive dependsOn closure from the central registry and print dependency clone URLs (issue #3513). Used by the per-AssetSpace SHACL CI gate to materialise dependent TBox.").requiredOption("--registry <path>","Path to a checked-out central registry (kitelev/exoas-registry)").requiredOption("--self <id>","Identity of the calling repo: an owner/repo slug (e.g. kitelev/exoas-exo, matches GitHub's github.repository), a full git URL, or a bare namespace").option("--format <type>","Output format: urls (one clone URL per line) | json (full diagnostics)","urls").option("--strict","Exit non-zero (2) when self is not registered, instead of validating standalone",!1).action(async r=>{try{let{exitCode:e}=await Tve(r);process.exit(e)}catch(e){le.handle(e)}})}a(rq,"resolveDepsCommand");ut();function nq(){let r=new de("cache").description("SPARQL query-result cache maintenance (clear / stats). For read-after-write, prefer `query --no-cache` or a short `--cache-ttl`.");return r.addCommand(Ave()),r.addCommand(Ive()),r}a(nq,"cacheCommand");function Ave(){return new de("clear").description("Remove all cached SPARQL query results from disk").option("--output <format>","Output format: text | json","text").action(async r=>{let e=new Qa,t=await e.getCacheStats();if(await e.clear(),r.output==="json"){console.log(JSON.stringify({success:!0,data:{action:"clear",cacheDir:e.getCacheDir(),clearedEntries:t.entryCount,freedBytes:t.totalSizeBytes}}));return}console.log(`\u{1F5D1}\uFE0F Cleared ${t.entryCount} cached query result(s) (${iq(t.totalSizeBytes)} freed) from ${e.getCacheDir()}`)})}a(Ave,"cacheClearCommand");function Ive(){return new de("stats").description("Show query-result cache entry count and total size").option("--output <format>","Output format: text | json","text").action(async r=>{let e=new Qa,t=await e.getCacheStats();if(r.output==="json"){console.log(JSON.stringify({success:!0,data:{cacheDir:e.getCacheDir(),entryCount:t.entryCount,totalSizeBytes:t.totalSizeBytes}}));return}console.log(`\u{1F4CA} SPARQL query-result cache: ${e.getCacheDir()}`),console.log(` Entries: ${t.entryCount.toLocaleString()}`),console.log(` Size: ${iq(t.totalSizeBytes)}`)})}a(Ive,"cacheStatsCommand");function iq(r){return r<1024?`${r} B`:r<1024*1024?`${(r/1024).toFixed(1)} KB`:`${(r/(1024*1024)).toFixed(1)} MB`}a(iq,"formatBytes");ut();var mq=require("readline");function sq(r){let e=r.aliases;if(e!==void 0&&(!Array.isArray(e)||e.some(n=>typeof n!="string")))return"`aliases` must be an array of strings";if(r.body!==void 0&&typeof r.body!="string")return"`body` must be a string";if(r.status!==void 0&&typeof r.status!="string"&&r.status!==!1)return"`status` must be a status name or false";let t=r.properties;if(t!==void 0){if(typeof t!="object"||t===null||Array.isArray(t))return"`properties` must be an object";for(let[n,i]of Object.entries(t))if((Array.isArray(i)?i:[i]).some(o=>typeof o!="string"))return`property \`${n}\` must be a string or an array of strings`}return null}a(sq,"invalidCreateAssetShape");function oq(r){let e=["create","--vault",r.vault,"--class",r.class,"--label",r.label];for(let t of r.aliases??[])e.push("--aliases",t);for(let[t,n]of Object.entries(r.properties??{})){let i=Array.isArray(n)?n:[n];for(let s of i)e.push("--property",`${t}=${s}`)}return r.body!==void 0&&e.push("--body",r.body),r.status===!1?e.push("--no-status"):typeof r.status=="string"&&e.push("--status",r.status),r.validate!==!1&&e.push("--validate"),r.dryRun&&e.push("--dry-run"),e}a(oq,"buildCreateAssetArgs");function aq(r){let e=["apply",r.command,r.target,"--vault",r.vault,"--json","--yes"];return r.input!==void 0&&e.push("--input",JSON.stringify(r.input)),r.dryRun&&e.push("--dry-run"),e}a(aq,"buildCreateEffortArgs");var Rve={oneOf:[{type:"string"},{type:"array",items:{type:"string"}}]},cq=[{name:"create_asset",description:"Create a vault asset through the Exocortex creation pipeline (co-location by exo__Asset_isDefinedBy, dangling-wikilink rejection, unknown-property-name rejection and \u2014 by default \u2014 SHACL-lite conformance validation before the file is written). Values are passed as an argument vector, so labels, bodies and property values containing $, backticks, quotes, parentheses or newlines are preserved byte-identically.",inputSchema:{type:"object",properties:{vault:{type:"string",description:"Path to the Obsidian vault."},class:{type:"string",description:"Class UUID or short name (e.g. ems__Task)."},label:{type:"string",description:"exo__Asset_label for the new asset."},properties:{type:"object",description:"Frontmatter properties. A string sets one value; an array of strings sets a multi-value (YAML array) property.",additionalProperties:Rve},aliases:{type:"array",items:{type:"string"},description:"Additional aliases."},body:{type:"string",description:"Markdown body of the asset."},status:{type:["string","boolean"],description:"ems__Effort_status name for a status-bearing class (e.g. Backlog, Doing). Pass false to create a status-less asset. Omit for the CLI default."},validate:{type:"boolean",default:!0,description:"Run the pre-write SHACL-lite conformance gate. Defaults to true; pass false to skip it."},dryRun:{type:"boolean",description:"Preview without writing the file."}},required:["vault","class","label"],additionalProperties:!1}},{name:"create_effort",description:"Create an effort (Task / Project / Area / \u2026) by applying a homoiconic Exocortex command to a target asset \u2014 the canonical effort-creation path. Returns the {command,target,created:[{uuid,path,label}]} envelope.",inputSchema:{type:"object",properties:{vault:{type:"string",description:"Path to the Obsidian vault."},command:{type:"string",description:"Command cliName slug (e.g. create-task) or command UUID."},target:{type:"string",description:"Vault-relative path to the target asset the command is applied to."},input:{type:"object",description:`userInput for the command's grounding (serialised as JSON), e.g. {"value":"New label"}.`},dryRun:{type:"boolean",description:"Preview without writing."}},required:["vault","command","target"],additionalProperties:!1}}];var Cve="2024-11-05",fq=-32700,lq=-32600,Ove=-32601,dq=-32603;function Cp(r,e=!1){return e?{content:[{type:"text",text:r}],isError:!0}:{content:[{type:"text",text:r}]}}a(Cp,"textResult");function xve(r){let e=r.split(`
711
+ `).map(n=>n.trim()).filter(n=>n.length>0),t=e[e.length-1];if(t!==void 0)try{return JSON.parse(t)}catch{return}}a(xve,"parseLastJsonLine");function uq(r,e){return e.filter(t=>{let n=r[t];return typeof n!="string"||n.trim().length===0})}a(uq,"missingStringFields");var lv=class{constructor(e){this.deps=e}static{a(this,"McpServer")}async handle(e){if(typeof e!="object"||e===null||Array.isArray(e))return{jsonrpc:"2.0",id:null,error:{code:lq,message:"Invalid request: expected a JSON-RPC object"}};let t=e.id,n=t===void 0;if(typeof e.method!="string")return n?null:{jsonrpc:"2.0",id:t??null,error:{code:lq,message:"Invalid request: missing method"}};if(n)return null;let i=t??null;switch(e.method){case"initialize":return{jsonrpc:"2.0",id:i,result:{protocolVersion:Cve,capabilities:{tools:{}},serverInfo:{name:"exocortex",version:this.deps.version}}};case"ping":return{jsonrpc:"2.0",id:i,result:{}};case"tools/list":return{jsonrpc:"2.0",id:i,result:{tools:cq}};case"tools/call":return{jsonrpc:"2.0",id:i,result:await this.callTool(e.params??{})};default:return{jsonrpc:"2.0",id:i,error:{code:Ove,message:`Method not found: ${e.method}`}}}}async callTool(e){let t=e.name,n=e.arguments??{},i;if(t==="create_asset"){let c=uq(n,["vault","class","label"]);if(c.length>0)return Cp(`create_asset: missing required argument(s): ${c.join(", ")}`,!0);let l=sq(n);if(l!==null)return Cp(`create_asset: ${l}`,!0);i=oq(n)}else if(t==="create_effort"){let c=uq(n,["vault","command","target"]);if(c.length>0)return Cp(`create_effort: missing required argument(s): ${c.join(", ")}`,!0);i=aq(n)}else return Cp(`Unknown tool: ${String(t)}`,!0);let s=await this.deps.runCli(i);if(s.exitCode!==0){let c=s.stderr.trim()||s.stdout.trim()||"(no diagnostic output)";return Cp(`exocortex-cli exited ${s.exitCode}
712
+ ${c}`,!0)}let o=xve(s.stdout);return Cp(o===void 0?s.stdout.trim():JSON.stringify(o))}};var pq=require("child_process");var Pve=32*1024*1024;function hq(r){return e=>new Promise(t=>{(0,pq.execFile)(process.execPath,[r,...e],{maxBuffer:Pve},(n,i,s)=>{let o=0;if(n){let c=n.code;o=typeof c=="number"?c:1}t({stdout:i,stderr:s,exitCode:o})})})}a(hq,"createSelfCliRunner");async function Fve(r,e,t){let n=(0,mq.createInterface)({input:e,crlfDelay:1/0});for await(let i of n){let s=i.trim();if(s.length===0)continue;let o;try{o=JSON.parse(s)}catch{t(JSON.stringify({jsonrpc:"2.0",id:null,error:{code:fq,message:"Parse error: invalid JSON"}})+`
713
713
  `);continue}let c;try{c=await r.handle(o)}catch(l){c={jsonrpc:"2.0",id:typeof o?.id=="string"||typeof o?.id=="number"?o.id:null,error:{code:dq,message:`Internal error: ${l instanceof Error?l.message:String(l)}`}}}c!==null&&t(JSON.stringify(c)+`
714
- `)}}a(Pve,"runStdioServer");function gq(r){return new de("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new lv({runCli:hq(t),version:r??"unknown"});await Pve(n,process.stdin,i=>process.stdout.write(i))})}a(gq,"mcpCommand");function uv(r){let e=new de;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.7.48"),e.addCommand($V()),e.addCommand(HV()),e.addCommand(S7()),e.addCommand(T7()),e.addCommand(W7()),e.addCommand(A7()),e.addCommand(x7()),e.addCommand(P7()),e.addCommand(Z7()),e.addCommand(iV()),e.addCommand(EV()),e.addCommand(RV()),e.addCommand(PV()),e.addCommand(FV()),e.addCommand(DV()),e.addCommand(LV()),e.addCommand(NV()),e.addCommand(bG()),e.addCommand(wG()),e.addCommand(KG()),e.addCommand(YG()),e.addCommand(JG()),e.addCommand(ZG()),e.addCommand(rq()),e.addCommand(kG()),e.addCommand(qG()),e.addCommand(nq()),e.addCommand(gq(r??"17.7.48")),e}a(uv,"createProgram");uv().parse();0&&(module.exports={createProgram});
714
+ `)}}a(Fve,"runStdioServer");function gq(r){return new de("mcp").description("Run an MCP (Model Context Protocol) stdio server exposing create_asset / create_effort tools backed by this CLI").option("--entry <path>","Path to the CLI entry script the tools invoke (defaults to this process's script)").action(async e=>{let t=e.entry??process.argv[1],n=new lv({runCli:hq(t),version:r??"unknown"});await Fve(n,process.stdin,i=>process.stdout.write(i))})}a(gq,"mcpCommand");function uv(r){let e=new de;return e.name("exocortex").description("CLI tool for Exocortex knowledge management system - SPARQL queries, task management, and more").version(r??"17.7.49"),e.addCommand($V()),e.addCommand(HV()),e.addCommand(S7()),e.addCommand(T7()),e.addCommand(W7()),e.addCommand(A7()),e.addCommand(x7()),e.addCommand(P7()),e.addCommand(Z7()),e.addCommand(iV()),e.addCommand(EV()),e.addCommand(RV()),e.addCommand(PV()),e.addCommand(FV()),e.addCommand(DV()),e.addCommand(LV()),e.addCommand(NV()),e.addCommand(bG()),e.addCommand(wG()),e.addCommand(KG()),e.addCommand(YG()),e.addCommand(JG()),e.addCommand(ZG()),e.addCommand(rq()),e.addCommand(kG()),e.addCommand(qG()),e.addCommand(nq()),e.addCommand(gq(r??"17.7.49")),e}a(uv,"createProgram");uv().parse();0&&(module.exports={createProgram});
715
715
  /*! Bundled license information:
716
716
 
717
717
  reflect-metadata/Reflect.js: