import{r as registerInstance,h,H as Host}from"./index-b7735e0d.js";import{d as dark}from"./dark-debf9c41.js";import{D as DataApiImpl}from"./dataApi-82558134.js";import{K as KimlikApiImpl}from"./kimlikApi-0d7e6ce7.js";import{i as isUserLoggedIn}from"./index-c7307038.js";import{C as CookieStorage}from"./cookie-1686830b.js";import{A as APIBase}from"./apiBase-d573f009.js";import{p as prod}from"./services-2b193868.js";import"./colors-4dc9e03b.js";import"./data-transfer-field-918730a3.js";import"./BaseField-461b6d0c.js";import"./filter-cbaa3d7d.js";import"./_commonjsHelpers-27f122dd.js";var DevingenApi=function(){function e(e,t){var r=this;if(t===void 0){t={}}this.createProduct=function(e){return r.api.post("products",e)};this.getProducts=function(){return r.api.get("products")};this.getProduct=function(e){return r.api.get("products/".concat(e))};this.updateProduct=function(e,t){return r.api.put("products/".concat(e),t)};this.deleteProduct=function(e){return r.api.delete("products/".concat(e))};this.createWorkspace=function(e){return r.api.post("workspaces",{name:e})};this.updateWorkspace=function(e,t){return r.api.put("workspaces/".concat(e),t)};this.deleteWorkspace=function(e){return r.api.delete("workspaces/".concat(e))};this.getWorkspaceOwnerships=function(){return r.api.get("workspace-ownerships")};this.api=new APIBase(e,t)}return e}();var wrapContent=function(e){return h(Host,null,h("dvn-theme-provider",{theme:dark,colorBackground:true,fitHeight:true},h("dvn-global-table",null),h("dvn-global-grid",null),h("dvn-global-text",null),h("notifier-wrapper",null,e)))};var DevingenRoot=function(){function e(e){registerInstance(this,e)}e.prototype.render=function(){var e=(new CookieStorage).getAll().jwt;var t={Authorization:e?"Bearer ".concat((new CookieStorage).getAll().jwt):undefined};var r=new KimlikApiImpl("".concat(prod.kimlik,"/").concat(prod.base),t);var o=new DataApiImpl("".concat(prod.data,"/").concat(prod.base),t);var i=new DevingenApi(prod.devingen,t);if(!isUserLoggedIn()){return wrapContent(h("devingen-login-page",{apiKimlik:r}))}return wrapContent(h("devingen-router",{apiKimlik:r,apiDevingen:i,apiData:o}))};return e}();export{DevingenRoot as devingen_root};