@opra/common 1.20.0 → 1.22.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 +3 -0
- package/browser.js +12 -0
- package/{esm/document → document}/api-document.js +7 -7
- package/{esm/document → document}/common/api-base.js +2 -1
- package/{esm/document → document}/common/data-type-map.js +3 -6
- package/{esm/document → document}/common/document-init-context.js +4 -3
- package/{esm/document → document}/common/document-node.js +4 -0
- package/{esm/document → document}/common/opra-document-error.js +1 -1
- package/{esm/document → document}/common/value.js +4 -0
- package/{esm/document → document}/data-type/api-field.js +1 -0
- package/{types/document → document}/data-type/array-type.d.ts +1 -1
- package/{esm/document → document}/data-type/complex-type-base.js +3 -0
- package/{esm/document → document}/data-type/complex-type.js +1 -0
- package/{esm/document → document}/data-type/extended-types/base64.type.js +1 -0
- package/{esm/document → document}/data-type/extended-types/date-time-tz.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/date-time.type.js +3 -0
- package/{esm/document → document}/data-type/extended-types/date.type.js +3 -0
- package/{esm/document → document}/data-type/extended-types/email.type.js +9 -0
- package/{esm/document → document}/data-type/extended-types/field-path.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/filter.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/partial-date.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/time.type.js +2 -0
- package/{esm/document → document}/data-type/extended-types/uuid.type.js +1 -0
- package/{esm/document → document}/data-type/mapped-type.js +4 -0
- package/{esm/document → document}/data-type/primitive-types/number.type.js +2 -0
- package/{esm/document → document}/data-type/primitive-types/string.type.js +4 -0
- package/{esm/document → document}/data-type/simple-type.js +3 -0
- package/document/decorators/ws-param.decorator.d.ts +7 -0
- package/{esm/document → document}/decorators/ws-param.decorator.js +2 -2
- package/{esm/document → document}/factory/api-document.factory.js +1 -3
- package/{esm/document → document}/factory/ws-api.factory.js +14 -3
- package/{esm/document → document}/http/http-api.js +5 -4
- package/{esm/document → document}/http/http-multipart-field.js +3 -0
- package/{esm/document → document}/http/http-operation-response.js +3 -0
- package/{esm/document → document}/http/http-request-body.js +8 -1
- package/{esm/document → document}/http/http-status-range.js +2 -2
- package/{esm/document → document}/mq/mq-api.js +5 -4
- package/{esm/document → document}/mq/mq-operation-response.js +7 -1
- package/{esm/document → document}/ws/ws-api.js +4 -4
- package/{types/document → document}/ws/ws-operation.d.ts +15 -3
- package/{esm/document → document}/ws/ws-operation.js +10 -2
- package/{esm/exception → exception}/http-errors/bad-request.error.js +1 -4
- package/{esm/exception → exception}/http-errors/conflict.error.js +1 -4
- package/{esm/exception → exception}/http-errors/failed-dependency.error.js +1 -4
- package/{esm/exception → exception}/http-errors/forbidden.error.js +1 -4
- package/{esm/exception → exception}/http-errors/internal-server.error.js +1 -4
- package/{esm/exception → exception}/http-errors/method-not-allowed.error.js +1 -4
- package/{esm/exception → exception}/http-errors/not-acceptable.error.js +1 -4
- package/{esm/exception → exception}/http-errors/not-found.error.js +1 -4
- package/{esm/exception → exception}/http-errors/resource-conflict.error.js +1 -1
- package/{esm/exception → exception}/http-errors/unauthorized.error.js +1 -4
- package/{esm/exception → exception}/http-errors/unprocessable-entity.error.js +1 -4
- package/{esm/exception → exception}/opra-exception.js +5 -1
- package/{esm/exception → exception}/opra-http-error.js +1 -0
- package/filter/antlr/OpraFilterLexer.js +425 -0
- package/filter/antlr/OpraFilterListener.js +302 -0
- package/{esm/filter → filter}/antlr/OpraFilterParser.js +218 -214
- package/filter/antlr/OpraFilterVisitor.js +185 -0
- package/{esm/filter → filter}/ast/abstract/ast.js +1 -0
- package/{esm/filter → filter}/ast/expressions/arithmetic-expression.js +3 -1
- package/{esm/filter → filter}/ast/expressions/array-expression.js +1 -0
- package/{esm/filter → filter}/ast/expressions/comparison-expression.js +4 -0
- package/{esm/filter → filter}/ast/expressions/logical-expression.js +2 -0
- package/{esm/filter → filter}/ast/expressions/negative-expression.js +1 -0
- package/{esm/filter → filter}/ast/expressions/parenthesized-expression.js +1 -0
- package/{esm/filter → filter}/ast/terms/date-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/date-time-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/null-literal.js +1 -1
- package/{esm/filter → filter}/ast/terms/number-literal.js +1 -0
- package/{esm/filter → filter}/ast/terms/time-literal.js +1 -0
- package/{esm/filter → filter}/filter-rules.js +2 -2
- package/{esm/filter → filter}/filter-tree-visitor.js +1 -0
- package/{esm/filter → filter}/opra-error-listener.js +1 -0
- package/{esm/helpers → helpers}/parse-fields-projection.js +2 -0
- package/package.json +15 -35
- package/{types/schema → schema}/ws/ws-api.interface.d.ts +4 -0
- package/browser/index.cjs +0 -12
- package/browser/index.mjs +0 -12
- package/cjs/document/api-document.js +0 -182
- package/cjs/document/common/api-base.js +0 -31
- package/cjs/document/common/data-type-map.js +0 -77
- package/cjs/document/common/document-element.js +0 -34
- package/cjs/document/common/document-init-context.js +0 -69
- package/cjs/document/common/document-node.js +0 -145
- package/cjs/document/common/opra-document-error.js +0 -15
- package/cjs/document/common/value.js +0 -39
- package/cjs/document/constants.js +0 -18
- package/cjs/document/data-type/api-field.js +0 -124
- package/cjs/document/data-type/array-type.js +0 -78
- package/cjs/document/data-type/complex-type-base.js +0 -346
- package/cjs/document/data-type/complex-type.js +0 -127
- package/cjs/document/data-type/data-type.js +0 -67
- package/cjs/document/data-type/enum-type.js +0 -128
- package/cjs/document/data-type/extended-types/base64.type.js +0 -49
- package/cjs/document/data-type/extended-types/date-time-tz.type.js +0 -63
- package/cjs/document/data-type/extended-types/date-time.type.js +0 -76
- package/cjs/document/data-type/extended-types/date.type.js +0 -74
- package/cjs/document/data-type/extended-types/email.type.js +0 -95
- package/cjs/document/data-type/extended-types/field-path.type.js +0 -65
- package/cjs/document/data-type/extended-types/filter.type.js +0 -88
- package/cjs/document/data-type/extended-types/index.js +0 -16
- package/cjs/document/data-type/extended-types/object-id.type.js +0 -31
- package/cjs/document/data-type/extended-types/operation-result.type.js +0 -67
- package/cjs/document/data-type/extended-types/partial-date.type.js +0 -85
- package/cjs/document/data-type/extended-types/time.type.js +0 -55
- package/cjs/document/data-type/extended-types/url.type.js +0 -31
- package/cjs/document/data-type/extended-types/uuid.type.js +0 -37
- package/cjs/document/data-type/mapped-type.js +0 -120
- package/cjs/document/data-type/mixin-type.js +0 -123
- package/cjs/document/data-type/omit-type.js +0 -10
- package/cjs/document/data-type/partial-type.js +0 -12
- package/cjs/document/data-type/pick-type.js +0 -10
- package/cjs/document/data-type/primitive-types/any.type.js +0 -27
- package/cjs/document/data-type/primitive-types/bigint.type.js +0 -38
- package/cjs/document/data-type/primitive-types/boolean.type.js +0 -31
- package/cjs/document/data-type/primitive-types/index.js +0 -11
- package/cjs/document/data-type/primitive-types/integer.type.js +0 -38
- package/cjs/document/data-type/primitive-types/null.type.js +0 -31
- package/cjs/document/data-type/primitive-types/number.type.js +0 -50
- package/cjs/document/data-type/primitive-types/object.type.js +0 -20
- package/cjs/document/data-type/primitive-types/string.type.js +0 -70
- package/cjs/document/data-type/required-type.js +0 -12
- package/cjs/document/data-type/simple-type.js +0 -133
- package/cjs/document/data-type/union-type.js +0 -84
- package/cjs/document/data-type/utils/create-mapped-class.js +0 -56
- package/cjs/document/data-type/utils/get-is-inherited-predicate-fn.js +0 -14
- package/cjs/document/decorators/api-field-decorator.js +0 -50
- package/cjs/document/decorators/complex-type.decorator.js +0 -31
- package/cjs/document/decorators/http-controller.decorator.js +0 -145
- package/cjs/document/decorators/http-operation-entity-create.decorator.js +0 -58
- package/cjs/document/decorators/http-operation-entity-delete-many.decorator.js +0 -41
- package/cjs/document/decorators/http-operation-entity-delete.decorator.js +0 -41
- package/cjs/document/decorators/http-operation-entity-find-many.decorator.js +0 -85
- package/cjs/document/decorators/http-operation-entity-get.decorator.js +0 -56
- package/cjs/document/decorators/http-operation-entity-replace.decorator.js +0 -56
- package/cjs/document/decorators/http-operation-entity-update-many.decorator.js +0 -50
- package/cjs/document/decorators/http-operation-entity-update.decorator.js +0 -66
- package/cjs/document/decorators/http-operation-entity.decorator.js +0 -143
- package/cjs/document/decorators/http-operation.decorator.js +0 -213
- package/cjs/document/decorators/mq-controller.decorator.js +0 -67
- package/cjs/document/decorators/mq-operation.decorator.js +0 -82
- package/cjs/document/decorators/simple-type.decorator.js +0 -67
- package/cjs/document/decorators/ws-controller.decorator.js +0 -51
- package/cjs/document/decorators/ws-operation.decorator.js +0 -42
- package/cjs/document/decorators/ws-param.decorator.js +0 -22
- package/cjs/document/factory/api-document.factory.js +0 -192
- package/cjs/document/factory/data-type.factory.js +0 -647
- package/cjs/document/factory/http-api.factory.js +0 -302
- package/cjs/document/factory/mq-api.factory.js +0 -203
- package/cjs/document/factory/ws-api.factory.js +0 -145
- package/cjs/document/http/http-api.js +0 -40
- package/cjs/document/http/http-controller.js +0 -159
- package/cjs/document/http/http-media-type.js +0 -104
- package/cjs/document/http/http-multipart-field.js +0 -32
- package/cjs/document/http/http-operation-response.js +0 -47
- package/cjs/document/http/http-operation.js +0 -126
- package/cjs/document/http/http-parameter.js +0 -57
- package/cjs/document/http/http-request-body.js +0 -27
- package/cjs/document/http/http-status-range.js +0 -45
- package/cjs/document/index.js +0 -70
- package/cjs/document/mq/mq-api.js +0 -54
- package/cjs/document/mq/mq-controller.js +0 -101
- package/cjs/document/mq/mq-header.js +0 -48
- package/cjs/document/mq/mq-operation-response.js +0 -66
- package/cjs/document/mq/mq-operation.js +0 -101
- package/cjs/document/utils/inspect.util.js +0 -7
- package/cjs/document/utils/parse-regexp.util.js +0 -21
- package/cjs/document/utils/string-compare.util.js +0 -10
- package/cjs/document/utils/test-scope-match.js +0 -15
- package/cjs/document/ws/ws-api.js +0 -52
- package/cjs/document/ws/ws-controller.js +0 -78
- package/cjs/document/ws/ws-operation.js +0 -64
- package/cjs/enums/http-headers-codes.enum.js +0 -411
- package/cjs/enums/http-status-codes.enum.js +0 -300
- package/cjs/enums/http-status-messages.js +0 -68
- package/cjs/enums/index.js +0 -7
- package/cjs/enums/mime-types.enum.js +0 -17
- package/cjs/exception/error-issue.js +0 -2
- package/cjs/exception/http-errors/bad-request.error.js +0 -23
- package/cjs/exception/http-errors/conflict.error.js +0 -22
- package/cjs/exception/http-errors/failed-dependency.error.js +0 -22
- package/cjs/exception/http-errors/forbidden.error.js +0 -25
- package/cjs/exception/http-errors/internal-server.error.js +0 -23
- package/cjs/exception/http-errors/method-not-allowed.error.js +0 -23
- package/cjs/exception/http-errors/not-acceptable.error.js +0 -23
- package/cjs/exception/http-errors/not-found.error.js +0 -26
- package/cjs/exception/http-errors/permission.error.js +0 -20
- package/cjs/exception/http-errors/resource-conflict.error.js +0 -19
- package/cjs/exception/http-errors/resource-not.available.error.js +0 -23
- package/cjs/exception/http-errors/unauthorized.error.js +0 -23
- package/cjs/exception/http-errors/unprocessable-entity.error.js +0 -23
- package/cjs/exception/index.js +0 -20
- package/cjs/exception/issue-severity.enum.js +0 -23
- package/cjs/exception/opra-exception.js +0 -70
- package/cjs/exception/opra-http-error.js +0 -25
- package/cjs/filter/antlr/OpraFilterLexer.js +0 -427
- package/cjs/filter/antlr/OpraFilterListener.js +0 -11
- package/cjs/filter/antlr/OpraFilterParser.js +0 -1851
- package/cjs/filter/antlr/OpraFilterVisitor.js +0 -14
- package/cjs/filter/ast/abstract/ast.js +0 -9
- package/cjs/filter/ast/abstract/expression.js +0 -7
- package/cjs/filter/ast/abstract/literal.js +0 -14
- package/cjs/filter/ast/abstract/term.js +0 -7
- package/cjs/filter/ast/expressions/arithmetic-expression.js +0 -29
- package/cjs/filter/ast/expressions/array-expression.js +0 -14
- package/cjs/filter/ast/expressions/comparison-expression.js +0 -15
- package/cjs/filter/ast/expressions/logical-expression.js +0 -18
- package/cjs/filter/ast/expressions/negative-expression.js +0 -14
- package/cjs/filter/ast/expressions/parenthesized-expression.js +0 -14
- package/cjs/filter/ast/index.js +0 -21
- package/cjs/filter/ast/terms/boolean-literal.js +0 -10
- package/cjs/filter/ast/terms/date-literal.js +0 -28
- package/cjs/filter/ast/terms/date-time-literal.js +0 -27
- package/cjs/filter/ast/terms/external-constant.js +0 -13
- package/cjs/filter/ast/terms/null-literal.js +0 -11
- package/cjs/filter/ast/terms/number-literal.js +0 -39
- package/cjs/filter/ast/terms/qualified-identifier.js +0 -10
- package/cjs/filter/ast/terms/string-literal.js +0 -14
- package/cjs/filter/ast/terms/time-literal.js +0 -34
- package/cjs/filter/build.js +0 -126
- package/cjs/filter/errors.js +0 -21
- package/cjs/filter/filter-rules.js +0 -150
- package/cjs/filter/filter-tree-visitor.js +0 -97
- package/cjs/filter/index.js +0 -5
- package/cjs/filter/opra-error-listener.js +0 -21
- package/cjs/filter/opra-filter.ns.js +0 -8
- package/cjs/filter/parse.js +0 -38
- package/cjs/filter/utils.js +0 -25
- package/cjs/helpers/function-utils.js +0 -15
- package/cjs/helpers/get-stack-filename.js +0 -51
- package/cjs/helpers/index.js +0 -12
- package/cjs/helpers/mixin-utils.js +0 -35
- package/cjs/helpers/object-utils.js +0 -19
- package/cjs/helpers/parse-fields-projection.js +0 -67
- package/cjs/helpers/responsive-map.js +0 -155
- package/cjs/helpers/safe-json-stringify.js +0 -16
- package/cjs/helpers/type-guards.js +0 -46
- package/cjs/i18n/i18n.js +0 -139
- package/cjs/i18n/index.js +0 -10
- package/cjs/i18n/string-utils.js +0 -12
- package/cjs/i18n/translate.js +0 -16
- package/cjs/index.js +0 -14
- package/cjs/package.json +0 -3
- package/cjs/polifils/array-find-last.js +0 -22
- package/cjs/schema/api-document.interface.js +0 -2
- package/cjs/schema/api.interface.js +0 -2
- package/cjs/schema/constants.js +0 -4
- package/cjs/schema/data-type/array-type.interface.js +0 -7
- package/cjs/schema/data-type/complex-type.interface.js +0 -7
- package/cjs/schema/data-type/data-type.interface.js +0 -2
- package/cjs/schema/data-type/enum-type.interface.js +0 -7
- package/cjs/schema/data-type/field.interface.js +0 -2
- package/cjs/schema/data-type/mapped-type.interface.js +0 -7
- package/cjs/schema/data-type/mixin-type.interface.js +0 -7
- package/cjs/schema/data-type/simple-type.interface.js +0 -7
- package/cjs/schema/data-type/union-type.interface.js +0 -7
- package/cjs/schema/data-type-container.interface.js +0 -2
- package/cjs/schema/http/http-api.interface.js +0 -2
- package/cjs/schema/http/http-controller.interface.js +0 -11
- package/cjs/schema/http/http-media-type.interface.js +0 -2
- package/cjs/schema/http/http-multipart-field.interface.js +0 -2
- package/cjs/schema/http/http-operation-response.interface.js +0 -2
- package/cjs/schema/http/http-operation.interface.js +0 -7
- package/cjs/schema/http/http-parameter.interface.js +0 -2
- package/cjs/schema/http/http-request-body.interface.js +0 -2
- package/cjs/schema/http/http-status-range.interface.js +0 -2
- package/cjs/schema/index.js +0 -6
- package/cjs/schema/mq/mq-api.interface.js +0 -2
- package/cjs/schema/mq/mq-controller.interface.js +0 -11
- package/cjs/schema/mq/mq-header.interface.js +0 -2
- package/cjs/schema/mq/mq-operation.interface.js +0 -7
- package/cjs/schema/opra-schema.js +0 -35
- package/cjs/schema/type-guards.js +0 -54
- package/cjs/schema/types.js +0 -2
- package/cjs/schema/value.interface.js +0 -2
- package/cjs/schema/ws/ws-api.interface.js +0 -2
- package/cjs/schema/ws/ws-controller.interface.js +0 -11
- package/cjs/schema/ws/ws-operation.interface.js +0 -7
- package/cjs/types.js +0 -2
- package/esm/filter/antlr/OpraFilterLexer.js +0 -425
- package/esm/filter/antlr/OpraFilterListener.js +0 -8
- package/esm/filter/antlr/OpraFilterVisitor.js +0 -11
- package/esm/helpers/monkey-patches.js +0 -14
- package/esm/package.json +0 -3
- package/types/document/decorators/ws-param.decorator.d.ts +0 -2
- package/types/index.d.cts +0 -9
- /package/{types/document → document}/api-document.d.ts +0 -0
- /package/{types/document → document}/common/api-base.d.ts +0 -0
- /package/{types/document → document}/common/data-type-map.d.ts +0 -0
- /package/{types/document → document}/common/document-element.d.ts +0 -0
- /package/{esm/document → document}/common/document-element.js +0 -0
- /package/{types/document → document}/common/document-init-context.d.ts +0 -0
- /package/{types/document → document}/common/document-node.d.ts +0 -0
- /package/{types/document → document}/common/opra-document-error.d.ts +0 -0
- /package/{types/document → document}/common/value.d.ts +0 -0
- /package/{types/document → document}/constants.d.ts +0 -0
- /package/{esm/document → document}/constants.js +0 -0
- /package/{types/document → document}/data-type/api-field.d.ts +0 -0
- /package/{esm/document → document}/data-type/array-type.js +0 -0
- /package/{types/document → document}/data-type/complex-type-base.d.ts +0 -0
- /package/{types/document → document}/data-type/complex-type.d.ts +0 -0
- /package/{types/document → document}/data-type/data-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/data-type.js +0 -0
- /package/{types/document → document}/data-type/enum-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/enum-type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/base64.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date-time-tz.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date-time.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/date.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/email.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/field-path.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/filter.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/index.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/index.js +0 -0
- /package/{types/document → document}/data-type/extended-types/object-id.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/object-id.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/operation-result.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/operation-result.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/partial-date.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/time.type.d.ts +0 -0
- /package/{types/document → document}/data-type/extended-types/url.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/extended-types/url.type.js +0 -0
- /package/{types/document → document}/data-type/extended-types/uuid.type.d.ts +0 -0
- /package/{types/document → document}/data-type/mapped-type.d.ts +0 -0
- /package/{types/document → document}/data-type/mixin-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/mixin-type.js +0 -0
- /package/{types/document → document}/data-type/omit-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/omit-type.js +0 -0
- /package/{types/document → document}/data-type/partial-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/partial-type.js +0 -0
- /package/{types/document → document}/data-type/pick-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/pick-type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/any.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/any.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/bigint.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/bigint.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/boolean.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/boolean.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/index.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/index.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/integer.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/integer.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/null.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/null.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/number.type.d.ts +0 -0
- /package/{types/document → document}/data-type/primitive-types/object.type.d.ts +0 -0
- /package/{esm/document → document}/data-type/primitive-types/object.type.js +0 -0
- /package/{types/document → document}/data-type/primitive-types/string.type.d.ts +0 -0
- /package/{types/document → document}/data-type/required-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/required-type.js +0 -0
- /package/{types/document → document}/data-type/simple-type.d.ts +0 -0
- /package/{types/document → document}/data-type/union-type.d.ts +0 -0
- /package/{esm/document → document}/data-type/union-type.js +0 -0
- /package/{types/document → document}/data-type/utils/create-mapped-class.d.ts +0 -0
- /package/{esm/document → document}/data-type/utils/create-mapped-class.js +0 -0
- /package/{types/document → document}/data-type/utils/get-is-inherited-predicate-fn.d.ts +0 -0
- /package/{esm/document → document}/data-type/utils/get-is-inherited-predicate-fn.js +0 -0
- /package/{types/document → document}/decorators/api-field-decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/api-field-decorator.js +0 -0
- /package/{types/document → document}/decorators/complex-type.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/complex-type.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-create.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-create.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-delete-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-delete-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-delete.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-delete.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-find-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-find-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-get.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-get.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-replace.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-replace.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-update-many.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-update-many.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity-update.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity-update.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation-entity.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation-entity.decorator.js +0 -0
- /package/{types/document → document}/decorators/http-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/http-operation.decorator.js +0 -0
- /package/{types/document → document}/decorators/mq-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/mq-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/mq-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/mq-operation.decorator.js +0 -0
- /package/{types/document → document}/decorators/simple-type.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/simple-type.decorator.js +0 -0
- /package/{types/document → document}/decorators/ws-controller.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/ws-controller.decorator.js +0 -0
- /package/{types/document → document}/decorators/ws-operation.decorator.d.ts +0 -0
- /package/{esm/document → document}/decorators/ws-operation.decorator.js +0 -0
- /package/{types/document → document}/factory/api-document.factory.d.ts +0 -0
- /package/{types/document → document}/factory/data-type.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/data-type.factory.js +0 -0
- /package/{types/document → document}/factory/http-api.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/http-api.factory.js +0 -0
- /package/{types/document → document}/factory/mq-api.factory.d.ts +0 -0
- /package/{esm/document → document}/factory/mq-api.factory.js +0 -0
- /package/{types/document → document}/factory/ws-api.factory.d.ts +0 -0
- /package/{types/document → document}/http/http-api.d.ts +0 -0
- /package/{types/document → document}/http/http-controller.d.ts +0 -0
- /package/{esm/document → document}/http/http-controller.js +0 -0
- /package/{types/document → document}/http/http-media-type.d.ts +0 -0
- /package/{esm/document → document}/http/http-media-type.js +0 -0
- /package/{types/document → document}/http/http-multipart-field.d.ts +0 -0
- /package/{types/document → document}/http/http-operation-response.d.ts +0 -0
- /package/{types/document → document}/http/http-operation.d.ts +0 -0
- /package/{esm/document → document}/http/http-operation.js +0 -0
- /package/{types/document → document}/http/http-parameter.d.ts +0 -0
- /package/{esm/document → document}/http/http-parameter.js +0 -0
- /package/{types/document → document}/http/http-request-body.d.ts +0 -0
- /package/{types/document → document}/http/http-status-range.d.ts +0 -0
- /package/{types/document → document}/index.d.ts +0 -0
- /package/{esm/document → document}/index.js +0 -0
- /package/{types/document → document}/mq/mq-api.d.ts +0 -0
- /package/{types/document → document}/mq/mq-controller.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-controller.js +0 -0
- /package/{types/document → document}/mq/mq-header.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-header.js +0 -0
- /package/{types/document → document}/mq/mq-operation-response.d.ts +0 -0
- /package/{types/document → document}/mq/mq-operation.d.ts +0 -0
- /package/{esm/document → document}/mq/mq-operation.js +0 -0
- /package/{types/document → document}/utils/inspect.util.d.ts +0 -0
- /package/{esm/document → document}/utils/inspect.util.js +0 -0
- /package/{types/document → document}/utils/parse-regexp.util.d.ts +0 -0
- /package/{esm/document → document}/utils/parse-regexp.util.js +0 -0
- /package/{types/document → document}/utils/string-compare.util.d.ts +0 -0
- /package/{esm/document → document}/utils/string-compare.util.js +0 -0
- /package/{types/document → document}/utils/test-scope-match.d.ts +0 -0
- /package/{esm/document → document}/utils/test-scope-match.js +0 -0
- /package/{types/document → document}/ws/ws-api.d.ts +0 -0
- /package/{types/document → document}/ws/ws-controller.d.ts +0 -0
- /package/{esm/document → document}/ws/ws-controller.js +0 -0
- /package/{types/enums → enums}/http-headers-codes.enum.d.ts +0 -0
- /package/{esm/enums → enums}/http-headers-codes.enum.js +0 -0
- /package/{types/enums → enums}/http-status-codes.enum.d.ts +0 -0
- /package/{esm/enums → enums}/http-status-codes.enum.js +0 -0
- /package/{types/enums → enums}/http-status-messages.d.ts +0 -0
- /package/{esm/enums → enums}/http-status-messages.js +0 -0
- /package/{types/enums → enums}/index.d.ts +0 -0
- /package/{esm/enums → enums}/index.js +0 -0
- /package/{types/enums → enums}/mime-types.enum.d.ts +0 -0
- /package/{esm/enums → enums}/mime-types.enum.js +0 -0
- /package/{types/exception → exception}/error-issue.d.ts +0 -0
- /package/{esm/exception → exception}/error-issue.js +0 -0
- /package/{types/exception → exception}/http-errors/bad-request.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/conflict.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/failed-dependency.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/forbidden.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/internal-server.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/method-not-allowed.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/not-acceptable.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/not-found.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/permission.error.d.ts +0 -0
- /package/{esm/exception → exception}/http-errors/permission.error.js +0 -0
- /package/{types/exception → exception}/http-errors/resource-conflict.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/resource-not.available.error.d.ts +0 -0
- /package/{esm/exception → exception}/http-errors/resource-not.available.error.js +0 -0
- /package/{types/exception → exception}/http-errors/unauthorized.error.d.ts +0 -0
- /package/{types/exception → exception}/http-errors/unprocessable-entity.error.d.ts +0 -0
- /package/{types/exception → exception}/index.d.ts +0 -0
- /package/{esm/exception → exception}/index.js +0 -0
- /package/{types/exception → exception}/issue-severity.enum.d.ts +0 -0
- /package/{esm/exception → exception}/issue-severity.enum.js +0 -0
- /package/{types/exception → exception}/opra-exception.d.ts +0 -0
- /package/{types/exception → exception}/opra-http-error.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterLexer.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterListener.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterParser.d.ts +0 -0
- /package/{types/filter → filter}/antlr/OpraFilterVisitor.d.ts +0 -0
- /package/{types/filter → filter}/ast/abstract/ast.d.ts +0 -0
- /package/{types/filter → filter}/ast/abstract/expression.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/expression.js +0 -0
- /package/{types/filter → filter}/ast/abstract/literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/literal.js +0 -0
- /package/{types/filter → filter}/ast/abstract/term.d.ts +0 -0
- /package/{esm/filter → filter}/ast/abstract/term.js +0 -0
- /package/{types/filter → filter}/ast/expressions/arithmetic-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/array-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/comparison-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/logical-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/negative-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/expressions/parenthesized-expression.d.ts +0 -0
- /package/{types/filter → filter}/ast/index.d.ts +0 -0
- /package/{esm/filter → filter}/ast/index.js +0 -0
- /package/{types/filter → filter}/ast/terms/boolean-literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/boolean-literal.js +0 -0
- /package/{types/filter → filter}/ast/terms/date-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/date-time-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/external-constant.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/external-constant.js +0 -0
- /package/{types/filter → filter}/ast/terms/null-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/number-literal.d.ts +0 -0
- /package/{types/filter → filter}/ast/terms/qualified-identifier.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/qualified-identifier.js +0 -0
- /package/{types/filter → filter}/ast/terms/string-literal.d.ts +0 -0
- /package/{esm/filter → filter}/ast/terms/string-literal.js +0 -0
- /package/{types/filter → filter}/ast/terms/time-literal.d.ts +0 -0
- /package/{types/filter → filter}/build.d.ts +0 -0
- /package/{esm/filter → filter}/build.js +0 -0
- /package/{types/filter → filter}/errors.d.ts +0 -0
- /package/{esm/filter → filter}/errors.js +0 -0
- /package/{types/filter → filter}/filter-rules.d.ts +0 -0
- /package/{types/filter → filter}/filter-tree-visitor.d.ts +0 -0
- /package/{types/filter → filter}/index.d.ts +0 -0
- /package/{esm/filter → filter}/index.js +0 -0
- /package/{types/filter → filter}/opra-error-listener.d.ts +0 -0
- /package/{types/filter → filter}/opra-filter.ns.d.ts +0 -0
- /package/{esm/filter → filter}/opra-filter.ns.js +0 -0
- /package/{types/filter → filter}/parse.d.ts +0 -0
- /package/{esm/filter → filter}/parse.js +0 -0
- /package/{types/filter → filter}/utils.d.ts +0 -0
- /package/{esm/filter → filter}/utils.js +0 -0
- /package/{types/helpers → helpers}/function-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/function-utils.js +0 -0
- /package/{types/helpers → helpers}/get-stack-filename.d.ts +0 -0
- /package/{esm/helpers → helpers}/get-stack-filename.js +0 -0
- /package/{types/helpers → helpers}/index.d.ts +0 -0
- /package/{esm/helpers → helpers}/index.js +0 -0
- /package/{types/helpers → helpers}/mixin-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/mixin-utils.js +0 -0
- /package/{types/helpers → helpers}/monkey-patches.d.ts +0 -0
- /package/{cjs/helpers → helpers}/monkey-patches.js +0 -0
- /package/{types/helpers → helpers}/object-utils.d.ts +0 -0
- /package/{esm/helpers → helpers}/object-utils.js +0 -0
- /package/{types/helpers → helpers}/parse-fields-projection.d.ts +0 -0
- /package/{types/helpers → helpers}/responsive-map.d.ts +0 -0
- /package/{esm/helpers → helpers}/responsive-map.js +0 -0
- /package/{types/helpers → helpers}/safe-json-stringify.d.ts +0 -0
- /package/{esm/helpers → helpers}/safe-json-stringify.js +0 -0
- /package/{types/helpers → helpers}/type-guards.d.ts +0 -0
- /package/{esm/helpers → helpers}/type-guards.js +0 -0
- /package/{types/i18n → i18n}/i18n.d.ts +0 -0
- /package/{esm/i18n → i18n}/i18n.js +0 -0
- /package/{types/i18n → i18n}/index.d.ts +0 -0
- /package/{esm/i18n → i18n}/index.js +0 -0
- /package/{types/i18n → i18n}/string-utils.d.ts +0 -0
- /package/{esm/i18n → i18n}/string-utils.js +0 -0
- /package/{types/i18n → i18n}/translate.d.ts +0 -0
- /package/{esm/i18n → i18n}/translate.js +0 -0
- /package/{types/index.d.ts → index.d.ts} +0 -0
- /package/{esm/index.js → index.js} +0 -0
- /package/{types/polifils → polifils}/array-find-last.d.ts +0 -0
- /package/{esm/polifils → polifils}/array-find-last.js +0 -0
- /package/{types/schema → schema}/api-document.interface.d.ts +0 -0
- /package/{esm/schema → schema}/api-document.interface.js +0 -0
- /package/{types/schema → schema}/api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/api.interface.js +0 -0
- /package/{types/schema → schema}/constants.d.ts +0 -0
- /package/{esm/schema → schema}/constants.js +0 -0
- /package/{types/schema → schema}/data-type/array-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/array-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/complex-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/complex-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/data-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/data-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/enum-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/enum-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/field.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/field.interface.js +0 -0
- /package/{types/schema → schema}/data-type/mapped-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/mapped-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/mixin-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/mixin-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/simple-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/simple-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type/union-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type/union-type.interface.js +0 -0
- /package/{types/schema → schema}/data-type-container.interface.d.ts +0 -0
- /package/{esm/schema → schema}/data-type-container.interface.js +0 -0
- /package/{types/schema → schema}/http/http-api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-api.interface.js +0 -0
- /package/{types/schema → schema}/http/http-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-controller.interface.js +0 -0
- /package/{types/schema → schema}/http/http-media-type.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-media-type.interface.js +0 -0
- /package/{types/schema → schema}/http/http-multipart-field.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-multipart-field.interface.js +0 -0
- /package/{types/schema → schema}/http/http-operation-response.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-operation-response.interface.js +0 -0
- /package/{types/schema → schema}/http/http-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-operation.interface.js +0 -0
- /package/{types/schema → schema}/http/http-parameter.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-parameter.interface.js +0 -0
- /package/{types/schema → schema}/http/http-request-body.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-request-body.interface.js +0 -0
- /package/{types/schema → schema}/http/http-status-range.interface.d.ts +0 -0
- /package/{esm/schema → schema}/http/http-status-range.interface.js +0 -0
- /package/{types/schema → schema}/index.d.ts +0 -0
- /package/{esm/schema → schema}/index.js +0 -0
- /package/{types/schema → schema}/mq/mq-api.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-api.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-controller.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-header.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-header.interface.js +0 -0
- /package/{types/schema → schema}/mq/mq-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/mq/mq-operation.interface.js +0 -0
- /package/{types/schema → schema}/opra-schema.d.ts +0 -0
- /package/{esm/schema → schema}/opra-schema.js +0 -0
- /package/{types/schema → schema}/type-guards.d.ts +0 -0
- /package/{esm/schema → schema}/type-guards.js +0 -0
- /package/{types/schema → schema}/types.d.ts +0 -0
- /package/{esm/schema → schema}/types.js +0 -0
- /package/{types/schema → schema}/value.interface.d.ts +0 -0
- /package/{esm/schema → schema}/value.interface.js +0 -0
- /package/{esm/schema → schema}/ws/ws-api.interface.js +0 -0
- /package/{types/schema → schema}/ws/ws-controller.interface.d.ts +0 -0
- /package/{esm/schema → schema}/ws/ws-controller.interface.js +0 -0
- /package/{types/schema → schema}/ws/ws-operation.interface.d.ts +0 -0
- /package/{esm/schema → schema}/ws/ws-operation.interface.js +0 -0
- /package/{types/types.d.ts → types.d.ts} +0 -0
- /package/{esm/types.js → types.js} +0 -0
package/README.md
ADDED
package/browser.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/****************************************
|
|
2
|
+
* All rights reserved Panates® 2022-2025
|
|
3
|
+
* http://www.panates.com
|
|
4
|
+
*****************************************/
|
|
5
|
+
|
|
6
|
+
var fi=Object.defineProperty;var op=(o,e,t)=>e in o?fi(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var a=(o,e)=>fi(o,"name",{value:e,configurable:!0});var Dr=(o,e)=>{for(var t in e)fi(o,t,{get:e[t],enumerable:!0})};var p=(o,e,t)=>op(o,typeof e!="symbol"?e+"":e,t);import"reflect-metadata";Array.prototype.findLast||(Array.prototype.findLast=function(o,e){let t=this.findLastIndex(o,e);return t>=0?this[t]:void 0},Array.prototype.findLastIndex=function(o,e){if(this==null)throw new TypeError("this is null or not defined");let t=Object(this),r=this.length;e=e||this;for(let i=r-1;i>=0;i--)if(o.call(e,t[i],i,t))return i;return-1});import{omitUndefined as Wp}from"@jsopen/objects";import{isString as zp}from"valgen";import{omitUndefined as mp}from"@jsopen/objects";import ap from"@browsery/i18next";import{splitString as pp,tokenize as Ys}from"fast-tokenizer";var np=/\\(.)/g,sp=/(\\)/g;function zs(o){return o.replace(sp,"\\\\")}a(zs,"escapeString");function Js(o){return o.replace(np,"$1")}a(Js,"unescapeString");var cp=Object.getPrototypeOf(ap.createInstance()).constructor,Gt=class Gt extends cp{async init(e,t){let r=typeof e=="object"?e:{},i=typeof e=="function"?e:t;try{let n=await super.init(r,i),s=this.services.formatter;if(s.add("lowercase",(c,l)=>c.toLocaleLowerCase(l)),s.add("uppercase",(c,l)=>c.toLocaleUpperCase(l)),s.add("upperFirst",(c,l)=>c.charAt(0).toLocaleUpperCase(l)+c.substring(1)),r!=null&&r.resources)for(let c of Object.keys(r.resources)){let l=r.resources[c];for(let m of Object.keys(l))this.addResourceBundle(c,m,l[m],!1,!0)}return i&&i(null,n),n}catch(n){throw i&&i(n,this.t),n}}deep(e,t){if(e==null)return e;let r=new WeakMap;return this._deepTranslate(e,r,t)}createInstance(e,t){return new Gt(e,t)}static createInstance(e,t){return new Gt(e,t)}_deepTranslate(e,t,r){if(e==null||r!=null&&r.ignore&&r.ignore(e,this))return e;if(typeof e=="object"&&t.has(e))return t.get(e);if(typeof e=="string"){let i="";for(let n of Ys(e,{brackets:{"$t(":")"},quotes:!0,keepQuotes:!0,keepBrackets:!0,keepDelimiters:!0})){if(n.startsWith("$t(")&&n.endsWith(")")){n=n.substring(3,n.length-1);let s=pp(n,{delimiters:"?",quotes:!0,brackets:{"{":"}"}}),c=Js(n.substring((s[0]||"").length+1));n=s[0]||"";let l=[],m=null;for(let w of Ys(n,{delimiters:",",quotes:!0,brackets:{"{":"}"}})){if(w.startsWith("{")){m=JSON.parse(w);continue}l.push(w)}let T=l.length>1?"$t("+l.join(",")+")":l[0];i+=c?this.t(T,c,{...r,...m}):this.t(T,{...r,...m});continue}i+=n}return i}if(Array.isArray(e)){let i=Array(e.length);t.set(e,i);for(let n=0,s=e.length;n<s;n++)i[n]=this._deepTranslate(e[n],t,r);return t.delete(e),i}if(typeof e=="object"){if(Buffer.isBuffer(e)||Buffer.isBuffer(e)||e instanceof Symbol||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet)return e;let i={};t.set(e,i);let n=Object.keys(e);for(let s=0,c=n.length;s<c;s++){let l=n[s];i[l]=this._deepTranslate(e[l],t,r)}return t.delete(e),i}return e}static get defaultInstance(){return lp}};a(Gt,"I18n");var Xt=Gt,lp=Xt.createInstance();var fp=/(\))/g;function Lf(o,e,t){let r=e&&typeof e=="object"?e:void 0,i=typeof e=="string"?e:t;return"$t("+o+(r?","+JSON.stringify(r):"")+(i?"?"+zs(i).replace(fp,"\\$1"):"")+")"}a(Lf,"translate");var mi=Xt.createInstance();mi.init().catch(()=>{});var ui=class ui extends Error{constructor(t,r){super("Unknown error");p(this,"cause");p(this,"severity","error");p(this,"system");p(this,"code");p(this,"details");r=r||(t instanceof Error?t:void 0),t instanceof Error&&(r=t),r&&r instanceof Error&&(this.cause=r,r.stack&&(this.stack=r.stack)),typeof t=="string"?this.initString(t):t instanceof Error?this.initError(t):this.init(t),this.message=this.message||this.constructor.name}toString(){return mi.deep(this.message)}toJSON(){var r;let t="production";return mp({message:this.message,severity:this.severity,system:this.system,code:this.code,details:this.details,stack:t==="dev"||t==="development"||t==="test"?(r=this.stack)==null?void 0:r.split(`
|
|
7
|
+
`):void 0},!0)}init(t){this.message=(t==null?void 0:t.message)||this.constructor.name,this.severity=(t==null?void 0:t.severity)||"error",t&&(this.system=t.system,this.code=t.code,this.details=t.details)}initString(t){this.init({message:String(t||"")||this.constructor.name,severity:"error",code:this.constructor.name})}initError(t){this.init({message:t.message,severity:t.severity||"error",code:t.code||t.constructor.name})}};a(ui,"OpraException");var xe=ui;var di=class di extends xe{constructor(t,r,i){super(t,r instanceof Error?r:void 0);p(this,"status");this.status=(typeof r=="number"?r:Number(i))||500}setStatus(t){return this.status=t,this}initError(t){typeof t.status=="number"?this.status=t.status:typeof t.getStatus=="function"&&(this.status=t.getStatus()),super.initError(t)}};a(di,"OpraHttpError");var v=di;var hi=class hi extends v{constructor(){super(...arguments);p(this,"status",400)}init(t){super.init({message:"Bad request",code:"BAD_REQUEST",...t})}};a(hi,"BadRequestError");var Qs=hi;var yi=class yi extends v{constructor(){super(...arguments);p(this,"status",409)}init(t){super.init({message:"Conflict",code:"CONFLICT",...t})}};a(yi,"ConflictError");var Gs=yi;var Ti=class Ti extends v{constructor(){super(...arguments);p(this,"status",424)}init(t){super.init({message:"The request failed due to failure of a previous request",code:"FAILED_DEPENDENCY",...t})}};a(Ti,"FailedDependencyError");var Xs=Ti;var Zs;(function(o){o.X_Opra_Version="X-Opra-Version",o.X_Total_Count="X-Total-Count",o.WWW_Authenticate="WWW-Authenticate",o.Authorization="Authorization",o.Proxy_Authenticate="Proxy-Authenticate",o.Proxy_Authorization="Proxy-Authorization",o.Age="Age",o.Cache_Control="Cache-Control",o.Clear_Site_Data="Clear-Site-Data",o.Expires="Expires",o.Pragma="Pragma",o.Last_Modified="Last-Modified",o.ETag="ETag",o.If_Match="If-Match",o.If_None_Match="If-None-Match",o.If_Modified_Since="If-Modified-Since",o.If_Unmodified_Since="If-Unmodified-Since",o.Vary="Vary",o.Connection="Connection",o.Keep_Alive="Keep-Alive",o.Accept="Accept",o.Accept_Encoding="Accept-Encoding",o.Accept_Language="Accept-Language",o.Expect="Expect",o.Cookie="Cookie",o.Set_Cookie="Set-Cookie",o.Access_Control_Allow_Origin="Access-Control-Allow-Origin",o.Access_Control_Allow_Credentials="Access-Control-Allow-Credentials",o.Access_Control_Allow_Headers="Access-Control-Allow-Headers",o.Access_Control_Allow_Methods="Access-Control-Allow-Methods",o.Access_Control_Expose_Headers="Access-Control-Expose-Headers",o.Access_Control_Max_Age="Access-Control-Max-Age",o.Access_Control_Request_Headers="Access-Control-Request-Headers",o.Access_Control_Request_Method="Access-Control-Request-Method",o.Origin="Origin",o.Timing_Allow_Origin="Timing-Allow-Origin",o.Content_Disposition="Content-Disposition",o.Content_ID="Content-ID",o.Content_Length="Content-Length",o.Content_Type="Content-Type",o.Content_Transfer_Encoding="Content-Transfer-Encoding",o.Content_Encoding="Content-Encoding",o.Content_Language="Content-Language",o.Content_Location="Content-Location",o.Forwarded="Forwarded",o.X_Forwarded_For="X-Forwarded-For",o.X_Forwarded_Host="X-Forwarded-Host",o.X_Forwarded_Proto="X-Forwarded-Proto",o.Via="Via",o.Location="Location",o.From="From",o.Host="Host",o.Referer="Referer",o.Referrer_Policy="Referrer-Policy",o.User_Agent="User-Agent",o.Allow="Allow",o.Server="Server",o.Accept_Ranges="Accept-Ranges",o.Range="Range",o.If_Range="If-Range",o.Content_Range="Content-Range",o.Cross_Origin_Embedder_Policy="Cross-Origin-Embedder-Policy",o.Cross_Origin_Opener_Policy="Cross-Origin-Opener-Policy",o.Cross_Origin_Resource_Policy="Cross-Origin-Resource-Policy",o.Content_Security_Policy="Content-Security-Policy",o.Content_Security_Policy_Report_Only="Content-Security-Policy-Report-Only",o.Expect_CT="Expect-CT",o.Feature_Policy="Feature-Policy",o.Strict_Transport_Security="Strict-Transport-Security",o.Upgrade="Upgrade",o.Upgrade_Insecure_Requests="Upgrade-Insecure-Requests",o.X_Content_Type_Options="X-Content-Type-Options",o.X_Download_Options="X-Download-Options",o.X_Frame_Options="X-Frame-Options",o.X_Permitted_Cross_Domain_Policies="X-Permitted-Cross-Domain-Policies",o.X_Powered_By="X-Powered-By",o.X_XSS_Protection="X-XSS-Protection",o.Transfer_Encoding="Transfer-Encoding",o.TE="TE",o.Trailer="Trailer",o.Sec_WebSocket_Key="Sec-WebSocket-Key",o.Sec_WebSocket_Extensions="Sec-WebSocket-Extensions",o.Sec_WebSocket_Accept="Sec-WebSocket-Accept",o.Sec_WebSocket_Protocol="Sec-WebSocket-Protocol",o.Sec_WebSocket_Version="Sec-WebSocket-Version",o.Date="Date",o.Retry_After="Retry-After",o.Server_Timing="Server-Timing",o.X_DNS_Prefetch_Control="X-DNS-Prefetch-Control",o.Max_Forwards="Max-Forwards"})(Zs||(Zs={}));var R;(function(o){o[o.CONTINUE=100]="CONTINUE",o[o.SWITCHING_PROTOCOLS=101]="SWITCHING_PROTOCOLS",o[o.PROCESSING=102]="PROCESSING",o[o.EARLYHINTS=103]="EARLYHINTS",o[o.OK=200]="OK",o[o.CREATED=201]="CREATED",o[o.ACCEPTED=202]="ACCEPTED",o[o.NON_AUTHORITATIVE_INFORMATION=203]="NON_AUTHORITATIVE_INFORMATION",o[o.NO_CONTENT=204]="NO_CONTENT",o[o.RESET_CONTENT=205]="RESET_CONTENT",o[o.PARTIAL_CONTENT=206]="PARTIAL_CONTENT",o[o.AMBIGUOUS=300]="AMBIGUOUS",o[o.MOVED_PERMANENTLY=301]="MOVED_PERMANENTLY",o[o.FOUND=302]="FOUND",o[o.SEE_OTHER=303]="SEE_OTHER",o[o.NOT_MODIFIED=304]="NOT_MODIFIED",o[o.TEMPORARY_REDIRECT=307]="TEMPORARY_REDIRECT",o[o.PERMANENT_REDIRECT=308]="PERMANENT_REDIRECT",o[o.BAD_REQUEST=400]="BAD_REQUEST",o[o.UNAUTHORIZED=401]="UNAUTHORIZED",o[o.PAYMENT_REQUIRED=402]="PAYMENT_REQUIRED",o[o.FORBIDDEN=403]="FORBIDDEN",o[o.NOT_FOUND=404]="NOT_FOUND",o[o.METHOD_NOT_ALLOWED=405]="METHOD_NOT_ALLOWED",o[o.NOT_ACCEPTABLE=406]="NOT_ACCEPTABLE",o[o.PROXY_AUTHENTICATION_REQUIRED=407]="PROXY_AUTHENTICATION_REQUIRED",o[o.REQUEST_TIMEOUT=408]="REQUEST_TIMEOUT",o[o.CONFLICT=409]="CONFLICT",o[o.GONE=410]="GONE",o[o.LENGTH_REQUIRED=411]="LENGTH_REQUIRED",o[o.PRECONDITION_FAILED=412]="PRECONDITION_FAILED",o[o.PAYLOAD_TOO_LARGE=413]="PAYLOAD_TOO_LARGE",o[o.URI_TOO_LONG=414]="URI_TOO_LONG",o[o.UNSUPPORTED_MEDIA_TYPE=415]="UNSUPPORTED_MEDIA_TYPE",o[o.REQUESTED_RANGE_NOT_SATISFIABLE=416]="REQUESTED_RANGE_NOT_SATISFIABLE",o[o.EXPECTATION_FAILED=417]="EXPECTATION_FAILED",o[o.I_AM_A_TEAPOT=418]="I_AM_A_TEAPOT",o[o.MISDIRECTED_REQUEST=421]="MISDIRECTED_REQUEST",o[o.UNPROCESSABLE_ENTITY=422]="UNPROCESSABLE_ENTITY",o[o.LOCKED=423]="LOCKED",o[o.FAILED_DEPENDENCY=424]="FAILED_DEPENDENCY",o[o.TOO_EARLY=425]="TOO_EARLY",o[o.UPGRADE_REQUIRED=426]="UPGRADE_REQUIRED",o[o.PRECONDITION_REQUIRED=428]="PRECONDITION_REQUIRED",o[o.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",o[o.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",o[o.NOT_IMPLEMENTED=501]="NOT_IMPLEMENTED",o[o.BAD_GATEWAY=502]="BAD_GATEWAY",o[o.SERVICE_UNAVAILABLE=503]="SERVICE_UNAVAILABLE",o[o.GATEWAY_TIMEOUT=504]="GATEWAY_TIMEOUT",o[o.HTTP_VERSION_NOT_SUPPORTED=505]="HTTP_VERSION_NOT_SUPPORTED",o[o.VARIANT_ALSO_NEGOTIATES=506]="VARIANT_ALSO_NEGOTIATES",o[o.INSUFFICIENT_STORAGE=507]="INSUFFICIENT_STORAGE",o[o.LOOP_DETECTED=508]="LOOP_DETECTED",o[o.NOT_EXTENDED=510]="NOT_EXTENDED",o[o.NETWORK_AUTHENTICATION_REQUIRED=511]="NETWORK_AUTHENTICATION_REQUIRED"})(R||(R={}));var om={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};var D;(function(o){o.json="application/json",o.opra_response_json="application/opra.response+json",o.xml="application/XML",o.text="text/plain",o.html="text/html",o.markdown="text/markdown",o.binary="binary/octet-stream"})(D||(D={}));var Ei=class Ei extends v{constructor(){super(...arguments);p(this,"status",R.FORBIDDEN)}init(t){super.init({message:"You are not authorized to perform this action",code:"FORBIDDEN",...t})}};a(Ei,"ForbiddenError");var Nr=Ei;var _i=class _i extends v{constructor(){super(...arguments);p(this,"status",500)}init(t){super.init({message:"Internal server error",code:"INTERNAL_SERVER_ERROR",severity:"fatal",...t})}};a(_i,"InternalServerError");var Hs=_i;var xi=class xi extends v{constructor(){super(...arguments);p(this,"status",405)}init(t){super.init({message:"Method not allowed",code:"METHOD_NOT_ALLOWED",...t})}};a(xi,"MethodNotAllowedError");var ea=xi;var gi=class gi extends v{constructor(){super(...arguments);p(this,"status",406)}init(t){super.init({message:"Not Acceptable",code:"NOT_ACCEPTABLE",...t})}};a(gi,"NotAcceptableError");var ta=gi;var wi=class wi extends v{constructor(){super(...arguments);p(this,"status",404)}init(t){super.init({message:"Not found",code:"NOT_FOUND",...t})}};a(wi,"NotFoundError");var ra=wi;var Ai=class Ai extends Nr{init(e){super.init({message:"You dont have permission for this operation",code:"PERMISSION_ERROR",...e})}};a(Ai,"PermissionError");var ia=Ai;var Oi=class Oi extends v{constructor(t,r,i){super({message:`There is already an other "${t}" resource with same values for field(s) [${r}]`,severity:"error",code:"RESOURCE_CONFLICT",details:{resource:t,location:r}},i);p(this,"status",409)}};a(Oi,"ResourceConflictError");var oa=Oi;var Ri=class Ri extends v{constructor(e,t,r){super({message:`Resource "${e}${t?"/"+t:""}" is not available`,severity:"error",code:"RESOURCE_NOT_AVAILABLE",details:{resource:e,key:t}},r,R.UNPROCESSABLE_ENTITY)}};a(Ri,"ResourceNotAvailableError");var na=Ri;var bi=class bi extends v{constructor(){super(...arguments);p(this,"status",401)}init(t){super.init({message:"You don't have permission to perform this action",code:"UNAUTHORIZED",...t})}};a(bi,"UnauthorizedError");var sa=bi;var Di=class Di extends v{constructor(){super(...arguments);p(this,"status",422)}init(t){super.init({message:"Unprocessable entity",severity:"error",code:"UNPROCESSABLE_ENTITY",...t})}};a(Di,"UnprocessableEntityError");var aa=Di;var pa;(function(o){let e;(function(t){t.fatal="fatal",t.error="error",t.warning="warning",t.info="info"})(e=o.Enum||(o.Enum={})),o.name="IssueSeverity",o.description="Severity of the issue",o.Keys=Object.keys(o),o.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"}})(pa||(pa={}));BigInt.prototype.toJSON||(BigInt.prototype.toJSON=function(){return this.toString()});RegExp.prototype.toJSON||(RegExp.prototype.toJSON=function(){return this.toString()});import{isConstructor as up}from"@jsopen/objects";import dp from"putil-promisify";async function Z(o){return o=dp.isPromise(o)?await o:o,typeof o=="function"?up(o)?o:await o():o}a(Z,"resolveThunk");var ca=/^(?:file:\/\/)?(.+)$/;function uu(o=1){if(o>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+o+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");let e=Error.prepareStackTrace;Error.prepareStackTrace=(r,i)=>i;let t=new Error().stack;if(Error.prepareStackTrace=e,t!==null&&typeof t=="object"){let r=t[o]?t[o].getFileName():void 0,i=r?ca.exec(r):void 0;return i?i[1]:""}return""}a(uu,"getStackFileName");function du(o=1){if(o>=Error.stackTraceLimit)throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+o+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`");let e=Error.prepareStackTrace;Error.prepareStackTrace=(r,i)=>i;let t=new Error().stack;if(Error.prepareStackTrace=e,t!==null&&typeof t=="object"){let r=t[o]?t[o].getFileName():void 0,i=r?ca.exec(r):void 0;return i?i[1]:""}return""}a(du,"getErrorStack");function Sr(o,e,t){for(let r of Object.getOwnPropertyNames(e))r==="constructor"||r==="__proto__"||r==="toJSON"||r==="toString"||t&&!t(r)||Object.defineProperty(o,r,Object.getOwnPropertyDescriptor(e,r)||Object.create(null))}a(Sr,"mergePrototype");function Mr(o,e,t=r=>!0){try{let r=new e;Object.getOwnPropertyNames(r).filter(n=>typeof r[n]<"u"&&typeof o[n]>"u").filter(n=>t(n)).forEach(n=>{o[n]=r[n]})}catch{}}a(Mr,"inheritPropertyInitializers");import{isPlainObject as fa,merge as hp}from"@jsopen/objects";var y=Symbol.for("opra.type.metadata"),ae=Symbol("opra.http-controller.metadata"),pe=Symbol("opra.mq-controller.metadata"),ce=Symbol("opra.ws-controller.metadata"),Zt=Symbol("opra.ws-param.metadata"),_u=Symbol("opra.rpc-controller.metadata"),x=Symbol.for("opra.type.decoder"),g=Symbol("opra.type.encoder"),A=Symbol.for("DECORATOR"),Ke=Symbol.for("BUILTIN"),la=/([a-z$_]\w+):(.+)/i,F=/^[a-z][\w_]*$/i,L=Symbol.for("kDataTypeMap"),vr=Symbol.for("kCtorMap"),De=Symbol.for("kTypeNSMap");function k(o,e){return hp({},o,{deep:a(t=>fa(t)&&!t[y],"deep"),symbolKeys:!0,copyDescriptors:!0,ignoreUndefined:!0,filter(t,r){let i=r[t];return!e||typeof i!="function"&&(typeof i!="object"||fa(i)||Array.isArray(i))}})}a(k,"cloneObject");import{splitString as ma}from"fast-tokenizer";var yp=/^([+-])?([a-z_$]\w*)$/i,Tp=/[^.]\(/g,Ni=class Ni{};a(Ni,"FieldsProjection");var Ve=Ni;(function(o){let t=class t{constructor(){p(this,"sign");p(this,"projection")}};a(t,"Item");let e=t;o.Item=e})(Ve||(Ve={}));function ua(o,e){let t=Array.isArray(o)?o:[o];if(!(t&&t.length))return;let r=new Ve;for(let i of t)e||(i=i.toLowerCase()),da(i,r);return r}a(ua,"parseFieldsProjection");function da(o,e){o=o.replace(Tp,r=>r.charAt(0)+"."+r.substring(1));let t=ma(o,{delimiters:".",brackets:!0,keepBrackets:!1});for(let r=0;r<t.length;r++){let i=t[r];if(i.includes(",")){let l=ma(i,{delimiters:",",brackets:!0,keepBrackets:!0});for(let m of l)da(m,e);continue}let n=yp.exec(i);if(!n)throw new TypeError(`Invalid field path (${o})`);let s=n[2],c=e[s]=e[s]||new Ve.Item;n[1]&&(c.sign=n[1]),r===t.length-1?delete c.projection:e=c.projection=c.projection||new Ve}}a(da,"parse");function Ep(o){return o&&typeof o.forEach=="function"}a(Ep,"isMap");var Y=Symbol.for("kEntries"),le=Symbol.for("kKeyMap"),Ir=Symbol.for("kWellKnownKeys"),Si=Symbol.for("kOptions"),pt=Symbol.for("kSize"),Mi=class Mi{constructor(e,t){Object.defineProperty(this,pt,{value:0,enumerable:!1,writable:!0}),Object.defineProperty(this,Y,{value:{},enumerable:!1,writable:!0}),Object.defineProperty(this,le,{value:{},enumerable:!1,writable:!0}),Object.defineProperty(this,Ir,{value:{},enumerable:!1,writable:!0});let r=!!(t!=null&&t.caseSensitive);Object.defineProperty(this,Si,{value:{caseSensitive:r},enumerable:!1}),t!=null&&t.wellKnownKeys&&t.wellKnownKeys.forEach(i=>{r?this[Ir][i]=i:this[Ir][i.toLowerCase()]=i}),this.clear(),e&&this.setAll(e)}get size(){return this[pt]}clear(){Object.keys(this[Y]).forEach(e=>delete this[Y][e]),Object.keys(this[le]).forEach(e=>delete this[le][e]),this[pt]=0}forEach(e,t){for(let[r,i]of this.entries())e.call(t,i,r,this)}get(e){if(e)return this[Y][this._getStoringKey(e)]}has(e){return e?Object.prototype.hasOwnProperty.call(this[Y],this._getStoringKey(e)):!1}set(e,t){let r=this._getStoringKey(e);e=this._getOriginalKey(e);let i=Object.prototype.hasOwnProperty.call(this[Y],r);return this[Y][r]=t,i||this[pt]++,this[le][r]=e,this}setAll(e){return Ep(e)?e.forEach((t,r)=>this.set(r,t)):Object.keys(e).forEach(t=>this.set(t,e[t])),this}keys(){return Object.values(this[le])[Symbol.iterator]()}values(){return Object.values(this[Y])[Symbol.iterator]()}entries(){return Object.entries(this[Y])[Symbol.iterator]()}delete(e){let t=this._getStoringKey(e),r=Object.prototype.hasOwnProperty.call(this[Y],t);return delete this[Y][t],delete this[le][t],r||this[pt]--,r}sort(e){let t={...this[Y]},r={...this[le]},i=Array.from(this.keys());e?i.sort(e):i.sort(),this.clear();for(let n of i)this[Y][n]=t[n],this[le][n]=r[n];return this[pt]=i.length,this}toObject(){let e={};for(let[t,r]of Object.entries(this[le]))e[r]=this[Y][t];return e}[Symbol.iterator](){return this.entries()}get[Symbol.toStringTag](){return"[Object ResponsiveMap]"}_getOriginalKey(e){if(!e||this[Si].caseSensitive)return e;let t=this._getStoringKey(e);return this[le][t]??this[Ir][t]??e}_getStoringKey(e){return this[Si].caseSensitive?e:e.toLowerCase()}};a(Mi,"ResponsiveMap");var S=Mi;function Mu(o,e,t){let r=new WeakSet;return JSON.stringify(o,(i,n)=>{if(n!==null&&typeof n=="object"){if(r.has(n))return;r.add(n)}return e?e(i,n):n},t)}a(Mu,"safeJsonStringify");function vi(o){return o!==null&&typeof o=="object"&&typeof o.pipe=="function"}a(vi,"isStream");function Lu(o){return vi(o)&&typeof o._read=="function"&&typeof o._readableState=="object"}a(Lu,"isReadable");function ku(o){return vi(o)&&typeof o._write=="function"}a(ku,"isWritable");function Pu(o){return vi(o)&&typeof o.getReader=="function"&&typeof o.pipeThrough=="function"&&typeof o.pipeTo=="function"}a(Pu,"isReadableStream");function Fu(o){return o!==null&&typeof o=="object"&&typeof o.size=="number"&&typeof o.arrayBuffer=="function"&&typeof o.stream=="function"}a(Fu,"isBlob");function ju(o){return o!==null&&typeof o.constructor=="function"&&o.constructor.name==="FormData"&&typeof o.append=="function"&&typeof o.getAll=="function"}a(ju,"isFormData");function Cu(o){return o!==null&&typeof o=="object"&&typeof o.host=="string"&&typeof o.href=="string"}a(Cu,"isURL");var Ii=class Ii{constructor(){p(this,"kind");this.kind=Object.getPrototypeOf(this).constructor.name}};a(Ii,"Ast");var Ht=Ii;var Li=class Li extends Ht{};a(Li,"Expression");var q=Li;var ki=class ki extends q{};a(ki,"Term");var We=ki;var Pi=class Pi extends We{constructor(e){super(),this.value=e}toString(){return""+this.value}};a(Pi,"Literal");var P=Pi;var Fi=class Fi extends q{constructor(){super();p(this,"items",[])}append(t,r){return this.items.push(new Lr({op:t,expression:r})),this}toString(){return this.items.map((t,r)=>(r>0?t.op:"")+t.expression).join("")}};a(Fi,"ArithmeticExpression");var ze=Fi,ji=class ji{constructor(e){p(this,"op");p(this,"expression");Object.assign(this,e)}};a(ji,"ArithmeticExpressionItem");var Lr=ji;var Ci=class Ci extends We{constructor(t){super();p(this,"items");this.items=t}toString(){return"["+this.items.map(t=>""+t).join(",")+"]"}};a(Ci,"ArrayExpression");var ge=Ci;var _p=/\w/,Ui=class Ui extends q{constructor(t){super();p(this,"op");p(this,"left");p(this,"right");p(this,"prepare");Object.assign(this,t)}toString(){return`${this.left}${_p.test(this.op)?" "+this.op+" ":this.op}${this.right}`}};a(Ui,"ComparisonExpression");var fe=Ui;var $i=class $i extends q{constructor(t){super();p(this,"op");p(this,"items");Object.assign(this,t),this.op==="&&"&&(this.op="and"),this.op==="||"&&(this.op="or")}toString(){return this.items.map(t=>""+t).join(" "+this.op+" ")}};a($i,"LogicalExpression");var me=$i;var qi=class qi extends q{constructor(t){super();p(this,"expression");this.expression=t}toString(){return`(${this.expression})`}};a(qi,"NegativeExpression");var er=qi;var Bi=class Bi extends q{constructor(t){super();p(this,"expression");this.expression=t}toString(){return`(${this.expression})`}};a(Bi,"ParenthesizedExpression");var we=Bi;var Ki=class Ki extends P{constructor(e){super(e)}};a(Ki,"BooleanLiteral");var Je=Ki;import{toDateDef as Rp}from"putil-varhelpers";var Vi=class Vi extends TypeError{};a(Vi,"SyntaxError");var kr=Vi,Wi=class Wi extends TypeError{constructor(e){super(typeof e=="string"?e:e==null?void 0:e.message),typeof e=="object"&&Object.assign(this,e)}};a(Wi,"FilterValidationError");var ue=Wi,zi=class zi extends Error{constructor(e,t){super(e),Object.assign(this,t)}};a(zi,"FilterParseError");var Pr=zi;var xp=/'/g,gp=/(\\)/g,wp=/\\(.)/g;function Ap(o){return o.replace(gp,"\\\\")}a(Ap,"escapeString");function Op(o){return o.replace(wp,"$1")}a(Op,"unescapeString");function Ne(o){return"'"+Ap(o).replace(xp,"\\'")+"'"}a(Ne,"quoteFilterString");function tr(o){return o&&(o.startsWith("'")||o.startsWith('"'))&&o.endsWith(o.charAt(0))?Op(o.substring(1,o.length-1)):o}a(tr,"unquoteFilterString");var ha=new Date(0),Ji=class Ji extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=t.toISOString();return}if(typeof t=="string"&&Rp(t,ha)!==ha){this.value=t;return}throw new ue(`Invalid date value "${t}"`)}toString(){return Ne(this.value)}};a(Ji,"DateLiteral");var Se=Ji;import{toDateDef as bp}from"putil-varhelpers";var ya=new Date(0),Yi=class Yi extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=t.toISOString();return}if(typeof t=="string"&&bp(t,ya)!==ya){this.value=t;return}throw new ue(`Invalid date-time value "${t}"`)}toString(){return Ne(this.value)}};a(Yi,"DateTimeLiteral");var rr=Yi;var Qi=class Qi extends P{constructor(){super(null);p(this,"value",null)}};a(Qi,"NullLiteral");var Ye=Qi;var Gi=class Gi extends P{constructor(t){super(0);p(this,"value");if(typeof t=="number"||typeof t=="bigint"){this.value=t;return}try{if(typeof t=="string"){if(t.includes(".")){this.value=parseFloat(t);return}let r=Number(t);""+r===t?this.value=r:this.value=BigInt(t);return}}catch{}throw new ue(`Invalid number literal ${t}`)}toString(){return typeof this.value=="bigint"?(""+this.value).replace(/n$/,""):""+this.value}};a(Gi,"NumberLiteral");var Ae=Gi;var Xi=class Xi extends P{constructor(e){super(""+e)}};a(Xi,"QualifiedIdentifier");var H=Xi;var Zi=class Zi extends P{constructor(e){super(""+e)}toString(){return Ne(this.value)}};a(Zi,"StringLiteral");var Qe=Zi;var Dp=/^([01]\d|2[0-3]):([0-5]\d)(:[0-5]\d)?(\.(\d+))?$/,Hi=class Hi extends P{constructor(t){super("");p(this,"value");if(t instanceof Date){this.value=Fr(t.getHours())+":"+Fr(t.getMinutes())+(t.getSeconds()?":"+Fr(t.getSeconds()):"")+(t.getMilliseconds()?"."+Fr(t.getMilliseconds()):"");return}if(typeof t=="string"&&Dp.test(t)){this.value=t;return}throw new ue(`Invalid time value "${t}"`)}toString(){return Ne(this.value)}};a(Hi,"TimeLiteral");var Ge=Hi;function Fr(o){return o<=9?"0"+o:""+o}a(Fr,"pad");import{CharStream as Kp,CommonTokenStream as Vp}from"@browsery/antlr4";import{ATNDeserializer as Np,DFA as Sp,Lexer as Mp,LexerATNSimulator as vp,PredictionContextCache as Ip,Token as Lp}from"@browsery/antlr4";var h=class h extends Mp{constructor(e){super(e),this._interp=new vp(this,h._ATN,h.DecisionsToDFA,new Ip)}get grammarFileName(){return"OpraFilter.g4"}get literalNames(){return h.literalNames}get symbolicNames(){return h.symbolicNames}get ruleNames(){return h.ruleNames}get serializedATN(){return h._serializedATN}get channelNames(){return h.channelNames}get modeNames(){return h.modeNames}static get _ATN(){return h.__ATN||(h.__ATN=new Np().deserialize(h._serializedATN)),h.__ATN}};a(h,"OpraFilterLexer"),p(h,"T__0",1),p(h,"T__1",2),p(h,"T__2",3),p(h,"T__3",4),p(h,"T__4",5),p(h,"T__5",6),p(h,"T__6",7),p(h,"T__7",8),p(h,"T__8",9),p(h,"T__9",10),p(h,"T__10",11),p(h,"T__11",12),p(h,"T__12",13),p(h,"T__13",14),p(h,"T__14",15),p(h,"T__15",16),p(h,"T__16",17),p(h,"T__17",18),p(h,"T__18",19),p(h,"T__19",20),p(h,"T__20",21),p(h,"T__21",22),p(h,"T__22",23),p(h,"T__23",24),p(h,"T__24",25),p(h,"T__25",26),p(h,"T__26",27),p(h,"T__27",28),p(h,"T__28",29),p(h,"T__29",30),p(h,"T__30",31),p(h,"T__31",32),p(h,"T__32",33),p(h,"T__33",34),p(h,"IDENTIFIER",35),p(h,"POLAR_OP",36),p(h,"DATE",37),p(h,"DATETIME",38),p(h,"TIME",39),p(h,"NUMBER",40),p(h,"INTEGER",41),p(h,"STRING",42),p(h,"WHITESPACE",43),p(h,"EOF",Lp.EOF),p(h,"channelNames",["DEFAULT_TOKEN_CHANNEL","HIDDEN"]),p(h,"literalNames",[null,"'('","')'","'not'","'!'","'.'","'@'","'['","','","']'","'true'","'false'","'null'","'Infinity'","'infinity'","'+'","'-'","'*'","'/'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'and'","'or'","'&&'","'||'"]),p(h,"symbolicNames",[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"IDENTIFIER","POLAR_OP","DATE","DATETIME","TIME","NUMBER","INTEGER","STRING","WHITESPACE"]),p(h,"modeNames",["DEFAULT_MODE"]),p(h,"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","IDENTIFIER","POLAR_OP","DATE","DATETIME","TIME","NUMBER","INTEGER","STRING","WHITESPACE","DIGIT","DATEFORMAT","TIMEFORMAT","TIMEZONEOFFSETFORMAT","ESC","UNICODE","HEX"]),p(h,"_serializedATN",[4,0,43,461,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,1,0,1,0,1,1,1,1,1,2,1,2,1,2,1,2,1,3,1,3,1,4,1,4,1,5,1,5,1,6,1,6,1,7,1,7,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,20,1,20,1,21,1,21,1,21,1,22,1,22,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,31,1,31,1,31,1,32,1,32,1,32,1,33,1,33,1,33,1,34,1,34,5,34,225,8,34,10,34,12,34,228,9,34,1,35,1,35,1,36,1,36,1,36,1,36,1,36,1,36,1,36,1,36,3,36,240,8,36,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,3,37,291,8,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,3,38,301,8,38,1,39,3,39,304,8,39,1,39,4,39,307,8,39,11,39,12,39,308,1,39,1,39,5,39,313,8,39,10,39,12,39,316,9,39,3,39,318,8,39,1,39,1,39,3,39,322,8,39,1,39,4,39,325,8,39,11,39,12,39,326,3,39,329,8,39,1,39,1,39,1,39,1,39,4,39,335,8,39,11,39,12,39,336,3,39,339,8,39,1,40,3,40,342,8,40,1,40,4,40,345,8,40,11,40,12,40,346,1,40,1,40,1,40,1,40,4,40,353,8,40,11,40,12,40,354,3,40,357,8,40,1,41,1,41,1,41,5,41,362,8,41,10,41,12,41,365,9,41,1,41,1,41,1,41,1,41,5,41,371,8,41,10,41,12,41,374,9,41,1,41,3,41,377,8,41,1,42,4,42,380,8,42,11,42,12,42,381,1,42,1,42,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,397,8,44,1,44,1,44,1,44,1,44,1,44,1,44,1,44,3,44,406,8,44,1,45,1,45,1,45,1,45,3,45,412,8,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,1,45,4,45,424,8,45,11,45,12,45,425,3,45,428,8,45,3,45,430,8,45,1,46,1,46,1,46,3,46,435,8,46,1,46,1,46,1,46,3,46,440,8,46,1,46,1,46,1,46,3,46,445,8,46,3,46,447,8,46,1,47,1,47,1,47,3,47,452,8,47,1,48,1,48,1,48,1,48,1,48,1,48,1,49,1,49,0,0,50,1,1,3,2,5,3,7,4,9,5,11,6,13,7,15,8,17,9,19,10,21,11,23,12,25,13,27,14,29,15,31,16,33,17,35,18,37,19,39,20,41,21,43,22,45,23,47,24,49,25,51,26,53,27,55,28,57,29,59,30,61,31,63,32,65,33,67,34,69,35,71,36,73,37,75,38,77,39,79,40,81,41,83,42,85,43,87,0,89,0,91,0,93,0,95,0,97,0,99,0,1,0,16,4,0,36,36,65,90,95,95,97,122,5,0,36,36,48,57,65,90,95,95,97,122,2,0,43,43,45,45,1,0,39,39,1,0,34,34,3,0,9,10,13,13,32,32,1,0,48,57,1,0,48,48,1,0,49,57,1,0,49,49,1,0,48,50,1,0,49,51,1,0,48,49,1,0,48,51,1,0,48,53,3,0,48,57,65,70,97,102,491,0,1,1,0,0,0,0,3,1,0,0,0,0,5,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,1,101,1,0,0,0,3,103,1,0,0,0,5,105,1,0,0,0,7,109,1,0,0,0,9,111,1,0,0,0,11,113,1,0,0,0,13,115,1,0,0,0,15,117,1,0,0,0,17,119,1,0,0,0,19,121,1,0,0,0,21,126,1,0,0,0,23,132,1,0,0,0,25,137,1,0,0,0,27,146,1,0,0,0,29,155,1,0,0,0,31,157,1,0,0,0,33,159,1,0,0,0,35,161,1,0,0,0,37,163,1,0,0,0,39,166,1,0,0,0,41,168,1,0,0,0,43,170,1,0,0,0,45,173,1,0,0,0,47,175,1,0,0,0,49,178,1,0,0,0,51,181,1,0,0,0,53,185,1,0,0,0,55,190,1,0,0,0,57,196,1,0,0,0,59,202,1,0,0,0,61,209,1,0,0,0,63,213,1,0,0,0,65,216,1,0,0,0,67,219,1,0,0,0,69,222,1,0,0,0,71,229,1,0,0,0,73,239,1,0,0,0,75,290,1,0,0,0,77,300,1,0,0,0,79,338,1,0,0,0,81,356,1,0,0,0,83,376,1,0,0,0,85,379,1,0,0,0,87,385,1,0,0,0,89,387,1,0,0,0,91,411,1,0,0,0,93,446,1,0,0,0,95,448,1,0,0,0,97,453,1,0,0,0,99,459,1,0,0,0,101,102,5,40,0,0,102,2,1,0,0,0,103,104,5,41,0,0,104,4,1,0,0,0,105,106,5,110,0,0,106,107,5,111,0,0,107,108,5,116,0,0,108,6,1,0,0,0,109,110,5,33,0,0,110,8,1,0,0,0,111,112,5,46,0,0,112,10,1,0,0,0,113,114,5,64,0,0,114,12,1,0,0,0,115,116,5,91,0,0,116,14,1,0,0,0,117,118,5,44,0,0,118,16,1,0,0,0,119,120,5,93,0,0,120,18,1,0,0,0,121,122,5,116,0,0,122,123,5,114,0,0,123,124,5,117,0,0,124,125,5,101,0,0,125,20,1,0,0,0,126,127,5,102,0,0,127,128,5,97,0,0,128,129,5,108,0,0,129,130,5,115,0,0,130,131,5,101,0,0,131,22,1,0,0,0,132,133,5,110,0,0,133,134,5,117,0,0,134,135,5,108,0,0,135,136,5,108,0,0,136,24,1,0,0,0,137,138,5,73,0,0,138,139,5,110,0,0,139,140,5,102,0,0,140,141,5,105,0,0,141,142,5,110,0,0,142,143,5,105,0,0,143,144,5,116,0,0,144,145,5,121,0,0,145,26,1,0,0,0,146,147,5,105,0,0,147,148,5,110,0,0,148,149,5,102,0,0,149,150,5,105,0,0,150,151,5,110,0,0,151,152,5,105,0,0,152,153,5,116,0,0,153,154,5,121,0,0,154,28,1,0,0,0,155,156,5,43,0,0,156,30,1,0,0,0,157,158,5,45,0,0,158,32,1,0,0,0,159,160,5,42,0,0,160,34,1,0,0,0,161,162,5,47,0,0,162,36,1,0,0,0,163,164,5,60,0,0,164,165,5,61,0,0,165,38,1,0,0,0,166,167,5,60,0,0,167,40,1,0,0,0,168,169,5,62,0,0,169,42,1,0,0,0,170,171,5,62,0,0,171,172,5,61,0,0,172,44,1,0,0,0,173,174,5,61,0,0,174,46,1,0,0,0,175,176,5,33,0,0,176,177,5,61,0,0,177,48,1,0,0,0,178,179,5,105,0,0,179,180,5,110,0,0,180,50,1,0,0,0,181,182,5,33,0,0,182,183,5,105,0,0,183,184,5,110,0,0,184,52,1,0,0,0,185,186,5,108,0,0,186,187,5,105,0,0,187,188,5,107,0,0,188,189,5,101,0,0,189,54,1,0,0,0,190,191,5,33,0,0,191,192,5,108,0,0,192,193,5,105,0,0,193,194,5,107,0,0,194,195,5,101,0,0,195,56,1,0,0,0,196,197,5,105,0,0,197,198,5,108,0,0,198,199,5,105,0,0,199,200,5,107,0,0,200,201,5,101,0,0,201,58,1,0,0,0,202,203,5,33,0,0,203,204,5,105,0,0,204,205,5,108,0,0,205,206,5,105,0,0,206,207,5,107,0,0,207,208,5,101,0,0,208,60,1,0,0,0,209,210,5,97,0,0,210,211,5,110,0,0,211,212,5,100,0,0,212,62,1,0,0,0,213,214,5,111,0,0,214,215,5,114,0,0,215,64,1,0,0,0,216,217,5,38,0,0,217,218,5,38,0,0,218,66,1,0,0,0,219,220,5,124,0,0,220,221,5,124,0,0,221,68,1,0,0,0,222,226,7,0,0,0,223,225,7,1,0,0,224,223,1,0,0,0,225,228,1,0,0,0,226,224,1,0,0,0,226,227,1,0,0,0,227,70,1,0,0,0,228,226,1,0,0,0,229,230,7,2,0,0,230,72,1,0,0,0,231,232,5,39,0,0,232,233,3,89,44,0,233,234,5,39,0,0,234,240,1,0,0,0,235,236,5,34,0,0,236,237,3,89,44,0,237,238,5,34,0,0,238,240,1,0,0,0,239,231,1,0,0,0,239,235,1,0,0,0,240,74,1,0,0,0,241,242,5,39,0,0,242,243,3,89,44,0,243,244,5,84,0,0,244,245,3,91,45,0,245,246,3,93,46,0,246,247,5,39,0,0,247,248,5,39,0,0,248,249,3,89,44,0,249,250,5,32,0,0,250,251,3,91,45,0,251,252,3,93,46,0,252,253,5,39,0,0,253,254,5,39,0,0,254,255,3,89,44,0,255,256,5,84,0,0,256,257,3,91,45,0,257,258,5,39,0,0,258,259,5,39,0,0,259,260,3,89,44,0,260,261,5,32,0,0,261,262,3,91,45,0,262,263,5,39,0,0,263,291,1,0,0,0,264,265,5,34,0,0,265,266,3,89,44,0,266,267,5,84,0,0,267,268,3,91,45,0,268,269,3,93,46,0,269,270,5,34,0,0,270,291,1,0,0,0,271,272,5,34,0,0,272,273,3,89,44,0,273,274,5,32,0,0,274,275,3,91,45,0,275,276,3,93,46,0,276,277,5,34,0,0,277,291,1,0,0,0,278,279,5,34,0,0,279,280,3,89,44,0,280,281,5,84,0,0,281,282,3,91,45,0,282,283,5,34,0,0,283,291,1,0,0,0,284,285,5,34,0,0,285,286,3,89,44,0,286,287,5,32,0,0,287,288,3,91,45,0,288,289,5,34,0,0,289,291,1,0,0,0,290,241,1,0,0,0,290,264,1,0,0,0,290,271,1,0,0,0,290,278,1,0,0,0,290,284,1,0,0,0,291,76,1,0,0,0,292,293,5,39,0,0,293,294,3,91,45,0,294,295,5,39,0,0,295,301,1,0,0,0,296,297,5,34,0,0,297,298,3,91,45,0,298,299,5,34,0,0,299,301,1,0,0,0,300,292,1,0,0,0,300,296,1,0,0,0,301,78,1,0,0,0,302,304,3,71,35,0,303,302,1,0,0,0,303,304,1,0,0,0,304,306,1,0,0,0,305,307,3,87,43,0,306,305,1,0,0,0,307,308,1,0,0,0,308,306,1,0,0,0,308,309,1,0,0,0,309,317,1,0,0,0,310,314,5,46,0,0,311,313,3,87,43,0,312,311,1,0,0,0,313,316,1,0,0,0,314,312,1,0,0,0,314,315,1,0,0,0,315,318,1,0,0,0,316,314,1,0,0,0,317,310,1,0,0,0,317,318,1,0,0,0,318,328,1,0,0,0,319,321,5,69,0,0,320,322,7,2,0,0,321,320,1,0,0,0,321,322,1,0,0,0,322,324,1,0,0,0,323,325,3,87,43,0,324,323,1,0,0,0,325,326,1,0,0,0,326,324,1,0,0,0,326,327,1,0,0,0,327,329,1,0,0,0,328,319,1,0,0,0,328,329,1,0,0,0,329,339,1,0,0,0,330,331,5,48,0,0,331,332,5,120,0,0,332,334,1,0,0,0,333,335,3,99,49,0,334,333,1,0,0,0,335,336,1,0,0,0,336,334,1,0,0,0,336,337,1,0,0,0,337,339,1,0,0,0,338,303,1,0,0,0,338,330,1,0,0,0,339,80,1,0,0,0,340,342,3,71,35,0,341,340,1,0,0,0,341,342,1,0,0,0,342,344,1,0,0,0,343,345,3,87,43,0,344,343,1,0,0,0,345,346,1,0,0,0,346,344,1,0,0,0,346,347,1,0,0,0,347,357,1,0,0,0,348,349,5,48,0,0,349,350,5,120,0,0,350,352,1,0,0,0,351,353,3,99,49,0,352,351,1,0,0,0,353,354,1,0,0,0,354,352,1,0,0,0,354,355,1,0,0,0,355,357,1,0,0,0,356,341,1,0,0,0,356,348,1,0,0,0,357,82,1,0,0,0,358,363,5,39,0,0,359,362,3,95,47,0,360,362,8,3,0,0,361,359,1,0,0,0,361,360,1,0,0,0,362,365,1,0,0,0,363,361,1,0,0,0,363,364,1,0,0,0,364,366,1,0,0,0,365,363,1,0,0,0,366,377,5,39,0,0,367,372,5,34,0,0,368,371,3,95,47,0,369,371,8,4,0,0,370,368,1,0,0,0,370,369,1,0,0,0,371,374,1,0,0,0,372,370,1,0,0,0,372,373,1,0,0,0,373,375,1,0,0,0,374,372,1,0,0,0,375,377,5,34,0,0,376,358,1,0,0,0,376,367,1,0,0,0,377,84,1,0,0,0,378,380,7,5,0,0,379,378,1,0,0,0,380,381,1,0,0,0,381,379,1,0,0,0,381,382,1,0,0,0,382,383,1,0,0,0,383,384,6,42,0,0,384,86,1,0,0,0,385,386,7,6,0,0,386,88,1,0,0,0,387,388,7,6,0,0,388,389,7,6,0,0,389,390,7,6,0,0,390,391,7,6,0,0,391,396,5,45,0,0,392,393,7,7,0,0,393,397,7,8,0,0,394,395,7,9,0,0,395,397,7,10,0,0,396,392,1,0,0,0,396,394,1,0,0,0,397,398,1,0,0,0,398,405,5,45,0,0,399,400,7,11,0,0,400,406,7,7,0,0,401,402,7,10,0,0,402,406,7,8,0,0,403,404,5,51,0,0,404,406,5,49,0,0,405,399,1,0,0,0,405,401,1,0,0,0,405,403,1,0,0,0,406,90,1,0,0,0,407,408,7,12,0,0,408,412,7,6,0,0,409,410,5,50,0,0,410,412,7,13,0,0,411,407,1,0,0,0,411,409,1,0,0,0,412,413,1,0,0,0,413,414,5,58,0,0,414,415,7,14,0,0,415,416,7,6,0,0,416,429,1,0,0,0,417,418,5,58,0,0,418,419,7,14,0,0,419,420,7,6,0,0,420,427,1,0,0,0,421,423,5,46,0,0,422,424,7,6,0,0,423,422,1,0,0,0,424,425,1,0,0,0,425,423,1,0,0,0,425,426,1,0,0,0,426,428,1,0,0,0,427,421,1,0,0,0,427,428,1,0,0,0,428,430,1,0,0,0,429,417,1,0,0,0,429,430,1,0,0,0,430,92,1,0,0,0,431,447,5,90,0,0,432,439,7,2,0,0,433,435,7,12,0,0,434,433,1,0,0,0,434,435,1,0,0,0,435,436,1,0,0,0,436,440,7,6,0,0,437,438,5,50,0,0,438,440,7,13,0,0,439,434,1,0,0,0,439,437,1,0,0,0,440,444,1,0,0,0,441,442,5,58,0,0,442,443,7,14,0,0,443,445,7,6,0,0,444,441,1,0,0,0,444,445,1,0,0,0,445,447,1,0,0,0,446,431,1,0,0,0,446,432,1,0,0,0,447,94,1,0,0,0,448,451,5,92,0,0,449,452,3,97,48,0,450,452,9,0,0,0,451,449,1,0,0,0,451,450,1,0,0,0,452,96,1,0,0,0,453,454,5,117,0,0,454,455,3,99,49,0,455,456,3,99,49,0,456,457,3,99,49,0,457,458,3,99,49,0,458,98,1,0,0,0,459,460,7,15,0,0,460,100,1,0,0,0,35,0,226,239,290,300,303,308,314,317,321,326,328,336,338,341,346,354,356,361,363,370,372,376,381,396,405,411,425,427,429,434,439,444,446,451,1,0,1,0]),p(h,"__ATN"),p(h,"DecisionsToDFA",h._ATN.decisionToState.map((e,t)=>new Sp(e,t)));var ir=h;import{ATN as Ta,ATNDeserializer as kp,DFA as Pp,FailedPredicateException as Fp,NoViableAltException as eo,Parser as jp,ParserATNSimulator as Cp,ParserRuleContext as K,PredictionContextCache as Up,RecognitionException as B,Token as $p}from"@browsery/antlr4";var f=class f extends jp{get grammarFileName(){return"OpraFilter.g4"}get literalNames(){return f.literalNames}get symbolicNames(){return f.symbolicNames}get ruleNames(){return f.ruleNames}get serializedATN(){return f._serializedATN}createFailedPredicateException(e,t){return new Fp(this,e,t)}constructor(e){super(e),this._interp=new Cp(this,f._ATN,f.DecisionsToDFA,new Up)}root(){let e=new to(this,this._ctx,this.state);this.enterRule(e,0,f.RULE_root);try{this.enterOuterAlt(e,1),this.state=34,this.expression(0),this.state=35,this.match(f.EOF)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}expression(e){e===void 0&&(e=0);let t=this._ctx,r=this.state,i=new X(this,this._ctx,r),n=i,s=2;this.enterRecursionRule(i,2,f.RULE_expression,e);let c;try{let l;this.enterOuterAlt(i,1);{switch(this.state=48,this._errHandler.sync(this),this._input.LA(1)){case 35:i=new oo(this,i),this._ctx=i,n=i,this.state=38,i._left=this.comparisonLeft(),this.state=39,i._operator=this.comparisonOperator(),this.state=40,i._right=this.comparisonRight();break;case 1:i=new ro(this,i),this._ctx=i,n=i,this.state=42,this.match(f.T__0),this.state=43,this.parenthesizedItem(),this.state=44,this.match(f.T__1);break;case 3:case 4:i=new io(this,i),this._ctx=i,n=i,this.state=46,c=this._input.LA(1),c===3||c===4?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this),this.state=47,this.expression(1);break;default:throw new eo(this)}for(this._ctx.stop=this._input.LT(-1),this.state=56,this._errHandler.sync(this),l=this._interp.adaptivePredict(this._input,1,this._ctx);l!==2&&l!==Ta.INVALID_ALT_NUMBER;){if(l===1){this._parseListeners!=null&&this.triggerExitRuleEvent(),n=i;{if(i=new or(this,new X(this,t,r)),this.pushNewRecursionContext(i,s,f.RULE_expression),this.state=50,!this.precpred(this._ctx,3))throw this.createFailedPredicateException("this.precpred(this._ctx, 3)");this.state=51,i._op=this.logicalOperator(),this.state=52,this.expression(4)}}this.state=58,this._errHandler.sync(this),l=this._interp.adaptivePredict(this._input,1,this._ctx)}}}catch(l){if(l instanceof B)i.exception=l,this._errHandler.reportError(this,l),this._errHandler.recover(this,l);else throw l}finally{this.unrollRecursionContexts(t)}return i}comparisonLeft(){let e=new jr(this,this._ctx,this.state);this.enterRule(e,4,f.RULE_comparisonLeft);try{this.enterOuterAlt(e,1),this.state=59,this.qualifiedIdentifier()}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}comparisonRight(){let e=new Cr(this,this._ctx,this.state);this.enterRule(e,6,f.RULE_comparisonRight);try{switch(this.state=65,this._errHandler.sync(this),this._input.LA(1)){case 10:case 11:case 12:case 13:case 14:case 37:case 38:case 39:case 40:case 42:this.enterOuterAlt(e,1),this.state=61,this.value();break;case 35:this.enterOuterAlt(e,2),this.state=62,this.qualifiedIdentifier();break;case 6:this.enterOuterAlt(e,3),this.state=63,this.externalConstant();break;case 7:this.enterOuterAlt(e,4),this.state=64,this.arrayValue();break;default:throw new eo(this)}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}parenthesizedItem(){let e=new Ur(this,this._ctx,this.state);this.enterRule(e,8,f.RULE_parenthesizedItem);try{this.enterOuterAlt(e,1),this.state=67,this.expression(0)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}value(){let e=new Q(this,this._ctx,this.state);this.enterRule(e,10,f.RULE_value);try{switch(this.state=77,this._errHandler.sync(this),this._input.LA(1)){case 40:e=new mo(this,e),this.enterOuterAlt(e,1),this.state=69,this.match(f.NUMBER);break;case 13:case 14:e=new lo(this,e),this.enterOuterAlt(e,2),this.state=70,this.infinity();break;case 10:case 11:e=new fo(this,e),this.enterOuterAlt(e,3),this.state=71,this.boolean_();break;case 12:e=new so(this,e),this.enterOuterAlt(e,4),this.state=72,this.null_();break;case 38:e=new ao(this,e),this.enterOuterAlt(e,5),this.state=73,this.match(f.DATETIME);break;case 37:e=new co(this,e),this.enterOuterAlt(e,6),this.state=74,this.match(f.DATE);break;case 39:e=new no(this,e),this.enterOuterAlt(e,7),this.state=75,this.match(f.TIME);break;case 42:e=new po(this,e),this.enterOuterAlt(e,8),this.state=76,this.match(f.STRING);break;default:throw new eo(this)}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}qualifiedIdentifier(){let e=new nr(this,this._ctx,this.state);this.enterRule(e,12,f.RULE_qualifiedIdentifier);try{let t;this.enterOuterAlt(e,1);{for(this.state=84,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,4,this._ctx);t!==2&&t!==Ta.INVALID_ALT_NUMBER;)t===1&&(this.state=79,this.identifier(),this.state=80,this.match(f.T__4)),this.state=86,this._errHandler.sync(this),t=this._interp.adaptivePredict(this._input,4,this._ctx);this.state=87,this.identifier()}}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}externalConstant(){let e=new $r(this,this._ctx,this.state);this.enterRule(e,14,f.RULE_externalConstant);try{this.enterOuterAlt(e,1),this.state=89,this.match(f.T__5),this.state=90,this.identifier()}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}identifier(){let e=new ct(this,this._ctx,this.state);this.enterRule(e,16,f.RULE_identifier);try{this.enterOuterAlt(e,1),this.state=92,this.match(f.IDENTIFIER)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}arrayValue(){let e=new qr(this,this._ctx,this.state);this.enterRule(e,18,f.RULE_arrayValue);let t;try{this.enterOuterAlt(e,1);{for(this.state=94,this.match(f.T__6),this.state=95,this.value(),this.state=100,this._errHandler.sync(this),t=this._input.LA(1);t===8;)this.state=96,this.match(f.T__7),this.state=97,this.value(),this.state=102,this._errHandler.sync(this),t=this._input.LA(1);this.state=103,this.match(f.T__8)}}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}boolean_(){let e=new Br(this,this._ctx,this.state);this.enterRule(e,20,f.RULE_boolean);let t;try{this.enterOuterAlt(e,1),this.state=105,t=this._input.LA(1),t===10||t===11?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}null_(){let e=new Kr(this,this._ctx,this.state);this.enterRule(e,22,f.RULE_null);try{this.enterOuterAlt(e,1),this.state=107,this.match(f.T__11)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}infinity(){let e=new Vr(this,this._ctx,this.state);this.enterRule(e,24,f.RULE_infinity);let t;try{this.enterOuterAlt(e,1),this.state=109,t=this._input.LA(1),t===13||t===14?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}arithmeticOperator(){let e=new uo(this,this._ctx,this.state);this.enterRule(e,26,f.RULE_arithmeticOperator);let t;try{this.enterOuterAlt(e,1),this.state=111,t=this._input.LA(1),(t&-32)===0&&(1<<t&491520)!==0?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}comparisonOperator(){let e=new Wr(this,this._ctx,this.state);this.enterRule(e,28,f.RULE_comparisonOperator);let t;try{this.enterOuterAlt(e,1),this.state=113,t=this._input.LA(1),(t&-32)===0&&(1<<t&2146959360)!==0?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}logicalOperator(){let e=new zr(this,this._ctx,this.state);this.enterRule(e,30,f.RULE_logicalOperator);let t;try{this.enterOuterAlt(e,1),this.state=115,t=this._input.LA(1),(t-31&-32)===0&&(1<<t-31&15)!==0?(this._errHandler.reportMatch(this),this.consume()):this._errHandler.recoverInline(this)}catch(r){if(r instanceof B)e.exception=r,this._errHandler.reportError(this,r),this._errHandler.recover(this,r);else throw r}finally{this.exitRule()}return e}polarityOperator(){let e=new ho(this,this._ctx,this.state);this.enterRule(e,32,f.RULE_polarityOperator);try{this.enterOuterAlt(e,1),this.state=117,this.match(f.POLAR_OP)}catch(t){if(t instanceof B)e.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t);else throw t}finally{this.exitRule()}return e}sempred(e,t,r){return t===1?this.expression_sempred(e,r):!0}expression_sempred(e,t){return t===0?this.precpred(this._ctx,3):!0}static get _ATN(){return f.__ATN||(f.__ATN=new kp().deserialize(f._serializedATN)),f.__ATN}};a(f,"OpraFilterParser"),p(f,"T__0",1),p(f,"T__1",2),p(f,"T__2",3),p(f,"T__3",4),p(f,"T__4",5),p(f,"T__5",6),p(f,"T__6",7),p(f,"T__7",8),p(f,"T__8",9),p(f,"T__9",10),p(f,"T__10",11),p(f,"T__11",12),p(f,"T__12",13),p(f,"T__13",14),p(f,"T__14",15),p(f,"T__15",16),p(f,"T__16",17),p(f,"T__17",18),p(f,"T__18",19),p(f,"T__19",20),p(f,"T__20",21),p(f,"T__21",22),p(f,"T__22",23),p(f,"T__23",24),p(f,"T__24",25),p(f,"T__25",26),p(f,"T__26",27),p(f,"T__27",28),p(f,"T__28",29),p(f,"T__29",30),p(f,"T__30",31),p(f,"T__31",32),p(f,"T__32",33),p(f,"T__33",34),p(f,"IDENTIFIER",35),p(f,"POLAR_OP",36),p(f,"DATE",37),p(f,"DATETIME",38),p(f,"TIME",39),p(f,"NUMBER",40),p(f,"INTEGER",41),p(f,"STRING",42),p(f,"WHITESPACE",43),p(f,"EOF",$p.EOF),p(f,"RULE_root",0),p(f,"RULE_expression",1),p(f,"RULE_comparisonLeft",2),p(f,"RULE_comparisonRight",3),p(f,"RULE_parenthesizedItem",4),p(f,"RULE_value",5),p(f,"RULE_qualifiedIdentifier",6),p(f,"RULE_externalConstant",7),p(f,"RULE_identifier",8),p(f,"RULE_arrayValue",9),p(f,"RULE_boolean",10),p(f,"RULE_null",11),p(f,"RULE_infinity",12),p(f,"RULE_arithmeticOperator",13),p(f,"RULE_comparisonOperator",14),p(f,"RULE_logicalOperator",15),p(f,"RULE_polarityOperator",16),p(f,"literalNames",[null,"'('","')'","'not'","'!'","'.'","'@'","'['","','","']'","'true'","'false'","'null'","'Infinity'","'infinity'","'+'","'-'","'*'","'/'","'<='","'<'","'>'","'>='","'='","'!='","'in'","'!in'","'like'","'!like'","'ilike'","'!ilike'","'and'","'or'","'&&'","'||'"]),p(f,"symbolicNames",[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"IDENTIFIER","POLAR_OP","DATE","DATETIME","TIME","NUMBER","INTEGER","STRING","WHITESPACE"]),p(f,"ruleNames",["root","expression","comparisonLeft","comparisonRight","parenthesizedItem","value","qualifiedIdentifier","externalConstant","identifier","arrayValue","boolean","null","infinity","arithmeticOperator","comparisonOperator","logicalOperator","polarityOperator"]),p(f,"_serializedATN",[4,1,43,120,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,49,8,1,1,1,1,1,1,1,1,1,5,1,55,8,1,10,1,12,1,58,9,1,1,2,1,2,1,3,1,3,1,3,1,3,3,3,66,8,3,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,3,5,78,8,5,1,6,1,6,1,6,5,6,83,8,6,10,6,12,6,86,9,6,1,6,1,6,1,7,1,7,1,7,1,8,1,8,1,9,1,9,1,9,1,9,5,9,99,8,9,10,9,12,9,102,9,9,1,9,1,9,1,10,1,10,1,11,1,11,1,12,1,12,1,13,1,13,1,14,1,14,1,15,1,15,1,16,1,16,1,16,0,1,2,17,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,0,6,1,0,3,4,1,0,10,11,1,0,13,14,1,0,15,18,1,0,19,30,1,0,31,34,117,0,34,1,0,0,0,2,48,1,0,0,0,4,59,1,0,0,0,6,65,1,0,0,0,8,67,1,0,0,0,10,77,1,0,0,0,12,84,1,0,0,0,14,89,1,0,0,0,16,92,1,0,0,0,18,94,1,0,0,0,20,105,1,0,0,0,22,107,1,0,0,0,24,109,1,0,0,0,26,111,1,0,0,0,28,113,1,0,0,0,30,115,1,0,0,0,32,117,1,0,0,0,34,35,3,2,1,0,35,36,5,0,0,1,36,1,1,0,0,0,37,38,6,1,-1,0,38,39,3,4,2,0,39,40,3,28,14,0,40,41,3,6,3,0,41,49,1,0,0,0,42,43,5,1,0,0,43,44,3,8,4,0,44,45,5,2,0,0,45,49,1,0,0,0,46,47,7,0,0,0,47,49,3,2,1,1,48,37,1,0,0,0,48,42,1,0,0,0,48,46,1,0,0,0,49,56,1,0,0,0,50,51,10,3,0,0,51,52,3,30,15,0,52,53,3,2,1,4,53,55,1,0,0,0,54,50,1,0,0,0,55,58,1,0,0,0,56,54,1,0,0,0,56,57,1,0,0,0,57,3,1,0,0,0,58,56,1,0,0,0,59,60,3,12,6,0,60,5,1,0,0,0,61,66,3,10,5,0,62,66,3,12,6,0,63,66,3,14,7,0,64,66,3,18,9,0,65,61,1,0,0,0,65,62,1,0,0,0,65,63,1,0,0,0,65,64,1,0,0,0,66,7,1,0,0,0,67,68,3,2,1,0,68,9,1,0,0,0,69,78,5,40,0,0,70,78,3,24,12,0,71,78,3,20,10,0,72,78,3,22,11,0,73,78,5,38,0,0,74,78,5,37,0,0,75,78,5,39,0,0,76,78,5,42,0,0,77,69,1,0,0,0,77,70,1,0,0,0,77,71,1,0,0,0,77,72,1,0,0,0,77,73,1,0,0,0,77,74,1,0,0,0,77,75,1,0,0,0,77,76,1,0,0,0,78,11,1,0,0,0,79,80,3,16,8,0,80,81,5,5,0,0,81,83,1,0,0,0,82,79,1,0,0,0,83,86,1,0,0,0,84,82,1,0,0,0,84,85,1,0,0,0,85,87,1,0,0,0,86,84,1,0,0,0,87,88,3,16,8,0,88,13,1,0,0,0,89,90,5,6,0,0,90,91,3,16,8,0,91,15,1,0,0,0,92,93,5,35,0,0,93,17,1,0,0,0,94,95,5,7,0,0,95,100,3,10,5,0,96,97,5,8,0,0,97,99,3,10,5,0,98,96,1,0,0,0,99,102,1,0,0,0,100,98,1,0,0,0,100,101,1,0,0,0,101,103,1,0,0,0,102,100,1,0,0,0,103,104,5,9,0,0,104,19,1,0,0,0,105,106,7,1,0,0,106,21,1,0,0,0,107,108,5,12,0,0,108,23,1,0,0,0,109,110,7,2,0,0,110,25,1,0,0,0,111,112,7,3,0,0,112,27,1,0,0,0,113,114,7,4,0,0,114,29,1,0,0,0,115,116,7,5,0,0,116,31,1,0,0,0,117,118,5,36,0,0,118,33,1,0,0,0,6,48,56,65,77,84,100]),p(f,"__ATN"),p(f,"DecisionsToDFA",f._ATN.decisionToState.map((e,t)=>new Pp(e,t)));var N=f,yo=class yo extends K{constructor(e,t,r){super(t,r),this.parser=e}expression(){return this.getTypedRuleContext(X,0)}EOF(){return this.getToken(N.EOF,0)}get ruleIndex(){return N.RULE_root}enterRule(e){e.enterRoot&&e.enterRoot(this)}exitRule(e){e.exitRoot&&e.exitRoot(this)}accept(e){return e.visitRoot?e.visitRoot(this):e.visitChildren(this)}};a(yo,"RootContext");var to=yo,To=class To extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_expression}copyFrom(e){super.copyFrom(e)}};a(To,"ExpressionContext");var X=To,Eo=class Eo extends X{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}parenthesizedItem(){return this.getTypedRuleContext(Ur,0)}enterRule(e){e.enterParenthesizedExpression&&e.enterParenthesizedExpression(this)}exitRule(e){e.exitParenthesizedExpression&&e.exitParenthesizedExpression(this)}accept(e){return e.visitParenthesizedExpression?e.visitParenthesizedExpression(this):e.visitChildren(this)}};a(Eo,"ParenthesizedExpressionContext");var ro=Eo,_o=class _o extends X{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}expression(){return this.getTypedRuleContext(X,0)}enterRule(e){e.enterNegativeExpression&&e.enterNegativeExpression(this)}exitRule(e){e.exitNegativeExpression&&e.exitNegativeExpression(this)}accept(e){return e.visitNegativeExpression?e.visitNegativeExpression(this):e.visitChildren(this)}};a(_o,"NegativeExpressionContext");var io=_o,xo=class xo extends X{constructor(t,r){super(t,r.parentCtx,r.invokingState);p(this,"_left");p(this,"_operator");p(this,"_right");super.copyFrom(r)}comparisonLeft(){return this.getTypedRuleContext(jr,0)}comparisonOperator(){return this.getTypedRuleContext(Wr,0)}comparisonRight(){return this.getTypedRuleContext(Cr,0)}enterRule(t){t.enterComparisonExpression&&t.enterComparisonExpression(this)}exitRule(t){t.exitComparisonExpression&&t.exitComparisonExpression(this)}accept(t){return t.visitComparisonExpression?t.visitComparisonExpression(this):t.visitChildren(this)}};a(xo,"ComparisonExpressionContext");var oo=xo,go=class go extends X{constructor(t,r){super(t,r.parentCtx,r.invokingState);p(this,"_op");super.copyFrom(r)}expression_list(){return this.getTypedRuleContexts(X)}expression(t){return this.getTypedRuleContext(X,t)}logicalOperator(){return this.getTypedRuleContext(zr,0)}enterRule(t){t.enterLogicalExpression&&t.enterLogicalExpression(this)}exitRule(t){t.exitLogicalExpression&&t.exitLogicalExpression(this)}accept(t){return t.visitLogicalExpression?t.visitLogicalExpression(this):t.visitChildren(this)}};a(go,"LogicalExpressionContext");var or=go,wo=class wo extends K{constructor(e,t,r){super(t,r),this.parser=e}qualifiedIdentifier(){return this.getTypedRuleContext(nr,0)}get ruleIndex(){return N.RULE_comparisonLeft}enterRule(e){e.enterComparisonLeft&&e.enterComparisonLeft(this)}exitRule(e){e.exitComparisonLeft&&e.exitComparisonLeft(this)}accept(e){return e.visitComparisonLeft?e.visitComparisonLeft(this):e.visitChildren(this)}};a(wo,"ComparisonLeftContext");var jr=wo,Ao=class Ao extends K{constructor(e,t,r){super(t,r),this.parser=e}value(){return this.getTypedRuleContext(Q,0)}qualifiedIdentifier(){return this.getTypedRuleContext(nr,0)}externalConstant(){return this.getTypedRuleContext($r,0)}arrayValue(){return this.getTypedRuleContext(qr,0)}get ruleIndex(){return N.RULE_comparisonRight}enterRule(e){e.enterComparisonRight&&e.enterComparisonRight(this)}exitRule(e){e.exitComparisonRight&&e.exitComparisonRight(this)}accept(e){return e.visitComparisonRight?e.visitComparisonRight(this):e.visitChildren(this)}};a(Ao,"ComparisonRightContext");var Cr=Ao,Oo=class Oo extends K{constructor(e,t,r){super(t,r),this.parser=e}expression(){return this.getTypedRuleContext(X,0)}get ruleIndex(){return N.RULE_parenthesizedItem}enterRule(e){e.enterParenthesizedItem&&e.enterParenthesizedItem(this)}exitRule(e){e.exitParenthesizedItem&&e.exitParenthesizedItem(this)}accept(e){return e.visitParenthesizedItem?e.visitParenthesizedItem(this):e.visitChildren(this)}};a(Oo,"ParenthesizedItemContext");var Ur=Oo,Ro=class Ro extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_value}copyFrom(e){super.copyFrom(e)}};a(Ro,"ValueContext");var Q=Ro,bo=class bo extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}TIME(){return this.getToken(N.TIME,0)}enterRule(e){e.enterTimeLiteral&&e.enterTimeLiteral(this)}exitRule(e){e.exitTimeLiteral&&e.exitTimeLiteral(this)}accept(e){return e.visitTimeLiteral?e.visitTimeLiteral(this):e.visitChildren(this)}};a(bo,"TimeLiteralContext");var no=bo,Do=class Do extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}null_(){return this.getTypedRuleContext(Kr,0)}enterRule(e){e.enterNullLiteral&&e.enterNullLiteral(this)}exitRule(e){e.exitNullLiteral&&e.exitNullLiteral(this)}accept(e){return e.visitNullLiteral?e.visitNullLiteral(this):e.visitChildren(this)}};a(Do,"NullLiteralContext");var so=Do,No=class No extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}DATETIME(){return this.getToken(N.DATETIME,0)}enterRule(e){e.enterDateTimeLiteral&&e.enterDateTimeLiteral(this)}exitRule(e){e.exitDateTimeLiteral&&e.exitDateTimeLiteral(this)}accept(e){return e.visitDateTimeLiteral?e.visitDateTimeLiteral(this):e.visitChildren(this)}};a(No,"DateTimeLiteralContext");var ao=No,So=class So extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}STRING(){return this.getToken(N.STRING,0)}enterRule(e){e.enterStringLiteral&&e.enterStringLiteral(this)}exitRule(e){e.exitStringLiteral&&e.exitStringLiteral(this)}accept(e){return e.visitStringLiteral?e.visitStringLiteral(this):e.visitChildren(this)}};a(So,"StringLiteralContext");var po=So,Mo=class Mo extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}DATE(){return this.getToken(N.DATE,0)}enterRule(e){e.enterDateLiteral&&e.enterDateLiteral(this)}exitRule(e){e.exitDateLiteral&&e.exitDateLiteral(this)}accept(e){return e.visitDateLiteral?e.visitDateLiteral(this):e.visitChildren(this)}};a(Mo,"DateLiteralContext");var co=Mo,vo=class vo extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}infinity(){return this.getTypedRuleContext(Vr,0)}enterRule(e){e.enterInfinityLiteral&&e.enterInfinityLiteral(this)}exitRule(e){e.exitInfinityLiteral&&e.exitInfinityLiteral(this)}accept(e){return e.visitInfinityLiteral?e.visitInfinityLiteral(this):e.visitChildren(this)}};a(vo,"InfinityLiteralContext");var lo=vo,Io=class Io extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}boolean_(){return this.getTypedRuleContext(Br,0)}enterRule(e){e.enterBooleanLiteral&&e.enterBooleanLiteral(this)}exitRule(e){e.exitBooleanLiteral&&e.exitBooleanLiteral(this)}accept(e){return e.visitBooleanLiteral?e.visitBooleanLiteral(this):e.visitChildren(this)}};a(Io,"BooleanLiteralContext");var fo=Io,Lo=class Lo extends Q{constructor(e,t){super(e,t.parentCtx,t.invokingState),super.copyFrom(t)}NUMBER(){return this.getToken(N.NUMBER,0)}enterRule(e){e.enterNumberLiteral&&e.enterNumberLiteral(this)}exitRule(e){e.exitNumberLiteral&&e.exitNumberLiteral(this)}accept(e){return e.visitNumberLiteral?e.visitNumberLiteral(this):e.visitChildren(this)}};a(Lo,"NumberLiteralContext");var mo=Lo,ko=class ko extends K{constructor(e,t,r){super(t,r),this.parser=e}identifier_list(){return this.getTypedRuleContexts(ct)}identifier(e){return this.getTypedRuleContext(ct,e)}get ruleIndex(){return N.RULE_qualifiedIdentifier}enterRule(e){e.enterQualifiedIdentifier&&e.enterQualifiedIdentifier(this)}exitRule(e){e.exitQualifiedIdentifier&&e.exitQualifiedIdentifier(this)}accept(e){return e.visitQualifiedIdentifier?e.visitQualifiedIdentifier(this):e.visitChildren(this)}};a(ko,"QualifiedIdentifierContext");var nr=ko,Po=class Po extends K{constructor(e,t,r){super(t,r),this.parser=e}identifier(){return this.getTypedRuleContext(ct,0)}get ruleIndex(){return N.RULE_externalConstant}enterRule(e){e.enterExternalConstant&&e.enterExternalConstant(this)}exitRule(e){e.exitExternalConstant&&e.exitExternalConstant(this)}accept(e){return e.visitExternalConstant?e.visitExternalConstant(this):e.visitChildren(this)}};a(Po,"ExternalConstantContext");var $r=Po,Fo=class Fo extends K{constructor(e,t,r){super(t,r),this.parser=e}IDENTIFIER(){return this.getToken(N.IDENTIFIER,0)}get ruleIndex(){return N.RULE_identifier}enterRule(e){e.enterIdentifier&&e.enterIdentifier(this)}exitRule(e){e.exitIdentifier&&e.exitIdentifier(this)}accept(e){return e.visitIdentifier?e.visitIdentifier(this):e.visitChildren(this)}};a(Fo,"IdentifierContext");var ct=Fo,jo=class jo extends K{constructor(e,t,r){super(t,r),this.parser=e}value_list(){return this.getTypedRuleContexts(Q)}value(e){return this.getTypedRuleContext(Q,e)}get ruleIndex(){return N.RULE_arrayValue}enterRule(e){e.enterArrayValue&&e.enterArrayValue(this)}exitRule(e){e.exitArrayValue&&e.exitArrayValue(this)}accept(e){return e.visitArrayValue?e.visitArrayValue(this):e.visitChildren(this)}};a(jo,"ArrayValueContext");var qr=jo,Co=class Co extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_boolean}enterRule(e){e.enterBoolean&&e.enterBoolean(this)}exitRule(e){e.exitBoolean&&e.exitBoolean(this)}accept(e){return e.visitBoolean?e.visitBoolean(this):e.visitChildren(this)}};a(Co,"BooleanContext");var Br=Co,Uo=class Uo extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_null}enterRule(e){e.enterNull&&e.enterNull(this)}exitRule(e){e.exitNull&&e.exitNull(this)}accept(e){return e.visitNull?e.visitNull(this):e.visitChildren(this)}};a(Uo,"NullContext");var Kr=Uo,$o=class $o extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_infinity}enterRule(e){e.enterInfinity&&e.enterInfinity(this)}exitRule(e){e.exitInfinity&&e.exitInfinity(this)}accept(e){return e.visitInfinity?e.visitInfinity(this):e.visitChildren(this)}};a($o,"InfinityContext");var Vr=$o,qo=class qo extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_arithmeticOperator}enterRule(e){e.enterArithmeticOperator&&e.enterArithmeticOperator(this)}exitRule(e){e.exitArithmeticOperator&&e.exitArithmeticOperator(this)}accept(e){return e.visitArithmeticOperator?e.visitArithmeticOperator(this):e.visitChildren(this)}};a(qo,"ArithmeticOperatorContext");var uo=qo,Bo=class Bo extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_comparisonOperator}enterRule(e){e.enterComparisonOperator&&e.enterComparisonOperator(this)}exitRule(e){e.exitComparisonOperator&&e.exitComparisonOperator(this)}accept(e){return e.visitComparisonOperator?e.visitComparisonOperator(this):e.visitChildren(this)}};a(Bo,"ComparisonOperatorContext");var Wr=Bo,Ko=class Ko extends K{constructor(e,t,r){super(t,r),this.parser=e}get ruleIndex(){return N.RULE_logicalOperator}enterRule(e){e.enterLogicalOperator&&e.enterLogicalOperator(this)}exitRule(e){e.exitLogicalOperator&&e.exitLogicalOperator(this)}accept(e){return e.visitLogicalOperator?e.visitLogicalOperator(this):e.visitChildren(this)}};a(Ko,"LogicalOperatorContext");var zr=Ko,Vo=class Vo extends K{constructor(e,t,r){super(t,r),this.parser=e}POLAR_OP(){return this.getToken(N.POLAR_OP,0)}get ruleIndex(){return N.RULE_polarityOperator}enterRule(e){e.enterPolarityOperator&&e.enterPolarityOperator(this)}exitRule(e){e.exitPolarityOperator&&e.exitPolarityOperator(this)}accept(e){return e.visitPolarityOperator?e.visitPolarityOperator(this):e.visitChildren(this)}};a(Vo,"PolarityOperatorContext");var ho=Vo;import{ParseTreeVisitor as qp}from"@browsery/antlr4";var Wo=class Wo extends P{constructor(e){super(""+e)}toString(){return"@"+super.toString()}};a(Wo,"ExternalConstant");var Jr=Wo;var zo=class zo extends qp{constructor(t){super();p(this,"_timeZone");this._timeZone=t==null?void 0:t.timeZone}visitChildren(t){let r=super.visitChildren(t);return Array.isArray(r)&&r.length<2?r[0]:r??t.getText()}defaultResult(){}visitRoot(t){return this.visit(t.expression())}visitParenthesizedExpression(t){let r=this.visit(t.parenthesizedItem());return new we(r)}visitParenthesizedItem(t){return this.visit(t.expression())}visitNegativeExpression(t){let r=this.visit(t.expression());return new er(r)}visitComparisonExpression(t){return new fe({op:t.comparisonOperator().getText(),left:this.visit(t.comparisonLeft()),right:this.visit(t.comparisonRight())})}visitLogicalExpression(t){let r=[],i=a((n,s)=>{for(let c of n){if(c instanceof or&&c.logicalOperator().getText()===s){i(c.expression_list(),c.logicalOperator().getText());continue}let l=this.visit(c);r.push(l)}},"wrapChildren");return i(t.expression_list(),t.logicalOperator().getText()),new me({op:t.logicalOperator().getText(),items:r})}visitQualifiedIdentifier(t){return new H(t.getText())}visitExternalConstant(t){return new Jr(t.identifier().getText())}visitNullLiteral(){return new Ye}visitBooleanLiteral(t){return new Je(t.getText()==="true")}visitNumberLiteral(t){return new Ae(t.getText())}visitStringLiteral(t){return new Qe(tr(t.getText()))}visitInfinityLiteral(){return new Ae(1/0)}visitDateLiteral(t){return new Se(tr(t.getText()))}visitDateTimeLiteral(t){return new rr(tr(t.getText()))}visitTimeLiteral(t){return new Ge(tr(t.getText()))}visitArrayValue(t){return new ge(t.value_list().map(r=>this.visit(r)))}};a(zo,"FilterTreeVisitor");var sr=zo;import{ErrorListener as Bp}from"@browsery/antlr4";var Jo=class Jo extends Bp{constructor(t){super();p(this,"errors");this.errors=t}syntaxError(t,r,i,n,s,c){this.errors.push(new Pr(s,{recognizer:t,offendingSymbol:r,line:i,column:n,e:c}))}};a(Jo,"OpraErrorListener");var ar=Jo;function Yo(o,e){let t=new Kp(o),r=new ir(t),i=new Vp(r),n=new N(i);n.buildParseTrees=!0;let s=[],c=new ar(s);r.removeErrorListeners(),r.addErrorListener(c),n.removeErrorListeners(),n.addErrorListener(c);let l=n.root();if(s.length){let m=[];for(let w of s)m.push(w.message+(o.includes(`
|
|
8
|
+
`)?" at line: "+w.line+" column: "+w.column:" at column: "+w.column));let T=new kr(m.join(`
|
|
9
|
+
`));throw T.errors=s,T}return e=e||new sr,e.visit(l)}a(Yo,"parse");var Qo=class Qo{constructor(e,t){p(this,"_rules",new S);p(this,"_decoderCache",new WeakMap);if(Object.defineProperty(this,"_rules",{value:new S(null,{caseSensitive:t==null?void 0:t.caseSensitive}),enumerable:!1}),e)for(let[r,i]of Object.entries(e))this.set(r,i)}set(e,t){let r=typeof(t==null?void 0:t.operators)=="string"?t.operators.split(/\s*[,| ]\s*/):t==null?void 0:t.operators;this._rules.set(e,Wp({...t,operators:r}))}normalizeFilter(e,t,r){let i=typeof e=="string"?Yo(e):e;return this.normalizeFilterAst(i,[],t,r)}normalizeFilterAst(e,t,r,i){if(e instanceof fe){if(t.push(e),this.normalizeFilterAst(e.left,t,r),!(e.left instanceof H&&e.left.field))throw new TypeError("Invalid filter query. Left side should be a data field.");let n=this._rules.get(e.left.value);if(!n)throw new xe({message:`Field '${e.left.value}' is not available for filter operation`,code:"UNACCEPTED_FILTER_FIELD",details:{field:e.left.value}});if(n.operators&&!n.operators.includes(e.op))throw new xe({message:`'${e.left.value}' field do not accept '${e.op}' filter operator`,code:"UNACCEPTED_FILTER_OPERATION",details:{field:e.left.value,operator:e.op}});return n.mappedField&&(e.left.value=n.mappedField),n.prepare&&(e.prepare=n.prepare),this.normalizeFilterAst(e.right,t,r),t.pop(),e}if(e instanceof me)return t.push(e),e.items.forEach(n=>this.normalizeFilterAst(n,t,r)),t.pop(),e;if(e instanceof ze)return t.push(e),e.items.forEach(n=>this.normalizeFilterAst(n.expression,t,r)),t.pop(),e;if(e instanceof ge)return t.push(e),e.items.forEach(n=>this.normalizeFilterAst(n,t,r)),t.pop(),e;if(e instanceof we)return t.push(e),this.normalizeFilterAst(e.expression,t,r),t.pop(),e;if(e instanceof H&&r)return e.value=r.normalizeFieldPath(e.value,{scope:i}),e.field=r.getField(e.value,i),e.dataType=e.field.type,e;if(e instanceof P){let n=t.findLastIndex(s=>s instanceof fe);if(n>=0){let s=t[n];if((e===s.right||t[n+1]===s.right)&&s&&s.left instanceof H&&s.left.field){if(e.value==null&&!s.left.field.required)return e.value;let c;s.op==="like"||s.op==="!like"||s.op==="ilike"||s.op==="!ilike"?c=zp:c=this._decoderCache.get(s.left.field),c||(c=s.left.field.generateCodec("decode",{scope:i,projection:"*",ignoreReadonlyFields:!0,coerce:!0}),this._decoderCache.set(s.left.field,c)),e.value=c(e.value,{coerce:!0})}}}return e}toJSON(){return this._rules.toObject()}[Symbol.iterator](){return this._rules.entries()}};a(Qo,"FilterRules");var lt=Qo;import cc from"object-hash";import{asMutable as lc}from"ts-gems";import{validator as fc,vg as G}from"valgen";import"reflect-metadata";import{omitUndefined as sc}from"@jsopen/objects";import{asMutable as ac}from"ts-gems";import{vg as Qr}from"valgen";var u={};Dr(u,{ArrayType:()=>ft,ComplexType:()=>mt,EnumType:()=>ut,HttpController:()=>pr,HttpOperation:()=>Go,MQController:()=>Xo,MQOperation:()=>Zo,MappedType:()=>dt,MixinType:()=>ht,SimpleType:()=>yt,SpecVersion:()=>m0,UnionType:()=>Tt,WSController:()=>Ho,WSOperation:()=>en,isArrayType:()=>ec,isComplexType:()=>Yp,isDataType:()=>Jp,isEnumType:()=>Zp,isHttpController:()=>tc,isMappedType:()=>Xp,isMixinType:()=>Gp,isSimpleType:()=>Qp,isUnionType:()=>Hp});var m0="1.0";var ft;(function(o){o.Kind="ArrayType"})(ft||(ft={}));var mt;(function(o){o.Kind="ComplexType"})(mt||(mt={}));var ut;(function(o){o.Kind="EnumType"})(ut||(ut={}));var dt;(function(o){o.Kind="MappedType"})(dt||(dt={}));var ht;(function(o){o.Kind="MixinType"})(ht||(ht={}));var yt;(function(o){o.Kind="SimpleType"})(yt||(yt={}));var Tt;(function(o){o.Kind="UnionType"})(Tt||(Tt={}));var pr;(function(o){o.Kind="HttpController"})(pr||(pr={}));var Go;(function(o){o.Kind="HttpOperation"})(Go||(Go={}));var Xo;(function(o){o.Kind="MQController"})(Xo||(Xo={}));var Zo;(function(o){o.Kind="MQOperation"})(Zo||(Zo={}));function Jp(o){return o&&typeof o=="object"&&(o.kind===ft.Kind||o.kind===mt.Kind||o.kind===ut.Kind||o.kind===dt.Kind||o.kind===yt.Kind||o.kind===ht.Kind||o.kind===Tt.Kind)}a(Jp,"isDataType");function Yp(o){return o&&typeof o=="object"&&o.kind===mt.Kind}a(Yp,"isComplexType");function Qp(o){return o&&typeof o=="object"&&o.kind===yt.Kind}a(Qp,"isSimpleType");function Gp(o){return o&&typeof o=="object"&&o.kind===ht.Kind}a(Gp,"isMixinType");function Xp(o){return o&&typeof o=="object"&&o.kind===dt.Kind}a(Xp,"isMappedType");function Zp(o){return o&&typeof o=="object"&&o.kind===ut.Kind}a(Zp,"isEnumType");function Hp(o){return o&&typeof o=="object"&&o.kind===Tt.Kind}a(Hp,"isUnionType");function ec(o){return o&&typeof o=="object"&&o.kind===ft.Kind}a(ec,"isArrayType");function tc(o){return o&&typeof o=="object"&&o.kind===pr.Kind}a(tc,"isHttpController");var Ho;(function(o){o.Kind="WSController"})(Ho||(Ho={}));var en;(function(o){o.Kind="WSOperation"})(en||(en={}));import{omitUndefined as oc}from"@jsopen/objects";import{asMutable as nc}from"ts-gems";import{asMutable as rc}from"ts-gems";import{uid as ic}from"uid";var Ea;Ea=L;var tn=class tn{constructor(e,t){p(this,Ea);p(this,"_document");p(this,"parent");p(this,"element");this.element=e,this.parent=t}getDocument(){if(this._document)return this._document;if(this.element[De])return this.element;if(this.parent)return this._document=this.parent.getDocument();throw new Error("ApiDocument not found in document tree")}hasDataType(e,t){return!!this.findDataType(e,t)}findDataType(e,t){var i;let r=(i=this[L])==null?void 0:i.get(e);return r&&r.inScope(t)?r:this.parent?this.parent.findDataType(e,t):void 0}getDataType(e,t){let r=this.findDataType(e,t);if(r)return r;let i="";if(typeof e=="function")i=Reflect.getMetadata(y,e).name;else if(typeof e=="object"){let n=e[y];i=n==null?void 0:n.name}throw i||(e&&typeof e=="string"?i=e:typeof e=="function"&&(i=e.name)),r?new TypeError(`Data type${i?" ("+i+")":""} is not in requested scope (${t})`):new TypeError(`Unknown data type${i?" ("+i+")":""}`)}getDataTypeNameWithNs(e){if(!e.name)return;let t=this.getDocument().getDataTypeNs(e);return t?t+":"+e.name:e.name}getArrayType(e,t){let r=this.getDataType(e,t);if(r.kind===u.ArrayType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a MixinType`)}getComplexType(e,t){let r=this.getDataType(e,t);if(r.kind===u.ComplexType.Kind)return r;throw new TypeError(`Data type "${r.name}" is not a ComplexType`)}getSimpleType(e,t){let r=this.getDataType(e,t);if(r.kind===u.SimpleType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a SimpleType`)}getEnumType(e,t){let r=this.getDataType(e,t);if(r.kind===u.EnumType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a EnumType`)}getMappedType(e,t){let r=this.getDataType(e,t);if(r.kind===u.MappedType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a MappedType`)}getMixinType(e,t){let r=this.getDataType(e,t);if(r.kind===u.MixinType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a MixinType`)}getUnionType(e,t){let r=this.getDataType(e,t);if(r.kind===u.UnionType.Kind)return r;throw new TypeError(`Data type "${r.name||r}" is not a UnionType`)}};a(tn,"DocumentNode");var Yr=tn;var O=a(function(o){if(!this)throw new TypeError('"this" should be passed to call class constructor');let e=rc(this);e.id=ic(16),Object.defineProperty(e,"node",{value:new Yr(this,o==null?void 0:o.node),enumerable:!1,writable:!0}),o&&Object.defineProperty(e,"owner",{value:o,enumerable:!1,writable:!0})},"DocumentElement"),on=class on{};a(on,"DocumentElementClass");var rn=on;O.prototype=rn.prototype;var Me=Symbol.for("nodejs.util.inspect.custom"),Oe="\x1B[0m",ve="\x1B[33m",Ie="\x1B[35m";function cr(o,e){return!e||o==="*"?!0:o?Array.isArray(e)?e.some(t=>typeof t=="string"?o===t:t.test(o)):typeof e=="string"?o===e:e.test(o):!1}a(cr,"testScopeMatch");var _=a(function(o,e,t){if(!this)throw new TypeError('"this" should be passed to call class constructor');if(e!=null&&e.name&&!F.test(e.name))throw new TypeError(`"${e.name}" is not a valid DataType name`);O.call(this,o);let r=nc(this);r.kind=e.kind,r.scopePattern=e.scopePattern?Array.isArray(e.scopePattern)?e.scopePattern:[e.scopePattern]:void 0,r.name=e.name,r.description=e.description,r.abstract=e.abstract,r.examples=e.examples},"DataType"),sn=class sn extends O{get embedded(){return!this.name}inScope(e){return cr(e,this.scopePattern)}toJSON(e){let t=this._locateBase(r=>!r.inScope(e==null?void 0:e.scope));if(t){let r=this.node.getDataTypeNameWithNs(t);throw new TypeError(`"${r}" model is not available for "${(e==null?void 0:e.scope)||"null"}" scope`)}return oc({kind:this.kind,description:this.description,abstract:this.abstract,examples:this.examples})}toString(){return`[${Object.getPrototypeOf(this).constructor.name} ${this.name||"#Embedded"}]`}[Me](){return`[${ve+Object.getPrototypeOf(this).constructor.name+Oe} ${Ie+this.name+Oe}]`}};a(sn,"DataTypeClass");var nn=sn;_.prototype=nn.prototype;var de=a(function(...o){if(!this)return de[A].apply(void 0,o);let[e,t,r]=o;_.call(this,e,t,r);let i=ac(this);i.kind=u.ArrayType.Kind,i.type=t.type,i.minOccurs=t.minOccurs,i.maxOccurs=t.maxOccurs},"ArrayType"),pn=class pn extends _{toJSON(e){let t=super.toJSON(e),r=this.node.getDataTypeNameWithNs(this.type);return sc({...t,kind:this.kind,type:r||this.type.toJSON(e),minOccurs:this.minOccurs,maxOccurs:this.maxOccurs})}generateCodec(e,t,r){let i=this.type.generateCodec(e,t,r);i=Qr.isArray(i);let n=[];return this.minOccurs&&n.push(Qr.lengthMin(this.minOccurs)),this.maxOccurs&&n.push(Qr.lengthMax(this.maxOccurs)),n.length>0?Qr.pipe([i,...n],{returnIndex:0}):i}extendsFrom(){return!1}_locateBase(){}};a(pn,"ArrayTypeClass");var an=pn;de.prototype=an.prototype;de[A]=pc;function pc(o,e){let i=class i{};a(i,"ArrayClass");let t=i,r={...e,kind:u.ArrayType.Kind,type:o};return Reflect.defineMetadata(y,r,t),t}a(pc,"ArrayTypeFactory");var Et=/^([+-])?([a-z$_][\w.]*)$/i,C=a(function(...o){if(!this)throw new TypeError('"this" should be passed to call class constructor');let[e,t,r]=o;_.call(this,e,t,r);let i=lc(this);i._fields=new S},"ComplexTypeBase"),ln=class ln extends _{constructor(){super(...arguments);p(this,"ctor");p(this,"additionalFields");p(this,"keyField")}fieldCount(t){if(t==="*")return this._fields.size;let r=0;for(let i of this.fields(t))r++;return r}fieldEntries(t){let r=this._fields.entries();if(t==="*")return r;let i;return{next(){for(;r&&(i=r.next(),!(i.done||i.value&&i.value[1].inScope(t))););return i.done?{done:i.done,value:void 0}:{done:i.done,value:[i.value[0],i.value[1].forScope(t)]}},return(n){return r=void 0,{done:!0,value:n}},[Symbol.iterator](){return this}}}fields(t){let r=this.fieldEntries(t),i;return{next(){var n;return r?(i=r.next(),{done:i.done,value:(n=i.value)==null?void 0:n[1]}):{done:!0,value:void 0}},return(n){return r=void 0,{done:!0,value:n}},[Symbol.iterator](){return this}}}fieldNames(t){if(t==="*")return this._fields.keys();let r=this.fieldEntries(t),i;return{next(){var n;return r?(i=r.next(),{done:i.done,value:(n=i.value)==null?void 0:n[0]}):{done:!0,value:void 0}},return(n){return r=void 0,{done:!0,value:n}},[Symbol.iterator](){return this}}}findField(t,r){if(t.includes(".")){let n=this.parseFieldPath(t,{scope:r});if(n.length===0)throw new Error(`Field "${t}" does not exist in scope "${r}"`);let s=n.pop();return s==null?void 0:s.field}let i=this._fields.get(t);if(i&&i.inScope(r))return i.forScope(r)}getField(t,r){let i=this.findField(t,"*");if(i&&!i.inScope(r))throw new Error(`Field "${t}" does not exist in scope "${r||"null"}"`);if(!i)throw new Error(`Field (${t}) does not exist`);return i.forScope(r)}parseFieldPath(t,r){var E,$,qe;let i=this,n,s=t.split("."),c=s.length,l=[],m=this.owner.node.getDataType("object"),T=r==null?void 0:r.allowSigns,w=a(()=>l.map(j=>j.fieldName).join("."),"getStrPath");for(let j=0;j<c;j++){let V={fieldName:s[j],dataType:m};l.push(V);let Be=Et.exec(s[j]);if(!Be)throw new TypeError(`Invalid field name (${w()})`);if(Be[1]&&((j===0&&T==="first"||T==="each")&&(V.sign=Be[1]),V.fieldName=Be[2]),i){if(i instanceof C){if(n=i.findField(V.fieldName,r==null?void 0:r.scope),n){V.fieldName=n.name,V.field=n,V.dataType=n.type,i=n.type;continue}if(((E=i.additionalFields)==null?void 0:E[0])===!0){V.additionalField=!0,V.dataType=m,i=void 0;continue}if((($=i.additionalFields)==null?void 0:$[0])==="type"&&((qe=i.additionalFields)==null?void 0:qe[1])instanceof _){V.additionalField=!0,V.dataType=i.additionalFields[1],i=i.additionalFields[1];continue}throw new Error(`Unknown field (${l.map(li=>li.fieldName).join(".")})`)}throw new TypeError(`"${l.map(li=>li.fieldName).join(".")}" field is not a complex type and has no child fields`)}V.additionalField=!0,V.dataType=m}return l}normalizeFieldPath(t,r){return this.parseFieldPath(t,r).map(i=>(i.sign||"")+i.fieldName).join(".")}generateCodec(t,r){var l;let i=r!=null&&r.cache?r:{...r,projection:Array.isArray(r==null?void 0:r.projection)?ua(r.projection):r==null?void 0:r.projection,currentPath:""},n=this._generateSchema(t,i),s;if(this.additionalFields instanceof _)s=this.additionalFields.generateCodec(t,r);else if(typeof this.additionalFields=="boolean")s=this.additionalFields;else if(Array.isArray(this.additionalFields))if(this.additionalFields.length<2)s="error";else{let m=s[1];s=fc((T,w,E)=>w.fail(E,m,T))}let c=G.isObject(n,{ctor:this.name==="object"?Object:this.ctor,additionalFields:s,name:this.name,coerce:!0,caseInSensitive:r==null?void 0:r.caseInSensitive,onFail:r==null?void 0:r.onFail});if(i.level===0&&((l=i.forwardCallbacks)!=null&&l.size))for(let m of i.forwardCallbacks)m();return c}_generateSchema(t,r){var m;r.fieldCache=r.fieldCache||new Map,r.level=r.level||0,r.forwardCallbacks=r.forwardCallbacks||new Set;let i={},{currentPath:n,projection:s}=r,c=!!(s&&Object.values(s).find(T=>!T.sign)),l;for(let T of this.fields("*")){if(!T.inScope(r.scope)||!(r.keepKeyFields&&this.keyField)&&(r.ignoreReadonlyFields&&T.readonly||r.ignoreWriteonlyFields&&T.writeonly)){i[T.name]=G.isUndefined({coerce:!0});continue}l=T.name;let w;if(s!=="*"&&(w=s==null?void 0:s[l.toLowerCase()],(w==null?void 0:w.sign)==="-"||c&&!w||!c&&T.exclusive&&!w)){i[T.name]=G.isUndefined({coerce:!0});continue}let E=typeof s=="object"?((m=s[l])==null?void 0:m.projection)||"*":s,$=r.fieldCache.get(T),qe=typeof E=="string"?E:cc(E||{});$||($={},r.fieldCache.set(T,$));let j=$[qe];if(j===null)j=G.isAny(),r.forwardCallbacks.add(()=>{j=$[qe],i[l]=r.partial||!T.required?G.optional(j):G.required(j)});else if(!j){let V=a(()=>{$[qe]=null;let Be=this._generateFieldCodec(t,T,{...r,partial:r.partial==="deep"?r.partial:void 0,projection:E,currentPath:n+(n?".":"")+l});return $[qe]=Be,Be},"defaultGenerator");r.fieldHook?j=r.fieldHook(T,r.currentPath,V):j=V()}i[l]=r.partial||!(T.required||j.id==="required")?G.optional(j):j.id==="required"?j:G.required(j)}return r.allowPatchOperators&&(i._$pull=G.optional(G.isAny()),i._$push=G.optional(G.isAny())),i}_generateFieldCodec(t,r,i){let n=r.generateCodec(t,{...i,level:i.level+1});return r.fixed&&(n=G.isEqual(r.fixed)),r.isArray&&!(r.type instanceof de)&&(n=G.isArray(n)),n}};a(ln,"ComplexTypeBaseClass");var cn=ln;C.prototype=cn.prototype;import"reflect-metadata";import{omitUndefined as fn}from"@jsopen/objects";import{asMutable as mc}from"ts-gems";import{vg as uc}from"valgen";var ee=a(function(...o){if(!this)return ee[A].apply(void 0,o);let[e,t,r]=o;_.call(this,e,t,r);let i=mc(this);if(i.kind=u.EnumType.Kind,t.base){if(!(t.base instanceof ee))throw new TypeError(`"${t.base.kind}" can't be set as base for a "${i.kind}"`);i.base=t.base}i.instance=t.instance,i.ownAttributes=k(t.attributes||{}),i.attributes=i.base?k(i.base.attributes):{};for(let[n,s]of Object.entries(i.ownAttributes))i.attributes[n]=s},"EnumType"),mn=class mn extends _{extendsFrom(e){var t;return e instanceof _||(e=this.node.getDataType(e)),e instanceof ee?e===this?!0:!!((t=this.base)!=null&&t.extendsFrom(e)):!1}generateCodec(){return uc.isEnum(Object.keys(this.attributes))}toJSON(e){let t=super.toJSON(e),r=this.base?this.node.getDataTypeNameWithNs(this.base):void 0;return fn({...t,kind:this.kind,base:r,attributes:k(this.ownAttributes)})}_locateBase(e){if(this.base){if(e(this.base))return this.base;if(this.base._locateBase)return this.base._locateBase(e)}}};a(mn,"EnumTypeClass");var lr=mn;ee.prototype=lr.prototype;Object.assign(ee,lr);function dc(o,...e){let t=e.length>=2?e[0]:void 0,r=e.length>=2?e[1]:e[0],i={},n=o;if(Array.isArray(o)){if(t){if(!Array.isArray(t))throw new TypeError('Both "target" and "base" arguments should be array');n=[...t,...o]}i={},o.forEach(c=>{var m;if(!isNaN(Number(c)))return;let l=(m=r==null?void 0:r.meanings)==null?void 0:m[c];i[c]=fn({description:l})})}else{if(t){if(Array.isArray(t))throw new TypeError('Both "target" and "base" arguments should be enum object');n={...t,...o}}Object.keys(o).forEach(c=>{var m;if(!isNaN(Number(c)))return;let l=(m=r==null?void 0:r.meanings)==null?void 0:m[c];i[o[c]]=fn({alias:c,description:l})})}let s={kind:u.EnumType.Kind,attributes:i,base:r==null?void 0:r.base,name:r==null?void 0:r.name,description:r==null?void 0:r.description};return Object.defineProperty(o,y,{value:s,enumerable:!1,configurable:!0,writable:!0}),n}a(dc,"EnumTypeFactory");ee.prototype=lr.prototype;ee[A]=dc;var Kn={};Dr(Kn,{Base64Type:()=>Tn,DateTimeType:()=>mr,DateTimeTypeTz:()=>ur,DateType:()=>fr,EmailType:()=>te,FieldPathType:()=>J,FilterType:()=>Ze,ObjectIdType:()=>Sn,OperationResult:()=>oe,PartialDateType:()=>hr,TimeType:()=>yr,UrlType:()=>Bn,UuidType:()=>Hr});import{__decorate as yc,__metadata as Tc}from"tslib";import{isBase64 as Ec,validator as En,vg as yn}from"valgen";import"reflect-metadata";import{omitUndefined as xa}from"@jsopen/objects";import{asMutable as hc}from"ts-gems";import{isAny as ga}from"valgen";function un(o){let e=[],t=a(function(r){let i;if(!(o!=null&&o.embedded))if(o!=null&&o.name){if(!F.test(o.name))throw new TypeError(`"${o.name}" is not a valid type name`);i=o.name}else i=r.name,i=i.toLowerCase();let n=Reflect.getOwnMetadata(y,r)||{};o&&Object.assign(n,o),n.kind=u.SimpleType.Kind,n.name=i,Reflect.defineMetadata(y,n,r);for(let s of e)s(n,r)},"decorator");return t.Example=(r,i)=>(e.push(n=>{n.examples=n.examples||[],n.examples.push({description:i,value:r})}),t),t}a(un,"SimpleTypeDecoratorFactory");function _a(o){return(e,t)=>{if(typeof t!="string")throw new TypeError("Symbol properties can't be decorated with Attribute");let r=Reflect.getOwnMetadata(y,e.constructor)||{},i=Reflect.getMetadata("design:type",e,t),n="string";i===Boolean?n="boolean":i===Number&&(n="number"),r.kind=u.SimpleType.Kind,r.attributes=r.attributes||{},r.attributes[t]={format:(o==null?void 0:o.format)||n,description:o==null?void 0:o.description,deprecated:o==null?void 0:o.deprecated},Reflect.defineMetadata(y,r,e.constructor)}}a(_a,"AttributeDecoratorFactory");var d=a(function(...o){var n,s;if(!this)return d[A](...o);let[e,t,r]=o;_.call(this,e,t,r);let i=hc(this);if(i.kind=u.SimpleType.Kind,t.base){if(!(t.base instanceof d))throw new TypeError(`"${t.base.kind}" can't be set as base for a "${this.kind}"`);i.base=t.base}if(i.properties=t.properties,i.ownNameMappings={...t.nameMappings},i.nameMappings={...(n=i.base)==null?void 0:n.nameMappings,...t.nameMappings},i.ownAttributes=k(t.attributes||{}),i.attributes=i.base?k(i.base.attributes):{},i.ownAttributes)for(let[c,l]of Object.entries(i.ownAttributes)){if((s=i.attributes[c])!=null&&s.sealed)throw new TypeError(`Sealed attribute "${c}" can not be overwritten`);i.attributes[c]=l}i._generateDecoder=t.generateDecoder,i._generateEncoder=t.generateEncoder},"SimpleType"),hn=class hn extends _{constructor(){super(...arguments);p(this,"_generateDecoder");p(this,"_generateEncoder");p(this,"properties")}extend(t){return Object.setPrototypeOf(t,this),t}extendsFrom(t){var r;return t instanceof _||(t=this.node.getDataType(t)),t instanceof d?t===this?!0:!!((r=this.base)!=null&&r.extendsFrom(t)):!1}generateCodec(t,r,i){let n={...this.properties,...i};if(t==="decode"){let c=this;for(;c;){if(c._generateDecoder)return c._generateDecoder(n,{dataType:this,element:(r==null?void 0:r.documentElement)||this.owner,scope:r==null?void 0:r.scope});c=this.base}return ga}let s=this;for(;s;){if(s._generateEncoder)return s._generateEncoder(n,{dataType:this,element:(r==null?void 0:r.documentElement)||this.owner,scope:r==null?void 0:r.scope});s=this.base}return ga}toJSON(t){let r=super.toJSON(t),i=this.base?this.node.getDataTypeNameWithNs(this.base):void 0,n=xa(this.ownAttributes),s;this.properties&&typeof this.properties.toJSON=="function"?s=this.properties.toJSON(this.properties,this.owner,t):s=this.properties?k(this.properties):{};let c={...r,kind:this.kind,base:i,attributes:n&&Object.keys(n).length?n:void 0,properties:Object.keys(s).length?s:void 0};return Object.keys(this.ownNameMappings).length&&(c.nameMappings={...this.ownNameMappings}),xa(c,!0)}_locateBase(t){if(this.base){if(t(this.base))return this.base;if(this.base._locateBase)return this.base._locateBase(t)}}};a(hn,"SimpleTypeClass");var dn=hn;d.prototype=dn.prototype;Object.assign(d,un);d[A]=un;d.Attribute=_a;var _t,Tn=(_t=class{constructor(e){p(this,"designType");e&&Object.assign(this,e)}[x](e){let t=yn.isBase64({coerce:!0});return e.designType===Buffer?yn.pipe([t,_c],{coerce:!0}):e.designType===Uint8Array?yn.pipe([t,xc],{coerce:!0}):t}[g](){return gc}},a(_t,"Base64Type"),_t);Tn=yc([d({name:"base64",description:"A stream of bytes, base64 encoded",nameMappings:{js:"string",json:"string"}}),Tc("design:paramtypes",[Object])],Tn);var _c=En(o=>Buffer.from(o,"base64")),xc=En(o=>new Uint8Array(Buffer.from(o,"base64"))),gc=En(o=>Buffer.isBuffer(o)?o.toString("base64"):Ec(o));import{__decorate as _n,__metadata as xn}from"tslib";import{vg as Le}from"valgen";var wa=Le.isDateString({precisionMin:"day",trim:"day",coerce:!0}),wc=Le.isDate({trim:"day",coerce:!0}),xt,fr=(xt=class{constructor(e){p(this,"designType");p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t;e.designType===Date?t=wc:t=wa;let r=[t];return e.minValue!=null&&r.push(Le.isGte(t(e.minValue))),e.maxValue!=null&&r.push(Le.isLte(t(e.maxValue))),r.length>0?Le.pipe(r,{returnIndex:0}):t}[g](e){let t=wa,r=[t];return e.minValue!=null&&r.push(Le.isGte(t(e.minValue))),e.maxValue!=null&&r.push(Le.isLte(t(e.maxValue))),r.length>0?Le.pipe(r,{returnIndex:0}):t}},a(xt,"DateType"),xt);_n([d.Attribute({description:"Minimum value"}),xn("design:type",String)],fr.prototype,"minValue",void 0);_n([d.Attribute({description:"Maximum value"}),xn("design:type",String)],fr.prototype,"maxValue",void 0);fr=_n([d({name:"date",description:"A date without time",nameMappings:{js:"string",json:"string"}}).Example("2021-04-18","Full date value"),xn("design:paramtypes",[Object])],fr);import{__decorate as gn,__metadata as wn}from"tslib";import{vg as ke}from"valgen";var Aa=ke.isDateString({precisionMin:"day",trim:"tz",coerce:!0}),Ac=ke.isDate({coerce:!0}),gt,mr=(gt=class{constructor(e){p(this,"designType");p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t;e.designType===Date?t=Ac:t=Aa;let r=[t];return e.minValue!=null&&r.push(ke.isGte(t(e.minValue))),e.maxValue!=null&&r.push(ke.isLte(t(e.maxValue))),r.length>0?ke.pipe(r,{returnIndex:0}):t}[g](e){let t=Aa,r=[t];return e.minValue!=null&&r.push(ke.isGte(t(e.minValue))),e.maxValue!=null&&r.push(ke.isLte(t(e.maxValue))),r.length>0?ke.pipe(r,{returnIndex:0}):t}},a(gt,"DateTimeType"),gt);gn([d.Attribute({description:"Minimum value"}),wn("design:type",String)],mr.prototype,"minValue",void 0);gn([d.Attribute({description:"Maximum value"}),wn("design:type",String)],mr.prototype,"maxValue",void 0);mr=gn([d({name:"datetime",description:"A full datetime value",nameMappings:{js:"string",json:"string"}}).Example("2021-04-18T22:30:15").Example("2021-04-18 22:30:15").Example("2021-04-18 22:30"),wn("design:paramtypes",[Object])],mr);import{__decorate as An,__metadata as On}from"tslib";import{vg as Xe}from"valgen";var Oa=Xe.isDateString({precisionMin:"tz",coerce:!0}),wt,ur=(wt=class{constructor(e){p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t=Oa,r=[t];return e.minValue!=null&&r.push(Xe.isGte(t(e.minValue))),e.maxValue!=null&&r.push(Xe.isLte(t(e.maxValue))),r.length>0?Xe.pipe(r,{returnIndex:0}):t}[g](e){let t=Oa,r=[t];return e.minValue!=null&&r.push(Xe.isGte(t(e.minValue))),e.maxValue!=null&&r.push(Xe.isLte(t(e.maxValue))),r.length>0?Xe.pipe(r,{returnIndex:0}):t}},a(wt,"DateTimeTypeTz"),wt);An([d.Attribute({description:"Minimum value"}),On("design:type",String)],ur.prototype,"minValue",void 0);An([d.Attribute({description:"Maximum value"}),On("design:type",String)],ur.prototype,"maxValue",void 0);ur=An([d({name:"datetimetz",description:"A full datetime value with time zone information",nameMappings:{js:"string",json:"string"}}).Example("2021-04-18T22:30:15+03:00"),On("design:paramtypes",[Object])],ur);import{__decorate as he,__metadata as ye}from"tslib";import{vg as Ra}from"valgen";var At,te=(At=class{constructor(e){p(this,"allowDisplayName");p(this,"requireDisplayName");p(this,"utf8LocalPart");p(this,"ignoreMaxLength");p(this,"allowIpDomain");p(this,"domainSpecificValidation");p(this,"hostBlacklist");p(this,"hostWhitelist");p(this,"blacklistedChars");e&&Object.assign(this,e)}[x](e){return Ra.isEmail({...e,coerce:!0})}[g](e){return Ra.isEmail({...e,coerce:!0})}},a(At,"EmailType"),At);he([d.Attribute({description:"If set to `true`, the validator will also match `Display Name <email-address>",default:!1}),ye("design:type",Boolean)],te.prototype,"allowDisplayName",void 0);he([d.Attribute({description:"If set to `true`, the validator will reject strings without the format `Display Name <email-address>",default:!1}),ye("design:type",Boolean)],te.prototype,"requireDisplayName",void 0);he([d.Attribute({description:"If set to `false`, the validator will not allow any non-English UTF8 character in email address's local part",default:!0}),ye("design:type",Boolean)],te.prototype,"utf8LocalPart",void 0);he([d.Attribute({description:"If set to `true`, the validator will not check for the standard max length of an email",default:!1}),ye("design:type",Boolean)],te.prototype,"ignoreMaxLength",void 0);he([d.Attribute({description:"If set to `true`, the validator will allow IP addresses in the host part",default:!1}),ye("design:type",Boolean)],te.prototype,"allowIpDomain",void 0);he([d.Attribute({description:"If set to `true`, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by GMail.",default:!1}),ye("design:type",Boolean)],te.prototype,"domainSpecificValidation",void 0);he([d.Attribute({description:"If set to an array of strings and the part of the email after the @ symbol one of the strings defined in it, the validation fails."}),ye("design:type",Array)],te.prototype,"hostBlacklist",void 0);he([d.Attribute({description:"If set to an array of strings and the part of the email after the @ symbol matches none of the strings defined in it, the validation fails."}),ye("design:type",Array)],te.prototype,"hostWhitelist",void 0);he([d.Attribute({description:"If set to a string, then the validator will reject emails that include any of the characters in the string, in the name part."}),ye("design:type",String)],te.prototype,"blacklistedChars",void 0);te=he([d({name:"email",description:"An email value",nameMappings:{js:"string",json:"string"}}).Example("some.body@example.com"),ye("design:paramtypes",[Object])],te);import{__decorate as Rn,__metadata as bn}from"tslib";import{toString as Oc,validator as Rc,vg as bc}from"valgen";var Ot,J=(Ot=class{constructor(e){p(this,"dataType");p(this,"allowSigns");e&&Object.assign(this,e)}[x](e,{element:t,scope:r}){let i=e.dataType?t.node.getComplexType(e.dataType):t.node.getComplexType("object"),n=e.allowSigns,s=Rc("decodeFieldPath",c=>i.normalizeFieldPath(c,{allowSigns:n,scope:r}));return bc.pipe([Oc,s])}[g](e,t){return this[x](e,t)}toJSON(e,t,r){let i=e.dataType?t.node.getComplexType(e.dataType):t.node.getComplexType("object");_.prototype.toJSON.call(i,r);let n=i?t.node.getDataTypeNameWithNs(i):void 0;return{dataType:n||i.toJSON(r),allowSigns:e.allowSigns}}},a(Ot,"FieldPathType"),Ot);Rn([d.Attribute({description:"Data type which field belong to"}),bn("design:type",Object)],J.prototype,"dataType",void 0);Rn([d.Attribute({description:'Determines if signs (+,-) are allowed. If set "first" signs are allowed only beginning of the field pathIf set "each" signs are allowed at each field in the path'}),bn("design:type",String)],J.prototype,"allowSigns",void 0);J=Rn([d({name:"fieldpath",description:"Field path",nameMappings:{js:"string",json:"string"}}),bn("design:paramtypes",[Object])],J);import{__decorate as Dn,__metadata as Nn}from"tslib";import{validator as Da}from"valgen";var dr={};Dr(dr,{$and:()=>Nc,$arithmetic:()=>zc,$array:()=>ba,$date:()=>Sc,$eq:()=>Lc,$field:()=>Ic,$gt:()=>Pc,$gte:()=>Fc,$ilike:()=>Kc,$in:()=>Uc,$like:()=>qc,$lt:()=>jc,$lte:()=>Cc,$ne:()=>kc,$notILike:()=>Vc,$notIn:()=>$c,$notLike:()=>Bc,$number:()=>vc,$or:()=>Dc,$paren:()=>Wc,$time:()=>Mc,ArithmeticExpression:()=>ze,ArithmeticExpressionItem:()=>Lr,ArrayExpression:()=>ge,Ast:()=>Ht,BooleanLiteral:()=>Je,ComparisonExpression:()=>fe,DateLiteral:()=>Se,DateTimeLiteral:()=>rr,Expression:()=>q,FilterTreeVisitor:()=>sr,Literal:()=>P,LogicalExpression:()=>me,NegativeExpression:()=>er,NullLiteral:()=>Ye,NumberLiteral:()=>Ae,OpraErrorListener:()=>ar,ParenthesizedExpression:()=>we,QualifiedIdentifier:()=>H,StringLiteral:()=>Qe,Term:()=>We,TimeLiteral:()=>Ge,parse:()=>Yo});function Dc(...o){return new me({op:"or",items:o})}a(Dc,"$or");function Nc(...o){return new me({op:"and",items:o})}a(Nc,"$and");function Sc(o){return new Se(o)}a(Sc,"$date");function Mc(o){return new Ge(o)}a(Mc,"$time");function vc(o){return new Ae(o)}a(vc,"$number");function ba(...o){return new ge(o.map(Gr))}a(ba,"$array");function Ic(o){return new H(o)}a(Ic,"$field");function Lc(o,e){return re("=",o,e)}a(Lc,"$eq");function kc(o,e){return re("!=",o,e)}a(kc,"$ne");function Pc(o,e){return re(">",o,e)}a(Pc,"$gt");function Fc(o,e){return re(">=",o,e)}a(Fc,"$gte");function jc(o,e){return re("<",o,e)}a(jc,"$lt");function Cc(o,e){return re("<=",o,e)}a(Cc,"$lte");function Uc(o,e){return re("in",o,e)}a(Uc,"$in");function $c(o,e){return re("!in",o,e)}a($c,"$notIn");function qc(o,e){return re("like",o,e)}a(qc,"$like");function Bc(o,e){return re("!like",o,e)}a(Bc,"$notLike");function Kc(o,e){return re("ilike",o,e)}a(Kc,"$ilike");function Vc(o,e){return re("!ilike",o,e)}a(Vc,"$notILike");function Wc(o){return new we(o)}a(Wc,"$paren");function zc(o){let e=new ze;return e.add=t=>(e.append("+",Rt(t)),e),e.sub=t=>(e.append("-",Rt(t)),e),e.mul=t=>(e.append("*",Rt(t)),e),e.div=t=>(e.append("/",Rt(t)),e),e.append("+",Gr(o)),e}a(zc,"$arithmetic");function re(o,e,t){let r=typeof e=="string"?new H(e):Gr(e),i=Gr(t);return new fe({op:o,left:r,right:i})}a(re,"comparisonExpression");var Gr=a(o=>Array.isArray(o)?ba(...o.map(Rt)):Rt(o),"wrapEntryValue"),Rt=a(o=>o instanceof q?o:typeof o=="boolean"?new Je(o):typeof o=="number"||typeof o=="bigint"?new Ae(o):o==null?new Ye:o instanceof Date?new Se(o):new Qe(""+o),"_wrapEntryValue");var bt,Ze=(bt=class{constructor(e){p(this,"dataType");p(this,"rules");e&&Object.assign(this,e)}[x](e,{element:t}){let r=e.dataType?t.node.getComplexType(e.dataType):t.node.getComplexType("object"),i=e.rules?new lt(e.rules):void 0;return Jc(r,i)}[g](){return Yc}toJSON(e,t,r){let i=e.dataType?t.node.getComplexType(e.dataType):t.node.getComplexType("object");_.prototype.toJSON.call(i,r);let n=i?t.node.getDataTypeNameWithNs(i):void 0;return{dataType:n||i.toJSON(r),rules:e.rules}}},a(bt,"FilterType"),bt);Dn([d.Attribute({description:"Data type which filtering fields belong to"}),Nn("design:type",Object)],Ze.prototype,"dataType",void 0);Dn([d.Attribute({description:"Stringified JSON object defines filtering rules",format:"string"}),Nn("design:type",Object)],Ze.prototype,"rules",void 0);Ze=Dn([d({name:"filter",description:"A query filter",nameMappings:{js:"object",json:"string"}}),Nn("design:paramtypes",[Object])],Ze);var Jc=a((o,e,t)=>Da("decodeFilter",(r,i,n)=>{if(typeof r=="string")try{let s=dr.parse(r);return e?e.normalizeFilter(s,o,t):s}catch(s){i.fail(n,`Not a valid filter expression. ${s.message}`,r);return}i.fail(n,"Nt a valid filter expression string",r)}),"decodeFilter"),Yc=Da("encodeFilter",(o,e,t)=>{if(o instanceof dr.Ast)return o.toString();e.fail(t,"Not a valid filter expression",o)});import{__decorate as Qc,__metadata as Gc}from"tslib";import{vg as Na}from"valgen";var Dt,Sn=(Dt=class{constructor(e){e&&Object.assign(this,e)}[x](){return Na.isObjectId({coerce:!0})}[g](){return Na.isObjectId({coerce:!0})}},a(Dt,"ObjectIdType"),Dt);Sn=Qc([d({name:"ObjectId",description:"A MongoDB ObjectID value",nameMappings:{js:"object",json:"string"}}),Gc("design:paramtypes",[Object])],Sn);import{__decorate as Ee,__metadata as _e}from"tslib";import{omitUndefined as Sa}from"@jsopen/objects";import{asMutable as Zc}from"ts-gems";import{omitUndefined as Xc}from"@jsopen/objects";function Mn(o){let e=[],t=a(function(r,i){if(typeof i!="string")throw new TypeError("Symbol properties can't be used as a field");let n=Reflect.getOwnMetadata(y,r.constructor)||{};n.kind=u.ComplexType.Kind,n.fields=n.fields||{};let s=Reflect.getMetadata("design:type",r,i),c=n.fields[i]={...o,designType:s};s===Array?c.isArray=!0:c.type=c.type||s,Reflect.defineMetadata(y,n,r.constructor);for(let l of e)l(c)},"decorator");return t.Override=(r,i)=>(e.push(n=>{n.override=n.override||[],n.override.push(Xc({...i,scopePattern:Array.isArray(r)?r:[r],type:void 0,isArray:void 0,isNestedEntity:void 0}))}),t),t}a(Mn,"ApiFieldDecoratorFactory");var U=a(function(...o){if(!this){let[n]=o;return U[A](n)}let[e,t]=o;O.call(this,e);let r=Zc(this);r.name=t.name;let i=t.origin||e;if(!(i instanceof C))throw new Error("Field origin should be one of ComplexType, MappedType or MixinType");r.origin=i,r.type=t.type||e.node.getDataType("any"),r.description=t.description,r.isArray=t.isArray,r.isNestedEntity=t.isNestedEntity,r.default=t.default,r.fixed=t.fixed,r.required=t.required,r.exclusive=t.exclusive,r.localization=t.localization,r.keyField=t.keyField,r.deprecated=t.deprecated,r.readonly=t.readonly,r.writeonly=t.writeonly,r.examples=t.examples,r.override=t.override,r.scopePattern=t.scopePattern?Array.isArray(t.scopePattern)?t.scopePattern:[t.scopePattern]:void 0,r.designType=t.designType,r.override=t.override},"ApiField"),In=class In extends O{constructor(){super(...arguments);p(this,"origin")}inScope(t){return cr(t,this.scopePattern)}forScope(t){if(!(t&&this.override))return this;this._overrideCache=this._overrideCache||{};let r=this._overrideCache[t];if(r)return r;if(t!=="*"){for(let i of this.override)if(cr(t,i.scopePattern)){r=Sa({...i,id:void 0,owner:void 0,node:void 0,origin:void 0,name:void 0,type:void 0,override:void 0,_overrideCache:void 0,scopePattern:i.scopePattern}),Object.setPrototypeOf(r,this);break}}return r=r||this,this._overrideCache[t]=r,r}toJSON(t){var i;let r=this.type?this.node.getDataTypeNameWithNs(this.type):void 0;return Sa({type:r||((i=this.type)==null?void 0:i.toJSON(t)),description:this.description,isArray:this.isArray||void 0,isNestedEntity:this.isNestedEntity||void 0,default:this.default,fixed:this.fixed,required:this.required||void 0,exclusive:this.exclusive||void 0,localization:this.localization||void 0,keyField:this.keyField||void 0,deprecated:this.deprecated||void 0,readonly:this.readonly||void 0,writeonly:this.writeonly||void 0,examples:this.examples})}generateCodec(t,r,i){return this.type.generateCodec(t,r,{...i,designType:this.designType})}};a(In,"ApiFieldClass");var vn=In;U.prototype=vn.prototype;Object.assign(U,Mn);U[A]=Mn;import"reflect-metadata";import{omitUndefined as el}from"@jsopen/objects";import{asMutable as tl}from"ts-gems";var Ln=class Ln extends xe{constructor(){super("");p(this,"details",[])}add(t){return this.details.push(t),this}};a(Ln,"OpraDocumentError");var Nt=Ln;var kn=class kn{constructor(e){p(this,"path","");p(this,"error",new Nt);p(this,"maxErrors");p(this,"showErrorDetails",!0);this.maxErrors=(e==null?void 0:e.maxErrors)||0,this.error.message=""}addError(e){if(!this.error.details.length)if(e instanceof Error)this.error.stack=e.stack;else{let t=new Error;Error.captureStackTrace(t,this.addError),this.error.stack=t.stack}if(this.error.add({message:typeof e=="string"?e:e.message,path:this.path,...typeof e=="object"?e:void 0}),this.error.details.length>=this.maxErrors)throw this.error}enter(e,t){let r=this.path;this.path=this.path+e;try{return t()}catch(i){i!==this.error&&this.addError(i)}finally{this.path=r}}async enterAsync(e,t){let r=this.path;this.path=this.path+e;try{return await t()}catch(i){i!==this.error&&this.addError(i)}finally{this.path=r}}extend(e){let t={...e};return Object.setPrototypeOf(t,this),t}};a(kn,"DocumentInitContext");var Te=kn;import{omit as Hc}from"@jsopen/objects";function Pn(o){return function(e){let t;if(!(o!=null&&o.embedded))if(o!=null&&o.name){if(!F.test(o.name))throw new TypeError(`"${o.name}" is not a valid type name`);t=o.name}else t=e.name;let r=Reflect.getOwnMetadata(y,e);r||(r={},Reflect.defineMetadata(y,r,e)),r.kind=u.ComplexType.Kind,r.name=t,o&&Object.assign(r,Hc(o,["name"]))}}a(Pn,"ComplexTypeDecorator");var ie=a(function(...o){var n;if(!this)return ie[A].apply(void 0,o);let[e,t]=o,r=o[2]||new Te({maxErrors:0});C.call(this,e,t,r);let i=tl(this);i.kind=u.ComplexType.Kind,i.discriminatorField=t.discriminatorField,i.discriminatorValue=t.discriminatorValue,t.base&&r.enter(".base",()=>{if(!(t.base instanceof C))throw new TypeError(`"${t.base.kind}" can't be set as base for a "${this.kind}"`);i.base=t.base,i.additionalFields=i.base.additionalFields,i.keyField=i.base.keyField;for(let s of i.base.fields("*"))i._fields.set(s.name,new U(this,s))}),t.additionalFields!==void 0&&(i.additionalFields=t.additionalFields),t.keyField!==void 0&&(i.keyField=t.keyField),i.ctor=t.ctor||((n=i.base)==null?void 0:n.ctor),t.fields&&r.enter(".fields",()=>{for(let[s,c]of Object.entries(t.fields)){let l=new U(this,{...c,name:s});this._fields.set(l.name,l)}})},"ComplexType"),jn=class jn extends C{constructor(){super(...arguments);p(this,"base")}extendsFrom(t){var r;return t instanceof _||(t=this.node.getDataType(t)),t instanceof C?t===this?!0:!!((r=this.base)!=null&&r.extendsFrom(t)):!1}toJSON(t){let r=super.toJSON(t),i=this.base?this.node.getDataTypeNameWithNs(this.base):void 0,n={...r,kind:this.kind,base:this.base?i||this.base.toJSON(t):void 0,discriminatorField:this.discriminatorField,discriminatorValue:this.discriminatorValue};if(this.additionalFields)if(this.additionalFields instanceof _){let s=this.node.getDataTypeNameWithNs(this.additionalFields);n.additionalFields=s||this.additionalFields.toJSON(t)}else n.additionalFields=this.additionalFields;if(this._fields.size){let s={},c=0;for(let l of this._fields.values())l.origin===this&&l.inScope(t==null?void 0:t.scope)&&(s[l.name]=l.toJSON(t),c++);c&&(n.fields=s)}return el(n)}_locateBase(t){if(this.base){if(t(this.base))return this.base;if(this.base._locateBase)return this.base._locateBase(t)}}};a(jn,"ComplexTypeClass");var Fn=jn;ie.prototype=Fn.prototype;Object.assign(ie,Pn);ie[A]=Pn;var St,oe=(St=class{constructor(e){e&&Object.assign(this,e)}},a(St,"OperationResult"),St);Ee([U(),_e("design:type",Number)],oe.prototype,"affected",void 0);Ee([U(),_e("design:type",Number)],oe.prototype,"totalMatches",void 0);Ee([U(),_e("design:type",String)],oe.prototype,"context",void 0);Ee([U(),_e("design:type",String)],oe.prototype,"type",void 0);Ee([U(),_e("design:type",String)],oe.prototype,"message",void 0);Ee([U({type:"any"}),_e("design:type",Object)],oe.prototype,"payload",void 0);Ee([U({type:"object"}),_e("design:type",Array)],oe.prototype,"errors",void 0);oe=Ee([ie({name:"OperationResult",description:"Operation result"}),_e("design:paramtypes",[Object])],oe);(function(o){function e(t){var i;let r=(i=class extends o{constructor(...s){super(...s)}},a(i,"OperationResult_"),i);return Ee([U({type:t,required:!0}),_e("design:type",Object)],r.prototype,"payload",void 0),r=Ee([ie({embedded:!0}),_e("design:paramtypes",[Object])],r),r}a(e,"forPayload"),o.forPayload=e})(oe||(oe={}));import{__decorate as Cn,__metadata as Un}from"tslib";import{isDateString as Xr,toString as Ma,validator as rl,vg as He}from"valgen";var Mt,hr=(Mt=class{constructor(e){p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t=Ia,r=[];return e.minValue!=null&&(Xr(e.minValue),r.push(Ma,He.isGte(e.minValue))),e.maxValue!=null&&(Xr(e.maxValue),r.push(Ma,He.isLte(e.maxValue))),r.length>0?He.pipe([t,...r],{returnIndex:0}):t}[g](e){let t=Ia,r=[];return e.minValue!=null&&(Xr(e.minValue),r.push(He.isGte(e.minValue))),e.maxValue!=null&&(Xr(e.maxValue),r.push(He.isLte(e.maxValue))),r.length>0?He.pipe([t,...r],{returnIndex:0}):t}},a(Mt,"PartialDateType"),Mt);Cn([d.Attribute({description:"Minimum value"}),Un("design:type",String)],hr.prototype,"minValue",void 0);Cn([d.Attribute({description:"Maximum value"}),Un("design:type",String)],hr.prototype,"maxValue",void 0);hr=Cn([d({name:"partialdate",description:"Specifies a point in time using a 24-hour clock notation.\rFormat: YYYY-[MM-[DD-[T?HH:[MM:[SS[.S[S[S[S]]]]]]]]][+/-ZZ:ZZ].",nameMappings:{js:"string",json:"string"}}).Example("2021-04-18T22:30:15:22+03:00").Example("2021-04-18 22:30").Example("2021-04-18").Example("2021"),Un("design:paramtypes",[Object])],hr);var va=He.isDateString({precisionMin:"year"}),Ia=rl(o=>{if(o instanceof Date){let e=va(o,{coerce:!0});return e.endsWith("Z")&&(e=e.substring(0,e.length-1)),e.endsWith(".000")&&(e=e.substring(0,e.length-4)),e.endsWith(":00")&&(e=e.substring(0,e.length-3)),e.endsWith("00:00")&&(e=e.substring(0,e.length-6)),e}return va(o,{coerce:!1})});import{__decorate as $n,__metadata as qn}from"tslib";import{vg as Zr}from"valgen";var il=/^([0-1][0-9]|2[0-4]):([0-5][0-9])(?::([0-5][0-9]))?$/,vt,yr=(vt=class{constructor(e){p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t=Zr.matches(il,{formatName:"time",coerce:!0}),r=[];return e.minValue!=null&&r.push(Zr.isGte(e.minValue)),e.maxValue!=null&&r.push(Zr.isLte(e.maxValue)),r.length>0?Zr.pipe([t,...r],{returnIndex:0}):t}[g](e){return this[x](e)}},a(vt,"TimeType"),vt);$n([d.Attribute({description:"Minimum value"}),qn("design:type",String)],yr.prototype,"minValue",void 0);$n([d.Attribute({description:"Maximum value"}),qn("design:type",String)],yr.prototype,"maxValue",void 0);yr=$n([d({name:"time",description:"Time string in 24h format",nameMappings:{js:"string",json:"string"}}).Example("18:23:00","Full time value").Example("18:23:00","Time value without seconds"),qn("design:paramtypes",[Object])],yr);import{__decorate as ol,__metadata as nl}from"tslib";import{vg as La}from"valgen";var It,Bn=(It=class{constructor(e){e&&Object.assign(this,e)}[x](){return La.isURL({coerce:!0})}[g](){return La.isURL({coerce:!0})}},a(It,"UrlType"),It);Bn=ol([d({name:"url",description:"A Uniform Resource Identifier Reference (RFC 3986 icon) value",nameMappings:{js:"string",json:"string"}}).Example("http://tempuri.org"),nl("design:paramtypes",[Object])],Bn);import{__decorate as Pa,__metadata as Fa}from"tslib";import{vg as ka}from"valgen";var Lt,Hr=(Lt=class{constructor(e){p(this,"version");e&&Object.assign(this,e)}[x](e){return ka.isUUID(e==null?void 0:e.version,{coerce:!0})}[g](e){return ka.isUUID(e==null?void 0:e.version,{coerce:!0})}},a(Lt,"UuidType"),Lt);Pa([d.Attribute({description:"Version of the UUID"}),Fa("design:type",Number)],Hr.prototype,"version",void 0);Hr=Pa([d({name:"uuid",description:"A Universal Unique Identifier (UUID) value",nameMappings:{js:"string",json:"string"}}),Fa("design:paramtypes",[Object])],Hr);import sl from"path-browserify";import{omitUndefined as al}from"@jsopen/objects";import{asMutable as pl}from"ts-gems";var ne=Symbol.for("kMap"),Tr=Symbol.for("kCtorMap"),ja,Ca,Vn=class Vn{constructor(){p(this,Ca,new S);p(this,ja,new WeakMap)}get size(){return this[ne].size}forEach(e,t){this[ne].forEach(e,t)}get(e){let t=typeof e=="string"?e:this[Tr].get(e);if(!t&&typeof e=="function"){let i=Reflect.getMetadata(y,e);t=i==null?void 0:i.name}if(!t&&typeof e=="object"){let i=e[y];t=i==null?void 0:i.name}if(!t)return;let r=this[ne].get(t);if(r)return typeof e=="function"&&r.kind==="ComplexType"?r.ctor===e?r:void 0:r}set(e,t){this[ne].set(e,t),t.ctor?this[Tr].set(t.ctor,e):t.instance&&this[Tr].set(t.instance,e)}has(e){if(e instanceof _)return!!e.name&&this[ne].has(e.name);let t=typeof e=="string"?e:this[Tr].get(e);return t?this[ne].has(t):!1}keys(){return this[ne].keys()}values(){return this[ne].values()}entries(){return this[ne].entries()}sort(e){return this[ne].sort(e),this}[(Ca=ne,ja=Tr,Symbol.iterator)](){return this[ne][Symbol.iterator]()}};a(Vn,"DataTypeMap");var W=Vn;import{isConstructor as kt}from"@jsopen/objects";function I(o,e){let t=a(((r,i)=>{if(typeof i!="string")throw new TypeError("Symbol properties can not be decorated");let n={...e,kind:u.HttpOperation.Kind},s=Reflect.getOwnMetadata(ae,r.constructor)||{};s.operations=s.operations||{},s.operations[i]=n;for(let c of o)c(n);Reflect.defineMetadata(ae,s,r.constructor)}),"decorator");return t.Cookie=(r,i)=>(o.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"cookie",type:i}:{...i,name:r,location:"cookie"};kt(s.type)&&(s.designType=s.type),n.parameters?n.parameters=n.parameters.filter(c=>!(c.location==="cookie"&&String(c.name)===String(r))):n.parameters=[],n.parameters.push(s)}),t),t.Header=(r,i)=>(o.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"header",type:i}:{...i,name:r,location:"header"};kt(s.type)&&(s.designType=s.type),n.parameters?n.parameters=n.parameters.filter(c=>!(c.location==="header"&&String(c.name)===String(r))):n.parameters=[],n.parameters.push(s)}),t),t.QueryParam=(r,i)=>(o.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"query",type:i}:{...i,name:r,location:"query"};kt(s.type)&&(s.designType=s.type),n.parameters?n.parameters=n.parameters.filter(c=>!(c.location==="query"&&String(c.name)===String(r))):n.parameters=[],n.parameters.push(s)}),t),t.PathParam=(r,i)=>(o.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"path",type:i}:{...i,name:r,location:"path"};kt(s.type)&&(s.designType=s.type),n.parameters?n.parameters=n.parameters.filter(c=>!(c.location==="path"&&String(c.name)===String(r))):n.parameters=[],n.parameters.push(s)}),t),t.Response=(r,i)=>{let n={...i,statusCode:r};return n.type&&(n.contentType=n.contentType||D.opra_response_json,n.contentEncoding=n.contentEncoding||"utf-8"),n.contentType===D.opra_response_json&&(n.contentEncoding=n.contentEncoding||"utf-8"),kt(n.type)&&(n.designType=n.type),o.push(s=>{s.responses=s.responses||[],s.responses.push(n)}),t},t.RequestContent=function(r){let i=typeof r=="object"?r:{type:r};return i.type&&(i.contentType=i.contentType||D.json,i.contentEncoding=i.contentEncoding||"utf-8",kt(i.type)&&(i.designType=i.type)),o.push(n=>{n.requestBody=n.requestBody||{required:!0,content:[]},n.requestBody.content=n.requestBody.content||[],n.requestBody.content.push(i)}),t},t.MultipartContent=function(r,i){let n={...r,contentType:(r==null?void 0:r.contentType)||"multipart/form-data"};if(o.push(s=>{s.requestBody=s.requestBody||{required:!0,content:[]},s.requestBody.content=s.requestBody.content||[],s.requestBody.content.push(n)}),i){let s={Field(c,l){return n.multipartFields=n.multipartFields||[],n.multipartFields.push({fieldName:c,fieldType:"field",...l}),s},File(c,l){return n.multipartFields=n.multipartFields||[],n.multipartFields.push({fieldName:c,fieldType:"file",...l}),s}};i(s)}return t},t.UseType=(...r)=>(o.push(i=>{i.types=i.types||[],i.types.push(...r)}),t),t}a(I,"HttpOperationDecoratorFactory");var b=a(function(...o){if(!this){let[i]=o,n=[];return b[A].call(void 0,n,i)}let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid operation name (${t.name})`);let r=pl(this);r.parameters=[],r.responses=[],r.types=r.node[L]=new W,r.name=t.name,r.path=t.path,r.mergePath=t.mergePath,r.method=t.method||"GET",r.description=t.description,r.composition=t.composition,r.compositionOptions=t.compositionOptions?k(t.compositionOptions):void 0},"HttpOperation"),zn=class zn extends O{findParameter(e,t){let r=e.toLowerCase(),i;for(i of this.parameters)if(!(t&&t!==i.location)&&(typeof i.name=="string"&&(i._nameLower=i._nameLower||i.name.toLowerCase(),i._nameLower===r)||i.name instanceof RegExp&&i.name.test(e)))return i}getFullUrl(){let e=this.owner.getFullUrl();return e?this.path?this.mergePath?e+this.path:sl.posix.join(e,this.path):e:this.path||"/"}toJSON(e){var r;let t=al({kind:u.HttpOperation.Kind,description:this.description,method:this.method,path:this.path,mergePath:this.mergePath,composition:this.composition,requestBody:(r=this.requestBody)==null?void 0:r.toJSON(e)});if(this.types.size){t.types={};for(let i of this.types.values())t.types[i.name]=i.toJSON(e)}if(this.parameters.length){t.parameters=[];for(let i of this.parameters)t.parameters.push(i.toJSON(e))}return this.responses.length&&(t.responses=this.responses.map(i=>i.toJSON(e))),t}};a(zn,"HttpOperationClass");var Wn=zn;b.prototype=Wn.prototype;b[A]=I;b.GET=function(o){return I([],{...o,method:"GET"})};b.DELETE=function(o){return I([],{...o,method:"DELETE"})};b.HEAD=function(o){return I([],{...o,method:"HEAD"})};b.OPTIONS=function(o){return I([],{...o,method:"OPTIONS"})};b.PATCH=function(o){return I([],{...o,method:"PATCH"})};b.POST=function(o){return I([],{...o,method:"POST"})};b.PUT=function(o){return I([],{...o,method:"PUT"})};b.SEARCH=function(o){return I([],{...o,method:"SEARCH"})};b.Entity={};function z(o){if(typeof o=="string")return o;let e=Reflect.getMetadata(y,o);if(!e)throw new TypeError(`Type (${o}) is not decorated with any datatype decorators`);if(e!=null&&e.name)return e.name;throw new TypeError("You should provide named data type but embedded one found")}a(z,"getDataTypeName");function Pe(o,e){return(t,r)=>{let i=typeof r=="string"||typeof r=="function"?{name:t,location:"path",type:r,keyParam:!0}:{...r,name:t,location:"path",keyParam:!0};return o.PathParam(t,i),e.push(n=>{var s;(s=n.path)!=null&&s.includes(":"+t)||(n.path=(n.path||"")+"@:"+t),n.mergePath=!0}),o}}a(Pe,"createKeyParamDecorator");function Ua(o,e){return(...t)=>{let r=typeof t[0]=="object"?t[0]:t.reduce((s,c)=>{let l=c.split(":");return s[l[0]]=l[1]||l[0],s},{}),i=Object.keys(r).reduce((s,c)=>{let l=Et.exec(c),m=Et.exec(r[c]);return l&&m&&(s[l[2]]=m[2]),s},{}),n=Object.keys(r).reduce((s,c)=>{let l=Et.exec(c);return l&&(l[1]!="-"&&(s[l[2]]=l[2]),l[1]!="+"&&(s["-"+l[2]]="-"+l[2])),s},{});return e.push(s=>{let c=s.compositionOptions=s.compositionOptions||{};c.sortFields=i}),o.QueryParam("sort",{description:"Determines sort fields",type:ee(n),isArray:!0,arraySeparator:",",parser:a(s=>s.map(c=>{let l=Et.exec(c);return l?(l[1]||"")+i[l[2]]:c}),"parser")}),o}}a(Ua,"createSortFieldsDecorator");function Fe(o,e,t){let r=Reflect.getMetadata("FilterRules",o);r||(r=new lt,Reflect.defineMetadata("FilterRules",r,o));let i=Reflect.getMetadata("FilterType",o);return i||(i=new Ze({dataType:t}),i.rules={},Reflect.defineMetadata("FilterType",i,o)),(n,s)=>{let c=(Array.isArray(s)?{operators:s}:typeof s=="string"?{operators:s.split(/\s*,\s*/)}:s)||{};if(c.operators=c.operators||["=","!="],n.includes(":")){let l=n.split(":");n=l[0],c.mappedField=l[1]}return e.push(()=>{r.set(n,c),i.rules=r.toJSON()}),o.QueryParam("filter",{type:i,description:"Determines filter fields"}),o}}a(Fe,"createFilterDecorator");b.Entity.Create=function(o,e){var n;let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"POST",...t,composition:"Entity.Create",requestBody:{immediateFetch:!0,...t.requestBody,required:!0}});return i.QueryParam("projection",{description:"Determines fields projection",type:new J({dataType:t.type,allowSigns:"each"}),isArray:!0,arraySeparator:","}).RequestContent(((n=t.requestBody)==null?void 0:n.type)||t.type).Response(R.CREATED,{description:'Operation is successful. Returns OperationResult with "payload" field that contains the created resource.',contentType:D.opra_response_json,type:t.type,partial:"deep"}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(s=>{let c=s.compositionOptions=s.compositionOptions||{};c.type=z(t.type)}),i};b.Entity.Delete=function(o,e){let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"DELETE",...t,composition:"Entity.Delete"});return i.Response(R.OK,{description:'Operation is successful. Returns OperationResult with "affected" field.',contentType:D.opra_response_json}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(n=>{let s=n.compositionOptions=n.compositionOptions||{};s.type=z(t.type)}),i.KeyParam=Pe(i,r),i};b.Entity.DeleteMany=function(o,e){let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"DELETE",...t,composition:"Entity.DeleteMany"});return i.Response(R.OK,{description:'Operation is successful. Returns OperationResult with "affected" field.',contentType:D.opra_response_json}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(n=>{let s=n.compositionOptions=n.compositionOptions||{};s.type=z(t.type)}),i.Filter=Fe(i,r,t.type),i};var is={};Dr(is,{AnyType:()=>Jn,BigintType:()=>Zn,BooleanType:()=>Hn,IntegerType:()=>$t,NullType:()=>ts,NumberType:()=>Re,ObjectType:()=>rs,StringType:()=>et});import{__decorate as cl,__metadata as ll}from"tslib";import{isAny as $a}from"valgen";var Pt,Jn=(Pt=class{constructor(e){e&&Object.assign(this,e)}[x](){return $a}[g](){return $a}},a(Pt,"AnyType"),Pt);Jn=cl([d({name:"any",description:"Represents any value"}),ll("design:paramtypes",[Object])],Jn);import{__decorate as fl,__metadata as ml}from"tslib";import{toBigint as Ba,vg as Xn}from"valgen";import{__decorate as Qn,__metadata as Gn}from"tslib";import{toNumber as qa,vg as Yn}from"valgen";var Ft,Re=(Ft=class{constructor(e){p(this,"minValue");p(this,"maxValue");e&&Object.assign(this,e)}[x](e){let t=[];return e.minValue!=null&&t.push(Yn.isGte(e.minValue)),e.maxValue!=null&&t.push(Yn.isLte(e.maxValue)),t.length>0?Yn.pipe([qa,...t],{returnIndex:0}):qa}[g](e){return this[x](e)}},a(Ft,"NumberType"),Ft);Qn([d.Attribute({description:"Determines the minimum value"}),Gn("design:type",Number)],Re.prototype,"minValue",void 0);Qn([d.Attribute({description:"Determines the maximum value"}),Gn("design:type",Number)],Re.prototype,"maxValue",void 0);Re=Qn([d({name:"number",description:"Both Integer as well as Floating-Point numbers",nameMappings:{js:"number",json:"number"}}),Gn("design:paramtypes",[Object])],Re);var jt,Zn=(jt=class extends Re{constructor(e){super(e)}[x](e){let t=[];return e.minValue!=null&&t.push(Xn.isGte(e.minValue)),e.maxValue!=null&&t.push(Xn.isLte(e.maxValue)),t.length>0?Xn.pipe([Ba,...t],{returnIndex:0}):Ba}[g](e){return this[x](e)}},a(jt,"BigintType"),jt);Zn=fl([d({name:"bigint",description:"BigInt number",nameMappings:{js:"bigint",json:"string"}}),ml("design:paramtypes",[Object])],Zn);import{__decorate as ul,__metadata as dl}from"tslib";import{toBoolean as Ka}from"valgen";var Ct,Hn=(Ct=class{constructor(e){e&&Object.assign(this,e)}[x](){return Ka}[g](){return Ka}},a(Ct,"BooleanType"),Ct);Hn=ul([d({name:"boolean",description:"Simple true/false value",nameMappings:{js:"boolean",json:"boolean"}}),dl("design:paramtypes",[Object])],Hn);import{__decorate as hl,__metadata as yl}from"tslib";import{toInteger as Va,vg as es}from"valgen";var Ut,$t=(Ut=class extends Re{constructor(e){super(e)}[x](e){let t=[];return e.minValue!=null&&t.push(es.isGte(e.minValue)),e.maxValue!=null&&t.push(es.isLte(e.maxValue)),t.length>0?es.pipe([Va,...t],{returnIndex:0}):Va}[g](e){return this[x](e)}},a(Ut,"IntegerType"),Ut);$t=hl([d({name:"integer",description:"An integer number",nameMappings:{js:"number",json:"number"}}),yl("design:paramtypes",[Object])],$t);import{__decorate as Tl,__metadata as El}from"tslib";import{isNull as Wa}from"valgen";var qt,ts=(qt=class{constructor(e){e&&Object.assign(this,e)}[x](){return Wa}[g](){return Wa}},a(qt,"NullType"),qt);ts=Tl([d({name:"null",description:"A Null value",nameMappings:{js:"null",json:"null"}}),El("design:paramtypes",[Object])],ts);import{__decorate as _l,__metadata as xl}from"tslib";var Bt,rs=(Bt=class{constructor(e){e&&Object.assign(this,e)}},a(Bt,"ObjectType"),Bt);rs=_l([ie({name:"object",description:"A non modelled object",additionalFields:!0}),xl("design:paramtypes",[Object])],rs);import{__decorate as Er,__metadata as _r}from"tslib";import{toString as za,vg as ei}from"valgen";var Kt,et=(Kt=class{constructor(e){p(this,"pattern");p(this,"patternName");p(this,"minLength");p(this,"maxLength");e&&Object.assign(this,e)}[x](e){let t=[];if(e.pattern){let r=e.patternName;r||(r=Reflect.getMetadata(y,Object.getPrototypeOf(this).constructor).name),t.push(ei.matches(e.pattern,{formatName:r}))}return e.minLength&&t.push(ei.lengthMin(e.minLength)),e.maxLength&&t.push(ei.lengthMax(e.maxLength)),t.length>0?ei.pipe([za,...t],{returnIndex:0}):za}[g](e){return this[x](e)}},a(Kt,"StringType"),Kt);Er([d.Attribute({description:"Regex pattern to be used for validation"}),_r("design:type",Object)],et.prototype,"pattern",void 0);Er([d.Attribute({description:"Name of the pattern"}),_r("design:type",String)],et.prototype,"patternName",void 0);Er([d.Attribute({description:"Minimum number of characters"}),_r("design:type",Number)],et.prototype,"minLength",void 0);Er([d.Attribute({description:"Minimum number of characters"}),_r("design:type",Number)],et.prototype,"maxLength",void 0);et=Er([d({name:"string",description:"A sequence of characters",nameMappings:{js:"string",json:"string"}}),_r("design:paramtypes",[Object])],et);b.Entity.FindMany=function(o,e){let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"GET",...t,composition:"Entity.FindMany"});return i.Response(R.OK,{description:'Operation is successful. Returns OperationResult with "payload" field that contains list of resources.',contentType:D.opra_response_json,type:t.type,partial:"deep",isArray:!0}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}).QueryParam("limit",{description:"Determines number of returning instances",type:new $t({minValue:1,maxValue:t.maxLimit})}).QueryParam("skip",{description:"Determines number of returning instances",type:new $t({minValue:1})}).QueryParam("count",{description:"Counts all matching instances if enabled",type:Boolean}).QueryParam("projection",{description:"Determines fields projection",type:new J({dataType:t.type,allowSigns:"each"}),isArray:!0,arraySeparator:","}),r.push(n=>{let s=n.compositionOptions=n.compositionOptions||{};s.type=z(t.type),t.defaultLimit&&(s.defaultLimit=t.defaultLimit),t.defaultProjection&&(s.defaultProjection=t.defaultProjection),t.maxLimit&&(s.maxLimit=t.maxLimit)}),i.Filter=Fe(i,r,t.type),i.DefaultSort=(...n)=>(r.push(s=>{let c=s.compositionOptions=s.compositionOptions||{};c.defaultSort=n}),i),i.SortFields=Ua(i,r),i};b.Entity.Get=function(o,e){let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"GET",...t,composition:"Entity.Get"});return i.QueryParam("projection",{description:"Determines fields projection",type:new J({dataType:t.type,allowSigns:"each"}),isArray:!0,arraySeparator:","}).Response(R.OK,{description:'Operation is successful. Returns OperationResult with "payload" field that contains the resource asked for.',contentType:D.opra_response_json,type:t.type,partial:"deep"}).Response(R.NO_CONTENT,{description:"Operation is successful but no resource found"}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(n=>{let s=n.compositionOptions=n.compositionOptions||{};s.type=z(t.type)}),i.KeyParam=Pe(i,r),i};b.Entity.Replace=function(o,e){let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"POST",...t,composition:"Entity.Replace"});return i.QueryParam("projection",{description:"Determines fields projection",type:new J({dataType:t.type,allowSigns:"each"}),isArray:!0,arraySeparator:","}).Response(R.OK,{description:'Operation is successful. Returns OperationResult with "payload" field that contains the resource asked for.',contentType:D.opra_response_json,type:t.type,partial:"deep"}).Response(R.NO_CONTENT,{description:"Operation is successful but no resource found"}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(n=>{let s=n.compositionOptions=n.compositionOptions||{};s.type=z(t.type)}),i.KeyParam=Pe(i,r),i};b.Entity.Update=function(o,e){var n;let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"PATCH",...t,composition:"Entity.Update",requestBody:{partial:"deep",immediateFetch:!0,allowPatchOperators:!0,keepKeyFields:!0,...t.requestBody,required:!0}});return i.QueryParam("projection",{description:"Determines fields projection",type:new J({dataType:t.type,allowSigns:"each"}),isArray:!0,arraySeparator:","}).RequestContent(((n=t.requestBody)==null?void 0:n.type)||t.type).Response(R.OK,{description:'Operation is successful. Returns OperationResult with "payload" field that contains updated resource.',contentType:D.opra_response_json,type:t.type,partial:"deep"}).Response(R.NO_CONTENT,{description:"Operation is successful but no resource found"}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(s=>{let c=s.compositionOptions=s.compositionOptions||{};c.type=z(t.type)}),i.KeyParam=Pe(i,r),i.Filter=Fe(i,r,t.type),i};b.Entity.UpdateMany=function(o,e){var n;let t;typeof o=="object"&&!o[y]?t=o:t={...e,type:o};let r=[],i=I(r,{method:"PATCH",...t,composition:"Entity.UpdateMany",requestBody:{immediateFetch:!0,partial:"deep",allowPatchOperators:!0,keepKeyFields:!0,...t.requestBody,required:!0}});return i.RequestContent(((n=t.requestBody)==null?void 0:n.type)||t.type).Response(R.OK,{description:'Operation is successful. Returns OperationResult with "affected" field.',contentType:D.opra_response_json}).Response(R.UNPROCESSABLE_ENTITY,{description:"The request was well-formed but was unable to process operation due to one or many errors.",contentType:D.opra_response_json}),r.push(s=>{let c=s.compositionOptions=s.compositionOptions||{};c.type=z(t.type)}),i.Filter=Fe(i,r,t.type),i};import{merge as os}from"@jsopen/objects";var gl=/^(.*)(Controller)$/,Ja=[];function Vt(o){let e=[],t=a(function(r){var l;let i=o==null?void 0:o.name;i||(i=((l=gl.exec(r.name))==null?void 0:l[1])||r.name);let n={},s=Reflect.getOwnMetadata(pe,Object.getPrototypeOf(r));s&&os(n,s,{deep:!0});let c=Reflect.getOwnMetadata(pe,r);c&&os(n,c,{deep:!0}),os(n,{...o,kind:u.MQController.Kind,name:i,path:i},{deep:!0}),Reflect.defineMetadata(pe,n,r);for(let m of e)m(n,r);Reflect.defineMetadata(pe,n,r)},"decorator");return t.Header=(r,i)=>(e.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,type:i}:{...i,name:r};n.headers=n.headers||[],n.headers.push(s)}),t),t.UseType=(...r)=>(e.push(i=>{i.types=i.types||[],i.types.push(...r)}),t),Ja.forEach(r=>r(t,e,o)),t}a(Vt,"MQControllerDecoratorFactory");Vt.augment=function(o){Ja.push(o)};import{isConstructor as Ya,omit as Al}from"@jsopen/objects";var Qa=[];function xr(o,e,t){let r=!1,i=a(((n,s)=>{if(typeof s!="string")throw new TypeError("Symbol properties can not be decorated");let c={kind:u.MQOperation.Kind,channel:s,type:e,...Al(t,["kind","type"])},l=Reflect.getOwnMetadata(pe,n.constructor)||{};l.operations=l.operations||{},l.operations[s]=c;for(let m of o)m(c,n,s);Reflect.defineMetadata(pe,l,n.constructor)}),"decorator");return i.UseType=(...n)=>(o.push(s=>{s.types=s.types||[],s.types.push(...n)}),i),i.Header=(n,s)=>(o.push(c=>{let l=typeof s=="string"||typeof s=="function"?{name:n,type:s}:{...s,name:n};Ya(l.type)&&(l.designType=l.type);let m=r?c.response:c;m.headers?m.headers=m.headers.filter(T=>String(T.name)!==String(n)):m.headers=[],m.headers.push(l)}),i),i.Response=(n,s)=>(o.push(c=>{r=!0,c.response={...s,type:n},Ya(n)&&(c.response.designType=n)}),i),Qa.forEach(n=>n(i,o,e,t)),i}a(xr,"MQOperationDecoratorFactory");xr.augment=function(o){Qa.push(o)};import{merge as ns}from"@jsopen/objects";var Rl=/^(.*)(Controller)$/,Ga=[];function Wt(o){let e=[],t=a(function(r){var l;let i=o==null?void 0:o.name;i||(i=((l=Rl.exec(r.name))==null?void 0:l[1])||r.name);let n={},s=Reflect.getOwnMetadata(ce,Object.getPrototypeOf(r));s&&ns(n,s,{deep:!0});let c=Reflect.getOwnMetadata(ce,r);c&&ns(n,c,{deep:!0}),ns(n,{...o,kind:u.WSController.Kind,name:i,path:i},{deep:!0}),Reflect.defineMetadata(ce,n,r);for(let m of e)m(n,r);Reflect.defineMetadata(ce,n,r)},"decorator");return t.UseType=(...r)=>(e.push(i=>{i.types=i.types||[],i.types.push(...r)}),t),Ga.forEach(r=>r(t,e,o)),t}a(Wt,"WSControllerDecoratorFactory");Wt.augment=function(o){Ga.push(o)};import{omit as Dl}from"@jsopen/objects";var Xa=[];function gr(o,e){let t=a(((r,i)=>{if(typeof i!="string")throw new TypeError("Symbol properties can not be decorated");let n={kind:u.WSOperation.Kind,event:i,...Dl(e,["kind"])},s=Reflect.getOwnMetadata(ce,r.constructor)||{};s.operations=s.operations||{},s.operations[i]=n;for(let c of o)c(n,r,i);Reflect.defineMetadata(ce,s,r.constructor)}),"decorator");return t.UseType=(...r)=>(o.push(i=>{i.types=i.types||[],i.types.push(...r)}),t),Xa.forEach(r=>r(t,o,e)),t}a(gr,"WSOperationDecoratorFactory");gr.augment=function(o){Xa.push(o)};import"reflect-metadata";import{omitUndefined as Sl}from"@jsopen/objects";import{asMutable as Ml}from"ts-gems";function ti(o,e){let t=o==null?void 0:o.map(i=>String(i).toLowerCase()),r=e==null?void 0:e.map(i=>String(i).toLowerCase());return i=>r&&r.includes(i.toLowerCase())?!1:t?t.includes(i.toLowerCase()):!0}a(ti,"getIsInheritedPredicateFn");var tt=a(function(...o){var n;if(!this)throw new TypeError('"this" should be passed to call class constructor');let[e,t,r]=o;C.call(this,e,t,r);let i=Ml(this);if(i.kind=u.MappedType.Kind,t.base){if(!(t.base instanceof C))throw new TypeError(`"${t.base.kind}" can't be set as base for a "${this.kind}"`);i.base=t.base,i.ctor=t.ctor||i.base.ctor,t.pick?i.pick=t.pick.map(m=>i.base.normalizeFieldPath(m)):t.omit?i.omit=t.omit.map(m=>i.base.normalizeFieldPath(m)):t.partial?i.partial=Array.isArray(t.partial)?t.partial.map(m=>i.base.normalizeFieldPath(m)):t.partial:t.required&&(i.required=Array.isArray(t.required)?t.required.map(m=>i.base.normalizeFieldPath(m)):t.required);let s=ti(i.pick,i.omit),c=Array.isArray(i.partial)?i.partial.map(m=>m.toLowerCase()):i.partial,l=Array.isArray(i.required)?i.required.map(m=>m.toLowerCase()):i.required;for(let[m,T]of i.base.fieldEntries("*")){if(!s(m))continue;let w={...T};c===!0||Array.isArray(c)&&c.includes(T.name.toLowerCase())?w.required=!1:(l===!0||Array.isArray(l)&&l.includes(T.name.toLowerCase()))&&(w.required=!0);let E=new U(this,w);i._fields.set(E.name,E)}(!i.pick||i.base.additionalFields===!1||Array.isArray(i.base.additionalFields)&&((n=i.base.additionalFields)==null?void 0:n[0])==="error")&&(i.additionalFields=i.base.additionalFields),t.base.keyField&&s(t.base.keyField)&&(i.keyField=t.base.keyField),i.discriminatorField=t.base.discriminatorField,i.discriminatorValue=t.base.discriminatorValue}},"MappedType"),as=class as extends C{constructor(){super(...arguments);p(this,"omit");p(this,"pick");p(this,"partial");p(this,"required")}extendsFrom(t){var r;return t instanceof _||(t=this.node.getDataType(t)),t instanceof C?t===this?!0:!!((r=this.base)!=null&&r.extendsFrom(t)):!1}toJSON(t){let r=super.toJSON(t),i=this.base?this.node.getDataTypeNameWithNs(this.base):void 0;return Sl({...r,base:i||this.base.toJSON(t),kind:this.kind,pick:this.pick,omit:this.omit,partial:this.partial,required:this.required,discriminatorField:this.discriminatorField,discriminatorValue:this.discriminatorValue})}_locateBase(t){if(this.base){if(t(this.base))return this.base;if(this.base._locateBase)return this.base._locateBase(t)}}};a(as,"MappedTypeClass");var ss=as;tt.prototype=ss.prototype;tt._applyMixin=()=>{};import"reflect-metadata";import{omitUndefined as vl}from"@jsopen/objects";import{asMutable as Il}from"ts-gems";var zt=a(function(...o){if(!this)return zt[A].apply(void 0,o);let[e,t,r]=o;C.call(this,e,t,r);let i=Il(this);i.kind=u.MixinType.Kind,i.types=[];for(let n of t.types){i.additionalFields!==!0&&(n.additionalFields===!0?i.additionalFields=!0:i.additionalFields||(i.additionalFields=n.additionalFields));for(let s of n.fields("*")){let c=new U(this,s);i._fields.set(c.name,c)}i.types.push(n),n.keyField&&(i.keyField=n.keyField)}},"MixinType"),cs=class cs extends C{extendsFrom(e){if(e instanceof _||(e=this.node.getDataType(e)),!(e instanceof C))return!1;if(e===this)return!0;for(let t of this.types)if(t.extendsFrom(e))return!0;return!1}toJSON(e){let t=super.toJSON(e);return vl({...t,kind:this.kind,types:this.types.map(r=>{let i=this.node.getDataTypeNameWithNs(r);return i||r.toJSON(e)})})}_locateBase(e){for(let t of this.types){if(e(t))return t;if(t._locateBase){let r=t._locateBase(e);if(r)return r}}}};a(cs,"MixinTypeClass");var ps=cs;zt.prototype=ps.prototype;zt[A]=Ll;function Ll(o,e){if(o=o.filter(n=>typeof n=="function"),!o.length)throw new TypeError("No Class has been provided");if(o.length===1)return o[0];let t=o[0].name+"Mixin",r={[t]:class{constructor(){for(let n of o)Mr(this,n)}}}[t],i={...e,kind:u.MixinType.Kind,types:[]};Reflect.defineMetadata(y,i,r);for(let n of o){let s=Reflect.getMetadata(y,n);if(!(s&&(s.kind===u.ComplexType.Kind||s.kind===u.MixinType.Kind||s.kind===u.MappedType.Kind)))throw new TypeError(`Class "${n.name}" is not a ${u.ComplexType.Kind}, ${u.MixinType.Kind} or ${u.MappedType.Kind}`);i.types.push(n),Sr(r.prototype,n.prototype)}return r}a(Ll,"MixinTypeFactory");import"reflect-metadata";import{omitUndefined as kl}from"@jsopen/objects";import{asMutable as Pl}from"ts-gems";import{vg as Za}from"valgen";var Jt=a(function(...o){if(!this)return Jt[A].apply(void 0,o);let[e,t,r]=o;_.call(this,e,t,r);let i=Pl(this);i.kind=u.UnionType.Kind,i.discriminator=t.discriminator,i.types=[];for(let n of t.types)i.types.push(n)},"UnionType"),fs=class fs extends _{toJSON(e){let t=super.toJSON(e);return kl({...t,kind:this.kind,discriminator:this.discriminator,types:this.types.map(r=>{let i=this.node.getDataTypeNameWithNs(r);return i||r.toJSON(e)})})}generateCodec(e,t){let r=this.types.map(i=>{let n=i.generateCodec(e,t);return(i.kind===u.ComplexType.Kind||i.kind===u.MappedType.Kind)&&i.discriminatorField?[n,{[i.discriminatorField]:Za.isEqual(i.discriminatorValue)}]:n});return Za.oneOf(r)}extendsFrom(){return!1}_locateBase(){}};a(fs,"UnionTypeClass");var ls=fs;Jt.prototype=ls.prototype;Jt[A]=Fl;function Fl(o,e){let i=class i{};a(i,"UnionClass");let t=i,r={...e,kind:u.UnionType.Kind,types:o};return Reflect.defineMetadata(y,r,t),t}a(Fl,"UnionTypeFactory");var ms=Symbol("initializing"),ri=class ri{static async createDataType(e,t,r){e=e||new Te({maxErrors:0});let i=await this._importDataTypeArgs(e,t,r);if(i)return typeof i=="string"?t.node.getDataType(i):this._createDataType(e,t,i)}static async resolveDataType(e,t,r){if(r){let i=t.node.findDataType(r);if(i)return i}if(typeof r=="object"||typeof r=="function"){let i=await ri.createDataType(e,t,r);if(i)return i}if(r){let i=t.node.getDataType(r);if(i)return i}return t.node.getDataType("any")}static async addDataTypes(e,t,r){let i=t.node[L];if(!i)throw new TypeError("DocumentElement should has [kDataTypeMap] property");let n=await this.createAllDataTypes(e,t,r);if(n)for(let s of n)s!=null&&s.name&&i.set(s.name,s)}static async createAllDataTypes(e,t,r){e=e||new Te({maxErrors:0});let i=await this._prepareAllInitArgs(e,t,r);if(!i)return;let n=new S;for(let l of i)n.set(l.name,l);let s=e.extend({initArgsMap:n}),c=[];for(let[l,m]of n.entries())e.enter(`[${l}]`,()=>{if(!n.has(l))return;let T=this._createDataType(s,t,m);T&&c.push(T)});return c}static async _prepareAllInitArgs(e,t,r){let i=new S,n=new S,s=e.extend({owner:t,importQueue:i,initArgsMap:n});if(!t.node[L])throw new TypeError("DocumentElement should has [kDataTypeMap] property");if(Array.isArray(r)){let c=0;for(let l of r)await s.enterAsync(`$[${c++}]`,async()=>{l=await Z(l);let m=Reflect.getMetadata(y,l)||l[y];if(!(m&&m.name))return typeof l=="function"?s.addError(`Class "${l.name}" doesn't have a valid data type metadata`):s.addError("Object doesn't have a valid data type metadata");i.set(m.name,l)})}else{let c,l;for([l,c]of Object.entries(r))c=await Z(c),i.set(l,typeof c=="object"?{...c,name:l}:c)}for(let c of Array.from(i.keys())){if(!i.has(c))continue;let l=await this._importDataTypeArgs(s,t,c);l&&typeof l!="string"&&s.addError("Embedded data type can't be loaded into document node directly")}return Array.from(n.values())}static async _importDataTypeArgs(e,t,r,i){var w;r=await Z(r);let{importQueue:n,initArgsMap:s}=e,c=t.node.findDataType(r);if(c instanceof _)return c.name;let l,m,T;if(typeof r!="string"){let $=t.node.getDocument().types[vr].get(r);$&&(r=$)}if(typeof r=="string"){let E=r;if(r=(n==null?void 0:n.get(E))||((w=e.initArgsMap)==null?void 0:w.get(E)),!r)return e.addError(`Unknown data type (${E})`)}if(typeof r=="function"){if(l=Reflect.getMetadata(y,r),!l)return e.addError(`Class "${r.name}" doesn't have a valid DataType metadata`);m=r}else if(typeof r=="object"){if(l=r[y],l)T=r,l.kind!==u.EnumType.Kind&&(l=void 0);else if(u.isDataType(r))l=r,m=l.ctor;else if(m=Object.getPrototypeOf(r).constructor,l=m&&Reflect.getMetadata(y,m),l&&l.kind===u.SimpleType.Kind){let E=await this._importDataTypeArgs(e,t,l.name);return E?typeof E=="object"&&E.kind!==u.SimpleType.Kind?e.addError("Kind of base data type is not same"):{kind:u.SimpleType.Kind,name:void 0,base:E,properties:r}:void 0}}return l?e.enterAsync(l.name?`[${l.name}]`:"",async()=>{if(l.name){let $=s==null?void 0:s.get(l.name);if($)return i&&$[ms]?e.addError("Circular reference detected"):l.name}let E={kind:l.kind,name:l.name};E[ms]=!0;try{if(E.name)if(n!=null&&n.has(E.name))s==null||s.set(l.name,E),E._instance={name:l.name},E[L]=t.node[L];else return e.addError(`Data Type (${E.name}) must be explicitly added to type list in the document scope`);switch(E.kind){case u.ArrayType.Kind:await this._prepareArrayTypeArgs(e,t,E,l);break;case u.ComplexType.Kind:E.ctor=m,await this._prepareComplexTypeArgs(e,t,E,l);break;case u.EnumType.Kind:E.instance=T,await this._prepareEnumTypeArgs(e,t,E,l);break;case u.MappedType.Kind:await this._prepareMappedTypeArgs(e,t,E,l);break;case u.MixinType.Kind:await this._prepareMixinTypeArgs(e,t,E,l);break;case u.SimpleType.Kind:E.ctor=m,await this._prepareSimpleTypeArgs(e,t,E,l);break;case u.UnionType.Kind:await this._prepareUnionTypeArgs(e,t,E,l);break;default:return e.addError(`Invalid data type kind ${l.kind}`)}}finally{E.name&&(n==null||n.delete(E.name)),delete E[ms]}return n&&E.name?E.name:E}):e.addError("No DataType metadata found")}static async _prepareDataTypeArgs(e,t,r){t.description=r.description,t.abstract=r.abstract,t.examples=r.examples,t.scopePattern=r.scopePattern}static async _prepareArrayTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),await e.enterAsync(".type",async()=>{let n=await this._importDataTypeArgs(e,t,i.type);n&&(r.type=be(n))})}static async _prepareComplexTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),r.keyField=i.keyField,r.discriminatorField=i.discriminatorField,r.discriminatorValue=i.discriminatorValue,await e.enterAsync(".base",async()=>{let n;if(i.base)n=await this._importDataTypeArgs(e,t,i.base,!0);else if(r.ctor){let s=Object.getPrototypeOf(r.ctor.prototype).constructor;Reflect.hasMetadata(y,s)&&(n=await this._importDataTypeArgs(e,t,s))}n&&(r.base=be(n),r.ctor=r.ctor||n.ctor)}),i.additionalFields!=null&&(typeof i.additionalFields=="boolean"||Array.isArray(i.additionalFields)?r.additionalFields=i.additionalFields:await e.enterAsync(".additionalFields",async()=>{let n=await this._importDataTypeArgs(e,t,i.additionalFields);n&&(r.additionalFields=be(n))})),i.fields&&(r.fields={},await e.enterAsync(".fields",async()=>{for(let[n,s]of Object.entries(i.fields))await e.enterAsync(`[${n}]`,async()=>{let c=typeof s=="string"?{type:s}:s;if(c.isArray&&!c.type)return e.addError('"type" must be defined explicitly for array fields');let l=await this._importDataTypeArgs(e,t,c.type||"any");l&&(r.fields[n]={...c,type:be(l)})})}))}static async _prepareEnumTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),i.base&&await e.enterAsync(".base",async()=>{let n=await this._importDataTypeArgs(e,t,i.base);n&&(r.base=be(n))}),r.attributes=k(i.attributes)}static async _prepareSimpleTypeArgs(e,t,r,i){var n,s,c,l;await this._prepareDataTypeArgs(e,r,i),await e.enterAsync(".base",async()=>{let m;if(i.base)m=await this._importDataTypeArgs(e,t,i.base,!0);else if(r.ctor){let T=Object.getPrototypeOf(r.ctor.prototype).constructor;Reflect.hasMetadata(y,T)&&(m=await this._importDataTypeArgs(e,t,T))}m&&(r.base=be(m),r.ctor=r.ctor||m.ctor)}),r.properties=i.properties,r.nameMappings=i.nameMappings,!r.properties&&r.ctor&&(r.properties=new r.ctor),i.attributes&&(r.attributes=k(i.attributes)),typeof((n=r.properties)==null?void 0:n[x])=="function"&&(r.generateDecoder=(s=r.properties)==null?void 0:s[x].bind(r.properties)),typeof((c=r.properties)==null?void 0:c[g])=="function"&&(r.generateEncoder=(l=r.properties)==null?void 0:l[g].bind(r.properties))}static async _prepareMappedTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),r.discriminatorField=i.discriminatorField,r.discriminatorValue=i.discriminatorValue,await e.enterAsync(".base",async()=>{let n;if(i.base)n=await this._importDataTypeArgs(e,t,i.base,!0);else if(r.ctor){let s=Object.getPrototypeOf(r.ctor.prototype).constructor;Reflect.hasMetadata(y,s)&&(n=await this._importDataTypeArgs(e,t,s))}n&&(r.base=be(n),r.ctor=r.ctor||n.ctor)}),i.pick?r.pick=[...i.pick]:i.omit?r.omit=[...i.omit]:i.partial?r.partial=Array.isArray(i.partial)?[...i.partial]:i.partial:i.required&&(r.required=Array.isArray(i.required)?[...i.required]:i.required)}static async _prepareMixinTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),r.types=[],await e.enterAsync(".types",async()=>{let n=i.types,s=0;for(let c of n)await e.enterAsync(`[${s++}]`,async()=>{let l=await this._importDataTypeArgs(e,t,c);l&&r.types.push(be(l))})})}static async _prepareUnionTypeArgs(e,t,r,i){await this._prepareDataTypeArgs(e,r,i),r.types=[],await e.enterAsync(".types",async()=>{let n=i.types,s=0;for(let c of n)await e.enterAsync(`[${s++}]`,async()=>{let l=await this._importDataTypeArgs(e,t,c);l&&r.types.push(be(l))})})}static _createDataType(e,t,r){var s;let i=t.node.findDataType(typeof r=="string"?r:r.name||"");if(i instanceof _)return i;let n=typeof r=="string"?(s=e.initArgsMap)==null?void 0:s.get(r):r;if(n){let c=n[L];switch(c||delete n._instance,i=n._instance,i!=null&&i.name&&c&&c.set(i.name,i),n==null?void 0:n.kind){case u.ArrayType.Kind:return this._createArrayType(e,t,n);case u.ComplexType.Kind:return this._createComplexType(e,t,n);case u.EnumType.Kind:return this._createEnumType(e,t,n);case u.MappedType.Kind:return this._createMappedType(e,t,n);case u.MixinType.Kind:return this._createMixinType(e,t,n);case u.SimpleType.Kind:return this._createSimpleType(e,t,n);case u.UnionType.Kind:return this._createUnionType(e,t,n);default:break}}e.addError(`Unknown data type (${String(r)})`)}static _createArrayType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,de.prototype);let n=k(r);return r.type&&e.enter(".type",()=>{n.type=this._createDataType(e,t,r.type)}),de.apply(i,[t,n]),i}static _createComplexType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,ie.prototype);let n=k(r);return r.base&&e.enter(".base",()=>{n.base=this._createDataType(e,t,r.base)}),r.additionalFields&&e.enter(".additionalFields",()=>{typeof r.additionalFields=="boolean"||Array.isArray(r.additionalFields)?n.additionalFields=r.additionalFields:n.additionalFields=this._createDataType(e,t,r.additionalFields)}),n.fields={},r.fields&&e.enter(".fields",()=>{for(let[s,c]of Object.entries(r.fields))e.enter(`[${s}]`,()=>{let l=this._createDataType(e,t,c.type);l&&(n.fields[s]={...c,name:s,type:l})})}),ie.apply(i,[t,n]),i}static _createEnumType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,ee.prototype);let n=k(r);return r.base&&e.enter(".base",()=>{n.base=this._createDataType(e,t,r.base)}),n.attributes=r.attributes,ee.apply(i,[t,n]),i}static _createMappedType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,tt.prototype);let n=k(r);return r.base&&e.enter(".base",()=>{n.base=this._createDataType(e,t,r.base)}),tt.apply(i,[t,n]),i}static _createMixinType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,zt.prototype);let n=k(r);return r.types&&e.enter(".types",()=>{n.types=[];let s=0;for(let c of r.types)e.enter(`[${s++}]`,()=>{let l=this._createDataType(e,t,c);if(!(l instanceof C))throw new TypeError(`"${l==null?void 0:l.kind}" can't be set as base for a "${n.kind}"`);n.types.push(l)})}),zt.apply(i,[t,n]),i}static _createSimpleType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,d.prototype);let n=k(r);return r.base&&e.enter(".base",()=>{n.base=this._createDataType(e,t,r.base)}),d.apply(i,[t,n]),i}static _createUnionType(e,t,r){let i=r._instance||{};Object.setPrototypeOf(i,Jt.prototype);let n=k(r);return r.types&&e.enter(".types",()=>{n.types=[];let s=0;for(let c of r.types)e.enter(`[${s++}]`,()=>{let l=this._createDataType(e,t,c);n.types.push(l)})}),Jt.apply(i,[t,n]),i}};a(ri,"DataTypeFactory");var M=ri;function be(o){return typeof o=="object"&&o.name?o.name:o}a(be,"preferName");import{isConstructor as nf}from"@jsopen/objects";import{omitUndefined as Cl}from"@jsopen/objects";var us=class us extends O{constructor(t){super(t.owner);p(this,"name","OpraApi");p(this,"description");this.name=t.name,this.description=t.description}toJSON(t){return Cl({transport:this.transport,name:this.name,description:this.description})}async _initialize(t,r){if(!F.test(t.name))throw new TypeError(`Invalid api name (${t.name})`);this.name=t.name,this.description=t==null?void 0:t.description}};a(us,"ApiBase");var je=us;import ql from"path-browserify";import{omitUndefined as Bl}from"@jsopen/objects";import{asMutable as Kl}from"ts-gems";import{merge as ds,omit as Ul}from"@jsopen/objects";var $l=/^(.*)(Controller)$/;function hs(o){let e=[],t=a(function(r){var l;let i=o==null?void 0:o.name;i||(i=((l=$l.exec(r.name))==null?void 0:l[1])||r.name);let n={},s=Reflect.getOwnMetadata(ae,Object.getPrototypeOf(r));s&&ds(n,s,{deep:!0});let c=Reflect.getOwnMetadata(ae,r);c&&ds(n,c,{deep:!0}),ds(n,{kind:u.HttpController.Kind,name:i,path:i,...Ul(o,["kind","name","instance","endpoints","key"])},{deep:!0}),Reflect.defineMetadata(ae,n,r);for(let m of e)m(n,r);Reflect.defineMetadata(ae,n,r)},"decorator");return t.Cookie=(r,i)=>(e.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"cookie",type:i}:{...i,name:r,location:"cookie"};n.parameters=n.parameters||[],n.parameters.push(s)}),t),t.Header=(r,i)=>(e.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"header",type:i}:{...i,name:r,location:"header"};n.parameters=n.parameters||[],n.parameters.push(s)}),t),t.QueryParam=(r,i)=>(e.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"query",type:i}:{...i,name:r,location:"query"};n.parameters=n.parameters||[],n.parameters.push(s)}),t),t.PathParam=(r,i)=>(e.push(n=>{let s=typeof i=="string"||typeof i=="function"?{name:r,location:"path",type:i}:{...i,name:r,location:"path"};n.parameters=n.parameters||[],n.parameters.push(s)}),t),t.KeyParam=(r,i)=>(e.push(n=>{var c;(c=n.path)!=null&&c.includes(":"+r)||(n.path=(n.path||"")+"@:"+r);let s=typeof i=="string"||typeof i=="function"?{name:r,location:"path",type:i,keyParam:!0}:{...i,name:r,location:"path",keyParam:!0};n.parameters=n.parameters||[],n.parameters.push(s)}),t),t.UseType=(...r)=>(e.push(i=>{i.types=i.types||[],i.types.push(...r)}),t),t}a(hs,"HttpControllerDecoratorFactory");var se=a(function(...o){var i;if(!this)return se[A].apply(void 0,o);let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid resource name (${t.name})`);let r=Kl(this);r.kind=u.HttpController.Kind,r.types=r.node[L]=new W,r.operations=new S,r.controllers=new S,r.parameters=[],r.name=t.name,r.description=t.description,r.path=t.path??t.name,r.instance=t.instance,r.ctor=t.ctor,r._controllerReverseMap=new WeakMap,(i=r._initialize)==null||i.call(r,t)},"HttpController"),Ts=class Ts extends O{get isRoot(){return!(this.owner instanceof se)}findController(e){if(typeof e=="function"){let t=this._controllerReverseMap.get(e);if(t!=null)return t;for(let r of this.controllers.values()){if(r.ctor===e)return this._controllerReverseMap.set(e,r),r;if(r.controllers.size&&(t=r.findController(e),t))return this._controllerReverseMap.set(e,t),t}this._controllerReverseMap.set(e,null);return}if(e.startsWith("/")&&(e=e.substring(1)),e.includes("/")){let t=e.split("/"),r=this;for(;r&&t.length>0;)r=r.controllers.get(t.shift());return r}return this.controllers.get(e)}findParameter(e,t){let r=e.toLowerCase(),i;for(i of this.parameters)if(!(t&&t!==i.location)&&(typeof i.name=="string"&&(i._nameLower=i._nameLower||i.name.toLowerCase(),i._nameLower===r)||i.name instanceof RegExp&&i.name.test(e)))return i;if(this.node.parent&&this.node.parent.element instanceof se)return this.node.parent.element.findParameter(e,t)}getFullUrl(){return ql.posix.join(this.owner instanceof se?this.owner.getFullUrl():"/",this.path)}toString(){return`[HttpController ${this.name}]`}toJSON(e){let t=Bl({kind:this.kind,description:this.description,path:this.path});if(this.operations.size){t.operations={};for(let r of this.operations.values())t.operations[r.name]=r.toJSON(e)}if(this.controllers.size){t.controllers={};for(let r of this.controllers.values())t.controllers[r.name]=r.toJSON(e)}if(this.types.size){t.types={};for(let r of this.types.values())t.types[r.name]=r.toJSON(e)}if(this.parameters.length){t.parameters=[];for(let r of this.parameters)t.parameters.push(r.toJSON(e))}return t}[Me](){return`[${ve}HttpController${Ie+this.name+Oe}]`}};a(Ts,"HttpControllerClass");var ys=Ts;se.prototype=ys.prototype;Object.assign(se,hs);se[A]=hs;var Es=class Es extends je{constructor(t){super(t);p(this,"_controllerReverseMap",new WeakMap);p(this,"transport","http");p(this,"controllers",new S);p(this,"url");this.url=t.url}findController(t){return se.prototype.findController.call(this,t)}findOperation(t,r){let i=this.findController(t);return i==null?void 0:i.operations.get(r)}toJSON(t){let i={...super.toJSON(),transport:this.transport,url:this.url,controllers:{}};for(let n of this.controllers.values())i.controllers[n.name]=n.toJSON(t);return i}};a(Es,"HttpApi");var rt=Es;import Vl from"@browsery/type-is";import{omitUndefined as Wl}from"@jsopen/objects";import{asMutable as zl}from"ts-gems";import{isAny as Jl,vg as Yl}from"valgen";var Ce=a(function(o,e){if(!this)throw new TypeError('"this" should be passed to call class constructor');O.call(this,o);let t=zl(this);if(e.contentType){let r=Array.isArray(e.contentType)?e.contentType:[e.contentType];r=r.map(i=>i.split(/\s*,\s*/)).flat(),t.contentType=r.length>1?r:r[0]}t.description=e.description,t.contentEncoding=e.contentEncoding,t.examples=e.examples,t.multipartFields=[],t.maxFieldsSize=e.maxFieldsSize,t.maxFields=e.maxFields,t.maxFiles=e.maxFiles,t.maxFileSize=e.maxFileSize,t.maxTotalFileSize=e.maxTotalFileSize,e!=null&&e.type&&(t.type=(e==null?void 0:e.type)instanceof _?e.type:t.owner.node.getDataType(e.type)),t.isArray=e.isArray,t.designType=e.designType},"HttpMediaType"),xs=class xs extends O{findMultipartField(e,t){if(this.multipartFields){for(let r of this.multipartFields)if((!t||t===r.fieldType)&&(r.fieldName instanceof RegExp&&r.fieldName.test(e)||r.fieldName===e))return r}}toJSON(e){var i,n;let t=this.type?this.node.getDataTypeNameWithNs(this.type):void 0,r=Wl({description:this.description,contentType:this.contentType,contentEncoding:this.contentEncoding,type:t||((i=this.type)==null?void 0:i.toJSON(e)),isArray:this.isArray,example:this.example,examples:this.examples,maxFields:this.maxFields,maxFieldsSize:this.maxFieldsSize,maxFiles:this.maxFiles,maxFileSize:this.maxFileSize,maxTotalFileSize:this.maxTotalFileSize});return(n=this.multipartFields)!=null&&n.length&&(r.multipartFields=this.multipartFields.map(s=>s.toJSON(e))),r}generateCodec(e,t,r){let i;return this.type?i=this.type.generateCodec(e,t,{designType:this.designType}):this.contentType&&(Array.isArray(this.contentType)?this.contentType:[this.contentType]).find(s=>Vl.is(s,["json"]))&&(i=this.node.findDataType("object").generateCodec(e,t,{...r,designType:this.designType})),i=i||Jl,this.isArray&&!(this.type instanceof de)?Yl.isArray(i):i}};a(xs,"HttpMediaTypeClass");var _s=xs;Ce.prototype=_s.prototype;import{omitUndefined as Ql}from"@jsopen/objects";function Ue(o,e){let t=o.lastIndexOf("/");if(o.startsWith("/")&&t){let r=o.substring(1,t),i=o.substring(t+1);if(e!=null&&e.includeFlags)for(let n of e.includeFlags)i.includes(n)||(i+=n);if(e!=null&&e.excludeFlags)for(let n of e.excludeFlags)i.replace(n,"");return new RegExp(r,i)}throw new TypeError(`"${o}" is not a valid RegExp string`)}a(Ue,"parseRegExp");var gs=class gs extends Ce{constructor(t,r){super(t,r);p(this,"fieldName");p(this,"fieldType");p(this,"required");this.fieldName=r.fieldName instanceof RegExp?r.fieldName:r.fieldName.startsWith("/")?Ue(r.fieldName):r.fieldName,this.fieldType=r.fieldType,this.required=r.required}toJSON(t){return Ql({fieldName:this.fieldName,fieldType:this.fieldType,required:this.required,...super.toJSON(t)})}};a(gs,"HttpMultipartField");var ii=gs;import{omitUndefined as Xl}from"@jsopen/objects";var Gl=/^([1-6]\d{2})(?:-([1-6]\d{2}))?$/,ws=class ws{constructor(e,t){p(this,"start",0);p(this,"end",0);if(e&&typeof e=="object"&&(this.start=e.start||0,this.end=e.end||0),typeof e=="number"&&(this.start=e,this.end=t||this.start),typeof e=="string"){let r=Gl.exec(e);if(!r)throw new TypeError(`"${e}" is not a valid Status Code range`);this.start=parseInt(r[1],10),this.end=r[2]?parseInt(r[2],10):this.start}}includes(e){return e>=this.start&&e<=this.end}intersects(e,t){return t>=this.start&&e<=this.end}toString(){return this.start===this.end?String(this.start):String(this.start)+"-"+String(this.end)}toJSON(){return!this.end||this.start===this.end?this.start:{start:this.start,end:this.end}}};a(ws,"HttpStatusRange");var wr=ws;var As=class As extends Ce{constructor(t,r){super(t,r);p(this,"statusCode");p(this,"parameters");p(this,"partial");this.parameters=[],this.statusCode=(Array.isArray(r.statusCode)?r.statusCode:[r.statusCode]).map(i=>typeof i=="object"?new wr(i.start,i.end):new wr(i)),this.partial=r.partial}findParameter(t,r){t=t.toLowerCase();for(let i of this.parameters)if((!r||r===i.location)&&(i.name instanceof RegExp&&i.name.test(t)||i.name===t))return i}toJSON(t){let r=this.statusCode.map(n=>n.toJSON()),i=Xl({...super.toJSON(t),statusCode:r.length===1&&typeof r[0]=="number"?r[0]:r,partial:this.partial});if(this.parameters.length){i.parameters=[];for(let n of this.parameters)i.parameters.push(n.toJSON(t))}return i}};a(As,"HttpOperationResponse");var oi=As;import{omitUndefined as ef}from"@jsopen/objects";import{asMutable as tf}from"ts-gems";import{vg as rf}from"valgen";import{omitUndefined as Zl}from"@jsopen/objects";import{asMutable as Hl}from"ts-gems";var it=a(function(o,e){if(!this)throw new TypeError('"this" should be passed to call class constructor');O.call(this,o);let t=Hl(this);t.description=e.description,t.type=e.type,t.examples=e.examples,t.isArray=e.isArray},"Value"),Rs=class Rs extends O{constructor(){super(...arguments);p(this,"type");p(this,"description");p(this,"examples");p(this,"isArray")}toJSON(t){let r=this.type?this.node.getDataTypeNameWithNs(this.type):void 0;return Zl({type:this.type?r||this.type.toJSON(t):"any",description:this.description,isArray:this.isArray,examples:this.examples})}};a(Rs,"ValueClass");var Os=Rs;it.prototype=Os.prototype;var Ar=a(function(o,e){if(!this)throw new TypeError('"this" should be passed to call class constructor');it.call(this,o,e);let t=tf(this);e.name&&(t.name=e.name instanceof RegExp?e.name:e.name.startsWith("/")?Ue(e.name,{includeFlags:"i",excludeFlags:"m"}):e.name),t.location=e.location,t.deprecated=e.deprecated,t.required=e.required,t.required==null&&e.location==="path"&&(t.required=!0),t.arraySeparator=e.arraySeparator,t.keyParam=e.keyParam,t.parser=e.parser,t.designType=e.designType},"HttpParameter"),Ds=class Ds extends it{toJSON(e){return ef({...super.toJSON(e),name:this.name,location:this.location,arraySeparator:this.arraySeparator,keyParam:this.keyParam,required:this.required,deprecated:this.deprecated})}generateCodec(e,t,r){var i;return((i=this.type)==null?void 0:i.generateCodec(e,t,{...r,designType:this.designType}))||rf.isAny()}};a(Ds,"HttpParameterClass");var bs=Ds;Ar.prototype=bs.prototype;import{omitUndefined as of}from"@jsopen/objects";var Ns=class Ns extends O{constructor(t){super(t);p(this,"description");p(this,"content",[]);p(this,"required");p(this,"maxContentSize");p(this,"immediateFetch");p(this,"partial");p(this,"allowPatchOperators");p(this,"keepKeyFields")}toJSON(t){return of({description:this.description,required:this.required,maxContentSize:this.maxContentSize,content:this.content.length?this.content.map(r=>r.toJSON(t)):[],partial:this.partial,allowPatchOperators:this.allowPatchOperators})}};a(Ns,"HttpRequestBody");var ni=Ns;var Ss=class Ss{static async createApi(e,t){let r=new rt(t);return t.controllers&&await e.enterAsync(".controllers",async()=>{await this._createControllers(e,r,t.controllers)}),r}static async _createControllers(e,t,r){if(Array.isArray(r)){let i=0;for(let n of r){let s;await e.enterAsync(`[${i++}]`,async()=>{s=await this._resolveControllerMetadata(e,t,n)}),s&&await e.enterAsync(`[${s.metadata.name}]`,async()=>{let c=await this._createController(e,t,s.metadata,s.instance,s.ctor);c&&(t.controllers.get(c.name)&&e.addError(`Duplicate controller name (${s.name})`),t.controllers.set(c.name,c))})}return}for(let[i,n]of Object.entries(r))await e.enterAsync(`[${i}]`,async()=>{let s=await this._resolveControllerMetadata(e,t,n);if(!s)return;let c=await this._createController(e,t,{...s.metadata,name:i},s.instance,s.ctor);c&&(t.controllers.get(c.name)&&e.addError(`Duplicate controller name (${i})`),t.controllers.set(c.name,c))})}static async _resolveControllerMetadata(e,t,r){typeof r=="function"&&!nf(r)&&(r=t instanceof se?r(t.instance):r()),r=await Z(r);let i,n,s;if(typeof r=="function"){if(n=Reflect.getMetadata(ae,r),!n)return e.addError(`Class "${r.name}" doesn't have a valid HttpController metadata`);i=r}else i=Object.getPrototypeOf(r).constructor,n=Reflect.getMetadata(ae,i),n?s=r:(n=r,r.instance==="object"&&(s=r.instance,i=Object.getPrototypeOf(s).constructor));return n?{metadata:n,instance:s,ctor:i}:e.addError(`Class "${i.name}" is not decorated with HttpController()`)}static async _createController(e,t,r,i,n){if(!r.name)throw new TypeError("Controller name required");let s=new se(t,{...r,instance:i,ctor:n});return r.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,s,r.types)}),r.parameters&&await e.enterAsync(".parameters",async()=>{let c=0;for(let l of r.parameters)await e.enterAsync(`[${c++}]`,async()=>{let m={...l};await e.enterAsync(".type",async()=>{m.type=await M.resolveDataType(e,s,l.type)});let T=new Ar(s,m);s.parameters.push(T)})}),r.operations&&await e.enterAsync(".operations",async()=>{for(let[c,l]of Object.entries(r.operations))await e.enterAsync(`[${c}]`,async()=>{let m=new b(s,{name:c,method:"GET"});await this._initHttpOperation(e,m,l),s.operations.set(c,m)})}),r.controllers&&await e.enterAsync(".controllers",async()=>{await this._createControllers(e,s,r.controllers)}),s}static async _initHttpOperation(e,t,r){let i={...r,name:t.name,types:void 0};return b.apply(t,[t.owner,i]),r.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,t,r.types)}),r.parameters&&await e.enterAsync(".parameters",async()=>{let n=0;for(let s of r.parameters)await e.enterAsync(`[${n++}]`,async()=>{let c={...s};await e.enterAsync(".type",async()=>{c.type=await M.resolveDataType(e,t,s.type)});let l=new Ar(t,c);t.parameters.push(l)})}),r.responses&&await e.enterAsync(".responses",async()=>{let n=0;for(let s of r.responses)await e.enterAsync(`[${n++}]`,async()=>{let c=new oi(t,{statusCode:s.statusCode});await this._initHttpOperationResponse(e,c,s),t.responses.push(c)})}),r.requestBody&&await e.enterAsync(".requestBody",async()=>{let n=new ni(t);await this._initHttpRequestBody(e,n,r.requestBody),t.requestBody=n}),t}static async _initHttpMediaType(e,t,r){Ce.call(t,t.owner,{...r,type:void 0,multipartFields:void 0}),r.type&&await e.enterAsync(".type",async()=>{t.type=await M.resolveDataType(e,t,r.type)}),r.multipartFields&&await e.enterAsync(".multipartFields",async()=>{for(let i=0;i<r.multipartFields.length;i++)await e.enterAsync(`[${i}]`,async()=>{let n=r.multipartFields[i],s=new ii(t,{fieldName:n.fieldName,fieldType:n.fieldType});await this._initHttpMediaType(e,s,n),t.multipartFields.push(s)})})}static async _initHttpOperationResponse(e,t,r){await this._initHttpMediaType(e,t,r),t.partial=r.partial,r.parameters&&await e.enterAsync(".parameters",async()=>{let i=0;for(let n of r.parameters)await e.enterAsync(`[${i++}]`,async()=>{let s={...n};await e.enterAsync(".type",async()=>{s.type=await M.resolveDataType(e,t,n.type)});let c=new Ar(t,s);t.parameters.push(c)})})}static async _initHttpRequestBody(e,t,r){t.description=r.description,t.required=r.required,t.maxContentSize=r.maxContentSize,t.immediateFetch=r.immediateFetch,t.partial=r.partial,t.allowPatchOperators=r.allowPatchOperators,t.keepKeyFields=r.keepKeyFields,r.content&&await e.enterAsync(".content",async()=>{for(let i=0;i<r.content.length;i++)await e.enterAsync(`[${i}]`,async()=>{let n=r.content[i],s=new Ce(t,String(i));await this._initHttpMediaType(e,s,n),t.content.push(s)})})}};a(Ss,"HttpApiFactory");var Yt=Ss;import{omitUndefined as af}from"@jsopen/objects";import{md5 as pf}from"super-fast-md5";var Ms=class Ms extends je{constructor(t){super(t);p(this,"_controllerReverseMap",new WeakMap);p(this,"transport","mq");p(this,"platform");p(this,"controllers",new S);this.platform=t.platform}findController(t){if(typeof t=="function"){let r=this._controllerReverseMap.get(t);if(r!=null)return r;for(let i of this.controllers.values())if(i.ctor===t)return this._controllerReverseMap.set(t,i),i;this._controllerReverseMap.set(t,null);return}return this.controllers.get(t)}findOperation(t,r){let i=this.findController(t);return i==null?void 0:i.operations.get(r)}toJSON(){let r={...super.toJSON(),transport:this.transport,platform:this.platform,controllers:{}};for(let i of this.controllers.values())r.controllers[i.name]=i.toJSON();return r}};a(Ms,"MQApi");var ot=Ms;var vs=class vs extends je{constructor(t){super(t);p(this,"_controllerReverseMap",new WeakMap);p(this,"transport","ws");p(this,"controllers",new S)}findController(t){if(typeof t=="function"){let r=this._controllerReverseMap.get(t);if(r!=null)return r;for(let i of this.controllers.values())if(i.ctor===t)return this._controllerReverseMap.set(t,i),i;this._controllerReverseMap.set(t,null);return}return this.controllers.get(t)}findOperation(t,r){let i=this.findController(t);return i==null?void 0:i.operations.get(r)}toJSON(){let r={...super.toJSON(),transport:this.transport,controllers:{}};for(let i of this.controllers.values())r.controllers[i.name]=i.toJSON();return r}};a(vs,"WSApi");var nt=vs;var Ha,ep,Is=class Is extends(ep=O,Ha=De,ep){constructor(){super(null);p(this,Ha,new WeakMap);p(this,"id","");p(this,"url");p(this,"info",{});p(this,"references",new S);p(this,"types",new W);p(this,"api");this.node[L]=this.types,this.node.findDataType=this._findDataType.bind(this)}getDataTypeNs(t){let r=t instanceof _?this._findDataType(t.name||""):this._findDataType(t);if(r)return this[De].get(r)}findDocument(t){if(this.id===t)return this;for(let r of this.references.values()){if(r.id===t)return r;let i=r.findDocument(t);if(i)return i}}get httpApi(){if(this.api&&this.api instanceof rt)return this.api}get mqApi(){if(this.api&&this.api instanceof ot)return this.api}get wsApi(){if(this.api&&this.api instanceof nt)return this.api}getHttpApi(){if(!(this.api&&this.api instanceof rt))throw new TypeError("The document do not contains HttpApi instance");return this.api}getMqApi(){if(!(this.api&&this.api instanceof ot))throw new TypeError("The document do not contains MQApi instance");return this.api}getWsApi(){if(!(this.api&&this.api instanceof nt))throw new TypeError("The document do not contains WSApi instance");return this.api}toJSON(){return this.export()}export(t){let r=af({spec:u.SpecVersion,id:this.id,url:this.url,info:k(this.info,!0)});if(this.references.size){let i=0,n={};for(let[s,c]of this.references.entries())c[Ke]||(n[s]={id:c.id,url:c.url,info:k(c.info,!0)},i++);i&&(r.references=n)}if(this.types.size){r.types={};for(let i of this.types.values())i.inScope(t==null?void 0:t.scope)&&(r.types[i.name]=i.toJSON(t))}return this.api&&(r.api=this.api.toJSON(t)),r}invalidate(){let t=this.export({});delete t.id,this.id=pf(JSON.stringify(t)),this[De]=new WeakMap}_findDataType(t,r,i){let n=this.types.get(t);if(n&&n.inScope(r))return n;if(!this.references.size)return;if(typeof t=="string"){let c=la.exec(t);if(c){let l=c[1];if(l){let m=this.references.get(l);return m?(i=i||new WeakMap,i.set(this,!0),i.set(m,!0),m._findDataType(c[2],r,i)):void 0}t=c[2]}}i=i||new WeakMap,i.set(this,!0);let s=Array.from(this.references.keys()).reverse();for(let c of s){let l=this.references.get(c);if(n=l==null?void 0:l.types.get(t),n)return this[De].set(n,l!=null&&l[Ke]?"":c),n}for(let c of s){let l=this.references.get(c);if(i.set(l,!0),n=l._findDataType(t,r,i),n)return this[De].set(n,l!=null&&l[Ke]?"":c),n}}};a(Is,"ApiDocument");var st=Is;function $e(o,e,t){let r=ti(e.pick,e.omit),i=typeof o=="string"?o.charAt(0).toUpperCase()+o.substring(1):o.name,n=(t==null?void 0:t.name)||i+"Mapped",s={[n]:class{constructor(){typeof o=="function"&&Mr(this,o,r)}}}[n];if(typeof o=="function"&&Sr(s.prototype,o.prototype),typeof o=="function"){let l=Reflect.getOwnMetadata(y,o);if(!l)throw new TypeError(`Class "${o}" doesn't have datatype metadata information`);if(!(l.kind===u.ComplexType.Kind||l.kind===u.MappedType.Kind||l.kind===u.MixinType.Kind))throw new TypeError(`Class "${o}" is not a ${u.ComplexType.Kind}`)}let c={...t,kind:"MappedType",base:o};return e.pick&&(c.pick=e.pick),e.omit&&(c.omit=e.omit),e.partial&&(c.partial=e.partial),e.required&&(c.required=e.required),Reflect.defineMetadata(y,c,s),typeof o=="function"&&tt._applyMixin(s,o,{...e,isInheritedPredicate:r}),s}a($e,"createMappedClass");function Fg(o,e,t){return $e(o,{omit:e},t)}a(Fg,"OmitType");function $g(o,...e){let t=Array.isArray(e[0])?e[0]:!0,r=Array.isArray(e[0])?e[1]:e[0];return $e(o,{partial:t},r)}a($g,"PartialType");function Vg(o,e,t){return $e(o,{pick:e},t)}a(Vg,"PickType");function Yg(o,...e){let t=Array.isArray(e[0])?e[0]:!0,r=Array.isArray(e[0])?e[1]:e[0];return $e(o,{required:t},r)}a(Yg,"RequiredType");function Zg(o,e){return(t,r,i)=>{if(typeof r!="string")throw new TypeError("Un-named properties can not be decorated");if(!o&&(o=Reflect.getMetadata("design:paramtypes",t,r)[i],!o))throw new TypeError("Missing parameter type");let n=Reflect.getOwnMetadata(Zt,t,r);n||(n=[],Reflect.defineMetadata(Zt,n,t,r)),n.push({...e,type:o,parameterIndex:i})}}a(Zg,"WsParam");import{isConstructor as Tf}from"@jsopen/objects";import{omitUndefined as cf}from"@jsopen/objects";import{asMutable as lf}from"ts-gems";var at=a(function(...o){var i;if(!this)return at[A].apply(void 0,o);let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid resource name (${t.name})`);let r=lf(this);r.kind=u.MQController.Kind,r.types=r.node[L]=new W,r.operations=new S,r.headers=[],r.name=t.name,r.description=t.description,r.instance=t.instance,r.ctor=t.ctor,r._controllerReverseMap=new WeakMap,(i=r._initialize)==null||i.call(r,t)},"MQController"),ks=class ks extends O{findHeader(e,t){let r=e.toLowerCase(),i;for(i of this.headers)if(typeof i.name=="string"&&(i._nameLower=i._nameLower||i.name.toLowerCase(),i._nameLower===r)||i.name instanceof RegExp&&i.name.test(e))return i;if(this.node.parent&&this.node.parent.element instanceof at)return this.node.parent.element.findHeader(e,t)}toString(){return`[MQController ${this.name}]`}toJSON(){let e=cf({kind:this.kind,description:this.description});if(this.operations.size){e.operations={};for(let t of this.operations.values())e.operations[t.name]=t.toJSON()}if(this.types.size){e.types={};for(let t of this.types.values())e.types[t.name]=t.toJSON()}if(this.headers.length){e.headers=[];for(let t of this.headers)e.headers.push(t.toJSON())}return e}[Me](){return`[${ve}MQController${Ie+this.name+Oe}]`}};a(ks,"MQControllerClass");var Ls=ks;at.prototype=Ls.prototype;Object.assign(at,Vt);at[A]=Vt;import{omitUndefined as ff}from"@jsopen/objects";import{asMutable as mf}from"ts-gems";import{vg as uf}from"valgen";var Or=a(function(o,e){if(!this)throw new TypeError('"this" should be passed to call class constructor');it.call(this,o,e);let t=mf(this);e.name&&(t.name=e.name instanceof RegExp?e.name:e.name.startsWith("/")?Ue(e.name,{includeFlags:"i",excludeFlags:"m"}):e.name),t.deprecated=e.deprecated,t.required=e.required,t.designType=e.designType},"MQHeader"),Fs=class Fs extends it{toJSON(){return ff({...super.toJSON(),name:this.name,required:this.required,deprecated:this.deprecated})}generateCodec(e,t,r){var i;return((i=this.type)==null?void 0:i.generateCodec(e,t,{...r,designType:this.designType}))||uf.isAny()}};a(Fs,"MQHeaderClass");var Ps=Fs;Or.prototype=Ps.prototype;import{omitUndefined as df}from"@jsopen/objects";import{asMutable as hf}from"ts-gems";import{vg as tp}from"valgen";var Rr=a(function(...o){if(!this){let[i,n]=o,s=[];return Rr[A].call(void 0,s,i,n)}let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid operation name (${t.name})`);let r=hf(this);r.headers=[],r.types=r.node[L]=new W,r.name=t.name,r.description=t.description,r.channel=t.channel,t!=null&&t.type&&(r.type=(t==null?void 0:t.type)instanceof _?t.type:r.owner.node.getDataType(t.type)),t!=null&&t.keyType&&(r.keyType=(t==null?void 0:t.keyType)instanceof _?t.keyType:r.owner.node.getDataType(t.keyType)),r.designType=t.designType,r.keyDesignType=t.keyDesignType},"MQOperation"),Cs=class Cs extends O{findHeader(e){let t=e.toLowerCase(),r;for(r of this.headers)if(typeof r.name=="string"&&(r._nameLower=r._nameLower||r.name.toLowerCase(),r._nameLower===t)||r.name instanceof RegExp&&r.name.test(e))return r}toJSON(){var t;let e=df({kind:u.MQOperation.Kind,description:this.description,channel:this.channel,type:this.type.name?this.type.name:this.type.toJSON(),keyType:this.keyType?this.keyType.name?this.keyType.name:this.keyType.toJSON():void 0,response:(t=this.response)==null?void 0:t.toJSON()});if(this.headers.length){e.headers=[];for(let r of this.headers)e.headers.push(r.toJSON())}return e}generateCodec(e,t,r){var i;return((i=this.type)==null?void 0:i.generateCodec(e,t,{...r,designType:this.designType}))||tp.isAny()}generateKeyCodec(e,t,r){var i;return((i=this.keyType)==null?void 0:i.generateCodec(e,t,{...r,designType:this.keyDesignType}))||tp.isAny()}};a(Cs,"MQOperationClass");var js=Cs;Rr.prototype=js.prototype;Rr[A]=xr;import{omitUndefined as yf}from"@jsopen/objects";var Us=class Us extends O{constructor(t,r){super(t);p(this,"channel");p(this,"description");p(this,"type");p(this,"keyType");p(this,"headers",[]);p(this,"designType");p(this,"keyDesignType");this.channel=r==null?void 0:r.channel,this.description=r==null?void 0:r.description,r!=null&&r.type?this.type=(r==null?void 0:r.type)instanceof _?r.type:this.owner.node.getDataType(r.type):this.type=this.owner.node.getDataType("any"),r!=null&&r.keyType&&(this.keyType=(r==null?void 0:r.keyType)instanceof _?r.keyType:this.owner.node.getDataType(r.keyType)),this.designType=r==null?void 0:r.designType,this.keyDesignType=r==null?void 0:r.keyDesignType}findHeader(t){let r=t.toLowerCase(),i;for(i of this.headers)if(typeof i.name=="string"&&(i._nameLower=i._nameLower||i.name.toLowerCase(),i._nameLower===r)||i.name instanceof RegExp&&i.name.test(t))return i}toJSON(){let t=yf({description:this.description,channel:this.channel,type:this.type.name?this.type.name:this.type.toJSON(),keyType:this.keyType?this.keyType.name?this.keyType.name:this.keyType.toJSON():void 0});if(this.headers.length){t.headers=[];for(let r of this.headers)t.headers.push(r.toJSON())}return t}};a(Us,"MQOperationResponse");var si=Us;var $s=class $s{static async createApi(e,t){let r=new ot(t);return t.controllers&&await e.enterAsync(".controllers",async()=>{if(Array.isArray(t.controllers))for(let i of t.controllers){let n=await this._createController(e,r,i);n&&r.controllers.set(n.name,n)}else for(let[i,n]of Object.entries(t.controllers)){let s=await this._createController(e,r,n,i);s&&r.controllers.set(s.name,s)}}),r}static async _createController(e,t,r,i){typeof r=="function"&&!Tf(r)&&(r=r()),r=await Z(r);let n,s,c;if(typeof r=="function"){if(s=Reflect.getMetadata(pe,r),!s)return e.addError(`Class "${r.name}" doesn't have a valid MQController metadata`);n=r}else n=Object.getPrototypeOf(r).constructor,s=Reflect.getMetadata(pe,n),s?c=r:(s=r,r.instance==="object"&&(c=r.instance,n=Object.getPrototypeOf(c).constructor));if(!s)return e.addError(`Class "${n.name}" is not decorated with MQController()`);if(i=i||s.name,!i)throw new TypeError("Controller name required");let l=new at(t,{...s,name:i,instance:c,ctor:n});return s.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,l,s.types)}),s.headers&&await e.enterAsync(".headers",async()=>{let m=0;for(let T of s.headers)await e.enterAsync(`[${m++}]`,async()=>{let w={...T};await e.enterAsync(".type",async()=>{T.type&&(w.type=l.node.findDataType(T.type)),!w.type&&typeof T.type=="object"&&(w.type=await M.createDataType(e,l,T.type)),w.type||(w.type=l.node.getDataType("any"))});let E=new Or(l,w);l.headers.push(E)})}),s.operations&&await e.enterAsync(".operations",async()=>{for(let[m,T]of Object.entries(s.operations))await e.enterAsync(`[${m}]`,async()=>{let w=new Rr(l,{...T,name:m,types:void 0,type:void 0,keyType:void 0});await this._initMQOperation(e,w,T),l.operations.set(w.name,w)})}),l}static async _initMQOperation(e,t,r){r.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,t,r.types)}),t.type=await M.resolveDataType(e,t,r.type),r.keyType&&(t.keyType=await M.resolveDataType(e,t,r.keyType)),r.headers&&await e.enterAsync(".headers",async()=>{let i=0;for(let n of r.headers)await e.enterAsync(`[${i++}]`,async()=>{let s={...n};await e.enterAsync(".type",async()=>{s.type=await M.resolveDataType(e,t,n.type)});let c=new Or(t,s);t.headers.push(c)})}),r.response&&await e.enterAsync(".response",async()=>{let i=new si(t,{...r.response,type:void 0,keyType:void 0});await this._initMQOperationResponse(e,i,r.response),t.response=i})}static async _initMQOperationResponse(e,t,r){t.type=await M.resolveDataType(e,t,r.type),r.keyType&&(t.keyType=await M.resolveDataType(e,t,r.keyType)),r.headers&&await e.enterAsync(".headers",async()=>{let i=0;for(let n of r.headers)await e.enterAsync(`[${i++}]`,async()=>{let s={...n};await e.enterAsync(".type",async()=>{s.type=await M.resolveDataType(e,t,n.type)});let c=new Or(t,s);t.headers.push(c)})})}};a($s,"MQApiFactory");var ai=$s;import{isConstructor as wf}from"@jsopen/objects";import{omitUndefined as Ef}from"@jsopen/objects";import{asMutable as _f}from"ts-gems";var Qt=a(function(...o){var i;if(!this)return Qt[A].apply(void 0,o);let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid resource name (${t.name})`);let r=_f(this);r.kind=u.WSController.Kind,r.types=r.node[L]=new W,r.operations=new S,r.name=t.name,r.description=t.description,r.instance=t.instance,r.ctor=t.ctor,r._controllerReverseMap=new WeakMap,(i=r._initialize)==null||i.call(r,t)},"WSController"),Bs=class Bs extends O{toString(){return`[WSController ${this.name}]`}toJSON(){let e=Ef({kind:this.kind,description:this.description});if(this.operations.size){e.operations={};for(let t of this.operations.values())e.operations[t.name]=t.toJSON()}if(this.types.size){e.types={};for(let t of this.types.values())e.types[t.name]=t.toJSON()}return e}[Me](){return`[${ve}WSController${Ie+this.name+Oe}]`}};a(Bs,"WSControllerClass");var qs=Bs;Qt.prototype=qs.prototype;Object.assign(Qt,Wt);Qt[A]=Wt;import{omitUndefined as xf}from"@jsopen/objects";import{asMutable as gf}from"ts-gems";var br=a(function(...o){if(!this){let[i,n]=o,s=[];return br[A].call(void 0,s,i,n)}let[e,t]=o;if(O.call(this,e),!F.test(t.name))throw new TypeError(`Invalid operation name (${t.name})`);let r=gf(this);r.types=r.node[L]=new W,r.name=t.name,r.description=t.description,t.event?this.event=t.event instanceof RegExp?t.event:t.event.startsWith("/")?Ue(t.event):t.event:r.event=this.name,t!=null&&t.arguments?r.arguments=t.arguments.map(i=>({type:i.type instanceof _?i.type:r.owner.node.getDataType(i.type),parameterIndex:i.parameterIndex})):r.arguments=[],t!=null&&t.response&&(r.response=t.response instanceof _?t.response:r.owner.node.getDataType(t.response))},"WSOperation"),Vs=class Vs extends O{toJSON(){var e;return xf({kind:u.WSOperation.Kind,description:this.description,event:this.event,arguments:(e=this.arguments)==null?void 0:e.map(t=>t.type.name?t.type.name:t.type.toJSON())})}};a(Vs,"WSOperationClass");var Ks=Vs;br.prototype=Ks.prototype;br[A]=gr;var Ws=class Ws{static async createApi(e,t){let r=new nt(t);return t.controllers&&await e.enterAsync(".controllers",async()=>{if(Array.isArray(t.controllers))for(let i of t.controllers){let n=await this._createController(e,r,i);n&&r.controllers.set(n.name,n)}else for(let[i,n]of Object.entries(t.controllers)){let s=await this._createController(e,r,n,i);s&&r.controllers.set(s.name,s)}}),r}static async _createController(e,t,r,i){typeof r=="function"&&!wf(r)&&(r=r()),r=await Z(r);let n,s,c;if(typeof r=="function"){if(s=Reflect.getMetadata(ce,r),!s)return e.addError(`Class "${r.name}" doesn't have a valid WSController metadata`);n=r}else n=Object.getPrototypeOf(r).constructor,s=Reflect.getMetadata(ce,n),s?c=r:(s=r,r.instance==="object"&&(c=r.instance,n=Object.getPrototypeOf(c).constructor));if(!s)return e.addError(`Class "${n.name}" is not decorated with WSController()`);if(i=i||s.name,!i)throw new TypeError("Controller name required");let l=new Qt(t,{...s,name:i,instance:c,ctor:n});return s.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,l,s.types)}),s.operations&&await e.enterAsync(".operations",async()=>{for(let[m,T]of Object.entries(s.operations))await e.enterAsync(`[${m}]`,async()=>{let w=Reflect.getMetadata(Zt,n.prototype,m),E=T;w&&(E={...E,arguments:w});let $=new br(l,{...E,name:m,types:void 0,type:void 0,keyType:void 0,arguments:void 0,response:void 0});await this._initWSOperation(e,$,E),l.operations.set(m,$)})}),l}static async _initWSOperation(e,t,r){var i;r.types&&await e.enterAsync(".types",async()=>{await M.addDataTypes(e,t,r.types)}),(i=r.arguments)!=null&&i.length&&await e.enterAsync(".arguments",async()=>{var s;t.arguments=[];let n;for(n of r.arguments){let c={};typeof n=="object"&&n.type&&n.parameterIndex!==null?Object.assign(c,n):c.type=n;let l=await M.resolveDataType(e,t,c.type);(s=t.arguments)==null||s.push({type:l,parameterIndex:c.parameterIndex})}}),r.response&&await e.enterAsync(".response",async()=>{t.response=await M.resolveDataType(e,t,r.response)})}};a(Ws,"WSApiFactory");var pi=Ws;var Af="https://oprajs.com/spec/v"+u.SpecVersion,ci=class ci{constructor(){p(this,"_allDocuments",{})}static async createDocument(e,t){let r=new ci,i=t instanceof Te?t:new Te(t);try{let n=new st;if(await r.initDocument(n,i,e),i.error.details.length)throw i.error;return n}catch(n){try{n instanceof Nt||i.addError(n)}catch{}if(!i.error.message){let s=i.error.details.length;i.error.message=`(${s}) error${s>1?"s":""} found in document schema.`,i.showErrorDetails&&(i.error.message+=i.error.details.map(c=>`
|
|
10
|
+
|
|
11
|
+
- ${c.message}`+(c.path?`
|
|
12
|
+
@${c.path}`:"")).join(""))}throw i.error}}async initDocument(e,t,r){let i;if(typeof r=="string"){if(i=await(await fetch(r,{method:"GET"})).json(),!i)return t.addError(`Invalid response returned from url: ${r}`);i.url=r}else i=r;let n;if(!e[Ke]){let s=e.node.findDataType("string");n=s==null?void 0:s.node.getDocument(),n||(n=await this.createBuiltinDocument(t),e.references.set("opra",n))}i.spec=i.spec||u.SpecVersion,e.url=i.url,i.info&&(e.info={...i.info}),i.references&&await t.enterAsync(".references",async()=>{let s,c;for([s,c]of Object.entries(i.references))c=await Z(c),await t.enterAsync(`[${s}]`,async()=>{if(!F.test(s))throw new TypeError(`Invalid namespace (${s})`);if(c instanceof st){e.references.set(s,c);return}let l=new st;n&&l.references.set("opra",n),await this.initDocument(l,t,c),e.references.set(s,this._allDocuments[l.id])})}),i.types&&await t.enterAsync(".types",async()=>{await M.addDataTypes(t,e,i.types)}),i.api&&await t.enterAsync(".api",async()=>{if(i.api&&i.api.transport==="http"){let s=await Yt.createApi(t,{...i.api,owner:e});s&&(e.api=s)}else if(i.api&&i.api.transport==="mq"){let s=await ai.createApi(t,{...i.api,owner:e});s&&(e.api=s)}else if(i.api&&i.api.transport==="ws"){let s=await pi.createApi(t,{...i.api,owner:e});s&&(e.api=s)}else t.addError(`Unknown service transport (${i.api.transport})`)}),e.invalidate(),this._allDocuments[e.id]||(this._allDocuments[e.id]=e)}async createBuiltinDocument(e){let t={spec:u.SpecVersion,url:Af,info:{version:u.SpecVersion,title:"Opra built-in types",license:{url:"https://github.com/oprajs/opra/blob/main/LICENSE",name:"MIT"}},types:[...Object.values(is),...Object.values(Kn)]},r=new st;r[Ke]=!0;let i=Object.getPrototypeOf(BigInt(0)).constructor,n=Object.getPrototypeOf(Buffer.from([])),s=r.types[vr];return s.set(Object,"object"),s.set(String,"string"),s.set(Number,"number"),s.set(Boolean,"boolean"),s.set(Object,"any"),s.set(Date,"datetime"),s.set(i,"bigint"),s.set(ArrayBuffer,"base64"),s.set(n,"base64"),await this.initDocument(r,e,t),r}};a(ci,"ApiDocumentFactory");var rp=ci;var ip;(function(o){o.HttpApiFactory=Yt,o.DataTypeFactory=M,o.MQOperationDecoratorFactory=xr,o.MQControllerDecoratorFactory=Vt,o.WSOperationDecoratorFactory=gr,o.WSControllerDecoratorFactory=Wt})(ip||(ip={}));import{uid as KO}from"uid";export{Jn as AnyType,je as ApiBase,st as ApiDocument,rp as ApiDocumentFactory,U as ApiField,de as ArrayType,Ke as BUILTIN,Qs as BadRequestError,Tn as Base64Type,cp as BaseI18n,Zn as BigintType,Hn as BooleanType,F as CLASS_NAME_PATTERN,ie as ComplexType,Gs as ConflictError,y as DATATYPE_METADATA,x as DECODER,A as DECORATOR,_ as DataType,W as DataTypeMap,mr as DateTimeType,ur as DateTimeTypeTz,fr as DateType,O as DocumentElement,Te as DocumentInitContext,Yr as DocumentNode,g as ENCODER,te as EmailType,ee as EnumType,Xs as FailedDependencyError,J as FieldPathType,Ve as FieldsProjection,Ze as FilterType,Nr as ForbiddenError,ae as HTTP_CONTROLLER_METADATA,rt as HttpApi,se as HttpController,Zs as HttpHeaderCodes,Ce as HttpMediaType,ii as HttpMultipartField,b as HttpOperation,oi as HttpOperationResponse,Ar as HttpParameter,ni as HttpRequestBody,R as HttpStatusCode,om as HttpStatusMessages,wr as HttpStatusRange,Xt as I18n,$t as IntegerType,Hs as InternalServerError,pa as IssueSeverity,ot as MQApi,at as MQController,Or as MQHeader,Rr as MQOperation,pe as MQ_CONTROLLER_METADATA,tt as MappedType,ea as MethodNotAllowedError,D as MimeTypes,zt as MixinType,la as NAMESPACE_PATTERN,ta as NotAcceptableError,ra as NotFoundError,ts as NullType,Re as NumberType,Sn as ObjectIdType,rs as ObjectType,Fg as OmitType,oe as OperationResult,Nt as OpraDocumentError,xe as OpraException,dr as OpraFilter,v as OpraHttpError,u as OpraSchema,hr as PartialDateType,$g as PartialType,ia as PermissionError,Vg as PickType,_u as RPC_CONTROLLER_METADATA,Yg as RequiredType,oa as ResourceConflictError,na as ResourceNotAvailableError,S as ResponsiveMap,d as SimpleType,et as StringType,yr as TimeType,sa as UnauthorizedError,Jt as UnionType,aa as UnprocessableEntityError,Bn as UrlType,Hr as UuidType,nt as WSApi,Qt as WSController,br as WSOperation,ce as WS_CONTROLLER_METADATA,Zt as WS_PARAM_METADATA,Zg as WsParam,ip as classes,k as cloneObject,du as getErrorStack,uu as getStackFileName,mi as i18n,Mr as inheritPropertyInitializers,Fu as isBlob,ju as isFormData,Lu as isReadable,Pu as isReadableStream,vi as isStream,Cu as isURL,ku as isWritable,vr as kCtorMap,L as kDataTypeMap,De as kTypeNSMap,Sr as mergePrototype,da as parse,ua as parseFieldsProjection,Z as resolveThunk,Mu as safeJsonStringify,Lf as translate,KO as uid};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _a;
|
|
2
1
|
import { omitUndefined } from '@jsopen/objects';
|
|
3
2
|
import { md5 } from 'super-fast-md5';
|
|
4
3
|
import { cloneObject, ResponsiveMap } from '../helpers/index.js';
|
|
@@ -15,13 +14,15 @@ import { WSApi } from './ws/ws-api.js';
|
|
|
15
14
|
* @class ApiDocument
|
|
16
15
|
*/
|
|
17
16
|
export class ApiDocument extends DocumentElement {
|
|
17
|
+
[kTypeNSMap] = new WeakMap();
|
|
18
|
+
id = '';
|
|
19
|
+
url;
|
|
20
|
+
info = {};
|
|
21
|
+
references = new ResponsiveMap();
|
|
22
|
+
types = new DataTypeMap();
|
|
23
|
+
api;
|
|
18
24
|
constructor() {
|
|
19
25
|
super(null);
|
|
20
|
-
this[_a] = new WeakMap();
|
|
21
|
-
this.id = '';
|
|
22
|
-
this.info = {};
|
|
23
|
-
this.references = new ResponsiveMap();
|
|
24
|
-
this.types = new DataTypeMap();
|
|
25
26
|
this.node[kDataTypeMap] = this.types;
|
|
26
27
|
this.node.findDataType = this._findDataType.bind(this);
|
|
27
28
|
}
|
|
@@ -175,4 +176,3 @@ export class ApiDocument extends DocumentElement {
|
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
}
|
|
178
|
-
_a = kTypeNSMap;
|
|
@@ -2,9 +2,10 @@ import { omitUndefined } from '@jsopen/objects';
|
|
|
2
2
|
import { CLASS_NAME_PATTERN } from '../constants.js';
|
|
3
3
|
import { DocumentElement } from './document-element.js';
|
|
4
4
|
export class ApiBase extends DocumentElement {
|
|
5
|
+
name = 'OpraApi';
|
|
6
|
+
description;
|
|
5
7
|
constructor(init) {
|
|
6
8
|
super(init.owner);
|
|
7
|
-
this.name = 'OpraApi';
|
|
8
9
|
this.name = init.name;
|
|
9
10
|
this.description = init.description;
|
|
10
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
var _a, _b;
|
|
2
1
|
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
2
|
import { DATATYPE_METADATA } from '../constants.js';
|
|
4
3
|
import { DataType } from '../data-type/data-type.js';
|
|
@@ -8,10 +7,8 @@ const kCtorMap = Symbol.for('kCtorMap');
|
|
|
8
7
|
* @class DataTypeMap
|
|
9
8
|
*/
|
|
10
9
|
export class DataTypeMap {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this[_b] = new WeakMap();
|
|
14
|
-
}
|
|
10
|
+
[kMap] = new ResponsiveMap();
|
|
11
|
+
[kCtorMap] = new WeakMap();
|
|
15
12
|
get size() {
|
|
16
13
|
return this[kMap].size;
|
|
17
14
|
}
|
|
@@ -67,7 +64,7 @@ export class DataTypeMap {
|
|
|
67
64
|
this[kMap].sort(compareFn);
|
|
68
65
|
return this;
|
|
69
66
|
}
|
|
70
|
-
[
|
|
67
|
+
[Symbol.iterator]() {
|
|
71
68
|
return this[kMap][Symbol.iterator]();
|
|
72
69
|
}
|
|
73
70
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { OpraDocumentError } from './opra-document-error.js';
|
|
2
2
|
export class DocumentInitContext {
|
|
3
|
+
path = '';
|
|
4
|
+
error = new OpraDocumentError();
|
|
5
|
+
maxErrors;
|
|
6
|
+
showErrorDetails = true;
|
|
3
7
|
constructor(options) {
|
|
4
|
-
this.path = '';
|
|
5
|
-
this.error = new OpraDocumentError();
|
|
6
|
-
this.showErrorDetails = true;
|
|
7
8
|
this.maxErrors = options?.maxErrors || 0;
|
|
8
9
|
this.error.message = '';
|
|
9
10
|
}
|