obi-sdk 0.1.2 → 0.1.3

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.
@@ -190,10 +190,10 @@ class ZodError extends Error {
190
190
  fieldErrors._errors.push(mapper(issue));
191
191
  } else {
192
192
  let curr = fieldErrors;
193
- let i2 = 0;
194
- while (i2 < issue.path.length) {
195
- const el = issue.path[i2];
196
- const terminal = i2 === issue.path.length - 1;
193
+ let i3 = 0;
194
+ while (i3 < issue.path.length) {
195
+ const el = issue.path[i3];
196
+ const terminal = i3 === issue.path.length - 1;
197
197
  if (!terminal) {
198
198
  curr[el] = curr[el] || { _errors: [] };
199
199
  } else {
@@ -201,7 +201,7 @@ class ZodError extends Error {
201
201
  curr[el]._errors.push(mapper(issue));
202
202
  }
203
203
  curr = curr[el];
204
- i2++;
204
+ i3++;
205
205
  }
206
206
  }
207
207
  }
@@ -2185,14 +2185,14 @@ class ZodArray extends ZodType {
2185
2185
  }
2186
2186
  }
2187
2187
  if (ctx.common.async) {
2188
- return Promise.all([...ctx.data].map((item, i2) => {
2189
- return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
2188
+ return Promise.all([...ctx.data].map((item, i3) => {
2189
+ return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i3));
2190
2190
  })).then((result2) => {
2191
2191
  return ParseStatus.mergeArray(status, result2);
2192
2192
  });
2193
2193
  }
2194
- const result = [...ctx.data].map((item, i2) => {
2195
- return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
2194
+ const result = [...ctx.data].map((item, i3) => {
2195
+ return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i3));
2196
2196
  });
2197
2197
  return ParseStatus.mergeArray(status, result);
2198
2198
  }
@@ -3121,7 +3121,7 @@ class ZodSet extends ZodType {
3121
3121
  }
3122
3122
  return { status: status.value, value: parsedSet };
3123
3123
  }
3124
- const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i2)));
3124
+ const elements = [...ctx.data.values()].map((item, i3) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i3)));
3125
3125
  if (ctx.common.async) {
3126
3126
  return Promise.all(elements).then((elements2) => finalizeSet(elements2));
3127
3127
  } else {
@@ -3949,7 +3949,7 @@ const coerce = {
3949
3949
  date: (arg) => ZodDate.create({ ...arg, coerce: true })
3950
3950
  };
3951
3951
  const NEVER = INVALID;
3952
- var z$1 = /* @__PURE__ */ Object.freeze({
3952
+ var z$2 = /* @__PURE__ */ Object.freeze({
3953
3953
  __proto__: null,
3954
3954
  defaultErrorMap: errorMap,
3955
3955
  setErrorMap,
@@ -4065,12 +4065,17 @@ var z$1 = /* @__PURE__ */ Object.freeze({
4065
4065
  quotelessJson,
4066
4066
  ZodError
4067
4067
  });
4068
- const ObiSDKConfigSchema = z$1.object({
4069
- apiKey: z$1.string().optional(),
4070
- baseUrl: z$1.string().default("https://iamobi.ai/api"),
4071
- enableVoice: z$1.boolean().default(true),
4072
- enableScreenCapture: z$1.boolean().default(true),
4073
- debug: z$1.boolean().default(false)
4068
+ const API_BASE_URL = "https://iamobi.ai/api";
4069
+ const ObiSDKConfigSchema = z$2.object({
4070
+ apiKey: z$2.string().optional(),
4071
+ enableVoice: z$2.boolean().default(true),
4072
+ enableScreenCapture: z$2.boolean().default(true),
4073
+ debug: z$2.boolean().default(false),
4074
+ user: z$2.object({
4075
+ id: z$2.string(),
4076
+ email: z$2.string().optional(),
4077
+ metadata: z$2.any().optional()
4078
+ }).optional()
4074
4079
  });
4075
4080
  var EventType = /* @__PURE__ */ ((EventType2) => {
4076
4081
  EventType2["READY"] = "ready";
@@ -4094,229 +4099,229 @@ var SDKState = /* @__PURE__ */ ((SDKState2) => {
4094
4099
  SDKState2["AWAITING_USER_INPUT"] = "awaiting_user_input";
4095
4100
  return SDKState2;
4096
4101
  })(SDKState || {});
4097
- const t = Symbol.for("@ts-pattern/matcher"), e = Symbol.for("@ts-pattern/isVariadic"), n = "@ts-pattern/anonymous-select-key", r = (t2) => Boolean(t2 && "object" == typeof t2), i = (e2) => e2 && !!e2[t], o = (n2, s2, c2) => {
4098
- if (i(n2)) {
4099
- const e2 = n2[t](), { matched: r2, selections: i2 } = e2.match(s2);
4100
- return r2 && i2 && Object.keys(i2).forEach((t2) => c2(t2, i2[t2])), r2;
4102
+ const t$3 = Symbol.for("@ts-pattern/matcher"), e$5 = Symbol.for("@ts-pattern/isVariadic"), n$6 = "@ts-pattern/anonymous-select-key", r$6 = (t2) => Boolean(t2 && "object" == typeof t2), i$5 = (e2) => e2 && !!e2[t$3], o$7 = (n3, s2, c2) => {
4103
+ if (i$5(n3)) {
4104
+ const e2 = n3[t$3](), { matched: r2, selections: i3 } = e2.match(s2);
4105
+ return r2 && i3 && Object.keys(i3).forEach((t2) => c2(t2, i3[t2])), r2;
4101
4106
  }
4102
- if (r(n2)) {
4103
- if (!r(s2))
4107
+ if (r$6(n3)) {
4108
+ if (!r$6(s2))
4104
4109
  return false;
4105
- if (Array.isArray(n2)) {
4110
+ if (Array.isArray(n3)) {
4106
4111
  if (!Array.isArray(s2))
4107
4112
  return false;
4108
4113
  let t2 = [], r2 = [], a2 = [];
4109
- for (const o2 of n2.keys()) {
4110
- const s3 = n2[o2];
4111
- i(s3) && s3[e] ? a2.push(s3) : a2.length ? r2.push(s3) : t2.push(s3);
4114
+ for (const o2 of n3.keys()) {
4115
+ const s3 = n3[o2];
4116
+ i$5(s3) && s3[e$5] ? a2.push(s3) : a2.length ? r2.push(s3) : t2.push(s3);
4112
4117
  }
4113
4118
  if (a2.length) {
4114
4119
  if (a2.length > 1)
4115
4120
  throw new Error("Pattern error: Using `...P.array(...)` several times in a single pattern is not allowed.");
4116
4121
  if (s2.length < t2.length + r2.length)
4117
4122
  return false;
4118
- const e2 = s2.slice(0, t2.length), n3 = 0 === r2.length ? [] : s2.slice(-r2.length), i2 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
4119
- return t2.every((t3, n4) => o(t3, e2[n4], c2)) && r2.every((t3, e3) => o(t3, n3[e3], c2)) && (0 === a2.length || o(a2[0], i2, c2));
4123
+ const e2 = s2.slice(0, t2.length), n4 = 0 === r2.length ? [] : s2.slice(-r2.length), i3 = s2.slice(t2.length, 0 === r2.length ? Infinity : -r2.length);
4124
+ return t2.every((t3, n5) => o$7(t3, e2[n5], c2)) && r2.every((t3, e3) => o$7(t3, n4[e3], c2)) && (0 === a2.length || o$7(a2[0], i3, c2));
4120
4125
  }
4121
- return n2.length === s2.length && n2.every((t3, e2) => o(t3, s2[e2], c2));
4126
+ return n3.length === s2.length && n3.every((t3, e2) => o$7(t3, s2[e2], c2));
4122
4127
  }
4123
- return Reflect.ownKeys(n2).every((e2) => {
4124
- const r2 = n2[e2];
4125
- return (e2 in s2 || i(a2 = r2) && "optional" === a2[t]().matcherType) && o(r2, s2[e2], c2);
4128
+ return Reflect.ownKeys(n3).every((e2) => {
4129
+ const r2 = n3[e2];
4130
+ return (e2 in s2 || i$5(a2 = r2) && "optional" === a2[t$3]().matcherType) && o$7(r2, s2[e2], c2);
4126
4131
  var a2;
4127
4132
  });
4128
4133
  }
4129
- return Object.is(s2, n2);
4130
- }, s = (e2) => {
4131
- var n2, o2, a2;
4132
- return r(e2) ? i(e2) ? null != (n2 = null == (o2 = (a2 = e2[t]()).getSelectionKeys) ? void 0 : o2.call(a2)) ? n2 : [] : Array.isArray(e2) ? c(e2, s) : c(Object.values(e2), s) : [];
4133
- }, c = (t2, e2) => t2.reduce((t3, n2) => t3.concat(e2(n2)), []);
4134
- function a(...t2) {
4134
+ return Object.is(s2, n3);
4135
+ }, s$4 = (e2) => {
4136
+ var n3, o2, a2;
4137
+ return r$6(e2) ? i$5(e2) ? null != (n3 = null == (o2 = (a2 = e2[t$3]()).getSelectionKeys) ? void 0 : o2.call(a2)) ? n3 : [] : Array.isArray(e2) ? c$4(e2, s$4) : c$4(Object.values(e2), s$4) : [];
4138
+ }, c$4 = (t2, e2) => t2.reduce((t3, n3) => t3.concat(e2(n3)), []);
4139
+ function a$2(...t2) {
4135
4140
  if (1 === t2.length) {
4136
4141
  const [e2] = t2;
4137
- return (t3) => o(e2, t3, () => {
4142
+ return (t3) => o$7(e2, t3, () => {
4138
4143
  });
4139
4144
  }
4140
4145
  if (2 === t2.length) {
4141
- const [e2, n2] = t2;
4142
- return o(e2, n2, () => {
4146
+ const [e2, n3] = t2;
4147
+ return o$7(e2, n3, () => {
4143
4148
  });
4144
4149
  }
4145
4150
  throw new Error(`isMatching wasn't given the right number of arguments: expected 1 or 2, received ${t2.length}.`);
4146
4151
  }
4147
- function u(t2) {
4148
- return Object.assign(t2, { optional: () => h(t2), and: (e2) => m(t2, e2), or: (e2) => d(t2, e2), select: (e2) => void 0 === e2 ? y(t2) : y(e2, t2) });
4152
+ function u$2(t2) {
4153
+ return Object.assign(t2, { optional: () => h$4(t2), and: (e2) => m$1(t2, e2), or: (e2) => d$2(t2, e2), select: (e2) => void 0 === e2 ? y$2(t2) : y$2(e2, t2) });
4149
4154
  }
4150
- function l(t2) {
4155
+ function l$2(t2) {
4151
4156
  return Object.assign(((t3) => Object.assign(t3, { [Symbol.iterator]() {
4152
- let n2 = 0;
4153
- const r2 = [{ value: Object.assign(t3, { [e]: true }), done: false }, { done: true, value: void 0 }];
4157
+ let n3 = 0;
4158
+ const r2 = [{ value: Object.assign(t3, { [e$5]: true }), done: false }, { done: true, value: void 0 }];
4154
4159
  return { next: () => {
4155
4160
  var t4;
4156
- return null != (t4 = r2[n2++]) ? t4 : r2.at(-1);
4161
+ return null != (t4 = r2[n3++]) ? t4 : r2.at(-1);
4157
4162
  } };
4158
- } }))(t2), { optional: () => l(h(t2)), select: (e2) => l(void 0 === e2 ? y(t2) : y(e2, t2)) });
4163
+ } }))(t2), { optional: () => l$2(h$4(t2)), select: (e2) => l$2(void 0 === e2 ? y$2(t2) : y$2(e2, t2)) });
4159
4164
  }
4160
- function h(e2) {
4161
- return u({ [t]: () => ({ match: (t2) => {
4162
- let n2 = {};
4165
+ function h$4(e2) {
4166
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4167
+ let n3 = {};
4163
4168
  const r2 = (t3, e3) => {
4164
- n2[t3] = e3;
4169
+ n3[t3] = e3;
4165
4170
  };
4166
- return void 0 === t2 ? (s(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n2 }) : { matched: o(e2, t2, r2), selections: n2 };
4167
- }, getSelectionKeys: () => s(e2), matcherType: "optional" }) });
4171
+ return void 0 === t2 ? (s$4(e2).forEach((t3) => r2(t3, void 0)), { matched: true, selections: n3 }) : { matched: o$7(e2, t2, r2), selections: n3 };
4172
+ }, getSelectionKeys: () => s$4(e2), matcherType: "optional" }) });
4168
4173
  }
4169
- const f = (t2, e2) => {
4170
- for (const n2 of t2)
4171
- if (!e2(n2))
4174
+ const f$4 = (t2, e2) => {
4175
+ for (const n3 of t2)
4176
+ if (!e2(n3))
4172
4177
  return false;
4173
4178
  return true;
4174
- }, g = (t2, e2) => {
4175
- for (const [n2, r2] of t2.entries())
4176
- if (!e2(r2, n2))
4179
+ }, g$1 = (t2, e2) => {
4180
+ for (const [n3, r2] of t2.entries())
4181
+ if (!e2(r2, n3))
4177
4182
  return false;
4178
4183
  return true;
4179
4184
  };
4180
- function m(...e2) {
4181
- return u({ [t]: () => ({ match: (t2) => {
4182
- let n2 = {};
4185
+ function m$1(...e2) {
4186
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4187
+ let n3 = {};
4183
4188
  const r2 = (t3, e3) => {
4184
- n2[t3] = e3;
4189
+ n3[t3] = e3;
4185
4190
  };
4186
- return { matched: e2.every((e3) => o(e3, t2, r2)), selections: n2 };
4187
- }, getSelectionKeys: () => c(e2, s), matcherType: "and" }) });
4191
+ return { matched: e2.every((e3) => o$7(e3, t2, r2)), selections: n3 };
4192
+ }, getSelectionKeys: () => c$4(e2, s$4), matcherType: "and" }) });
4188
4193
  }
4189
- function d(...e2) {
4190
- return u({ [t]: () => ({ match: (t2) => {
4191
- let n2 = {};
4194
+ function d$2(...e2) {
4195
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4196
+ let n3 = {};
4192
4197
  const r2 = (t3, e3) => {
4193
- n2[t3] = e3;
4198
+ n3[t3] = e3;
4194
4199
  };
4195
- return c(e2, s).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o(e3, t2, r2)), selections: n2 };
4196
- }, getSelectionKeys: () => c(e2, s), matcherType: "or" }) });
4200
+ return c$4(e2, s$4).forEach((t3) => r2(t3, void 0)), { matched: e2.some((e3) => o$7(e3, t2, r2)), selections: n3 };
4201
+ }, getSelectionKeys: () => c$4(e2, s$4), matcherType: "or" }) });
4197
4202
  }
4198
- function p(e2) {
4199
- return { [t]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
4203
+ function p$2(e2) {
4204
+ return { [t$3]: () => ({ match: (t2) => ({ matched: Boolean(e2(t2)) }) }) };
4200
4205
  }
4201
- function y(...e2) {
4202
- const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i2 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
4203
- return u({ [t]: () => ({ match: (t2) => {
4204
- let e3 = { [null != r2 ? r2 : n]: t2 };
4205
- return { matched: void 0 === i2 || o(i2, t2, (t3, n2) => {
4206
- e3[t3] = n2;
4206
+ function y$2(...e2) {
4207
+ const r2 = "string" == typeof e2[0] ? e2[0] : void 0, i3 = 2 === e2.length ? e2[1] : "string" == typeof e2[0] ? void 0 : e2[0];
4208
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4209
+ let e3 = { [null != r2 ? r2 : n$6]: t2 };
4210
+ return { matched: void 0 === i3 || o$7(i3, t2, (t3, n3) => {
4211
+ e3[t3] = n3;
4207
4212
  }), selections: e3 };
4208
- }, getSelectionKeys: () => [null != r2 ? r2 : n].concat(void 0 === i2 ? [] : s(i2)) }) });
4213
+ }, getSelectionKeys: () => [null != r2 ? r2 : n$6].concat(void 0 === i3 ? [] : s$4(i3)) }) });
4209
4214
  }
4210
- function v(t2) {
4215
+ function v$1(t2) {
4211
4216
  return "number" == typeof t2;
4212
4217
  }
4213
- function b(t2) {
4218
+ function b$2(t2) {
4214
4219
  return "string" == typeof t2;
4215
4220
  }
4216
4221
  function w(t2) {
4217
4222
  return "bigint" == typeof t2;
4218
4223
  }
4219
- const S = u(p(function(t2) {
4224
+ const S$2 = u$2(p$2(function(t2) {
4220
4225
  return true;
4221
- })), O = S, j = (t2) => Object.assign(u(t2), { startsWith: (e2) => {
4222
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.startsWith(n2)))));
4223
- var n2;
4226
+ })), O = S$2, j$1 = (t2) => Object.assign(u$2(t2), { startsWith: (e2) => {
4227
+ return j$1(m$1(t2, (n3 = e2, p$2((t3) => b$2(t3) && t3.startsWith(n3)))));
4228
+ var n3;
4224
4229
  }, endsWith: (e2) => {
4225
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.endsWith(n2)))));
4226
- var n2;
4227
- }, minLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length >= t3))(e2))), length: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length === t3))(e2))), maxLength: (e2) => j(m(t2, ((t3) => p((e3) => b(e3) && e3.length <= t3))(e2))), includes: (e2) => {
4228
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && t3.includes(n2)))));
4229
- var n2;
4230
+ return j$1(m$1(t2, (n3 = e2, p$2((t3) => b$2(t3) && t3.endsWith(n3)))));
4231
+ var n3;
4232
+ }, minLength: (e2) => j$1(m$1(t2, ((t3) => p$2((e3) => b$2(e3) && e3.length >= t3))(e2))), length: (e2) => j$1(m$1(t2, ((t3) => p$2((e3) => b$2(e3) && e3.length === t3))(e2))), maxLength: (e2) => j$1(m$1(t2, ((t3) => p$2((e3) => b$2(e3) && e3.length <= t3))(e2))), includes: (e2) => {
4233
+ return j$1(m$1(t2, (n3 = e2, p$2((t3) => b$2(t3) && t3.includes(n3)))));
4234
+ var n3;
4230
4235
  }, regex: (e2) => {
4231
- return j(m(t2, (n2 = e2, p((t3) => b(t3) && Boolean(t3.match(n2))))));
4232
- var n2;
4233
- } }), K = j(p(b)), x = (t2) => Object.assign(u(t2), { between: (e2, n2) => x(m(t2, ((t3, e3) => p((n3) => v(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 < t3))(e2))), gt: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 > t3))(e2))), lte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 <= t3))(e2))), gte: (e2) => x(m(t2, ((t3) => p((e3) => v(e3) && e3 >= t3))(e2))), int: () => x(m(t2, p((t3) => v(t3) && Number.isInteger(t3)))), finite: () => x(m(t2, p((t3) => v(t3) && Number.isFinite(t3)))), positive: () => x(m(t2, p((t3) => v(t3) && t3 > 0))), negative: () => x(m(t2, p((t3) => v(t3) && t3 < 0))) }), E = x(p(v)), A = (t2) => Object.assign(u(t2), { between: (e2, n2) => A(m(t2, ((t3, e3) => p((n3) => w(n3) && t3 <= n3 && e3 >= n3))(e2, n2))), lt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A(m(t2, ((t3) => p((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A(m(t2, p((t3) => w(t3) && t3 > 0))), negative: () => A(m(t2, p((t3) => w(t3) && t3 < 0))) }), P = A(p(w)), T = u(p(function(t2) {
4236
+ return j$1(m$1(t2, (n3 = e2, p$2((t3) => b$2(t3) && Boolean(t3.match(n3))))));
4237
+ var n3;
4238
+ } }), K = j$1(p$2(b$2)), x$1 = (t2) => Object.assign(u$2(t2), { between: (e2, n3) => x$1(m$1(t2, ((t3, e3) => p$2((n4) => v$1(n4) && t3 <= n4 && e3 >= n4))(e2, n3))), lt: (e2) => x$1(m$1(t2, ((t3) => p$2((e3) => v$1(e3) && e3 < t3))(e2))), gt: (e2) => x$1(m$1(t2, ((t3) => p$2((e3) => v$1(e3) && e3 > t3))(e2))), lte: (e2) => x$1(m$1(t2, ((t3) => p$2((e3) => v$1(e3) && e3 <= t3))(e2))), gte: (e2) => x$1(m$1(t2, ((t3) => p$2((e3) => v$1(e3) && e3 >= t3))(e2))), int: () => x$1(m$1(t2, p$2((t3) => v$1(t3) && Number.isInteger(t3)))), finite: () => x$1(m$1(t2, p$2((t3) => v$1(t3) && Number.isFinite(t3)))), positive: () => x$1(m$1(t2, p$2((t3) => v$1(t3) && t3 > 0))), negative: () => x$1(m$1(t2, p$2((t3) => v$1(t3) && t3 < 0))) }), E$1 = x$1(p$2(v$1)), A$1 = (t2) => Object.assign(u$2(t2), { between: (e2, n3) => A$1(m$1(t2, ((t3, e3) => p$2((n4) => w(n4) && t3 <= n4 && e3 >= n4))(e2, n3))), lt: (e2) => A$1(m$1(t2, ((t3) => p$2((e3) => w(e3) && e3 < t3))(e2))), gt: (e2) => A$1(m$1(t2, ((t3) => p$2((e3) => w(e3) && e3 > t3))(e2))), lte: (e2) => A$1(m$1(t2, ((t3) => p$2((e3) => w(e3) && e3 <= t3))(e2))), gte: (e2) => A$1(m$1(t2, ((t3) => p$2((e3) => w(e3) && e3 >= t3))(e2))), positive: () => A$1(m$1(t2, p$2((t3) => w(t3) && t3 > 0))), negative: () => A$1(m$1(t2, p$2((t3) => w(t3) && t3 < 0))) }), P$1 = A$1(p$2(w)), T$1 = u$2(p$2(function(t2) {
4234
4239
  return "boolean" == typeof t2;
4235
- })), B = u(p(function(t2) {
4240
+ })), B$1 = u$2(p$2(function(t2) {
4236
4241
  return "symbol" == typeof t2;
4237
- })), _ = u(p(function(t2) {
4242
+ })), _$1 = u$2(p$2(function(t2) {
4238
4243
  return null == t2;
4239
- })), k = u(p(function(t2) {
4244
+ })), k$1 = u$2(p$2(function(t2) {
4240
4245
  return null != t2;
4241
4246
  }));
4242
- var N = { __proto__: null, matcher: t, optional: h, array: function(...e2) {
4243
- return l({ [t]: () => ({ match: (t2) => {
4247
+ var N$1 = { __proto__: null, matcher: t$3, optional: h$4, array: function(...e2) {
4248
+ return l$2({ [t$3]: () => ({ match: (t2) => {
4244
4249
  if (!Array.isArray(t2))
4245
4250
  return { matched: false };
4246
4251
  if (0 === e2.length)
4247
4252
  return { matched: true };
4248
- const n2 = e2[0];
4253
+ const n3 = e2[0];
4249
4254
  let r2 = {};
4250
4255
  if (0 === t2.length)
4251
- return s(n2).forEach((t3) => {
4256
+ return s$4(n3).forEach((t3) => {
4252
4257
  r2[t3] = [];
4253
4258
  }), { matched: true, selections: r2 };
4254
- const i2 = (t3, e3) => {
4259
+ const i3 = (t3, e3) => {
4255
4260
  r2[t3] = (r2[t3] || []).concat([e3]);
4256
4261
  };
4257
- return { matched: t2.every((t3) => o(n2, t3, i2)), selections: r2 };
4258
- }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
4262
+ return { matched: t2.every((t3) => o$7(n3, t3, i3)), selections: r2 };
4263
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s$4(e2[0]) }) });
4259
4264
  }, set: function(...e2) {
4260
- return u({ [t]: () => ({ match: (t2) => {
4265
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4261
4266
  if (!(t2 instanceof Set))
4262
4267
  return { matched: false };
4263
- let n2 = {};
4268
+ let n3 = {};
4264
4269
  if (0 === t2.size)
4265
- return { matched: true, selections: n2 };
4270
+ return { matched: true, selections: n3 };
4266
4271
  if (0 === e2.length)
4267
4272
  return { matched: true };
4268
4273
  const r2 = (t3, e3) => {
4269
- n2[t3] = (n2[t3] || []).concat([e3]);
4270
- }, i2 = e2[0];
4271
- return { matched: f(t2, (t3) => o(i2, t3, r2)), selections: n2 };
4272
- }, getSelectionKeys: () => 0 === e2.length ? [] : s(e2[0]) }) });
4274
+ n3[t3] = (n3[t3] || []).concat([e3]);
4275
+ }, i3 = e2[0];
4276
+ return { matched: f$4(t2, (t3) => o$7(i3, t3, r2)), selections: n3 };
4277
+ }, getSelectionKeys: () => 0 === e2.length ? [] : s$4(e2[0]) }) });
4273
4278
  }, map: function(...e2) {
4274
- return u({ [t]: () => ({ match: (t2) => {
4279
+ return u$2({ [t$3]: () => ({ match: (t2) => {
4275
4280
  if (!(t2 instanceof Map))
4276
4281
  return { matched: false };
4277
- let n2 = {};
4282
+ let n3 = {};
4278
4283
  if (0 === t2.size)
4279
- return { matched: true, selections: n2 };
4284
+ return { matched: true, selections: n3 };
4280
4285
  const r2 = (t3, e3) => {
4281
- n2[t3] = (n2[t3] || []).concat([e3]);
4286
+ n3[t3] = (n3[t3] || []).concat([e3]);
4282
4287
  };
4283
4288
  if (0 === e2.length)
4284
4289
  return { matched: true };
4285
- var i2;
4290
+ var i3;
4286
4291
  if (1 === e2.length)
4287
- throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i2 = e2[0]) ? void 0 : i2.toString()}`);
4292
+ throw new Error(`\`P.map\` wasn't given enough arguments. Expected (key, value), received ${null == (i3 = e2[0]) ? void 0 : i3.toString()}`);
4288
4293
  const [s2, c2] = e2;
4289
- return { matched: g(t2, (t3, e3) => {
4290
- const n3 = o(s2, e3, r2), i3 = o(c2, t3, r2);
4291
- return n3 && i3;
4292
- }), selections: n2 };
4293
- }, getSelectionKeys: () => 0 === e2.length ? [] : [...s(e2[0]), ...s(e2[1])] }) });
4294
- }, intersection: m, union: d, not: function(e2) {
4295
- return u({ [t]: () => ({ match: (t2) => ({ matched: !o(e2, t2, () => {
4294
+ return { matched: g$1(t2, (t3, e3) => {
4295
+ const n4 = o$7(s2, e3, r2), i4 = o$7(c2, t3, r2);
4296
+ return n4 && i4;
4297
+ }), selections: n3 };
4298
+ }, getSelectionKeys: () => 0 === e2.length ? [] : [...s$4(e2[0]), ...s$4(e2[1])] }) });
4299
+ }, intersection: m$1, union: d$2, not: function(e2) {
4300
+ return u$2({ [t$3]: () => ({ match: (t2) => ({ matched: !o$7(e2, t2, () => {
4296
4301
  }) }), getSelectionKeys: () => [], matcherType: "not" }) });
4297
- }, when: p, select: y, any: S, _: O, string: K, number: E, bigint: P, boolean: T, symbol: B, nullish: _, nonNullable: k, instanceOf: function(t2) {
4298
- return u(p(function(t3) {
4302
+ }, when: p$2, select: y$2, any: S$2, _: O, string: K, number: E$1, bigint: P$1, boolean: T$1, symbol: B$1, nullish: _$1, nonNullable: k$1, instanceOf: function(t2) {
4303
+ return u$2(p$2(function(t3) {
4299
4304
  return (e2) => e2 instanceof t3;
4300
4305
  }(t2)));
4301
4306
  }, shape: function(t2) {
4302
- return u(p(a(t2)));
4307
+ return u$2(p$2(a$2(t2)));
4303
4308
  } };
4304
4309
  class W extends Error {
4305
4310
  constructor(t2) {
4306
4311
  let e2;
4307
4312
  try {
4308
4313
  e2 = JSON.stringify(t2);
4309
- } catch (n2) {
4314
+ } catch (n3) {
4310
4315
  e2 = t2;
4311
4316
  }
4312
4317
  super(`Pattern matching error: no pattern matches value ${e2}`), this.input = void 0, this.input = t2;
4313
4318
  }
4314
4319
  }
4315
- const $ = { matched: false, value: void 0 };
4316
- function z(t2) {
4317
- return new I(t2, $);
4320
+ const $$1 = { matched: false, value: void 0 };
4321
+ function z$1(t2) {
4322
+ return new I$1(t2, $$1);
4318
4323
  }
4319
- class I {
4324
+ let I$1 = class I {
4320
4325
  constructor(t2, e2) {
4321
4326
  this.input = void 0, this.state = void 0, this.input = t2, this.state = e2;
4322
4327
  }
@@ -4324,24 +4329,24 @@ class I {
4324
4329
  if (this.state.matched)
4325
4330
  return this;
4326
4331
  const e2 = t2[t2.length - 1], r2 = [t2[0]];
4327
- let i2;
4328
- 3 === t2.length && "function" == typeof t2[1] ? i2 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
4332
+ let i3;
4333
+ 3 === t2.length && "function" == typeof t2[1] ? i3 = t2[1] : t2.length > 2 && r2.push(...t2.slice(1, t2.length - 1));
4329
4334
  let s2 = false, c2 = {};
4330
4335
  const a2 = (t3, e3) => {
4331
4336
  s2 = true, c2[t3] = e3;
4332
- }, u2 = !r2.some((t3) => o(t3, this.input, a2)) || i2 && !Boolean(i2(this.input)) ? $ : { matched: true, value: e2(s2 ? n in c2 ? c2[n] : c2 : this.input, this.input) };
4337
+ }, u2 = !r2.some((t3) => o$7(t3, this.input, a2)) || i3 && !Boolean(i3(this.input)) ? $$1 : { matched: true, value: e2(s2 ? n$6 in c2 ? c2[n$6] : c2 : this.input, this.input) };
4333
4338
  return new I(this.input, u2);
4334
4339
  }
4335
4340
  when(t2, e2) {
4336
4341
  if (this.state.matched)
4337
4342
  return this;
4338
- const n2 = Boolean(t2(this.input));
4339
- return new I(this.input, n2 ? { matched: true, value: e2(this.input, this.input) } : $);
4343
+ const n3 = Boolean(t2(this.input));
4344
+ return new I(this.input, n3 ? { matched: true, value: e2(this.input, this.input) } : $$1);
4340
4345
  }
4341
4346
  otherwise(t2) {
4342
4347
  return this.state.matched ? this.state.value : t2(this.input);
4343
4348
  }
4344
- exhaustive(t2 = L) {
4349
+ exhaustive(t2 = L$1) {
4345
4350
  return this.state.matched ? this.state.value : t2(this.input);
4346
4351
  }
4347
4352
  run() {
@@ -4350,15 +4355,2015 @@ class I {
4350
4355
  returnType() {
4351
4356
  return this;
4352
4357
  }
4353
- }
4354
- function L(t2) {
4358
+ };
4359
+ function L$1(t2) {
4355
4360
  throw new W(t2);
4356
4361
  }
4362
+ const t$2 = globalThis, e$4 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$3 = Symbol(), o$6 = /* @__PURE__ */ new WeakMap();
4363
+ let n$5 = class n {
4364
+ constructor(t2, e2, o2) {
4365
+ if (this._$cssResult$ = true, o2 !== s$3)
4366
+ throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
4367
+ this.cssText = t2, this.t = e2;
4368
+ }
4369
+ get styleSheet() {
4370
+ let t2 = this.o;
4371
+ const s2 = this.t;
4372
+ if (e$4 && void 0 === t2) {
4373
+ const e2 = void 0 !== s2 && 1 === s2.length;
4374
+ e2 && (t2 = o$6.get(s2)), void 0 === t2 && ((this.o = t2 = new CSSStyleSheet()).replaceSync(this.cssText), e2 && o$6.set(s2, t2));
4375
+ }
4376
+ return t2;
4377
+ }
4378
+ toString() {
4379
+ return this.cssText;
4380
+ }
4381
+ };
4382
+ const r$5 = (t2) => new n$5("string" == typeof t2 ? t2 : t2 + "", void 0, s$3), i$4 = (t2, ...e2) => {
4383
+ const o2 = 1 === t2.length ? t2[0] : e2.reduce((e3, s2, o3) => e3 + ((t3) => {
4384
+ if (true === t3._$cssResult$)
4385
+ return t3.cssText;
4386
+ if ("number" == typeof t3)
4387
+ return t3;
4388
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t3 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
4389
+ })(s2) + t2[o3 + 1], t2[0]);
4390
+ return new n$5(o2, t2, s$3);
4391
+ }, S$1 = (s2, o2) => {
4392
+ if (e$4)
4393
+ s2.adoptedStyleSheets = o2.map((t2) => t2 instanceof CSSStyleSheet ? t2 : t2.styleSheet);
4394
+ else
4395
+ for (const e2 of o2) {
4396
+ const o3 = document.createElement("style"), n3 = t$2.litNonce;
4397
+ void 0 !== n3 && o3.setAttribute("nonce", n3), o3.textContent = e2.cssText, s2.appendChild(o3);
4398
+ }
4399
+ }, c$3 = e$4 ? (t2) => t2 : (t2) => t2 instanceof CSSStyleSheet ? ((t3) => {
4400
+ let e2 = "";
4401
+ for (const s2 of t3.cssRules)
4402
+ e2 += s2.cssText;
4403
+ return r$5(e2);
4404
+ })(t2) : t2;
4405
+ const { is: i$3, defineProperty: e$3, getOwnPropertyDescriptor: h$3, getOwnPropertyNames: r$4, getOwnPropertySymbols: o$5, getPrototypeOf: n$4 } = Object, a$1 = globalThis, c$2 = a$1.trustedTypes, l$1 = c$2 ? c$2.emptyScript : "", p$1 = a$1.reactiveElementPolyfillSupport, d$1 = (t2, s2) => t2, u$1 = { toAttribute(t2, s2) {
4406
+ switch (s2) {
4407
+ case Boolean:
4408
+ t2 = t2 ? l$1 : null;
4409
+ break;
4410
+ case Object:
4411
+ case Array:
4412
+ t2 = null == t2 ? t2 : JSON.stringify(t2);
4413
+ }
4414
+ return t2;
4415
+ }, fromAttribute(t2, s2) {
4416
+ let i3 = t2;
4417
+ switch (s2) {
4418
+ case Boolean:
4419
+ i3 = null !== t2;
4420
+ break;
4421
+ case Number:
4422
+ i3 = null === t2 ? null : Number(t2);
4423
+ break;
4424
+ case Object:
4425
+ case Array:
4426
+ try {
4427
+ i3 = JSON.parse(t2);
4428
+ } catch (t3) {
4429
+ i3 = null;
4430
+ }
4431
+ }
4432
+ return i3;
4433
+ } }, f$3 = (t2, s2) => !i$3(t2, s2), b$1 = { attribute: true, type: String, converter: u$1, reflect: false, useDefault: false, hasChanged: f$3 };
4434
+ Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), a$1.litPropertyMetadata ?? (a$1.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
4435
+ let y$1 = class y extends HTMLElement {
4436
+ static addInitializer(t2) {
4437
+ this._$Ei(), (this.l ?? (this.l = [])).push(t2);
4438
+ }
4439
+ static get observedAttributes() {
4440
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
4441
+ }
4442
+ static createProperty(t2, s2 = b$1) {
4443
+ if (s2.state && (s2.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t2) && ((s2 = Object.create(s2)).wrapped = true), this.elementProperties.set(t2, s2), !s2.noAccessor) {
4444
+ const i3 = Symbol(), h2 = this.getPropertyDescriptor(t2, i3, s2);
4445
+ void 0 !== h2 && e$3(this.prototype, t2, h2);
4446
+ }
4447
+ }
4448
+ static getPropertyDescriptor(t2, s2, i3) {
4449
+ const { get: e2, set: r2 } = h$3(this.prototype, t2) ?? { get() {
4450
+ return this[s2];
4451
+ }, set(t3) {
4452
+ this[s2] = t3;
4453
+ } };
4454
+ return { get: e2, set(s3) {
4455
+ const h2 = e2?.call(this);
4456
+ r2?.call(this, s3), this.requestUpdate(t2, h2, i3);
4457
+ }, configurable: true, enumerable: true };
4458
+ }
4459
+ static getPropertyOptions(t2) {
4460
+ return this.elementProperties.get(t2) ?? b$1;
4461
+ }
4462
+ static _$Ei() {
4463
+ if (this.hasOwnProperty(d$1("elementProperties")))
4464
+ return;
4465
+ const t2 = n$4(this);
4466
+ t2.finalize(), void 0 !== t2.l && (this.l = [...t2.l]), this.elementProperties = new Map(t2.elementProperties);
4467
+ }
4468
+ static finalize() {
4469
+ if (this.hasOwnProperty(d$1("finalized")))
4470
+ return;
4471
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d$1("properties"))) {
4472
+ const t3 = this.properties, s2 = [...r$4(t3), ...o$5(t3)];
4473
+ for (const i3 of s2)
4474
+ this.createProperty(i3, t3[i3]);
4475
+ }
4476
+ const t2 = this[Symbol.metadata];
4477
+ if (null !== t2) {
4478
+ const s2 = litPropertyMetadata.get(t2);
4479
+ if (void 0 !== s2)
4480
+ for (const [t3, i3] of s2)
4481
+ this.elementProperties.set(t3, i3);
4482
+ }
4483
+ this._$Eh = /* @__PURE__ */ new Map();
4484
+ for (const [t3, s2] of this.elementProperties) {
4485
+ const i3 = this._$Eu(t3, s2);
4486
+ void 0 !== i3 && this._$Eh.set(i3, t3);
4487
+ }
4488
+ this.elementStyles = this.finalizeStyles(this.styles);
4489
+ }
4490
+ static finalizeStyles(s2) {
4491
+ const i3 = [];
4492
+ if (Array.isArray(s2)) {
4493
+ const e2 = new Set(s2.flat(1 / 0).reverse());
4494
+ for (const s3 of e2)
4495
+ i3.unshift(c$3(s3));
4496
+ } else
4497
+ void 0 !== s2 && i3.push(c$3(s2));
4498
+ return i3;
4499
+ }
4500
+ static _$Eu(t2, s2) {
4501
+ const i3 = s2.attribute;
4502
+ return false === i3 ? void 0 : "string" == typeof i3 ? i3 : "string" == typeof t2 ? t2.toLowerCase() : void 0;
4503
+ }
4504
+ constructor() {
4505
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
4506
+ }
4507
+ _$Ev() {
4508
+ this._$ES = new Promise((t2) => this.enableUpdating = t2), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t2) => t2(this));
4509
+ }
4510
+ addController(t2) {
4511
+ (this._$EO ?? (this._$EO = /* @__PURE__ */ new Set())).add(t2), void 0 !== this.renderRoot && this.isConnected && t2.hostConnected?.();
4512
+ }
4513
+ removeController(t2) {
4514
+ this._$EO?.delete(t2);
4515
+ }
4516
+ _$E_() {
4517
+ const t2 = /* @__PURE__ */ new Map(), s2 = this.constructor.elementProperties;
4518
+ for (const i3 of s2.keys())
4519
+ this.hasOwnProperty(i3) && (t2.set(i3, this[i3]), delete this[i3]);
4520
+ t2.size > 0 && (this._$Ep = t2);
4521
+ }
4522
+ createRenderRoot() {
4523
+ const t2 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
4524
+ return S$1(t2, this.constructor.elementStyles), t2;
4525
+ }
4526
+ connectedCallback() {
4527
+ this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(true), this._$EO?.forEach((t2) => t2.hostConnected?.());
4528
+ }
4529
+ enableUpdating(t2) {
4530
+ }
4531
+ disconnectedCallback() {
4532
+ this._$EO?.forEach((t2) => t2.hostDisconnected?.());
4533
+ }
4534
+ attributeChangedCallback(t2, s2, i3) {
4535
+ this._$AK(t2, i3);
4536
+ }
4537
+ _$ET(t2, s2) {
4538
+ const i3 = this.constructor.elementProperties.get(t2), e2 = this.constructor._$Eu(t2, i3);
4539
+ if (void 0 !== e2 && true === i3.reflect) {
4540
+ const h2 = (void 0 !== i3.converter?.toAttribute ? i3.converter : u$1).toAttribute(s2, i3.type);
4541
+ this._$Em = t2, null == h2 ? this.removeAttribute(e2) : this.setAttribute(e2, h2), this._$Em = null;
4542
+ }
4543
+ }
4544
+ _$AK(t2, s2) {
4545
+ const i3 = this.constructor, e2 = i3._$Eh.get(t2);
4546
+ if (void 0 !== e2 && this._$Em !== e2) {
4547
+ const t3 = i3.getPropertyOptions(e2), h2 = "function" == typeof t3.converter ? { fromAttribute: t3.converter } : void 0 !== t3.converter?.fromAttribute ? t3.converter : u$1;
4548
+ this._$Em = e2, this[e2] = h2.fromAttribute(s2, t3.type) ?? this._$Ej?.get(e2) ?? null, this._$Em = null;
4549
+ }
4550
+ }
4551
+ requestUpdate(t2, s2, i3) {
4552
+ if (void 0 !== t2) {
4553
+ const e2 = this.constructor, h2 = this[t2];
4554
+ if (i3 ?? (i3 = e2.getPropertyOptions(t2)), !((i3.hasChanged ?? f$3)(h2, s2) || i3.useDefault && i3.reflect && h2 === this._$Ej?.get(t2) && !this.hasAttribute(e2._$Eu(t2, i3))))
4555
+ return;
4556
+ this.C(t2, s2, i3);
4557
+ }
4558
+ false === this.isUpdatePending && (this._$ES = this._$EP());
4559
+ }
4560
+ C(t2, s2, { useDefault: i3, reflect: e2, wrapped: h2 }, r2) {
4561
+ i3 && !(this._$Ej ?? (this._$Ej = /* @__PURE__ */ new Map())).has(t2) && (this._$Ej.set(t2, r2 ?? s2 ?? this[t2]), true !== h2 || void 0 !== r2) || (this._$AL.has(t2) || (this.hasUpdated || i3 || (s2 = void 0), this._$AL.set(t2, s2)), true === e2 && this._$Em !== t2 && (this._$Eq ?? (this._$Eq = /* @__PURE__ */ new Set())).add(t2));
4562
+ }
4563
+ async _$EP() {
4564
+ this.isUpdatePending = true;
4565
+ try {
4566
+ await this._$ES;
4567
+ } catch (t3) {
4568
+ Promise.reject(t3);
4569
+ }
4570
+ const t2 = this.scheduleUpdate();
4571
+ return null != t2 && await t2, !this.isUpdatePending;
4572
+ }
4573
+ scheduleUpdate() {
4574
+ return this.performUpdate();
4575
+ }
4576
+ performUpdate() {
4577
+ if (!this.isUpdatePending)
4578
+ return;
4579
+ if (!this.hasUpdated) {
4580
+ if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
4581
+ for (const [t4, s3] of this._$Ep)
4582
+ this[t4] = s3;
4583
+ this._$Ep = void 0;
4584
+ }
4585
+ const t3 = this.constructor.elementProperties;
4586
+ if (t3.size > 0)
4587
+ for (const [s3, i3] of t3) {
4588
+ const { wrapped: t4 } = i3, e2 = this[s3];
4589
+ true !== t4 || this._$AL.has(s3) || void 0 === e2 || this.C(s3, void 0, i3, e2);
4590
+ }
4591
+ }
4592
+ let t2 = false;
4593
+ const s2 = this._$AL;
4594
+ try {
4595
+ t2 = this.shouldUpdate(s2), t2 ? (this.willUpdate(s2), this._$EO?.forEach((t3) => t3.hostUpdate?.()), this.update(s2)) : this._$EM();
4596
+ } catch (s3) {
4597
+ throw t2 = false, this._$EM(), s3;
4598
+ }
4599
+ t2 && this._$AE(s2);
4600
+ }
4601
+ willUpdate(t2) {
4602
+ }
4603
+ _$AE(t2) {
4604
+ this._$EO?.forEach((t3) => t3.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t2)), this.updated(t2);
4605
+ }
4606
+ _$EM() {
4607
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
4608
+ }
4609
+ get updateComplete() {
4610
+ return this.getUpdateComplete();
4611
+ }
4612
+ getUpdateComplete() {
4613
+ return this._$ES;
4614
+ }
4615
+ shouldUpdate(t2) {
4616
+ return true;
4617
+ }
4618
+ update(t2) {
4619
+ this._$Eq && (this._$Eq = this._$Eq.forEach((t3) => this._$ET(t3, this[t3]))), this._$EM();
4620
+ }
4621
+ updated(t2) {
4622
+ }
4623
+ firstUpdated(t2) {
4624
+ }
4625
+ };
4626
+ y$1.elementStyles = [], y$1.shadowRootOptions = { mode: "open" }, y$1[d$1("elementProperties")] = /* @__PURE__ */ new Map(), y$1[d$1("finalized")] = /* @__PURE__ */ new Map(), p$1?.({ ReactiveElement: y$1 }), (a$1.reactiveElementVersions ?? (a$1.reactiveElementVersions = [])).push("2.1.0");
4627
+ const t$1 = globalThis, i$2 = t$1.trustedTypes, s$2 = i$2 ? i$2.createPolicy("lit-html", { createHTML: (t2) => t2 }) : void 0, e$2 = "$lit$", h$2 = `lit$${Math.random().toFixed(9).slice(2)}$`, o$4 = "?" + h$2, n$3 = `<${o$4}>`, r$3 = document, l = () => r$3.createComment(""), c$1 = (t2) => null === t2 || "object" != typeof t2 && "function" != typeof t2, a = Array.isArray, u = (t2) => a(t2) || "function" == typeof t2?.[Symbol.iterator], d = "[ \n\f\r]", f$2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, v = /-->/g, _ = />/g, m = RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^
4628
+ \f\r"'\`<>=]|("|')|))|$)`, "g"), p = /'/g, g = /"/g, $ = /^(?:script|style|textarea|title)$/i, y2 = (t2) => (i3, ...s2) => ({ _$litType$: t2, strings: i3, values: s2 }), x = y2(1), b = y2(2), T = Symbol.for("lit-noChange"), E = Symbol.for("lit-nothing"), A = /* @__PURE__ */ new WeakMap(), C = r$3.createTreeWalker(r$3, 129);
4629
+ function P(t2, i3) {
4630
+ if (!a(t2) || !t2.hasOwnProperty("raw"))
4631
+ throw Error("invalid template strings array");
4632
+ return void 0 !== s$2 ? s$2.createHTML(i3) : i3;
4633
+ }
4634
+ const V = (t2, i3) => {
4635
+ const s2 = t2.length - 1, o2 = [];
4636
+ let r2, l2 = 2 === i3 ? "<svg>" : 3 === i3 ? "<math>" : "", c2 = f$2;
4637
+ for (let i4 = 0; i4 < s2; i4++) {
4638
+ const s3 = t2[i4];
4639
+ let a2, u2, d2 = -1, y3 = 0;
4640
+ for (; y3 < s3.length && (c2.lastIndex = y3, u2 = c2.exec(s3), null !== u2); )
4641
+ y3 = c2.lastIndex, c2 === f$2 ? "!--" === u2[1] ? c2 = v : void 0 !== u2[1] ? c2 = _ : void 0 !== u2[2] ? ($.test(u2[2]) && (r2 = RegExp("</" + u2[2], "g")), c2 = m) : void 0 !== u2[3] && (c2 = m) : c2 === m ? ">" === u2[0] ? (c2 = r2 ?? f$2, d2 = -1) : void 0 === u2[1] ? d2 = -2 : (d2 = c2.lastIndex - u2[2].length, a2 = u2[1], c2 = void 0 === u2[3] ? m : '"' === u2[3] ? g : p) : c2 === g || c2 === p ? c2 = m : c2 === v || c2 === _ ? c2 = f$2 : (c2 = m, r2 = void 0);
4642
+ const x2 = c2 === m && t2[i4 + 1].startsWith("/>") ? " " : "";
4643
+ l2 += c2 === f$2 ? s3 + n$3 : d2 >= 0 ? (o2.push(a2), s3.slice(0, d2) + e$2 + s3.slice(d2) + h$2 + x2) : s3 + h$2 + (-2 === d2 ? i4 : x2);
4644
+ }
4645
+ return [P(t2, l2 + (t2[s2] || "<?>") + (2 === i3 ? "</svg>" : 3 === i3 ? "</math>" : "")), o2];
4646
+ };
4647
+ class N {
4648
+ constructor({ strings: t2, _$litType$: s2 }, n3) {
4649
+ let r2;
4650
+ this.parts = [];
4651
+ let c2 = 0, a2 = 0;
4652
+ const u2 = t2.length - 1, d2 = this.parts, [f2, v2] = V(t2, s2);
4653
+ if (this.el = N.createElement(f2, n3), C.currentNode = this.el.content, 2 === s2 || 3 === s2) {
4654
+ const t3 = this.el.content.firstChild;
4655
+ t3.replaceWith(...t3.childNodes);
4656
+ }
4657
+ for (; null !== (r2 = C.nextNode()) && d2.length < u2; ) {
4658
+ if (1 === r2.nodeType) {
4659
+ if (r2.hasAttributes())
4660
+ for (const t3 of r2.getAttributeNames())
4661
+ if (t3.endsWith(e$2)) {
4662
+ const i3 = v2[a2++], s3 = r2.getAttribute(t3).split(h$2), e2 = /([.?@])?(.*)/.exec(i3);
4663
+ d2.push({ type: 1, index: c2, name: e2[2], strings: s3, ctor: "." === e2[1] ? H : "?" === e2[1] ? I2 : "@" === e2[1] ? L : k }), r2.removeAttribute(t3);
4664
+ } else
4665
+ t3.startsWith(h$2) && (d2.push({ type: 6, index: c2 }), r2.removeAttribute(t3));
4666
+ if ($.test(r2.tagName)) {
4667
+ const t3 = r2.textContent.split(h$2), s3 = t3.length - 1;
4668
+ if (s3 > 0) {
4669
+ r2.textContent = i$2 ? i$2.emptyScript : "";
4670
+ for (let i3 = 0; i3 < s3; i3++)
4671
+ r2.append(t3[i3], l()), C.nextNode(), d2.push({ type: 2, index: ++c2 });
4672
+ r2.append(t3[s3], l());
4673
+ }
4674
+ }
4675
+ } else if (8 === r2.nodeType)
4676
+ if (r2.data === o$4)
4677
+ d2.push({ type: 2, index: c2 });
4678
+ else {
4679
+ let t3 = -1;
4680
+ for (; -1 !== (t3 = r2.data.indexOf(h$2, t3 + 1)); )
4681
+ d2.push({ type: 7, index: c2 }), t3 += h$2.length - 1;
4682
+ }
4683
+ c2++;
4684
+ }
4685
+ }
4686
+ static createElement(t2, i3) {
4687
+ const s2 = r$3.createElement("template");
4688
+ return s2.innerHTML = t2, s2;
4689
+ }
4690
+ }
4691
+ function S(t2, i3, s2 = t2, e2) {
4692
+ if (i3 === T)
4693
+ return i3;
4694
+ let h2 = void 0 !== e2 ? s2._$Co?.[e2] : s2._$Cl;
4695
+ const o2 = c$1(i3) ? void 0 : i3._$litDirective$;
4696
+ return h2?.constructor !== o2 && (h2?._$AO?.(false), void 0 === o2 ? h2 = void 0 : (h2 = new o2(t2), h2._$AT(t2, s2, e2)), void 0 !== e2 ? (s2._$Co ?? (s2._$Co = []))[e2] = h2 : s2._$Cl = h2), void 0 !== h2 && (i3 = S(t2, h2._$AS(t2, i3.values), h2, e2)), i3;
4697
+ }
4698
+ class M {
4699
+ constructor(t2, i3) {
4700
+ this._$AV = [], this._$AN = void 0, this._$AD = t2, this._$AM = i3;
4701
+ }
4702
+ get parentNode() {
4703
+ return this._$AM.parentNode;
4704
+ }
4705
+ get _$AU() {
4706
+ return this._$AM._$AU;
4707
+ }
4708
+ u(t2) {
4709
+ const { el: { content: i3 }, parts: s2 } = this._$AD, e2 = (t2?.creationScope ?? r$3).importNode(i3, true);
4710
+ C.currentNode = e2;
4711
+ let h2 = C.nextNode(), o2 = 0, n3 = 0, l2 = s2[0];
4712
+ for (; void 0 !== l2; ) {
4713
+ if (o2 === l2.index) {
4714
+ let i4;
4715
+ 2 === l2.type ? i4 = new R(h2, h2.nextSibling, this, t2) : 1 === l2.type ? i4 = new l2.ctor(h2, l2.name, l2.strings, this, t2) : 6 === l2.type && (i4 = new z(h2, this, t2)), this._$AV.push(i4), l2 = s2[++n3];
4716
+ }
4717
+ o2 !== l2?.index && (h2 = C.nextNode(), o2++);
4718
+ }
4719
+ return C.currentNode = r$3, e2;
4720
+ }
4721
+ p(t2) {
4722
+ let i3 = 0;
4723
+ for (const s2 of this._$AV)
4724
+ void 0 !== s2 && (void 0 !== s2.strings ? (s2._$AI(t2, s2, i3), i3 += s2.strings.length - 2) : s2._$AI(t2[i3])), i3++;
4725
+ }
4726
+ }
4727
+ class R {
4728
+ get _$AU() {
4729
+ return this._$AM?._$AU ?? this._$Cv;
4730
+ }
4731
+ constructor(t2, i3, s2, e2) {
4732
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t2, this._$AB = i3, this._$AM = s2, this.options = e2, this._$Cv = e2?.isConnected ?? true;
4733
+ }
4734
+ get parentNode() {
4735
+ let t2 = this._$AA.parentNode;
4736
+ const i3 = this._$AM;
4737
+ return void 0 !== i3 && 11 === t2?.nodeType && (t2 = i3.parentNode), t2;
4738
+ }
4739
+ get startNode() {
4740
+ return this._$AA;
4741
+ }
4742
+ get endNode() {
4743
+ return this._$AB;
4744
+ }
4745
+ _$AI(t2, i3 = this) {
4746
+ t2 = S(this, t2, i3), c$1(t2) ? t2 === E || null == t2 || "" === t2 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t2 !== this._$AH && t2 !== T && this._(t2) : void 0 !== t2._$litType$ ? this.$(t2) : void 0 !== t2.nodeType ? this.T(t2) : u(t2) ? this.k(t2) : this._(t2);
4747
+ }
4748
+ O(t2) {
4749
+ return this._$AA.parentNode.insertBefore(t2, this._$AB);
4750
+ }
4751
+ T(t2) {
4752
+ this._$AH !== t2 && (this._$AR(), this._$AH = this.O(t2));
4753
+ }
4754
+ _(t2) {
4755
+ this._$AH !== E && c$1(this._$AH) ? this._$AA.nextSibling.data = t2 : this.T(r$3.createTextNode(t2)), this._$AH = t2;
4756
+ }
4757
+ $(t2) {
4758
+ const { values: i3, _$litType$: s2 } = t2, e2 = "number" == typeof s2 ? this._$AC(t2) : (void 0 === s2.el && (s2.el = N.createElement(P(s2.h, s2.h[0]), this.options)), s2);
4759
+ if (this._$AH?._$AD === e2)
4760
+ this._$AH.p(i3);
4761
+ else {
4762
+ const t3 = new M(e2, this), s3 = t3.u(this.options);
4763
+ t3.p(i3), this.T(s3), this._$AH = t3;
4764
+ }
4765
+ }
4766
+ _$AC(t2) {
4767
+ let i3 = A.get(t2.strings);
4768
+ return void 0 === i3 && A.set(t2.strings, i3 = new N(t2)), i3;
4769
+ }
4770
+ k(t2) {
4771
+ a(this._$AH) || (this._$AH = [], this._$AR());
4772
+ const i3 = this._$AH;
4773
+ let s2, e2 = 0;
4774
+ for (const h2 of t2)
4775
+ e2 === i3.length ? i3.push(s2 = new R(this.O(l()), this.O(l()), this, this.options)) : s2 = i3[e2], s2._$AI(h2), e2++;
4776
+ e2 < i3.length && (this._$AR(s2 && s2._$AB.nextSibling, e2), i3.length = e2);
4777
+ }
4778
+ _$AR(t2 = this._$AA.nextSibling, i3) {
4779
+ for (this._$AP?.(false, true, i3); t2 && t2 !== this._$AB; ) {
4780
+ const i4 = t2.nextSibling;
4781
+ t2.remove(), t2 = i4;
4782
+ }
4783
+ }
4784
+ setConnected(t2) {
4785
+ void 0 === this._$AM && (this._$Cv = t2, this._$AP?.(t2));
4786
+ }
4787
+ }
4788
+ class k {
4789
+ get tagName() {
4790
+ return this.element.tagName;
4791
+ }
4792
+ get _$AU() {
4793
+ return this._$AM._$AU;
4794
+ }
4795
+ constructor(t2, i3, s2, e2, h2) {
4796
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t2, this.name = i3, this._$AM = e2, this.options = h2, s2.length > 2 || "" !== s2[0] || "" !== s2[1] ? (this._$AH = Array(s2.length - 1).fill(new String()), this.strings = s2) : this._$AH = E;
4797
+ }
4798
+ _$AI(t2, i3 = this, s2, e2) {
4799
+ const h2 = this.strings;
4800
+ let o2 = false;
4801
+ if (void 0 === h2)
4802
+ t2 = S(this, t2, i3, 0), o2 = !c$1(t2) || t2 !== this._$AH && t2 !== T, o2 && (this._$AH = t2);
4803
+ else {
4804
+ const e3 = t2;
4805
+ let n3, r2;
4806
+ for (t2 = h2[0], n3 = 0; n3 < h2.length - 1; n3++)
4807
+ r2 = S(this, e3[s2 + n3], i3, n3), r2 === T && (r2 = this._$AH[n3]), o2 || (o2 = !c$1(r2) || r2 !== this._$AH[n3]), r2 === E ? t2 = E : t2 !== E && (t2 += (r2 ?? "") + h2[n3 + 1]), this._$AH[n3] = r2;
4808
+ }
4809
+ o2 && !e2 && this.j(t2);
4810
+ }
4811
+ j(t2) {
4812
+ t2 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t2 ?? "");
4813
+ }
4814
+ }
4815
+ class H extends k {
4816
+ constructor() {
4817
+ super(...arguments), this.type = 3;
4818
+ }
4819
+ j(t2) {
4820
+ this.element[this.name] = t2 === E ? void 0 : t2;
4821
+ }
4822
+ }
4823
+ class I2 extends k {
4824
+ constructor() {
4825
+ super(...arguments), this.type = 4;
4826
+ }
4827
+ j(t2) {
4828
+ this.element.toggleAttribute(this.name, !!t2 && t2 !== E);
4829
+ }
4830
+ }
4831
+ class L extends k {
4832
+ constructor(t2, i3, s2, e2, h2) {
4833
+ super(t2, i3, s2, e2, h2), this.type = 5;
4834
+ }
4835
+ _$AI(t2, i3 = this) {
4836
+ if ((t2 = S(this, t2, i3, 0) ?? E) === T)
4837
+ return;
4838
+ const s2 = this._$AH, e2 = t2 === E && s2 !== E || t2.capture !== s2.capture || t2.once !== s2.once || t2.passive !== s2.passive, h2 = t2 !== E && (s2 === E || e2);
4839
+ e2 && this.element.removeEventListener(this.name, this, s2), h2 && this.element.addEventListener(this.name, this, t2), this._$AH = t2;
4840
+ }
4841
+ handleEvent(t2) {
4842
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t2) : this._$AH.handleEvent(t2);
4843
+ }
4844
+ }
4845
+ class z {
4846
+ constructor(t2, i3, s2) {
4847
+ this.element = t2, this.type = 6, this._$AN = void 0, this._$AM = i3, this.options = s2;
4848
+ }
4849
+ get _$AU() {
4850
+ return this._$AM._$AU;
4851
+ }
4852
+ _$AI(t2) {
4853
+ S(this, t2);
4854
+ }
4855
+ }
4856
+ const j = t$1.litHtmlPolyfillSupport;
4857
+ j?.(N, R), (t$1.litHtmlVersions ?? (t$1.litHtmlVersions = [])).push("3.3.0");
4858
+ const B = (t2, i3, s2) => {
4859
+ const e2 = s2?.renderBefore ?? i3;
4860
+ let h2 = e2._$litPart$;
4861
+ if (void 0 === h2) {
4862
+ const t3 = s2?.renderBefore ?? null;
4863
+ e2._$litPart$ = h2 = new R(i3.insertBefore(l(), t3), t3, void 0, s2 ?? {});
4864
+ }
4865
+ return h2._$AI(t2), h2;
4866
+ };
4867
+ const s$1 = globalThis;
4868
+ let i$1 = class i extends y$1 {
4869
+ constructor() {
4870
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
4871
+ }
4872
+ createRenderRoot() {
4873
+ var _a;
4874
+ const t2 = super.createRenderRoot();
4875
+ return (_a = this.renderOptions).renderBefore ?? (_a.renderBefore = t2.firstChild), t2;
4876
+ }
4877
+ update(t2) {
4878
+ const r2 = this.render();
4879
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t2), this._$Do = B(r2, this.renderRoot, this.renderOptions);
4880
+ }
4881
+ connectedCallback() {
4882
+ super.connectedCallback(), this._$Do?.setConnected(true);
4883
+ }
4884
+ disconnectedCallback() {
4885
+ super.disconnectedCallback(), this._$Do?.setConnected(false);
4886
+ }
4887
+ render() {
4888
+ return T;
4889
+ }
4890
+ };
4891
+ i$1._$litElement$ = true, i$1["finalized"] = true, s$1.litElementHydrateSupport?.({ LitElement: i$1 });
4892
+ const o$3 = s$1.litElementPolyfillSupport;
4893
+ o$3?.({ LitElement: i$1 });
4894
+ (s$1.litElementVersions ?? (s$1.litElementVersions = [])).push("4.2.0");
4895
+ const o$2 = { attribute: true, type: String, converter: u$1, reflect: false, hasChanged: f$3 }, r$2 = (t2 = o$2, e2, r2) => {
4896
+ const { kind: n3, metadata: i3 } = r2;
4897
+ let s2 = globalThis.litPropertyMetadata.get(i3);
4898
+ if (void 0 === s2 && globalThis.litPropertyMetadata.set(i3, s2 = /* @__PURE__ */ new Map()), "setter" === n3 && ((t2 = Object.create(t2)).wrapped = true), s2.set(r2.name, t2), "accessor" === n3) {
4899
+ const { name: o2 } = r2;
4900
+ return { set(r3) {
4901
+ const n4 = e2.get.call(this);
4902
+ e2.set.call(this, r3), this.requestUpdate(o2, n4, t2);
4903
+ }, init(e3) {
4904
+ return void 0 !== e3 && this.C(o2, void 0, t2, e3), e3;
4905
+ } };
4906
+ }
4907
+ if ("setter" === n3) {
4908
+ const { name: o2 } = r2;
4909
+ return function(r3) {
4910
+ const n4 = this[o2];
4911
+ e2.call(this, r3), this.requestUpdate(o2, n4, t2);
4912
+ };
4913
+ }
4914
+ throw Error("Unsupported decorator location: " + n3);
4915
+ };
4916
+ function n$2(t2) {
4917
+ return (e2, o2) => "object" == typeof o2 ? r$2(t2, e2, o2) : ((t3, e3, o3) => {
4918
+ const r2 = e3.hasOwnProperty(o3);
4919
+ return e3.constructor.createProperty(o3, t3), r2 ? Object.getOwnPropertyDescriptor(e3, o3) : void 0;
4920
+ })(t2, e2, o2);
4921
+ }
4922
+ function r$1(r2) {
4923
+ return n$2({ ...r2, state: true, attribute: false });
4924
+ }
4925
+ var __defProp$6 = Object.defineProperty;
4926
+ var __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor;
4927
+ var __decorateClass$6 = (decorators, target, key, kind) => {
4928
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target;
4929
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
4930
+ if (decorator = decorators[i3])
4931
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
4932
+ if (kind && result)
4933
+ __defProp$6(target, key, result);
4934
+ return result;
4935
+ };
4936
+ class NavIcon extends i$1 {
4937
+ constructor() {
4938
+ super(...arguments);
4939
+ this.id = "";
4940
+ this.isActive = false;
4941
+ this.isSpecial = false;
4942
+ }
4943
+ handleClick(e2) {
4944
+ e2.preventDefault();
4945
+ e2.stopPropagation();
4946
+ const event = new CustomEvent("click", {
4947
+ detail: {
4948
+ id: this.id,
4949
+ isActive: !this.isActive
4950
+ },
4951
+ bubbles: true,
4952
+ composed: true
4953
+ });
4954
+ this.dispatchEvent(event);
4955
+ if (this.onClick) {
4956
+ this.onClick(this.id, !this.isActive);
4957
+ }
4958
+ }
4959
+ render() {
4960
+ return x`
4961
+ <button
4962
+ id="obi-nav-${this.id}"
4963
+ class=${this.isSpecial ? "special" : ""}
4964
+ ?active=${this.isActive}
4965
+ @click=${this.handleClick}
4966
+ aria-label="${this.id} control"
4967
+ >
4968
+ <slot></slot>
4969
+ </button>
4970
+ `;
4971
+ }
4972
+ }
4973
+ NavIcon.styles = i$4`
4974
+ :host {
4975
+ display: block;
4976
+ }
4977
+
4978
+ button {
4979
+ display: flex;
4980
+ height: 40px;
4981
+ width: 40px;
4982
+ align-items: center;
4983
+ justify-content: center;
4984
+ border-radius: 2px;
4985
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
4986
+ transition: all 0.2s;
4987
+ cursor: pointer;
4988
+ margin: 4px 0;
4989
+ padding: 0;
4990
+ border: none;
4991
+ color: black;
4992
+ }
4993
+
4994
+ button.special {
4995
+ color: #fff;
4996
+ background-color: #000;
4997
+ }
4998
+
4999
+ button.special svg {
5000
+ stroke: #fff;
5001
+ }
5002
+
5003
+ button.special.active {
5004
+ background-color: black;
5005
+ color: white;
5006
+ }
5007
+
5008
+ button.special.active:hover {
5009
+ background-color: #27272a;
5010
+ }
5011
+
5012
+ button:not(.special) {
5013
+ background-color: white;
5014
+ color: black;
5015
+ }
5016
+
5017
+ button:not(.special):hover {
5018
+ background-color: #e5e5e5;
5019
+ }
5020
+
5021
+ ::slotted(*) {
5022
+ width: 18px;
5023
+ height: 18px;
5024
+ }
5025
+ `;
5026
+ __decorateClass$6([
5027
+ n$2({ type: String })
5028
+ ], NavIcon.prototype, "id", 2);
5029
+ __decorateClass$6([
5030
+ n$2({ type: Boolean })
5031
+ ], NavIcon.prototype, "isActive", 2);
5032
+ __decorateClass$6([
5033
+ n$2({ type: Boolean })
5034
+ ], NavIcon.prototype, "isSpecial", 2);
5035
+ __decorateClass$6([
5036
+ n$2({ type: Function })
5037
+ ], NavIcon.prototype, "onClick", 2);
5038
+ if (!customElements.get("obi-nav-icon")) {
5039
+ customElements.define("obi-nav-icon", NavIcon);
5040
+ }
5041
+ const navIcon = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5042
+ __proto__: null,
5043
+ NavIcon
5044
+ }, Symbol.toStringTag, { value: "Module" }));
5045
+ const svgWrapper = (content) => x`
5046
+ <svg
5047
+ xmlns="http://www.w3.org/2000/svg"
5048
+ width="24"
5049
+ height="24"
5050
+ viewBox="0 0 24 24"
5051
+ fill="none"
5052
+ stroke="currentColor"
5053
+ stroke-width="2"
5054
+ stroke-linecap="round"
5055
+ stroke-linejoin="round"
5056
+ class="lucide"
5057
+ style="display: block;"
5058
+ >
5059
+ ${content}
5060
+ </svg>
5061
+ `;
5062
+ const pauseIcon = svgWrapper(b`
5063
+ <rect x="14" y="4" width="4" height="16" rx="1"/><rect x="6" y="4" width="4" height="16" rx="1"/>
5064
+ `);
5065
+ const playIcon = svgWrapper(b`<polygon points="6 3 20 12 6 21 6 3"/>`);
5066
+ const powerIcon = svgWrapper(b`
5067
+ <path d="M12 2v10"/><path d="M18.4 6.6a9 9 0 1 1-12.77.04"/>
5068
+ `);
5069
+ const closeIcon = svgWrapper(b`
5070
+ <path d="M18 6 6 18"/><path d="m6 6 12 12"/>
5071
+ `);
5072
+ const bookOpenIcon = svgWrapper(b`
5073
+ <path d="M12 7v14" />
5074
+ <path
5075
+ d="M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z"
5076
+ />
5077
+ `);
5078
+ const obiIcon = x`
5079
+ <img
5080
+ class="widget-icon"
5081
+ src="data:image/svg+xml;base64,${btoa(`<?xml version="1.0" encoding="UTF-8"?>
5082
+ <svg width="32" height="32" viewBox="0 0 32 34" fill="none" xmlns="http://www.w3.org/2000/svg">
5083
+ <g id="obi-icon">
5084
+ <g id="Subtract">
5085
+ <path d="M15.5845 9.29177L8.20527 5.00637L8.20527 13.4502L15.5845 17.7356L15.5845 9.29177Z" fill="white" />
5086
+ <path d="M15.5896 27.7146L8.21035 31.9994L8.21032 23.4698L15.5896 19.1843L15.5896 27.7146Z" fill="white" />
5087
+ <path d="M16.4104 27.7146L16.4104 19.1786L23.7897 23.4641L23.7897 32L16.4104 27.7146Z" fill="white" />
5088
+ <path d="M32 27.7142L24.6207 31.9996L24.6207 23.47L32 19.1846L32 27.7142Z" fill="white" />
5089
+ <path d="M24.2048 22.748L31.5911 18.4585L24.2845 14.2154L16.8983 18.5048L24.2048 22.748Z" fill="white" />
5090
+ <path d="M23.7948 5.01235L23.7948 13.4564L16.4156 17.7418L16.4156 9.29775L23.7948 5.01235Z" fill="white" />
5091
+ <path d="M16.0052 0L23.3865 4.2866L16.0003 8.57606L8.61897 4.28946L16.0052 0Z" fill="white" />
5092
+ <path d="M7.72042 14.2182L15.1017 18.5048L7.79445 22.7477L0.413699 18.4615L7.72042 14.2182Z" fill="white" />
5093
+ <path d="M7.37926 31.9997L7.37926 23.4638L0 19.1784L3.79636e-05 27.7143L7.37926 31.9997Z" fill="white" />
5094
+ </g>
5095
+ </g>
5096
+ </svg>`)}"
5097
+ alt="Obi Icon"
5098
+ />
5099
+ `;
5100
+ var __defProp$5 = Object.defineProperty;
5101
+ var __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor;
5102
+ var __decorateClass$5 = (decorators, target, key, kind) => {
5103
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target;
5104
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
5105
+ if (decorator = decorators[i3])
5106
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5107
+ if (kind && result)
5108
+ __defProp$5(target, key, result);
5109
+ return result;
5110
+ };
5111
+ class NavigationBar extends i$1 {
5112
+ constructor() {
5113
+ super();
5114
+ this.isActive = false;
5115
+ this.isScreenActive = false;
5116
+ this.position = { top: 0, left: 0 };
5117
+ this.currentState = SDKState.READY;
5118
+ this.direction = "up";
5119
+ }
5120
+ connectedCallback() {
5121
+ super.connectedCallback();
5122
+ }
5123
+ handleIconClick(id, isActive) {
5124
+ if (this.onItemSelect) {
5125
+ this.onItemSelect(id, isActive);
5126
+ }
5127
+ }
5128
+ render() {
5129
+ return x`
5130
+ ${this.isActive ? x`
5131
+ <obi-nav-icon
5132
+ id="pause"
5133
+ ?isActive=${this.currentState === SDKState.PAUSED}
5134
+ @click=${() => this.handleIconClick("pause", this.currentState === SDKState.PAUSED ? false : true)}
5135
+ >
5136
+ ${this.currentState === SDKState.PAUSED ? playIcon : pauseIcon}
5137
+ </obi-nav-icon>
5138
+ <obi-nav-icon
5139
+ id="activate"
5140
+ ?isActive=${this.isActive}
5141
+ ?isSpecial=${true}
5142
+ @click=${() => this.handleIconClick("activate", this.isActive ? false : true)}
5143
+ >
5144
+ ${this.isActive ? closeIcon : powerIcon}
5145
+ </obi-nav-icon>
5146
+ ` : x`
5147
+ <obi-nav-icon
5148
+ id="experiences"
5149
+ @click=${() => this.handleIconClick("experiences", true)}
5150
+ >
5151
+ ${bookOpenIcon}
5152
+ </obi-nav-icon>
5153
+ `}
5154
+ `;
5155
+ }
5156
+ }
5157
+ NavigationBar.styles = i$4`
5158
+ :host {
5159
+ display: flex;
5160
+ position: absolute;
5161
+ z-index: 10000;
5162
+ width: 40px;
5163
+ transition: all 0.2s ease-in-out;
5164
+ opacity: 1;
5165
+ transform: scale(1);
5166
+ pointer-events: auto;
5167
+ background-color: #fff;
5168
+ }
5169
+
5170
+ :host([data-direction="up"]) {
5171
+ bottom: 64px;
5172
+ top: auto;
5173
+ flex-direction: column-reverse;
5174
+ }
5175
+
5176
+ :host([data-direction="down"]) {
5177
+ top: 64px;
5178
+ bottom: auto;
5179
+ flex-direction: column;
5180
+ }
5181
+ `;
5182
+ __decorateClass$5([
5183
+ n$2({ type: Boolean })
5184
+ ], NavigationBar.prototype, "isActive", 2);
5185
+ __decorateClass$5([
5186
+ n$2({ type: Boolean })
5187
+ ], NavigationBar.prototype, "isScreenActive", 2);
5188
+ __decorateClass$5([
5189
+ n$2({ type: Object })
5190
+ ], NavigationBar.prototype, "position", 2);
5191
+ __decorateClass$5([
5192
+ n$2({ type: String })
5193
+ ], NavigationBar.prototype, "currentState", 2);
5194
+ __decorateClass$5([
5195
+ n$2({ type: String })
5196
+ ], NavigationBar.prototype, "direction", 2);
5197
+ __decorateClass$5([
5198
+ n$2({ type: Function })
5199
+ ], NavigationBar.prototype, "onItemSelect", 2);
5200
+ if (!customElements.get("obi-navigation-bar")) {
5201
+ customElements.define("obi-navigation-bar", NavigationBar);
5202
+ }
5203
+ const navigationBar = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5204
+ __proto__: null,
5205
+ NavigationBar
5206
+ }, Symbol.toStringTag, { value: "Module" }));
5207
+ var __defProp$4 = Object.defineProperty;
5208
+ var __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor;
5209
+ var __decorateClass$4 = (decorators, target, key, kind) => {
5210
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target;
5211
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
5212
+ if (decorator = decorators[i3])
5213
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5214
+ if (kind && result)
5215
+ __defProp$4(target, key, result);
5216
+ return result;
5217
+ };
5218
+ class Course extends i$1 {
5219
+ constructor() {
5220
+ super(...arguments);
5221
+ this.id = "";
5222
+ this.name = "";
5223
+ this.description = "";
5224
+ this.imageSrc = "";
5225
+ }
5226
+ handleClick() {
5227
+ if (this.onSelect) {
5228
+ this.onSelect(this.id);
5229
+ }
5230
+ this.dispatchEvent(
5231
+ new CustomEvent("course-select", {
5232
+ detail: { id: this.id },
5233
+ bubbles: true,
5234
+ composed: true
5235
+ })
5236
+ );
5237
+ }
5238
+ render() {
5239
+ return x`
5240
+ <div class="course-container" @click=${this.handleClick}>
5241
+ <img src=${this.imageSrc} alt="Course Preview" class="course-image" />
5242
+ <h2 class="course-title">${this.name}</h2>
5243
+ ${this.description ? x`<p class="course-description">${this.description}</p>` : ""}
5244
+ </div>
5245
+ `;
5246
+ }
5247
+ }
5248
+ Course.styles = i$4`
5249
+ :host {
5250
+ display: block;
5251
+ }
5252
+
5253
+ .course-container {
5254
+ padding: 16px 12px;
5255
+ gap: 12px;
5256
+ border-radius: 4px;
5257
+ border: 1px solid #e5e7eb;
5258
+ cursor: pointer;
5259
+ transition: all 0.2s;
5260
+ }
5261
+
5262
+ .course-container:hover {
5263
+ background-color: #f9fafb;
5264
+ border-color: #d1d5db;
5265
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
5266
+ }
5267
+
5268
+ .course-container:active {
5269
+ transform: scale(0.98);
5270
+ }
5271
+
5272
+ .course-image {
5273
+ max-height: 160px;
5274
+ border-radius: 2px;
5275
+ border: 1px solid #e5e7eb;
5276
+ object-fit: cover;
5277
+ width: 100%;
5278
+ margin-bottom: 12px;
5279
+ }
5280
+
5281
+ .course-title {
5282
+ font-size: 14px;
5283
+ font-weight: bold;
5284
+ margin: 0;
5285
+ margin-bottom: 12px;
5286
+ }
5287
+
5288
+ .course-description {
5289
+ font-size: 14px;
5290
+ color: #71717a;
5291
+ margin: 0;
5292
+ }
5293
+ `;
5294
+ __decorateClass$4([
5295
+ n$2({ type: String })
5296
+ ], Course.prototype, "id", 2);
5297
+ __decorateClass$4([
5298
+ n$2({ type: String })
5299
+ ], Course.prototype, "name", 2);
5300
+ __decorateClass$4([
5301
+ n$2({ type: String })
5302
+ ], Course.prototype, "description", 2);
5303
+ __decorateClass$4([
5304
+ n$2({ type: String })
5305
+ ], Course.prototype, "imageSrc", 2);
5306
+ __decorateClass$4([
5307
+ n$2({ type: Function })
5308
+ ], Course.prototype, "onSelect", 2);
5309
+ class CourseList extends i$1 {
5310
+ constructor() {
5311
+ super(...arguments);
5312
+ this.courses = [];
5313
+ this.loading = false;
5314
+ this.error = "";
5315
+ }
5316
+ handleCourseSelect(e2) {
5317
+ if (this.onCourseSelect) {
5318
+ this.onCourseSelect(e2.detail.id);
5319
+ }
5320
+ }
5321
+ render() {
5322
+ if (this.loading) {
5323
+ return x`<div class="loading">Loading...</div>`;
5324
+ }
5325
+ if (this.error) {
5326
+ return x`<div class="error">${this.error}</div>`;
5327
+ }
5328
+ if (!this.courses || this.courses.length === 0) {
5329
+ return x`<div class="empty">No courses available</div>`;
5330
+ }
5331
+ const gridClass = this.courses.length === 1 ? "grid-cols-1" : this.courses.length === 2 ? "grid-cols-2" : "grid-cols-3";
5332
+ return x`
5333
+ <div class="course-grid ${gridClass}">
5334
+ ${this.courses.map(
5335
+ (course) => x`
5336
+ <obi-course
5337
+ id=${course.id}
5338
+ name=${course.name}
5339
+ description=${course.description || ""}
5340
+ imageSrc=${course.imageSrc}
5341
+ @course-select=${this.handleCourseSelect}
5342
+ ></obi-course>
5343
+ `
5344
+ )}
5345
+ </div>
5346
+ `;
5347
+ }
5348
+ }
5349
+ CourseList.styles = i$4`
5350
+ :host {
5351
+ display: block;
5352
+ }
5353
+
5354
+ .course-grid {
5355
+ display: grid;
5356
+ gap: 12px;
5357
+ margin-top: 24px;
5358
+ }
5359
+
5360
+ .course-grid.grid-cols-1 {
5361
+ grid-template-columns: 1fr;
5362
+ }
5363
+
5364
+ .course-grid.grid-cols-2 {
5365
+ grid-template-columns: 1fr 1fr;
5366
+ }
5367
+
5368
+ .course-grid.grid-cols-3 {
5369
+ grid-template-columns: 1fr 1fr 1fr;
5370
+ }
5371
+
5372
+ .loading,
5373
+ .error,
5374
+ .empty {
5375
+ display: flex;
5376
+ justify-content: center;
5377
+ align-items: center;
5378
+ margin-top: 16px;
5379
+ }
5380
+
5381
+ .error {
5382
+ color: #ef4444;
5383
+ }
5384
+ `;
5385
+ __decorateClass$4([
5386
+ n$2({ type: Array })
5387
+ ], CourseList.prototype, "courses", 2);
5388
+ __decorateClass$4([
5389
+ n$2({ type: Boolean })
5390
+ ], CourseList.prototype, "loading", 2);
5391
+ __decorateClass$4([
5392
+ n$2({ type: String })
5393
+ ], CourseList.prototype, "error", 2);
5394
+ __decorateClass$4([
5395
+ n$2({ type: Function })
5396
+ ], CourseList.prototype, "onCourseSelect", 2);
5397
+ if (!customElements.get("obi-course")) {
5398
+ customElements.define("obi-course", Course);
5399
+ }
5400
+ if (!customElements.get("obi-course-list")) {
5401
+ customElements.define("obi-course-list", CourseList);
5402
+ }
5403
+ const courses = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5404
+ __proto__: null,
5405
+ Course,
5406
+ CourseList
5407
+ }, Symbol.toStringTag, { value: "Module" }));
5408
+ var __defProp$3 = Object.defineProperty;
5409
+ var __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor;
5410
+ var __decorateClass$3 = (decorators, target, key, kind) => {
5411
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target;
5412
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
5413
+ if (decorator = decorators[i3])
5414
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5415
+ if (kind && result)
5416
+ __defProp$3(target, key, result);
5417
+ return result;
5418
+ };
5419
+ class CourseModal extends i$1 {
5420
+ constructor() {
5421
+ super(...arguments);
5422
+ this.courses = [];
5423
+ this.loading = true;
5424
+ this.error = "";
5425
+ this.apiBaseUrl = "";
5426
+ this.apiKey = "";
5427
+ }
5428
+ handleCourseSelect(e2) {
5429
+ if (this.onCourseSelect) {
5430
+ this.onCourseSelect(e2.detail.id);
5431
+ }
5432
+ }
5433
+ handleClose() {
5434
+ if (this.onClose) {
5435
+ this.onClose();
5436
+ }
5437
+ }
5438
+ async fetchCourses() {
5439
+ try {
5440
+ this.loading = true;
5441
+ const raw_response = await fetch(`${this.apiBaseUrl}/sessions?token=${this.apiKey}`);
5442
+ const response = await raw_response.json();
5443
+ const mappedCourses = response.map((session) => ({
5444
+ id: session.uuid,
5445
+ name: session.onboarding_plan.name,
5446
+ description: session.onboarding_plan.description,
5447
+ imageSrc: session.onboarding_plan.screen_url || "https://corproductionsydney-storagebucket5cb7c8ea-atg4gmftc6sk.s3.amazonaws.com/static/generic-course.png"
5448
+ }));
5449
+ const filteredCourses = mappedCourses.filter((course) => !!course.name);
5450
+ this.courses = [...filteredCourses];
5451
+ this.requestUpdate();
5452
+ } catch (err) {
5453
+ console.error("Fetch error:", err);
5454
+ this.error = "Failed to fetch courses";
5455
+ } finally {
5456
+ this.loading = false;
5457
+ this.requestUpdate();
5458
+ }
5459
+ }
5460
+ connectedCallback() {
5461
+ super.connectedCallback();
5462
+ if (window.obiWidgetConfig?.apiKey) {
5463
+ this.apiKey = window.obiWidgetConfig.apiKey;
5464
+ }
5465
+ this.apiBaseUrl = API_BASE_URL;
5466
+ if (this.apiBaseUrl && this.apiKey) {
5467
+ this.fetchCourses();
5468
+ } else {
5469
+ this.loading = false;
5470
+ this.error = "API base URL or API key is missing";
5471
+ }
5472
+ }
5473
+ render() {
5474
+ return x`
5475
+ <div class="backdrop" @click=${this.handleClose}></div>
5476
+ <div class="container">
5477
+ <button class="close-button" @click=${this.handleClose}>×</button>
5478
+ <div class="header">
5479
+ <h1>Give Obi a try!</h1>
5480
+ <p class="subtitle">Pick a tour, share your screen, and Obi will take it from there.</p>
5481
+ </div>
5482
+
5483
+ <obi-course-list
5484
+ .courses=${this.courses}
5485
+ .loading=${this.loading}
5486
+ .error=${this.error}
5487
+ @course-select=${this.handleCourseSelect}
5488
+ ></obi-course-list>
5489
+ </div>
5490
+ `;
5491
+ }
5492
+ }
5493
+ CourseModal.styles = i$4`
5494
+ :host {
5495
+ display: block;
5496
+ font-family: "Syne", sans-serif;
5497
+ }
5498
+
5499
+ .backdrop {
5500
+ position: fixed;
5501
+ top: 0;
5502
+ right: 0;
5503
+ bottom: 0;
5504
+ left: 0;
5505
+ background-color: black;
5506
+ opacity: 0.7;
5507
+ z-index: 40;
5508
+ }
5509
+
5510
+ .container {
5511
+ position: fixed;
5512
+ background-color: white;
5513
+ color: black;
5514
+ border: 1px solid #e5e7eb;
5515
+ width: 640px;
5516
+ max-height: 80vh;
5517
+ overflow-y: auto;
5518
+ padding: 48px;
5519
+ gap: 12px;
5520
+ top: 50%;
5521
+ left: 50%;
5522
+ transform: translate(-50%, -50%);
5523
+ border-radius: 4px;
5524
+ z-index: 50;
5525
+ display: flex;
5526
+ flex-direction: column;
5527
+ text-align: center;
5528
+ }
5529
+
5530
+ .container:hover {
5531
+ cursor: auto;
5532
+ }
5533
+
5534
+ .container::-webkit-scrollbar {
5535
+ width: 0.5rem;
5536
+ }
5537
+
5538
+ .container::-webkit-scrollbar-track {
5539
+ background-color: #f3f4f6;
5540
+ border-radius: 9999px;
5541
+ }
5542
+
5543
+ .container::-webkit-scrollbar-thumb {
5544
+ background-color: #d1d5db;
5545
+ border-radius: 9999px;
5546
+ }
5547
+
5548
+ .header {
5549
+ margin-bottom: 24px;
5550
+ text-align: center;
5551
+ }
5552
+
5553
+ h1 {
5554
+ font-size: 32px;
5555
+ font-weight: 700;
5556
+ margin: 0;
5557
+ margin-bottom: 8px;
5558
+ }
5559
+
5560
+ .subtitle {
5561
+ font-size: 20px;
5562
+ color: rgb(113 113 122 / 1);
5563
+ margin: 0;
5564
+ }
5565
+
5566
+ .close-button {
5567
+ position: absolute;
5568
+ top: 16px;
5569
+ right: 16px;
5570
+ background: none;
5571
+ border: none;
5572
+ cursor: pointer;
5573
+ font-size: 24px;
5574
+ color: #6b7280;
5575
+ }
5576
+ `;
5577
+ __decorateClass$3([
5578
+ n$2({ type: Array })
5579
+ ], CourseModal.prototype, "courses", 2);
5580
+ __decorateClass$3([
5581
+ n$2({ type: Boolean })
5582
+ ], CourseModal.prototype, "loading", 2);
5583
+ __decorateClass$3([
5584
+ n$2({ type: String })
5585
+ ], CourseModal.prototype, "error", 2);
5586
+ __decorateClass$3([
5587
+ n$2({ type: String })
5588
+ ], CourseModal.prototype, "apiBaseUrl", 2);
5589
+ __decorateClass$3([
5590
+ n$2({ type: String })
5591
+ ], CourseModal.prototype, "apiKey", 2);
5592
+ __decorateClass$3([
5593
+ n$2({ type: Function })
5594
+ ], CourseModal.prototype, "onCourseSelect", 2);
5595
+ __decorateClass$3([
5596
+ n$2({ type: Function })
5597
+ ], CourseModal.prototype, "onClose", 2);
5598
+ if (!customElements.get("obi-course-modal")) {
5599
+ customElements.define("obi-course-modal", CourseModal);
5600
+ }
5601
+ const courseModal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5602
+ __proto__: null,
5603
+ CourseModal
5604
+ }, Symbol.toStringTag, { value: "Module" }));
5605
+ const f$1 = (o2) => void 0 === o2.strings;
5606
+ const t = { ATTRIBUTE: 1, CHILD: 2, PROPERTY: 3, BOOLEAN_ATTRIBUTE: 4, EVENT: 5, ELEMENT: 6 }, e$1 = (t2) => (...e2) => ({ _$litDirective$: t2, values: e2 });
5607
+ class i2 {
5608
+ constructor(t2) {
5609
+ }
5610
+ get _$AU() {
5611
+ return this._$AM._$AU;
5612
+ }
5613
+ _$AT(t2, e2, i3) {
5614
+ this._$Ct = t2, this._$AM = e2, this._$Ci = i3;
5615
+ }
5616
+ _$AS(t2, e2) {
5617
+ return this.update(t2, e2);
5618
+ }
5619
+ update(t2, e2) {
5620
+ return this.render(...e2);
5621
+ }
5622
+ }
5623
+ const s = (i3, t2) => {
5624
+ const e2 = i3._$AN;
5625
+ if (void 0 === e2)
5626
+ return false;
5627
+ for (const i4 of e2)
5628
+ i4._$AO?.(t2, false), s(i4, t2);
5629
+ return true;
5630
+ }, o$1 = (i3) => {
5631
+ let t2, e2;
5632
+ do {
5633
+ if (void 0 === (t2 = i3._$AM))
5634
+ break;
5635
+ e2 = t2._$AN, e2.delete(i3), i3 = t2;
5636
+ } while (0 === e2?.size);
5637
+ }, r = (i3) => {
5638
+ for (let t2; t2 = i3._$AM; i3 = t2) {
5639
+ let e2 = t2._$AN;
5640
+ if (void 0 === e2)
5641
+ t2._$AN = e2 = /* @__PURE__ */ new Set();
5642
+ else if (e2.has(i3))
5643
+ break;
5644
+ e2.add(i3), c(t2);
5645
+ }
5646
+ };
5647
+ function h$1(i3) {
5648
+ void 0 !== this._$AN ? (o$1(this), this._$AM = i3, r(this)) : this._$AM = i3;
5649
+ }
5650
+ function n$1(i3, t2 = false, e2 = 0) {
5651
+ const r2 = this._$AH, h2 = this._$AN;
5652
+ if (void 0 !== h2 && 0 !== h2.size)
5653
+ if (t2)
5654
+ if (Array.isArray(r2))
5655
+ for (let i4 = e2; i4 < r2.length; i4++)
5656
+ s(r2[i4], false), o$1(r2[i4]);
5657
+ else
5658
+ null != r2 && (s(r2, false), o$1(r2));
5659
+ else
5660
+ s(this, i3);
5661
+ }
5662
+ const c = (i3) => {
5663
+ i3.type == t.CHILD && (i3._$AP ?? (i3._$AP = n$1), i3._$AQ ?? (i3._$AQ = h$1));
5664
+ };
5665
+ class f extends i2 {
5666
+ constructor() {
5667
+ super(...arguments), this._$AN = void 0;
5668
+ }
5669
+ _$AT(i3, t2, e2) {
5670
+ super._$AT(i3, t2, e2), r(this), this.isConnected = i3._$AU;
5671
+ }
5672
+ _$AO(i3, t2 = true) {
5673
+ i3 !== this.isConnected && (this.isConnected = i3, i3 ? this.reconnected?.() : this.disconnected?.()), t2 && (s(this, i3), o$1(this));
5674
+ }
5675
+ setValue(t2) {
5676
+ if (f$1(this._$Ct))
5677
+ this._$Ct._$AI(t2, this);
5678
+ else {
5679
+ const i3 = [...this._$Ct._$AH];
5680
+ i3[this._$Ci] = t2, this._$Ct._$AI(i3, this, 0);
5681
+ }
5682
+ }
5683
+ disconnected() {
5684
+ }
5685
+ reconnected() {
5686
+ }
5687
+ }
5688
+ const e = () => new h();
5689
+ class h {
5690
+ }
5691
+ const o = /* @__PURE__ */ new WeakMap(), n2 = e$1(class extends f {
5692
+ render(i3) {
5693
+ return E;
5694
+ }
5695
+ update(i3, [s2]) {
5696
+ const e2 = s2 !== this.G;
5697
+ return e2 && void 0 !== this.G && this.rt(void 0), (e2 || this.lt !== this.ct) && (this.G = s2, this.ht = i3.options?.host, this.rt(this.ct = i3.element)), E;
5698
+ }
5699
+ rt(t2) {
5700
+ if (this.isConnected || (t2 = void 0), "function" == typeof this.G) {
5701
+ const i3 = this.ht ?? globalThis;
5702
+ let s2 = o.get(i3);
5703
+ void 0 === s2 && (s2 = /* @__PURE__ */ new WeakMap(), o.set(i3, s2)), void 0 !== s2.get(this.G) && this.G.call(this.ht, void 0), s2.set(this.G, t2), void 0 !== t2 && this.G.call(this.ht, t2);
5704
+ } else
5705
+ this.G.value = t2;
5706
+ }
5707
+ get lt() {
5708
+ return "function" == typeof this.G ? o.get(this.ht ?? globalThis)?.get(this.G) : this.G?.value;
5709
+ }
5710
+ disconnected() {
5711
+ this.lt === this.ct && this.rt(void 0);
5712
+ }
5713
+ reconnected() {
5714
+ this.rt(this.ct);
5715
+ }
5716
+ });
5717
+ var __defProp$2 = Object.defineProperty;
5718
+ var __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor;
5719
+ var __decorateClass$2 = (decorators, target, key, kind) => {
5720
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target;
5721
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
5722
+ if (decorator = decorators[i3])
5723
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5724
+ if (kind && result)
5725
+ __defProp$2(target, key, result);
5726
+ return result;
5727
+ };
5728
+ class AudioEqualizer extends i$1 {
5729
+ constructor() {
5730
+ super(...arguments);
5731
+ this.volume = { speaker: "ASSISTANT", volume: 0, spectrum: [] };
5732
+ this.canvasRef = e();
5733
+ this.barCount = 8;
5734
+ this.animationFrame = null;
5735
+ }
5736
+ connectedCallback() {
5737
+ super.connectedCallback();
5738
+ this.startAnimation();
5739
+ }
5740
+ disconnectedCallback() {
5741
+ super.disconnectedCallback();
5742
+ this.stopAnimation();
5743
+ }
5744
+ startAnimation() {
5745
+ const animate = () => {
5746
+ this.drawEqualizer();
5747
+ this.animationFrame = requestAnimationFrame(animate);
5748
+ };
5749
+ this.animationFrame = requestAnimationFrame(animate);
5750
+ }
5751
+ stopAnimation() {
5752
+ if (this.animationFrame) {
5753
+ cancelAnimationFrame(this.animationFrame);
5754
+ this.animationFrame = null;
5755
+ }
5756
+ }
5757
+ drawEqualizer() {
5758
+ const canvas = this.canvasRef.value;
5759
+ if (!canvas)
5760
+ return;
5761
+ const ctx = canvas.getContext("2d");
5762
+ if (!ctx)
5763
+ return;
5764
+ const dpr = window.devicePixelRatio || 1;
5765
+ const displayWidth = canvas.clientWidth;
5766
+ const displayHeight = canvas.clientHeight;
5767
+ canvas.width = displayWidth * dpr;
5768
+ canvas.height = displayHeight * dpr;
5769
+ ctx.scale(dpr, dpr);
5770
+ ctx.clearRect(0, 0, displayWidth, displayHeight);
5771
+ const gap = 3;
5772
+ const barWidth = Math.max(1, (displayWidth - (this.barCount - 1) * gap) / this.barCount);
5773
+ const barMaxHeight = displayHeight / 2;
5774
+ const currentVolume = this.volume.speaker === "USER" ? this.volume.volume : this.volume.volume;
5775
+ const currentSpectrum = this.volume.speaker === "USER" ? this.volume.spectrum : this.volume.spectrum;
5776
+ if (currentVolume === 0)
5777
+ return;
5778
+ let processedSpectrum = [];
5779
+ if (currentSpectrum && currentSpectrum.length > 0) {
5780
+ const spectrumLength = currentSpectrum.length;
5781
+ const regionSize = Math.ceil(spectrumLength / 10);
5782
+ let energyByRegion = [];
5783
+ for (let i3 = 0; i3 < 10; i3++) {
5784
+ const start = i3 * regionSize;
5785
+ const end = Math.min((i3 + 1) * regionSize, spectrumLength);
5786
+ let regionEnergy = 0;
5787
+ for (let j2 = start; j2 < end; j2++) {
5788
+ regionEnergy += currentSpectrum[j2] || 0;
5789
+ }
5790
+ energyByRegion.push({ region: i3, startIdx: start, endIdx: end, energy: regionEnergy });
5791
+ }
5792
+ energyByRegion.sort((a2, b2) => b2.energy - a2.energy);
5793
+ const topRegions = energyByRegion.slice(0, 3);
5794
+ const startIdx = Math.min(...topRegions.map((r2) => r2.startIdx));
5795
+ const endIdx = Math.max(...topRegions.map((r2) => r2.endIdx));
5796
+ if (endIdx > startIdx) {
5797
+ for (let i3 = 0; i3 < this.barCount; i3++) {
5798
+ const position = startIdx + i3 / (this.barCount - 1) * (endIdx - startIdx);
5799
+ const index = Math.min(spectrumLength - 1, Math.floor(position));
5800
+ processedSpectrum[i3] = currentSpectrum[index] || 0;
5801
+ }
5802
+ } else {
5803
+ for (let i3 = 0; i3 < this.barCount; i3++) {
5804
+ const position = i3 / (this.barCount - 1) * (spectrumLength / 2);
5805
+ const index = Math.min(spectrumLength - 1, Math.floor(position));
5806
+ processedSpectrum[i3] = currentSpectrum[index] || 0;
5807
+ }
5808
+ }
5809
+ const maxSpectrumValue = Math.max(...processedSpectrum, 1);
5810
+ const amplificationFactorRoot = this.volume.speaker === "USER" ? 0.7 : 0.6;
5811
+ processedSpectrum = processedSpectrum.map((value, index) => {
5812
+ const relativeValue = value / maxSpectrumValue;
5813
+ const amplificationFactor = amplificationFactorRoot + index / (this.barCount - 1) * 0.3;
5814
+ return Math.min(1, relativeValue * amplificationFactor);
5815
+ });
5816
+ } else {
5817
+ if (this.volume.speaker !== "USER") {
5818
+ for (let i3 = 0; i3 < this.barCount; i3++) {
5819
+ const time = Date.now() * 2e-3;
5820
+ const value = 0.3 + 0.2 * Math.sin(time + i3 * 0.7);
5821
+ processedSpectrum[i3] = value;
5822
+ }
5823
+ }
5824
+ }
5825
+ for (let i3 = 0; i3 < this.barCount; i3++) {
5826
+ const spectrumValue = processedSpectrum.length > 0 ? processedSpectrum[i3] !== void 0 ? processedSpectrum[i3] : currentVolume : currentVolume;
5827
+ if (this.volume.speaker === "USER") {
5828
+ ctx.fillStyle = `rgba(109, 40, 217, ${spectrumValue * 0.5 + 0.5})`;
5829
+ } else {
5830
+ ctx.fillStyle = `rgba(255, 255, 255, ${spectrumValue * 0.5 + 0.5})`;
5831
+ }
5832
+ const barHeight = Math.max(2, spectrumValue * 0.8 * barMaxHeight);
5833
+ const x2 = displayWidth - (this.barCount - i3) * (barWidth + gap);
5834
+ const radius = barWidth / 2;
5835
+ ctx.beginPath();
5836
+ ctx.moveTo(x2 + radius, displayHeight / 2 - barHeight);
5837
+ ctx.lineTo(x2 + barWidth - radius, displayHeight / 2 - barHeight);
5838
+ ctx.quadraticCurveTo(
5839
+ x2 + barWidth,
5840
+ displayHeight / 2 - barHeight,
5841
+ x2 + barWidth,
5842
+ displayHeight / 2 - barHeight + radius
5843
+ );
5844
+ ctx.lineTo(x2 + barWidth, displayHeight / 2);
5845
+ ctx.lineTo(x2, displayHeight / 2);
5846
+ ctx.lineTo(x2, displayHeight / 2 - barHeight + radius);
5847
+ ctx.quadraticCurveTo(
5848
+ x2,
5849
+ displayHeight / 2 - barHeight,
5850
+ x2 + radius,
5851
+ displayHeight / 2 - barHeight
5852
+ );
5853
+ ctx.fill();
5854
+ ctx.beginPath();
5855
+ ctx.moveTo(x2, displayHeight / 2);
5856
+ ctx.lineTo(x2 + barWidth, displayHeight / 2);
5857
+ ctx.lineTo(x2 + barWidth, displayHeight / 2 + barHeight - radius);
5858
+ ctx.quadraticCurveTo(
5859
+ x2 + barWidth,
5860
+ displayHeight / 2 + barHeight,
5861
+ x2 + barWidth - radius,
5862
+ displayHeight / 2 + barHeight
5863
+ );
5864
+ ctx.lineTo(x2 + radius, displayHeight / 2 + barHeight);
5865
+ ctx.quadraticCurveTo(
5866
+ x2,
5867
+ displayHeight / 2 + barHeight,
5868
+ x2,
5869
+ displayHeight / 2 + barHeight - radius
5870
+ );
5871
+ ctx.lineTo(x2, displayHeight / 2);
5872
+ ctx.fill();
5873
+ }
5874
+ }
5875
+ render() {
5876
+ return x` <canvas ${n2(this.canvasRef)} width="52" height="52"></canvas> `;
5877
+ }
5878
+ }
5879
+ AudioEqualizer.styles = i$4`
5880
+ :host {
5881
+ display: block;
5882
+ width: 40px;
5883
+ height: 40px;
5884
+ margin: 4px;
5885
+ }
5886
+
5887
+ canvas {
5888
+ width: 100%;
5889
+ height: 100%;
5890
+ }
5891
+ `;
5892
+ __decorateClass$2([
5893
+ n$2({ type: Object })
5894
+ ], AudioEqualizer.prototype, "volume", 2);
5895
+ __decorateClass$2([
5896
+ r$1()
5897
+ ], AudioEqualizer.prototype, "canvasRef", 2);
5898
+ if (!customElements.get("obi-audio-equalizer")) {
5899
+ customElements.define("obi-audio-equalizer", AudioEqualizer);
5900
+ }
5901
+ const audioEqualizer = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
5902
+ __proto__: null,
5903
+ AudioEqualizer
5904
+ }, Symbol.toStringTag, { value: "Module" }));
5905
+ var __defProp$1 = Object.defineProperty;
5906
+ var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
5907
+ var __decorateClass$1 = (decorators, target, key, kind) => {
5908
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
5909
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
5910
+ if (decorator = decorators[i3])
5911
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
5912
+ if (kind && result)
5913
+ __defProp$1(target, key, result);
5914
+ return result;
5915
+ };
5916
+ class DotLoader extends i$1 {
5917
+ constructor() {
5918
+ super(...arguments);
5919
+ this.activeDots = Array(5).fill(false);
5920
+ this.numDots = 5;
5921
+ this.containerWidth = 32;
5922
+ this.dotSize = 2;
5923
+ this.bounceHeight = 12;
5924
+ this.animationDuration = 200;
5925
+ this.pauseDuration = 300;
5926
+ this.overlapFactor = 0.7;
5927
+ this.color = "#FFF";
5928
+ this.timeoutIds = [];
5929
+ }
5930
+ connectedCallback() {
5931
+ super.connectedCallback();
5932
+ this.startAnimation();
5933
+ this.style.setProperty("--dot-loader-width", `${this.containerWidth}px`);
5934
+ this.style.setProperty("--dot-size", `${this.dotSize}px`);
5935
+ this.style.setProperty("--dot-color", this.color);
5936
+ }
5937
+ disconnectedCallback() {
5938
+ super.disconnectedCallback();
5939
+ this.stopAnimation();
5940
+ }
5941
+ startAnimation() {
5942
+ this.animateSequence();
5943
+ }
5944
+ stopAnimation() {
5945
+ this.timeoutIds.forEach((id) => window.clearTimeout(id));
5946
+ this.timeoutIds = [];
5947
+ }
5948
+ animateSequence() {
5949
+ this.activeDots = Array(this.numDots).fill(false);
5950
+ for (let i3 = 0; i3 < this.numDots; i3++) {
5951
+ const delay = i3 * (this.animationDuration * this.overlapFactor);
5952
+ const bounceStartId = window.setTimeout(() => {
5953
+ this.activeDots = [...this.activeDots];
5954
+ this.activeDots[i3] = true;
5955
+ const bounceEndId = window.setTimeout(() => {
5956
+ this.activeDots = [...this.activeDots];
5957
+ this.activeDots[i3] = false;
5958
+ }, this.animationDuration);
5959
+ this.timeoutIds.push(bounceEndId);
5960
+ }, delay);
5961
+ this.timeoutIds.push(bounceStartId);
5962
+ }
5963
+ const nextSequenceId = window.setTimeout(
5964
+ () => {
5965
+ this.animateSequence();
5966
+ },
5967
+ this.numDots * this.animationDuration * this.overlapFactor + this.pauseDuration
5968
+ );
5969
+ this.timeoutIds.push(nextSequenceId);
5970
+ }
5971
+ render() {
5972
+ return x`
5973
+ <div class="dot-loader">
5974
+ ${this.activeDots.map(
5975
+ (isActive) => x`
5976
+ <div
5977
+ class="dot"
5978
+ style="transform: ${isActive ? `translateY(-${this.bounceHeight}px)` : "translateY(0)"}"
5979
+ ></div>
5980
+ `
5981
+ )}
5982
+ </div>
5983
+ `;
5984
+ }
5985
+ }
5986
+ DotLoader.styles = i$4`
5987
+ :host {
5988
+ display: block;
5989
+ }
5990
+
5991
+ .dot-loader {
5992
+ display: flex;
5993
+ flex-direction: row;
5994
+ width: var(--dot-loader-width, 32px);
5995
+ height: 14px;
5996
+ justify-content: center;
5997
+ align-items: center;
5998
+ padding: 0;
5999
+ margin: 0;
6000
+ gap: 4px;
6001
+ }
6002
+
6003
+ .dot {
6004
+ width: var(--dot-size, 2px);
6005
+ height: var(--dot-size, 2px);
6006
+ border-radius: 50%;
6007
+ background-color: var(--dot-color, #fff);
6008
+ margin: 0;
6009
+ padding: 0;
6010
+ transition: transform 0.2s ease-in-out;
6011
+ opacity: 1;
6012
+ }
6013
+ `;
6014
+ __decorateClass$1([
6015
+ r$1()
6016
+ ], DotLoader.prototype, "activeDots", 2);
6017
+ if (!customElements.get("obi-dot-loader")) {
6018
+ customElements.define("obi-dot-loader", DotLoader);
6019
+ }
6020
+ const dotLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6021
+ __proto__: null,
6022
+ DotLoader
6023
+ }, Symbol.toStringTag, { value: "Module" }));
6024
+ class SearchingLoader extends i$1 {
6025
+ render() {
6026
+ return x`
6027
+ <obi-dot-loader loading style="margin-left: 2px"></obi-dot-loader>
6028
+ <span class="text">Searching the knowledge base</span>
6029
+ `;
6030
+ }
6031
+ }
6032
+ SearchingLoader.styles = i$4`
6033
+ :host {
6034
+ display: flex;
6035
+ align-items: center;
6036
+ gap: 12px;
6037
+ background-color: #7c3aed;
6038
+ border-radius: 12px;
6039
+ padding: 8px 12px;
6040
+ }
6041
+
6042
+ .text {
6043
+ color: white;
6044
+ font-weight: 500;
6045
+ font-size: 14px;
6046
+ }
6047
+ `;
6048
+ if (!customElements.get("obi-searching-loader")) {
6049
+ customElements.define("obi-searching-loader", SearchingLoader);
6050
+ }
6051
+ const searchingLoader = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6052
+ __proto__: null,
6053
+ SearchingLoader
6054
+ }, Symbol.toStringTag, { value: "Module" }));
6055
+ var __defProp = Object.defineProperty;
6056
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6057
+ var __decorateClass = (decorators, target, key, kind) => {
6058
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
6059
+ for (var i3 = decorators.length - 1, decorator; i3 >= 0; i3--)
6060
+ if (decorator = decorators[i3])
6061
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
6062
+ if (kind && result)
6063
+ __defProp(target, key, result);
6064
+ return result;
6065
+ };
6066
+ class ObiWidget extends i$1 {
6067
+ constructor() {
6068
+ super();
6069
+ this.apiBaseUrl = API_BASE_URL;
6070
+ this.apiKey = "";
6071
+ this.position = "bottom-right";
6072
+ this.user = null;
6073
+ this.state = SDKState.READY;
6074
+ this.showCourseModal = false;
6075
+ this.isHovering = false;
6076
+ this.navVisible = false;
6077
+ this.activeSession = null;
6078
+ this.volume = {
6079
+ speaker: "ASSISTANT",
6080
+ volume: 0,
6081
+ spectrum: []
6082
+ };
6083
+ this.closeNavTimeoutRef = null;
6084
+ if (window.obiWidgetConfig) {
6085
+ if (window.obiWidgetConfig.apiKey) {
6086
+ this.apiKey = window.obiWidgetConfig.apiKey;
6087
+ }
6088
+ if (window.obiWidgetConfig.position) {
6089
+ this.position = window.obiWidgetConfig.position;
6090
+ }
6091
+ if (window.obiWidgetConfig.user) {
6092
+ this.user = window.obiWidgetConfig.user;
6093
+ }
6094
+ }
6095
+ }
6096
+ connectedCallback() {
6097
+ super.connectedCallback();
6098
+ if (!window.obiWidgetConfig) {
6099
+ window.obiWidgetConfig = {
6100
+ apiKey: this.apiKey || ""
6101
+ };
6102
+ }
6103
+ if (this.apiKey) {
6104
+ window.obiWidgetConfig.apiKey = this.apiKey;
6105
+ }
6106
+ this.setAttribute("position", this.position);
6107
+ }
6108
+ disconnectedCallback() {
6109
+ super.disconnectedCallback();
6110
+ if (this.closeNavTimeoutRef !== null) {
6111
+ window.clearTimeout(this.closeNavTimeoutRef);
6112
+ }
6113
+ if (this.activeSession) {
6114
+ this.activeSession.disconnect();
6115
+ this.activeSession = null;
6116
+ }
6117
+ }
6118
+ handleMouseEnter() {
6119
+ this.isHovering = true;
6120
+ this.navVisible = true;
6121
+ }
6122
+ handleMouseLeave() {
6123
+ this.isHovering = false;
6124
+ if (this.closeNavTimeoutRef !== null) {
6125
+ window.clearTimeout(this.closeNavTimeoutRef);
6126
+ }
6127
+ this.closeNavTimeoutRef = window.setTimeout(() => {
6128
+ if (!this.isHovering) {
6129
+ this.navVisible = false;
6130
+ }
6131
+ this.closeNavTimeoutRef = null;
6132
+ }, 300);
6133
+ }
6134
+ handleItemSelect(id, itemIsActive) {
6135
+ if (id === "experiences") {
6136
+ this.showCourseModal = true;
6137
+ return;
6138
+ }
6139
+ z$1([id, itemIsActive]).with(["pause", true], () => {
6140
+ this.activeSession?.pauseRecording();
6141
+ }).with(["pause", false], () => {
6142
+ this.activeSession?.resumeRecording();
6143
+ }).with(["activate", false], () => {
6144
+ this.activeSession?.disconnect();
6145
+ }).otherwise(() => {
6146
+ return;
6147
+ });
6148
+ }
6149
+ async handleSessionStart(sessionToken) {
6150
+ this.showCourseModal = false;
6151
+ this.state = SDKState.LOADING;
6152
+ try {
6153
+ const { ObiSession } = await import("./session-37970ed1.js").then((n3) => n3.s);
6154
+ const session = new ObiSession({ token: sessionToken, apiBaseUrl: this.apiBaseUrl });
6155
+ session.on("stateChanged", (data) => {
6156
+ this.state = data.newState;
6157
+ });
6158
+ session.on("volume", (data) => {
6159
+ this.volume = data;
6160
+ });
6161
+ session.on("error", (data) => {
6162
+ console.error("Session error:", data.error);
6163
+ this.state = SDKState.ERROR;
6164
+ this.activeSession = null;
6165
+ });
6166
+ await session.connect();
6167
+ this.activeSession = session;
6168
+ } catch (error) {
6169
+ console.error("Failed to connect to session:", error);
6170
+ this.state = SDKState.ERROR;
6171
+ }
6172
+ }
6173
+ render() {
6174
+ const stateRender = z$1(this.state).with(SDKState.LOADING, () => x`<obi-dot-loader></obi-dot-loader>`).with(SDKState.RESEARCHING, () => x`<obi-searching-loader></obi-searching-loader>`).with(
6175
+ N$1.union(SDKState.USER_SPEAKING, SDKState.AGENT_SPEAKING),
6176
+ () => x`<obi-audio-equalizer .volume=${this.volume}></obi-audio-equalizer>`
6177
+ ).with(SDKState.PAUSED, () => obiIcon).otherwise(() => obiIcon);
6178
+ return x`
6179
+ <div
6180
+ class="widget-container ${this.state === SDKState.USER_SPEAKING || this.state === SDKState.AGENT_SPEAKING ? "pulse" : ""} ${this.state !== SDKState.READY || this.navVisible ? "rounded" : ""} ${this.state === SDKState.RESEARCHING ? "researching" : ""} ${this.state === SDKState.USER_SPEAKING ? "user-speaking" : ""}"
6181
+ @mouseenter=${this.handleMouseEnter}
6182
+ @mouseleave=${this.handleMouseLeave}
6183
+ >
6184
+ ${stateRender}
6185
+ ${this.navVisible && this.state !== SDKState.RESEARCHING ? x`
6186
+ <obi-navigation-bar
6187
+ ?isActive=${this.state !== SDKState.READY}
6188
+ .position=${this.position}
6189
+ data-direction="up"
6190
+ .currentState=${this.state}
6191
+ .onItemSelect=${this.handleItemSelect.bind(this)}
6192
+ ></obi-navigation-bar>
6193
+ ` : E}
6194
+ </div>
6195
+ ${this.showCourseModal ? x`<obi-course-modal
6196
+ .onClose=${() => this.showCourseModal = false}
6197
+ .onCourseSelect=${this.handleSessionStart.bind(this)}
6198
+ .apiBaseUrl=${this.apiBaseUrl}
6199
+ .apiKey=${this.apiKey}
6200
+ ></obi-course-modal>` : E}
6201
+ `;
6202
+ }
6203
+ }
6204
+ ObiWidget.styles = i$4`
6205
+ :host {
6206
+ display: block;
6207
+ position: fixed;
6208
+ z-index: 9999;
6209
+ font-family: Arial, sans-serif;
6210
+ --obi-primary: #7c3aed;
6211
+ --obi-danger: #ef4444;
6212
+ --obi-gray: #6b7280;
6213
+ }
6214
+
6215
+ /* Position-specific styles */
6216
+ :host([position="bottom-right"]) {
6217
+ bottom: 80px;
6218
+ right: 80px;
6219
+ }
6220
+
6221
+ :host([position="bottom-left"]) {
6222
+ bottom: 80px;
6223
+ left: 20px;
6224
+ }
6225
+
6226
+ :host([position="top-right"]) {
6227
+ top: 20px;
6228
+ right: 80px;
6229
+ }
6230
+
6231
+ :host([position="top-left"]) {
6232
+ top: 20px;
6233
+ left: 20px;
6234
+ }
6235
+
6236
+ /* Adjust position when in researching state to accommodate wider container */
6237
+ :host([position="bottom-right"]) .widget-container.researching {
6238
+ right: 20px;
6239
+ }
6240
+
6241
+ :host([position="top-right"]) .widget-container.researching {
6242
+ right: 20px;
6243
+ }
6244
+
6245
+ .widget-container {
6246
+ position: fixed;
6247
+ width: 56px;
6248
+ height: 56px;
6249
+ border-radius: 28px;
6250
+ border-color: transparent;
6251
+ background-color: var(--obi-primary);
6252
+ display: flex;
6253
+ align-items: center;
6254
+ justify-content: center;
6255
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
6256
+ transition: all 0.2s ease-out;
6257
+ }
6258
+
6259
+ .widget-container.user-speaking {
6260
+ background:
6261
+ linear-gradient(0deg, #c4b5fd, #c4b5fd),
6262
+ linear-gradient(195.84deg, rgba(192, 132, 252, 0) 11.05%, #c084fc 117.01%);
6263
+ }
6264
+
6265
+ .widget-container:hover {
6266
+ border-radius: 12px;
6267
+ }
6268
+
6269
+ .widget-container.rounded {
6270
+ border-radius: 12px;
6271
+ }
6272
+
6273
+ .widget-container.researching {
6274
+ width: 265px;
6275
+ border-radius: 12px;
6276
+ }
6277
+
6278
+ .widget-icon {
6279
+ width: 32px;
6280
+ height: 32px;
6281
+ transition: transform 0.5s ease-in-out;
6282
+ }
6283
+
6284
+ .widget-container.rounded .widget-icon {
6285
+ transform: rotate(110deg);
6286
+ }
6287
+
6288
+ @keyframes pulse-shadow {
6289
+ 0% {
6290
+ box-shadow: 0 0 0 0 rgba(124, 58, 237, 0.4);
6291
+ }
6292
+ 70% {
6293
+ box-shadow: 0 0 0 10px rgba(124, 58, 237, 0);
6294
+ }
6295
+ 100% {
6296
+ box-shadow: 0 0 0 0 rgba(124, 58, 237, 0);
6297
+ }
6298
+ }
6299
+
6300
+ .pulse {
6301
+ animation: pulse-shadow 2s ease-in-out infinite;
6302
+ }
6303
+ `;
6304
+ __decorateClass([
6305
+ n$2({ type: String })
6306
+ ], ObiWidget.prototype, "apiBaseUrl", 2);
6307
+ __decorateClass([
6308
+ n$2({ type: String })
6309
+ ], ObiWidget.prototype, "apiKey", 2);
6310
+ __decorateClass([
6311
+ n$2({ type: String })
6312
+ ], ObiWidget.prototype, "position", 2);
6313
+ __decorateClass([
6314
+ n$2({ type: Object })
6315
+ ], ObiWidget.prototype, "user", 2);
6316
+ __decorateClass([
6317
+ r$1()
6318
+ ], ObiWidget.prototype, "state", 2);
6319
+ __decorateClass([
6320
+ r$1()
6321
+ ], ObiWidget.prototype, "showCourseModal", 2);
6322
+ __decorateClass([
6323
+ r$1()
6324
+ ], ObiWidget.prototype, "isHovering", 2);
6325
+ __decorateClass([
6326
+ r$1()
6327
+ ], ObiWidget.prototype, "navVisible", 2);
6328
+ __decorateClass([
6329
+ r$1()
6330
+ ], ObiWidget.prototype, "activeSession", 2);
6331
+ __decorateClass([
6332
+ r$1()
6333
+ ], ObiWidget.prototype, "volume", 2);
6334
+ if (!customElements.get("obi-widget")) {
6335
+ customElements.define("obi-widget", ObiWidget);
6336
+ }
6337
+ const obiWidget = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6338
+ __proto__: null,
6339
+ ObiWidget
6340
+ }, Symbol.toStringTag, { value: "Module" }));
4357
6341
  export {
6342
+ AudioEqualizer as A,
6343
+ Course as C,
6344
+ DotLoader as D,
4358
6345
  EventType as E,
4359
- N,
4360
- ObiSDKConfigSchema as O,
6346
+ NavIcon as N,
6347
+ ObiWidget as O,
4361
6348
  SDKState as S,
4362
- z
6349
+ i$1 as a,
6350
+ NavigationBar as b,
6351
+ SearchingLoader as c,
6352
+ CourseList as d,
6353
+ CourseModal as e,
6354
+ API_BASE_URL as f,
6355
+ ObiSDKConfigSchema as g,
6356
+ navIcon as h,
6357
+ i$4 as i,
6358
+ navigationBar as j,
6359
+ courses as k,
6360
+ courseModal as l,
6361
+ audioEqualizer as m,
6362
+ n$2 as n,
6363
+ dotLoader as o,
6364
+ obiWidget as p,
6365
+ searchingLoader as s,
6366
+ x,
6367
+ z$1 as z
4363
6368
  };
4364
- //# sourceMappingURL=index-634e0df5.js.map
6369
+ //# sourceMappingURL=obi-widget-9c0306f4.js.map