@lark-apaas/miaoda-coding-sdk 0.0.19-beta.0 → 0.0.20-beta.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/README.md CHANGED
@@ -44,6 +44,15 @@
44
44
 
45
45
  详见设计文档 `docs/superpowers/specs/2026-06-05-miaoda-coding-sdk-design.md`。
46
46
 
47
+ ## 创意产物 Babel 转译目标
48
+
49
+ `design-runtime`(创意预览态)与 `runtime`(创意运行态)在 DOMContentLoaded 时读取宿主注入的 `window.__creativeBabelTargets__`,给 `text/babel` 脚本补 `data-targets`,让 preset-env 少做降级:
50
+
51
+ - 写法:逗号分隔的「浏览器 版本」,只认 `chrome` / `safari` / `ios_saf` / `firefox`,如 `"chrome 80, safari 13.1, ios_saf 13.4, firefox 74"`;由 page_server 从 TCC `design_sdk_cdn_url.babelTargets` 注入。
52
+ - UA 门槛:当前浏览器须不低于配置里同类条目的每一条;iOS 只和 `ios_saf` 比(按系统版本),macOS Safari 只和 `safari` 比,配置里没有当前浏览器对应条目时不补。
53
+ - 同时追加把顶层 `const` / `let` / `class` 降成 `var`、块内函数声明提到外层的插件组:产物靠顶层声明跨脚本共享,只补 targets 会白屏。插件按本体去重,作者写的 `proposal-*` 旧名不会和追加的 `transform-*` 冲突。
54
+ - 未注入、写法不合规、Babel 不认、当前浏览器低于配置的版本、作者已写 `data-targets` / `data-presets`、`data-type="module"` 时都不改,与现状一致。
55
+
47
56
  ## 本地验证
48
57
 
49
58
  ```bash
@@ -45,13 +45,15 @@ var MiaodaRuntime = (() => {
45
45
  }
46
46
  __name(initCreativeBabelStages, "initCreativeBabelStages");
47
47
  function onDomContentLoaded() {
48
+ var _a2;
48
49
  const scripts = collectBabelScripts();
49
50
  if (!scripts.length) return;
50
51
  const stages = {
51
52
  fetchDur: 0,
52
53
  transformDur: 0,
53
54
  evalDur: 0,
54
- externalCount: scripts.filter((s) => s.src).length
55
+ externalCount: scripts.filter((s) => s.src).length,
56
+ targets: ((_a2 = scripts.find((s) => s.hasAttribute("data-targets"))) == null ? void 0 : _a2.getAttribute("data-targets")) || "none"
55
57
  };
56
58
  const state = {
57
59
  sent: false,
@@ -276,12 +278,148 @@ var MiaodaRuntime = (() => {
276
278
  categories: {
277
279
  takeover: String(state.takeover),
278
280
  external: String(stages.externalCount > 0),
279
- render_observed: String(state.renderDur !== null)
281
+ render_observed: String(state.renderDur !== null),
282
+ targets: stages.targets
280
283
  }
281
284
  });
282
285
  }
283
286
  __name(trySend, "trySend");
284
287
 
288
+ // src/creative-babel-targets.ts
289
+ var BABEL_SCRIPT_SELECTOR = 'script[type="text/babel"],script[type="text/jsx"]';
290
+ var STANDALONE_DEFAULT_PLUGINS = [
291
+ "transform-class-properties",
292
+ "transform-object-rest-spread",
293
+ "transform-flow-strip-types"
294
+ ];
295
+ var SCOPE_PLUGINS = [
296
+ "transform-class-static-block",
297
+ "transform-class-properties",
298
+ "transform-private-methods",
299
+ "transform-private-property-in-object",
300
+ "transform-classes",
301
+ "transform-block-scoped-functions",
302
+ "transform-block-scoping"
303
+ ];
304
+ var MAX_TARGETS_LENGTH = 200;
305
+ var TARGET_RE = /^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;
306
+ function initCreativeBabelTargets() {
307
+ document.addEventListener("DOMContentLoaded", applyBabelTargets, {
308
+ once: true
309
+ });
310
+ }
311
+ __name(initCreativeBabelTargets, "initCreativeBabelTargets");
312
+ function detectBrowserEngine(ua) {
313
+ let m = /\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(ua);
314
+ if (m) return {
315
+ engine: "ios",
316
+ version: [
317
+ +m[1],
318
+ +(m[2] || 0)
319
+ ]
320
+ };
321
+ if (/\bEdge\/\d/.test(ua)) return null;
322
+ m = /\bFirefox\/(\d+)/.exec(ua);
323
+ if (m) return {
324
+ engine: "firefox",
325
+ version: [
326
+ +m[1],
327
+ 0
328
+ ]
329
+ };
330
+ m = /Chrom(?:e|ium)\/(\d+)/.exec(ua);
331
+ if (m) return {
332
+ engine: "chrome",
333
+ version: [
334
+ +m[1],
335
+ 0
336
+ ]
337
+ };
338
+ m = /\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(ua);
339
+ if (m) return {
340
+ engine: "safari",
341
+ version: [
342
+ +m[1],
343
+ +(m[2] || 0)
344
+ ]
345
+ };
346
+ return null;
347
+ }
348
+ __name(detectBrowserEngine, "detectBrowserEngine");
349
+ function compareVersion(a, b) {
350
+ return a[0] - b[0] || a[1] - b[1];
351
+ }
352
+ __name(compareVersion, "compareVersion");
353
+ function readTargets() {
354
+ const raw = window.__creativeBabelTargets__;
355
+ if (typeof raw !== "string" || raw.length > MAX_TARGETS_LENGTH) return null;
356
+ const targets = [];
357
+ for (const item of raw.split(",")) {
358
+ const query = item.trim().toLowerCase().replace(/\s+/g, " ");
359
+ if (!query) continue;
360
+ const m = TARGET_RE.exec(query);
361
+ if (!m) return null;
362
+ targets.push({
363
+ query,
364
+ engine: m[1] === "ios_saf" ? "ios" : m[1],
365
+ version: [
366
+ +m[2],
367
+ +(m[3] || 0)
368
+ ]
369
+ });
370
+ }
371
+ return targets.length ? targets : null;
372
+ }
373
+ __name(readTargets, "readTargets");
374
+ function currentBrowserMeets(targets) {
375
+ const current = detectBrowserEngine(navigator.userAgent || "");
376
+ if (!current) return false;
377
+ const same = targets.filter((t) => t.engine === current.engine);
378
+ return same.length > 0 && same.every((t) => compareVersion(current.version, t.version) >= 0);
379
+ }
380
+ __name(currentBrowserMeets, "currentBrowserMeets");
381
+ function appendPlugins(babel, base, extra) {
382
+ const available = babel.availablePlugins || {};
383
+ const same = /* @__PURE__ */ __name((a, b) => a === b || available[a] !== void 0 && available[a] === available[b], "same");
384
+ const out = base.slice();
385
+ for (const p of extra) {
386
+ if (!out.some((q) => same(q, p))) out.push(p);
387
+ }
388
+ return out;
389
+ }
390
+ __name(appendPlugins, "appendPlugins");
391
+ function applyBabelTargets() {
392
+ const targets = readTargets();
393
+ if (!targets || !currentBrowserMeets(targets)) return;
394
+ const babel = window.Babel;
395
+ if (!babel || typeof babel.transform !== "function") return;
396
+ const tags = Array.from(document.querySelectorAll(BABEL_SCRIPT_SELECTOR)).filter((el) => !el.hasAttribute("data-targets") && !el.hasAttribute("data-presets") && el.getAttribute("data-type") !== "module");
397
+ if (!tags.length) return;
398
+ const browsers = targets.map((t) => t.query);
399
+ try {
400
+ babel.transform("", {
401
+ presets: [
402
+ "react",
403
+ "env"
404
+ ],
405
+ plugins: appendPlugins(babel, STANDALONE_DEFAULT_PLUGINS, SCOPE_PLUGINS),
406
+ targets: {
407
+ browsers
408
+ }
409
+ });
410
+ } catch {
411
+ return;
412
+ }
413
+ const value = browsers.join(",");
414
+ for (const el of tags) {
415
+ const current = el.getAttribute("data-plugins");
416
+ const base = current === null ? STANDALONE_DEFAULT_PLUGINS : current.split(",").map((s) => s.trim()).filter(Boolean);
417
+ el.setAttribute("data-plugins", appendPlugins(babel, base, SCOPE_PLUGINS).join(","));
418
+ el.setAttribute("data-targets", value);
419
+ }
420
+ }
421
+ __name(applyBabelTargets, "applyBabelTargets");
422
+
285
423
  // src/creative-perf.ts
286
424
  var SLARDAR_URL = "https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js";
287
425
  var CREATIVE_FCP_MESSAGE_TYPE = "miaoda:perf:fcp";
@@ -789,11 +927,12 @@ var MiaodaRuntime = (() => {
789
927
  __name(initCreativePvTracking, "initCreativePvTracking");
790
928
 
791
929
  // src/design-runtime.ts
792
- var version = "0.0.19-beta.0";
930
+ var version = "0.0.20-beta.0";
793
931
  var name = "@lark-apaas/miaoda-coding-sdk";
794
932
  if (!window.__CREATIVITY_RUNTIME__) {
795
933
  window.__CREATIVITY_RUNTIME__ = true;
796
934
  registerInspectorIdPlugin();
935
+ initCreativeBabelTargets();
797
936
  initCreativePerf();
798
937
  initCreativePvTracking();
799
938
  initCreativeBabelStages();
@@ -45,13 +45,15 @@ var MiaodaRuntime = (() => {
45
45
  }
46
46
  __name(initCreativeBabelStages, "initCreativeBabelStages");
47
47
  function onDomContentLoaded() {
48
+ var _a2;
48
49
  const scripts = collectBabelScripts();
49
50
  if (!scripts.length) return;
50
51
  const stages = {
51
52
  fetchDur: 0,
52
53
  transformDur: 0,
53
54
  evalDur: 0,
54
- externalCount: scripts.filter((s) => s.src).length
55
+ externalCount: scripts.filter((s) => s.src).length,
56
+ targets: ((_a2 = scripts.find((s) => s.hasAttribute("data-targets"))) == null ? void 0 : _a2.getAttribute("data-targets")) || "none"
55
57
  };
56
58
  const state = {
57
59
  sent: false,
@@ -276,12 +278,148 @@ var MiaodaRuntime = (() => {
276
278
  categories: {
277
279
  takeover: String(state.takeover),
278
280
  external: String(stages.externalCount > 0),
279
- render_observed: String(state.renderDur !== null)
281
+ render_observed: String(state.renderDur !== null),
282
+ targets: stages.targets
280
283
  }
281
284
  });
282
285
  }
283
286
  __name(trySend, "trySend");
284
287
 
288
+ // src/creative-babel-targets.ts
289
+ var BABEL_SCRIPT_SELECTOR = 'script[type="text/babel"],script[type="text/jsx"]';
290
+ var STANDALONE_DEFAULT_PLUGINS = [
291
+ "transform-class-properties",
292
+ "transform-object-rest-spread",
293
+ "transform-flow-strip-types"
294
+ ];
295
+ var SCOPE_PLUGINS = [
296
+ "transform-class-static-block",
297
+ "transform-class-properties",
298
+ "transform-private-methods",
299
+ "transform-private-property-in-object",
300
+ "transform-classes",
301
+ "transform-block-scoped-functions",
302
+ "transform-block-scoping"
303
+ ];
304
+ var MAX_TARGETS_LENGTH = 200;
305
+ var TARGET_RE = /^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;
306
+ function initCreativeBabelTargets() {
307
+ document.addEventListener("DOMContentLoaded", applyBabelTargets, {
308
+ once: true
309
+ });
310
+ }
311
+ __name(initCreativeBabelTargets, "initCreativeBabelTargets");
312
+ function detectBrowserEngine(ua) {
313
+ let m = /\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(ua);
314
+ if (m) return {
315
+ engine: "ios",
316
+ version: [
317
+ +m[1],
318
+ +(m[2] || 0)
319
+ ]
320
+ };
321
+ if (/\bEdge\/\d/.test(ua)) return null;
322
+ m = /\bFirefox\/(\d+)/.exec(ua);
323
+ if (m) return {
324
+ engine: "firefox",
325
+ version: [
326
+ +m[1],
327
+ 0
328
+ ]
329
+ };
330
+ m = /Chrom(?:e|ium)\/(\d+)/.exec(ua);
331
+ if (m) return {
332
+ engine: "chrome",
333
+ version: [
334
+ +m[1],
335
+ 0
336
+ ]
337
+ };
338
+ m = /\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(ua);
339
+ if (m) return {
340
+ engine: "safari",
341
+ version: [
342
+ +m[1],
343
+ +(m[2] || 0)
344
+ ]
345
+ };
346
+ return null;
347
+ }
348
+ __name(detectBrowserEngine, "detectBrowserEngine");
349
+ function compareVersion(a, b) {
350
+ return a[0] - b[0] || a[1] - b[1];
351
+ }
352
+ __name(compareVersion, "compareVersion");
353
+ function readTargets() {
354
+ const raw = window.__creativeBabelTargets__;
355
+ if (typeof raw !== "string" || raw.length > MAX_TARGETS_LENGTH) return null;
356
+ const targets = [];
357
+ for (const item of raw.split(",")) {
358
+ const query = item.trim().toLowerCase().replace(/\s+/g, " ");
359
+ if (!query) continue;
360
+ const m = TARGET_RE.exec(query);
361
+ if (!m) return null;
362
+ targets.push({
363
+ query,
364
+ engine: m[1] === "ios_saf" ? "ios" : m[1],
365
+ version: [
366
+ +m[2],
367
+ +(m[3] || 0)
368
+ ]
369
+ });
370
+ }
371
+ return targets.length ? targets : null;
372
+ }
373
+ __name(readTargets, "readTargets");
374
+ function currentBrowserMeets(targets) {
375
+ const current = detectBrowserEngine(navigator.userAgent || "");
376
+ if (!current) return false;
377
+ const same = targets.filter((t) => t.engine === current.engine);
378
+ return same.length > 0 && same.every((t) => compareVersion(current.version, t.version) >= 0);
379
+ }
380
+ __name(currentBrowserMeets, "currentBrowserMeets");
381
+ function appendPlugins(babel, base, extra) {
382
+ const available = babel.availablePlugins || {};
383
+ const same = /* @__PURE__ */ __name((a, b) => a === b || available[a] !== void 0 && available[a] === available[b], "same");
384
+ const out = base.slice();
385
+ for (const p of extra) {
386
+ if (!out.some((q) => same(q, p))) out.push(p);
387
+ }
388
+ return out;
389
+ }
390
+ __name(appendPlugins, "appendPlugins");
391
+ function applyBabelTargets() {
392
+ const targets = readTargets();
393
+ if (!targets || !currentBrowserMeets(targets)) return;
394
+ const babel = window.Babel;
395
+ if (!babel || typeof babel.transform !== "function") return;
396
+ const tags = Array.from(document.querySelectorAll(BABEL_SCRIPT_SELECTOR)).filter((el) => !el.hasAttribute("data-targets") && !el.hasAttribute("data-presets") && el.getAttribute("data-type") !== "module");
397
+ if (!tags.length) return;
398
+ const browsers = targets.map((t) => t.query);
399
+ try {
400
+ babel.transform("", {
401
+ presets: [
402
+ "react",
403
+ "env"
404
+ ],
405
+ plugins: appendPlugins(babel, STANDALONE_DEFAULT_PLUGINS, SCOPE_PLUGINS),
406
+ targets: {
407
+ browsers
408
+ }
409
+ });
410
+ } catch {
411
+ return;
412
+ }
413
+ const value = browsers.join(",");
414
+ for (const el of tags) {
415
+ const current = el.getAttribute("data-plugins");
416
+ const base = current === null ? STANDALONE_DEFAULT_PLUGINS : current.split(",").map((s) => s.trim()).filter(Boolean);
417
+ el.setAttribute("data-plugins", appendPlugins(babel, base, SCOPE_PLUGINS).join(","));
418
+ el.setAttribute("data-targets", value);
419
+ }
420
+ }
421
+ __name(applyBabelTargets, "applyBabelTargets");
422
+
285
423
  // src/creative-perf.ts
286
424
  var SLARDAR_URL = "https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js";
287
425
  var CREATIVE_FCP_MESSAGE_TYPE = "miaoda:perf:fcp";
@@ -789,11 +927,12 @@ var MiaodaRuntime = (() => {
789
927
  __name(initCreativePvTracking, "initCreativePvTracking");
790
928
 
791
929
  // src/design-runtime.ts
792
- var version = "0.0.19-beta.0";
930
+ var version = "0.0.20-beta.0";
793
931
  var name = "@lark-apaas/miaoda-coding-sdk";
794
932
  if (!window.__CREATIVITY_RUNTIME__) {
795
933
  window.__CREATIVITY_RUNTIME__ = true;
796
934
  registerInspectorIdPlugin();
935
+ initCreativeBabelTargets();
797
936
  initCreativePerf();
798
937
  initCreativePvTracking();
799
938
  initCreativeBabelStages();
@@ -1 +1 @@
1
- "use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var j=Object.prototype.hasOwnProperty;var i=(t,e)=>y(t,"name",{value:e,configurable:!0});var H=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},K=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of V(e))!j.call(t,o)&&o!==r&&y(t,o,{get:()=>e[o],enumerable:!(n=U(e,o))||n.enumerable});return t};var X=t=>K(y({},"__esModule",{value:!0}),t);var ve={};H(ve,{name:()=>ge,version:()=>_e});var J=new Set(["text/babel","text/jsx"]),Y=3e3,z=15e3,G=1e3,q=20,P=!1;function D(){P||(P=!0,document.addEventListener("DOMContentLoaded",Q,{once:!0}))}i(D,"initCreativeBabelStages");function Q(){let t=W();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(o=>o.src).length},r={sent:!1,scriptsDone:!1,scriptsDoneAt:null,totalStart:null,renderStart:null,renderDur:null,takeover:!1,retries:0,hardTimer:null},n=window.Babel;if(!n||typeof n.transform!="function"||typeof n.disableScriptTags!="function"||e.externalCount>0&&typeof fetch!="function"){r.scriptsDone=!0,m(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,m(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>m(e,r),z),te(e,r),ee(n,t,e,r)}i(Q,"onDomContentLoaded");function W(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];J.has((n.type||"").split(";")[0])&&e.push(n)}return e}i(W,"collectBabelScripts");function S(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}i(S,"attrList");function Z(t,e){var o,a,c;let r=t.getAttribute("data-type"),n={browsers:(o=S(t,"data-targets"))!=null?o:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(a=S(t,"data-presets"))!=null?a:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(c=S(t,"data-plugins"))!=null?c:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}i(Z,"buildOptions");function ee(t,e,r,n){let o=0,a=i((l,d)=>{var h;let p;if(l.src)p=l.src;else{let f=l.getAttribute("data-module");f?p=f:(o++,p=o===1?"Inline Babel script":`Inline Babel script (${o})`)}try{let f=performance.now(),v=t.transform(d,Z(l,p)),b=performance.now(),g=document.createElement("script"),w=l.getAttribute("data-type");w&&g.setAttribute("type",w),l.nonce&&(g.nonce=l.nonce),g.text=(h=v==null?void 0:v.code)!=null?h:"",document.head.appendChild(g),r.transformDur+=b-f,r.evalDur+=performance.now()-b}catch(f){console.error("[creative-babel-stages] script failed:",p,f)}},"runOne"),c=0;for(;c<e.length&&!e[c].src;)a(e[c],e[c].innerHTML),c++;if(c>=e.length){A(r,n);return}let u=e.slice(c),s=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(p=>{if(!p.ok)throw new Error(`HTTP ${p.status}`);return p.text()}).then(p=>(r.fetchDur+=performance.now()-d,p))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await s[l]}catch(p){console.error("[creative-babel-stages] load failed:",u[l].src,p);continue}a(u[l],d)}A(r,n)})()}i(ee,"runScripts");function te(t,e){let r=window.ReactDOM;if(!r)return;let n=i(c=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&m(t,e)});u.observe(c,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),o=r.createRoot;typeof o=="function"&&(r.createRoot=(c,u)=>{let s=o.call(r,c,u),l=s.render.bind(s);return s.render=d=>(n(c),l(d)),s});let a=r.render;typeof a=="function"&&(r.render=(c,u,s)=>(n(u),a.call(r,c,u,s)))}i(te,"instrumentRender");function A(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?m(t,e):setTimeout(()=>m(t,e),Y)}i(A,"onScriptsDone");function m(t,e){var a;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<q&&setTimeout(()=>m(t,e),G);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(a=e.scriptsDoneAt)!=null?a:performance.now(),o=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(o),babel_fetch_dur:Math.round(t.fetchDur),babel_transform_dur:Math.round(t.transformDur),babel_eval_dur:Math.round(t.evalDur)},categories:{takeover:String(e.takeover),external:String(t.externalCount>0),render_observed:String(e.renderDur!==null)}})}i(m,"trySend");var re="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",ne="miaoda:perf:fcp",R=!1;function M(){if(R)return;if(R=!0,ie(),window.Slardar){x();return}let t=document.createElement("script");t.src=re,t.onload=()=>{window.Slardar&&x()},t.onerror=()=>{},document.head.appendChild(t)}i(M,"initCreativePerf");function x(){var o,a,c;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(o=window.__appId__)!=null?o:"",creative_type:(a=window.__creativeType__)!=null?a:"unknown",is_public:String((c=window.__isExternallyVisible__)!=null?c:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let s of u.getEntries())if(s.name==="first-contentful-paint"){e=s.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=i(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),s=performance.getEntriesByType("navigation")[0],l=e!=null?e:oe(),d={transfer_size:u.reduce((p,h)=>{var f;return p+((f=h.transferSize)!=null?f:0)},0)};s&&s.domContentLoadedEventEnd>=s.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(s.domContentLoadedEventEnd-s.responseStart)),s&&l!==null&&l>=s.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-s.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}i(x,"bootstrap");function ie(){if(window.parent===window||typeof performance.timeOrigin!="number")return;let t=!1;try{new PerformanceObserver(e=>{var r;if(!t)for(let n of e.getEntries()){if(n.name!=="first-contentful-paint")continue;t=!0;let o={type:ne,fcpTime:performance.timeOrigin+n.startTime,creativeType:(r=window.__creativeType__)!=null?r:"unknown"};window.parent.postMessage(o,"*");break}}).observe({type:"paint",buffered:!0})}catch{}}i(ie,"postFcpToParent");function oe(){var r;let e=performance.getEntriesByType("paint").find(n=>n.name==="first-contentful-paint");return(r=e==null?void 0:e.startTime)!=null?r:null}i(oe,"getBufferedFcpStartTime");function k(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=i(()=>{let a={},c=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let s=u.getAttribute("src");if(s){let l=s.split("?")[0],d=l.split("/").pop()||l;a[d]=d in a?"":l}else{c++;let l=c===1?"Inline Babel script":`Inline Babel script (${c})`;a[l]=u.getAttribute("data-filename")||`inline-${c-1}`}}),a},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:a})=>({visitor:{JSXOpeningElement(c,u){let s=c.node;if(s.name&&s.name.type==="JSXMemberExpression")return;for(let T=0;T<s.attributes.length;T++){let E=s.attributes[T];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let l=u.file&&u.file.opts&&u.file.opts.filename||"?";r===null&&(r=n());let d=l.split("?")[0],p=d.split("/").pop()||d,h=r[l]||r[p]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,f=s.loc&&s.loc.start,v=f?f.line:0,b=f?f.column+1:0,g=s.name&&s.name.type==="JSXIdentifier"?s.name.name:h,w=`jsx:${h}:${g}:${v}:${b}`;s.attributes.push(a.jsxAttribute(a.jsxIdentifier("data-inspector-id"),a.stringLiteral(w)))}}}));let o="";try{let a=document.getElementById("__srcmap");if(a&&a.textContent){let c=JSON.parse(a.textContent),u=c==null?void 0:c.file;typeof u=="string"&&(o=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((a,c)=>{let u=a.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&a.setAttribute("data-plugins",u?`${u},${t}`:t),!a.hasAttribute("data-filename")){let s=o?`${o}#inline-${c}`:`inline-${c}`;a.setAttribute("data-filename",a.getAttribute("src")||s)}})})}i(k,"registerInspectorIdPlugin");function C(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}i(C,"generateUUID");var L="x_sdk_device_id";function se(){try{let t=localStorage.getItem(L);return t||(t=C(),localStorage.setItem(L,t)),t}catch{return C()}}i(se,"getDeviceId");function ae(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}i(ae,"getDeviceType");var ce="pageSessionID";function le(){try{return new URLSearchParams(window.location.search).get(ce)||""}catch{return""}}i(le,"getPvId");function ue(t={}){let e=t.pvId||le();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:se(),module:"app_web",app_env:"runtime",source_type:"user",device_type:ae(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(ue,"getDefaultAttributes");function N(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(N,"toNanoString");var de="1.0.2";function pe(t,e){let r=ue(e),n=N(Date.now());return{metricsData:{resource:{attributes:{sdk_version:de,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:t.map(o=>({attributes:{...r,url:o.url,path:o.path,referrer:o.referrer},startTimeUnixNano:N(o.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}i(pe,"buildPayload");function fe(t,e,r={},n){if(e.length===0)return;let o;try{o=JSON.stringify(pe(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:o,keepalive:!0}).catch(()=>{})}catch{}}i(fe,"sendPvData");var I="__APAAS_PV_TRACKER_STARTED__";function he(){try{let t=window;return t[I]?!1:(t[I]=!0,!0)}catch{return!0}}i(he,"claimPvReporting");function B(){try{window[I]=!1}catch{}}i(B,"releasePvReporting");var _,me=(_=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new _),this._instance}start(e){var r;if(!this.started&&he()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let n=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),n)}catch(n){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,B(),n}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,B())}pageKey(){let{origin:e,pathname:r,search:n}=window.location;return`${e}${r}${n}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);fe(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],n=i(()=>this.recordPv(),"recordPv");history[e]=function(...o){let a=r.apply(this,o);return n(),a},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},i(_,"_PvTracker"),_),O=me.instance;function F(){return window.appId||null}i(F,"getAppId");function $(){var e;let t=(e=F())!=null?e:"";O.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}i($,"initCreativePvTracking");var _e="0.0.19-beta.0",ge="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,k(),M(),$(),D());return X(ve);})();
1
+ "use strict";var MiaodaRuntime=(()=>{var y=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var o=(t,e)=>y(t,"name",{value:e,configurable:!0});var K=(t,e)=>{for(var r in e)y(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of X(e))!q.call(t,s)&&s!==r&&y(t,s,{get:()=>e[s],enumerable:!(n=H(e,s))||n.enumerable});return t};var Y=t=>J(y({},"__esModule",{value:!0}),t);var De={};K(De,{name:()=>xe,version:()=>Ie});var z=new Set(["text/babel","text/jsx"]),Q=3e3,W=15e3,Z=1e3,ee=20,P=!1;function x(){P||(P=!0,document.addEventListener("DOMContentLoaded",te,{once:!0}))}o(x,"initCreativeBabelStages");function te(){var s;let t=re();if(!t.length)return;let e={fetchDur:0,transformDur:0,evalDur:0,externalCount:t.filter(i=>i.src).length,targets:((s=t.find(i=>i.hasAttribute("data-targets")))==null?void 0:s.getAttribute("data-targets"))||"none"},r={sent:!1,scriptsDone:!1,scriptsDoneAt:null,totalStart:null,renderStart:null,renderDur:null,takeover:!1,retries:0,hardTimer:null},n=window.Babel;if(!n||typeof n.transform!="function"||typeof n.disableScriptTags!="function"||e.externalCount>0&&typeof fetch!="function"){r.scriptsDone=!0,h(e,r);return}try{n.disableScriptTags()}catch{r.scriptsDone=!0,h(e,r);return}r.takeover=!0,r.totalStart=performance.now(),r.hardTimer=setTimeout(()=>h(e,r),W),oe(e,r),ie(n,t,e,r)}o(te,"onDomContentLoaded");function re(){let t=document.getElementsByTagName("script"),e=[];for(let r=0;r<t.length;r++){let n=t[r];z.has((n.type||"").split(";")[0])&&e.push(n)}return e}o(re,"collectBabelScripts");function S(t,e){let r=t.getAttribute(e);return r===""?[]:r?r.split(",").map(n=>n.trim()):null}o(S,"attrList");function ne(t,e){var s,i,a;let r=t.getAttribute("data-type"),n={browsers:(s=S(t,"data-targets"))!=null?s:void 0};return r==="module"&&(n.esmodules="intersect"),{filename:e,presets:(i=S(t,"data-presets"))!=null?i:r==="module"?["react",["env",{modules:!1}]]:["react","env"],plugins:(a=S(t,"data-plugins"))!=null?a:["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],sourceMaps:"inline",sourceFileName:e,targets:n}}o(ne,"buildOptions");function ie(t,e,r,n){let s=0,i=o((l,d)=>{var m;let f;if(l.src)f=l.src;else{let p=l.getAttribute("data-module");p?f=p:(s++,f=s===1?"Inline Babel script":`Inline Babel script (${s})`)}try{let p=performance.now(),b=t.transform(d,ne(l,f)),v=performance.now(),_=document.createElement("script"),w=l.getAttribute("data-type");w&&_.setAttribute("type",w),l.nonce&&(_.nonce=l.nonce),_.text=(m=b==null?void 0:b.code)!=null?m:"",document.head.appendChild(_),r.transformDur+=v-p,r.evalDur+=performance.now()-v}catch(p){console.error("[creative-babel-stages] script failed:",f,p)}},"runOne"),a=0;for(;a<e.length&&!e[a].src;)i(e[a],e[a].innerHTML),a++;if(a>=e.length){I(r,n);return}let u=e.slice(a),c=u.map(l=>{if(!l.src)return Promise.resolve(l.innerHTML);let d=performance.now();return fetch(l.src).then(f=>{if(!f.ok)throw new Error(`HTTP ${f.status}`);return f.text()}).then(f=>(r.fetchDur+=performance.now()-d,f))});(async()=>{for(let l=0;l<u.length;l++){let d=null;try{d=await c[l]}catch(f){console.error("[creative-babel-stages] load failed:",u[l].src,f);continue}i(u[l],d)}I(r,n)})()}o(ie,"runScripts");function oe(t,e){let r=window.ReactDOM;if(!r)return;let n=o(a=>{if(e.renderStart===null){e.renderStart=performance.now();try{let u=new MutationObserver(()=>{u.disconnect(),e.renderDur=performance.now()-e.renderStart,e.scriptsDone&&h(t,e)});u.observe(a,{childList:!0,subtree:!0})}catch{}}},"observeCommit"),s=r.createRoot;typeof s=="function"&&(r.createRoot=(a,u)=>{let c=s.call(r,a,u),l=c.render.bind(c);return c.render=d=>(n(a),l(d)),c});let i=r.render;typeof i=="function"&&(r.render=(a,u,c)=>(n(u),i.call(r,a,u,c)))}o(oe,"instrumentRender");function I(t,e){e.scriptsDone=!0,e.scriptsDoneAt=performance.now(),e.renderStart===null||e.renderDur!==null?h(t,e):setTimeout(()=>h(t,e),Q)}o(I,"onScriptsDone");function h(t,e){var i;if(e.sent)return;let r=window.Slardar;if(!r){e.retries++<ee&&setTimeout(()=>h(t,e),Z);return}e.sent=!0,e.hardTimer!==null&&clearTimeout(e.hardTimer);let n=e.renderDur!==null&&e.renderStart!==null?e.renderStart+e.renderDur:(i=e.scriptsDoneAt)!=null?i:performance.now(),s=e.totalStart===null?0:Math.max(0,n-e.totalStart);r("sendEvent",{name:"creative_babel_stages",metrics:{babel_total_dur:Math.round(s),babel_fetch_dur:Math.round(t.fetchDur),babel_transform_dur:Math.round(t.transformDur),babel_eval_dur:Math.round(t.evalDur)},categories:{takeover:String(e.takeover),external:String(t.externalCount>0),render_observed:String(e.renderDur!==null),targets:t.targets}})}o(h,"trySend");var se='script[type="text/babel"],script[type="text/jsx"]',D=["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],R=["transform-class-static-block","transform-class-properties","transform-private-methods","transform-private-property-in-object","transform-classes","transform-block-scoped-functions","transform-block-scoping"];var ae=/^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;function M(){document.addEventListener("DOMContentLoaded",fe,{once:!0})}o(M,"initCreativeBabelTargets");function ce(t){let e=/\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(t);return e?{engine:"ios",version:[+e[1],+(e[2]||0)]}:/\bEdge\/\d/.test(t)?null:(e=/\bFirefox\/(\d+)/.exec(t),e?{engine:"firefox",version:[+e[1],0]}:(e=/Chrom(?:e|ium)\/(\d+)/.exec(t),e?{engine:"chrome",version:[+e[1],0]}:(e=/\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(t),e?{engine:"safari",version:[+e[1],+(e[2]||0)]}:null)))}o(ce,"detectBrowserEngine");function ue(t,e){return t[0]-e[0]||t[1]-e[1]}o(ue,"compareVersion");function le(){let t=window.__creativeBabelTargets__;if(typeof t!="string"||t.length>200)return null;let e=[];for(let r of t.split(",")){let n=r.trim().toLowerCase().replace(/\s+/g," ");if(!n)continue;let s=ae.exec(n);if(!s)return null;e.push({query:n,engine:s[1]==="ios_saf"?"ios":s[1],version:[+s[2],+(s[3]||0)]})}return e.length?e:null}o(le,"readTargets");function de(t){let e=ce(navigator.userAgent||"");if(!e)return!1;let r=t.filter(n=>n.engine===e.engine);return r.length>0&&r.every(n=>ue(e.version,n.version)>=0)}o(de,"currentBrowserMeets");function C(t,e,r){let n=t.availablePlugins||{},s=o((a,u)=>a===u||n[a]!==void 0&&n[a]===n[u],"same"),i=e.slice();for(let a of r)i.some(u=>s(u,a))||i.push(a);return i}o(C,"appendPlugins");function fe(){let t=le();if(!t||!de(t))return;let e=window.Babel;if(!e||typeof e.transform!="function")return;let r=Array.from(document.querySelectorAll(se)).filter(i=>!i.hasAttribute("data-targets")&&!i.hasAttribute("data-presets")&&i.getAttribute("data-type")!=="module");if(!r.length)return;let n=t.map(i=>i.query);try{e.transform("",{presets:["react","env"],plugins:C(e,D,R),targets:{browsers:n}})}catch{return}let s=n.join(",");for(let i of r){let a=i.getAttribute("data-plugins"),u=a===null?D:a.split(",").map(c=>c.trim()).filter(Boolean);i.setAttribute("data-plugins",C(e,u,R).join(",")),i.setAttribute("data-targets",s)}}o(fe,"applyBabelTargets");var pe="https://lf3-short.ibytedapm.com/slardar/fe/sdk-web/browser.cn.js",me="miaoda:perf:fcp",k=!1;function N(){if(k)return;if(k=!0,he(),window.Slardar){L();return}let t=document.createElement("script");t.src=pe,t.onload=()=>{window.Slardar&&L()},t.onerror=()=>{},document.head.appendChild(t)}o(N,"initCreativePerf");function L(){var s,i,a;let t=window.Slardar;if(!t)return;let e=null;t("context.merge",{app_id:(s=window.__appId__)!=null?s:"",creative_type:(i=window.__creativeType__)!=null?i:"unknown",is_public:String((a=window.__isExternallyVisible__)!=null?a:!1)}),t("init",{bid:"apaas_miaoda",env:window.ENVIRONMENT||"online"}),t("start");try{new PerformanceObserver(u=>{for(let c of u.getEntries())if(c.name==="first-contentful-paint"){e=c.startTime,t("context.merge",{has_painted:"true"});break}}).observe({type:"paint",buffered:!0})}catch{}let r=!1,n=o(()=>{if(r||!window.Slardar)return;r=!0;let u=performance.getEntriesByType("resource"),c=performance.getEntriesByType("navigation")[0],l=e!=null?e:ge(),d={transfer_size:u.reduce((f,m)=>{var p;return f+((p=m.transferSize)!=null?p:0)},0)};c&&c.domContentLoadedEventEnd>=c.responseStart&&(d.ttfb_to_dom_ready_dur=Math.round(c.domContentLoadedEventEnd-c.responseStart)),c&&l!==null&&l>=c.domContentLoadedEventEnd&&(d.render_to_fcp_dur=Math.round(l-c.domContentLoadedEventEnd)),window.Slardar("sendEvent",{name:"creative_perf",metrics:d})},"send");window.addEventListener("load",()=>setTimeout(n,500)),setTimeout(n,15e3)}o(L,"bootstrap");function he(){if(window.parent===window||typeof performance.timeOrigin!="number")return;let t=!1;try{new PerformanceObserver(e=>{var r;if(!t)for(let n of e.getEntries()){if(n.name!=="first-contentful-paint")continue;t=!0;let s={type:me,fcpTime:performance.timeOrigin+n.startTime,creativeType:(r=window.__creativeType__)!=null?r:"unknown"};window.parent.postMessage(s,"*");break}}).observe({type:"paint",buffered:!0})}catch{}}o(he,"postFcpToParent");function ge(){var r;let e=performance.getEntriesByType("paint").find(n=>n.name==="first-contentful-paint");return(r=e==null?void 0:e.startTime)!=null?r:null}o(ge,"getBufferedFcpStartTime");function B(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,n=o(()=>{let i={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(u=>{let c=u.getAttribute("src");if(c){let l=c.split("?")[0],d=l.split("/").pop()||l;i[d]=d in i?"":l}else{a++;let l=a===1?"Inline Babel script":`Inline Babel script (${a})`;i[l]=u.getAttribute("data-filename")||`inline-${a-1}`}}),i},"buildFileMap");e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:i})=>({visitor:{JSXOpeningElement(a,u){let c=a.node;if(c.name&&c.name.type==="JSXMemberExpression")return;for(let T=0;T<c.attributes.length;T++){let E=c.attributes[T];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let l=u.file&&u.file.opts&&u.file.opts.filename||"?";r===null&&(r=n());let d=l.split("?")[0],f=d.split("/").pop()||d,m=r[l]||r[f]||d.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||l,p=c.loc&&c.loc.start,b=p?p.line:0,v=p?p.column+1:0,_=c.name&&c.name.type==="JSXIdentifier"?c.name.name:m,w=`jsx:${m}:${_}:${b}:${v}`;c.attributes.push(i.jsxAttribute(i.jsxIdentifier("data-inspector-id"),i.stringLiteral(w)))}}}));let s="";try{let i=document.getElementById("__srcmap");if(i&&i.textContent){let a=JSON.parse(i.textContent),u=a==null?void 0:a.file;typeof u=="string"&&(s=u)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((i,a)=>{let u=i.getAttribute("data-plugins")||"";if(u.indexOf(t)<0&&i.setAttribute("data-plugins",u?`${u},${t}`:t),!i.hasAttribute("data-filename")){let c=s?`${s}#inline-${a}`:`inline-${a}`;i.setAttribute("data-filename",i.getAttribute("src")||c)}})})}o(B,"registerInspectorIdPlugin");function O(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}o(O,"generateUUID");var F="x_sdk_device_id";function _e(){try{let t=localStorage.getItem(F);return t||(t=O(),localStorage.setItem(F,t)),t}catch{return O()}}o(_e,"getDeviceId");function be(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}o(be,"getDeviceType");var ve="pageSessionID";function we(){try{return new URLSearchParams(window.location.search).get(ve)||""}catch{return""}}o(we,"getPvId");function ye(t={}){let e=t.pvId||we();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:_e(),module:"app_web",app_env:"runtime",source_type:"user",device_type:be(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}o(ye,"getDefaultAttributes");function $(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}o($,"toNanoString");var Te="1.0.2";function Ee(t,e){let r=ye(e),n=$(Date.now());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:t.map(s=>({attributes:{...r,url:s.url,path:s.path,referrer:s.referrer},startTimeUnixNano:$(s.timestampMs),timeUnixNano:n,asDouble:1}))}}]}}}o(Ee,"buildPayload");function Se(t,e,r={},n){if(e.length===0)return;let s;try{s=JSON.stringify(Ee(e,n))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:s,keepalive:!0}).catch(()=>{})}catch{}}o(Se,"sendPvData");var A="__APAAS_PV_TRACKER_STARTED__";function Ae(){try{let t=window;return t[A]?!1:(t[A]=!0,!0)}catch{return!0}}o(Ae,"claimPvReporting");function U(){try{window[A]=!1}catch{}}o(U,"releasePvReporting");var g,Pe=(g=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new g),this._instance}start(e){var r;if(!this.started&&Ae()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let n=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),n)}catch(n){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,U(),n}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,U())}pageKey(){let{origin:e,pathname:r,search:n}=window.location;return`${e}${r}${n}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Se(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=o(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],n=o(()=>this.recordPv(),"recordPv");history[e]=function(...s){let i=r.apply(this,s);return n(),i},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=o(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=o(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},o(g,"_PvTracker"),g),j=Pe.instance;function V(){return window.appId||null}o(V,"getAppId");function G(){var e;let t=(e=V())!=null?e:"";j.start({collectorUrl:`/app/${t}/__runtime__/api/v1/observability/metrics/collect`,firstFlushDelayMs:1e3})}o(G,"initCreativePvTracking");var Ie="0.0.20-beta.0",xe="@lark-apaas/miaoda-coding-sdk";window.__CREATIVITY_RUNTIME__||(window.__CREATIVITY_RUNTIME__=!0,B(),M(),N(),G(),x());return Y(De);})();
@@ -1704,7 +1704,7 @@ var MiaodaRuntime = (() => {
1704
1704
  return bootstrap.init(options);
1705
1705
  });
1706
1706
  state[key] = runtime;
1707
- var version = "0.0.19-beta.0";
1707
+ var version = "0.0.20-beta.0";
1708
1708
  function init({
1709
1709
  iframe,
1710
1710
  nonce = hostNonce
@@ -2178,7 +2178,7 @@ var MiaodaRuntime = (() => {
2178
2178
  }
2179
2179
 
2180
2180
  // src/doubao-html-runtime.ts
2181
- var version2 = "0.0.19-beta.0";
2181
+ var version2 = "0.0.20-beta.0";
2182
2182
  var name = "@lark-apaas/miaoda-coding-sdk";
2183
2183
  registerInspectorIdPlugin();
2184
2184
  if (isOnlineEnv()) {
@@ -1704,7 +1704,7 @@ var MiaodaRuntime = (() => {
1704
1704
  return bootstrap.init(options);
1705
1705
  });
1706
1706
  state[key] = runtime;
1707
- var version = "0.0.19-beta.0";
1707
+ var version = "0.0.20-beta.0";
1708
1708
  function init({
1709
1709
  iframe,
1710
1710
  nonce = hostNonce
@@ -2178,7 +2178,7 @@ var MiaodaRuntime = (() => {
2178
2178
  }
2179
2179
 
2180
2180
  // src/doubao-html-runtime.ts
2181
- var version2 = "0.0.19-beta.0";
2181
+ var version2 = "0.0.20-beta.0";
2182
2182
  var name = "@lark-apaas/miaoda-coding-sdk";
2183
2183
  registerInspectorIdPlugin();
2184
2184
  if (isOnlineEnv()) {
@@ -1,4 +1,4 @@
1
- "use strict";var MiaodaRuntime=(()=>{var Ue=Object.create;var R=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var j=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Q=(t,e)=>{for(var r in e)R(t,r,{get:e[r],enumerable:!0})},ee=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Ge(e))!Xe.call(t,p)&&p!==r&&R(t,p,{get:()=>e[p],enumerable:!(i=ze(e,p))||i.enumerable});return t};var te=(t,e,r)=>(r=t!=null?Ue(Je(t)):{},ee(e||!t||!t.__esModule?R(r,"default",{value:t,enumerable:!0}):r,t)),Ke=t=>ee(R({},"__esModule",{value:!0}),t);var re=j((ne,O)=>{"use strict";(function(t){"use strict";function e(n,v){var o=(n&65535)+(v&65535),C=(n>>16)+(v>>16)+(o>>16);return C<<16|o&65535}function r(n,v){return n<<v|n>>>32-v}function i(n,v,o,C,x,T){return e(r(e(e(v,n),e(C,T)),x),o)}function p(n,v,o,C,x,T,M){return i(v&o|~v&C,n,v,x,T,M)}function f(n,v,o,C,x,T,M){return i(v&C|o&~C,n,v,x,T,M)}function a(n,v,o,C,x,T,M){return i(v^o^C,n,v,x,T,M)}function g(n,v,o,C,x,T,M){return i(o^(v|~C),n,v,x,T,M)}function h(n,v){n[v>>5]|=128<<v%32,n[(v+64>>>9<<4)+14]=v;var o,C,x,T,M,c=1732584193,l=-271733879,d=-1732584194,u=271733878;for(o=0;o<n.length;o+=16)C=c,x=l,T=d,M=u,c=p(c,l,d,u,n[o],7,-680876936),u=p(u,c,l,d,n[o+1],12,-389564586),d=p(d,u,c,l,n[o+2],17,606105819),l=p(l,d,u,c,n[o+3],22,-1044525330),c=p(c,l,d,u,n[o+4],7,-176418897),u=p(u,c,l,d,n[o+5],12,1200080426),d=p(d,u,c,l,n[o+6],17,-1473231341),l=p(l,d,u,c,n[o+7],22,-45705983),c=p(c,l,d,u,n[o+8],7,1770035416),u=p(u,c,l,d,n[o+9],12,-1958414417),d=p(d,u,c,l,n[o+10],17,-42063),l=p(l,d,u,c,n[o+11],22,-1990404162),c=p(c,l,d,u,n[o+12],7,1804603682),u=p(u,c,l,d,n[o+13],12,-40341101),d=p(d,u,c,l,n[o+14],17,-1502002290),l=p(l,d,u,c,n[o+15],22,1236535329),c=f(c,l,d,u,n[o+1],5,-165796510),u=f(u,c,l,d,n[o+6],9,-1069501632),d=f(d,u,c,l,n[o+11],14,643717713),l=f(l,d,u,c,n[o],20,-373897302),c=f(c,l,d,u,n[o+5],5,-701558691),u=f(u,c,l,d,n[o+10],9,38016083),d=f(d,u,c,l,n[o+15],14,-660478335),l=f(l,d,u,c,n[o+4],20,-405537848),c=f(c,l,d,u,n[o+9],5,568446438),u=f(u,c,l,d,n[o+14],9,-1019803690),d=f(d,u,c,l,n[o+3],14,-187363961),l=f(l,d,u,c,n[o+8],20,1163531501),c=f(c,l,d,u,n[o+13],5,-1444681467),u=f(u,c,l,d,n[o+2],9,-51403784),d=f(d,u,c,l,n[o+7],14,1735328473),l=f(l,d,u,c,n[o+12],20,-1926607734),c=a(c,l,d,u,n[o+5],4,-378558),u=a(u,c,l,d,n[o+8],11,-2022574463),d=a(d,u,c,l,n[o+11],16,1839030562),l=a(l,d,u,c,n[o+14],23,-35309556),c=a(c,l,d,u,n[o+1],4,-1530992060),u=a(u,c,l,d,n[o+4],11,1272893353),d=a(d,u,c,l,n[o+7],16,-155497632),l=a(l,d,u,c,n[o+10],23,-1094730640),c=a(c,l,d,u,n[o+13],4,681279174),u=a(u,c,l,d,n[o],11,-358537222),d=a(d,u,c,l,n[o+3],16,-722521979),l=a(l,d,u,c,n[o+6],23,76029189),c=a(c,l,d,u,n[o+9],4,-640364487),u=a(u,c,l,d,n[o+12],11,-421815835),d=a(d,u,c,l,n[o+15],16,530742520),l=a(l,d,u,c,n[o+2],23,-995338651),c=g(c,l,d,u,n[o],6,-198630844),u=g(u,c,l,d,n[o+7],10,1126891415),d=g(d,u,c,l,n[o+14],15,-1416354905),l=g(l,d,u,c,n[o+5],21,-57434055),c=g(c,l,d,u,n[o+12],6,1700485571),u=g(u,c,l,d,n[o+3],10,-1894986606),d=g(d,u,c,l,n[o+10],15,-1051523),l=g(l,d,u,c,n[o+1],21,-2054922799),c=g(c,l,d,u,n[o+8],6,1873313359),u=g(u,c,l,d,n[o+15],10,-30611744),d=g(d,u,c,l,n[o+6],15,-1560198380),l=g(l,d,u,c,n[o+13],21,1309151649),c=g(c,l,d,u,n[o+4],6,-145523070),u=g(u,c,l,d,n[o+11],10,-1120210379),d=g(d,u,c,l,n[o+2],15,718787259),l=g(l,d,u,c,n[o+9],21,-343485551),c=e(c,C),l=e(l,x),d=e(d,T),u=e(u,M);return[c,l,d,u]}function k(n){var v,o="",C=n.length*32;for(v=0;v<C;v+=8)o+=String.fromCharCode(n[v>>5]>>>v%32&255);return o}function y(n){var v,o=[];for(o[(n.length>>2)-1]=void 0,v=0;v<o.length;v+=1)o[v]=0;var C=n.length*8;for(v=0;v<C;v+=8)o[v>>5]|=(n.charCodeAt(v/8)&255)<<v%32;return o}function S(n){return k(h(y(n),n.length*8))}function L(n,v){var o,C=y(n),x=[],T=[],M;for(x[15]=T[15]=void 0,C.length>16&&(C=h(C,n.length*8)),o=0;o<16;o+=1)x[o]=C[o]^909522486,T[o]=C[o]^1549556828;return M=h(x.concat(y(v)),512+v.length*8),k(h(T.concat(M),640))}function w(n){var v="0123456789abcdef",o="",C,x;for(x=0;x<n.length;x+=1)C=n.charCodeAt(x),o+=v.charAt(C>>>4&15)+v.charAt(C&15);return o}function I(n){return unescape(encodeURIComponent(n))}function s(n){return S(I(n))}function m(n){return w(s(n))}function _(n,v){return L(I(n),I(v))}function b(n,v){return w(_(n,v))}function E(n,v,o){return v?o?_(v,n):b(v,n):o?s(n):m(n)}typeof define=="function"&&define.amd?define(function(){return E}):typeof O=="object"&&O.exports?O.exports=E:t.md5=E})(ne)});var ie=j((B,oe)=>{"use strict";(function(t,e){typeof B=="object"?oe.exports=B=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(B,function(){var t=t||(function(e,r){var i=Object.create||(function(){function s(){}return function(m){var _;return s.prototype=m,_=new s,s.prototype=null,_}})(),p={},f=p.lib={},a=f.Base=(function(){return{extend:function(s){var m=i(this);return s&&m.mixIn(s),(!m.hasOwnProperty("init")||this.init===m.init)&&(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var s=this.extend();return s.init.apply(s,arguments),s},init:function(){},mixIn:function(s){for(var m in s)s.hasOwnProperty(m)&&(this[m]=s[m]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),g=f.WordArray=a.extend({init:function(s,m){s=this.words=s||[],m!=r?this.sigBytes=m:this.sigBytes=s.length*4},toString:function(s){return(s||k).stringify(this)},concat:function(s){var m=this.words,_=s.words,b=this.sigBytes,E=s.sigBytes;if(this.clamp(),b%4)for(var n=0;n<E;n++){var v=_[n>>>2]>>>24-n%4*8&255;m[b+n>>>2]|=v<<24-(b+n)%4*8}else for(var n=0;n<E;n+=4)m[b+n>>>2]=_[n>>>2];return this.sigBytes+=E,this},clamp:function(){var s=this.words,m=this.sigBytes;s[m>>>2]&=4294967295<<32-m%4*8,s.length=e.ceil(m/4)},clone:function(){var s=a.clone.call(this);return s.words=this.words.slice(0),s},random:function(s){for(var m=[],_=(function(o){var o=o,C=987654321,x=4294967295;return function(){C=36969*(C&65535)+(C>>16)&x,o=18e3*(o&65535)+(o>>16)&x;var T=(C<<16)+o&x;return T/=4294967296,T+=.5,T*(e.random()>.5?1:-1)}}),b=0,E;b<s;b+=4){var n=_((E||e.random())*4294967296);E=n()*987654071,m.push(n()*4294967296|0)}return new g.init(m,s)}}),h=p.enc={},k=h.Hex={stringify:function(s){for(var m=s.words,_=s.sigBytes,b=[],E=0;E<_;E++){var n=m[E>>>2]>>>24-E%4*8&255;b.push((n>>>4).toString(16)),b.push((n&15).toString(16))}return b.join("")},parse:function(s){for(var m=s.length,_=[],b=0;b<m;b+=2)_[b>>>3]|=parseInt(s.substr(b,2),16)<<24-b%8*4;return new g.init(_,m/2)}},y=h.Latin1={stringify:function(s){for(var m=s.words,_=s.sigBytes,b=[],E=0;E<_;E++){var n=m[E>>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(n))}return b.join("")},parse:function(s){for(var m=s.length,_=[],b=0;b<m;b++)_[b>>>2]|=(s.charCodeAt(b)&255)<<24-b%4*8;return new g.init(_,m)}},S=h.Utf8={stringify:function(s){try{return decodeURIComponent(escape(y.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(s){return y.parse(unescape(encodeURIComponent(s)))}},L=f.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(s){typeof s=="string"&&(s=S.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},_process:function(s){var m=this._data,_=m.words,b=m.sigBytes,E=this.blockSize,n=E*4,v=b/n;s?v=e.ceil(v):v=e.max((v|0)-this._minBufferSize,0);var o=v*E,C=e.min(o*4,b);if(o){for(var x=0;x<o;x+=E)this._doProcessBlock(_,x);var T=_.splice(0,o);m.sigBytes-=C}return new g.init(T,C)},clone:function(){var s=a.clone.call(this);return s._data=this._data.clone(),s},_minBufferSize:0}),w=f.Hasher=L.extend({cfg:a.extend(),init:function(s){this.cfg=this.cfg.extend(s),this.reset()},reset:function(){L.reset.call(this),this._doReset()},update:function(s){return this._append(s),this._process(),this},finalize:function(s){s&&this._append(s);var m=this._doFinalize();return m},blockSize:512/32,_createHelper:function(s){return function(m,_){return new s.init(_).finalize(m)}},_createHmacHelper:function(s){return function(m,_){return new I.HMAC.init(s,_).finalize(m)}}}),I=p.algo={};return p})(Math);return t})});var ae=j((H,se)=>{"use strict";(function(t,e){typeof H=="object"?se.exports=H=e(ie()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(H,function(t){return(function(){var e=t,r=e.lib,i=r.WordArray,p=r.Hasher,f=e.algo,a=[],g=f.SHA1=p.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,k){for(var y=this._hash.words,S=y[0],L=y[1],w=y[2],I=y[3],s=y[4],m=0;m<80;m++){if(m<16)a[m]=h[k+m]|0;else{var _=a[m-3]^a[m-8]^a[m-14]^a[m-16];a[m]=_<<1|_>>>31}var b=(S<<5|S>>>27)+s+a[m];m<20?b+=(L&w|~L&I)+1518500249:m<40?b+=(L^w^I)+1859775393:m<60?b+=(L&w|L&I|w&I)-1894007588:b+=(L^w^I)-899497514,s=I,I=w,w=L<<30|L>>>2,L=S,S=b}y[0]=y[0]+S|0,y[1]=y[1]+L|0,y[2]=y[2]+w|0,y[3]=y[3]+I|0,y[4]=y[4]+s|0},_doFinalize:function(){var h=this._data,k=h.words,y=this._nDataBytes*8,S=h.sigBytes*8;return k[S>>>5]|=128<<24-S%32,k[(S+64>>>9<<4)+14]=Math.floor(y/4294967296),k[(S+64>>>9<<4)+15]=y,h.sigBytes=k.length*4,this._process(),this._hash},clone:function(){var h=p.clone.call(this);return h._hash=this._hash.clone(),h}});e.SHA1=p._createHelper(g),e.HmacSHA1=p._createHmacHelper(g)})(),t.SHA1})});var $t={};Q($t,{TrackKey:()=>z,comments:()=>W,name:()=>Dt,reportTeaEvent:()=>G,version:()=>Ft});var pe=te(re(),1),fe=te(ae(),1);function P(){return window.appId||null}function N(){var r;let t="suda-csrf-token",e=document.cookie.split("; ");for(let i of e){let[p,f]=i.split("=");if(p===t)return decodeURIComponent(f)}return(r=window.csrfToken)!=null?r:null}function F(){let t=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(t)}function D(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}function ce(){return window.appEnv!=null?window.appEnv==="runtime":!0}function $(){let t=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(t),r=/iPad|Tab|Tablet/i.test(t)&&navigator.maxTouchPoints>1;return e||r}async function le(){var t,e,r;try{let i=P();if(!i)return!0;let p=F()?`/app/${i}/__runtime__/api/v1/studio/get_published`:`/spark/b/${i}/get_published`,a=await(await fetch(p,{headers:{"X-Suda-Csrf-Token":(t=N())!=null?t:""}})).json();if(a.code===0||a.status_code==="0")return((r=(e=a.data)==null?void 0:e.app_info)==null?void 0:r.show_badge)!==!1}catch{}return!0}async function de(){var i;let t=P();if(!t)return{code:1,msg:"appId is required",data:{}};let e=F()?`/app/${t}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${t}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(i=N())!=null?i:""}})).json()}var z={VIEW:"aily_agent_artifact_page_view"},Ze="08a441",qe="42b91e";function ue(t){let e=String(t);return(0,fe.default)(Ze+(0,pe.default)(e+qe)).toString()}var U=!1;async function Ye(){var f,a,g,h;let{data:t}=await de(),{tenantID:e,userID:r}=t||{},i=r&&r!=="0"?ue(r):void 0,p=e&&e!=="0"?ue(e):void 0;(f=window.collectEvent)==null||f.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:i,device_type:$()?"mobile":"pc",evtParams:{open_from:(a=new URLSearchParams(window.location.search).get("open-from"))!=null?a:void 0,env:D(),user_id:i,tenant_id:p}}),U=!0,(h=window.collectEvent)==null||h.call(window,"start")}async function G({trackKey:t,trackParams:e={}}){var r;try{U||(U=!0,await Ye()),(r=window.collectEvent)==null||r.call(window,t,e)}catch(i){console.error(i)}}function me(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:P(),agent_id:"agent_miaoda",url:window.location.href}})}function he(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var ge="x_sdk_device_id";function Qe(){try{let t=localStorage.getItem(ge);return t||(t=he(),localStorage.setItem(ge,t)),t}catch{return he()}}function et(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}var tt="pageSessionID";function nt(){try{return new URLSearchParams(window.location.search).get(tt)||""}catch{return""}}function rt(t={}){let e=t.pvId||nt();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Qe(),module:"app_web",app_env:"runtime",source_type:"user",device_type:et(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}function ve(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}var ot="1.0.2";function it(t,e){let r=rt(e),i=ve(Date.now());return{metricsData:{resource:{attributes:{sdk_version:ot,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:t.map(p=>({attributes:{...r,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:ve(p.timestampMs),timeUnixNano:i,asDouble:1}))}}]}}}function st(t,e,r={},i){if(e.length===0)return;let p;try{p=JSON.stringify(it(e,i))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:p,keepalive:!0}).catch(()=>{})}catch{}}var J="__APAAS_PV_TRACKER_STARTED__";function at(){try{let t=window;return t[J]?!1:(t[J]=!0,!0)}catch{return!0}}function be(){try{window[J]=!1}catch{}}var ct=class ye{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new ye),this._instance}start(e){var r;if(!this.started&&at()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let i=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),i)}catch(i){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,be(),i}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,be())}pageKey(){let{origin:e,pathname:r,search:i}=window.location;return`${e}${r}${i}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);st(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=()=>this.recordPv();window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],i=()=>this.recordPv();history[e]=function(...p){let f=r.apply(this,p);return i(),f},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=()=>{document.visibilityState==="hidden"&&this.flush()};document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=()=>this.flush();window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},we=ct.instance;function _e(){var r;let t=(r=P())!=null?r:"",e=F()?`/app/${t}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${t}/runtime/api/v1/observability/metrics/collect`;we.start({collectorUrl:e})}var lt=/\bLark\//i;function Ce(){var e,r,i,p;let t=window;return typeof((i=(r=(e=t.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.invokeNative)==null?void 0:i.postMessage)=="function"||typeof((p=t.Lark_Bridge)==null?void 0:p.invokeNative)=="function"?!0:lt.test(navigator.userAgent)}function ke({messageIds:t,token:e,docType:r=113}){var g,h;if(t.length===0||!e)return!1;let i={apiName:"markMiaodaFeedMessagesRead",data:{__v2__:!0,messageIds:t.map(String),token:e,docType:r}},p=window,f=(h=(g=p.webkit)==null?void 0:g.messageHandlers)==null?void 0:h.invokeNative;if(f!=null&&f.postMessage)return f.postMessage(i),!0;let a=p.Lark_Bridge;return a!=null&&a.invokeNative?(a.invokeNative(JSON.stringify(i)),!0):!1}var dt=113,ut="/app/",pt="/__runtime__/api/v1/devops/read_lark_messages";function ft(t){if(!t||typeof t!="object")return[];let{data:e}=t;return Array.isArray(e)?e.map(String):e&&Array.isArray(e.message_ids)?e.message_ids.map(String):[]}var xe=!1;async function mt(t){var i;let e=await fetch(`${ut}${t}${pt}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":(i=N())!=null?i:""}});if(!e.ok)return[];let r=await e.json();return ft(r)}async function Ee(){if(xe||!Ce())return;xe=!0;let t=P();if(t)try{let e=await mt(t);if(!e.length)return;ke({messageIds:e,token:t,docType:dt})}catch{}}function Se(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,i=()=>{let f={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(g=>{let h=g.getAttribute("src");if(h){let k=h.split("?")[0],y=k.split("/").pop()||k;f[y]=y in f?"":k}else{a++;let k=a===1?"Inline Babel script":`Inline Babel script (${a})`;f[k]=g.getAttribute("data-filename")||`inline-${a-1}`}}),f};e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:f})=>({visitor:{JSXOpeningElement(a,g){let h=a.node;if(h.name&&h.name.type==="JSXMemberExpression")return;for(let b=0;b<h.attributes.length;b++){let E=h.attributes[b];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let k=g.file&&g.file.opts&&g.file.opts.filename||"?";r===null&&(r=i());let y=k.split("?")[0],S=y.split("/").pop()||y,L=r[k]||r[S]||y.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||k,w=h.loc&&h.loc.start,I=w?w.line:0,s=w?w.column+1:0,m=h.name&&h.name.type==="JSXIdentifier"?h.name.name:L,_=`jsx:${L}:${m}:${I}:${s}`;h.attributes.push(f.jsxAttribute(f.jsxIdentifier("data-inspector-id"),f.stringLiteral(_)))}}}));let p="";try{let f=document.getElementById("__srcmap");if(f&&f.textContent){let a=JSON.parse(f.textContent),g=a==null?void 0:a.file;typeof g=="string"&&(p=g)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((f,a)=>{let g=f.getAttribute("data-plugins")||"";if(g.indexOf(t)<0&&f.setAttribute("data-plugins",g?`${g},${t}`:t),!f.hasAttribute("data-filename")){let h=p?`${p}#inline-${a}`:`inline-${a}`;f.setAttribute("data-filename",f.getAttribute("src")||h)}})})}var W={};Q(W,{destroy:()=>yt,init:()=>K,version:()=>bt});var ht=new Set(["https://comment.feishuapp.cn","https://comment.aiforce.cloud","https://comment.doubaoapps.com","https://comment.feishu.link","https://comment.feishuapp.com","https://comment.doubaowork.link","https://comment.doubao.link"]),Le="ccm-comment-bootstrap";function Ie(){return(t,e,r)=>{let i=new URL(t.src,document.URL);return!t.isConnected||t.hasAttribute("srcdoc")||!ht.has(i.origin)||i.username||i.password?Promise.reject(new Error("Untrusted comment iframe")):new Promise((p,f)=>{var S;let a=()=>{clearTimeout(y),window.removeEventListener("message",k),r.removeEventListener("abort",h)},g=L=>{a(),f(L)},h=()=>g(new Error("Comment session destroyed")),k=L=>{let w=L.data;if(L.source!==t.contentWindow||L.origin!==i.origin||(w==null?void 0:w.channel)!==Le||w.version!==1||w.type!=="waiting"||w.bootstrapSource===void 0)return;if(typeof w.bootstrapSource!="string"||!w.bootstrapSource.length||w.bootstrapSource.length>65536||typeof w.bootstrapVersion!="string"||!/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?$/.test(w.bootstrapVersion)||w.bootstrapVersion.length>64||typeof w.buildId!="string"||!w.buildId.length||w.buildId.length>128){g(new Error("Invalid comment bootstrap payload"));return}a();let I=window,s=I.CCMCommentBootstrap,m=document.createElement("script");e&&(m.nonce=e),m.textContent=w.bootstrapSource;try{I.CCMCommentBootstrap=void 0,document.head.appendChild(m);let _=I.CCMCommentBootstrap;if(!_||typeof _.init!="function"||_.version!==w.bootstrapVersion||_.buildId!==w.buildId)throw new Error("Comment bootstrap blocked or version/buildId mismatch");p(_)}catch(_){I.CCMCommentBootstrap=s,f(_)}finally{m.remove()}},y=setTimeout(()=>g(new Error("Comment bootstrap announcement timed out")),15e3);if(window.addEventListener("message",k),r.addEventListener("abort",h,{once:!0}),r.aborted){h();return}(S=t.contentWindow)==null||S.postMessage({channel:Le,version:1,type:"request-bootstrap"},i.origin)})}}function Te(t){let e;function r(){e==null||e.session.destroy()}function i(p){let{iframe:f}=p;if(!(f instanceof HTMLIFrameElement))throw new Error("A comment iframe is required");if((e==null?void 0:e.iframe)===f)return e.session;r();let a=new AbortController,g,h=new Promise((S,L)=>{let w=()=>{s(),S()},I=()=>{s(),L(new Error("Comment session destroyed"))},s=()=>{document.removeEventListener("DOMContentLoaded",w),a.signal.removeEventListener("abort",I)};a.signal.addEventListener("abort",I,{once:!0}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w,{once:!0}):w()}).then(async()=>{if(a.signal.aborted)throw new Error("Comment session destroyed");let S=await t(p,a.signal);if(g=S,a.signal.aborted)throw S.destroy(),new Error("Comment session destroyed");return S.ready}),k=S=>{S.persisted||y.destroy()},y={ready:h,destroy(){a.abort(),g==null||g.destroy(),window.removeEventListener("pagehide",k),(e==null?void 0:e.session)===y&&(e=void 0)}};return e={iframe:f,session:y},window.addEventListener("pagehide",k),h.catch(()=>y.destroy()),y}return{init:i,destroy:r}}var gt=document.currentScript instanceof HTMLScriptElement?document.currentScript.nonce:void 0,Pe="__miaodaCommentRuntime__",Ae=window,vt=Ie(),Me,X=(Me=Ae[Pe])!=null?Me:Te(async(t,e)=>{let r=await vt(t.iframe,t.nonce,e);if(e.aborted)throw new Error("Comment session destroyed");return r.init(t)});Ae[Pe]=X;var bt="0.0.19-beta.0";function K({iframe:t,nonce:e=gt}){return X.init({iframe:t,nonce:e})}var yt=X.destroy;function Re(){let t=()=>{let e=document.getElementById("miaoda-html-comment");if(e instanceof HTMLIFrameElement)try{K({iframe:e}).ready.catch(r=>{console.warn("[MiaodaComments] initialization failed",r)})}catch(r){console.warn("[MiaodaComments] initialization failed",r)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var q="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",wt=`${q}/miaoda-ui/doubao.svg`,_t=`${q}/miaoda-ui/Doubao_watermark_aigc.svg`,Ct=`${q}/logo/miaodalogo.svg`,Be='<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>',kt='<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>',xt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.13397 2.5C7.51887 1.83333 8.48113 1.83333 8.86603 2.5L14.0622 11.5C14.4471 12.1667 13.966 13 13.1962 13H2.80385C2.03405 13 1.55292 12.1667 1.93782 11.5L7.13397 2.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/><path d="M8 6.16667V8.83333" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="10.6667" r="0.6667" fill="currentColor"/></svg>',Et='<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.91685 2.08234C10.2097 2.37519 10.2096 2.8501 9.91685 3.143L7.06253 5.99732L9.91858 8.85337C10.2114 9.14627 10.2115 9.62115 9.91858 9.91403C9.62568 10.2068 9.15076 10.2068 8.85792 9.91403L6.00187 7.05798L3.14444 9.91541C2.85155 10.2083 2.37667 10.2083 2.08378 9.91541C1.791 9.62251 1.79093 9.14761 2.08378 8.85475L4.94121 5.99732L2.08551 3.14162C1.79267 2.84878 1.79278 2.37387 2.08551 2.08096C2.3784 1.78807 2.85327 1.78807 3.14617 2.08096L6.00187 4.93666L8.85619 2.08234C9.14906 1.78961 9.62399 1.7896 9.91685 2.08234Z" fill="white" fill-opacity="0.3"/></svg>',St='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',Lt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',He=!0,It="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)",Tt="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)",Y="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",Mt="'Doubao Sans', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",V={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C AI \u751F\u6210",logoSrc:wt,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:Ct,landingUrl:"https://miaoda.feishu.cn/landing"}},Pt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ne(){var r;let t=JSON.stringify({scene:"miaoda_app_report",entity_id:(r=P())!=null?r:"",entity_type:"miaoda_app",extra:""}),e=`https://${Pt[D()]}/cust/lark_report/?type=common&params=${encodeURIComponent(t)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}var At={feedback:kt,report:xt,close:Be,download:St,efficiency:Lt};function Fe(t){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${t}px`,height:`${t}px`,flexShrink:"0"}),e.innerHTML=Be;let r=e.firstElementChild;return r&&(r.setAttribute("width",String(t)),r.setAttribute("height",String(t)),r.style.display="block"),e}function Rt(t,e=16){if(t==="close")return Fe(e);let r=document.createElement("span");Object.assign(r.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),r.innerHTML=At[t];let i=r.firstElementChild;return i&&(i.style.display="block"),r}function Ot(t,e){let r=document.createElement("img");return r.src=t,r.width=e,r.height=e,r.alt="",Object.assign(r.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),r}function De(t,e,r){let i=e==="desktop",p=t==="doubao",f=V[t],a=document.createElement("div");p?Object.assign(a.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 8px",background:"rgba(77,77,77,0.7)",borderRadius:"6px",cursor:"pointer"}):Object.assign(a.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:i?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:It,cursor:"pointer"});let g;if(p){let h=document.createElement("img");h.src=_t,h.alt=f.brandText,h.draggable=!1,Object.assign(h.style,{height:i?"12px":"14px",width:"auto",display:"block",flexShrink:"0"}),g=h}else{let h=Ot(f.logoSrc,16),k=document.createElement("span");k.textContent=f.brandText,Object.assign(k.style,{fontFamily:Y,fontSize:i?"12px":"14px",lineHeight:i?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),g=k,a.append(h)}if(a.append(g),i&&r){let h=document.createElement("span");h.setAttribute("role","button"),h.setAttribute("aria-label","\u5173\u95ED"),h.setAttribute("data-watermark-close",""),Object.assign(h.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0"}),p?h.innerHTML=Et:(h.style.color="rgba(255,255,255,0.5)",h.appendChild(Fe(10))),h.addEventListener("click",k=>{k.stopPropagation(),r()}),a.appendChild(h)}return a}function A(t){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",t.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let r=document.createElement("span");Object.assign(r.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),r.appendChild(Rt(t.icon));let i=document.createElement("span");return i.textContent=t.label,Object.assign(i.style,{fontFamily:Y,fontSize:`${t.fontSize}px`,lineHeight:`${t.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(r,i),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",t.onClick),e}function Bt(){let t=document.createElement("div");return Object.assign(t.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),t}function $e(t){var r;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${t.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:Tt,overflow:"hidden",outline:"none"}),t.items.length){let i=document.createElement("div");Object.assign(i.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(r=t.itemGap)!=null?r:0}px`}),t.items.forEach(p=>i.appendChild(p)),e.appendChild(i)}if(t.extraItems&&t.extraItems.length){e.appendChild(Bt());let i=document.createElement("div");Object.assign(i.style,{boxSizing:"border-box",padding:"4px"}),t.extraItems.forEach(p=>i.appendChild(p)),e.appendChild(i)}return e}function We(t,e=!1){let r=document.createElement("div");r.setAttribute("data-custom-element",`${t}-watermark${e?"-mobile":""}`);let i=r.attachShadow({mode:"open"}),p=t==="doubao"?Mt:Y,f=document.createElement("style");f.textContent=`
1
+ "use strict";var MiaodaRuntime=(()=>{var Ue=Object.create;var R=Object.defineProperty;var ze=Object.getOwnPropertyDescriptor;var Ge=Object.getOwnPropertyNames;var Je=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var j=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Q=(t,e)=>{for(var r in e)R(t,r,{get:e[r],enumerable:!0})},ee=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Ge(e))!Xe.call(t,p)&&p!==r&&R(t,p,{get:()=>e[p],enumerable:!(i=ze(e,p))||i.enumerable});return t};var te=(t,e,r)=>(r=t!=null?Ue(Je(t)):{},ee(e||!t||!t.__esModule?R(r,"default",{value:t,enumerable:!0}):r,t)),Ke=t=>ee(R({},"__esModule",{value:!0}),t);var re=j((ne,O)=>{"use strict";(function(t){"use strict";function e(n,v){var o=(n&65535)+(v&65535),C=(n>>16)+(v>>16)+(o>>16);return C<<16|o&65535}function r(n,v){return n<<v|n>>>32-v}function i(n,v,o,C,x,T){return e(r(e(e(v,n),e(C,T)),x),o)}function p(n,v,o,C,x,T,M){return i(v&o|~v&C,n,v,x,T,M)}function f(n,v,o,C,x,T,M){return i(v&C|o&~C,n,v,x,T,M)}function a(n,v,o,C,x,T,M){return i(v^o^C,n,v,x,T,M)}function g(n,v,o,C,x,T,M){return i(o^(v|~C),n,v,x,T,M)}function h(n,v){n[v>>5]|=128<<v%32,n[(v+64>>>9<<4)+14]=v;var o,C,x,T,M,c=1732584193,l=-271733879,d=-1732584194,u=271733878;for(o=0;o<n.length;o+=16)C=c,x=l,T=d,M=u,c=p(c,l,d,u,n[o],7,-680876936),u=p(u,c,l,d,n[o+1],12,-389564586),d=p(d,u,c,l,n[o+2],17,606105819),l=p(l,d,u,c,n[o+3],22,-1044525330),c=p(c,l,d,u,n[o+4],7,-176418897),u=p(u,c,l,d,n[o+5],12,1200080426),d=p(d,u,c,l,n[o+6],17,-1473231341),l=p(l,d,u,c,n[o+7],22,-45705983),c=p(c,l,d,u,n[o+8],7,1770035416),u=p(u,c,l,d,n[o+9],12,-1958414417),d=p(d,u,c,l,n[o+10],17,-42063),l=p(l,d,u,c,n[o+11],22,-1990404162),c=p(c,l,d,u,n[o+12],7,1804603682),u=p(u,c,l,d,n[o+13],12,-40341101),d=p(d,u,c,l,n[o+14],17,-1502002290),l=p(l,d,u,c,n[o+15],22,1236535329),c=f(c,l,d,u,n[o+1],5,-165796510),u=f(u,c,l,d,n[o+6],9,-1069501632),d=f(d,u,c,l,n[o+11],14,643717713),l=f(l,d,u,c,n[o],20,-373897302),c=f(c,l,d,u,n[o+5],5,-701558691),u=f(u,c,l,d,n[o+10],9,38016083),d=f(d,u,c,l,n[o+15],14,-660478335),l=f(l,d,u,c,n[o+4],20,-405537848),c=f(c,l,d,u,n[o+9],5,568446438),u=f(u,c,l,d,n[o+14],9,-1019803690),d=f(d,u,c,l,n[o+3],14,-187363961),l=f(l,d,u,c,n[o+8],20,1163531501),c=f(c,l,d,u,n[o+13],5,-1444681467),u=f(u,c,l,d,n[o+2],9,-51403784),d=f(d,u,c,l,n[o+7],14,1735328473),l=f(l,d,u,c,n[o+12],20,-1926607734),c=a(c,l,d,u,n[o+5],4,-378558),u=a(u,c,l,d,n[o+8],11,-2022574463),d=a(d,u,c,l,n[o+11],16,1839030562),l=a(l,d,u,c,n[o+14],23,-35309556),c=a(c,l,d,u,n[o+1],4,-1530992060),u=a(u,c,l,d,n[o+4],11,1272893353),d=a(d,u,c,l,n[o+7],16,-155497632),l=a(l,d,u,c,n[o+10],23,-1094730640),c=a(c,l,d,u,n[o+13],4,681279174),u=a(u,c,l,d,n[o],11,-358537222),d=a(d,u,c,l,n[o+3],16,-722521979),l=a(l,d,u,c,n[o+6],23,76029189),c=a(c,l,d,u,n[o+9],4,-640364487),u=a(u,c,l,d,n[o+12],11,-421815835),d=a(d,u,c,l,n[o+15],16,530742520),l=a(l,d,u,c,n[o+2],23,-995338651),c=g(c,l,d,u,n[o],6,-198630844),u=g(u,c,l,d,n[o+7],10,1126891415),d=g(d,u,c,l,n[o+14],15,-1416354905),l=g(l,d,u,c,n[o+5],21,-57434055),c=g(c,l,d,u,n[o+12],6,1700485571),u=g(u,c,l,d,n[o+3],10,-1894986606),d=g(d,u,c,l,n[o+10],15,-1051523),l=g(l,d,u,c,n[o+1],21,-2054922799),c=g(c,l,d,u,n[o+8],6,1873313359),u=g(u,c,l,d,n[o+15],10,-30611744),d=g(d,u,c,l,n[o+6],15,-1560198380),l=g(l,d,u,c,n[o+13],21,1309151649),c=g(c,l,d,u,n[o+4],6,-145523070),u=g(u,c,l,d,n[o+11],10,-1120210379),d=g(d,u,c,l,n[o+2],15,718787259),l=g(l,d,u,c,n[o+9],21,-343485551),c=e(c,C),l=e(l,x),d=e(d,T),u=e(u,M);return[c,l,d,u]}function k(n){var v,o="",C=n.length*32;for(v=0;v<C;v+=8)o+=String.fromCharCode(n[v>>5]>>>v%32&255);return o}function y(n){var v,o=[];for(o[(n.length>>2)-1]=void 0,v=0;v<o.length;v+=1)o[v]=0;var C=n.length*8;for(v=0;v<C;v+=8)o[v>>5]|=(n.charCodeAt(v/8)&255)<<v%32;return o}function S(n){return k(h(y(n),n.length*8))}function L(n,v){var o,C=y(n),x=[],T=[],M;for(x[15]=T[15]=void 0,C.length>16&&(C=h(C,n.length*8)),o=0;o<16;o+=1)x[o]=C[o]^909522486,T[o]=C[o]^1549556828;return M=h(x.concat(y(v)),512+v.length*8),k(h(T.concat(M),640))}function w(n){var v="0123456789abcdef",o="",C,x;for(x=0;x<n.length;x+=1)C=n.charCodeAt(x),o+=v.charAt(C>>>4&15)+v.charAt(C&15);return o}function I(n){return unescape(encodeURIComponent(n))}function s(n){return S(I(n))}function m(n){return w(s(n))}function _(n,v){return L(I(n),I(v))}function b(n,v){return w(_(n,v))}function E(n,v,o){return v?o?_(v,n):b(v,n):o?s(n):m(n)}typeof define=="function"&&define.amd?define(function(){return E}):typeof O=="object"&&O.exports?O.exports=E:t.md5=E})(ne)});var ie=j((B,oe)=>{"use strict";(function(t,e){typeof B=="object"?oe.exports=B=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(B,function(){var t=t||(function(e,r){var i=Object.create||(function(){function s(){}return function(m){var _;return s.prototype=m,_=new s,s.prototype=null,_}})(),p={},f=p.lib={},a=f.Base=(function(){return{extend:function(s){var m=i(this);return s&&m.mixIn(s),(!m.hasOwnProperty("init")||this.init===m.init)&&(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var s=this.extend();return s.init.apply(s,arguments),s},init:function(){},mixIn:function(s){for(var m in s)s.hasOwnProperty(m)&&(this[m]=s[m]);s.hasOwnProperty("toString")&&(this.toString=s.toString)},clone:function(){return this.init.prototype.extend(this)}}})(),g=f.WordArray=a.extend({init:function(s,m){s=this.words=s||[],m!=r?this.sigBytes=m:this.sigBytes=s.length*4},toString:function(s){return(s||k).stringify(this)},concat:function(s){var m=this.words,_=s.words,b=this.sigBytes,E=s.sigBytes;if(this.clamp(),b%4)for(var n=0;n<E;n++){var v=_[n>>>2]>>>24-n%4*8&255;m[b+n>>>2]|=v<<24-(b+n)%4*8}else for(var n=0;n<E;n+=4)m[b+n>>>2]=_[n>>>2];return this.sigBytes+=E,this},clamp:function(){var s=this.words,m=this.sigBytes;s[m>>>2]&=4294967295<<32-m%4*8,s.length=e.ceil(m/4)},clone:function(){var s=a.clone.call(this);return s.words=this.words.slice(0),s},random:function(s){for(var m=[],_=(function(o){var o=o,C=987654321,x=4294967295;return function(){C=36969*(C&65535)+(C>>16)&x,o=18e3*(o&65535)+(o>>16)&x;var T=(C<<16)+o&x;return T/=4294967296,T+=.5,T*(e.random()>.5?1:-1)}}),b=0,E;b<s;b+=4){var n=_((E||e.random())*4294967296);E=n()*987654071,m.push(n()*4294967296|0)}return new g.init(m,s)}}),h=p.enc={},k=h.Hex={stringify:function(s){for(var m=s.words,_=s.sigBytes,b=[],E=0;E<_;E++){var n=m[E>>>2]>>>24-E%4*8&255;b.push((n>>>4).toString(16)),b.push((n&15).toString(16))}return b.join("")},parse:function(s){for(var m=s.length,_=[],b=0;b<m;b+=2)_[b>>>3]|=parseInt(s.substr(b,2),16)<<24-b%8*4;return new g.init(_,m/2)}},y=h.Latin1={stringify:function(s){for(var m=s.words,_=s.sigBytes,b=[],E=0;E<_;E++){var n=m[E>>>2]>>>24-E%4*8&255;b.push(String.fromCharCode(n))}return b.join("")},parse:function(s){for(var m=s.length,_=[],b=0;b<m;b++)_[b>>>2]|=(s.charCodeAt(b)&255)<<24-b%4*8;return new g.init(_,m)}},S=h.Utf8={stringify:function(s){try{return decodeURIComponent(escape(y.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(s){return y.parse(unescape(encodeURIComponent(s)))}},L=f.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(s){typeof s=="string"&&(s=S.parse(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes},_process:function(s){var m=this._data,_=m.words,b=m.sigBytes,E=this.blockSize,n=E*4,v=b/n;s?v=e.ceil(v):v=e.max((v|0)-this._minBufferSize,0);var o=v*E,C=e.min(o*4,b);if(o){for(var x=0;x<o;x+=E)this._doProcessBlock(_,x);var T=_.splice(0,o);m.sigBytes-=C}return new g.init(T,C)},clone:function(){var s=a.clone.call(this);return s._data=this._data.clone(),s},_minBufferSize:0}),w=f.Hasher=L.extend({cfg:a.extend(),init:function(s){this.cfg=this.cfg.extend(s),this.reset()},reset:function(){L.reset.call(this),this._doReset()},update:function(s){return this._append(s),this._process(),this},finalize:function(s){s&&this._append(s);var m=this._doFinalize();return m},blockSize:512/32,_createHelper:function(s){return function(m,_){return new s.init(_).finalize(m)}},_createHmacHelper:function(s){return function(m,_){return new I.HMAC.init(s,_).finalize(m)}}}),I=p.algo={};return p})(Math);return t})});var ae=j((H,se)=>{"use strict";(function(t,e){typeof H=="object"?se.exports=H=e(ie()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(H,function(t){return(function(){var e=t,r=e.lib,i=r.WordArray,p=r.Hasher,f=e.algo,a=[],g=f.SHA1=p.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(h,k){for(var y=this._hash.words,S=y[0],L=y[1],w=y[2],I=y[3],s=y[4],m=0;m<80;m++){if(m<16)a[m]=h[k+m]|0;else{var _=a[m-3]^a[m-8]^a[m-14]^a[m-16];a[m]=_<<1|_>>>31}var b=(S<<5|S>>>27)+s+a[m];m<20?b+=(L&w|~L&I)+1518500249:m<40?b+=(L^w^I)+1859775393:m<60?b+=(L&w|L&I|w&I)-1894007588:b+=(L^w^I)-899497514,s=I,I=w,w=L<<30|L>>>2,L=S,S=b}y[0]=y[0]+S|0,y[1]=y[1]+L|0,y[2]=y[2]+w|0,y[3]=y[3]+I|0,y[4]=y[4]+s|0},_doFinalize:function(){var h=this._data,k=h.words,y=this._nDataBytes*8,S=h.sigBytes*8;return k[S>>>5]|=128<<24-S%32,k[(S+64>>>9<<4)+14]=Math.floor(y/4294967296),k[(S+64>>>9<<4)+15]=y,h.sigBytes=k.length*4,this._process(),this._hash},clone:function(){var h=p.clone.call(this);return h._hash=this._hash.clone(),h}});e.SHA1=p._createHelper(g),e.HmacSHA1=p._createHmacHelper(g)})(),t.SHA1})});var $t={};Q($t,{TrackKey:()=>z,comments:()=>W,name:()=>Dt,reportTeaEvent:()=>G,version:()=>Ft});var pe=te(re(),1),fe=te(ae(),1);function P(){return window.appId||null}function N(){var r;let t="suda-csrf-token",e=document.cookie.split("; ");for(let i of e){let[p,f]=i.split("=");if(p===t)return decodeURIComponent(f)}return(r=window.csrfToken)!=null?r:null}function F(){let t=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(t)}function D(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}function ce(){return window.appEnv!=null?window.appEnv==="runtime":!0}function $(){let t=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(t),r=/iPad|Tab|Tablet/i.test(t)&&navigator.maxTouchPoints>1;return e||r}async function le(){var t,e,r;try{let i=P();if(!i)return!0;let p=F()?`/app/${i}/__runtime__/api/v1/studio/get_published`:`/spark/b/${i}/get_published`,a=await(await fetch(p,{headers:{"X-Suda-Csrf-Token":(t=N())!=null?t:""}})).json();if(a.code===0||a.status_code==="0")return((r=(e=a.data)==null?void 0:e.app_info)==null?void 0:r.show_badge)!==!1}catch{}return!0}async function de(){var i;let t=P();if(!t)return{code:1,msg:"appId is required",data:{}};let e=F()?`/app/${t}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${t}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(i=N())!=null?i:""}})).json()}var z={VIEW:"aily_agent_artifact_page_view"},Ze="08a441",qe="42b91e";function ue(t){let e=String(t);return(0,fe.default)(Ze+(0,pe.default)(e+qe)).toString()}var U=!1;async function Ye(){var f,a,g,h;let{data:t}=await de(),{tenantID:e,userID:r}=t||{},i=r&&r!=="0"?ue(r):void 0,p=e&&e!=="0"?ue(e):void 0;(f=window.collectEvent)==null||f.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:i,device_type:$()?"mobile":"pc",evtParams:{open_from:(a=new URLSearchParams(window.location.search).get("open-from"))!=null?a:void 0,env:D(),user_id:i,tenant_id:p}}),U=!0,(h=window.collectEvent)==null||h.call(window,"start")}async function G({trackKey:t,trackParams:e={}}){var r;try{U||(U=!0,await Ye()),(r=window.collectEvent)==null||r.call(window,t,e)}catch(i){console.error(i)}}function me(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:P(),agent_id:"agent_miaoda",url:window.location.href}})}function he(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}var ge="x_sdk_device_id";function Qe(){try{let t=localStorage.getItem(ge);return t||(t=he(),localStorage.setItem(ge,t)),t}catch{return he()}}function et(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}var tt="pageSessionID";function nt(){try{return new URLSearchParams(window.location.search).get(tt)||""}catch{return""}}function rt(t={}){let e=t.pvId||nt();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Qe(),module:"app_web",app_env:"runtime",source_type:"user",device_type:et(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}function ve(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}var ot="1.0.2";function it(t,e){let r=rt(e),i=ve(Date.now());return{metricsData:{resource:{attributes:{sdk_version:ot,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:t.map(p=>({attributes:{...r,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:ve(p.timestampMs),timeUnixNano:i,asDouble:1}))}}]}}}function st(t,e,r={},i){if(e.length===0)return;let p;try{p=JSON.stringify(it(e,i))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...r},body:p,keepalive:!0}).catch(()=>{})}catch{}}var J="__APAAS_PV_TRACKER_STARTED__";function at(){try{let t=window;return t[J]?!1:(t[J]=!0,!0)}catch{return!0}}function be(){try{window[J]=!1}catch{}}var ct=class ye{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new ye),this._instance}start(e){var r;if(!this.started&&at()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let i=(r=e.flushIntervalMs)!=null?r:1e4;this.flushTimer=setInterval(()=>this.flush(),i)}catch(i){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,be(),i}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,be())}pageKey(){let{origin:e,pathname:r,search:i}=window.location;return`${e}${r}${i}`}scheduleFirstFlush(){var e;let r=(e=this.config)==null?void 0:e.firstFlushDelayMs;r==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),r))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);st(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=()=>this.recordPv();window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let r=history[e],i=()=>this.recordPv();history[e]=function(...p){let f=r.apply(this,p);return i(),f},this.disposers.push(()=>{history[e]=r})}registerLifecycleListeners(){let e=()=>{document.visibilityState==="hidden"&&this.flush()};document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let r=()=>this.flush();window.addEventListener("pagehide",r),this.disposers.push(()=>window.removeEventListener("pagehide",r))}},we=ct.instance;function _e(){var r;let t=(r=P())!=null?r:"",e=F()?`/app/${t}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${t}/runtime/api/v1/observability/metrics/collect`;we.start({collectorUrl:e})}var lt=/\bLark\//i;function Ce(){var e,r,i,p;let t=window;return typeof((i=(r=(e=t.webkit)==null?void 0:e.messageHandlers)==null?void 0:r.invokeNative)==null?void 0:i.postMessage)=="function"||typeof((p=t.Lark_Bridge)==null?void 0:p.invokeNative)=="function"?!0:lt.test(navigator.userAgent)}function ke({messageIds:t,token:e,docType:r=113}){var g,h;if(t.length===0||!e)return!1;let i={apiName:"markMiaodaFeedMessagesRead",data:{__v2__:!0,messageIds:t.map(String),token:e,docType:r}},p=window,f=(h=(g=p.webkit)==null?void 0:g.messageHandlers)==null?void 0:h.invokeNative;if(f!=null&&f.postMessage)return f.postMessage(i),!0;let a=p.Lark_Bridge;return a!=null&&a.invokeNative?(a.invokeNative(JSON.stringify(i)),!0):!1}var dt=113,ut="/app/",pt="/__runtime__/api/v1/devops/read_lark_messages";function ft(t){if(!t||typeof t!="object")return[];let{data:e}=t;return Array.isArray(e)?e.map(String):e&&Array.isArray(e.message_ids)?e.message_ids.map(String):[]}var xe=!1;async function mt(t){var i;let e=await fetch(`${ut}${t}${pt}`,{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":(i=N())!=null?i:""}});if(!e.ok)return[];let r=await e.json();return ft(r)}async function Ee(){if(xe||!Ce())return;xe=!0;let t=P();if(t)try{let e=await mt(t);if(!e.length)return;ke({messageIds:e,token:t,docType:dt})}catch{}}function Se(){let t="inspector-id";document.addEventListener("DOMContentLoaded",()=>{let e=window.Babel;if(!e||!e.registerPlugin)return;let r=null,i=()=>{let f={},a=0;return document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach(g=>{let h=g.getAttribute("src");if(h){let k=h.split("?")[0],y=k.split("/").pop()||k;f[y]=y in f?"":k}else{a++;let k=a===1?"Inline Babel script":`Inline Babel script (${a})`;f[k]=g.getAttribute("data-filename")||`inline-${a-1}`}}),f};e.availablePlugins&&delete e.availablePlugins[t],e.registerPlugin(t,({types:f})=>({visitor:{JSXOpeningElement(a,g){let h=a.node;if(h.name&&h.name.type==="JSXMemberExpression")return;for(let b=0;b<h.attributes.length;b++){let E=h.attributes[b];if(E.type==="JSXAttribute"&&E.name&&E.name.name==="data-inspector-id")return}let k=g.file&&g.file.opts&&g.file.opts.filename||"?";r===null&&(r=i());let y=k.split("?")[0],S=y.split("/").pop()||y,L=r[k]||r[S]||y.replace(/^\/?[a-z][a-z0-9+.-]*:\/{1,2}[^/]+/i,"").replace(/^\/+/,"")||k,w=h.loc&&h.loc.start,I=w?w.line:0,s=w?w.column+1:0,m=h.name&&h.name.type==="JSXIdentifier"?h.name.name:L,_=`jsx:${L}:${m}:${I}:${s}`;h.attributes.push(f.jsxAttribute(f.jsxIdentifier("data-inspector-id"),f.stringLiteral(_)))}}}));let p="";try{let f=document.getElementById("__srcmap");if(f&&f.textContent){let a=JSON.parse(f.textContent),g=a==null?void 0:a.file;typeof g=="string"&&(p=g)}}catch{}document.querySelectorAll('script[type="text/babel"],script[type="text/jsx"]').forEach((f,a)=>{let g=f.getAttribute("data-plugins")||"";if(g.indexOf(t)<0&&f.setAttribute("data-plugins",g?`${g},${t}`:t),!f.hasAttribute("data-filename")){let h=p?`${p}#inline-${a}`:`inline-${a}`;f.setAttribute("data-filename",f.getAttribute("src")||h)}})})}var W={};Q(W,{destroy:()=>yt,init:()=>K,version:()=>bt});var ht=new Set(["https://comment.feishuapp.cn","https://comment.aiforce.cloud","https://comment.doubaoapps.com","https://comment.feishu.link","https://comment.feishuapp.com","https://comment.doubaowork.link","https://comment.doubao.link"]),Le="ccm-comment-bootstrap";function Ie(){return(t,e,r)=>{let i=new URL(t.src,document.URL);return!t.isConnected||t.hasAttribute("srcdoc")||!ht.has(i.origin)||i.username||i.password?Promise.reject(new Error("Untrusted comment iframe")):new Promise((p,f)=>{var S;let a=()=>{clearTimeout(y),window.removeEventListener("message",k),r.removeEventListener("abort",h)},g=L=>{a(),f(L)},h=()=>g(new Error("Comment session destroyed")),k=L=>{let w=L.data;if(L.source!==t.contentWindow||L.origin!==i.origin||(w==null?void 0:w.channel)!==Le||w.version!==1||w.type!=="waiting"||w.bootstrapSource===void 0)return;if(typeof w.bootstrapSource!="string"||!w.bootstrapSource.length||w.bootstrapSource.length>65536||typeof w.bootstrapVersion!="string"||!/^\d+\.\d+\.\d+(?:-[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*)?$/.test(w.bootstrapVersion)||w.bootstrapVersion.length>64||typeof w.buildId!="string"||!w.buildId.length||w.buildId.length>128){g(new Error("Invalid comment bootstrap payload"));return}a();let I=window,s=I.CCMCommentBootstrap,m=document.createElement("script");e&&(m.nonce=e),m.textContent=w.bootstrapSource;try{I.CCMCommentBootstrap=void 0,document.head.appendChild(m);let _=I.CCMCommentBootstrap;if(!_||typeof _.init!="function"||_.version!==w.bootstrapVersion||_.buildId!==w.buildId)throw new Error("Comment bootstrap blocked or version/buildId mismatch");p(_)}catch(_){I.CCMCommentBootstrap=s,f(_)}finally{m.remove()}},y=setTimeout(()=>g(new Error("Comment bootstrap announcement timed out")),15e3);if(window.addEventListener("message",k),r.addEventListener("abort",h,{once:!0}),r.aborted){h();return}(S=t.contentWindow)==null||S.postMessage({channel:Le,version:1,type:"request-bootstrap"},i.origin)})}}function Te(t){let e;function r(){e==null||e.session.destroy()}function i(p){let{iframe:f}=p;if(!(f instanceof HTMLIFrameElement))throw new Error("A comment iframe is required");if((e==null?void 0:e.iframe)===f)return e.session;r();let a=new AbortController,g,h=new Promise((S,L)=>{let w=()=>{s(),S()},I=()=>{s(),L(new Error("Comment session destroyed"))},s=()=>{document.removeEventListener("DOMContentLoaded",w),a.signal.removeEventListener("abort",I)};a.signal.addEventListener("abort",I,{once:!0}),document.readyState==="loading"?document.addEventListener("DOMContentLoaded",w,{once:!0}):w()}).then(async()=>{if(a.signal.aborted)throw new Error("Comment session destroyed");let S=await t(p,a.signal);if(g=S,a.signal.aborted)throw S.destroy(),new Error("Comment session destroyed");return S.ready}),k=S=>{S.persisted||y.destroy()},y={ready:h,destroy(){a.abort(),g==null||g.destroy(),window.removeEventListener("pagehide",k),(e==null?void 0:e.session)===y&&(e=void 0)}};return e={iframe:f,session:y},window.addEventListener("pagehide",k),h.catch(()=>y.destroy()),y}return{init:i,destroy:r}}var gt=document.currentScript instanceof HTMLScriptElement?document.currentScript.nonce:void 0,Pe="__miaodaCommentRuntime__",Ae=window,vt=Ie(),Me,X=(Me=Ae[Pe])!=null?Me:Te(async(t,e)=>{let r=await vt(t.iframe,t.nonce,e);if(e.aborted)throw new Error("Comment session destroyed");return r.init(t)});Ae[Pe]=X;var bt="0.0.20-beta.0";function K({iframe:t,nonce:e=gt}){return X.init({iframe:t,nonce:e})}var yt=X.destroy;function Re(){let t=()=>{let e=document.getElementById("miaoda-html-comment");if(e instanceof HTMLIFrameElement)try{K({iframe:e}).ready.catch(r=>{console.warn("[MiaodaComments] initialization failed",r)})}catch(r){console.warn("[MiaodaComments] initialization failed",r)}};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t,{once:!0}):t()}var q="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",wt=`${q}/miaoda-ui/doubao.svg`,_t=`${q}/miaoda-ui/Doubao_watermark_aigc.svg`,Ct=`${q}/logo/miaodalogo.svg`,Be='<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>',kt='<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>',xt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.13397 2.5C7.51887 1.83333 8.48113 1.83333 8.86603 2.5L14.0622 11.5C14.4471 12.1667 13.966 13 13.1962 13H2.80385C2.03405 13 1.55292 12.1667 1.93782 11.5L7.13397 2.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/><path d="M8 6.16667V8.83333" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="10.6667" r="0.6667" fill="currentColor"/></svg>',Et='<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.91685 2.08234C10.2097 2.37519 10.2096 2.8501 9.91685 3.143L7.06253 5.99732L9.91858 8.85337C10.2114 9.14627 10.2115 9.62115 9.91858 9.91403C9.62568 10.2068 9.15076 10.2068 8.85792 9.91403L6.00187 7.05798L3.14444 9.91541C2.85155 10.2083 2.37667 10.2083 2.08378 9.91541C1.791 9.62251 1.79093 9.14761 2.08378 8.85475L4.94121 5.99732L2.08551 3.14162C1.79267 2.84878 1.79278 2.37387 2.08551 2.08096C2.3784 1.78807 2.85327 1.78807 3.14617 2.08096L6.00187 4.93666L8.85619 2.08234C9.14906 1.78961 9.62399 1.7896 9.91685 2.08234Z" fill="white" fill-opacity="0.3"/></svg>',St='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',Lt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',He=!0,It="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)",Tt="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)",Y="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",Mt="'Doubao Sans', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",V={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C AI \u751F\u6210",logoSrc:wt,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:Ct,landingUrl:"https://miaoda.feishu.cn/landing"}},Pt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ne(){var r;let t=JSON.stringify({scene:"miaoda_app_report",entity_id:(r=P())!=null?r:"",entity_type:"miaoda_app",extra:""}),e=`https://${Pt[D()]}/cust/lark_report/?type=common&params=${encodeURIComponent(t)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}var At={feedback:kt,report:xt,close:Be,download:St,efficiency:Lt};function Fe(t){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${t}px`,height:`${t}px`,flexShrink:"0"}),e.innerHTML=Be;let r=e.firstElementChild;return r&&(r.setAttribute("width",String(t)),r.setAttribute("height",String(t)),r.style.display="block"),e}function Rt(t,e=16){if(t==="close")return Fe(e);let r=document.createElement("span");Object.assign(r.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),r.innerHTML=At[t];let i=r.firstElementChild;return i&&(i.style.display="block"),r}function Ot(t,e){let r=document.createElement("img");return r.src=t,r.width=e,r.height=e,r.alt="",Object.assign(r.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),r}function De(t,e,r){let i=e==="desktop",p=t==="doubao",f=V[t],a=document.createElement("div");p?Object.assign(a.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 8px",background:"rgba(77,77,77,0.7)",borderRadius:"6px",cursor:"pointer"}):Object.assign(a.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:i?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:It,cursor:"pointer"});let g;if(p){let h=document.createElement("img");h.src=_t,h.alt=f.brandText,h.draggable=!1,Object.assign(h.style,{height:i?"12px":"14px",width:"auto",display:"block",flexShrink:"0"}),g=h}else{let h=Ot(f.logoSrc,16),k=document.createElement("span");k.textContent=f.brandText,Object.assign(k.style,{fontFamily:Y,fontSize:i?"12px":"14px",lineHeight:i?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),g=k,a.append(h)}if(a.append(g),i&&r){let h=document.createElement("span");h.setAttribute("role","button"),h.setAttribute("aria-label","\u5173\u95ED"),h.setAttribute("data-watermark-close",""),Object.assign(h.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0"}),p?h.innerHTML=Et:(h.style.color="rgba(255,255,255,0.5)",h.appendChild(Fe(10))),h.addEventListener("click",k=>{k.stopPropagation(),r()}),a.appendChild(h)}return a}function A(t){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",t.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let r=document.createElement("span");Object.assign(r.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),r.appendChild(Rt(t.icon));let i=document.createElement("span");return i.textContent=t.label,Object.assign(i.style,{fontFamily:Y,fontSize:`${t.fontSize}px`,lineHeight:`${t.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(r,i),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",t.onClick),e}function Bt(){let t=document.createElement("div");return Object.assign(t.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),t}function $e(t){var r;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${t.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:Tt,overflow:"hidden",outline:"none"}),t.items.length){let i=document.createElement("div");Object.assign(i.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(r=t.itemGap)!=null?r:0}px`}),t.items.forEach(p=>i.appendChild(p)),e.appendChild(i)}if(t.extraItems&&t.extraItems.length){e.appendChild(Bt());let i=document.createElement("div");Object.assign(i.style,{boxSizing:"border-box",padding:"4px"}),t.extraItems.forEach(p=>i.appendChild(p)),e.appendChild(i)}return e}function We(t,e=!1){let r=document.createElement("div");r.setAttribute("data-custom-element",`${t}-watermark${e?"-mobile":""}`);let i=r.attachShadow({mode:"open"}),p=t==="doubao"?Mt:Y,f=document.createElement("style");f.textContent=`
2
2
  :host {
3
3
  all: initial !important;
4
4
  display: block !important;
@@ -20,4 +20,4 @@
20
20
  align-items: flex-end;
21
21
  gap: 8px;
22
22
  }
23
- `;let a=document.createElement("div");return a.className="watermark-root",i.append(f,a),{host:r,container:a}}function Ht(t){let{host:e,container:r}=We(t),i=[];t==="doubao"?i.push(A({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:()=>window.open(V.doubao.downloadUrl,"_blank","noopener,noreferrer")})):i.push(A({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:()=>window.open(V.miaoda.landingUrl,"_blank","noopener,noreferrer")})),He&&i.push(A({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ne}));let p=$e({items:i,minWidth:160,itemGap:8});p.style.display="none";let f=De(t,"desktop",()=>e.remove()),a=f.querySelector("[data-watermark-close]");r.append(p,f);let g=null;return r.addEventListener("mouseenter",()=>{g&&clearTimeout(g),p.style.display="flex",a&&(a.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{g=setTimeout(()=>{p.style.display="none",a&&(a.style.display="none")},100)}),e}function Nt(t){let{host:e,container:r}=We(t,!0);r.style.cursor="pointer";let i=[];t==="miaoda"&&i.push(A({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:()=>window.open(V.miaoda.landingUrl,"_blank","noopener,noreferrer")})),He&&i.push(A({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ne}));let p=[A({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:h=>{h.stopPropagation(),document.removeEventListener("click",g),e.remove()}})],f=$e({items:i,extraItems:p,minWidth:160});f.style.display="none";let a=De(t,"mobile");r.append(f,a),r.addEventListener("click",h=>{h.stopPropagation(),f.style.display=f.style.display==="none"?"flex":"none"});let g=()=>{f.style.display="none"};return document.addEventListener("click",g),e}var Oe=!1,Z=!1;async function Ve(t){if(Oe||Z||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Ve(t),{once:!0});return}Z=!0;let e=await le();if(Oe=!0,Z=!1,!e)return;let r=$()?Nt(t):Ht(t);document.body.appendChild(r)}function je(){return Ve("doubao")}var Ft="0.0.19-beta.0",Dt="@lark-apaas/miaoda-coding-sdk";Se();ce()&&(me(),_e());je();Ee();Re();return Ke($t);})();
23
+ `;let a=document.createElement("div");return a.className="watermark-root",i.append(f,a),{host:r,container:a}}function Ht(t){let{host:e,container:r}=We(t),i=[];t==="doubao"?i.push(A({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:()=>window.open(V.doubao.downloadUrl,"_blank","noopener,noreferrer")})):i.push(A({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:()=>window.open(V.miaoda.landingUrl,"_blank","noopener,noreferrer")})),He&&i.push(A({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ne}));let p=$e({items:i,minWidth:160,itemGap:8});p.style.display="none";let f=De(t,"desktop",()=>e.remove()),a=f.querySelector("[data-watermark-close]");r.append(p,f);let g=null;return r.addEventListener("mouseenter",()=>{g&&clearTimeout(g),p.style.display="flex",a&&(a.style.display="inline-flex")}),r.addEventListener("mouseleave",()=>{g=setTimeout(()=>{p.style.display="none",a&&(a.style.display="none")},100)}),e}function Nt(t){let{host:e,container:r}=We(t,!0);r.style.cursor="pointer";let i=[];t==="miaoda"&&i.push(A({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:()=>window.open(V.miaoda.landingUrl,"_blank","noopener,noreferrer")})),He&&i.push(A({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ne}));let p=[A({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:h=>{h.stopPropagation(),document.removeEventListener("click",g),e.remove()}})],f=$e({items:i,extraItems:p,minWidth:160});f.style.display="none";let a=De(t,"mobile");r.append(f,a),r.addEventListener("click",h=>{h.stopPropagation(),f.style.display=f.style.display==="none"?"flex":"none"});let g=()=>{f.style.display="none"};return document.addEventListener("click",g),e}var Oe=!1,Z=!1;async function Ve(t){if(Oe||Z||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Ve(t),{once:!0});return}Z=!0;let e=await le();if(Oe=!0,Z=!1,!e)return;let r=$()?Nt(t):Ht(t);document.body.appendChild(r)}function je(){return Ve("doubao")}var Ft="0.0.20-beta.0",Dt="@lark-apaas/miaoda-coding-sdk";Se();ce()&&(me(),_e());je();Ee();Re();return Ke($t);})();
@@ -1954,7 +1954,7 @@ var MiaodaRuntime = (() => {
1954
1954
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1955
1955
 
1956
1956
  // src/doubao-runtime.ts
1957
- var version = "0.0.19-beta.0";
1957
+ var version = "0.0.20-beta.0";
1958
1958
  var name = "@lark-apaas/miaoda-coding-sdk";
1959
1959
  if (isOnlineEnv()) {
1960
1960
  reportPageView();
@@ -1954,7 +1954,7 @@ var MiaodaRuntime = (() => {
1954
1954
  __name(mountDoubaoWatermark, "mountDoubaoWatermark");
1955
1955
 
1956
1956
  // src/doubao-runtime.ts
1957
- var version = "0.0.19-beta.0";
1957
+ var version = "0.0.20-beta.0";
1958
1958
  var name = "@lark-apaas/miaoda-coding-sdk";
1959
1959
  if (isOnlineEnv()) {
1960
1960
  reportPageView();
@@ -20,4 +20,4 @@
20
20
  align-items: flex-end;
21
21
  gap: 8px;
22
22
  }
23
- `;let g=document.createElement("div");return g.className="watermark-root",u.append(m,g),{host:o,container:g}}i(Ae,"createWatermarkRoot");function yt(t){let{host:e,container:o}=Ae(t),u=[];t==="doubao"?u.push(B({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(W.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Le}));let f=Te({items:u,minWidth:160,itemGap:8});f.style.display="none";let m=Ie(t,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(f,m);let b=null;return o.addEventListener("mouseenter",()=>{b&&clearTimeout(b),f.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{b=setTimeout(()=>{f.style.display="none",g&&(g.style.display="none")},100)}),e}i(yt,"buildDesktopWatermark");function Ct(t){let{host:e,container:o}=Ae(t,!0);o.style.cursor="pointer";let u=[];t==="miaoda"&&u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Le}));let f=[B({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(v=>{v.stopPropagation(),document.removeEventListener("click",b),e.remove()},"onClick")})],m=Te({items:u,extraItems:f,minWidth:160});m.style.display="none";let g=Ie(t,"mobile");o.append(m,g),o.addEventListener("click",v=>{v.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let b=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",b),e}i(Ct,"buildMobileWatermark");var xe=!1,X=!1;async function Oe(t){if(xe||X||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}X=!0;let e=await se();if(xe=!0,X=!1,!e)return;let o=U()?Ct(t):yt(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Me(){return Oe("doubao")}i(Me,"mountDoubaoWatermark");var xt="0.0.19-beta.0",kt="@lark-apaas/miaoda-coding-sdk";ae()&&(fe(),be());Me();Ce();return Ne(St);})();
23
+ `;let g=document.createElement("div");return g.className="watermark-root",u.append(m,g),{host:o,container:g}}i(Ae,"createWatermarkRoot");function yt(t){let{host:e,container:o}=Ae(t),u=[];t==="doubao"?u.push(B({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(W.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Le}));let f=Te({items:u,minWidth:160,itemGap:8});f.style.display="none";let m=Ie(t,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(f,m);let b=null;return o.addEventListener("mouseenter",()=>{b&&clearTimeout(b),f.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{b=setTimeout(()=>{f.style.display="none",g&&(g.style.display="none")},100)}),e}i(yt,"buildDesktopWatermark");function Ct(t){let{host:e,container:o}=Ae(t,!0);o.style.cursor="pointer";let u=[];t==="miaoda"&&u.push(B({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),Se&&u.push(B({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Le}));let f=[B({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(v=>{v.stopPropagation(),document.removeEventListener("click",b),e.remove()},"onClick")})],m=Te({items:u,extraItems:f,minWidth:160});m.style.display="none";let g=Ie(t,"mobile");o.append(m,g),o.addEventListener("click",v=>{v.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let b=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",b),e}i(Ct,"buildMobileWatermark");var xe=!1,X=!1;async function Oe(t){if(xe||X||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}X=!0;let e=await se();if(xe=!0,X=!1,!e)return;let o=U()?Ct(t):yt(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Me(){return Oe("doubao")}i(Me,"mountDoubaoWatermark");var xt="0.0.20-beta.0",kt="@lark-apaas/miaoda-coding-sdk";ae()&&(fe(),be());Me();Ce();return Ne(St);})();
@@ -955,6 +955,141 @@ var MiaodaRuntime = (() => {
955
955
  version: () => version
956
956
  });
957
957
 
958
+ // src/creative-babel-targets.ts
959
+ var BABEL_SCRIPT_SELECTOR = 'script[type="text/babel"],script[type="text/jsx"]';
960
+ var STANDALONE_DEFAULT_PLUGINS = [
961
+ "transform-class-properties",
962
+ "transform-object-rest-spread",
963
+ "transform-flow-strip-types"
964
+ ];
965
+ var SCOPE_PLUGINS = [
966
+ "transform-class-static-block",
967
+ "transform-class-properties",
968
+ "transform-private-methods",
969
+ "transform-private-property-in-object",
970
+ "transform-classes",
971
+ "transform-block-scoped-functions",
972
+ "transform-block-scoping"
973
+ ];
974
+ var MAX_TARGETS_LENGTH = 200;
975
+ var TARGET_RE = /^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;
976
+ function initCreativeBabelTargets() {
977
+ document.addEventListener("DOMContentLoaded", applyBabelTargets, {
978
+ once: true
979
+ });
980
+ }
981
+ __name(initCreativeBabelTargets, "initCreativeBabelTargets");
982
+ function detectBrowserEngine(ua) {
983
+ let m = /\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(ua);
984
+ if (m) return {
985
+ engine: "ios",
986
+ version: [
987
+ +m[1],
988
+ +(m[2] || 0)
989
+ ]
990
+ };
991
+ if (/\bEdge\/\d/.test(ua)) return null;
992
+ m = /\bFirefox\/(\d+)/.exec(ua);
993
+ if (m) return {
994
+ engine: "firefox",
995
+ version: [
996
+ +m[1],
997
+ 0
998
+ ]
999
+ };
1000
+ m = /Chrom(?:e|ium)\/(\d+)/.exec(ua);
1001
+ if (m) return {
1002
+ engine: "chrome",
1003
+ version: [
1004
+ +m[1],
1005
+ 0
1006
+ ]
1007
+ };
1008
+ m = /\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(ua);
1009
+ if (m) return {
1010
+ engine: "safari",
1011
+ version: [
1012
+ +m[1],
1013
+ +(m[2] || 0)
1014
+ ]
1015
+ };
1016
+ return null;
1017
+ }
1018
+ __name(detectBrowserEngine, "detectBrowserEngine");
1019
+ function compareVersion(a, b) {
1020
+ return a[0] - b[0] || a[1] - b[1];
1021
+ }
1022
+ __name(compareVersion, "compareVersion");
1023
+ function readTargets() {
1024
+ const raw = window.__creativeBabelTargets__;
1025
+ if (typeof raw !== "string" || raw.length > MAX_TARGETS_LENGTH) return null;
1026
+ const targets = [];
1027
+ for (const item of raw.split(",")) {
1028
+ const query = item.trim().toLowerCase().replace(/\s+/g, " ");
1029
+ if (!query) continue;
1030
+ const m = TARGET_RE.exec(query);
1031
+ if (!m) return null;
1032
+ targets.push({
1033
+ query,
1034
+ engine: m[1] === "ios_saf" ? "ios" : m[1],
1035
+ version: [
1036
+ +m[2],
1037
+ +(m[3] || 0)
1038
+ ]
1039
+ });
1040
+ }
1041
+ return targets.length ? targets : null;
1042
+ }
1043
+ __name(readTargets, "readTargets");
1044
+ function currentBrowserMeets(targets) {
1045
+ const current = detectBrowserEngine(navigator.userAgent || "");
1046
+ if (!current) return false;
1047
+ const same = targets.filter((t) => t.engine === current.engine);
1048
+ return same.length > 0 && same.every((t) => compareVersion(current.version, t.version) >= 0);
1049
+ }
1050
+ __name(currentBrowserMeets, "currentBrowserMeets");
1051
+ function appendPlugins(babel, base, extra) {
1052
+ const available = babel.availablePlugins || {};
1053
+ const same = /* @__PURE__ */ __name((a, b) => a === b || available[a] !== void 0 && available[a] === available[b], "same");
1054
+ const out = base.slice();
1055
+ for (const p of extra) {
1056
+ if (!out.some((q) => same(q, p))) out.push(p);
1057
+ }
1058
+ return out;
1059
+ }
1060
+ __name(appendPlugins, "appendPlugins");
1061
+ function applyBabelTargets() {
1062
+ const targets = readTargets();
1063
+ if (!targets || !currentBrowserMeets(targets)) return;
1064
+ const babel = window.Babel;
1065
+ if (!babel || typeof babel.transform !== "function") return;
1066
+ const tags = Array.from(document.querySelectorAll(BABEL_SCRIPT_SELECTOR)).filter((el) => !el.hasAttribute("data-targets") && !el.hasAttribute("data-presets") && el.getAttribute("data-type") !== "module");
1067
+ if (!tags.length) return;
1068
+ const browsers = targets.map((t) => t.query);
1069
+ try {
1070
+ babel.transform("", {
1071
+ presets: [
1072
+ "react",
1073
+ "env"
1074
+ ],
1075
+ plugins: appendPlugins(babel, STANDALONE_DEFAULT_PLUGINS, SCOPE_PLUGINS),
1076
+ targets: {
1077
+ browsers
1078
+ }
1079
+ });
1080
+ } catch {
1081
+ return;
1082
+ }
1083
+ const value = browsers.join(",");
1084
+ for (const el of tags) {
1085
+ const current = el.getAttribute("data-plugins");
1086
+ const base = current === null ? STANDALONE_DEFAULT_PLUGINS : current.split(",").map((s) => s.trim()).filter(Boolean);
1087
+ el.setAttribute("data-plugins", appendPlugins(babel, base, SCOPE_PLUGINS).join(","));
1088
+ el.setAttribute("data-targets", value);
1089
+ }
1090
+ }
1091
+ __name(applyBabelTargets, "applyBabelTargets");
1092
+
958
1093
  // src/runtime/tea.ts
959
1094
  var import_blueimp_md5 = __toESM(require_md5(), 1);
960
1095
  var import_sha1 = __toESM(require_sha1(), 1);
@@ -1868,12 +2003,13 @@ var MiaodaRuntime = (() => {
1868
2003
  __name(mountMiaodaWatermark, "mountMiaodaWatermark");
1869
2004
 
1870
2005
  // src/runtime.ts
1871
- var version = "0.0.19-beta.0";
2006
+ var version = "0.0.20-beta.0";
1872
2007
  var name = "@lark-apaas/miaoda-coding-sdk";
1873
2008
  if (isOnlineEnv()) {
1874
2009
  reportPageView();
1875
2010
  initPvTracking();
1876
2011
  }
1877
2012
  mountMiaodaWatermark();
2013
+ initCreativeBabelTargets();
1878
2014
  return __toCommonJS(runtime_exports);
1879
2015
  })();
package/dist/runtime.js CHANGED
@@ -955,6 +955,141 @@ var MiaodaRuntime = (() => {
955
955
  version: () => version
956
956
  });
957
957
 
958
+ // src/creative-babel-targets.ts
959
+ var BABEL_SCRIPT_SELECTOR = 'script[type="text/babel"],script[type="text/jsx"]';
960
+ var STANDALONE_DEFAULT_PLUGINS = [
961
+ "transform-class-properties",
962
+ "transform-object-rest-spread",
963
+ "transform-flow-strip-types"
964
+ ];
965
+ var SCOPE_PLUGINS = [
966
+ "transform-class-static-block",
967
+ "transform-class-properties",
968
+ "transform-private-methods",
969
+ "transform-private-property-in-object",
970
+ "transform-classes",
971
+ "transform-block-scoped-functions",
972
+ "transform-block-scoping"
973
+ ];
974
+ var MAX_TARGETS_LENGTH = 200;
975
+ var TARGET_RE = /^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;
976
+ function initCreativeBabelTargets() {
977
+ document.addEventListener("DOMContentLoaded", applyBabelTargets, {
978
+ once: true
979
+ });
980
+ }
981
+ __name(initCreativeBabelTargets, "initCreativeBabelTargets");
982
+ function detectBrowserEngine(ua) {
983
+ let m = /\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(ua);
984
+ if (m) return {
985
+ engine: "ios",
986
+ version: [
987
+ +m[1],
988
+ +(m[2] || 0)
989
+ ]
990
+ };
991
+ if (/\bEdge\/\d/.test(ua)) return null;
992
+ m = /\bFirefox\/(\d+)/.exec(ua);
993
+ if (m) return {
994
+ engine: "firefox",
995
+ version: [
996
+ +m[1],
997
+ 0
998
+ ]
999
+ };
1000
+ m = /Chrom(?:e|ium)\/(\d+)/.exec(ua);
1001
+ if (m) return {
1002
+ engine: "chrome",
1003
+ version: [
1004
+ +m[1],
1005
+ 0
1006
+ ]
1007
+ };
1008
+ m = /\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(ua);
1009
+ if (m) return {
1010
+ engine: "safari",
1011
+ version: [
1012
+ +m[1],
1013
+ +(m[2] || 0)
1014
+ ]
1015
+ };
1016
+ return null;
1017
+ }
1018
+ __name(detectBrowserEngine, "detectBrowserEngine");
1019
+ function compareVersion(a, b) {
1020
+ return a[0] - b[0] || a[1] - b[1];
1021
+ }
1022
+ __name(compareVersion, "compareVersion");
1023
+ function readTargets() {
1024
+ const raw = window.__creativeBabelTargets__;
1025
+ if (typeof raw !== "string" || raw.length > MAX_TARGETS_LENGTH) return null;
1026
+ const targets = [];
1027
+ for (const item of raw.split(",")) {
1028
+ const query = item.trim().toLowerCase().replace(/\s+/g, " ");
1029
+ if (!query) continue;
1030
+ const m = TARGET_RE.exec(query);
1031
+ if (!m) return null;
1032
+ targets.push({
1033
+ query,
1034
+ engine: m[1] === "ios_saf" ? "ios" : m[1],
1035
+ version: [
1036
+ +m[2],
1037
+ +(m[3] || 0)
1038
+ ]
1039
+ });
1040
+ }
1041
+ return targets.length ? targets : null;
1042
+ }
1043
+ __name(readTargets, "readTargets");
1044
+ function currentBrowserMeets(targets) {
1045
+ const current = detectBrowserEngine(navigator.userAgent || "");
1046
+ if (!current) return false;
1047
+ const same = targets.filter((t) => t.engine === current.engine);
1048
+ return same.length > 0 && same.every((t) => compareVersion(current.version, t.version) >= 0);
1049
+ }
1050
+ __name(currentBrowserMeets, "currentBrowserMeets");
1051
+ function appendPlugins(babel, base, extra) {
1052
+ const available = babel.availablePlugins || {};
1053
+ const same = /* @__PURE__ */ __name((a, b) => a === b || available[a] !== void 0 && available[a] === available[b], "same");
1054
+ const out = base.slice();
1055
+ for (const p of extra) {
1056
+ if (!out.some((q) => same(q, p))) out.push(p);
1057
+ }
1058
+ return out;
1059
+ }
1060
+ __name(appendPlugins, "appendPlugins");
1061
+ function applyBabelTargets() {
1062
+ const targets = readTargets();
1063
+ if (!targets || !currentBrowserMeets(targets)) return;
1064
+ const babel = window.Babel;
1065
+ if (!babel || typeof babel.transform !== "function") return;
1066
+ const tags = Array.from(document.querySelectorAll(BABEL_SCRIPT_SELECTOR)).filter((el) => !el.hasAttribute("data-targets") && !el.hasAttribute("data-presets") && el.getAttribute("data-type") !== "module");
1067
+ if (!tags.length) return;
1068
+ const browsers = targets.map((t) => t.query);
1069
+ try {
1070
+ babel.transform("", {
1071
+ presets: [
1072
+ "react",
1073
+ "env"
1074
+ ],
1075
+ plugins: appendPlugins(babel, STANDALONE_DEFAULT_PLUGINS, SCOPE_PLUGINS),
1076
+ targets: {
1077
+ browsers
1078
+ }
1079
+ });
1080
+ } catch {
1081
+ return;
1082
+ }
1083
+ const value = browsers.join(",");
1084
+ for (const el of tags) {
1085
+ const current = el.getAttribute("data-plugins");
1086
+ const base = current === null ? STANDALONE_DEFAULT_PLUGINS : current.split(",").map((s) => s.trim()).filter(Boolean);
1087
+ el.setAttribute("data-plugins", appendPlugins(babel, base, SCOPE_PLUGINS).join(","));
1088
+ el.setAttribute("data-targets", value);
1089
+ }
1090
+ }
1091
+ __name(applyBabelTargets, "applyBabelTargets");
1092
+
958
1093
  // src/runtime/tea.ts
959
1094
  var import_blueimp_md5 = __toESM(require_md5(), 1);
960
1095
  var import_sha1 = __toESM(require_sha1(), 1);
@@ -1868,12 +2003,13 @@ var MiaodaRuntime = (() => {
1868
2003
  __name(mountMiaodaWatermark, "mountMiaodaWatermark");
1869
2004
 
1870
2005
  // src/runtime.ts
1871
- var version = "0.0.19-beta.0";
2006
+ var version = "0.0.20-beta.0";
1872
2007
  var name = "@lark-apaas/miaoda-coding-sdk";
1873
2008
  if (isOnlineEnv()) {
1874
2009
  reportPageView();
1875
2010
  initPvTracking();
1876
2011
  }
1877
2012
  mountMiaodaWatermark();
2013
+ initCreativeBabelTargets();
1878
2014
  return __toCommonJS(runtime_exports);
1879
2015
  })();
@@ -1,4 +1,4 @@
1
- "use strict";var MiaodaRuntime=(()=>{var Te=Object.create;var D=Object.defineProperty;var Ae=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var Be=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var i=(n,e)=>D(n,"name",{value:e,configurable:!0});var j=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Me=(n,e)=>{for(var o in e)D(n,o,{get:e[o],enumerable:!0})},X=(n,e,o,u)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of Oe(e))!Pe.call(n,p)&&p!==o&&D(n,p,{get:()=>e[p],enumerable:!(u=Ae(e,p))||u.enumerable});return n};var Y=(n,e,o)=>(o=n!=null?Te(Be(n)):{},X(e||!n||!n.__esModule?D(o,"default",{value:n,enumerable:!0}):o,n)),De=n=>X(D({},"__esModule",{value:!0}),n);var ee=j((Q,R)=>{"use strict";(function(n){"use strict";function e(t,h){var r=(t&65535)+(h&65535),y=(t>>16)+(h>>16)+(r>>16);return y<<16|r&65535}i(e,"safeAdd");function o(t,h){return t<<h|t>>>32-h}i(o,"bitRotateLeft");function u(t,h,r,y,C,S){return e(o(e(e(h,t),e(y,S)),C),r)}i(u,"md5cmn");function p(t,h,r,y,C,S,A){return u(h&r|~h&y,t,h,C,S,A)}i(p,"md5ff");function m(t,h,r,y,C,S,A){return u(h&y|r&~y,t,h,C,S,A)}i(m,"md5gg");function g(t,h,r,y,C,S,A){return u(h^r^y,t,h,C,S,A)}i(g,"md5hh");function b(t,h,r,y,C,S,A){return u(r^(h|~y),t,h,C,S,A)}i(b,"md5ii");function v(t,h){t[h>>5]|=128<<h%32,t[(h+64>>>9<<4)+14]=h;var r,y,C,S,A,a=1732584193,s=-271733879,c=-1732584194,l=271733878;for(r=0;r<t.length;r+=16)y=a,C=s,S=c,A=l,a=p(a,s,c,l,t[r],7,-680876936),l=p(l,a,s,c,t[r+1],12,-389564586),c=p(c,l,a,s,t[r+2],17,606105819),s=p(s,c,l,a,t[r+3],22,-1044525330),a=p(a,s,c,l,t[r+4],7,-176418897),l=p(l,a,s,c,t[r+5],12,1200080426),c=p(c,l,a,s,t[r+6],17,-1473231341),s=p(s,c,l,a,t[r+7],22,-45705983),a=p(a,s,c,l,t[r+8],7,1770035416),l=p(l,a,s,c,t[r+9],12,-1958414417),c=p(c,l,a,s,t[r+10],17,-42063),s=p(s,c,l,a,t[r+11],22,-1990404162),a=p(a,s,c,l,t[r+12],7,1804603682),l=p(l,a,s,c,t[r+13],12,-40341101),c=p(c,l,a,s,t[r+14],17,-1502002290),s=p(s,c,l,a,t[r+15],22,1236535329),a=m(a,s,c,l,t[r+1],5,-165796510),l=m(l,a,s,c,t[r+6],9,-1069501632),c=m(c,l,a,s,t[r+11],14,643717713),s=m(s,c,l,a,t[r],20,-373897302),a=m(a,s,c,l,t[r+5],5,-701558691),l=m(l,a,s,c,t[r+10],9,38016083),c=m(c,l,a,s,t[r+15],14,-660478335),s=m(s,c,l,a,t[r+4],20,-405537848),a=m(a,s,c,l,t[r+9],5,568446438),l=m(l,a,s,c,t[r+14],9,-1019803690),c=m(c,l,a,s,t[r+3],14,-187363961),s=m(s,c,l,a,t[r+8],20,1163531501),a=m(a,s,c,l,t[r+13],5,-1444681467),l=m(l,a,s,c,t[r+2],9,-51403784),c=m(c,l,a,s,t[r+7],14,1735328473),s=m(s,c,l,a,t[r+12],20,-1926607734),a=g(a,s,c,l,t[r+5],4,-378558),l=g(l,a,s,c,t[r+8],11,-2022574463),c=g(c,l,a,s,t[r+11],16,1839030562),s=g(s,c,l,a,t[r+14],23,-35309556),a=g(a,s,c,l,t[r+1],4,-1530992060),l=g(l,a,s,c,t[r+4],11,1272893353),c=g(c,l,a,s,t[r+7],16,-155497632),s=g(s,c,l,a,t[r+10],23,-1094730640),a=g(a,s,c,l,t[r+13],4,681279174),l=g(l,a,s,c,t[r],11,-358537222),c=g(c,l,a,s,t[r+3],16,-722521979),s=g(s,c,l,a,t[r+6],23,76029189),a=g(a,s,c,l,t[r+9],4,-640364487),l=g(l,a,s,c,t[r+12],11,-421815835),c=g(c,l,a,s,t[r+15],16,530742520),s=g(s,c,l,a,t[r+2],23,-995338651),a=b(a,s,c,l,t[r],6,-198630844),l=b(l,a,s,c,t[r+7],10,1126891415),c=b(c,l,a,s,t[r+14],15,-1416354905),s=b(s,c,l,a,t[r+5],21,-57434055),a=b(a,s,c,l,t[r+12],6,1700485571),l=b(l,a,s,c,t[r+3],10,-1894986606),c=b(c,l,a,s,t[r+10],15,-1051523),s=b(s,c,l,a,t[r+1],21,-2054922799),a=b(a,s,c,l,t[r+8],6,1873313359),l=b(l,a,s,c,t[r+15],10,-30611744),c=b(c,l,a,s,t[r+6],15,-1560198380),s=b(s,c,l,a,t[r+13],21,1309151649),a=b(a,s,c,l,t[r+4],6,-145523070),l=b(l,a,s,c,t[r+11],10,-1120210379),c=b(c,l,a,s,t[r+2],15,718787259),s=b(s,c,l,a,t[r+9],21,-343485551),a=e(a,y),s=e(s,C),c=e(c,S),l=e(l,A);return[a,s,c,l]}i(v,"binlMD5");function L(t){var h,r="",y=t.length*32;for(h=0;h<y;h+=8)r+=String.fromCharCode(t[h>>5]>>>h%32&255);return r}i(L,"binl2rstr");function x(t){var h,r=[];for(r[(t.length>>2)-1]=void 0,h=0;h<r.length;h+=1)r[h]=0;var y=t.length*8;for(h=0;h<y;h+=8)r[h>>5]|=(t.charCodeAt(h/8)&255)<<h%32;return r}i(x,"rstr2binl");function I(t){return L(v(x(t),t.length*8))}i(I,"rstrMD5");function E(t,h){var r,y=x(t),C=[],S=[],A;for(C[15]=S[15]=void 0,y.length>16&&(y=v(y,t.length*8)),r=0;r<16;r+=1)C[r]=y[r]^909522486,S[r]=y[r]^1549556828;return A=v(C.concat(x(h)),512+h.length*8),L(v(S.concat(A),640))}i(E,"rstrHMACMD5");function O(t){var h="0123456789abcdef",r="",y,C;for(C=0;C<t.length;C+=1)y=t.charCodeAt(C),r+=h.charAt(y>>>4&15)+h.charAt(y&15);return r}i(O,"rstr2hex");function T(t){return unescape(encodeURIComponent(t))}i(T,"str2rstrUTF8");function d(t){return I(T(t))}i(d,"rawMD5");function f(t){return O(d(t))}i(f,"hexMD5");function _(t,h){return E(T(t),T(h))}i(_,"rawHMACMD5");function w(t,h){return O(_(t,h))}i(w,"hexHMACMD5");function k(t,h,r){return h?r?_(h,t):w(h,t):r?d(t):f(t)}i(k,"md5"),typeof define=="function"&&define.amd?define(function(){return k}):typeof R=="object"&&R.exports?R.exports=k:n.md5=k})(Q)});var ne=j((H,te)=>{"use strict";(function(n,e){typeof H=="object"?te.exports=H=e():typeof define=="function"&&define.amd?define([],e):n.CryptoJS=e()})(H,function(){var n=n||(function(e,o){var u=Object.create||(function(){function d(){}return i(d,"F"),function(f){var _;return d.prototype=f,_=new d,d.prototype=null,_}})(),p={},m=p.lib={},g=m.Base=(function(){return{extend:i(function(d){var f=u(this);return d&&f.mixIn(d),(!f.hasOwnProperty("init")||this.init===f.init)&&(f.init=function(){f.$super.init.apply(this,arguments)}),f.init.prototype=f,f.$super=this,f},"extend"),create:i(function(){var d=this.extend();return d.init.apply(d,arguments),d},"create"),init:i(function(){},"init"),mixIn:i(function(d){for(var f in d)d.hasOwnProperty(f)&&(this[f]=d[f]);d.hasOwnProperty("toString")&&(this.toString=d.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),b=m.WordArray=g.extend({init:i(function(d,f){d=this.words=d||[],f!=o?this.sigBytes=f:this.sigBytes=d.length*4},"init"),toString:i(function(d){return(d||L).stringify(this)},"toString"),concat:i(function(d){var f=this.words,_=d.words,w=this.sigBytes,k=d.sigBytes;if(this.clamp(),w%4)for(var t=0;t<k;t++){var h=_[t>>>2]>>>24-t%4*8&255;f[w+t>>>2]|=h<<24-(w+t)%4*8}else for(var t=0;t<k;t+=4)f[w+t>>>2]=_[t>>>2];return this.sigBytes+=k,this},"concat"),clamp:i(function(){var d=this.words,f=this.sigBytes;d[f>>>2]&=4294967295<<32-f%4*8,d.length=e.ceil(f/4)},"clamp"),clone:i(function(){var d=g.clone.call(this);return d.words=this.words.slice(0),d},"clone"),random:i(function(d){for(var f=[],_=i(function(r){var r=r,y=987654321,C=4294967295;return function(){y=36969*(y&65535)+(y>>16)&C,r=18e3*(r&65535)+(r>>16)&C;var S=(y<<16)+r&C;return S/=4294967296,S+=.5,S*(e.random()>.5?1:-1)}},"r"),w=0,k;w<d;w+=4){var t=_((k||e.random())*4294967296);k=t()*987654071,f.push(t()*4294967296|0)}return new b.init(f,d)},"random")}),v=p.enc={},L=v.Hex={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,w=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;w.push((t>>>4).toString(16)),w.push((t&15).toString(16))}return w.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],w=0;w<f;w+=2)_[w>>>3]|=parseInt(d.substr(w,2),16)<<24-w%8*4;return new b.init(_,f/2)},"parse")},x=v.Latin1={stringify:i(function(d){for(var f=d.words,_=d.sigBytes,w=[],k=0;k<_;k++){var t=f[k>>>2]>>>24-k%4*8&255;w.push(String.fromCharCode(t))}return w.join("")},"stringify"),parse:i(function(d){for(var f=d.length,_=[],w=0;w<f;w++)_[w>>>2]|=(d.charCodeAt(w)&255)<<24-w%4*8;return new b.init(_,f)},"parse")},I=v.Utf8={stringify:i(function(d){try{return decodeURIComponent(escape(x.stringify(d)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(d){return x.parse(unescape(encodeURIComponent(d)))},"parse")},E=m.BufferedBlockAlgorithm=g.extend({reset:i(function(){this._data=new b.init,this._nDataBytes=0},"reset"),_append:i(function(d){typeof d=="string"&&(d=I.parse(d)),this._data.concat(d),this._nDataBytes+=d.sigBytes},"_append"),_process:i(function(d){var f=this._data,_=f.words,w=f.sigBytes,k=this.blockSize,t=k*4,h=w/t;d?h=e.ceil(h):h=e.max((h|0)-this._minBufferSize,0);var r=h*k,y=e.min(r*4,w);if(r){for(var C=0;C<r;C+=k)this._doProcessBlock(_,C);var S=_.splice(0,r);f.sigBytes-=y}return new b.init(S,y)},"_process"),clone:i(function(){var d=g.clone.call(this);return d._data=this._data.clone(),d},"clone"),_minBufferSize:0}),O=m.Hasher=E.extend({cfg:g.extend(),init:i(function(d){this.cfg=this.cfg.extend(d),this.reset()},"init"),reset:i(function(){E.reset.call(this),this._doReset()},"reset"),update:i(function(d){return this._append(d),this._process(),this},"update"),finalize:i(function(d){d&&this._append(d);var f=this._doFinalize();return f},"finalize"),blockSize:512/32,_createHelper:i(function(d){return function(f,_){return new d.init(_).finalize(f)}},"_createHelper"),_createHmacHelper:i(function(d){return function(f,_){return new T.HMAC.init(d,_).finalize(f)}},"_createHmacHelper")}),T=p.algo={};return p})(Math);return n})});var ie=j((F,re)=>{"use strict";(function(n,e){typeof F=="object"?re.exports=F=e(ne()):typeof define=="function"&&define.amd?define(["./core"],e):e(n.CryptoJS)})(F,function(n){return(function(){var e=n,o=e.lib,u=o.WordArray,p=o.Hasher,m=e.algo,g=[],b=m.SHA1=p.extend({_doReset:i(function(){this._hash=new u.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(v,L){for(var x=this._hash.words,I=x[0],E=x[1],O=x[2],T=x[3],d=x[4],f=0;f<80;f++){if(f<16)g[f]=v[L+f]|0;else{var _=g[f-3]^g[f-8]^g[f-14]^g[f-16];g[f]=_<<1|_>>>31}var w=(I<<5|I>>>27)+d+g[f];f<20?w+=(E&O|~E&T)+1518500249:f<40?w+=(E^O^T)+1859775393:f<60?w+=(E&O|E&T|O&T)-1894007588:w+=(E^O^T)-899497514,d=T,T=O,O=E<<30|E>>>2,E=I,I=w}x[0]=x[0]+I|0,x[1]=x[1]+E|0,x[2]=x[2]+O|0,x[3]=x[3]+T|0,x[4]=x[4]+d|0},"_doProcessBlock"),_doFinalize:i(function(){var v=this._data,L=v.words,x=this._nDataBytes*8,I=v.sigBytes*8;return L[I>>>5]|=128<<24-I%32,L[(I+64>>>9<<4)+14]=Math.floor(x/4294967296),L[(I+64>>>9<<4)+15]=x,v.sigBytes=L.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var v=p.clone.call(this);return v._hash=this._hash.clone(),v},"clone")});e.SHA1=p._createHelper(b),e.HmacSHA1=p._createHmacHelper(b)})(),n.SHA1})});var gt={};Me(gt,{TrackKey:()=>z,name:()=>ht,reportTeaEvent:()=>G,version:()=>pt});var de=Y(ee(),1),ue=Y(ie(),1);function B(){return window.appId||null}i(B,"getAppId");function oe(){var o;let n="suda-csrf-token",e=document.cookie.split("; ");for(let u of e){let[p,m]=u.split("=");if(p===n)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(oe,"getCsrfToken");function N(){let n=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(n)}i(N,"isNewPathEnabled");function $(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i($,"getEnv");function ae(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(ae,"isOnlineEnv");function U(){let n=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(n),o=/iPad|Tab|Tablet/i.test(n)&&navigator.maxTouchPoints>1;return e||o}i(U,"isMobile");async function se(){var n,e,o;try{let u=B();if(!u)return!0;let p=N()?`/app/${u}/__runtime__/api/v1/studio/get_published`:`/spark/b/${u}/get_published`,g=await(await fetch(p,{headers:{"X-Suda-Csrf-Token":(n=oe())!=null?n:""}})).json();if(g.code===0||g.status_code==="0")return((o=(e=g.data)==null?void 0:e.app_info)==null?void 0:o.show_badge)!==!1}catch{}return!0}i(se,"fetchShowBadge");async function ce(){var u;let n=B();if(!n)return{code:1,msg:"appId is required",data:{}};let e=N()?`/app/${n}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${n}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(u=oe())!=null?u:""}})).json()}i(ce,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},Re="08a441",He="42b91e";function le(n){let e=String(n);return(0,ue.default)(Re+(0,de.default)(e+He)).toString()}i(le,"encryptTea");var V=!1;async function Fe(){var m,g,b,v;let{data:n}=await ce(),{tenantID:e,userID:o}=n||{},u=o&&o!=="0"?le(o):void 0,p=e&&e!=="0"?le(e):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:u,device_type:U()?"mobile":"pc",evtParams:{open_from:(g=new URLSearchParams(window.location.search).get("open-from"))!=null?g:void 0,env:$(),user_id:u,tenant_id:p}}),V=!0,(v=window.collectEvent)==null||v.call(window,"start")}i(Fe,"createTracker");async function G({trackKey:n,trackParams:e={}}){var o;try{V||(V=!0,await Fe()),(o=window.collectEvent)==null||o.call(window,n,e)}catch(u){console.error(u)}}i(G,"reportTeaEvent");function fe(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:B(),agent_id:"agent_miaoda",url:window.location.href}})}i(fe,"reportPageView");function pe(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let n="";for(let e=0;e<16;e++)n+=Math.floor(Math.random()*16).toString(16);return n}i(pe,"generateUUID");var he="x_sdk_device_id";function Ne(){try{let n=localStorage.getItem(he);return n||(n=pe(),localStorage.setItem(he,n)),n}catch{return pe()}}i(Ne,"getDeviceId");function $e(){let n=typeof navigator!="undefined"?navigator.userAgent:"";return n&&(/Android/i.test(n)&&/Mobile/i.test(n)||/iPhone|iPod/i.test(n)||/BlackBerry|IEMobile|Opera Mini/i.test(n))?"mobile":"desktop"}i($e,"getDeviceType");var Ue="pageSessionID";function We(){try{return new URLSearchParams(window.location.search).get(Ue)||""}catch{return""}}i(We,"getPvId");function je(n={}){let e=n.pvId||We();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Ne(),module:"app_web",app_env:"runtime",source_type:"user",device_type:$e(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(je,"getDefaultAttributes");function ge(n){let e=Math.round(n);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${n}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(ge,"toNanoString");var Ve="1.0.2";function ze(n,e){let o=je(e),u=ge(Date.now());return{metricsData:{resource:{attributes:{sdk_version:Ve,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:n.map(p=>({attributes:{...o,url:p.url,path:p.path,referrer:p.referrer},startTimeUnixNano:ge(p.timestampMs),timeUnixNano:u,asDouble:1}))}}]}}}i(ze,"buildPayload");function Ge(n,e,o={},u){if(e.length===0)return;let p;try{p=JSON.stringify(ze(e,u))}catch{return}try{fetch(n,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:p,keepalive:!0}).catch(()=>{})}catch{}}i(Ge,"sendPvData");var Z="__APAAS_PV_TRACKER_STARTED__";function Ze(){try{let n=window;return n[Z]?!1:(n[Z]=!0,!0)}catch{return!0}}i(Ze,"claimPvReporting");function me(){try{window[Z]=!1}catch{}}i(me,"releasePvReporting");var P,Ke=(P=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(e){var o;if(!this.started&&Ze()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let u=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),u)}catch(u){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,me(),u}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,me())}pageKey(){let{origin:e,pathname:o,search:u}=window.location;return`${e}${o}${u}`}scheduleFirstFlush(){var e;let o=(e=this.config)==null?void 0:e.firstFlushDelayMs;o==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),o))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);Ge(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],u=i(()=>this.recordPv(),"recordPv");history[e]=function(...p){let m=o.apply(this,p);return u(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(P,"_PvTracker"),P),ve=Ke.instance;function be(){var o;let n=(o=B())!=null?o:"",e=N()?`/app/${n}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${n}/runtime/api/v1/observability/metrics/collect`;ve.start({collectorUrl:e})}i(be,"initPvTracking");var J="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",Je=`${J}/miaoda-ui/doubao.svg`,qe=`${J}/miaoda-ui/Doubao_watermark_aigc.svg`,Xe=`${J}/logo/miaodalogo.svg`,ye='<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>',Ye='<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>',Qe='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.13397 2.5C7.51887 1.83333 8.48113 1.83333 8.86603 2.5L14.0622 11.5C14.4471 12.1667 13.966 13 13.1962 13H2.80385C2.03405 13 1.55292 12.1667 1.93782 11.5L7.13397 2.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/><path d="M8 6.16667V8.83333" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="10.6667" r="0.6667" fill="currentColor"/></svg>',et='<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.91685 2.08234C10.2097 2.37519 10.2096 2.8501 9.91685 3.143L7.06253 5.99732L9.91858 8.85337C10.2114 9.14627 10.2115 9.62115 9.91858 9.91403C9.62568 10.2068 9.15076 10.2068 8.85792 9.91403L6.00187 7.05798L3.14444 9.91541C2.85155 10.2083 2.37667 10.2083 2.08378 9.91541C1.791 9.62251 1.79093 9.14761 2.08378 8.85475L4.94121 5.99732L2.08551 3.14162C1.79267 2.84878 1.79278 2.37387 2.08551 2.08096C2.3784 1.78807 2.85327 1.78807 3.14617 2.08096L6.00187 4.93666L8.85619 2.08234C9.14906 1.78961 9.62399 1.7896 9.91685 2.08234Z" fill="white" fill-opacity="0.3"/></svg>',tt='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',nt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',_e=!0,rt="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)",it="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)",q="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",ot="'Doubao Sans', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",W={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C AI \u751F\u6210",logoSrc:Je,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:Xe,landingUrl:"https://miaoda.feishu.cn/landing"}},at={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ce(){var o;let n=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=B())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${at[$()]}/cust/lark_report/?type=common&params=${encodeURIComponent(n)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(Ce,"openReport");var st={feedback:Ye,report:Qe,close:ye,download:tt,efficiency:nt};function xe(n){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${n}px`,height:`${n}px`,flexShrink:"0"}),e.innerHTML=ye;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(n)),o.setAttribute("height",String(n)),o.style.display="block"),e}i(xe,"makeCloseIcon");function ct(n,e=16){if(n==="close")return xe(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=st[n];let u=o.firstElementChild;return u&&(u.style.display="block"),o}i(ct,"makeIcon");function lt(n,e){let o=document.createElement("img");return o.src=n,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(lt,"makeLogo");function ke(n,e,o){let u=e==="desktop",p=n==="doubao",m=W[n],g=document.createElement("div");p?Object.assign(g.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 8px",background:"rgba(77,77,77,0.7)",borderRadius:"6px",cursor:"pointer"}):Object.assign(g.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:u?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:rt,cursor:"pointer"});let b;if(p){let v=document.createElement("img");v.src=qe,v.alt=m.brandText,v.draggable=!1,Object.assign(v.style,{height:u?"12px":"14px",width:"auto",display:"block",flexShrink:"0"}),b=v}else{let v=lt(m.logoSrc,16),L=document.createElement("span");L.textContent=m.brandText,Object.assign(L.style,{fontFamily:q,fontSize:u?"12px":"14px",lineHeight:u?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),b=L,g.append(v)}if(g.append(b),u&&o){let v=document.createElement("span");v.setAttribute("role","button"),v.setAttribute("aria-label","\u5173\u95ED"),v.setAttribute("data-watermark-close",""),Object.assign(v.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0"}),p?v.innerHTML=et:(v.style.color="rgba(255,255,255,0.5)",v.appendChild(xe(10))),v.addEventListener("click",L=>{L.stopPropagation(),o()}),g.appendChild(v)}return g}i(ke,"buildPill");function M(n){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",n.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(ct(n.icon));let u=document.createElement("span");return u.textContent=n.label,Object.assign(u.style,{fontFamily:q,fontSize:`${n.fontSize}px`,lineHeight:`${n.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,u),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",n.onClick),e}i(M,"buildMenuRow");function dt(){let n=document.createElement("div");return Object.assign(n.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),n}i(dt,"buildDivider");function Se(n){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${n.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:it,overflow:"hidden",outline:"none"}),n.items.length){let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=n.itemGap)!=null?o:0}px`}),n.items.forEach(p=>u.appendChild(p)),e.appendChild(u)}if(n.extraItems&&n.extraItems.length){e.appendChild(dt());let u=document.createElement("div");Object.assign(u.style,{boxSizing:"border-box",padding:"4px"}),n.extraItems.forEach(p=>u.appendChild(p)),e.appendChild(u)}return e}i(Se,"buildMenuCard");function Le(n,e=!1){let o=document.createElement("div");o.setAttribute("data-custom-element",`${n}-watermark${e?"-mobile":""}`);let u=o.attachShadow({mode:"open"}),p=n==="doubao"?ot:q,m=document.createElement("style");m.textContent=`
1
+ "use strict";var MiaodaRuntime=(()=>{var Pe=Object.create;var R=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,He=Object.prototype.hasOwnProperty;var i=(t,e)=>R(t,"name",{value:e,configurable:!0});var V=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fe=(t,e)=>{for(var o in e)R(t,o,{get:e[o],enumerable:!0})},J=(t,e,o,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let f of Re(e))!He.call(t,f)&&f!==o&&R(t,f,{get:()=>e[f],enumerable:!(s=Me(e,f))||s.enumerable});return t};var Y=(t,e,o)=>(o=t!=null?Pe(De(t)):{},J(e||!t||!t.__esModule?R(o,"default",{value:t,enumerable:!0}):o,t)),Ne=t=>J(R({},"__esModule",{value:!0}),t);var ie=V((re,D)=>{"use strict";(function(t){"use strict";function e(n,g){var r=(n&65535)+(g&65535),w=(n>>16)+(g>>16)+(r>>16);return w<<16|r&65535}i(e,"safeAdd");function o(n,g){return n<<g|n>>>32-g}i(o,"bitRotateLeft");function s(n,g,r,w,C,k){return e(o(e(e(g,n),e(w,k)),C),r)}i(s,"md5cmn");function f(n,g,r,w,C,k,I){return s(g&r|~g&w,n,g,C,k,I)}i(f,"md5ff");function m(n,g,r,w,C,k,I){return s(g&w|r&~w,n,g,C,k,I)}i(m,"md5gg");function h(n,g,r,w,C,k,I){return s(g^r^w,n,g,C,k,I)}i(h,"md5hh");function v(n,g,r,w,C,k,I){return s(r^(g|~w),n,g,C,k,I)}i(v,"md5ii");function b(n,g){n[g>>5]|=128<<g%32,n[(g+64>>>9<<4)+14]=g;var r,w,C,k,I,a=1732584193,c=-271733879,l=-1732584194,d=271733878;for(r=0;r<n.length;r+=16)w=a,C=c,k=l,I=d,a=f(a,c,l,d,n[r],7,-680876936),d=f(d,a,c,l,n[r+1],12,-389564586),l=f(l,d,a,c,n[r+2],17,606105819),c=f(c,l,d,a,n[r+3],22,-1044525330),a=f(a,c,l,d,n[r+4],7,-176418897),d=f(d,a,c,l,n[r+5],12,1200080426),l=f(l,d,a,c,n[r+6],17,-1473231341),c=f(c,l,d,a,n[r+7],22,-45705983),a=f(a,c,l,d,n[r+8],7,1770035416),d=f(d,a,c,l,n[r+9],12,-1958414417),l=f(l,d,a,c,n[r+10],17,-42063),c=f(c,l,d,a,n[r+11],22,-1990404162),a=f(a,c,l,d,n[r+12],7,1804603682),d=f(d,a,c,l,n[r+13],12,-40341101),l=f(l,d,a,c,n[r+14],17,-1502002290),c=f(c,l,d,a,n[r+15],22,1236535329),a=m(a,c,l,d,n[r+1],5,-165796510),d=m(d,a,c,l,n[r+6],9,-1069501632),l=m(l,d,a,c,n[r+11],14,643717713),c=m(c,l,d,a,n[r],20,-373897302),a=m(a,c,l,d,n[r+5],5,-701558691),d=m(d,a,c,l,n[r+10],9,38016083),l=m(l,d,a,c,n[r+15],14,-660478335),c=m(c,l,d,a,n[r+4],20,-405537848),a=m(a,c,l,d,n[r+9],5,568446438),d=m(d,a,c,l,n[r+14],9,-1019803690),l=m(l,d,a,c,n[r+3],14,-187363961),c=m(c,l,d,a,n[r+8],20,1163531501),a=m(a,c,l,d,n[r+13],5,-1444681467),d=m(d,a,c,l,n[r+2],9,-51403784),l=m(l,d,a,c,n[r+7],14,1735328473),c=m(c,l,d,a,n[r+12],20,-1926607734),a=h(a,c,l,d,n[r+5],4,-378558),d=h(d,a,c,l,n[r+8],11,-2022574463),l=h(l,d,a,c,n[r+11],16,1839030562),c=h(c,l,d,a,n[r+14],23,-35309556),a=h(a,c,l,d,n[r+1],4,-1530992060),d=h(d,a,c,l,n[r+4],11,1272893353),l=h(l,d,a,c,n[r+7],16,-155497632),c=h(c,l,d,a,n[r+10],23,-1094730640),a=h(a,c,l,d,n[r+13],4,681279174),d=h(d,a,c,l,n[r],11,-358537222),l=h(l,d,a,c,n[r+3],16,-722521979),c=h(c,l,d,a,n[r+6],23,76029189),a=h(a,c,l,d,n[r+9],4,-640364487),d=h(d,a,c,l,n[r+12],11,-421815835),l=h(l,d,a,c,n[r+15],16,530742520),c=h(c,l,d,a,n[r+2],23,-995338651),a=v(a,c,l,d,n[r],6,-198630844),d=v(d,a,c,l,n[r+7],10,1126891415),l=v(l,d,a,c,n[r+14],15,-1416354905),c=v(c,l,d,a,n[r+5],21,-57434055),a=v(a,c,l,d,n[r+12],6,1700485571),d=v(d,a,c,l,n[r+3],10,-1894986606),l=v(l,d,a,c,n[r+10],15,-1051523),c=v(c,l,d,a,n[r+1],21,-2054922799),a=v(a,c,l,d,n[r+8],6,1873313359),d=v(d,a,c,l,n[r+15],10,-30611744),l=v(l,d,a,c,n[r+6],15,-1560198380),c=v(c,l,d,a,n[r+13],21,1309151649),a=v(a,c,l,d,n[r+4],6,-145523070),d=v(d,a,c,l,n[r+11],10,-1120210379),l=v(l,d,a,c,n[r+2],15,718787259),c=v(c,l,d,a,n[r+9],21,-343485551),a=e(a,w),c=e(c,C),l=e(l,k),d=e(d,I);return[a,c,l,d]}i(b,"binlMD5");function E(n){var g,r="",w=n.length*32;for(g=0;g<w;g+=8)r+=String.fromCharCode(n[g>>5]>>>g%32&255);return r}i(E,"binl2rstr");function x(n){var g,r=[];for(r[(n.length>>2)-1]=void 0,g=0;g<r.length;g+=1)r[g]=0;var w=n.length*8;for(g=0;g<w;g+=8)r[g>>5]|=(n.charCodeAt(g/8)&255)<<g%32;return r}i(x,"rstr2binl");function T(n){return E(b(x(n),n.length*8))}i(T,"rstrMD5");function L(n,g){var r,w=x(n),C=[],k=[],I;for(C[15]=k[15]=void 0,w.length>16&&(w=b(w,n.length*8)),r=0;r<16;r+=1)C[r]=w[r]^909522486,k[r]=w[r]^1549556828;return I=b(C.concat(x(g)),512+g.length*8),E(b(k.concat(I),640))}i(L,"rstrHMACMD5");function O(n){var g="0123456789abcdef",r="",w,C;for(C=0;C<n.length;C+=1)w=n.charCodeAt(C),r+=g.charAt(w>>>4&15)+g.charAt(w&15);return r}i(O,"rstr2hex");function A(n){return unescape(encodeURIComponent(n))}i(A,"str2rstrUTF8");function u(n){return T(A(n))}i(u,"rawMD5");function p(n){return O(u(n))}i(p,"hexMD5");function _(n,g){return L(A(n),A(g))}i(_,"rawHMACMD5");function y(n,g){return O(_(n,g))}i(y,"hexHMACMD5");function S(n,g,r){return g?r?_(g,n):y(g,n):r?u(n):p(n)}i(S,"md5"),typeof define=="function"&&define.amd?define(function(){return S}):typeof D=="object"&&D.exports?D.exports=S:t.md5=S})(re)});var se=V((H,oe)=>{"use strict";(function(t,e){typeof H=="object"?oe.exports=H=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(H,function(){var t=t||(function(e,o){var s=Object.create||(function(){function u(){}return i(u,"F"),function(p){var _;return u.prototype=p,_=new u,u.prototype=null,_}})(),f={},m=f.lib={},h=m.Base=(function(){return{extend:i(function(u){var p=s(this);return u&&p.mixIn(u),(!p.hasOwnProperty("init")||this.init===p.init)&&(p.init=function(){p.$super.init.apply(this,arguments)}),p.init.prototype=p,p.$super=this,p},"extend"),create:i(function(){var u=this.extend();return u.init.apply(u,arguments),u},"create"),init:i(function(){},"init"),mixIn:i(function(u){for(var p in u)u.hasOwnProperty(p)&&(this[p]=u[p]);u.hasOwnProperty("toString")&&(this.toString=u.toString)},"mixIn"),clone:i(function(){return this.init.prototype.extend(this)},"clone")}})(),v=m.WordArray=h.extend({init:i(function(u,p){u=this.words=u||[],p!=o?this.sigBytes=p:this.sigBytes=u.length*4},"init"),toString:i(function(u){return(u||E).stringify(this)},"toString"),concat:i(function(u){var p=this.words,_=u.words,y=this.sigBytes,S=u.sigBytes;if(this.clamp(),y%4)for(var n=0;n<S;n++){var g=_[n>>>2]>>>24-n%4*8&255;p[y+n>>>2]|=g<<24-(y+n)%4*8}else for(var n=0;n<S;n+=4)p[y+n>>>2]=_[n>>>2];return this.sigBytes+=S,this},"concat"),clamp:i(function(){var u=this.words,p=this.sigBytes;u[p>>>2]&=4294967295<<32-p%4*8,u.length=e.ceil(p/4)},"clamp"),clone:i(function(){var u=h.clone.call(this);return u.words=this.words.slice(0),u},"clone"),random:i(function(u){for(var p=[],_=i(function(r){var r=r,w=987654321,C=4294967295;return function(){w=36969*(w&65535)+(w>>16)&C,r=18e3*(r&65535)+(r>>16)&C;var k=(w<<16)+r&C;return k/=4294967296,k+=.5,k*(e.random()>.5?1:-1)}},"r"),y=0,S;y<u;y+=4){var n=_((S||e.random())*4294967296);S=n()*987654071,p.push(n()*4294967296|0)}return new v.init(p,u)},"random")}),b=f.enc={},E=b.Hex={stringify:i(function(u){for(var p=u.words,_=u.sigBytes,y=[],S=0;S<_;S++){var n=p[S>>>2]>>>24-S%4*8&255;y.push((n>>>4).toString(16)),y.push((n&15).toString(16))}return y.join("")},"stringify"),parse:i(function(u){for(var p=u.length,_=[],y=0;y<p;y+=2)_[y>>>3]|=parseInt(u.substr(y,2),16)<<24-y%8*4;return new v.init(_,p/2)},"parse")},x=b.Latin1={stringify:i(function(u){for(var p=u.words,_=u.sigBytes,y=[],S=0;S<_;S++){var n=p[S>>>2]>>>24-S%4*8&255;y.push(String.fromCharCode(n))}return y.join("")},"stringify"),parse:i(function(u){for(var p=u.length,_=[],y=0;y<p;y++)_[y>>>2]|=(u.charCodeAt(y)&255)<<24-y%4*8;return new v.init(_,p)},"parse")},T=b.Utf8={stringify:i(function(u){try{return decodeURIComponent(escape(x.stringify(u)))}catch{throw new Error("Malformed UTF-8 data")}},"stringify"),parse:i(function(u){return x.parse(unescape(encodeURIComponent(u)))},"parse")},L=m.BufferedBlockAlgorithm=h.extend({reset:i(function(){this._data=new v.init,this._nDataBytes=0},"reset"),_append:i(function(u){typeof u=="string"&&(u=T.parse(u)),this._data.concat(u),this._nDataBytes+=u.sigBytes},"_append"),_process:i(function(u){var p=this._data,_=p.words,y=p.sigBytes,S=this.blockSize,n=S*4,g=y/n;u?g=e.ceil(g):g=e.max((g|0)-this._minBufferSize,0);var r=g*S,w=e.min(r*4,y);if(r){for(var C=0;C<r;C+=S)this._doProcessBlock(_,C);var k=_.splice(0,r);p.sigBytes-=w}return new v.init(k,w)},"_process"),clone:i(function(){var u=h.clone.call(this);return u._data=this._data.clone(),u},"clone"),_minBufferSize:0}),O=m.Hasher=L.extend({cfg:h.extend(),init:i(function(u){this.cfg=this.cfg.extend(u),this.reset()},"init"),reset:i(function(){L.reset.call(this),this._doReset()},"reset"),update:i(function(u){return this._append(u),this._process(),this},"update"),finalize:i(function(u){u&&this._append(u);var p=this._doFinalize();return p},"finalize"),blockSize:512/32,_createHelper:i(function(u){return function(p,_){return new u.init(_).finalize(p)}},"_createHelper"),_createHmacHelper:i(function(u){return function(p,_){return new A.HMAC.init(u,_).finalize(p)}},"_createHmacHelper")}),A=f.algo={};return f})(Math);return t})});var ce=V((F,ae)=>{"use strict";(function(t,e){typeof F=="object"?ae.exports=F=e(se()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(F,function(t){return(function(){var e=t,o=e.lib,s=o.WordArray,f=o.Hasher,m=e.algo,h=[],v=m.SHA1=f.extend({_doReset:i(function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878,3285377520])},"_doReset"),_doProcessBlock:i(function(b,E){for(var x=this._hash.words,T=x[0],L=x[1],O=x[2],A=x[3],u=x[4],p=0;p<80;p++){if(p<16)h[p]=b[E+p]|0;else{var _=h[p-3]^h[p-8]^h[p-14]^h[p-16];h[p]=_<<1|_>>>31}var y=(T<<5|T>>>27)+u+h[p];p<20?y+=(L&O|~L&A)+1518500249:p<40?y+=(L^O^A)+1859775393:p<60?y+=(L&O|L&A|O&A)-1894007588:y+=(L^O^A)-899497514,u=A,A=O,O=L<<30|L>>>2,L=T,T=y}x[0]=x[0]+T|0,x[1]=x[1]+L|0,x[2]=x[2]+O|0,x[3]=x[3]+A|0,x[4]=x[4]+u|0},"_doProcessBlock"),_doFinalize:i(function(){var b=this._data,E=b.words,x=this._nDataBytes*8,T=b.sigBytes*8;return E[T>>>5]|=128<<24-T%32,E[(T+64>>>9<<4)+14]=Math.floor(x/4294967296),E[(T+64>>>9<<4)+15]=x,b.sigBytes=E.length*4,this._process(),this._hash},"_doFinalize"),clone:i(function(){var b=f.clone.call(this);return b._hash=this._hash.clone(),b},"clone")});e.SHA1=f._createHelper(v),e.HmacSHA1=f._createHmacHelper(v)})(),t.SHA1})});var Et={};Fe(Et,{TrackKey:()=>z,name:()=>kt,reportTeaEvent:()=>G,version:()=>St});var je='script[type="text/babel"],script[type="text/jsx"]',Q=["transform-class-properties","transform-object-rest-spread","transform-flow-strip-types"],ee=["transform-class-static-block","transform-class-properties","transform-private-methods","transform-private-property-in-object","transform-classes","transform-block-scoped-functions","transform-block-scoping"];var Ue=/^(chrome|firefox|safari|ios_saf) (\d+)(?:\.(\d+))?$/;function ne(){document.addEventListener("DOMContentLoaded",Ge,{once:!0})}i(ne,"initCreativeBabelTargets");function $e(t){let e=/\b(?:iPhone|iPad|iPod)\b.*? OS (\d+)(?:_(\d+))?/.exec(t);return e?{engine:"ios",version:[+e[1],+(e[2]||0)]}:/\bEdge\/\d/.test(t)?null:(e=/\bFirefox\/(\d+)/.exec(t),e?{engine:"firefox",version:[+e[1],0]}:(e=/Chrom(?:e|ium)\/(\d+)/.exec(t),e?{engine:"chrome",version:[+e[1],0]}:(e=/\bVersion\/(\d+)(?:\.(\d+))?.*\bSafari\//.exec(t),e?{engine:"safari",version:[+e[1],+(e[2]||0)]}:null)))}i($e,"detectBrowserEngine");function Ve(t,e){return t[0]-e[0]||t[1]-e[1]}i(Ve,"compareVersion");function We(){let t=window.__creativeBabelTargets__;if(typeof t!="string"||t.length>200)return null;let e=[];for(let o of t.split(",")){let s=o.trim().toLowerCase().replace(/\s+/g," ");if(!s)continue;let f=Ue.exec(s);if(!f)return null;e.push({query:s,engine:f[1]==="ios_saf"?"ios":f[1],version:[+f[2],+(f[3]||0)]})}return e.length?e:null}i(We,"readTargets");function ze(t){let e=$e(navigator.userAgent||"");if(!e)return!1;let o=t.filter(s=>s.engine===e.engine);return o.length>0&&o.every(s=>Ve(e.version,s.version)>=0)}i(ze,"currentBrowserMeets");function te(t,e,o){let s=t.availablePlugins||{},f=i((h,v)=>h===v||s[h]!==void 0&&s[h]===s[v],"same"),m=e.slice();for(let h of o)m.some(v=>f(v,h))||m.push(h);return m}i(te,"appendPlugins");function Ge(){let t=We();if(!t||!ze(t))return;let e=window.Babel;if(!e||typeof e.transform!="function")return;let o=Array.from(document.querySelectorAll(je)).filter(m=>!m.hasAttribute("data-targets")&&!m.hasAttribute("data-presets")&&m.getAttribute("data-type")!=="module");if(!o.length)return;let s=t.map(m=>m.query);try{e.transform("",{presets:["react","env"],plugins:te(e,Q,ee),targets:{browsers:s}})}catch{return}let f=s.join(",");for(let m of o){let h=m.getAttribute("data-plugins"),v=h===null?Q:h.split(",").map(b=>b.trim()).filter(Boolean);m.setAttribute("data-plugins",te(e,v,ee).join(",")),m.setAttribute("data-targets",f)}}i(Ge,"applyBabelTargets");var he=Y(ie(),1),ge=Y(ce(),1);function B(){return window.appId||null}i(B,"getAppId");function le(){var o;let t="suda-csrf-token",e=document.cookie.split("; ");for(let s of e){let[f,m]=s.split("=");if(f===t)return decodeURIComponent(m)}return(o=window.csrfToken)!=null?o:null}i(le,"getCsrfToken");function N(){let t=globalThis.CLIENT_BASE_PATH||"/";return/^\/app\/[^/]/.test(t)}i(N,"isNewPathEnabled");function j(){switch(globalThis.ENVIRONMENT){case"gray":return"PRE";case"online":return"ONLINE";default:return"BOE"}}i(j,"getEnv");function de(){return window.appEnv!=null?window.appEnv==="runtime":!0}i(de,"isOnlineEnv");function U(){let t=navigator.userAgent,e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(t),o=/iPad|Tab|Tablet/i.test(t)&&navigator.maxTouchPoints>1;return e||o}i(U,"isMobile");async function ue(){var t,e,o;try{let s=B();if(!s)return!0;let f=N()?`/app/${s}/__runtime__/api/v1/studio/get_published`:`/spark/b/${s}/get_published`,h=await(await fetch(f,{headers:{"X-Suda-Csrf-Token":(t=le())!=null?t:""}})).json();if(h.code===0||h.status_code==="0")return((o=(e=h.data)==null?void 0:e.app_info)==null?void 0:o.show_badge)!==!1}catch{}return!0}i(ue,"fetchShowBadge");async function fe(){var s;let t=B();if(!t)return{code:1,msg:"appId is required",data:{}};let e=N()?`/app/${t}/__runtime__/api/v1/studio/lark/user_info`:`/spark/b/${t}/lark/user_info`;return await(await fetch(e,{headers:{"X-Suda-Csrf-Token":(s=le())!=null?s:""}})).json()}i(fe,"getLarkUserInfo");var z={VIEW:"aily_agent_artifact_page_view"},Ze="08a441",Ke="42b91e";function pe(t){let e=String(t);return(0,ge.default)(Ze+(0,he.default)(e+Ke)).toString()}i(pe,"encryptTea");var W=!1;async function qe(){var m,h,v,b;let{data:t}=await fe(),{tenantID:e,userID:o}=t||{},s=o&&o!=="0"?pe(o):void 0,f=e&&e!=="0"?pe(e):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}),(v=window.collectEvent)==null||v.call(window,"config",{user_unique_id:s,device_type:U()?"mobile":"pc",evtParams:{open_from:(h=new URLSearchParams(window.location.search).get("open-from"))!=null?h:void 0,env:j(),user_id:s,tenant_id:f}}),W=!0,(b=window.collectEvent)==null||b.call(window,"start")}i(qe,"createTracker");async function G({trackKey:t,trackParams:e={}}){var o;try{W||(W=!0,await qe()),(o=window.collectEvent)==null||o.call(window,t,e)}catch(s){console.error(s)}}i(G,"reportTeaEvent");function me(){return G({trackKey:z.VIEW,trackParams:{artifact_uid:B(),agent_id:"agent_miaoda",url:window.location.href}})}i(me,"reportPageView");function ve(){if(typeof crypto!="undefined"&&crypto.getRandomValues){let e=new Uint8Array(8);return crypto.getRandomValues(e),Array.from(e).map(o=>o.toString(16).padStart(2,"0")).join("")}let t="";for(let e=0;e<16;e++)t+=Math.floor(Math.random()*16).toString(16);return t}i(ve,"generateUUID");var be="x_sdk_device_id";function Xe(){try{let t=localStorage.getItem(be);return t||(t=ve(),localStorage.setItem(be,t)),t}catch{return ve()}}i(Xe,"getDeviceId");function Je(){let t=typeof navigator!="undefined"?navigator.userAgent:"";return t&&(/Android/i.test(t)&&/Mobile/i.test(t)||/iPhone|iPod/i.test(t)||/BlackBerry|IEMobile|Opera Mini/i.test(t))?"mobile":"desktop"}i(Je,"getDeviceType");var Ye="pageSessionID";function Qe(){try{return new URLSearchParams(window.location.search).get(Ye)||""}catch{return""}}i(Qe,"getPvId");function et(t={}){let e=t.pvId||Qe();return{app_id:window.appId||"",tenant_id:window.tenantId||"",user_id:window.userId||"",did:Xe(),module:"app_web",app_env:"runtime",source_type:"user",device_type:Je(),release_commit_id:window.__RELEASE_COMMIT_ID__||"",...e?{pv_id:e}:{}}}i(et,"getDefaultAttributes");function ye(t){let e=Math.round(t);if(!Number.isFinite(e))throw new RangeError(`toNanoString: \u975E\u6CD5\u65F6\u95F4\u6233 ${t}`);return typeof BigInt!="function"?e===0?"0":`${e}000000`:String(BigInt(e)*BigInt(1e6))}i(ye,"toNanoString");var tt="1.0.2";function nt(t,e){let o=et(e),s=ye(Date.now());return{metricsData:{resource:{attributes:{sdk_version:tt,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:t.map(f=>({attributes:{...o,url:f.url,path:f.path,referrer:f.referrer},startTimeUnixNano:ye(f.timestampMs),timeUnixNano:s,asDouble:1}))}}]}}}i(nt,"buildPayload");function rt(t,e,o={},s){if(e.length===0)return;let f;try{f=JSON.stringify(nt(e,s))}catch{return}try{fetch(t,{method:"POST",headers:{"Content-Type":"application/json","X-Suda-Csrf-Token":window.csrfToken||"",...o},body:f,keepalive:!0}).catch(()=>{})}catch{}}i(rt,"sendPvData");var Z="__APAAS_PV_TRACKER_STARTED__";function it(){try{let t=window;return t[Z]?!1:(t[Z]=!0,!0)}catch{return!0}}i(it,"claimPvReporting");function we(){try{window[Z]=!1}catch{}}i(we,"releasePvReporting");var P,ot=(P=class{constructor(){this.started=!1,this.disposers=[],this.holdsPvReporting=!1,this.buffer=[]}static get instance(){return this._instance||(this._instance=new P),this._instance}start(e){var o;if(!this.started&&it()){this.holdsPvReporting=!0,this.config=e,this.started=!0;try{this.listenRouteChanges(),this.registerLifecycleListeners();let s=(o=e.flushIntervalMs)!=null?o:1e4;this.flushTimer=setInterval(()=>this.flush(),s)}catch(s){throw this.started=!1,this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.holdsPvReporting=!1,we(),s}}}shutdown(){this.flush(),this.flushTimer&&(clearInterval(this.flushTimer),this.flushTimer=void 0),this.firstFlushTimer&&(clearTimeout(this.firstFlushTimer),this.firstFlushTimer=void 0),this.started=!1;for(let e of this.disposers.splice(0))try{e()}catch{}this.holdsPvReporting&&(this.holdsPvReporting=!1,we())}pageKey(){let{origin:e,pathname:o,search:s}=window.location;return`${e}${o}${s}`}scheduleFirstFlush(){var e;let o=(e=this.config)==null?void 0:e.firstFlushDelayMs;o==null||this.firstFlushTimer||(this.firstFlushTimer=setTimeout(()=>this.flush(),o))}recordPv(){let e=this.pageKey();this.lastKey!==e&&(this.lastKey=e,this.buffer.push({url:window.location.href,path:window.location.pathname,referrer:document.referrer,timestampMs:Date.now()}),this.scheduleFirstFlush())}flush(){if(!this.config||this.buffer.length===0)return;let e=this.buffer.splice(0);rt(this.config.collectorUrl,e,this.config.headers,{pvId:this.config.pvId})}listenRouteChanges(){this.recordPv();let e=i(()=>this.recordPv(),"onPopState");window.addEventListener("popstate",e),this.disposers.push(()=>window.removeEventListener("popstate",e)),this.patchHistory("pushState"),this.patchHistory("replaceState")}patchHistory(e){let o=history[e],s=i(()=>this.recordPv(),"recordPv");history[e]=function(...f){let m=o.apply(this,f);return s(),m},this.disposers.push(()=>{history[e]=o})}registerLifecycleListeners(){let e=i(()=>{document.visibilityState==="hidden"&&this.flush()},"onVisibilityChange");document.addEventListener("visibilitychange",e),this.disposers.push(()=>document.removeEventListener("visibilitychange",e));let o=i(()=>this.flush(),"onPageHide");window.addEventListener("pagehide",o),this.disposers.push(()=>window.removeEventListener("pagehide",o))}},i(P,"_PvTracker"),P),_e=ot.instance;function Ce(){var o;let t=(o=B())!=null?o:"",e=N()?`/app/${t}/__runtime__/api/v1/observability/metrics/collect`:`/spark/app/${t}/runtime/api/v1/observability/metrics/collect`;_e.start({collectorUrl:e})}i(Ce,"initPvTracking");var q="https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp",st=`${q}/miaoda-ui/doubao.svg`,at=`${q}/miaoda-ui/Doubao_watermark_aigc.svg`,ct=`${q}/logo/miaodalogo.svg`,Se='<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>',lt='<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>',dt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.13397 2.5C7.51887 1.83333 8.48113 1.83333 8.86603 2.5L14.0622 11.5C14.4471 12.1667 13.966 13 13.1962 13H2.80385C2.03405 13 1.55292 12.1667 1.93782 11.5L7.13397 2.5Z" stroke="currentColor" stroke-width="1.2" fill="none"/><path d="M8 6.16667V8.83333" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/><circle cx="8" cy="10.6667" r="0.6667" fill="currentColor"/></svg>',ut='<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9.91685 2.08234C10.2097 2.37519 10.2096 2.8501 9.91685 3.143L7.06253 5.99732L9.91858 8.85337C10.2114 9.14627 10.2115 9.62115 9.91858 9.91403C9.62568 10.2068 9.15076 10.2068 8.85792 9.91403L6.00187 7.05798L3.14444 9.91541C2.85155 10.2083 2.37667 10.2083 2.08378 9.91541C1.791 9.62251 1.79093 9.14761 2.08378 8.85475L4.94121 5.99732L2.08551 3.14162C1.79267 2.84878 1.79278 2.37387 2.08551 2.08096C2.3784 1.78807 2.85327 1.78807 3.14617 2.08096L6.00187 4.93666L8.85619 2.08234C9.14906 1.78961 9.62399 1.7896 9.91685 2.08234Z" fill="white" fill-opacity="0.3"/></svg>',ft='<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M11.9922 1.99221C12.5445 1.98895 12.9958 2.43407 12.999 2.98634L13.0762 16.1943L14.6387 14.6328L17.8926 11.3789C18.2831 10.9884 18.9171 10.9885 19.3076 11.3789C19.6977 11.7695 19.6979 12.4026 19.3076 12.793L16.0527 16.0479L12.7979 19.3018C12.7111 19.3884 12.6098 19.4566 12.5 19.5059H20.375C20.9271 19.5059 21.3748 19.9538 21.375 20.5059C21.375 21.0581 20.9273 21.5059 20.375 21.5059H3.625C3.07272 21.5059 2.625 21.0581 2.625 20.5059C2.62523 19.9538 3.07286 19.5059 3.625 19.5059H11.6816C11.572 19.4566 11.4704 19.3884 11.3838 19.3018L4.87402 12.793C4.48372 12.4026 4.4839 11.7694 4.87402 11.3789C5.26452 10.9884 5.89756 10.9885 6.28809 11.3789L11.0762 16.166L10.999 2.99806C10.9958 2.44603 11.4402 1.99582 11.9922 1.99221Z" fill="currentColor"/></svg>',pt='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2.0754 7.57153C2.23188 9.44922 3.49231 11.053 5.27982 11.6488C5.31351 11.6601 5.33994 11.6865 5.35117 11.7202L5.72076 12.8289C5.88752 13.3292 6.3557 13.6667 6.88304 13.6667H9.11696C9.6443 13.6667 10.1125 13.3292 10.2792 12.8289L10.6488 11.7202C10.6601 11.6865 10.6865 11.6601 10.7202 11.6488C12.5077 11.053 13.7681 9.44922 13.9246 7.57153L14 6.66667C14 3.35296 11.3137 0.666668 8 0.666668C4.68629 0.666668 2 3.35296 2 6.66667L2.0754 7.57153ZM9.38392 11.2985L9.03899 12.3333H6.96101L6.61608 11.2985C6.47214 10.8667 6.13328 10.5279 5.70146 10.3839C4.41995 9.95675 3.51631 8.80696 3.40413 7.4608L3.33362 6.61462C3.36152 4.06127 5.44004 2 8 2C10.56 2 12.6385 4.06127 12.6664 6.61462L12.5959 7.4608C12.4837 8.80696 11.5801 9.95675 10.2985 10.3839C9.86672 10.5279 9.52786 10.8667 9.38392 11.2985Z" fill="currentColor"/><path d="M6.66667 14.3333C6.29848 14.3333 6 14.6318 6 15C6 15.3682 6.29848 15.6667 6.66667 15.6667H9.33333C9.70152 15.6667 10 15.3682 10 15C10 14.6318 9.70152 14.3333 9.33333 14.3333H6.66667Z" fill="currentColor"/><path d="M8.00864 4.13208L5.44578 6.94049C5.20258 7.18228 5.37835 7.56531 5.74361 7.58951L7.2181 7.6872L7.21814 9.60852C7.21814 9.96788 7.72139 10.1366 7.99168 9.86792C8.26197 9.59921 10.5545 7.05951 10.5545 7.05951C10.7977 6.81772 10.622 6.43469 10.2567 6.41049L8.78222 6.3128L8.78219 4.39148C8.78218 4.03212 8.27893 3.86336 8.00864 4.13208Z" fill="currentColor"/></svg>',ke=!0,ht="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)",gt="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)",X="'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",mt="'Doubao Sans', 'PingFang SC', -apple-system, BlinkMacSystemFont, sans-serif",$={doubao:{brandText:"\u8C46\u5305\u5DE5\u4F5C AI \u751F\u6210",logoSrc:st,downloadUrl:"https://ugapk.com/FCtLH"},miaoda:{brandText:"\u5999\u642D\u751F\u6210",logoSrc:ct,landingUrl:"https://miaoda.feishu.cn/landing"}},vt={BOE:"tns.feishu-boe.cn",PRE:"tns.feishu-pre.cn",ONLINE:"tns.feishu.cn"};function Ee(){var o;let t=JSON.stringify({scene:"miaoda_app_report",entity_id:(o=B())!=null?o:"",entity_type:"miaoda_app",extra:""}),e=`https://${vt[j()]}/cust/lark_report/?type=common&params=${encodeURIComponent(t)}&lang=zh-CN`;window.open(e,"_blank","noopener,noreferrer")}i(Ee,"openReport");var bt={feedback:lt,report:dt,close:Se,download:ft,efficiency:pt};function Le(t){let e=document.createElement("span");Object.assign(e.style,{display:"inline-flex",width:`${t}px`,height:`${t}px`,flexShrink:"0"}),e.innerHTML=Se;let o=e.firstElementChild;return o&&(o.setAttribute("width",String(t)),o.setAttribute("height",String(t)),o.style.display="block"),e}i(Le,"makeCloseIcon");function yt(t,e=16){if(t==="close")return Le(e);let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:`${e}px`,height:`${e}px`,flexShrink:"0"}),o.innerHTML=bt[t];let s=o.firstElementChild;return s&&(s.style.display="block"),o}i(yt,"makeIcon");function wt(t,e){let o=document.createElement("img");return o.src=t,o.width=e,o.height=e,o.alt="",Object.assign(o.style,{width:`${e}px`,height:`${e}px`,maxWidth:"none",maxHeight:"none",borderRadius:"100px",flexShrink:"0",display:"block"}),o}i(wt,"makeLogo");function Te(t,e,o){let s=e==="desktop",f=t==="doubao",m=$[t],h=document.createElement("div");f?Object.assign(h.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 8px",background:"rgba(77,77,77,0.7)",borderRadius:"6px",cursor:"pointer"}):Object.assign(h.style,{boxSizing:"border-box",display:"inline-flex",alignItems:"center",gap:"4px",padding:s?"6px 12px 6px 8px":"5px 12px 5px 8px",background:"#363636",border:"0.5px solid rgba(255,255,255,0.1)",borderRadius:"100px",boxShadow:ht,cursor:"pointer"});let v;if(f){let b=document.createElement("img");b.src=at,b.alt=m.brandText,b.draggable=!1,Object.assign(b.style,{height:s?"12px":"14px",width:"auto",display:"block",flexShrink:"0"}),v=b}else{let b=wt(m.logoSrc,16),E=document.createElement("span");E.textContent=m.brandText,Object.assign(E.style,{fontFamily:X,fontSize:s?"12px":"14px",lineHeight:s?"18px":"22px",color:"rgba(255,255,255,0.85)",whiteSpace:"nowrap"}),v=E,h.append(b)}if(h.append(v),s&&o){let b=document.createElement("span");b.setAttribute("role","button"),b.setAttribute("aria-label","\u5173\u95ED"),b.setAttribute("data-watermark-close",""),Object.assign(b.style,{display:"none",alignItems:"center",cursor:"pointer",flexShrink:"0"}),f?b.innerHTML=ut:(b.style.color="rgba(255,255,255,0.5)",b.appendChild(Le(10))),b.addEventListener("click",E=>{E.stopPropagation(),o()}),h.appendChild(b)}return h}i(Te,"buildPill");function M(t){let e=document.createElement("div");e.setAttribute("role","menuitem"),e.setAttribute("data-label",t.label),Object.assign(e.style,{boxSizing:"border-box",display:"flex",alignItems:"center",gap:"8px",minHeight:"38px",padding:"4px 10px",borderRadius:"6px",cursor:"pointer",color:"#000000"});let o=document.createElement("span");Object.assign(o.style,{display:"inline-flex",width:"16px",height:"16px",flexShrink:"0",color:"#000000"}),o.appendChild(yt(t.icon));let s=document.createElement("span");return s.textContent=t.label,Object.assign(s.style,{fontFamily:X,fontSize:`${t.fontSize}px`,lineHeight:`${t.fontSize+8}px`,color:"#000000",whiteSpace:"nowrap"}),e.append(o,s),e.addEventListener("mouseenter",()=>{e.style.background="rgba(0,0,0,0.04)"}),e.addEventListener("mouseleave",()=>{e.style.background="transparent"}),e.addEventListener("click",t.onClick),e}i(M,"buildMenuRow");function _t(){let t=document.createElement("div");return Object.assign(t.style,{height:"1px",background:"rgba(0,0,0,0.08)",margin:"0 10px"}),t}i(_t,"buildDivider");function Ae(t){var o;let e=document.createElement("div");if(Object.assign(e.style,{boxSizing:"border-box",display:"flex",flexDirection:"column",minWidth:`${t.minWidth}px`,background:"#ffffff",border:"0.5px solid rgba(0,0,0,0.1)",borderRadius:"10px",boxShadow:gt,overflow:"hidden",outline:"none"}),t.items.length){let s=document.createElement("div");Object.assign(s.style,{boxSizing:"border-box",padding:"4px",display:"flex",flexDirection:"column",gap:`${(o=t.itemGap)!=null?o:0}px`}),t.items.forEach(f=>s.appendChild(f)),e.appendChild(s)}if(t.extraItems&&t.extraItems.length){e.appendChild(_t());let s=document.createElement("div");Object.assign(s.style,{boxSizing:"border-box",padding:"4px"}),t.extraItems.forEach(f=>s.appendChild(f)),e.appendChild(s)}return e}i(Ae,"buildMenuCard");function Ie(t,e=!1){let o=document.createElement("div");o.setAttribute("data-custom-element",`${t}-watermark${e?"-mobile":""}`);let s=o.attachShadow({mode:"open"}),f=t==="doubao"?mt:X,m=document.createElement("style");m.textContent=`
2
2
  :host {
3
3
  all: initial !important;
4
4
  display: block !important;
@@ -14,10 +14,10 @@
14
14
  all: initial;
15
15
  direction: ltr;
16
16
  unicode-bidi: isolate;
17
- font-family: ${p};
17
+ font-family: ${f};
18
18
  display: flex;
19
19
  flex-direction: column;
20
20
  align-items: flex-end;
21
21
  gap: 8px;
22
22
  }
23
- `;let g=document.createElement("div");return g.className="watermark-root",u.append(m,g),{host:o,container:g}}i(Le,"createWatermarkRoot");function ut(n){let{host:e,container:o}=Le(n),u=[];n==="doubao"?u.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open(W.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:n==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ce}));let p=Se({items:u,minWidth:160,itemGap:8});p.style.display="none";let m=ke(n,"desktop",()=>e.remove()),g=m.querySelector("[data-watermark-close]");o.append(p,m);let b=null;return o.addEventListener("mouseenter",()=>{b&&clearTimeout(b),p.style.display="flex",g&&(g.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{b=setTimeout(()=>{p.style.display="none",g&&(g.style.display="none")},100)}),e}i(ut,"buildDesktopWatermark");function ft(n){let{host:e,container:o}=Le(n,!0);o.style.cursor="pointer";let u=[];n==="miaoda"&&u.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open(W.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),_e&&u.push(M({icon:n==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ce}));let p=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(v=>{v.stopPropagation(),document.removeEventListener("click",b),e.remove()},"onClick")})],m=Se({items:u,extraItems:p,minWidth:160});m.style.display="none";let g=ke(n,"mobile");o.append(m,g),o.addEventListener("click",v=>{v.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let b=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",b),e}i(ft,"buildMobileWatermark");var we=!1,K=!1;async function Ee(n){if(we||K||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Ee(n),{once:!0});return}K=!0;let e=await se();if(we=!0,K=!1,!e)return;let o=U()?ft(n):ut(n);document.body.appendChild(o)}i(Ee,"mountWatermark");function Ie(){return Ee("miaoda")}i(Ie,"mountMiaodaWatermark");var pt="0.0.19-beta.0",ht="@lark-apaas/miaoda-coding-sdk";ae()&&(fe(),be());Ie();return De(gt);})();
23
+ `;let h=document.createElement("div");return h.className="watermark-root",s.append(m,h),{host:o,container:h}}i(Ie,"createWatermarkRoot");function Ct(t){let{host:e,container:o}=Ie(t),s=[];t==="doubao"?s.push(M({icon:"download",label:"\u4E0B\u8F7D\u8C46\u5305\u5DE5\u4F5C",fontSize:14,onClick:i(()=>window.open($.doubao.downloadUrl,"_blank","noopener,noreferrer"),"onClick")})):s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:14,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:14,onClick:Ee}));let f=Ae({items:s,minWidth:160,itemGap:8});f.style.display="none";let m=Te(t,"desktop",()=>e.remove()),h=m.querySelector("[data-watermark-close]");o.append(f,m);let v=null;return o.addEventListener("mouseenter",()=>{v&&clearTimeout(v),f.style.display="flex",h&&(h.style.display="inline-flex")}),o.addEventListener("mouseleave",()=>{v=setTimeout(()=>{f.style.display="none",h&&(h.style.display="none")},100)}),e}i(Ct,"buildDesktopWatermark");function xt(t){let{host:e,container:o}=Ie(t,!0);o.style.cursor="pointer";let s=[];t==="miaoda"&&s.push(M({icon:"efficiency",label:"\u4E86\u89E3\u5999\u642D",fontSize:16,onClick:i(()=>window.open($.miaoda.landingUrl,"_blank","noopener,noreferrer"),"onClick")})),ke&&s.push(M({icon:t==="doubao"?"report":"feedback",label:"\u6295\u8BC9\u4E0E\u4E3E\u62A5",fontSize:16,onClick:Ee}));let f=[M({icon:"close",label:"\u4E0D\u518D\u5C55\u793A",fontSize:16,onClick:i(b=>{b.stopPropagation(),document.removeEventListener("click",v),e.remove()},"onClick")})],m=Ae({items:s,extraItems:f,minWidth:160});m.style.display="none";let h=Te(t,"mobile");o.append(m,h),o.addEventListener("click",b=>{b.stopPropagation(),m.style.display=m.style.display==="none"?"flex":"none"});let v=i(()=>{m.style.display="none"},"onOutsideClick");return document.addEventListener("click",v),e}i(xt,"buildMobileWatermark");var xe=!1,K=!1;async function Oe(t){if(xe||K||typeof document=="undefined")return;if(document.readyState==="loading"){document.addEventListener("DOMContentLoaded",()=>Oe(t),{once:!0});return}K=!0;let e=await ue();if(xe=!0,K=!1,!e)return;let o=U()?xt(t):Ct(t);document.body.appendChild(o)}i(Oe,"mountWatermark");function Be(){return Oe("miaoda")}i(Be,"mountMiaodaWatermark");var St="0.0.20-beta.0",kt="@lark-apaas/miaoda-coding-sdk";de()&&(me(),Ce());Be();ne();return Ne(Et);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/miaoda-coding-sdk",
3
- "version": "0.0.19-beta.0",
3
+ "version": "0.0.20-beta.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",
@@ -25,6 +25,7 @@
25
25
  "crypto-js": "^3.1.9-1"
26
26
  },
27
27
  "devDependencies": {
28
+ "@babel/standalone": "7.29.0",
28
29
  "@types/blueimp-md5": "^2.18.2",
29
30
  "@types/crypto-js": "^4.2.2",
30
31
  "tsup": "^8.0.0",