@fishx/module-renderer
Version:
Support render Fish, Fishx module
1 lines • 25.6 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window.React"),require("window.qiankun")):"function"==typeof define&&define.amd?define(["window.React","window.qiankun"],t):"object"==typeof exports?exports.ModuleRenderer=t(require("window.React"),require("window.qiankun")):e.ModuleRenderer=t(e["window.React"],e["window.qiankun"])}(self,(function(e,t){return function(){var r={333:function(e,t,r){var n,o,i;r(191).default;o=[],void 0===(i="function"==typeof(n=function(){var e=function(){},t={},r={},n={};function o(e,t){e=e.push?e:[e];var o,i,c,a=[],u=e.length,s=u;for(o=function(e,r){r.length&&a.push(e),--s||t(a)};u--;)i=e[u],(c=r[i])?o(i,c):(n[i]=n[i]||[]).push(o)}function i(e,t){if(e){var o=n[e];if(r[e]=t,o)for(;o.length;)o[0](e,t),o.splice(0,1)}}function c(t,r){t.call&&(t={success:t}),r.length?(t.error||e)(r):(t.success||e)(t)}function a(t,r,n,o){var i,c,u,s=document,f=n.async,l=(n.numRetries||0)+1,d=n.before||e,p=t.replace(/[\?|#].*$/,""),h=t.replace(/^(css|img|module|nomodule)!/,"");if(o=o||0,/(^css!|\.css$)/.test(p))(u=s.createElement("link")).rel="stylesheet",u.href=h,(i="hideFocus"in u)&&u.relList&&(i=0,u.rel="preload",u.as="style");else if(/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(p))(u=s.createElement("img")).src=h;else if((u=s.createElement("script")).src=h,u.async=void 0===f||f,c="noModule"in u,/^module!/.test(p)){if(!c)return r(t,"l");u.type="module"}else if(/^nomodule!/.test(p)&&c)return r(t,"l");u.onload=u.onerror=u.onbeforeload=function(e){var c=e.type[0];if(i)try{u.sheet.cssText.length||(c="e")}catch(e){18!=e.code&&(c="e")}if("e"==c){if((o+=1)<l)return a(t,r,n,o)}else if("preload"==u.rel&&"style"==u.as)return u.rel="stylesheet";r(t,c,e.defaultPrevented)},!1!==d(t,u)&&s.head.appendChild(u)}function u(e,t,r){var n,o,i=(e=e.push?e:[e]).length,c=i,u=[];for(n=function(e,r,n){if("e"==r&&u.push(e),"b"==r){if(!n)return;u.push(e)}--i||t(u)},o=0;o<c;o++)a(e[o],n,r)}function s(e,r,n){var o,a;if(r&&r.trim&&(o=r),a=(o?n:r)||{},o){if(o in t)throw"LoadJS";t[o]=!0}function s(t,r){u(e,(function(e){c(a,e),t&&c({success:t,error:r},e),i(o,e)}),a)}if(a.returnPromise)return new Promise(s);s()}return s.ready=function(e,t){return o(e,(function(e){c(t,e)})),s},s.done=function(e){i(e,[])},s.reset=function(){t={},r={},n={}},s.isDefined=function(e){return e in t},s})?n.apply(t,o):n)||(e.exports=i)},436:function(t){"use strict";t.exports=e},304:function(e){"use strict";e.exports=t},154:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},462:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},411:function(e){function t(e,t,r,n,o,i,c){try{var a=e[i](c),u=a.value}catch(e){return void r(e)}a.done?t(u):Promise.resolve(u).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,i){var c=e.apply(r,n);function a(e){t(c,o,i,a,u,"next",e)}function u(e){t(c,o,i,a,u,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},706:function(e,t,r){var n=r(237);e.exports=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=n(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,i=function(){};return{s:i,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:i}}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 c,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,c=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw c}}}},e.exports.__esModule=!0,e.exports.default=e.exports},51:function(e,t,r){var n=r(108);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},449:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,c,a=[],u=!0,s=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(s)throw o}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},431:function(e){e.exports=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.")},e.exports.__esModule=!0,e.exports.default=e.exports},402:function(e,t,r){var n=r(51);function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}e.exports=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e},e.exports.__esModule=!0,e.exports.default=e.exports},15:function(e,t,r){var n=r(191).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,c=i.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},s=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),c=new T(n||[]);return a(i,"_invoke",{value:L(e,r,c)}),i}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var v="suspendedStart",y="executing",m="completed",w={};function g(){}function b(){}function x(){}var j={};d(j,s,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(C([])));_&&_!==i&&c.call(_,s)&&(j=_);var O=x.prototype=g.prototype=Object.create(j);function S(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function r(o,i,a,u){var s=h(e[o],e,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==n(l)&&c.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var o;a(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function L(e,r,n){var o=v;return function(i,c){if(o===y)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw c;return{value:t,done:!0}}for(n.method=i,n.arg=c;;){var a=n.delegate;if(a){var u=P(a,n);if(u){if(u===w)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===v)throw o=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var s=h(e,r,n);if("normal"===s.type){if(o=n.done?m:"suspendedYield",s.arg===w)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=m,n.method="throw",n.arg=s.arg)}}}function P(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var i=h(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,w;var c=i.arg;return c?c.done?(r[e.resultName]=c.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,w):c:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function I(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function C(e){if(e||""===e){var r=e[s];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(c.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(n(e)+" is not iterable")}return b.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,l,"GeneratorFunction"),r.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},r.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,d(e,l,"GeneratorFunction")),e.prototype=Object.create(O),e},r.awrap=function(e){return{__await:e}},S(k.prototype),d(k.prototype,f,(function(){return this})),r.AsyncIterator=k,r.async=function(e,t,n,o,i){void 0===i&&(i=Promise);var c=new k(p(e,t,n,o),i);return r.isGeneratorFunction(t)?c:c.next().then((function(e){return e.done?e.value:c.next()}))},S(O),d(O,l,"Generator"),d(O,s,(function(){return this})),d(O,"toString",(function(){return"[object Generator]"})),r.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},r.values=C,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(I),!e)for(var r in this)"t"===r.charAt(0)&&c.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(n,o){return a.type="throw",a.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=c.call(i,"catchLoc"),s=c.call(i,"finallyLoc");if(u&&s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&c.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,w):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),w},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),I(r),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;I(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:C(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},488:function(e,t,r){var n=r(462),o=r(449),i=r(237),c=r(431);e.exports=function(e,t){return n(e)||o(e,t)||i(e,t)||c()},e.exports.__esModule=!0,e.exports.default=e.exports},875:function(e,t,r){var n=r(191).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!==n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},108:function(e,t,r){var n=r(191).default,o=r(875);e.exports=function(e){var t=o(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},191:function(e){function t(r){return e.exports=t="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.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},237:function(e,t,r){var n=r(154);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e].call(i.exports,i,i.exports,o),i.exports}o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,{a:t}),t},o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){"use strict";o.r(i),o.d(i,{ChildModuleRenderer:function(){return ee},FishModuleRenderer:function(){return c},QiankunAppRenderer:function(){return re}});var e=o(488),t=o.n(e),r=o(436),n=o.n(r);function c(e){var o=e.url,i=e.id,c=void 0===i?"":i,u=e.moduleProps,s=e.fallback,f=void 0===s?"404":s,l=e.showLoading,d=void 0===l||l,p=e.loadingContent,h=void 0===p?"Loading...":p,v=e.debug,y=void 0!==v&&v,m=e.onLoaded,w=e.onError,g=(0,r.useState)(!1),b=t()(g,2),x=b[0],j=b[1],E=(0,r.useState)(!1),_=t()(E,2),O=_[0],S=_[1],k=(0,r.useMemo)((function(){return"fish-".concat(c.replace(" ",""))}),[c]),L=(0,r.useCallback)((function(e){j(!0),S(!1),console.error(e),"function"==typeof w&&w(e)}),[]),P=(0,r.useCallback)((function(){if(!o&&!c)throw new Error("Invalid Params");try{a(o,"#".concat(k),u,(function(){S(!1),"function"==typeof m&&m()}),(function(e){L(e)}),y)}catch(e){L(e)}}),[k,o,u,L]);return(0,r.useEffect)((function(){S(!0);try{P()}catch(e){L(e)}}),[k,o,u]),n().createElement("div",{style:{width:"100%",height:"100%"},className:"module-container"},d&&O&&n().createElement("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},h),n().createElement("div",{key:k,id:k},x&&f))}var a=function(e,t,r,n,o,i){if(!window.require||!window.fish)throw new Error("Fish Not Found");i&&console.log("[FishModule] info:",{url:e,containerId:t,moduleProps:r,callback:n,errorCb:o}),window.require([e],(function(e){try{var i;window.portalView?(i=new e(r),$(t).css({height:"calc(100% - 1px)",overflow:"hidden auto"}),window.portalView.setView(t,i),window.portalView.renderViews(t)):i=new e(window.fish.extend({el:$(t)},r)).render();var c=i.$el,a=c.parent().height()-c.outerHeight(),u=c.parent().innerHeight();c.outerHeight(Math.floor(u)),a>10&&i.resize(a),"function"==typeof n&&n(i)}catch(e){o(e)}}),(function(e){"function"==typeof o&&o(e)}))},u=o(706),s=o.n(u),f=o(402),l=o.n(f),d=o(191);var p=function(e){var t=d(e);return null!=e&&("object"==t||"function"==t)},h="object"==("undefined"==typeof global?"undefined":d(global))&&global&&global.Object===Object&&global,v="object"==("undefined"==typeof self?"undefined":d(self))&&self&&self.Object===Object&&self,y=h||v||Function("return this")(),m=function(){return y.Date.now()},w=/\s/;var g=function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t},b=/^\s+/;var x=function(e){return e?e.slice(0,g(e)+1).replace(b,""):e},j=y.Symbol,E=Object.prototype,_=E.hasOwnProperty,O=E.toString,S=j?j.toStringTag:void 0;var k=function(e){var t=_.call(e,S),r=e[S];try{e[S]=void 0;var n=!0}catch(e){}var o=O.call(e);return n&&(t?e[S]=r:delete e[S]),o},L=Object.prototype.toString;var P=function(e){return L.call(e)},M=j?j.toStringTag:void 0;var I=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":M&&M in Object(e)?k(e):P(e)};var T=function(e){return null!=e&&"object"==d(e)};var C=function(e){return"symbol"==d(e)||T(e)&&"[object Symbol]"==I(e)},N=/^[-+]0x[0-9a-f]+$/i,R=/^0b[01]+$/i,A=/^0o[0-7]+$/i,F=parseInt;var q=function(e){if("number"==typeof e)return e;if(C(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=x(e);var r=R.test(e);return r||A.test(e)?F(e.slice(2),r?2:8):N.test(e)?NaN:+e},D=Math.max,G=Math.min;var V=function(e,t,r){var n,o,i,c,a,u,s=0,f=!1,l=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function h(t){var r=n,i=o;return n=o=void 0,s=t,c=e.apply(i,r)}function v(e){return s=e,a=setTimeout(w,t),f?h(e):c}function y(e){var r=e-u;return void 0===u||r>=t||r<0||l&&e-s>=i}function w(){var e=m();if(y(e))return g(e);a=setTimeout(w,function(e){var r=t-(e-u);return l?G(r,i-(e-s)):r}(e))}function g(e){return a=void 0,d&&n?h(e):(n=o=void 0,c)}function b(){var e=m(),r=y(e);if(n=arguments,o=this,u=e,r){if(void 0===a)return v(u);if(l)return clearTimeout(a),a=setTimeout(w,t),h(u)}return void 0===a&&(a=setTimeout(w,t)),c}return t=q(t)||0,p(r)&&(f=!!r.leading,i=(l="maxWait"in r)?D(q(r.maxWait)||0,t):i,d="trailing"in r?!!r.trailing:d),b.cancel=function(){void 0!==a&&clearTimeout(a),s=0,n=u=o=a=void 0},b.flush=function(){return void 0===a?c:g(m())},b},H=o(15),B=o.n(H),U=o(411),W=o.n(U),Y=o(333),z=o.n(Y),J=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=document.createElement("script");t?r.src=e:r.text=e,r.type="module",document.getElementsByTagName("head")[0].appendChild(r)};function Q(e){return new Promise((function(t,r){try{if(!window.requirejs)throw new Error("Can't find window.requirejs");window.requirejs(e,(function(e){t(e)}),(function(e){r(e)}))}catch(e){r(e)}}))}function X(e){return new Promise((function(t,r){(null==e?void 0:e.length)>0?z()(e,{success:function(){t("loadjs")},error:r}):t("loadjs")}))}var K=function(){var e=W()(B()().mark((function e(t){var r,n,o,i,c,a,u,s,f,l,d=arguments;return B()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=d.length>1&&void 0!==d[1]?d[1]:"",window.localStorage.getItem("viteDevModule")!==t){e.next=6;break}return J("\n import RefreshRuntime from '".concat(r,"/").concat(t,"/@react-refresh'\n RefreshRuntime.injectIntoGlobalHook(window)\n window.$RefreshReg$ = () => {}\n window.$RefreshSig$ = () => (type) => type\n window.__vite_plugin_react_preamble_installed__ = true\n "),!1),J("".concat(r,"/").concat(t,"/@vite/client?t=").concat((new Date).getTime())),J("".concat(r,"/").concat(t,"/src/.fishx/fishx.ts?t=").concat((new Date).getTime())),e.abrupt("return",Promise.resolve());case 6:if(n=["".concat(r,"/").concat(t,"/asset-manifest.js")],i=window.define&&window.requirejs?Q:X,!window.define||!window.requirejs){e.next=14;break}return e.next=11,Q(n);case 11:o=e.sent,e.next=20;break;case 14:return e.next=16,X(n);case 16:if(e.sent){e.next=19;break}throw new Error("Load asset-manifest.js failed");case 19:o=window.assetManifest;case 20:if(o){e.next=22;break}throw new Error("Can't find window.assetManifest");case 22:return c=/\.(chunk.*.js)$/,a=/\.(chunk.*.css)$/,u=[],s=[],o["@@/devScripts.js"]&&u.push("".concat(r,"/").concat(t,"/").concat(o["@@/devScripts.js"]).replace("//","/")),o["runtime-main.js"]&&u.push("".concat(r,"/").concat(t,"/").concat(o["runtime-main.js"]).replace("//","/")),Object.keys(o).forEach((function(e){c.test(o[e])&&u.push("".concat(r,"/").concat(t,"/").concat(o[e]).replace("//","/")),a.test(o[e])&&-1===e.indexOf("p__")&&s.push("".concat(r,"/").concat(t,"/").concat(o[e]).replace("//","/"))})),u.push("".concat(r,"/").concat(t,"/").concat(o["main.js"]).replace("//","/")),f=Array.from(new Set(u)),l=Array.from(new Set(s)),e.abrupt("return",Promise.all([i([].concat(f)),X([].concat(l))]));case 33:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Z={attributes:!1,childList:!0,subtree:!0};var ee=function(e){var o=e.id,i=void 0===o?"":o,c=e.moduleName,a=e.path,u=void 0===a?"/":a,f=e.urlBasename,d=void 0===f?"":f,p=e.moduleProps,h=void 0===p?{}:p,v=e.fallback,y=void 0===v?"404":v,m=e.showLoading,w=void 0===m||m,g=e.loadingContent,b=void 0===g?"Loading...":g,x=e.debug,j=void 0!==x&&x,E=e.onLoaded,_=e.onError,O=h.menuComponentPrivs,S=(0,r.useMemo)((function(){return"child-module-".concat(i.replace(" ",""))}),[i]),k=(0,r.useState)(!1),L=t()(k,2),P=L[0],M=L[1],I=(0,r.useState)(!1),T=t()(I,2),C=T[0],N=T[1],R=(0,r.useRef)(null),A=(0,r.useRef)({id:i,isLoaded:!1,history:null,containerId:S}),F=(0,r.useRef)({isFetching:!1,fetched:!1}),q=(0,r.useCallback)(V((function(e){N(!1),M(!0),console.error(e),"function"==typeof _&&_(e)}),300),[]),$=(0,r.useCallback)(V((function(){try{if(M(!1),N(!1),document.getElementById(S)){var e=A.current;j&&console.log("[FishXModule] info:",{moduleName:c,containerId:S,path:u,moduleProps:h,onLoaded:E,onError:_});var t,r=i===e.id?e.history:null,n=0;if(window[c])t=window[c].render("#".concat(S),l()(l()({},h),{},{history:r}),u);else var o=setInterval((function(){try{n<5&&!t?(t=window[c]&&window[c].render("#".concat(S),l()(l()({},h),{},{history:r}),u))?clearInterval(o):n+=1:clearInterval(o)}catch(e){clearInterval(o),n=5}}),200);if(n>=5)throw new Error("".concat(c," Module Load Failed!"));e.isLoaded||(e.isLoaded=!0),e.id=i,e.containerId=S,e.history=t&&t.history}"function"==typeof E&&E()}catch(e){q(e)}}),500),[c,S,u,h,E,q,i,j,A.current]),D=(0,r.useCallback)((function(){F.current.isFetching||(F.current.isFetching=!0,K(c,d).then((function(){F.current.isFetching=!1,F.current.fetched=!0,$()})).then((function(){"function"==typeof E&&E()})).catch((function(e){q(e),F.current.isFetching=!1,F.current.fetched=!1})))}),[c,d,h]);(0,r.useEffect)((function(){M(!1),window[c]?$():(N(!0),D())}),[c,i,d,h]),(0,r.useEffect)((function(){return function(){try{var e=A.current;window[c]&&$&&$.cancel(),window[c]&&"function"==typeof window[c].unmount&&e.containerId&&(window[c].unmount("#".concat(e.containerId)),e.isLoaded=!1)}catch(e){q(e)}}}),[]);var G=(0,r.useCallback)(V((function(){Array.isArray(O)&&O.forEach((function(e){var t=document.querySelectorAll("[data-comp-code='".concat(e,"']"));t.length>0&&t.forEach((function(e){e.style.display="none"}))}))}),300),[O]);return(0,r.useEffect)((function(){var e=new MutationObserver((function(e){var t,r=s()(e);try{for(r.s();!(t=r.n()).done;){var n=t.value;"childList"===n.type?G():"attributes"===n.type&&console.log("The ".concat(n.attributeName," attribute was modified."))}}catch(e){r.e(e)}finally{r.f()}}));return R.current&&e.observe(R.current,Z),function(){e.disconnect()}}),[R.current,G]),n().createElement("div",{style:{width:"100%",height:"100%",overflow:"auto"},ref:R,className:"module-container"},w&&C&&n().createElement("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},b),!C&&P?y:n().createElement("div",{id:S,style:{width:"100%",height:"100%"},key:S}))},te=o(304),re=function(e){var o=e.id,i=e.url,c=e.appProps,a=e.loadingContent,u=e.fallback,s=void 0===u?"404":u,f=e.configuration,d=e.onLoaded,p=e.onError,h=(0,r.useState)(!1),v=t()(h,2),y=v[0],m=v[1],w=(0,r.useState)(!1),g=t()(w,2),b=g[0],x=g[1],j=(0,r.useMemo)((function(){return"qiankun-app-".concat(o)}),[o]),E=(0,r.useRef)(null),_=(0,r.useRef)(null),O=(0,r.useCallback)((function(e){x(!1),m(!0),console.error(e),"function"==typeof p&&p(e)}),[p]),S=(0,r.useCallback)(W()(B()().mark((function e(){return B()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!E.current){e.next=17;break}if(!_.current||"function"!=typeof _.current.update){e.next=5;break}_.current.update(l()({},c)),e.next=17;break;case 5:return x(!0),e.prev=6,_.current=(0,te.loadMicroApp)({name:o,entry:i,container:E.current,props:c},f),e.next=10,_.current.mountPromise;case 10:x(!1),"function"==typeof d&&d(_.current),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(6),O(e.t0);case 17:case"end":return e.stop()}}),e,null,[[6,14]])}))),[E,_,o,i,c,d,O]);return(0,r.useEffect)((function(){return S(),function(){_.current&&"function"==typeof _.current.unmount&&_.current.unmount()}}),[i,c,S,o]),n().createElement("div",{style:{width:"100%",height:"100%",overflow:"auto"},className:"module-container"},b&&n().createElement("div",{style:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},a),n().createElement("div",{id:j,style:{width:"100%",height:"100%"},key:j,ref:E},y&&s))}}(),i}()}));