@a-company/paradigm 7.1.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/dist/{accept-orchestration-WMGFGYDK.js → accept-orchestration-JA3A3TSU.js} +1 -1
  2. package/dist/add-CBDU23S2.js +12 -0
  3. package/dist/{aggregate-KZICPVT3.js → aggregate-H7SB2UYT.js} +1 -1
  4. package/dist/{ambient-HAXPDIWK.js → ambient-TFLZFV5Y.js} +1 -1
  5. package/dist/ambient-VCTUHHIG.js +2 -0
  6. package/dist/arch-loader-YVOS3QRY.js +2 -0
  7. package/dist/{beacon-52EWNZPK.js → beacon-WVN264OT.js} +1 -1
  8. package/dist/calibrate-SH6PRZFD.js +2 -0
  9. package/dist/calibration-aggregate-5IVXSBDP.js +2 -0
  10. package/dist/calibration-aggregate-DUEE3LL2.js +4 -0
  11. package/dist/captain-ILBN2IKJ.js +2 -0
  12. package/dist/captain-J4FZ5PRU.js +2 -0
  13. package/dist/{chunk-QDP4G53M.js → chunk-27EK3OQZ.js} +4 -4
  14. package/dist/{chunk-KP5VOYAH.js → chunk-3F4QP2Z5.js} +1 -1
  15. package/dist/{chunk-VPNJL4LS.js → chunk-5VR7FKS5.js} +1 -1
  16. package/dist/{chunk-S3UVQ5RV.js → chunk-6VZSOQ7Y.js} +1 -1
  17. package/dist/chunk-7BZPDOOQ.js +25 -0
  18. package/dist/{chunk-YQK3XU63.js → chunk-7HUPVOAY.js} +12 -12
  19. package/dist/chunk-A5EEY6NO.js +3 -0
  20. package/dist/{chunk-4GC35IFF.js → chunk-D6BSCELB.js} +1 -1
  21. package/dist/{chunk-G6DK3ND3.js → chunk-DH7QVZDI.js} +9 -0
  22. package/dist/chunk-FG3M6VVO.js +30 -0
  23. package/dist/chunk-FNYYQNJY.js +2 -0
  24. package/dist/{chunk-RDWWSQGH.js → chunk-IBKCMLOW.js} +14 -14
  25. package/dist/chunk-K6TLYNRQ.js +7 -0
  26. package/dist/{chunk-W4BW7GXA.js → chunk-KA6QEI3C.js} +1 -1
  27. package/dist/chunk-L3AOKDMU.js +93 -0
  28. package/dist/chunk-M7JHVVDW.js +6 -0
  29. package/dist/chunk-MBKTVQS2.js +2 -0
  30. package/dist/chunk-NFN5UUJB.js +2 -0
  31. package/dist/chunk-O4ADSTSY.js +504 -0
  32. package/dist/chunk-RPGSQQTS.js +2 -0
  33. package/dist/chunk-RQHZUPLO.js +4 -0
  34. package/dist/chunk-SD3KVW5Q.js +2 -0
  35. package/dist/chunk-VKVVIN6J.js +25 -0
  36. package/dist/chunk-VOPJ47QY.js +2 -0
  37. package/dist/chunk-VR2LLUYE.js +17 -0
  38. package/dist/chunk-WMTES556.js +2 -0
  39. package/dist/chunk-XBK244QR.js +6 -0
  40. package/dist/{chunk-MBSY57RN.js → chunk-Y76OIMDO.js} +1 -1
  41. package/dist/{chunk-EG22HDXI.js → chunk-YNFF7XHV.js} +12 -12
  42. package/dist/chunk-YYRP7FLC.js +2 -0
  43. package/dist/{compliance-4P3EE5OA.js → compliance-3M6COUCO.js} +3 -3
  44. package/dist/{constellation-RHZAEFV7.js → constellation-TIKNCZWR.js} +1 -1
  45. package/dist/{cost-24UZSS2P.js → cost-VTHZQKO4.js} +2 -2
  46. package/dist/{diff-VBVIUNL5.js → diff-NZSJW3V3.js} +1 -1
  47. package/dist/dist-6TDAY6TQ-HMSTBL57.js +39 -0
  48. package/dist/{dist-TNE4GFT7.js → dist-PW5YPGFF.js} +1 -1
  49. package/dist/{docs-NTP6UENF.js → docs-DWU3T2BV.js} +1 -1
  50. package/dist/github-GI3HX3N5.js +4 -0
  51. package/dist/{habits-BX2IRSUI.js → habits-UA7YT3CG.js} +3 -3
  52. package/dist/{hooks-AXBWYJ5V.js → hooks-XXJ7CSGJ.js} +1 -1
  53. package/dist/index.js +9 -9
  54. package/dist/{init-F4MSKZIW.js → init-QPMLEQWQ.js} +1 -1
  55. package/dist/{integrity-7TKX3DZ4.js → integrity-FRGF5BFS.js} +1 -1
  56. package/dist/lint-Y4P3MHBV.js +26 -0
  57. package/dist/list-5XRLWD7K.js +12 -0
  58. package/dist/mcp.js +1 -1
  59. package/dist/{migrate-5M4KUQ2L.js → migrate-LIVXILOO.js} +1 -1
  60. package/dist/nomination-engine-EFXDEPZN.js +2 -0
  61. package/dist/{orchestrate-MLUGQOEJ.js → orchestrate-C7SI4J7C.js} +1 -1
  62. package/dist/orchestration-4MJKBSGM.js +2 -0
  63. package/dist/orchestration-S2ESNKSA.js +2 -0
  64. package/dist/platform-server-IOWHNS7Q.js +25 -0
  65. package/dist/{probe-27ARJKRO.js → probe-G3TKOJYW.js} +1 -1
  66. package/dist/quiz-QKIKAVL7.js +10 -0
  67. package/dist/registry-NEW4OJ44.js +2 -0
  68. package/dist/{reindex-ZLDQBFUR.js → reindex-G2JLIGOQ.js} +1 -1
  69. package/dist/reindex-JR3PXYQE.js +2 -0
  70. package/dist/remember-KZYAY77S.js +14 -0
  71. package/dist/{review-BRO2UP4M.js → review-WHRNLW2W.js} +1 -1
  72. package/dist/{ripple-KCVDS3WE.js → ripple-B6U7263T.js} +1 -1
  73. package/dist/{sentinel-EFPEX246.js → sentinel-RIEQWALQ.js} +1 -1
  74. package/dist/{sentinel-bridge-UR2MKARY.js → sentinel-bridge-D4LFDFCH.js} +1 -1
  75. package/dist/{serve-2PKJP65E.js → serve-6RNZYK2I.js} +2 -2
  76. package/dist/serve-PWAFVYYC.js +9 -0
  77. package/dist/{server-4D77LCST.js → server-K7G3IHR3.js} +1 -1
  78. package/dist/{setup-5V2AGLQ6.js → setup-L5OP24US.js} +3 -3
  79. package/dist/{shift-PM4GI736.js → shift-HGXZ5THV.js} +3 -3
  80. package/dist/{show-N5LGB5B2.js → show-VXNGIJE4.js} +3 -3
  81. package/dist/{snapshot-YMX5QRBM.js → snapshot-MT5L6XE4.js} +1 -1
  82. package/dist/status-45KIG32R.js +6 -0
  83. package/dist/{status-3GJXI4IK.js → status-4QGKLOP6.js} +4 -4
  84. package/dist/{summary-RPU2BS3Q.js → summary-6QNVQZJV.js} +1 -1
  85. package/dist/symphony-KQJ6HIXB.js +53 -0
  86. package/dist/symphony-VDNDFK7H.js +2 -0
  87. package/dist/symphony-relay-ASMKPDEE.js +3 -0
  88. package/dist/sync-layer-C2PF273N.js +2 -0
  89. package/dist/task-PRLQ4VPK.js +3 -0
  90. package/dist/task-loader-EIXPKHA3.js +2 -0
  91. package/dist/task-loader-LFEE6OU7.js +2 -0
  92. package/dist/task-settlement-A2T6EACG.js +3 -0
  93. package/dist/task-settlement-ZXOY4YGX.js +3 -0
  94. package/dist/team-KP4HMUB5.js +2 -0
  95. package/dist/thread-2A7QKU72.js +41 -0
  96. package/dist/tools-NOMEIBS7.js +2 -0
  97. package/dist/tools-YW3Q27UI.js +142 -0
  98. package/dist/validate-OZTX3FYX.js +13 -0
  99. package/dist/validate-RIMSY3RP.js +9 -0
  100. package/dist/{workspace-6POCBPDY.js → workspace-4D4TQ637.js} +1 -1
  101. package/package.json +2 -6
  102. package/platform-ui/dist/assets/{AmbientSection-CwatqcBD.js → AmbientSection-xoxr3DQg.js} +1 -1
  103. package/platform-ui/dist/assets/{DocsSection-BZ2SFJBZ.js → DocsSection-Us2qksna.js} +1 -1
  104. package/platform-ui/dist/assets/{GitSection-MNNYU1tO.js → GitSection-DIHZyadf.js} +1 -1
  105. package/platform-ui/dist/assets/{GraphSection-COYjb4Pt.js → GraphSection-9TO0L1IO.js} +1 -1
  106. package/platform-ui/dist/assets/{LoreSection-B0hUbfsJ.js → LoreSection-DVDit8Aw.js} +1 -1
  107. package/platform-ui/dist/assets/{SentinelSection-BCxW1DCp.js → SentinelSection-a5_VNYcx.js} +1 -1
  108. package/platform-ui/dist/assets/{SymphonySection-BsucZRqy.js → SymphonySection-cRHEoJ9t.js} +1 -1
  109. package/platform-ui/dist/assets/TasksSection-44_gDO3L.css +1 -0
  110. package/platform-ui/dist/assets/TasksSection-h8x3qRIj.js +1 -0
  111. package/platform-ui/dist/assets/{TeamSection-C0QNTudW.js → TeamSection-mFoDyNic.js} +1 -1
  112. package/platform-ui/dist/assets/{UniversitySection-DN1-g9pw.js → UniversitySection-D99YRjmC.js} +1 -1
  113. package/platform-ui/dist/assets/{index-DwUT8pju.js → index-D_wB2S_2.js} +11 -11
  114. package/platform-ui/dist/index.html +1 -1
  115. package/dist/add-V6XR7DU5.js +0 -12
  116. package/dist/agent-loader-Z753DQWH.js +0 -2
  117. package/dist/ambient-QB7V4TBR.js +0 -6
  118. package/dist/calibrate-PHVP7RPH.js +0 -4
  119. package/dist/captain-3COP6YTD.js +0 -2
  120. package/dist/chunk-4CGPLLWQ.js +0 -30
  121. package/dist/chunk-7SWEOPWF.js +0 -2
  122. package/dist/chunk-CHSU6LTR.js +0 -2
  123. package/dist/chunk-EKNLG73M.js +0 -6
  124. package/dist/chunk-H55W26AR.js +0 -3
  125. package/dist/chunk-HE2NA5QF.js +0 -8
  126. package/dist/chunk-JIXHEBGK.js +0 -7
  127. package/dist/chunk-MBPLJKE5.js +0 -3
  128. package/dist/chunk-OIYJUU6T.js +0 -25
  129. package/dist/chunk-QO7YPQXC.js +0 -2
  130. package/dist/chunk-XMAV5AG6.js +0 -2
  131. package/dist/chunk-XPPFILCM.js +0 -2
  132. package/dist/chunk-YCDOA5IQ.js +0 -18
  133. package/dist/dist-GQ42YS5N-4HIJZVBB.js +0 -39
  134. package/dist/lint-IGKE6UPS.js +0 -26
  135. package/dist/list-NC3QGT75.js +0 -12
  136. package/dist/lore-loader-HAZ5FRLP.js +0 -2
  137. package/dist/lore-server-FC2GMDLT.js +0 -14
  138. package/dist/nomination-engine-ORHH4L2W.js +0 -2
  139. package/dist/orchestration-O2OVPTIZ.js +0 -2
  140. package/dist/platform-server-Y6TLEXR2.js +0 -25
  141. package/dist/quiz-TNV6APBM.js +0 -10
  142. package/dist/remember-MJRNTXYS.js +0 -14
  143. package/dist/serve-L52ZUTU6.js +0 -10
  144. package/dist/serve-XZ6GBUS3.js +0 -8
  145. package/dist/session-work-log-FF7CKMWP.js +0 -2
  146. package/dist/status-ENAI35NL.js +0 -6
  147. package/dist/symphony-CFAYJGLF.js +0 -2
  148. package/dist/symphony-L56O5ZG3.js +0 -53
  149. package/dist/symphony-relay-Y2UR3YNR.js +0 -3
  150. package/dist/task-loader-H7HQAYGL.js +0 -2
  151. package/dist/task-loader-YZME4RKE.js +0 -2
  152. package/dist/task-settlement-HINBVZBE.js +0 -3
  153. package/dist/task-settlement-XC6E6JNT.js +0 -3
  154. package/dist/team-25LK6CWM.js +0 -2
  155. package/dist/thread-HFXK65D4.js +0 -41
  156. package/dist/tools-GAU5WOEI.js +0 -2
  157. package/dist/validate-IQG7DBFC.js +0 -9
  158. package/dist/validate-LSCDOLBO.js +0 -13
  159. package/dist/work-log-loader-CRVTOMVB.js +0 -2
  160. package/graph-ui/dist/assets/index-BlgXTl53.css +0 -1
  161. package/graph-ui/dist/assets/index-Bq5nXK8p.js +0 -63
  162. package/graph-ui/dist/index.html +0 -13
  163. package/lore-ui/dist/assets/index-C3EixkjW.css +0 -1
  164. package/lore-ui/dist/assets/index-DKhNxgtW.js +0 -56
  165. package/lore-ui/dist/index.html +0 -13
  166. package/platform-ui/dist/assets/CanvasSection-dFAthehN.js +0 -9
  167. package/platform-ui/dist/assets/CanvasSection-flMXU19z.css +0 -1
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+ import'./chunk-5TAVYPOV.js';import*as z from'fs';import {realpathSync,readlinkSync,readdirSync,readdir as readdir$1,lstatSync}from'fs';import {z as z$1}from'zod';import*as A from'path';import {win32,posix}from'path';import {fileURLToPath}from'url';import {realpath,readlink,readdir,lstat}from'fs/promises';import {EventEmitter}from'events';import Fi from'stream';import {StringDecoder}from'string_decoder';function Pi(t){return typeof t>"u"||t===null}function sr(t){return typeof t=="object"&&t!==null}function rr(t){return Array.isArray(t)?t:Pi(t)?[]:[t]}function nr(t,e){var i,s,r,n;if(e)for(n=Object.keys(e),i=0,s=n.length;i<s;i+=1)r=n[i],t[r]=e[r];return t}function or(t,e){var i="",s;for(s=0;s<e;s+=1)i+=t;return i}function ar(t){return t===0&&Number.NEGATIVE_INFINITY===1/t}var lr=Pi,hr=sr,ur=rr,cr=or,pr=ar,fr=nr,T={isNothing:lr,isObject:hr,toArray:ur,repeat:cr,isNegativeZero:pr,extend:fr};function $i(t,e){var i="",s=t.reason||"(unknown reason)";return t.mark?(t.mark.name&&(i+='in "'+t.mark.name+'" '),i+="("+(t.mark.line+1)+":"+(t.mark.column+1)+")",!e&&t.mark.snippet&&(i+=`
3
+
4
+ `+t.mark.snippet),s+" "+i):s}function Rt(t,e){Error.call(this),this.name="YAMLException",this.reason=t,this.mark=e,this.message=$i(this,false),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||"";}Rt.prototype=Object.create(Error.prototype);Rt.prototype.constructor=Rt;Rt.prototype.toString=function(t){return this.name+": "+$i(this,t)};var D=Rt;function pe(t,e,i,s,r){var n="",o="",a=Math.floor(r/2)-1;return s-e>a&&(n=" ... ",e=s-a+n.length),i-s>a&&(o=" ...",i=s+a-o.length),{str:n+t.slice(e,i).replace(/\t/g,"\u2192")+o,pos:s-e+n.length}}function fe(t,e){return T.repeat(" ",e-t.length)+t}function dr(t,e){if(e=Object.create(e||null),!t.buffer)return null;e.maxLength||(e.maxLength=79),typeof e.indent!="number"&&(e.indent=1),typeof e.linesBefore!="number"&&(e.linesBefore=3),typeof e.linesAfter!="number"&&(e.linesAfter=2);for(var i=/\r?\n|\r|\0/g,s=[0],r=[],n,o=-1;n=i.exec(t.buffer);)r.push(n.index),s.push(n.index+n[0].length),t.position<=n.index&&o<0&&(o=s.length-2);o<0&&(o=s.length-1);var a="",l,h,c=Math.min(t.line+e.linesAfter,r.length).toString().length,u=e.maxLength-(e.indent+c+3);for(l=1;l<=e.linesBefore&&!(o-l<0);l++)h=pe(t.buffer,s[o-l],r[o-l],t.position-(s[o]-s[o-l]),u),a=T.repeat(" ",e.indent)+fe((t.line-l+1).toString(),c)+" | "+h.str+`
5
+ `+a;for(h=pe(t.buffer,s[o],r[o],t.position,u),a+=T.repeat(" ",e.indent)+fe((t.line+1).toString(),c)+" | "+h.str+`
6
+ `,a+=T.repeat("-",e.indent+c+3+h.pos)+`^
7
+ `,l=1;l<=e.linesAfter&&!(o+l>=r.length);l++)h=pe(t.buffer,s[o+l],r[o+l],t.position-(s[o]-s[o+l]),u),a+=T.repeat(" ",e.indent)+fe((t.line+l+1).toString(),c)+" | "+h.str+`
8
+ `;return a.replace(/\n$/,"")}var gr=dr,mr=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],yr=["scalar","sequence","mapping"];function wr(t){var e={};return t!==null&&Object.keys(t).forEach(function(i){t[i].forEach(function(s){e[String(s)]=i;});}),e}function br(t,e){if(e=e||{},Object.keys(e).forEach(function(i){if(mr.indexOf(i)===-1)throw new D('Unknown option "'+i+'" is met in definition of "'+t+'" YAML type.')}),this.options=e,this.tag=t,this.kind=e.kind||null,this.resolve=e.resolve||function(){return true},this.construct=e.construct||function(i){return i},this.instanceOf=e.instanceOf||null,this.predicate=e.predicate||null,this.represent=e.represent||null,this.representName=e.representName||null,this.defaultStyle=e.defaultStyle||null,this.multi=e.multi||false,this.styleAliases=wr(e.styleAliases||null),yr.indexOf(this.kind)===-1)throw new D('Unknown kind "'+this.kind+'" is specified for "'+t+'" YAML type.')}var M=br;function Ue(t,e){var i=[];return t[e].forEach(function(s){var r=i.length;i.forEach(function(n,o){n.tag===s.tag&&n.kind===s.kind&&n.multi===s.multi&&(r=o);}),i[r]=s;}),i}function vr(){var t={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},e,i;function s(r){r.multi?(t.multi[r.kind].push(r),t.multi.fallback.push(r)):t[r.kind][r.tag]=t.fallback[r.tag]=r;}for(e=0,i=arguments.length;e<i;e+=1)arguments[e].forEach(s);return t}function Ee(t){return this.extend(t)}Ee.prototype.extend=function(t){var e=[],i=[];if(t instanceof M)i.push(t);else if(Array.isArray(t))i=i.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(e=e.concat(t.implicit)),t.explicit&&(i=i.concat(t.explicit));else throw new D("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");e.forEach(function(r){if(!(r instanceof M))throw new D("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(r.loadKind&&r.loadKind!=="scalar")throw new D("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(r.multi)throw new D("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),i.forEach(function(r){if(!(r instanceof M))throw new D("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var s=Object.create(Ee.prototype);return s.implicit=(this.implicit||[]).concat(e),s.explicit=(this.explicit||[]).concat(i),s.compiledImplicit=Ue(s,"implicit"),s.compiledExplicit=Ue(s,"explicit"),s.compiledTypeMap=vr(s.compiledImplicit,s.compiledExplicit),s};var Sr=Ee,xr=new M("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),kr=new M("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Ar=new M("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Cr=new Sr({explicit:[xr,kr,Ar]});function Er(t){if(t===null)return true;var e=t.length;return e===1&&t==="~"||e===4&&(t==="null"||t==="Null"||t==="NULL")}function Or(){return null}function Tr(t){return t===null}var jr=new M("tag:yaml.org,2002:null",{kind:"scalar",resolve:Er,construct:Or,predicate:Tr,represent:{canonical:function(){return "~"},lowercase:function(){return "null"},uppercase:function(){return "NULL"},camelcase:function(){return "Null"},empty:function(){return ""}},defaultStyle:"lowercase"});function Fr(t){if(t===null)return false;var e=t.length;return e===4&&(t==="true"||t==="True"||t==="TRUE")||e===5&&(t==="false"||t==="False"||t==="FALSE")}function Pr(t){return t==="true"||t==="True"||t==="TRUE"}function $r(t){return Object.prototype.toString.call(t)==="[object Boolean]"}var Mr=new M("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Fr,construct:Pr,predicate:$r,represent:{lowercase:function(t){return t?"true":"false"},uppercase:function(t){return t?"TRUE":"FALSE"},camelcase:function(t){return t?"True":"False"}},defaultStyle:"lowercase"});function Rr(t){return 48<=t&&t<=57||65<=t&&t<=70||97<=t&&t<=102}function Ir(t){return 48<=t&&t<=55}function Lr(t){return 48<=t&&t<=57}function Nr(t){if(t===null)return false;var e=t.length,i=0,s=false,r;if(!e)return false;if(r=t[i],(r==="-"||r==="+")&&(r=t[++i]),r==="0"){if(i+1===e)return true;if(r=t[++i],r==="b"){for(i++;i<e;i++)if(r=t[i],r!=="_"){if(r!=="0"&&r!=="1")return false;s=true;}return s&&r!=="_"}if(r==="x"){for(i++;i<e;i++)if(r=t[i],r!=="_"){if(!Rr(t.charCodeAt(i)))return false;s=true;}return s&&r!=="_"}if(r==="o"){for(i++;i<e;i++)if(r=t[i],r!=="_"){if(!Ir(t.charCodeAt(i)))return false;s=true;}return s&&r!=="_"}}if(r==="_")return false;for(;i<e;i++)if(r=t[i],r!=="_"){if(!Lr(t.charCodeAt(i)))return false;s=true;}return !(!s||r==="_")}function _r(t){var e=t,i=1,s;if(e.indexOf("_")!==-1&&(e=e.replace(/_/g,"")),s=e[0],(s==="-"||s==="+")&&(s==="-"&&(i=-1),e=e.slice(1),s=e[0]),e==="0")return 0;if(s==="0"){if(e[1]==="b")return i*parseInt(e.slice(2),2);if(e[1]==="x")return i*parseInt(e.slice(2),16);if(e[1]==="o")return i*parseInt(e.slice(2),8)}return i*parseInt(e,10)}function Dr(t){return Object.prototype.toString.call(t)==="[object Number]"&&t%1===0&&!T.isNegativeZero(t)}var Wr=new M("tag:yaml.org,2002:int",{kind:"scalar",resolve:Nr,construct:_r,predicate:Dr,represent:{binary:function(t){return t>=0?"0b"+t.toString(2):"-0b"+t.toString(2).slice(1)},octal:function(t){return t>=0?"0o"+t.toString(8):"-0o"+t.toString(8).slice(1)},decimal:function(t){return t.toString(10)},hexadecimal:function(t){return t>=0?"0x"+t.toString(16).toUpperCase():"-0x"+t.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),zr=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Br(t){return !(t===null||!zr.test(t)||t[t.length-1]==="_")}function Ur(t){var e,i;return e=t.replace(/_/g,"").toLowerCase(),i=e[0]==="-"?-1:1,"+-".indexOf(e[0])>=0&&(e=e.slice(1)),e===".inf"?i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:e===".nan"?NaN:i*parseFloat(e,10)}var Gr=/^[-+]?[0-9]+e/;function Yr(t,e){var i;if(isNaN(t))switch(e){case "lowercase":return ".nan";case "uppercase":return ".NAN";case "camelcase":return ".NaN"}else if(Number.POSITIVE_INFINITY===t)switch(e){case "lowercase":return ".inf";case "uppercase":return ".INF";case "camelcase":return ".Inf"}else if(Number.NEGATIVE_INFINITY===t)switch(e){case "lowercase":return "-.inf";case "uppercase":return "-.INF";case "camelcase":return "-.Inf"}else if(T.isNegativeZero(t))return "-0.0";return i=t.toString(10),Gr.test(i)?i.replace("e",".e"):i}function qr(t){return Object.prototype.toString.call(t)==="[object Number]"&&(t%1!==0||T.isNegativeZero(t))}var Vr=new M("tag:yaml.org,2002:float",{kind:"scalar",resolve:Br,construct:Ur,predicate:qr,represent:Yr,defaultStyle:"lowercase"}),Zr=Cr.extend({implicit:[jr,Mr,Wr,Vr]}),Kr=Zr,Mi=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),Ri=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 Hr(t){return t===null?false:Mi.exec(t)!==null||Ri.exec(t)!==null}function Jr(t){var e,i,s,r,n,o,a,l=0,h=null,c,u,f;if(e=Mi.exec(t),e===null&&(e=Ri.exec(t)),e===null)throw new Error("Date resolve error");if(i=+e[1],s=+e[2]-1,r=+e[3],!e[4])return new Date(Date.UTC(i,s,r));if(n=+e[4],o=+e[5],a=+e[6],e[7]){for(l=e[7].slice(0,3);l.length<3;)l+="0";l=+l;}return e[9]&&(c=+e[10],u=+(e[11]||0),h=(c*60+u)*6e4,e[9]==="-"&&(h=-h)),f=new Date(Date.UTC(i,s,r,n,o,a,l)),h&&f.setTime(f.getTime()-h),f}function Xr(t){return t.toISOString()}var Qr=new M("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Hr,construct:Jr,instanceOf:Date,represent:Xr});function tn(t){return t==="<<"||t===null}var en=new M("tag:yaml.org,2002:merge",{kind:"scalar",resolve:tn}),Ie=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
9
+ \r`;function sn(t){if(t===null)return false;var e,i,s=0,r=t.length,n=Ie;for(i=0;i<r;i++)if(e=n.indexOf(t.charAt(i)),!(e>64)){if(e<0)return false;s+=6;}return s%8===0}function rn(t){var e,i,s=t.replace(/[\r\n=]/g,""),r=s.length,n=Ie,o=0,a=[];for(e=0;e<r;e++)e%4===0&&e&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|n.indexOf(s.charAt(e));return i=r%4*6,i===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):i===18?(a.push(o>>10&255),a.push(o>>2&255)):i===12&&a.push(o>>4&255),new Uint8Array(a)}function nn(t){var e="",i=0,s,r,n=t.length,o=Ie;for(s=0;s<n;s++)s%3===0&&s&&(e+=o[i>>18&63],e+=o[i>>12&63],e+=o[i>>6&63],e+=o[i&63]),i=(i<<8)+t[s];return r=n%3,r===0?(e+=o[i>>18&63],e+=o[i>>12&63],e+=o[i>>6&63],e+=o[i&63]):r===2?(e+=o[i>>10&63],e+=o[i>>4&63],e+=o[i<<2&63],e+=o[64]):r===1&&(e+=o[i>>2&63],e+=o[i<<4&63],e+=o[64],e+=o[64]),e}function on(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}var an=new M("tag:yaml.org,2002:binary",{kind:"scalar",resolve:sn,construct:rn,predicate:on,represent:nn}),ln=Object.prototype.hasOwnProperty,hn=Object.prototype.toString;function un(t){if(t===null)return true;var e=[],i,s,r,n,o,a=t;for(i=0,s=a.length;i<s;i+=1){if(r=a[i],o=false,hn.call(r)!=="[object Object]")return false;for(n in r)if(ln.call(r,n))if(!o)o=true;else return false;if(!o)return false;if(e.indexOf(n)===-1)e.push(n);else return false}return true}function cn(t){return t!==null?t:[]}var pn=new M("tag:yaml.org,2002:omap",{kind:"sequence",resolve:un,construct:cn}),fn=Object.prototype.toString;function dn(t){if(t===null)return true;var e,i,s,r,n,o=t;for(n=new Array(o.length),e=0,i=o.length;e<i;e+=1){if(s=o[e],fn.call(s)!=="[object Object]"||(r=Object.keys(s),r.length!==1))return false;n[e]=[r[0],s[r[0]]];}return true}function gn(t){if(t===null)return [];var e,i,s,r,n,o=t;for(n=new Array(o.length),e=0,i=o.length;e<i;e+=1)s=o[e],r=Object.keys(s),n[e]=[r[0],s[r[0]]];return n}var mn=new M("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:dn,construct:gn}),yn=Object.prototype.hasOwnProperty;function wn(t){if(t===null)return true;var e,i=t;for(e in i)if(yn.call(i,e)&&i[e]!==null)return false;return true}function bn(t){return t!==null?t:{}}var vn=new M("tag:yaml.org,2002:set",{kind:"mapping",resolve:wn,construct:bn}),Ii=Kr.extend({implicit:[Qr,en],explicit:[an,pn,mn,vn]}),at=Object.prototype.hasOwnProperty,Ht=1,Li=2,Ni=3,Jt=4,de=1,Sn=2,Ge=3,xn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,kn=/[\x85\u2028\u2029]/,An=/[,\[\]\{\}]/,_i=/^(?:!|!!|![a-z\-]+!)$/i,Di=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Ye(t){return Object.prototype.toString.call(t)}function Q(t){return t===10||t===13}function pt(t){return t===9||t===32}function W(t){return t===9||t===32||t===10||t===13}function wt(t){return t===44||t===91||t===93||t===123||t===125}function Cn(t){var e;return 48<=t&&t<=57?t-48:(e=t|32,97<=e&&e<=102?e-97+10:-1)}function En(t){return t===120?2:t===117?4:t===85?8:0}function On(t){return 48<=t&&t<=57?t-48:-1}function qe(t){return t===48?"\0":t===97?"\x07":t===98?"\b":t===116||t===9?" ":t===110?`
10
+ `:t===118?"\v":t===102?"\f":t===114?"\r":t===101?"\x1B":t===32?" ":t===34?'"':t===47?"/":t===92?"\\":t===78?"\x85":t===95?"\xA0":t===76?"\u2028":t===80?"\u2029":""}function Tn(t){return t<=65535?String.fromCharCode(t):String.fromCharCode((t-65536>>10)+55296,(t-65536&1023)+56320)}function Wi(t,e,i){e==="__proto__"?Object.defineProperty(t,e,{configurable:true,enumerable:true,writable:true,value:i}):t[e]=i;}var zi=new Array(256),Bi=new Array(256);for(ht=0;ht<256;ht++)zi[ht]=qe(ht)?1:0,Bi[ht]=qe(ht);var ht;function jn(t,e){this.input=t,this.filename=e.filename||null,this.schema=e.schema||Ii,this.onWarning=e.onWarning||null,this.legacy=e.legacy||false,this.json=e.json||false,this.listener=e.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=t.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[];}function Ui(t,e){var i={name:t.filename,buffer:t.input.slice(0,-1),position:t.position,line:t.line,column:t.position-t.lineStart};return i.snippet=gr(i),new D(e,i)}function x(t,e){throw Ui(t,e)}function Xt(t,e){t.onWarning&&t.onWarning.call(null,Ui(t,e));}var Ve={YAML:function(t,e,i){var s,r,n;t.version!==null&&x(t,"duplication of %YAML directive"),i.length!==1&&x(t,"YAML directive accepts exactly one argument"),s=/^([0-9]+)\.([0-9]+)$/.exec(i[0]),s===null&&x(t,"ill-formed argument of the YAML directive"),r=parseInt(s[1],10),n=parseInt(s[2],10),r!==1&&x(t,"unacceptable YAML version of the document"),t.version=i[0],t.checkLineBreaks=n<2,n!==1&&n!==2&&Xt(t,"unsupported YAML version of the document");},TAG:function(t,e,i){var s,r;i.length!==2&&x(t,"TAG directive accepts exactly two arguments"),s=i[0],r=i[1],_i.test(s)||x(t,"ill-formed tag handle (first argument) of the TAG directive"),at.call(t.tagMap,s)&&x(t,'there is a previously declared suffix for "'+s+'" tag handle'),Di.test(r)||x(t,"ill-formed tag prefix (second argument) of the TAG directive");try{r=decodeURIComponent(r);}catch{x(t,"tag prefix is malformed: "+r);}t.tagMap[s]=r;}};function ot(t,e,i,s){var r,n,o,a;if(e<i){if(a=t.input.slice(e,i),s)for(r=0,n=a.length;r<n;r+=1)o=a.charCodeAt(r),o===9||32<=o&&o<=1114111||x(t,"expected valid JSON character");else xn.test(a)&&x(t,"the stream contains non-printable characters");t.result+=a;}}function Ze(t,e,i,s){var r,n,o,a;for(T.isObject(i)||x(t,"cannot merge mappings; the provided source object is unacceptable"),r=Object.keys(i),o=0,a=r.length;o<a;o+=1)n=r[o],at.call(e,n)||(Wi(e,n,i[n]),s[n]=true);}function bt(t,e,i,s,r,n,o,a,l){var h,c;if(Array.isArray(r))for(r=Array.prototype.slice.call(r),h=0,c=r.length;h<c;h+=1)Array.isArray(r[h])&&x(t,"nested arrays are not supported inside keys"),typeof r=="object"&&Ye(r[h])==="[object Object]"&&(r[h]="[object Object]");if(typeof r=="object"&&Ye(r)==="[object Object]"&&(r="[object Object]"),r=String(r),e===null&&(e={}),s==="tag:yaml.org,2002:merge")if(Array.isArray(n))for(h=0,c=n.length;h<c;h+=1)Ze(t,e,n[h],i);else Ze(t,e,n,i);else !t.json&&!at.call(i,r)&&at.call(e,r)&&(t.line=o||t.line,t.lineStart=a||t.lineStart,t.position=l||t.position,x(t,"duplicated mapping key")),Wi(e,r,n),delete i[r];return e}function Le(t){var e;e=t.input.charCodeAt(t.position),e===10?t.position++:e===13?(t.position++,t.input.charCodeAt(t.position)===10&&t.position++):x(t,"a line break is expected"),t.line+=1,t.lineStart=t.position,t.firstTabInLine=-1;}function O(t,e,i){for(var s=0,r=t.input.charCodeAt(t.position);r!==0;){for(;pt(r);)r===9&&t.firstTabInLine===-1&&(t.firstTabInLine=t.position),r=t.input.charCodeAt(++t.position);if(e&&r===35)do r=t.input.charCodeAt(++t.position);while(r!==10&&r!==13&&r!==0);if(Q(r))for(Le(t),r=t.input.charCodeAt(t.position),s++,t.lineIndent=0;r===32;)t.lineIndent++,r=t.input.charCodeAt(++t.position);else break}return i!==-1&&s!==0&&t.lineIndent<i&&Xt(t,"deficient indentation"),s}function oe(t){var e=t.position,i;return i=t.input.charCodeAt(e),!!((i===45||i===46)&&i===t.input.charCodeAt(e+1)&&i===t.input.charCodeAt(e+2)&&(e+=3,i=t.input.charCodeAt(e),i===0||W(i)))}function Ne(t,e){e===1?t.result+=" ":e>1&&(t.result+=T.repeat(`
11
+ `,e-1));}function Fn(t,e,i){var s,r,n,o,a,l,h,c,u=t.kind,f=t.result,d;if(d=t.input.charCodeAt(t.position),W(d)||wt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(r=t.input.charCodeAt(t.position+1),W(r)||i&&wt(r)))return false;for(t.kind="scalar",t.result="",n=o=t.position,a=false;d!==0;){if(d===58){if(r=t.input.charCodeAt(t.position+1),W(r)||i&&wt(r))break}else if(d===35){if(s=t.input.charCodeAt(t.position-1),W(s))break}else {if(t.position===t.lineStart&&oe(t)||i&&wt(d))break;if(Q(d))if(l=t.line,h=t.lineStart,c=t.lineIndent,O(t,false,-1),t.lineIndent>=e){a=true,d=t.input.charCodeAt(t.position);continue}else {t.position=o,t.line=l,t.lineStart=h,t.lineIndent=c;break}}a&&(ot(t,n,o,false),Ne(t,t.line-l),n=o=t.position,a=false),pt(d)||(o=t.position+1),d=t.input.charCodeAt(++t.position);}return ot(t,n,o,false),t.result?true:(t.kind=u,t.result=f,false)}function Pn(t,e){var i,s,r;if(i=t.input.charCodeAt(t.position),i!==39)return false;for(t.kind="scalar",t.result="",t.position++,s=r=t.position;(i=t.input.charCodeAt(t.position))!==0;)if(i===39)if(ot(t,s,t.position,true),i=t.input.charCodeAt(++t.position),i===39)s=t.position,t.position++,r=t.position;else return true;else Q(i)?(ot(t,s,r,true),Ne(t,O(t,false,e)),s=r=t.position):t.position===t.lineStart&&oe(t)?x(t,"unexpected end of the document within a single quoted scalar"):(t.position++,r=t.position);x(t,"unexpected end of the stream within a single quoted scalar");}function $n(t,e){var i,s,r,n,o,a;if(a=t.input.charCodeAt(t.position),a!==34)return false;for(t.kind="scalar",t.result="",t.position++,i=s=t.position;(a=t.input.charCodeAt(t.position))!==0;){if(a===34)return ot(t,i,t.position,true),t.position++,true;if(a===92){if(ot(t,i,t.position,true),a=t.input.charCodeAt(++t.position),Q(a))O(t,false,e);else if(a<256&&zi[a])t.result+=Bi[a],t.position++;else if((o=En(a))>0){for(r=o,n=0;r>0;r--)a=t.input.charCodeAt(++t.position),(o=Cn(a))>=0?n=(n<<4)+o:x(t,"expected hexadecimal character");t.result+=Tn(n),t.position++;}else x(t,"unknown escape sequence");i=s=t.position;}else Q(a)?(ot(t,i,s,true),Ne(t,O(t,false,e)),i=s=t.position):t.position===t.lineStart&&oe(t)?x(t,"unexpected end of the document within a double quoted scalar"):(t.position++,s=t.position);}x(t,"unexpected end of the stream within a double quoted scalar");}function Mn(t,e){var i=true,s,r,n,o=t.tag,a,l=t.anchor,h,c,u,f,d,g=Object.create(null),m,b,v,y;if(y=t.input.charCodeAt(t.position),y===91)c=93,d=false,a=[];else if(y===123)c=125,d=true,a={};else return false;for(t.anchor!==null&&(t.anchorMap[t.anchor]=a),y=t.input.charCodeAt(++t.position);y!==0;){if(O(t,true,e),y=t.input.charCodeAt(t.position),y===c)return t.position++,t.tag=o,t.anchor=l,t.kind=d?"mapping":"sequence",t.result=a,true;i?y===44&&x(t,"expected the node content, but found ','"):x(t,"missed comma between flow collection entries"),b=m=v=null,u=f=false,y===63&&(h=t.input.charCodeAt(t.position+1),W(h)&&(u=f=true,t.position++,O(t,true,e))),s=t.line,r=t.lineStart,n=t.position,St(t,e,Ht,false,true),b=t.tag,m=t.result,O(t,true,e),y=t.input.charCodeAt(t.position),(f||t.line===s)&&y===58&&(u=true,y=t.input.charCodeAt(++t.position),O(t,true,e),St(t,e,Ht,false,true),v=t.result),d?bt(t,a,g,b,m,v,s,r,n):u?a.push(bt(t,null,g,b,m,v,s,r,n)):a.push(m),O(t,true,e),y=t.input.charCodeAt(t.position),y===44?(i=true,y=t.input.charCodeAt(++t.position)):i=false;}x(t,"unexpected end of the stream within a flow collection");}function Rn(t,e){var i,s,r=de,n=false,o=false,a=e,l=0,h=false,c,u;if(u=t.input.charCodeAt(t.position),u===124)s=false;else if(u===62)s=true;else return false;for(t.kind="scalar",t.result="";u!==0;)if(u=t.input.charCodeAt(++t.position),u===43||u===45)de===r?r=u===43?Ge:Sn:x(t,"repeat of a chomping mode identifier");else if((c=On(u))>=0)c===0?x(t,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?x(t,"repeat of an indentation width identifier"):(a=e+c-1,o=true);else break;if(pt(u)){do u=t.input.charCodeAt(++t.position);while(pt(u));if(u===35)do u=t.input.charCodeAt(++t.position);while(!Q(u)&&u!==0)}for(;u!==0;){for(Le(t),t.lineIndent=0,u=t.input.charCodeAt(t.position);(!o||t.lineIndent<a)&&u===32;)t.lineIndent++,u=t.input.charCodeAt(++t.position);if(!o&&t.lineIndent>a&&(a=t.lineIndent),Q(u)){l++;continue}if(t.lineIndent<a){r===Ge?t.result+=T.repeat(`
12
+ `,n?1+l:l):r===de&&n&&(t.result+=`
13
+ `);break}for(s?pt(u)?(h=true,t.result+=T.repeat(`
14
+ `,n?1+l:l)):h?(h=false,t.result+=T.repeat(`
15
+ `,l+1)):l===0?n&&(t.result+=" "):t.result+=T.repeat(`
16
+ `,l):t.result+=T.repeat(`
17
+ `,n?1+l:l),n=true,o=true,l=0,i=t.position;!Q(u)&&u!==0;)u=t.input.charCodeAt(++t.position);ot(t,i,t.position,false);}return true}function Ke(t,e){var i,s=t.tag,r=t.anchor,n=[],o,a=false,l;if(t.firstTabInLine!==-1)return false;for(t.anchor!==null&&(t.anchorMap[t.anchor]=n),l=t.input.charCodeAt(t.position);l!==0&&(t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),!(l!==45||(o=t.input.charCodeAt(t.position+1),!W(o))));){if(a=true,t.position++,O(t,true,-1)&&t.lineIndent<=e){n.push(null),l=t.input.charCodeAt(t.position);continue}if(i=t.line,St(t,e,Ni,false,true),n.push(t.result),O(t,true,-1),l=t.input.charCodeAt(t.position),(t.line===i||t.lineIndent>e)&&l!==0)x(t,"bad indentation of a sequence entry");else if(t.lineIndent<e)break}return a?(t.tag=s,t.anchor=r,t.kind="sequence",t.result=n,true):false}function In(t,e,i){var s,r,n,o,a,l,h=t.tag,c=t.anchor,u={},f=Object.create(null),d=null,g=null,m=null,b=false,v=false,y;if(t.firstTabInLine!==-1)return false;for(t.anchor!==null&&(t.anchorMap[t.anchor]=u),y=t.input.charCodeAt(t.position);y!==0;){if(!b&&t.firstTabInLine!==-1&&(t.position=t.firstTabInLine,x(t,"tab characters must not be used in indentation")),s=t.input.charCodeAt(t.position+1),n=t.line,(y===63||y===58)&&W(s))y===63?(b&&(bt(t,u,f,d,g,null,o,a,l),d=g=m=null),v=true,b=true,r=true):b?(b=false,r=true):x(t,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),t.position+=1,y=s;else {if(o=t.line,a=t.lineStart,l=t.position,!St(t,i,Li,false,true))break;if(t.line===n){for(y=t.input.charCodeAt(t.position);pt(y);)y=t.input.charCodeAt(++t.position);if(y===58)y=t.input.charCodeAt(++t.position),W(y)||x(t,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(bt(t,u,f,d,g,null,o,a,l),d=g=m=null),v=true,b=false,r=false,d=t.tag,g=t.result;else if(v)x(t,"can not read an implicit mapping pair; a colon is missed");else return t.tag=h,t.anchor=c,true}else if(v)x(t,"can not read a block mapping entry; a multiline key may not be an implicit key");else return t.tag=h,t.anchor=c,true}if((t.line===n||t.lineIndent>e)&&(b&&(o=t.line,a=t.lineStart,l=t.position),St(t,e,Jt,true,r)&&(b?g=t.result:m=t.result),b||(bt(t,u,f,d,g,m,o,a,l),d=g=m=null),O(t,true,-1),y=t.input.charCodeAt(t.position)),(t.line===n||t.lineIndent>e)&&y!==0)x(t,"bad indentation of a mapping entry");else if(t.lineIndent<e)break}return b&&bt(t,u,f,d,g,null,o,a,l),v&&(t.tag=h,t.anchor=c,t.kind="mapping",t.result=u),v}function Ln(t){var e,i=false,s=false,r,n,o;if(o=t.input.charCodeAt(t.position),o!==33)return false;if(t.tag!==null&&x(t,"duplication of a tag property"),o=t.input.charCodeAt(++t.position),o===60?(i=true,o=t.input.charCodeAt(++t.position)):o===33?(s=true,r="!!",o=t.input.charCodeAt(++t.position)):r="!",e=t.position,i){do o=t.input.charCodeAt(++t.position);while(o!==0&&o!==62);t.position<t.length?(n=t.input.slice(e,t.position),o=t.input.charCodeAt(++t.position)):x(t,"unexpected end of the stream within a verbatim tag");}else {for(;o!==0&&!W(o);)o===33&&(s?x(t,"tag suffix cannot contain exclamation marks"):(r=t.input.slice(e-1,t.position+1),_i.test(r)||x(t,"named tag handle cannot contain such characters"),s=true,e=t.position+1)),o=t.input.charCodeAt(++t.position);n=t.input.slice(e,t.position),An.test(n)&&x(t,"tag suffix cannot contain flow indicator characters");}n&&!Di.test(n)&&x(t,"tag name cannot contain such characters: "+n);try{n=decodeURIComponent(n);}catch{x(t,"tag name is malformed: "+n);}return i?t.tag=n:at.call(t.tagMap,r)?t.tag=t.tagMap[r]+n:r==="!"?t.tag="!"+n:r==="!!"?t.tag="tag:yaml.org,2002:"+n:x(t,'undeclared tag handle "'+r+'"'),true}function Nn(t){var e,i;if(i=t.input.charCodeAt(t.position),i!==38)return false;for(t.anchor!==null&&x(t,"duplication of an anchor property"),i=t.input.charCodeAt(++t.position),e=t.position;i!==0&&!W(i)&&!wt(i);)i=t.input.charCodeAt(++t.position);return t.position===e&&x(t,"name of an anchor node must contain at least one character"),t.anchor=t.input.slice(e,t.position),true}function _n(t){var e,i,s;if(s=t.input.charCodeAt(t.position),s!==42)return false;for(s=t.input.charCodeAt(++t.position),e=t.position;s!==0&&!W(s)&&!wt(s);)s=t.input.charCodeAt(++t.position);return t.position===e&&x(t,"name of an alias node must contain at least one character"),i=t.input.slice(e,t.position),at.call(t.anchorMap,i)||x(t,'unidentified alias "'+i+'"'),t.result=t.anchorMap[i],O(t,true,-1),true}function St(t,e,i,s,r){var n,o,a,l=1,h=false,c=false,u,f,d,g,m,b;if(t.listener!==null&&t.listener("open",t),t.tag=null,t.anchor=null,t.kind=null,t.result=null,n=o=a=Jt===i||Ni===i,s&&O(t,true,-1)&&(h=true,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)),l===1)for(;Ln(t)||Nn(t);)O(t,true,-1)?(h=true,a=n,t.lineIndent>e?l=1:t.lineIndent===e?l=0:t.lineIndent<e&&(l=-1)):a=false;if(a&&(a=h||r),(l===1||Jt===i)&&(Ht===i||Li===i?m=e:m=e+1,b=t.position-t.lineStart,l===1?a&&(Ke(t,b)||In(t,b,m))||Mn(t,m)?c=true:(o&&Rn(t,m)||Pn(t,m)||$n(t,m)?c=true:_n(t)?(c=true,(t.tag!==null||t.anchor!==null)&&x(t,"alias node should not have any properties")):Fn(t,m,Ht===i)&&(c=true,t.tag===null&&(t.tag="?")),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):l===0&&(c=a&&Ke(t,b))),t.tag===null)t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);else if(t.tag==="?"){for(t.result!==null&&t.kind!=="scalar"&&x(t,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+t.kind+'"'),u=0,f=t.implicitTypes.length;u<f;u+=1)if(g=t.implicitTypes[u],g.resolve(t.result)){t.result=g.construct(t.result),t.tag=g.tag,t.anchor!==null&&(t.anchorMap[t.anchor]=t.result);break}}else if(t.tag!=="!"){if(at.call(t.typeMap[t.kind||"fallback"],t.tag))g=t.typeMap[t.kind||"fallback"][t.tag];else for(g=null,d=t.typeMap.multi[t.kind||"fallback"],u=0,f=d.length;u<f;u+=1)if(t.tag.slice(0,d[u].tag.length)===d[u].tag){g=d[u];break}g||x(t,"unknown tag !<"+t.tag+">"),t.result!==null&&g.kind!==t.kind&&x(t,"unacceptable node kind for !<"+t.tag+'> tag; it should be "'+g.kind+'", not "'+t.kind+'"'),g.resolve(t.result,t.tag)?(t.result=g.construct(t.result,t.tag),t.anchor!==null&&(t.anchorMap[t.anchor]=t.result)):x(t,"cannot resolve a node with !<"+t.tag+"> explicit tag");}return t.listener!==null&&t.listener("close",t),t.tag!==null||t.anchor!==null||c}function Dn(t){var e=t.position,i,s,r,n=false,o;for(t.version=null,t.checkLineBreaks=t.legacy,t.tagMap=Object.create(null),t.anchorMap=Object.create(null);(o=t.input.charCodeAt(t.position))!==0&&(O(t,true,-1),o=t.input.charCodeAt(t.position),!(t.lineIndent>0||o!==37));){for(n=true,o=t.input.charCodeAt(++t.position),i=t.position;o!==0&&!W(o);)o=t.input.charCodeAt(++t.position);for(s=t.input.slice(i,t.position),r=[],s.length<1&&x(t,"directive name must not be less than one character in length");o!==0;){for(;pt(o);)o=t.input.charCodeAt(++t.position);if(o===35){do o=t.input.charCodeAt(++t.position);while(o!==0&&!Q(o));break}if(Q(o))break;for(i=t.position;o!==0&&!W(o);)o=t.input.charCodeAt(++t.position);r.push(t.input.slice(i,t.position));}o!==0&&Le(t),at.call(Ve,s)?Ve[s](t,s,r):Xt(t,'unknown document directive "'+s+'"');}if(O(t,true,-1),t.lineIndent===0&&t.input.charCodeAt(t.position)===45&&t.input.charCodeAt(t.position+1)===45&&t.input.charCodeAt(t.position+2)===45?(t.position+=3,O(t,true,-1)):n&&x(t,"directives end mark is expected"),St(t,t.lineIndent-1,Jt,false,true),O(t,true,-1),t.checkLineBreaks&&kn.test(t.input.slice(e,t.position))&&Xt(t,"non-ASCII line breaks are interpreted as content"),t.documents.push(t.result),t.position===t.lineStart&&oe(t)){t.input.charCodeAt(t.position)===46&&(t.position+=3,O(t,true,-1));return}if(t.position<t.length-1)x(t,"end of the stream or a document separator is expected");else return}function Wn(t,e){t=String(t),e=e||{},t.length!==0&&(t.charCodeAt(t.length-1)!==10&&t.charCodeAt(t.length-1)!==13&&(t+=`
18
+ `),t.charCodeAt(0)===65279&&(t=t.slice(1)));var i=new jn(t,e),s=t.indexOf("\0");for(s!==-1&&(i.position=s,x(i,"null byte is not allowed in input")),i.input+="\0";i.input.charCodeAt(i.position)===32;)i.lineIndent+=1,i.position+=1;for(;i.position<i.length-1;)Dn(i);return i.documents}function zn(t,e){var i=Wn(t,e);if(i.length!==0){if(i.length===1)return i[0];throw new D("expected a single document in the stream, but found more")}}var Bn=zn,Un={load:Bn},Gi=Object.prototype.toString,Yi=Object.prototype.hasOwnProperty,_e=65279,Gn=9,It=10,Yn=13,qn=32,Vn=33,Zn=34,Oe=35,Kn=37,Hn=38,Jn=39,Xn=42,qi=44,Qn=45,Qt=58,to=61,eo=62,io=63,so=64,Vi=91,Zi=93,ro=96,Ki=123,no=124,Hi=125,R={};R[0]="\\0";R[7]="\\a";R[8]="\\b";R[9]="\\t";R[10]="\\n";R[11]="\\v";R[12]="\\f";R[13]="\\r";R[27]="\\e";R[34]='\\"';R[92]="\\\\";R[133]="\\N";R[160]="\\_";R[8232]="\\L";R[8233]="\\P";var oo=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ao=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lo(t,e){var i,s,r,n,o,a,l;if(e===null)return {};for(i={},s=Object.keys(e),r=0,n=s.length;r<n;r+=1)o=s[r],a=String(e[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=t.compiledTypeMap.fallback[o],l&&Yi.call(l.styleAliases,a)&&(a=l.styleAliases[a]),i[o]=a;return i}function ho(t){var e,i,s;if(e=t.toString(16).toUpperCase(),t<=255)i="x",s=2;else if(t<=65535)i="u",s=4;else if(t<=4294967295)i="U",s=8;else throw new D("code point within a string may not be greater than 0xFFFFFFFF");return "\\"+i+T.repeat("0",s-e.length)+e}var uo=1,Lt=2;function co(t){this.schema=t.schema||Ii,this.indent=Math.max(1,t.indent||2),this.noArrayIndent=t.noArrayIndent||false,this.skipInvalid=t.skipInvalid||false,this.flowLevel=T.isNothing(t.flowLevel)?-1:t.flowLevel,this.styleMap=lo(this.schema,t.styles||null),this.sortKeys=t.sortKeys||false,this.lineWidth=t.lineWidth||80,this.noRefs=t.noRefs||false,this.noCompatMode=t.noCompatMode||false,this.condenseFlow=t.condenseFlow||false,this.quotingType=t.quotingType==='"'?Lt:uo,this.forceQuotes=t.forceQuotes||false,this.replacer=typeof t.replacer=="function"?t.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null;}function He(t,e){for(var i=T.repeat(" ",e),s=0,r=-1,n="",o,a=t.length;s<a;)r=t.indexOf(`
19
+ `,s),r===-1?(o=t.slice(s),s=a):(o=t.slice(s,r+1),s=r+1),o.length&&o!==`
20
+ `&&(n+=i),n+=o;return n}function Te(t,e){return `
21
+ `+T.repeat(" ",t.indent*e)}function po(t,e){var i,s,r;for(i=0,s=t.implicitTypes.length;i<s;i+=1)if(r=t.implicitTypes[i],r.resolve(e))return true;return false}function te(t){return t===qn||t===Gn}function Nt(t){return 32<=t&&t<=126||161<=t&&t<=55295&&t!==8232&&t!==8233||57344<=t&&t<=65533&&t!==_e||65536<=t&&t<=1114111}function Je(t){return Nt(t)&&t!==_e&&t!==Yn&&t!==It}function Xe(t,e,i){var s=Je(t),r=s&&!te(t);return (i?s:s&&t!==qi&&t!==Vi&&t!==Zi&&t!==Ki&&t!==Hi)&&t!==Oe&&!(e===Qt&&!r)||Je(e)&&!te(e)&&t===Oe||e===Qt&&r}function fo(t){return Nt(t)&&t!==_e&&!te(t)&&t!==Qn&&t!==io&&t!==Qt&&t!==qi&&t!==Vi&&t!==Zi&&t!==Ki&&t!==Hi&&t!==Oe&&t!==Hn&&t!==Xn&&t!==Vn&&t!==no&&t!==to&&t!==eo&&t!==Jn&&t!==Zn&&t!==Kn&&t!==so&&t!==ro}function go(t){return !te(t)&&t!==Qt}function Tt(t,e){var i=t.charCodeAt(e),s;return i>=55296&&i<=56319&&e+1<t.length&&(s=t.charCodeAt(e+1),s>=56320&&s<=57343)?(i-55296)*1024+s-56320+65536:i}function Ji(t){var e=/^\n* /;return e.test(t)}var Xi=1,je=2,Qi=3,ts=4,mt=5;function mo(t,e,i,s,r,n,o,a){var l,h=0,c=null,u=false,f=false,d=s!==-1,g=-1,m=fo(Tt(t,0))&&go(Tt(t,t.length-1));if(e||o)for(l=0;l<t.length;h>=65536?l+=2:l++){if(h=Tt(t,l),!Nt(h))return mt;m=m&&Xe(h,c,a),c=h;}else {for(l=0;l<t.length;h>=65536?l+=2:l++){if(h=Tt(t,l),h===It)u=true,d&&(f=f||l-g-1>s&&t[g+1]!==" ",g=l);else if(!Nt(h))return mt;m=m&&Xe(h,c,a),c=h;}f=f||d&&l-g-1>s&&t[g+1]!==" ";}return !u&&!f?m&&!o&&!r(t)?Xi:n===Lt?mt:je:i>9&&Ji(t)?mt:o?n===Lt?mt:je:f?ts:Qi}function yo(t,e,i,s,r){t.dump=(function(){if(e.length===0)return t.quotingType===Lt?'""':"''";if(!t.noCompatMode&&(oo.indexOf(e)!==-1||ao.test(e)))return t.quotingType===Lt?'"'+e+'"':"'"+e+"'";var n=t.indent*Math.max(1,i),o=t.lineWidth===-1?-1:Math.max(Math.min(t.lineWidth,40),t.lineWidth-n),a=s||t.flowLevel>-1&&i>=t.flowLevel;function l(h){return po(t,h)}switch(mo(e,a,t.indent,o,l,t.quotingType,t.forceQuotes&&!s,r)){case Xi:return e;case je:return "'"+e.replace(/'/g,"''")+"'";case Qi:return "|"+Qe(e,t.indent)+ti(He(e,n));case ts:return ">"+Qe(e,t.indent)+ti(He(wo(e,o),n));case mt:return '"'+bo(e)+'"';default:throw new D("impossible error: invalid scalar style")}})();}function Qe(t,e){var i=Ji(t)?String(e):"",s=t[t.length-1]===`
22
+ `,r=s&&(t[t.length-2]===`
23
+ `||t===`
24
+ `),n=r?"+":s?"":"-";return i+n+`
25
+ `}function ti(t){return t[t.length-1]===`
26
+ `?t.slice(0,-1):t}function wo(t,e){for(var i=/(\n+)([^\n]*)/g,s=(function(){var h=t.indexOf(`
27
+ `);return h=h!==-1?h:t.length,i.lastIndex=h,ei(t.slice(0,h),e)})(),r=t[0]===`
28
+ `||t[0]===" ",n,o;o=i.exec(t);){var a=o[1],l=o[2];n=l[0]===" ",s+=a+(!r&&!n&&l!==""?`
29
+ `:"")+ei(l,e),r=n;}return s}function ei(t,e){if(t===""||t[0]===" ")return t;for(var i=/ [^ ]/g,s,r=0,n,o=0,a=0,l="";s=i.exec(t);)a=s.index,a-r>e&&(n=o>r?o:a,l+=`
30
+ `+t.slice(r,n),r=n+1),o=a;return l+=`
31
+ `,t.length-r>e&&o>r?l+=t.slice(r,o)+`
32
+ `+t.slice(o+1):l+=t.slice(r),l.slice(1)}function bo(t){for(var e="",i=0,s,r=0;r<t.length;i>=65536?r+=2:r++)i=Tt(t,r),s=R[i],!s&&Nt(i)?(e+=t[r],i>=65536&&(e+=t[r+1])):e+=s||ho(i);return e}function vo(t,e,i){var s="",r=t.tag,n,o,a;for(n=0,o=i.length;n<o;n+=1)a=i[n],t.replacer&&(a=t.replacer.call(i,String(n),a)),(it(t,e,a,false,false)||typeof a>"u"&&it(t,e,null,false,false))&&(s!==""&&(s+=","+(t.condenseFlow?"":" ")),s+=t.dump);t.tag=r,t.dump="["+s+"]";}function ii(t,e,i,s){var r="",n=t.tag,o,a,l;for(o=0,a=i.length;o<a;o+=1)l=i[o],t.replacer&&(l=t.replacer.call(i,String(o),l)),(it(t,e+1,l,true,true,false,true)||typeof l>"u"&&it(t,e+1,null,true,true,false,true))&&((!s||r!=="")&&(r+=Te(t,e)),t.dump&&It===t.dump.charCodeAt(0)?r+="-":r+="- ",r+=t.dump);t.tag=n,t.dump=r||"[]";}function So(t,e,i){var s="",r=t.tag,n=Object.keys(i),o,a,l,h,c;for(o=0,a=n.length;o<a;o+=1)c="",s!==""&&(c+=", "),t.condenseFlow&&(c+='"'),l=n[o],h=i[l],t.replacer&&(h=t.replacer.call(i,l,h)),it(t,e,l,false,false)&&(t.dump.length>1024&&(c+="? "),c+=t.dump+(t.condenseFlow?'"':"")+":"+(t.condenseFlow?"":" "),it(t,e,h,false,false)&&(c+=t.dump,s+=c));t.tag=r,t.dump="{"+s+"}";}function xo(t,e,i,s){var r="",n=t.tag,o=Object.keys(i),a,l,h,c,u,f;if(t.sortKeys===true)o.sort();else if(typeof t.sortKeys=="function")o.sort(t.sortKeys);else if(t.sortKeys)throw new D("sortKeys must be a boolean or a function");for(a=0,l=o.length;a<l;a+=1)f="",(!s||r!=="")&&(f+=Te(t,e)),h=o[a],c=i[h],t.replacer&&(c=t.replacer.call(i,h,c)),it(t,e+1,h,true,true,true)&&(u=t.tag!==null&&t.tag!=="?"||t.dump&&t.dump.length>1024,u&&(t.dump&&It===t.dump.charCodeAt(0)?f+="?":f+="? "),f+=t.dump,u&&(f+=Te(t,e)),it(t,e+1,c,true,u)&&(t.dump&&It===t.dump.charCodeAt(0)?f+=":":f+=": ",f+=t.dump,r+=f));t.tag=n,t.dump=r||"{}";}function si(t,e,i){var s,r,n,o,a,l;for(r=i?t.explicitTypes:t.implicitTypes,n=0,o=r.length;n<o;n+=1)if(a=r[n],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof e=="object"&&e instanceof a.instanceOf)&&(!a.predicate||a.predicate(e))){if(i?a.multi&&a.representName?t.tag=a.representName(e):t.tag=a.tag:t.tag="?",a.represent){if(l=t.styleMap[a.tag]||a.defaultStyle,Gi.call(a.represent)==="[object Function]")s=a.represent(e,l);else if(Yi.call(a.represent,l))s=a.represent[l](e,l);else throw new D("!<"+a.tag+'> tag resolver accepts not "'+l+'" style');t.dump=s;}return true}return false}function it(t,e,i,s,r,n,o){t.tag=null,t.dump=i,si(t,i,false)||si(t,i,true);var a=Gi.call(t.dump),l=s,h;s&&(s=t.flowLevel<0||t.flowLevel>e);var c=a==="[object Object]"||a==="[object Array]",u,f;if(c&&(u=t.duplicates.indexOf(i),f=u!==-1),(t.tag!==null&&t.tag!=="?"||f||t.indent!==2&&e>0)&&(r=false),f&&t.usedDuplicates[u])t.dump="*ref_"+u;else {if(c&&f&&!t.usedDuplicates[u]&&(t.usedDuplicates[u]=true),a==="[object Object]")s&&Object.keys(t.dump).length!==0?(xo(t,e,t.dump,r),f&&(t.dump="&ref_"+u+t.dump)):(So(t,e,t.dump),f&&(t.dump="&ref_"+u+" "+t.dump));else if(a==="[object Array]")s&&t.dump.length!==0?(t.noArrayIndent&&!o&&e>0?ii(t,e-1,t.dump,r):ii(t,e,t.dump,r),f&&(t.dump="&ref_"+u+t.dump)):(vo(t,e,t.dump),f&&(t.dump="&ref_"+u+" "+t.dump));else if(a==="[object String]")t.tag!=="?"&&yo(t,t.dump,e,n,l);else {if(a==="[object Undefined]"||t.skipInvalid)return false;throw new D("unacceptable kind of an object to dump "+a)}t.tag!==null&&t.tag!=="?"&&(h=encodeURI(t.tag[0]==="!"?t.tag.slice(1):t.tag).replace(/!/g,"%21"),t.tag[0]==="!"?h="!"+h:h.slice(0,18)==="tag:yaml.org,2002:"?h="!!"+h.slice(18):h="!<"+h+">",t.dump=h+" "+t.dump);}return true}function ko(t,e){var i=[],s=[],r,n;for(Fe(t,i,s),r=0,n=s.length;r<n;r+=1)e.duplicates.push(i[s[r]]);e.usedDuplicates=new Array(n);}function Fe(t,e,i){var s,r,n;if(t!==null&&typeof t=="object")if(r=e.indexOf(t),r!==-1)i.indexOf(r)===-1&&i.push(r);else if(e.push(t),Array.isArray(t))for(r=0,n=t.length;r<n;r+=1)Fe(t[r],e,i);else for(s=Object.keys(t),r=0,n=s.length;r<n;r+=1)Fe(t[s[r]],e,i);}function Ao(t,e){e=e||{};var i=new co(e);i.noRefs||ko(t,i);var s=t;return i.replacer&&(s=i.replacer.call({"":s},"",s)),it(i,0,s,true,true)?i.dump+`
33
+ `:""}var Co=Ao,Eo={dump:Co},ae=Un.load,Oo=Eo.dump,es=(t,e,i)=>{let s=t instanceof RegExp?ri(t,i):t,r=e instanceof RegExp?ri(e,i):e,n=s!==null&&r!=null&&To(s,r,i);return n&&{start:n[0],end:n[1],pre:i.slice(0,n[0]),body:i.slice(n[0]+s.length,n[1]),post:i.slice(n[1]+r.length)}},ri=(t,e)=>{let i=e.match(t);return i?i[0]:null},To=(t,e,i)=>{let s,r,n,o,a,l=i.indexOf(t),h=i.indexOf(e,l+1),c=l;if(l>=0&&h>0){if(t===e)return [l,h];for(s=[],n=i.length;c>=0&&!a;){if(c===l)s.push(c),l=i.indexOf(t,c+1);else if(s.length===1){let u=s.pop();u!==void 0&&(a=[u,h]);}else r=s.pop(),r!==void 0&&r<n&&(n=r,o=h),h=i.indexOf(e,c+1);c=l<h&&l>=0?l:h;}s.length&&o!==void 0&&(a=[n,o]);}return a},is="\0SLASH"+Math.random()+"\0",ss="\0OPEN"+Math.random()+"\0",De="\0CLOSE"+Math.random()+"\0",rs="\0COMMA"+Math.random()+"\0",ns="\0PERIOD"+Math.random()+"\0",jo=new RegExp(is,"g"),Fo=new RegExp(ss,"g"),Po=new RegExp(De,"g"),$o=new RegExp(rs,"g"),Mo=new RegExp(ns,"g"),Ro=/\\\\/g,Io=/\\{/g,Lo=/\\}/g,No=/\\,/g,_o=/\\./g,Do=1e5;function ge(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function Wo(t){return t.replace(Ro,is).replace(Io,ss).replace(Lo,De).replace(No,rs).replace(_o,ns)}function zo(t){return t.replace(jo,"\\").replace(Fo,"{").replace(Po,"}").replace($o,",").replace(Mo,".")}function os(t){if(!t)return [""];let e=[],i=es("{","}",t);if(!i)return t.split(",");let{pre:s,body:r,post:n}=i,o=s.split(",");o[o.length-1]+="{"+r+"}";let a=os(n);return n.length&&(o[o.length-1]+=a.shift(),o.push.apply(o,a)),e.push.apply(e,o),e}function Bo(t,e={}){if(!t)return [];let{max:i=Do}=e;return t.slice(0,2)==="{}"&&(t="\\{\\}"+t.slice(2)),jt(Wo(t),i,true).map(zo)}function Uo(t){return "{"+t+"}"}function Go(t){return /^-?0\d/.test(t)}function Yo(t,e){return t<=e}function qo(t,e){return t>=e}function jt(t,e,i){let s=[],r=es("{","}",t);if(!r)return [t];let n=r.pre,o=r.post.length?jt(r.post,e,false):[""];if(/\$$/.test(r.pre))for(let a=0;a<o.length&&a<e;a++){let l=n+"{"+r.body+"}"+o[a];s.push(l);}else {let a=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(r.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(r.body),h=a||l,c=r.body.indexOf(",")>=0;if(!h&&!c)return r.post.match(/,(?!,).*\}/)?(t=r.pre+"{"+r.body+De+r.post,jt(t,e,true)):[t];let u;if(h)u=r.body.split(/\.\./);else if(u=os(r.body),u.length===1&&u[0]!==void 0&&(u=jt(u[0],e,false).map(Uo),u.length===1))return o.map(d=>r.pre+u[0]+d);let f;if(h&&u[0]!==void 0&&u[1]!==void 0){let d=ge(u[0]),g=ge(u[1]),m=Math.max(u[0].length,u[1].length),b=u.length===3&&u[2]!==void 0?Math.abs(ge(u[2])):1,v=Yo;g<d&&(b*=-1,v=qo);let y=u.some(Go);f=[];for(let k=d;v(k,g);k+=b){let w;if(l)w=String.fromCharCode(k),w==="\\"&&(w="");else if(w=String(k),y){let S=m-w.length;if(S>0){let C=new Array(S+1).join("0");k<0?w="-"+C+w.slice(1):w=C+w;}}f.push(w);}}else {f=[];for(let d=0;d<u.length;d++)f.push.apply(f,jt(u[d],e,false));}for(let d=0;d<f.length;d++)for(let g=0;g<o.length&&s.length<e;g++){let m=n+f[d]+o[g];(!i||h||m)&&s.push(m);}}return s}var ee=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")},Vo={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x00-\\x7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]},xt=t=>t.replace(/[[\]\\-]/g,"\\$&"),Zo=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),ni=t=>t.join(""),Ko=(t,e)=>{let i=e;if(t.charAt(i)!=="[")throw new Error("not in a brace expression");let s=[],r=[],n=i+1,o=false,a=false,l=false,h=false,c=i,u="";t:for(;n<t.length;){let g=t.charAt(n);if((g==="!"||g==="^")&&n===i+1){h=true,n++;continue}if(g==="]"&&o&&!l){c=n+1;break}if(o=true,g==="\\"&&!l){l=true,n++;continue}if(g==="["&&!l){for(let[m,[b,v,y]]of Object.entries(Vo))if(t.startsWith(m,n)){if(u)return ["$.",false,t.length-i,true];n+=m.length,y?r.push(b):s.push(b),a=a||v;continue t}}if(l=false,u){g>u?s.push(xt(u)+"-"+xt(g)):g===u&&s.push(xt(g)),u="",n++;continue}if(t.startsWith("-]",n+1)){s.push(xt(g+"-")),n+=2;continue}if(t.startsWith("-",n+1)){u=g,n+=2;continue}s.push(xt(g)),n++;}if(c<n)return ["",false,0,false];if(!s.length&&!r.length)return ["$.",false,t.length-i,true];if(r.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!h){let g=s[0].length===2?s[0].slice(-1):s[0];return [Zo(g),false,c-i,false]}let f="["+(h?"^":"")+ni(s)+"]",d="["+(h?"":"^")+ni(r)+"]";return [s.length&&r.length?"("+f+"|"+d+")":s.length?f:d,a,c-i,true]},vt=(t,{windowsPathsNoEscape:e=false,magicalBraces:i=true}={})=>i?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),Ho=new Set(["!","?","+","*","@"]),oi=t=>Ho.has(t),Jo="(?!(?:^|/)\\.\\.?(?:$|/))",Wt="(?!\\.)",Xo=new Set(["[","."]),Qo=new Set(["..","."]),ta=new Set("().*{}+?[]^$\\!"),ea=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),We="[^/]",ai=We+"*?",li=We+"+?",as=class U{type;#t;#i;#n=false;#r=[];#o;#v;#y;#u=false;#a;#p;#c=false;constructor(e,i,s={}){this.type=e,e&&(this.#i=true),this.#o=i,this.#t=this.#o?this.#o.#t:this,this.#a=this.#t===this?s:this.#t.#a,this.#y=this.#t===this?[]:this.#t.#y,e==="!"&&!this.#t.#u&&this.#y.push(this),this.#v=this.#o?this.#o.#r.length:0;}get hasMagic(){if(this.#i!==void 0)return this.#i;for(let e of this.#r)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#i=true;return this.#i}toString(){return this.#p!==void 0?this.#p:this.type?this.#p=this.type+"("+this.#r.map(e=>String(e)).join("|")+")":this.#p=this.#r.map(e=>String(e)).join("")}#l(){if(this!==this.#t)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=true;let e;for(;e=this.#y.pop();){if(e.type!=="!")continue;let i=e,s=i.#o;for(;s;){for(let r=i.#v+1;!s.type&&r<s.#r.length;r++)for(let n of e.#r){if(typeof n=="string")throw new Error("string part in extglob AST??");n.copyIn(s.#r[r]);}i=s,s=i.#o;}}return this}push(...e){for(let i of e)if(i!==""){if(typeof i!="string"&&!(i instanceof U&&i.#o===this))throw new Error("invalid part: "+i);this.#r.push(i);}}toJSON(){let e=this.type===null?this.#r.slice().map(i=>typeof i=="string"?i:i.toJSON()):[this.type,...this.#r.map(i=>i.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#u&&this.#o?.type==="!")&&e.push({}),e}isStart(){if(this.#t===this)return true;if(!this.#o?.isStart())return false;if(this.#v===0)return true;let e=this.#o;for(let i=0;i<this.#v;i++){let s=e.#r[i];if(!(s instanceof U&&s.type==="!"))return false}return true}isEnd(){if(this.#t===this||this.#o?.type==="!")return true;if(!this.#o?.isEnd())return false;if(!this.type)return this.#o?.isEnd();let e=this.#o?this.#o.#r.length:0;return this.#v===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this));}clone(e){let i=new U(this.type,e);for(let s of this.#r)i.copyIn(s);return i}static#s(e,i,s,r){let n=false,o=false,a=-1,l=false;if(i.type===null){let d=s,g="";for(;d<e.length;){let m=e.charAt(d++);if(n||m==="\\"){n=!n,g+=m;continue}if(o){d===a+1?(m==="^"||m==="!")&&(l=true):m==="]"&&!(d===a+2&&l)&&(o=false),g+=m;continue}else if(m==="["){o=true,a=d,l=false,g+=m;continue}if(!r.noext&&oi(m)&&e.charAt(d)==="("){i.push(g),g="";let b=new U(m,i);d=U.#s(e,b,d,r),i.push(b);continue}g+=m;}return i.push(g),d}let h=s+1,c=new U(null,i),u=[],f="";for(;h<e.length;){let d=e.charAt(h++);if(n||d==="\\"){n=!n,f+=d;continue}if(o){h===a+1?(d==="^"||d==="!")&&(l=true):d==="]"&&!(h===a+2&&l)&&(o=false),f+=d;continue}else if(d==="["){o=true,a=h,l=false,f+=d;continue}if(oi(d)&&e.charAt(h)==="("){c.push(f),f="";let g=new U(d,c);c.push(g),h=U.#s(e,g,h,r);continue}if(d==="|"){c.push(f),f="",u.push(c),c=new U(null,i);continue}if(d===")")return f===""&&i.#r.length===0&&(i.#c=true),c.push(f),f="",i.push(...u,c),h;f+=d;}return i.type=null,i.#i=void 0,i.#r=[e.substring(s-1)],h}static fromGlob(e,i={}){let s=new U(null,void 0,i);return U.#s(e,s,0,i),s}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();let e=this.toString(),[i,s,r,n]=this.toRegExpSource();if(!(r||this.#i||this.#a.nocase&&!this.#a.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return s;let o=(this.#a.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${i}$`,o),{_src:i,_glob:e})}get options(){return this.#a}toRegExpSource(e){let i=e??!!this.#a.dot;if(this.#t===this&&this.#l(),!this.type){let l=this.isStart()&&this.isEnd()&&!this.#r.some(f=>typeof f!="string"),h=this.#r.map(f=>{let[d,g,m,b]=typeof f=="string"?U.#S(f,this.#i,l):f.toRegExpSource(e);return this.#i=this.#i||m,this.#n=this.#n||b,d}).join(""),c="";if(this.isStart()&&typeof this.#r[0]=="string"&&!(this.#r.length===1&&Qo.has(this.#r[0]))){let f=Xo,d=i&&f.has(h.charAt(0))||h.startsWith("\\.")&&f.has(h.charAt(2))||h.startsWith("\\.\\.")&&f.has(h.charAt(4)),g=!i&&!e&&f.has(h.charAt(0));c=d?Jo:g?Wt:"";}let u="";return this.isEnd()&&this.#t.#u&&this.#o?.type==="!"&&(u="(?:$|\\/)"),[c+h+u,vt(h),this.#i=!!this.#i,this.#n]}let s=this.type==="*"||this.type==="+",r=this.type==="!"?"(?:(?!(?:":"(?:",n=this.#f(i);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){let l=this.toString();return this.#r=[l],this.type=null,this.#i=void 0,[l,vt(this.toString()),false,false]}let o=!s||e||i||!Wt?"":this.#f(true);o===n&&(o=""),o&&(n=`(?:${n})(?:${o})*?`);let a="";if(this.type==="!"&&this.#c)a=(this.isStart()&&!i?Wt:"")+li;else {let l=this.type==="!"?"))"+(this.isStart()&&!i&&!e?Wt:"")+ai+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=r+n+l;}return [a,vt(n),this.#i=!!this.#i,this.#n]}#f(e){return this.#r.map(i=>{if(typeof i=="string")throw new Error("string type in extglob ast??");let[s,r,n,o]=i.toRegExpSource(e);return this.#n=this.#n||o,s}).filter(i=>!(this.isStart()&&this.isEnd())||!!i).join("|")}static#S(e,i,s=false){let r=false,n="",o=false,a=false;for(let l=0;l<e.length;l++){let h=e.charAt(l);if(r){r=false,n+=(ta.has(h)?"\\":"")+h;continue}if(h==="*"){if(a)continue;a=true,n+=s&&/^[*]+$/.test(e)?li:ai,i=true;continue}else a=false;if(h==="\\"){l===e.length-1?n+="\\\\":r=true;continue}if(h==="["){let[c,u,f,d]=Ko(e,l);if(f){n+=c,o=o||u,l+=f-1,i=i||d;continue}}if(h==="?"){n+=We,i=true;continue}n+=ea(h);}return [n,vt(e),!!i,o]}},ls=(t,{windowsPathsNoEscape:e=false,magicalBraces:i=false}={})=>i?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),N=(t,e,i={})=>(ee(e),!i.nocomment&&e.charAt(0)==="#"?false:new lt(e,i).match(t)),ia=/^\*+([^+@!?\*\[\(]*)$/,sa=t=>e=>!e.startsWith(".")&&e.endsWith(t),ra=t=>e=>e.endsWith(t),na=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),oa=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),aa=/^\*+\.\*+$/,la=t=>!t.startsWith(".")&&t.includes("."),ha=t=>t!=="."&&t!==".."&&t.includes("."),ua=/^\.\*+$/,ca=t=>t!=="."&&t!==".."&&t.startsWith("."),pa=/^\*+$/,fa=t=>t.length!==0&&!t.startsWith("."),da=t=>t.length!==0&&t!=="."&&t!=="..",ga=/^\?+([^+@!?\*\[\(]*)?$/,ma=([t,e=""])=>{let i=hs([t]);return e?(e=e.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(e)):i},ya=([t,e=""])=>{let i=us([t]);return e?(e=e.toLowerCase(),s=>i(s)&&s.toLowerCase().endsWith(e)):i},wa=([t,e=""])=>{let i=us([t]);return e?s=>i(s)&&s.endsWith(e):i},ba=([t,e=""])=>{let i=hs([t]);return e?s=>i(s)&&s.endsWith(e):i},hs=([t])=>{let e=t.length;return i=>i.length===e&&!i.startsWith(".")},us=([t])=>{let e=t.length;return i=>i.length===e&&i!=="."&&i!==".."},cs=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",hi={win32:{sep:"\\"},posix:{sep:"/"}},va=cs==="win32"?hi.win32.sep:hi.posix.sep;N.sep=va;var L=Symbol("globstar **");N.GLOBSTAR=L;var Sa="[^/]",xa=Sa+"*?",ka="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",Aa="(?:(?!(?:\\/|^)\\.).)*?",Ca=(t,e={})=>i=>N(i,t,e);N.filter=Ca;var Y=(t,e={})=>Object.assign({},t,e),Ea=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return N;let e=N;return Object.assign((i,s,r={})=>e(i,s,Y(t,r)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,Y(t,s));}static defaults(i){return e.defaults(Y(t,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,r={}){super(i,s,Y(t,r));}static fromGlob(i,s={}){return e.AST.fromGlob(i,Y(t,s))}},unescape:(i,s={})=>e.unescape(i,Y(t,s)),escape:(i,s={})=>e.escape(i,Y(t,s)),filter:(i,s={})=>e.filter(i,Y(t,s)),defaults:i=>e.defaults(Y(t,i)),makeRe:(i,s={})=>e.makeRe(i,Y(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,Y(t,s)),match:(i,s,r={})=>e.match(i,s,Y(t,r)),sep:e.sep,GLOBSTAR:L})};N.defaults=Ea;var ps=(t,e={})=>(ee(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:Bo(t,{max:e.braceExpandMax}));N.braceExpand=ps;var Oa=(t,e={})=>new lt(t,e).makeRe();N.makeRe=Oa;var Ta=(t,e,i={})=>{let s=new lt(e,i);return t=t.filter(r=>s.match(r)),s.options.nonull&&!t.length&&t.push(e),t};N.match=Ta;var ui=/[?*]|[+@!]\(.*?\)|\[|\]/,ja=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),lt=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){ee(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||cs,this.isWindows=this.platform==="win32";let i="allowWindowsEscape";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e[i]===false,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=false,this.nonegate=!!e.nonegate,this.comment=false,this.empty=false,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=e.windowsNoMagicRoot!==void 0?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make();}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return true;for(let t of this.set)for(let e of t)if(typeof e!="string")return true;return false}debug(...t){}make(){let t=this.pattern,e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...r)=>console.error(...r)),this.debug(this.pattern,this.globSet);let i=this.globSet.map(r=>this.slashSplit(r));this.globParts=this.preprocess(i),this.debug(this.pattern,this.globParts);let s=this.globParts.map((r,n,o)=>{if(this.isWindows&&this.windowsNoMagicRoot){let a=r[0]===""&&r[1]===""&&(r[2]==="?"||!ui.test(r[2]))&&!ui.test(r[3]),l=/^[a-z]:/i.test(r[0]);if(a)return [...r.slice(0,4),...r.slice(4).map(h=>this.parse(h))];if(l)return [r[0],...r.slice(1).map(h=>this.parse(h))]}return r.map(a=>this.parse(a))});if(this.debug(this.pattern,s),this.set=s.filter(r=>r.indexOf(false)===-1),this.isWindows)for(let r=0;r<this.set.length;r++){let n=this.set[r];n[0]===""&&n[1]===""&&this.globParts[r][2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3])&&(n[2]="?");}this.debug(this.pattern,this.set);}preprocess(t){if(this.options.noglobstar)for(let i=0;i<t.length;i++)for(let s=0;s<t[i].length;s++)t[i][s]==="**"&&(t[i][s]="*");let{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):e>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(e=>{let i=-1;for(;(i=e.indexOf("**",i+1))!==-1;){let s=i;for(;e[s+1]==="**";)s++;s!==i&&e.splice(i,s-i);}return e})}levelOneOptimize(t){return t.map(e=>(e=e.reduce((i,s)=>{let r=i[i.length-1];return s==="**"&&r==="**"?i:s===".."&&r&&r!==".."&&r!=="."&&r!=="**"?(i.pop(),i):(i.push(s),i)},[]),e.length===0?[""]:e))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=false;do{if(e=false,!this.preserveMultipleSlashes){for(let s=1;s<t.length-1;s++){let r=t[s];s===1&&r===""&&t[0]===""||(r==="."||r==="")&&(e=true,t.splice(s,1),s--);}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(e=true,t.pop());}let i=0;for(;(i=t.indexOf("..",i+1))!==-1;){let s=t[i-1];s&&s!=="."&&s!==".."&&s!=="**"&&(e=true,t.splice(i-1,2),i-=2);}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let i of t){let s=-1;for(;(s=i.indexOf("**",s+1))!==-1;){let n=s;for(;i[n+1]==="**";)n++;n>s&&i.splice(s+1,n-s);let o=i[s+1],a=i[s+2],l=i[s+3];if(o!==".."||!a||a==="."||a===".."||!l||l==="."||l==="..")continue;e=true,i.splice(s,1);let h=i.slice(0);h[s]="**",t.push(h),s--;}if(!this.preserveMultipleSlashes){for(let n=1;n<i.length-1;n++){let o=i[n];n===1&&o===""&&i[0]===""||(o==="."||o==="")&&(e=true,i.splice(n,1),n--);}i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")&&(e=true,i.pop());}let r=0;for(;(r=i.indexOf("..",r+1))!==-1;){let n=i[r-1];if(n&&n!=="."&&n!==".."&&n!=="**"){e=true;let o=r===1&&i[r+1]==="**"?["."]:[];i.splice(r-1,2,...o),i.length===0&&i.push(""),r-=2;}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let i=e+1;i<t.length;i++){let s=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(s){t[e]=[],t[i]=s;break}}return t.filter(e=>e.length)}partsMatch(t,e,i=false){let s=0,r=0,n=[],o="";for(;s<t.length&&r<e.length;)if(t[s]===e[r])n.push(o==="b"?e[r]:t[s]),s++,r++;else if(i&&t[s]==="**"&&e[r]===t[s+1])n.push(t[s]),s++;else if(i&&e[r]==="**"&&t[s]===e[r+1])n.push(e[r]),r++;else if(t[s]==="*"&&e[r]&&(this.options.dot||!e[r].startsWith("."))&&e[r]!=="**"){if(o==="b")return false;o="a",n.push(t[s]),s++,r++;}else if(e[r]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(o==="a")return false;o="b",n.push(e[r]),s++,r++;}else return false;return t.length===e.length&&n}parseNegate(){if(this.nonegate)return;let t=this.pattern,e=false,i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++)e=!e,i++;i&&(this.pattern=t.slice(i)),this.negate=e;}matchOne(t,e,i=false){let s=this.options;if(this.isWindows){let g=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),m=!g&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),b=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),v=!b&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]=="string"&&/^[a-z]:$/i.test(e[3]),y=m?3:g?0:void 0,k=v?3:b?0:void 0;if(typeof y=="number"&&typeof k=="number"){let[w,S]=[t[y],e[k]];w.toLowerCase()===S.toLowerCase()&&(e[k]=w,k>y?e=e.slice(k):y>k&&(t=t.slice(y)));}}let{optimizationLevel:r=1}=this.options;r>=2&&(t=this.levelTwoFileOptimize(t)),this.debug("matchOne",this,{file:t,pattern:e}),this.debug("matchOne",t.length,e.length);for(var n=0,o=0,a=t.length,l=e.length;n<a&&o<l;n++,o++){this.debug("matchOne loop");var h=e[o],c=t[n];if(this.debug(e,h,c),h===false)return false;if(h===L){this.debug("GLOBSTAR",[e,h,c]);var u=n,f=o+1;if(f===l){for(this.debug("** at the end");n<a;n++)if(t[n]==="."||t[n]===".."||!s.dot&&t[n].charAt(0)===".")return false;return true}for(;u<a;){var d=t[u];if(this.debug(`
34
+ globstar while`,t,u,e,f,d),this.matchOne(t.slice(u),e.slice(f),i))return this.debug("globstar found match!",u,a,d),true;if(d==="."||d===".."||!s.dot&&d.charAt(0)==="."){this.debug("dot detected!",t,u,e,f);break}this.debug("globstar swallow a segment, and continue"),u++;}return !!(i&&(this.debug(`
35
+ >>> no match, partial?`,t,u,e,f),u===a))}let g;if(typeof h=="string"?(g=c===h,this.debug("string match",h,c,g)):(g=h.test(c),this.debug("pattern match",h,c,g)),!g)return false}if(n===a&&o===l)return true;if(n===a)return i;if(o===l)return n===a-1&&t[n]==="";throw new Error("wtf?")}braceExpand(){return ps(this.pattern,this.options)}parse(t){ee(t);let e=this.options;if(t==="**")return L;if(t==="")return "";let i,s=null;(i=t.match(pa))?s=e.dot?da:fa:(i=t.match(ia))?s=(e.nocase?e.dot?oa:na:e.dot?ra:sa)(i[1]):(i=t.match(ga))?s=(e.nocase?e.dot?ya:ma:e.dot?wa:ba)(i):(i=t.match(aa))?s=e.dot?ha:la:(i=t.match(ua))&&(s=ca);let r=as.fromGlob(t,this.options).toMMPattern();return s&&typeof r=="object"&&Reflect.defineProperty(r,"test",{value:s}),r}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;let t=this.set;if(!t.length)return this.regexp=false,this.regexp;let e=this.options,i=e.noglobstar?xa:e.dot?ka:Aa,s=new Set(e.nocase?["i"]:[]),r=t.map(a=>{let l=a.map(c=>{if(c instanceof RegExp)for(let u of c.flags.split(""))s.add(u);return typeof c=="string"?ja(c):c===L?L:c._src});l.forEach((c,u)=>{let f=l[u+1],d=l[u-1];c!==L||d===L||(d===void 0?f!==void 0&&f!==L?l[u+1]="(?:\\/|"+i+"\\/)?"+f:l[u]=i:f===void 0?l[u-1]=d+"(?:\\/|\\/"+i+")?":f!==L&&(l[u-1]=d+"(?:\\/|\\/"+i+"\\/)"+f,l[u+1]=L));});let h=l.filter(c=>c!==L);if(this.partial&&h.length>=1){let c=[];for(let u=1;u<=h.length;u++)c.push(h.slice(0,u).join("/"));return "(?:"+c.join("|")+")"}return h.join("/")}).join("|"),[n,o]=t.length>1?["(?:",")"]:["",""];r="^"+n+r+o+"$",this.partial&&(r="^(?:\\/|"+n+r.slice(1,-1)+o+")$"),this.negate&&(r="^(?!"+r+").+$");try{this.regexp=new RegExp(r,[...s].join(""));}catch{this.regexp=false;}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return false;if(this.empty)return t==="";if(t==="/"&&e)return true;let i=this.options;this.isWindows&&(t=t.split("\\").join("/"));let s=this.slashSplit(t);this.debug(this.pattern,"split",s);let r=this.set;this.debug(this.pattern,"set",r);let n=s[s.length-1];if(!n)for(let o=s.length-2;!n&&o>=0;o--)n=s[o];for(let o=0;o<r.length;o++){let a=r[o],l=s;if(i.matchBase&&a.length===1&&(l=[n]),this.matchOne(l,a,e))return i.flipNegate?true:!this.negate}return i.flipNegate?false:this.negate}static defaults(t){return N.defaults(t).Minimatch}};N.AST=as;N.Minimatch=lt;N.escape=ls;N.unescape=vt;var Fa=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,fs=new Set,Pe=typeof process=="object"&&process?process:{},ds=(t,e,i,s)=>{typeof Pe.emitWarning=="function"?Pe.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`);},ie=globalThis.AbortController,ci=globalThis.AbortSignal;if(typeof ie>"u"){ci=class{onabort;_onabort=[];reason;aborted=false;addEventListener(i,s){this._onabort.push(s);}},ie=class{constructor(){e();}signal=new ci;abort(i){if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=true;for(let s of this.signal._onabort)s(i);this.signal.onabort?.(i);}}};let t=Pe.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=false,ds("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var Pa=t=>!fs.has(t),nt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),gs=t=>nt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Zt:null:null,Zt=class extends Array{constructor(t){super(t),this.fill(0);}},$a=class Ft{heap;length;static#t=false;static create(e){let i=gs(e);if(!i)return [];Ft.#t=true;let s=new Ft(e,i);return Ft.#t=false,s}constructor(e,i){if(!Ft.#t)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new i(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},le=class ms{#t;#i;#n;#r;#o;#v;#y;#u;get perf(){return this.#u}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#p;#c;#l;#s;#f;#S;#b;#d;#T;#g;#A;#C;#m;#w;#x;#E;#e;#R;static unsafeExposeInternals(e){return {starts:e.#C,ttls:e.#m,autopurgeTimers:e.#w,sizes:e.#A,keyMap:e.#c,keyList:e.#l,valList:e.#s,next:e.#f,prev:e.#S,get head(){return e.#b},get tail(){return e.#d},free:e.#T,isBackgroundFetch:i=>e.#h(i),backgroundFetch:(i,s,r,n)=>e.#B(i,s,r,n),moveToTail:i=>e.#L(i),indexes:i=>e.#F(i),rindexes:i=>e.#P(i),isStale:i=>e.#k(i)}}get max(){return this.#t}get maxSize(){return this.#i}get calculatedSize(){return this.#p}get size(){return this.#a}get fetchMethod(){return this.#v}get memoMethod(){return this.#y}get dispose(){return this.#n}get onInsert(){return this.#r}get disposeAfter(){return this.#o}constructor(e){let{max:i=0,ttl:s,ttlResolution:r=1,ttlAutopurge:n,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:h,onInsert:c,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:d,maxSize:g=0,maxEntrySize:m=0,sizeCalculation:b,fetchMethod:v,memoMethod:y,noDeleteOnFetchRejection:k,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:C,ignoreFetchAbort:G,perf:st}=e;if(st!==void 0&&typeof st?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#u=st??Fa,i!==0&&!nt(i))throw new TypeError("max option must be a nonnegative integer");let dt=i?gs(i):Array;if(!dt)throw new Error("invalid max value: "+i);if(this.#t=i,this.#i=g,this.maxEntrySize=m||this.#i,this.sizeCalculation=b,this.sizeCalculation){if(!this.#i&&!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(y!==void 0&&typeof y!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#y=y,v!==void 0&&typeof v!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#v=v,this.#E=!!v,this.#c=new Map,this.#l=new Array(i).fill(void 0),this.#s=new Array(i).fill(void 0),this.#f=new dt(i),this.#S=new dt(i),this.#b=0,this.#d=0,this.#T=$a.create(i),this.#a=0,this.#p=0,typeof h=="function"&&(this.#n=h),typeof c=="function"&&(this.#r=c),typeof u=="function"?(this.#o=u,this.#g=[]):(this.#o=void 0,this.#g=void 0),this.#x=!!this.#n,this.#R=!!this.#r,this.#e=!!this.#o,this.noDisposeOnSet=!!f,this.noUpdateTTL=!!d,this.noDeleteOnFetchRejection=!!k,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!C,this.ignoreFetchAbort=!!G,this.maxEntrySize!==0){if(this.#i!==0&&!nt(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!nt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#G();}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!w,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=nt(r)||r===0?r:1,this.ttlAutopurge=!!n,this.ttl=s||0,this.ttl){if(!nt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$();}if(this.#t===0&&this.ttl===0&&this.#i===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#i){let ce="LRU_CACHE_UNBOUNDED";Pa(ce)&&(fs.add(ce),ds("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ce,ms));}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#$(){let e=new Zt(this.#t),i=new Zt(this.#t);this.#m=e,this.#C=i;let s=this.ttlAutopurge?new Array(this.#t):void 0;this.#w=s,this.#_=(o,a,l=this.#u.now())=>{if(i[o]=a!==0?l:0,e[o]=a,s?.[o]&&(clearTimeout(s[o]),s[o]=void 0),a!==0&&s){let h=setTimeout(()=>{this.#k(o)&&this.#j(this.#l[o],"expire");},a+1);h.unref&&h.unref(),s[o]=h;}},this.#O=o=>{i[o]=e[o]!==0?this.#u.now():0;},this.#M=(o,a)=>{if(e[a]){let l=e[a],h=i[a];if(!l||!h)return;o.ttl=l,o.start=h,o.now=r||n();let c=o.now-h;o.remainingTTL=l-c;}};let r=0,n=()=>{let o=this.#u.now();if(this.ttlResolution>0){r=o;let a=setTimeout(()=>r=0,this.ttlResolution);a.unref&&a.unref();}return o};this.getRemainingTTL=o=>{let a=this.#c.get(o);if(a===void 0)return 0;let l=e[a],h=i[a];if(!l||!h)return 1/0;let c=(r||n())-h;return l-c},this.#k=o=>{let a=i[o],l=e[o];return !!l&&!!a&&(r||n())-a>l};}#O=()=>{};#M=()=>{};#_=()=>{};#k=()=>false;#G(){let e=new Zt(this.#t);this.#p=0,this.#A=e,this.#N=i=>{this.#p-=e[i],e[i]=0;},this.#D=(i,s,r,n)=>{if(this.#h(s))return 0;if(!nt(r))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(r=n(s,i),!nt(r))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 r},this.#I=(i,s,r)=>{if(e[i]=s,this.#i){let n=this.#i-e[i];for(;this.#p>n;)this.#z(true);}this.#p+=e[i],r&&(r.entrySize=s,r.totalCalculatedSize=this.#p);};}#N=e=>{};#I=(e,i,s)=>{};#D=(e,i,s,r)=>{if(s||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#F({allowStale:e=this.allowStale}={}){if(this.#a)for(let i=this.#d;!(!this.#W(i)||((e||!this.#k(i))&&(yield i),i===this.#b));)i=this.#S[i];}*#P({allowStale:e=this.allowStale}={}){if(this.#a)for(let i=this.#b;!(!this.#W(i)||((e||!this.#k(i))&&(yield i),i===this.#d));)i=this.#f[i];}#W(e){return e!==void 0&&this.#c.get(this.#l[e])===e}*entries(){for(let e of this.#F())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#s[e])&&(yield [this.#l[e],this.#s[e]]);}*rentries(){for(let e of this.#P())this.#s[e]!==void 0&&this.#l[e]!==void 0&&!this.#h(this.#s[e])&&(yield [this.#l[e],this.#s[e]]);}*keys(){for(let e of this.#F()){let i=this.#l[e];i!==void 0&&!this.#h(this.#s[e])&&(yield i);}}*rkeys(){for(let e of this.#P()){let i=this.#l[e];i!==void 0&&!this.#h(this.#s[e])&&(yield i);}}*values(){for(let e of this.#F())this.#s[e]!==void 0&&!this.#h(this.#s[e])&&(yield this.#s[e]);}*rvalues(){for(let e of this.#P())this.#s[e]!==void 0&&!this.#h(this.#s[e])&&(yield this.#s[e]);}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,i={}){for(let s of this.#F()){let r=this.#s[s],n=this.#h(r)?r.__staleWhileFetching:r;if(n!==void 0&&e(n,this.#l[s],this))return this.get(this.#l[s],i)}}forEach(e,i=this){for(let s of this.#F()){let r=this.#s[s],n=this.#h(r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,this.#l[s],this);}}rforEach(e,i=this){for(let s of this.#P()){let r=this.#s[s],n=this.#h(r)?r.__staleWhileFetching:r;n!==void 0&&e.call(i,n,this.#l[s],this);}}purgeStale(){let e=false;for(let i of this.#P({allowStale:true}))this.#k(i)&&(this.#j(this.#l[i],"expire"),e=true);return e}info(e){let i=this.#c.get(e);if(i===void 0)return;let s=this.#s[i],r=this.#h(s)?s.__staleWhileFetching:s;if(r===void 0)return;let n={value:r};if(this.#m&&this.#C){let o=this.#m[i],a=this.#C[i];if(o&&a){let l=o-(this.#u.now()-a);n.ttl=l,n.start=Date.now();}}return this.#A&&(n.size=this.#A[i]),n}dump(){let e=[];for(let i of this.#F({allowStale:true})){let s=this.#l[i],r=this.#s[i],n=this.#h(r)?r.__staleWhileFetching:r;if(n===void 0||s===void 0)continue;let o={value:n};if(this.#m&&this.#C){o.ttl=this.#m[i];let a=this.#u.now()-this.#C[i];o.start=Math.floor(Date.now()-a);}this.#A&&(o.size=this.#A[i]),e.unshift([s,o]);}return e}load(e){this.clear();for(let[i,s]of e){if(s.start){let r=Date.now()-s.start;s.start=this.#u.now()-r;}this.set(i,s.value,s);}}set(e,i,s={}){if(i===void 0)return this.delete(e),this;let{ttl:r=this.ttl,start:n,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=s,{noUpdateTTL:h=this.noUpdateTTL}=s,c=this.#D(e,i,s.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=true),this.#j(e,"set"),this;let u=this.#a===0?void 0:this.#c.get(e);if(u===void 0)u=this.#a===0?this.#d:this.#T.length!==0?this.#T.pop():this.#a===this.#t?this.#z(false):this.#a,this.#l[u]=e,this.#s[u]=i,this.#c.set(e,u),this.#f[this.#d]=u,this.#S[u]=this.#d,this.#d=u,this.#a++,this.#I(u,c,l),l&&(l.set="add"),h=false,this.#R&&this.#r?.(i,e,"add");else {this.#L(u);let f=this.#s[u];if(i!==f){if(this.#E&&this.#h(f)){f.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:d}=f;d!==void 0&&!o&&(this.#x&&this.#n?.(d,e,"set"),this.#e&&this.#g?.push([d,e,"set"]));}else o||(this.#x&&this.#n?.(f,e,"set"),this.#e&&this.#g?.push([f,e,"set"]));if(this.#N(u),this.#I(u,c,l),this.#s[u]=i,l){l.set="replace";let d=f&&this.#h(f)?f.__staleWhileFetching:f;d!==void 0&&(l.oldValue=d);}}else l&&(l.set="update");this.#R&&this.onInsert?.(i,e,i===f?"update":"replace");}if(r!==0&&!this.#m&&this.#$(),this.#m&&(h||this.#_(u,r,n),l&&this.#M(l,u)),!o&&this.#e&&this.#g){let f=this.#g,d;for(;d=f?.shift();)this.#o?.(...d);}return this}pop(){try{for(;this.#a;){let e=this.#s[this.#b];if(this.#z(!0),this.#h(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#e&&this.#g){let e=this.#g,i;for(;i=e?.shift();)this.#o?.(...i);}}}#z(e){let i=this.#b,s=this.#l[i],r=this.#s[i];return this.#E&&this.#h(r)?r.__abortController.abort(new Error("evicted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(r,s,"evict"),this.#e&&this.#g?.push([r,s,"evict"])),this.#N(i),this.#w?.[i]&&(clearTimeout(this.#w[i]),this.#w[i]=void 0),e&&(this.#l[i]=void 0,this.#s[i]=void 0,this.#T.push(i)),this.#a===1?(this.#b=this.#d=0,this.#T.length=0):this.#b=this.#f[i],this.#c.delete(s),this.#a--,i}has(e,i={}){let{updateAgeOnHas:s=this.updateAgeOnHas,status:r}=i,n=this.#c.get(e);if(n!==void 0){let o=this.#s[n];if(this.#h(o)&&o.__staleWhileFetching===void 0)return false;if(this.#k(n))r&&(r.has="stale",this.#M(r,n));else return s&&this.#O(n),r&&(r.has="hit",this.#M(r,n)),true}else r&&(r.has="miss");return false}peek(e,i={}){let{allowStale:s=this.allowStale}=i,r=this.#c.get(e);if(r===void 0||!s&&this.#k(r))return;let n=this.#s[r];return this.#h(n)?n.__staleWhileFetching:n}#B(e,i,s,r){let n=i===void 0?void 0:this.#s[i];if(this.#h(n))return n;let o=new ie,{signal:a}=s;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:s,context:r},h=(m,b=false)=>{let{aborted:v}=o.signal,y=s.ignoreFetchAbort&&m!==void 0,k=s.ignoreFetchAbort||!!(s.allowStaleOnFetchAbort&&m!==void 0);if(s.status&&(v&&!b?(s.status.fetchAborted=true,s.status.fetchError=o.signal.reason,y&&(s.status.fetchAbortIgnored=true)):s.status.fetchResolved=true),v&&!y&&!b)return u(o.signal.reason,k);let w=d,S=this.#s[i];return (S===d||y&&b&&S===void 0)&&(m===void 0?w.__staleWhileFetching!==void 0?this.#s[i]=w.__staleWhileFetching:this.#j(e,"fetch"):(s.status&&(s.status.fetchUpdated=true),this.set(e,m,l.options))),m},c=m=>(s.status&&(s.status.fetchRejected=true,s.status.fetchError=m),u(m,false)),u=(m,b)=>{let{aborted:v}=o.signal,y=v&&s.allowStaleOnFetchAbort,k=y||s.allowStaleOnFetchRejection,w=k||s.noDeleteOnFetchRejection,S=d;if(this.#s[i]===d&&(!w||!b&&S.__staleWhileFetching===void 0?this.#j(e,"fetch"):y||(this.#s[i]=S.__staleWhileFetching)),k)return s.status&&S.__staleWhileFetching!==void 0&&(s.status.returnedStale=true),S.__staleWhileFetching;if(S.__returned===S)throw m},f=(m,b)=>{let v=this.#v?.(e,n,l);v&&v instanceof Promise&&v.then(y=>m(y===void 0?void 0:y),b),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(m(void 0),s.allowStaleOnFetchAbort&&(m=y=>h(y,true)));});};s.status&&(s.status.fetchDispatched=true);let d=new Promise(f).then(h,c),g=Object.assign(d,{__abortController:o,__staleWhileFetching:n,__returned:void 0});return i===void 0?(this.set(e,g,{...l.options,status:void 0}),i=this.#c.get(e)):this.#s[i]=g,g}#h(e){if(!this.#E)return false;let i=e;return !!i&&i instanceof Promise&&i.hasOwnProperty("__staleWhileFetching")&&i.__abortController instanceof ie}async fetch(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:h=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:d=this.ignoreFetchAbort,allowStaleOnFetchAbort:g=this.allowStaleOnFetchAbort,context:m,forceRefresh:b=false,status:v,signal:y}=i;if(!this.#E)return v&&(v.fetch="get"),this.get(e,{allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,status:v});let k={allowStale:s,updateAgeOnGet:r,noDeleteOnStaleGet:n,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:h,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:g,ignoreFetchAbort:d,status:v,signal:y},w=this.#c.get(e);if(w===void 0){v&&(v.fetch="miss");let S=this.#B(e,w,k,m);return S.__returned=S}else {let S=this.#s[w];if(this.#h(S)){let dt=s&&S.__staleWhileFetching!==void 0;return v&&(v.fetch="inflight",dt&&(v.returnedStale=true)),dt?S.__staleWhileFetching:S.__returned=S}let C=this.#k(w);if(!b&&!C)return v&&(v.fetch="hit"),this.#L(w),r&&this.#O(w),v&&this.#M(v,w),S;let G=this.#B(e,w,k,m),st=G.__staleWhileFetching!==void 0&&s;return v&&(v.fetch=C?"stale":"refresh",st&&C&&(v.returnedStale=true)),st?G.__staleWhileFetching:G.__returned=G}}async forceFetch(e,i={}){let s=await this.fetch(e,i);if(s===void 0)throw new Error("fetch() returned undefined");return s}memo(e,i={}){let s=this.#y;if(!s)throw new Error("no memoMethod provided to constructor");let{context:r,forceRefresh:n,...o}=i,a=this.get(e,o);if(!n&&a!==void 0)return a;let l=s(e,a,{options:o,context:r});return this.set(e,l,o),l}get(e,i={}){let{allowStale:s=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:o}=i,a=this.#c.get(e);if(a!==void 0){let l=this.#s[a],h=this.#h(l);return o&&this.#M(o,a),this.#k(a)?(o&&(o.get="stale"),h?(o&&s&&l.__staleWhileFetching!==void 0&&(o.returnedStale=true),s?l.__staleWhileFetching:void 0):(n||this.#j(e,"expire"),o&&s&&(o.returnedStale=true),s?l:void 0)):(o&&(o.get="hit"),h?l.__staleWhileFetching:(this.#L(a),r&&this.#O(a),l))}else o&&(o.get="miss");}#U(e,i){this.#S[i]=e,this.#f[e]=i;}#L(e){e!==this.#d&&(e===this.#b?this.#b=this.#f[e]:this.#U(this.#S[e],this.#f[e]),this.#U(this.#d,e),this.#d=e);}delete(e){return this.#j(e,"delete")}#j(e,i){let s=false;if(this.#a!==0){let r=this.#c.get(e);if(r!==void 0)if(this.#w?.[r]&&(clearTimeout(this.#w?.[r]),this.#w[r]=void 0),s=true,this.#a===1)this.#Y(i);else {this.#N(r);let n=this.#s[r];if(this.#h(n)?n.__abortController.abort(new Error("deleted")):(this.#x||this.#e)&&(this.#x&&this.#n?.(n,e,i),this.#e&&this.#g?.push([n,e,i])),this.#c.delete(e),this.#l[r]=void 0,this.#s[r]=void 0,r===this.#d)this.#d=this.#S[r];else if(r===this.#b)this.#b=this.#f[r];else {let o=this.#S[r];this.#f[o]=this.#f[r];let a=this.#f[r];this.#S[a]=this.#S[r];}this.#a--,this.#T.push(r);}}if(this.#e&&this.#g?.length){let r=this.#g,n;for(;n=r?.shift();)this.#o?.(...n);}return s}clear(){return this.#Y("delete")}#Y(e){for(let i of this.#P({allowStale:true})){let s=this.#s[i];if(this.#h(s))s.__abortController.abort(new Error("deleted"));else {let r=this.#l[i];this.#x&&this.#n?.(s,r,e),this.#e&&this.#g?.push([s,r,e]);}}if(this.#c.clear(),this.#s.fill(void 0),this.#l.fill(void 0),this.#m&&this.#C){this.#m.fill(0),this.#C.fill(0);for(let i of this.#w??[])i!==void 0&&clearTimeout(i);this.#w?.fill(void 0);}if(this.#A&&this.#A.fill(0),this.#b=0,this.#d=0,this.#T.length=0,this.#p=0,this.#a=0,this.#e&&this.#g){let i=this.#g,s;for(;s=i?.shift();)this.#o?.(...s);}}},pi=typeof process=="object"&&process?process:{stdout:null,stderr:null},Ma=t=>!!t&&typeof t=="object"&&(t instanceof se||t instanceof Fi||Ra(t)||Ia(t)),Ra=t=>!!t&&typeof t=="object"&&t instanceof EventEmitter&&typeof t.pipe=="function"&&t.pipe!==Fi.Writable.prototype.pipe,Ia=t=>!!t&&typeof t=="object"&&t instanceof EventEmitter&&typeof t.write=="function"&&typeof t.end=="function",tt=Symbol("EOF"),et=Symbol("maybeEmitEnd"),rt=Symbol("emittedEnd"),zt=Symbol("emittingEnd"),kt=Symbol("emittedError"),Bt=Symbol("closed"),fi=Symbol("read"),Ut=Symbol("flush"),di=Symbol("flushChunk"),K=Symbol("encoding"),gt=Symbol("decoder"),j=Symbol("flowing"),At=Symbol("paused"),yt=Symbol("resume"),F=Symbol("buffer"),I=Symbol("pipes"),P=Symbol("bufferLength"),me=Symbol("bufferPush"),Gt=Symbol("bufferShift"),$=Symbol("objectMode"),E=Symbol("destroyed"),ye=Symbol("error"),we=Symbol("emitData"),gi=Symbol("emitEnd"),be=Symbol("emitEnd2"),J=Symbol("async"),ve=Symbol("abort"),Yt=Symbol("aborted"),Ct=Symbol("signal"),ut=Symbol("dataListeners"),B=Symbol("discarded"),Et=t=>Promise.resolve().then(t),La=t=>t(),Na=t=>t==="end"||t==="finish"||t==="prefinish",_a=t=>t instanceof ArrayBuffer||!!t&&typeof t=="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0,Da=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t),ys=class{src;dest;opts;ondrain;constructor(t,e,i){this.src=t,this.dest=e,this.opts=i,this.ondrain=()=>t[yt](),this.dest.on("drain",this.ondrain);}unpipe(){this.dest.removeListener("drain",this.ondrain);}proxyErrors(t){}end(){this.unpipe(),this.opts.end&&this.dest.end();}},Wa=class extends ys{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe();}constructor(t,e,i){super(t,e,i),this.proxyErrors=s=>this.dest.emit("error",s),t.on("error",this.proxyErrors);}},za=t=>!!t.objectMode,Ba=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer",se=class extends EventEmitter{[j]=false;[At]=false;[I]=[];[F]=[];[$];[K];[J];[gt];[tt]=false;[rt]=false;[zt]=false;[Bt]=false;[kt]=null;[P]=0;[E]=false;[Ct];[Yt]=false;[ut]=0;[B]=false;writable=true;readable=true;constructor(...t){let e=t[0]||{};if(super(),e.objectMode&&typeof e.encoding=="string")throw new TypeError("Encoding and objectMode may not be used together");za(e)?(this[$]=true,this[K]=null):Ba(e)?(this[K]=e.encoding,this[$]=false):(this[$]=false,this[K]=null),this[J]=!!e.async,this[gt]=this[K]?new StringDecoder(this[K]):null,e&&e.debugExposeBuffer===true&&Object.defineProperty(this,"buffer",{get:()=>this[F]}),e&&e.debugExposePipes===true&&Object.defineProperty(this,"pipes",{get:()=>this[I]});let{signal:i}=e;i&&(this[Ct]=i,i.aborted?this[ve]():i.addEventListener("abort",()=>this[ve]()));}get bufferLength(){return this[P]}get encoding(){return this[K]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[$]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get async(){return this[J]}set async(t){this[J]=this[J]||!!t;}[ve](){this[Yt]=true,this.emit("abort",this[Ct]?.reason),this.destroy(this[Ct]?.reason);}get aborted(){return this[Yt]}set aborted(t){}write(t,e,i){if(this[Yt])return false;if(this[tt])throw new Error("write after end");if(this[E])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),true;typeof e=="function"&&(i=e,e="utf8"),e||(e="utf8");let s=this[J]?Et:La;if(!this[$]&&!Buffer.isBuffer(t)){if(Da(t))t=Buffer.from(t.buffer,t.byteOffset,t.byteLength);else if(_a(t))t=Buffer.from(t);else if(typeof t!="string")throw new Error("Non-contiguous data written to non-objectMode stream")}return this[$]?(this[j]&&this[P]!==0&&this[Ut](true),this[j]?this.emit("data",t):this[me](t),this[P]!==0&&this.emit("readable"),i&&s(i),this[j]):t.length?(typeof t=="string"&&!(e===this[K]&&!this[gt]?.lastNeed)&&(t=Buffer.from(t,e)),Buffer.isBuffer(t)&&this[K]&&(t=this[gt].write(t)),this[j]&&this[P]!==0&&this[Ut](true),this[j]?this.emit("data",t):this[me](t),this[P]!==0&&this.emit("readable"),i&&s(i),this[j]):(this[P]!==0&&this.emit("readable"),i&&s(i),this[j])}read(t){if(this[E])return null;if(this[B]=false,this[P]===0||t===0||t&&t>this[P])return this[et](),null;this[$]&&(t=null),this[F].length>1&&!this[$]&&(this[F]=[this[K]?this[F].join(""):Buffer.concat(this[F],this[P])]);let e=this[fi](t||null,this[F][0]);return this[et](),e}[fi](t,e){if(this[$])this[Gt]();else {let i=e;t===i.length||t===null?this[Gt]():typeof i=="string"?(this[F][0]=i.slice(t),e=i.slice(0,t),this[P]-=t):(this[F][0]=i.subarray(t),e=i.subarray(0,t),this[P]-=t);}return this.emit("data",e),!this[F].length&&!this[tt]&&this.emit("drain"),e}end(t,e,i){return typeof t=="function"&&(i=t,t=void 0),typeof e=="function"&&(i=e,e="utf8"),t!==void 0&&this.write(t,e),i&&this.once("end",i),this[tt]=true,this.writable=false,(this[j]||!this[At])&&this[et](),this}[yt](){this[E]||(!this[ut]&&!this[I].length&&(this[B]=true),this[At]=false,this[j]=true,this.emit("resume"),this[F].length?this[Ut]():this[tt]?this[et]():this.emit("drain"));}resume(){return this[yt]()}pause(){this[j]=false,this[At]=true,this[B]=false;}get destroyed(){return this[E]}get flowing(){return this[j]}get paused(){return this[At]}[me](t){this[$]?this[P]+=1:this[P]+=t.length,this[F].push(t);}[Gt](){return this[$]?this[P]-=1:this[P]-=this[F][0].length,this[F].shift()}[Ut](t=false){do;while(this[di](this[Gt]())&&this[F].length);!t&&!this[F].length&&!this[tt]&&this.emit("drain");}[di](t){return this.emit("data",t),this[j]}pipe(t,e){if(this[E])return t;this[B]=false;let i=this[rt];return e=e||{},t===pi.stdout||t===pi.stderr?e.end=false:e.end=e.end!==false,e.proxyErrors=!!e.proxyErrors,i?e.end&&t.end():(this[I].push(e.proxyErrors?new Wa(this,t,e):new ys(this,t,e)),this[J]?Et(()=>this[yt]()):this[yt]()),t}unpipe(t){let e=this[I].find(i=>i.dest===t);e&&(this[I].length===1?(this[j]&&this[ut]===0&&(this[j]=false),this[I]=[]):this[I].splice(this[I].indexOf(e),1),e.unpipe());}addListener(t,e){return this.on(t,e)}on(t,e){let i=super.on(t,e);if(t==="data")this[B]=false,this[ut]++,!this[I].length&&!this[j]&&this[yt]();else if(t==="readable"&&this[P]!==0)super.emit("readable");else if(Na(t)&&this[rt])super.emit(t),this.removeAllListeners(t);else if(t==="error"&&this[kt]){let s=e;this[J]?Et(()=>s.call(this,this[kt])):s.call(this,this[kt]);}return i}removeListener(t,e){return this.off(t,e)}off(t,e){let i=super.off(t,e);return t==="data"&&(this[ut]=this.listeners("data").length,this[ut]===0&&!this[B]&&!this[I].length&&(this[j]=false)),i}removeAllListeners(t){let e=super.removeAllListeners(t);return (t==="data"||t===void 0)&&(this[ut]=0,!this[B]&&!this[I].length&&(this[j]=false)),e}get emittedEnd(){return this[rt]}[et](){!this[zt]&&!this[rt]&&!this[E]&&this[F].length===0&&this[tt]&&(this[zt]=true,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[Bt]&&this.emit("close"),this[zt]=false);}emit(t,...e){let i=e[0];if(t!=="error"&&t!=="close"&&t!==E&&this[E])return false;if(t==="data")return !this[$]&&!i?false:this[J]?(Et(()=>this[we](i)),true):this[we](i);if(t==="end")return this[gi]();if(t==="close"){if(this[Bt]=true,!this[rt]&&!this[E])return false;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(t==="error"){this[kt]=i,super.emit(ye,i);let r=!this[Ct]||this.listeners("error").length?super.emit("error",i):false;return this[et](),r}else if(t==="resume"){let r=super.emit("resume");return this[et](),r}else if(t==="finish"||t==="prefinish"){let r=super.emit(t);return this.removeAllListeners(t),r}let s=super.emit(t,...e);return this[et](),s}[we](t){for(let i of this[I])i.dest.write(t)===false&&this.pause();let e=this[B]?false:super.emit("data",t);return this[et](),e}[gi](){return this[rt]?false:(this[rt]=true,this.readable=false,this[J]?(Et(()=>this[be]()),true):this[be]())}[be](){if(this[gt]){let e=this[gt].end();if(e){for(let i of this[I])i.dest.write(e);this[B]||super.emit("data",e);}}for(let e of this[I])e.end();let t=super.emit("end");return this.removeAllListeners("end"),t}async collect(){let t=Object.assign([],{dataLength:0});this[$]||(t.dataLength=0);let e=this.promise();return this.on("data",i=>{t.push(i),this[$]||(t.dataLength+=i.length);}),await e,t}async concat(){if(this[$])throw new Error("cannot concat in objectMode");let t=await this.collect();return this[K]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise((t,e)=>{this.on(E,()=>e(new Error("stream destroyed"))),this.on("error",i=>e(i)),this.on("end",()=>t());})}[Symbol.asyncIterator](){this[B]=false;let t=false,e=async()=>(this.pause(),t=true,{value:void 0,done:true});return {next:()=>{if(t)return e();let i=this.read();if(i!==null)return Promise.resolve({done:false,value:i});if(this[tt])return e();let s,r,n=h=>{this.off("data",o),this.off("end",a),this.off(E,l),e(),r(h);},o=h=>{this.off("error",n),this.off("end",a),this.off(E,l),this.pause(),s({value:h,done:!!this[tt]});},a=()=>{this.off("error",n),this.off("data",o),this.off(E,l),e(),s({done:true,value:void 0});},l=()=>n(new Error("stream destroyed"));return new Promise((h,c)=>{r=c,s=h,this.once(E,l),this.once("error",n),this.once("end",a),this.once("data",o);})},throw:e,return:e,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[B]=false;let t=false,e=()=>(this.pause(),this.off(ye,e),this.off(E,e),this.off("end",e),t=true,{done:true,value:void 0}),i=()=>{if(t)return e();let s=this.read();return s===null?e():{done:false,value:s}};return this.once("end",e),this.once(ye,e),this.once(E,e),{next:i,throw:e,return:e,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(t){if(this[E])return t?this.emit("error",t):this.emit(E),this;this[E]=true,this[B]=true,this[F].length=0,this[P]=0;let e=this;return typeof e.close=="function"&&!this[Bt]&&e.close(),t?this.emit("error",t):this.emit(E),this}static get isStream(){return Ma}},Ua=realpathSync.native,Pt={lstatSync:lstatSync,readdir:readdir$1,readdirSync:readdirSync,readlinkSync:readlinkSync,realpathSync:Ua,promises:{lstat:lstat,readdir:readdir,readlink:readlink,realpath:realpath}},ws=t=>!t||t===Pt||t===z?Pt:{...Pt,...t,promises:{...Pt.promises,...t.promises||{}}},bs=/^\\\\\?\\([a-z]:)\\?$/i,Ga=t=>t.replace(/\//g,"\\").replace(bs,"$1\\"),Ya=/[\\\/]/,Z=0,vs=1,Ss=2,X=4,xs=6,ks=8,ct=10,As=12,q=15,Ot=~q,Se=16,mi=32,$t=64,H=128,qt=256,Kt=512,yi=$t|H|Kt,qa=1023,xe=t=>t.isFile()?ks:t.isDirectory()?X:t.isSymbolicLink()?ct:t.isCharacterDevice()?Ss:t.isBlockDevice()?xs:t.isSocket()?As:t.isFIFO()?vs:Z,wi=new le({max:2**12}),Mt=t=>{let e=wi.get(t);if(e)return e;let i=t.normalize("NFKD");return wi.set(t,i),i},bi=new le({max:2**12}),Vt=t=>{let e=bi.get(t);if(e)return e;let i=Mt(t.toLowerCase());return bi.set(t,i),i},vi=class extends le{constructor(){super({max:256});}},Va=class extends le{constructor(t=16*1024){super({maxSize:t,sizeCalculation:e=>e.length+1});}},Cs=Symbol("PathScurry setAsCwd"),_=class{name;root;roots;parent;nocase;isCWD=false;#t;#i;get dev(){return this.#i}#n;get mode(){return this.#n}#r;get nlink(){return this.#r}#o;get uid(){return this.#o}#v;get gid(){return this.#v}#y;get rdev(){return this.#y}#u;get blksize(){return this.#u}#a;get ino(){return this.#a}#p;get size(){return this.#p}#c;get blocks(){return this.#c}#l;get atimeMs(){return this.#l}#s;get mtimeMs(){return this.#s}#f;get ctimeMs(){return this.#f}#S;get birthtimeMs(){return this.#S}#b;get atime(){return this.#b}#d;get mtime(){return this.#d}#T;get ctime(){return this.#T}#g;get birthtime(){return this.#g}#A;#C;#m;#w;#x;#E;#e;#R;#$;#O;get parentPath(){return (this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=Z,i,s,r,n,o){this.name=t,this.#A=r?Vt(t):Mt(t),this.#e=e&qa,this.nocase=r,this.roots=s,this.root=i||this,this.#R=n,this.#m=o.fullpath,this.#x=o.relative,this.#E=o.relativePosix,this.parent=o.parent,this.parent?this.#t=this.parent.#t:this.#t=ws(o.fs);}depth(){return this.#C!==void 0?this.#C:this.parent?this.#C=this.parent.depth()+1:this.#C=0}childrenCache(){return this.#R}resolve(t){if(!t)return this;let e=this.getRootString(t),i=t.substring(e.length).split(this.splitSep);return e?this.getRoot(e).#M(i):this.#M(i)}#M(t){let e=this;for(let i of t)e=e.child(i);return e}children(){let t=this.#R.get(this);if(t)return t;let e=Object.assign([],{provisional:0});return this.#R.set(this,e),this.#e&=~Se,e}child(t,e){if(t===""||t===".")return this;if(t==="..")return this.parent||this;let i=this.children(),s=this.nocase?Vt(t):Mt(t);for(let a of i)if(a.#A===s)return a;let r=this.parent?this.sep:"",n=this.#m?this.#m+r+t:void 0,o=this.newChild(t,Z,{...e,parent:this,fullpath:n});return this.canReaddir()||(o.#e|=H),i.push(o),o}relative(){if(this.isCWD)return "";if(this.#x!==void 0)return this.#x;let t=this.name,e=this.parent;if(!e)return this.#x=this.name;let i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return "";if(this.#E!==void 0)return this.#E;let t=this.name,e=this.parent;if(!e)return this.#E=this.fullpathPosix();let i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(this.#m!==void 0)return this.#m;let t=this.name,e=this.parent;if(!e)return this.#m=this.name;let i=e.fullpath()+(e.parent?this.sep:"")+t;return this.#m=i}fullpathPosix(){if(this.#w!==void 0)return this.#w;if(this.sep==="/")return this.#w=this.fullpath();if(!this.parent){let s=this.fullpath().replace(/\\/g,"/");return /^[a-z]:\//i.test(s)?this.#w=`//?/${s}`:this.#w=s}let t=this.parent,e=t.fullpathPosix(),i=e+(!e||!t.parent?"":"/")+this.name;return this.#w=i}isUnknown(){return (this.#e&q)===Z}isType(t){return this[`is${t}`]()}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.#e&q)===ks}isDirectory(){return (this.#e&q)===X}isCharacterDevice(){return (this.#e&q)===Ss}isBlockDevice(){return (this.#e&q)===xs}isFIFO(){return (this.#e&q)===vs}isSocket(){return (this.#e&q)===As}isSymbolicLink(){return (this.#e&ct)===ct}lstatCached(){return this.#e&mi?this:void 0}readlinkCached(){return this.#$}realpathCached(){return this.#O}readdirCached(){let t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#$)return true;if(!this.parent)return false;let t=this.#e&q;return !(t!==Z&&t!==ct||this.#e&qt||this.#e&H)}calledReaddir(){return !!(this.#e&Se)}isENOENT(){return !!(this.#e&H)}isNamed(t){return this.nocase?this.#A===Vt(t):this.#A===Mt(t)}async readlink(){let t=this.#$;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=await this.#t.promises.readlink(this.fullpath()),i=(await this.parent.realpath())?.resolve(e);if(i)return this.#$=i}catch(e){this.#P(e.code);return}}readlinkSync(){let t=this.#$;if(t)return t;if(this.canReadlink()&&this.parent)try{let e=this.#t.readlinkSync(this.fullpath()),i=this.parent.realpathSync()?.resolve(e);if(i)return this.#$=i}catch(e){this.#P(e.code);return}}#_(t){this.#e|=Se;for(let e=t.provisional;e<t.length;e++){let i=t[e];i&&i.#k();}}#k(){this.#e&H||(this.#e=(this.#e|H)&Ot,this.#G());}#G(){let t=this.children();t.provisional=0;for(let e of t)e.#k();}#N(){this.#e|=Kt,this.#I();}#I(){if(this.#e&$t)return;let t=this.#e;(t&q)===X&&(t&=Ot),this.#e=t|$t,this.#G();}#D(t=""){t==="ENOTDIR"||t==="EPERM"?this.#I():t==="ENOENT"?this.#k():this.children().provisional=0;}#F(t=""){t==="ENOTDIR"?this.parent.#I():t==="ENOENT"&&this.#k();}#P(t=""){let e=this.#e;e|=qt,t==="ENOENT"&&(e|=H),(t==="EINVAL"||t==="UNKNOWN")&&(e&=Ot),this.#e=e,t==="ENOTDIR"&&this.parent&&this.parent.#I();}#W(t,e){return this.#B(t,e)||this.#z(t,e)}#z(t,e){let i=xe(t),s=this.newChild(t.name,i,{parent:this}),r=s.#e&q;return r!==X&&r!==ct&&r!==Z&&(s.#e|=$t),e.unshift(s),e.provisional++,s}#B(t,e){for(let i=e.provisional;i<e.length;i++){let s=e[i];if((this.nocase?Vt(t.name):Mt(t.name))===s.#A)return this.#h(t,s,i,e)}}#h(t,e,i,s){let r=e.name;return e.#e=e.#e&Ot|xe(t),r!==t.name&&(e.name=t.name),i!==s.provisional&&(i===s.length-1?s.pop():s.splice(i,1),s.unshift(e)),s.provisional++,e}async lstat(){if((this.#e&H)===0)try{return this.#U(await this.#t.promises.lstat(this.fullpath())),this}catch(t){this.#F(t.code);}}lstatSync(){if((this.#e&H)===0)try{return this.#U(this.#t.lstatSync(this.fullpath())),this}catch(t){this.#F(t.code);}}#U(t){let{atime:e,atimeMs:i,birthtime:s,birthtimeMs:r,blksize:n,blocks:o,ctime:a,ctimeMs:l,dev:h,gid:c,ino:u,mode:f,mtime:d,mtimeMs:g,nlink:m,rdev:b,size:v,uid:y}=t;this.#b=e,this.#l=i,this.#g=s,this.#S=r,this.#u=n,this.#c=o,this.#T=a,this.#f=l,this.#i=h,this.#v=c,this.#a=u,this.#n=f,this.#d=d,this.#s=g,this.#r=m,this.#y=b,this.#p=v,this.#o=y;let k=xe(t);this.#e=this.#e&Ot|k|mi,k!==Z&&k!==X&&k!==ct&&(this.#e|=$t);}#L=[];#j=false;#Y(t){this.#j=false;let e=this.#L.slice();this.#L.length=0,e.forEach(i=>i(null,t));}readdirCB(t,e=false){if(!this.canReaddir()){e?t(null,[]):queueMicrotask(()=>t(null,[]));return}let i=this.children();if(this.calledReaddir()){let r=i.slice(0,i.provisional);e?t(null,r):queueMicrotask(()=>t(null,r));return}if(this.#L.push(t),this.#j)return;this.#j=true;let s=this.fullpath();this.#t.readdir(s,{withFileTypes:true},(r,n)=>{if(r)this.#D(r.code),i.provisional=0;else {for(let o of n)this.#W(o,i);this.#_(i);}this.#Y(i.slice(0,i.provisional));});}#q;async readdir(){if(!this.canReaddir())return [];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();if(this.#q)await this.#q;else {let i=()=>{};this.#q=new Promise(s=>i=s);try{for(let s of await this.#t.promises.readdir(e,{withFileTypes:!0}))this.#W(s,t);this.#_(t);}catch(s){this.#D(s.code),t.provisional=0;}this.#q=void 0,i();}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir())return [];let t=this.children();if(this.calledReaddir())return t.slice(0,t.provisional);let e=this.fullpath();try{for(let i of this.#t.readdirSync(e,{withFileTypes:!0}))this.#W(i,t);this.#_(t);}catch(i){this.#D(i.code),t.provisional=0;}return t.slice(0,t.provisional)}canReaddir(){if(this.#e&yi)return false;let t=q&this.#e;return t===Z||t===X||t===ct}shouldWalk(t,e){return (this.#e&X)===X&&!(this.#e&yi)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#O)return this.#O;if(!((Kt|qt|H)&this.#e))try{let t=await this.#t.promises.realpath(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N();}}realpathSync(){if(this.#O)return this.#O;if(!((Kt|qt|H)&this.#e))try{let t=this.#t.realpathSync(this.fullpath());return this.#O=this.resolve(t)}catch{this.#N();}}[Cs](t){if(t===this)return;t.isCWD=false,this.isCWD=true;let e=new Set([]),i=[],s=this;for(;s&&s.parent;)e.add(s),s.#x=i.join(this.sep),s.#E=i.join("/"),s=s.parent,i.push("..");for(s=t;s&&s.parent&&!e.has(s);)s.#x=void 0,s.#E=void 0,s=s.parent;}},Es=class Os extends _{sep="\\";splitSep=Ya;constructor(e,i=Z,s,r,n,o,a){super(e,i,s,r,n,o,a);}newChild(e,i=Z,s={}){return new Os(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}getRootString(e){return win32.parse(e).root}getRoot(e){if(e=Ga(e.toUpperCase()),e===this.root.name)return this.root;for(let[i,s]of Object.entries(this.roots))if(this.sameRoot(e,i))return this.roots[e]=s;return this.roots[e]=new ze(e,this).root}sameRoot(e,i=this.root.name){return e=e.toUpperCase().replace(/\//g,"\\").replace(bs,"$1\\"),e===i}},Ts=class js extends _{splitSep="/";sep="/";constructor(e,i=Z,s,r,n,o,a){super(e,i,s,r,n,o,a);}getRootString(e){return e.startsWith("/")?"/":""}getRoot(e){return this.root}newChild(e,i=Z,s={}){return new js(e,i,this.root,this.roots,this.nocase,this.childrenCache(),s)}},Fs=class{root;rootPath;roots;cwd;#t;#i;#n;nocase;#r;constructor(t=process.cwd(),e,i,{nocase:s,childrenCacheSize:r=16*1024,fs:n=Pt}={}){this.#r=ws(n),(t instanceof URL||t.startsWith("file://"))&&(t=fileURLToPath(t));let o=e.resolve(t);this.roots=Object.create(null),this.rootPath=this.parseRootPath(o),this.#t=new vi,this.#i=new vi,this.#n=new Va(r);let a=o.substring(this.rootPath.length).split(i);if(a.length===1&&!a[0]&&a.pop(),s===void 0)throw new TypeError("must provide nocase setting to PathScurryBase ctor");this.nocase=s,this.root=this.newRoot(this.#r),this.roots[this.rootPath]=this.root;let l=this.root,h=a.length-1,c=e.sep,u=this.rootPath,f=false;for(let d of a){let g=h--;l=l.child(d,{relative:new Array(g).fill("..").join(c),relativePosix:new Array(g).fill("..").join("/"),fullpath:u+=(f?"":c)+d}),f=true;}this.cwd=l;}depth(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.depth()}childrenCache(){return this.#n}resolve(...t){let e="";for(let r=t.length-1;r>=0;r--){let n=t[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let i=this.#t.get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpath();return this.#t.set(e,s),s}resolvePosix(...t){let e="";for(let r=t.length-1;r>=0;r--){let n=t[r];if(!(!n||n===".")&&(e=e?`${n}/${e}`:n,this.isAbsolute(n)))break}let i=this.#i.get(e);if(i!==void 0)return i;let s=this.cwd.resolve(e).fullpathPosix();return this.#i.set(e,s),s}relative(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relative()}relativePosix(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.relativePosix()}basename(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.name}dirname(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i}=e;if(t.canReaddir()){let s=await t.readdir();return i?s:s.map(r=>r.name)}else return []}readdirSync(t=this.cwd,e={withFileTypes:true}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true}=e;return t.canReaddir()?i?t.readdirSync():t.readdirSync().map(s=>s.name):[]}async lstat(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstat()}lstatSync(t=this.cwd){return typeof t=="string"&&(t=this.cwd.resolve(t)),t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t.withFileTypes,t=this.cwd);let i=await t.readlink();return e?i:i?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t.withFileTypes,t=this.cwd);let i=t.readlinkSync();return e?i:i?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t.withFileTypes,t=this.cwd);let i=await t.realpath();return e?i:i?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t.withFileTypes,t=this.cwd);let i=t.realpathSync();return e?i:i?.fullpath()}async walk(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:r,walkFilter:n}=e,o=[];(!r||r(t))&&o.push(i?t:t.fullpath());let a=new Set,l=(c,u)=>{a.add(c),c.readdirCB((f,d)=>{if(f)return u(f);let g=d.length;if(!g)return u();let m=()=>{--g===0&&u();};for(let b of d)(!r||r(b))&&o.push(i?b:b.fullpath()),s&&b.isSymbolicLink()?b.realpath().then(v=>v?.isUnknown()?v.lstat():v).then(v=>v?.shouldWalk(a,n)?l(v,m):m()):b.shouldWalk(a,n)?l(b,m):m();},true);},h=t;return new Promise((c,u)=>{l(h,f=>{if(f)return u(f);c(o);});})}walkSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:r,walkFilter:n}=e,o=[];(!r||r(t))&&o.push(i?t:t.fullpath());let a=new Set([t]);for(let l of a){let h=l.readdirSync();for(let c of h){(!r||r(c))&&o.push(i?c:c.fullpath());let u=c;if(c.isSymbolicLink()){if(!(s&&(u=c.realpathSync())))continue;u.isUnknown()&&u.lstatSync();}u.shouldWalk(a,n)&&a.add(u);}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){return typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd),this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:r,walkFilter:n}=e;(!r||r(t))&&(yield i?t:t.fullpath());let o=new Set([t]);for(let a of o){let l=a.readdirSync();for(let h of l){(!r||r(h))&&(yield i?h:h.fullpath());let c=h;if(h.isSymbolicLink()){if(!(s&&(c=h.realpathSync())))continue;c.isUnknown()&&c.lstatSync();}c.shouldWalk(o,n)&&o.add(c);}}}stream(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:r,walkFilter:n}=e,o=new se({objectMode:true});(!r||r(t))&&o.write(i?t:t.fullpath());let a=new Set,l=[t],h=0,c=()=>{let u=false;for(;!u;){let f=l.shift();if(!f){h===0&&o.end();return}h++,a.add(f);let d=(m,b,v=false)=>{if(m)return o.emit("error",m);if(s&&!v){let y=[];for(let k of b)k.isSymbolicLink()&&y.push(k.realpath().then(w=>w?.isUnknown()?w.lstat():w));if(y.length){Promise.all(y).then(()=>d(null,b,true));return}}for(let y of b)y&&(!r||r(y))&&(o.write(i?y:y.fullpath())||(u=true));h--;for(let y of b){let k=y.realpathCached()||y;k.shouldWalk(a,n)&&l.push(k);}u&&!o.flowing?o.once("drain",c):g||c();},g=true;f.readdirCB(d,true),g=false;}};return c(),o}streamSync(t=this.cwd,e={}){typeof t=="string"?t=this.cwd.resolve(t):t instanceof _||(e=t,t=this.cwd);let{withFileTypes:i=true,follow:s=false,filter:r,walkFilter:n}=e,o=new se({objectMode:true}),a=new Set;(!r||r(t))&&o.write(i?t:t.fullpath());let l=[t],h=0,c=()=>{let u=false;for(;!u;){let f=l.shift();if(!f){h===0&&o.end();return}h++,a.add(f);let d=f.readdirSync();for(let g of d)(!r||r(g))&&(o.write(i?g:g.fullpath())||(u=true));h--;for(let g of d){let m=g;if(g.isSymbolicLink()){if(!(s&&(m=g.realpathSync())))continue;m.isUnknown()&&m.lstatSync();}m.shouldWalk(a,n)&&l.push(m);}}u&&!o.flowing&&o.once("drain",c);};return c(),o}chdir(t=this.cwd){let e=this.cwd;this.cwd=typeof t=="string"?this.cwd.resolve(t):t,this.cwd[Cs](e);}},ze=class extends Fs{sep="\\";constructor(t=process.cwd(),e={}){let{nocase:i=true}=e;super(t,win32,"\\",{...e,nocase:i}),this.nocase=i;for(let s=this.cwd;s;s=s.parent)s.nocase=this.nocase;}parseRootPath(t){return win32.parse(t).root.toUpperCase()}newRoot(t){return new Es(this.rootPath,X,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}},Be=class extends Fs{sep="/";constructor(t=process.cwd(),e={}){let{nocase:i=false}=e;super(t,posix,"/",{...e,nocase:i}),this.nocase=i;}parseRootPath(t){return "/"}newRoot(t){return new Ts(this.rootPath,X,void 0,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}},Ps=class extends Be{constructor(t=process.cwd(),e={}){let{nocase:i=true}=e;super(t,{...e,nocase:i});}};process.platform;var Za=process.platform==="win32"?ze:process.platform==="darwin"?Ps:Be,Ka=t=>t.length>=1,Ha=t=>t.length>=1,Ja=Symbol.for("nodejs.util.inspect.custom"),$s=class Ms{#t;#i;#n;length;#r;#o;#v;#y;#u;#a;#p=true;constructor(e,i,s,r){if(!Ka(e))throw new TypeError("empty pattern list");if(!Ha(i))throw new TypeError("empty glob list");if(i.length!==e.length)throw new TypeError("mismatched pattern list and glob list lengths");if(this.length=e.length,s<0||s>=this.length)throw new TypeError("index out of range");if(this.#t=e,this.#i=i,this.#n=s,this.#r=r,this.#n===0){if(this.isUNC()){let[n,o,a,l,...h]=this.#t,[c,u,f,d,...g]=this.#i;h[0]===""&&(h.shift(),g.shift());let m=[n,o,a,l,""].join("/"),b=[c,u,f,d,""].join("/");this.#t=[m,...h],this.#i=[b,...g],this.length=this.#t.length;}else if(this.isDrive()||this.isAbsolute()){let[n,...o]=this.#t,[a,...l]=this.#i;o[0]===""&&(o.shift(),l.shift());let h=n+"/",c=a+"/";this.#t=[h,...o],this.#i=[c,...l],this.length=this.#t.length;}}}[Ja](){return "Pattern <"+this.#i.slice(this.#n).join("/")+">"}pattern(){return this.#t[this.#n]}isString(){return typeof this.#t[this.#n]=="string"}isGlobstar(){return this.#t[this.#n]===L}isRegExp(){return this.#t[this.#n]instanceof RegExp}globString(){return this.#v=this.#v||(this.#n===0?this.isAbsolute()?this.#i[0]+this.#i.slice(1).join("/"):this.#i.join("/"):this.#i.slice(this.#n).join("/"))}hasMore(){return this.length>this.#n+1}rest(){return this.#o!==void 0?this.#o:this.hasMore()?(this.#o=new Ms(this.#t,this.#i,this.#n+1,this.#r),this.#o.#a=this.#a,this.#o.#u=this.#u,this.#o.#y=this.#y,this.#o):this.#o=null}isUNC(){let e=this.#t;return this.#u!==void 0?this.#u:this.#u=this.#r==="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.#y!==void 0?this.#y:this.#y=this.#r==="win32"&&this.#n===0&&this.length>1&&typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0])}isAbsolute(){let e=this.#t;return this.#a!==void 0?this.#a:this.#a=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.#p)}markFollowGlobstar(){return this.#n===0||!this.isGlobstar()||!this.#p?false:(this.#p=false,true)}},Xa=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",Si=class{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:r,platform:n=Xa}){this.relative=[],this.absolute=[],this.relativeChildren=[],this.absoluteChildren=[],this.platform=n,this.mmopts={dot:true,nobrace:e,nocase:i,noext:s,noglobstar:r,optimizationLevel:2,platform:n,nocomment:true,nonegate:true};for(let o of t)this.add(o);}add(t){let e=new lt(t,this.mmopts);for(let i=0;i<e.set.length;i++){let s=e.set[i],r=e.globParts[i];if(!s||!r)throw new Error("invalid pattern object");for(;s[0]==="."&&r[0]===".";)s.shift(),r.shift();let n=new $s(s,r,0,this.platform),o=new lt(n.globString(),this.mmopts),a=r[r.length-1]==="**",l=n.isAbsolute();l?this.absolute.push(o):this.relative.push(o),a&&(l?this.absoluteChildren.push(o):this.relativeChildren.push(o));}}ignored(t){let e=t.fullpath(),i=`${e}/`,s=t.relative()||".",r=`${s}/`;for(let n of this.relative)if(n.match(s)||n.match(r))return true;for(let n of this.absolute)if(n.match(e)||n.match(i))return true;return false}childrenIgnored(t){let e=t.fullpath()+"/",i=(t.relative()||".")+"/";for(let s of this.relativeChildren)if(s.match(i))return true;for(let s of this.absoluteChildren)if(s.match(e))return true;return false}},Qa=class Rs{store;constructor(e=new Map){this.store=e;}copy(){return new Rs(new Map(this.store))}hasWalked(e,i){return this.store.get(e.fullpath())?.has(i.globString())}storeWalked(e,i){let s=e.fullpath(),r=this.store.get(s);r?r.add(i.globString()):this.store.set(s,new Set([i.globString()]));}},tl=class{store=new Map;add(t,e,i){let s=(e?2:0)|(i?1:0),r=this.store.get(t);this.store.set(t,r===void 0?s:s&r);}entries(){return [...this.store.entries()].map(([t,e])=>[t,!!(e&2),!!(e&1)])}},el=class{store=new Map;add(t,e){if(!t.canReaddir())return;let i=this.store.get(t);i?i.find(s=>s.globString()===e.globString())||i.push(e):this.store.set(t,[e]);}get(t){let e=this.store.get(t);if(!e)throw new Error("attempting to walk unknown path");return e}entries(){return this.keys().map(t=>[t,this.store.get(t)])}keys(){return [...this.store.keys()].filter(t=>t.canReaddir())}},xi=class Is{hasWalkedCache;matches=new tl;subwalks=new el;patterns;follow;dot;opts;constructor(e,i){this.opts=e,this.follow=!!e.follow,this.dot=!!e.dot,this.hasWalkedCache=i?i.copy():new Qa;}processPatterns(e,i){this.patterns=i;let s=i.map(r=>[e,r]);for(let[r,n]of s){this.hasWalkedCache.storeWalked(r,n);let o=n.root(),a=n.isAbsolute()&&this.opts.absolute!==false;if(o){r=r.resolve(o==="/"&&this.opts.root!==void 0?this.opts.root:o);let u=n.rest();if(u)n=u;else {this.matches.add(r,true,false);continue}}if(r.isENOENT())continue;let l,h,c=false;for(;typeof(l=n.pattern())=="string"&&(h=n.rest());)r=r.resolve(l),n=h,c=true;if(l=n.pattern(),h=n.rest(),c){if(this.hasWalkedCache.hasWalked(r,n))continue;this.hasWalkedCache.storeWalked(r,n);}if(typeof l=="string"){let u=l===".."||l===""||l===".";this.matches.add(r.resolve(l),a,u);continue}else if(l===L){(!r.isSymbolicLink()||this.follow||n.checkFollowGlobstar())&&this.subwalks.add(r,n);let u=h?.pattern(),f=h?.rest();if(!h||(u===""||u===".")&&!f)this.matches.add(r,a,u===""||u===".");else if(u===".."){let d=r.parent||r;f?this.hasWalkedCache.hasWalked(d,f)||this.subwalks.add(d,f):this.matches.add(d,a,true);}}else l instanceof RegExp&&this.subwalks.add(r,n);}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Is(this.opts,this.hasWalkedCache)}filterEntries(e,i){let s=this.subwalks.get(e),r=this.child();for(let n of i)for(let o of s){let a=o.isAbsolute(),l=o.pattern(),h=o.rest();l===L?r.testGlobstar(n,o,h,a):l instanceof RegExp?r.testRegExp(n,l,h,a):r.testString(n,l,h,a);}return r}testGlobstar(e,i,s,r){if((this.dot||!e.name.startsWith("."))&&(i.hasMore()||this.matches.add(e,r,false),e.canReaddir()&&(this.follow||!e.isSymbolicLink()?this.subwalks.add(e,i):e.isSymbolicLink()&&(s&&i.checkFollowGlobstar()?this.subwalks.add(e,s):i.markFollowGlobstar()&&this.subwalks.add(e,i)))),s){let n=s.pattern();if(typeof n=="string"&&n!==".."&&n!==""&&n!==".")this.testString(e,n,s.rest(),r);else if(n===".."){let o=e.parent||e;this.subwalks.add(o,s);}else n instanceof RegExp&&this.testRegExp(e,n,s.rest(),r);}}testRegExp(e,i,s,r){i.test(e.name)&&(s?this.subwalks.add(e,s):this.matches.add(e,r,false));}testString(e,i,s,r){e.isNamed(i)&&(s?this.subwalks.add(e,s):this.matches.add(e,r,false));}},il=(t,e)=>typeof t=="string"?new Si([t],e):Array.isArray(t)?new Si(t,e):t,Ls=class{path;patterns;opts;seen=new Set;paused=false;aborted=false;#t=[];#i;#n;signal;maxDepth;includeChildMatches;constructor(t,e,i){if(this.patterns=t,this.path=e,this.opts=i,this.#n=!i.posix&&i.platform==="win32"?"\\":"/",this.includeChildMatches=i.includeChildMatches!==false,(i.ignore||!this.includeChildMatches)&&(this.#i=il(i.ignore??[],i),!this.includeChildMatches&&typeof this.#i.add!="function")){let s="cannot ignore child matches, ignore lacks add() method.";throw new Error(s)}this.maxDepth=i.maxDepth||1/0,i.signal&&(this.signal=i.signal,this.signal.addEventListener("abort",()=>{this.#t.length=0;}));}#r(t){return this.seen.has(t)||!!this.#i?.ignored?.(t)}#o(t){return !!this.#i?.childrenIgnored?.(t)}pause(){this.paused=true;}resume(){if(this.signal?.aborted)return;this.paused=false;let t;for(;!this.paused&&(t=this.#t.shift());)t();}onResume(t){this.signal?.aborted||(this.paused?this.#t.push(t):t());}async matchCheck(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||await t.realpath(),!i)return;t=i;}let s=t.isUnknown()||this.opts.stat?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let r=await s.realpath();r&&(r.isUnknown()||this.opts.stat)&&await r.lstat();}return this.matchCheckTest(s,e)}matchCheckTest(t,e){return t&&(this.maxDepth===1/0||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#r(t)?t:void 0}matchCheckSync(t,e){if(e&&this.opts.nodir)return;let i;if(this.opts.realpath){if(i=t.realpathCached()||t.realpathSync(),!i)return;t=i;}let s=t.isUnknown()||this.opts.stat?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&s?.isSymbolicLink()){let r=s.realpathSync();r&&(r?.isUnknown()||this.opts.stat)&&r.lstatSync();}return this.matchCheckTest(s,e)}matchFinish(t,e){if(this.#r(t))return;if(!this.includeChildMatches&&this.#i?.add){let r=`${t.relativePosix()}/**`;this.#i.add(r);}let i=this.opts.absolute===void 0?e:this.opts.absolute;this.seen.add(t);let s=this.opts.mark&&t.isDirectory()?this.#n:"";if(this.opts.withFileTypes)this.matchEmit(t);else if(i){let r=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(r+s);}else {let r=this.opts.posix?t.relativePosix():t.relative(),n=this.opts.dotRelative&&!r.startsWith(".."+this.#n)?"."+this.#n:"";this.matchEmit(r?n+r+s:"."+s);}}async match(t,e,i){let s=await this.matchCheck(t,i);s&&this.matchFinish(s,e);}matchSync(t,e,i){let s=this.matchCheckSync(t,i);s&&this.matchFinish(s,e);}walkCB(t,e,i){this.signal?.aborted&&i(),this.walkCB2(t,e,new xi(this.opts),i);}walkCB2(t,e,i,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2(t,e,i,s));return}i.processPatterns(t,e);let r=1,n=()=>{--r===0&&s();};for(let[o,a,l]of i.matches.entries())this.#r(o)||(r++,this.match(o,a,l).then(()=>n()));for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let a=o.readdirCached();o.calledReaddir()?this.walkCB3(o,a,i,n):o.readdirCB((l,h)=>this.walkCB3(o,h,i,n),true);}n();}walkCB3(t,e,i,s){i=i.filterEntries(t,e);let r=1,n=()=>{--r===0&&s();};for(let[o,a,l]of i.matches.entries())this.#r(o)||(r++,this.match(o,a,l).then(()=>n()));for(let[o,a]of i.subwalks.entries())r++,this.walkCB2(o,a,i.child(),n);n();}walkCBSync(t,e,i){this.signal?.aborted&&i(),this.walkCB2Sync(t,e,new xi(this.opts),i);}walkCB2Sync(t,e,i,s){if(this.#o(t))return s();if(this.signal?.aborted&&s(),this.paused){this.onResume(()=>this.walkCB2Sync(t,e,i,s));return}i.processPatterns(t,e);let r=1,n=()=>{--r===0&&s();};for(let[o,a,l]of i.matches.entries())this.#r(o)||this.matchSync(o,a,l);for(let o of i.subwalkTargets()){if(this.maxDepth!==1/0&&o.depth()>=this.maxDepth)continue;r++;let a=o.readdirSync();this.walkCB3Sync(o,a,i,n);}n();}walkCB3Sync(t,e,i,s){i=i.filterEntries(t,e);let r=1,n=()=>{--r===0&&s();};for(let[o,a,l]of i.matches.entries())this.#r(o)||this.matchSync(o,a,l);for(let[o,a]of i.subwalks.entries())r++,this.walkCB2Sync(o,a,i.child(),n);n();}},ki=class extends Ls{matches=new Set;constructor(t,e,i){super(t,e,i);}matchEmit(t){this.matches.add(t);}async walk(){if(this.signal?.aborted)throw this.signal.reason;return this.path.isUnknown()&&await this.path.lstat(),await new Promise((t,e)=>{this.walkCB(this.path,this.patterns,()=>{this.signal?.aborted?e(this.signal.reason):t(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}},Ai=class extends Ls{results;constructor(t,e,i){super(t,e,i),this.results=new se({signal:this.signal,objectMode:true}),this.results.on("drain",()=>this.resume()),this.results.on("resume",()=>this.resume());}matchEmit(t){this.results.write(t),this.results.flowing||this.pause();}stream(){let t=this.path;return t.isUnknown()?t.lstat().then(()=>{this.walkCB(t,this.patterns,()=>this.results.end());}):this.walkCB(t,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}},sl=typeof process=="object"&&process&&typeof process.platform=="string"?process.platform:"linux",ft=class{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(t,e){if(!e)throw new TypeError("glob options required");if(this.withFileTypes=!!e.withFileTypes,this.signal=e.signal,this.follow=!!e.follow,this.dot=!!e.dot,this.dotRelative=!!e.dotRelative,this.nodir=!!e.nodir,this.mark=!!e.mark,e.cwd?(e.cwd instanceof URL||e.cwd.startsWith("file://"))&&(e.cwd=fileURLToPath(e.cwd)):this.cwd="",this.cwd=e.cwd||"",this.root=e.root,this.magicalBraces=!!e.magicalBraces,this.nobrace=!!e.nobrace,this.noext=!!e.noext,this.realpath=!!e.realpath,this.absolute=e.absolute,this.includeChildMatches=e.includeChildMatches!==false,this.noglobstar=!!e.noglobstar,this.matchBase=!!e.matchBase,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:1/0,this.stat=!!e.stat,this.ignore=e.ignore,this.withFileTypes&&this.absolute!==void 0)throw new Error("cannot set absolute and withFileTypes:true");if(typeof t=="string"&&(t=[t]),this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false,this.windowsPathsNoEscape&&(t=t.map(a=>a.replace(/\\/g,"/"))),this.matchBase){if(e.noglobstar)throw new TypeError("base matching requires globstar");t=t.map(a=>a.includes("/")?a:`./**/${a}`);}if(this.pattern=t,this.platform=e.platform||sl,this.opts={...e,platform:this.platform},e.scurry){if(this.scurry=e.scurry,e.nocase!==void 0&&e.nocase!==e.scurry.nocase)throw new Error("nocase option contradicts provided scurry option")}else {let a=e.platform==="win32"?ze:e.platform==="darwin"?Ps:e.platform?Be:Za;this.scurry=new a(this.cwd,{nocase:e.nocase,fs:e.fs});}this.nocase=this.scurry.nocase;let i=this.platform==="darwin"||this.platform==="win32",s={braceExpandMax:1e4,...e,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:i,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug},r=this.pattern.map(a=>new lt(a,s)),[n,o]=r.reduce((a,l)=>(a[0].push(...l.set),a[1].push(...l.globParts),a),[[],[]]);this.patterns=n.map((a,l)=>{let h=o[l];if(!h)throw new Error("invalid pattern object");return new $s(a,h,0,this.platform)});}async walk(){return [...await new ki(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 ki(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 Ai(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 Ai(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()}},rl=(t,e={})=>{Array.isArray(t)||(t=[t]);for(let i of t)if(new lt(i,e).hasMagic())return true;return false};function he(t,e={}){return new ft(t,e).streamSync()}function Ns(t,e={}){return new ft(t,e).stream()}function _s(t,e={}){return new ft(t,e).walkSync()}async function Ci(t,e={}){return new ft(t,e).walk()}function ue(t,e={}){return new ft(t,e).iterateSync()}function Ds(t,e={}){return new ft(t,e).iterate()}var nl=he,ol=Object.assign(Ns,{sync:he}),al=ue,ll=Object.assign(Ds,{sync:ue}),hl=Object.assign(_s,{stream:he,iterate:ue}),_t=Object.assign(Ci,{glob:Ci,globSync:_s,sync:hl,globStream:Ns,stream:ol,globStreamSync:he,streamSync:nl,globIterate:Ds,iterate:ll,globIterateSync:ue,iterateSync:al,Glob:ft,hasMagic:rl,escape:ls,unescape:vt});_t.glob=_t;var $e=z$1.object({description:z$1.string(),type:z$1.string().optional(),parent:z$1.string().optional(),anchors:z$1.array(z$1.string()).optional(),tags:z$1.array(z$1.string()).optional(),endpoints:z$1.array(z$1.string()).optional(),tests:z$1.array(z$1.string()).optional(),rules:z$1.record(z$1.unknown()).optional(),aspects:z$1.array(z$1.string()).optional(),flows:z$1.array(z$1.string()).optional(),gates:z$1.array(z$1.string()).optional(),signals:z$1.array(z$1.string()).optional(),states:z$1.array(z$1.string()).optional(),components:z$1.array(z$1.string()).optional(),location:z$1.string().optional(),locations:z$1.array(z$1.string()).optional(),uses:z$1.array(z$1.string()).optional(),"used-by":z$1.array(z$1.string()).optional(),"used-for":z$1.array(z$1.string()).optional(),exports:z$1.array(z$1.string()).optional(),status:z$1.string().optional(),properties:z$1.record(z$1.unknown()).optional(),handles:z$1.array(z$1.string()).optional()}).passthrough(),Ei=$e.extend({id:z$1.string()}),ul=z$1.object({description:z$1.string().optional(),category:z$1.string().optional(),severity:z$1.enum(["info","warn","error"]).optional(),emitters:z$1.array(z$1.string()).optional(),related:z$1.array(z$1.string()).optional(),data:z$1.record(z$1.unknown()).optional()}),cl=z$1.union([ul,z$1.string().transform(t=>({description:t}))]),pl=z$1.object({from:z$1.string(),to:z$1.string(),type:z$1.string(),description:z$1.string().optional()}),fl=z$1.union([pl,z$1.string()]),dl=z$1.object({component:z$1.string(),action:z$1.string(),description:z$1.string().optional()}),Ws=z$1.union([dl,z$1.string()]),gl=z$1.object({name:z$1.string(),description:z$1.string().optional(),steps:z$1.array(Ws)}),ml=z$1.object({description:z$1.string().optional(),gates:z$1.array(z$1.string()).optional(),signals:z$1.array(z$1.string()).optional(),components:z$1.array(z$1.string()).optional(),steps:z$1.array(Ws).optional()}),yl=z$1.object({description:z$1.string().optional(),requires:z$1.array(z$1.string()).optional(),keys:z$1.array(z$1.string()).optional(),signals:z$1.array(z$1.string()).optional()}),wl=z$1.object({description:z$1.string().optional(),default:z$1.unknown().optional(),type:z$1.string().optional()}),bl=z$1.object({description:z$1.string().optional(),tags:z$1.array(z$1.string()).optional(),anchors:z$1.array(z$1.string()).optional(),"applies-to":z$1.array(z$1.string()).optional(),enforcement:z$1.string().optional()}),vl=z$1.object({target:z$1.string(),type:z$1.string(),path:z$1.string()}),Sl=z$1.object({version:z$1.string().optional(),description:z$1.string().optional(),apiSpec:z$1.string().optional(),context:z$1.array(z$1.string()).optional(),rules:z$1.record(z$1.unknown()).optional(),features:z$1.union([z$1.array(Ei),z$1.record($e)]).optional(),components:z$1.union([z$1.array(Ei),z$1.record($e)]).optional(),gates:z$1.record(yl).optional(),states:z$1.record(wl).optional(),signals:z$1.record(cl).optional(),aspects:z$1.record(bl).optional(),relationships:z$1.array(fl).optional(),flows:z$1.union([z$1.array(gl),z$1.record(ml)]).optional(),references:z$1.array(vl).optional()});function xl(t){let e=kl(t);return {data:e.data,errors:e.errors}}function kl(t){let e=[],i=[],s;try{s=z.readFileSync(t,"utf8");}catch(a){let l=`Cannot read file: ${a.message}`;return e.push(l),i.push({message:l,type:"file"}),{data:null,errors:e,detailedErrors:i,rawContent:void 0,isYamlValid:false}}let r=s.replace(/^([#~!$^][\w-]+):/gm,'"$1":').replace(/^(\s*-\s+)([!#][\w-]+)$/gm,'$1"$2"'),n=null;try{n=ae(r);}catch(a){let l=a,h=l.mark?.line?l.mark.line+1:void 0,c=`YAML syntax error: ${l.reason||a.message}`;return e.push(`${c}${h?` (line ${h})`:""}`),i.push({message:c,line:h,type:"yaml"}),{data:null,errors:e,detailedErrors:i,rawContent:s,isYamlValid:false}}if(n==null)return {data:{},errors:[],detailedErrors:[],rawContent:s,isYamlValid:true};if(typeof n=="object"&&n!==null){let a=n,l={"#":"components",$:"flows","^":"gates","!":"signals","~":"aspects"};for(let h of Object.keys(a)){let c=h[0],u=l[c];if(!u||h.length<2)continue;let f=h.slice(1),d=a[h];if(typeof d!="object"||d===null)continue;let g=a[u]||{};u in a||(a[u]=g),f in g||(g[f]=d),delete a[h];}}let o=Sl.safeParse(n);if(!o.success){for(let a of o.error.issues){let l=a.path.join("."),h=a.message;e.push(`Schema error at ${l||"/"}: ${h}`),i.push({message:h,path:l||"/",type:"schema"});}return {data:n,errors:e,detailedErrors:i,rawContent:s,isYamlValid:true}}return {data:o.data,errors:[],detailedErrors:[],rawContent:s,isYamlValid:true}}function re(t){return t?Array.isArray(t)?t.map(e=>[e.id,e]):Object.entries(t):[]}async function Al(t){let e=A.resolve(t);return (await _t("**/.purpose",{cwd:e,absolute:true,ignore:["**/node_modules/**","**/dist/**","**/.git/**"]})).sort((i,s)=>{let r=i.split(A.sep).length,n=s.split(A.sep).length;return r-n})}async function Cl(t){let e=await Al(t),i=[];for(let s of e){let{data:r,errors:n}=xl(s);r&&(i.push({filePath:s,data:r}),n.length>0&&console.warn(`Warnings parsing ${s}:`,n));}return i}function El(t){let e=new Map;for(let{filePath:i,data:s}of t){let r=re(s.features);for(let[n,o]of r)e.set(n,{item:o,filePath:i});}return e}function Ol(t){let e=new Map;for(let{filePath:i,data:s}of t){let r=re(s.components);for(let[n,o]of r)e.set(n,{item:o,filePath:i});}return e}function Tl(t){let e=new Map;for(let{filePath:i,data:s}of t)if(s.gates)for(let[r,n]of Object.entries(s.gates))e.set(r,{item:n,filePath:i});return e}function jl(t){let e=new Map;for(let{filePath:i,data:s}of t)if(s.states)for(let[r,n]of Object.entries(s.states))e.set(r,{item:n,filePath:i});return e}function Fl(t){let e=new Map;for(let{filePath:i,data:s}of t)if(s.flows)if(Array.isArray(s.flows))for(let r of s.flows)e.set(r.name,{item:{id:r.name,description:r.description,steps:r.steps},filePath:i});else for(let[r,n]of Object.entries(s.flows))e.set(r,{item:{id:r,description:n.description,gates:n.gates,signals:n.signals,components:n.components,steps:n.steps},filePath:i});return e}function Pl(t){let e=new Map;for(let{filePath:i,data:s}of t)if(s.signals)for(let[r,n]of Object.entries(s.signals))e.set(r,{item:n,filePath:i});return e}function $l(t){let e=new Map;for(let{filePath:i,data:s}of t)if(s.aspects)for(let[r,n]of Object.entries(s.aspects))e.set(r,{item:n,filePath:i});return e}function Ml(t){let e=[],i=new Set;for(let{filePath:s,data:r}of t){let n=re(r.features);for(let[a,l]of n)Oi(`#${a}`,l,s,e,i);let o=re(r.components);for(let[a,l]of o)Oi(`#${a}`,l,s,e,i);}return e}function Oi(t,e,i,s,r){if(e.flows)for(let n of e.flows){let o=n.startsWith("$")?n:`$${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"flow",sourceSymbol:t,filePath:i}));}if(e.gates)for(let n of e.gates){let o=n.startsWith("^")?n:`^${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"gate",sourceSymbol:t,filePath:i}));}if(e.signals)for(let n of e.signals){let o=n.startsWith("!")?n:`!${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"signal",sourceSymbol:t,filePath:i}));}if(e.states)for(let n of e.states){let o=n.startsWith("#")?n:n.startsWith("%")?`#${n.slice(1)}`:`#${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"component",sourceSymbol:t,filePath:i}));}if(e.components)for(let n of e.components){let o=n.startsWith("#")?n:`#${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"component",sourceSymbol:t,filePath:i}));}if(e.aspects)for(let n of e.aspects){let o=n.startsWith("~")?n:`~${n}`;r.has(o)||(r.add(o),s.push({symbol:o,type:"aspect",sourceSymbol:t,filePath:i}));}if(e.description){let n=Il(e.description);for(let{symbol:o,type:a}of n)r.has(o)||(r.add(o),s.push({symbol:o,type:a,sourceSymbol:t,filePath:i}));}}var Rl=new Set(["$lib","$env","$app","$service-worker","$virtual","$schema","$ref","$id","$type"]);function Il(t){let e=[],i=/([$^!#~%])([a-zA-Z][a-zA-Z0-9._-]*)/g,s;for(;(s=i.exec(t))!==null;){let r=s[1],n=s[2],o,a;switch(r){case "#":a="component",o=`#${n}`;break;case "$":a="flow",o=`$${n}`;break;case "^":a="gate",o=`^${n}`;break;case "!":a="signal",o=`!${n}`;break;case "~":a="aspect",o=`~${n}`;break;case "%":a="component",o=`#${n}`;break;default:continue}Rl.has(o)||e.push({symbol:o,type:a});}return e}var Ll={visualizerPort:42195,watcherPort:42196,autoConnect:true};async function ke(t){let e=A.resolve(t),i=A.dirname(e);if(!z.existsSync(e))throw new Error(`Gate config not found: ${e}`);let s=z.readFileSync(e,"utf8"),r=ae(s);if(!r.version)throw new Error('Gate config missing required "version" field');let n=[],o=r,a=r.gates||o.portals;if(a)for(let[h,c]of Object.entries(a)){let u=h.startsWith("^")?h.slice(1):h;n.push(Me(u,c));}if(r.include)for(let h of r.include){let c=A.join(i,h),u=await _t(c.replace(/\\/g,"/"));for(let f of u){let d=await Nl(f);n.push(...d);}}let l=[];if(r.flows)for(let[h,c]of Object.entries(r.flows))l.push(Wl(h,c));return {version:r.version,gates:n,flows:l,settings:{dev:{...Ll,...r.settings?.dev}}}}async function Nl(t){let e=z.readFileSync(t,"utf8"),i=ae(e);if(i.id){let s=i.id,r=s.startsWith("^")?s.slice(1):s;return [Me(r,i)]}if(i.gates){let s=[];for(let[r,n]of Object.entries(i.gates)){let o=r.startsWith("^")?r.slice(1):r;s.push(Me(o,n));}return s}return []}function Me(t,e){let i=[];if(e.locks)for(let r of e.locks)i.push(_l(r));let s=[];if(e.prizes)for(let r of e.prizes)s.push(Dl(r));return {id:t,description:e.description,locks:i,prizes:s,position:e.position}}function _l(t){let e=t,i=[];if(e.keys){for(let s of e.keys)if(typeof s=="string")i.push({expression:s});else if(s.expression){let r=s;i.push({expression:r.expression,description:r.description});}}return {id:e.id,description:e.description,keys:i,mode:e.mode||"all"}}function Dl(t){let e=t;return {id:e.id,oneTime:e.oneTime??false,metadata:e.metadata}}function Wl(t,e){return {id:t,description:e.description,gates:e.gates||[],forkable:e.forkable}}async function zl(t){let e=A.resolve(t);return await _t("**/portal.yaml",{cwd:e,absolute:true,ignore:["**/node_modules/**","**/dist/**","**/.git/**"]})}var Bl={component:"#",flow:"$",gate:"^",signal:"!",aspect:"~"},Ul={"#":"component",$:"flow","^":"gate","!":"signal","~":"aspect"},Gl=["#","$","^","!","~"];function Yl(t){return Gl.includes(t)}var ql=z$1.object({x:z$1.number(),y:z$1.number()}),Vl=z$1.object({x:z$1.number(),y:z$1.number(),zoom:z$1.number()}),Ti=z$1.object({path:z$1.string(),include:z$1.array(z$1.string()).optional(),exclude:z$1.array(z$1.string()).optional()}),zs=z$1.object({id:z$1.string(),symbol:z$1.string(),type:z$1.enum(["feature","component","flow","state","aspect","gate","signal","idea"]),content:z$1.string().optional(),position:ql,tags:z$1.array(z$1.string()).optional(),created:z$1.string(),modified:z$1.string().optional()}),Bs=z$1.object({from:z$1.string(),to:z$1.string(),label:z$1.string().optional(),type:z$1.string().optional()}),Zl=z$1.object({id:z$1.string(),name:z$1.string(),nodes:z$1.array(z$1.string()),color:z$1.string().optional()}),Us=z$1.object({viewport:Vl,groups:z$1.array(Zl).optional()}),Kl=z$1.object({nodes:z$1.array(zs),connections:z$1.array(Bs),layout:Us}),Hl=z$1.object({id:z$1.string(),name:z$1.string(),timestamp:z$1.string(),description:z$1.string().optional(),state:Kl}),Jl=z$1.object({version:z$1.string(),metadata:z$1.object({name:z$1.string(),created:z$1.string(),modified:z$1.string()}),sources:z$1.object({purpose:z$1.array(Ti).optional(),portal:z$1.array(Ti).optional()}),nodes:z$1.array(zs),connections:z$1.array(Bs),layout:Us,snapshots:z$1.array(Hl).optional()});function yh(t){let e=[],i;try{i=z.readFileSync(t,"utf8");}catch(s){return e.push(`Cannot read file: ${s.message}`),{data:null,errors:e,rawContent:void 0}}return Xl(i)}function Xl(t){let e=[],i=null;try{i=ae(t);}catch(r){let n=r,o=n.mark?.line?n.mark.line+1:void 0;return e.push(`YAML syntax error: ${n.reason||r.message}${o?` (line ${o})`:""}`),{data:null,errors:e,rawContent:t}}if(i==null)return {data:Gs(),errors:[],rawContent:t};let s=Jl.safeParse(i);if(!s.success){for(let r of s.error.issues){let n=r.path.join(".");e.push(`Schema error at ${n||"/"}: ${r.message}`);}return {data:i,errors:e,rawContent:t}}return {data:s.data,errors:[],rawContent:t}}function Gs(t="Untitled"){let e=new Date().toISOString();return {version:"1.0.0",metadata:{name:t,created:e,modified:e},sources:{purpose:[{path:"./"}],portal:[{path:"./portal.yaml"}]},nodes:[],connections:[],layout:{viewport:{x:0,y:0,zoom:1}}}}function Ql(t){return t.metadata.modified=new Date().toISOString(),Oo(t,{indent:2,lineWidth:-1,noRefs:true,sortKeys:false})}function wh(t="My Project"){return Ql(Gs(t))}function bh(t,e){return {...t,nodes:[...t.nodes,e],metadata:{...t.metadata,modified:new Date().toISOString()}}}function vh(t,e,i){return {...t,nodes:t.nodes.map(s=>s.id===e?{...s,position:i,modified:new Date().toISOString()}:s),metadata:{...t.metadata,modified:new Date().toISOString()}}}function Sh(t,e){return t.connections.some(i=>i.from===e.from&&i.to===e.to)?t:{...t,connections:[...t.connections,e],metadata:{...t.metadata,modified:new Date().toISOString()}}}function xh(t,e,i){let s={id:`snap-${Date.now()}`,name:e,timestamp:new Date().toISOString(),description:i,state:{nodes:[...t.nodes],connections:[...t.connections],layout:{...t.layout}}};return {...t,snapshots:[...t.snapshots||[],s],metadata:{...t.metadata,modified:new Date().toISOString()}}}async function th(t,e){let i=[],s=[],r=[],n=[];if(t.sources.purpose)for(let l of t.sources.purpose){let h=A.resolve(e,l.path);try{let c=await Cl(h);r.push(...c.map(w=>w.filePath));let u=El(c);for(let[w,{item:S,filePath:C}]of u){let G=["feature",...S.tags||[]];i.push(V({id:`purpose-feature-${w}`,symbol:`#${w}`,type:"component",source:"purpose",filePath:C,data:S,description:S.description,tags:G,componentType:S.type,parentSymbol:S.parent,anchors:S.anchors?.map(st=>Ae(st))}));}let f=Ol(c);for(let[w,{item:S,filePath:C}]of f)i.push(V({id:`purpose-component-${w}`,symbol:`#${w}`,type:"component",source:"purpose",filePath:C,data:S,description:S.description,tags:S.tags,componentType:S.type,parentSymbol:S.parent,anchors:S.anchors?.map(G=>Ae(G))}));let d=Tl(c);for(let[w,{item:S,filePath:C}]of d)i.push(V({id:`purpose-gate-${w}`,symbol:`^${w}`,type:"gate",source:"purpose",filePath:C,data:S,description:S.description}));let g=jl(c);for(let[w,{item:S,filePath:C}]of g)i.push(V({id:`purpose-state-${w}`,symbol:`#${w}`,type:"component",source:"purpose",filePath:C,data:S,description:S.description,tags:["state"]}));let m=Fl(c);for(let[w,{item:S,filePath:C}]of m)i.push(V({id:`purpose-flow-${w}`,symbol:`$${w}`,type:"flow",source:"purpose",filePath:C,data:S,description:S.description}));let b=Pl(c);for(let[w,{item:S,filePath:C}]of b)i.push(V({id:`purpose-signal-${w}`,symbol:`!${w}`,type:"signal",source:"purpose",filePath:C,data:S,description:S.description}));let v=$l(c);for(let[w,{item:S,filePath:C}]of v)i.push(V({id:`purpose-aspect-${w}`,symbol:`~${w}`,type:"aspect",source:"purpose",filePath:C,data:S,description:S.description,anchors:S.anchors?.map(G=>Ae(G)),appliesTo:S["applies-to"],tags:S.tags,enforcement:S.enforcement}));let y=Ml(c),k=new Set(i.map(w=>w.symbol));for(let w of y)k.has(w.symbol)||(k.add(w.symbol),i.push(V({id:`purpose-ref-${w.type}-${w.symbol.slice(1)}`,symbol:w.symbol,type:w.type,source:"purpose",filePath:w.filePath,data:{referencedFrom:w.sourceSymbol},description:`Referenced from ${w.sourceSymbol}`})));}catch(c){s.push({source:"purpose",filePath:h,message:c.message});}}if(t.sources.portal)for(let l of t.sources.portal){let h=A.resolve(e,l.path);try{let c;if(h.endsWith(".yaml")||h.endsWith(".yml"))c=await ke(h),n.push(h);else {let u=await zl(h);if(n.push(...u),u.length>0){c=await ke(u[0]);for(let f=1;f<u.length;f++){let d=await ke(u[f]);c.gates.push(...d.gates),c.flows.push(...d.flows);}}else continue}for(let u of c.gates){i.push(eh(u,h));for(let f of u.prizes)i.push(V({id:`gate-signal-${u.id}-${f.id}`,symbol:`!${f.id}`,type:"signal",source:"portal",filePath:h,data:f,description:`Signal from gate ${u.id}`}));}for(let u of c.flows)i.push(ih(u,h));}catch(c){s.push({source:"portal",filePath:h,message:c.message});}}for(let l of t.nodes){let h=l.tags?.includes("idea");if(!l.content&&!h){let c=i.find(u=>u.symbol===l.symbol);if(c){c.position=l.position,c.tags=l.tags;continue}}i.push(V({id:l.id,symbol:l.symbol,type:l.type,source:"premise",filePath:".premise",data:l,description:l.content,position:l.position,tags:l.tags,created:l.created,modified:l.modified}));}rh(i);let o=new Map;for(let l of i){let h=o.get(l.symbol)||[];h.includes(l.filePath)||h.push(l.filePath),o.set(l.symbol,h);}let a=[];for(let[l,h]of o)h.length>1&&a.push({symbol:l,files:h});return {symbols:i,purposeFiles:r,portalFiles:n,errors:s,timestamp:Date.now(),...a.length>0?{duplicateSymbols:a}:{}}}function V(t){return {...t,data:t.data??null,references:t.references??[],referencedBy:t.referencedBy??[]}}function eh(t,e){let i=t.id.startsWith("^")?t.id.slice(1):t.id;return V({id:`gate-${i}`,symbol:`^${i}`,type:"gate",source:"portal",filePath:e,data:t,description:t.description,position:t.position})}function ih(t,e){return V({id:`gate-flow-${t.id}`,symbol:`$${t.id}`,type:"flow",source:"portal",filePath:e,data:t,description:t.description})}function Ae(t){let e=t.lastIndexOf(":");if(e===-1||e===t.length-1)return {path:t,lines:0,raw:t};let i=t.slice(e+1),s=t.slice(0,e);if(!/^[\d,\- ]+$/.test(i))return {path:t,lines:0,raw:t};if(i.includes("-")){let[r,n]=i.split("-").map(Number);return {path:s,lines:[r,n],raw:t}}else if(i.includes(",")){let r=i.split(",").map(Number);return {path:s,lines:r,raw:t}}else return {path:s,lines:Number(i),raw:t}}var sh=new Set(["$lib","$env","$app","$service-worker","$virtual","$schema","$ref","$id","$type"]);function rh(t){let e=new Map(t.map(i=>[i.symbol,i]));for(let i of t){let s=JSON.stringify(i.data),r=/(?:\?[@#$%~^!]|[@#$%~^!?])[a-zA-Z][\w-]*/g,n=(s.match(r)||[]).filter(o=>!sh.has(o));for(let o of n)if(o!==i.symbol&&e.has(o)){i.references.includes(o)||i.references.push(o);let a=e.get(o);a&&!a.referencedBy.includes(i.symbol)&&a.referencedBy.push(i.symbol);}}}async function kh(t){let e={metadata:{name:A.basename(t),created:new Date().toISOString(),modified:new Date().toISOString()},sources:{purpose:[{path:"./"}],portal:[{path:"./"}]},nodes:[]};return th(e,t)}function nh(){return {entries:new Map,byType:new Map,bySource:new Map,timestamp:0}}function Ah(t){let e=nh();e.timestamp=t.timestamp;for(let i of t.symbols)e.entries.set(i.id,i),e.byType.has(i.type)||e.byType.set(i.type,[]),e.byType.get(i.type).push(i),e.bySource.has(i.source)||e.bySource.set(i.source,[]),e.bySource.get(i.source).push(i);return e}function ne(t,e){for(let i of t.entries.values())if(i.symbol===e)return i}function Ch(t,e){return t.entries.get(e)}function Dt(t,e){return t.byType.get(e)||[]}function Eh(t,e){return t.bySource.get(e)||[]}function oh(t,e){let i=e.toLowerCase(),s=[];for(let r of t.entries.values()){if(r.symbol.toLowerCase().includes(i)){s.push(r);continue}if(r.description?.toLowerCase().includes(i)){s.push(r);continue}if(r.tags?.some(n=>n.toLowerCase().includes(i))){s.push(r);continue}if(r.componentType?.toLowerCase().includes(i)){s.push(r);continue}}return s}function Oh(t,e){return Dt(t,"component").filter(i=>i.componentType===e)}function Th(t){let e=new Set,i=Dt(t,"component");for(let s of i)s.componentType&&e.add(s.componentType);return Array.from(e).sort()}function jh(t,e){return Dt(t,"component").filter(i=>i.parentSymbol===e)}function Fh(t,e){let i=ne(t,e);return i?i.referencedBy.map(s=>ne(t,s)).filter(s=>s!==void 0):[]}function Ph(t,e){let i=ne(t,e);return i?i.references.map(s=>ne(t,s)).filter(s=>s!==void 0):[]}function $h(t,e){let i=[];for(let s of t.entries.values())s.tags?.includes(e)&&i.push(s);return i}function Mh(t){let e=new Set;for(let i of t.entries.values())for(let s of i.tags||[])e.add(s);return Array.from(e).sort()}function Rh(t){let e={component:0,flow:0,gate:0,signal:0,aspect:0};for(let[i,s]of t.byType)i in e&&(e[i]=s.length);return e}function Ih(t){return Array.from(t.entries.values())}function Ys(t){if(t.length<2)return null;let e=t[0],i=t.slice(1);return Yl(e)?{type:Ul[e],name:i}:null}function Lh(t,e){return `${Bl[t]}${e}`}function Nh(t){return Ys(t)!==null}function _h(t,e,i=10){let s=e.toLowerCase(),r=Ys(e);return r?Dt(t,r.type).filter(n=>n.symbol.toLowerCase().includes(s)).slice(0,i):oh(t,e).slice(0,i)}function ah(t,e,i){if(A.isAbsolute(t))return {resolvedPath:t,baseUsed:"absolute",exists:z.existsSync(t)};let s=A.join(i,t);if(z.existsSync(s))return {resolvedPath:s,baseUsed:"project-root",exists:true};let r=A.resolve(e,t);return z.existsSync(r)?{resolvedPath:r,baseUsed:"purpose-dir",exists:true}:{resolvedPath:s,baseUsed:"project-root",exists:false}}function Dh(t,e,i){if(A.isAbsolute(t)){let n=z.existsSync(t);return {rootResolves:n,purposeResolves:n,mismatch:false}}let s=z.existsSync(A.join(i,t)),r=z.existsSync(A.resolve(e,t));return {rootResolves:s,purposeResolves:r,mismatch:s!==r}}function lh(t,e){return t.includes("*")?new RegExp("^"+t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$").test(e):t===e}function Wh(t,e,i){let s=[],r=Dt(t,"aspect"),n=new Set;for(let o of r){let a=o.appliesTo||[];if(a.length!==0)for(let l of a)for(let h of e){if(!lh(l,h))continue;let c=o.anchors||[];if(c.length===0){let u=`${o.symbol}::__no-anchors__`;n.has(u)||(n.add(u),s.push({aspectSymbol:o.symbol,anchorRaw:null,kind:"no-anchors"}));}else {let u=o.filePath?A.isAbsolute(o.filePath)?o.filePath:A.resolve(i,o.filePath):i,f=o.filePath?A.dirname(u):i;for(let d of c){let g=`${o.symbol}::${d.raw}`;n.has(g)||ah(d.path,f,i).exists||(n.add(g),s.push({aspectSymbol:o.symbol,anchorRaw:d.raw,kind:"missing-file"}));}}}}return s}/*! Bundled license information:
36
+
37
+ js-yaml/dist/js-yaml.mjs:
38
+ (*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT *)
39
+ */export{Ul as PREFIX_TO_TYPE,Bl as SYMBOL_PREFIXES,Sh as addConnection,bh as addPremiseNode,kh as aggregateFromDirectory,th as aggregateFromPremise,Ah as buildSymbolIndex,Wh as checkAspectAnchors,Gs as createEmptyPremiseFile,xh as createSnapshot,nh as createSymbolIndex,Lh as createSymbolString,Dh as detectAnchorBaseMismatch,Th as getAllComponentTypes,Ih as getAllSymbols,Mh as getAllTags,_h as getAutocompleteSuggestions,jh as getChildComponents,Oh as getComponentsByType,wh as getDefaultPremiseContent,Ph as getReferencesFrom,Fh as getReferencesTo,ne as getSymbol,Ch as getSymbolById,Rh as getSymbolCounts,Eh as getSymbolsBySource,$h as getSymbolsByTag,Dt as getSymbolsByType,Nh as isValidSymbol,Xl as parsePremiseContent,yh as parsePremiseFile,Ys as parseSymbol,ah as resolveAnchorPath,oh as searchSymbols,Ql as serializePremiseFile,vh as updateNodePosition};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{b as PREFIX_TO_TYPE,a as SYMBOL_PREFIXES,j as addConnection,h as addPremiseNode,m as aggregateFromDirectory,l as aggregateFromPremise,o as buildSymbolIndex,J as checkAspectAnchors,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,I as detectAnchorBaseMismatch,v as getAllComponentTypes,C as getAllSymbols,A as getAllTags,G as getAutocompleteSuggestions,w as getChildComponents,u as getComponentsByType,g as getDefaultPremiseContent,y as getReferencesFrom,x as getReferencesTo,p as getSymbol,q as getSymbolById,B as getSymbolCounts,s as getSymbolsBySource,z as getSymbolsByTag,r as getSymbolsByType,F as isValidSymbol,d as parsePremiseContent,c as parsePremiseFile,D as parseSymbol,H as resolveAnchorPath,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-4GC35IFF.js';import'./chunk-JIXHEBGK.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';
2
+ export{b as PREFIX_TO_TYPE,a as SYMBOL_PREFIXES,j as addConnection,h as addPremiseNode,m as aggregateFromDirectory,l as aggregateFromPremise,o as buildSymbolIndex,J as checkAspectAnchors,e as createEmptyPremiseFile,k as createSnapshot,n as createSymbolIndex,E as createSymbolString,I as detectAnchorBaseMismatch,v as getAllComponentTypes,C as getAllSymbols,A as getAllTags,G as getAutocompleteSuggestions,w as getChildComponents,u as getComponentsByType,g as getDefaultPremiseContent,y as getReferencesFrom,x as getReferencesTo,p as getSymbol,q as getSymbolById,B as getSymbolCounts,s as getSymbolsBySource,z as getSymbolsByTag,r as getSymbolsByType,F as isValidSymbol,d as parsePremiseContent,c as parsePremiseFile,D as parseSymbol,H as resolveAnchorPath,t as searchSymbols,f as serializePremiseFile,i as updateNodePosition}from'./chunk-D6BSCELB.js';import'./chunk-K6TLYNRQ.js';import'./chunk-ZJQY5PPP.js';import'./chunk-5TAVYPOV.js';
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {a,d,e,f,g,b}from'./chunk-BFD3GFRK.js';import'./chunk-5TAVYPOV.js';import n from'chalk';import*as t from'fs';import*as o from'path';import {fileURLToPath}from'url';async function C(c){let s=process.cwd(),e=parseInt(c.port||"3850",10),p=c.open!==false;console.log(n.cyan(`
3
3
  Starting Paradigm Docs...
4
- `));try{let{startPlatformServer:i}=await import('./platform-server-Y6TLEXR2.js');await i({projectDir:s,port:e,open:p,sections:["overview","docs"]}),console.log(n.green(` Docs running at ${n.bold(`http://localhost:${e}`)}`)),console.log(n.gray(` Press Ctrl+C to stop
4
+ `));try{let{startPlatformServer:i}=await import('./platform-server-IOWHNS7Q.js');await i({projectDir:s,port:e,open:p,sections:["overview","docs"]}),console.log(n.green(` Docs running at ${n.bold(`http://localhost:${e}`)}`)),console.log(n.gray(` Press Ctrl+C to stop
5
5
  `)),await new Promise(()=>{});}catch(i){i.code==="EADDRINUSE"?(console.error(n.red(`
6
6
  Error: Port ${e} is already in use.`)),console.log(n.gray(` Try: paradigm docs serve --port ${e+1}
7
7
  `))):console.error(n.red(`
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import {a as a$1}from'./chunk-RPGSQQTS.js';import {a}from'./chunk-NFN5UUJB.js';import {b,a as a$2}from'./chunk-EK4ZRIFJ.js';import'./chunk-5TAVYPOV.js';import {execFileSync}from'child_process';b();var y="gh";function p(o){let e=o.match(/^([^/\s]+\/[^/#\s]+)#\d+$/);if(e)return e[1];let s=o.match(/github\.com\/([^/]+\/[^/]+)\/issues\/\d+/);if(s)return s[1]}function v(o){let e=o.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);return e?`${e[1]}#${e[2]}`:void 0}function d(o){let e=o.match(/#(\d+)$/)||o.match(/\/issues\/(\d+)/);return e?e[1]:o}var m=class{id="github";repo;run;constructor(e={}){this.repo=e.repo,this.run=e.run??(s=>execFileSync(y,s,{encoding:"utf8",timeout:2e4}));}capabilities(){return {push:true,comment:true,pull:true,close:true}}async isAvailable(){try{return this.run(["auth","status"]),!0}catch{return false}}async push(e){let s=this.resolveRepo(e),t=this.renderBody(e),r=a$1(e.claimant),n=["issue","create","--title",e.blurb,"--body",t];s&&n.push("--repo",s),r.assignee&&n.push("--assignee","@me");let a=this.run(n).trim(),l=a.split(`
3
+ `).map(i=>i.trim()).find(i=>/github\.com\//.test(i)),c=l?v(l):void 0;if(!c)throw a$2.component("#github-provider").warn("Could not parse issue ref from gh output",{stdout:a}),new Error(`gh issue create did not return a parseable issue URL: ${a||"(empty)"}`);return a$2.component("#github-provider").info("Pushed task to GitHub",{taskId:e.id,ref:c}),{ref:c,url:l}}async comment(e,s){let t=p(e.ref)??this.repo,r=["issue","comment",d(e.ref),"--body",s];t&&r.push("--repo",t),this.run(r),a$2.component("#github-provider").info("Commented on GitHub issue",{ref:e.ref});}async close(e,s="completed"){let t=p(e.ref)??this.repo,r=["issue","close",d(e.ref),"--reason",s];t&&r.push("--repo",t),this.run(r),a$2.component("#github-provider").info("Closed GitHub issue",{ref:e.ref,reason:s});}async reopen(e){let s=p(e.ref)??this.repo,t=["issue","reopen",d(e.ref)];s&&t.push("--repo",s),this.run(t),a$2.component("#github-provider").info("Reopened GitHub issue",{ref:e.ref});}async edit(e,s){let t=p(e.ref)??this.repo,r=["issue","edit",d(e.ref)];for(let n of s.addLabels??[])r.push("--add-label",n);for(let n of s.removeLabels??[])r.push("--remove-label",n);s.addAssignee&&r.push("--add-assignee",s.addAssignee),r.length!==3&&(t&&r.push("--repo",t),this.run(r));}async pull(e){let s=p(e.ref)??this.repo,t=["issue","view",d(e.ref),"--json","state,stateReason,assignees,labels,title,url"];s&&t.push("--repo",s);let r=this.run(t),n=JSON.parse(r),a=(n.state||"").toUpperCase()==="CLOSED"?"closed":"open",l=(n.stateReason||"").toUpperCase();return {status:a,closedReason:a==="closed"?l==="NOT_PLANNED"?"not-planned":"completed":void 0,assignees:(n.assignees??[]).map(i=>i.login).filter(i=>!!i),labels:(n.labels??[]).map(i=>i.name).filter(i=>!!i),title:n.title,url:n.url}}resolveRepo(e){if(e.external_ref?.ref){let s=p(e.external_ref.ref);if(s)return s}return this.repo}renderBody(e){let s=[];return s.push(`Synced from Paradigm task \`${e.id}\`.`),s.push(""),e.claimant&&s.push(`Claimant: \`${e.claimant.kind}:${e.claimant.ref}\``),s.push(`Priority: ${e.priority}`),e.tags.length>0&&s.push(`Tags: ${e.tags.join(", ")}`),s.push(""),s.push("\u2014 Synced by Paradigm (two-way). Closing/reopening this issue flows back to the task on the next `paradigm task sync`."),s.join(`
4
+ `)}};a("github",()=>new m);export{m as GithubProvider};
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import {a,b,c,e,d}from'./chunk-QO7YPQXC.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as u from'path';import {execSync}from'child_process';import o from'chalk';import*as C from'js-yaml';var $=".paradigm/habits.yaml",G=new Set(["explore-before-implement","ripple-before-modify","check-fragility","wisdom-before-implement","verify-before-done","postflight-compliance","test-new-components","purpose-coverage","record-lore-for-significant","gates-for-routes"]),x=["discovery","verification","testing","documentation","collaboration","security"],E=["preflight","postflight","on-stop","on-commit"],I=["advisory","warn","block"],P=["tool-called","file-exists","file-modified","lore-recorded","symbols-registered","gates-declared","tests-exist","git-clean"];function T(e,t){let r=u.join(e,$),i=F(r,t);if(i)return {source:"project",...i};let n=process.env.HOME||process.env.USERPROFILE||"~",l=u.join(n,".paradigm","habits.yaml"),c=F(l,t);return c?{source:"global",...c}:G.has(t)?{source:"seed",filePath:"",index:-1}:null}function F(e,t){if(!g.existsSync(e))return null;try{let r=g.readFileSync(e,"utf8"),i=C.load(r);if(!i?.habits)return null;let n=i.habits.findIndex(l=>l.id===t);return n===-1?null:{filePath:e,index:n}}catch{return null}}function D(e){let t=g.readFileSync(e,"utf8"),r=C.load(t);return r.habits||(r.habits=[]),r.overrides||(r.overrides={}),r}function w(e,t){g.writeFileSync(e,C.dump(t,{lineWidth:80,noRefs:true}),"utf8");}function L(e){let t=u.join(e,$);if(!g.existsSync(t)){let r=u.dirname(t);g.existsSync(r)||g.mkdirSync(r,{recursive:true}),w(t,{version:"1.0",habits:[],overrides:{}});}return t}async function J(e){let t=process.cwd(),r;try{r=a(t);}catch(s){console.log(o.red("Failed to load habits:"),s.message);return}if(e.trigger&&(r=r.filter(s=>s.trigger===e.trigger)),e.category&&(r=r.filter(s=>s.category===e.category)),e.json){console.log(JSON.stringify(r,null,2));return}let i=r.filter(s=>s.enabled),n=r.filter(s=>!s.enabled);console.log(o.magenta(`
2
+ import {a,b,c}from'./chunk-FNYYQNJY.js';import {n,m}from'./chunk-WMTES556.js';import'./chunk-5TAVYPOV.js';import*as g from'fs';import*as u from'path';import {execSync}from'child_process';import o from'chalk';import*as C from'js-yaml';var $=".paradigm/habits.yaml",G=new Set(["explore-before-implement","ripple-before-modify","check-fragility","wisdom-before-implement","verify-before-done","postflight-compliance","test-new-components","purpose-coverage","record-lore-for-significant","gates-for-routes"]),x=["discovery","verification","testing","documentation","collaboration","security"],E=["preflight","postflight","on-stop","on-commit"],I=["advisory","warn","block"],P=["tool-called","file-exists","file-modified","lore-recorded","symbols-registered","gates-declared","tests-exist","git-clean"];function T(e,t){let r=u.join(e,$),i=F(r,t);if(i)return {source:"project",...i};let n=process.env.HOME||process.env.USERPROFILE||"~",l=u.join(n,".paradigm","habits.yaml"),c=F(l,t);return c?{source:"global",...c}:G.has(t)?{source:"seed",filePath:"",index:-1}:null}function F(e,t){if(!g.existsSync(e))return null;try{let r=g.readFileSync(e,"utf8"),i=C.load(r);if(!i?.habits)return null;let n=i.habits.findIndex(l=>l.id===t);return n===-1?null:{filePath:e,index:n}}catch{return null}}function D(e){let t=g.readFileSync(e,"utf8"),r=C.load(t);return r.habits||(r.habits=[]),r.overrides||(r.overrides={}),r}function w(e,t){g.writeFileSync(e,C.dump(t,{lineWidth:80,noRefs:true}),"utf8");}function L(e){let t=u.join(e,$);if(!g.existsSync(t)){let r=u.dirname(t);g.existsSync(r)||g.mkdirSync(r,{recursive:true}),w(t,{version:"1.0",habits:[],overrides:{}});}return t}async function J(e){let t=process.cwd(),r;try{r=a(t);}catch(s){console.log(o.red("Failed to load habits:"),s.message);return}if(e.trigger&&(r=r.filter(s=>s.trigger===e.trigger)),e.category&&(r=r.filter(s=>s.category===e.category)),e.json){console.log(JSON.stringify(r,null,2));return}let i=r.filter(s=>s.enabled),n=r.filter(s=>!s.enabled);console.log(o.magenta(`
3
3
  Habits (${i.length} active, ${n.length} disabled)
4
4
  `));let l=["preflight","postflight","on-stop","on-commit"];for(let s of l){let y=r.filter(d=>d.trigger===s);if(y.length!==0){console.log(o.cyan(` ${s}:`));for(let d of y){let a=d.enabled?o.green("ON"):o.gray("OFF"),m=d.severity==="block"?o.red(d.severity):d.severity==="warn"?o.yellow(d.severity):o.gray(d.severity);console.log(` ${a} ${o.white(d.id)} [${m}] - ${d.name}`),console.log(o.gray(` ${d.description}`));}console.log();}}let c=u.join(t,$);g.existsSync(c)?console.log(o.gray(` Config: ${$}`)):console.log(o.gray(" Config: using seed habits only (run 'paradigm habits init' to customize)")),console.log();}async function W(e){let t=process.cwd(),r;try{r=a(t);}catch(c){console.log(o.red("Failed to load habits:"),c.message);return}let i=b(r),n=null;try{let{SentinelStorage:c}=await import('./dist-VGFSP3XM.js'),s=u.join(t,".paradigm","sentinel");if(g.existsSync(s)){let y=new c(s),d=e.period||"30d",a=parseInt(d.replace("d",""),10)||30,m=d==="all"?void 0:new Date(Date.now()-a*24*60*60*1e3).toISOString(),v=y.getComplianceRate({dateFrom:m}),f=y.getPracticeEvents({dateFrom:m,limit:500}),b=new Map;for(let h of f){let p=h.habitCategory,S=b.get(p)||{followed:0,skipped:0,partial:0};S[h.result]++,b.set(p,S);}let j=Array.from(b.entries()).map(([h,p])=>{let S=p.followed+p.skipped+p.partial,O=S>0?Math.round((p.followed+p.partial*.5)/S*100):100;return {category:h,rate:O,total:S}}).sort((h,p)=>h.rate-p.rate);n={total:v.total,followed:v.followed,skipped:v.skipped,partial:v.partial,rate:v.rate,byCategory:j};}}catch{}if(e.json){console.log(JSON.stringify({habits:{total:r.length,enabled:i.length},practice:n},null,2));return}console.log(o.magenta(`
5
5
  Habits Practice Profile
@@ -35,8 +35,8 @@ ${C.dump({version:"1.0",habits:[],overrides:{"verify-before-done":{severity:"war
35
35
  # enabled: false # Disable this habit
36
36
  `;g.writeFileSync(r,l,"utf8"),c(t),console.log(o.green(`Created ${$}`)),console.log(o.gray(" 10 seed habits are active by default.")),console.log(o.gray(" Use overrides section to tune severity or disable habits.")),console.log(o.gray(" Run `paradigm habits list` to see all habits.\n"));}async function q(e){let t=process.cwd(),r=u.join(t,$);if(!g.existsSync(r)){console.log(o.yellow(`No ${$} found. Run 'paradigm habits init' first.`));return}if(!x.includes(e.category)){console.log(o.red(`Invalid category: ${e.category}. Valid: ${x.join(", ")}`));return}if(!E.includes(e.trigger)){console.log(o.red(`Invalid trigger: ${e.trigger}. Valid: ${E.join(", ")}`));return}if(e.severity&&!I.includes(e.severity)){console.log(o.red(`Invalid severity: ${e.severity}. Valid: ${I.join(", ")}`));return}let i=e.checkType||"tool-called";if(!P.includes(i)){console.log(o.red(`Invalid check-type: ${i}. Valid: ${P.join(", ")}`));return}let n;try{let a=g.readFileSync(r,"utf8");n=C.load(a),n.habits||(n.habits=[]);}catch(a){console.log(o.red("Failed to parse habits.yaml:"),a.message);return}if(new Set([...n.habits.map(a=>a.id),...a(t).map(a=>a.id)]).has(e.id)){console.log(o.yellow(`Habit "${e.id}" already exists.`));return}let c$1=e.tools?e.tools.split(",").map(a=>a.trim()):[],s=e.patterns?e.patterns.split(",").map(a=>a.trim()):[],y={};i==="tool-called"&&c$1.length>0&&(y.tools=c$1),(i==="file-exists"||i==="file-modified"||i==="tests-exist")&&s.length>0&&(y.patterns=s);let d={id:e.id,name:e.name,description:e.description,category:e.category,trigger:e.trigger,severity:e.severity||"advisory",check:{type:i,params:y},enabled:true};n.habits.push(d),w(r,n),c(t),console.log(o.green(`Added habit: ${e.id}`)),console.log(o.gray(` Name: ${e.name}`)),console.log(o.gray(` Category: ${e.category} | Trigger: ${e.trigger} | Severity: ${e.severity||"advisory"}`)),console.log(o.gray(` Check: ${i}`)),c$1.length>0&&console.log(o.gray(` Tools: ${c$1.join(", ")}`)),s.length>0&&console.log(o.gray(` Patterns: ${s.join(", ")}`)),console.log();}async function z(e,t){let r=process.cwd();if(t.category&&!x.includes(t.category)){console.log(o.red(`Invalid category: ${t.category}. Valid: ${x.join(", ")}`));return}if(t.trigger&&!E.includes(t.trigger)){console.log(o.red(`Invalid trigger: ${t.trigger}. Valid: ${E.join(", ")}`));return}if(t.severity&&!I.includes(t.severity)){console.log(o.red(`Invalid severity: ${t.severity}. Valid: ${I.join(", ")}`));return}if(t.checkType&&!P.includes(t.checkType)){console.log(o.red(`Invalid check-type: ${t.checkType}. Valid: ${P.join(", ")}`));return}let i=T(r,e);if(!i){console.log(o.red(`Habit not found: ${e}`));return}if(i.source==="seed"){if(["name","description","category","trigger","checkType","patterns","tools"].some(m=>t[m]!==void 0)){console.log(o.yellow(`"${e}" is a seed habit. Only --severity and --enabled can be changed.`)),console.log(o.gray(" Other fields require creating a custom habit with the same functionality."));return}if(!t.severity&&t.enabled===void 0){console.log(o.yellow("No changes specified. Use --severity or --enabled for seed habits."));return}let d=L(r),a=D(d);a.overrides||(a.overrides={}),a.overrides[e]||(a.overrides[e]={}),t.severity&&(a.overrides[e].severity=t.severity),t.enabled!==void 0&&(a.overrides[e].enabled=t.enabled==="true"),w(d,a),c(r),console.log(o.green(`Updated seed habit override: ${e}`)),t.severity&&console.log(o.gray(` Severity: ${t.severity}`)),t.enabled!==void 0&&console.log(o.gray(` Enabled: ${t.enabled}`)),console.log();return}let n=D(i.filePath),l=n.habits[i.index];t.name&&(l.name=t.name),t.description&&(l.description=t.description),t.category&&(l.category=t.category),t.trigger&&(l.trigger=t.trigger),t.severity&&(l.severity=t.severity),t.enabled!==void 0&&(l.enabled=t.enabled==="true"),t.checkType&&(l.check.type=t.checkType),t.tools&&(l.check.params.tools=t.tools.split(",").map(s=>s.trim())),t.patterns&&(l.check.params.patterns=t.patterns.split(",").map(s=>s.trim())),n.habits[i.index]=l,w(i.filePath,n),c(r);let c$1=i.source==="global"?"(global)":"(project)";console.log(o.green(`Updated habit: ${e} ${o.gray(c$1)}`)),console.log();}async function Q(e,t){let r=process.cwd(),i=T(r,e);if(!i){console.log(o.red(`Habit not found: ${e}`));return}if(i.source==="seed"){console.log(o.yellow(`"${e}" is a seed habit and cannot be removed.`)),console.log(o.gray(` Use: paradigm habits edit ${e} --enabled false`));return}let n=D(i.filePath),l=n.habits[i.index];if(!t.yes){console.log(o.yellow(`
37
37
  Will remove habit: ${l.name} (${e})`)),console.log(o.gray(` Source: ${i.source} (${i.filePath})`)),console.log(o.gray(` Use --yes to confirm.
38
- `));return}n.habits.splice(i.index,1),w(i.filePath,n),c(r),console.log(o.green(`Removed habit: ${e}`)),console.log();}async function X(e,t){let r=process.cwd(),i=t==="enable",n=T(r,e);if(!n){console.log(o.red(`Habit not found: ${e}`));return}if(n.source==="seed"){let c$1=L(r),s=D(c$1);s.overrides||(s.overrides={}),s.overrides[e]||(s.overrides[e]={}),s.overrides[e].enabled=i,w(c$1,s),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} seed habit: ${e}`)),console.log();return}let l=D(n.filePath);l.habits[n.index].enabled=i,w(n.filePath,l),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} habit: ${e}`)),console.log();}async function Z(e$1){let t=process.cwd(),r=e$1.trigger,i;try{i=a(t);}catch(f){console.log(o.red("Failed to load habits:"),f.message),process.exitCode=1;return}let n=e$1.files?e$1.files.split(",").map(f=>f.trim()).filter(Boolean):N(t),l=e$1.symbols?e$1.symbols.split(",").map(f=>f.trim()).filter(Boolean):[],c;try{c=execSync("git status --porcelain",{cwd:t,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let s=u.join(t,"portal.yaml"),y=false;if(g.existsSync(s))try{let f=g.readFileSync(s,"utf8"),b=C.load(f);y=b?.routes!=null&&Object.keys(b.routes).length>0;}catch{}let d$1=e({toolsCalled:[],filesModified:n,symbolsTouched:l,loreRecorded:false,hasPortalRoutes:y,taskAddsRoutes:false,gitClean:c}),a$1=d(i,r,d$1),m=0;if(e$1.record&&a$1.evaluations.length>0)try{let f=u.join(t,".paradigm","sentinel");if(g.existsSync(f)){let{SentinelStorage:b}=await import('./dist-VGFSP3XM.js'),j=new b(f);for(let h of a$1.evaluations)j.recordPracticeEvent({habitId:h.habit.id,habitCategory:h.habit.category,result:h.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:l,filesModified:n,notes:h.reason}),m++;}}catch{}let v=u.join(t,".paradigm",".habits-blocking");try{if(r==="on-stop"&&a$1.blocksCompletion){let f=a$1.evaluations.filter(b=>b.result==="skipped"&&b.habit.severity==="block").map(b=>`${b.habit.name}: ${b.reason}`);g.writeFileSync(v,f.join(`
39
- `),"utf8");}else r==="on-stop"&&g.existsSync(v)&&g.unlinkSync(v);}catch{}e$1.json?console.log(JSON.stringify({trigger:r,evaluation:{total:a$1.summary.total,followed:a$1.summary.followed,skipped:a$1.summary.skipped,partial:a$1.summary.partial,blockingViolations:a$1.summary.blockingViolations,blocksCompletion:a$1.blocksCompletion},habits:a$1.evaluations.map(f=>({id:f.habit.id,name:f.habit.name,category:f.habit.category,severity:f.habit.severity,result:f.result,reason:f.reason,evidence:f.evidence})),recorded:m},null,2)):U(a$1,m),a$1.blocksCompletion&&(process.exitCode=1);}function N(e){try{return execSync("git diff --name-only HEAD",{cwd:e,encoding:"utf8",timeout:5e3}).trim().split(`
38
+ `));return}n.habits.splice(i.index,1),w(i.filePath,n),c(r),console.log(o.green(`Removed habit: ${e}`)),console.log();}async function X(e,t){let r=process.cwd(),i=t==="enable",n=T(r,e);if(!n){console.log(o.red(`Habit not found: ${e}`));return}if(n.source==="seed"){let c$1=L(r),s=D(c$1);s.overrides||(s.overrides={}),s.overrides[e]||(s.overrides[e]={}),s.overrides[e].enabled=i,w(c$1,s),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} seed habit: ${e}`)),console.log();return}let l=D(n.filePath);l.habits[n.index].enabled=i,w(n.filePath,l),c(r),console.log(o.green(`${i?"Enabled":"Disabled"} habit: ${e}`)),console.log();}async function Z(e){let t=process.cwd(),r=e.trigger,i;try{i=a(t);}catch(f){console.log(o.red("Failed to load habits:"),f.message),process.exitCode=1;return}let n$1=e.files?e.files.split(",").map(f=>f.trim()).filter(Boolean):N(t),l=e.symbols?e.symbols.split(",").map(f=>f.trim()).filter(Boolean):[],c;try{c=execSync("git status --porcelain",{cwd:t,encoding:"utf8",timeout:5e3}).trim()==="";}catch{}let s=u.join(t,"portal.yaml"),y=false;if(g.existsSync(s))try{let f=g.readFileSync(s,"utf8"),b=C.load(f);y=b?.routes!=null&&Object.keys(b.routes).length>0;}catch{}let d=n({toolsCalled:[],filesModified:n$1,symbolsTouched:l,loreRecorded:false,hasPortalRoutes:y,taskAddsRoutes:false,gitClean:c}),a$1=m(i,r,d),m$1=0;if(e.record&&a$1.evaluations.length>0)try{let f=u.join(t,".paradigm","sentinel");if(g.existsSync(f)){let{SentinelStorage:b}=await import('./dist-VGFSP3XM.js'),j=new b(f);for(let h of a$1.evaluations)j.recordPracticeEvent({habitId:h.habit.id,habitCategory:h.habit.category,result:h.result,engineer:"agent",sessionId:`cli-${Date.now().toString(36)}`,symbolsTouched:l,filesModified:n$1,notes:h.reason}),m$1++;}}catch{}let v=u.join(t,".paradigm",".habits-blocking");try{if(r==="on-stop"&&a$1.blocksCompletion){let f=a$1.evaluations.filter(b=>b.result==="skipped"&&b.habit.severity==="block").map(b=>`${b.habit.name}: ${b.reason}`);g.writeFileSync(v,f.join(`
39
+ `),"utf8");}else r==="on-stop"&&g.existsSync(v)&&g.unlinkSync(v);}catch{}e.json?console.log(JSON.stringify({trigger:r,evaluation:{total:a$1.summary.total,followed:a$1.summary.followed,skipped:a$1.summary.skipped,partial:a$1.summary.partial,blockingViolations:a$1.summary.blockingViolations,blocksCompletion:a$1.blocksCompletion},habits:a$1.evaluations.map(f=>({id:f.habit.id,name:f.habit.name,category:f.habit.category,severity:f.habit.severity,result:f.result,reason:f.reason,evidence:f.evidence})),recorded:m$1},null,2)):U(a$1,m$1),a$1.blocksCompletion&&(process.exitCode=1);}function N(e){try{return execSync("git diff --name-only HEAD",{cwd:e,encoding:"utf8",timeout:5e3}).trim().split(`
40
40
  `).filter(Boolean)}catch{return []}}function U(e,t){let{summary:r}=e;console.log(o.magenta(`
41
41
  Habits Check (${e.trigger})
42
42
  `));for(let i of e.evaluations){let n=i.result==="followed"?o.green("PASS"):i.result==="skipped"?i.habit.severity==="block"?o.red("BLOCK"):o.yellow("SKIP"):o.gray("PART"),l=i.habit.severity==="block"?o.red(i.habit.severity):i.habit.severity==="warn"?o.yellow(i.habit.severity):o.gray(i.habit.severity);console.log(` ${n} ${o.white(i.habit.id)} [${l}]`),console.log(o.gray(` ${i.reason}`));}console.log(),console.log(o.white(` Summary: ${r.followed} followed, ${r.skipped} skipped, ${r.partial} partial`)),r.blockingViolations>0&&console.log(o.red(` ${r.blockingViolations} blocking violation(s) \u2014 exit code 1`)),t>0&&console.log(o.gray(` Recorded ${t} practice event(s) to Sentinel`)),console.log();}export{q as habitsAddCommand,Z as habitsCheckCommand,z as habitsEditCommand,Y as habitsInitCommand,J as habitsListCommand,Q as habitsRemoveCommand,W as habitsStatusCommand,X as habitsToggleCommand};
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-G6DK3ND3.js';import'./chunk-5TAVYPOV.js';
2
+ export{a as hooksInstallCommand,c as hooksStatusCommand,b as hooksUninstallCommand}from'./chunk-DH7QVZDI.js';import'./chunk-5TAVYPOV.js';