1import { G as p, Jr as g, Pi as l, fi as d, gt as u, la as f, wr as m } from "./chunk-c97c17u8.js"; 2import { Dt as _, P as w, d as A, j as P, pt as U, ut as b, x as a } from "./chunk-fbjoug0d.js"; 3import { t as C } from "./chunk-o4f8w5yc.js"; 4function R(e) { 5 return e.get(s); 6} 7var s, n, c; 8function h() { 9 return (h = C((() => { 10 l(), b(), f(), s = (() => { 11 var e = class {}; 12 let i = (e.ɵfac = function(t) { 13 return new (t || e)(); 14 }, e.ɵprov = d({ 15 token: e, 16 factory: function(t) { 17 let r = null; 18 return t ? r = new t() : r = R(g(A)), r; 19 }, 20 providedIn: "root" 21 }), e); 22 return i = m([_({ 23 key: w, 24 product: P.SF 25 })], i), i; 26 })(), n = class { 27 get name() { 28 return this._name; 29 } 30 get apiBaseUrl() { 31 return this._apiBaseUrl; 32 } 33 get isEnabled() { 34 return this._enabled; 35 } 36 get isEnabledProductApi() { 37 return this._enabledProductApi; 38 } 39 get isRegistered() { 40 return this._isRegistered; 41 } 42 get isHost() { 43 return this._name === "host"; 44 } 45 get injector() { 46 return this.requireRegistered(), this._injector; 47 } 48 constructor(e, i) { 49 this.product = e, this.productInfo = i, this._enabled = i.enabled, this._enabledProductApi = i.enabledProductApi, this._apiBaseUrl = i.apiBaseUrl, this._name = e; 50 } 51 onRegister(e) { 52 this._injector = e.injector, this._isRegistered = !0; 53 } 54 requireRegistered() { 55 if (!this.isRegistered) throw new Error(`Product ${this.name} must be loaded to access the requested property.`); 56 } 57 }, c = (() => { 58 let e = class o { 59 constructor() { 60 this._clientConfig = u(U), this.productConfig = u(s), this.hostMetadata = new n("host", { 61 apiBaseUrl: "", 62 enabled: !0, 63 enabledProductApi: !0 64 }), this.activeProduct = o.DEFAULT_PRODUCT, this.metadata = /* @__PURE__ */ new Map(), this.productChanged = new p(); 65 } 66 get current() { 67 return this.getMetadata(this.activeProduct); 68 } 69 get isSingleDomainApp() { 70 return a in this._clientConfig; 71 } 72 get defaultProduct() { 73 return this.isSingleDomainApp ? this._clientConfig[a]?.defaultProduct : void 0; 74 } 75 get productApiUrls() { 76 if (!this.isSingleDomainApp) return {}; 77 let t = this._clientConfig[a].productApiUrls; 78 if (!t) throw new Error("App is running in single domain mode, but productApiUrls is not configured."); 79 return t; 80 } 81 getMetadata(t) { 82 if (this.isSingleDomainApp) { 83 if (t === o.DEFAULT_PRODUCT) return this.hostMetadata; 84 if (!this.metadata.has(t)) { 85 let r = Object.keys(this.productApiUrls); 86 if (!r.includes(t)) throw new Error(`Product ${t} is not configured in productApiUrls. Configured ones are: ${r}.`); 87 this.metadata.set(t, new n(t, { 88 apiBaseUrl: this.productApiUrls[t], 89 enabled: !0, 90 enabledProductApi: !0 91 })); 92 } 93 return this.metadata.get(t); 94 } 95 if (!this.productConfig[t]) throw new Error(`Product ${t} is not configured.`); 96 return this.metadata.has(t) || this.metadata.set(t, new n(t, this.productConfig[t])), this.metadata.get(t); 97 } 98 register(t, r) { 99 this.getMetadata(t).onRegister({ injector: r }); 100 } 101 setActive(t) { 102 if (this.activeProduct !== t) { 103 if (!this.getMetadata(t).isRegistered) throw new Error(`Cannot set active product ${t} because it was not registered.`); 104 this.activeProduct = t, this.productChanged.next(this.current); 105 } 106 } 107 }; 108 return e.DEFAULT_PRODUCT = "host", e.ɵfac = function(i) { 109 return new (i || e)(); 110 }, e.ɵprov = d({ 111 token: e, 112 factory: e.ɵfac, 113 providedIn: "root" 114 }), e; 115 })(); 116 })))(); 117} 118export { s as n, h as r, c as t }; 119 120//# sourceMappingURL=chunk-c9rg1mp5.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.