@saasquatch/squatch-js 2.8.2-32 → 2.8.2-33
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/squatch.cjs.js +395 -451
- package/dist/squatch.cjs.js.map +1 -1
- package/dist/squatch.esm.js +395 -451
- package/dist/squatch.esm.js.map +1 -1
- package/dist/squatch.js +351 -407
- package/dist/squatch.js.map +1 -1
- package/dist/squatch.min.js +1 -1
- package/package.json +1 -1
package/dist/squatch.js
CHANGED
|
@@ -1238,419 +1238,105 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1238
1238
|
return isVerified && (noContainer || isComponent);
|
|
1239
1239
|
}
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
<div class="share-section">
|
|
1258
|
-
<div class="skeleton sk-label"></div>
|
|
1259
|
-
<div class="skeleton sk-input"></div>
|
|
1260
|
-
<div class="social-buttons">
|
|
1261
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1262
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1263
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1264
|
-
<div class="skeleton sk-btn-social"></div>
|
|
1265
|
-
</div>
|
|
1266
|
-
</div>
|
|
1267
|
-
|
|
1268
|
-
<div class="skeleton sk-title-md" style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"></div>
|
|
1269
|
-
<div class="skeleton sk-text" style="width: 60%; margin-left: auto; margin-right: auto"></div>
|
|
1270
|
-
|
|
1271
|
-
<div class="stats-section">
|
|
1272
|
-
<div class="stat-card">
|
|
1273
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1274
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1275
|
-
</div>
|
|
1276
|
-
<div class="stat-card stat-divider">
|
|
1277
|
-
<div class="skeleton sk-stat-num"></div>
|
|
1278
|
-
<div class="skeleton sk-stat-label"></div>
|
|
1279
|
-
</div>
|
|
1280
|
-
</div>
|
|
1281
|
-
|
|
1282
|
-
<div class="skeleton sk-title-md"></div>
|
|
1283
|
-
|
|
1284
|
-
<div class="table-header">
|
|
1285
|
-
<div class="skeleton sk-th col-user"></div>
|
|
1286
|
-
<div class="skeleton sk-th col-status"></div>
|
|
1287
|
-
<div class="skeleton sk-th col-reward"></div>
|
|
1288
|
-
<div class="skeleton sk-th col-date"></div>
|
|
1289
|
-
</div>
|
|
1290
|
-
|
|
1291
|
-
<div class="table-row">
|
|
1292
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 70%; margin: 0"></div></div>
|
|
1293
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1294
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1295
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1296
|
-
</div>
|
|
1297
|
-
|
|
1298
|
-
<div class="table-row">
|
|
1299
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 60%; margin: 0"></div></div>
|
|
1300
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1301
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1302
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1303
|
-
</div>
|
|
1304
|
-
|
|
1305
|
-
<div class="table-row">
|
|
1306
|
-
<div class="col-user"><div class="skeleton sk-text" style="width: 75%; margin: 0"></div></div>
|
|
1307
|
-
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1308
|
-
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1309
|
-
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1310
|
-
</div>
|
|
1311
|
-
|
|
1312
|
-
<div class="pagination">
|
|
1313
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1314
|
-
<div class="skeleton sk-btn-page"></div>
|
|
1315
|
-
</div>
|
|
1316
|
-
`;
|
|
1317
|
-
const instantAccessHTML = `
|
|
1318
|
-
<div class="hero-section instant-access-layout">
|
|
1319
|
-
<div class="skeleton hero-image ia-image"></div>
|
|
1320
|
-
|
|
1321
|
-
<div class="hero-content ia-content">
|
|
1322
|
-
<div class="skeleton sk-title-lg ia-center"></div>
|
|
1323
|
-
<div class="skeleton sk-text ia-center"></div>
|
|
1324
|
-
|
|
1325
|
-
<div class="skeleton sk-btn-action"></div>
|
|
1326
|
-
|
|
1327
|
-
<div class="skeleton sk-label"></div>
|
|
1328
|
-
<div class="input-group">
|
|
1329
|
-
<div class="skeleton sk-input"></div>
|
|
1330
|
-
<div class="skeleton sk-btn-copy"></div>
|
|
1331
|
-
</div>
|
|
1332
|
-
|
|
1333
|
-
<div class="skeleton sk-text-short ia-center" style="margin-top: 20px; width: 30%"></div>
|
|
1334
|
-
<div class="skeleton sk-text-short ia-center" style="width: 20%"></div>
|
|
1335
|
-
</div>
|
|
1336
|
-
</div>
|
|
1337
|
-
`;
|
|
1338
|
-
return `
|
|
1339
|
-
<style>
|
|
1340
|
-
* {
|
|
1341
|
-
box-sizing: border-box;
|
|
1342
|
-
padding: 0;
|
|
1343
|
-
margin: 0;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
.widget-container {
|
|
1347
|
-
background: white;
|
|
1348
|
-
width: 100%;
|
|
1349
|
-
padding: 40px;
|
|
1350
|
-
box-sizing: border-box;
|
|
1351
|
-
overflow: hidden;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
@keyframes shimmer {
|
|
1355
|
-
0% { background-position: -100% 0; }
|
|
1356
|
-
100% { background-position: 100% 0; }
|
|
1357
|
-
}
|
|
1358
|
-
|
|
1359
|
-
.skeleton {
|
|
1360
|
-
background: ${skeletonBackgroundColor};
|
|
1361
|
-
background: linear-gradient(
|
|
1362
|
-
90deg,
|
|
1363
|
-
${skeletonBackgroundColor} 25%,
|
|
1364
|
-
${skeletonShimmerColor} 50%,
|
|
1365
|
-
${skeletonBackgroundColor} 75%
|
|
1366
|
-
);
|
|
1367
|
-
background-size: 200% 100%;
|
|
1368
|
-
animation: shimmer 1.5s infinite linear;
|
|
1369
|
-
border-radius: 6px;
|
|
1370
|
-
margin-bottom: 12px;
|
|
1241
|
+
const _log$6 = browserExports.debug("squatch-js:POPUPwidget");
|
|
1242
|
+
let popupId = 0;
|
|
1243
|
+
class PopupWidget extends Widget {
|
|
1244
|
+
constructor(params, trigger = ".squatchpop") {
|
|
1245
|
+
super(params);
|
|
1246
|
+
__publicField(this, "trigger");
|
|
1247
|
+
__publicField(this, "id");
|
|
1248
|
+
__publicField(this, "show", this.open);
|
|
1249
|
+
__publicField(this, "hide", this.close);
|
|
1250
|
+
this.trigger = trigger;
|
|
1251
|
+
if (this.container) {
|
|
1252
|
+
this.id = "squatchModal";
|
|
1253
|
+
} else {
|
|
1254
|
+
this.id = popupId === 0 ? `squatchModal` : `squatchModal__${popupId}`;
|
|
1255
|
+
popupId = popupId + 1;
|
|
1371
1256
|
}
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
.
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
flex-direction: row;
|
|
1387
|
-
height: 100%;
|
|
1388
|
-
/* Removed border-bottom */
|
|
1257
|
+
document.head.insertAdjacentHTML(
|
|
1258
|
+
"beforeend",
|
|
1259
|
+
`<style>#${this.id}::-webkit-scrollbar { display: none; }</style>`
|
|
1260
|
+
);
|
|
1261
|
+
}
|
|
1262
|
+
_initialiseCTA() {
|
|
1263
|
+
if (!this.trigger) return;
|
|
1264
|
+
let triggerElement;
|
|
1265
|
+
try {
|
|
1266
|
+
triggerElement = document.querySelector(this.trigger) || document.querySelector(".impactpop");
|
|
1267
|
+
if (this.trigger && !triggerElement)
|
|
1268
|
+
_log$6("No element found with trigger selector", this.trigger);
|
|
1269
|
+
} catch {
|
|
1270
|
+
_log$6("Not a valid selector", this.trigger);
|
|
1389
1271
|
}
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
flex-direction: column;
|
|
1395
|
-
justify-content: center;
|
|
1272
|
+
if (triggerElement) {
|
|
1273
|
+
triggerElement.onclick = () => {
|
|
1274
|
+
this.open();
|
|
1275
|
+
};
|
|
1396
1276
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1277
|
+
}
|
|
1278
|
+
_createPopupDialog() {
|
|
1279
|
+
var _a2, _b, _c;
|
|
1280
|
+
const dialog = document.createElement("dialog");
|
|
1281
|
+
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1282
|
+
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
|
|
1283
|
+
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "auto";
|
|
1284
|
+
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
|
|
1285
|
+
dialog.id = this.id;
|
|
1286
|
+
dialog.setAttribute(
|
|
1287
|
+
"style",
|
|
1288
|
+
`width: 100%; min-width: ${minWidth}; max-width: ${maxWidth}; border: none; padding: 0;`
|
|
1289
|
+
);
|
|
1290
|
+
const onClick = (e) => {
|
|
1291
|
+
e.stopPropagation();
|
|
1292
|
+
if (e.target === dialog) dialog.close();
|
|
1293
|
+
};
|
|
1294
|
+
dialog.addEventListener("click", onClick);
|
|
1295
|
+
return dialog;
|
|
1296
|
+
}
|
|
1297
|
+
async load() {
|
|
1298
|
+
var _a2;
|
|
1299
|
+
const frame = this._createFrame();
|
|
1300
|
+
this._initialiseCTA();
|
|
1301
|
+
const element = this.container ? this._findElement() : document.body;
|
|
1302
|
+
const dialogParent = element.shadowRoot || element;
|
|
1303
|
+
const dialog = this._createPopupDialog();
|
|
1304
|
+
dialog.appendChild(frame);
|
|
1305
|
+
if (((_a2 = dialogParent.lastChild) == null ? void 0 : _a2.nodeName) === "DIALOG") {
|
|
1306
|
+
dialogParent.replaceChild(dialog, dialogParent.lastChild);
|
|
1307
|
+
} else {
|
|
1308
|
+
dialogParent.appendChild(dialog);
|
|
1402
1309
|
}
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
margin-bottom: 0;
|
|
1407
|
-
padding-bottom: 0;
|
|
1408
|
-
align-items: center;
|
|
1310
|
+
const { contentWindow } = frame;
|
|
1311
|
+
if (!contentWindow) {
|
|
1312
|
+
throw new Error("Frame needs a content window");
|
|
1409
1313
|
}
|
|
1410
|
-
.
|
|
1411
|
-
|
|
1314
|
+
const frameDoc = contentWindow.document;
|
|
1315
|
+
frameDoc.open();
|
|
1316
|
+
frameDoc.write(this.content);
|
|
1317
|
+
frameDoc.write(
|
|
1318
|
+
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1319
|
+
);
|
|
1320
|
+
frameDoc.write(`
|
|
1321
|
+
<style>
|
|
1322
|
+
body {
|
|
1323
|
+
height: 600px;
|
|
1324
|
+
border: 2px solid #ccc;
|
|
1325
|
+
background-color: #f9f9f9;
|
|
1326
|
+
margin: 0;
|
|
1327
|
+
padding: 0;
|
|
1328
|
+
box-sizing: border-box;
|
|
1412
1329
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
.
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
width: 140px;
|
|
1424
|
-
border-radius: 6px;
|
|
1425
|
-
margin: 24px auto;
|
|
1426
|
-
}
|
|
1427
|
-
.input-group {
|
|
1428
|
-
display: flex;
|
|
1429
|
-
gap: 10px;
|
|
1430
|
-
width: 100%;
|
|
1431
|
-
max-width: 400px;
|
|
1432
|
-
}
|
|
1433
|
-
.sk-btn-copy {
|
|
1434
|
-
height: 50px;
|
|
1435
|
-
width: 120px;
|
|
1436
|
-
border-radius: 8px;
|
|
1437
|
-
}
|
|
1438
|
-
/* ------------------------------------- */
|
|
1439
|
-
|
|
1440
|
-
.share-section { margin-bottom: 40px; }
|
|
1441
|
-
.sk-input { height: 50px; width: 100%; border-radius: 8px; margin-bottom: 16px; }
|
|
1442
|
-
|
|
1443
|
-
.social-buttons { display: flex; gap: 12px; }
|
|
1444
|
-
.sk-btn-social { flex: 1; height: 50px; border-radius: 8px; }
|
|
1445
|
-
|
|
1446
|
-
.stats-section {
|
|
1447
|
-
display: flex;
|
|
1448
|
-
gap: 24px;
|
|
1449
|
-
margin-bottom: 40px;
|
|
1450
|
-
padding: 30px 0;
|
|
1451
|
-
/* Removed border-top and border-bottom */
|
|
1452
|
-
}
|
|
1453
|
-
.stat-card { flex: 1; display: flex; flex-direction: column; align-items: center; }
|
|
1454
|
-
.stat-divider { padding-left: 24px; }
|
|
1455
|
-
.sk-stat-num { height: 48px; width: 120px; margin-bottom: 8px; }
|
|
1456
|
-
.sk-stat-label { height: 18px; width: 80px; }
|
|
1457
|
-
|
|
1458
|
-
/* Table Styles */
|
|
1459
|
-
.table-header { display: flex; gap: 16px; margin-bottom: 16px; }
|
|
1460
|
-
.sk-th { height: 16px; }
|
|
1461
|
-
.table-row {
|
|
1462
|
-
display: flex;
|
|
1463
|
-
align-items: center;
|
|
1464
|
-
gap: 16px;
|
|
1465
|
-
padding: 16px 0;
|
|
1466
|
-
/* Removed border-bottom */
|
|
1467
|
-
}
|
|
1468
|
-
|
|
1469
|
-
.col-user { flex: 2; }
|
|
1470
|
-
.col-status { flex: 1; }
|
|
1471
|
-
.col-reward { flex: 2; }
|
|
1472
|
-
.col-date { flex: 1; }
|
|
1473
|
-
|
|
1474
|
-
.sk-badge { height: 28px; width: 90px; border-radius: 14px; }
|
|
1475
|
-
.sk-reward-block { height: 36px; width: 100%; border-radius: 6px; }
|
|
1476
|
-
|
|
1477
|
-
.pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
|
|
1478
|
-
.sk-btn-page { height: 36px; width: 64px; border-radius: 6px; margin-bottom: 0; }
|
|
1479
|
-
|
|
1480
|
-
@media (max-width: 768px) {
|
|
1481
|
-
body { padding: 20px; }
|
|
1482
|
-
.widget-container { padding: 24px; }
|
|
1483
|
-
|
|
1484
|
-
.hero-section { flex-direction: column-reverse; gap: 24px; }
|
|
1485
|
-
.instant-access-layout { flex-direction: column; }
|
|
1486
|
-
|
|
1487
|
-
.hero-image { height: 220px; width: 100%; }
|
|
1488
|
-
.sk-title-lg { width: 100%; }
|
|
1489
|
-
|
|
1490
|
-
.col-date { display: none; }
|
|
1491
|
-
}
|
|
1492
|
-
</style>
|
|
1493
|
-
|
|
1494
|
-
<div class="widget-container">
|
|
1495
|
-
${type === "verified-access" ? referrerHTML : instantAccessHTML}
|
|
1496
|
-
</div>
|
|
1497
|
-
`;
|
|
1498
|
-
};
|
|
1499
|
-
const _log$6 = browserExports.debug("squatch-js:POPUPwidget");
|
|
1500
|
-
let popupId = 0;
|
|
1501
|
-
class PopupWidget extends Widget {
|
|
1502
|
-
constructor(params, trigger = ".squatchpop") {
|
|
1503
|
-
super(params);
|
|
1504
|
-
__publicField(this, "trigger");
|
|
1505
|
-
__publicField(this, "id");
|
|
1506
|
-
__publicField(this, "show", this.open);
|
|
1507
|
-
__publicField(this, "hide", this.close);
|
|
1508
|
-
this.trigger = trigger;
|
|
1509
|
-
if (this.container) {
|
|
1510
|
-
this.id = "squatchModal";
|
|
1511
|
-
} else {
|
|
1512
|
-
this.id = popupId === 0 ? `squatchModal` : `squatchModal__${popupId}`;
|
|
1513
|
-
popupId = popupId + 1;
|
|
1514
|
-
}
|
|
1515
|
-
document.head.insertAdjacentHTML(
|
|
1516
|
-
"beforeend",
|
|
1517
|
-
`<style>#${this.id}::-webkit-scrollbar { display: none; }</style>`
|
|
1518
|
-
);
|
|
1519
|
-
}
|
|
1520
|
-
_initialiseCTA() {
|
|
1521
|
-
if (!this.trigger) return;
|
|
1522
|
-
let triggerElement;
|
|
1523
|
-
try {
|
|
1524
|
-
triggerElement = document.querySelector(this.trigger) || document.querySelector(".impactpop");
|
|
1525
|
-
if (this.trigger && !triggerElement)
|
|
1526
|
-
_log$6("No element found with trigger selector", this.trigger);
|
|
1527
|
-
} catch {
|
|
1528
|
-
_log$6("Not a valid selector", this.trigger);
|
|
1529
|
-
}
|
|
1530
|
-
if (triggerElement) {
|
|
1531
|
-
triggerElement.onclick = () => {
|
|
1532
|
-
this.open();
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
_createPopupDialog() {
|
|
1537
|
-
var _a2, _b, _c;
|
|
1538
|
-
const dialog = document.createElement("dialog");
|
|
1539
|
-
const brandingConfig = (_b = (_a2 = this.context.widgetConfig) == null ? void 0 : _a2.values) == null ? void 0 : _b.brandingConfig;
|
|
1540
|
-
const sizes = (_c = brandingConfig == null ? void 0 : brandingConfig.widgetSize) == null ? void 0 : _c.popupWidgets;
|
|
1541
|
-
const minWidth = (sizes == null ? void 0 : sizes.minWidth) ? formatWidth(sizes.minWidth) : "auto";
|
|
1542
|
-
const maxWidth = (sizes == null ? void 0 : sizes.maxWidth) ? formatWidth(sizes.maxWidth) : "500px";
|
|
1543
|
-
dialog.id = this.id;
|
|
1544
|
-
dialog.setAttribute(
|
|
1545
|
-
"style",
|
|
1546
|
-
`width: 100%; min-width: ${minWidth}; max-width: ${maxWidth}; border: none; padding: 0;`
|
|
1547
|
-
);
|
|
1548
|
-
const onClick = (e) => {
|
|
1549
|
-
e.stopPropagation();
|
|
1550
|
-
if (e.target === dialog) dialog.close();
|
|
1551
|
-
};
|
|
1552
|
-
dialog.addEventListener("click", onClick);
|
|
1553
|
-
return dialog;
|
|
1554
|
-
}
|
|
1555
|
-
/*
|
|
1556
|
-
async load() {
|
|
1557
|
-
const frame = this._createFrame();
|
|
1558
|
-
this._initialiseCTA();
|
|
1559
|
-
|
|
1560
|
-
const element = this.container ? this._findElement() : document.body;
|
|
1561
|
-
|
|
1562
|
-
const dialogParent = element.shadowRoot || element;
|
|
1563
|
-
const dialog = this._createPopupDialog();
|
|
1564
|
-
dialog.appendChild(frame);
|
|
1565
|
-
|
|
1566
|
-
const skeletonHTML = getSkeleton({
|
|
1567
|
-
height: "100%",
|
|
1568
|
-
type: "verified-access",
|
|
1569
|
-
});
|
|
1570
|
-
|
|
1571
|
-
const skeletonContainer = document.createElement("div");
|
|
1572
|
-
skeletonContainer.id = "loading-skeleton";
|
|
1573
|
-
skeletonContainer.innerHTML = skeletonHTML;
|
|
1574
|
-
|
|
1575
|
-
if (dialogParent.lastChild?.nodeName === "DIALOG") {
|
|
1576
|
-
// Was reloaded
|
|
1577
|
-
dialogParent.replaceChild(dialog, dialogParent.lastChild);
|
|
1578
|
-
} else {
|
|
1579
|
-
// First time rendering
|
|
1580
|
-
dialogParent.appendChild(dialog);
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
const { contentWindow } = frame;
|
|
1584
|
-
if (!contentWindow) {
|
|
1585
|
-
throw new Error("Frame needs a content window");
|
|
1586
|
-
}
|
|
1587
|
-
|
|
1588
|
-
const frameDoc = contentWindow.document;
|
|
1589
|
-
frameDoc.open();
|
|
1590
|
-
frameDoc.write(this.content);
|
|
1591
|
-
frameDoc.write(
|
|
1592
|
-
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1593
|
-
);
|
|
1594
|
-
frameDoc.close();
|
|
1595
|
-
_log("Popup template loaded into iframe");
|
|
1596
|
-
await this._setupResizeHandler(frame);
|
|
1597
|
-
}
|
|
1598
|
-
*/
|
|
1599
|
-
async load() {
|
|
1600
|
-
var _a2;
|
|
1601
|
-
const frame = this._createFrame();
|
|
1602
|
-
this._initialiseCTA();
|
|
1603
|
-
const element = this.container ? this._findElement() : document.body;
|
|
1604
|
-
const dialogParent = element.shadowRoot || element;
|
|
1605
|
-
const dialog = this._createPopupDialog();
|
|
1606
|
-
const skeletonHTML = getSkeleton({
|
|
1607
|
-
height: "100%",
|
|
1608
|
-
type: "verified-access"
|
|
1609
|
-
});
|
|
1610
|
-
const skeletonContainer = document.createElement("div");
|
|
1611
|
-
skeletonContainer.id = "loading-skeleton";
|
|
1612
|
-
skeletonContainer.innerHTML = skeletonHTML;
|
|
1613
|
-
skeletonContainer.style.width = "100%";
|
|
1614
|
-
frame.style.display = "none";
|
|
1615
|
-
dialog.appendChild(skeletonContainer);
|
|
1616
|
-
dialog.appendChild(frame);
|
|
1617
|
-
if (((_a2 = dialogParent.lastChild) == null ? void 0 : _a2.nodeName) === "DIALOG") {
|
|
1618
|
-
dialogParent.replaceChild(dialog, dialogParent.lastChild);
|
|
1619
|
-
} else {
|
|
1620
|
-
dialogParent.appendChild(dialog);
|
|
1621
|
-
}
|
|
1622
|
-
const removeSkeleton = () => {
|
|
1623
|
-
const skel = dialog.querySelector("#loading-skeleton");
|
|
1624
|
-
if (skel) {
|
|
1625
|
-
skel.remove();
|
|
1626
|
-
}
|
|
1627
|
-
frame.style.display = "block";
|
|
1628
|
-
};
|
|
1629
|
-
frame.addEventListener("sq:load", removeSkeleton);
|
|
1630
|
-
frame.addEventListener("load", removeSkeleton);
|
|
1631
|
-
const safetyTimer = setTimeout(() => {
|
|
1632
|
-
removeSkeleton();
|
|
1633
|
-
}, 5e3);
|
|
1634
|
-
const { contentWindow } = frame;
|
|
1635
|
-
if (!contentWindow) {
|
|
1636
|
-
throw new Error("Frame needs a content window");
|
|
1637
|
-
}
|
|
1638
|
-
const frameDoc = contentWindow.document;
|
|
1639
|
-
frameDoc.open();
|
|
1640
|
-
frameDoc.write(this.content);
|
|
1641
|
-
frameDoc.write(
|
|
1642
|
-
`<script src="${this.npmCdn}/resize-observer-polyfill@1.5.x"><\/script>`
|
|
1643
|
-
);
|
|
1644
|
-
frameDoc.close();
|
|
1645
|
-
_log$6("Popup template loaded into iframe");
|
|
1646
|
-
await this._setupResizeHandler(frame);
|
|
1647
|
-
clearTimeout(safetyTimer);
|
|
1648
|
-
removeSkeleton();
|
|
1649
|
-
}
|
|
1650
|
-
async _setupResizeHandler(frame) {
|
|
1651
|
-
const { contentWindow } = frame;
|
|
1652
|
-
if (!contentWindow) {
|
|
1653
|
-
throw new Error("Frame needs a content window");
|
|
1330
|
+
</style>
|
|
1331
|
+
`);
|
|
1332
|
+
frameDoc.close();
|
|
1333
|
+
_log$6("Popup template loaded into iframe");
|
|
1334
|
+
await this._setupResizeHandler(frame);
|
|
1335
|
+
}
|
|
1336
|
+
async _setupResizeHandler(frame) {
|
|
1337
|
+
const { contentWindow } = frame;
|
|
1338
|
+
if (!contentWindow) {
|
|
1339
|
+
throw new Error("Frame needs a content window");
|
|
1654
1340
|
}
|
|
1655
1341
|
const frameDoc = contentWindow.document;
|
|
1656
1342
|
domready(frameDoc, async () => {
|
|
@@ -2187,6 +1873,264 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2187
1873
|
}
|
|
2188
1874
|
};
|
|
2189
1875
|
}
|
|
1876
|
+
const getSkeleton = ({
|
|
1877
|
+
type = "verified-access",
|
|
1878
|
+
height = "500px",
|
|
1879
|
+
skeletonBackgroundColor = "#e0e0e0",
|
|
1880
|
+
skeletonShimmerColor = "#f5f5f5"
|
|
1881
|
+
}) => {
|
|
1882
|
+
const referrerHTML = `
|
|
1883
|
+
<div class="hero-section">
|
|
1884
|
+
<div class="hero-content">
|
|
1885
|
+
<div class="skeleton sk-title-lg"></div>
|
|
1886
|
+
<div class="skeleton sk-text"></div>
|
|
1887
|
+
<div class="skeleton sk-text sk-text-short"></div>
|
|
1888
|
+
</div>
|
|
1889
|
+
<div class="skeleton hero-image"></div>
|
|
1890
|
+
</div>
|
|
1891
|
+
|
|
1892
|
+
<div class="share-section">
|
|
1893
|
+
<div class="skeleton sk-label"></div>
|
|
1894
|
+
<div class="skeleton sk-input"></div>
|
|
1895
|
+
<div class="social-buttons">
|
|
1896
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1897
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1898
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1899
|
+
<div class="skeleton sk-btn-social"></div>
|
|
1900
|
+
</div>
|
|
1901
|
+
</div>
|
|
1902
|
+
|
|
1903
|
+
<div class="skeleton sk-title-md" style="margin-top: 0; width: 30%; margin-left: auto; margin-right: auto"></div>
|
|
1904
|
+
<div class="skeleton sk-text" style="width: 60%; margin-left: auto; margin-right: auto"></div>
|
|
1905
|
+
|
|
1906
|
+
<div class="stats-section">
|
|
1907
|
+
<div class="stat-card">
|
|
1908
|
+
<div class="skeleton sk-stat-num"></div>
|
|
1909
|
+
<div class="skeleton sk-stat-label"></div>
|
|
1910
|
+
</div>
|
|
1911
|
+
<div class="stat-card stat-divider">
|
|
1912
|
+
<div class="skeleton sk-stat-num"></div>
|
|
1913
|
+
<div class="skeleton sk-stat-label"></div>
|
|
1914
|
+
</div>
|
|
1915
|
+
</div>
|
|
1916
|
+
|
|
1917
|
+
<div class="skeleton sk-title-md"></div>
|
|
1918
|
+
|
|
1919
|
+
<div class="table-header">
|
|
1920
|
+
<div class="skeleton sk-th col-user"></div>
|
|
1921
|
+
<div class="skeleton sk-th col-status"></div>
|
|
1922
|
+
<div class="skeleton sk-th col-reward"></div>
|
|
1923
|
+
<div class="skeleton sk-th col-date"></div>
|
|
1924
|
+
</div>
|
|
1925
|
+
|
|
1926
|
+
<div class="table-row">
|
|
1927
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 70%; margin: 0"></div></div>
|
|
1928
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1929
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1930
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1931
|
+
</div>
|
|
1932
|
+
|
|
1933
|
+
<div class="table-row">
|
|
1934
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 60%; margin: 0"></div></div>
|
|
1935
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1936
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1937
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1938
|
+
</div>
|
|
1939
|
+
|
|
1940
|
+
<div class="table-row">
|
|
1941
|
+
<div class="col-user"><div class="skeleton sk-text" style="width: 75%; margin: 0"></div></div>
|
|
1942
|
+
<div class="col-status"><div class="skeleton sk-badge" style="margin: 0"></div></div>
|
|
1943
|
+
<div class="col-reward"><div class="skeleton sk-reward-block" style="margin: 0"></div></div>
|
|
1944
|
+
<div class="col-date"><div class="skeleton sk-text" style="width: 80%; margin: 0"></div></div>
|
|
1945
|
+
</div>
|
|
1946
|
+
|
|
1947
|
+
<div class="pagination">
|
|
1948
|
+
<div class="skeleton sk-btn-page"></div>
|
|
1949
|
+
<div class="skeleton sk-btn-page"></div>
|
|
1950
|
+
</div>
|
|
1951
|
+
`;
|
|
1952
|
+
const instantAccessHTML = `
|
|
1953
|
+
<div class="hero-section instant-access-layout">
|
|
1954
|
+
<div class="skeleton hero-image ia-image"></div>
|
|
1955
|
+
|
|
1956
|
+
<div class="hero-content ia-content">
|
|
1957
|
+
<div class="skeleton sk-title-lg ia-center"></div>
|
|
1958
|
+
<div class="skeleton sk-text ia-center"></div>
|
|
1959
|
+
|
|
1960
|
+
<div class="skeleton sk-btn-action"></div>
|
|
1961
|
+
|
|
1962
|
+
<div class="skeleton sk-label"></div>
|
|
1963
|
+
<div class="input-group">
|
|
1964
|
+
<div class="skeleton sk-input"></div>
|
|
1965
|
+
<div class="skeleton sk-btn-copy"></div>
|
|
1966
|
+
</div>
|
|
1967
|
+
|
|
1968
|
+
<div class="skeleton sk-text-short ia-center" style="margin-top: 20px; width: 30%"></div>
|
|
1969
|
+
<div class="skeleton sk-text-short ia-center" style="width: 20%"></div>
|
|
1970
|
+
</div>
|
|
1971
|
+
</div>
|
|
1972
|
+
`;
|
|
1973
|
+
return `
|
|
1974
|
+
<style>
|
|
1975
|
+
* {
|
|
1976
|
+
box-sizing: border-box;
|
|
1977
|
+
padding: 0;
|
|
1978
|
+
margin: 0;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
.widget-container {
|
|
1982
|
+
background: white;
|
|
1983
|
+
width: 100%;
|
|
1984
|
+
padding: 40px;
|
|
1985
|
+
box-sizing: border-box;
|
|
1986
|
+
overflow: hidden;
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
@keyframes shimmer {
|
|
1990
|
+
0% { background-position: -100% 0; }
|
|
1991
|
+
100% { background-position: 100% 0; }
|
|
1992
|
+
}
|
|
1993
|
+
|
|
1994
|
+
.skeleton {
|
|
1995
|
+
background: ${skeletonBackgroundColor};
|
|
1996
|
+
background: linear-gradient(
|
|
1997
|
+
90deg,
|
|
1998
|
+
${skeletonBackgroundColor} 25%,
|
|
1999
|
+
${skeletonShimmerColor} 50%,
|
|
2000
|
+
${skeletonBackgroundColor} 75%
|
|
2001
|
+
);
|
|
2002
|
+
background-size: 200% 100%;
|
|
2003
|
+
animation: shimmer 1.5s infinite linear;
|
|
2004
|
+
border-radius: 6px;
|
|
2005
|
+
margin-bottom: 12px;
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
/* Typography Skeletons */
|
|
2009
|
+
.sk-title-lg { height: 36px; width: 80%; margin-bottom: 16px; }
|
|
2010
|
+
.sk-title-md { height: 28px; width: 30%; margin-bottom: 20px; margin-top: 40px; }
|
|
2011
|
+
.sk-text { height: 16px; width: 90%; margin-bottom: 8px; }
|
|
2012
|
+
.sk-text-short { width: 40%; }
|
|
2013
|
+
.sk-label { height: 14px; width: 25%; margin-bottom: 10px; }
|
|
2014
|
+
|
|
2015
|
+
/* Layouts */
|
|
2016
|
+
.hero-section {
|
|
2017
|
+
display: flex;
|
|
2018
|
+
gap: 40px;
|
|
2019
|
+
margin-bottom: 40px;
|
|
2020
|
+
padding-bottom: 40px;
|
|
2021
|
+
flex-direction: row;
|
|
2022
|
+
height: 100%;
|
|
2023
|
+
/* Removed border-bottom */
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
.hero-content {
|
|
2027
|
+
flex: 1;
|
|
2028
|
+
display: flex;
|
|
2029
|
+
flex-direction: column;
|
|
2030
|
+
justify-content: center;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
.hero-image {
|
|
2034
|
+
flex: 1;
|
|
2035
|
+
height: 300px;
|
|
2036
|
+
border-radius: 12px;
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
/* -- Specific Instant Access Overrides -- */
|
|
2040
|
+
.instant-access-layout {
|
|
2041
|
+
margin-bottom: 0;
|
|
2042
|
+
padding-bottom: 0;
|
|
2043
|
+
align-items: center;
|
|
2044
|
+
}
|
|
2045
|
+
.ia-image {
|
|
2046
|
+
height: 400px;
|
|
2047
|
+
}
|
|
2048
|
+
.ia-center {
|
|
2049
|
+
margin-left: auto;
|
|
2050
|
+
margin-right: auto;
|
|
2051
|
+
}
|
|
2052
|
+
.ia-content {
|
|
2053
|
+
align-items: center;
|
|
2054
|
+
text-align: center;
|
|
2055
|
+
}
|
|
2056
|
+
.sk-btn-action {
|
|
2057
|
+
height: 45px;
|
|
2058
|
+
width: 140px;
|
|
2059
|
+
border-radius: 6px;
|
|
2060
|
+
margin: 24px auto;
|
|
2061
|
+
}
|
|
2062
|
+
.input-group {
|
|
2063
|
+
display: flex;
|
|
2064
|
+
gap: 10px;
|
|
2065
|
+
width: 100%;
|
|
2066
|
+
max-width: 400px;
|
|
2067
|
+
}
|
|
2068
|
+
.sk-btn-copy {
|
|
2069
|
+
height: 50px;
|
|
2070
|
+
width: 120px;
|
|
2071
|
+
border-radius: 8px;
|
|
2072
|
+
}
|
|
2073
|
+
/* ------------------------------------- */
|
|
2074
|
+
|
|
2075
|
+
.share-section { margin-bottom: 40px; }
|
|
2076
|
+
.sk-input { height: 50px; width: 100%; border-radius: 8px; margin-bottom: 16px; }
|
|
2077
|
+
|
|
2078
|
+
.social-buttons { display: flex; gap: 12px; }
|
|
2079
|
+
.sk-btn-social { flex: 1; height: 50px; border-radius: 8px; }
|
|
2080
|
+
|
|
2081
|
+
.stats-section {
|
|
2082
|
+
display: flex;
|
|
2083
|
+
gap: 24px;
|
|
2084
|
+
margin-bottom: 40px;
|
|
2085
|
+
padding: 30px 0;
|
|
2086
|
+
/* Removed border-top and border-bottom */
|
|
2087
|
+
}
|
|
2088
|
+
.stat-card { flex: 1; display: flex; flex-direction: column; align-items: center; }
|
|
2089
|
+
.stat-divider { padding-left: 24px; }
|
|
2090
|
+
.sk-stat-num { height: 48px; width: 120px; margin-bottom: 8px; }
|
|
2091
|
+
.sk-stat-label { height: 18px; width: 80px; }
|
|
2092
|
+
|
|
2093
|
+
/* Table Styles */
|
|
2094
|
+
.table-header { display: flex; gap: 16px; margin-bottom: 16px; }
|
|
2095
|
+
.sk-th { height: 16px; }
|
|
2096
|
+
.table-row {
|
|
2097
|
+
display: flex;
|
|
2098
|
+
align-items: center;
|
|
2099
|
+
gap: 16px;
|
|
2100
|
+
padding: 16px 0;
|
|
2101
|
+
/* Removed border-bottom */
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
.col-user { flex: 2; }
|
|
2105
|
+
.col-status { flex: 1; }
|
|
2106
|
+
.col-reward { flex: 2; }
|
|
2107
|
+
.col-date { flex: 1; }
|
|
2108
|
+
|
|
2109
|
+
.sk-badge { height: 28px; width: 90px; border-radius: 14px; }
|
|
2110
|
+
.sk-reward-block { height: 36px; width: 100%; border-radius: 6px; }
|
|
2111
|
+
|
|
2112
|
+
.pagination { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
|
|
2113
|
+
.sk-btn-page { height: 36px; width: 64px; border-radius: 6px; margin-bottom: 0; }
|
|
2114
|
+
|
|
2115
|
+
@media (max-width: 768px) {
|
|
2116
|
+
body { padding: 20px; }
|
|
2117
|
+
.widget-container { padding: 24px; }
|
|
2118
|
+
|
|
2119
|
+
.hero-section { flex-direction: column-reverse; gap: 24px; }
|
|
2120
|
+
.instant-access-layout { flex-direction: column; }
|
|
2121
|
+
|
|
2122
|
+
.hero-image { height: 220px; width: 100%; }
|
|
2123
|
+
.sk-title-lg { width: 100%; }
|
|
2124
|
+
|
|
2125
|
+
.col-date { display: none; }
|
|
2126
|
+
}
|
|
2127
|
+
</style>
|
|
2128
|
+
|
|
2129
|
+
<div class="widget-container">
|
|
2130
|
+
${type === "verified-access" ? referrerHTML : instantAccessHTML}
|
|
2131
|
+
</div>
|
|
2132
|
+
`;
|
|
2133
|
+
};
|
|
2190
2134
|
const _log$2 = browserExports.debug("squatch-js:decodeUserJwt");
|
|
2191
2135
|
function decodeUserJwt(tokenStr) {
|
|
2192
2136
|
var _a2;
|