configcat-vue 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/configcat-vue.js +1770 -1618
- package/dist/configcat-vue.umd.cjs +6 -6
- package/package.json +2 -2
package/dist/configcat-vue.js
CHANGED
|
@@ -133,788 +133,888 @@ var K;
|
|
|
133
133
|
(function(t) {
|
|
134
134
|
t[t.Fetched = 0] = "Fetched", t[t.NotModified = 1] = "NotModified", t[t.Errored = 2] = "Errored";
|
|
135
135
|
})(K || (K = {}));
|
|
136
|
-
var q =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
136
|
+
var q = (
|
|
137
|
+
/** @class */
|
|
138
|
+
function() {
|
|
139
|
+
function t(e, r, n, i) {
|
|
140
|
+
this.status = e, this.config = r, this.errorMessage = n, this.errorException = i;
|
|
141
|
+
}
|
|
142
|
+
return t.success = function(e) {
|
|
143
|
+
return new t(K.Fetched, e);
|
|
144
|
+
}, t.notModified = function(e) {
|
|
145
|
+
return new t(K.NotModified, e);
|
|
146
|
+
}, t.error = function(e, r, n) {
|
|
147
|
+
return new t(K.Errored, e, r ?? "Unknown error.", n);
|
|
148
|
+
}, t;
|
|
149
|
+
}()
|
|
150
|
+
), ie = (
|
|
151
|
+
/** @class */
|
|
152
|
+
function(t) {
|
|
153
|
+
B(e, t);
|
|
154
|
+
function e(r) {
|
|
155
|
+
for (var n = [], i = 1; i < arguments.length; i++)
|
|
156
|
+
n[i - 1] = arguments[i];
|
|
157
|
+
var o = t.call(this, function(s, a) {
|
|
158
|
+
switch (s) {
|
|
159
|
+
case "abort":
|
|
160
|
+
return "Request was aborted.";
|
|
161
|
+
case "timeout":
|
|
162
|
+
var c = a[0];
|
|
163
|
+
return "Request timed out. Timeout value: " + c + "ms";
|
|
164
|
+
case "failure":
|
|
165
|
+
var u = a[0], l = "Request failed due to a network or protocol error.";
|
|
166
|
+
return u ? l + " " + (u instanceof Error ? u.message : u + "") : l;
|
|
167
|
+
}
|
|
168
|
+
}(r, n)) || this;
|
|
169
|
+
return o.cause = r, o instanceof e || (Object.setPrototypeOf || function(s, a) {
|
|
170
|
+
return s.__proto__ = a;
|
|
171
|
+
})(o, e.prototype), o.args = n, o;
|
|
172
|
+
}
|
|
173
|
+
return e;
|
|
174
|
+
}(Error)
|
|
175
|
+
), M = (
|
|
176
|
+
/** @class */
|
|
177
|
+
function() {
|
|
178
|
+
function t(e, r, n, i) {
|
|
179
|
+
this.configJson = e, this.config = r, this.timestamp = n, this.httpETag = i;
|
|
180
|
+
}
|
|
181
|
+
return t.equals = function(e, r) {
|
|
182
|
+
return e.httpETag && r.httpETag ? e.httpETag === r.httpETag : e.configJson === r.configJson;
|
|
183
|
+
}, t.prototype.with = function(e) {
|
|
184
|
+
return new t(this.configJson, this.config, e, this.httpETag);
|
|
185
|
+
}, Object.defineProperty(t.prototype, "isEmpty", {
|
|
186
|
+
get: function() {
|
|
187
|
+
return !this.config;
|
|
188
|
+
},
|
|
189
|
+
enumerable: !1,
|
|
190
|
+
configurable: !0
|
|
191
|
+
}), t.prototype.isExpired = function(e) {
|
|
192
|
+
return this === t.empty || this.timestamp + e < t.generateTimestamp();
|
|
193
|
+
}, t.generateTimestamp = function() {
|
|
194
|
+
return (/* @__PURE__ */ new Date()).getTime();
|
|
195
|
+
}, t.serialize = function(e) {
|
|
196
|
+
var r, n;
|
|
197
|
+
return e.timestamp + `
|
|
190
198
|
` + ((r = e.httpETag) !== null && r !== void 0 ? r : "") + `
|
|
191
199
|
` + ((n = e.configJson) !== null && n !== void 0 ? n : "");
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
200
|
+
}, t.deserialize = function(e) {
|
|
201
|
+
for (var r = Array(2), n = 0, i = 0; i < r.length; i++) {
|
|
202
|
+
if (n = e.indexOf(`
|
|
195
203
|
`, n), n < 0)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
204
|
+
throw new Error("Number of values is fewer than expected.");
|
|
205
|
+
r[i] = n++;
|
|
206
|
+
}
|
|
207
|
+
var o = r[0], s = e.substring(0, o), a = parseInt(s);
|
|
208
|
+
if (isNaN(a))
|
|
209
|
+
throw new Error("Invalid fetch time: " + s);
|
|
210
|
+
n = o + 1, o = r[1], s = e.substring(n, o);
|
|
211
|
+
var c = s.length > 0 ? s : void 0;
|
|
212
|
+
n = o + 1, s = e.substring(n);
|
|
213
|
+
var u, l;
|
|
214
|
+
if (s.length > 0) {
|
|
215
|
+
try {
|
|
216
|
+
u = new de(JSON.parse(s));
|
|
217
|
+
} catch {
|
|
218
|
+
throw new Error("Invalid config JSON content: " + s);
|
|
219
|
+
}
|
|
220
|
+
l = s;
|
|
211
221
|
}
|
|
212
|
-
l
|
|
222
|
+
return new t(l, u, a, c);
|
|
223
|
+
}, t.serializationFormatVersion = "v2", t.empty = new t(void 0, void 0, 0, void 0), t;
|
|
224
|
+
}()
|
|
225
|
+
), de = (
|
|
226
|
+
/** @class */
|
|
227
|
+
function() {
|
|
228
|
+
function t(e) {
|
|
229
|
+
this.settings = e.f ? Object.fromEntries(Object.entries(e.f).map(function(r) {
|
|
230
|
+
var n = r[0], i = r[1];
|
|
231
|
+
return [n, new _e(i)];
|
|
232
|
+
})) : {}, this.preferences = e.p ? new Ye(e.p) : void 0;
|
|
213
233
|
}
|
|
214
|
-
return
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function t(e) {
|
|
218
|
-
this.settings = e.f ? Object.fromEntries(Object.entries(e.f).map(function(r) {
|
|
219
|
-
var n = r[0], i = r[1];
|
|
220
|
-
return [n, new ze(i)];
|
|
221
|
-
})) : {}, this.preferences = e.p ? new Ye(e.p) : void 0;
|
|
222
|
-
}
|
|
223
|
-
return t;
|
|
224
|
-
}(), X;
|
|
234
|
+
return t;
|
|
235
|
+
}()
|
|
236
|
+
), X;
|
|
225
237
|
(function(t) {
|
|
226
238
|
t[t.No = 0] = "No", t[t.Should = 1] = "Should", t[t.Force = 2] = "Force";
|
|
227
239
|
})(X || (X = {}));
|
|
228
|
-
var Ye =
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
240
|
+
var Ye = (
|
|
241
|
+
/** @class */
|
|
242
|
+
function() {
|
|
243
|
+
function t(e) {
|
|
244
|
+
this.baseUrl = e.u, this.redirectMode = e.r;
|
|
245
|
+
}
|
|
246
|
+
return t;
|
|
247
|
+
}()
|
|
248
|
+
), Se;
|
|
234
249
|
(function(t) {
|
|
235
250
|
t[t.Boolean = 0] = "Boolean", t[t.String = 1] = "String", t[t.Int = 2] = "Int", t[t.Double = 3] = "Double";
|
|
236
251
|
})(Se || (Se = {}));
|
|
237
|
-
var
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
}
|
|
252
|
+
var _e = (
|
|
253
|
+
/** @class */
|
|
254
|
+
function() {
|
|
255
|
+
function t(e) {
|
|
256
|
+
var r, n, i, o;
|
|
257
|
+
this.value = e.v, this.type = e.t, this.percentageOptions = (n = (r = e.p) === null || r === void 0 ? void 0 : r.map(function(s) {
|
|
258
|
+
return new Ze(s);
|
|
259
|
+
})) !== null && n !== void 0 ? n : [], this.targetingRules = (o = (i = e.r) === null || i === void 0 ? void 0 : i.map(function(s) {
|
|
260
|
+
return new Xe(s);
|
|
261
|
+
})) !== null && o !== void 0 ? o : [], this.variationId = e.i;
|
|
262
|
+
}
|
|
263
|
+
return t.fromValue = function(e) {
|
|
264
|
+
return new t({
|
|
265
|
+
t: -1,
|
|
266
|
+
v: e
|
|
267
|
+
});
|
|
268
|
+
}, t;
|
|
269
|
+
}()
|
|
270
|
+
), g;
|
|
253
271
|
(function(t) {
|
|
254
272
|
t[t.In = 0] = "In", t[t.NotIn = 1] = "NotIn", t[t.Contains = 2] = "Contains", t[t.NotContains = 3] = "NotContains", t[t.SemVerIn = 4] = "SemVerIn", t[t.SemVerNotIn = 5] = "SemVerNotIn", t[t.SemVerLessThan = 6] = "SemVerLessThan", t[t.SemVerLessThanEqual = 7] = "SemVerLessThanEqual", t[t.SemVerGreaterThan = 8] = "SemVerGreaterThan", t[t.SemVerGreaterThanEqual = 9] = "SemVerGreaterThanEqual", t[t.NumberEqual = 10] = "NumberEqual", t[t.NumberNotEqual = 11] = "NumberNotEqual", t[t.NumberLessThan = 12] = "NumberLessThan", t[t.NumberLessThanEqual = 13] = "NumberLessThanEqual", t[t.NumberGreaterThan = 14] = "NumberGreaterThan", t[t.NumberGreaterThanEqual = 15] = "NumberGreaterThanEqual", t[t.SensitiveOneOf = 16] = "SensitiveOneOf", t[t.SensitiveNotOneOf = 17] = "SensitiveNotOneOf";
|
|
255
273
|
})(g || (g = {}));
|
|
256
|
-
var Xe =
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
274
|
+
var Xe = (
|
|
275
|
+
/** @class */
|
|
276
|
+
function() {
|
|
277
|
+
function t(e) {
|
|
278
|
+
this.order = e.o, this.comparisonAttribute = e.a, this.comparator = e.t, this.comparisonValue = e.c, this.value = e.v, this.variationId = e.i;
|
|
279
|
+
}
|
|
280
|
+
return t;
|
|
281
|
+
}()
|
|
282
|
+
), Ze = (
|
|
283
|
+
/** @class */
|
|
284
|
+
function() {
|
|
285
|
+
function t(e) {
|
|
286
|
+
this.order = e.o, this.percentage = e.p, this.value = e.v, this.variationId = e.i;
|
|
287
|
+
}
|
|
288
|
+
return t;
|
|
289
|
+
}()
|
|
290
|
+
), ae = (
|
|
291
|
+
/** @class */
|
|
292
|
+
function() {
|
|
293
|
+
function t(e, r) {
|
|
294
|
+
this.errorMessage = e, this.errorException = r;
|
|
295
|
+
}
|
|
296
|
+
return Object.defineProperty(t.prototype, "isSuccess", {
|
|
297
|
+
/** Indicates whether the operation was successful or not. */
|
|
298
|
+
get: function() {
|
|
299
|
+
return this.errorMessage === null;
|
|
300
|
+
},
|
|
301
|
+
enumerable: !1,
|
|
302
|
+
configurable: !0
|
|
303
|
+
}), t.from = function(e) {
|
|
304
|
+
return e.status !== K.Errored ? t.success() : t.failure(e.errorMessage, e.errorException);
|
|
305
|
+
}, t.success = function() {
|
|
306
|
+
return new t(null);
|
|
307
|
+
}, t.failure = function(e, r) {
|
|
308
|
+
return new t(e, r);
|
|
309
|
+
}, t;
|
|
310
|
+
}()
|
|
311
|
+
), T;
|
|
284
312
|
(function(t) {
|
|
285
|
-
t[t.
|
|
313
|
+
t[t.NoFlagData = 0] = "NoFlagData", t[t.HasLocalOverrideFlagDataOnly = 1] = "HasLocalOverrideFlagDataOnly", t[t.HasCachedFlagDataOnly = 2] = "HasCachedFlagDataOnly", t[t.HasUpToDateFlagData = 3] = "HasUpToDateFlagData";
|
|
286
314
|
})(T || (T = {}));
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
case 0:
|
|
321
|
-
return [4, this.fetchAsync(e)];
|
|
322
|
-
case 1:
|
|
323
|
-
return r = i.sent(), n = r.status === K.Fetched, n || r.config.timestamp > e.timestamp && (!r.config.isEmpty || e.isEmpty) ? [4, this.options.cache.set(this.cacheKey, r.config)] : [3, 3];
|
|
324
|
-
case 2:
|
|
325
|
-
i.sent(), this.onConfigUpdated(r.config), n && !M.equals(r.config, e) && this.onConfigChanged(r.config), e = r.config, i.label = 3;
|
|
326
|
-
case 3:
|
|
327
|
-
return [2, [r, e]];
|
|
328
|
-
}
|
|
315
|
+
var I;
|
|
316
|
+
(function(t) {
|
|
317
|
+
t[t.Online = 0] = "Online", t[t.Offline = 1] = "Offline", t[t.Disposed = 2] = "Disposed";
|
|
318
|
+
})(I || (I = {}));
|
|
319
|
+
var me = (
|
|
320
|
+
/** @class */
|
|
321
|
+
function() {
|
|
322
|
+
function t(e, r) {
|
|
323
|
+
this.configFetcher = e, this.options = r, this.pendingFetch = null, this.cacheKey = r.getCacheKey(), this.configFetcher = e, this.options = r, this.status = r.offline ? I.Offline : I.Online;
|
|
324
|
+
}
|
|
325
|
+
return t.prototype.dispose = function() {
|
|
326
|
+
this.status = I.Disposed;
|
|
327
|
+
}, Object.defineProperty(t.prototype, "disposed", {
|
|
328
|
+
get: function() {
|
|
329
|
+
return this.status === I.Disposed;
|
|
330
|
+
},
|
|
331
|
+
enumerable: !1,
|
|
332
|
+
configurable: !0
|
|
333
|
+
}), t.prototype.refreshConfigAsync = function() {
|
|
334
|
+
return S(this, void 0, void 0, function() {
|
|
335
|
+
var e, r, n, i, o;
|
|
336
|
+
return O(this, function(s) {
|
|
337
|
+
switch (s.label) {
|
|
338
|
+
case 0:
|
|
339
|
+
return [4, this.options.cache.get(this.cacheKey)];
|
|
340
|
+
case 1:
|
|
341
|
+
return e = s.sent(), this.isOffline ? [3, 3] : [4, this.refreshConfigCoreAsync(e)];
|
|
342
|
+
case 2:
|
|
343
|
+
return r = s.sent(), n = r[0], i = r[1], [2, [ae.from(n), i]];
|
|
344
|
+
case 3:
|
|
345
|
+
return o = this.options.logger.configServiceCannotInitiateHttpCalls().toString(), [2, [ae.failure(o), e]];
|
|
346
|
+
}
|
|
347
|
+
});
|
|
329
348
|
});
|
|
330
|
-
})
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
var r;
|
|
334
|
-
this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new de({}));
|
|
335
|
-
}, t.prototype.fetchAsync = function(e) {
|
|
336
|
-
var r = this, n;
|
|
337
|
-
return (n = this.pendingFetch) !== null && n !== void 0 ? n : this.pendingFetch = function() {
|
|
338
|
-
return S(r, void 0, void 0, function() {
|
|
349
|
+
}, t.prototype.refreshConfigCoreAsync = function(e) {
|
|
350
|
+
return S(this, void 0, void 0, function() {
|
|
351
|
+
var r, n;
|
|
339
352
|
return O(this, function(i) {
|
|
340
353
|
switch (i.label) {
|
|
341
354
|
case 0:
|
|
342
|
-
return
|
|
355
|
+
return [4, this.fetchAsync(e)];
|
|
343
356
|
case 1:
|
|
344
|
-
return
|
|
357
|
+
return r = i.sent(), n = r.status === K.Fetched, n || r.config.timestamp > e.timestamp && (!r.config.isEmpty || e.isEmpty) ? [4, this.options.cache.set(this.cacheKey, r.config)] : [3, 3];
|
|
345
358
|
case 2:
|
|
346
|
-
|
|
359
|
+
i.sent(), this.onConfigUpdated(r.config), n && !M.equals(r.config, e) && this.onConfigChanged(r.config), e = r.config, i.label = 3;
|
|
347
360
|
case 3:
|
|
348
|
-
return [2];
|
|
361
|
+
return [2, [r, e]];
|
|
349
362
|
}
|
|
350
363
|
});
|
|
351
364
|
});
|
|
352
|
-
}()
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
365
|
+
}, t.prototype.onConfigUpdated = function(e) {
|
|
366
|
+
}, t.prototype.onConfigChanged = function(e) {
|
|
367
|
+
var r;
|
|
368
|
+
this.options.logger.debug("config changed"), this.options.hooks.emit("configChanged", (r = e.config) !== null && r !== void 0 ? r : new de({}));
|
|
369
|
+
}, t.prototype.fetchAsync = function(e) {
|
|
370
|
+
var r = this, n;
|
|
371
|
+
return (n = this.pendingFetch) !== null && n !== void 0 ? n : this.pendingFetch = function() {
|
|
372
|
+
return S(r, void 0, void 0, function() {
|
|
373
|
+
return O(this, function(i) {
|
|
374
|
+
switch (i.label) {
|
|
375
|
+
case 0:
|
|
376
|
+
return i.trys.push([0, , 2, 3]), [4, this.fetchLogicAsync(e)];
|
|
377
|
+
case 1:
|
|
378
|
+
return [2, i.sent()];
|
|
379
|
+
case 2:
|
|
380
|
+
return this.pendingFetch = null, [
|
|
381
|
+
7
|
|
382
|
+
/*endfinally*/
|
|
383
|
+
];
|
|
384
|
+
case 3:
|
|
385
|
+
return [
|
|
386
|
+
2
|
|
387
|
+
/*return*/
|
|
388
|
+
];
|
|
374
389
|
}
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
}();
|
|
393
|
+
}, t.prototype.fetchLogicAsync = function(e) {
|
|
394
|
+
var r;
|
|
395
|
+
return S(this, void 0, void 0, function() {
|
|
396
|
+
var n, i, o, s, a, c;
|
|
397
|
+
return O(this, function(u) {
|
|
398
|
+
switch (u.label) {
|
|
399
|
+
case 0:
|
|
400
|
+
n = this.options, n.logger.debug("ConfigServiceBase.fetchLogicAsync() - called."), u.label = 1;
|
|
401
|
+
case 1:
|
|
402
|
+
return u.trys.push([1, 3, , 4]), [4, this.fetchRequestAsync((r = e.httpETag) !== null && r !== void 0 ? r : null)];
|
|
403
|
+
case 2:
|
|
404
|
+
switch (o = u.sent(), s = o[0], a = o[1], s.statusCode) {
|
|
405
|
+
case 200:
|
|
406
|
+
return a ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was successful. Returning new config."), [2, q.success(new M(s.body, a, M.generateTimestamp(), s.eTag))]) : (i = n.logger.fetchReceived200WithInvalidBody().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + s.statusCode + " " + s.reasonPhrase + " was received but the HTTP response content was invalid. Returning null."), [2, q.error(e, i)]);
|
|
407
|
+
case 304:
|
|
408
|
+
return e ? (n.logger.debug("ConfigServiceBase.fetchLogicAsync(): content was not modified. Returning last config with updated timestamp."), [2, q.notModified(e.with(M.generateTimestamp()))]) : (i = n.logger.fetchReceived304WhenLocalCacheIsEmpty(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): " + s.statusCode + " " + s.reasonPhrase + " was received when no config is cached locally. Returning null."), [2, q.error(e, i)]);
|
|
409
|
+
case 403:
|
|
410
|
+
case 404:
|
|
411
|
+
return i = n.logger.fetchFailedDueToInvalidSdkKey().toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning last config (if any) with updated timestamp."), [2, q.error(e.with(M.generateTimestamp()), i)];
|
|
412
|
+
default:
|
|
413
|
+
return i = n.logger.fetchFailedDueToUnexpectedHttpResponse(s.statusCode, s.reasonPhrase).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, q.error(e, i)];
|
|
414
|
+
}
|
|
415
|
+
return [3, 4];
|
|
416
|
+
case 3:
|
|
417
|
+
return c = u.sent(), i = (c instanceof ie && c.cause === "timeout" ? n.logger.fetchFailedDueToRequestTimeout(c.args[0], c) : n.logger.fetchFailedDueToUnexpectedError(c)).toString(), n.logger.debug("ConfigServiceBase.fetchLogicAsync(): fetch was unsuccessful. Returning null."), [2, q.error(e, i, c)];
|
|
418
|
+
case 4:
|
|
419
|
+
return [
|
|
420
|
+
2
|
|
421
|
+
/*return*/
|
|
422
|
+
];
|
|
423
|
+
}
|
|
424
|
+
});
|
|
381
425
|
});
|
|
382
|
-
})
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
426
|
+
}, t.prototype.fetchRequestAsync = function(e, r) {
|
|
427
|
+
return r === void 0 && (r = 2), S(this, void 0, void 0, function() {
|
|
428
|
+
var n, i, o, s, a, c, u;
|
|
429
|
+
return O(this, function(l) {
|
|
430
|
+
switch (l.label) {
|
|
431
|
+
case 0:
|
|
432
|
+
n = this.options, n.logger.debug("ConfigServiceBase.fetchRequestAsync() - called."), i = 0, l.label = 1;
|
|
433
|
+
case 1:
|
|
434
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): calling fetchLogic()" + (i > 0 ? ", retry " + i + "/" + r : "")), [4, this.configFetcher.fetchLogic(n, e)];
|
|
435
|
+
case 2:
|
|
436
|
+
if (o = l.sent(), o.statusCode !== 200)
|
|
437
|
+
return [2, [o]];
|
|
438
|
+
if (!o.body)
|
|
439
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): no response body."), [2, [o]];
|
|
440
|
+
s = void 0;
|
|
441
|
+
try {
|
|
442
|
+
s = new de(JSON.parse(o.body));
|
|
443
|
+
} catch {
|
|
444
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): invalid response body."), [2, [o]];
|
|
445
|
+
}
|
|
446
|
+
if (a = s.preferences, !a)
|
|
447
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): preferences is empty."), [2, [o, s]];
|
|
448
|
+
if (c = a.baseUrl, !c || c === n.baseUrl)
|
|
449
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): baseUrl OK."), [2, [o, s]];
|
|
450
|
+
if (u = a.redirectMode, n.baseUrlOverriden && u !== X.Force)
|
|
451
|
+
return n.logger.debug("ConfigServiceBase.fetchRequestAsync(): options.baseUrlOverriden && redirect !== 2."), [2, [o, s]];
|
|
452
|
+
if (n.baseUrl = c, u === X.No)
|
|
453
|
+
return [2, [o, s]];
|
|
454
|
+
if (u === X.Should && n.logger.dataGovernanceIsOutOfSync(), i >= r)
|
|
455
|
+
return n.logger.fetchFailedDueToRedirectLoop(), [2, [o, s]];
|
|
456
|
+
l.label = 3;
|
|
457
|
+
case 3:
|
|
458
|
+
return i++, [3, 1];
|
|
459
|
+
case 4:
|
|
460
|
+
return [
|
|
461
|
+
2
|
|
462
|
+
/*return*/
|
|
463
|
+
];
|
|
464
|
+
}
|
|
465
|
+
});
|
|
419
466
|
});
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
467
|
+
}, Object.defineProperty(t.prototype, "isOfflineExactly", {
|
|
468
|
+
get: function() {
|
|
469
|
+
return this.status === I.Offline;
|
|
470
|
+
},
|
|
471
|
+
enumerable: !1,
|
|
472
|
+
configurable: !0
|
|
473
|
+
}), Object.defineProperty(t.prototype, "isOffline", {
|
|
474
|
+
get: function() {
|
|
475
|
+
return this.status !== I.Online;
|
|
476
|
+
},
|
|
477
|
+
enumerable: !1,
|
|
478
|
+
configurable: !0
|
|
479
|
+
}), t.prototype.setOnlineCore = function() {
|
|
480
|
+
}, t.prototype.setOnline = function() {
|
|
481
|
+
this.status === I.Offline ? (this.setOnlineCore(), this.status = I.Online, this.options.logger.configServiceStatusChanged(I[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOnline");
|
|
482
|
+
}, t.prototype.setOfflineCore = function() {
|
|
483
|
+
}, t.prototype.setOffline = function() {
|
|
484
|
+
this.status === I.Online ? (this.setOfflineCore(), this.status = I.Offline, this.options.logger.configServiceStatusChanged(I[this.status])) : this.disposed && this.options.logger.configServiceMethodHasNoEffectDueToDisposedClient("setOffline");
|
|
485
|
+
}, t.prototype.onCacheSynced = function(e) {
|
|
486
|
+
this.options.hooks.emit("clientReady", this.getCacheState(e));
|
|
487
|
+
}, t.prototype.syncUpWithCache = function() {
|
|
488
|
+
return S(this, void 0, void 0, function() {
|
|
489
|
+
var e;
|
|
490
|
+
return O(this, function(r) {
|
|
491
|
+
switch (r.label) {
|
|
492
|
+
case 0:
|
|
493
|
+
return [4, this.options.cache.get(this.cacheKey)];
|
|
494
|
+
case 1:
|
|
495
|
+
return e = r.sent(), this.onCacheSynced(e), [2, e];
|
|
496
|
+
}
|
|
497
|
+
});
|
|
449
498
|
});
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
this.addListener = this.on, this.off = this.removeListener;
|
|
455
|
-
}
|
|
456
|
-
return t.prototype.on = function() {
|
|
457
|
-
return this;
|
|
458
|
-
}, t.prototype.once = function() {
|
|
459
|
-
return this;
|
|
460
|
-
}, t.prototype.removeListener = function() {
|
|
461
|
-
return this;
|
|
462
|
-
}, t.prototype.removeAllListeners = function() {
|
|
463
|
-
return this;
|
|
464
|
-
}, t.prototype.listeners = function() {
|
|
465
|
-
return [];
|
|
466
|
-
}, t.prototype.listenerCount = function() {
|
|
467
|
-
return 0;
|
|
468
|
-
}, t.prototype.eventNames = function() {
|
|
469
|
-
return [];
|
|
470
|
-
}, t.prototype.emit = function() {
|
|
471
|
-
return !1;
|
|
472
|
-
}, t;
|
|
473
|
-
}(), L;
|
|
474
|
-
(function(t) {
|
|
475
|
-
t[t.NoFlagData = 0] = "NoFlagData", t[t.HasLocalOverrideFlagDataOnly = 1] = "HasLocalOverrideFlagDataOnly", t[t.HasCachedFlagDataOnly = 2] = "HasCachedFlagDataOnly", t[t.HasUpToDateFlagData = 3] = "HasUpToDateFlagData";
|
|
476
|
-
})(L || (L = {}));
|
|
477
|
-
var Oe = new Qe(), et = function() {
|
|
478
|
-
function t(e) {
|
|
479
|
-
this.addListener = this.on, this.off = this.removeListener, this.eventEmitter = e;
|
|
480
|
-
}
|
|
481
|
-
return t.prototype.tryDisconnect = function() {
|
|
482
|
-
var e = this.eventEmitter;
|
|
483
|
-
return this.eventEmitter = Oe, e !== Oe;
|
|
484
|
-
}, t.prototype.on = function(e, r) {
|
|
485
|
-
return this.eventEmitter.on(e, r), this;
|
|
486
|
-
}, t.prototype.once = function(e, r) {
|
|
487
|
-
return this.eventEmitter.once(e, r), this;
|
|
488
|
-
}, t.prototype.removeListener = function(e, r) {
|
|
489
|
-
return this.eventEmitter.removeListener(e, r), this;
|
|
490
|
-
}, t.prototype.removeAllListeners = function(e) {
|
|
491
|
-
return this.eventEmitter.removeAllListeners(e), this;
|
|
492
|
-
}, t.prototype.listeners = function(e) {
|
|
493
|
-
return this.eventEmitter.listeners(e);
|
|
494
|
-
}, t.prototype.listenerCount = function(e) {
|
|
495
|
-
return this.eventEmitter.listenerCount(e);
|
|
496
|
-
}, t.prototype.eventNames = function() {
|
|
497
|
-
return this.eventEmitter.eventNames();
|
|
498
|
-
}, t.prototype.emit = function(e) {
|
|
499
|
-
for (var r, n = [], i = 1; i < arguments.length; i++)
|
|
500
|
-
n[i - 1] = arguments[i];
|
|
501
|
-
return (r = this.eventEmitter).emit.apply(r, $e([e], n));
|
|
502
|
-
}, t;
|
|
503
|
-
}();
|
|
504
|
-
function tt(t, e) {
|
|
499
|
+
}, t;
|
|
500
|
+
}()
|
|
501
|
+
);
|
|
502
|
+
function Qe(t, e) {
|
|
505
503
|
var r, n = new Promise(function(i) {
|
|
506
504
|
return r = setTimeout(i, t);
|
|
507
505
|
});
|
|
508
|
-
return e
|
|
506
|
+
return e && (e.clearTimer = function() {
|
|
509
507
|
return clearTimeout(r);
|
|
510
508
|
}), n;
|
|
511
509
|
}
|
|
512
|
-
function
|
|
510
|
+
function _(t, e) {
|
|
513
511
|
return e === void 0 && (e = !1), t instanceof Error ? e && t.stack ? t.stack : t.toString() : t + "";
|
|
514
512
|
}
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
return S(this, void 0, void 0, function() {
|
|
564
|
-
function r(i) {
|
|
565
|
-
i.debug("AutoPollConfigService.getConfig() - returning value from cache.");
|
|
566
|
-
}
|
|
567
|
-
var n;
|
|
568
|
-
return O(this, function(i) {
|
|
569
|
-
switch (i.label) {
|
|
570
|
-
case 0:
|
|
571
|
-
return this.options.logger.debug("AutoPollConfigService.getConfig() called."), !this.isOffline && !this.initialized ? [4, this.options.cache.get(this.cacheKey)] : [3, 3];
|
|
572
|
-
case 1:
|
|
573
|
-
return n = i.sent(), n.isExpired(this.pollIntervalMs) ? (this.options.logger.debug("AutoPollConfigService.getConfig() - cache is empty or expired, waiting for initialization."), [4, this.waitForInitializationAsync()]) : (r(this.options.logger), [2, n]);
|
|
574
|
-
case 2:
|
|
575
|
-
i.sent(), i.label = 3;
|
|
576
|
-
case 3:
|
|
577
|
-
return [4, this.options.cache.get(this.cacheKey)];
|
|
578
|
-
case 4:
|
|
579
|
-
return n = i.sent(), n.isExpired(this.pollIntervalMs) ? this.options.logger.debug("AutoPollConfigService.getConfig() - cache is empty or expired.") : r(this.options.logger), [2, n];
|
|
580
|
-
}
|
|
513
|
+
function et(t) {
|
|
514
|
+
var e;
|
|
515
|
+
return typeof ((e = t) === null || e === void 0 ? void 0 : e.then) == "function";
|
|
516
|
+
}
|
|
517
|
+
var tt = (
|
|
518
|
+
/** @class */
|
|
519
|
+
function(t) {
|
|
520
|
+
B(e, t);
|
|
521
|
+
function e(r, n) {
|
|
522
|
+
var i = t.call(this, r, n) || this;
|
|
523
|
+
i.signalInitialization = function() {
|
|
524
|
+
}, i.pollIntervalMs = n.pollIntervalSeconds * 1e3;
|
|
525
|
+
var o = t.prototype.syncUpWithCache.call(i);
|
|
526
|
+
return n.maxInitWaitTimeSeconds !== 0 ? (i.initialized = !1, i.initialization = new Promise(function(s) {
|
|
527
|
+
return i.signalInitialization = function() {
|
|
528
|
+
i.initialized = !0, clearTimeout(i.initTimerId), s();
|
|
529
|
+
};
|
|
530
|
+
}), i.initialization.then(function() {
|
|
531
|
+
return t.prototype.onCacheSynced.call(i, n.cache.getInMemory());
|
|
532
|
+
}), n.maxInitWaitTimeSeconds > 0 && (i.initTimerId = setTimeout(function() {
|
|
533
|
+
return i.signalInitialization();
|
|
534
|
+
}, n.maxInitWaitTimeSeconds * 1e3))) : (i.initialized = !0, i.initialization = Promise.resolve(), o.then(function(s) {
|
|
535
|
+
return t.prototype.onCacheSynced.call(i, s);
|
|
536
|
+
})), n.offline || i.startRefreshWorker(o), i;
|
|
537
|
+
}
|
|
538
|
+
return e.prototype.onCacheSynced = function() {
|
|
539
|
+
}, e.prototype.waitForInitializationAsync = function() {
|
|
540
|
+
return S(this, void 0, void 0, function() {
|
|
541
|
+
var r, n;
|
|
542
|
+
return O(this, function(i) {
|
|
543
|
+
switch (i.label) {
|
|
544
|
+
case 0:
|
|
545
|
+
return this.options.maxInitWaitTimeSeconds < 0 ? [4, this.initialization] : [3, 2];
|
|
546
|
+
case 1:
|
|
547
|
+
return i.sent(), [2, !0];
|
|
548
|
+
case 2:
|
|
549
|
+
return r = {}, [4, Promise.race([
|
|
550
|
+
this.initialization.then(function() {
|
|
551
|
+
return !0;
|
|
552
|
+
}),
|
|
553
|
+
Qe(this.options.maxInitWaitTimeSeconds * 1e3, r).then(function() {
|
|
554
|
+
return !1;
|
|
555
|
+
})
|
|
556
|
+
])];
|
|
557
|
+
case 3:
|
|
558
|
+
return n = i.sent(), r.clearTimer(), [2, n];
|
|
559
|
+
}
|
|
560
|
+
});
|
|
581
561
|
});
|
|
582
|
-
})
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
this.options.logger.debug("AutoPollConfigService.dispose() called."), t.prototype.dispose.call(this), this.timerId && this.stopRefreshWorker();
|
|
587
|
-
}, e.prototype.onConfigUpdated = function(r) {
|
|
588
|
-
t.prototype.onConfigUpdated.call(this, r), this.signalInitialization();
|
|
589
|
-
}, e.prototype.setOnlineCore = function() {
|
|
590
|
-
this.startRefreshWorker();
|
|
591
|
-
}, e.prototype.setOfflineCore = function() {
|
|
592
|
-
this.stopRefreshWorker();
|
|
593
|
-
}, e.prototype.startRefreshWorker = function() {
|
|
594
|
-
return S(this, void 0, void 0, function() {
|
|
595
|
-
var r, n, i = this;
|
|
596
|
-
return O(this, function(o) {
|
|
597
|
-
switch (o.label) {
|
|
598
|
-
case 0:
|
|
599
|
-
return this.options.logger.debug("AutoPollConfigService.startRefreshWorker() called."), r = this.pollIntervalMs, [4, this.options.cache.get(this.cacheKey)];
|
|
600
|
-
case 1:
|
|
601
|
-
return n = o.sent(), n.isExpired(this.pollIntervalMs) ? this.isOfflineExactly ? [3, 3] : [4, this.refreshConfigCoreAsync(n)] : [3, 4];
|
|
602
|
-
case 2:
|
|
603
|
-
o.sent(), o.label = 3;
|
|
604
|
-
case 3:
|
|
605
|
-
return [3, 5];
|
|
606
|
-
case 4:
|
|
607
|
-
this.signalInitialization(), o.label = 5;
|
|
608
|
-
case 5:
|
|
609
|
-
return this.options.logger.debug("AutoPollConfigService.startRefreshWorker() - calling refreshWorkerLogic()'s setTimeout."), this.timerId = setTimeout(function(s) {
|
|
610
|
-
return i.refreshWorkerLogic(s);
|
|
611
|
-
}, r, r), [2];
|
|
562
|
+
}, e.prototype.getConfig = function() {
|
|
563
|
+
return S(this, void 0, void 0, function() {
|
|
564
|
+
function r(i) {
|
|
565
|
+
i.debug("AutoPollConfigService.getConfig() - returning value from cache.");
|
|
612
566
|
}
|
|
567
|
+
var n;
|
|
568
|
+
return O(this, function(i) {
|
|
569
|
+
switch (i.label) {
|
|
570
|
+
case 0:
|
|
571
|
+
return this.options.logger.debug("AutoPollConfigService.getConfig() called."), !this.isOffline && !this.initialized ? [4, this.options.cache.get(this.cacheKey)] : [3, 3];
|
|
572
|
+
case 1:
|
|
573
|
+
return n = i.sent(), n.isExpired(this.pollIntervalMs) ? (this.options.logger.debug("AutoPollConfigService.getConfig() - cache is empty or expired, waiting for initialization."), [4, this.waitForInitializationAsync()]) : (r(this.options.logger), [2, n]);
|
|
574
|
+
case 2:
|
|
575
|
+
i.sent(), i.label = 3;
|
|
576
|
+
case 3:
|
|
577
|
+
return [4, this.options.cache.get(this.cacheKey)];
|
|
578
|
+
case 4:
|
|
579
|
+
return n = i.sent(), n.isExpired(this.pollIntervalMs) ? this.options.logger.debug("AutoPollConfigService.getConfig() - cache is empty or expired.") : r(this.options.logger), [2, n];
|
|
580
|
+
}
|
|
581
|
+
});
|
|
613
582
|
});
|
|
614
|
-
})
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
return
|
|
631
|
-
|
|
632
|
-
|
|
583
|
+
}, e.prototype.refreshConfigAsync = function() {
|
|
584
|
+
return this.options.logger.debug("AutoPollConfigService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
|
|
585
|
+
}, e.prototype.dispose = function() {
|
|
586
|
+
this.options.logger.debug("AutoPollConfigService.dispose() called."), t.prototype.dispose.call(this), this.workerTimerId && this.stopRefreshWorker();
|
|
587
|
+
}, e.prototype.onConfigUpdated = function(r) {
|
|
588
|
+
t.prototype.onConfigUpdated.call(this, r), this.signalInitialization();
|
|
589
|
+
}, e.prototype.setOnlineCore = function() {
|
|
590
|
+
this.startRefreshWorker();
|
|
591
|
+
}, e.prototype.setOfflineCore = function() {
|
|
592
|
+
this.stopRefreshWorker();
|
|
593
|
+
}, e.prototype.startRefreshWorker = function(r) {
|
|
594
|
+
return S(this, void 0, void 0, function() {
|
|
595
|
+
var n, i, o = this;
|
|
596
|
+
return O(this, function(s) {
|
|
597
|
+
switch (s.label) {
|
|
598
|
+
case 0:
|
|
599
|
+
return this.options.logger.debug("AutoPollConfigService.startRefreshWorker() called."), n = this.pollIntervalMs, [4, r ?? this.options.cache.get(this.cacheKey)];
|
|
600
|
+
case 1:
|
|
601
|
+
return i = s.sent(), i.isExpired(this.pollIntervalMs) ? this.isOfflineExactly ? [3, 3] : [4, this.refreshConfigCoreAsync(i)] : [3, 4];
|
|
602
|
+
case 2:
|
|
603
|
+
s.sent(), s.label = 3;
|
|
604
|
+
case 3:
|
|
605
|
+
return [3, 5];
|
|
606
|
+
case 4:
|
|
607
|
+
this.signalInitialization(), s.label = 5;
|
|
608
|
+
case 5:
|
|
609
|
+
return this.options.logger.debug("AutoPollConfigService.startRefreshWorker() - calling refreshWorkerLogic()'s setTimeout."), this.workerTimerId = setTimeout(function(a) {
|
|
610
|
+
return o.refreshWorkerLogic(a);
|
|
611
|
+
}, n, n), [
|
|
612
|
+
2
|
|
613
|
+
/*return*/
|
|
614
|
+
];
|
|
615
|
+
}
|
|
616
|
+
});
|
|
633
617
|
});
|
|
634
|
-
})
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
if (i.trys.push([0, 2, , 3]), !r.isEmpty)
|
|
660
|
-
this.cachedSerializedConfig = M.serialize(r), this.cachedConfig = r;
|
|
661
|
-
else
|
|
662
|
-
return this.cachedSerializedConfig = void 0, this.cachedConfig = r, [2];
|
|
663
|
-
return [4, this.cache.set(e, this.cachedSerializedConfig)];
|
|
664
|
-
case 1:
|
|
665
|
-
return i.sent(), [3, 3];
|
|
666
|
-
case 2:
|
|
667
|
-
return n = i.sent(), this.logger.configServiceCacheWriteError(n), [3, 3];
|
|
668
|
-
case 3:
|
|
669
|
-
return [2];
|
|
670
|
-
}
|
|
618
|
+
}, e.prototype.stopRefreshWorker = function() {
|
|
619
|
+
this.options.logger.debug("AutoPollConfigService.stopRefreshWorker() - clearing setTimeout."), clearTimeout(this.workerTimerId);
|
|
620
|
+
}, e.prototype.refreshWorkerLogic = function(r) {
|
|
621
|
+
return S(this, void 0, void 0, function() {
|
|
622
|
+
var n, i = this;
|
|
623
|
+
return O(this, function(o) {
|
|
624
|
+
switch (o.label) {
|
|
625
|
+
case 0:
|
|
626
|
+
return this.disposed ? (this.options.logger.debug("AutoPollConfigService.refreshWorkerLogic() - called on a disposed client."), [
|
|
627
|
+
2
|
|
628
|
+
/*return*/
|
|
629
|
+
]) : (this.options.logger.debug("AutoPollConfigService.refreshWorkerLogic() - called."), this.isOffline ? [3, 3] : [4, this.options.cache.get(this.cacheKey)]);
|
|
630
|
+
case 1:
|
|
631
|
+
return n = o.sent(), [4, this.refreshConfigCoreAsync(n)];
|
|
632
|
+
case 2:
|
|
633
|
+
o.sent(), o.label = 3;
|
|
634
|
+
case 3:
|
|
635
|
+
return this.options.logger.debug("AutoPollConfigService.refreshWorkerLogic() - calling refreshWorkerLogic()'s setTimeout."), this.workerTimerId = setTimeout(function(s) {
|
|
636
|
+
return i.refreshWorkerLogic(s);
|
|
637
|
+
}, r, r), [
|
|
638
|
+
2
|
|
639
|
+
/*return*/
|
|
640
|
+
];
|
|
641
|
+
}
|
|
642
|
+
});
|
|
671
643
|
});
|
|
672
|
-
})
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
644
|
+
}, e.prototype.getCacheState = function(r) {
|
|
645
|
+
return r.isEmpty ? T.NoFlagData : r.isExpired(this.pollIntervalMs) ? T.HasCachedFlagDataOnly : T.HasUpToDateFlagData;
|
|
646
|
+
}, e;
|
|
647
|
+
}(me)
|
|
648
|
+
), rt = (
|
|
649
|
+
/** @class */
|
|
650
|
+
function() {
|
|
651
|
+
function t() {
|
|
652
|
+
this.cachedConfig = M.empty;
|
|
653
|
+
}
|
|
654
|
+
return t.prototype.set = function(e, r) {
|
|
655
|
+
this.cachedConfig = r;
|
|
656
|
+
}, t.prototype.get = function(e) {
|
|
657
|
+
return this.cachedConfig;
|
|
658
|
+
}, t.prototype.getInMemory = function() {
|
|
659
|
+
return this.cachedConfig;
|
|
660
|
+
}, t;
|
|
661
|
+
}()
|
|
662
|
+
), ze = (
|
|
663
|
+
/** @class */
|
|
664
|
+
function() {
|
|
665
|
+
function t(e, r) {
|
|
666
|
+
this.cache = e, this.logger = r, this.cachedConfig = M.empty;
|
|
667
|
+
}
|
|
668
|
+
return t.prototype.set = function(e, r) {
|
|
669
|
+
return S(this, void 0, void 0, function() {
|
|
670
|
+
var n;
|
|
671
|
+
return O(this, function(i) {
|
|
672
|
+
switch (i.label) {
|
|
673
|
+
case 0:
|
|
674
|
+
if (i.trys.push([0, 2, , 3]), !r.isEmpty)
|
|
675
|
+
this.cachedSerializedConfig = M.serialize(r), this.cachedConfig = r;
|
|
676
|
+
else
|
|
677
|
+
return this.cachedSerializedConfig = void 0, this.cachedConfig = r, [
|
|
678
|
+
2
|
|
679
|
+
/*return*/
|
|
680
|
+
];
|
|
681
|
+
return [4, this.cache.set(e, this.cachedSerializedConfig)];
|
|
682
|
+
case 1:
|
|
683
|
+
return i.sent(), [3, 3];
|
|
684
|
+
case 2:
|
|
685
|
+
return n = i.sent(), this.logger.configServiceCacheWriteError(n), [3, 3];
|
|
686
|
+
case 3:
|
|
687
|
+
return [
|
|
688
|
+
2
|
|
689
|
+
/*return*/
|
|
690
|
+
];
|
|
691
|
+
}
|
|
692
|
+
});
|
|
687
693
|
});
|
|
688
|
-
})
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
694
|
+
}, t.prototype.updateCachedConfig = function(e) {
|
|
695
|
+
e == null || e === this.cachedSerializedConfig || (this.cachedConfig = M.deserialize(e), this.cachedSerializedConfig = e);
|
|
696
|
+
}, t.prototype.get = function(e) {
|
|
697
|
+
var r = this;
|
|
698
|
+
try {
|
|
699
|
+
var n = this.cache.get(e);
|
|
700
|
+
if (et(n))
|
|
701
|
+
return function(i) {
|
|
702
|
+
return S(r, void 0, void 0, function() {
|
|
703
|
+
var o, s;
|
|
704
|
+
return O(this, function(a) {
|
|
705
|
+
switch (a.label) {
|
|
706
|
+
case 0:
|
|
707
|
+
return a.trys.push([0, 2, , 3]), o = this.updateCachedConfig, [4, i];
|
|
708
|
+
case 1:
|
|
709
|
+
return o.apply(this, [a.sent()]), [3, 3];
|
|
710
|
+
case 2:
|
|
711
|
+
return s = a.sent(), this.logger.configServiceCacheReadError(s), [3, 3];
|
|
712
|
+
case 3:
|
|
713
|
+
return [2, this.cachedConfig];
|
|
714
|
+
}
|
|
715
|
+
});
|
|
716
|
+
});
|
|
717
|
+
}(n);
|
|
718
|
+
this.updateCachedConfig(n);
|
|
719
|
+
} catch (i) {
|
|
720
|
+
this.logger.configServiceCacheReadError(i);
|
|
721
|
+
}
|
|
722
|
+
return Promise.resolve(this.cachedConfig);
|
|
723
|
+
}, t.prototype.getInMemory = function() {
|
|
724
|
+
return this.cachedConfig;
|
|
725
|
+
}, t;
|
|
726
|
+
}()
|
|
727
|
+
), v;
|
|
693
728
|
(function(t) {
|
|
694
729
|
t[t.Debug = 4] = "Debug", t[t.Info = 3] = "Info", t[t.Warn = 2] = "Warn", t[t.Error = 1] = "Error", t[t.Off = -1] = "Off";
|
|
695
730
|
})(v || (v = {}));
|
|
696
|
-
var A =
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
e =
|
|
713
|
-
|
|
714
|
-
e
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
}
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
731
|
+
var A = (
|
|
732
|
+
/** @class */
|
|
733
|
+
function() {
|
|
734
|
+
function t(e, r, n) {
|
|
735
|
+
this.strings = e, this.argNames = r, this.argValues = n;
|
|
736
|
+
}
|
|
737
|
+
return t.from = function() {
|
|
738
|
+
for (var e = [], r = 0; r < arguments.length; r++)
|
|
739
|
+
e[r] = arguments[r];
|
|
740
|
+
return function(n) {
|
|
741
|
+
for (var i = [], o = 1; o < arguments.length; o++)
|
|
742
|
+
i[o - 1] = arguments[o];
|
|
743
|
+
return new t(n, e, i);
|
|
744
|
+
};
|
|
745
|
+
}, Object.defineProperty(t.prototype, "defaultFormattedMessage", {
|
|
746
|
+
get: function() {
|
|
747
|
+
var e = this.cachedDefaultFormattedMessage;
|
|
748
|
+
if (e === void 0) {
|
|
749
|
+
e = "";
|
|
750
|
+
for (var r = this, n = r.strings, i = r.argValues, o = 0; o < n.length - 1; o++)
|
|
751
|
+
e += n[o], e += i[o];
|
|
752
|
+
e += n[o], this.cachedDefaultFormattedMessage = e;
|
|
753
|
+
}
|
|
754
|
+
return e;
|
|
755
|
+
},
|
|
756
|
+
enumerable: !1,
|
|
757
|
+
configurable: !0
|
|
758
|
+
}), t.prototype.toString = function() {
|
|
759
|
+
return this.defaultFormattedMessage;
|
|
760
|
+
}, t;
|
|
761
|
+
}()
|
|
762
|
+
), nt = (
|
|
763
|
+
/** @class */
|
|
764
|
+
function() {
|
|
765
|
+
function t(e, r) {
|
|
766
|
+
this.logger = e, this.hooks = r;
|
|
767
|
+
}
|
|
768
|
+
return Object.defineProperty(t.prototype, "level", {
|
|
769
|
+
get: function() {
|
|
770
|
+
var e;
|
|
771
|
+
return (e = this.logger.level) !== null && e !== void 0 ? e : v.Warn;
|
|
772
|
+
},
|
|
773
|
+
enumerable: !1,
|
|
774
|
+
configurable: !0
|
|
775
|
+
}), t.prototype.isLogLevelEnabled = function(e) {
|
|
776
|
+
return this.level >= e;
|
|
777
|
+
}, t.prototype.log = function(e, r, n, i) {
|
|
778
|
+
var o;
|
|
779
|
+
return this.isLogLevelEnabled(e) && this.logger.log(e, r, n, i), e === v.Error && ((o = this.hooks) === null || o === void 0 || o.emit("clientError", n.toString(), i)), n;
|
|
780
|
+
}, t.prototype.debug = function(e) {
|
|
781
|
+
this.log(v.Debug, 0, e);
|
|
782
|
+
}, t.prototype.configJsonIsNotPresent = function(e) {
|
|
783
|
+
return this.log(v.Error, 1e3, A.from("DEFAULT_RETURN_VALUE")(Oe || (Oe = C(["Config JSON is not present. Returning ", "."], ["Config JSON is not present. Returning ", "."])), e));
|
|
784
|
+
}, t.prototype.configJsonIsNotPresentSingle = function(e, r, n) {
|
|
785
|
+
return this.log(v.Error, 1e3, A.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(Ce || (Ce = C(["Config JSON is not present when evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Config JSON is not present when evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n));
|
|
786
|
+
}, t.prototype.settingEvaluationFailedDueToMissingKey = function(e, r, n, i) {
|
|
787
|
+
return this.log(v.Error, 1001, A.from("KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE", "AVAILABLE_KEYS")(Ae || (Ae = C(["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the `", "` parameter that you specified in your application: '", "'. Available keys: [", "]."], ["Failed to evaluate setting '", "' (the key was not found in config JSON). Returning the \\`", "\\` parameter that you specified in your application: '", "'. Available keys: [", "]."])), e, r, n, i));
|
|
788
|
+
}, t.prototype.settingEvaluationError = function(e, r, n) {
|
|
789
|
+
return this.log(v.Error, 1002, A.from("METHOD_NAME", "DEFAULT_RETURN_VALUE")(Te || (Te = C(["Error occurred in the `", "` method. Returning ", "."], ["Error occurred in the \\`", "\\` method. Returning ", "."])), e, r), n);
|
|
790
|
+
}, t.prototype.settingEvaluationErrorSingle = function(e, r, n, i, o) {
|
|
791
|
+
return this.log(v.Error, 1002, A.from("METHOD_NAME", "KEY", "DEFAULT_PARAM_NAME", "DEFAULT_PARAM_VALUE")(we || (we = C(["Error occurred in the `", "` method while evaluating setting '", "'. Returning the `", "` parameter that you specified in your application: '", "'."], ["Error occurred in the \\`", "\\` method while evaluating setting '", "'. Returning the \\`", "\\` parameter that you specified in your application: '", "'."])), e, r, n, i), o);
|
|
792
|
+
}, t.prototype.forceRefreshError = function(e, r) {
|
|
793
|
+
return this.log(v.Error, 1003, A.from("METHOD_NAME")(Ie || (Ie = C(["Error occurred in the `", "` method."], ["Error occurred in the \\`", "\\` method."])), e), r);
|
|
794
|
+
}, t.prototype.fetchFailedDueToInvalidSdkKey = function() {
|
|
795
|
+
return this.log(v.Error, 1100, "Your SDK Key seems to be wrong. You can find the valid SDK Key at https://app.configcat.com/sdkkey");
|
|
796
|
+
}, t.prototype.fetchFailedDueToUnexpectedHttpResponse = function(e, r) {
|
|
797
|
+
return this.log(v.Error, 1101, A.from("STATUS_CODE", "REASON_PHRASE")(Ne || (Ne = C(["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""], ["Unexpected HTTP response was received while trying to fetch config JSON: ", " ", ""])), e, r));
|
|
798
|
+
}, t.prototype.fetchFailedDueToRequestTimeout = function(e, r) {
|
|
799
|
+
return this.log(v.Error, 1102, A.from("TIMEOUT")(Le || (Le = C(["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"], ["Request timed out while trying to fetch config JSON. Timeout value: ", "ms"])), e), r);
|
|
800
|
+
}, t.prototype.fetchFailedDueToUnexpectedError = function(e) {
|
|
801
|
+
return this.log(v.Error, 1103, "Unexpected error occurred while trying to fetch config JSON.", e);
|
|
802
|
+
}, t.prototype.fetchFailedDueToRedirectLoop = function() {
|
|
803
|
+
return this.log(v.Error, 1104, "Redirection loop encountered while trying to fetch config JSON. Please contact us at https://configcat.com/support/");
|
|
804
|
+
}, t.prototype.fetchReceived200WithInvalidBody = function() {
|
|
805
|
+
return this.log(v.Error, 1105, "Fetching config JSON was successful but the HTTP response content was invalid.");
|
|
806
|
+
}, t.prototype.fetchReceived304WhenLocalCacheIsEmpty = function(e, r) {
|
|
807
|
+
return this.log(v.Error, 1106, A.from("STATUS_CODE", "REASON_PHRASE")(Re || (Re = C(["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""], ["Unexpected HTTP response was received when no config JSON is cached locally: ", " ", ""])), e, r));
|
|
808
|
+
}, t.prototype.settingForVariationIdIsNotPresent = function(e) {
|
|
809
|
+
return this.log(v.Error, 2011, A.from("VARIATION_ID")(De || (De = C(["Could not find the setting for the specified variation ID: '", "'."], ["Could not find the setting for the specified variation ID: '", "'."])), e));
|
|
810
|
+
}, t.prototype.configServiceCacheReadError = function(e) {
|
|
811
|
+
return this.log(v.Error, 2200, "Error occurred while reading the cache.", e);
|
|
812
|
+
}, t.prototype.configServiceCacheWriteError = function(e) {
|
|
813
|
+
return this.log(v.Error, 2201, "Error occurred while writing the cache.", e);
|
|
814
|
+
}, t.prototype.clientIsAlreadyCreated = function(e) {
|
|
815
|
+
return this.log(v.Warn, 3e3, A.from("SDK_KEY")(Fe || (Fe = C(["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."], ["There is an existing client instance for the specified SDK Key. No new client instance will be created and the specified options are ignored. Returning the existing client instance. SDK Key: '", "'."])), e));
|
|
816
|
+
}, t.prototype.targetingIsNotPossible = function(e) {
|
|
817
|
+
return this.log(v.Warn, 3001, A.from("KEY")(Pe || (Pe = C(["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like `getValueAsync()` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"], ["Cannot evaluate targeting rules and % options for setting '", "' (User Object is missing). You should pass a User Object to the evaluation methods like \\`getValueAsync()\\` in order to make targeting work properly. Read more: https://configcat.com/docs/advanced/user-object/"])), e));
|
|
818
|
+
}, t.prototype.dataGovernanceIsOutOfSync = function() {
|
|
819
|
+
return this.log(v.Warn, 3002, "The `dataGovernance` parameter specified at the client initialization is not in sync with the preferences on the ConfigCat Dashboard. Read more: https://configcat.com/docs/advanced/data-governance/");
|
|
820
|
+
}, t.prototype.configServiceCannotInitiateHttpCalls = function() {
|
|
821
|
+
return this.log(v.Warn, 3200, "Client is in offline mode, it cannot initiate HTTP calls.");
|
|
822
|
+
}, t.prototype.configServiceMethodHasNoEffectDueToDisposedClient = function(e) {
|
|
823
|
+
return this.log(v.Warn, 3201, A.from("METHOD_NAME")(Ue || (Ue = C(["The client object is already disposed, thus `", "()` has no effect."], ["The client object is already disposed, thus \\`", "()\\` has no effect."])), e));
|
|
824
|
+
}, t.prototype.configServiceMethodHasNoEffectDueToOverrideBehavior = function(e, r) {
|
|
825
|
+
return this.log(v.Warn, 3202, A.from("OVERRIDE_BEHAVIOR", "METHOD_NAME")(ke || (ke = C(["Client is configured to use the `", "` override behavior, thus `", "()` has no effect."], ["Client is configured to use the \\`", "\\` override behavior, thus \\`", "()\\` has no effect."])), e, r));
|
|
826
|
+
}, t.prototype.settingEvaluated = function(e) {
|
|
827
|
+
return this.log(v.Info, 5e3, A.from("EVALUATE_LOG")(Me || (Me = C(["", ""], ["", ""])), e));
|
|
828
|
+
}, t.prototype.configServiceStatusChanged = function(e) {
|
|
829
|
+
return this.log(v.Info, 5200, A.from("MODE")(Ve || (Ve = C(["Switched to ", " mode."], ["Switched to ", " mode."])), e.toUpperCase()));
|
|
830
|
+
}, t;
|
|
831
|
+
}()
|
|
832
|
+
), Be = (
|
|
833
|
+
/** @class */
|
|
834
|
+
function() {
|
|
835
|
+
function t(e) {
|
|
836
|
+
e === void 0 && (e = v.Warn), this.level = e, this.SOURCE = "ConfigCat";
|
|
837
|
+
}
|
|
838
|
+
return t.prototype.log = function(e, r, n, i) {
|
|
839
|
+
var o = e === v.Debug ? [console.info, "DEBUG"] : e === v.Info ? [console.info, "INFO"] : e === v.Warn ? [console.warn, "WARN"] : e === v.Error ? [console.error, "ERROR"] : [console.log, v[e].toUpperCase()], s = o[0], a = o[1], c = i !== void 0 ? `
|
|
840
|
+
` + _(i, !0) : "";
|
|
841
|
+
s(this.SOURCE + " - " + a + " - [" + r + "] " + n + c);
|
|
842
|
+
}, t;
|
|
843
|
+
}()
|
|
844
|
+
), Oe, Ce, Ae, Te, we, Ie, Ne, Le, Re, De, Fe, Pe, Ue, ke, Me, Ve;
|
|
801
845
|
function J(t) {
|
|
802
846
|
return !!t.fn;
|
|
803
847
|
}
|
|
804
|
-
var
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
848
|
+
var it = (
|
|
849
|
+
/** @class */
|
|
850
|
+
function() {
|
|
851
|
+
function t() {
|
|
852
|
+
this.events = {}, this.eventCount = 0, this.addListener = this.on, this.off = this.removeListener;
|
|
853
|
+
}
|
|
854
|
+
return t.prototype.addListenerCore = function(e, r, n) {
|
|
855
|
+
if (typeof r != "function")
|
|
856
|
+
throw new TypeError("Listener must be a function");
|
|
857
|
+
var i = this.events[e], o = { fn: r, once: n };
|
|
858
|
+
return i ? J(i) ? this.events[e] = [i, o] : i.push(o) : (this.events[e] = o, this.eventCount++), this;
|
|
859
|
+
}, t.prototype.removeListenerCore = function(e, r, n) {
|
|
860
|
+
var i = this.events[e];
|
|
861
|
+
if (!i)
|
|
862
|
+
return this;
|
|
863
|
+
if (J(i))
|
|
864
|
+
n(i, r) && this.removeEvent(e);
|
|
865
|
+
else
|
|
866
|
+
for (var o = i.length - 1; o >= 0; o--)
|
|
867
|
+
if (n(i[o], r)) {
|
|
868
|
+
i.splice(o, 1), i.length ? i.length === 1 && (this.events[e] = i[0]) : this.removeEvent(e);
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
816
871
|
return this;
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
872
|
+
}, t.prototype.removeEvent = function(e) {
|
|
873
|
+
--this.eventCount === 0 ? this.events = {} : delete this.events[e];
|
|
874
|
+
}, t.prototype.on = function(e, r) {
|
|
875
|
+
return this.addListenerCore(e, r, !1);
|
|
876
|
+
}, t.prototype.once = function(e, r) {
|
|
877
|
+
return this.addListenerCore(e, r, !0);
|
|
878
|
+
}, t.prototype.removeListener = function(e, r) {
|
|
879
|
+
if (typeof r != "function")
|
|
880
|
+
throw new TypeError("Listener must be a function");
|
|
881
|
+
return this.removeListenerCore(e, r, function(n, i) {
|
|
882
|
+
return n.fn === i;
|
|
883
|
+
});
|
|
884
|
+
}, t.prototype.removeAllListeners = function(e) {
|
|
885
|
+
return e ? this.events[e] && this.removeEvent(e) : (this.events = {}, this.eventCount = 0), this;
|
|
886
|
+
}, t.prototype.listeners = function(e) {
|
|
887
|
+
var r = this.events[e];
|
|
888
|
+
if (!r)
|
|
889
|
+
return [];
|
|
890
|
+
if (J(r))
|
|
891
|
+
return [r.fn];
|
|
892
|
+
for (var n = r.length, i = new Array(n), o = 0; o < n; o++)
|
|
893
|
+
i[o] = r[o].fn;
|
|
894
|
+
return i;
|
|
895
|
+
}, t.prototype.listenerCount = function(e) {
|
|
896
|
+
var r = this.events[e];
|
|
897
|
+
return r ? J(r) ? 1 : r.length : 0;
|
|
898
|
+
}, t.prototype.eventNames = function() {
|
|
899
|
+
var e = [];
|
|
900
|
+
if (this.eventCount === 0)
|
|
901
|
+
return e;
|
|
902
|
+
var r = this.events;
|
|
903
|
+
for (var n in r)
|
|
904
|
+
Object.prototype.hasOwnProperty.call(r, n) && e.push(n);
|
|
905
|
+
return Object.getOwnPropertySymbols ? e.concat(Object.getOwnPropertySymbols(r)) : e;
|
|
906
|
+
}, t.prototype.emit = function(e, r, n, i, o) {
|
|
907
|
+
var s, a, c = this.events[e];
|
|
908
|
+
if (!c)
|
|
909
|
+
return !1;
|
|
910
|
+
var u, l;
|
|
911
|
+
J(c) ? (s = [c, 1], u = s[0], l = s[1]) : (c = c.slice(), a = [c[0], c.length], u = a[0], l = a[1]);
|
|
912
|
+
for (var h = arguments.length - 1, p = 0; ; ) {
|
|
913
|
+
switch (u.once && this.removeListenerCore(e, u, function(y, E) {
|
|
914
|
+
return y === E;
|
|
915
|
+
}), h) {
|
|
916
|
+
case 0:
|
|
917
|
+
u.fn.call(this);
|
|
918
|
+
break;
|
|
919
|
+
case 1:
|
|
920
|
+
u.fn.call(this, r);
|
|
921
|
+
break;
|
|
922
|
+
case 2:
|
|
923
|
+
u.fn.call(this, r, n);
|
|
924
|
+
break;
|
|
925
|
+
case 3:
|
|
926
|
+
u.fn.call(this, r, n, i);
|
|
927
|
+
break;
|
|
928
|
+
case 4:
|
|
929
|
+
u.fn.call(this, r, n, i, o);
|
|
930
|
+
break;
|
|
931
|
+
default:
|
|
932
|
+
for (var f = new Array(h), d = 0; d < h; d++)
|
|
933
|
+
f[d] = arguments[d + 1];
|
|
934
|
+
u.fn.apply(this, f);
|
|
935
|
+
break;
|
|
824
936
|
}
|
|
825
|
-
|
|
826
|
-
}, t.prototype.removeEvent = function(e) {
|
|
827
|
-
--this.eventCount === 0 ? this.events = {} : delete this.events[e];
|
|
828
|
-
}, t.prototype.on = function(e, r) {
|
|
829
|
-
return this.addListenerCore(e, r, !1);
|
|
830
|
-
}, t.prototype.once = function(e, r) {
|
|
831
|
-
return this.addListenerCore(e, r, !0);
|
|
832
|
-
}, t.prototype.removeListener = function(e, r) {
|
|
833
|
-
if (typeof r != "function")
|
|
834
|
-
throw new TypeError("Listener must be a function");
|
|
835
|
-
return this.removeListenerCore(e, r, function(n, i) {
|
|
836
|
-
return n.fn === i;
|
|
837
|
-
});
|
|
838
|
-
}, t.prototype.removeAllListeners = function(e) {
|
|
839
|
-
return e ? this.events[e] && this.removeEvent(e) : (this.events = {}, this.eventCount = 0), this;
|
|
840
|
-
}, t.prototype.listeners = function(e) {
|
|
841
|
-
var r = this.events[e];
|
|
842
|
-
if (!r)
|
|
843
|
-
return [];
|
|
844
|
-
if (J(r))
|
|
845
|
-
return [r.fn];
|
|
846
|
-
for (var n = r.length, i = new Array(n), o = 0; o < n; o++)
|
|
847
|
-
i[o] = r[o].fn;
|
|
848
|
-
return i;
|
|
849
|
-
}, t.prototype.listenerCount = function(e) {
|
|
850
|
-
var r = this.events[e];
|
|
851
|
-
return r ? J(r) ? 1 : r.length : 0;
|
|
852
|
-
}, t.prototype.eventNames = function() {
|
|
853
|
-
var e = [];
|
|
854
|
-
if (this.eventCount === 0)
|
|
855
|
-
return e;
|
|
856
|
-
var r = this.events;
|
|
857
|
-
for (var n in r)
|
|
858
|
-
Object.prototype.hasOwnProperty.call(r, n) && e.push(n);
|
|
859
|
-
return Object.getOwnPropertySymbols ? e.concat(Object.getOwnPropertySymbols(r)) : e;
|
|
860
|
-
}, t.prototype.emit = function(e, r, n, i, o) {
|
|
861
|
-
var s, a, c = this.events[e];
|
|
862
|
-
if (!c)
|
|
863
|
-
return !1;
|
|
864
|
-
var u, l;
|
|
865
|
-
J(c) ? (s = [c, 1], u = s[0], l = s[1]) : (c = c.slice(), a = [c[0], c.length], u = a[0], l = a[1]);
|
|
866
|
-
for (var h = arguments.length - 1, p = 0; ; ) {
|
|
867
|
-
switch (u.once && this.removeListenerCore(e, u, function(y, E) {
|
|
868
|
-
return y === E;
|
|
869
|
-
}), h) {
|
|
870
|
-
case 0:
|
|
871
|
-
u.fn.call(this);
|
|
872
|
-
break;
|
|
873
|
-
case 1:
|
|
874
|
-
u.fn.call(this, r);
|
|
875
|
-
break;
|
|
876
|
-
case 2:
|
|
877
|
-
u.fn.call(this, r, n);
|
|
878
|
-
break;
|
|
879
|
-
case 3:
|
|
880
|
-
u.fn.call(this, r, n, i);
|
|
881
|
-
break;
|
|
882
|
-
case 4:
|
|
883
|
-
u.fn.call(this, r, n, i, o);
|
|
884
|
-
break;
|
|
885
|
-
default:
|
|
886
|
-
for (var f = new Array(h), d = 0; d < h; d++)
|
|
887
|
-
f[d] = arguments[d + 1];
|
|
888
|
-
u.fn.apply(this, f);
|
|
937
|
+
if (++p >= l)
|
|
889
938
|
break;
|
|
939
|
+
u = c[p];
|
|
890
940
|
}
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
941
|
+
return !0;
|
|
942
|
+
}, t;
|
|
943
|
+
}()
|
|
944
|
+
), ot = (
|
|
945
|
+
/** @class */
|
|
946
|
+
function() {
|
|
947
|
+
function t() {
|
|
948
|
+
this.addListener = this.on, this.off = this.removeListener;
|
|
894
949
|
}
|
|
895
|
-
return
|
|
896
|
-
|
|
897
|
-
}()
|
|
950
|
+
return t.prototype.on = function() {
|
|
951
|
+
return this;
|
|
952
|
+
}, t.prototype.once = function() {
|
|
953
|
+
return this;
|
|
954
|
+
}, t.prototype.removeListener = function() {
|
|
955
|
+
return this;
|
|
956
|
+
}, t.prototype.removeAllListeners = function() {
|
|
957
|
+
return this;
|
|
958
|
+
}, t.prototype.listeners = function() {
|
|
959
|
+
return [];
|
|
960
|
+
}, t.prototype.listenerCount = function() {
|
|
961
|
+
return 0;
|
|
962
|
+
}, t.prototype.eventNames = function() {
|
|
963
|
+
return [];
|
|
964
|
+
}, t.prototype.emit = function() {
|
|
965
|
+
return !1;
|
|
966
|
+
}, t;
|
|
967
|
+
}()
|
|
968
|
+
), qt = T, xe = new ot(), st = (
|
|
969
|
+
/** @class */
|
|
970
|
+
function() {
|
|
971
|
+
function t(e) {
|
|
972
|
+
this.addListener = this.on, this.off = this.removeListener, this.eventEmitter = e;
|
|
973
|
+
}
|
|
974
|
+
return t.prototype.tryDisconnect = function() {
|
|
975
|
+
var e = this.eventEmitter;
|
|
976
|
+
return this.eventEmitter = xe, e !== xe;
|
|
977
|
+
}, t.prototype.on = function(e, r) {
|
|
978
|
+
return this.eventEmitter.on(e, r), this;
|
|
979
|
+
}, t.prototype.once = function(e, r) {
|
|
980
|
+
return this.eventEmitter.once(e, r), this;
|
|
981
|
+
}, t.prototype.removeListener = function(e, r) {
|
|
982
|
+
return this.eventEmitter.removeListener(e, r), this;
|
|
983
|
+
}, t.prototype.removeAllListeners = function(e) {
|
|
984
|
+
return this.eventEmitter.removeAllListeners(e), this;
|
|
985
|
+
}, t.prototype.listeners = function(e) {
|
|
986
|
+
return this.eventEmitter.listeners(e);
|
|
987
|
+
}, t.prototype.listenerCount = function(e) {
|
|
988
|
+
return this.eventEmitter.listenerCount(e);
|
|
989
|
+
}, t.prototype.eventNames = function() {
|
|
990
|
+
return this.eventEmitter.eventNames();
|
|
991
|
+
}, t.prototype.emit = function(e) {
|
|
992
|
+
for (var r, n = [], i = 1; i < arguments.length; i++)
|
|
993
|
+
n[i - 1] = arguments[i];
|
|
994
|
+
return (r = this.eventEmitter).emit.apply(r, $e([e], n));
|
|
995
|
+
}, t;
|
|
996
|
+
}()
|
|
997
|
+
);
|
|
898
998
|
function oe(t) {
|
|
899
|
-
function e(V,
|
|
900
|
-
var H = V <<
|
|
999
|
+
function e(V, L) {
|
|
1000
|
+
var H = V << L | V >>> 32 - L;
|
|
901
1001
|
return H;
|
|
902
1002
|
}
|
|
903
1003
|
function r(V) {
|
|
904
|
-
for (var
|
|
905
|
-
H = V >>> R * 4 & 15,
|
|
906
|
-
return
|
|
1004
|
+
for (var L = "", H, R = 7; R >= 0; R--)
|
|
1005
|
+
H = V >>> R * 4 & 15, L += H.toString(16);
|
|
1006
|
+
return L;
|
|
907
1007
|
}
|
|
908
1008
|
function n(V) {
|
|
909
1009
|
V = V.replace(/\r\n/g, `
|
|
910
1010
|
`);
|
|
911
|
-
for (var
|
|
1011
|
+
for (var L = "", H = 0; H < V.length; H++) {
|
|
912
1012
|
var R = V.charCodeAt(H);
|
|
913
|
-
R < 128 ?
|
|
1013
|
+
R < 128 ? L += String.fromCharCode(R) : R > 127 && R < 2048 ? (L += String.fromCharCode(R >> 6 | 192), L += String.fromCharCode(R & 63 | 128)) : (L += String.fromCharCode(R >> 12 | 224), L += String.fromCharCode(R >> 6 & 63 | 128), L += String.fromCharCode(R & 63 | 128));
|
|
914
1014
|
}
|
|
915
|
-
return
|
|
1015
|
+
return L;
|
|
916
1016
|
}
|
|
917
|
-
var i, o, s, a = new Array(80), c = 1732584193, u = 4023233417, l = 2562383102, h = 271733878, p = 3285377520, f, d, y, E,
|
|
1017
|
+
var i, o, s, a = new Array(80), c = 1732584193, u = 4023233417, l = 2562383102, h = 271733878, p = 3285377520, f, d, y, E, N, U;
|
|
918
1018
|
t = n(t);
|
|
919
1019
|
var D = t.length, F = new Array();
|
|
920
1020
|
for (o = 0; o < D - 3; o += 4)
|
|
@@ -940,15 +1040,15 @@ function oe(t) {
|
|
|
940
1040
|
a[o] = F[i + o];
|
|
941
1041
|
for (o = 16; o <= 79; o++)
|
|
942
1042
|
a[o] = e(a[o - 3] ^ a[o - 8] ^ a[o - 14] ^ a[o - 16], 1);
|
|
943
|
-
for (f = c, d = u, y = l, E = h,
|
|
944
|
-
U = e(f, 5) + (d & y | ~d & E) +
|
|
1043
|
+
for (f = c, d = u, y = l, E = h, N = p, o = 0; o <= 19; o++)
|
|
1044
|
+
U = e(f, 5) + (d & y | ~d & E) + N + a[o] + 1518500249 & 4294967295, N = E, E = y, y = e(d, 30), d = f, f = U;
|
|
945
1045
|
for (o = 20; o <= 39; o++)
|
|
946
|
-
U = e(f, 5) + (d ^ y ^ E) +
|
|
1046
|
+
U = e(f, 5) + (d ^ y ^ E) + N + a[o] + 1859775393 & 4294967295, N = E, E = y, y = e(d, 30), d = f, f = U;
|
|
947
1047
|
for (o = 40; o <= 59; o++)
|
|
948
|
-
U = e(f, 5) + (d & y | d & E | y & E) +
|
|
1048
|
+
U = e(f, 5) + (d & y | d & E | y & E) + N + a[o] + 2400959708 & 4294967295, N = E, E = y, y = e(d, 30), d = f, f = U;
|
|
949
1049
|
for (o = 60; o <= 79; o++)
|
|
950
|
-
U = e(f, 5) + (d ^ y ^ E) +
|
|
951
|
-
c = c + f & 4294967295, u = u + d & 4294967295, l = l + y & 4294967295, h = h + E & 4294967295, p = p +
|
|
1050
|
+
U = e(f, 5) + (d ^ y ^ E) + N + a[o] + 3395469782 & 4294967295, N = E, E = y, y = e(d, 30), d = f, f = U;
|
|
1051
|
+
c = c + f & 4294967295, u = u + d & 4294967295, l = l + y & 4294967295, h = h + E & 4294967295, p = p + N & 4294967295;
|
|
952
1052
|
}
|
|
953
1053
|
return (r(c) + r(u) + r(l) + r(h) + r(p)).toLowerCase();
|
|
954
1054
|
}
|
|
@@ -960,170 +1060,194 @@ var ue;
|
|
|
960
1060
|
(function(t) {
|
|
961
1061
|
t[t.Global = 0] = "Global", t[t.EuOnly = 1] = "EuOnly";
|
|
962
1062
|
})(ue || (ue = {}));
|
|
963
|
-
var Ee =
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
this.hooks = new et(l), this.readyPromise = new Promise(function(f) {
|
|
978
|
-
return s.hooks.once("clientReady", f);
|
|
979
|
-
});
|
|
980
|
-
var h, p;
|
|
981
|
-
if (n) {
|
|
982
|
-
if (h = n.logger, p = n.cache, n.requestTimeoutMs) {
|
|
983
|
-
if (n.requestTimeoutMs < 0)
|
|
984
|
-
throw new Error("Invalid 'requestTimeoutMs' value");
|
|
985
|
-
this.requestTimeoutMs = n.requestTimeoutMs;
|
|
1063
|
+
var Ee = (
|
|
1064
|
+
/** @class */
|
|
1065
|
+
function() {
|
|
1066
|
+
function t(e, r, n, i, o) {
|
|
1067
|
+
var s = this, a, c, u;
|
|
1068
|
+
if (this.requestTimeoutMs = 3e4, this.baseUrlOverriden = !1, this.proxy = "", this.offline = !1, !e)
|
|
1069
|
+
throw new Error("Invalid 'apiKey' value");
|
|
1070
|
+
switch (this.apiKey = e, this.clientVersion = r, this.dataGovernance = (a = n == null ? void 0 : n.dataGovernance) !== null && a !== void 0 ? a : ue.Global, this.dataGovernance) {
|
|
1071
|
+
case ue.EuOnly:
|
|
1072
|
+
this.baseUrl = "https://cdn-eu.configcat.com";
|
|
1073
|
+
break;
|
|
1074
|
+
default:
|
|
1075
|
+
this.baseUrl = "https://cdn-global.configcat.com";
|
|
1076
|
+
break;
|
|
986
1077
|
}
|
|
987
|
-
|
|
1078
|
+
var l = (c = o == null ? void 0 : o()) !== null && c !== void 0 ? c : new it();
|
|
1079
|
+
this.hooks = new st(l), this.readyPromise = new Promise(function(f) {
|
|
1080
|
+
return s.hooks.once("clientReady", f);
|
|
1081
|
+
});
|
|
1082
|
+
var h, p;
|
|
1083
|
+
if (n) {
|
|
1084
|
+
if (h = n.logger, p = n.cache, n.requestTimeoutMs) {
|
|
1085
|
+
if (n.requestTimeoutMs < 0)
|
|
1086
|
+
throw new Error("Invalid 'requestTimeoutMs' value");
|
|
1087
|
+
this.requestTimeoutMs = n.requestTimeoutMs;
|
|
1088
|
+
}
|
|
1089
|
+
n.baseUrl && (this.baseUrl = n.baseUrl, this.baseUrlOverriden = !0), n.proxy && (this.proxy = n.proxy), n.flagOverrides && (this.flagOverrides = n.flagOverrides), n.defaultUser && (this.defaultUser = n.defaultUser), n.offline && (this.offline = n.offline), (u = n.setupHooks) === null || u === void 0 || u.call(n, this.hooks);
|
|
1090
|
+
}
|
|
1091
|
+
this.logger = new nt(h ?? new Be(), this.hooks), this.cache = p ? new ze(p, this.logger) : i ? i(this) : new rt();
|
|
988
1092
|
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1093
|
+
return t.prototype.getUrl = function() {
|
|
1094
|
+
return this.baseUrl + "/configuration-files/" + this.apiKey + "/" + t.configFileName + "?sdk=" + this.clientVersion;
|
|
1095
|
+
}, t.prototype.getCacheKey = function() {
|
|
1096
|
+
return oe(this.apiKey + "_" + t.configFileName + "_" + M.serializationFormatVersion);
|
|
1097
|
+
}, t.configFileName = "config_v5.json", t;
|
|
1098
|
+
}()
|
|
1099
|
+
), He = (
|
|
1100
|
+
/** @class */
|
|
1101
|
+
function(t) {
|
|
1102
|
+
B(e, t);
|
|
1103
|
+
function e(r, n, i, o, s, a) {
|
|
1104
|
+
var c = t.call(this, r, n + "/a-" + i, o, s, a) || this;
|
|
1105
|
+
c.pollIntervalSeconds = 60, c.maxInitWaitTimeSeconds = 5, o && (o.pollIntervalSeconds !== void 0 && o.pollIntervalSeconds !== null && (c.pollIntervalSeconds = o.pollIntervalSeconds), o.maxInitWaitTimeSeconds !== void 0 && o.maxInitWaitTimeSeconds !== null && (c.maxInitWaitTimeSeconds = o.maxInitWaitTimeSeconds));
|
|
1106
|
+
var u = 2147483;
|
|
1107
|
+
if (!(typeof c.pollIntervalSeconds == "number" && 1 <= c.pollIntervalSeconds && c.pollIntervalSeconds <= u))
|
|
1108
|
+
throw new Error("Invalid 'pollIntervalSeconds' value");
|
|
1109
|
+
if (!(typeof c.maxInitWaitTimeSeconds == "number" && c.maxInitWaitTimeSeconds <= u))
|
|
1110
|
+
throw new Error("Invalid 'maxInitWaitTimeSeconds' value");
|
|
1111
|
+
return c;
|
|
1112
|
+
}
|
|
1113
|
+
return e;
|
|
1114
|
+
}(Ee)
|
|
1115
|
+
), je = (
|
|
1116
|
+
/** @class */
|
|
1117
|
+
function(t) {
|
|
1118
|
+
B(e, t);
|
|
1119
|
+
function e(r, n, i, o, s, a) {
|
|
1120
|
+
return t.call(this, r, n + "/m-" + i, o, s, a) || this;
|
|
1121
|
+
}
|
|
1122
|
+
return e;
|
|
1123
|
+
}(Ee)
|
|
1124
|
+
), qe = (
|
|
1125
|
+
/** @class */
|
|
1126
|
+
function(t) {
|
|
1127
|
+
B(e, t);
|
|
1128
|
+
function e(r, n, i, o, s, a) {
|
|
1129
|
+
var c = t.call(this, r, n + "/l-" + i, o, s, a) || this;
|
|
1130
|
+
if (c.cacheTimeToLiveSeconds = 60, o && o.cacheTimeToLiveSeconds !== void 0 && o.cacheTimeToLiveSeconds !== null && (c.cacheTimeToLiveSeconds = o.cacheTimeToLiveSeconds), !(typeof c.cacheTimeToLiveSeconds == "number" && 1 <= c.cacheTimeToLiveSeconds && c.cacheTimeToLiveSeconds <= 2147483647))
|
|
1131
|
+
throw new Error("Invalid 'cacheTimeToLiveSeconds' value");
|
|
1132
|
+
return c;
|
|
1133
|
+
}
|
|
1134
|
+
return e;
|
|
1135
|
+
}(Ee)
|
|
1136
|
+
), P;
|
|
1025
1137
|
(function(t) {
|
|
1026
1138
|
t[t.LocalOnly = 0] = "LocalOnly", t[t.LocalOverRemote = 1] = "LocalOverRemote", t[t.RemoteOverLocal = 2] = "RemoteOverLocal";
|
|
1027
1139
|
})(P || (P = {}));
|
|
1028
|
-
var
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
return
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
var
|
|
1057
|
-
return
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
case 2:
|
|
1064
|
-
return i = o.sent(), n = i[1], [3, 4];
|
|
1065
|
-
case 3:
|
|
1066
|
-
r(this.options.logger), o.label = 4;
|
|
1067
|
-
case 4:
|
|
1068
|
-
return [2, n];
|
|
1069
|
-
case 5:
|
|
1070
|
-
return this.options.logger.debug("LazyLoadConfigService.getConfig(): cache is valid, returning from cache."), [2, n];
|
|
1140
|
+
var at = (
|
|
1141
|
+
/** @class */
|
|
1142
|
+
function() {
|
|
1143
|
+
function t(e) {
|
|
1144
|
+
this.map = {}, this.map = Object.fromEntries(Object.entries(e).map(function(r) {
|
|
1145
|
+
var n = r[0], i = r[1];
|
|
1146
|
+
return [n, _e.fromValue(i)];
|
|
1147
|
+
}));
|
|
1148
|
+
}
|
|
1149
|
+
return t.prototype.getOverrides = function() {
|
|
1150
|
+
return Promise.resolve(this.map);
|
|
1151
|
+
}, t.prototype.getOverridesSync = function() {
|
|
1152
|
+
return this.map;
|
|
1153
|
+
}, t;
|
|
1154
|
+
}()
|
|
1155
|
+
), ut = (
|
|
1156
|
+
/** @class */
|
|
1157
|
+
function() {
|
|
1158
|
+
function t(e, r) {
|
|
1159
|
+
this.dataSource = e, this.behaviour = r;
|
|
1160
|
+
}
|
|
1161
|
+
return t;
|
|
1162
|
+
}()
|
|
1163
|
+
), ct = (
|
|
1164
|
+
/** @class */
|
|
1165
|
+
function(t) {
|
|
1166
|
+
B(e, t);
|
|
1167
|
+
function e(r, n) {
|
|
1168
|
+
var i = t.call(this, r, n) || this;
|
|
1169
|
+
return i.cacheTimeToLiveMs = n.cacheTimeToLiveSeconds * 1e3, t.prototype.syncUpWithCache.call(i), i;
|
|
1170
|
+
}
|
|
1171
|
+
return e.prototype.getConfig = function() {
|
|
1172
|
+
return S(this, void 0, void 0, function() {
|
|
1173
|
+
function r(o, s) {
|
|
1174
|
+
s === void 0 && (s = ""), o.debug("LazyLoadConfigService.getConfig(): cache is empty or expired" + s + ".");
|
|
1071
1175
|
}
|
|
1176
|
+
var n, i;
|
|
1177
|
+
return O(this, function(o) {
|
|
1178
|
+
switch (o.label) {
|
|
1179
|
+
case 0:
|
|
1180
|
+
return this.options.logger.debug("LazyLoadConfigService.getConfig() called."), [4, this.options.cache.get(this.cacheKey)];
|
|
1181
|
+
case 1:
|
|
1182
|
+
return n = o.sent(), n.isExpired(this.cacheTimeToLiveMs) ? this.isOffline ? [3, 3] : (r(this.options.logger, ", calling refreshConfigCoreAsync()"), [4, this.refreshConfigCoreAsync(n)]) : [3, 5];
|
|
1183
|
+
case 2:
|
|
1184
|
+
return i = o.sent(), n = i[1], [3, 4];
|
|
1185
|
+
case 3:
|
|
1186
|
+
r(this.options.logger), o.label = 4;
|
|
1187
|
+
case 4:
|
|
1188
|
+
return [2, n];
|
|
1189
|
+
case 5:
|
|
1190
|
+
return this.options.logger.debug("LazyLoadConfigService.getConfig(): cache is valid, returning from cache."), [2, n];
|
|
1191
|
+
}
|
|
1192
|
+
});
|
|
1072
1193
|
});
|
|
1073
|
-
})
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
}
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
function
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1194
|
+
}, e.prototype.refreshConfigAsync = function() {
|
|
1195
|
+
return this.options.logger.debug("LazyLoadConfigService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
|
|
1196
|
+
}, e.prototype.getCacheState = function(r) {
|
|
1197
|
+
return r.isEmpty ? T.NoFlagData : r.isExpired(this.cacheTimeToLiveMs) ? T.HasCachedFlagDataOnly : T.HasUpToDateFlagData;
|
|
1198
|
+
}, e;
|
|
1199
|
+
}(me)
|
|
1200
|
+
), lt = (
|
|
1201
|
+
/** @class */
|
|
1202
|
+
function(t) {
|
|
1203
|
+
B(e, t);
|
|
1204
|
+
function e(r, n) {
|
|
1205
|
+
var i = t.call(this, r, n) || this;
|
|
1206
|
+
return t.prototype.syncUpWithCache.call(i), i;
|
|
1207
|
+
}
|
|
1208
|
+
return e.prototype.getCacheState = function(r) {
|
|
1209
|
+
return r.isEmpty ? T.NoFlagData : T.HasCachedFlagDataOnly;
|
|
1210
|
+
}, e.prototype.getConfig = function() {
|
|
1211
|
+
return S(this, void 0, void 0, function() {
|
|
1212
|
+
return O(this, function(r) {
|
|
1213
|
+
switch (r.label) {
|
|
1214
|
+
case 0:
|
|
1215
|
+
return this.options.logger.debug("ManualPollService.getConfig() called."), [4, this.options.cache.get(this.cacheKey)];
|
|
1216
|
+
case 1:
|
|
1217
|
+
return [2, r.sent()];
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1096
1220
|
});
|
|
1097
|
-
})
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
function
|
|
1103
|
-
typeof Object.values > "u" && (Object.values =
|
|
1221
|
+
}, e.prototype.refreshConfigAsync = function() {
|
|
1222
|
+
return this.options.logger.debug("ManualPollService.refreshConfigAsync() called."), t.prototype.refreshConfigAsync.call(this);
|
|
1223
|
+
}, e;
|
|
1224
|
+
}(me)
|
|
1225
|
+
);
|
|
1226
|
+
function ft() {
|
|
1227
|
+
typeof Object.values > "u" && (Object.values = ht), typeof Object.entries > "u" && (Object.entries = gt), typeof Object.fromEntries > "u" && (Object.fromEntries = pt);
|
|
1104
1228
|
}
|
|
1105
|
-
function
|
|
1229
|
+
function ht(t) {
|
|
1106
1230
|
for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
1107
1231
|
var i = n[r];
|
|
1108
1232
|
e.push(t[i]);
|
|
1109
1233
|
}
|
|
1110
1234
|
return e;
|
|
1111
1235
|
}
|
|
1112
|
-
function
|
|
1236
|
+
function gt(t) {
|
|
1113
1237
|
for (var e = [], r = 0, n = Object.keys(t); r < n.length; r++) {
|
|
1114
1238
|
var i = n[r];
|
|
1115
1239
|
e.push([i, t[i]]);
|
|
1116
1240
|
}
|
|
1117
1241
|
return e;
|
|
1118
1242
|
}
|
|
1119
|
-
function
|
|
1243
|
+
function pt(t) {
|
|
1120
1244
|
var e, r = {};
|
|
1121
1245
|
if (Array.isArray(t))
|
|
1122
1246
|
for (var n = 0, i = t; n < i.length; n++) {
|
|
1123
1247
|
var o = i[n], s = o[0], a = o[1];
|
|
1124
1248
|
r[s] = a;
|
|
1125
1249
|
}
|
|
1126
|
-
else if (typeof Symbol < "u" && (t
|
|
1250
|
+
else if (typeof Symbol < "u" && (t != null && t[Symbol.iterator]))
|
|
1127
1251
|
for (var c = t[Symbol.iterator](), u = void 0, l = void 0; e = c.next(), u = e.value, l = e.done, !l; ) {
|
|
1128
1252
|
var s = u[0], a = u[1];
|
|
1129
1253
|
r[s] = a;
|
|
@@ -1132,7 +1256,7 @@ function gt(t) {
|
|
|
1132
1256
|
throw new TypeError("Object.fromEntries() requires a single iterable argument");
|
|
1133
1257
|
return r;
|
|
1134
1258
|
}
|
|
1135
|
-
function
|
|
1259
|
+
function dt() {
|
|
1136
1260
|
var t = function(e) {
|
|
1137
1261
|
this.target = e;
|
|
1138
1262
|
};
|
|
@@ -1140,13 +1264,14 @@ function pt() {
|
|
|
1140
1264
|
return this.target;
|
|
1141
1265
|
}, t.isFallback = !0, t;
|
|
1142
1266
|
}
|
|
1143
|
-
var
|
|
1267
|
+
var vt = function() {
|
|
1144
1268
|
return typeof WeakRef == "function";
|
|
1145
1269
|
}, We = /^[0-9]+$/, $ = function(t, e) {
|
|
1146
1270
|
var r = We.test(t), n = We.test(e);
|
|
1147
1271
|
return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1;
|
|
1148
|
-
}, ve = 256, te = Number.MAX_SAFE_INTEGER ||
|
|
1149
|
-
|
|
1272
|
+
}, ve = 256, te = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
1273
|
+
9007199254740991, Z = [], b = [], m = {}, yt = 0, w = function(t, e) {
|
|
1274
|
+
var r = yt++;
|
|
1150
1275
|
m[t] = r, b[r] = e, Z[r] = new RegExp(e);
|
|
1151
1276
|
};
|
|
1152
1277
|
w("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
@@ -1164,125 +1289,128 @@ w("FULLPLAIN", "v?" + b[m.MAINVERSION] + b[m.PRERELEASE] + "?" + b[m.BUILD] + "?
|
|
|
1164
1289
|
w("FULL", "^" + b[m.FULLPLAIN] + "$");
|
|
1165
1290
|
w("LOOSEPLAIN", "[v=\\s]*" + b[m.MAINVERSIONLOOSE] + b[m.PRERELEASELOOSE] + "?" + b[m.BUILD] + "?");
|
|
1166
1291
|
w("LOOSE", "^" + b[m.LOOSEPLAIN] + "$");
|
|
1167
|
-
var ce =
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
if (
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version;
|
|
1201
|
-
}, t.prototype.toString = function() {
|
|
1202
|
-
return this.version;
|
|
1203
|
-
}, t.prototype.compare = function(e) {
|
|
1204
|
-
if (!(e instanceof t)) {
|
|
1205
|
-
if (typeof e == "string" && e === this.version)
|
|
1206
|
-
return 0;
|
|
1207
|
-
e = new t(e, this.options);
|
|
1292
|
+
var ce = (
|
|
1293
|
+
/** @class */
|
|
1294
|
+
function() {
|
|
1295
|
+
function t(e, r) {
|
|
1296
|
+
if ((!r || typeof r != "object") && (r = {
|
|
1297
|
+
loose: !!r,
|
|
1298
|
+
includePrerelease: !1
|
|
1299
|
+
}), e instanceof t) {
|
|
1300
|
+
if (e.loose === !!r.loose && e.includePrerelease === !!r.includePrerelease)
|
|
1301
|
+
return e;
|
|
1302
|
+
e = e.version;
|
|
1303
|
+
} else if (typeof e != "string")
|
|
1304
|
+
throw new TypeError("Invalid Version: " + e);
|
|
1305
|
+
if (e.length > ve)
|
|
1306
|
+
throw new TypeError("version is longer than " + ve + " characters");
|
|
1307
|
+
this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
|
|
1308
|
+
var n = e.trim().match(r.loose ? Z[m.LOOSE] : Z[m.FULL]);
|
|
1309
|
+
if (!n)
|
|
1310
|
+
throw new TypeError("Invalid Version: " + e);
|
|
1311
|
+
if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > te || this.major < 0)
|
|
1312
|
+
throw new TypeError("Invalid major version");
|
|
1313
|
+
if (this.minor > te || this.minor < 0)
|
|
1314
|
+
throw new TypeError("Invalid minor version");
|
|
1315
|
+
if (this.patch > te || this.patch < 0)
|
|
1316
|
+
throw new TypeError("Invalid patch version");
|
|
1317
|
+
n[4] ? this.prerelease = n[4].split(".").map(function(i) {
|
|
1318
|
+
if (/^[0-9]+$/.test(i)) {
|
|
1319
|
+
var o = +i;
|
|
1320
|
+
if (o >= 0 && o < te)
|
|
1321
|
+
return o;
|
|
1322
|
+
}
|
|
1323
|
+
return i;
|
|
1324
|
+
}) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format();
|
|
1208
1325
|
}
|
|
1209
|
-
return
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
if (i === void 0)
|
|
1225
|
-
return 1;
|
|
1226
|
-
if (n === void 0)
|
|
1326
|
+
return t.prototype.format = function() {
|
|
1327
|
+
return this.version = this.major + "." + this.minor + "." + this.patch, this.prerelease.length && (this.version += "-" + this.prerelease.join(".")), this.version;
|
|
1328
|
+
}, t.prototype.toString = function() {
|
|
1329
|
+
return this.version;
|
|
1330
|
+
}, t.prototype.compare = function(e) {
|
|
1331
|
+
if (!(e instanceof t)) {
|
|
1332
|
+
if (typeof e == "string" && e === this.version)
|
|
1333
|
+
return 0;
|
|
1334
|
+
e = new t(e, this.options);
|
|
1335
|
+
}
|
|
1336
|
+
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
1337
|
+
}, t.prototype.compareMain = function(e) {
|
|
1338
|
+
return e instanceof t || (e = new t(e, this.options)), $(this.major, e.major) || $(this.minor, e.minor) || $(this.patch, e.patch);
|
|
1339
|
+
}, t.prototype.comparePre = function(e) {
|
|
1340
|
+
if (e instanceof t || (e = new t(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
1227
1341
|
return -1;
|
|
1228
|
-
if (
|
|
1229
|
-
continue;
|
|
1230
|
-
return $(n, i);
|
|
1231
|
-
} while (++r);
|
|
1232
|
-
}, t.prototype.compareBuild = function(e) {
|
|
1233
|
-
e instanceof t || (e = new t(e, this.options));
|
|
1234
|
-
var r = 0;
|
|
1235
|
-
do {
|
|
1236
|
-
var n = this.build[r], i = e.build[r];
|
|
1237
|
-
if (n === void 0 && i === void 0)
|
|
1238
|
-
return 0;
|
|
1239
|
-
if (i === void 0)
|
|
1342
|
+
if (!this.prerelease.length && e.prerelease.length)
|
|
1240
1343
|
return 1;
|
|
1241
|
-
if (
|
|
1242
|
-
return
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
(
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1344
|
+
if (!this.prerelease.length && !e.prerelease.length)
|
|
1345
|
+
return 0;
|
|
1346
|
+
var r = 0;
|
|
1347
|
+
do {
|
|
1348
|
+
var n = this.prerelease[r], i = e.prerelease[r];
|
|
1349
|
+
if (n === void 0 && i === void 0)
|
|
1350
|
+
return 0;
|
|
1351
|
+
if (i === void 0)
|
|
1352
|
+
return 1;
|
|
1353
|
+
if (n === void 0)
|
|
1354
|
+
return -1;
|
|
1355
|
+
if (n === i)
|
|
1356
|
+
continue;
|
|
1357
|
+
return $(n, i);
|
|
1358
|
+
} while (++r);
|
|
1359
|
+
}, t.prototype.compareBuild = function(e) {
|
|
1360
|
+
e instanceof t || (e = new t(e, this.options));
|
|
1361
|
+
var r = 0;
|
|
1362
|
+
do {
|
|
1363
|
+
var n = this.build[r], i = e.build[r];
|
|
1364
|
+
if (n === void 0 && i === void 0)
|
|
1365
|
+
return 0;
|
|
1366
|
+
if (i === void 0)
|
|
1367
|
+
return 1;
|
|
1368
|
+
if (n === void 0)
|
|
1369
|
+
return -1;
|
|
1370
|
+
if (n === i)
|
|
1371
|
+
continue;
|
|
1372
|
+
return $(n, i);
|
|
1373
|
+
} while (++r);
|
|
1374
|
+
}, t.prototype.inc = function(e, r) {
|
|
1375
|
+
switch (e) {
|
|
1376
|
+
case "premajor":
|
|
1377
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", r);
|
|
1378
|
+
break;
|
|
1379
|
+
case "preminor":
|
|
1380
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", r);
|
|
1381
|
+
break;
|
|
1382
|
+
case "prepatch":
|
|
1383
|
+
this.prerelease.length = 0, this.inc("patch", r), this.inc("pre", r);
|
|
1384
|
+
break;
|
|
1385
|
+
case "prerelease":
|
|
1386
|
+
this.prerelease.length === 0 && this.inc("patch", r), this.inc("pre", r);
|
|
1387
|
+
break;
|
|
1388
|
+
case "major":
|
|
1389
|
+
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
1390
|
+
break;
|
|
1391
|
+
case "minor":
|
|
1392
|
+
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
1393
|
+
break;
|
|
1394
|
+
case "patch":
|
|
1395
|
+
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
1396
|
+
break;
|
|
1397
|
+
case "pre":
|
|
1398
|
+
if (this.prerelease.length === 0)
|
|
1399
|
+
this.prerelease = [0];
|
|
1400
|
+
else {
|
|
1401
|
+
for (var n = this.prerelease.length; --n >= 0; )
|
|
1402
|
+
typeof this.prerelease[n] == "number" && (this.prerelease[n]++, n = -2);
|
|
1403
|
+
n === -1 && this.prerelease.push(0);
|
|
1404
|
+
}
|
|
1405
|
+
r && (this.prerelease[0] === r ? isNaN(this.prerelease[1]) && (this.prerelease = [r, 0]) : this.prerelease = [r, 0]);
|
|
1406
|
+
break;
|
|
1407
|
+
default:
|
|
1408
|
+
throw new Error("invalid increment argument: " + e);
|
|
1409
|
+
}
|
|
1410
|
+
return this.format(), this.raw = this.version, this;
|
|
1411
|
+
}, t;
|
|
1412
|
+
}()
|
|
1413
|
+
), mt = function(t, e) {
|
|
1286
1414
|
if ((!e || typeof e != "object") && (e = {
|
|
1287
1415
|
loose: !!e,
|
|
1288
1416
|
includePrerelease: !1
|
|
@@ -1301,257 +1429,266 @@ var ce = function() {
|
|
|
1301
1429
|
}, G = function(t, e, r) {
|
|
1302
1430
|
return new ce(t, r).compare(new ce(e, r));
|
|
1303
1431
|
}, W = function(t) {
|
|
1304
|
-
var e =
|
|
1432
|
+
var e = mt(t, !1);
|
|
1305
1433
|
return e ? e.version : null;
|
|
1306
|
-
}, mt = function(t, e) {
|
|
1307
|
-
return G(t, e, !0) === 0;
|
|
1308
1434
|
}, Et = function(t, e) {
|
|
1309
|
-
return G(t, e, !
|
|
1435
|
+
return G(t, e, !0) === 0;
|
|
1310
1436
|
}, bt = function(t, e) {
|
|
1311
|
-
return G(t, e, !1)
|
|
1437
|
+
return G(t, e, !1) === 0;
|
|
1312
1438
|
}, St = function(t, e) {
|
|
1313
|
-
return G(t, e, !1)
|
|
1439
|
+
return G(t, e, !1) < 0;
|
|
1314
1440
|
}, Ot = function(t, e) {
|
|
1315
|
-
return G(t, e, !1)
|
|
1441
|
+
return G(t, e, !1) <= 0;
|
|
1316
1442
|
}, Ct = function(t, e) {
|
|
1443
|
+
return G(t, e, !1) > 0;
|
|
1444
|
+
}, At = function(t, e) {
|
|
1317
1445
|
return G(t, e, !1) >= 0;
|
|
1318
|
-
},
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
}(), At = function() {
|
|
1324
|
-
function t(e) {
|
|
1325
|
-
this.logger = e;
|
|
1326
|
-
}
|
|
1327
|
-
return t.prototype.evaluate = function(e, r, n, i, o) {
|
|
1328
|
-
if (this.logger.debug("RolloutEvaluator.Evaluate() called."), e.type < 0 && !Je(e.value))
|
|
1329
|
-
throw new TypeError(e.value === null ? "Setting value is null." : e.value === void 0 ? "Setting value is undefined." : "Setting value '" + e.value + "' is of an unsupported type (" + typeof e.value + ").");
|
|
1330
|
-
var s = new wt();
|
|
1331
|
-
s.user = i, s.keyName = r, s.returnValue = n;
|
|
1332
|
-
var a;
|
|
1333
|
-
try {
|
|
1334
|
-
if (i) {
|
|
1335
|
-
if (a = this.evaluateRules(e.targetingRules, i, s), a !== null || (a = this.evaluatePercentageRules(e.percentageOptions, r, i), e.percentageOptions && e.percentageOptions.length > 0 && s.opAppendLine("Evaluating % options => " + (a ? "user targeted" : "user not targeted")), a !== null))
|
|
1336
|
-
return s.returnValue = a.value, a;
|
|
1337
|
-
} else
|
|
1338
|
-
(e.targetingRules && e.targetingRules.length > 0 || e.percentageOptions && e.percentageOptions.length > 0) && this.logger.targetingIsNotPossible(r);
|
|
1339
|
-
return a = {
|
|
1340
|
-
value: e.value,
|
|
1341
|
-
variationId: e.variationId
|
|
1342
|
-
}, s.returnValue = a.value, a;
|
|
1343
|
-
} finally {
|
|
1344
|
-
this.logger.settingEvaluated(s);
|
|
1446
|
+
}, Wt = (
|
|
1447
|
+
/** @class */
|
|
1448
|
+
function() {
|
|
1449
|
+
function t(e, r, n, i) {
|
|
1450
|
+
this.custom = {}, this.identifier = e, this.email = r, this.country = n, this.custom = i || {};
|
|
1345
1451
|
}
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
if (l.indexOf(p) !== -1)
|
|
1373
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1374
|
-
f += "no match";
|
|
1375
|
-
break;
|
|
1376
|
-
case g.NotContains:
|
|
1377
|
-
if (l.indexOf(p) === -1)
|
|
1378
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1379
|
-
f += "no match";
|
|
1380
|
-
break;
|
|
1381
|
-
case g.SemVerIn:
|
|
1382
|
-
case g.SemVerNotIn:
|
|
1383
|
-
case g.SemVerLessThan:
|
|
1384
|
-
case g.SemVerLessThanEqual:
|
|
1385
|
-
case g.SemVerGreaterThan:
|
|
1386
|
-
case g.SemVerGreaterThanEqual:
|
|
1387
|
-
if (o.evaluateSemver(l, p, h))
|
|
1388
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1389
|
-
f += "no match";
|
|
1390
|
-
break;
|
|
1391
|
-
case g.NumberEqual:
|
|
1392
|
-
case g.NumberNotEqual:
|
|
1393
|
-
case g.NumberLessThan:
|
|
1394
|
-
case g.NumberLessThanEqual:
|
|
1395
|
-
case g.NumberGreaterThan:
|
|
1396
|
-
case g.NumberGreaterThanEqual:
|
|
1397
|
-
if (o.evaluateNumber(l, p, h))
|
|
1398
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1399
|
-
f += "no match";
|
|
1400
|
-
break;
|
|
1401
|
-
case g.SensitiveOneOf: {
|
|
1402
|
-
for (var I = p.split(","), U = oe(l), E = 0; E < I.length; E++)
|
|
1403
|
-
if (I[E].trim() === U)
|
|
1404
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1405
|
-
f += "no match";
|
|
1406
|
-
break;
|
|
1407
|
-
}
|
|
1408
|
-
case g.SensitiveNotOneOf: {
|
|
1409
|
-
var D = oe(l);
|
|
1410
|
-
if (!p.split(",").some(function(F) {
|
|
1411
|
-
return F.trim() === D;
|
|
1412
|
-
}))
|
|
1413
|
-
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1414
|
-
f += "no match";
|
|
1415
|
-
break;
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
n.opAppendLine(f);
|
|
1419
|
-
}, o = this, s = 0; s < e.length; s++) {
|
|
1420
|
-
var a = i(s);
|
|
1421
|
-
if (typeof a == "object")
|
|
1422
|
-
return a.value;
|
|
1452
|
+
return t;
|
|
1453
|
+
}()
|
|
1454
|
+
), Tt = (
|
|
1455
|
+
/** @class */
|
|
1456
|
+
function() {
|
|
1457
|
+
function t(e) {
|
|
1458
|
+
this.logger = e;
|
|
1459
|
+
}
|
|
1460
|
+
return t.prototype.evaluate = function(e, r, n, i, o) {
|
|
1461
|
+
if (this.logger.debug("RolloutEvaluator.Evaluate() called."), e.type < 0 && !Je(e.value))
|
|
1462
|
+
throw new TypeError(e.value === null ? "Setting value is null." : e.value === void 0 ? "Setting value is undefined." : "Setting value '" + e.value + "' is of an unsupported type (" + typeof e.value + ").");
|
|
1463
|
+
var s = new wt();
|
|
1464
|
+
s.user = i, s.keyName = r, s.returnValue = n;
|
|
1465
|
+
var a;
|
|
1466
|
+
try {
|
|
1467
|
+
if (i) {
|
|
1468
|
+
if (a = this.evaluateRules(e.targetingRules, i, s), a !== null || (a = this.evaluatePercentageRules(e.percentageOptions, r, i), e.percentageOptions && e.percentageOptions.length > 0 && s.opAppendLine("Evaluating % options => " + (a ? "user targeted" : "user not targeted")), a !== null))
|
|
1469
|
+
return s.returnValue = a.value, a;
|
|
1470
|
+
} else
|
|
1471
|
+
(e.targetingRules && e.targetingRules.length > 0 || e.percentageOptions && e.percentageOptions.length > 0) && this.logger.targetingIsNotPossible(r);
|
|
1472
|
+
return a = {
|
|
1473
|
+
value: e.value,
|
|
1474
|
+
variationId: e.variationId
|
|
1475
|
+
}, s.returnValue = a.value, a;
|
|
1476
|
+
} finally {
|
|
1477
|
+
this.logger.settingEvaluated(s);
|
|
1423
1478
|
}
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1479
|
+
}, t.prototype.evaluateRules = function(e, r, n) {
|
|
1480
|
+
if (this.logger.debug("RolloutEvaluator.EvaluateRules() called."), e && e.length > 0)
|
|
1481
|
+
for (var i = function(c) {
|
|
1482
|
+
var u = e[c], l = o.getUserAttribute(r, u.comparisonAttribute), h = u.comparator, p = u.comparisonValue, f = "Evaluating rule: '" + l + "' " + o.ruleToString(h) + " '" + p + "' => ";
|
|
1483
|
+
if (!l)
|
|
1484
|
+
return f += "NO MATCH (Attribute is not defined on the user object)", n.opAppendLine(f), "continue";
|
|
1485
|
+
var d = {
|
|
1431
1486
|
value: u.value,
|
|
1432
1487
|
variationId: u.variationId,
|
|
1433
|
-
|
|
1488
|
+
matchedTargetingRule: u
|
|
1434
1489
|
};
|
|
1490
|
+
switch (h) {
|
|
1491
|
+
case g.In:
|
|
1492
|
+
for (var y = p.split(","), E = 0; E < y.length; E++)
|
|
1493
|
+
if (y[E].trim() === l)
|
|
1494
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1495
|
+
f += "no match";
|
|
1496
|
+
break;
|
|
1497
|
+
case g.NotIn:
|
|
1498
|
+
if (!p.split(",").some(function(F) {
|
|
1499
|
+
return F.trim() === l;
|
|
1500
|
+
}))
|
|
1501
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1502
|
+
f += "no match";
|
|
1503
|
+
break;
|
|
1504
|
+
case g.Contains:
|
|
1505
|
+
if (l.indexOf(p) !== -1)
|
|
1506
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1507
|
+
f += "no match";
|
|
1508
|
+
break;
|
|
1509
|
+
case g.NotContains:
|
|
1510
|
+
if (l.indexOf(p) === -1)
|
|
1511
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1512
|
+
f += "no match";
|
|
1513
|
+
break;
|
|
1514
|
+
case g.SemVerIn:
|
|
1515
|
+
case g.SemVerNotIn:
|
|
1516
|
+
case g.SemVerLessThan:
|
|
1517
|
+
case g.SemVerLessThanEqual:
|
|
1518
|
+
case g.SemVerGreaterThan:
|
|
1519
|
+
case g.SemVerGreaterThanEqual:
|
|
1520
|
+
if (o.evaluateSemver(l, p, h))
|
|
1521
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1522
|
+
f += "no match";
|
|
1523
|
+
break;
|
|
1524
|
+
case g.NumberEqual:
|
|
1525
|
+
case g.NumberNotEqual:
|
|
1526
|
+
case g.NumberLessThan:
|
|
1527
|
+
case g.NumberLessThanEqual:
|
|
1528
|
+
case g.NumberGreaterThan:
|
|
1529
|
+
case g.NumberGreaterThanEqual:
|
|
1530
|
+
if (o.evaluateNumber(l, p, h))
|
|
1531
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1532
|
+
f += "no match";
|
|
1533
|
+
break;
|
|
1534
|
+
case g.SensitiveOneOf: {
|
|
1535
|
+
for (var N = p.split(","), U = oe(l), E = 0; E < N.length; E++)
|
|
1536
|
+
if (N[E].trim() === U)
|
|
1537
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1538
|
+
f += "no match";
|
|
1539
|
+
break;
|
|
1540
|
+
}
|
|
1541
|
+
case g.SensitiveNotOneOf: {
|
|
1542
|
+
var D = oe(l);
|
|
1543
|
+
if (!p.split(",").some(function(F) {
|
|
1544
|
+
return F.trim() === D;
|
|
1545
|
+
}))
|
|
1546
|
+
return f += "MATCH", n.opAppendLine(f), { value: d };
|
|
1547
|
+
f += "no match";
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
n.opAppendLine(f);
|
|
1552
|
+
}, o = this, s = 0; s < e.length; s++) {
|
|
1553
|
+
var a = i(s);
|
|
1554
|
+
if (typeof a == "object")
|
|
1555
|
+
return a.value;
|
|
1556
|
+
}
|
|
1557
|
+
return null;
|
|
1558
|
+
}, t.prototype.evaluatePercentageRules = function(e, r, n) {
|
|
1559
|
+
if (this.logger.debug("RolloutEvaluator.EvaluateVariations() called."), e && e.length > 0)
|
|
1560
|
+
for (var i = r + (n.identifier === null || n.identifier === void 0 ? "" : n.identifier), o = oe(i).substring(0, 7), s = parseInt(o, 16) % 100, a = 0, c = 0; c < e.length; c++) {
|
|
1561
|
+
var u = e[c];
|
|
1562
|
+
if (a += +u.percentage, s < a)
|
|
1563
|
+
return {
|
|
1564
|
+
value: u.value,
|
|
1565
|
+
variationId: u.variationId,
|
|
1566
|
+
matchedPercentageOption: u
|
|
1567
|
+
};
|
|
1568
|
+
}
|
|
1569
|
+
return null;
|
|
1570
|
+
}, t.prototype.evaluateNumber = function(e, r, n) {
|
|
1571
|
+
this.logger.debug("RolloutEvaluator.EvaluateNumber() called.");
|
|
1572
|
+
var i, o;
|
|
1573
|
+
if (e && !Number.isNaN(Number.parseFloat(e.replace(",", "."))))
|
|
1574
|
+
i = Number.parseFloat(e.replace(",", "."));
|
|
1575
|
+
else
|
|
1576
|
+
return !1;
|
|
1577
|
+
if (r && !Number.isNaN(Number.parseFloat(r.replace(",", "."))))
|
|
1578
|
+
o = Number.parseFloat(r.replace(",", "."));
|
|
1579
|
+
else
|
|
1580
|
+
return !1;
|
|
1581
|
+
switch (n) {
|
|
1582
|
+
case g.NumberEqual:
|
|
1583
|
+
return i === o;
|
|
1584
|
+
case g.NumberNotEqual:
|
|
1585
|
+
return i !== o;
|
|
1586
|
+
case g.NumberLessThan:
|
|
1587
|
+
return i < o;
|
|
1588
|
+
case g.NumberLessThanEqual:
|
|
1589
|
+
return i <= o;
|
|
1590
|
+
case g.NumberGreaterThan:
|
|
1591
|
+
return i > o;
|
|
1592
|
+
case g.NumberGreaterThanEqual:
|
|
1593
|
+
return i >= o;
|
|
1435
1594
|
}
|
|
1436
|
-
return null;
|
|
1437
|
-
}, t.prototype.evaluateNumber = function(e, r, n) {
|
|
1438
|
-
this.logger.debug("RolloutEvaluator.EvaluateNumber() called.");
|
|
1439
|
-
var i, o;
|
|
1440
|
-
if (e && !Number.isNaN(Number.parseFloat(e.replace(",", "."))))
|
|
1441
|
-
i = Number.parseFloat(e.replace(",", "."));
|
|
1442
|
-
else
|
|
1443
|
-
return !1;
|
|
1444
|
-
if (r && !Number.isNaN(Number.parseFloat(r.replace(",", "."))))
|
|
1445
|
-
o = Number.parseFloat(r.replace(",", "."));
|
|
1446
|
-
else
|
|
1447
1595
|
return !1;
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
return
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1596
|
+
}, t.prototype.evaluateSemver = function(e, r, n) {
|
|
1597
|
+
if (this.logger.debug("RolloutEvaluator.EvaluateSemver() called."), W(e) == null || r === void 0)
|
|
1598
|
+
return !1;
|
|
1599
|
+
switch (r = r.trim(), n) {
|
|
1600
|
+
case g.SemVerIn:
|
|
1601
|
+
for (var i = r.split(","), o = !1, s = 0; s < i.length; s++)
|
|
1602
|
+
if (!(!i[s] || i[s].trim() === "")) {
|
|
1603
|
+
if (W(i[s].trim()) == null)
|
|
1604
|
+
return !1;
|
|
1605
|
+
o || (o = Et(e, i[s].trim()));
|
|
1606
|
+
}
|
|
1607
|
+
return o;
|
|
1608
|
+
case g.SemVerNotIn:
|
|
1609
|
+
return !r.split(",").some(function(a) {
|
|
1610
|
+
return !a || a.trim() === "" || (a = W(a.trim()), a == null) ? !1 : bt(e, a);
|
|
1611
|
+
});
|
|
1612
|
+
case g.SemVerLessThan:
|
|
1613
|
+
return W(r) == null ? !1 : St(e, r);
|
|
1614
|
+
case g.SemVerLessThanEqual:
|
|
1615
|
+
return W(r) == null ? !1 : Ot(e, r);
|
|
1616
|
+
case g.SemVerGreaterThan:
|
|
1617
|
+
return W(r) == null ? !1 : Ct(e, r);
|
|
1618
|
+
case g.SemVerGreaterThanEqual:
|
|
1619
|
+
return W(r) == null ? !1 : At(e, r);
|
|
1620
|
+
}
|
|
1465
1621
|
return !1;
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
return "!= (Number)";
|
|
1526
|
-
case g.NumberLessThan:
|
|
1527
|
-
return "< (Number)";
|
|
1528
|
-
case g.NumberLessThanEqual:
|
|
1529
|
-
return "<= (Number)";
|
|
1530
|
-
case g.NumberGreaterThan:
|
|
1531
|
-
return "> (Number)";
|
|
1532
|
-
case g.NumberGreaterThanEqual:
|
|
1533
|
-
return ">= (Number)";
|
|
1534
|
-
case g.SensitiveOneOf:
|
|
1535
|
-
return "IS ONE OF (Sensitive)";
|
|
1536
|
-
case g.SensitiveNotOneOf:
|
|
1537
|
-
return "IS NOT ONE OF (Sensitive)";
|
|
1538
|
-
default:
|
|
1539
|
-
return e + "";
|
|
1622
|
+
}, t.prototype.getUserAttribute = function(e, r) {
|
|
1623
|
+
switch (r) {
|
|
1624
|
+
case "Identifier":
|
|
1625
|
+
return e.identifier;
|
|
1626
|
+
case "Email":
|
|
1627
|
+
return e.email;
|
|
1628
|
+
case "Country":
|
|
1629
|
+
return e.country;
|
|
1630
|
+
default:
|
|
1631
|
+
return (e.custom || {})[r];
|
|
1632
|
+
}
|
|
1633
|
+
}, t.prototype.ruleToString = function(e) {
|
|
1634
|
+
switch (e) {
|
|
1635
|
+
case g.In:
|
|
1636
|
+
return "IS ONE OF";
|
|
1637
|
+
case g.NotIn:
|
|
1638
|
+
return "IS NOT ONE OF";
|
|
1639
|
+
case g.Contains:
|
|
1640
|
+
return "CONTAINS";
|
|
1641
|
+
case g.NotContains:
|
|
1642
|
+
return "DOES NOT CONTAIN";
|
|
1643
|
+
case g.SemVerIn:
|
|
1644
|
+
return "IS ONE OF (SemVer)";
|
|
1645
|
+
case g.SemVerNotIn:
|
|
1646
|
+
return "IS NOT ONE OF (SemVer)";
|
|
1647
|
+
case g.SemVerLessThan:
|
|
1648
|
+
return "< (SemVer)";
|
|
1649
|
+
case g.SemVerLessThanEqual:
|
|
1650
|
+
return "<= (SemVer)";
|
|
1651
|
+
case g.SemVerGreaterThan:
|
|
1652
|
+
return "> (SemVer)";
|
|
1653
|
+
case g.SemVerGreaterThanEqual:
|
|
1654
|
+
return ">= (SemVer)";
|
|
1655
|
+
case g.NumberEqual:
|
|
1656
|
+
return "= (Number)";
|
|
1657
|
+
case g.NumberNotEqual:
|
|
1658
|
+
return "!= (Number)";
|
|
1659
|
+
case g.NumberLessThan:
|
|
1660
|
+
return "< (Number)";
|
|
1661
|
+
case g.NumberLessThanEqual:
|
|
1662
|
+
return "<= (Number)";
|
|
1663
|
+
case g.NumberGreaterThan:
|
|
1664
|
+
return "> (Number)";
|
|
1665
|
+
case g.NumberGreaterThanEqual:
|
|
1666
|
+
return ">= (Number)";
|
|
1667
|
+
case g.SensitiveOneOf:
|
|
1668
|
+
return "IS ONE OF (Sensitive)";
|
|
1669
|
+
case g.SensitiveNotOneOf:
|
|
1670
|
+
return "IS NOT ONE OF (Sensitive)";
|
|
1671
|
+
default:
|
|
1672
|
+
return e + "";
|
|
1673
|
+
}
|
|
1674
|
+
}, t;
|
|
1675
|
+
}()
|
|
1676
|
+
), wt = (
|
|
1677
|
+
/** @class */
|
|
1678
|
+
function() {
|
|
1679
|
+
function t() {
|
|
1680
|
+
this.operations = "";
|
|
1540
1681
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
function t() {
|
|
1544
|
-
this.operations = "";
|
|
1545
|
-
}
|
|
1546
|
-
return t.prototype.opAppendLine = function(e) {
|
|
1547
|
-
this.operations += " " + e + `
|
|
1682
|
+
return t.prototype.opAppendLine = function(e) {
|
|
1683
|
+
this.operations += " " + e + `
|
|
1548
1684
|
`;
|
|
1549
|
-
|
|
1550
|
-
|
|
1685
|
+
}, t.prototype.toString = function() {
|
|
1686
|
+
return "Evaluate '" + this.keyName + `'
|
|
1551
1687
|
User : ` + JSON.stringify(this.user) + `
|
|
1552
1688
|
` + this.operations + " Returning value : " + this.returnValue;
|
|
1553
|
-
|
|
1554
|
-
}()
|
|
1689
|
+
}, t;
|
|
1690
|
+
}()
|
|
1691
|
+
);
|
|
1555
1692
|
function Ge(t, e, r, n) {
|
|
1556
1693
|
return {
|
|
1557
1694
|
key: t,
|
|
@@ -1564,7 +1701,7 @@ function Ge(t, e, r, n) {
|
|
|
1564
1701
|
matchedEvaluationPercentageRule: e.matchedPercentageOption
|
|
1565
1702
|
};
|
|
1566
1703
|
}
|
|
1567
|
-
function
|
|
1704
|
+
function z(t, e, r, n, i, o) {
|
|
1568
1705
|
return {
|
|
1569
1706
|
key: t,
|
|
1570
1707
|
value: e,
|
|
@@ -1578,10 +1715,10 @@ function _(t, e, r, n, i, o) {
|
|
|
1578
1715
|
function le(t, e, r, n, i, o, s) {
|
|
1579
1716
|
var a;
|
|
1580
1717
|
if (!e)
|
|
1581
|
-
return a = s.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(),
|
|
1718
|
+
return a = s.configJsonIsNotPresentSingle(r, "defaultValue", n).toString(), z(r, n, x(o), i, a);
|
|
1582
1719
|
var c = e[r];
|
|
1583
1720
|
if (!c)
|
|
1584
|
-
return a = s.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n,
|
|
1721
|
+
return a = s.settingEvaluationFailedDueToMissingKey(r, "defaultValue", n, It(e)).toString(), z(r, n, x(o), i, a);
|
|
1585
1722
|
var u = t.evaluate(c, r, n, i, o);
|
|
1586
1723
|
if (n != null && typeof n != typeof u.value)
|
|
1587
1724
|
throw new TypeError(`The type of a setting must match the type of the given default value.
|
|
@@ -1599,7 +1736,7 @@ function Ke(t, e, r, n, i, o) {
|
|
|
1599
1736
|
var d = t.evaluate(p, h, null, r, n);
|
|
1600
1737
|
f = Ge(h, d, x(n), r);
|
|
1601
1738
|
} catch (y) {
|
|
1602
|
-
s ?? (s = []), s.push(y), f =
|
|
1739
|
+
s ?? (s = []), s.push(y), f = z(h, null, x(n), r, _(y), y);
|
|
1603
1740
|
}
|
|
1604
1741
|
a.push(f);
|
|
1605
1742
|
}
|
|
@@ -1614,377 +1751,395 @@ function Je(t) {
|
|
|
1614
1751
|
function x(t) {
|
|
1615
1752
|
return t ? new Date(t.timestamp) : void 0;
|
|
1616
1753
|
}
|
|
1617
|
-
function
|
|
1754
|
+
function It(t) {
|
|
1618
1755
|
return Object.keys(t).map(function(e) {
|
|
1619
1756
|
return "'" + e + "'";
|
|
1620
1757
|
}).join(", ");
|
|
1621
1758
|
}
|
|
1622
|
-
var
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
var n, i = this.instances[e.apiKey];
|
|
1628
|
-
if (i) {
|
|
1629
|
-
var o = i[0];
|
|
1630
|
-
if (n = o.deref(), n)
|
|
1631
|
-
return [n, !0];
|
|
1632
|
-
}
|
|
1633
|
-
var s = {};
|
|
1634
|
-
n = new be(e, r, s);
|
|
1635
|
-
var a = dt() ? WeakRef : pt();
|
|
1636
|
-
return this.instances[e.apiKey] = [new a(n), s], [n, !1];
|
|
1637
|
-
}, t.prototype.remove = function(e, r) {
|
|
1638
|
-
var n = this.instances[e];
|
|
1639
|
-
if (n) {
|
|
1640
|
-
var i = n[0], o = n[1], s = !!i.deref();
|
|
1641
|
-
if (!s || o === r)
|
|
1642
|
-
return delete this.instances[e], s;
|
|
1643
|
-
}
|
|
1644
|
-
return !1;
|
|
1645
|
-
}, t.prototype.clear = function() {
|
|
1646
|
-
for (var e = [], r = 0, n = Object.entries(this.instances); r < n.length; r++) {
|
|
1647
|
-
var i = n[r], o = i[0], s = i[1][0], a = s.deref();
|
|
1648
|
-
a && e.push(a), delete this.instances[o];
|
|
1759
|
+
var Nt = (
|
|
1760
|
+
/** @class */
|
|
1761
|
+
function() {
|
|
1762
|
+
function t() {
|
|
1763
|
+
this.instances = {};
|
|
1649
1764
|
}
|
|
1650
|
-
return e
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
throw new Error("Invalid 'sdkKey' value");
|
|
1674
|
-
var o = r === j.AutoPoll ? He : r === j.ManualPoll ? je : r === j.LazyLoad ? qe : function() {
|
|
1675
|
-
throw new Error("Invalid 'pollingMode' value");
|
|
1676
|
-
}(), s = new o(e, i.sdkType, i.sdkVersion, n, i.defaultCacheFactory, i.eventEmitterFactory), a = Y.getOrCreate(s, i), c = a[0], u = a[1];
|
|
1677
|
-
return u && n && s.logger.clientIsAlreadyCreated(e), c;
|
|
1678
|
-
}, t.finalize = function(e) {
|
|
1679
|
-
var r;
|
|
1680
|
-
(r = e.logger) === null || r === void 0 || r.debug("finalize() called"), e.cacheToken && Y.remove(e.sdkKey, e.cacheToken), t.close(e.configService, e.logger);
|
|
1681
|
-
}, t.close = function(e, r, n) {
|
|
1682
|
-
r == null || r.debug("close() called"), n == null || n.tryDisconnect(), e == null || e.dispose();
|
|
1683
|
-
}, t.prototype.dispose = function() {
|
|
1684
|
-
var e = this.options;
|
|
1685
|
-
e.logger.debug("dispose() called"), this.cacheToken && Y.remove(e.apiKey, this.cacheToken), t.close(this.configService, e.logger, e.hooks), this.suppressFinalize();
|
|
1686
|
-
}, t.disposeAll = function() {
|
|
1687
|
-
for (var e = Y.clear(), r, n = 0, i = e; n < i.length; n++) {
|
|
1688
|
-
var o = i[n];
|
|
1689
|
-
try {
|
|
1690
|
-
t.close(o.configService, o.options.logger, o.options.hooks), o.suppressFinalize();
|
|
1691
|
-
} catch (s) {
|
|
1692
|
-
r ?? (r = []), r.push(s);
|
|
1765
|
+
return t.prototype.getOrCreate = function(e, r) {
|
|
1766
|
+
var n, i = this.instances[e.apiKey];
|
|
1767
|
+
if (i) {
|
|
1768
|
+
var o = i[0];
|
|
1769
|
+
if (n = o.deref(), n)
|
|
1770
|
+
return [n, !0];
|
|
1771
|
+
}
|
|
1772
|
+
var s = {};
|
|
1773
|
+
n = new be(e, r, s);
|
|
1774
|
+
var a = vt() ? WeakRef : dt();
|
|
1775
|
+
return this.instances[e.apiKey] = [new a(n), s], [n, !1];
|
|
1776
|
+
}, t.prototype.remove = function(e, r) {
|
|
1777
|
+
var n = this.instances[e];
|
|
1778
|
+
if (n) {
|
|
1779
|
+
var i = n[0], o = n[1], s = !!i.deref();
|
|
1780
|
+
if (!s || o === r)
|
|
1781
|
+
return delete this.instances[e], s;
|
|
1782
|
+
}
|
|
1783
|
+
return !1;
|
|
1784
|
+
}, t.prototype.clear = function() {
|
|
1785
|
+
for (var e = [], r = 0, n = Object.entries(this.instances); r < n.length; r++) {
|
|
1786
|
+
var i = n[r], o = i[0], s = i[1][0], a = s.deref();
|
|
1787
|
+
a && e.push(a), delete this.instances[o];
|
|
1693
1788
|
}
|
|
1789
|
+
return e;
|
|
1790
|
+
}, t;
|
|
1791
|
+
}()
|
|
1792
|
+
), Y = new Nt(), be = (
|
|
1793
|
+
/** @class */
|
|
1794
|
+
function() {
|
|
1795
|
+
function t(e, r, n) {
|
|
1796
|
+
var i;
|
|
1797
|
+
if (this.cacheToken = n, this.addListener = this.on, this.off = this.removeListener, !e)
|
|
1798
|
+
throw new Error("Invalid 'options' value");
|
|
1799
|
+
if (this.options = e, this.options.logger.debug("Initializing ConfigCatClient. Options: " + JSON.stringify(this.options)), !r)
|
|
1800
|
+
throw new Error("Invalid 'configCatKernel' value");
|
|
1801
|
+
if (!r.configFetcher)
|
|
1802
|
+
throw new Error("Invalid 'configCatKernel.configFetcher' value");
|
|
1803
|
+
e.defaultUser && this.setDefaultUser(e.defaultUser), this.evaluator = new Tt(e.logger), ((i = e.flagOverrides) === null || i === void 0 ? void 0 : i.behaviour) !== P.LocalOnly ? this.configService = e instanceof He ? new tt(r.configFetcher, e) : e instanceof je ? new lt(r.configFetcher, e) : e instanceof qe ? new ct(r.configFetcher, e) : function() {
|
|
1804
|
+
throw new Error("Invalid 'options' value");
|
|
1805
|
+
}() : this.options.hooks.emit("clientReady", T.HasLocalOverrideFlagDataOnly), this.suppressFinalize = se(this, { sdkKey: e.apiKey, cacheToken: n, configService: this.configService, logger: e.logger });
|
|
1694
1806
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1807
|
+
return Object.defineProperty(t, "instanceCache", {
|
|
1808
|
+
get: function() {
|
|
1809
|
+
return Y;
|
|
1810
|
+
},
|
|
1811
|
+
enumerable: !1,
|
|
1812
|
+
configurable: !0
|
|
1813
|
+
}), t.get = function(e, r, n, i) {
|
|
1814
|
+
if (!e)
|
|
1815
|
+
throw new Error("Invalid 'sdkKey' value");
|
|
1816
|
+
var o = r === j.AutoPoll ? He : r === j.ManualPoll ? je : r === j.LazyLoad ? qe : function() {
|
|
1817
|
+
throw new Error("Invalid 'pollingMode' value");
|
|
1818
|
+
}(), s = new o(e, i.sdkType, i.sdkVersion, n, i.defaultCacheFactory, i.eventEmitterFactory), a = Y.getOrCreate(s, i), c = a[0], u = a[1];
|
|
1819
|
+
return u && n && s.logger.clientIsAlreadyCreated(e), c;
|
|
1820
|
+
}, t.finalize = function(e) {
|
|
1821
|
+
var r;
|
|
1822
|
+
(r = e.logger) === null || r === void 0 || r.debug("finalize() called"), e.cacheToken && Y.remove(e.sdkKey, e.cacheToken), t.close(e.configService, e.logger);
|
|
1823
|
+
}, t.close = function(e, r, n) {
|
|
1824
|
+
r == null || r.debug("close() called"), n == null || n.tryDisconnect(), e == null || e.dispose();
|
|
1825
|
+
}, t.prototype.dispose = function() {
|
|
1826
|
+
var e = this.options;
|
|
1827
|
+
e.logger.debug("dispose() called"), this.cacheToken && Y.remove(e.apiKey, this.cacheToken), t.close(this.configService, e.logger, e.hooks), this.suppressFinalize();
|
|
1828
|
+
}, t.disposeAll = function() {
|
|
1829
|
+
for (var e = Y.clear(), r, n = 0, i = e; n < i.length; n++) {
|
|
1830
|
+
var o = i[n];
|
|
1831
|
+
try {
|
|
1832
|
+
t.close(o.configService, o.options.logger, o.options.hooks), o.suppressFinalize();
|
|
1833
|
+
} catch (s) {
|
|
1834
|
+
r ?? (r = []), r.push(s);
|
|
1712
1835
|
}
|
|
1836
|
+
}
|
|
1837
|
+
if (r)
|
|
1838
|
+
throw typeof AggregateError < "u" ? new AggregateError(r) : r.pop();
|
|
1839
|
+
}, t.prototype.getValueAsync = function(e, r, n) {
|
|
1840
|
+
return S(this, void 0, void 0, function() {
|
|
1841
|
+
var i, o, s, a, c, u;
|
|
1842
|
+
return O(this, function(l) {
|
|
1843
|
+
switch (l.label) {
|
|
1844
|
+
case 0:
|
|
1845
|
+
this.options.logger.debug("getValueAsync() called."), fe(e), he(r), s = null, n ?? (n = this.defaultUser), l.label = 1;
|
|
1846
|
+
case 1:
|
|
1847
|
+
return l.trys.push([1, 3, , 4]), a = void 0, [4, this.getSettingsAsync()];
|
|
1848
|
+
case 2:
|
|
1849
|
+
return u = l.sent(), a = u[0], s = u[1], o = le(this.evaluator, a, e, r, n, s, this.options.logger), i = o.value, [3, 4];
|
|
1850
|
+
case 3:
|
|
1851
|
+
return c = l.sent(), this.options.logger.settingEvaluationErrorSingle("getValueAsync", e, "defaultValue", r, c), o = z(e, r, x(s), n, _(c), c), i = r, [3, 4];
|
|
1852
|
+
case 4:
|
|
1853
|
+
return this.options.hooks.emit("flagEvaluated", o), [2, i];
|
|
1854
|
+
}
|
|
1855
|
+
});
|
|
1713
1856
|
});
|
|
1714
|
-
})
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
}
|
|
1857
|
+
}, t.prototype.getValueDetailsAsync = function(e, r, n) {
|
|
1858
|
+
return S(this, void 0, void 0, function() {
|
|
1859
|
+
var i, o, s, a, c;
|
|
1860
|
+
return O(this, function(u) {
|
|
1861
|
+
switch (u.label) {
|
|
1862
|
+
case 0:
|
|
1863
|
+
this.options.logger.debug("getValueDetailsAsync() called."), fe(e), he(r), o = null, n ?? (n = this.defaultUser), u.label = 1;
|
|
1864
|
+
case 1:
|
|
1865
|
+
return u.trys.push([1, 3, , 4]), s = void 0, [4, this.getSettingsAsync()];
|
|
1866
|
+
case 2:
|
|
1867
|
+
return c = u.sent(), s = c[0], o = c[1], i = le(this.evaluator, s, e, r, n, o, this.options.logger), [3, 4];
|
|
1868
|
+
case 3:
|
|
1869
|
+
return a = u.sent(), this.options.logger.settingEvaluationErrorSingle("getValueDetailsAsync", e, "defaultValue", r, a), i = z(e, r, x(o), n, _(a), a), [3, 4];
|
|
1870
|
+
case 4:
|
|
1871
|
+
return this.options.hooks.emit("flagEvaluated", i), [2, i];
|
|
1872
|
+
}
|
|
1873
|
+
});
|
|
1731
1874
|
});
|
|
1732
|
-
})
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1875
|
+
}, t.prototype.getAllKeysAsync = function() {
|
|
1876
|
+
return S(this, void 0, void 0, function() {
|
|
1877
|
+
var e, r, n;
|
|
1878
|
+
return O(this, function(i) {
|
|
1879
|
+
switch (i.label) {
|
|
1880
|
+
case 0:
|
|
1881
|
+
this.options.logger.debug("getAllKeysAsync() called."), e = "empty array", i.label = 1;
|
|
1882
|
+
case 1:
|
|
1883
|
+
return i.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
1884
|
+
case 2:
|
|
1885
|
+
return r = i.sent()[0], ye(r, this.options.logger, e) ? [2, Object.keys(r)] : [2, []];
|
|
1886
|
+
case 3:
|
|
1887
|
+
return n = i.sent(), this.options.logger.settingEvaluationError("getAllKeysAsync", e, n), [2, []];
|
|
1888
|
+
case 4:
|
|
1889
|
+
return [
|
|
1890
|
+
2
|
|
1891
|
+
/*return*/
|
|
1892
|
+
];
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1749
1895
|
});
|
|
1750
|
-
})
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
}
|
|
1896
|
+
}, t.prototype.getAllValuesAsync = function(e) {
|
|
1897
|
+
return S(this, void 0, void 0, function() {
|
|
1898
|
+
var r, n, i, o, s, a, c, u, l, h, p, f;
|
|
1899
|
+
return O(this, function(d) {
|
|
1900
|
+
switch (d.label) {
|
|
1901
|
+
case 0:
|
|
1902
|
+
this.options.logger.debug("getAllValuesAsync() called."), r = "empty array", e ?? (e = this.defaultUser), d.label = 1;
|
|
1903
|
+
case 1:
|
|
1904
|
+
return d.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
1905
|
+
case 2:
|
|
1906
|
+
return s = d.sent(), a = s[0], c = s[1], f = Ke(this.evaluator, a, e, c, this.options.logger, r), i = f[0], o = f[1], n = i.map(function(y) {
|
|
1907
|
+
return new ne(y.key, y.value);
|
|
1908
|
+
}), [3, 4];
|
|
1909
|
+
case 3:
|
|
1910
|
+
return u = d.sent(), this.options.logger.settingEvaluationError("getAllValuesAsync", r, u), [2, []];
|
|
1911
|
+
case 4:
|
|
1912
|
+
for (o != null && o.length && this.options.logger.settingEvaluationError("getAllValuesAsync", "evaluation result", typeof AggregateError < "u" ? new AggregateError(o) : o.pop()), l = 0, h = i; l < h.length; l++)
|
|
1913
|
+
p = h[l], this.options.hooks.emit("flagEvaluated", p);
|
|
1914
|
+
return [2, n];
|
|
1915
|
+
}
|
|
1916
|
+
});
|
|
1771
1917
|
});
|
|
1772
|
-
})
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
}
|
|
1918
|
+
}, t.prototype.getAllValueDetailsAsync = function(e) {
|
|
1919
|
+
return S(this, void 0, void 0, function() {
|
|
1920
|
+
var r, n, i, o, s, a, c, u, l, h, p;
|
|
1921
|
+
return O(this, function(f) {
|
|
1922
|
+
switch (f.label) {
|
|
1923
|
+
case 0:
|
|
1924
|
+
this.options.logger.debug("getAllValueDetailsAsync() called."), r = "empty array", e ?? (e = this.defaultUser), f.label = 1;
|
|
1925
|
+
case 1:
|
|
1926
|
+
return f.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
1927
|
+
case 2:
|
|
1928
|
+
return o = f.sent(), s = o[0], a = o[1], p = Ke(this.evaluator, s, e, a, this.options.logger, r), n = p[0], i = p[1], [3, 4];
|
|
1929
|
+
case 3:
|
|
1930
|
+
return c = f.sent(), this.options.logger.settingEvaluationError("getAllValueDetailsAsync", r, c), [2, []];
|
|
1931
|
+
case 4:
|
|
1932
|
+
for (i != null && i.length && this.options.logger.settingEvaluationError("getAllValueDetailsAsync", "evaluation result", typeof AggregateError < "u" ? new AggregateError(i) : i.pop()), u = 0, l = n; u < l.length; u++)
|
|
1933
|
+
h = l[u], this.options.hooks.emit("flagEvaluated", h);
|
|
1934
|
+
return [2, n];
|
|
1935
|
+
}
|
|
1936
|
+
});
|
|
1791
1937
|
});
|
|
1792
|
-
})
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1938
|
+
}, t.prototype.getKeyAndValueAsync = function(e) {
|
|
1939
|
+
return S(this, void 0, void 0, function() {
|
|
1940
|
+
var r, n, i, o, s, a, c, u, p, l, h, p, f, d;
|
|
1941
|
+
return O(this, function(y) {
|
|
1942
|
+
switch (y.label) {
|
|
1943
|
+
case 0:
|
|
1944
|
+
this.options.logger.debug("getKeyAndValueAsync() called."), r = "null", y.label = 1;
|
|
1945
|
+
case 1:
|
|
1946
|
+
return y.trys.push([1, 3, , 4]), [4, this.getSettingsAsync()];
|
|
1947
|
+
case 2:
|
|
1948
|
+
if (n = y.sent()[0], !ye(n, this.options.logger, r))
|
|
1949
|
+
return [2, null];
|
|
1950
|
+
for (i = 0, o = Object.entries(n); i < o.length; i++) {
|
|
1951
|
+
if (s = o[i], a = s[0], c = s[1], e === c.variationId)
|
|
1952
|
+
return [2, new ne(a, c.value)];
|
|
1953
|
+
if (u = n[a].targetingRules, u && u.length > 0) {
|
|
1954
|
+
for (p = 0; p < u.length; p++)
|
|
1955
|
+
if (l = u[p], e === l.variationId)
|
|
1956
|
+
return [2, new ne(a, l.value)];
|
|
1957
|
+
}
|
|
1958
|
+
if (h = n[a].percentageOptions, h && h.length > 0) {
|
|
1959
|
+
for (p = 0; p < h.length; p++)
|
|
1960
|
+
if (f = h[p], e === f.variationId)
|
|
1961
|
+
return [2, new ne(a, f.value)];
|
|
1962
|
+
}
|
|
1817
1963
|
}
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
}
|
|
1964
|
+
return this.options.logger.settingForVariationIdIsNotPresent(e), [3, 4];
|
|
1965
|
+
case 3:
|
|
1966
|
+
return d = y.sent(), this.options.logger.settingEvaluationError("getKeyAndValueAsync", r, d), [3, 4];
|
|
1967
|
+
case 4:
|
|
1968
|
+
return [2, null];
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1825
1971
|
});
|
|
1826
|
-
})
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1972
|
+
}, t.prototype.forceRefreshAsync = function() {
|
|
1973
|
+
return S(this, void 0, void 0, function() {
|
|
1974
|
+
var e, r;
|
|
1975
|
+
return O(this, function(n) {
|
|
1976
|
+
switch (n.label) {
|
|
1977
|
+
case 0:
|
|
1978
|
+
if (this.options.logger.debug("forceRefreshAsync() called."), !this.configService)
|
|
1979
|
+
return [3, 5];
|
|
1980
|
+
n.label = 1;
|
|
1981
|
+
case 1:
|
|
1982
|
+
return n.trys.push([1, 3, , 4]), [4, this.configService.refreshConfigAsync()];
|
|
1983
|
+
case 2:
|
|
1984
|
+
return e = n.sent()[0], [2, e];
|
|
1985
|
+
case 3:
|
|
1986
|
+
return r = n.sent(), this.options.logger.forceRefreshError("forceRefreshAsync", r), [2, ae.failure(_(r), r)];
|
|
1987
|
+
case 4:
|
|
1988
|
+
return [3, 6];
|
|
1989
|
+
case 5:
|
|
1990
|
+
return [2, ae.failure("Client is configured to use the LocalOnly override behavior, which prevents making HTTP requests.")];
|
|
1991
|
+
case 6:
|
|
1992
|
+
return [
|
|
1993
|
+
2
|
|
1994
|
+
/*return*/
|
|
1995
|
+
];
|
|
1996
|
+
}
|
|
1997
|
+
});
|
|
1849
1998
|
});
|
|
1850
|
-
})
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1999
|
+
}, t.prototype.setDefaultUser = function(e) {
|
|
2000
|
+
this.defaultUser = e;
|
|
2001
|
+
}, t.prototype.clearDefaultUser = function() {
|
|
2002
|
+
this.defaultUser = void 0;
|
|
2003
|
+
}, Object.defineProperty(t.prototype, "isOffline", {
|
|
2004
|
+
get: function() {
|
|
2005
|
+
var e, r;
|
|
2006
|
+
return (r = (e = this.configService) === null || e === void 0 ? void 0 : e.isOffline) !== null && r !== void 0 ? r : !0;
|
|
2007
|
+
},
|
|
2008
|
+
enumerable: !1,
|
|
2009
|
+
configurable: !0
|
|
2010
|
+
}), t.prototype.setOnline = function() {
|
|
2011
|
+
this.configService ? this.configService.setOnline() : this.options.logger.configServiceMethodHasNoEffectDueToOverrideBehavior(P[P.LocalOnly], "setOnline");
|
|
2012
|
+
}, t.prototype.setOffline = function() {
|
|
2013
|
+
var e;
|
|
2014
|
+
(e = this.configService) === null || e === void 0 || e.setOffline();
|
|
2015
|
+
}, t.prototype.waitForReady = function() {
|
|
2016
|
+
return this.options.readyPromise;
|
|
2017
|
+
}, t.prototype.snapshot = function() {
|
|
2018
|
+
var e, r, n, i = this, o, s = function() {
|
|
2019
|
+
var h = i.options.cache.getInMemory(), p = h.isEmpty ? null : h.config.settings;
|
|
2020
|
+
return [p, h];
|
|
2021
|
+
}, a, c, u = (o = this.options) === null || o === void 0 ? void 0 : o.flagOverrides;
|
|
2022
|
+
if (u) {
|
|
2023
|
+
var l = u.dataSource.getOverridesSync();
|
|
2024
|
+
switch (u.behaviour) {
|
|
2025
|
+
case P.LocalOnly:
|
|
2026
|
+
return new re(l, null, this);
|
|
2027
|
+
case P.LocalOverRemote:
|
|
2028
|
+
return e = s(), a = e[0], c = e[1], new re(k(k({}, a ?? {}), l), c, this);
|
|
2029
|
+
case P.RemoteOverLocal:
|
|
2030
|
+
return r = s(), a = r[0], c = r[1], new re(k(k({}, l), a ?? {}), c, this);
|
|
2031
|
+
}
|
|
1883
2032
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
}
|
|
2033
|
+
return n = s(), a = n[0], c = n[1], new re(a, c, this);
|
|
2034
|
+
}, t.prototype.getSettingsAsync = function() {
|
|
2035
|
+
var e;
|
|
2036
|
+
return S(this, void 0, void 0, function() {
|
|
2037
|
+
var r, n, i, o, s, a, c, u, l = this;
|
|
2038
|
+
return O(this, function(h) {
|
|
2039
|
+
switch (h.label) {
|
|
2040
|
+
case 0:
|
|
2041
|
+
return this.options.logger.debug("getSettingsAsync() called."), r = function() {
|
|
2042
|
+
return S(l, void 0, void 0, function() {
|
|
2043
|
+
var p, f;
|
|
2044
|
+
return O(this, function(d) {
|
|
2045
|
+
switch (d.label) {
|
|
2046
|
+
case 0:
|
|
2047
|
+
return [4, this.configService.getConfig()];
|
|
2048
|
+
case 1:
|
|
2049
|
+
return p = d.sent(), f = p.isEmpty ? null : p.config.settings, [2, [f, p]];
|
|
2050
|
+
}
|
|
2051
|
+
});
|
|
1903
2052
|
});
|
|
1904
|
-
});
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
}
|
|
2053
|
+
}, n = (e = this.options) === null || e === void 0 ? void 0 : e.flagOverrides, n ? (i = void 0, o = void 0, [4, n.dataSource.getOverrides()]) : [3, 7];
|
|
2054
|
+
case 1:
|
|
2055
|
+
switch (s = h.sent(), a = n.behaviour, a) {
|
|
2056
|
+
case P.LocalOnly:
|
|
2057
|
+
return [3, 2];
|
|
2058
|
+
case P.LocalOverRemote:
|
|
2059
|
+
return [3, 3];
|
|
2060
|
+
case P.RemoteOverLocal:
|
|
2061
|
+
return [3, 5];
|
|
2062
|
+
}
|
|
2063
|
+
return [3, 7];
|
|
2064
|
+
case 2:
|
|
2065
|
+
return [2, [s, null]];
|
|
2066
|
+
case 3:
|
|
2067
|
+
return [4, r()];
|
|
2068
|
+
case 4:
|
|
2069
|
+
return c = h.sent(), i = c[0], o = c[1], [2, [k(k({}, i ?? {}), s), o]];
|
|
2070
|
+
case 5:
|
|
2071
|
+
return [4, r()];
|
|
2072
|
+
case 6:
|
|
2073
|
+
return u = h.sent(), i = u[0], o = u[1], [2, [k(k({}, s), i ?? {}), o]];
|
|
2074
|
+
case 7:
|
|
2075
|
+
return [4, r()];
|
|
2076
|
+
case 8:
|
|
2077
|
+
return [2, h.sent()];
|
|
2078
|
+
}
|
|
2079
|
+
});
|
|
1931
2080
|
});
|
|
1932
|
-
})
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
get: function() {
|
|
1954
|
-
var e = this.remoteConfig;
|
|
1955
|
-
return e && !e.isEmpty ? e.config : null;
|
|
1956
|
-
},
|
|
1957
|
-
enumerable: !1,
|
|
1958
|
-
configurable: !0
|
|
1959
|
-
}), t.prototype.getAllKeys = function() {
|
|
1960
|
-
return this.mergedSettings ? Object.keys(this.mergedSettings) : [];
|
|
1961
|
-
}, t.prototype.getValue = function(e, r, n) {
|
|
1962
|
-
this.options.logger.debug("Snapshot.getValue() called."), fe(e), he(r);
|
|
1963
|
-
var i, o;
|
|
1964
|
-
n ?? (n = this.defaultUser);
|
|
1965
|
-
try {
|
|
1966
|
-
o = le(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger), i = o.value;
|
|
1967
|
-
} catch (s) {
|
|
1968
|
-
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValue", e, "defaultValue", r, s), o = _(e, r, x(this.remoteConfig), n, z(s), s), i = r;
|
|
2081
|
+
}, t.prototype.on = function(e, r) {
|
|
2082
|
+
return this.options.hooks.on(e, r), this;
|
|
2083
|
+
}, t.prototype.once = function(e, r) {
|
|
2084
|
+
return this.options.hooks.once(e, r), this;
|
|
2085
|
+
}, t.prototype.removeListener = function(e, r) {
|
|
2086
|
+
return this.options.hooks.removeListener(e, r), this;
|
|
2087
|
+
}, t.prototype.removeAllListeners = function(e) {
|
|
2088
|
+
return this.options.hooks.removeAllListeners(e), this;
|
|
2089
|
+
}, t.prototype.listeners = function(e) {
|
|
2090
|
+
return this.options.hooks.listeners(e);
|
|
2091
|
+
}, t.prototype.listenerCount = function(e) {
|
|
2092
|
+
return this.options.hooks.listenerCount(e);
|
|
2093
|
+
}, t.prototype.eventNames = function() {
|
|
2094
|
+
return this.options.hooks.eventNames();
|
|
2095
|
+
}, t;
|
|
2096
|
+
}()
|
|
2097
|
+
), re = (
|
|
2098
|
+
/** @class */
|
|
2099
|
+
function() {
|
|
2100
|
+
function t(e, r, n) {
|
|
2101
|
+
this.mergedSettings = e, this.remoteConfig = r, this.defaultUser = n.defaultUser, this.evaluator = n.evaluator, this.options = n.options, this.cacheState = r ? n.configService.getCacheState(r) : T.HasLocalOverrideFlagDataOnly;
|
|
1969
2102
|
}
|
|
1970
|
-
return
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
}
|
|
1978
|
-
this.
|
|
2103
|
+
return Object.defineProperty(t.prototype, "fetchedConfig", {
|
|
2104
|
+
get: function() {
|
|
2105
|
+
var e = this.remoteConfig;
|
|
2106
|
+
return e && !e.isEmpty ? e.config : null;
|
|
2107
|
+
},
|
|
2108
|
+
enumerable: !1,
|
|
2109
|
+
configurable: !0
|
|
2110
|
+
}), t.prototype.getAllKeys = function() {
|
|
2111
|
+
return this.mergedSettings ? Object.keys(this.mergedSettings) : [];
|
|
2112
|
+
}, t.prototype.getValue = function(e, r, n) {
|
|
2113
|
+
this.options.logger.debug("Snapshot.getValue() called."), fe(e), he(r);
|
|
2114
|
+
var i, o;
|
|
2115
|
+
n ?? (n = this.defaultUser);
|
|
2116
|
+
try {
|
|
2117
|
+
o = le(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger), i = o.value;
|
|
2118
|
+
} catch (s) {
|
|
2119
|
+
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValue", e, "defaultValue", r, s), o = z(e, r, x(this.remoteConfig), n, _(s), s), i = r;
|
|
2120
|
+
}
|
|
2121
|
+
return this.options.hooks.emit("flagEvaluated", o), i;
|
|
2122
|
+
}, t.prototype.getValueDetails = function(e, r, n) {
|
|
2123
|
+
this.options.logger.debug("Snapshot.getValueDetails() called."), fe(e), he(r);
|
|
2124
|
+
var i;
|
|
2125
|
+
n ?? (n = this.defaultUser);
|
|
2126
|
+
try {
|
|
2127
|
+
i = le(this.evaluator, this.mergedSettings, e, r, n, this.remoteConfig, this.options.logger);
|
|
2128
|
+
} catch (o) {
|
|
2129
|
+
this.options.logger.settingEvaluationErrorSingle("Snapshot.getValueDetails", e, "defaultValue", r, o), i = z(e, r, x(this.remoteConfig), n, _(o), o);
|
|
2130
|
+
}
|
|
2131
|
+
return this.options.hooks.emit("flagEvaluated", i), i;
|
|
2132
|
+
}, t;
|
|
2133
|
+
}()
|
|
2134
|
+
), ne = (
|
|
2135
|
+
/** @class */
|
|
2136
|
+
function() {
|
|
2137
|
+
function t(e, r) {
|
|
2138
|
+
this.settingKey = e, this.settingValue = r;
|
|
1979
2139
|
}
|
|
1980
|
-
return
|
|
1981
|
-
}
|
|
1982
|
-
|
|
1983
|
-
function t(e, r) {
|
|
1984
|
-
this.settingKey = e, this.settingValue = r;
|
|
1985
|
-
}
|
|
1986
|
-
return t;
|
|
1987
|
-
}();
|
|
2140
|
+
return t;
|
|
2141
|
+
}()
|
|
2142
|
+
);
|
|
1988
2143
|
function fe(t) {
|
|
1989
2144
|
if (!t)
|
|
1990
2145
|
throw new Error("Invalid 'key' value");
|
|
@@ -2011,19 +2166,19 @@ var se = function(t, e) {
|
|
|
2011
2166
|
};
|
|
2012
2167
|
return se(t, e);
|
|
2013
2168
|
};
|
|
2014
|
-
|
|
2015
|
-
function
|
|
2169
|
+
ft();
|
|
2170
|
+
function Lt(t, e, r, n) {
|
|
2016
2171
|
return be.get(t, e, r, n);
|
|
2017
2172
|
}
|
|
2018
2173
|
function Rt(t) {
|
|
2019
2174
|
return new Be(t);
|
|
2020
2175
|
}
|
|
2021
|
-
const
|
|
2176
|
+
const Dt = (t, e) => {
|
|
2022
2177
|
const r = t.__vccOpts || t;
|
|
2023
2178
|
for (const [n, i] of e)
|
|
2024
2179
|
r[n] = i;
|
|
2025
2180
|
return r;
|
|
2026
|
-
},
|
|
2181
|
+
}, Ft = {
|
|
2027
2182
|
emits: ["flagValueChanged"],
|
|
2028
2183
|
props: {
|
|
2029
2184
|
featureKey: {
|
|
@@ -2039,41 +2194,38 @@ const Lt = (t, e) => {
|
|
|
2039
2194
|
data() {
|
|
2040
2195
|
return {
|
|
2041
2196
|
isFeatureFlagEnabled: null
|
|
2197
|
+
// `null` indicates that the feature flag value is not available yet
|
|
2042
2198
|
};
|
|
2043
2199
|
},
|
|
2044
2200
|
beforeMount() {
|
|
2045
2201
|
this.configChangedHandler = () => {
|
|
2046
|
-
const
|
|
2047
|
-
this.isFeatureFlagEnabled !==
|
|
2202
|
+
const n = this.$configCat.client.snapshot().getValue(this.featureKey, !1, this.userObject);
|
|
2203
|
+
this.isFeatureFlagEnabled !== n && (this.isFeatureFlagEnabled = n, this.$emit("flagValueChanged", n));
|
|
2048
2204
|
};
|
|
2049
|
-
const t = this.$configCat.
|
|
2050
|
-
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2053
|
-
}
|
|
2054
|
-
this.$configCat.client.getValueAsync(this.featureKey, !1, this.userObject).then((e) => {
|
|
2055
|
-
const r = this.configChangedHandler;
|
|
2056
|
-
!r || (this.isFeatureFlagEnabled = e, this.$configCat.client.on("configChanged", r));
|
|
2057
|
-
});
|
|
2205
|
+
const t = this.$configCat.client.snapshot(), e = t.cacheState;
|
|
2206
|
+
e == T.HasUpToDateFlagData || e == T.HasLocalOverrideFlagDataOnly ? (this.isFeatureFlagEnabled = t.getValue(this.featureKey, !1, this.userObject), this.$configCat.client.on("configChanged", this.configChangedHandler)) : this.$configCat.client.getValueAsync(this.featureKey, !1, this.userObject).then((r) => {
|
|
2207
|
+
const n = this.configChangedHandler;
|
|
2208
|
+
n && (this.isFeatureFlagEnabled = r, this.$configCat.client.on("configChanged", n));
|
|
2209
|
+
});
|
|
2058
2210
|
},
|
|
2059
2211
|
unmounted() {
|
|
2060
2212
|
const t = this.configChangedHandler;
|
|
2061
2213
|
delete this.configChangedHandler, this.$configCat.client.off("configChanged", t);
|
|
2062
2214
|
}
|
|
2063
|
-
},
|
|
2064
|
-
function
|
|
2215
|
+
}, Pt = { key: 0 }, Ut = { key: 1 }, kt = { key: 2 };
|
|
2216
|
+
function Mt(t, e, r, n, i, o) {
|
|
2065
2217
|
return Q(), ee("div", null, [
|
|
2066
|
-
i.isFeatureFlagEnabled === !0 ? (Q(), ee("div",
|
|
2218
|
+
i.isFeatureFlagEnabled === !0 ? (Q(), ee("div", Pt, [
|
|
2067
2219
|
ge(t.$slots, "default")
|
|
2068
|
-
])) : i.isFeatureFlagEnabled === !1 ? (Q(), ee("div",
|
|
2220
|
+
])) : i.isFeatureFlagEnabled === !1 ? (Q(), ee("div", Ut, [
|
|
2069
2221
|
ge(t.$slots, "else")
|
|
2070
|
-
])) : (Q(), ee("div",
|
|
2222
|
+
])) : (Q(), ee("div", kt, [
|
|
2071
2223
|
ge(t.$slots, "loading")
|
|
2072
2224
|
]))
|
|
2073
2225
|
]);
|
|
2074
2226
|
}
|
|
2075
|
-
const
|
|
2076
|
-
class
|
|
2227
|
+
const Kt = /* @__PURE__ */ Dt(Ft, [["render", Mt]]);
|
|
2228
|
+
class Vt {
|
|
2077
2229
|
handleStateChange(e, r, n) {
|
|
2078
2230
|
try {
|
|
2079
2231
|
if (e.readyState === 4) {
|
|
@@ -2100,7 +2252,7 @@ class Mt {
|
|
|
2100
2252
|
});
|
|
2101
2253
|
}
|
|
2102
2254
|
}
|
|
2103
|
-
class
|
|
2255
|
+
class xt {
|
|
2104
2256
|
set(e, r) {
|
|
2105
2257
|
try {
|
|
2106
2258
|
localStorage.setItem(e, btoa(r));
|
|
@@ -2116,48 +2268,48 @@ class Vt {
|
|
|
2116
2268
|
}
|
|
2117
2269
|
}
|
|
2118
2270
|
}
|
|
2119
|
-
const
|
|
2271
|
+
const Ht = "1.4.0", _t = {
|
|
2120
2272
|
install: (t, e) => {
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
r.client = Nt(
|
|
2273
|
+
let r = (
|
|
2274
|
+
// https://configcat.com/docs/sdk-reference/js/#manual-polling
|
|
2275
|
+
e.pollingMode === "manual" ? j.ManualPoll : (
|
|
2276
|
+
// https://configcat.com/docs/sdk-reference/js/#lazy-loading
|
|
2277
|
+
e.pollingMode === "lazy" ? j.LazyLoad : (
|
|
2278
|
+
// Auto poll is default
|
|
2279
|
+
j.AutoPoll
|
|
2280
|
+
)
|
|
2281
|
+
)
|
|
2282
|
+
);
|
|
2283
|
+
const n = Lt(
|
|
2133
2284
|
e.SDKKey,
|
|
2134
|
-
|
|
2135
|
-
|
|
2285
|
+
r,
|
|
2286
|
+
e.clientOptions,
|
|
2136
2287
|
{
|
|
2137
2288
|
sdkType: "ConfigCat-Vue",
|
|
2138
|
-
sdkVersion:
|
|
2139
|
-
configFetcher: new
|
|
2140
|
-
defaultCacheFactory: (
|
|
2289
|
+
sdkVersion: Ht,
|
|
2290
|
+
configFetcher: new Vt(),
|
|
2291
|
+
defaultCacheFactory: (s) => new ze(new xt(), s.logger)
|
|
2141
2292
|
}
|
|
2142
|
-
),
|
|
2143
|
-
|
|
2293
|
+
), i = { client: n };
|
|
2294
|
+
t.config.globalProperties.$configCat = i;
|
|
2295
|
+
const o = t.unmount;
|
|
2144
2296
|
t.unmount = function() {
|
|
2145
|
-
|
|
2297
|
+
o.apply(this, arguments), n.dispose();
|
|
2146
2298
|
};
|
|
2147
2299
|
}
|
|
2148
2300
|
};
|
|
2149
|
-
function
|
|
2301
|
+
function zt(t) {
|
|
2150
2302
|
return Rt(t);
|
|
2151
2303
|
}
|
|
2152
|
-
function
|
|
2153
|
-
return new
|
|
2304
|
+
function Bt(t, e) {
|
|
2305
|
+
return new ut(new at(t), e);
|
|
2154
2306
|
}
|
|
2155
2307
|
export {
|
|
2156
|
-
|
|
2308
|
+
qt as ClientReadyState,
|
|
2157
2309
|
g as Comparator,
|
|
2158
|
-
|
|
2310
|
+
_t as ConfigCatPlugin,
|
|
2159
2311
|
ue as DataGovernance,
|
|
2160
|
-
|
|
2312
|
+
Kt as FeatureWrapper,
|
|
2161
2313
|
A as FormattableLogMessage,
|
|
2162
2314
|
v as LogLevel,
|
|
2163
2315
|
P as OverrideBehaviour,
|
|
@@ -2165,7 +2317,7 @@ export {
|
|
|
2165
2317
|
ae as RefreshResult,
|
|
2166
2318
|
ne as SettingKeyValue,
|
|
2167
2319
|
Se as SettingType,
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2320
|
+
Wt as User,
|
|
2321
|
+
zt as createConsoleLogger,
|
|
2322
|
+
Bt as createFlagOverridesFromMap
|
|
2171
2323
|
};
|