@sava-info-systems/api-maker-with-extensions 1.19.3 → 1.19.5
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/1025.ad3d7fe2972421a7.js +1 -0
- package/dist/1097.f7edc9a254293cbe.js +1 -0
- package/dist/148.3d1172921fc38628.js +1 -0
- package/dist/1558.d77067ef3989dc57.js +1 -0
- package/dist/{1351.48e08341fba9b889.js → 1617.cd35a3a268fd8f90.js} +1 -1
- package/dist/1678.2c6fe869dc9df280.js +1 -0
- package/dist/1754.616b92791d39dab1.js +1 -0
- package/dist/1928.a299b3986d670379.js +1 -0
- package/dist/1957.cafa315c70f23efe.js +1 -0
- package/dist/2140.82e389d21656cd83.js +1 -0
- package/dist/2295.b066a00a7c4c4d9c.js +1 -0
- package/dist/238.6207cf874f0ff82a.js +1 -0
- package/dist/2473.6a522dcf87dfb922.js +1 -0
- package/dist/2714.1ed8bfd73f5693eb.js +1 -0
- package/dist/{3611.9577d58af5f1f4aa.js → 2735.880b4c038ef3207e.js} +1 -1
- package/dist/2908.c7cbde300e1840a4.js +1 -0
- package/dist/3081.e470a8aeed4a7745.js +1 -0
- package/dist/3139.7a6ebcaa6a5f38f6.js +1 -0
- package/dist/3450.68d8d179c9496764.js +1 -0
- package/dist/4110.1747a68dfaacbbd8.js +1 -0
- package/dist/4186.601304798e909236.js +1 -0
- package/dist/4211.b7a72c8db8263edf.js +1 -0
- package/dist/4575.987834c6e73af961.js +1 -0
- package/dist/4842.f89ded9e1e9f1110.js +1 -0
- package/dist/485.b333cf63f954b75c.js +1 -0
- package/dist/4895.95e42b567a89ce84.js +1 -0
- package/dist/5249.52aa732ef6a173c5.js +1 -0
- package/dist/5334.8ed5b236a6948681.js +1 -0
- package/dist/5421.e729ed3585afa9af.js +1 -0
- package/dist/5679.53292305f1448567.js +1 -0
- package/dist/5761.c363fe26244e8787.js +1 -0
- package/dist/5765.e70cd773673bfe27.js +1 -0
- package/dist/6236.b81e95926f7fcd60.js +1 -0
- package/dist/6393.1323e8b7d2cdae70.js +1 -0
- package/dist/6401.02e5b3cb94d0322a.js +1 -0
- package/dist/{8970.8eece52bbc1c316c.js → 6925.d59cabb0e343d24c.js} +1 -1
- package/dist/7368.4c04430d3efc5947.js +1 -0
- package/dist/{2442.adbc5b49349bb569.js → 7436.7e4876b9e90efde6.js} +1 -1
- package/dist/7470.9195bddaee5202e0.js +1 -0
- package/dist/7649.870e05f3aa978078.js +1 -0
- package/dist/7975.dbe6e674c50ab553.js +1 -0
- package/dist/7977.35ebfb6f4c9503b4.js +1 -0
- package/dist/7987.37367b65a76d5083.js +1 -0
- package/dist/8125.58e1a7a385797896.js +1 -0
- package/dist/8266.d665463de8b8d75a.js +1 -0
- package/dist/8296.32f107844a1381b6.js +1 -0
- package/dist/{3732.b5ac36f1448e215c.js → 8374.11d430ef2432bfba.js} +1 -1
- package/dist/{6589.b9c83295e466e464.js → 8682.5bde1163690a18dc.js} +1 -1
- package/dist/8841.6cb824dd9d5ad8f8.js +1 -0
- package/dist/885.e3d53b62c51f8311.js +1 -0
- package/dist/{9785.35cc7f0c3778344e.js → 891.333c6913b8246e3c.js} +1 -1
- package/dist/913.7d41933171ab9fbe.js +1 -0
- package/dist/9243.c223cdbc4cd84cb8.js +1 -0
- package/dist/9575.0a35a4da70f9e6e5.js +1 -0
- package/dist/9939.218315684234eb18.js +1 -0
- package/dist/common.442040891fd4ef29.js +1 -0
- package/dist/index.html +1 -1
- package/dist/main.9630ecd9c9613e82.js +1 -0
- package/dist/polyfills.93062920aa87d580.js +1 -0
- package/dist/runtime.21919a870e05d69b.js +1 -0
- package/main.js +1 -1
- package/package.json +4 -4
- package/sandbox/sandbox.js +1 -1
- package/src/tools/local-client.js +1 -1
- package/dist/1417.5caf023140e7c67f.js +0 -1
- package/dist/1468.d42293f7d802a787.js +0 -1
- package/dist/1959.a22fe393419f10c5.js +0 -1
- package/dist/2162.3c94f3d66c6312d5.js +0 -1
- package/dist/2818.71176f4848a9419f.js +0 -1
- package/dist/3488.ada60be2dbcd9845.js +0 -1
- package/dist/3545.b5585792e9fe1447.js +0 -1
- package/dist/3605.3c6cdf2a08c47301.js +0 -1
- package/dist/3621.412300a009ea6346.js +0 -1
- package/dist/379.d3e61f3350a595dc.js +0 -1
- package/dist/3929.9ac933e926943db2.js +0 -1
- package/dist/4092.71b0eccc0cb429f0.js +0 -1
- package/dist/4124.a8329e77343e7087.js +0 -1
- package/dist/4316.542be541e58dff84.js +0 -1
- package/dist/4344.d8f42d425eaec852.js +0 -1
- package/dist/4689.e827720779e0cf34.js +0 -1
- package/dist/4709.262c34f60b50ebc9.js +0 -1
- package/dist/4774.a4368f3ce2e778da.js +0 -1
- package/dist/4880.70ca405524206be7.js +0 -1
- package/dist/5011.ed9a6465223f760d.js +0 -1
- package/dist/5090.c8bf74c35b0a5d26.js +0 -1
- package/dist/5140.581ccd2699e2a8a8.js +0 -1
- package/dist/5362.912e053f78479e90.js +0 -1
- package/dist/5442.186b40719e7c1da9.js +0 -1
- package/dist/5455.a1d0d507419e3c59.js +0 -1
- package/dist/5729.f0ee236ba6579a94.js +0 -1
- package/dist/5826.44efead20568788a.js +0 -1
- package/dist/6053.67f38f7b35484475.js +0 -1
- package/dist/6220.b6c29e6e3e717880.js +0 -1
- package/dist/6415.a48241737e134178.js +0 -1
- package/dist/6679.c5073d3a60b67e2e.js +0 -1
- package/dist/6828.36c6805f2b3c6f38.js +0 -1
- package/dist/6866.4dd76a41246a20be.js +0 -1
- package/dist/6882.fe03a3df377ca119.js +0 -1
- package/dist/7014.5db4db60cc21782e.js +0 -1
- package/dist/7152.dab3cc50472f703f.js +0 -1
- package/dist/7367.ba1e63db0f9b97f4.js +0 -1
- package/dist/7374.ebfe1004d1773912.js +0 -1
- package/dist/7597.177f15771dcdea42.js +0 -1
- package/dist/7759.2b4ed39a62323abd.js +0 -1
- package/dist/807.dba59148bbbbe7fb.js +0 -1
- package/dist/8219.2c97945d465ab185.js +0 -1
- package/dist/8447.8caa67c3eb5d2b55.js +0 -1
- package/dist/9036.876c1f0c1ce4e82b.js +0 -1
- package/dist/9347.4e7d02eee86c5778.js +0 -1
- package/dist/9429.9299aa0abda3dc76.js +0 -1
- package/dist/9882.a94c746b42e5fc0e.js +0 -1
- package/dist/9957.47ed0e74bdfeddd5.js +0 -1
- package/dist/common.d4eb1616e93e21e1.js +0 -1
- package/dist/main.1da32156380b46d5.js +0 -1
- package/dist/polyfills.9cbb1c8222a6b6c3.js +0 -1
- package/dist/runtime.212fca73d6a42b3a.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1025],{4061:(_e,k,c)=>{c.d(k,{T:()=>K});var S=c(5861),e=c(328),P=c(7850),A=c(6990),E=c(6212),O=c(1162),n=c(4946),I=c(95),w=c(7240),Z=c(262),W=c(9961),G=c(7414),i=c(5852),Y=c(3429),Q=c(2189),J=c(4977),V=c(2559),H=c(7629),U=c(1429),q=c(6814),N=c(5219),j=c(7680),D=c(3965);function R(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Database"),n.qZA(),n.TgZ(3,"p-dropdown",9),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.database=p.value,n.KtG(r.loadCollections(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allDatabases)("ngModel",s.tab.database)("filter",!0)}}function X(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"Collections"),n.qZA(),n.TgZ(3,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.collection=p.value,n.KtG(r.loadInstanceAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allCollections)("ngModel",s.tab.collection)("filter",!0)}}function z(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"Instances"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.instance=p.value,n.KtG(r.loadDatabases(!0))}),n.qZA()(),n.YNc(5,R,4,3,"div",8),n.YNc(6,X,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allInstances)("ngModel",s.tab.instance)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.INSTANCES)}}function ee(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",2)(1,"span",3),n._uU(2,"API Versions"),n.qZA(),n.TgZ(3,"p-dropdown",10),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw(2);return r.tab.tpStoreApiVersion=p.value,n.KtG(r.loadThirdPartyAPIs(!0))}),n.qZA()()}if(2&f){const s=n.oxw(2);n.xp6(3),n.Q6J("options",s.tab.allStoreApiVersions)("ngModel",s.tab.tpStoreApiVersion)("filter",!0)}}function L(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",1)(1,"div",2)(2,"span",3),n._uU(3,"API Bundle"),n.qZA(),n.TgZ(4,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return r.tab.tpApiBundle=p.value,n.KtG(r.loadStoreApiVersions(!0))}),n.qZA()(),n.YNc(5,ee,4,3,"div",8),n.qZA()}if(2&f){const s=n.oxw();n.xp6(4),n.Q6J("options",s.tab.allApiBundles)("ngModel",s.tab.tpApiBundle)("filter",!0),n.xp6(1),n.Q6J("ngIf",s.tab.apiCategory.id===s.EAPICategory.THIRD_PARTY_APIS)}}function F(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function te(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ne(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,F,2,1,"span",16),n.YNc(4,te,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function ae(f,y){1&f&&n.YNc(0,ne,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function oe(f,y){if(1&f&&(n.TgZ(0,"span",18),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function se(f,y){if(1&f&&(n.TgZ(0,"span",19),n._uU(1),n.qZA()),2&f){const s=n.oxw(2).$implicit;n.xp6(1),n.hij(" - ",s.category.toLowerCase(),"")}}function ie(f,y){if(1&f&&(n.TgZ(0,"div")(1,"span"),n._uU(2),n.qZA(),n.YNc(3,oe,2,1,"span",16),n.YNc(4,se,2,1,"span",17),n.qZA()),2&f){const s=n.oxw().$implicit;n.xp6(2),n.Oqu(s.name),n.xp6(1),n.Q6J("ngIf","SCHEMA"===s.category),n.xp6(1),n.Q6J("ngIf","GEN"===s.category)}}function re(f,y){1&f&&n.YNc(0,ie,5,3,"div",15),2&f&&n.Q6J("ngIf",y.$implicit)}function ce(f,y){if(1&f){const s=n.EpF();n.TgZ(0,"div",11)(1,"div",1)(2,"div",12)(3,"span",3),n._uU(4,"APIs"),n.qZA(),n.TgZ(5,"p-dropdown",4),n.NdJ("onChange",function(p){n.CHM(s);const r=n.oxw();return n.KtG(r.tab.api=p.value)}),n.YNc(6,ae,1,1,"ng-template",13),n.YNc(7,re,1,1,"ng-template",14),n.qZA()()()()}if(2&f){const s=n.oxw();n.xp6(5),n.Q6J("options",s.tab.apiList)("ngModel",s.tab.api)("filter",!0)}}function B(f,y){1&f&&n._UZ(0,"p-progressSpinner",20)}let K=(()=>{class f{fb;generalS;webSocketEventsS;ns;constantsS;authCS;instanceS;navigationCS;tpStoreApiVersionS;tpInstalledApisS;functionS;dataProviderS;cd;EFormMode=e.D;form;subscriptions=[];tab={};apiCategories;loading={dropdown:!0};EAPICategory=P.R;tpAPIVersionMap={};apiCategoriesMap={};dbIdMap={};colIdMap={};tpLibraryMap={};tpPIMap={};constructor(s,t,p,r,d,C,l,g,v,T,h,_,b){this.fb=s,this.generalS=t,this.webSocketEventsS=p,this.ns=r,this.constantsS=d,this.authCS=C,this.instanceS=l,this.navigationCS=g,this.tpStoreApiVersionS=v,this.tpInstalledApisS=T,this.functionS=h,this.dataProviderS=_,this.cd=b}ngOnInit(){this.loadApiCategories().then()}loadApiCategories(){var s=this;return(0,S.Z)(function*(){const t=s.dataProviderS.getApiCategoriesForWebSocketAndGroup();s.apiCategories=t.filter(r=>r.id!==P.R.SCHEDULERS&&r.id!==P.R.EVENTS),s.apiCategoriesMap=A.keyBy(s.apiCategories,O.GR.id);const p=s.navigationCS.getQueryParam(E.p.at_category);p&&s.tab&&(s.tab.apiCategory=A.find(s.apiCategories,{id:p})),s.tab.apiCategory||(s.tab.apiCategory=s.apiCategories[0]),yield s.apiCategoryChangedEvent(!1),yield s.categorySelected(!1),s.cd.detectChanges()})()}apiCategoryChangedEvent(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.tab.apiCategory.id===P.R.INSTANCES?yield t.loadInstances(s):t.tab.apiCategory.id===P.R.THIRD_PARTY_APIS?yield t.loadLibraries(s):t.tab.apiCategory.id===P.R.CUSTOM_APIS?yield t.loadCustomAPIs(s):t.tab.apiCategory.id===P.R.SYSTEM_APIS&&(yield t.loadSystemAPIs(s)),t.loading.dropdown=!1})()}loadInstances(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("INSTANCE"),yield t.categorySelected(s),t.loading.dropdown=!0;try{const r={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(r).toPromise()).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allInstances=[]}const p=t.navigationCS.getQueryParam(E.p.at_instance);p&&(t.tab.instance=A.find(t.tab.allInstances,{name:p})),!t.tab.instance&&t.tab.allInstances.length&&(t.tab.instance=t.tab.allInstances[0]),yield t.loadDatabases(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadDatabases(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("DATABASE"),yield t.setInstanceInURL(s),!t.tab.instance)return t.tab.allDatabases=[],t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=A.keyBy(t.tab.allDatabases,O.N7.db)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allDatabases=[]}const p=t.navigationCS.getQueryParam(E.p.at_database);p&&(t.tab.database=A.find(t.tab.allDatabases,{db:p})),!t.tab.database&&t.tab.allDatabases.length&&(t.tab.database=t.tab.allDatabases[0]),yield t.loadCollections(s),t.loading.dropdown=!1})()}loadCollections(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("COLLECTION"),yield t.setDatabaseInURL(s),!t.tab.instance||!t.tab.database)return t.tab.allCollections=[],void(t.tab.apiList=[]);try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=A.keyBy(t.tab.allCollections,O.GR.name)}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.allCollections=[]}const p=t.navigationCS.getQueryParam(E.p.at_collection);t.tab.collection=p?A.find(t.tab.allCollections,{name:p}):t.tab.allCollections[0],yield t.loadInstanceAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadInstanceAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setCollectionInURL(s),!t.tab.instance||!t.tab.database||!t.tab.collection)return t.tab.apiList=[],void(t.loading.dropdown=!1);try{const r=t.tab.collection;r.removeStreamApisInResponse=!0,t.tab.apiList=(yield t.instanceS.instanceAPIList([r])).data||[]}catch(r){t.ns.showErrorMessageFromErrorObject(r),t.tab.apiList=[]}const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadLibraries(s){var t=this;return(0,S.Z)(function*(){t.resetDependentObjects("LIBRARY"),t.loading.dropdown=!0,t.tab.allApiBundles=yield t.tpStoreApiVersionS.getAllAPIBundles(),t.tpLibraryMap=A.keyBy(t.tab.allApiBundles,"value");const p=t.navigationCS.getQueryParam(E.p.at_bundleName);p&&(t.tab.tpApiBundle=A.find(t.tab.allApiBundles,{value:p})),!t.tab.tpApiBundle&&t.tab.allApiBundles.length&&(t.tab.tpApiBundle=t.tab.allApiBundles[0]),yield t.loadStoreApiVersions(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadStoreApiVersions(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,t.resetDependentObjects("API_VERSION"),yield t.setLibraryInURL(s),!t.tab.tpApiBundle)return t.tab.allStoreApiVersions=[],void(t.tab.apiList=[]);t.tab.allStoreApiVersions=yield t.tpStoreApiVersionS.getAllStoreApiVersions([t.tab.tpApiBundle.value]);const p=t.navigationCS.getQueryParam(E.p.at_bundleName),r=t.navigationCS.getQueryParam(E.p.at_apiVersion);r&&(t.tab.tpStoreApiVersion=A.find(t.tab.allStoreApiVersions,{apiBundleName:p,storeApiVersion:r})),!t.tab.tpStoreApiVersion&&t.tab.allStoreApiVersions.length&&(t.tab.tpStoreApiVersion=t.tab.allStoreApiVersions[0]),yield t.loadThirdPartyAPIs(s),t.loading.dropdown=!1,t.cd.detectChanges()})()}loadThirdPartyAPIs(s){var t=this;return(0,S.Z)(function*(){if(t.loading.dropdown=!0,yield t.setTPApiVersionInURL(s),!t.tab.tpApiBundle||!t.tab.tpStoreApiVersion)return void(t.tab.apiList=[]);t.tab.apiList=(yield t.tpInstalledApisS.getThirdPartyAPIListArray([t.tab.tpStoreApiVersion]).toPromise()).data,t.tpPIMap=A.keyBy(t.tab.apiList,O.iH._id);const p=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(p)})()}loadCustomAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.functionS.getFunctionsAsAPI().toPromise();p.success&&p.data&&p.data.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}loadSystemAPIs(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0;const p=yield t.instanceS.systemAPIList().toPromise();p?.data?.length&&(t.tab.apiList=p.data||[]);const r=t.navigationCS.getQueryParam(E.p.at_api);yield t.apiCommon(r)})()}apiCommon(s){var t=this;return(0,S.Z)(function*(){t.loading.dropdown=!0,s?(t.tab.api=A.find(t.tab.apiList,{id:s}),t.tab.api||(t.tab.api=A.find(t.tab.apiList,{name:s}))):t.tab.api=t.tab.apiList[0],yield t.setApiInURL(),t.loading.dropdown=!1})()}categorySelected(s){var t=this;return(0,S.Z)(function*(){t.tab.apiCategory&&(yield t.navigationCS.setQueryParam(E.p.at_category,t.tab.apiCategory.id),s&&(yield t.generalS.resetUrlParams([E.p.at_instance,E.p.at_database,E.p.at_collection,E.p.at_bundleName,E.p.at_apiVersion,E.p.at_api])))})()}resetDependentObjects(s){"INSTANCE"===s?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===s?(this.tab.allDatabases=this.tab.allCollections=this.tab.apiList=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===s?(this.tab.allCollections=this.tab.apiList=[],this.tab.collection=this.tab.api=void 0):"LIBRARY"===s?(this.tab.allApiBundles=this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpApiBundle=this.tab.api=this.tab.tpStoreApiVersion=void 0):"API_VERSION"===s&&(this.tab.allStoreApiVersions=this.tab.apiList=[],this.tab.tpStoreApiVersion=this.tab.api=void 0)}setInstanceInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.instance&&t.tab.instance._id&&(yield t.navigationCS.setQueryParam(E.p.at_instance,t.tab.instance._id),s&&(yield t.generalS.resetUrlParams([E.p.at_database,E.p.at_collection,E.p.at_api])))})()}setDatabaseInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.database&&t.tab.database._id&&(yield t.navigationCS.setQueryParam(E.p.at_database,t.tab.database._id),s&&(yield t.generalS.resetUrlParams([E.p.at_collection,E.p.at_api])))})()}setCollectionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.collection&&t.tab.collection._id&&(yield t.navigationCS.setQueryParam(E.p.at_collection,t.tab.collection._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setLibraryInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpApiBundle&&t.tab.tpApiBundle.value&&(yield t.navigationCS.setQueryParam(E.p.at_bundleName,t.tab.tpApiBundle.value),s&&(yield t.generalS.resetUrlParams([E.p.at_apiVersion,E.p.at_api])))})()}setTPApiVersionInURL(s){var t=this;return(0,S.Z)(function*(){t.tab.tpStoreApiVersion&&t.tab.tpStoreApiVersion._id&&(yield t.navigationCS.setQueryParam(E.p.at_apiVersion,t.tab.tpStoreApiVersion._id),s&&(yield t.generalS.resetUrlParams([E.p.at_api])))})()}setApiInURL(){var s=this;return(0,S.Z)(function*(){s.tab?.api?.id&&(yield s.navigationCS.setQueryParam(E.p.at_api,s.tab.api.id))})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(t){return new(t||f)(n.Y36(I.qu),n.Y36(w.b),n.Y36(Z.a),n.Y36(W.W),n.Y36(G.L),n.Y36(i.D),n.Y36(Y.E),n.Y36(Q.S),n.Y36(J.f),n.Y36(V.d),n.Y36(H.d),n.Y36(U.B),n.Y36(n.sBO))};static \u0275cmp=n.Xpm({type:f,selectors:[["app-web-socket-events-form-second"]],decls:13,vars:7,consts:[[1,"container","mt-3"],[1,"row"],[1,"col-4"],[1,"small"],["optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["class","row",4,"ngIf"],["class","container mt-3 mb-3",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["class","col-4",4,"ngIf"],["optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],["optionLabel","displayText","filterBy","displayText","appendTo","body","styleClass","w-100 p-input-filled",3,"options","ngModel","filter","onChange"],[1,"container","mt-3","mb-3"],[1,"col-8"],["pTemplate","item"],["pTemplate","selectedItem"],[4,"ngIf"],["class","small text-success italic",4,"ngIf"],["class","small text-info italic",4,"ngIf"],[1,"small","text-success","italic"],[1,"small","text-info","italic"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(t,p){1&t&&(n.TgZ(0,"div")(1,"div",0)(2,"div",1)(3,"div",2)(4,"span",3),n._uU(5,"API Category"),n.qZA(),n.TgZ(6,"p-dropdown",4),n.NdJ("onChange",function(d){return p.tab.apiCategory=d.value,p.apiCategoryChangedEvent(!0)}),n.qZA()()()(),n.TgZ(7,"div",0),n.YNc(8,z,7,5,"div",5),n.qZA(),n.TgZ(9,"div",0),n.YNc(10,L,6,4,"div",5),n.qZA(),n.YNc(11,ce,8,3,"div",6),n.YNc(12,B,1,0,"p-progressSpinner",7),n.qZA()),2&t&&(n.xp6(6),n.Q6J("options",p.apiCategories)("ngModel",p.tab.apiCategory)("filter",!0),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.INSTANCES),n.xp6(2),n.Q6J("ngIf",p.tab.apiCategory.id===p.EAPICategory.THIRD_PARTY_APIS),n.xp6(1),n.Q6J("ngIf",p.tab.apiCategory.id!==p.EAPICategory.WEB_SOCKET_EVENT),n.xp6(1),n.Q6J("ngIf",p.loading.dropdown))},dependencies:[I.JJ,I.On,q.O5,N.jx,j.G,D.Lt],encapsulation:2})}return f})()},2726:(_e,k,c)=>{c.d(k,{x:()=>h});var S=c(5861),e=c(4946),P=c(3157),A=c(328),o=c(6990),O=c(5085),n=c(6212),I=c(1162),w=c(6925),Z=c(7240),W=c(9961),G=c(262),i=c(5852),Y=c(7414),Q=c(2915),J=c(5405),V=c(7629),H=c(2189),U=c(5219),q=c(7664),N=c(95),j=c(6814),D=c(5431),R=c(7680),X=c(3259),z=c(8057),ee=c(8980);const L=["webSocketEventsManFormC"];function F(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.navigateToTreeView())}),e._UZ(1,"i",18),e.qZA()}}function te(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.edit())}),e._UZ(1,"i",20),e.qZA()}}function ne(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(a);const u=e.oxw(2);return e.KtG(u.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function ae(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,te,2,0,"span",15),e.YNc(5,ne,2,0,"span",16),e.qZA()}if(2&_){const a=e.oxw();e.xp6(3),e.Q6J("ngIf",a.rows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length),e.xp6(1),e.Q6J("ngIf",a.selectedRows.length)}}function oe(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const M=e.oxw();return e.KtG(M.eventCenterS.group.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.group.apisRegex.allWebSocketEvents)("binary",!0)}}function se(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(u){e.CHM(a);const M=e.oxw();return e.KtG(M.eventCenterS.filterInLog.apisRegex.allWebSocketEvents=u)}),e.qZA()()()}if(2&_){const a=e.oxw();e.xp6(2),e.Q6J("ngModel",a.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)("binary",!0)}}function ie(_,b){if(1&_&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&_){const a=e.oxw();e.xp6(2),e.Oqu(a.constantsS.group.allWebSocketEventsPermitted)}}function re(_,b){1&_&&(e.TgZ(0,"th",36),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ce(_,b){1&_&&e._UZ(0,"th",37)}function B(_,b){1&_&&e._UZ(0,"th",38)}function K(_,b){if(1&_&&(e.TgZ(0,"tr"),e.YNc(1,re,2,0,"th",32),e.YNc(2,ce,1,0,"th",33),e.TgZ(3,"th",34),e._uU(4,"API Category"),e.qZA(),e.TgZ(5,"th"),e._uU(6,"Name"),e.qZA(),e.YNc(7,B,1,0,"th",35),e.qZA()),2&_){const a=e.oxw(2);e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(1),e.Q6J("ngIf",!a.isDependentOnGroup&&!a.isLPM&&!a.isFilterLogTable),e.xp6(5),e.Q6J("ngIf",a.isLPM)}}function f(_,b){if(1&_&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",41),e.qZA()),2&_){const a=e.oxw().$implicit;e.xp6(1),e.Q6J("value",a)("pSelectableRow",a)}}function y(_,b){if(1&_&&(e.TgZ(0,"td",42)(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().rowIndex;e.xp6(2),e.Oqu(a+1)}}function s(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA(),e.TgZ(11,"span"),e._uU(12," \u2192 "),e.qZA(),e.TgZ(13,"span"),e._uU(14),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.instanceNameUI),e.xp6(4),e.Oqu(a.databaseName),e.xp6(4),e.Oqu(a.collectionName),e.xp6(4),e.Oqu(a.apiNameUI)}}function t(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA(),e.TgZ(3,"span"),e._uU(4," \u2192 "),e.qZA(),e.TgZ(5,"span"),e._uU(6),e.qZA(),e.TgZ(7,"span"),e._uU(8," \u2192 "),e.qZA(),e.TgZ(9,"span"),e._uU(10),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiBundleNameUI),e.xp6(4),e.Oqu(a.storeApiVersionUI),e.xp6(4),e.Oqu(a.apiNameUI)}}function p(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function r(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function d(_,b){if(1&_&&(e.TgZ(0,"div")(1,"span"),e._uU(2),e.qZA()()),2&_){const a=e.oxw().$implicit;e.xp6(2),e.Oqu(a.apiNameUI)}}function C(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div")(1,"label",43)(2,"p-checkbox",44),e.NdJ("ngModelChange",function(){e.CHM(a);const u=e.oxw(2).$implicit,M=e.oxw(2);return e.KtG(M.checkedChangeGridItem(u))})("ngModelChange",function(u){e.CHM(a);const M=e.oxw(2).$implicit;return e.KtG(M.saveResponseInLog=u)}),e.qZA()()()}if(2&_){const a=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",a.saveResponseInLog)("binary",!0)}}function l(_,b){if(1&_&&(e.TgZ(0,"td"),e.YNc(1,C,3,2,"div",6),e.qZA()),2&_){const a=e.oxw().$implicit,m=e.oxw(2);e.xp6(1),e.Q6J("ngIf",m.selectedRows.indexOf(a)>=0)}}function g(_,b){if(1&_&&(e.TgZ(0,"tr",39),e.YNc(1,f,2,2,"td",6),e.YNc(2,y,3,1,"td",40),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e.YNc(6,s,15,4,"div",6),e.YNc(7,t,11,3,"div",6),e.YNc(8,p,3,1,"div",6),e.YNc(9,r,3,1,"div",6),e.YNc(10,d,3,1,"div",6),e.qZA(),e.YNc(11,l,2,1,"td",6),e.qZA()),2&_){const a=b.$implicit,m=e.oxw(2);e.Q6J("pSelectableRow",a),e.xp6(1),e.Q6J("ngIf",m.showCheckbox),e.xp6(1),e.Q6J("ngIf",!m.isDependentOnGroup&&!m.isLPM&&!m.isFilterLogTable),e.xp6(2),e.Oqu(a.categoryUI),e.xp6(2),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.INSTANCES),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.THIRD_PARTY_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.SYSTEM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.CUSTOM_APIS),e.xp6(1),e.Q6J("ngIf",a.apiCategory===m.EAPICategory.WEB_SOCKET_EVENT),e.xp6(1),e.Q6J("ngIf",m.isLPM)}}function v(_,b){1&_&&e._UZ(0,"p-progressSpinner",45)}function T(_,b){if(1&_){const a=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(u){e.CHM(a);const M=e.oxw();return e.KtG(M.selectedRows=u)})("selectionChange",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.webSocketEventSelected())})("dblclick",function(){e.CHM(a);const u=e.oxw();return e.KtG(u.dblClickWebSocketEvent())}),e.YNc(2,K,8,3,"ng-template",29),e.YNc(3,g,12,10,"ng-template",30),e.qZA(),e.YNc(4,v,1,0,"p-progressSpinner",31),e.qZA()}if(2&_){const a=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",a.metaKeySelection)("selection",a.selectedRows)("dataKey",a.gridKey)("scrollable",!0)("value",a.rows),e.xp6(3),e.Q6J("ngIf",a.loading.grid)}}let h=(()=>{class _{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;showCheckbox=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:A.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=I.iH._id;EAPICategory=O.R;ERequestMethod=w.Yp;webSocketEventsManFormC;constructor(a,m,u,M,x,le,de,pe,me,ge,ve,fe){this.generalS=a,this.notificationS=m,this.webSocketEventsS=u,this.authCS=M,this.constantsS=x,this.eventCenterS=le,this.cd=de,this.eventCenterCS=pe,this.functionS=me,this.navigationCS=ge,this.confirmationService=ve,this.router=fe}ngOnInit(){var a=this;this.loadGridData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(m=>{(m.action===P.F.SAVED||m.action===P.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadGridData().then())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var m=(0,S.Z)(function*(u){u.length&&(yield a.loadGridData())});return function(u){return m.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(m=>{m&&this.loadGridData().then()})),this.generalS.setNewTitle("API Maker - WebSocket Events")}loadGridData(){var a=this;return(0,S.Z)(function*(){if(a.isDependentOnGroup&&0===a.eventCenterS.group.selectedGroups.value.length)return void a.resetGridAndUrl();a.loading.grid=!0;const m=yield a.webSocketEventsS.getWSEventKGrid({}).toPromise();m.success?(a.selectedRows=[],a.rows=m.data,a.rowsMap=o.keyBy(a.rows,I.iH._id),a.rowsMapName=o.keyBy(a.rows,I.of.id)):a.resetGridAndUrl();const u=a.navigationCS.getQueryParam(n.p.am_ws_event)||(a.isFilterLogTable?a.eventCenterS.filterInLog.webSocketIds.value.join(","):a.eventCenterS.group.webSocketIds.value.join(","));if(u){const M=u.split(","),x=o.intersection(o.keys(a.rowsMap),M),le=[];for(const de of x)a.rowsMap[de]&&le.push(a.rowsMap[de]);a.selectedRows=le,a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next(le),a.eventCenterS.filterInLog.webSocketIds.next(x)}if(a.isDependentOnGroup&&a.eventCenterS.group.webSocketIds.value.length&&(a.selectedRows=a.generalS.getObjectsFromIdArray(a.eventCenterS.group.webSocketIds.value,a.rowsMap),a.eventCenterS.group.webSocketApis.next(a.selectedRows)),a.isLPM&&a.eventCenterS.group.selectedGroups.value[0]?.queryParams?.webSocketEventNames?.length){const M=a.eventCenterS.group.selectedGroups.value[0];for(const x of M?.queryParams?.webSocketEventNames)a.rowsMapName[x]&&(a.rowsMapName[x].saveResponseInLog=M.webSocketEventsLog?.[x]?.saveResponseInLog||!1);a.setResDataInEventCenter()}setTimeout(()=>{a.loading.grid=!1,a.cd.detectChanges()},100)})()}add(){this.data.formData=void 0,this.data.mode=A.D.ADD,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}view(){this.data.formData=this.selectedRows[0],this.data.mode=A.D.VIEW,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_VIEW_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=A.D.EDIT,this.data.eventChannel.emit({action:P.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal()}removePermanentDialog(){var a=this;return(0,S.Z)(function*(){var m;a.confirmationService.confirm({message:a.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(m=(0,S.Z)(function*(){yield a.removePermanent()}),function(){return m.apply(this,arguments)})})})()}removePermanent(){var a=this;return(0,S.Z)(function*(){a.loading.grid=!0;const m=yield a.webSocketEventsS.permanentDelete(a.selectedRows[0]._id).toPromise();a.loading.grid=!1,m.success?(a.notificationS.showSuccess(a.constantsS.webSocketEvents.removePermanent),a.resetGridAndUrl(),a.loadGridData().then(),a.selectedRows=[]):a.notificationS.showErrorFromResponse(m,a.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}dblClickWebSocketEvent(){this.selectedRows.length&&this.edit()}navigateToTreeView(){this.router.navigate(["api-info","web-socket-events","layout-tree"]).then()}resetThisUrl(){var a=this;return(0,S.Z)(function*(){a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield a.navigationCS.setQueryParam(n.p.am_ws_event,null)})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.webSocketApis.next(this.selectedRows),this.eventCenterS.group.selectedWebSocket.next(this.selectedRows),this.eventCenterS.group.webSocketIds.next(o.map(this.selectedRows,"_id"))),this.isFilterLogTable&&this.eventCenterS.filterInLog.webSocketApis.next(this.selectedRows)}webSocketEventSelected(){var a=this;return(0,S.Z)(function*(){if(a.fillData().then(),a.selectedRows?.[0]){const m=(a.selectedRows[0]?.nameUI||"").split("/");a.generalS.setNewTitle(m[m.length-1],O.R.WEB_SOCKET_EVENT)}})()}fillData(){var a=this;return(0,S.Z)(function*(){if(!a.selectedRows.length)return yield a.navigationCS.setQueryParam(n.p.am_ws_event,""),a.eventCenterS.group.webSocketIds.next([]),a.eventCenterS.group.webSocketApis.next([]),a.eventCenterS.filterInLog.webSocketIds.next([]),void a.eventCenterS.filterInLog.webSocketApis.next([]);if(a.isDependentOnGroup||a.isFilterLogTable)a.eventCenterS.group.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.group.webSocketApis.next(a.selectedRows),a.isFilterLogTable&&(a.eventCenterS.filterInLog.webSocketIds.next(o.map(a.selectedRows,"_id")),a.eventCenterS.filterInLog.webSocketApis.next(a.selectedRows));else{const m=(yield a.webSocketEventsS.getById(a.selectedRows[0]._id).toPromise()).data;m._id?(yield a.navigationCS.setQueryParam(n.p.am_ws_event,m._id),a.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([m])):a.resetThisUrl()}})()}checkedChangeGridItem(a){var m=this;setTimeout((0,S.Z)(function*(){m.selectedRows.push(a),m.selectedRows=o.uniq(m.selectedRows);for(const u in m.rowsMap){const M=m.rowsMap[u];-1===m.selectedRows.indexOf(M)&&(M.saveResponseInLog=!1)}m.setResDataInEventCenter(),m.cd.detectChanges()}),100)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(m){return new(m||_)(e.Y36(Z.b),e.Y36(W.W),e.Y36(G.a),e.Y36(i.D),e.Y36(Y.L),e.Y36(Q.u),e.Y36(e.sBO),e.Y36(J.M),e.Y36(V.d),e.Y36(H.S),e.Y36(U.YP),e.Y36(q.F0))};static \u0275cmp=e.Xpm({type:_,selectors:[["app-web-socket-events-grid"]],viewQuery:function(m,u){if(1&m&&e.Gf(L,5),2&m){let M;e.iGM(M=e.CRH())&&(u.webSocketEventsManFormC=M.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],showCheckbox:"showCheckbox",isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All WebSocket Events",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Tree View",1,"fas","fa-sitemap","text-yellow","fa-fw","fa-rotate-270"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All WebSocket Events",1,"float-right","cursor-pointer"],[1,"align-middle","mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped ws-events-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 45px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","200px"],["style","width: 60px;",4,"ngIf"],[2,"width","45px"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(m,u){1&m&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," WebSocket Events"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,ae,6,3,"span",6),e.YNc(9,oe,3,2,"span",7),e.YNc(10,se,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,ie,3,1,"div",6),e.YNc(13,T,5,7,"div",9),e.qZA()(),e._UZ(14,"app-web-socket-events-man-form",10,11)),2&m&&(e.xp6(8),e.Q6J("ngIf",!u.isDependentOnGroup&&!u.isLPM&&!u.isFilterLogTable),e.xp6(1),e.Q6J("ngIf",u.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",u.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),e.xp6(1),e.Q6J("ngIf",!(u.eventCenterS.group.apisRegex.allWebSocketEvents||u.eventCenterS.filterInLog.apisRegex.allWebSocketEvents)),e.xp6(1),e.Q6J("data",u.data))},dependencies:[N.JJ,N.On,j.O5,D.iA,U.jx,D.Ei,D.UA,D.Mo,R.G,X.u,z.XZ,ee.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return _})()},8980:(_e,k,c)=>{c.d(k,{D:()=>r});var S=c(5861),e=c(95),P=c(3157),A=c(328),o=c(7850),E=c(6990),n=c(9361),I=c(6212),w=c(1162),Z=c(553),W=c(3531),G=c(9989),i=c(4946),Y=c(7240),Q=c(262),J=c(9961),V=c(7414),H=c(5852),U=c(2304),q=c(2559),N=c(3429),j=c(4977),D=c(2189),R=c(6814),X=c(2660),z=c(5860),ee=c(756),L=c(7680),F=c(4844),te=c(3259),ne=c(8057),ae=c(4061);const oe=["webSocketEventsFormSecondC"],se=["insertCodeModalC"];function ie(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",30),i._uU(2," Add WebSocket Event"),i.qZA())}function re(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",31),i._uU(2," View WebSocket Event"),i.qZA())}function ce(d,C){1&d&&(i.TgZ(0,"span"),i._UZ(1,"i",32),i._uU(2," Edit WebSocket Event"),i.qZA())}function B(d,C){1&d&&(i.TgZ(0,"div",33)(1,"div",34)(2,"span",35),i._uU(3,"Name"),i.qZA(),i._UZ(4,"input",36),i.qZA()())}function K(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"div",37)(1,"app-monaco-editor",38),i.NdJ("editorGenerated",function(v){i.CHM(l);const T=i.oxw();return i.KtG(T.editorGenerated(v))}),i.qZA()()}if(2&d){const l=i.oxw();i.xp6(1),i.Q6J("isSchemaEditor",!0)("editorOptions",l.editorOptionsSchedulers)}}function f(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Save"),i.qZA())}function y(d,C){1&d&&(i.TgZ(0,"span"),i._uU(1,"Update"),i.qZA())}function s(d,C){if(1&d){const l=i.EpF();i.TgZ(0,"button",39),i.NdJ("click",function(){i.CHM(l);const v=i.oxw();return i.KtG(v.save())}),i._UZ(1,"i",40),i.YNc(2,f,2,0,"span",4),i.YNc(3,y,2,0,"span",4),i.qZA()}if(2&d){const l=i.oxw();i.xp6(2),i.Q6J("ngIf",l.data.mode===l.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",l.data.mode===l.EFormMode.EDIT)}}function t(d,C){1&d&&i._UZ(0,"p-progressSpinner",41)}const p=function(d){return{"text-danger font-weight-bold":d}};let r=(()=>{class d{fb;generalCS;webSocketEventsS;ns;constantsS;authCS;monacoS;tpInstalledApisS;instanceS;tpStoreApiVersionS;navigationCS;cd;data;EFormMode=A.D;form;subscriptions=[];loading={form:!1};EAPICategory=o.R;reqActiveIndex=0;tabIndexReq={Basic:0,Code:1,Intervals:2};BE_HOST_PORT=Z.N.BE_HOST_PORT;DOCS_HOST_PORT=Z.N.DOCS_HOST_PORT;shouldLoadMonacoEditor=!1;editorWSNotifications;editorOptionsSchedulers={readOnly:!1,language:"typescript",contextmenu:!0};wsFormSecondC;insertCodeModalC;constructor(l,g,v,T,h,_,b,a,m,u,M,x){this.fb=l,this.generalCS=g,this.webSocketEventsS=v,this.ns=T,this.constantsS=h,this.authCS=_,this.monacoS=b,this.tpInstalledApisS=a,this.instanceS=m,this.tpStoreApiVersionS=u,this.navigationCS=M,this.cd=x}ngOnInit(){var l=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var g=(0,S.Z)(function*(v){if(v)if(l.form.enable(),v.action===P.F.OPEN_FORM_IN_EDIT_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),yield l.editModelLoadData(T.data),l.form.patchValue(T.data)}else if(v.action===P.F.OPEN_FORM_IN_VIEW_MODE){if(!l.data.formData)return;const T=yield l.webSocketEventsS.getById(l.data.formData._id).toPromise();l.form.reset(),l.form.patchValue(T.data),l.form.disable()}else if(v.action===P.F.OPEN_FORM_IN_ADD_MODE){l.form.reset();const T=yield l.instanceS.getDefaultContent(l.BE_HOST_PORT,o.R.WEB_SOCKET_EVENT_CAN_USER_CONNECT_CODE).toPromise();l.generalCS.setValueInEditor(l,"editorWSNotifications",T.data)}});return function(v){return g.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[e.kI.required]],runOnNativeProcess:[!1,[]]})}showInsertCodeModel(){this.generalCS.messageReceivedFor=n.H.All,this.insertCodeModalC.showModal(W.b.WebSocketFormC)}showModal(){var l=this;return(0,S.Z)(function*(){l.shouldLoadMonacoEditor=!0,$("#idWebSocketEventsForm").modal("show"),setTimeout((0,S.Z)(function*(){yield l.wsFormSecondC.loadApiCategories()}),100)})()}hideModal(){$("#idWebSocketEventsForm").modal("hide")}editModelLoadData(l){var g=this;return(0,S.Z)(function*(){if(yield g.wsFormSecondC.categorySelected(!0),g.wsFormSecondC.tab.apiCategory=g.wsFormSecondC.apiCategoriesMap[l.apiCategory],yield g.navigationCS.setQueryParam(I.p.at_category,l.apiCategory),l.apiCategory===o.R.SYSTEM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.systemApiName);else if(l.apiCategory===o.R.CUSTOM_APIS)yield g.navigationCS.setQueryParam(I.p.at_api,l.customApiName);else if(l.apiCategory===o.R.INSTANCES)yield g.navigationCS.setQueryParam(I.p.at_instance,l.instanceName),yield g.navigationCS.setQueryParam(I.p.at_database,l.databaseName),yield g.navigationCS.setQueryParam(I.p.at_collection,l.collectionName),yield g.navigationCS.setQueryParam(I.p.at_api,l.instanceApiName);else if(l.apiCategory===o.R.THIRD_PARTY_APIS){const v=(yield g.tpInstalledApisS.query({find:{bundleName:l.tpInstalledApiBundleName,apiVersion:l.tpInstalledApiVersion,name:l.tpInstalledApiName,user:l.user,active:!0},limit:1}).toPromise())?.data?.[0];if(v){const T=(yield g.tpStoreApiVersionS.query({find:{apiBundleName:v.bundleName,storeApiVersion:v.apiVersion,user:v.user,active:!0},limit:1}).toPromise()).data?.[0];yield g.navigationCS.setQueryParam(I.p.at_bundleName,v.bundleName),yield g.navigationCS.setQueryParam(I.p.at_apiVersion,T.storeApiVersion),yield g.navigationCS.setQueryParam(I.p.at_api,v.name)}}g.generalCS.setValueInEditor(g,"editorWSNotifications",l.canUserConnectViaWSCode||"")})()}save(){var l=this;return(0,S.Z)(function*(){try{l.loading.form=!0;const g=l.form.getRawValue();let v;g.user=l.authCS.getUserId(),g.apiCategory=l.wsFormSecondC.tab.apiCategory.id,v=l.data.formData&&l.data.formData._id?(yield l.webSocketEventsS.getById(l.data.formData._id).toPromise()).data:{};const T=E.find(v.versions||[],{isActive:!0});T&&(T.apiCodeStr=l.editorWSNotifications.getValue());const h=Object.assign({},v,g);h.user=l.authCS.getUserId(),h.canUserConnectViaWSCode=l.editorWSNotifications.getValue();for(const b of h?.versions||[])b.version=b.version.toString();if(h.apiCategory===o.R.WEB_SOCKET_EVENT&&!h.name)return l.ns.showError("Please provide websocket events name.");let _;h.apiCategory===o.R.CUSTOM_APIS&&(h.customApiName=l.wsFormSecondC.tab.api.customApiName),h.apiCategory===o.R.SYSTEM_APIS&&(h.systemApiName=l.wsFormSecondC.tab.api.systemApiId),h.apiCategory===o.R.THIRD_PARTY_APIS&&(h.tpInstalledApiBundleName=l.wsFormSecondC.tab.api.bundleName,h.tpInstalledApiVersion=l.wsFormSecondC.tab.api.apiVersion,h.tpInstalledApiName=l.wsFormSecondC.tab.api.name),h.apiCategory===o.R.INSTANCES&&(h.instanceName=l.wsFormSecondC.tab.instance.name,h.databaseName=l.wsFormSecondC.tab.database.db,h.collectionName=l.wsFormSecondC.tab.collection.name,h.instanceApiName=l.wsFormSecondC.tab.api.id),h.apiCategory!==o.R.WEB_SOCKET_EVENT&&delete h.name,l.data.mode===A.D.ADD?_=yield l.webSocketEventsS.post(h).toPromise():l.data.mode===A.D.EDIT&&(_=yield l.webSocketEventsS.put(l.data.formData._id,h,{select:w.iH._id}).toPromise()),_&&(l.ns.showSuccess(l.data.mode===A.D.ADD?l.constantsS.webSocketEvents.addSuccess:l.constantsS.webSocketEvents.editSuccess),l.data.eventChannel.emit({action:l.data.mode===A.D.ADD?P.F.SAVED:P.F.UPDATED})),l.loading.form=!1}catch(g){l.loading.form=!1,l.ns.showErrorFromResponse(g.error||g,"Unable to save websocket event.")}l.cd.detectChanges()})()}editorGenerated(l){var g=this;return(0,S.Z)(function*(){g.editorWSNotifications=l,yield g.monacoS.loadSchemaEditorSettings(g.BE_HOST_PORT,g.authCS.getUserId(),null),g.monacoS.addSaveCodeKeyBinding(l,v=>{g.form.valid&&g.save()}),g.monacoS.addInsertCodeKeyBinding(l,v=>{g.generalCS.messageReceivedFor=n.H.All,g.data.mode!==A.D.VIEW&&g.insertCodeModalC.showModal(W.b.WebSocketFormC)}),g.subscriptions.push(g.generalCS.messageReceived.subscribe(v=>{v.type&&v.type===G.g.TEXT_COPIED&&v.componentName===W.b.WebSocketFormC&&(g.monacoS.insertAtCursor(l,v.selectedText),g.insertCodeModalC.hideModal())}))})()}ngOnDestroy(){this.generalCS.unsubscribe(this.subscriptions)}ISchedulerProps=w.qH;static \u0275fac=function(g){return new(g||d)(i.Y36(e.qu),i.Y36(Y.b),i.Y36(Q.a),i.Y36(J.W),i.Y36(V.L),i.Y36(H.D),i.Y36(U.b),i.Y36(q.d),i.Y36(N.E),i.Y36(j.f),i.Y36(D.S),i.Y36(i.sBO))};static \u0275cmp=i.Xpm({type:d,selectors:[["app-web-socket-events-man-form"]],viewQuery:function(g,v){if(1&g&&(i.Gf(oe,5),i.Gf(se,5)),2&g){let T;i.iGM(T=i.CRH())&&(v.wsFormSecondC=T.first),i.iGM(T=i.CRH())&&(v.insertCodeModalC=T.first)}},inputs:{data:"data"},decls:34,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idWebSocketEventsForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-xl"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],[1,"w-100",3,"activeIndex","activeIndexChange"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],["webSocketEventsFormSecondC",""],["class","form-group row m-0",4,"ngIf"],[1,"form-group","row"],[1,"col-12"],[1,"align-middle","mb-0","ml-3"],["formControlName","runOnNativeProcess","pTooltip","Code will run on actual process and not in sandbox, so be careful with code. You can not use sandbox packages in this mode. You can use all Node.js packages + some packages on which API Maker is dependent on. You can use features of global variable 'g'.","label","Run Code On Native Process",3,"ngClass","binary"],["header","Code"],["class","overflow-hidden mb-3","style","height: calc(100vh - 270px);",4,"ngIf"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"form-group","row","m-0"],[1,"col-4"],[1,"small"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","level1/level2/name",1,"form-control","form-control-sm"],[1,"overflow-hidden","mb-3",2,"height","calc(100vh - 270px)"],[3,"isSchemaEditor","editorOptions","editorGenerated"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(g,v){if(1&g&&(i.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),i.YNc(4,ie,3,0,"span",4),i.YNc(5,re,3,0,"span",4),i.YNc(6,ce,3,0,"span",4),i.TgZ(7,"div",5)(8,"button",6)(9,"span",7),i._UZ(10,"i",8),i.qZA()(),i.TgZ(11,"span",9),i.NdJ("click",function(){return v.showInsertCodeModel()}),i._UZ(12,"i",10),i.qZA()()(),i.TgZ(13,"div",11)(14,"p-tabView",12),i.NdJ("activeIndexChange",function(h){return v.reqActiveIndex=h}),i.TgZ(15,"p-tabPanel",13)(16,"form",14),i._UZ(17,"app-web-socket-events-form-second",null,15),i.YNc(19,B,5,0,"div",16),i.TgZ(20,"div",17)(21,"div",18)(22,"label",19),i._UZ(23,"p-checkbox",20),i.qZA()()()()(),i.TgZ(24,"p-tabPanel",21),i.YNc(25,K,2,2,"div",22),i.qZA()()(),i.TgZ(26,"div",23)(27,"button",24),i._UZ(28,"i",25),i._uU(29," Close"),i.qZA(),i.YNc(30,s,4,2,"button",26),i.qZA(),i.YNc(31,t,1,0,"p-progressSpinner",27),i.qZA()()(),i._UZ(32,"app-insert-code-modal",28,29)),2&g){const T=i.MAs(18);i.xp6(4),i.Q6J("ngIf",v.data.mode===v.EFormMode.ADD),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.data.mode===v.EFormMode.EDIT),i.xp6(8),i.Q6J("activeIndex",v.reqActiveIndex),i.xp6(2),i.Q6J("formGroup",v.form),i.xp6(3),i.Q6J("ngIf",T.tab.apiCategory.id===v.EAPICategory.WEB_SOCKET_EVENT),i.xp6(4),i.Q6J("ngClass",i.VKq(14,p,!0===v.form.get(v.ISchedulerProps.runOnNativeProcess).value))("binary",!0),i.xp6(2),i.Q6J("ngIf",v.shouldLoadMonacoEditor),i.xp6(5),i.Q6J("ngIf",v.data.mode!==v.EFormMode.VIEW),i.xp6(1),i.Q6J("ngIf",v.loading.form),i.xp6(1),i.Q6J("frameId","idInsertCodeWebSocketFrame")("modalId","idInsertCodeWebSocketModal")("docsHostPort",v.DOCS_HOST_PORT)}},dependencies:[e._Y,e.Fj,e.JJ,e.JL,e.sg,e.u,R.mk,R.O5,X.y,z.P,ee.O,L.G,F.xf,F.x4,te.u,ne.XZ,ae.T],encapsulation:2})}return d})()},1025:(_e,k,c)=>{c.r(k),c.d(k,{WebSocketEventsM:()=>s});var S=c(7664),e=c(7017),P=c(3726),o=(c(4061),c(4946)),E=c(2726);let O=(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-grid"]],decls:2,vars:1,consts:[[1,"pt-1","pl-1","pr-1"],[3,"showCheckbox"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-grid",1),o.qZA()),2&d&&(o.xp6(1),o.Q6J("showCheckbox",!1))},dependencies:[E.x],encapsulation:2})}return t})();var n=c(5861),I=c(3157),w=c(328),Z=c(5085),W=c(6212),G=c(1162),i=c(6925),Y=c(7240),Q=c(9961),J=c(262),V=c(5852),H=c(7414),U=c(2915),q=c(5405),N=c(7629),j=c(2189),D=c(5219),R=c(6814),X=c(1396),z=c(7680),ee=c(3259),L=c(8980);const F=["webSocketEventsManFormC"];function te(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",19),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.edit())}),o._UZ(1,"i",20),o.qZA()}}function ne(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"span",21),o.NdJ("click",function(){o.CHM(r);const C=o.oxw();return o.KtG(C.removePermanentDialog())}),o._UZ(1,"i",22),o.qZA()}}function ae(t,p){if(1&t&&(o.TgZ(0,"div")(1,"div",23),o._uU(2),o.qZA()()),2&t){const r=o.oxw();o.xp6(2),o.Oqu(r.constantsS.group.allWebSocketEventsPermitted)}}function oe(t,p){if(1&t&&(o.TgZ(0,"div"),o._uU(1),o.qZA()),2&t){const r=o.oxw().$implicit;o.xp6(1),o.Oqu(r.label)}}const se=function(t,p,r,d){return{get:t,put:p,post:r,delete:d}};function ie(t,p){if(1&t&&(o.TgZ(0,"div")(1,"span",25),o._uU(2),o.qZA(),o.TgZ(3,"span"),o._uU(4),o.qZA()()),2&t){const r=o.oxw().$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngClass",o.l5B(3,se,r.data.requestMethod===d.ERequestMethod.GET,r.data.requestMethod===d.ERequestMethod.PUT,r.data.requestMethod===d.ERequestMethod.POST,r.data.requestMethod===d.ERequestMethod.DELETE)),o.xp6(1),o.Oqu(r.data.requestMethod),o.xp6(2),o.Oqu(r.data.name||r.label)}}function re(t,p){if(1&t){const r=o.EpF();o.TgZ(0,"div",24),o.NdJ("click",function(){const l=o.CHM(r).$implicit,g=o.oxw();return l.children&&(l.isExpanded=!0),o.KtG(g.selectedRows=[l._id])}),o.YNc(1,oe,2,1,"div",12),o.YNc(2,ie,5,8,"div",12),o.qZA()}if(2&t){const r=p.$implicit,d=o.oxw();o.xp6(1),o.Q6J("ngIf",(null==r.children?null:r.children.length)||(null==r||null==r.data?null:r.data.apiCategory)!==d.EAPICategory.CUSTOM_APIS),o.xp6(1),o.Q6J("ngIf",!(null!=r.children&&r.children.length)&&(null==r||null==r.data?null:r.data.apiCategory)===d.EAPICategory.CUSTOM_APIS)}}function ce(t,p){1&t&&o._UZ(0,"p-progressSpinner",26)}let B=(()=>{class t{generalS;notificationS;webSocketEventsS;authCS;constantsS;eventCenterS;cd;eventCenterCS;functionS;navigationCS;confirmationService;router;isReadOnly=!1;loading={grid:!1};subscriptions=[];data={mode:w.D.ADD,eventChannel:new o.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=G.iH._id;EAPICategory=Z.R;ERequestMethod=i.Yp;treeNodes=[];allTreeItemsMap={};leafSelected=!1;webSocketEventsManFormC;constructor(r,d,C,l,g,v,T,h,_,b,a,m){this.generalS=r,this.notificationS=d,this.webSocketEventsS=C,this.authCS=l,this.constantsS=g,this.eventCenterS=v,this.cd=T,this.eventCenterCS=h,this.functionS=_,this.navigationCS=b,this.confirmationService=a,this.router=m}ngOnInit(){this.loadTreeData().then(),this.subscriptions.push(this.data.eventChannel.subscribe(r=>{(r.action===I.F.SAVED||r.action===I.F.UPDATED)&&(this.webSocketEventsManFormC.hideModal(),this.loadTreeData().then())})),this.generalS.setNewTitle("API Maker - WebSocket Events")}add(){this.data.formData=void 0,this.data.mode=w.D.ADD,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_ADD_MODE}),this.webSocketEventsManFormC.showModal().then()}edit(){this.selectedRows.length&&(this.data.formData=this.selectedRows[0].data,this.data.mode=w.D.EDIT,this.data.eventChannel.emit({action:I.F.OPEN_FORM_IN_EDIT_MODE}),this.webSocketEventsManFormC.showModal().then())}removePermanentDialog(){var r=this;return(0,n.Z)(function*(){var d;r.confirmationService.confirm({message:r.constantsS.webSocketEvents.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(d=(0,n.Z)(function*(){yield r.removePermanent()}),function(){return d.apply(this,arguments)})})})()}removePermanent(){var r=this;return(0,n.Z)(function*(){r.loading.grid=!0;const d=r.selectedRows[0].data,C=yield r.webSocketEventsS.permanentDelete(d._id).toPromise();r.loading.grid=!1,C.success?(r.notificationS.showSuccess(r.constantsS.webSocketEvents.removePermanent),r.resetGridAndUrl(),r.loadTreeData().then(),r.selectedRows=[]):r.notificationS.showErrorFromResponse(C,r.constantsS.webSocketEvents.removePermanentError)})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={},this.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([])}navigateToGrid(){var r=this;return(0,n.Z)(function*(){r.router.navigate(["api-info","web-socket-events","layout-grid"]).then()})()}loadTreeData(){var r=this;return(0,n.Z)(function*(){const d=(yield r.functionS.getWSEventKTree().toPromise()).data;for(const l of d)r.generalS.convertKTreeItemToPrimeNGTreeItem(l);const C={};r.generalS.getMapOfAllItems(C,d),r.generalS.setIsExpandedStateFromOldMap(r.allTreeItemsMap,C),r.treeNodes=d,r.allTreeItemsMap=C,r.loading.grid=!1,r.cd.detectChanges()})()}resetThisUrl(){var r=this;return(0,n.Z)(function*(){r.eventCenterS.webSocketEvents.selectedWebSocketEvents.next([]),yield r.navigationCS.setQueryParam(W.p.am_ws_event,null)})()}selectedKeysChange(){var r=this;return(0,n.Z)(function*(){if(r.selectedRows.length){const d=r.selectedRows[0];d.children?.length?r.leafSelected=!1:(r.leafSelected=!0,d&&d?.label?r.generalS.setNewTitle(d.label,Z.R.WEB_SOCKET_EVENT):r.generalS.setNewTitle("API Maker - WebSocket Events"),yield r.resetThisUrl())}else r.leafSelected=!1})()}dblClickTreeEvent(){this.leafSelected&&this.selectedRows.length&&this.edit()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(d){return new(d||t)(o.Y36(Y.b),o.Y36(Q.W),o.Y36(J.a),o.Y36(V.D),o.Y36(H.L),o.Y36(U.u),o.Y36(o.sBO),o.Y36(q.M),o.Y36(N.d),o.Y36(j.S),o.Y36(D.YP),o.Y36(S.F0))};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-tree"]],viewQuery:function(d,C){if(1&d&&o.Gf(F,5),2&d){let l;o.iGM(l=o.CRH())&&(C.webSocketEventsManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"]},decls:22,vars:7,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/web.svg","alt","WebSocket Events",1,"fa-fw","mr-1"],["href","https://docs.apimaker.dev/v1/docs/pages/web-socket-event-page.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],[1,"float-right","cursor-pointer","ml-3",3,"click"],["pTooltip","Grid View",1,"fas","fa-table","text-yellow","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],[4,"ngIf"],[1,"h-100"],["scrollHeight","flex","selectionMode","multiple",1,"w-full",3,"value","selection","selectionChange","dblclick"],["pTemplate","default"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["webSocketEventsManFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[1,"p-2","text-center","text-success"],[1,"w-100","prevent-text-selection","cursor-pointer",3,"click"],[1,"small","font-weight-bold","d-inline-block","mr-2",3,"ngClass"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0)(1,"div",1)(2,"span"),o._UZ(3,"img",2),o._uU(4," WebSocket Events"),o.qZA(),o.TgZ(5,"span")(6,"a",3),o._UZ(7,"img",4),o.qZA(),o.TgZ(8,"span",5),o.NdJ("click",function(){return C.add()}),o._UZ(9,"i",6),o.qZA(),o.TgZ(10,"span",7),o.NdJ("click",function(){return C.navigateToGrid()}),o._UZ(11,"i",8),o.qZA(),o.YNc(12,te,2,0,"span",9),o.YNc(13,ne,2,0,"span",10),o.qZA()(),o.TgZ(14,"div",11),o.YNc(15,ae,3,1,"div",12),o.TgZ(16,"div",13)(17,"p-tree",14),o.NdJ("selectionChange",function(g){return C.selectedRows=g})("dblclick",function(){return C.dblClickTreeEvent()})("selectionChange",function(){return C.selectedKeysChange()}),o.YNc(18,re,3,2,"ng-template",15),o.qZA(),o.YNc(19,ce,1,0,"p-progressSpinner",16),o.qZA()()(),o._UZ(20,"app-web-socket-events-man-form",17,18)),2&d&&(o.xp6(12),o.Q6J("ngIf",C.leafSelected),o.xp6(1),o.Q6J("ngIf",C.leafSelected),o.xp6(2),o.Q6J("ngIf",C.eventCenterS.group.apisRegex.allWebSocketEvents||C.eventCenterS.filterInLog.apisRegex.allWebSocketEvents),o.xp6(2),o.Q6J("value",C.treeNodes)("selection",C.selectedRows),o.xp6(2),o.Q6J("ngIf",C.loading.grid),o.xp6(1),o.Q6J("data",C.data))},dependencies:[R.mk,R.O5,D.jx,X.mp,z.G,ee.u,L.D],styles:[".custom-tab-title[_ngcontent-%COMP%]{padding:.5rem}.min-width[_ngcontent-%COMP%], .none[_ngcontent-%COMP%], .delete[_ngcontent-%COMP%], .post[_ngcontent-%COMP%], .put[_ngcontent-%COMP%], .get[_ngcontent-%COMP%]{width:45px;display:inline-block}.get[_ngcontent-%COMP%]{color:var(--accent-success)}.put[_ngcontent-%COMP%]{color:var(--brand-secondary)}.post[_ngcontent-%COMP%]{color:var(--accent-warning)}.delete[_ngcontent-%COMP%]{color:var(--accent-error)}.none[_ngcontent-%COMP%]{color:var(--accent-success--shade--three)}.width-160[_ngcontent-%COMP%]{width:160px}"]})}return t})();const f=[{path:"",redirectTo:"layout-tree",pathMatch:"full"},{path:"layout-tree",component:(()=>{class t{constructor(){}ngOnInit(){}static \u0275fac=function(d){return new(d||t)};static \u0275cmp=o.Xpm({type:t,selectors:[["app-web-socket-events-layout-tree"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(d,C){1&d&&(o.TgZ(0,"div",0),o._UZ(1,"app-web-socket-events-tree"),o.qZA())},dependencies:[B],encapsulation:2})}return t})(),canActivate:[P.P]},{path:"layout-grid",component:O,canActivate:[P.P]}];let s=(()=>{class t{static \u0275fac=function(d){return new(d||t)};static \u0275mod=o.oAB({type:t});static \u0275inj=o.cJS({imports:[S.Bz.forChild(f),e.u]})}return t})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1097,6925,8374,8682,1617],{1097:(Ue,q,c)=>{c.r(q),c.d(q,{DbMastersM:()=>na});var N=c(7664),E=c(7017),O=c(3726),d=c(5861),m=c(95),_=c(6990),G=c(8645),H=c(3620),f=c(3157),p=c(328),Z=c(9361),M=c(1162),s=c(553),A=c(5085),K=c(1601),T=c(3531),V=c(9989),j=c(1495),e=c(4946),I=c(9961),w=c(7240),x=c(7414),me=c(9729),P=c(5852),z=c(2304),fe=c(4795),J=c(3429),R=c(2915),W=c(6097),X=c(2094),ee=c(5405),Y=c(6814),te=c(2660),ae=c(5860),oe=c(756),F=c(5219),ke=c(1396),L=c(7680),B=c(4844),Q=c(3259),Ze=c(3965),ie=c(5025),Ie=c(4323);const we=["insertCodeModalC"],xe=["monacoEditorModalC"];function Ee(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",45),e._uU(2," Add UI Page"),e.qZA())}function Ae(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",46),e._uU(2," View UI Page"),e.qZA())}function Fe(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",47),e._uU(2," Edit UI Page "),e.TgZ(3,"span",48),e._uU(4),e.qZA(),e.TgZ(5,"span",48),e._uU(6),e.qZA(),e.TgZ(7,"span",48),e._uU(8),e.qZA(),e.TgZ(9,"span",48),e._uU(10),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(null==t.form.get("instanceName").value?null:t.form.get("instanceName").value.name),e.xp6(2),e.hij("| \xa0",null==t.form.get("databaseName").value?null:t.form.get("databaseName").value.db,""),e.xp6(2),e.hij("| \xa0",null==t.form.get("collectionName").value?null:t.form.get("collectionName").value.name,""),e.xp6(2),e.hij("| \xa0",t.form.get("name").value,"")}}function Ne(i,r){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=r.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function Oe(i,r){if(1&i&&(e._UZ(0,"span",49),e.ALo(1,"safeHtml")),2&i){const t=r.$implicit;e.Q6J("innerHTML",e.lcZ(1,1,t.labelHTML||t.label),e.oJD)}}function Pe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",t.editorOptionsDBMasters)}}function Je(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",50)(1,"app-monaco-editor",51),e.NdJ("onDidChangeModelContent",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.editorConfigJSValueChanged())})("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGeneratedJSUtil(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptionsDBMastersJS)}}function Re(i,r){if(1&i&&(e.TgZ(0,"span",52),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.AsE(" You are allowed to use ",null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",t.totalCreatedMasters," UI Pages. ")}}function Ye(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",53),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Le(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Be(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",55),e.YNc(2,Le,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Qe(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Ge(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function qe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",54),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",55),e.YNc(2,Qe,2,0,"span",4),e.YNc(3,Ge,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid||t.totalCreatedMasters>(null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI)),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function He(i,r){1&i&&e._UZ(0,"p-progressSpinner",56)}let pe=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;zone;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;activeIndex=0;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;selectedConfigOutlineNode;outlineData=[];selectedConfigOutlineNodeFunctions;outlineDataFunctions=[];constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k,de,ue){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.dbMastersS=l,this.authCS=u,this.monacoS=h,this.authS=C,this.instanceS=g,this.eventCenterS=v,this.localClientSyncUtilsS=y,this.webSocketClientCS=D,this.eventCenterCS=U,this.generalCS=k,this.zone=de,this.cd=ue}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.form.disable(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.resetDependentObjects("INSTANCE"),yield t.loadInstances();const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,A.R.DB_MASTERS_JSON).toPromise();t.editorOptionsDBMasters={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMaster",n.data);const l=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,A.R.DB_MASTERS_JS_UTILS).toPromise();t.editorOptionsDBMastersJS={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMasterJS",l.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.editorConfigValueChangedSubject.pipe((0,H.b)(500)).subscribe((0,d.Z)(function*(){const a=t.editorDBMaster.getValue();a&&(yield t.getOutlineDBMaster({tsCode:a,mode:"config"}))}))),t.subscriptions.push(t.editorConfigJSValueChangedSubject.pipe((0,H.b)(500)).subscribe((0,d.Z)(function*(){const a=t.editorDBMasterJS.getValue();a&&(yield t.getOutlineDBMasterJS({tsCode:a,mode:"utility_functions"}))}))),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const l=t.webSocketClientCS.getCategoryOfPath(n),h=t.generalCS.getUtf8FromBase64String(o[n].content);l===j.c.DB_MASTERS&&t.localClientSyncUtilsS.dataChangedInUIMakerPages(n,h,t.data.formData,t.editorDBMaster,t.editorDBMasterJS)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.dbMastersS.getById(t.data.formData._id).toPromise();t.form.reset(),t.resetDependentObjects("INSTANCE"),t.form.patchValue(a.data),t.formDataTemp=a.data,t.generalCS.setValueInEditor(t,"editorDBMaster",a.data?.dbMasterConfigCode||""),t.generalCS.setValueInEditor(t,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield t.loadInstances(),t.editorConfigValueChanged(),t.editorConfigJSValueChanged(),t.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required,m.kI.minLength(3),m.kI.maxLength(50),m.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[m.kI.required]],databaseName:[null,[m.kI.required]],collectionName:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,this.activeIndex=0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let h;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,h=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const C=Object.assign({},h,o);C.user=a.authCS.getUserId(),C.dbMasterConfigCode=a.editorDBMaster.getValue(),C.pageUtilsCode=a.editorDBMasterJS.getValue();try{let g;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===p.D.ADD?g=yield a.dbMastersS.post(C).toPromise():a.data.mode===p.D.EDIT&&(g=yield a.dbMastersS.put(C._id,C,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:g}),a.loading.form=!1}catch(g){a.loading.form=!1,a.ns.showErrorFromResponse(g.error||g,"Unable to save database master."),a.lastError=g.error,a.tab=a.tab||{},a.tab.axiosResponse={data:g.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=Z.H.All,this.insertCodeModalC.showModal(T.b.CodeFinderResultC)}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorDBMaster=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=Z.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(t){var a=this;return(0,d.Z)(function*(){a.editorDBMasterJS=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=Z.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorConfigValueChangedSubject=new G.x;editorConfigValueChanged(){this.editorConfigValueChangedSubject.next()}editorConfigJSValueChangedSubject=new G.x;editorConfigJSValueChanged(){this.editorConfigJSValueChangedSubject.next()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}loadInstances(){var t=this;return(0,d.Z)(function*(){t.resetDependentObjects("INSTANCE"),t.loading.form=!0;try{const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(a).toPromise()).data||[]}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allInstances=[]}if(t.formDataTemp){const a=t.form.controls.instanceName;t.tab.instance=_.find(t.tab.allInstances,{name:t.formDataTemp.instanceName}),t.tab.instance&&a.setValue(t.tab.instance)}else t.tab.instance=t.tab.allInstances[0];yield t.loadDatabases(),t.loading.form=!1,t.cd.detectChanges()})()}getOutlineDBMaster(t){var a=this;return(0,d.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineData,o,"backup"),a.outlineData=[];const n=a.selectedConfigOutlineNode,l=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineData=l.data,a.processNodesForBackupAndRestore(a.outlineData,o,"restore"),a.selectedConfigOutlineNode=a.findNodeOfKey(a.outlineData,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineData=[...a.outlineData],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}getOutlineDBMasterJS(t){var a=this;return(0,d.Z)(function*(){try{const o=new Map;a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"backup"),a.outlineDataFunctions=[];const n=a.selectedConfigOutlineNodeFunctions,l=yield a.instanceS.getOutlineDBMasterConfig(t);a.outlineDataFunctions=l.data,a.processNodesForBackupAndRestore(a.outlineDataFunctions,o,"restore"),a.selectedConfigOutlineNodeFunctions=a.findNodeOfKey(a.outlineDataFunctions,n?.key),setTimeout(()=>{a.zone.run(()=>{a.outlineDataFunctions=[...a.outlineDataFunctions],a.cd.markForCheck()})},10)}catch(o){a.ns.showErrorFromResponse(o.error||o,"Unable to get outline data.")}})()}processNodesForBackupAndRestore(t,a,o){if(Array.isArray(t))for(const n of t)this.processNodesForBackupAndRestore(n,a,o);else"backup"===o?a.set(t.key,t.expanded):"restore"===o&&(t.expanded=a.get(t.key)),t?.children?.length&&this.processNodesForBackupAndRestore(t.children,a,o)}findNodeOfKey(t,a){if(a)if(Array.isArray(t))for(const o of t){const n=this.findNodeOfKey(o,a);if(n)return n}else{if(t.key===a)return t;if(t?.children?.length)return this.findNodeOfKey(t.children,a)}}loadDatabases(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("DATABASE"),!t.tab.instance)return t.tab.allDatabases=[],void(t.tab.allCollections=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=_.keyBy(t.tab.allDatabases,M.N7.db)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allDatabases=[]}if(t.formDataTemp){const a=t.form.get("databaseName");t.tab.database=_.find(t.tab.allDatabases,{db:t.formDataTemp.databaseName}),t.tab.database&&a.patchValue(t.tab.database)}else t.tab.database=t.tab.allDatabases[0];yield t.loadCollections(),t.loading.form=!1})()}loadCollections(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("COLLECTION"),t.tab.instance&&t.tab.database){try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=_.keyBy(t.tab.allCollections,M.GR.name)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allCollections=[]}if(t.formDataTemp){const a=t.form.get("collectionName");t.tab.collection=_.find(t.tab.allCollections,{name:t.formDataTemp.collectionName}),t.tab.collection&&a.patchValue(t.tab.collection)}else t.tab.collection=t.tab.allCollections[0];t.loading.form=!1,t.cd.detectChanges()}else t.tab.allCollections=[]})()}resetDependentObjects(t){"INSTANCE"===t?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===t?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===t&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}outlineNodeSelected(t,a){const o=t.data,n=a.getValue(),l=this.generalCS.getLineNumberFromIndex(n,o.end);a.setPosition(l),a.revealPositionInCenter(l),a.focus()}generateUIMakerCodeForCollection(){var t=this;return(0,d.Z)(function*(){const o=(yield t.instanceS.getSampleUIMCodeForSchema({instanceName:t.tab.instance.name,databaseName:t.tab.database.db,collectionName:t.tab.collection.name})).data;t.editorDBMaster.setValue(o.configCode),t.editorDBMasterJS.setValue(o.functionsCode)})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(I.W),e.Y36(w.b),e.Y36(x.L),e.Y36(me.z),e.Y36(P.D),e.Y36(z.b),e.Y36(fe.e),e.Y36(J.E),e.Y36(R.u),e.Y36(W._),e.Y36(X.P),e.Y36(ee.M),e.Y36(w.b),e.Y36(e.R0b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(we,5),e.Gf(xe,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:66,vars:32,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["tooltipPosition","left","pTooltip","Generate code for this schema",1,"fas","fa-seedling","fa-fw","text-warning","mr-3","cursor-pointer",2,"font-size","21px",3,"click"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Code"],[1,"row","m-0"],[1,"col-3","pl-0","pr-2","pt-2","overflow-auto",2,"height","calc(100vh - 186px)"],["selectionMode","single","styleClass","tree-width","scrollHeight","flex",1,"id_ptree_db_master_config_outline",3,"value","hidden","selection","filter","selectionChange"],["pTemplate","default"],[1,"col-9","pl-0","pr-0"],[3,"activeIndex","activeIndexChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 212px);",4,"ngIf"],["header","userUtils.Main"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[2,"white-space","nowrap","padding-right","10px",3,"innerHTML"],[1,"overflow-hidden",2,"height","calc(100vh - 212px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","onDidChangeModelContent","editorGenerated"],[1,"mr-3","small","text-danger"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Ee,3,0,"span",4),e.YNc(5,Ae,3,0,"span",4),e.YNc(6,Fe,11,4,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"i",9),e.NdJ("click",function(){return o.generateUIMakerCodeForCollection()}),e.qZA(),e.TgZ(12,"span",10),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(13,"i",11),e.qZA(),e.TgZ(14,"a",12),e._UZ(15,"img",13),e.qZA()()(),e.TgZ(16,"div",14)(17,"p-tabView")(18,"p-tabPanel",15)(19,"form",16)(20,"div",17)(21,"label",18),e._uU(22,"Name"),e.qZA(),e.TgZ(23,"div",19),e._UZ(24,"input",20),e.qZA()(),e.TgZ(25,"div",17)(26,"label",18),e._uU(27,"Instance"),e.qZA(),e.TgZ(28,"div",19)(29,"p-dropdown",21),e.NdJ("onChange",function(l){return o.tab.instance=l.value,o.loadDatabases()}),e.qZA()()(),e.TgZ(30,"div",17)(31,"label",18),e._uU(32,"Database"),e.qZA(),e.TgZ(33,"div",19)(34,"p-dropdown",22),e.NdJ("onChange",function(l){return o.tab.database=l.value,o.loadCollections()}),e.qZA()()(),e.TgZ(35,"div",17)(36,"label",18),e._uU(37,"Collection"),e.qZA(),e.TgZ(38,"div",19)(39,"p-dropdown",23),e.NdJ("onChange",function(l){return o.tab.collection=l.value}),e.qZA()()()()(),e.TgZ(40,"p-tabPanel",24)(41,"div",25)(42,"div",26)(43,"p-tree",27),e.NdJ("selectionChange",function(l){return o.selectedConfigOutlineNode=l})("selectionChange",function(l){return o.outlineNodeSelected(l,o.editorDBMaster)}),e.YNc(44,Ne,2,3,"ng-template",28),e.qZA(),e.TgZ(45,"p-tree",27),e.NdJ("selectionChange",function(l){return o.selectedConfigOutlineNodeFunctions=l})("selectionChange",function(l){return o.outlineNodeSelected(l,o.editorDBMasterJS)}),e.YNc(46,Oe,2,3,"ng-template",28),e.qZA()(),e.TgZ(47,"div",29)(48,"p-tabView",30),e.NdJ("activeIndexChange",function(l){return o.activeIndex=l}),e.TgZ(49,"p-tabPanel",31),e.YNc(50,Pe,2,3,"div",32),e.qZA(),e.TgZ(51,"p-tabPanel",33),e.YNc(52,Je,2,3,"div",32),e.qZA()()()()()()(),e.TgZ(53,"div",34),e.YNc(54,Re,2,2,"span",35),e.YNc(55,Ye,2,0,"a",36),e.TgZ(56,"button",37),e.NdJ("click",function(){return o.hideModal()}),e._UZ(57,"i",38),e._uU(58," Close"),e.qZA(),e.YNc(59,Be,3,2,"button",39),e.YNc(60,qe,4,3,"button",39),e.qZA(),e.YNc(61,He,1,0,"p-progressSpinner",40),e.qZA()()(),e._UZ(62,"app-insert-code-modal",41,42)(64,"app-monaco-editor-modal",43,44)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(13),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("options",o.tab.allInstances)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allDatabases)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allCollections)("filter",!0),e.xp6(4),e.Q6J("value",o.outlineData)("hidden",0!==o.activeIndex)("selection",o.selectedConfigOutlineNode)("filter",!0),e.xp6(2),e.Q6J("value",o.outlineDataFunctions)("hidden",1!==o.activeIndex)("selection",o.selectedConfigOutlineNodeFunctions)("filter",!0),e.xp6(3),e.Q6J("activeIndex",o.activeIndex),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),e.xp6(1),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,te.y,ae.P,oe.O,F.jx,ke.mp,L.G,B.xf,B.x4,Q.u,Ze.Lt,ie.A,Ie.z],encapsulation:2,changeDetection:0})}return i})();var ne=c(4950);let Ve=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[E.u,ne.A]})}return i})();var S=c(6212),_e=c(6925),Ke=c(9394),se=c(2466),re=c(921),le=c(2189),je=c(5561),ce=c(3835),ze=c(7797),b=c(5431);const We=["DBMastersFormC"],$e=["cloneApiModalC"];function Xe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",25),e.qZA()}}function et(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",27),e.qZA()}}function tt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",29),e.qZA()}}function at(i,r){1&i&&(e.TgZ(0,"th",31),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ot(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,at,2,0,"th",30),e.TgZ(2,"th",31),e._uU(3,"*"),e.qZA(),e.TgZ(4,"th",32),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Instance \u2192 Database \u2192 Collection"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Required Auth Headers"),e.qZA(),e._UZ(10,"th",33),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function it(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",39),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function nt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"tr",34),e.YNc(1,it,2,2,"td",35),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",36)(12,"button",37),e.NdJ("click",function(){const n=e.CHM(t).$implicit,l=e.oxw();return e.KtG(l.openMasterPageInNewTab(n))}),e._UZ(13,"i",38),e.qZA()()()()}if(2&i){const t=r.$implicit,a=r.rowIndex,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",o.showCheckbox),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.lnq("",t.instanceName," \u2192 ",t.databaseName," \u2192 ",t.collectionName,""),e.xp6(2),e.Oqu(t.authHeadersGrid)}}function st(i,r){1&i&&e._UZ(0,"p-progressSpinner",40)}let he=(()=>{class i{dbMastersS;generalS;notificationS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};EUserType=re.d;gridKey=M.iH._id;EAPICategory=A.R;ENavigationMenu=se.E;BE_HOST_PORT=s.N.BE_HOST_PORT;selectedRows=[];dbMastersFormC;cloneApiModalC;constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k,de,ue){this.dbMastersS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.navigationS=l,this.authCS=u,this.authS=h,this.constantsS=C,this.eventCenterS=g,this.router=v,this.userS=y,this.instanceS=D,this.ns=U,this.cs=k,this.confirmationService=de,this.cd=ue}ngOnInit(){var t=this;return(0,d.Z)(function*(){if(!t.authS.backendSettings.extensions)return t.navigationS.gotoDashboard();t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.dbMastersFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("UI Maker")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a=yield t.dbMastersS.getDBMastersGrid({}).toPromise();if(a){t.selectedRows=[],t.rows=a.data,t.rowsMap=_.keyBy(t.rows,M.iH._id);for(const n of t.rows){const l=[];for(const u of n.authHeaders||[])l.push(u.name);n.authHeadersGrid=l.join(", ")}}let o=t.navigationCS.getQueryParam(S.p.am_db_master);o&&!t.rowsMap[o]&&t.rows.length&&(o=t.rows[0]._id),t.rowsMap[o]?yield t.fillData():t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={order:(_.max(_.map(this.rows,"order"))||0)+1},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){yield t.cloneApiModalC.showModal(t.getSelectedRowId(),[m.kI.pattern("[a-zA-Z0-9_-]*$")],function(){var a=(0,d.Z)(function*(o){o&&(yield t.loadGridData()),t.cd.detectChanges()});return function(o){return a.apply(this,arguments)}}())})()}getSelectedRowId(){return this.selectedRows[0]?._id}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.dbMaster.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.dbMastersS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.dbMasters.selectedDBMaster.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_db_master,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_db_master,""),void t.eventCenterS.dbMasters.selectedDBMaster.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_db_master,a._id),t.eventCenterS.dbMasters.selectedDBMaster.next(a)):yield t.resetThisUrl()})()}dblClick(){this.selectedRows.length&&this.edit()}openMasterPageInNewTab(t){const a=this.authCS.getUserPath();let o=[s.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${_e.ZF.ADMIN_PATH}=${a}&`].join("");const n=[`${_e.ZF.DB_MASTER_NAME}=${t.name}`];for(const l of t.authHeaders)n.push(`${l.name}=____actual_header_value____`);o+=n.join("&"),window.open(o,"_blank")}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=Ke.k4;static \u0275fac=function(a){return new(a||i)(e.Y36(me.z),e.Y36(w.b),e.Y36(I.W),e.Y36(le.S),e.Y36(je.X),e.Y36(P.D),e.Y36(fe.e),e.Y36(x.L),e.Y36(R.u),e.Y36(N.F0),e.Y36(ce.K),e.Y36(J.E),e.Y36(I.W),e.Y36(x.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&(e.Gf(We,5),e.Gf($e,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.dbMastersFormC=n.first),e.iGM(n=e.CRH())&&(o.cloneApiModalC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:31,vars:20,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Styles For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-css3","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"totalCreatedMasters","data"],["DBMastersFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),e._UZ(4,"img",2),e._uU(5," UI Pages"),e.qZA(),e.TgZ(6,"span",3),e._uU(7,"Using "),e.TgZ(8,"span"),e._uU(9),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"a",4),e._UZ(12,"img",5),e.qZA(),e.TgZ(13,"span",6),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"styles"])}),e._UZ(14,"i",7),e.qZA(),e.TgZ(15,"span",8),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),e._UZ(16,"i",9),e.qZA(),e.TgZ(17,"span",10),e.NdJ("click",function(){return o.add()}),e._UZ(18,"i",11),e.qZA(),e.YNc(19,Xe,2,0,"span",12),e.YNc(20,et,2,0,"span",13),e.YNc(21,tt,2,0,"span",14),e.qZA(),e.TgZ(22,"div",15)(23,"p-table",16),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClick()}),e.YNc(24,ot,11,1,"ng-template",17),e.YNc(25,nt,14,8,"ng-template",18),e.qZA(),e.YNc(26,st,1,0,"p-progressSpinner",19),e.qZA()(),e._UZ(27,"app-db-masters-form",20,21)(29,"app-clone-api-modal",22,23)),2&a&&(e.xp6(8),e.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),e.xp6(1),e.hij(" ",o.rows.length,""),e.xp6(1),e.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",1===o.selectedRows.length),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data),e.xp6(2),e.Q6J("modalId","idCloneDBMasters")("hostAndPort",o.BE_HOST_PORT)("modelApiPaths",o.EModelApiPaths.DB_MASTERS))},dependencies:[Y.O5,ze.s,b.iA,F.jx,b.Ei,b.UA,b.Mo,L.G,Q.u,pe],encapsulation:2,changeDetection:0})}return i})(),ge=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-db-masters-list"),e.qZA())},dependencies:[he],encapsulation:2})}return i})();var Ce=c(9836),rt=c(8057);const lt=["insertCodeModalC"],ct=["monacoEditorModalC"];function dt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Styles"),e.qZA())}function ut(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Styles"),e.qZA())}function mt(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Styles "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function ft(i,r){1&i&&(e.TgZ(0,"div",30)(1,"label",31),e._uU(2,"Order No"),e.qZA(),e.TgZ(3,"div",32),e._UZ(4,"input",37),e.qZA()())}function pt(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()(),e.TgZ(7,"div",30),e._UZ(8,"label",31),e.TgZ(9,"div",32)(10,"label",34),e._UZ(11,"p-checkbox",35),e.qZA()()(),e.YNc(12,ft,5,0,"div",36),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form),e.xp6(10),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",t.form.getRawValue().loadInAllPages)}}function _t(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",38)(1,"app-monaco-editor",39),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!1)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function ht(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function gt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Ct(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",42),e.YNc(2,gt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Mt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function St(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function bt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",42),e.YNc(2,Mt,2,0,"span",4),e.YNc(3,St,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Tt(i,r){1&i&&e._UZ(0,"p-progressSpinner",43)}let Me=(()=>{class i{fb;ns;generalS;constantsS;uiMakerStylesS;authCS;monacoS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"css",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"typescript",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerStylesS=l,this.authCS=u,this.monacoS=h,this.instanceS=C,this.eventCenterS=g,this.localClientSyncUtilsS=v,this.webSocketClientCS=y,this.eventCenterCS=D,this.generalCS=U,this.cd=k}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,A.R.UI_MAKER_STYLES).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const l=t.webSocketClientCS.getCategoryOfPath(n),h=t.generalCS.getUtf8FromBase64String(o[n].content);l===j.c.UI_MAKER_STYLES&&t.localClientSyncUtilsS.dataChangedInUIMakerStyles(n,h,t.data.formData,t.editorPI)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerStylesS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.styleCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]],loadInAllPages:[!1,[]],orderNumber:[!1,[m.kI.min(1)]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerStylesForm").modal("show")},100)}hideModal(){$("#idUIMakerStylesForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerStylesS.getById(a.data.formData._id).toPromise()).data:{};const l=Object.assign({},n,o);l.user=a.authCS.getUserId(),l.styleCode=a.editorPI.getValue();try{let u;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?u=yield a.uiMakerStylesS.post(l).toPromise():a.data.mode===p.D.EDIT&&(u=yield a.uiMakerStylesS.put(l._id,l,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerStyle.addSuccess:a.constantsS.uiMakerStyle.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:u}),a.eventCenterS.uiMakerStylesSavedAndUpdate.next(!0),a.loading.form=!1}catch(u){a.loading.form=!1,a.ns.showErrorFromResponse(u.error||u,"Unable to save styles."),a.lastError=u.error,a.tab=a.tab||{},a.tab.axiosResponse={data:u.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=Z.H.All,this.insertCodeModalC.showModal(T.b.UiMakerStylesFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=Z.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerStylesFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.UiMakerStylesFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerStylesSavedAndUpdate.next(!1)}ISchedulerProps=M.qH;static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(I.W),e.Y36(w.b),e.Y36(x.L),e.Y36(Ce.q),e.Y36(P.D),e.Y36(z.b),e.Y36(J.E),e.Y36(R.u),e.Y36(W._),e.Y36(X.P),e.Y36(ee.M),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(lt,5),e.Gf(ct,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerStylesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","loadInAllPages","pTooltip","If true, these styles will be applied to all UI Pages.","label","Load Styles In All Pages",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","orderNumber","name","orderNumber","spellcheck","false","type","number","placeholder","Order number in which these styles will be loaded in page",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,dt,3,0,"span",4),e.YNc(5,ut,3,0,"span",4),e.YNc(6,mt,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,pt,13,3,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,_t,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,ht,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,Ct,3,2,"button",19),e.YNc(25,bt,4,3,"button",19),e.qZA(),e.YNc(26,Tt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerStyles")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.wV,m.JJ,m.JL,m.sg,m.u,Y.O5,te.y,ae.P,oe.O,L.G,B.xf,B.x4,Q.u,rt.XZ,ie.A],encapsulation:2,changeDetection:0})}return i})(),vt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[E.u,ne.A]})}return i})();const yt=["uiMakerStylesFormC"];function Dt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function Ut(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function kt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Zt(i,r){1&i&&(e.TgZ(0,"th",26),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function It(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Zt,2,0,"th",23),e.TgZ(2,"th",24),e._uU(3,"Order"),e.qZA(),e.TgZ(4,"th",25),e._uU(5,"Load in all pages"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function wt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",30),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function xt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Yes"),e.qZA())}function Et(i,r){if(1&i&&(e.TgZ(0,"tr",27),e.YNc(1,wt,2,2,"td",28),e.TgZ(2,"td",29),e._uU(3),e.qZA(),e.TgZ(4,"td",29),e.YNc(5,xt,2,0,"span",28),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.orderNumber||""),e.xp6(2),e.Q6J("ngIf",t.loadInAllPages),e.xp6(2),e.Oqu(t.name)}}function At(i,r){1&i&&e._UZ(0,"p-progressSpinner",31)}let Se=(()=>{class i{uiMakerStylesS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=re.d;gridKey=M.iH._id;EAPICategory=A.R;selectedRows=[];uiMakerStylesFormC;constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k){this.uiMakerStylesS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.eventCenterS=h,this.router=C,this.userS=g,this.instanceS=v,this.ns=y,this.cs=D,this.confirmationService=U,this.cd=k}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.uiMakerStylesFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Styles")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,loadInAllPages:1,orderNumber:1,user:1},sort:{orderNumber:1,name:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerStylesS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,M.iH._id));let n=t.navigationCS.getQueryParam(S.p.am_ui_maker_style);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerStylesFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerStylesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerStylesS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerStylesS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerStyle.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerStyle.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerStyle.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerStylesS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerStyles.selectedStyle.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,""),void t.eventCenterS.uiMakerStyles.selectedStyle.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,a._id),t.eventCenterS.uiMakerStyles.selectedStyle.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=se.E;static \u0275fac=function(a){return new(a||i)(e.Y36(Ce.q),e.Y36(w.b),e.Y36(I.W),e.Y36(le.S),e.Y36(P.D),e.Y36(x.L),e.Y36(R.u),e.Y36(N.F0),e.Y36(ce.K),e.Y36(J.E),e.Y36(I.W),e.Y36(x.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(yt,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerStylesFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-css3","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerStylesFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[1,"text-center",2,"width","40px"],[1,"text-center",2,"width","150px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Styles For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,Dt,2,0,"span",7),e.YNc(10,Ut,2,0,"span",8),e.YNc(11,kt,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,It,8,1,"ng-template",12),e.YNc(15,Et,8,5,"ng-template",13),e.qZA(),e.YNc(16,At,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-styles-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,F.jx,b.Ei,b.UA,b.Mo,L.G,Q.u,Me],encapsulation:2,changeDetection:0})}return i})(),be=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-styles-list"),e.qZA())},dependencies:[Se],encapsulation:2})}return i})();var Te=c(6125);const Ft=["insertCodeModalC"],Nt=["monacoEditorModalC"];function Ot(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Utility"),e.qZA())}function Pt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Utility"),e.qZA())}function Jt(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Utility "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function Rt(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()()()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form)}}function Yt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(o){e.CHM(t);const n=e.oxw();return e.KtG(n.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function Lt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function Bt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Qt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",38),e.YNc(2,Bt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Gt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function qt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ht(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",38),e.YNc(2,Gt,2,0,"span",4),e.YNc(3,qt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Vt(i,r){1&i&&e._UZ(0,"p-progressSpinner",39)}let ve=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;localClientSyncUtilsS;webSocketClientCS;eventCenterCS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=f.F;id;BE_HOST_PORT=s.N.BE_HOST_PORT;DOCS_HOST_PORT=s.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=n,this.uiMakerUtilsS=l,this.authCS=u,this.monacoS=h,this.instanceS=C,this.eventCenterS=g,this.localClientSyncUtilsS=v,this.webSocketClientCS=y,this.eventCenterCS=D,this.generalCS=U,this.cd=k}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===f.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===f.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const n=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,A.R.UI_MAKER_UTILITY_CLASS).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",n.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}())),t.subscriptions.push(t.eventCenterCS.dataChangedInDatabase.subscribe(function(){var a=(0,d.Z)(function*(o){if(o){if(!t.data.formData)return;for(const n in o){const l=t.webSocketClientCS.getCategoryOfPath(n),h=t.generalCS.getUtf8FromBase64String(o[n].content);l===j.c.UI_MAKER_UTILITY_CLASS&&t.localClientSyncUtilsS.dataChangedInUIMakerUtils(n,h,t.data.formData,t.editorPI)}}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerUtilsS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let n;n=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const l=Object.assign({},n,o);l.user=a.authCS.getUserId(),l.utilsCode=a.editorPI.getValue();try{let u;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?u=yield a.uiMakerUtilsS.post(l).toPromise():a.data.mode===p.D.EDIT&&(u=yield a.uiMakerUtilsS.put(l._id,l,{select:M.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?f.F.SAVED:f.F.UPDATED,data:u}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(u){a.loading.form=!1,a.ns.showErrorFromResponse(u.error||u,"Unable to save utility."),a.lastError=u.error,a.tab=a.tab||{},a.tab.axiosResponse={data:u.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=Z.H.All,this.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=Z.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===V.g.TEXT_COPIED&&o.componentName===T.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),K.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}trim=_.trim;static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(I.W),e.Y36(w.b),e.Y36(x.L),e.Y36(Te.L),e.Y36(P.D),e.Y36(z.b),e.Y36(J.E),e.Y36(R.u),e.Y36(W._),e.Y36(X.P),e.Y36(ee.M),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Ft,5),e.Gf(Nt,5)),2&a){let n;e.iGM(n=e.CRH())&&(o.insertCodeModalC=n.first),e.iGM(n=e.CRH())&&(o.viewDockerfileModelC=n.first)}},inputs:{data:"data"},decls:31,vars:16,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[3,"header"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Ot,3,0,"span",4),e.YNc(5,Pt,3,0,"span",4),e.YNc(6,Jt,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,Rt,7,1,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,Yt,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,Lt,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,Qt,3,2,"button",19),e.YNc(25,Ht,4,3,"button",19),e.qZA(),e.YNc(26,Vt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(1),e.Q6J("header",(o.form.get("name").getRawValue()||"").trim()?"userUtils."+o.form.get("name").getRawValue().trim():"Code"),e.xp6(1),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,te.y,ae.P,oe.O,L.G,B.xf,B.x4,Q.u,ie.A],encapsulation:2,changeDetection:0})}return i})(),Kt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[E.u,ne.A]})}return i})();const jt=["uiMakerUtilsFormC"];function zt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function Wt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function $t(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Xt(i,r){1&i&&(e.TgZ(0,"th",24),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function ea(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Xt,2,0,"th",23),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function ta(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",27),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function aa(i,r){if(1&i&&(e.TgZ(0,"tr",25),e.YNc(1,ta,2,2,"td",26),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function oa(i,r){1&i&&e._UZ(0,"p-progressSpinner",28)}let ye=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=re.d;gridKey=M.iH._id;EAPICategory=A.R;selectedRows=[];uiMakerUtilsFormC;constructor(t,a,o,n,l,u,h,C,g,v,y,D,U,k){this.uiMakerUtilsS=t,this.generalS=a,this.notificationS=o,this.navigationCS=n,this.authCS=l,this.constantsS=u,this.eventCenterS=h,this.router=C,this.userS=g,this.instanceS=v,this.ns=y,this.cs=D,this.confirmationService=U,this.cd=k}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===f.F.SAVED||o.action===f.F.UPDATED)&&(t.uiMakerUtilsFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{order:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerUtilsS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,M.iH._id));let n=t.navigationCS.getQueryParam(S.p.am_ui_maker_util);n&&!t.rowsMap[n]&&t.rows.length&&(n=t.rows[0]._id),t.rowsMap[n]?(t.selectedRows=[t.rowsMap[n]],yield t.fillData()):t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:f.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerUtilsS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerUtil.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,""),void t.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,a._id),t.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=se.E;static \u0275fac=function(a){return new(a||i)(e.Y36(Te.L),e.Y36(w.b),e.Y36(I.W),e.Y36(le.S),e.Y36(P.D),e.Y36(x.L),e.Y36(R.u),e.Y36(N.F0),e.Y36(ce.K),e.Y36(J.E),e.Y36(I.W),e.Y36(x.L),e.Y36(F.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(jt,5),2&a){let n;e.iGM(n=e.CRH())&&(o.uiMakerUtilsFormC=n.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerUtilsFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Common Utils For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,zt,2,0,"span",7),e.YNc(10,Wt,2,0,"span",8),e.YNc(11,$t,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(l){return o.selectedRows=l})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,ea,4,1,"ng-template",12),e.YNc(15,aa,4,3,"ng-template",13),e.qZA(),e.YNc(16,oa,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,F.jx,b.Ei,b.UA,b.Mo,L.G,Q.u,ve],encapsulation:2,changeDetection:0})}return i})();const ia=[{path:"main",component:ge,canActivate:[O.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-utils-list"),e.qZA())},dependencies:[ye],encapsulation:2})}return i})(),canActivate:[O.P]},{path:"styles",component:be,canActivate:[O.P]}];let na=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[N.Bz.forChild(ia),E.u,Ve,Kt,vt]})}return i})()},6925:(Ue,q,c)=>{c.d(q,{Eg:()=>_,Yp:()=>O,ZF:()=>G,vT:()=>E});var E=function(s){return s.FORM_DATA="FORM_DATA",s.JSON="JSON",s.TEXT="TEXT",s}(E||{}),O=function(s){return s.GET="GET",s.POST="POST",s.PUT="PUT",s.DELETE="DELETE",s}(O||{}),_=function(s){return s.CONTENT_TYPE="content-type",s.ACCEPT_ENCODING="accept-encoding",s.NO_COMPRESSION_STD="x-no-compression",s.AUTHORIZATION_AM="x-am-authorization",s.AUTHORIZATION_AM_USER="x-am-user-authorization",s.AUTHORIZATION_AWS="x-aws-authorization",s.AUTHORIZATION_GOOGLE="x-google-authorization",s.AUTHORIZATION_AZURE="x-azure-authorization",s.RUN_IN_SANDBOX="x-am-run-in-sandbox",s.ORIGIN="origin",s.AUTHORIZATION="authorization",s.META="x-am-meta",s.SECRET="x-am-secret",s.CONTENT_TYPE_RESPONSE="x-am-content-type-response",s.CACHE_CONTROL="x-am-cache-control",s.CODE_HASH="x-am-code-hash",s.SANDBOX_TIMEOUT="x-am-sandbox-timeout",s.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",s.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",s.RESPONSE_CASE="x-am-response-case",s.RESPONSE_OBJECT_TYPE="x-am-response-object-type",s.AM_I18N="x-am-internationalization",s.DATA_SOURCE="x-am-data-source",s.TEST_HOOK="x-am-test-hook",s.TEST_EVENT="x-am-test-event",s.INTER_COMM="x-am-inter-comm",s.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",s.AM_REQUEST_ID="x-am-request-id",s.AM_STORE_TOKEN="x-am-store-token",s.AM_WS_Client_ID="x-am-ws-client-id",s.RUN_IN_DEBUGGER="x-am-run-in-debugger",s}(_||{}),G=function(s){return s.DB_MASTER_NAME="db-master-name",s.ADMIN_PATH="admin-path",s}(G||{})}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(7017),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(5765),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1558],{1558:(A,M,a)=>{a.r(M),a.d(M,{SchedulerManM:()=>E});var c=a(7664),e=a(7017),o=a(4946),h=a(6607);let f=(()=>{class _{constructor(){}ngOnInit(){}static \u0275fac=function(u){return new(u||_)};static \u0275cmp=o.Xpm({type:_,selectors:[["app-scheduler-man-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1"]],template:function(u,P){1&u&&(o.TgZ(0,"div",0),o._UZ(1,"app-scheduler-man-w"),o.qZA())},dependencies:[h.V],encapsulation:2})}return _})();var d=a(3726),I=a(885);const g=[{path:"scheduler-layout",component:f,canActivate:[d.P]}];let E=(()=>{class _{static \u0275fac=function(u){return new(u||_)};static \u0275mod=o.oAB({type:_});static \u0275inj=o.cJS({imports:[c.Bz.forChild(g),e.u,I.R]})}return _})()},6607:(A,M,a)=>{a.d(M,{V:()=>pe});var c=a(5861),e=a(4946),o=a(3157),h=a(328),f=a(6212),d=a(6990),g=a(1162),D=a(5085),E=a(921),_=a(1042),R=a(7240),S=a(9961),u=a(5219),P=a(2189),y=a(5852),Z=a(7414),L=a(2915),w=a(7664),O=a(95),W=a(6814),C=a(5431),U=a(7680),N=a(3259),b=a(8057),K=a(8479);const G=["schedulerManFormC"];function F(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.edit())}),e._UZ(1,"i",18),e.qZA()}}function J(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.clone())}),e._UZ(1,"i",20),e.qZA()}}function Q(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const i=e.oxw(2);return e.KtG(i.removePermanentDialog())}),e._UZ(1,"i",22),e.qZA()}}function B(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span")(1,"span",12),e.NdJ("click",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.add())}),e._UZ(2,"i",13),e.qZA(),e.YNc(3,F,2,0,"span",14),e.YNc(4,J,2,0,"span",15),e.YNc(5,Q,2,0,"span",16),e.qZA()}if(2&n){const t=e.oxw();e.xp6(3),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length),e.xp6(1),e.Q6J("ngIf",t.selectedRows.length)}}function Y(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.group.apisRegex.allSchedulers=i)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.group.apisRegex.allSchedulers)("binary",!0)}}function k(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"span",23)(1,"label",24)(2,"p-checkbox",25),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.eventCenterS.filterInLog.apisRegex.allSchedulers=i)}),e.qZA()()()}if(2&n){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.eventCenterS.filterInLog.apisRegex.allSchedulers)("binary",!0)}}function H(n,r){if(1&n&&(e.TgZ(0,"div")(1,"div",26),e._uU(2),e.qZA()()),2&n){const t=e.oxw();e.xp6(2),e.Oqu(t.constantsS.group.allSchedulersPermitted)}}function V(n,r){1&n&&(e.TgZ(0,"th",34),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function j(n,r){1&n&&e._UZ(0,"th",36)}function $(n,r){1&n&&e._UZ(0,"th")}function q(n,r){1&n&&e._UZ(0,"th",37)}function X(n,r){if(1&n&&(e.TgZ(0,"tr"),e.YNc(1,V,2,0,"th",32),e.YNc(2,j,1,0,"th",33),e._UZ(3,"th",34),e.TgZ(4,"th"),e._uU(5,"Name"),e.qZA(),e.YNc(6,$,1,0,"th",6),e.YNc(7,q,1,0,"th",35),e.qZA()),2&n){const t=e.oxw(2);e.xp6(1),e.Q6J("ngIf",t.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable),e.xp6(4),e.Q6J("ngIf",t.isLPM),e.xp6(1),e.Q6J("ngIf",!t.isDependentOnGroup&&!t.isLPM&&!t.isFilterLogTable)}}function z(n,r){if(1&n&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",43),e.qZA()),2&n){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function ee(n,r){if(1&n&&(e.TgZ(0,"td",44)(1,"span"),e._uU(2),e.qZA()()),2&n){const t=e.oxw().rowIndex;e.xp6(2),e.Oqu(t+1)}}function te(n,r){1&n&&e._UZ(0,"i",45)}function ne(n,r){1&n&&e._UZ(0,"i",46)}function se(n,r){1&n&&e._UZ(0,"i",47)}function ie(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div")(1,"label",48)(2,"p-checkbox",49),e.NdJ("ngModelChange",function(i){e.CHM(t);const l=e.oxw(2).$implicit;return e.KtG(l.saveResponseInLog=i)})("click",function(i){e.CHM(t);const l=e.oxw(4);return e.KtG(l.generalS.stopPropagation(i))}),e.qZA()()()}if(2&n){const t=e.oxw(2).$implicit;e.xp6(2),e.Q6J("ngModel",t.saveResponseInLog)("binary",!0)}}function ae(n,r){if(1&n&&(e.TgZ(0,"td"),e.YNc(1,ie,3,2,"div",6),e.qZA()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(1),e.Q6J("ngIf",s.selectedRows.indexOf(t)>=0)}}const re=function(){return["/api-info/api-testing/testing"]},le=function(n,r){return{at_category:"SCHEDULERS",at_user:n,at_api:r}};function oe(n,r){if(1&n&&(e.TgZ(0,"td")(1,"div",44)(2,"a",50),e.NdJ("click",function(s){return s.stopPropagation()}),e._UZ(3,"i",51),e.qZA()()()),2&n){const t=e.oxw().$implicit,s=e.oxw(2);e.xp6(2),e.Q6J("routerLink",e.DdM(2,re))("queryParams",e.WLB(3,le,s.authCS.getUserId(),t._id))}}function ce(n,r){if(1&n&&(e.TgZ(0,"tr",38),e.YNc(1,z,2,2,"td",6),e.YNc(2,ee,3,1,"td",39),e.TgZ(3,"td"),e.YNc(4,te,1,0,"i",40),e.YNc(5,ne,1,0,"i",41),e.qZA(),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e.YNc(9,se,1,0,"i",42),e.qZA(),e.YNc(10,ae,2,1,"td",6),e.YNc(11,oe,4,6,"td",6),e.qZA()),2&n){const t=r.$implicit,s=e.oxw(2);e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",s.isMultiSelect),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",t.isActive),e.xp6(1),e.Q6J("ngIf",!t.isActive),e.xp6(3),e.Oqu(t.name),e.xp6(1),e.Q6J("ngIf",t.runOnNativeProcess),e.xp6(1),e.Q6J("ngIf",s.isLPM),e.xp6(1),e.Q6J("ngIf",!s.isDependentOnGroup&&!s.isLPM&&!s.isFilterLogTable)}}function _e(n,r){1&n&&e._UZ(0,"p-progressSpinner",52)}function de(n,r){if(1&n){const t=e.EpF();e.TgZ(0,"div",27)(1,"p-table",28),e.NdJ("selectionChange",function(i){e.CHM(t);const l=e.oxw();return e.KtG(l.selectedRows=i)})("selectionChange",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.selectionChange())})("dblclick",function(){e.CHM(t);const i=e.oxw();return e.KtG(i.dblClickSchedulerList())}),e.YNc(2,X,8,4,"ng-template",29),e.YNc(3,ce,12,9,"ng-template",30),e.qZA(),e.YNc(4,_e,1,0,"p-progressSpinner",31),e.qZA()}if(2&n){const t=e.oxw();e.xp6(1),e.Q6J("selectionMode","multiple")("metaKeySelection",t.metaKeySelection)("selection",t.selectedRows)("dataKey",t.gridKey)("scrollable",!0)("value",t.rows),e.xp6(3),e.Q6J("ngIf",t.loading.grid)}}let pe=(()=>{class n{schedulerS;generalS;notificationS;confirmationService;navigationCS;authCS;constantsS;eventCenterS;cd;router;isReadOnly=!1;isMultiSelect=!1;isDependentOnGroup=!1;isLPM=!1;isFilterLogTable=!1;metaKeySelection=!0;loading={grid:!1};subscriptions=[];data={mode:h.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};rowsMapName={};showAll=!1;selectedRows=[];gridKey=g.iH._id;EUserType=E.d;schedulerManFormC;constructor(t,s,i,l,x,m,p,v,T,ue){this.schedulerS=t,this.generalS=s,this.notificationS=i,this.confirmationService=l,this.navigationCS=x,this.authCS=m,this.constantsS=p,this.eventCenterS=v,this.cd=T,this.router=ue}ngOnInit(){var t=this;this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(s=>{s.action===o.F.SAVED?(this.schedulerManFormC.hideModal(),this.loadGridData()):s.action===o.F.UPDATED&&(s.closeModal&&this.schedulerManFormC.hideModal(),this.loadGridData())})),this.isDependentOnGroup&&this.subscriptions.push(this.eventCenterS.group.selectedGroups.subscribe(function(){var s=(0,c.Z)(function*(i){i.length&&t.loadGridData()});return function(i){return s.apply(this,arguments)}}())),(this.isFilterLogTable||this.isLPM)&&this.subscriptions.push(this.eventCenterS.filterInLog.refreshGrid.subscribe(s=>{s&&this.loadGridData()})),this.generalS.setNewTitle("API Maker - Scheduler")}loadGridData(){var t=this;this.loading.grid=!0;const s={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,label:1,isActive:1,active:1,runOnNativeProcess:1},sort:{name:1}};this.showAll&&delete s.find.active,this.subscriptions.push(this.schedulerS.query(s).subscribe(function(){var i=(0,c.Z)(function*(l){l.success?(t.selectedRows=[],t.rows=l.data||[],t.rowsMap=d.keyBy(t.rows,g.iH._id),t.rowsMapName=d.keyBy(t.rows,g.qH.name)):t.resetGridAndUrl();const x=t.navigationCS.getQueryParam(f.p.am_scheduler)||(t.isFilterLogTable?t.eventCenterS.filterInLog.schedulersIds.value.join(","):t.eventCenterS.group.schedulersIds.value.join(","))||(t.isDependentOnGroup&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?t.eventCenterS.group.selectedGroups.value[0]?.queryParams.schedulerNames.join(","):"");if(x){const m=x.split(","),p=d.intersection(d.keys(t.rowsMap),m),v=[];for(const T of p)t.rowsMap[T]&&v.push(t.rowsMap[T]);t.selectedRows=v,t.eventCenterS.group.selectedSchedulers.next(v),t.eventCenterS.group.schedulersIds.next(p),t.eventCenterS.filterInLog.schedulersIds.next(p)}if(t.isLPM&&t.eventCenterS.group.selectedGroups.value[0]?.queryParams?.schedulerNames?.length){const m=t.eventCenterS.group.selectedGroups.value[0];for(const p of m?.queryParams?.schedulerNames)t.rowsMapName[p]&&(t.rowsMapName[p].saveResponseInLog=m.schedulersLog?.[p]?.saveResponseInLog||!1);t.setResDataInEventCenter()}t.loading.grid=!1,t.cd.detectChanges()});return function(l){return i.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=h.D.ADD,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_ADD_MODE}),this.schedulerManFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.VIEW,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_VIEW_MODE}),this.schedulerManFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=h.D.EDIT,this.data.eventChannel.emit({action:o.F.OPEN_FORM_IN_EDIT_MODE}),this.schedulerManFormC.showModal()}clone(){var t=this;return(0,c.Z)(function*(){try{if(!t.selectedRows[0]||!t.selectedRows[0])return;const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;delete s._id,s.name=`${s.name}-clone`,(yield t.schedulerS.post(s).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.schedulers.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.schedulers.cloneError)}})()}setResDataInEventCenter(){this.isDependentOnGroup&&(this.eventCenterS.group.schedulersApis.next(this.selectedRows),this.eventCenterS.group.selectedSchedulers.next(this.selectedRows)),this.isFilterLogTable&&this.eventCenterS.filterInLog.schedulersApis.next(this.selectedRows)}removePermanentDialog(){var t=this;return(0,c.Z)(function*(){var s;t.confirmationService.confirm({message:t.constantsS.schedulers.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(s=(0,c.Z)(function*(){yield t.removePermanent()}),function(){return s.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,c.Z)(function*(){t.loading.grid=!0;const s=yield t.schedulerS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,s.success?(t.notificationS.showSuccess(t.constantsS.schedulers.removePermanent),t.resetGridAndUrl(),t.loadGridData()):t.notificationS.showErrorFromResponse(s,t.constantsS.schedulers.removePermanentError)})()}resetDependents(){var t=this;return(0,c.Z)(function*(){yield t.navigationCS.setQueryParam(f.p.am_scheduler,null)})()}selectionChange(){var t=this;return(0,c.Z)(function*(){t.resetDependents().then(),t.fillData().then(),t.selectedRows?.[0]?t.generalS.setNewTitle(t.selectedRows[0].name,D.R.SCHEDULERS):t.generalS.setNewTitle("API Maker - Scheduler")})()}resetGridAndUrl(){this.rows=[],this.selectedRows=[],this.rowsMap={},this.rowsMapName={}}fillData(){var t=this;return(0,c.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(f.p.am_scheduler,""),t.eventCenterS.group.schedulersIds.next([]),t.eventCenterS.group.schedulersApis.next([]),t.eventCenterS.filterInLog.schedulersIds.next([]),void t.eventCenterS.filterInLog.schedulersApis.next([]);if(t.isDependentOnGroup||t.isFilterLogTable)t.eventCenterS.group.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.group.schedulersApis.next(t.selectedRows),t.isFilterLogTable&&(t.eventCenterS.filterInLog.schedulersIds.next(d.map(t.selectedRows,"_id")),t.eventCenterS.filterInLog.schedulersApis.next(t.selectedRows));else{const s=(yield t.schedulerS.getById(t.selectedRows[0]._id).toPromise()).data;s._id?yield t.navigationCS.setQueryParam(f.p.am_scheduler,s._id):t.resetDependents()}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickSchedulerList(){this.selectedRows.length&&!this.isMultiSelect&&this.edit()}static \u0275fac=function(s){return new(s||n)(e.Y36(_.Z),e.Y36(R.b),e.Y36(S.W),e.Y36(u.YP),e.Y36(P.S),e.Y36(y.D),e.Y36(Z.L),e.Y36(L.u),e.Y36(e.sBO),e.Y36(w.F0))};static \u0275cmp=e.Xpm({type:n,selectors:[["app-scheduler-man-w"]],viewQuery:function(s,i){if(1&s&&e.Gf(G,5),2&s){let l;e.iGM(l=e.CRH())&&(i.schedulerManFormC=l.first)}},inputs:{isReadOnly:["IsReadOnly","isReadOnly"],isMultiSelect:["IsMultiSelect","isMultiSelect"],isDependentOnGroup:["IsDependentOnGroup","isDependentOnGroup"],isLPM:"isLPM",isFilterLogTable:"isFilterLogTable",metaKeySelection:"metaKeySelection"},decls:16,vars:6,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/schedulers.svg","alt","Schedulers",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/apis-all/schedulers/user-created-schedulers-api.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],[4,"ngIf"],["class","float-right cursor-pointer","tooltipPosition","left","pTooltip","All Schedulers",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["class","h-100",4,"ngIf"],[3,"data"],["schedulerManFormC",""],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["tooltipPosition","left","pTooltip","All Schedulers",1,"float-right","cursor-pointer"],[1,"mb-0","mt--2px"],[3,"ngModel","binary","ngModelChange"],[1,"p-2","text-center","text-success"],[1,"h-100"],["styleClass","p-datatable-striped schedulers-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],["style","width: 40px;",4,"ngIf"],["style","width: 80px;",4,"ngIf"],[2,"width","40px"],["style","width: 60px;",4,"ngIf"],[2,"width","80px"],[2,"width","60px"],[3,"pSelectableRow"],["class","text-center",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-success text-v-small",4,"ngIf"],["class","fas fa-circle fa-fw align-middle text-muted text-v-small",4,"ngIf"],["pTooltip","Running on native process","class","fas fa-radiation ml-2 text-danger",4,"ngIf"],[3,"value","pSelectableRow"],[1,"text-center"],[1,"fas","fa-circle","fa-fw","align-middle","text-success","text-v-small"],[1,"fas","fa-circle","fa-fw","align-middle","text-muted","text-v-small"],["pTooltip","Running on native process",1,"fas","fa-radiation","ml-2","text-danger"],[1,"m-0","vertical-align-sub"],["label","Save Response In Log",3,"ngModel","binary","ngModelChange","click"],["href","javascript:","tooltipPosition","left","pTooltip","Test API",1,"btn","btn-xsm-custom","mr-3",3,"routerLink","queryParams","click"],[1,"fas","fa-vial","text-info","fa-fw","test-tube","pt-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(s,i){1&s&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Scheduler List"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.YNc(8,B,6,3,"span",6),e.YNc(9,Y,3,2,"span",7),e.YNc(10,k,3,2,"span",7),e.qZA(),e.TgZ(11,"div",8),e.YNc(12,H,3,1,"div",6),e.YNc(13,de,5,7,"div",9),e.qZA()(),e._UZ(14,"app-w-scheduler-man-form",10,11)),2&s&&(e.xp6(8),e.Q6J("ngIf",!i.isReadOnly),e.xp6(1),e.Q6J("ngIf",i.isDependentOnGroup),e.xp6(1),e.Q6J("ngIf",i.isFilterLogTable),e.xp6(2),e.Q6J("ngIf",i.eventCenterS.group.apisRegex.allSchedulers||i.eventCenterS.filterInLog.apisRegex.allSchedulers),e.xp6(1),e.Q6J("ngIf",!(i.eventCenterS.group.apisRegex.allSchedulers||i.eventCenterS.filterInLog.apisRegex.allSchedulers)),e.xp6(1),e.Q6J("data",i.data))},dependencies:[w.rH,O.JJ,O.On,W.O5,C.iA,u.jx,C.Ei,C.UA,C.Mo,U.G,N.u,b.XZ,K.o],encapsulation:2})}return n})()}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1617,6925,8374,8682],{6925:(l,o,c)=>{c.d(o,{Eg:()=>i,Yp:()=>a,ZF:()=>_,vT:()=>t});var t=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(t||{}),a=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(a||{}),i=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n.AM_WS_Client_ID="x-am-ws-client-id",n.RUN_IN_DEBUGGER="x-am-run-in-debugger",n}(i||{}),_=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(_||{})}}]);
|