hel-tpl-remote-lib
Version:
基于[hel-micro](https://github.com/tnfe/hel)搭建的远程仓库模板库
2 lines • 32.5 kB
JavaScript
/*! For license information please see 0.a51b4d9e.chunk.js.LICENSE.txt */
(this["helJsonp_hel-tpl-remote-lib_1697456136277"]=this["helJsonp_hel-tpl-remote-lib_1697456136277"]||[]).push([[0],[,,function(e,t,n){"use strict";n.r(t);var r={get num1to9(){return/^[1-9]+[0-9]*$/},get en(){return/^[A-Za-z]+$/},get enSnake(){return/^[a-z][_0-9a-z]*[a-z0-9]+$/},get enOrNumOrUnderline(){return/^[A-Za-z0-9_]+$/},get enOrNum(){return/^[A-Za-z0-9]+$/}};t.default=r},function(e,t,n){"use strict";n.r(t),n.d(t,"canBeNum",(function(){return o})),n.d(t,"random",(function(){return i}));var r=n(2);function o(e){var t=typeof e;if("string"===t){if(e.includes(".")){var n=e.replace(/\./g,"");if(!r.default.num1to9.test(n))return!1;var o=parseFloat(e);return!Number.isNaN(o)}return r.default.num1to9.test(e)}return"number"===t}function i(e){return console.log("random"),Math.floor(e*Math.random())}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),function(e){function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,u=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(u.push(r.value),u.length!==t);c=!0);}catch(p){l=!0,o=p}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return u}}(e,t)||l(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||l(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){if(e){if("string"===typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}n.d(t,"allowLog",(function(){return Ze})),n.d(t,"appReady",(function(){return Rt})),n.d(t,"commonDataUtil",(function(){return dt})),n.d(t,"commonUtil",(function(){return Be})),n.d(t,"evName",(function(){return Pt})),n.d(t,"getAppMeta",(function(){return it})),n.d(t,"getAppPlatform",(function(){return Nt})),n.d(t,"getAppStyleStr",(function(){return ht})),n.d(t,"getCommonData",(function(){return st})),n.d(t,"getCustomData",(function(){return lt})),n.d(t,"getGlobalThis",(function(){return Qe})),n.d(t,"getHelDebug",(function(){return Je})),n.d(t,"getHelEventBus",(function(){return Dt})),n.d(t,"getPlatform",(function(){return We})),n.d(t,"getPlatformConfig",(function(){return Lt})),n.d(t,"getSharedCache",(function(){return $e})),n.d(t,"getUserEventBus",(function(){return Ct})),n.d(t,"getVerApp",(function(){return tt})),n.d(t,"getVerExtraCssList",(function(){return bt})),n.d(t,"getVerLib",(function(){return rt})),n.d(t,"getVerLoadStatus",(function(){return vt})),n.d(t,"getVerStyleStrStatus",(function(){return gt})),n.d(t,"getVersion",(function(){return ut})),n.d(t,"helConsts",(function(){return Ye})),n.d(t,"helEvents",(function(){return ke})),n.d(t,"helLoadStatus",(function(){return Ue})),n.d(t,"inectPlatToMod",(function(){return He})),n.d(t,"initPlatformConfig",(function(){return Ot})),n.d(t,"isSubApp",(function(){return ze})),n.d(t,"libReady",(function(){return Mt})),n.d(t,"log",(function(){return qe})),n.d(t,"originInit",(function(){return Tt})),n.d(t,"resetGlobalThis",(function(){return Xe})),n.d(t,"setAppMeta",(function(){return at})),n.d(t,"setAppPlatform",(function(){return It})),n.d(t,"setAppStyleStr",(function(){return yt})),n.d(t,"setCommonData",(function(){return ft})),n.d(t,"setCustomData",(function(){return pt})),n.d(t,"setEmitApp",(function(){return nt})),n.d(t,"setEmitLib",(function(){return ot})),n.d(t,"setGlobalThis",(function(){return et})),n.d(t,"setVerExtraCssList",(function(){return At})),n.d(t,"setVerLoadStatus",(function(){return mt})),n.d(t,"setVerStyleStrStatus",(function(){return _t})),n.d(t,"setVersion",(function(){return ct})),n.d(t,"tryGetAppName",(function(){return St})),n.d(t,"tryGetVersion",(function(){return Et}));var s=null;function f(){return s||function(){if("undefined"===typeof window){if("undefined"===typeof e)throw new Error("unable to locate global object");s=e}else s=window}(),s}function d(){return f()}function v(e){return Object.keys(e)}function m(){var e=function(){try{var e,t;return(null===(e=f().top)||void 0===e||null===(t=e.location)||void 0===t?void 0:t.search)||""}catch(o){var n,r;return(null===(n=f())||void 0===n||null===(r=n.location)||void 0===r?void 0:r.search)||""}}(),t={};null!==e&&void 0!==e&&e.startsWith("?")&&e.substring(1).split("&").forEach((function(e){var n=u(e.split("="),2),r=n[0],o=n[1];t[r]=o}));return t}function g(){var e="";try{throw new Error("getJsRunLocation")}catch(n){var t=n.stack.split("\n");e=t[t.length-1]||""}return e}function _(e,t,n,r){h(e,t)[n]=r}function h(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e[t];return r||(r=n,e[t]=r),r}function y(e,t){Object.keys(t).forEach((function(n){var r=t[n];[null,void 0,""].includes(r)||(e[n]=r)}))}function b(e,t){e.includes(t)||e.push(t)}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.nullValues,r=void 0===n?[null,void 0,""]:n,o=t.emptyObjIsNull,a=void 0===o||o,u=t.emptyArrIsNull,c=void 0===u||u,l=r.includes(e);if(l)return!0;if(Array.isArray(e))return!!c&&0===e.length;if("object"===i(e)){var p=v(e),s=p.length;return!!a&&0===s}return!1}function E(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t}var S=A,L=b,N=v;function I(e,t){var n=t||function(e){return!S(e)},r={};return N(e).forEach((function(t){n(e[t])&&(r[t]=e[t])})),r}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"MULTI",n=e.split("\n"),r=n.length-1,o=n.map((function(e,n){var o;if(!e&&(0===n||n===r))return"";var i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=e;return e.endsWith("<br/>")?(r=e.substring(0,r.length-5),"".concat(r).concat(t)):"".concat(r).concat(n)},a=(null===(o=e.trimStart)||void 0===o?void 0:o.call(e))||e;return"MULTI"===t?"".concat(i(a,""),"\n"):a=i(a,"\n"," ")})).join("");return o}function T(e){return O(e,"ONE")}function D(e,t,n){e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(t),n)}function C(e){D(e,"heldisabled","1"),e.disabled=!0}var P=Object.freeze({__proto__:null,noop:E,safeParse:function(e,t,n){if(e&&"string"!==typeof e)return e;try{return JSON.parse(e)||t}catch(r){if(void 0!==t)return t;if(n)throw new Error(n);throw r}},isNull:S,noDupPush:L,okeys:N,merge2List:function(e,t){var n=[];return e.forEach((function(e){return L(n,e)})),t.forEach((function(e){return L(n,e)})),n},purify:I,getObjsVal:function(e,t,n){var r,o=n,i=function(e,t){var n="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=l(e))||t&&e&&"number"===typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value[t];if(![null,void 0,""].includes(a)){o=a;break}}}catch(u){i.e(u)}finally{i.f()}return o},pfstr:O,nbstr:T,nbalert:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=f(),r=T(e),o=n.alert||E;t&&n.location?n.location.port&&o(r):o(r)},setDataset:D,disableNode:C});var M={isIncludeFilter:function(e,t){return t.includes(",")?t.split(",").some((function(t){return e.includes(t)})):e.includes(t)},getLogFilter:function(){return F().logFilter},setLogFilter:function(e){F().logFilter=e},setLogMode:function(e){var t=parseInt(e,10);[1,2].includes(t)&&(F().logMode=t)},getLogMode:function(){return F().logMode}},R={};function w(){if(A(R=d().__HEL_MICRO_DEBUG__)){R={logMode:0,logFilter:"",isInit:!1},d().__HEL_MICRO_DEBUG__=R;try{!function(){if(!F().isInit){F().isInit=!0;var e=m(),t=e.hellog,n=e.hellogf,r=f().localStorage,o=t||(null===r||void 0===r?void 0:r.getItem("HelConfig.logMode"))||0;M.setLogMode(o);var i=n||(null===r||void 0===r?void 0:r.getItem("HelConfig.logFilter"))||"";M.setLogFilter(i)}}()}catch(e){}}else void 0===R.logMode&&(R.logMode=0,R.logFilter="")}function x(){return 0!==M.getLogMode()}function F(){return R}var j=" %c--\x3e HEL LOG:",G="color:#ad4e00;font-weight:600";function V(){if(x()){for(var e=1===M.getLogMode()?console.log:console.trace||console.log,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=n.slice(1);if("string"!==typeof o)return e.apply(void 0,[j,G].concat(n));var a=M.getLogFilter(),u=["".concat(j," ").concat(o),G].concat(c(i));a?M.isIncludeFilter(o,a)&&e.apply(void 0,c(u)):e.apply(void 0,c(u))}}var K="__default_online_ver__",k={CORE_VER:"4.7.0",DEFAULT_API_PREFIX:"https://unpkg.com",DEFAULT_API_URL:"/openapi/v1/app/info",DEFAULT_ONLINE_VER:K,DEFAULT_USER_LS_KEY:"HelUserRtxName",DEFAULT_PLAT:"unpkg",PLAT_HEL:"hel",PLAT_UNPKG:"unpkg",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"},U={SUB_APP_LOADED:"subAppLoaded",SUB_LIB_LOADED:"SubLibLoaded",STYLE_STR_FETCHED:"StyleStrFetched",STYLE_TAG_ADDED:"StyleTagAdded",CSS_LINK_TAG_ADDED:"CssLinkTagAdded"},Y={NOT_LOAD:0,LOADING:1,LOADED:2},H=k.DEFAULT_API_URL,B=k.DEFAULT_USER_LS_KEY,z=k.PLAT_HEL,X=k.PLAT_UNPKG,W=k.DEFAULT_API_PREFIX,$=k.CORE_VER,J=k.KEY_CSS_LINK_TAG_ADDED,Z=k.KEY_STYLE_TAG_ADDED,q=k.KEY_IGNORE_CSS_PREFIX_LIST,Q=k.KEY_IGNORE_STYLE_TAG_KEY,ee=k.KEY_IGNORE_CSS_PREFIX_2_KEYS;function te(e){return{apiMode:"get",apiPrefix:(e||{}).apiPrefix,apiSuffix:"",apiPathOfApp:H,apiPathOfAppVersion:"",getSubAppAndItsVersionFn:null,onFetchMetaFailed:null,strictMatchVer:!0,getUserName:null,userLsKey:B,shouldUseGray:null,trustAppNames:null,semverApi:null,hook:{}}}function ne(e){return o(o({isConfigOverwrite:!1,platform:e,appName2Comp:{},appName2Lib:{},appName2isLibAssigned:{},appName2EmitApp:{},appName2verLoadStatus:{},appName2verEmitLib:{},appName2verEmitApp:{},appName2verStyleStr:{},appName2verStyleFetched:{},appName2verExtraCssList:{},appName2verAppVersion:{},appName2verCustomData:{},appName2app:{},appName2appVersion:{},appName2styleStr:{},appGroupName2firstVer:{},isOriginInitCalled:!1},te()),{},{origin:te({apiPrefix:W})})}function re(){var e={};return{on:function(t,n){var r=e[t];if(!r){var o=[];e[t]=o,r=o}r.push(n)},emit:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var i=e[t];if(i){var a=i.slice();a.forEach((function(e){return e.apply(void 0,r)}))}},off:function(t,n){var r=e[t];if(r)for(var o=0,i=r.length;o<i;o++){if(r[o]===n){r.splice(o,1);break}}}}}function oe(e){[J,Z,q,Q,ee].forEach((function(t){return h(e,t,function(e){return e===q?[]:{}}(t))}))}function ie(){var e=ae();if(e){var t=e.cacheRoot;h(t,"appGroupName2platform"),h(t,"common");var n=t.caches;return Object.keys(n).forEach((function(e){var t=n[e];h(t,"appGroupName2firstVer"),h(t,"appName2verExtraCssList"),h(t,"appName2verCustomData"),h(t,"hook"),h(t,"origin",te()),h(t.origin,"hook")})),oe(t.common),void(e.userEventBus||(e.userEventBus=re()))}oe((e=function(){var e,t=ne(X),n=ne(z),r={platform:z,platformHint:"the platform value here does not make any sense!",appName2platform:{},appGroupName2platform:{},caches:(e={},a(e,X,t),a(e,z,n),e),common:{}},o=re(),i=re();return{ver:$,isStyleObInit:!1,nativeHeadAppend:null,nativeBodyAppend:null,createFeature:g(),eventBus:o,userEventBus:i,cacheRoot:r,unpkgCache:t,helCache:n,dev:{setLogMode:M.setLogMode,setLogFilter:M.setLogFilter}}}()).cacheRoot.common),d().__HEL_MICRO_SHARED__=e}function ae(){return d().__HEL_MICRO_SHARED__}function ue(){return"unpkg"}function ce(e){var t=e||"unpkg",n=le(),r=n.caches[t];if(!r){var o=i(e);if("string"!==o)throw console.error("invalid plaform:",e),new Error("fatal error: platform only can be a string, now it is ".concat(o));var a=ne(e);n.caches[t]=a,r=a}return r}function le(){return ae().cacheRoot}var pe={getCustomData:function(e,t,n){var r=n.versionId,o=h(ce(n.platform).appName2verCustomData,e);return h(o,t)[r||K]},getAppMeta:function(e,t){return ce(t).appName2app[e]},setVerLoadStatus:function(e,t,n,r){var o=r||{},i=o.versionId;_(ce(o.platform)[n],e,i||K,t)},getVerLoadStatus:function(e,t,n){var r,o=n||{},i=o.versionId,a=ce(o.platform)[t],u=i||K;return(null===(r=a[e])||void 0===r?void 0:r[u])||Y.NOT_LOAD},ensureOnlineModule:function(e,t,n){if(!e[K]){var r=pe.getAppMeta(t,n),o=e[null===r||void 0===r?void 0:r.online_version];o&&(e[K]=o)}}};function se(e,t){V("[[ core:setEmitApp ]] appName,emitApp:",e,t);var n=t.versionId,r=ce(t.platform),o=r.appName2verEmitApp,i=r.appName2Comp,a=r.appName2EmitApp;h(o,e)[K]||(i[e]=t.Comp,a[e]=t,_(o,e,K,t)),n&&_(o,e,n,t)}var fe=k.KEY_CSS_LINK_TAG_ADDED,de=k.KEY_STYLE_TAG_ADDED,ve=k.KEY_IGNORE_CSS_PREFIX_LIST,me=k.KEY_IGNORE_STYLE_TAG_KEY,ge=k.KEY_IGNORE_CSS_PREFIX_2_KEYS;function _e(e){return h(le().common,e)}function he(e){return le().common[e]}function ye(e,t){var n=_e(e)[t];return void 0!==n?n:null}function be(e,t,n){_e(e)[t]=n}var Ae={setIgnoreCssPrefix:function(e){b(he(ve),e)},setIgnoreStyleTagKey:function(e){Ae.getIgnoreStyleTagMap()[e]=1},getIgnoreStyleTagMap:function(){return he(me)},setIgnoreCssPrefixKey:function(e,t){var n=ye(ge,e);n||be(ge,e,n=[]),b(n,t)},getIgnoreCssPrefixKeys:function(e){return he(ge)[e]||[]},getMatchedIgnoreCssPrefix:function(e){for(var t=he(ve),n="",r=0;r<t.length;r++){var o=t[r];if(e.startsWith(o)){n=o;break}}return n},getIgnoreCssPrefixCssUrlList:function(e){var t=ye(fe,e);return t||be(fe,e,t=[]),t},setIgnoreCssPrefixCssUrl:function(e,t){Ae.getIgnoreCssPrefixCssUrlList(e).push(t)},getStyleTagText:function(e){return ye(de,e)||""},clearStyleTagText:function(e){be(de,e,"")},appendStyleTagText:function(e,t){var n=Ae.getStyleTagText(e);be(de,e,"".concat(n," ").concat(t))}};function Ee(e,t){var n=e.apiMode,r=e.apiPrefix,o=e.apiSuffix,i=e.apiPathOfApp,a=e.apiPathOfAppVersion,u=e.getSubAppAndItsVersionFn,c=e.onFetchMetaFailed,l=e.strictMatchVer,p=e.getUserName,s=e.userLsKey,f=e.shouldUseGray,d=e.getApiPrefix,v=e.trustAppNames,m=e.platform,g=e.origin,_={apiMode:n,apiPrefix:r,apiSuffix:o,apiPathOfApp:i,apiPathOfAppVersion:a,getSubAppAndItsVersionFn:u,onFetchMetaFailed:c,strictMatchVer:l,getUserName:p,userLsKey:s,shouldUseGray:f,getApiPrefix:d,trustAppNames:v,hook:e.hook,platform:m};return t&&(_.origin=g),_}function Se(e){return le().appGroupName2platform[e]||"unpkg"}function Le(e,t){var n=t.customKey,r=h(ce(t.platform).appName2verCustomData,e);return h(r,n)}var Ne=U.STYLE_TAG_ADDED,Ie=U.CSS_LINK_TAG_ADDED;function Oe(){return ae().eventBus}var Te={styleTagAdded:function(e){return"".concat(Ne,"/").concat(e)},cssLinkTagAdded:function(e){return"".concat(Ie,"(").concat(e,")")}};function De(e,t,n){var r=(n||{}).appGroupName,o=t.versionId,a=t.appProperties,u=t.platform||n.platform,c=ce(u),l=c.appName2verEmitLib,p=c.appName2Lib,s=c.appName2isLibAssigned,f=pe.getAppMeta(e,u),d=function(e){var t=p[e];t?"object"===i(t)&&0===Object.keys(t).length&&Object.assign(t,a):p[e]=a,s[e]=!0};d(e),r?d(r):f&&d(f.app_group_name),V("[[ core:setEmitLib ]] appMeta:",f),h(l,e)[K]||_(l,e,K,a),o&&_(l,e,o,a)}function Ce(e,t){return ce(t).appName2app[e]}function Pe(e,t,n){pe.setVerLoadStatus(e,t,"appName2verLoadStatus",n)}function Me(e,t){var n=g();V("[[ core:tryGetVersion ]] may include source > ".concat(n));var r=ce(t).appGroupName2firstVer[e]||"";if(n.includes("https://")||n.includes("http://")){var o=u(n.split("//"),2)[1].split("/");if(r){if("unpkg"===t&&o.some((function(e){return e.includes(r)})))return r;if(o.includes(r))return r;if("static"===o[1]&&"js"===o[2]||"js"===o[1])return r}return"unpkg"===t?o[1].split("@")[1]||r:o[2]||r}return r}function Re(e,t){return e===K?t||"":e.includes("_")?e.substring(0,e.length-15):t||""}var we=!1,xe=!1;var Fe=k.KEY_ASSET_CTX;function je(e,t){if(!t||!["LINK","SCRIPT"].includes(t.tagName))return e(t);var n=t.href,r=t.tagName,o=t.src,i="LINK"===r,a=ye(Fe,n||o||"")||{},u=a.platform,c=a.groupName,l=a.name,p=a.ver,s=a.beforeAppend,f=t;if(s){var d=i?"href":"src",v=t.getAttribute(d);f=s({el:t,nativeAppend:e,setAssetUrl:function(e){return t.setAttribute(d,e)},url:v,tagName:r})||t}return u&&function(e,t){var n=t.platform,r=t.groupName,o=t.name,i=t.ver;D(e,"el",t.elName),D(e,"plat",n),D(e,"gname",r),D(e,"name",o),D(e,"ver",i)}(f,{platform:u,groupName:c,name:l,ver:p,elName:i?"HelLink":"HelScript"}),e(f)}var Ge="/* @helstart ".length;function Ve(e,t){var n=e.tagName,r=e.innerText,o=e.href;if(["STYLE","LINK"].includes(n)&&("STYLE"!==n||r))if("STYLE"===n){var i=r.indexOf("/* @helstart ");if(i<0)return;var a=r.indexOf(" @helend */"),u=r.substring(Ge+i,a);if(u){var c=u.trim();D(e,"gname",c),t[c]&&C(e);var l=Oe();Ae.appendStyleTagText(c,r),l.emit(Te.styleTagAdded(c),{nodes:[e]})}}else{(function(e,t){var n=Oe(),r=Ae.getMatchedIgnoreCssPrefix(t);return r&&(Ae.setIgnoreCssPrefixCssUrl(r,t),n.emit(Te.cssLinkTagAdded(r),{nodes:[e]})),r})(e,o)&&C(e)}}function Ke(e,t){var n=e.tagName,r=e.src,o=void 0===r?"":r;if("SCRIPT"!==n)return!1;if(!o.endsWith(".hot-update.js"))return!1;var i=Ae.getMatchedIgnoreCssPrefix(o);if(!i)return!1;var a=Ae.getIgnoreCssPrefixKeys(i);if(!a.length)return!1;var u=!1;return a.forEach((function(e){t[e]&&(!function(e){var t=f();if(t){var n=t.document.head.querySelectorAll('style[data-gname="'.concat(e,'"]'));if(n.length)Ae.clearStyleTagText(e),n.forEach((function(t){C(t),Ae.appendStyleTagText(e,t.innerText)})),Oe().emit(Te.styleTagAdded(e),{nodes:n})}}(e),u=!0)})),u}Xe(),V("hel-micro-core ver ".concat(k.CORE_VER));var ke=U,Ue=Y,Ye=k,He=function e(t,n,r){var a=r||{},u=a.ignoreKeys,c=void 0===u?[]:u,l=a.arg1PlatObjFnKeys,p=void 0===l?[]:l,s={};return Object.keys(n).forEach((function(a){var u=n[a];if(c.includes(a))s[a]=u;else{var l=i(u);s[a]=l&&"object"===l?e(t,u,r):"function"!==l?u:function(e,t){var n=this,r=t.fn,i=t.fnName,a=t.arg1PlatObjFnKeys.includes(i);return function(){for(var t=function(t){return o({platform:e},I(t||{}))},i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];var l=u[0],p=u[1];return a?u[0]=t(l):u[1]=t(p),r.apply(n,u)}}(t,{arg1PlatObjFnKeys:p,fn:u,fnName:a})}})),s},Be=P,ze=function(){return"more details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp",console.log("%c".concat("WARNING: calling isSubApp is unsafe, use hel-iso.isSubApp instead,\nmore details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp"),"color:red;"),!we};function Xe(e){e&&et(e),function(e){if(e&&(we=!1,xe=!1),!xe){xe=!0;var t=f();void 0===t.__MASTER_APP_LOADED__&&(t.__MASTER_APP_LOADED__=!0,we=!0)}}(!!e),ie(),w(),function(){var e=ae(),t=f().document,n=e.nativeHeadAppend,r=e.nativeBodyAppend;if(!n&&t){var o=t.head,i=t.body;n=o.appendChild.bind(o),r=i.appendChild.bind(i),e.nativeHeadAppend=n,e.nativeBodyAppend=r,t.head.appendChild=function(e){return je(n,e)},t.body.appendChild=function(e){return je(r,e)}}}(),function(){var e=ae(),t=f(),n=e.isStyleObInit,r=t.document;if(!n&&r){e.isStyleObInit=!0;var o=Ae.getIgnoreStyleTagMap(),i=t.MutationObserver||t.WebKitMutationObserver||t.MozMutationObserver;if(i)new i((function(e){e.forEach((function(e){for(var t=e.addedNodes,n=e.removedNodes,r=t.length,i=0;i<r;i++)Ve(t[i],o);for(var a=n.length,u=0;u<a&&!Ke(n[u],o);u++);}))})).observe(document.head,{childList:!0})}}()}var We=ue,$e=ce,Je=F,Ze=x,qe=V,Qe=f,et=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=null;null!==(t=s)&&void 0!==t&&t.__HEL_MICRO_SHARED__&&(r=s.__HEL_MICRO_SHARED__),s=n?o(o({},s),e):e,r&&(s.__HEL_MICRO_SHARED__=r)},tt=function(e,t){var n,r=t||{},o=r.versionId,i=r.platform,a=ce(i),u=a.appName2verEmitApp,c=a.appName2Comp,l=a.strictMatchVer,p=a.appName2EmitApp,s=null!==(n=r.strictMatchVer)&&void 0!==n?n:l,f=h(u,e);pe.ensureOnlineModule(f,e,i);var d=f[o||K],v=c[e],m=v?{Comp:v}:null,g=s?null:p[e]||m,_=d||g||null;return V("[[ core:getVerApp ]] appName,options,result:",e,r,_),_},nt=se,rt=function(e,t){var n,r=t||{},o=r.versionId,i=ce(r.platform),a=i.appName2verEmitLib,u=i.appName2Lib,c=i.strictMatchVer,l=i.appName2isLibAssigned,p=null!==(n=r.strictMatchVer)&&void 0!==n?n:c,s=h(a,e);pe.ensureOnlineModule(s,e);var f=s[o||K],d=l[e]?u[e]:null,v=f||(p?null:d)||null;return V("[[ core:getVerLib ]] appName,options,result:",e,r,v),v},ot=De,it=Ce,at=function(e,t){ce(t).appName2app[e.name]=e},ut=function(e,t){var n,r=t||{},o=r.platform,i=r.versionId,a=ce(o),u=a.appName2verAppVersion,c=a.appName2appVersion[e]||null;return i&&(null===(n=u[e])||void 0===n?void 0:n[i])||c},ct=function(e,t,n){var r=(n||{}).platform,o=ce(r),i=o.appName2verAppVersion,a=o.appGroupName2firstVer,u=o.appName2appVersion,c=t.sub_app_version;if(c){var l=pe.getAppMeta(e,r);h(i,e)[K]||(_(i,e,K,t),u[e]=t),_(i,e,c,t),a[l.app_group_name]=c}},lt=function(e,t){var n=Le(e,t)[t.versionId||K];return void 0!==n?n:null},pt=function(e,t){var n=t.customValue,r=t.versionId;Le(e,t)[r||K]=n},st=ye,ft=be,dt=Ae,vt=function(e,t){return pe.getVerLoadStatus(e,"appName2verLoadStatus",t)},mt=Pe,gt=function(e,t){return pe.getVerLoadStatus(e,"appName2verStyleFetched",t)},_t=function(e,t,n){pe.setVerLoadStatus(e,t,"appName2verStyleFetched",n)},ht=function(e,t){var n,r=t||{},o=r.platform,i=r.versionId,a=ce(o),u=a.appName2verStyleStr,c=a.appName2styleStr[e]||"";return i?(null===(n=u[e])||void 0===n?void 0:n[i])||c||"":c},yt=function(e,t,n){var r=n||{},o=r.platform,i=r.versionId,a=ce(o),u=a.appName2verStyleStr,c=a.appName2verStyleFetched,l=a.appName2styleStr;i?(_(u,e,i,t),_(c,e,i,Y.LOADED)):l[e]=t},bt=function(e,t){var n=t||{},r=n.versionId,o=h(ce(n.platform).appName2verExtraCssList,e),i=o[r]||o[K]||[];return V("[[ core:getVerExtraCssList ]] options,cssList:",n,i),i},At=function(e,t,n){var r=n||{},o=r.versionId,i=ce(r.platform).appName2verExtraCssList;V("[[ core:setVerExtraCssList ]] cssList:",t),h(i,e)[K]||_(i,e,K,t),o&&_(i,e,o,t)},Et=Me,St=Re,Lt=function(e){return Ee(ce(e),!0)},Nt=Se,It=function(e,t){return le().appGroupName2platform[e]=t,Se(e)},Ot=function(e,t){var n=ce(t),r=Ee(e);n.isConfigOverwrite||(n.isConfigOverwrite=!0,y(n,r))},Tt=function(e,t){var n=ce(e),r="[[ core:originInit ]] invalid call, it can only been called";if(n.isConfigOverwrite)V("".concat(r," before init"));else if(n.isOriginInitCalled)V("".concat(r," one time"));else{var o=Ee(t);n.isOriginInitCalled=!0,y(n.origin,o)}},Dt=Oe,Ct=function(){return ae().userEventBus},Pt=Te,Mt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.platform||Se(e),o=n.versionId||Me(e,r),i=n.appName||Re(o,e),a=Ce(i,r);null!==a&&void 0!==a&&a.__fromCust&&(o=n.versionId||a.online_version,i=a.name);var u={platform:r,appName:i,appGroupName:e,versionId:o,appProperties:t,Comp:function(){},lifecycle:{}};De(i,u,{appGroupName:e,platform:r}),Pe(i,Y.LOADED,{versionId:o,platform:r});var c=Oe();c.emit(U.SUB_LIB_LOADED,u)},Rt=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.lifecycle,o=n.platform||Se(e),i=n.versionId||Me(e,o),a=n.appName||Re(i,e),u={Comp:t,appName:a,appGroupName:e,lifecycle:r,platform:o,versionId:i,isLib:!1};se(a,u),Pe(a,Y.LOADED,{versionId:i,platform:o});var c=Oe();c.emit(U.SUB_APP_LOADED,u)}}.call(this,n(4))},function(e,t,n){"use strict";n.r(t),n.d(t,"LIB_NAME",(function(){return r}));var r="hel-tpl-remote-lib"},function(e,t,n){"use strict";n.r(t),function(e){n.d(t,"default",(function(){return l})),n.d(t,"isMasterApp",(function(){return u})),n.d(t,"isSubApp",(function(){return c}));var r=function(){var e=i(),t=e.__HEL_ISO_FLAG__,n=e.__MASTER_APP_LOADED__;return{isFirstMod:void 0===t,isBeforeCore:void 0===n}}();!function(){var e=i();void 0===e.__HEL_ISO_FLAG__&&(e.__HEL_ISO_FLAG__=1)}();var o=function(){var e=i(),t=e.location,n=e.__HEL_MICRO_SHARED__,o=r.isFirstMod,a=r.isBeforeCore;if(!o)return!1;if(a)return!0;var u=function(){var e="";try{throw new Error("codeHost")}catch(n){var t=n.stack.split("\n");e=t[t.length-1]||""}return e.split("//")[1].split("/")[0]}();if(t&&t.host===u)return!0;if(n){var c=n.cacheRoot.appGroupName2platform;if(!Object.keys(c).length)return!0}return!1}();function i(){return window||e}function a(){return o}var u=a,c=function(){return!a()},l={isSubApp:c,isMasterApp:a}}.call(this,n(4))},function(e,t,n){!function(e,t){"use strict";var n=function(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}(t),r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,n){var r=n||(null===t.getAppPlatform||void 0===t.getAppPlatform?void 0:t.getAppPlatform(e)),o=t.getSharedCache(r).appName2Lib;return o[e]||(o[e]={}),o[e]}var i="4.7.0";n.log("hel-lib-proxy ver ".concat(i));var a=n.getUserEventBus,u=n.helConsts,c=a();function l(e,t){var o=r({},t||{});return o.platform=u.DEFAULT_PLAT,n.getVerLib(e,o)}function p(e,r){var i,a=!0,c="";r&&("string"==typeof r?c=r:(c=r.platform||"",a=null===(i=r.asProxy)||void 0===i||i));var l=o(e,c=c||n.getAppPlatform(e)||u.DEFAULT_PLAT);return"function"==typeof Proxy&&a&&(l=function(e,n,r){return new Proxy(n,{get:function(n,i){var a=String(i);return t.log("[[getLibProxy]] call lib [".concat(e,"] method [").concat(a,"]")),Object.keys(n).length?n[a]:o(e,r)[a]}})}(e,l,c)),n.log("[[ exposeLib ]] libName, libObj",e,l),l}function s(e,o,i){var a=function(e){var n={allowDup:!1,platform:t.helConsts.DEFAULT_PLAT};return r(r({},n),e||{})}(i);n.libReady(e,o,a)}function f(e,t,r){n.appReady(e,t,r)}function d(e,t){return n.getVerApp(e,t)}var v=n.isSubApp;function m(){return!n.isSubApp()}var g=Object.freeze({__proto__:null,VER:i,eventBus:c,getLib:l,exposeLib:p,libReady:s,appReady:f,exposeApp:d,isSubApp:v,isMasterApp:m}),_=t.commonUtil.purify,h=["isMasterApp","isSubApp","eventBus"],y=["appReady","libReady"];function b(e,t){return t&&"object"==typeof t?r({platform:e},_(t)):t}function A(e){var t=function(e,t){var n={};return Object.keys(e).forEach((function(r){var o=e[r];if(h.includes(r))n[r]=o;else if(y.includes(r))n[r]=function(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=n[0],i=n[1],a=n[2];return e(o,i,b(t,void 0===a?{}:a))}}(o,t);else{var i="exposeLib"===r;n[r]=function(e,t,n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=r[0],a=r[1];return e(i,n&&"string"==typeof a?a||t:b(t,a))}}(o,t,i)}})),n}(g,e);return t.createInstance=A,t}var E=i,S=s,L=p,N=l,I=v,O=m,T=c,D=f,C=d,P={VER:E,libReady:S,exposeLib:L,getLib:N,isSubApp:I,isMasterApp:O,eventBus:T,appReady:D,exposeApp:C,createInstance:A};e.VER=E,e.appReady=D,e.createInstance=A,e.default=P,e.eventBus=T,e.exposeApp=C,e.exposeLib=L,e.getLib=N,e.isMasterApp=O,e.isSubApp=I,e.libReady=S,Object.defineProperty(e,"__esModule",{value:!0})}(t,n(5))},function(e,t,n){"use strict";n.r(t);var r=n(6),o=n(3);window.__callMethod__=function(){var e=Object(o.random)(100);a("".concat(e,"_").concat(Date.now()))};var i='\n <span style="color:#c62d31">---\x3e lazy load mode</span>\n <pre style="background-color:lightgray;padding-top:12px">\n import helMicro from \'hel-micro\';\n\n export async function callRemoteMethod(){\n const remoteLib = await helMicro.preFetchLib(\''.concat(r.LIB_NAME,"');\n // now you can call the remote lib by 'remoteLib' reference\n }\n </pre>\n <span style=\"color:#c62d31\">---\x3e preload mode</span>\n <pre style=\"background-color:lightgray;padding-top:12px\">\n // call preFetchLib at entry js file\n (async function(){\n const helMicro = await import('hel-micro');\n await helMicro.preFetchLib('").concat(r.LIB_NAME,"');\n import('./loadApp'); // move your app original entry file content to this file and load it\n })();\n\n /** --------------------------------------------------------------------------- */\n import remoteLib from '").concat(r.LIB_NAME,"';\n remoteLib.num.random(19); // now you can call the remote safely just like local module\n </pre>\n");function a(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.querySelector("#container");t||((t=document.createElement("div")).id="container",document.body.append(t)),t.innerHTML='\n <div style="padding:60px;">\n <h1>Cool, as you see this is your hel remote module\n <a style="color:blue" href="https://github.com/hel-eco/hel-tpl-remote-lib" target="_blank" rel="noopener noreferrer">'.concat(r.LIB_NAME,'</a>\n </h1>\n <span style="color:red;">you can delete or edit this file, It will only run at master-app mode</span>,\n see the <a href="https://www.bilibili.com/video/BV1Dd4y1y7Wj/?vd_source=51bc50bf5f860e0d778c49b00d192cee" target="_blank" rel="noopener noreferrer">video</a>\n if you want to use local debug feature.\n <br />\n <h2>\n <button onclick="__callMethod__()" style="font-size:20px;background-color:#ff9800;color:white;border:none;padding:6px;">click me</button>\n to see changed result : ').concat(e,"\n </h2>\n <fieldset>\n <legend>usage snippet</legend>\n ").concat(i,'\n </fieldset>\n <p style="font-size:20px">\n <img width="30px" style="vertical-align:middle" src="https://tnfe.gtimg.com/image/1k4xi9izbk_1651642720099.png"></img>\n <a href="https://github.com/tnfe/hel" target="_blank" rel="noopener noreferrer">hel-micro</a>,\n a module federation SDK which is unrelated to tool\uff0cmore details see\n <a href="https://tnfe.github.io/hel/" target="_blank" rel="noopener noreferrer">doc</a>.\n </p>\n </div>\n ')}a()},function(e,t,n){"use strict";n.r(t);var r={};n.r(r),n.d(r,"sayHelloToHel",(function(){return a}));var o={};n.r(o),n.d(o,"regs",(function(){return i})),n.d(o,"num",(function(){return u})),n.d(o,"myMod",(function(){return r}));var i=n(2);function a(e){return"hello hel, I am ".concat("",", I come from ").concat(e)}var u=n(3);t.default=o}]]);