@melt-js/libs-core 2026.11.14 → 2026.11.15-2

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
@@ -13,15 +13,16 @@ import { preloadHelLibs, loadHelLib } from '@melt-js/libs-core'
13
13
  // 先绑定宿主的 Vue / React 共享运行时。
14
14
  await preloadHelLibs({
15
15
  type: 'custom',
16
- base: 'http://82.156.212.243',
16
+ base: 'http://xx.xx.xx.xx',
17
17
  deps: [
18
18
  '@melt-js/comps-vue3',
19
19
  'https://xxx.com/xxx-melt-js/comps-vue3-antd@1.1.1',
20
20
  'libs-xxx@1.1.1',
21
21
  '/@melt-js/comps-vue3',
22
22
  ],
23
+ loading: true, // 公共 API 默认关闭;没有启动 loading 的宿主显式开启。
24
+ loadApp: () => import('./loadApp'), // 预加载结束后再求值业务代理,完成后清理遮罩。
23
25
  })
24
- await import('./loadApp') // 此后业务代码可以普通 import 已安装的组件代理包。
25
26
 
26
27
  // 低频包放在页面或交互中调用,调用前不会下载。
27
28
  const charts = await loadHelLib('@example/comps-charts@1.1.1', { type: 'github' })
@@ -29,6 +30,22 @@ const charts = await loadHelLib('@example/comps-charts@1.1.1', { type: 'github'
29
30
 
30
31
  以上地址与包名用于说明协议,不保证示例服务器已发布对应资源。
31
32
 
33
+ `preloadHelLibs` 的启动 loading **默认关闭**,省略 `loading` 或设置 `false` 不创建遮罩;`true` 使用默认四方块动效与“正在加载应用…”文字,配置对象可自定义:
34
+
35
+ ```js
36
+ await preloadHelLibs({
37
+ deps,
38
+ loading: { text: '正在准备数据大屏…', background: '#050f33', color: '#38bdf8' },
39
+ loadApp: () => import('./loadApp'),
40
+ })
41
+ ```
42
+
43
+ `loadApp` 为可选回调,远程依赖全部就绪后执行;返回 Promise 时等待其完成。开启的遮罩会覆盖预加载及回调,成功或异常都自动清理,错误仍交给调用方 `catch` 显示。异步挂载或首屏路由准备需要由回调返回/等待相应 Promise,仅发起任务但不等待不会延长遮罩。返回值仍为已加载模块表;不传回调时保持原有预加载用法。
44
+
45
+ 已有自身 loading 的宿主优先沿用原实现,避免重复遮罩;Mini3d 模板使用自己的场景 loading,入口不启用公共 loading。缺少 loading 的示例才显式开启,不因已有 loading 在挂载后出现就自动补一层遮罩。此方法从预加载调用时显示,不覆盖浏览器获取 HTML 和入口脚本的时间。
46
+
47
+ `showHelLoading({ text, background, color })` 可手动显示同一遮罩,返回幂等的清理函数,调用方在 `finally` 中清理。它使用框架无关 DOM/CSS,无额外远程依赖;服务端环境为空操作,尊重减少动画设置,不修改全局主题。Vue 2 / Vue 3 / React 适配包及 `./browser` 入口均转出这些 API。
48
+
32
49
  | type | 默认 base | 短包名路径 |
33
50
  | --- | --- | --- |
34
51
  | `unpkg`(默认) | `https://unpkg.com` | `/包引用[@版本]/hel_dist/hel-meta.json`;不补 scope |
@@ -37,7 +54,7 @@ const charts = await loadHelLib('@example/comps-charts@1.1.1', { type: 'github'
37
54
 
38
55
  公共库没有默认组织或 scope。`@melt-js/libs-xxx@1.1.1` 和 `libs-xxx@1.1.1` 在 unpkg 是两个不同的 npm 包,分别保留原路径;其他 scope 也一样。GitHub 从显式 scope 推导 owner;npm scope 与 GitHub owner 不同或使用自定义域名时,传 `base` 覆盖。
39
56
 
40
- SFTP 的 base 只配置站点根 `http://82.156.212.243`。`@melt-js/comps-vue3`、`@other/comps-vue3`、`comps-vue3` 分别解析到 `/@melt-js/comps-vue3`、`/@other/comps-vue3`、`/comps-vue3`,不会自动补 scope。为兼容带命名空间的旧 base,完整 scoped 引用会替换 base 末尾的 `/@scope`,避免重复。
57
+ SFTP 的 base 只配置站点根 `http://xx.xx.xx.xx`。`@melt-js/comps-vue3`、`@other/comps-vue3`、`comps-vue3` 分别解析到 `/@melt-js/comps-vue3`、`/@other/comps-vue3`、`/comps-vue3`,不会自动补 scope。为兼容带命名空间的旧 base,完整 scoped 引用会替换 base 末尾的 `/@scope`,避免重复。
41
58
 
42
59
  - `type` 选择默认 base 和拼接逻辑,`base` 可以覆盖预设;完整 HTTP(S) URL 保持自己的域名与目录。
43
60
  - `/comps-vue3` 与 `comps-vue3` 都相对 base 目录;不会丢失 `/@melt-js` 等前缀。
@@ -167,6 +184,11 @@ Vite / Vue CLI / CRA / Umi 配置先导入本包 bootstrap,原 `dev` / `build`
167
184
  `REMOTE_TARGET` 支持 `auto/local/sftp/github/unpkg`;每个 `*_PACKAGE` 可单独使用 `*_TARGET` / `*_URL` 覆盖。
168
185
  `*_VERSION=installed` 通过已安装依赖的公开入口解析其包版本;显式版本与 `latest` 也受支持。
169
186
  未配置工作区时可独立 localhost 开发、unpkg 构建;私有 SFTP/GitHub 地址由消费包 `.env.local` 或进程变量提供。
187
+ `HEL_RELATIVE_PATH=1` 让生产构建的 `HEL_APP_HOME_PAGE` 默认为 `/`;已有 HTTP(S) homePage 则只保留 pathname。
188
+ 因此 HTML、JS/CSS 与 `hel-meta.json` 从同一 homePage 生成站点根路径,静态产物可更换域名;部署目录段保持不变。
189
+ 该开关不改变开发或 `HEL_LOCAL_BUILD=1` 联调构建;`0` 或未设置时保持原行为。
190
+ HEL 配置与元数据脚本通过 `@melt-js/libs-core/scripts/hel-build-paths.cjs` 适配自身直接声明的 `hel-dev-utils`,
191
+ 使显式 `/` 不再回退到 localhost,并统一 Windows 路径分隔符、保留根目录 `webDirPath=/`。
170
192
  只有公共地址会生成 `VITE_` / `VUE_APP_` 等前端变量,不复制 SFTP 凭据。
171
193
 
172
194
  发布顺序:先发布包含该入口的新版 `libs-core`,再发布/交付使用它的包。
@@ -185,3 +207,27 @@ const inlineProps = parseCode('export default { props: { title: String } }')
185
207
  提供同步/异步文件解析、源码解析与 TypeScript 类型提取,供 Vue 2 / Vue 3 leva 的 schema CLI 共用。此子路径是 Node 专用工具,不改变默认浏览器入口;Babel、SFC 编译器和 JSDoc 解析依赖由本包携带。
186
208
 
187
209
  CLI 发布后也会调用本包,因此 leva 包将 `@melt-js/libs-core` 声明在 `dependencies`,而非仅放在 `devDependencies`。发布时先发布包含此子路径的新版 `libs-core`,再发布依赖它的 leva 包,不能让新 CLI 引用尚无此入口的旧版 core。源码出处与适配记录见 `scripts/vdoc-parser/NOTICE.md`。
210
+ ## HTML 浏览器入口
211
+
212
+ `pnpm run build` 生成 `dist/browser.mjs` 及其余运行模块、声明,`pnpm pack` 前自动构建。browser 文件打包 core 和 hel-micro 的浏览器依赖,可通过 unpkg 直接用于原生 ESM HTML,导出 core 加载 API 及 `bindReactRuntime`。框架适配层使用各自的 `dist/index.mjs`,通过 importmap 将 `@melt-js/libs-core` 指向此入口,并将 Vue/React 映射到宿主同一运行时。
213
+
214
+ ## 发布入口与产物生成
215
+
216
+ 本地 workspace 的入口保留在 `src`,pnpm 打包通过 `publishConfig` 将运行和类型入口改为 `dist`,npm 清单只包含 `dist`、`scripts` 和 README。`scripts` 是已安装 CLI 与公开构建工具的真实依赖;不会为类型或 workspace 联调自动分发 `src`。
217
+
218
+ `hel-package-artifacts` 读取调用包的 `releaseArtifacts`:`remote` 生成代理目录内的声明、schema 和配置的命名空间代理;`adapter` 编译框架适配模块;`library` 编译普通多入口模块;`declarations` 清理既有声明中的样式副作用导入。工具只读取本包源码与直接声明的依赖,不搜索 workspace 或构建兄弟包。重复生成时旧声明、资源保留在调用包 `.tmp/release-artifact-history`。
219
+
220
+ 使用新命令的包必须直接声明包含该命令的新版本 core。发布顺序为 core 在先、消费包在后;源码目录的构建能力与 npm 产物的安装能力分别验证。
221
+
222
+
223
+ ## Demo 公共能力
224
+
225
+ `@melt-js/libs-core/demo` 提供 `buildDownloadFile`、`createDownloadController`、`buildComponentDocs`、`componentEvents`、`resolveModels` 和 `createDemoFullscreen`。它不引入 Vue、React、Leva 或 Tweakpane,也不附带 UI 样式。三个框架的 leva 包负责 Panel、Playground、文档区与按钮展示。
226
+
227
+ 下载 HTML 只引用 unpkg 的框架、core 浏览器产物、框架适配层和组件包,使用 `defineHelComponent` 懒加载组件。`libName` 支持版本号。单文件需联网,新增入口与组件导出需实际发布后才能从 unpkg 获取。
228
+
229
+ `@melt-js/libs-core/scripts/component-events.mjs` 是 Node 专用事件解析入口,供 Vue schema CLI 复用;浏览器入口不会导入 Babel 或文件系统模块。
230
+
231
+ `createDemoTabsController` 统一三个 Leva 包的单行横向滚动、滚轮边界处理、当前标签定位和尺寸监听。组件负责展开换行与按钮展示,卸载时调用 `dispose()` 清理监听和动画帧。仓库根目录运行 `node scripts/verify-leva-tabs.mjs` 验证三种框架的浏览器交互;加 `--serve` 可启动本地演示。
232
+
233
+ `setupDemoRemoteDebug({ deps })` 在 demo 启动预加载前选择地址:依赖声明 `{ name, host, localHost }`,`#/local` 使用 `localHost`,其他路由使用 `host`。将返回的 `deps` 传给 `preloadHelLibs`。进入 / 离开本地调试时自动刷新文档,使 HEL 应用组使用新地址;无需修改环境或重启 demo。本地提供方服务仍需先启动。`renderError(root, error)` 展示实际地址、重试及返回入口;HMR / 卸载时调用 `dispose()` 清理监听。
@@ -0,0 +1,2 @@
1
+ export * from './remote.mjs'
2
+ export { bindReactRuntime } from 'hel-micro'
@@ -0,0 +1,60 @@
1
+ var xa=Object.create;var mr=Object.defineProperty;var Ma=Object.getOwnPropertyDescriptor;var Da=Object.getOwnPropertyNames;var Va=Object.getPrototypeOf,wa=Object.prototype.hasOwnProperty;var je=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ra=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Da(t))!wa.call(e,a)&&a!==r&&mr(e,a,{get:()=>t[a],enumerable:!(n=Ma(t,a))||n.enumerable});return e};var He=(e,t,r)=>(r=e!=null?xa(Va(e)):{},Ra(t||!e||!e.__esModule?mr(r,"default",{value:e,enumerable:!0}):r,e));var Xe=je(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function ft(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Na(e){if(Array.isArray(e))return e}function Fa(e){if(Array.isArray(e))return ft(e)}function Oa(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=yt(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(u){throw u},f:a}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,o=!1;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return s=u.done,u},e:function(u){o=!0,i=u},f:function(){try{s||r.return==null||r.return()}finally{if(o)throw i}}}}function dt(e,t,r){return(t=Ga(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ka(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ja(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,a,i,s,o=[],u=!0,c=!1;try{if(i=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(o.push(n.value),o.length!==t);u=!0);}catch(p){c=!0,a=p}finally{try{if(!u&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw a}}return o}}function Ha(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ua(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Me(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gr(Object(r),!0).forEach(function(n){dt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Be(e,t){return Na(e)||ja(e,t)||yt(e,t)||Ha()}function st(e){return Fa(e)||ka(e)||yt(e)||Ua()}function Ba(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ga(e){var t=Ba(e,"string");return typeof t=="symbol"?t:t+""}function ye(e){"@babel/helpers - typeof";return ye=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ye(e)}function yt(e,t){if(e){if(typeof e=="string")return ft(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ft(e,t):void 0}}var ie=null;function Ka(){if(typeof window<"u"){ie=window;return}if(typeof global<"u"){ie=global;return}throw new Error("unable to locate global object")}function z(){return ie||Ka(),ie}function $a(e){var t,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,n=null;(t=ie)!==null&&t!==void 0&&t.__HEL_MICRO_SHARED__&&(n=ie.__HEL_MICRO_SHARED__),r?ie=Me(Me({},ie),e):ie=e,n&&(ie.__HEL_MICRO_SHARED__=n)}function Ge(){return z()}function xr(){var e=z();return e.MutationObserver||e.WebKitMutationObserver||e.MozMutationObserver}function br(e,t){for(var r=null,n=e.length,a=0;a<n;a++){var i=e[a];if(i.tagName===t){r=i;break}}return r}function Mr(e){return Object.keys(e)}function Ya(){var e=function(a){var i=a||{},s=i.search||"";if(!s){var o=i.hash||"",u=o.split("?")[1]||"";u&&(s="?".concat(u))}return s};try{var t;return e((t=z())===null||t===void 0||(t=t.top)===null||t===void 0?void 0:t.location)}catch{var r;return e((r=z())===null||r===void 0?void 0:r.location)}}function Ar(e){var t,r=(t=z())===null||t===void 0?void 0:t.localStorage;return r?.getItem(e)}function yr(e,t){var r,n=(r=z())===null||r===void 0?void 0:r.localStorage;return n?.setItem(e,t)}function Wa(){var e=Ya(),t={};if(e!=null&&e.startsWith("?")){var r=e.substring(1),n=r.split("&");n.forEach(function(a){var i=a.split("="),s=Be(i,2),o=s[0],u=s[1];t[o]=u})}return t}function Dr(){var e="";try{throw new Error("getJsRunLocation")}catch(n){var t=n.stack.split(`
5
+ `),r=t.length;e=t[r-1]||t[r-2]||""}return e}function re(e,t,r,n){var a=H(e,t);a[r]=n}function H(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=e[t];return n||(n=r,e[t]=n),n}function Vr(e,t){Object.keys(t).forEach(function(r){var n=t[r];[null,void 0,""].includes(n)||(e[r]=n)})}function vt(e,t){e.includes(t)||e.push(t)}function wr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.nullValues,n=r===void 0?[null,void 0,""]:r,a=t.emptyObjIsNull,i=a===void 0?!0:a,s=t.emptyArrIsNull,o=s===void 0?!0:s,u=n.includes(e);if(u)return!0;if(Array.isArray(e))return o?e.length===0:!1;if(ye(e)==="object"){var c=Mr(e),p=c.length;return i?p===0:!1}return!1}function Rr(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t}function qa(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xa(){var e=z();return e.process&&e.global&&!e.document}function Ja(e,t,r){if(e&&typeof e!="string")return e;try{var n=JSON.parse(e);return n||t}catch(a){if(t!==void 0)return t;throw r?new Error(r):a}}var Nr=wr,ht=vt,Fr=Mr;function za(e,t){var r=[];return e.forEach(function(n){return ht(r,n)}),t.forEach(function(n){return ht(r,n)}),r}function Or(e,t){var r=t||function(a){return!Nr(a)},n={};return Fr(e).forEach(function(a){r(e[a])&&(n[a]=e[a])}),n}function Qa(e,t,r){var n=r,a=Oa(e),i;try{for(a.s();!(i=a.n()).done;){var s=i.value,o=s[t];if(![null,void 0,""].includes(o)){n=o;break}}}catch(u){a.e(u)}finally{a.f()}return n}function kr(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"MULTI",r=e.split(`
6
+ `),n=r.length-1,a=r.map(function(i,s){var o;if(!i&&(s===0||s===n))return"";var u=function(f,d){var v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",h=f;return f.endsWith("<br/>")?(h=f.substring(0,h.length-5),"".concat(h).concat(d)):"".concat(h).concat(v)},c=((o=i.trimStart)===null||o===void 0?void 0:o.call(i))||i;return t==="MULTI"?"".concat(u(c,""),`
7
+ `):(c=u(c,`
8
+ `," "),c)}).join("");return a}function jr(e){return kr(e,"ONE")}function Za(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=z(),n=jr(e),a=r.alert||Rr;if(t){var i;!((i=r.location)===null||i===void 0)&&i.port&&a(n);return}a(n)}function oe(e,t,r){e.dataset?e.dataset[t]=r:e.setAttribute("data-".concat(t),r)}function Ke(e){oe(e,"heldisabled","1"),e.disabled=!0}var ei=Object.freeze({__proto__:null,noop:Rr,hasProp:qa,isServer:Xa,safeParse:Ja,isNull:Nr,noDupPush:ht,okeys:Fr,merge2List:za,purify:Or,getObjsVal:Qa,pfstr:kr,nbstr:jr,nbalert:Za,setDataset:oe,disableNode:Ke});function ti(e,t){var r=this,n=t.fn,a=t.fnName,i=t.arg1PlatObjFnKeys,s=i.includes(a);return function(){for(var o=function(h){return Me({platform:e},Or(h||{}))},u=arguments.length,c=new Array(u),p=0;p<u;p++)c[p]=arguments[p];var f=c[0],d=c[1];return s?c[0]=o(f):c[1]=o(d),n.apply(r,c)}}function Hr(e,t,r){var n=r||{},a=n.ignoreKeys,i=a===void 0?[]:a,s=n.arg1PlatObjFnKeys,o=s===void 0?[]:s,u={};return Object.keys(t).forEach(function(c){var p=t[c];if(i.includes(c)){u[c]=p;return}var f=ye(p);if(f&&f==="object"){u[c]=Hr(e,p,r);return}if(f==="function"){u[c]=ti(e,{arg1PlatObjFnKeys:o,fn:p,fnName:c});return}u[c]=p}),u}var ri="hel",Ur="unpkg",St={NONE:0,LOG:1,TRACE:2},G="__default_online_ver__",Br=Ur,$={CORE_VER:"4.13.1",DEFAULT_API_PREFIX:"https://unpkg.com",DEFAULT_API_URL:"/openapi/v1/app/info",DEFAULT_ONLINE_VER:G,DEFAULT_USER_LS_KEY:"HelUserRtxName",DEFAULT_PLAT:Br,LS_LOG_MODE:"HelConfig.logMode",LS_LOG_FILTER:"HelConfig.logFilter",PLAT_HEL:ri,PLAT_UNPKG:Ur,KEY_CSS_STR:"CSS_STR",KEY_ASSET_CTX:"ASSET_CTX",KEY_STYLE_TAG_ADDED:"STYLE_TAG_ADDED",KEY_CSS_LINK_TAG_ADDED:"CSS_LINK_TAG_ADDED",KEY_IGNORE_CSS_PREFIX_LIST:"IGNORE_CSS_PREFIX_LIST",KEY_IGNORE_STYLE_TAG_KEY:"IGNORE_STYLE_TAG_KEY",KEY_IGNORE_CSS_PREFIX_2_KEYS:"IGNORE_CSS_PREFIX_2_KEYS"},Ve={SUB_APP_LOADED:"subAppLoaded",SUB_LIB_LOADED:"SubLibLoaded",STYLE_STR_FETCHED:"StyleStrFetched",STYLE_TAG_ADDED:"StyleTagAdded",CSS_LINK_TAG_ADDED:"CssLinkTagAdded"},we={NOT_LOAD:0,LOADING:1,LOADED:2},Gr=$.LS_LOG_FILTER,Kr=$.LS_LOG_MODE,Re=St.NONE,$r=St.LOG,ni=St.TRACE,pe={isIncludeFilter:function(t,r){if(!r.includes(","))return t.includes(r);var n=r.split(",");return n.some(function(a){return t.includes(a)})},getLogFilter:function(){return he().logFilter},setLogFilter:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;he().logFilter=t,r&&yr(Gr,t)},setLogMode:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=parseInt(t,10);[Re,$r,ni].includes(n)&&(he().logMode=n,r&&yr(Kr,n))},getLogMode:function(){return he().logMode}},le={};function ai(){if(!he().isInit){he().isInit=!0;var e=Wa(),t=e.hellog,r=e.hellogf,n=t||Ar(Kr)||Re;pe.setLogMode(n,!1);var a=r||Ar(Gr)||"";pe.setLogFilter(a,!1)}}function ii(){return{logMode:Re,logFilter:"",isInit:!1}}function si(){if(le=Ge().__HEL_MICRO_DEBUG__,!wr(le)){le.logMode===void 0&&(le.logMode=Re,le.logFilter="");return}le=ii(),Ge().__HEL_MICRO_DEBUG__=le;try{ai()}catch{}}function $e(){return pe.getLogMode()!==Re}function he(){return le}var Sr=" %c--> HEL LOG:",_r="color:#ad4e00;font-weight:600";function J(){if($e()){for(var e=pe.getLogMode()===$r?console.log:console.trace||console.log,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var a=r[0],i=r.slice(1);if(typeof a!="string")return e.apply(void 0,[Sr,_r].concat(r));var s=pe.getLogFilter(),o=["".concat(Sr," ").concat(a),_r].concat(st(i));if(s){pe.isIncludeFilter(a,s)&&e.apply(void 0,st(o));return}e.apply(void 0,st(o))}}var De={};function oi(e){!$e()||De[e]||(De[e]=Date.now())}function _t(e,t,r){if(!(!$e()||!De[e])){var n=De[e];J("[[ PerfCheck ]] (".concat(e,"/").concat(t,") costs ").concat(Date.now()-n," ms")),r&&Yr(e)}}function Yr(e){De[e]=0}var ui=$.DEFAULT_API_URL,ci=$.DEFAULT_USER_LS_KEY,ot=$.PLAT_HEL,Lr=$.PLAT_UNPKG,li=$.DEFAULT_API_PREFIX,pi=$.CORE_VER,fi=$.KEY_CSS_LINK_TAG_ADDED,di=$.KEY_STYLE_TAG_ADDED,Er=$.KEY_IGNORE_CSS_PREFIX_LIST,vi=$.KEY_IGNORE_STYLE_TAG_KEY,hi=$.KEY_IGNORE_CSS_PREFIX_2_KEYS;function mt(e){var t=e||{},r=t.apiPrefix;return{apiMode:"get",apiPrefix:r,apiSuffix:"",apiPathOfApp:ui,apiPathOfAppVersion:"",getSubAppAndItsVersionFn:null,customMetaUrl:"",customMetaJsonpUrl:"",getMeta:null,onFetchMetaFailed:null,strictMatchVer:!0,getUserName:null,userLsKey:ci,shouldUseGray:null,trustAppNames:null,semverApi:null,hook:{}}}function gt(e){var t=Me(Me({isConfigOverwrite:!1,platform:e,appName2Comp:{},appName2Lib:{},appName2isLibAssigned:{},appName2EmitApp:{},appName2verLoadStatus:{},appName2verEmitLib:{},appName2verEmitApp:{},appName2verStyleStr:{},appName2verStyleFetched:{},appName2verExtraCssList:{},appName2verAppVersion:{},appName2verCustomData:{},appName2app:{},appName2appVersion:{},appName2styleStr:{},appGroupName2firstVer:{},isOriginInitCalled:!1},mt()),{},{origin:mt({apiPrefix:li})});return t}function bt(){var e={};return{on:function(r,n){var a=e[r];if(!a){var i=[];e[r]=i,a=i}a.push(n)},emit:function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];var s=e[r];if(s){var o=s.slice();o.forEach(function(u){return u.apply(void 0,a)})}},off:function(r,n){var a=e[r];if(a)for(var i=0,s=a.length;i<s;i++){var o=a[i];if(o===n){a.splice(i,1);break}}}}}function mi(){var e=gt(Lr),t=gt(ot),r={platform:ot,platformHint:"the platform value here does not make any sense!",appName2platform:{},appGroupName2platform:{},caches:dt(dt({},Lr,e),ot,t),common:{}},n=bt(),a=bt();return{ver:pi,isStyleObInit:!1,nativeHeadAppend:null,nativeBodyAppend:null,patchedHeadAppend:null,patchedBodyAppend:null,createFeature:Dr(),eventBus:n,userEventBus:a,cacheRoot:r,unpkgCache:e,helCache:t,dev:{setLogMode:pe.setLogMode,setLogFilter:pe.setLogFilter}}}function Cr(e){var t=[fi,di,Er,vi,hi],r=function(a){return a===Er?[]:{}};t.forEach(function(n){return H(e,n,r(n))})}function gi(){var e=me();if(e){var t=e.cacheRoot;H(t,"appGroupName2platform"),H(t,"common");var r=t.caches;Object.keys(r).forEach(function(n){var a=r[n];H(a,"appGroupName2firstVer"),H(a,"appName2isLibAssigned"),H(a,"appName2verExtraCssList"),H(a,"appName2verCustomData"),H(a,"hook"),H(a,"origin",mt()),H(a.origin,"hook")}),Cr(t.common),e.userEventBus||(e.userEventBus=bt());return}e=mi(),Cr(e.cacheRoot.common),Ge().__HEL_MICRO_SHARED__=e}function me(){var e=Ge().__HEL_MICRO_SHARED__;return e}function Ye(){return Br}function K(e){var t=e||Ye(),r=ge(),n=r.caches[t];if(!n){var a=ye(e);if(a!=="string")throw console.error("invalid plaform:",e),new Error("fatal error: platform only can be a string, now it is ".concat(a));var i=gt(e);r.caches[t]=i,n=i}return n}function ge(){return me().cacheRoot}var ue={getCustomData:function(t,r,n){var a=n.versionId,i=n.platform,s=K(i),o=s.appName2verCustomData,u=H(o,t),c=H(u,r);return c[a||G]},getAppMeta:function(t,r){var n=K(r),a=n.appName2app;return a[t]},setVerLoadStatus:function(t,r,n,a){var i=a||{},s=i.versionId,o=i.platform,u=K(o)[n],c=s||G;re(u,t,c,r)},getVerLoadStatus:function(t,r,n){var a,i=n||{},s=i.versionId,o=i.platform,u=K(o)[r],c=s||G;return((a=u[t])===null||a===void 0?void 0:a[c])||we.NOT_LOAD},ensureOnlineModule:function(t,r,n){if(!t[G]){var a=ue.getAppMeta(r,n),i=t[a?.online_version];i&&(t[G]=i)}}};function bi(e,t){var r,n=t||{},a=n.versionId,i=n.platform,s=K(i),o=s.appName2verEmitApp,u=s.appName2Comp,c=s.strictMatchVer,p=s.appName2EmitApp,f=(r=n.strictMatchVer)!==null&&r!==void 0?r:c,d=H(o,e);ue.ensureOnlineModule(d,e,i);var v=a||G,h=d[v],m=u[e],g=m?{Comp:m}:null,b=f?null:p[e]||g,y=h||b||null;return J("[[ core:getVerApp ]] appName,options,result:",e,n,y),y}function Wr(e,t){J("[[ core:setEmitApp ]] appName,emitApp:",e,t);var r=t.versionId,n=t.platform,a=K(n),i=a.appName2verEmitApp,s=a.appName2Comp,o=a.appName2EmitApp,u=H(i,e);u[G]||(s[e]=t.Comp,o[e]=t,re(i,e,G,t)),r&&re(i,e,r,t)}var Ir=$.KEY_CSS_LINK_TAG_ADDED,ut=$.KEY_STYLE_TAG_ADDED,Tr=$.KEY_IGNORE_CSS_PREFIX_LIST,Ai=$.KEY_IGNORE_STYLE_TAG_KEY,ct=$.KEY_IGNORE_CSS_PREFIX_2_KEYS;function qr(e){var t=ge(),r=t.common,n=H(r,e);return n}function Ue(e){var t=ge(),r=t.common;return r[e]}function xe(e,t){var r=qr(e),n=r[t];return n!==void 0?n:null}function Pe(e,t,r){var n=qr(e);n[t]=r}var ee={setIgnoreCssPrefix:function(t){var r=Ue(Tr);vt(r,t)},setIgnoreStyleTagKey:function(t){var r=ee.getIgnoreStyleTagMap();r[t]=1},getIgnoreStyleTagMap:function(){var t=Ue(Ai);return t},setIgnoreCssPrefixKey:function(t,r){var n=xe(ct,t);n||(n=[],Pe(ct,t,n)),vt(n,r)},getIgnoreCssPrefixKeys:function(t){var r=Ue(ct);return r[t]||[]},getMatchedIgnoreCssPrefix:function(t){for(var r=Ue(Tr),n="",a=0;a<r.length;a++){var i=r[a];if(t.startsWith(i)){n=i;break}}return n},getIgnoreCssPrefixCssUrlList:function(t){var r=xe(Ir,t);return r||(r=[],Pe(Ir,t,r)),r},setIgnoreCssPrefixCssUrl:function(t,r){var n=ee.getIgnoreCssPrefixCssUrlList(t);n.push(r)},getStyleTagText:function(t){var r=xe(ut,t)||"";return r},clearStyleTagText:function(t){Pe(ut,t,"")},appendStyleTagText:function(t,r){var n=ee.getStyleTagText(t);Pe(ut,t,"".concat(n," ").concat(r))}};function Lt(e,t){var r=e.apiMode,n=e.apiPrefix,a=e.apiSuffix,i=e.apiPathOfApp,s=e.apiPathOfAppVersion,o=e.getSubAppAndItsVersionFn,u=e.onFetchMetaFailed,c=e.strictMatchVer,p=e.getUserName,f=e.userLsKey,d=e.shouldUseGray,v=e.getApiPrefix,h=e.trustAppNames,m=e.platform,g=e.origin,b=e.hook,y=e.customMetaUrl,S=e.customMetaJsonpUrl,A=e.getMeta,C={apiMode:r,apiPrefix:n,apiSuffix:a,apiPathOfApp:i,apiPathOfAppVersion:s,getSubAppAndItsVersionFn:o,onFetchMetaFailed:u,strictMatchVer:c,getUserName:p,userLsKey:f,shouldUseGray:d,getApiPrefix:v,trustAppNames:h,hook:b,platform:m,customMetaUrl:y,customMetaJsonpUrl:S,getMeta:A};return t&&(C.origin=g),C}function yi(e){var t=K(e);return Lt(t,!0)}function Si(e){var t=me(),r=t.nativeHeadAppend,n=t.nativeBodyAppend,a=e.headAppend||null,i=e.bodyAppend||null,s=function(u){return"pass same ".concat(u," handle, hel will ignore it for avlid 'Maximum call stack size exceeded'")};a&&a===r?console.error(s("headAppend")):t.patchedHeadAppend=a,i&&i===n?console.error(s("bodyAppend")):t.patchedBodyAppend=i}function _i(e,t){var r=K(t),n=Lt(e);r.isConfigOverwrite||(r.isConfigOverwrite=!0,Vr(r,n))}function Li(e,t){var r=K(e),n="[[ core:originInit ]] invalid call, it can only been called";if(r.isConfigOverwrite){J("".concat(n," before init"));return}if(r.isOriginInitCalled){J("".concat(n," one time"));return}var a=Lt(t);r.isOriginInitCalled=!0,Vr(r.origin,a)}function We(e){return ge().appGroupName2platform[e]||Ye()}function Ei(e,t,r){var n=ge().appGroupName2platform;return(r||!n[e])&&(n[e]=t),We(e)}function Et(e){return ge().appName2platform[e]||Ye()}function Ci(e,t,r){var n=ge().appName2platform;return(r||!n[e])&&(n[e]=t),Et(e)}function Xr(e,t){var r=t.customKey,n=t.platform,a=n===void 0?Et(e):n,i=K(a),s=i.appName2verCustomData,o=H(s,e),u=H(o,r);return u}function Ii(e,t){var r=Xr(e,t),n=r[t.versionId||G];return n!==void 0?n:null}function Ti(e,t){var r=t.customValue,n=t.versionId,a=Xr(e,t);a[n||G]=r,a[G]||(a[G]=r)}var Pi=Ve.STYLE_TAG_ADDED,xi=Ve.CSS_LINK_TAG_ADDED;function Se(){return me().eventBus}function Mi(){return me().userEventBus}var qe={styleTagAdded:function(t){return"".concat(Pi,"/").concat(t)},cssLinkTagAdded:function(t){return"".concat(xi,"(").concat(t,")")}};function Di(e,t){var r,n=t||{},a=n.versionId,i=n.platform,s=K(i),o=s.appName2verEmitLib,u=s.appName2Lib,c=s.strictMatchVer,p=s.appName2isLibAssigned,f=(r=n.strictMatchVer)!==null&&r!==void 0?r:c,d=H(o,e);ue.ensureOnlineModule(d,e);var v=a||G,h=d[v],m=p[e]?u[e]:null,g=f?null:m,b=h||g||null;return J("[[ core:getVerLib ]] appName,options,result:",e,n,b),b}function Jr(e,t,r){var n=r||{},a=n.appGroupName,i=t.versionId,s=t.appProperties,o=t.platform||r.platform,u=K(o),c=u.appName2verEmitLib,p=u.appName2Lib,f=u.appName2isLibAssigned,d=ue.getAppMeta(e,o),v=function(g){var b=p[g];b?ye(b)==="object"&&Object.keys(b).length===0&&Object.assign(b,s):p[g]=s,f[g]=!0};v(e),a?v(a):d&&v(d.app_group_name),J("[[ core:setEmitLib ]] appMeta:",d);var h=H(c,e);h[G]||re(c,e,G,s),i&&re(c,e,i,s)}function zr(e,t){var r=K(t),n=r.appName2app;return n[e]}function Vi(e,t){var r=K(t),n=r.appName2app;n[e.name]=e}function Ct(e,t,r){ue.setVerLoadStatus(e,t,"appName2verLoadStatus",r)}function wi(e,t){return ue.getVerLoadStatus(e,"appName2verLoadStatus",t)}function Ri(e,t,r){ue.setVerLoadStatus(e,t,"appName2verStyleFetched",r)}function Ni(e,t){return ue.getVerLoadStatus(e,"appName2verStyleFetched",t)}function Fi(e,t){var r,n=t||{},a=n.platform,i=n.versionId,s=K(a),o=s.appName2verStyleStr,u=s.appName2styleStr,c=u[e]||"";return i?((r=o[e])===null||r===void 0?void 0:r[i])||c||"":c}function Oi(e,t,r){var n=r||{},a=n.platform,i=n.versionId,s=K(a),o=s.appName2verStyleStr,u=s.appName2verStyleFetched,c=s.appName2styleStr;if(!i){c[e]=t;return}re(o,e,i,t),re(u,e,i,we.LOADED)}function ki(e,t,r){var n=r||{},a=n.versionId,i=n.platform,s=K(i),o=s.appName2verExtraCssList;J("[[ core:setVerExtraCssList ]] cssList:",t);var u=H(o,e);u[G]||re(o,e,G,t),a&&re(o,e,a,t)}function ji(e,t){var r=t||{},n=r.versionId,a=r.platform,i=K(a),s=i.appName2verExtraCssList,o=H(s,e),u=o[n]||o[G]||[];return J("[[ core:getVerExtraCssList ]] options,cssList:",r,u),u}function Hi(e,t){var r,n=t||{},a=n.platform,i=n.versionId,s=K(a),o=s.appName2verAppVersion,u=s.appName2appVersion,c=u[e]||null;return i&&((r=o[e])===null||r===void 0?void 0:r[i])||c}function Ui(e,t,r){var n=r||{},a=n.platform,i=K(a),s=i.appName2verAppVersion,o=i.appGroupName2firstVer,u=i.appName2appVersion,c=t.version_tag||t.sub_app_version;if(c){var p=ue.getAppMeta(e,a),f=H(s,e);f[G]||(re(s,e,G,t),u[e]=t),re(s,e,c,t),o[p.app_group_name]=t.sub_app_version}}function Te(e,t){var r=e.split("@"),n=r.slice(1),a=n.join("@");return a||t||e}function Pr(e){return e==="js"||e==="mjs"}function It(e,t){var r=Dr();J("[[ core:tryGetVersion ]] may include ver source > ".concat(r));var n=K(t),a=n.appGroupName2firstVer,i=a[e]||"";if(r.includes("https://")||r.includes("http://")){var s=r.split("//"),o=Be(s,2),u=o[1],c=u.split("/");if(i){var p=u.includes("/".concat(i,"/"));if(p){var f=i.startsWith("@");if(f){var m=i.split("/")[1]||"";return Te(m)}else{var d=c.indexOf(i),v=c[d-1],h=v.startsWith("@");if(!h)return Te(i)}}var g=c[1],b=c[2];if(g==="static"&&Pr(b)||Pr(g))return Te(i)}var y=u.indexOf("@");if(y>=0){var S=c.filter(function(R){return R.includes("@")}),A=S.findIndex(function(R){return R.startsWith("@")});if(A>=0){var C=S[A+1]||"";return Te(C,i)}var x=S[0]||"";return Te(x,i)}var _=u.split("/".concat(t,"/")),D=Be(_,2),O=D[1],k=O===void 0?"":O,F=k.split("/"),j=Be(F,1),U=j[0];return U||i}return i}function Tt(e,t){if(e===G)return t||"";if(e.includes("_")){var r=e.substring(0,e.length-15);return r}return t||""}var At=!1,lt=!1;function Bi(e){if(e&&(At=!1,lt=!1),!lt){lt=!0;var t=z();t.__MASTER_APP_LOADED__===void 0&&(t.__MASTER_APP_LOADED__=!0,At=!0)}}function Gi(){var e=`WARNING: calling isSubApp is unsafe, use hel-iso.isSubApp instead,
9
+ `;return e+="more details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp",console.log("%c".concat(e),"color:red;"),!At}function Ki(e,t){var r=t.platform,n=t.groupName,a=t.name,i=t.ver,s=t.elName;oe(e,"el",s),oe(e,"plat",r),oe(e,"gname",n),oe(e,"name",a),oe(e,"ver",i)}var $i=$.KEY_ASSET_CTX;function pt(e,t){if(!t||!["LINK","SCRIPT"].includes(t.tagName))return e(t);var r=t.href,n=t.tagName,a=t.src,i=r||a||"",s=n==="LINK",o=xe($i,i)||{},u=o.platform,c=o.groupName,p=o.name,f=o.ver,d=o.beforeAppend,v=t;if(d){var h=s?"href":"src",m=t.getAttribute(h),g=function(S){return t.setAttribute(h,S)};v=d({el:t,nativeAppend:e,setAssetUrl:g,url:m,tagName:n})||t}var b=s?"HelLink":"HelScript";return u&&Ki(v,{platform:u,groupName:c,name:p,ver:f,elName:b}),e(v)}function Yi(){var e=z();if(!(e.__POWERED_BY_QIANKUN__||e.__DISABLE_HEL_MONKEY_PATCH__)){var t=me(),r=e.document,n=t.nativeHeadAppend,a=t.nativeBodyAppend;if(!(n||!r)){var i=r.head,s=r.body;if(n=i.appendChild.bind(i),t.nativeHeadAppend=n,s)a=s.appendChild.bind(s),t.nativeBodyAppend=a;else{var o=xr(),u=new o(function(f){for(var d,v=0;v<f.length;v++){var h=f[v].addedNodes;if(d=br(h,"BODY"),d)break}d&&(a=d.appendChild.bind(d),t.nativeBodyAppend=a,d.appendChild=function(m){return pt(p(a,d,"body"),m)},u.disconnect())}),c=br(r.childNodes,"HTML");c&&u.observe(c,{childList:!0})}var p=function(d,v,h){var m=t.patchedHeadAppend,g=t.patchedBodyAppend,b=h==="head";if(m&&b)return m;if(g&&!b)return g;if(e.__POWERED_BY_WUJIE__)return d;var y=e.Element;return y?y.prototype.appendChild.bind(v):d};i.appendChild=function(f){return pt(p(n,i,"head"),f)},s&&(s.appendChild=function(f){return pt(p(a,s,"body"),f)})}}}var Qr="preFetch";function Wi(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.platform||We(e),a=r.versionId||It(e,n),i=r.appName||Tt(a,e);J("[[ core:libReady ]] appGroupName ".concat(e,", appName ").concat(i,", versionId ").concat(a));var s=zr(i,n);s!=null&&s.__fromCust&&(a=r.versionId||s.online_version,i=s.name,J("[[ core:libReady ]] fromCust, appGroupName ".concat(e,", appName ").concat(i,", versionId ").concat(a)));var o={platform:n,appName:i,appGroupName:e,versionId:a,appProperties:t,Comp:function(){},lifecycle:{}};Jr(i,o,{appGroupName:e,platform:n}),Ct(i,we.LOADED,{versionId:a,platform:n});var u=Se();_t(Qr,"libReady"),u.emit(Ve.SUB_LIB_LOADED,o)}function qi(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=r.lifecycle,a=r.platform||We(e),i=r.versionId||It(e,a),s=r.appName||Tt(i,e),o={Comp:t,appName:s,appGroupName:e,lifecycle:n,platform:a,versionId:i,isLib:!1};Wr(s,o),Ct(s,we.LOADED,{versionId:i,platform:a});var u=Se();_t(Qr,"appReady"),u.emit(Ve.SUB_APP_LOADED,o)}var Zr="/* @helstart ",Xi=" @helend */",Ji=Zr.length;function zi(e,t){var r=Se(),n=ee.getMatchedIgnoreCssPrefix(t);return n&&(ee.setIgnoreCssPrefixCssUrl(n,t),r.emit(qe.cssLinkTagAdded(n),{nodes:[e]})),n}function Qi(e){var t=z();if(t){var r=t.document.head.querySelectorAll('style[data-gname="'.concat(e,'"]'));if(r.length){ee.clearStyleTagText(e),r.forEach(function(a){Ke(a),ee.appendStyleTagText(e,a.innerText)});var n=Se();n.emit(qe.styleTagAdded(e),{nodes:r})}}}function Zi(e,t){var r=e.tagName,n=e.innerText,a=e.href;if(["STYLE","LINK"].includes(r)){if(r==="STYLE"){if(!n)return;var i=n.indexOf(Zr);if(i<0)return;var s=n.indexOf(Xi);if(s<0)return;var o=n.substring(Ji+i,s);if(o){var u=o.trim(),c="",p=u;if(u.includes("/")){var f=u.split("/");c=f[0],p=f[1]}oe(e,"gname",p),c&&oe(e,"plat",c),t[u]&&Ke(e);var d=Se();ee.appendStyleTagText(u,n),d.emit(qe.styleTagAdded(u),{nodes:[e]})}return}var v=zi(e,a);v&&Ke(e)}}function es(e,t){var r=e.tagName,n=e.src,a=n===void 0?"":n;if(r!=="SCRIPT"||!a.endsWith(".hot-update.js"))return!1;var i=ee.getMatchedIgnoreCssPrefix(a);if(!i)return!1;var s=ee.getIgnoreCssPrefixKeys(i);if(!s.length)return!1;var o=!1;return s.forEach(function(u){t[u]&&(Qi(u),o=!0)}),o}function ts(){var e=me(),t=z(),r=e.isStyleObInit,n=t.document;if(!(r||!n)){e.isStyleObInit=!0;var a=ee.getIgnoreStyleTagMap(),i=xr();if(i){var s=new i(function(o){o.forEach(function(u){for(var c=u.addedNodes,p=u.removedNodes,f=c.length,d=0;d<f;d++)Zi(c[d],a);for(var v=p.length,h=0;h<v&&!es(p[h],a);h++);})});s.observe(document.head,{childList:!0})}}}en();J("hel-micro-core ver ".concat($.CORE_VER));var rs=Ve,ns=we,as=$,is=Hr,ss=ei,os=Gi;function en(e){e&&tn(e),Bi(!!e),gi(),si(),Yi(),ts()}var us=Ye,cs=K,ls=he,ps=$e,fs=J,ds=oi,vs=_t,hs=Yr,ms=z,tn=$a,gs=bi,bs=Wr,As=Di,ys=Jr,Ss=zr,_s=Vi,Ls=Hi,Es=Ui,Cs=Ii,Is=Ti,Ts=xe,Ps=Pe,xs=ee,Ms=wi,Ds=Ct,Vs=Ni,ws=Ri,Rs=Fi,Ns=Oi,Fs=ji,Os=ki,ks=It,js=Tt,Hs=yi,Us=We,Bs=Ei,Gs=Ci,Ks=Et,$s=_i,Ys=Li,Ws=Si,qs=Se,Xs=Mi,Js=qe,zs=Wi,Qs=qi;L.allowLog=ps;L.appReady=Qs;L.clearPerfMark=hs;L.commonDataUtil=xs;L.commonUtil=ss;L.evName=Js;L.getAppMeta=Ss;L.getAppPlatform=Us;L.getAppPlatformByAppName=Ks;L.getAppStyleStr=Rs;L.getCommonData=Ts;L.getCustomData=Cs;L.getGlobalThis=ms;L.getHelDebug=ls;L.getHelEventBus=qs;L.getPlatform=us;L.getPlatformConfig=Hs;L.getSharedCache=cs;L.getUserEventBus=Xs;L.getVerApp=gs;L.getVerExtraCssList=Fs;L.getVerLib=As;L.getVerLoadStatus=Ms;L.getVerStyleStrStatus=Vs;L.getVersion=Ls;L.helConsts=as;L.helEvents=rs;L.helLoadStatus=ns;L.inectPlatToMod=is;L.initGlobalConfig=Ws;L.initPlatformConfig=$s;L.isSubApp=os;L.libReady=zs;L.log=fs;L.originInit=Ys;L.perfMark=ds;L.perfPeek=vs;L.resetGlobalThis=en;L.setAppMeta=_s;L.setAppPlatform=Bs;L.setAppPlatformByAppName=Gs;L.setAppStyleStr=Ns;L.setCommonData=Ps;L.setCustomData=Is;L.setEmitApp=bs;L.setEmitLib=ys;L.setGlobalThis=tn;L.setVerExtraCssList=Os;L.setVerLoadStatus=Ds;L.setVerStyleStrStatus=ws;L.setVersion=Es;L.tryGetAppName=js;L.tryGetVersion=ks});var nn=je((Je,rn)=>{(function(e,t){typeof Je=="object"&&typeof rn<"u"?t(Je,Xe()):typeof define=="function"&&define.amd?define(["exports","hel-micro-core"],t):t((e=typeof globalThis<"u"?globalThis:e||self).HelLibProxy={},e.HelMicroCore)})(Je,function(e,t){"use strict";var r=function(){return r=Object.assign||function(M){for(var E,I=1,N=arguments.length;I<N;I++)for(var B in E=arguments[I])Object.prototype.hasOwnProperty.call(E,B)&&(M[B]=E[B]);return M},r.apply(this,arguments)};function n(M,E){var I=E||(t.getAppPlatform===null||t.getAppPlatform===void 0?void 0:t.getAppPlatform(M)),N=t.getSharedCache(I).appName2Lib;return N[M]||(N[M]={}),N[M]}var a="4.12.1";t.log("hel-lib-proxy ver ".concat(a));var i=t.getUserEventBus,s=t.helConsts,o=i();function u(M,E){var I=r({},E||{});return I.platform=I.platform||s.DEFAULT_PLAT,t.getVerLib(M,I)}function c(M,E){var I,N=!0,B="";E&&(typeof E=="string"?B=E:(B=E.platform||"",N=(I=E.asProxy)===null||I===void 0||I));var Y=n(M,B=B||t.getAppPlatform(M)||s.DEFAULT_PLAT);return typeof Proxy=="function"&&N&&(Y=(function(Z,W,q){return new Proxy(W,{get:function(X,te){var de=String(te);return t.log("[[getLibProxy]] call lib [".concat(Z,"] method [").concat(de,"]")),Object.keys(X).length?X[de]:n(Z,q)[de]}})})(M,Y,B)),t.log("[[ exposeLib ]] libName, libObj",M,Y),Y}function p(M,E,I){var N=(function(B){var Y={allowDup:!1,platform:t.helConsts.DEFAULT_PLAT};return r(r({},Y),B||{})})(I);t.libReady(M,E,N)}function f(M,E,I){t.appReady(M,E,I)}function d(M,E){return t.getVerApp(M,E)}var v=t.isSubApp;function h(){return!t.isSubApp()}var m=Object.freeze({__proto__:null,VER:a,eventBus:o,getLib:u,exposeLib:c,libReady:p,appReady:f,exposeApp:d,isSubApp:v,isMasterApp:h}),g=t.commonUtil.purify,b=["isMasterApp","isSubApp","eventBus"],y=["appReady","libReady"];function S(M,E){return E&&typeof E=="object"&&!Array.isArray(E)?r({platform:M},g(E)):{platform:M}}function A(M,E){var I={};return Object.keys(M).forEach(function(N){var B=M[N];if(b.includes(N))I[N]=B;else if(y.includes(N))I[N]=(function(Z,W){return function(){for(var q=[],X=0;X<arguments.length;X++)q[X]=arguments[X];var te=q[0],de=q[1],ve=q[2];return Z(te,de,S(W,ve===void 0?{}:ve))}})(B,E);else{var Y=N==="exposeLib";I[N]=(function(Z,W,q){return function(){for(var X=[],te=0;te<arguments.length;te++)X[te]=arguments[te];var de=X[0],ve=X[1];return Z(de,!q||typeof ve!="string"&&ve!==void 0?S(W,ve):ve||W)}})(B,E,Y)}}),I}var C=function M(E){var I=A(m,E);return I.createInstance=M,I},x=a,_=p,D=c,O=u,k=v,F=h,j=o,U=f,R=d,V={VER:x,libReady:_,exposeLib:D,getLib:O,isSubApp:k,isMasterApp:F,eventBus:j,appReady:U,exposeApp:R,createInstance:C};(function(M){var E=t.getGlobalThis();t.commonUtil.isServer()||E.HelLibProxy||(t.log("auto bind hel-lib-proxy to global.HelLibProxy"),E.HelLibProxy=M)})(V),e.VER=x,e.appReady=U,e.createInstance=C,e.default=V,e.eventBus=j,e.exposeApp=R,e.exposeLib=D,e.getLib=O,e.isMasterApp=F,e.isSubApp=k,e.libReady=_,Object.defineProperty(e,"__esModule",{value:!0})})});var _a=je((ic,Sa)=>{"use strict";var ya=Object.freeze({unpkg:"https://unpkg.com"});function Ku(e){let t=/^(?:(@[a-z\d._-]+)\/)?([a-z\d][a-z\d._-]*)(?:@([a-z\d][a-z\d.+_-]*))?$/i.exec(e);if(!t)throw new Error("\u65E0\u6548\u7684\u8FDC\u7A0B\u5305\u540D\u79F0\u6216\u7248\u672C\uFF1A"+e);let[,r,n,a]=t;return{scope:r||"",name:n,packageName:(r?r+"/":"")+n,version:a||""}}function $u(e,{type:t="unpkg",base:r,projectName:n,versioned:a=!0}={}){let i=r||ya[t]||(t==="github"&&e.scope?"https://"+e.scope.slice(1)+".github.io":"");if(!i)throw new Error(t==="github"?"github \u65E0 scope \u7684\u5305\u5F15\u7528\u9700\u8981 base\uFF08\u65E0\u6CD5\u63A8\u5BFC\u7EC4\u7EC7\uFF09":"custom \u52A0\u8F7D\u9700\u8981 base");let s;try{s=new URL(i)}catch{throw new Error("\u9700\u8981\u7EDD\u5BF9 HTTP(S) \u5730\u5740\uFF1A"+i)}if(!/^https?:$/.test(s.protocol))throw new Error("\u4E0D\u652F\u6301\u7684\u5730\u5740\u534F\u8BAE\uFF1A"+i);if(s.search||s.hash)throw new Error("base \u4E0D\u80FD\u5305\u542B\u67E5\u8BE2\u53C2\u6570\u6216 hash\uFF1A"+i);let o=n||(t==="github"?e.name:e.packageName);!n&&t!=="github"&&e.scope&&(s.pathname=s.pathname.replace(/\/@[a-z\d._-]+\/*$/i,""));let u=a&&e.version&&e.version.toLowerCase()!=="latest"?"@"+e.version:"";return s.pathname=s.pathname.replace(/\/+$/,"")+"/"+o+u,s}Sa.exports={HEL_BASES:ya,packageRef:Ku,packageUrl:$u}});var Ea=je((sc,La)=>{"use strict";La.exports=_a()});var Cn=He(nn()),$t=He(Xe()),l=He(Xe());function Zs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function an(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,ro(n.key),n)}}function eo(e,t,r){return t&&an(e.prototype,t),r&&an(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function to(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ro(e){var t=to(e,"string");return typeof t=="symbol"?t:String(t)}var no=/\s/,ao=/[a-zA-Z0-9\-]/,sn="<!DOCTYPE html>",io="<!--",on="-->",so="</meta>",oo="</link>",uo=["meta","link"],co={meta:so,link:oo},lo=(function(){function e(){Zs(this,e),this.input="",this.len=0,this.cur=0}return eo(e,[{key:"eof",get:function(){return this.cur>=this.len}},{key:"peek",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return this.input[this.cur+r]}},{key:"sub",value:function(r,n){var a=n||this.cur;return this.input.substring(a,a+r)}},{key:"moveCur",value:function(r){this.cur+=r}},{key:"consumeChar",value:function(r){var n=this.peek();if(n===r)this.cur++;else throw new Error("Unexpected character: '".concat(n,"' should be '").concat(r,"'"));return n}},{key:"consumeSpace",value:function(){this.consumeWhile(no)}},{key:"consumeWhile",value:function(r){var n=[];do{var a=this.peek();if(r.test(a))n.push(a),this.cur++;else break}while(!this.eof);return n.join("")}},{key:"noop",value:function(){}},{key:"pureInput",value:function(r){var n=r.trim();n.startsWith(sn)&&(n=n.substring(sn.length));var a=function i(s){var o=s.indexOf(io),u=s.indexOf(on);if(o>=0&&u>=0){var c=s.substring(0,o),p=s.substring(u+on.length);return i("".concat(c).concat(p))}return s};return n=a(n),n}},{key:"parse",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r||"";return this.input=this.pureInput(a),this.len=a.length,this.onTagOpen=n.onTagOpen||this.noop(),this.onTagClose=n.onTagClose||this.noop(),this.cur=0,this.parseNodes()}},{key:"parseNodes",value:function(){var r=[];do{var n=void 0;if(this.peek()==="<"){if(this.peek(1)==="/")break;n=this.parseElement()}else n=this.parseTextNode();n!==" "&&r.push(n)}while(!this.eof);return r}},{key:"parseTextNode",value:function(){var r=this.consumeWhile(/[^<]/);return r.replace(/[\s\n]+/g," ")}},{key:"parseElement",value:function(){var r=this;this.consumeChar("<");var n=this.parseTag();this.onTagOpen(n),this.consumeSpace();var a=this.parseAttrs(),i=this.peek(),s=this.peek(-1),o=function(h){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;r.parseTag(),r.consumeSpace(),r.consumeChar(">"),m&&r.moveCur(m);var g={tag:n,attrs:a,children:h};return r.onTagClose(n,g),g};if("".concat(s).concat(i)==="/>")return o([]);if(uo.includes(n)&&i===">"){var u=co[n],c=u.length,p=this.sub(c,this.cur+1),f=p===u?c:0;return o([],f)}this.consumeChar(">");var d=this.parseNodes();return this.consumeChar("<"),this.consumeChar("/"),o(d)}},{key:"parseTag",value:function(){var r=this.consumeWhile(ao);return r}},{key:"parseAttrs",value:function(){for(var r={};this.peek()!==">";){var n=this.parseTag();if(!n){this.consumeChar(this.peek());continue}if(this.peek()==="="){this.consumeChar("="),this.consumeChar('"');var a=this.consumeWhile(/[^"]/);this.consumeChar('"'),r[n]=a}else r[n]="";this.consumeSpace()}return r}}]),e})();function un(e,t){var r=new lo,n=r.parse(e,t);return n}var In="4.15.3";function Yt(e){var t=e.appGroupName,r=e.Comp,n=e.platform,a=e.lifecycle,i=e.appName,s=e.versionId;(0,l.appReady)(t,r,{lifecycle:a,platform:n,appName:i,versionId:s})}var w=function(){return w=Object.assign||function(t){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},w.apply(this,arguments)};function Ie(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r}function T(e,t,r,n){function a(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function o(p){try{c(n.next(p))}catch(f){s(f)}}function u(p){try{c(n.throw(p))}catch(f){s(f)}}function c(p){p.done?i(p.value):a(p.value).then(o,u)}c((n=n.apply(e,t||[])).next())})}function P(e,t){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(p){return u([c,p])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,a&&(i=c[0]&2?a.return:c[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,c[1])).done)return i;switch(a=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,a=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){r.label=c[1];break}if(c[0]===6&&r.label<i[1]){r.label=i[1],i=c;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(c);break}i[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(p){c=[6,p],a=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}var Ft={LS_CACHE_APP_PREFIX:"HelAppCache",DATABASE_NAME:"HelIndexedDB",STORE_NAME:"HelMetaData"},cn={};function ln(){return{db:null,name:"",storeName:"",version:1}}function Tn(){var e=(0,l.getGlobalThis)();return"indexedDB"in e?e.indexedDB:(console.warn("The current browser is not support indexedDB!"),null)}var po=(function(){function e(t){this.dbInfo=ln(),this.ready=null,this.initStorage(t)}return e.prototype.initStorage=function(t){var r=Tn();if(r){var n=null,a=null;this.ready=new Promise(function(v,h){n=v,a=h});var i=this.dbInfo;if(t){var s=t.name,o=t.storeName,u=t.version;Object.assign(i,l.commonUtil.purify({name:s,storeName:o,version:u}))}var c=cn[i.name];c||(c=ln(),cn[i.name]=c),i.db=c.db;var p=this.isUpgradeNeeded(i);if(i.db)if(p)i.db.close();else{n(i);return}var f=[i.name,void 0];p&&(f[1]=i.version);var d=r.open.apply(r,f);p&&(d.onupgradeneeded=function(v){c.db=d.result,i.db=d.result;try{i.db.createObjectStore(i.storeName)}catch(m){if(m.name==="ConstraintError"){var h=l.commonUtil.nbstr(`
10
+ The database "`.concat(i.name,`"
11
+ has been upgraded from version `).concat(v.oldVersion," to version ").concat(v.newVersion,`,
12
+ but the storage "`).concat(i.storeName,'" already exists.'));console.warn(h)}else throw m}}),d.onerror=function(){a(d.error)},d.onsuccess=function(){i.db=d.result,c.db=d.result,i.db.onversionchange=function(v){v.target.close()},n(i)}}},e.prototype.isUpgradeNeeded=function(t){if(!t.db)return!0;var r=!t.db.objectStoreNames.contains(t.storeName),n=t.version<t.db.version,a=t.version>t.db.version;if(n&&(console.warn('The database "'.concat(t.name,`" can't be downgraded from version `).concat(t.db.version," to version ").concat(t.version)),t.version=t.db.version),a||r){if(r){var i=t.db.version+1;i>t.version&&(t.version=i)}return!0}return!1},e.prototype.getObjectStore=function(t,r){var n=t.name,a=t.db,i=t.storeName;if(!a)throw new Error("get ".concat(i," objectStore failed in ").concat(n," database"));var s=a.transaction(i,r||"readonly").objectStore(i);return s},e.prototype.attachHandler=function(t,r,n){t.onsuccess=function(){r(t.result||null)},t.onerror=function(){n(t.error)}},e.prototype.getItem=function(t){return T(this,void 0,void 0,function(){var r,n,a,i=this;return P(this,function(s){switch(s.label){case 0:return[4,this.getDbInfo()];case 1:return r=s.sent(),n=this.getObjectStore(r),a=n.get(t),[2,new Promise(function(o,u){i.attachHandler(a,o,u)})]}})})},e.prototype.setItem=function(t,r){return T(this,void 0,void 0,function(){var n,a,i,s=this;return P(this,function(o){switch(o.label){case 0:return[4,this.getDbInfo()];case 1:return n=o.sent(),a=this.getObjectStore(n,"readwrite"),i=a.put(r,t),[2,new Promise(function(u,c){s.attachHandler(i,u,c)})]}})})},e.prototype.removeItem=function(t){return T(this,void 0,void 0,function(){var r,n,a,i=this;return P(this,function(s){switch(s.label){case 0:return[4,this.getDbInfo()];case 1:return r=s.sent(),n=this.getObjectStore(r,"readwrite"),a=n.delete(t),[2,new Promise(function(o,u){i.attachHandler(a,o,u)})]}})})},e.prototype.getDbInfo=function(){return this.ready?this.ready:Promise.reject("forget init")},e})();function Pn(e){return e.startsWith("//")?!1:e.startsWith("/")||e.startsWith("./")||e.startsWith("../")}function fo(e,t){return t.startsWith(e)?"build":Pn(t)?"relative":"static"}function Wt(){if(!Tn())return null;try{var e=new po({name:Ft.DATABASE_NAME,storeName:Ft.STORE_NAME});return{setItem:function(t,r){return e.setItem(t,r)},getItem:function(t){return e.getItem(t)},removeItem:function(t){return e.removeItem(t)}}}catch(t){return console.error("new IndexedDBStorage error: ".concat(t.message)),null}}function nt(){var e,t={getItem:function(){},setItem:function(){},removeItem:function(){}};try{var r=(e=(0,l.getGlobalThis)())===null||e===void 0?void 0:e.localStorage;return r||t}catch{return t}}function vo(e,t,r){var n=Object.prototype.hasOwnProperty.call(e,t);if(n)return e[t]||r}function ae(e){return e||(0,l.getPlatform)()}function Pt(e,t){try{nt().setItem(e,JSON.stringify(t))}catch(r){(0,l.log)("save localStorage failed: ".concat(r.message))}}function pn(e){if(!e)return e;var t=e.appInfo,r=e.appVersion;return t&&r?{app:t,version:r}:e}function at(e,t){var r="".concat(Ft.LS_CACHE_APP_PREFIX,".").concat(ae(t),".").concat(e);return r}function qt(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p,f,d;return P(this,function(v){switch(v.label){case 0:r=t||{},n=r.platform,a=r.cacheKey,i=r.storageType,s=i===void 0?"indexedDB":i,o=a||at(e,n),v.label=1;case 1:return v.trys.push([1,4,,5]),s!=="indexedDB"?[3,3]:(u=Wt(),u?[4,u.getItem(o)]:[3,3]);case 2:return c=v.sent(),[2,pn(c)];case 3:return p=nt().getItem(o),f=l.commonUtil.safeParse(p||"",null),[2,pn(f)];case 4:return d=v.sent(),console.error(d),[2,null];case 5:return[2]}})})}function Xt(e,t,r){var n=at(e,r),a=t?.({appName:e,innerKey:n})||n;return a}function xn(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return r=t.getCacheKey,n=t.storageType,a=t.platform,i=Xt(e,r,a),[4,qt(e,{platform:a,cacheKey:i,storageType:n})];case 1:return s=o.sent(),s?[2,{appInfo:s.app,appVersion:s.version}]:[2,null]}})})}function ho(e,t,r){var n=r==="indexedDB";if(!n)return Pt(e,t);var a=Wt();if(!a)return Pt(e,t);a.setItem(e,t).catch(function(i){(0,l.log)("save indexeddb failed, use localStorage instead, err: ".concat(i.message)),Pt(e,t)})}var Le={GET_APP_AND_VER:"getSubAppAndItsVersion",GET_APP_AND_FULL_VER:"getSubAppAndItsFullVersion",BATCH_GET_APP_AND_VER:"batchGetSubAppAndItsVersion",BATCH_GET_APP_AND_FULL_VER:"batchGetSubAppAndItsFullVersion",GET_APP_VER:"getSubAppVersion",GET_APP_FULL_VER:"getSubAppFullVersion"},Ne="get",Mn="Jsonp";function mo(e){var t=e.userLsKey,r=nt().getItem(t)||"";if(r)return r;try{var n={};(0,l.getGlobalThis)().document.cookie.split(";").forEach(function(a){var i=a.split("="),s=i[0],o=i[1];n[s]=o}),r=n[t]||"",(0,l.log)("[[ getUserName ]] result:",r)}catch(a){(0,l.log)("[[ getUserName ]] err:",a)}return r}var go=Object.freeze({__proto__:null,getUserName:mo}),xt=l.commonUtil.isNull;function rt(e,t,r){var n=(0,l.getPlatformConfig)(e),a=n.origin,i=n[t],s=a[t];return r||i||s}function Dn(e,t,r,n){var a=rt(e,t,n);if(a)return a(r);var i=go[t]||(function(){return null});return i(r)}function se(e,t,r,n){var a=r||[],i=a[0],s=a[1];if(!xt(i,n))return i;var o=(0,l.getPlatformConfig)(e),u=o[t];if(!xt(u,n))return u;var c=o.origin,p=c[t];return xt(p,n)?s:p}function Ot(e,t){var r,n=(0,l.getPlatformConfig)(e.platform),a=e.hook||{},i=n.origin,s=n.hook;return a[t]||s[t]||((r=i.hook)===null||r===void 0?void 0:r[t])}function Vn(e,t){var r,n,a,i="";if(t&&(i=((r=t.getApiPrefix)===null||r===void 0?void 0:r.call(t))||t.apiPrefix),i)return i;var s=(0,l.getPlatformConfig)(e);if(i=((n=s.getApiPrefix)===null||n===void 0?void 0:n.call(s))||s.apiPrefix,i)return i;var o=s.origin;return i=((a=o.getApiPrefix)===null||a===void 0?void 0:a.call(o))||o.apiPrefix,i}var bo=11,_e={now:function(){return new Date().getTime()},rand:function(){return Math.random().toString().substring(6)},removeElem:function(e){var t=e.parentNode;t&&t.nodeType!==bo&&t.removeChild(e)},parseData:function(e){var t="";if(typeof e=="string")t=e;else if(typeof e=="object")for(var r in e)t+="".concat(t,"&").concat(r,"=").concat(encodeURIComponent(e[r]));return t+="&_t=".concat(_e.now()),t=t.substring(1),t},getJSON:function(e,t){return new Promise(function(r,n){var a="",i=e;i=i+(i.indexOf("?")===-1?"?":"&")+_e.parseData(t);var s=/callback=(\w+)/.exec(i);s?.[1]?a=s[1]:a="helJsonp_".concat(_e.now(),"_").concat(_e.rand()),i.includes("?")?i="".concat(i,"&callback=").concat(a):i="".concat(i,"?callback=").concat(a);var o=(0,l.getGlobalThis)(),u=o.document,c=u.createElement("script");c.type="text/javascript",c.src=i,c.id=a,c.onerror=n,c.addEventListener("error",n),o[a]=function(f){delete o[a];var d=u.getElementById(a);return d&&_e.removeElem(d),r(f)};var p=u.getElementsByTagName("head");p?.[0]&&p[0].appendChild(c)})}},Ao=_e.getJSON;function yo(){return"XMLHttpRequest"in(0,l.getGlobalThis)()?new XMLHttpRequest:null}function So(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return r=t||{},n=r.method,a=Ie(r,["method"]),i=new _o(a),[4,i.request(e,n)];case 1:return s=o.sent(),[2,s]}})})}var _o=(function(){function e(t){this.req=null,this.resultPromise=Promise.resolve(null),this.init(t||{})}return e.prototype.init=function(t){var r=yo();if(!r)throw new Error("current browser is not support XMLHttpRequest!");this.req=r;var n=t.responseType,a=t.timeout,i=a===void 0?1e4:a,s=t.withCredentials,o=t.headers;r.responseType=n||"json",r.timeout=i,r.withCredentials=!!s,o&&Object.keys(o).forEach(function(d){r.setRequestHeader(d,o[d])});var u=null,c=null;this.resultPromise=new Promise(function(d,v){u=d,c=v});var p=function(){var d=r.response,v=r.status,h=r.statusText,m=r.responseURL;u({data:d,status:v,statusText:h,url:m})},f=function(d){var v=r.status,h=r.statusText,m=r.responseURL;c({msg:d,status:v,statusText:h,url:m})};r.onload=function(){return p()},r.onerror=function(d){return f(d)},r.onabort=function(d){return f(d)},r.ontimeout=function(d){return f(d)},r.onprogress=function(){}},e.prototype.request=function(t,r){return T(this,void 0,Promise,function(){var n;return P(this,function(a){switch(a.label){case 0:if(!this.req)throw new Error("forget init");return this.req.open(r?r.toUpperCase():"GET",t),this.req.send(),[4,this.resultPromise];case 1:return n=a.sent(),[2,n]}})})},e})(),fn=0,Lo="try_detect_latest_ver";function dn(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function wn(e,t){var r="";return(0,l.allowLog)()&&(t&&(fn+=1,r="_".concat(fn)),console.time("".concat(e).concat(r))),r}function kt(e,t){(0,l.allowLog)()&&console.timeEnd("".concat(e).concat(t||""))}function Eo(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,Oe("".concat(t,"/").concat(e,"@latest/").concat(Lo,"_").concat(Date.now()))];case 1:return r=o.sent().url,n=r.split("@"),a=n[n.length-1],i=a.split("/")[0],[2,i];case 2:return s=o.sent(),(0,l.log)("[[ getSemverLatestVer ]] returns ver(latest) due to error:",s.message),[2,"latest"];case 3:return[2]}})})}function Co(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return[4,(0,l.getGlobalThis)().fetch(e)];case 1:return r=o.sent(),n=r.status,a=r.url,[200,304].includes(n)?t?[4,r.json()]:[3,3]:[2,{url:a,reply:null,status:n}];case 2:return i=o.sent(),[2,{url:a,reply:i,status:n}];case 3:return[4,r.text()];case 4:return s=o.sent(),[2,{url:a,reply:s,status:n}]}})})}function Io(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return[4,So(e,{method:"GET",responseType:t?"json":"text"})];case 1:return r=o.sent(),n=r.status,a=r.data,i=r.url,s=i===void 0?"":i,n===400?[2,{url:s,reply:null,status:n}]:[2,{url:s,reply:a,status:n}]}})})}function Oe(e,t){return t===void 0&&(t=!0),T(this,void 0,void 0,function(){var r,n;return P(this,function(a){switch(a.label){case 0:return r=Io,(0,l.getGlobalThis)().fetch&&(r=Co),[4,r(e,t)];case 1:return n=a.sent(),[2,n]}})})}function Rn(e){var t=e.extraCssList,r=t===void 0?[]:t,n=e.custom;if(n){var a=n.extraCssList,i=a===void 0?[]:a,s=n.enable,o=s===void 0?!0:s;if(o){var u=l.commonUtil.merge2List(r,i);return u}}return r.slice()}var jt=l.commonUtil.safeParse,ne={handleSemverRet:function(e,t){var r=e||{},n,a=r.data||r;return t.onlyVersion&&(n=r.version||r.data,a=n),n=n||a.version,!t.isFullVersion&&n&&Reflect.deleteProperty(n,"html_content"),n?{data:a,code:"0",msg:""}:{data:null,code:"404",msg:"no version found"}},appendSearchKV:function(e,t,r){var n=e;return r&&(n+="&".concat(t,"=").concat(r)),n},appendSuffix:function(e,t){var r=e;return t&&(r+=t),r},getSemverApiVal:function(e){var t=e.semverApi;return t===void 0&&(t=!(e.customMetaUrl||e.customMetaJsonpUrl)),t}};function Jt(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u;return P(this,function(c){switch(c.label){case 0:r=null,n=t.semverApi,a=n===void 0?!0:n,i=a?Ne:t.apiMode,s="request ".concat(e),wn(s),c.label=1;case 1:return c.trys.push([1,6,,7]),i!==Ne?[3,3]:[4,Oe(e)];case 2:return o=c.sent(),r=o.reply,[3,5];case 3:return[4,Ao(e)];case 4:r=c.sent(),c.label=5;case 5:return kt(s),a?[2,ne.handleSemverRet(r,t)]:[2,r];case 6:return u=c.sent(),kt(s),[2,{data:null,code:"404",msg:u.message}];case 7:return[2]}})})}function Nn(e){var t=w({},e);return t.additional_scripts=jt(t.additional_scripts,[]),t.additional_body_scripts=jt(t.additional_body_scripts,[]),t}function zt(e){var t=w({},e);return t.src_map=jt(t.src_map,{htmlIndexSrc:"",webDirPath:"",headAssetList:[],bodyAssetList:[],chunkJsSrcList:[],chunkCssSrcList:[],staticJsSrcList:[],staticCssSrcList:[],relativeJsSrcList:[],relativeCssSrcList:[],otherSrcList:[]}),t}function Fn(e,t,r,n){return n===void 0&&(n=!1),T(this,void 0,void 0,function(){var a;return P(this,function(i){switch(i.label){case 0:return a=r,a?[3,3]:n?(a="latest",[3,3]):[3,1];case 1:return[4,Eo(t,e)];case 2:a=i.sent(),i.label=3;case 3:return[2,"".concat(e,"/").concat(t,"@").concat(a,"/hel_dist/hel-meta.json?_t=").concat(Date.now())]}})})}function Qt(e,t){var r=t.versionId,n=t.projectId,a=t.branchId,i=t.apiMode,s=t.isFullVersion,o=s===void 0?!1:s,u=t.versionIdList,c=u===void 0?[]:u,p=t.projectIdList,f=p===void 0?[]:p,d=t.branchIdList,v=d===void 0?[]:d,h=t.loadOptions,m=h===void 0?{}:h,g=ae(t.platform),b=e,y=b,S=r,A=n,C=a,x=!1;Array.isArray(e)&&(b=e[0],y=e.join(","),S=c.join(","),A=f.join(","),C=v.join(","),x=!0);var _=function(q,X){return se(g,q,[m[q],X])},D=function(q,X){return Dn(g,q,X,m[q])},O=_("userLsKey",l.helConsts.DEFAULT_USER_LS_KEY),k=D("getUserName",{platform:g,appName:b,userLsKey:O}),F=D("shouldUseGray",{appName:b}),j=_("apiSuffix"),U="";typeof F=="boolean"&&(U=F?"1":"0");var R=i!==Ne,V="",M="",E=!1;if(x)M=o?Le.BATCH_GET_APP_AND_FULL_VER:Le.BATCH_GET_APP_AND_VER;else{var I=_("customMetaUrl",""),N=_("customMetaJsonpUrl","");I?V=S?"".concat(I,"/").concat(b,"@").concat(S,"?"):"".concat(I,"/").concat(b,"?"):R&&N&&(V=S?"".concat(N,"/").concat(b,"@").concat(S,"?"):"".concat(N,"/").concat(b,"?")),V?E=!0:M=o?Le.GET_APP_AND_FULL_VER:Le.GET_APP_AND_VER}if(!E){var B=_("apiPathOfApp",l.helConsts.DEFAULT_API_URL),Y=Vn(g,m),Z=R?Mn:"",W="".concat(M).concat(Z);V="".concat(Y).concat(B,"/").concat(W,"?name=").concat(y),V=ne.appendSearchKV(V,"version",S)}return V=ne.appendSearchKV(V,"userName",k),V=ne.appendSearchKV(V,"projId",A),V=ne.appendSearchKV(V,"branch",C),V=ne.appendSearchKV(V,"gray",U),V=ne.appendSuffix(V,j),V.endsWith("?")&&(V=V.substring(0,V.length-1)),{url:V,userName:k}}function To(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return r=t.versionId,n=t.platform,a=t.loadOptions,i=Vn(n,a),[4,Fn(i,e,r||"",a?.skip404Sniff)];case 1:return s=o.sent(),[2,s]}})})}function Po(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o;return P(this,function(u){switch(u.label){case 0:return r=t.loadOptions,n=r===void 0?{}:r,a="",i="",s=ne.getSemverApiVal(n),s?[4,To(e,t)]:[3,2];case 1:return i=u.sent(),[3,3];case 2:o=Qt(e,t),i=o.url,a=o.userName,u.label=3;case 3:return[2,{url:i,userName:a}]}})})}function xo(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C;return P(this,function(x){switch(x.label){case 0:return r=t.apiMode,n=t.appName,a=t.isFullVersion,i=a===void 0?!1:a,s=t.semverApi,o=t.customMetaUrl,u=t.apiPrefix,c=u===void 0?"":u,p=t.getUrl,f=ae(t.platform),d=c||se(f,"apiPrefix"),v=se(f,"apiSuffix"),h=se(f,"apiPathOfApp"),m=se(f,"apiPathOfAppVersion"),g="",b=!!o,b?(g="".concat(o,"/").concat(n).concat(e?"@".concat(e):""),[3,4]):[3,1];case 1:return s?[4,Fn(d,n,e)]:[3,3];case 2:return g=x.sent(),[3,4];case 3:y=r===Ne?"":Mn,S=i?Le.GET_APP_FULL_VER:Le.GET_APP_VER,A="".concat(S).concat(y),C=m||h||l.helConsts.DEFAULT_API_URL,g="".concat(d).concat(C,"/").concat(A,"?ver=").concat(e),g=ne.appendSearchKV(g,"name",n),g=ne.appendSuffix(g,v),x.label=4;case 4:return g=p?.(g)||g,[2,g]}})})}function vn(e,t){var r=t;if(dn(r,"app")&&dn(r,"version")&&(r={code:0,data:{app:r.app,version:r.version}}),!r||Number(r.code)!==0)throw new Error(r?.msg||"getSubAppAndItsVersion err`");var n=r.data||{},a=n.app,i=n.version;if(!a)throw new Error("no app for ".concat(e));if(!i)throw new Error("no version for ".concat(e));return{app:Nn(a),version:zt(i)}}function Zt(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C,x=this;return P(this,function(_){switch(_.label){case 0:return r=t.versionId,n=t.branchId,a=t.projectId,i=t.platform,s=t.apiMode,o=t.loadOptions,u=o===void 0?{}:o,c="getSubAppAndItsVersionFn",p="getMeta",f=p,d=rt(i,p,u.getMeta),d||(d=rt(i,c,u.getSubAppAndItsVersionFn),f=c),[4,Po(e,t)];case 1:return v=_.sent(),h=v.url,m=v.userName,g=function(D,O){return T(x,void 0,void 0,function(){var k,F,j,U;return P(this,function(R){switch(R.label){case 0:return k=D||h,F=ne.getSemverApiVal(u),[4,Jt(k,{apiMode:O||s,semverApi:F})];case 1:return j=R.sent(),U=vn(e,j),[2,U]}})})},d?(b=Dn(i,"shouldUseGray",{appName:e},u.shouldUseGray),y={platform:i,appName:e,userName:m,versionId:r,branchId:n,projectId:a,url:h,needGrayVer:b,innerRequest:g},(0,l.log)("[[ ".concat(f," ]] fnParams:"),y),[4,Promise.resolve(d(y))]):[3,3];case 2:return S=_.sent(),A=vn(e,S),[2,A];case 3:return[4,g()];case 4:return C=_.sent(),[2,C]}})})}function Mo(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u,c,p,f,d,v;return P(this,function(h){switch(h.label){case 0:return r=t.apiMode,n=t.isFullVersion,a=n===void 0?!1:n,i=t.semverApi,s=t.customMetaUrl,[4,xo(e,t)];case 1:return o=h.sent(),u=s?!1:i,[4,Jt(o,{apiMode:r,isFullVersion:a,semverApi:u,onlyVersion:!0})];case 2:if(c=h.sent(),p=c.data,f=c.code,d=c.msg,parseInt(f,10)!==0||!p)throw new Error(d||"ver not found");return v=zt(p),[2,v]}})})}function Do(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u,c,p=this;return P(this,function(f){switch(f.label){case 0:return e.length?(r=t.apiMode,n=t.batchGetFn,a=t.semverApi,i=ae(t.platform),[4,Qt(e,t)]):[2,[]];case 1:return s=f.sent().url,o=function(){return T(p,void 0,void 0,function(){var d,v,h,m,g;return P(this,function(b){switch(b.label){case 0:return[4,Jt(s,{apiMode:r,semverApi:a})];case 1:if(d=b.sent(),v=d.data,h=d.code,m=d.msg,parseInt(h,10)!==0||!v)throw new Error(m||"batch get failed");return g=v.map(function(y){return{app:Nn(y.app),version:zt(y.version)}}),[2,g]}})})},u=[],n?(c={url:s,platform:i,innerRequest:o},[4,Promise.resolve(n(c))]):[3,3];case 2:return u=f.sent(),[3,5];case 3:return[4,o()];case 4:u=f.sent(),f.label=5;case 5:return[2,u]}})})}var Ht=l.commonUtil.noop,On=l.commonUtil.okeys;function Vo(){var e=(0,l.getGlobalThis)();e.__HEL_LOAD_ASSETS_FLAG__=1}function kn(e){var t;try{var r=(t=(0,l.getGlobalThis)())===null||t===void 0?void 0:t.document,n=r.querySelector(e);return!!n}catch{return!1}}function jn(e,t){var r=e["data-helex"]||"",n=e["data-helappend"],a=(0,l.getGlobalThis)();if(n==="0")return!1;if(r){var i=r.split(",");if(t==="script"&&i.every(function(o){return!!a[o]}))return!1;var s=kn("".concat(t,'[data-helex="').concat(r,'"]'));return!s}return!0}function er(e,t,r){var n=(0,l.getGlobalThis)().document;On(t).forEach(function(a){return e.setAttribute(a,t[a])}),r?n.body.appendChild(e):n.head.appendChild(e)}function wo(e,t){e.textContent===""?e.textContent=t:e.innerText=t}function tr(e){var t=e.attrs,r=e.innerText,n=e.appendToBody,a=n===void 0?!0:n,i=e.onloadCb,s=i===void 0?Ht:i,o=e.onerrorCb,u=o===void 0?Ht:o,c=t.src,p=Ie(t,["src"]),f=p,d=function(m){return s(m),m};if(!c&&!r)return d(!1);var v=(0,l.getGlobalThis)().document;if(c&&kn('script[src="'.concat(c,'"]'))||!jn(f,"script"))return d(!1);var h=v.createElement("script");return c&&h.setAttribute("src",c),On(f).forEach(function(m){return h.setAttribute(m,f[m])}),h.onload=s,h.onerror=u,r&&wo(h,r),er(h,f,a),!0}function Ut(e){var t=e.appendToBody,r=t===void 0?!1:t,n=e.innerText,a=e.attrs,i=a.href,s=a.rel,o=Ie(a,["href","rel"]),u=o,c=(0,l.getGlobalThis)().document;if(!(!i&&!n)){if(!jn(u,"link"))return!1;var p=c.createElement("link");i?(p.setAttribute("href",i),p.setAttribute("rel",s||"stylesheet")):s&&p.setAttribute("rel",s),n&&(p.innerText=n),er(p,u,r)}}function Ro(e){var t=e.appendToBody,r=t===void 0?!1:t,n=e.innerText,a=n===void 0?"":n,i=e.attrs,s=(0,l.getGlobalThis)().document,o=s.createElement("style");o.innerText=a,er(o,i,r)}function Hn(e){return["link","staticLink","relativeLink"].includes(e.tag)}function Un(e,t){return Ht(t),["script","staticScript","relativeScript"].includes(e)}function hn(e){return e==="staticScript"}function Bn(e,t){var r=e.attrs,n=e.innerText,a=n===void 0?"":n,i=t.appendToBody,s=t.appendCss,o=t.webDirPath,u=t.cssAppendTypes,c=t.excludeCssList,p={appendToBody:i,attrs:r,innerText:a},f=r.href;if(!(f.endsWith(".ico")&&e.append!==!0)){if(f.endsWith(".css")){s&&u.includes(fo(o,f))&&!c.includes(f)&&Ut(p);return}Ut(p)}}function ze(e,t){var r=t.appendToBody;e.forEach(function(n){var a=n.tag,i=n.attrs,s=n.append,o=s===void 0?!0:s,u=n.innerText,c=u===void 0?"":u;if(o){if(Hn(n)){Bn(n,t);return}if(Un(a,i)){tr({appendToBody:r,attrs:i,innerText:c});return}a==="style"&&Ro({appendToBody:r,attrs:i,innerText:c})}})}function Mt(e,t){return T(this,void 0,void 0,function(){var r,n;return P(this,function(a){switch(a.label){case 0:return r=t.appendToBody,n=function(i){return new Promise(function(s,o){var u=i.tag,c=i.attrs,p=i.append,f=p===void 0?!0:p,d=i.innerText,v=d===void 0?"":d;if(!f)return s(!0);if(Hn(i))return Bn(i,t),s(!0);if(Un(u,c)){var h=function(){return s(!0)},m=function(g,b,y,S,A){console.error(g,b,y,S,A);var C=A instanceof Error?A:new Error(String(g));o(C)};return tr({appendToBody:r,attrs:c,innerText:v,onloadCb:h,onerrorCb:m})}s(!0)})},[4,Promise.all(e.map(n))];case 1:return a.sent(),[2]}})})}function No(e){var t=e.assetUrlList,r=e.appendCss,n=e.excludeCssList,a=e.appendToBody;if(t)for(var i=0,s=t;i<s.length;i++){var o=s[i];o.endsWith(".css")?r&&!n.includes(o)&&Ut({appendToBody:a,attrs:{href:o}}):tr({appendToBody:a,attrs:{src:o}})}}function Fo(e,t,r){return T(this,void 0,void 0,function(){var n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C,x,_,D,O,k,F,j,U,R,V,M;return P(this,function(E){switch(E.label){case 0:return Vo(),n=e.additional_scripts,a=n===void 0?[]:n,i=e.additional_body_scripts,s=i===void 0?[]:i,o=t.src_map,u=o.headAssetList,c=u===void 0?[]:u,p=o.bodyAssetList,f=p===void 0?[]:p,d=o.webDirPath,v=o.chunkCssSrcList,h=v===void 0?[]:v,m=r.useAdditionalScript,g=m===void 0?!1:m,b=r.appendCss,y=b===void 0?!0:b,S=r.cssAppendTypes,A=S===void 0?["build","static","relative"]:S,C=r.getExcludeCssList,x=Rn(r),_=l.commonUtil.merge2List(x,h),D=C?.(_,{version:t})||[],O={excludeCssList:D,webDirPath:d,appendCss:y,cssAppendTypes:A,appendToBody:!1},k={excludeCssList:D,webDirPath:d,appendCss:y,cssAppendTypes:A,appendToBody:!0},g?(F=function(I){return I.endsWith(".css")?{tag:"staticLink",attrs:{href:I}}:{tag:"staticScript",attrs:{src:I}}},j=a.map(F),U=s.map(F),[4,Mt(j,O)]):[3,3];case 1:return E.sent(),[4,Mt(U,k)];case 2:E.sent(),E.label=3;case 3:return x.length&&No({assetUrlList:x,excludeCssList:D,appendToBody:!1}),R=[],V=[],M=[],c.forEach(function(I){hn(I.tag)?R.push(I):V.push(I)}),f.forEach(function(I){hn(I.tag)?R.push(I):M.push(I)}),R.length?[4,Mt(R,O)]:[3,5];case 4:return E.sent(),ze(V,O),ze(M,k),[2];case 5:return ze(V,O),ze(M,k),[2]}})})}var Ae={SHADOW:!0,SET_STYLE_AS_STRING:!0,ENABLE_DISK_CACHE:!1,ENABLE_DISK_CACHE_FOR_ERR:!0,ENABLE_SYNC_META:!0,STORAGE_TYPE:"localStorage",ENABLE_APPEND_CSS:!0,API_MODE:"get",EXTRA_DATA_PREFIX:"HelExtraData"},Dt="[[ isEmitVerMatchInputVer ]]";function rr(e,t){var r,n=t.branchId,a=t.platform,i=t.emitVer,s=t.inputVer,o=t.projectId,u=se(a,"strictMatchVer",[t.strictMatchVer]),c=(0,l.getAppMeta)(e,a);if(u===!1)return(0,l.log)("".concat(Dt," set strictMatchVer false for app (").concat(e,"), trust emitVer (").concat(i,") is the target version")),!0;if(!i)return(0,l.log)("".concat(Dt," emitVer should not be null")),!0;if(!s&&c){if(n)return(0,l.log)("".concat(Dt," found branchId ").concat(n)),!0;var p=c.online_version,f=c.build_version;if(o){var d=((r=c.proj_ver)===null||r===void 0?void 0:r.map)||{},v=d[o];if(v)return i===v.b||i===f||i===v.o}return i===p||i===f}return i===s}function Oo(e){var t=(0,l.getGlobalThis)();!l.commonUtil.isServer()&&!t.HelMicro&&((0,l.log)("auto bind hel-micro to global.HelMicro"),t.HelMicro=e)}var Vt=l.helConsts.DEFAULT_ONLINE_VER,mn="http://localhost",gn="http://127.0.0.1",Bt=["script","link","style"];function ko(e){var t=(0,l.getGlobalThis)().DOMParser,r=new t().parseFromString(e,"text/html"),n=[],a=function(i,s,o){i.querySelectorAll(o).forEach(function(u){var c=u.getAttributeNames(),p={};c.forEach(function(f){var d=u.getAttribute(f);d!==null&&(p[f]=d)}),n.push({head:s,tag:o,attrs:p,innerText:u.innerText})})};return Bt.forEach(function(i){return a(r.head,!0,i)}),Bt.forEach(function(i){return a(r.body,!1,i)}),n}var be={isSrcMatchHost:function(e,t){return t.startsWith(mn)||t.startsWith(gn)?e.startsWith(mn)||e.startsWith(gn):e.startsWith(t)},parseHtml:function(e){if((0,l.getGlobalThis)().DOMParser)return ko(e);var t=!0,r=[],n=function(a){return Bt.includes(a)};return un(e,{onTagOpen:function(a){n(a)&&r.push({tag:a,attrs:{},innerText:"",head:t})},onTagClose:function(a,i){if(a==="head"&&(t=!1),!!n(a)){var s=r[r.length-1];if(s){var o=i.children[0]||"";typeof o=="string"&&(s.innerText=o),s.attrs=i.attrs}}}}),r},convertToAssetList:function(e,t){var r=[],n=[],a=[],i=[],s=[],o=[];return e.forEach(function(u){var c=u.head,p=u.attrs,f=u.innerText,d=u.tag,v=c?r:n,h=p.src,m=p.href,g=p["data-helex"],b=p.rel,y=vo(p,"data-helappend","1");if(d==="style")v.push({tag:d,attrs:p,innerText:f,append:!0});else{var S=h||m||"",A=S.endsWith(".css"),C=d==="link";if(!S)return;var x=!0,_=be.isSrcMatchHost(S,t);(b==="icon"||!_&&y!=="1"&&!g)&&(x=!1);var D=d;_||(Pn(S)?(D=C?"relativeLink":"relativeScript",A?s.push(S):o.push(S)):(D=C?"staticLink":"staticScript",A?a.push(S):i.push(S)));var O={tag:D,attrs:p,innerText:f,append:x};v.push(O)}}),{headAssetList:r,bodyAssetList:n,staticCssSrcList:a,staticJsSrcList:i,relativeCssSrcList:s,relativeJsSrcList:o}},getChunkList:function(e){var t=[],r=[];return e.forEach(function(n){var a=n.attrs,i=a.href,s=a.src,o=i||s||"";o&&(o.endsWith(".css")?t.push(o):r.push(o))}),{chunkCssSrcList:t,chunkJsSrcList:r}},extactHelMeta:function(e){var t=e.code,r=e.data,n=e.msg;if(t&&r){if(t!=="0")throw new Error(n||"server error occurred");return r}return e},getHelMeta:function(e,t,r){return T(this,void 0,void 0,function(){var n,a,i,s;return P(this,function(o){switch(o.label){case 0:n=function(u){return u===void 0&&(u=""),"fetch ".concat(e," helmeta by url ").concat(t," failed in custom mode! ").concat(u)},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,Oe(t)];case 2:if(a=o.sent().reply,i=be.extactHelMeta(a),i&&i.app&&i.version)return i.app.__fromCust=!0,[2,i];if(r)throw new Error(n());return(0,l.log)("[[ getCustomMeta ]] 404 is a expected behavior for custom mode, user can ignore it"),[2,null];case 3:if(s=o.sent(),r)throw new Error(n(s.messgae));return l.commonUtil.noop("json parse fail or other error"),[3,4];case 4:return[2]}})})}};function Gn(e){if(e){var t=e.enable,r=t===void 0?!0:t,n=e.host;return!!(n&&r)}return!1}function jo(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p,d,f,d,v,h,m,g,b,y,S,A,C,x,_;return P(this,function(D){switch(D.label){case 0:return r=t.host,n=t.appGroupName,a=t.skipFetchHelMeta,i=a===void 0?!1:a,s=t.isApiUrl,o=t.parseHtml,u=t.attachHostSuffix,c=u===void 0?!0:u,p=Date.now(),s?[4,be.getHelMeta(e,r,!0)]:[3,2];case 1:return d=D.sent(),[2,d];case 2:return i?[3,4]:(f=r.endsWith("hel-meta.json")?r:"".concat(r,"/hel-meta.json?_t=").concat(p),[4,be.getHelMeta(e,f)]);case 3:if(d=D.sent(),d)return[2,d];D.label=4;case 4:v="",D.label=5;case 5:return D.trys.push([5,7,,8]),h=c?"".concat(r,"/index.html?_t=").concat(p):r,[4,Oe(h,!1)];case 6:if(m=D.sent(),v=m.reply||"",![200,304].includes(m.status))throw new Error("status ".concat(m.status));return[3,8];case 7:throw g=D.sent(),new Error("".concat(g.message," from ").concat(r));case 8:return b=o||be.parseHtml,y=b(v),S=be.convertToAssetList(y,r),A=S.headAssetList,C=S.bodyAssetList,x=Ie(S,["headAssetList","bodyAssetList"]),_=be.getChunkList(A.concat(C)),[2,{app:{__fromCust:!0,name:e,app_group_name:n||e,online_version:Vt,build_version:Vt},version:{sub_app_name:e,sub_app_version:Vt,src_map:w(w({webDirPath:r,headAssetList:A,bodyAssetList:C},_),x)}}]}})})}var Kn=l.commonUtil,Ho=l.helConsts,tt=l.log,bn=Ho.KEY_ASSET_CTX,An={recordAssetCtx:function(e,t,r){var n=e.name,a=e.app_group_name,i=t.src_map,s=t.version_tag||t.sub_app_version,o=i.chunkCssSrcList,u=o===void 0?[]:o,c=i.chunkJsSrcList,p=c===void 0?[]:c,f=Ot(r,"beforeAppendAssetNode"),d=u.concat(p),v=r.platform;d.forEach(function(h){var m=(0,l.getCommonData)(bn,h)||{};m.marked||(Object.assign(m,{marked:!0,platform:v,groupName:a,name:n,ver:s,beforeAppend:f}),(0,l.setCommonData)(bn,h,m))})},tryTriggerOnFetchMetaSuccess:function(e,t,r){var n=r.loadOptions,a=r.fromFallback,i=Ot(n,"onFetchMetaSuccess");i?.({app:e,version:t,fromFallback:a})}};function $n(e){var t=rt(e.platform,"onFetchMetaFailed",e.onFetchMetaFailed),r=Ot(e,"onFetchMetaFailed");return r||t}function Uo(e,t){var r=(0,l.getPlatformConfig)(e).apiMode;return t||r}function Yn(e,t){var r=ae(e),n=Uo(r,t);return{platform:r,apiMode:n}}function yn(e,t,r){return T(this,void 0,void 0,function(){var n,a;return P(this,function(i){switch(i.label){case 0:return n=Wt(),a=Xt(e,t,r),n?[4,n.removeItem(a)]:[3,2];case 1:i.sent(),i.label=2;case 2:return nt().removeItem(a),[2]}})})}function Wn(e,t,r){return T(this,void 0,void 0,function(){var n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C,x,_,D,O,k,F,j,U,R,V,M,E,I,N,B,Y,Z=this;return P(this,function(W){switch(W.label){case 0:return n=t.enableDiskCache,a=n===void 0?Ae.ENABLE_DISK_CACHE:n,i=t.enableSyncMeta,s=i===void 0?Ae.ENABLE_SYNC_META:i,o=t.versionId,u=o===void 0?"":o,c=t.projectId,p=c===void 0?"":c,f=t.branchId,d=t.isFullVersion,v=d===void 0?!1:d,h=t.custom,m=t.strictMatchVer,g=t.semverApi,b=(r||{}).callRemote,y=b===void 0?!0:b,S=Yn(t.platform,t.apiMode),A=S.platform,C=S.apiMode,Gn(h)?[4,jo(e,h)]:[3,2];case 1:return x=W.sent(),_=x.app,D=x.version,Fe(_,{appVersion:D,platform:A,toDisk:!1,loadOptions:t}),(0,l.setAppPlatform)(_.app_group_name,A),(0,l.setAppPlatformByAppName)(e,A),[2,{appInfo:_,appVersion:D}];case 2:return O=(0,l.getAppMeta)(e,A),k=(0,l.getVersion)(e,{platform:A,versionId:u}),F=!g&&!f,F&&O&&k&&(j=k.version_tag||k.sub_app_version,rr(e,{platform:A,projectId:p,emitVer:j,inputVer:u,strictMatchVer:m}))?[2,{appInfo:O,appVersion:k}]:(U={platform:A,apiMode:C,versionId:u,projectId:p,branchId:f,isFullVersion:v,loadOptions:t},R=null,V=function(q){return T(Z,void 0,void 0,function(){var X;return P(this,function(te){switch(te.label){case 0:return q?[4,Ko(e,U)]:[3,2];case 1:return X=te.sent(),[2,X];case 2:return[2,null]}})})},a?[4,xn(e,t)]:[3,9]);case 3:return R=W.sent(),R?[3,5]:(tt("[[ getAppFromRemoteOrLocal ]] get meta from disk but failed!"),[4,V(y)]);case 4:return R=W.sent(),[3,8];case 5:return M=R.appInfo,E=R.appVersion,tt("[[ getAppFromRemoteOrLocal ]] disk meta:",R),I=E.version_tag||E.sub_app_version,u&&I!==u?[4,V(y)]:[3,7];case 6:return R=W.sent(),tt("[[ getAppFromRemoteOrLocal ]] remote meta:",R),[3,8];case 7:Fe(M,{appVersion:E,platform:A,toDisk:!1,loadOptions:t}),V(s).catch(function(q){return Kn.noop(q)}),W.label=8;case 8:return[3,11];case 9:return[4,V(y)];case 10:R=W.sent(),W.label=11;case 11:return R&&(N=R.appInfo,B=N.app_group_name,Y=N.name,(0,l.setAppPlatform)(B,A),(0,l.setAppPlatformByAppName)(Y,A)),[2,R]}})})}function Bo(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,o,s,o;return P(this,function(u){switch(u.label){case 0:r=t.isFirstCall,n=r===void 0?!0:r,a=t.enableDiskCacheForErr,i=a===void 0?Ae.ENABLE_DISK_CACHE_FOR_ERR:a,u.label=1;case 1:return u.trys.push([1,3,,6]),[4,Wn(e,t)];case 2:return o=u.sent(),[2,{data:o,err:""}];case 3:if(s=u.sent(),n)throw s;return $n(t)?[2,{data:null,err:s.message}]:(o=null,i?[4,xn(e,t)]:[3,5]);case 4:if(o=u.sent(),!o)throw s;Kn.nbalert(`
13
+ [Dev mode alert err only]: `.concat(s.message,`, hel-micro will try use cached data to keep your app works well,
14
+ please check your network if this behavior is not as you expected! you can also set enableDiskCacheForErr = false
15
+ to skip reusing cached data.
16
+ `)),u.label=5;case 5:return[2,{data:o,err:s}];case 6:return[2]}})})}function Go(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u;return P(this,function(c){switch(c.label){case 0:return r=Yn(t.platform,t.apiMode),n=r.platform,a=r.apiMode,i=w(w({},t),{platform:n,apiMode:a}),[4,Zt(e,i)];case 1:if(s=c.sent(),o=s.app,u=s.version,tt("[[ getAppAndVersion ]] result:",{app:o,version:u}),!u)throw new Error("no version found or builded");return[2,{appInfo:o,appVersion:u}]}})})}function Fe(e,t){var r=t.appVersion,n=t.platform,a=t.toDisk,i=a===void 0?!0:a,s=t.loadOptions;if(!(!e||!r)){var o=e,u=o.name;if(i){var c=Xt(u,s.getCacheKey),p={app:e,version:r};ho(c,p,s.storageType)}if(s.semverApi){var f=(0,l.getAppMeta)(u,n);f?.__setByLatest!==!0&&(o=s.versionId?o:w(w({},o),{__setByLatest:!0}),(0,l.setAppMeta)(o,n))}else(0,l.setAppMeta)(e,n);(0,l.setVersion)(u,r,{platform:n});var d=Rn(s),v=r.version_tag||r.sub_app_version;(0,l.setVerExtraCssList)(u,d,{platform:n,versionId:v})}}function Ko(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s;return P(this,function(o){switch(o.label){case 0:return r=t.platform,n=t.loadOptions,[4,Go(e,t)];case 1:return a=o.sent(),i=a.appInfo,s=a.appVersion,Fe(i,{appVersion:s,platform:r,loadOptions:n}),[2,a]}})})}function qn(e,t){return t===void 0&&(t={}),T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C,x=this;return P(this,function(_){switch(_.label){case 0:r=t.isFirstCall,n=r===void 0?!0:r,a=t.controlLoadAssets,i=a===void 0?!1:a,s=t.platform,o=t.versionId,u=o===void 0?"":o,_.label=1;case 1:return _.trys.push([1,6,,9]),[4,Bo(e,t)];case 2:return c=_.sent(),p=c.data,f=c.err,d=p||{},v=d.appInfo,h=d.appVersion,m=!v||!h,g=!1,m&&!n?(b=$n(t),b?[4,Promise.resolve(b({platform:s,appName:e,versionId:u}))]:[3,4]):[3,4];case 3:y=_.sent(),y&&(v=y.app,h=y.version,g=!0,Fe(v,{appVersion:h,platform:ae(s),toDisk:!1,loadOptions:t})),_.label=4;case 4:if(!v)throw new Error(f||"app[".concat(e,"] not exist"));if(!h)throw new Error(f||"app[".concat(e,"]'s version[").concat(u,"] not exist"));return An.tryTriggerOnFetchMetaSuccess(v,h,{loadOptions:t,fromFallback:g}),An.recordAssetCtx(v,h,t),S=function(){return T(x,void 0,void 0,function(){return P(this,function(D){switch(D.label){case 0:return[4,Fo(v,h,t)];case 1:return D.sent(),[2]}})})},i?[2,S]:[4,S()];case 5:return _.sent(),[2,null];case 6:return A=_.sent(),n?(console.error("loadApp err and try one more time: ",A),[4,qn(e,w(w({},t),{isFirstCall:!1}))]):[3,8];case 7:return C=_.sent(),[2,C];case 8:throw new Error("loadApp [".concat(e,"] err (").concat(A.message,"), recommend config onFetchMetaFailed hook"));case 9:return[2]}})})}function $o(e,t){return T(this,void 0,Promise,function(){var r;return P(this,function(n){switch(n.label){case 0:return[4,Mo(e,t)];case 1:return r=n.sent(),[2,r]}})})}function Yo(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p,f;return P(this,function(d){switch(d.label){case 0:return r=t||{},n=r.versionId,a=r.projectId,i=r.branchId,s=r.platform,o=r.reuseCache,u=o===void 0?!0:o,u&&!n&&!a&&!i&&(p=(0,l.getAppMeta)(e,s),f=(0,l.getVersion)(e,{platform:s}),p&&f&&(c={app:p,version:f})),c?[3,2]:[4,Zt(e,t||{})];case 1:c=d.sent(),d.label=2;case 2:return[2,c]}})})}function Wo(e,t){var r=t||{},n=r.versionId,a=r.platform,i=r.apiMode,s=i===void 0?Ne:i,o=r.protocol,u=o===void 0?"http":o,c=r.projectId,p=r.branchId,f=r.semverApi,d=f===void 0?!0:f,v=Qt(e,{platform:a,versionId:n,branchId:p,apiMode:s,projectId:c,semverApi:d}).url;return u==="http"&&(v=v.replace("https:","http:")),v}function qo(e,t,r){return T(this,void 0,void 0,function(){var n;return P(this,function(a){switch(a.label){case 0:return Array.isArray(e)?(n=[],e.forEach(function(i){return n.push(yn(i,t,r))}),[4,Promise.all(n)]):[3,2];case 1:return a.sent(),[3,4];case 2:return[4,yn(e,t,r)];case 3:a.sent(),a.label=4;case 4:return[2]}})})}var Xn=Object.freeze({__proto__:null,getSubAppVersion:$o,getSubAppMeta:Yo,getMetaDataUrl:Wo,clearDiskCachedApp:qo});function Jn(e,t){var r=(0,l.getVersion)(e,t);return r?.src_map.webDirPath||""}function Ee(e,t){var r=t||{},n=ae(r.platform),a=r.versionId||"";if(!a){var i=(0,l.getVersion)(e,{platform:n});if(i)a=i.version_tag||i.sub_app_version;else{var s=(0,l.getAppMeta)(e,n);a=s?.online_version||s?.build_version||""}}return{platform:n,versionId:a}}function Xo(e,t){var r={static:[],build:[]},n=(0,l.getVersion)(e,t);if(n){var a=n.src_map,i=a.webDirPath,s=a.chunkCssSrcList;s.forEach(function(o){o.startsWith(i)?r.build.push(o):r.static.push(o)})}return r}var Jo=Jn,zn=Object.freeze({__proto__:null,getPlatAndVer:Ee,getGroupedStyleList:Xo,getWebDirPath:Jo}),Sn=l.helConsts.KEY_CSS_STR,nr=l.helLoadStatus,Qn=nr.LOADED,_n=nr.LOADING,zo=nr.NOT_LOAD,Qe=l.commonUtil.merge2List,wt=(0,l.getHelEventBus)(),Rt=l.helEvents.STYLE_STR_FETCHED,ce={isStyleStatusMatch:function(e,t,r){var n=Ee(e,r),a=n.platform,i=n.versionId,s=(0,l.getVerStyleStrStatus)(e,{platform:a,versionId:i});return s===t},getSelfCssList:function(e,t){var r=Ee(e,t),n=(0,l.getVersion)(e,r),a=(0,l.getVerExtraCssList)(e,r),i=[],s=[];if(n){var o=n.src_map||{},u=o.chunkCssSrcList,c=u===void 0?[]:u,p=o.headAssetList,f=p===void 0?[]:p,d=o.bodyAssetList,v=d===void 0?[]:d;i=c;var h=function(g){var b=[];return g.forEach(function(y){var S=y.append,A=S===void 0?!0:S,C=y.attrs.href||"";C.endsWith(".css")&&A&&b.push(C)}),b},m=Qe(h(f),h(v));s=Qe(m,i)}return s=Qe(s,a),{buildCssList:i,initExtraCssList:a,appCssList:s}},fetchStyleStr:function(e){return T(this,void 0,void 0,function(){var t,r,n,a,i,s,o;return P(this,function(u){switch(u.label){case 0:t="",r=0,n=e.length,u.label=1;case 1:if(!(r<n))return[3,7];if(a=e[r],!a.endsWith(".css"))return[3,6];if(i=(0,l.getCommonData)(Sn,a),i)return[3,5];u.label=2;case 2:return u.trys.push([2,4,,5]),[4,Oe(a,!1)];case 3:return s=u.sent(),i=s.reply,(0,l.setCommonData)(Sn,a,i),[3,5];case 4:return o=u.sent(),console.error(o),[3,5];case 5:t+=i,u.label=6;case 6:return r++,[3,1];case 7:return[2,t]}})})},waitStyleReady:function(e,t){return T(this,void 0,void 0,function(){var r;return P(this,function(n){switch(n.label){case 0:return r=null,[4,new Promise(function(a){r=function(i){var s=i.appName,o=i.platform,u=i.versionId,c=t.branchId,p=t.versionId,f=t.platform,d=t.strictMatchVer;s!==e||o!==f||!rr(e,{branchId:c,platform:f,emitVer:u,inputVer:p,strictMatchVer:d})||a(!0)},wt.on(Rt,r)})];case 1:return n.sent(),r&&wt.off(Rt,r),[2]}})})},computeStyleData:function(e,t){var r=Ee(e,t),n=ce.getSelfCssList(e,t),a=n.appCssList,i=n.buildCssList,s=n.initExtraCssList,o=t.extraCssList,u=o===void 0?[]:o,c=t.getExcludeCssList,p=Qe(a,u),f=c?.(p,{version:(0,l.getVersion)(e,r)})||[],d=!f.length&&!u.length,v=p;return f.length&&(v=p.filter(function(h){return!f.includes(h)})),{validCssList:v,onlyUseAppCssList:d,buildCssList:i,initExtraCssList:s,appCssList:a}},fetchStyleData:function(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S;return P(this,function(A){switch(A.label){case 0:return r=Ee(e,t),n=t.extraStyleStr,a=n===void 0?"":n,i=t.cssListToStr,s=t.extraCssList,o=s===void 0?[]:s,u=t.strictMatchVer,c=t.branchId,p=ce.computeStyleData(e,t),f=p.validCssList,d=p.onlyUseAppCssList,v=p.buildCssList,h=p.initExtraCssList,m=p.appCssList,g={validCssList:f,buildCssList:v,initExtraCssList:h,appCssList:m,extraCssList:o,extraStyleStr:a,renderStyleStr:""},i?d?(b=(0,l.getVerStyleStrStatus)(e,r),y="",b!==_n?[3,2]:[4,ce.waitStyleReady(e,w(w({},r),{strictMatchVer:u,branchId:c}))]):[3,6]:[2,g];case 1:return A.sent(),y=(0,l.getAppStyleStr)(e,r)||"",[3,5];case 2:return b!==zo?[3,4]:((0,l.setVerStyleStrStatus)(e,_n,r),[4,ce.fetchStyleStr(m)]);case 3:return y=A.sent(),(0,l.setAppStyleStr)(e,y,r),(0,l.setVerStyleStrStatus)(e,Qn,r),wt.emit(Rt,w({appName:e},r)),[3,5];case 4:y=(0,l.getAppStyleStr)(e,r)||"",A.label=5;case 5:return g.renderStyleStr="".concat(y).concat(a),[3,8];case 6:return[4,ce.fetchStyleStr(f)];case 7:S=A.sent(),g.renderStyleStr="".concat(S).concat(a),A.label=8;case 8:return[2,g]}})})}};function Qo(e,t){return T(this,void 0,Promise,function(){var r;return P(this,function(n){switch(n.label){case 0:return[4,ce.fetchStyleData(e,t||{})];case 1:return r=n.sent(),[2,r]}})})}function Zo(e,t){var r=Ee(e,t),n=(0,l.getAppStyleStr)(e,r);return n}function eu(e,t){var r=ce.getSelfCssList(e,t||{});return r}function tu(e){return T(this,void 0,void 0,function(){var t;return P(this,function(r){switch(r.label){case 0:return[4,ce.fetchStyleStr(e)];case 1:return t=r.sent(),[2,t]}})})}function ru(e,t){return ce.isStyleStatusMatch(e,Qn,t||{})}function nu(e){var t=(0,l.getGlobalThis)();if(t.document){var r=t.document.querySelectorAll('style[data-gname="'.concat(e,'"]'));r.forEach(l.commonUtil.disableNode)}}function au(e){var t=l.commonDataUtil.getStyleTagText(e);return t}function iu(e,t){var r=ar(e,t),n=l.commonDataUtil.getIgnoreCssPrefixCssUrlList(r)||[];return n}function ar(e,t){var r=(t||{}).custom||{},n="",a=r.host,i=r.enable,s=i===void 0?!0:i;if(a&&s)if(a.endsWith(".json")||a.endsWith(".html")){var o=a.split("/"),u=o.length;o.splice(u-1,u),n=o.join("/")}else n=a;else n=Jn(e,t);return n}var Zn=Object.freeze({__proto__:null,fetchAppStyleData:Qo,getAppStyleStr:Zo,getAppCssList:eu,fetchStyleByUrlList:tu,isStyleFetched:ru,disableStyleTags:nu,getStyleTagText:au,getIgnoredCssUrlList:iu,getSuitableCssPrefix:ar});function ea(e,t,r){var n=r.platform,a=(0,l.getAppMeta)(t,n);if(!a){var i=(0,l.getAppMeta)(e,n),s=(0,l.getVersion)(e,r);if(i&&s){(0,l.setAppMeta)(w(w({},i),{name:t,__addedByTrust:!0}),n),(0,l.setVersion)(t,w(w({},s),{sub_app_name:t,__addedByTrust:!0}),{platform:n});var o=(0,l.getVerExtraCssList)(e,r);(0,l.setVerExtraCssList)(t,o,r)}}}function su(e,t,r){var n=r.platform,a=r.emitPlatform,i=r.versionId,s=r.emitVer,o=(0,l.getVerLib)(e,r);if(!o){ea(e,t,r);var u=(0,l.getVerLib)(t,{platform:n,versionId:i});if(!u&&a&&(u=(0,l.getVerLib)(t,{platform:a,versionId:s,strictMatchVer:!1})),!u)throw new Error("seems plat ".concat(a," emit null lib for ").concat(t));return(0,l.libReady)(t,u,{platform:n,appName:e,versionId:i}),!1}return!0}function ou(e,t,r){var n=r.platform,a=r.emitPlatform,i=r.versionId,s=r.emitVer,o=(0,l.getVerApp)(e,r);if(!o){ea(e,t,r);var u=(0,l.getVerApp)(t,{platform:n,versionId:i});if(!u&&a&&(u=(0,l.getVerApp)(t,{platform:a,versionId:s,strictMatchVer:!1})),!u)throw new Error("seems plat ".concat(a," emit null app for ").concat(t));return Yt(w(w({},u),{platform:n,appGroupName:t,appName:e,versionId:i})),!1}return!0}function ir(e,t){var r=t.versionId,n=r===void 0?"":r,a=t.isLib,i=ae(t.platform),s=se(i,"strictMatchVer",[t.strictMatchVer]),o=w(w({},t),{strictMatchVer:s}),u=e,c=t.custom;Gn(c)&&(u=c.appGroupName||e,o.strictMatchVer=!1);var p=(0,l.getAppMeta)(u,i);if(t.semverApi&&!n&&p&&p.__setByLatest!==!0)return null;if(a){var f=(0,l.getVerLib)(u,o),d={appName:u,appGroupName:p?.app_group_name||"",platform:i,appProperties:f,isLib:!0,versionId:n,Comp:null,lifecycle:void 0};return f?d:null}var v=(0,l.getVerApp)(u,o);return v||null}function ta(e,t,r){var n="[[ judgeAppReady ]]",a=t.versionId,i=a===void 0?"":a,s=t.projectId,o=t.appName,u=t.platform,c=t.next,p=t.error,f=t.isLib,d=t.strictMatchVer;(0,l.log)("".concat(n," receive emit app and judge (emitAppInfo, judgeOptions):"),e,{inputVer:i,projectId:s,appName:o,platform:u,isLib:f,strictMatchVer:d});var v=ae(u),h=e.appName,m=e.appGroupName,g=e.platform,b=g===void 0?v:g,y=e.versionId,S="".concat(u,"/").concat(o,"/").concat(i),A=(0,l.getAppMeta)(o,u),C=r.branchId,x=r.custom,_=r.trust,D=function(Y){try{var Z=f?su(o,m,Y):ou(o,m,Y);return Z}catch(W){return p(W),!1}};if(x){var O=x.enable,k=O===void 0?!0:O,F=x.host,j=x.appGroupName,U=x.trust,R=U===void 0?!1:U,V=function(){return m&&(m===o||m===j)};if(k&&F){(0,l.log)("".concat(n," judge for custom:"),x);var M=function(Y){(0,l.log)("".concat(n," custom conf ").concat(Y?"":"mis","match current emit app!")),Y&&c()};if(!R)return M(V());var E=D({versionId:i,platform:v,emitPlatform:b,emitVer:y});return M(E)}}if(d===!1&&m&&A?.app_group_name===m&&v===b)return(0,l.log)("".concat(n," treat emitApp as wanted when strictMatchVer is false (appInfo):"),e),c();var I=function(){return(0,l.log)("".concat(n," still wait ").concat(S," to be emitted (emitAppInfo,toMatch):"),e,N)},N={branchId:C,platform:u,emitVer:y,inputVer:i,projectId:s,strictMatchVer:d};if(o!==h||!rr(o,N))return I();var B=se(v,"trustAppNames",[null,[]],{emptyArrIsNull:!1});if(v!==b&&(_||B.includes(o))){var E=D({versionId:i,platform:v,emitPlatform:b,emitVer:y});if(!E)return(0,l.log)("".concat(n," transfer ").concat(b," app [").concat(o,"] to ").concat(v," plat due to being in trustAppNames")),I()}c()}var ra=Object.freeze({__proto__:null,getLibOrApp:ir,judgeAppReady:ta});function na(e){var t=e.platform,r=Ie(e,["platform"]);(0,l.initPlatformConfig)(r,t)}function aa(){return(0,l.isSubApp)()}function Gt(e){if(e&&!e.default)try{e.default=e}catch{}return e}function it(e){var t=(0,l.getGlobalThis)();Object.keys(e).forEach(function(r){var n=e[r];n&&(t[r]=n)})}function ia(e){var t=Gt(e.React),r=Gt(e.ReactDOM),n=e.ReactIs||null,a=e.ReactReconciler||null,i={LEAH_React:t,LEAH_ReactDOM:r,LEAH_ReactIs:n,LEAH_ReactReconciler:a,React:t,ReactDOM:r,ReactIs:n,ReactReconciler:a};it(i)}function sa(e){var t=Gt(e.Vue),r={LEAH_Vue:t,Vue:t};it(r)}function oa(e){return"".concat(Ae.EXTRA_DATA_PREFIX,".").concat(e)}function ua(e,t){var r,n,a=t??!1,i=(n=(r=(0,l.getGlobalThis)().localStorage)===null||r===void 0?void 0:r.getItem(oa(e)))!==null&&n!==void 0?n:null;return i?a?JSON.parse(i):i:null}function ca(e,t,r){var n,a=r??!1,i=a?JSON.stringify(t):t;(n=(0,l.getGlobalThis)().localStorage)===null||n===void 0||n.setItem(oa(e),i)}function Ln(e){var t;return typeof e=="string"?(t=(0,l.getGlobalThis)())===null||t===void 0?void 0:t.document.getElementById(e):e}function la(e,t){return{name:e,platform:t?.platform||(0,l.getAppPlatform)(e),versionId:t?.versionId||"",getShadowAppRoot:Ln,getShadowBodyRoot:Ln}}var Nt=l.commonUtil.getObjsVal,uu=l.commonUtil.purify,cu=Ae.ENABLE_DISK_CACHE,lu=Ae.ENABLE_SYNC_META,pu=Ae.STORAGE_TYPE,Kt="preFetchLib",fu="preFetchApp",Ce="preFetch";function pa(e,t){var r=typeof t=="string"?{versionId:t}:w({},t||{});r.platform=ae(r.platform),r.isLib=e;var n=r.platform;return r.strictMatchVer=se(n,"strictMatchVer",[r.strictMatchVer]),r.storageType=r.storageType||"indexedDB",r.semverApi=se(n,"semverApi",[r.semverApi]),r}function du(e,t,r){if(r.shadow){if(!t)return;var n=ar(e,r);l.commonDataUtil.setIgnoreCssPrefix(n),l.commonDataUtil.setIgnoreStyleTagKey(e),l.commonDataUtil.setIgnoreStyleTagKey(t),l.commonDataUtil.setIgnoreCssPrefixKey(n,t)}}function En(e,t,r){return T(this,void 0,void 0,function(){var n,a,i,s,o,u,c,p,f,d;return P(this,function(v){switch(v.label){case 0:return n=(0,l.getHelEventBus)(),a=t.platform,i=t.isLib,s=i===void 0?!1:i,o=t.versionId,u=t.projectId,c=t.strictMatchVer,p=s?l.helEvents.SUB_LIB_LOADED:l.helEvents.SUB_APP_LOADED,f=null,[4,new Promise(function(h,m){if(f=function(b){ta(b,{appName:e,platform:a,versionId:o,projectId:u,isLib:s,next:h,error:m,strictMatchVer:c},t)},n.on(p,f),r){var g=(0,l.getAppMeta)(e,a);g&&du(e,g.app_group_name,t),r().catch(m)}})];case 1:return v.sent(),f&&n.off(p,f),d=ir(e,t),[2,d]}})})}function fa(e,t){return T(this,void 0,void 0,function(){var r,n,a,i,s,o,u;return P(this,function(c){switch(c.label){case 0:r=null,n=t.versionId,a=t.isLib,i=a?Kt:fu,c.label=1;case 1:return c.trys.push([1,7,,8]),r=ir(e,t),r&&(!n||n&&r.versionId===n)?((0,l.log)("[[ ".concat(i," ]] return cached app:"),e,t),[2,{emitApp:r,msg:""}]):(s=null,o=(0,l.getVerLoadStatus)(e,t),o!==l.helLoadStatus.LOADED?[3,3]:[4,En(e,t)]);case 2:return r=c.sent(),(0,l.log)("[[ ".concat(i," ]] return emit app:"),e,t,r),[2,{emitApp:r,msg:""}];case 3:return o===l.helLoadStatus.LOADING?[3,5]:((0,l.setVerLoadStatus)(e,l.helLoadStatus.LOADING,t),[4,qn(e,w(w({},t),{controlLoadAssets:!0}))]);case 4:s=c.sent(),(0,l.perfPeek)(Ce,"loadApp"),c.label=5;case 5:return[4,En(e,t,s)];case 6:return r=c.sent(),(0,l.perfPeek)(Ce,"waitAppEmit"),(0,l.log)("[[ ".concat(i," ]] return fetch&emit app:"),e,t,r),[2,{emitApp:r,msg:""}];case 7:return u=c.sent(),console.error(u),(0,l.setVerLoadStatus)(e,l.helLoadStatus.NOT_LOAD,t),[2,{emitApp:r,msg:u.message}];case 8:return[2]}})})}function sr(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p;return P(this,function(f){switch(f.label){case 0:return(0,l.perfMark)(Ce),r="".concat(Kt,"(").concat(e,")"),n=wn(r,!0),a=pa(!0,t),[4,fa(e,a)];case 1:if(i=f.sent(),s=i.emitApp,o=i.msg,u=s?.appProperties,!u&&a.onLibNull&&(c=a.onLibNull(e,{versionId:a.versionId}),c&&(u=c)),kt(r,n),(0,l.perfPeek)(Ce,"end",!0),!u)throw p=o?" details : ".concat(o):"",new Error("".concat(Kt," ").concat(e," fail from ").concat(a.platform,", it may be an invalid module!").concat(p));return[2,u]}})})}function da(e,t){return T(this,void 0,void 0,function(){var r,n;return P(this,function(a){switch(a.label){case 0:return(0,l.perfMark)(Ce),r=pa(!1,t),[4,fa(e,r)];case 1:return n=a.sent(),(0,l.perfPeek)(Ce,"end",!0),[2,n?.emitApp||null]}})})}function va(e,t){return T(this,void 0,Promise,function(){var r,n,a,i,s,o,u,c,p,f,d,v,h,m,g,b,y,S,A,C,x,_,D,O,k;return P(this,function(F){switch(F.label){case 0:if(r=t?.preFetchConfigs||{},n=w({semverApi:!1},t?.common||{}),a=ae(n.platform),i=n.versionIdList,s=i===void 0?[]:i,o=n.projectIdList,u=o===void 0?[]:o,c=n.branchIdList,p=c===void 0?[]:c,f=[],d=[],v=[],e.length>8)throw new Error("only support 8 appName at most!");h=[],m=[],g={},b=[];for(y in e)b.push(y);S=0,F.label=1;case 1:return S<b.length?(A=b[S],C=e[A],x=r[C],_={platform:a,versionId:s[A]||"",projectId:u[A]||"",branchId:p[A]||""},typeof x=="string"&&x?_.versionId=x:typeof x=="object"&&x&&(_=w(w({},_),uu(x)),_.platform=a),g[C]=_,_.enableDiskCache=Nt([_,n],"enableDiskCache",cu),_.enableSyncMeta=Nt([_,n],"enableSyncMeta",lu),_.storageType=Nt([_,n],"storageType",pu),[4,Wn(C,_,{callRemote:!1})]):[3,4];case 2:D=F.sent(),D||(m.push(C),f[A]=_.versionId||"",d[A]=_.projectId||"",v[A]=_.branchId||""),F.label=3;case 3:return S++,[3,1];case 4:return n.versionIdList=f,n.projectIdList=d,n.branchIdList=v,n.semverApi?[4,Promise.all(m.map(function(j){return Zt(j,g[j])}))]:[3,6];case 5:return h=F.sent(),[3,8];case 6:return[4,Do(m,n)];case 7:h=F.sent(),F.label=8;case 8:return h.forEach(function(j){var U=j.app,R=j.version,V=g[U.name]||{};Fe(U,{appVersion:R,platform:a,toDisk:V.enableDiskCache,loadOptions:V})}),O=e.map(function(j){return sr(j,g[j])}),[4,Promise.all(O)];case 9:return k=F.sent(),[2,k]}})})}var vu=Object.freeze({__proto__:null,core:$t,VER:In,emitApp:Yt,getAppCacheKey:at,getCachedAppMeta:qt,appMetaSrv:Xn,appParamSrv:zn,appStyleSrv:Zn,logicSrv:ra,init:na,isSubApp:aa,bindExternals:it,bindReactRuntime:ia,bindVueRuntime:sa,getExtraData:ua,setExtraData:ca,getFakeHelContext:la,batchPreFetchLib:va,preFetchApp:da,preFetchLib:sr}),Ze=l.commonUtil.purify,hu=(0,l.getUserEventBus)(),mu=["eventBus","getExtraData","setExtraData","bindExternals","bindVueRuntime","bindReactRuntime","isSubApp"],et={ignoreFns:["tryGetAppName","log","commonUtil","getCommonData","setCommonData","setGlobalThis"],arg1PlatFns:["getPlatformConfig","getSharedCache"],arg2PlatFns:["initPlatformConfig","getAppMeta","setAppMeta","tryGetVersion","setAppPlatform"],arg2PlatObjFns:[]},gu=["preFetchLib","preFetchApp"],bu=["getSubAppMeta","getMetaDataUrl"],Au=["emitApp","init"],yu=["getAppCacheKey"];function Su(e,t){var r=this,n=t.fnName,a=t.fn,i=t.isCore,s=t.preFetchOptions;return function(){for(var o=[],u=0;u<arguments.length;u++)o[u]=arguments[u];var c=function(y){return w({platform:e},Ze(y||{}))},p=o[0],f=o[1],d=o[2];if(i){if(n==="getPlatform")return e;et.arg1PlatFns.includes(n)?o[0]=p||e:et.arg2PlatFns.includes(n)?o[1]=f||e:et.arg2PlatObjFns.includes(n)?o[1]=c(f):et.ignoreFns.includes(n)||(n.startsWith("set")?o[2]=c(d):o[1]=c(f))}else if(n==="batchPreFetchLib"){var v=f||{},h=c(v.common);o[1]=w(w({},v),{common:h})}else if(gu.includes(n)){var m=Ze(typeof f=="string"?{versionId:f}:f||{});s&&(m=Ze(w(w({},s),m))),o[1]=w({platform:e},m)}else if(bu.includes(n)){var g=(s||{}).semverApi,b=g===void 0?!0:g;o[1]=c(w({semverApi:b},Ze(f||{})))}else Au.includes(n)?o[0]=c(p):yu.includes(n)?o[1]=f||e:o[1]=c(f);return a.apply(r,o)}}function ha(e,t,r){var n=r.preFetchOptions,a=r.isCore,i={};return Object.keys(t).forEach(function(s){var o=t[s];if(mu.includes(s)){i[s]=o;return}var u=typeof o;if(u==="function"){var c={fnName:s,fn:o,isCore:a,preFetchOptions:n};i[s]=Su(e,c);return}if(o&&u==="object"){var p=w(w({},r),{isCore:s==="core"});i[s]=ha(e,o,p);return}i[s]=o}),i}function or(e,t){var r=ha(e,vu,{preFetchOptions:t});return r.createInstance=or,r.createOriginInstance=ma,r.resetGlobalThis=l.resetGlobalThis,r.eventBus=hu,r.default=r,r}function ma(e,t){var r=t||{},n=r.trustAppNames,a=Ie(r,["trustAppNames"]);return(0,l.originInit)(e,t),or(e,a)}var ga=In,_u=sr,Lu=da,Eu=va,Cu=Zn,Iu=zn,Tu=Xn,Pu=ra,xu=Yt,Mu=na,Du=aa,Vu=at,wu=qt,Ru=la,Nu=ua,Fu=ca,Ou=it,ku=sa,ba=ia,ju=$t,Hu=l.resetGlobalThis,Uu=or,Bu=ma,Gu=(0,l.getUserEventBus)();ju.log("hel-micro ver ".concat(ga));var Aa={VER:ga,preFetchLib:_u,preFetchApp:Lu,batchPreFetchLib:Eu,appStyleSrv:Cu,appParamSrv:Iu,appMetaSrv:Tu,logicSrv:Pu,emitApp:xu,eventBus:Gu,init:Mu,isSubApp:Du,getAppCacheKey:Vu,getCachedAppMeta:wu,getFakeHelContext:Ru,getExtraData:Nu,setExtraData:Fu,bindExternals:Ou,bindVueRuntime:ku,bindReactRuntime:ba,resetGlobalThis:Hu,core:$t,createInstance:Uu,createOriginInstance:Bu};Oo(Aa);l.commonUtil.noop(Cn.default);var ur=Aa;var ke=He(Ea(),1);var Yu=`
17
+ [data-hel-loading] { position:fixed; inset:0; z-index:2147483647; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:22px; margin:0; background:var(--hel-loading-background,#f8fafc); color:var(--hel-loading-color,#2563eb); font:15px/1.6 system-ui,sans-serif; }
18
+ [data-hel-loading] .hel-loading-shapes { display:grid; grid-template-columns:repeat(2,18px); gap:7px; }
19
+ [data-hel-loading] .hel-loading-square { box-sizing:border-box; width:18px; height:18px; border:3px solid currentColor; border-radius:3px; animation:hel-loading-morph 1.8s ease-in-out infinite; }
20
+ [data-hel-loading] .hel-loading-square:nth-child(2) { animation-delay:.15s; }
21
+ [data-hel-loading] .hel-loading-square:nth-child(3) { animation-delay:.3s; }
22
+ [data-hel-loading] .hel-loading-square:nth-child(4) { animation-delay:.45s; }
23
+ [data-hel-loading] .hel-loading-text { max-width:80vw; text-align:center; white-space:pre-wrap; overflow-wrap:anywhere; }
24
+ @keyframes hel-loading-morph { 50% { transform:rotate(180deg) scale(.55); border-radius:50%; } 100% { transform:rotate(360deg); } }
25
+ @media (prefers-reduced-motion:reduce) { [data-hel-loading] .hel-loading-square { animation:none; } }
26
+ `;function cr(e={}){if(e===!1||typeof document>"u")return()=>{};let t=e===!0?{}:e,r=document.body||document.documentElement;if(!r)return()=>{};let n=document.createElement("div");n.setAttribute("data-hel-loading",""),n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-busy","true"),t.background&&n.style.setProperty("--hel-loading-background",t.background),t.color&&n.style.setProperty("--hel-loading-color",t.color);let a=document.createElement("style");a.textContent=Yu;let i=document.createElement("div");i.className="hel-loading-shapes",i.setAttribute("aria-hidden","true");for(let o=0;o<4;o++){let u=document.createElement("span");u.className="hel-loading-square",i.appendChild(u)}let s=document.createElement("div");return s.className="hel-loading-text",s.textContent=t.text!=null?t.text:"\u6B63\u5728\u52A0\u8F7D\u5E94\u7528\u2026",n.appendChild(a),n.appendChild(i),n.appendChild(s),r.appendChild(n),()=>n.remove()}var{preFetchLib:Wu}=ur,{HEL_BASES:lc}=ke.default;function lr(e){try{return ke.default.packageRef(e)}catch(t){throw Q(t.message)}}var fe=class extends Error{constructor({moduleName:t,host:r,phase:n,message:a,missingExports:i=[],cause:s}){super(a,{cause:s}),this.name="HelLoadError",this.moduleName=t,this.host=r,this.phase=n,this.missingExports=i,this.cause=s}};function Q(e,t="",r=""){return new fe({moduleName:t,host:r,phase:"config",message:"[hel-loader] "+e})}function pr(e){let t;try{t=new URL(e)}catch{throw Q("\u9700\u8981\u7EDD\u5BF9 HTTP(S) \u5730\u5740\uFF1A"+e)}if(!/^https?:$/.test(t.protocol))throw Q("\u4E0D\u652F\u6301\u7684\u5730\u5740\u534F\u8BAE\uFF1A"+e);return t}function Ia(e){return/\/hel-meta\.json$/i.test(pr(e.trim()).pathname)}function vr(e,t={}){if(e&&typeof e=="object"){if(typeof e.name!="string"||!e.name.trim()||typeof e.host!="string")throw Q("\u663E\u5F0F\u4F9D\u8D56\u9700\u8981 name \u548C host");return pr(e.host),{...e,name:e.name.trim()}}if(typeof e!="string"||!e.trim())throw Q("\u4F9D\u8D56\u5FC5\u987B\u662F\u5305\u5F15\u7528\u3001URL \u6216\u663E\u5F0F\u4F9D\u8D56\u5BF9\u8C61");let r=e.trim(),n=t.type||"unpkg";if(!["custom","unpkg","github"].includes(n))throw Q("\u672A\u77E5\u52A0\u8F7D\u7C7B\u578B\uFF1A"+n);let a,i;if(/^https?:\/\//i.test(r)){a=pr(r);let o=a.pathname.replace(/\/+$/,"").replace(/\/(?:(?:hel_dist|dist)(?:\/(?:hel-meta\.json|index\.html))?|hel-meta\.json|index\.html)$/i,"");i=lr(decodeURIComponent(o.split("/").pop()||""))}else{i=lr(r.replace(/^\//,""));try{a=ke.default.packageUrl(i,{...t,type:n})}catch(o){throw Q(o.message)}}let s=a.pathname.replace(/\/+$/,"");if(a.pathname=s,!/\/(?:hel-meta\.json|index\.html)$/i.test(s)){let o=/\/(hel_dist|dist)$/i.exec(s),u=o?o[1].toLowerCase():/^(?:tpl|demo)-/.test(i.name)?"dist":"hel_dist";a.pathname=s+(o?"":"/"+u)+(u==="dist"?"/index.html":"/hel-meta.json")}return{name:i.name,host:a.href}}function Ca(e){let t=e.name.split("/").pop();return t.startsWith("libs-")?0:t.startsWith("comps-")?1:2}function qu(e){if(!e||!Array.isArray(e.deps))throw Q("\u9884\u52A0\u8F7D\u9700\u8981 deps \u6570\u7EC4");let t=e.deps.map(n=>vr(n,e)),r=new Map;for(let n of t){let a=Ta(n),i=Pa(n);if(r.has(a)&&r.get(a)!==i)throw Q("\u540C\u4E00\u6A21\u5757\u4E0D\u80FD\u914D\u7F6E\u591A\u4E2A\u5730\u5740\u6216\u7248\u672C\uFF1A"+n.name,n.name,n.host);r.set(a,i)}return t.sort((n,a)=>Ca(n)-Ca(a))}function fr(e,t,r,n=[]){if(!r||typeof r!="object"&&typeof r!="function")throw new fe({moduleName:e,host:t,phase:"ready",message:"[hel-loader] "+e+" \u672A\u8FD4\u56DE\u8FDC\u7A0B\u6A21\u5757\u5BF9\u8C61"});let a=n.filter(i=>!(i in r)||r[i]==null);if(a.length)throw new fe({moduleName:e,host:t,phase:"exports",missingExports:a,message:"[hel-loader] "+e+" \u7F3A\u5C11\u5BFC\u51FA\uFF1A"+a.join(", ")})}function Xu(e,t){let r=e&&e.version&&e.version.src_map;if(!r||!Ia(t))return;let n=new URL(".",t).href,a=String(r.webDirPath||"").replace(/\/+$/,""),i=s=>{if(typeof s!="string"||!s||/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(s))return s;let o=a&&s.startsWith(a+"/")?new URL(s.slice(a.length+1),n).href:new URL(a?s:s.replace(/^\/+/,""),n).href;if(typeof document<"u"&&document.baseURI){let u=ur.core,c=new URL(s,document.baseURI).href;u.setCommonData(u.helConsts.KEY_ASSET_CTX,c,{marked:!0,beforeAppend:({setAssetUrl:p})=>{p(o)}})}return o};for(let[s,o]of Object.entries(r))if(s==="headAssetList"||s==="bodyAssetList")for(let u of o||[])for(let c of["src","href"])u.attrs&&u.attrs[c]&&(u.attrs[c]=i(u.attrs[c]));else s.endsWith("List")&&Array.isArray(o)?r[s]=o.map(i):s!=="webDirPath"&&/(?:Path|Src|Index)$/.test(s)&&(r[s]=i(o));/^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(a)||(r.webDirPath=n.replace(/\/$/,""))}function hr(e){return{...e.platform?{platform:e.platform}:{},hook:{onFetchMetaSuccess:t=>Xu(t,e.host)},custom:{skipFetchHelMeta:!Ia(e.host),enable:!0,trust:!0,...e.custom||{},host:e.host,appGroupName:e.appGroupName||e.custom&&e.custom.appGroupName||e.name}}}function Ta(e){let t=hr(e);return JSON.stringify([e.platform||"",t.custom.appGroupName||e.name])}function dr(e){return Array.isArray(e)?e.map(dr):e&&typeof e=="object"?Object.fromEntries(Object.keys(e).sort().map(t=>[t,dr(e[t])])):e}function Pa(e){return JSON.stringify(dr([e.name,hr(e)]))}function Ju(e=Wu){let t=new Map,r=Promise.resolve();function n(s,o={}){let u,c,p;try{u=vr(s,o),c=Ta(u),p=Pa(u)}catch(v){return Promise.reject(v)}let f=t.get(c);if(f&&f.key!==p)return Promise.reject(Q("\u6A21\u5757\u5DF2\u4F7F\u7528\u53E6\u4E00\u5730\u5740\u6216\u7248\u672C\u52A0\u8F7D\uFF1A"+u.name,u.name,u.host));let d=f&&f.promise;return d||(d=r.then(async()=>{try{let v=await e(u.name,hr(u));return fr(u.name,u.host,v),v}catch(v){throw v instanceof fe?v:new fe({moduleName:u.name,host:u.host,phase:"assets",cause:v,message:"[hel-loader] "+u.name+" \u52A0\u8F7D\u5931\u8D25\uFF1A"+(v instanceof Error?v.message:String(v))})}}),t.set(c,{key:p,promise:d}),r=d.then(()=>{},()=>{t.delete(c)})),d.then(v=>(fr(u.name,u.host,v,u.requiredExports),v))}async function a(s){let o=[];for(let u of s)o.push(await n(u));return o}async function i(s){let o=qu(s),u=Object.create(null);if(s.loadApp!==void 0&&typeof s.loadApp!="function")throw Q("loadApp \u5FC5\u987B\u662F\u51FD\u6570");let c=s.loading&&(o.length||s.loadApp)?cr(s.loading):()=>{};try{for(let p of o)u[p.name]=await n(p);return s.loadApp&&await s.loadApp(),u}finally{c()}}return{loadHelLib:n,loadHelLibsSerial:a,preloadHelLibs:i}}var zu=Ju(),{loadHelLib:Qu,loadHelLibsSerial:pc,preloadHelLibs:fc}=zu;async function Zu(e){let t=e.dep?vr(e.dep,e):null,r=t?t.name:"remote",n=t?t.host:"";if(!e.exportName||typeof e.exportName!="string")throw Q("\u7EC4\u4EF6\u9700\u8981 exportName");if(!t&&typeof e.loader!="function")throw Q("\u7EC4\u4EF6\u9700\u8981 dep \u6216 loader");let a=e.loader?await e.loader():await Qu(t);fr(r,n,a,[e.exportName]);let i=a[e.exportName];if(typeof i!="object"&&typeof i!="function")throw new fe({moduleName:r,host:n,phase:"exports",missingExports:[e.exportName],message:"[hel-loader] "+e.exportName+" \u4E0D\u662F\u53EF\u7528\u7684\u7EC4\u4EF6\u5BFC\u51FA"});return i}function dc(e,t=()=>{}){let r=0,n=!1,a={status:"loading",component:null,error:null},i=u=>{a=u,t(u)};function s(u){n||(r++,i({status:"error",component:null,error:u}),e.onError&&e.onError(u))}async function o(){if(n)return;let u=++r;i({status:"loading",component:null,error:null});try{let c=await Zu(e);!n&&u===r&&i({status:"ready",component:c,error:null})}catch(c){!n&&u===r&&s(c)}}return{getState:()=>a,load:o,retry:o,fail:s,dispose:()=>{n=!0,r++}}}function vc({packageName:e,target:t,version:r="",projectName:n,baseUrl:a=""}){let i=lr(e);i.version=r;let s=ke.default.packageUrl(i,{type:t==="sftp"?"custom":t,base:a,projectName:t==="unpkg"?void 0:n,versioned:t==="unpkg"});return s.pathname+="/hel_dist/hel-meta.json",s.href}export{lc as HEL_BASES,fe as HelLoadError,fr as assertHelExports,ba as bindReactRuntime,dc as createHelComponentResource,Ju as createHelLoader,Ia as isHelMetaHost,Zu as loadHelComponent,Qu as loadHelLib,pc as loadHelLibsSerial,fc as preloadHelLibs,vr as resolveHelDep,qu as resolveHelDeps,vc as resolveHelHost,cr as showHelLoading};
27
+ /*! Bundled license information:
28
+
29
+ hel-lib-proxy/dist/hel-lib-proxy.min.js:
30
+ (*! *****************************************************************************
31
+ Copyright (c) Microsoft Corporation.
32
+
33
+ Permission to use, copy, modify, and/or distribute this software for any
34
+ purpose with or without fee is hereby granted.
35
+
36
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
37
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
38
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
39
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
40
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
+ PERFORMANCE OF THIS SOFTWARE.
43
+ ***************************************************************************** *)
44
+
45
+ hel-micro/es/index.js:
46
+ (*! *****************************************************************************
47
+ Copyright (c) Microsoft Corporation.
48
+
49
+ Permission to use, copy, modify, and/or distribute this software for any
50
+ purpose with or without fee is hereby granted.
51
+
52
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
53
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
54
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
55
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
56
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
57
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
58
+ PERFORMANCE OF THIS SOFTWARE.
59
+ ***************************************************************************** *)
60
+ */
@@ -0,0 +1,28 @@
1
+ export interface DocumentationEvent { name: string; type?: string; description?: string }
2
+ export interface ComponentDocumentation {
3
+ description?: string
4
+ requirements?: string[]
5
+ events?: Array<DocumentationEvent | string>
6
+ code?: string
7
+ }
8
+ export interface DocumentationSchema { name: string; type?: string; default?: unknown; required?: boolean | string; description?: string; isEvent?: boolean }
9
+ export interface DocumentationOptions extends ComponentDocumentation {
10
+ libName?: string
11
+ exportName?: string
12
+ remoteDep?: { platform?: string }
13
+ name?: string
14
+ schema?: DocumentationSchema[]
15
+ values?: Record<string, unknown>
16
+ framework?: 'vue2' | 'vue3' | 'react'
17
+ slotHtml?: Record<string, string>
18
+ models?: Array<{ prop: string; event: string }>
19
+ }
20
+ export function buildComponentDocs(options?: DocumentationOptions): {
21
+ name: string
22
+ props: Array<{ name: string; type: string; default: string; required: boolean; description: string }>
23
+ events: Array<{ name: string; type: string; description: string }>
24
+ description: string
25
+ requirements: string[]
26
+ code: string
27
+ }
28
+ export function componentEvents(component: unknown, listeners?: Record<string, unknown>): string[]
@@ -0,0 +1,58 @@
1
+ const C=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),b=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),y=t=>"on"+t.replace(/(^|[^a-zA-Z0-9])([a-zA-Z0-9])/g,(i,u,r)=>r.toUpperCase()),R=t=>String(t).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/\n/g,"&#10;");function m(t){if(typeof t=="function")return"() => {}";if(t===void 0)return"undefined";try{const i=JSON.stringify(t,(u,r)=>typeof r=="function"?void 0:typeof r=="bigint"?String(r):r);return i===void 0?"undefined":i}catch{return"undefined /* \u8BF7\u63D0\u4F9B\u53EF\u5E8F\u5217\u5316\u7684\u503C */"}}function _({name:t="Component",schema:i=[],values:u={},framework:r="vue3",events:l=[],slotHtml:d={},description:A="",requirements:x=[],code:f,models:c=[],libName:s,exportName:$=t,remoteDep:V={}}={}){const S=i.filter(n=>!n.isEvent).map(n=>({name:n.name,type:n.type||"unknown",default:n.default===void 0||n.default===""?"\u2014":String(n.default),required:n.required===!0||n.required==="true",description:n.description||"\u2014"})),g=new Map;for(const n of[...i.filter(a=>a.isEvent),...l]){const a=typeof n=="string"?{name:n}:n;a&&a.name&&g.set(a.name,{...g.get(a.name),...a})}const h=[...g.values()].map(n=>({name:n.name,type:n.type||"\u672A\u58F0\u660E\u53C2\u6570\u7C7B\u578B",description:n.description||"\u2014"})),O=Object.entries(u).filter(([n])=>!g.has(n));let v;if(r==="react"){const n=O.filter(([e])=>e!=="children").map(([e,o])=>typeof o=="string"?` ${e}="${R(o)}"`:` ${e}={${m(o)}}`);for(const e of h){const o=/^on[A-Z]/.test(e.name)?e.name:y(e.name);n.push(` ${o}={(...args) => { /* \u5904\u7406 ${e.name} */ }}`)}const a=d.default!==void 0?`{${m(d.default)}}`:C(u,"children")?`{${m(u.children)}}`:"",j=d.default&&/<[a-z][\s\S]*>/i.test(d.default)?`<span dangerouslySetInnerHTML={{ __html: ${m(d.default)} }} />`:a;v=`<${t}${n.length?`
2
+ `+n.join(`
3
+ `)+`
4
+ `:""}${j?`>
5
+ ${j}
6
+ </${t}>`:" />"}`}else{const n=O.map(([e,o])=>c.some(p=>p.prop===e)?` :${b(e)}="${R(e)}"`:typeof o=="string"?` ${b(e)}="${R(o)}"`:` :${b(e)}="${R(m(o))}"`);for(const e of c)g.has(e.event)||h.push({name:e.event,type:"\u6A21\u578B\u503C",description:`\u540C\u6B65 ${e.prop}`});for(const e of h){const o=c.find(p=>p.event===e.name);n.push(` @${e.name}="${o?`${o.prop} = $event`:y(e.name)}"`)}const a=Object.entries(d).map(([e,o])=>e==="default"?String(o):`<template #${e}>${o}</template>`).join(`
7
+ `);v=`<${b(t)}${n.length?`
8
+ `+n.join(`
9
+ `)+`
10
+ `:""}>${a?`
11
+ `+a+`
12
+ `:""}</${b(t)}>`;const j=h.filter(e=>!c.some(o=>o.event===e.name));if(c.length||j.length){const e=Object.fromEntries(c.map(p=>[p.prop,u[p.prop]])),o=r==="vue3"?[c.length?"import { ref } from 'vue'":"",...c.map(p=>`const ${p.prop} = ref(${m(u[p.prop])})`),...j.map(p=>`function ${y(p.name)}(...args) { /* \u5904\u7406 ${p.name} */ }`)].filter(Boolean).join(`
13
+ `):`export default {
14
+ data: () => (${m(e)}),
15
+ methods: {
16
+ ${j.map(p=>` ${y(p.name)}(...args) { /* \u5904\u7406 ${p.name} */ },`).join(`
17
+ `)}
18
+ },
19
+ }`;v=`<template>
20
+ ${v}
21
+ </template>
22
+
23
+ <script${r==="vue3"?" setup":""}>
24
+ ${o}
25
+ <\/script>`}}return{name:t,props:S,events:h,description:A,requirements:x,code:f||I({usage:v,name:t,exportName:$,libName:s,remoteDep:V,framework:r})}}function I({usage:t,name:i,exportName:u,libName:r,remoteDep:l,framework:d}){const A=r?r.startsWith("@")?r:"@melt-js/"+r:"@melt-js/your-components",x=l.platform?`{ ...resolveHelDep(${m(A)}), platform: ${m(l.platform)} }`:m(A),f=`const ${i} = defineHelComponent({ dep: ${x}, exportName: ${m(u)} })`,c=r?"// \u7EC4\u4EF6\u5B9E\u73B0\u4ECE unpkg \u6309\u9700\u52A0\u8F7D\uFF1B\u9996\u6B21\u6302\u8F7D\u624D\u53D1\u8D77\u8BF7\u6C42\u3002":"// \u8BF7\u628A @melt-js/your-components \u66FF\u6362\u4E3A\u5B9E\u9645\u53D1\u5E03\u7684\u8FDC\u7A0B\u7EC4\u4EF6\u5305\u3002";if(d==="react")return["// \u5B89\u88C5\uFF1Apnpm add react@18 react-dom@18 react-is@18 @melt-js/libs-core-react",'// index.html \u4E2D\u51C6\u5907 <div id="root"></div>\uFF1BVite \u5165\u53E3\u4F7F\u7528 /src/main.jsx\u3002',"// src/main.jsx","import React from 'react'","import * as ReactDOM from 'react-dom'","import { createRoot } from 'react-dom/client'","import * as ReactIs from 'react-is'","import { bindReactRuntime } from '@melt-js/libs-core-react'","import App from './App.jsx'","bindReactRuntime({ React, ReactDOM, ReactIs })","createRoot(document.getElementById('root')).render(<App />)","","// src/App.jsx","import React from 'react'",`import { defineHelComponent${l.platform?", resolveHelDep":""} } from '@melt-js/libs-core-react'`,c,"// \u5728 render \u5916\u5B9A\u4E49\uFF0C\u907F\u514D\u6BCF\u6B21\u6E32\u67D3\u91CD\u65B0\u521B\u5EFA\u7EC4\u4EF6\u3002",f,`export default function App() {
26
+ return (
27
+ ${t.split(`
28
+ `).map(V=>" "+V).join(`
29
+ `)}
30
+ )
31
+ }`].join(`
32
+ `);let s=t;const $=`import { defineHelComponent${l.platform?", resolveHelDep":""} } from '@melt-js/libs-core-${d}'`;return d==="vue3"?(s.includes("<script setup>")?s=s.replace("<script setup>",`<script setup>
33
+ ${$}
34
+ ${c}
35
+ ${f}`):s=`<script setup>
36
+ ${$}
37
+ ${c}
38
+ ${f}
39
+ <\/script>
40
+
41
+ <template>
42
+ ${t}
43
+ </template>`,["// \u5B89\u88C5\uFF1Apnpm add vue@3 hel-micro @melt-js/libs-core-vue3",'// \u4F7F\u7528 Vite Vue \u9879\u76EE\uFF1Bindex.html \u4E2D\u51C6\u5907 <div id="app"></div>\u3002',"// src/main.js","import * as Vue from 'vue'","import { bindVueRuntime } from 'hel-micro'","import App from './App.vue'","bindVueRuntime({ Vue })","Vue.createApp(App).mount('#app')","","// src/App.vue",s].join(`
44
+ `)):(s.includes("<script>")?s=s.replace("<script>",`<script>
45
+ ${$}
46
+ ${c}
47
+ ${f}`).replace("export default {",`export default {
48
+ components: { ${i} },`):s=`<template>
49
+ ${t}
50
+ </template>
51
+
52
+ <script>
53
+ ${$}
54
+ ${c}
55
+ ${f}
56
+ export default { components: { ${i} } }
57
+ <\/script>`,["// \u5B89\u88C5\uFF1Apnpm add vue@2.7 hel-micro @melt-js/libs-core-vue2",'// \u4F7F\u7528 Vue 2.7 \u9879\u76EE\uFF1Bindex.html \u4E2D\u51C6\u5907 <div id="app"></div>\u3002',"// src/main.js","import Vue from 'vue'","import { bindVueRuntime } from 'hel-micro'","import App from './App.vue'","bindVueRuntime({ Vue })","new Vue({ render: h => h(App) }).$mount('#app')","","// src/App.vue",s].join(`
58
+ `))}function z(t,i={}){const r=(t&&t.options||t||{}).emits||[];return[...new Set([...Array.isArray(r)?r:Object.keys(r),...Object.keys(i)])]}export{_ as buildComponentDocs,z as componentEvents};
@@ -0,0 +1,35 @@
1
+ export interface VueDownloadExample {
2
+ remoteDep?: { platform?: string }
3
+ component: string
4
+ props?: Record<string, unknown>
5
+ slotHtml?: string | Record<string, string>
6
+ background?: string
7
+ stageHeight?: string
8
+ openProp?: string
9
+ libName?: string
10
+ }
11
+ export interface DownloadItem {
12
+ name: string
13
+ label: string
14
+ props: Record<string, unknown>
15
+ slotHtml?: Record<string, string>
16
+ }
17
+ export interface ReactDownloadExample {
18
+ remoteDep?: { platform?: string }
19
+ title: string
20
+ libName: string
21
+ items: DownloadItem[]
22
+ panelSchema?: unknown[]
23
+ propsPanel?: boolean
24
+ }
25
+ export interface DownloadFile { fileName: string; html: string }
26
+ export interface DownloadOptions { framework: 'vue2' | 'vue3' | 'react'; libName?: string }
27
+ export interface DownloadState { downloaded: string; error: string }
28
+ export const DOWNLOAD_HINT: string
29
+ export const EXAMPLE_HINT: string
30
+ export function buildDownloadFile(example: VueDownloadExample | ReactDownloadExample, options: DownloadOptions): DownloadFile
31
+ export function createDownloadController(onChange?: (state: DownloadState) => void): {
32
+ reset(): void
33
+ dispose(): void
34
+ download(example: VueDownloadExample | ReactDownloadExample, options: DownloadOptions): DownloadFile | undefined
35
+ }
@@ -0,0 +1,4 @@
1
+ import{resolveHelDep as f}from"../remote.mjs";import*as y from"./runtime.mjs";const N="\u4E0B\u8F7D\u5F53\u524D\u793A\u4F8B\uFF08HTML + unpkg CDN \u5355\u6587\u4EF6\uFF0C\u8054\u7F51\u540E\u53EF\u76F4\u63A5\u6253\u5F00\uFF09",L="\u672C\u793A\u4F8B\u7684\u6846\u67B6\u3001\u52A0\u8F7D\u5668\u3001\u9002\u914D\u5C42\u548C\u8FDC\u7A0B\u7EC4\u4EF6\u5747\u4ECE unpkg \u52A0\u8F7D\u3002\u4FDD\u5B58\u4E3A HTML \u540E\u53EF\u76F4\u63A5\u6253\u5F00\uFF0C\u9700\u8981\u8054\u7F51\u3002",d=(e,t)=>"https://unpkg.com/"+e+"/"+t,l=e=>String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;"),v=e=>JSON.stringify(e,null,2).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"),u=e=>"data:text/javascript,"+encodeURIComponent(e);function $(e){const t={"@melt-js/libs-core":d("@melt-js/libs-core","dist/browser.mjs"),["@melt-js/libs-core-"+e]:d("@melt-js/libs-core-"+e,"dist/index.mjs")};let r;return e==="react"?(t.react=u("export default window.React;"),r=[d("react@18.3.1","umd/react.production.min.js"),d("react-dom@18.3.1","umd/react-dom.production.min.js"),d("react-is@18.3.1","umd/react-is.production.min.js")]):e==="vue2"?(t.vue=u("export default window.Vue;"),r=[d("vue@2.7.16","dist/vue.min.js")]):(t.vue=u("export default window.Vue; export const { defineComponent, h, onBeforeUnmount, onErrorCaptured, onMounted, shallowRef } = window.Vue;"),r=[d("vue@3.5.45","dist/vue.global.prod.js")]),{imports:t,scripts:r}}function C(e,{framework:t,libName:r=e&&e.libName}={}){if(!["vue2","vue3","react"].includes(t))throw new Error("\u9700\u8981\u6307\u5B9A\u793A\u4F8B\u6846\u67B6\uFF1Avue2 / vue3 / react");if(!e||typeof r!="string"||!r.trim())throw new Error("\u9700\u8981\u6307\u5B9A\u8FDC\u7A0B\u7EC4\u4EF6\u5305 libName");const p=r.startsWith("@")?r:"@melt-js/"+r,c={...f(p,{type:"unpkg"}),...e.remoteDep&&e.remoteDep.platform?{platform:e.remoteDep.platform}:{}},o=t==="react"?{title:e.title,packageName:p,items:e.items.map(({name:a,label:b,props:j,slotHtml:h})=>({name:a,label:b,props:j||{},...h?{slotHtml:h}:{}})),...e.panelSchema?{panelSchema:e.panelSchema}:{},propsPanel:!!e.propsPanel}:{title:e.component,packageName:p,component:e.component,props:e.props||{},slotHtml:e.slotHtml||"",openProp:e.openProp||""};if(c.platform&&(o.remoteDep=c),t==="react"?!o.items.length:!o.component)throw new Error("\u793A\u4F8B\u7F3A\u5C11\u7EC4\u4EF6");const{imports:m,scripts:i}=$(t),n=[...i,...Object.values(m).filter(a=>a.startsWith("https:")),c.host];o.panelSchema&&n.push(f("@melt-js/libs-react-leva").host);const s=[`import { defineHelComponent${t==="react"?", loadHelLib, bindReactRuntime":o.openProp?", loadHelComponent":""} } from '@melt-js/libs-core-${t}'`,"const example = JSON.parse(document.getElementById('demo-config').textContent)",y[t!=="react"&&o.openProp?t+"Modal":t]].join(`
2
+ `),x=[e.background?"background:"+e.background:"",e.stageHeight?"height:"+e.stageHeight:""].filter(Boolean).join(";"),g=[...i.map(a=>`<script src="${l(a)}" crossorigin="anonymous"><\/script>`),`<script type="importmap">${v({imports:m})}<\/script>`,`<script type="module">${s}<\/script>`].join(`
3
+ `),w=['<!doctype html><html lang="zh-CN"><head>','<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">','<base href="https://unpkg.com/">',`<title>${l(o.title)} \xB7 HTML + unpkg</title>`,"<style>body{margin:0;padding:28px;color:#1f2937;background:#f5f7fa;font:15px/1.7 system-ui,sans-serif}main{max-width:1100px;margin:auto}#app{box-sizing:border-box;min-height:240px;padding:24px;background:#fff;border-radius:12px;overflow:auto}pre{padding:20px;overflow:auto;background:#0f172a;color:#e2e8f0;border-radius:12px;font:13px/1.7 monospace}.example-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:16px}.example-item{min-width:0}a{overflow-wrap:anywhere}h1{font-size:26px}</style>",`</head><body><main><h1>${l(o.title)}</h1><p>${L}</p>`,`<div id="app" style="${l(x)}"><div id="demo-root">\u6B63\u5728\u52A0\u8F7D\u8FDC\u7A0B\u7EC4\u4EF6\u2026</div></div><p id="example-load-error" role="alert" hidden></p>`,"<h2>\u5F15\u7528\u7684 unpkg CDN</h2><ul>"+n.map(a=>`<li><a href="${l(a)}">${l(a)}</a></li>`).join("")+"</ul>","<h2>HTML \u5F15\u7528\u4E0E\u61D2\u52A0\u8F7D\u793A\u4F8B</h2><pre>"+l(g)+"</pre>","<h2>\u793A\u4F8B\u53C2\u6570</h2><pre>"+l(JSON.stringify(o,null,2))+"</pre></main>",`<script id="demo-config" type="application/json">${v(o)}<\/script>`,'<script>function showLoadError(message){const target=document.getElementById("example-load-error");if(target){target.hidden=false;target.textContent="\u52A0\u8F7D\u5931\u8D25\uFF1A"+message}}window.addEventListener("error",function(event){if(event.target&&event.target!==window&&!/^(SCRIPT|LINK)$/.test(event.target.tagName))return;showLoadError(event.message||"unpkg \u8D44\u6E90\u52A0\u8F7D\u5931\u8D25")},true);window.addEventListener("unhandledrejection",function(event){showLoadError(String(event.reason))})<\/script>',g,"</body></html>"].join(`
4
+ `);return{fileName:"hel-micro-"+(e.component||c.name+"-"+(e.items?e.items.map(a=>a.name).join("-"):"example")).replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-z0-9_-]/gi,"-").toLowerCase()+".html",html:w}}function T(e=()=>{}){let t,r=!1;const p=o=>{r||e(o)},c=()=>{clearTimeout(t),p({downloaded:"",error:""})};return{reset:c,dispose(){r=!0,clearTimeout(t)},download(o,m){let i="",n;try{const s=C(o,m);return i=URL.createObjectURL(new Blob([s.html],{type:"text/html;charset=utf-8"})),n=document.createElement("a"),n.href=i,n.download=s.fileName,n.rel="noopener",document.body.appendChild(n),n.click(),setTimeout(()=>URL.revokeObjectURL(i),1e3),clearTimeout(t),p({downloaded:s.fileName,error:""}),t=setTimeout(c,2e3),s}catch(s){i&&URL.revokeObjectURL(i),clearTimeout(t),p({downloaded:"",error:"\u4E0B\u8F7D\u5931\u8D25\uFF1A"+String(s)})}finally{n&&n.remove()}}}}export{N as DOWNLOAD_HINT,L as EXAMPLE_HINT,C as buildDownloadFile,T as createDownloadController};
@@ -0,0 +1,8 @@
1
+ export type FullscreenTarget = string | Element | null | (() => Element | null)
2
+ export function createDemoFullscreen(options?: { target?: FullscreenTarget; onChange?: (active: boolean) => void }): {
3
+ readonly active: boolean
4
+ enter(trigger?: HTMLElement): void
5
+ exit(): void
6
+ toggle(trigger?: HTMLElement): void
7
+ dispose(): void
8
+ }
@@ -0,0 +1 @@
1
+ const s=Symbol.for("@melt-js/demo-fullscreen");function A({target:a="[data-demo-preview]",onChange:f=()=>{}}={}){let c=null,m=!1;const w=()=>{const n=typeof a=="function"?a():a;return typeof n=="string"?document.querySelector(n):n},l={get active(){return!!c},enter(n){if(m||c)return;const t=w();if(!t||!t.isConnected||t===document.body||t===document.documentElement)throw new Error("\u6CA1\u6709\u627E\u5230\u9700\u8981\u5168\u5C4F\u7684\u7EC4\u4EF6\u9884\u89C8\u533A");document[s]&&document[s].exit();const d=document.createComment("demo fullscreen position");t.before(d);const E=["role","aria-modal","aria-label"].map(e=>[e,t.getAttribute(e)]),h=document.body.style.overflow,i=n||document.activeElement,x=[window.scrollX,window.scrollY],g=t.classList.contains("leva-demo-fullscreen"),o=document.createElement("button");o.type="button",o.className="leva-fullscreen-exit",o.textContent="\u9000\u51FA\u5168\u5C4F\uFF08Esc\uFF09",o.setAttribute("aria-label","\u9000\u51FA\u5168\u5C4F"),o.addEventListener("click",()=>l.exit()),document.body.appendChild(t),t.classList.add("leva-demo-fullscreen"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label","\u7EC4\u4EF6\u5168\u5C4F\u9884\u89C8"),t.appendChild(o),document.body.style.overflow="hidden";const b=[...document.body.children].filter(e=>e!==t&&e.tagName!=="SCRIPT"&&e.tagName!=="STYLE").map(e=>[e,e.inert]);for(const[e]of b)e.inert=!0;function v(e){if(e.key==="Escape"){e.preventDefault(),l.exit();return}if(e.key!=="Tab")return;const r=[...t.querySelectorAll("a[href],button,input,select,textarea,[tabindex]")].filter(u=>u.tabIndex>=0&&!u.matches(":disabled,[hidden]")&&!u.closest("[inert]")&&u.getClientRects().length),p=r[0]||o,y=r[r.length-1]||o;e.shiftKey&&(document.activeElement===p||!t.contains(document.activeElement))?(e.preventDefault(),y.focus()):!e.shiftKey&&(document.activeElement===y||!t.contains(document.activeElement))&&(e.preventDefault(),p.focus())}document.addEventListener("keydown",v),c=()=>{document.removeEventListener("keydown",v),o.remove(),g||t.classList.remove("leva-demo-fullscreen");for(const[e,r]of E)r===null?t.removeAttribute(e):t.setAttribute(e,r);d.parentNode&&d.replaceWith(t),document.body.style.overflow=h;for(const[e,r]of b)e.inert=r;i&&i.isConnected&&i.focus&&i.focus({preventScroll:!0}),window.scrollTo(...x)},document[s]=l,o.focus({preventScroll:!0}),f(!0)},exit(){if(!c)return;const n=c;c=null,n(),document[s]===l&&delete document[s],f(!1)},toggle(n){c?l.exit():l.enter(n)},dispose(){l.exit(),m=!0}};return l}export{A as createDemoFullscreen};
@@ -0,0 +1,7 @@
1
+ export * from './download.mjs'
2
+ export * from './docs.mjs'
3
+ export * from './fullscreen.mjs'
4
+ export * from './model.mjs'
5
+ export * from './remote-debug.mjs'
6
+ export * from './split-pane.mjs'
7
+ export * from './tabs.mjs'
@@ -0,0 +1 @@
1
+ export*from"./download.mjs";export*from"./docs.mjs";export*from"./fullscreen.mjs";export*from"./model.mjs";export*from"./remote-debug.mjs";export*from"./split-pane.mjs";export*from"./tabs.mjs";