From 0120f1e3133876181ea09090b5f23807086be24b Mon Sep 17 00:00:00 2001 From: Lin Yem Date: Tue, 11 Jun 2024 14:08:01 +0900 Subject: [PATCH 1/4] Add matcher --- README.md | 16 + dist/completion-generator.d.ts | 209 +++++++---- dist/completion-generator.es5.js | 2 +- dist/completion-generator.js | 395 +++++++++++++++------ package-lock.json | 592 ++++++++++++++++++++++++++++++- package.json | 4 +- src/fetcher.ts | 109 ++++++ src/generator.ts | 74 ++++ src/index.ts | 408 +-------------------- src/matcher.ts | 422 ++++++++++++++++++++++ src/types.ts | 56 +++ src/utils.ts | 3 + test/fixtures/test-suites.json | 73 ++++ test/index.test.js | 37 +- vite.config.ts | 16 +- 15 files changed, 1814 insertions(+), 602 deletions(-) create mode 100644 src/fetcher.ts create mode 100644 src/generator.ts create mode 100644 src/matcher.ts create mode 100644 src/types.ts create mode 100644 src/utils.ts diff --git a/README.md b/README.md index fc07d2f..92968bc 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,23 @@ import { Generator, Fetcher } from '@obot-ai/completion-generator' /* Generator Constructor + Matchers: + - ForwardMatcher: + - 入力文全文を前方一致でマッチする + - キーワードで判定された部分以外も比較対象テキストに含まれる必要がある + - KeywordMatcher: + - キーワードベースの正規表現を用いてマッチする + - キーワードの全文マッチが優先、マッチがなければ部分マッチを行う + - ConcatMatcher: + - 複数のMatcherのマッチ結果を結合して出力する + - addMatcherByClass, addMatcherで結合対象のMatcherを追加しないとマッチ成功結果が得られない + - KeywordForwardMatcher: + - KeywordMatcher, ForwardMatcherをConcatMatcherで結合したクラス + - DefaultMatcher: ForwardMatcher Args: - properties: object + - matcher?: Matcher?: + - 指定すると他のオプション設定は無視される、していなければ他のオプション設定でDefaultMatcherを構成して使う - keywordSeparator?: string: キーワードの分割文字 - minKeywordLength?: number: キーワードとして認定する最短長さ - strictMatchLocales?: string[]: 単語ごとにキーワードをマッチする言語(指定していない言語コードは文字ごとにマッチを行う) @@ -60,6 +75,7 @@ import { Generator, Fetcher } from '@obot-ai/completion-generator' - locale: string: 言語コード - Return: 数字で示した比較結果。0: = , >0: >, <0: < - filter?: (localeData: LocaleDataItem[], input: string, locale: string) => MatchedResultData[]: 既存のマッチルールを上書きするメソッド + - KeywordMatcherでのみ有効。廃止予定、カスタマイズしたMatcherの指定を推奨 - Args: - localeData: LocaleDataItem({text: string, keywords: string})[]: 該当言語の候補データ集 - input: string: 入力テキスト diff --git a/dist/completion-generator.d.ts b/dist/completion-generator.d.ts index bbe9593..bc84181 100644 --- a/dist/completion-generator.d.ts +++ b/dist/completion-generator.d.ts @@ -1,52 +1,88 @@ -export type LocaleDataItem = { - text: string; - keywords: string; -}; -export type MatchedResult = { - isMatched: boolean; - data?: MatchedResultData; -}; -export type MatchedResultData = { - text: string; - keywords: string; - matchedKeywords?: MatchedKeyword[]; -}; -export type MatchedKeyword = { - text: string; - startAt: number; - endAt: number; +export declare type CompletionFetcherProperties = { + apiKey: string; + apiKeyHeaderName?: string; + getEndpoint?: GetEndpoint; + handleResponse?: HandleResponse; }; -export type CompletionGeneratorProperties = { - keywordSeparator: string; - minKeywordLength: number; - strictMatchLocales: string[]; + +export declare type CompletionGeneratorProperties = { + keywordSeparator?: string; + minKeywordLength?: number; + strictMatchLocales?: string[]; + maxResults?: number; comparator?: LocaleDataComparator; filter?: LocaleDateFilter; + matcher?: Matcher; }; -export type LocaleDataComparator = (itemA: LocaleDataItem, itemB: LocaleDataItem, input: string, locale: string) => number; -export type LocaleDateFilter = (localeData: LocaleDataItem[], input: string, locale: string) => MatchedResultData[]; -export interface CompletionGeneratorInter { - /** キーワードの分割文字 */ - keywordSeparator: string; - /** キーワードとして認定する最短長さ */ - minKeywordLength: number; - /** _strictMatchを使う言語コード設定 */ - strictMatchLocales: string[]; - /** ソート用メソッド */ + +export declare type CompletionMatcherProperties = { + keywordSeparator?: string; + minKeywordLength?: number; + strictMatchLocales?: string[]; + maxResults?: number; comparator?: LocaleDataComparator; - /** 絞り込み用メソッド */ filter?: LocaleDateFilter; - data: Map; - loadData: (locale: string, localeData: LocaleDataItem[]) => void; - generateCompletions: (input: string, locale: string) => MatchedResultData[]; +}; + +export declare class ConcatMatcher extends Matcher { + matchers: Matcher[]; + constructor(properties: CompletionMatcherProperties); + addMatcherByClass(matcherClass: typeof Matcher): void; + addMatcher(matcher: Matcher): void; + loadData(locale: string, localeData: LocaleDataItem[]): void; + match(input: string, locale: string): MatchedResultData[]; } -export declare class Generator implements CompletionGeneratorInter { - keywordSeparator: string; - minKeywordLength: number; - strictMatchLocales: string[]; - comparator?: LocaleDataComparator; - filter?: LocaleDateFilter; - data: Map; + +export declare const DefaultMatcher: typeof ForwardMatcher; + +export declare class Fetcher { + apiKey: string; + apiKeyHeaderName: string; + getEndpoint: GetEndpoint; + handleResponse: HandleResponse; + constructor(properties?: CompletionFetcherProperties); + /** + * 指定エンドポイントから候補データを取得 + * @param locale 言語コード + * @returns + */ + fetch(locale: string): Promise; + _fetch(endpoint: string): Promise; + isFetchAvailable(): boolean; +} + +/** + * 入力文を前方一致でマッチするMatcher + */ +export declare class ForwardMatcher extends Matcher { + match(input: string, locale: string): MatchedResultData[]; + _match(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[]; + _charMatch(dataItem: LocaleDataItem, input: string): { + isMatched: boolean; + data?: undefined; + } | { + isMatched: boolean; + data: { + text: string; + keywords: string; + matchedKeywords: MatchedKeyword[]; + }; + }; + _wordMatch(dataItem: LocaleDataItem, input: string): { + isMatched: boolean; + data?: undefined; + } | { + isMatched: boolean; + data: { + text: string; + keywords: string; + matchedKeywords: MatchedKeyword[]; + }; + }; +} + +declare class Generator_2 { + matcher: Matcher; constructor(properties?: CompletionGeneratorProperties); /** * 候補データをインスタンスにセットする @@ -62,34 +98,73 @@ export declare class Generator implements CompletionGeneratorInter { * @returns 補完データ */ generateCompletions(input: string, locale: string): MatchedResultData[]; - _getMatchedCompletions(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[]; - _match(dataItem: LocaleDataItem, input: string): MatchedResult; - _strictMatch(dataItem: LocaleDataItem, input: string): MatchedResult; + get keywordSeparator(): string; + get minKeywordLength(): number; + get strictMatchLocales(): string[]; + get data(): Map; } -export type CompletionFetcherProperties = { - apiKey: string; - apiKeyHeaderName?: string; - getEndpoint?: GetEndpoint; - handleResponse?: HandleResponse; -}; -export type GetEndpoint = (locale: string) => string; -export type HandleResponse = (data: any) => LocaleDataItem[]; -export interface CompletionFetcherInter { - apiKey: string; - fetch(locale: string): Promise; +export { Generator_2 as Generator } + +export declare type GetEndpoint = (locale: string) => string; + +export declare type HandleResponse = (data: any) => LocaleDataItem[]; + +export declare class KeywordForwardMatcher extends ConcatMatcher { + constructor(properties: CompletionMatcherProperties); } -export declare class Fetcher implements CompletionFetcherInter { - apiKey: string; - apiKeyHeaderName: string; - getEndpoint: GetEndpoint; - handleResponse: HandleResponse; - constructor(properties?: CompletionFetcherProperties); + +export declare class KeywordMatcher extends Matcher { + exactRegExpMap: Map; + partialRegExpMap: Map; + loadData(locale: string, localeData: LocaleDataItem[]): void; + match(input: string, locale: string): MatchedResultData[]; + _match(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[]; +} + +export declare type LocaleDataComparator = (itemA: LocaleDataItem, itemB: LocaleDataItem, input: string, locale: string) => number; + +export declare type LocaleDataItem = { + idx?: number; + text: string; + keywords: string; +}; + +export declare type LocaleDateFilter = (localeData: LocaleDataItem[], input: string, locale: string) => MatchedResultData[]; + +export declare type MatchedKeyword = { + text: string; + startAt: number; + endAt: number; +}; + +export declare type MatchedResult = { + isMatched: boolean; + data?: MatchedResultData; +}; + +export declare type MatchedResultData = { + idx?: number; + text: string; + keywords: string; + matchedKeywords?: MatchedKeyword[]; +}; + +export declare class Matcher { + keywordSeparator: string; + minKeywordLength: number; + strictMatchLocales: string[]; + comparator?: LocaleDataComparator; + filter?: LocaleDateFilter; + data: Map; + maxResults?: number; + constructor(properties?: CompletionMatcherProperties); /** - * 指定エンドポイントから候補データを取得 + * 候補データをインスタンスにセットする * @param locale 言語コード - * @returns + * @param localeData 言語データ */ - fetch(locale: string): Promise; - _fetch(endpoint: string): Promise; - isFetchAvailable(): boolean; + loadData(locale: string, localeData: LocaleDataItem[]): void; + match(input: string, locale: string): MatchedResultData[]; } + +export { } diff --git a/dist/completion-generator.es5.js b/dist/completion-generator.es5.js index a6b2c5a..8359635 100644 --- a/dist/completion-generator.es5.js +++ b/dist/completion-generator.es5.js @@ -1 +1 @@ -function e(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}c((n=n.apply(e,t||[])).next())}))}function t(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(a=2&s[0]?n.return:s[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,s[1])).done)return a;switch(n=0,a&&(s=[2&s[0],a.value]),s[0]){case 0:case 1:a=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!a||s[1]>a[0]&&s[1]=this.minKeywordLength&&i.push({text:s,startAt:o,endAt:u}),o=u+1}else{if(-1===r.indexOf(c))return{isMatched:!1};o+=1}}for(var f=[],d=0,h=null,p=null;dy&&f.push(t.slice(y+1,b)),h=p,d+=1}if(0===d)f.push(t);else if(p){var v=p.endAt;v+1)")}}return Object.defineProperty(r.prototype,"fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this,a=this.getEndpoint(r);return new Promise((function(r,i){return e(n,void 0,void 0,(function(){var e,n,o;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this._fetch(a)];case 1:e=t.sent();try{n=this.handleResponse(e),r(n)}catch(t){i("Invalid data fetched. ".concat(JSON.stringify(e)))}return"user_says"in e&&Array.isArray(e.user_says),[3,3];case 2:return o=t.sent(),i("Failed to fetch data from ".concat(a,".")),console.error(o),[3,3];case 3:return[2]}}))}))}))}}),Object.defineProperty(r.prototype,"_fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(r){var n=this;return new Promise((function(a,i){return e(n,void 0,void 0,(function(){var e,n,o,s,c;return t(this,(function(t){switch(t.label){case 0:return this.isFetchAvailable()?(e={},this.apiKey&&((n={})[this.apiKeyHeaderName]=this.apiKey,e.headers=n),[4,fetch(r,e)]):[3,5];case 1:return(o=t.sent()).ok&&200==o.status?[4,o.json()]:[3,3];case 2:return s=t.sent(),a(s),[3,4];case 3:i("Failed to fetch data. Status: ".concat(o.status)),t.label=4;case 4:return[3,6];case 5:(c=new XMLHttpRequest).open("GET",r),this.apiKey&&c.setRequestHeader(this.apiKeyHeaderName,this.apiKey),c.onload=function(){if(200===c.status)try{var e=JSON.parse(c.response);a(e)}catch(e){i("Invalid response data format.")}else i("Failed to fetch data. Status: ".concat(c.status))},c.onerror=function(){i("Unknown error occurred while fetching completion data.")},c.send(),t.label=6;case 6:return[2]}}))}))}))}}),Object.defineProperty(r.prototype,"isFetchAvailable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof window.fetch}}),r}();export{n as Fetcher,r as Generator}; +var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}function r(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{u(a.next(e))}catch(e){o(e)}}function c(e){try{u(a.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}u((a=a.apply(e,t||[])).next())}))}function a(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,a&&(n=2&c[0]?a.return:c[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,c[1])).done)return n;switch(a=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]=this.maxResults)break}return n}}),Object.defineProperty(r.prototype,"_charMatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=e.text.toLowerCase(),a=e.keywords.toLowerCase(),n=this.minKeywordLength||2,o=t.length,i=[],c=0;c=n&&i.push({text:u,startAt:c,endAt:l}),c=l+1}else{if(-1===r.indexOf(s))return{isMatched:!1};c+=1}}for(var h=[],p=0,d=null,y=null;pb&&h.push(t.slice(b+1,m)),d=y,p+=1}if(0===p)h.push(t);else if(y){var v=y.endAt;v+10&&n.add(e.toLowerCase())}))}));var o=Array.from(n);o.sort((function(e,t){return t.length-e.length})),this.exactRegExpMap.set(t,new RegExp(o.join("|"),"g"));var i=[];o.forEach((function(e){if(e.length>a.minKeywordLength){var t=e.slice(0,a.minKeywordLength),r=[t];(n=e.length-a.minKeywordLength,o=a.minKeywordLength,Array.from(Array(n).keys()).map((function(e){return e+o}))).forEach((function(a){t+=e[a],r.push(t)})),r.reverse(),i.push(r.join("|"))}else e.length>0&&i.push(e);var n,o})),this.partialRegExpMap.set(t,new RegExp(i.join("|"),"g"))}}),Object.defineProperty(r.prototype,"match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.data.get(t);if(!r)return[];var a=Array.from(r);if(this.comparator){var n=this.comparator;a.sort((function(r,a){return n(r,a,e,t)}))}return this._match(a,e,t)}}),Object.defineProperty(r.prototype,"_match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var a=[],n=this.exactRegExpMap.get(r);if(e&&n){var o=void 0;if(!(o=t.toLowerCase().match(n))){var i=this.partialRegExpMap.get(r);i&&(o=t.toLowerCase().match(i))}if(o)for(var c=o.map((function(e){var r=t.indexOf(e);return{text:e,startAt:r,endAt:r+e.length}})),u=function(e){var t=[],r=e.keywords;if(c.forEach((function(e){-1!==r.indexOf(e.text)&&t.push(e)})),t.length>0&&a.push({text:e.text,keywords:e.keywords,matchedKeywords:t}),s.maxResults&&a.length>=s.maxResults)return"break"},s=this,l=0,f=e;l=c.maxResults)return"break"},c=this,u=0,s=o;u=this.maxResults)break}return r}}),r}(n),u=function(e){function r(t){var r=e.call(this,t)||this;return r.addMatcher(new i(t)),r.addMatcher(new o(t)),r}return t(r,e),r}(c),s=o,l=function(){function e(e){void 0===e&&(e={keywordSeparator:",",minKeywordLength:2,strictMatchLocales:["en"]}),Object.defineProperty(this,"matcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e.matcher?this.matcher=e.matcher:this.matcher=new s({keywordSeparator:e.keywordSeparator||",",minKeywordLength:e.minKeywordLength||2,strictMatchLocales:e.strictMatchLocales||["en"],comparator:e.comparator,filter:e.filter})}return Object.defineProperty(e.prototype,"loadData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._validateLocaleData(t),this.matcher.loadData(e,t)}}),Object.defineProperty(e.prototype,"_validateLocaleData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e.text&&"string"==typeof e.keywords})))throw Error("Locale data should be a list of {text: string, keywords: string}")}}),Object.defineProperty(e.prototype,"generateCompletions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e||e.length<=0?[]:this.matcher.match(e,t)}}),Object.defineProperty(e.prototype,"keywordSeparator",{get:function(){return this.matcher.keywordSeparator},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minKeywordLength",{get:function(){return this.matcher.minKeywordLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strictMatchLocales",{get:function(){return this.matcher.strictMatchLocales},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.matcher.data},enumerable:!1,configurable:!0}),e}(),f=function(){function e(e){void 0===e&&(e={apiKey:""}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKeyHeaderName",{enumerable:!0,configurable:!0,writable:!0,value:"X-Secret-Key"}),Object.defineProperty(this,"getEndpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.apiKey=e.apiKey,e.apiKeyHeaderName&&(this.apiKeyHeaderName=e.apiKeyHeaderName),"function"==typeof e.getEndpoint?this.getEndpoint=e.getEndpoint:this.getEndpoint=function(e){return"/input_completion/".concat(e,"/")},"function"==typeof e.handleResponse?this.handleResponse=e.handleResponse:this.handleResponse=function(e){if("user_says"in e&&Array.isArray(e.user_says))return e.user_says;throw Error("Data should have [user_says](Array)")}}return Object.defineProperty(e.prototype,"fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getEndpoint(e);return new Promise((function(e,o){return r(t,void 0,void 0,(function(){var t,r,i;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._fetch(n)];case 1:t=a.sent();try{r=this.handleResponse(t),e(r)}catch(e){o("Invalid data fetched. ".concat(JSON.stringify(t)))}return"user_says"in t&&Array.isArray(t.user_says),[3,3];case 2:return i=a.sent(),o("Failed to fetch data from ".concat(n,".")),console.error(i),[3,3];case 3:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"_fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n,o){return r(t,void 0,void 0,(function(){var t,r,i,c,u;return a(this,(function(a){switch(a.label){case 0:return this.isFetchAvailable()?(t={},this.apiKey&&((r={})[this.apiKeyHeaderName]=this.apiKey,t.headers=r),[4,fetch(e,t)]):[3,5];case 1:return(i=a.sent()).ok&&200==i.status?[4,i.json()]:[3,3];case 2:return c=a.sent(),n(c),[3,4];case 3:o("Failed to fetch data. Status: ".concat(i.status)),a.label=4;case 4:return[3,6];case 5:(u=new XMLHttpRequest).open("GET",e),this.apiKey&&u.setRequestHeader(this.apiKeyHeaderName,this.apiKey),u.onload=function(){if(200===u.status)try{var e=JSON.parse(u.response);n(e)}catch(e){o("Invalid response data format.")}else o("Failed to fetch data. Status: ".concat(u.status))},u.onerror=function(){o("Unknown error occurred while fetching completion data.")},u.send(),a.label=6;case 6:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"isFetchAvailable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof window.fetch}}),e}();export{c as ConcatMatcher,s as DefaultMatcher,f as Fetcher,o as ForwardMatcher,l as Generator,u as KeywordForwardMatcher,i as KeywordMatcher,n as Matcher}; diff --git a/dist/completion-generator.js b/dist/completion-generator.js index 6925d1f..bdf3259 100644 --- a/dist/completion-generator.js +++ b/dist/completion-generator.js @@ -1,15 +1,17 @@ -var g = Object.defineProperty; -var x = (l, t, e) => t in l ? g(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e; -var h = (l, t, e) => (x(l, typeof t != "symbol" ? t + "" : t, e), e); -class L { - constructor(t = { keywordSeparator: ",", minKeywordLength: 2, strictMatchLocales: ["en"] }) { - h(this, "keywordSeparator"); - h(this, "minKeywordLength"); - h(this, "strictMatchLocales"); - h(this, "comparator"); - h(this, "filter"); - h(this, "data"); - this.keywordSeparator = t.keywordSeparator || ",", this.minKeywordLength = t.minKeywordLength || 2, this.data = /* @__PURE__ */ new Map(), this.strictMatchLocales = t.strictMatchLocales || ["en"], typeof t.comparator == "function" && (this.comparator = t.comparator), typeof t.filter == "function" && (this.filter = t.filter); +var K = Object.defineProperty; +var L = (y, t, e) => t in y ? K(y, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : y[t] = e; +var l = (y, t, e) => (L(y, typeof t != "symbol" ? t + "" : t, e), e); +const k = (y, t) => Array.from(Array(y).keys()).map((e) => e + t); +class g { + constructor(t = {}) { + l(this, "keywordSeparator"); + l(this, "minKeywordLength"); + l(this, "strictMatchLocales"); + l(this, "comparator"); + l(this, "filter"); + l(this, "data"); + l(this, "maxResults"); + this.keywordSeparator = t.keywordSeparator || ",", this.minKeywordLength = t.minKeywordLength || 2, this.strictMatchLocales = t.strictMatchLocales || ["en"], t.maxResults && (this.maxResults = t.maxResults), typeof t.comparator == "function" && (this.comparator = t.comparator), typeof t.filter == "function" && (this.filter = t.filter), this.data = /* @__PURE__ */ new Map(); } /** * 候補データをインスタンスにセットする @@ -17,84 +19,81 @@ class L { * @param localeData 言語データ */ loadData(t, e) { - this._validateLocaleData(e), this.data.set(t, e); + this.data.set(t, e); } - _validateLocaleData(t) { - if (!(Array.isArray(t) && t.every((e) => typeof e.text == "string" && typeof e.keywords == "string"))) - throw Error("Locale data should be a list of {text: string, keywords: string}"); + // @ts-ignore + match(t, e) { + return []; } - /** - * 指定入力テキストと言語に対し、補完データを生成して返す - * @param input 入力テキスト - * @param locale 言語コード - * @returns 補完データ - */ - generateCompletions(t, e) { - if (!t || t.length <= 0) - return []; - const n = this.data.get(e); - if (!n) +} +class M extends g { + match(t, e) { + const o = this.data.get(e); + if (!o) return []; - let a = Array.from(n); + let s = Array.from(o); if (this.comparator) { - const s = this.comparator; - a.sort((r, i) => s(r, i, t, e)); + const a = this.comparator; + s.sort((n, r) => a(n, r, t, e)); } if (this.filter) { - const s = this.filter; - return s(a, t, e); + const a = this.filter; + return a(s, t, e); } - return this._getMatchedCompletions(a, t, e); + return this._match(s, t.toLowerCase(), e); } - _getMatchedCompletions(t, e, n) { - const a = this.strictMatchLocales.indexOf(n) !== -1, s = []; - return t.forEach((r) => { - let i = null; - a ? i = this._strictMatch(r, e.toLowerCase()) : i = this._match(r, e.toLowerCase()), i.isMatched && i.data && s.push(i.data); - }), s; + _match(t, e, o) { + const s = this.strictMatchLocales.indexOf(o) !== -1, a = []; + if (t) + for (const n of t) { + let r; + if (s ? r = this._wordMatch(n, e) : r = this._charMatch(n, e), r.isMatched && r.data && a.push(r.data), this.maxResults && a.length >= this.maxResults) + break; + } + return a; } - _match(t, e) { - const n = t.text.toLowerCase(), a = t.keywords.toLowerCase(), s = e.length, r = []; + _charMatch(t, e) { + const o = t.text.toLowerCase(), s = t.keywords.toLowerCase(), a = this.minKeywordLength || 2, n = e.length, r = []; let i = 0; - for (; i < s; ) { - let c = "", y = e[i]; - if (a.indexOf(y) !== -1) { - let d = i; - if (c = y, d < s - 1) - for (d += 1; d < s; ) { - const m = c + e[d]; - if (a.indexOf(m) === -1) { - d -= 1; + for (; i < n; ) { + let f = "", w = e[i]; + if (s.indexOf(w) !== -1) { + let m = i; + if (f = w, m < n - 1) + for (m += 1; m < n; ) { + const x = f + e[m]; + if (s.indexOf(x) === -1) { + m -= 1; break; } - c = m, d += 1; + f = x, m += 1; } - c.length >= this.minKeywordLength && r.push({ - text: c, + f.length >= a && r.push({ + text: f, startAt: i, - endAt: d - }), i = d + 1; + endAt: m + }), i = m + 1; } else { - if (n.indexOf(y) === -1) + if (o.indexOf(w) === -1) return { isMatched: !1 }; i += 1; } } - const f = []; - let u = 0, w = null, o = null; - for (; u < r.length; ) { - o = r[u]; - let c = (w == null ? void 0 : w.endAt) || 0, y = o.startAt; - y > c && f.push(e.slice(c + 1, y)), w = o, u += 1; + const c = []; + let d = 0, u = null, h = null; + for (; d < r.length; ) { + h = r[d]; + let f = (u == null ? void 0 : u.endAt) || 0, w = h.startAt; + w > f && c.push(e.slice(f + 1, w)), u = h, d += 1; } - if (u === 0) - f.push(e); - else if (o) { - const c = o.endAt; - c + 1 < s && f.push(e.slice(c + 1, s)); + if (d === 0) + c.push(e); + else if (h) { + const f = h.endAt; + f + 1 < n && c.push(e.slice(f + 1, n)); } return { - isMatched: f.every((c) => n.indexOf(c) !== -1), + isMatched: c.every((f) => o.indexOf(f) !== -1), data: { text: t.text, keywords: t.keywords, @@ -102,42 +101,202 @@ class L { } }; } - _strictMatch(t, e) { - const n = t.text.toLowerCase(), a = []; - t.keywords.toLowerCase().split(this.keywordSeparator).forEach((o) => { - o.split(" ").forEach((p) => { + _wordMatch(t, e) { + const o = t.text.toLowerCase(), s = this.keywordSeparator || ",", a = []; + t.keywords.toLowerCase().split(s).forEach((h) => { + h.split(" ").forEach((p) => { a.push(p); }); }); - const s = e.split(" "), r = s.pop(); - if (!(n.indexOf(r) !== -1 || a.some((o) => o.indexOf(r) !== -1))) + const n = e.split(" "), r = n.pop(); + if (!(o.indexOf(r) !== -1 || a.some((h) => h.indexOf(r) !== -1))) return { isMatched: !1 }; - const f = s.filter((o) => a.indexOf(o) !== -1).map( - (o) => { - const p = e.indexOf(o), c = p + o.length; + const c = n.filter((h) => a.indexOf(h) !== -1).map( + (h) => { + const p = e.indexOf(h), f = p + h.length; return { - text: o, + text: h, startAt: p, - endAt: c + endAt: f }; } ); return { - isMatched: s.filter((o) => a.indexOf(o) === -1).every((o) => n.indexOf(o) !== -1), + isMatched: n.filter((h) => a.indexOf(h) === -1).every((h) => o.indexOf(h) !== -1), data: { text: t.text, keywords: t.keywords, - matchedKeywords: f + matchedKeywords: c } }; } } -class M { +class R extends g { + constructor() { + super(...arguments); + l(this, "exactRegExpMap", /* @__PURE__ */ new Map()); + l(this, "partialRegExpMap", /* @__PURE__ */ new Map()); + } + loadData(e, o) { + super.loadData(e, o); + const s = /* @__PURE__ */ new Set(); + o.forEach((r) => { + r.keywords.split(this.keywordSeparator).forEach((d) => { + d.length > 0 && s.add(d.toLowerCase()); + }); + }); + const a = Array.from(s); + a.sort((r, i) => i.length - r.length), this.exactRegExpMap.set(e, new RegExp(a.join("|"), "g")); + const n = []; + a.forEach((r) => { + if (r.length > this.minKeywordLength) { + let i = r.slice(0, this.minKeywordLength); + const c = [i]; + k(r.length - this.minKeywordLength, this.minKeywordLength).forEach((d) => { + i += r[d], c.push(i); + }), c.reverse(), n.push(c.join("|")); + } else + r.length > 0 && n.push(r); + }), this.partialRegExpMap.set(e, new RegExp(n.join("|"), "g")); + } + match(e, o) { + const s = this.data.get(o); + if (!s) + return []; + let a = Array.from(s); + if (this.comparator) { + const n = this.comparator; + a.sort((r, i) => n(r, i, e, o)); + } + return this._match(a, e, o); + } + _match(e, o, s) { + const a = []; + let n = this.exactRegExpMap.get(s); + if (e && n) { + let r; + if (r = o.toLowerCase().match(n), !r) { + const i = this.partialRegExpMap.get(s); + i && (r = o.toLowerCase().match(i)); + } + if (r) { + const i = r.map((c) => { + const d = o.indexOf(c); + return { + text: c, + startAt: d, + endAt: d + c.length + }; + }); + for (const c of e) { + const d = [], u = c.keywords; + if (i.forEach((h) => { + u.indexOf(h.text) !== -1 && d.push(h); + }), d.length > 0 && a.push({ + text: c.text, + keywords: c.keywords, + matchedKeywords: d + }), this.maxResults && a.length >= this.maxResults) + break; + } + } + } + return a; + } +} +class E extends g { + constructor(e) { + super(e); + l(this, "matchers"); + this.matchers = []; + } + addMatcherByClass(e) { + const o = new e({ + keywordSeparator: this.keywordSeparator, + minKeywordLength: this.minKeywordLength, + strictMatchLocales: this.strictMatchLocales + }); + this.addMatcher(o); + } + addMatcher(e) { + typeof e.loadData == "function" && typeof e.match == "function" && this.matchers.push(e); + } + loadData(e, o) { + const s = JSON.stringify(o); + this.matchers.forEach((a) => { + a.loadData(e, JSON.parse(s)); + }); + } + match(e, o) { + const s = []; + for (const a of this.matchers) { + const n = a.match(e, o); + for (const r of n) + if (s.some((i) => i.text === r.text) || s.push(r), this.maxResults && s.length >= this.maxResults) + break; + if (this.maxResults && s.length >= this.maxResults) + break; + } + return s; + } +} +class O extends E { + constructor(t) { + super(t), this.addMatcher(new R(t)), this.addMatcher(new M(t)); + } +} +const A = M; +class _ { + constructor(t = { keywordSeparator: ",", minKeywordLength: 2, strictMatchLocales: ["en"] }) { + l(this, "matcher"); + t.matcher ? this.matcher = t.matcher : this.matcher = new A({ + keywordSeparator: t.keywordSeparator || ",", + minKeywordLength: t.minKeywordLength || 2, + strictMatchLocales: t.strictMatchLocales || ["en"], + comparator: t.comparator, + filter: t.filter + }); + } + /** + * 候補データをインスタンスにセットする + * @param locale 言語コード + * @param localeData 言語データ + */ + loadData(t, e) { + this._validateLocaleData(e), this.matcher.loadData(t, e); + } + _validateLocaleData(t) { + if (!(Array.isArray(t) && t.every((e) => typeof e.text == "string" && typeof e.keywords == "string"))) + throw Error("Locale data should be a list of {text: string, keywords: string}"); + } + /** + * 指定入力テキストと言語に対し、補完データを生成して返す + * @param input 入力テキスト + * @param locale 言語コード + * @returns 補完データ + */ + generateCompletions(t, e) { + return !t || t.length <= 0 ? [] : this.matcher.match(t, e); + } + get keywordSeparator() { + return this.matcher.keywordSeparator; + } + get minKeywordLength() { + return this.matcher.minKeywordLength; + } + get strictMatchLocales() { + return this.matcher.strictMatchLocales; + } + get data() { + return this.matcher.data; + } +} +class D { constructor(t = { apiKey: "" }) { - h(this, "apiKey"); - h(this, "apiKeyHeaderName", "X-Secret-Key"); - h(this, "getEndpoint"); - h(this, "handleResponse"); + l(this, "apiKey"); + l(this, "apiKeyHeaderName", "X-Secret-Key"); + l(this, "getEndpoint"); + l(this, "handleResponse"); this.apiKey = t.apiKey, t.apiKeyHeaderName && (this.apiKeyHeaderName = t.apiKeyHeaderName), typeof t.getEndpoint == "function" ? this.getEndpoint = t.getEndpoint : this.getEndpoint = (e) => `/input_completion/${e}/`, typeof t.handleResponse == "function" ? this.handleResponse = t.handleResponse : this.handleResponse = (e) => { if ("user_says" in e && Array.isArray(e.user_says)) return e.user_says; @@ -151,50 +310,50 @@ class M { */ fetch(t) { const e = this.getEndpoint(t); - return new Promise(async (n, a) => { + return new Promise(async (o, s) => { try { - const s = await this._fetch(e); + const a = await this._fetch(e); try { - const r = this.handleResponse(s); - n(r); + const n = this.handleResponse(a); + o(n); } catch { - a(`Invalid data fetched. ${JSON.stringify(s)}`); + s(`Invalid data fetched. ${JSON.stringify(a)}`); } - "user_says" in s && Array.isArray(s.user_says); - } catch (s) { - a(`Failed to fetch data from ${e}.`), console.error(s); + "user_says" in a && Array.isArray(a.user_says); + } catch (a) { + s(`Failed to fetch data from ${e}.`), console.error(a); } }); } _fetch(t) { - return new Promise(async (e, n) => { + return new Promise(async (e, o) => { if (this.isFetchAvailable()) { - const a = {}; + const s = {}; if (this.apiKey) { - const r = {}; - r[this.apiKeyHeaderName] = this.apiKey, a.headers = r; + const n = {}; + n[this.apiKeyHeaderName] = this.apiKey, s.headers = n; } - const s = await fetch(t, a); - if (s.ok && s.status == 200) { - const r = await s.json(); - e(r); + const a = await fetch(t, s); + if (a.ok && a.status == 200) { + const n = await a.json(); + e(n); } else - n(`Failed to fetch data. Status: ${s.status}`); + o(`Failed to fetch data. Status: ${a.status}`); } else { - const a = new XMLHttpRequest(); - a.open("GET", t), this.apiKey && a.setRequestHeader(this.apiKeyHeaderName, this.apiKey), a.onload = () => { - if (a.status === 200) + const s = new XMLHttpRequest(); + s.open("GET", t), this.apiKey && s.setRequestHeader(this.apiKeyHeaderName, this.apiKey), s.onload = () => { + if (s.status === 200) try { - const s = JSON.parse(a.response); - e(s); + const a = JSON.parse(s.response); + e(a); } catch { - n("Invalid response data format."); + o("Invalid response data format."); } else - n(`Failed to fetch data. Status: ${a.status}`); - }, a.onerror = () => { - n("Unknown error occurred while fetching completion data."); - }, a.send(); + o(`Failed to fetch data. Status: ${s.status}`); + }, s.onerror = () => { + o("Unknown error occurred while fetching completion data."); + }, s.send(); } }); } @@ -203,6 +362,12 @@ class M { } } export { - M as Fetcher, - L as Generator + E as ConcatMatcher, + A as DefaultMatcher, + D as Fetcher, + M as ForwardMatcher, + _ as Generator, + O as KeywordForwardMatcher, + R as KeywordMatcher, + g as Matcher }; diff --git a/package-lock.json b/package-lock.json index 51052e5..348234f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "jsdom": "^22.1.0", "tslib": "^2.6.2", "vite": "^4.4.5", + "vite-plugin-dts": "^3.9.1", "vitest": "^0.33.0" } }, @@ -31,6 +32,18 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/parser": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", + "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -468,6 +481,84 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@microsoft/api-extractor": { + "version": "7.43.0", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.43.0.tgz", + "integrity": "sha512-GFhTcJpB+MI6FhvXEI9b2K0snulNLWHqC/BbcJtyNYcKUiw7l3Lgis5ApsYncJ0leALX7/of4XfmXk+maT111w==", + "dev": true, + "dependencies": { + "@microsoft/api-extractor-model": "7.28.13", + "@microsoft/tsdoc": "0.14.2", + "@microsoft/tsdoc-config": "~0.16.1", + "@rushstack/node-core-library": "4.0.2", + "@rushstack/rig-package": "0.5.2", + "@rushstack/terminal": "0.10.0", + "@rushstack/ts-command-line": "4.19.1", + "lodash": "~4.17.15", + "minimatch": "~3.0.3", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "source-map": "~0.6.1", + "typescript": "5.4.2" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.28.13", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.28.13.tgz", + "integrity": "sha512-39v/JyldX4MS9uzHcdfmjjfS6cYGAoXV+io8B5a338pkHiSt+gy2eXQ0Q7cGFJ7quSa1VqqlMdlPrB6sLR/cAw==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.14.2", + "@microsoft/tsdoc-config": "~0.16.1", + "@rushstack/node-core-library": "4.0.2" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/minimatch": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.8.tgz", + "integrity": "sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.14.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", + "integrity": "sha512-9b8mPpKrfeGRuhFH5iO1iwCLeIIsV6+H1sRfxbkoGXIyQE2BTsPd9zqSqQJ+pv5sJ/hT5M1zvOFL02MnEezFug==", + "dev": true + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.16.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.16.2.tgz", + "integrity": "sha512-OGiIzzoBLgWWR0UdRJX98oYO+XKGf7tiK4Zk6tQ/E4IJqGCe7dvkTvgDZV5cFJUzLGDOjeAXrnZoA6QkVySuxw==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.14.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@rollup/plugin-terser": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", @@ -517,9 +608,9 @@ } }, "node_modules/@rollup/pluginutils": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.0.4.tgz", - "integrity": "sha512-0KJnIoRI8A+a1dqOYLxH8vBf8bphDmty5QvIm2hqm7oFCFYKCAZWWd2hXgMibaPsNDhI0AtpYfQZJG47pt/k4g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.1.0.tgz", + "integrity": "sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==", "dev": true, "dependencies": { "@types/estree": "^1.0.0", @@ -530,7 +621,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^1.20.0||^2.0.0||^3.0.0" + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -538,6 +629,83 @@ } } }, + "node_modules/@rushstack/node-core-library": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz", + "integrity": "sha512-hyES82QVpkfQMeBMteQUnrhASL/KHPhd7iJ8euduwNJG4mu2GSOKybf0rOEjOm1Wz7CwJEUm9y0yD7jg2C1bfg==", + "dev": true, + "dependencies": { + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.22.1", + "semver": "~7.5.4", + "z-schema": "~5.0.2" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/rig-package": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.2.tgz", + "integrity": "sha512-mUDecIJeH3yYGZs2a48k+pbhM6JYwWlgjs2Ca5f2n1G2/kgdgP9D/07oglEGf6mRyXEnazhEENeYTSNDRCwdqA==", + "dev": true, + "dependencies": { + "resolve": "~1.22.1", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/terminal": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@rushstack/terminal/-/terminal-0.10.0.tgz", + "integrity": "sha512-UbELbXnUdc7EKwfH2sb8ChqNgapUOdqcCIdQP4NGxBpTZV2sQyeekuK3zmfQSa/MN+/7b4kBogl2wq0vpkpYGw==", + "dev": true, + "dependencies": { + "@rushstack/node-core-library": "4.0.2", + "supports-color": "~8.1.1" + }, + "peerDependencies": { + "@types/node": "*" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/@rushstack/terminal/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/@rushstack/ts-command-line": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.19.1.tgz", + "integrity": "sha512-J7H768dgcpG60d7skZ5uSSwyCZs/S2HrWP1Ds8d1qYAyaaeJmpmmLr9BVw97RjFzmQPOYnoXcKA4GkqDCkduQg==", + "dev": true, + "dependencies": { + "@rushstack/terminal": "0.10.0", + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "string-argv": "~0.3.1" + } + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -553,6 +721,12 @@ "node": ">= 10" } }, + "node_modules/@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true + }, "node_modules/@types/chai": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", @@ -679,6 +853,112 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/@volar/language-core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", + "integrity": "sha512-dOcNn3i9GgZAcJt43wuaEykSluAuOkQgzni1cuxLxTV0nJKanQztp7FxyswdRILaKH+P2XZMPRp2S4MV/pElCw==", + "dev": true, + "dependencies": { + "@volar/source-map": "1.11.1" + } + }, + "node_modules/@volar/source-map": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/source-map/-/source-map-1.11.1.tgz", + "integrity": "sha512-hJnOnwZ4+WT5iupLRnuzbULZ42L7BWWPMmruzwtLhJfpDVoZLjNBxHDi2sY2bgZXCKlpU5XcsMFoYrsQmPhfZg==", + "dev": true, + "dependencies": { + "muggle-string": "^0.3.1" + } + }, + "node_modules/@volar/typescript": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@volar/typescript/-/typescript-1.11.1.tgz", + "integrity": "sha512-iU+t2mas/4lYierSnoFOeRFQUhAEMgsFuQxoxvwn5EdQopw43j+J27a4lt9LMInx1gLJBC6qL14WYGlgymaSMQ==", + "dev": true, + "dependencies": { + "@volar/language-core": "1.11.1", + "path-browserify": "^1.0.1" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.4.27", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.27.tgz", + "integrity": "sha512-E+RyqY24KnyDXsCuQrI+mlcdW3ALND6U7Gqa/+bVwbcpcR3BRRIckFoz7Qyd4TTlnugtwuI7YgjbvsLmxb+yvg==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@vue/shared": "3.4.27", + "entities": "^4.5.0", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.0" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.4.27", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.27.tgz", + "integrity": "sha512-kUTvochG/oVgE1w5ViSr3KUBh9X7CWirebA3bezTbB5ZKBQZwR2Mwj9uoSKRMFcz4gSMzzLXBPD6KpCLb9nvWw==", + "dev": true, + "dependencies": { + "@vue/compiler-core": "3.4.27", + "@vue/shared": "3.4.27" + } + }, + "node_modules/@vue/language-core": { + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/@vue/language-core/-/language-core-1.8.27.tgz", + "integrity": "sha512-L8Kc27VdQserNaCUNiSFdDl9LWT24ly8Hpwf1ECy3aFb9m6bDhBGQYOujDm21N7EW3moKIOKEanQwe1q5BK+mA==", + "dev": true, + "dependencies": { + "@volar/language-core": "~1.11.1", + "@volar/source-map": "~1.11.1", + "@vue/compiler-dom": "^3.3.0", + "@vue/shared": "^3.3.0", + "computeds": "^0.0.1", + "minimatch": "^9.0.3", + "muggle-string": "^0.3.1", + "path-browserify": "^1.0.1", + "vue-template-compiler": "^2.7.14" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@vue/language-core/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@vue/language-core/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@vue/shared": { + "version": "3.4.27", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.27.tgz", + "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==", + "dev": true + }, "node_modules/abab": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", @@ -718,6 +998,22 @@ "node": ">= 6.0.0" } }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-styles": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", @@ -730,6 +1026,15 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", @@ -821,6 +1126,12 @@ "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, + "node_modules/computeds": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/computeds/-/computeds-0.0.1.tgz", + "integrity": "sha512-7CEBgcMjVmitjYo5q8JTJVra6X5mQ20uTThdK+0kR7UEaDrAWEQcRiBtWJzga4eRpP6afNwwLsX2SET2JhVB1Q==", + "dev": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -859,6 +1170,12 @@ "node": ">=14" } }, + "node_modules/de-indent": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", + "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", + "dev": true + }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -979,6 +1296,18 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, "node_modules/form-data": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", @@ -993,6 +1322,29 @@ "node": ">= 6" } }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-extra/node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "engines": { + "node": ">= 4.0.0" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -1048,6 +1400,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -1069,6 +1427,15 @@ "node": ">=8" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -1126,6 +1493,15 @@ "node": ">=0.10.0" } }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1210,6 +1586,12 @@ "node": ">=8" } }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", + "dev": true + }, "node_modules/jsdom": { "version": "22.1.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", @@ -1252,12 +1634,33 @@ } } }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "node_modules/jsonc-parser": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", "dev": true }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/kolorist": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.8.0.tgz", + "integrity": "sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==", + "dev": true + }, "node_modules/local-pkg": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", @@ -1270,6 +1673,24 @@ "url": "https://github.com/sponsors/antfu" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", + "dev": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true + }, "node_modules/loupe": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", @@ -1292,15 +1713,12 @@ } }, "node_modules/magic-string": { - "version": "0.30.3", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.3.tgz", - "integrity": "sha512-B7xGbll2fG/VjP+SWg4sX3JynwIU0mjoTc6MPpKNuIvftk6u6vqhDnk1R80b8C2GBR6ywqy+1DcKBrevBg+bmw==", + "version": "0.30.10", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", + "integrity": "sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==", "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" - }, - "engines": { - "node": ">=12" } }, "node_modules/make-dir": { @@ -1369,6 +1787,12 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, + "node_modules/muggle-string": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/muggle-string/-/muggle-string-0.3.1.tgz", + "integrity": "sha512-ckmWDJjphvd/FvZawgygcUeQCxzvohjFO5RxTjj4eq8kw359gFF3E1brjfI+viLMxss5JrHTDRHZvu2/tuy0Qg==", + "dev": true + }, "node_modules/nanoid": { "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", @@ -1429,6 +1853,12 @@ "url": "https://github.com/inikulin/parse5?sponsor=1" } }, + "node_modules/path-browserify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", + "dev": true + }, "node_modules/path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -1695,9 +2125,9 @@ } }, "node_modules/source-map-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", - "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.0.tgz", + "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -1713,6 +2143,12 @@ "source-map": "^0.6.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -1725,6 +2161,27 @@ "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", "dev": true }, + "node_modules/string-argv": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", + "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-literal": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", @@ -1866,11 +2323,10 @@ } }, "node_modules/typescript": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", - "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", "dev": true, - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1894,6 +2350,15 @@ "node": ">= 4.0.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-parse": { "version": "1.5.10", "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", @@ -1918,6 +2383,15 @@ "node": ">=10.12.0" } }, + "node_modules/validator": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/vite": { "version": "4.4.9", "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", @@ -1996,6 +2470,33 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/vite-plugin-dts": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/vite-plugin-dts/-/vite-plugin-dts-3.9.1.tgz", + "integrity": "sha512-rVp2KM9Ue22NGWB8dNtWEr+KekN3rIgz1tWD050QnRGlriUCmaDwa7qA5zDEjbXg5lAXhYMSBJtx3q3hQIJZSg==", + "dev": true, + "dependencies": { + "@microsoft/api-extractor": "7.43.0", + "@rollup/pluginutils": "^5.1.0", + "@vue/language-core": "^1.8.27", + "debug": "^4.3.4", + "kolorist": "^1.8.0", + "magic-string": "^0.30.8", + "vue-tsc": "^1.8.27" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "peerDependencies": { + "typescript": "*", + "vite": "*" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, "node_modules/vitest": { "version": "0.33.0", "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.33.0.tgz", @@ -2073,6 +2574,33 @@ } } }, + "node_modules/vue-template-compiler": { + "version": "2.7.16", + "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", + "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", + "dev": true, + "dependencies": { + "de-indent": "^1.0.2", + "he": "^1.2.0" + } + }, + "node_modules/vue-tsc": { + "version": "1.8.27", + "resolved": "https://registry.npmjs.org/vue-tsc/-/vue-tsc-1.8.27.tgz", + "integrity": "sha512-WesKCAZCRAbmmhuGl3+VrdWItEvfoFIPXOvUJkjULi+x+6G/Dy69yO3TBRJDr9eUlmsNAwVmxsNZxvHKzbkKdg==", + "dev": true, + "dependencies": { + "@volar/typescript": "~1.11.1", + "@vue/language-core": "1.8.27", + "semver": "^7.5.4" + }, + "bin": { + "vue-tsc": "bin/vue-tsc.js" + }, + "peerDependencies": { + "typescript": "*" + } + }, "node_modules/w3c-xmlserializer": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", @@ -2203,6 +2731,36 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/z-schema": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz", + "integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==", + "dev": true, + "dependencies": { + "lodash.get": "^4.4.2", + "lodash.isequal": "^4.5.0", + "validator": "^13.7.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "engines": { + "node": ">=8.0.0" + }, + "optionalDependencies": { + "commander": "^9.4.1" + } + }, + "node_modules/z-schema/node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "optional": true, + "engines": { + "node": "^12.20.0 || >=14" + } } } } diff --git a/package.json b/package.json index e7b0463..c414cfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@obot-ai/completion-generator", - "version": "1.0.0", + "version": "1.1.0-preview.1", "description": "A completion generator for ObotAI InputCompletion.", "type": "module", "files": [ @@ -23,6 +23,7 @@ "scripts": { "test": "vitest run", "coverage": "vitest --coverage", + "start": "vite", "dev": "vite build --watch", "dev:es5": "rollup --config rollup.config.mjs --watch", "build": "tsc && vite build && rollup --config rollup.config.mjs --environment BUILD:production" @@ -34,6 +35,7 @@ "jsdom": "^22.1.0", "tslib": "^2.6.2", "vite": "^4.4.5", + "vite-plugin-dts": "^3.9.1", "vitest": "^0.33.0" }, "license": "MIT" diff --git a/src/fetcher.ts b/src/fetcher.ts new file mode 100644 index 0000000..499bcb9 --- /dev/null +++ b/src/fetcher.ts @@ -0,0 +1,109 @@ +import type { + LocaleDataItem, + GetEndpoint, HandleResponse,CompletionFetcherProperties +} from './types' + + +export class Fetcher { + apiKey: string + apiKeyHeaderName: string = "X-Secret-Key" + getEndpoint: GetEndpoint + handleResponse: HandleResponse + + constructor(properties: CompletionFetcherProperties = { apiKey: "" }) { + this.apiKey = properties.apiKey + if (properties.apiKeyHeaderName) { + this.apiKeyHeaderName = properties.apiKeyHeaderName + } + if (typeof properties.getEndpoint === 'function') { + this.getEndpoint = properties.getEndpoint + } else { + this.getEndpoint = (locale: string) => { + return `/input_completion/${locale}/` + } + } + if (typeof properties.handleResponse === 'function') { + this.handleResponse = properties.handleResponse + } else { + this.handleResponse = (data) => { + if ('user_says' in data && Array.isArray(data.user_says)) { + return data.user_says as LocaleDataItem[] + } + throw Error("Data should have [user_says](Array)") + } + } + } + + /** + * 指定エンドポイントから候補データを取得 + * @param locale 言語コード + * @returns + */ + fetch(locale: string): Promise { + const endpoint = this.getEndpoint(locale) + + return new Promise(async (resolve, reject) => { + try { + const resData = await this._fetch(endpoint) + try { + const handled = this.handleResponse(resData) + resolve(handled) + } catch (e) { + reject(`Invalid data fetched. ${JSON.stringify(resData)}`) + } + if ('user_says' in resData && Array.isArray(resData.user_says)) { + + } + } catch (e) { + reject(`Failed to fetch data from ${endpoint}.`) + console.error(e) + } + }) + } + + _fetch(endpoint: string): Promise { + return new Promise(async (resolve, reject) => { + if (this.isFetchAvailable()) { + const fetchOptions: RequestInit = {} + if (this.apiKey) { + const headers: HeadersInit = {} + headers[this.apiKeyHeaderName] = this.apiKey + fetchOptions.headers = headers + } + const res = await fetch(endpoint, fetchOptions) + if (res.ok && res.status == 200) { + const resData = await res.json() + resolve(resData) + } else { + reject(`Failed to fetch data. Status: ${res.status}`) + } + } else { + const xhr = new XMLHttpRequest() + xhr.open('GET', endpoint) + if (this.apiKey) { + xhr.setRequestHeader(this.apiKeyHeaderName, this.apiKey) + } + xhr.onload = () => { + if (xhr.status === 200) { + try { + const resData = JSON.parse(xhr.response) + resolve(resData) + } catch(e) { + reject("Invalid response data format.") + } + } else { + reject(`Failed to fetch data. Status: ${xhr.status}`) + } + } + xhr.onerror = () => { + reject("Unknown error occurred while fetching completion data.") + } + xhr.send() + } + }) + } + + isFetchAvailable() { + return typeof window.fetch === 'function' + } +} diff --git a/src/generator.ts b/src/generator.ts new file mode 100644 index 0000000..6f6893f --- /dev/null +++ b/src/generator.ts @@ -0,0 +1,74 @@ +import type { + MatchedResultData, + LocaleDataItem, + CompletionGeneratorProperties +} from './types' + +import { Matcher, DefaultMatcher } from './matcher' + + +export class Generator { + matcher: Matcher + + constructor(properties: CompletionGeneratorProperties = { keywordSeparator: ",", minKeywordLength: 2, strictMatchLocales: ["en"] }) { + if (properties.matcher) { + this.matcher = properties.matcher + } else { + this.matcher = new DefaultMatcher({ + keywordSeparator: properties.keywordSeparator || ",", + minKeywordLength: properties.minKeywordLength || 2, + strictMatchLocales: properties.strictMatchLocales || ["en"], + comparator: properties.comparator, + filter: properties.filter + }) + } + } + + /** + * 候補データをインスタンスにセットする + * @param locale 言語コード + * @param localeData 言語データ + */ + loadData (locale: string, localeData: LocaleDataItem[]) { + this._validateLocaleData(localeData) + this.matcher.loadData(locale, localeData) + } + + _validateLocaleData(localeData: LocaleDataItem[]) { + if ( + !(Array.isArray(localeData) && + localeData.every(ld => (typeof ld.text === 'string' && typeof ld.keywords === 'string')))) + { + throw Error("Locale data should be a list of {text: string, keywords: string}") + } + } + + /** + * 指定入力テキストと言語に対し、補完データを生成して返す + * @param input 入力テキスト + * @param locale 言語コード + * @returns 補完データ + */ + generateCompletions(input: string, locale: string): MatchedResultData[] { + if (!input || input.length <= 0) { + return [] + } + return this.matcher.match(input, locale) + } + + get keywordSeparator() { + return this.matcher.keywordSeparator + } + + get minKeywordLength() { + return this.matcher.minKeywordLength + } + + get strictMatchLocales() { + return this.matcher.strictMatchLocales + } + + get data() { + return this.matcher.data + } +} diff --git a/src/index.ts b/src/index.ts index 53bc0ee..59419a2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,396 +1,12 @@ -export type LocaleDataItem = { - text: string; - keywords: string; -} - -export type MatchedResult = { - isMatched: boolean; - data?: MatchedResultData; -} - -export type MatchedResultData = { - text: string; - keywords: string; - matchedKeywords?: MatchedKeyword[]; -} - -export type MatchedKeyword = { - text: string; - startAt: number; - endAt: number; -} - -export type CompletionGeneratorProperties = { - keywordSeparator: string; - minKeywordLength: number; - strictMatchLocales: string[]; - comparator?: LocaleDataComparator; - filter?: LocaleDateFilter; -} -export type LocaleDataComparator = (itemA: LocaleDataItem, itemB: LocaleDataItem, input: string, locale: string) => number -export type LocaleDateFilter = (localeData: LocaleDataItem[], input: string, locale: string) => MatchedResultData[] - -export interface CompletionGeneratorInter { - /** キーワードの分割文字 */ - keywordSeparator: string - /** キーワードとして認定する最短長さ */ - minKeywordLength: number - /** _strictMatchを使う言語コード設定 */ - strictMatchLocales: string[] - /** ソート用メソッド */ - comparator?: LocaleDataComparator - /** 絞り込み用メソッド */ - filter?: LocaleDateFilter - data: Map; - - loadData: (locale: string, localeData: LocaleDataItem[]) => void; - generateCompletions: (input: string, locale: string) => MatchedResultData[]; -} - -export class Generator implements CompletionGeneratorInter{ - keywordSeparator: string - minKeywordLength: number - strictMatchLocales: string[] - comparator?: LocaleDataComparator - filter?: LocaleDateFilter - data: Map - - constructor(properties: CompletionGeneratorProperties = { keywordSeparator: ",", minKeywordLength: 2, strictMatchLocales: ["en"] }) { - this.keywordSeparator = properties.keywordSeparator || "," - this.minKeywordLength = properties.minKeywordLength || 2 - this.data = new Map() - this.strictMatchLocales = properties.strictMatchLocales || ["en"] - - if (typeof properties.comparator === 'function') { - this.comparator = properties.comparator - } - - if (typeof properties.filter === 'function') { - this.filter = properties.filter - } - } - - /** - * 候補データをインスタンスにセットする - * @param locale 言語コード - * @param localeData 言語データ - */ - loadData (locale: string, localeData: LocaleDataItem[]) { - this._validateLocaleData(localeData) - this.data.set(locale, localeData) - } - - _validateLocaleData(localeData: LocaleDataItem[]) { - if ( - !(Array.isArray(localeData) && - localeData.every(ld => (typeof ld.text === 'string' && typeof ld.keywords === 'string')))) - { - throw Error("Locale data should be a list of {text: string, keywords: string}") - } - } - - /** - * 指定入力テキストと言語に対し、補完データを生成して返す - * @param input 入力テキスト - * @param locale 言語コード - * @returns 補完データ - */ - generateCompletions(input: string, locale: string): MatchedResultData[] { - if (!input || input.length <= 0) { - return [] - } - - const localeDataOrigin = this.data.get(locale) - if (!localeDataOrigin) { - return [] - } - - let localeData = Array.from(localeDataOrigin) - - if (this.comparator) { - const comparator = this.comparator - localeData.sort((itemA, itemB) => { - return comparator(itemA, itemB, input, locale) - }) - } - - if (this.filter) { - const filter = this.filter - return filter(localeData, input, locale) - } - - return this._getMatchedCompletions(localeData, input, locale) - } - - _getMatchedCompletions(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[] { - const doStrictMatch = this.strictMatchLocales.indexOf(locale) !== -1 - - const results: MatchedResultData[] = [] - localeData.forEach(item => { - let checkResult = null - if (doStrictMatch) { - checkResult = this._strictMatch(item, input.toLowerCase()) - } else { - checkResult = this._match(item, input.toLowerCase()) - } - if (checkResult.isMatched && checkResult.data) { - results.push(checkResult.data) - } - }) - return results - } - - _match(dataItem: LocaleDataItem, input: string): MatchedResult { - // 候補データの質問内容とキーワード - const text = dataItem.text.toLowerCase() - const keywords = dataItem.keywords.toLowerCase() - - const inputLength = input.length - const matchedKeywords: MatchedKeyword[] = [] - - let startAt = 0 // マッチキーワードの開始位置 - while(startAt < inputLength) { - let matchedKeyword = '' - let word = input[startAt] - - if (keywords.indexOf(word) !== -1) { - let endAt = startAt - matchedKeyword = word - if (endAt < inputLength - 1) { - // 次にまだ文字がある場合 - - endAt += 1 - // 最長のマッチできるキーワードを探し出す - while (endAt < inputLength) { - const checkWord = matchedKeyword + input[endAt] - if (keywords.indexOf(checkWord) === -1) { - endAt -= 1 - break - } - matchedKeyword = checkWord - endAt += 1 - } - } - - if (matchedKeyword.length >= this.minKeywordLength) { - // マッチしたキーワードの長さは指定値以上の場合のみ、キーワードとして受け入れる - matchedKeywords.push({ - text: matchedKeyword, - startAt: startAt, - endAt: endAt - }) - } - - startAt = endAt + 1 - } else if (text.indexOf(word) === -1) { - // 質問にもキーワードにも存在しない文字があれば、そのinputのマッチが外れとする - return { isMatched: false } - } else { - startAt += 1 - } - } - - const unmatchedParts: string[] = [] - - let keywordIdx = 0 - let prevKeyword: MatchedKeyword | null = null - let currentKeyword: MatchedKeyword | null = null - while (keywordIdx < matchedKeywords.length) { - currentKeyword = matchedKeywords[keywordIdx] - let prevEndAt = prevKeyword?.endAt || 0 - let startAt = currentKeyword.startAt - - if (startAt > prevEndAt) { - unmatchedParts.push(input.slice(prevEndAt + 1, startAt)) - } - - prevKeyword = currentKeyword - keywordIdx += 1 - } - if (keywordIdx === 0) { - unmatchedParts.push(input) - } else if (currentKeyword) { - const lastEndAt = currentKeyword.endAt - if (lastEndAt + 1 < inputLength) { - unmatchedParts.push(input.slice(lastEndAt + 1, inputLength)) - } - } - - const isMatched = unmatchedParts.every(word => text.indexOf(word) !== -1) - - return { - isMatched, - data: { - text: dataItem.text, - keywords: dataItem.keywords, - matchedKeywords - } - } - } - - _strictMatch(dataItem: LocaleDataItem, input: string): MatchedResult { - // 候補データの質問内容とキーワード - const text = dataItem.text.toLowerCase() - // 英語などのスペース区切りの言語は、単語ごとにマッチする - // NOTE: なるべくマッチしやすいよう、複数の単語でできたキーワードも分割して、一単語でもマッチ成功と見なす - const keywords: string[] = [] - dataItem.keywords.toLowerCase().split(this.keywordSeparator).forEach(kparts => { - kparts.split(" ").forEach(kp => { - keywords.push(kp) - }) - }) - - const inputs = input.split(" ") - // NOTE: inputがないパターンは既に除外済みで、必ず string になるので、 `as string` を使う - const lastInputPart = inputs.pop() as string - - // 最後の単語だけは入力途中なので、部分一致でマッチ - const lastInputMatched = text.indexOf(lastInputPart) !== -1 || keywords.some(kw => kw.indexOf(lastInputPart) !== -1) - if (!lastInputMatched) { - return { isMatched: false } - } - - const matchedKeywords: MatchedKeyword[] = inputs.filter(ipt => keywords.indexOf(ipt) !== -1).map( - kw => { - const startAt = input.indexOf(kw) - const endAt = startAt + kw.length - return { - text: kw, - startAt: startAt, - endAt - } - } - ) - - const unmatchedParts = inputs.filter(ipt => keywords.indexOf(ipt) === -1) - const isMatched = unmatchedParts.every(word => text.indexOf(word) !== -1) - - return { - isMatched, data: { - text: dataItem.text, - keywords: dataItem.keywords, - matchedKeywords - } - } - } -} - - -export type CompletionFetcherProperties = { - apiKey: string; - apiKeyHeaderName?: string; - getEndpoint?: GetEndpoint; - handleResponse?: HandleResponse -} -export type GetEndpoint = (locale: string) => string -export type HandleResponse = (data: any) => LocaleDataItem[] - -export interface CompletionFetcherInter { - apiKey: string; - - fetch(locale: string): Promise -} - -export class Fetcher implements CompletionFetcherInter { - apiKey: string - apiKeyHeaderName: string = "X-Secret-Key" - getEndpoint: GetEndpoint - handleResponse: HandleResponse - - constructor(properties: CompletionFetcherProperties = { apiKey: "" }) { - this.apiKey = properties.apiKey - if (properties.apiKeyHeaderName) { - this.apiKeyHeaderName = properties.apiKeyHeaderName - } - if (typeof properties.getEndpoint === 'function') { - this.getEndpoint = properties.getEndpoint - } else { - this.getEndpoint = (locale: string) => { - return `/input_completion/${locale}/` - } - } - if (typeof properties.handleResponse === 'function') { - this.handleResponse = properties.handleResponse - } else { - this.handleResponse = (data) => { - if ('user_says' in data && Array.isArray(data.user_says)) { - return data.user_says as LocaleDataItem[] - } - throw Error("Data should have [user_says](Array)") - } - } - } - - /** - * 指定エンドポイントから候補データを取得 - * @param locale 言語コード - * @returns - */ - fetch(locale: string): Promise { - const endpoint = this.getEndpoint(locale) - - return new Promise(async (resolve, reject) => { - try { - const resData = await this._fetch(endpoint) - try { - const handled = this.handleResponse(resData) - resolve(handled) - } catch (e) { - reject(`Invalid data fetched. ${JSON.stringify(resData)}`) - } - if ('user_says' in resData && Array.isArray(resData.user_says)) { - - } - } catch (e) { - reject(`Failed to fetch data from ${endpoint}.`) - console.error(e) - } - }) - } - - _fetch(endpoint: string): Promise { - return new Promise(async (resolve, reject) => { - if (this.isFetchAvailable()) { - const fetchOptions: RequestInit = {} - if (this.apiKey) { - const headers: HeadersInit = {} - headers[this.apiKeyHeaderName] = this.apiKey - fetchOptions.headers = headers - } - const res = await fetch(endpoint, fetchOptions) - if (res.ok && res.status == 200) { - const resData = await res.json() - resolve(resData) - } else { - reject(`Failed to fetch data. Status: ${res.status}`) - } - } else { - const xhr = new XMLHttpRequest() - xhr.open('GET', endpoint) - if (this.apiKey) { - xhr.setRequestHeader(this.apiKeyHeaderName, this.apiKey) - } - xhr.onload = () => { - if (xhr.status === 200) { - try { - const resData = JSON.parse(xhr.response) - resolve(resData) - } catch(e) { - reject("Invalid response data format.") - } - } else { - reject(`Failed to fetch data. Status: ${xhr.status}`) - } - } - xhr.onerror = () => { - reject("Unknown error occurred while fetching completion data.") - } - xhr.send() - } - }) - } - - isFetchAvailable() { - return typeof window.fetch === 'function' - } -} +export * from "./types"; + +export { Generator } from "./generator"; +export { Fetcher } from "./fetcher"; +export { + Matcher, + DefaultMatcher, + ForwardMatcher, + KeywordMatcher, + ConcatMatcher, + KeywordForwardMatcher +} from "./matcher" diff --git a/src/matcher.ts b/src/matcher.ts new file mode 100644 index 0000000..ad386d0 --- /dev/null +++ b/src/matcher.ts @@ -0,0 +1,422 @@ +import type { + MatchedResultData, + LocaleDataItem, MatchedResult, MatchedKeyword, + LocaleDataComparator, LocaleDateFilter, + CompletionMatcherProperties +} from "./types" +import { range } from "./utils" + + +export interface MatcherInters { + loadData(locale: string, localeData: LocaleDataItem[]): void; + match(input: string, locale: string): MatchedResultData[]; +} + +export class Matcher { + keywordSeparator: string; + minKeywordLength: number; + strictMatchLocales: string[]; + comparator?: LocaleDataComparator; + filter?: LocaleDateFilter; + data: Map; + maxResults?: number + + constructor( + properties: CompletionMatcherProperties = {} + ) { + this.keywordSeparator = properties.keywordSeparator || "," + this.minKeywordLength = properties.minKeywordLength || 2 + this.strictMatchLocales = properties.strictMatchLocales || ["en"] + if (properties.maxResults) { + this.maxResults = properties.maxResults + } + if (typeof properties.comparator === 'function') { + this.comparator = properties.comparator + } + if (typeof properties.filter === 'function') { + this.filter = properties.filter + } + this.data = new Map(); + } + + /** + * 候補データをインスタンスにセットする + * @param locale 言語コード + * @param localeData 言語データ + */ + loadData (locale: string, localeData: LocaleDataItem[]) { + this.data.set(locale, localeData) + } + + // @ts-ignore + match(input: string, locale: string): MatchedResultData[] { + return [] + } +} + +/** + * 入力文を前方一致でマッチするMatcher + */ +export class ForwardMatcher extends Matcher { + + match(input: string, locale: string): MatchedResultData[] { + const localeDataOrigin = this.data.get(locale) + + if (!localeDataOrigin) { + return [] + } + + let localeData = Array.from(localeDataOrigin) + + if (this.comparator) { + const comparator = this.comparator + localeData.sort((itemA, itemB) => { + return comparator(itemA, itemB, input, locale) + }) + } + + if (this.filter) { + const filter = this.filter + return filter(localeData, input, locale) + } + + return this._match(localeData, input.toLowerCase(), locale) + } + + _match(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[] { + // スペースで単語を区切る言語は、単語ごとにマッチ、そうでない場合は文字ごとにマッチ + const doStrictMatch = this.strictMatchLocales.indexOf(locale) !== -1 + + const results: MatchedResultData[] = [] + if (localeData) { + for (const item of localeData) { + let checkResult: MatchedResult + if (doStrictMatch) { + checkResult = this._wordMatch(item, input) + } else { + checkResult = this._charMatch(item, input) + } + + if (checkResult.isMatched && checkResult.data) { + results.push(checkResult.data) + } + + if (this.maxResults && results.length >= this.maxResults) { + break + } + } + } + return results + } + + _charMatch(dataItem: LocaleDataItem, input: string) { + const text = dataItem.text.toLowerCase() + const keywords = dataItem.keywords.toLowerCase() + const minKeywordLength = this.minKeywordLength || 2 + + const inputLength = input.length + const matchedKeywords: MatchedKeyword[] = [] + + let startAt = 0 // マッチキーワードの開始位置 + while(startAt < inputLength) { + let matchedKeyword = '' + let word = input[startAt] + + if (keywords.indexOf(word) !== -1) { + let endAt = startAt + matchedKeyword = word + if (endAt < inputLength - 1) { + // 次にまだ文字がある場合 + + endAt += 1 + // 最長のマッチできるキーワードを探し出す + while (endAt < inputLength) { + const checkWord = matchedKeyword + input[endAt] + if (keywords.indexOf(checkWord) === -1) { + endAt -= 1 + break + } + matchedKeyword = checkWord + endAt += 1 + } + } + + if (matchedKeyword.length >= minKeywordLength) { + // マッチしたキーワードの長さは指定値以上の場合のみ、キーワードとして受け入れる + matchedKeywords.push({ + text: matchedKeyword, + startAt: startAt, + endAt: endAt + }) + } + + startAt = endAt + 1 + } else if (text.indexOf(word) === -1) { + // 質問にもキーワードにも存在しない文字があれば、そのinputのマッチが外れとする + return { isMatched: false } + } else { + startAt += 1 + } + } + + const unmatchedParts: string[] = [] + + let keywordIdx = 0 + let prevKeyword: MatchedKeyword | null = null + let currentKeyword: MatchedKeyword | null = null + while (keywordIdx < matchedKeywords.length) { + currentKeyword = matchedKeywords[keywordIdx] + let prevEndAt = prevKeyword?.endAt || 0 + let startAt = currentKeyword.startAt + + if (startAt > prevEndAt) { + unmatchedParts.push(input.slice(prevEndAt + 1, startAt)) + } + + prevKeyword = currentKeyword + keywordIdx += 1 + } + if (keywordIdx === 0) { + unmatchedParts.push(input) + } else if (currentKeyword) { + const lastEndAt = currentKeyword.endAt + if (lastEndAt + 1 < inputLength) { + unmatchedParts.push(input.slice(lastEndAt + 1, inputLength)) + } + } + + const isMatched = unmatchedParts.every(word => text.indexOf(word) !== -1) + + return { + isMatched, + data: { + text: dataItem.text, + keywords: dataItem.keywords, + matchedKeywords + } + } + } + + _wordMatch(dataItem: LocaleDataItem, input: string) { + // 候補データの質問内容とキーワード + const text = dataItem.text.toLowerCase() + const keywordSeparator = this.keywordSeparator || ',' + // 英語などのスペース区切りの言語は、単語ごとにマッチする + // NOTE: なるべくマッチしやすいよう、複数の単語でできたキーワードも分割して、一単語でもマッチ成功と見なす + const keywords: string[] = [] + dataItem.keywords.toLowerCase().split(keywordSeparator).forEach(kparts => { + kparts.split(" ").forEach(kp => { + keywords.push(kp) + }) + }) + + const inputs = input.split(" ") + // NOTE: inputがないパターンは既に除外済みで、必ず string になるので、 `as string` を使う + const lastInputPart = inputs.pop() as string + + // 最後の単語だけは入力途中なので、部分一致でマッチ + const lastInputMatched = text.indexOf(lastInputPart) !== -1 || keywords.some(kw => kw.indexOf(lastInputPart) !== -1) + if (!lastInputMatched) { + return { isMatched: false } + } + + const matchedKeywords: MatchedKeyword[] = inputs.filter(ipt => keywords.indexOf(ipt) !== -1).map( + kw => { + const startAt = input.indexOf(kw) + const endAt = startAt + kw.length + return { + text: kw, + startAt: startAt, + endAt + } + } + ) + + const unmatchedParts = inputs.filter(ipt => keywords.indexOf(ipt) === -1) + const isMatched = unmatchedParts.every(word => text.indexOf(word) !== -1) + + return { + isMatched, data: { + text: dataItem.text, + keywords: dataItem.keywords, + matchedKeywords + } + } + } +} + +export class KeywordMatcher extends Matcher { + + exactRegExpMap: Map = new Map() + partialRegExpMap: Map = new Map() + + loadData(locale: string, localeData: LocaleDataItem[]): void { + super.loadData(locale, localeData) + + const keywordSet: Set = new Set() + localeData.forEach(item => { + const itemKeywords = item.keywords + const splits = itemKeywords.split(this.keywordSeparator) + splits.forEach(kw => { + if (kw.length > 0) { + keywordSet.add(kw.toLowerCase()) + } + }) + }) + + const allKeywords = Array.from(keywordSet) + allKeywords.sort((kwA, kwB) => { + return kwB.length - kwA.length + }) + this.exactRegExpMap.set(locale, new RegExp(allKeywords.join("|"), "g")) + + const partialPatterns: string[] = [] + allKeywords.forEach(kw => { + if (kw.length > this.minKeywordLength) { + let partStr = kw.slice(0, this.minKeywordLength) + const parts = [partStr] + range(kw.length - this.minKeywordLength, this.minKeywordLength).forEach(num => { + partStr += kw[num] + parts.push(partStr) + }) + parts.reverse() + partialPatterns.push(parts.join("|")) + } else if (kw.length > 0) { + partialPatterns.push(kw) + } + }) + this.partialRegExpMap.set(locale, new RegExp(partialPatterns.join("|"), "g")) + } + + match(input: string, locale: string): MatchedResultData[] { + const localeDataOrigin = this.data.get(locale) + + if (!localeDataOrigin) { + return [] + } + + let localeData = Array.from(localeDataOrigin) + + if (this.comparator) { + const comparator = this.comparator + localeData.sort((itemA, itemB) => { + return comparator(itemA, itemB, input, locale) + }) + } + + return this._match(localeData, input, locale) + } + + _match(localeData: LocaleDataItem[], input: string, locale: string): MatchedResultData[]{ + + const results: MatchedResultData[] = [] + let exactRegExp = this.exactRegExpMap.get(locale) + if (localeData && exactRegExp) { + let matches: RegExpMatchArray | null + matches = input.toLowerCase().match(exactRegExp) + if (!matches) { + const partialRegExp = this.partialRegExpMap.get(locale) + if (partialRegExp) { + matches = input.toLowerCase().match(partialRegExp) + } + } + if (matches) { + const matchedKeywords: MatchedKeyword[] = matches.map(match => { + const idx = input.indexOf(match) + return { + text: match, + startAt: idx, + endAt: idx + match.length + } + }) + for (const item of localeData) { + const matched: MatchedKeyword[] = [] + const itemKeywords = item.keywords + matchedKeywords.forEach(kwItem => { + if (itemKeywords.indexOf(kwItem.text) !== -1) { + matched.push(kwItem) + } + }) + if (matched.length > 0) { + results.push({ + text: item.text, + keywords: item.keywords, + matchedKeywords: matched + }) + } + if (this.maxResults && results.length >= this.maxResults) { + break + } + } + } + } + + return results + } +} + +export class ConcatMatcher extends Matcher { + matchers: Matcher[]; + + constructor(properties: CompletionMatcherProperties) { + super(properties) + + this.matchers = [] + } + + addMatcherByClass(matcherClass: typeof Matcher) { + const matcher = new matcherClass({ + keywordSeparator: this.keywordSeparator, + minKeywordLength: this.minKeywordLength, + strictMatchLocales: this.strictMatchLocales, + }) + + this.addMatcher(matcher) + } + + addMatcher(matcher: Matcher) { + if (typeof matcher.loadData === 'function' && typeof matcher.match === 'function') { + this.matchers.push(matcher) + } + } + + loadData(locale: string, localeData: LocaleDataItem[]): void { + const stringifiedData = JSON.stringify(localeData) + + this.matchers.forEach(matcher => { + matcher.loadData(locale, JSON.parse(stringifiedData)) + }) + } + + match(input: string, locale: string): MatchedResultData[] { + const results: MatchedResultData[] = [] + for (const matcher of this.matchers) { + const matched = matcher.match(input, locale) + for (const result of matched) { + if (!results.some(rt => rt.text === result.text)) { + results.push(result) + } + + if (this.maxResults && results.length >= this.maxResults) { + break + } + } + + if (this.maxResults && results.length >= this.maxResults) { + break + } + } + return results + } +} + +export class KeywordForwardMatcher extends ConcatMatcher { + constructor(properties: CompletionMatcherProperties) { + super(properties) + + this.addMatcher(new KeywordMatcher(properties)) + this.addMatcher(new ForwardMatcher(properties)) + } +} + +export const DefaultMatcher = ForwardMatcher \ No newline at end of file diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..ae39a3c --- /dev/null +++ b/src/types.ts @@ -0,0 +1,56 @@ +import type { Matcher } from "./matcher"; + + +export type MatchedResult = { + isMatched: boolean; + data?: MatchedResultData; +} + +export type MatchedResultData = { + idx?: number; + text: string; + keywords: string; + matchedKeywords?: MatchedKeyword[]; +} + +export type MatchedKeyword = { + text: string; + startAt: number; + endAt: number; +} + +export type LocaleDataItem = { + idx?: number; + text: string; + keywords: string; +} + +export type LocaleDataComparator = (itemA: LocaleDataItem, itemB: LocaleDataItem, input: string, locale: string) => number +export type LocaleDateFilter = (localeData: LocaleDataItem[], input: string, locale: string) => MatchedResultData[] + +export type CompletionMatcherProperties = { + keywordSeparator?: string; + minKeywordLength?: number; + strictMatchLocales?: string[]; + maxResults?: number; + comparator?: LocaleDataComparator; + filter?: LocaleDateFilter; +} +export type CompletionGeneratorProperties = { + keywordSeparator?: string; + minKeywordLength?: number; + strictMatchLocales?: string[]; + maxResults?: number; + comparator?: LocaleDataComparator; + filter?: LocaleDateFilter; + matcher?: Matcher; +} + +export type CompletionFetcherProperties = { + apiKey: string; + apiKeyHeaderName?: string; + getEndpoint?: GetEndpoint; + handleResponse?: HandleResponse +} +export type GetEndpoint = (locale: string) => string +export type HandleResponse = (data: any) => LocaleDataItem[] diff --git a/src/utils.ts b/src/utils.ts new file mode 100644 index 0000000..14ec4d9 --- /dev/null +++ b/src/utils.ts @@ -0,0 +1,3 @@ +export const range = (length: number, startAt: number) => { + return Array.from(Array(length).keys()).map((num: number) => (num + startAt)) +} diff --git a/test/fixtures/test-suites.json b/test/fixtures/test-suites.json index 76021e1..c715e54 100644 --- a/test/fixtures/test-suites.json +++ b/test/fixtures/test-suites.json @@ -70,6 +70,79 @@ } ] }, + { + "suiteName": "Process ja matching with default properties in KeywordMatcher", + "locale": "ja", + "generatorProperties": {}, + "matcher": "KeywordMatcher", + "matcherProperties": {}, + "cases": [ + { + "name": "Input [Empty] and not matched", + "input": "", + "expectedIdx": [] + }, + { + "name": "Input [{TextNotIncluded}] and not matched", + "input": "今日の天気は?", + "expectedIdx": [] + }, + { + "name": "Input [{TextIncluded}] but not matched because no matched keyword", + "input": "ですか", + "expectedIdx": [] + }, + { + "name": "Input [{PartOfKeyword}] and matched", + "input": "COVID-", + "expectedIdx": [1, 2] + }, + { + "name": "Input [{PartOfKeyword} + {TextIncluded}] and matched", + "input": "コロナとは", + "expectedIdx": [1, 2] + }, + { + "name": "Input [{PartOfKeyword} + {TextUnIncluded}] and matched", + "input": "コロナ休業", + "expectedIdx": [1, 2] + }, + { + "name": "Input [{PartOfKeyword} + {TextUnIncluded}] and matched, Case 2", + "input": "COVIDなに?", + "expectedIdx": [1, 2] + }, + { + "name": "Input [{PartOfKeyword} + {TextIncluded} + {PartOfKeyword}] and matched", + "input": "コロナとCOVID-19", + "expectedIdx": [1, 2] + }, + { + "name": "Input [{PartOfKeyword} + {TextIncluded} + {PartOfKeyword} + {TextUnIncluded}] and matched", + "input": "コロナとCOVID-19の関係は?", + "expectedIdx": [1, 2] + }, + { + "name": "Same input not matched because keywords not set", + "input": "新型コロナウイルス感染症とは何ですか?", + "expectedIdx": [1, 2] + } + ], + "dataset": [ + { + "text": "新型コロナウイルス感染症とは何ですか?", + "keywords": "" + }, + { + "text": "コロナウイルスとはどのようなウイルスですか?", + "keywords": "コロナウイルス,Corona Virus,COVID19,COVID-19,ころなういるす,新型コロナウイルス,Covid-19,Covid19,covid19,covid-19,COVID,コロナウィルス,ころな,COVIDー19,コロナ,新型コロナウイルス感染症,新型コロナウィルス感染症,コロな,コロナ,covid19,新型コロナ,新型コロナウィルス" + }, + { + "text": "新型コロナウイルス感染症によって、事業の休止などを余儀なくされ、やむを得ず休業とする場合等にどのようなことに心がければよいのでしょうか。", + "keywords": "コロナウイルス,Corona Virus,COVID19,COVID-19,ころなういるす,新型コロナウイルス,Covid-19,Covid19,covid19,covid-19,COVID,コロナウィルス,ころな,COVIDー19,コロナ,新型コロナウイルス感染症,新型コロナウィルス感染症,コロな,コロナ,covid19,新型コロナ,新型コロナウィルス,休業,一時休業" + } + ] + }, { "suiteName": "Process ja matching with property[minKeywordLength=4]", "locale": "ja", diff --git a/test/index.test.js b/test/index.test.js index 5c7f81e..612c654 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,6 +1,6 @@ import { describe, expect, test, vi } from 'vitest' -import { Generator, Fetcher } from "../src/index" +import { Generator, Fetcher, Matcher, KeywordMatcher, DefaultMatcher } from "../src/index" import testSuites from "./fixtures/test-suites.json" import jaData from "./fixtures/ja.json" import enData from "./fixtures/en.json" @@ -27,6 +27,14 @@ describe("Generator", () => { const completionGenerator = new Generator({ minKeywordLength: 5 }) expect(completionGenerator.minKeywordLength).toBe(5) }) + + test("Construct with [matcher] property", () => { + const matcher = new Matcher({ + minKeywordLength: 5 + }) + const completionGenerator = new Generator({ matcher }) + expect(completionGenerator.minKeywordLength).toBe(5) + }) }) test("Able to load locale data", () => { @@ -63,9 +71,30 @@ describe("Generator", () => { describe.each( testSuites - )('Suite $suiteName', ({suiteName, locale, generatorProperties, cases, dataset}) => { - - const completionGenerator = new Generator(generatorProperties) + )('Suite $suiteName', ({ + suiteName, + locale, generatorProperties, + matcher, matcherProperties, + cases, dataset + }) => { + let matcherInstance = null + if (matcher || matcherProperties) { + let MatcherClass = DefaultMatcher + if (matcher === 'KeywordMatcher') { + MatcherClass = KeywordMatcher + } + matcherInstance = new MatcherClass({ + ...matcherProperties + }) + } + let completionGenerator + if (matcherInstance) { + completionGenerator = new Generator({ + matcher: matcherInstance + }) + } else { + completionGenerator = new Generator(generatorProperties) + } completionGenerator.loadData(locale, dataset) test.each(cases)('Case $name', ({name, input, expectedIdx}) => { diff --git a/vite.config.ts b/vite.config.ts index 7f968e3..ba39c76 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,5 +1,7 @@ +import { unlinkSync, existsSync } from 'fs' import { resolve } from 'path' import { defineConfig } from 'vite' +import dts from 'vite-plugin-dts' export default defineConfig({ @@ -14,5 +16,17 @@ export default defineConfig({ }, test: { environment: "jsdom" - } + }, + plugins: [ + dts({ + rollupTypes: true, + beforeWriteFile(_, __) { + const dtsPath = resolve(__dirname, "./dist/completion-generator.d.ts") + const dtsExists = existsSync(dtsPath) + if (dtsExists) { + unlinkSync(dtsPath) + } + } + }) + ] }) From a78983b06bd63c96f0857007bbdff2c3846ef41b Mon Sep 17 00:00:00 2001 From: Lin Yem Date: Tue, 11 Jun 2024 14:21:27 +0900 Subject: [PATCH 2/4] Update package.json --- package-lock.json | 1635 +++++++++++++++++++++++++++++---------------- package.json | 15 +- 2 files changed, 1077 insertions(+), 573 deletions(-) diff --git a/package-lock.json b/package-lock.json index 348234f..518da31 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,41 +1,60 @@ { "name": "@obot-ai/completion-generator", - "version": "1.0.0", + "version": "1.1.0-preview.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@obot-ai/completion-generator", - "version": "1.0.0", + "version": "1.1.0-preview.1", "license": "MIT", "devDependencies": { - "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "^11.1.2", - "@vitest/coverage-v8": "^0.33.0", - "jsdom": "^22.1.0", - "tslib": "^2.6.2", - "vite": "^4.4.5", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@types/node": "^20.14.2", + "@vitest/coverage-v8": "^1.6.0", + "jsdom": "^24.1.0", + "tslib": "^2.6.3", + "vite": "^5.2.13", "vite-plugin-dts": "^3.9.1", - "vitest": "^0.33.0" + "vitest": "^1.6.0" } }, "node_modules/@ampproject/remapping": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", - "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, + "node_modules/@babel/helper-string-parser": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.24.7.tgz", + "integrity": "sha512-7MbVt6xrwFQbunH2DNQsAP5sTGxfqQtErvBIvIMi6EQnbgUOuVYanvREcmFrOPhoXBrTtjhhP+lW+o5UfK+tDg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/parser": { - "version": "7.24.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.6.tgz", - "integrity": "sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==", + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.24.7.tgz", + "integrity": "sha512-9uUYRm6OqQrCqQdG1iCBwBPZgN8ciDBro2nIOFaiRz1/BCxaI7CNvQbDHvsArAC7Tw9Hda/B3U+6ui9u4HWXPw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -44,16 +63,46 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/types": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.24.7.tgz", + "integrity": "sha512-XEFXSlxiG5td2EJRe8vOmRbaXVgfcBlszKujvVmWIK/UpywWljQCfzAv3RQCGujWQ1RD4YYWEAqDXfuJiy8f5Q==", + "dev": true, + "dependencies": { + "@babel/helper-string-parser": "^7.24.7", + "@babel/helper-validator-identifier": "^7.24.7", + "to-fast-properties": "^2.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz", + "integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz", + "integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==", "cpu": [ "arm" ], @@ -67,9 +116,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz", + "integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==", "cpu": [ "arm64" ], @@ -83,9 +132,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz", + "integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==", "cpu": [ "x64" ], @@ -99,9 +148,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz", + "integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==", "cpu": [ "arm64" ], @@ -115,9 +164,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz", + "integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==", "cpu": [ "x64" ], @@ -131,9 +180,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz", + "integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==", "cpu": [ "arm64" ], @@ -147,9 +196,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz", + "integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==", "cpu": [ "x64" ], @@ -163,9 +212,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz", + "integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==", "cpu": [ "arm" ], @@ -179,9 +228,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz", + "integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==", "cpu": [ "arm64" ], @@ -195,9 +244,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz", + "integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==", "cpu": [ "ia32" ], @@ -211,9 +260,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz", + "integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==", "cpu": [ "loong64" ], @@ -227,9 +276,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz", + "integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==", "cpu": [ "mips64el" ], @@ -243,9 +292,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz", + "integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==", "cpu": [ "ppc64" ], @@ -259,9 +308,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz", + "integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==", "cpu": [ "riscv64" ], @@ -275,9 +324,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz", + "integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==", "cpu": [ "s390x" ], @@ -291,9 +340,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz", + "integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==", "cpu": [ "x64" ], @@ -307,9 +356,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz", + "integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==", "cpu": [ "x64" ], @@ -323,9 +372,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz", + "integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==", "cpu": [ "x64" ], @@ -339,9 +388,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz", + "integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==", "cpu": [ "x64" ], @@ -355,9 +404,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz", + "integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==", "cpu": [ "arm64" ], @@ -371,9 +420,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz", + "integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==", "cpu": [ "ia32" ], @@ -386,22 +435,6 @@ "node": ">=12" } }, - "node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": ">=12" - } - }, "node_modules/@istanbuljs/schema": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.3.tgz", @@ -424,45 +457,45 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz", + "integrity": "sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==", "dev": true, "dependencies": { - "@jridgewell/set-array": "^1.0.1", + "@jridgewell/set-array": "^1.2.1", "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.24" }, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/set-array": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", - "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.2.1.tgz", + "integrity": "sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==", "dev": true, "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/source-map": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.5.tgz", - "integrity": "sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.6.tgz", + "integrity": "sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" } }, "node_modules/@jridgewell/sourcemap-codec": { @@ -472,9 +505,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", - "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", + "version": "0.3.25", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz", + "integrity": "sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", @@ -528,6 +561,34 @@ "node": "*" } }, + "node_modules/@microsoft/api-extractor/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/typescript": { + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", + "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "node_modules/@microsoft/tsdoc": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", @@ -560,9 +621,9 @@ } }, "node_modules/@rollup/plugin-terser": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.3.tgz", - "integrity": "sha512-EF0oejTMtkyhrkwCdg0HJ0IpkcaVg1MMSf2olHb2Jp+1mnLM04OhjpJWGma4HobiDTF0WCyViWuvadyE9ch2XA==", + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@rollup/plugin-terser/-/plugin-terser-0.4.4.tgz", + "integrity": "sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==", "dev": true, "dependencies": { "serialize-javascript": "^6.0.1", @@ -573,7 +634,7 @@ "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.x || ^3.x" + "rollup": "^2.0.0||^3.0.0||^4.0.0" }, "peerDependenciesMeta": { "rollup": { @@ -582,19 +643,19 @@ } }, "node_modules/@rollup/plugin-typescript": { - "version": "11.1.3", - "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.3.tgz", - "integrity": "sha512-8o6cNgN44kQBcpsUJTbTXMTtb87oR1O0zgP3Dxm71hrNgparap3VujgofEilTYJo+ivf2ke6uy3/E5QEaiRlDA==", + "version": "11.1.6", + "resolved": "https://registry.npmjs.org/@rollup/plugin-typescript/-/plugin-typescript-11.1.6.tgz", + "integrity": "sha512-R92yOmIACgYdJ7dJ97p4K69I8gg6IEHt8M7dUBxN3W6nrO8uUxX5ixl0yU/N3aZTi8WhPuICvOHXQvF6FaykAA==", "dev": true, "dependencies": { - "@rollup/pluginutils": "^5.0.1", + "@rollup/pluginutils": "^5.1.0", "resolve": "^1.22.1" }, "engines": { "node": ">=14.0.0" }, "peerDependencies": { - "rollup": "^2.14.0||^3.0.0", + "rollup": "^2.14.0||^3.0.0||^4.0.0", "tslib": "*", "typescript": ">=3.7.0" }, @@ -629,6 +690,214 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", + "integrity": "sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@rushstack/node-core-library": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-4.0.2.tgz", @@ -651,6 +920,21 @@ } } }, + "node_modules/@rushstack/node-core-library/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@rushstack/rig-package": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.5.2.tgz", @@ -712,101 +996,76 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, - "node_modules/@tootallnate/once": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", - "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", - "dev": true, - "engines": { - "node": ">= 10" - } - }, "node_modules/@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", "dev": true }, - "node_modules/@types/chai": { - "version": "4.3.5", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", - "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", + "node_modules/@types/estree": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, - "node_modules/@types/chai-subset": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", - "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", + "node_modules/@types/node": { + "version": "20.14.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", + "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", "dev": true, "dependencies": { - "@types/chai": "*" + "undici-types": "~5.26.4" } }, - "node_modules/@types/estree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", - "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", - "dev": true - }, - "node_modules/@types/istanbul-lib-coverage": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", - "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==", - "dev": true - }, - "node_modules/@types/node": { - "version": "20.5.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.5.7.tgz", - "integrity": "sha512-dP7f3LdZIysZnmvP3ANJYTSwg+wLLl8p7RqniVlV7j+oXSXAbt9h0WIBFmJy5inWZoX9wZN6eXx+YXd9Rh3RBA==", - "dev": true - }, "node_modules/@vitest/coverage-v8": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-0.33.0.tgz", - "integrity": "sha512-Rj5IzoLF7FLj6yR7TmqsfRDSeaFki6NAJ/cQexqhbWkHEV2htlVGrmuOde3xzvFsCbLCagf4omhcIaVmfU8Okg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-1.6.0.tgz", + "integrity": "sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==", "dev": true, "dependencies": { "@ampproject/remapping": "^2.2.1", "@bcoe/v8-coverage": "^0.2.3", - "istanbul-lib-coverage": "^3.2.0", - "istanbul-lib-report": "^3.0.0", - "istanbul-lib-source-maps": "^4.0.1", - "istanbul-reports": "^3.1.5", - "magic-string": "^0.30.1", + "debug": "^4.3.4", + "istanbul-lib-coverage": "^3.2.2", + "istanbul-lib-report": "^3.0.1", + "istanbul-lib-source-maps": "^5.0.4", + "istanbul-reports": "^3.1.6", + "magic-string": "^0.30.5", + "magicast": "^0.3.3", "picocolors": "^1.0.0", - "std-env": "^3.3.3", - "test-exclude": "^6.0.0", - "v8-to-istanbul": "^9.1.0" + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "test-exclude": "^6.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { - "vitest": ">=0.32.0 <1" + "vitest": "1.6.0" } }, "node_modules/@vitest/expect": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.33.0.tgz", - "integrity": "sha512-sVNf+Gla3mhTCxNJx+wJLDPp/WcstOe0Ksqz4Vec51MmgMth/ia0MGFEkIZmVGeTL5HtjYR4Wl/ZxBxBXZJTzQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-1.6.0.tgz", + "integrity": "sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==", "dev": true, "dependencies": { - "@vitest/spy": "0.33.0", - "@vitest/utils": "0.33.0", - "chai": "^4.3.7" + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "chai": "^4.3.10" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/runner": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.33.0.tgz", - "integrity": "sha512-UPfACnmCB6HKRHTlcgCoBh6ppl6fDn+J/xR8dTufWiKt/74Y9bHci5CKB8tESSV82zKYtkBJo9whU3mNvfaisg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-1.6.0.tgz", + "integrity": "sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==", "dev": true, "dependencies": { - "@vitest/utils": "0.33.0", - "p-limit": "^4.0.0", + "@vitest/utils": "1.6.0", + "p-limit": "^5.0.0", "pathe": "^1.1.1" }, "funding": { @@ -814,45 +1073,55 @@ } }, "node_modules/@vitest/snapshot": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.33.0.tgz", - "integrity": "sha512-tJjrl//qAHbyHajpFvr8Wsk8DIOODEebTu7pgBrP07iOepR5jYkLFiqLq2Ltxv+r0uptUb4izv1J8XBOwKkVYA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-1.6.0.tgz", + "integrity": "sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==", "dev": true, "dependencies": { - "magic-string": "^0.30.1", + "magic-string": "^0.30.5", "pathe": "^1.1.1", - "pretty-format": "^29.5.0" + "pretty-format": "^29.7.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/spy": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.33.0.tgz", - "integrity": "sha512-Kv+yZ4hnH1WdiAkPUQTpRxW8kGtH8VRTnus7ZTGovFYM1ZezJpvGtb9nPIjPnptHbsyIAxYZsEpVPYgtpjGnrg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-1.6.0.tgz", + "integrity": "sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==", "dev": true, "dependencies": { - "tinyspy": "^2.1.1" + "tinyspy": "^2.2.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, "node_modules/@vitest/utils": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.33.0.tgz", - "integrity": "sha512-pF1w22ic965sv+EN6uoePkAOTkAPWM03Ri/jXNyMIKBb/XHLDPfhLvf/Fa9g0YECevAIz56oVYXhodLvLQ/awA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-1.6.0.tgz", + "integrity": "sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==", "dev": true, "dependencies": { - "diff-sequences": "^29.4.3", - "loupe": "^2.3.6", - "pretty-format": "^29.5.0" + "diff-sequences": "^29.6.3", + "estree-walker": "^3.0.3", + "loupe": "^2.3.7", + "pretty-format": "^29.7.0" }, "funding": { "url": "https://opencollective.com/vitest" } }, + "node_modules/@vitest/utils/node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.0" + } + }, "node_modules/@volar/language-core": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/@volar/language-core/-/language-core-1.11.1.tgz", @@ -959,16 +1228,10 @@ "integrity": "sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==", "dev": true }, - "node_modules/abab": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz", - "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==", - "dev": true - }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -978,24 +1241,24 @@ } }, "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.2.tgz", + "integrity": "sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==", "dev": true, "engines": { "node": ">=0.4.0" } }, "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", "dev": true, "dependencies": { - "debug": "4" + "debug": "^4.3.4" }, "engines": { - "node": ">= 6.0.0" + "node": ">= 14" } }, "node_modules/ajv": { @@ -1082,28 +1345,31 @@ } }, "node_modules/chai": { - "version": "4.3.8", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", - "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.4.1.tgz", + "integrity": "sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^4.1.2", - "get-func-name": "^2.0.0", - "loupe": "^2.3.1", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "type-detect": "^4.0.8" }, "engines": { "node": ">=4" } }, "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", "dev": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, "engines": { "node": "*" } @@ -1138,36 +1404,55 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, - "node_modules/convert-source-map": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", + "node_modules/confbox": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.7.tgz", + "integrity": "sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==", "dev": true }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/cssstyle": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-3.0.0.tgz", - "integrity": "sha512-N4u2ABATi3Qplzf0hWbVCdjenim8F3ojEXpBDF5hBpjzW182MjNGLqfmQ0SkSPeQ+V86ZXgeH8aXj6kayd4jgg==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.0.1.tgz", + "integrity": "sha512-8ZYiJ3A/3OkDd093CBT/0UKDWry7ak4BdPTFP2+QEP7cmhouyq/Up709ASSj2cK02BbZiMgk7kYjZNS4QP5qrQ==", "dev": true, "dependencies": { "rrweb-cssom": "^0.6.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, + "node_modules/cssstyle/node_modules/rrweb-cssom": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", + "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "dev": true + }, "node_modules/data-urls": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-4.0.0.tgz", - "integrity": "sha512-/mMTei/JXPqvFqQtfyTowxmJVwr2PVAeCcDxyFf6LhoOu/09TX2OX3kb2wzi4DMXcfj4OItwDOnhl5oziPnT6g==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz", + "integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==", "dev": true, "dependencies": { - "abab": "^2.0.6", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.0" + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/de-indent": { @@ -1177,9 +1462,9 @@ "dev": true }, "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1200,9 +1485,9 @@ "dev": true }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", "dev": true, "dependencies": { "type-detect": "^4.0.0" @@ -1226,19 +1511,7 @@ "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", "dev": true, "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/domexception": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-4.0.0.tgz", - "integrity": "sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==", - "dev": true, - "dependencies": { - "webidl-conversions": "^7.0.0" - }, - "engines": { - "node": ">=12" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/entities": { @@ -1254,9 +1527,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz", + "integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==", "dev": true, "hasInstallScript": true, "bin": { @@ -1266,28 +1539,45 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" + "@esbuild/aix-ppc64": "0.20.2", + "@esbuild/android-arm": "0.20.2", + "@esbuild/android-arm64": "0.20.2", + "@esbuild/android-x64": "0.20.2", + "@esbuild/darwin-arm64": "0.20.2", + "@esbuild/darwin-x64": "0.20.2", + "@esbuild/freebsd-arm64": "0.20.2", + "@esbuild/freebsd-x64": "0.20.2", + "@esbuild/linux-arm": "0.20.2", + "@esbuild/linux-arm64": "0.20.2", + "@esbuild/linux-ia32": "0.20.2", + "@esbuild/linux-loong64": "0.20.2", + "@esbuild/linux-mips64el": "0.20.2", + "@esbuild/linux-ppc64": "0.20.2", + "@esbuild/linux-riscv64": "0.20.2", + "@esbuild/linux-s390x": "0.20.2", + "@esbuild/linux-x64": "0.20.2", + "@esbuild/netbsd-x64": "0.20.2", + "@esbuild/openbsd-x64": "0.20.2", + "@esbuild/sunos-x64": "0.20.2", + "@esbuild/win32-arm64": "0.20.2", + "@esbuild/win32-ia32": "0.20.2", + "@esbuild/win32-x64": "0.20.2" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-x64": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz", + "integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" } }, "node_modules/estree-walker": { @@ -1296,6 +1586,29 @@ "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", "dev": true }, + "node_modules/execa": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", + "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^8.0.1", + "human-signals": "^5.0.0", + "is-stream": "^3.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^5.1.0", + "onetime": "^6.0.0", + "signal-exit": "^4.1.0", + "strip-final-newline": "^3.0.0" + }, + "engines": { + "node": ">=16.17" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, "node_modules/fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -1366,24 +1679,40 @@ } }, "node_modules/function-bind": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", - "dev": true + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" } }, + "node_modules/get-stream": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", + "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -1406,18 +1735,6 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, - "node_modules/has": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", - "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.1" - }, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -1427,6 +1744,18 @@ "node": ">=8" } }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -1437,15 +1766,15 @@ } }, "node_modules/html-encoding-sniffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", - "integrity": "sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz", + "integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==", "dev": true, "dependencies": { - "whatwg-encoding": "^2.0.0" + "whatwg-encoding": "^3.1.1" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/html-escaper": { @@ -1455,30 +1784,38 @@ "dev": true }, "node_modules/http-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", - "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "dependencies": { - "@tootallnate/once": "2", - "agent-base": "6", - "debug": "4" + "agent-base": "^7.1.0", + "debug": "^4.3.4" }, "engines": { - "node": ">= 6" + "node": ">= 14" } }, "node_modules/https-proxy-agent": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", - "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, "dependencies": { - "agent-base": "6", + "agent-base": "^7.0.2", "debug": "4" }, "engines": { - "node": ">= 6" + "node": ">= 14" + } + }, + "node_modules/human-signals": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", + "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", + "dev": true, + "engines": { + "node": ">=16.17.0" } }, "node_modules/iconv-lite": { @@ -1506,6 +1843,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", "dev": true, "dependencies": { "once": "^1.3.0", @@ -1519,12 +1857,12 @@ "dev": true }, "node_modules/is-core-module": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz", - "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==", + "version": "2.13.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", + "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", "dev": true, "dependencies": { - "has": "^1.0.3" + "hasown": "^2.0.0" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -1536,10 +1874,28 @@ "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", "dev": true }, + "node_modules/is-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", + "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, "node_modules/istanbul-lib-coverage": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", - "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", "dev": true, "engines": { "node": ">=8" @@ -1560,23 +1916,23 @@ } }, "node_modules/istanbul-lib-source-maps": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", - "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-5.0.4.tgz", + "integrity": "sha512-wHOoEsNJTVltaJp8eVkm8w+GVkVNHT2YDYo53YdzQEL2gWm1hBX5cGFR9hQJtuGLebidVX7et3+dmDZrmclduw==", "dev": true, "dependencies": { + "@jridgewell/trace-mapping": "^0.3.23", "debug": "^4.1.1", - "istanbul-lib-coverage": "^3.0.0", - "source-map": "^0.6.1" + "istanbul-lib-coverage": "^3.0.0" }, "engines": { "node": ">=10" } }, "node_modules/istanbul-reports": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", - "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.7.tgz", + "integrity": "sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==", "dev": true, "dependencies": { "html-escaper": "^2.0.0", @@ -1592,41 +1948,45 @@ "integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==", "dev": true }, + "node_modules/js-tokens": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.0.tgz", + "integrity": "sha512-WriZw1luRMlmV3LGJaR6QOJjWwgLUTf89OwT2lUOyjX2dJGBwgmIkbcz+7WFZjrZM635JOIR517++e/67CP9dQ==", + "dev": true + }, "node_modules/jsdom": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-22.1.0.tgz", - "integrity": "sha512-/9AVW7xNbsBv6GfWho4TTNjEo9fe6Zhf9O7s0Fhhr3u+awPwAJMKwAMXnkk5vBxflqLW9hTHX/0cs+P3gW+cQw==", + "version": "24.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-24.1.0.tgz", + "integrity": "sha512-6gpM7pRXCwIOKxX47cgOyvyQDN/Eh0f1MeKySBV2xGdKtqJBLj8P25eY3EVCWo2mglDDzozR2r2MW4T+JiNUZA==", "dev": true, "dependencies": { - "abab": "^2.0.6", - "cssstyle": "^3.0.0", - "data-urls": "^4.0.0", + "cssstyle": "^4.0.1", + "data-urls": "^5.0.0", "decimal.js": "^10.4.3", - "domexception": "^4.0.0", "form-data": "^4.0.0", - "html-encoding-sniffer": "^3.0.0", - "http-proxy-agent": "^5.0.0", - "https-proxy-agent": "^5.0.1", + "html-encoding-sniffer": "^4.0.0", + "http-proxy-agent": "^7.0.2", + "https-proxy-agent": "^7.0.4", "is-potential-custom-element-name": "^1.0.1", - "nwsapi": "^2.2.4", + "nwsapi": "^2.2.10", "parse5": "^7.1.2", - "rrweb-cssom": "^0.6.0", + "rrweb-cssom": "^0.7.0", "saxes": "^6.0.0", "symbol-tree": "^3.2.4", - "tough-cookie": "^4.1.2", - "w3c-xmlserializer": "^4.0.0", + "tough-cookie": "^4.1.4", + "w3c-xmlserializer": "^5.0.0", "webidl-conversions": "^7.0.0", - "whatwg-encoding": "^2.0.0", - "whatwg-mimetype": "^3.0.0", - "whatwg-url": "^12.0.1", - "ws": "^8.13.0", - "xml-name-validator": "^4.0.0" + "whatwg-encoding": "^3.1.1", + "whatwg-mimetype": "^4.0.0", + "whatwg-url": "^14.0.0", + "ws": "^8.17.0", + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=16" + "node": ">=18" }, "peerDependencies": { - "canvas": "^2.5.0" + "canvas": "^2.11.2" }, "peerDependenciesMeta": { "canvas": { @@ -1640,12 +2000,6 @@ "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, - "node_modules/jsonc-parser": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.2.0.tgz", - "integrity": "sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==", - "dev": true - }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -1662,10 +2016,14 @@ "dev": true }, "node_modules/local-pkg": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", - "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.5.0.tgz", + "integrity": "sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==", "dev": true, + "dependencies": { + "mlly": "^1.4.2", + "pkg-types": "^1.0.3" + }, "engines": { "node": ">=14" }, @@ -1692,12 +2050,12 @@ "dev": true }, "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", "dev": true, "dependencies": { - "get-func-name": "^2.0.0" + "get-func-name": "^2.0.1" } }, "node_modules/lru-cache": { @@ -1721,6 +2079,17 @@ "@jridgewell/sourcemap-codec": "^1.4.15" } }, + "node_modules/magicast": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.3.4.tgz", + "integrity": "sha512-TyDF/Pn36bBji9rWKHlZe+PZb6Mx5V8IHCSxk7X4aljM4e/vyDvZZYwHewdVaqiA0nb3ghfHU/6AUpDxWoER2Q==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.24.4", + "@babel/types": "^7.24.0", + "source-map-js": "^1.2.0" + } + }, "node_modules/make-dir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", @@ -1736,6 +2105,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -1757,6 +2132,18 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", + "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -1770,15 +2157,15 @@ } }, "node_modules/mlly": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.1.tgz", - "integrity": "sha512-SCDs78Q2o09jiZiE2WziwVBEqXQ02XkGdUy45cbJf+BpYRIjArXRJ1Wbowxkb+NaM9DWvS3UC9GiO/6eqvQ/pg==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.7.1.tgz", + "integrity": "sha512-rrVRZRELyQzrIUAVMHxP97kv+G786pHmOKzuFII8zDYahFBS7qnHh2AlYSl1GAHhaMPCz6/oHjVMcfFYgFYHgA==", "dev": true, "dependencies": { - "acorn": "^8.10.0", - "pathe": "^1.1.1", - "pkg-types": "^1.0.3", - "ufo": "^1.3.0" + "acorn": "^8.11.3", + "pathe": "^1.1.2", + "pkg-types": "^1.1.1", + "ufo": "^1.5.3" } }, "node_modules/ms": { @@ -1794,9 +2181,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", - "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "version": "3.3.7", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", + "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", "dev": true, "funding": [ { @@ -1811,10 +2198,37 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/npm-run-path": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", + "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "dev": true, + "dependencies": { + "path-key": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/npm-run-path/node_modules/path-key": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", + "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/nwsapi": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz", - "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==", + "version": "2.2.10", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.10.tgz", + "integrity": "sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==", "dev": true }, "node_modules/once": { @@ -1826,16 +2240,31 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", + "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "dev": true, + "dependencies": { + "mimic-fn": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dev": true, "dependencies": { "yocto-queue": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -1868,6 +2297,15 @@ "node": ">=0.10.0" } }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/path-parse": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", @@ -1875,9 +2313,9 @@ "dev": true }, "node_modules/pathe": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.2.tgz", + "integrity": "sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==", "dev": true }, "node_modules/pathval": { @@ -1890,9 +2328,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -1908,20 +2346,20 @@ } }, "node_modules/pkg-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", - "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.1.1.tgz", + "integrity": "sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==", "dev": true, "dependencies": { - "jsonc-parser": "^3.2.0", - "mlly": "^1.2.0", - "pathe": "^1.1.0" + "confbox": "^0.1.7", + "mlly": "^1.7.0", + "pathe": "^1.1.2" } }, "node_modules/postcss": { - "version": "8.4.28", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.28.tgz", - "integrity": "sha512-Z7V5j0cq8oEKyejIKfpD8b4eBy9cwW2JWPk0+fB1HOAMsfHbnAXLLS+PfVWlzMSLQaWttKDt607I0XHmpE67Vw==", + "version": "8.4.38", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", + "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", "dev": true, "funding": [ { @@ -1938,18 +2376,18 @@ } ], "dependencies": { - "nanoid": "^3.3.6", + "nanoid": "^3.3.7", "picocolors": "^1.0.0", - "source-map-js": "^1.0.2" + "source-map-js": "^1.2.0" }, "engines": { "node": "^10 || ^12 || >=14" } }, "node_modules/pretty-format": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", - "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", @@ -1967,9 +2405,9 @@ "dev": true }, "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", "dev": true, "engines": { "node": ">=6" @@ -1991,9 +2429,9 @@ } }, "node_modules/react-is": { - "version": "18.2.0", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", "dev": true }, "node_modules/requires-port": { @@ -2003,9 +2441,9 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.4", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz", - "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==", + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", "dev": true, "dependencies": { "is-core-module": "^2.13.0", @@ -2020,25 +2458,44 @@ } }, "node_modules/rollup": { - "version": "3.28.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.28.1.tgz", - "integrity": "sha512-R9OMQmIHJm9znrU3m3cpE8uhN0fGdXiawME7aZIpQqvpS/85+Vt1Hq1/yVIcYfOmaQiHjvXkQAoJukvLpau6Yw==", + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.18.0.tgz", + "integrity": "sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==", "dev": true, + "dependencies": { + "@types/estree": "1.0.5" + }, "bin": { "rollup": "dist/bin/rollup" }, "engines": { - "node": ">=14.18.0", + "node": ">=18.0.0", "npm": ">=8.0.0" }, "optionalDependencies": { + "@rollup/rollup-android-arm-eabi": "4.18.0", + "@rollup/rollup-android-arm64": "4.18.0", + "@rollup/rollup-darwin-arm64": "4.18.0", + "@rollup/rollup-darwin-x64": "4.18.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.18.0", + "@rollup/rollup-linux-arm-musleabihf": "4.18.0", + "@rollup/rollup-linux-arm64-gnu": "4.18.0", + "@rollup/rollup-linux-arm64-musl": "4.18.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.18.0", + "@rollup/rollup-linux-riscv64-gnu": "4.18.0", + "@rollup/rollup-linux-s390x-gnu": "4.18.0", + "@rollup/rollup-linux-x64-gnu": "4.18.0", + "@rollup/rollup-linux-x64-musl": "4.18.0", + "@rollup/rollup-win32-arm64-msvc": "4.18.0", + "@rollup/rollup-win32-ia32-msvc": "4.18.0", + "@rollup/rollup-win32-x64-msvc": "4.18.0", "fsevents": "~2.3.2" } }, "node_modules/rrweb-cssom": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.6.0.tgz", - "integrity": "sha512-APM0Gt1KoXBz0iIkkdB/kfvGOwC4UuJFeG/c+yV7wSc7q96cG/kJ0HiYCnzivD9SB53cLV1MlHFNfOuPaadYSw==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.0.tgz", + "integrity": "sha512-KlSv0pm9kgQSRxXEMgtivPJ4h826YHsuob8pSHcfSZsSXGtvpEAie8S0AnXuObEJ7nhikOb4ahwxDm0H2yW17g==", "dev": true }, "node_modules/safe-buffer": { @@ -2080,13 +2537,10 @@ } }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, "bin": { "semver": "bin/semver.js" }, @@ -2095,24 +2549,57 @@ } }, "node_modules/serialize-javascript": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", - "integrity": "sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", "dev": true }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/smob": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/smob/-/smob-1.4.0.tgz", - "integrity": "sha512-MqR3fVulhjWuRNSMydnTlweu38UhQ0HXM4buStD/S3mc/BzX3CuM9OmhyQpmtYCvoYdl5ris6TI0ZqH355Ymqg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/smob/-/smob-1.5.0.tgz", + "integrity": "sha512-g6T+p7QO8npa+/hNx9ohv1E5pVCmWrVCUzUXJyLdMmftX6ER0oiWY/w9knEonLpnOp6b6FenKnMfR8gqwWdwig==", "dev": true }, "node_modules/source-map": { @@ -2156,9 +2643,9 @@ "dev": true }, "node_modules/std-env": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.4.3.tgz", - "integrity": "sha512-f9aPhy8fYBuMN+sNfakZV18U39PbalgjXG3lLB9WkaYTxijru61wb57V9wxxNthXM5Sd88ETBWi29qLAsHO52Q==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.7.0.tgz", + "integrity": "sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==", "dev": true }, "node_modules/string-argv": { @@ -2170,6 +2657,18 @@ "node": ">=0.6.19" } }, + "node_modules/strip-final-newline": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", + "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2183,12 +2682,12 @@ } }, "node_modules/strip-literal": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", - "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-2.1.0.tgz", + "integrity": "sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==", "dev": true, "dependencies": { - "acorn": "^8.10.0" + "js-tokens": "^9.0.0" }, "funding": { "url": "https://github.com/sponsors/antfu" @@ -2225,9 +2724,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.19.2", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.19.2.tgz", - "integrity": "sha512-qC5+dmecKJA4cpYxRa5aVkKehYsQKc+AHeKl0Oe62aYjBL8ZA33tTljktDHJSaxxMnbI5ZYw+o/S2DxxLu8OfA==", + "version": "5.31.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", + "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -2257,33 +2756,42 @@ } }, "node_modules/tinybench": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", - "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.8.0.tgz", + "integrity": "sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==", "dev": true }, "node_modules/tinypool": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.6.0.tgz", - "integrity": "sha512-FdswUUo5SxRizcBc6b1GSuLpLjisa8N8qMyYoP3rl+bym+QauhtJP5bvZY1ytt8krKGmMLYIRl36HBZfeAoqhQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.8.4.tgz", + "integrity": "sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==", "dev": true, "engines": { "node": ">=14.0.0" } }, "node_modules/tinyspy": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", - "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.2.1.tgz", + "integrity": "sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==", "dev": true, "engines": { "node": ">=14.0.0" } }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/tough-cookie": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", - "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.4.tgz", + "integrity": "sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag==", "dev": true, "dependencies": { "psl": "^1.1.33", @@ -2296,21 +2804,21 @@ } }, "node_modules/tr46": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", - "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz", + "integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==", "dev": true, "dependencies": { - "punycode": "^2.3.0" + "punycode": "^2.3.1" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", "dev": true }, "node_modules/type-detect": { @@ -2323,10 +2831,11 @@ } }, "node_modules/typescript": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.2.tgz", - "integrity": "sha512-+2/g0Fds1ERlP6JsakQQDXjZdZMM+rqpamFZJEKh4kwTIn3iDkgKtby0CeNd5ATNZ4Ry1ax15TMx0W2V+miizQ==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -2336,9 +2845,15 @@ } }, "node_modules/ufo": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==", + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.3.tgz", + "integrity": "sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==", + "dev": true + }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", "dev": true }, "node_modules/universalify": { @@ -2369,20 +2884,6 @@ "requires-port": "^1.0.0" } }, - "node_modules/v8-to-istanbul": { - "version": "9.1.0", - "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.1.0.tgz", - "integrity": "sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==", - "dev": true, - "dependencies": { - "@jridgewell/trace-mapping": "^0.3.12", - "@types/istanbul-lib-coverage": "^2.0.1", - "convert-source-map": "^1.6.0" - }, - "engines": { - "node": ">=10.12.0" - } - }, "node_modules/validator": { "version": "13.12.0", "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", @@ -2393,29 +2894,29 @@ } }, "node_modules/vite": { - "version": "4.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", - "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", + "version": "5.2.13", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.2.13.tgz", + "integrity": "sha512-SSq1noJfY9pR3I1TUENL3rQYDQCFqgD+lM6fTRAM8Nv6Lsg5hDLaXkjETVeBt+7vZBCMoibD+6IWnT2mJ+Zb/A==", "dev": true, "dependencies": { - "esbuild": "^0.18.10", - "postcss": "^8.4.27", - "rollup": "^3.27.1" + "esbuild": "^0.20.1", + "postcss": "^8.4.38", + "rollup": "^4.13.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { - "fsevents": "~2.3.2" + "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": ">= 14", + "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", @@ -2448,23 +2949,22 @@ } }, "node_modules/vite-node": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.33.0.tgz", - "integrity": "sha512-19FpHYbwWWxDr73ruNahC+vtEdza52kA90Qb3La98yZ0xULqV8A5JLNPUff0f5zID4984tW7l3DH2przTJUZSw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-1.6.0.tgz", + "integrity": "sha512-de6HJgzC+TFzOu0NTC4RAIsyf/DY/ibWDYQUcuEA84EMHhcefTUGkjFHKKEJhQN4A+6I0u++kr3l36ZF2d7XRw==", "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", - "mlly": "^1.4.0", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "vite": "^3.0.0 || ^4.0.0" + "vite": "^5.0.0" }, "bin": { "vite-node": "vite-node.mjs" }, "engines": { - "node": ">=v14.18.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" @@ -2498,59 +2998,56 @@ } }, "node_modules/vitest": { - "version": "0.33.0", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.33.0.tgz", - "integrity": "sha512-1CxaugJ50xskkQ0e969R/hW47za4YXDUfWJDxip1hwbnhUjYolpfUn2AMOulqG/Dtd9WYAtkHmM/m3yKVrEejQ==", - "dev": true, - "dependencies": { - "@types/chai": "^4.3.5", - "@types/chai-subset": "^1.3.3", - "@types/node": "*", - "@vitest/expect": "0.33.0", - "@vitest/runner": "0.33.0", - "@vitest/snapshot": "0.33.0", - "@vitest/spy": "0.33.0", - "@vitest/utils": "0.33.0", - "acorn": "^8.9.0", - "acorn-walk": "^8.2.0", - "cac": "^6.7.14", - "chai": "^4.3.7", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-1.6.0.tgz", + "integrity": "sha512-H5r/dN06swuFnzNFhq/dnz37bPXnq8xB2xB5JOVk8K09rUtoeNN+LHWkoQ0A/i3hvbUKKcCei9KpbxqHMLhLLA==", + "dev": true, + "dependencies": { + "@vitest/expect": "1.6.0", + "@vitest/runner": "1.6.0", + "@vitest/snapshot": "1.6.0", + "@vitest/spy": "1.6.0", + "@vitest/utils": "1.6.0", + "acorn-walk": "^8.3.2", + "chai": "^4.3.10", "debug": "^4.3.4", - "local-pkg": "^0.4.3", - "magic-string": "^0.30.1", + "execa": "^8.0.1", + "local-pkg": "^0.5.0", + "magic-string": "^0.30.5", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "std-env": "^3.3.3", - "strip-literal": "^1.0.1", - "tinybench": "^2.5.0", - "tinypool": "^0.6.0", - "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.33.0", + "std-env": "^3.5.0", + "strip-literal": "^2.0.0", + "tinybench": "^2.5.1", + "tinypool": "^0.8.3", + "vite": "^5.0.0", + "vite-node": "1.6.0", "why-is-node-running": "^2.2.2" }, "bin": { "vitest": "vitest.mjs" }, "engines": { - "node": ">=v14.18.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://opencollective.com/vitest" }, "peerDependencies": { "@edge-runtime/vm": "*", - "@vitest/browser": "*", - "@vitest/ui": "*", + "@types/node": "^18.0.0 || >=20.0.0", + "@vitest/browser": "1.6.0", + "@vitest/ui": "1.6.0", "happy-dom": "*", - "jsdom": "*", - "playwright": "*", - "safaridriver": "*", - "webdriverio": "*" + "jsdom": "*" }, "peerDependenciesMeta": { "@edge-runtime/vm": { "optional": true }, + "@types/node": { + "optional": true + }, "@vitest/browser": { "optional": true }, @@ -2562,15 +3059,6 @@ }, "jsdom": { "optional": true - }, - "playwright": { - "optional": true - }, - "safaridriver": { - "optional": true - }, - "webdriverio": { - "optional": true } } }, @@ -2602,15 +3090,15 @@ } }, "node_modules/w3c-xmlserializer": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz", - "integrity": "sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dev": true, "dependencies": { - "xml-name-validator": "^4.0.0" + "xml-name-validator": "^5.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" } }, "node_modules/webidl-conversions": { @@ -2623,37 +3111,52 @@ } }, "node_modules/whatwg-encoding": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", - "integrity": "sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", "dev": true, "dependencies": { "iconv-lite": "0.6.3" }, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/whatwg-url": { - "version": "12.0.1", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-12.0.1.tgz", - "integrity": "sha512-Ed/LrqB8EPlGxjS+TrsXcpUond1mhccS3pchLhzSgPCnTimUCKj3IZE75pAs5m6heB2U2TMerKFUXheyHY+VDQ==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz", + "integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==", "dev": true, "dependencies": { - "tr46": "^4.1.1", + "tr46": "^5.0.0", "webidl-conversions": "^7.0.0" }, "engines": { - "node": ">=14" + "node": ">=18" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, "node_modules/why-is-node-running": { @@ -2679,9 +3182,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.0.tgz", + "integrity": "sha512-uJq6108EgZMAl20KagGkzCKfMEjxmKvZHG7Tlq0Z6nOky7YF7aq4mOx6xK8TJ/i1LeK4Qus7INktacctDgY8Ow==", "dev": true, "engines": { "node": ">=10.0.0" @@ -2700,12 +3203,12 @@ } }, "node_modules/xml-name-validator": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-4.0.0.tgz", - "integrity": "sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz", + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", "dev": true, "engines": { - "node": ">=12" + "node": ">=18" } }, "node_modules/xmlchars": { diff --git a/package.json b/package.json index c414cfb..50485f9 100644 --- a/package.json +++ b/package.json @@ -29,14 +29,15 @@ "build": "tsc && vite build && rollup --config rollup.config.mjs --environment BUILD:production" }, "devDependencies": { - "@rollup/plugin-terser": "^0.4.3", - "@rollup/plugin-typescript": "^11.1.2", - "@vitest/coverage-v8": "^0.33.0", - "jsdom": "^22.1.0", - "tslib": "^2.6.2", - "vite": "^4.4.5", + "@rollup/plugin-terser": "^0.4.4", + "@rollup/plugin-typescript": "^11.1.6", + "@types/node": "^20.14.2", + "@vitest/coverage-v8": "^1.6.0", + "jsdom": "^24.1.0", + "tslib": "^2.6.3", + "vite": "^5.2.13", "vite-plugin-dts": "^3.9.1", - "vitest": "^0.33.0" + "vitest": "^1.6.0" }, "license": "MIT" } From b3a5553d5d2ff06760f3187b6d85d21f42e4d250 Mon Sep 17 00:00:00 2001 From: Lin Yem Date: Tue, 11 Jun 2024 16:02:42 +0900 Subject: [PATCH 3/4] v1.1.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50485f9..677a029 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@obot-ai/completion-generator", - "version": "1.1.0-preview.1", + "version": "1.1.0", "description": "A completion generator for ObotAI InputCompletion.", "type": "module", "files": [ From 574349d89bd5da22985239e92ab6e5de321e8786 Mon Sep 17 00:00:00 2001 From: Lin Yem Date: Tue, 11 Jun 2024 16:18:01 +0900 Subject: [PATCH 4/4] Fix ConcatMatcher addMatcherByClass --- dist/completion-generator.es5.js | 2 +- dist/completion-generator.js | 3 ++- src/matcher.ts | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dist/completion-generator.es5.js b/dist/completion-generator.es5.js index 8359635..fae9327 100644 --- a/dist/completion-generator.es5.js +++ b/dist/completion-generator.es5.js @@ -1 +1 @@ -var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}function r(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{u(a.next(e))}catch(e){o(e)}}function c(e){try{u(a.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}u((a=a.apply(e,t||[])).next())}))}function a(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,a&&(n=2&c[0]?a.return:c[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,c[1])).done)return n;switch(a=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]=this.maxResults)break}return n}}),Object.defineProperty(r.prototype,"_charMatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=e.text.toLowerCase(),a=e.keywords.toLowerCase(),n=this.minKeywordLength||2,o=t.length,i=[],c=0;c=n&&i.push({text:u,startAt:c,endAt:l}),c=l+1}else{if(-1===r.indexOf(s))return{isMatched:!1};c+=1}}for(var h=[],p=0,d=null,y=null;pb&&h.push(t.slice(b+1,m)),d=y,p+=1}if(0===p)h.push(t);else if(y){var v=y.endAt;v+10&&n.add(e.toLowerCase())}))}));var o=Array.from(n);o.sort((function(e,t){return t.length-e.length})),this.exactRegExpMap.set(t,new RegExp(o.join("|"),"g"));var i=[];o.forEach((function(e){if(e.length>a.minKeywordLength){var t=e.slice(0,a.minKeywordLength),r=[t];(n=e.length-a.minKeywordLength,o=a.minKeywordLength,Array.from(Array(n).keys()).map((function(e){return e+o}))).forEach((function(a){t+=e[a],r.push(t)})),r.reverse(),i.push(r.join("|"))}else e.length>0&&i.push(e);var n,o})),this.partialRegExpMap.set(t,new RegExp(i.join("|"),"g"))}}),Object.defineProperty(r.prototype,"match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.data.get(t);if(!r)return[];var a=Array.from(r);if(this.comparator){var n=this.comparator;a.sort((function(r,a){return n(r,a,e,t)}))}return this._match(a,e,t)}}),Object.defineProperty(r.prototype,"_match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var a=[],n=this.exactRegExpMap.get(r);if(e&&n){var o=void 0;if(!(o=t.toLowerCase().match(n))){var i=this.partialRegExpMap.get(r);i&&(o=t.toLowerCase().match(i))}if(o)for(var c=o.map((function(e){var r=t.indexOf(e);return{text:e,startAt:r,endAt:r+e.length}})),u=function(e){var t=[],r=e.keywords;if(c.forEach((function(e){-1!==r.indexOf(e.text)&&t.push(e)})),t.length>0&&a.push({text:e.text,keywords:e.keywords,matchedKeywords:t}),s.maxResults&&a.length>=s.maxResults)return"break"},s=this,l=0,f=e;l=c.maxResults)return"break"},c=this,u=0,s=o;u=this.maxResults)break}return r}}),r}(n),u=function(e){function r(t){var r=e.call(this,t)||this;return r.addMatcher(new i(t)),r.addMatcher(new o(t)),r}return t(r,e),r}(c),s=o,l=function(){function e(e){void 0===e&&(e={keywordSeparator:",",minKeywordLength:2,strictMatchLocales:["en"]}),Object.defineProperty(this,"matcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e.matcher?this.matcher=e.matcher:this.matcher=new s({keywordSeparator:e.keywordSeparator||",",minKeywordLength:e.minKeywordLength||2,strictMatchLocales:e.strictMatchLocales||["en"],comparator:e.comparator,filter:e.filter})}return Object.defineProperty(e.prototype,"loadData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._validateLocaleData(t),this.matcher.loadData(e,t)}}),Object.defineProperty(e.prototype,"_validateLocaleData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e.text&&"string"==typeof e.keywords})))throw Error("Locale data should be a list of {text: string, keywords: string}")}}),Object.defineProperty(e.prototype,"generateCompletions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e||e.length<=0?[]:this.matcher.match(e,t)}}),Object.defineProperty(e.prototype,"keywordSeparator",{get:function(){return this.matcher.keywordSeparator},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minKeywordLength",{get:function(){return this.matcher.minKeywordLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strictMatchLocales",{get:function(){return this.matcher.strictMatchLocales},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.matcher.data},enumerable:!1,configurable:!0}),e}(),f=function(){function e(e){void 0===e&&(e={apiKey:""}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKeyHeaderName",{enumerable:!0,configurable:!0,writable:!0,value:"X-Secret-Key"}),Object.defineProperty(this,"getEndpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.apiKey=e.apiKey,e.apiKeyHeaderName&&(this.apiKeyHeaderName=e.apiKeyHeaderName),"function"==typeof e.getEndpoint?this.getEndpoint=e.getEndpoint:this.getEndpoint=function(e){return"/input_completion/".concat(e,"/")},"function"==typeof e.handleResponse?this.handleResponse=e.handleResponse:this.handleResponse=function(e){if("user_says"in e&&Array.isArray(e.user_says))return e.user_says;throw Error("Data should have [user_says](Array)")}}return Object.defineProperty(e.prototype,"fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getEndpoint(e);return new Promise((function(e,o){return r(t,void 0,void 0,(function(){var t,r,i;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._fetch(n)];case 1:t=a.sent();try{r=this.handleResponse(t),e(r)}catch(e){o("Invalid data fetched. ".concat(JSON.stringify(t)))}return"user_says"in t&&Array.isArray(t.user_says),[3,3];case 2:return i=a.sent(),o("Failed to fetch data from ".concat(n,".")),console.error(i),[3,3];case 3:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"_fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n,o){return r(t,void 0,void 0,(function(){var t,r,i,c,u;return a(this,(function(a){switch(a.label){case 0:return this.isFetchAvailable()?(t={},this.apiKey&&((r={})[this.apiKeyHeaderName]=this.apiKey,t.headers=r),[4,fetch(e,t)]):[3,5];case 1:return(i=a.sent()).ok&&200==i.status?[4,i.json()]:[3,3];case 2:return c=a.sent(),n(c),[3,4];case 3:o("Failed to fetch data. Status: ".concat(i.status)),a.label=4;case 4:return[3,6];case 5:(u=new XMLHttpRequest).open("GET",e),this.apiKey&&u.setRequestHeader(this.apiKeyHeaderName,this.apiKey),u.onload=function(){if(200===u.status)try{var e=JSON.parse(u.response);n(e)}catch(e){o("Invalid response data format.")}else o("Failed to fetch data. Status: ".concat(u.status))},u.onerror=function(){o("Unknown error occurred while fetching completion data.")},u.send(),a.label=6;case 6:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"isFetchAvailable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof window.fetch}}),e}();export{c as ConcatMatcher,s as DefaultMatcher,f as Fetcher,o as ForwardMatcher,l as Generator,u as KeywordForwardMatcher,i as KeywordMatcher,n as Matcher}; +var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function a(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(a.prototype=r.prototype,new a)}function r(e,t,r,a){return new(r||(r=Promise))((function(n,o){function i(e){try{u(a.next(e))}catch(e){o(e)}}function c(e){try{u(a.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,c)}u((a=a.apply(e,t||[])).next())}))}function a(e,t){var r,a,n,o,i={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(u){return function(c){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(i=0)),i;)try{if(r=1,a&&(n=2&c[0]?a.return:c[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,c[1])).done)return n;switch(a=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,a=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(n=i.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]=this.maxResults)break}return n}}),Object.defineProperty(r.prototype,"_charMatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=e.text.toLowerCase(),a=e.keywords.toLowerCase(),n=this.minKeywordLength||2,o=t.length,i=[],c=0;c=n&&i.push({text:u,startAt:c,endAt:l}),c=l+1}else{if(-1===r.indexOf(s))return{isMatched:!1};c+=1}}for(var h=[],p=0,d=null,y=null;pb&&h.push(t.slice(b+1,m)),d=y,p+=1}if(0===p)h.push(t);else if(y){var v=y.endAt;v+10&&n.add(e.toLowerCase())}))}));var o=Array.from(n);o.sort((function(e,t){return t.length-e.length})),this.exactRegExpMap.set(t,new RegExp(o.join("|"),"g"));var i=[];o.forEach((function(e){if(e.length>a.minKeywordLength){var t=e.slice(0,a.minKeywordLength),r=[t];(n=e.length-a.minKeywordLength,o=a.minKeywordLength,Array.from(Array(n).keys()).map((function(e){return e+o}))).forEach((function(a){t+=e[a],r.push(t)})),r.reverse(),i.push(r.join("|"))}else e.length>0&&i.push(e);var n,o})),this.partialRegExpMap.set(t,new RegExp(i.join("|"),"g"))}}),Object.defineProperty(r.prototype,"match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.data.get(t);if(!r)return[];var a=Array.from(r);if(this.comparator){var n=this.comparator;a.sort((function(r,a){return n(r,a,e,t)}))}return this._match(a,e,t)}}),Object.defineProperty(r.prototype,"_match",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var a=[],n=this.exactRegExpMap.get(r);if(e&&n){var o=void 0;if(!(o=t.toLowerCase().match(n))){var i=this.partialRegExpMap.get(r);i&&(o=t.toLowerCase().match(i))}if(o)for(var c=o.map((function(e){var r=t.indexOf(e);return{text:e,startAt:r,endAt:r+e.length}})),u=function(e){var t=[],r=e.keywords;if(c.forEach((function(e){-1!==r.indexOf(e.text)&&t.push(e)})),t.length>0&&a.push({text:e.text,keywords:e.keywords,matchedKeywords:t}),s.maxResults&&a.length>=s.maxResults)return"break"},s=this,l=0,f=e;l=c.maxResults)return"break"},c=this,u=0,s=o;u=this.maxResults)break}return r}}),r}(n),u=function(e){function r(t){var r=e.call(this,t)||this;return r.addMatcher(new i(t)),r.addMatcher(new o(t)),r}return t(r,e),r}(c),s=o,l=function(){function e(e){void 0===e&&(e={keywordSeparator:",",minKeywordLength:2,strictMatchLocales:["en"]}),Object.defineProperty(this,"matcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),e.matcher?this.matcher=e.matcher:this.matcher=new s({keywordSeparator:e.keywordSeparator||",",minKeywordLength:e.minKeywordLength||2,strictMatchLocales:e.strictMatchLocales||["en"],comparator:e.comparator,filter:e.filter})}return Object.defineProperty(e.prototype,"loadData",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._validateLocaleData(t),this.matcher.loadData(e,t)}}),Object.defineProperty(e.prototype,"_validateLocaleData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!Array.isArray(e)||!e.every((function(e){return"string"==typeof e.text&&"string"==typeof e.keywords})))throw Error("Locale data should be a list of {text: string, keywords: string}")}}),Object.defineProperty(e.prototype,"generateCompletions",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e||e.length<=0?[]:this.matcher.match(e,t)}}),Object.defineProperty(e.prototype,"keywordSeparator",{get:function(){return this.matcher.keywordSeparator},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"minKeywordLength",{get:function(){return this.matcher.minKeywordLength},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"strictMatchLocales",{get:function(){return this.matcher.strictMatchLocales},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"data",{get:function(){return this.matcher.data},enumerable:!1,configurable:!0}),e}(),f=function(){function e(e){void 0===e&&(e={apiKey:""}),Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiKeyHeaderName",{enumerable:!0,configurable:!0,writable:!0,value:"X-Secret-Key"}),Object.defineProperty(this,"getEndpoint",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleResponse",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.apiKey=e.apiKey,e.apiKeyHeaderName&&(this.apiKeyHeaderName=e.apiKeyHeaderName),"function"==typeof e.getEndpoint?this.getEndpoint=e.getEndpoint:this.getEndpoint=function(e){return"/input_completion/".concat(e,"/")},"function"==typeof e.handleResponse?this.handleResponse=e.handleResponse:this.handleResponse=function(e){if("user_says"in e&&Array.isArray(e.user_says))return e.user_says;throw Error("Data should have [user_says](Array)")}}return Object.defineProperty(e.prototype,"fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,n=this.getEndpoint(e);return new Promise((function(e,o){return r(t,void 0,void 0,(function(){var t,r,i;return a(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this._fetch(n)];case 1:t=a.sent();try{r=this.handleResponse(t),e(r)}catch(e){o("Invalid data fetched. ".concat(JSON.stringify(t)))}return"user_says"in t&&Array.isArray(t.user_says),[3,3];case 2:return i=a.sent(),o("Failed to fetch data from ".concat(n,".")),console.error(i),[3,3];case 3:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"_fetch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(n,o){return r(t,void 0,void 0,(function(){var t,r,i,c,u;return a(this,(function(a){switch(a.label){case 0:return this.isFetchAvailable()?(t={},this.apiKey&&((r={})[this.apiKeyHeaderName]=this.apiKey,t.headers=r),[4,fetch(e,t)]):[3,5];case 1:return(i=a.sent()).ok&&200==i.status?[4,i.json()]:[3,3];case 2:return c=a.sent(),n(c),[3,4];case 3:o("Failed to fetch data. Status: ".concat(i.status)),a.label=4;case 4:return[3,6];case 5:(u=new XMLHttpRequest).open("GET",e),this.apiKey&&u.setRequestHeader(this.apiKeyHeaderName,this.apiKey),u.onload=function(){if(200===u.status)try{var e=JSON.parse(u.response);n(e)}catch(e){o("Invalid response data format.")}else o("Failed to fetch data. Status: ".concat(u.status))},u.onerror=function(){o("Unknown error occurred while fetching completion data.")},u.send(),a.label=6;case 6:return[2]}}))}))}))}}),Object.defineProperty(e.prototype,"isFetchAvailable",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"function"==typeof window.fetch}}),e}();export{c as ConcatMatcher,s as DefaultMatcher,f as Fetcher,o as ForwardMatcher,l as Generator,u as KeywordForwardMatcher,i as KeywordMatcher,n as Matcher}; diff --git a/dist/completion-generator.js b/dist/completion-generator.js index bdf3259..8c24175 100644 --- a/dist/completion-generator.js +++ b/dist/completion-generator.js @@ -214,7 +214,8 @@ class E extends g { const o = new e({ keywordSeparator: this.keywordSeparator, minKeywordLength: this.minKeywordLength, - strictMatchLocales: this.strictMatchLocales + strictMatchLocales: this.strictMatchLocales, + comparator: this.comparator }); this.addMatcher(o); } diff --git a/src/matcher.ts b/src/matcher.ts index ad386d0..3f1aca7 100644 --- a/src/matcher.ts +++ b/src/matcher.ts @@ -369,6 +369,7 @@ export class ConcatMatcher extends Matcher { keywordSeparator: this.keywordSeparator, minKeywordLength: this.minKeywordLength, strictMatchLocales: this.strictMatchLocales, + comparator: this.comparator }) this.addMatcher(matcher)