import{a as u}from"./chunk-B47LJMRU.js";import{b as h}from"./chunk-QG2WC3H3.js";import{a as E}from"./chunk-ZVZZ3QVR.js";import{a as m}from"./chunk-KHAMQZND.js";import{c as x}from"./chunk-OBT56KUD.js";import{aa as f,f as s,ha as p,ka as l,pa as o,ua as c,v as n}from"./chunk-IYD54RT7.js";var d=(()=>{let e=class e{constructor(t,r){this.http=t,this.txService=r}getArtifactExplorerPreferences(){return this.http.get(m+"/orcs/preferences/explorer")}createArtifactExplorerPrefs(t,r){let a={branch:"570",txComment:"Create Artifact Explorer Preferences",createArtifacts:[{typeId:u.ARTIFACTEXPLORERPREFERENCES,name:t.name+" Artifact Explorer Preferences",key:"artifactExplorerPrefs",attributes:[{typeName:"Artifact Explorer Panel Location",value:r.artifactExplorerPanelLocation}]}],addRelations:[{typeName:"User to Artifact Explorer Preferences",aArtId:t.id,bArtId:"artifactExplorerPrefs"}]};return this.txService.performMutation(a)}updateArtifactExplorerPrefs(t,r){let a=[];t.artifactExplorerPanelLocation!==r.artifactExplorerPanelLocation&&a.push({typeName:"Artifact Explorer Panel Location",value:r.artifactExplorerPanelLocation});let A={branch:"570",txComment:"Updating Artifact Explorer Preferences",modifyArtifacts:[{id:r.id,setAttributes:a}]};return this.txService.performMutation(A)}};e.\u0275fac=function(r){return new(r||e)(c(x),c(h))},e.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();var U=(()=>{let e=class e{constructor(t,r){this.preferencesService=t,this.userDataService=r,this._prefsUpdated=new s,this._artifactExplorerPreferences=this.preferencesService.getArtifactExplorerPreferences().pipe(f({delay:()=>this._prefsUpdated}))}createOrUpdateArtifactExplorerPrefs(t){return n([this.userDataService.user,this.artifactExplorerPreferences]).pipe(p(([r,a])=>a.id==="-1"?this.preferencesService.createArtifactExplorerPrefs(r,t):this.preferencesService.updateArtifactExplorerPrefs(a,t)),l(()=>this._prefsUpdated.next(!0)))}get artifactExplorerPreferences(){return this._artifactExplorerPreferences}};e.\u0275fac=function(r){return new(r||e)(c(d),c(E))},e.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"});let i=e;return i})();export{U as a};
