@repobit/dex-store-elements 1.6.1 → 1.7.1
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/CHANGELOG.md +15 -0
- package/README.md +7 -9
- package/dist/src/renders/attributes/buyLink.js +2 -1
- package/dist/src/renders/attributes/buyLink.js.map +1 -1
- package/dist/src/renders/attributes/index.js +1 -3
- package/dist/src/renders/attributes/index.js.map +1 -1
- package/dist/src/renders/observe.d.ts +2 -2
- package/dist/src/renders/observe.js +1 -2
- package/dist/src/renders/observe.js.map +1 -1
- package/package.json +3 -3
- package/dist/src/renders/attributes/trialLink.d.ts +0 -2
- package/dist/src/renders/attributes/trialLink.js +0 -14
- package/dist/src/renders/attributes/trialLink.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.7.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.7.0...@repobit/dex-store-elements@1.7.1) (2026-07-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @repobit/dex-store-elements
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.7.0](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.6.1...@repobit/dex-store-elements@1.7.0) (2026-07-22)
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **DEX-24668:** combined trial link and buy link logic
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
## [1.6.1](https://github.com/bitdefender/dex-core/compare/@repobit/dex-store-elements@1.6.0...@repobit/dex-store-elements@1.6.1) (2026-07-20)
|
|
7
22
|
|
|
8
23
|
**Note:** Version bump only for package @repobit/dex-store-elements
|
package/README.md
CHANGED
|
@@ -88,7 +88,7 @@ Peer dependencies are resolved automatically by npm; no extra install command is
|
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
**Store Config**
|
|
91
|
-
- `trialLinks` and `overrides` come from `@repobit/dex-store` and work transparently with these elements. You pass them when creating the `Store` and render
|
|
91
|
+
- `trialLinks` and `overrides` come from `@repobit/dex-store` and work transparently with these elements. You pass them when creating the `Store` and render trial links via `data-store-buy-link="30 days"` (trial duration as the attribute value) or rely on overridden option fields.
|
|
92
92
|
|
|
93
93
|
Example advanced config when constructing the store:
|
|
94
94
|
|
|
@@ -105,12 +105,12 @@ const store = new Store({
|
|
|
105
105
|
trialLinks: {
|
|
106
106
|
'com.bitdefender.tsmd.v2': {
|
|
107
107
|
default: {
|
|
108
|
-
'5-12' : 'https://trial.example.com/default/5-12',
|
|
109
|
-
'10-12': 'https://trial.example.com/default/10-12'
|
|
108
|
+
'5-12' : { '30 days': 'https://trial.example.com/default/5-12' },
|
|
109
|
+
'10-12': { '30 days': 'https://trial.example.com/default/10-12' }
|
|
110
110
|
},
|
|
111
111
|
PromoX: {
|
|
112
|
-
'5-12' : 'https://trial.example.com/promox/5-12',
|
|
113
|
-
'10-12': 'https://trial.example.com/promox/10-12'
|
|
112
|
+
'5-12' : { '30 days': 'https://trial.example.com/promox/5-12' },
|
|
113
|
+
'10-12': { '30 days': 'https://trial.example.com/promox/10-12' }
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
},
|
|
@@ -137,9 +137,8 @@ const store = new Store({
|
|
|
137
137
|
```
|
|
138
138
|
|
|
139
139
|
Notes
|
|
140
|
-
- `data-store-trial-link` uses `trialLinks` to set the anchor `href`. If no mapping exists, the attribute is left untouched.
|
|
141
140
|
- `overrides.options` merges into each option; you can update `buyLink`, `discountedPrice`, etc., or delete an entire variation with `null`.
|
|
142
|
-
- Keys are resolved against the product
|
|
141
|
+
- Keys are resolved against the product alias returned by the provider. If you don't use id mappings, it's the id you pass in `<bd-product product-id="...">`.
|
|
143
142
|
|
|
144
143
|
## Rendering model
|
|
145
144
|
- Add `data-store-render` to any element you want updated by the pipeline.
|
|
@@ -170,8 +169,7 @@ Notes
|
|
|
170
169
|
- `data-store-context-discount` tokens: `min-value`, `max-value`, `min-value-monthly`, `max-value-monthly`, `min-percentage`, `max-percentage`, `min-percentage-monthly`, `max-percentage-monthly`
|
|
171
170
|
|
|
172
171
|
- Links
|
|
173
|
-
- `data-store-buy-link` sets anchor `href` and useful `data-*` attributes
|
|
174
|
-
- `data-store-trial-link` sets anchor `href` to the trial link (if configured in `@repobit/dex-store` store config)
|
|
172
|
+
- `data-store-buy-link` sets anchor `href` and useful `data-*` attributes. Accepts an optional trial-duration value (e.g. `data-store-buy-link="30 days"`): when provided, the trial link for that duration is used if one is configured for the current variation, otherwise falls back to the regular buy link.
|
|
175
173
|
|
|
176
174
|
- Hide DSL
|
|
177
175
|
- `data-store-hide="<boolean expression>"` with an optional `data-store-hide-type="display|opacity|visibility"`
|
|
@@ -12,7 +12,8 @@ export const handleBuyLink = (el, ctx) => {
|
|
|
12
12
|
const product = option.getProduct();
|
|
13
13
|
const discountedPrice = option.getDiscountedPrice({ currency: false });
|
|
14
14
|
const fullPrice = option.getPrice({ currency: false });
|
|
15
|
-
|
|
15
|
+
const trialLink = storeBuyLink ? option.getTrialLink(storeBuyLink) : undefined;
|
|
16
|
+
link.href = trialLink ?? option.getBuyLink();
|
|
16
17
|
link.dataset.product = product.getAlias();
|
|
17
18
|
link.dataset.vlaicuProduct = product.getId();
|
|
18
19
|
link.dataset.buyPrice = discountedPrice ? String(discountedPrice) : String(fullPrice);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buyLink.js","sourceRoot":"","sources":["../../../../src/renders/attributes/buyLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAE,GAAmB,EAAE,EAAE;IACpE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;IACpC,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAEvD,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"buyLink.js","sourceRoot":"","sources":["../../../../src/renders/attributes/buyLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,EAAe,EAAE,GAAmB,EAAE,EAAE;IACpE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;IACpC,IAAI,YAAY,KAAK,SAAS;QAAE,OAAO;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,eAAe,GAAG,MAAM,CAAC,kBAAkB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IACvE,MAAM,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,CAAC;IAEvD,MAAM,SAAS,GAAG,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,IAAI,CAAC,IAAI,GAAG,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC1C,IAAI,CAAC,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAC7C,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAC,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtF,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1C,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,SAAS,GAAG,GAAG,MAAM,CAAC,UAAU,EAAE,KAAK,MAAM,CAAC,eAAe,EAAE,GAAG,CAAC;AAClF,CAAC,CAAC","sourcesContent":["import type { UnifiedContext } from '../context';\nimport { resolveAnchor } from './utilty';\n\nexport const handleBuyLink = (el: HTMLElement, ctx: UnifiedContext) => {\n const { storeBuyLink } = el.dataset;\n if (storeBuyLink === undefined) return;\n const option = ctx.option;\n if (!option) return;\n\n const link = resolveAnchor(el);\n if (!link) return;\n\n const product = option.getProduct();\n const discountedPrice = option.getDiscountedPrice({ currency: false });\n const fullPrice = option.getPrice({ currency: false });\n\n const trialLink = storeBuyLink ? option.getTrialLink(storeBuyLink) : undefined;\n link.href = trialLink ?? option.getBuyLink();\n link.dataset.product = product.getAlias();\n link.dataset.vlaicuProduct = product.getId();\n link.dataset.buyPrice = discountedPrice ? String(discountedPrice) : String(fullPrice);\n link.dataset.oldPrice = String(fullPrice);\n link.dataset.currency = product.getCurrency();\n link.dataset.variation = `${option.getDevices()}u-${option.getSubscription()}m`;\n};\n"]}
|
|
@@ -4,7 +4,6 @@ import { handleDiscount } from './discount.js';
|
|
|
4
4
|
import { handleHide } from './hide.js';
|
|
5
5
|
import { handlePrice } from './price.js';
|
|
6
6
|
import { handleSubscription } from './subscription.js';
|
|
7
|
-
import { handleTrialLink } from './trialLink.js';
|
|
8
7
|
// Dispatch known attribute handlers. Order matters for conflicts; keep hide last.
|
|
9
8
|
const handlers = [
|
|
10
9
|
handleDevices,
|
|
@@ -12,8 +11,7 @@ const handlers = [
|
|
|
12
11
|
handleBuyLink,
|
|
13
12
|
handlePrice,
|
|
14
13
|
handleDiscount,
|
|
15
|
-
handleHide
|
|
16
|
-
handleTrialLink
|
|
14
|
+
handleHide
|
|
17
15
|
// further handlers (devices, subscription, links) will be pushed here
|
|
18
16
|
];
|
|
19
17
|
export const renderAttributes = async (el, ctx) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/renders/attributes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/renders/attributes/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAIpD,kFAAkF;AAClF,MAAM,QAAQ,GAAuB;IACnC,aAAa;IACb,kBAAkB;IAClB,aAAa;IACb,WAAW;IACX,cAAc;IACd,UAAU;IACV,sEAAsE;CACvE,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,EAAE,EAAe,EAAE,GAAmB,EAAE,EAAE;IAC7E,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,MAAM,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACnB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { UnifiedContext } from '../context';\nimport { handleBuyLink } from './buyLink';\nimport { handleDevices } from './devices';\nimport { handleDiscount } from './discount';\nimport { handleHide } from './hide';\nimport { handlePrice } from './price';\nimport { handleSubscription } from './subscription';\n\nexport type AttributeHandler = (el: HTMLElement, ctx: UnifiedContext) => void | Promise<void>;\n\n// Dispatch known attribute handlers. Order matters for conflicts; keep hide last.\nconst handlers: AttributeHandler[] = [\n handleDevices,\n handleSubscription,\n handleBuyLink,\n handlePrice,\n handleDiscount,\n handleHide\n // further handlers (devices, subscription, links) will be pushed here\n];\n\nexport const renderAttributes = async (el: HTMLElement, ctx: UnifiedContext) => {\n for (const h of handlers) {\n await h(el, ctx);\n }\n};\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const OBS_ATTRS_COMMON: readonly ["data-store-hide", "data-store-hide-type"];
|
|
2
|
-
export declare const OBS_ATTRS_OPTION: readonly ["data-store-devices", "data-store-subscription", "data-store-text-single", "data-store-text-many", "data-store-subscription-type", "data-store-price", "data-store-discount", "data-store-buy-link"
|
|
2
|
+
export declare const OBS_ATTRS_OPTION: readonly ["data-store-devices", "data-store-subscription", "data-store-text-single", "data-store-text-many", "data-store-subscription-type", "data-store-price", "data-store-discount", "data-store-buy-link"];
|
|
3
3
|
export declare const OBS_ATTRS_STATE: readonly ["data-store-context-price", "data-store-context-discount"];
|
|
4
|
-
export declare const OBS_ATTRS_OPTION_PLUS_STATE: readonly ["data-store-devices", "data-store-subscription", "data-store-text-single", "data-store-text-many", "data-store-subscription-type", "data-store-price", "data-store-discount", "data-store-buy-link", "data-store-
|
|
4
|
+
export declare const OBS_ATTRS_OPTION_PLUS_STATE: readonly ["data-store-devices", "data-store-subscription", "data-store-text-single", "data-store-text-many", "data-store-subscription-type", "data-store-price", "data-store-discount", "data-store-buy-link", "data-store-context-price", "data-store-context-discount", "data-store-hide", "data-store-hide-type"];
|
|
@@ -13,8 +13,7 @@ export const OBS_ATTRS_OPTION = [
|
|
|
13
13
|
'data-store-subscription-type',
|
|
14
14
|
'data-store-price',
|
|
15
15
|
'data-store-discount',
|
|
16
|
-
'data-store-buy-link'
|
|
17
|
-
'data-store-trial-link'
|
|
16
|
+
'data-store-buy-link'
|
|
18
17
|
];
|
|
19
18
|
// Attributes affecting state-level rendering
|
|
20
19
|
export const OBS_ATTRS_STATE = [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../../../src/renders/observe.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,sBAAsB;CACd,CAAC;AAEX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,sBAAsB;IACtB,8BAA8B;IAC9B,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;
|
|
1
|
+
{"version":3,"file":"observe.js","sourceRoot":"","sources":["../../../src/renders/observe.ts"],"names":[],"mappings":"AAAA,sEAAsE;AAEtE,8BAA8B;AAC9B,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,iBAAiB;IACjB,sBAAsB;CACd,CAAC;AAEX,8CAA8C;AAC9C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,sBAAsB;IACtB,8BAA8B;IAC9B,kBAAkB;IAClB,qBAAqB;IACrB,qBAAqB;CACb,CAAC;AAEX,6CAA6C;AAC7C,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,0BAA0B;IAC1B,6BAA6B;CACrB,CAAC;AAEX,wFAAwF;AACxF,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,gBAAgB;IACnB,GAAG,eAAe;IAClB,GAAG,gBAAgB;CACX,CAAC","sourcesContent":["// Attributes that, when changed, should trigger a re-render of nodes.\n\n// Shared across both contexts\nexport const OBS_ATTRS_COMMON = [\n 'data-store-hide',\n 'data-store-hide-type'\n] as const;\n\n// Attributes affecting option-level rendering\nexport const OBS_ATTRS_OPTION = [\n 'data-store-devices',\n 'data-store-subscription',\n 'data-store-text-single',\n 'data-store-text-many',\n 'data-store-subscription-type',\n 'data-store-price',\n 'data-store-discount',\n 'data-store-buy-link'\n] as const;\n\n// Attributes affecting state-level rendering\nexport const OBS_ATTRS_STATE = [\n 'data-store-context-price',\n 'data-store-context-discount'\n] as const;\n\n// Combined set used when option-side also cares about state-driven attributes in markup\nexport const OBS_ATTRS_OPTION_PLUS_STATE = [\n ...OBS_ATTRS_OPTION,\n ...OBS_ATTRS_STATE,\n ...OBS_ATTRS_COMMON\n] as const;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repobit/dex-store-elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"description": "HTML elements layer for pricings",
|
|
5
5
|
"author": "Buga Adrian Alexandru <abuga@bitdefender.com>",
|
|
6
6
|
"homepage": "https://github.com/bitdefender/dex-core#readme",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"@lit/context": "^1.1.6",
|
|
54
54
|
"@lit/task": "^1.0.3",
|
|
55
|
-
"@repobit/dex-store": "1.
|
|
55
|
+
"@repobit/dex-store": "1.5.1",
|
|
56
56
|
"eta": "^4.5.1",
|
|
57
57
|
"nanomorph": "^5.4.3"
|
|
58
58
|
},
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "ea05d71f27bcdb434d61cdc575d72cea749f2b8e"
|
|
67
67
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { resolveAnchor } from './utilty.js';
|
|
2
|
-
export const handleTrialLink = (el, ctx) => {
|
|
3
|
-
const { storeTrialLink } = el.dataset;
|
|
4
|
-
if (storeTrialLink === undefined)
|
|
5
|
-
return;
|
|
6
|
-
const option = ctx.option;
|
|
7
|
-
if (!option)
|
|
8
|
-
return;
|
|
9
|
-
const link = resolveAnchor(el);
|
|
10
|
-
if (!link)
|
|
11
|
-
return;
|
|
12
|
-
link.href = option.getTrialLink(storeTrialLink) || '';
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=trialLink.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trialLink.js","sourceRoot":"","sources":["../../../../src/renders/attributes/trialLink.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAAe,EAAE,GAAmB,EAAE,EAAE;IACtE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC;IACtC,IAAI,cAAc,KAAK,SAAS;QAAE,OAAO;IACzC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;IAC1B,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,IAAI,GAAG,aAAa,CAAC,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,IAAI;QAAE,OAAO;IAElB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC,CAAC","sourcesContent":["import type { UnifiedContext } from '../context';\nimport { resolveAnchor } from './utilty';\n\nexport const handleTrialLink = (el: HTMLElement, ctx: UnifiedContext) => {\n const { storeTrialLink } = el.dataset;\n if (storeTrialLink === undefined) return;\n const option = ctx.option;\n if (!option) return;\n\n const link = resolveAnchor(el);\n if (!link) return;\n\n link.href = option.getTrialLink(storeTrialLink) || '';\n};\n"]}
|