@monetize.software/sdk-extension 3.0.0-alpha.8 → 3.0.0-alpha.9
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/chunks/{ar-nh4l4WDE.js → ar-CHae8g-2.js} +4 -3
- package/dist/chunks/ar-CHae8g-2.js.map +1 -0
- package/dist/chunks/ar-E1mc8SO_.js +2 -0
- package/dist/chunks/ar-E1mc8SO_.js.map +1 -0
- package/dist/chunks/{chrome-port-PhlW29BV.js → chrome-port-BzNV1ahF.js} +2 -2
- package/dist/chunks/{chrome-port-PhlW29BV.js.map → chrome-port-BzNV1ahF.js.map} +1 -1
- package/dist/chunks/{chrome-port-CxW3Pwc2.js → chrome-port-rVd4zwU3.js} +21 -21
- package/dist/chunks/{chrome-port-CxW3Pwc2.js.map → chrome-port-rVd4zwU3.js.map} +1 -1
- package/dist/chunks/cs-Dccq6LAT.js +2 -0
- package/dist/chunks/cs-Dccq6LAT.js.map +1 -0
- package/dist/chunks/{cs-2UYO2rWf.js → cs-eZTedzaK.js} +2 -1
- package/dist/chunks/cs-eZTedzaK.js.map +1 -0
- package/dist/chunks/da-C_4MbEh5.js +2 -0
- package/dist/chunks/da-C_4MbEh5.js.map +1 -0
- package/dist/chunks/{da-BD0O_HfV.js → da-Dca6j8fp.js} +2 -1
- package/dist/chunks/da-Dca6j8fp.js.map +1 -0
- package/dist/chunks/{de-BkCiXPsn.js → de-BCjn3PUI.js} +3 -1
- package/dist/chunks/de-BCjn3PUI.js.map +1 -0
- package/dist/chunks/de-DulxcJj-.js +2 -0
- package/dist/chunks/de-DulxcJj-.js.map +1 -0
- package/dist/chunks/{el-cIcxTp07.js → el-BpXtDTez.js} +2 -1
- package/dist/chunks/el-BpXtDTez.js.map +1 -0
- package/dist/chunks/el-CVG_1iKB.js +2 -0
- package/dist/chunks/el-CVG_1iKB.js.map +1 -0
- package/dist/chunks/{es-CJBC_jrV.js → es-B3P4nlMw.js} +3 -1
- package/dist/chunks/es-B3P4nlMw.js.map +1 -0
- package/dist/chunks/es-ri0uKzUW.js +2 -0
- package/dist/chunks/es-ri0uKzUW.js.map +1 -0
- package/dist/chunks/{fi-DyV7ynBf.js → fi-BbQ_Bs0Z.js} +2 -1
- package/dist/chunks/fi-BbQ_Bs0Z.js.map +1 -0
- package/dist/chunks/fi-CNZqWHjw.js +2 -0
- package/dist/chunks/fi-CNZqWHjw.js.map +1 -0
- package/dist/chunks/{fr-BLQ4AIu7.js → fr-BKDUXceO.js} +3 -1
- package/dist/chunks/fr-BKDUXceO.js.map +1 -0
- package/dist/chunks/fr-CfFOw4hD.js +2 -0
- package/dist/chunks/fr-CfFOw4hD.js.map +1 -0
- package/dist/chunks/{he-Bg-Bqi7r.js → he-BVCHlTtT.js} +2 -1
- package/dist/chunks/he-BVCHlTtT.js.map +1 -0
- package/dist/chunks/he-DN2JEtQb.js +2 -0
- package/dist/chunks/he-DN2JEtQb.js.map +1 -0
- package/dist/chunks/hi-DxfOerNP.js +2 -0
- package/dist/chunks/hi-DxfOerNP.js.map +1 -0
- package/dist/chunks/{hi-wQeE43oY.js → hi-H_Hshh-7.js} +4 -3
- package/dist/chunks/hi-H_Hshh-7.js.map +1 -0
- package/dist/chunks/hu-BTImywuV.js +2 -0
- package/dist/chunks/{hu-DXtscQ8_.js.map → hu-BTImywuV.js.map} +1 -1
- package/dist/chunks/{hu-D9qxzu0r.js → hu-ZWiNfzvN.js} +2 -1
- package/dist/chunks/{hu-D9qxzu0r.js.map → hu-ZWiNfzvN.js.map} +1 -1
- package/dist/chunks/{id-Rx_wYvqy.js → id-DeiRYsJ1.js} +2 -1
- package/dist/chunks/id-DeiRYsJ1.js.map +1 -0
- package/dist/chunks/id-YFuArJA6.js +2 -0
- package/dist/chunks/id-YFuArJA6.js.map +1 -0
- package/dist/chunks/{it-B1SRPZ3e.js → it-UH9OzFhg.js} +3 -1
- package/dist/chunks/it-UH9OzFhg.js.map +1 -0
- package/dist/chunks/it-mhkzXBM9.js +2 -0
- package/dist/chunks/it-mhkzXBM9.js.map +1 -0
- package/dist/chunks/{ja-CMC3Parn.js → ja-6l_z_G9k.js} +2 -2
- package/dist/chunks/ja-6l_z_G9k.js.map +1 -0
- package/dist/chunks/{ja-DiItm8te.js → ja-BYC8FRN8.js} +3 -1
- package/dist/chunks/ja-BYC8FRN8.js.map +1 -0
- package/dist/chunks/{ko-CdGFWAKX.js → ko-Bjs2ZRcF.js} +3 -1
- package/dist/chunks/ko-Bjs2ZRcF.js.map +1 -0
- package/dist/chunks/ko-YAl4XwHu.js +2 -0
- package/dist/chunks/ko-YAl4XwHu.js.map +1 -0
- package/dist/chunks/nl-C-9zHtfb.js +2 -0
- package/dist/chunks/nl-C-9zHtfb.js.map +1 -0
- package/dist/chunks/{nl-CmZ3vEvj.js → nl-Ch5HFWQO.js} +3 -1
- package/dist/chunks/nl-Ch5HFWQO.js.map +1 -0
- package/dist/chunks/{no-BuxByZpq.js → no-CljpinWz.js} +2 -1
- package/dist/chunks/no-CljpinWz.js.map +1 -0
- package/dist/chunks/no-qzPitLlx.js +2 -0
- package/dist/chunks/no-qzPitLlx.js.map +1 -0
- package/dist/chunks/{pl-jZFCnDb8.js → pl-CUcSS0zZ.js} +2 -1
- package/dist/chunks/pl-CUcSS0zZ.js.map +1 -0
- package/dist/chunks/pl-MAIYeuhW.js +2 -0
- package/dist/chunks/pl-MAIYeuhW.js.map +1 -0
- package/dist/chunks/{pt-Cld7MwIW.js → pt-BHK0LwkC.js} +3 -1
- package/dist/chunks/pt-BHK0LwkC.js.map +1 -0
- package/dist/chunks/pt-DqDabE4v.js +2 -0
- package/dist/chunks/pt-DqDabE4v.js.map +1 -0
- package/dist/chunks/ro-BVs-lHH-.js +2 -0
- package/dist/chunks/ro-BVs-lHH-.js.map +1 -0
- package/dist/chunks/{ro-CuKDqj3C.js → ro-Bj8cwU2n.js} +2 -1
- package/dist/chunks/ro-Bj8cwU2n.js.map +1 -0
- package/dist/chunks/{ru-B7cjqJUm.js → ru-CgqNy0Gb.js} +10 -1
- package/dist/chunks/ru-CgqNy0Gb.js.map +1 -0
- package/dist/chunks/ru-DP7qDAmE.js +2 -0
- package/dist/chunks/ru-DP7qDAmE.js.map +1 -0
- package/dist/chunks/sv-B3QEYGgd.js +2 -0
- package/dist/chunks/sv-B3QEYGgd.js.map +1 -0
- package/dist/chunks/{sv-D9y-M1Fo.js → sv-H7jroOQ5.js} +2 -1
- package/dist/chunks/sv-H7jroOQ5.js.map +1 -0
- package/dist/chunks/{th-D9umBjEy.js → th-Dqm-gpGe.js} +2 -1
- package/dist/chunks/th-Dqm-gpGe.js.map +1 -0
- package/dist/chunks/th-DzQau9aW.js +2 -0
- package/dist/chunks/th-DzQau9aW.js.map +1 -0
- package/dist/chunks/{tr-BddMywiw.js → tr-D3zPcNtT.js} +2 -1
- package/dist/chunks/tr-D3zPcNtT.js.map +1 -0
- package/dist/chunks/tr-cG1YuE1E.js +2 -0
- package/dist/chunks/tr-cG1YuE1E.js.map +1 -0
- package/dist/chunks/{uk-Dbd31hFt.js → uk-CoIIs3QI.js} +10 -1
- package/dist/chunks/uk-CoIIs3QI.js.map +1 -0
- package/dist/chunks/uk-Cvbo0IBW.js +2 -0
- package/dist/chunks/uk-Cvbo0IBW.js.map +1 -0
- package/dist/chunks/vi-BRtYSBUp.js +2 -0
- package/dist/chunks/{vi-CJefLP_g.js.map → vi-BRtYSBUp.js.map} +1 -1
- package/dist/chunks/{vi-Do3BMOdh.js → vi-C_fruIbh.js} +2 -1
- package/dist/chunks/{vi-Do3BMOdh.js.map → vi-C_fruIbh.js.map} +1 -1
- package/dist/chunks/zh-CwczPMPp.js +2 -0
- package/dist/chunks/zh-CwczPMPp.js.map +1 -0
- package/dist/chunks/{zh-gQSYLZI3.js → zh-LDkEV2D9.js} +3 -1
- package/dist/chunks/zh-LDkEV2D9.js.map +1 -0
- package/dist/content.cjs +3 -3
- package/dist/content.cjs.map +1 -1
- package/dist/content.js +777 -813
- package/dist/content.js.map +1 -1
- package/dist/offscreen.cjs +1 -1
- package/dist/offscreen.js +1 -1
- package/package.json +3 -3
- package/dist/chunks/ar-BUQInJ5a.js +0 -2
- package/dist/chunks/ar-BUQInJ5a.js.map +0 -1
- package/dist/chunks/ar-nh4l4WDE.js.map +0 -1
- package/dist/chunks/cs-2UYO2rWf.js.map +0 -1
- package/dist/chunks/cs-i5K4KTFV.js +0 -2
- package/dist/chunks/cs-i5K4KTFV.js.map +0 -1
- package/dist/chunks/da-BD0O_HfV.js.map +0 -1
- package/dist/chunks/da-CZbhtVJO.js +0 -2
- package/dist/chunks/da-CZbhtVJO.js.map +0 -1
- package/dist/chunks/de-Bc-GoLgC.js +0 -2
- package/dist/chunks/de-Bc-GoLgC.js.map +0 -1
- package/dist/chunks/de-BkCiXPsn.js.map +0 -1
- package/dist/chunks/el-CcMEbl_F.js +0 -2
- package/dist/chunks/el-CcMEbl_F.js.map +0 -1
- package/dist/chunks/el-cIcxTp07.js.map +0 -1
- package/dist/chunks/es-BvYmomAz.js +0 -2
- package/dist/chunks/es-BvYmomAz.js.map +0 -1
- package/dist/chunks/es-CJBC_jrV.js.map +0 -1
- package/dist/chunks/fi-DyV7ynBf.js.map +0 -1
- package/dist/chunks/fi-aZR-qmZN.js +0 -2
- package/dist/chunks/fi-aZR-qmZN.js.map +0 -1
- package/dist/chunks/fr-BLQ4AIu7.js.map +0 -1
- package/dist/chunks/fr-BgbFAgHx.js +0 -2
- package/dist/chunks/fr-BgbFAgHx.js.map +0 -1
- package/dist/chunks/he-Bg-Bqi7r.js.map +0 -1
- package/dist/chunks/he-CQ4yCuja.js +0 -2
- package/dist/chunks/he-CQ4yCuja.js.map +0 -1
- package/dist/chunks/hi-DtUsj1c-.js +0 -2
- package/dist/chunks/hi-DtUsj1c-.js.map +0 -1
- package/dist/chunks/hi-wQeE43oY.js.map +0 -1
- package/dist/chunks/hu-DXtscQ8_.js +0 -2
- package/dist/chunks/id-BByOYpeo.js +0 -2
- package/dist/chunks/id-BByOYpeo.js.map +0 -1
- package/dist/chunks/id-Rx_wYvqy.js.map +0 -1
- package/dist/chunks/it-52Ip42pa.js +0 -2
- package/dist/chunks/it-52Ip42pa.js.map +0 -1
- package/dist/chunks/it-B1SRPZ3e.js.map +0 -1
- package/dist/chunks/ja-CMC3Parn.js.map +0 -1
- package/dist/chunks/ja-DiItm8te.js.map +0 -1
- package/dist/chunks/ko-3qY21q40.js +0 -2
- package/dist/chunks/ko-3qY21q40.js.map +0 -1
- package/dist/chunks/ko-CdGFWAKX.js.map +0 -1
- package/dist/chunks/nl-Borc5nw1.js +0 -2
- package/dist/chunks/nl-Borc5nw1.js.map +0 -1
- package/dist/chunks/nl-CmZ3vEvj.js.map +0 -1
- package/dist/chunks/no-BuxByZpq.js.map +0 -1
- package/dist/chunks/no-Do2iGedg.js +0 -2
- package/dist/chunks/no-Do2iGedg.js.map +0 -1
- package/dist/chunks/pl-jZFCnDb8.js.map +0 -1
- package/dist/chunks/pl-mRaky_7k.js +0 -2
- package/dist/chunks/pl-mRaky_7k.js.map +0 -1
- package/dist/chunks/pt-Cld7MwIW.js.map +0 -1
- package/dist/chunks/pt-DilDTXfs.js +0 -2
- package/dist/chunks/pt-DilDTXfs.js.map +0 -1
- package/dist/chunks/ro-CuKDqj3C.js.map +0 -1
- package/dist/chunks/ro-DF2uzPIB.js +0 -2
- package/dist/chunks/ro-DF2uzPIB.js.map +0 -1
- package/dist/chunks/ru-B7cjqJUm.js.map +0 -1
- package/dist/chunks/ru-YeaXnTO-.js +0 -2
- package/dist/chunks/ru-YeaXnTO-.js.map +0 -1
- package/dist/chunks/sv-2pHEvuSe.js +0 -2
- package/dist/chunks/sv-2pHEvuSe.js.map +0 -1
- package/dist/chunks/sv-D9y-M1Fo.js.map +0 -1
- package/dist/chunks/th-D9umBjEy.js.map +0 -1
- package/dist/chunks/th-u2QSDF0G.js +0 -2
- package/dist/chunks/th-u2QSDF0G.js.map +0 -1
- package/dist/chunks/tr-BddMywiw.js.map +0 -1
- package/dist/chunks/tr-Bhgm6_ti.js +0 -2
- package/dist/chunks/tr-Bhgm6_ti.js.map +0 -1
- package/dist/chunks/uk-7vwqsaVK.js +0 -2
- package/dist/chunks/uk-7vwqsaVK.js.map +0 -1
- package/dist/chunks/uk-Dbd31hFt.js.map +0 -1
- package/dist/chunks/vi-CJefLP_g.js +0 -2
- package/dist/chunks/zh-D5C3BzYL.js +0 -2
- package/dist/chunks/zh-D5C3BzYL.js.map +0 -1
- package/dist/chunks/zh-gQSYLZI3.js.map +0 -1
|
@@ -157,7 +157,7 @@ function D() {
|
|
|
157
157
|
const e = Array.from(t, (s) => s.toString(16).padStart(2, "0")).join("");
|
|
158
158
|
return `${e.slice(0, 8)}-${e.slice(8, 12)}-${e.slice(12, 16)}-${e.slice(16, 20)}-${e.slice(20)}`;
|
|
159
159
|
}
|
|
160
|
-
async function
|
|
160
|
+
async function B(i) {
|
|
161
161
|
try {
|
|
162
162
|
const e = await i.getItem(u.visitorId);
|
|
163
163
|
if (e && typeof e == "string" && e.length >= 16) return e;
|
|
@@ -178,23 +178,23 @@ function M(i) {
|
|
|
178
178
|
for (let s = 0; s < i; s++) t[s] = Math.floor(Math.random() * 256);
|
|
179
179
|
return t;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function _(i) {
|
|
182
182
|
let t = "";
|
|
183
183
|
for (let e = 0; e < i.length; e++) t += String.fromCharCode(i[e]);
|
|
184
184
|
return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
185
185
|
}
|
|
186
186
|
function j() {
|
|
187
|
-
return
|
|
187
|
+
return _(M(64));
|
|
188
188
|
}
|
|
189
189
|
async function G(i) {
|
|
190
190
|
const t = new TextEncoder().encode(i), e = globalThis.crypto;
|
|
191
191
|
if (!e?.subtle?.digest)
|
|
192
192
|
throw new Error("crypto.subtle is required for PKCE");
|
|
193
193
|
const s = await e.subtle.digest("SHA-256", t);
|
|
194
|
-
return
|
|
194
|
+
return _(new Uint8Array(s));
|
|
195
195
|
}
|
|
196
196
|
function X() {
|
|
197
|
-
return
|
|
197
|
+
return _(M(16));
|
|
198
198
|
}
|
|
199
199
|
const z = 6e4, Q = 600 * 1e3;
|
|
200
200
|
class mt {
|
|
@@ -1095,7 +1095,7 @@ async function at(i) {
|
|
|
1095
1095
|
return null;
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
|
-
const nt = 5e3, rt = 30 * 6e4,
|
|
1098
|
+
const nt = 5e3, rt = 30 * 6e4, k = 60 * 6e4, ot = 5 * 6e4, I = {
|
|
1099
1099
|
has_active_subscription: !1,
|
|
1100
1100
|
purchases: [],
|
|
1101
1101
|
trial: null,
|
|
@@ -1140,7 +1140,7 @@ class St {
|
|
|
1140
1140
|
}), t.auth && (this.authUnsubscribe = t.auth.onAuthChange((s, a) => {
|
|
1141
1141
|
const n = a ? O(a.user) : void 0;
|
|
1142
1142
|
dt(this.identity, n) || this.setIdentity(n);
|
|
1143
|
-
})), this.hydrateUserFromStorage(), this.hydrateBootstrapFromStorage(), this.subscribeBootstrapStorage(), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.visitorIdPromise =
|
|
1143
|
+
})), this.hydrateUserFromStorage(), this.hydrateBootstrapFromStorage(), this.subscribeBootstrapStorage(), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.visitorIdPromise = B(this.storage).then((s) => (this.visitorId = s, s));
|
|
1144
1144
|
}
|
|
1145
1145
|
/**
|
|
1146
1146
|
* Stable visitor_id (UUID v4). Первый вызов awaitит первичный резолв из
|
|
@@ -1148,15 +1148,15 @@ class St {
|
|
|
1148
1148
|
* EventTracker'ом для атрибуции аналитики.
|
|
1149
1149
|
*/
|
|
1150
1150
|
async getVisitorId() {
|
|
1151
|
-
return this.visitorId ? this.visitorId : (this.visitorIdPromise || (this.visitorIdPromise =
|
|
1151
|
+
return this.visitorId ? this.visitorId : (this.visitorIdPromise || (this.visitorIdPromise = B(this.storage).then((t) => (this.visitorId = t, t))), this.visitorIdPromise);
|
|
1152
1152
|
}
|
|
1153
1153
|
/** Sync-доступ к visitor_id. null если ещё не зарезолвили (первые ms жизни). */
|
|
1154
1154
|
getCachedVisitorId() {
|
|
1155
1155
|
return this.visitorId;
|
|
1156
1156
|
}
|
|
1157
1157
|
setIdentity(t) {
|
|
1158
|
-
this.identity = t, this.cachedUser = null, this.cachedUserAt = 0, this.inflightUser = null, this.cachedBalances = null, this.cachedBalancesAt = 0, this.inflightBalances = null, this.balancesStorageUnwatch && (this.balancesStorageUnwatch(), this.balancesStorageUnwatch = null), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.hydrateUserFromStorage(), t
|
|
1159
|
-
});
|
|
1158
|
+
this.identity = t, this.cachedUser = null, this.cachedUserAt = 0, this.inflightUser = null, this.cachedBalances = null, this.cachedBalancesAt = 0, this.inflightBalances = null, this.balancesStorageUnwatch && (this.balancesStorageUnwatch(), this.balancesStorageUnwatch = null), this.hydrateBalancesFromStorage(), this.subscribeBalancesStorage(), this.hydrateUserFromStorage(), t ? this.getUser({ force: !0 }).catch(() => {
|
|
1159
|
+
}) : (this.applyUser(I), this.applyBalances([]));
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
1162
|
* Отписаться от auth-event'ов и сбросить listener'ы. Вызывать когда
|
|
@@ -1184,7 +1184,7 @@ class St {
|
|
|
1184
1184
|
"BillingClient in preview mode but cachedBootstrap is not seeded. Call setBootstrap(bootstrap) before open()."
|
|
1185
1185
|
);
|
|
1186
1186
|
}
|
|
1187
|
-
const s = Date.now(), a = this.cachedBootstrap && this.cachedBootstrapAt > 0 && s - this.cachedBootstrapAt <
|
|
1187
|
+
const s = Date.now(), a = this.cachedBootstrap && this.cachedBootstrapAt > 0 && s - this.cachedBootstrapAt < k;
|
|
1188
1188
|
return !e.force && a ? (s - this.cachedBootstrapAt > ot && this.revalidateBootstrap(e.signal).catch(() => {
|
|
1189
1189
|
}), { ...this.cachedBootstrap, user: this.cachedUser ?? void 0 }) : this.inflightBootstrap ? this.inflightBootstrap : (this.inflightBootstrap = this.fetchBootstrap({
|
|
1190
1190
|
ifVersion: e.force ? void 0 : this.cachedBootstrap?.version,
|
|
@@ -1289,7 +1289,7 @@ class St {
|
|
|
1289
1289
|
const t = await this.storage.getItem(u.bootstrap(this.paywallId));
|
|
1290
1290
|
if (!t) return;
|
|
1291
1291
|
const e = JSON.parse(t);
|
|
1292
|
-
if (!e?.bootstrap || Date.now() - e.at >
|
|
1292
|
+
if (!e?.bootstrap || Date.now() - e.at > k || this.cachedBootstrap) return;
|
|
1293
1293
|
w(e.bootstrap), this.cachedBootstrap = e.bootstrap, this.cachedBootstrapAt = e.at;
|
|
1294
1294
|
for (const s of this.bootstrapListeners)
|
|
1295
1295
|
try {
|
|
@@ -1388,7 +1388,7 @@ class St {
|
|
|
1388
1388
|
return !t && this.cachedUser && Date.now() - this.cachedUserAt < nt ? this.cachedUser : this.inflightUser ? this.inflightUser : (this.inflightUser = (async () => {
|
|
1389
1389
|
try {
|
|
1390
1390
|
if (!this.identity?.email)
|
|
1391
|
-
return this.applyUser(
|
|
1391
|
+
return this.applyUser(I), I;
|
|
1392
1392
|
const s = await this.api.request(
|
|
1393
1393
|
`/api/v1/paywall/${this.paywallId}/user-state`,
|
|
1394
1394
|
{ headers: { "X-User-Email": this.identity.email }, signal: e }
|
|
@@ -1971,10 +1971,10 @@ class It {
|
|
|
1971
1971
|
}
|
|
1972
1972
|
}
|
|
1973
1973
|
const C = 3600 * 1e3;
|
|
1974
|
-
function
|
|
1974
|
+
function v(i) {
|
|
1975
1975
|
return `paywall-${i}-trial-time-first-open`;
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function b(i) {
|
|
1978
1978
|
return `paywall-${i}-skip-times`;
|
|
1979
1979
|
}
|
|
1980
1980
|
class K {
|
|
@@ -1988,10 +1988,10 @@ class K {
|
|
|
1988
1988
|
return this.config.mode === "time" ? this.recordTime() : this.recordOpens();
|
|
1989
1989
|
}
|
|
1990
1990
|
async reset() {
|
|
1991
|
-
await this.storage.removeItem(this.config.mode === "time" ?
|
|
1991
|
+
await this.storage.removeItem(this.config.mode === "time" ? v(this.paywallId) : b(this.paywallId));
|
|
1992
1992
|
}
|
|
1993
1993
|
async checkTime() {
|
|
1994
|
-
const t = this.config.payload * C, e = await this.storage.getItem(
|
|
1994
|
+
const t = this.config.payload * C, e = await this.storage.getItem(v(this.paywallId)), s = e ? Number(e) : null;
|
|
1995
1995
|
if (!s || !Number.isFinite(s))
|
|
1996
1996
|
return {
|
|
1997
1997
|
mode: "time",
|
|
@@ -2012,7 +2012,7 @@ class K {
|
|
|
2012
2012
|
};
|
|
2013
2013
|
}
|
|
2014
2014
|
async checkOpens() {
|
|
2015
|
-
const t = this.config.payload, e = await this.storage.getItem(
|
|
2015
|
+
const t = this.config.payload, e = await this.storage.getItem(b(this.paywallId)), s = e ? Number(e) : 0, a = Number.isFinite(s) ? s : 0, n = a < t, r = Math.max(0, t - a);
|
|
2016
2016
|
return {
|
|
2017
2017
|
mode: "opens",
|
|
2018
2018
|
blocked: n,
|
|
@@ -2021,7 +2021,7 @@ class K {
|
|
|
2021
2021
|
};
|
|
2022
2022
|
}
|
|
2023
2023
|
async recordTime() {
|
|
2024
|
-
const t = this.config.payload * C, e =
|
|
2024
|
+
const t = this.config.payload * C, e = v(this.paywallId), s = await this.storage.getItem(e);
|
|
2025
2025
|
let a = s ? Number(s) : null;
|
|
2026
2026
|
(!a || !Number.isFinite(a)) && (a = Date.now(), await this.storage.setItem(e, String(a)));
|
|
2027
2027
|
const n = a + t, r = Math.max(0, n - Date.now());
|
|
@@ -2035,7 +2035,7 @@ class K {
|
|
|
2035
2035
|
};
|
|
2036
2036
|
}
|
|
2037
2037
|
async recordOpens() {
|
|
2038
|
-
const t = this.config.payload, e =
|
|
2038
|
+
const t = this.config.payload, e = b(this.paywallId), s = await this.storage.getItem(e), a = s ? Number(s) : 0, n = Number.isFinite(a) ? a : 0, r = Math.min(t, n + 1);
|
|
2039
2039
|
await this.storage.setItem(e, String(r));
|
|
2040
2040
|
const l = Math.max(0, t - r);
|
|
2041
2041
|
return {
|
|
@@ -2142,4 +2142,4 @@ export {
|
|
|
2142
2142
|
_t as s,
|
|
2143
2143
|
Z as w
|
|
2144
2144
|
};
|
|
2145
|
-
//# sourceMappingURL=chrome-port-
|
|
2145
|
+
//# sourceMappingURL=chrome-port-rVd4zwU3.js.map
|