@roomle/embedding-lib 8.2.1 → 9.0.0-alpha.10

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.
@@ -1,4 +1,5 @@
1
- ## <small>8.2.1 (2026-10-23)</small>
1
+ ## 9.0.0-alpha.10 (2026-11-03)
2
2
 
3
- * Merge pull request #3158 from roomle-dev/hotfix/empty-mobile-catalog-RML-18271 ([24abe32](https://github.com/roomle-dev/roomle-ui/commit/24abe32)), closes [#3158](https://github.com/roomle-dev/roomle-ui/issues/3158)
4
- * fix(planner): show catalog drawer after starting the embedded planner ([287c87d](https://github.com/roomle-dev/roomle-ui/commit/287c87d))
3
+ * Merge pull request #3252 from roomle-dev/fix/rapi-v2-fallback-again ([7d26f21](https://github.com/roomle-dev/roomle-ui/commit/7d26f21)), closes [#3252](https://github.com/roomle-dev/roomle-ui/issues/3252)
4
+ * test(e2e): restore v2 RAPI mocks for v3 paths ([396124a](https://github.com/roomle-dev/roomle-ui/commit/396124a))
5
+ * fix(rapi): route all RAPI requests to v2 again ([f0e4d53](https://github.com/roomle-dev/roomle-ui/commit/f0e4d53))
package/hi.js CHANGED
@@ -65,10 +65,158 @@ var n = (e, t) => t === e.libraryId ? e : {
65
65
  }, window.addEventListener("message", h);
66
66
  }, _ = () => {
67
67
  h &&= (window.removeEventListener("message", h), null);
68
- }, v = {
68
+ }, v = ({ output: e }) => ({
69
+ type: "content",
70
+ value: e.content.map((e) => e.type === "text" ? {
71
+ type: "text",
72
+ text: e.text
73
+ } : {
74
+ type: "file",
75
+ mediaType: e.mimeType,
76
+ data: {
77
+ type: "data",
78
+ data: e.data
79
+ }
80
+ })
81
+ }), y = async ({ extended: e }) => {
82
+ if (typeof e.getExternalObjectAgentTools != "function") throw Error("The planner has no HI agent tools: it needs a Rubens UI with getExternalObjectAgentTools.");
83
+ let t = await e.getExternalObjectAgentTools();
84
+ return Object.fromEntries(t.map(({ name: t, description: n, inputSchema: r }) => {
85
+ let i = () => r;
86
+ return [t, {
87
+ type: "dynamic",
88
+ description: n,
89
+ inputSchema: { "~standard": {
90
+ version: 1,
91
+ vendor: "hi-mcp",
92
+ validate: (e) => ({ value: e }),
93
+ jsonSchema: {
94
+ input: i,
95
+ output: i
96
+ }
97
+ } },
98
+ execute: (n) => e.callExternalObjectAgentTool(t, n).catch((e) => ({
99
+ content: [{
100
+ type: "text",
101
+ text: e instanceof Error ? e.message : String(e)
102
+ }],
103
+ isError: !0
104
+ })),
105
+ toModelOutput: v
106
+ }];
107
+ }));
108
+ }, b = (e) => `https://esm.sh/${e}?deps=zod@4.6.5`, x = 16, S = async ({ provider: e, model: t, apiKey: n, baseUrl: r, chatCompletions: i, reasoningEffort: a }) => {
109
+ switch (e) {
110
+ case "azure": {
111
+ let { createAzure: e } = await import(
112
+ /* @vite-ignore */
113
+ b("@ai-sdk/azure@4.0.85")
114
+ ), o = e({
115
+ apiKey: n,
116
+ baseURL: r
117
+ });
118
+ return {
119
+ languageModel: i ? o.chat(t) : o(t),
120
+ providerOptions: a ? { azure: { reasoningEffort: a } } : void 0
121
+ };
122
+ }
123
+ case "mistral": {
124
+ let { createMistral: e } = await import(
125
+ /* @vite-ignore */
126
+ b("@ai-sdk/mistral@4.0.54")
127
+ );
128
+ return { languageModel: e({ apiKey: n })(t) };
129
+ }
130
+ case "anthropic": {
131
+ let { createAnthropic: e } = await import(
132
+ /* @vite-ignore */
133
+ b("@ai-sdk/anthropic@4.0.68")
134
+ );
135
+ return { languageModel: e({
136
+ apiKey: n,
137
+ headers: { "anthropic-dangerous-direct-browser-access": "true" }
138
+ })(t) };
139
+ }
140
+ case "google": {
141
+ let { createGoogleGenerativeAI: e } = await import(
142
+ /* @vite-ignore */
143
+ b("@ai-sdk/google@4.0.85")
144
+ );
145
+ return { languageModel: e({ apiKey: n })(t) };
146
+ }
147
+ default: throw Error(`Unknown provider "${e}" - supported: azure, mistral, anthropic, google`);
148
+ }
149
+ }, C = async (e, t, n) => {
150
+ let r = e.extended, i = (e) => r.planningAssistantOutput(e), a;
151
+ try {
152
+ a = await Promise.all([
153
+ import(
154
+ /* @vite-ignore */
155
+ b("ai@7.0.122")
156
+ ),
157
+ S(t),
158
+ r.getExternalObjectAgentPrompts(),
159
+ y(e)
160
+ ]);
161
+ } catch (e) {
162
+ console.log("[planning-assistant]", String(e)), i({
163
+ type: "availability",
164
+ available: !1,
165
+ text: String(e)
166
+ });
167
+ return;
168
+ }
169
+ let [{ streamText: o, stepCountIs: s }, c, l, u] = a, d = [];
170
+ r.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: t }) => {
171
+ let r = {
172
+ role: "user",
173
+ content: [{
174
+ type: "text",
175
+ text: e || l.imagePrompt
176
+ }, ...t.map((e) => ({
177
+ type: "file",
178
+ data: e,
179
+ mediaType: "image/jpeg"
180
+ }))]
181
+ };
182
+ try {
183
+ let e = o({
184
+ model: c.languageModel,
185
+ providerOptions: c.providerOptions,
186
+ instructions: l.systemPrompt,
187
+ messages: [...d, r],
188
+ tools: u,
189
+ stopWhen: s(x),
190
+ abortSignal: n,
191
+ prepareStep: ({ stepNumber: e }) => e === x - 1 ? { toolChoice: "none" } : void 0
192
+ });
193
+ for await (let t of e.stream) if (t.type === "text-delta") i({
194
+ type: "text",
195
+ text: t.text
196
+ });
197
+ else if (t.type === "tool-call") i({
198
+ type: "activity",
199
+ text: t.toolName
200
+ });
201
+ else if (t.type === "error") throw t.error;
202
+ d.push(r, ...await e.responseMessages), i({ type: "done" });
203
+ } catch (e) {
204
+ console.log("[planning-assistant]", String(e)), i({
205
+ type: "error",
206
+ text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}`
207
+ });
208
+ }
209
+ }, i({
210
+ type: "images",
211
+ enabled: t.readsImages
212
+ }), i({
213
+ type: "availability",
214
+ available: !0
215
+ });
216
+ }, w = {
69
217
  HIDE: "hide",
70
218
  SHOW_ATTRIBUTES: "attributes",
71
219
  SHOW_ARTICLES: "articles"
72
220
  };
73
221
  //#endregion
74
- export { v as HI_PANEL_ACTION, _ as cleanupHi, d as createHiLibraryCallbacks, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, g as setupHi, o as unregisterLegacyUrlFormat };
222
+ export { w as HI_PANEL_ACTION, _ as cleanupHi, d as createHiLibraryCallbacks, y as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, S as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, g as setupHi, C as startPlanningAssistant, o as unregisterLegacyUrlFormat };
package/hi.min.js CHANGED
@@ -66,9 +66,142 @@ var n = (e, t) => t === e.libraryId ? e : {
66
66
  }, window.addEventListener("message", m);
67
67
  }, g = () => {
68
68
  m &&= (window.removeEventListener("message", m), null);
69
- }, _ = {
69
+ }, _ = ({ output: e }) => ({
70
+ type: "content",
71
+ value: e.content.map((e) => e.type === "text" ? {
72
+ type: "text",
73
+ text: e.text
74
+ } : {
75
+ type: "file",
76
+ mediaType: e.mimeType,
77
+ data: {
78
+ type: "data",
79
+ data: e.data
80
+ }
81
+ })
82
+ }), v = async ({ extended: e }) => {
83
+ if (typeof e.getExternalObjectAgentTools != "function") throw Error("The planner has no HI agent tools: it needs a Rubens UI with getExternalObjectAgentTools.");
84
+ let t = await e.getExternalObjectAgentTools();
85
+ return Object.fromEntries(t.map(({ name: t, description: n, inputSchema: r }) => {
86
+ let i = () => r;
87
+ return [t, {
88
+ type: "dynamic",
89
+ description: n,
90
+ inputSchema: { "~standard": {
91
+ version: 1,
92
+ vendor: "hi-mcp",
93
+ validate: (e) => ({ value: e }),
94
+ jsonSchema: {
95
+ input: i,
96
+ output: i
97
+ }
98
+ } },
99
+ execute: (n) => e.callExternalObjectAgentTool(t, n).catch((e) => ({
100
+ content: [{
101
+ type: "text",
102
+ text: e instanceof Error ? e.message : String(e)
103
+ }],
104
+ isError: !0
105
+ })),
106
+ toModelOutput: _
107
+ }];
108
+ }));
109
+ }, y = (e) => `https://esm.sh/${e}?deps=zod@4.6.5`, b = async ({ provider: e, model: t, apiKey: n, baseUrl: r, chatCompletions: i, reasoningEffort: a }) => {
110
+ switch (e) {
111
+ case "azure": {
112
+ let { createAzure: e } = await import(y("@ai-sdk/azure@4.0.85")), o = e({
113
+ apiKey: n,
114
+ baseURL: r
115
+ });
116
+ return {
117
+ languageModel: i ? o.chat(t) : o(t),
118
+ providerOptions: a ? { azure: { reasoningEffort: a } } : void 0
119
+ };
120
+ }
121
+ case "mistral": {
122
+ let { createMistral: e } = await import(y("@ai-sdk/mistral@4.0.54"));
123
+ return { languageModel: e({ apiKey: n })(t) };
124
+ }
125
+ case "anthropic": {
126
+ let { createAnthropic: e } = await import(y("@ai-sdk/anthropic@4.0.68"));
127
+ return { languageModel: e({
128
+ apiKey: n,
129
+ headers: { "anthropic-dangerous-direct-browser-access": "true" }
130
+ })(t) };
131
+ }
132
+ case "google": {
133
+ let { createGoogleGenerativeAI: e } = await import(y("@ai-sdk/google@4.0.85"));
134
+ return { languageModel: e({ apiKey: n })(t) };
135
+ }
136
+ default: throw Error(`Unknown provider "${e}" - supported: azure, mistral, anthropic, google`);
137
+ }
138
+ }, x = async (e, t, n) => {
139
+ let r = e.extended, i = (e) => r.planningAssistantOutput(e), a;
140
+ try {
141
+ a = await Promise.all([
142
+ import(y("ai@7.0.122")),
143
+ b(t),
144
+ r.getExternalObjectAgentPrompts(),
145
+ v(e)
146
+ ]);
147
+ } catch (e) {
148
+ i({
149
+ type: "availability",
150
+ available: !1,
151
+ text: String(e)
152
+ });
153
+ return;
154
+ }
155
+ let [{ streamText: o, stepCountIs: s }, c, l, u] = a, d = [];
156
+ r.callbacks.onPlanningAssistantPrompt = async ({ text: e, images: t }) => {
157
+ let r = {
158
+ role: "user",
159
+ content: [{
160
+ type: "text",
161
+ text: e || l.imagePrompt
162
+ }, ...t.map((e) => ({
163
+ type: "file",
164
+ data: e,
165
+ mediaType: "image/jpeg"
166
+ }))]
167
+ };
168
+ try {
169
+ let e = o({
170
+ model: c.languageModel,
171
+ providerOptions: c.providerOptions,
172
+ instructions: l.systemPrompt,
173
+ messages: [...d, r],
174
+ tools: u,
175
+ stopWhen: s(16),
176
+ abortSignal: n,
177
+ prepareStep: ({ stepNumber: e }) => e === 15 ? { toolChoice: "none" } : void 0
178
+ });
179
+ for await (let t of e.stream) if (t.type === "text-delta") i({
180
+ type: "text",
181
+ text: t.text
182
+ });
183
+ else if (t.type === "tool-call") i({
184
+ type: "activity",
185
+ text: t.toolName
186
+ });
187
+ else if (t.type === "error") throw t.error;
188
+ d.push(r, ...await e.responseMessages), i({ type: "done" });
189
+ } catch (e) {
190
+ i({
191
+ type: "error",
192
+ text: `The planning assistant failed: ${e instanceof Error ? e.message : String(e)}`
193
+ });
194
+ }
195
+ }, i({
196
+ type: "images",
197
+ enabled: t.readsImages
198
+ }), i({
199
+ type: "availability",
200
+ available: !0
201
+ });
202
+ }, S = {
70
203
  HIDE: "hide",
71
204
  SHOW_ATTRIBUTES: "attributes",
72
205
  SHOW_ARTICLES: "articles"
73
206
  };
74
- export { _ as HI_PANEL_ACTION, g as cleanupHi, d as createHiLibraryCallbacks, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, h as setupHi, o as unregisterLegacyUrlFormat };
207
+ export { S as HI_PANEL_ACTION, g as cleanupHi, d as createHiLibraryCallbacks, v as createHiMcpTools, c as libLoadArticleCatalog, u as libLoadCalcScript, l as libLoadMasterData, b as loadChatModel, p as omGetRequest, f as omPostRequest, a as registerLegacyUrlFormat, h as setupHi, x as startPlanningAssistant, o as unregisterLegacyUrlFormat };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roomle/embedding-lib",
3
- "version": "8.2.1",
3
+ "version": "9.0.0-alpha.10",
4
4
  "description": "This is a small library which can be used to communicate with the Roomle Configurator. ES modules only (browser-compatible).",
5
5
  "type": "module",
6
6
  "main": "./roomle-embedding-lib.js",
@@ -14,5 +14,7 @@ export { createHiLibraryCallbacks } from './homag-intelligence/hi-callbacks';
14
14
  export { libLoadArticleCatalog, libLoadMasterData, libLoadCalcScript, registerLegacyUrlFormat, unregisterLegacyUrlFormat, } from './homag-intelligence/hi-requests';
15
15
  export { omPostRequest, omGetRequest, } from './homag-intelligence/hi-order-manager';
16
16
  export { setupHi, cleanupHi } from './homag-intelligence/hi-setup';
17
+ export { createHiMcpTools, type HiMcpTool, type HiMcpTools, type HiMcpPlannerApi, } from './homag-intelligence/hi-mcp-tools';
18
+ export { loadChatModel, startPlanningAssistant, type PlanningAssistantConfig, type PlanningAssistantPlannerApi, } from './homag-intelligence/hi-planning-assistant';
17
19
  export { type ExternalObjectSnapshotSaveResult, type HiContextAction, } from '../../web-sdk/packages';
18
20
  export { HI_PANEL_ACTION, type HiPanelActionType, type HiOrderHeader, type HiOrder, type HiOrderData, type HiPriceData, type HiCallbacks, } from '../../common/src/hi/hi-types';
@@ -0,0 +1,68 @@
1
+ import { HiAgentToolDefinition, McpToolResult } from '../../../web-sdk/packages';
2
+ /** What the model gets of a tool result, as `@ai-sdk/mcp` hands it to the AI SDK. */
3
+ export interface HiMcpModelOutput {
4
+ type: 'content';
5
+ value: ({
6
+ type: 'text';
7
+ text: string;
8
+ } | {
9
+ type: 'file';
10
+ mediaType: string;
11
+ data: {
12
+ type: 'data';
13
+ data: string;
14
+ };
15
+ })[];
16
+ }
17
+ /** The input schema of a tool as a Standard Schema with its JSON Schema. */
18
+ export interface HiMcpInputSchema {
19
+ '~standard': {
20
+ version: 1;
21
+ vendor: string;
22
+ validate: (value: unknown) => {
23
+ value: unknown;
24
+ };
25
+ jsonSchema: {
26
+ input: (options: {
27
+ target: string;
28
+ }) => Record<string, unknown>;
29
+ output: (options: {
30
+ target: string;
31
+ }) => Record<string, unknown>;
32
+ };
33
+ };
34
+ }
35
+ /** A tool of the HI MCP tool set, in the shape of an AI SDK dynamic tool. */
36
+ export interface HiMcpTool {
37
+ type: 'dynamic';
38
+ description: string;
39
+ inputSchema: HiMcpInputSchema;
40
+ execute: (input: unknown) => Promise<McpToolResult>;
41
+ toModelOutput: (options: {
42
+ output: McpToolResult;
43
+ }) => HiMcpModelOutput;
44
+ }
45
+ /** The HI MCP tools by name, the tool set an AI SDK `streamText` takes. */
46
+ export type HiMcpTools = Record<string, HiMcpTool>;
47
+ /** The planner methods the HI MCP tools forward to: the HI agent tools of the planner. */
48
+ export interface HiMcpPlannerApi {
49
+ extended: {
50
+ getExternalObjectAgentTools(): Promise<HiAgentToolDefinition[]>;
51
+ callExternalObjectAgentTool(name: string, input: unknown): Promise<McpToolResult>;
52
+ };
53
+ }
54
+ /** The tool result as `@ai-sdk/mcp` passes it to the model: text parts and images as file parts. */
55
+ export declare const mcpToModelOutput: ({ output, }: {
56
+ output: McpToolResult;
57
+ }) => HiMcpModelOutput;
58
+ /**
59
+ * Creates the HI MCP tools for an AI agent that plans in the planner of this
60
+ * page: the HI agent tools of the planner as an AI SDK tool set, without the
61
+ * MCP protocol. The host passes the tool set as `tools` to its own
62
+ * `streamText`. The tools run in the planner; every call is forwarded to
63
+ * `callExternalObjectAgentTool`. The AI SDK gets the JSON Schema of each input
64
+ * and lets every input through: the planner validates it and answers an
65
+ * invalid input and a failed call as an MCP error result (`isError`), as a
66
+ * forwarding error is answered here.
67
+ */
68
+ export declare const createHiMcpTools: ({ extended, }: HiMcpPlannerApi) => Promise<HiMcpTools>;
@@ -0,0 +1,55 @@
1
+ import { PlanningAssistantOutput, PlanningAssistantPrompt } from '../../../web-sdk/packages';
2
+ import { HiMcpPlannerApi } from './hi-mcp-tools';
3
+ /**
4
+ * The model of the AI Planning Assistant as a JSON object: everything
5
+ * `loadChatModel` and `startPlanningAssistant` need to reach it.
6
+ */
7
+ export interface PlanningAssistantConfig {
8
+ /** `azure` for a deployment on an Azure AI Foundry resource, else the provider of the model. */
9
+ provider: 'azure' | 'mistral' | 'anthropic' | 'google';
10
+ /** The model id at the provider; for `azure` the name of the deployment. */
11
+ model: string;
12
+ /** The API key of the provider; for `azure` the key of the Foundry resource. */
13
+ apiKey: string;
14
+ /** `azure` only: the OpenAI v1 endpoint of the Foundry resource, e.g. `https://<resource>.services.ai.azure.com/openai/v1`. */
15
+ baseUrl?: string;
16
+ /** `azure` only: call the deployment through the Chat Completions API instead of the Responses API. */
17
+ chatCompletions?: boolean;
18
+ /** `azure` only: the reasoning effort of the deployment; its default when unset. */
19
+ reasoningEffort?: string;
20
+ /** Whether the model reads images: the window offers the image drop only then. */
21
+ readsImages: boolean;
22
+ }
23
+ /** The planner the planning assistant runs in: the HI MCP tools' planner API, the agent prompts and the window. */
24
+ export type PlanningAssistantPlannerApi = HiMcpPlannerApi & {
25
+ extended: {
26
+ getExternalObjectAgentPrompts(): Promise<{
27
+ systemPrompt: string;
28
+ imagePrompt: string;
29
+ }>;
30
+ planningAssistantOutput(part: PlanningAssistantOutput): unknown;
31
+ callbacks: {
32
+ onPlanningAssistantPrompt?: (prompt: PlanningAssistantPrompt) => Promise<void>;
33
+ };
34
+ };
35
+ };
36
+ /** The AI SDK language model of the config and the provider options `streamText` takes with it. */
37
+ export declare const loadChatModel: ({ provider, model, apiKey, baseUrl, chatCompletions, reasoningEffort, }: PlanningAssistantConfig) => Promise<{
38
+ languageModel: any;
39
+ providerOptions: {
40
+ azure: {
41
+ reasoningEffort: string;
42
+ };
43
+ };
44
+ } | {
45
+ languageModel: any;
46
+ providerOptions?: undefined;
47
+ }>;
48
+ /**
49
+ * Runs the planning agent of the AI Planning Assistant window
50
+ * (featureFlags.planningAssistant) in this page: the window hands every
51
+ * message to "onPlanningAssistantPrompt", the agent calls the HI MCP tools,
52
+ * the tools run in the planner of this page, and the agent's output goes to
53
+ * "planningAssistantOutput". Aborting the signal ends a running turn.
54
+ */
55
+ export declare const startPlanningAssistant: (roomDesignerApi: PlanningAssistantPlannerApi, config: PlanningAssistantConfig, signal: AbortSignal) => Promise<void>;
@@ -97,6 +97,14 @@ var t = class {
97
97
  }, c = /* @__PURE__ */ function(e) {
98
98
  return e.BOTTOM_BAR = "bottom_bar", e.PARTLIST_BOUNDS = "partlist_bounds", e.INTERACTION_NOTES = "interaction_notes", e.PARAMETER_GROUPS = "parameter_groups", e;
99
99
  }({}), l = (e) => JSON.parse(JSON.stringify(e)), u = {
100
+ staging: !1,
101
+ theme: "scandinavian",
102
+ density: "balanced",
103
+ light: "soft",
104
+ birdsEyeView: "adjust",
105
+ debug: !1,
106
+ stage: "alpha"
107
+ }, d = {
100
108
  mobileLandscape: !0,
101
109
  floorMaterialRootTag: "materials_root",
102
110
  buttons: {
@@ -124,35 +132,36 @@ var t = class {
124
132
  openCloseAnimation: !0,
125
133
  localExport3d: !1
126
134
  },
135
+ imageGenConfig: u,
127
136
  configuratorZoom: !1,
128
137
  rotationSnapDegrees: 10,
129
138
  interactionsCollapsed: !1
130
- }, d = (e) => (p(e), e?.customApiUrl && (e.customApiUrl = decodeURIComponent(e.customApiUrl)), e.shareUrl && (e.deeplink = e.shareUrl.replace(h, g)), e), f = (e) => e.trim() !== "" && Number.isFinite(Number(e.trim())), p = (e) => {
139
+ }, f = (e) => (m(e), e?.customApiUrl && (e.customApiUrl = decodeURIComponent(e.customApiUrl)), e.shareUrl && (e.deeplink = e.shareUrl.replace(g, _)), e), p = (e) => e.trim() !== "" && Number.isFinite(Number(e.trim())), m = (e) => {
131
140
  if (!e || typeof e != "object") return;
132
141
  let t = Object.keys(e);
133
142
  for (let n of t) {
134
143
  let t = e[n];
135
- if (!Array.isArray(t) && typeof t == "object" && t && p(t), Array.isArray(t)) for (let e of t) p(e);
136
- t === "true" || t === "false" ? e[n] = t === "true" : typeof t == "string" && f(t) && (e[n] = Number(t));
144
+ if (!Array.isArray(t) && typeof t == "object" && t && m(t), Array.isArray(t)) for (let e of t) m(e);
145
+ t === "true" || t === "false" ? e[n] = t === "true" : typeof t == "string" && p(t) && (e[n] = Number(t));
137
146
  }
138
- }, m = () => {
139
- let t = l(u);
147
+ }, h = () => {
148
+ let t = l(d);
140
149
  t.locale ||= e(null, !0), t.id === "(idle)" && delete t.id;
141
150
  let n = i();
142
- return n && a(n) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = void 0, t.emails = !1, t;
143
- }, h = "<CONF_ID>", g = "#CONFIGURATIONID#", _ = (e) => {
151
+ return n && a(n) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
152
+ }, g = "<CONF_ID>", _ = "#CONFIGURATIONID#", v = (e) => {
144
153
  let t = e.featureFlags;
145
154
  if (!t || typeof t != "object" || Array.isArray(t)) return;
146
155
  let n = t;
147
156
  "enableTwoLevelCatalog" in n && typeof n.enableTwoLevelCatalog == "boolean" && (e.enableTwoLevelCatalog === !1 || e.enableTwoLevelCatalog === void 0) && (e.enableTwoLevelCatalog = n.enableTwoLevelCatalog), "webGpu" in n && typeof n.webGpu == "boolean" && (e.webGpu === !1 || e.webGpu === void 0) && (e.webGpu = n.webGpu);
148
- }, v = (e) => {
157
+ }, y = (e) => {
149
158
  e.featureFlags ||= {}, typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
150
- }, y = (e, t) => {
151
- let n = l(t), r = m();
152
- v(r);
159
+ }, b = (e, t) => {
160
+ let n = l(t), r = h();
161
+ y(r);
153
162
  let i = o(o(r, e.settings || {}), n);
154
- return i.configuratorId = e.id, !i.overrideTenant && e.tenant && (i.overrideTenant = e.tenant), _(i), i;
155
- }, b = () => /(android)/i.test(navigator.userAgent), x = class {
163
+ return i.configuratorId = e.id, !i.overrideTenant && e.tenant && (i.overrideTenant = e.tenant), v(i), i;
164
+ }, x = () => /(android)/i.test(navigator.userAgent), S = class {
156
165
  _messageHandler = null;
157
166
  isSetupDone = !1;
158
167
  viewName = "main";
@@ -216,7 +225,7 @@ var t = class {
216
225
  }
217
226
  }));
218
227
  }
219
- }, S = () => {
228
+ }, C = () => {
220
229
  let e, t;
221
230
  return {
222
231
  promise: new Promise((n, r) => {
@@ -229,7 +238,7 @@ var t = class {
229
238
  //#endregion
230
239
  //#region packages/common/src/utils/rapi-version.ts
231
240
  (/* @__PURE__ */ "/items./items/{id}./items/{id}/renderings./items/{id}/conversions./items/{id}/3d-exports./items/{id}/perspectiveImage./items/{id}/perspectiveImageHD./items/{id}/topImage./items/{id}/tags./items/{id}/tagConnections./items/{id}/additionalContents./items/{id}/assetProcessings./items/{id}/3dAssets/{format}./items/{id}/3dAssets/{format}/{dummyFileName}./configurations./configurations/{id}./configurations/{id}/shares./configurations/{id}/renderings./configurations/{id}/3d-exports./configurations/{id}/3dAssets/{format}./configurations/{id}/3dAssets/{format}/{dummyFileName}./auth/signin./auth/signout./auth/reset./auth/reset/confirm./auth/change/pwd./auth/context./assets/analyze./version".split(".")).map((e) => RegExp("^" + e.replace(/\{[^}]+\}/g, "[^/]+") + "/?$"));
232
- var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t, T = {
241
+ var w = /\/v[23]\/?$/, T = (e, t) => w.test(e) ? e.replace(w, "/v2") + t : e + t, E = {
233
242
  SDK: "extended",
234
243
  CONFIGURATOR_SDK: "configurator",
235
244
  CALLBACKS: "callbacks",
@@ -237,22 +246,22 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
237
246
  ANALYTICS: "analytics",
238
247
  GLOBAL: "global",
239
248
  RAPI: "rapi"
240
- }, E = ".", D = T.SDK + "." + T.CALLBACKS, O = {
249
+ }, D = ".", O = E.SDK + "." + E.CALLBACKS, k = {
241
250
  REQUEST_BOOT: "requestBoot",
242
251
  SETUP: "setup",
243
252
  WEBSITE_READY: "websiteReady"
244
- }, k = {
253
+ }, A = {
245
254
  GET_METHODS: "getMethods",
246
255
  RETURN_METHODS: "returnMethods",
247
256
  REGISTER_CUSTOM_VIEW: "registerCustomView",
248
257
  REGISTER_CUSTOM_VIEW_DONE: "registerCustomViewDone"
249
- }, A = ["constructor", "callbacks"], j = (e) => e[0] !== "_" && !A.includes(e), M = (e, t, n = !1) => {
258
+ }, j = ["constructor", "callbacks"], M = (e) => e[0] !== "_" && !j.includes(e), N = (e, t, n = !1) => {
250
259
  if (!e) return [];
251
- let r = Object.getOwnPropertyNames(e), i = n ? T.CALLBACKS + "." : "";
252
- return r.filter(j).map((e) => t + "." + i + e);
253
- }, N = async (e, t) => {
260
+ let r = Object.getOwnPropertyNames(e), i = n ? E.CALLBACKS + "." : "";
261
+ return r.filter(M).map((e) => t + "." + i + e);
262
+ }, P = async (e, t) => {
254
263
  if (typeof e != "string") throw Error("Configurator ID is not a string type: \"" + typeof e + "\"");
255
- let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = w(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
264
+ let n = t.customApiUrl ? t.customApiUrl : "https://api.roomle.com/v2", r = t.overrideTenant || 9, i = T(n, "/configurators/" + e), a = "03-" + window.btoa((/* @__PURE__ */ new Date()).toISOString() + ";anonymous;roomle_portal_v2"), o = new Request(i, {
256
265
  method: "GET",
257
266
  headers: new Headers({
258
267
  apiKey: "roomle_portal_v2",
@@ -267,7 +276,7 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
267
276
  cache: "default"
268
277
  }), { configurator: s } = await (await fetch(o)).json();
269
278
  return s;
270
- }, P = "data-rml-interaction-container", F = (e, t, n) => {
279
+ }, F = "data-rml-interaction-container", I = (e, t, n) => {
271
280
  let r = null;
272
281
  Object.defineProperty(e, t, {
273
282
  get() {
@@ -277,28 +286,28 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
277
286
  e?.mute ? r = e.value : (console.warn("You override Roomle defined behaviour. To disalbe this warning pass in an object with the following properties"), console.warn("{ mute: true, value: () => void }"), r = e);
278
287
  }
279
288
  });
280
- }, I = () => window.innerHeight * .01 + "px", L = (e) => {
281
- e && setTimeout(() => e.style.setProperty(B, I()), 0);
282
- }, R = "rml-styles", z = 450, B = "--rml-full-height", V = {
289
+ }, L = () => window.innerHeight * .01 + "px", R = (e) => {
290
+ e && setTimeout(() => e.style.setProperty(V, L()), 0);
291
+ }, z = "rml-styles", B = 450, V = "--rml-full-height", H = {
283
292
  CONTAINER: "rml-container",
284
293
  FILL: "rml-fill",
285
294
  POSITION: "rml-pos",
286
295
  TRANSITION: "rml-transition",
287
296
  ANDROID_HEIGHT: "rml-android-height",
288
297
  OVERFLOW_HIDDEN: "rml-overflow-hidden"
289
- }, H = /* @__PURE__ */ new Map(), U = class extends x {
298
+ }, U = /* @__PURE__ */ new Map(), W = class extends S {
290
299
  static createPlanner(e, t, n, r = []) {
291
300
  return this._create(e, t, n, r);
292
301
  }
293
302
  static async connect(e, n = []) {
294
- let r = new x();
303
+ let r = new S();
295
304
  r.viewName = e;
296
- let { resolve: i, promise: a } = S(), { resolve: o, promise: s } = S(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
305
+ let { resolve: i, promise: a } = C(), { resolve: o, promise: s } = C(), c = new t("custom-view-" + e, window, window.parent, ({ message: e, args: t }) => {
297
306
  switch (e) {
298
- case k.REGISTER_CUSTOM_VIEW_DONE:
307
+ case A.REGISTER_CUSTOM_VIEW_DONE:
299
308
  i();
300
309
  break;
301
- case k.RETURN_METHODS:
310
+ case A.RETURN_METHODS:
302
311
  r.handleSetup(t[0]), o();
303
312
  break;
304
313
  default: if (r.isSetupDone) return r.executeMessage({
@@ -309,7 +318,7 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
309
318
  });
310
319
  r.setMessageHandler(c);
311
320
  let l = [e];
312
- return c.sendMessage(k.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(k.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
321
+ return c.sendMessage(A.REGISTER_CUSTOM_VIEW, l), await a, c.sendMessage(A.GET_METHODS, l), await s, r.setupPlugins(n, document.body, "custom-view"), await Promise.allSettled(r.pluginsLoaded), r;
313
322
  }
314
323
  static createConfigurator(e, t, n, r = []) {
315
324
  return this._create(e, t, n, r);
@@ -323,10 +332,10 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
323
332
  static async _create(e, t, n, r) {
324
333
  return new Promise(async (i, a) => {
325
334
  try {
326
- let a = d(n), s = m();
327
- v(s);
328
- let c = await N(e, o(s, a));
329
- n = y(c, a);
335
+ let a = f(n), s = h();
336
+ y(s);
337
+ let c = await P(e, o(s, a));
338
+ n = b(c, a);
330
339
  let l = new this(c, t, n, r, i);
331
340
  return await Promise.allSettled(l.pluginsLoaded), l;
332
341
  } catch (e) {
@@ -341,51 +350,51 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
341
350
  _iframe;
342
351
  constructor(e, n, r, i, a) {
343
352
  if (super(), !e || typeof e.id != "string") throw Error("Please provide a correct configuratorId, you get the correct ID from your Roomle Contact Person");
344
- if (H.has(n)) throw Error("There is already an instance on this DOM element");
345
- if (!document.getElementById(R)) {
353
+ if (U.has(n)) throw Error("There is already an instance on this DOM element");
354
+ if (!document.getElementById(z)) {
346
355
  let e = r.zIndex || 9999999, t = document.createElement("style");
347
- t.type = "text/css", t.id = R;
348
- let n = "transition:all ease-in-out " + z + "ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a = I();
356
+ t.type = "text/css", t.id = z;
357
+ let n = "transition:all ease-in-out " + B + "ms;", i = ["-webkit-", "-o-"].reduce((e, t) => e += t + n, "") + n, a = L();
349
358
  t.innerHTML = `
350
- .${V.CONTAINER}{${B}:${a};}
351
- .${V.POSITION}{position:fixed;top:0;left:0;z-index:${e};opacity:0}
352
- .${V.TRANSITION}{${i}}
353
- .${V.FILL}{width:100%;height:100%;opacity:1}
354
- .${V.ANDROID_HEIGHT}{height:calc(var(${B},1vh)*100)}
355
- .${V.OVERFLOW_HIDDEN}{overflow:hidden}
359
+ .${H.CONTAINER}{${V}:${a};}
360
+ .${H.POSITION}{position:fixed;top:0;left:0;z-index:${e};opacity:0}
361
+ .${H.TRANSITION}{${i}}
362
+ .${H.FILL}{width:100%;height:100%;opacity:1}
363
+ .${H.ANDROID_HEIGHT}{height:calc(var(${V},1vh)*100)}
364
+ .${H.OVERFLOW_HIDDEN}{overflow:hidden}
356
365
  `, document.head.appendChild(t);
357
366
  }
358
367
  this._executeMessage = this._executeMessage.bind(this);
359
368
  let o = new t("website", window, null, this._executeMessage);
360
- this.setMessageHandler(o), this._onResize = this._onResize.bind(this), b() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
369
+ this.setMessageHandler(o), this._onResize = this._onResize.bind(this), x() && window.addEventListener("resize", this._onResize), this._container = n, this._initData = r, this._configuratorSettings = e;
361
370
  let s = this._createIframe();
362
- this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), H.set(n, !0);
371
+ this._onUseFullPage = this._onUseFullPage.bind(this), this._onBackToWebsite = this._onBackToWebsite.bind(this), this._waitForIframe = a, this._container.appendChild(s), this._iframe = s, this.setupPlugins(i, this._iframe), U.set(n, !0);
363
372
  }
364
373
  teardown() {
365
- this._container && H.delete(this._container);
374
+ this._container && U.delete(this._container);
366
375
  let e = this._container.querySelector("iframe");
367
376
  e && this._container.removeChild(e), window.removeEventListener("resize", this._onResize);
368
377
  }
369
378
  _createIframe() {
370
379
  let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
371
- return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.classList.add(V.CONTAINER), e.classList.add(V.FILL), e;
380
+ return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(H.CONTAINER), e.classList.add(H.FILL), e;
372
381
  }
373
382
  _onResize() {
374
- L(this._iframe);
383
+ R(this._iframe);
375
384
  }
376
385
  _onUseFullPage() {
377
- this._iframe.classList.add(V.POSITION), document.documentElement.classList.add(V.OVERFLOW_HIDDEN), window.document.body.classList.add(V.OVERFLOW_HIDDEN), b() && (L(this._iframe), this._iframe.classList.add(V.ANDROID_HEIGHT));
386
+ this._iframe.classList.add(H.POSITION), document.documentElement.classList.add(H.OVERFLOW_HIDDEN), window.document.body.classList.add(H.OVERFLOW_HIDDEN), x() && (R(this._iframe), this._iframe.classList.add(H.ANDROID_HEIGHT));
378
387
  }
379
388
  _onBackToWebsite() {
380
- this._iframe.classList.remove(V.POSITION), this._iframe.classList.remove(V.ANDROID_HEIGHT), document.documentElement.classList.remove(V.OVERFLOW_HIDDEN), window.document.body.classList.remove(V.OVERFLOW_HIDDEN);
389
+ this._iframe.classList.remove(H.POSITION), this._iframe.classList.remove(H.ANDROID_HEIGHT), document.documentElement.classList.remove(H.OVERFLOW_HIDDEN), window.document.body.classList.remove(H.OVERFLOW_HIDDEN);
381
390
  }
382
391
  _executeMessage({ message: e, args: t }, n) {
383
- if (n.source && n.source === this._iframe?.contentWindow) return e === O.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === O.SETUP ? (this.handleSetup(t[0]), F(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), F(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
392
+ if (n.source && n.source === this._iframe?.contentWindow) return e === k.REQUEST_BOOT ? this._messageHandler ? (this._messageHandler.setOutgoingMessageBus(n.source), Promise.resolve({ result: this._initData })) : (console.error("MessageHandler not set"), Promise.resolve({ error: "MessageHandler not set" })) : e === k.SETUP ? (this.handleSetup(t[0]), I(this.ui.callbacks, "onUseFullPage", this._onUseFullPage), I(this.ui.callbacks, "onBackToWebsite", this._onBackToWebsite), this._waitForIframe(this), setTimeout(() => {
384
393
  if (!this._messageHandler) {
385
394
  console.error("MessageHandler not set");
386
395
  return;
387
396
  }
388
- this._messageHandler.sendMessage(O.WEBSITE_READY);
397
+ this._messageHandler.sendMessage(k.WEBSITE_READY);
389
398
  }, 0), Promise.resolve({ result: null })) : this.executeMessage({
390
399
  message: e,
391
400
  args: t
@@ -393,4 +402,4 @@ var C = /\/v[23]\/?$/, w = (e, t) => C.test(e) ? e.replace(C, "/v2") + t : e + t
393
402
  }
394
403
  };
395
404
  //#endregion
396
- export { O as HANDSHAKE_MESSAGES, P as INTERACTION_CONTAINER_SELECTOR, T as NAMESPACE, E as NAMESPACE_SEPARATOR, D as SDK_CALLBACK, k as WELL_KNOWN_MESSAGES, U as default, N as getConfiguratorSettings, M as getMethodNames, j as isExposable };
405
+ export { k as HANDSHAKE_MESSAGES, F as INTERACTION_CONTAINER_SELECTOR, E as NAMESPACE, D as NAMESPACE_SEPARATOR, O as SDK_CALLBACK, A as WELL_KNOWN_MESSAGES, W as default, P as getConfiguratorSettings, N as getMethodNames, M as isExposable };
@@ -102,6 +102,15 @@ var t = class {
102
102
  openCloseAnimation: !0,
103
103
  localExport3d: !1
104
104
  },
105
+ imageGenConfig: {
106
+ staging: !1,
107
+ theme: "scandinavian",
108
+ density: "balanced",
109
+ light: "soft",
110
+ birdsEyeView: "adjust",
111
+ debug: !1,
112
+ stage: "alpha"
113
+ },
105
114
  configuratorZoom: !1,
106
115
  rotationSnapDegrees: 10,
107
116
  interactionsCollapsed: !1
@@ -134,7 +143,7 @@ var t = class {
134
143
  return r && ((e) => {
135
144
  let t = /* @__PURE__ */ new RegExp(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/);
136
145
  return !!(n.includes(e) || t.test(e) || e.endsWith("roomle.com") || e.endsWith("gitlab.io") || e.endsWith("gitlab.com"));
137
- })(r) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = void 0, t.emails = !1, t;
146
+ })(r) && (t.configuratorId = "demoConfigurator"), t.customApiUrl = "https://rubens.alpha.roomle.com/api/v2", t.emails = !1, t;
138
147
  }, d = (e) => {
139
148
  e.featureFlags ||= {}, typeof e.featureFlags.realPartList != "boolean" && (e.featureFlags.realPartList = !0), typeof e.featureFlags.globalCallbacks != "boolean" && (e.featureFlags.globalCallbacks = !0), typeof e.featureFlags.mocAr != "boolean" && (e.featureFlags.mocAr = !1);
140
149
  }, f = () => /(android)/i.test(navigator.userAgent), p = class {
@@ -343,7 +352,7 @@ var h = /\/v[23]\/?$/, g = {
343
352
  }
344
353
  _createIframe() {
345
354
  let e = document.createElement("iframe"), t = this._configuratorSettings?.url || "https://www.roomle.com/t/cp/";
346
- return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.classList.add(j), e.classList.add(M), e;
355
+ return this._initData.useLocalRoomle && (t = location.href.replace("embedding.html", "")), location.href.includes("roomle.gitlab.io") && (t = location.href.replace("embedding.html", "index.html")), this._initData.overrideServerUrl && (t = this._initData.overrideServerUrl), e.src = t, e.allow = "microphone", e.classList.add(j), e.classList.add(M), e;
347
356
  }
348
357
  _onResize() {
349
358
  O(this._iframe);