@rqmii_immersive/agent-react-sdk 1.0.4 → 1.0.5

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.
@@ -150,7 +150,7 @@ function wg() {
150
150
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
151
151
  )), Q = this.props.ref, Q !== void 0 ? Q : null;
152
152
  }
153
- function U(Q, Ae, et, gt, qt, Ct) {
153
+ function U(Q, Ae, et, gt, qt, kt) {
154
154
  var ot = et.ref;
155
155
  return Q = {
156
156
  $$typeof: ie,
@@ -180,10 +180,10 @@ function wg() {
180
180
  configurable: !1,
181
181
  enumerable: !1,
182
182
  writable: !0,
183
- value: Ct
183
+ value: kt
184
184
  }), Object.freeze && (Object.freeze(Q.props), Object.freeze(Q)), Q;
185
185
  }
186
- function B(Q, Ae, et, gt, qt, Ct) {
186
+ function B(Q, Ae, et, gt, qt, kt) {
187
187
  var ot = Ae.children;
188
188
  if (ot !== void 0)
189
189
  if (gt)
@@ -228,7 +228,7 @@ React keys must be passed directly to JSX without using spread:
228
228
  et,
229
229
  f(),
230
230
  qt,
231
- Ct
231
+ kt
232
232
  );
233
233
  }
234
234
  function te(Q) {
@@ -2842,9 +2842,15 @@ function vy({
2842
2842
  pcmOptions: v,
2843
2843
  debug: C = !1
2844
2844
  }) {
2845
- const [R, _] = jr(Tp), U = xt(null), B = xt(null), te = xt(!1), X = xt(!1), ee = xt({ ...Sp, ...a }), ie = xt(yy()), de = xt(null), le = xt(!1), Le = xt(null), Ce = xt(Tp.session.agentType);
2845
+ const [R, _] = jr(Tp), U = xt(null), B = xt(null), te = xt(!1), X = xt(!1), ee = xt({
2846
+ ...Sp,
2847
+ ...a
2848
+ }), ie = xt(yy()), de = xt(null), le = xt(!1), Le = xt(null), Ce = xt(Tp.session.agentType);
2846
2849
  xr(() => {
2847
- ee.current = { ...Sp, ...a };
2850
+ ee.current = {
2851
+ ...Sp,
2852
+ ...a
2853
+ };
2848
2854
  }, [a]), xr(() => {
2849
2855
  Ce.current = R.session.agentType;
2850
2856
  }, [R.session.agentType]);
@@ -2955,7 +2961,11 @@ function vy({
2955
2961
  }), pe.on(lt.CONNECT_ERROR, (fe) => {
2956
2962
  ce("socket connect_error", fe), Ne || (re(Vt.FAILED), ue(fe?.message || "Connection error"), ct(dt, fe));
2957
2963
  }), pe.on(lt.DISCONNECT, (fe) => {
2958
- ce("socket disconnected", fe), _((Ue) => ({ ...Ue, isConnected: !1, isSessionReady: !1 })), !X.current && (ee.current.enabled ? re(Vt.RECONNECTING) : (re(Vt.FAILED), ue("Connection lost")));
2964
+ ce("socket disconnected", fe), _((Ue) => ({
2965
+ ...Ue,
2966
+ isConnected: !1,
2967
+ isSessionReady: !1
2968
+ })), !X.current && (ee.current.enabled ? re(Vt.RECONNECTING) : (re(Vt.FAILED), ue("Connection lost")));
2959
2969
  }), pe.on(lt.SESSION_READY, (fe) => {
2960
2970
  _((Ue) => ({
2961
2971
  ...Ue,
@@ -2963,7 +2973,9 @@ function vy({
2963
2973
  error: null,
2964
2974
  session: {
2965
2975
  ...Ue.session,
2966
- agentType: io(fe?.agentType || Ue.session.agentType)
2976
+ agentType: io(
2977
+ fe?.agentType || Ue.session.agentType
2978
+ )
2967
2979
  }
2968
2980
  }));
2969
2981
  }), pe.on(lt.SESSION_JOINED, () => {
@@ -2971,30 +2983,60 @@ function vy({
2971
2983
  }), pe.on(lt.SESSION_TERMINATED, () => {
2972
2984
  re(Vt.ENDED), _((fe) => ({ ...fe, isSessionReady: !1 }));
2973
2985
  }), pe.on(lt.TRANSCRIPT, (fe) => {
2974
- _((Ue) => ({ ...Ue, transcript: fe || null }));
2986
+ _((Ue) => {
2987
+ const Et = { ...Ue, transcript: fe || null };
2988
+ if (fe?.is_final && fe?.text?.trim()) {
2989
+ const Rt = {
2990
+ id: `transcript-${Date.now()}`,
2991
+ role: "user",
2992
+ text: fe.text.trim(),
2993
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
2994
+ };
2995
+ Et.messages = [...Ue.messages, Rt];
2996
+ }
2997
+ return Et;
2998
+ });
2975
2999
  }), pe.on(lt.PARTIAL_TRANSCRIPT, (fe) => {
2976
3000
  _((Ue) => ({ ...Ue, partialTranscript: fe || null }));
2977
3001
  }), pe.on(lt.AGENT_RESPONSE_CHUNK, (fe) => {
2978
- const { id: Ue, text: Pt } = ie.current.addChunk(fe?.requestId, fe?.text);
2979
- _((Ot) => {
2980
- const dr = Ot.messages.filter((cr) => cr.id !== Ue);
3002
+ const { id: Ue, text: Et } = ie.current.addChunk(
3003
+ fe?.requestId,
3004
+ fe?.text
3005
+ );
3006
+ _((Rt) => {
3007
+ const dr = Rt.messages.filter((cr) => cr.id !== Ue);
2981
3008
  return {
2982
- ...Ot,
3009
+ ...Rt,
2983
3010
  messages: [
2984
3011
  ...dr,
2985
- { id: Ue, role: "assistant", text: Pt, streaming: !0, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
3012
+ {
3013
+ id: Ue,
3014
+ role: "assistant",
3015
+ text: Et,
3016
+ streaming: !0,
3017
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
3018
+ }
2986
3019
  ]
2987
3020
  };
2988
3021
  });
2989
3022
  }), pe.on(lt.AGENT_RESPONSE, (fe) => {
2990
- const { id: Ue, text: Pt } = ie.current.consume(fe?.requestId, fe?.text);
2991
- _((Ot) => {
2992
- const dr = Ot.messages.filter((cr) => cr.id !== Ue);
3023
+ const { id: Ue, text: Et } = ie.current.consume(
3024
+ fe?.requestId,
3025
+ fe?.text
3026
+ );
3027
+ _((Rt) => {
3028
+ const dr = Rt.messages.filter((cr) => cr.id !== Ue);
2993
3029
  return {
2994
- ...Ot,
3030
+ ...Rt,
2995
3031
  messages: [
2996
3032
  ...dr,
2997
- { id: Ue, role: "assistant", text: Pt, streaming: !1, timestamp: (/* @__PURE__ */ new Date()).toISOString() }
3033
+ {
3034
+ id: Ue,
3035
+ role: "assistant",
3036
+ text: Et,
3037
+ streaming: !1,
3038
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
3039
+ }
2998
3040
  ]
2999
3041
  };
3000
3042
  });
@@ -3007,12 +3049,12 @@ function vy({
3007
3049
  const Ue = io(Ce.current);
3008
3050
  if (Ue === sn.CLOUD_AVATAR || Ue === sn.DESKTOP_AVATAR)
3009
3051
  return;
3010
- const Pt = gy(fe?.audio);
3011
- if (!Pt) return;
3012
- const Ot = he();
3013
- if (Ot)
3052
+ const Et = gy(fe?.audio);
3053
+ if (!Et) return;
3054
+ const Rt = he();
3055
+ if (Rt)
3014
3056
  try {
3015
- Ot.feed(Pt), _((dr) => ({ ...dr, isAudioPlaying: !0 }));
3057
+ Rt.feed(Et), _((dr) => ({ ...dr, isAudioPlaying: !0 }));
3016
3058
  } catch (dr) {
3017
3059
  ce("feed pcm failed", dr);
3018
3060
  }
@@ -3068,12 +3110,12 @@ function vy({
3068
3110
  reject: ct
3069
3111
  }), wt) {
3070
3112
  const Ue = () => {
3071
- fe.off(lt.RECONNECT_FAILED, Pt), dt();
3072
- }, Pt = (Ot) => {
3073
- fe.off(lt.RECONNECT_SUCCESS, Ue), ct(new Error(Ot?.reason || "Reconnect failed"));
3113
+ fe.off(lt.RECONNECT_FAILED, Et), dt();
3114
+ }, Et = (Rt) => {
3115
+ fe.off(lt.RECONNECT_SUCCESS, Ue), ct(new Error(Rt?.reason || "Reconnect failed"));
3074
3116
  };
3075
- fe.once(lt.RECONNECT_SUCCESS, Ue), fe.once(lt.RECONNECT_FAILED, Pt), setTimeout(() => {
3076
- fe.off(lt.RECONNECT_SUCCESS, Ue), fe.off(lt.RECONNECT_FAILED, Pt), ct(new Error("Reconnect timed out"));
3117
+ fe.once(lt.RECONNECT_SUCCESS, Ue), fe.once(lt.RECONNECT_FAILED, Et), setTimeout(() => {
3118
+ fe.off(lt.RECONNECT_SUCCESS, Ue), fe.off(lt.RECONNECT_FAILED, Et), ct(new Error("Reconnect timed out"));
3077
3119
  }, ee.current.timeoutMs);
3078
3120
  }
3079
3121
  }),
@@ -3132,20 +3174,20 @@ function vy({
3132
3174
  method: "POST",
3133
3175
  headers: { "Content-Type": "application/json" },
3134
3176
  body: JSON.stringify(ct)
3135
- }).then($p), Ue = fe?.session_id || null, Pt = fe?.session_token;
3136
- if (!Ue || !Pt)
3177
+ }).then($p), Ue = fe?.session_id || null, Et = fe?.session_token;
3178
+ if (!Ue || !Et)
3137
3179
  throw new Error("Invalid initialize session response");
3138
- return _((Ot) => ({
3139
- ...Ot,
3180
+ return _((Rt) => ({
3181
+ ...Rt,
3140
3182
  session: {
3141
- ...Ot.session,
3183
+ ...Rt.session,
3142
3184
  sessionId: Ue,
3143
- agentType: fe?.streaming_url ? sn.CLOUD_AVATAR : Ot.session.agentType,
3185
+ agentType: fe?.streaming_url ? sn.CLOUD_AVATAR : Rt.session.agentType,
3144
3186
  streamingUrl: fe?.streaming_url || null,
3145
3187
  uniqueId: fe?.unique_id || null,
3146
3188
  role: null
3147
3189
  }
3148
- })), re(Vt.CONNECTING), fe?.streaming_url ? Ke(tr.CONNECTING) : Ke(tr.IDLE), await yt({ authPayload: { token: Pt }, queryToken: Pt }), fe;
3190
+ })), re(Vt.CONNECTING), fe?.streaming_url ? Ke(tr.CONNECTING) : Ke(tr.IDLE), await yt({ authPayload: { token: Et }, queryToken: Et }), fe;
3149
3191
  },
3150
3192
  [
3151
3193
  yt,
@@ -3191,7 +3233,10 @@ function vy({
3191
3233
  ]
3192
3234
  ), rt = Qe(() => {
3193
3235
  Be({ keepManualDisconnect: !0 });
3194
- }, [Be]), Ze = Qe(async () => (rt(), { success: !0 }), [rt]), Q = Qe((pe, Ne = {}) => !U.current || !R.isConnected ? !1 : (U.current.emit(pe, Ne), !0), [R.isConnected]), Ae = Qe(
3236
+ }, [Be]), Ze = Qe(async () => (rt(), { success: !0 }), [rt]), Q = Qe(
3237
+ (pe, Ne = {}) => !U.current || !R.isConnected ? !1 : (U.current.emit(pe, Ne), !0),
3238
+ [R.isConnected]
3239
+ ), Ae = Qe(
3195
3240
  (pe) => {
3196
3241
  if (!pe || !String(pe).trim()) return !1;
3197
3242
  const Ne = {
@@ -3200,13 +3245,25 @@ function vy({
3200
3245
  text: String(pe),
3201
3246
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
3202
3247
  };
3203
- return _((wt) => ({ ...wt, messages: [...wt.messages, Ne] })), Q(lt.USER_MESSAGE, { message: String(pe) });
3248
+ return _((wt) => ({
3249
+ ...wt,
3250
+ messages: [...wt.messages, Ne]
3251
+ })), Q(lt.USER_MESSAGE, { message: String(pe) });
3204
3252
  },
3205
3253
  [Q]
3206
- ), et = Qe((pe) => Q(lt.AUDIO_CHUNK, { audio: pe }), [Q]), gt = Qe(() => Q(lt.AUDIO_END, {}), [Q]), qt = Qe(() => (le.current = !0, Me(), _((pe) => ({ ...pe, isAudioPlaying: !1 })), Q(lt.INTERRUPT, {})), [Me, Q]), Ct = Qe(
3254
+ ), et = Qe(
3255
+ (pe) => Q(lt.AUDIO_CHUNK, { audio: pe }),
3256
+ [Q]
3257
+ ), gt = Qe(
3258
+ () => Q(lt.AUDIO_END, {}),
3259
+ [Q]
3260
+ ), qt = Qe(() => (le.current = !0, Me(), _((pe) => ({ ...pe, isAudioPlaying: !1 })), Q(lt.INTERRUPT, {})), [Me, Q]), kt = Qe(
3207
3261
  () => Q(lt.REFRESH_SESSION_ACTIVITY, {}),
3208
3262
  [Q]
3209
- ), ot = Qe(() => Q(lt.CLEAR_SESSION_HISTORY, {}), [Q]), tt = Qe(
3263
+ ), ot = Qe(
3264
+ () => Q(lt.CLEAR_SESSION_HISTORY, {}),
3265
+ [Q]
3266
+ ), tt = Qe(
3210
3267
  (pe) => pe ? Q(lt.CHANGE_SESSION_LANGUAGE, { language: pe }) : !1,
3211
3268
  [Q]
3212
3269
  ), Xt = Qe(() => {
@@ -3227,7 +3284,7 @@ function vy({
3227
3284
  sendAudioChunk: et,
3228
3285
  endAudioStream: gt,
3229
3286
  interrupt: qt,
3230
- refreshSessionActivity: Ct,
3287
+ refreshSessionActivity: kt,
3231
3288
  clearSessionHistory: ot,
3232
3289
  changeSessionLanguage: tt,
3233
3290
  clearMessages: Xt,
@@ -3249,7 +3306,7 @@ function vy({
3249
3306
  tt,
3250
3307
  De,
3251
3308
  Ze,
3252
- Ct,
3309
+ kt,
3253
3310
  me,
3254
3311
  et,
3255
3312
  Ae,
@@ -3262,7 +3319,9 @@ function vy({
3262
3319
  const on = () => {
3263
3320
  const c = gg(pf);
3264
3321
  if (!c)
3265
- throw new Error("useRqmiiAgentContext must be used inside <RqmiiAgentProvider>");
3322
+ throw new Error(
3323
+ "useRqmiiAgentContext must be used inside <RqmiiAgentProvider>"
3324
+ );
3266
3325
  return c;
3267
3326
  }, _y = [
3268
3327
  "Cannot read properties of null (reading 'state')",
@@ -3703,7 +3762,7 @@ function $y() {
3703
3762
  e && (Ze.set("int64", BigInt64Array), Q.set(BigInt64Array, "int64")), t && (Ze.set("uint64", BigUint64Array), Q.set(BigUint64Array, "uint64")), i ? (Ze.set("float16", s), Q.set(s, "float16")) : Ze.set("float16", Uint16Array);
3704
3763
  }
3705
3764
  };
3706
- }), qt, Ct, ot = _(() => {
3765
+ }), qt, kt, ot = _(() => {
3707
3766
  Xt(), qt = (e) => {
3708
3767
  let t = 1;
3709
3768
  for (let s = 0; s < e.length; s++) {
@@ -3713,7 +3772,7 @@ function $y() {
3713
3772
  t *= i;
3714
3773
  }
3715
3774
  return t;
3716
- }, Ct = (e, t) => {
3775
+ }, kt = (e, t) => {
3717
3776
  switch (e.location) {
3718
3777
  case "cpu":
3719
3778
  return new tt(e.type, e.data, t);
@@ -3868,12 +3927,12 @@ function $y() {
3868
3927
  }
3869
3928
  reshape(e) {
3870
3929
  if (this.ensureValid(), this.downloader || this.disposer) throw new Error("Cannot reshape a tensor that owns GPU resource.");
3871
- return Ct(this, e);
3930
+ return kt(this, e);
3872
3931
  }
3873
3932
  };
3874
3933
  }), vt, pe = _(() => {
3875
3934
  Xt(), vt = tt;
3876
- }), Ne, wt, dt, ct, fe, Ue, Pt = _(() => {
3935
+ }), Ne, wt, dt, ct, fe, Ue, Et = _(() => {
3877
3936
  Me(), Ne = (e, t) => {
3878
3937
  (typeof he.trace > "u" ? !he.wasm.trace : !he.trace) || console.timeStamp(`${e}::ORT::${t}`);
3879
3938
  }, wt = (e, t) => {
@@ -3895,8 +3954,8 @@ function $y() {
3895
3954
  }, Ue = (e) => {
3896
3955
  (typeof he.trace > "u" ? !he.wasm.trace : !he.trace) || console.timeEnd(`ORT::${e}`);
3897
3956
  };
3898
- }), Ot, dr = _(() => {
3899
- Le(), pe(), Pt(), Ot = class gf {
3957
+ }), Rt, dr = _(() => {
3958
+ Le(), pe(), Et(), Rt = class gf {
3900
3959
  constructor(t) {
3901
3960
  this.handler = t;
3902
3961
  }
@@ -3989,7 +4048,7 @@ function $y() {
3989
4048
  }
3990
4049
  };
3991
4050
  }), cr, Wi = _(() => {
3992
- dr(), cr = Ot;
4051
+ dr(), cr = Rt;
3993
4052
  }), Hi = _(() => {
3994
4053
  }), ji = _(() => {
3995
4054
  }), Ki = _(() => {
@@ -3997,7 +4056,7 @@ function $y() {
3997
4056
  }), ls = {};
3998
4057
  U(ls, { InferenceSession: () => cr, TRACE: () => Ne, TRACE_EVENT_BEGIN: () => fe, TRACE_EVENT_END: () => Ue, TRACE_FUNC_BEGIN: () => dt, TRACE_FUNC_END: () => ct, Tensor: () => vt, env: () => me, registerBackend: () => ie });
3999
4058
  var zt = _(() => {
4000
- Ce(), ut(), Wi(), pe(), Hi(), ji(), Pt(), Ki(), Qi();
4059
+ Ce(), ut(), Wi(), pe(), Hi(), ji(), Et(), Ki(), Qi();
4001
4060
  }), ln = _(() => {
4002
4061
  }), us = {};
4003
4062
  U(us, { default: () => ds });
@@ -4158,8 +4217,8 @@ function $y() {
4158
4217
  if (Br && gn) return gn;
4159
4218
  throw new Error("WebAssembly is not initialized yet.");
4160
4219
  };
4161
- }), Et, Nr, ke, vn = _(() => {
4162
- Yt(), Et = (e, t) => {
4220
+ }), Ct, Nr, ke, vn = _(() => {
4221
+ Yt(), Ct = (e, t) => {
4163
4222
  let s = Oe(), i = s.lengthBytesUTF8(e) + 1, o = s._malloc(i);
4164
4223
  return s.stringToUTF8(e, o, i), t.push(o), o;
4165
4224
  }, Nr = (e, t, s, i) => {
@@ -4195,8 +4254,8 @@ function $y() {
4195
4254
  else if (typeof e.logVerbosityLevel != "number" || !Number.isInteger(e.logVerbosityLevel)) throw new Error(`log verbosity level is not valid: ${e.logVerbosityLevel}`);
4196
4255
  e?.terminate === void 0 && (o.terminate = !1);
4197
4256
  let l = 0;
4198
- return e?.tag !== void 0 && (l = Et(e.tag, i)), s = t._OrtCreateRunOptions(o.logSeverityLevel, o.logVerbosityLevel, !!o.terminate, l), s === 0 && ke("Can't create run options."), e?.extra !== void 0 && Nr(e.extra, "", /* @__PURE__ */ new WeakSet(), (u, d) => {
4199
- let h = Et(u, i), p = Et(d, i);
4257
+ return e?.tag !== void 0 && (l = Ct(e.tag, i)), s = t._OrtCreateRunOptions(o.logSeverityLevel, o.logVerbosityLevel, !!o.terminate, l), s === 0 && ke("Can't create run options."), e?.extra !== void 0 && Nr(e.extra, "", /* @__PURE__ */ new WeakSet(), (u, d) => {
4258
+ let h = Ct(u, i), p = Ct(d, i);
4200
4259
  t._OrtAddRunConfigEntry(s, h, p) !== 0 && ke(`Can't set a run config entry: ${u} - ${d}.`);
4201
4260
  }), [s, i];
4202
4261
  } catch (l) {
@@ -4233,7 +4292,7 @@ function $y() {
4233
4292
  let t = e.extra.session;
4234
4293
  t.use_ort_model_bytes_directly || (t.use_ort_model_bytes_directly = "1"), e.executionProviders && e.executionProviders.some((s) => (typeof s == "string" ? s : s.name) === "webgpu") && (e.enableMemPattern = !1);
4235
4294
  }, pr = (e, t, s, i) => {
4236
- let o = Et(t, i), l = Et(s, i);
4295
+ let o = Ct(t, i), l = Ct(s, i);
4237
4296
  Oe()._OrtAddSessionConfigEntry(e, o, l) !== 0 && ke(`Can't set a session config entry: ${t} - ${s}.`);
4238
4297
  }, xs = async (e, t, s) => {
4239
4298
  let i = t.executionProviders;
@@ -4261,7 +4320,7 @@ function $y() {
4261
4320
  default:
4262
4321
  throw new Error(`not supported execution provider: ${l}`);
4263
4322
  }
4264
- let d = Et(l, s), h = u.length, p = 0, g = 0;
4323
+ let d = Ct(l, s), h = u.length, p = 0, g = 0;
4265
4324
  if (h > 0) {
4266
4325
  p = Oe()._malloc(h * Oe().PTR_SIZE), s.push(p), g = Oe()._malloc(h * Oe().PTR_SIZE), s.push(g);
4267
4326
  for (let m = 0; m < h; m++) Oe().setValue(p + m * Oe().PTR_SIZE, u[m][0], "*"), Oe().setValue(g + m * Oe().PTR_SIZE, u[m][1], "*");
@@ -4272,11 +4331,11 @@ function $y() {
4272
4331
  let t = Oe(), s = 0, i = [], o = e || {};
4273
4332
  $s(o);
4274
4333
  try {
4275
- let l = Ss(o.graphOptimizationLevel ?? "all"), u = Ts(o.executionMode ?? "sequential"), d = typeof o.logId == "string" ? Et(o.logId, i) : 0, h = o.logSeverityLevel ?? 2;
4334
+ let l = Ss(o.graphOptimizationLevel ?? "all"), u = Ts(o.executionMode ?? "sequential"), d = typeof o.logId == "string" ? Ct(o.logId, i) : 0, h = o.logSeverityLevel ?? 2;
4276
4335
  if (!Number.isInteger(h) || h < 0 || h > 4) throw new Error(`log severity level is not valid: ${h}`);
4277
4336
  let p = o.logVerbosityLevel ?? 0;
4278
4337
  if (!Number.isInteger(p) || p < 0 || p > 4) throw new Error(`log verbosity level is not valid: ${p}`);
4279
- let g = typeof o.optimizedModelFilePath == "string" ? Et(o.optimizedModelFilePath, i) : 0;
4338
+ let g = typeof o.optimizedModelFilePath == "string" ? Ct(o.optimizedModelFilePath, i) : 0;
4280
4339
  if (s = t._OrtCreateSessionOptions(l, !!o.enableCpuMemArena, !!o.enableMemPattern, u, !!o.enableProfiling, 0, d, h, p, g), s === 0 && ke("Can't create session options."), o.executionProviders && await xs(s, o, i), o.enableGraphCapture !== void 0) {
4281
4340
  if (typeof o.enableGraphCapture != "boolean") throw new Error(`enableGraphCapture must be a boolean value: ${o.enableGraphCapture}`);
4282
4341
  pr(s, "enableGraphCapture", o.enableGraphCapture.toString(), i);
@@ -4284,7 +4343,7 @@ function $y() {
4284
4343
  if (o.freeDimensionOverrides) for (let [m, w] of Object.entries(o.freeDimensionOverrides)) {
4285
4344
  if (typeof m != "string") throw new Error(`free dimension override name must be a string: ${m}`);
4286
4345
  if (typeof w != "number" || !Number.isInteger(w) || w < 0) throw new Error(`free dimension override value must be a non-negative integer: ${w}`);
4287
- let b = Et(m, i);
4346
+ let b = Ct(m, i);
4288
4347
  t._OrtAddFreeDimensionOverride(s, b, w) !== 0 && ke(`Can't set a free dimension override: ${m} - ${w}.`);
4289
4348
  }
4290
4349
  return o.extra !== void 0 && Nr(o.extra, "", /* @__PURE__ */ new WeakSet(), (m, w) => {
@@ -5447,8 +5506,8 @@ function $y() {
5447
5506
  }, sr = (e, t) => {
5448
5507
  Bt(e.inputs, t.perm), e.compute(Tt(e.inputs[0], t.perm));
5449
5508
  }, Bs = (e) => $({ perm: e.perm });
5450
- }), nr, fi, gr, kn, kt, Ht, ns, Rn, Ns, mi, Dt, yr, en, Rt, $t, ir, gi, yi, zo, Do, Lo, wm = _(() => {
5451
- Ie(), Re(), _e(), ta(), We(), nr = { max: "select(bestValue, candidate, candidate > bestValue)", min: "select(bestValue, candidate, candidate < bestValue)", mean: "bestValue + candidate", sum: "bestValue + candidate", prod: "bestValue * candidate", sumSquare: "bestValue + candidate * candidate", logSumExp: "bestValue + exp(candidate)", l1: "bestValue + abs(candidate)", l2: "bestValue + candidate * candidate", logSum: "bestValue + candidate" }, fi = { max: "select(bestValue, candidate, candidate > bestValue)", min: "select(bestValue, candidate, candidate < bestValue)", mean: "bestValue + candidate", sum: "bestValue + candidate", prod: "bestValue * candidate", sumSquare: "bestValue + candidate", logSumExp: "bestValue + candidate", l1: "bestValue + candidate", l2: "bestValue + candidate", logSum: "bestValue + candidate" }, gr = { max: "_A[offset]", min: "_A[offset]", mean: "0", sum: "0", prod: "1", sumSquare: "0", logSumExp: "0", l1: "0", l2: "0", logSum: "0" }, kn = { max: "bestValue", min: "bestValue", sum: "bestValue", prod: "bestValue", sumSquare: "bestValue", logSumExp: "log(bestValue)", l1: "bestValue", l2: "sqrt(bestValue)", logSum: "log(bestValue)" }, kt = (e, t) => {
5509
+ }), nr, fi, gr, kn, At, Ht, ns, Rn, Ns, mi, Dt, yr, en, Mt, $t, ir, gi, yi, zo, Do, Lo, wm = _(() => {
5510
+ Ie(), Re(), _e(), ta(), We(), nr = { max: "select(bestValue, candidate, candidate > bestValue)", min: "select(bestValue, candidate, candidate < bestValue)", mean: "bestValue + candidate", sum: "bestValue + candidate", prod: "bestValue * candidate", sumSquare: "bestValue + candidate * candidate", logSumExp: "bestValue + exp(candidate)", l1: "bestValue + abs(candidate)", l2: "bestValue + candidate * candidate", logSum: "bestValue + candidate" }, fi = { max: "select(bestValue, candidate, candidate > bestValue)", min: "select(bestValue, candidate, candidate < bestValue)", mean: "bestValue + candidate", sum: "bestValue + candidate", prod: "bestValue * candidate", sumSquare: "bestValue + candidate", logSumExp: "bestValue + candidate", l1: "bestValue + candidate", l2: "bestValue + candidate", logSum: "bestValue + candidate" }, gr = { max: "_A[offset]", min: "_A[offset]", mean: "0", sum: "0", prod: "1", sumSquare: "0", logSumExp: "0", l1: "0", l2: "0", logSum: "0" }, kn = { max: "bestValue", min: "bestValue", sum: "bestValue", prod: "bestValue", sumSquare: "bestValue", logSumExp: "log(bestValue)", l1: "bestValue", l2: "sqrt(bestValue)", logSum: "log(bestValue)" }, At = (e, t) => {
5452
5511
  let s = [];
5453
5512
  for (let i = t - e; i < t; ++i) s.push(i);
5454
5513
  return s;
@@ -5518,14 +5577,14 @@ function $y() {
5518
5577
  let o = e.inputs.length === 1 ? s : ea(e.inputs, s), l = o.axes;
5519
5578
  l.length === 0 && !o.noopWithEmptyAxes && (l = e.inputs[0].dims.map((b, S) => S));
5520
5579
  let u = H.normalizeAxes(l, e.inputs[0].dims.length), d = u, h = e.inputs[0], p = Ns(d, e.inputs[0].dims.length);
5521
- p.length > 0 && (h = e.compute(Tt(e.inputs[0], p), { inputs: [0], outputs: [-1] })[0], d = kt(d.length, h.dims.length));
5580
+ p.length > 0 && (h = e.compute(Tt(e.inputs[0], p), { inputs: [0], outputs: [-1] })[0], d = At(d.length, h.dims.length));
5522
5581
  let [g, m] = Ht(h.dims, d), w = g;
5523
5582
  o.keepDims && (w = ns(g, u)), e.compute(mi(t, o.cacheKey, [h], i, e.inputs[0].dataType, w, m), { inputs: [h] });
5524
5583
  }, yr = (e, t) => {
5525
5584
  Dt(e, "ReduceMeanShared", t, "mean");
5526
5585
  }, en = (e, t) => {
5527
5586
  Dt(e, "ReduceL1Shared", t, "l1");
5528
- }, Rt = (e, t) => {
5587
+ }, Mt = (e, t) => {
5529
5588
  Dt(e, "ReduceL2Shared", t, "l2");
5530
5589
  }, $t = (e, t) => {
5531
5590
  Dt(e, "ReduceLogSumExpShared", t, "logSumExp");
@@ -5628,7 +5687,7 @@ function $y() {
5628
5687
  }, Xo = (e, t) => {
5629
5688
  _r(e.inputs[0].dims, t.axes, t.noopWithEmptyAxes) ? Uo(e, t) : en(e, t);
5630
5689
  }, Yo = (e, t) => {
5631
- _r(e.inputs[0].dims, t.axes, t.noopWithEmptyAxes) ? Fo(e, t) : Rt(e, t);
5690
+ _r(e.inputs[0].dims, t.axes, t.noopWithEmptyAxes) ? Fo(e, t) : Mt(e, t);
5632
5691
  }, Jo = (e, t) => {
5633
5692
  _r(e.inputs[0].dims, t.axes, t.noopWithEmptyAxes) ? Vo(e, t) : $t(e, t);
5634
5693
  }, Zo = (e, t) => {
@@ -10920,7 +10979,7 @@ ${l}`, d = s.createShaderModule({ code: u, label: e.name });
10920
10979
  S = h * k.length, b = d._malloc(S), s.push(b);
10921
10980
  for (let x = 0; x < k.length; x++) {
10922
10981
  if (typeof k[x] != "string") throw new TypeError(`tensor data at index ${x} is not a string`);
10923
- d.setValue(b + x * h, Et(k[x], s), "*");
10982
+ d.setValue(b + x * h, Ct(k[x], s), "*");
10924
10983
  }
10925
10984
  } else {
10926
10985
  let x = d.webnnIsGraphInput, O = d.webnnIsGraphOutput;
@@ -10989,43 +11048,43 @@ ${l}`, d = s.createShaderModule({ code: u, label: e.name });
10989
11048
  let pt = u.getValue(Fe + d * 2, "*"), Sr = Number(u.getValue(Fe + d * 3, ve)), Pr = [];
10990
11049
  for (let Ft = 0; Ft < Sr; Ft++) Pr.push(Number(u.getValue(pt + Ft * d, ve)));
10991
11050
  u._OrtFree(pt) !== 0 && ke("Can't free memory for tensor dims.");
10992
- let nn = Pr.reduce((Ft, At) => Ft * At, 1);
11051
+ let nn = Pr.reduce((Ft, It) => Ft * It, 1);
10993
11052
  ht = Zt(Ve);
10994
11053
  let Xs = w?.outputPreferredLocations[i[we]];
10995
11054
  if (ht === "string") {
10996
11055
  if (Xs === "gpu-buffer" || Xs === "ml-tensor") throw new Error("String tensor is not supported on GPU.");
10997
11056
  let Ft = [];
10998
- for (let At = 0; At < nn; At++) {
10999
- let Vr = u.getValue(ne + At * d, "*"), pg = u.getValue(ne + (At + 1) * d, "*"), fg = At === nn - 1 ? void 0 : pg - Vr;
11057
+ for (let It = 0; It < nn; It++) {
11058
+ let Vr = u.getValue(ne + It * d, "*"), pg = u.getValue(ne + (It + 1) * d, "*"), fg = It === nn - 1 ? void 0 : pg - Vr;
11000
11059
  Ft.push(u.UTF8ToString(Vr, fg));
11001
11060
  }
11002
11061
  Pe.push([ht, Pr, Ft, "cpu"]);
11003
11062
  } else if (Xs === "gpu-buffer" && nn > 0) {
11004
11063
  let Ft = u.jsepGetBuffer;
11005
11064
  if (!Ft) throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');
11006
- let At = Ft(ne), Vr = er(Ve, nn);
11065
+ let It = Ft(ne), Vr = er(Ve, nn);
11007
11066
  if (Vr === void 0 || !Sn(ht)) throw new Error(`Unsupported data type: ${ht}`);
11008
- ze = !0, Pe.push([ht, Pr, { gpuBuffer: At, download: u.jsepCreateDownloader(At, Vr, ht), dispose: () => {
11067
+ ze = !0, Pe.push([ht, Pr, { gpuBuffer: It, download: u.jsepCreateDownloader(It, Vr, ht), dispose: () => {
11009
11068
  u._OrtReleaseTensor(xe) !== 0 && ke("Can't release tensor.");
11010
11069
  } }, "gpu-buffer"]);
11011
11070
  } else if (Xs === "ml-tensor" && nn > 0) {
11012
- let Ft = u.webnnEnsureTensor, At = u.webnnIsGraphInputOutputTypeSupported;
11013
- if (!Ft || !At) throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');
11071
+ let Ft = u.webnnEnsureTensor, It = u.webnnIsGraphInputOutputTypeSupported;
11072
+ if (!Ft || !It) throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');
11014
11073
  if (er(Ve, nn) === void 0 || !Tn(ht)) throw new Error(`Unsupported data type: ${ht}`);
11015
- if (!At(e, ht, !1)) throw new Error(`preferredLocation "ml-tensor" for ${ht} output is not supported by current WebNN Context.`);
11074
+ if (!It(e, ht, !1)) throw new Error(`preferredLocation "ml-tensor" for ${ht} output is not supported by current WebNN Context.`);
11016
11075
  let Vr = await Ft(e, ne, Ve, Pr, !1);
11017
11076
  ze = !0, Pe.push([ht, Pr, { mlTensor: Vr, download: u.webnnCreateMLTensorDownloader(ne, ht), dispose: () => {
11018
11077
  u.webnnReleaseTensorId(ne), u._OrtReleaseTensor(xe);
11019
11078
  } }, "ml-tensor"]);
11020
11079
  } else if (Xs === "ml-tensor-cpu-output" && nn > 0) {
11021
- let Ft = u.webnnCreateMLTensorDownloader(ne, ht)(), At = Pe.length;
11080
+ let Ft = u.webnnCreateMLTensorDownloader(ne, ht)(), It = Pe.length;
11022
11081
  ze = !0, it.push((async () => {
11023
- let Vr = [At, await Ft];
11082
+ let Vr = [It, await Ft];
11024
11083
  return u.webnnReleaseTensorId(ne), u._OrtReleaseTensor(xe), Vr;
11025
11084
  })()), Pe.push([ht, Pr, [], "cpu"]);
11026
11085
  } else {
11027
- let Ft = _n(ht), At = new Ft(nn);
11028
- new Uint8Array(At.buffer, At.byteOffset, At.byteLength).set(u.HEAPU8.subarray(ne, ne + At.byteLength)), Pe.push([ht, Pr, At, "cpu"]);
11086
+ let Ft = _n(ht), It = new Ft(nn);
11087
+ new Uint8Array(It.buffer, It.byteOffset, It.byteLength).set(u.HEAPU8.subarray(ne, ne + It.byteLength)), Pe.push([ht, Pr, It, "cpu"]);
11029
11088
  }
11030
11089
  } finally {
11031
11090
  u.stackRestore(je), ht === "string" && ne && u._free(ne), ze || u._OrtReleaseTensor(xe);
@@ -11791,7 +11850,7 @@ function Ay() {
11791
11850
  y && (Ze.set("int64", BigInt64Array), Q.set(BigInt64Array, "int64")), $ && (Ze.set("uint64", BigUint64Array), Q.set(BigUint64Array, "uint64")), z ? (Ze.set("float16", A), Q.set(A, "float16")) : Ze.set("float16", Uint16Array);
11792
11851
  }
11793
11852
  };
11794
- }), qt, Ct, ot = _(() => {
11853
+ }), qt, kt, ot = _(() => {
11795
11854
  Xt(), qt = (y) => {
11796
11855
  let $ = 1;
11797
11856
  for (let A = 0; A < y.length; A++) {
@@ -11801,7 +11860,7 @@ function Ay() {
11801
11860
  $ *= z;
11802
11861
  }
11803
11862
  return $;
11804
- }, Ct = (y, $) => {
11863
+ }, kt = (y, $) => {
11805
11864
  switch (y.location) {
11806
11865
  case "cpu":
11807
11866
  return new tt(y.type, y.data, $);
@@ -11956,12 +12015,12 @@ function Ay() {
11956
12015
  }
11957
12016
  reshape(y) {
11958
12017
  if (this.ensureValid(), this.downloader || this.disposer) throw new Error("Cannot reshape a tensor that owns GPU resource.");
11959
- return Ct(this, y);
12018
+ return kt(this, y);
11960
12019
  }
11961
12020
  };
11962
12021
  }), vt, pe = _(() => {
11963
12022
  Xt(), vt = tt;
11964
- }), Ne, wt, dt, ct, fe, Ue, Pt = _(() => {
12023
+ }), Ne, wt, dt, ct, fe, Ue, Et = _(() => {
11965
12024
  Me(), Ne = (y, $) => {
11966
12025
  (typeof he.trace > "u" ? !he.wasm.trace : !he.trace) || console.timeStamp(`${y}::ORT::${$}`);
11967
12026
  }, wt = (y, $) => {
@@ -11983,8 +12042,8 @@ function Ay() {
11983
12042
  }, Ue = (y) => {
11984
12043
  (typeof he.trace > "u" ? !he.wasm.trace : !he.trace) || console.timeEnd(`ORT::${y}`);
11985
12044
  };
11986
- }), Ot, dr = _(() => {
11987
- Le(), pe(), Pt(), Ot = class _f {
12045
+ }), Rt, dr = _(() => {
12046
+ Le(), pe(), Et(), Rt = class _f {
11988
12047
  constructor($) {
11989
12048
  this.handler = $;
11990
12049
  }
@@ -12077,7 +12136,7 @@ function Ay() {
12077
12136
  }
12078
12137
  };
12079
12138
  }), cr, Wi = _(() => {
12080
- dr(), cr = Ot;
12139
+ dr(), cr = Rt;
12081
12140
  }), Hi = _(() => {
12082
12141
  }), ji = _(() => {
12083
12142
  }), Ki = _(() => {
@@ -12085,7 +12144,7 @@ function Ay() {
12085
12144
  }), ls = {};
12086
12145
  U(ls, { InferenceSession: () => cr, TRACE: () => Ne, TRACE_EVENT_BEGIN: () => fe, TRACE_EVENT_END: () => Ue, TRACE_FUNC_BEGIN: () => dt, TRACE_FUNC_END: () => ct, Tensor: () => vt, env: () => me, registerBackend: () => ie });
12087
12146
  var zt = _(() => {
12088
- Ce(), ut(), Wi(), pe(), Hi(), ji(), Pt(), Ki(), Qi();
12147
+ Ce(), ut(), Wi(), pe(), Hi(), ji(), Et(), Ki(), Qi();
12089
12148
  }), ln = _(() => {
12090
12149
  }), us = {};
12091
12150
  U(us, { default: () => ds });
@@ -12246,8 +12305,8 @@ function Ay() {
12246
12305
  if (Br && gn) return gn;
12247
12306
  throw new Error("WebAssembly is not initialized yet.");
12248
12307
  };
12249
- }), Et, Nr, ke, vn = _(() => {
12250
- Yt(), Et = (y, $) => {
12308
+ }), Ct, Nr, ke, vn = _(() => {
12309
+ Yt(), Ct = (y, $) => {
12251
12310
  let A = Oe(), z = A.lengthBytesUTF8(y) + 1, P = A._malloc(z);
12252
12311
  return A.stringToUTF8(y, P, z), $.push(P), P;
12253
12312
  }, Nr = (y, $, A, z) => {
@@ -12283,8 +12342,8 @@ function Ay() {
12283
12342
  else if (typeof y.logVerbosityLevel != "number" || !Number.isInteger(y.logVerbosityLevel)) throw new Error(`log verbosity level is not valid: ${y.logVerbosityLevel}`);
12284
12343
  y?.terminate === void 0 && (P.terminate = !1);
12285
12344
  let G = 0;
12286
- return y?.tag !== void 0 && (G = Et(y.tag, z)), A = $._OrtCreateRunOptions(P.logSeverityLevel, P.logVerbosityLevel, !!P.terminate, G), A === 0 && ke("Can't create run options."), y?.extra !== void 0 && Nr(y.extra, "", /* @__PURE__ */ new WeakSet(), (N, L) => {
12287
- let V = Et(N, z), Z = Et(L, z);
12345
+ return y?.tag !== void 0 && (G = Ct(y.tag, z)), A = $._OrtCreateRunOptions(P.logSeverityLevel, P.logVerbosityLevel, !!P.terminate, G), A === 0 && ke("Can't create run options."), y?.extra !== void 0 && Nr(y.extra, "", /* @__PURE__ */ new WeakSet(), (N, L) => {
12346
+ let V = Ct(N, z), Z = Ct(L, z);
12288
12347
  $._OrtAddRunConfigEntry(A, V, Z) !== 0 && ke(`Can't set a run config entry: ${N} - ${L}.`);
12289
12348
  }), [A, z];
12290
12349
  } catch (G) {
@@ -12321,7 +12380,7 @@ function Ay() {
12321
12380
  let $ = y.extra.session;
12322
12381
  $.use_ort_model_bytes_directly || ($.use_ort_model_bytes_directly = "1"), y.executionProviders && y.executionProviders.some((A) => (typeof A == "string" ? A : A.name) === "webgpu") && (y.enableMemPattern = !1);
12323
12382
  }, pr = (y, $, A, z) => {
12324
- let P = Et($, z), G = Et(A, z);
12383
+ let P = Ct($, z), G = Ct(A, z);
12325
12384
  Oe()._OrtAddSessionConfigEntry(y, P, G) !== 0 && ke(`Can't set a session config entry: ${$} - ${A}.`);
12326
12385
  }, xs = async (y, $, A) => {
12327
12386
  let z = $.executionProviders;
@@ -12349,7 +12408,7 @@ function Ay() {
12349
12408
  default:
12350
12409
  throw new Error(`not supported execution provider: ${G}`);
12351
12410
  }
12352
- let L = Et(G, A), V = N.length, Z = 0, se = 0;
12411
+ let L = Ct(G, A), V = N.length, Z = 0, se = 0;
12353
12412
  if (V > 0) {
12354
12413
  Z = Oe()._malloc(V * Oe().PTR_SIZE), A.push(Z), se = Oe()._malloc(V * Oe().PTR_SIZE), A.push(se);
12355
12414
  for (let J = 0; J < V; J++) Oe().setValue(Z + J * Oe().PTR_SIZE, N[J][0], "*"), Oe().setValue(se + J * Oe().PTR_SIZE, N[J][1], "*");
@@ -12360,11 +12419,11 @@ function Ay() {
12360
12419
  let $ = Oe(), A = 0, z = [], P = y || {};
12361
12420
  $s(P);
12362
12421
  try {
12363
- let G = Ss(P.graphOptimizationLevel ?? "all"), N = Ts(P.executionMode ?? "sequential"), L = typeof P.logId == "string" ? Et(P.logId, z) : 0, V = P.logSeverityLevel ?? 2;
12422
+ let G = Ss(P.graphOptimizationLevel ?? "all"), N = Ts(P.executionMode ?? "sequential"), L = typeof P.logId == "string" ? Ct(P.logId, z) : 0, V = P.logSeverityLevel ?? 2;
12364
12423
  if (!Number.isInteger(V) || V < 0 || V > 4) throw new Error(`log severity level is not valid: ${V}`);
12365
12424
  let Z = P.logVerbosityLevel ?? 0;
12366
12425
  if (!Number.isInteger(Z) || Z < 0 || Z > 4) throw new Error(`log verbosity level is not valid: ${Z}`);
12367
- let se = typeof P.optimizedModelFilePath == "string" ? Et(P.optimizedModelFilePath, z) : 0;
12426
+ let se = typeof P.optimizedModelFilePath == "string" ? Ct(P.optimizedModelFilePath, z) : 0;
12368
12427
  if (A = $._OrtCreateSessionOptions(G, !!P.enableCpuMemArena, !!P.enableMemPattern, N, !!P.enableProfiling, 0, L, V, Z, se), A === 0 && ke("Can't create session options."), P.executionProviders && await xs(A, P, z), P.enableGraphCapture !== void 0) {
12369
12428
  if (typeof P.enableGraphCapture != "boolean") throw new Error(`enableGraphCapture must be a boolean value: ${P.enableGraphCapture}`);
12370
12429
  pr(A, "enableGraphCapture", P.enableGraphCapture.toString(), z);
@@ -12372,7 +12431,7 @@ function Ay() {
12372
12431
  if (P.freeDimensionOverrides) for (let [J, j] of Object.entries(P.freeDimensionOverrides)) {
12373
12432
  if (typeof J != "string") throw new Error(`free dimension override name must be a string: ${J}`);
12374
12433
  if (typeof j != "number" || !Number.isInteger(j) || j < 0) throw new Error(`free dimension override value must be a non-negative integer: ${j}`);
12375
- let Te = Et(J, z);
12434
+ let Te = Ct(J, z);
12376
12435
  $._OrtAddFreeDimensionOverride(A, Te, j) !== 0 && ke(`Can't set a free dimension override: ${J} - ${j}.`);
12377
12436
  }
12378
12437
  return P.extra !== void 0 && Nr(P.extra, "", /* @__PURE__ */ new WeakSet(), (J, j) => {
@@ -12675,7 +12734,7 @@ function Ay() {
12675
12734
  F = V * Ge.length, Te = L._malloc(F), A.push(Te);
12676
12735
  for (let $e = 0; $e < Ge.length; $e++) {
12677
12736
  if (typeof Ge[$e] != "string") throw new TypeError(`tensor data at index ${$e} is not a string`);
12678
- L.setValue(Te + $e * V, Et(Ge[$e], A), "*");
12737
+ L.setValue(Te + $e * V, Ct(Ge[$e], A), "*");
12679
12738
  }
12680
12739
  } else {
12681
12740
  let $e = L.webnnIsGraphInput, qe = L.webnnIsGraphOutput;
@@ -12724,54 +12783,54 @@ function Ay() {
12724
12783
  sr.push(P[We]), nr !== qe[We] && N._OrtReleaseTensor(nr) !== 0 && ke("Can't release tensor.");
12725
12784
  continue;
12726
12785
  }
12727
- let fi = N.stackSave(), gr = N.stackAlloc(4 * L), kn = !1, kt, Ht = 0;
12786
+ let fi = N.stackSave(), gr = N.stackAlloc(4 * L), kn = !1, At, Ht = 0;
12728
12787
  try {
12729
12788
  N._OrtGetTensorData(nr, gr, gr + L, gr + 2 * L, gr + 3 * L) !== 0 && ke(`Can't access output tensor data on index ${We}.`);
12730
12789
  let ns = L === 4 ? "i32" : "i64", Rn = Number(N.getValue(gr, ns));
12731
12790
  Ht = N.getValue(gr + L, "*");
12732
12791
  let Ns = N.getValue(gr + L * 2, "*"), mi = Number(N.getValue(gr + L * 3, ns)), Dt = [];
12733
- for (let Rt = 0; Rt < mi; Rt++) Dt.push(Number(N.getValue(Ns + Rt * L, ns)));
12792
+ for (let Mt = 0; Mt < mi; Mt++) Dt.push(Number(N.getValue(Ns + Mt * L, ns)));
12734
12793
  N._OrtFree(Ns) !== 0 && ke("Can't free memory for tensor dims.");
12735
- let yr = Dt.reduce((Rt, $t) => Rt * $t, 1);
12736
- kt = Zt(Rn);
12794
+ let yr = Dt.reduce((Mt, $t) => Mt * $t, 1);
12795
+ At = Zt(Rn);
12737
12796
  let en = j?.outputPreferredLocations[z[We]];
12738
- if (kt === "string") {
12797
+ if (At === "string") {
12739
12798
  if (en === "gpu-buffer" || en === "ml-tensor") throw new Error("String tensor is not supported on GPU.");
12740
- let Rt = [];
12799
+ let Mt = [];
12741
12800
  for (let $t = 0; $t < yr; $t++) {
12742
12801
  let ir = N.getValue(Ht + $t * L, "*"), gi = N.getValue(Ht + ($t + 1) * L, "*"), yi = $t === yr - 1 ? void 0 : gi - ir;
12743
- Rt.push(N.UTF8ToString(ir, yi));
12802
+ Mt.push(N.UTF8ToString(ir, yi));
12744
12803
  }
12745
- sr.push([kt, Dt, Rt, "cpu"]);
12804
+ sr.push([At, Dt, Mt, "cpu"]);
12746
12805
  } else if (en === "gpu-buffer" && yr > 0) {
12747
- let Rt = N.jsepGetBuffer;
12748
- if (!Rt) throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');
12749
- let $t = Rt(Ht), ir = er(Rn, yr);
12750
- if (ir === void 0 || !Sn(kt)) throw new Error(`Unsupported data type: ${kt}`);
12751
- kn = !0, sr.push([kt, Dt, { gpuBuffer: $t, download: N.jsepCreateDownloader($t, ir, kt), dispose: () => {
12806
+ let Mt = N.jsepGetBuffer;
12807
+ if (!Mt) throw new Error('preferredLocation "gpu-buffer" is not supported without using WebGPU.');
12808
+ let $t = Mt(Ht), ir = er(Rn, yr);
12809
+ if (ir === void 0 || !Sn(At)) throw new Error(`Unsupported data type: ${At}`);
12810
+ kn = !0, sr.push([At, Dt, { gpuBuffer: $t, download: N.jsepCreateDownloader($t, ir, At), dispose: () => {
12752
12811
  N._OrtReleaseTensor(nr) !== 0 && ke("Can't release tensor.");
12753
12812
  } }, "gpu-buffer"]);
12754
12813
  } else if (en === "ml-tensor" && yr > 0) {
12755
- let Rt = N.webnnEnsureTensor, $t = N.webnnIsGraphInputOutputTypeSupported;
12756
- if (!Rt || !$t) throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');
12757
- if (er(Rn, yr) === void 0 || !Tn(kt)) throw new Error(`Unsupported data type: ${kt}`);
12758
- if (!$t(y, kt, !1)) throw new Error(`preferredLocation "ml-tensor" for ${kt} output is not supported by current WebNN Context.`);
12759
- let ir = await Rt(y, Ht, Rn, Dt, !1);
12760
- kn = !0, sr.push([kt, Dt, { mlTensor: ir, download: N.webnnCreateMLTensorDownloader(Ht, kt), dispose: () => {
12814
+ let Mt = N.webnnEnsureTensor, $t = N.webnnIsGraphInputOutputTypeSupported;
12815
+ if (!Mt || !$t) throw new Error('preferredLocation "ml-tensor" is not supported without using WebNN.');
12816
+ if (er(Rn, yr) === void 0 || !Tn(At)) throw new Error(`Unsupported data type: ${At}`);
12817
+ if (!$t(y, At, !1)) throw new Error(`preferredLocation "ml-tensor" for ${At} output is not supported by current WebNN Context.`);
12818
+ let ir = await Mt(y, Ht, Rn, Dt, !1);
12819
+ kn = !0, sr.push([At, Dt, { mlTensor: ir, download: N.webnnCreateMLTensorDownloader(Ht, At), dispose: () => {
12761
12820
  N.webnnReleaseTensorId(Ht), N._OrtReleaseTensor(nr);
12762
12821
  } }, "ml-tensor"]);
12763
12822
  } else if (en === "ml-tensor-cpu-output" && yr > 0) {
12764
- let Rt = N.webnnCreateMLTensorDownloader(Ht, kt)(), $t = sr.length;
12823
+ let Mt = N.webnnCreateMLTensorDownloader(Ht, At)(), $t = sr.length;
12765
12824
  kn = !0, Bs.push((async () => {
12766
- let ir = [$t, await Rt];
12825
+ let ir = [$t, await Mt];
12767
12826
  return N.webnnReleaseTensorId(Ht), N._OrtReleaseTensor(nr), ir;
12768
- })()), sr.push([kt, Dt, [], "cpu"]);
12827
+ })()), sr.push([At, Dt, [], "cpu"]);
12769
12828
  } else {
12770
- let Rt = _n(kt), $t = new Rt(yr);
12771
- new Uint8Array($t.buffer, $t.byteOffset, $t.byteLength).set(N.HEAPU8.subarray(Ht, Ht + $t.byteLength)), sr.push([kt, Dt, $t, "cpu"]);
12829
+ let Mt = _n(At), $t = new Mt(yr);
12830
+ new Uint8Array($t.buffer, $t.byteOffset, $t.byteLength).set(N.HEAPU8.subarray(Ht, Ht + $t.byteLength)), sr.push([At, Dt, $t, "cpu"]);
12772
12831
  }
12773
12832
  } finally {
12774
- N.stackRestore(fi), kt === "string" && Ht && N._free(Ht), kn || N._OrtReleaseTensor(nr);
12833
+ N.stackRestore(fi), At === "string" && Ht && N._free(Ht), kn || N._OrtReleaseTensor(nr);
12775
12834
  }
12776
12835
  }
12777
12836
  j && !Te && (N._OrtClearBoundOutputs(j.handle) !== 0 && ke("Can't clear bound outputs."), Cr.set(y, [Z, se, J, j, Te, !1]));
@@ -13473,21 +13532,21 @@ function Uw(c = {}) {
13473
13532
  try {
13474
13533
  const et = rt.createMediaStreamDestination();
13475
13534
  if (Ze.length > 0) {
13476
- const Ct = rt.createBuffer(1, Ze.length, Ni);
13477
- Ct.getChannelData(0).set(Ze);
13535
+ const kt = rt.createBuffer(1, Ze.length, Ni);
13536
+ kt.getChannelData(0).set(Ze);
13478
13537
  const ot = rt.createBufferSource();
13479
- ot.buffer = Ct, ot.connect(et), ot.start(0);
13538
+ ot.buffer = kt, ot.connect(et), ot.start(0);
13480
13539
  }
13481
13540
  const gt = rt.createMediaStreamSource(De);
13482
13541
  if (Q > 0) {
13483
- const Ct = rt.createDelay(Q + 0.1);
13484
- Ct.delayTime.value = Q, gt.connect(Ct).connect(et);
13542
+ const kt = rt.createDelay(Q + 0.1);
13543
+ kt.delayTime.value = Q, gt.connect(kt).connect(et);
13485
13544
  } else
13486
13545
  gt.connect(et);
13487
13546
  const qt = new MediaRecorder(et.stream, Ae ? { mimeType: Ae } : {});
13488
- qt.ondataavailable = async (Ct) => {
13489
- if (!Ct.data || Ct.data.size <= 0) return;
13490
- const ot = await Ct.data.arrayBuffer();
13547
+ qt.ondataavailable = async (kt) => {
13548
+ if (!kt.data || kt.data.size <= 0) return;
13549
+ const ot = await kt.data.arrayBuffer();
13491
13550
  r ? r(ot) : U(ot);
13492
13551
  }, Le.current = qt, qt.start(100);
13493
13552
  } catch (et) {
@@ -14110,10 +14169,10 @@ t=0 0\r
14110
14169
  }, c.exports = r;
14111
14170
  })(ho)), ho.exports;
14112
14171
  }
14113
- var Hp = Uy(), Er, It, Ui = { d: (c, r) => {
14172
+ var Hp = Uy(), Er, Ot, Ui = { d: (c, r) => {
14114
14173
  for (var n in r) Ui.o(r, n) && !Ui.o(c, n) && Object.defineProperty(c, n, { enumerable: !0, get: r[n] });
14115
14174
  }, o: (c, r) => Object.prototype.hasOwnProperty.call(c, r) }, be = {};
14116
- Ui.d(be, { Dz: () => im, g$: () => kf, Lt: () => Ef, Q9: () => Cf, qf: () => $o, hV: () => dm, z$: () => Pw, J0: () => Eo, De: () => aw, $C: () => Nn, al: () => Lf, _W: () => Bf, Gv: () => Jf, m: () => Zf, tz: () => Df, Nu: () => lm, zg: () => pm, vp: () => sm, vU: () => K, wF: () => jf, rv: () => am, Nh: () => om, ss: () => hm, qW: () => em, QL: () => Yf, cf: () => mm, eM: () => Hf, Yd: () => T, Tk: () => Se, iM: () => Tf, qy: () => Kr, ce: () => Xy, sK: () => ye, Ok: () => St, q5: () => um, g: () => Iw, xl: () => qf, I: () => Wf, bx: () => xo, dD: () => rm, Ib: () => ci, Az: () => Mt, Iw: () => Or, qY: () => To, db: () => xf, mR: () => ui, Tn: () => So, rV: () => Kf, gh: () => Uf, Mi: () => Ff, j: () => Vf, YB: () => Gf, Yt: () => Xf, i5: () => Qf, x_: () => Hr, Am: () => Co, eR: () => Rf, r8: () => Nf, u3: () => fm, vd: () => Mf, iV: () => Pf, jZ: () => If, SW: () => zf, ZH: () => Of, Ni: () => gm, lh: () => Af, ZP: () => nm, bq: () => $f, $f: () => ym, eu: () => tm, Ax: () => tw, Mc: () => ew });
14175
+ Ui.d(be, { Dz: () => im, g$: () => kf, Lt: () => Ef, Q9: () => Cf, qf: () => $o, hV: () => dm, z$: () => Pw, J0: () => Eo, De: () => aw, $C: () => Nn, al: () => Lf, _W: () => Bf, Gv: () => Jf, m: () => Zf, tz: () => Df, Nu: () => lm, zg: () => pm, vp: () => sm, vU: () => K, wF: () => jf, rv: () => am, Nh: () => om, ss: () => hm, qW: () => em, QL: () => Yf, cf: () => mm, eM: () => Hf, Yd: () => T, Tk: () => Se, iM: () => Tf, qy: () => Kr, ce: () => Xy, sK: () => ye, Ok: () => St, q5: () => um, g: () => Iw, xl: () => qf, I: () => Wf, bx: () => xo, dD: () => rm, Ib: () => ci, Az: () => Pt, Iw: () => Or, qY: () => To, db: () => xf, mR: () => ui, Tn: () => So, rV: () => Kf, gh: () => Uf, Mi: () => Ff, j: () => Vf, YB: () => Gf, Yt: () => Xf, i5: () => Qf, x_: () => Hr, Am: () => Co, eR: () => Rf, r8: () => Nf, u3: () => fm, vd: () => Mf, iV: () => Pf, jZ: () => If, SW: () => zf, ZH: () => Of, Ni: () => gm, lh: () => Af, ZP: () => nm, bq: () => $f, $f: () => ym, eu: () => tm, Ax: () => tw, Mc: () => ew });
14117
14176
  class T {
14118
14177
  static GetStackTrace() {
14119
14178
  const r = new Error();
@@ -14218,7 +14277,7 @@ class Qy {
14218
14277
  }
14219
14278
  (function(c) {
14220
14279
  c.CONFIG = "config", c.STREAMER_LIST = "streamerList", c.STREAMER_ID_CHANGED = "streamerIDChanged", c.PLAYER_COUNT = "playerCount", c.OFFER = "offer", c.ANSWER = "answer", c.ICE_CANDIDATE = "iceCandidate", c.PEER_DATA_CHANNELS = "peerDataChannels", c.PING = "ping", c.WARNING = "warning";
14221
- })(It || (It = {}));
14280
+ })(Ot || (Ot = {}));
14222
14281
  class Tf {
14223
14282
  }
14224
14283
  class Xy extends Tf {
@@ -14234,41 +14293,41 @@ class So {
14234
14293
  this.FromUEMessageHandlers.has(r) ? this.FromUEMessageHandlers.get(r)(n) : T.Error(T.GetStackTrace(), `Message type of ${r} does not have a message handler registered on the frontend - ignoring message.`);
14235
14294
  }
14236
14295
  static setupDefaultHandlers(r) {
14237
- r.signallingProtocol.addMessageHandler(It.PING, ((n) => {
14296
+ r.signallingProtocol.addMessageHandler(Ot.PING, ((n) => {
14238
14297
  const a = new qy((/* @__PURE__ */ new Date()).getTime()).payload();
14239
- T.Log(T.GetStackTrace(), It.PING + ": " + n, 6), r.webSocket.send(a);
14240
- })), r.signallingProtocol.addMessageHandler(It.CONFIG, ((n) => {
14241
- T.Log(T.GetStackTrace(), It.CONFIG, 6);
14298
+ T.Log(T.GetStackTrace(), Ot.PING + ": " + n, 6), r.webSocket.send(a);
14299
+ })), r.signallingProtocol.addMessageHandler(Ot.CONFIG, ((n) => {
14300
+ T.Log(T.GetStackTrace(), Ot.CONFIG, 6);
14242
14301
  const a = JSON.parse(n);
14243
14302
  r.onConfig(a);
14244
- })), r.signallingProtocol.addMessageHandler(It.STREAMER_LIST, ((n) => {
14245
- T.Log(T.GetStackTrace(), It.STREAMER_LIST, 6);
14303
+ })), r.signallingProtocol.addMessageHandler(Ot.STREAMER_LIST, ((n) => {
14304
+ T.Log(T.GetStackTrace(), Ot.STREAMER_LIST, 6);
14246
14305
  const a = JSON.parse(n);
14247
14306
  r.onStreamerList(a);
14248
- })), r.signallingProtocol.addMessageHandler(It.STREAMER_ID_CHANGED, ((n) => {
14249
- T.Log(T.GetStackTrace(), It.STREAMER_ID_CHANGED, 6);
14307
+ })), r.signallingProtocol.addMessageHandler(Ot.STREAMER_ID_CHANGED, ((n) => {
14308
+ T.Log(T.GetStackTrace(), Ot.STREAMER_ID_CHANGED, 6);
14250
14309
  const a = JSON.parse(n);
14251
14310
  r.onStreamerIDChanged(a);
14252
- })), r.signallingProtocol.addMessageHandler(It.PLAYER_COUNT, ((n) => {
14253
- T.Log(T.GetStackTrace(), It.PLAYER_COUNT, 6);
14311
+ })), r.signallingProtocol.addMessageHandler(Ot.PLAYER_COUNT, ((n) => {
14312
+ T.Log(T.GetStackTrace(), Ot.PLAYER_COUNT, 6);
14254
14313
  const a = JSON.parse(n);
14255
14314
  T.Log(T.GetStackTrace(), "Player Count: " + a.count, 6), r.onPlayerCount(a);
14256
- })), r.signallingProtocol.addMessageHandler(It.ANSWER, ((n) => {
14257
- T.Log(T.GetStackTrace(), It.ANSWER, 6);
14315
+ })), r.signallingProtocol.addMessageHandler(Ot.ANSWER, ((n) => {
14316
+ T.Log(T.GetStackTrace(), Ot.ANSWER, 6);
14258
14317
  const a = JSON.parse(n);
14259
14318
  r.onWebRtcAnswer(a);
14260
- })), r.signallingProtocol.addMessageHandler(It.OFFER, ((n) => {
14261
- T.Log(T.GetStackTrace(), It.OFFER, 6);
14319
+ })), r.signallingProtocol.addMessageHandler(Ot.OFFER, ((n) => {
14320
+ T.Log(T.GetStackTrace(), Ot.OFFER, 6);
14262
14321
  const a = JSON.parse(n);
14263
14322
  r.onWebRtcOffer(a);
14264
- })), r.signallingProtocol.addMessageHandler(It.ICE_CANDIDATE, ((n) => {
14265
- T.Log(T.GetStackTrace(), It.ICE_CANDIDATE, 6);
14323
+ })), r.signallingProtocol.addMessageHandler(Ot.ICE_CANDIDATE, ((n) => {
14324
+ T.Log(T.GetStackTrace(), Ot.ICE_CANDIDATE, 6);
14266
14325
  const a = JSON.parse(n);
14267
14326
  r.onIceCandidate(a.candidate);
14268
- })), r.signallingProtocol.addMessageHandler(It.WARNING, ((n) => {
14327
+ })), r.signallingProtocol.addMessageHandler(Ot.WARNING, ((n) => {
14269
14328
  T.Warning(T.GetStackTrace(), `Warning received: ${n}`);
14270
- })), r.signallingProtocol.addMessageHandler(It.PEER_DATA_CHANNELS, ((n) => {
14271
- T.Log(T.GetStackTrace(), It.PEER_DATA_CHANNELS, 6);
14329
+ })), r.signallingProtocol.addMessageHandler(Ot.PEER_DATA_CHANNELS, ((n) => {
14330
+ T.Log(T.GetStackTrace(), Ot.PEER_DATA_CHANNELS, 6);
14272
14331
  const a = JSON.parse(n);
14273
14332
  r.onWebRtcPeerDataChannels(a);
14274
14333
  }));
@@ -14448,7 +14507,7 @@ class ci {
14448
14507
  this._value = r, this.onChange(this._value, this), this.onChangeEmit(this._value);
14449
14508
  }
14450
14509
  }
14451
- class Mt extends ci {
14510
+ class Pt extends ci {
14452
14511
  constructor(r, n, a, f, v, C = (() => {
14453
14512
  })) {
14454
14513
  super(r, n, a, f, C);
@@ -14809,9 +14868,9 @@ class aw {
14809
14868
  const C = v.mimeType.split("/")[1] + " " + (v.sdpFmtpLine || "");
14810
14869
  f.exec(C) !== null && a.push(C);
14811
14870
  })), a;
14812
- })(), r)), this.flags.set(K.AutoConnect, new Mt(K.AutoConnect, "Auto connect to stream", "Whether we should attempt to auto connect to the signalling server or show a click to start prompt.", !(!n || !n.hasOwnProperty(K.AutoConnect)) && n[K.AutoConnect], r)), this.flags.set(K.AutoPlayVideo, new Mt(K.AutoPlayVideo, "Auto play video", "When video is ready automatically start playing it as opposed to showing a play button.", !n || !n.hasOwnProperty(K.AutoPlayVideo) || n[K.AutoPlayVideo], r)), this.flags.set(K.BrowserSendOffer, new Mt(K.BrowserSendOffer, "Browser send offer", "Browser will initiate the WebRTC handshake by sending the offer to the streamer", !(!n || !n.hasOwnProperty(K.BrowserSendOffer)) && n[K.BrowserSendOffer], r)), this.flags.set(K.UseMic, new Mt(K.UseMic, "Use microphone", "Make browser request microphone access and open an input audio track.", !(!n || !n.hasOwnProperty(K.UseMic)) && n[K.UseMic], r)), this.flags.set(K.StartVideoMuted, new Mt(K.StartVideoMuted, "Start video muted", "Video will start muted if true.", !(!n || !n.hasOwnProperty(K.StartVideoMuted)) && n[K.StartVideoMuted], r)), this.flags.set(K.SuppressBrowserKeys, new Mt(K.SuppressBrowserKeys, "Suppress browser keys", "Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.", !n || !n.hasOwnProperty(K.SuppressBrowserKeys) || n[K.SuppressBrowserKeys], r)), this.flags.set(K.IsQualityController, new Mt(K.IsQualityController, "Is quality controller?", "True if this peer controls stream quality", !n || !n.hasOwnProperty(K.IsQualityController) || n[K.IsQualityController], r)), this.flags.set(K.ForceMonoAudio, new Mt(K.ForceMonoAudio, "Force mono audio", "Force browser to request mono audio in the SDP", !(!n || !n.hasOwnProperty(K.ForceMonoAudio)) && n[K.ForceMonoAudio], r)), this.flags.set(K.ForceTURN, new Mt(K.ForceTURN, "Force TURN", "Only generate TURN/Relayed ICE candidates.", !(!n || !n.hasOwnProperty(K.ForceTURN)) && n[K.ForceTURN], r)), this.flags.set(K.AFKDetection, new Mt(K.AFKDetection, "AFK if idle", "Timeout the experience if user is AFK for a period.", !(!n || !n.hasOwnProperty(K.AFKDetection)) && n[K.AFKDetection], r)), this.flags.set(K.MatchViewportResolution, new Mt(K.MatchViewportResolution, "Match viewport resolution", "Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.", !(!n || !n.hasOwnProperty(K.MatchViewportResolution)) && n[K.MatchViewportResolution], r)), this.flags.set(K.HoveringMouseMode, new Mt(K.HoveringMouseMode, "Control Scheme: Locked Mouse", "Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.", !(!n || !n.hasOwnProperty(K.HoveringMouseMode)) && n[K.HoveringMouseMode], r, ((a, f) => {
14871
+ })(), r)), this.flags.set(K.AutoConnect, new Pt(K.AutoConnect, "Auto connect to stream", "Whether we should attempt to auto connect to the signalling server or show a click to start prompt.", !(!n || !n.hasOwnProperty(K.AutoConnect)) && n[K.AutoConnect], r)), this.flags.set(K.AutoPlayVideo, new Pt(K.AutoPlayVideo, "Auto play video", "When video is ready automatically start playing it as opposed to showing a play button.", !n || !n.hasOwnProperty(K.AutoPlayVideo) || n[K.AutoPlayVideo], r)), this.flags.set(K.BrowserSendOffer, new Pt(K.BrowserSendOffer, "Browser send offer", "Browser will initiate the WebRTC handshake by sending the offer to the streamer", !(!n || !n.hasOwnProperty(K.BrowserSendOffer)) && n[K.BrowserSendOffer], r)), this.flags.set(K.UseMic, new Pt(K.UseMic, "Use microphone", "Make browser request microphone access and open an input audio track.", !(!n || !n.hasOwnProperty(K.UseMic)) && n[K.UseMic], r)), this.flags.set(K.StartVideoMuted, new Pt(K.StartVideoMuted, "Start video muted", "Video will start muted if true.", !(!n || !n.hasOwnProperty(K.StartVideoMuted)) && n[K.StartVideoMuted], r)), this.flags.set(K.SuppressBrowserKeys, new Pt(K.SuppressBrowserKeys, "Suppress browser keys", "Suppress certain browser keys that we use in UE, for example F5 to show shader complexity instead of refresh the page.", !n || !n.hasOwnProperty(K.SuppressBrowserKeys) || n[K.SuppressBrowserKeys], r)), this.flags.set(K.IsQualityController, new Pt(K.IsQualityController, "Is quality controller?", "True if this peer controls stream quality", !n || !n.hasOwnProperty(K.IsQualityController) || n[K.IsQualityController], r)), this.flags.set(K.ForceMonoAudio, new Pt(K.ForceMonoAudio, "Force mono audio", "Force browser to request mono audio in the SDP", !(!n || !n.hasOwnProperty(K.ForceMonoAudio)) && n[K.ForceMonoAudio], r)), this.flags.set(K.ForceTURN, new Pt(K.ForceTURN, "Force TURN", "Only generate TURN/Relayed ICE candidates.", !(!n || !n.hasOwnProperty(K.ForceTURN)) && n[K.ForceTURN], r)), this.flags.set(K.AFKDetection, new Pt(K.AFKDetection, "AFK if idle", "Timeout the experience if user is AFK for a period.", !(!n || !n.hasOwnProperty(K.AFKDetection)) && n[K.AFKDetection], r)), this.flags.set(K.MatchViewportResolution, new Pt(K.MatchViewportResolution, "Match viewport resolution", "Pixel Streaming will be instructed to dynamically resize the video stream to match the size of the video element.", !(!n || !n.hasOwnProperty(K.MatchViewportResolution)) && n[K.MatchViewportResolution], r)), this.flags.set(K.HoveringMouseMode, new Pt(K.HoveringMouseMode, "Control Scheme: Locked Mouse", "Either locked mouse, where the pointer is consumed by the video and locked to it, or hovering mouse, where the mouse is not consumed.", !(!n || !n.hasOwnProperty(K.HoveringMouseMode)) && n[K.HoveringMouseMode], r, ((a, f) => {
14813
14872
  f.label = `Control Scheme: ${a ? "Hovering" : "Locked"} Mouse`;
14814
- }))), this.flags.set(K.FakeMouseWithTouches, new Mt(K.FakeMouseWithTouches, "Fake mouse with touches", "A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.", !(!n || !n.hasOwnProperty(K.FakeMouseWithTouches)) && n[K.FakeMouseWithTouches], r)), this.flags.set(K.KeyboardInput, new Mt(K.KeyboardInput, "Keyboard input", "If enabled, send keyboard events to streamer", !n || !n.hasOwnProperty(K.KeyboardInput) || n[K.KeyboardInput], r)), this.flags.set(K.MouseInput, new Mt(K.MouseInput, "Mouse input", "If enabled, send mouse events to streamer", !n || !n.hasOwnProperty(K.MouseInput) || n[K.MouseInput], r)), this.flags.set(K.TouchInput, new Mt(K.TouchInput, "Touch input", "If enabled, send touch events to streamer", !n || !n.hasOwnProperty(K.TouchInput) || n[K.TouchInput], r)), this.flags.set(K.GamepadInput, new Mt(K.GamepadInput, "Gamepad input", "If enabled, send gamepad events to streamer", !n || !n.hasOwnProperty(K.GamepadInput) || n[K.GamepadInput], r)), this.flags.set(K.XRControllerInput, new Mt(K.XRControllerInput, "XR controller input", "If enabled, send XR controller events to streamer", !n || !n.hasOwnProperty(K.XRControllerInput) || n[K.XRControllerInput], r)), this.flags.set(K.WaitForStreamer, new Mt(K.WaitForStreamer, "Wait for streamer", "Will continue trying to connect to the first streamer available.", !n || !n.hasOwnProperty(K.WaitForStreamer) || n[K.WaitForStreamer], r)), this.flags.set(K.HideUI, new Mt(K.HideUI, "Hide the UI overlay", "Will hide all UI overlay details", !(!n || !n.hasOwnProperty(K.HideUI)) && n[K.HideUI], r)), this.numericParameters.set(ye.AFKTimeoutSecs, new Or(ye.AFKTimeoutSecs, "AFK timeout", "The time (in seconds) it takes for the application to time out if AFK timeout is enabled.", 0, null, n && n.hasOwnProperty(ye.AFKTimeoutSecs) ? n[ye.AFKTimeoutSecs] : 120, r)), this.numericParameters.set(ye.AFKCountdownSecs, new Or(ye.AFKCountdownSecs, "AFK countdown", "The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.", 10, null, 10, r)), this.numericParameters.set(ye.MaxReconnectAttempts, new Or(ye.MaxReconnectAttempts, "Max Reconnects", "Maximum number of reconnects the application will attempt when a streamer disconnects.", 0, 999, n && n.hasOwnProperty(ye.MaxReconnectAttempts) ? n[ye.MaxReconnectAttempts] : 3, r)), this.numericParameters.set(ye.MinQP, new Or(ye.MinQP, "Min QP", "The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.", 0, 51, n && n.hasOwnProperty(ye.MinQP) ? n[ye.MinQP] : 0, r)), this.numericParameters.set(ye.MaxQP, new Or(ye.MaxQP, "Max QP", "The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.", 0, 51, n && n.hasOwnProperty(ye.MaxQP) ? n[ye.MaxQP] : 51, r)), this.numericParameters.set(ye.WebRTCFPS, new Or(ye.WebRTCFPS, "Max FPS", "The maximum FPS that WebRTC will try to transmit frames at.", 1, 999, n && n.hasOwnProperty(ye.WebRTCFPS) ? n[ye.WebRTCFPS] : 60, r)), this.numericParameters.set(ye.WebRTCMinBitrate, new Or(ye.WebRTCMinBitrate, "Min Bitrate (kbps)", "The minimum bitrate that WebRTC should use.", 0, 5e5, n && n.hasOwnProperty(ye.WebRTCMinBitrate) ? n[ye.WebRTCMinBitrate] : 0, r)), this.numericParameters.set(ye.WebRTCMaxBitrate, new Or(ye.WebRTCMaxBitrate, "Max Bitrate (kbps)", "The maximum bitrate that WebRTC should use.", 0, 5e5, n && n.hasOwnProperty(ye.WebRTCMaxBitrate) ? n[ye.WebRTCMaxBitrate] : 0, r)), this.numericParameters.set(ye.StreamerAutoJoinInterval, new Or(ye.StreamerAutoJoinInterval, "Streamer Auto Join Interval (ms)", "Delay between retries when waiting for an available streamer.", 500, 9e5, n && n.hasOwnProperty(ye.StreamerAutoJoinInterval) ? n[ye.StreamerAutoJoinInterval] : 3e3, r));
14873
+ }))), this.flags.set(K.FakeMouseWithTouches, new Pt(K.FakeMouseWithTouches, "Fake mouse with touches", "A single finger touch is converted into a mouse event. This allows a non-touch application to be controlled partially via a touch device.", !(!n || !n.hasOwnProperty(K.FakeMouseWithTouches)) && n[K.FakeMouseWithTouches], r)), this.flags.set(K.KeyboardInput, new Pt(K.KeyboardInput, "Keyboard input", "If enabled, send keyboard events to streamer", !n || !n.hasOwnProperty(K.KeyboardInput) || n[K.KeyboardInput], r)), this.flags.set(K.MouseInput, new Pt(K.MouseInput, "Mouse input", "If enabled, send mouse events to streamer", !n || !n.hasOwnProperty(K.MouseInput) || n[K.MouseInput], r)), this.flags.set(K.TouchInput, new Pt(K.TouchInput, "Touch input", "If enabled, send touch events to streamer", !n || !n.hasOwnProperty(K.TouchInput) || n[K.TouchInput], r)), this.flags.set(K.GamepadInput, new Pt(K.GamepadInput, "Gamepad input", "If enabled, send gamepad events to streamer", !n || !n.hasOwnProperty(K.GamepadInput) || n[K.GamepadInput], r)), this.flags.set(K.XRControllerInput, new Pt(K.XRControllerInput, "XR controller input", "If enabled, send XR controller events to streamer", !n || !n.hasOwnProperty(K.XRControllerInput) || n[K.XRControllerInput], r)), this.flags.set(K.WaitForStreamer, new Pt(K.WaitForStreamer, "Wait for streamer", "Will continue trying to connect to the first streamer available.", !n || !n.hasOwnProperty(K.WaitForStreamer) || n[K.WaitForStreamer], r)), this.flags.set(K.HideUI, new Pt(K.HideUI, "Hide the UI overlay", "Will hide all UI overlay details", !(!n || !n.hasOwnProperty(K.HideUI)) && n[K.HideUI], r)), this.numericParameters.set(ye.AFKTimeoutSecs, new Or(ye.AFKTimeoutSecs, "AFK timeout", "The time (in seconds) it takes for the application to time out if AFK timeout is enabled.", 0, null, n && n.hasOwnProperty(ye.AFKTimeoutSecs) ? n[ye.AFKTimeoutSecs] : 120, r)), this.numericParameters.set(ye.AFKCountdownSecs, new Or(ye.AFKCountdownSecs, "AFK countdown", "The time (in seconds) for a user to respond before the stream is ended after an AFK timeout.", 10, null, 10, r)), this.numericParameters.set(ye.MaxReconnectAttempts, new Or(ye.MaxReconnectAttempts, "Max Reconnects", "Maximum number of reconnects the application will attempt when a streamer disconnects.", 0, 999, n && n.hasOwnProperty(ye.MaxReconnectAttempts) ? n[ye.MaxReconnectAttempts] : 3, r)), this.numericParameters.set(ye.MinQP, new Or(ye.MinQP, "Min QP", "The lower bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.", 0, 51, n && n.hasOwnProperty(ye.MinQP) ? n[ye.MinQP] : 0, r)), this.numericParameters.set(ye.MaxQP, new Or(ye.MaxQP, "Max QP", "The upper bound for the quantization parameter (QP) of the encoder. 0 = Best quality, 51 = worst quality.", 0, 51, n && n.hasOwnProperty(ye.MaxQP) ? n[ye.MaxQP] : 51, r)), this.numericParameters.set(ye.WebRTCFPS, new Or(ye.WebRTCFPS, "Max FPS", "The maximum FPS that WebRTC will try to transmit frames at.", 1, 999, n && n.hasOwnProperty(ye.WebRTCFPS) ? n[ye.WebRTCFPS] : 60, r)), this.numericParameters.set(ye.WebRTCMinBitrate, new Or(ye.WebRTCMinBitrate, "Min Bitrate (kbps)", "The minimum bitrate that WebRTC should use.", 0, 5e5, n && n.hasOwnProperty(ye.WebRTCMinBitrate) ? n[ye.WebRTCMinBitrate] : 0, r)), this.numericParameters.set(ye.WebRTCMaxBitrate, new Or(ye.WebRTCMaxBitrate, "Max Bitrate (kbps)", "The maximum bitrate that WebRTC should use.", 0, 5e5, n && n.hasOwnProperty(ye.WebRTCMaxBitrate) ? n[ye.WebRTCMaxBitrate] : 0, r)), this.numericParameters.set(ye.StreamerAutoJoinInterval, new Or(ye.StreamerAutoJoinInterval, "Streamer Auto Join Interval (ms)", "Delay between retries when waiting for an available streamer.", 500, 9e5, n && n.hasOwnProperty(ye.StreamerAutoJoinInterval) ? n[ye.StreamerAutoJoinInterval] : 3e3, r));
14815
14874
  }
14816
14875
  _addOnNumericSettingChangedListener(r, n) {
14817
14876
  this.numericParameters.has(r) && this.numericParameters.get(r).addOnChangedListener(n);