@lark-apaas/miaoda-coding-sdk 0.0.2-beta.1 → 0.0.3-alpha.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/doubao-runtime.dev.js +228 -124
- package/dist/doubao-runtime.js +228 -124
- package/dist/doubao-runtime.min.js +1 -1
- package/dist/runtime.dev.js +1 -1
- package/dist/runtime.js +1 -1
- package/dist/runtime.min.js +1 -1
- package/package.json +2 -2
|
@@ -1079,13 +1079,16 @@ var MiaodaRuntime = (() => {
|
|
|
1079
1079
|
|
|
1080
1080
|
// src/runtime/watermark.ts
|
|
1081
1081
|
var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
|
|
1082
|
-
var
|
|
1083
|
-
var
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
var DOUBAO_REPORT_ITEM_SRC = `${CDN}/_Dropdown-item.svg`;
|
|
1087
|
-
var DOUBAO_DONTSHOW_ITEM_SRC = `${CDN}/_Dropdown-item%20(1).svg`;
|
|
1082
|
+
var DOUBAO_AVATAR_SRC = `${CDN}/setting_voice.svg`;
|
|
1083
|
+
var DOUBAO_PILL_MOBILE_PNG = `${CDN}/Frame%202147223991%20(2).png`;
|
|
1084
|
+
var CLOSE_ICON_SVG = '<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>';
|
|
1085
|
+
var FEEDBACK_ICON_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>';
|
|
1088
1086
|
var REPORT_ENABLED = false;
|
|
1087
|
+
var BRAND_TEXT = "\u8C46\u5305AI";
|
|
1088
|
+
var POWERED_BY_TEXT = "\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301";
|
|
1089
|
+
var PILL_SHADOW = "0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)";
|
|
1090
|
+
var CARD_SHADOW = "0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)";
|
|
1091
|
+
var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
|
|
1089
1092
|
var REPORT_DOMAIN = {
|
|
1090
1093
|
BOE: "tns.feishu-boe.cn",
|
|
1091
1094
|
PRE: "tns.feishu-pre.cn",
|
|
@@ -1103,110 +1106,217 @@ var MiaodaRuntime = (() => {
|
|
|
1103
1106
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
1104
1107
|
}
|
|
1105
1108
|
__name(openDoubaoReport, "openDoubaoReport");
|
|
1106
|
-
function
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
zIndex: "9999",
|
|
1114
|
-
display: "flex",
|
|
1115
|
-
flexDirection: "column",
|
|
1116
|
-
alignItems: "flex-end"
|
|
1109
|
+
function makeCloseIcon(size) {
|
|
1110
|
+
const span = document.createElement("span");
|
|
1111
|
+
Object.assign(span.style, {
|
|
1112
|
+
display: "inline-flex",
|
|
1113
|
+
width: `${size}px`,
|
|
1114
|
+
height: `${size}px`,
|
|
1115
|
+
flexShrink: "0"
|
|
1117
1116
|
});
|
|
1117
|
+
span.innerHTML = CLOSE_ICON_SVG;
|
|
1118
|
+
const svg = span.firstElementChild;
|
|
1119
|
+
if (svg) {
|
|
1120
|
+
svg.setAttribute("width", String(size));
|
|
1121
|
+
svg.setAttribute("height", String(size));
|
|
1122
|
+
svg.style.display = "block";
|
|
1123
|
+
}
|
|
1124
|
+
return span;
|
|
1125
|
+
}
|
|
1126
|
+
__name(makeCloseIcon, "makeCloseIcon");
|
|
1127
|
+
function makeAvatar(size) {
|
|
1128
|
+
const img = document.createElement("img");
|
|
1129
|
+
img.src = DOUBAO_AVATAR_SRC;
|
|
1130
|
+
img.width = size;
|
|
1131
|
+
img.height = size;
|
|
1132
|
+
img.alt = "";
|
|
1133
|
+
Object.assign(img.style, {
|
|
1134
|
+
width: `${size}px`,
|
|
1135
|
+
height: `${size}px`,
|
|
1136
|
+
maxWidth: "none",
|
|
1137
|
+
maxHeight: "none",
|
|
1138
|
+
borderRadius: "100px",
|
|
1139
|
+
flexShrink: "0",
|
|
1140
|
+
display: "block"
|
|
1141
|
+
});
|
|
1142
|
+
return img;
|
|
1143
|
+
}
|
|
1144
|
+
__name(makeAvatar, "makeAvatar");
|
|
1145
|
+
function buildPill(variant, onClose) {
|
|
1146
|
+
const isDesktop = variant === "desktop";
|
|
1118
1147
|
const pill = document.createElement("div");
|
|
1119
1148
|
Object.assign(pill.style, {
|
|
1120
1149
|
boxSizing: "border-box",
|
|
1121
1150
|
display: "inline-flex",
|
|
1122
1151
|
alignItems: "center",
|
|
1123
|
-
gap: "4px",
|
|
1124
|
-
padding: "6px 12px 6px 8px",
|
|
1152
|
+
gap: isDesktop ? "4px" : "6px",
|
|
1153
|
+
padding: isDesktop ? "6px 12px 6px 8px" : "4px 12px 4px 8px",
|
|
1125
1154
|
background: "#363636",
|
|
1126
1155
|
border: "0.5px solid rgba(255,255,255,0.1)",
|
|
1127
1156
|
borderRadius: "100px",
|
|
1128
|
-
boxShadow:
|
|
1129
|
-
|
|
1130
|
-
const logo = document.createElement("img");
|
|
1131
|
-
logo.src = DOUBAO_LOGO_SRC;
|
|
1132
|
-
logo.width = 16;
|
|
1133
|
-
logo.height = 16;
|
|
1134
|
-
logo.alt = "";
|
|
1135
|
-
Object.assign(logo.style, {
|
|
1136
|
-
borderRadius: "100px",
|
|
1137
|
-
flexShrink: "0",
|
|
1138
|
-
display: "block"
|
|
1157
|
+
boxShadow: PILL_SHADOW,
|
|
1158
|
+
cursor: "pointer"
|
|
1139
1159
|
});
|
|
1160
|
+
const avatar = makeAvatar(isDesktop ? 16 : 18);
|
|
1140
1161
|
const text = document.createElement("span");
|
|
1141
|
-
text.textContent =
|
|
1162
|
+
text.textContent = BRAND_TEXT;
|
|
1142
1163
|
Object.assign(text.style, {
|
|
1143
|
-
fontFamily:
|
|
1144
|
-
fontSize: "12px",
|
|
1145
|
-
lineHeight: "18px",
|
|
1164
|
+
fontFamily: FONT_FAMILY,
|
|
1165
|
+
fontSize: isDesktop ? "12px" : "14px",
|
|
1166
|
+
lineHeight: isDesktop ? "18px" : "22px",
|
|
1146
1167
|
color: "rgba(255,255,255,0.85)",
|
|
1147
1168
|
whiteSpace: "nowrap"
|
|
1148
1169
|
});
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1170
|
+
pill.append(avatar, text);
|
|
1171
|
+
if (isDesktop && onClose) {
|
|
1172
|
+
const close = document.createElement("span");
|
|
1173
|
+
close.setAttribute("role", "button");
|
|
1174
|
+
close.setAttribute("aria-label", "\u5173\u95ED");
|
|
1175
|
+
Object.assign(close.style, {
|
|
1176
|
+
display: "inline-flex",
|
|
1177
|
+
alignItems: "center",
|
|
1178
|
+
cursor: "pointer",
|
|
1179
|
+
flexShrink: "0",
|
|
1180
|
+
color: "rgba(255,255,255,0.5)"
|
|
1181
|
+
});
|
|
1182
|
+
close.appendChild(makeCloseIcon(10));
|
|
1183
|
+
close.addEventListener("click", (e) => {
|
|
1184
|
+
e.stopPropagation();
|
|
1185
|
+
onClose();
|
|
1186
|
+
});
|
|
1187
|
+
pill.appendChild(close);
|
|
1188
|
+
}
|
|
1189
|
+
return pill;
|
|
1190
|
+
}
|
|
1191
|
+
__name(buildPill, "buildPill");
|
|
1192
|
+
function buildMenuRow(opts) {
|
|
1193
|
+
const row = document.createElement("div");
|
|
1194
|
+
row.setAttribute("role", "menuitem");
|
|
1195
|
+
row.setAttribute("data-label", opts.label);
|
|
1196
|
+
Object.assign(row.style, {
|
|
1197
|
+
boxSizing: "border-box",
|
|
1198
|
+
display: "flex",
|
|
1154
1199
|
alignItems: "center",
|
|
1200
|
+
gap: "8px",
|
|
1201
|
+
padding: "4px 10px",
|
|
1202
|
+
borderRadius: "6px",
|
|
1155
1203
|
cursor: "pointer",
|
|
1156
|
-
|
|
1204
|
+
color: "#000000"
|
|
1157
1205
|
});
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
close.addEventListener("click", (e) => {
|
|
1166
|
-
e.stopPropagation();
|
|
1167
|
-
container.remove();
|
|
1206
|
+
const icon = document.createElement("span");
|
|
1207
|
+
Object.assign(icon.style, {
|
|
1208
|
+
display: "inline-flex",
|
|
1209
|
+
width: "16px",
|
|
1210
|
+
height: "16px",
|
|
1211
|
+
flexShrink: "0",
|
|
1212
|
+
color: "#000000"
|
|
1168
1213
|
});
|
|
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
|
-
|
|
1214
|
+
if (opts.icon === "feedback") {
|
|
1215
|
+
icon.innerHTML = FEEDBACK_ICON_SVG;
|
|
1216
|
+
} else {
|
|
1217
|
+
icon.appendChild(makeCloseIcon(16));
|
|
1218
|
+
}
|
|
1219
|
+
const label = document.createElement("span");
|
|
1220
|
+
label.textContent = opts.label;
|
|
1221
|
+
Object.assign(label.style, {
|
|
1222
|
+
fontFamily: FONT_FAMILY,
|
|
1223
|
+
fontSize: `${opts.fontSize}px`,
|
|
1224
|
+
lineHeight: `${opts.fontSize + 8}px`,
|
|
1225
|
+
color: "#000000",
|
|
1226
|
+
whiteSpace: "nowrap"
|
|
1227
|
+
});
|
|
1228
|
+
row.append(icon, label);
|
|
1229
|
+
row.addEventListener("mouseenter", () => {
|
|
1230
|
+
row.style.background = "rgba(0,0,0,0.04)";
|
|
1231
|
+
});
|
|
1232
|
+
row.addEventListener("mouseleave", () => {
|
|
1233
|
+
row.style.background = "transparent";
|
|
1234
|
+
});
|
|
1235
|
+
row.addEventListener("click", opts.onClick);
|
|
1236
|
+
return row;
|
|
1237
|
+
}
|
|
1238
|
+
__name(buildMenuRow, "buildMenuRow");
|
|
1239
|
+
function buildMenuCard(opts) {
|
|
1240
|
+
const card = document.createElement("div");
|
|
1241
|
+
Object.assign(card.style, {
|
|
1242
|
+
boxSizing: "border-box",
|
|
1243
|
+
display: "flex",
|
|
1244
|
+
flexDirection: "column",
|
|
1245
|
+
minWidth: `${opts.minWidth}px`,
|
|
1246
|
+
background: "#ffffff",
|
|
1247
|
+
border: "0.5px solid rgba(0,0,0,0.1)",
|
|
1248
|
+
borderRadius: "10px",
|
|
1249
|
+
boxShadow: CARD_SHADOW,
|
|
1250
|
+
overflow: "hidden"
|
|
1251
|
+
});
|
|
1252
|
+
if (opts.rows.length) {
|
|
1253
|
+
const items = document.createElement("div");
|
|
1254
|
+
Object.assign(items.style, {
|
|
1255
|
+
boxSizing: "border-box",
|
|
1256
|
+
padding: "4px"
|
|
1194
1257
|
});
|
|
1258
|
+
opts.rows.forEach((r) => items.appendChild(r));
|
|
1259
|
+
card.appendChild(items);
|
|
1195
1260
|
}
|
|
1261
|
+
const footer = document.createElement("div");
|
|
1262
|
+
footer.textContent = POWERED_BY_TEXT;
|
|
1263
|
+
Object.assign(footer.style, {
|
|
1264
|
+
boxSizing: "border-box",
|
|
1265
|
+
background: "#f9f9f9",
|
|
1266
|
+
padding: "8px 14px",
|
|
1267
|
+
fontFamily: FONT_FAMILY,
|
|
1268
|
+
fontSize: `${opts.footerFontSize}px`,
|
|
1269
|
+
lineHeight: `${opts.footerFontSize + 8}px`,
|
|
1270
|
+
color: "rgba(0,0,0,0.35)",
|
|
1271
|
+
whiteSpace: "nowrap"
|
|
1272
|
+
});
|
|
1273
|
+
card.appendChild(footer);
|
|
1274
|
+
return card;
|
|
1275
|
+
}
|
|
1276
|
+
__name(buildMenuCard, "buildMenuCard");
|
|
1277
|
+
function buildDesktopWatermark() {
|
|
1278
|
+
const container = document.createElement("div");
|
|
1279
|
+
container.setAttribute("data-custom-element", "doubao-watermark");
|
|
1280
|
+
Object.assign(container.style, {
|
|
1281
|
+
position: "fixed",
|
|
1282
|
+
right: "12px",
|
|
1283
|
+
bottom: "12px",
|
|
1284
|
+
zIndex: "9999",
|
|
1285
|
+
display: "flex",
|
|
1286
|
+
flexDirection: "column",
|
|
1287
|
+
alignItems: "flex-end",
|
|
1288
|
+
gap: "8px"
|
|
1289
|
+
});
|
|
1290
|
+
const rows = [];
|
|
1291
|
+
if (REPORT_ENABLED) {
|
|
1292
|
+
rows.push(buildMenuRow({
|
|
1293
|
+
icon: "feedback",
|
|
1294
|
+
label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
1295
|
+
fontSize: 14,
|
|
1296
|
+
onClick: openDoubaoReport
|
|
1297
|
+
}));
|
|
1298
|
+
}
|
|
1299
|
+
const menu = buildMenuCard({
|
|
1300
|
+
rows,
|
|
1301
|
+
footerFontSize: 12,
|
|
1302
|
+
minWidth: 144
|
|
1303
|
+
});
|
|
1304
|
+
menu.style.display = "none";
|
|
1305
|
+
const pill = buildPill("desktop", () => container.remove());
|
|
1306
|
+
container.append(menu, pill);
|
|
1307
|
+
let timer = null;
|
|
1308
|
+
container.addEventListener("mouseenter", () => {
|
|
1309
|
+
if (timer) clearTimeout(timer);
|
|
1310
|
+
menu.style.display = "flex";
|
|
1311
|
+
});
|
|
1312
|
+
container.addEventListener("mouseleave", () => {
|
|
1313
|
+
timer = setTimeout(() => {
|
|
1314
|
+
menu.style.display = "none";
|
|
1315
|
+
}, 100);
|
|
1316
|
+
});
|
|
1196
1317
|
return container;
|
|
1197
1318
|
}
|
|
1198
1319
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1199
|
-
function mobileMenuItemStyle() {
|
|
1200
|
-
return {
|
|
1201
|
-
display: "block",
|
|
1202
|
-
width: "132px",
|
|
1203
|
-
height: "38px",
|
|
1204
|
-
maxWidth: "none",
|
|
1205
|
-
maxHeight: "none",
|
|
1206
|
-
cursor: "pointer"
|
|
1207
|
-
};
|
|
1208
|
-
}
|
|
1209
|
-
__name(mobileMenuItemStyle, "mobileMenuItemStyle");
|
|
1210
1320
|
function buildMobileWatermark() {
|
|
1211
1321
|
const wrapper = document.createElement("div");
|
|
1212
1322
|
wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
|
|
@@ -1219,12 +1329,12 @@ var MiaodaRuntime = (() => {
|
|
|
1219
1329
|
zIndex: "9999",
|
|
1220
1330
|
cursor: "pointer"
|
|
1221
1331
|
});
|
|
1222
|
-
const
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
Object.assign(
|
|
1332
|
+
const pill = document.createElement("img");
|
|
1333
|
+
pill.src = DOUBAO_PILL_MOBILE_PNG;
|
|
1334
|
+
pill.width = 129;
|
|
1335
|
+
pill.height = 94;
|
|
1336
|
+
pill.alt = "\u8C46\u5305AI";
|
|
1337
|
+
Object.assign(pill.style, {
|
|
1228
1338
|
position: "absolute",
|
|
1229
1339
|
right: "-12px",
|
|
1230
1340
|
bottom: "-40px",
|
|
@@ -1235,42 +1345,36 @@ var MiaodaRuntime = (() => {
|
|
|
1235
1345
|
display: "block",
|
|
1236
1346
|
pointerEvents: "none"
|
|
1237
1347
|
});
|
|
1238
|
-
wrapper.appendChild(
|
|
1239
|
-
const
|
|
1348
|
+
wrapper.appendChild(pill);
|
|
1349
|
+
const rows = [];
|
|
1350
|
+
if (REPORT_ENABLED) {
|
|
1351
|
+
rows.push(buildMenuRow({
|
|
1352
|
+
icon: "feedback",
|
|
1353
|
+
label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
1354
|
+
fontSize: 16,
|
|
1355
|
+
onClick: openDoubaoReport
|
|
1356
|
+
}));
|
|
1357
|
+
}
|
|
1358
|
+
rows.push(buildMenuRow({
|
|
1359
|
+
icon: "close",
|
|
1360
|
+
label: "\u4E0D\u518D\u5C55\u793A",
|
|
1361
|
+
fontSize: 16,
|
|
1362
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
1363
|
+
e.stopPropagation();
|
|
1364
|
+
wrapper.remove();
|
|
1365
|
+
}, "onClick")
|
|
1366
|
+
}));
|
|
1367
|
+
const menu = buildMenuCard({
|
|
1368
|
+
rows,
|
|
1369
|
+
footerFontSize: 14,
|
|
1370
|
+
minWidth: 160
|
|
1371
|
+
});
|
|
1240
1372
|
Object.assign(menu.style, {
|
|
1241
1373
|
position: "absolute",
|
|
1242
1374
|
right: "0",
|
|
1243
1375
|
bottom: "38px",
|
|
1244
|
-
display: "none"
|
|
1245
|
-
flexDirection: "column",
|
|
1246
|
-
background: "#fff",
|
|
1247
|
-
borderRadius: "12px",
|
|
1248
|
-
padding: "4px",
|
|
1249
|
-
boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
|
|
1250
|
-
zIndex: "10000",
|
|
1251
|
-
outline: "none"
|
|
1252
|
-
});
|
|
1253
|
-
if (REPORT_ENABLED) {
|
|
1254
|
-
const reportItem = document.createElement("img");
|
|
1255
|
-
reportItem.src = DOUBAO_REPORT_ITEM_SRC;
|
|
1256
|
-
reportItem.width = 132;
|
|
1257
|
-
reportItem.height = 38;
|
|
1258
|
-
reportItem.alt = "\u6295\u8BC9\u4E0E\u4E3E\u62A5";
|
|
1259
|
-
Object.assign(reportItem.style, mobileMenuItemStyle());
|
|
1260
|
-
reportItem.addEventListener("click", openDoubaoReport);
|
|
1261
|
-
menu.appendChild(reportItem);
|
|
1262
|
-
}
|
|
1263
|
-
const dontShow = document.createElement("img");
|
|
1264
|
-
dontShow.src = DOUBAO_DONTSHOW_ITEM_SRC;
|
|
1265
|
-
dontShow.width = 132;
|
|
1266
|
-
dontShow.height = 38;
|
|
1267
|
-
dontShow.alt = "\u4E0D\u518D\u5C55\u793A";
|
|
1268
|
-
Object.assign(dontShow.style, mobileMenuItemStyle());
|
|
1269
|
-
dontShow.addEventListener("click", (e) => {
|
|
1270
|
-
e.stopPropagation();
|
|
1271
|
-
wrapper.remove();
|
|
1376
|
+
display: "none"
|
|
1272
1377
|
});
|
|
1273
|
-
menu.appendChild(dontShow);
|
|
1274
1378
|
wrapper.appendChild(menu);
|
|
1275
1379
|
wrapper.addEventListener("click", (e) => {
|
|
1276
1380
|
e.stopPropagation();
|
|
@@ -1298,7 +1402,7 @@ var MiaodaRuntime = (() => {
|
|
|
1298
1402
|
__name(mountDoubaoWatermark, "mountDoubaoWatermark");
|
|
1299
1403
|
|
|
1300
1404
|
// src/doubao-runtime.ts
|
|
1301
|
-
var version = "0.0.
|
|
1405
|
+
var version = "0.0.3-alpha.0";
|
|
1302
1406
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1303
1407
|
if (false) {
|
|
1304
1408
|
reportPageView();
|
package/dist/doubao-runtime.js
CHANGED
|
@@ -1288,13 +1288,16 @@ var MiaodaRuntime = (() => {
|
|
|
1288
1288
|
|
|
1289
1289
|
// src/runtime/watermark.ts
|
|
1290
1290
|
var CDN = "https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui";
|
|
1291
|
-
var
|
|
1292
|
-
var
|
|
1293
|
-
var
|
|
1294
|
-
var
|
|
1295
|
-
var DOUBAO_REPORT_ITEM_SRC = `${CDN}/_Dropdown-item.svg`;
|
|
1296
|
-
var DOUBAO_DONTSHOW_ITEM_SRC = `${CDN}/_Dropdown-item%20(1).svg`;
|
|
1291
|
+
var DOUBAO_AVATAR_SRC = `${CDN}/setting_voice.svg`;
|
|
1292
|
+
var DOUBAO_PILL_MOBILE_PNG = `${CDN}/Frame%202147223991%20(2).png`;
|
|
1293
|
+
var CLOSE_ICON_SVG = '<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>';
|
|
1294
|
+
var FEEDBACK_ICON_SVG = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>';
|
|
1297
1295
|
var REPORT_ENABLED = false;
|
|
1296
|
+
var BRAND_TEXT = "\u8C46\u5305AI";
|
|
1297
|
+
var POWERED_BY_TEXT = "\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301";
|
|
1298
|
+
var PILL_SHADOW = "0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)";
|
|
1299
|
+
var CARD_SHADOW = "0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)";
|
|
1300
|
+
var FONT_FAMILY = "'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif";
|
|
1298
1301
|
var REPORT_DOMAIN = {
|
|
1299
1302
|
BOE: "tns.feishu-boe.cn",
|
|
1300
1303
|
PRE: "tns.feishu-pre.cn",
|
|
@@ -1312,110 +1315,217 @@ var MiaodaRuntime = (() => {
|
|
|
1312
1315
|
window.open(url, "_blank", "noopener,noreferrer");
|
|
1313
1316
|
}
|
|
1314
1317
|
__name(openDoubaoReport, "openDoubaoReport");
|
|
1315
|
-
function
|
|
1316
|
-
const
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
zIndex: "9999",
|
|
1323
|
-
display: "flex",
|
|
1324
|
-
flexDirection: "column",
|
|
1325
|
-
alignItems: "flex-end"
|
|
1318
|
+
function makeCloseIcon(size) {
|
|
1319
|
+
const span = document.createElement("span");
|
|
1320
|
+
Object.assign(span.style, {
|
|
1321
|
+
display: "inline-flex",
|
|
1322
|
+
width: `${size}px`,
|
|
1323
|
+
height: `${size}px`,
|
|
1324
|
+
flexShrink: "0"
|
|
1326
1325
|
});
|
|
1326
|
+
span.innerHTML = CLOSE_ICON_SVG;
|
|
1327
|
+
const svg = span.firstElementChild;
|
|
1328
|
+
if (svg) {
|
|
1329
|
+
svg.setAttribute("width", String(size));
|
|
1330
|
+
svg.setAttribute("height", String(size));
|
|
1331
|
+
svg.style.display = "block";
|
|
1332
|
+
}
|
|
1333
|
+
return span;
|
|
1334
|
+
}
|
|
1335
|
+
__name(makeCloseIcon, "makeCloseIcon");
|
|
1336
|
+
function makeAvatar(size) {
|
|
1337
|
+
const img = document.createElement("img");
|
|
1338
|
+
img.src = DOUBAO_AVATAR_SRC;
|
|
1339
|
+
img.width = size;
|
|
1340
|
+
img.height = size;
|
|
1341
|
+
img.alt = "";
|
|
1342
|
+
Object.assign(img.style, {
|
|
1343
|
+
width: `${size}px`,
|
|
1344
|
+
height: `${size}px`,
|
|
1345
|
+
maxWidth: "none",
|
|
1346
|
+
maxHeight: "none",
|
|
1347
|
+
borderRadius: "100px",
|
|
1348
|
+
flexShrink: "0",
|
|
1349
|
+
display: "block"
|
|
1350
|
+
});
|
|
1351
|
+
return img;
|
|
1352
|
+
}
|
|
1353
|
+
__name(makeAvatar, "makeAvatar");
|
|
1354
|
+
function buildPill(variant, onClose) {
|
|
1355
|
+
const isDesktop = variant === "desktop";
|
|
1327
1356
|
const pill = document.createElement("div");
|
|
1328
1357
|
Object.assign(pill.style, {
|
|
1329
1358
|
boxSizing: "border-box",
|
|
1330
1359
|
display: "inline-flex",
|
|
1331
1360
|
alignItems: "center",
|
|
1332
|
-
gap: "4px",
|
|
1333
|
-
padding: "6px 12px 6px 8px",
|
|
1361
|
+
gap: isDesktop ? "4px" : "6px",
|
|
1362
|
+
padding: isDesktop ? "6px 12px 6px 8px" : "4px 12px 4px 8px",
|
|
1334
1363
|
background: "#363636",
|
|
1335
1364
|
border: "0.5px solid rgba(255,255,255,0.1)",
|
|
1336
1365
|
borderRadius: "100px",
|
|
1337
|
-
boxShadow:
|
|
1338
|
-
|
|
1339
|
-
const logo = document.createElement("img");
|
|
1340
|
-
logo.src = DOUBAO_LOGO_SRC;
|
|
1341
|
-
logo.width = 16;
|
|
1342
|
-
logo.height = 16;
|
|
1343
|
-
logo.alt = "";
|
|
1344
|
-
Object.assign(logo.style, {
|
|
1345
|
-
borderRadius: "100px",
|
|
1346
|
-
flexShrink: "0",
|
|
1347
|
-
display: "block"
|
|
1366
|
+
boxShadow: PILL_SHADOW,
|
|
1367
|
+
cursor: "pointer"
|
|
1348
1368
|
});
|
|
1369
|
+
const avatar = makeAvatar(isDesktop ? 16 : 18);
|
|
1349
1370
|
const text = document.createElement("span");
|
|
1350
|
-
text.textContent =
|
|
1371
|
+
text.textContent = BRAND_TEXT;
|
|
1351
1372
|
Object.assign(text.style, {
|
|
1352
|
-
fontFamily:
|
|
1353
|
-
fontSize: "12px",
|
|
1354
|
-
lineHeight: "18px",
|
|
1373
|
+
fontFamily: FONT_FAMILY,
|
|
1374
|
+
fontSize: isDesktop ? "12px" : "14px",
|
|
1375
|
+
lineHeight: isDesktop ? "18px" : "22px",
|
|
1355
1376
|
color: "rgba(255,255,255,0.85)",
|
|
1356
1377
|
whiteSpace: "nowrap"
|
|
1357
1378
|
});
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1379
|
+
pill.append(avatar, text);
|
|
1380
|
+
if (isDesktop && onClose) {
|
|
1381
|
+
const close = document.createElement("span");
|
|
1382
|
+
close.setAttribute("role", "button");
|
|
1383
|
+
close.setAttribute("aria-label", "\u5173\u95ED");
|
|
1384
|
+
Object.assign(close.style, {
|
|
1385
|
+
display: "inline-flex",
|
|
1386
|
+
alignItems: "center",
|
|
1387
|
+
cursor: "pointer",
|
|
1388
|
+
flexShrink: "0",
|
|
1389
|
+
color: "rgba(255,255,255,0.5)"
|
|
1390
|
+
});
|
|
1391
|
+
close.appendChild(makeCloseIcon(10));
|
|
1392
|
+
close.addEventListener("click", (e) => {
|
|
1393
|
+
e.stopPropagation();
|
|
1394
|
+
onClose();
|
|
1395
|
+
});
|
|
1396
|
+
pill.appendChild(close);
|
|
1397
|
+
}
|
|
1398
|
+
return pill;
|
|
1399
|
+
}
|
|
1400
|
+
__name(buildPill, "buildPill");
|
|
1401
|
+
function buildMenuRow(opts) {
|
|
1402
|
+
const row = document.createElement("div");
|
|
1403
|
+
row.setAttribute("role", "menuitem");
|
|
1404
|
+
row.setAttribute("data-label", opts.label);
|
|
1405
|
+
Object.assign(row.style, {
|
|
1406
|
+
boxSizing: "border-box",
|
|
1407
|
+
display: "flex",
|
|
1363
1408
|
alignItems: "center",
|
|
1409
|
+
gap: "8px",
|
|
1410
|
+
padding: "4px 10px",
|
|
1411
|
+
borderRadius: "6px",
|
|
1364
1412
|
cursor: "pointer",
|
|
1365
|
-
|
|
1413
|
+
color: "#000000"
|
|
1366
1414
|
});
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
close.addEventListener("click", (e) => {
|
|
1375
|
-
e.stopPropagation();
|
|
1376
|
-
container.remove();
|
|
1415
|
+
const icon = document.createElement("span");
|
|
1416
|
+
Object.assign(icon.style, {
|
|
1417
|
+
display: "inline-flex",
|
|
1418
|
+
width: "16px",
|
|
1419
|
+
height: "16px",
|
|
1420
|
+
flexShrink: "0",
|
|
1421
|
+
color: "#000000"
|
|
1377
1422
|
});
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1423
|
+
if (opts.icon === "feedback") {
|
|
1424
|
+
icon.innerHTML = FEEDBACK_ICON_SVG;
|
|
1425
|
+
} else {
|
|
1426
|
+
icon.appendChild(makeCloseIcon(16));
|
|
1427
|
+
}
|
|
1428
|
+
const label = document.createElement("span");
|
|
1429
|
+
label.textContent = opts.label;
|
|
1430
|
+
Object.assign(label.style, {
|
|
1431
|
+
fontFamily: FONT_FAMILY,
|
|
1432
|
+
fontSize: `${opts.fontSize}px`,
|
|
1433
|
+
lineHeight: `${opts.fontSize + 8}px`,
|
|
1434
|
+
color: "#000000",
|
|
1435
|
+
whiteSpace: "nowrap"
|
|
1436
|
+
});
|
|
1437
|
+
row.append(icon, label);
|
|
1438
|
+
row.addEventListener("mouseenter", () => {
|
|
1439
|
+
row.style.background = "rgba(0,0,0,0.04)";
|
|
1440
|
+
});
|
|
1441
|
+
row.addEventListener("mouseleave", () => {
|
|
1442
|
+
row.style.background = "transparent";
|
|
1443
|
+
});
|
|
1444
|
+
row.addEventListener("click", opts.onClick);
|
|
1445
|
+
return row;
|
|
1446
|
+
}
|
|
1447
|
+
__name(buildMenuRow, "buildMenuRow");
|
|
1448
|
+
function buildMenuCard(opts) {
|
|
1449
|
+
const card = document.createElement("div");
|
|
1450
|
+
Object.assign(card.style, {
|
|
1451
|
+
boxSizing: "border-box",
|
|
1452
|
+
display: "flex",
|
|
1453
|
+
flexDirection: "column",
|
|
1454
|
+
minWidth: `${opts.minWidth}px`,
|
|
1455
|
+
background: "#ffffff",
|
|
1456
|
+
border: "0.5px solid rgba(0,0,0,0.1)",
|
|
1457
|
+
borderRadius: "10px",
|
|
1458
|
+
boxShadow: CARD_SHADOW,
|
|
1459
|
+
overflow: "hidden"
|
|
1460
|
+
});
|
|
1461
|
+
if (opts.rows.length) {
|
|
1462
|
+
const items = document.createElement("div");
|
|
1463
|
+
Object.assign(items.style, {
|
|
1464
|
+
boxSizing: "border-box",
|
|
1465
|
+
padding: "4px"
|
|
1403
1466
|
});
|
|
1467
|
+
opts.rows.forEach((r) => items.appendChild(r));
|
|
1468
|
+
card.appendChild(items);
|
|
1469
|
+
}
|
|
1470
|
+
const footer = document.createElement("div");
|
|
1471
|
+
footer.textContent = POWERED_BY_TEXT;
|
|
1472
|
+
Object.assign(footer.style, {
|
|
1473
|
+
boxSizing: "border-box",
|
|
1474
|
+
background: "#f9f9f9",
|
|
1475
|
+
padding: "8px 14px",
|
|
1476
|
+
fontFamily: FONT_FAMILY,
|
|
1477
|
+
fontSize: `${opts.footerFontSize}px`,
|
|
1478
|
+
lineHeight: `${opts.footerFontSize + 8}px`,
|
|
1479
|
+
color: "rgba(0,0,0,0.35)",
|
|
1480
|
+
whiteSpace: "nowrap"
|
|
1481
|
+
});
|
|
1482
|
+
card.appendChild(footer);
|
|
1483
|
+
return card;
|
|
1484
|
+
}
|
|
1485
|
+
__name(buildMenuCard, "buildMenuCard");
|
|
1486
|
+
function buildDesktopWatermark() {
|
|
1487
|
+
const container = document.createElement("div");
|
|
1488
|
+
container.setAttribute("data-custom-element", "doubao-watermark");
|
|
1489
|
+
Object.assign(container.style, {
|
|
1490
|
+
position: "fixed",
|
|
1491
|
+
right: "12px",
|
|
1492
|
+
bottom: "12px",
|
|
1493
|
+
zIndex: "9999",
|
|
1494
|
+
display: "flex",
|
|
1495
|
+
flexDirection: "column",
|
|
1496
|
+
alignItems: "flex-end",
|
|
1497
|
+
gap: "8px"
|
|
1498
|
+
});
|
|
1499
|
+
const rows = [];
|
|
1500
|
+
if (REPORT_ENABLED) {
|
|
1501
|
+
rows.push(buildMenuRow({
|
|
1502
|
+
icon: "feedback",
|
|
1503
|
+
label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
1504
|
+
fontSize: 14,
|
|
1505
|
+
onClick: openDoubaoReport
|
|
1506
|
+
}));
|
|
1404
1507
|
}
|
|
1508
|
+
const menu = buildMenuCard({
|
|
1509
|
+
rows,
|
|
1510
|
+
footerFontSize: 12,
|
|
1511
|
+
minWidth: 144
|
|
1512
|
+
});
|
|
1513
|
+
menu.style.display = "none";
|
|
1514
|
+
const pill = buildPill("desktop", () => container.remove());
|
|
1515
|
+
container.append(menu, pill);
|
|
1516
|
+
let timer = null;
|
|
1517
|
+
container.addEventListener("mouseenter", () => {
|
|
1518
|
+
if (timer) clearTimeout(timer);
|
|
1519
|
+
menu.style.display = "flex";
|
|
1520
|
+
});
|
|
1521
|
+
container.addEventListener("mouseleave", () => {
|
|
1522
|
+
timer = setTimeout(() => {
|
|
1523
|
+
menu.style.display = "none";
|
|
1524
|
+
}, 100);
|
|
1525
|
+
});
|
|
1405
1526
|
return container;
|
|
1406
1527
|
}
|
|
1407
1528
|
__name(buildDesktopWatermark, "buildDesktopWatermark");
|
|
1408
|
-
function mobileMenuItemStyle() {
|
|
1409
|
-
return {
|
|
1410
|
-
display: "block",
|
|
1411
|
-
width: "132px",
|
|
1412
|
-
height: "38px",
|
|
1413
|
-
maxWidth: "none",
|
|
1414
|
-
maxHeight: "none",
|
|
1415
|
-
cursor: "pointer"
|
|
1416
|
-
};
|
|
1417
|
-
}
|
|
1418
|
-
__name(mobileMenuItemStyle, "mobileMenuItemStyle");
|
|
1419
1529
|
function buildMobileWatermark() {
|
|
1420
1530
|
const wrapper = document.createElement("div");
|
|
1421
1531
|
wrapper.setAttribute("data-custom-element", "doubao-watermark-mobile");
|
|
@@ -1428,12 +1538,12 @@ var MiaodaRuntime = (() => {
|
|
|
1428
1538
|
zIndex: "9999",
|
|
1429
1539
|
cursor: "pointer"
|
|
1430
1540
|
});
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
Object.assign(
|
|
1541
|
+
const pill = document.createElement("img");
|
|
1542
|
+
pill.src = DOUBAO_PILL_MOBILE_PNG;
|
|
1543
|
+
pill.width = 129;
|
|
1544
|
+
pill.height = 94;
|
|
1545
|
+
pill.alt = "\u8C46\u5305AI";
|
|
1546
|
+
Object.assign(pill.style, {
|
|
1437
1547
|
position: "absolute",
|
|
1438
1548
|
right: "-12px",
|
|
1439
1549
|
bottom: "-40px",
|
|
@@ -1444,42 +1554,36 @@ var MiaodaRuntime = (() => {
|
|
|
1444
1554
|
display: "block",
|
|
1445
1555
|
pointerEvents: "none"
|
|
1446
1556
|
});
|
|
1447
|
-
wrapper.appendChild(
|
|
1448
|
-
const
|
|
1557
|
+
wrapper.appendChild(pill);
|
|
1558
|
+
const rows = [];
|
|
1559
|
+
if (REPORT_ENABLED) {
|
|
1560
|
+
rows.push(buildMenuRow({
|
|
1561
|
+
icon: "feedback",
|
|
1562
|
+
label: "\u6295\u8BC9\u4E0E\u4E3E\u62A5",
|
|
1563
|
+
fontSize: 16,
|
|
1564
|
+
onClick: openDoubaoReport
|
|
1565
|
+
}));
|
|
1566
|
+
}
|
|
1567
|
+
rows.push(buildMenuRow({
|
|
1568
|
+
icon: "close",
|
|
1569
|
+
label: "\u4E0D\u518D\u5C55\u793A",
|
|
1570
|
+
fontSize: 16,
|
|
1571
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
1572
|
+
e.stopPropagation();
|
|
1573
|
+
wrapper.remove();
|
|
1574
|
+
}, "onClick")
|
|
1575
|
+
}));
|
|
1576
|
+
const menu = buildMenuCard({
|
|
1577
|
+
rows,
|
|
1578
|
+
footerFontSize: 14,
|
|
1579
|
+
minWidth: 160
|
|
1580
|
+
});
|
|
1449
1581
|
Object.assign(menu.style, {
|
|
1450
1582
|
position: "absolute",
|
|
1451
1583
|
right: "0",
|
|
1452
1584
|
bottom: "38px",
|
|
1453
|
-
display: "none"
|
|
1454
|
-
flexDirection: "column",
|
|
1455
|
-
background: "#fff",
|
|
1456
|
-
borderRadius: "12px",
|
|
1457
|
-
padding: "4px",
|
|
1458
|
-
boxShadow: "0px 6px 16px rgba(0,0,0,0.12)",
|
|
1459
|
-
zIndex: "10000",
|
|
1460
|
-
outline: "none"
|
|
1461
|
-
});
|
|
1462
|
-
if (REPORT_ENABLED) {
|
|
1463
|
-
const reportItem = document.createElement("img");
|
|
1464
|
-
reportItem.src = DOUBAO_REPORT_ITEM_SRC;
|
|
1465
|
-
reportItem.width = 132;
|
|
1466
|
-
reportItem.height = 38;
|
|
1467
|
-
reportItem.alt = "\u6295\u8BC9\u4E0E\u4E3E\u62A5";
|
|
1468
|
-
Object.assign(reportItem.style, mobileMenuItemStyle());
|
|
1469
|
-
reportItem.addEventListener("click", openDoubaoReport);
|
|
1470
|
-
menu.appendChild(reportItem);
|
|
1471
|
-
}
|
|
1472
|
-
const dontShow = document.createElement("img");
|
|
1473
|
-
dontShow.src = DOUBAO_DONTSHOW_ITEM_SRC;
|
|
1474
|
-
dontShow.width = 132;
|
|
1475
|
-
dontShow.height = 38;
|
|
1476
|
-
dontShow.alt = "\u4E0D\u518D\u5C55\u793A";
|
|
1477
|
-
Object.assign(dontShow.style, mobileMenuItemStyle());
|
|
1478
|
-
dontShow.addEventListener("click", (e) => {
|
|
1479
|
-
e.stopPropagation();
|
|
1480
|
-
wrapper.remove();
|
|
1585
|
+
display: "none"
|
|
1481
1586
|
});
|
|
1482
|
-
menu.appendChild(dontShow);
|
|
1483
1587
|
wrapper.appendChild(menu);
|
|
1484
1588
|
wrapper.addEventListener("click", (e) => {
|
|
1485
1589
|
e.stopPropagation();
|
|
@@ -1507,7 +1611,7 @@ var MiaodaRuntime = (() => {
|
|
|
1507
1611
|
__name(mountDoubaoWatermark, "mountDoubaoWatermark");
|
|
1508
1612
|
|
|
1509
1613
|
// src/doubao-runtime.ts
|
|
1510
|
-
var version = "0.0.
|
|
1614
|
+
var version = "0.0.3-alpha.0";
|
|
1511
1615
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1512
1616
|
if (true) {
|
|
1513
1617
|
reportPageView();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var MiaodaRuntime=(()=>{var ht=Object.create;var L=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var gt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,_t=Object.prototype.hasOwnProperty;var c=(r,n)=>L(r,"name",{value:n,configurable:!0});var W=(r,n)=>()=>(n||r((n={exports:{}}).exports,n),n.exports),yt=(r,n)=>{for(var f in n)L(r,f,{get:n[f],enumerable:!0})},J=(r,n,f,h)=>{if(n&&typeof n=="object"||typeof n=="function")for(let p of gt(n))!_t.call(r,p)&&p!==f&&L(r,p,{get:()=>n[p],enumerable:!(h=mt(n,p))||h.enumerable});return r};var q=(r,n,f)=>(f=r!=null?ht(vt(r)):{},J(n||!r||!r.__esModule?L(f,"default",{value:r,enumerable:!0}):f,r)),bt=r=>J(L({},"__esModule",{value:!0}),r);var X=W((G,M)=>{"use strict";(function(r){"use strict";function n(t,u){var e=(t&65535)+(u&65535),y=(t>>16)+(u>>16)+(e>>16);return y<<16|e&65535}c(n,"safeAdd");function f(t,u){return t<<u|t>>>32-u}c(f,"bitRotateLeft");function h(t,u,e,y,w,S){return n(f(n(n(u,t),n(y,S)),w),e)}c(h,"md5cmn");function p(t,u,e,y,w,S,O){return h(u&e|~u&y,t,u,w,S,O)}c(p,"md5ff");function v(t,u,e,y,w,S,O){return h(u&y|e&~y,t,u,w,S,O)}c(v,"md5gg");function m(t,u,e,y,w,S,O){return h(u^e^y,t,u,w,S,O)}c(m,"md5hh");function g(t,u,e,y,w,S,O){return h(e^(u|~y),t,u,w,S,O)}c(g,"md5ii");function E(t,u){t[u>>5]|=128<<u%32,t[(u+64>>>9<<4)+14]=u;var e,y,w,S,O,i=1732584193,o=-271733879,a=-1732584194,s=271733878;for(e=0;e<t.length;e+=16)y=i,w=o,S=a,O=s,i=p(i,o,a,s,t[e],7,-680876936),s=p(s,i,o,a,t[e+1],12,-389564586),a=p(a,s,i,o,t[e+2],17,606105819),o=p(o,a,s,i,t[e+3],22,-1044525330),i=p(i,o,a,s,t[e+4],7,-176418897),s=p(s,i,o,a,t[e+5],12,1200080426),a=p(a,s,i,o,t[e+6],17,-1473231341),o=p(o,a,s,i,t[e+7],22,-45705983),i=p(i,o,a,s,t[e+8],7,1770035416),s=p(s,i,o,a,t[e+9],12,-1958414417),a=p(a,s,i,o,t[e+10],17,-42063),o=p(o,a,s,i,t[e+11],22,-1990404162),i=p(i,o,a,s,t[e+12],7,1804603682),s=p(s,i,o,a,t[e+13],12,-40341101),a=p(a,s,i,o,t[e+14],17,-1502002290),o=p(o,a,s,i,t[e+15],22,1236535329),i=v(i,o,a,s,t[e+1],5,-165796510),s=v(s,i,o,a,t[e+6],9,-1069501632),a=v(a,s,i,o,t[e+11],14,643717713),o=v(o,a,s,i,t[e],20,-373897302),i=v(i,o,a,s,t[e+5],5,-701558691),s=v(s,i,o,a,t[e+10],9,38016083),a=v(a,s,i,o,t[e+15],14,-660478335),o=v(o,a,s,i,t[e+4],20,-405537848),i=v(i,o,a,s,t[e+9],5,568446438),s=v(s,i,o,a,t[e+14],9,-1019803690),a=v(a,s,i,o,t[e+3],14,-187363961),o=v(o,a,s,i,t[e+8],20,1163531501),i=v(i,o,a,s,t[e+13],5,-1444681467),s=v(s,i,o,a,t[e+2],9,-51403784),a=v(a,s,i,o,t[e+7],14,1735328473),o=v(o,a,s,i,t[e+12],20,-1926607734),i=m(i,o,a,s,t[e+5],4,-378558),s=m(s,i,o,a,t[e+8],11,-2022574463),a=m(a,s,i,o,t[e+11],16,1839030562),o=m(o,a,s,i,t[e+14],23,-35309556),i=m(i,o,a,s,t[e+1],4,-1530992060),s=m(s,i,o,a,t[e+4],11,1272893353),a=m(a,s,i,o,t[e+7],16,-155497632),o=m(o,a,s,i,t[e+10],23,-1094730640),i=m(i,o,a,s,t[e+13],4,681279174),s=m(s,i,o,a,t[e],11,-358537222),a=m(a,s,i,o,t[e+3],16,-722521979),o=m(o,a,s,i,t[e+6],23,76029189),i=m(i,o,a,s,t[e+9],4,-640364487),s=m(s,i,o,a,t[e+12],11,-421815835),a=m(a,s,i,o,t[e+15],16,530742520),o=m(o,a,s,i,t[e+2],23,-995338651),i=g(i,o,a,s,t[e],6,-198630844),s=g(s,i,o,a,t[e+7],10,1126891415),a=g(a,s,i,o,t[e+14],15,-1416354905),o=g(o,a,s,i,t[e+5],21,-57434055),i=g(i,o,a,s,t[e+12],6,1700485571),s=g(s,i,o,a,t[e+3],10,-1894986606),a=g(a,s,i,o,t[e+10],15,-1051523),o=g(o,a,s,i,t[e+1],21,-2054922799),i=g(i,o,a,s,t[e+8],6,1873313359),s=g(s,i,o,a,t[e+15],10,-30611744),a=g(a,s,i,o,t[e+6],15,-1560198380),o=g(o,a,s,i,t[e+13],21,1309151649),i=g(i,o,a,s,t[e+4],6,-145523070),s=g(s,i,o,a,t[e+11],10,-1120210379),a=g(a,s,i,o,t[e+2],15,718787259),o=g(o,a,s,i,t[e+9],21,-343485551),i=n(i,y),o=n(o,w),a=n(a,S),s=n(s,O);return[i,o,a,s]}c(E,"binlMD5");function A(t){var u,e="",y=t.length*32;for(u=0;u<y;u+=8)e+=String.fromCharCode(t[u>>5]>>>u%32&255);return e}c(A,"binl2rstr");function x(t){var u,e=[];for(e[(t.length>>2)-1]=void 0,u=0;u<e.length;u+=1)e[u]=0;var y=t.length*8;for(u=0;u<y;u+=8)e[u>>5]|=(t.charCodeAt(u/8)&255)<<u%32;return e}c(x,"rstr2binl");function B(t){return A(E(x(t),t.length*8))}c(B,"rstrMD5");function I(t,u){var e,y=x(t),w=[],S=[],O;for(w[15]=S[15]=void 0,y.length>16&&(y=E(y,t.length*8)),e=0;e<16;e+=1)w[e]=y[e]^909522486,S[e]=y[e]^1549556828;return O=E(w.concat(x(u)),512+u.length*8),A(E(S.concat(O),640))}c(I,"rstrHMACMD5");function T(t){var u="0123456789abcdef",e="",y,w;for(w=0;w<t.length;w+=1)y=t.charCodeAt(w),e+=u.charAt(y>>>4&15)+u.charAt(y&15);return e}c(T,"rstr2hex");function C(t){return unescape(encodeURIComponent(t))}c(C,"str2rstrUTF8");function d(t){return B(C(t))}c(d,"rawMD5");function l(t){return T(d(t))}c(l,"hexMD5");function b(t,u){return I(C(t),C(u))}c(b,"rawHMACMD5");function _(t,u){return T(b(t,u))}c(_,"hexHMACMD5");function k(t,u,e){return u?e?b(u,t):_(u,t):e?d(t):l(t)}c(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof M=="object"&&M.exports?M.exports=k:r.md5=k})(G)});var Y=W((H,Q)=>{"use strict";(function(r,n){typeof H=="object"?Q.exports=H=n():typeof define=="function"&&define.amd?define([],n):r.CryptoJS=n()})(H,function(){var r=r||(function(n,f){var h=Object.create||(function(){function d(){}return c(d,"F"),function(l){var b;return d.prototype=l,b=new d,d.prototype=null,b}})(),p={},v=p.lib={},m=v.Base=(function(){return{extend:c(function(d){var l=h(this);return d&&l.mixIn(d),(!l.hasOwnProperty("init")||this.init===l.init)&&(l.init=function(){l.$super.init.apply(this,arguments)}),l.init.prototype=l,l.$super=this,l},"extend"),create:c(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:c(function(){},"init"),mixIn:c(function(d){for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:c(function(){return this.init.prototype.extend(this)},"clone")}})(),g=v.WordArray=m.extend({init:c(function(d,l){d=this.words=d||[],l!=f?this.sigBytes=l:this.sigBytes=d.length*4},"init"),toString:c(function(d){return(d||A).stringify(this)},"toString"),concat:c(function(d){var l=this.words,b=d.words,_=this.sigBytes,k=d.sigBytes;if(this.clamp(),_%4)for(var t=0;t<k;t++){var u=b[t>>>2]>>>24-t%4*8&255;l[_+t>>>2]|=u<<24-(_+t)%4*8}else for(var t=0;t<k;t+=4)l[_+t>>>2]=b[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:c(function(){var d=this.words,l=this.sigBytes;d[l>>>2]&=4294967295<<32-l%4*8,d.length=n.ceil(l/4)},"clamp"),clone:c(function(){var d=m.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:c(function(d){for(var l=[],b=c(function(e){var e=e,y=987654321,w=4294967295;return function(){y=36969*(y&65535)+(y>>16)&w,e=18e3*(e&65535)+(e>>16)&w;var S=(y<<16)+e&w;return S/=4294967296,S+=.5,S*(n.random()>.5?1:-1)}},"r"),_=0,k;_<d;_+=4){var t=b((k||n.random())*4294967296);k=t()*987654071,l.push(t()*4294967296|0)}return new g.init(l,d)},"random")}),E=p.enc={},A=E.Hex={stringify:c(function(d){for(var l=d.words,b=d.sigBytes,_=[],k=0;k<b;k++){var t=l[k>>>2]>>>24-k%4*8&255;_.push((t>>>4).toString(16)),_.push((t&15).toString(16))}return _.join("")},"stringify"),parse:c(function(d){for(var l=d.length,b=[],_=0;_<l;_+=2)b[_>>>3]|=parseInt(d.substr(_,2),16)<<24-_%8*4;return new g.init(b,l/2)},"parse")},x=E.Latin1={stringify:c(function(d){for(var l=d.words,b=d.sigBytes,_=[],k=0;k<b;k++){var t=l[k>>>2]>>>24-k%4*8&255;_.push(String.fromCharCode(t))}return _.join("")},"stringify"),parse:c(function(d){for(var l=d.length,b=[],_=0;_<l;_++)b[_>>>2]|=(d.charCodeAt(_)&255)<<24-_%4*8;return new g.init(b,l)},"parse")},B=E.Utf8={stringify:c(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:c(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},I=v.BufferedBlockAlgorithm=m.extend({reset:c(function(){this._data=new g.init,this._nDataBytes=0},"reset"),_append:c(function(d){typeof d=="string"&&(d=B.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:c(function(d){var l=this._data,b=l.words,_=l.sigBytes,k=this.blockSize,t=k*4,u=_/t;d?u=n.ceil(u):u=n.max((u|0)-this._minBufferSize,0);var e=u*k,y=n.min(e*4,_);if(e){for(var w=0;w<e;w+=k)this._doProcessBlock(b,w);var S=b.splice(0,e);l.sigBytes-=y}return new g.init(S,y)},"_process"),clone:c(function(){var d=m.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),T=v.Hasher=I.extend({cfg:m.extend(),init:c(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:c(function(){I.reset.call(this),this._doReset()},"reset"),update:c(function(d){return this._append(d),this._process(),this},"update"),finalize:c(function(d){d&&this._append(d);var l=this._doFinalize();return l},"finalize"),blockSize:512/32,_createHelper:c(function(d){return function(l,b){return new d.init(b).finalize(l)}},"_createHelper"),_createHmacHelper:c(function(d){return function(l,b){return new C.HMAC.init(d,b).finalize(l)}},"_createHmacHelper")}),C=p.algo={};return p})(Math);return r})});var tt=W((U,Z)=>{"use strict";(function(r,n){typeof U=="object"?Z.exports=U=n(Y()):typeof define=="function"&&define.amd?define(["./core"],n):n(r.CryptoJS)})(U,function(r){return(function(){var n=r,f=n.lib,h=f.WordArray,p=f.Hasher,v=n.algo,m=[],g=v.SHA1=p.extend({_doReset:c(function(){this._hash=new h.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:c(function(E,A){for(var x=this._hash.words,B=x[0],I=x[1],T=x[2],C=x[3],d=x[4],l=0;l<80;l++){if(l<16)m[l]=E[A+l]|0;else{var b=m[l-3]^m[l-8]^m[l-14]^m[l-16];m[l]=b<<1|b>>>31}var _=(B<<5|B>>>27)+d+m[l];l<20?_+=(I&T|~I&C)+1518500249:l<40?_+=(I^T^C)+1859775393:l<60?_+=(I&T|I&C|T&C)-1894007588:_+=(I^T^C)-899497514,d=C,C=T,T=I<<30|I>>>2,I=B,B=_}x[0]=x[0]+B|0,x[1]=x[1]+I|0,x[2]=x[2]+T|0,x[3]=x[3]+C|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:c(function(){var E=this._data,A=E.words,x=this._nDataBytes*8,B=E.sigBytes*8;return A[B>>>5]|=128<<24-B%32,A[(B+64>>>9<<4)+14]=Math.floor(x/4294967296),A[(B+64>>>9<<4)+15]=x,E.sigBytes=A.length*4,this._process(),this._hash},"_doFinalize"),clone:c(function(){var E=p.clone.call(this);return E._hash=this._hash.clone(),E},"clone")});n.SHA1=p._createHelper(g),n.HmacSHA1=p._createHmacHelper(g)})(),r.SHA1})});var zt={};yt(zt,{TrackKey:()=>$,name:()=>Ft,reportTeaEvent:()=>V,version:()=>Wt});var rt=q(X(),1),it=q(tt(),1);function D(){return window.appId||null}c(D,"getAppId");function wt(){var f;let r="suda-csrf-token",n=document.cookie.split("; ");for(let h of n){let[p,v]=h.split("=");if(p===r)return decodeURIComponent(v)}return(f=window.csrfToken)!=null?f:null}c(wt,"getCsrfToken");function F(){let r=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(r)}c(F,"isNewPathEnabled");function N(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}c(N,"getEnv");function j(){let r=navigator.userAgent,n=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(r),f=/iPad|Tab|Tablet/i.test(r)&&navigator.maxTouchPoints>1;return n||f}c(j,"isMobile");async function et(){var h;let r=D();if(!r)return{code:1,msg:"appId is required",data:{}};let n=F()?`/app/${r}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${r}/lark/user_info`;return await(await fetch(n,{headers:{"X-Suda-Csrf-Token":(h=wt())!=null?h:""}})).json()}c(et,"getLarkUserInfo");var $={VIEW:"aily_agent_artifact_page_view"},xt="08a441",kt="42b91e";function nt(r){let n=String(r);return(0,it.default)(xt+(0,rt.default)(n+kt)).toString()}c(nt,"encryptTea");var z=!1;async function St(){var v,m,g,E;let{data:r}=await et(),{tenantID:n,userID:f}=r||{},h=f&&f!=="0"?nt(f):void 0,p=n&&n!=="0"?nt(n):void 0;(v=window.collectEvent)==null||v.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(g=window.collectEvent)==null||g.call(window,"config",{user_unique_id:h,device_type:j()?"mobile":"pc",evtParams:{open_from:(m=new URLSearchParams(window.location.search).get("open-from"))!=null?m:void 0,env:N(),user_id:h,tenant_id:p}}),z=!0,(E=window.collectEvent)==null||E.call(window,"start")}c(St,"createTracker");async function V({trackKey:r,trackParams:n={}}){var f;try{z||(z=!0,await St()),(f=window.collectEvent)==null||f.call(window,r,n)}catch(h){console.error(h)}}c(V,"reportTeaEvent");function ot(){return V({trackKey:$.VIEW,trackParams:{artifact_uid:D(),agent_id:"agent_miaoda",url:window.location.href}})}c(ot,"reportPageView");function at(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let n=new Uint8Array(8);return crypto.getRandomValues(n),Array.from(n).map(f=>f.toString(16).padStart(2,"0")).join("")}let r="";for(let n=0;n<16;n++)r+=Math.floor(Math.random()*16).toString(16);return r}c(at,"generateUUID");var st="x_sdk_device_id";function Et(){try{let r=localStorage.getItem(st);return r||(r=at(),localStorage.setItem(st,r)),r}catch{return at()}}c(Et,"getDeviceId");function It(){let r=typeof navigator!="undefined"?navigator.userAgent:"";return r&&(/Android/i.test(r)&&/Mobile/i.test(r)||/iPhone|iPod/i.test(r)||/BlackBerry|IEMobile|Opera Mini/i.test(r))?"mobile":"desktop"}c(It,"getDeviceType");function Bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Et(),module:"app_web",app_env:"runtime",source_type:"user",device_type:It(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}c(Bt,"getDefaultAttributes");var Ct="1.0.0";function Ot(r){let n=Bt(),f=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Ct,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:r.map(h=>({attributes:{...n,url:h.url,path:h.path,referrer:h.referrer},startTimeUnixNano:String(BigInt(h.timestampMs)*BigInt(1e6)),timeUnixNano:f,asDouble:1}))}}]}}}c(Ot,"buildPayload");function Tt(r,n,f={}){if(n.length===0)return;let h=JSON.stringify(Ot(n));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...f},body:h,keepalive:!0}).catch(()=>{})}catch{}}c(Tt,"sendPvData");var P,At=(P=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(n){var f;if(this.started)return;this.config=n,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let h=(f=n.flushIntervalMs)!=null?f:1e4;this.flushTimer=setInterval(()=>this.flush(),h)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let n=window.location.href;this.lastUrl!==n&&(this.lastUrl=n,this.buffer.push({url:n,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let n=this.buffer.splice(0);Tt(this.config.collectorUrl,n,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(n){let f=history[n],h=c(()=>this.recordPv(),"recordPv");history[n]=function(...p){let v=f.apply(this,p);return h(),v}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},c(P,"_PvTracker"),P),ct=At.instance;function dt(){var f;let r=(f=D())!=null?f:"",n=F()?`/app/${r}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${r}/runtime/api/v1/observability/metrics/collect`;ct.start({collectorUrl:n})}c(dt,"initPvTracking");var R="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",Dt=`${R}/setting_voice.svg`,Pt=`${R}/icon_close_outlined.svg`,Rt=`${R}/%5BDBX%5DDropdown.svg`,Lt=`${R}/Frame%202147223991%20(4).svg`,Mt=`${R}/_Dropdown-item.svg`,Ht=`${R}/_Dropdown-item%20(1).svg`,ft=!1,Ut={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function pt(){var f;let r=JSON.stringify({scene:"miaoda_app_report",entity_id:(f=D())!=null?f:"",entity_type:"miaoda_app",extra:""}),n=`https://${Ut[N()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(r)}&lang=zh-CN`;window.open(n,"_blank","noopener,noreferrer")}c(pt,"openDoubaoReport");function Nt(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end"});let n=document.createElement("div");Object.assign(n.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:"6px 12px 6px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:"0px 2px 2px rgba(0,0,0,0.02), 0px 4px 8px rgba(0,0,0,0.04), 0px 8px 16px rgba(0,0,0,0.08)"});let f=document.createElement("img");f.src=Dt,f.width=16,f.height=16,f.alt="",Object.assign(f.style,{borderRadius:"100px",flexShrink:"0",display:"block"});let h=document.createElement("span");h.textContent="\u7531 \u8C46\u5305AI \u751F\u6210",Object.assign(h.style,{fontFamily:"'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",fontSize:"12px",lineHeight:"18px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"});let p=document.createElement("span");p.setAttribute("role","button"),p.setAttribute("aria-label","\u5173\u95ED"),Object.assign(p.style,{display:"inline-flex",alignItems:"center",cursor:"pointer",flexShrink:"0"});let v=document.createElement("img");if(v.src=Pt,v.width=10,v.height=10,v.alt="",v.style.display="block",p.appendChild(v),p.addEventListener("click",m=>{m.stopPropagation(),r.remove()}),n.append(f,h,p),r.appendChild(n),ft){let m=null,g=document.createElement("img");g.src=Rt,g.width=168,g.height=78,g.alt="\u6295\u8BC9\u4E0E\u4E3E\u62A5",Object.assign(g.style,{display:"none",cursor:"pointer",marginBottom:"-8px",marginRight:"-12px"}),g.addEventListener("click",pt),r.insertBefore(g,n),r.addEventListener("mouseenter",()=>{m&&clearTimeout(m),g.style.display="block"}),r.addEventListener("mouseleave",()=>{m=setTimeout(()=>{g.style.display="none"},100)})}return r}c(Nt,"buildDesktopWatermark");function lt(){return{display:"block",width:"132px",height:"38px",maxWidth:"none",maxHeight:"none",cursor:"pointer"}}c(lt,"mobileMenuItemStyle");function jt(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark-mobile"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",width:"85px",height:"30px",zIndex:"9999",cursor:"pointer"});let n=document.createElement("img");n.src=Lt,n.width=129,n.height=94,n.alt="\u8C46\u5305 AI \u751F\u6210",Object.assign(n.style,{position:"absolute",right:"-12px",bottom:"-40px",width:"129px",height:"94px",maxWidth:"none",maxHeight:"none",display:"block",pointerEvents:"none"}),r.appendChild(n);let f=document.createElement("div");if(Object.assign(f.style,{position:"absolute",right:"0",bottom:"38px",display:"none",flexDirection:"column",background:"#fff",borderRadius:"12px",padding:"4px",boxShadow:"0px 6px 16px rgba(0,0,0,0.12)",zIndex:"10000",outline:"none"}),ft){let p=document.createElement("img");p.src=Mt,p.width=132,p.height=38,p.alt="\u6295\u8BC9\u4E0E\u4E3E\u62A5",Object.assign(p.style,lt()),p.addEventListener("click",pt),f.appendChild(p)}let h=document.createElement("img");return h.src=Ht,h.width=132,h.height=38,h.alt="\u4E0D\u518D\u5C55\u793A",Object.assign(h.style,lt()),h.addEventListener("click",p=>{p.stopPropagation(),r.remove()}),f.appendChild(h),r.appendChild(f),r.addEventListener("click",p=>{p.stopPropagation(),f.style.display=f.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{f.style.display="none"}),r}c(jt,"buildMobileWatermark");var ut=!1;function K(){if(ut||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",K,{once:!0});return}ut=!0;let r=j()?jt():Nt();document.body.appendChild(r)}c(K,"mountDoubaoWatermark");var Wt="0.0.2-beta.1",Ft="@lark-apaas/miaoda-coding-sdk";ot(),dt();K();return bt(zt);})();
|
|
1
|
+
"use strict";var MiaodaRuntime=(()=>{var ve=Object.create;var D=Object.defineProperty;var be=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty;var i=(r,t)=>D(r,"name",{value:t,configurable:!0});var j=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),xe=(r,t)=>{for(var d in t)D(r,d,{get:t[d],enumerable:!0})},G=(r,t,d,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of ye(t))!we.call(r,h)&&h!==d&&D(r,h,{get:()=>t[h],enumerable:!(p=be(t,h))||p.enumerable});return r};var J=(r,t,d)=>(d=r!=null?ve(_e(r)):{},G(t||!r||!r.__esModule?D(d,"default",{value:r,enumerable:!0}):d,r)),Ce=r=>G(D({},"__esModule",{value:!0}),r);var q=j((X,H)=>{"use strict";(function(r){"use strict";function t(e,f){var n=(e&65535)+(f&65535),v=(e>>16)+(f>>16)+(n>>16);return v<<16|n&65535}i(t,"safeAdd");function d(e,f){return e<<f|e>>>32-f}i(d,"bitRotateLeft");function p(e,f,n,v,w,S){return t(d(t(t(f,e),t(v,S)),w),n)}i(p,"md5cmn");function h(e,f,n,v,w,S,A){return p(f&n|~f&v,e,f,w,S,A)}i(h,"md5ff");function b(e,f,n,v,w,S,A){return p(f&v|n&~v,e,f,w,S,A)}i(b,"md5gg");function g(e,f,n,v,w,S,A){return p(f^n^v,e,f,w,S,A)}i(g,"md5hh");function y(e,f,n,v,w,S,A){return p(n^(f|~v),e,f,w,S,A)}i(y,"md5ii");function k(e,f){e[f>>5]|=128<<f%32,e[(f+64>>>9<<4)+14]=f;var n,v,w,S,A,o=1732584193,a=-271733879,s=-1732584194,c=271733878;for(n=0;n<e.length;n+=16)v=o,w=a,S=s,A=c,o=h(o,a,s,c,e[n],7,-680876936),c=h(c,o,a,s,e[n+1],12,-389564586),s=h(s,c,o,a,e[n+2],17,606105819),a=h(a,s,c,o,e[n+3],22,-1044525330),o=h(o,a,s,c,e[n+4],7,-176418897),c=h(c,o,a,s,e[n+5],12,1200080426),s=h(s,c,o,a,e[n+6],17,-1473231341),a=h(a,s,c,o,e[n+7],22,-45705983),o=h(o,a,s,c,e[n+8],7,1770035416),c=h(c,o,a,s,e[n+9],12,-1958414417),s=h(s,c,o,a,e[n+10],17,-42063),a=h(a,s,c,o,e[n+11],22,-1990404162),o=h(o,a,s,c,e[n+12],7,1804603682),c=h(c,o,a,s,e[n+13],12,-40341101),s=h(s,c,o,a,e[n+14],17,-1502002290),a=h(a,s,c,o,e[n+15],22,1236535329),o=b(o,a,s,c,e[n+1],5,-165796510),c=b(c,o,a,s,e[n+6],9,-1069501632),s=b(s,c,o,a,e[n+11],14,643717713),a=b(a,s,c,o,e[n],20,-373897302),o=b(o,a,s,c,e[n+5],5,-701558691),c=b(c,o,a,s,e[n+10],9,38016083),s=b(s,c,o,a,e[n+15],14,-660478335),a=b(a,s,c,o,e[n+4],20,-405537848),o=b(o,a,s,c,e[n+9],5,568446438),c=b(c,o,a,s,e[n+14],9,-1019803690),s=b(s,c,o,a,e[n+3],14,-187363961),a=b(a,s,c,o,e[n+8],20,1163531501),o=b(o,a,s,c,e[n+13],5,-1444681467),c=b(c,o,a,s,e[n+2],9,-51403784),s=b(s,c,o,a,e[n+7],14,1735328473),a=b(a,s,c,o,e[n+12],20,-1926607734),o=g(o,a,s,c,e[n+5],4,-378558),c=g(c,o,a,s,e[n+8],11,-2022574463),s=g(s,c,o,a,e[n+11],16,1839030562),a=g(a,s,c,o,e[n+14],23,-35309556),o=g(o,a,s,c,e[n+1],4,-1530992060),c=g(c,o,a,s,e[n+4],11,1272893353),s=g(s,c,o,a,e[n+7],16,-155497632),a=g(a,s,c,o,e[n+10],23,-1094730640),o=g(o,a,s,c,e[n+13],4,681279174),c=g(c,o,a,s,e[n],11,-358537222),s=g(s,c,o,a,e[n+3],16,-722521979),a=g(a,s,c,o,e[n+6],23,76029189),o=g(o,a,s,c,e[n+9],4,-640364487),c=g(c,o,a,s,e[n+12],11,-421815835),s=g(s,c,o,a,e[n+15],16,530742520),a=g(a,s,c,o,e[n+2],23,-995338651),o=y(o,a,s,c,e[n],6,-198630844),c=y(c,o,a,s,e[n+7],10,1126891415),s=y(s,c,o,a,e[n+14],15,-1416354905),a=y(a,s,c,o,e[n+5],21,-57434055),o=y(o,a,s,c,e[n+12],6,1700485571),c=y(c,o,a,s,e[n+3],10,-1894986606),s=y(s,c,o,a,e[n+10],15,-1051523),a=y(a,s,c,o,e[n+1],21,-2054922799),o=y(o,a,s,c,e[n+8],6,1873313359),c=y(c,o,a,s,e[n+15],10,-30611744),s=y(s,c,o,a,e[n+6],15,-1560198380),a=y(a,s,c,o,e[n+13],21,1309151649),o=y(o,a,s,c,e[n+4],6,-145523070),c=y(c,o,a,s,e[n+11],10,-1120210379),s=y(s,c,o,a,e[n+2],15,718787259),a=y(a,s,c,o,e[n+9],21,-343485551),o=t(o,v),a=t(a,w),s=t(s,S),c=t(c,A);return[o,a,s,c]}i(k,"binlMD5");function T(e){var f,n="",v=e.length*32;for(f=0;f<v;f+=8)n+=String.fromCharCode(e[f>>5]>>>f%32&255);return n}i(T,"binl2rstr");function x(e){var f,n=[];for(n[(e.length>>2)-1]=void 0,f=0;f<n.length;f+=1)n[f]=0;var v=e.length*8;for(f=0;f<v;f+=8)n[f>>5]|=(e.charCodeAt(f/8)&255)<<f%32;return n}i(x,"rstr2binl");function I(e){return T(k(x(e),e.length*8))}i(I,"rstrMD5");function E(e,f){var n,v=x(e),w=[],S=[],A;for(w[15]=S[15]=void 0,v.length>16&&(v=k(v,e.length*8)),n=0;n<16;n+=1)w[n]=v[n]^909522486,S[n]=v[n]^1549556828;return A=k(w.concat(x(f)),512+f.length*8),T(k(S.concat(A),640))}i(E,"rstrHMACMD5");function L(e){var f="0123456789abcdef",n="",v,w;for(w=0;w<e.length;w+=1)v=e.charCodeAt(w),n+=f.charAt(v>>>4&15)+f.charAt(v&15);return n}i(L,"rstr2hex");function B(e){return unescape(encodeURIComponent(e))}i(B,"str2rstrUTF8");function l(e){return I(B(e))}i(l,"rawMD5");function u(e){return L(l(e))}i(u,"hexMD5");function _(e,f){return E(B(e),B(f))}i(_,"rawHMACMD5");function m(e,f){return L(_(e,f))}i(m,"hexHMACMD5");function C(e,f,n){return f?n?_(f,e):m(f,e):n?l(e):u(e)}i(C,"md5"),typeof define=="function"&&define.amd?define(function(){return C}):typeof H=="object"&&H.exports?H.exports=C:r.md5=C})(X)});var Q=j((M,Y)=>{"use strict";(function(r,t){typeof M=="object"?Y.exports=M=t():typeof define=="function"&&define.amd?define([],t):r.CryptoJS=t()})(M,function(){var r=r||(function(t,d){var p=Object.create||(function(){function l(){}return i(l,"F"),function(u){var _;return l.prototype=u,_=new l,l.prototype=null,_}})(),h={},b=h.lib={},g=b.Base=(function(){return{extend:i(function(l){var u=p(this);return l&&u.mixIn(l),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:i(function(){var l=this.extend();return l.init.apply(l,arguments),l},"create"),init:i(function(){},"init"),mixIn:i(function(l){for(var u in l)l.hasOwnProperty(u)&&(this[u]=l[u]);l.hasOwnProperty("toString")&&(this.toString=l.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),y=b.WordArray=g.extend({init:i(function(l,u){l=this.words=l||[],u!=d?this.sigBytes=u:this.sigBytes=l.length*4},"init"),toString:i(function(l){return(l||T).stringify(this)},"toString"),concat:i(function(l){var u=this.words,_=l.words,m=this.sigBytes,C=l.sigBytes;if(this.clamp(),m%4)for(var e=0;e<C;e++){var f=_[e>>>2]>>>24-e%4*8&255;u[m+e>>>2]|=f<<24-(m+e)%4*8}else for(var e=0;e<C;e+=4)u[m+e>>>2]=_[e>>>2];return this.sigBytes+=C,this},"concat"),clamp:i(function(){var l=this.words,u=this.sigBytes;l[u>>>2]&=4294967295<<32-u%4*8,l.length=t.ceil(u/4)},"clamp"),clone:i(function(){var l=g.clone.call(this);return l.words=this.words.slice(0),l},"clone"),random:i(function(l){for(var u=[],_=i(function(n){var n=n,v=987654321,w=4294967295;return function(){v=36969*(v&65535)+(v>>16)&w,n=18e3*(n&65535)+(n>>16)&w;var S=(v<<16)+n&w;return S/=4294967296,S+=.5,S*(t.random()>.5?1:-1)}},"r"),m=0,C;m<l;m+=4){var e=_((C||t.random())*4294967296);C=e()*987654071,u.push(e()*4294967296|0)}return new y.init(u,l)},"random")}),k=h.enc={},T=k.Hex={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,m=[],C=0;C<_;C++){var e=u[C>>>2]>>>24-C%4*8&255;m.push((e>>>4).toString(16)),m.push((e&15).toString(16))}return m.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],m=0;m<u;m+=2)_[m>>>3]|=parseInt(l.substr(m,2),16)<<24-m%8*4;return new y.init(_,u/2)},"parse")},x=k.Latin1={stringify:i(function(l){for(var u=l.words,_=l.sigBytes,m=[],C=0;C<_;C++){var e=u[C>>>2]>>>24-C%4*8&255;m.push(String.fromCharCode(e))}return m.join("")},"stringify"),parse:i(function(l){for(var u=l.length,_=[],m=0;m<u;m++)_[m>>>2]|=(l.charCodeAt(m)&255)<<24-m%4*8;return new y.init(_,u)},"parse")},I=k.Utf8={stringify:i(function(l){try{return decodeURIComponent(escape(x.stringify(l)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(l){return x.parse(unescape(encodeURIComponent(l)))},"parse")},E=b.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new y.init,this._nDataBytes=0},"reset"),_append:i(function(l){typeof l=="string"&&(l=I.parse(l)),this._data.concat(l),this._nDataBytes+=l.sigBytes},"_append"),_process:i(function(l){var u=this._data,_=u.words,m=u.sigBytes,C=this.blockSize,e=C*4,f=m/e;l?f=t.ceil(f):f=t.max((f|0)-this._minBufferSize,0);var n=f*C,v=t.min(n*4,m);if(n){for(var w=0;w<n;w+=C)this._doProcessBlock(_,w);var S=_.splice(0,n);u.sigBytes-=v}return new y.init(S,v)},"_process"),clone:i(function(){var l=g.clone.call(this);return l._data=this._data.clone(),l},"clone"),_minBufferSize:0}),L=b.Hasher=E.extend({cfg:g.extend(),init:i(function(l){this.cfg=this.cfg.extend(l),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(l){return this._append(l),this._process(),this},"update"),finalize:i(function(l){l&&this._append(l);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:i(function(l){return function(u,_){return new l.init(_).finalize(u)}},"_createHelper"),_createHmacHelper:i(function(l){return function(u,_){return new B.HMAC.init(l,_).finalize(u)}},"_createHmacHelper")}),B=h.algo={};return h})(Math);return r})});var te=j((R,ee)=>{"use strict";(function(r,t){typeof R=="object"?ee.exports=R=t(Q()):typeof define=="function"&&define.amd?define(["./core"],t):t(r.CryptoJS)})(R,function(r){return(function(){var t=r,d=t.lib,p=d.WordArray,h=d.Hasher,b=t.algo,g=[],y=b.SHA1=h.extend({_doReset:i(function(){this._hash=new p.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(k,T){for(var x=this._hash.words,I=x[0],E=x[1],L=x[2],B=x[3],l=x[4],u=0;u<80;u++){if(u<16)g[u]=k[T+u]|0;else{var _=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=_<<1|_>>>31}var m=(I<<5|I>>>27)+l+g[u];u<20?m+=(E&L|~E&B)+1518500249:u<40?m+=(E^L^B)+1859775393:u<60?m+=(E&L|E&B|L&B)-1894007588:m+=(E^L^B)-899497514,l=B,B=L,L=E<<30|E>>>2,E=I,I=m}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+L|0,x[3]=x[3]+B|0,x[4]=x[4]+l|0},"_doProcessBlock"),_doFinalize:i(function(){var k=this._data,T=k.words,x=this._nDataBytes*8,I=k.sigBytes*8;return T[I>>>5]|=128<<24-I%32,T[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),T[(I+64>>>9<<4)+15]=x,k.sigBytes=T.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});t.SHA1=h._createHelper(y),t.HmacSHA1=h._createHmacHelper(y)})(),r.SHA1})});var Xe={};xe(Xe,{TrackKey:()=>U,name:()=>Je,reportTeaEvent:()=>$,version:()=>Ge});var ie=J(q(),1),oe=J(te(),1);function O(){return window.appId||null}i(O,"getAppId");function Se(){var d;let r="suda-csrf-token",t=document.cookie.split("; ");for(let p of t){let[h,b]=p.split("=");if(h===r)return decodeURIComponent(b)}return(d=window.csrfToken)!=null?d:null}i(Se,"getCsrfToken");function W(){let r=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(r)}i(W,"isNewPathEnabled");function F(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(F,"getEnv");function N(){let r=navigator.userAgent,t=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(r),d=/iPad|Tab|Tablet/i.test(r)&&navigator.maxTouchPoints>1;return t||d}i(N,"isMobile");async function ne(){var p;let r=O();if(!r)return{code:1,msg:"appId is required",data:{}};let t=W()?`/app/${r}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${r}/lark/user_info`;return await(await fetch(t,{headers:{"X-Suda-Csrf-Token":(p=Se())!=null?p:""}})).json()}i(ne,"getLarkUserInfo");var U={VIEW:"aily_agent_artifact_page_view"},ke="08a441",Ee="42b91e";function re(r){let t=String(r);return(0,oe.default)(ke+(0,ie.default)(t+Ee)).toString()}i(re,"encryptTea");var z=!1;async function Ie(){var b,g,y,k;let{data:r}=await ne(),{tenantID:t,userID:d}=r||{},p=d&&d!=="0"?re(d):void 0,h=t&&t!=="0"?re(t):void 0;(b=window.collectEvent)==null||b.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(y=window.collectEvent)==null||y.call(window,"config",{user_unique_id:p,device_type:N()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:F(),user_id:p,tenant_id:h}}),z=!0,(k=window.collectEvent)==null||k.call(window,"start")}i(Ie,"createTracker");async function $({trackKey:r,trackParams:t={}}){var d;try{z||(z=!0,await Ie()),(d=window.collectEvent)==null||d.call(window,r,t)}catch(p){console.error(p)}}i($,"reportTeaEvent");function ae(){return $({trackKey:U.VIEW,trackParams:{artifact_uid:O(),agent_id:"agent_miaoda",url:window.location.href}})}i(ae,"reportPageView");function se(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t).map(d=>d.toString(16).padStart(2,"0")).join("")}let r="";for(let t=0;t<16;t++)r+=Math.floor(Math.random()*16).toString(16);return r}i(se,"generateUUID");var ce="x_sdk_device_id";function Be(){try{let r=localStorage.getItem(ce);return r||(r=se(),localStorage.setItem(ce,r)),r}catch{return se()}}i(Be,"getDeviceId");function Ae(){let r=typeof navigator!="undefined"?navigator.userAgent:"";return r&&(/Android/i.test(r)&&/Mobile/i.test(r)||/iPhone|iPod/i.test(r)||/BlackBerry|IEMobile|Opera Mini/i.test(r))?"mobile":"desktop"}i(Ae,"getDeviceType");function Le(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Be(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Ae(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}i(Le,"getDefaultAttributes");var Te="1.0.0";function Oe(r){let t=Le(),d=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:Te,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:r.map(p=>({attributes:{...t,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:String(BigInt(p.timestampMs)*BigInt(1e6)),timeUnixNano:d,asDouble:1}))}}]}}}i(Oe,"buildPayload");function Pe(r,t,d={}){if(t.length===0)return;let p=JSON.stringify(Oe(t));try{fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...d},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Pe,"sendPvData");var P,De=(P=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(t){var d;if(this.started)return;this.config=t,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let p=(d=t.flushIntervalMs)!=null?d:1e4;this.flushTimer=setInterval(()=>this.flush(),p)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let t=window.location.href;this.lastUrl!==t&&(this.lastUrl=t,this.buffer.push({url:t,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let t=this.buffer.splice(0);Pe(this.config.collectorUrl,t,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(t){let d=history[t],p=i(()=>this.recordPv(),"recordPv");history[t]=function(...h){let b=d.apply(this,h);return p(),b}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},i(P,"_PvTracker"),P),le=De.instance;function de(){var d;let r=(d=O())!=null?d:"",t=W()?`/app/${r}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${r}/runtime/api/v1/observability/metrics/collect`;le.start({collectorUrl:t})}i(de,"initPvTracking");var fe="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miaoda-ui",He=`${fe}/setting_voice.svg`,Me=`${fe}/Frame%202147223991%20(2).png`,Re='<svg viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.08312 8.08298C8.2384 7.92769 8.23953 7.67705 8.08424 7.52176L5.3625 4.80002L8.08422 2.07829C8.23951 1.92301 8.23839 1.67236 8.0831 1.51708C7.92781 1.36179 7.67717 1.36066 7.52188 1.51595C7.36659 1.67124 4.80016 4.23767 4.80016 4.23767L2.07841 1.51593C1.92313 1.36064 1.67248 1.36177 1.5172 1.51705C1.36191 1.67234 1.36078 1.92298 1.51607 2.07827L4.23782 4.80002L1.51605 7.52178C1.36076 7.67707 1.36189 7.92771 1.51718 8.083C1.67246 8.23829 1.92311 8.23941 2.07839 8.08412L4.80016 5.36236L7.5219 8.0841C7.67719 8.23939 7.92783 8.23826 8.08312 8.08298Z" fill="currentColor"/></svg>',Fe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.6667 2H3.33333V14H6.66667V15.3334H3.33333C2.59695 15.3334 2 14.7364 2 14V2C2 1.26364 2.59695 0.666687 3.33333 0.666687H12.6667C13.403 0.666687 14 1.26364 14 2V7.33335H12.6667V2Z" fill="currentColor"/><path d="M5.33333 4.66669C4.96514 4.66669 4.66667 4.96516 4.66667 5.33335C4.66667 5.70154 4.96514 6 5.33333 6H10.6667C11.0349 6 11.3333 5.70154 11.3333 5.33335C11.3333 4.96516 11.0349 4.66669 10.6667 4.66669H5.33333Z" fill="currentColor"/><path d="M4.66667 8.33335C4.66667 7.96516 4.96514 7.66669 5.33333 7.66669H8C8.36819 7.66669 8.66667 7.96516 8.66667 8.33335C8.66667 8.70154 8.36819 9 8 9H5.33333C4.96514 9 4.66667 8.70154 4.66667 8.33335Z" fill="currentColor"/><path d="M13.5523 8.70017C13.9428 8.30964 14.576 8.30964 14.9665 8.70017C15.357 9.09069 15.357 9.72386 14.9665 10.1144L14.2594 10.8215L12.8452 9.40728L13.5523 8.70017Z" fill="currentColor"/><path d="M12.1381 10.1144L13.5523 11.5286L10.2309 14.85C10.0916 14.9892 9.91229 15.0815 9.71798 15.1138L8.45737 15.3234C8.42136 15.3294 8.38467 15.3177 8.35885 15.2918C8.33271 15.2657 8.32099 15.2284 8.32749 15.192L8.55128 13.9374C8.58465 13.7502 8.6746 13.5779 8.80901 13.4435L12.1381 10.1144Z" fill="currentColor"/></svg>',pe=!1,Ne="\u8C46\u5305AI",je="\u7531\u98DE\u4E66\u5999\u642D\u63D0\u4F9B\u652F\u6301",We="0px 8px 32px rgba(0,0,0,0.08), 0px 4px 16px rgba(0,0,0,0.04), 0px 2px 4px rgba(0,0,0,0.02)",ze="0px 4px 16px rgba(0,0,0,0.03), 0px 4px 10px rgba(0,0,0,0.03), 0px 2px 4px rgba(0,0,0,0.02)",K="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",Ue={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function he(){var d;let r=JSON.stringify({scene:"miaoda_app_report",entity_id:(d=O())!=null?d:"",entity_type:"miaoda_app",extra:""}),t=`https://${Ue[F()]}/cust/lark_report/?type=common¶ms=${encodeURIComponent(r)}&lang=zh-CN`;window.open(t,"_blank","noopener,noreferrer")}i(he,"openDoubaoReport");function ge(r){let t=document.createElement("span");Object.assign(t.style,{display:"inline-flex",width:`${r}px`,height:`${r}px`,flexShrink:"0"}),t.innerHTML=Re;let d=t.firstElementChild;return d&&(d.setAttribute("width",String(r)),d.setAttribute("height",String(r)),d.style.display="block"),t}i(ge,"makeCloseIcon");function $e(r){let t=document.createElement("img");return t.src=He,t.width=r,t.height=r,t.alt="",Object.assign(t.style,{width:`${r}px`,height:`${r}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),t}i($e,"makeAvatar");function Ve(r,t){let d=r==="desktop",p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:d?"4px":"6px",padding:d?"6px 12px 6px 8px":"4px 12px 4px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:We,cursor:"pointer"});let h=$e(d?16:18),b=document.createElement("span");if(b.textContent=Ne,Object.assign(b.style,{fontFamily:K,fontSize:d?"12px":"14px",lineHeight:d?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),p.append(h,b),d&&t){let g=document.createElement("span");g.setAttribute("role","button"),g.setAttribute("aria-label","\u5173\u95ED"),Object.assign(g.style,{display:"inline-flex",alignItems:"center",cursor:"pointer",flexShrink:"0",color:"rgba(255,255,255,0.5)"}),g.appendChild(ge(10)),g.addEventListener("click",y=>{y.stopPropagation(),t()}),p.appendChild(g)}return p}i(Ve,"buildPill");function V(r){let t=document.createElement("div");t.setAttribute("role","menuitem"),t.setAttribute("data-label",r.label),Object.assign(t.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let d=document.createElement("span");Object.assign(d.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),r.icon==="feedback"?d.innerHTML=Fe:d.appendChild(ge(16));let p=document.createElement("span");return p.textContent=r.label,Object.assign(p.style,{fontFamily:K,fontSize:`${r.fontSize}px`,lineHeight:`${r.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),t.append(d,p),t.addEventListener("mouseenter",()=>{t.style.background="rgba(0,0,0,0.04)"}),t.addEventListener("mouseleave",()=>{t.style.background="transparent"}),t.addEventListener("click",r.onClick),t}i(V,"buildMenuRow");function me(r){let t=document.createElement("div");if(Object.assign(t.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${r.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:ze,overflow:"hidden"}),r.rows.length){let p=document.createElement("div");Object.assign(p.style,{boxSizing:"border-box",padding:"4px"}),r.rows.forEach(h=>p.appendChild(h)),t.appendChild(p)}let d=document.createElement("div");return d.textContent=je,Object.assign(d.style,{boxSizing:"border-box",background:"#f9f9f9",padding:"8px 14px",fontFamily:K,fontSize:`${r.footerFontSize}px`,lineHeight:`${r.footerFontSize+8}px`,color:"rgba(0,0,0,0.35)",whiteSpace:"nowrap"}),t.appendChild(d),t}i(me,"buildMenuCard");function Ke(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",zIndex:"9999",display:"flex",flexDirection:"column",alignItems:"flex-end",gap:"8px"});let t=[];pe&&t.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:he}));let d=me({rows:t,footerFontSize:12,minWidth:144});d.style.display="none";let p=Ve("desktop",()=>r.remove());r.append(d,p);let h=null;return r.addEventListener("mouseenter",()=>{h&&clearTimeout(h),d.style.display="flex"}),r.addEventListener("mouseleave",()=>{h=setTimeout(()=>{d.style.display="none"},100)}),r}i(Ke,"buildDesktopWatermark");function Ze(){let r=document.createElement("div");r.setAttribute("data-custom-element","doubao-watermark-mobile"),Object.assign(r.style,{position:"fixed",right:"12px",bottom:"12px",width:"85px",height:"30px",zIndex:"9999",cursor:"pointer"});let t=document.createElement("img");t.src=Me,t.width=129,t.height=94,t.alt="\u8C46\u5305AI",Object.assign(t.style,{position:"absolute",right:"-12px",bottom:"-40px",width:"129px",height:"94px",maxWidth:"none",maxHeight:"none",display:"block",pointerEvents:"none"}),r.appendChild(t);let d=[];pe&&d.push(V({icon:"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:he})),d.push(V({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(h=>{h.stopPropagation(),r.remove()},"onClick")}));let p=me({rows:d,footerFontSize:14,minWidth:160});return Object.assign(p.style,{position:"absolute",right:"0",bottom:"38px",display:"none"}),r.appendChild(p),r.addEventListener("click",h=>{h.stopPropagation(),p.style.display=p.style.display==="none"?"flex":"none"}),document.addEventListener("click",()=>{p.style.display="none"}),r}i(Ze,"buildMobileWatermark");var ue=!1;function Z(){if(ue||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",Z,{once:!0});return}ue=!0;let r=N()?Ze():Ke();document.body.appendChild(r)}i(Z,"mountDoubaoWatermark");var Ge="0.0.3-alpha.0",Je="@lark-apaas/miaoda-coding-sdk";ae(),de();Z();return Ce(Xe);})();
|
package/dist/runtime.dev.js
CHANGED
|
@@ -1078,7 +1078,7 @@ var MiaodaRuntime = (() => {
|
|
|
1078
1078
|
__name(reportTeaEvent, "reportTeaEvent");
|
|
1079
1079
|
|
|
1080
1080
|
// src/runtime.ts
|
|
1081
|
-
var version = "0.0.
|
|
1081
|
+
var version = "0.0.3-alpha.0";
|
|
1082
1082
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1083
1083
|
if (false) {
|
|
1084
1084
|
reportPageView();
|
package/dist/runtime.js
CHANGED
|
@@ -1287,7 +1287,7 @@ var MiaodaRuntime = (() => {
|
|
|
1287
1287
|
__name(initPvTracking, "initPvTracking");
|
|
1288
1288
|
|
|
1289
1289
|
// src/runtime.ts
|
|
1290
|
-
var version = "0.0.
|
|
1290
|
+
var version = "0.0.3-alpha.0";
|
|
1291
1291
|
var name = "@lark-apaas/miaoda-coding-sdk";
|
|
1292
1292
|
if (true) {
|
|
1293
1293
|
reportPageView();
|
package/dist/runtime.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var MiaodaRuntime=(()=>{var ct=Object.create;var M=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var c=(f,r)=>M(f,"name",{value:r,configurable:!0});var O=(f,r)=>()=>(r||f((r={exports:{}}).exports,r),r.exports),ht=(f,r)=>{for(var l in r)M(f,l,{get:r[l],enumerable:!0})},j=(f,r,l,_)=>{if(r&&typeof r=="object"||typeof r=="function")for(let h of ut(r))!lt.call(f,h)&&h!==l&&M(f,h,{get:()=>r[h],enumerable:!(_=ft(r,h))||_.enumerable});return f};var V=(f,r,l)=>(l=f!=null?ct(dt(f)):{},j(r||!f||!f.__esModule?M(l,"default",{value:f,enumerable:!0}):l,f)),pt=f=>j(M({},"__esModule",{value:!0}),f);var $=O((K,U)=>{"use strict";(function(f){"use strict";function r(t,d){var e=(t&65535)+(d&65535),v=(t>>16)+(d>>16)+(e>>16);return v<<16|e&65535}c(r,"safeAdd");function l(t,d){return t<<d|t>>>32-d}c(l,"bitRotateLeft");function _(t,d,e,v,w,I){return r(l(r(r(d,t),r(v,I)),w),e)}c(_,"md5cmn");function h(t,d,e,v,w,I,P){return _(d&e|~d&v,t,d,w,I,P)}c(h,"md5ff");function m(t,d,e,v,w,I,P){return _(d&v|e&~v,t,d,w,I,P)}c(m,"md5gg");function g(t,d,e,v,w,I,P){return _(d^e^v,t,d,w,I,P)}c(g,"md5hh");function b(t,d,e,v,w,I,P){return _(e^(d|~v),t,d,w,I,P)}c(b,"md5ii");function k(t,d){t[d>>5]|=128<<d%32,t[(d+64>>>9<<4)+14]=d;var e,v,w,I,P,n=1732584193,i=-271733879,a=-1732584194,o=271733878;for(e=0;e<t.length;e+=16)v=n,w=i,I=a,P=o,n=h(n,i,a,o,t[e],7,-680876936),o=h(o,n,i,a,t[e+1],12,-389564586),a=h(a,o,n,i,t[e+2],17,606105819),i=h(i,a,o,n,t[e+3],22,-1044525330),n=h(n,i,a,o,t[e+4],7,-176418897),o=h(o,n,i,a,t[e+5],12,1200080426),a=h(a,o,n,i,t[e+6],17,-1473231341),i=h(i,a,o,n,t[e+7],22,-45705983),n=h(n,i,a,o,t[e+8],7,1770035416),o=h(o,n,i,a,t[e+9],12,-1958414417),a=h(a,o,n,i,t[e+10],17,-42063),i=h(i,a,o,n,t[e+11],22,-1990404162),n=h(n,i,a,o,t[e+12],7,1804603682),o=h(o,n,i,a,t[e+13],12,-40341101),a=h(a,o,n,i,t[e+14],17,-1502002290),i=h(i,a,o,n,t[e+15],22,1236535329),n=m(n,i,a,o,t[e+1],5,-165796510),o=m(o,n,i,a,t[e+6],9,-1069501632),a=m(a,o,n,i,t[e+11],14,643717713),i=m(i,a,o,n,t[e],20,-373897302),n=m(n,i,a,o,t[e+5],5,-701558691),o=m(o,n,i,a,t[e+10],9,38016083),a=m(a,o,n,i,t[e+15],14,-660478335),i=m(i,a,o,n,t[e+4],20,-405537848),n=m(n,i,a,o,t[e+9],5,568446438),o=m(o,n,i,a,t[e+14],9,-1019803690),a=m(a,o,n,i,t[e+3],14,-187363961),i=m(i,a,o,n,t[e+8],20,1163531501),n=m(n,i,a,o,t[e+13],5,-1444681467),o=m(o,n,i,a,t[e+2],9,-51403784),a=m(a,o,n,i,t[e+7],14,1735328473),i=m(i,a,o,n,t[e+12],20,-1926607734),n=g(n,i,a,o,t[e+5],4,-378558),o=g(o,n,i,a,t[e+8],11,-2022574463),a=g(a,o,n,i,t[e+11],16,1839030562),i=g(i,a,o,n,t[e+14],23,-35309556),n=g(n,i,a,o,t[e+1],4,-1530992060),o=g(o,n,i,a,t[e+4],11,1272893353),a=g(a,o,n,i,t[e+7],16,-155497632),i=g(i,a,o,n,t[e+10],23,-1094730640),n=g(n,i,a,o,t[e+13],4,681279174),o=g(o,n,i,a,t[e],11,-358537222),a=g(a,o,n,i,t[e+3],16,-722521979),i=g(i,a,o,n,t[e+6],23,76029189),n=g(n,i,a,o,t[e+9],4,-640364487),o=g(o,n,i,a,t[e+12],11,-421815835),a=g(a,o,n,i,t[e+15],16,530742520),i=g(i,a,o,n,t[e+2],23,-995338651),n=b(n,i,a,o,t[e],6,-198630844),o=b(o,n,i,a,t[e+7],10,1126891415),a=b(a,o,n,i,t[e+14],15,-1416354905),i=b(i,a,o,n,t[e+5],21,-57434055),n=b(n,i,a,o,t[e+12],6,1700485571),o=b(o,n,i,a,t[e+3],10,-1894986606),a=b(a,o,n,i,t[e+10],15,-1051523),i=b(i,a,o,n,t[e+1],21,-2054922799),n=b(n,i,a,o,t[e+8],6,1873313359),o=b(o,n,i,a,t[e+15],10,-30611744),a=b(a,o,n,i,t[e+6],15,-1560198380),i=b(i,a,o,n,t[e+13],21,1309151649),n=b(n,i,a,o,t[e+4],6,-145523070),o=b(o,n,i,a,t[e+11],10,-1120210379),a=b(a,o,n,i,t[e+2],15,718787259),i=b(i,a,o,n,t[e+9],21,-343485551),n=r(n,v),i=r(i,w),a=r(a,I),o=r(o,P);return[n,i,a,o]}c(k,"binlMD5");function D(t){var d,e="",v=t.length*32;for(d=0;d<v;d+=8)e+=String.fromCharCode(t[d>>5]>>>d%32&255);return e}c(D,"binl2rstr");function S(t){var d,e=[];for(e[(t.length>>2)-1]=void 0,d=0;d<e.length;d+=1)e[d]=0;var v=t.length*8;for(d=0;d<v;d+=8)e[d>>5]|=(t.charCodeAt(d/8)&255)<<d%32;return e}c(S,"rstr2binl");function E(t){return D(k(S(t),t.length*8))}c(E,"rstrMD5");function T(t,d){var e,v=S(t),w=[],I=[],P;for(w[15]=I[15]=void 0,v.length>16&&(v=k(v,t.length*8)),e=0;e<16;e+=1)w[e]=v[e]^909522486,I[e]=v[e]^1549556828;return P=k(w.concat(S(d)),512+d.length*8),D(k(I.concat(P),640))}c(T,"rstrHMACMD5");function A(t){var d="0123456789abcdef",e="",v,w;for(w=0;w<t.length;w+=1)v=t.charCodeAt(w),e+=d.charAt(v>>>4&15)+d.charAt(v&15);return e}c(A,"rstr2hex");function C(t){return unescape(encodeURIComponent(t))}c(C,"str2rstrUTF8");function s(t){return E(C(t))}c(s,"rawMD5");function u(t){return A(s(t))}c(u,"hexMD5");function y(t,d){return T(C(t),C(d))}c(y,"rawHMACMD5");function p(t,d){return A(y(t,d))}c(p,"hexHMACMD5");function B(t,d,e){return d?e?y(d,t):p(d,t):e?s(t):u(t)}c(B,"md5"),typeof define=="function"&&define.amd?define(function(){return B}):typeof U=="object"&&U.exports?U.exports=B:f.md5=B})(K)});var q=O((L,J)=>{"use strict";(function(f,r){typeof L=="object"?J.exports=L=r():typeof define=="function"&&define.amd?define([],r):f.CryptoJS=r()})(L,function(){var f=f||(function(r,l){var _=Object.create||(function(){function s(){}return c(s,"F"),function(u){var y;return s.prototype=u,y=new s,s.prototype=null,y}})(),h={},m=h.lib={},g=m.Base=(function(){return{extend:c(function(s){var u=_(this);return s&&u.mixIn(s),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:c(function(){var s=this.extend();return s.init.apply(s,arguments),s},"create"),init:c(function(){},"init"),mixIn:c(function(s){for(var u in s)s.hasOwnProperty(u)&&(this[u]=s[u]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},"mixIn"),clone:c(function(){return this.init.prototype.extend(this)},"clone")}})(),b=m.WordArray=g.extend({init:c(function(s,u){s=this.words=s||[],u!=l?this.sigBytes=u:this.sigBytes=s.length*4},"init"),toString:c(function(s){return(s||D).stringify(this)},"toString"),concat:c(function(s){var u=this.words,y=s.words,p=this.sigBytes,B=s.sigBytes;if(this.clamp(),p%4)for(var t=0;t<B;t++){var d=y[t>>>2]>>>24-t%4*8&255;u[p+t>>>2]|=d<<24-(p+t)%4*8}else for(var t=0;t<B;t+=4)u[p+t>>>2]=y[t>>>2];return this.sigBytes+=B,this},"concat"),clamp:c(function(){var s=this.words,u=this.sigBytes;s[u>>>2]&=4294967295<<32-u%4*8,s.length=r.ceil(u/4)},"clamp"),clone:c(function(){var s=g.clone.call(this);return s.words=this.words.slice(0),s},"clone"),random:c(function(s){for(var u=[],y=c(function(e){var e=e,v=987654321,w=4294967295;return function(){v=36969*(v&65535)+(v>>16)&w,e=18e3*(e&65535)+(e>>16)&w;var I=(v<<16)+e&w;return I/=4294967296,I+=.5,I*(r.random()>.5?1:-1)}},"r"),p=0,B;p<s;p+=4){var t=y((B||r.random())*4294967296);B=t()*987654071,u.push(t()*4294967296|0)}return new b.init(u,s)},"random")}),k=h.enc={},D=k.Hex={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push((t>>>4).toString(16)),p.push((t&15).toString(16))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p+=2)y[p>>>3]|=parseInt(s.substr(p,2),16)<<24-p%8*4;return new b.init(y,u/2)},"parse")},S=k.Latin1={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push(String.fromCharCode(t))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p++)y[p>>>2]|=(s.charCodeAt(p)&255)<<24-p%4*8;return new b.init(y,u)},"parse")},E=k.Utf8={stringify:c(function(s){try{return decodeURIComponent(escape(S.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:c(function(s){return S.parse(unescape(encodeURIComponent(s)))},"parse")},T=m.BufferedBlockAlgorithm=g.extend({reset:c(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:c(function(s){typeof s=="string"&&(s=E.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},"_append"),_process:c(function(s){var u=this._data,y=u.words,p=u.sigBytes,B=this.blockSize,t=B*4,d=p/t;s?d=r.ceil(d):d=r.max((d|0)-this._minBufferSize,0);var e=d*B,v=r.min(e*4,p);if(e){for(var w=0;w<e;w+=B)this._doProcessBlock(y,w);var I=y.splice(0,e);u.sigBytes-=v}return new b.init(I,v)},"_process"),clone:c(function(){var s=g.clone.call(this);return s._data=this._data.clone(),s},"clone"),_minBufferSize:0}),A=m.Hasher=T.extend({cfg:g.extend(),init:c(function(s){this.cfg=this.cfg.extend(s),this.reset()},"init"),reset:c(function(){T.reset.call(this),this._doReset()},"reset"),update:c(function(s){return this._append(s),this._process(),this},"update"),finalize:c(function(s){s&&this._append(s);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:c(function(s){return function(u,y){return new s.init(y).finalize(u)}},"_createHelper"),_createHmacHelper:c(function(s){return function(u,y){return new C.HMAC.init(s,y).finalize(u)}},"_createHmacHelper")}),C=h.algo={};return h})(Math);return f})});var Q=O((N,G)=>{"use strict";(function(f,r){typeof N=="object"?G.exports=N=r(q()):typeof define=="function"&&define.amd?define(["./core"],r):r(f.CryptoJS)})(N,function(f){return(function(){var r=f,l=r.lib,_=l.WordArray,h=l.Hasher,m=r.algo,g=[],b=m.SHA1=h.extend({_doReset:c(function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:c(function(k,D){for(var S=this._hash.words,E=S[0],T=S[1],A=S[2],C=S[3],s=S[4],u=0;u<80;u++){if(u<16)g[u]=k[D+u]|0;else{var y=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=y<<1|y>>>31}var p=(E<<5|E>>>27)+s+g[u];u<20?p+=(T&A|~T&C)+1518500249:u<40?p+=(T^A^C)+1859775393:u<60?p+=(T&A|T&C|A&C)-1894007588:p+=(T^A^C)-899497514,s=C,C=A,A=T<<30|T>>>2,T=E,E=p}S[0]=S[0]+E|0,S[1]=S[1]+T|0,S[2]=S[2]+A|0,S[3]=S[3]+C|0,S[4]=S[4]+s|0},"_doProcessBlock"),_doFinalize:c(function(){var k=this._data,D=k.words,S=this._nDataBytes*8,E=k.sigBytes*8;return D[E>>>5]|=128<<24-E%32,D[(E+64>>>9<<4)+14]=Math.floor(S/4294967296),D[(E+64>>>9<<4)+15]=S,k.sigBytes=D.length*4,this._process(),this._hash},"_doFinalize"),clone:c(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});r.SHA1=h._createHelper(b),r.HmacSHA1=h._createHmacHelper(b)})(),f.SHA1})});var Ct={};ht(Ct,{TrackKey:()=>W,name:()=>Et,reportTeaEvent:()=>z,version:()=>Tt});var et=V($(),1),rt=V(Q(),1);function R(){return window.appId||null}c(R,"getAppId");function vt(){var l;let f="suda-csrf-token",r=document.cookie.split("; ");for(let _ of r){let[h,m]=_.split("=");if(h===f)return decodeURIComponent(m)}return(l=window.csrfToken)!=null?l:null}c(vt,"getCsrfToken");function x(){let f=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(f)}c(x,"isNewPathEnabled");function X(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}c(X,"getEnv");function Y(){let f=navigator.userAgent,r=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(f),l=/iPad|Tab|Tablet/i.test(f)&&navigator.maxTouchPoints>1;return r||l}c(Y,"isMobile");async function Z(){var _;let f=R();if(!f)return{code:1,msg:"appId is required",data:{}};let r=x()?`/app/${f}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${f}/lark/user_info`;return await(await fetch(r,{headers:{"X-Suda-Csrf-Token":(_=vt())!=null?_:""}})).json()}c(Z,"getLarkUserInfo");var W={VIEW:"aily_agent_artifact_page_view"},gt="08a441",_t="42b91e";function tt(f){let r=String(f);return(0,rt.default)(gt+(0,et.default)(r+_t)).toString()}c(tt,"encryptTea");var F=!1;async function mt(){var m,g,b,k;let{data:f}=await Z(),{tenantID:r,userID:l}=f||{},_=l&&l!=="0"?tt(l):void 0,h=r&&r!=="0"?tt(r):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(b=window.collectEvent)==null||b.call(window,"config",{user_unique_id:_,device_type:Y()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:X(),user_id:_,tenant_id:h}}),F=!0,(k=window.collectEvent)==null||k.call(window,"start")}c(mt,"createTracker");async function z({trackKey:f,trackParams:r={}}){var l;try{F||(F=!0,await mt()),(l=window.collectEvent)==null||l.call(window,f,r)}catch(_){console.error(_)}}c(z,"reportTeaEvent");function nt(){return z({trackKey:W.VIEW,trackParams:{artifact_uid:R(),agent_id:"agent_miaoda",url:window.location.href}})}c(nt,"reportPageView");function it(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let r=new Uint8Array(8);return crypto.getRandomValues(r),Array.from(r).map(l=>l.toString(16).padStart(2,"0")).join("")}let f="";for(let r=0;r<16;r++)f+=Math.floor(Math.random()*16).toString(16);return f}c(it,"generateUUID");var at="x_sdk_device_id";function yt(){try{let f=localStorage.getItem(at);return f||(f=it(),localStorage.setItem(at,f)),f}catch{return it()}}c(yt,"getDeviceId");function wt(){let f=typeof navigator!="undefined"?navigator.userAgent:"";return f&&(/Android/i.test(f)&&/Mobile/i.test(f)||/iPhone|iPod/i.test(f)||/BlackBerry|IEMobile|Opera Mini/i.test(f))?"mobile":"desktop"}c(wt,"getDeviceType");function bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:yt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:wt(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}c(bt,"getDefaultAttributes");var St="1.0.0";function Bt(f){let r=bt(),l=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:St,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:f.map(_=>({attributes:{...r,url:_.url,path:_.path,referrer:_.referrer},startTimeUnixNano:String(BigInt(_.timestampMs)*BigInt(1e6)),timeUnixNano:l,asDouble:1}))}}]}}}c(Bt,"buildPayload");function It(f,r,l={}){if(r.length===0)return;let _=JSON.stringify(Bt(r));try{fetch(f,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...l},body:_,keepalive:!0}).catch(()=>{})}catch{}}c(It,"sendPvData");var H,kt=(H=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new H),this._instance}start(r){var l;if(this.started)return;this.config=r,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let _=(l=r.flushIntervalMs)!=null?l:1e4;this.flushTimer=setInterval(()=>this.flush(),_)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let r=window.location.href;this.lastUrl!==r&&(this.lastUrl=r,this.buffer.push({url:r,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let r=this.buffer.splice(0);It(this.config.collectorUrl,r,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(r){let l=history[r],_=c(()=>this.recordPv(),"recordPv");history[r]=function(...h){let m=l.apply(this,h);return _(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},c(H,"_PvTracker"),H),ot=kt.instance;function st(){var l;let f=(l=R())!=null?l:"",r=x()?`/app/${f}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${f}/runtime/api/v1/observability/metrics/collect`;ot.start({collectorUrl:r})}c(st,"initPvTracking");var Tt="0.0.2-beta.1",Et="@lark-apaas/miaoda-coding-sdk";nt(),st();return pt(Ct);})();
|
|
1
|
+
"use strict";var MiaodaRuntime=(()=>{var ct=Object.create;var M=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ut=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,lt=Object.prototype.hasOwnProperty;var c=(f,r)=>M(f,"name",{value:r,configurable:!0});var O=(f,r)=>()=>(r||f((r={exports:{}}).exports,r),r.exports),ht=(f,r)=>{for(var l in r)M(f,l,{get:r[l],enumerable:!0})},j=(f,r,l,_)=>{if(r&&typeof r=="object"||typeof r=="function")for(let h of ut(r))!lt.call(f,h)&&h!==l&&M(f,h,{get:()=>r[h],enumerable:!(_=ft(r,h))||_.enumerable});return f};var V=(f,r,l)=>(l=f!=null?ct(dt(f)):{},j(r||!f||!f.__esModule?M(l,"default",{value:f,enumerable:!0}):l,f)),pt=f=>j(M({},"__esModule",{value:!0}),f);var $=O((K,U)=>{"use strict";(function(f){"use strict";function r(t,d){var e=(t&65535)+(d&65535),v=(t>>16)+(d>>16)+(e>>16);return v<<16|e&65535}c(r,"safeAdd");function l(t,d){return t<<d|t>>>32-d}c(l,"bitRotateLeft");function _(t,d,e,v,w,I){return r(l(r(r(d,t),r(v,I)),w),e)}c(_,"md5cmn");function h(t,d,e,v,w,I,P){return _(d&e|~d&v,t,d,w,I,P)}c(h,"md5ff");function m(t,d,e,v,w,I,P){return _(d&v|e&~v,t,d,w,I,P)}c(m,"md5gg");function g(t,d,e,v,w,I,P){return _(d^e^v,t,d,w,I,P)}c(g,"md5hh");function b(t,d,e,v,w,I,P){return _(e^(d|~v),t,d,w,I,P)}c(b,"md5ii");function k(t,d){t[d>>5]|=128<<d%32,t[(d+64>>>9<<4)+14]=d;var e,v,w,I,P,n=1732584193,i=-271733879,a=-1732584194,o=271733878;for(e=0;e<t.length;e+=16)v=n,w=i,I=a,P=o,n=h(n,i,a,o,t[e],7,-680876936),o=h(o,n,i,a,t[e+1],12,-389564586),a=h(a,o,n,i,t[e+2],17,606105819),i=h(i,a,o,n,t[e+3],22,-1044525330),n=h(n,i,a,o,t[e+4],7,-176418897),o=h(o,n,i,a,t[e+5],12,1200080426),a=h(a,o,n,i,t[e+6],17,-1473231341),i=h(i,a,o,n,t[e+7],22,-45705983),n=h(n,i,a,o,t[e+8],7,1770035416),o=h(o,n,i,a,t[e+9],12,-1958414417),a=h(a,o,n,i,t[e+10],17,-42063),i=h(i,a,o,n,t[e+11],22,-1990404162),n=h(n,i,a,o,t[e+12],7,1804603682),o=h(o,n,i,a,t[e+13],12,-40341101),a=h(a,o,n,i,t[e+14],17,-1502002290),i=h(i,a,o,n,t[e+15],22,1236535329),n=m(n,i,a,o,t[e+1],5,-165796510),o=m(o,n,i,a,t[e+6],9,-1069501632),a=m(a,o,n,i,t[e+11],14,643717713),i=m(i,a,o,n,t[e],20,-373897302),n=m(n,i,a,o,t[e+5],5,-701558691),o=m(o,n,i,a,t[e+10],9,38016083),a=m(a,o,n,i,t[e+15],14,-660478335),i=m(i,a,o,n,t[e+4],20,-405537848),n=m(n,i,a,o,t[e+9],5,568446438),o=m(o,n,i,a,t[e+14],9,-1019803690),a=m(a,o,n,i,t[e+3],14,-187363961),i=m(i,a,o,n,t[e+8],20,1163531501),n=m(n,i,a,o,t[e+13],5,-1444681467),o=m(o,n,i,a,t[e+2],9,-51403784),a=m(a,o,n,i,t[e+7],14,1735328473),i=m(i,a,o,n,t[e+12],20,-1926607734),n=g(n,i,a,o,t[e+5],4,-378558),o=g(o,n,i,a,t[e+8],11,-2022574463),a=g(a,o,n,i,t[e+11],16,1839030562),i=g(i,a,o,n,t[e+14],23,-35309556),n=g(n,i,a,o,t[e+1],4,-1530992060),o=g(o,n,i,a,t[e+4],11,1272893353),a=g(a,o,n,i,t[e+7],16,-155497632),i=g(i,a,o,n,t[e+10],23,-1094730640),n=g(n,i,a,o,t[e+13],4,681279174),o=g(o,n,i,a,t[e],11,-358537222),a=g(a,o,n,i,t[e+3],16,-722521979),i=g(i,a,o,n,t[e+6],23,76029189),n=g(n,i,a,o,t[e+9],4,-640364487),o=g(o,n,i,a,t[e+12],11,-421815835),a=g(a,o,n,i,t[e+15],16,530742520),i=g(i,a,o,n,t[e+2],23,-995338651),n=b(n,i,a,o,t[e],6,-198630844),o=b(o,n,i,a,t[e+7],10,1126891415),a=b(a,o,n,i,t[e+14],15,-1416354905),i=b(i,a,o,n,t[e+5],21,-57434055),n=b(n,i,a,o,t[e+12],6,1700485571),o=b(o,n,i,a,t[e+3],10,-1894986606),a=b(a,o,n,i,t[e+10],15,-1051523),i=b(i,a,o,n,t[e+1],21,-2054922799),n=b(n,i,a,o,t[e+8],6,1873313359),o=b(o,n,i,a,t[e+15],10,-30611744),a=b(a,o,n,i,t[e+6],15,-1560198380),i=b(i,a,o,n,t[e+13],21,1309151649),n=b(n,i,a,o,t[e+4],6,-145523070),o=b(o,n,i,a,t[e+11],10,-1120210379),a=b(a,o,n,i,t[e+2],15,718787259),i=b(i,a,o,n,t[e+9],21,-343485551),n=r(n,v),i=r(i,w),a=r(a,I),o=r(o,P);return[n,i,a,o]}c(k,"binlMD5");function D(t){var d,e="",v=t.length*32;for(d=0;d<v;d+=8)e+=String.fromCharCode(t[d>>5]>>>d%32&255);return e}c(D,"binl2rstr");function S(t){var d,e=[];for(e[(t.length>>2)-1]=void 0,d=0;d<e.length;d+=1)e[d]=0;var v=t.length*8;for(d=0;d<v;d+=8)e[d>>5]|=(t.charCodeAt(d/8)&255)<<d%32;return e}c(S,"rstr2binl");function E(t){return D(k(S(t),t.length*8))}c(E,"rstrMD5");function T(t,d){var e,v=S(t),w=[],I=[],P;for(w[15]=I[15]=void 0,v.length>16&&(v=k(v,t.length*8)),e=0;e<16;e+=1)w[e]=v[e]^909522486,I[e]=v[e]^1549556828;return P=k(w.concat(S(d)),512+d.length*8),D(k(I.concat(P),640))}c(T,"rstrHMACMD5");function A(t){var d="0123456789abcdef",e="",v,w;for(w=0;w<t.length;w+=1)v=t.charCodeAt(w),e+=d.charAt(v>>>4&15)+d.charAt(v&15);return e}c(A,"rstr2hex");function C(t){return unescape(encodeURIComponent(t))}c(C,"str2rstrUTF8");function s(t){return E(C(t))}c(s,"rawMD5");function u(t){return A(s(t))}c(u,"hexMD5");function y(t,d){return T(C(t),C(d))}c(y,"rawHMACMD5");function p(t,d){return A(y(t,d))}c(p,"hexHMACMD5");function B(t,d,e){return d?e?y(d,t):p(d,t):e?s(t):u(t)}c(B,"md5"),typeof define=="function"&&define.amd?define(function(){return B}):typeof U=="object"&&U.exports?U.exports=B:f.md5=B})(K)});var q=O((L,J)=>{"use strict";(function(f,r){typeof L=="object"?J.exports=L=r():typeof define=="function"&&define.amd?define([],r):f.CryptoJS=r()})(L,function(){var f=f||(function(r,l){var _=Object.create||(function(){function s(){}return c(s,"F"),function(u){var y;return s.prototype=u,y=new s,s.prototype=null,y}})(),h={},m=h.lib={},g=m.Base=(function(){return{extend:c(function(s){var u=_(this);return s&&u.mixIn(s),(!u.hasOwnProperty("init")||this.init===u.init)&&(u.init=function(){u.$super.init.apply(this,arguments)}),u.init.prototype=u,u.$super=this,u},"extend"),create:c(function(){var s=this.extend();return s.init.apply(s,arguments),s},"create"),init:c(function(){},"init"),mixIn:c(function(s){for(var u in s)s.hasOwnProperty(u)&&(this[u]=s[u]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},"mixIn"),clone:c(function(){return this.init.prototype.extend(this)},"clone")}})(),b=m.WordArray=g.extend({init:c(function(s,u){s=this.words=s||[],u!=l?this.sigBytes=u:this.sigBytes=s.length*4},"init"),toString:c(function(s){return(s||D).stringify(this)},"toString"),concat:c(function(s){var u=this.words,y=s.words,p=this.sigBytes,B=s.sigBytes;if(this.clamp(),p%4)for(var t=0;t<B;t++){var d=y[t>>>2]>>>24-t%4*8&255;u[p+t>>>2]|=d<<24-(p+t)%4*8}else for(var t=0;t<B;t+=4)u[p+t>>>2]=y[t>>>2];return this.sigBytes+=B,this},"concat"),clamp:c(function(){var s=this.words,u=this.sigBytes;s[u>>>2]&=4294967295<<32-u%4*8,s.length=r.ceil(u/4)},"clamp"),clone:c(function(){var s=g.clone.call(this);return s.words=this.words.slice(0),s},"clone"),random:c(function(s){for(var u=[],y=c(function(e){var e=e,v=987654321,w=4294967295;return function(){v=36969*(v&65535)+(v>>16)&w,e=18e3*(e&65535)+(e>>16)&w;var I=(v<<16)+e&w;return I/=4294967296,I+=.5,I*(r.random()>.5?1:-1)}},"r"),p=0,B;p<s;p+=4){var t=y((B||r.random())*4294967296);B=t()*987654071,u.push(t()*4294967296|0)}return new b.init(u,s)},"random")}),k=h.enc={},D=k.Hex={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push((t>>>4).toString(16)),p.push((t&15).toString(16))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p+=2)y[p>>>3]|=parseInt(s.substr(p,2),16)<<24-p%8*4;return new b.init(y,u/2)},"parse")},S=k.Latin1={stringify:c(function(s){for(var u=s.words,y=s.sigBytes,p=[],B=0;B<y;B++){var t=u[B>>>2]>>>24-B%4*8&255;p.push(String.fromCharCode(t))}return p.join("")},"stringify"),parse:c(function(s){for(var u=s.length,y=[],p=0;p<u;p++)y[p>>>2]|=(s.charCodeAt(p)&255)<<24-p%4*8;return new b.init(y,u)},"parse")},E=k.Utf8={stringify:c(function(s){try{return decodeURIComponent(escape(S.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:c(function(s){return S.parse(unescape(encodeURIComponent(s)))},"parse")},T=m.BufferedBlockAlgorithm=g.extend({reset:c(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:c(function(s){typeof s=="string"&&(s=E.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},"_append"),_process:c(function(s){var u=this._data,y=u.words,p=u.sigBytes,B=this.blockSize,t=B*4,d=p/t;s?d=r.ceil(d):d=r.max((d|0)-this._minBufferSize,0);var e=d*B,v=r.min(e*4,p);if(e){for(var w=0;w<e;w+=B)this._doProcessBlock(y,w);var I=y.splice(0,e);u.sigBytes-=v}return new b.init(I,v)},"_process"),clone:c(function(){var s=g.clone.call(this);return s._data=this._data.clone(),s},"clone"),_minBufferSize:0}),A=m.Hasher=T.extend({cfg:g.extend(),init:c(function(s){this.cfg=this.cfg.extend(s),this.reset()},"init"),reset:c(function(){T.reset.call(this),this._doReset()},"reset"),update:c(function(s){return this._append(s),this._process(),this},"update"),finalize:c(function(s){s&&this._append(s);var u=this._doFinalize();return u},"finalize"),blockSize:512/32,_createHelper:c(function(s){return function(u,y){return new s.init(y).finalize(u)}},"_createHelper"),_createHmacHelper:c(function(s){return function(u,y){return new C.HMAC.init(s,y).finalize(u)}},"_createHmacHelper")}),C=h.algo={};return h})(Math);return f})});var Q=O((N,G)=>{"use strict";(function(f,r){typeof N=="object"?G.exports=N=r(q()):typeof define=="function"&&define.amd?define(["./core"],r):r(f.CryptoJS)})(N,function(f){return(function(){var r=f,l=r.lib,_=l.WordArray,h=l.Hasher,m=r.algo,g=[],b=m.SHA1=h.extend({_doReset:c(function(){this._hash=new _.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:c(function(k,D){for(var S=this._hash.words,E=S[0],T=S[1],A=S[2],C=S[3],s=S[4],u=0;u<80;u++){if(u<16)g[u]=k[D+u]|0;else{var y=g[u-3]^g[u-8]^g[u-14]^g[u-16];g[u]=y<<1|y>>>31}var p=(E<<5|E>>>27)+s+g[u];u<20?p+=(T&A|~T&C)+1518500249:u<40?p+=(T^A^C)+1859775393:u<60?p+=(T&A|T&C|A&C)-1894007588:p+=(T^A^C)-899497514,s=C,C=A,A=T<<30|T>>>2,T=E,E=p}S[0]=S[0]+E|0,S[1]=S[1]+T|0,S[2]=S[2]+A|0,S[3]=S[3]+C|0,S[4]=S[4]+s|0},"_doProcessBlock"),_doFinalize:c(function(){var k=this._data,D=k.words,S=this._nDataBytes*8,E=k.sigBytes*8;return D[E>>>5]|=128<<24-E%32,D[(E+64>>>9<<4)+14]=Math.floor(S/4294967296),D[(E+64>>>9<<4)+15]=S,k.sigBytes=D.length*4,this._process(),this._hash},"_doFinalize"),clone:c(function(){var k=h.clone.call(this);return k._hash=this._hash.clone(),k},"clone")});r.SHA1=h._createHelper(b),r.HmacSHA1=h._createHmacHelper(b)})(),f.SHA1})});var Ct={};ht(Ct,{TrackKey:()=>W,name:()=>Et,reportTeaEvent:()=>z,version:()=>Tt});var et=V($(),1),rt=V(Q(),1);function R(){return window.appId||null}c(R,"getAppId");function vt(){var l;let f="suda-csrf-token",r=document.cookie.split("; ");for(let _ of r){let[h,m]=_.split("=");if(h===f)return decodeURIComponent(m)}return(l=window.csrfToken)!=null?l:null}c(vt,"getCsrfToken");function x(){let f=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(f)}c(x,"isNewPathEnabled");function X(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}c(X,"getEnv");function Y(){let f=navigator.userAgent,r=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(f),l=/iPad|Tab|Tablet/i.test(f)&&navigator.maxTouchPoints>1;return r||l}c(Y,"isMobile");async function Z(){var _;let f=R();if(!f)return{code:1,msg:"appId is required",data:{}};let r=x()?`/app/${f}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${f}/lark/user_info`;return await(await fetch(r,{headers:{"X-Suda-Csrf-Token":(_=vt())!=null?_:""}})).json()}c(Z,"getLarkUserInfo");var W={VIEW:"aily_agent_artifact_page_view"},gt="08a441",_t="42b91e";function tt(f){let r=String(f);return(0,rt.default)(gt+(0,et.default)(r+_t)).toString()}c(tt,"encryptTea");var F=!1;async function mt(){var m,g,b,k;let{data:f}=await Z(),{tenantID:r,userID:l}=f||{},_=l&&l!=="0"?tt(l):void 0,h=r&&r!=="0"?tt(r):void 0;(m=window.collectEvent)==null||m.call(window,"init",{app_id:788827,channel:"cn",disable_auto_pv:!1,enable_ab_test:!1,enable_debug:!1,enable_stay_duration:!0,reportTime:1e3}),(b=window.collectEvent)==null||b.call(window,"config",{user_unique_id:_,device_type:Y()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:X(),user_id:_,tenant_id:h}}),F=!0,(k=window.collectEvent)==null||k.call(window,"start")}c(mt,"createTracker");async function z({trackKey:f,trackParams:r={}}){var l;try{F||(F=!0,await mt()),(l=window.collectEvent)==null||l.call(window,f,r)}catch(_){console.error(_)}}c(z,"reportTeaEvent");function nt(){return z({trackKey:W.VIEW,trackParams:{artifact_uid:R(),agent_id:"agent_miaoda",url:window.location.href}})}c(nt,"reportPageView");function it(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let r=new Uint8Array(8);return crypto.getRandomValues(r),Array.from(r).map(l=>l.toString(16).padStart(2,"0")).join("")}let f="";for(let r=0;r<16;r++)f+=Math.floor(Math.random()*16).toString(16);return f}c(it,"generateUUID");var at="x_sdk_device_id";function yt(){try{let f=localStorage.getItem(at);return f||(f=it(),localStorage.setItem(at,f)),f}catch{return it()}}c(yt,"getDeviceId");function wt(){let f=typeof navigator!="undefined"?navigator.userAgent:"";return f&&(/Android/i.test(f)&&/Mobile/i.test(f)||/iPhone|iPod/i.test(f)||/BlackBerry|IEMobile|Opera Mini/i.test(f))?"mobile":"desktop"}c(wt,"getDeviceType");function bt(){return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:yt(),module:"app_web",app_env:"runtime",source_type:"user",device_type:wt(),release_commit_id:window.__RELEASE_COMMIT_ID__||""}}c(bt,"getDefaultAttributes");var St="1.0.0";function Bt(f){let r=bt(),l=String(BigInt(Date.now())*BigInt(1e6));return{metricsData:{resource:{attributes:{sdk_version:St,sdk_lang:"javascript",sdk_type:"client-frontend"}},metrics:[{name:"apaas_internal_metrics_pv_uv",description:"Count of page views",unit:"",scopeName:"apaas_internal_metrics_pv_uv",sum:{aggregationTemporality:1,isMonotonic:!0,dataPoints:f.map(_=>({attributes:{...r,url:_.url,path:_.path,referrer:_.referrer},startTimeUnixNano:String(BigInt(_.timestampMs)*BigInt(1e6)),timeUnixNano:l,asDouble:1}))}}]}}}c(Bt,"buildPayload");function It(f,r,l={}){if(r.length===0)return;let _=JSON.stringify(Bt(r));try{fetch(f,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...l},body:_,keepalive:!0}).catch(()=>{})}catch{}}c(It,"sendPvData");var H,kt=(H=class{constructor(){this.started=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new H),this._instance}start(r){var l;if(this.started)return;this.config=r,this.started=!0,this.listenRouteChanges(),this.registerLifecycleListeners();let _=(l=r.flushIntervalMs)!=null?l:1e4;this.flushTimer=setInterval(()=>this.flush(),_)}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.started=!1}recordPv(){let r=window.location.href;this.lastUrl!==r&&(this.lastUrl=r,this.buffer.push({url:r,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}))}flush(){if(!this.config||this.buffer.length===0)return;let r=this.buffer.splice(0);It(this.config.collectorUrl,r,this.config.headers)}listenRouteChanges(){document.readyState==="complete"?this.recordPv():window.addEventListener("load",()=>this.recordPv()),window.addEventListener("popstate",()=>this.recordPv()),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(r){let l=history[r],_=c(()=>this.recordPv(),"recordPv");history[r]=function(...h){let m=l.apply(this,h);return _(),m}}registerLifecycleListeners(){document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flush()}),window.addEventListener("pagehide",()=>this.flush())}},c(H,"_PvTracker"),H),ot=kt.instance;function st(){var l;let f=(l=R())!=null?l:"",r=x()?`/app/${f}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${f}/runtime/api/v1/observability/metrics/collect`;ot.start({collectorUrl:r})}c(st,"initPvTracking");var Tt="0.0.3-alpha.0",Et="@lark-apaas/miaoda-coding-sdk";nt(),st();return pt(Ct);})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lark-apaas/miaoda-coding-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-alpha.0",
|
|
4
4
|
"description": "CDN distribution of aPaaS Web SDK for no-build HTML — self-contained IIFE entries consumed via <script src>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"typecheck": "tsc --noEmit"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@lark-apaas/observable-web-lite": "1.0.1
|
|
23
|
+
"@lark-apaas/observable-web-lite": "^1.0.1",
|
|
24
24
|
"blueimp-md5": "^2.10.0",
|
|
25
25
|
"crypto-js": "^3.1.9-1"
|
|
26
26
|
},
|