(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{14325:function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"default",(function(){return l}));var s=i(1858),o=i(1660),a=i(2282),d=i(3178),n=i(14324),r=i(5443);class l{constructor(){this.model=null,this.adapter=null}async didCreate(){this.model=new n.default,this.model.setLoading&&this.model.setLoading(!0),this.adapter=new r.default(this.model),await this.adapter.hydrate(),this.model.setLoading&&this.model.setLoading(!1)}async fetchEnvironments(){await Object(o.getStore)("SyncStatusStore").onSyncAvailable();const e=Object(o.getStore)("ActiveWorkspaceStore").id,i=await s.default.request(d.ENVIRONMENT_LIST_AND_SUBSCRIBE`${e}`,{method:"POST"}),n=t.forEach(t.get(i,"body.data",[]),(e=>{const i={model:"environment",modelId:e.id,action:"UPDATE_ENVIRONMENT"},s=a.default.getCompositeKey(i);!Object(o.getStore)("PermissionStore").members.has(s)&&t.set(e,"attributes.permissions.userCanUpdate",!0)}));return this.model.hydrate&&this.model.hydrate(n),this.model.setLoading&&this.model.setLoading(!1),i}beforeDestroy(){this.model.dispose(),this.model=null,this.adapter&&this.adapter.dispose(),this.adapter=null}}}.call(this,i(574))},24591:function(t,e,i){"use strict";i.r(e),function(t){i.d(e,"default",(function(){return c}));var s=i(1654),o=i(6128),a=i(5942),d=i(6476),n=i(6489),r=i(24590),l=i(6861),h=i(6856),m=i(6968);class c{constructor(){this.model=null,this.adapter=null}async didCreate(){this.model=new r.default,this.model.setLoading&&this.model.setLoading(!0);const e=await this.fetchEnvironments();!function(e){if(t.isEmpty(e))return;const i=[],s=[];e.forEach((e=>{const o=t.get(e,"attributes.permissions.anybodyCanView"),a=t.get(e,"attributes.permissions.teamCanView");o&&i.push({id:e.id}),a&&s.push({id:e.id})})),!t.isEmpty(i)&&Object(a.getStore)("PublicEntityStore").add(i),!t.isEmpty(s)&&Object(a.getStore)("SharedEnvironmentsStore").add(s)}(t.get(e,"body.data",[])),this.model.environmentList=await h.default.subscribe();const i=t=>t&&Object(a.getStore)("EnvironmentStore").find(Object(m.decomposeUID)(t).modelId);try{await Object(s.when)((()=>this.model.environmentList.ids.every(i)),{timeout:6e4})}catch(t){pm.logger.warn("EnvironmentSidebarController~didCreate: Timed out while waiting for store to be fully hydrated",t)}this.adapter=new l.default(this.model),await this.adapter.hydrate(),this.model.setLoading&&this.model.setLoading(!1)}async fetchEnvironments(){await Object(a.getStore)("SyncStatusStore").onSyncAvailable();const e=Object(a.getStore)("ActiveWorkspaceStore").id,i=await o.default.request(n.ENVIRONMENT_LIST_AND_SUBSCRIBE`${e}`,{method:"POST"}),s=t.forEach(t.get(i,"body.data",[]),(e=>{const i={model:"environment",modelId:e.id,action:"UPDATE_ENVIRONMENT"},s=d.default.getCompositeKey(i);!Object(a.getStore)("PermissionStore").members.has(s)&&t.set(e,"attributes.permissions.userCanUpdate",!0)}));return this.model.hydrate&&this.model.hydrate(s),this.model.setLoading&&this.model.setLoading(!1),i}beforeDestroy(){this.model.dispose(),this.model=null,this.adapter&&this.adapter.dispose(),this.adapter=null}}}.call(this,i(2751))}}]);