@visulima/vis 1.0.0-alpha.15 → 1.0.0-alpha.16

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 (101) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/LICENSE.md +44 -233
  3. package/dist/bin.js +1 -1
  4. package/dist/config/index.d.ts +121 -94
  5. package/dist/config/index.js +1 -1
  6. package/dist/packem_chunks/bin.js +271 -271
  7. package/dist/packem_chunks/config.js +18 -0
  8. package/dist/packem_chunks/fix.js +1 -1
  9. package/dist/packem_chunks/handler.js +1 -1
  10. package/dist/packem_chunks/handler10.js +1 -1
  11. package/dist/packem_chunks/handler11.js +1 -1
  12. package/dist/packem_chunks/handler12.js +1 -1
  13. package/dist/packem_chunks/handler13.js +1 -1
  14. package/dist/packem_chunks/handler14.js +4 -4
  15. package/dist/packem_chunks/handler15.js +1 -1
  16. package/dist/packem_chunks/handler16.js +1 -1
  17. package/dist/packem_chunks/handler17.js +1 -1
  18. package/dist/packem_chunks/handler18.js +1 -1
  19. package/dist/packem_chunks/handler19.js +5 -5
  20. package/dist/packem_chunks/handler2.js +1 -1
  21. package/dist/packem_chunks/handler20.js +2 -1
  22. package/dist/packem_chunks/handler21.js +18 -1
  23. package/dist/packem_chunks/handler22.js +1 -5
  24. package/dist/packem_chunks/handler23.js +1 -1
  25. package/dist/packem_chunks/handler24.js +5 -3
  26. package/dist/packem_chunks/handler25.js +1 -1
  27. package/dist/packem_chunks/handler26.js +3 -1
  28. package/dist/packem_chunks/handler27.js +1 -7
  29. package/dist/packem_chunks/handler28.js +1 -23
  30. package/dist/packem_chunks/handler29.js +7 -3
  31. package/dist/packem_chunks/handler3.js +1 -1
  32. package/dist/packem_chunks/handler30.js +23 -18
  33. package/dist/packem_chunks/handler31.js +3 -1
  34. package/dist/packem_chunks/handler32.js +1 -2
  35. package/dist/packem_chunks/handler33.js +2 -25
  36. package/dist/packem_chunks/handler34.js +25 -2
  37. package/dist/packem_chunks/handler35.js +2 -2
  38. package/dist/packem_chunks/handler36.js +8 -8
  39. package/dist/packem_chunks/handler37.js +3 -3
  40. package/dist/packem_chunks/handler38.js +4 -4
  41. package/dist/packem_chunks/handler39.js +6 -6
  42. package/dist/packem_chunks/handler40.js +5 -5
  43. package/dist/packem_chunks/handler41.js +9 -9
  44. package/dist/packem_chunks/handler42.js +10 -10
  45. package/dist/packem_chunks/handler43.js +1 -1
  46. package/dist/packem_chunks/handler44.js +5 -5
  47. package/dist/packem_chunks/handler45.js +3 -3
  48. package/dist/packem_chunks/handler46.js +9 -9
  49. package/dist/packem_chunks/handler47.js +161 -36
  50. package/dist/packem_chunks/handler48.js +1 -1
  51. package/dist/packem_chunks/handler5.js +5 -5
  52. package/dist/packem_chunks/handler6.js +1 -1
  53. package/dist/packem_chunks/handler7.js +1 -1
  54. package/dist/packem_chunks/handler8.js +1 -1
  55. package/dist/packem_chunks/handler9.js +1 -1
  56. package/dist/packem_chunks/heal-accept.js +2 -2
  57. package/dist/packem_chunks/heal.js +1 -1
  58. package/dist/packem_chunks/help-command.js +16 -16
  59. package/dist/packem_chunks/index.js +1 -1
  60. package/dist/packem_chunks/loader.js +1 -1
  61. package/dist/packem_shared/{ai-analysis-CGVjqwdc.js → ai-analysis-C_GpXikx.js} +3 -3
  62. package/dist/packem_shared/ai-cache-DrCLD4gc.js +1 -0
  63. package/dist/packem_shared/ai-fix-CWOz12Om.js +43 -0
  64. package/dist/packem_shared/applyDefaults-DLY94gWA.js +1 -0
  65. package/dist/packem_shared/cache-directory-C_U1qsIw.js +1 -0
  66. package/dist/packem_shared/definePlugin-CWm4Dv_t.js +1 -0
  67. package/dist/packem_shared/dependency-scan-YdgNVvoz.js +2 -0
  68. package/dist/packem_shared/docker-Dl0AoVTZ.js +60 -0
  69. package/dist/packem_shared/failure-log-CSC6KfcO.js +2 -0
  70. package/dist/packem_shared/flakiness-Dzz-I3dB.js +1 -0
  71. package/dist/packem_shared/lifecycle-BC6Nst6i.js +2 -0
  72. package/dist/packem_shared/{lockfile-B7JJzxnL.js → lockfile-i-qvq_k8.js} +1 -1
  73. package/dist/packem_shared/otelPlugin-CJR2T_lk.js +1 -0
  74. package/dist/packem_shared/{readTomlSync-1fKo0R52-DAKNI1Me.js → readTomlSync-1fKo0R52-DtxWULlF.js} +1 -1
  75. package/dist/packem_shared/run-summary-utils-CJv75pla.js +1 -0
  76. package/dist/packem_shared/runtime-check-CBU6W8qG.js +1 -0
  77. package/dist/packem_shared/{selectors-Sem2CTYA.js → selectors-B2ISH581.js} +1 -1
  78. package/dist/packem_shared/toolchain-B7dckBQ1.js +5 -0
  79. package/dist/packem_shared/typosquats-B3A38-qx.js +1 -0
  80. package/dist/packem_shared/verify-WDStBFvK.js +1 -0
  81. package/dist/packem_shared/vis-update-app-D0uL3eO5.js +1 -0
  82. package/package.json +13 -13
  83. package/schemas/project.schema.json +12 -2
  84. package/schemas/vis-config.schema.json +248 -3
  85. package/dist/packem_chunks/applyDefaults.js +0 -2
  86. package/dist/packem_shared/ai-cache-BdPgSfg2.js +0 -1
  87. package/dist/packem_shared/ai-fix-iHtGLkJS.js +0 -43
  88. package/dist/packem_shared/cache-directory-DTfMSzT9.js +0 -1
  89. package/dist/packem_shared/dependency-scan-SQeRzrpJ.js +0 -2
  90. package/dist/packem_shared/docker-D5p9mRPU.js +0 -2
  91. package/dist/packem_shared/failure-log-CElcbnb9.js +0 -2
  92. package/dist/packem_shared/flakiness-C4t4_NoA.js +0 -1
  93. package/dist/packem_shared/otel-CO8UEfTa.js +0 -17
  94. package/dist/packem_shared/otelPlugin-DTynZDWh.js +0 -1
  95. package/dist/packem_shared/registry-D04iOQ5H.js +0 -2
  96. package/dist/packem_shared/run-summary-utils-BPraMTcm.js +0 -1
  97. package/dist/packem_shared/runtime-check-l4qFpo08.js +0 -1
  98. package/dist/packem_shared/toolchain-BhZNts--.js +0 -5
  99. package/dist/packem_shared/typosquats-Dr7VIL2B.js +0 -1
  100. package/dist/packem_shared/verify-C6NNOhTA.js +0 -1
  101. package/dist/packem_shared/vis-update-app-DGiMc5kb.js +0 -1
@@ -1,4 +1,4 @@
1
- var Vc=Object.defineProperty;var l=(e,t)=>Vc(e,"name",{value:t,configurable:!0});import{createRequire as Sc}from"node:module";import{ba as Bc,bb as Zo,E as Ue,q as _c,e as br,d as Mc,c as yu,p as we}from"./bin.js";import{O as Mt,z as Ya,i as eo,n as Lc,B as Kc,$ as Jc,C as Bt,M as un}from"../packem_shared/otel-CO8UEfTa.js";import{fingerprint as Ft,listRules as $u,listRequiredValidators as Wc,scan as wu,scanFiles as qc,inspectRuleset as Rc}from"@visulima/secret-scanner";const zc=Sc(import.meta.url),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xa=l(e=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[t,n]=Qt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Qt.getBuiltinModule(e)}return zc(e)},"__cjs_getBuiltinModule"),{createRequire:Uc}=Xa("node:module"),{pathToFileURL:Pu}=Xa("node:url"),{execFileSync:Qc}=Xa("node:child_process"),Zc={one:{},two:{},three:{},four:{}},Xc={one:{},two:{},three:{}},Yc={},ed=[],wa={methods:Zc,model:Xc,compute:Yc,hooks:ed};var td=Object.defineProperty,ku=l((e,t)=>td(e,"name",{value:t,configurable:!0}),"s$1p");const nd=ku(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),rd={compute:ku(function(e){const{world:t}=this,n=t.compute;return typeof e=="string"&&n.hasOwnProperty(e)?n[e](this):nd(e)?e.forEach(r=>{t.compute.hasOwnProperty(r)?n[r](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this},"compute")};var ad=Object.defineProperty,Kt=l((e,t)=>ad(e,"name",{value:t,configurable:!0}),"o$1X");const od=Kt(function(e){return this.fullPointer.forEach((t,n)=>{const r=this.update([t]);e(r,n)}),this},"forEach"),id=Kt(function(e,t){const n=this.fullPointer.map((a,o)=>{const i=this.update([a]),s=e(i,o);return s===void 0?this.none():s});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let r=[];return n.forEach(a=>{r=r.concat(a.fullPointer)}),this.toView(r)},"map"),sd=Kt(function(e){let t=this.fullPointer;return t=t.filter((n,r)=>{const a=this.update([n]);return e(a,r)}),this.update(t)},"filter"),ud=Kt(function(e){const t=this.fullPointer.find((n,r)=>{const a=this.update([n]);return e(a,r)});return this.update([t])},"find"),ld=Kt(function(e){return this.fullPointer.some((t,n)=>{const r=this.update([t]);return e(r,n)})},"some"),cd=Kt(function(e=1){let t=this.fullPointer,n=Math.floor(Math.random()*t.length);return n+e>this.length&&(n=this.length-e,n=n<0?0:n),t=t.slice(n,n+e),this.update(t)},"random"),dd={forEach:od,map:id,filter:sd,find:ud,some:ld,random:cd};var hd=Object.defineProperty,X=l((e,t)=>hd(e,"name",{value:t,configurable:!0}),"r$1p");const Te={termList:X(function(){return this.methods.one.termList(this.docs)},"termList"),terms:X(function(e){const t=this.match(".");return typeof e=="number"?t.eq(e):t},"terms"),groups:X(function(e){if(e||e===0)return this.update(this._groups[e]||[]);const t={};return Object.keys(this._groups).forEach(n=>{t[n]=this.update(this._groups[n])}),t},"groups"),eq:X(function(e){let t=this.pointer;return t||(t=this.docs.map((n,r)=>[r])),t[e]?this.update([t[e]]):this.none()},"eq"),first:X(function(){return this.eq(0)},"first"),last:X(function(){const e=this.fullPointer.length-1;return this.eq(e)},"last"),firstTerms:X(function(){return this.match("^.")},"firstTerms"),lastTerms:X(function(){return this.match(".$")},"lastTerms"),slice:X(function(e,t){let n=this.pointer||this.docs.map((r,a)=>[a]);return n=n.slice(e,t),this.update(n)},"slice"),all:X(function(){return this.update().toView()},"all"),fullSentences:X(function(){const e=this.fullPointer.map(t=>[t[0]]);return this.update(e).toView()},"fullSentences"),none:X(function(){return this.update([])},"none"),isDoc:X(function(e){if(!e||!e.isView)return!1;const t=this.fullPointer,n=e.fullPointer;return!t.length===n.length?!1:t.every((r,a)=>n[a]?r[0]===n[a][0]&&r[1]===n[a][1]&&r[2]===n[a][2]:!1)},"isDoc"),wordCount:X(function(){return this.docs.reduce((e,t)=>(e+=t.filter(n=>n.text!=="").length,e),0)},"wordCount"),isFull:X(function(){const e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,n=0;return this.document.forEach(r=>t+=r.length),this.docs.forEach(r=>n+=r.length),t===n},"isFull"),getNth:X(function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this},"getNth")};Te.group=Te.groups;Te.fullSentence=Te.fullSentences;Te.sentence=Te.fullSentences;Te.lastTerm=Te.lastTerms;Te.firstTerm=Te.firstTerms;const Pa=Object.assign({},Te,rd,dd);Pa.get=Pa.eq;var pd=Object.defineProperty,fd=l((e,t)=>pd(e,"name",{value:t,configurable:!0}),"l$1q");let yr=class ar{static{l(this,"h")}static{fd(this,"View")}constructor(t,n,r={}){[["document",t],["world",wa],["_groups",r],["_cache",null],["viewType","View"]].forEach(a=>{Object.defineProperty(this,a[0],{value:a[1],writable:!0})}),this.ptrs=n}get docs(){let t=this.document;return this.ptrs&&(t=wa.methods.one.getDoc(this.ptrs,this.document)),t}get pointer(){return this.ptrs}get methods(){return this.world.methods}get model(){return this.world.model}get hooks(){return this.world.hooks}get isView(){return!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){const{docs:t,ptrs:n,document:r}=this;return(n||t.map((a,o)=>[o])).map(a=>{let[o,i,s,u,c]=a;return i=i||0,s=s||(r[o]||[]).length,r[o]&&r[o][i]&&(u=u||r[o][i].id,r[o][s-1]&&(c=c||r[o][s-1].id)),[o,i,s,u,c]})}update(t){const n=new ar(this.document,t);if(this._cache&&t&&t.length>0){const r=[];t.forEach((a,o)=>{const[i,s,u]=a;a.length===1?r[o]=this._cache[i]:s===0&&this.document[i].length===u&&(r[o]=this._cache[i])}),r.length>0&&(n._cache=r)}return n.world=this.world,n}toView(t){return new ar(this.document,t||this.pointer)}fromText(t){const{methods:n}=this,r=n.one.tokenize.fromString(t,this.world),a=new ar(r);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(r=>r.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));const n=this.update(this.pointer);return n.document=t,n._cache=this._cache,n}};Object.assign(yr.prototype,Pa);const gd="14.15.0";var md=Object.defineProperty,Jt=l((e,t)=>md(e,"name",{value:t,configurable:!0}),"a$1T");const Xo=Jt(function(e){return e&&typeof e=="object"&&!Array.isArray(e)},"isObject"),vd=Jt(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray");function to(e,t){if(Xo(t))for(const n in t)Xo(t[n])?(e[n]||Object.assign(e,{[n]:{}}),to(e[n],t[n])):Object.assign(e,{[n]:t[n]});return e}l(to,"c$1O");Jt(to,"mergeDeep");function ju(e,t){for(const n in t)e[n]=e[n]||{},Object.assign(e[n],t[n]);return e}l(ju,"h$1u");Jt(ju,"mergeQuick");const bd=Jt(function(e,t){const n=e.two.models||{};Object.keys(t).forEach(r=>{t[r].pastTense&&(n.toPast&&(n.toPast.ex[r]=t[r].pastTense),n.fromPast&&(n.fromPast.ex[t[r].pastTense]=r)),t[r].presentTense&&(n.toPresent&&(n.toPresent.ex[r]=t[r].presentTense),n.fromPresent&&(n.fromPresent.ex[t[r].presentTense]=r)),t[r].gerund&&(n.toGerund&&(n.toGerund.ex[r]=t[r].gerund),n.fromGerund&&(n.fromGerund.ex[t[r].gerund]=r)),t[r].comparative&&(n.toComparative&&(n.toComparative.ex[r]=t[r].comparative),n.fromComparative&&(n.fromComparative.ex[t[r].comparative]=r)),t[r].superlative&&(n.toSuperlative&&(n.toSuperlative.ex[r]=t[r].superlative),n.fromSuperlative&&(n.fromSuperlative.ex[t[r].superlative]=r))})},"addIrregulars"),Au=Jt(function(e,t,n,r){if(vd(e)){e.forEach(u=>Au(u,t,n,r));return}const{methods:a,model:o,compute:i,hooks:s}=t;e.methods&&ju(a,e.methods),e.model&&to(o,e.model),e.irregulars&&bd(o,e.irregulars),e.compute&&Object.assign(i,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(n),e.lib&&Object.keys(e.lib).forEach(u=>r[u]=e.lib[u]),e.tags&&r.addTags(e.tags),e.words&&r.addWords(e.words),e.frozen&&r.addWords(e.frozen,!0),e.mutate&&e.mutate(t,r)},"extend");var yd=Object.defineProperty,$d=l((e,t)=>yd(e,"name",{value:t,configurable:!0}),"n$15");const wd=$d(function(e){const t=process.env?process.env:self.env||{};return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},"verbose");var Pd=Object.defineProperty,mn=l((e,t)=>Pd(e,"name",{value:t,configurable:!0}),"n$14");const kd=mn(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),ka=mn(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),jd=mn(function(e){return e.map(t=>t.terms.map(n=>(ka(n.tags)&&(n.tags=new Set(n.tags)),n)))},"fromJson"),Ad=mn(function(e){return e.map(t=>t.map(n=>({text:n,normal:n,pre:"",post:" ",tags:new Set})))},"preTokenized"),xu=mn(function(e,t,n){const{methods:r}=n,a=new t([]);if(a.world=n,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){const o=r.one.tokenize.fromString(e,n);return new t(o)}if(kd(e)&&e.isView)return new t(e.document,e.ptrs);if(ka(e)){if(ka(e[0])){const i=Ad(e);return new t(i)}const o=jd(e);return new t(o)}return a},"inputs");var xd=Object.defineProperty,Cd=l((e,t)=>xd(e,"name",{value:t,configurable:!0}),"d$U");const dr=Object.assign({},wa),$=Cd(function(e,t){t&&$.addWords(t);const n=xu(e,yr,dr);return e&&n.compute(dr.hooks),n},"nlp");Object.defineProperty($,"_world",{value:dr,writable:!0});$.tokenize=function(e,t){const{compute:n}=this._world;t&&$.addWords(t);const r=xu(e,yr,dr);return n.contractions&&r.compute(["alias","normal","machine","contractions"]),r};$.plugin=function(e){return Au(e,this._world,yr,this),this};$.extend=$.plugin;$.world=function(){return this._world};$.model=function(){return this._world.model};$.methods=function(){return this._world.methods};$.hooks=function(){return this._world.hooks};$.verbose=wd;$.version=gd;var Od=Object.defineProperty,Nd=l((e,t)=>Od(e,"name",{value:t,configurable:!0}),"f$1P");const Td=Nd(function(e){return e.map(t=>{const n=new Set;return t.forEach(r=>{r.normal!==""&&n.add(r.normal),r.switch&&n.add(`%${r.switch}%`),r.implicit&&n.add(r.implicit),r.machine&&n.add(r.machine),r.root&&n.add(r.root),r.alias&&r.alias.forEach(o=>n.add(o));const a=Array.from(r.tags);for(let o=0;o<a.length;o+=1)n.add("#"+a[o])}),n})},"createCache"),Id={one:{cacheDoc:Td}};var Dd=Object.defineProperty,ja=l((e,t)=>Dd(e,"name",{value:t,configurable:!0}),"t$Q");const Ed={cache:ja(function(){return this._cache=this.methods.one.cacheDoc(this.document),this},"cache"),uncache:ja(function(){return this._cache=null,this},"uncache")},Hd=ja(function(e){Object.assign(e.prototype,Ed)},"addAPI");var Gd=Object.defineProperty,Fd=l((e,t)=>Gd(e,"name",{value:t,configurable:!0}),"e$1g");const Vd={cache:Fd(function(e){e._cache=e.methods.one.cacheDoc(e.document)},"cache")},Sd={api:Hd,compute:Vd,methods:Id};var zd=Object.defineProperty,Fn=l((e,t)=>zd(e,"name",{value:t,configurable:!0}),"r$1n");const Bd={toLowerCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toLowerCase()}),this},"toLowerCase"),toUpperCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toUpperCase()}),this},"toUpperCase"),toTitleCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.replace(/^ *[a-z\u00C0-\u00FF]/,t=>t.toUpperCase())}),this},"toTitleCase"),toCamelCase:Fn(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,r=>r.toUpperCase())),n!==e.length-1&&(t.post="")})}),this},"toCamelCase")};var _d=Object.defineProperty,Ze=l((e,t)=>_d(e,"name",{value:t,configurable:!0}),"a$1R");const Yo=Ze(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),Md=Ze(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),Ld=Ze(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),Cu=Ze((e,t,n)=>{if(n.forEach(r=>r.dirty=!0),e){const r=[t,0].concat(n);Array.prototype.splice.apply(e,r)}return e},"spliceArr"),an=Ze(function(e){const t=/ $/,n=/[-–—]/,r=e[e.length-1];r&&!t.test(r.post)&&!n.test(r.post)&&(r.post+=" ")},"endSpace"),ei=Ze((e,t,n)=>{const r=/[-.?!,;:)–—'"]/g,a=e[t-1];if(!a)return;const o=a.post;if(r.test(o)){const i=o.match(r).join(""),s=n[n.length-1];s.post=i+s.post,a.post=a.post.replace(r,"")}},"movePunct"),Kd=Ze(function(e,t,n){const r=e[t];if(t!==0||!Yo(r.text))return;n[0].text=Md(n[0].text);const a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||Yo(a.text)&&a.text.length>1&&(a.text=Ld(a.text))},"moveTitleCase"),Jd=Ze(function(e,t,n,r){const[a,o,i]=t;o===0||i===r[a].length?an(n):(an(n),an([e[t[1]]])),Kd(e,o,n),Cu(e,o,n)},"cleanPrepend"),Wd=Ze(function(e,t,n,r){const[a,,o]=t,i=(r[a]||[]).length;o<i?(ei(e,o,n),an(n)):i===o&&(an(e),ei(e,o,n),r[a+1]&&(n[n.length-1].post+=" ")),Cu(e,t[2],n),t[4]=n[n.length-1].id},"cleanAppend");var qd=Object.defineProperty,Ou=l((e,t)=>qd(e,"name",{value:t,configurable:!0}),"a$1Q");let Zt=0;const ti=Ou(e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),"pad3"),Nu=Ou(function(e){let[t,n]=e.index||[0,0];Zt+=1,Zt=Zt>46655?0:Zt,t=t>46655?0:t,n=n>1294?0:n;let r=ti(Zt.toString(36));r+=ti(t.toString(36));let a=n.toString(36);a=a.length<2?"0"+a:a,r+=a;const o=parseInt(Math.random()*36,10);return r+=o.toString(36),e.normal+"|"+r.toUpperCase()},"toId");var Rd=Object.defineProperty,wt=l((e,t)=>Rd(e,"name",{value:t,configurable:!0}),"r$1k");const ni=wt(function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},"expand"),ri=wt(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Ud=wt(function(e){return e=e.map(t=>(t.id=Nu(t),t)),e},"addIds"),Qd=wt(function(e,t){const{methods:n}=t;return typeof e=="string"?n.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:ri(e)?ri(e[0])?e[0]:e:[]},"getTerms"),ai=wt(function(e,t,n){const{document:r,world:a}=t;t.uncache();const o=t.fullPointer,i=t.fullPointer;t.forEach((u,c)=>{const d=u.fullPointer[0],[h]=d,p=r[h];let b=Qd(e,a);b.length!==0&&(b=Ud(b),n?(ni(t.update([d]).firstTerm()),Jd(p,d,b,r)):(ni(t.update([d]).lastTerm()),Wd(p,d,b,r)),r[h]&&r[h][d[1]]&&(d[3]=r[h][d[1]].id),i[c]=d,d[2]+=b.length,o[c]=d)});const s=t.toView(o);return t.ptrs=i,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},"insert"),Pt={insertAfter:wt(function(e){return ai(e,this,!1)},"insertAfter"),insertBefore:wt(function(e){return ai(e,this,!0)},"insertBefore")};Pt.append=Pt.insertAfter;Pt.prepend=Pt.insertBefore;Pt.insert=Pt.insertAfter;var Zd=Object.defineProperty,vn=l((e,t)=>Zd(e,"name",{value:t,configurable:!0}),"f$1O");const Xd=/\$[0-9a-z]+/g,no={},Yd=vn(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),eh=vn(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),th=vn(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),nh=vn(function(e,t,n){return e.forEach(r=>{const a=t(r);r.replaceWith(a,n)}),e},"replaceByFn"),rh=vn(function(e,t){if(typeof e!="string")return e;const n=t.groups();return e=e.replace(Xd,r=>{const a=r.replace(/\$/,"");return n.hasOwnProperty(a)?n[a].text():r}),e},"subDollarSign");no.replaceWith=function(e,t={}){let n=this.fullPointer;const r=this;if(this.uncache(),typeof e=="function")return nh(r,e,t);const a=r.docs[0];if(!a)return r;const o=t.possessives&&a[a.length-1].tags.has("Possessive"),i=t.case&&Yd(a[0].text);e=rh(e,r);const s=this.update(n);n=n.map(p=>p.slice(0,3));const u=(s.docs[0]||[]).map(p=>Array.from(p.tags)),c=s.docs[0][0].pre,d=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),r.insertAfter(e),s.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction+").contractions().expand(),r.delete(s),o){const p=r.docs[0],b=p[p.length-1];b.tags.has("Possessive")||(b.text+="'s",b.normal+="'s",b.tags.add("Possessive"))}if(c&&r.docs[0]&&(r.docs[0][0].pre=c),d&&r.docs[0]){const p=r.docs[0][r.docs[0].length-1];p.post.trim()||(p.post=d)}const h=r.toView(n).compute(["index","freeze","lexicon"]);if(h.world.compute.preTagger&&h.compute("preTagger"),h.compute("unfreeze"),t.tags&&h.terms().forEach((p,b)=>{p.tagSafe(u[b])}),!h.docs[0]||!h.docs[0][0])return h;if(t.case){const p=i?eh:th;h.docs[0][0].text=p(h.docs[0][0].text)}return h};no.replace=function(e,t,n){if(e&&!t)return this.replaceWith(e,n);const r=this.match(e);return r.found?(this.soften(),r.replaceWith(t,n)):this};var ah=Object.defineProperty,Tu=l((e,t)=>ah(e,"name",{value:t,configurable:!0}),"r$1j");const oh=Tu(function(e,t){const n=e.length-1,r=e[n],a=e[n-t];a&&r&&(a.post+=r.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},"repairPunct"),ih=Tu(function(e,t){t.forEach(n=>{const[r,a,o]=n,i=o-a;e[r]&&(o===e[r].length&&o>1&&oh(e[r],i),e[r].splice(a,i))});for(let n=e.length-1;n>=0;n-=1)if(e[n].length===0&&(e.splice(n,1),n===e.length&&e[n-1])){const r=e[n-1],a=r[r.length-1];a&&(a.post=a.post.trimEnd())}return e},"pluckOut");var sh=Object.defineProperty,Iu=l((e,t)=>sh(e,"name",{value:t,configurable:!0}),"s$1m");const uh=Iu(function(e,t){return e=e.map(n=>{const[r]=n;return t[r]&&t[r].forEach(a=>{const o=a[2]-a[1];n[1]<=a[1]&&n[2]>=a[2]&&(n[2]-=o)}),n}),e.forEach((n,r)=>{if(n[1]===0&&n[2]==0)for(let a=r+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(n=>n[2]-n[1]>0),e=e.map(n=>(n[3]=null,n[4]=null,n)),e},"fixPointers"),Aa={remove:Iu(function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let n=this.all(),r=this;e&&(n=this,r=this.match(e));const a=!n.ptrs;r.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction").contractions().expand();let o=n.fullPointer;const i=r.fullPointer.reverse(),s=ih(this.document,i),u=t(i);return o=uh(o,u),n.ptrs=o,n.document=s,n.compute("index"),a&&(n.ptrs=void 0),e?n.toView(o):(this.ptrs=[],n.none())},"remove")};Aa.delete=Aa.remove;var lh=Object.defineProperty,ht=l((e,t)=>lh(e,"name",{value:t,configurable:!0}),"e$1c");const ln={pre:ht(function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(n=>{const r=n[0];t===!0?r.pre+=e:r.pre=e}),this)},"pre"),post:ht(function(e,t){if(e===void 0){const n=this.docs[this.docs.length-1];return n[n.length-1].post}return this.docs.forEach(n=>{const r=n[n.length-1];t===!0?r.post+=e:r.post=e}),this},"post"),trim:ht(function(){if(!this.found)return this;const e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();const n=e[e.length-1],r=n[n.length-1];return r.post=r.post.trimEnd(),this},"trim"),hyphenate:ht(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.pre=""),e[n+1]&&(t.post="-")})}),this},"hyphenate"),dehyphenate:ht(function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(n=>{e.test(n.post)&&(n.post=" ")})}),this},"dehyphenate"),toQuotations:ht(function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toQuotations"),toParentheses:ht(function(e,t){return e=e||"(",t=t||")",this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toParentheses")};ln.deHyphenate=ln.dehyphenate;ln.toQuotation=ln.toQuotations;var ch=Object.defineProperty,bn=l((e,t)=>ch(e,"name",{value:t,configurable:!0}),"o$1O");const dh=bn((e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,"alpha"),hh=bn((e,t)=>{const n=e.normal.trim().length,r=t.normal.trim().length;return n<r?1:n>r?-1:0},"length"),ph=bn((e,t)=>e.words<t.words?1:e.words>t.words?-1:0,"wordCount"),fh=bn((e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,"sequential"),gh=bn(function(e){const t={};return e.forEach(n=>{t[n.normal]=t[n.normal]||0,t[n.normal]+=1}),e.sort((n,r)=>{const a=t[n.normal],o=t[r.normal];return a<o?1:a>o?-1:0}),e},"byFreq"),Zr={alpha:dh,length:hh,wordCount:ph,sequential:fh,byFreq:gh};var mh=Object.defineProperty,$r=l((e,t)=>mh(e,"name",{value:t,configurable:!0}),"a$1N");const vh=new Set(["index","sequence","seq","sequential","chron","chronological"]),bh=new Set(["freq","frequency","topk","repeats"]),yh=new Set(["alpha","alphabetical"]),$h=$r(function(e,t){let n=e.fullPointer;return n=n.sort((r,a)=>(r=e.update([r]),a=e.update([a]),t(r,a))),e.ptrs=n,e},"customSort"),wh=$r(function(e){const{docs:t,pointer:n}=this;if(this.uncache(),typeof e=="function")return $h(this,e);e=e||"alpha";const r=n||t.map((o,i)=>[i]);let a=t.map((o,i)=>({index:i,words:o.length,normal:o.map(s=>s.machine||s.normal||"").join(" "),pointer:r[i]}));return vh.has(e)&&(e="sequential"),yh.has(e)&&(e="alpha"),bh.has(e)?(a=Zr.byFreq(a),this.update(a.map(o=>o.pointer))):typeof Zr[e]=="function"?(a=a.sort(Zr[e]),this.update(a.map(o=>o.pointer))):this},"sort"),Ph=$r(function(){let e=this.pointer||this.docs.map((t,n)=>[n]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},"reverse"),kh=$r(function(){const e=new Set;return this.filter(t=>{const n=t.text("machine");return e.has(n)?!1:(e.add(n),!0)})},"unique"),jh={unique:kh,reverse:Ph,sort:wh};var Ah=Object.defineProperty,wr=l((e,t)=>Ah(e,"name",{value:t,configurable:!0}),"o$1N");const xh=wr(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Du=wr(function(e,t){if(e.length>0){const n=e[e.length-1],r=n[n.length-1];/ /.test(r.post)===!1&&(r.post+=" ")}return e=e.concat(t),e},"combineDocs"),Ch=wr(function(e,t){if(e.document===t.document){const n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Du(e.document,t.docs),e.all()},"combineViews"),Oh={concat:wr(function(e){if(typeof e=="string"){const t=this.fromText(e);if(!this.found||!this.ptrs)this.document=this.document.concat(t.document);else{const n=this.fullPointer,r=n[n.length-1][0];this.document.splice(r,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return Ch(this,e);if(xh(e)){const t=Du(this.document,e);return this.document=t,this.all()}return this},"concat")};var Nh=Object.defineProperty,Eu=l((e,t)=>Nh(e,"name",{value:t,configurable:!0}),"n$11");const Th=Eu(function(){return this.ptrs=this.fullPointer,this},"harden"),Ih=Eu(function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},"soften"),Dh={harden:Th,soften:Ih};var Eh=Object.defineProperty,Hh=l((e,t)=>Eh(e,"name",{value:t,configurable:!0}),"r$1g");const Gh=Object.assign({},Bd,Pt,no,Aa,ln,jh,Oh,Dh),Fh=Hh(function(e){Object.assign(e.prototype,Gh)},"addAPI");var Vh=Object.defineProperty,Sh=l((e,t)=>Vh(e,"name",{value:t,configurable:!0}),"d$Q");const zh={id:Sh(function(e){const t=e.docs;for(let n=0;n<t.length;n+=1)for(let r=0;r<t[n].length;r+=1){const a=t[n][r];a.id=a.id||Nu(a)}},"id")},Bh={api:Fh,compute:zh},_h=[{word:"@",out:["at"]},{word:"arent",out:["are","not"]},{word:"alot",out:["a","lot"]},{word:"brb",out:["be","right","back"]},{word:"cannot",out:["can","not"]},{word:"dun",out:["do","not"]},{word:"can't",out:["can","not"]},{word:"shan't",out:["should","not"]},{word:"won't",out:["will","not"]},{word:"that's",out:["that","is"]},{word:"what's",out:["what","is"]},{word:"let's",out:["let","us"]},{word:"dunno",out:["do","not","know"]},{word:"gonna",out:["going","to"]},{word:"gotta",out:["have","got","to"]},{word:"gimme",out:["give","me"]},{word:"outta",out:["out","of"]},{word:"tryna",out:["trying","to"]},{word:"gtg",out:["got","to","go"]},{word:"im",out:["i","am"]},{word:"imma",out:["I","will"]},{word:"imo",out:["in","my","opinion"]},{word:"irl",out:["in","real","life"]},{word:"ive",out:["i","have"]},{word:"rn",out:["right","now"]},{word:"tbh",out:["to","be","honest"]},{word:"wanna",out:["want","to"]},{word:"c'mere",out:["come","here"]},{word:"c'mon",out:["come","on"]},{word:"shoulda",out:["should","have"]},{word:"coulda",out:["coulda","have"]},{word:"woulda",out:["woulda","have"]},{word:"musta",out:["must","have"]},{word:"tis",out:["it","is"]},{word:"twas",out:["it","was"]},{word:"y'know",out:["you","know"]},{word:"ne'er",out:["never"]},{word:"o'er",out:["over"]},{after:"ll",out:["will"]},{after:"ve",out:["have"]},{after:"re",out:["are"]},{after:"m",out:["am"]},{before:"c",out:["ce"]},{before:"m",out:["me"]},{before:"n",out:["ne"]},{before:"qu",out:["que"]},{before:"s",out:["se"]},{before:"t",out:["tu"]},{word:"shouldnt",out:["should","not"]},{word:"couldnt",out:["could","not"]},{word:"wouldnt",out:["would","not"]},{word:"hasnt",out:["has","not"]},{word:"wasnt",out:["was","not"]},{word:"isnt",out:["is","not"]},{word:"cant",out:["can","not"]},{word:"dont",out:["do","not"]},{word:"wont",out:["will","not"]},{word:"howd",out:["how","did"]},{word:"whatd",out:["what","did"]},{word:"whend",out:["when","did"]},{word:"whered",out:["where","did"]}],Mh={st:!0,nd:!0,rd:!0,th:!0,am:!0,pm:!0,max:!0,"°":!0,s:!0,e:!0,er:!0,ère:!0,ème:!0},Lh={one:{contractions:_h,numberSuffixes:Mh}};var Kh=Object.defineProperty,Jh=l((e,t)=>Kh(e,"name",{value:t,configurable:!0}),"a$1L");const Xr=Jh(function(e,t,n){const[r,a]=t;!n||n.length===0||(n=n.map((o,i)=>(o.implicit=o.text,o.machine=o.text,o.pre="",o.post="",o.text="",o.normal="",o.index=[r,a+i],o)),n[0]&&(n[0].pre=e[r][a].pre,n[n.length-1].post=e[r][a].post,n[0].text=e[r][a].text,n[0].normal=e[r][a].normal),e[r].splice(a,1,...n))},"insertContraction");var Wh=Object.defineProperty,qh=l((e,t)=>Wh(e,"name",{value:t,configurable:!0}),"t$N");const Rh=/'/,Uh=new Set(["what","how","when","where","why"]),Qh=new Set(["be","go","start","think","need"]),Zh=new Set(["been","gone"]),Xh=qh(function(e,t){const n=e[t].normal.split(Rh)[0];if(Uh.has(n))return[n,"did"];if(e[t+1]){if(Zh.has(e[t+1].normal))return[n,"had"];if(Qh.has(e[t+1].normal))return[n,"would"]}return null},"_apostropheD");var Yh=Object.defineProperty,ep=l((e,t)=>Yh(e,"name",{value:t,configurable:!0}),"r$1d");const tp=ep(function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},"apostropheT");var np=Object.defineProperty,ro=l((e,t)=>np(e,"name",{value:t,configurable:!0}),"s$1i");const ao=/'/,rp=/(e|é|aison|sion|tion)$/,ap=/(age|isme|acle|ege|oire)$/,op=ro((e,t)=>{const n=e[t].normal.split(ao)[1];return n&&n.endsWith("e")?["la",n]:["le",n]},"preL"),ip=ro((e,t)=>{const n=e[t].normal.split(ao)[1];return n&&rp.test(n)&&!ap.test(n)?["du",n]:n&&n.endsWith("s")?["des",n]:["de",n]},"preD"),sp=ro((e,t)=>["je",e[t].normal.split(ao)[1]],"preJ"),Yr={preJ:sp,preL:op,preD:ip};var up=Object.defineProperty,lp=l((e,t)=>up(e,"name",{value:t,configurable:!0}),"u$1H");const cp=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,dp=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,hp=/^[0-9]{3}-[0-9]{4}$/,pp=lp(function(e,t){const n=e[t];let r=n.text.match(cp);return r!==null?n.tags.has("PhoneNumber")===!0||hp.test(n.text)?null:[r[1],"to",r[2]]:(r=n.text.match(dp),r!==null?[r[1],"to",r[4]]:null)},"numberRange");var fp=Object.defineProperty,gp=l((e,t)=>fp(e,"name",{value:t,configurable:!0}),"o$1I");const mp=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,vp=gp(function(e,t,n){const r=n.model.one.numberSuffixes||{},a=e[t].text.match(mp);if(a!==null){const o=a[2].toLowerCase().trim();return r.hasOwnProperty(o)?null:[a[1],o]}return null},"numberUnit");var bp=Object.defineProperty,He=l((e,t)=>bp(e,"name",{value:t,configurable:!0}),"i$1L");const oi=/'/,yp=/^[0-9][^-–—]*[-–—].*?[0-9]/,ii=He(function(e,t,n,r){const a=t.update();a.document=[e];let o=n+r;n>0&&(n-=1),e[o]&&(o+=1),a.ptrs=[[0,n,o]]},"reTag"),si={t:He((e,t)=>tp(e,t),"t"),d:He((e,t)=>Xh(e,t),"d")},ui={j:He((e,t)=>Yr.preJ(e,t),"j"),l:He((e,t)=>Yr.preL(e,t),"l"),d:He((e,t)=>Yr.preD(e,t),"d")},$p=He(function(e,t,n,r){for(let a=0;a<e.length;a+=1){const o=e[a];if(o.word===t.normal)return o.out;if(r!==null&&r===o.after)return[n].concat(o.out);if(n!==null&&n===o.before&&r&&r.length>2)return o.out.concat(r)}return null},"knownOnes"),ea=He(function(e,t){const n=t.fromText(e.join(" "));return n.compute(["id","alias"]),n.docs[0]},"toDocs"),wp=He(function(e,t){for(let n=t+1;n<5&&e[n];n+=1)if(e[n].normal==="been")return["there","has"];return["there","is"]},"thereHas"),Pp=He(e=>{const{world:t,document:n}=e,{model:r,methods:a}=t,o=r.one.contractions||[];n.forEach((i,s)=>{for(let u=i.length-1;u>=0;u-=1){let c=null,d=null;if(oi.test(i[u].normal)===!0){const p=i[u].normal.split(oi);c=p[0],d=p[1]}let h=$p(o,i[u],c,d);if(!h&&si.hasOwnProperty(d)&&(h=si[d](i,u,t)),!h&&ui.hasOwnProperty(c)&&(h=ui[c](i,u)),c==="there"&&d==="s"&&(h=wp(i,u)),h){h=ea(h,e),Xr(n,[s,u],h),ii(n[s],e,u,h.length);continue}if(yp.test(i[u].normal)){h=pp(i,u),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag(h,"NumberRange",t),h[2]&&h[2].tags.has("Time")&&a.one.setTag([h[0]],"Time",t,null,"time-range"),ii(n[s],e,u,h.length));continue}h=vp(i,u,t),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag([h[1]],"Unit",t,null,"contraction-unit"))}})},"contractions"),kp={contractions:Pp},jp={model:Lh,compute:kp,hooks:["contractions"]};var Ap=Object.defineProperty,Hu=l((e,t)=>Ap(e,"name",{value:t,configurable:!0}),"i$1K");const li=Hu(function(e){const t=e.world,{model:n,methods:r}=e.world,a=r.one.setTag,{frozenLex:o}=n.one,i=n.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){const c=s[u],d=c.machine||c.normal;if(i[d]!==void 0&&s[u+1]){const h=u+i[d]-1;for(let p=h;p>u;p-=1){const b=s.slice(u,p+1),x=b.map(C=>C.machine||C.normal).join(" ");if(o.hasOwnProperty(x)===!0){a(b,o[x],t,!1,"1-frozen-multi-lexicon"),b.forEach(C=>C.frozen=!0);continue}}}if(o[d]!==void 0&&o.hasOwnProperty(d)){a([c],o[d],t,!1,"1-freeze-lexicon"),c.frozen=!0;continue}}})},"freeze"),xp=Hu(function(e){return e.docs.forEach(t=>{t.forEach(n=>{delete n.frozen})}),e},"unfreeze"),Cp={frozen:li,freeze:li,unfreeze:xp};var Op=Object.defineProperty,oo=l((e,t)=>Op(e,"name",{value:t,configurable:!0}),"t$K");const ci=oo(e=>"\x1B[34m"+e+"\x1B[0m","blue"),di=oo(e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m","dim"),hi=oo(function(e){e.docs.forEach(t=>{console.log(ci(`
1
+ var Vc=Object.defineProperty;var l=(e,t)=>Vc(e,"name",{value:t,configurable:!0});import{createRequire as Sc}from"node:module";import{bi as Bc,bj as Zo,E as Ue,q as _c,e as br,d as Mc,c as yu,p as we}from"./bin.js";import{b as Mt,z as Ya,a as eo,n as Lc,B as Kc,$ as Jc,C as Bt,M as un}from"./config.js";import{fingerprint as Ft,listRules as $u,listRequiredValidators as Wc,scan as wu,scanFiles as qc,inspectRuleset as Rc}from"@visulima/secret-scanner";const zc=Sc(import.meta.url),Qt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xa=l(e=>{if(typeof Qt<"u"&&Qt.versions&&Qt.versions.node){const[t,n]=Qt.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return Qt.getBuiltinModule(e)}return zc(e)},"__cjs_getBuiltinModule"),{createRequire:Uc}=Xa("node:module"),{pathToFileURL:Pu}=Xa("node:url"),{execFileSync:Qc}=Xa("node:child_process"),Zc={one:{},two:{},three:{},four:{}},Xc={one:{},two:{},three:{}},Yc={},ed=[],wa={methods:Zc,model:Xc,compute:Yc,hooks:ed};var td=Object.defineProperty,ku=l((e,t)=>td(e,"name",{value:t,configurable:!0}),"s$1p");const nd=ku(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),rd={compute:ku(function(e){const{world:t}=this,n=t.compute;return typeof e=="string"&&n.hasOwnProperty(e)?n[e](this):nd(e)?e.forEach(r=>{t.compute.hasOwnProperty(r)?n[r](this):console.warn("no compute:",e)}):typeof e=="function"?e(this):console.warn("no compute:",e),this},"compute")};var ad=Object.defineProperty,Kt=l((e,t)=>ad(e,"name",{value:t,configurable:!0}),"o$1X");const od=Kt(function(e){return this.fullPointer.forEach((t,n)=>{const r=this.update([t]);e(r,n)}),this},"forEach"),id=Kt(function(e,t){const n=this.fullPointer.map((a,o)=>{const i=this.update([a]),s=e(i,o);return s===void 0?this.none():s});if(n.length===0)return t||this.update([]);if(n[0]!==void 0&&(typeof n[0]=="string"||typeof n[0]=="object"&&(n[0]===null||!n[0].isView)))return n;let r=[];return n.forEach(a=>{r=r.concat(a.fullPointer)}),this.toView(r)},"map"),sd=Kt(function(e){let t=this.fullPointer;return t=t.filter((n,r)=>{const a=this.update([n]);return e(a,r)}),this.update(t)},"filter"),ud=Kt(function(e){const t=this.fullPointer.find((n,r)=>{const a=this.update([n]);return e(a,r)});return this.update([t])},"find"),ld=Kt(function(e){return this.fullPointer.some((t,n)=>{const r=this.update([t]);return e(r,n)})},"some"),cd=Kt(function(e=1){let t=this.fullPointer,n=Math.floor(Math.random()*t.length);return n+e>this.length&&(n=this.length-e,n=n<0?0:n),t=t.slice(n,n+e),this.update(t)},"random"),dd={forEach:od,map:id,filter:sd,find:ud,some:ld,random:cd};var hd=Object.defineProperty,X=l((e,t)=>hd(e,"name",{value:t,configurable:!0}),"r$1p");const Te={termList:X(function(){return this.methods.one.termList(this.docs)},"termList"),terms:X(function(e){const t=this.match(".");return typeof e=="number"?t.eq(e):t},"terms"),groups:X(function(e){if(e||e===0)return this.update(this._groups[e]||[]);const t={};return Object.keys(this._groups).forEach(n=>{t[n]=this.update(this._groups[n])}),t},"groups"),eq:X(function(e){let t=this.pointer;return t||(t=this.docs.map((n,r)=>[r])),t[e]?this.update([t[e]]):this.none()},"eq"),first:X(function(){return this.eq(0)},"first"),last:X(function(){const e=this.fullPointer.length-1;return this.eq(e)},"last"),firstTerms:X(function(){return this.match("^.")},"firstTerms"),lastTerms:X(function(){return this.match(".$")},"lastTerms"),slice:X(function(e,t){let n=this.pointer||this.docs.map((r,a)=>[a]);return n=n.slice(e,t),this.update(n)},"slice"),all:X(function(){return this.update().toView()},"all"),fullSentences:X(function(){const e=this.fullPointer.map(t=>[t[0]]);return this.update(e).toView()},"fullSentences"),none:X(function(){return this.update([])},"none"),isDoc:X(function(e){if(!e||!e.isView)return!1;const t=this.fullPointer,n=e.fullPointer;return!t.length===n.length?!1:t.every((r,a)=>n[a]?r[0]===n[a][0]&&r[1]===n[a][1]&&r[2]===n[a][2]:!1)},"isDoc"),wordCount:X(function(){return this.docs.reduce((e,t)=>(e+=t.filter(n=>n.text!=="").length,e),0)},"wordCount"),isFull:X(function(){const e=this.pointer;if(!e)return!0;if(e.length===0||e[0][0]!==0)return!1;let t=0,n=0;return this.document.forEach(r=>t+=r.length),this.docs.forEach(r=>n+=r.length),t===n},"isFull"),getNth:X(function(e){return typeof e=="number"?this.eq(e):typeof e=="string"?this.if(e):this},"getNth")};Te.group=Te.groups;Te.fullSentence=Te.fullSentences;Te.sentence=Te.fullSentences;Te.lastTerm=Te.lastTerms;Te.firstTerm=Te.firstTerms;const Pa=Object.assign({},Te,rd,dd);Pa.get=Pa.eq;var pd=Object.defineProperty,fd=l((e,t)=>pd(e,"name",{value:t,configurable:!0}),"l$1q");let yr=class ar{static{l(this,"h")}static{fd(this,"View")}constructor(t,n,r={}){[["document",t],["world",wa],["_groups",r],["_cache",null],["viewType","View"]].forEach(a=>{Object.defineProperty(this,a[0],{value:a[1],writable:!0})}),this.ptrs=n}get docs(){let t=this.document;return this.ptrs&&(t=wa.methods.one.getDoc(this.ptrs,this.document)),t}get pointer(){return this.ptrs}get methods(){return this.world.methods}get model(){return this.world.model}get hooks(){return this.world.hooks}get isView(){return!0}get found(){return this.docs.length>0}get length(){return this.docs.length}get fullPointer(){const{docs:t,ptrs:n,document:r}=this;return(n||t.map((a,o)=>[o])).map(a=>{let[o,i,s,u,c]=a;return i=i||0,s=s||(r[o]||[]).length,r[o]&&r[o][i]&&(u=u||r[o][i].id,r[o][s-1]&&(c=c||r[o][s-1].id)),[o,i,s,u,c]})}update(t){const n=new ar(this.document,t);if(this._cache&&t&&t.length>0){const r=[];t.forEach((a,o)=>{const[i,s,u]=a;a.length===1?r[o]=this._cache[i]:s===0&&this.document[i].length===u&&(r[o]=this._cache[i])}),r.length>0&&(n._cache=r)}return n.world=this.world,n}toView(t){return new ar(this.document,t||this.pointer)}fromText(t){const{methods:n}=this,r=n.one.tokenize.fromString(t,this.world),a=new ar(r);return a.world=this.world,a.compute(["normal","freeze","lexicon"]),this.world.compute.preTagger&&a.compute("preTagger"),a.compute("unfreeze"),a}clone(){let t=this.document.slice(0);t=t.map(r=>r.map(a=>(a=Object.assign({},a),a.tags=new Set(a.tags),a)));const n=this.update(this.pointer);return n.document=t,n._cache=this._cache,n}};Object.assign(yr.prototype,Pa);const gd="14.15.0";var md=Object.defineProperty,Jt=l((e,t)=>md(e,"name",{value:t,configurable:!0}),"a$1T");const Xo=Jt(function(e){return e&&typeof e=="object"&&!Array.isArray(e)},"isObject"),vd=Jt(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray");function to(e,t){if(Xo(t))for(const n in t)Xo(t[n])?(e[n]||Object.assign(e,{[n]:{}}),to(e[n],t[n])):Object.assign(e,{[n]:t[n]});return e}l(to,"c$1O");Jt(to,"mergeDeep");function ju(e,t){for(const n in t)e[n]=e[n]||{},Object.assign(e[n],t[n]);return e}l(ju,"h$1u");Jt(ju,"mergeQuick");const bd=Jt(function(e,t){const n=e.two.models||{};Object.keys(t).forEach(r=>{t[r].pastTense&&(n.toPast&&(n.toPast.ex[r]=t[r].pastTense),n.fromPast&&(n.fromPast.ex[t[r].pastTense]=r)),t[r].presentTense&&(n.toPresent&&(n.toPresent.ex[r]=t[r].presentTense),n.fromPresent&&(n.fromPresent.ex[t[r].presentTense]=r)),t[r].gerund&&(n.toGerund&&(n.toGerund.ex[r]=t[r].gerund),n.fromGerund&&(n.fromGerund.ex[t[r].gerund]=r)),t[r].comparative&&(n.toComparative&&(n.toComparative.ex[r]=t[r].comparative),n.fromComparative&&(n.fromComparative.ex[t[r].comparative]=r)),t[r].superlative&&(n.toSuperlative&&(n.toSuperlative.ex[r]=t[r].superlative),n.fromSuperlative&&(n.fromSuperlative.ex[t[r].superlative]=r))})},"addIrregulars"),Au=Jt(function(e,t,n,r){if(vd(e)){e.forEach(u=>Au(u,t,n,r));return}const{methods:a,model:o,compute:i,hooks:s}=t;e.methods&&ju(a,e.methods),e.model&&to(o,e.model),e.irregulars&&bd(o,e.irregulars),e.compute&&Object.assign(i,e.compute),s&&(t.hooks=s.concat(e.hooks||[])),e.api&&e.api(n),e.lib&&Object.keys(e.lib).forEach(u=>r[u]=e.lib[u]),e.tags&&r.addTags(e.tags),e.words&&r.addWords(e.words),e.frozen&&r.addWords(e.frozen,!0),e.mutate&&e.mutate(t,r)},"extend");var yd=Object.defineProperty,$d=l((e,t)=>yd(e,"name",{value:t,configurable:!0}),"n$15");const wd=$d(function(e){const t=process.env?process.env:self.env||{};return t.DEBUG_TAGS=e==="tagger"||e===!0?!0:"",t.DEBUG_MATCH=e==="match"||e===!0?!0:"",t.DEBUG_CHUNKS=e==="chunker"||e===!0?!0:"",this},"verbose");var Pd=Object.defineProperty,mn=l((e,t)=>Pd(e,"name",{value:t,configurable:!0}),"n$14");const kd=mn(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),ka=mn(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),jd=mn(function(e){return e.map(t=>t.terms.map(n=>(ka(n.tags)&&(n.tags=new Set(n.tags)),n)))},"fromJson"),Ad=mn(function(e){return e.map(t=>t.map(n=>({text:n,normal:n,pre:"",post:" ",tags:new Set})))},"preTokenized"),xu=mn(function(e,t,n){const{methods:r}=n,a=new t([]);if(a.world=n,typeof e=="number"&&(e=String(e)),!e)return a;if(typeof e=="string"){const o=r.one.tokenize.fromString(e,n);return new t(o)}if(kd(e)&&e.isView)return new t(e.document,e.ptrs);if(ka(e)){if(ka(e[0])){const i=Ad(e);return new t(i)}const o=jd(e);return new t(o)}return a},"inputs");var xd=Object.defineProperty,Cd=l((e,t)=>xd(e,"name",{value:t,configurable:!0}),"d$U");const dr=Object.assign({},wa),$=Cd(function(e,t){t&&$.addWords(t);const n=xu(e,yr,dr);return e&&n.compute(dr.hooks),n},"nlp");Object.defineProperty($,"_world",{value:dr,writable:!0});$.tokenize=function(e,t){const{compute:n}=this._world;t&&$.addWords(t);const r=xu(e,yr,dr);return n.contractions&&r.compute(["alias","normal","machine","contractions"]),r};$.plugin=function(e){return Au(e,this._world,yr,this),this};$.extend=$.plugin;$.world=function(){return this._world};$.model=function(){return this._world.model};$.methods=function(){return this._world.methods};$.hooks=function(){return this._world.hooks};$.verbose=wd;$.version=gd;var Od=Object.defineProperty,Nd=l((e,t)=>Od(e,"name",{value:t,configurable:!0}),"f$1P");const Td=Nd(function(e){return e.map(t=>{const n=new Set;return t.forEach(r=>{r.normal!==""&&n.add(r.normal),r.switch&&n.add(`%${r.switch}%`),r.implicit&&n.add(r.implicit),r.machine&&n.add(r.machine),r.root&&n.add(r.root),r.alias&&r.alias.forEach(o=>n.add(o));const a=Array.from(r.tags);for(let o=0;o<a.length;o+=1)n.add("#"+a[o])}),n})},"createCache"),Id={one:{cacheDoc:Td}};var Dd=Object.defineProperty,ja=l((e,t)=>Dd(e,"name",{value:t,configurable:!0}),"t$Q");const Ed={cache:ja(function(){return this._cache=this.methods.one.cacheDoc(this.document),this},"cache"),uncache:ja(function(){return this._cache=null,this},"uncache")},Hd=ja(function(e){Object.assign(e.prototype,Ed)},"addAPI");var Gd=Object.defineProperty,Fd=l((e,t)=>Gd(e,"name",{value:t,configurable:!0}),"e$1g");const Vd={cache:Fd(function(e){e._cache=e.methods.one.cacheDoc(e.document)},"cache")},Sd={api:Hd,compute:Vd,methods:Id};var zd=Object.defineProperty,Fn=l((e,t)=>zd(e,"name",{value:t,configurable:!0}),"r$1n");const Bd={toLowerCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toLowerCase()}),this},"toLowerCase"),toUpperCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.toUpperCase()}),this},"toUpperCase"),toTitleCase:Fn(function(){return this.termList().forEach(e=>{e.text=e.text.replace(/^ *[a-z\u00C0-\u00FF]/,t=>t.toUpperCase())}),this},"toTitleCase"),toCamelCase:Fn(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.text=t.text.replace(/^ *[a-z\u00C0-\u00FF]/,r=>r.toUpperCase())),n!==e.length-1&&(t.post="")})}),this},"toCamelCase")};var _d=Object.defineProperty,Ze=l((e,t)=>_d(e,"name",{value:t,configurable:!0}),"a$1R");const Yo=Ze(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),Md=Ze(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),Ld=Ze(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),Cu=Ze((e,t,n)=>{if(n.forEach(r=>r.dirty=!0),e){const r=[t,0].concat(n);Array.prototype.splice.apply(e,r)}return e},"spliceArr"),an=Ze(function(e){const t=/ $/,n=/[-–—]/,r=e[e.length-1];r&&!t.test(r.post)&&!n.test(r.post)&&(r.post+=" ")},"endSpace"),ei=Ze((e,t,n)=>{const r=/[-.?!,;:)–—'"]/g,a=e[t-1];if(!a)return;const o=a.post;if(r.test(o)){const i=o.match(r).join(""),s=n[n.length-1];s.post=i+s.post,a.post=a.post.replace(r,"")}},"movePunct"),Kd=Ze(function(e,t,n){const r=e[t];if(t!==0||!Yo(r.text))return;n[0].text=Md(n[0].text);const a=e[t];a.tags.has("ProperNoun")||a.tags.has("Acronym")||Yo(a.text)&&a.text.length>1&&(a.text=Ld(a.text))},"moveTitleCase"),Jd=Ze(function(e,t,n,r){const[a,o,i]=t;o===0||i===r[a].length?an(n):(an(n),an([e[t[1]]])),Kd(e,o,n),Cu(e,o,n)},"cleanPrepend"),Wd=Ze(function(e,t,n,r){const[a,,o]=t,i=(r[a]||[]).length;o<i?(ei(e,o,n),an(n)):i===o&&(an(e),ei(e,o,n),r[a+1]&&(n[n.length-1].post+=" ")),Cu(e,t[2],n),t[4]=n[n.length-1].id},"cleanAppend");var qd=Object.defineProperty,Ou=l((e,t)=>qd(e,"name",{value:t,configurable:!0}),"a$1Q");let Zt=0;const ti=Ou(e=>(e=e.length<3?"0"+e:e,e.length<3?"0"+e:e),"pad3"),Nu=Ou(function(e){let[t,n]=e.index||[0,0];Zt+=1,Zt=Zt>46655?0:Zt,t=t>46655?0:t,n=n>1294?0:n;let r=ti(Zt.toString(36));r+=ti(t.toString(36));let a=n.toString(36);a=a.length<2?"0"+a:a,r+=a;const o=parseInt(Math.random()*36,10);return r+=o.toString(36),e.normal+"|"+r.toUpperCase()},"toId");var Rd=Object.defineProperty,wt=l((e,t)=>Rd(e,"name",{value:t,configurable:!0}),"r$1k");const ni=wt(function(e){e.has("@hasContraction")&&typeof e.contractions=="function"&&e.grow("@hasContraction").contractions().expand()},"expand"),ri=wt(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Ud=wt(function(e){return e=e.map(t=>(t.id=Nu(t),t)),e},"addIds"),Qd=wt(function(e,t){const{methods:n}=t;return typeof e=="string"?n.one.tokenize.fromString(e,t)[0]:typeof e=="object"&&e.isView?e.clone().docs[0]||[]:ri(e)?ri(e[0])?e[0]:e:[]},"getTerms"),ai=wt(function(e,t,n){const{document:r,world:a}=t;t.uncache();const o=t.fullPointer,i=t.fullPointer;t.forEach((u,c)=>{const d=u.fullPointer[0],[h]=d,p=r[h];let b=Qd(e,a);b.length!==0&&(b=Ud(b),n?(ni(t.update([d]).firstTerm()),Jd(p,d,b,r)):(ni(t.update([d]).lastTerm()),Wd(p,d,b,r)),r[h]&&r[h][d[1]]&&(d[3]=r[h][d[1]].id),i[c]=d,d[2]+=b.length,o[c]=d)});const s=t.toView(o);return t.ptrs=i,s.compute(["id","index","freeze","lexicon"]),s.world.compute.preTagger&&s.compute("preTagger"),s.compute("unfreeze"),s},"insert"),Pt={insertAfter:wt(function(e){return ai(e,this,!1)},"insertAfter"),insertBefore:wt(function(e){return ai(e,this,!0)},"insertBefore")};Pt.append=Pt.insertAfter;Pt.prepend=Pt.insertBefore;Pt.insert=Pt.insertAfter;var Zd=Object.defineProperty,vn=l((e,t)=>Zd(e,"name",{value:t,configurable:!0}),"f$1O");const Xd=/\$[0-9a-z]+/g,no={},Yd=vn(e=>new RegExp("^\\p{Lu}[\\p{Ll}'’]","u").test(e)||new RegExp("^\\p{Lu}$","u").test(e),"isTitleCase"),eh=vn(e=>e.replace(new RegExp("^\\p{Ll}","u"),t=>t.toUpperCase()),"toTitleCase"),th=vn(e=>e.replace(new RegExp("^\\p{Lu}","u"),t=>t.toLowerCase()),"toLowerCase"),nh=vn(function(e,t,n){return e.forEach(r=>{const a=t(r);r.replaceWith(a,n)}),e},"replaceByFn"),rh=vn(function(e,t){if(typeof e!="string")return e;const n=t.groups();return e=e.replace(Xd,r=>{const a=r.replace(/\$/,"");return n.hasOwnProperty(a)?n[a].text():r}),e},"subDollarSign");no.replaceWith=function(e,t={}){let n=this.fullPointer;const r=this;if(this.uncache(),typeof e=="function")return nh(r,e,t);const a=r.docs[0];if(!a)return r;const o=t.possessives&&a[a.length-1].tags.has("Possessive"),i=t.case&&Yd(a[0].text);e=rh(e,r);const s=this.update(n);n=n.map(p=>p.slice(0,3));const u=(s.docs[0]||[]).map(p=>Array.from(p.tags)),c=s.docs[0][0].pre,d=s.docs[0][s.docs[0].length-1].post;if(typeof e=="string"&&(e=this.fromText(e).compute("id")),r.insertAfter(e),s.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction+").contractions().expand(),r.delete(s),o){const p=r.docs[0],b=p[p.length-1];b.tags.has("Possessive")||(b.text+="'s",b.normal+="'s",b.tags.add("Possessive"))}if(c&&r.docs[0]&&(r.docs[0][0].pre=c),d&&r.docs[0]){const p=r.docs[0][r.docs[0].length-1];p.post.trim()||(p.post=d)}const h=r.toView(n).compute(["index","freeze","lexicon"]);if(h.world.compute.preTagger&&h.compute("preTagger"),h.compute("unfreeze"),t.tags&&h.terms().forEach((p,b)=>{p.tagSafe(u[b])}),!h.docs[0]||!h.docs[0][0])return h;if(t.case){const p=i?eh:th;h.docs[0][0].text=p(h.docs[0][0].text)}return h};no.replace=function(e,t,n){if(e&&!t)return this.replaceWith(e,n);const r=this.match(e);return r.found?(this.soften(),r.replaceWith(t,n)):this};var ah=Object.defineProperty,Tu=l((e,t)=>ah(e,"name",{value:t,configurable:!0}),"r$1j");const oh=Tu(function(e,t){const n=e.length-1,r=e[n],a=e[n-t];a&&r&&(a.post+=r.post,a.post=a.post.replace(/ +([.?!,;:])/,"$1"),a.post=a.post.replace(/[,;:]+([.?!])/,"$1"))},"repairPunct"),ih=Tu(function(e,t){t.forEach(n=>{const[r,a,o]=n,i=o-a;e[r]&&(o===e[r].length&&o>1&&oh(e[r],i),e[r].splice(a,i))});for(let n=e.length-1;n>=0;n-=1)if(e[n].length===0&&(e.splice(n,1),n===e.length&&e[n-1])){const r=e[n-1],a=r[r.length-1];a&&(a.post=a.post.trimEnd())}return e},"pluckOut");var sh=Object.defineProperty,Iu=l((e,t)=>sh(e,"name",{value:t,configurable:!0}),"s$1m");const uh=Iu(function(e,t){return e=e.map(n=>{const[r]=n;return t[r]&&t[r].forEach(a=>{const o=a[2]-a[1];n[1]<=a[1]&&n[2]>=a[2]&&(n[2]-=o)}),n}),e.forEach((n,r)=>{if(n[1]===0&&n[2]==0)for(let a=r+1;a<e.length;a+=1)e[a][0]-=1,e[a][0]<0&&(e[a][0]=0)}),e=e.filter(n=>n[2]-n[1]>0),e=e.map(n=>(n[3]=null,n[4]=null,n)),e},"fixPointers"),Aa={remove:Iu(function(e){const{indexN:t}=this.methods.one.pointer;this.uncache();let n=this.all(),r=this;e&&(n=this,r=this.match(e));const a=!n.ptrs;r.has("@hasContraction")&&r.contractions&&r.grow("@hasContraction").contractions().expand();let o=n.fullPointer;const i=r.fullPointer.reverse(),s=ih(this.document,i),u=t(i);return o=uh(o,u),n.ptrs=o,n.document=s,n.compute("index"),a&&(n.ptrs=void 0),e?n.toView(o):(this.ptrs=[],n.none())},"remove")};Aa.delete=Aa.remove;var lh=Object.defineProperty,ht=l((e,t)=>lh(e,"name",{value:t,configurable:!0}),"e$1c");const ln={pre:ht(function(e,t){return e===void 0&&this.found?this.docs[0][0].pre:(this.docs.forEach(n=>{const r=n[0];t===!0?r.pre+=e:r.pre=e}),this)},"pre"),post:ht(function(e,t){if(e===void 0){const n=this.docs[this.docs.length-1];return n[n.length-1].post}return this.docs.forEach(n=>{const r=n[n.length-1];t===!0?r.post+=e:r.post=e}),this},"post"),trim:ht(function(){if(!this.found)return this;const e=this.docs,t=e[0][0];t.pre=t.pre.trimStart();const n=e[e.length-1],r=n[n.length-1];return r.post=r.post.trimEnd(),this},"trim"),hyphenate:ht(function(){return this.docs.forEach(e=>{e.forEach((t,n)=>{n!==0&&(t.pre=""),e[n+1]&&(t.post="-")})}),this},"hyphenate"),dehyphenate:ht(function(){const e=/[-–—]/;return this.docs.forEach(t=>{t.forEach(n=>{e.test(n.post)&&(n.post=" ")})}),this},"dehyphenate"),toQuotations:ht(function(e,t){return e=e||'"',t=t||'"',this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toQuotations"),toParentheses:ht(function(e,t){return e=e||"(",t=t||")",this.docs.forEach(n=>{n[0].pre=e+n[0].pre;const r=n[n.length-1];r.post=t+r.post}),this},"toParentheses")};ln.deHyphenate=ln.dehyphenate;ln.toQuotation=ln.toQuotations;var ch=Object.defineProperty,bn=l((e,t)=>ch(e,"name",{value:t,configurable:!0}),"o$1O");const dh=bn((e,t)=>e.normal<t.normal?-1:e.normal>t.normal?1:0,"alpha"),hh=bn((e,t)=>{const n=e.normal.trim().length,r=t.normal.trim().length;return n<r?1:n>r?-1:0},"length"),ph=bn((e,t)=>e.words<t.words?1:e.words>t.words?-1:0,"wordCount"),fh=bn((e,t)=>e[0]<t[0]?1:e[0]>t[0]?-1:e[1]>t[1]?1:-1,"sequential"),gh=bn(function(e){const t={};return e.forEach(n=>{t[n.normal]=t[n.normal]||0,t[n.normal]+=1}),e.sort((n,r)=>{const a=t[n.normal],o=t[r.normal];return a<o?1:a>o?-1:0}),e},"byFreq"),Zr={alpha:dh,length:hh,wordCount:ph,sequential:fh,byFreq:gh};var mh=Object.defineProperty,$r=l((e,t)=>mh(e,"name",{value:t,configurable:!0}),"a$1N");const vh=new Set(["index","sequence","seq","sequential","chron","chronological"]),bh=new Set(["freq","frequency","topk","repeats"]),yh=new Set(["alpha","alphabetical"]),$h=$r(function(e,t){let n=e.fullPointer;return n=n.sort((r,a)=>(r=e.update([r]),a=e.update([a]),t(r,a))),e.ptrs=n,e},"customSort"),wh=$r(function(e){const{docs:t,pointer:n}=this;if(this.uncache(),typeof e=="function")return $h(this,e);e=e||"alpha";const r=n||t.map((o,i)=>[i]);let a=t.map((o,i)=>({index:i,words:o.length,normal:o.map(s=>s.machine||s.normal||"").join(" "),pointer:r[i]}));return vh.has(e)&&(e="sequential"),yh.has(e)&&(e="alpha"),bh.has(e)?(a=Zr.byFreq(a),this.update(a.map(o=>o.pointer))):typeof Zr[e]=="function"?(a=a.sort(Zr[e]),this.update(a.map(o=>o.pointer))):this},"sort"),Ph=$r(function(){let e=this.pointer||this.docs.map((t,n)=>[n]);return e=[].concat(e),e=e.reverse(),this._cache&&(this._cache=this._cache.reverse()),this.update(e)},"reverse"),kh=$r(function(){const e=new Set;return this.filter(t=>{const n=t.text("machine");return e.has(n)?!1:(e.add(n),!0)})},"unique"),jh={unique:kh,reverse:Ph,sort:wh};var Ah=Object.defineProperty,wr=l((e,t)=>Ah(e,"name",{value:t,configurable:!0}),"o$1N");const xh=wr(e=>Object.prototype.toString.call(e)==="[object Array]","isArray"),Du=wr(function(e,t){if(e.length>0){const n=e[e.length-1],r=n[n.length-1];/ /.test(r.post)===!1&&(r.post+=" ")}return e=e.concat(t),e},"combineDocs"),Ch=wr(function(e,t){if(e.document===t.document){const n=e.fullPointer.concat(t.fullPointer);return e.toView(n).compute("index")}return t.fullPointer.forEach(n=>{n[0]+=e.document.length}),e.document=Du(e.document,t.docs),e.all()},"combineViews"),Oh={concat:wr(function(e){if(typeof e=="string"){const t=this.fromText(e);if(!this.found||!this.ptrs)this.document=this.document.concat(t.document);else{const n=this.fullPointer,r=n[n.length-1][0];this.document.splice(r,0,...t.document)}return this.all().compute("index")}if(typeof e=="object"&&e.isView)return Ch(this,e);if(xh(e)){const t=Du(this.document,e);return this.document=t,this.all()}return this},"concat")};var Nh=Object.defineProperty,Eu=l((e,t)=>Nh(e,"name",{value:t,configurable:!0}),"n$11");const Th=Eu(function(){return this.ptrs=this.fullPointer,this},"harden"),Ih=Eu(function(){let e=this.ptrs;return!e||e.length<1?this:(e=e.map(t=>t.slice(0,3)),this.ptrs=e,this)},"soften"),Dh={harden:Th,soften:Ih};var Eh=Object.defineProperty,Hh=l((e,t)=>Eh(e,"name",{value:t,configurable:!0}),"r$1g");const Gh=Object.assign({},Bd,Pt,no,Aa,ln,jh,Oh,Dh),Fh=Hh(function(e){Object.assign(e.prototype,Gh)},"addAPI");var Vh=Object.defineProperty,Sh=l((e,t)=>Vh(e,"name",{value:t,configurable:!0}),"d$Q");const zh={id:Sh(function(e){const t=e.docs;for(let n=0;n<t.length;n+=1)for(let r=0;r<t[n].length;r+=1){const a=t[n][r];a.id=a.id||Nu(a)}},"id")},Bh={api:Fh,compute:zh},_h=[{word:"@",out:["at"]},{word:"arent",out:["are","not"]},{word:"alot",out:["a","lot"]},{word:"brb",out:["be","right","back"]},{word:"cannot",out:["can","not"]},{word:"dun",out:["do","not"]},{word:"can't",out:["can","not"]},{word:"shan't",out:["should","not"]},{word:"won't",out:["will","not"]},{word:"that's",out:["that","is"]},{word:"what's",out:["what","is"]},{word:"let's",out:["let","us"]},{word:"dunno",out:["do","not","know"]},{word:"gonna",out:["going","to"]},{word:"gotta",out:["have","got","to"]},{word:"gimme",out:["give","me"]},{word:"outta",out:["out","of"]},{word:"tryna",out:["trying","to"]},{word:"gtg",out:["got","to","go"]},{word:"im",out:["i","am"]},{word:"imma",out:["I","will"]},{word:"imo",out:["in","my","opinion"]},{word:"irl",out:["in","real","life"]},{word:"ive",out:["i","have"]},{word:"rn",out:["right","now"]},{word:"tbh",out:["to","be","honest"]},{word:"wanna",out:["want","to"]},{word:"c'mere",out:["come","here"]},{word:"c'mon",out:["come","on"]},{word:"shoulda",out:["should","have"]},{word:"coulda",out:["coulda","have"]},{word:"woulda",out:["woulda","have"]},{word:"musta",out:["must","have"]},{word:"tis",out:["it","is"]},{word:"twas",out:["it","was"]},{word:"y'know",out:["you","know"]},{word:"ne'er",out:["never"]},{word:"o'er",out:["over"]},{after:"ll",out:["will"]},{after:"ve",out:["have"]},{after:"re",out:["are"]},{after:"m",out:["am"]},{before:"c",out:["ce"]},{before:"m",out:["me"]},{before:"n",out:["ne"]},{before:"qu",out:["que"]},{before:"s",out:["se"]},{before:"t",out:["tu"]},{word:"shouldnt",out:["should","not"]},{word:"couldnt",out:["could","not"]},{word:"wouldnt",out:["would","not"]},{word:"hasnt",out:["has","not"]},{word:"wasnt",out:["was","not"]},{word:"isnt",out:["is","not"]},{word:"cant",out:["can","not"]},{word:"dont",out:["do","not"]},{word:"wont",out:["will","not"]},{word:"howd",out:["how","did"]},{word:"whatd",out:["what","did"]},{word:"whend",out:["when","did"]},{word:"whered",out:["where","did"]}],Mh={st:!0,nd:!0,rd:!0,th:!0,am:!0,pm:!0,max:!0,"°":!0,s:!0,e:!0,er:!0,ère:!0,ème:!0},Lh={one:{contractions:_h,numberSuffixes:Mh}};var Kh=Object.defineProperty,Jh=l((e,t)=>Kh(e,"name",{value:t,configurable:!0}),"a$1L");const Xr=Jh(function(e,t,n){const[r,a]=t;!n||n.length===0||(n=n.map((o,i)=>(o.implicit=o.text,o.machine=o.text,o.pre="",o.post="",o.text="",o.normal="",o.index=[r,a+i],o)),n[0]&&(n[0].pre=e[r][a].pre,n[n.length-1].post=e[r][a].post,n[0].text=e[r][a].text,n[0].normal=e[r][a].normal),e[r].splice(a,1,...n))},"insertContraction");var Wh=Object.defineProperty,qh=l((e,t)=>Wh(e,"name",{value:t,configurable:!0}),"t$N");const Rh=/'/,Uh=new Set(["what","how","when","where","why"]),Qh=new Set(["be","go","start","think","need"]),Zh=new Set(["been","gone"]),Xh=qh(function(e,t){const n=e[t].normal.split(Rh)[0];if(Uh.has(n))return[n,"did"];if(e[t+1]){if(Zh.has(e[t+1].normal))return[n,"had"];if(Qh.has(e[t+1].normal))return[n,"would"]}return null},"_apostropheD");var Yh=Object.defineProperty,ep=l((e,t)=>Yh(e,"name",{value:t,configurable:!0}),"r$1d");const tp=ep(function(e,t){return e[t].normal==="ain't"||e[t].normal==="aint"?null:[e[t].normal.replace(/n't/,""),"not"]},"apostropheT");var np=Object.defineProperty,ro=l((e,t)=>np(e,"name",{value:t,configurable:!0}),"s$1i");const ao=/'/,rp=/(e|é|aison|sion|tion)$/,ap=/(age|isme|acle|ege|oire)$/,op=ro((e,t)=>{const n=e[t].normal.split(ao)[1];return n&&n.endsWith("e")?["la",n]:["le",n]},"preL"),ip=ro((e,t)=>{const n=e[t].normal.split(ao)[1];return n&&rp.test(n)&&!ap.test(n)?["du",n]:n&&n.endsWith("s")?["des",n]:["de",n]},"preD"),sp=ro((e,t)=>["je",e[t].normal.split(ao)[1]],"preJ"),Yr={preJ:sp,preL:op,preD:ip};var up=Object.defineProperty,lp=l((e,t)=>up(e,"name",{value:t,configurable:!0}),"u$1H");const cp=/^([0-9.]{1,4}[a-z]{0,2}) ?[-–—] ?([0-9]{1,4}[a-z]{0,2})$/i,dp=/^([0-9]{1,2}(:[0-9][0-9])?(am|pm)?) ?[-–—] ?([0-9]{1,2}(:[0-9][0-9])?(am|pm)?)$/i,hp=/^[0-9]{3}-[0-9]{4}$/,pp=lp(function(e,t){const n=e[t];let r=n.text.match(cp);return r!==null?n.tags.has("PhoneNumber")===!0||hp.test(n.text)?null:[r[1],"to",r[2]]:(r=n.text.match(dp),r!==null?[r[1],"to",r[4]]:null)},"numberRange");var fp=Object.defineProperty,gp=l((e,t)=>fp(e,"name",{value:t,configurable:!0}),"o$1I");const mp=/^([+-]?[0-9][.,0-9]*)([a-z°²³µ/]+)$/,vp=gp(function(e,t,n){const r=n.model.one.numberSuffixes||{},a=e[t].text.match(mp);if(a!==null){const o=a[2].toLowerCase().trim();return r.hasOwnProperty(o)?null:[a[1],o]}return null},"numberUnit");var bp=Object.defineProperty,He=l((e,t)=>bp(e,"name",{value:t,configurable:!0}),"i$1L");const oi=/'/,yp=/^[0-9][^-–—]*[-–—].*?[0-9]/,ii=He(function(e,t,n,r){const a=t.update();a.document=[e];let o=n+r;n>0&&(n-=1),e[o]&&(o+=1),a.ptrs=[[0,n,o]]},"reTag"),si={t:He((e,t)=>tp(e,t),"t"),d:He((e,t)=>Xh(e,t),"d")},ui={j:He((e,t)=>Yr.preJ(e,t),"j"),l:He((e,t)=>Yr.preL(e,t),"l"),d:He((e,t)=>Yr.preD(e,t),"d")},$p=He(function(e,t,n,r){for(let a=0;a<e.length;a+=1){const o=e[a];if(o.word===t.normal)return o.out;if(r!==null&&r===o.after)return[n].concat(o.out);if(n!==null&&n===o.before&&r&&r.length>2)return o.out.concat(r)}return null},"knownOnes"),ea=He(function(e,t){const n=t.fromText(e.join(" "));return n.compute(["id","alias"]),n.docs[0]},"toDocs"),wp=He(function(e,t){for(let n=t+1;n<5&&e[n];n+=1)if(e[n].normal==="been")return["there","has"];return["there","is"]},"thereHas"),Pp=He(e=>{const{world:t,document:n}=e,{model:r,methods:a}=t,o=r.one.contractions||[];n.forEach((i,s)=>{for(let u=i.length-1;u>=0;u-=1){let c=null,d=null;if(oi.test(i[u].normal)===!0){const p=i[u].normal.split(oi);c=p[0],d=p[1]}let h=$p(o,i[u],c,d);if(!h&&si.hasOwnProperty(d)&&(h=si[d](i,u,t)),!h&&ui.hasOwnProperty(c)&&(h=ui[c](i,u)),c==="there"&&d==="s"&&(h=wp(i,u)),h){h=ea(h,e),Xr(n,[s,u],h),ii(n[s],e,u,h.length);continue}if(yp.test(i[u].normal)){h=pp(i,u),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag(h,"NumberRange",t),h[2]&&h[2].tags.has("Time")&&a.one.setTag([h[0]],"Time",t,null,"time-range"),ii(n[s],e,u,h.length));continue}h=vp(i,u,t),h&&(h=ea(h,e),Xr(n,[s,u],h),a.one.setTag([h[1]],"Unit",t,null,"contraction-unit"))}})},"contractions"),kp={contractions:Pp},jp={model:Lh,compute:kp,hooks:["contractions"]};var Ap=Object.defineProperty,Hu=l((e,t)=>Ap(e,"name",{value:t,configurable:!0}),"i$1K");const li=Hu(function(e){const t=e.world,{model:n,methods:r}=e.world,a=r.one.setTag,{frozenLex:o}=n.one,i=n.one._multiCache||{};e.docs.forEach(s=>{for(let u=0;u<s.length;u+=1){const c=s[u],d=c.machine||c.normal;if(i[d]!==void 0&&s[u+1]){const h=u+i[d]-1;for(let p=h;p>u;p-=1){const b=s.slice(u,p+1),x=b.map(C=>C.machine||C.normal).join(" ");if(o.hasOwnProperty(x)===!0){a(b,o[x],t,!1,"1-frozen-multi-lexicon"),b.forEach(C=>C.frozen=!0);continue}}}if(o[d]!==void 0&&o.hasOwnProperty(d)){a([c],o[d],t,!1,"1-freeze-lexicon"),c.frozen=!0;continue}}})},"freeze"),xp=Hu(function(e){return e.docs.forEach(t=>{t.forEach(n=>{delete n.frozen})}),e},"unfreeze"),Cp={frozen:li,freeze:li,unfreeze:xp};var Op=Object.defineProperty,oo=l((e,t)=>Op(e,"name",{value:t,configurable:!0}),"t$K");const ci=oo(e=>"\x1B[34m"+e+"\x1B[0m","blue"),di=oo(e=>"\x1B[3m\x1B[2m"+e+"\x1B[0m","dim"),hi=oo(function(e){e.docs.forEach(t=>{console.log(ci(`
2
2
  ┌─────────`)),t.forEach(n=>{let r=` ${di("│")} `;const a=n.implicit||n.text||"-";n.frozen===!0?r+=`${ci(a)} ❄️`:r+=di(a),console.log(r)})})},"debug");var Np=Object.defineProperty,pi=l((e,t)=>Np(e,"name",{value:t,configurable:!0}),"r$1b");const Tp={compute:Cp,mutate:pi(e=>{const t=e.methods.one;t.termMethods.isFrozen=n=>n.frozen===!0,t.debug.freeze=hi,t.debug.frozen=hi},"mutate"),api:pi(function(e){e.prototype.freeze=function(){return this.docs.forEach(t=>{t.forEach(n=>{n.frozen=!0})}),this},e.prototype.unfreeze=function(){this.compute("unfreeze")},e.prototype.isFrozen=function(){return this.match("@isFrozen+")}},"api"),hooks:["freeze"]};var Ip=Object.defineProperty,Dp=l((e,t)=>Ip(e,"name",{value:t,configurable:!0}),"m$S");const Ep=Dp(function(e,t,n){const{model:r,methods:a}=n,o=a.one.setTag,i=r.one._multiCache||{},{lexicon:s}=r.one||{},u=e[t],c=u.machine||u.normal;if(i[c]!==void 0&&e[t+1]){const d=t+i[c]-1;for(let h=d;h>t;h-=1){const p=e.slice(t,h+1);if(p.length<=1)return!1;const b=p.map(x=>x.machine||x.normal).join(" ");if(s.hasOwnProperty(b)===!0){const x=s[b];return o(p,x,n,!1,"1-multi-lexicon"),x&&x.length===2&&(x[0]==="PhrasalVerb"||x[1]==="PhrasalVerb")&&o([p[1]],"Particle",n,!1,"1-phrasal-particle"),!0}}return!1}return null},"multiWord");var Hp=Object.defineProperty,Gp=l((e,t)=>Hp(e,"name",{value:t,configurable:!0}),"c$1J");const fi=/^(under|over|mis|re|un|dis|semi|pre|post)-?/,Fp=new Set(["Verb","Infinitive","PastTense","Gerund","PresentTense","Adjective","Participle"]),Vp=Gp(function(e,t,n){const{model:r,methods:a}=n,o=a.one.setTag,{lexicon:i}=r.one,s=e[t],u=s.machine||s.normal;if(i[u]!==void 0&&i.hasOwnProperty(u))return o([s],i[u],n,!1,"1-lexicon"),!0;if(s.alias){const c=s.alias.find(d=>i.hasOwnProperty(d));if(c)return o([s],i[c],n,!1,"1-lexicon-alias"),!0}if(fi.test(u)===!0){const c=u.replace(fi,"");if(i.hasOwnProperty(c)&&c.length>3&&Fp.has(i[c]))return o([s],i[c],n,!1,"1-lexicon-prefix"),!0}return null},"checkLexicon");var Sp=Object.defineProperty,zp=l((e,t)=>Sp(e,"name",{value:t,configurable:!0}),"i$1J");const Bp=zp(function(e){const t=e.world;e.docs.forEach(n=>{for(let r=0;r<n.length;r+=1)if(n[r].tags.size===0){let a=null;a=a||Ep(n,r,t),a=a||Vp(n,r,t)}})},"lexicon"),_p={lexicon:Bp};var Mp=Object.defineProperty,Lp=l((e,t)=>Mp(e,"name",{value:t,configurable:!0}),"s$1f");const Kp=Lp(function(e){const t={},n={};return Object.keys(e).forEach(r=>{const a=e[r];r=r.toLowerCase().trim(),r=r.replace(/'s\b/,"");const o=r.split(/ /);o.length>1&&(n[o[0]]===void 0||o.length>n[o[0]])&&(n[o[0]]=o.length),t[r]=t[r]||a}),delete t[""],delete t[null],delete t[" "],{lex:t,_multi:n}},"expand"),Jp={one:{expandLexicon:Kp}};var Wp=Object.defineProperty,qp=l((e,t)=>Wp(e,"name",{value:t,configurable:!0}),"s$1e");const Rp=qp(function(e,t=!1){const n=this.world(),{methods:r,model:a}=n;if(!e)return;if(Object.keys(e).forEach(s=>{typeof e[s]=="string"&&e[s].startsWith("#")&&(e[s]=e[s].replace(/^#/,""))}),t===!0){const{lex:s,_multi:u}=r.one.expandLexicon(e,n);Object.assign(a.one._multiCache,u),Object.assign(a.one.frozenLex,s);return}if(r.two.expandLexicon){const{lex:s,_multi:u}=r.two.expandLexicon(e,n);Object.assign(a.one.lexicon,s),Object.assign(a.one._multiCache,u)}const{lex:o,_multi:i}=r.one.expandLexicon(e,n);Object.assign(a.one.lexicon,o),Object.assign(a.one._multiCache,i)},"addWords"),Up={addWords:Rp},Qp={one:{lexicon:{},_multiCache:{},frozenLex:{}}},Zp={model:Qp,methods:Jp,compute:_p,lib:Up,hooks:["lexicon"]};var Xp=Object.defineProperty,Gu=l((e,t)=>Xp(e,"name",{value:t,configurable:!0}),"p$1a");const Yp=Gu(function(e,t){const{methods:n,model:r}=t;return n.one.tokenize.splitTerms(e,r).map(a=>n.one.tokenize.splitWhitespace(a,r)).map(a=>a.text.toLowerCase())},"tokenize"),Fu=Gu(function(e,t){const n=[{}],r=[null],a=[0],o=[];let i=0;e.forEach(function(s){let u=0;const c=Yp(s,t);for(let d=0;d<c.length;d++){const h=c[d];n[u]&&n[u].hasOwnProperty(h)?u=n[u][h]:(i++,n[u][h]=i,n[i]={},u=i,r[i]=null)}r[u]=[c.length]});for(const s in n[0])i=n[0][s],a[i]=0,o.push(i);for(;o.length;){const s=o.shift(),u=Object.keys(n[s]);for(let c=0;c<u.length;c+=1){const d=u[c],h=n[s][d];for(o.push(h),i=a[s];i>0&&!n[i].hasOwnProperty(d);)i=a[i];if(n.hasOwnProperty(i)){const p=n[i][d];a[h]=p,r[p]&&(r[h]=r[h]||[],r[h]=r[h].concat(r[p]))}else a[h]=0}}return{goNext:n,endAs:r,failTo:a}},"buildTrie");var ef=Object.defineProperty,io=l((e,t)=>ef(e,"name",{value:t,configurable:!0}),"u$1D");const tf=io(function(e,t,n){let r=0;const a=[];for(let o=0;o<e.length;o++){const i=e[o][n.form]||e[o].normal;for(;r>0&&(t.goNext[r]===void 0||!t.goNext[r].hasOwnProperty(i));)r=t.failTo[r]||0;if(t.goNext[r].hasOwnProperty(i)&&(r=t.goNext[r][i],t.endAs[r])){const s=t.endAs[r];for(let u=0;u<s.length;u++){const c=s[u],d=e[o-c+1],[h,p]=d.index;a.push([h,p,p+c,d.id])}}}return a},"scanWords"),nf=io(function(e,t){for(let n=0;n<e.length;n+=1)if(t.has(e[n])===!0)return!1;return!0},"cacheMiss"),rf=io(function(e,t,n){let r=[];n.form=n.form||"normal";const a=e.docs;if(!t.goNext||!t.goNext[0])return console.error("Compromise invalid lookup trie"),e.none();const o=Object.keys(t.goNext[0]);for(let i=0;i<a.length;i++){if(e._cache&&e._cache[i]&&nf(o,e._cache[i])===!0)continue;const s=a[i],u=tf(s,t,n);u.length>0&&(r=r.concat(u))}return e.update(r)},"scan");var af=Object.defineProperty,Vu=l((e,t)=>af(e,"name",{value:t,configurable:!0}),"r$19");const of=Vu(e=>Object.prototype.toString.call(e)==="[object Object]","isObject");function Su(e){e.prototype.lookup=function(t,n={}){if(!t)return this.none();typeof t=="string"&&(t=[t]);const r=of(t)?t:Fu(t,this.world);let a=rf(this,r,n);return a=a.settle(),a}}l(Su,"b$j");Vu(Su,"default");var sf=Object.defineProperty,zu=l((e,t)=>sf(e,"name",{value:t,configurable:!0}),"u$1C");const ta=zu((e,t)=>{for(let n=e.length-1;n>=0;n-=1)if(e[n]!==t)return e=e.slice(0,n+1),e;return e},"truncate"),uf=zu(function(e){return e.goNext=e.goNext.map(t=>{if(Object.keys(t).length!==0)return t}),e.goNext=ta(e.goNext,void 0),e.failTo=ta(e.failTo,0),e.endAs=ta(e.endAs,null),e},"compress");var lf=Object.defineProperty,cf=l((e,t)=>lf(e,"name",{value:t,configurable:!0}),"t$I");const xa={buildTrie:cf(function(e){const t=Fu(e,this.world());return uf(t)},"buildTrie")};xa.compile=xa.buildTrie;const df={api:Su,lib:xa};var hf=Object.defineProperty,Wt=l((e,t)=>hf(e,"name",{value:t,configurable:!0}),"c$1H");const gi=Wt(function(e,t){return t&&e.forEach(n=>{const r=n[0];t[r]&&(n[0]=t[r][0],n[1]+=t[r][1],n[2]+=t[r][1])}),e},"relPointer"),Bu=Wt(function(e,t){let{ptrs:n}=e;const{byGroup:r}=e;return n=gi(n,t),Object.keys(r).forEach(a=>{r[a]=gi(r[a],t)}),{ptrs:n,byGroup:r}},"fixPointers"),yn=Wt(function(e,t,n){const r=n.methods.one;return typeof e=="number"&&(e=String(e)),typeof e=="string"&&(e=r.killUnicode(e,n),e=r.parseMatch(e,t,n)),e},"parseRegs"),_u=Wt(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),$n=Wt(e=>e&&_u(e)&&e.isView===!0,"isView"),wn=Wt(e=>e&&_u(e)&&e.isNet===!0,"isNet");var pf=Object.defineProperty,Pn=l((e,t)=>pf(e,"name",{value:t,configurable:!0}),"u$1A");const ff=Pn(function(e,t,n){const r=this.methods.one;if($n(e))return this.intersection(e);if(wn(e))return this.sweep(e,{tagger:!1}).view.settle();e=yn(e,n,this.world);const a={regs:e,group:t},o=r.match(this.docs,a,this._cache),{ptrs:i,byGroup:s}=Bu(o,this.fullPointer),u=this.toView(i);return u._groups=s,u},"match"),gf=Pn(function(e,t,n){const r=this.methods.one;if($n(e))return this.intersection(e).eq(0);if(wn(e))return this.sweep(e,{tagger:!1,matchOne:!0}).view;e=yn(e,n,this.world);const a={regs:e,group:t,justOne:!0},o=r.match(this.docs,a,this._cache),{ptrs:i,byGroup:s}=Bu(o,this.fullPointer),u=this.toView(i);return u._groups=s,u},"matchOne"),mf=Pn(function(e,t,n){const r=this.methods.one;if($n(e))return this.intersection(e).fullPointer.length>0;if(wn(e))return this.sweep(e,{tagger:!1}).view.found;e=yn(e,n,this.world);const a={regs:e,group:t,justOne:!0};return r.match(this.docs,a,this._cache).ptrs.length>0},"has"),vf=Pn(function(e,t,n){const r=this.methods.one;if($n(e))return this.filter(u=>u.intersection(e).found);if(wn(e)){const u=this.sweep(e,{tagger:!1}).view.settle();return this.if(u)}e=yn(e,n,this.world);const a={regs:e,group:t,justOne:!0};let o=this.fullPointer;const i=this._cache||[];o=o.filter((u,c)=>{const d=this.update([u]);return r.match(d.docs,a,i[c]).ptrs.length>0});const s=this.update(o);return this._cache&&(s._cache=o.map(u=>i[u[0]])),s},"ifFn"),bf=Pn(function(e,t,n){const{methods:r}=this,a=r.one;if($n(e))return this.filter(s=>!s.intersection(e).found);if(wn(e)){const s=this.sweep(e,{tagger:!1}).view.settle();return this.ifNo(s)}e=yn(e,n,this.world);const o=this._cache||[],i=this.filter((s,u)=>{const c={regs:e,group:t,justOne:!0};return a.match(s.docs,c,o[u]).ptrs.length===0});return this._cache&&(i._cache=i.ptrs.map(s=>o[s[0]])),i},"ifNo"),yf={matchOne:gf,match:ff,has:mf,if:vf,ifNo:bf};var $f=Object.defineProperty,kn=l((e,t)=>$f(e,"name",{value:t,configurable:!0}),"h$1j");const wf=kn(function(e,t,n){const{indexN:r}=this.methods.one.pointer,a=[],o=r(this.fullPointer);Object.keys(o).forEach(s=>{const u=o[s].sort((c,d)=>c[1]>d[1]?1:-1)[0];u[1]>0&&a.push([u[0],0,u[1]])});const i=this.toView(a);return e?i.match(e,t,n):i},"before"),Pf=kn(function(e,t,n){const{indexN:r}=this.methods.one.pointer,a=[],o=r(this.fullPointer),i=this.document;Object.keys(o).forEach(u=>{const c=o[u].sort((p,b)=>p[1]>b[1]?-1:1)[0],[d,,h]=c;h<i[d].length&&a.push([d,h,i[d].length])});const s=this.toView(a);return e?s.match(e,t,n):s},"after"),kf=kn(function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[e.length-1].end=!0;const r=this.fullPointer;return this.forEach((a,o)=>{const i=a.before(e,t);if(i.found){const s=i.terms();r[o][1]-=s.length,r[o][3]=s.docs[0][0].id}}),this.update(r)},"growLeft"),jf=kn(function(e,t,n){typeof e=="string"&&(e=this.world.methods.one.parseMatch(e,n,this.world)),e[0].start=!0;const r=this.fullPointer;return this.forEach((a,o)=>{const i=a.after(e,t);if(i.found){const s=i.terms();r[o][2]+=s.length,r[o][4]=null}}),this.update(r)},"growRight"),Af=kn(function(e,t,n){return this.growRight(e,t,n).growLeft(e,t,n)},"grow"),xf={before:wf,after:Pf,growLeft:kf,growRight:jf,grow:Af};var Cf=Object.defineProperty,Pr=l((e,t)=>Cf(e,"name",{value:t,configurable:!0}),"l$1g");const Mu=Pr(function(e,t){return[e[0],e[1],t[2]]},"combine"),Of=Pr(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),so=Pr((e,t,n)=>typeof e=="string"||Of(e)?t.match(e,n):e||t.none(),"getDoc"),uo=Pr(function(e,t){const[n,r,a]=e;return t.document[n]&&t.document[n][r]&&(e[3]=e[3]||t.document[n][r].id,t.document[n][a-1]&&(e[4]=e[4]||t.document[n][a-1].id)),e},"addIds"),Lt={};Lt.splitOn=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=so(e,this,t).fullPointer,a=n(this.fullPointer,r);let o=[];return a.forEach(i=>{o.push(i.passthrough),o.push(i.before),o.push(i.match),o.push(i.after)}),o=o.filter(i=>i),o=o.map(i=>uo(i,this)),this.update(o)};Lt.splitBefore=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=so(e,this,t).fullPointer,a=n(this.fullPointer,r);for(let i=0;i<a.length;i+=1)!a[i].after&&a[i+1]&&a[i+1].before&&a[i].match&&a[i].match[0]===a[i+1].before[0]&&(a[i].after=a[i+1].before,delete a[i+1].before);let o=[];return a.forEach(i=>{o.push(i.passthrough),o.push(i.before),i.match&&i.after?o.push(Mu(i.match,i.after)):o.push(i.match)}),o=o.filter(i=>i),o=o.map(i=>uo(i,this)),this.update(o)};Lt.splitAfter=function(e,t){const{splitAll:n}=this.methods.one.pointer,r=so(e,this,t).fullPointer,a=n(this.fullPointer,r);let o=[];return a.forEach(i=>{o.push(i.passthrough),i.before&&i.match?o.push(Mu(i.before,i.match)):(o.push(i.before),o.push(i.match)),o.push(i.after)}),o=o.filter(i=>i),o=o.map(i=>uo(i,this)),this.update(o)};Lt.split=Lt.splitAfter;var Nf=Object.defineProperty,hr=l((e,t)=>Nf(e,"name",{value:t,configurable:!0}),"r$18");const Tf=hr(function(e,t){return!e||!t||e[0]!==t[0]?!1:e[2]===t[1]},"isNeighbour"),mi=hr(function(e,t,n){const r=e.world,a=r.methods.one.parseMatch;t=t||".$",n=n||"^.";const o=a(t,{},r),i=a(n,{},r);o[o.length-1].end=!0,i[0].start=!0;const s=e.fullPointer,u=[s[0]];for(let c=1;c<s.length;c+=1){const d=u[u.length-1],h=s[c],p=e.update([d]),b=e.update([h]);Tf(d,h)&&p.has(o)&&b.has(i)?u[u.length-1]=[d[0],d[1],h[2],d[3],h[4]]:u.push(h)}return e.update(u)},"mergeIf"),If={joinIf:hr(function(e,t){return mi(this,e,t)},"joinIf"),join:hr(function(){return mi(this)},"join")};var Df=Object.defineProperty,Ef=l((e,t)=>Df(e,"name",{value:t,configurable:!0}),"e$17");const Ie=Object.assign({},yf,xf,Lt,If);Ie.lookBehind=Ie.before;Ie.lookBefore=Ie.before;Ie.lookAhead=Ie.after;Ie.lookAfter=Ie.after;Ie.notIf=Ie.ifNo;const Hf=Ef(function(e){Object.assign(e.prototype,Ie)},"matchAPI");var Gf=Object.defineProperty,kr=l((e,t)=>Gf(e,"name",{value:t,configurable:!0}),"o$1D");const Ff=/(?:^|\s)([![^]*(?:<[^<]*>)?\/.*?[^\\/]\/[?\]+*$~]*)(?:\s|$)/,Vf=/([!~[^]*(?:<[^<]*>)?\([^)]+[^\\)]\)[?\]+*$~]*)(?:\s|$)/,Sf=/ /g,zf=kr(e=>/^[![^]*(<[^<]*>)?\(/.test(e)&&/\)[?\]+*$~]*$/.test(e),"isBlock"),vi=kr(e=>/^[![^]*(<[^<]*>)?\//.test(e)&&/\/[?\]+*$~]*$/.test(e),"isReg"),bi=kr(function(e){return e=e.map(t=>t.trim()),e=e.filter(t=>t),e},"cleanUp"),Bf=kr(function(e){const t=e.split(Ff);let n=[];t.forEach(a=>{if(vi(a)){n.push(a);return}n=n.concat(a.split(Vf))}),n=bi(n);let r=[];return n.forEach(a=>{zf(a)||vi(a)?r.push(a):r=r.concat(a.split(Sf))}),r=bi(r),r},"parseBlocks");var _f=Object.defineProperty,kt=l((e,t)=>_f(e,"name",{value:t,configurable:!0}),"o$1C");const yi=/\{([0-9]+)?(, *[0-9]*)?\}/,$i=/&&/,Mf=new RegExp(/^<\s*(\S+)\s*>/),wi=kt(e=>e.charAt(0).toUpperCase()+e.substring(1),"titleCase"),ve=kt(e=>e.charAt(e.length-1),"end"),le=kt(e=>e.charAt(0),"start"),Vt=kt(e=>e.substring(1),"stripStart"),St=kt(e=>e.substring(0,e.length-1),"stripEnd"),Xt=kt(function(e){return e=Vt(e),e=St(e),e},"stripBoth"),Lu=kt(function(e,t){const n={};for(let r=0;r<2;r+=1){if(ve(e)==="$"&&(n.end=!0,e=St(e)),le(e)==="^"&&(n.start=!0,e=Vt(e)),ve(e)==="?"&&(n.optional=!0,e=St(e)),(le(e)==="["||ve(e)==="]")&&(n.group=null,le(e)==="["&&(n.groupStart=!0),ve(e)==="]"&&(n.groupEnd=!0),e=e.replace(/^\[/,""),e=e.replace(/\]$/,""),le(e)==="<")){const a=Mf.exec(e);a.length>=2&&(n.group=a[1],e=e.replace(a[0],""))}if(ve(e)==="+"&&(n.greedy=!0,e=St(e)),e!=="*"&&ve(e)==="*"&&e!=="\\*"&&(n.greedy=!0,e=St(e)),le(e)==="!"&&(n.negative=!0,e=Vt(e)),le(e)==="~"&&ve(e)==="~"&&e.length>2&&(e=Xt(e),n.fuzzy=!0,n.min=t.fuzzy||.85,/\(/.test(e)===!1))return n.word=e,n;if(le(e)==="/"&&ve(e)==="/")return e=Xt(e),t.caseSensitive&&(n.use="text"),n.regex=new RegExp(e),n;if(yi.test(e)===!0&&(e=e.replace(yi,(a,o,i)=>(i===void 0?(n.min=Number(o),n.max=Number(o)):(i=i.replace(/, */,""),o===void 0?(n.min=0,n.max=Number(i)):(n.min=Number(o),n.max=Number(i||999))),n.greedy=!0,n.min||(n.optional=!0),""))),le(e)==="("&&ve(e)===")"){$i.test(e)?(n.choices=e.split($i),n.operator="and"):(n.choices=e.split("|"),n.operator="or"),n.choices[0]=Vt(n.choices[0]);const a=n.choices.length-1;n.choices[a]=St(n.choices[a]),n.choices=n.choices.map(o=>o.trim()),n.choices=n.choices.filter(o=>o),n.choices=n.choices.map(o=>o.split(/ /g).map(i=>Lu(i,t))),e=""}if(le(e)==="{"&&ve(e)==="}"){if(e=Xt(e),n.root=e,/\//.test(e)){const a=n.root.split(/\//);n.root=a[0],n.pos=a[1],n.pos==="adj"&&(n.pos="Adjective"),n.pos=n.pos.charAt(0).toUpperCase()+n.pos.substr(1).toLowerCase(),a[2]!==void 0&&(n.sense=a[2])}return n}if(le(e)==="<"&&ve(e)===">")return e=Xt(e),n.chunk=wi(e),n.greedy=!0,n;if(le(e)==="%"&&ve(e)==="%")return e=Xt(e),n.switch=e,n}return le(e)==="#"?(n.tag=Vt(e),n.tag=wi(n.tag),n):le(e)==="@"?(n.method=Vt(e),n):e==="."?(n.anything=!0,n):e==="*"?(n.anything=!0,n.greedy=!0,n.optional=!0,n):(e&&(e=e.replace("\\*","*"),e=e.replace("\\.","."),t.caseSensitive?n.use="text":e=e.toLowerCase(),n.word=e),n)},"parseToken");var Lf=Object.defineProperty,Kf=l((e,t)=>Lf(e,"name",{value:t,configurable:!0}),"c$1F");const Jf=/[a-z0-9][-–—][a-z]/i,Wf=Kf(function(e,t){const n=t.model.one.prefixes;for(let r=e.length-1;r>=0;r-=1){const a=e[r];if(a.word&&Jf.test(a.word)){let o=a.word.split(/[-–—]/g);if(n.hasOwnProperty(o[0]))continue;o=o.filter(i=>i).reverse(),e.splice(r,1),o.forEach(i=>{const s=Object.assign({},a);s.word=i,e.splice(r,0,s)})}}return e},"splitHyphens");var qf=Object.defineProperty,jr=l((e,t)=>qf(e,"name",{value:t,configurable:!0}),"e$16");const Pi=jr(function(e,t){const{all:n}=t.methods.two.transform.verb||{},r=e.root;return n?n(r,t.model):[]},"addVerbs"),ki=jr(function(e,t){const{all:n}=t.methods.two.transform.noun||{};return n?n(e.root,t.model):[e.root]},"addNoun"),ji=jr(function(e,t){const{all:n}=t.methods.two.transform.adjective||{};return n?n(e.root,t.model):[e.root]},"addAdjective"),Rf=jr(function(e,t){return e=e.map(n=>{if(n.root)if(t.methods.two&&t.methods.two.transform){let r=[];n.pos?n.pos==="Verb"?r=r.concat(Pi(n,t)):n.pos==="Noun"?r=r.concat(ki(n,t)):n.pos==="Adjective"&&(r=r.concat(ji(n,t))):(r=r.concat(Pi(n,t)),r=r.concat(ki(n,t)),r=r.concat(ji(n,t))),r=r.filter(a=>a),r.length>0&&(n.operator="or",n.fastOr=new Set(r))}else n.machine=n.root,delete n.id,delete n.root;return n}),e},"inflectRoot");var Uf=Object.defineProperty,Ar=l((e,t)=>Uf(e,"name",{value:t,configurable:!0}),"f$1v");const Qf=Ar(function(e){let t=0,n=null;for(let r=0;r<e.length;r++){const a=e[r];a.groupStart===!0&&(n=a.group,n===null&&(n=String(t),t+=1)),n!==null&&(a.group=n),a.groupEnd===!0&&(n=null)}return e},"nameGroups"),Zf=Ar(function(e){return e.map(t=>{if(t.choices!==void 0){if(t.operator!=="or"||t.fuzzy===!0)return t;t.choices.every(n=>{if(n.length!==1)return!1;const r=n[0];return r.fuzzy===!0||r.start||r.end?!1:r.word!==void 0&&r.negative!==!0&&r.optional!==!0&&r.method!==!0})===!0&&(t.fastOr=new Set,t.choices.forEach(n=>{t.fastOr.add(n[0].word)}),delete t.choices)}return t})},"doFastOrMode"),Xf=Ar(function(e){return e.map(t=>(t.fuzzy&&t.choices&&t.choices.forEach(n=>{n.length===1&&n[0].word&&(n[0].fuzzy=!0,n[0].min=t.min)}),t))},"fuzzyOr"),Yf=Ar(function(e){return e=Qf(e),e=Zf(e),e=Xf(e),e},"postProcess");var eg=Object.defineProperty,tg=l((e,t)=>eg(e,"name",{value:t,configurable:!0}),"m$J");const ng=tg(function(e,t,n){if(e==null||e==="")return[];t=t||{},typeof e=="number"&&(e=String(e));let r=Bf(e);return r=r.map(a=>Lu(a,t)),r=Wf(r,n),r=Rf(r,n),r=Yf(r,t),r},"syntax");var rg=Object.defineProperty,Ku=l((e,t)=>rg(e,"name",{value:t,configurable:!0}),"f$1u");const ag=Ku(function(e,t){for(const n of t)if(e.has(n))return!0;return!1},"anyIntersection"),og=Ku(function(e,t){for(let n=0;n<e.length;n+=1){const r=e[n];if(!(r.optional===!0||r.negative===!0||r.fuzzy===!0)){if(r.word!==void 0&&t.has(r.word)===!1||r.tag!==void 0&&t.has("#"+r.tag)===!1)return!0;if(r.fastOr&&ag(r.fastOr,t)===!1)return!1}}return!1},"failFast");var ig=Object.defineProperty,Ju=l((e,t)=>ig(e,"name",{value:t,configurable:!0}),"g$v");const sg=Ju(function(e,t){const n=e.length,r=t.length;if(n===0)return r;if(r===0)return n;const a=(r>n?r:n)+1;if(Math.abs(n-r)>(a||100))return a||100;const o=[];for(let p=0;p<a;p++)o[p]=[p],o[p].length=a;for(let p=0;p<a;p++)o[0][p]=p;let i,s,u,c,d,h;for(let p=1;p<=n;++p)for(s=e[p-1],i=1;i<=r;++i){if(p===i&&o[p][i]>4)return n;u=t[i-1],c=s===u?0:1,d=o[p-1][i]+1,(h=o[p][i-1]+1)<d&&(d=h),(h=o[p-1][i-1]+c)<d&&(d=h),p>1&&i>1&&s===t[i-2]&&e[p-2]===u&&(h=o[p-2][i-2]+c)<d?o[p][i]=h:o[p][i]=d}return o[n][r]},"editDistance"),ug=Ju(function(e,t,n=3){if(e===t)return 1;if(e.length<n||t.length<n)return 0;const r=sg(e,t),a=Math.max(e.length,t.length);return 1-(a===0?0:r/a)},"fuzzyMatch");var lg=Object.defineProperty,R=l((e,t)=>lg(e,"name",{value:t,configurable:!0}),"t$H");const cg=/([\u0022\uFF02\u0027\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F])/,dg=/([\u0022\uFF02\u0027\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4])/,Ai=/^[-–—]$/,xi=/ [-–—]{1,3} /,De=R((e,t)=>e.post.indexOf(t)!==-1,"hasPost"),cn={hasQuote:R(e=>cg.test(e.pre)||dg.test(e.post),"hasQuote"),hasComma:R(e=>De(e,","),"hasComma"),hasPeriod:R(e=>De(e,".")===!0&&De(e,"...")===!1,"hasPeriod"),hasExclamation:R(e=>De(e,"!"),"hasExclamation"),hasQuestionMark:R(e=>De(e,"?")||De(e,"¿"),"hasQuestionMark"),hasEllipses:R(e=>De(e,"..")||De(e,"…"),"hasEllipses"),hasSemicolon:R(e=>De(e,";"),"hasSemicolon"),hasColon:R(e=>De(e,":"),"hasColon"),hasSlash:R(e=>/\//.test(e.text),"hasSlash"),hasHyphen:R(e=>Ai.test(e.post)||Ai.test(e.pre),"hasHyphen"),hasDash:R(e=>xi.test(e.post)||xi.test(e.pre),"hasDash"),hasContraction:R(e=>!!e.implicit,"hasContraction"),isAcronym:R(e=>e.tags.has("Acronym"),"isAcronym"),isKnown:R(e=>e.tags.size>0,"isKnown"),isTitleCase:R(e=>new RegExp("^\\p{Lu}[a-z'\\u00C0-\\u00FF]","u").test(e.text),"isTitleCase"),isUpperCase:R(e=>new RegExp("^\\p{Lu}+$","u").test(e.text),"isUpperCase")};cn.hasQuotation=cn.hasQuote;var hg=Object.defineProperty,lo=l((e,t)=>hg(e,"name",{value:t,configurable:!0}),"s$1c");let W=lo(function(){},"wrapMatch");const pg=lo(function(e,t,n,r){if(t.anything===!0)return!0;if(t.start===!0&&n!==0||t.end===!0&&n!==r-1)return!1;if(t.id!==void 0&&t.id===e.id)return!0;if(t.word!==void 0)return t.use?t.word===e[t.use]:e.machine!==null&&e.machine===t.word||e.alias!==void 0&&e.alias.hasOwnProperty(t.word)||t.fuzzy===!0&&(t.word===e.root||ug(t.word,e.normal)>=t.min)||e.alias&&e.alias.some(a=>a===t.word)?!0:t.word===e.text||t.word===e.normal;if(t.tag!==void 0)return e.tags.has(t.tag)===!0;if(t.method!==void 0)return typeof cn[t.method]=="function"&&cn[t.method](e)===!0;if(t.pre!==void 0)return e.pre&&e.pre.includes(t.pre);if(t.post!==void 0)return e.post&&e.post.includes(t.post);if(t.regex!==void 0){let a=e.normal;return t.use&&(a=e[t.use]),t.regex.test(a)}if(t.chunk!==void 0)return e.chunk===t.chunk;if(t.switch!==void 0)return e.switch===t.switch;if(t.machine!==void 0)return e.normal===t.machine||e.machine===t.machine||e.root===t.machine;if(t.sense!==void 0)return e.sense===t.sense;if(t.fastOr!==void 0){if(t.pos&&!e.tags.has(t.pos))return null;const a=e.root||e.implicit||e.machine||e.normal;return t.fastOr.has(a)||t.fastOr.has(e.text)}return t.choices!==void 0?t.operator==="and"?t.choices.every(a=>W(e,a,n,r)):t.choices.some(a=>W(e,a,n,r)):!1},"doesMatch");W=lo(function(e,t,n,r){const a=pg(e,t,n,r);return t.negative===!0?!a:a},"wrapMatch");var fg=Object.defineProperty,co=l((e,t)=>fg(e,"name",{value:t,configurable:!0}),"i$1B");const gg=co(function(e,t){const n=Object.assign({},e.regs[e.r],{start:!1,end:!1}),r=e.t;for(;e.t<e.terms.length;e.t+=1){if(t&&W(e.terms[e.t],t,e.start_i+e.t,e.phrase_length))return e.t;const a=e.t-r+1;if(n.max!==void 0&&a===n.max)return e.t;if(W(e.terms[e.t],n,e.start_i+e.t,e.phrase_length)===!1)return n.min!==void 0&&a<n.min?null:e.t}return e.t},"getGreedy"),mg=co(function(e,t){let n=e.t;if(!t)return e.terms.length;for(;n<e.terms.length;n+=1)if(W(e.terms[n],t,e.start_i+n,e.phrase_length)===!0)return n;return null},"greedyTo"),vg=co(function(e,t){if(e.end===!0&&e.greedy===!0&&t.start_i+t.t<t.phrase_length-1){const n=Object.assign({},e,{end:!1});if(W(t.terms[t.t],n,t.start_i+t.t,t.phrase_length)===!0)return!0}return!1},"isEndGreedy");var bg=Object.defineProperty,yg=l((e,t)=>bg(e,"name",{value:t,configurable:!0}),"u$1u");const xr=yg(function(e,t){return e.groups[e.inGroup]||(e.groups[e.inGroup]={start:t,length:0}),e.groups[e.inGroup]},"getGroup");var $g=Object.defineProperty,wg=l((e,t)=>$g(e,"name",{value:t,configurable:!0}),"i$1A");const Pg=wg(function(e){const{regs:t}=e,n=t[e.r],r=mg(e,t[e.r+1]);if(r===null||r===0||n.min!==void 0&&r-e.t<n.min)return null;if(n.max!==void 0&&r-e.t>n.max)return e.t=e.t+n.max,!0;if(e.hasGroup===!0){const a=xr(e,e.t);a.length=r-e.t}return e.t=r,!0},"doAstrix");var kg=Object.defineProperty,ho=l((e,t)=>kg(e,"name",{value:t,configurable:!0}),"s$1b");const jg=ho(function(e){return Object.prototype.toString.call(e)==="[object Array]"},"isArray"),Wu=ho(function(e,t=0){const n=e.regs[e.r];let r=!1;for(let a=0;a<n.choices.length;a+=1){const o=n.choices[a];if(!jg(o))return!1;if(r=o.every((i,s)=>{let u=0;const c=e.t+s+t+u;if(e.terms[c]===void 0)return!1;const d=W(e.terms[c],i,c+e.start_i,e.phrase_length);if(d===!0&&i.greedy===!0)for(let h=1;h<e.terms.length;h+=1){const p=e.terms[c+h];if(p)if(W(p,i,e.start_i+h,e.phrase_length)===!0)u+=1;else break}return t+=u,d}),r){t+=o.length;break}}return r&&n.greedy===!0?Wu(e,t):t},"doOrBlock"),Ag=ho(function(e){let t=0;return e.regs[e.r].choices.every(n=>{const r=n.every((a,o)=>{const i=e.t+o;return e.terms[i]===void 0?!1:W(e.terms[i],a,i,e.phrase_length)});return r===!0&&n.length>t&&(t=n.length),r})===!0?t:!1},"doAndBlock");var xg=Object.defineProperty,Cg=l((e,t)=>xg(e,"name",{value:t,configurable:!0}),"i$1z");const Og=Cg(function(e){const{regs:t}=e,n=t[e.r],r=Wu(e);if(r){if(n.negative===!0)return null;if(e.hasGroup===!0){const a=xr(e,e.t);a.length+=r}if(n.end===!0){const a=e.phrase_length;if(e.t+e.start_i+r!==a)return null}return e.t+=r,!0}else if(!n.optional)return null;return!0},"orBlock");var Ng=Object.defineProperty,Tg=l((e,t)=>Ng(e,"name",{value:t,configurable:!0}),"i$1y");const Ig=Tg(function(e){const{regs:t}=e,n=t[e.r],r=Ag(e);if(r){if(n.negative===!0)return null;if(e.hasGroup===!0){const a=xr(e,e.t);a.length+=r}if(n.end===!0){const a=e.phrase_length-1;if(e.t+e.start_i!==a)return null}return e.t+=r,!0}else if(!n.optional)return null;return!0},"andBlock");var Dg=Object.defineProperty,Eg=l((e,t)=>Dg(e,"name",{value:t,configurable:!0}),"m$G");const Hg=Eg(function(e,t,n){let r=0;for(let a=e.t;a<e.terms.length;a+=1){let o=W(e.terms[a],t,e.start_i+e.t,e.phrase_length);if(o||n&&(o=W(e.terms[a],n,e.start_i+e.t,e.phrase_length),o)||(r+=1,t.max!==void 0&&r===t.max))break}return r===0||t.min&&t.min>r?!1:(e.t+=r,!0)},"negGreedy");var Gg=Object.defineProperty,Fg=l((e,t)=>Gg(e,"name",{value:t,configurable:!0}),"g$u");const Vg=Fg(function(e){const{regs:t}=e,n=t[e.r],r=Object.assign({},n);if(r.negative=!1,W(e.terms[e.t],r,e.start_i+e.t,e.phrase_length))return!1;if(n.optional){const a=t[e.r+1];a&&(W(e.terms[e.t],a,e.start_i+e.t,e.phrase_length)?e.r+=1:a.optional&&t[e.r+2]&&W(e.terms[e.t],t[e.r+2],e.start_i+e.t,e.phrase_length)&&(e.r+=2))}return n.greedy?Hg(e,r,t[e.r+1]):(e.t+=1,!0)},"doNegative");var Sg=Object.defineProperty,zg=l((e,t)=>Sg(e,"name",{value:t,configurable:!0}),"c$1y");const Bg=zg(function(e){const{regs:t}=e,n=t[e.r],r=e.terms[e.t],a=W(r,t[e.r+1],e.start_i+e.t,e.phrase_length);if(n.negative||a){const o=e.terms[e.t+1];(!o||!W(o,t[e.r+1],e.start_i+e.t,e.phrase_length))&&(e.r+=1)}},"foundOptional");var _g=Object.defineProperty,Mg=l((e,t)=>_g(e,"name",{value:t,configurable:!0}),"e$12");const Lg=Mg(function(e){const{regs:t,phrase_length:n}=e,r=t[e.r];return e.t=gg(e,t[e.r+1]),e.t===null||r.min&&r.min>e.t||r.end===!0&&e.start_i+e.t!==n?null:!0},"greedyMatch");var Kg=Object.defineProperty,Jg=l((e,t)=>Kg(e,"name",{value:t,configurable:!0}),"o$1w");const Wg=Jg(function(e){const t=e.terms[e.t],n=e.regs[e.r];if(t.implicit&&e.terms[e.t+1]){if(!e.terms[e.t+1].implicit)return;n.word===t.normal&&(e.t+=1),n.method==="hasContraction"&&(e.t+=1)}},"contractionSkip");var qg=Object.defineProperty,qu=l((e,t)=>qg(e,"name",{value:t,configurable:!0}),"e$11");const Rg=qu(function(e,t){const n=e.regs[e.r],r=xr(e,t);e.t>1&&n.greedy?r.length+=e.t-t:r.length++},"setGroup"),na=qu(function(e){const{regs:t}=e,n=t[e.r],r=e.terms[e.t],a=e.t;return n.optional&&t[e.r+1]&&n.negative?!0:(n.optional&&t[e.r+1]&&Bg(e),r.implicit&&e.terms[e.t+1]&&Wg(e),e.t+=1,n.end===!0&&e.t!==e.terms.length&&n.greedy!==!0||n.greedy===!0&&!Lg(e)?null:(e.hasGroup===!0&&Rg(e,a),!0))},"simpleMatch");var Ug=Object.defineProperty,Qg=l((e,t)=>Ug(e,"name",{value:t,configurable:!0}),"s$1a");const po=Qg(function(e,t,n,r){if(e.length===0||t.length===0)return null;const a={t:0,terms:e,r:0,regs:t,groups:{},start_i:n,phrase_length:r,inGroup:null};for(;a.r<t.length;a.r+=1){const s=t[a.r];if(a.hasGroup=!!s.group,a.hasGroup===!0?a.inGroup=s.group:a.inGroup=null,!a.terms[a.t]){if(t.slice(a.r).some(u=>!u.optional)===!1)break;return null}if(s.anything===!0&&s.greedy===!0){if(!Pg(a))return null;continue}if(s.choices!==void 0&&s.operator==="or"){if(!Og(a))return null;continue}if(s.choices!==void 0&&s.operator==="and"){if(!Ig(a))return null;continue}if(s.anything===!0){if(s.negative&&s.anything||!na(a))return null;continue}if(vg(s,a)===!0){if(!na(a))return null;continue}if(s.negative){if(!Vg(a))return null;continue}if(W(a.terms[a.t],s,a.start_i+a.t,a.phrase_length)===!0){if(!na(a))return null;continue}if(s.optional!==!0)return null}const o=[null,n,a.t+n];if(o[1]===o[2])return null;const i={};return Object.keys(a.groups).forEach(s=>{const u=a.groups[s],c=n+u.start;i[s]=[null,c,c+u.length]}),{pointer:o,groups:i}},"tryHere");var Zg=Object.defineProperty,Xg=l((e,t)=>Zg(e,"name",{value:t,configurable:!0}),"u$1s");const Yg=Xg(function(e,t){const n=[],r={};return e.length===0?{ptrs:n,byGroup:r}:(typeof t=="number"&&(t=String(t)),t?e.forEach(a=>{a.groups[t]&&n.push(a.groups[t])}):e.forEach(a=>{n.push(a.pointer),Object.keys(a.groups).forEach(o=>{r[o]=r[o]||[],r[o].push(a.groups[o])})}),{ptrs:n,byGroup:r})},"getGroup");var em=Object.defineProperty,tm=l((e,t)=>em(e,"name",{value:t,configurable:!0}),"r$16");const nm=tm(function(e,t,n){return e=e.filter(r=>{const[a,o,i]=r.pointer,s=n[a].slice(o,i);for(let u=0;u<s.length;u+=1){const c=s.slice(u);if(po(c,t,u,s.length)!==null)return!1}return!0}),e},"notIf");var rm=Object.defineProperty,fo=l((e,t)=>rm(e,"name",{value:t,configurable:!0}),"a$1w");const Ru=fo(function(e,t){return e.pointer[0]=t,Object.keys(e.groups).forEach(n=>{e.groups[n][0]=t}),e},"addSentence"),am=fo(function(e,t,n){let r=po(e,t,0,e.length);return r?(r=Ru(r,n),r):null},"handleStart"),om=fo(function(e,t,n){n=n||[];const{regs:r,group:a,justOne:o}=t;let i=[];if(!r||r.length===0)return{ptrs:[],byGroup:{}};const s=r.filter(u=>u.optional!==!0&&u.negative!==!0).length;e:for(let u=0;u<e.length;u+=1){const c=e[u];if(!(n[u]&&og(r,n[u]))){if(r[0].start===!0){const d=am(c,r,u,a);d&&i.push(d);continue}for(let d=0;d<c.length;d+=1){const h=c.slice(d);if(h.length<s)break;let p=po(h,r,d,c.length);if(p){if(p=Ru(p,u),i.push(p),o===!0)break e;const b=p.pointer[2];Math.abs(b-1)>d&&(d=Math.abs(b-1))}}}}return r[r.length-1].end===!0&&(i=i.filter(u=>{const c=u.pointer[0];return e[c].length===u.pointer[2]})),t.notIf&&(i=nm(i,t.notIf,e)),i=Yg(i,a),i.ptrs.forEach(u=>{const[c,d,h]=u;u[3]=e[c][d].id,u[4]=e[c][h-1].id}),i},"runMatch"),im={one:{termMethods:cn,parseMatch:ng,match:om}};var sm=Object.defineProperty,um=l((e,t)=>sm(e,"name",{value:t,configurable:!0}),"c$1t");const lm={parseMatch:um(function(e,t){const n=this.world(),r=n.methods.one.killUnicode;return r&&(e=r(e,n)),n.methods.one.parseMatch(e,t,n)},"parseMatch")},cm={api:Hf,methods:im,lib:lm};var dm=Object.defineProperty,Cr=l((e,t)=>dm(e,"name",{value:t,configurable:!0}),"i$1w");const hm=/^\../,pm=/^#./,fm=Cr(e=>(e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e=e.replace(/'/g,"&apos;"),e),"escapeXml"),gm=Cr(function(e){let t="",n="</span>";return e=fm(e),hm.test(e)?t=`<span class="${e.replace(/^\./,"")}"`:pm.test(e)?t=`<span id="${e.replace(/^#/,"")}"`:(t=`<${e}`,n=`</${e}>`),t+=">",{start:t,end:n}},"toTag"),mm=Cr(function(e,t){const n={},r={};return Object.keys(t).forEach(a=>{let o=t[a];const i=gm(a);typeof o=="string"&&(o=e.match(o)),o.docs.forEach(s=>{if(s.every(d=>d.implicit))return;const u=s[0].id;n[u]=n[u]||[],n[u].push(i.start);const c=s[s.length-1].id;r[c]=r[c]||[],r[c].push(i.end)})}),{starts:n,ends:r}},"getIndex"),vm=Cr(function(e){const{starts:t,ends:n}=mm(this,e);let r="";return this.docs.forEach(a=>{for(let o=0;o<a.length;o+=1){const i=a[o];t.hasOwnProperty(i.id)&&(r+=t[i.id].join("")),r+=i.pre||"",r+=i.text||"",n.hasOwnProperty(i.id)&&(r+=n[i.id].join("")),r+=i.post||""}}),r},"html"),bm={html:vm};var ym=Object.defineProperty,Uu=l((e,t)=>ym(e,"name",{value:t,configurable:!0}),"n$V");const Qu=/[,:;)\]*.?~!\u0022\uFF02\u201D\u2019\u00BB\u203A\u2032\u2033\u2034\u301E\u00B4—-]+$/,Ca=/^[(['"*~\uFF02\u201C\u2018\u201F\u201B\u201E\u2E42\u201A\u00AB\u2039\u2035\u2036\u2037\u301D\u0060\u301F]+/,$m=/[,:;)('"\u201D\]]/,wm=/^[-–—]$/,Pm=/ /,vt=Uu(function(e,t,n=!0){let r="";return e.forEach(a=>{let o=a.pre||"",i=a.post||"";t.punctuation==="some"&&(o=o.replace(Ca,""),wm.test(i)&&(i=" "),i=i.replace($m,""),i=i.replace(/\?!+/,"?"),i=i.replace(/!+/,"!"),i=i.replace(/\?+/,"?"),i=i.replace(/\.{2,}/,""),a.tags.has("Abbreviation")&&(i=i.replace(/\./,""))),t.whitespace==="some"&&(o=o.replace(/\s/,""),i=i.replace(/\s+/," ")),t.keepPunct||(o=o.replace(Ca,""),i==="-"?i=" ":i=i.replace(Qu,""));let s=a[t.form||"text"]||a.normal||"";t.form==="implicit"&&(s=a.implicit||a.text),t.form==="root"&&a.implicit&&(s=a.root||a.implicit||a.normal),(t.form==="machine"||t.form==="implicit"||t.form==="root")&&a.implicit&&(!i||!Pm.test(i))&&(i+=" "),r+=o+s+i}),n===!1&&(r=r.trim()),t.lowerCase===!0&&(r=r.toLowerCase()),r},"textFromTerms"),km=Uu(function(e,t){let n="";if(!e||!e[0]||!e[0][0])return n;for(let r=0;r<e.length;r+=1)n+=vt(e[r],t,!0);if(t.keepSpace||(n=n.trim()),t.keepEndPunct===!1){e[0][0].tags.has("Emoticon")||(n=n.replace(Ca,""));const r=e[e.length-1];r[r.length-1].tags.has("Emoticon")||(n=n.replace(Qu,"")),n.endsWith("'")&&!n.endsWith("s'")&&(n=n.replace(/'/,""))}return t.cleanWhitespace===!0&&(n=n.trim()),n},"textFromDoc"),ut={text:{form:"text"},normal:{whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"normal"},machine:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"none",unicode:"some",form:"machine"},root:{keepSpace:!1,whitespace:"some",punctuation:"some",case:"some",unicode:"some",form:"root"},implicit:{form:"implicit"}};ut.clean=ut.normal;ut.reduced=ut.root;var jm=Object.defineProperty,Am=l((e,t)=>jm(e,"name",{value:t,configurable:!0}),"h$1a");const Zu=[];let bt=0;for(;bt<64;)Zu[bt]=0|Math.sin(++bt%Math.PI)*4294967296;const go=Am(function(e){let t,n,r,a=decodeURI(encodeURI(e))+"€",o=a.length;const i=[t=1732584193,n=4023233417,~t,~n],s=[];for(e=--o/4+2|15,s[--e]=o*8;~o;)s[o>>2]|=a.charCodeAt(o)<<8*o--;for(bt=a=0;bt<e;bt+=16){for(o=i;a<64;o=[r=o[3],t+((r=o[0]+[t&n|~t&r,r&t|~r&n,t^n^r,n^(t|~r)][o=a>>4]+Zu[a]+~~s[bt|[a,5*a+1,3*a+5,7*a][o]&15])<<(o=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*o+a++%4])|r>>>-o),t,n])t=o[1]|0,n=o[2];for(a=4;a;)i[--a]+=o[a]}for(e="";a<32;)e+=(i[a>>3]>>(1^a++)*4&15).toString(16);return e},"md5");var xm=Object.defineProperty,ae=l((e,t)=>xm(e,"name",{value:t,configurable:!0}),"s$17");const Cm={text:!0,terms:!0},Ci={case:"none",unicode:"some",form:"machine",punctuation:"some"},ra=ae(function(e,t){return Object.assign({},e,t)},"merge"),Qe={text:ae(e=>vt(e,{keepPunct:!0},!1),"text"),normal:ae(e=>vt(e,ra(ut.normal,{keepPunct:!0}),!1),"normal"),implicit:ae(e=>vt(e,ra(ut.implicit,{keepPunct:!0}),!1),"implicit"),machine:ae(e=>vt(e,Ci,!1),"machine"),root:ae(e=>vt(e,ra(Ci,{form:"root"}),!1),"root"),hash:ae(e=>go(vt(e,{keepPunct:!0},!1)),"hash"),offset:ae(e=>{const t=Qe.text(e).length;return{index:e[0].offset.index,start:e[0].offset.start,length:t}},"offset"),terms:ae(e=>e.map(t=>{const n=Object.assign({},t);return n.tags=Array.from(t.tags),n}),"terms"),confidence:ae((e,t,n)=>t.eq(n).confidence(),"confidence"),syllables:ae((e,t,n)=>t.eq(n).syllables(),"syllables"),sentence:ae((e,t,n)=>t.eq(n).fullSentence().text(),"sentence"),dirty:ae(e=>e.some(t=>t.dirty===!0),"dirty")};Qe.sentences=Qe.sentence;Qe.clean=Qe.normal;Qe.reduced=Qe.root;const Om=ae(function(e,t){return t=t||{},typeof t=="string"&&(t={}),t=Object.assign({},Cm,t),t.offset&&e.compute("offset"),e.docs.map((n,r)=>{const a={};return Object.keys(t).forEach(o=>{t[o]&&Qe[o]&&(a[o]=Qe[o](n,e,r))}),a})},"toJSON"),Oa={json:ae(function(e){const t=Om(this,e);return typeof e=="number"?t[e]:t},"json")};Oa.data=Oa.json;var Nm=Object.defineProperty,Xu=l((e,t)=>Nm(e,"name",{value:t,configurable:!0}),"i$1u");const Tm=Xu(()=>typeof window<"u"&&window.document,"isClientSide"),Im=Xu(function(e){const t=this.methods.one.debug||{};return e&&t.hasOwnProperty(e)?(t[e](this),this):Tm()?(t.clientSide(this),this):(t.tags(this),this)},"debug");var Dm=Object.defineProperty,mo=l((e,t)=>Dm(e,"name",{value:t,configurable:!0}),"f$1p");const Em=mo(function(e){const t=e.pre||"",n=e.post||"";return t+e.text+n},"toText"),Hm=mo(function(e,t){const n={};return Object.keys(t).forEach(r=>{e.match(r).fullPointer.forEach(a=>{n[a[3]]={fn:t[r],end:a[2]}})}),n},"findStarts"),Yu=mo(function(e,t){const n=Hm(e,t);let r="";return e.docs.forEach((a,o)=>{for(let i=0;i<a.length;i+=1){const s=a[i];if(n.hasOwnProperty(s.id)){const{fn:u,end:c}=n[s.id],d=e.update([[o,i,c]]);r+=a[i].pre||"",r+=u(d),i=c-1,r+=a[i].post||""}else r+=Em(s)}}),r},"wrap");var Gm=Object.defineProperty,Or=l((e,t)=>Gm(e,"name",{value:t,configurable:!0}),"i$1t");const Fm=Or(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Vm=Or(function(e){const t={};return e.forEach(n=>{t[n]=t[n]||0,t[n]+=1}),Object.keys(t).map(n=>({normal:n,count:t[n]})).sort((n,r)=>n.count>r.count?-1:0)},"topk"),Sm=Or(function(e){if(Fm(e))return Yu(this,e);if(e==="text")return this.text();if(e==="normal")return this.text("normal");if(e==="root")return this.text("root");if(e==="machine"||e==="reduced")return this.text("machine");if(e==="hash"||e==="md5")return go(this.text());if(e==="json")return this.json();if(e==="offset"||e==="offsets")return this.compute("offset"),this.json({offset:!0});if(e==="array")return this.docs.map(t=>t.reduce((n,r)=>n+r.pre+r.text+r.post,"").trim()).filter(t=>t);if(e==="freq"||e==="frequency"||e==="topk")return Vm(this.json({normal:!0}).map(t=>t.normal));if(e==="terms"){let t=[];return this.docs.forEach(n=>{let r=n.map(a=>a.text);r=r.filter(a=>a),t=t.concat(r)}),t}return e==="tags"?this.docs.map(t=>t.reduce((n,r)=>(n[r.implicit||r.normal]=Array.from(r.tags),n),{})):e==="debug"?this.debug():this.text()},"out"),zm={debug:Im,out:Sm,wrap:Or(function(e){return Yu(this,e)},"wrap")};var Bm=Object.defineProperty,el=l((e,t)=>Bm(e,"name",{value:t,configurable:!0}),"n$R");const _m=el(e=>Object.prototype.toString.call(e)==="[object Object]","isObject"),Mm={text:el(function(e){let t={};if(e&&typeof e=="string"&&ut.hasOwnProperty(e)?t=Object.assign({},ut[e]):e&&_m(e)&&(t=Object.assign({},e)),t.keepSpace===void 0&&!this.isFull()&&(t.keepSpace=!1),t.keepEndPunct===void 0&&this.pointer){const n=this.pointer[0];n&&n[1]?t.keepEndPunct=!1:t.keepEndPunct=!0}return t.keepPunct===void 0&&(t.keepPunct=!0),t.keepSpace===void 0&&(t.keepSpace=!0),km(this.docs,t)},"text")};var Lm=Object.defineProperty,Km=l((e,t)=>Lm(e,"name",{value:t,configurable:!0}),"o$1t");const Jm=Object.assign({},zm,Mm,Oa,bm),Wm=Km(function(e){Object.assign(e.prototype,Jm)},"addAPI");var qm=Object.defineProperty,Rm=l((e,t)=>qm(e,"name",{value:t,configurable:!0}),"l$16");const Um=Rm(function(e){console.log("%c -=-=- ","background-color:#6699cc;"),e.forEach(t=>{console.groupCollapsed(t.text());const n=t.docs[0].map(r=>{let a=r.text||"-";r.implicit&&(a="["+r.implicit+"]");const o="["+Array.from(r.tags).join(", ")+"]";return{text:a,tags:o}});console.table(n,["text","tags"]),console.groupEnd()})},"logClientSide");var Qm=Object.defineProperty,Se=l((e,t)=>Qm(e,"name",{value:t,configurable:!0}),"m$D");const ze="\x1B[0m",he={green:Se(e=>"\x1B[32m"+e+ze,"green"),red:Se(e=>"\x1B[31m"+e+ze,"red"),blue:Se(e=>"\x1B[34m"+e+ze,"blue"),magenta:Se(e=>"\x1B[35m"+e+ze,"magenta"),cyan:Se(e=>"\x1B[36m"+e+ze,"cyan"),yellow:Se(e=>"\x1B[33m"+e+ze,"yellow"),black:Se(e=>"\x1B[30m"+e+ze,"black"),dim:Se(e=>"\x1B[2m"+e+ze,"dim"),i:Se(e=>"\x1B[3m"+e+ze,"i")};var Zm=Object.defineProperty,tl=l((e,t)=>Zm(e,"name",{value:t,configurable:!0}),"i$1r");const Xm=tl(function(e,t){return t.one.tagSet&&(e=e.map(n=>{if(!t.one.tagSet.hasOwnProperty(n))return n;const r=t.one.tagSet[n].color||"blue";return he[r](n)})),e.join(", ")},"tagString"),Ym=tl(function(e){const{docs:t,model:n}=e;t.length===0&&console.log(he.blue(`
3
3
  ──────`)),t.forEach(r=>{console.log(he.blue(`
4
4
  ┌─────────`)),r.forEach(a=>{const o=[...a.tags||[]];let i=a.text||"-";a.sense&&(i=`{${a.normal}/${a.sense}}`),a.implicit&&(i="["+a.implicit+"]"),i=he.yellow(i);let s="'"+i+"'";if(a.reference){const c=e.update([a.reference]).text("normal");s+=` - ${he.dim(he.i("["+c+"]"))}`}s=s.padEnd(18);const u=he.blue(" │ ")+he.i(s)+" - "+Xm(o,n);console.log(u)})}),console.log(`
@@ -1,8 +1,8 @@
1
- var Y=Object.defineProperty;var b=(c,o)=>Y(c,"name",{value:o,configurable:!0});import{A as D,O as G,W as J,p as f,U as V,f as W,R as Z,F as m,J as q,V as K,B as Q,H as j,g as X,G as _,s as ee}from"./bin.js";import{render as T,renderToString as te,Text as y}from"@visulima/tui";import a from"react";import{H as oe,e as re,Z as ne}from"../packem_shared/ai-analysis-CGVjqwdc.js";import{U as se,B as ie,T as U}from"../packem_shared/vis-update-app-DGiMc5kb.js";var ae=Object.defineProperty,ce=b((c,o)=>ae(c,"name",{value:o,configurable:!0}),"$");const ge=ce(async({argument:c,logger:o,options:e,visConfig:i,workspaceRoot:x})=>{if(!x)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const d=x;if(e.securityConfig){const t=D(d);if(G(i??{},t.name),e.sync&&t.name==="pnpm"){const r=J(i??{});if(r.length>0){f.info(`
2
- Settings that would sync to pnpm-workspace.yaml:`);for(const R of r)f.success(` ${R}`)}else f.info("No security settings to sync.")}else e.sync&&t.name!=="pnpm"&&(f.info(`--sync is only available for pnpm projects. Your project uses ${t.name}.`),f.info("vis enforces security settings at the vis layer for non-pnpm projects."));if(!e.security&&!c?.length)return}const{packageManager:N}=V(d),O=W(d),l=i?.update??{},w=Z(d,N,{dev:e.dev,includeInternal:e["include-internal"],peer:e.peer,prod:e.prod});if(w.size===0){o.info("No catalogs found.");return}const h=e.target??l.target??"latest";if(!["latest","minor","patch"].includes(h))throw new Error(`Invalid target "${h}". Use: latest, minor, or patch.`);const B={exclude:[...m(e.exclude),...m(l.exclude)],ignore:m(l.ignore),include:[...m(e.include),...m(l.include),...c],includeLocked:!!e.includeLocked,includePrerelease:e.prerelease||l.prerelease||!1,security:e.security!==!1,target:h};let C=0;for(const t of w.values())C+=t.size;const v=!!process.stdout.isTTY&&!ee;let u;const F=v?(t,r)=>{u?u.rerender(a.createElement(U,{current:t,total:r})):u=T(a.createElement(U,{current:t,total:r}),{interactive:!0,patchConsole:!1})}:(t,r)=>{o.info(`Checking ${String(t)}/${String(r)} dependencies...`)};v||o.info(`Checking ${String(C)} catalog dependencies against npm registry...
3
- `);const z=q(i?.security?.socket),{failed:$,outdated:s}=await K(w,B,O,F,d,z,i?.security?.socket?.acceptedRisks);if(u&&(u.clear(),u.unmount()),$.length>0&&o.warn(`Failed to fetch: ${$.join(", ")}`),s.length===0){o.info("All catalog dependencies are up to date.");return}const k=e.format??l.format??"table",A=oe(e.aiType??"impact"),p=e.ai?await re(s,o,i?.ai,A):void 0;if(v&&k==="table"){const t=new se(s,p??null),r=i?.tui?.autoExit??!1,R=r===!0?3:typeof r=="number"?r:0;await T(a.createElement(ie,{autoExitSeconds:R,isDryRun:!0,store:t}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();const H=process.stdout.columns||80;process.stdout.write(`
4
- `);for(const n of s){const I=n.vulnerabilities?.length||n.socketReport&&n.socketReport.alerts.length>0,E=!!n.acceptedRisk,L=I?E?"✓":"⚠":"✓",M=E?"gray":n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",g=n.socketReport?.score.overall,P=g===void 0?"":` [${String(Math.round(g*100))}%]`,S=g===void 0?void 0:Q(g);process.stdout.write(`${te(a.createElement(y,null," ",a.createElement(y,{color:M},L),` ${n.packageName} ${n.currentRange} → ${n.newRange}`,a.createElement(y,{dimColor:!0},` ${n.updateType}`),S?a.createElement(y,{color:S},P):null),{columns:H})}
1
+ var B=Object.defineProperty;var b=(c,o)=>B(c,"name",{value:o,configurable:!0});import{A as D,O as G,W as J,p as f,U as V,f as W,R as Z,F as m,J as q,V as K,B as Q,H as j,g as X,G as _,s as ee}from"./bin.js";import{render as T,renderToString as te}from"@visulima/tui";import{Text as y}from"@visulima/tui/components/text";import a from"react";import{H as oe,e as re,Z as ne}from"../packem_shared/ai-analysis-C_GpXikx.js";import{U as se,C as ie,a as U}from"../packem_shared/vis-update-app-D0uL3eO5.js";var ae=Object.defineProperty,ce=b((c,o)=>ae(c,"name",{value:o,configurable:!0}),"$");const ye=ce(async({argument:c,logger:o,options:e,visConfig:i,workspaceRoot:R})=>{if(!R)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const d=R;if(e.securityConfig){const t=D(d);if(G(i??{},t.name),e.sync&&t.name==="pnpm"){const r=J(i??{});if(r.length>0){f.info(`
2
+ Settings that would sync to pnpm-workspace.yaml:`);for(const C of r)f.success(` ${C}`)}else f.info("No security settings to sync.")}else e.sync&&t.name!=="pnpm"&&(f.info(`--sync is only available for pnpm projects. Your project uses ${t.name}.`),f.info("vis enforces security settings at the vis layer for non-pnpm projects."));if(!e.security&&!c?.length)return}const{packageManager:N}=V(d),O=W(d),l=i?.update??{},w=Z(d,N,{dev:e.dev,includeInternal:e["include-internal"],peer:e.peer,prod:e.prod});if(w.size===0){o.info("No catalogs found.");return}const h=e.target??l.target??"latest";if(!["latest","minor","patch"].includes(h))throw new Error(`Invalid target "${h}". Use: latest, minor, or patch.`);const F={exclude:[...m(e.exclude),...m(l.exclude)],ignore:m(l.ignore),include:[...m(e.include),...m(l.include),...c],includeLocked:!!e.includeLocked,includePrerelease:e.prerelease||l.prerelease||!1,security:e.security!==!1,target:h};let x=0;for(const t of w.values())x+=t.size;const v=!!process.stdout.isTTY&&!ee;let u;const z=v?(t,r)=>{u?u.rerender(a.createElement(U,{current:t,total:r})):u=T(a.createElement(U,{current:t,total:r}),{interactive:!0,patchConsole:!1})}:(t,r)=>{o.info(`Checking ${String(t)}/${String(r)} dependencies...`)};v||o.info(`Checking ${String(x)} catalog dependencies against npm registry...
3
+ `);const A=q(i?.security?.socket),{failed:$,outdated:s}=await K(w,F,O,z,d,A,i?.security?.socket?.acceptedRisks);if(u&&(u.clear(),u.unmount()),$.length>0&&o.warn(`Failed to fetch: ${$.join(", ")}`),s.length===0){o.info("All catalog dependencies are up to date.");return}const k=e.format??l.format??"table",H=oe(e.aiType??"impact"),p=e.ai?await re(s,o,i?.ai,H):void 0;if(v&&k==="table"){const t=new se(s,p??null),r=i?.tui?.autoExit??!1,C=r===!0?3:typeof r=="number"?r:0;await T(a.createElement(ie,{autoExitSeconds:C,isDryRun:!0,store:t}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit();const I=process.stdout.columns||80;process.stdout.write(`
4
+ `);for(const n of s){const L=n.vulnerabilities?.length||n.socketReport&&n.socketReport.alerts.length>0,E=!!n.acceptedRisk,M=L?E?"✓":"⚠":"✓",P=E?"gray":n.updateType==="major"?"red":n.updateType==="minor"?"yellow":"green",g=n.socketReport?.score.overall,Y=g===void 0?"":` [${String(Math.round(g*100))}%]`,S=g===void 0?void 0:Q(g);process.stdout.write(`${te(a.createElement(y,null," ",a.createElement(y,{color:P},M),` ${n.packageName} ${n.currentRange} → ${n.newRange}`,a.createElement(y,{dimColor:!0},` ${n.updateType}`),S?a.createElement(y,{color:S},Y):null),{columns:I})}
5
5
  `)}process.stdout.write(`
6
6
  `),o.info(j(s))}else if(k==="json"){const t={failed:$,outdated:s};p&&(t.aiAnalysis=p),process.stdout.write(`${JSON.stringify(t,void 0,2)}
7
7
  `)}else k==="minimal"?process.stdout.write(`${X(s)}
8
- `):(_(s,o),o.info(j(s)),p&&(o.info(""),o.info(ne(p))));e.exitCode&&s.length>0&&(process.exitCode=1)},"execute");export{ge as default};
8
+ `):(_(s,o),o.info(j(s)),p&&(o.info(""),o.info(ne(p))));e.exitCode&&s.length>0&&(process.exitCode=1)},"execute");export{ye as default};
@@ -1 +1 @@
1
- var h=Object.defineProperty;var g=(r,n)=>h(r,"name",{value:n,configurable:!0});import{r as m}from"../packem_shared/toolchain-BhZNts--.js";var C=Object.defineProperty,a=g((r,n)=>C(r,"name",{value:n,configurable:!0}),"a");const u=a(()=>process.env.GITHUB_BASE_REF?{base:`origin/${process.env.GITHUB_BASE_REF}`,head:process.env.GITHUB_SHA??"HEAD"}:process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME?{base:`origin/${process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME}`,head:process.env.CI_COMMIT_SHA??"HEAD"}:process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH?{base:`origin/${process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH}`,head:process.env.BUILDKITE_COMMIT??"HEAD"}:process.env.CIRCLE_BRANCH&&process.env.CIRCLE_SHA1?{base:"origin/main",head:process.env.CIRCLE_SHA1}:{base:"origin/main",head:"HEAD"},"detectCiRefs"),A=a(async({argument:r,logger:n,options:e,runtime:s,visConfig:f,workspaceRoot:t})=>{const p=r[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const l=p.split(",").map(o=>o.trim()).filter(Boolean);if(l.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!t)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const{base:_,head:d}=u(),c=e.base??_,E=e.head??d;e.skipToolchain||n.info("▸ Toolchain pre-flight"),await m(t,f?.toolchain,{error:a(o=>{n.error(o)},"error"),info:a(o=>{n.info(o)},"info"),warn:a(o=>{n.warn(o)},"warn")},!!e.skipToolchain),e.install===!1?n.info("▸ Skipping install (--no-install)"):(n.info("▸ Installing dependencies"),await s.runCommand("install",{argv:["--frozen-lockfile"]}));for(const o of l){n.info(`▸ Running affected ${o} (base=${c}, head=${E})`);const i=[o,`--base=${c}`,`--head=${E}`,`--upstream=${String(e.upstream??"none")}`,`--downstream=${String(e.downstream??"deep")}`];e.parallel!==void 0&&i.push(`--parallel=${String(e.parallel)}`),e.partition&&i.push(`--partition=${String(e.partition)}`),e.query&&i.push(`--query=${String(e.query)}`),await s.runCommand("affected",{argv:i})}n.info("▸ CI pipeline complete")},"execute");export{A as default};
1
+ var h=Object.defineProperty;var g=(r,n)=>h(r,"name",{value:n,configurable:!0});import{r as m}from"../packem_shared/toolchain-B7dckBQ1.js";var C=Object.defineProperty,a=g((r,n)=>C(r,"name",{value:n,configurable:!0}),"a");const u=a(()=>process.env.GITHUB_BASE_REF?{base:`origin/${process.env.GITHUB_BASE_REF}`,head:process.env.GITHUB_SHA??"HEAD"}:process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME?{base:`origin/${process.env.CI_MERGE_REQUEST_TARGET_BRANCH_NAME}`,head:process.env.CI_COMMIT_SHA??"HEAD"}:process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH?{base:`origin/${process.env.BUILDKITE_PULL_REQUEST_BASE_BRANCH}`,head:process.env.BUILDKITE_COMMIT??"HEAD"}:process.env.CIRCLE_BRANCH&&process.env.CIRCLE_SHA1?{base:"origin/main",head:process.env.CIRCLE_SHA1}:{base:"origin/main",head:"HEAD"},"detectCiRefs"),A=a(async({argument:r,logger:n,options:e,runtime:s,visConfig:f,workspaceRoot:t})=>{const p=r[0];if(!p)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");const l=p.split(",").map(o=>o.trim()).filter(Boolean);if(l.length===0)throw new Error("Missing targets. Usage: vis ci <target>[,<target>…]");if(!t)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const{base:_,head:d}=u(),c=e.base??_,E=e.head??d;e.skipToolchain||n.info("▸ Toolchain pre-flight"),await m(t,f?.toolchain,{error:a(o=>{n.error(o)},"error"),info:a(o=>{n.info(o)},"info"),warn:a(o=>{n.warn(o)},"warn")},!!e.skipToolchain),e.install===!1?n.info("▸ Skipping install (--no-install)"):(n.info("▸ Installing dependencies"),await s.runCommand("install",{argv:["--frozen-lockfile"]}));for(const o of l){n.info(`▸ Running affected ${o} (base=${c}, head=${E})`);const i=[o,`--base=${c}`,`--head=${E}`,`--upstream=${String(e.upstream??"none")}`,`--downstream=${String(e.downstream??"deep")}`];e.parallel!==void 0&&i.push(`--parallel=${String(e.parallel)}`),e.partition&&i.push(`--partition=${String(e.partition)}`),e.query&&i.push(`--query=${String(e.query)}`),await s.runCommand("affected",{argv:i})}n.info("▸ CI pipeline complete")},"execute");export{A as default};
@@ -1 +1 @@
1
- var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,i as k}from"../packem_shared/otel-CO8UEfTa.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
1
+ var m=Object.defineProperty;var d=(s,o)=>m(s,"name",{value:o,configurable:!0});import{createRequire as p}from"node:module";import{M as a,a as k}from"./config.js";import{cleanWorkspace as b}from"#native";import{p as c}from"./bin.js";import{f as $}from"../packem_shared/utils-DrNg0XTR.js";const g=p(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(s=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,n]=f.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return f.getBuiltinModule(s)}return g(s)},"__cjs_getBuiltinModule"),{readdirSync:v,lstatSync:y,unlinkSync:_}=h("node:fs");var R=Object.defineProperty,u=d((s,o)=>R(s,"name",{value:o,configurable:!0}),"f");const j=u(s=>{const o=[],n=[s];for(;n.length>0;){const t=n.pop();let i;try{i=v(t)}catch{continue}for(const r of i){const e=a(t,r);try{const l=y(e);if(l.isSymbolicLink()||!l.isDirectory())continue}catch{continue}r==="node_modules"?o.push(e):r!==".git"&&r!==".hg"&&n.push(e)}}return o},"findNodeModulesDirectories"),M=["pnpm-lock.yaml","package-lock.json","npm-shrinkwrap.json","yarn.lock","bun.lock","bun.lockb"],x=u((s,o,n)=>{let t=0,i=!1;for(const r of M){const e=a(s,r);if(k(e)){if(o){n.info(` ${e}`),t++;continue}try{_(e),c.success(`Removed ${e}`),t++}catch(l){c.error(`${e}: ${$(l)}`),i=!0}}}return{hadError:i,removed:t}},"removeLockfiles"),C=u(async({logger:s,options:o,workspaceRoot:n})=>{const t=n??process.cwd(),i=o.lockfile||!1;if(o.dryRun){const e=j(t);if(e.length>0){c.info("Would remove:");for(const l of e)s.info(` ${l}`)}else c.info("No node_modules directories found.");i&&x(t,!0,s);return}const r=b(t,i);for(const e of r.removed)c.success(`Removed ${e}`);for(const e of r.lockfilesRemoved)c.success(`Removed ${e}`);for(const e of r.errors)c.error(e);r.removed.length===0&&r.lockfilesRemoved.length===0?c.info("No node_modules directories found."):c.info(`Cleaned ${r.removed.length} node_modules director${r.removed.length===1?"y":"ies"}`),r.errors.length>0&&(process.exitCode=1)},"execute");export{C as default};
@@ -1 +1 @@
1
- var i=Object.defineProperty;var n=(e,o)=>i(e,"name",{value:o,configurable:!0});import{h as l,i as p}from"./bin.js";var f=Object.defineProperty,d=n((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),s=p(t,o.check||!1,c,e);s!==0&&(process.exitCode=s)},"execute");export{u as default};
1
+ var i=Object.defineProperty;var n=(e,o)=>i(e,"name",{value:o,configurable:!0});import{h as l,C as p}from"./bin.js";var f=Object.defineProperty,d=n((e,o)=>f(e,"name",{value:o,configurable:!0}),"n");const u=d(async({logger:e,options:o,visConfig:a,workspaceRoot:r})=>{const c=r??process.cwd(),t=l(c,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),s=p(t,o.check||!1,c,e);s!==0&&(process.exitCode=s)},"execute");export{u as default};
@@ -1 +1 @@
1
- var d=Object.defineProperty;var i=(e,s)=>d(e,"name",{value:s,configurable:!0});import{h as f,k as u}from"./bin.js";var v=Object.defineProperty,h=i((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const x=h(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:t})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[g,...l]=o,c=t??process.cwd(),p=f(c,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),k=a.package?Array.isArray(a.package)?a.package:[a.package]:[],n=u(p,{additionalPackages:k,args:l,package:g,shellMode:a.shellMode||!1,silent:a.silent||!1},c,s);n!==0&&(process.exitCode=n)},"execute");export{x as default};
1
+ var d=Object.defineProperty;var n=(e,s)=>d(e,"name",{value:s,configurable:!0});import{h as f,i as u}from"./bin.js";var v=Object.defineProperty,h=n((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const w=h(async({argument:e,logger:s,options:a,visConfig:r,workspaceRoot:t})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[g,...l]=o,c=t??process.cwd(),p=f(c,{configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),k=a.package?Array.isArray(a.package)?a.package:[a.package]:[],i=u(p,{additionalPackages:k,args:l,package:g,shellMode:a.shellMode||!1,silent:a.silent||!1},c,s);i!==0&&(process.exitCode=i)},"execute");export{w as default};
@@ -1,9 +1,9 @@
1
- var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"../packem_shared/otel-CO8UEfTa.js";import{d as D,P as K,R as S,w as j,p as V}from"./heal.js";import{A as q,a3 as Y,p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:u}=n;if(u!=="ERR_MODULE_NOT_FOUND"&&u!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
1
+ var H=Object.defineProperty;var I=(e,t)=>H(e,"name",{value:t,configurable:!0});import{createRequire as U}from"node:module";import{C as O,z as F}from"./config.js";import{d as j,P as D,R as K,w as S,p as V}from"./heal.js";import{A as q,ab as Y,p as a}from"./bin.js";const P=U(import.meta.url),T=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=I(e=>{if(typeof T<"u"&&T.versions&&T.versions.node){const[t,o]=T.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return T.getBuiltinModule(e)}return P(e)},"__cjs_getBuiltinModule"),{readFile:B}=A("node:fs/promises"),{createInterface:M}=A("node:readline");var J=Object.defineProperty,k=I((e,t)=>J(e,"name",{value:t,configurable:!0}),"o");const z=k(()=>!!process.stdout.isTTY&&process.env.CI!=="true","isInteractive"),W=k(e=>new Promise(t=>{const o=M({input:process.stdin,output:process.stderr});o.question(`${e} (Y/n) `,i=>{o.close();const s=i.trim().toLowerCase();t(s===""||s==="y"||s==="yes")})}),"defaultPrompt"),X=k((e,t)=>{const o=q(t),i=Y(o,{exact:!1,filter:[],global:!1,optional:!1,packages:[e],peer:!1,saveDev:!1,workspace:!1,workspaceRoot:!1},t,console);return Promise.resolve({exitCode:i})},"defaultRunInstall"),y=k(e=>`pnpm add ${e}`,"installCommandFor"),Q=k(e=>e==="@gitbeaker/rest"?import("@gitbeaker/rest"):import("@octokit/rest"),"defaultImport"),L=k(async(e,t={})=>{const o=t.interactive??z(),i=t.prompt??W,s=t.runInstall??X,l=t.importImpl??Q,d=t.workspaceRoot??process.cwd();try{return await l(e)}catch(n){const{code:u}=n;if(u!=="ERR_MODULE_NOT_FOUND"&&u!=="MODULE_NOT_FOUND")throw n}if(!o)throw new Error(`${e} is not installed. \`vis ai heal accept\` needs it to talk to the host. Install it in your repo first:
2
2
  ${y(e)}`);if(!await i(`${e} isn't installed. Install it now?`))throw new Error(`${e} install declined. Re-run \`vis ai heal accept\` after installing manually:
3
3
  ${y(e)}`);const r=await s(e,d);if(r.exitCode!==0)throw new Error(`Install of ${e} failed (exit ${String(r.exitCode)}). Install manually and retry:
4
4
  ${y(e)}`);return await l(e)},"loadOptionalSdk");var Z=Object.defineProperty,_=I((e,t)=>Z(e,"name",{value:t,configurable:!0}),"s");const ee=_(e=>{const t=e.indexOf("/");if(t<=0||t===e.length-1)throw new Error(`Expected GITHUB_REPOSITORY in "owner/repo" form, got: ${e}`);return{owner:e.slice(0,t),repo:e.slice(t+1)}},"splitGithubRepo"),te=_(async(e,t)=>{if(t.githubClient)return t.githubClient;const o=(await(t.loadSdk??L)("@octokit/rest")).Octokit;if(!o)throw new TypeError("Loaded `@octokit/rest` but no `Octokit` export was found. Reinstall the package or pin to a supported major.");return new o({auth:e})},"loadGithubClient"),oe=_(async(e,t,o)=>{if(o.gitlabClient)return o.gitlabClient;const i=(await(o.loadSdk??L)("@gitbeaker/rest")).Gitlab;if(!i)throw new TypeError("Loaded `@gitbeaker/rest` but no `Gitlab` export was found. Reinstall the package or pin to a supported major.");return new i({host:t,token:e})},"loadGitlabClient"),re=_(e=>e.replace(/\/api\/v\d+\/?$/,""),"apiBaseToHost"),ie=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(w=>B(w,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitHub: GITHUB_REPOSITORY (owner/repo) is not set.");if(!o.token)throw new Error("Cannot commit on GitHub: GITHUB_TOKEN is not set. Grant the workflow `contents: write` and pass the token through.");const{owner:r,repo:n}=ee(o.repo),u=await te(o.token,e),p=(await u.rest.git.getRef({owner:r,ref:`heads/${t}`,repo:n})).data.object.sha,h=(await u.rest.git.getCommit({commit_sha:p,owner:r,repo:n})).data.tree.sha,m=await Promise.all(i.map(async w=>{const v=O(l,w),E=await d(v),C=await u.rest.git.createBlob({content:Buffer.from(E,"utf8").toString("base64"),encoding:"base64",owner:r,repo:n});return{mode:"100644",path:w,sha:C.data.sha,type:"blob"}})),f=await u.rest.git.createTree({base_tree:h,owner:r,repo:n,tree:m}),b=await u.rest.git.createCommit({message:s,owner:r,parents:[p],repo:n,tree:f.data.sha});return await u.rest.git.updateRef({owner:r,ref:`heads/${t}`,repo:n,sha:b.data.sha}),{sha:b.data.sha,url:b.data.html_url}},"commitToGithub"),ae=_(async e=>{const{branch:t,ciContext:o,files:i,message:s,workspaceRoot:l}=e,d=e.readFile??(m=>B(m,"utf8"));if(!o.repo)throw new Error("Cannot commit on GitLab: CI_PROJECT_ID / CI_PROJECT_PATH is not set.");if(!o.token)throw new Error("Cannot commit on GitLab: no token. CI_JOB_TOKEN cannot push commits — set GITLAB_TOKEN to a PAT/project-token with `api` scope.");if(!o.apiBaseUrl)throw new Error("Cannot commit on GitLab: CI_API_V4_URL is not set.");const r=re(o.apiBaseUrl),n=await oe(o.token,r,e),u=await Promise.all(i.map(async m=>{const f=O(l,m);return{action:"update",content:await d(f),filePath:m}})),p=await n.Commits.create(o.repo,t,s,u),h=p.id??p.sha;if(!h)throw new Error("GitLab Commits.create returned no commit ID — cannot reference the new commit.");return{sha:h,url:p.web_url??p.webUrl}},"commitToGitlab"),ne=_(async e=>{if(e.files.length===0)throw new Error("Cannot commit: no files to include.");if(e.ciContext.provider==="github-actions")return await ie(e);if(e.ciContext.provider==="gitlab-ci")return await ae(e);throw new Error(`Cannot commit: unsupported CI provider \`${e.ciContext.provider}\`. Run \`vis ai heal accept\` from a recognised CI environment.`)},"commitFiles");var se=Object.defineProperty,g=I((e,t)=>se(e,"name",{value:t,configurable:!0}),"u");const G="/vis heal accept",ce=g(async e=>{if(!e)return;let t;try{t=await B(e,"utf8")}catch{return}const o=JSON.parse(t),i=o.comment?.body??"",s=o.comment?.user?.login??"",l=o.pull_request?.head?.repo?.full_name,d=o.pull_request?.base?.repo?.full_name??o.repository?.full_name,r=l!==void 0&&d!==void 0&&l!==d;return{actor:s,body:i,headRef:o.pull_request?.head?.ref,isFork:r}},"loadGithubTrigger"),le=g(e=>{const t=e.VIS_HEAL_TRIGGER_BODY,o=e.VIS_HEAL_TRIGGER_ACTOR;if(!(!t||!o))return{actor:o,body:t,headRef:e.VIS_HEAL_HEAD_REF,isFork:!1}},"loadGitlabTrigger"),de=g(e=>{const t=e.BUILDKITE_UNBLOCKER_EMAIL??e.BUILDKITE_UNBLOCKER;if(t)return{actor:t,body:G,headRef:e.BUILDKITE_BRANCH,isFork:!1}},"loadBuildkiteTrigger"),ue=g(async(e,t)=>{if(e.provider==="github-actions")return await ce(t.GITHUB_EVENT_PATH);if(e.provider==="gitlab-ci")return le(t);if(e.provider==="buildkite")return de(t)},"loadTrigger"),pe=g((e,t)=>{const o=t.BUILDKITE_REPO;if(!o)return;const i=/(?:^|@|\/\/)github\.com[:/]([^/]+)\/([^/]+?)(?:\.git)?\/?$/i.exec(o);if(i&&t.GITHUB_TOKEN)return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"github-actions",repo:`${i[1]}/${i[2]}`,sha:e.sha,token:t.GITHUB_TOKEN};const s=/\/\/([^/]*gitlab[^/]*)\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),l=s?null:/@([^/:]*gitlab[^/:]*):([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(o),d=s??l;if(d&&t.GITLAB_TOKEN){const r=d[1];return{apiBaseUrl:t.CI_API_V4_URL??`https://${r}/api/v4`,buildId:void 0,buildNumber:void 0,prNumber:e.prNumber,provider:"gitlab-ci",repo:`${d[2]}/${d[3]}`,sha:e.sha,token:t.GITLAB_TOKEN}}},"deriveBuildkiteCommitContext"),me=g(async e=>{const t=e.fetchImpl??globalThis.fetch,o=`${(e.apiBaseUrl??"https://api.github.com").replace(/\/+$/,"")}/repos/${e.repo}/pulls/${String(e.prNumber)}`;try{const i=await t(o,{headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e.token}`,"X-GitHub-Api-Version":"2022-11-28"}});return i.ok?(await i.json()).head?.ref:void 0}catch{return}},"fetchGithubHeadRef"),fe=g((e,t,o,i)=>{const s=t.map(l=>`- \`${l}\``).join(`
5
5
  `);return["## vis ai heal — committed","",`Accepted by @${i}.`,"",`Failing task: \`${o}\``,e.url?`Commit: [\`${e.sha.slice(0,7)}\`](${e.url})`:`Commit: \`${e.sha.slice(0,7)}\``,"","### Files changed",s,"","_Re-run the failing job to confirm the fix landed._"].join(`
6
- `)},"summariseDetail"),he=g(async(e,t={})=>{const{logger:o,visConfig:i,workspaceRoot:s}=e,l=s??process.cwd(),d=t.env??process.env,r=await(t.detectCi??(()=>D(d)))();if(r.provider==="unknown"){a.error("`vis ai heal accept` must run inside a recognised CI provider (GitHub Actions, GitLab CI, or Buildkite)."),process.exitCode=1;return}const n=await ue(r,d);if(!n){const c=r.provider==="github-actions"?"No issue_comment payload found. Trigger this command from a workflow listening for `issue_comment.created`.":r.provider==="gitlab-ci"?"No GitLab trigger payload found. Set VIS_HEAL_TRIGGER_BODY, VIS_HEAL_TRIGGER_ACTOR, and VIS_HEAL_HEAD_REF in the bridge that re-emits note hooks as pipeline runs.":"No Buildkite unblock signal found. Wire this command to run after a manually-unblocked block step so BUILDKITE_UNBLOCKER_EMAIL is set.";a.error(c),process.exitCode=1;return}if(r.provider!=="buildkite"&&!n.body.includes(G)){a.notice(`Trigger comment does not contain \`${G}\`; nothing to do.`);return}const u=i?.ai?.heal?.allowedActors??[];if(u.length===0){a.error("`ai.heal.allowedActors` is empty. Configure the allow-list in `vis.config.*` before enabling auto-commit."),process.exitCode=1;return}if(!n.actor||!u.includes(n.actor)){const c=r.provider==="buildkite"?"Buildkite entries are emails (BUILDKITE_UNBLOCKER_EMAIL) or Buildkite usernames (BUILDKITE_UNBLOCKER), not the upstream GitHub/GitLab username.":r.provider==="gitlab-ci"?"GitLab entries are platform usernames (without the leading `@`).":"GitHub entries are platform usernames (without the leading `@`).";a.error(`Actor \`${n.actor||"(unknown)"}\` is not in \`ai.heal.allowedActors\`. Refusing to commit. ${c}`),process.exitCode=1;return}if(n.isFork){a.error("Refusing to accept: the change is from a forked repository. The CI token does not have write access to the fork."),process.exitCode=1;return}let p=n.headRef;if(!p&&r.provider==="github-actions"&&r.prNumber!==void 0&&r.repo&&r.token&&(p=await me({fetchImpl:t.fetchImpl,prNumber:r.prNumber,repo:r.repo,token:r.token})),!p){a.error("Could not resolve the PR / MR head branch. Ensure the trigger payload includes head.ref or set VIS_HEAL_HEAD_REF."),process.exitCode=1;return}a.info(`Accepting fix on \`${p}\` for actor \`${n.actor}\`.`);const h=await K(l,e.options.run);if(h.outcome==="no-failed-task"){a.error("No failed tasks found in the run summary. The accept command should run on the same workspace as the original failure."),process.exitCode=1;return}if(h.outcome==="missing-metadata"){a.error(`Failed task ${h.failedTask.taskId} is missing project/target metadata; cannot validate the fix.`),process.exitCode=1;return}if(h.outcome==="no-failure-context"){a.error(`No failure log or run summary found for ${h.failedTask.taskId}.`),process.exitCode=1;return}const m=h,f=await S(e,m);if(f.outcome==="no-proposal"){a.error("AI fix proposal failed; cannot commit."),process.exitCode=1;return}if(f.outcome==="cannot-fix"){a.warn(`AI declined to fix: ${f.detail??"(no reason)"}. Nothing to commit.`),process.exitCode=1;return}if(f.outcome==="empty-patches"){a.warn("AI returned an empty patch set. Nothing to commit."),process.exitCode=1;return}if(f.outcome==="no-patches-applied"){a.error("Patches could not be applied to the workspace. Refusing to commit."),process.exitCode=1;return}a.info(`Re-running ${m.failedTask.taskId} to validate the fix before committing...`);const b=await j(e,m,{validate:t.validate});if(b.exitCode!==0){a.error(`Validation failed (exit ${String(b.exitCode)}). Refusing to commit.`),b.stderr.trim().length>0&&(o.info("--- validation stderr (tail) ---"),o.info(b.stderr.split(`
6
+ `)},"summariseDetail"),he=g(async(e,t={})=>{const{logger:o,visConfig:i,workspaceRoot:s}=e,l=s??process.cwd(),d=t.env??process.env,r=await(t.detectCi??(()=>j(d)))();if(r.provider==="unknown"){a.error("`vis ai heal accept` must run inside a recognised CI provider (GitHub Actions, GitLab CI, or Buildkite)."),process.exitCode=1;return}const n=await ue(r,d);if(!n){const c=r.provider==="github-actions"?"No issue_comment payload found. Trigger this command from a workflow listening for `issue_comment.created`.":r.provider==="gitlab-ci"?"No GitLab trigger payload found. Set VIS_HEAL_TRIGGER_BODY, VIS_HEAL_TRIGGER_ACTOR, and VIS_HEAL_HEAD_REF in the bridge that re-emits note hooks as pipeline runs.":"No Buildkite unblock signal found. Wire this command to run after a manually-unblocked block step so BUILDKITE_UNBLOCKER_EMAIL is set.";a.error(c),process.exitCode=1;return}if(r.provider!=="buildkite"&&!n.body.includes(G)){a.notice(`Trigger comment does not contain \`${G}\`; nothing to do.`);return}const u=i?.ai?.heal?.allowedActors??[];if(u.length===0){a.error("`ai.heal.allowedActors` is empty. Configure the allow-list in `vis.config.*` before enabling auto-commit."),process.exitCode=1;return}if(!n.actor||!u.includes(n.actor)){const c=r.provider==="buildkite"?"Buildkite entries are emails (BUILDKITE_UNBLOCKER_EMAIL) or Buildkite usernames (BUILDKITE_UNBLOCKER), not the upstream GitHub/GitLab username.":r.provider==="gitlab-ci"?"GitLab entries are platform usernames (without the leading `@`).":"GitHub entries are platform usernames (without the leading `@`).";a.error(`Actor \`${n.actor||"(unknown)"}\` is not in \`ai.heal.allowedActors\`. Refusing to commit. ${c}`),process.exitCode=1;return}if(n.isFork){a.error("Refusing to accept: the change is from a forked repository. The CI token does not have write access to the fork."),process.exitCode=1;return}let p=n.headRef;if(!p&&r.provider==="github-actions"&&r.prNumber!==void 0&&r.repo&&r.token&&(p=await me({fetchImpl:t.fetchImpl,prNumber:r.prNumber,repo:r.repo,token:r.token})),!p){a.error("Could not resolve the PR / MR head branch. Ensure the trigger payload includes head.ref or set VIS_HEAL_HEAD_REF."),process.exitCode=1;return}a.info(`Accepting fix on \`${p}\` for actor \`${n.actor}\`.`);const h=await D(l,e.options.run);if(h.outcome==="no-failed-task"){a.error("No failed tasks found in the run summary. The accept command should run on the same workspace as the original failure."),process.exitCode=1;return}if(h.outcome==="missing-metadata"){a.error(`Failed task ${h.failedTask.taskId} is missing project/target metadata; cannot validate the fix.`),process.exitCode=1;return}if(h.outcome==="no-failure-context"){a.error(`No failure log or run summary found for ${h.failedTask.taskId}.`),process.exitCode=1;return}const m=h,f=await K(e,m);if(f.outcome==="no-proposal"){a.error("AI fix proposal failed; cannot commit."),process.exitCode=1;return}if(f.outcome==="cannot-fix"){a.warn(`AI declined to fix: ${f.detail??"(no reason)"}. Nothing to commit.`),process.exitCode=1;return}if(f.outcome==="empty-patches"){a.warn("AI returned an empty patch set. Nothing to commit."),process.exitCode=1;return}if(f.outcome==="no-patches-applied"){a.error("Patches could not be applied to the workspace. Refusing to commit."),process.exitCode=1;return}a.info(`Re-running ${m.failedTask.taskId} to validate the fix before committing...`);const b=await S(e,m,{validate:t.validate});if(b.exitCode!==0){a.error(`Validation failed (exit ${String(b.exitCode)}). Refusing to commit.`),b.stderr.trim().length>0&&(o.info("--- validation stderr (tail) ---"),o.info(b.stderr.split(`
7
7
  `).slice(-20).join(`
8
8
  `))),process.exitCode=1;return}a.success("Validation passed. Committing.");const w=(f.applyResults??[]).filter(c=>c.status==="applied").map(c=>{const $=c.absolutePath??c.patch.file,x=F(l,$);return x===""||x.startsWith("..")?c.patch.file:x});if(w.length===0){a.error("No applied files to commit. Aborting."),process.exitCode=1;return}const v=[`fix: vis ai heal accepted by @${n.actor}`,"",`Failing task: ${m.failedTask.taskId}`,f.proposal?.explanation?`
9
9
  ${f.proposal.explanation}`:"","","Auto-committed by `vis ai heal accept`."].join(`
@@ -1,4 +1,4 @@
1
- var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,d as G,c as j,p as u,e as F}from"./bin.js";import{z as D}from"../packem_shared/otel-CO8UEfTa.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-iHtGLkJS.js";import{r as q}from"../packem_shared/run-summary-utils-BPraMTcm.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
1
+ var U=Object.defineProperty;var I=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createRequire as A}from"node:module";import{j as O,E as v,d as G,c as j,p as u,e as F}from"./bin.js";import{z as D}from"./config.js";import{readLastRunSummary as K}from"@visulima/task-runner";import{r as H,a as M,b as V,c as z}from"../packem_shared/ai-fix-CWOz12Om.js";import{r as q}from"../packem_shared/run-summary-utils-CJv75pla.js";const L=A(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=I(t=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[e,o]=b.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return b.getBuiltinModule(t)}return L(t)},"__cjs_getBuiltinModule"),{spawn:k}=T("node:child_process"),{readFile:J}=T("node:fs/promises");var Q=Object.defineProperty,g=I((t,e)=>Q(t,"name",{value:e,configurable:!0}),"i");const W=g(t=>{if(!t)return;const e=/^refs\/pull\/(\d+)\//.exec(t);return e?Number.parseInt(e[1],10):void 0},"parsePrNumberFromGithubRef"),Y=g(async t=>{if(!t)return{prNumber:void 0,sha:void 0};try{const e=await J(t,"utf8"),o=JSON.parse(e),r=o.pull_request?.number??o.issue?.number??o.number,i=o.pull_request?.head?.sha;return{prNumber:r,sha:i}}catch{return{prNumber:void 0,sha:void 0}}},"readPrNumberFromGithubEvent"),Z=g(async t=>{const e=W(t.GITHUB_REF),{prNumber:o,sha:r}=e===void 0?await Y(t.GITHUB_EVENT_PATH):{prNumber:e,sha:void 0};return{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:e??o,provider:"github-actions",repo:t.GITHUB_REPOSITORY,sha:r??t.GITHUB_SHA,token:t.GITHUB_TOKEN}},"detectGithubActions"),X=g(t=>{const e=t.CI_MERGE_REQUEST_IID,o=e!==void 0&&e!==""?Number.parseInt(e,10):void 0,r=t.CI_API_V4_URL,i=t.GITLAB_TOKEN??t.CI_TOKEN;return{apiBaseUrl:r,buildId:void 0,buildNumber:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"gitlab-ci",repo:t.CI_PROJECT_ID??t.CI_PROJECT_PATH,sha:t.CI_COMMIT_SHA,token:i}},"detectGitlabCi"),ee=g(t=>{const e=t.BUILDKITE_PULL_REQUEST,o=e!==void 0&&e!==""&&e!=="false"?Number.parseInt(e,10):void 0,r=t.BUILDKITE_BUILD_NUMBER,i=r!==void 0&&r!==""?Number.parseInt(r,10):void 0,n=t.BUILDKITE_ORGANIZATION_SLUG,a=t.BUILDKITE_PIPELINE_SLUG,s=n!==void 0&&n!==""&&a!==void 0&&a!==""?`${n}/${a}`:void 0;return{apiBaseUrl:(t.BUILDKITE_API_BASE_URL??"https://api.buildkite.com").replace(/\/+$/,""),buildId:t.BUILDKITE_BUILD_ID,buildNumber:Number.isFinite(i)?i:void 0,prNumber:Number.isFinite(o)?o:void 0,provider:"buildkite",repo:s,sha:t.BUILDKITE_COMMIT,token:t.BUILDKITE_API_TOKEN}},"detectBuildkite"),te=g(async(t=process.env)=>t.GITHUB_ACTIONS==="true"?await Z(t):t.GITLAB_CI==="true"?X(t):t.BUILDKITE==="true"?ee(t):{apiBaseUrl:void 0,buildId:void 0,buildNumber:void 0,prNumber:void 0,provider:"unknown",repo:void 0,sha:void 0,token:void 0},"detectCiContext");var oe=Object.defineProperty,h=I((t,e)=>oe(t,"name",{value:e,configurable:!0}),"p");const re=h((t,e,o,r)=>new Promise(i=>{const n=["pr","comment",String(e),"--body-file","-"];r&&n.push("--repo",r);const a=k(t,n,{stdio:["pipe","ignore","pipe"]});let s="";a.stderr?.setEncoding("utf8"),a.stderr?.on("data",d=>{s+=d}),a.once("error",()=>{i({exitCode:127,stderr:s})}),a.once("close",d=>{i({exitCode:d??-1,stderr:s})}),a.stdin?.on("error",()=>{}),a.stdin?.end(o)}),"runGhComment"),ie=h(async(t,e,o,r,i)=>{const n=`https://api.github.com/repos/${e}/issues/${String(o)}/comments`;try{const a=await t(n,{body:JSON.stringify({body:r}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${i}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"},method:"POST"});if(!a.ok){const s=await a.text().catch(()=>"");return{error:`GitHub REST returned ${String(a.status)}: ${s.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(a){return{error:a instanceof Error?a.message:String(a),ok:!1}}},"postViaGithubRest"),ne=h(async(t,e,o,r,i,n)=>{const a=encodeURIComponent(o),s=`${e.replace(/\/+$/,"")}/projects/${a}/merge_requests/${String(r)}/notes`;try{const d=await t(s,{body:JSON.stringify({body:i}),headers:{"Content-Type":"application/json","PRIVATE-TOKEN":n},method:"POST"});if(!d.ok){const p=await d.text().catch(()=>"");return{error:`GitLab REST returned ${String(d.status)}: ${p.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(d){return{error:d instanceof Error?d.message:String(d),ok:!1}}},"postViaGitlabRest"),ae=h((t,e,o,r)=>new Promise(i=>{const n=k(t,["annotate","--style",o,"--context",r],{stdio:["pipe","ignore","pipe"]});let a="";n.stderr?.setEncoding("utf8"),n.stderr?.on("data",s=>{a+=s}),n.once("error",()=>{i({exitCode:127,stderr:a})}),n.once("close",s=>{i({exitCode:s??-1,stderr:a})}),n.stdin?.on("error",()=>{}),n.stdin?.end(e)}),"runBuildkiteAnnotate"),se=h(async(t,e,o,r,i,n,a,s)=>{const[d,p]=o.split("/",2);if(!d||!p)return{error:`Buildkite repo identifier \`${o}\` is not in {org}/{pipeline} form.`,ok:!1};const m=`${e}/v2/organizations/${encodeURIComponent(d)}/pipelines/${encodeURIComponent(p)}/builds/${String(r)}/annotations`;try{const c=await t(m,{body:JSON.stringify({body:i,context:a,style:n}),headers:{Authorization:`Bearer ${s}`,"Content-Type":"application/json"},method:"POST"});if(!c.ok){const l=await c.text().catch(()=>"");return{error:`Buildkite REST returned ${String(c.status)}: ${l.slice(0,500)}`,ok:!1}}return{ok:!0}}catch(c){return{error:c instanceof Error?c.message:String(c),ok:!1}}},"postViaBuildkiteRest"),de=h(async(t,e,o,r)=>{const i=e.buildId?`vis-ai-heal-${e.buildId}`:"vis-ai-heal",n="info",a=await ae(o,t,n,i);if(a.exitCode===0)return{method:"buildkite-cli",posted:!0};if(!e.apiBaseUrl||!e.repo||e.buildNumber===void 0||!e.token){const d=[];return e.repo||d.push("BUILDKITE_ORGANIZATION_SLUG / BUILDKITE_PIPELINE_SLUG"),e.buildNumber===void 0&&d.push("BUILDKITE_BUILD_NUMBER"),e.token||d.push("BUILDKITE_API_TOKEN (with `write_build_annotations` scope)"),{error:`buildkite-agent annotate exited ${String(a.exitCode)} (${a.stderr.trim().slice(0,200)}); cannot fall back to REST without ${d.join(", ")}`,method:"buildkite-cli",posted:!1}}const s=await se(r,e.apiBaseUrl,e.repo,e.buildNumber,t,n,i,e.token);return s.ok?{method:"rest",posted:!0}:{error:`buildkite-agent annotate exited ${String(a.exitCode)}; REST fallback also failed: ${s.error??"unknown"}`,method:"rest",posted:!1}},"postBuildkiteAnnotation"),pe=h(async(t,e,o,r)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};const i=await re(o,e.prNumber,t,e.repo);if(i.exitCode===0)return{method:"gh-cli",posted:!0};if(!e.repo||!e.token)return{error:`gh exited ${String(i.exitCode)} (${i.stderr.trim().slice(0,200)}); cannot fall back to REST without GITHUB_REPOSITORY + GITHUB_TOKEN`,method:"gh-cli",posted:!1};const n=await ie(r,e.repo,e.prNumber,t,e.token);return n.ok?{method:"rest",posted:!0}:{error:`gh exited ${String(i.exitCode)}; REST fallback also failed: ${n.error??"unknown"}`,method:"rest",posted:!1}},"postGithubComment"),ce=h(async(t,e,o)=>{if(e.prNumber===void 0)return{method:"skipped",posted:!1};if(!e.apiBaseUrl||!e.repo)return{error:"GitLab CI context is missing CI_API_V4_URL or CI_PROJECT_ID; cannot post note.",method:"rest",posted:!1};if(!e.token)return{error:"GitLab CI context has no token. CI_JOB_TOKEN cannot post MR notes — set GITLAB_TOKEN to a personal/project access token with `api` scope.",method:"rest",posted:!1};const r=await ne(o,e.apiBaseUrl,e.repo,e.prNumber,t,e.token);return r.ok?{method:"rest",posted:!0}:{error:r.error,method:"rest",posted:!1}},"postGitlabComment"),ue=h(async t=>{const{body:e,buildkiteAgentBin:o="buildkite-agent",context:r,fetchImpl:i=globalThis.fetch,ghBin:n="gh"}=t;return r.provider==="github-actions"?await pe(e,r,n,i):r.provider==="gitlab-ci"?await ce(e,r,i):r.provider==="buildkite"?await de(e,r,o,i):{method:"skipped",posted:!1}},"postPrComment");var le=Object.defineProperty,f=I((t,e)=>le(t,"name",{value:e,configurable:!0}),"l");const C=f(t=>{let e=0,o=0;for(const r of t)r.status==="applied"?e+=1:o+=1;return{applied:e,failed:o}},"summarizeApply"),_=f((t,e,o)=>{const r=H(t,e,o),i=D(t,r);return i===""||i.startsWith("..")?r:i},"formatDisplayPath"),fe=f((t,e,o,r)=>new Promise(i=>{const n=process.argv[1];if(!n){i({exitCode:-1,stderr:"Cannot locate vis bin (process.argv[1] missing).",stdout:""});return}const a=[n,"run",o,"--projects",e,"--no-cache","--summarize","--fail-fast"],s=k(process.execPath,a,{cwd:t,env:{...process.env,NO_COLOR:"1"},stdio:["ignore","pipe","pipe"]});let d="",p="";const m=setTimeout(()=>{s.kill("SIGTERM"),setTimeout(()=>s.kill("SIGKILL"),2e3).unref()},r);s.stdout?.setEncoding("utf8"),s.stdout?.on("data",c=>{d+=c}),s.stderr?.setEncoding("utf8"),s.stderr?.on("data",c=>{p+=c}),s.once("error",c=>{clearTimeout(m),i({exitCode:-1,stderr:c.message,stdout:d})}),s.once("close",c=>{clearTimeout(m),i({exitCode:c??-1,stderr:p,stdout:d})})}),"validateFixByRerun"),me=6e4,y=f(t=>{let e=0;const o=t.match(/`{3,}/g);if(o)for(const r of o)e=Math.max(e,r.length);return"`".repeat(Math.max(3,e+1))},"pickFence"),$=f((t,e,o)=>{if(t.patches.length===0)return"_No patches proposed._";const r=[];for(const[i,n]of t.patches.entries()){const a=_(e,o,n.file),s=[`**[${String(i+1)}] \`${a}\`**`];n.reason&&s.push(`_${n.reason}_`);const d=y(`${n.oldString}
2
2
  ${n.newString}`);s.push(`${d}diff`);for(const p of n.oldString.split(`
3
3
  `))s.push(`- ${p}`);for(const p of n.newString.split(`
4
4
  `))s.push(`+ ${p}`);s.push(d),r.push(s.join(`