@elliemae/pui-app-bridge 2.7.7 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/tests/scriptingObjects/appraisalServiceModule.js +7 -1
- package/dist/esm/tests/scriptingObjects/appraisalServiceModule.js +7 -1
- package/dist/public/frame.html +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/js/{emuiAppBridge.df8c5e6469e0b6137614.js → emuiAppBridge.91845bbe220933b0a591.js} +1 -1
- package/dist/public/js/emuiAppBridge.91845bbe220933b0a591.js.br +0 -0
- package/dist/public/js/{emuiAppBridge.df8c5e6469e0b6137614.js.gz → emuiAppBridge.91845bbe220933b0a591.js.gz} +0 -0
- package/dist/public/js/{emuiAppBridge.df8c5e6469e0b6137614.js.map → emuiAppBridge.91845bbe220933b0a591.js.map} +1 -1
- package/dist/types/lib/tests/scriptingObjects/appraisalServiceModule.d.ts +4 -2
- package/dist/types/lib/tests/server.d.ts +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/dist/public/js/emuiAppBridge.df8c5e6469e0b6137614.js.br +0 -0
|
@@ -26,6 +26,11 @@ var import_microfe_common = require("@elliemae/microfe-common");
|
|
|
26
26
|
class AppraisalService extends import_microfe_common.ScriptingObject {
|
|
27
27
|
#loanId;
|
|
28
28
|
#creditScore;
|
|
29
|
+
Close = new import_microfe_common.Event({
|
|
30
|
+
name: "Close",
|
|
31
|
+
requiresFeedback: false,
|
|
32
|
+
so: this
|
|
33
|
+
});
|
|
29
34
|
Unloading = new import_microfe_common.Event({
|
|
30
35
|
name: "Unloading",
|
|
31
36
|
requiresFeedback: false,
|
|
@@ -54,6 +59,7 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
|
|
|
54
59
|
los: "Encompass"
|
|
55
60
|
});
|
|
56
61
|
getParameters = () => Promise.resolve({
|
|
62
|
+
moduleId: "appraisalService",
|
|
57
63
|
loanId: this.#loanId,
|
|
58
64
|
creditScore: this.#creditScore
|
|
59
65
|
});
|
|
@@ -71,7 +77,7 @@ class AppraisalService extends import_microfe_common.ScriptingObject {
|
|
|
71
77
|
throw new Error("Not implemented");
|
|
72
78
|
};
|
|
73
79
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
74
|
-
|
|
80
|
+
showDialog = (options) => Promise.resolve("");
|
|
75
81
|
unload = async () => {
|
|
76
82
|
};
|
|
77
83
|
}
|
|
@@ -5,6 +5,11 @@ import { ScriptingObject, Event } from "@elliemae/microfe-common";
|
|
|
5
5
|
class AppraisalService extends ScriptingObject {
|
|
6
6
|
#loanId;
|
|
7
7
|
#creditScore;
|
|
8
|
+
Close = new Event({
|
|
9
|
+
name: "Close",
|
|
10
|
+
requiresFeedback: false,
|
|
11
|
+
so: this
|
|
12
|
+
});
|
|
8
13
|
Unloading = new Event({
|
|
9
14
|
name: "Unloading",
|
|
10
15
|
requiresFeedback: false,
|
|
@@ -33,6 +38,7 @@ class AppraisalService extends ScriptingObject {
|
|
|
33
38
|
los: "Encompass"
|
|
34
39
|
});
|
|
35
40
|
getParameters = () => Promise.resolve({
|
|
41
|
+
moduleId: "appraisalService",
|
|
36
42
|
loanId: this.#loanId,
|
|
37
43
|
creditScore: this.#creditScore
|
|
38
44
|
});
|
|
@@ -50,7 +56,7 @@ class AppraisalService extends ScriptingObject {
|
|
|
50
56
|
throw new Error("Not implemented");
|
|
51
57
|
};
|
|
52
58
|
// eslint-disable-next-line no-unused-vars, @typescript-eslint/no-unused-vars
|
|
53
|
-
|
|
59
|
+
showDialog = (options) => Promise.resolve("");
|
|
54
60
|
unload = async () => {
|
|
55
61
|
};
|
|
56
62
|
}
|
package/dist/public/frame.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><script>!function(e,t,n,a,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga")</script><style>.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="mobile-web-app-capable" content="yes"/><link rel="icon" href="/favicon.ico"/><title>Application</title><script>!function(e,t,n,a,c,o,s){e.GoogleAnalyticsObject=c,e[c]=e[c]||function(){(e[c].q=e[c].q||[]).push(arguments)},e[c].l=1*new Date,o=t.createElement(n),s=t.getElementsByTagName(n)[0],o.async=1,o.src="https://www.google-analytics.com/analytics.js",s.parentNode.insertBefore(o,s)}(window,document,"script",0,"ga")</script><style>.full-width{width:100%}.full-height{height:100%}</style><script defer="defer" src="js/emuiAppBridge.91845bbe220933b0a591.js"></script></head><body class="full-width full-height"><noscript>If you're seeing this message, that means <strong>JavaScript has been disabled on your browser</strong>, please <strong>enable JS</strong> to make this app work.</noscript><div id="pui-app-container-" class="full-width full-height"></div></body></html>
|
package/dist/public/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Host</title><script src="https://cdn.tailwindcss.com?plugins=forms"></script><script src="https://qa.assets.rd.elliemae.io/pui-diagnostics@3"></script><script defer="defer" src="js/emuiAppBridge.91845bbe220933b0a591.js"></script></head><body><header class="bg-indigo-300 h-10 flex place-items-center"><div class="px-2">ICE Mortgage Product</div></header><main class="mx-auto max-w-7xl px-2 sm:px-6 lg:px-8"><div class="min-w-0 flex-1 mt-4"><h1 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-3xl sm:tracking-tight">Loan Application</h1></div><div id="successFeedback" class="hidden rounded-md bg-green-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-green-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"/></svg></div><div class="ml-3"><p class="text-sm font-medium text-green-800">Loan Saved Successfully</p></div></div></div><div id="errorFeedback" class="hidden rounded-md bg-red-50 p-4"><div class="flex"><div class="flex-shrink-0"><svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.28 7.22a.75.75 0 00-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 101.06 1.06L10 11.06l1.72 1.72a.75.75 0 101.06-1.06L11.06 10l1.72-1.72a.75.75 0 00-1.06-1.06L10 8.94 8.28 7.22z" clip-rule="evenodd"/></svg></div><div class="ml-3"><h3 class="text-sm font-medium text-red-800">Credit Score is not meeting the requirement</h3></div></div></div><div class="mt-2 sm:grid sm:grid-cols-2 sm:gap-2"><form class="px-2 py-2 space-y-8 divide-y divide-gray-200 bg-gray-50"><div class="space-y-8 divide-y divide-gray-200 sm:space-y-5"><div class="space-y-6 sm:space-y-5"><div><h3 class="text-lg font-medium leading-6 text-gray-900">Personal Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="firstName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">First name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="firstName" id="firstName" autocomplete="given-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="John" placeholder="John"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="lastName" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Last name</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input name="lastName" id="lastName" autocomplete="family-name" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="Doe" placeholder="Doe"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="ssn" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">SSN</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="ssn" id="ssn" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="123456789" placeholder="123456789"/></div></div></div><div><h3 class="text-lg font-medium leading-6 text-gray-900">Loan Information</h3></div><div class="space-y-6 sm:space-y-5"><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="amount" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Amount</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="amount" id="amount" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="500000" placeholder="500000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="Term" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Term (years)</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="term" id="term" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="30" placeholder="30"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="downPayment" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Down Payment</label><div class="mt-1 sm:col-span-2 sm:mt-0"><input type="number" name="downPayment" id="downPayment" class="block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" value="50000" placeholder="50000"/></div></div><div class="sm:grid sm:grid-cols-3 sm:items-start sm:gap-4 sm:border-gray-200"><label for="creditScore" class="block text-sm font-medium text-gray-700 sm:mt-px sm:pt-2">Credit Score</label><div class="mt-1 sm:mt-0"><output id="creditScore" class="block w-full max-w-lg pl-2 pt-2 sm:max-w-xs sm:text-sm">NA</output></div><div class="mt-1 sm:mt-0"><button id="getCreditScore" type="button" class="inline-flex items-center rounded-full border border-transparent bg-indigo-600 p-1 text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg></button></div></div></div></div></div><button id="saveLoan" type="button" class="inline-flex items-center rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">Save</button></form><div id="aside-container" class="flex flex-col gap-4 items-start mt-4 border-2 p-2 rounded-lg border-dashed border-cyan-300 sm:mt-0"></div></div><div id="bottom-container" class="flex flex-col gap-4 items-start mt-4 p-2 sm:mt-0"></div></main><script src="./init.js" type="module"></script></body></html>
|
|
@@ -22,4 +22,4 @@
|
|
|
22
22
|
}
|
|
23
23
|
`,n),{}),Zr=t=>({space:{...t.spaces,xxxs:t.spaces[1],xxs:t.spaces[2],xxs2:t.spaces[3],xs:t.spaces[4],s:t.spaces[5],m:t.spaces[6],l:t.spaces[7],xl:t.spaces[8],xxl:t.spaces[9]},fontSizes:{...t.fontSizes,title:{500:t.fontSizes[3],600:t.fontSizes[4],700:t.fontSizes[5],800:t.fontSizes[6],900:t.fontSizes[7]},subTitle:{300:t.fontSizes[1],400:t.fontSizes[2]},label:{200:t.fontSizes[0],300:t.fontSizes[1],400:t.fontSizes[2]},value:{300:t.fontSizes[1],400:t.fontSizes[2],500:t.fontSizes[3],600:t.fontSizes[4]},hyperlink:{200:t.fontSizes[0],300:t.fontSizes[1],400:t.fontSizes[2]},microText:{200:t.fontSizes[0]}},fontWeights:{...t.fontWeights,thin:t.fontWeights[0],light:t.fontWeights[1],regular:t.fontWeights[3],semibold:t.fontWeights[5],bold:t.fontWeights[8]},lineHeights:{...t.lineHeights,r:t.lineHeights[0],m:t.lineHeights[1],l:t.lineHeights[2],xl:t.lineHeights[3]},letterSpacings:{normal:t.letterSpacings[0],tracked:t.letterSpacings[1],tight:t.letterSpacings[2],mega:t.letterSpacings[3]},fonts:{...t.fonts,default:t.fonts[0]},colors:{neutral:{"000":t.colors.neutral[0],"050":t.colors.neutral[1],"080":t.colors.neutral[2],100:t.colors.neutral[3],200:t.colors.neutral[4],300:t.colors.neutral[5],400:t.colors.neutral[6],500:t.colors.neutral[7],600:t.colors.neutral[8],700:t.colors.neutral[9],800:t.colors.neutral[10]},brand:{100:t.colors.brand[0],200:t.colors.brand[1],300:t.colors.brand[2],400:t.colors.brand[3],500:t.colors.brand[4],600:t.colors.brand[5],700:t.colors.brand[6],800:t.colors.brand[7]},success:{300:t.colors.success[0],400:t.colors.success[1],600:t.colors.success[2],900:t.colors.success[3],950:t.colors.success[4]},warning:{400:t.colors.warning[0],500:t.colors.warning[1],600:t.colors.warning[1],900:t.colors.warning[2],950:t.colors.warning[3]},danger:{200:t.colors.danger[0],400:t.colors.danger[1],600:t.colors.danger[2],900:t.colors.danger[3],950:t.colors.danger[4]}},shadows:{xs:t.shadows[0],s:t.shadows[1],m:t.shadows[2],l:t.shadows[3],xl:t.shadows[4]},breakpoints:{...t.breakpoints,small:t.breakpoints[0],medium:t.breakpoints[1],large:t.breakpoints[2]},media:Xr({small:t.breakpoints[0],medium:t.breakpoints[1],large:t.breakpoints[2]}),zIndex:{dialog:t.zIndex[0],popper:t.zIndex[1],tooltip:t.zIndex[2],backdrop:t.zIndex[3],loader:t.zIndex[4]},states:{_:t.states[0],motionSafe:t.states[1],motionReduce:t.states[2],first:t.states[3],last:t.states[4],odd:t.states[5],even:t.states[6],visited:t.states[7],checked:t.states[8],focusWithin:t.states[9],hover:t.states[10],focus:t.states[11],focusVisible:t.states[12],active:t.states[13],disabled:t.states[14],placeholder:t.states[15]}}),Jr=((t=ke())=>()=>Zr(t))(),Vn=()=>{try{return window.parent.document,window.parent}catch{return window}},tr=()=>({width:Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)}),xr=t=>Number(t.replace("px","")),Sr=()=>{const{width:t}=tr(),{breakpoints:n}=Jr();return t<=xr(n.small)?"small":t<=xr(n.medium)?"medium":"large"};var Qr=q(5402),_r=q.n(Qr),qr=q(5887),en=q.n(qr),tn=q(7579),rn=q.n(tn),nn=q(4339),on=q.n(nn),sn=q(2495),Ar=q.n(sn);const an=JSON.parse('{"appId":"microfe","activeEnv":"localhost","googleTagManager":true,"sessionTimeoutWarnInterval":"7200000","sessionTimeoutInterval":"9000000","microFrontendApps":{"loanapp":{"name":"Loan","hostUrl":"./loan","development":{"files":["index.js"]},"production":{"files":["index.js"]}},"taskapp":{"name":"Task","hostUrl":"./task","mode":"development","development":{"files":["index.dev.js"]},"production":{"files":["index.js"]}},"travelhub":{"name":"TravelHub","hostUrl":"./travelhub","development":{"files":["app.js","landing.js","app.css","landing.css"]},"production":{"files":["app.js","landing.js","app.css","landing.css"]}},"flights":{"name":"Flights","hostUrl":"./flights","development":{"files":["app.js","app.css"]},"production":{"files":["app.js","app.css"]}},"hotels":{"name":"Hotels","hostUrl":"./hotels","development":{"files":["app.js","app.css"]},"production":{"files":["app.js","app.css"]}}},"serviceEndpoints":{"api":"","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"},"env":{"localhost":{"serviceEndpoints":{"api":"","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"dev":{"serviceEndpoints":{"api":"https://dev.api.puiservice.rd.elliemae.io","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"dev2":{"serviceEndpoints":{"api":"https://int.api.ellielabs.com","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"qa":{"serviceEndpoints":{"api":"https://dev.api.puiservice.rd.elliemae.io","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"qa2":{"serviceEndpoints":{"api":"https://int.api.ellielabs.com","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"qa3":{"serviceEndpoints":{"api":"https://int.api.ellielabs.com","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"int":{"serviceEndpoints":{"api":"https://int.api.ellielabs.com","idp":"https://int.idp.ellielabs.com","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg-osb1":{"serviceEndpoints":{"api":"https://encompass-peg-api.elliemae.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg-osb2":{"serviceEndpoints":{"api":"https://encompass-peg2-api.elliemae.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg":{"serviceEndpoints":{"api":"https://peg2-west.api.ellielabs.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg-oapi-west":{"serviceEndpoints":{"api":"https://peg2-west.api.ellielabs.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg-oapi-east":{"serviceEndpoints":{"api":"https://peg2-east.api.ellielabs.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg2-oapi-east":{"serviceEndpoints":{"api":"https://peg2-east.api.ellielabs.com","idp":"https://peg.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"peg3":{"serviceEndpoints":{"api":"https://pel1.api.ellielabs.com","idp":"https://peg3.idp.ellielabs.com/authorize","logger":"https://int.api.ellielabs.com/diagnostics/v2/logging"}},"stage":{"serviceEndpoints":{"api":"https://stg.api.elliemae.com","idp":"https://stg.idp.elliemae.com/authorize","logger":"https://api.ellielabs.com/diagnostics/v2/logging"}},"beta":{"serviceEndpoints":{"api":"https://concept.api.elliemae.com","idp":"https://concept.idp.elliemae.com/authorize","logger":"https://api.ellielabs.com/diagnostics/v2/logging"}},"demo":{"serviceEndpoints":{"api":"https://concept.api.elliemae.com","idp":"https://concept.idp.elliemae.com/authorize","logger":"https://api.ellielabs.com/diagnostics/v2/logging"}},"epc":{"serviceEndpoints":{"api":"https://concept.api.elliemae.com","idp":"https://concept.idp.elliemae.com/authorize","logger":"https://api.ellielabs.com/diagnostics/v2/logging"}},"prod":{"serviceEndpoints":{"api":"https://api.elliemae.com","idp":"https://idp.elliemae.com/authorize","logger":"https://api.ellielabs.com/diagnostics/v2/logging"}}}}'),St="latest",rr=t=>t.replace(/([^:]\/)\/+/g,"$1"),Wn=t=>{const n=document.createElement("a");return n.href=t,n.href},Bt=t=>t?.replace?.(/\/?$/,"/"),cn=()=>window.navigator.userAgent.includes("jsdom");class ln{#e=an;#t;#r;constructor(n){this.#t=n?.version||St,this.#r=Bt(n?.baseUrl||"")}#n=n=>{const{activeEnv:o}=n,f=n.env[o]||{};n.env&&delete n.env,this.#e=Ar()(n,f)};get=(n="",o=null)=>_r()(en()(this.#e,n,o));set=(n,o)=>rn()(this.#e,n,o);has=(n="")=>on()(this.#e,n);load=async n=>{const o=this.#t.match(/^(?:\d+\.\d+)*/g),f=n??`${this.#r}${o&&o[0]||St}/app.config.json`,y=await fetch(f);if(y.ok)try{const x=await y.json();this.#n(x)}catch(x){if(!n&&this.#t!==St)await this.load(`${this.#r}latest/app.config.json`);else throw new Error("Failed to parse app config",{cause:x})}else{if(!n&&this.#t!==St){await this.load(`${this.#r}latest/app.config.json`);return}throw new Error("Failed to load app config")}}}const un="microFrontendApps",pn=()=>!0,fn=t=>pn()?!0:t?t==="production":!0,dn=t=>t?new URL(t).pathname:"",hn=t=>{const n=document.createElement("a");return n.href=t,n.href},gn=(t,n)=>{const o=n.match(/^(?:\d+\.\d+)*/g);return t.replace(/{SYSTEM_VERSION}/,o&&o[0]||St)},Er=t=>!t||!t.length?!1:t.every(n=>typeof n=="string"),mn=(t,n)=>{const{mode:o="production"}=n;if(o!=="production"&&o!=="development")throw new Error(`invalid mode '${o}' for ${t}`);const{production:f,development:y}=n;if(o==="production"){if(!f)throw new Error(`microFrontendApps.${t} is missing production section in app.config.json`);if(!Er(f.files))throw new Error("invalid value for production.files")}if(o==="development"){if(!y)throw new Error(`microFrontendApps.${t} is missing development section in app.config.json`);if(!Er(y.files))throw new Error("invalid value for development.files")}},vn=({id:t,config:n,version:o="latest"})=>{const{mode:f="production"}=n,y=fn(f)?n.production:n.development;n.production&&delete n.production,n.development&&delete n.development;const x=Ar()({id:t},{name:t,mode:"production",manifestPath:"./{SYSTEM_VERSION}/",securityContext:u.USER},n,y);return x.hostUrl=Bt(hn(x.hostUrl||"")),x.homeRoute=Bt(x.homeRoute)||dn(x.hostUrl),x.manifestPath=Bt(gn(x.manifestPath,o)),x};class yn{#e=[];init=({version:n,appConfig:o})=>{const f=o.get(un);if(!f)throw new Error("app.config.json is missing microFrontendApps section");this.#e=Object.keys(f).map(y=>(mn(y,f[y]),vn({id:y,config:f[y],version:n})))};getConfigById=n=>this.#e.find(o=>o.id===n)}const bn="ice-script-",wn=/(?:emuiDiagnostics|global|global-prod|emuiUserMonitoring)(?:..*)?.js/,xn=t=>!wn.test(t);class Sn{#e;constructor(n){this.#e=n}add=({name:n,hostUrl:o,documentEle:f,fileName:y,index:x})=>new Promise((O,I)=>{const N=new URL(y,o),k=f.createElement("script");k.id=`${bn}${n.toLowerCase()}-${x}`,k.src=rr(N.href),k.onload=O.bind(null,k.id),k.onerror=K=>{I(new Error(`Unable to load script ${k.src}`,{cause:new Error(K)}))},k.async=!1,!cn()&&xn(k.src)&&(k.defer=!0),f.head.appendChild(k)});remove=(n="",o=document)=>new Promise(f=>{const y=o.getElementById(n);y||(this.#e.warn(`script with id ${n} not found`),f()),y.remove(),f()});removeDynamicImportedScripts=(n,o)=>{const f=new RegExp(n,"i"),y=o.getElementsByTagName("script");for(let x=y.length-1;x>=0;x-=1){const O=y[x],{src:I}=O;f.test(I)&&O.remove()}};removePrefetchLinks=(n,o)=>{const f=new RegExp(n,"i"),y=o.querySelectorAll('[rel="prefetch"]');for(let x=y.length-1;x>=0;x-=1){const O=y[x],{href:I}=O;f.test(I)&&O.remove()}}}const An="ice-style-";class En{#e;constructor(n){this.#e=n}add=({name:n,hostUrl:o,documentEle:f,fileName:y,index:x})=>new Promise((O,I)=>{const N=f.createElement("link");N.id=`${An}${n.toLowerCase()}-${x}`,N.rel="stylesheet";const k=new URL(y,o);N.href=rr(k.href),N.onload=O.bind(null,N.id),N.onerror=K=>{I(new Error(`Unable to load stylesheet ${N.href}`,{cause:new Error(K)}))},f.head.appendChild(N)});remove=(n="",o=document)=>new Promise(f=>{const y=o.getElementById(n);y||(this.#e.warn(`style with id ${n} not found`),f()),y.remove(),f()});removeDynamicImportedStyles=(n,o)=>{const f=new RegExp(n,"i"),y=o.querySelectorAll('[rel="stylesheet"]');for(let x=y.length-1;x>=0;x-=1){const O=y[x],{href:I}=O;f.test(I)&&O.remove()}}}const Or=t=>t.replace(/\/\d+\.\d+/,"/latest"),On=t=>{let n;try{n=new URL(t)}catch{return!1}return n.protocol==="http:"||n.protocol==="https:"},Cr=async({hostUrl:t,manifestPath:n})=>{const o=new URL(`${n}manifest.json`,t),f=await fetch(rr(o.href));if(f.ok){const{headers:x}=f;if((x?.get?.("content-type")??"").includes("application/json"))return await f.json();throw new Error(`manifest ${o.href} is not a valid json`)}const y=Or(n);if(n!==y)return Cr({hostUrl:t,manifestPath:Or(n)});throw new Error(`unable to get manifest ${o.href}`)},Tr={get:Cr,getFullFileNameofAssets:(t,n=[])=>n.reduce((o,f)=>{const y=t[f];if(y)o.push(y);else if(On(f))o.push(f);else throw new Error(`unable to locate ${f} in manifest`);return o},[])};class Cn{#e;#t;#r;#n;#o;constructor(n){this.#t=n.guest,this.#e=n.logger,this.#r=n?.version||St,this.#n=n.soManager,this.#o=n.eventManager}addEventListener=n=>this.#o.subscribe(n);get version(){return this.#r}getObject=n=>Promise.resolve(this.#n.getObject(n,this.#t));removeEventListener=n=>{this.#o.unsubscribe(n)};setAppWindowSize=n=>{const{appId:o,size:f}=n,y=document.getElementById(`${ie}${o}`);y&&(y.style.height=`${f.height}px`)};subscribe=(n,o)=>(0,b.subscribe)(n,o);unsubscribe=n=>{(0,b.unsubscribe)(n)}}const jr="pui-app-container-",Tn=/\.css$/,jn=t=>Tn.test(t);class In{#e;#t;#r;#n;#o;#s=new yn;#i;#c;#a=new Map;constructor(n){const{logger:o}=n;if(!o)throw new Error("logger is required");this.#e=n.logger,this.#t=n.version,this.#o=new ln({version:n.version,baseUrl:n.appConfigBaseUrl}),this.#r=new Sn(o),this.#n=new En(o),this.#i=new C,this.#c=new se}#f=(n,o=document)=>{const{elementIds:f}=this.#a.get(n)||{};f&&f.forEach(y=>{const x=o.getElementById(y);x&&x.remove()})};#d=(n,o,f)=>{const y=window.emui?.[n]||{};this.#a.set(n,{elementIds:f,guest:{guestWindow:o?.defaultView,...y}})};#h=(n,o)=>{const{id:f,name:y,hostUrl:x,manifestPath:O,homeRoute:I,history:N,theme:k,documentEle:K}=n;return Promise.all(o).then(this.#d.bind(null,f,K)).then(this.#g.bind(null,{id:f,name:y,hostUrl:x,manifestPath:O,homeRoute:I,history:N,theme:k})).catch(Q=>{const ce=`Application load failed. Unable to load one or more resources for appId: ${n.id}. ${Q.message}`;throw this.#e.error({message:ce,appId:n.id,exception:Q}),new Error(ce)})};#g=async({id:n,name:o,hostUrl:f,manifestPath:y,homeRoute:x,history:O,theme:I})=>{const N=window.emui?.[n];if(!N)throw new Error(`Application ${o} with ${n} is not found. Most probably the appId property of app.config.json is not set to ${n}`);if(!N.init||typeof N.init!="function")throw new Error(`Application ${o} with id ${n} doesn't expose init method`);const k=new Cn({guest:{id:n},version:this.#t,logger:this.#e,soManager:this.#i,eventManager:this.#c});return N.init({host:k,hostUrl:f,manifestPath:y,homeRoute:x,prevState:null,history:O,theme:I,hostBreakpoint:Sr(),hostViewportSize:tr(),logger:this.#e})};#m=async n=>{const{id:o,files:f,name:y,hostUrl:x,documentEle:O}=n;this.#e.debug(`Application ${o} is loading...`);let I=f;const N=await Tr.get(n);I=Tr.getFullFileNameofAssets(N,f);let k=0;const K=I.map(Q=>{k+=1;const ce={name:y,hostUrl:x,documentEle:O,fileName:Q,index:k};return jn(Q)?this.#n.add(ce):this.#r.add(ce)});await this.#h(n,K),this.#e.audit({message:"Application loaded",appId:o})};#l=({id:n,hostUrl:o,documentEle:f})=>{this.#e.debug(`Application ${n} unloading...`),window.emui?.[n]&&(this.#f(n,f),this.#r.removeDynamicImportedScripts(o,f),this.#r.removePrefetchLinks(o,f),this.#n.removeDynamicImportedStyles(o,f),window.emui?.[n]&&delete window.emui[n],this.#a.delete(n),this.#e.info({message:"Application unloaded",appId:n}))};#u=async({id:n,name:o})=>{const f=window.emui?.[n]||{};if(!f?.mount||typeof f?.mount!="function")throw new Error(`Application ${o} with id ${n} doesn't expose mount method`);return f.mount({containerId:`${jr}${n}`,hostBreakpoint:Sr(),hostViewportSize:tr()})};#p=({id:n,name:o})=>{const f=window.emui?.[n]||{};if(!f?.unmount)return null;if(typeof f.unmount!="function")throw new Error(`Application ${o} with id ${n} doesn't expose unmount method`);return f.unmount({containerId:`${jr}${n}`})};addScriptingObject=(n,o)=>{this.#i.addScriptingObject(n,o)};closeAllApps=async()=>{await Promise.all([...this.#a.keys()].map(this.closeApp))};closeApp=async n=>{if(!n)throw new Error("id is required");const o=this.#s.getConfigById(n);if(!o)throw new Error(`Application with id ${n} is not found`);const{name:f,hostUrl:y}=o;try{await this.#p({id:n,name:f})}finally{const x=W.get(n);if(!x?.contentDocument)throw new Error(`Iframe for application with id ${n} is not found`);this.#l({id:n,hostUrl:y,documentEle:x.contentDocument}),this.#i.removeAllScriptingObjects(n),W.remove(n)}};dispatchEvent=async n=>this.#c.dispatchEvent(n);getGuest=n=>this.#a.get(n)?.guest;getGuests=()=>[...this.#a.values()].map(n=>n.guest);init=async()=>{await this.#o.load(),this.#s.init({version:this.#t,appConfig:this.#o})};mountApp=async n=>{if(!n)throw new Error("id is required");const o=this.#s.getConfigById(n);if(!o)throw new Error(`Application with id ${n} is not found`);await this.#u(o)};openApp=async n=>{const{id:o,frameOptions:f,history:y,theme:x}=n,O=this.#s.getConfigById(o);if(!O)throw new Error(`Application with id ${o} is not found`);if(W.get(o))throw new Error(`Application with id ${o} is already open`);const I=await W.create(o,{title:O.name,...f});if(!I?.contentDocument)throw new Error("unable to create iframe for the microapp");try{return await this.#m({...O,history:y,theme:x,documentEle:I.contentDocument}),await this.#u(O),this.#a.get(o)?.guest}catch(N){throw this.#l({id:o,hostUrl:O.hostUrl,documentEle:I.contentDocument}),W.remove(o),N}};publish=(n,o)=>(0,b.publish)(n,o);removeAllEventListeners=()=>{this.#c.unsubscribeAll()};removeScriptingObject=n=>{this.#i.removeScriptingObject(n)};unmountApp=async n=>{if(!n)throw new Error("id is required");const o=this.#s.getConfigById(n);if(!o)throw new Error(`Application with id ${n} is not found`);await this.#p(o)}}})(),Ht})());
|
|
24
24
|
|
|
25
|
-
//# sourceMappingURL=emuiAppBridge.
|
|
25
|
+
//# sourceMappingURL=emuiAppBridge.91845bbe220933b0a591.js.map
|
|
Binary file
|