@redocly/reference-docs 3.0.0-alpha.3 → 3.0.0-alpha.4
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/bin/cli/commands/redocly-docs-cli.min.js +274 -241
- package/bin/cli/commands/redocly-docs-cli.min.js.LICENSE.txt +5 -21
- package/dist/console.redocly-reference-docs.min.js +182 -159
- package/dist/oauth2-redirect.js +1 -1
- package/dist/redocly-reference-docs.min.js +812 -710
- package/lib/components/Endpoint/Endpoint.d.ts +1 -6
- package/lib/components/Endpoint/Endpoint.js +1 -1
- package/lib/components/Endpoint/ServerList.d.ts +2 -7
- package/lib/components/Endpoint/ServerList.js +1 -1
- package/lib/components/Endpoint/Summary.d.ts +1 -12
- package/lib/components/Endpoint/Summary.js +1 -1
- package/lib/components/Endpoint/index.d.ts +2 -1
- package/lib/components/Endpoint/index.js +1 -1
- package/lib/components/Endpoint/styled.d.ts +13 -0
- package/lib/components/Endpoint/styled.js +2 -0
- package/lib/components/Endpoint/types.d.ts +21 -0
- package/lib/components/Endpoint/types.js +2 -0
- package/lib/components/OperationParameters/OperationParameters.js +1 -1
- package/lib/components/OperationParameters/utils.d.ts +1 -1
- package/lib/components/OperationParameters/utils.js +1 -1
- package/lib/components/Panel/Accordion.js +1 -1
- package/lib/components/Panel/ContentPanel.js +1 -1
- package/lib/components/Panel/Description.d.ts +1 -0
- package/lib/components/Panel/Description.js +2 -0
- package/lib/components/Panel/PanelComponent.d.ts +1 -1
- package/lib/components/Panel/PanelComponent.js +1 -1
- package/lib/components/Panel/index.d.ts +1 -0
- package/lib/components/Panel/index.js +1 -1
- package/lib/components/ProProviders.d.ts +8 -2
- package/lib/components/RedoclyReferenceDocs.d.ts +1 -7
- package/lib/components/RedoclyReferenceDocs.js +1 -1
- package/lib/components/RedoclyReferenceDocsMultiStandalone.d.ts +8 -0
- package/lib/components/RedoclyReferenceDocsMultiStandalone.js +2 -0
- package/lib/components/Samples/SamplesTabs.d.ts +3 -1
- package/lib/components/Samples/SamplesTabs.js +1 -1
- package/lib/components/Samples/use-example-key.js +1 -1
- package/lib/components/Search/ProSearchBox.js +1 -1
- package/lib/components/StoreProvider.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +1 -1
- package/lib/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib/components/common/CheckboxList.d.ts +1 -1
- package/lib/components/common/FileUpload/FileUpload.d.ts +3 -2
- package/lib/components/common/FileUpload/FileUpload.js +1 -1
- package/lib/components/console/ActionPanel.js +1 -1
- package/lib/components/console/AuthPanel/AuthPanel.d.ts +1 -1
- package/lib/components/console/AuthPanel/AuthPanel.js +1 -1
- package/lib/components/console/AuthPanel/types.d.ts +1 -1
- package/lib/components/console/CodemirrorInput.d.ts +15 -11
- package/lib/components/console/CodemirrorInput.js +1 -1
- package/lib/components/console/Console.d.ts +3 -3
- package/lib/components/console/Console.js +1 -1
- package/lib/components/console/ConsoleLazy.js +1 -1
- package/lib/components/console/OAuth2Flow.d.ts +2 -1
- package/lib/components/console/OAuth2Flow.js +1 -1
- package/lib/components/console/OAuth2TokenInput.d.ts +2 -1
- package/lib/components/console/OAuth2TokenInput.js +1 -1
- package/lib/components/console/OpenIDConnect.d.ts +4 -1
- package/lib/components/console/OpenIDConnect.js +1 -1
- package/lib/components/console/ParameterArray.d.ts +10 -0
- package/lib/components/console/ParameterArray.js +2 -0
- package/lib/components/console/RequestBody/RequestBody.d.ts +3 -0
- package/lib/components/console/RequestBody/RequestBody.js +2 -0
- package/lib/components/console/RequestBody/index.d.ts +2 -0
- package/lib/components/console/RequestBody/index.js +2 -0
- package/lib/components/console/RequestBody/types.d.ts +10 -0
- package/lib/components/console/RequestBody/types.js +2 -0
- package/lib/components/console/RequestBodyForm.d.ts +3 -2
- package/lib/components/console/ServersDropdown/ServersDropdown.d.ts +3 -0
- package/lib/components/console/ServersDropdown/ServersDropdown.js +2 -0
- package/lib/components/console/ServersDropdown/index.d.ts +1 -0
- package/lib/components/console/ServersDropdown/index.js +2 -0
- package/lib/components/console/ServersDropdown/types.d.ts +5 -0
- package/lib/components/console/ServersDropdown/types.js +2 -0
- package/lib/components/console/styled.d.ts +1 -0
- package/lib/components/console/styled.js +1 -1
- package/lib/components/console/utils.d.ts +9 -1
- package/lib/components/console/utils.js +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -1
- package/lib/components/shared/index.d.ts +0 -1
- package/lib/components/shared/index.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +1 -1
- package/lib/hooks/useDimensions.d.ts +1 -0
- package/lib/hooks/useDimensions.js +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/oauth2-redirect-page/handler/helpers.d.ts +1 -0
- package/lib/oauth2-redirect-page/handler/helpers.js +1 -1
- package/lib/redoc-lib/src/common-elements/linkify.d.ts +1 -1
- package/lib/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +1 -1
- package/lib/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.js +1 -1
- package/lib/redoc-lib/src/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbackDetails.js +1 -1
- package/lib/redoc-lib/src/components/Callbacks/CallbacksList.js +1 -1
- package/lib/redoc-lib/src/components/ContentItem/ContentItem.d.ts +10 -0
- package/lib/redoc-lib/src/components/ContentItem/ContentItem.js +2 -0
- package/lib/redoc-lib/src/components/ContentItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/ContentItem/index.js +2 -0
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.d.ts +2 -18
- package/lib/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib/redoc-lib/src/components/ContentItems/Skeleton.d.ts +2 -0
- package/lib/redoc-lib/src/components/ContentItems/Skeleton.js +2 -0
- package/lib/redoc-lib/src/components/ContentItems/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/ContentItems/index.js +2 -0
- package/lib/redoc-lib/src/components/ErrorBoundary.d.ts +1 -1
- package/lib/redoc-lib/src/components/Fields/EnumValues.js +1 -1
- package/lib/redoc-lib/src/components/GenericChildrenSwitcher/GenericChildrenSwitcher.js +1 -1
- package/lib/redoc-lib/src/components/Markdown/AdvancedMarkdown.js +1 -1
- package/lib/redoc-lib/src/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib/redoc-lib/src/components/Operation/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/Operation/index.js +2 -0
- package/lib/redoc-lib/src/components/OperationItem/OperationItem.d.ts +7 -0
- package/lib/redoc-lib/src/components/OperationItem/OperationItem.js +2 -0
- package/lib/redoc-lib/src/components/OperationItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/OperationItem/index.js +2 -0
- package/lib/redoc-lib/src/components/PayloadSamples/Example.d.ts +1 -5
- package/lib/redoc-lib/src/components/PayloadSamples/Example.js +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/ExampleValue.d.ts +1 -8
- package/lib/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.d.ts +2 -7
- package/lib/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/PayloadSamples.d.ts +1 -7
- package/lib/redoc-lib/src/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib/redoc-lib/src/components/PayloadSamples/index.d.ts +5 -0
- package/lib/redoc-lib/src/components/PayloadSamples/index.js +2 -0
- package/lib/redoc-lib/src/components/PayloadSamples/types.d.ts +23 -0
- package/lib/redoc-lib/src/components/PayloadSamples/types.js +2 -0
- package/lib/redoc-lib/src/components/PayloadSamples/{exernalExampleHook.d.ts → useExternalExample.d.ts} +0 -0
- package/lib/redoc-lib/src/components/PayloadSamples/{exernalExampleHook.js → useExternalExample.js} +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +1 -1
- package/lib/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib/redoc-lib/src/components/Responses/Response.d.ts +2 -5
- package/lib/redoc-lib/src/components/Responses/Response.js +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseDetails.d.ts +3 -8
- package/lib/redoc-lib/src/components/Responses/ResponseDetails.js +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseHeaders.d.ts +3 -9
- package/lib/redoc-lib/src/components/Responses/ResponseHeaders.js +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponseSummary.d.ts +1 -5
- package/lib/redoc-lib/src/components/Responses/ResponseSummary.js +1 -1
- package/lib/redoc-lib/src/components/Responses/ResponsesList.d.ts +3 -8
- package/lib/redoc-lib/src/components/Responses/ResponsesList.js +1 -1
- package/lib/redoc-lib/src/components/Responses/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/Responses/index.js +2 -0
- package/lib/redoc-lib/src/components/Responses/{styled.elements.d.ts → styled.d.ts} +1 -0
- package/lib/redoc-lib/src/components/Responses/styled.js +2 -0
- package/lib/redoc-lib/src/components/Responses/types.d.ts +12 -0
- package/lib/redoc-lib/src/components/Responses/types.js +2 -0
- package/lib/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib/redoc-lib/src/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib/redoc-lib/src/components/SearchBox/SearchBox.d.ts +1 -1
- package/lib/redoc-lib/src/components/SectionItem/SectionItem.d.ts +7 -0
- package/lib/redoc-lib/src/components/SectionItem/SectionItem.js +2 -0
- package/lib/redoc-lib/src/components/SectionItem/index.d.ts +1 -0
- package/lib/redoc-lib/src/components/SectionItem/index.js +2 -0
- package/lib/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +1 -1
- package/lib/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +1 -1
- package/lib/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
- package/lib/redoc-lib/src/components/SecuritySchemes/helpers.d.ts +4 -0
- package/lib/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -1
- package/lib/redoc-lib/src/components/index.d.ts +2 -4
- package/lib/redoc-lib/src/components/index.js +1 -1
- package/lib/redoc-lib/src/services/MenuBuilder.d.ts +1 -1
- package/lib/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib/redoc-lib/src/services/OpenAPIParser.js +1 -1
- package/lib/redoc-lib/src/services/SearchStore.js +1 -1
- package/lib/redoc-lib/src/services/models/MediaContent.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/MediaType.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/MediaType.js +1 -1
- package/lib/redoc-lib/src/services/models/Operation.d.ts +2 -2
- package/lib/redoc-lib/src/services/models/RequestBody.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Response.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib/redoc-lib/src/types/open-api.d.ts +3 -0
- package/lib/redoc-lib/src/utils/helpers.d.ts +3 -1
- package/lib/redoc-lib/src/utils/helpers.js +1 -1
- package/lib/redoc-lib/src/utils/openapi.d.ts +3 -2
- package/lib/redoc-lib/src/utils/openapi.js +1 -1
- package/lib/redoc-lib/src/utils/string.d.ts +1 -0
- package/lib/redoc-lib/src/utils/string.js +2 -0
- package/lib/services/OAuth2.d.ts +4 -2
- package/lib/services/OAuth2.js +1 -1
- package/lib/services/OpenIDConnect.d.ts +1 -1
- package/lib/services/ProStore.d.ts +6 -6
- package/lib/services/SearchStore.d.ts +1 -1
- package/lib/services/VersionedSpecStore.d.ts +1 -1
- package/lib/services/code-samples/generator.d.ts +1 -0
- package/lib/services/code-samples/generator.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib/standalone.d.ts +1 -1
- package/lib/standalone.js +1 -1
- package/lib/types.d.ts +11 -0
- package/lib/utils.d.ts +3 -13
- package/lib/utils.js +1 -1
- package/lib-esm/components/Endpoint/Endpoint.d.ts +1 -6
- package/lib-esm/components/Endpoint/Endpoint.js +1 -1
- package/lib-esm/components/Endpoint/ServerList.d.ts +2 -7
- package/lib-esm/components/Endpoint/ServerList.js +1 -1
- package/lib-esm/components/Endpoint/Summary.d.ts +1 -12
- package/lib-esm/components/Endpoint/Summary.js +1 -1
- package/lib-esm/components/Endpoint/index.d.ts +2 -1
- package/lib-esm/components/Endpoint/index.js +1 -1
- package/lib-esm/components/Endpoint/styled.d.ts +13 -0
- package/lib-esm/components/Endpoint/styled.js +2 -0
- package/lib-esm/components/Endpoint/types.d.ts +21 -0
- package/lib-esm/components/Endpoint/types.js +2 -0
- package/lib-esm/components/OperationParameters/OperationParameters.js +1 -1
- package/lib-esm/components/OperationParameters/utils.d.ts +1 -1
- package/lib-esm/components/OperationParameters/utils.js +1 -1
- package/lib-esm/components/Panel/Accordion.js +1 -1
- package/lib-esm/components/Panel/ContentPanel.js +1 -1
- package/lib-esm/components/Panel/Description.d.ts +1 -0
- package/lib-esm/components/Panel/Description.js +2 -0
- package/lib-esm/components/Panel/PanelComponent.d.ts +1 -1
- package/lib-esm/components/Panel/PanelComponent.js +1 -1
- package/lib-esm/components/Panel/index.d.ts +1 -0
- package/lib-esm/components/Panel/index.js +1 -1
- package/lib-esm/components/ProProviders.d.ts +8 -2
- package/lib-esm/components/RedoclyReferenceDocs.d.ts +1 -7
- package/lib-esm/components/RedoclyReferenceDocs.js +1 -1
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.d.ts +8 -0
- package/lib-esm/components/RedoclyReferenceDocsMultiStandalone.js +2 -0
- package/lib-esm/components/Samples/SamplesTabs.d.ts +3 -1
- package/lib-esm/components/Samples/SamplesTabs.js +1 -1
- package/lib-esm/components/Samples/use-example-key.js +1 -1
- package/lib-esm/components/Search/ProSearchBox.js +1 -1
- package/lib-esm/components/StoreProvider.d.ts +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.d.ts +1 -1
- package/lib-esm/components/Tabs/CollapsingTabs/CollapsingTabsBase.js +1 -1
- package/lib-esm/components/common/CheckboxList.d.ts +1 -1
- package/lib-esm/components/common/FileUpload/FileUpload.d.ts +3 -2
- package/lib-esm/components/common/FileUpload/FileUpload.js +1 -1
- package/lib-esm/components/console/ActionPanel.js +1 -1
- package/lib-esm/components/console/AuthPanel/AuthPanel.d.ts +1 -1
- package/lib-esm/components/console/AuthPanel/AuthPanel.js +1 -1
- package/lib-esm/components/console/AuthPanel/types.d.ts +1 -1
- package/lib-esm/components/console/CodemirrorInput.d.ts +15 -11
- package/lib-esm/components/console/CodemirrorInput.js +1 -1
- package/lib-esm/components/console/Console.d.ts +3 -3
- package/lib-esm/components/console/Console.js +1 -1
- package/lib-esm/components/console/ConsoleLazy.js +1 -1
- package/lib-esm/components/console/OAuth2Flow.d.ts +2 -1
- package/lib-esm/components/console/OAuth2Flow.js +1 -1
- package/lib-esm/components/console/OAuth2TokenInput.d.ts +2 -1
- package/lib-esm/components/console/OAuth2TokenInput.js +1 -1
- package/lib-esm/components/console/OpenIDConnect.d.ts +4 -1
- package/lib-esm/components/console/OpenIDConnect.js +1 -1
- package/lib-esm/components/console/ParameterArray.d.ts +10 -0
- package/lib-esm/components/console/ParameterArray.js +2 -0
- package/lib-esm/components/console/RequestBody/RequestBody.d.ts +3 -0
- package/lib-esm/components/console/RequestBody/RequestBody.js +2 -0
- package/lib-esm/components/console/RequestBody/index.d.ts +2 -0
- package/lib-esm/components/console/RequestBody/index.js +2 -0
- package/lib-esm/components/console/RequestBody/types.d.ts +10 -0
- package/lib-esm/components/console/RequestBody/types.js +2 -0
- package/lib-esm/components/console/RequestBodyForm.d.ts +3 -2
- package/lib-esm/components/console/ServersDropdown/ServersDropdown.d.ts +3 -0
- package/lib-esm/components/console/ServersDropdown/ServersDropdown.js +2 -0
- package/lib-esm/components/console/ServersDropdown/index.d.ts +1 -0
- package/lib-esm/components/console/ServersDropdown/index.js +2 -0
- package/lib-esm/components/console/ServersDropdown/types.d.ts +5 -0
- package/lib-esm/components/console/ServersDropdown/types.js +2 -0
- package/lib-esm/components/console/styled.d.ts +1 -0
- package/lib-esm/components/console/styled.js +1 -1
- package/lib-esm/components/console/utils.d.ts +9 -1
- package/lib-esm/components/console/utils.js +1 -1
- package/lib-esm/components/index.d.ts +1 -0
- package/lib-esm/components/index.js +1 -1
- package/lib-esm/components/shared/index.d.ts +0 -1
- package/lib-esm/components/shared/index.js +1 -1
- package/lib-esm/hooks/index.d.ts +1 -0
- package/lib-esm/hooks/index.js +1 -1
- package/lib-esm/hooks/useDimensions.d.ts +1 -0
- package/lib-esm/hooks/useDimensions.js +2 -0
- package/lib-esm/index.d.ts +1 -1
- package/lib-esm/oauth2-redirect-page/handler/helpers.d.ts +1 -0
- package/lib-esm/oauth2-redirect-page/handler/helpers.js +1 -1
- package/lib-esm/redoc-lib/src/common-elements/linkify.d.ts +1 -1
- package/lib-esm/redoc-lib/src/common-elements/perfect-scrollbar.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/CallbackSamples/CallbackReqSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/CallbackSamples/CallbackSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbackDetails.js +1 -1
- package/lib-esm/redoc-lib/src/components/Callbacks/CallbacksList.js +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItem/ContentItem.d.ts +10 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/ContentItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/ContentItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.d.ts +2 -18
- package/lib-esm/redoc-lib/src/components/ContentItems/ContentItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/ContentItems/Skeleton.d.ts +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/Skeleton.js +2 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/ContentItems/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/ErrorBoundary.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/Fields/EnumValues.js +1 -1
- package/lib-esm/redoc-lib/src/components/GenericChildrenSwitcher/GenericChildrenSwitcher.js +1 -1
- package/lib-esm/redoc-lib/src/components/Markdown/AdvancedMarkdown.js +1 -1
- package/lib-esm/redoc-lib/src/components/MediaTypeSwitch/MediaTypesSwitch.js +1 -1
- package/lib-esm/redoc-lib/src/components/Operation/Operation.js +1 -1
- package/lib-esm/redoc-lib/src/components/Operation/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/Operation/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/OperationItem.d.ts +7 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/OperationItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/OperationItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/Example.d.ts +1 -5
- package/lib-esm/redoc-lib/src/components/PayloadSamples/Example.js +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/ExampleValue.d.ts +1 -8
- package/lib-esm/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.d.ts +2 -7
- package/lib-esm/redoc-lib/src/components/PayloadSamples/MediaTypeSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/PayloadSamples.d.ts +1 -7
- package/lib-esm/redoc-lib/src/components/PayloadSamples/PayloadSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/PayloadSamples/index.d.ts +5 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/types.d.ts +23 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/types.js +2 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/{exernalExampleHook.d.ts → useExternalExample.d.ts} +0 -0
- package/lib-esm/redoc-lib/src/components/PayloadSamples/{exernalExampleHook.js → useExternalExample.js} +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/CodeSample.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/RequestSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/RequestSamples/languageSwitchEvent.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/ResponseSamples/ResponseSamples.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/Response.d.ts +2 -5
- package/lib-esm/redoc-lib/src/components/Responses/Response.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseDetails.d.ts +3 -8
- package/lib-esm/redoc-lib/src/components/Responses/ResponseDetails.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseHeaders.d.ts +3 -9
- package/lib-esm/redoc-lib/src/components/Responses/ResponseHeaders.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponseSummary.d.ts +1 -5
- package/lib-esm/redoc-lib/src/components/Responses/ResponseSummary.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/ResponsesList.d.ts +3 -8
- package/lib-esm/redoc-lib/src/components/Responses/ResponsesList.js +1 -1
- package/lib-esm/redoc-lib/src/components/Responses/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/Responses/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/Responses/{styled.elements.d.ts → styled.d.ts} +1 -0
- package/lib-esm/redoc-lib/src/components/Responses/styled.js +2 -0
- package/lib-esm/redoc-lib/src/components/Responses/types.d.ts +12 -0
- package/lib-esm/redoc-lib/src/components/Responses/types.js +2 -0
- package/lib-esm/redoc-lib/src/components/Schema/DiscriminatorDropdown.js +1 -1
- package/lib-esm/redoc-lib/src/components/SchemaDefinition/SchemaDefinition.js +1 -1
- package/lib-esm/redoc-lib/src/components/SearchBox/SearchBox.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/SectionItem/SectionItem.d.ts +7 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/SectionItem.js +2 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/index.d.ts +1 -0
- package/lib-esm/redoc-lib/src/components/SectionItem/index.js +2 -0
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/RequiredScopesRow.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirement.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementElement.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecurityRequirement/SecurityRequirementPanelDescription.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecuritySchemes/SecuritySchemes.js +1 -1
- package/lib-esm/redoc-lib/src/components/SecuritySchemes/helpers.d.ts +4 -0
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItem.js +1 -1
- package/lib-esm/redoc-lib/src/components/SideMenu/MenuItems.js +1 -1
- package/lib-esm/redoc-lib/src/components/StickySidebar/StickyResponsiveSidebar.d.ts +1 -1
- package/lib-esm/redoc-lib/src/components/index.d.ts +2 -4
- package/lib-esm/redoc-lib/src/components/index.js +1 -1
- package/lib-esm/redoc-lib/src/services/MenuBuilder.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/OpenAPIParser.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/OpenAPIParser.js +1 -1
- package/lib-esm/redoc-lib/src/services/SearchStore.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/MediaContent.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/MediaType.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/MediaType.js +1 -1
- package/lib-esm/redoc-lib/src/services/models/Operation.d.ts +2 -2
- package/lib-esm/redoc-lib/src/services/models/RequestBody.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Response.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.d.ts +1 -1
- package/lib-esm/redoc-lib/src/services/models/Schema.js +1 -1
- package/lib-esm/redoc-lib/src/types/open-api.d.ts +3 -0
- package/lib-esm/redoc-lib/src/utils/helpers.d.ts +3 -1
- package/lib-esm/redoc-lib/src/utils/helpers.js +1 -1
- package/lib-esm/redoc-lib/src/utils/openapi.d.ts +3 -2
- package/lib-esm/redoc-lib/src/utils/openapi.js +1 -1
- package/lib-esm/redoc-lib/src/utils/string.d.ts +1 -0
- package/lib-esm/redoc-lib/src/utils/string.js +2 -0
- package/lib-esm/services/OAuth2.d.ts +4 -2
- package/lib-esm/services/OAuth2.js +1 -1
- package/lib-esm/services/OpenIDConnect.d.ts +1 -1
- package/lib-esm/services/ProStore.d.ts +6 -6
- package/lib-esm/services/SearchStore.d.ts +1 -1
- package/lib-esm/services/VersionedSpecStore.d.ts +1 -1
- package/lib-esm/services/code-samples/generator.d.ts +1 -0
- package/lib-esm/services/code-samples/generator.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/csharp/httpclient.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/java8/apachehttp.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/javascript/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/node/fetch.js +1 -1
- package/lib-esm/services/code-samples/httpsnippet/targets/python/requests.js +1 -1
- package/lib-esm/standalone.d.ts +1 -1
- package/lib-esm/standalone.js +1 -1
- package/lib-esm/types.d.ts +11 -0
- package/lib-esm/utils.d.ts +3 -13
- package/lib-esm/utils.js +1 -1
- package/package.json +11 -8
- package/lib/components/Endpoint/CopyLink.d.ts +0 -1
- package/lib/components/Endpoint/CopyLink.js +0 -2
- package/lib/components/Endpoint/Path.d.ts +0 -4
- package/lib/components/Endpoint/Path.js +0 -2
- package/lib/components/Endpoint/ServerItem.d.ts +0 -1
- package/lib/components/Endpoint/ServerItem.js +0 -2
- package/lib/components/Endpoint/ServerUrl.d.ts +0 -1
- package/lib/components/Endpoint/ServerUrl.js +0 -2
- package/lib/components/console/RequestBody.d.ts +0 -12
- package/lib/components/console/RequestBody.js +0 -2
- package/lib/components/console/ServerDropdown.d.ts +0 -24
- package/lib/components/console/ServerDropdown.js +0 -2
- package/lib/components/shared/SelectOnClick.d.ts +0 -6
- package/lib/components/shared/SelectOnClick.js +0 -2
- package/lib/redoc-lib/src/components/Responses/styled.elements.js +0 -2
- package/lib-esm/components/Endpoint/CopyLink.d.ts +0 -1
- package/lib-esm/components/Endpoint/CopyLink.js +0 -2
- package/lib-esm/components/Endpoint/Path.d.ts +0 -4
- package/lib-esm/components/Endpoint/Path.js +0 -2
- package/lib-esm/components/Endpoint/ServerItem.d.ts +0 -1
- package/lib-esm/components/Endpoint/ServerItem.js +0 -2
- package/lib-esm/components/Endpoint/ServerUrl.d.ts +0 -1
- package/lib-esm/components/Endpoint/ServerUrl.js +0 -2
- package/lib-esm/components/console/RequestBody.d.ts +0 -12
- package/lib-esm/components/console/RequestBody.js +0 -2
- package/lib-esm/components/console/ServerDropdown.d.ts +0 -24
- package/lib-esm/components/console/ServerDropdown.js +0 -2
- package/lib-esm/components/shared/SelectOnClick.d.ts +0 -6
- package/lib-esm/components/shared/SelectOnClick.js +0 -2
- package/lib-esm/redoc-lib/src/components/Responses/styled.elements.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see SearchStore.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SearchStore=t():e.SearchStore=t()}(this,(function(){return(()=>{var e={27:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var i=r(336),n=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),o=(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{a(r.next(e))}catch(e){n(e)}},o=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())}));class a{constructor(){s(this,"add",f),s(this,"done",p),s(this,"search",R),s(this,"toJS",y),s(this,"load",g),s(this,"dispose",x),s(this,"fromExternalJS",m)}}let u,l,c,h=[];function d(){u=new i.Builder,u.field("title"),u.field("description"),u.ref("ref"),u.pipeline.add(i.trimmer,i.stopWordFilter,i.stemmer),c=new Promise((e=>{l=e}))}function f(e,t,r){const i=h.push(r)-1,n={title:e.toLowerCase(),description:t.toLowerCase(),ref:i};u.add(n)}function p(){return o(this,null,(function*(){l(u.build())}))}function y(){return o(this,null,(function*(){return{store:h,index:(yield c).toJSON()}}))}function m(e,t){return o(this,null,(function*(){try{if(importScripts(e),!self[t])throw new Error("Broken index file format");yield g(self[t])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function g(e){return o(this,null,(function*(){h=e.store,l(i.Index.load(e.index))}))}function x(){return o(this,null,(function*(){h=[],d()}))}function R(e,t=0){return o(this,null,(function*(){if(0===e.trim().length)return[];let r=(yield c).query((t=>{e.trim().toLowerCase().split(/\s+/).forEach((e=>{if(1===e.length)return;const r=(e=>"*"+i.stemmer(new i.Token(e,{}))+"*")(e);t.term(r,{})}))}));return t>0&&(r=r.slice(0,t)),r.map((e=>({meta:h[e.ref],score:e.score})))}))}i.tokenizer.separator=/\s+/,d()},336:(e,t,r)=>{var i,n;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,R,v,w,Q,k,S,E,b,L,P,T,O,I=function(e){var t=new I.Builder;return t.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),t.searchPipeline.add(I.stemmer),e.call(t,t),t.build()};I.version="2.3.9",I.utils={},I.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),I.utils.asString=function(e){return null==e?"":e.toString()},I.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var n=r[i],s=e[n];if(Array.isArray(s))t[n]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[n]=s}}return t},I.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},I.FieldRef.joiner="/",I.FieldRef.fromString=function(e){var t=e.indexOf(I.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new I.FieldRef(i,r,e)},I.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+I.FieldRef.joiner+this.docRef),this._stringValue},I.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},I.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},I.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},I.Set.prototype.contains=function(e){return!!this.elements[e]},I.Set.prototype.intersect=function(e){var t,r,i,n=[];if(e===I.Set.complete)return this;if(e===I.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),i=Object.keys(t.elements);for(var s=0;s<i.length;s++){var o=i[s];o in r.elements&&n.push(o)}return new I.Set(n)},I.Set.prototype.union=function(e){return e===I.Set.complete?I.Set.complete:e===I.Set.empty?this:new I.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},I.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},I.Token=function(e,t){this.str=e||"",this.metadata=t||{}},I.Token.prototype.toString=function(){return this.str},I.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},I.Token.prototype.clone=function(e){return e=e||function(e){return e},new I.Token(e(this.str,this.metadata),this.metadata)},I.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new I.Token(I.utils.asString(e).toLowerCase(),I.utils.clone(t))}));for(var r=e.toString().toLowerCase(),i=r.length,n=[],s=0,o=0;s<=i;s++){var a=s-o;if(r.charAt(s).match(I.tokenizer.separator)||s==i){if(a>0){var u=I.utils.clone(t)||{};u.position=[o,a],u.index=n.length,n.push(new I.Token(r.slice(o,s),u))}o=s+1}}return n},I.tokenizer.separator=/[\s\-]+/,I.Pipeline=function(){this._stack=[]},I.Pipeline.registeredFunctions=Object.create(null),I.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&I.utils.warn("Overwriting existing registered function: "+t),e.label=t,I.Pipeline.registeredFunctions[e.label]=e},I.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||I.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},I.Pipeline.load=function(e){var t=new I.Pipeline;return e.forEach((function(e){var r=I.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},I.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach((function(e){I.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},I.Pipeline.prototype.after=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},I.Pipeline.prototype.before=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},I.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},I.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack[r],n=[],s=0;s<e.length;s++){var o=i(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)n.push(o[a]);else n.push(o)}e=n}return e},I.Pipeline.prototype.runString=function(e,t){var r=new I.Token(e,t);return this.run([r]).map((function(e){return e.toString()}))},I.Pipeline.prototype.reset=function(){this._stack=[]},I.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return I.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},I.Vector=function(e){this._magnitude=0,this.elements=e||[]},I.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(s<e&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e||s>e?2*n:s<e?2*(n+1):void 0},I.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},I.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},I.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},I.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u<n&&l<s;)(o=r[u])<(a=i[l])?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},I.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},I.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},I.Vector.prototype.toJSON=function(){return this.elements},I.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},u="[aeiouy]",l="[^aeiou][^aeiouy]*",c=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),p=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,x=/.$/,R=/(at|bl|iz)$/,v=new RegExp("([^aeiouylsz])\\1$"),w=new RegExp("^"+l+u+"[^aeiouwxy]$"),Q=/^(.+?[^aeiou])y$/,k=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,S=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,E=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,b=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,P=/ll$/,T=new RegExp("^"+l+u+"[^aeiouwxy]$"),O=function(e){var t,r,i,n,s,u,l;if(e.length<3)return e;if("y"==(i=e.substr(0,1))&&(e=i.toUpperCase()+e.substr(1)),s=y,(n=p).test(e)?e=e.replace(n,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=g,(n=m).test(e)){var O=n.exec(e);(n=c).test(O[1])&&(n=x,e=e.replace(n,""))}else s.test(e)&&(t=(O=s.exec(e))[1],(s=f).test(t)&&(u=v,l=w,(s=R).test(e=t)?e+="e":u.test(e)?(n=x,e=e.replace(n,"")):l.test(e)&&(e+="e")));return(n=Q).test(e)&&(e=(t=(O=n.exec(e))[1])+"i"),(n=k).test(e)&&(t=(O=n.exec(e))[1],r=O[2],(n=c).test(t)&&(e=t+o[r])),(n=S).test(e)&&(t=(O=n.exec(e))[1],r=O[2],(n=c).test(t)&&(e=t+a[r])),s=b,(n=E).test(e)?(t=(O=n.exec(e))[1],(n=h).test(t)&&(e=t)):s.test(e)&&(t=(O=s.exec(e))[1]+O[2],(s=h).test(t)&&(e=t)),(n=L).test(e)&&(t=(O=n.exec(e))[1],s=d,u=T,((n=h).test(t)||s.test(t)&&!u.test(t))&&(e=t)),s=h,(n=P).test(e)&&s.test(e)&&(n=x,e=e.replace(n,"")),"y"==i&&(e=i.toLowerCase()+e.substr(1)),e},function(e){return e.update(O)}),I.Pipeline.registerFunction(I.stemmer,"stemmer"),I.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},I.stopWordFilter=I.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),I.Pipeline.registerFunction(I.stopWordFilter,"stopWordFilter"),I.trimmer=function(e){return e.update((function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")}))},I.Pipeline.registerFunction(I.trimmer,"trimmer"),I.TokenSet=function(){this.final=!1,this.edges={},this.id=I.TokenSet._nextId,I.TokenSet._nextId+=1},I.TokenSet._nextId=1,I.TokenSet.fromArray=function(e){for(var t=new I.TokenSet.Builder,r=0,i=e.length;r<i;r++)t.insert(e[r]);return t.finish(),t.root},I.TokenSet.fromClause=function(e){return"editDistance"in e?I.TokenSet.fromFuzzyString(e.term,e.editDistance):I.TokenSet.fromString(e.term)},I.TokenSet.fromFuzzyString=function(e,t){for(var r=new I.TokenSet,i=[{node:r,editsRemaining:t,str:e}];i.length;){var n=i.pop();if(n.str.length>0){var s,o=n.str.charAt(0);o in n.node.edges?s=n.node.edges[o]:(s=new I.TokenSet,n.node.edges[o]=s),1==n.str.length&&(s.final=!0),i.push({node:s,editsRemaining:n.editsRemaining,str:n.str.slice(1)})}if(0!=n.editsRemaining){if("*"in n.node.edges)var a=n.node.edges["*"];else a=new I.TokenSet,n.node.edges["*"]=a;if(0==n.str.length&&(a.final=!0),i.push({node:a,editsRemaining:n.editsRemaining-1,str:n.str}),n.str.length>1&&i.push({node:n.node,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)}),1==n.str.length&&(n.node.final=!0),n.str.length>=1){if("*"in n.node.edges)var u=n.node.edges["*"];else u=new I.TokenSet,n.node.edges["*"]=u;1==n.str.length&&(u.final=!0),i.push({node:u,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)})}if(n.str.length>1){var l,c=n.str.charAt(0),h=n.str.charAt(1);h in n.node.edges?l=n.node.edges[h]:(l=new I.TokenSet,n.node.edges[h]=l),1==n.str.length&&(l.final=!0),i.push({node:l,editsRemaining:n.editsRemaining-1,str:c+n.str.slice(2)})}}}return r},I.TokenSet.fromString=function(e){for(var t=new I.TokenSet,r=t,i=0,n=e.length;i<n;i++){var s=e[i],o=i==n-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new I.TokenSet;a.final=o,t.edges[s]=a,t=a}}return r},I.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<n;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},I.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t[i];e=e+n+this.edges[n].id}return e},I.TokenSet.prototype.intersect=function(e){for(var t=new I.TokenSet,r=void 0,i=[{qNode:e,output:t,node:this}];i.length;){r=i.pop();for(var n=Object.keys(r.qNode.edges),s=n.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=n[u],c=0;c<a;c++){var h=o[c];if(h==l||"*"==l){var d=r.node.edges[h],f=r.qNode.edges[l],p=d.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges[h]).final=y.final||p:((y=new I.TokenSet).final=p,r.output.edges[h]=y),i.push({qNode:f,output:y,node:d})}}}return t},I.TokenSet.Builder=function(){this.previousWord="",this.root=new I.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},I.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;for(this.minimize(r),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child,i=r;i<e.length;i++){var n=new I.TokenSet,s=e[i];t.edges[s]=n,this.uncheckedNodes.push({parent:t,char:s,child:n}),t=n}t.final=!0,this.previousWord=e},I.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},I.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},I.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},I.Index.prototype.search=function(e){return this.query((function(t){new I.QueryParser(e,t).parse()}))},I.Index.prototype.query=function(e){for(var t=new I.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)i[this.fields[a]]=new I.Vector;for(e.call(t,t),a=0;a<t.clauses.length;a++){var u,l=t.clauses[a],c=I.Set.empty;u=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var h=0;h<u.length;h++){var d=u[h];l.term=d;var f=I.TokenSet.fromClause(l),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&l.presence===I.Query.presence.REQUIRED){for(var y=0;y<l.fields.length;y++)s[F=l.fields[y]]=I.Set.empty;break}for(var m=0;m<p.length;m++){var g=p[m],x=this.invertedIndex[g],R=x._index;for(y=0;y<l.fields.length;y++){var v=x[F=l.fields[y]],w=Object.keys(v),Q=g+"/"+F,k=new I.Set(w);if(l.presence==I.Query.presence.REQUIRED&&(c=c.union(k),void 0===s[F]&&(s[F]=I.Set.complete)),l.presence!=I.Query.presence.PROHIBITED){if(i[F].upsert(R,l.boost,(function(e,t){return e+t})),!n[Q]){for(var S=0;S<w.length;S++){var E,b=w[S],L=new I.FieldRef(b,F),P=v[b];void 0===(E=r[L])?r[L]=new I.MatchData(g,F,P):E.add(g,F,P)}n[Q]=!0}}else void 0===o[F]&&(o[F]=I.Set.empty),o[F]=o[F].union(k)}}}if(l.presence===I.Query.presence.REQUIRED)for(y=0;y<l.fields.length;y++)s[F=l.fields[y]]=s[F].intersect(c)}var T=I.Set.complete,O=I.Set.empty;for(a=0;a<this.fields.length;a++){var F;s[F=this.fields[a]]&&(T=T.intersect(s[F])),o[F]&&(O=O.union(o[F]))}var C=Object.keys(r),j=[],N=Object.create(null);if(t.isNegated())for(C=Object.keys(this.fieldVectors),a=0;a<C.length;a++){L=C[a];var _=I.FieldRef.fromString(L);r[L]=new I.MatchData}for(a=0;a<C.length;a++){var D=(_=I.FieldRef.fromString(C[a])).docRef;if(T.contains(D)&&!O.contains(D)){var A,B=this.fieldVectors[_],V=i[_.fieldName].similarity(B);if(void 0!==(A=N[D]))A.score+=V,A.matchData.combine(r[_]);else{var z={ref:D,score:V,matchData:r[_]};N[D]=z,j.push(z)}}}return j.sort((function(e,t){return t.score-e.score}))},I.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:I.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},I.Index.load=function(e){var t={},r={},i=e.fieldVectors,n=Object.create(null),s=e.invertedIndex,o=new I.TokenSet.Builder,a=I.Pipeline.load(e.pipeline);e.version!=I.version&&I.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+I.version+"' does not match serialized index '"+e.version+"'");for(var u=0;u<i.length;u++){var l=(h=i[u])[0],c=h[1];r[l]=new I.Vector(c)}for(u=0;u<s.length;u++){var h,d=(h=s[u])[0],f=h[1];o.insert(d),n[d]=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=n,t.tokenSet=o.root,t.pipeline=a,new I.Index(t)},I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(e){this._ref=e},I.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},I.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},I.Builder.prototype.k1=function(e){this._k1=e},I.Builder.prototype.add=function(e,t){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var n=0;n<i.length;n++){var s=i[n],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new I.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<i.length;y++)p[i[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],x=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(x)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},i={},n=0;n<t;n++){var s=I.FieldRef.fromString(e[n]),o=s.fieldName;i[o]||(i[o]=0),i[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var u=a[n];r[u]=r[u]/i[u]}this.averageFieldLength=r},I.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,i=Object.create(null),n=0;n<r;n++){for(var s=I.FieldRef.fromString(t[n]),o=s.fieldName,a=this.fieldLengths[s],u=new I.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,x=c[p],R=l[x],v=this.invertedIndex[x]._index;void 0===i[x]?(y=I.idf(this.invertedIndex[x],this.documentCount),i[x]=y):y=i[x],m=y*((this._k1+1)*R)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+R),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(v,g)}e[s]=u}this.fieldVectors=e},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},I.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r||{}),s=0;s<n.length;s++){var o=n[s];i[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=i)},I.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t[r],n=Object.keys(e.metadata[i]);null==this.metadata[i]&&(this.metadata[i]=Object.create(null));for(var s=0;s<n.length;s++){var o=n[s],a=Object.keys(e.metadata[i][o]);null==this.metadata[i][o]&&(this.metadata[i][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[i][o][l]?this.metadata[i][o][l]=e.metadata[i][o][l]:this.metadata[i][o][l]=this.metadata[i][o][l].concat(e.metadata[i][o][l])}}}},I.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in this.metadata[e])for(var i=Object.keys(r),n=0;n<i.length;n++){var s=i[n];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}else this.metadata[e][t]=r},I.Query=function(e){this.clauses=[],this.allFields=e},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=I.Query.wildcard.NONE),e.wildcard&I.Query.wildcard.LEADING&&e.term.charAt(0)!=I.Query.wildcard&&(e.term="*"+e.term),e.wildcard&I.Query.wildcard.TRAILING&&e.term.slice(-1)!=I.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=I.Query.presence.OPTIONAL),this.clauses.push(e),this},I.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,I.utils.clone(t))}),this),this;var r=t||{};return r.term=e.toString(),this.clause(r),this},I.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},I.QueryParseError.prototype=new Error,I.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var e=I.QueryLexer.lexText;e;)e=e(this)},I.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},I.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(e){return e.backup(),e.emit(I.QueryLexer.FIELD),e.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(I.QueryLexer.TERM)),e.ignore(),e.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return I.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(t.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else e.escapeCharacter()}},I.QueryParser=function(e,t){this.lexer=new I.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=I.QueryParser.parseClause;e;)e=e(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},I.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},I.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new I.QueryParseError(r,t.start,t.end)}},I.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=I.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+t.str+"'";throw new I.QueryParseError(r,t.start,t.end)}var i=e.peekLexeme();if(null==i)throw r="expecting term or field, found nothing",new I.QueryParseError(r,t.start,t.end);switch(i.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:throw r="expecting term or field, found '"+i.type+"'",new I.QueryParseError(r,i.start,i.end)}}},I.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),i="unrecognised field '"+t.str+"', possible fields: "+r;throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n)throw i="expecting term, found nothing",new I.QueryParseError(i,t.start,t.end);if(n.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;throw i="expecting term, found '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}},I.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new I.QueryParseError(i,r.start,r.end)}else e.nextClause()}},I.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:throw i="Unexpected lexeme type '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},I.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:throw i="Unexpected lexeme type '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},void 0===(n="function"==typeof(i=function(){return I})?i.call(t,r,t,e):i)||(e.exports=n)}()},567:(e,t,r)=>{var i=r(314),n=["add","done","toJS","fromExternalJS","load","dispose","search","Worker"];e.exports=function(){var e=new Worker(URL.createObjectURL(new Blob(['/*! For license information please see c583fb27fbae15fc4e3d.worker.js.LICENSE.txt */\n(()=>{var e={336:(e,t,r)=>{var i,n;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,v,w,Q,k,S,E,P,L,b,T,O,I,R=function(e){var t=new R.Builder;return t.pipeline.add(R.trimmer,R.stopWordFilter,R.stemmer),t.searchPipeline.add(R.stemmer),e.call(t,t),t.build()};R.version="2.3.9",R.utils={},R.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),R.utils.asString=function(e){return null==e?"":e.toString()},R.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var n=r[i],s=e[n];if(Array.isArray(s))t[n]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[n]=s}}return t},R.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},R.FieldRef.joiner="/",R.FieldRef.fromString=function(e){var t=e.indexOf(R.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new R.FieldRef(i,r,e)},R.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+R.FieldRef.joiner+this.docRef),this._stringValue},R.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},R.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},R.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},R.Set.prototype.contains=function(e){return!!this.elements[e]},R.Set.prototype.intersect=function(e){var t,r,i,n=[];if(e===R.Set.complete)return this;if(e===R.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),i=Object.keys(t.elements);for(var s=0;s<i.length;s++){var o=i[s];o in r.elements&&n.push(o)}return new R.Set(n)},R.Set.prototype.union=function(e){return e===R.Set.complete?R.Set.complete:e===R.Set.empty?this:new R.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},R.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},R.Token=function(e,t){this.str=e||"",this.metadata=t||{}},R.Token.prototype.toString=function(){return this.str},R.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},R.Token.prototype.clone=function(e){return e=e||function(e){return e},new R.Token(e(this.str,this.metadata),this.metadata)},R.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new R.Token(R.utils.asString(e).toLowerCase(),R.utils.clone(t))}));for(var r=e.toString().toLowerCase(),i=r.length,n=[],s=0,o=0;s<=i;s++){var a=s-o;if(r.charAt(s).match(R.tokenizer.separator)||s==i){if(a>0){var u=R.utils.clone(t)||{};u.position=[o,a],u.index=n.length,n.push(new R.Token(r.slice(o,s),u))}o=s+1}}return n},R.tokenizer.separator=/[\\s\\-]+/,R.Pipeline=function(){this._stack=[]},R.Pipeline.registeredFunctions=Object.create(null),R.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&R.utils.warn("Overwriting existing registered function: "+t),e.label=t,R.Pipeline.registeredFunctions[e.label]=e},R.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||R.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\\n",e)},R.Pipeline.load=function(e){var t=new R.Pipeline;return e.forEach((function(e){var r=R.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},R.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach((function(e){R.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},R.Pipeline.prototype.after=function(e,t){R.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},R.Pipeline.prototype.before=function(e,t){R.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},R.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},R.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack[r],n=[],s=0;s<e.length;s++){var o=i(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)n.push(o[a]);else n.push(o)}e=n}return e},R.Pipeline.prototype.runString=function(e,t){var r=new R.Token(e,t);return this.run([r]).map((function(e){return e.toString()}))},R.Pipeline.prototype.reset=function(){this._stack=[]},R.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return R.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},R.Vector=function(e){this._magnitude=0,this.elements=e||[]},R.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(s<e&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e||s>e?2*n:s<e?2*(n+1):void 0},R.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},R.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},R.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},R.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u<n&&l<s;)(o=r[u])<(a=i[l])?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},R.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},R.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},R.Vector.prototype.toJSON=function(){return this.elements},R.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},u="[aeiouy]",l="[^aeiou][^aeiouy]*",c=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),p=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,x=/.$/,v=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\\\1$"),Q=new RegExp("^"+l+u+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,S=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,P=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,L=/^(.+?)(s|t)(ion)$/,b=/^(.+?)e$/,T=/ll$/,O=new RegExp("^"+l+u+"[^aeiouwxy]$"),I=function(e){var t,r,i,n,s,u,l;if(e.length<3)return e;if("y"==(i=e.substr(0,1))&&(e=i.toUpperCase()+e.substr(1)),s=y,(n=p).test(e)?e=e.replace(n,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=g,(n=m).test(e)){var I=n.exec(e);(n=c).test(I[1])&&(n=x,e=e.replace(n,""))}else s.test(e)&&(t=(I=s.exec(e))[1],(s=f).test(t)&&(u=w,l=Q,(s=v).test(e=t)?e+="e":u.test(e)?(n=x,e=e.replace(n,"")):l.test(e)&&(e+="e")));return(n=k).test(e)&&(e=(t=(I=n.exec(e))[1])+"i"),(n=S).test(e)&&(t=(I=n.exec(e))[1],r=I[2],(n=c).test(t)&&(e=t+o[r])),(n=E).test(e)&&(t=(I=n.exec(e))[1],r=I[2],(n=c).test(t)&&(e=t+a[r])),s=L,(n=P).test(e)?(t=(I=n.exec(e))[1],(n=h).test(t)&&(e=t)):s.test(e)&&(t=(I=s.exec(e))[1]+I[2],(s=h).test(t)&&(e=t)),(n=b).test(e)&&(t=(I=n.exec(e))[1],s=d,u=O,((n=h).test(t)||s.test(t)&&!u.test(t))&&(e=t)),s=h,(n=T).test(e)&&s.test(e)&&(n=x,e=e.replace(n,"")),"y"==i&&(e=i.toLowerCase()+e.substr(1)),e},function(e){return e.update(I)}),R.Pipeline.registerFunction(R.stemmer,"stemmer"),R.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},R.stopWordFilter=R.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),R.Pipeline.registerFunction(R.stopWordFilter,"stopWordFilter"),R.trimmer=function(e){return e.update((function(e){return e.replace(/^\\W+/,"").replace(/\\W+$/,"")}))},R.Pipeline.registerFunction(R.trimmer,"trimmer"),R.TokenSet=function(){this.final=!1,this.edges={},this.id=R.TokenSet._nextId,R.TokenSet._nextId+=1},R.TokenSet._nextId=1,R.TokenSet.fromArray=function(e){for(var t=new R.TokenSet.Builder,r=0,i=e.length;r<i;r++)t.insert(e[r]);return t.finish(),t.root},R.TokenSet.fromClause=function(e){return"editDistance"in e?R.TokenSet.fromFuzzyString(e.term,e.editDistance):R.TokenSet.fromString(e.term)},R.TokenSet.fromFuzzyString=function(e,t){for(var r=new R.TokenSet,i=[{node:r,editsRemaining:t,str:e}];i.length;){var n=i.pop();if(n.str.length>0){var s,o=n.str.charAt(0);o in n.node.edges?s=n.node.edges[o]:(s=new R.TokenSet,n.node.edges[o]=s),1==n.str.length&&(s.final=!0),i.push({node:s,editsRemaining:n.editsRemaining,str:n.str.slice(1)})}if(0!=n.editsRemaining){if("*"in n.node.edges)var a=n.node.edges["*"];else a=new R.TokenSet,n.node.edges["*"]=a;if(0==n.str.length&&(a.final=!0),i.push({node:a,editsRemaining:n.editsRemaining-1,str:n.str}),n.str.length>1&&i.push({node:n.node,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)}),1==n.str.length&&(n.node.final=!0),n.str.length>=1){if("*"in n.node.edges)var u=n.node.edges["*"];else u=new R.TokenSet,n.node.edges["*"]=u;1==n.str.length&&(u.final=!0),i.push({node:u,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)})}if(n.str.length>1){var l,c=n.str.charAt(0),h=n.str.charAt(1);h in n.node.edges?l=n.node.edges[h]:(l=new R.TokenSet,n.node.edges[h]=l),1==n.str.length&&(l.final=!0),i.push({node:l,editsRemaining:n.editsRemaining-1,str:c+n.str.slice(2)})}}}return r},R.TokenSet.fromString=function(e){for(var t=new R.TokenSet,r=t,i=0,n=e.length;i<n;i++){var s=e[i],o=i==n-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new R.TokenSet;a.final=o,t.edges[s]=a,t=a}}return r},R.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<n;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},R.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t[i];e=e+n+this.edges[n].id}return e},R.TokenSet.prototype.intersect=function(e){for(var t=new R.TokenSet,r=void 0,i=[{qNode:e,output:t,node:this}];i.length;){r=i.pop();for(var n=Object.keys(r.qNode.edges),s=n.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=n[u],c=0;c<a;c++){var h=o[c];if(h==l||"*"==l){var d=r.node.edges[h],f=r.qNode.edges[l],p=d.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges[h]).final=y.final||p:((y=new R.TokenSet).final=p,r.output.edges[h]=y),i.push({qNode:f,output:y,node:d})}}}return t},R.TokenSet.Builder=function(){this.previousWord="",this.root=new R.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},R.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;for(this.minimize(r),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child,i=r;i<e.length;i++){var n=new R.TokenSet,s=e[i];t.edges[s]=n,this.uncheckedNodes.push({parent:t,char:s,child:n}),t=n}t.final=!0,this.previousWord=e},R.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},R.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},R.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},R.Index.prototype.search=function(e){return this.query((function(t){new R.QueryParser(e,t).parse()}))},R.Index.prototype.query=function(e){for(var t=new R.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)i[this.fields[a]]=new R.Vector;for(e.call(t,t),a=0;a<t.clauses.length;a++){var u,l=t.clauses[a],c=R.Set.empty;u=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var h=0;h<u.length;h++){var d=u[h];l.term=d;var f=R.TokenSet.fromClause(l),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&l.presence===R.Query.presence.REQUIRED){for(var y=0;y<l.fields.length;y++)s[F=l.fields[y]]=R.Set.empty;break}for(var m=0;m<p.length;m++){var g=p[m],x=this.invertedIndex[g],v=x._index;for(y=0;y<l.fields.length;y++){var w=x[F=l.fields[y]],Q=Object.keys(w),k=g+"/"+F,S=new R.Set(Q);if(l.presence==R.Query.presence.REQUIRED&&(c=c.union(S),void 0===s[F]&&(s[F]=R.Set.complete)),l.presence!=R.Query.presence.PROHIBITED){if(i[F].upsert(v,l.boost,(function(e,t){return e+t})),!n[k]){for(var E=0;E<Q.length;E++){var P,L=Q[E],b=new R.FieldRef(L,F),T=w[L];void 0===(P=r[b])?r[b]=new R.MatchData(g,F,T):P.add(g,F,T)}n[k]=!0}}else void 0===o[F]&&(o[F]=R.Set.empty),o[F]=o[F].union(S)}}}if(l.presence===R.Query.presence.REQUIRED)for(y=0;y<l.fields.length;y++)s[F=l.fields[y]]=s[F].intersect(c)}var O=R.Set.complete,I=R.Set.empty;for(a=0;a<this.fields.length;a++){var F;s[F=this.fields[a]]&&(O=O.intersect(s[F])),o[F]&&(I=I.union(o[F]))}var C=Object.keys(r),N=[],j=Object.create(null);if(t.isNegated())for(C=Object.keys(this.fieldVectors),a=0;a<C.length;a++){b=C[a];var _=R.FieldRef.fromString(b);r[b]=new R.MatchData}for(a=0;a<C.length;a++){var D=(_=R.FieldRef.fromString(C[a])).docRef;if(O.contains(D)&&!I.contains(D)){var A,B=this.fieldVectors[_],z=i[_.fieldName].similarity(B);if(void 0!==(A=j[D]))A.score+=z,A.matchData.combine(r[_]);else{var V={ref:D,score:z,matchData:r[_]};j[D]=V,N.push(V)}}}return N.sort((function(e,t){return t.score-e.score}))},R.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:R.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},R.Index.load=function(e){var t={},r={},i=e.fieldVectors,n=Object.create(null),s=e.invertedIndex,o=new R.TokenSet.Builder,a=R.Pipeline.load(e.pipeline);e.version!=R.version&&R.utils.warn("Version mismatch when loading serialised index. Current version of lunr \'"+R.version+"\' does not match serialized index \'"+e.version+"\'");for(var u=0;u<i.length;u++){var l=(h=i[u])[0],c=h[1];r[l]=new R.Vector(c)}for(u=0;u<s.length;u++){var h,d=(h=s[u])[0],f=h[1];o.insert(d),n[d]=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=n,t.tokenSet=o.root,t.pipeline=a,new R.Index(t)},R.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=R.tokenizer,this.pipeline=new R.Pipeline,this.searchPipeline=new R.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},R.Builder.prototype.ref=function(e){this._ref=e},R.Builder.prototype.field=function(e,t){if(/\\//.test(e))throw new RangeError("Field \'"+e+"\' contains illegal character \'/\'");this._fields[e]=t||{}},R.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},R.Builder.prototype.k1=function(e){this._k1=e},R.Builder.prototype.add=function(e,t){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var n=0;n<i.length;n++){var s=i[n],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new R.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<i.length;y++)p[i[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],x=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(x)}}}},R.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},i={},n=0;n<t;n++){var s=R.FieldRef.fromString(e[n]),o=s.fieldName;i[o]||(i[o]=0),i[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var u=a[n];r[u]=r[u]/i[u]}this.averageFieldLength=r},R.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,i=Object.create(null),n=0;n<r;n++){for(var s=R.FieldRef.fromString(t[n]),o=s.fieldName,a=this.fieldLengths[s],u=new R.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,x=c[p],v=l[x],w=this.invertedIndex[x]._index;void 0===i[x]?(y=R.idf(this.invertedIndex[x],this.documentCount),i[x]=y):y=i[x],m=y*((this._k1+1)*v)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+v),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(w,g)}e[s]=u}this.fieldVectors=e},R.Builder.prototype.createTokenSet=function(){this.tokenSet=R.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},R.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new R.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},R.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},R.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r||{}),s=0;s<n.length;s++){var o=n[s];i[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=i)},R.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t[r],n=Object.keys(e.metadata[i]);null==this.metadata[i]&&(this.metadata[i]=Object.create(null));for(var s=0;s<n.length;s++){var o=n[s],a=Object.keys(e.metadata[i][o]);null==this.metadata[i][o]&&(this.metadata[i][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[i][o][l]?this.metadata[i][o][l]=e.metadata[i][o][l]:this.metadata[i][o][l]=this.metadata[i][o][l].concat(e.metadata[i][o][l])}}}},R.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in this.metadata[e])for(var i=Object.keys(r),n=0;n<i.length;n++){var s=i[n];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}else this.metadata[e][t]=r},R.Query=function(e){this.clauses=[],this.allFields=e},R.Query.wildcard=new String("*"),R.Query.wildcard.NONE=0,R.Query.wildcard.LEADING=1,R.Query.wildcard.TRAILING=2,R.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},R.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=R.Query.wildcard.NONE),e.wildcard&R.Query.wildcard.LEADING&&e.term.charAt(0)!=R.Query.wildcard&&(e.term="*"+e.term),e.wildcard&R.Query.wildcard.TRAILING&&e.term.slice(-1)!=R.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=R.Query.presence.OPTIONAL),this.clauses.push(e),this},R.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=R.Query.presence.PROHIBITED)return!1;return!0},R.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,R.utils.clone(t))}),this),this;var r=t||{};return r.term=e.toString(),this.clause(r),this},R.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},R.QueryParseError.prototype=new Error,R.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},R.QueryLexer.prototype.run=function(){for(var e=R.QueryLexer.lexText;e;)e=e(this)},R.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},R.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},R.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},R.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return R.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},R.QueryLexer.prototype.width=function(){return this.pos-this.start},R.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},R.QueryLexer.prototype.backup=function(){this.pos-=1},R.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=R.QueryLexer.EOS&&this.backup()},R.QueryLexer.prototype.more=function(){return this.pos<this.length},R.QueryLexer.EOS="EOS",R.QueryLexer.FIELD="FIELD",R.QueryLexer.TERM="TERM",R.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",R.QueryLexer.BOOST="BOOST",R.QueryLexer.PRESENCE="PRESENCE",R.QueryLexer.lexField=function(e){return e.backup(),e.emit(R.QueryLexer.FIELD),e.ignore(),R.QueryLexer.lexText},R.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(R.QueryLexer.TERM)),e.ignore(),e.more())return R.QueryLexer.lexText},R.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(R.QueryLexer.EDIT_DISTANCE),R.QueryLexer.lexText},R.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(R.QueryLexer.BOOST),R.QueryLexer.lexText},R.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(R.QueryLexer.TERM)},R.QueryLexer.termSeparator=R.tokenizer.separator,R.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==R.QueryLexer.EOS)return R.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return R.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(R.QueryLexer.TERM),R.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(R.QueryLexer.TERM),R.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if(t.match(R.QueryLexer.termSeparator))return R.QueryLexer.lexTerm}else e.escapeCharacter()}},R.QueryParser=function(e,t){this.lexer=new R.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},R.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=R.QueryParser.parseClause;e;)e=e(this);return this.query},R.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},R.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},R.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},R.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case R.QueryLexer.PRESENCE:return R.QueryParser.parsePresence;case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value \'"+t.str+"\'"),new R.QueryParseError(r,t.start,t.end)}},R.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=R.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=R.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator\'"+t.str+"\'";throw new R.QueryParseError(r,t.start,t.end)}var i=e.peekLexeme();if(null==i)throw r="expecting term or field, found nothing",new R.QueryParseError(r,t.start,t.end);switch(i.type){case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:throw r="expecting term or field, found \'"+i.type+"\'",new R.QueryParseError(r,i.start,i.end)}}},R.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"\'"+e+"\'"})).join(", "),i="unrecognised field \'"+t.str+"\', possible fields: "+r;throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n)throw i="expecting term, found nothing",new R.QueryParseError(i,t.start,t.end);if(n.type===R.QueryLexer.TERM)return R.QueryParser.parseTerm;throw i="expecting term, found \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}},R.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:var i="Unexpected lexeme type \'"+r.type+"\'";throw new R.QueryParseError(i,r.start,r.end)}else e.nextClause()}},R.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:throw i="Unexpected lexeme type \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}else e.nextClause()}},R.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:throw i="Unexpected lexeme type \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}else e.nextClause()}},void 0===(n="function"==typeof(i=function(){return R})?i.call(t,r,t,e):i)||(e.exports=n)}()}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{"use strict";r.d(i,{add:()=>l,done:()=>c,toJS:()=>h,fromExternalJS:()=>d,load:()=>f,dispose:()=>p,search:()=>y});var e=r(336),t=(Object.defineProperty,(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{a(r.next(e))}catch(e){n(e)}},o=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())})));let n,s,o,a=[];function u(){n=new e.Builder,n.field("title"),n.field("description"),n.ref("ref"),n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),o=new Promise((e=>{s=e}))}function l(e,t,r){const i=a.push(r)-1,s={title:e.toLowerCase(),description:t.toLowerCase(),ref:i};n.add(s)}function c(){return t(this,null,(function*(){s(n.build())}))}function h(){return t(this,null,(function*(){return{store:a,index:(yield o).toJSON()}}))}function d(e,r){return t(this,null,(function*(){try{if(importScripts(e),!self[r])throw new Error("Broken index file format");yield f(self[r])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function f(r){return t(this,null,(function*(){a=r.store,s(e.Index.load(r.index))}))}function p(){return t(this,null,(function*(){a=[],u()}))}function y(r,i=0){return t(this,null,(function*(){if(0===r.trim().length)return[];let t=(yield o).query((t=>{r.trim().toLowerCase().split(/\\s+/).forEach((r=>{if(1===r.length)return;const i=(t=>"*"+e.stemmer(new e.Token(t,{}))+"*")(r);t.term(i,{})}))}));return i>0&&(t=t.slice(0,i)),t.map((e=>({meta:a[e.ref],score:e.score})))}))}e.tokenizer.separator=/\\s+/,u(),addEventListener("message",(function(e){var t,r=e.data,n=r.type,s=r.method,o=r.id,a=r.params;"RPC"===n&&s&&((t=i[s])?Promise.resolve().then((function(){return t.apply(i,a)})):Promise.reject("No such method")).then((function(e){postMessage({type:"RPC",id:o,result:e})})).catch((function(e){var t={message:e};e.stack&&(t.message=e.message,t.stack=e.stack,t.name=e.name),postMessage({type:"RPC",id:o,error:t})}))})),postMessage({type:"RPC",method:"ready"})})()})();'])),{name:"[fullhash].worker.js"});return i(e,n),e}},314:e=>{e.exports=function(e,t){var r=0,i={};e.addEventListener("message",(function(t){var r=t.data;if("RPC"===r.type)if(r.id){var n=i[r.id];n&&(delete i[r.id],r.error?n[1](Object.assign(Error(r.error.message),r.error)):n[0](r.result))}else{var s=document.createEvent("Event");s.initEvent(r.method,!1,!1),s.data=r.params,e.dispatchEvent(s)}})),t.forEach((function(t){e[t]=function(){var n=arguments;return new Promise((function(s,o){var a=++r;i[a]=[s,o],e.postMessage({type:"RPC",id:a,method:t,params:[].slice.call(n)})}))}}))}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{SearchStore:()=>n});const e="undefined"!=typeof window&&"HTMLElement"in window;"undefined"==typeof Element||Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(e){e=0===arguments.length||!!e;const t=this.parentNode,r=window.getComputedStyle(t,void 0),i=parseInt(r.getPropertyValue("border-top-width"),10),n=parseInt(r.getPropertyValue("border-left-width"),10),s=this.offsetTop-t.offsetTop<t.scrollTop,o=this.offsetTop-t.offsetTop+this.clientHeight-i>t.scrollTop+t.clientHeight,a=this.offsetLeft-t.offsetLeft<t.scrollLeft,u=this.offsetLeft-t.offsetLeft+this.clientWidth-n>t.scrollLeft+t.clientWidth,l=s&&!o;(s||o)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-i+this.clientHeight/2),(a||u)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-n+this.clientWidth/2),(s||o||a||u)&&!e&&this.scrollIntoView(l)});var t=Object.defineProperty;class n{constructor(){var i,n,s;i=this,n="searchWorker",s=function(){let t;if(e)try{t=r(567)}catch(e){t=r(27).ZP}else t=r(27).ZP;return new t}(),((e,r,i)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i})(i,"symbol"!=typeof n?n+"":n,s)}indexItems(e){const t=e=>{e.forEach((e=>{"group"!==e.type&&this.add(e.name,e.description||"",e.id),t(e.items)}))};t(e),this.searchWorker.done()}add(e,t,r){this.searchWorker.add(e,t,r)}dispose(){this.searchWorker.terminate(),this.searchWorker.dispose()}search(e){return this.searchWorker.search(e)}toJS(){return e=this,null,t=function*(){return this.searchWorker.toJS()},new Promise(((r,i)=>{var n=e=>{try{o(t.next(e))}catch(e){i(e)}},s=e=>{try{o(t.throw(e))}catch(e){i(e)}},o=e=>e.done?r(e.value):Promise.resolve(e.value).then(n,s);o((t=t.apply(e,null)).next())}));var e,t}load(e){this.searchWorker.load(e)}fromExternalJS(e,t){e&&t&&this.searchWorker.fromExternalJS(e,t)}}})(),i})()}));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SearchStore=t():e.SearchStore=t()}(this,(function(){return(()=>{var e={27:(e,t,r)=>{"use strict";r.d(t,{ZP:()=>a});var i=r(336),n=Object.defineProperty,s=(e,t,r)=>(((e,t,r)=>{t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),o=(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{a(r.next(e))}catch(e){n(e)}},o=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())}));class a{constructor(){s(this,"add",f),s(this,"done",p),s(this,"search",R),s(this,"toJS",y),s(this,"load",g),s(this,"dispose",x),s(this,"fromExternalJS",m)}}let u,l,c,h=[];function d(){u=new i.Builder,u.field("title"),u.field("description"),u.ref("ref"),u.pipeline.add(i.trimmer,i.stopWordFilter,i.stemmer),c=new Promise((e=>{l=e}))}function f(e,t,r){const i=h.push(r)-1,n={title:e.toLowerCase(),description:t.toLowerCase(),ref:i};u.add(n)}function p(){return o(this,null,(function*(){l(u.build())}))}function y(){return o(this,null,(function*(){return{store:h,index:(yield c).toJSON()}}))}function m(e,t){return o(this,null,(function*(){try{if(importScripts(e),!self[t])throw new Error("Broken index file format");yield g(self[t])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function g(e){return o(this,null,(function*(){h=e.store,l(i.Index.load(e.index))}))}function x(){return o(this,null,(function*(){h=[],d()}))}function R(e,t=0){return o(this,null,(function*(){if(0===e.trim().length)return[];let r=(yield c).query((t=>{e.trim().toLowerCase().split(/\s+/).forEach((e=>{if(1===e.length)return;const r=(e=>"*"+i.stemmer(new i.Token(e,{}))+"*")(e);t.term(r,{})}))}));return t>0&&(r=r.slice(0,t)),r.map((e=>({meta:h[e.ref],score:e.score})))}))}i.tokenizer.separator=/\s+/,d()},336:(e,t,r)=>{var i,n;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,R,v,w,Q,k,S,E,b,L,P,T,O,I=function(e){var t=new I.Builder;return t.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),t.searchPipeline.add(I.stemmer),e.call(t,t),t.build()};I.version="2.3.9",I.utils={},I.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),I.utils.asString=function(e){return null==e?"":e.toString()},I.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var n=r[i],s=e[n];if(Array.isArray(s))t[n]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[n]=s}}return t},I.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},I.FieldRef.joiner="/",I.FieldRef.fromString=function(e){var t=e.indexOf(I.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new I.FieldRef(i,r,e)},I.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+I.FieldRef.joiner+this.docRef),this._stringValue},I.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},I.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},I.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},I.Set.prototype.contains=function(e){return!!this.elements[e]},I.Set.prototype.intersect=function(e){var t,r,i,n=[];if(e===I.Set.complete)return this;if(e===I.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),i=Object.keys(t.elements);for(var s=0;s<i.length;s++){var o=i[s];o in r.elements&&n.push(o)}return new I.Set(n)},I.Set.prototype.union=function(e){return e===I.Set.complete?I.Set.complete:e===I.Set.empty?this:new I.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},I.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},I.Token=function(e,t){this.str=e||"",this.metadata=t||{}},I.Token.prototype.toString=function(){return this.str},I.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},I.Token.prototype.clone=function(e){return e=e||function(e){return e},new I.Token(e(this.str,this.metadata),this.metadata)},I.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new I.Token(I.utils.asString(e).toLowerCase(),I.utils.clone(t))}));for(var r=e.toString().toLowerCase(),i=r.length,n=[],s=0,o=0;s<=i;s++){var a=s-o;if(r.charAt(s).match(I.tokenizer.separator)||s==i){if(a>0){var u=I.utils.clone(t)||{};u.position=[o,a],u.index=n.length,n.push(new I.Token(r.slice(o,s),u))}o=s+1}}return n},I.tokenizer.separator=/[\s\-]+/,I.Pipeline=function(){this._stack=[]},I.Pipeline.registeredFunctions=Object.create(null),I.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&I.utils.warn("Overwriting existing registered function: "+t),e.label=t,I.Pipeline.registeredFunctions[e.label]=e},I.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||I.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},I.Pipeline.load=function(e){var t=new I.Pipeline;return e.forEach((function(e){var r=I.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},I.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach((function(e){I.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},I.Pipeline.prototype.after=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},I.Pipeline.prototype.before=function(e,t){I.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},I.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},I.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack[r],n=[],s=0;s<e.length;s++){var o=i(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)n.push(o[a]);else n.push(o)}e=n}return e},I.Pipeline.prototype.runString=function(e,t){var r=new I.Token(e,t);return this.run([r]).map((function(e){return e.toString()}))},I.Pipeline.prototype.reset=function(){this._stack=[]},I.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return I.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},I.Vector=function(e){this._magnitude=0,this.elements=e||[]},I.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(s<e&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e||s>e?2*n:s<e?2*(n+1):void 0},I.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},I.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},I.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},I.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u<n&&l<s;)(o=r[u])<(a=i[l])?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},I.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},I.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},I.Vector.prototype.toJSON=function(){return this.elements},I.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},u="[aeiouy]",l="[^aeiou][^aeiouy]*",c=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),p=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,x=/.$/,R=/(at|bl|iz)$/,v=new RegExp("([^aeiouylsz])\\1$"),w=new RegExp("^"+l+u+"[^aeiouwxy]$"),Q=/^(.+?[^aeiou])y$/,k=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,S=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,E=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,b=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,P=/ll$/,T=new RegExp("^"+l+u+"[^aeiouwxy]$"),O=function(e){var t,r,i,n,s,u,l;if(e.length<3)return e;if("y"==(i=e.substr(0,1))&&(e=i.toUpperCase()+e.substr(1)),s=y,(n=p).test(e)?e=e.replace(n,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=g,(n=m).test(e)){var O=n.exec(e);(n=c).test(O[1])&&(n=x,e=e.replace(n,""))}else s.test(e)&&(t=(O=s.exec(e))[1],(s=f).test(t)&&(u=v,l=w,(s=R).test(e=t)?e+="e":u.test(e)?(n=x,e=e.replace(n,"")):l.test(e)&&(e+="e")));return(n=Q).test(e)&&(e=(t=(O=n.exec(e))[1])+"i"),(n=k).test(e)&&(t=(O=n.exec(e))[1],r=O[2],(n=c).test(t)&&(e=t+o[r])),(n=S).test(e)&&(t=(O=n.exec(e))[1],r=O[2],(n=c).test(t)&&(e=t+a[r])),s=b,(n=E).test(e)?(t=(O=n.exec(e))[1],(n=h).test(t)&&(e=t)):s.test(e)&&(t=(O=s.exec(e))[1]+O[2],(s=h).test(t)&&(e=t)),(n=L).test(e)&&(t=(O=n.exec(e))[1],s=d,u=T,((n=h).test(t)||s.test(t)&&!u.test(t))&&(e=t)),s=h,(n=P).test(e)&&s.test(e)&&(n=x,e=e.replace(n,"")),"y"==i&&(e=i.toLowerCase()+e.substr(1)),e},function(e){return e.update(O)}),I.Pipeline.registerFunction(I.stemmer,"stemmer"),I.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},I.stopWordFilter=I.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),I.Pipeline.registerFunction(I.stopWordFilter,"stopWordFilter"),I.trimmer=function(e){return e.update((function(e){return e.replace(/^\W+/,"").replace(/\W+$/,"")}))},I.Pipeline.registerFunction(I.trimmer,"trimmer"),I.TokenSet=function(){this.final=!1,this.edges={},this.id=I.TokenSet._nextId,I.TokenSet._nextId+=1},I.TokenSet._nextId=1,I.TokenSet.fromArray=function(e){for(var t=new I.TokenSet.Builder,r=0,i=e.length;r<i;r++)t.insert(e[r]);return t.finish(),t.root},I.TokenSet.fromClause=function(e){return"editDistance"in e?I.TokenSet.fromFuzzyString(e.term,e.editDistance):I.TokenSet.fromString(e.term)},I.TokenSet.fromFuzzyString=function(e,t){for(var r=new I.TokenSet,i=[{node:r,editsRemaining:t,str:e}];i.length;){var n=i.pop();if(n.str.length>0){var s,o=n.str.charAt(0);o in n.node.edges?s=n.node.edges[o]:(s=new I.TokenSet,n.node.edges[o]=s),1==n.str.length&&(s.final=!0),i.push({node:s,editsRemaining:n.editsRemaining,str:n.str.slice(1)})}if(0!=n.editsRemaining){if("*"in n.node.edges)var a=n.node.edges["*"];else a=new I.TokenSet,n.node.edges["*"]=a;if(0==n.str.length&&(a.final=!0),i.push({node:a,editsRemaining:n.editsRemaining-1,str:n.str}),n.str.length>1&&i.push({node:n.node,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)}),1==n.str.length&&(n.node.final=!0),n.str.length>=1){if("*"in n.node.edges)var u=n.node.edges["*"];else u=new I.TokenSet,n.node.edges["*"]=u;1==n.str.length&&(u.final=!0),i.push({node:u,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)})}if(n.str.length>1){var l,c=n.str.charAt(0),h=n.str.charAt(1);h in n.node.edges?l=n.node.edges[h]:(l=new I.TokenSet,n.node.edges[h]=l),1==n.str.length&&(l.final=!0),i.push({node:l,editsRemaining:n.editsRemaining-1,str:c+n.str.slice(2)})}}}return r},I.TokenSet.fromString=function(e){for(var t=new I.TokenSet,r=t,i=0,n=e.length;i<n;i++){var s=e[i],o=i==n-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new I.TokenSet;a.final=o,t.edges[s]=a,t=a}}return r},I.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<n;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},I.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t[i];e=e+n+this.edges[n].id}return e},I.TokenSet.prototype.intersect=function(e){for(var t=new I.TokenSet,r=void 0,i=[{qNode:e,output:t,node:this}];i.length;){r=i.pop();for(var n=Object.keys(r.qNode.edges),s=n.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=n[u],c=0;c<a;c++){var h=o[c];if(h==l||"*"==l){var d=r.node.edges[h],f=r.qNode.edges[l],p=d.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges[h]).final=y.final||p:((y=new I.TokenSet).final=p,r.output.edges[h]=y),i.push({qNode:f,output:y,node:d})}}}return t},I.TokenSet.Builder=function(){this.previousWord="",this.root=new I.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},I.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;for(this.minimize(r),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child,i=r;i<e.length;i++){var n=new I.TokenSet,s=e[i];t.edges[s]=n,this.uncheckedNodes.push({parent:t,char:s,child:n}),t=n}t.final=!0,this.previousWord=e},I.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},I.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},I.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},I.Index.prototype.search=function(e){return this.query((function(t){new I.QueryParser(e,t).parse()}))},I.Index.prototype.query=function(e){for(var t=new I.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)i[this.fields[a]]=new I.Vector;for(e.call(t,t),a=0;a<t.clauses.length;a++){var u,l=t.clauses[a],c=I.Set.empty;u=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var h=0;h<u.length;h++){var d=u[h];l.term=d;var f=I.TokenSet.fromClause(l),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&l.presence===I.Query.presence.REQUIRED){for(var y=0;y<l.fields.length;y++)s[F=l.fields[y]]=I.Set.empty;break}for(var m=0;m<p.length;m++){var g=p[m],x=this.invertedIndex[g],R=x._index;for(y=0;y<l.fields.length;y++){var v=x[F=l.fields[y]],w=Object.keys(v),Q=g+"/"+F,k=new I.Set(w);if(l.presence==I.Query.presence.REQUIRED&&(c=c.union(k),void 0===s[F]&&(s[F]=I.Set.complete)),l.presence!=I.Query.presence.PROHIBITED){if(i[F].upsert(R,l.boost,(function(e,t){return e+t})),!n[Q]){for(var S=0;S<w.length;S++){var E,b=w[S],L=new I.FieldRef(b,F),P=v[b];void 0===(E=r[L])?r[L]=new I.MatchData(g,F,P):E.add(g,F,P)}n[Q]=!0}}else void 0===o[F]&&(o[F]=I.Set.empty),o[F]=o[F].union(k)}}}if(l.presence===I.Query.presence.REQUIRED)for(y=0;y<l.fields.length;y++)s[F=l.fields[y]]=s[F].intersect(c)}var T=I.Set.complete,O=I.Set.empty;for(a=0;a<this.fields.length;a++){var F;s[F=this.fields[a]]&&(T=T.intersect(s[F])),o[F]&&(O=O.union(o[F]))}var C=Object.keys(r),j=[],N=Object.create(null);if(t.isNegated())for(C=Object.keys(this.fieldVectors),a=0;a<C.length;a++){L=C[a];var _=I.FieldRef.fromString(L);r[L]=new I.MatchData}for(a=0;a<C.length;a++){var D=(_=I.FieldRef.fromString(C[a])).docRef;if(T.contains(D)&&!O.contains(D)){var A,B=this.fieldVectors[_],V=i[_.fieldName].similarity(B);if(void 0!==(A=N[D]))A.score+=V,A.matchData.combine(r[_]);else{var z={ref:D,score:V,matchData:r[_]};N[D]=z,j.push(z)}}}return j.sort((function(e,t){return t.score-e.score}))},I.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:I.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},I.Index.load=function(e){var t={},r={},i=e.fieldVectors,n=Object.create(null),s=e.invertedIndex,o=new I.TokenSet.Builder,a=I.Pipeline.load(e.pipeline);e.version!=I.version&&I.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+I.version+"' does not match serialized index '"+e.version+"'");for(var u=0;u<i.length;u++){var l=(h=i[u])[0],c=h[1];r[l]=new I.Vector(c)}for(u=0;u<s.length;u++){var h,d=(h=s[u])[0],f=h[1];o.insert(d),n[d]=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=n,t.tokenSet=o.root,t.pipeline=a,new I.Index(t)},I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(e){this._ref=e},I.Builder.prototype.field=function(e,t){if(/\//.test(e))throw new RangeError("Field '"+e+"' contains illegal character '/'");this._fields[e]=t||{}},I.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},I.Builder.prototype.k1=function(e){this._k1=e},I.Builder.prototype.add=function(e,t){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var n=0;n<i.length;n++){var s=i[n],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new I.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<i.length;y++)p[i[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],x=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(x)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},i={},n=0;n<t;n++){var s=I.FieldRef.fromString(e[n]),o=s.fieldName;i[o]||(i[o]=0),i[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var u=a[n];r[u]=r[u]/i[u]}this.averageFieldLength=r},I.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,i=Object.create(null),n=0;n<r;n++){for(var s=I.FieldRef.fromString(t[n]),o=s.fieldName,a=this.fieldLengths[s],u=new I.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,x=c[p],R=l[x],v=this.invertedIndex[x]._index;void 0===i[x]?(y=I.idf(this.invertedIndex[x],this.documentCount),i[x]=y):y=i[x],m=y*((this._k1+1)*R)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+R),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(v,g)}e[s]=u}this.fieldVectors=e},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},I.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r||{}),s=0;s<n.length;s++){var o=n[s];i[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=i)},I.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t[r],n=Object.keys(e.metadata[i]);null==this.metadata[i]&&(this.metadata[i]=Object.create(null));for(var s=0;s<n.length;s++){var o=n[s],a=Object.keys(e.metadata[i][o]);null==this.metadata[i][o]&&(this.metadata[i][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[i][o][l]?this.metadata[i][o][l]=e.metadata[i][o][l]:this.metadata[i][o][l]=this.metadata[i][o][l].concat(e.metadata[i][o][l])}}}},I.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in this.metadata[e])for(var i=Object.keys(r),n=0;n<i.length;n++){var s=i[n];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}else this.metadata[e][t]=r},I.Query=function(e){this.clauses=[],this.allFields=e},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=I.Query.wildcard.NONE),e.wildcard&I.Query.wildcard.LEADING&&e.term.charAt(0)!=I.Query.wildcard&&(e.term="*"+e.term),e.wildcard&I.Query.wildcard.TRAILING&&e.term.slice(-1)!=I.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=I.Query.presence.OPTIONAL),this.clauses.push(e),this},I.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,I.utils.clone(t))}),this),this;var r=t||{};return r.term=e.toString(),this.clause(r),this},I.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},I.QueryParseError.prototype=new Error,I.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var e=I.QueryLexer.lexText;e;)e=e(this)},I.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},I.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(e){return e.backup(),e.emit(I.QueryLexer.FIELD),e.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(I.QueryLexer.TERM)),e.ignore(),e.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return I.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(t.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else e.escapeCharacter()}},I.QueryParser=function(e,t){this.lexer=new I.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=I.QueryParser.parseClause;e;)e=e(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},I.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},I.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value '"+t.str+"'"),new I.QueryParseError(r,t.start,t.end)}},I.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=I.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+t.str+"'";throw new I.QueryParseError(r,t.start,t.end)}var i=e.peekLexeme();if(null==i)throw r="expecting term or field, found nothing",new I.QueryParseError(r,t.start,t.end);switch(i.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:throw r="expecting term or field, found '"+i.type+"'",new I.QueryParseError(r,i.start,i.end)}}},I.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"'"+e+"'"})).join(", "),i="unrecognised field '"+t.str+"', possible fields: "+r;throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n)throw i="expecting term, found nothing",new I.QueryParseError(i,t.start,t.end);if(n.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;throw i="expecting term, found '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}},I.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new I.QueryParseError(i,r.start,r.end)}else e.nextClause()}},I.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:throw i="Unexpected lexeme type '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},I.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new I.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case I.QueryLexer.TERM:return e.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return e.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return e.nextClause(),I.QueryParser.parsePresence;default:throw i="Unexpected lexeme type '"+n.type+"'",new I.QueryParseError(i,n.start,n.end)}else e.nextClause()}},void 0===(n="function"==typeof(i=function(){return I})?i.call(t,r,t,e):i)||(e.exports=n)}()},567:(e,t,r)=>{var i=r(314),n=["add","done","toJS","fromExternalJS","load","dispose","search","Worker"];e.exports=function(){var e=new Worker(URL.createObjectURL(new Blob(['/*! For license information please see 1a77c0465d2508da59cb.worker.js.LICENSE.txt */\n(()=>{var e={336:(e,t,r)=>{var i,n;!function(){var s,o,a,u,l,c,h,d,f,p,y,m,g,x,v,w,Q,k,S,E,P,L,b,T,O,I,R=function(e){var t=new R.Builder;return t.pipeline.add(R.trimmer,R.stopWordFilter,R.stemmer),t.searchPipeline.add(R.stemmer),e.call(t,t),t.build()};R.version="2.3.9",R.utils={},R.utils.warn=(s=this,function(e){s.console&&console.warn&&console.warn(e)}),R.utils.asString=function(e){return null==e?"":e.toString()},R.utils.clone=function(e){if(null==e)return e;for(var t=Object.create(null),r=Object.keys(e),i=0;i<r.length;i++){var n=r[i],s=e[n];if(Array.isArray(s))t[n]=s.slice();else{if("string"!=typeof s&&"number"!=typeof s&&"boolean"!=typeof s)throw new TypeError("clone is not deep and does not support nested objects");t[n]=s}}return t},R.FieldRef=function(e,t,r){this.docRef=e,this.fieldName=t,this._stringValue=r},R.FieldRef.joiner="/",R.FieldRef.fromString=function(e){var t=e.indexOf(R.FieldRef.joiner);if(-1===t)throw"malformed field ref string";var r=e.slice(0,t),i=e.slice(t+1);return new R.FieldRef(i,r,e)},R.FieldRef.prototype.toString=function(){return null==this._stringValue&&(this._stringValue=this.fieldName+R.FieldRef.joiner+this.docRef),this._stringValue},R.Set=function(e){if(this.elements=Object.create(null),e){this.length=e.length;for(var t=0;t<this.length;t++)this.elements[e[t]]=!0}else this.length=0},R.Set.complete={intersect:function(e){return e},union:function(){return this},contains:function(){return!0}},R.Set.empty={intersect:function(){return this},union:function(e){return e},contains:function(){return!1}},R.Set.prototype.contains=function(e){return!!this.elements[e]},R.Set.prototype.intersect=function(e){var t,r,i,n=[];if(e===R.Set.complete)return this;if(e===R.Set.empty)return e;this.length<e.length?(t=this,r=e):(t=e,r=this),i=Object.keys(t.elements);for(var s=0;s<i.length;s++){var o=i[s];o in r.elements&&n.push(o)}return new R.Set(n)},R.Set.prototype.union=function(e){return e===R.Set.complete?R.Set.complete:e===R.Set.empty?this:new R.Set(Object.keys(this.elements).concat(Object.keys(e.elements)))},R.idf=function(e,t){var r=0;for(var i in e)"_index"!=i&&(r+=Object.keys(e[i]).length);var n=(t-r+.5)/(r+.5);return Math.log(1+Math.abs(n))},R.Token=function(e,t){this.str=e||"",this.metadata=t||{}},R.Token.prototype.toString=function(){return this.str},R.Token.prototype.update=function(e){return this.str=e(this.str,this.metadata),this},R.Token.prototype.clone=function(e){return e=e||function(e){return e},new R.Token(e(this.str,this.metadata),this.metadata)},R.tokenizer=function(e,t){if(null==e||null==e)return[];if(Array.isArray(e))return e.map((function(e){return new R.Token(R.utils.asString(e).toLowerCase(),R.utils.clone(t))}));for(var r=e.toString().toLowerCase(),i=r.length,n=[],s=0,o=0;s<=i;s++){var a=s-o;if(r.charAt(s).match(R.tokenizer.separator)||s==i){if(a>0){var u=R.utils.clone(t)||{};u.position=[o,a],u.index=n.length,n.push(new R.Token(r.slice(o,s),u))}o=s+1}}return n},R.tokenizer.separator=/[\\s\\-]+/,R.Pipeline=function(){this._stack=[]},R.Pipeline.registeredFunctions=Object.create(null),R.Pipeline.registerFunction=function(e,t){t in this.registeredFunctions&&R.utils.warn("Overwriting existing registered function: "+t),e.label=t,R.Pipeline.registeredFunctions[e.label]=e},R.Pipeline.warnIfFunctionNotRegistered=function(e){e.label&&e.label in this.registeredFunctions||R.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\\n",e)},R.Pipeline.load=function(e){var t=new R.Pipeline;return e.forEach((function(e){var r=R.Pipeline.registeredFunctions[e];if(!r)throw new Error("Cannot load unregistered function: "+e);t.add(r)})),t},R.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach((function(e){R.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)}),this)},R.Pipeline.prototype.after=function(e,t){R.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");r+=1,this._stack.splice(r,0,t)},R.Pipeline.prototype.before=function(e,t){R.Pipeline.warnIfFunctionNotRegistered(t);var r=this._stack.indexOf(e);if(-1==r)throw new Error("Cannot find existingFn");this._stack.splice(r,0,t)},R.Pipeline.prototype.remove=function(e){var t=this._stack.indexOf(e);-1!=t&&this._stack.splice(t,1)},R.Pipeline.prototype.run=function(e){for(var t=this._stack.length,r=0;r<t;r++){for(var i=this._stack[r],n=[],s=0;s<e.length;s++){var o=i(e[s],s,e);if(null!=o&&""!==o)if(Array.isArray(o))for(var a=0;a<o.length;a++)n.push(o[a]);else n.push(o)}e=n}return e},R.Pipeline.prototype.runString=function(e,t){var r=new R.Token(e,t);return this.run([r]).map((function(e){return e.toString()}))},R.Pipeline.prototype.reset=function(){this._stack=[]},R.Pipeline.prototype.toJSON=function(){return this._stack.map((function(e){return R.Pipeline.warnIfFunctionNotRegistered(e),e.label}))},R.Vector=function(e){this._magnitude=0,this.elements=e||[]},R.Vector.prototype.positionForIndex=function(e){if(0==this.elements.length)return 0;for(var t=0,r=this.elements.length/2,i=r-t,n=Math.floor(i/2),s=this.elements[2*n];i>1&&(s<e&&(t=n),s>e&&(r=n),s!=e);)i=r-t,n=t+Math.floor(i/2),s=this.elements[2*n];return s==e||s>e?2*n:s<e?2*(n+1):void 0},R.Vector.prototype.insert=function(e,t){this.upsert(e,t,(function(){throw"duplicate index"}))},R.Vector.prototype.upsert=function(e,t,r){this._magnitude=0;var i=this.positionForIndex(e);this.elements[i]==e?this.elements[i+1]=r(this.elements[i+1],t):this.elements.splice(i,0,e,t)},R.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var e=0,t=this.elements.length,r=1;r<t;r+=2){var i=this.elements[r];e+=i*i}return this._magnitude=Math.sqrt(e)},R.Vector.prototype.dot=function(e){for(var t=0,r=this.elements,i=e.elements,n=r.length,s=i.length,o=0,a=0,u=0,l=0;u<n&&l<s;)(o=r[u])<(a=i[l])?u+=2:o>a?l+=2:o==a&&(t+=r[u+1]*i[l+1],u+=2,l+=2);return t},R.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},R.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),t=1,r=0;t<this.elements.length;t+=2,r++)e[r]=this.elements[t];return e},R.Vector.prototype.toJSON=function(){return this.elements},R.stemmer=(o={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},a={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},u="[aeiouy]",l="[^aeiou][^aeiouy]*",c=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),h=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*[aeiouy][aeiou]*[^aeiou][^aeiouy]*"),d=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy][aeiou]*[^aeiou][^aeiouy]*([aeiouy][aeiou]*)?$"),f=new RegExp("^([^aeiou][^aeiouy]*)?[aeiouy]"),p=/^(.+?)(ss|i)es$/,y=/^(.+?)([^s])s$/,m=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,x=/.$/,v=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\\\1$"),Q=new RegExp("^"+l+u+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,S=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,P=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,L=/^(.+?)(s|t)(ion)$/,b=/^(.+?)e$/,T=/ll$/,O=new RegExp("^"+l+u+"[^aeiouwxy]$"),I=function(e){var t,r,i,n,s,u,l;if(e.length<3)return e;if("y"==(i=e.substr(0,1))&&(e=i.toUpperCase()+e.substr(1)),s=y,(n=p).test(e)?e=e.replace(n,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=g,(n=m).test(e)){var I=n.exec(e);(n=c).test(I[1])&&(n=x,e=e.replace(n,""))}else s.test(e)&&(t=(I=s.exec(e))[1],(s=f).test(t)&&(u=w,l=Q,(s=v).test(e=t)?e+="e":u.test(e)?(n=x,e=e.replace(n,"")):l.test(e)&&(e+="e")));return(n=k).test(e)&&(e=(t=(I=n.exec(e))[1])+"i"),(n=S).test(e)&&(t=(I=n.exec(e))[1],r=I[2],(n=c).test(t)&&(e=t+o[r])),(n=E).test(e)&&(t=(I=n.exec(e))[1],r=I[2],(n=c).test(t)&&(e=t+a[r])),s=L,(n=P).test(e)?(t=(I=n.exec(e))[1],(n=h).test(t)&&(e=t)):s.test(e)&&(t=(I=s.exec(e))[1]+I[2],(s=h).test(t)&&(e=t)),(n=b).test(e)&&(t=(I=n.exec(e))[1],s=d,u=O,((n=h).test(t)||s.test(t)&&!u.test(t))&&(e=t)),s=h,(n=T).test(e)&&s.test(e)&&(n=x,e=e.replace(n,"")),"y"==i&&(e=i.toLowerCase()+e.substr(1)),e},function(e){return e.update(I)}),R.Pipeline.registerFunction(R.stemmer,"stemmer"),R.generateStopWordFilter=function(e){var t=e.reduce((function(e,t){return e[t]=t,e}),{});return function(e){if(e&&t[e.toString()]!==e.toString())return e}},R.stopWordFilter=R.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),R.Pipeline.registerFunction(R.stopWordFilter,"stopWordFilter"),R.trimmer=function(e){return e.update((function(e){return e.replace(/^\\W+/,"").replace(/\\W+$/,"")}))},R.Pipeline.registerFunction(R.trimmer,"trimmer"),R.TokenSet=function(){this.final=!1,this.edges={},this.id=R.TokenSet._nextId,R.TokenSet._nextId+=1},R.TokenSet._nextId=1,R.TokenSet.fromArray=function(e){for(var t=new R.TokenSet.Builder,r=0,i=e.length;r<i;r++)t.insert(e[r]);return t.finish(),t.root},R.TokenSet.fromClause=function(e){return"editDistance"in e?R.TokenSet.fromFuzzyString(e.term,e.editDistance):R.TokenSet.fromString(e.term)},R.TokenSet.fromFuzzyString=function(e,t){for(var r=new R.TokenSet,i=[{node:r,editsRemaining:t,str:e}];i.length;){var n=i.pop();if(n.str.length>0){var s,o=n.str.charAt(0);o in n.node.edges?s=n.node.edges[o]:(s=new R.TokenSet,n.node.edges[o]=s),1==n.str.length&&(s.final=!0),i.push({node:s,editsRemaining:n.editsRemaining,str:n.str.slice(1)})}if(0!=n.editsRemaining){if("*"in n.node.edges)var a=n.node.edges["*"];else a=new R.TokenSet,n.node.edges["*"]=a;if(0==n.str.length&&(a.final=!0),i.push({node:a,editsRemaining:n.editsRemaining-1,str:n.str}),n.str.length>1&&i.push({node:n.node,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)}),1==n.str.length&&(n.node.final=!0),n.str.length>=1){if("*"in n.node.edges)var u=n.node.edges["*"];else u=new R.TokenSet,n.node.edges["*"]=u;1==n.str.length&&(u.final=!0),i.push({node:u,editsRemaining:n.editsRemaining-1,str:n.str.slice(1)})}if(n.str.length>1){var l,c=n.str.charAt(0),h=n.str.charAt(1);h in n.node.edges?l=n.node.edges[h]:(l=new R.TokenSet,n.node.edges[h]=l),1==n.str.length&&(l.final=!0),i.push({node:l,editsRemaining:n.editsRemaining-1,str:c+n.str.slice(2)})}}}return r},R.TokenSet.fromString=function(e){for(var t=new R.TokenSet,r=t,i=0,n=e.length;i<n;i++){var s=e[i],o=i==n-1;if("*"==s)t.edges[s]=t,t.final=o;else{var a=new R.TokenSet;a.final=o,t.edges[s]=a,t=a}}return r},R.TokenSet.prototype.toArray=function(){for(var e=[],t=[{prefix:"",node:this}];t.length;){var r=t.pop(),i=Object.keys(r.node.edges),n=i.length;r.node.final&&(r.prefix.charAt(0),e.push(r.prefix));for(var s=0;s<n;s++){var o=i[s];t.push({prefix:r.prefix.concat(o),node:r.node.edges[o]})}}return e},R.TokenSet.prototype.toString=function(){if(this._str)return this._str;for(var e=this.final?"1":"0",t=Object.keys(this.edges).sort(),r=t.length,i=0;i<r;i++){var n=t[i];e=e+n+this.edges[n].id}return e},R.TokenSet.prototype.intersect=function(e){for(var t=new R.TokenSet,r=void 0,i=[{qNode:e,output:t,node:this}];i.length;){r=i.pop();for(var n=Object.keys(r.qNode.edges),s=n.length,o=Object.keys(r.node.edges),a=o.length,u=0;u<s;u++)for(var l=n[u],c=0;c<a;c++){var h=o[c];if(h==l||"*"==l){var d=r.node.edges[h],f=r.qNode.edges[l],p=d.final&&f.final,y=void 0;h in r.output.edges?(y=r.output.edges[h]).final=y.final||p:((y=new R.TokenSet).final=p,r.output.edges[h]=y),i.push({qNode:f,output:y,node:d})}}}return t},R.TokenSet.Builder=function(){this.previousWord="",this.root=new R.TokenSet,this.uncheckedNodes=[],this.minimizedNodes={}},R.TokenSet.Builder.prototype.insert=function(e){var t,r=0;if(e<this.previousWord)throw new Error("Out of order word insertion");for(var i=0;i<e.length&&i<this.previousWord.length&&e[i]==this.previousWord[i];i++)r++;for(this.minimize(r),t=0==this.uncheckedNodes.length?this.root:this.uncheckedNodes[this.uncheckedNodes.length-1].child,i=r;i<e.length;i++){var n=new R.TokenSet,s=e[i];t.edges[s]=n,this.uncheckedNodes.push({parent:t,char:s,child:n}),t=n}t.final=!0,this.previousWord=e},R.TokenSet.Builder.prototype.finish=function(){this.minimize(0)},R.TokenSet.Builder.prototype.minimize=function(e){for(var t=this.uncheckedNodes.length-1;t>=e;t--){var r=this.uncheckedNodes[t],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}},R.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},R.Index.prototype.search=function(e){return this.query((function(t){new R.QueryParser(e,t).parse()}))},R.Index.prototype.query=function(e){for(var t=new R.Query(this.fields),r=Object.create(null),i=Object.create(null),n=Object.create(null),s=Object.create(null),o=Object.create(null),a=0;a<this.fields.length;a++)i[this.fields[a]]=new R.Vector;for(e.call(t,t),a=0;a<t.clauses.length;a++){var u,l=t.clauses[a],c=R.Set.empty;u=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var h=0;h<u.length;h++){var d=u[h];l.term=d;var f=R.TokenSet.fromClause(l),p=this.tokenSet.intersect(f).toArray();if(0===p.length&&l.presence===R.Query.presence.REQUIRED){for(var y=0;y<l.fields.length;y++)s[F=l.fields[y]]=R.Set.empty;break}for(var m=0;m<p.length;m++){var g=p[m],x=this.invertedIndex[g],v=x._index;for(y=0;y<l.fields.length;y++){var w=x[F=l.fields[y]],Q=Object.keys(w),k=g+"/"+F,S=new R.Set(Q);if(l.presence==R.Query.presence.REQUIRED&&(c=c.union(S),void 0===s[F]&&(s[F]=R.Set.complete)),l.presence!=R.Query.presence.PROHIBITED){if(i[F].upsert(v,l.boost,(function(e,t){return e+t})),!n[k]){for(var E=0;E<Q.length;E++){var P,L=Q[E],b=new R.FieldRef(L,F),T=w[L];void 0===(P=r[b])?r[b]=new R.MatchData(g,F,T):P.add(g,F,T)}n[k]=!0}}else void 0===o[F]&&(o[F]=R.Set.empty),o[F]=o[F].union(S)}}}if(l.presence===R.Query.presence.REQUIRED)for(y=0;y<l.fields.length;y++)s[F=l.fields[y]]=s[F].intersect(c)}var O=R.Set.complete,I=R.Set.empty;for(a=0;a<this.fields.length;a++){var F;s[F=this.fields[a]]&&(O=O.intersect(s[F])),o[F]&&(I=I.union(o[F]))}var C=Object.keys(r),N=[],j=Object.create(null);if(t.isNegated())for(C=Object.keys(this.fieldVectors),a=0;a<C.length;a++){b=C[a];var _=R.FieldRef.fromString(b);r[b]=new R.MatchData}for(a=0;a<C.length;a++){var D=(_=R.FieldRef.fromString(C[a])).docRef;if(O.contains(D)&&!I.contains(D)){var A,B=this.fieldVectors[_],z=i[_.fieldName].similarity(B);if(void 0!==(A=j[D]))A.score+=z,A.matchData.combine(r[_]);else{var V={ref:D,score:z,matchData:r[_]};j[D]=V,N.push(V)}}}return N.sort((function(e,t){return t.score-e.score}))},R.Index.prototype.toJSON=function(){var e=Object.keys(this.invertedIndex).sort().map((function(e){return[e,this.invertedIndex[e]]}),this),t=Object.keys(this.fieldVectors).map((function(e){return[e,this.fieldVectors[e].toJSON()]}),this);return{version:R.version,fields:this.fields,fieldVectors:t,invertedIndex:e,pipeline:this.pipeline.toJSON()}},R.Index.load=function(e){var t={},r={},i=e.fieldVectors,n=Object.create(null),s=e.invertedIndex,o=new R.TokenSet.Builder,a=R.Pipeline.load(e.pipeline);e.version!=R.version&&R.utils.warn("Version mismatch when loading serialised index. Current version of lunr \'"+R.version+"\' does not match serialized index \'"+e.version+"\'");for(var u=0;u<i.length;u++){var l=(h=i[u])[0],c=h[1];r[l]=new R.Vector(c)}for(u=0;u<s.length;u++){var h,d=(h=s[u])[0],f=h[1];o.insert(d),n[d]=f}return o.finish(),t.fields=e.fields,t.fieldVectors=r,t.invertedIndex=n,t.tokenSet=o.root,t.pipeline=a,new R.Index(t)},R.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=R.tokenizer,this.pipeline=new R.Pipeline,this.searchPipeline=new R.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},R.Builder.prototype.ref=function(e){this._ref=e},R.Builder.prototype.field=function(e,t){if(/\\//.test(e))throw new RangeError("Field \'"+e+"\' contains illegal character \'/\'");this._fields[e]=t||{}},R.Builder.prototype.b=function(e){this._b=e<0?0:e>1?1:e},R.Builder.prototype.k1=function(e){this._k1=e},R.Builder.prototype.add=function(e,t){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=t||{},this.documentCount+=1;for(var n=0;n<i.length;n++){var s=i[n],o=this._fields[s].extractor,a=o?o(e):e[s],u=this.tokenizer(a,{fields:[s]}),l=this.pipeline.run(u),c=new R.FieldRef(r,s),h=Object.create(null);this.fieldTermFrequencies[c]=h,this.fieldLengths[c]=0,this.fieldLengths[c]+=l.length;for(var d=0;d<l.length;d++){var f=l[d];if(null==h[f]&&(h[f]=0),h[f]+=1,null==this.invertedIndex[f]){var p=Object.create(null);p._index=this.termIndex,this.termIndex+=1;for(var y=0;y<i.length;y++)p[i[y]]=Object.create(null);this.invertedIndex[f]=p}null==this.invertedIndex[f][s][r]&&(this.invertedIndex[f][s][r]=Object.create(null));for(var m=0;m<this.metadataWhitelist.length;m++){var g=this.metadataWhitelist[m],x=f.metadata[g];null==this.invertedIndex[f][s][r][g]&&(this.invertedIndex[f][s][r][g]=[]),this.invertedIndex[f][s][r][g].push(x)}}}},R.Builder.prototype.calculateAverageFieldLengths=function(){for(var e=Object.keys(this.fieldLengths),t=e.length,r={},i={},n=0;n<t;n++){var s=R.FieldRef.fromString(e[n]),o=s.fieldName;i[o]||(i[o]=0),i[o]+=1,r[o]||(r[o]=0),r[o]+=this.fieldLengths[s]}var a=Object.keys(this._fields);for(n=0;n<a.length;n++){var u=a[n];r[u]=r[u]/i[u]}this.averageFieldLength=r},R.Builder.prototype.createFieldVectors=function(){for(var e={},t=Object.keys(this.fieldTermFrequencies),r=t.length,i=Object.create(null),n=0;n<r;n++){for(var s=R.FieldRef.fromString(t[n]),o=s.fieldName,a=this.fieldLengths[s],u=new R.Vector,l=this.fieldTermFrequencies[s],c=Object.keys(l),h=c.length,d=this._fields[o].boost||1,f=this._documents[s.docRef].boost||1,p=0;p<h;p++){var y,m,g,x=c[p],v=l[x],w=this.invertedIndex[x]._index;void 0===i[x]?(y=R.idf(this.invertedIndex[x],this.documentCount),i[x]=y):y=i[x],m=y*((this._k1+1)*v)/(this._k1*(1-this._b+this._b*(a/this.averageFieldLength[o]))+v),m*=d,m*=f,g=Math.round(1e3*m)/1e3,u.insert(w,g)}e[s]=u}this.fieldVectors=e},R.Builder.prototype.createTokenSet=function(){this.tokenSet=R.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},R.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new R.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},R.Builder.prototype.use=function(e){var t=Array.prototype.slice.call(arguments,1);t.unshift(this),e.apply(this,t)},R.MatchData=function(e,t,r){for(var i=Object.create(null),n=Object.keys(r||{}),s=0;s<n.length;s++){var o=n[s];i[o]=r[o].slice()}this.metadata=Object.create(null),void 0!==e&&(this.metadata[e]=Object.create(null),this.metadata[e][t]=i)},R.MatchData.prototype.combine=function(e){for(var t=Object.keys(e.metadata),r=0;r<t.length;r++){var i=t[r],n=Object.keys(e.metadata[i]);null==this.metadata[i]&&(this.metadata[i]=Object.create(null));for(var s=0;s<n.length;s++){var o=n[s],a=Object.keys(e.metadata[i][o]);null==this.metadata[i][o]&&(this.metadata[i][o]=Object.create(null));for(var u=0;u<a.length;u++){var l=a[u];null==this.metadata[i][o][l]?this.metadata[i][o][l]=e.metadata[i][o][l]:this.metadata[i][o][l]=this.metadata[i][o][l].concat(e.metadata[i][o][l])}}}},R.MatchData.prototype.add=function(e,t,r){if(!(e in this.metadata))return this.metadata[e]=Object.create(null),void(this.metadata[e][t]=r);if(t in this.metadata[e])for(var i=Object.keys(r),n=0;n<i.length;n++){var s=i[n];s in this.metadata[e][t]?this.metadata[e][t][s]=this.metadata[e][t][s].concat(r[s]):this.metadata[e][t][s]=r[s]}else this.metadata[e][t]=r},R.Query=function(e){this.clauses=[],this.allFields=e},R.Query.wildcard=new String("*"),R.Query.wildcard.NONE=0,R.Query.wildcard.LEADING=1,R.Query.wildcard.TRAILING=2,R.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},R.Query.prototype.clause=function(e){return"fields"in e||(e.fields=this.allFields),"boost"in e||(e.boost=1),"usePipeline"in e||(e.usePipeline=!0),"wildcard"in e||(e.wildcard=R.Query.wildcard.NONE),e.wildcard&R.Query.wildcard.LEADING&&e.term.charAt(0)!=R.Query.wildcard&&(e.term="*"+e.term),e.wildcard&R.Query.wildcard.TRAILING&&e.term.slice(-1)!=R.Query.wildcard&&(e.term=e.term+"*"),"presence"in e||(e.presence=R.Query.presence.OPTIONAL),this.clauses.push(e),this},R.Query.prototype.isNegated=function(){for(var e=0;e<this.clauses.length;e++)if(this.clauses[e].presence!=R.Query.presence.PROHIBITED)return!1;return!0},R.Query.prototype.term=function(e,t){if(Array.isArray(e))return e.forEach((function(e){this.term(e,R.utils.clone(t))}),this),this;var r=t||{};return r.term=e.toString(),this.clause(r),this},R.QueryParseError=function(e,t,r){this.name="QueryParseError",this.message=e,this.start=t,this.end=r},R.QueryParseError.prototype=new Error,R.QueryLexer=function(e){this.lexemes=[],this.str=e,this.length=e.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},R.QueryLexer.prototype.run=function(){for(var e=R.QueryLexer.lexText;e;)e=e(this)},R.QueryLexer.prototype.sliceString=function(){for(var e=[],t=this.start,r=this.pos,i=0;i<this.escapeCharPositions.length;i++)r=this.escapeCharPositions[i],e.push(this.str.slice(t,r)),t=r+1;return e.push(this.str.slice(t,this.pos)),this.escapeCharPositions.length=0,e.join("")},R.QueryLexer.prototype.emit=function(e){this.lexemes.push({type:e,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},R.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},R.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return R.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},R.QueryLexer.prototype.width=function(){return this.pos-this.start},R.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},R.QueryLexer.prototype.backup=function(){this.pos-=1},R.QueryLexer.prototype.acceptDigitRun=function(){var e,t;do{t=(e=this.next()).charCodeAt(0)}while(t>47&&t<58);e!=R.QueryLexer.EOS&&this.backup()},R.QueryLexer.prototype.more=function(){return this.pos<this.length},R.QueryLexer.EOS="EOS",R.QueryLexer.FIELD="FIELD",R.QueryLexer.TERM="TERM",R.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",R.QueryLexer.BOOST="BOOST",R.QueryLexer.PRESENCE="PRESENCE",R.QueryLexer.lexField=function(e){return e.backup(),e.emit(R.QueryLexer.FIELD),e.ignore(),R.QueryLexer.lexText},R.QueryLexer.lexTerm=function(e){if(e.width()>1&&(e.backup(),e.emit(R.QueryLexer.TERM)),e.ignore(),e.more())return R.QueryLexer.lexText},R.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(R.QueryLexer.EDIT_DISTANCE),R.QueryLexer.lexText},R.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(R.QueryLexer.BOOST),R.QueryLexer.lexText},R.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(R.QueryLexer.TERM)},R.QueryLexer.termSeparator=R.tokenizer.separator,R.QueryLexer.lexText=function(e){for(;;){var t=e.next();if(t==R.QueryLexer.EOS)return R.QueryLexer.lexEOS;if(92!=t.charCodeAt(0)){if(":"==t)return R.QueryLexer.lexField;if("~"==t)return e.backup(),e.width()>0&&e.emit(R.QueryLexer.TERM),R.QueryLexer.lexEditDistance;if("^"==t)return e.backup(),e.width()>0&&e.emit(R.QueryLexer.TERM),R.QueryLexer.lexBoost;if("+"==t&&1===e.width())return e.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if("-"==t&&1===e.width())return e.emit(R.QueryLexer.PRESENCE),R.QueryLexer.lexText;if(t.match(R.QueryLexer.termSeparator))return R.QueryLexer.lexTerm}else e.escapeCharacter()}},R.QueryParser=function(e,t){this.lexer=new R.QueryLexer(e),this.query=t,this.currentClause={},this.lexemeIdx=0},R.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=R.QueryParser.parseClause;e;)e=e(this);return this.query},R.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},R.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},R.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},R.QueryParser.parseClause=function(e){var t=e.peekLexeme();if(null!=t)switch(t.type){case R.QueryLexer.PRESENCE:return R.QueryParser.parsePresence;case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+t.type;throw t.str.length>=1&&(r+=" with value \'"+t.str+"\'"),new R.QueryParseError(r,t.start,t.end)}},R.QueryParser.parsePresence=function(e){var t=e.consumeLexeme();if(null!=t){switch(t.str){case"-":e.currentClause.presence=R.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=R.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator\'"+t.str+"\'";throw new R.QueryParseError(r,t.start,t.end)}var i=e.peekLexeme();if(null==i)throw r="expecting term or field, found nothing",new R.QueryParseError(r,t.start,t.end);switch(i.type){case R.QueryLexer.FIELD:return R.QueryParser.parseField;case R.QueryLexer.TERM:return R.QueryParser.parseTerm;default:throw r="expecting term or field, found \'"+i.type+"\'",new R.QueryParseError(r,i.start,i.end)}}},R.QueryParser.parseField=function(e){var t=e.consumeLexeme();if(null!=t){if(-1==e.query.allFields.indexOf(t.str)){var r=e.query.allFields.map((function(e){return"\'"+e+"\'"})).join(", "),i="unrecognised field \'"+t.str+"\', possible fields: "+r;throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.fields=[t.str];var n=e.peekLexeme();if(null==n)throw i="expecting term, found nothing",new R.QueryParseError(i,t.start,t.end);if(n.type===R.QueryLexer.TERM)return R.QueryParser.parseTerm;throw i="expecting term, found \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}},R.QueryParser.parseTerm=function(e){var t=e.consumeLexeme();if(null!=t){e.currentClause.term=t.str.toLowerCase(),-1!=t.str.indexOf("*")&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(null!=r)switch(r.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:var i="Unexpected lexeme type \'"+r.type+"\'";throw new R.QueryParseError(i,r.start,r.end)}else e.nextClause()}},R.QueryParser.parseEditDistance=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.editDistance=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:throw i="Unexpected lexeme type \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}else e.nextClause()}},R.QueryParser.parseBoost=function(e){var t=e.consumeLexeme();if(null!=t){var r=parseInt(t.str,10);if(isNaN(r)){var i="boost must be numeric";throw new R.QueryParseError(i,t.start,t.end)}e.currentClause.boost=r;var n=e.peekLexeme();if(null!=n)switch(n.type){case R.QueryLexer.TERM:return e.nextClause(),R.QueryParser.parseTerm;case R.QueryLexer.FIELD:return e.nextClause(),R.QueryParser.parseField;case R.QueryLexer.EDIT_DISTANCE:return R.QueryParser.parseEditDistance;case R.QueryLexer.BOOST:return R.QueryParser.parseBoost;case R.QueryLexer.PRESENCE:return e.nextClause(),R.QueryParser.parsePresence;default:throw i="Unexpected lexeme type \'"+n.type+"\'",new R.QueryParseError(i,n.start,n.end)}else e.nextClause()}},void 0===(n="function"==typeof(i=function(){return R})?i.call(t,r,t,e):i)||(e.exports=n)}()}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var i={};(()=>{"use strict";r.d(i,{add:()=>l,done:()=>c,toJS:()=>h,fromExternalJS:()=>d,load:()=>f,dispose:()=>p,search:()=>y});var e=r(336),t=(Object.defineProperty,(e,t,r)=>new Promise(((i,n)=>{var s=e=>{try{a(r.next(e))}catch(e){n(e)}},o=e=>{try{a(r.throw(e))}catch(e){n(e)}},a=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,o);a((r=r.apply(e,t)).next())})));let n,s,o,a=[];function u(){n=new e.Builder,n.field("title"),n.field("description"),n.ref("ref"),n.pipeline.add(e.trimmer,e.stopWordFilter,e.stemmer),o=new Promise((e=>{s=e}))}function l(e,t,r){const i=a.push(r)-1,s={title:e.toLowerCase(),description:t.toLowerCase(),ref:i};n.add(s)}function c(){return t(this,null,(function*(){s(n.build())}))}function h(){return t(this,null,(function*(){return{store:a,index:(yield o).toJSON()}}))}function d(e,r){return t(this,null,(function*(){try{if(importScripts(e),!self[r])throw new Error("Broken index file format");yield f(self[r])}catch(e){console.error("Failed to load search index: "+e.message)}}))}function f(r){return t(this,null,(function*(){a=r.store,s(e.Index.load(r.index))}))}function p(){return t(this,null,(function*(){a=[],u()}))}function y(r,i=0){return t(this,null,(function*(){if(0===r.trim().length)return[];let t=(yield o).query((t=>{r.trim().toLowerCase().split(/\\s+/).forEach((r=>{if(1===r.length)return;const i=(t=>"*"+e.stemmer(new e.Token(t,{}))+"*")(r);t.term(i,{})}))}));return i>0&&(t=t.slice(0,i)),t.map((e=>({meta:a[e.ref],score:e.score})))}))}e.tokenizer.separator=/\\s+/,u(),addEventListener("message",(function(e){var t,r=e.data,n=r.type,s=r.method,o=r.id,a=r.params;"RPC"===n&&s&&((t=i[s])?Promise.resolve().then((function(){return t.apply(i,a)})):Promise.reject("No such method")).then((function(e){postMessage({type:"RPC",id:o,result:e})})).catch((function(e){var t={message:e};e.stack&&(t.message=e.message,t.stack=e.stack,t.name=e.name),postMessage({type:"RPC",id:o,error:t})}))})),postMessage({type:"RPC",method:"ready"})})()})();'])),{name:"[fullhash].worker.js"});return i(e,n),e}},314:e=>{e.exports=function(e,t){var r=0,i={};e.addEventListener("message",(function(t){var r=t.data;if("RPC"===r.type)if(r.id){var n=i[r.id];n&&(delete i[r.id],r.error?n[1](Object.assign(Error(r.error.message),r.error)):n[0](r.result))}else{var s=document.createEvent("Event");s.initEvent(r.method,!1,!1),s.data=r.params,e.dispatchEvent(s)}})),t.forEach((function(t){e[t]=function(){var n=arguments;return new Promise((function(s,o){var a=++r;i[a]=[s,o],e.postMessage({type:"RPC",id:a,method:t,params:[].slice.call(n)})}))}}))}}},t={};function r(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={exports:{}};return e[i](s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var i in t)r.o(t,i)&&!r.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";r.r(i),r.d(i,{SearchStore:()=>n});const e="undefined"!=typeof window&&"HTMLElement"in window;"undefined"==typeof Element||Element.prototype.scrollIntoViewIfNeeded||(Element.prototype.scrollIntoViewIfNeeded=function(e){e=0===arguments.length||!!e;const t=this.parentNode,r=window.getComputedStyle(t,void 0),i=parseInt(r.getPropertyValue("border-top-width"),10),n=parseInt(r.getPropertyValue("border-left-width"),10),s=this.offsetTop-t.offsetTop<t.scrollTop,o=this.offsetTop-t.offsetTop+this.clientHeight-i>t.scrollTop+t.clientHeight,a=this.offsetLeft-t.offsetLeft<t.scrollLeft,u=this.offsetLeft-t.offsetLeft+this.clientWidth-n>t.scrollLeft+t.clientWidth,l=s&&!o;(s||o)&&e&&(t.scrollTop=this.offsetTop-t.offsetTop-t.clientHeight/2-i+this.clientHeight/2),(a||u)&&e&&(t.scrollLeft=this.offsetLeft-t.offsetLeft-t.clientWidth/2-n+this.clientWidth/2),(s||o||a||u)&&!e&&this.scrollIntoView(l)});var t=Object.defineProperty;class n{constructor(){var i,n,s;i=this,n="searchWorker",s=function(){let t;if(e)try{t=r(567)}catch(e){t=r(27).ZP}else t=r(27).ZP;return new t}(),((e,r,i)=>{r in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[r]=i})(i,"symbol"!=typeof n?n+"":n,s)}indexItems(e){const t=e=>{e.forEach((e=>{"group"!==e.type&&this.add(e.name,e.description||"",e.id),t(e.items)}))};t(e),this.searchWorker.done()}add(e,t,r){this.searchWorker.add(e,t,r)}dispose(){this.searchWorker.terminate(),this.searchWorker.dispose()}search(e){return this.searchWorker.search(e)}toJS(){return e=this,null,t=function*(){return this.searchWorker.toJS()},new Promise(((r,i)=>{var n=e=>{try{o(t.next(e))}catch(e){i(e)}},s=e=>{try{o(t.throw(e))}catch(e){i(e)}},o=e=>e.done?r(e.value):Promise.resolve(e.value).then(n,s);o((t=t.apply(e,null)).next())}));var e,t}load(e){this.searchWorker.load(e)}fromExternalJS(e,t){e&&t&&this.searchWorker.fromExternalJS(e,t)}}})(),i})()}));
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
-
import { MediaTypeModel } from './MediaType';
|
|
5
4
|
import type { OperationModel } from './Operation';
|
|
6
5
|
import type { ResponseModel } from './Response';
|
|
6
|
+
import { MediaTypeModel } from './MediaType';
|
|
7
7
|
/**
|
|
8
8
|
* MediaContent model ready to be sued by React components
|
|
9
9
|
* Contains multiple MediaTypes and keeps track of the currently active one
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { OpenAPIMediaType } from '../../types';
|
|
2
2
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
3
3
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
|
-
import { SchemaModel } from './Schema';
|
|
5
|
-
import { ExampleModel } from './Example';
|
|
6
4
|
import type { OperationModel } from './Operation';
|
|
7
5
|
import type { ResponseModel } from './Response';
|
|
6
|
+
import { ExampleModel } from './Example';
|
|
7
|
+
import { SchemaModel } from './Schema';
|
|
8
8
|
export declare class MediaTypeModel {
|
|
9
9
|
options: RedocProNormalizedOptions;
|
|
10
10
|
examples?: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import*as Sampler from"openapi-sampler";import{isFormUrlEncoded,isJsonLike,mapValues}from"../../utils";import{
|
|
1
|
+
import*as Sampler from"openapi-sampler";import{isFormUrlEncoded,isJsonLike,mapValues}from"../../utils";import{ExampleModel}from"./Example";import{SchemaModel}from"./Schema";var MediaTypeModel=function(){function e(e,i,a,t,o,l){var r=void 0===l?{}:l,s=r.operation,n=r.type,p=r.response;Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isRequestType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onlyRequiredInSamples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"operation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i,this.operation=s,this.isRequestType=a,this.schema=t.schema&&new SchemaModel(e,t.schema,"",o,void 0,void 0,{operation:s,type:n,response:p}),this.onlyRequiredInSamples=o.onlyRequiredInSamples,void 0!==t.examples?this.examples=mapValues(t.examples,(function(a){return new ExampleModel(e,a,i,t.encoding)})):void 0!==t.example?this.examples={default:new ExampleModel(e,{value:e.deref(t.example).resolved},i,t.encoding)}:(isJsonLike(i)||isFormUrlEncoded(i))&&this.generateExample(e,t)}return Object.defineProperty(e.prototype,"generateExample",{enumerable:!1,configurable:!0,writable:!0,value:function(e,i){var a={skipReadOnly:this.isRequestType,skipWriteOnly:!this.isRequestType,skipNonRequired:this.isRequestType&&this.onlyRequiredInSamples,maxSampleDepth:this.options.generatedPayloadSamplesMaxDepth};if(this.schema&&this.schema.oneOf){this.examples={};for(var t=0,o=this.schema.oneOf;t<o.length;t++){var l=o[t],r=Sampler.sample(l.rawSchema,a,e.definition);this.schema.discriminatorProp&&"object"==typeof r&&r&&(r[this.schema.discriminatorProp]=l.title),this.examples[l.title]=new ExampleModel(e,{value:r},this.name,i.encoding)}}else this.schema&&(this.examples={default:new ExampleModel(e,{value:Sampler.sample(i.schema,a,e.definition)},this.name,i.encoding)})}}),e}();export{MediaTypeModel};
|
|
2
2
|
//# sourceMappingURL=MediaType.js.map
|
|
@@ -2,13 +2,13 @@ import type { IMenuItem, ContentItemModel, ExtendedOpenAPIOperation, Unstable_Ex
|
|
|
2
2
|
import type { OpenAPIExternalDocumentation, OpenAPIServer, OpenAPIXCodeSample, Server } from '../../types';
|
|
3
3
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
4
4
|
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
5
|
+
import type { MediaContentModel } from './MediaContent';
|
|
6
|
+
import type { GroupModel } from './Group.model';
|
|
5
7
|
import { CallbackModel } from './Callback';
|
|
6
8
|
import { FieldModel } from './Field';
|
|
7
|
-
import type { MediaContentModel } from './MediaContent';
|
|
8
9
|
import { RequestBodyModel } from './RequestBody';
|
|
9
10
|
import { ResponseModel } from './Response';
|
|
10
11
|
import { SecurityRequirementModel } from './SecurityRequirement';
|
|
11
|
-
import type { GroupModel } from './Group.model';
|
|
12
12
|
export interface Sample {
|
|
13
13
|
lang: string;
|
|
14
14
|
label?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OpenAPIRequestBody, Referenced } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
-
import { MediaContentModel } from './MediaContent';
|
|
5
4
|
import type { OperationModel } from './Operation';
|
|
5
|
+
import { MediaContentModel } from './MediaContent';
|
|
6
6
|
declare type RequestBodyProps = {
|
|
7
7
|
parser: OpenAPIParser;
|
|
8
8
|
infoOrRef: Referenced<OpenAPIRequestBody>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { OpenAPIResponse, Referenced } from '../../types';
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services/ProStore';
|
|
4
|
+
import type { OperationModel } from './Operation';
|
|
4
5
|
import { FieldModel } from './Field';
|
|
5
6
|
import { MediaContentModel } from './MediaContent';
|
|
6
|
-
import type { OperationModel } from './Operation';
|
|
7
7
|
declare type ResponseProps = {
|
|
8
8
|
parser: OpenAPIParser;
|
|
9
9
|
code: string;
|
|
@@ -2,8 +2,8 @@ import type { OpenAPIExternalDocumentation, OpenAPISchema, Referenced } from '..
|
|
|
2
2
|
import type { OpenAPIParser } from '../OpenAPIParser';
|
|
3
3
|
import type { RedocProNormalizedOptions } from '../../../../services';
|
|
4
4
|
import type { MergedOpenAPISchema, ResponseModel } from '../';
|
|
5
|
-
import { FieldModel } from './Field';
|
|
6
5
|
import type { OperationModel } from './Operation';
|
|
6
|
+
import { FieldModel } from './Field';
|
|
7
7
|
export declare type Deps = {
|
|
8
8
|
parentFieldFullPath?: string;
|
|
9
9
|
operation?: OperationModel;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__decorate,__rest,__spreadArray}from"tslib";import{action,observable,makeObservable}from"mobx";import{pushRef}from"../OpenAPIParser";import{detectType,extractExtensions,humanizeConstraints,isNamedDefinition,isObject,isPrimitiveType,JsonPointer,pluralizeType,sortByField,sortByRequired}from"../../utils/";import{l}from"../Labels";import{FieldModel}from"./Field";var SchemaModel=function(){function e(e,i,t,r,n,a,s){void 0===n&&(n=!1),void 0===a&&(a=[]),void 0===s&&(s={}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"refsStack",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"deps",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"pointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"typePrefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isPrimitive",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isCircular",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"format",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFormat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nullable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deprecated",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"example",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enum",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"default",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"constraints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oneOf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oneOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"discriminatorProp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeOneOf",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"rawSchema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"x-enumDescriptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"const",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentEncoding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentMediaType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.pointer=i.$ref||t||"";var o=e.deref(i,a,!0),l=o.resolved,p=o.refsStack;this.refsStack=pushRef(p,this.pointer),this.rawSchema=l,this.schema=e.mergeAllOf(this.rawSchema,this.pointer,this.refsStack),this.init(e,n),r.showExtensions&&(this.extensions=extractExtensions(this.schema,r.showExtensions))}return Object.defineProperty(e.prototype,"activateOneOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.activeOneOf=e}}),Object.defineProperty(e.prototype,"hasType",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.type===e||Array.isArray(this.type)&&this.type.includes(e)}}),Object.defineProperty(e.prototype,"fields",{get:function(){if(!this.isCircular)return!this._fields&&this.hasType("object")&&(this._fields=buildFields(this.parser,this.schema,this.pointer,this.options,this.refsStack,this.deps)),this._fields},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r,n,a,s,o,p,d,u,f=this,c=this.schema;if(this.isCircular=!!c["x-circular-ref"],this.title=c.title||isNamedDefinition(this.pointer)&&JsonPointer.baseName(this.pointer)||"",this.description=c.description||"",this.type=c.type||detectType(c),this.format=c.format,this.enum=c.enum||[],this["x-enumDescriptions"]=c["x-enumDescriptions"],this.example=c.example,this.deprecated=!!c.deprecated,this.pattern=c.pattern,this.externalDocs=c.externalDocs,this.constraints=humanizeConstraints(c),this.displayFormat=this.format,this.isPrimitive=isPrimitiveType(c,this.type),this.default=c.default,this.readOnly=!!c.readOnly,this.writeOnly=!!c.writeOnly,this.const=c.const||"",this.contentEncoding=c.contentEncoding,this.contentMediaType=c.contentMediaType,this.minItems=c.minItems,this.maxItems=c.maxItems,(c.nullable||c["x-nullable"])&&(Array.isArray(this.type)&&!this.type.some((function(e){return null===e||"null"===e}))?this.type=__spreadArray(__spreadArray([],this.type,!0),["null"],!1):Array.isArray(this.type)||null===this.type&&"null"===this.type||(this.type=[this.type,"null"])),this.displayType=Array.isArray(this.type)?this.type.map((function(e){return null===e?"null":e})).join(" or "):this.type,!this.isCircular)if(c.if&&c.then||c.if&&c.else)this.initConditionalOperators(c,i);else if(t||void 0===getDiscriminator(c)){if(t&&Array.isArray(c.oneOf)&&c.oneOf.find((function(e){return e.$ref===f.pointer}))&&delete c.oneOf,void 0!==c.oneOf)return this.initOneOf(c.oneOf,i),this.oneOfType="One of",void(void 0!==c.anyOf&&console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf at "+this.pointer));if(void 0!==c.anyOf)return this.initOneOf(c.anyOf,i),void(this.oneOfType="Any of");if(this.hasType("array")&&(Array.isArray(c.items)||Array.isArray(c.prefixItems)?this._fields=buildFields(i,c,this.pointer,this.options,this.refsStack,this.deps):isObject(c.items)&&(this.items=new e(i,c.items,this.pointer+"/items",this.options,!1,this.refsStack,this.deps)),this.displayType=c.prefixItems||Array.isArray(c.items)?"items":pluralizeType((null===(r=this.items)||void 0===r?void 0:r.displayType)||this.displayType),this.displayFormat=(null===(n=this.items)||void 0===n?void 0:n.format)||"",this.typePrefix=(null===(a=this.items)||void 0===a?void 0:a.typePrefix)||""+l("arrayOf"),this.title=this.title||(null===(s=this.items)||void 0===s?void 0:s.title)||"",this.isPrimitive=void 0!==(null===(o=this.items)||void 0===o?void 0:o.isPrimitive)?null===(p=this.items)||void 0===p?void 0:p.isPrimitive:this.isPrimitive,void 0===this.example&&void 0!==(null===(d=this.items)||void 0===d?void 0:d.example)&&(this.example=[this.items.example]),(null===(u=this.items)||void 0===u?void 0:u.isPrimitive)&&(this.enum=this.items.enum,this["x-enumDescriptions"]=this.items["x-enumDescriptions"]),Array.isArray(this.type))){var h=this.type.filter((function(e){return"array"!==e}));h.length&&(this.displayType+=" or "+h.join(" or "))}this.enum.length&&this.options.sortEnumValuesAlphabetically&&this.enum.sort()}else this.initDiscriminator(c,i)}}),Object.defineProperty(e.prototype,"initOneOf",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this;if(this.oneOf=i.map((function(i,n){var a=t.deref(i,r.refsStack,!0),s=a.resolved,o=a.refsStack,l=t.mergeAllOf(s,r.pointer+"/oneOf/"+n,o),p=isNamedDefinition(i.$ref)&&!l.title?JsonPointer.baseName(i.$ref):""+(l.title||"")+(l.const&&JSON.stringify(l.const)||"");return new e(t,__assign(__assign({},l),{title:p,allOf:[__assign(__assign({},r.schema),{oneOf:void 0,anyOf:void 0})]}),r.pointer+"/oneOf/"+n,r.options,!1,r.refsStack,__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}))})),this.options.simpleOneOfTypeLabel){var n=collectUniqueOneOfTypesDeep(this);this.displayType=n.join(" or ")}else this.displayType=this.oneOf.map((function(e){var i=e.typePrefix+(e.title?e.title+" ("+e.displayType+")":e.displayType);return i.indexOf(" or ")>-1&&(i="("+i+")"),i})).join(" or ")}}),Object.defineProperty(e.prototype,"initDiscriminator",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this,n=getDiscriminator(i);this.discriminatorProp=null==n?void 0:n.propertyName;var a=t.findDerived(__spreadArray(__spreadArray([],this.schema["x-parentRefs"]||[],!0),[this.pointer],!1));if(i.oneOf)for(var s=0,o=i.oneOf;s<o.length;s++){var l=o[s];if(void 0!==l.$ref){var p=JsonPointer.baseName(l.$ref);a[l.$ref]=p}}var d=(null==n?void 0:n.mapping)||{},u=(null==n?void 0:n["x-explicitMappingOnly"])||!1;0===Object.keys(d).length&&(u=!1);var f={};for(var c in d){var h=d[c];Array.isArray(f[h])?f[h].push(c):f[h]=[c]}for(var b=__assign(u?{}:__assign({},a),f),m=[],y=0,v=Object.keys(b);y<v.length;y++){var O=b[h=v[y]];if(Array.isArray(O))for(var g=0,P=O;g<P.length;g++){var w=P[g];m.push({$ref:h,name:w})}else m.push({$ref:h,name:O})}var j=Object.keys(d);0!==j.length&&(m=m.sort((function(e,i){var t=j.indexOf(e.name),r=j.indexOf(i.name);return t<0&&r<0?e.name.localeCompare(i.name):t<0?1:r<0?-1:t-r}))),this.oneOf=m.map((function(i,n){var a=i.$ref,s=i.name,o=new e(t,{$ref:a},a,r.options,!0,r.refsStack.slice(0,-1),__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}));return o.title=s,o}))}}),Object.defineProperty(e.prototype,"initConditionalOperators",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this,n=i.if,a=i.else,s=void 0===a?{}:a,o=i.then,l=void 0===o?{}:o,p=__rest(i,["if","else","then"]),d=[{allOf:[p,l,n],title:n&&n["x-displayName"]||(null==n?void 0:n.title)||"case 1"},{allOf:[p,s],title:s&&s["x-displayName"]||(null==s?void 0:s.title)||"case 2"}];this.oneOf=d.map((function(i,n){return new e(t,__assign({},i),r.pointer+"/oneOf/"+n,r.options,!1,r.refsStack,__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}))})),this.oneOfType="One of"}}),__decorate([observable],e.prototype,"activeOneOf",void 0),__decorate([action],e.prototype,"activateOneOf",null),e}();export{SchemaModel};function normalizeField(e,i,t){return e||(console.warn('Field "'+i+'" is invalid, skipping.\n Field must be an object but got '+typeof e+' at "'+t+'"'),{})}function buildFields(e,i,t,r,n,a){var s=i.properties||i.prefixItems||i.items||{},o=i.patternProperties||{},l=i.additionalProperties||i.unevaluatedProperties,p=i.prefixItems?i.items:i.additionalItems,d=i.default||{},u=Object.keys(s).map((function(o){var l,p=normalizeField(s[o],o,t),u=void 0!==i.required&&i.required.indexOf(o)>-1;return new FieldModel(e,{name:i.properties?o:"["+o+"]",required:u,schema:__assign(__assign({},p),{example:(null===(l=i.example)||void 0===l?void 0:l[o])||p.example,default:void 0===p.default&&d?d[o]:p.default})},t+"/properties/"+o,r,n,a)}));return r.sortPropsAlphabetically&&(u=sortByField(u,"name")),r.requiredPropsFirst&&(u=sortByRequired(u,r.sortPropsAlphabetically?void 0:i.required)),u.push.apply(u,Object.keys(o).map((function(i){var s=normalizeField(o[i],i,t);return new FieldModel(e,{name:i,required:!1,schema:s,kind:"patternProperties"},t+"/patternProperties/"+i,r,n,a)}))),(isObject(l)||!0===l)&&u.push(new FieldModel(e,{name:(isObject(l)&&l["x-additionalPropertiesName"]||"property name").concat("*"),required:!1,schema:!0===l?{}:l,kind:"additionalProperties"},t+"/additionalProperties",r,n,a)),u.push.apply(u,buildAdditionalItems({parser:e,schema:p,fieldsCount:u.length,$ref:t,options:r,refsStack:n,deps:a})),u}function buildAdditionalItems(e){var i=e.parser,t=e.schema,r=void 0!==t&&t,n=e.fieldsCount,a=e.$ref,s=e.options,o=e.refsStack,l=e.deps;return"boolean"==typeof r?r?[new FieldModel(i,{name:"["+n+"...]",schema:{},kind:"additionalItems"},a+"/additionalItems",s,o,l)]:[]:Array.isArray(r)?__spreadArray([],r.map((function(e,t){return new FieldModel(i,{name:"["+(n+t)+"]",schema:e,kind:"additionalItems"},a+"/additionalItems/"+t,s,o,l)})),!0):isObject(r)?[new FieldModel(i,{name:"["+n+"...]",schema:r,kind:"additionalItems"},a+"/additionalItems",s,o,l)]:[]}function getDiscriminator(e){return e.discriminator||e["x-discriminator"]}function collectUniqueOneOfTypesDeep(e){var i=new Set;return function e(t){for(var r=0,n=t.oneOf||[];r<n.length;r++){var a=n[r];a.oneOf?e(a):a.type&&i.add(a.type)}}(e),Array.from(i.values())}
|
|
1
|
+
import{__assign,__decorate,__rest,__spreadArray}from"tslib";import{action,observable,makeObservable}from"mobx";import{pushRef}from"../OpenAPIParser";import{detectType,extractExtensions,humanizeConstraints,isNamedDefinition,isObject,isPrimitiveType,JsonPointer,pluralizeType,sortByField,sortByRequired}from"../../utils/";import{l}from"../Labels";import{FieldModel}from"./Field";var SchemaModel=function(){function e(e,i,t,r,n,a,s){void 0===n&&(n=!1),void 0===a&&(a=[]),void 0===s&&(s={}),Object.defineProperty(this,"parser",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"refsStack",{enumerable:!0,configurable:!0,writable:!0,value:a}),Object.defineProperty(this,"deps",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"pointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"typePrefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"title",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"description",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"externalDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isPrimitive",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isCircular",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"format",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"displayFormat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nullable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"deprecated",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pattern",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"example",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enum",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"default",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writeOnly",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"constraints",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_fields",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oneOf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"oneOfType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"discriminatorProp",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"activeOneOf",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"rawSchema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"schema",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extensions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"x-enumDescriptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"const",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentEncoding",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contentMediaType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"minItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxItems",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),makeObservable(this),this.pointer=i.$ref||t||"";var o=e.deref(i,a,!0),l=o.resolved,p=o.refsStack;this.refsStack=pushRef(p,this.pointer),this.rawSchema=l,this.schema=e.mergeAllOf(this.rawSchema,this.pointer,this.refsStack),this.init(e,n),r.showExtensions&&(this.extensions=extractExtensions(this.schema,r.showExtensions))}return Object.defineProperty(e.prototype,"activateOneOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.activeOneOf=e}}),Object.defineProperty(e.prototype,"hasType",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.type===e||Array.isArray(this.type)&&this.type.includes(e)}}),Object.defineProperty(e.prototype,"fields",{get:function(){if(!this.isCircular)return!this._fields&&this.hasType("object")&&(this._fields=buildFields(this.parser,this.schema,this.pointer,this.options,this.refsStack,this.deps)),this._fields},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r,n,a,s,o,p,d,u,f=this,c=this.schema;if(this.isCircular=!!c["x-circular-ref"],this.title=c.title||isNamedDefinition(this.pointer)&&JsonPointer.baseName(this.pointer)||"",this.description=c.description||"",this.type=c.type||detectType(c),this.format=c.format,this.enum=c.enum||[],this["x-enumDescriptions"]=c["x-enumDescriptions"],this.example=c.example,this.deprecated=!!c.deprecated,this.pattern=c.pattern,this.externalDocs=c.externalDocs,this.constraints=humanizeConstraints(c),this.displayFormat=this.format,this.isPrimitive=isPrimitiveType(c,this.type),this.default=c.default,this.readOnly=!!c.readOnly,this.writeOnly=!!c.writeOnly,this.const=c.const||"",this.contentEncoding=c.contentEncoding,this.contentMediaType=c.contentMediaType,this.minItems=c.minItems,this.maxItems=c.maxItems,(c.nullable||c["x-nullable"])&&(Array.isArray(this.type)&&!this.type.some((function(e){return null===e||"null"===e}))?this.type=__spreadArray(__spreadArray([],this.type,!0),["null"],!1):Array.isArray(this.type)||null===this.type&&"null"===this.type||(this.type=[this.type,"null"])),this.displayType=Array.isArray(this.type)?this.type.map((function(e){return null===e?"null":e})).join(" or "):this.type,!this.isCircular)if(c.if&&c.then||c.if&&c.else)this.initConditionalOperators(c,i);else if(t||void 0===getDiscriminator(c)){if(t&&Array.isArray(c.oneOf)&&c.oneOf.find((function(e){return e.$ref===f.pointer}))&&delete c.oneOf,void 0!==c.oneOf)return this.initOneOf(c.oneOf,i),this.oneOfType="One of",void(void 0!==c.anyOf&&console.warn("oneOf and anyOf are not supported on the same level. Skipping anyOf at "+this.pointer));if(void 0!==c.anyOf)return this.initOneOf(c.anyOf,i),void(this.oneOfType="Any of");if(this.hasType("array")&&(Array.isArray(c.items)||Array.isArray(c.prefixItems)?this._fields=buildFields(i,c,this.pointer,this.options,this.refsStack,this.deps):c.items&&(this.items=new e(i,c.items,this.pointer+"/items",this.options,!1,this.refsStack,this.deps)),this.displayType=c.prefixItems||Array.isArray(c.items)?"items":pluralizeType((null===(r=this.items)||void 0===r?void 0:r.displayType)||this.displayType),this.displayFormat=(null===(n=this.items)||void 0===n?void 0:n.format)||"",this.typePrefix=(null===(a=this.items)||void 0===a?void 0:a.typePrefix)||""+l("arrayOf"),this.title=this.title||(null===(s=this.items)||void 0===s?void 0:s.title)||"",this.isPrimitive=void 0!==(null===(o=this.items)||void 0===o?void 0:o.isPrimitive)?null===(p=this.items)||void 0===p?void 0:p.isPrimitive:this.isPrimitive,void 0===this.example&&void 0!==(null===(d=this.items)||void 0===d?void 0:d.example)&&(this.example=[this.items.example]),(null===(u=this.items)||void 0===u?void 0:u.isPrimitive)&&(this.enum=this.items.enum,this["x-enumDescriptions"]=this.items["x-enumDescriptions"]),Array.isArray(this.type))){var h=this.type.filter((function(e){return"array"!==e}));h.length&&(this.displayType+=" or "+h.join(" or "))}this.enum.length&&this.options.sortEnumValuesAlphabetically&&this.enum.sort()}else this.initDiscriminator(c,i)}}),Object.defineProperty(e.prototype,"initOneOf",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this;if(this.oneOf=i.map((function(i,n){var a=t.deref(i,r.refsStack,!0),s=a.resolved,o=a.refsStack,l=t.mergeAllOf(s,r.pointer+"/oneOf/"+n,o),p=isNamedDefinition(i.$ref)&&!l.title?JsonPointer.baseName(i.$ref):""+(l.title||"")+(l.const&&JSON.stringify(l.const)||"");return new e(t,__assign(__assign({},l),{title:p,allOf:[__assign(__assign({},r.schema),{oneOf:void 0,anyOf:void 0})]}),i.$ref||r.pointer+"/oneOf/"+n,r.options,!1,o,__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}))})),this.options.simpleOneOfTypeLabel){var n=collectUniqueOneOfTypesDeep(this);this.displayType=n.join(" or ")}else this.displayType=this.oneOf.map((function(e){var i=e.typePrefix+(e.title?e.title+" ("+e.displayType+")":e.displayType);return i.indexOf(" or ")>-1&&(i="("+i+")"),i})).join(" or ")}}),Object.defineProperty(e.prototype,"initDiscriminator",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this,n=getDiscriminator(i);this.discriminatorProp=null==n?void 0:n.propertyName;var a=t.findDerived(__spreadArray(__spreadArray([],this.schema["x-parentRefs"]||[],!0),[this.pointer],!1));if(i.oneOf)for(var s=0,o=i.oneOf;s<o.length;s++){var l=o[s];if(void 0!==l.$ref){var p=JsonPointer.baseName(l.$ref);a[l.$ref]=p}}var d=(null==n?void 0:n.mapping)||{},u=(null==n?void 0:n["x-explicitMappingOnly"])||!1;0===Object.keys(d).length&&(u=!1);var f={};for(var c in d){var h=d[c];Array.isArray(f[h])?f[h].push(c):f[h]=[c]}for(var b=__assign(u?{}:__assign({},a),f),m=[],y=0,v=Object.keys(b);y<v.length;y++){var O=b[h=v[y]];if(Array.isArray(O))for(var g=0,P=O;g<P.length;g++){var w=P[g];m.push({$ref:h,name:w})}else m.push({$ref:h,name:O})}var j=Object.keys(d);0!==j.length&&(m=m.sort((function(e,i){var t=j.indexOf(e.name),r=j.indexOf(i.name);return t<0&&r<0?e.name.localeCompare(i.name):t<0?1:r<0?-1:t-r}))),this.oneOf=m.map((function(i,n){var a=i.$ref,s=i.name,o=new e(t,{$ref:a},a,r.options,!0,r.refsStack.slice(0,-1),__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}));return o.title=s,o}))}}),Object.defineProperty(e.prototype,"initConditionalOperators",{enumerable:!1,configurable:!0,writable:!0,value:function(i,t){var r=this,n=i.if,a=i.else,s=void 0===a?{}:a,o=i.then,l=void 0===o?{}:o,p=__rest(i,["if","else","then"]),d=[{allOf:[p,l,n],title:n&&n["x-displayName"]||(null==n?void 0:n.title)||"case 1"},{allOf:[p,s],title:s&&s["x-displayName"]||(null==s?void 0:s.title)||"case 2"}];this.oneOf=d.map((function(i,n){return new e(t,__assign({},i),r.pointer+"/oneOf/"+n,r.options,!1,r.refsStack,__assign(__assign({},r.deps),{parentFieldFullPath:r.deps.parentFieldFullPath?r.deps.parentFieldFullPath+r.options.deepLinkSeparator+n:n.toString()}))})),this.oneOfType="One of"}}),__decorate([observable],e.prototype,"activeOneOf",void 0),__decorate([action],e.prototype,"activateOneOf",null),e}();export{SchemaModel};function normalizeField(e,i,t){return e||(console.warn('Field "'+i+'" is invalid, skipping.\n Field must be an object but got '+typeof e+' at "'+t+'"'),{})}function buildFields(e,i,t,r,n,a){var s=i.properties||i.prefixItems||i.items||{},o=i.patternProperties||{},l=i.additionalProperties||i.unevaluatedProperties,p=i.prefixItems?i.items:i.additionalItems,d=i.default||{},u=Object.keys(s).map((function(o){var l,p=normalizeField(s[o],o,t),u=void 0!==i.required&&i.required.indexOf(o)>-1;return new FieldModel(e,{name:i.properties?o:"["+o+"]",required:u,schema:__assign(__assign({},p),{example:(null===(l=i.example)||void 0===l?void 0:l[o])||p.example,default:void 0===p.default&&d?d[o]:p.default})},t+"/properties/"+o,r,n,a)}));return r.sortPropsAlphabetically&&(u=sortByField(u,"name")),r.requiredPropsFirst&&(u=sortByRequired(u,r.sortPropsAlphabetically?void 0:i.required)),u.push.apply(u,Object.keys(o).map((function(i){var s=normalizeField(o[i],i,t);return new FieldModel(e,{name:i,required:!1,schema:s,kind:"patternProperties"},t+"/patternProperties/"+i,r,n,a)}))),(isObject(l)||!0===l)&&u.push(new FieldModel(e,{name:(isObject(l)&&l["x-additionalPropertiesName"]||"property name").concat("*"),required:!1,schema:!0===l?{}:l,kind:"additionalProperties"},t+"/additionalProperties",r,n,a)),u.push.apply(u,buildAdditionalItems({parser:e,schema:p,fieldsCount:u.length,$ref:t,options:r,refsStack:n,deps:a})),u}function buildAdditionalItems(e){var i=e.parser,t=e.schema,r=void 0!==t&&t,n=e.fieldsCount,a=e.$ref,s=e.options,o=e.refsStack,l=e.deps;return"boolean"==typeof r?r?[new FieldModel(i,{name:"["+n+"...]",schema:{},kind:"additionalItems"},a+"/additionalItems",s,o,l)]:[]:Array.isArray(r)?__spreadArray([],r.map((function(e,t){return new FieldModel(i,{name:"["+(n+t)+"]",schema:e,kind:"additionalItems"},a+"/additionalItems/"+t,s,o,l)})),!0):isObject(r)?[new FieldModel(i,{name:"["+n+"...]",schema:r,kind:"additionalItems"},a+"/additionalItems",s,o,l)]:[]}function getDiscriminator(e){return e.discriminator||e["x-discriminator"]}function collectUniqueOneOfTypesDeep(e){var i=new Set;return function e(t){for(var r=0,n=t.oneOf||[];r<n.length;r++){var a=n[r];a.oneOf?e(a):a.type&&i.add(a.type)}}(e),Array.from(i.values())}
|
|
2
2
|
//# sourceMappingURL=Schema.js.map
|
|
@@ -287,6 +287,7 @@ export interface OpenAPISecurityScheme {
|
|
|
287
287
|
scopes: Record<string, string>;
|
|
288
288
|
authorizationUrl: string;
|
|
289
289
|
'x-defaultClientId'?: string;
|
|
290
|
+
'x-tokenEndpointAuthMethod'?: string;
|
|
290
291
|
};
|
|
291
292
|
password?: {
|
|
292
293
|
refreshUrl?: string;
|
|
@@ -299,6 +300,7 @@ export interface OpenAPISecurityScheme {
|
|
|
299
300
|
scopes: Record<string, string>;
|
|
300
301
|
tokenUrl: string;
|
|
301
302
|
'x-defaultClientId'?: string;
|
|
303
|
+
'x-tokenEndpointAuthMethod'?: string;
|
|
302
304
|
};
|
|
303
305
|
authorizationCode?: {
|
|
304
306
|
refreshUrl?: string;
|
|
@@ -306,6 +308,7 @@ export interface OpenAPISecurityScheme {
|
|
|
306
308
|
authorizationUrl: string;
|
|
307
309
|
tokenUrl: string;
|
|
308
310
|
'x-defaultClientId'?: string;
|
|
311
|
+
'x-tokenEndpointAuthMethod'?: string;
|
|
309
312
|
};
|
|
310
313
|
};
|
|
311
314
|
openIdConnectUrl?: string;
|
|
@@ -22,6 +22,8 @@ export declare function isNumeric(value: unknown): value is number;
|
|
|
22
22
|
export declare function appendToMdHeading(md: string, heading: string, content: string): string;
|
|
23
23
|
export declare const mergeObjects: (target: GenericObject, ...sources: GenericObject[]) => GenericObject;
|
|
24
24
|
export declare const isObject: (item: unknown) => item is "object";
|
|
25
|
+
export declare const isArrayOfObjects: (items: unknown) => items is [];
|
|
26
|
+
export declare const deleteEmptyArrayItem: (items: unknown[]) => unknown[];
|
|
25
27
|
export declare const isMergeableObject: (item: unknown) => boolean;
|
|
26
28
|
/**
|
|
27
29
|
* slugify() returns empty string when failed to slugify.
|
|
@@ -37,7 +39,7 @@ export declare function isAbsoluteUrl(url: string): boolean;
|
|
|
37
39
|
export declare function resolveUrl(url: string, to: string): string;
|
|
38
40
|
export declare function getBasePath(serverUrl: string): string;
|
|
39
41
|
export declare function titleize(text: string): string;
|
|
40
|
-
export declare function
|
|
42
|
+
export declare function removeQueryStringAndHash(serverUrl: string): string;
|
|
41
43
|
export declare function escapeHTMLAttrChars(str: string): string;
|
|
42
44
|
export declare function unescapeHTMLChars(str: string): string;
|
|
43
45
|
export declare function sanitizeItemId(id: string): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign,__spreadArray}from"tslib";import slugify from"slugify";import{format,parse}from"url";import{ZERO_BREAKPOINT}from"./media-css";import{isNamedDefinition}from"./openapi";import JsonPointer from"./JsonPointer";export function mapWithLast(e,r){for(var t=[],n=0;n<e.length-1;n++)t.push(r(e[n],!1));return 0!==e.length&&t.push(r(e[e.length-1],!0)),t}export function mapValues(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=r(e[n],n,e));return t}export function flattenByProp(e,r){var t=[],n=function(e){for(var i=0,a=e;i<a.length;i++){var o=a[i];t.push(o),o[r]&&n(o[r])}};return n(e),t}export function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function appendToMdHeading(e,r,t){var n=new RegExp("(^|\\n)#\\s?"+r+"\\s*\\n","i"),i=new RegExp("((\\n|^)#\\s*"+r+"\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)","i");if(n.test(e))return e.replace(i,"$1\n\n"+t+"\n$4");var a=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return""+e+a+"# "+r+"\n\n"+t}export var mergeObjects=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];if(!r.length)return e;var n=r.shift();return void 0===n?e:(isMergeableObject(e)&&isMergeableObject(n)&&Object.keys(n).forEach((function(r){var t;isMergeableObject(n[r])?(e[r]||(e[r]={}),["string","number"].includes(typeof e[r])&&(n[r][ZERO_BREAKPOINT]||0===n[r][ZERO_BREAKPOINT]||console.warn('Theme resolver: using default value of "'+e[r]+'" for "'+r+'". This is not recommended. Prefer adding default value by providing "'+ZERO_BREAKPOINT+'" property to '+JSON.stringify(n[r])+"."),e[r]=((t={})[ZERO_BREAKPOINT]=e[r],t)),mergeObjects(e[r],n[r])):e[r]=n[r]})),mergeObjects.apply(void 0,__spreadArray([e],r,!1)))};export var isObject=function(e){return null!==e&&"object"==typeof e};export var isMergeableObject=function(e){return isObject(e)&&!Array.isArray(e)};export function safeSlugify(e){return slugify(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}export function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}export function resolveUrl(e,r){var t;if(r.startsWith("//"))t=""+(parse(e).protocol||"https:")+r;else if(isAbsoluteUrl(r))t=r;else if(r.startsWith("/")){var n=parse(e);t=format(__assign(__assign({},n),{pathname:r}))}else t=stripTrailingSlash(e)+"/"+r;return stripTrailingSlash(t)}export function getBasePath(e){try{return parseURL(e).pathname}catch(r){return e}}export function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}export function
|
|
1
|
+
import{__assign,__spreadArray}from"tslib";import slugify from"slugify";import{format,parse}from"url";import{ZERO_BREAKPOINT}from"./media-css";import{isNamedDefinition}from"./openapi";import JsonPointer from"./JsonPointer";export function mapWithLast(e,r){for(var t=[],n=0;n<e.length-1;n++)t.push(r(e[n],!1));return 0!==e.length&&t.push(r(e[e.length-1],!0)),t}export function mapValues(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=r(e[n],n,e));return t}export function flattenByProp(e,r){var t=[],n=function(e){for(var i=0,a=e;i<a.length;i++){var o=a[i];t.push(o),o[r]&&n(o[r])}};return n(e),t}export function stripTrailingSlash(e){return e.endsWith("/")?e.substring(0,e.length-1):e}export function isNumeric(e){return!isNaN(parseFloat(e))&&isFinite(e)}export function appendToMdHeading(e,r,t){var n=new RegExp("(^|\\n)#\\s?"+r+"\\s*\\n","i"),i=new RegExp("((\\n|^)#\\s*"+r+"\\s*(\\n|$)(?:.|\\n)*?)(\\n#|$)","i");if(n.test(e))return e.replace(i,"$1\n\n"+t+"\n$4");var a=""===e||e.endsWith("\n\n")?"":e.endsWith("\n")?"\n":"\n\n";return""+e+a+"# "+r+"\n\n"+t}export var mergeObjects=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];if(!r.length)return e;var n=r.shift();return void 0===n?e:(isMergeableObject(e)&&isMergeableObject(n)&&Object.keys(n).forEach((function(r){var t;isMergeableObject(n[r])?(e[r]||(e[r]={}),["string","number"].includes(typeof e[r])&&(n[r][ZERO_BREAKPOINT]||0===n[r][ZERO_BREAKPOINT]||console.warn('Theme resolver: using default value of "'+e[r]+'" for "'+r+'". This is not recommended. Prefer adding default value by providing "'+ZERO_BREAKPOINT+'" property to '+JSON.stringify(n[r])+"."),e[r]=((t={})[ZERO_BREAKPOINT]=e[r],t)),mergeObjects(e[r],n[r])):e[r]=n[r]})),mergeObjects.apply(void 0,__spreadArray([e],r,!1)))};export var isObject=function(e){return null!==e&&"object"==typeof e};export var isArrayOfObjects=function(e){return Array.isArray(e)&&e.some((function(e){return isObject(e)}))};export var deleteEmptyArrayItem=function(e){return e.filter((function(e){return!!e}))};export var isMergeableObject=function(e){return isObject(e)&&!Array.isArray(e)};export function safeSlugify(e){return slugify(e)||e.toString().toLowerCase().replace(/\s+/g,"-").replace(/&/g,"-and-").replace(/--+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}export function isAbsoluteUrl(e){return/(?:^[a-z][a-z0-9+.-]*:|\/\/)/i.test(e)}export function resolveUrl(e,r){var t;if(r.startsWith("//"))t=""+(parse(e).protocol||"https:")+r;else if(isAbsoluteUrl(r))t=r;else if(r.startsWith("/")){var n=parse(e);t=format(__assign(__assign({},n),{pathname:r}))}else t=stripTrailingSlash(e)+"/"+r;return stripTrailingSlash(t)}export function getBasePath(e){try{return parseURL(e).pathname}catch(r){return e}}export function titleize(e){return e.charAt(0).toUpperCase()+e.slice(1)}export function removeQueryStringAndHash(e){try{var r=parseURL(e);return r.search="",r.hash="",r.toString()}catch(r){return e}}function parseURL(e){return"undefined"==typeof URL?new(require("url").URL)(e):new URL(e)}export function escapeHTMLAttrChars(e){return e.replace(/["\\]/g,"\\$&")}export function unescapeHTMLChars(e){return e.replace(/&#(\d+);/g,(function(e,r){return String.fromCharCode(parseInt(r,10))})).replace(/&/g,"&").replace(/"/g,'"')}export function sanitizeItemId(e){return e&&e.replace(/#/g,"_")}export function getSchemaTitle(e,r){return r||isNamedDefinition(e)&&JsonPointer.baseName(e)||""}
|
|
2
2
|
//# sourceMappingURL=helpers.js.map
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { FieldModel } from '../services/models';
|
|
2
2
|
import type { OpenAPIParser } from '../services/OpenAPIParser';
|
|
3
|
-
import type { OpenAPIEncoding, OpenAPIMediaType,
|
|
3
|
+
import type { OpenAPIEncoding, OpenAPIMediaType, OpenAPIParameter, OpenAPIParameterStyle, OpenAPISchema, OpenAPIServer, Referenced, OpenAPIResponse, OpenAPIRequestBody } from '../types';
|
|
4
|
+
import type { ExtendedOpenAPIOperation } from '../services';
|
|
4
5
|
export declare function isStatusCode(statusCode: string): boolean;
|
|
5
6
|
export declare function getStatusCodeType(statusCode: string | number, defaultAsError?: boolean): string;
|
|
6
7
|
export declare function isOperationName(key: string): boolean;
|
|
7
|
-
export declare function getOperationSummary(operation:
|
|
8
|
+
export declare function getOperationSummary(operation: ExtendedOpenAPIOperation): string;
|
|
8
9
|
export declare function detectType(schema: OpenAPISchema): string;
|
|
9
10
|
export declare function isPrimitiveType(schema: OpenAPISchema, type?: string | string[] | undefined): boolean;
|
|
10
11
|
export declare function isJsonLike(contentType: string): boolean;
|