@privacyscrubber/sdk 2.0.2 → 2.1.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.
@@ -1,257 +1,11 @@
1
- (function(global) {
2
- // ── START LICENSE CRYPTO ──
3
- const PUBLIC_KEY_N = BigInt("21317979104050344678233452423803986868842680501941538057759536089609908024281729760556922188810565541201321990374637212776148857190553192389608364990754937991254608109727112734447704854882786946805547031142530865504430968628760311494129154950865158735816268612258108296781892583171421605668998979064782378729322077179022581884976242706169323540456286526420742434868559866211716347133681429395477256705746276962607312574959642065929462114149296066812527505837608212730874704915352119747022918247963886630350365119206627670591400728523813746184290857872958847087691236909900501703203494160206941648263514117706558791691");
4
- const PUBLIC_KEY_E = 65537n;
5
-
6
- function modPow(base, exp, mod) {
7
- let res = 1n;
8
- base = base % mod;
9
- while (exp > 0n) {
10
- if (exp % 2n === 1n) res = (res * base) % mod;
11
- exp = exp / 2n;
12
- base = (base * base) % mod;
13
- }
14
- return res;
15
- }
16
-
17
- function bigIntToString(bi) {
18
- let hex = bi.toString(16);
19
- if (hex.length % 2 !== 0) hex = '0' + hex;
20
- let str = '';
21
- for (let i = 0; i < hex.length; i += 2) {
22
- str += String.fromCharCode(parseInt(hex.substr(i, 2), 16));
23
- }
24
- return str;
25
- }
26
-
27
- function stringToBigInt(str) {
28
- let hex = '';
29
- for (let i = 0; i < str.length; i++) {
30
- hex += str.charCodeAt(i).toString(16).padStart(2, '0');
31
- }
32
- return BigInt('0x' + hex);
33
- }
34
-
35
- function sha256(ascii) {
36
- function rightRotate(value, amount) { return (value>>>amount) | (value<<(32 - amount)); }
37
- var mathPow = Math.pow; var maxWord = mathPow(2, 32);
38
- var lengthProperty = 'length'; var i, j;
39
- var result = ''; var words = []; var asciiBitLength = ascii[lengthProperty]*8;
40
- var hash = sha256.h = sha256.h || [];
41
- var k = sha256.k = sha256.k || [];
42
- var primeCounter = k[lengthProperty];
43
- var isComposite = {};
44
- for (var candidate = 2; primeCounter < 64; candidate++) {
45
- if (!isComposite[candidate]) {
46
- for (i = 0; i < 313; i += candidate) { isComposite[i] = candidate; }
47
- hash[primeCounter] = (mathPow(candidate, .5)*maxWord)|0;
48
- k[primeCounter++] = (mathPow(candidate, 1/3)*maxWord)|0;
49
- }
50
- }
51
- ascii += '\x80';
52
- while (ascii[lengthProperty]%64 - 56) ascii += '\x00';
53
- for (i = 0; i < ascii[lengthProperty]; i++) {
54
- j = ascii.charCodeAt(i);
55
- if (j>>8) return;
56
- words[i>>2] |= j << ((3 - i)%4)*8;
57
- }
58
- words[words[lengthProperty]] = ((asciiBitLength/maxWord)|0);
59
- words[words[lengthProperty]] = (asciiBitLength)
60
- for (j = 0; j < words[lengthProperty];) {
61
- var w = words.slice(j, j += 16);
62
- var oldHash = hash;
63
- hash = hash.slice(0, 8);
64
- for (i = 0; i < 64; i++) {
65
- var w15 = w[i - 15], w2 = w[i - 2];
66
- var a = hash[0], e = hash[4];
67
- var temp1 = hash[7] + (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) + ((e&hash[5])^((~e)&hash[6])) + k[i] + (w[i] = (i < 16) ? w[i] : (w[i - 16] + (rightRotate(w15, 7) ^ rightRotate(w15, 18) ^ (w15>>>3)) + w[i - 7] + (rightRotate(w2, 17) ^ rightRotate(w2, 19) ^ (w2>>>10)))|0);
68
- var temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) + ((a&hash[1])^(a&hash[2])^(hash[1]&hash[2]));
69
- hash = [(temp1 + temp2)|0].concat(hash);
70
- hash[4] = (hash[4] + temp1)|0;
71
- }
72
- for (i = 0; i < 8; i++) { hash[i] = (hash[i] + oldHash[i])|0; }
73
- }
74
- for (i = 0; i < 8; i++) {
75
- for (j = 3; j + 1; j--) {
76
- var b = (hash[i]>>(j*8))&255;
77
- result += ((b < 16) ? 0 : '') + b.toString(16);
78
- }
79
- }
80
- return result;
81
- }
82
- // ── END LICENSE CRYPTO ──
83
-
84
- class LicenseManager {
85
- /**
86
- * Validates a license key universally across all environments.
87
- * @param {string} key - The license key.
88
- * @param {object} options - Options mapping to environment specifics.
89
- * @returns {object} { valid: boolean, tier: string|null, reason?: string, expires?: number }
90
- */
91
- static validate(key, options = {}) {
92
- if (!key) return { valid: false, tier: null, reason: "No key provided" };
93
- const rawKey = key.trim();
94
- const k = rawKey.toUpperCase();
95
- const parts = k.split('-');
96
-
97
- const now = options.mockTime !== undefined && options.mockTime !== null ? options.mockTime : Date.now();
98
- let lastSeen = 0;
99
-
100
- if (options.storage) {
101
- lastSeen = parseInt(options.storage.getItem('ps_last_seen_time') || '0', 10);
102
- if (options.mockTime === undefined || options.mockTime === null) {
103
- options.storage.setItem('ps_last_seen_time', now.toString());
104
- }
105
- }
106
-
107
- // Clock rollback guard
108
- if ((options.mockTime === undefined || options.mockTime === null) && now < lastSeen) {
109
- if (options.onAnomaly) options.onAnomaly();
110
- return { valid: false, tier: null, reason: "Clock rollback anomaly detected" };
111
- }
112
-
113
- const _atob = typeof atob !== 'undefined' ? atob : (str) => Buffer.from(str, 'base64').toString('binary');
114
-
115
- // 1. Process Pilot Keys (RSA-1024 Encrypted Timestamps)
116
- if (k.startsWith('PS-PILOT-')) {
117
- try {
118
- const payload = rawKey.substring(9);
119
- const binary = _atob(payload);
120
- const bytes = new Uint8Array(binary.length);
121
- for (let i = 0; i < binary.length; i++) {
122
- bytes[i] = binary.charCodeAt(i);
123
- }
124
- let hex = '';
125
- for (let i = 0; i < bytes.length; i++) {
126
- hex += bytes[i].toString(16).padStart(2, '0');
127
- }
128
- const S = BigInt('0x' + hex);
129
-
130
- const M = modPow(S, PUBLIC_KEY_E, PUBLIC_KEY_N);
131
- const decryptedStr = bigIntToString(M);
132
-
133
- if (decryptedStr.startsWith('ZTDS-PILOT-')) {
134
- const expDate = parseInt(decryptedStr.substring(11), 10);
135
- if (!isNaN(expDate)) {
136
- if (now < expDate) return { valid: true, tier: 'TEAMS', expires: expDate };
137
-
138
- if (options.onExpired) options.onExpired('Pilot');
139
- return { valid: false, tier: null, reason: "Pilot expired" };
140
- }
141
- }
142
- } catch(e) {
143
- return { valid: false, tier: null, reason: "Pilot decryption failed" };
144
- }
145
- }
146
-
147
- // 1.5. Process RSA Signed Keys (PS-RSA-...)
148
- if (k.startsWith('PS-RSA-')) {
149
- try {
150
- const payload = rawKey.substring(7);
151
- const binary = _atob(payload);
152
- const bytes = new Uint8Array(binary.length);
153
- for (let i = 0; i < binary.length; i++) {
154
- bytes[i] = binary.charCodeAt(i);
155
- }
156
- let hex = '';
157
- for (let i = 0; i < bytes.length; i++) {
158
- hex += bytes[i].toString(16).padStart(2, '0');
159
- }
160
- const S = BigInt('0x' + hex);
161
-
162
- const M = modPow(S, PUBLIC_KEY_E, PUBLIC_KEY_N);
163
- const decryptedStr = bigIntToString(M);
164
-
165
- if (decryptedStr.startsWith('ZTDS-LIC-')) {
166
- const pieces = decryptedStr.split('-');
167
- if (pieces.length >= 5) {
168
- const tier = pieces[2];
169
- const expires = parseInt(pieces[4], 10);
170
- if (!isNaN(expires)) {
171
- if (now < expires) return { valid: true, tier: tier, expires: expires };
172
-
173
- if (options.onExpired) options.onExpired('RSA');
174
- return { valid: false, tier: null, reason: "RSA key expired" };
175
- }
176
- }
177
- }
178
- } catch(e) {
179
- return { valid: false, tier: null, reason: "RSA decryption failed" };
180
- }
181
- }
182
-
183
- // 2. Process Modern Prefixed Keys (v1.4.2+ Salted Checksum)
184
- if (parts.length === 4 && parts[0] === 'PS' && ['PRO', 'TEAMS', 'SDK', 'OEM', 'ENTERPRISE'].includes(parts[1])) {
185
- const tier = parts[1];
186
- const core = parts[2];
187
- const checksum = parts[3];
188
- const salt = "ZTDS_SALT_2026_!@#";
189
- const input = core + salt + tier;
190
- let sum = 0;
191
- for (let i = 0; i < input.length; i++) {
192
- sum += input.charCodeAt(i) * (i + 1);
193
- }
194
- const expectedChecksum = (sum % 9999).toString().padStart(4, '0');
195
- if (checksum === expectedChecksum) {
196
- return { valid: true, tier: tier };
197
- }
198
- }
199
-
200
- // 3. Process Standard RS256 JWTs (eyJ...)
201
- if (rawKey.startsWith('eyJ') && rawKey.split('.').length === 3) {
202
- try {
203
- const [b64Header, b64Payload, b64Signature] = rawKey.split('.');
204
-
205
- let sigStr = b64Signature.replace(/-/g, '+').replace(/_/g, '/');
206
- while (sigStr.length % 4) sigStr += '=';
207
- const binarySig = _atob(sigStr);
208
- let hexSig = '';
209
- for (let i = 0; i < binarySig.length; i++) {
210
- hexSig += binarySig.charCodeAt(i).toString(16).padStart(2, '0');
211
- }
212
-
213
- const S = BigInt('0x' + hexSig);
214
- const M = modPow(S, PUBLIC_KEY_E, PUBLIC_KEY_N);
215
-
216
- let mHex = M.toString(16);
217
- if (mHex.length % 2 !== 0) mHex = '0' + mHex;
218
-
219
- const expectedHash = sha256(b64Header + '.' + b64Payload);
220
-
221
- if (mHex.endsWith(expectedHash)) {
222
- const payloadJson = _atob(b64Payload.replace(/-/g, '+').replace(/_/g, '/'));
223
- const payload = JSON.parse(payloadJson);
224
-
225
- if (payload.exp && (now / 1000) < payload.exp) {
226
- return { valid: true, tier: payload.tier || 'PRO', expires: payload.exp * 1000 };
227
- } else {
228
- if (options.onExpired) options.onExpired('JWT');
229
- return { valid: false, tier: null, reason: "JWT expired" };
230
- }
231
- }
232
- } catch(e) {
233
- return { valid: false, tier: null, reason: "JWT validation failed" };
234
- }
235
- }
236
-
237
- return { valid: false, tier: null, reason: "Invalid format" };
238
- }
239
- }
240
-
241
- // Export module for ES modules, CommonJS, and Browser Global
242
- if (typeof globalThis !== 'undefined') {
243
- globalThis.LicenseManager = LicenseManager;
244
- }
245
- if (typeof global !== 'undefined') {
246
- global.LicenseManager = LicenseManager;
247
- }
248
- if (typeof window !== 'undefined') {
249
- window.LicenseManager = LicenseManager;
250
- }
251
- if (typeof exports !== 'undefined') {
252
- if (typeof module !== 'undefined' && module.exports) {
253
- module.exports = LicenseManager;
254
- }
255
- exports.LicenseManager = LicenseManager;
256
- }
257
- })(typeof globalThis !== 'undefined' ? globalThis : (typeof window !== 'undefined' ? window : this));
1
+ /**
2
+ * @license
3
+ * PrivacyScrubber Core Processing Engine (ZTDS)
4
+ * Copyright (c) 2026 PrivacyScrubber. All Rights Reserved.
5
+ *
6
+ * WARNING: This is proprietary, commercial software.
7
+ * Unauthorized copying, modification, distribution, or use of this source code,
8
+ * via any medium, is strictly prohibited. Protected by international copyright
9
+ * laws and treaties.
10
+ */
11
+ function _0x1dd9(){const _0x3a1c0b=['DvbKwfy','tg9grhe','y29Uy2f0','wNDTDw8','CNfuz0m','B3rftuq','sgLQzLG','twvhr2u','C3vIC3rYAw5N','mJCWvxr0rMT2','DfLvt0K','mty3ndLMDMrgtKO','tgnwz1K','CgfYC2u','CwnJA2q','zNjVBq','BgvUz3rO','ChnFBgfZDf9ZzwvUx3rPBwu','ugLSB3qGzxHWAxjLza','sLDuigv4CgLYzwq','mJyWmty2mfLVEg1NEa','tgLJzw5Zzu1HBMfNzxi','nJaWA3nhrvzi','ru5urvjquKLtrq','ndKZmduWnhPvwenmuG','Bw9JA1rPBwu','C3vIC3rY','ufmTueLmt1qT','Cg93','mJmXndLQzvv5tLu','vLr5q08','C3bSAxq','EfrVre8','wLreu19tquXuxZiWmJzFiuaJ','CMvWBgfJzq','uLnb','ufjp','Dw5KzwzPBMvK','ufmTuLnblq','EvHLDNa','C3rVCMfNzq','odeXmtC3A1v0Efbd','zxHW','q2XVy2SGCM9SBgjHy2SGyw5VBwfSEsbKzxrLy3rLza','BM93','u0rl','zxLk','vKHtshO','uLnbigTLEsbLEhbPCMvK','t0f4yNK','C2XPy2u','ntu0ntG3zMLgtKzR','C3rHCNrZv2L0Aa','ugLSB3q','y2HHCKnVzgvbDa','tM8GA2v5ihbYB3zPzgvK','DuH1Afe','Dg9tDhjPBMC','mZbVzNPwDLK','zNjVBunOyxjdB2rL','mtHMweX6CwW','uLnbigrLy3j5ChrPB24GzMfPBgvK','vxHJrKu','v3fntM0','qMTYv1K','qwrPzwq','Beffuxy','B25bBM9TywX5','r2Xyqvy','CgfKu3rHCNq','mtuWndq1mhLuAwfpsa','Bfz1Axq','sw52ywXPzcbMB3jTyxq','BuX5wxe','zxHWB3j0CW','wLreuY1qsuXpvc0','B25fEhbPCMvK','r0LhzeK','zgPyqMi','yMLUyxj5','t0vn','ywjqyMm'];_0x1dd9=function(){return _0x3a1c0b;};return _0x1dd9();}const _0x1bad3b=_0x3d8c;function _0x3d8c(_0x1fa210,_0x5c23c0){_0x1fa210=_0x1fa210-0x90;const _0x1dd982=_0x1dd9();let _0x3d8c18=_0x1dd982[_0x1fa210];if(_0x3d8c['ZxNkru']===undefined){var _0x3dbc7c=function(_0x14e084){const _0x2d573c='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x18afa8='',_0x2a8933='';for(let _0xf8f8fc=0x0,_0x4e5615,_0x48bfed,_0x34c71d=0x0;_0x48bfed=_0x14e084['charAt'](_0x34c71d++);~_0x48bfed&&(_0x4e5615=_0xf8f8fc%0x4?_0x4e5615*0x40+_0x48bfed:_0x48bfed,_0xf8f8fc++%0x4)?_0x18afa8+=String['fromCharCode'](0xff&_0x4e5615>>(-0x2*_0xf8f8fc&0x6)):0x0){_0x48bfed=_0x2d573c['indexOf'](_0x48bfed);}for(let _0x27eadc=0x0,_0x4396fe=_0x18afa8['length'];_0x27eadc<_0x4396fe;_0x27eadc++){_0x2a8933+='%'+('00'+_0x18afa8['charCodeAt'](_0x27eadc)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2a8933);};_0x3d8c['lAqnnL']=_0x3dbc7c,_0x3d8c['lacXax']={},_0x3d8c['ZxNkru']=!![];}const _0x4b8fa3=_0x1dd982[0x0],_0xae702e=_0x1fa210+_0x4b8fa3,_0x5b0434=_0x3d8c['lacXax'][_0xae702e];return!_0x5b0434?(_0x3d8c18=_0x3d8c['lAqnnL'](_0x3d8c18),_0x3d8c['lacXax'][_0xae702e]=_0x3d8c18):_0x3d8c18=_0x5b0434,_0x3d8c18;}(function(_0x2a4664,_0x125be5){const _0xf0cb6b={_0x331331:0x9e,_0x3379f3:0xdb,_0x2b1fbf:0xbb,_0x3d567a:0xa8},_0x4d6122=_0x3d8c,_0x9c65c6=_0x2a4664();while(!![]){try{const _0x3679f7=parseInt(_0x4d6122(_0xf0cb6b._0x331331))/0x1+parseInt(_0x4d6122(_0xf0cb6b._0x3379f3))/0x2+-parseInt(_0x4d6122(0xd2))/0x3*(-parseInt(_0x4d6122(0xdd))/0x4)+parseInt(_0x4d6122(_0xf0cb6b._0x2b1fbf))/0x5+-parseInt(_0x4d6122(0xaf))/0x6*(-parseInt(_0x4d6122(0x92))/0x7)+-parseInt(_0x4d6122(0xdf))/0x8*(parseInt(_0x4d6122(0xb1))/0x9)+-parseInt(_0x4d6122(0xd0))/0xa*(parseInt(_0x4d6122(_0xf0cb6b._0x3d567a))/0xb);if(_0x3679f7===_0x125be5)break;else _0x9c65c6['push'](_0x9c65c6['shift']());}catch(_0x2cb63a){_0x9c65c6['push'](_0x9c65c6['shift']());}}}(_0x1dd9,0xa44e5),function(_0x587584){const _0x372b82={_0x2e16be:0xac,_0x39786e:0xc5,_0x3c231d:0xde,_0x5ffd2e:0xda,_0xe7c775:0xbd,_0x36eeb5:0xdc,_0x2637e8:0xd5,_0x4eb87c:0xd5},_0x3d00e3={_0x50812e:0xe0,_0x2ea0d6:0xa1,_0x407cb5:0x9d,_0x327fa6:0xb9,_0x456656:0xd8,_0x186dd9:0xe0,_0x357a78:0xe0,_0x5e063a:0xa0,_0xd08296:0x90,_0xc91e56:0xd7,_0x1ad311:0xd7,_0x264a10:0xae,_0x4a9df8:0xa9,_0x400df0:0xb5,_0x395d17:0xaa,_0x482066:0xd9,_0x3236e2:0xba,_0x437b70:0xb4,_0x413c63:0x94,_0x39f16d:0xb3,_0xcef8c6:0xc1,_0x4bce95:0xc1,_0x38f1d3:0xa5,_0x4dad0e:0x99,_0x52c4bf:0xd3,_0x933bbf:0x96,_0x10eb44:0xa4,_0x2882c7:0xa3,_0x91488f:0x94,_0x1a46f1:0x97,_0xe00c16:0xad,_0x475cc1:0x95,_0xedc29b:0x9c,_0x1501e8:0xd4,_0x487ba9:0x9f},_0x263162={_0x1ef0b7:0xcc,_0x12082e:0xc3,_0x4dd2bd:0xab,_0x59c305:0xcd,_0x216764:0xbe,_0x1f0976:0xa7,_0x181609:0xc7,_0x1ed54d:0xb6,_0x54fd6d:0xcc,_0x37bd9f:0xc9,_0x379c07:0xca},_0x4a0de5={_0x3ec594:0xae},_0x597c6c={_0x1a4082:0xd7,_0x1b062b:0xe1},_0x44770d=_0x3d8c,_0x29c976={'VHSHz':function(_0x5c59d8,_0xde5803){return _0x5c59d8%_0xde5803;},'yXevp':function(_0x43d93f,_0x1420ed){return _0x43d93f+_0x1420ed;},'otEMD':function(_0x39b4fd,_0x6ddac8,_0xd13272){return _0x39b4fd(_0x6ddac8,_0xd13272);},'Zwmuo':function(_0x5a7c5a,_0x46caa0){return _0x5a7c5a|_0x46caa0;},'djXBb':function(_0x506eac,_0x3f34e2){return _0x506eac*_0x3f34e2;},'aeLVN':function(_0x3605db,_0x42348a){return _0x3605db%_0x42348a;},'HijfX':function(_0x1deb2b,_0x6cfa8e){return _0x1deb2b>>_0x6cfa8e;},'mLyYq':function(_0xd0c996,_0x46a9da){return _0xd0c996/_0x46a9da;},'uPdXV':function(_0x537b9b,_0x39624a){return _0x537b9b^_0x39624a;},'lVuit':function(_0x1ae91a,_0x39d16c){return _0x1ae91a&_0x39d16c;},'iYKyn':function(_0x61a9dc,_0xb57148){return _0x61a9dc+_0xb57148;},'Adied':function(_0x193e06,_0xc56003){return _0x193e06>>>_0xc56003;},'GlXAV':function(_0x386323,_0x14d3e8,_0x2c5c76){return _0x386323(_0x14d3e8,_0x2c5c76);},'owudR':function(_0x17bddd,_0x2fd792){return _0x17bddd&_0x2fd792;},'VTyCO':_0x44770d(_0x372b82._0x2e16be),'BkrWY':function(_0xb9b3a,_0x10afee){return _0xb9b3a<_0x10afee;},'abPbc':'Pilot\x20decryption\x20failed','GIGdI':_0x44770d(0x9b),'MeGGe':function(_0x46e9fb,_0x5ad3b9){return _0x46e9fb+_0x5ad3b9;},'WqMNm':function(_0x46d3b2,_0x55b3f9){return _0x46d3b2(_0x55b3f9);},'UxcFE':function(_0x16ec6f,_0x48098e){return _0x16ec6f(_0x48098e);},'OAxby':_0x44770d(0xa2),'LcVgY':_0x44770d(_0x372b82._0x39786e),'tYUOI':_0x44770d(_0x372b82._0x3c231d),'uHuhQ':function(_0x22b6a1,_0x242a30){return _0x22b6a1%_0x242a30;},'xToDO':function(_0x1868a9,_0x10e97b){return _0x1868a9!==_0x10e97b;},'rqTgC':function(_0x273664,_0x232910){return _0x273664%_0x232910;},'zdDUH':function(_0x495bca,_0x379046){return _0x495bca<_0x379046;},'LoFDq':_0x44770d(_0x372b82._0x5ffd2e),'lAEQv':_0x44770d(_0x372b82._0xe7c775),'qcckd':'undefined'},_0x325d1c=BigInt('21317979104050344678233452423803986868842680501941538057759536089609908024281729760556922188810565541201321990374637212776148857190553192389608364990754937991254608109727112734447704854882786946805547031142530865504430968628760311494129154950865158735816268612258108296781892583171421605668998979064782378729322077179022581884976242706169323540456286526420742434868559866211716347133681429395477256705746276962607312574959642065929462114149296066812527505837608212730874704915352119747022918247963886630350365119206627670591400728523813746184290857872958847087691236909900501703203494160206941648263514117706558791691'),_0x2f87a6=0x10001n;function _0x2639cd(_0xe64707,_0x47db1d,_0x5485b6){const _0x1e7baf=_0x44770d;let _0xbbfa73=0x1n;_0xe64707=_0xe64707%_0x5485b6;while(_0x47db1d>0x0n){if(_0x47db1d%0x2n===0x1n)_0xbbfa73=_0x29c976[_0x1e7baf(0xa4)](_0xbbfa73*_0xe64707,_0x5485b6);_0x47db1d=_0x47db1d/0x2n,_0xe64707=_0xe64707*_0xe64707%_0x5485b6;}return _0xbbfa73;}function _0x404405(_0x869cb9){const _0xa4b2a3=_0x44770d;let _0x2ea42b=_0x869cb9[_0xa4b2a3(0xae)](0x10);if(_0x2ea42b[_0xa4b2a3(0xd7)]%0x2!==0x0)_0x2ea42b='0'+_0x2ea42b;let _0x327ace='';for(let _0x58a0a1=0x0;_0x58a0a1<_0x2ea42b[_0xa4b2a3(_0x597c6c._0x1a4082)];_0x58a0a1+=0x2){_0x327ace+=String[_0xa4b2a3(0xb0)](parseInt(_0x2ea42b[_0xa4b2a3(_0x597c6c._0x1b062b)](_0x58a0a1,0x2),0x10));}return _0x327ace;}function _0x348eff(_0x48e705){const _0xc44e9a=_0x44770d;let _0x68041a='';for(let _0x3759d3=0x0;_0x3759d3<_0x48e705[_0xc44e9a(0xd7)];_0x3759d3++){_0x68041a+=_0x48e705[_0xc44e9a(0xab)](_0x3759d3)[_0xc44e9a(_0x4a0de5._0x3ec594)](0x10)['padStart'](0x2,'0');}return BigInt(_0x29c976[_0xc44e9a(0x9c)]('0x',_0x68041a));}function _0x36c501(_0x2f6896){const _0x3af7f5=_0x44770d;function _0x138c24(_0x2b29e4,_0x9ed02b){return _0x2b29e4>>>_0x9ed02b|_0x2b29e4<<0x20-_0x9ed02b;}var _0x3a6e01=Math[_0x3af7f5(0x91)],_0x2b9fbb=_0x29c976[_0x3af7f5(_0x263162._0x1ef0b7)](_0x3a6e01,0x2,0x20),_0x7fa012='length',_0x255f31,_0x32aaf6,_0x1e34c2='',_0x234068=[],_0x1ba105=_0x2f6896[_0x7fa012]*0x8,_0x25eeff=_0x36c501['h']=_0x36c501['h']||[],_0x305e31=_0x36c501['k']=_0x36c501['k']||[],_0xa1590d=_0x305e31[_0x7fa012],_0x307a59={};for(var _0x13bc11=0x2;_0xa1590d<0x40;_0x13bc11++){if(!_0x307a59[_0x13bc11]){for(_0x255f31=0x0;_0x255f31<0x139;_0x255f31+=_0x13bc11){_0x307a59[_0x255f31]=_0x13bc11;}_0x25eeff[_0xa1590d]=_0x29c976[_0x3af7f5(0xca)](_0x29c976['otEMD'](_0x3a6e01,_0x13bc11,0.5)*_0x2b9fbb,0x0),_0x305e31[_0xa1590d++]=_0x29c976[_0x3af7f5(_0x263162._0x12082e)](_0x3a6e01(_0x13bc11,0x1/0x3),_0x2b9fbb)|0x0;}}_0x2f6896+='\u0080';while(_0x29c976['aeLVN'](_0x2f6896[_0x7fa012],0x40)-0x38)_0x2f6896+='\x00';for(_0x255f31=0x0;_0x255f31<_0x2f6896[_0x7fa012];_0x255f31++){_0x32aaf6=_0x2f6896[_0x3af7f5(_0x263162._0x4dd2bd)](_0x255f31);if(_0x29c976[_0x3af7f5(_0x263162._0x59c305)](_0x32aaf6,0x8))return;_0x234068[_0x255f31>>0x2]|=_0x32aaf6<<(0x3-_0x255f31)%0x4*0x8;}_0x234068[_0x234068[_0x7fa012]]=_0x29c976[_0x3af7f5(_0x263162._0x216764)](_0x1ba105,_0x2b9fbb)|0x0,_0x234068[_0x234068[_0x7fa012]]=_0x1ba105;for(_0x32aaf6=0x0;_0x32aaf6<_0x234068[_0x7fa012];){var _0x200dda=_0x234068[_0x3af7f5(_0x263162._0x1f0976)](_0x32aaf6,_0x32aaf6+=0x10),_0xc95345=_0x25eeff;_0x25eeff=_0x25eeff['slice'](0x0,0x8);for(_0x255f31=0x0;_0x255f31<0x40;_0x255f31++){var _0x156dc0=_0x200dda[_0x255f31-0xf],_0x4889da=_0x200dda[_0x255f31-0x2],_0x45516d=_0x25eeff[0x0],_0x47d31a=_0x25eeff[0x4],_0x3c3e00=_0x25eeff[0x7]+_0x29c976[_0x3af7f5(0xc7)](_0x138c24(_0x47d31a,0x6)^_0x138c24(_0x47d31a,0xb),_0x138c24(_0x47d31a,0x19))+_0x29c976[_0x3af7f5(0xc7)](_0x47d31a&_0x25eeff[0x5],_0x29c976[_0x3af7f5(0xbc)](~_0x47d31a,_0x25eeff[0x6]))+_0x305e31[_0x255f31]+(_0x200dda[_0x255f31]=_0x255f31<0x10?_0x200dda[_0x255f31]:_0x29c976['yXevp'](_0x29c976['iYKyn'](_0x200dda[_0x255f31-0x10],_0x29c976[_0x3af7f5(0xc7)](_0x138c24(_0x156dc0,0x7)^_0x138c24(_0x156dc0,0x12),_0x156dc0>>>0x3)),_0x200dda[_0x255f31-0x7])+(_0x29c976[_0x3af7f5(_0x263162._0x181609)](_0x138c24(_0x4889da,0x11),_0x138c24(_0x4889da,0x13))^_0x29c976[_0x3af7f5(_0x263162._0x1ed54d)](_0x4889da,0xa))|0x0),_0x15fa92=(_0x29c976[_0x3af7f5(_0x263162._0x54fd6d)](_0x138c24,_0x45516d,0x2)^_0x29c976[_0x3af7f5(0xb9)](_0x138c24,_0x45516d,0xd)^_0x138c24(_0x45516d,0x16))+(_0x29c976['owudR'](_0x45516d,_0x25eeff[0x1])^_0x45516d&_0x25eeff[0x2]^_0x25eeff[0x1]&_0x25eeff[0x2]);_0x25eeff=[_0x29c976[_0x3af7f5(0x9c)](_0x3c3e00,_0x15fa92)|0x0][_0x3af7f5(_0x263162._0x37bd9f)](_0x25eeff),_0x25eeff[0x4]=_0x29c976[_0x3af7f5(_0x263162._0x379c07)](_0x25eeff[0x4]+_0x3c3e00,0x0);}for(_0x255f31=0x0;_0x255f31<0x8;_0x255f31++){_0x25eeff[_0x255f31]=_0x25eeff[_0x255f31]+_0xc95345[_0x255f31]|0x0;}}for(_0x255f31=0x0;_0x255f31<0x8;_0x255f31++){for(_0x32aaf6=0x3;_0x32aaf6+0x1;_0x32aaf6--){var _0x591dd0=_0x25eeff[_0x255f31]>>_0x32aaf6*0x8&0xff;_0x1e34c2+=(_0x591dd0<0x10?0x0:'')+_0x591dd0[_0x3af7f5(0xae)](0x10);}}return _0x1e34c2;}class LicenseManager{static validate(_0x2c7060,_0x2dbf5b={}){const _0x2d9cc6=_0x44770d;if(!_0x2c7060)return{'valid':![],'tier':null,'reason':_0x29c976[_0x2d9cc6(0x93)]};const _0x3d3180=_0x2c7060['trim'](),_0x5f496e=_0x3d3180['toUpperCase'](),_0x4c7b75=_0x5f496e[_0x2d9cc6(0x94)]('-'),_0x5033f7=_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x50812e)]!==undefined&&_0x2dbf5b['mockTime']!==null?_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x50812e)]:Date[_0x2d9cc6(_0x3d00e3._0x2ea0d6)]();let _0x50516a=0x0;_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x407cb5)]&&(_0x50516a=_0x29c976[_0x2d9cc6(_0x3d00e3._0x327fa6)](parseInt,_0x2dbf5b[_0x2d9cc6(0x9d)]['getItem'](_0x2d9cc6(_0x3d00e3._0x456656))||'0',0xa),(_0x2dbf5b['mockTime']===undefined||_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x186dd9)]===null)&&_0x2dbf5b[_0x2d9cc6(0x9d)]['setItem'](_0x2d9cc6(0xd8),_0x5033f7[_0x2d9cc6(0xae)]()));if((_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x357a78)]===undefined||_0x2dbf5b['mockTime']===null)&&_0x5033f7<_0x50516a){if(_0x2dbf5b[_0x2d9cc6(0xb8)])_0x2dbf5b['onAnomaly']();return{'valid':![],'tier':null,'reason':_0x2d9cc6(_0x3d00e3._0x5e063a)};}const _0x2875d9=typeof atob!==_0x2d9cc6(0x9a)?atob:_0x56371c=>Buffer[_0x2d9cc6(0xd6)](_0x56371c,'base64')[_0x2d9cc6(0xae)](_0x2d9cc6(0xc4));if(_0x5f496e['startsWith'](_0x2d9cc6(_0x3d00e3._0xd08296)))try{const _0x48cd97=_0x3d3180[_0x2d9cc6(0xcf)](0x9),_0xcd9538=_0x2875d9(_0x48cd97),_0x5ff1f8=new Uint8Array(_0xcd9538[_0x2d9cc6(_0x3d00e3._0xc91e56)]);for(let _0x5adbda=0x0;_0x5adbda<_0xcd9538[_0x2d9cc6(0xd7)];_0x5adbda++){_0x5ff1f8[_0x5adbda]=_0xcd9538[_0x2d9cc6(0xab)](_0x5adbda);}let _0x5e2640='';for(let _0x3cdca9=0x0;_0x3cdca9<_0x5ff1f8[_0x2d9cc6(_0x3d00e3._0x1ad311)];_0x3cdca9++){_0x5e2640+=_0x5ff1f8[_0x3cdca9][_0x2d9cc6(_0x3d00e3._0x264a10)](0x10)[_0x2d9cc6(0xba)](0x2,'0');}const _0x1c06c2=BigInt(_0x29c976[_0x2d9cc6(0x9c)]('0x',_0x5e2640)),_0x1c45dc=_0x2639cd(_0x1c06c2,_0x2f87a6,_0x325d1c),_0x14f853=_0x404405(_0x1c45dc);if(_0x14f853[_0x2d9cc6(_0x3d00e3._0x4a9df8)](_0x2d9cc6(0xc0))){const _0xe5cbc=parseInt(_0x14f853[_0x2d9cc6(0xcf)](0xb),0xa);if(!isNaN(_0xe5cbc)){if(_0x29c976[_0x2d9cc6(_0x3d00e3._0x400df0)](_0x5033f7,_0xe5cbc))return{'valid':!![],'tier':'TEAMS','expires':_0xe5cbc};if(_0x2dbf5b[_0x2d9cc6(0xc1)])_0x2dbf5b[_0x2d9cc6(0xc1)](_0x2d9cc6(_0x3d00e3._0x395d17));return{'valid':![],'tier':null,'reason':_0x2d9cc6(_0x3d00e3._0x482066)};}}}catch(_0x387bb3){return{'valid':![],'tier':null,'reason':_0x29c976[_0x2d9cc6(0xc6)]};}if(_0x5f496e[_0x2d9cc6(0xa9)](_0x29c976[_0x2d9cc6(0xc2)]))try{const _0xa474cf=_0x3d3180[_0x2d9cc6(0xcf)](0x7),_0x3a62d8=_0x2875d9(_0xa474cf),_0x4af084=new Uint8Array(_0x3a62d8[_0x2d9cc6(_0x3d00e3._0xc91e56)]);for(let _0x17e443=0x0;_0x17e443<_0x3a62d8['length'];_0x17e443++){_0x4af084[_0x17e443]=_0x3a62d8[_0x2d9cc6(0xab)](_0x17e443);}let _0x154a7e='';for(let _0x49a683=0x0;_0x49a683<_0x4af084[_0x2d9cc6(0xd7)];_0x49a683++){_0x154a7e+=_0x4af084[_0x49a683][_0x2d9cc6(_0x3d00e3._0x264a10)](0x10)[_0x2d9cc6(_0x3d00e3._0x3236e2)](0x2,'0');}const _0x4655de=BigInt(_0x29c976[_0x2d9cc6(0xce)]('0x',_0x154a7e)),_0x9e345b=_0x2639cd(_0x4655de,_0x2f87a6,_0x325d1c),_0x2c96d8=_0x29c976[_0x2d9cc6(_0x3d00e3._0x437b70)](_0x404405,_0x9e345b);if(_0x2c96d8[_0x2d9cc6(0xa9)]('ZTDS-LIC-')){const _0x2b11f1=_0x2c96d8[_0x2d9cc6(_0x3d00e3._0x413c63)]('-');if(_0x2b11f1[_0x2d9cc6(_0x3d00e3._0x1ad311)]>=0x5){const _0x527f53=_0x2b11f1[0x2],_0x3f8f75=parseInt(_0x2b11f1[0x4],0xa);if(!_0x29c976[_0x2d9cc6(_0x3d00e3._0x39f16d)](isNaN,_0x3f8f75)){if(_0x5033f7<_0x3f8f75)return{'valid':!![],'tier':_0x527f53,'expires':_0x3f8f75};if(_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0xcef8c6)])_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0x4bce95)](_0x2d9cc6(0x98));return{'valid':![],'tier':null,'reason':_0x2d9cc6(_0x3d00e3._0x38f1d3)};}}}}catch(_0x4a48b5){return{'valid':![],'tier':null,'reason':_0x2d9cc6(0xb2)};}if(_0x4c7b75['length']===0x4&&_0x4c7b75[0x0]==='PS'&&[_0x2d9cc6(_0x3d00e3._0x4dad0e),'TEAMS',_0x29c976[_0x2d9cc6(0xa6)],_0x29c976[_0x2d9cc6(_0x3d00e3._0x52c4bf)],_0x29c976[_0x2d9cc6(0xd1)]]['includes'](_0x4c7b75[0x1])){const _0x31e900=_0x4c7b75[0x1],_0x3c0cb3=_0x4c7b75[0x2],_0x5b68ee=_0x4c7b75[0x3],_0xbccdae=_0x2d9cc6(_0x3d00e3._0x933bbf),_0x1086c4=_0x29c976['iYKyn'](_0x3c0cb3+_0xbccdae,_0x31e900);let _0x11c3fa=0x0;for(let _0x2af9fe=0x0;_0x2af9fe<_0x1086c4[_0x2d9cc6(0xd7)];_0x2af9fe++){_0x11c3fa+=_0x1086c4[_0x2d9cc6(0xab)](_0x2af9fe)*(_0x2af9fe+0x1);}const _0x1d52d4=_0x29c976[_0x2d9cc6(_0x3d00e3._0x10eb44)](_0x11c3fa,0x270f)['toString']()['padStart'](0x4,'0');if(_0x5b68ee===_0x1d52d4)return{'valid':!![],'tier':_0x31e900};}if(_0x3d3180[_0x2d9cc6(0xa9)](_0x2d9cc6(_0x3d00e3._0x2882c7))&&_0x3d3180[_0x2d9cc6(_0x3d00e3._0x91488f)]('.')['length']===0x3)try{const [_0x55adb8,_0x1c983e,_0x36cac5]=_0x3d3180['split']('.');let _0x44600f=_0x36cac5[_0x2d9cc6(0x97)](/-/g,'+')[_0x2d9cc6(_0x3d00e3._0x1a46f1)](/_/g,'/');while(_0x29c976[_0x2d9cc6(_0x3d00e3._0xe00c16)](_0x44600f['length'],0x4))_0x44600f+='=';const _0x48a2f2=_0x29c976['WqMNm'](_0x2875d9,_0x44600f);let _0x2480f4='';for(let _0x5a9a79=0x0;_0x5a9a79<_0x48a2f2['length'];_0x5a9a79++){_0x2480f4+=_0x48a2f2[_0x2d9cc6(0xab)](_0x5a9a79)[_0x2d9cc6(0xae)](0x10)[_0x2d9cc6(_0x3d00e3._0x3236e2)](0x2,'0');}const _0xfc4c4f=BigInt('0x'+_0x2480f4),_0x75cf7f=_0x2639cd(_0xfc4c4f,_0x2f87a6,_0x325d1c);let _0xb4a870=_0x75cf7f['toString'](0x10);if(_0x29c976[_0x2d9cc6(_0x3d00e3._0x475cc1)](_0x29c976[_0x2d9cc6(0xcb)](_0xb4a870['length'],0x2),0x0))_0xb4a870='0'+_0xb4a870;const _0x3ce109=_0x36c501(_0x29c976[_0x2d9cc6(_0x3d00e3._0xedc29b)](_0x55adb8,'.')+_0x1c983e);if(_0xb4a870['endsWith'](_0x3ce109)){const _0x261276=_0x2875d9(_0x1c983e[_0x2d9cc6(_0x3d00e3._0x1a46f1)](/-/g,'+')[_0x2d9cc6(_0x3d00e3._0x1a46f1)](/_/g,'/')),_0x27ab89=JSON[_0x2d9cc6(_0x3d00e3._0x1501e8)](_0x261276);if(_0x27ab89[_0x2d9cc6(_0x3d00e3._0x487ba9)]&&_0x29c976['zdDUH'](_0x5033f7/0x3e8,_0x27ab89[_0x2d9cc6(0x9f)]))return{'valid':!![],'tier':_0x27ab89['tier']||_0x2d9cc6(_0x3d00e3._0x4dad0e),'expires':_0x27ab89['exp']*0x3e8};else{if(_0x2dbf5b['onExpired'])_0x2dbf5b[_0x2d9cc6(_0x3d00e3._0xcef8c6)]('JWT');return{'valid':![],'tier':null,'reason':_0x29c976[_0x2d9cc6(0xc8)]};}}}catch(_0x1a3e58){return{'valid':![],'tier':null,'reason':'JWT\x20validation\x20failed'};}return{'valid':![],'tier':null,'reason':_0x29c976[_0x2d9cc6(0xb7)]};}}typeof globalThis!=='undefined'&&(globalThis[_0x44770d(_0x372b82._0x36eeb5)]=LicenseManager),typeof _0x587584!==_0x44770d(0x9a)&&(_0x587584[_0x44770d(0xdc)]=LicenseManager),typeof window!==_0x29c976[_0x44770d(_0x372b82._0x2637e8)]&&(window[_0x44770d(0xdc)]=LicenseManager),typeof exports!==_0x29c976[_0x44770d(_0x372b82._0x4eb87c)]&&(_0x29c976[_0x44770d(0x95)](typeof module,_0x44770d(0x9a))&&module['exports']&&(module[_0x44770d(0xbf)]=LicenseManager),exports[_0x44770d(_0x372b82._0x36eeb5)]=LicenseManager);}(typeof globalThis!==_0x1bad3b(0x9a)?globalThis:typeof window!=='undefined'?window:this));