@opra/client 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cjs/714.min.cjs +1 -0
- package/cjs/antlr4ts.min.cjs +2 -0
- package/cjs/antlr4ts.min.cjs.LICENSE.txt +4 -0
- package/cjs/main.min.cjs +1 -0
- package/cjs/opra-common.min.cjs +1 -0
- package/cjs/vendors.min.cjs +2 -0
- package/cjs/vendors.min.cjs.LICENSE.txt +52 -0
- package/esm/714.min.mjs +1 -0
- package/esm/antlr4ts.min.mjs +2 -0
- package/esm/antlr4ts.min.mjs.LICENSE.txt +4 -0
- package/esm/main.min.mjs +1 -0
- package/esm/opra-common.min.mjs +1 -0
- package/esm/vendors.min.mjs +2 -0
- package/esm/vendors.min.mjs.LICENSE.txt +52 -0
- package/package.json +22 -50
- package/{esm → typings}/client-error.d.ts +1 -1
- package/typings/common/constants.d.ts +0 -0
- package/typings/common/exception/enums/issue-severity.enum.d.ts +13 -0
- package/typings/common/exception/error-issue.d.ts +9 -0
- package/typings/common/exception/http-errors/bad-request.error.d.ts +10 -0
- package/typings/common/exception/http-errors/failed-dependency.error.d.ts +9 -0
- package/typings/common/exception/http-errors/forbidden.error.d.ts +11 -0
- package/typings/common/exception/http-errors/internal-server.error.d.ts +9 -0
- package/typings/common/exception/http-errors/method-not-allowed.error.d.ts +10 -0
- package/typings/common/exception/http-errors/not-acceptable.error.d.ts +10 -0
- package/typings/common/exception/http-errors/not-found.error.d.ts +13 -0
- package/typings/common/exception/http-errors/unauthorized.error.d.ts +10 -0
- package/typings/common/exception/http-errors/unprocessable-entity.error.d.ts +9 -0
- package/typings/common/exception/index.d.ts +15 -0
- package/typings/common/exception/opra-exception.d.ts +15 -0
- package/typings/common/exception/resource-errors/resource-conflict.error.d.ts +5 -0
- package/typings/common/exception/resource-errors/resource-not-found.error.d.ts +4 -0
- package/typings/common/exception/wrap-exception.d.ts +2 -0
- package/typings/common/filter/antlr/OpraFilterLexer.d.ts +78 -0
- package/typings/common/filter/antlr/OpraFilterParser.d.ts +365 -0
- package/typings/common/filter/antlr/OpraFilterVisitor.d.ts +290 -0
- package/typings/common/filter/ast/abstract/ast.d.ts +5 -0
- package/typings/common/filter/ast/abstract/expression.d.ts +3 -0
- package/typings/common/filter/ast/abstract/literal.d.ts +6 -0
- package/typings/common/filter/ast/abstract/term.d.ts +3 -0
- package/typings/common/filter/ast/expressions/arithmetic-expression.d.ts +13 -0
- package/typings/common/filter/ast/expressions/array-expression.d.ts +7 -0
- package/typings/common/filter/ast/expressions/comparison-expression.d.ts +10 -0
- package/typings/common/filter/ast/expressions/logical-expression.d.ts +8 -0
- package/typings/common/filter/ast/expressions/parentheses-expression.d.ts +6 -0
- package/typings/common/filter/ast/index.d.ts +16 -0
- package/typings/common/filter/ast/terms/boolean-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/date-literal.d.ts +6 -0
- package/typings/common/filter/ast/terms/external-constant.d.ts +5 -0
- package/typings/common/filter/ast/terms/null-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/number-literal.d.ts +6 -0
- package/typings/common/filter/ast/terms/qualified-identifier.d.ts +4 -0
- package/typings/common/filter/ast/terms/string-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/time-literal.d.ts +6 -0
- package/typings/common/filter/build.d.ts +31 -0
- package/typings/common/filter/error-listener.d.ts +8 -0
- package/typings/common/filter/errors.d.ts +20 -0
- package/typings/common/filter/filter-tree-visitor.d.ts +30 -0
- package/typings/common/filter/index.d.ts +5 -0
- package/typings/common/filter/parse.d.ts +2 -0
- package/typings/common/filter/utils.d.ts +2 -0
- package/typings/common/helpers/index.d.ts +1 -0
- package/typings/common/helpers/responsive-map.d.ts +18 -0
- package/typings/common/http/enums/http-headers.enum.d.ts +379 -0
- package/typings/common/http/enums/http-status.enum.d.ts +290 -0
- package/typings/common/http/http-request.d.ts +34 -0
- package/typings/common/http/index.d.ts +6 -0
- package/typings/common/http/interfaces/client-http-headers.interface.d.ts +65 -0
- package/typings/common/http/interfaces/server-http-headers.interface.d.ts +1 -0
- package/typings/common/http/multipart/batch-multipart.d.ts +31 -0
- package/typings/common/http/multipart/http-request-content.d.ts +8 -0
- package/typings/common/http/multipart/http-response-content.d.ts +7 -0
- package/typings/common/http/multipart/index.d.ts +1 -0
- package/typings/common/http/utils/normalize-headers.d.ts +1 -0
- package/typings/common/i18n/i18n.d.ts +28 -0
- package/typings/common/i18n/index.d.ts +5 -0
- package/typings/common/i18n/string-utils.d.ts +2 -0
- package/typings/common/i18n/translate.d.ts +4 -0
- package/typings/common/index.d.ts +10 -0
- package/typings/common/schema/constants.d.ts +8 -0
- package/typings/common/schema/decorators/opr-collection-resource.decorator.d.ts +8 -0
- package/typings/common/schema/decorators/opr-complex-type.decorator.d.ts +6 -0
- package/typings/common/schema/decorators/opr-field.decorator.d.ts +3 -0
- package/typings/common/schema/decorators/opr-resolver.decorator.d.ts +8 -0
- package/typings/common/schema/decorators/opr-simple-type.decorator.d.ts +6 -0
- package/typings/common/schema/decorators/opr-singleton-resource.decorator.d.ts +8 -0
- package/typings/common/schema/implementation/data-type/builtin/any.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/base64-binary.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/bigint.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/boolean.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/date-string.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/date.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/guid.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/integer.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/number.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/object.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/string.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin-data-types.d.ts +4 -0
- package/typings/common/schema/implementation/data-type/complex-type.d.ts +29 -0
- package/typings/common/schema/implementation/data-type/data-type.d.ts +16 -0
- package/typings/common/schema/implementation/data-type/simple-type.d.ts +12 -0
- package/typings/common/schema/implementation/data-type/union-type.d.ts +16 -0
- package/typings/common/schema/implementation/document-builder.d.ts +16 -0
- package/typings/common/schema/implementation/opra-document.d.ts +44 -0
- package/typings/common/schema/implementation/query/collection-count-query.d.ts +14 -0
- package/typings/common/schema/implementation/query/collection-create-query.d.ts +18 -0
- package/typings/common/schema/implementation/query/collection-delete-many-query.d.ts +14 -0
- package/typings/common/schema/implementation/query/collection-delete-query.d.ts +10 -0
- package/typings/common/schema/implementation/query/collection-get-query.d.ts +21 -0
- package/typings/common/schema/implementation/query/collection-search-query.d.ts +30 -0
- package/typings/common/schema/implementation/query/collection-update-many-query.d.ts +15 -0
- package/typings/common/schema/implementation/query/collection-update-query.d.ts +19 -0
- package/typings/common/schema/implementation/query/field-get-query.d.ts +30 -0
- package/typings/common/schema/implementation/query/index.d.ts +27 -0
- package/typings/common/schema/implementation/query/singleton-get-query.d.ts +20 -0
- package/typings/common/schema/implementation/resource/collection-resource-info.d.ts +19 -0
- package/typings/common/schema/implementation/resource/container-resource-info.d.ts +13 -0
- package/typings/common/schema/implementation/resource/resource-info.d.ts +17 -0
- package/typings/common/schema/implementation/resource/singleton-resource-info.d.ts +14 -0
- package/typings/common/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +3 -0
- package/typings/common/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +4 -0
- package/typings/common/schema/index.d.ts +25 -0
- package/typings/common/schema/interfaces/child-field-query.interface.d.ts +4 -0
- package/typings/common/schema/interfaces/data-type.metadata.d.ts +18 -0
- package/typings/common/schema/interfaces/resource-container.interface.d.ts +8 -0
- package/typings/common/schema/interfaces/resource.metadata.d.ts +18 -0
- package/typings/common/schema/opra-schema.definition.d.ts +178 -0
- package/typings/common/schema/type-helpers/extend-type.helper.d.ts +3 -0
- package/typings/common/schema/type-helpers/mixin-type.helper.d.ts +2 -0
- package/typings/common/schema/type-helpers/mixin.utils.d.ts +3 -0
- package/typings/common/schema/types.d.ts +14 -0
- package/typings/common/schema/utils/class.utils.d.ts +2 -0
- package/typings/common/schema/utils/clone-object.util.d.ts +1 -0
- package/typings/common/schema/utils/inspect.util.d.ts +4 -0
- package/typings/common/schema/utils/normalize-field-array.util.d.ts +3 -0
- package/typings/common/schema/utils/path-to-tree.util.d.ts +4 -0
- package/typings/common/schema/utils/string-compare.util.d.ts +1 -0
- package/typings/common/url/formats/boolean-format.d.ts +5 -0
- package/typings/common/url/formats/date-format.d.ts +16 -0
- package/typings/common/url/formats/filter-format.d.ts +6 -0
- package/typings/common/url/formats/format.d.ts +4 -0
- package/typings/common/url/formats/integer-format.d.ts +9 -0
- package/typings/common/url/formats/number-format.d.ts +12 -0
- package/typings/common/url/formats/string-format.d.ts +14 -0
- package/typings/common/url/index.d.ts +5 -0
- package/typings/common/url/opra-url-path-component.d.ts +15 -0
- package/typings/common/url/opra-url-path.d.ts +30 -0
- package/typings/common/url/opra-url-search-params.d.ts +44 -0
- package/typings/common/url/opra-url.d.ts +79 -0
- package/typings/common/url/utils/path-utils.d.ts +8 -0
- package/typings/common/utils/index.d.ts +3 -0
- package/typings/common/utils/is-url.d.ts +1 -0
- package/typings/common/utils/path-to-tree.d.ts +4 -0
- package/typings/common/utils/type-guards.d.ts +9 -0
- package/{esm → typings}/constants.d.ts +0 -0
- package/{esm → typings}/http/http-client.d.ts +1 -1
- package/{esm → typings}/http/http-collection-service.d.ts +1 -1
- package/{esm → typings}/http/http-request.d.ts +1 -1
- package/{esm → typings}/http/http-response.d.ts +0 -0
- package/{esm → typings}/http/http-singleton-service.d.ts +1 -1
- package/{esm → typings}/http/http-types.d.ts +1 -1
- package/{esm → typings}/http/requests/batch-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-create-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-delete-many-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-delete-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-get-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-search-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-update-many-request.d.ts +1 -1
- package/{esm → typings}/http/requests/collection-update-request.d.ts +1 -1
- package/{esm → typings}/http/requests/http-singleton-get-request.d.ts +1 -1
- package/{esm → typings}/http/utils/merge-raw-http-requests.util.d.ts +0 -0
- package/{esm → typings}/index.d.ts +0 -1
- package/{esm → typings}/interfaces/http-options.interface.d.ts +1 -4
- package/{esm → typings}/interfaces/http-request-config.interface.d.ts +1 -1
- package/umd/714.min.cjs +1 -0
- package/umd/antlr4ts.min.cjs +2 -0
- package/umd/antlr4ts.min.cjs.LICENSE.txt +4 -0
- package/umd/main.min.cjs +1 -0
- package/umd/opra-common.min.cjs +1 -0
- package/umd/vendors.min.cjs +2 -0
- package/umd/vendors.min.cjs.LICENSE.txt +52 -0
- package/cjs/client-error.js +0 -20
- package/cjs/constants.js +0 -6
- package/cjs/http/http-client.js +0 -164
- package/cjs/http/http-collection-service.js +0 -40
- package/cjs/http/http-request.js +0 -66
- package/cjs/http/http-response.js +0 -2
- package/cjs/http/http-singleton-service.js +0 -16
- package/cjs/http/http-types.js +0 -2
- package/cjs/http/requests/batch-request.js +0 -80
- package/cjs/http/requests/collection-create-request.js +0 -35
- package/cjs/http/requests/collection-delete-many-request.js +0 -28
- package/cjs/http/requests/collection-delete-request.js +0 -29
- package/cjs/http/requests/collection-get-request.js +0 -37
- package/cjs/http/requests/collection-search-request.js +0 -44
- package/cjs/http/requests/collection-update-many-request.js +0 -31
- package/cjs/http/requests/collection-update-request.js +0 -40
- package/cjs/http/requests/http-singleton-get-request.js +0 -31
- package/cjs/http/utils/merge-raw-http-requests.util.js +0 -29
- package/cjs/index.js +0 -20
- package/cjs/interfaces/http-options.interface.js +0 -2
- package/cjs/interfaces/http-request-config.interface.js +0 -2
- package/cjs/package.json +0 -3
- package/cjs/types.js +0 -2
- package/esm/client-error.js +0 -16
- package/esm/constants.js +0 -3
- package/esm/http/http-client.js +0 -160
- package/esm/http/http-collection-service.js +0 -36
- package/esm/http/http-request.js +0 -62
- package/esm/http/http-response.js +0 -1
- package/esm/http/http-singleton-service.js +0 -12
- package/esm/http/http-types.js +0 -1
- package/esm/http/requests/batch-request.js +0 -76
- package/esm/http/requests/collection-create-request.js +0 -31
- package/esm/http/requests/collection-delete-many-request.js +0 -24
- package/esm/http/requests/collection-delete-request.js +0 -25
- package/esm/http/requests/collection-get-request.js +0 -33
- package/esm/http/requests/collection-search-request.js +0 -40
- package/esm/http/requests/collection-update-many-request.js +0 -27
- package/esm/http/requests/collection-update-request.js +0 -36
- package/esm/http/requests/http-singleton-get-request.js +0 -27
- package/esm/http/utils/merge-raw-http-requests.util.js +0 -25
- package/esm/index.js +0 -17
- package/esm/interfaces/http-options.interface.js +0 -1
- package/esm/interfaces/http-request-config.interface.js +0 -1
- package/esm/types.d.ts +0 -7
- package/esm/types.js +0 -1
- package/umd/opra-client.umd.min.js +0 -1
package/umd/main.min.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("fast-tokenizer"),require("i18next"),require("luxon"),require("uid"),require("reflect-metadata"),require("lodash-es"),require("rxjs"));else if("function"==typeof define&&define.amd)define(["fast-tokenizer","i18next","luxon","uid","reflect-metadata","lodash-es","rxjs"],e);else{var s="object"==typeof exports?e(require("fast-tokenizer"),require("i18next"),require("luxon"),require("uid"),require("reflect-metadata"),require("lodash-es"),require("rxjs")):e(t["fast-tokenizer"],t.i18next,t.luxon,t.uid,t["reflect-metadata"],t["lodash-es"],t.rxjs);for(var r in s)("object"==typeof exports?exports:t)[r]=s[r]}}(self,((t,e,s,r,i,o,n)=>(()=>{var a,h,u,c,p,l={685:e=>{"use strict";e.exports=t},8661:t=>{"use strict";t.exports=e},2212:t=>{"use strict";t.exports=o},6985:t=>{"use strict";t.exports=s},2150:t=>{"use strict";t.exports=i},3832:t=>{"use strict";t.exports=n},8228:t=>{"use strict";t.exports=r},4854:()=>{},6602:()=>{},7711:(t,e,s)=>{"use strict";s.r(e),s.d(e,{BatchRequest:()=>v,ClientError:()=>i,CollectionCreateRequest:()=>p,CollectionDeleteManyRequest:()=>l,CollectionDeleteRequest:()=>d,CollectionGetRequest:()=>f,CollectionSearchRequest:()=>m,CollectionUpdateManyRequest:()=>y,CollectionUpdateRequest:()=>_,HttpCollectionService:()=>b,HttpRequest:()=>u,HttpSingletonGetRequest:()=>g,HttpSingletonService:()=>w,OpraHttpClient:()=>q});var r=s(2506);class i extends Error{constructor(t,e){super(t.message),this.cause=e,this.issues=t.issues||[],this.status=t.status,e&&(this.cause=e,e.stack&&(this.stack=e.stack))}}const o=/^application\/([\w-]+\+)?\bjson\b/i,n=/^text\/.*$/i,a=/^multipart\/\bform-data\b/i;var h=s(3832);class u extends h.Observable{constructor(t,e={}){super((t=>{"response"!==e.observe?this.resolve().then((e=>{t.next(e),t.complete()})).catch((e=>t.error(e))):this.fetch().then((e=>{t.next(e),t.complete()})).catch((e=>t.error(e)))})),this._handler=t,this.options=e,this.contentId=(0,r.hQ)(6),this.options=e}header(t,e){return this._headers=this._headers||{},this._headers[t]=e,this}async fetch(){const t=this._promise||(this._promise=new Promise(((t,e)=>{setTimeout((()=>{this._execute().then(t).catch(e)}),0)})));return await t}async resolve(){return(await this.fetch()).data}with(t){return t(this),this}binding(){return{}}async _execute(){const t=this.prepare();return await this._handler(t)}}function c(t,...e){let s;const i=[t,...e];let o;for(let t=i.length-1;t>=0;t--){const e=i[t];e?.headers&&(o=o||{},Object.assign(o,(0,r.kh)(e.headers)))}for(const e of i)e&&(Object.assign(t,e),e?.params&&(s=s||new r.G2,e.params.forEach(((t,e)=>s?.append(e,t)))));return t.headers=o,t.params=s,t}class p extends u{constructor(t,e,s,r={}){super(t,r),this._handler=t,this.resource=e,this.data=s,this.options=r}prepare(){const t=new r.G2;return this.options.include&&t.set("$include",this.options.include),this.options.pick&&t.set("$pick",this.options.pick),this.options.omit&&t.set("$omit",this.options.omit),c({method:"POST",path:this.resource.name,params:t,body:this.data},this.options.http)}}class l extends u{constructor(t,e,s={}){super(t,s),this._handler=t,this.resource=e,this.options=s}prepare(){const t=new r.G2;return this.options.filter&&t.set("$filter",this.options.filter),c({method:"DELETE",path:this.resource.name,params:t},this.options.http)}}class d extends u{constructor(t,e,s,r={}){super(t,r),this._handler=t,this.resource=e,this.keyValue=s,this.options=r}prepare(){if(null==this.keyValue||""===this.keyValue)throw new TypeError('Key value required to perform "delete" request');return c({method:"DELETE",path:new r._Y({resource:this.resource.name,key:this.keyValue}).toString()},this.options.http)}}class f extends u{constructor(t,e,s,r={}){super(t,r),this._handler=t,this.resource=e,this.keyValue=s,this.options=r}prepare(){if(null==this.keyValue||""===this.keyValue)throw new TypeError('Key value required to perform "get" request');const t=new r._Y({resource:this.resource.name,key:this.keyValue}),e=new r.G2;return this.options.include&&e.set("$include",this.options.include),this.options.pick&&e.set("$pick",this.options.pick),this.options.omit&&e.set("$omit",this.options.omit),c({method:"GET",path:t.toString(),params:e},this.options.http)}}class m extends u{constructor(t,e,s={}){super(t,s),this._handler=t,this.resource=e,this.options=s}prepare(){const t=new r.G2;return this.options.include&&t.set("$include",this.options.include),this.options.pick&&t.set("$pick",this.options.pick),this.options.omit&&t.set("$omit",this.options.omit),this.options.sort&&t.set("$sort",this.options.sort),this.options.filter&&t.set("$filter",this.options.filter),null!=this.options.limit&&t.set("$limit",this.options.limit),null!=this.options.skip&&t.set("$skip",this.options.skip),null!=this.options.count&&t.set("$count",this.options.count),null!=this.options.distinct&&t.set("$distinct",this.options.distinct),c({method:"GET",path:this.resource.name,params:t},this.options.http)}}class y extends u{constructor(t,e,s,r={}){super(t,r),this._handler=t,this.resource=e,this.data=s,this.options=r}prepare(){const t=new r.G2;return this.options.filter&&t.set("$filter",this.options.filter),c({method:"PATCH",path:this.resource.name,params:t,body:this.data},this.options.http)}}class _ extends u{constructor(t,e,s,r,i={}){super(t,i),this._handler=t,this.resource=e,this.keyValue=s,this.data=r,this.options=i}prepare(){if(null==this.keyValue||""===this.keyValue)throw new TypeError('Key value required to perform "get" request');const t=new r._Y({resource:this.resource.name,key:this.keyValue}),e=new r.G2;return this.options.include&&e.set("$include",this.options.include),this.options.pick&&e.set("$pick",this.options.pick),this.options.omit&&e.set("$omit",this.options.omit),c({method:"PATCH",path:t.toString(),params:e,body:this.data},this.options.http)}}class b{constructor(t,e){this.resource=t,this._handler=e}create(t,e){return new p(this._handler,this.resource,t,e)}delete(t,e){return new d(this._handler,this.resource,t,e)}deleteMany(t){return new l(this._handler,this.resource,t)}get(t,e){return new f(this._handler,this.resource,t,e)}search(t){return new m(this._handler,this.resource,t)}update(t,e,s){return new _(this._handler,this.resource,t,e,s)}updateMany(t,e){return new y(this._handler,this.resource,t,e)}}class g extends u{constructor(t,e,s={}){super(t,s),this._handler=t,this.resource=e,this.options=s}prepare(){const t=new URLSearchParams;return this.options.include&&t.set("$include",""+this.options.include),this.options.pick&&t.set("$pick",""+this.options.pick),this.options.omit&&t.set("$omit",""+this.options.omit),c({method:"GET",path:this.resource.name,params:t},this.options.http)}}class w{constructor(t,e){this.resource=t,this._handler=e}get(t){return new g(this._handler,this.resource,t)}}class v extends u{constructor(t,e,s={}){super(t,s),this._handler=t,this.requests=e,this.options=s,this._results=new WeakMap,this._listeners=new Set,e.forEach((t=>{Object.defineProperty(t,"_execute",{writable:!0,enumerable:!1,configurable:!0,value:()=>new Promise(((e,s)=>{const r=this._results.get(t);if(r)return r.error?s(r.error):e(r.response);const i=(t,r)=>{if(this._listeners.delete(i),t)return s(t);e(r)};this._listeners.add(i)}))})}))}prepare(){const t=this._buildBatchMultipart(this);return c({method:"POST",path:"/$batch",headers:{"content-type":"multipart/mixed;boundary="+t.boundary},body:t.stream()},this.options.http)}_buildBatchMultipart(t){const e=new r.kE;for(const s of t.requests){const t=s.prepare();if(s instanceof v){const t=this._buildBatchMultipart(s);e.addBatch(t)}else e.addRequestPart({method:t.method,url:t.path,headers:t.headers,data:t.body})}return e}async _execute(){const t=this.prepare();return await this._handler(t)}}const k=new Map,x=new Map;class q{constructor(t,e){if(this._serviceUrl=t,this._metadata=e?.document,!this._metadata){const t=k.get(this.serviceUrl.toLowerCase());t&&(this._metadata=t)}this.defaults=e?.defaults||{}}get serviceUrl(){return this._serviceUrl}get initialized(){return!!this._metadata}get metadata(){return this._assertMetadata(),this._metadata}async init(t){if(!t&&this.initialized)return;const e=this.serviceUrl.toLowerCase();let s=x.get(e);if(!s)return s=this._resolveMetadata(),x.set(e,s),s.catch((()=>{})).finally((()=>x.delete(e)));await s}batch(t){return this._assertMetadata(),new v((t=>this._handleRequest(t)),t)}collection(t){this._assertMetadata(),"function"==typeof t&&(t=t.name);const e=this.metadata.getCollectionResource(t);return new b(e,(t=>this._handleRequest(t)))}singleton(t){this._assertMetadata(),"function"==typeof t&&(t=t.name);const e=this.metadata.getSingletonResource(t);return new w(e,(t=>this._handleRequest(t)))}async _resolveMetadata(){const t=await this._handleRequest({method:"GET",path:"/$metadata",headers:{accept:"application/json"}});this._metadata=new r.rG(t.data)}async _handleRequest(t){c(t,this.defaults);let e=(0,r.Vo)(this.serviceUrl,t.path);return t.params&&(e+="?"+t.params.toString()),t.body&&"object"==typeof t.body&&((0,r.FA)(t.body)||(0,r.Os)(t.body)||Buffer.isBuffer(t.body)||(t.headers?.["content-type"]||(t.headers=t.headers||{},t.headers["content-type"]="application/json"),t.body=JSON.stringify(t.body))),this._fetch(e,t)}async _fetch(t,e){const s=await fetch(t,e);let r;if(s.body&&(o.test(s.headers.get("Content-Type")||"")?(r=await s.json(),"string"==typeof r&&(r=JSON.parse(r))):r=n.test(s.headers.get("Content-Type")||"")?await s.text():a.test(s.headers.get("Content-Type")||"")?await s.formData():await s.arrayBuffer()),s.status>=400&&s.status<600)throw new i({message:s.status+" "+s.statusText,status:s.status,issues:r?.errors});return{get headers(){return s.headers},get ok(){return s.ok},get redirected(){return s.redirected},get status(){return s.status},get statusText(){return s.statusText},get type(){return s.type},get url(){return s.url},get contentId(){return s.headers.get("Content-ID")},get data(){return r}}}_assertMetadata(){if(!this._metadata)throw new Error("You must call init() to before using the client instance")}static async create(t,e){const s=new this(t,e);return s._metadata||await s.init(),s}}}},d={};function f(t){var e=d[t];if(void 0!==e)return e.exports;var s=d[t]={exports:{}};return l[t].call(s.exports,s,s.exports,f),s.exports}f.m=l,a=[],f.O=(t,e,s,r)=>{if(!e){var i=1/0;for(u=0;u<a.length;u++){for(var[e,s,r]=a[u],o=!0,n=0;n<e.length;n++)(!1&r||i>=r)&&Object.keys(f.O).every((t=>f.O[t](e[n])))?e.splice(n--,1):(o=!1,r<i&&(i=r));if(o){a.splice(u--,1);var h=s();void 0!==h&&(t=h)}}return t}r=r||0;for(var u=a.length;u>0&&a[u-1][2]>r;u--)a[u]=a[u-1];a[u]=[e,s,r]},u=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,f.t=function(t,e){if(1&e&&(t=this(t)),8&e)return t;if("object"==typeof t&&t){if(4&e&&t.__esModule)return t;if(16&e&&"function"==typeof t.then)return t}var s=Object.create(null);f.r(s);var r={};h=h||[null,u({}),u([]),u(u)];for(var i=2&e&&t;"object"==typeof i&&!~h.indexOf(i);i=u(i))Object.getOwnPropertyNames(i).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,f.d(s,r),s},f.d=(t,e)=>{for(var s in e)f.o(e,s)&&!f.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},f.f={},f.e=t=>Promise.all(Object.keys(f.f).reduce(((e,s)=>(f.f[s](t,e),e)),[])),f.u=t=>t+".min.cjs",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),f.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),c={},p="@opra/node-client:",f.l=(t,e,s,r)=>{if(c[t])c[t].push(e);else{var i,o;if(void 0!==s)for(var n=document.getElementsByTagName("script"),a=0;a<n.length;a++){var h=n[a];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==p+s){i=h;break}}i||(o=!0,(i=document.createElement("script")).charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.setAttribute("data-webpack",p+s),i.src=t),c[t]=[e];var u=(e,s)=>{i.onerror=i.onload=null,clearTimeout(l);var r=c[t];if(delete c[t],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach((t=>t(s))),e)return e(s)},l=setTimeout(u.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=u.bind(null,i.onerror),i.onload=u.bind(null,i.onload),o&&document.head.appendChild(i)}},f.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;f.g.importScripts&&(t=f.g.location+"");var e=f.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");s.length&&(t=s[s.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f.p=t})(),(()=>{var t={179:0};f.f.j=(e,s)=>{var r=f.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var i=new Promise(((s,i)=>r=t[e]=[s,i]));s.push(r[2]=i);var o=f.p+f.u(e),n=new Error;f.l(o,(s=>{if(f.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var i=s&&("load"===s.type?"missing":s.type),o=s&&s.target&&s.target.src;n.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",n.name="ChunkLoadError",n.type=i,n.request=o,r[1](n)}}),"chunk-"+e,e)}},f.O.j=e=>0===t[e];var e=(e,s)=>{var r,i,[o,n,a]=s,h=0;if(o.some((e=>0!==t[e]))){for(r in n)f.o(n,r)&&(f.m[r]=n[r]);if(a)var u=a(f)}for(e&&e(s);h<o.length;h++)i=o[h],f.o(t,i)&&t[i]&&t[i][0](),t[i]=0;return f.O(u)},s=self.webpackChunk_opra_node_client=self.webpackChunk_opra_node_client||[];s.forEach(e.bind(null,0)),s.push=e.bind(null,s.push.bind(s))})();var m=f.O(void 0,[459,409,216],(()=>f(7711)));return m=f.O(m)})()));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_opra_node_client=self.webpackChunk_opra_node_client||[]).push([[409],{2506:(t,e,r)=>{r.d(e,{kE:()=>pe,rG:()=>dr,_Y:()=>vr,G2:()=>kr,FA:()=>se,Os:()=>ne,Vo:()=>Tr,kh:()=>he,hQ:()=>re.uid});var i=r(685),s=r(8661);const n=/^(https?:\/\/.)[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/i;const o=/\\(.)/g;function a(t){return t.replace(o,"$1")}const c=Object.getPrototypeOf(s).constructor,h=[];class l extends c{async init(t,e){const r="object"==typeof t?t:{},i="function"==typeof t?t:e;try{const t=await super.init(r),e=this.services.formatter;if(e.add("lowercase",((t,e)=>t.toLocaleLowerCase(e))),e.add("uppercase",((t,e)=>t.toLocaleUpperCase(e))),e.add("upperFirst",((t,e)=>t.charAt(0).toLocaleUpperCase(e)+t.substring(1))),h.length&&await this.loadResourceDir(h,!1,!0),r?.resourceDirs?.length&&await this.loadResourceDir(r.resourceDirs,!1,!0),r?.resources)for(const t of Object.keys(r.resources)){const e=r.resources[t];for(const r of Object.keys(e))this.addResourceBundle(t,r,e[r],!1,!0)}return i&&i(null,t),t}catch(t){throw i&&i(t,this.t),t}}deep(t,e){if(null==t)return t;const r=new WeakMap;return this._deepTranslate(t,r,e)}registerLocaleDir(...t){h.push(...t)}async loadResourceBundle(t,e,i,s,o){let a;if(c=i,n.test(c))a=(await fetch(i,{headers:{accept:"application/json"}})).json();else{const t=await r.e(714).then(r.t.bind(r,3714,19)),e=await t.readFile(i,"utf8");a=JSON.parse(e)}var c;this.addResourceBundle(t,e,a,s,o)}async loadResourceDir(t,e,i){const s=await r.e(714).then(r.t.bind(r,3714,19)),n=await r.e(216).then(r.t.bind(r,4371,19));for(const r of Array.isArray(t)?t:[t]){if(!(await s.stat(r)).isDirectory()){console.warn(`Locale directory does not exists. (${r})`);continue}const t=await s.readdir(r);for(const o of t){const t=n.join(r,o);if((await s.stat(t)).isDirectory()){const r=await s.readdir(t);for(const a of r){const r=n.join(t,a),c=n.extname(a);if(".json"===c&&(await s.stat(r)).isFile()){const t=n.basename(a,c);await this.loadResourceBundle(o,t,r,e,i)}}}}}}createInstance(t={},e){return new l(t,e)}static createInstance(t,e){return new l(t,e)}_deepTranslate(t,e,r){if(null==t)return t;if(r?.ignore&&r.ignore(t,this))return t;if("object"==typeof t&&e.has(t))return e.get(t);if("string"==typeof t){let e="";for(let s of(0,i.tokenize)(t,{brackets:{"$t(":")"},quotes:!0,keepQuotes:!0,keepBrackets:!0,keepDelimiters:!0}))if(s.startsWith("$t(")&&s.endsWith(")")){s=s.substring(3,s.length-1);const t=(0,i.splitString)(s,{delimiters:"?",quotes:!0,brackets:{"{":"}"}}),n=a(s.substring((t[0]||"").length+1));s=t[0]||"";const o=[];let c=null;for(const t of(0,i.tokenize)(s,{delimiters:",",quotes:!0,brackets:{"{":"}"}}))t.startsWith("{")?c=JSON.parse(t):o.push(t);const h=o.length>1?"$t("+o.join(",")+")":o[0];e+=n?this.t(h,n,{...r,...c}):this.t(h,{...r,...c})}else e+=s;return e}if(Array.isArray(t)){const i=Array(t.length);e.set(t,i);for(let s=0,n=t.length;s<n;s++)i[s]=this._deepTranslate(t[s],e,r);return e.delete(t),i}if("object"==typeof t){if(Buffer.isBuffer(t))return t;if(Buffer.isBuffer(t)||t instanceof Symbol||t instanceof RegExp||t instanceof Map||t instanceof Set||t instanceof WeakMap||t instanceof WeakSet)return t;const i={};e.set(t,i);const s=Object.keys(t);for(let n=0,o=s.length;n<o;n++){const o=s[n];i[o]=this._deepTranslate(t[o],e,r)}return e.delete(t),i}return t}static get defaultInstance(){return u}}const u=l.createInstance();l.createInstance().init().catch((()=>{}));class _ extends Error{constructor(t,e){super(""),this.status=500,this._initName(),e&&(this.cause=e,e.stack&&(this.stack=e.stack)),this._init(t||e||"Unknown error"),this.message=i18n.deep(this.issue.message)}get issue(){return this._issue}setIssue(t){this._issue={message:"Unknown error",severity:"error",...t}}setStatus(t){return this.status=t,this}_initName(){this.name=this.constructor.name}_init(t){t instanceof Error?("number"==typeof t.status?this.status=t.status:"function"==typeof t.getStatus&&(this.status=t.getStatus()),this.setIssue({message:t.message})):"object"==typeof t?this.setIssue(t):this.setIssue({message:String(t)})}}var d;!function(t){let e;!function(t){t.fatal="fatal",t.error="error",t.warning="warning",t.info="info"}(e=t.Enum||(t.Enum={})),t.name="IssueSeverity",t.description="Severity of the issue",t.Keys=Object.keys(t),t.descriptions={fatal:"The issue caused the action to fail and no further checking could be performed",error:"The issue is sufficiently important to cause the action to fail",warning:"The issue is not important enough to cause the action to fail but may cause it to be performed suboptimally or in a way that is not as desired",info:"The issue has no relation to the degree of success of the action"}}(d||(d={}));class p{constructor(){this.kind=Object.getPrototypeOf(this).constructor.name}}class f extends p{}class T extends f{constructor(){super(),this.items=[]}append(t,e){return this.items.push(new y({op:t,expression:e})),this}toString(){return this.items.map(((t,e)=>(e>0?t.op:"")+t.expression)).join("")}}class y{constructor(t){Object.assign(this,t)}}class E extends f{}class m extends E{constructor(t){super(),this.items=t}toString(){return"["+this.items.map((t=>""+t)).join(",")+"]"}}const g=/\w/;class R extends f{constructor(t){super(),Object.assign(this,t)}toString(){return`${this.left}${g.test(this.op)?" "+this.op+" ":this.op}${this.right}`}}class x extends f{constructor(t){super(),Object.assign(this,t)}toString(){return this.items.map((t=>""+t)).join(" "+this.op+" ")}}class v extends f{constructor(t){super(),this.expression=t}toString(){return`(${this.expression})`}}class A extends E{constructor(t){super(),this.value=t}toString(){return""+this.value}}class I extends A{constructor(t){super(t)}}var w=r(6985);class O extends TypeError{}class C extends TypeError{}class b extends Error{constructor(t,e){super(t),Object.assign(this,e)}}const S=/'/g,N=/(\\)/g,L=/\\(.)/g;function k(t){return"'"+function(t){return t.replace(N,"\\\\")}(t).replace(S,"\\'")+"'"}function D(t){return t&&(t.startsWith("'")||t.startsWith('"'))&&t.endsWith(t.charAt(0))?function(t){return t.replace(L,"$1")}(t.substring(1,t.length-1)):t}const U=/^(\d{4})-(0[1-9]|1[012])-([123]0|[012][1-9]|31)/;class P extends A{constructor(t){if(super(""),t instanceof Date)this.value=t.toISOString();else{if("string"!=typeof t||!U.test(t)||!w.DateTime.fromISO(t).isValid)throw new C(`Invalid date value "${t}"`);this.value=t}}toString(){return k(this.value)}}class F extends A{constructor(){super(null),this.value=null}}class M extends A{constructor(t){if(super(0),"number"!=typeof t&&"bigint"!=typeof t){try{if("string"==typeof t){if(t.includes("."))return void(this.value=parseFloat(t));const e=Number(t);return void(this.value=""+e===t?e:BigInt(t))}}catch{}throw new C(`Invalid number literal ${t}`)}this.value=t}toString(){return"bigint"==typeof this.value?(""+this.value).replace(/n$/,""):""+this.value}}class H extends A{constructor(t){super(""+t)}}class $ extends A{constructor(t){super(""+t)}toString(){return k(this.value)}}const j=/^([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?(\.(\d+))?$/;class B extends A{constructor(t){if(super(""),t instanceof Date)this.value=G(t.getHours())+":"+G(t.getMinutes())+(t.getSeconds()?":"+G(t.getSeconds()):"")+(t.getMilliseconds()?"."+G(t.getMilliseconds()):"");else{if("string"!=typeof t||!j.test(t))throw new C(`Invalid time value "${t}"`);this.value=t}}toString(){return k(this.value)}}function G(t){return t<=9?"0"+t:""+t}var z=r(5029),V=r(6349),q=r(8170),W=r(9796),Y=r(1434),X=r(3070);class Q extends q.Lexer{constructor(t){super(t),this._interp=new W.LexerATNSimulator(Q._ATN,this)}get vocabulary(){return Q.VOCABULARY}get grammarFileName(){return"OpraFilter.g4"}get ruleNames(){return Q.ruleNames}get serializedATN(){return Q._serializedATN}get channelNames(){return Q.channelNames}get modeNames(){return Q.modeNames}static get _ATN(){return Q.__ATN||(Q.__ATN=(new V.ATNDeserializer).deserialize(X.toCharArray(Q._serializedATN))),Q.__ATN}}Q.T__0=1,Q.T__1=2,Q.T__2=3,Q.T__3=4,Q.T__4=5,Q.T__5=6,Q.T__6=7,Q.T__7=8,Q.T__8=9,Q.T__9=10,Q.T__10=11,Q.T__11=12,Q.T__12=13,Q.T__13=14,Q.T__14=15,Q.T__15=16,Q.T__16=17,Q.T__17=18,Q.T__18=19,Q.T__19=20,Q.T__20=21,Q.T__21=22,Q.T__22=23,Q.T__23=24,Q.T__24=25,Q.T__25=26,Q.T__26=27,Q.T__27=28,Q.T__28=29,Q.T__29=30,Q.T__30=31,Q.T__31=32,Q.T__32=33,Q.T__33=34,Q.T__34=35,Q.T__35=36,Q.T__36=37,Q.T__37=38,Q.T__38=39,Q.T__39=40,Q.T__40=41,Q.T__41=42,Q.T__42=43,Q.T__43=44,Q.T__44=45,Q.T__45=46,Q.DATE=47,Q.DATETIME=48,Q.TIME=49,Q.IDENTIFIER=50,Q.STRING=51,Q.NUMBER=52,Q.INTEGER=53,Q.WHITESPACE=54,Q.COMMENT=55,Q.LINE_COMMENT=56,Q.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],Q.modeNames=["DEFAULT_MODE"],Q.ruleNames=["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","T__14","T__15","T__16","T__17","T__18","T__19","T__20","T__21","T__22","T__23","T__24","T__25","T__26","T__27","T__28","T__29","T__30","T__31","T__32","T__33","T__34","T__35","T__36","T__37","T__38","T__39","T__40","T__41","T__42","T__43","T__44","T__45","DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT","NUMBERFORMAT","INTEGERFORMAT","DATEFORMAT","TIMEFORMAT","TIMEZONEOFFSETFORMAT","ESC","UNICODE","HEX"],Q._LITERAL_NAMES=[void 0,"'('","')'","'['","','","']'","'year'","'month'","'week'","'day'","'hour'","'minute'","'second'","'millisecond'","'years'","'months'","'weeks'","'days'","'hours'","'minutes'","'seconds'","'milliseconds'","'.'","'@'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'+'","'-'","'*'","'/'","'and'","'or'","'true'","'false'","'null'","'Infinity'","'infinity'"],Q._SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT"],Q.VOCABULARY=new Y.VocabularyImpl(Q._LITERAL_NAMES,Q._SYMBOLIC_NAMES,[]),Q._serializedATN='줝쪺֍꾺体؇쉁:Ț\b\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t !\t!"\t"#\t#$\t$%\t%&\t&\'\t\'(\t()\t)*\t*+\t+,\t,-\t-.\t./\t/0\t01\t12\t23\t34\t45\t56\t67\t78\t89\t9:\t:;\t;<\t<=\t=>\t>?\t?@\t@A\tA\b\b\b\b\b\b\t\t\t\t\t\n\n\n\n\v\v\v\v\v\f\f\f\f\f\f\f\r\r\r\r\r\r\r !!!!!""""""######$$$$$$$%%&&\'\'(())))***+++++,,,,,,-----........./////////000000000ŧ\n0111111111111111ŷ\n1222222222Ɓ\n2333ƅ\n3\f33ƈ\v34444ƍ\n4\f44Ɛ\v444444Ɩ\n4\f44ƙ\v444Ɯ\n4556677ƣ\n7\r77Ƥ7788888ƭ\n8\f88ư\v88888899999ƻ\n9\f99ƾ\v999::ǃ\n:\r::DŽ:::lj\n:\r::NJ:Ǎ\n:;;<<<<<<<<<<ǚ\n<<<<<<<<<ǣ\n<=====ǩ\n============ǵ\n=\r==Ƕ=ǹ\n==ǻ\n=>>>>Ȁ\n>>>>>ȅ\n>>>>>Ȋ\n>>Ȍ\n>????ȑ\n?@@@@@@AAƮB\t\v\r\b\t\n\v\f\r!#%\')+-/13579;= ?!A"C#E$G%I&K\'M(O)Q*S+U,W-Y.[/]0_1a2c3e4g5i6k7m8o9q:suwy{}&&C\\aac|&&2;C\\aac|))$$\v\f""\f\f2;223;332435232527--//2;CHchȬ\t\v\r!#%\')+-/13579;=?ACEGIKMOQSUWY[]_acegikmoq
\t\v\r¡¦´ÀÆ!Í#Ó%Ø\'Þ)æ+î-û/ý1ÿ3Ă5Ą7Ć9ĉ;ċ=Ď?đAĕCĚEĠGĦIĭKįMıOijQĵSĹUļWŁYŇ[Ō]ŕ_ŦaŶcƀeƂgƛiƝkƟmƢoƨqƶsǂuǎwǐyǨ{ȋ}ȍȒȘ*
+]\b.\n_\f{gctoqpvjyggmfc { ¡¢j¢£q£¤w¤¥t¥¦§o§¨k¨©p©ªwª«v«¬g¬®u®¯g¯°e°±q±²p²³f³´µoµ¶k¶·n·¸n¸¹k¹ºuº»g»¼e¼½q½¾p¾¿f¿ÀÁ{ÁÂgÂÃcÃÄtÄÅuÅÆÇoÇÈqÈÉpÉÊvÊËjËÌuÌ ÍÎyÎÏgÏÐgÐÑmÑÒuÒ"ÓÔfÔÕcÕÖ{Ö×u×$ØÙjÙÚqÚÛwÛÜtÜÝuÝ&Þßoßàkàápáâwâãvãägäåuå(æçuçègèéeéêqêëpëìfìíuí*îïoïðkðñnñònòókóôuôõgõöeö÷q÷øpøùfùúuú,ûü0ü.ýþBþ0ÿĀ>Āā?ā2Ăă>ă4Ąą@ą6Ćć@ćĈ?Ĉ8ĉĊ?Ċ:ċČ#Čč?č<ĎďkďĐpĐ>đĒ#ĒēkēĔpĔ@ĕĖnĖėkėĘmĘęgęBĚě#ěĜnĜĝkĝĞmĞğgğDĠġkġĢnĢģkģĤmĤĥgĥFĦħ#ħĨkĨĩnĩĪkĪīmīĬgĬHĭĮ-ĮJįİ/İLıIJ,IJNijĴ1ĴPĵĶcĶķpķĸfĸRĹĺqĺĻtĻTļĽvĽľtľĿwĿŀgŀVŁłhłŃcŃńnńŅuŅņgņXŇňpňʼnwʼnŊnŊŋnŋZŌōKōŎpŎŏhŏŐkŐőpőŒkŒœvœŔ{Ŕ\\ŕŖkŖŗpŗŘhŘřkřŚpŚśkśŜvŜŝ{ŝ^Şş)şŠw<Šš)šŧŢţ$ţŤw<Ťť$ťŧŦŞŦŢŧ`Ũũ)ũŪw<ŪūVūŬy=Ŭŭ{>ŭŮ)ŮŷůŰ$Űűw<űŲVŲųy=ųŴ{>Ŵŵ$ŵŷŶŨŶůŷbŸŹ)Źźy=źŻ)ŻƁżŽ$Žžy=žſ$ſƁƀŸƀżƁdƂƆ\tƃƅ\tƄƃƅƈƆƄƆƇƇfƈƆƉƎ)Ɗƍ}?Ƌƍ\nƌƊƌƋƍƐƎƌƎƏƏƑƐƎƑƜ)ƒƗ$ƓƖ}?ƔƖ\nƕƓƕƔƖƙƗƕƗƘƘƚƙƗƚƜ$ƛƉƛƒƜhƝƞs:ƞjƟƠu;Ơlơƣ\tƢơƣƤƤƢƤƥƥƦƦƧ\b7ƧnƨƩ1Ʃƪ,ƪƮƫƭ\vƬƫƭưƮƯƮƬƯƱưƮƱƲ,ƲƳ1ƳƴƴƵ\b8ƵpƶƷ1ƷƸ1ƸƼƹƻ\nƺƹƻƾƼƺƼƽƽƿƾƼƿǀ\b9ǀrǁǃ\t\bǂǁǃDŽDŽǂDŽDžDžnjdžLj0LJlj\t\bLjLJljNJNJLjNJNjNjǍnjdžnjǍǍtǎǏ\t\bǏvǐǑ\t\bǑǒ\t\bǒǓ\t\bǓǔ\t\bǔǙ/Ǖǖ\t\tǖǚ\t\nǗǘ\t\vǘǚ\t\fǙǕǙǗǚǛǛǢ/ǜǝ\t\rǝǣ\t\tǞǟ\t\fǟǣ\t\nǠǡ5ǡǣ3ǢǜǢǞǢǠǣxǤǥ\tǥǩ\t\bǦǧ4ǧǩ\tǨǤǨǦǩǪǪǫ<ǫǬ\tǬǭ\t\bǭǺǮǯ<ǯǰ\tǰDZ\t\bDZǸDzǴ0dzǵ\t\bǴdzǵǶǶǴǶǷǷǹǸDzǸǹǹǻǺǮǺǻǻzǼȌ\\ǽȄ\tǾȀ\tǿǾǿȀȀȁȁȅ\t\bȂȃ4ȃȅ\tȄǿȄȂȅȉȆȇ<ȇȈ\tȈȊ\t\bȉȆȉȊȊȌȋǼȋǽȌ|ȍȐ^Ȏȑ@ȏȑ\vȐȎȐȏȑ~ȒȓwȓȔAȔȕAȕȖAȖȗAȗȘș\tșŦŶƀƆƌƎƕƗƛƤƮƼDŽNJnjǙǢǨǶǸǺǿȄȉȋȐ';var K=r(8148),Z=r(1103),J=r(1202),tt=r(3679),et=r(9248),rt=r(4217),it=r(1100),st=r(8999);class nt extends tt.Parser{constructor(t){super(t),this._interp=new rt.ParserATNSimulator(nt._ATN,this)}get vocabulary(){return nt.VOCABULARY}get grammarFileName(){return"OpraFilter.g4"}get ruleNames(){return nt.ruleNames}get serializedATN(){return nt._serializedATN}createFailedPredicateException(t,e){return new Z.FailedPredicateException(this,t,e)}root(){let t=new ot(this._ctx,this.state);this.enterRule(t,0,nt.RULE_root);try{this.enterOuterAlt(t,1),this.state=44,this.expression(0),this.state=45,this.match(nt.EOF)}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}expression(t){void 0===t&&(t=0);let e,r=this._ctx,i=this.state,s=new at(this._ctx,i),n=s;this.enterRecursionRule(s,2,nt.RULE_expression,t);try{let t;switch(this.enterOuterAlt(s,1),this.state=67,this._errHandler.sync(this),this._input.LA(1)){case nt.T__22:case nt.T__41:case nt.T__42:case nt.T__43:case nt.T__44:case nt.T__45:case nt.DATE:case nt.DATETIME:case nt.TIME:case nt.IDENTIFIER:case nt.STRING:case nt.NUMBER:s=new ct(s),this._ctx=s,n=s,this.state=48,this.term();break;case nt.T__35:case nt.T__36:s=new ht(s),this._ctx=s,n=s,this.state=49,this.polarOp(),this.state=50,this.expression(6);break;case nt.T__0:s=new dt(s),this._ctx=s,n=s,this.state=52,this.match(nt.T__0),this.state=53,this.expression(0),this.state=54,this.match(nt.T__1);break;case nt.T__2:for(s=new pt(s),this._ctx=s,n=s,this.state=56,this.match(nt.T__2),this.state=57,this.expression(0),this.state=62,this._errHandler.sync(this),e=this._input.LA(1);e===nt.T__3;)this.state=58,this.match(nt.T__3),this.state=59,this.expression(0),this.state=64,this._errHandler.sync(this),e=this._input.LA(1);this.state=65,this.match(nt.T__4);break;default:throw new J.NoViableAltException(this)}for(this._ctx._stop=this._input.tryLT(-1),this.state=83,this._errHandler.sync(this),t=this.interpreter.adaptivePredict(this._input,3,this._ctx);2!==t&&t!==K.ATN.INVALID_ALT_NUMBER;){if(1===t)switch(null!=this._parseListeners&&this.triggerExitRuleEvent(),n=s,this.state=81,this._errHandler.sync(this),this.interpreter.adaptivePredict(this._input,2,this._ctx)){case 1:if(s=new lt(new at(r,i)),this.pushNewRecursionContext(s,2,nt.RULE_expression),this.state=69,!this.precpred(this._ctx,5))throw this.createFailedPredicateException("this.precpred(this._ctx, 5)");this.state=70,this.arthOp(),this.state=71,this.expression(6);break;case 2:if(s=new ut(new at(r,i)),this.pushNewRecursionContext(s,2,nt.RULE_expression),this.state=73,!this.precpred(this._ctx,4))throw this.createFailedPredicateException("this.precpred(this._ctx, 4)");this.state=74,this.compOp(),this.state=75,this.expression(5);break;case 3:if(s=new _t(new at(r,i)),this.pushNewRecursionContext(s,2,nt.RULE_expression),this.state=77,!this.precpred(this._ctx,3))throw this.createFailedPredicateException("this.precpred(this._ctx, 3)");this.state=78,this.logOp(),this.state=79,this.expression(4)}this.state=85,this._errHandler.sync(this),t=this.interpreter.adaptivePredict(this._input,3,this._ctx)}}catch(t){if(!(t instanceof it.RecognitionException))throw t;s.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.unrollRecursionContexts(r)}return s}term(){let t=new ft(this._ctx,this.state);this.enterRule(t,4,nt.RULE_term);try{switch(this.state=89,this._errHandler.sync(this),this._input.LA(1)){case nt.T__41:case nt.T__42:case nt.T__43:case nt.T__44:case nt.T__45:case nt.DATE:case nt.DATETIME:case nt.TIME:case nt.STRING:case nt.NUMBER:t=new Tt(t),this.enterOuterAlt(t,1),this.state=86,this.literal();break;case nt.IDENTIFIER:t=new yt(t),this.enterOuterAlt(t,2),this.state=87,this.qualifiedIdentifier();break;case nt.T__22:t=new Et(t),this.enterOuterAlt(t,3),this.state=88,this.externalConstant();break;default:throw new J.NoViableAltException(this)}}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}invocable(){let t=new mt(this._ctx,this.state);this.enterRule(t,6,nt.RULE_invocable);try{this.enterOuterAlt(t,1),this.state=91,this.function()}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}invocation(){let t=new gt(this._ctx,this.state);this.enterRule(t,8,nt.RULE_invocation);try{t=new Rt(t),this.enterOuterAlt(t,1),this.state=93,this.identifier()}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}indexer(){let t=new xt(this._ctx,this.state);this.enterRule(t,10,nt.RULE_indexer);try{switch(this.state=97,this._errHandler.sync(this),this._input.LA(1)){case nt.IDENTIFIER:t=new vt(t),this.enterOuterAlt(t,1),this.state=95,this.identifier();break;case nt.INTEGER:t=new At(t),this.enterOuterAlt(t,2),this.state=96,this.match(nt.INTEGER);break;default:throw new J.NoViableAltException(this)}}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}function(){let t,e=new It(this._ctx,this.state);this.enterRule(e,12,nt.RULE_function);try{this.enterOuterAlt(e,1),this.state=99,this.identifier(),this.state=100,this.match(nt.T__0),this.state=102,this._errHandler.sync(this),t=this._input.LA(1),(0==(-32&t)&&0!=(1<<t&(1<<nt.T__0|1<<nt.T__2|1<<nt.T__22))||0==(t-36&-32)&&0!=(1<<t-36&(1<<nt.T__35-36|1<<nt.T__36-36|1<<nt.T__41-36|1<<nt.T__42-36|1<<nt.T__43-36|1<<nt.T__44-36|1<<nt.T__45-36|1<<nt.DATE-36|1<<nt.DATETIME-36|1<<nt.TIME-36|1<<nt.IDENTIFIER-36|1<<nt.STRING-36|1<<nt.NUMBER-36)))&&(this.state=101,this.paramList()),this.state=104,this.match(nt.T__1)}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}paramList(){let t,e=new wt(this._ctx,this.state);this.enterRule(e,14,nt.RULE_paramList);try{for(this.enterOuterAlt(e,1),this.state=106,this.expression(0),this.state=111,this._errHandler.sync(this),t=this._input.LA(1);t===nt.T__3;)this.state=107,this.match(nt.T__3),this.state=108,this.expression(0),this.state=113,this._errHandler.sync(this),t=this._input.LA(1)}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}unit(){let t=new Ot(this._ctx,this.state);this.enterRule(t,16,nt.RULE_unit);try{switch(this.state=117,this._errHandler.sync(this),this._input.LA(1)){case nt.T__5:case nt.T__6:case nt.T__7:case nt.T__8:case nt.T__9:case nt.T__10:case nt.T__11:case nt.T__12:this.enterOuterAlt(t,1),this.state=114,this.dateTimePrecision();break;case nt.T__13:case nt.T__14:case nt.T__15:case nt.T__16:case nt.T__17:case nt.T__18:case nt.T__19:case nt.T__20:this.enterOuterAlt(t,2),this.state=115,this.pluralDateTimePrecision();break;case nt.STRING:this.enterOuterAlt(t,3),this.state=116,this.match(nt.STRING);break;default:throw new J.NoViableAltException(this)}}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}dateTimePrecision(){let t,e=new Ct(this._ctx,this.state);this.enterRule(e,18,nt.RULE_dateTimePrecision);try{this.enterOuterAlt(e,1),this.state=119,t=this._input.LA(1),0!=(-32&t)||0==(1<<t&(1<<nt.T__5|1<<nt.T__6|1<<nt.T__7|1<<nt.T__8|1<<nt.T__9|1<<nt.T__10|1<<nt.T__11|1<<nt.T__12))?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}pluralDateTimePrecision(){let t,e=new bt(this._ctx,this.state);this.enterRule(e,20,nt.RULE_pluralDateTimePrecision);try{this.enterOuterAlt(e,1),this.state=121,t=this._input.LA(1),0!=(-32&t)||0==(1<<t&(1<<nt.T__13|1<<nt.T__14|1<<nt.T__15|1<<nt.T__16|1<<nt.T__17|1<<nt.T__18|1<<nt.T__19|1<<nt.T__20))?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}qualifiedIdentifier(){let t=new St(this._ctx,this.state);this.enterRule(t,22,nt.RULE_qualifiedIdentifier);try{let e;for(this.enterOuterAlt(t,1),this.state=128,this._errHandler.sync(this),e=this.interpreter.adaptivePredict(this._input,9,this._ctx);2!==e&&e!==K.ATN.INVALID_ALT_NUMBER;)1===e&&(this.state=123,this.identifier(),this.state=124,this.match(nt.T__21)),this.state=130,this._errHandler.sync(this),e=this.interpreter.adaptivePredict(this._input,9,this._ctx);this.state=131,this.identifier()}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}externalConstant(){let t,e=new Nt(this._ctx,this.state);this.enterRule(e,24,nt.RULE_externalConstant);try{this.enterOuterAlt(e,1),this.state=133,this.match(nt.T__22),this.state=134,t=this._input.LA(1),t!==nt.IDENTIFIER&&t!==nt.STRING?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}identifier(){let t=new Lt(this._ctx,this.state);this.enterRule(t,26,nt.RULE_identifier);try{this.enterOuterAlt(t,1),this.state=136,this.match(nt.IDENTIFIER)}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}literal(){let t=new kt(this._ctx,this.state);this.enterRule(t,28,nt.RULE_literal);try{switch(this.state=146,this._errHandler.sync(this),this._input.LA(1)){case nt.NUMBER:t=new Dt(t),this.enterOuterAlt(t,1),this.state=138,this.match(nt.NUMBER);break;case nt.T__44:case nt.T__45:t=new Ut(t),this.enterOuterAlt(t,2),this.state=139,this.infinity();break;case nt.T__41:case nt.T__42:t=new Pt(t),this.enterOuterAlt(t,3),this.state=140,this.boolean();break;case nt.T__43:t=new Ft(t),this.enterOuterAlt(t,4),this.state=141,this.null();break;case nt.DATE:t=new Mt(t),this.enterOuterAlt(t,5),this.state=142,this.match(nt.DATE);break;case nt.DATETIME:t=new Ht(t),this.enterOuterAlt(t,6),this.state=143,this.match(nt.DATETIME);break;case nt.TIME:t=new $t(t),this.enterOuterAlt(t,7),this.state=144,this.match(nt.TIME);break;case nt.STRING:t=new jt(t),this.enterOuterAlt(t,8),this.state=145,this.match(nt.STRING);break;default:throw new J.NoViableAltException(this)}}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}compOp(){let t,e=new Bt(this._ctx,this.state);this.enterRule(e,30,nt.RULE_compOp);try{this.enterOuterAlt(e,1),this.state=148,t=this._input.LA(1),0!=(t-24&-32)||0==(1<<t-24&(1<<nt.T__23-24|1<<nt.T__24-24|1<<nt.T__25-24|1<<nt.T__26-24|1<<nt.T__27-24|1<<nt.T__28-24|1<<nt.T__29-24|1<<nt.T__30-24|1<<nt.T__31-24|1<<nt.T__32-24|1<<nt.T__33-24|1<<nt.T__34-24))?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}arthOp(){let t,e=new Gt(this._ctx,this.state);this.enterRule(e,32,nt.RULE_arthOp);try{this.enterOuterAlt(e,1),this.state=150,t=this._input.LA(1),0!=(t-36&-32)||0==(1<<t-36&(1<<nt.T__35-36|1<<nt.T__36-36|1<<nt.T__37-36|1<<nt.T__38-36))?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}polarOp(){let t,e=new zt(this._ctx,this.state);this.enterRule(e,34,nt.RULE_polarOp);try{this.enterOuterAlt(e,1),this.state=152,t=this._input.LA(1),t!==nt.T__35&&t!==nt.T__36?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}logOp(){let t,e=new Vt(this._ctx,this.state);this.enterRule(e,36,nt.RULE_logOp);try{this.enterOuterAlt(e,1),this.state=154,t=this._input.LA(1),t!==nt.T__39&&t!==nt.T__40?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}boolean(){let t,e=new qt(this._ctx,this.state);this.enterRule(e,38,nt.RULE_boolean);try{this.enterOuterAlt(e,1),this.state=156,t=this._input.LA(1),t!==nt.T__41&&t!==nt.T__42?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}null(){let t=new Wt(this._ctx,this.state);this.enterRule(t,40,nt.RULE_null);try{this.enterOuterAlt(t,1),this.state=158,this.match(nt.T__43)}catch(e){if(!(e instanceof it.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}infinity(){let t,e=new Yt(this._ctx,this.state);this.enterRule(e,42,nt.RULE_infinity);try{this.enterOuterAlt(e,1),this.state=160,t=this._input.LA(1),t!==nt.T__44&&t!==nt.T__45?this._errHandler.recoverInline(this):(this._input.LA(1)===st.Token.EOF&&(this.matchedEOF=!0),this._errHandler.reportMatch(this),this.consume())}catch(t){if(!(t instanceof it.RecognitionException))throw t;e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.exitRule()}return e}sempred(t,e,r){return 1!==e||this.expression_sempred(t,r)}expression_sempred(t,e){switch(e){case 0:return this.precpred(this._ctx,5);case 1:return this.precpred(this._ctx,4);case 2:return this.precpred(this._ctx,3)}return!0}static get _ATN(){return nt.__ATN||(nt.__ATN=(new V.ATNDeserializer).deserialize(X.toCharArray(nt._serializedATN))),nt.__ATN}}nt.T__0=1,nt.T__1=2,nt.T__2=3,nt.T__3=4,nt.T__4=5,nt.T__5=6,nt.T__6=7,nt.T__7=8,nt.T__8=9,nt.T__9=10,nt.T__10=11,nt.T__11=12,nt.T__12=13,nt.T__13=14,nt.T__14=15,nt.T__15=16,nt.T__16=17,nt.T__17=18,nt.T__18=19,nt.T__19=20,nt.T__20=21,nt.T__21=22,nt.T__22=23,nt.T__23=24,nt.T__24=25,nt.T__25=26,nt.T__26=27,nt.T__27=28,nt.T__28=29,nt.T__29=30,nt.T__30=31,nt.T__31=32,nt.T__32=33,nt.T__33=34,nt.T__34=35,nt.T__35=36,nt.T__36=37,nt.T__37=38,nt.T__38=39,nt.T__39=40,nt.T__40=41,nt.T__41=42,nt.T__42=43,nt.T__43=44,nt.T__44=45,nt.T__45=46,nt.DATE=47,nt.DATETIME=48,nt.TIME=49,nt.IDENTIFIER=50,nt.STRING=51,nt.NUMBER=52,nt.INTEGER=53,nt.WHITESPACE=54,nt.COMMENT=55,nt.LINE_COMMENT=56,nt.RULE_root=0,nt.RULE_expression=1,nt.RULE_term=2,nt.RULE_invocable=3,nt.RULE_invocation=4,nt.RULE_indexer=5,nt.RULE_function=6,nt.RULE_paramList=7,nt.RULE_unit=8,nt.RULE_dateTimePrecision=9,nt.RULE_pluralDateTimePrecision=10,nt.RULE_qualifiedIdentifier=11,nt.RULE_externalConstant=12,nt.RULE_identifier=13,nt.RULE_literal=14,nt.RULE_compOp=15,nt.RULE_arthOp=16,nt.RULE_polarOp=17,nt.RULE_logOp=18,nt.RULE_boolean=19,nt.RULE_null=20,nt.RULE_infinity=21,nt.ruleNames=["root","expression","term","invocable","invocation","indexer","function","paramList","unit","dateTimePrecision","pluralDateTimePrecision","qualifiedIdentifier","externalConstant","identifier","literal","compOp","arthOp","polarOp","logOp","boolean","null","infinity"],nt._LITERAL_NAMES=[void 0,"'('","')'","'['","','","']'","'year'","'month'","'week'","'day'","'hour'","'minute'","'second'","'millisecond'","'years'","'months'","'weeks'","'days'","'hours'","'minutes'","'seconds'","'milliseconds'","'.'","'@'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'+'","'-'","'*'","'/'","'and'","'or'","'true'","'false'","'null'","'Infinity'","'infinity'"],nt._SYMBOLIC_NAMES=[void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,"DATE","DATETIME","TIME","IDENTIFIER","STRING","NUMBER","INTEGER","WHITESPACE","COMMENT","LINE_COMMENT"],nt.VOCABULARY=new Y.VocabularyImpl(nt._LITERAL_NAMES,nt._SYMBOLIC_NAMES,[]),nt._serializedATN='줝쪺֍꾺体؇쉁:¥\t\t\t\t\t\t\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f\r\t\r\t\t\t\t\t\t\t\t\t\t?\n\fB\vF\nT\n\fW\v\\\nd\n\b\b\b\bi\n\b\b\b\t\t\t\tp\n\t\f\t\ts\v\t\n\n\n\nx\n\n\v\v\f\f\r\r\r\r\n\r\f\r\r\v\r\r\r\n\b\n\f "$&(*,\v\b45%&)&\'*+,-/0¤.E[\b]\n_\fcelwy{ "$&(* ,¢.//0012\b2F34$45\b5F6778899F:;;@<==?><?B@>@AACB@CDDFE1E3E6E:FUGH\fHI"IJ\bJTKL\fLM MNNTOP\fPQ&QRRTSGSKSOTWUSUVVWUX\\Y\\\rZ\\[X[Y[Z\\]^\b^\t_``\vadbd7cacbd\reffhgi\thghiijjkklqmnnpompsqoqrrsqtx\vux\fvx5wtwuwvxyz\tz{|\t|}~~}
\t46,(*1235\t!\t#\t%\t\b\'\t\t) ¡.¡+¢£\t\n£-\r@ESU[chqw';class ot extends et.ParserRuleContext{expression(){return this.getRuleContext(0,at)}EOF(){return this.getToken(nt.EOF,0)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_root}accept(t){return t.visitRoot?t.visitRoot(this):t.visitChildren(this)}}class at extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_expression}copyFrom(t){super.copyFrom(t)}}class ct extends at{term(){return this.getRuleContext(0,ft)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitTermExpression?t.visitTermExpression(this):t.visitChildren(this)}}class ht extends at{polarOp(){return this.getRuleContext(0,zt)}expression(){return this.getRuleContext(0,at)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitPolarityExpression?t.visitPolarityExpression(this):t.visitChildren(this)}}class lt extends at{expression(t){return void 0===t?this.getRuleContexts(at):this.getRuleContext(t,at)}arthOp(){return this.getRuleContext(0,Gt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitArithmeticExpression?t.visitArithmeticExpression(this):t.visitChildren(this)}}class ut extends at{expression(t){return void 0===t?this.getRuleContexts(at):this.getRuleContext(t,at)}compOp(){return this.getRuleContext(0,Bt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitComparisonExpression?t.visitComparisonExpression(this):t.visitChildren(this)}}class _t extends at{expression(t){return void 0===t?this.getRuleContexts(at):this.getRuleContext(t,at)}logOp(){return this.getRuleContext(0,Vt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitLogicalExpression?t.visitLogicalExpression(this):t.visitChildren(this)}}class dt extends at{expression(){return this.getRuleContext(0,at)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitParenthesizedExpression?t.visitParenthesizedExpression(this):t.visitChildren(this)}}class pt extends at{expression(t){return void 0===t?this.getRuleContexts(at):this.getRuleContext(t,at)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitArrayExpression?t.visitArrayExpression(this):t.visitChildren(this)}}class ft extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_term}copyFrom(t){super.copyFrom(t)}}class Tt extends ft{literal(){return this.getRuleContext(0,kt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitLiteralTerm?t.visitLiteralTerm(this):t.visitChildren(this)}}class yt extends ft{qualifiedIdentifier(){return this.getRuleContext(0,St)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitQualifiedIdentifierTerm?t.visitQualifiedIdentifierTerm(this):t.visitChildren(this)}}class Et extends ft{externalConstant(){return this.getRuleContext(0,Nt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitExternalConstantTerm?t.visitExternalConstantTerm(this):t.visitChildren(this)}}class mt extends et.ParserRuleContext{function(){return this.getRuleContext(0,It)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_invocable}accept(t){return t.visitInvocable?t.visitInvocable(this):t.visitChildren(this)}}class gt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_invocation}copyFrom(t){super.copyFrom(t)}}class Rt extends gt{identifier(){return this.getRuleContext(0,Lt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitMemberInvocation?t.visitMemberInvocation(this):t.visitChildren(this)}}class xt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_indexer}copyFrom(t){super.copyFrom(t)}}class vt extends xt{identifier(){return this.getRuleContext(0,Lt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitMemberIndex?t.visitMemberIndex(this):t.visitChildren(this)}}class At extends xt{INTEGER(){return this.getToken(nt.INTEGER,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNumberIndex?t.visitNumberIndex(this):t.visitChildren(this)}}class It extends et.ParserRuleContext{identifier(){return this.getRuleContext(0,Lt)}paramList(){return this.tryGetRuleContext(0,wt)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_function}accept(t){return t.visitFunction?t.visitFunction(this):t.visitChildren(this)}}class wt extends et.ParserRuleContext{expression(t){return void 0===t?this.getRuleContexts(at):this.getRuleContext(t,at)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_paramList}accept(t){return t.visitParamList?t.visitParamList(this):t.visitChildren(this)}}class Ot extends et.ParserRuleContext{dateTimePrecision(){return this.tryGetRuleContext(0,Ct)}pluralDateTimePrecision(){return this.tryGetRuleContext(0,bt)}STRING(){return this.tryGetToken(nt.STRING,0)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_unit}accept(t){return t.visitUnit?t.visitUnit(this):t.visitChildren(this)}}class Ct extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_dateTimePrecision}accept(t){return t.visitDateTimePrecision?t.visitDateTimePrecision(this):t.visitChildren(this)}}class bt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_pluralDateTimePrecision}accept(t){return t.visitPluralDateTimePrecision?t.visitPluralDateTimePrecision(this):t.visitChildren(this)}}class St extends et.ParserRuleContext{identifier(t){return void 0===t?this.getRuleContexts(Lt):this.getRuleContext(t,Lt)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_qualifiedIdentifier}accept(t){return t.visitQualifiedIdentifier?t.visitQualifiedIdentifier(this):t.visitChildren(this)}}class Nt extends et.ParserRuleContext{IDENTIFIER(){return this.tryGetToken(nt.IDENTIFIER,0)}STRING(){return this.tryGetToken(nt.STRING,0)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_externalConstant}accept(t){return t.visitExternalConstant?t.visitExternalConstant(this):t.visitChildren(this)}}class Lt extends et.ParserRuleContext{IDENTIFIER(){return this.getToken(nt.IDENTIFIER,0)}constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_identifier}accept(t){return t.visitIdentifier?t.visitIdentifier(this):t.visitChildren(this)}}class kt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_literal}copyFrom(t){super.copyFrom(t)}}class Dt extends kt{NUMBER(){return this.getToken(nt.NUMBER,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNumberLiteral?t.visitNumberLiteral(this):t.visitChildren(this)}}class Ut extends kt{infinity(){return this.getRuleContext(0,Yt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitInfinityLiteral?t.visitInfinityLiteral(this):t.visitChildren(this)}}class Pt extends kt{boolean(){return this.getRuleContext(0,qt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitBooleanLiteral?t.visitBooleanLiteral(this):t.visitChildren(this)}}class Ft extends kt{null(){return this.getRuleContext(0,Wt)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitNullLiteral?t.visitNullLiteral(this):t.visitChildren(this)}}class Mt extends kt{DATE(){return this.getToken(nt.DATE,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitDateLiteral?t.visitDateLiteral(this):t.visitChildren(this)}}class Ht extends kt{DATETIME(){return this.getToken(nt.DATETIME,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitDateTimeLiteral?t.visitDateTimeLiteral(this):t.visitChildren(this)}}class $t extends kt{TIME(){return this.getToken(nt.TIME,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitTimeLiteral?t.visitTimeLiteral(this):t.visitChildren(this)}}class jt extends kt{STRING(){return this.getToken(nt.STRING,0)}constructor(t){super(t.parent,t.invokingState),this.copyFrom(t)}accept(t){return t.visitStringLiteral?t.visitStringLiteral(this):t.visitChildren(this)}}class Bt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_compOp}accept(t){return t.visitCompOp?t.visitCompOp(this):t.visitChildren(this)}}class Gt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_arthOp}accept(t){return t.visitArthOp?t.visitArthOp(this):t.visitChildren(this)}}class zt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_polarOp}accept(t){return t.visitPolarOp?t.visitPolarOp(this):t.visitChildren(this)}}class Vt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_logOp}accept(t){return t.visitLogOp?t.visitLogOp(this):t.visitChildren(this)}}class qt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_boolean}accept(t){return t.visitBoolean?t.visitBoolean(this):t.visitChildren(this)}}class Wt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_null}accept(t){return t.visitNull?t.visitNull(this):t.visitChildren(this)}}class Yt extends et.ParserRuleContext{constructor(t,e){super(t,e)}get ruleIndex(){return nt.RULE_infinity}accept(t){return t.visitInfinity?t.visitInfinity(this):t.visitChildren(this)}}class Xt{constructor(t){this.errors=t}syntaxError(t,e,r,i,s,n){this.errors.push(new b(s,{recognizer:t,offendingSymbol:e,line:r,charPositionInLine:i,e:n}))}}var Qt=r(1410);class Kt extends A{constructor(t){super(""+t)}toString(){return"@"+super.toString()}}class Zt extends Qt.AbstractParseTreeVisitor{constructor(t){super(),this._timeZone=t?.timeZone}defaultResult(){}visitRoot(t){return this.visit(t.expression())}visitIdentifier(t){return t.text}visitNullLiteral(){return new F}visitBooleanLiteral(t){return new I("true"===t.text)}visitNumberLiteral(t){return new M(t.text)}visitStringLiteral(t){return new $(D(t.text))}visitInfinityLiteral(){return new M(1/0)}visitDateLiteral(t){return new P(D(t.text))}visitDateTimeLiteral(t){return new P(D(t.text))}visitTimeLiteral(t){return new B(D(t.text))}visitQualifiedIdentifierTerm(t){return new H(t.text)}visitPolarityExpression(t){const e=this.visit(t.expression());if("NumberLiteral"===e.kind)return"-"===t.polarOp().text&&(e.value*=-1),e;throw new O('Unexpected token "'+t.text+'"')}visitExternalConstantTerm(t){return new Kt(t.externalConstant().text.substring(1))}visitParenthesizedExpression(t){const e=this.visit(t.expression());return new v(e)}visitArrayExpression(t){return new m(t.expression().map((t=>this.visit(t))))}visitComparisonExpression(t){return new R({op:t.compOp().text,left:this.visit(t.expression(0)),right:this.visit(t.expression(1))})}visitLogicalExpression(t){const e=[],r=(t,i)=>{for(const s of t){if(s instanceof _t&&s.logOp().text===i){r(s.expression(),s.logOp().text);continue}const t=this.visit(s);e.push(t)}};return r(t.expression(),t.logOp().text),new x({op:t.logOp().text,items:e})}visitArithmeticExpression(t){const e=new T,r=(t,i)=>{for(let s=0,n=t.length;s<n;s++){const n=t[s];if(n instanceof lt){r(n.expression(),n.arthOp().text);continue}const o=this.visit(n);e.append(i||"+",o)}};return r(t.expression(),t.arthOp().text),e}}var Jt,te,ee=r(139),re=r(8228);function ie(t){return null!==t&&"object"==typeof t&&"function"==typeof t.pipe}function se(t){return ie(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState}function ne(t){return ie(t)&&!1!==t.readable&&"function"==typeof t.getReader&&"function"==typeof t.pipeThrough&&"function"==typeof t.pipeTo}function oe(t){return null!==t&&"string"==typeof t.host&&"string"==typeof t.href}!function(t){t.X_Opra_Version="X-Opra-Version",t.X_Opra_DataType="X-Opra-DataType",t.X_Opra_Count="X-Opra-Count",t.WWW_Authenticate="WWW-Authenticate",t.Authorization="Authorization",t.Proxy_Authenticate="Proxy-Authenticate",t.Proxy_Authorization="Proxy-Authorization",t.Age="Age",t.Cache_Control="Cache-Control",t.Clear_Site_Data="Clear-Site-Data",t.Expires="Expires",t.Pragma="Pragma",t.Last_Modified="Last-Modified",t.ETag="ETag",t.If_Match="If-Match",t.If_None_Match="If-None-Match",t.If_Modified_Since="If-Modified-Since",t.If_Unmodified_Since="If-Unmodified-Since",t.Vary="Vary",t.Connection="Connection",t.Keep_Alive="Keep-Alive",t.Accept="Accept",t.Accept_Encoding="Accept-Encoding",t.Accept_Language="Accept-Language",t.Expect="Expect",t.Cookie="Cookie",t.Set_Cookie="Set-Cookie",t.Access_Control_Allow_Origin="Access-Control-Allow-Origin",t.Access_Control_Allow_Credentials="Access-Control-Allow-Credentials",t.Access_Control_Allow_Headers="Access-Control-Allow-Headers",t.Access_Control_Allow_Methods="Access-Control-Allow-Methods",t.Access_Control_Expose_Headers="Access-Control-Expose-Headers",t.Access_Control_Max_Age="Access-Control-Max-Age",t.Access_Control_Request_Headers="Access-Control-Request-Headers",t.Access_Control_Request_Method="Access-Control-Request-Method",t.Origin="Origin",t.Timing_Allow_Origin="Timing-Allow-Origin",t.Content_Disposition="Content-Disposition",t.Content_ID="Content-ID",t.Content_Length="Content-Length",t.Content_Type="Content-Type",t.Content_Transfer_Encoding="Content-Transfer-Encoding",t.Content_Encoding="Content-Encoding",t.Content_Language="Content-Language",t.Content_Location="Content-Location",t.Forwarded="Forwarded",t.X_Forwarded_For="X-Forwarded-For",t.X_Forwarded_Host="X-Forwarded-Host",t.X_Forwarded_Proto="X-Forwarded-Proto",t.Via="Via",t.Location="Location",t.From="From",t.Host="Host",t.Referer="Referer",t.Referrer_Policy="Referrer-Policy",t.User_Agent="User-Agent",t.Allow="Allow",t.Server="Server",t.Accept_Ranges="Accept-Ranges",t.Range="Range",t.If_Range="If-Range",t.Content_Range="Content-Range",t.Cross_Origin_Embedder_Policy="Cross-Origin-Embedder-Policy",t.Cross_Origin_Opener_Policy="Cross-Origin-Opener-Policy",t.Cross_Origin_Resource_Policy="Cross-Origin-Resource-Policy",t.Content_Security_Policy="Content-Security-Policy",t.Content_Security_Policy_Report_Only="Content-Security-Policy-Report-Only",t.Expect_CT="Expect-CT",t.Feature_Policy="Feature-Policy",t.Strict_Transport_Security="Strict-Transport-Security",t.Upgrade_Insecure_Requests="Upgrade-Insecure-Requests",t.X_Content_Type_Options="X-Content-Type-Options",t.X_Download_Options="X-Download-Options",t.X_Frame_Options="X-Frame-Options",t.X_Permitted_Cross_Domain_Policies="X-Permitted-Cross-Domain-Policies",t.X_Powered_By="X-Powered-By",t.X_XSS_Protection="X-XSS-Protection",t.Transfer_Encoding="Transfer-Encoding",t.TE="TE",t.Trailer="Trailer",t.Sec_WebSocket_Key="Sec-WebSocket-Key",t.Sec_WebSocket_Extensions="Sec-WebSocket-Extensions",t.Sec_WebSocket_Accept="Sec-WebSocket-Accept",t.Sec_WebSocket_Protocol="Sec-WebSocket-Protocol",t.Sec_WebSocket_Version="Sec-WebSocket-Version",t.Date="Date",t.Retry_After="Retry-After",t.Server_Timing="Server-Timing",t.X_DNS_Prefetch_Control="X-DNS-Prefetch-Control"}(Jt||(Jt={})),function(t){t[t.CONTINUE=100]="CONTINUE",t[t.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",t[t.PROCESSING=102]="PROCESSING",t[t.EARLYHINTS=103]="EARLYHINTS",t[t.OK=200]="OK",t[t.CREATED=201]="CREATED",t[t.ACCEPTED=202]="ACCEPTED",t[t.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",t[t.NO_CONTENT=204]="NO_CONTENT",t[t.RESET_CONTENT=205]="RESET_CONTENT",t[t.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",t[t.AMBIGUOUS=300]="AMBIGUOUS",t[t.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",t[t.FOUND=302]="FOUND",t[t.SEE_OTHER=303]="SEE_OTHER",t[t.NOT_MODIFIED=304]="NOT_MODIFIED",t[t.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",t[t.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",t[t.BAD_REQUEST=400]="BAD_REQUEST",t[t.UNAUTHORIZED=401]="UNAUTHORIZED",t[t.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",t[t.FORBIDDEN=403]="FORBIDDEN",t[t.NOT_FOUND=404]="NOT_FOUND",t[t.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",t[t.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",t[t.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",t[t.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",t[t.CONFLICT=409]="CONFLICT",t[t.GONE=410]="GONE",t[t.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",t[t.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",t[t.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",t[t.URI_TOO_LONG=414]="URI_TOO_LONG",t[t.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",t[t.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",t[t.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",t[t.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",t[t.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",t[t.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",t[t.LOCKED=423]="LOCKED",t[t.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",t[t.TOO_EARLY=425]="TOO_EARLY",t[t.UPGRADE_REQUIRED=428]="UPGRADE_REQUIRED",t[t.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",t[t.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",t[t.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",t[t.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",t[t.BAD_GATEWAY=502]="BAD_GATEWAY",t[t.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",t[t.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",t[t.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",t[t.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",t[t.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",t[t.LOOP_DETECTED=508]="LOOP_DETECTED",t[t.NOT_EXTENDED=510]="NOT_EXTENDED",t[t.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"}(te||(te={}));const ae=Object.keys(Jt),ce=ae.map((t=>t.toLowerCase()));function he(t,e){return t&&Object.keys(t).reduce(((r,i)=>{const s=t[i],n=e?ae[ce.indexOf(i.toLowerCase())]||i.replace(/(^\w|[A-Z]|\b\w)/g,(function(t){return t.toUpperCase()})):i.toLowerCase();return"set-cookie"===i.toLowerCase()?r[n]=Array.isArray(s)?s:[s]:r[n]=Array.isArray(s)?s.join(";"):s,r}),{})||{}}class le{constructor(t){this.method=t.method,this.url=encodeURI(decodeURI(t.url)),this.headers=t.headers,this.data=t.data}}class ue{constructor(t){this.status=t.status,this.headers=t.headers,this.data=t.data}}const _e="\r\n",de=/ *charset=./i;class pe{constructor(){this._parts=[],this.boundary="batch_"+(0,re.uid)(12)}addRequestPart(t,e){const r={...he(e?.headers||{},!0),[Jt.Content_Type]:"application/http",[Jt.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[Jt.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:new le(t)}),this}addHttpResponse(t,e){const r={...he(e?.headers||{},!0),[Jt.Content_Type]:"application/http",[Jt.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[Jt.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:new ue(t)}),this}addBatch(t,e){const r={...he(e?.headers||{},!0),[Jt.Content_Type]:"application/http",[Jt.Content_Transfer_Encoding]:"binary"};return e?.contentId&&(r[Jt.Content_ID]=e.contentId),this._parts.push({headers:r,contentId:e?.contentId,content:t}),this}stream(){const t=[];return this._build(t),ee(t).flatten().toNodeStream()}_build(t){for(const e of this._parts){if(!(e.content instanceof le||e.content instanceof ue))throw new Error("Not implemented yet");{let r=e.content.data,i=0;const s=he(e.content.headers);if(r){const t=String(s["content-type"]||"").split(/\s*;\s*/);let e="";if(se(r)?i=parseInt(String(s["content-length"]),10)||0:"object"==typeof r?"function"==typeof r.stream?(t[0]=r.type||"binary",i=r.size,r=r.stream()):Buffer.isBuffer(r)?s["content-length"]=String(r.length):(t[0]=t[0]||"application/json",e="utf-8",r=Buffer.from(JSON.stringify(r),"utf-8"),i=r.length):(t[0]=t[0]||"text/plain",e="utf-8",r=Buffer.from(String(r),"utf-8"),i=r.length),t[0]){if(e){const r=t.findIndex((t=>de.test(String(t))));r>0?t[r]="charset="+e:t.join("charset="+e)}s["content-type"]=t.join(";")}i&&(s["content-length"]=String(i))}let n="--"+this.boundary+_e;for(const[t,r]of Object.entries(e.headers))""!==r&&null!=r&&(n+=t+": "+(Array.isArray(r)?r.join(";"):r)+_e);if(n+=_e,e.content instanceof le?n+=(e.content.method||"GET").toUpperCase()+" "+e.content.url+" HTTP/1.1"+_e:n+="HTTP/1.1 "+e.content.status+(te[e.content.status]||"Unknown")+_e,e.content.headers)for(const[t,r]of Object.entries(e.content.headers))""!==r&&null!=r&&("set-cookie"===t&&Array.isArray(r)?r.forEach((e=>n+=t+": "+e)):n+=t+": "+(Array.isArray(r)?r.join(";"):r)+_e);n+=_e,t.push(Buffer.from(n,"utf-8")),r&&(t.push(r),t.push(Buffer.from(_e+_e)))}}t.push(Buffer.from("--"+this.boundary+"--"+_e,"utf-8"))}}r(2150);const fe="opra:complex_type.fields",Te="opra:resolver.metadata",ye="opra:ignore_resolver-method",Ee="opra:mapped_type.metadata",me=["create","delete","get","update"],ge=[...me,"count","deleteMany","updateMany","search"];var Re;!function(t){t.Version="1.0",t.isDataType=function(t){return t&&"object"==typeof t&&("ComplexType"===t.kind||"SimpleType"===t.kind||"UnionType"===t.kind)},t.isComplexType=function(t){return t&&"object"==typeof t&&"ComplexType"===t.kind},t.isSimpleType=function(t){return t&&"object"==typeof t&&"SimpleType"===t.kind},t.isUnionTypee=function(t){return t&&"object"==typeof t&&"UnionType"===t.kind},t.isResource=function(t){return t&&"object"==typeof t&&"ContainerResource"===t.kind||"CollectionResource"===t.kind||"SingletonResource"===t.kind},t.isCollectionResource=function(t){return t&&"object"==typeof t&&"CollectionResource"===t.kind},t.isSingletonResource=function(t){return t&&"object"==typeof t&&"SingletonResource"===t.kind},t.isContainerResource=function(t){return t&&"object"==typeof t&&"ContainerResource"===t.kind}}(Re||(Re={}));var xe=r(2212);var ve=r(7514);class Ae extends Map{constructor(t,e){super(),this._keyMap=new Map,this._keyOrder=[],this._wellKnownKeyMap=new Map,e&&e.forEach((t=>this._wellKnownKeyMap.set(t.toLowerCase(),t))),"function"==typeof t?.forEach?t.forEach(((t,e)=>this.set(e,t))):t&&"object"==typeof t&&Object.keys(t).forEach((e=>this.set(e,t[e])))}clear(){super.clear(),this._keyMap.clear(),this._keyOrder=[]}get(t){const e=this._getOriginalKey(t);return super.get(e)}has(t){return this._keyMap.has(this._getLowerKey(t))}set(t,e){return t=this._getOriginalKey(t),this._keyMap.set(this._getLowerKey(t),t),this._keyOrder.includes(t)||this._keyOrder.push(t),super.set(t,e)}keys(){return this._keyOrder.values()}values(){let t=-1;const e=this._keyOrder,r=this;return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:r.get(e[t])})}}entries(){let t=-1;const e=this._keyOrder,r=this;return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:[e[t],r.get(e[t])]})}}delete(t){const e=this._getOriginalKey(t),r=this._getLowerKey(t);this._keyMap.delete(r);const i=this._keyOrder.indexOf(e);return i>=0&&this._keyOrder.splice(i,1),super.delete(e)}sort(t){return this._keyOrder.sort(t),this}[Symbol.iterator](){return this.entries()}_getOriginalKey(t){return"string"==typeof t?this._keyMap.get(t.toLowerCase())??this._wellKnownKeyMap.get(t.toLowerCase())??t:t}_getLowerKey(t){return"string"==typeof t?t.toLowerCase():t}}function Ie(t){return"function"==typeof t&&!(!t.prototype||!t.prototype.constructor)}const we={kind:"UnionType",description:"Any value",ctor:Object,types:[]},Oe={kind:"SimpleType",description:"A stream of bytes, base64 encoded",ctor:Object.getPrototypeOf(Buffer.from("")).constructor,parse:t=>Buffer.from(t),serialize:t=>Buffer.isBuffer(t)?t.toString("base64"):void 0},Ce={kind:"SimpleType",description:"BigInt number",ctor:Object.getPrototypeOf(BigInt(0)).constructor,parse:t=>BigInt(t),serialize:t=>String(t)};var be=r(7527);const Se={kind:"SimpleType",description:"Simple true/false value",ctor:Boolean,parse:t=>(0,be.toBoolean)(t),serialize:t=>(0,be.toBoolean)(t)},Ne={kind:"SimpleType",description:"A date, date-time or partial date",ctor:String,parse:t=>(0,be.toDate)(t),serialize:t=>String(t)},Le={kind:"SimpleType",description:"A date, date-time or partial date in string format",ctor:String,parse:t=>(0,be.toString)(t),serialize:t=>(0,be.toString)(t)},ke={kind:"SimpleType",description:"A guid value",ctor:String,parse:t=>(0,be.toString)(t),serialize:t=>(0,be.toString)(t)},De={kind:"SimpleType",description:"An integer number",ctor:Number,parse:t=>(0,be.toInt)(t),serialize:t=>(0,be.toInt)(t)},Ue={kind:"SimpleType",description:"Both Integer as well as Floating-Point numbers",ctor:Number,parse:t=>(0,be.toNumber)(t),serialize:t=>(0,be.toNumber)(t)},Pe={kind:"ComplexType",description:"A non modelled object",ctor:Object,additionalFields:!0,parse:t=>t,serialize:t=>t},Fe={kind:"SimpleType",description:"A sequence of characters",ctor:String,parse:t=>(0,be.toString)(t),serialize:t=>(0,be.toString)(t)},Me=Object.getPrototypeOf(BigInt(0)).constructor,He=Object.getPrototypeOf(Buffer.from("")).constructor,$e=new Ae;$e.set("any",we),$e.set("base64Binary",Oe),$e.set("bigint",Ce),$e.set("boolean",Se),$e.set("date",Ne),$e.set("dateString",Le),$e.set("guid",ke),$e.set("integer",De),$e.set("number",Ue),$e.set("object",Pe),$e.set("string",Fe);const je=new Map;je.set(Boolean,"boolean"),je.set(String,"string"),je.set(Number,"number"),je.set(Date,"date"),je.set(Me,"bigint"),je.set(He,"base64Binary"),je.set(Object,"object");var Be=r(3199),Ge=r(9340);function ze(t,e){return Ge({},t,{deep:!0,clone:!0,filter:(t,r)=>{const i=t[r];return null!=i&&!e||"function"!=typeof i&&("object"!=typeof i||Be(i)||Array.isArray(i))}})}async function Ve(t){const e=Object.getPrototypeOf(t).constructor,r=Reflect.getMetadata("opra:resource.metadata",e);if(!r)throw new TypeError(`Class "${e.name}" doesn't have "Resource" metadata information`);const i=ze(r);if(i.instance=t,i.name=r.name||e.name.replace(/(Resource|Controller)$/,""),Re.isCollectionResource(r))return await async function(t){const e=t.instance,r=Object.getPrototypeOf(t.instance);let i,s;const n=(t,e)=>{s=t[e],i=Reflect.getMetadata(Te,t,e),null==s&&i&&(t=Object.getPrototypeOf(t),s=t[e])};for(const o of ge){if(n(e,o),"function"!=typeof s)continue;const a=t[o]={...i};Reflect.hasMetadata(ye,r.constructor,o)||(a.handler=s.bind(e),s=e["pre_"+o],"function"==typeof s&&(t["pre_"+o]=s.bind(e)))}return t}(i);if(Re.isSingletonResource(r))return await async function(t){const e=t.instance,r=Object.getPrototypeOf(t.instance);let i,s;const n=(t,e)=>{s=t[e],i=Reflect.getMetadata(Te,t,e),null==s&&i&&(t=Object.getPrototypeOf(t),s=t[e])};for(const o of me){if(n(e,o),"function"!=typeof s)continue;const a=t[o]={...i};Reflect.hasMetadata(ye,r.constructor,o)||(a.handler=s.bind(e),s=e["pre_"+o],"function"==typeof s&&(t["pre_"+o]=s.bind(e)))}return t}(i);throw new TypeError("Invalid Resource metadata")}const qe=Symbol.for("opra.optional-lib.sqb-connect");async function We(t){const e=Reflect.getMetadata("opra:data_type.metadata",t);if(!e)throw new TypeError(`Class "${t}" doesn't have "DataType" metadata information`);if(Re.isComplexType(e))return await async function(t,e){const r=ze(e);r.ctor=t;const i=Reflect.getMetadata(Ee,t);i&&(r.extends=[...i.map((t=>ze(t)))]);const s=Reflect.getMetadata(fe,t);if(s){r.fields=ze(s);for(const[e,i]of Object.entries(r.fields)){if("function"==typeof i.type){const t=je.get(i.type);t&&(i.type=t)}const r=globalThis[qe]?.SqbConnect;let s;if(r){const{EntityMetadata:n,isAssociationField:o}=r,a=n.get(t);if(s=a&&n.getField(a,e),s){if((i.type===Function||"object"===i.type||i.type===Object||"any"===i.type)&&(i.type="any",o(s))){s.association.returnsMany()||delete i.isArray;const t=await s.association.resolveTarget();t&&(i.type=t.ctor)}s.exclusive&&void 0===i.exclusive&&(i.exclusive=s.exclusive)}}if(s&&"column"===s.kind){const t=r.DataType;if("number"===i.type||i.type===Number)switch(s.dataType){case t.INTEGER:case t.SMALLINT:i.type="integer";break;case t.BIGINT:i.type="bigint"}else if(("string"===i.type||i.type===String)&&s.dataType===t.GUID)i.type="guid";s.notNull&&void 0===i.required&&(i.required=s.notNull),s.exclusive&&void 0===i.exclusive&&(i.exclusive=s.exclusive),void 0!==s.default&&void 0===i.default&&(i.default=s.default)}}}return r}(t,e);if(Re.isSimpleType(e))return await async function(t,e){const r=ze(e);return r.ctor=t,r}(t,e);throw new TypeError("Invalid DataType metadata")}const Ye=Symbol.for("opra.optional-lib.sqb-connect");class Xe{constructor(t){this._dataTypes=new Ae,this._resources=new Ae,this._args=t}buildSchema(){const t={...this._args,version:Re.Version};return this._dataTypes.size&&(t.types=Array.from(this._dataTypes.keys()).sort().reduce(((t,e)=>(t[e]=this._dataTypes.get(e),t)),{})),this._resources.size&&(t.resources=Array.from(this._resources.keys()).sort().reduce(((t,e)=>(t[e]=this._resources.get(e),t)),{})),t}async addDataTypeSchema(t,e){if(!Re.isDataType(e))throw new TypeError("Invalid DataType schema");const r=this._dataTypes.get(t);if(r){if(r.kind!==e.kind||!r.ctor||r.ctor!==e.ctor)throw new Error(`An other instance of "${t}" data type previously defined`)}else if(this._dataTypes.set(t,e),Re.isComplexType(e)){if(e.extends)for(const t of e.extends)"string"!=typeof t.type&&(t.type=await this.addDataTypeClass(t.type));if(e.fields)for(const t of Object.values(e.fields))t.type=t.type||"string","string"!=typeof t.type&&(t.type=await this.addDataTypeClass(t.type))}}async addDataTypeClass(t){if(!Ie(t=(0,ve.isPromise)(t)?await t:t))return this.addDataTypeClass(t());const e=je.get(t);if(e)return e;const r=await We(t),i=r.name,s=r;return delete s.name,await this.addDataTypeSchema(i,s),i}async addResourceSchema(t,e){if(!Re.isResource(e))throw new TypeError("Invalid Resource schema");if(this._resources.has(t))throw new Error(`An other instance of "${t}" resource previously defined`);if(Re.isCollectionResource(e)||Re.isSingletonResource(e)){const t="function"==typeof e.type?await this.addDataTypeClass(e.type):e.type;if(e.type=t,!this._dataTypes.has(e.type)&&!$e.has(e.type))throw new Error(`Resource registration error. Type "${e.type}" not found.`)}if(Re.isCollectionResource(e)&&!e.keyFields){const r=this._dataTypes.get(e.type),i=globalThis[Ye]?.SqbConnect;if(i&&r?.ctor){const t=i.EntityMetadata.get(r?.ctor);if(t?.indexes){const r=t.indexes.find((t=>t.primary));r&&(e.keyFields=r.columns)}}if(e.keyFields=Array.isArray(e.keyFields)?e.keyFields.length?e.keyFields:"":e.keyFields,!e.keyFields)throw new TypeError(`You must provide keyFields for "${t}" entity resource`)}this._resources.set(t,e)}async addResourceInstance(t){let e;"function"==typeof(t=(0,ve.isPromise)(t)?await t:t)?Ie(t)?(e={},Object.setPrototypeOf(e,t.prototype)):e=await t():e=t;const r=await Ve(e),i=r.name,s=r;return delete s.name,await this.addResourceSchema(i,s),i}}function Qe(t,e){return t<e?-1:t>e?1:0}const Ke=Symbol.for("nodejs.util.inspect.custom"),Ze="[0m",Je="[33m",tr="[35m";class er{constructor(t,e,r){this._document=t,this._name=e,this._metadata=r}get document(){return this._document}get kind(){return this._metadata.kind}get name(){return this._name}get description(){return this._metadata.description}get ctor(){return this._metadata.ctor}parse(t){return this._metadata.parse?this._metadata.parse(t):t}getSchema(t){return ze(this._metadata,t)}}class rr extends er{constructor(t,e,r){super(t,e,{kind:"ComplexType",...r}),this._initialized=!1,this.ownFields=new Ae,this.fields=new Ae}get abstract(){return!!this._metadata.abstract}get additionalFields(){return this._metadata.additionalFields||this._mixinAdditionalFields}get extends(){return this._metadata.extends}getField(t){if(t.includes(".")){let e=this;const r=t.split(".");let i;for(const t of r)i=e.getField(t),e=e.document.getDataType(i.type||"string");return i}const e=this.fields.get(t);if(!e)throw new Error(`"${this.name}" type doesn't have a field named "${t}"`);return e}getFieldType(t){const e=this.getField(t);return this.document.getDataType(e.type||"string")}getOwnField(t){const e=this.ownFields.get(t);if(!e)throw new Error(`"${this.name}" type doesn't have an own field named "${t}"`);return e}getSchema(){const t=super.getSchema();if(this.additionalFields&&(t.additionalFields=this.additionalFields),this.ownFields.size){t.fields={};for(const[e,r]of this.ownFields)t.fields[e]=ze(r),delete t.fields[e].name}return t}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[Ke](){return`[${Je+Object.getPrototypeOf(this).constructor.name+Ze} ${tr+this.name+Ze}]`}init(){if(this._initialized)return;this._initialized=!0;const t=this._metadata;if(t.extends)for(const e of t.extends){const t=this.document.types.get(e.type);if(!t)throw new TypeError(`Extending schema (${e.type}) of data type "${this.name}" does not exists`);if(!(t instanceof rr))throw new TypeError(`Cannot extend ${this.name} from a "${t.kind}"`);t.init(),t.additionalFields&&(this._mixinAdditionalFields=!0);for(const[e,r]of t.fields){const t=ze(r);t.name=e,t.parent=this,this.fields.set(e,t)}}if(t.fields)for(const[e,r]of Object.entries(t.fields)){if(!this.document.types.get(r.type))throw new TypeError(`Type "${r.type}" defined for "${this.name}.${e}" does not exists`);const t=ze(r);t.name=e,this.fields.set(e,t),this.ownFields.set(e,t)}}}class ir extends er{constructor(t,e,r){super(t,e,{kind:"SimpleType",...r})}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[Ke](){return`[${Je+Object.getPrototypeOf(this).constructor.name+Ze} ${tr+this.name+Ze}]`}}class sr extends er{constructor(t,e,r){super(t,e,(0,xe.omit)({kind:"UnionType",...r},["types"])),this.types=r.types,this.hasAdditionalFields="any"===e||!!this.types.find((t=>t instanceof rr&&t.additionalFields))}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}[Ke](){return`[${Je+Object.getPrototypeOf(this).constructor.name+Ze} ${tr+this.name+Ze}]`}}const nr=/^([^.]+)\.(.*)$/;function or(t){if(t.length)return ar(t,{})}function ar(t,e){for(const r of t){const t=nr.exec(r);if(t){const r=t[1];if(!0===e[r])continue;const i=e[r]="object"==typeof e[r]?e[r]:{};ar([t[2]],i)}else e[r]=!0}return e}function cr(t,e,r,i=""){return hr([],t,e,or(r)||{},"",i,{additionalFields:!0})}function hr(t,e,r,i,s="",n="",o){let a="";for(const c of Object.keys(i)){const h=i[c],l=r?.fields.get(c);if(!l){if(a=s?s+"."+c:c,!o?.additionalFields||r&&!r.additionalFields)throw new TypeError(`Unknown field "${a}"`);"object"==typeof h?hr(t,e,void 0,h,a,n,o):t.push(a);continue}a=s?s+"."+l.name:l.name;const u=e.getDataType(l.type||"string");if("object"!=typeof h)t.findIndex((t=>t.startsWith(a+".")))>=0&&(t=t.filter((t=>!t.startsWith(a+".")))),t.push(a);else{if(!(u&&u instanceof rr))throw new TypeError(`"${n?n+"."+a:a}" is not a complex type and has no sub fields`);if(t.findIndex((t=>t===s))>=0)continue;t=hr(t,e,u,h,a,n,o)}}return t}class lr{constructor(t,e,r){this.document=t,this.name=e,this.metadata=r}get instance(){return this.metadata.instance}get kind(){return this.metadata.kind}get description(){return this.metadata.description}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name}]`}validateQueryOptions(){}getSchema(t){return ze(this.metadata,t)}[Ke](){return`[${Je+Object.getPrototypeOf(this).constructor.name+Ze} ${tr+this.name+Ze}]`}}class ur extends lr{constructor(t,e,r,i){if(!i.keyFields)throw new TypeError(`You should provide key fields for ${e}`);super(t,e,i),i.keyFields=Array.isArray(i.keyFields)?i.keyFields:[i.keyFields],i.keyFields.forEach((t=>r.getField(t))),this.dataType=r,i.search&&i.search.sortFields&&(i.search.sortFields=cr(t,r,i.search.sortFields))}get keyFields(){return this.metadata.keyFields}get create(){return this.metadata.create}get count(){return this.metadata.count}get delete(){return this.metadata.delete}get deleteMany(){return this.metadata.deleteMany}get get(){return this.metadata.get}get update(){return this.metadata.update}get updateMany(){return this.metadata.updateMany}get search(){return this.metadata.search}getSchema(t){const e=super.getSchema(t);e.keyFields.length<2&&(e.keyFields=e.keyFields[0]);for(const t of ge)"object"!=typeof e[t]||Object.keys(e[t]).length||(e[t]=!0);return e}}class _r extends lr{constructor(t,e,r,i){if(!(r instanceof rr))throw new TypeError('You should provide a ComplexType as "dataType" argument');super(t,e,i),this.dataType=r}get create(){return this.metadata.create}get delete(){return this.metadata.delete}get get(){return this.metadata.get}get update(){return this.metadata.update}getSchema(t){const e=super.getSchema(t);for(const t of me)"object"!=typeof e[t]||Object.keys(e[t]).length||(e[t]=!0);return e}}class dr{constructor(t){this._ownTypes=new Ae,this._types=new Ae,this._resources=new Ae,this._meta=(0,xe.omit)(t,["types","resources"]);for(const[t,e]of $e.entries())this._addDataType(t,e,!1);if(t.types)for(const[e,r]of Object.entries(t.types))this._addDataType(e,r,!0);if(this._initTypes(),t.resources)for(const[e,r]of Object.entries(t.resources))this._addResource(e,r)}get info(){return this._meta.info}get types(){return this._types}getDataType(t){const e=this.types.get(t);if(e)return e;throw new Error(`Data type "${t}" does not exists`)}getComplexDataType(t){const e=this.getDataType(t);if(e&&e instanceof rr)return e;throw new Error(`Data type "${t}" is not a ComplexType`)}getSimpleDataType(t){const e=this.getDataType(t);if(e&&e instanceof ir)return e;throw new Error(`Data type "${t}" is not a SimpleType`)}getUnionDataType(t){const e=this.getDataType(t);if(e&&e instanceof sr)return e;throw new Error(`Data type "${t}" is not a UnionType`)}get resources(){return this._resources}get servers(){return this._meta.servers}getResource(t){const e=this.resources.get(t);if(!e)throw new Error(`Resource "${t}" does not exists`);return e}getCollectionResource(t){const e=this.getResource(t);if(!(e instanceof ur))throw new Error(`"${t}" is not a CollectionResource`);return e}getSingletonResource(t){const e=this.getResource(t);if(!(e instanceof _r))throw new Error(`"${t}" is not a SingletonResource`);return e}getMetadata(t){const e={version:Re.Version,info:ze(this.info)};return this._ownTypes.size&&(e.types=Array.from(this._ownTypes.values()).sort(((t,e)=>Qe(t.name,e.name))).reduce(((e,r)=>(e[r.name]=r.getSchema(t),e)),{})),this.resources.size&&(e.resources=Array.from(this._resources.values()).sort(((t,e)=>Qe(t.name,e.name))).reduce(((e,r)=>(e[r.name]=r.getSchema(t),e)),{})),e}_addDataType(t,e,r){let i=this._types.get(t);if(i)return i;if(Re.isComplexType(e))i=new rr(this,t,e);else if(Re.isSimpleType(e))i=new ir(this,t,e);else{if(!Re.isUnionTypee(e))throw new TypeError("Invalid data type schema");i=new sr(this,t,{...e,types:[]})}return this._types.set(t,i),r&&this._ownTypes.set(t,i),i}_addResource(t,e){if(!Re.isCollectionResource(e)&&!Re.isSingletonResource(e))throw new TypeError(`Unknown resource kind (${e.kind})`);{const r=this.getDataType(e.type);if(!r)throw new TypeError(`Datatype "${e.type}" declared in CollectionResource (${t}) does not exists`);if(!(r instanceof rr))throw new TypeError(`${e.type} is not an ComplexType`);Re.isCollectionResource(e)?this.resources.set(t,new ur(this,t,r,e)):this.resources.set(t,new _r(this,t,r,e))}}_initTypes(){for(const t of this._types.values())t instanceof rr&&t.init()}static async create(t){const e=new Xe(t);if(t.types)if(Array.isArray(t.types))for(const r of t.types)await e.addDataTypeClass(r);else for(const[r,i]of Object.entries(t.types))await e.addDataTypeSchema(r,i);if(t.resources)if(Array.isArray(t.resources))for(const r of t.resources)await e.addResourceInstance(r);else for(const[r,i]of Object.entries(t.resources))await e.addResourceSchema(r,i);const r=e.buildSchema();return new dr(r)}}Symbol.for("opra.optional-lib.sqb-connect");Symbol.for("opra.optional-lib.sqb-connect");var pr=r(2699);function fr(t,e){if(!t)return"";for(;e&&t.startsWith("/");)t=t.substring(1);for(;t.endsWith("/");)t=t.substring(0,t.length-1);return t}function Tr(...t){const e=[];let r;for(let i=0,s=t.length;i<s;i++)r=fr(t[i],i>0),r&&e.push(r);return e.join("/")}const yr=/^([^/?#:@]+)(?:@([^/?#:]*))?(?:::(.*))?$/;function Er(t){const e=yr.exec(t);if(!e)throw Object.assign(new TypeError("Invalid URL path"),{code:"ERR_INVALID_URL_PATH",input:t});const r=decodeURIComponent(e[1]);let s;if(e[2]){const r=decodeURIComponent(e[2]||""),n=(0,i.splitString)(r,{delimiters:";",quotes:!0,escape:!1});for(const e of n){const r=(0,i.splitString)(e,{delimiters:"=",quotes:!0,escape:!1});if(n.length>1&&r.length<2||s&&r.length>=2&&"object"!=typeof s||r.length<2&&"object"==typeof s)throw Object.assign(new TypeError("Invalid URL path. name:value pair required for multiple key format"),{pathComponent:t,code:"ERR_INVALID_URL_PATH"});r.length>=2?(s=s||{},s[r.shift()||""]=r.join("=")):s=r[0]}}return e[3]?{resource:r,key:s,typeCast:e[3]}:{resource:r,key:s}}function mr(t,e,r){if(null==t)return"";let i="";if(""!==e&&null!=e)if(Be(e)){const t=[];for(const r of Object.keys(e))t.push(encodeURIComponent(r)+"="+encodeURIComponent(e[r]));i=t.join(";")}else i=encodeURIComponent(""+e);return r&&(r=encodeURIComponent(r)),encodeURIComponent(t).replace(/%24/,"$")+(i?"@"+i:"")+(r?"::"+r:"")}const gr=Symbol.for("nodejs.util.inspect.custom");class Rr{constructor(t){this.resource=t.resource,this.key=t.key,this.typeCast=t.typeCast}toString(){const t=mr(this.resource,this.key,this.typeCast);return t&&Object.setPrototypeOf(t,Rr.prototype),t}[gr](){const t={resource:this.resource};return null!=this.key&&(t.key=this.key),null!=this.typeCast&&(t.typeCast=this.typeCast),t}}const xr=Symbol.for("nodejs.util.inspect.custom");class vr extends pr.EventEmitter{constructor(...t){super(),this._entries=[];for(const e of t)oe(e)?this._parse(e.pathname):e instanceof vr?this._entries.push(...e._entries):this.add(e)}get size(){return this._entries.length}add(t,e,r){this._add(t,e,r),this.emit("change")}clear(){this._entries=[],this.emit("change")}get(t){return this._entries[t]}join(t){const e=(0,i.tokenize)(fr(t,!0),{delimiters:"/",quotes:!0,brackets:!0});for(const t of e){const e=Er(t);this._add(e)}return this.emit("change"),this}entries(){let t=-1;const e=[...this._entries];return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:[e[t],t]})}}values(){let t=-1;const e=[...this._entries];return{[Symbol.iterator](){return this},next:()=>(t++,{done:t>=e.length,value:e[t]})}}forEach(t){for(const e of this._entries)t.call(this,e.resource,e.key,this)}getResource(t){const e=this._entries[t];return null==e?void 0:e.resource}getKey(t){const e=this._entries[t];return null==e?void 0:e.key}toString(){return this._entries.map((t=>mr(t.resource,t.key,t.typeCast))).join("/")}[Symbol.iterator](){return this.entries()}[xr](){return this._entries}_add(t,e,r){t instanceof Rr?this._entries.push(t):"object"==typeof t?this._entries.push(new Rr(t)):this._entries.push(new Rr({resource:t,key:e,typeCast:r}))}_parse(t){if(!t)return;const e=(0,i.tokenize)(t,{delimiters:"/",quotes:!0,brackets:!0});for(const t of e){if(!t)continue;const e=Er(t);this._add(e)}this.emit("change")}}class Ar{}const Ir=["true","t","yes","y","1"],wr=["false","f","no","n","0"];const Or=/^(\d{4})(?:-?(0[1-9]|1[012])(?:-?([123]0|[012][1-9]|31))?)?(?:[T ]?([01][0-9]|2[0-3]):?([0-5][0-9]):?([0-5][0-9])?(?:\.(\d+))?(?:(Z)|(?:([+-])([01]?[0-9]|2[0-3]):?([0-5][0-9])?))?)?$/;function Cr(t,e,r){if(""===t||null==t)return"";const i=t.match(Or);if(!i)throw new TypeError(`"${t}" is not a valid date.`);let s=i[1]+"-"+(i[2]||"01")+"-"+(i[3]||"01");return e&&(s+="T"+(i[4]||"00")+":"+(i[5]||"00")+":"+(i[6]||"00")+(i[7]?"."+i[7]:""),r&&(s+=i[8]?"Z":i[9]?i[9]+(i[10]||"00")+":"+(i[11]||"00"):"")),s}class br extends Ar{constructor(t){super(),this.max=t?.max,this.min=t?.min}parse(t){const e="number"==typeof t?t:parseFloat(t);if(isNaN(e))throw new TypeError(`"${t}" is not a valid number`);if(null!=this.min&&e<this.min)throw new TypeError(`Value must be ${this.min} or greater.`);if(null!=this.max&&e>this.max)throw new TypeError(`Value must be ${this.max} or less.`);return e}stringify(t){return"number"==typeof t?""+t:""}}class Sr extends br{constructor(t){super(t),this.enum=t?.enum}parse(t){const e=super.parse(t);if(!Number.isInteger(e))throw new TypeError(`"${t}" is not a valid integer`);if(this.enum&&!this.enum.includes(e))throw new TypeError(`"${t}" is not one of allowed enum values (${this.enum}).`);return e}}const Nr={integer:new Sr,number:new br,string:new class extends Ar{constructor(t){super(),this.maxLength=t?.maxLength,this.minLength=t?.minLength,this.enum=t?.enum}parse(t){if(null!=this.minLength&&t.length<this.minLength)throw new TypeError(`Value must be at least ${this.minLength} character${this.minLength>1?"s":""} long.`);if(null!=this.maxLength&&t.length>this.maxLength)throw new TypeError(`Value can be up to ${this.maxLength} character${this.maxLength>1?"s":""} long.`);if(this.enum&&!this.enum.includes(t))throw new TypeError(`"${t}" is not one of allowed enum values (${this.enum}).`);return t}stringify(t){return null==t?"":""+t}},boolean:new class extends Ar{parse(t){if(""===t)return!0;if("boolean"==typeof t)return t;if(Ir.includes(t.toLowerCase()))return!0;if(wr.includes(t.toLowerCase()))return!1;throw new TypeError(`"${t}" is not a valid boolean`)}stringify(t){return"boolean"==typeof t?t?"true":"false":""}},date:new class extends Ar{constructor(t){super(),this.max=t?.max?Cr(t.max):void 0,this.min=t?.min?Cr(t.min):void 0,this.time=t?.time??!0,this.timeZone=t?.timeZone??!0}parse(t){const e=Cr(t,this.time,this.timeZone);if(null!=this.min&&e<this.min)throw new TypeError(`Value must be ${this.min} or greater.`);if(null!=this.max&&e>this.max)throw new TypeError(`Value must be ${this.max} or less.`);return e}stringify(t){return Cr(t,this.time,this.timeZone)}},filter:new class extends Ar{parse(t){return t instanceof f?t:function(t,e){const r=z.CharStreams.fromString(t),i=new Q(r),s=new z.CommonTokenStream(i),n=new nt(s);n.buildParseTree=!0;const o=[],a=new Xt(o);i.removeErrorListeners(),i.addErrorListener(a),n.removeErrorListeners(),n.addErrorListener(a);const c=n.root(),h=(e=e||new Zt).visit(c);if(o.length){const t=[];for(const e of o)t.push(e.message+" at (line: "+e.line+" column: "+e.charPositionInLine+")");const e=new O(t.join("\n"));throw e.errors=o,e}return h}(t)}stringify(t){return t?""+t:""}}},Lr=Symbol.for("nodejs.util.inspect.custom");class kr extends pr.EventEmitter{constructor(t){super(),this._params=new Ae,this._entries=new Ae,this._size=0,this.defineParam("$filter",{format:"filter"}),this.defineParam("$limit",{format:new Sr({min:0})}),this.defineParam("$skip",{format:new Sr({min:0})}),this.defineParam("$pick",{format:"string",array:"strict"}),this.defineParam("$omit",{format:"string",array:"strict"}),this.defineParam("$include",{format:"string",array:"strict"}),this.defineParam("$sort",{format:"string",array:"strict"}),this.defineParam("$distinct",{format:"boolean"}),this.defineParam("$count",{format:"boolean"}),t&&("string"==typeof t?this.parse(t):this.addAll(t))}get size(){return this._size}addAll(t){let e=!1;if("function"==typeof t.forEach)t.forEach(((t,r)=>{e=this._add(r,t)||e}));else{if("object"!=typeof t)throw new TypeError("Invalid argument");Object.entries(((t,r)=>{e=this._add(t,r)||e}))}e&&this.emit("change")}append(t,e){this._add(t,e)&&this.emit("change")}clear(){this._entries.clear(),this._size=0,this.emit("change")}defineParam(t,e){if(!t)throw new Error("Parameter name required");const r={...e,name:t,format:e?.format||"string"};if("string"==typeof r.format&&!Nr[r.format])throw new Error(`Unknown data format "${r.format}"`);return r.format=r.format||"string",this._params.set(t,r),this}delete(t){this._delete(t)&&this.emit("change")}entries(){const t=[];return this.forEach(((e,r)=>{t.push([r,e])})),t.values()}forEach(t){for(const[e,r]of this._entries.entries())for(let i=0;i<r.length;i++)t(r[i],e,this)}get(t,e){const r=this._entries.get(t),i=r&&r[e||0];return null==i?null:i}getAll(t){const e=this._entries.get(t);return e?e.slice(0):[]}has(t){return this._entries.has(t)}keys(){return this._entries.keys()}set(t,e){this._delete(t),this._add(t,e),this.emit("change")}sort(t){this._entries.sort(t),this.emit("change")}values(){const t=[];return this.forEach((e=>t.push(e))),t.values()}toString(){let t="";return this.forEach(((e,r)=>{const i=this._params.get(r),s=i?"string"==typeof i.format?Nr[i.format]:i.format:void 0,n=t=>encodeURIComponent(s?s.stringify(t,r):null==t?"":""+t),o=Array.isArray(e)?e.map(n).join(i?.arrayDelimiter||","):n(e);o&&(t.length>0&&(t+="&"),t+=r+"="+o)})),t}parse(t){if(this._entries.clear(),this._size=0,t&&t.startsWith("?")&&(t=t.substring(1)),!t)return;const e=(0,i.tokenize)(t,{delimiters:"&",quotes:!0,brackets:!0});for(const t of e){if(!t)continue;const e=(0,i.tokenize)(t,{delimiters:"=",quotes:!0,brackets:!0}),r=decodeURIComponent(e.next()||""),s=e.join("="),n=this._params.get(r);if(n?.array){const t=(0,i.splitString)(s,{delimiters:n?.arrayDelimiter||",",brackets:!0,quotes:!0}).map((t=>decodeURIComponent(t)));this._add(r,t)}else this._add(r,decodeURIComponent(s))}this.emit("change")}toURLSearchParams(){const t=new URLSearchParams;return this.forEach(((e,r)=>{const i=this._params.get(r),s=i?"string"==typeof i.format?Nr[i.format]:i.format:void 0,n=t=>s?s.stringify(t,r):null==t?"":""+t,o=Array.isArray(e)?e.map(n).join(i?.arrayDelimiter||","):n(e);t.append(r,o)})),t}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"URLSearchParams"}[Lr](){return this._entries}_delete(t){const e=this._entries.get(t);return!!e&&(this._size-=e.length,this._entries.delete(t),!0)}_add(t,e){const r=this._params.get(t),i=r?"string"==typeof r.format?Nr[r.format]:r.format:void 0,s=e=>i?i.parse(e,t):e;let n=Array.isArray(e)?e.map(s):s(e);if(r&&("strict"===r.array?n=Array.isArray(n)?n:[n]:r.array&&(n=Array.isArray(n)&&1===n.length?n[0]:n),Array.isArray(n))){if(r.minArrayItems&&n.length<r.minArrayItems)throw new Error(`"${t}" parameter requires at least ${r.minArrayItems} values`);if(r.maxArrayItems&&n.length>r.maxArrayItems)throw new Error(`"${t}" parameter accepts up to ${r.maxArrayItems} values`)}let o=this._entries.get(t);return o||(o=[],this._entries.set(t,o)),o.push(n),this._size++,!0}}Symbol.for("nodejs.util.inspect.custom"),Symbol.for("opra.url.context"),Symbol.for("opra.url.path"),Symbol.for("opra.url.searchparams");r(9651),r(4851);Buffer.from("\r\n"),Symbol("kHeaders"),Symbol("kHeadersCount"),Symbol("kTrailers"),Symbol("kTrailersCount")}}]);
|