langchain-stripe-loader 0.0.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +54 -12
- package/dist/index.cjs +482 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +139 -0
- package/dist/index.d.ts +139 -3
- package/dist/index.js +457 -0
- package/dist/index.js.map +1 -0
- package/package.json +28 -22
- package/dist/StripeComLoader.d.ts +0 -44
- package/dist/StripeComLoader.d.ts.map +0 -1
- package/dist/StripeDocsLoader.d.ts +0 -28
- package/dist/StripeDocsLoader.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.spec.d.ts +0 -2
- package/dist/index.spec.d.ts.map +0 -1
- package/dist/langchain-stripe-loader.cjs +0 -62
- package/dist/langchain-stripe-loader.cjs.map +0 -1
- package/dist/langchain-stripe-loader.js +0 -2671
- package/dist/langchain-stripe-loader.js.map +0 -1
- package/dist/utils.d.ts +0 -13
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.spec.d.ts +0 -2
- package/dist/utils.spec.d.ts.map +0 -1
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { BaseDocumentLoader } from '@langchain/core/document_loaders/base';
|
|
2
|
-
import { Document } from '@langchain/core/documents';
|
|
3
|
-
/**
|
|
4
|
-
* Document loader for Stripe Docs website content
|
|
5
|
-
* Extracts content from docs.stripe.com pages and converts it to LangChain documents
|
|
6
|
-
*/
|
|
7
|
-
export declare class StripeDocsDocumentLoader extends BaseDocumentLoader {
|
|
8
|
-
private readonly debug;
|
|
9
|
-
constructor(debug?: boolean);
|
|
10
|
-
/**
|
|
11
|
-
* Fetches URLs from the Stripe Docs sitemap
|
|
12
|
-
* @returns {Promise<string[]>} Array of URLs from the sitemap
|
|
13
|
-
*/
|
|
14
|
-
protected fetchURLsFromSitemap(): Promise<string[]>;
|
|
15
|
-
/**
|
|
16
|
-
* Fetches articles from the sitemap
|
|
17
|
-
* @param {string} locale Locale for the content
|
|
18
|
-
* @returns {Promise<StripeDocsArticle[]>} Array of article objects
|
|
19
|
-
*/
|
|
20
|
-
private fetchArticlesFromSitemap;
|
|
21
|
-
/**
|
|
22
|
-
* Loads documents from Stripe Docs
|
|
23
|
-
* @param {string} locale Locale for the content (defaults to 'en-US')
|
|
24
|
-
* @returns {Promise<Document[]>} Array of LangChain documents
|
|
25
|
-
*/
|
|
26
|
-
load(locale?: string): Promise<Document[]>;
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=StripeDocsLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StripeDocsLoader.d.ts","sourceRoot":"","sources":["../src/StripeDocsLoader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAarD;;;GAGG;AACH,qBAAa,wBAAyB,SAAQ,kBAAkB;IAClD,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,GAAE,OAAe;IAGnD;;;OAGG;cACa,oBAAoB;IAOpC;;;;OAIG;YACW,wBAAwB;IAiBtC;;;;OAIG;IACG,IAAI,CAAC,MAAM,GAAE,MAAgB,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;CAgB1D"}
|
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.spec.d.ts
DELETED
package/dist/index.spec.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.spec.d.ts","sourceRoot":"","sources":["../src/index.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class Ft{constructor(r=!1){this.debug=r}log(r){this.debug&&console.log(r)}error(r){console.error(r)}warn(r){this.debug&&console.warn(r)}}class wt{constructor(r={}){this.debug=r.debug??!1,this.logger=r.logger??new Ft(this.debug)}log(r){this.logger.log(r)}logError(r){this.logger.error(r)}logWarning(r){this.logger.warn(r)}extractUrlsFromSitemap(r,t="https://docs.stripe.com/"){const n=new RegExp(`<loc>(${t}[^<]+)</loc>`,"g"),a=[];let l;for(;(l=n.exec(r))!==null;)a.push(l[1]);return a}extractSitemapUrlsFromIndex(r){if(!r||typeof r!="string")return this.logError("Invalid input: content must be a string"),[];if(!r.includes("<?xml")||!r.includes("<sitemapindex"))return this.logError("Invalid sitemap index XML: Missing <?xml or <sitemapindex> elements."),[];try{const t=/<loc>([^<]+)<\/loc>/g,n=[];let a;for(;(a=t.exec(r))!==null;){const l=a[1];try{new URL(l),n.push(l)}catch{this.logWarning(`Skipped invalid URL format: ${l}`)}}return n.length===0&&this.logWarning("No valid URLs found in sitemap index"),n}catch(t){return this.logError(`Error extracting URLs from sitemap index: ${t}`),[]}}findNewUrls(r,t){const n=new Set(t);return r.filter(a=>!n.has(a))}async fetchAndProcessSitemap(r,t){const n=await fetch(r);if(!n.ok)throw new Error(`Failed to fetch sitemap: ${n.status} ${n.statusText}`);const a=await n.text();return this.extractUrlsFromSitemap(a,t)}async fetchAndProcessSitemapIndex(r,t){this.log(`Fetching sitemap index: ${r}`);const n=await fetch(r);if(!n.ok)throw new Error(`Failed to fetch sitemap index: ${n.status} ${n.statusText}`);const a=await n.text(),l=this.extractSitemapUrlsFromIndex(a);this.log(`Number of sitemap partitions: ${l.length}`);const u=[];for(let o=0;o<l.length;o++){const s=l[o];this.log(`Processing partition ${o+1}/${l.length}: ${s}`);const h=await this.fetchAndProcessSitemap(s,t);this.log(`Retrieved ${h.length} URLs from partition ${o+1}`),u.push(...h)}return u}}class $t{async loadAndSplit(r){if(r===void 0)throw new Error("You must pass a text splitter to use this method.");const t=await this.load();return r.invoke(t)}}class Tt{constructor(r){Object.defineProperty(this,"pageContent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.pageContent=r.pageContent!==void 0?r.pageContent.toString():"",this.metadata=r.metadata??{},this.id=r.id}}function Ut(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var V={exports:{}},ce={},fe,gr;function Bt(){if(gr)return fe;gr=1;function e(r,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return fe=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var t=new Date().getTime();if(r&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(r,t){this._fn=r,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)},e.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},t=null,n=0,a=0;a<this._errors.length;a++){var l=this._errors[a],u=l.message,o=(r[u]||0)+1;r[u]=o,o>=n&&(t=l,n=o)}return t},fe}var Rr;function kt(){return Rr||(Rr=1,function(e){var r=Bt();e.operation=function(t){var n=e.timeouts(t);return new r(n,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},e.timeouts=function(t){if(t instanceof Array)return[].concat(t);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var a in t)n[a]=t[a];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var l=[],u=0;u<n.retries;u++)l.push(this.createTimeout(u,n));return t&&t.forever&&!l.length&&l.push(this.createTimeout(u,n)),l.sort(function(o,s){return o-s}),l},e.createTimeout=function(t,n){var a=n.randomize?Math.random()+1:1,l=Math.round(a*Math.max(n.minTimeout,1)*Math.pow(n.factor,t));return l=Math.min(l,n.maxTimeout),l},e.wrap=function(t,n,a){if(n instanceof Array&&(a=n,n=null),!a){a=[];for(var l in t)typeof t[l]=="function"&&a.push(l)}for(var u=0;u<a.length;u++){var o=a[u],s=t[o];t[o]=(function(i){var f=e.operation(n),c=Array.prototype.slice.call(arguments,1),p=c.pop();c.push(function(d){f.retry(d)||(d&&(arguments[0]=f.mainError()),p.apply(this,arguments))}),f.attempt(function(){i.apply(t,c)})}).bind(t,s),t[o].options=n}}}(ce)),ce}var he,yr;function Gt(){return yr||(yr=1,he=kt()),he}var _r;function Mt(){if(_r)return V.exports;_r=1;const e=Gt(),r=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class t extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const n=(u,o,s)=>{const h=s.retries-(o-1);return u.attemptNumber=o,u.retriesLeft=h,u},a=u=>r.includes(u),l=(u,o)=>new Promise((s,h)=>{o={onFailedAttempt:()=>{},retries:10,...o};const i=e.operation(o);i.attempt(async f=>{try{s(await u(f))}catch(c){if(!(c instanceof Error)){h(new TypeError(`Non-error was thrown: "${c}". You should only throw errors.`));return}if(c instanceof t)i.stop(),h(c.originalError);else if(c instanceof TypeError&&!a(c.message))i.stop(),h(c);else{n(c,f,o);try{await o.onFailedAttempt(c)}catch(p){h(p);return}i.retry(c)||h(i.mainError())}}})});return V.exports=l,V.exports.default=l,V.exports.AbortError=t,V.exports}Mt();var z={},pe={exports:{}},Ir;function jt(){return Ir||(Ir=1,function(e){var r=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function a(s,h,i){this.fn=s,this.context=h,this.once=i||!1}function l(s,h,i,f,c){if(typeof i!="function")throw new TypeError("The listener must be a function");var p=new a(i,f||s,c),d=t?t+h:h;return s._events[d]?s._events[d].fn?s._events[d]=[s._events[d],p]:s._events[d].push(p):(s._events[d]=p,s._eventsCount++),s}function u(s,h){--s._eventsCount===0?s._events=new n:delete s._events[h]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var h=[],i,f;if(this._eventsCount===0)return h;for(f in i=this._events)r.call(i,f)&&h.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(i)):h},o.prototype.listeners=function(h){var i=t?t+h:h,f=this._events[i];if(!f)return[];if(f.fn)return[f.fn];for(var c=0,p=f.length,d=new Array(p);c<p;c++)d[c]=f[c].fn;return d},o.prototype.listenerCount=function(h){var i=t?t+h:h,f=this._events[i];return f?f.fn?1:f.length:0},o.prototype.emit=function(h,i,f,c,p,d){var m=t?t+h:h;if(!this._events[m])return!1;var E=this._events[m],y=arguments.length,L,R;if(E.fn){switch(E.once&&this.removeListener(h,E.fn,void 0,!0),y){case 1:return E.fn.call(E.context),!0;case 2:return E.fn.call(E.context,i),!0;case 3:return E.fn.call(E.context,i,f),!0;case 4:return E.fn.call(E.context,i,f,c),!0;case 5:return E.fn.call(E.context,i,f,c,p),!0;case 6:return E.fn.call(E.context,i,f,c,p,d),!0}for(R=1,L=new Array(y-1);R<y;R++)L[R-1]=arguments[R];E.fn.apply(E.context,L)}else{var q=E.length,b;for(R=0;R<q;R++)switch(E[R].once&&this.removeListener(h,E[R].fn,void 0,!0),y){case 1:E[R].fn.call(E[R].context);break;case 2:E[R].fn.call(E[R].context,i);break;case 3:E[R].fn.call(E[R].context,i,f);break;case 4:E[R].fn.call(E[R].context,i,f,c);break;default:if(!L)for(b=1,L=new Array(y-1);b<y;b++)L[b-1]=arguments[b];E[R].fn.apply(E[R].context,L)}}return!0},o.prototype.on=function(h,i,f){return l(this,h,i,f,!1)},o.prototype.once=function(h,i,f){return l(this,h,i,f,!0)},o.prototype.removeListener=function(h,i,f,c){var p=t?t+h:h;if(!this._events[p])return this;if(!i)return u(this,p),this;var d=this._events[p];if(d.fn)d.fn===i&&(!c||d.once)&&(!f||d.context===f)&&u(this,p);else{for(var m=0,E=[],y=d.length;m<y;m++)(d[m].fn!==i||c&&!d[m].once||f&&d[m].context!==f)&&E.push(d[m]);E.length?this._events[p]=E.length===1?E[0]:E:u(this,p)}return this},o.prototype.removeAllListeners=function(h){var i;return h?(i=t?t+h:h,this._events[i]&&u(this,i)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=t,o.EventEmitter=o,e.exports=o}(pe)),pe.exports}var X={exports:{}},me,wr;function Vt(){return wr||(wr=1,me=(e,r)=>(r=r||(()=>{}),e.then(t=>new Promise(n=>{n(r())}).then(()=>t),t=>new Promise(n=>{n(r())}).then(()=>{throw t})))),me}var $r;function Xt(){if($r)return X.exports;$r=1;const e=Vt();class r extends Error{constructor(a){super(a),this.name="TimeoutError"}}const t=(n,a,l)=>new Promise((u,o)=>{if(typeof a!="number"||a<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(a===1/0){u(n);return}const s=setTimeout(()=>{if(typeof l=="function"){try{u(l())}catch(f){o(f)}return}const h=typeof l=="string"?l:`Promise timed out after ${a} milliseconds`,i=l instanceof Error?l:new r(h);typeof n.cancel=="function"&&n.cancel(),o(i)},a);e(n.then(u,o),()=>{clearTimeout(s)})});return X.exports=t,X.exports.default=t,X.exports.TimeoutError=r,X.exports}var Y={},Q={},Tr;function Ht(){if(Tr)return Q;Tr=1,Object.defineProperty(Q,"__esModule",{value:!0});function e(r,t,n){let a=0,l=r.length;for(;l>0;){const u=l/2|0;let o=a+u;n(r[o],t)<=0?(a=++o,l-=u+1):l=u}return a}return Q.default=e,Q}var Ar;function Wt(){if(Ar)return Y;Ar=1,Object.defineProperty(Y,"__esModule",{value:!0});const e=Ht();class r{constructor(){this._queue=[]}enqueue(n,a){a=Object.assign({priority:0},a);const l={priority:a.priority,run:n};if(this.size&&this._queue[this.size-1].priority>=a.priority){this._queue.push(l);return}const u=e.default(this._queue,l,(o,s)=>s.priority-o.priority);this._queue.splice(u,0,l)}dequeue(){const n=this._queue.shift();return n==null?void 0:n.run}filter(n){return this._queue.filter(a=>a.priority===n.priority).map(a=>a.run)}get size(){return this._queue.length}}return Y.default=r,Y}var Sr;function zt(){if(Sr)return z;Sr=1,Object.defineProperty(z,"__esModule",{value:!0});const e=jt(),r=Xt(),t=Wt(),n=()=>{},a=new r.TimeoutError;class l extends e{constructor(o){var s,h,i,f;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=n,this._resolveIdle=n,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:t.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(h=(s=o.intervalCap)===null||s===void 0?void 0:s.toString())!==null&&h!==void 0?h:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(f=(i=o.interval)===null||i===void 0?void 0:i.toString())!==null&&f!==void 0?f:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=n,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=n,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const o=Date.now();if(this._intervalId===void 0){const s=this._intervalEnd-o;if(s<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},s)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const s=this._queue.dequeue();return s?(this.emit("active"),s(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,s={}){return new Promise((h,i)=>{const f=async()=>{this._pendingCount++,this._intervalCount++;try{const c=this._timeout===void 0&&s.timeout===void 0?o():r.default(Promise.resolve(o()),s.timeout===void 0?this._timeout:s.timeout,()=>{(s.throwOnTimeout===void 0?this._throwOnTimeout:s.throwOnTimeout)&&i(a)});h(await c)}catch(c){i(c)}this._next()};this._queue.enqueue(f,s),this._tryToStartAnother(),this.emit("add")})}async addAll(o,s){return Promise.all(o.map(async h=>this.add(h,s)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{const s=this._resolveEmpty;this._resolveEmpty=()=>{s(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{const s=this._resolveIdle;this._resolveIdle=()=>{s(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return z.default=l,z}zt();var K={exports:{}},de,Lr;function re(){if(Lr)return de;Lr=1;const e="2.0.0",r=256,t=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,a=r-6;return de={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:a,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},de}var Ee,Nr;function te(){return Nr||(Nr=1,Ee=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{}),Ee}var Cr;function W(){return Cr||(Cr=1,function(e,r){const{MAX_SAFE_COMPONENT_LENGTH:t,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:a}=re(),l=te();r=e.exports={};const u=r.re=[],o=r.safeRe=[],s=r.src=[],h=r.safeSrc=[],i=r.t={};let f=0;const c="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",a],[c,n]],d=E=>{for(const[y,L]of p)E=E.split(`${y}*`).join(`${y}{0,${L}}`).split(`${y}+`).join(`${y}{1,${L}}`);return E},m=(E,y,L)=>{const R=d(y),q=f++;l(E,q,y),i[E]=q,s[q]=y,h[q]=R,u[q]=new RegExp(y,L?"g":void 0),o[q]=new RegExp(R,L?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${c}*`),m("MAINVERSION",`(${s[i.NUMERICIDENTIFIER]})\\.(${s[i.NUMERICIDENTIFIER]})\\.(${s[i.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${s[i.NUMERICIDENTIFIERLOOSE]})\\.(${s[i.NUMERICIDENTIFIERLOOSE]})\\.(${s[i.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${s[i.NUMERICIDENTIFIER]}|${s[i.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${s[i.NUMERICIDENTIFIERLOOSE]}|${s[i.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${s[i.PRERELEASEIDENTIFIER]}(?:\\.${s[i.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${s[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[i.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${c}+`),m("BUILD",`(?:\\+(${s[i.BUILDIDENTIFIER]}(?:\\.${s[i.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${s[i.MAINVERSION]}${s[i.PRERELEASE]}?${s[i.BUILD]}?`),m("FULL",`^${s[i.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${s[i.MAINVERSIONLOOSE]}${s[i.PRERELEASELOOSE]}?${s[i.BUILD]}?`),m("LOOSE",`^${s[i.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${s[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${s[i.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${s[i.XRANGEIDENTIFIER]})(?:\\.(${s[i.XRANGEIDENTIFIER]})(?:\\.(${s[i.XRANGEIDENTIFIER]})(?:${s[i.PRERELEASE]})?${s[i.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${s[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[i.XRANGEIDENTIFIERLOOSE]})(?:${s[i.PRERELEASELOOSE]})?${s[i.BUILD]}?)?)?`),m("XRANGE",`^${s[i.GTLT]}\\s*${s[i.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${s[i.GTLT]}\\s*${s[i.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`),m("COERCE",`${s[i.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",s[i.COERCEPLAIN]+`(?:${s[i.PRERELEASE]})?(?:${s[i.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",s[i.COERCE],!0),m("COERCERTLFULL",s[i.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${s[i.LONETILDE]}\\s+`,!0),r.tildeTrimReplace="$1~",m("TILDE",`^${s[i.LONETILDE]}${s[i.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${s[i.LONETILDE]}${s[i.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${s[i.LONECARET]}\\s+`,!0),r.caretTrimReplace="$1^",m("CARET",`^${s[i.LONECARET]}${s[i.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${s[i.LONECARET]}${s[i.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${s[i.GTLT]}\\s*(${s[i.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${s[i.GTLT]}\\s*(${s[i.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${s[i.GTLT]}\\s*(${s[i.LOOSEPLAIN]}|${s[i.XRANGEPLAIN]})`,!0),r.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${s[i.XRANGEPLAIN]})\\s+-\\s+(${s[i.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${s[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[i.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(K,K.exports)),K.exports}var ve,Or;function lr(){if(Or)return ve;Or=1;const e=Object.freeze({loose:!0}),r=Object.freeze({});return ve=n=>n?typeof n!="object"?e:n:r,ve}var ge,br;function At(){if(br)return ge;br=1;const e=/^[0-9]+$/,r=(n,a)=>{const l=e.test(n),u=e.test(a);return l&&u&&(n=+n,a=+a),n===a?0:l&&!u?-1:u&&!l?1:n<a?-1:1};return ge={compareIdentifiers:r,rcompareIdentifiers:(n,a)=>r(a,n)},ge}var Re,Pr;function U(){if(Pr)return Re;Pr=1;const e=te(),{MAX_LENGTH:r,MAX_SAFE_INTEGER:t}=re(),{safeRe:n,safeSrc:a,t:l}=W(),u=lr(),{compareIdentifiers:o}=At();class s{constructor(i,f){if(f=u(f),i instanceof s){if(i.loose===!!f.loose&&i.includePrerelease===!!f.includePrerelease)return i;i=i.version}else if(typeof i!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof i}".`);if(i.length>r)throw new TypeError(`version is longer than ${r} characters`);e("SemVer",i,f),this.options=f,this.loose=!!f.loose,this.includePrerelease=!!f.includePrerelease;const c=i.trim().match(f.loose?n[l.LOOSE]:n[l.FULL]);if(!c)throw new TypeError(`Invalid Version: ${i}`);if(this.raw=i,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(p=>{if(/^[0-9]+$/.test(p)){const d=+p;if(d>=0&&d<t)return d}return p}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(i){if(e("SemVer.compare",this.version,this.options,i),!(i instanceof s)){if(typeof i=="string"&&i===this.version)return 0;i=new s(i,this.options)}return i.version===this.version?0:this.compareMain(i)||this.comparePre(i)}compareMain(i){return i instanceof s||(i=new s(i,this.options)),o(this.major,i.major)||o(this.minor,i.minor)||o(this.patch,i.patch)}comparePre(i){if(i instanceof s||(i=new s(i,this.options)),this.prerelease.length&&!i.prerelease.length)return-1;if(!this.prerelease.length&&i.prerelease.length)return 1;if(!this.prerelease.length&&!i.prerelease.length)return 0;let f=0;do{const c=this.prerelease[f],p=i.prerelease[f];if(e("prerelease compare",f,c,p),c===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(c===void 0)return-1;if(c===p)continue;return o(c,p)}while(++f)}compareBuild(i){i instanceof s||(i=new s(i,this.options));let f=0;do{const c=this.build[f],p=i.build[f];if(e("build compare",f,c,p),c===void 0&&p===void 0)return 0;if(p===void 0)return 1;if(c===void 0)return-1;if(c===p)continue;return o(c,p)}while(++f)}inc(i,f,c){if(i.startsWith("pre")){if(!f&&c===!1)throw new Error("invalid increment argument: identifier is empty");if(f){const p=new RegExp(`^${this.options.loose?a[l.PRERELEASELOOSE]:a[l.PRERELEASE]}$`),d=`-${f}`.match(p);if(!d||d[1]!==f)throw new Error(`invalid identifier: ${f}`)}}switch(i){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",f,c);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",f,c);break;case"prepatch":this.prerelease.length=0,this.inc("patch",f,c),this.inc("pre",f,c);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",f,c),this.inc("pre",f,c);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const p=Number(c)?1:0;if(this.prerelease.length===0)this.prerelease=[p];else{let d=this.prerelease.length;for(;--d>=0;)typeof this.prerelease[d]=="number"&&(this.prerelease[d]++,d=-2);if(d===-1){if(f===this.prerelease.join(".")&&c===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(p)}}if(f){let d=[f,p];c===!1&&(d=[f]),o(this.prerelease[0],f)===0?isNaN(this.prerelease[1])&&(this.prerelease=d):this.prerelease=d}break}default:throw new Error(`invalid increment argument: ${i}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Re=s,Re}var ye,xr;function G(){if(xr)return ye;xr=1;const e=U();return ye=(t,n,a=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(l){if(!a)return null;throw l}},ye}var _e,qr;function Yt(){if(qr)return _e;qr=1;const e=G();return _e=(t,n)=>{const a=e(t,n);return a?a.version:null},_e}var Ie,Dr;function Qt(){if(Dr)return Ie;Dr=1;const e=G();return Ie=(t,n)=>{const a=e(t.trim().replace(/^[=v]+/,""),n);return a?a.version:null},Ie}var we,Fr;function Kt(){if(Fr)return we;Fr=1;const e=U();return we=(t,n,a,l,u)=>{typeof a=="string"&&(u=l,l=a,a=void 0);try{return new e(t instanceof e?t.version:t,a).inc(n,l,u).version}catch{return null}},we}var $e,Ur;function Jt(){if(Ur)return $e;Ur=1;const e=G();return $e=(t,n)=>{const a=e(t,null,!0),l=e(n,null,!0),u=a.compare(l);if(u===0)return null;const o=u>0,s=o?a:l,h=o?l:a,i=!!s.prerelease.length;if(!!h.prerelease.length&&!i){if(!h.patch&&!h.minor)return"major";if(h.compareMain(s)===0)return h.minor&&!h.patch?"minor":"patch"}const c=i?"pre":"";return a.major!==l.major?c+"major":a.minor!==l.minor?c+"minor":a.patch!==l.patch?c+"patch":"prerelease"},$e}var Te,Br;function Zt(){if(Br)return Te;Br=1;const e=U();return Te=(t,n)=>new e(t,n).major,Te}var Ae,kr;function en(){if(kr)return Ae;kr=1;const e=U();return Ae=(t,n)=>new e(t,n).minor,Ae}var Se,Gr;function rn(){if(Gr)return Se;Gr=1;const e=U();return Se=(t,n)=>new e(t,n).patch,Se}var Le,Mr;function tn(){if(Mr)return Le;Mr=1;const e=G();return Le=(t,n)=>{const a=e(t,n);return a&&a.prerelease.length?a.prerelease:null},Le}var Ne,jr;function B(){if(jr)return Ne;jr=1;const e=U();return Ne=(t,n,a)=>new e(t,a).compare(new e(n,a)),Ne}var Ce,Vr;function nn(){if(Vr)return Ce;Vr=1;const e=B();return Ce=(t,n,a)=>e(n,t,a),Ce}var Oe,Xr;function sn(){if(Xr)return Oe;Xr=1;const e=B();return Oe=(t,n)=>e(t,n,!0),Oe}var be,Hr;function cr(){if(Hr)return be;Hr=1;const e=U();return be=(t,n,a)=>{const l=new e(t,a),u=new e(n,a);return l.compare(u)||l.compareBuild(u)},be}var Pe,Wr;function an(){if(Wr)return Pe;Wr=1;const e=cr();return Pe=(t,n)=>t.sort((a,l)=>e(a,l,n)),Pe}var xe,zr;function on(){if(zr)return xe;zr=1;const e=cr();return xe=(t,n)=>t.sort((a,l)=>e(l,a,n)),xe}var qe,Yr;function ne(){if(Yr)return qe;Yr=1;const e=B();return qe=(t,n,a)=>e(t,n,a)>0,qe}var De,Qr;function fr(){if(Qr)return De;Qr=1;const e=B();return De=(t,n,a)=>e(t,n,a)<0,De}var Fe,Kr;function St(){if(Kr)return Fe;Kr=1;const e=B();return Fe=(t,n,a)=>e(t,n,a)===0,Fe}var Ue,Jr;function Lt(){if(Jr)return Ue;Jr=1;const e=B();return Ue=(t,n,a)=>e(t,n,a)!==0,Ue}var Be,Zr;function hr(){if(Zr)return Be;Zr=1;const e=B();return Be=(t,n,a)=>e(t,n,a)>=0,Be}var ke,et;function pr(){if(et)return ke;et=1;const e=B();return ke=(t,n,a)=>e(t,n,a)<=0,ke}var Ge,rt;function Nt(){if(rt)return Ge;rt=1;const e=St(),r=Lt(),t=ne(),n=hr(),a=fr(),l=pr();return Ge=(o,s,h,i)=>{switch(s){case"===":return typeof o=="object"&&(o=o.version),typeof h=="object"&&(h=h.version),o===h;case"!==":return typeof o=="object"&&(o=o.version),typeof h=="object"&&(h=h.version),o!==h;case"":case"=":case"==":return e(o,h,i);case"!=":return r(o,h,i);case">":return t(o,h,i);case">=":return n(o,h,i);case"<":return a(o,h,i);case"<=":return l(o,h,i);default:throw new TypeError(`Invalid operator: ${s}`)}},Ge}var Me,tt;function un(){if(tt)return Me;tt=1;const e=U(),r=G(),{safeRe:t,t:n}=W();return Me=(l,u)=>{if(l instanceof e)return l;if(typeof l=="number"&&(l=String(l)),typeof l!="string")return null;u=u||{};let o=null;if(!u.rtl)o=l.match(u.includePrerelease?t[n.COERCEFULL]:t[n.COERCE]);else{const p=u.includePrerelease?t[n.COERCERTLFULL]:t[n.COERCERTL];let d;for(;(d=p.exec(l))&&(!o||o.index+o[0].length!==l.length);)(!o||d.index+d[0].length!==o.index+o[0].length)&&(o=d),p.lastIndex=d.index+d[1].length+d[2].length;p.lastIndex=-1}if(o===null)return null;const s=o[2],h=o[3]||"0",i=o[4]||"0",f=u.includePrerelease&&o[5]?`-${o[5]}`:"",c=u.includePrerelease&&o[6]?`+${o[6]}`:"";return r(`${s}.${h}.${i}${f}${c}`,u)},Me}var je,nt;function ln(){if(nt)return je;nt=1;class e{constructor(){this.max=1e3,this.map=new Map}get(t){const n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){const l=this.map.keys().next().value;this.delete(l)}this.map.set(t,n)}return this}}return je=e,je}var Ve,it;function k(){if(it)return Ve;it=1;const e=/\s+/g;class r{constructor(v,w){if(w=a(w),v instanceof r)return v.loose===!!w.loose&&v.includePrerelease===!!w.includePrerelease?v:new r(v.raw,w);if(v instanceof l)return this.raw=v.value,this.set=[[v]],this.formatted=void 0,this;if(this.options=w,this.loose=!!w.loose,this.includePrerelease=!!w.includePrerelease,this.raw=v.trim().replace(e," "),this.set=this.raw.split("||").map(_=>this.parseRange(_.trim())).filter(_=>_.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const _=this.set[0];if(this.set=this.set.filter($=>!m($[0])),this.set.length===0)this.set=[_];else if(this.set.length>1){for(const $ of this.set)if($.length===1&&E($[0])){this.set=[$];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let v=0;v<this.set.length;v++){v>0&&(this.formatted+="||");const w=this.set[v];for(let _=0;_<w.length;_++)_>0&&(this.formatted+=" "),this.formatted+=w[_].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(v){const _=((this.options.includePrerelease&&p)|(this.options.loose&&d))+":"+v,$=n.get(_);if($)return $;const I=this.options.loose,T=I?s[h.HYPHENRANGELOOSE]:s[h.HYPHENRANGE];v=v.replace(T,ue(this.options.includePrerelease)),u("hyphen replace",v),v=v.replace(s[h.COMPARATORTRIM],i),u("comparator trim",v),v=v.replace(s[h.TILDETRIM],f),u("tilde trim",v),v=v.replace(s[h.CARETTRIM],c),u("caret trim",v);let N=v.split(" ").map(P=>L(P,this.options)).join(" ").split(/\s+/).map(P=>oe(P,this.options));I&&(N=N.filter(P=>(u("loose invalid filter",P,this.options),!!P.match(s[h.COMPARATORLOOSE])))),u("range list",N);const S=new Map,C=N.map(P=>new l(P,this.options));for(const P of C){if(m(P))return[P];S.set(P.value,P)}S.size>1&&S.has("")&&S.delete("");const F=[...S.values()];return n.set(_,F),F}intersects(v,w){if(!(v instanceof r))throw new TypeError("a Range is required");return this.set.some(_=>y(_,w)&&v.set.some($=>y($,w)&&_.every(I=>$.every(T=>I.intersects(T,w)))))}test(v){if(!v)return!1;if(typeof v=="string")try{v=new o(v,this.options)}catch{return!1}for(let w=0;w<this.set.length;w++)if(le(this.set[w],v,this.options))return!0;return!1}}Ve=r;const t=ln(),n=new t,a=lr(),l=ie(),u=te(),o=U(),{safeRe:s,t:h,comparatorTrimReplace:i,tildeTrimReplace:f,caretTrimReplace:c}=W(),{FLAG_INCLUDE_PRERELEASE:p,FLAG_LOOSE:d}=re(),m=g=>g.value==="<0.0.0-0",E=g=>g.value==="",y=(g,v)=>{let w=!0;const _=g.slice();let $=_.pop();for(;w&&_.length;)w=_.every(I=>$.intersects(I,v)),$=_.pop();return w},L=(g,v)=>(u("comp",g,v),g=O(g,v),u("caret",g),g=q(g,v),u("tildes",g),g=A(g,v),u("xrange",g),g=ae(g,v),u("stars",g),g),R=g=>!g||g.toLowerCase()==="x"||g==="*",q=(g,v)=>g.trim().split(/\s+/).map(w=>b(w,v)).join(" "),b=(g,v)=>{const w=v.loose?s[h.TILDELOOSE]:s[h.TILDE];return g.replace(w,(_,$,I,T,N)=>{u("tilde",g,_,$,I,T,N);let S;return R($)?S="":R(I)?S=`>=${$}.0.0 <${+$+1}.0.0-0`:R(T)?S=`>=${$}.${I}.0 <${$}.${+I+1}.0-0`:N?(u("replaceTilde pr",N),S=`>=${$}.${I}.${T}-${N} <${$}.${+I+1}.0-0`):S=`>=${$}.${I}.${T} <${$}.${+I+1}.0-0`,u("tilde return",S),S})},O=(g,v)=>g.trim().split(/\s+/).map(w=>x(w,v)).join(" "),x=(g,v)=>{u("caret",g,v);const w=v.loose?s[h.CARETLOOSE]:s[h.CARET],_=v.includePrerelease?"-0":"";return g.replace(w,($,I,T,N,S)=>{u("caret",g,$,I,T,N,S);let C;return R(I)?C="":R(T)?C=`>=${I}.0.0${_} <${+I+1}.0.0-0`:R(N)?I==="0"?C=`>=${I}.${T}.0${_} <${I}.${+T+1}.0-0`:C=`>=${I}.${T}.0${_} <${+I+1}.0.0-0`:S?(u("replaceCaret pr",S),I==="0"?T==="0"?C=`>=${I}.${T}.${N}-${S} <${I}.${T}.${+N+1}-0`:C=`>=${I}.${T}.${N}-${S} <${I}.${+T+1}.0-0`:C=`>=${I}.${T}.${N}-${S} <${+I+1}.0.0-0`):(u("no pr"),I==="0"?T==="0"?C=`>=${I}.${T}.${N}${_} <${I}.${T}.${+N+1}-0`:C=`>=${I}.${T}.${N}${_} <${I}.${+T+1}.0-0`:C=`>=${I}.${T}.${N} <${+I+1}.0.0-0`),u("caret return",C),C})},A=(g,v)=>(u("replaceXRanges",g,v),g.split(/\s+/).map(w=>M(w,v)).join(" ")),M=(g,v)=>{g=g.trim();const w=v.loose?s[h.XRANGELOOSE]:s[h.XRANGE];return g.replace(w,(_,$,I,T,N,S)=>{u("xRange",g,_,$,I,T,N,S);const C=R(I),F=C||R(T),P=F||R(N),j=P;return $==="="&&j&&($=""),S=v.includePrerelease?"-0":"",C?$===">"||$==="<"?_="<0.0.0-0":_="*":$&&j?(F&&(T=0),N=0,$===">"?($=">=",F?(I=+I+1,T=0,N=0):(T=+T+1,N=0)):$==="<="&&($="<",F?I=+I+1:T=+T+1),$==="<"&&(S="-0"),_=`${$+I}.${T}.${N}${S}`):F?_=`>=${I}.0.0${S} <${+I+1}.0.0-0`:P&&(_=`>=${I}.${T}.0${S} <${I}.${+T+1}.0-0`),u("xRange return",_),_})},ae=(g,v)=>(u("replaceStars",g,v),g.trim().replace(s[h.STAR],"")),oe=(g,v)=>(u("replaceGTE0",g,v),g.trim().replace(s[v.includePrerelease?h.GTE0PRE:h.GTE0],"")),ue=g=>(v,w,_,$,I,T,N,S,C,F,P,j)=>(R(_)?w="":R($)?w=`>=${_}.0.0${g?"-0":""}`:R(I)?w=`>=${_}.${$}.0${g?"-0":""}`:T?w=`>=${w}`:w=`>=${w}${g?"-0":""}`,R(C)?S="":R(F)?S=`<${+C+1}.0.0-0`:R(P)?S=`<${C}.${+F+1}.0-0`:j?S=`<=${C}.${F}.${P}-${j}`:g?S=`<${C}.${F}.${+P+1}-0`:S=`<=${S}`,`${w} ${S}`.trim()),le=(g,v,w)=>{for(let _=0;_<g.length;_++)if(!g[_].test(v))return!1;if(v.prerelease.length&&!w.includePrerelease){for(let _=0;_<g.length;_++)if(u(g[_].semver),g[_].semver!==l.ANY&&g[_].semver.prerelease.length>0){const $=g[_].semver;if($.major===v.major&&$.minor===v.minor&&$.patch===v.patch)return!0}return!1}return!0};return Ve}var Xe,st;function ie(){if(st)return Xe;st=1;const e=Symbol("SemVer ANY");class r{static get ANY(){return e}constructor(i,f){if(f=t(f),i instanceof r){if(i.loose===!!f.loose)return i;i=i.value}i=i.trim().split(/\s+/).join(" "),u("comparator",i,f),this.options=f,this.loose=!!f.loose,this.parse(i),this.semver===e?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(i){const f=this.options.loose?n[a.COMPARATORLOOSE]:n[a.COMPARATOR],c=i.match(f);if(!c)throw new TypeError(`Invalid comparator: ${i}`);this.operator=c[1]!==void 0?c[1]:"",this.operator==="="&&(this.operator=""),c[2]?this.semver=new o(c[2],this.options.loose):this.semver=e}toString(){return this.value}test(i){if(u("Comparator.test",i,this.options.loose),this.semver===e||i===e)return!0;if(typeof i=="string")try{i=new o(i,this.options)}catch{return!1}return l(i,this.operator,this.semver,this.options)}intersects(i,f){if(!(i instanceof r))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new s(i.value,f).test(this.value):i.operator===""?i.value===""?!0:new s(this.value,f).test(i.semver):(f=t(f),f.includePrerelease&&(this.value==="<0.0.0-0"||i.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||i.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&i.operator.startsWith(">")||this.operator.startsWith("<")&&i.operator.startsWith("<")||this.semver.version===i.semver.version&&this.operator.includes("=")&&i.operator.includes("=")||l(this.semver,"<",i.semver,f)&&this.operator.startsWith(">")&&i.operator.startsWith("<")||l(this.semver,">",i.semver,f)&&this.operator.startsWith("<")&&i.operator.startsWith(">")))}}Xe=r;const t=lr(),{safeRe:n,t:a}=W(),l=Nt(),u=te(),o=U(),s=k();return Xe}var He,at;function se(){if(at)return He;at=1;const e=k();return He=(t,n,a)=>{try{n=new e(n,a)}catch{return!1}return n.test(t)},He}var We,ot;function cn(){if(ot)return We;ot=1;const e=k();return We=(t,n)=>new e(t,n).set.map(a=>a.map(l=>l.value).join(" ").trim().split(" ")),We}var ze,ut;function fn(){if(ut)return ze;ut=1;const e=U(),r=k();return ze=(n,a,l)=>{let u=null,o=null,s=null;try{s=new r(a,l)}catch{return null}return n.forEach(h=>{s.test(h)&&(!u||o.compare(h)===-1)&&(u=h,o=new e(u,l))}),u},ze}var Ye,lt;function hn(){if(lt)return Ye;lt=1;const e=U(),r=k();return Ye=(n,a,l)=>{let u=null,o=null,s=null;try{s=new r(a,l)}catch{return null}return n.forEach(h=>{s.test(h)&&(!u||o.compare(h)===1)&&(u=h,o=new e(u,l))}),u},Ye}var Qe,ct;function pn(){if(ct)return Qe;ct=1;const e=U(),r=k(),t=ne();return Qe=(a,l)=>{a=new r(a,l);let u=new e("0.0.0");if(a.test(u)||(u=new e("0.0.0-0"),a.test(u)))return u;u=null;for(let o=0;o<a.set.length;++o){const s=a.set[o];let h=null;s.forEach(i=>{const f=new e(i.semver.version);switch(i.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!h||t(f,h))&&(h=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),h&&(!u||t(u,h))&&(u=h)}return u&&a.test(u)?u:null},Qe}var Ke,ft;function mn(){if(ft)return Ke;ft=1;const e=k();return Ke=(t,n)=>{try{return new e(t,n).range||"*"}catch{return null}},Ke}var Je,ht;function mr(){if(ht)return Je;ht=1;const e=U(),r=ie(),{ANY:t}=r,n=k(),a=se(),l=ne(),u=fr(),o=pr(),s=hr();return Je=(i,f,c,p)=>{i=new e(i,p),f=new n(f,p);let d,m,E,y,L;switch(c){case">":d=l,m=o,E=u,y=">",L=">=";break;case"<":d=u,m=s,E=l,y="<",L="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(i,f,p))return!1;for(let R=0;R<f.set.length;++R){const q=f.set[R];let b=null,O=null;if(q.forEach(x=>{x.semver===t&&(x=new r(">=0.0.0")),b=b||x,O=O||x,d(x.semver,b.semver,p)?b=x:E(x.semver,O.semver,p)&&(O=x)}),b.operator===y||b.operator===L||(!O.operator||O.operator===y)&&m(i,O.semver))return!1;if(O.operator===L&&E(i,O.semver))return!1}return!0},Je}var Ze,pt;function dn(){if(pt)return Ze;pt=1;const e=mr();return Ze=(t,n,a)=>e(t,n,">",a),Ze}var er,mt;function En(){if(mt)return er;mt=1;const e=mr();return er=(t,n,a)=>e(t,n,"<",a),er}var rr,dt;function vn(){if(dt)return rr;dt=1;const e=k();return rr=(t,n,a)=>(t=new e(t,a),n=new e(n,a),t.intersects(n,a)),rr}var tr,Et;function gn(){if(Et)return tr;Et=1;const e=se(),r=B();return tr=(t,n,a)=>{const l=[];let u=null,o=null;const s=t.sort((c,p)=>r(c,p,a));for(const c of s)e(c,n,a)?(o=c,u||(u=c)):(o&&l.push([u,o]),o=null,u=null);u&&l.push([u,null]);const h=[];for(const[c,p]of l)c===p?h.push(c):!p&&c===s[0]?h.push("*"):p?c===s[0]?h.push(`<=${p}`):h.push(`${c} - ${p}`):h.push(`>=${c}`);const i=h.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return i.length<f.length?i:n},tr}var nr,vt;function Rn(){if(vt)return nr;vt=1;const e=k(),r=ie(),{ANY:t}=r,n=se(),a=B(),l=(f,c,p={})=>{if(f===c)return!0;f=new e(f,p),c=new e(c,p);let d=!1;e:for(const m of f.set){for(const E of c.set){const y=s(m,E,p);if(d=d||y!==null,y)continue e}if(d)return!1}return!0},u=[new r(">=0.0.0-0")],o=[new r(">=0.0.0")],s=(f,c,p)=>{if(f===c)return!0;if(f.length===1&&f[0].semver===t){if(c.length===1&&c[0].semver===t)return!0;p.includePrerelease?f=u:f=o}if(c.length===1&&c[0].semver===t){if(p.includePrerelease)return!0;c=o}const d=new Set;let m,E;for(const A of f)A.operator===">"||A.operator===">="?m=h(m,A,p):A.operator==="<"||A.operator==="<="?E=i(E,A,p):d.add(A.semver);if(d.size>1)return null;let y;if(m&&E){if(y=a(m.semver,E.semver,p),y>0)return null;if(y===0&&(m.operator!==">="||E.operator!=="<="))return null}for(const A of d){if(m&&!n(A,String(m),p)||E&&!n(A,String(E),p))return null;for(const M of c)if(!n(A,String(M),p))return!1;return!0}let L,R,q,b,O=E&&!p.includePrerelease&&E.semver.prerelease.length?E.semver:!1,x=m&&!p.includePrerelease&&m.semver.prerelease.length?m.semver:!1;O&&O.prerelease.length===1&&E.operator==="<"&&O.prerelease[0]===0&&(O=!1);for(const A of c){if(b=b||A.operator===">"||A.operator===">=",q=q||A.operator==="<"||A.operator==="<=",m){if(x&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===x.major&&A.semver.minor===x.minor&&A.semver.patch===x.patch&&(x=!1),A.operator===">"||A.operator===">="){if(L=h(m,A,p),L===A&&L!==m)return!1}else if(m.operator===">="&&!n(m.semver,String(A),p))return!1}if(E){if(O&&A.semver.prerelease&&A.semver.prerelease.length&&A.semver.major===O.major&&A.semver.minor===O.minor&&A.semver.patch===O.patch&&(O=!1),A.operator==="<"||A.operator==="<="){if(R=i(E,A,p),R===A&&R!==E)return!1}else if(E.operator==="<="&&!n(E.semver,String(A),p))return!1}if(!A.operator&&(E||m)&&y!==0)return!1}return!(m&&q&&!E&&y!==0||E&&b&&!m&&y!==0||x||O)},h=(f,c,p)=>{if(!f)return c;const d=a(f.semver,c.semver,p);return d>0?f:d<0||c.operator===">"&&f.operator===">="?c:f},i=(f,c,p)=>{if(!f)return c;const d=a(f.semver,c.semver,p);return d<0?f:d>0||c.operator==="<"&&f.operator==="<="?c:f};return nr=l,nr}var ir,gt;function yn(){if(gt)return ir;gt=1;const e=W(),r=re(),t=U(),n=At(),a=G(),l=Yt(),u=Qt(),o=Kt(),s=Jt(),h=Zt(),i=en(),f=rn(),c=tn(),p=B(),d=nn(),m=sn(),E=cr(),y=an(),L=on(),R=ne(),q=fr(),b=St(),O=Lt(),x=hr(),A=pr(),M=Nt(),ae=un(),oe=ie(),ue=k(),le=se(),g=cn(),v=fn(),w=hn(),_=pn(),$=mn(),I=mr(),T=dn(),N=En(),S=vn(),C=gn(),F=Rn();return ir={parse:a,valid:l,clean:u,inc:o,diff:s,major:h,minor:i,patch:f,prerelease:c,compare:p,rcompare:d,compareLoose:m,compareBuild:E,sort:y,rsort:L,gt:R,lt:q,eq:b,neq:O,gte:x,lte:A,cmp:M,coerce:ae,Comparator:oe,Range:ue,satisfies:le,toComparators:g,maxSatisfying:v,minSatisfying:w,minVersion:_,validRange:$,outside:I,gtr:T,ltr:N,intersects:S,simplifyRange:C,subset:F,SemVer:t,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:r.SEMVER_SPEC_VERSION,RELEASE_TYPES:r.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},ir}yn();new TextEncoder;var J={exports:{}},Rt;function _n(){if(Rt)return J.exports;Rt=1;const e=/[\p{Lu}]/u,r=/[\p{Ll}]/u,t=/^[\p{Lu}](?![\p{Lu}])/gu,n=/([\p{Alpha}\p{N}_]|$)/u,a=/[_.\- ]+/,l=new RegExp("^"+a.source),u=new RegExp(a.source+n.source,"gu"),o=new RegExp("\\d+"+n.source,"gu"),s=(c,p,d)=>{let m=!1,E=!1,y=!1;for(let L=0;L<c.length;L++){const R=c[L];m&&e.test(R)?(c=c.slice(0,L)+"-"+c.slice(L),m=!1,y=E,E=!0,L++):E&&y&&r.test(R)?(c=c.slice(0,L-1)+"-"+c.slice(L-1),y=E,E=!1,m=!0):(m=p(R)===R&&d(R)!==R,y=E,E=d(R)===R&&p(R)!==R)}return c},h=(c,p)=>(t.lastIndex=0,c.replace(t,d=>p(d))),i=(c,p)=>(u.lastIndex=0,o.lastIndex=0,c.replace(u,(d,m)=>p(m)).replace(o,d=>p(d))),f=(c,p)=>{if(!(typeof c=="string"||Array.isArray(c)))throw new TypeError("Expected the input to be `string | string[]`");if(p={pascalCase:!1,preserveConsecutiveUppercase:!1,...p},Array.isArray(c)?c=c.map(y=>y.trim()).filter(y=>y.length).join("-"):c=c.trim(),c.length===0)return"";const d=p.locale===!1?y=>y.toLowerCase():y=>y.toLocaleLowerCase(p.locale),m=p.locale===!1?y=>y.toUpperCase():y=>y.toLocaleUpperCase(p.locale);return c.length===1?p.pascalCase?m(c):d(c):(c!==d(c)&&(c=s(c,d,m)),c=c.replace(l,""),p.preserveConsecutiveUppercase?c=h(c,d):c=d(c),p.pascalCase&&(c=m(c.charAt(0))+c.slice(1)),i(c,m))};return J.exports=f,J.exports.default=f,J.exports}_n();var Z={exports:{}};Z.exports;var yt;function In(){return yt||(yt=1,function(e){const t=(l=0)=>u=>`\x1B[${38+l};5;${u}m`,n=(l=0)=>(u,o,s)=>`\x1B[${38+l};2;${u};${o};${s}m`;function a(){const l=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(const[o,s]of Object.entries(u)){for(const[h,i]of Object.entries(s))u[h]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},s[h]=u[h],l.set(i[0],i[1]);Object.defineProperty(u,o,{value:s,enumerable:!1})}return Object.defineProperty(u,"codes",{value:l,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi256=t(),u.color.ansi16m=n(),u.bgColor.ansi256=t(10),u.bgColor.ansi16m=n(10),Object.defineProperties(u,{rgbToAnsi256:{value:(o,s,h)=>o===s&&s===h?o<8?16:o>248?231:Math.round((o-8)/247*24)+232:16+36*Math.round(o/255*5)+6*Math.round(s/255*5)+Math.round(h/255*5),enumerable:!1},hexToRgb:{value:o=>{const s=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(o.toString(16));if(!s)return[0,0,0];let{colorString:h}=s.groups;h.length===3&&(h=h.split("").map(f=>f+f).join(""));const i=Number.parseInt(h,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:o=>u.rgbToAnsi256(...u.hexToRgb(o)),enumerable:!1}}),u}Object.defineProperty(e,"exports",{enumerable:!0,get:a})}(Z)),Z.exports}var wn=In();const $n=Ut(wn),{color:ei}=$n;new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Tn(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}return e}function ur(e,r){return Array(r+1).join(e)}function An(e){return e.replace(/^\n*/,"")}function Sn(e){for(var r=e.length;r>0&&e[r-1]===`
|
|
2
|
-
`;)r--;return e.substring(0,r)}var Ln=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function dr(e){return Er(e,Ln)}var Ct=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Ot(e){return Er(e,Ct)}function Nn(e){return Pt(e,Ct)}var bt=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Cn(e){return Er(e,bt)}function On(e){return Pt(e,bt)}function Er(e,r){return r.indexOf(e.nodeName)>=0}function Pt(e,r){return e.getElementsByTagName&&r.some(function(t){return e.getElementsByTagName(t).length})}var D={};D.paragraph={filter:"p",replacement:function(e){return`
|
|
3
|
-
|
|
4
|
-
`+e+`
|
|
5
|
-
|
|
6
|
-
`}};D.lineBreak={filter:"br",replacement:function(e,r,t){return t.br+`
|
|
7
|
-
`}};D.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,r,t){var n=Number(r.nodeName.charAt(1));if(t.headingStyle==="setext"&&n<3){var a=ur(n===1?"=":"-",e.length);return`
|
|
8
|
-
|
|
9
|
-
`+e+`
|
|
10
|
-
`+a+`
|
|
11
|
-
|
|
12
|
-
`}else return`
|
|
13
|
-
|
|
14
|
-
`+ur("#",n)+" "+e+`
|
|
15
|
-
|
|
16
|
-
`}};D.blockquote={filter:"blockquote",replacement:function(e){return e=e.replace(/^\n+|\n+$/g,""),e=e.replace(/^/gm,"> "),`
|
|
17
|
-
|
|
18
|
-
`+e+`
|
|
19
|
-
|
|
20
|
-
`}};D.list={filter:["ul","ol"],replacement:function(e,r){var t=r.parentNode;return t.nodeName==="LI"&&t.lastElementChild===r?`
|
|
21
|
-
`+e:`
|
|
22
|
-
|
|
23
|
-
`+e+`
|
|
24
|
-
|
|
25
|
-
`}};D.listItem={filter:"li",replacement:function(e,r,t){e=e.replace(/^\n+/,"").replace(/\n+$/,`
|
|
26
|
-
`).replace(/\n/gm,`
|
|
27
|
-
`);var n=t.bulletListMarker+" ",a=r.parentNode;if(a.nodeName==="OL"){var l=a.getAttribute("start"),u=Array.prototype.indexOf.call(a.children,r);n=(l?Number(l)+u:u+1)+". "}return n+e+(r.nextSibling&&!/\n$/.test(e)?`
|
|
28
|
-
`:"")}};D.indentedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="indented"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){return`
|
|
29
|
-
|
|
30
|
-
`+r.firstChild.textContent.replace(/\n/g,`
|
|
31
|
-
`)+`
|
|
32
|
-
|
|
33
|
-
`}};D.fencedCodeBlock={filter:function(e,r){return r.codeBlockStyle==="fenced"&&e.nodeName==="PRE"&&e.firstChild&&e.firstChild.nodeName==="CODE"},replacement:function(e,r,t){for(var n=r.firstChild.getAttribute("class")||"",a=(n.match(/language-(\S+)/)||[null,""])[1],l=r.firstChild.textContent,u=t.fence.charAt(0),o=3,s=new RegExp("^"+u+"{3,}","gm"),h;h=s.exec(l);)h[0].length>=o&&(o=h[0].length+1);var i=ur(u,o);return`
|
|
34
|
-
|
|
35
|
-
`+i+a+`
|
|
36
|
-
`+l.replace(/\n$/,"")+`
|
|
37
|
-
`+i+`
|
|
38
|
-
|
|
39
|
-
`}};D.horizontalRule={filter:"hr",replacement:function(e,r,t){return`
|
|
40
|
-
|
|
41
|
-
`+t.hr+`
|
|
42
|
-
|
|
43
|
-
`}};D.inlineLink={filter:function(e,r){return r.linkStyle==="inlined"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r){var t=r.getAttribute("href");t&&(t=t.replace(/([()])/g,"\\$1"));var n=ee(r.getAttribute("title"));return n&&(n=' "'+n.replace(/"/g,'\\"')+'"'),"["+e+"]("+t+n+")"}};D.referenceLink={filter:function(e,r){return r.linkStyle==="referenced"&&e.nodeName==="A"&&e.getAttribute("href")},replacement:function(e,r,t){var n=r.getAttribute("href"),a=ee(r.getAttribute("title"));a&&(a=' "'+a+'"');var l,u;switch(t.linkReferenceStyle){case"collapsed":l="["+e+"][]",u="["+e+"]: "+n+a;break;case"shortcut":l="["+e+"]",u="["+e+"]: "+n+a;break;default:var o=this.references.length+1;l="["+e+"]["+o+"]",u="["+o+"]: "+n+a}return this.references.push(u),l},references:[],append:function(e){var r="";return this.references.length&&(r=`
|
|
44
|
-
|
|
45
|
-
`+this.references.join(`
|
|
46
|
-
`)+`
|
|
47
|
-
|
|
48
|
-
`,this.references=[]),r}};D.emphasis={filter:["em","i"],replacement:function(e,r,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:""}};D.strong={filter:["strong","b"],replacement:function(e,r,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:""}};D.code={filter:function(e){var r=e.previousSibling||e.nextSibling,t=e.parentNode.nodeName==="PRE"&&!r;return e.nodeName==="CODE"&&!t},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var r=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",t="`",n=e.match(/`+/gm)||[];n.indexOf(t)!==-1;)t=t+"`";return t+r+e+r+t}};D.image={filter:"img",replacement:function(e,r){var t=ee(r.getAttribute("alt")),n=r.getAttribute("src")||"",a=ee(r.getAttribute("title")),l=a?' "'+a+'"':"";return n?"":""}};function ee(e){return e?e.replace(/(\n+\s*)+/g,`
|
|
49
|
-
`):""}function xt(e){this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[];for(var r in e.rules)this.array.push(e.rules[r])}xt.prototype={add:function(e,r){this.array.unshift(r)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){if(e.isBlank)return this.blankRule;var r;return(r=sr(this.array,e,this.options))||(r=sr(this._keep,e,this.options))||(r=sr(this._remove,e,this.options))?r:this.defaultRule},forEach:function(e){for(var r=0;r<this.array.length;r++)e(this.array[r],r)}};function sr(e,r,t){for(var n=0;n<e.length;n++){var a=e[n];if(bn(a,r,t))return a}}function bn(e,r,t){var n=e.filter;if(typeof n=="string"){if(n===r.nodeName.toLowerCase())return!0}else if(Array.isArray(n)){if(n.indexOf(r.nodeName.toLowerCase())>-1)return!0}else if(typeof n=="function"){if(n.call(e,r,t))return!0}else throw new TypeError("`filter` needs to be a string, array, or function")}function Pn(e){var r=e.element,t=e.isBlock,n=e.isVoid,a=e.isPre||function(f){return f.nodeName==="PRE"};if(!(!r.firstChild||a(r))){for(var l=null,u=!1,o=null,s=_t(o,r,a);s!==r;){if(s.nodeType===3||s.nodeType===4){var h=s.data.replace(/[ \r\n\t]+/g," ");if((!l||/ $/.test(l.data))&&!u&&h[0]===" "&&(h=h.substr(1)),!h){s=ar(s);continue}s.data=h,l=s}else if(s.nodeType===1)t(s)||s.nodeName==="BR"?(l&&(l.data=l.data.replace(/ $/,"")),l=null,u=!1):n(s)||a(s)?(l=null,u=!0):l&&(u=!1);else{s=ar(s);continue}var i=_t(o,s,a);o=s,s=i}l&&(l.data=l.data.replace(/ $/,""),l.data||ar(l))}}function ar(e){var r=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),r}function _t(e,r,t){return e&&e.parentNode===r||t(r)?r.nextSibling||r.parentNode:r.firstChild||r.nextSibling||r.parentNode}var vr=typeof window<"u"?window:{};function xn(){var e=vr.DOMParser,r=!1;try{new e().parseFromString("","text/html")&&(r=!0)}catch{}return r}function qn(){var e=function(){};return Dn()?e.prototype.parseFromString=function(r){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(r),t.close(),t}:e.prototype.parseFromString=function(r){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(r),t.close(),t},e}function Dn(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch{vr.ActiveXObject&&(e=!0)}return e}var Fn=xn()?vr.DOMParser:qn();function Un(e,r){var t;if(typeof e=="string"){var n=Bn().parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html");t=n.getElementById("turndown-root")}else t=e.cloneNode(!0);return Pn({element:t,isBlock:dr,isVoid:Ot,isPre:r.preformattedCode?kn:null}),t}var or;function Bn(){return or=or||new Fn,or}function kn(e){return e.nodeName==="PRE"||e.nodeName==="CODE"}function Gn(e,r){return e.isBlock=dr(e),e.isCode=e.nodeName==="CODE"||e.parentNode.isCode,e.isBlank=Mn(e),e.flankingWhitespace=jn(e,r),e}function Mn(e){return!Ot(e)&&!Cn(e)&&/^\s*$/i.test(e.textContent)&&!Nn(e)&&!On(e)}function jn(e,r){if(e.isBlock||r.preformattedCode&&e.isCode)return{leading:"",trailing:""};var t=Vn(e.textContent);return t.leadingAscii&&It("left",e,r)&&(t.leading=t.leadingNonAscii),t.trailingAscii&&It("right",e,r)&&(t.trailing=t.trailingNonAscii),{leading:t.leading,trailing:t.trailing}}function Vn(e){var r=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:r[1],leadingAscii:r[2],leadingNonAscii:r[3],trailing:r[4],trailingNonAscii:r[5],trailingAscii:r[6]}}function It(e,r,t){var n,a,l;return e==="left"?(n=r.previousSibling,a=/ $/):(n=r.nextSibling,a=/^ /),n&&(n.nodeType===3?l=a.test(n.nodeValue):t.preformattedCode&&n.nodeName==="CODE"?l=!1:n.nodeType===1&&!dr(n)&&(l=a.test(n.textContent))),l}var Xn=Array.prototype.reduce,Hn=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function H(e){if(!(this instanceof H))return new H(e);var r={rules:D,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(t,n){return n.isBlock?`
|
|
50
|
-
|
|
51
|
-
`:""},keepReplacement:function(t,n){return n.isBlock?`
|
|
52
|
-
|
|
53
|
-
`+n.outerHTML+`
|
|
54
|
-
|
|
55
|
-
`:n.outerHTML},defaultReplacement:function(t,n){return n.isBlock?`
|
|
56
|
-
|
|
57
|
-
`+t+`
|
|
58
|
-
|
|
59
|
-
`:t}};this.options=Tn({},r,e),this.rules=new xt(this.options)}H.prototype={turndown:function(e){if(!Yn(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(e==="")return"";var r=qt.call(this,new Un(e,this.options));return Wn.call(this,r)},use:function(e){if(Array.isArray(e))for(var r=0;r<e.length;r++)this.use(e[r]);else if(typeof e=="function")e(this);else throw new TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function(e,r){return this.rules.add(e,r),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Hn.reduce(function(r,t){return r.replace(t[0],t[1])},e)}};function qt(e){var r=this;return Xn.call(e.childNodes,function(t,n){n=new Gn(n,r.options);var a="";return n.nodeType===3?a=n.isCode?n.nodeValue:r.escape(n.nodeValue):n.nodeType===1&&(a=zn.call(r,n)),Dt(t,a)},"")}function Wn(e){var r=this;return this.rules.forEach(function(t){typeof t.append=="function"&&(e=Dt(e,t.append(r.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function zn(e){var r=this.rules.forNode(e),t=qt.call(this,e),n=e.flankingWhitespace;return(n.leading||n.trailing)&&(t=t.trim()),n.leading+r.replacement(t,e,this.options)+n.trailing}function Dt(e,r){var t=Sn(e),n=An(r),a=Math.max(e.length-t.length,r.length-n.length),l=`
|
|
60
|
-
|
|
61
|
-
`.substring(0,a);return t+l+n}function Yn(e){return e!=null&&(typeof e=="string"||e.nodeType&&(e.nodeType===1||e.nodeType===9||e.nodeType===11))}function Qn(e){try{const r=/<body[^>]*>([\s\S]*?)<\/body>/g,t=[];let n;for(;(n=r.exec(e))!==null;)t.push(n[1].trim());return t.length===0?(console.log("No body tags found"),[]):t}catch(r){return console.error("An error occurred:",r),[]}}function Kn(e){try{const r=/<article[^>]*>([\s\S]*?)<\/article>/g,t=[];let n;for(;(n=r.exec(e))!==null;)t.push(n[1].trim());return t.length===0?(console.log("No article tags found"),[]):t}catch(r){return console.error("An error occurred:",r),[]}}class Jn extends $t{constructor(r=!1){super(),this.debug=r}async fetchURLsFromSitemap(){return await new wt({debug:this.debug}).fetchAndProcessSitemap("https://docs.stripe.com/sitemap.xml")}async fetchArticlesFromSitemap(r){const t=await this.fetchURLsFromSitemap(),n=[];for await(const a of t){const u=await(await fetch(`${a}?locale=${r}`)).text(),o=Kn(u),s=u.match(/<title[^>]*>([^<]+)<\/title>/),h=u.match(/<meta[^>]*name="description"[^>]*content="([^"]+)"[^>]*>/),i=s?s[1].trim():"Unknown",f=h?h[1].trim():"No description";n.push(...o.map(c=>({url:a,content:c,title:i,description:f})))}return n}async load(r="en-US"){const t=await this.fetchArticlesFromSitemap(r),n=new H;return t.map(l=>{const u=n.turndown(l.content);return new Tt({pageContent:u,metadata:{source:l.url,title:l.title,description:l.description}})})}}class Zn extends $t{constructor(r=!1){super(),this.debug=r}async fetchURLsFromSitemap(r){const t=await new wt({debug:this.debug}).fetchAndProcessSitemapIndex("https://stripe.com/sitemap/sitemap.xml",["https://stripe.com/",r].filter(Boolean).join(""));return[t[0],t[1]]}async fetchArticlesFromURLs(r,t){const n=[];for await(const a of r){const u=await(await fetch(`${a}?locale=${t}`)).text(),o=Qn(u),s=u.match(/<title[^>]*>([^<]+)<\/title>/),h=u.match(/<meta[^>]*name="description"[^>]*content="([^"]+)"[^>]*>/),i=s?s[1].trim():"Unknown",f=h?h[1].trim():"No description";n.push(...o.map(c=>({url:a,content:c,title:i,description:f})))}return n}async fetchArticlesFromSitemap(r,t){const n=await this.fetchURLsFromSitemap(r);return await this.fetchArticlesFromURLs(n,t)}async load(r){const{resource:t,urls:n}=r??{},a=(r==null?void 0:r.locale)??"en-US",l=n?await this.fetchArticlesFromURLs(n,a):await this.fetchArticlesFromSitemap(t,a),u=new H;return l.map(s=>{const h=u.turndown(s.content);return new Tt({pageContent:h,metadata:{source:s.url,title:s.title,description:s.description}})})}}exports.StripeComDocumentLoader=Zn;exports.StripeDocsDocumentLoader=Jn;
|
|
62
|
-
//# sourceMappingURL=langchain-stripe-loader.cjs.map
|