@coveo/atomic 3.32.3-pre.8d7d6469f7 → 3.32.3-pre.d8395b7e5a
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/dist/atomic/_atomic.esm.js +1 -1
- package/dist/atomic/components/analytics-config.js +1 -1
- package/dist/atomic/components/atomic-generated-answer.js +4 -2
- package/dist/atomic/components/atomic-generated-answer.js.map +1 -1
- package/dist/atomic/components/atomic-insight-generated-answer.js +3 -2
- package/dist/atomic/components/atomic-insight-generated-answer.js.map +1 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-did-you-mean/atomic-commerce-did-you-mean.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-facet/atomic-commerce-facet.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-facets/atomic-commerce-facets.js +1 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-interface/atomic-commerce-interface.js +2 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-layout/atomic-commerce-layout.js +1 -2
- package/dist/atomic/components/components/commerce/atomic-commerce-no-products/atomic-commerce-no-products.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-numeric-facet/atomic-commerce-numeric-facet.js +3 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-pager/atomic-commerce-pager.js +1 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-product-list/atomic-commerce-product-list.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-query-error/atomic-commerce-query-error.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-query-summary/atomic-commerce-query-summary.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.js +1 -3
- package/dist/atomic/components/components/commerce/atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.js +1 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-refine-toggle/atomic-commerce-refine-toggle.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.js +4 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.js +2 -1
- package/dist/atomic/components/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-sort-dropdown/atomic-commerce-sort-dropdown.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-commerce-timeframe-facet/atomic-commerce-timeframe-facet.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-product-field-condition/atomic-product-field-condition.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-product-link/atomic-product-link.js +1 -2
- package/dist/atomic/components/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.js +1 -0
- package/dist/atomic/components/components/commerce/atomic-product-price/atomic-product-price.js +1 -0
- package/dist/atomic/components/components/commerce/atomic-product-rating/atomic-product-rating.js +2 -0
- package/dist/atomic/components/components/commerce/atomic-product-template/atomic-product-template.js +2 -0
- package/dist/atomic/components/generated-answer-common.js +23 -0
- package/dist/atomic/components/generated-answer-common.js.map +1 -1
- package/dist/atomic/components/global/environment.js +1 -1
- package/dist/atomic/{p-e2135441.entry.js → p-0dc126bb.entry.js} +2 -2
- package/dist/atomic/p-0dc126bb.entry.js.map +1 -0
- package/dist/atomic/{p-40051121.js → p-320ab8c0.js} +2 -2
- package/dist/atomic/{p-377540cc.entry.js → p-4fb01481.entry.js} +2 -2
- package/dist/atomic/{p-5b38b5ae.entry.js → p-8ace8433.entry.js} +2 -2
- package/dist/atomic/p-c6e1a7ab.entry.js +2 -0
- package/dist/atomic/p-c6e1a7ab.entry.js.map +1 -0
- package/dist/atomic/p-cf3b7218.js +2 -0
- package/dist/atomic/p-cf3b7218.js.map +1 -0
- package/dist/atomic/{p-13525e49.entry.js → p-e74a4a8c.entry.js} +2 -2
- package/dist/cjs/_loader.cjs.js +1 -1
- package/dist/cjs/{analytics-config-8687c28f.js → analytics-config-879b5a35.js} +2 -2
- package/dist/cjs/{analytics-config-8687c28f.js.map → analytics-config-879b5a35.js.map} +1 -1
- package/dist/cjs/atomic-generated-answer.cjs.entry.js +4 -2
- package/dist/cjs/atomic-generated-answer.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js +4 -2
- package/dist/cjs/atomic-insight-generated-answer.cjs.entry.js.map +1 -1
- package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
- package/dist/cjs/atomic.cjs.js +1 -1
- package/dist/cjs/{generated-answer-common-1f7e3c88.js → generated-answer-common-1f24d687.js} +24 -1
- package/dist/cjs/generated-answer-common-1f24d687.js.map +1 -0
- package/dist/cjs/version.cjs.js +1 -1
- package/dist/esm/_loader.js +1 -1
- package/dist/esm/{analytics-config-7fc55d65.js → analytics-config-3175e6f5.js} +2 -2
- package/dist/esm/{analytics-config-7fc55d65.js.map → analytics-config-3175e6f5.js.map} +1 -1
- package/dist/esm/atomic-generated-answer.entry.js +4 -2
- package/dist/esm/atomic-generated-answer.entry.js.map +1 -1
- package/dist/esm/atomic-insight-generated-answer.entry.js +4 -2
- package/dist/esm/atomic-insight-generated-answer.entry.js.map +1 -1
- package/dist/esm/atomic-insight-interface.entry.js +1 -1
- package/dist/esm/atomic-recs-interface.entry.js +1 -1
- package/dist/esm/atomic-search-interface.entry.js +1 -1
- package/dist/esm/atomic.js +1 -1
- package/dist/esm/{generated-answer-common-ee9bfc67.js → generated-answer-common-83e389e1.js} +24 -1
- package/dist/esm/generated-answer-common-83e389e1.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/components/commerce/atomic-commerce-breadbox/atomic-commerce-breadbox.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-did-you-mean/atomic-commerce-did-you-mean.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-facet/atomic-commerce-facet.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-facets/atomic-commerce-facets.d.ts +1 -0
- package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts +2 -1
- package/dist/types/components/commerce/atomic-commerce-layout/atomic-commerce-layout.d.ts +1 -2
- package/dist/types/components/commerce/atomic-commerce-no-products/atomic-commerce-no-products.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-numeric-facet/atomic-commerce-numeric-facet.d.ts +3 -0
- package/dist/types/components/commerce/atomic-commerce-pager/atomic-commerce-pager.d.ts +1 -0
- package/dist/types/components/commerce/atomic-commerce-product-list/atomic-commerce-product-list.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-products-per-page/atomic-commerce-products-per-page.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-query-error/atomic-commerce-query-error.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-query-summary/atomic-commerce-query-summary.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-recommendation-interface/atomic-commerce-recommendation-interface.d.ts +1 -3
- package/dist/types/components/commerce/atomic-commerce-recommendation-list/atomic-commerce-recommendation-list.d.ts +1 -0
- package/dist/types/components/commerce/atomic-commerce-refine-toggle/atomic-commerce-refine-toggle.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-search-box-instant-products/atomic-commerce-search-box-instant-products.d.ts +4 -1
- package/dist/types/components/commerce/atomic-commerce-search-box-query-suggestions/atomic-commerce-search-box-query-suggestions.d.ts +2 -1
- package/dist/types/components/commerce/atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-recent-queries.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-sort-dropdown/atomic-commerce-sort-dropdown.d.ts +2 -0
- package/dist/types/components/commerce/atomic-commerce-timeframe-facet/atomic-commerce-timeframe-facet.d.ts +2 -0
- package/dist/types/components/commerce/atomic-product-field-condition/atomic-product-field-condition.d.ts +2 -0
- package/dist/types/components/commerce/atomic-product-link/atomic-product-link.d.ts +1 -2
- package/dist/types/components/commerce/atomic-product-multi-value-text/atomic-product-multi-value-text.d.ts +2 -0
- package/dist/types/components/commerce/atomic-product-numeric-field-value/atomic-product-numeric-field-value.d.ts +1 -0
- package/dist/types/components/commerce/atomic-product-price/atomic-product-price.d.ts +1 -0
- package/dist/types/components/commerce/atomic-product-rating/atomic-product-rating.d.ts +2 -0
- package/dist/types/components/commerce/atomic-product-template/atomic-product-template.d.ts +2 -0
- package/dist/types/components/common/generated-answer/generated-answer-common.d.ts +1 -0
- package/dist/types/components/insight/atomic-insight-generated-answer/atomic-insight-generated-answer.d.ts +3 -3
- package/dist/types/components/search/atomic-generated-answer/atomic-generated-answer.d.ts +3 -3
- package/dist/types/components.d.ts +8 -8
- package/docs/atomic-docs.json +6 -6
- package/package.json +1 -1
- package/dist/atomic/p-2857ab2b.js +0 -2
- package/dist/atomic/p-2857ab2b.js.map +0 -1
- package/dist/atomic/p-50dc4fa2.entry.js +0 -2
- package/dist/atomic/p-50dc4fa2.entry.js.map +0 -1
- package/dist/atomic/p-e2135441.entry.js.map +0 -1
- package/dist/cjs/generated-answer-common-1f7e3c88.js.map +0 -1
- package/dist/esm/generated-answer-common-ee9bfc67.js.map +0 -1
- /package/dist/atomic/{p-40051121.js.map → p-320ab8c0.js.map} +0 -0
- /package/dist/atomic/{p-377540cc.entry.js.map → p-4fb01481.entry.js.map} +0 -0
- /package/dist/atomic/{p-5b38b5ae.entry.js.map → p-8ace8433.entry.js.map} +0 -0
- /package/dist/atomic/{p-13525e49.entry.js.map → p-e74a4a8c.entry.js.map} +0 -0
|
@@ -3,6 +3,8 @@ import { LitElement } from 'lit';
|
|
|
3
3
|
import type { InitializableComponent } from "../../../decorators/types";
|
|
4
4
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
5
5
|
/**
|
|
6
|
+
* @alpha
|
|
7
|
+
*
|
|
6
8
|
* The `atomic-commerce-did-you-mean` component is responsible for handling query corrections. When a query returns no products but finds a possible query correction, the component either suggests the correction or automatically triggers a new query with the suggested term.
|
|
7
9
|
*
|
|
8
10
|
* @part no-results - The text displayed when there are no results.
|
|
@@ -35,6 +35,8 @@ declare const AtomicCommerceFacet_base: typeof LitElement;
|
|
|
35
35
|
* @part show-more - The show more results button.
|
|
36
36
|
* @part show-less - The show less results button.
|
|
37
37
|
* @part show-more-less-icon - The icons of the show more & show less buttons.
|
|
38
|
+
*
|
|
39
|
+
* @alpha
|
|
38
40
|
*/
|
|
39
41
|
export declare class AtomicCommerceFacet extends AtomicCommerceFacet_base implements InitializableComponent<CommerceBindings> {
|
|
40
42
|
/**
|
|
@@ -9,6 +9,7 @@ import '../atomic-commerce-timeframe-facet/atomic-commerce-timeframe-facet';
|
|
|
9
9
|
/**
|
|
10
10
|
* The `atomic-commerce-facets` component automatically renders commerce facets based on the Commerce API response.
|
|
11
11
|
* Unlike regular facets, which require explicit definition and request in the query, the `atomic-commerce-facets` component dynamically generates facets.
|
|
12
|
+
*
|
|
12
13
|
*/
|
|
13
14
|
export declare class AtomicCommerceFacets extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
14
15
|
bindings: CommerceBindings;
|
package/dist/types/components/commerce/atomic-commerce-interface/atomic-commerce-interface.d.ts
CHANGED
|
@@ -8,12 +8,13 @@ export type CommerceInitializationOptions = CommerceEngineConfiguration;
|
|
|
8
8
|
export type CommerceBindings = CommonBindings<CommerceEngine, CommerceStore, AtomicCommerceInterface>;
|
|
9
9
|
declare const AtomicCommerceInterface_base: typeof LitElement;
|
|
10
10
|
/**
|
|
11
|
+
* @alpha
|
|
11
12
|
* The `atomic-commerce-interface` component is the parent to all other atomic commerce components in a commerce page
|
|
12
13
|
* (except for `atomic-commerce-recommendation-list`, which must have
|
|
13
14
|
* `atomic-commerce-recommendation-interface` as a parent). It handles the headless commerce engine and localization
|
|
14
15
|
* configurations.
|
|
15
16
|
*
|
|
16
|
-
* @slot default - The default slot where you can add child components to the
|
|
17
|
+
* @slot default - The default slot where you can add child components to the search box.
|
|
17
18
|
*/
|
|
18
19
|
export declare class AtomicCommerceInterface extends AtomicCommerceInterface_base implements BaseAtomicInterface<CommerceEngine> {
|
|
19
20
|
urlManager: UrlManager;
|
|
@@ -2,8 +2,7 @@ import { LitElement } from 'lit';
|
|
|
2
2
|
declare const AtomicCommerceLayout_base: typeof LitElement;
|
|
3
3
|
/**
|
|
4
4
|
* The `atomic-commerce-layout` helps organize elements in the commerce page.
|
|
5
|
-
*
|
|
6
|
-
* @slot default - The default slot where you can add child components to the layout.
|
|
5
|
+
* @alpha
|
|
7
6
|
*/
|
|
8
7
|
export declare class AtomicCommerceLayout extends AtomicCommerceLayout_base {
|
|
9
8
|
error: Error;
|
package/dist/types/components/commerce/atomic-commerce-no-products/atomic-commerce-no-products.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ import type { InitializableComponent } from "../../../decorators/types.js";
|
|
|
4
4
|
import { AriaLiveRegionController } from "../../../utils/accessibility-utils.js";
|
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface.js';
|
|
6
6
|
/**
|
|
7
|
+
* @alpha
|
|
8
|
+
*
|
|
7
9
|
* The `atomic-commerce-no-products` component displays search tips when there are no products. Any additional content slotted inside of its element will be displayed as well.
|
|
8
10
|
*
|
|
9
11
|
* @part no-results - The text indicating that no products were found for the search.
|
|
@@ -23,6 +23,9 @@ declare const AtomicCommerceNumericFacet_base: typeof LitElement;
|
|
|
23
23
|
* @part label-end - The label for the maximum value input field.
|
|
24
24
|
* @part input-end - The input field to enter the maximum numeric value.
|
|
25
25
|
* @part input-apply-button - The button to apply custom numeric range values.
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*
|
|
26
29
|
*/
|
|
27
30
|
export declare class AtomicCommerceNumericFacet extends AtomicCommerceNumericFacet_base implements InitializableComponent<CommerceBindings> {
|
|
28
31
|
/**
|
|
@@ -15,6 +15,7 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
15
15
|
* @part next-button-icon - The "next page" button icon.
|
|
16
16
|
*
|
|
17
17
|
* @event atomic/scrollToTop - Emitted when the user clicks the next or previous button, or a page button.
|
|
18
|
+
* @alpha
|
|
18
19
|
*/
|
|
19
20
|
export declare class AtomicCommercePager extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
20
21
|
bindings: CommerceBindings;
|
|
@@ -22,6 +22,8 @@ declare const AtomicCommerceProductList_base: typeof LitElement;
|
|
|
22
22
|
* @part result-table-cell - The td elements nested under each tbody > tr when the display prop is set to "table".
|
|
23
23
|
*
|
|
24
24
|
* @slot default - The default slot where the product templates are defined.
|
|
25
|
+
*
|
|
26
|
+
* @alpha
|
|
25
27
|
*/
|
|
26
28
|
export declare class AtomicCommerceProductList extends AtomicCommerceProductList_base implements InitializableComponent<CommerceBindings> {
|
|
27
29
|
static styles: CSSResultGroup;
|
|
@@ -9,6 +9,8 @@ import type { InitializableComponent } from "../../../decorators/types.js";
|
|
|
9
9
|
* @part buttons - The list of buttons.
|
|
10
10
|
* @part button - The individual products per page buttons.
|
|
11
11
|
* @part active-button - The active products per page button.
|
|
12
|
+
*
|
|
13
|
+
* @alpha
|
|
12
14
|
*/
|
|
13
15
|
export declare class AtomicCommerceProductsPerPage extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
14
16
|
bindings: CommerceBindings;
|
package/dist/types/components/commerce/atomic-commerce-query-error/atomic-commerce-query-error.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
12
12
|
* @part doc-link - A link to the relevant documentation.
|
|
13
13
|
* @part more-info-btn - A button to request additional error information.
|
|
14
14
|
* @part error-info - Additional error information.
|
|
15
|
+
*
|
|
16
|
+
* @alpha
|
|
15
17
|
*/
|
|
16
18
|
export declare class AtomicCommerceQueryError extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
17
19
|
bindings: CommerceBindings;
|
|
@@ -10,6 +10,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
10
10
|
* @part highlight - The summary highlights.
|
|
11
11
|
* @part query - The summary highlighted query.
|
|
12
12
|
* @part placeholder - The query summary placeholder used while the search interface is initializing.
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
13
15
|
*/
|
|
14
16
|
export declare class AtomicCommerceQuerySummary extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
15
17
|
bindings: CommerceBindings;
|
|
@@ -11,10 +11,8 @@ declare const AtomicCommerceRecommendationInterface_base: typeof LitElement;
|
|
|
11
11
|
/**
|
|
12
12
|
* The `atomic-commerce-recommendation-interface` component is meant to be used
|
|
13
13
|
* as the parent of one or more `atomic-commerce-recommendation-list`
|
|
14
|
-
* components. It handles the headless engine and localization
|
|
14
|
+
* components. It handles the headless search engine and localization
|
|
15
15
|
* configurations.
|
|
16
|
-
*
|
|
17
|
-
* @slot default - The default slot where you can add child components to the interface.
|
|
18
16
|
*/
|
|
19
17
|
export declare class AtomicCommerceRecommendationInterface extends AtomicCommerceRecommendationInterface_base implements BaseAtomicInterface<CommerceEngine> {
|
|
20
18
|
bindings: CommerceBindings;
|
|
@@ -7,6 +7,7 @@ import type { CommerceBindings } from '../atomic-commerce-recommendation-interfa
|
|
|
7
7
|
declare const AtomicCommerceRecommendationList_base: typeof LitElement;
|
|
8
8
|
/**
|
|
9
9
|
* The `atomic-commerce-recommendation-list` component displays a list of product recommendations by applying one or more product templates.
|
|
10
|
+
* @alpha
|
|
10
11
|
*
|
|
11
12
|
* @part result-list - The element containing the list of product recommendations.
|
|
12
13
|
* @part result-list-grid-clickable-container - The parent of a recommended product and the clickable link encompassing it.
|
|
@@ -9,6 +9,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
9
9
|
*
|
|
10
10
|
* @part button - The refine toggle button.
|
|
11
11
|
* @part placeholder - The placeholder shown while the first request is being executed.
|
|
12
|
+
*
|
|
13
|
+
* @alpha
|
|
12
14
|
*/
|
|
13
15
|
export declare class AtomicCommerceRefineToggle extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
14
16
|
bindings: CommerceBindings;
|
package/dist/types/components/commerce/atomic-commerce-search-box/atomic-commerce-search-box.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ import '../atomic-commerce-search-box-recent-queries/atomic-commerce-search-box-
|
|
|
49
49
|
* @part instant-results-show-all-button - The button inside the clickable suggestion from the `atomic-commerce-search-box-instant-products` component.
|
|
50
50
|
*
|
|
51
51
|
* @event redirect - Event that is emitted when a standalone search box redirection is triggered. By default, the search box will directly change the URL and redirect accordingly, so if you want to handle the redirection differently, use this event.
|
|
52
|
+
*
|
|
53
|
+
* @alpha
|
|
52
54
|
*/
|
|
53
55
|
export declare class AtomicCommerceSearchBox extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
54
56
|
static styles: CSSResultGroup;
|
|
@@ -7,7 +7,9 @@ import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
|
|
7
7
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
8
8
|
export type AriaLabelGenerator = (bindings: CommerceBindings, product: Product) => string | undefined;
|
|
9
9
|
/**
|
|
10
|
-
* The `atomic-commerce-search-box-instant-products` component can be added as a child of an `atomic-
|
|
10
|
+
* The `atomic-commerce-search-box-instant-products` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of instant products behavior.
|
|
11
|
+
*
|
|
12
|
+
* This component does not support accessibility out-of-the-box. To do so, see [Instant Results Accessibility](https://docs.coveo.com/en/atomic/latest/usage/accessibility/#instant-results-accessibility).
|
|
11
13
|
*
|
|
12
14
|
* This component is not supported on mobile.
|
|
13
15
|
*
|
|
@@ -15,6 +17,7 @@ export type AriaLabelGenerator = (bindings: CommerceBindings, product: Product)
|
|
|
15
17
|
* @part instant-results-item - The individual instant product item.
|
|
16
18
|
*
|
|
17
19
|
* @slot default - The default slot where the instant products are rendered.
|
|
20
|
+
* @alpha
|
|
18
21
|
*/
|
|
19
22
|
export declare class AtomicCommerceSearchBoxInstantProducts extends LitElement implements SearchBoxSuggestionsComponent<CommerceBindings> {
|
|
20
23
|
bindings: SearchBoxSuggestionsBindings<SearchBox, CommerceBindings>;
|
|
@@ -4,7 +4,8 @@ import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from "..
|
|
|
4
4
|
import type { SearchBoxSuggestionsComponent } from "../../../decorators/types";
|
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
6
6
|
/**
|
|
7
|
-
* The `atomic-commerce-search-box-query-suggestions` component can be added as a child of an `atomic-
|
|
7
|
+
* The `atomic-commerce-search-box-query-suggestions` component can be added as a child of an `atomic-search-box` component, allowing for the configuration of query suggestion behavior.
|
|
8
|
+
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export declare class AtomicCommerceSearchBoxQuerySuggestions extends LitElement implements SearchBoxSuggestionsComponent<CommerceBindings> {
|
|
10
11
|
bindings: SearchBoxSuggestionsBindings<SearchBox, CommerceBindings>;
|
|
@@ -5,6 +5,8 @@ import { type SearchBoxSuggestions, type SearchBoxSuggestionsBindings } from '..
|
|
|
5
5
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
6
6
|
/**
|
|
7
7
|
* The `atomic-commerce-search-box-recent-queries` component can be added as a child of an `atomic-commerce-search-box` component, allowing for the configuration of recent query suggestions.
|
|
8
|
+
*
|
|
9
|
+
* @alpha
|
|
8
10
|
*/
|
|
9
11
|
export declare class AtomicCommerceSearchBoxRecentQueries extends LitElement implements SearchBoxSuggestionsComponent<CommerceBindings> {
|
|
10
12
|
bindings: SearchBoxSuggestionsBindings<SearchBox, CommerceBindings>;
|
|
@@ -10,6 +10,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
10
10
|
* @part select - The `<select>` element of the dropdown list.
|
|
11
11
|
* @part select-separator - The element separating the select from the icon.
|
|
12
12
|
* @part placeholder - The dropdown placeholder for while the interface is initializing.
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
13
15
|
*/
|
|
14
16
|
export declare class AtomicCommerceSortDropdown extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
15
17
|
bindings: CommerceBindings;
|
|
@@ -22,6 +22,8 @@ declare const AtomicCommerceTimeframeFacet_base: typeof LitElement;
|
|
|
22
22
|
* @part input-start - The start date input field.
|
|
23
23
|
* @part input-end - The end date input field.
|
|
24
24
|
* @part input-apply-button - The button to apply date range selection.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
25
27
|
*/
|
|
26
28
|
export declare class AtomicCommerceTimeframeFacet extends AtomicCommerceTimeframeFacet_base implements InitializableComponent<CommerceBindings> {
|
|
27
29
|
static styles: CSSResultGroup;
|
|
@@ -6,6 +6,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
6
6
|
* The condition properties can be based on any top-level product property of the `product` object, not restricted to fields (e.g., `ec_name`).
|
|
7
7
|
*
|
|
8
8
|
* @slot default - The content to render if the conditions are met.
|
|
9
|
+
*
|
|
10
|
+
* @alpha
|
|
9
11
|
*/
|
|
10
12
|
export declare class AtomicProductFieldCondition extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
11
13
|
createRenderRoot(): this;
|
|
@@ -6,8 +6,7 @@ import '../atomic-product-text/atomic-product-text';
|
|
|
6
6
|
import { type LightDOMWithSlots } from "../../../mixins/slots-for-no-shadow-dom-mixin";
|
|
7
7
|
declare const AtomicProductLink_base: typeof LitElement & import("../../../mixins/mixin-common").Constructor<LightDOMWithSlots>;
|
|
8
8
|
/**
|
|
9
|
-
* The `atomic-product-link` component automatically transforms a product
|
|
10
|
-
*
|
|
9
|
+
* The `atomic-product-link` component automatically transforms a search product title into a clickable link that points to the original item.
|
|
11
10
|
* @slot default - The content to display inside the link.
|
|
12
11
|
* @slot attributes - Use `<a slot="attributes" target="_blank"></a>` to pass custom attributes to the generated link.
|
|
13
12
|
*/
|
|
@@ -3,6 +3,8 @@ import { LitElement, type TemplateResult } from 'lit';
|
|
|
3
3
|
import type { InitializableComponent } from "../../../decorators/types";
|
|
4
4
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface';
|
|
5
5
|
/**
|
|
6
|
+
* @alpha
|
|
7
|
+
*
|
|
6
8
|
* The `atomic-product-multi-value-text` component renders the values of a multi-value string field.
|
|
7
9
|
*
|
|
8
10
|
* @part product-multi-value-text-list - The list of field values.
|
|
@@ -5,6 +5,7 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
5
5
|
* The `atomic-product-numeric-field-value` component renders the value of a number product field.
|
|
6
6
|
*
|
|
7
7
|
* The number can be formatted by adding a `atomic-format-number`, `atomic-format-currency` or `atomic-format-unit` component into this component.
|
|
8
|
+
* @alpha
|
|
8
9
|
*/
|
|
9
10
|
export declare class AtomicProductNumericFieldValue extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
10
11
|
createRenderRoot(): this;
|
|
@@ -4,6 +4,7 @@ import type { InitializableComponent } from "../../../decorators/types.js";
|
|
|
4
4
|
import type { CommerceBindings } from '../atomic-commerce-interface/atomic-commerce-interface.js';
|
|
5
5
|
/**
|
|
6
6
|
* The `atomic-product-price` component renders the price of a product.
|
|
7
|
+
* @alpha
|
|
7
8
|
*/
|
|
8
9
|
export declare class AtomicProductPrice extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
9
10
|
static styles: import("lit").CSSResult;
|
|
@@ -10,6 +10,8 @@ import type { CommerceBindings } from '../atomic-commerce-interface/atomic-comme
|
|
|
10
10
|
* @cssprop --atomic-rating-icon-active-color - Color of the icon when active.
|
|
11
11
|
* @cssprop --atomic-rating-icon-inactive-color - Color of the icon when inactive.
|
|
12
12
|
* @cssprop --atomic-rating-icon-outline - Outline color of the icon.
|
|
13
|
+
*
|
|
14
|
+
* @alpha
|
|
13
15
|
*/
|
|
14
16
|
export declare class AtomicProductRating extends LitElement implements InitializableComponent<CommerceBindings> {
|
|
15
17
|
bindings: CommerceBindings;
|
|
@@ -24,6 +24,8 @@ import '../atomic-product-rating/atomic-product-rating';
|
|
|
24
24
|
* @MapProp name: mustNotMatch;attr: must-not-match;docs: The field and values that must not be matched by a product item for the template to apply. For example, a template with the following attribute only applies to product items whose `filetype` is not `lithiummessage`: `must-not-match-filetype="lithiummessage";type: Record<string, string[]> ;default: {}
|
|
25
25
|
* @slot default - The default slot where to insert the template element.
|
|
26
26
|
* @slot link - A `template` element that contains a single `atomic-product-link` component.
|
|
27
|
+
*
|
|
28
|
+
* @alpha
|
|
27
29
|
*/
|
|
28
30
|
export declare class AtomicProductTemplate extends LitElement implements LitElementWithError {
|
|
29
31
|
private productTemplateController;
|
|
@@ -81,9 +81,9 @@ export declare class AtomicInsightGeneratedAnswer implements InitializableCompon
|
|
|
81
81
|
fieldsToIncludeInCitations?: string;
|
|
82
82
|
/**
|
|
83
83
|
* Option to disable citation anchoring.
|
|
84
|
-
* @default false
|
|
84
|
+
* @default 'false'
|
|
85
85
|
*/
|
|
86
|
-
disableCitationAnchoring?:
|
|
86
|
+
disableCitationAnchoring?: string;
|
|
87
87
|
protected ariaMessage: string;
|
|
88
88
|
private generatedAnswerCommon;
|
|
89
89
|
private fullAnswerHeight?;
|
|
@@ -98,7 +98,7 @@ export declare class AtomicInsightGeneratedAnswer implements InitializableCompon
|
|
|
98
98
|
private adaptAnswerHeight;
|
|
99
99
|
private getAnswerContainer;
|
|
100
100
|
private getAnswerFooter;
|
|
101
|
-
|
|
101
|
+
getCitationFields(): string[];
|
|
102
102
|
private validateMaxCollapsedHeight;
|
|
103
103
|
private setCSSVariable;
|
|
104
104
|
private updateAnswerHeight;
|
|
@@ -81,9 +81,9 @@ export declare class AtomicGeneratedAnswer implements InitializableComponent {
|
|
|
81
81
|
fieldsToIncludeInCitations?: string;
|
|
82
82
|
/**
|
|
83
83
|
* Option to disable citation anchoring.
|
|
84
|
-
* @default false
|
|
84
|
+
* @default 'false'
|
|
85
85
|
*/
|
|
86
|
-
disableCitationAnchoring?:
|
|
86
|
+
disableCitationAnchoring?: string;
|
|
87
87
|
/**
|
|
88
88
|
* The tabs on which the generated answer can be displayed. This property should not be used at the same time as `tabs-excluded`.
|
|
89
89
|
*
|
|
@@ -118,7 +118,7 @@ export declare class AtomicGeneratedAnswer implements InitializableComponent {
|
|
|
118
118
|
private adaptAnswerHeight;
|
|
119
119
|
private getAnswerContainer;
|
|
120
120
|
private getAnswerFooter;
|
|
121
|
-
|
|
121
|
+
getCitationFields(): string[];
|
|
122
122
|
private validateMaxCollapsedHeight;
|
|
123
123
|
private setCSSVariable;
|
|
124
124
|
private updateAnswerHeight;
|
|
@@ -543,9 +543,9 @@ export namespace Components {
|
|
|
543
543
|
"collapsible"?: boolean;
|
|
544
544
|
/**
|
|
545
545
|
* Option to disable citation anchoring.
|
|
546
|
-
* @default false
|
|
546
|
+
* @default 'false'
|
|
547
547
|
*/
|
|
548
|
-
"disableCitationAnchoring"?:
|
|
548
|
+
"disableCitationAnchoring"?: string;
|
|
549
549
|
/**
|
|
550
550
|
* A list of fields to include with the citations used to generate the answer.
|
|
551
551
|
*/
|
|
@@ -692,9 +692,9 @@ export namespace Components {
|
|
|
692
692
|
"collapsible"?: boolean;
|
|
693
693
|
/**
|
|
694
694
|
* Option to disable citation anchoring.
|
|
695
|
-
* @default false
|
|
695
|
+
* @default 'false'
|
|
696
696
|
*/
|
|
697
|
-
"disableCitationAnchoring"?:
|
|
697
|
+
"disableCitationAnchoring"?: string;
|
|
698
698
|
/**
|
|
699
699
|
* A list of fields to include with the citations used to generate the answer.
|
|
700
700
|
*/
|
|
@@ -5215,9 +5215,9 @@ declare namespace LocalJSX {
|
|
|
5215
5215
|
"collapsible"?: boolean;
|
|
5216
5216
|
/**
|
|
5217
5217
|
* Option to disable citation anchoring.
|
|
5218
|
-
* @default false
|
|
5218
|
+
* @default 'false'
|
|
5219
5219
|
*/
|
|
5220
|
-
"disableCitationAnchoring"?:
|
|
5220
|
+
"disableCitationAnchoring"?: string;
|
|
5221
5221
|
/**
|
|
5222
5222
|
* A list of fields to include with the citations used to generate the answer.
|
|
5223
5223
|
*/
|
|
@@ -5360,9 +5360,9 @@ declare namespace LocalJSX {
|
|
|
5360
5360
|
"collapsible"?: boolean;
|
|
5361
5361
|
/**
|
|
5362
5362
|
* Option to disable citation anchoring.
|
|
5363
|
-
* @default false
|
|
5363
|
+
* @default 'false'
|
|
5364
5364
|
*/
|
|
5365
|
-
"disableCitationAnchoring"?:
|
|
5365
|
+
"disableCitationAnchoring"?: string;
|
|
5366
5366
|
/**
|
|
5367
5367
|
* A list of fields to include with the citations used to generate the answer.
|
|
5368
5368
|
*/
|
package/docs/atomic-docs.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2025-08-11T15:
|
|
2
|
+
"timestamp": "2025-08-11T15:54:01",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.20.0",
|
|
@@ -3646,10 +3646,10 @@
|
|
|
3646
3646
|
},
|
|
3647
3647
|
{
|
|
3648
3648
|
"name": "disableCitationAnchoring",
|
|
3649
|
-
"type": "
|
|
3649
|
+
"type": "string | undefined",
|
|
3650
3650
|
"complexType": {
|
|
3651
|
-
"original": "
|
|
3652
|
-
"resolved": "
|
|
3651
|
+
"original": "string",
|
|
3652
|
+
"resolved": "string | undefined",
|
|
3653
3653
|
"references": {}
|
|
3654
3654
|
},
|
|
3655
3655
|
"mutable": false,
|
|
@@ -3659,12 +3659,12 @@
|
|
|
3659
3659
|
"docsTags": [
|
|
3660
3660
|
{
|
|
3661
3661
|
"name": "default",
|
|
3662
|
-
"text": "false"
|
|
3662
|
+
"text": "'false'"
|
|
3663
3663
|
}
|
|
3664
3664
|
],
|
|
3665
3665
|
"values": [
|
|
3666
3666
|
{
|
|
3667
|
-
"type": "
|
|
3667
|
+
"type": "string"
|
|
3668
3668
|
},
|
|
3669
3669
|
{
|
|
3670
3670
|
"type": "undefined"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/atomic",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.32.3-pre.
|
|
4
|
+
"version": "3.32.3-pre.d8395b7e5a",
|
|
5
5
|
"description": "A web-component library for building modern UIs interfacing with the Coveo platform",
|
|
6
6
|
"homepage": "https://docs.coveo.com/en/atomic/latest/",
|
|
7
7
|
"repository": {
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{h as t}from"./p-dc3df5ce.js";import{S as e,a as n}from"./p-946fe85f.js";import{g as s}from"./p-634ca060.js";import{H as i}from"./p-66d48d1a.js";import{B as r}from"./p-28a6dd9b.js";import{D as o}from"./p-f284897c.js";import{c as a}from"./p-0462f723.js";import{A as c}from"./p-b700cfe1.js";import{A as l}from"./p-35fb03be.js";const h=e=>{const n={onClick:()=>e.onToggle?.(!e.checked),"arial-label":e.ariaLabel,"aria-checked":String(!!e.checked),part:e.part,tabIndex:e.tabIndex,title:e.title};const s=["w-12","h-6","p-1","rounded-full",e.checked?"bg-primary":"bg-neutral"].join(" ");const i=["w-4","h-4","rounded-full","bg-white",e.checked?"ml-6":""].join(" ");const r=["rounded-full","btn-outline-neutral",e.withToggle?"flex":"hidden"].join(" ");return t("button",{role:"switch",...n,class:r},t("div",{class:s},t("div",{class:i})))};const u=`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<rect x="1.5" y="1.50024" width="9" height="10" rx="1.5" stroke="currentColor"/>\n<path d="M3.5 8.50024H8.5" stroke="currentColor" stroke-linecap="round"/>\n<path d="M3.5 4.50024L8.5 4.50024" stroke="currentColor" stroke-linecap="round"/>\n<path d="M3.5 6.50024L8.5 6.50024" stroke="currentColor" stroke-linecap="round"/>\n<path d="M4.5 14.5002L11.5 14.5002C12.6046 14.5002 13.5 13.6048 13.5 12.5002L13.5 5.50024" stroke="currentColor" stroke-linecap="round"/>\n</svg>\n`;const f=e=>t(r,{title:e.title,part:"copy-button",style:"text-transparent",class:`rounded-md p-2 ${e.isCopied?"copied":""} ${e.error?"error":""}`,onClick:e.onClick},t("div",{class:"icon-container text-neutral-dark"},t("atomic-icon",{class:"w-5",icon:u})));const p=`<svg\n width="14"\n height="14"\n viewBox="0 0 14 14"\n fill="none"\n version="1.1"\n xmlns="http://www.w3.org/2000/svg"\n xmlns:svg="http://www.w3.org/2000/svg">\n <path\n class="line"\n d="m 11.00003,8.49978 h 0.5 c 0.55229,0 1,0.44771 1,1 v 0 c 0,0.55228 -0.44771,1 -1,1 L 10,10.49996 h 1 c 0.55228,0 0.99999,0.44771 1,1 v 0 c 0,0.55228 -0.44772,1 -1,1 H 9.5 l -3.52786,-6e-5 c -0.31049,0 -0.61672,-0.07229 -0.89443,-0.21115 L 3.5,11.4999 m 0,-6.5 c 0,-0.2761 -0.2239,-0.5 -0.5,-0.5 H 1 c -0.2761,0 -0.5,0.2239 -0.5,0.5 v 7 c 0,0.27614 0.2239,0.5 0.5,0.5 h 2 c 0.2761,0 0.5,-0.22386 0.5,-0.5 v -0.5 -6.5 h 0.9415 c 0.3471,10e-6 0.6694,-0.18 0.85145,-0.4755 L 6.48493,2.5895 C 6.49482,2.5735 6.50005,2.555 6.50005,2.5361 L 6.50004,1.477 C 6.50004,0.9374 6.93748,0.5 7.47709,0.5 v 0 c 0.32669,0 0.63296,0.165 0.81417,0.4368 v 0 C 8.7432,1.6147 8.91025,2.4487 8.75047,3.2476 L 8.5000098,4.498621 12.5,4.497321 c 0,0 1,-0.07687 1,0.9999998 0,0.983123 -1,1 -1,1 l -2.460584,0.00258 h 2 c 0.55228,0 1,0.44772 1,1 v 0 c 0,0.55228 -0.44772,1 -1,1 h -2"\n stroke="currentColor"\n stroke-linecap="round"\n stroke-linejoin="round"\n id="path1" />\n</svg>\n`;const d=e=>t(r,{title:e.title,style:"text-transparent",part:"feedback-button",class:`feedback-button rounded-md p-2 ${e.variant} ${e.active?"active":""}`,onClick:e.onClick,ariaPressed:`${e.active}`},t("atomic-icon",{class:"w-5",icon:p}));var g={exports:{}};(function(t,e){(function(t,n){n(e)})(a,(function(t){function e(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}t.defaults=e();function n(e){t.defaults=e}const s=/[&<>"']/;const i=new RegExp(s.source,"g");const r=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/;const o=new RegExp(r.source,"g");const a={"&":"&","<":"<",">":">",'"':""","'":"'"};const c=t=>a[t];function l(t,e){if(e){if(s.test(t)){return t.replace(i,c)}}else{if(r.test(t)){return t.replace(o,c)}}return t}const h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function u(t){return t.replace(h,((t,e)=>{e=e.toLowerCase();if(e==="colon")return":";if(e.charAt(0)==="#"){return e.charAt(1)==="x"?String.fromCharCode(parseInt(e.substring(2),16)):String.fromCharCode(+e.substring(1))}return""}))}const f=/(^|[^\[])\^/g;function p(t,e){let n=typeof t==="string"?t:t.source;e=e||"";const s={replace:(t,e)=>{let i=typeof e==="string"?e:e.source;i=i.replace(f,"$1");n=n.replace(t,i);return s},getRegex:()=>new RegExp(n,e)};return s}function d(t){try{t=encodeURI(t).replace(/%25/g,"%")}catch(t){return null}return t}const g={exec:()=>null};function w(t,e){const n=t.replace(/\|/g,((t,e,n)=>{let s=false;let i=e;while(--i>=0&&n[i]==="\\")s=!s;if(s){return"|"}else{return" |"}})),s=n.split(/ \|/);let i=0;if(!s[0].trim()){s.shift()}if(s.length>0&&!s[s.length-1].trim()){s.pop()}if(e){if(s.length>e){s.splice(e)}else{while(s.length<e)s.push("")}}for(;i<s.length;i++){s[i]=s[i].trim().replace(/\\\|/g,"|")}return s}function b(t,e,n){const s=t.length;if(s===0){return""}let i=0;while(i<s){const r=t.charAt(s-i-1);if(r===e&&!n){i++}else if(r!==e&&n){i++}else{break}}return t.slice(0,s-i)}function m(t,e){if(t.indexOf(e[1])===-1){return-1}let n=0;for(let s=0;s<t.length;s++){if(t[s]==="\\"){s++}else if(t[s]===e[0]){n++}else if(t[s]===e[1]){n--;if(n<0){return s}}}return-1}function k(t,e,n,s){const i=e.href;const r=e.title?l(e.title):null;const o=t[1].replace(/\\([\[\]])/g,"$1");if(t[0].charAt(0)!=="!"){s.state.inLink=true;const t={type:"link",raw:n,href:i,title:r,text:o,tokens:s.inlineTokens(o)};s.state.inLink=false;return t}return{type:"image",raw:n,href:i,title:r,text:l(o)}}function x(t,e){const n=t.match(/^(\s+)(?:```)/);if(n===null){return e}const s=n[1];return e.split("\n").map((t=>{const e=t.match(/^\s+/);if(e===null){return t}const[n]=e;if(n.length>=s.length){return t.slice(s.length)}return t})).join("\n")}class ${options;rules;lexer;constructor(e){this.options=e||t.defaults}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0){return{type:"space",raw:e[0]}}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:!this.options.pedantic?b(t,"\n"):t}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0];const n=x(t,e[3]||"");return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(/#$/.test(t)){const e=b(t,"#");if(this.options.pedantic){t=e.trim()}else if(!e||/ $/.test(e)){t=e.trim()}}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e){return{type:"hr",raw:e[0]}}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,"\n $1");t=b(t.replace(/^ *>[ \t]?/gm,""),"\n");const n=this.lexer.state.top;this.lexer.state.top=true;const s=this.lexer.blockTokens(t);this.lexer.state.top=n;return{type:"blockquote",raw:e[0],tokens:s,text:t}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const s=n.length>1;const i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:false,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`;if(this.options.pedantic){n=s?n:"[*+-]"}const r=new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`);let o="";let a="";let c=false;while(t){let n=false;if(!(e=r.exec(t))){break}if(this.rules.block.hr.test(t)){break}o=e[0];t=t.substring(o.length);let s=e[2].split("\n",1)[0].replace(/^\t+/,(t=>" ".repeat(3*t.length)));let l=t.split("\n",1)[0];let h=0;if(this.options.pedantic){h=2;a=s.trimStart()}else{h=e[2].search(/[^ ]/);h=h>4?1:h;a=s.slice(h);h+=e[1].length}let u=false;if(!s&&/^ *$/.test(l)){o+=l+"\n";t=t.substring(l.length+1);n=true}if(!n){const e=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`);const n=new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);const i=new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`);const r=new RegExp(`^ {0,${Math.min(3,h-1)}}#`);while(t){const c=t.split("\n",1)[0];l=c;if(this.options.pedantic){l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")}if(i.test(l)){break}if(r.test(l)){break}if(e.test(l)){break}if(n.test(t)){break}if(l.search(/[^ ]/)>=h||!l.trim()){a+="\n"+l.slice(h)}else{if(u){break}if(s.search(/[^ ]/)>=4){break}if(i.test(s)){break}if(r.test(s)){break}if(n.test(s)){break}a+="\n"+l}if(!u&&!l.trim()){u=true}o+=c+"\n";t=t.substring(c.length+1);s=l.slice(h)}}if(!i.loose){if(c){i.loose=true}else if(/\n *\n *$/.test(o)){c=true}}let f=null;let p;if(this.options.gfm){f=/^\[[ xX]\] /.exec(a);if(f){p=f[0]!=="[ ] ";a=a.replace(/^\[[ xX]\] +/,"")}}i.items.push({type:"list_item",raw:o,task:!!f,checked:p,loose:false,text:a,tokens:[]});i.raw+=o}i.items[i.items.length-1].raw=o.trimEnd();i.items[i.items.length-1].text=a.trimEnd();i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++){this.lexer.state.top=false;i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]);if(!i.loose){const e=i.items[t].tokens.filter((t=>t.type==="space"));const n=e.length>0&&e.some((t=>/\n.*\n/.test(t.raw)));i.loose=n}}if(i.loose){for(let t=0;t<i.items.length;t++){i.items[t].loose=true}}return i}}html(t){const e=this.rules.block.html.exec(t);if(e){const t={type:"html",block:true,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]};return t}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(/\s+/g," ");const n=e[2]?e[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"";const s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:s}}}table(t){const e=this.rules.block.table.exec(t);if(!e){return}if(!/[:|]/.test(e[2])){return}const n=w(e[1]);const s=e[2].replace(/^\||\| *$/g,"").split("|");const i=e[3]&&e[3].trim()?e[3].replace(/\n[ \t]*$/,"").split("\n"):[];const r={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length!==s.length){return}for(const t of s){if(/^ *-+: *$/.test(t)){r.align.push("right")}else if(/^ *:-+: *$/.test(t)){r.align.push("center")}else if(/^ *:-+ *$/.test(t)){r.align.push("left")}else{r.align.push(null)}}for(const t of n){r.header.push({text:t,tokens:this.lexer.inline(t)})}for(const t of i){r.rows.push(w(t,r.header.length).map((t=>({text:t,tokens:this.lexer.inline(t)}))))}return r}lheading(t){const e=this.rules.block.lheading.exec(t);if(e){return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t=e[1].charAt(e[1].length-1)==="\n"?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e){return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}}escape(t){const e=this.rules.inline.escape.exec(t);if(e){return{type:"escape",raw:e[0],text:l(e[1])}}}tag(t){const e=this.rules.inline.tag.exec(t);if(e){if(!this.lexer.state.inLink&&/^<a /i.test(e[0])){this.lexer.state.inLink=true}else if(this.lexer.state.inLink&&/^<\/a>/i.test(e[0])){this.lexer.state.inLink=false}if(!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=true}else if(this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0])){this.lexer.state.inRawBlock=false}return{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:e[0]}}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t)){return}const e=b(t.slice(0,-1),"\\");if((t.length-e.length)%2===0){return}}else{const t=m(e[2],"()");if(t>-1){const n=e[0].indexOf("!")===0?5:4;const s=n+e[1].length+t;e[2]=e[2].substring(0,t);e[0]=e[0].substring(0,s).trim();e[3]=""}}let n=e[2];let s="";if(this.options.pedantic){const t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);if(t){n=t[1];s=t[3]}}else{s=e[3]?e[3].slice(1,-1):""}n=n.trim();if(/^</.test(n)){if(this.options.pedantic&&!/>$/.test(t)){n=n.slice(1)}else{n=n.slice(1,-1)}}return k(e,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:s?s.replace(this.rules.inline.anyPunctuation,"$1"):s},e[0],this.lexer)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const t=(n[2]||n[1]).replace(/\s+/g," ");const s=e[t.toLowerCase()];if(!s){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return k(n,s,n[0],this.lexer)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;const i=s[1]||s[2]||"";if(!i||!n||this.rules.inline.punctuation.exec(n)){const n=[...s[0]].length-1;let i,r,o=n,a=0;const c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;c.lastIndex=0;e=e.slice(-1*t.length+n);while((s=c.exec(e))!=null){i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6];if(!i)continue;r=[...i].length;if(s[3]||s[4]){o+=r;continue}else if(s[5]||s[6]){if(n%3&&!((n+r)%3)){a+=r;continue}}o-=r;if(o>0)continue;r=Math.min(r,r+o+a);const e=[...s[0]][0].length;const c=t.slice(0,n+s.index+e+r);if(Math.min(n,r)%2){const t=c.slice(1,-1);return{type:"em",raw:c,text:t,tokens:this.lexer.inlineTokens(t)}}const l=c.slice(2,-2);return{type:"strong",raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(/\n/g," ");const n=/[^ ]/.test(t);const s=/^ /.test(t)&&/ $/.test(t);if(n&&s){t=t.substring(1,t.length-1)}t=l(t,true);return{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e){return{type:"br",raw:e[0]}}}del(t){const e=this.rules.inline.del.exec(t);if(e){return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,n;if(e[2]==="@"){t=l(e[1]);n="mailto:"+t}else{t=l(e[1]);n=t}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,n;if(e[2]==="@"){t=l(e[0]);n="mailto:"+t}else{let s;do{s=e[0];e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(s!==e[0]);t=l(e[0]);if(e[1]==="www."){n="http://"+e[0]}else{n=e[0]}}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){let t;if(this.lexer.state.inRawBlock){t=e[0]}else{t=l(e[0])}return{type:"text",raw:e[0],text:t}}}}const y=/^(?: *(?:\n|$))+/;const v=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/;const A=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/;const _=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/;const S=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/;const C=/(?:[*+-]|\d{1,9}[.)])/;const z=p(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,C).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex();const T=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/;const q=/^[^\n]+/;const E=/(?!\s*\])(?:\\.|[^\[\]\\])+/;const Z=p(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label",E).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex();const L=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C).getRegex();const R="address|article|aside|base|basefont|blockquote|body|caption"+"|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption"+"|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe"+"|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option"+"|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title"+"|tr|track|ul";const M=/<!--(?:-?>|[\s\S]*?(?:-->|$))/;const I=p("^ {0,3}(?:"+"<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)"+"|comment[^\\n]*(\\n+|$)"+"|<\\?[\\s\\S]*?(?:\\?>\\n*|$)"+"|<![A-Z][\\s\\S]*?(?:>\\n*|$)"+"|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)"+"|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+"|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)"+")","i").replace("comment",M).replace("tag",R).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();const j=p(T).replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",R).getRegex();const B=p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",j).getRegex();const G={blockquote:B,code:v,def:Z,fences:A,heading:S,hr:_,html:I,lheading:z,list:L,newline:y,paragraph:j,table:g,text:q};const D=p("^ *([^\\n ].*)\\n"+" {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)"+"(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",R).getRegex();const H={...G,table:D,paragraph:p(T).replace("hr",_).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",D).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",R).getRegex()};const P={...G,html:p("^ *(?:comment *(?:\\n|\\s*$)"+"|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)"+"|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M).replace(/tag/g,"(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub"+"|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)"+"\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:g,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(T).replace("hr",_).replace("heading"," *#{1,6} *[^\n]").replace("lheading",z).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()};const F=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/;const O=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/;const N=/^( {2,}|\\)\n(?!\s*$)/;const V=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/;const X="\\p{P}\\p{S}";const U=p(/^((?![*_])[\spunctuation])/,"u").replace(/punctuation/g,X).getRegex();const Q=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;const J=p(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,X).getRegex();const K=p("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)"+"|[^*]+(?=[^*])"+"|(?!\\*)[punct](\\*+)(?=[\\s]|$)"+"|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)"+"|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])"+"|[\\s](\\*+)(?!\\*)(?=[punct])"+"|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])"+"|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,X).getRegex();const W=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)"+"|[^_]+(?=[^_])"+"|(?!_)[punct](_+)(?=[\\s]|$)"+"|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)"+"|(?!_)[punct\\s](_+)(?=[^punct\\s])"+"|[\\s](_+)(?!_)(?=[punct])"+"|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,X).getRegex();const Y=p(/\\([punct])/,"gu").replace(/punct/g,X).getRegex();const tt=p(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex();const et=p(M).replace("(?:--\x3e|$)","--\x3e").getRegex();const nt=p("^comment"+"|^</[a-zA-Z][\\w:-]*\\s*>"+"|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>"+"|^<\\?[\\s\\S]*?\\?>"+"|^<![a-zA-Z]+\\s[\\s\\S]*?>"+"|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",et).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex();const st=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;const it=p(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",st).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex();const rt=p(/^!?\[(label)\]\[(ref)\]/).replace("label",st).replace("ref",E).getRegex();const ot=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",E).getRegex();const at=p("reflink|nolink(?!\\()","g").replace("reflink",rt).replace("nolink",ot).getRegex();const ct={_backpedal:g,anyPunctuation:Y,autolink:tt,blockSkip:Q,br:N,code:O,del:g,emStrongLDelim:J,emStrongRDelimAst:K,emStrongRDelimUnd:W,escape:F,link:it,nolink:ot,punctuation:U,reflink:rt,reflinkSearch:at,tag:nt,text:V,url:g};const lt={...ct,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",st).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",st).getRegex()};const ht={...ct,escape:p(F).replace("])","~|])").getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};const ut={...ht,br:p(N).replace("{2,}","*").getRegex(),text:p(ht.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};const ft={normal:G,gfm:H,pedantic:P};const pt={normal:ct,gfm:ht,breaks:ut,pedantic:lt};class dt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[];this.tokens.links=Object.create(null);this.options=e||t.defaults;this.options.tokenizer=this.options.tokenizer||new $;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;this.tokenizer.lexer=this;this.inlineQueue=[];this.state={inLink:false,inRawBlock:false,top:true};const n={block:ft.normal,inline:pt.normal};if(this.options.pedantic){n.block=ft.pedantic;n.inline=pt.pedantic}else if(this.options.gfm){n.block=ft.gfm;if(this.options.breaks){n.inline=pt.breaks}else{n.inline=pt.gfm}}this.tokenizer.rules=n}static get rules(){return{block:ft,inline:pt}}static lex(t,e){const n=new dt(e);return n.lex(t)}static lexInline(t,e){const n=new dt(e);return n.inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,"\n");this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}this.inlineQueue=[];return this.tokens}blockTokens(t,e=[]){if(this.options.pedantic){t=t.replace(/\t/g," ").replace(/^ +$/gm,"")}else{t=t.replace(/^( *)(\t+)/gm,((t,e,n)=>e+" ".repeat(n.length)))}let n;let s;let i;let r;while(t){if(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>{if(n=s.call({lexer:this},t,e)){t=t.substring(n.raw.length);e.push(n);return true}return false}))){continue}if(n=this.tokenizer.space(t)){t=t.substring(n.raw.length);if(n.raw.length===1&&e.length>0){e[e.length-1].raw+="\n"}else{e.push(n)}continue}if(n=this.tokenizer.code(t)){t=t.substring(n.raw.length);s=e[e.length-1];if(s&&(s.type==="paragraph"||s.type==="text")){s.raw+="\n"+n.raw;s.text+="\n"+n.text;this.inlineQueue[this.inlineQueue.length-1].src=s.text}else{e.push(n)}continue}if(n=this.tokenizer.fences(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.heading(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.hr(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.blockquote(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.list(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.html(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.def(t)){t=t.substring(n.raw.length);s=e[e.length-1];if(s&&(s.type==="paragraph"||s.type==="text")){s.raw+="\n"+n.raw;s.text+="\n"+n.raw;this.inlineQueue[this.inlineQueue.length-1].src=s.text}else if(!this.tokens.links[n.tag]){this.tokens.links[n.tag]={href:n.href,title:n.title}}continue}if(n=this.tokenizer.table(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.lheading(t)){t=t.substring(n.raw.length);e.push(n);continue}i=t;if(this.options.extensions&&this.options.extensions.startBlock){let e=Infinity;const n=t.slice(1);let s;this.options.extensions.startBlock.forEach((t=>{s=t.call({lexer:this},n);if(typeof s==="number"&&s>=0){e=Math.min(e,s)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(this.state.top&&(n=this.tokenizer.paragraph(i))){s=e[e.length-1];if(r&&s.type==="paragraph"){s.raw+="\n"+n.raw;s.text+="\n"+n.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=s.text}else{e.push(n)}r=i.length!==t.length;t=t.substring(n.raw.length);continue}if(n=this.tokenizer.text(t)){t=t.substring(n.raw.length);s=e[e.length-1];if(s&&s.type==="text"){s.raw+="\n"+n.raw;s.text+="\n"+n.text;this.inlineQueue.pop();this.inlineQueue[this.inlineQueue.length-1].src=s.text}else{e.push(n)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}this.state.top=true;return e}inline(t,e=[]){this.inlineQueue.push({src:t,tokens:e});return e}inlineTokens(t,e=[]){let n,s,i;let r=t;let o;let a,c;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0){while((o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null){if(t.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))){r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex)}}}}while((o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null){r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex)}while((o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null){r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex)}while(t){if(!a){c=""}a=false;if(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>{if(n=s.call({lexer:this},t,e)){t=t.substring(n.raw.length);e.push(n);return true}return false}))){continue}if(n=this.tokenizer.escape(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.tag(t)){t=t.substring(n.raw.length);s=e[e.length-1];if(s&&n.type==="text"&&s.type==="text"){s.raw+=n.raw;s.text+=n.text}else{e.push(n)}continue}if(n=this.tokenizer.link(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(n.raw.length);s=e[e.length-1];if(s&&n.type==="text"&&s.type==="text"){s.raw+=n.raw;s.text+=n.text}else{e.push(n)}continue}if(n=this.tokenizer.emStrong(t,r,c)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.codespan(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.br(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.del(t)){t=t.substring(n.raw.length);e.push(n);continue}if(n=this.tokenizer.autolink(t)){t=t.substring(n.raw.length);e.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(t))){t=t.substring(n.raw.length);e.push(n);continue}i=t;if(this.options.extensions&&this.options.extensions.startInline){let e=Infinity;const n=t.slice(1);let s;this.options.extensions.startInline.forEach((t=>{s=t.call({lexer:this},n);if(typeof s==="number"&&s>=0){e=Math.min(e,s)}}));if(e<Infinity&&e>=0){i=t.substring(0,e+1)}}if(n=this.tokenizer.inlineText(i)){t=t.substring(n.raw.length);if(n.raw.slice(-1)!=="_"){c=n.raw.slice(-1)}a=true;s=e[e.length-1];if(s&&s.type==="text"){s.raw+=n.raw;s.text+=n.text}else{e.push(n)}continue}if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}else{throw new Error(e)}}}return e}}class gt{options;constructor(e){this.options=e||t.defaults}code(t,e,n){const s=(e||"").match(/^\S*/)?.[0];t=t.replace(/\n$/,"")+"\n";if(!s){return"<pre><code>"+(n?t:l(t,true))+"</code></pre>\n"}return'<pre><code class="language-'+l(s)+'">'+(n?t:l(t,true))+"</code></pre>\n"}blockquote(t){return`<blockquote>\n${t}</blockquote>\n`}html(t,e){return t}heading(t,e,n){return`<h${e}>${t}</h${e}>\n`}hr(){return"<hr>\n"}list(t,e,n){const s=e?"ol":"ul";const i=e&&n!==1?' start="'+n+'"':"";return"<"+s+i+">\n"+t+"</"+s+">\n"}listitem(t,e,n){return`<li>${t}</li>\n`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>\n`}table(t,e){if(e)e=`<tbody>${e}</tbody>`;return"<table>\n"+"<thead>\n"+t+"</thead>\n"+e+"</table>\n"}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e){const n=e.header?"th":"td";const s=e.align?`<${n} align="${e.align}">`:`<${n}>`;return s+t+`</${n}>\n`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){const s=d(t);if(s===null){return n}t=s;let i='<a href="'+t+'"';if(e){i+=' title="'+e+'"'}i+=">"+n+"</a>";return i}image(t,e,n){const s=d(t);if(s===null){return n}t=s;let i=`<img src="${t}" alt="${n}"`;if(e){i+=` title="${e}"`}i+=">";return i}text(t){return t}}class wt{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,e,n){return""+n}image(t,e,n){return""+n}br(){return""}}class bt{options;renderer;textRenderer;constructor(e){this.options=e||t.defaults;this.options.renderer=this.options.renderer||new gt;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new wt}static parse(t,e){const n=new bt(e);return n.parse(t)}static parseInline(t,e){const n=new bt(e);return n.parseInline(t)}parse(t,e=true){let n="";for(let s=0;s<t.length;s++){const i=t[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=i;const e=this.options.extensions.renderers[t.type].call({parser:this},t);if(e!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){n+=e||"";continue}}switch(i.type){case"space":{continue}case"hr":{n+=this.renderer.hr();continue}case"heading":{const t=i;n+=this.renderer.heading(this.parseInline(t.tokens),t.depth,u(this.parseInline(t.tokens,this.textRenderer)));continue}case"code":{const t=i;n+=this.renderer.code(t.text,t.lang,!!t.escaped);continue}case"table":{const t=i;let e="";let s="";for(let e=0;e<t.header.length;e++){s+=this.renderer.tablecell(this.parseInline(t.header[e].tokens),{header:true,align:t.align[e]})}e+=this.renderer.tablerow(s);let r="";for(let e=0;e<t.rows.length;e++){const n=t.rows[e];s="";for(let e=0;e<n.length;e++){s+=this.renderer.tablecell(this.parseInline(n[e].tokens),{header:false,align:t.align[e]})}r+=this.renderer.tablerow(s)}n+=this.renderer.table(e,r);continue}case"blockquote":{const t=i;const e=this.parse(t.tokens);n+=this.renderer.blockquote(e);continue}case"list":{const t=i;const e=t.ordered;const s=t.start;const r=t.loose;let o="";for(let e=0;e<t.items.length;e++){const n=t.items[e];const s=n.checked;const i=n.task;let a="";if(n.task){const t=this.renderer.checkbox(!!s);if(r){if(n.tokens.length>0&&n.tokens[0].type==="paragraph"){n.tokens[0].text=t+" "+n.tokens[0].text;if(n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"){n.tokens[0].tokens[0].text=t+" "+n.tokens[0].tokens[0].text}}else{n.tokens.unshift({type:"text",text:t+" "})}}else{a+=t+" "}}a+=this.parse(n.tokens,r);o+=this.renderer.listitem(a,i,!!s)}n+=this.renderer.list(o,e,s);continue}case"html":{const t=i;n+=this.renderer.html(t.text,t.block);continue}case"paragraph":{const t=i;n+=this.renderer.paragraph(this.parseInline(t.tokens));continue}case"text":{let r=i;let o=r.tokens?this.parseInline(r.tokens):r.text;while(s+1<t.length&&t[s+1].type==="text"){r=t[++s];o+="\n"+(r.tokens?this.parseInline(r.tokens):r.text)}n+=e?this.renderer.paragraph(o):o;continue}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return n}parseInline(t,e){e=e||this.renderer;let n="";for(let s=0;s<t.length;s++){const i=t[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(t!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=t||"";continue}}switch(i.type){case"escape":{const t=i;n+=e.text(t.text);break}case"html":{const t=i;n+=e.html(t.text);break}case"link":{const t=i;n+=e.link(t.href,t.title,this.parseInline(t.tokens,e));break}case"image":{const t=i;n+=e.image(t.href,t.title,t.text);break}case"strong":{const t=i;n+=e.strong(this.parseInline(t.tokens,e));break}case"em":{const t=i;n+=e.em(this.parseInline(t.tokens,e));break}case"codespan":{const t=i;n+=e.codespan(t.text);break}case"br":{n+=e.br();break}case"del":{const t=i;n+=e.del(this.parseInline(t.tokens,e));break}case"text":{const t=i;n+=e.text(t.text);break}default:{const t='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(t);return""}else{throw new Error(t)}}}}return n}}class mt{options;constructor(e){this.options=e||t.defaults}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}}class kt{defaults=e();options=this.setOptions;parse=this.#t(dt.lex,bt.parse);parseInline=this.#t(dt.lexInline,bt.parseInline);Parser=bt;Renderer=gt;TextRenderer=wt;Lexer=dt;Tokenizer=$;Hooks=mt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const s of t){n=n.concat(e.call(this,s));switch(s.type){case"table":{const t=s;for(const s of t.header){n=n.concat(this.walkTokens(s.tokens,e))}for(const s of t.rows){for(const t of s){n=n.concat(this.walkTokens(t.tokens,e))}}break}case"list":{const t=s;n=n.concat(this.walkTokens(t.items,e));break}default:{const t=s;if(this.defaults.extensions?.childTokens?.[t.type]){this.defaults.extensions.childTokens[t.type].forEach((s=>{const i=t[s].flat(Infinity);n=n.concat(this.walkTokens(i,e))}))}else if(t.tokens){n=n.concat(this.walkTokens(t.tokens,e))}}}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};t.forEach((t=>{const n={...t};n.async=this.defaults.async||n.async||false;if(t.extensions){t.extensions.forEach((t=>{if(!t.name){throw new Error("extension name required")}if("renderer"in t){const n=e.renderers[t.name];if(n){e.renderers[t.name]=function(...e){let s=t.renderer.apply(this,e);if(s===false){s=n.apply(this,e)}return s}}else{e.renderers[t.name]=t.renderer}}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline"){throw new Error("extension level must be 'block' or 'inline'")}const n=e[t.level];if(n){n.unshift(t.tokenizer)}else{e[t.level]=[t.tokenizer]}if(t.start){if(t.level==="block"){if(e.startBlock){e.startBlock.push(t.start)}else{e.startBlock=[t.start]}}else if(t.level==="inline"){if(e.startInline){e.startInline.push(t.start)}else{e.startInline=[t.start]}}}}if("childTokens"in t&&t.childTokens){e.childTokens[t.name]=t.childTokens}}));n.extensions=e}if(t.renderer){const e=this.defaults.renderer||new gt(this.defaults);for(const n in t.renderer){if(!(n in e)){throw new Error(`renderer '${n}' does not exist`)}if(n==="options"){continue}const s=n;const i=t.renderer[s];const r=e[s];e[s]=(...t)=>{let n=i.apply(e,t);if(n===false){n=r.apply(e,t)}return n||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new $(this.defaults);for(const n in t.tokenizer){if(!(n in e)){throw new Error(`tokenizer '${n}' does not exist`)}if(["options","rules","lexer"].includes(n)){continue}const s=n;const i=t.tokenizer[s];const r=e[s];e[s]=(...t)=>{let n=i.apply(e,t);if(n===false){n=r.apply(e,t)}return n}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new mt;for(const n in t.hooks){if(!(n in e)){throw new Error(`hook '${n}' does not exist`)}if(n==="options"){continue}const s=n;const i=t.hooks[s];const r=e[s];if(mt.passThroughHooks.has(n)){e[s]=t=>{if(this.defaults.async){return Promise.resolve(i.call(e,t)).then((t=>r.call(e,t)))}const n=i.call(e,t);return r.call(e,n)}}else{e[s]=(...t)=>{let n=i.apply(e,t);if(n===false){n=r.apply(e,t)}return n}}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens;const s=t.walkTokens;n.walkTokens=function(t){let n=[];n.push(s.call(this,t));if(e){n=n.concat(e.call(this,t))}return n}}this.defaults={...this.defaults,...n}}));return this}setOptions(t){this.defaults={...this.defaults,...t};return this}lexer(t,e){return dt.lex(t,e??this.defaults)}parser(t,e){return bt.parse(t,e??this.defaults)}#t(t,e){return(n,s)=>{const i={...s};const r={...this.defaults,...i};if(this.defaults.async===true&&i.async===false){if(!r.silent){console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.")}r.async=true}const o=this.#e(!!r.silent,!!r.async);if(typeof n==="undefined"||n===null){return o(new Error("marked(): input parameter is undefined or null"))}if(typeof n!=="string"){return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"))}if(r.hooks){r.hooks.options=r}if(r.async){return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then((e=>t(e,r))).then((t=>r.hooks?r.hooks.processAllTokens(t):t)).then((t=>r.walkTokens?Promise.all(this.walkTokens(t,r.walkTokens)).then((()=>t)):t)).then((t=>e(t,r))).then((t=>r.hooks?r.hooks.postprocess(t):t)).catch(o)}try{if(r.hooks){n=r.hooks.preprocess(n)}let s=t(n,r);if(r.hooks){s=r.hooks.processAllTokens(s)}if(r.walkTokens){this.walkTokens(s,r.walkTokens)}let i=e(s,r);if(r.hooks){i=r.hooks.postprocess(i)}return i}catch(t){return o(t)}}}#e(t,e){return n=>{n.message+="\nPlease report this to https://github.com/markedjs/marked.";if(t){const t="<p>An error occurred:</p><pre>"+l(n.message+"",true)+"</pre>";if(e){return Promise.resolve(t)}return t}if(e){return Promise.reject(n)}throw n}}}const xt=new kt;function $t(t,e){return xt.parse(t,e)}$t.options=$t.setOptions=function(t){xt.setOptions(t);$t.defaults=xt.defaults;n($t.defaults);return $t};$t.getDefaults=e;$t.defaults=t.defaults;$t.use=function(...t){xt.use(...t);$t.defaults=xt.defaults;n($t.defaults);return $t};$t.walkTokens=function(t,e){return xt.walkTokens(t,e)};$t.parseInline=xt.parseInline;$t.Parser=bt;$t.parser=bt.parse;$t.Renderer=gt;$t.TextRenderer=wt;$t.Lexer=dt;$t.lexer=dt.lex;$t.Tokenizer=$;$t.Hooks=mt;$t.parse=$t;const yt=$t.options;const vt=$t.setOptions;const At=$t.use;const _t=$t.walkTokens;const St=$t.parseInline;const Ct=$t;const zt=bt.parse;const Tt=dt.lex;t.Hooks=mt;t.Lexer=dt;t.Marked=kt;t.Parser=bt;t.Renderer=gt;t.TextRenderer=wt;t.Tokenizer=$;t.getDefaults=e;t.lexer=Tt;t.marked=$t;t.options=yt;t.parse=Ct;t.parseInline=St;t.parser=zt;t.setOptions=vt;t.use=At;t.walkTokens=_t}))})(g,g.exports);const w=t=>{const e=t.replace(/<[^>]*>/g," ");const n=e.replace(/\s{2,}/g," ");return n.trim()};const b=/(\*{1,3}|`)($|\w[\w\s]*$)/;const m=t=>{const e=b.exec(t);if(e){const n=e[1];const s={"***":'<strong part="answer-strong"><em part="answer-emphasis">$2</em></strong>',"**":'<strong part="answer-strong">$2</strong>',"*":'<em part="answer-emphasis">$2</em>',"`":'<code part="answer-inline-code">$2</code>'};return t.replace(b,s[n])}return t};const k=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'");const x={blockquote(t){return`<blockquote part="answer-quote-block">${t}</blockquote>`},code(t){return`<pre part="answer-code-block"><code>${k(t)}</code></pre>`},codespan(t){return`<code part="answer-inline-code">${t}</code>`},em(t){return`<em part="answer-emphasis">${t}</em>`},heading(t,e){const n=w(t);return`<div part="answer-heading-${e}" aria-label="${n}">${t}</div>`},html(t){return k(t)},list(t,e,n){const s=e?"ol":"ul";const i=e?"answer-ordered-list":"answer-unordered-list";const r=e&&n!==1?`<${s} part="${i}" start="${n}">`:`<${s} part="${i}">`;return`${r}${t}</${s}>`},listitem(t){const e=t.replace(/^<p[^>]*>/,"").replace(/<\/p>\n?$/,"");const n=m(e);return`<li part="answer-list-item">${n}</li>`},paragraph(t){return`<p part="answer-paragraph">${t}</p>`},strong(t){return`<strong part="answer-strong">${t}</strong>`},table(t,e){return`<div part="answer-table-container" class="scrollable-table"><table part="answer-table"><thead>${t}</thead><tbody>${e}</tbody></table></div>`},tablecell(t,e){const n=e.header?"th":"td";const s=e.header?"answer-table-header":"answer-table-content";const i=e.align?`<${n} part="${s}" align="${e.align}">`:`<${n} part="${s}">`;return`${i}${t}</${n}>`},text(t){return m(t)}};const $=t=>g.exports.marked.use({renderer:x}).parse(t);const y=e=>{const n=o.sanitize($(e.answer??""),{ADD_ATTR:["part"]});return t("div",{part:"generated-text",class:`text-on-background mb-0 ${e.isStreaming?"cursor":""}`,innerHTML:n})};const v=e=>t("p",{part:"generated-text",class:`text-on-background mb-0 whitespace-pre-wrap ${e.isStreaming?"cursor":""}`},e.answer);const A=(e,n)=>t("div",{part:"generated-container",class:"mt-6"},e.answerContentFormat==="text/markdown"?t(y,{answer:e.answer,isStreaming:e.isStreaming}):t(v,{answer:e.answer,isStreaming:e.isStreaming}),t("div",{class:"footer mt-6"},n));const _=e=>t("div",{part:"retry-container",class:"mt-4"},t("div",{class:"text-neutral-dark mx-auto text-center"},e.message),t(r,{class:"mx-auto mt-4 block px-4 py-2",style:"outline-primary",onClick:e.onClick},e.buttonLabel));const S=e=>t(r,{style:"text-primary",part:"answer-show-button",class:"hidden items-center hover:bg-transparent",onClick:()=>e.onClick()},t("div",{class:"text-base font-light"},e.isCollapsed?e.i18n.t("show-more"):e.i18n.t("show-less")),t("atomic-icon",{part:"answer-show-icon",class:"ml-2 w-3.5",icon:e.isCollapsed?c:l}));const C=(e,n)=>e.isVisible?t("div",{class:"source-citations"},t("p",{part:"citations-label",class:"text-neutral-dark mb-2 shrink-0"},e.label),t("ol",{class:"citations-container flex list-none flex-wrap items-center gap-2"},n)):null;class z{constructor(t){this.props=t;this.storage=new e;this._data=this.readStoredData()}insertFeedbackModal(){this.modalRef=document.createElement("atomic-generated-answer-feedback-modal");this.modalRef.generatedAnswer=this.props.getGeneratedAnswer();this.props.host.insertAdjacentElement("beforebegin",this.modalRef)}readStoredData(){const{withToggle:t}=this.props;const e=this.storage.getParsedJSON(n.GENERATED_ANSWER_DATA,{isVisible:true});return{isVisible:t&&e.isVisible||!t}}writeStoredData(t){this.storage.setJSON(n.GENERATED_ANSWER_DATA,t)}get data(){return this._data}set data(t){this._data=t}getGeneratedAnswerStatus(){const t=!this.props.getGeneratedAnswerState()?.isVisible;const e=!!this.props.getGeneratedAnswerState()?.isStreaming;const n=!!this.props.getGeneratedAnswerState()?.answer;const s=!!this.props.getGeneratedAnswerState()?.error;if(t){return this.props.getBindings().i18n.t("generated-answer-hidden")}if(e){return this.props.getBindings().i18n.t("generating-answer")}if(s){return this.props.getBindings().i18n.t("answer-could-not-be-generated")}if(n){return this.props.getBindings().i18n.t("answer-generated",{answer:this.props.getGeneratedAnswerState()?.answer})}return""}get hasRetryableError(){return!this.props.getSearchStatusState()?.hasError&&this.props.getGeneratedAnswerState()?.error?.isRetryable}get hasNoAnswerGenerated(){const{answer:t,citations:e}=this.props.getGeneratedAnswerState()??{};return t===undefined&&!e?.length&&!this.hasRetryableError}get isAnswerVisible(){return this.props.getGeneratedAnswerState()?.isVisible}get toggleTooltip(){const t=this.isAnswerVisible?"generated-answer-toggle-on":"generated-answer-toggle-off";return this.props.getBindings().i18n.t(t)}get hasClipboard(){return!!navigator?.clipboard?.writeText}get copyToClipboardTooltip(){if(this.props.getCopyError()){return this.props.getBindings().i18n.t("failed-to-copy-generated-answer")}return!this.props.getCopied()?this.props.getBindings().i18n.t("copy-generated-answer"):this.props.getBindings().i18n.t("generated-answer-copied")}get hasCustomNoAnswerMessage(){const t=s(this.props.host,"no-answer-message");return!!t}async copyToClipboard(t){try{await navigator.clipboard.writeText(t);this.props.setCopied(true);this.props.getGeneratedAnswer()?.logCopyToClipboard()}catch(t){this.props.setCopyError(true);this.props.getBindings().engine.logger.error(`Failed to copy to clipboard: ${t}`)}setTimeout((()=>{this.props.setCopied(false);this.props.setCopyError(false)}),2e3)}clickOnShowButton(){if(this.props.getGeneratedAnswerState()?.expanded){this.props.getGeneratedAnswer()?.collapse()}else{this.props.getGeneratedAnswer()?.expand()}}getCitation(t){const{title:e}=t;const{i18n:n}=this.props.getBindings();return e.trim()!==""?t:{...t,title:n.t("no-title")}}renderCitations(){const{getGeneratedAnswerState:e,buildInteractiveCitation:n,getGeneratedAnswer:s,disableCitationAnchoring:i}=this.props;const{citations:r}=e()??{};const{logCitationHover:o}=s()??{};return r?.map(((e,s)=>{const r=n({options:{citation:e}});return t("li",{key:e.id,class:"max-w-full"},t("atomic-citation",{citation:this.getCitation(e),index:s,sendHoverEndEvent:t=>{o?.(e.id,t)},interactiveCitation:r,disableCitationAnchoring:i,exportparts:"citation,citation-popover"}))}))}renderFeedbackAndCopyButtons(){const{getGeneratedAnswerState:e,getBindings:n,getCopied:s,getCopyError:i}=this.props;const{i18n:r}=n();const{liked:o,disliked:a,answer:c,isStreaming:l}=e()??{};const h=["feedback-buttons","flex","h-9","absolute","top-6","shrink-0","gap-2",this.props.withToggle?"right-20":"right-6"].join(" ");if(l){return null}return t("div",{class:h},t(d,{title:r.t("this-answer-was-helpful"),variant:"like",active:!!o,onClick:()=>this.clickLike()}),t(d,{title:r.t("this-answer-was-not-helpful"),variant:"dislike",active:!!a,onClick:()=>this.clickDislike()}),this.hasClipboard?t(f,{title:this.copyToClipboardTooltip,isCopied:s(),error:i(),onClick:async()=>{if(c){await this.copyToClipboard(c)}}}):null)}setIsAnswerHelpful(t){if(this.modalRef){this.modalRef.helpful=t}}openFeedbackModal(){if(this.modalRef&&!this.props.getGeneratedAnswerState()?.feedbackSubmitted){this.modalRef.isOpen=true}}clickDislike(){this.setIsAnswerHelpful(false);this.props.getGeneratedAnswer()?.dislike();this.openFeedbackModal()}clickLike(){this.setIsAnswerHelpful(true);this.props.getGeneratedAnswer()?.like();this.openFeedbackModal()}renderDisclaimer(){const{getGeneratedAnswerState:e,getBindings:n}=this.props;const{i18n:s}=n();const{isStreaming:i}=e()??{};if(i){return null}return t("div",{class:"text-neutral-dark text-xs/[1rem]"},t("slot",{name:"disclaimer",slot:"disclaimer"},s.t("generated-answer-disclaimer")))}renderShowButton(){const{getGeneratedAnswerState:e,getBindings:n,collapsible:s}=this.props;const{i18n:i}=n();const{expanded:r,isStreaming:o}=e()??{};const a=s&&!o;if(!a){return null}return t(S,{i18n:i,onClick:()=>this.clickOnShowButton(),isCollapsed:!r})}renderGeneratingAnswerLabel(){const{getGeneratedAnswerState:e,getBindings:n,collapsible:s}=this.props;const{i18n:i}=n();const{isStreaming:r}=e()??{};const o=s&&r;if(!o){return null}return t("div",{part:"is-generating",class:"text-primary hidden text-base font-light"},i.t("generating-answer"),"...")}renderContent(){const{getGeneratedAnswerState:e,getBindings:n,getGeneratedAnswer:s}=this.props;const{i18n:r}=n();const{isStreaming:o,answer:a,citations:c,answerContentFormat:l}=e()??{};return t("div",{part:"generated-content"},t("div",{class:"flex items-center"},t(i,{level:0,part:"header-label",class:"text-primary bg-primary-background inline-block rounded-md px-2.5 py-2 font-medium"},r.t("generated-answer-title")),t("div",{class:"ml-auto flex h-9 items-center"},t(h,{part:"toggle",checked:this.isAnswerVisible,onToggle:t=>{t?s()?.show():s()?.hide()},ariaLabel:r.t("generated-answer-title"),title:this.toggleTooltip,withToggle:this.props.withToggle}))),this.hasRetryableError&&this.isAnswerVisible?t(_,{onClick:()=>s()?.retry(),buttonLabel:r.t("retry"),message:r.t("retry-stream-message")}):null,!this.hasRetryableError&&this.isAnswerVisible?t(A,{answer:a,answerContentFormat:l,isStreaming:!!o},this.renderFeedbackAndCopyButtons(),t(C,{label:r.t("citations"),isVisible:!!c?.length},this.renderCitations())):null,!this.hasRetryableError&&this.isAnswerVisible&&t("div",{part:"generated-answer-footer",class:"mt-6 flex justify-end"},this.renderGeneratingAnswerLabel(),this.renderShowButton(),this.renderDisclaimer()))}renderCustomNoAnswerMessage(){const{getBindings:e}=this.props;const{i18n:n}=e();return t("div",{part:"generated-content"},t("div",{class:"flex items-center"},t(i,{level:0,part:"header-label",class:"text-primary bg-primary-background inline-block rounded-md px-2.5 py-2 font-medium"},n.t("generated-answer-title"))),t("div",{part:"generated-container",class:"mt-6 break-words"},t("slot",{name:"no-answer-message"})))}render(){const{getGeneratedAnswerState:e}=this.props;const{cannotAnswer:n}=e()??{};const s="mx-auto mt-0 mb-4 border border-neutral shadow-lg p-6 bg-background rounded-lg p-6 text-on-background";if(this.hasNoAnswerGenerated){return n&&this.hasCustomNoAnswerMessage?t("div",null,t("aside",{class:s,part:"container"},t("article",null,this.renderCustomNoAnswerMessage()))):null}return t("div",null,t("aside",{class:s,part:"container"},t("article",null,this.renderContent())))}}export{z as G};
|
|
2
|
-
//# sourceMappingURL=p-2857ab2b.js.map
|