hanc-webrtc-widgets 2.5.0 → 2.5.1
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.
- package/dist/hanc-webrtc-widgets.es.js +911 -827
- package/dist/hanc-webrtc-widgets.umd.js +76 -76
- package/dist/src/components/floating-call/floating-call.d.ts +3 -0
- package/dist/src/components/inline-call/inline-call.d.ts +3 -0
- package/dist/src/components/pill-call/pill-call.d.ts +3 -0
- package/dist/src/components/pill-floating-call/pill-floating-call.d.ts +3 -0
- package/package.json +1 -1
|
@@ -578,7 +578,7 @@ const hD = { attribute: !0, type: String, converter: ds, reflect: !1, hasChanged
|
|
|
578
578
|
}
|
|
579
579
|
throw Error("Unsupported decorator location: " + t);
|
|
580
580
|
};
|
|
581
|
-
function
|
|
581
|
+
function Z(i) {
|
|
582
582
|
return (A, e) => typeof e == "object" ? lD(i, A, e) : ((t, g, o) => {
|
|
583
583
|
const n = g.hasOwnProperty(o);
|
|
584
584
|
return g.constructor.createProperty(o, n ? { ...t, wrapped: !0 } : t), n ? Object.getOwnPropertyDescriptor(g, o) : void 0;
|
|
@@ -590,7 +590,7 @@ function z(i) {
|
|
|
590
590
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
591
591
|
*/
|
|
592
592
|
function Ge(i) {
|
|
593
|
-
return
|
|
593
|
+
return Z({ ...i, state: !0, attribute: !1 });
|
|
594
594
|
}
|
|
595
595
|
/**
|
|
596
596
|
* @license
|
|
@@ -3533,7 +3533,7 @@ const up = /* @__PURE__ */ q.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
3533
3533
|
no: 1,
|
|
3534
3534
|
name: "kind",
|
|
3535
3535
|
kind: "enum",
|
|
3536
|
-
T: q.getEnumType(
|
|
3536
|
+
T: q.getEnumType(ee)
|
|
3537
3537
|
}, {
|
|
3538
3538
|
no: 4,
|
|
3539
3539
|
name: "participant_identity",
|
|
@@ -3630,7 +3630,7 @@ const up = /* @__PURE__ */ q.makeMessageType("livekit.MetricsBatch", () => [{
|
|
|
3630
3630
|
kind: "scalar",
|
|
3631
3631
|
T: 9
|
|
3632
3632
|
/* ScalarType.STRING */
|
|
3633
|
-
}]),
|
|
3633
|
+
}]), ee = /* @__PURE__ */ q.makeEnum("livekit.DataPacket.Kind", [{
|
|
3634
3634
|
no: 0,
|
|
3635
3635
|
name: "RELIABLE"
|
|
3636
3636
|
}, {
|
|
@@ -5546,12 +5546,12 @@ var bi;
|
|
|
5546
5546
|
(function(i) {
|
|
5547
5547
|
i.Default = "livekit", i.Room = "livekit-room", i.Participant = "livekit-participant", i.Track = "livekit-track", i.Publication = "livekit-track-publication", i.Engine = "livekit-engine", i.Signal = "livekit-signal", i.PCManager = "livekit-pc-manager", i.PCTransport = "livekit-pc-transport", i.E2EE = "lk-e2ee";
|
|
5548
5548
|
})(bi || (bi = {}));
|
|
5549
|
-
let
|
|
5549
|
+
let re = Vs.getLogger("livekit");
|
|
5550
5550
|
Object.values(bi).map((i) => Vs.getLogger(i));
|
|
5551
|
-
|
|
5551
|
+
re.setDefaultLevel(jr.info);
|
|
5552
5552
|
function yg(i) {
|
|
5553
5553
|
const A = Vs.getLogger(i);
|
|
5554
|
-
return A.setDefaultLevel(
|
|
5554
|
+
return A.setDefaultLevel(re.getLevel()), A;
|
|
5555
5555
|
}
|
|
5556
5556
|
const ow = Vs.getLogger("lk-e2ee"), $n = 7e3, nw = [0, 300, 2 * 2 * 300, 3 * 3 * 300, 4 * 4 * 300, $n, $n, $n, $n, $n];
|
|
5557
5557
|
class Iw {
|
|
@@ -7391,7 +7391,7 @@ class gv extends eg.EventEmitter {
|
|
|
7391
7391
|
constructor() {
|
|
7392
7392
|
let A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
7393
7393
|
super(), this.onKeyRatcheted = (e, t, g) => {
|
|
7394
|
-
|
|
7394
|
+
re.debug("key ratcheted event received", {
|
|
7395
7395
|
ratchetResult: e,
|
|
7396
7396
|
participantId: t,
|
|
7397
7397
|
keyIndex: g
|
|
@@ -7429,13 +7429,13 @@ class Gg extends Error {
|
|
|
7429
7429
|
super(e || "an error has occured"), this.name = "LiveKitError", this.code = A;
|
|
7430
7430
|
}
|
|
7431
7431
|
}
|
|
7432
|
-
var
|
|
7432
|
+
var Be;
|
|
7433
7433
|
(function(i) {
|
|
7434
7434
|
i[i.NotAllowed = 0] = "NotAllowed", i[i.ServerUnreachable = 1] = "ServerUnreachable", i[i.InternalError = 2] = "InternalError", i[i.Cancelled = 3] = "Cancelled", i[i.LeaveRequest = 4] = "LeaveRequest", i[i.Timeout = 5] = "Timeout";
|
|
7435
|
-
})(
|
|
7435
|
+
})(Be || (Be = {}));
|
|
7436
7436
|
class Le extends Gg {
|
|
7437
7437
|
constructor(A, e, t, g) {
|
|
7438
|
-
super(1, A), this.name = "ConnectionError", this.status = t, this.reason = e, this.context = g, this.reasonName =
|
|
7438
|
+
super(1, A), this.name = "ConnectionError", this.status = t, this.reason = e, this.context = g, this.reasonName = Be[e];
|
|
7439
7439
|
}
|
|
7440
7440
|
}
|
|
7441
7441
|
class tE extends Gg {
|
|
@@ -7615,13 +7615,13 @@ class tA extends eg.EventEmitter {
|
|
|
7615
7615
|
constructor(A, e) {
|
|
7616
7616
|
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
7617
7617
|
var g;
|
|
7618
|
-
super(), this.attachedElements = [], this.isMuted = !1, this._streamState = tA.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log =
|
|
7618
|
+
super(), this.attachedElements = [], this.isMuted = !1, this._streamState = tA.StreamState.Active, this.isInBackground = !1, this._currentBitrate = 0, this.log = re, this.appVisibilityChangedListener = () => {
|
|
7619
7619
|
this.backgroundTimeout && clearTimeout(this.backgroundTimeout), document.visibilityState === "hidden" ? this.backgroundTimeout = setTimeout(() => this.handleAppVisibilityChanged(), Rw) : this.handleAppVisibilityChanged();
|
|
7620
7620
|
}, this.log = yg((g = t.loggerName) !== null && g !== void 0 ? g : bi.Track), this.loggerContextCb = t.loggerContextCb, this.setMaxListeners(100), this.kind = e, this._mediaStreamTrack = A, this._mediaStreamID = A.id, this.source = tA.Source.Unknown;
|
|
7621
7621
|
}
|
|
7622
7622
|
get logContext() {
|
|
7623
7623
|
var A;
|
|
7624
|
-
return Object.assign(Object.assign({}, (A = this.loggerContextCb) === null || A === void 0 ? void 0 : A.call(this)),
|
|
7624
|
+
return Object.assign(Object.assign({}, (A = this.loggerContextCb) === null || A === void 0 ? void 0 : A.call(this)), Ie(this));
|
|
7625
7625
|
}
|
|
7626
7626
|
/** current receive bits per second */
|
|
7627
7627
|
get currentBitrate() {
|
|
@@ -7647,7 +7647,7 @@ class tA extends eg.EventEmitter {
|
|
|
7647
7647
|
return A.play().then(() => {
|
|
7648
7648
|
this.emit(g ? CA.AudioPlaybackStarted : CA.VideoPlaybackStarted);
|
|
7649
7649
|
}).catch((o) => {
|
|
7650
|
-
o.name === "NotAllowedError" ? this.emit(g ? CA.AudioPlaybackFailed : CA.VideoPlaybackFailed, o) : o.name === "AbortError" ?
|
|
7650
|
+
o.name === "NotAllowedError" ? this.emit(g ? CA.AudioPlaybackFailed : CA.VideoPlaybackFailed, o) : o.name === "AbortError" ? re.debug("".concat(g ? "audio" : "video", " playback aborted, likely due to new play request")) : re.warn("could not playback ".concat(g ? "audio" : "video"), o), g && A && t.some((n) => n.kind === "video") && o.name === "NotAllowedError" && (A.muted = !0, A.play().catch(() => {
|
|
7651
7651
|
}));
|
|
7652
7652
|
}), this.emit(CA.ElementAttached, A), A;
|
|
7653
7653
|
}
|
|
@@ -8127,13 +8127,13 @@ function jw(i) {
|
|
|
8127
8127
|
}
|
|
8128
8128
|
function O0(i) {
|
|
8129
8129
|
switch (i.reason) {
|
|
8130
|
-
case
|
|
8130
|
+
case Be.LeaveRequest:
|
|
8131
8131
|
return i.context;
|
|
8132
|
-
case
|
|
8132
|
+
case Be.Cancelled:
|
|
8133
8133
|
return Si.CLIENT_INITIATED;
|
|
8134
|
-
case
|
|
8134
|
+
case Be.NotAllowed:
|
|
8135
8135
|
return Si.USER_REJECTED;
|
|
8136
|
-
case
|
|
8136
|
+
case Be.ServerUnreachable:
|
|
8137
8137
|
return Si.JOIN_FAILURE;
|
|
8138
8138
|
default:
|
|
8139
8139
|
return Si.UNKNOWN_REASON;
|
|
@@ -8328,7 +8328,7 @@ function Am(i) {
|
|
|
8328
8328
|
}));
|
|
8329
8329
|
}), A;
|
|
8330
8330
|
}
|
|
8331
|
-
function
|
|
8331
|
+
function Ie(i) {
|
|
8332
8332
|
return "mediaStreamTrack" in i ? {
|
|
8333
8333
|
trackID: i.sid,
|
|
8334
8334
|
source: i.source,
|
|
@@ -8347,7 +8347,7 @@ function te(i) {
|
|
|
8347
8347
|
encrypted: i.isEncrypted,
|
|
8348
8348
|
kind: i.kind,
|
|
8349
8349
|
source: i.source
|
|
8350
|
-
}, i.track ?
|
|
8350
|
+
}, i.track ? Ie(i.track) : {})
|
|
8351
8351
|
};
|
|
8352
8352
|
}
|
|
8353
8353
|
function em() {
|
|
@@ -8405,7 +8405,7 @@ class om extends eg.EventEmitter {
|
|
|
8405
8405
|
} = e.data;
|
|
8406
8406
|
switch (o) {
|
|
8407
8407
|
case "error":
|
|
8408
|
-
|
|
8408
|
+
re.error(n.error.message), this.emit(Xg.EncryptionError, n.error);
|
|
8409
8409
|
break;
|
|
8410
8410
|
case "initAck":
|
|
8411
8411
|
n.enabled && this.keyProvider.getKeys().forEach((I) => {
|
|
@@ -8429,7 +8429,7 @@ class om extends eg.EventEmitter {
|
|
|
8429
8429
|
break;
|
|
8430
8430
|
}
|
|
8431
8431
|
}, this.onWorkerError = (e) => {
|
|
8432
|
-
|
|
8432
|
+
re.error("e2ee worker encountered an error:", {
|
|
8433
8433
|
error: e.error
|
|
8434
8434
|
}), this.emit(Xg.EncryptionError, e.error);
|
|
8435
8435
|
}, this.keyProvider = A.keyProvider, this.worker = A.worker, this.encryptionEnabled = !1;
|
|
@@ -8440,7 +8440,7 @@ class om extends eg.EventEmitter {
|
|
|
8440
8440
|
setup(A) {
|
|
8441
8441
|
if (!fw())
|
|
8442
8442
|
throw new tE("tried to setup end-to-end encryption on an unsupported browser");
|
|
8443
|
-
if (
|
|
8443
|
+
if (re.info("setting up e2ee"), A !== this.room) {
|
|
8444
8444
|
this.room = A, this.setupEventListeners(A, this.keyProvider);
|
|
8445
8445
|
const e = {
|
|
8446
8446
|
kind: "init",
|
|
@@ -8449,7 +8449,7 @@ class om extends eg.EventEmitter {
|
|
|
8449
8449
|
loglevel: ow.getLevel()
|
|
8450
8450
|
}
|
|
8451
8451
|
};
|
|
8452
|
-
this.worker && (
|
|
8452
|
+
this.worker && (re.info("initializing worker", {
|
|
8453
8453
|
worker: this.worker
|
|
8454
8454
|
}), this.worker.onmessage = this.onWorkerMessage, this.worker.onerror = this.onWorkerError, this.worker.postMessage(e));
|
|
8455
8455
|
}
|
|
@@ -8458,13 +8458,13 @@ class om extends eg.EventEmitter {
|
|
|
8458
8458
|
* @internal
|
|
8459
8459
|
*/
|
|
8460
8460
|
setParticipantCryptorEnabled(A, e) {
|
|
8461
|
-
|
|
8461
|
+
re.debug("set e2ee to ".concat(A, " for participant ").concat(e)), this.postEnable(A, e);
|
|
8462
8462
|
}
|
|
8463
8463
|
/**
|
|
8464
8464
|
* @internal
|
|
8465
8465
|
*/
|
|
8466
8466
|
setSifTrailer(A) {
|
|
8467
|
-
!A || A.length === 0 ?
|
|
8467
|
+
!A || A.length === 0 ? re.warn("ignoring server sent trailer as it's empty") : this.postSifTrailer(A);
|
|
8468
8468
|
}
|
|
8469
8469
|
setupEngine(A) {
|
|
8470
8470
|
A.on(BA.RTPVideoMapUpdate, (e) => {
|
|
@@ -8592,7 +8592,7 @@ class om extends eg.EventEmitter {
|
|
|
8592
8592
|
}
|
|
8593
8593
|
setupE2EESender(A, e) {
|
|
8594
8594
|
if (!mn(A) || !e) {
|
|
8595
|
-
e ||
|
|
8595
|
+
e || re.warn("early return because sender is not ready");
|
|
8596
8596
|
return;
|
|
8597
8597
|
}
|
|
8598
8598
|
this.handleSender(e, A.mediaStreamID, void 0);
|
|
@@ -8659,7 +8659,7 @@ class om extends eg.EventEmitter {
|
|
|
8659
8659
|
if (!(!((g = this.room) === null || g === void 0) && g.localParticipant.identity) || this.room.localParticipant.identity === "")
|
|
8660
8660
|
throw TypeError("local identity needs to be known in order to set up encrypted sender");
|
|
8661
8661
|
if (eQ()) {
|
|
8662
|
-
|
|
8662
|
+
re.info("initialize script transform");
|
|
8663
8663
|
const o = {
|
|
8664
8664
|
kind: "encode",
|
|
8665
8665
|
participantIdentity: this.room.localParticipant.identity,
|
|
@@ -8668,7 +8668,7 @@ class om extends eg.EventEmitter {
|
|
|
8668
8668
|
};
|
|
8669
8669
|
A.transform = new RTCRtpScriptTransform(this.worker, o);
|
|
8670
8670
|
} else {
|
|
8671
|
-
|
|
8671
|
+
re.info("initialize encoded streams");
|
|
8672
8672
|
const o = A.createEncodedStreams(), n = {
|
|
8673
8673
|
kind: "encode",
|
|
8674
8674
|
data: {
|
|
@@ -8704,11 +8704,11 @@ class ut {
|
|
|
8704
8704
|
return function* () {
|
|
8705
8705
|
var o;
|
|
8706
8706
|
if (((o = ut.userMediaPromiseMap) === null || o === void 0 ? void 0 : o.size) > 0) {
|
|
8707
|
-
|
|
8707
|
+
re.debug("awaiting getUserMedia promise");
|
|
8708
8708
|
try {
|
|
8709
8709
|
e ? yield ut.userMediaPromiseMap.get(e) : yield Promise.all(ut.userMediaPromiseMap.values());
|
|
8710
8710
|
} catch {
|
|
8711
|
-
|
|
8711
|
+
re.warn("error waiting for media permissons");
|
|
8712
8712
|
}
|
|
8713
8713
|
}
|
|
8714
8714
|
let n = yield navigator.mediaDevices.enumerateDevices();
|
|
@@ -8739,12 +8739,12 @@ class ut {
|
|
|
8739
8739
|
return e;
|
|
8740
8740
|
const g = yield this.getDevices(A), o = g.find((I) => I.deviceId === TC);
|
|
8741
8741
|
if (!o) {
|
|
8742
|
-
|
|
8742
|
+
re.warn("could not reliably determine default device");
|
|
8743
8743
|
return;
|
|
8744
8744
|
}
|
|
8745
8745
|
const n = g.find((I) => I.deviceId !== TC && I.groupId === (t ?? o.groupId));
|
|
8746
8746
|
if (!n) {
|
|
8747
|
-
|
|
8747
|
+
re.warn("could not reliably determine default device");
|
|
8748
8748
|
return;
|
|
8749
8749
|
}
|
|
8750
8750
|
return n == null ? void 0 : n.deviceId;
|
|
@@ -8809,7 +8809,7 @@ function Ol(i, A) {
|
|
|
8809
8809
|
const Cm = ["syncState", "trickle", "offer", "answer", "simulate", "leave"];
|
|
8810
8810
|
function rm(i) {
|
|
8811
8811
|
const A = Cm.indexOf(i.case) >= 0;
|
|
8812
|
-
return
|
|
8812
|
+
return re.trace("request allowed to bypass queue:", {
|
|
8813
8813
|
canPass: A,
|
|
8814
8814
|
req: i
|
|
8815
8815
|
}), A;
|
|
@@ -8834,7 +8834,7 @@ class oE {
|
|
|
8834
8834
|
constructor() {
|
|
8835
8835
|
let A = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
8836
8836
|
var t;
|
|
8837
|
-
this.rtt = 0, this.state = Ve.DISCONNECTED, this.log =
|
|
8837
|
+
this.rtt = 0, this.state = Ve.DISCONNECTED, this.log = re, this._requestId = 0, this.resetCallbacks = () => {
|
|
8838
8838
|
this.onAnswer = void 0, this.onLeave = void 0, this.onLocalTrackPublished = void 0, this.onLocalTrackUnpublished = void 0, this.onNegotiateRequested = void 0, this.onOffer = void 0, this.onRemoteMuteChanged = void 0, this.onSubscribedQualityUpdate = void 0, this.onTokenRefresh = void 0, this.onTrickle = void 0, this.onClose = void 0;
|
|
8839
8839
|
}, this.log = yg((t = e.loggerName) !== null && t !== void 0 ? t : bi.Signal), this.loggerContextCb = e.loggerContextCb, this.useJSON = A, this.requestQueue = new nm(), this.queuedRequests = [], this.closingLock = new Pt(), this.connectionLock = new Pt(), this.state = Ve.DISCONNECTED;
|
|
8840
8840
|
}
|
|
@@ -8867,9 +8867,9 @@ class oE {
|
|
|
8867
8867
|
const r = yield this.connectionLock.lock();
|
|
8868
8868
|
try {
|
|
8869
8869
|
const Q = () => N(this, void 0, void 0, function* () {
|
|
8870
|
-
this.close(), clearTimeout(B), C(new Le("room connection has been cancelled (signal)",
|
|
8870
|
+
this.close(), clearTimeout(B), C(new Le("room connection has been cancelled (signal)", Be.Cancelled));
|
|
8871
8871
|
}), B = setTimeout(() => {
|
|
8872
|
-
this.close(), C(new Le("room connection has timed out (signal)",
|
|
8872
|
+
this.close(), C(new Le("room connection has timed out (signal)", Be.ServerUnreachable));
|
|
8873
8873
|
}, t.websocketTimeout);
|
|
8874
8874
|
g != null && g.aborted && Q(), g == null || g.addEventListener("abort", Q);
|
|
8875
8875
|
const d = new URL(I);
|
|
@@ -8885,11 +8885,11 @@ class oE {
|
|
|
8885
8885
|
const h = yield fetch(a);
|
|
8886
8886
|
if (h.status.toFixed(0).startsWith("4")) {
|
|
8887
8887
|
const E = yield h.text();
|
|
8888
|
-
C(new Le(E,
|
|
8888
|
+
C(new Le(E, Be.NotAllowed, h.status));
|
|
8889
8889
|
} else
|
|
8890
|
-
C(new Le("Encountered unknown websocket error during connection: ".concat(c.toString()),
|
|
8890
|
+
C(new Le("Encountered unknown websocket error during connection: ".concat(c.toString()), Be.InternalError, h.status));
|
|
8891
8891
|
} catch (h) {
|
|
8892
|
-
C(new Le(h instanceof Error ? h.message : "server was not reachable",
|
|
8892
|
+
C(new Le(h instanceof Error ? h.message : "server was not reachable", Be.ServerUnreachable));
|
|
8893
8893
|
}
|
|
8894
8894
|
return;
|
|
8895
8895
|
}
|
|
@@ -8913,12 +8913,12 @@ class oE {
|
|
|
8913
8913
|
if (((h = p.message) === null || h === void 0 ? void 0 : h.case) === "join" ? (this.state = Ve.CONNECTED, g == null || g.removeEventListener("abort", Q), this.pingTimeoutDuration = p.message.value.pingTimeout, this.pingIntervalDuration = p.message.value.pingInterval, this.pingTimeoutDuration && this.pingTimeoutDuration > 0 && (this.log.debug("ping config", Object.assign(Object.assign({}, this.logContext), {
|
|
8914
8914
|
timeout: this.pingTimeoutDuration,
|
|
8915
8915
|
interval: this.pingIntervalDuration
|
|
8916
|
-
})), this.startPingInterval()), s(p.message.value)) : this.state === Ve.RECONNECTING && p.message.case !== "leave" ? (this.state = Ve.CONNECTED, g == null || g.removeEventListener("abort", Q), this.startPingInterval(), ((E = p.message) === null || E === void 0 ? void 0 : E.case) === "reconnect" ? s(p.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), s(void 0), u = !0)) : this.isEstablishingConnection && p.message.case === "leave" ? C(new Le("Received leave request while trying to (re)connect",
|
|
8916
|
+
})), this.startPingInterval()), s(p.message.value)) : this.state === Ve.RECONNECTING && p.message.case !== "leave" ? (this.state = Ve.CONNECTED, g == null || g.removeEventListener("abort", Q), this.startPingInterval(), ((E = p.message) === null || E === void 0 ? void 0 : E.case) === "reconnect" ? s(p.message.value) : (this.log.debug("declaring signal reconnected without reconnect response received", this.logContext), s(void 0), u = !0)) : this.isEstablishingConnection && p.message.case === "leave" ? C(new Le("Received leave request while trying to (re)connect", Be.LeaveRequest, void 0, p.message.value.reason)) : t.reconnect || C(new Le("did not receive join response, got ".concat((x = p.message) === null || x === void 0 ? void 0 : x.case, " instead"), Be.InternalError)), !u)
|
|
8917
8917
|
return;
|
|
8918
8918
|
}
|
|
8919
8919
|
this.signalLatency && (yield Ot(this.signalLatency)), this.handleSignalResponse(p);
|
|
8920
8920
|
}), this.ws.onclose = (c) => {
|
|
8921
|
-
this.isEstablishingConnection && C(new Le("Websocket got closed during a (re)connection attempt",
|
|
8921
|
+
this.isEstablishingConnection && C(new Le("Websocket got closed during a (re)connection attempt", Be.InternalError)), this.log.warn("websocket closed", Object.assign(Object.assign({}, this.logContext), {
|
|
8922
8922
|
reason: c.reason,
|
|
8923
8923
|
code: c.code,
|
|
8924
8924
|
wasClean: c.wasClean,
|
|
@@ -9955,7 +9955,7 @@ class Ac extends eg.EventEmitter {
|
|
|
9955
9955
|
constructor(A) {
|
|
9956
9956
|
let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
9957
9957
|
var t;
|
|
9958
|
-
super(), this.log =
|
|
9958
|
+
super(), this.log = re, this.ddExtID = 0, this.latestOfferId = 0, this.pendingCandidates = [], this.restartingIce = !1, this.renegotiate = !1, this.trackBitrates = [], this.remoteStereoMids = [], this.remoteNackMids = [], this.negotiate = IE((g) => N(this, void 0, void 0, function* () {
|
|
9959
9959
|
this.emit(_n.NegotiationStarted);
|
|
9960
9960
|
try {
|
|
9961
9961
|
yield this.createAndSendOffer();
|
|
@@ -10328,7 +10328,7 @@ class Dm {
|
|
|
10328
10328
|
}
|
|
10329
10329
|
constructor(A, e, t) {
|
|
10330
10330
|
var g;
|
|
10331
|
-
this.peerConnectionTimeout = aE.peerConnectionTimeout, this.log =
|
|
10331
|
+
this.peerConnectionTimeout = aE.peerConnectionTimeout, this.log = re, this.updateState = () => {
|
|
10332
10332
|
var o;
|
|
10333
10333
|
const n = this.state, I = this.requiredTransports.map((a) => a.getConnectionState());
|
|
10334
10334
|
I.every((a) => a === "connected") ? this.state = At.CONNECTED : I.some((a) => a === "failed") ? this.state = At.FAILED : I.some((a) => a === "connecting") ? this.state = At.CONNECTING : I.every((a) => a === "closed") ? this.state = At.CLOSED : I.some((a) => a === "closed") ? this.state = At.CLOSING : I.every((a) => a === "new") && (this.state = At.NEW), n !== this.state && (this.log.debug("pc state change: from ".concat(At[n], " to ").concat(At[this.state]), this.logContext), (o = this.onStateChange) === null || o === void 0 || o.call(this, this.state, this.publisher.getConnectionState(), this.subscriber.getConnectionState()));
|
|
@@ -10472,15 +10472,15 @@ class Dm {
|
|
|
10472
10472
|
if (t.getConnectionState() !== "connected")
|
|
10473
10473
|
return new Promise((a, s) => N(o, void 0, void 0, function* () {
|
|
10474
10474
|
const C = () => {
|
|
10475
|
-
this.log.warn("abort transport connection", this.logContext), Dt.clearTimeout(r), s(new Le("room connection has been cancelled",
|
|
10475
|
+
this.log.warn("abort transport connection", this.logContext), Dt.clearTimeout(r), s(new Le("room connection has been cancelled", Be.Cancelled));
|
|
10476
10476
|
};
|
|
10477
10477
|
g != null && g.signal.aborted && C(), g == null || g.signal.addEventListener("abort", C);
|
|
10478
10478
|
const r = Dt.setTimeout(() => {
|
|
10479
|
-
g == null || g.signal.removeEventListener("abort", C), s(new Le("could not establish pc connection",
|
|
10479
|
+
g == null || g.signal.removeEventListener("abort", C), s(new Le("could not establish pc connection", Be.InternalError));
|
|
10480
10480
|
}, n);
|
|
10481
10481
|
for (; this.state !== At.CONNECTED; )
|
|
10482
10482
|
if (yield Ot(50), g != null && g.signal.aborted) {
|
|
10483
|
-
s(new Le("room connection has been cancelled",
|
|
10483
|
+
s(new Le("room connection has been cancelled", Be.Cancelled));
|
|
10484
10484
|
return;
|
|
10485
10485
|
}
|
|
10486
10486
|
Dt.clearTimeout(r), g == null || g.signal.removeEventListener("abort", C), a();
|
|
@@ -11189,7 +11189,7 @@ function cQ(i, A, e, t) {
|
|
|
11189
11189
|
const I = t == null ? void 0 : t.simulcast, a = t == null ? void 0 : t.scalabilityMode, s = t == null ? void 0 : t.videoCodec;
|
|
11190
11190
|
if (!n && !I && !a || !A || !e)
|
|
11191
11191
|
return [{}];
|
|
11192
|
-
n || (n = Lm(i, A, e, s),
|
|
11192
|
+
n || (n = Lm(i, A, e, s), re.debug("using video encoding", n));
|
|
11193
11193
|
const C = n.maxFramerate, r = new be(A, e, n.maxBitrate, n.maxFramerate, n.priority);
|
|
11194
11194
|
if (a && Hi(s)) {
|
|
11195
11195
|
const d = new Xl(a), c = [];
|
|
@@ -11216,7 +11216,7 @@ function cQ(i, A, e, t) {
|
|
|
11216
11216
|
/* @ts-ignore */
|
|
11217
11217
|
scalabilityMode: a
|
|
11218
11218
|
});
|
|
11219
|
-
return r.encoding.priority && (c[0].priority = r.encoding.priority, c[0].networkPriority = r.encoding.priority),
|
|
11219
|
+
return r.encoding.priority && (c[0].priority = r.encoding.priority, c[0].networkPriority = r.encoding.priority), re.debug("using svc encoding", {
|
|
11220
11220
|
encodings: c
|
|
11221
11221
|
}), c;
|
|
11222
11222
|
}
|
|
@@ -11240,7 +11240,7 @@ function vm(i, A, e) {
|
|
|
11240
11240
|
var t, g, o, n;
|
|
11241
11241
|
if (!e.backupCodec || e.backupCodec === !0 || e.backupCodec.codec === e.videoCodec)
|
|
11242
11242
|
return;
|
|
11243
|
-
A !== e.backupCodec.codec &&
|
|
11243
|
+
A !== e.backupCodec.codec && re.warn("requested a different codec than specified as backup", {
|
|
11244
11244
|
serverRequested: A,
|
|
11245
11245
|
backup: e.backupCodec.codec
|
|
11246
11246
|
}), e.videoCodec = A, e.videoEncoding = e.backupCodec.encoding;
|
|
@@ -11306,7 +11306,7 @@ function qC(i, A, e, t) {
|
|
|
11306
11306
|
let n = !0;
|
|
11307
11307
|
g.forEach((I) => {
|
|
11308
11308
|
var a;
|
|
11309
|
-
I.maxFramerate != o && (n && (n = !1,
|
|
11309
|
+
I.maxFramerate != o && (n && (n = !1, re.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")), re.info('Setting framerate of encoding "'.concat((a = I.rid) !== null && a !== void 0 ? a : "", '" to ').concat(o)), I.maxFramerate = o);
|
|
11310
11310
|
});
|
|
11311
11311
|
}
|
|
11312
11312
|
return g;
|
|
@@ -11834,7 +11834,7 @@ class qm extends eg.EventEmitter {
|
|
|
11834
11834
|
}
|
|
11835
11835
|
constructor(A) {
|
|
11836
11836
|
var e;
|
|
11837
|
-
super(), this.options = A, this.rtcConfig = {}, this.peerConnectionTimeout = aE.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = li.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log =
|
|
11837
|
+
super(), this.options = A, this.rtcConfig = {}, this.peerConnectionTimeout = aE.peerConnectionTimeout, this.fullReconnectOnNext = !1, this.latestRemoteOfferId = 0, this.subscriberPrimary = !1, this.pcState = li.New, this._isClosed = !0, this.pendingTrackResolvers = {}, this.reconnectAttempts = 0, this.reconnectStart = 0, this.attemptingReconnect = !1, this.joinAttempts = 0, this.maxJoinAttempts = 1, this.shouldFailNext = !1, this.log = re, this.reliableDataSequence = 1, this.reliableMessageBuffer = new W0(), this.reliableReceivedState = new Bm(Ym), this.handleDataChannel = (t) => N(this, [t], void 0, function(g) {
|
|
11838
11838
|
var o = this;
|
|
11839
11839
|
let {
|
|
11840
11840
|
channel: n
|
|
@@ -11890,7 +11890,7 @@ class qm extends eg.EventEmitter {
|
|
|
11890
11890
|
event: t
|
|
11891
11891
|
}));
|
|
11892
11892
|
}, this.handleBufferedAmountLow = (t) => {
|
|
11893
|
-
const o = t.currentTarget.maxRetransmits === 0 ?
|
|
11893
|
+
const o = t.currentTarget.maxRetransmits === 0 ? ee.LOSSY : ee.RELIABLE;
|
|
11894
11894
|
this.updateAndEmitDCBufferStatus(o);
|
|
11895
11895
|
}, this.handleDisconnect = (t, g) => {
|
|
11896
11896
|
if (this._isClosed)
|
|
@@ -11922,13 +11922,13 @@ class qm extends eg.EventEmitter {
|
|
|
11922
11922
|
}, this.isBufferStatusLow = (t) => {
|
|
11923
11923
|
const g = this.dataChannelForKind(t);
|
|
11924
11924
|
if (g)
|
|
11925
|
-
return t ===
|
|
11925
|
+
return t === ee.RELIABLE && this.reliableMessageBuffer.alignBufferedAmount(g.bufferedAmount), g.bufferedAmount <= g.bufferedAmountLowThreshold;
|
|
11926
11926
|
}, this.handleBrowserOnLine = () => {
|
|
11927
11927
|
this.client.currentState === Ve.RECONNECTING && (this.clearReconnectTimeout(), this.attemptReconnect(jo.RR_SIGNAL_DISCONNECTED));
|
|
11928
11928
|
}, this.log = yg((e = A.loggerName) !== null && e !== void 0 ? e : bi.Engine), this.loggerOptions = {
|
|
11929
11929
|
loggerName: A.loggerName,
|
|
11930
11930
|
loggerContextCb: () => this.logContext
|
|
11931
|
-
}, this.client = new oE(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new Pt(), this.dataProcessLock = new Pt(), this.dcBufferStatus = /* @__PURE__ */ new Map([[
|
|
11931
|
+
}, this.client = new oE(void 0, this.loggerOptions), this.client.signalLatency = this.options.expSignalLatency, this.reconnectPolicy = this.options.reconnectPolicy, this.registerOnLineListener(), this.closingLock = new Pt(), this.dataProcessLock = new Pt(), this.dcBufferStatus = /* @__PURE__ */ new Map([[ee.LOSSY, !0], [ee.RELIABLE, !0]]), this.client.onParticipantUpdate = (t) => this.emit(BA.ParticipantUpdate, t), this.client.onConnectionQuality = (t) => this.emit(BA.ConnectionQualityUpdate, t), this.client.onRoomUpdate = (t) => this.emit(BA.RoomUpdate, t), this.client.onSubscriptionError = (t) => this.emit(BA.SubscriptionError, t), this.client.onSubscriptionPermissionUpdate = (t) => this.emit(BA.SubscriptionPermissionUpdate, t), this.client.onSpeakersChanged = (t) => this.emit(BA.SpeakersChanged, t), this.client.onStreamStateUpdate = (t) => this.emit(BA.StreamStateChanged, t), this.client.onRequestResponse = (t) => this.emit(BA.SignalRequestResponse, t);
|
|
11932
11932
|
}
|
|
11933
11933
|
/** @internal */
|
|
11934
11934
|
get logContext() {
|
|
@@ -11948,7 +11948,7 @@ class qm extends eg.EventEmitter {
|
|
|
11948
11948
|
const o = yield this.client.join(A, e, t, g);
|
|
11949
11949
|
return this._isClosed = !1, this.latestJoinResponse = o, this.subscriberPrimary = o.subscriberPrimary, this.pcManager || (yield this.configure(o)), (!this.subscriberPrimary || o.fastPublish) && this.negotiate(), this.clientConfiguration = o.clientConfiguration, this.emit(BA.SignalConnected, o), o;
|
|
11950
11950
|
} catch (o) {
|
|
11951
|
-
if (o instanceof Le && o.reason ===
|
|
11951
|
+
if (o instanceof Le && o.reason === Be.ServerUnreachable && (this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts, " of ").concat(this.maxJoinAttempts), this.logContext), this.joinAttempts < this.maxJoinAttempts))
|
|
11952
11952
|
return this.join(A, e, t, g);
|
|
11953
11953
|
throw o;
|
|
11954
11954
|
}
|
|
@@ -11988,7 +11988,7 @@ class qm extends eg.EventEmitter {
|
|
|
11988
11988
|
throw new xg("a track with the same ID has already been published");
|
|
11989
11989
|
return new Promise((e, t) => {
|
|
11990
11990
|
const g = setTimeout(() => {
|
|
11991
|
-
delete this.pendingTrackResolvers[A.cid], t(new Le("publication of local track timed out, no response from server",
|
|
11991
|
+
delete this.pendingTrackResolvers[A.cid], t(new Le("publication of local track timed out, no response from server", Be.Timeout));
|
|
11992
11992
|
}, 1e4);
|
|
11993
11993
|
this.pendingTrackResolvers[A.cid] = {
|
|
11994
11994
|
resolve: (o) => {
|
|
@@ -12200,7 +12200,7 @@ class qm extends eg.EventEmitter {
|
|
|
12200
12200
|
var e, t, g;
|
|
12201
12201
|
if (!this._isClosed) {
|
|
12202
12202
|
if (this.attemptingReconnect) {
|
|
12203
|
-
|
|
12203
|
+
re.warn("already attempting reconnect, returning early", this.logContext);
|
|
12204
12204
|
return;
|
|
12205
12205
|
}
|
|
12206
12206
|
(((e = this.clientConfiguration) === null || e === void 0 ? void 0 : e.resumeConnection) === TI.DISABLED || // signaling state could change to closed due to hardware sleep
|
|
@@ -12243,7 +12243,7 @@ class qm extends eg.EventEmitter {
|
|
|
12243
12243
|
throw this.log.warn("attempted connection restart, without signal options present", this.logContext), new Wo();
|
|
12244
12244
|
o = yield this.join(A ?? this.url, this.token, this.signalOpts);
|
|
12245
12245
|
} catch (n) {
|
|
12246
|
-
throw n instanceof Le && n.reason ===
|
|
12246
|
+
throw n instanceof Le && n.reason === Be.NotAllowed ? new Qt("could not reconnect, token might be expired") : new Wo();
|
|
12247
12247
|
}
|
|
12248
12248
|
if (this.shouldFailNext)
|
|
12249
12249
|
throw this.shouldFailNext = !1, new Error("simulated failure");
|
|
@@ -12275,7 +12275,7 @@ class qm extends eg.EventEmitter {
|
|
|
12275
12275
|
let o = "";
|
|
12276
12276
|
throw g instanceof Error && (o = g.message, this.log.error(g.message, Object.assign(Object.assign({}, this.logContext), {
|
|
12277
12277
|
error: g
|
|
12278
|
-
}))), g instanceof Le && g.reason ===
|
|
12278
|
+
}))), g instanceof Le && g.reason === Be.NotAllowed ? new Qt("could not reconnect, token might be expired") : g instanceof Le && g.reason === Be.LeaveRequest ? g : new Wo(o);
|
|
12279
12279
|
}
|
|
12280
12280
|
if (this.emit(BA.SignalResumed), t) {
|
|
12281
12281
|
const g = this.makeRTCConfiguration(t);
|
|
@@ -12304,7 +12304,7 @@ class qm extends eg.EventEmitter {
|
|
|
12304
12304
|
throw new Qt("PC manager is closed");
|
|
12305
12305
|
yield this.pcManager.ensurePCTransportConnection(void 0, this.peerConnectionTimeout), this.pcState = li.Connected;
|
|
12306
12306
|
} catch (A) {
|
|
12307
|
-
throw this.pcState = li.Disconnected, new Le("could not establish PC connection, ".concat(A.message),
|
|
12307
|
+
throw this.pcState = li.Disconnected, new Le("could not establish PC connection, ".concat(A.message), Be.InternalError);
|
|
12308
12308
|
}
|
|
12309
12309
|
});
|
|
12310
12310
|
}
|
|
@@ -12313,7 +12313,7 @@ class qm extends eg.EventEmitter {
|
|
|
12313
12313
|
return N(this, void 0, void 0, function* () {
|
|
12314
12314
|
const o = new qt({
|
|
12315
12315
|
destinationIdentities: [A],
|
|
12316
|
-
kind:
|
|
12316
|
+
kind: ee.RELIABLE,
|
|
12317
12317
|
value: {
|
|
12318
12318
|
case: "rpcResponse",
|
|
12319
12319
|
value: new Kh({
|
|
@@ -12328,7 +12328,7 @@ class qm extends eg.EventEmitter {
|
|
|
12328
12328
|
})
|
|
12329
12329
|
}
|
|
12330
12330
|
});
|
|
12331
|
-
yield this.sendDataPacket(o,
|
|
12331
|
+
yield this.sendDataPacket(o, ee.RELIABLE);
|
|
12332
12332
|
});
|
|
12333
12333
|
}
|
|
12334
12334
|
/** @internal */
|
|
@@ -12336,7 +12336,7 @@ class qm extends eg.EventEmitter {
|
|
|
12336
12336
|
return N(this, void 0, void 0, function* () {
|
|
12337
12337
|
const t = new qt({
|
|
12338
12338
|
destinationIdentities: [A],
|
|
12339
|
-
kind:
|
|
12339
|
+
kind: ee.RELIABLE,
|
|
12340
12340
|
value: {
|
|
12341
12341
|
case: "rpcAck",
|
|
12342
12342
|
value: new Th({
|
|
@@ -12344,16 +12344,16 @@ class qm extends eg.EventEmitter {
|
|
|
12344
12344
|
})
|
|
12345
12345
|
}
|
|
12346
12346
|
});
|
|
12347
|
-
yield this.sendDataPacket(t,
|
|
12347
|
+
yield this.sendDataPacket(t, ee.RELIABLE);
|
|
12348
12348
|
});
|
|
12349
12349
|
}
|
|
12350
12350
|
/* @internal */
|
|
12351
12351
|
sendDataPacket(A, e) {
|
|
12352
12352
|
return N(this, void 0, void 0, function* () {
|
|
12353
|
-
yield this.ensurePublisherConnected(e), e ===
|
|
12353
|
+
yield this.ensurePublisherConnected(e), e === ee.RELIABLE && (A.sequence = this.reliableDataSequence, this.reliableDataSequence += 1);
|
|
12354
12354
|
const t = A.toBinary(), g = this.dataChannelForKind(e);
|
|
12355
12355
|
if (g) {
|
|
12356
|
-
if (e ===
|
|
12356
|
+
if (e === ee.RELIABLE && this.reliableMessageBuffer.push({
|
|
12357
12357
|
data: t,
|
|
12358
12358
|
sequence: A.sequence
|
|
12359
12359
|
}), this.attemptingReconnect)
|
|
@@ -12365,11 +12365,11 @@ class qm extends eg.EventEmitter {
|
|
|
12365
12365
|
}
|
|
12366
12366
|
resendReliableMessagesForResume(A) {
|
|
12367
12367
|
return N(this, void 0, void 0, function* () {
|
|
12368
|
-
yield this.ensurePublisherConnected(
|
|
12369
|
-
const e = this.dataChannelForKind(
|
|
12368
|
+
yield this.ensurePublisherConnected(ee.RELIABLE);
|
|
12369
|
+
const e = this.dataChannelForKind(ee.RELIABLE);
|
|
12370
12370
|
e && (this.reliableMessageBuffer.popToSequence(A), this.reliableMessageBuffer.getAll().forEach((t) => {
|
|
12371
12371
|
e.send(t.data);
|
|
12372
|
-
})), this.updateAndEmitDCBufferStatus(
|
|
12372
|
+
})), this.updateAndEmitDCBufferStatus(ee.RELIABLE);
|
|
12373
12373
|
});
|
|
12374
12374
|
}
|
|
12375
12375
|
waitForBufferStatusLow(A) {
|
|
@@ -12397,7 +12397,7 @@ class qm extends eg.EventEmitter {
|
|
|
12397
12397
|
throw new Qt("PC manager is closed");
|
|
12398
12398
|
const n = g ? t.pcManager.subscriber : t.pcManager.publisher, I = g ? "Subscriber" : "Publisher";
|
|
12399
12399
|
if (!n)
|
|
12400
|
-
throw new Le("".concat(I, " connection not set"),
|
|
12400
|
+
throw new Le("".concat(I, " connection not set"), Be.InternalError);
|
|
12401
12401
|
let a = !1;
|
|
12402
12402
|
!g && !t.dataChannelForKind(e, g) && (t.createDataChannels(), a = !0), !a && !g && !t.pcManager.publisher.isICEConnected && t.pcManager.publisher.getICEConnectionState() !== "checking" && (a = !0), a && t.negotiate();
|
|
12403
12403
|
const s = t.dataChannelForKind(e, g);
|
|
@@ -12409,7 +12409,7 @@ class qm extends eg.EventEmitter {
|
|
|
12409
12409
|
return;
|
|
12410
12410
|
yield Ot(50);
|
|
12411
12411
|
}
|
|
12412
|
-
throw new Le("could not establish ".concat(I, " connection, state: ").concat(n.getICEConnectionState()),
|
|
12412
|
+
throw new Le("could not establish ".concat(I, " connection, state: ").concat(n.getICEConnectionState()), Be.InternalError);
|
|
12413
12413
|
}();
|
|
12414
12414
|
});
|
|
12415
12415
|
}
|
|
@@ -12453,14 +12453,14 @@ class qm extends eg.EventEmitter {
|
|
|
12453
12453
|
}
|
|
12454
12454
|
dataChannelForKind(A, e) {
|
|
12455
12455
|
if (e) {
|
|
12456
|
-
if (A ===
|
|
12456
|
+
if (A === ee.LOSSY)
|
|
12457
12457
|
return this.lossyDCSub;
|
|
12458
|
-
if (A ===
|
|
12458
|
+
if (A === ee.RELIABLE)
|
|
12459
12459
|
return this.reliableDCSub;
|
|
12460
12460
|
} else {
|
|
12461
|
-
if (A ===
|
|
12461
|
+
if (A === ee.LOSSY)
|
|
12462
12462
|
return this.lossyDC;
|
|
12463
|
-
if (A ===
|
|
12463
|
+
if (A === ee.RELIABLE)
|
|
12464
12464
|
return this.reliableDC;
|
|
12465
12465
|
}
|
|
12466
12466
|
}
|
|
@@ -12509,7 +12509,7 @@ class qm extends eg.EventEmitter {
|
|
|
12509
12509
|
target: g
|
|
12510
12510
|
}));
|
|
12511
12511
|
};
|
|
12512
|
-
return e(this.dataChannelForKind(
|
|
12512
|
+
return e(this.dataChannelForKind(ee.LOSSY), wi.PUBLISHER), e(this.dataChannelForKind(ee.RELIABLE), wi.PUBLISHER), e(this.dataChannelForKind(ee.LOSSY, !0), wi.SUBSCRIBER), e(this.dataChannelForKind(ee.RELIABLE, !0), wi.SUBSCRIBER), A;
|
|
12513
12513
|
}
|
|
12514
12514
|
clearReconnectTimeout() {
|
|
12515
12515
|
this.reconnectTimeout && Dt.clearTimeout(this.reconnectTimeout);
|
|
@@ -12556,7 +12556,7 @@ class dQ {
|
|
|
12556
12556
|
const e = this.regionSettings.regions.filter((t) => !this.attemptedRegions.find((g) => g.url === t.url));
|
|
12557
12557
|
if (e.length > 0) {
|
|
12558
12558
|
const t = e[0];
|
|
12559
|
-
return this.attemptedRegions.push(t),
|
|
12559
|
+
return this.attemptedRegions.push(t), re.debug("next region: ".concat(t.region)), t.url;
|
|
12560
12560
|
} else
|
|
12561
12561
|
return null;
|
|
12562
12562
|
});
|
|
@@ -12577,7 +12577,7 @@ class dQ {
|
|
|
12577
12577
|
const t = yield e.json();
|
|
12578
12578
|
return this.lastUpdateAt = Date.now(), t;
|
|
12579
12579
|
} else
|
|
12580
|
-
throw new Le("Could not fetch region settings: ".concat(e.statusText), e.status === 401 ?
|
|
12580
|
+
throw new Le("Could not fetch region settings: ".concat(e.statusText), e.status === 401 ? Be.NotAllowed : Be.InternalError, e.status);
|
|
12581
12581
|
});
|
|
12582
12582
|
}
|
|
12583
12583
|
setServerReportedRegions(A) {
|
|
@@ -12828,7 +12828,7 @@ class jm extends $l {
|
|
|
12828
12828
|
}
|
|
12829
12829
|
class Wm {
|
|
12830
12830
|
constructor() {
|
|
12831
|
-
this.log =
|
|
12831
|
+
this.log = re, this.byteStreamControllers = /* @__PURE__ */ new Map(), this.textStreamControllers = /* @__PURE__ */ new Map(), this.byteStreamHandlers = /* @__PURE__ */ new Map(), this.textStreamHandlers = /* @__PURE__ */ new Map();
|
|
12832
12832
|
}
|
|
12833
12833
|
registerTextStreamHandler(A, e) {
|
|
12834
12834
|
if (this.textStreamHandlers.has(A))
|
|
@@ -13045,14 +13045,14 @@ class zm {
|
|
|
13045
13045
|
value: n
|
|
13046
13046
|
}
|
|
13047
13047
|
});
|
|
13048
|
-
yield this.engine.sendDataPacket(a,
|
|
13048
|
+
yield this.engine.sendDataPacket(a, ee.RELIABLE);
|
|
13049
13049
|
let s = 0;
|
|
13050
13050
|
const C = this.engine, r = new WritableStream({
|
|
13051
13051
|
// Implement the sink
|
|
13052
13052
|
write(d) {
|
|
13053
13053
|
return N(this, void 0, void 0, function* () {
|
|
13054
13054
|
for (const c of Xw(d, Cc)) {
|
|
13055
|
-
yield C.waitForBufferStatusLow(
|
|
13055
|
+
yield C.waitForBufferStatusLow(ee.RELIABLE);
|
|
13056
13056
|
const h = new qr({
|
|
13057
13057
|
content: c,
|
|
13058
13058
|
streamId: g,
|
|
@@ -13064,7 +13064,7 @@ class zm {
|
|
|
13064
13064
|
value: h
|
|
13065
13065
|
}
|
|
13066
13066
|
});
|
|
13067
|
-
yield C.sendDataPacket(E,
|
|
13067
|
+
yield C.sendDataPacket(E, ee.RELIABLE), s += 1;
|
|
13068
13068
|
}
|
|
13069
13069
|
});
|
|
13070
13070
|
},
|
|
@@ -13079,7 +13079,7 @@ class zm {
|
|
|
13079
13079
|
value: d
|
|
13080
13080
|
}
|
|
13081
13081
|
});
|
|
13082
|
-
yield C.sendDataPacket(c,
|
|
13082
|
+
yield C.sendDataPacket(c, ee.RELIABLE);
|
|
13083
13083
|
});
|
|
13084
13084
|
},
|
|
13085
13085
|
abort(d) {
|
|
@@ -13156,7 +13156,7 @@ class zm {
|
|
|
13156
13156
|
value: C
|
|
13157
13157
|
}
|
|
13158
13158
|
});
|
|
13159
|
-
yield this.engine.sendDataPacket(r,
|
|
13159
|
+
yield this.engine.sendDataPacket(r, ee.RELIABLE);
|
|
13160
13160
|
let Q = 0;
|
|
13161
13161
|
const B = new Pt(), d = this.engine, c = this.log, h = new WritableStream({
|
|
13162
13162
|
write(x) {
|
|
@@ -13166,7 +13166,7 @@ class zm {
|
|
|
13166
13166
|
try {
|
|
13167
13167
|
for (; u < x.byteLength; ) {
|
|
13168
13168
|
const D = x.slice(u, u + Cc);
|
|
13169
|
-
yield d.waitForBufferStatusLow(
|
|
13169
|
+
yield d.waitForBufferStatusLow(ee.RELIABLE);
|
|
13170
13170
|
const w = new qt({
|
|
13171
13171
|
destinationIdentities: a,
|
|
13172
13172
|
value: {
|
|
@@ -13178,7 +13178,7 @@ class zm {
|
|
|
13178
13178
|
})
|
|
13179
13179
|
}
|
|
13180
13180
|
});
|
|
13181
|
-
yield d.sendDataPacket(w,
|
|
13181
|
+
yield d.sendDataPacket(w, ee.RELIABLE), Q += 1, u += D.byteLength;
|
|
13182
13182
|
}
|
|
13183
13183
|
} finally {
|
|
13184
13184
|
p();
|
|
@@ -13196,7 +13196,7 @@ class zm {
|
|
|
13196
13196
|
value: x
|
|
13197
13197
|
}
|
|
13198
13198
|
});
|
|
13199
|
-
yield d.sendDataPacket(p,
|
|
13199
|
+
yield d.sendDataPacket(p, ee.RELIABLE);
|
|
13200
13200
|
});
|
|
13201
13201
|
},
|
|
13202
13202
|
abort(x) {
|
|
@@ -13611,7 +13611,7 @@ function hQ(i, A) {
|
|
|
13611
13611
|
class Eg extends eg.EventEmitter {
|
|
13612
13612
|
constructor(A, e, t, g) {
|
|
13613
13613
|
var o;
|
|
13614
|
-
super(), this.metadataMuted = !1, this.encryption = $t.NONE, this.log =
|
|
13614
|
+
super(), this.metadataMuted = !1, this.encryption = $t.NONE, this.log = re, this.handleMuted = () => {
|
|
13615
13615
|
this.emit(CA.Muted);
|
|
13616
13616
|
}, this.handleUnmuted = () => {
|
|
13617
13617
|
this.emit(CA.Unmuted);
|
|
@@ -13623,7 +13623,7 @@ class Eg extends eg.EventEmitter {
|
|
|
13623
13623
|
}
|
|
13624
13624
|
get logContext() {
|
|
13625
13625
|
var A;
|
|
13626
|
-
return Object.assign(Object.assign({}, (A = this.loggerContextCb) === null || A === void 0 ? void 0 : A.call(this)),
|
|
13626
|
+
return Object.assign(Object.assign({}, (A = this.loggerContextCb) === null || A === void 0 ? void 0 : A.call(this)), Ie(this));
|
|
13627
13627
|
}
|
|
13628
13628
|
get isMuted() {
|
|
13629
13629
|
return this.metadataMuted;
|
|
@@ -13866,7 +13866,7 @@ class tx extends eg.EventEmitter {
|
|
|
13866
13866
|
constructor(A, e, t, g, o, n) {
|
|
13867
13867
|
let I = arguments.length > 6 && arguments[6] !== void 0 ? arguments[6] : KI.STANDARD;
|
|
13868
13868
|
var a;
|
|
13869
|
-
super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = jg.Unknown, this.log =
|
|
13869
|
+
super(), this.audioLevel = 0, this.isSpeaking = !1, this._connectionQuality = jg.Unknown, this.log = re, this.log = yg((a = n == null ? void 0 : n.loggerName) !== null && a !== void 0 ? a : bi.Participant), this.loggerOptions = n, this.setMaxListeners(100), this.sid = A, this.identity = e, this.name = t, this.metadata = g, this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this._kind = I, this._attributes = o ?? {};
|
|
13870
13870
|
}
|
|
13871
13871
|
getTrackPublications() {
|
|
13872
13872
|
return Array.from(this.trackPublications.values());
|
|
@@ -14047,14 +14047,14 @@ class n_ extends tx {
|
|
|
14047
14047
|
this.onTrackMuted(I, I.isUpstreamPaused);
|
|
14048
14048
|
}, this.onTrackMuted = (I, a) => {
|
|
14049
14049
|
if (a === void 0 && (a = !0), !I.sid) {
|
|
14050
|
-
this.log.error("could not update mute status for unpublished track", Object.assign(Object.assign({}, this.logContext),
|
|
14050
|
+
this.log.error("could not update mute status for unpublished track", Object.assign(Object.assign({}, this.logContext), Ie(I)));
|
|
14051
14051
|
return;
|
|
14052
14052
|
}
|
|
14053
14053
|
this.engine.updateMuteStatus(I.sid, a);
|
|
14054
14054
|
}, this.onTrackUpstreamPaused = (I) => {
|
|
14055
|
-
this.log.debug("upstream paused", Object.assign(Object.assign({}, this.logContext),
|
|
14055
|
+
this.log.debug("upstream paused", Object.assign(Object.assign({}, this.logContext), Ie(I))), this.onTrackMuted(I, !0);
|
|
14056
14056
|
}, this.onTrackUpstreamResumed = (I) => {
|
|
14057
|
-
this.log.debug("upstream resumed", Object.assign(Object.assign({}, this.logContext),
|
|
14057
|
+
this.log.debug("upstream resumed", Object.assign(Object.assign({}, this.logContext), Ie(I))), this.onTrackMuted(I, I.isMuted);
|
|
14058
14058
|
}, this.onTrackFeatureUpdate = (I) => {
|
|
14059
14059
|
const a = this.audioTrackPublications.get(I.sid);
|
|
14060
14060
|
if (!a) {
|
|
@@ -14063,7 +14063,7 @@ class n_ extends tx {
|
|
|
14063
14063
|
}
|
|
14064
14064
|
this.engine.client.sendUpdateLocalAudioTrack(a.trackSid, a.getTrackFeatures());
|
|
14065
14065
|
}, this.onTrackCpuConstrained = (I, a) => {
|
|
14066
|
-
this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext),
|
|
14066
|
+
this.log.debug("track cpu constrained", Object.assign(Object.assign({}, this.logContext), Ie(a))), this.emit(QA.LocalTrackCpuConstrained, I, a);
|
|
14067
14067
|
}, this.handleSubscribedQualityUpdate = (I) => N(this, void 0, void 0, function* () {
|
|
14068
14068
|
var a, s, C, r, Q;
|
|
14069
14069
|
if (!(!((Q = this.roomOptions) === null || Q === void 0) && Q.dynacast))
|
|
@@ -14082,7 +14082,7 @@ class n_ extends tx {
|
|
|
14082
14082
|
for (var c = !0, h = lg(d), E; E = yield h.next(), a = E.done, !a; c = !0) {
|
|
14083
14083
|
r = E.value, c = !1;
|
|
14084
14084
|
const x = r;
|
|
14085
|
-
Mw(x) && (this.log.debug("publish ".concat(x, " for ").concat(B.videoTrack.sid), Object.assign(Object.assign({}, this.logContext),
|
|
14085
|
+
Mw(x) && (this.log.debug("publish ".concat(x, " for ").concat(B.videoTrack.sid), Object.assign(Object.assign({}, this.logContext), Ie(B))), yield this.publishAdditionalCodecForTrack(B.videoTrack, x, B.options));
|
|
14086
14086
|
}
|
|
14087
14087
|
} catch (x) {
|
|
14088
14088
|
s = {
|
|
@@ -14106,7 +14106,7 @@ class n_ extends tx {
|
|
|
14106
14106
|
this.unpublishTrack(a.track);
|
|
14107
14107
|
}, this.handleTrackEnded = (I) => N(this, void 0, void 0, function* () {
|
|
14108
14108
|
if (I.source === tA.Source.ScreenShare || I.source === tA.Source.ScreenShareAudio)
|
|
14109
|
-
this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext),
|
|
14109
|
+
this.log.debug("unpublishing local track due to TrackEnded", Object.assign(Object.assign({}, this.logContext), Ie(I))), this.unpublishTrack(I);
|
|
14110
14110
|
else if (I.isUserProvided)
|
|
14111
14111
|
yield I.mute();
|
|
14112
14112
|
else if (sg(I) || vg(I))
|
|
@@ -14119,16 +14119,16 @@ class n_ extends tx {
|
|
|
14119
14119
|
name: I.source === tA.Source.Camera ? "camera" : "microphone"
|
|
14120
14120
|
});
|
|
14121
14121
|
if (a && a.state === "denied")
|
|
14122
|
-
throw this.log.warn("user has revoked access to ".concat(I.source), Object.assign(Object.assign({}, this.logContext),
|
|
14122
|
+
throw this.log.warn("user has revoked access to ".concat(I.source), Object.assign(Object.assign({}, this.logContext), Ie(I))), a.onchange = () => {
|
|
14123
14123
|
a.state !== "denied" && (I.isMuted || I.restartTrack(), a.onchange = null);
|
|
14124
14124
|
}, new Error("GetUserMedia Permission denied");
|
|
14125
14125
|
} catch {
|
|
14126
14126
|
}
|
|
14127
|
-
I.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext),
|
|
14127
|
+
I.isMuted || (this.log.debug("track ended, attempting to use a different device", Object.assign(Object.assign({}, this.logContext), Ie(I))), sg(I) ? yield I.restartTrack({
|
|
14128
14128
|
deviceId: "default"
|
|
14129
14129
|
}) : yield I.restartTrack());
|
|
14130
14130
|
} catch {
|
|
14131
|
-
this.log.warn("could not restart track, muting instead", Object.assign(Object.assign({}, this.logContext),
|
|
14131
|
+
this.log.warn("could not restart track, muting instead", Object.assign(Object.assign({}, this.logContext), Ie(I))), yield I.mute();
|
|
14132
14132
|
}
|
|
14133
14133
|
}), this.audioTrackPublications = /* @__PURE__ */ new Map(), this.videoTrackPublications = /* @__PURE__ */ new Map(), this.trackPublications = /* @__PURE__ */ new Map(), this.engine = t, this.roomOptions = g, this.setupEngine(t), this.activeDeviceMap = /* @__PURE__ */ new Map([["audioinput", "default"], ["videoinput", "default"], ["audiooutput", "default"]]), this.pendingSignalRequests = /* @__PURE__ */ new Map(), this.rpcHandlers = o, this.roomOutgoingDataStreamManager = n;
|
|
14134
14134
|
}
|
|
@@ -14328,7 +14328,7 @@ class n_ extends tx {
|
|
|
14328
14328
|
try {
|
|
14329
14329
|
const s = [];
|
|
14330
14330
|
for (const r of a)
|
|
14331
|
-
this.log.info("publishing track", Object.assign(Object.assign({}, this.logContext),
|
|
14331
|
+
this.log.info("publishing track", Object.assign(Object.assign({}, this.logContext), Ie(r))), s.push(this.publishTrack(r, g));
|
|
14332
14332
|
[I] = yield Promise.all(s);
|
|
14333
14333
|
} catch (s) {
|
|
14334
14334
|
throw a == null || a.forEach((C) => {
|
|
@@ -14480,17 +14480,17 @@ class n_ extends tx {
|
|
|
14480
14480
|
if (o.trackPublications.forEach((E) => {
|
|
14481
14481
|
E.track && E.track === t && (Q = E);
|
|
14482
14482
|
}), Q)
|
|
14483
|
-
return o.log.warn("track has already been published, skipping", Object.assign(Object.assign({}, o.logContext),
|
|
14483
|
+
return o.log.warn("track has already been published, skipping", Object.assign(Object.assign({}, o.logContext), Ie(Q))), Q;
|
|
14484
14484
|
const B = "channelCount" in t.mediaStreamTrack.getSettings() && // @ts-ignore `channelCount` on getSettings() is currently only available for Safari, but is generally the best way to determine a stereo track https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackSettings/channelCount
|
|
14485
14485
|
t.mediaStreamTrack.getSettings().channelCount === 2 || t.mediaStreamTrack.getConstraints().channelCount === 2, d = (a = g == null ? void 0 : g.forceStereo) !== null && a !== void 0 ? a : B;
|
|
14486
|
-
d && (g || (g = {}), g.dtx === void 0 && o.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, o.logContext),
|
|
14486
|
+
d && (g || (g = {}), g.dtx === void 0 && o.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.", Object.assign(Object.assign({}, o.logContext), Ie(t))), g.red === void 0 && o.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."), (s = g.dtx) !== null && s !== void 0 || (g.dtx = !1), (C = g.red) !== null && C !== void 0 || (g.red = !1));
|
|
14487
14487
|
const c = Object.assign(Object.assign({}, o.roomOptions.publishDefaults), g);
|
|
14488
14488
|
!Jw() && o.roomOptions.e2ee && (o.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2", Object.assign({}, o.logContext)), c.simulcast = !1), c.source && (t.source = c.source);
|
|
14489
14489
|
const h = new Promise((E, x) => N(o, void 0, void 0, function* () {
|
|
14490
14490
|
try {
|
|
14491
14491
|
if (this.engine.client.currentState !== Ve.CONNECTED) {
|
|
14492
14492
|
this.log.debug("deferring track publication until signal is connected", Object.assign(Object.assign({}, this.logContext), {
|
|
14493
|
-
track:
|
|
14493
|
+
track: Ie(t)
|
|
14494
14494
|
}));
|
|
14495
14495
|
const p = setTimeout(() => {
|
|
14496
14496
|
x(new L0("publishing rejected as engine not connected within timeout", 408));
|
|
@@ -14525,19 +14525,19 @@ class n_ extends tx {
|
|
|
14525
14525
|
}
|
|
14526
14526
|
hasPermissionsToPublish(A) {
|
|
14527
14527
|
if (!this.permissions)
|
|
14528
|
-
return this.log.warn("no permissions present for publishing track", Object.assign(Object.assign({}, this.logContext),
|
|
14528
|
+
return this.log.warn("no permissions present for publishing track", Object.assign(Object.assign({}, this.logContext), Ie(A))), !1;
|
|
14529
14529
|
const {
|
|
14530
14530
|
canPublish: e,
|
|
14531
14531
|
canPublishSources: t
|
|
14532
14532
|
} = this.permissions;
|
|
14533
|
-
return e && (t.length === 0 || t.map((g) => im(g)).includes(A.source)) ? !0 : (this.log.warn("insufficient permissions to publish", Object.assign(Object.assign({}, this.logContext),
|
|
14533
|
+
return e && (t.length === 0 || t.map((g) => im(g)).includes(A.source)) ? !0 : (this.log.warn("insufficient permissions to publish", Object.assign(Object.assign({}, this.logContext), Ie(A))), !1);
|
|
14534
14534
|
}
|
|
14535
14535
|
publish(A, e, t) {
|
|
14536
14536
|
return N(this, void 0, void 0, function* () {
|
|
14537
14537
|
var g, o, n, I, a, s, C, r, Q, B;
|
|
14538
14538
|
if (!this.hasPermissionsToPublish(A))
|
|
14539
14539
|
throw new L0("failed to publish track, insufficient permissions", 403);
|
|
14540
|
-
Array.from(this.trackPublications.values()).find((l) => mn(A) && l.source === A.source) && A.source !== tA.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(A.source), Object.assign(Object.assign({}, this.logContext),
|
|
14540
|
+
Array.from(this.trackPublications.values()).find((l) => mn(A) && l.source === A.source) && A.source !== tA.Source.Unknown && this.log.info("publishing a second track with the same source: ".concat(A.source), Object.assign(Object.assign({}, this.logContext), Ie(A))), e.stopMicTrackOnMute && ji(A) && (A.stopOnMute = !0), A.source === tA.Source.ScreenShare && Lo() && (e.simulcast = !1), e.videoCodec === "av1" && !vw() && (e.videoCodec = void 0), e.videoCodec === "vp9" && !Lw() && (e.videoCodec = void 0), e.videoCodec === void 0 && (e.videoCodec = BQ), this.enabledPublishVideoCodecs.length > 0 && (this.enabledPublishVideoCodecs.some((l) => e.videoCodec === RI(l.mime)) || (e.videoCodec = RI(this.enabledPublishVideoCodecs[0].mime)));
|
|
14541
14541
|
const c = e.videoCodec;
|
|
14542
14542
|
A.on(CA.Muted, this.onTrackMuted), A.on(CA.Unmuted, this.onTrackUnmuted), A.on(CA.Ended, this.handleTrackEnded), A.on(CA.UpstreamPaused, this.onTrackUpstreamPaused), A.on(CA.UpstreamResumed, this.onTrackUpstreamResumed), A.on(CA.AudioTrackFeatureUpdate, this.onTrackFeatureUpdate);
|
|
14543
14543
|
const h = [], E = !(!((g = e.dtx) !== null && g !== void 0) || g), x = A.getSourceTrackSettings();
|
|
@@ -14570,11 +14570,11 @@ class n_ extends tx {
|
|
|
14570
14570
|
l = {
|
|
14571
14571
|
width: S.width,
|
|
14572
14572
|
height: S.height
|
|
14573
|
-
}, this.log.error("could not determine track dimensions, using defaults", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
14573
|
+
}, this.log.error("could not determine track dimensions, using defaults", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(A)), {
|
|
14574
14574
|
dims: l
|
|
14575
14575
|
}));
|
|
14576
14576
|
}
|
|
14577
|
-
p.width = l.width, p.height = l.height, vg(A) && (Hi(c) && (A.source === tA.Source.ScreenShare && (e.scalabilityMode = "L1T3", "contentHint" in A.mediaStreamTrack && (A.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext),
|
|
14577
|
+
p.width = l.width, p.height = l.height, vg(A) && (Hi(c) && (A.source === tA.Source.ScreenShare && (e.scalabilityMode = "L1T3", "contentHint" in A.mediaStreamTrack && (A.mediaStreamTrack.contentHint = "motion", this.log.info("forcing contentHint to motion for screenshare with SVC codecs", Object.assign(Object.assign({}, this.logContext), Ie(A))))), e.scalabilityMode = (a = e.scalabilityMode) !== null && a !== void 0 ? a : "L3T3_KEY"), p.simulcastCodecs = [new Or({
|
|
14578
14578
|
codec: c,
|
|
14579
14579
|
cid: A.mediaStreamTrack.id
|
|
14580
14580
|
})], e.backupCodec === !0 && (e.backupCodec = {
|
|
@@ -14622,7 +14622,7 @@ class n_ extends tx {
|
|
|
14622
14622
|
w = yield this.engine.addTrack(p), l(w);
|
|
14623
14623
|
} catch (v) {
|
|
14624
14624
|
A.sender && (!((S = this.engine.pcManager) === null || S === void 0) && S.publisher) && (this.engine.pcManager.publisher.removeTrack(A.sender), yield this.engine.negotiate().catch((T) => {
|
|
14625
|
-
this.log.error("failed to negotiate after removing track due to failed add track request", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
14625
|
+
this.log.error("failed to negotiate after removing track due to failed add track request", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(A)), {
|
|
14626
14626
|
error: T
|
|
14627
14627
|
}));
|
|
14628
14628
|
})), m(v);
|
|
@@ -14637,7 +14637,7 @@ class n_ extends tx {
|
|
|
14637
14637
|
l === void 0 && (l = m.mimeType);
|
|
14638
14638
|
}), l && A.kind === tA.Kind.Video) {
|
|
14639
14639
|
const m = RI(l);
|
|
14640
|
-
m !== c && (this.log.debug("falling back to server selected codec", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
14640
|
+
m !== c && (this.log.debug("falling back to server selected codec", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(A)), {
|
|
14641
14641
|
codec: m
|
|
14642
14642
|
})), e.videoCodec = m, u = cQ(A.source === tA.Source.ScreenShare, p.width, p.height, e));
|
|
14643
14643
|
}
|
|
@@ -14658,16 +14658,16 @@ class n_ extends tx {
|
|
|
14658
14658
|
this.log.warn("subscribe event came to late, buffer already closed", this.logContext);
|
|
14659
14659
|
return;
|
|
14660
14660
|
}
|
|
14661
|
-
this.log.debug("finished recording preconnect buffer", Object.assign(Object.assign({}, this.logContext),
|
|
14661
|
+
this.log.debug("finished recording preconnect buffer", Object.assign(Object.assign({}, this.logContext), Ie(A))), A.stopPreConnectBuffer();
|
|
14662
14662
|
}
|
|
14663
14663
|
}), l && new Promise((v, T) => N(this, void 0, void 0, function* () {
|
|
14664
14664
|
var O, W, P, V, $, DA;
|
|
14665
14665
|
try {
|
|
14666
|
-
this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext),
|
|
14666
|
+
this.log.debug("waiting for agent", Object.assign(Object.assign({}, this.logContext), Ie(A)));
|
|
14667
14667
|
const OA = setTimeout(() => {
|
|
14668
14668
|
T(new Error("agent not active within 10 seconds"));
|
|
14669
14669
|
}, 1e4), Pe = yield this.waitUntilActiveAgentPresent();
|
|
14670
|
-
clearTimeout(OA), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext),
|
|
14670
|
+
clearTimeout(OA), this.log.debug("sending preconnect buffer", Object.assign(Object.assign({}, this.logContext), Ie(A)));
|
|
14671
14671
|
const Se = yield this.streamBytes({
|
|
14672
14672
|
name: "preconnect-buffer",
|
|
14673
14673
|
mimeType: m,
|
|
@@ -14682,12 +14682,12 @@ class n_ extends tx {
|
|
|
14682
14682
|
try {
|
|
14683
14683
|
for (var EA = !0, wA = lg(l), VA; VA = yield wA.next(), O = VA.done, !O; EA = !0) {
|
|
14684
14684
|
V = VA.value, EA = !1;
|
|
14685
|
-
const
|
|
14686
|
-
yield Se.write(
|
|
14685
|
+
const z = V;
|
|
14686
|
+
yield Se.write(z);
|
|
14687
14687
|
}
|
|
14688
|
-
} catch (
|
|
14688
|
+
} catch (z) {
|
|
14689
14689
|
W = {
|
|
14690
|
-
error:
|
|
14690
|
+
error: z
|
|
14691
14691
|
};
|
|
14692
14692
|
} finally {
|
|
14693
14693
|
try {
|
|
@@ -14701,9 +14701,9 @@ class n_ extends tx {
|
|
|
14701
14701
|
T(OA);
|
|
14702
14702
|
}
|
|
14703
14703
|
})).then(() => {
|
|
14704
|
-
this.log.debug("preconnect buffer sent successfully", Object.assign(Object.assign({}, this.logContext),
|
|
14704
|
+
this.log.debug("preconnect buffer sent successfully", Object.assign(Object.assign({}, this.logContext), Ie(A)));
|
|
14705
14705
|
}).catch((v) => {
|
|
14706
|
-
this.log.error("error sending preconnect buffer", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
14706
|
+
this.log.error("error sending preconnect buffer", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(A)), {
|
|
14707
14707
|
error: v
|
|
14708
14708
|
}));
|
|
14709
14709
|
});
|
|
@@ -14731,7 +14731,7 @@ class n_ extends tx {
|
|
|
14731
14731
|
throw new xg("track is not a video track");
|
|
14732
14732
|
const n = Object.assign(Object.assign({}, (g = this.roomOptions) === null || g === void 0 ? void 0 : g.publishDefaults), t), I = vm(A, e, n);
|
|
14733
14733
|
if (!I) {
|
|
14734
|
-
this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext),
|
|
14734
|
+
this.log.info("backup codec has been disabled, ignoring request to add additional codec for track", Object.assign(Object.assign({}, this.logContext), Ie(A)));
|
|
14735
14735
|
return;
|
|
14736
14736
|
}
|
|
14737
14737
|
const a = A.addSimulcastTrack(e, I);
|
|
@@ -14764,9 +14764,9 @@ class n_ extends tx {
|
|
|
14764
14764
|
var t, g;
|
|
14765
14765
|
if (mn(A)) {
|
|
14766
14766
|
const s = this.pendingPublishPromises.get(A);
|
|
14767
|
-
s && (this.log.info("awaiting publish promise before attempting to unpublish", Object.assign(Object.assign({}, this.logContext),
|
|
14767
|
+
s && (this.log.info("awaiting publish promise before attempting to unpublish", Object.assign(Object.assign({}, this.logContext), Ie(A))), yield s);
|
|
14768
14768
|
}
|
|
14769
|
-
const o = this.getPublicationForTrack(A), n = o ?
|
|
14769
|
+
const o = this.getPublicationForTrack(A), n = o ? Ie(o) : void 0;
|
|
14770
14770
|
if (this.log.debug("unpublishing track", Object.assign(Object.assign({}, this.logContext), n)), !o || !o.track) {
|
|
14771
14771
|
this.log.warn("track was not unpublished because no publication was found", Object.assign(Object.assign({}, this.logContext), n));
|
|
14772
14772
|
return;
|
|
@@ -14841,7 +14841,7 @@ class n_ extends tx {
|
|
|
14841
14841
|
var t = this;
|
|
14842
14842
|
let g = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
14843
14843
|
return function* () {
|
|
14844
|
-
const o = g.reliable ?
|
|
14844
|
+
const o = g.reliable ? ee.RELIABLE : ee.LOSSY, n = g.destinationIdentities, I = g.topic, a = new qt({
|
|
14845
14845
|
kind: o,
|
|
14846
14846
|
value: {
|
|
14847
14847
|
case: "user",
|
|
@@ -14866,7 +14866,7 @@ class n_ extends tx {
|
|
|
14866
14866
|
publishDtmf(A, e) {
|
|
14867
14867
|
return N(this, void 0, void 0, function* () {
|
|
14868
14868
|
const t = new qt({
|
|
14869
|
-
kind:
|
|
14869
|
+
kind: ee.RELIABLE,
|
|
14870
14870
|
value: {
|
|
14871
14871
|
case: "sipDtmf",
|
|
14872
14872
|
value: new Lh({
|
|
@@ -14875,7 +14875,7 @@ class n_ extends tx {
|
|
|
14875
14875
|
})
|
|
14876
14876
|
}
|
|
14877
14877
|
});
|
|
14878
|
-
yield this.engine.sendDataPacket(t,
|
|
14878
|
+
yield this.engine.sendDataPacket(t, ee.RELIABLE);
|
|
14879
14879
|
});
|
|
14880
14880
|
}
|
|
14881
14881
|
/** @deprecated Consider migrating to {@link sendText} */
|
|
@@ -14894,7 +14894,7 @@ class n_ extends tx {
|
|
|
14894
14894
|
}))
|
|
14895
14895
|
}
|
|
14896
14896
|
});
|
|
14897
|
-
return yield this.engine.sendDataPacket(g,
|
|
14897
|
+
return yield this.engine.sendDataPacket(g, ee.RELIABLE), this.emit(QA.ChatMessage, t), t;
|
|
14898
14898
|
});
|
|
14899
14899
|
}
|
|
14900
14900
|
/** @deprecated Consider migrating to {@link sendText} */
|
|
@@ -14912,7 +14912,7 @@ class n_ extends tx {
|
|
|
14912
14912
|
}))
|
|
14913
14913
|
}
|
|
14914
14914
|
});
|
|
14915
|
-
return yield this.engine.sendDataPacket(g,
|
|
14915
|
+
return yield this.engine.sendDataPacket(g, ee.RELIABLE), this.emit(QA.ChatMessage, t), t;
|
|
14916
14916
|
});
|
|
14917
14917
|
}
|
|
14918
14918
|
/**
|
|
@@ -15058,7 +15058,7 @@ class n_ extends tx {
|
|
|
15058
15058
|
return N(this, void 0, void 0, function* () {
|
|
15059
15059
|
const n = new qt({
|
|
15060
15060
|
destinationIdentities: [A],
|
|
15061
|
-
kind:
|
|
15061
|
+
kind: ee.RELIABLE,
|
|
15062
15062
|
value: {
|
|
15063
15063
|
case: "rpcRequest",
|
|
15064
15064
|
value: new Uh({
|
|
@@ -15070,7 +15070,7 @@ class n_ extends tx {
|
|
|
15070
15070
|
})
|
|
15071
15071
|
}
|
|
15072
15072
|
});
|
|
15073
|
-
yield this.engine.sendDataPacket(n,
|
|
15073
|
+
yield this.engine.sendDataPacket(n, ee.RELIABLE);
|
|
15074
15074
|
});
|
|
15075
15075
|
}
|
|
15076
15076
|
/** @internal */
|
|
@@ -15096,7 +15096,7 @@ class n_ extends tx {
|
|
|
15096
15096
|
const o = this.trackPublications.get(e.sid);
|
|
15097
15097
|
if (o) {
|
|
15098
15098
|
const n = o.isMuted || ((g = (t = o.track) === null || t === void 0 ? void 0 : t.isUpstreamPaused) !== null && g !== void 0 ? g : !1);
|
|
15099
|
-
n !== e.muted && (this.log.debug("updating server mute state after reconcile", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
15099
|
+
n !== e.muted && (this.log.debug("updating server mute state after reconcile", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(o)), {
|
|
15100
15100
|
mutedOnServer: n
|
|
15101
15101
|
})), this.engine.client.sendMuteTrack(e.sid, n));
|
|
15102
15102
|
}
|
|
@@ -15297,7 +15297,7 @@ class _s extends tx {
|
|
|
15297
15297
|
}
|
|
15298
15298
|
addTrackPublication(A) {
|
|
15299
15299
|
super.addTrackPublication(A), A.on(CA.UpdateSettings, (e) => {
|
|
15300
|
-
this.log.debug("send update settings", Object.assign(Object.assign(Object.assign({}, this.logContext),
|
|
15300
|
+
this.log.debug("send update settings", Object.assign(Object.assign(Object.assign({}, this.logContext), Ie(A)), {
|
|
15301
15301
|
settings: e
|
|
15302
15302
|
})), this.signalClient.sendUpdateTrackSettings(e);
|
|
15303
15303
|
}), A.on(CA.UpdateSubscription, (e) => {
|
|
@@ -15364,7 +15364,7 @@ class _s extends tx {
|
|
|
15364
15364
|
return;
|
|
15365
15365
|
}
|
|
15366
15366
|
if (A.readyState === "ended") {
|
|
15367
|
-
this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext),
|
|
15367
|
+
this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()", Object.assign(Object.assign({}, this.logContext), Ie(I))), this.emit(QA.TrackSubscriptionFailed, e);
|
|
15368
15368
|
return;
|
|
15369
15369
|
}
|
|
15370
15370
|
const a = A.kind === "video";
|
|
@@ -15401,13 +15401,13 @@ class _s extends tx {
|
|
|
15401
15401
|
}), I.updateInfo(g), t.set(g.sid, I);
|
|
15402
15402
|
const s = Array.from(this.trackPublications.values()).find((C) => C.source === (I == null ? void 0 : I.source));
|
|
15403
15403
|
s && I.source !== tA.Source.Unknown && this.log.debug("received a second track publication for ".concat(this.identity, " with the same source: ").concat(I.source), Object.assign(Object.assign({}, this.logContext), {
|
|
15404
|
-
oldTrack:
|
|
15405
|
-
newTrack:
|
|
15404
|
+
oldTrack: Ie(s),
|
|
15405
|
+
newTrack: Ie(I)
|
|
15406
15406
|
})), this.addTrackPublication(I);
|
|
15407
15407
|
}
|
|
15408
15408
|
e.set(g.sid, I);
|
|
15409
15409
|
}), this.trackPublications.forEach((g) => {
|
|
15410
|
-
e.has(g.trackSid) || (this.log.trace("detected removed track on remote participant, unpublishing", Object.assign(Object.assign({}, this.logContext),
|
|
15410
|
+
e.has(g.trackSid) || (this.log.trace("detected removed track on remote participant, unpublishing", Object.assign(Object.assign({}, this.logContext), Ie(g))), this.unpublishTrack(g.trackSid, !0));
|
|
15411
15411
|
}), t.forEach((g) => {
|
|
15412
15412
|
this.emit(QA.TrackPublished, g);
|
|
15413
15413
|
}), !0;
|
|
@@ -15465,7 +15465,7 @@ class Ln extends eg.EventEmitter {
|
|
|
15465
15465
|
*/
|
|
15466
15466
|
constructor(A) {
|
|
15467
15467
|
var e, t, g, o;
|
|
15468
|
-
if (super(), e = this, this.state = fe.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log =
|
|
15468
|
+
if (super(), e = this, this.state = fe.Disconnected, this.activeSpeakers = [], this.isE2EEEnabled = !1, this.audioEnabled = !0, this.isVideoPlaybackBlocked = !1, this.log = re, this.bufferedEvents = [], this.isResuming = !1, this.rpcHandlers = /* @__PURE__ */ new Map(), this.connect = (n, I, a) => N(this, void 0, void 0, function* () {
|
|
15469
15469
|
var s;
|
|
15470
15470
|
if (!Uw())
|
|
15471
15471
|
throw zi() ? Error("WebRTC isn't detected, have you called registerGlobals?") : Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");
|
|
@@ -15490,12 +15490,12 @@ class Ln extends eg.EventEmitter {
|
|
|
15490
15490
|
try {
|
|
15491
15491
|
yield this.attemptConnection(c ?? n, I, a, x), this.abortController = void 0, B();
|
|
15492
15492
|
} catch (p) {
|
|
15493
|
-
if (this.regionUrlProvider && p instanceof Le && p.reason !==
|
|
15493
|
+
if (this.regionUrlProvider && p instanceof Le && p.reason !== Be.Cancelled && p.reason !== Be.NotAllowed) {
|
|
15494
15494
|
let u = null;
|
|
15495
15495
|
try {
|
|
15496
15496
|
u = yield this.regionUrlProvider.getNextBestRegionUrl((h = this.abortController) === null || h === void 0 ? void 0 : h.signal);
|
|
15497
15497
|
} catch (D) {
|
|
15498
|
-
if (D instanceof Le && (D.status === 401 || D.reason ===
|
|
15498
|
+
if (D instanceof Le && (D.status === 401 || D.reason === Be.Cancelled)) {
|
|
15499
15499
|
this.handleDisconnect(this.options.stopLocalTrackOnUnpublish), d(D);
|
|
15500
15500
|
return;
|
|
15501
15501
|
}
|
|
@@ -15554,13 +15554,13 @@ class Ln extends eg.EventEmitter {
|
|
|
15554
15554
|
this.applyJoinResponse(Q), this.setupLocalParticipantEvents(), this.emit(IA.SignalConnected);
|
|
15555
15555
|
} catch (Q) {
|
|
15556
15556
|
yield this.engine.close(), this.recreateEngine();
|
|
15557
|
-
const B = new Le("could not establish signal connection",
|
|
15557
|
+
const B = new Le("could not establish signal connection", Be.ServerUnreachable);
|
|
15558
15558
|
throw Q instanceof Error && (B.message = "".concat(B.message, ": ").concat(Q.message)), Q instanceof Le && (B.reason = Q.reason, B.status = Q.status), this.log.debug("error trying to establish signal connection", Object.assign(Object.assign({}, this.logContext), {
|
|
15559
15559
|
error: Q
|
|
15560
15560
|
})), B;
|
|
15561
15561
|
}
|
|
15562
15562
|
if (s.signal.aborted)
|
|
15563
|
-
throw yield this.engine.close(), this.recreateEngine(), new Le("Connection attempt aborted",
|
|
15563
|
+
throw yield this.engine.close(), this.recreateEngine(), new Le("Connection attempt aborted", Be.Cancelled);
|
|
15564
15564
|
try {
|
|
15565
15565
|
yield this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout, s);
|
|
15566
15566
|
} catch (Q) {
|
|
@@ -15581,7 +15581,7 @@ class Ln extends eg.EventEmitter {
|
|
|
15581
15581
|
s.log.debug("already disconnected", s.logContext);
|
|
15582
15582
|
return;
|
|
15583
15583
|
}
|
|
15584
|
-
s.log.info("disconnect from room", Object.assign({}, s.logContext)), (s.state === fe.Connecting || s.state === fe.Reconnecting || s.isResuming) && (s.log.warn("abort connection attempt", s.logContext), (r = s.abortController) === null || r === void 0 || r.abort(), (B = (Q = s.connectFuture) === null || Q === void 0 ? void 0 : Q.reject) === null || B === void 0 || B.call(Q, new Le("Client initiated disconnect",
|
|
15584
|
+
s.log.info("disconnect from room", Object.assign({}, s.logContext)), (s.state === fe.Connecting || s.state === fe.Reconnecting || s.isResuming) && (s.log.warn("abort connection attempt", s.logContext), (r = s.abortController) === null || r === void 0 || r.abort(), (B = (Q = s.connectFuture) === null || Q === void 0 ? void 0 : Q.reject) === null || B === void 0 || B.call(Q, new Le("Client initiated disconnect", Be.Cancelled)), s.connectFuture = void 0), !((d = s.engine) === null || d === void 0) && d.client.isDisconnected || (yield s.engine.client.sendLeave()), s.engine && (yield s.engine.close()), s.handleDisconnect(C, Si.CLIENT_INITIATED), s.engine = void 0;
|
|
15585
15585
|
} finally {
|
|
15586
15586
|
c();
|
|
15587
15587
|
}
|
|
@@ -16908,7 +16908,7 @@ class c_ extends Bo {
|
|
|
16908
16908
|
});
|
|
16909
16909
|
});
|
|
16910
16910
|
try {
|
|
16911
|
-
yield this.connect(),
|
|
16911
|
+
yield this.connect(), re.info("now the room is connected");
|
|
16912
16912
|
} catch (t) {
|
|
16913
16913
|
throw this.appendWarning("ports need to be open on firewall in order to connect."), t;
|
|
16914
16914
|
}
|
|
@@ -34132,7 +34132,7 @@ function oa() {
|
|
|
34132
34132
|
const i = Math.random() * 4294967295 | 0, A = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0;
|
|
34133
34133
|
return (mt[i & 255] + mt[i >> 8 & 255] + mt[i >> 16 & 255] + mt[i >> 24 & 255] + "-" + mt[A & 255] + mt[A >> 8 & 255] + "-" + mt[A >> 16 & 15 | 64] + mt[A >> 24 & 255] + "-" + mt[e & 63 | 128] + mt[e >> 8 & 255] + "-" + mt[e >> 16 & 255] + mt[e >> 24 & 255] + mt[t & 255] + mt[t >> 8 & 255] + mt[t >> 16 & 255] + mt[t >> 24 & 255]).toLowerCase();
|
|
34134
34134
|
}
|
|
34135
|
-
function
|
|
34135
|
+
function Qe(i, A, e) {
|
|
34136
34136
|
return Math.max(A, Math.min(e, i));
|
|
34137
34137
|
}
|
|
34138
34138
|
function XS(i, A) {
|
|
@@ -34447,7 +34447,7 @@ class De {
|
|
|
34447
34447
|
* @return {Vector2} A reference to this vector.
|
|
34448
34448
|
*/
|
|
34449
34449
|
clamp(A, e) {
|
|
34450
|
-
return this.x =
|
|
34450
|
+
return this.x = Qe(this.x, A.x, e.x), this.y = Qe(this.y, A.y, e.y), this;
|
|
34451
34451
|
}
|
|
34452
34452
|
/**
|
|
34453
34453
|
* If this vector's x or y values are greater than the max value, they are
|
|
@@ -34460,7 +34460,7 @@ class De {
|
|
|
34460
34460
|
* @return {Vector2} A reference to this vector.
|
|
34461
34461
|
*/
|
|
34462
34462
|
clampScalar(A, e) {
|
|
34463
|
-
return this.x =
|
|
34463
|
+
return this.x = Qe(this.x, A, e), this.y = Qe(this.y, A, e), this;
|
|
34464
34464
|
}
|
|
34465
34465
|
/**
|
|
34466
34466
|
* If this vector's length is greater than the max value, it is replaced by
|
|
@@ -34474,7 +34474,7 @@ class De {
|
|
|
34474
34474
|
*/
|
|
34475
34475
|
clampLength(A, e) {
|
|
34476
34476
|
const t = this.length();
|
|
34477
|
-
return this.divideScalar(t || 1).multiplyScalar(
|
|
34477
|
+
return this.divideScalar(t || 1).multiplyScalar(Qe(t, A, e));
|
|
34478
34478
|
}
|
|
34479
34479
|
/**
|
|
34480
34480
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -34588,7 +34588,7 @@ class De {
|
|
|
34588
34588
|
const e = Math.sqrt(this.lengthSq() * A.lengthSq());
|
|
34589
34589
|
if (e === 0) return Math.PI / 2;
|
|
34590
34590
|
const t = this.dot(A) / e;
|
|
34591
|
-
return Math.acos(
|
|
34591
|
+
return Math.acos(Qe(t, -1, 1));
|
|
34592
34592
|
}
|
|
34593
34593
|
/**
|
|
34594
34594
|
* Computes the distance from the given vector to this instance.
|
|
@@ -34951,7 +34951,7 @@ class na {
|
|
|
34951
34951
|
* @return {number} The angle in radians.
|
|
34952
34952
|
*/
|
|
34953
34953
|
angleTo(A) {
|
|
34954
|
-
return 2 * Math.acos(Math.abs(
|
|
34954
|
+
return 2 * Math.acos(Math.abs(Qe(this.dot(A), -1, 1)));
|
|
34955
34955
|
}
|
|
34956
34956
|
/**
|
|
34957
34957
|
* Rotates this quaternion by a given angular step to the given quaternion.
|
|
@@ -35517,7 +35517,7 @@ class J {
|
|
|
35517
35517
|
* @return {Vector3} A reference to this vector.
|
|
35518
35518
|
*/
|
|
35519
35519
|
clamp(A, e) {
|
|
35520
|
-
return this.x =
|
|
35520
|
+
return this.x = Qe(this.x, A.x, e.x), this.y = Qe(this.y, A.y, e.y), this.z = Qe(this.z, A.z, e.z), this;
|
|
35521
35521
|
}
|
|
35522
35522
|
/**
|
|
35523
35523
|
* If this vector's x, y or z values are greater than the max value, they are
|
|
@@ -35530,7 +35530,7 @@ class J {
|
|
|
35530
35530
|
* @return {Vector3} A reference to this vector.
|
|
35531
35531
|
*/
|
|
35532
35532
|
clampScalar(A, e) {
|
|
35533
|
-
return this.x =
|
|
35533
|
+
return this.x = Qe(this.x, A, e), this.y = Qe(this.y, A, e), this.z = Qe(this.z, A, e), this;
|
|
35534
35534
|
}
|
|
35535
35535
|
/**
|
|
35536
35536
|
* If this vector's length is greater than the max value, it is replaced by
|
|
@@ -35544,7 +35544,7 @@ class J {
|
|
|
35544
35544
|
*/
|
|
35545
35545
|
clampLength(A, e) {
|
|
35546
35546
|
const t = this.length();
|
|
35547
|
-
return this.divideScalar(t || 1).multiplyScalar(
|
|
35547
|
+
return this.divideScalar(t || 1).multiplyScalar(Qe(t, A, e));
|
|
35548
35548
|
}
|
|
35549
35549
|
/**
|
|
35550
35550
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -35728,7 +35728,7 @@ class J {
|
|
|
35728
35728
|
const e = Math.sqrt(this.lengthSq() * A.lengthSq());
|
|
35729
35729
|
if (e === 0) return Math.PI / 2;
|
|
35730
35730
|
const t = this.dot(A) / e;
|
|
35731
|
-
return Math.acos(
|
|
35731
|
+
return Math.acos(Qe(t, -1, 1));
|
|
35732
35732
|
}
|
|
35733
35733
|
/**
|
|
35734
35734
|
* Computes the distance from the given vector to this instance.
|
|
@@ -37090,7 +37090,7 @@ class ot {
|
|
|
37090
37090
|
* @return {Vector4} A reference to this vector.
|
|
37091
37091
|
*/
|
|
37092
37092
|
clamp(A, e) {
|
|
37093
|
-
return this.x =
|
|
37093
|
+
return this.x = Qe(this.x, A.x, e.x), this.y = Qe(this.y, A.y, e.y), this.z = Qe(this.z, A.z, e.z), this.w = Qe(this.w, A.w, e.w), this;
|
|
37094
37094
|
}
|
|
37095
37095
|
/**
|
|
37096
37096
|
* If this vector's x, y, z or w values are greater than the max value, they are
|
|
@@ -37103,7 +37103,7 @@ class ot {
|
|
|
37103
37103
|
* @return {Vector4} A reference to this vector.
|
|
37104
37104
|
*/
|
|
37105
37105
|
clampScalar(A, e) {
|
|
37106
|
-
return this.x =
|
|
37106
|
+
return this.x = Qe(this.x, A, e), this.y = Qe(this.y, A, e), this.z = Qe(this.z, A, e), this.w = Qe(this.w, A, e), this;
|
|
37107
37107
|
}
|
|
37108
37108
|
/**
|
|
37109
37109
|
* If this vector's length is greater than the max value, it is replaced by
|
|
@@ -37117,7 +37117,7 @@ class ot {
|
|
|
37117
37117
|
*/
|
|
37118
37118
|
clampLength(A, e) {
|
|
37119
37119
|
const t = this.length();
|
|
37120
|
-
return this.divideScalar(t || 1).multiplyScalar(
|
|
37120
|
+
return this.divideScalar(t || 1).multiplyScalar(Qe(t, A, e));
|
|
37121
37121
|
}
|
|
37122
37122
|
/**
|
|
37123
37123
|
* The components of this vector are rounded down to the nearest integer value.
|
|
@@ -39203,22 +39203,22 @@ class Mg {
|
|
|
39203
39203
|
const g = A.elements, o = g[0], n = g[4], I = g[8], a = g[1], s = g[5], C = g[9], r = g[2], Q = g[6], B = g[10];
|
|
39204
39204
|
switch (e) {
|
|
39205
39205
|
case "XYZ":
|
|
39206
|
-
this._y = Math.asin(
|
|
39206
|
+
this._y = Math.asin(Qe(I, -1, 1)), Math.abs(I) < 0.9999999 ? (this._x = Math.atan2(-C, B), this._z = Math.atan2(-n, o)) : (this._x = Math.atan2(Q, s), this._z = 0);
|
|
39207
39207
|
break;
|
|
39208
39208
|
case "YXZ":
|
|
39209
|
-
this._x = Math.asin(-
|
|
39209
|
+
this._x = Math.asin(-Qe(C, -1, 1)), Math.abs(C) < 0.9999999 ? (this._y = Math.atan2(I, B), this._z = Math.atan2(a, s)) : (this._y = Math.atan2(-r, o), this._z = 0);
|
|
39210
39210
|
break;
|
|
39211
39211
|
case "ZXY":
|
|
39212
|
-
this._x = Math.asin(
|
|
39212
|
+
this._x = Math.asin(Qe(Q, -1, 1)), Math.abs(Q) < 0.9999999 ? (this._y = Math.atan2(-r, B), this._z = Math.atan2(-n, s)) : (this._y = 0, this._z = Math.atan2(a, o));
|
|
39213
39213
|
break;
|
|
39214
39214
|
case "ZYX":
|
|
39215
|
-
this._y = Math.asin(-
|
|
39215
|
+
this._y = Math.asin(-Qe(r, -1, 1)), Math.abs(r) < 0.9999999 ? (this._x = Math.atan2(Q, B), this._z = Math.atan2(a, o)) : (this._x = 0, this._z = Math.atan2(-n, s));
|
|
39216
39216
|
break;
|
|
39217
39217
|
case "YZX":
|
|
39218
|
-
this._z = Math.asin(
|
|
39218
|
+
this._z = Math.asin(Qe(a, -1, 1)), Math.abs(a) < 0.9999999 ? (this._x = Math.atan2(-C, s), this._y = Math.atan2(-r, o)) : (this._x = 0, this._y = Math.atan2(I, B));
|
|
39219
39219
|
break;
|
|
39220
39220
|
case "XZY":
|
|
39221
|
-
this._z = Math.asin(-
|
|
39221
|
+
this._z = Math.asin(-Qe(n, -1, 1)), Math.abs(n) < 0.9999999 ? (this._x = Math.atan2(Q, s), this._y = Math.atan2(I, o)) : (this._x = Math.atan2(-C, B), this._y = 0);
|
|
39222
39222
|
break;
|
|
39223
39223
|
default:
|
|
39224
39224
|
PA("Euler: .setFromRotationMatrix() encountered an unknown order: " + e);
|
|
@@ -40471,7 +40471,7 @@ const kf = {
|
|
|
40471
40471
|
function _r(i, A, e) {
|
|
40472
40472
|
return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? i + (A - i) * 6 * e : e < 1 / 2 ? A : e < 2 / 3 ? i + (A - i) * 6 * (2 / 3 - e) : i;
|
|
40473
40473
|
}
|
|
40474
|
-
class
|
|
40474
|
+
class Ee {
|
|
40475
40475
|
/**
|
|
40476
40476
|
* Constructs a new color.
|
|
40477
40477
|
*
|
|
@@ -40544,7 +40544,7 @@ class re {
|
|
|
40544
40544
|
* @return {Color} A reference to this color.
|
|
40545
40545
|
*/
|
|
40546
40546
|
setHSL(A, e, t, g = de.workingColorSpace) {
|
|
40547
|
-
if (A = XS(A, 1), e =
|
|
40547
|
+
if (A = XS(A, 1), e = Qe(e, 0, 1), t = Qe(t, 0, 1), e === 0)
|
|
40548
40548
|
this.r = this.g = this.b = t;
|
|
40549
40549
|
else {
|
|
40550
40550
|
const o = t <= 0.5 ? t * (1 + e) : t + e - t * e, n = 2 * t - o;
|
|
@@ -40694,7 +40694,7 @@ class re {
|
|
|
40694
40694
|
* @return {number} The hexadecimal value.
|
|
40695
40695
|
*/
|
|
40696
40696
|
getHex(A = ni) {
|
|
40697
|
-
return de.workingToColorSpace(_t.copy(this), A), Math.round(
|
|
40697
|
+
return de.workingToColorSpace(_t.copy(this), A), Math.round(Qe(_t.r * 255, 0, 255)) * 65536 + Math.round(Qe(_t.g * 255, 0, 255)) * 256 + Math.round(Qe(_t.b * 255, 0, 255));
|
|
40698
40698
|
}
|
|
40699
40699
|
/**
|
|
40700
40700
|
* Returns the hexadecimal value of this color as a string (for example, 'FFFFFF').
|
|
@@ -40939,15 +40939,15 @@ class re {
|
|
|
40939
40939
|
yield this.r, yield this.g, yield this.b;
|
|
40940
40940
|
}
|
|
40941
40941
|
}
|
|
40942
|
-
const _t = /* @__PURE__ */ new
|
|
40943
|
-
|
|
40942
|
+
const _t = /* @__PURE__ */ new Ee();
|
|
40943
|
+
Ee.NAMES = kf;
|
|
40944
40944
|
let QR = 0;
|
|
40945
40945
|
class aC extends jn {
|
|
40946
40946
|
/**
|
|
40947
40947
|
* Constructs a new material.
|
|
40948
40948
|
*/
|
|
40949
40949
|
constructor() {
|
|
40950
|
-
super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: QR++ }), this.uuid = oa(), this.name = "", this.type = "Material", this.blending = bn, this.side = Rg, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = VQ, this.blendDst = jQ, this.blendEquation = yo, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new
|
|
40950
|
+
super(), this.isMaterial = !0, Object.defineProperty(this, "id", { value: QR++ }), this.uuid = oa(), this.name = "", this.type = "Material", this.blending = bn, this.side = Rg, this.vertexColors = !1, this.opacity = 1, this.transparent = !1, this.alphaHash = !1, this.blendSrc = VQ, this.blendDst = jQ, this.blendEquation = yo, this.blendSrcAlpha = null, this.blendDstAlpha = null, this.blendEquationAlpha = null, this.blendColor = new Ee(0, 0, 0), this.blendAlpha = 0, this.depthFunc = Tn, this.depthTest = !0, this.depthWrite = !0, this.stencilWriteMask = 255, this.stencilFunc = dd, this.stencilRef = 0, this.stencilFuncMask = 255, this.stencilFail = $o, this.stencilZFail = $o, this.stencilZPass = $o, this.stencilWrite = !1, this.clippingPlanes = null, this.clipIntersection = !1, this.clipShadows = !1, this.shadowSide = null, this.colorWrite = !0, this.precision = null, this.polygonOffset = !1, this.polygonOffsetFactor = 0, this.polygonOffsetUnits = 0, this.dithering = !1, this.alphaToCoverage = !1, this.premultipliedAlpha = !1, this.forceSinglePass = !1, this.allowOverride = !0, this.visible = !0, this.toneMapped = !0, this.userData = {}, this.version = 0, this._alphaTest = 0;
|
|
40951
40951
|
}
|
|
40952
40952
|
/**
|
|
40953
40953
|
* Sets the alpha value to be used when running an alpha test. The material
|
|
@@ -41119,7 +41119,7 @@ class yf extends aC {
|
|
|
41119
41119
|
* by {@link Color#set}.
|
|
41120
41120
|
*/
|
|
41121
41121
|
constructor(A) {
|
|
41122
|
-
super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new
|
|
41122
|
+
super(), this.isMeshBasicMaterial = !0, this.type = "MeshBasicMaterial", this.color = new Ee(16777215), this.map = null, this.lightMap = null, this.lightMapIntensity = 1, this.aoMap = null, this.aoMapIntensity = 1, this.specularMap = null, this.alphaMap = null, this.envMap = null, this.envMapRotation = new Mg(), this.combine = af, this.reflectivity = 1, this.refractionRatio = 0.98, this.wireframe = !1, this.wireframeLinewidth = 1, this.wireframeLinecap = "round", this.wireframeLinejoin = "round", this.fog = !0, this.setValues(A);
|
|
41123
41123
|
}
|
|
41124
41124
|
copy(A) {
|
|
41125
41125
|
return super.copy(A), this.color.copy(A.color), this.map = A.map, this.lightMap = A.lightMap, this.lightMapIntensity = A.lightMapIntensity, this.aoMap = A.aoMap, this.aoMapIntensity = A.aoMapIntensity, this.specularMap = A.specularMap, this.alphaMap = A.alphaMap, this.envMap = A.envMap, this.envMapRotation.copy(A.envMapRotation), this.combine = A.combine, this.reflectivity = A.reflectivity, this.refractionRatio = A.refractionRatio, this.wireframe = A.wireframe, this.wireframeLinewidth = A.wireframeLinewidth, this.wireframeLinecap = A.wireframeLinecap, this.wireframeLinejoin = A.wireframeLinejoin, this.fog = A.fog, this;
|
|
@@ -47710,7 +47710,7 @@ void main() {
|
|
|
47710
47710
|
sprite_frag: BM
|
|
47711
47711
|
}, fA = {
|
|
47712
47712
|
common: {
|
|
47713
|
-
diffuse: { value: /* @__PURE__ */ new
|
|
47713
|
+
diffuse: { value: /* @__PURE__ */ new Ee(16777215) },
|
|
47714
47714
|
opacity: { value: 1 },
|
|
47715
47715
|
map: { value: null },
|
|
47716
47716
|
mapTransform: { value: /* @__PURE__ */ new ZA() },
|
|
@@ -47780,7 +47780,7 @@ void main() {
|
|
|
47780
47780
|
fogDensity: { value: 25e-5 },
|
|
47781
47781
|
fogNear: { value: 1 },
|
|
47782
47782
|
fogFar: { value: 2e3 },
|
|
47783
|
-
fogColor: { value: /* @__PURE__ */ new
|
|
47783
|
+
fogColor: { value: /* @__PURE__ */ new Ee(16777215) }
|
|
47784
47784
|
},
|
|
47785
47785
|
lights: {
|
|
47786
47786
|
ambientLightColor: { value: [] },
|
|
@@ -47850,7 +47850,7 @@ void main() {
|
|
|
47850
47850
|
ltc_2: { value: null }
|
|
47851
47851
|
},
|
|
47852
47852
|
points: {
|
|
47853
|
-
diffuse: { value: /* @__PURE__ */ new
|
|
47853
|
+
diffuse: { value: /* @__PURE__ */ new Ee(16777215) },
|
|
47854
47854
|
opacity: { value: 1 },
|
|
47855
47855
|
size: { value: 1 },
|
|
47856
47856
|
scale: { value: 1 },
|
|
@@ -47861,7 +47861,7 @@ void main() {
|
|
|
47861
47861
|
uvTransform: { value: /* @__PURE__ */ new ZA() }
|
|
47862
47862
|
},
|
|
47863
47863
|
sprite: {
|
|
47864
|
-
diffuse: { value: /* @__PURE__ */ new
|
|
47864
|
+
diffuse: { value: /* @__PURE__ */ new Ee(16777215) },
|
|
47865
47865
|
opacity: { value: 1 },
|
|
47866
47866
|
center: { value: /* @__PURE__ */ new De(0.5, 0.5) },
|
|
47867
47867
|
rotation: { value: 0 },
|
|
@@ -47898,7 +47898,7 @@ void main() {
|
|
|
47898
47898
|
fA.fog,
|
|
47899
47899
|
fA.lights,
|
|
47900
47900
|
{
|
|
47901
|
-
emissive: { value: /* @__PURE__ */ new
|
|
47901
|
+
emissive: { value: /* @__PURE__ */ new Ee(0) }
|
|
47902
47902
|
}
|
|
47903
47903
|
]),
|
|
47904
47904
|
vertexShader: XA.meshlambert_vert,
|
|
@@ -47918,8 +47918,8 @@ void main() {
|
|
|
47918
47918
|
fA.fog,
|
|
47919
47919
|
fA.lights,
|
|
47920
47920
|
{
|
|
47921
|
-
emissive: { value: /* @__PURE__ */ new
|
|
47922
|
-
specular: { value: /* @__PURE__ */ new
|
|
47921
|
+
emissive: { value: /* @__PURE__ */ new Ee(0) },
|
|
47922
|
+
specular: { value: /* @__PURE__ */ new Ee(1118481) },
|
|
47923
47923
|
shininess: { value: 30 }
|
|
47924
47924
|
}
|
|
47925
47925
|
]),
|
|
@@ -47941,7 +47941,7 @@ void main() {
|
|
|
47941
47941
|
fA.fog,
|
|
47942
47942
|
fA.lights,
|
|
47943
47943
|
{
|
|
47944
|
-
emissive: { value: /* @__PURE__ */ new
|
|
47944
|
+
emissive: { value: /* @__PURE__ */ new Ee(0) },
|
|
47945
47945
|
roughness: { value: 1 },
|
|
47946
47946
|
metalness: { value: 0 },
|
|
47947
47947
|
envMapIntensity: { value: 1 }
|
|
@@ -47963,7 +47963,7 @@ void main() {
|
|
|
47963
47963
|
fA.fog,
|
|
47964
47964
|
fA.lights,
|
|
47965
47965
|
{
|
|
47966
|
-
emissive: { value: /* @__PURE__ */ new
|
|
47966
|
+
emissive: { value: /* @__PURE__ */ new Ee(0) }
|
|
47967
47967
|
}
|
|
47968
47968
|
]),
|
|
47969
47969
|
vertexShader: XA.meshtoon_vert,
|
|
@@ -48087,7 +48087,7 @@ void main() {
|
|
|
48087
48087
|
fA.lights,
|
|
48088
48088
|
fA.fog,
|
|
48089
48089
|
{
|
|
48090
|
-
color: { value: /* @__PURE__ */ new
|
|
48090
|
+
color: { value: /* @__PURE__ */ new Ee(0) },
|
|
48091
48091
|
opacity: { value: 1 }
|
|
48092
48092
|
}
|
|
48093
48093
|
]),
|
|
@@ -48118,7 +48118,7 @@ qi.physical = {
|
|
|
48118
48118
|
iridescenceThicknessMap: { value: null },
|
|
48119
48119
|
iridescenceThicknessMapTransform: { value: /* @__PURE__ */ new ZA() },
|
|
48120
48120
|
sheen: { value: 0 },
|
|
48121
|
-
sheenColor: { value: /* @__PURE__ */ new
|
|
48121
|
+
sheenColor: { value: /* @__PURE__ */ new Ee(0) },
|
|
48122
48122
|
sheenColorMap: { value: null },
|
|
48123
48123
|
sheenColorMapTransform: { value: /* @__PURE__ */ new ZA() },
|
|
48124
48124
|
sheenRoughness: { value: 1 },
|
|
@@ -48133,8 +48133,8 @@ qi.physical = {
|
|
|
48133
48133
|
thicknessMap: { value: null },
|
|
48134
48134
|
thicknessMapTransform: { value: /* @__PURE__ */ new ZA() },
|
|
48135
48135
|
attenuationDistance: { value: 0 },
|
|
48136
|
-
attenuationColor: { value: /* @__PURE__ */ new
|
|
48137
|
-
specularColor: { value: /* @__PURE__ */ new
|
|
48136
|
+
attenuationColor: { value: /* @__PURE__ */ new Ee(0) },
|
|
48137
|
+
specularColor: { value: /* @__PURE__ */ new Ee(1, 1, 1) },
|
|
48138
48138
|
specularColorMap: { value: null },
|
|
48139
48139
|
specularColorMapTransform: { value: /* @__PURE__ */ new ZA() },
|
|
48140
48140
|
specularIntensity: { value: 1 },
|
|
@@ -48150,7 +48150,7 @@ qi.physical = {
|
|
|
48150
48150
|
};
|
|
48151
48151
|
const La = { r: 0, b: 0, g: 0 }, Do = /* @__PURE__ */ new Mg(), EM = /* @__PURE__ */ new rt();
|
|
48152
48152
|
function cM(i, A, e, t, g, o, n) {
|
|
48153
|
-
const I = new
|
|
48153
|
+
const I = new Ee(0);
|
|
48154
48154
|
let a = o === !0 ? 0 : 1, s, C, r = null, Q = 0, B = null;
|
|
48155
48155
|
function d(p) {
|
|
48156
48156
|
let u = p.isScene === !0 ? p.background : null;
|
|
@@ -48326,7 +48326,7 @@ function dM(i, A) {
|
|
|
48326
48326
|
if (DA === void 0 && (V === "instanceMatrix" && m.instanceMatrix && (DA = m.instanceMatrix), V === "instanceColor" && m.instanceColor && (DA = m.instanceColor)), DA !== void 0) {
|
|
48327
48327
|
const EA = DA.normalized, wA = DA.itemSize, VA = A.get(DA);
|
|
48328
48328
|
if (VA === void 0) continue;
|
|
48329
|
-
const OA = VA.buffer, Pe = VA.type, Se = VA.bytesPerElement,
|
|
48329
|
+
const OA = VA.buffer, Pe = VA.type, Se = VA.bytesPerElement, z = Pe === i.INT || Pe === i.UNSIGNED_INT || DA.gpuType === NE;
|
|
48330
48330
|
if (DA.isInterleavedBufferAttribute) {
|
|
48331
48331
|
const oA = DA.data, RA = oA.stride, jA = DA.offset;
|
|
48332
48332
|
if (oA.isInstancedInterleavedBuffer) {
|
|
@@ -48345,7 +48345,7 @@ function dM(i, A) {
|
|
|
48345
48345
|
EA,
|
|
48346
48346
|
RA * Se,
|
|
48347
48347
|
(jA + wA / $.locationSize * GA) * Se,
|
|
48348
|
-
|
|
48348
|
+
z
|
|
48349
48349
|
);
|
|
48350
48350
|
} else {
|
|
48351
48351
|
if (DA.isInstancedBufferAttribute) {
|
|
@@ -48364,7 +48364,7 @@ function dM(i, A) {
|
|
|
48364
48364
|
EA,
|
|
48365
48365
|
wA * Se,
|
|
48366
48366
|
wA / $.locationSize * oA * Se,
|
|
48367
|
-
|
|
48367
|
+
z
|
|
48368
48368
|
);
|
|
48369
48369
|
}
|
|
48370
48370
|
} else if (P !== void 0) {
|
|
@@ -48611,7 +48611,7 @@ function uM(i) {
|
|
|
48611
48611
|
dispose: o
|
|
48612
48612
|
};
|
|
48613
48613
|
}
|
|
48614
|
-
const $g = 4, Ud = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], So = 20, fM = 256, EI = /* @__PURE__ */ new Lf(), Td = /* @__PURE__ */ new
|
|
48614
|
+
const $g = 4, Ud = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582], So = 20, fM = 256, EI = /* @__PURE__ */ new Lf(), Td = /* @__PURE__ */ new Ee();
|
|
48615
48615
|
let br = null, Nr = 0, Mr = 0, Gr = !1;
|
|
48616
48616
|
const DM = /* @__PURE__ */ new J();
|
|
48617
48617
|
class Kd {
|
|
@@ -50724,13 +50724,13 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50724
50724
|
const EA = W.morphAttributes.position || W.morphAttributes.normal || W.morphAttributes.color, wA = EA !== void 0 ? EA.length : 0;
|
|
50725
50725
|
let VA = 0;
|
|
50726
50726
|
W.morphAttributes.position !== void 0 && (VA = 1), W.morphAttributes.normal !== void 0 && (VA = 2), W.morphAttributes.color !== void 0 && (VA = 3);
|
|
50727
|
-
let OA, Pe, Se,
|
|
50727
|
+
let OA, Pe, Se, z;
|
|
50728
50728
|
if (DA) {
|
|
50729
50729
|
const me = qi[DA];
|
|
50730
50730
|
OA = me.vertexShader, Pe = me.fragmentShader;
|
|
50731
50731
|
} else
|
|
50732
|
-
OA = l.vertexShader, Pe = l.fragmentShader, a.update(l), Se = a.getVertexShaderID(l),
|
|
50733
|
-
const oA = i.getRenderTarget(), RA = i.state.buffers.depth.getReversed(), jA = T.isInstancedMesh === !0, GA = T.isBatchedMesh === !0, le = !!l.map, dt = !!l.matcap, ce = !!V, we = !!l.aoMap, Fe = !!l.lightMap,
|
|
50732
|
+
OA = l.vertexShader, Pe = l.fragmentShader, a.update(l), Se = a.getVertexShaderID(l), z = a.getFragmentShaderID(l);
|
|
50733
|
+
const oA = i.getRenderTarget(), RA = i.state.buffers.depth.getReversed(), jA = T.isInstancedMesh === !0, GA = T.isBatchedMesh === !0, le = !!l.map, dt = !!l.matcap, ce = !!V, we = !!l.aoMap, Fe = !!l.lightMap, $A = !!l.bumpMap, nt = !!l.normalMap, M = !!l.displacementMap, It = !!l.emissiveMap, pe = !!l.metalnessMap, Te = !!l.roughnessMap, vA = l.anisotropy > 0, y = l.clearcoat > 0, f = l.dispersion > 0, F = l.iridescence > 0, X = l.sheen > 0, gA = l.transmission > 0, j = vA && !!l.anisotropyMap, UA = y && !!l.clearcoatMap, dA = y && !!l.clearcoatNormalMap, FA = y && !!l.clearcoatRoughnessMap, qA = F && !!l.iridescenceMap, sA = F && !!l.iridescenceThicknessMap, lA = X && !!l.sheenColorMap, MA = X && !!l.sheenRoughnessMap, LA = !!l.specularMap, hA = !!l.specularColorMap, Ae = !!l.specularIntensityMap, G = gA && !!l.transmissionMap, mA = gA && !!l.thicknessMap, rA = !!l.gradientMap, kA = !!l.alphaMap, aA = l.alphaTest > 0, eA = !!l.alphaHash, cA = !!l.extensions;
|
|
50734
50734
|
let HA = Wi;
|
|
50735
50735
|
l.toneMapped && (oA === null || oA.isXRRenderTarget === !0) && (HA = i.toneMapping);
|
|
50736
50736
|
const Ke = {
|
|
@@ -50741,7 +50741,7 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50741
50741
|
fragmentShader: Pe,
|
|
50742
50742
|
defines: l.defines,
|
|
50743
50743
|
customVertexShaderID: Se,
|
|
50744
|
-
customFragmentShaderID:
|
|
50744
|
+
customFragmentShaderID: z,
|
|
50745
50745
|
isRawShaderMaterial: l.isRawShaderMaterial === !0,
|
|
50746
50746
|
glslVersion: l.glslVersion,
|
|
50747
50747
|
precision: B,
|
|
@@ -50759,7 +50759,7 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50759
50759
|
envMapCubeUVHeight: $,
|
|
50760
50760
|
aoMap: we,
|
|
50761
50761
|
lightMap: Fe,
|
|
50762
|
-
bumpMap:
|
|
50762
|
+
bumpMap: $A,
|
|
50763
50763
|
normalMap: nt,
|
|
50764
50764
|
displacementMap: M,
|
|
50765
50765
|
emissiveMap: It,
|
|
@@ -50777,12 +50777,12 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50777
50777
|
iridescence: F,
|
|
50778
50778
|
iridescenceMap: qA,
|
|
50779
50779
|
iridescenceThicknessMap: sA,
|
|
50780
|
-
sheen:
|
|
50780
|
+
sheen: X,
|
|
50781
50781
|
sheenColorMap: lA,
|
|
50782
50782
|
sheenRoughnessMap: MA,
|
|
50783
50783
|
specularMap: LA,
|
|
50784
50784
|
specularColorMap: hA,
|
|
50785
|
-
specularIntensityMap:
|
|
50785
|
+
specularIntensityMap: Ae,
|
|
50786
50786
|
transmission: gA,
|
|
50787
50787
|
transmissionMap: G,
|
|
50788
50788
|
thicknessMap: mA,
|
|
@@ -50796,7 +50796,7 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50796
50796
|
mapUv: le && c(l.map.channel),
|
|
50797
50797
|
aoMapUv: we && c(l.aoMap.channel),
|
|
50798
50798
|
lightMapUv: Fe && c(l.lightMap.channel),
|
|
50799
|
-
bumpMapUv:
|
|
50799
|
+
bumpMapUv: $A && c(l.bumpMap.channel),
|
|
50800
50800
|
normalMapUv: nt && c(l.normalMap.channel),
|
|
50801
50801
|
displacementMapUv: M && c(l.displacementMap.channel),
|
|
50802
50802
|
emissiveMapUv: It && c(l.emissiveMap.channel),
|
|
@@ -50812,7 +50812,7 @@ function AF(i, A, e, t, g, o, n) {
|
|
|
50812
50812
|
sheenRoughnessMapUv: MA && c(l.sheenRoughnessMap.channel),
|
|
50813
50813
|
specularMapUv: LA && c(l.specularMap.channel),
|
|
50814
50814
|
specularColorMapUv: hA && c(l.specularColorMap.channel),
|
|
50815
|
-
specularIntensityMapUv:
|
|
50815
|
+
specularIntensityMapUv: Ae && c(l.specularIntensityMap.channel),
|
|
50816
50816
|
transmissionMapUv: G && c(l.transmissionMap.channel),
|
|
50817
50817
|
thicknessMapUv: mA && c(l.thicknessMap.channel),
|
|
50818
50818
|
alphaMapUv: kA && c(l.alphaMap.channel),
|
|
@@ -51024,14 +51024,14 @@ function gF() {
|
|
|
51024
51024
|
case "DirectionalLight":
|
|
51025
51025
|
e = {
|
|
51026
51026
|
direction: new J(),
|
|
51027
|
-
color: new
|
|
51027
|
+
color: new Ee()
|
|
51028
51028
|
};
|
|
51029
51029
|
break;
|
|
51030
51030
|
case "SpotLight":
|
|
51031
51031
|
e = {
|
|
51032
51032
|
position: new J(),
|
|
51033
51033
|
direction: new J(),
|
|
51034
|
-
color: new
|
|
51034
|
+
color: new Ee(),
|
|
51035
51035
|
distance: 0,
|
|
51036
51036
|
coneCos: 0,
|
|
51037
51037
|
penumbraCos: 0,
|
|
@@ -51041,7 +51041,7 @@ function gF() {
|
|
|
51041
51041
|
case "PointLight":
|
|
51042
51042
|
e = {
|
|
51043
51043
|
position: new J(),
|
|
51044
|
-
color: new
|
|
51044
|
+
color: new Ee(),
|
|
51045
51045
|
distance: 0,
|
|
51046
51046
|
decay: 0
|
|
51047
51047
|
};
|
|
@@ -51049,13 +51049,13 @@ function gF() {
|
|
|
51049
51049
|
case "HemisphereLight":
|
|
51050
51050
|
e = {
|
|
51051
51051
|
direction: new J(),
|
|
51052
|
-
skyColor: new
|
|
51053
|
-
groundColor: new
|
|
51052
|
+
skyColor: new Ee(),
|
|
51053
|
+
groundColor: new Ee()
|
|
51054
51054
|
};
|
|
51055
51055
|
break;
|
|
51056
51056
|
case "RectAreaLight":
|
|
51057
51057
|
e = {
|
|
51058
|
-
color: new
|
|
51058
|
+
color: new Ee(),
|
|
51059
51059
|
position: new J(),
|
|
51060
51060
|
halfWidth: new J(),
|
|
51061
51061
|
halfHeight: new J()
|
|
@@ -51586,7 +51586,7 @@ function dF(i, A) {
|
|
|
51586
51586
|
};
|
|
51587
51587
|
}
|
|
51588
51588
|
const o = new e(), n = new t(), I = new g(), a = /* @__PURE__ */ new WeakMap(), s = /* @__PURE__ */ new WeakMap();
|
|
51589
|
-
let C = {}, r = {}, Q = /* @__PURE__ */ new WeakMap(), B = [], d = null, c = !1, h = null, E = null, x = null, p = null, u = null, D = null, w = null, k = new
|
|
51589
|
+
let C = {}, r = {}, Q = /* @__PURE__ */ new WeakMap(), B = [], d = null, c = !1, h = null, E = null, x = null, p = null, u = null, D = null, w = null, k = new Ee(0, 0, 0), b = 0, l = !1, m = null, S = null, v = null, T = null, O = null;
|
|
51590
51590
|
const W = i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
|
51591
51591
|
let P = !1, V = 0;
|
|
51592
51592
|
const $ = i.getParameter(i.VERSION);
|
|
@@ -51600,8 +51600,8 @@ function dF(i, A) {
|
|
|
51600
51600
|
G === i.TEXTURE_3D || G === i.TEXTURE_2D_ARRAY ? i.texImage3D(mA, 0, i.RGBA, 1, 1, kA, 0, i.RGBA, i.UNSIGNED_BYTE, aA) : i.texImage2D(mA + cA, 0, i.RGBA, 1, 1, 0, i.RGBA, i.UNSIGNED_BYTE, aA);
|
|
51601
51601
|
return eA;
|
|
51602
51602
|
}
|
|
51603
|
-
const
|
|
51604
|
-
|
|
51603
|
+
const z = {};
|
|
51604
|
+
z[i.TEXTURE_2D] = Se(i.TEXTURE_2D, i.TEXTURE_2D, 1), z[i.TEXTURE_CUBE_MAP] = Se(i.TEXTURE_CUBE_MAP, i.TEXTURE_CUBE_MAP_POSITIVE_X, 6), z[i.TEXTURE_2D_ARRAY] = Se(i.TEXTURE_2D_ARRAY, i.TEXTURE_2D_ARRAY, 1, 1), z[i.TEXTURE_3D] = Se(i.TEXTURE_3D, i.TEXTURE_3D, 1, 1), o.setClear(0, 0, 0, 1), n.setClear(1), I.setClear(0), oA(i.DEPTH_TEST), n.setFunc(Tn), $A(!1), nt(Bd), oA(i.CULL_FACE), we(_g);
|
|
51605
51605
|
function oA(G) {
|
|
51606
51606
|
C[G] !== !0 && (i.enable(G), C[G] = !0);
|
|
51607
51607
|
}
|
|
@@ -51703,11 +51703,11 @@ function dF(i, A) {
|
|
|
51703
51703
|
function Fe(G, mA) {
|
|
51704
51704
|
G.side === fg ? RA(i.CULL_FACE) : oA(i.CULL_FACE);
|
|
51705
51705
|
let rA = G.side === Gt;
|
|
51706
|
-
mA && (rA = !rA),
|
|
51706
|
+
mA && (rA = !rA), $A(rA), G.blending === bn && G.transparent === !1 ? we(_g) : we(G.blending, G.blendEquation, G.blendSrc, G.blendDst, G.blendEquationAlpha, G.blendSrcAlpha, G.blendDstAlpha, G.blendColor, G.blendAlpha, G.premultipliedAlpha), n.setFunc(G.depthFunc), n.setTest(G.depthTest), n.setMask(G.depthWrite), o.setMask(G.colorWrite);
|
|
51707
51707
|
const kA = G.stencilWrite;
|
|
51708
51708
|
I.setTest(kA), kA && (I.setMask(G.stencilWriteMask), I.setFunc(G.stencilFunc, G.stencilRef, G.stencilFuncMask), I.setOp(G.stencilFail, G.stencilZFail, G.stencilZPass)), It(G.polygonOffset, G.polygonOffsetFactor, G.polygonOffsetUnits), G.alphaToCoverage === !0 ? oA(i.SAMPLE_ALPHA_TO_COVERAGE) : RA(i.SAMPLE_ALPHA_TO_COVERAGE);
|
|
51709
51709
|
}
|
|
51710
|
-
function
|
|
51710
|
+
function $A(G) {
|
|
51711
51711
|
m !== G && (G ? i.frontFace(i.CW) : i.frontFace(i.CCW), m = G);
|
|
51712
51712
|
}
|
|
51713
51713
|
function nt(G) {
|
|
@@ -51728,7 +51728,7 @@ function dF(i, A) {
|
|
|
51728
51728
|
function vA(G, mA, rA) {
|
|
51729
51729
|
rA === void 0 && (DA === null ? rA = i.TEXTURE0 + W - 1 : rA = DA);
|
|
51730
51730
|
let kA = EA[rA];
|
|
51731
|
-
kA === void 0 && (kA = { type: void 0, texture: void 0 }, EA[rA] = kA), (kA.type !== G || kA.texture !== mA) && (DA !== rA && (i.activeTexture(rA), DA = rA), i.bindTexture(G, mA ||
|
|
51731
|
+
kA === void 0 && (kA = { type: void 0, texture: void 0 }, EA[rA] = kA), (kA.type !== G || kA.texture !== mA) && (DA !== rA && (i.activeTexture(rA), DA = rA), i.bindTexture(G, mA || z[G]), kA.type = G, kA.texture = mA);
|
|
51732
51732
|
}
|
|
51733
51733
|
function y() {
|
|
51734
51734
|
const G = EA[DA];
|
|
@@ -51748,7 +51748,7 @@ function dF(i, A) {
|
|
|
51748
51748
|
ue("WebGLState:", G);
|
|
51749
51749
|
}
|
|
51750
51750
|
}
|
|
51751
|
-
function
|
|
51751
|
+
function X() {
|
|
51752
51752
|
try {
|
|
51753
51753
|
i.texSubImage2D(...arguments);
|
|
51754
51754
|
} catch (G) {
|
|
@@ -51820,8 +51820,8 @@ function dF(i, A) {
|
|
|
51820
51820
|
const kA = s.get(mA).get(G);
|
|
51821
51821
|
a.get(mA) !== kA && (i.uniformBlockBinding(mA, kA, G.__bindingPointIndex), a.set(mA, kA));
|
|
51822
51822
|
}
|
|
51823
|
-
function
|
|
51824
|
-
i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), n.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), C = {}, DA = null, EA = {}, r = {}, Q = /* @__PURE__ */ new WeakMap(), B = [], d = null, c = !1, h = null, E = null, x = null, p = null, u = null, D = null, w = null, k = new
|
|
51823
|
+
function Ae() {
|
|
51824
|
+
i.disable(i.BLEND), i.disable(i.CULL_FACE), i.disable(i.DEPTH_TEST), i.disable(i.POLYGON_OFFSET_FILL), i.disable(i.SCISSOR_TEST), i.disable(i.STENCIL_TEST), i.disable(i.SAMPLE_ALPHA_TO_COVERAGE), i.blendEquation(i.FUNC_ADD), i.blendFunc(i.ONE, i.ZERO), i.blendFuncSeparate(i.ONE, i.ZERO, i.ONE, i.ZERO), i.blendColor(0, 0, 0, 0), i.colorMask(!0, !0, !0, !0), i.clearColor(0, 0, 0, 0), i.depthMask(!0), i.depthFunc(i.LESS), n.setReversed(!1), i.clearDepth(1), i.stencilMask(4294967295), i.stencilFunc(i.ALWAYS, 0, 4294967295), i.stencilOp(i.KEEP, i.KEEP, i.KEEP), i.clearStencil(0), i.cullFace(i.BACK), i.frontFace(i.CCW), i.polygonOffset(0, 0), i.activeTexture(i.TEXTURE0), i.bindFramebuffer(i.FRAMEBUFFER, null), i.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), i.bindFramebuffer(i.READ_FRAMEBUFFER, null), i.useProgram(null), i.lineWidth(1), i.scissor(0, 0, i.canvas.width, i.canvas.height), i.viewport(0, 0, i.canvas.width, i.canvas.height), C = {}, DA = null, EA = {}, r = {}, Q = /* @__PURE__ */ new WeakMap(), B = [], d = null, c = !1, h = null, E = null, x = null, p = null, u = null, D = null, w = null, k = new Ee(0, 0, 0), b = 0, l = !1, m = null, S = null, v = null, T = null, O = null, OA.set(0, 0, i.canvas.width, i.canvas.height), Pe.set(0, 0, i.canvas.width, i.canvas.height), o.reset(), n.reset(), I.reset();
|
|
51825
51825
|
}
|
|
51826
51826
|
return {
|
|
51827
51827
|
buffers: {
|
|
@@ -51836,7 +51836,7 @@ function dF(i, A) {
|
|
|
51836
51836
|
useProgram: le,
|
|
51837
51837
|
setBlending: we,
|
|
51838
51838
|
setMaterial: Fe,
|
|
51839
|
-
setFlipSided:
|
|
51839
|
+
setFlipSided: $A,
|
|
51840
51840
|
setCullFace: nt,
|
|
51841
51841
|
setLineWidth: M,
|
|
51842
51842
|
setPolygonOffset: It,
|
|
@@ -51852,13 +51852,13 @@ function dF(i, A) {
|
|
|
51852
51852
|
uniformBlockBinding: hA,
|
|
51853
51853
|
texStorage2D: dA,
|
|
51854
51854
|
texStorage3D: FA,
|
|
51855
|
-
texSubImage2D:
|
|
51855
|
+
texSubImage2D: X,
|
|
51856
51856
|
texSubImage3D: gA,
|
|
51857
51857
|
compressedTexSubImage2D: j,
|
|
51858
51858
|
compressedTexSubImage3D: UA,
|
|
51859
51859
|
scissor: lA,
|
|
51860
51860
|
viewport: MA,
|
|
51861
|
-
reset:
|
|
51861
|
+
reset: Ae
|
|
51862
51862
|
};
|
|
51863
51863
|
}
|
|
51864
51864
|
function hF(i, A, e, t, g, o, n) {
|
|
@@ -51874,11 +51874,11 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
51874
51874
|
return B ? new OffscreenCanvas(y, f) : Us("canvas");
|
|
51875
51875
|
}
|
|
51876
51876
|
function c(y, f, F) {
|
|
51877
|
-
let
|
|
51877
|
+
let X = 1;
|
|
51878
51878
|
const gA = vA(y);
|
|
51879
|
-
if ((gA.width > F || gA.height > F) && (
|
|
51879
|
+
if ((gA.width > F || gA.height > F) && (X = F / Math.max(gA.width, gA.height)), X < 1)
|
|
51880
51880
|
if (typeof HTMLImageElement < "u" && y instanceof HTMLImageElement || typeof HTMLCanvasElement < "u" && y instanceof HTMLCanvasElement || typeof ImageBitmap < "u" && y instanceof ImageBitmap || typeof VideoFrame < "u" && y instanceof VideoFrame) {
|
|
51881
|
-
const j = Math.floor(
|
|
51881
|
+
const j = Math.floor(X * gA.width), UA = Math.floor(X * gA.height);
|
|
51882
51882
|
r === void 0 && (r = d(j, UA));
|
|
51883
51883
|
const dA = f ? d(j, UA) : r;
|
|
51884
51884
|
return dA.width = j, dA.height = UA, dA.getContext("2d").drawImage(y, 0, 0, j, UA), PA("WebGLRenderer: Texture has been resized from (" + gA.width + "x" + gA.height + ") to (" + j + "x" + UA + ")."), dA;
|
|
@@ -51895,14 +51895,14 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
51895
51895
|
function x(y) {
|
|
51896
51896
|
return y.isWebGLCubeRenderTarget ? i.TEXTURE_CUBE_MAP : y.isWebGL3DRenderTarget ? i.TEXTURE_3D : y.isWebGLArrayRenderTarget || y.isCompressedArrayTexture ? i.TEXTURE_2D_ARRAY : i.TEXTURE_2D;
|
|
51897
51897
|
}
|
|
51898
|
-
function p(y, f, F,
|
|
51898
|
+
function p(y, f, F, X, gA = !1) {
|
|
51899
51899
|
if (y !== null) {
|
|
51900
51900
|
if (i[y] !== void 0) return i[y];
|
|
51901
51901
|
PA("WebGLRenderer: Attempt to use non-existing WebGL internal format '" + y + "'");
|
|
51902
51902
|
}
|
|
51903
51903
|
let j = f;
|
|
51904
51904
|
if (f === i.RED && (F === i.FLOAT && (j = i.R32F), F === i.HALF_FLOAT && (j = i.R16F), F === i.UNSIGNED_BYTE && (j = i.R8)), f === i.RED_INTEGER && (F === i.UNSIGNED_BYTE && (j = i.R8UI), F === i.UNSIGNED_SHORT && (j = i.R16UI), F === i.UNSIGNED_INT && (j = i.R32UI), F === i.BYTE && (j = i.R8I), F === i.SHORT && (j = i.R16I), F === i.INT && (j = i.R32I)), f === i.RG && (F === i.FLOAT && (j = i.RG32F), F === i.HALF_FLOAT && (j = i.RG16F), F === i.UNSIGNED_BYTE && (j = i.RG8)), f === i.RG_INTEGER && (F === i.UNSIGNED_BYTE && (j = i.RG8UI), F === i.UNSIGNED_SHORT && (j = i.RG16UI), F === i.UNSIGNED_INT && (j = i.RG32UI), F === i.BYTE && (j = i.RG8I), F === i.SHORT && (j = i.RG16I), F === i.INT && (j = i.RG32I)), f === i.RGB_INTEGER && (F === i.UNSIGNED_BYTE && (j = i.RGB8UI), F === i.UNSIGNED_SHORT && (j = i.RGB16UI), F === i.UNSIGNED_INT && (j = i.RGB32UI), F === i.BYTE && (j = i.RGB8I), F === i.SHORT && (j = i.RGB16I), F === i.INT && (j = i.RGB32I)), f === i.RGBA_INTEGER && (F === i.UNSIGNED_BYTE && (j = i.RGBA8UI), F === i.UNSIGNED_SHORT && (j = i.RGBA16UI), F === i.UNSIGNED_INT && (j = i.RGBA32UI), F === i.BYTE && (j = i.RGBA8I), F === i.SHORT && (j = i.RGBA16I), F === i.INT && (j = i.RGBA32I)), f === i.RGB && (F === i.UNSIGNED_INT_5_9_9_9_REV && (j = i.RGB9_E5), F === i.UNSIGNED_INT_10F_11F_11F_REV && (j = i.R11F_G11F_B10F)), f === i.RGBA) {
|
|
51905
|
-
const UA = gA ? vs : de.getTransfer(
|
|
51905
|
+
const UA = gA ? vs : de.getTransfer(X);
|
|
51906
51906
|
F === i.FLOAT && (j = i.RGBA32F), F === i.HALF_FLOAT && (j = i.RGBA16F), F === i.UNSIGNED_BYTE && (j = UA === ye ? i.SRGB8_ALPHA8 : i.RGBA8), F === i.UNSIGNED_SHORT_4_4_4_4 && (j = i.RGBA4), F === i.UNSIGNED_SHORT_5_5_5_1 && (j = i.RGB5_A1);
|
|
51907
51907
|
}
|
|
51908
51908
|
return (j === i.R16F || j === i.R32F || j === i.RG16F || j === i.RG32F || j === i.RGBA16F || j === i.RGBA32F) && A.get("EXT_color_buffer_float"), j;
|
|
@@ -51925,43 +51925,43 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
51925
51925
|
function b(y) {
|
|
51926
51926
|
const f = t.get(y);
|
|
51927
51927
|
if (f.__webglInit === void 0) return;
|
|
51928
|
-
const F = y.source,
|
|
51929
|
-
if (
|
|
51930
|
-
const gA =
|
|
51931
|
-
gA.usedTimes--, gA.usedTimes === 0 && l(y), Object.keys(
|
|
51928
|
+
const F = y.source, X = Q.get(F);
|
|
51929
|
+
if (X) {
|
|
51930
|
+
const gA = X[f.__cacheKey];
|
|
51931
|
+
gA.usedTimes--, gA.usedTimes === 0 && l(y), Object.keys(X).length === 0 && Q.delete(F);
|
|
51932
51932
|
}
|
|
51933
51933
|
t.remove(y);
|
|
51934
51934
|
}
|
|
51935
51935
|
function l(y) {
|
|
51936
51936
|
const f = t.get(y);
|
|
51937
51937
|
i.deleteTexture(f.__webglTexture);
|
|
51938
|
-
const F = y.source,
|
|
51939
|
-
delete
|
|
51938
|
+
const F = y.source, X = Q.get(F);
|
|
51939
|
+
delete X[f.__cacheKey], n.memory.textures--;
|
|
51940
51940
|
}
|
|
51941
51941
|
function m(y) {
|
|
51942
51942
|
const f = t.get(y);
|
|
51943
51943
|
if (y.depthTexture && (y.depthTexture.dispose(), t.remove(y.depthTexture)), y.isWebGLCubeRenderTarget)
|
|
51944
|
-
for (let
|
|
51945
|
-
if (Array.isArray(f.__webglFramebuffer[
|
|
51946
|
-
for (let gA = 0; gA < f.__webglFramebuffer[
|
|
51944
|
+
for (let X = 0; X < 6; X++) {
|
|
51945
|
+
if (Array.isArray(f.__webglFramebuffer[X]))
|
|
51946
|
+
for (let gA = 0; gA < f.__webglFramebuffer[X].length; gA++) i.deleteFramebuffer(f.__webglFramebuffer[X][gA]);
|
|
51947
51947
|
else
|
|
51948
|
-
i.deleteFramebuffer(f.__webglFramebuffer[
|
|
51949
|
-
f.__webglDepthbuffer && i.deleteRenderbuffer(f.__webglDepthbuffer[
|
|
51948
|
+
i.deleteFramebuffer(f.__webglFramebuffer[X]);
|
|
51949
|
+
f.__webglDepthbuffer && i.deleteRenderbuffer(f.__webglDepthbuffer[X]);
|
|
51950
51950
|
}
|
|
51951
51951
|
else {
|
|
51952
51952
|
if (Array.isArray(f.__webglFramebuffer))
|
|
51953
|
-
for (let
|
|
51953
|
+
for (let X = 0; X < f.__webglFramebuffer.length; X++) i.deleteFramebuffer(f.__webglFramebuffer[X]);
|
|
51954
51954
|
else
|
|
51955
51955
|
i.deleteFramebuffer(f.__webglFramebuffer);
|
|
51956
51956
|
if (f.__webglDepthbuffer && i.deleteRenderbuffer(f.__webglDepthbuffer), f.__webglMultisampledFramebuffer && i.deleteFramebuffer(f.__webglMultisampledFramebuffer), f.__webglColorRenderbuffer)
|
|
51957
|
-
for (let
|
|
51958
|
-
f.__webglColorRenderbuffer[
|
|
51957
|
+
for (let X = 0; X < f.__webglColorRenderbuffer.length; X++)
|
|
51958
|
+
f.__webglColorRenderbuffer[X] && i.deleteRenderbuffer(f.__webglColorRenderbuffer[X]);
|
|
51959
51959
|
f.__webglDepthRenderbuffer && i.deleteRenderbuffer(f.__webglDepthRenderbuffer);
|
|
51960
51960
|
}
|
|
51961
51961
|
const F = y.textures;
|
|
51962
|
-
for (let
|
|
51963
|
-
const j = t.get(F[
|
|
51964
|
-
j.__webglTexture && (i.deleteTexture(j.__webglTexture), n.memory.textures--), t.remove(F[
|
|
51962
|
+
for (let X = 0, gA = F.length; X < gA; X++) {
|
|
51963
|
+
const j = t.get(F[X]);
|
|
51964
|
+
j.__webglTexture && (i.deleteTexture(j.__webglTexture), n.memory.textures--), t.remove(F[X]);
|
|
51965
51965
|
}
|
|
51966
51966
|
t.remove(y);
|
|
51967
51967
|
}
|
|
@@ -51980,13 +51980,13 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
51980
51980
|
function W(y, f) {
|
|
51981
51981
|
const F = t.get(y);
|
|
51982
51982
|
if (y.isVideoTexture && pe(y), y.isRenderTargetTexture === !1 && y.isExternalTexture !== !0 && y.version > 0 && F.__version !== y.version) {
|
|
51983
|
-
const
|
|
51984
|
-
if (
|
|
51983
|
+
const X = y.image;
|
|
51984
|
+
if (X === null)
|
|
51985
51985
|
PA("WebGLRenderer: Texture marked for update but no image data found.");
|
|
51986
|
-
else if (
|
|
51986
|
+
else if (X.complete === !1)
|
|
51987
51987
|
PA("WebGLRenderer: Texture marked for update but image is incomplete");
|
|
51988
51988
|
else {
|
|
51989
|
-
|
|
51989
|
+
z(F, y, f);
|
|
51990
51990
|
return;
|
|
51991
51991
|
}
|
|
51992
51992
|
} else y.isExternalTexture && (F.__webglTexture = y.sourceTexture ? y.sourceTexture : null);
|
|
@@ -51995,7 +51995,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
51995
51995
|
function P(y, f) {
|
|
51996
51996
|
const F = t.get(y);
|
|
51997
51997
|
if (y.isRenderTargetTexture === !1 && y.version > 0 && F.__version !== y.version) {
|
|
51998
|
-
|
|
51998
|
+
z(F, y, f);
|
|
51999
51999
|
return;
|
|
52000
52000
|
} else y.isExternalTexture && (F.__webglTexture = y.sourceTexture ? y.sourceTexture : null);
|
|
52001
52001
|
e.bindTexture(i.TEXTURE_2D_ARRAY, F.__webglTexture, i.TEXTURE0 + f);
|
|
@@ -52003,7 +52003,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52003
52003
|
function V(y, f) {
|
|
52004
52004
|
const F = t.get(y);
|
|
52005
52005
|
if (y.isRenderTargetTexture === !1 && y.version > 0 && F.__version !== y.version) {
|
|
52006
|
-
|
|
52006
|
+
z(F, y, f);
|
|
52007
52007
|
return;
|
|
52008
52008
|
}
|
|
52009
52009
|
e.bindTexture(i.TEXTURE_3D, F.__webglTexture, i.TEXTURE0 + f);
|
|
@@ -52049,9 +52049,9 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52049
52049
|
function OA(y, f) {
|
|
52050
52050
|
let F = !1;
|
|
52051
52051
|
y.__webglInit === void 0 && (y.__webglInit = !0, f.addEventListener("dispose", w));
|
|
52052
|
-
const
|
|
52053
|
-
let gA = Q.get(
|
|
52054
|
-
gA === void 0 && (gA = {}, Q.set(
|
|
52052
|
+
const X = f.source;
|
|
52053
|
+
let gA = Q.get(X);
|
|
52054
|
+
gA === void 0 && (gA = {}, Q.set(X, gA));
|
|
52055
52055
|
const j = O(f);
|
|
52056
52056
|
if (j !== y.__cacheKey) {
|
|
52057
52057
|
gA[j] === void 0 && (gA[j] = {
|
|
@@ -52066,16 +52066,16 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52066
52066
|
function Pe(y, f, F) {
|
|
52067
52067
|
return Math.floor(Math.floor(y / F) / f);
|
|
52068
52068
|
}
|
|
52069
|
-
function Se(y, f, F,
|
|
52069
|
+
function Se(y, f, F, X) {
|
|
52070
52070
|
const j = y.updateRanges;
|
|
52071
52071
|
if (j.length === 0)
|
|
52072
|
-
e.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, f.width, f.height, F,
|
|
52072
|
+
e.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, f.width, f.height, F, X, f.data);
|
|
52073
52073
|
else {
|
|
52074
52074
|
j.sort((sA, lA) => sA.start - lA.start);
|
|
52075
52075
|
let UA = 0;
|
|
52076
52076
|
for (let sA = 1; sA < j.length; sA++) {
|
|
52077
|
-
const lA = j[UA], MA = j[sA], LA = lA.start + lA.count, hA = Pe(MA.start, f.width, 4),
|
|
52078
|
-
MA.start <= LA + 1 && hA ===
|
|
52077
|
+
const lA = j[UA], MA = j[sA], LA = lA.start + lA.count, hA = Pe(MA.start, f.width, 4), Ae = Pe(lA.start, f.width, 4);
|
|
52078
|
+
MA.start <= LA + 1 && hA === Ae && Pe(MA.start + MA.count - 1, f.width, 4) === hA ? lA.count = Math.max(
|
|
52079
52079
|
lA.count,
|
|
52080
52080
|
MA.start + MA.count - lA.start
|
|
52081
52081
|
) : (++UA, j[UA] = MA);
|
|
@@ -52084,17 +52084,17 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52084
52084
|
const dA = i.getParameter(i.UNPACK_ROW_LENGTH), FA = i.getParameter(i.UNPACK_SKIP_PIXELS), qA = i.getParameter(i.UNPACK_SKIP_ROWS);
|
|
52085
52085
|
i.pixelStorei(i.UNPACK_ROW_LENGTH, f.width);
|
|
52086
52086
|
for (let sA = 0, lA = j.length; sA < lA; sA++) {
|
|
52087
|
-
const MA = j[sA], LA = Math.floor(MA.start / 4), hA = Math.ceil(MA.count / 4),
|
|
52088
|
-
i.pixelStorei(i.UNPACK_SKIP_PIXELS,
|
|
52087
|
+
const MA = j[sA], LA = Math.floor(MA.start / 4), hA = Math.ceil(MA.count / 4), Ae = LA % f.width, G = Math.floor(LA / f.width), mA = hA, rA = 1;
|
|
52088
|
+
i.pixelStorei(i.UNPACK_SKIP_PIXELS, Ae), i.pixelStorei(i.UNPACK_SKIP_ROWS, G), e.texSubImage2D(i.TEXTURE_2D, 0, Ae, G, mA, rA, F, X, f.data);
|
|
52089
52089
|
}
|
|
52090
52090
|
y.clearUpdateRanges(), i.pixelStorei(i.UNPACK_ROW_LENGTH, dA), i.pixelStorei(i.UNPACK_SKIP_PIXELS, FA), i.pixelStorei(i.UNPACK_SKIP_ROWS, qA);
|
|
52091
52091
|
}
|
|
52092
52092
|
}
|
|
52093
|
-
function
|
|
52094
|
-
let
|
|
52095
|
-
(f.isDataArrayTexture || f.isCompressedArrayTexture) && (
|
|
52093
|
+
function z(y, f, F) {
|
|
52094
|
+
let X = i.TEXTURE_2D;
|
|
52095
|
+
(f.isDataArrayTexture || f.isCompressedArrayTexture) && (X = i.TEXTURE_2D_ARRAY), f.isData3DTexture && (X = i.TEXTURE_3D);
|
|
52096
52096
|
const gA = OA(y, f), j = f.source;
|
|
52097
|
-
e.bindTexture(
|
|
52097
|
+
e.bindTexture(X, y.__webglTexture, i.TEXTURE0 + F);
|
|
52098
52098
|
const UA = t.get(j);
|
|
52099
52099
|
if (j.version !== UA.__version || gA === !0) {
|
|
52100
52100
|
e.activeTexture(i.TEXTURE0 + F);
|
|
@@ -52104,24 +52104,24 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52104
52104
|
sA = Te(f, sA);
|
|
52105
52105
|
const lA = o.convert(f.format, f.colorSpace), MA = o.convert(f.type);
|
|
52106
52106
|
let LA = p(f.internalFormat, lA, MA, f.colorSpace, f.isVideoTexture);
|
|
52107
|
-
VA(
|
|
52107
|
+
VA(X, f);
|
|
52108
52108
|
let hA;
|
|
52109
|
-
const
|
|
52109
|
+
const Ae = f.mipmaps, G = f.isVideoTexture !== !0, mA = UA.__version === void 0 || gA === !0, rA = j.dataReady, kA = D(f, sA);
|
|
52110
52110
|
if (f.isDepthTexture)
|
|
52111
52111
|
LA = u(f.format === No, f.type), mA && (G ? e.texStorage2D(i.TEXTURE_2D, 1, LA, sA.width, sA.height) : e.texImage2D(i.TEXTURE_2D, 0, LA, sA.width, sA.height, 0, lA, MA, null));
|
|
52112
52112
|
else if (f.isDataTexture)
|
|
52113
|
-
if (
|
|
52114
|
-
G && mA && e.texStorage2D(i.TEXTURE_2D, kA, LA,
|
|
52115
|
-
for (let aA = 0, eA =
|
|
52116
|
-
hA =
|
|
52113
|
+
if (Ae.length > 0) {
|
|
52114
|
+
G && mA && e.texStorage2D(i.TEXTURE_2D, kA, LA, Ae[0].width, Ae[0].height);
|
|
52115
|
+
for (let aA = 0, eA = Ae.length; aA < eA; aA++)
|
|
52116
|
+
hA = Ae[aA], G ? rA && e.texSubImage2D(i.TEXTURE_2D, aA, 0, 0, hA.width, hA.height, lA, MA, hA.data) : e.texImage2D(i.TEXTURE_2D, aA, LA, hA.width, hA.height, 0, lA, MA, hA.data);
|
|
52117
52117
|
f.generateMipmaps = !1;
|
|
52118
52118
|
} else
|
|
52119
52119
|
G ? (mA && e.texStorage2D(i.TEXTURE_2D, kA, LA, sA.width, sA.height), rA && Se(f, sA, lA, MA)) : e.texImage2D(i.TEXTURE_2D, 0, LA, sA.width, sA.height, 0, lA, MA, sA.data);
|
|
52120
52120
|
else if (f.isCompressedTexture)
|
|
52121
52121
|
if (f.isCompressedArrayTexture) {
|
|
52122
|
-
G && mA && e.texStorage3D(i.TEXTURE_2D_ARRAY, kA, LA,
|
|
52123
|
-
for (let aA = 0, eA =
|
|
52124
|
-
if (hA =
|
|
52122
|
+
G && mA && e.texStorage3D(i.TEXTURE_2D_ARRAY, kA, LA, Ae[0].width, Ae[0].height, sA.depth);
|
|
52123
|
+
for (let aA = 0, eA = Ae.length; aA < eA; aA++)
|
|
52124
|
+
if (hA = Ae[aA], f.format !== Ri)
|
|
52125
52125
|
if (lA !== null)
|
|
52126
52126
|
if (G) {
|
|
52127
52127
|
if (rA)
|
|
@@ -52144,9 +52144,9 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52144
52144
|
else
|
|
52145
52145
|
G ? rA && e.texSubImage3D(i.TEXTURE_2D_ARRAY, aA, 0, 0, 0, hA.width, hA.height, sA.depth, lA, MA, hA.data) : e.texImage3D(i.TEXTURE_2D_ARRAY, aA, LA, hA.width, hA.height, sA.depth, 0, lA, MA, hA.data);
|
|
52146
52146
|
} else {
|
|
52147
|
-
G && mA && e.texStorage2D(i.TEXTURE_2D, kA, LA,
|
|
52148
|
-
for (let aA = 0, eA =
|
|
52149
|
-
hA =
|
|
52147
|
+
G && mA && e.texStorage2D(i.TEXTURE_2D, kA, LA, Ae[0].width, Ae[0].height);
|
|
52148
|
+
for (let aA = 0, eA = Ae.length; aA < eA; aA++)
|
|
52149
|
+
hA = Ae[aA], f.format !== Ri ? lA !== null ? G ? rA && e.compressedTexSubImage2D(i.TEXTURE_2D, aA, 0, 0, hA.width, hA.height, lA, hA.data) : e.compressedTexImage2D(i.TEXTURE_2D, aA, LA, hA.width, hA.height, 0, hA.data) : PA("WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : G ? rA && e.texSubImage2D(i.TEXTURE_2D, aA, 0, 0, hA.width, hA.height, lA, MA, hA.data) : e.texImage2D(i.TEXTURE_2D, aA, LA, hA.width, hA.height, 0, lA, MA, hA.data);
|
|
52150
52150
|
}
|
|
52151
52151
|
else if (f.isDataArrayTexture)
|
|
52152
52152
|
if (G) {
|
|
@@ -52176,13 +52176,13 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52176
52176
|
for (let cA = 0; cA < kA; cA++)
|
|
52177
52177
|
e.texImage2D(i.TEXTURE_2D, cA, LA, aA, eA, 0, lA, MA, null), aA >>= 1, eA >>= 1;
|
|
52178
52178
|
}
|
|
52179
|
-
} else if (
|
|
52179
|
+
} else if (Ae.length > 0) {
|
|
52180
52180
|
if (G && mA) {
|
|
52181
|
-
const aA = vA(
|
|
52181
|
+
const aA = vA(Ae[0]);
|
|
52182
52182
|
e.texStorage2D(i.TEXTURE_2D, kA, LA, aA.width, aA.height);
|
|
52183
52183
|
}
|
|
52184
|
-
for (let aA = 0, eA =
|
|
52185
|
-
hA =
|
|
52184
|
+
for (let aA = 0, eA = Ae.length; aA < eA; aA++)
|
|
52185
|
+
hA = Ae[aA], G ? rA && e.texSubImage2D(i.TEXTURE_2D, aA, 0, 0, lA, MA, hA) : e.texImage2D(i.TEXTURE_2D, aA, LA, lA, MA, hA);
|
|
52186
52186
|
f.generateMipmaps = !1;
|
|
52187
52187
|
} else if (G) {
|
|
52188
52188
|
if (mA) {
|
|
@@ -52192,53 +52192,53 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52192
52192
|
rA && e.texSubImage2D(i.TEXTURE_2D, 0, 0, 0, lA, MA, sA);
|
|
52193
52193
|
} else
|
|
52194
52194
|
e.texImage2D(i.TEXTURE_2D, 0, LA, lA, MA, sA);
|
|
52195
|
-
h(f) && E(
|
|
52195
|
+
h(f) && E(X), UA.__version = j.version, f.onUpdate && f.onUpdate(f);
|
|
52196
52196
|
}
|
|
52197
52197
|
y.__version = f.version;
|
|
52198
52198
|
}
|
|
52199
52199
|
function oA(y, f, F) {
|
|
52200
52200
|
if (f.image.length !== 6) return;
|
|
52201
|
-
const
|
|
52201
|
+
const X = OA(y, f), gA = f.source;
|
|
52202
52202
|
e.bindTexture(i.TEXTURE_CUBE_MAP, y.__webglTexture, i.TEXTURE0 + F);
|
|
52203
52203
|
const j = t.get(gA);
|
|
52204
|
-
if (gA.version !== j.__version ||
|
|
52204
|
+
if (gA.version !== j.__version || X === !0) {
|
|
52205
52205
|
e.activeTexture(i.TEXTURE0 + F);
|
|
52206
52206
|
const UA = de.getPrimaries(de.workingColorSpace), dA = f.colorSpace === Zg ? null : de.getPrimaries(f.colorSpace), FA = f.colorSpace === Zg || UA === dA ? i.NONE : i.BROWSER_DEFAULT_WEBGL;
|
|
52207
52207
|
i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL, f.flipY), i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL, f.premultiplyAlpha), i.pixelStorei(i.UNPACK_ALIGNMENT, f.unpackAlignment), i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL, FA);
|
|
52208
52208
|
const qA = f.isCompressedTexture || f.image[0].isCompressedTexture, sA = f.image[0] && f.image[0].isDataTexture, lA = [];
|
|
52209
52209
|
for (let eA = 0; eA < 6; eA++)
|
|
52210
52210
|
!qA && !sA ? lA[eA] = c(f.image[eA], !0, g.maxCubemapSize) : lA[eA] = sA ? f.image[eA].image : f.image[eA], lA[eA] = Te(f, lA[eA]);
|
|
52211
|
-
const MA = lA[0], LA = o.convert(f.format, f.colorSpace), hA = o.convert(f.type),
|
|
52211
|
+
const MA = lA[0], LA = o.convert(f.format, f.colorSpace), hA = o.convert(f.type), Ae = p(f.internalFormat, LA, hA, f.colorSpace), G = f.isVideoTexture !== !0, mA = j.__version === void 0 || X === !0, rA = gA.dataReady;
|
|
52212
52212
|
let kA = D(f, MA);
|
|
52213
52213
|
VA(i.TEXTURE_CUBE_MAP, f);
|
|
52214
52214
|
let aA;
|
|
52215
52215
|
if (qA) {
|
|
52216
|
-
G && mA && e.texStorage2D(i.TEXTURE_CUBE_MAP, kA,
|
|
52216
|
+
G && mA && e.texStorage2D(i.TEXTURE_CUBE_MAP, kA, Ae, MA.width, MA.height);
|
|
52217
52217
|
for (let eA = 0; eA < 6; eA++) {
|
|
52218
52218
|
aA = lA[eA].mipmaps;
|
|
52219
52219
|
for (let cA = 0; cA < aA.length; cA++) {
|
|
52220
52220
|
const HA = aA[cA];
|
|
52221
|
-
f.format !== Ri ? LA !== null ? G ? rA && e.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA, 0, 0, HA.width, HA.height, LA, HA.data) : e.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA,
|
|
52221
|
+
f.format !== Ri ? LA !== null ? G ? rA && e.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA, 0, 0, HA.width, HA.height, LA, HA.data) : e.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA, Ae, HA.width, HA.height, 0, HA.data) : PA("WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()") : G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA, 0, 0, HA.width, HA.height, LA, hA, HA.data) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA, Ae, HA.width, HA.height, 0, LA, hA, HA.data);
|
|
52222
52222
|
}
|
|
52223
52223
|
}
|
|
52224
52224
|
} else {
|
|
52225
52225
|
if (aA = f.mipmaps, G && mA) {
|
|
52226
52226
|
aA.length > 0 && kA++;
|
|
52227
52227
|
const eA = vA(lA[0]);
|
|
52228
|
-
e.texStorage2D(i.TEXTURE_CUBE_MAP, kA,
|
|
52228
|
+
e.texStorage2D(i.TEXTURE_CUBE_MAP, kA, Ae, eA.width, eA.height);
|
|
52229
52229
|
}
|
|
52230
52230
|
for (let eA = 0; eA < 6; eA++)
|
|
52231
52231
|
if (sA) {
|
|
52232
|
-
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, 0, 0, lA[eA].width, lA[eA].height, LA, hA, lA[eA].data) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0,
|
|
52232
|
+
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, 0, 0, lA[eA].width, lA[eA].height, LA, hA, lA[eA].data) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, Ae, lA[eA].width, lA[eA].height, 0, LA, hA, lA[eA].data);
|
|
52233
52233
|
for (let cA = 0; cA < aA.length; cA++) {
|
|
52234
52234
|
const Ke = aA[cA].image[eA].image;
|
|
52235
|
-
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, 0, 0, Ke.width, Ke.height, LA, hA, Ke.data) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1,
|
|
52235
|
+
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, 0, 0, Ke.width, Ke.height, LA, hA, Ke.data) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, Ae, Ke.width, Ke.height, 0, LA, hA, Ke.data);
|
|
52236
52236
|
}
|
|
52237
52237
|
} else {
|
|
52238
|
-
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, 0, 0, LA, hA, lA[eA]) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0,
|
|
52238
|
+
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, 0, 0, LA, hA, lA[eA]) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, 0, Ae, LA, hA, lA[eA]);
|
|
52239
52239
|
for (let cA = 0; cA < aA.length; cA++) {
|
|
52240
52240
|
const HA = aA[cA];
|
|
52241
|
-
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, 0, 0, LA, hA, HA.image[eA]) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1,
|
|
52241
|
+
G ? rA && e.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, 0, 0, LA, hA, HA.image[eA]) : e.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X + eA, cA + 1, Ae, LA, hA, HA.image[eA]);
|
|
52242
52242
|
}
|
|
52243
52243
|
}
|
|
52244
52244
|
}
|
|
@@ -52246,33 +52246,33 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52246
52246
|
}
|
|
52247
52247
|
y.__version = f.version;
|
|
52248
52248
|
}
|
|
52249
|
-
function RA(y, f, F,
|
|
52249
|
+
function RA(y, f, F, X, gA, j) {
|
|
52250
52250
|
const UA = o.convert(F.format, F.colorSpace), dA = o.convert(F.type), FA = p(F.internalFormat, UA, dA, F.colorSpace), qA = t.get(f), sA = t.get(F);
|
|
52251
52251
|
if (sA.__renderTarget = f, !qA.__hasExternalTextures) {
|
|
52252
52252
|
const lA = Math.max(1, f.width >> j), MA = Math.max(1, f.height >> j);
|
|
52253
52253
|
gA === i.TEXTURE_3D || gA === i.TEXTURE_2D_ARRAY ? e.texImage3D(gA, j, FA, lA, MA, f.depth, 0, UA, dA, null) : e.texImage2D(gA, j, FA, lA, MA, 0, UA, dA, null);
|
|
52254
52254
|
}
|
|
52255
|
-
e.bindFramebuffer(i.FRAMEBUFFER, y), It(f) ? I.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,
|
|
52255
|
+
e.bindFramebuffer(i.FRAMEBUFFER, y), It(f) ? I.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, X, gA, sA.__webglTexture, 0, M(f)) : (gA === i.TEXTURE_2D || gA >= i.TEXTURE_CUBE_MAP_POSITIVE_X && gA <= i.TEXTURE_CUBE_MAP_NEGATIVE_Z) && i.framebufferTexture2D(i.FRAMEBUFFER, X, gA, sA.__webglTexture, j), e.bindFramebuffer(i.FRAMEBUFFER, null);
|
|
52256
52256
|
}
|
|
52257
52257
|
function jA(y, f, F) {
|
|
52258
52258
|
if (i.bindRenderbuffer(i.RENDERBUFFER, y), f.depthBuffer) {
|
|
52259
|
-
const
|
|
52259
|
+
const X = f.depthTexture, gA = X && X.isDepthTexture ? X.type : null, j = u(f.stencilBuffer, gA), UA = f.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
|
|
52260
52260
|
It(f) ? I.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, M(f), j, f.width, f.height) : F ? i.renderbufferStorageMultisample(i.RENDERBUFFER, M(f), j, f.width, f.height) : i.renderbufferStorage(i.RENDERBUFFER, j, f.width, f.height), i.framebufferRenderbuffer(i.FRAMEBUFFER, UA, i.RENDERBUFFER, y);
|
|
52261
52261
|
} else {
|
|
52262
|
-
const
|
|
52263
|
-
for (let gA = 0; gA <
|
|
52264
|
-
const j =
|
|
52262
|
+
const X = f.textures;
|
|
52263
|
+
for (let gA = 0; gA < X.length; gA++) {
|
|
52264
|
+
const j = X[gA], UA = o.convert(j.format, j.colorSpace), dA = o.convert(j.type), FA = p(j.internalFormat, UA, dA, j.colorSpace);
|
|
52265
52265
|
It(f) ? I.renderbufferStorageMultisampleEXT(i.RENDERBUFFER, M(f), FA, f.width, f.height) : F ? i.renderbufferStorageMultisample(i.RENDERBUFFER, M(f), FA, f.width, f.height) : i.renderbufferStorage(i.RENDERBUFFER, FA, f.width, f.height);
|
|
52266
52266
|
}
|
|
52267
52267
|
}
|
|
52268
52268
|
i.bindRenderbuffer(i.RENDERBUFFER, null);
|
|
52269
52269
|
}
|
|
52270
52270
|
function GA(y, f, F) {
|
|
52271
|
-
const
|
|
52271
|
+
const X = f.isWebGLCubeRenderTarget === !0;
|
|
52272
52272
|
if (e.bindFramebuffer(i.FRAMEBUFFER, y), !(f.depthTexture && f.depthTexture.isDepthTexture))
|
|
52273
52273
|
throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");
|
|
52274
52274
|
const gA = t.get(f.depthTexture);
|
|
52275
|
-
if (gA.__renderTarget = f, (!gA.__webglTexture || f.depthTexture.image.width !== f.width || f.depthTexture.image.height !== f.height) && (f.depthTexture.image.width = f.width, f.depthTexture.image.height = f.height, f.depthTexture.needsUpdate = !0),
|
|
52275
|
+
if (gA.__renderTarget = f, (!gA.__webglTexture || f.depthTexture.image.width !== f.width || f.depthTexture.image.height !== f.height) && (f.depthTexture.image.width = f.width, f.depthTexture.image.height = f.height, f.depthTexture.needsUpdate = !0), X) {
|
|
52276
52276
|
if (gA.__webglInit === void 0 && (gA.__webglInit = !0, f.depthTexture.addEventListener("dispose", w)), gA.__webglTexture === void 0) {
|
|
52277
52277
|
gA.__webglTexture = i.createTexture(), e.bindTexture(i.TEXTURE_CUBE_MAP, gA.__webglTexture), VA(i.TEXTURE_CUBE_MAP, f.depthTexture);
|
|
52278
52278
|
const qA = o.convert(f.depthTexture.format), sA = o.convert(f.depthTexture.type);
|
|
@@ -52283,7 +52283,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52283
52283
|
}
|
|
52284
52284
|
} else
|
|
52285
52285
|
W(f.depthTexture, 0);
|
|
52286
|
-
const j = gA.__webglTexture, UA = M(f), dA =
|
|
52286
|
+
const j = gA.__webglTexture, UA = M(f), dA = X ? i.TEXTURE_CUBE_MAP_POSITIVE_X + F : i.TEXTURE_2D, FA = f.depthTexture.format === No ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT;
|
|
52287
52287
|
if (f.depthTexture.format === Ng)
|
|
52288
52288
|
It(f) ? I.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER, FA, dA, j, 0, UA) : i.framebufferTexture2D(i.FRAMEBUFFER, FA, dA, j, 0);
|
|
52289
52289
|
else if (f.depthTexture.format === No)
|
|
@@ -52294,35 +52294,35 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52294
52294
|
function le(y) {
|
|
52295
52295
|
const f = t.get(y), F = y.isWebGLCubeRenderTarget === !0;
|
|
52296
52296
|
if (f.__boundDepthTexture !== y.depthTexture) {
|
|
52297
|
-
const
|
|
52298
|
-
if (f.__depthDisposeCallback && f.__depthDisposeCallback(),
|
|
52297
|
+
const X = y.depthTexture;
|
|
52298
|
+
if (f.__depthDisposeCallback && f.__depthDisposeCallback(), X) {
|
|
52299
52299
|
const gA = () => {
|
|
52300
|
-
delete f.__boundDepthTexture, delete f.__depthDisposeCallback,
|
|
52300
|
+
delete f.__boundDepthTexture, delete f.__depthDisposeCallback, X.removeEventListener("dispose", gA);
|
|
52301
52301
|
};
|
|
52302
|
-
|
|
52302
|
+
X.addEventListener("dispose", gA), f.__depthDisposeCallback = gA;
|
|
52303
52303
|
}
|
|
52304
|
-
f.__boundDepthTexture =
|
|
52304
|
+
f.__boundDepthTexture = X;
|
|
52305
52305
|
}
|
|
52306
52306
|
if (y.depthTexture && !f.__autoAllocateDepthBuffer)
|
|
52307
52307
|
if (F)
|
|
52308
|
-
for (let
|
|
52309
|
-
GA(f.__webglFramebuffer[
|
|
52308
|
+
for (let X = 0; X < 6; X++)
|
|
52309
|
+
GA(f.__webglFramebuffer[X], y, X);
|
|
52310
52310
|
else {
|
|
52311
|
-
const
|
|
52312
|
-
|
|
52311
|
+
const X = y.texture.mipmaps;
|
|
52312
|
+
X && X.length > 0 ? GA(f.__webglFramebuffer[0], y, 0) : GA(f.__webglFramebuffer, y, 0);
|
|
52313
52313
|
}
|
|
52314
52314
|
else if (F) {
|
|
52315
52315
|
f.__webglDepthbuffer = [];
|
|
52316
|
-
for (let
|
|
52317
|
-
if (e.bindFramebuffer(i.FRAMEBUFFER, f.__webglFramebuffer[
|
|
52318
|
-
f.__webglDepthbuffer[
|
|
52316
|
+
for (let X = 0; X < 6; X++)
|
|
52317
|
+
if (e.bindFramebuffer(i.FRAMEBUFFER, f.__webglFramebuffer[X]), f.__webglDepthbuffer[X] === void 0)
|
|
52318
|
+
f.__webglDepthbuffer[X] = i.createRenderbuffer(), jA(f.__webglDepthbuffer[X], y, !1);
|
|
52319
52319
|
else {
|
|
52320
|
-
const gA = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = f.__webglDepthbuffer[
|
|
52320
|
+
const gA = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = f.__webglDepthbuffer[X];
|
|
52321
52321
|
i.bindRenderbuffer(i.RENDERBUFFER, j), i.framebufferRenderbuffer(i.FRAMEBUFFER, gA, i.RENDERBUFFER, j);
|
|
52322
52322
|
}
|
|
52323
52323
|
} else {
|
|
52324
|
-
const
|
|
52325
|
-
if (
|
|
52324
|
+
const X = y.texture.mipmaps;
|
|
52325
|
+
if (X && X.length > 0 ? e.bindFramebuffer(i.FRAMEBUFFER, f.__webglFramebuffer[0]) : e.bindFramebuffer(i.FRAMEBUFFER, f.__webglFramebuffer), f.__webglDepthbuffer === void 0)
|
|
52326
52326
|
f.__webglDepthbuffer = i.createRenderbuffer(), jA(f.__webglDepthbuffer, y, !1);
|
|
52327
52327
|
else {
|
|
52328
52328
|
const gA = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, j = f.__webglDepthbuffer;
|
|
@@ -52332,14 +52332,14 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52332
52332
|
e.bindFramebuffer(i.FRAMEBUFFER, null);
|
|
52333
52333
|
}
|
|
52334
52334
|
function dt(y, f, F) {
|
|
52335
|
-
const
|
|
52336
|
-
f !== void 0 && RA(
|
|
52335
|
+
const X = t.get(y);
|
|
52336
|
+
f !== void 0 && RA(X.__webglFramebuffer, y, y.texture, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, 0), F !== void 0 && le(y);
|
|
52337
52337
|
}
|
|
52338
52338
|
function ce(y) {
|
|
52339
|
-
const f = y.texture, F = t.get(y),
|
|
52339
|
+
const f = y.texture, F = t.get(y), X = t.get(f);
|
|
52340
52340
|
y.addEventListener("dispose", k);
|
|
52341
52341
|
const gA = y.textures, j = y.isWebGLCubeRenderTarget === !0, UA = gA.length > 1;
|
|
52342
|
-
if (UA || (
|
|
52342
|
+
if (UA || (X.__webglTexture === void 0 && (X.__webglTexture = i.createTexture()), X.__version = f.version, n.memory.textures++), j) {
|
|
52343
52343
|
F.__webglFramebuffer = [];
|
|
52344
52344
|
for (let dA = 0; dA < 6; dA++)
|
|
52345
52345
|
if (f.mipmaps && f.mipmaps.length > 0) {
|
|
@@ -52372,7 +52372,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52372
52372
|
}
|
|
52373
52373
|
}
|
|
52374
52374
|
if (j) {
|
|
52375
|
-
e.bindTexture(i.TEXTURE_CUBE_MAP,
|
|
52375
|
+
e.bindTexture(i.TEXTURE_CUBE_MAP, X.__webglTexture), VA(i.TEXTURE_CUBE_MAP, f);
|
|
52376
52376
|
for (let dA = 0; dA < 6; dA++)
|
|
52377
52377
|
if (f.mipmaps && f.mipmaps.length > 0)
|
|
52378
52378
|
for (let FA = 0; FA < f.mipmaps.length; FA++)
|
|
@@ -52389,7 +52389,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52389
52389
|
e.unbindTexture();
|
|
52390
52390
|
} else {
|
|
52391
52391
|
let dA = i.TEXTURE_2D;
|
|
52392
|
-
if ((y.isWebGL3DRenderTarget || y.isWebGLArrayRenderTarget) && (dA = y.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), e.bindTexture(dA,
|
|
52392
|
+
if ((y.isWebGL3DRenderTarget || y.isWebGLArrayRenderTarget) && (dA = y.isWebGL3DRenderTarget ? i.TEXTURE_3D : i.TEXTURE_2D_ARRAY), e.bindTexture(dA, X.__webglTexture), VA(dA, f), f.mipmaps && f.mipmaps.length > 0)
|
|
52393
52393
|
for (let FA = 0; FA < f.mipmaps.length; FA++)
|
|
52394
52394
|
RA(F.__webglFramebuffer[FA], y, f, i.COLOR_ATTACHMENT0, dA, FA);
|
|
52395
52395
|
else
|
|
@@ -52400,7 +52400,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52400
52400
|
}
|
|
52401
52401
|
function we(y) {
|
|
52402
52402
|
const f = y.textures;
|
|
52403
|
-
for (let F = 0,
|
|
52403
|
+
for (let F = 0, X = f.length; F < X; F++) {
|
|
52404
52404
|
const gA = f[F];
|
|
52405
52405
|
if (h(gA)) {
|
|
52406
52406
|
const j = x(y), UA = t.get(gA).__webglTexture;
|
|
@@ -52408,11 +52408,11 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52408
52408
|
}
|
|
52409
52409
|
}
|
|
52410
52410
|
}
|
|
52411
|
-
const Fe = [],
|
|
52411
|
+
const Fe = [], $A = [];
|
|
52412
52412
|
function nt(y) {
|
|
52413
52413
|
if (y.samples > 0) {
|
|
52414
52414
|
if (It(y) === !1) {
|
|
52415
|
-
const f = y.textures, F = y.width,
|
|
52415
|
+
const f = y.textures, F = y.width, X = y.height;
|
|
52416
52416
|
let gA = i.COLOR_BUFFER_BIT;
|
|
52417
52417
|
const j = y.stencilBuffer ? i.DEPTH_STENCIL_ATTACHMENT : i.DEPTH_ATTACHMENT, UA = t.get(y), dA = f.length > 1;
|
|
52418
52418
|
if (dA)
|
|
@@ -52427,7 +52427,7 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52427
52427
|
const sA = t.get(f[qA]).__webglTexture;
|
|
52428
52428
|
i.framebufferTexture2D(i.DRAW_FRAMEBUFFER, i.COLOR_ATTACHMENT0, i.TEXTURE_2D, sA, 0);
|
|
52429
52429
|
}
|
|
52430
|
-
i.blitFramebuffer(0, 0, F,
|
|
52430
|
+
i.blitFramebuffer(0, 0, F, X, 0, 0, F, X, gA, i.NEAREST), a === !0 && (Fe.length = 0, $A.length = 0, Fe.push(i.COLOR_ATTACHMENT0 + qA), y.depthBuffer && y.resolveDepthBuffer === !1 && (Fe.push(j), $A.push(j), i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER, $A)), i.invalidateFramebuffer(i.READ_FRAMEBUFFER, Fe));
|
|
52431
52431
|
}
|
|
52432
52432
|
if (e.bindFramebuffer(i.READ_FRAMEBUFFER, null), e.bindFramebuffer(i.DRAW_FRAMEBUFFER, null), dA)
|
|
52433
52433
|
for (let qA = 0; qA < f.length; qA++) {
|
|
@@ -52454,8 +52454,8 @@ function hF(i, A, e, t, g, o, n) {
|
|
|
52454
52454
|
C.get(y) !== f && (C.set(y, f), y.update());
|
|
52455
52455
|
}
|
|
52456
52456
|
function Te(y, f) {
|
|
52457
|
-
const F = y.colorSpace,
|
|
52458
|
-
return y.isCompressedTexture === !0 || y.isVideoTexture === !0 || F !== Yn && F !== Zg && (de.getTransfer(F) === ye ? (
|
|
52457
|
+
const F = y.colorSpace, X = y.format, gA = y.type;
|
|
52458
|
+
return y.isCompressedTexture === !0 || y.isVideoTexture === !0 || F !== Yn && F !== Zg && (de.getTransfer(F) === ye ? (X !== Ri || gA !== si) && PA("WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.") : ue("WebGLTextures: Unsupported texture color space:", F)), f;
|
|
52459
52459
|
}
|
|
52460
52460
|
function vA(y) {
|
|
52461
52461
|
return typeof HTMLImageElement < "u" && y instanceof HTMLImageElement ? (s.width = y.naturalWidth || y.width, s.height = y.naturalHeight || y.height) : typeof VideoFrame < "u" && y instanceof VideoFrame ? (s.width = y.displayWidth, s.height = y.displayHeight) : (s.width = y.width, s.height = y.height), s;
|
|
@@ -52662,42 +52662,42 @@ class DF extends jn {
|
|
|
52662
52662
|
m.viewport = new ot();
|
|
52663
52663
|
const S = [l, m], v = new bR();
|
|
52664
52664
|
let T = null, O = null;
|
|
52665
|
-
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(
|
|
52666
|
-
let oA = D[
|
|
52667
|
-
return oA === void 0 && (oA = new Sr(), D[
|
|
52668
|
-
}, this.getControllerGrip = function(
|
|
52669
|
-
let oA = D[
|
|
52670
|
-
return oA === void 0 && (oA = new Sr(), D[
|
|
52671
|
-
}, this.getHand = function(
|
|
52672
|
-
let oA = D[
|
|
52673
|
-
return oA === void 0 && (oA = new Sr(), D[
|
|
52665
|
+
this.cameraAutoUpdate = !0, this.enabled = !1, this.isPresenting = !1, this.getController = function(z) {
|
|
52666
|
+
let oA = D[z];
|
|
52667
|
+
return oA === void 0 && (oA = new Sr(), D[z] = oA), oA.getTargetRaySpace();
|
|
52668
|
+
}, this.getControllerGrip = function(z) {
|
|
52669
|
+
let oA = D[z];
|
|
52670
|
+
return oA === void 0 && (oA = new Sr(), D[z] = oA), oA.getGripSpace();
|
|
52671
|
+
}, this.getHand = function(z) {
|
|
52672
|
+
let oA = D[z];
|
|
52673
|
+
return oA === void 0 && (oA = new Sr(), D[z] = oA), oA.getHandSpace();
|
|
52674
52674
|
};
|
|
52675
|
-
function W(
|
|
52676
|
-
const oA = w.indexOf(
|
|
52675
|
+
function W(z) {
|
|
52676
|
+
const oA = w.indexOf(z.inputSource);
|
|
52677
52677
|
if (oA === -1)
|
|
52678
52678
|
return;
|
|
52679
52679
|
const RA = D[oA];
|
|
52680
|
-
RA !== void 0 && (RA.update(
|
|
52680
|
+
RA !== void 0 && (RA.update(z.inputSource, z.frame, s || n), RA.dispatchEvent({ type: z.type, data: z.inputSource }));
|
|
52681
52681
|
}
|
|
52682
52682
|
function P() {
|
|
52683
52683
|
g.removeEventListener("select", W), g.removeEventListener("selectstart", W), g.removeEventListener("selectend", W), g.removeEventListener("squeeze", W), g.removeEventListener("squeezestart", W), g.removeEventListener("squeezeend", W), g.removeEventListener("end", P), g.removeEventListener("inputsourceschange", V);
|
|
52684
|
-
for (let
|
|
52685
|
-
const oA = w[
|
|
52686
|
-
oA !== null && (w[
|
|
52684
|
+
for (let z = 0; z < D.length; z++) {
|
|
52685
|
+
const oA = w[z];
|
|
52686
|
+
oA !== null && (w[z] = null, D[z].disconnect(oA));
|
|
52687
52687
|
}
|
|
52688
52688
|
T = null, O = null, h.reset();
|
|
52689
|
-
for (const
|
|
52690
|
-
delete E[
|
|
52689
|
+
for (const z in E)
|
|
52690
|
+
delete E[z];
|
|
52691
52691
|
A.setRenderTarget(p), B = null, Q = null, r = null, g = null, u = null, Se.stop(), t.isPresenting = !1, A.setPixelRatio(b), A.setSize(k.width, k.height, !1), t.dispatchEvent({ type: "sessionend" });
|
|
52692
52692
|
}
|
|
52693
|
-
this.setFramebufferScaleFactor = function(
|
|
52694
|
-
o =
|
|
52695
|
-
}, this.setReferenceSpaceType = function(
|
|
52696
|
-
I =
|
|
52693
|
+
this.setFramebufferScaleFactor = function(z) {
|
|
52694
|
+
o = z, t.isPresenting === !0 && PA("WebXRManager: Cannot change framebuffer scale while presenting.");
|
|
52695
|
+
}, this.setReferenceSpaceType = function(z) {
|
|
52696
|
+
I = z, t.isPresenting === !0 && PA("WebXRManager: Cannot change reference space type while presenting.");
|
|
52697
52697
|
}, this.getReferenceSpace = function() {
|
|
52698
52698
|
return s || n;
|
|
52699
|
-
}, this.setReferenceSpace = function(
|
|
52700
|
-
s =
|
|
52699
|
+
}, this.setReferenceSpace = function(z) {
|
|
52700
|
+
s = z;
|
|
52701
52701
|
}, this.getBaseLayer = function() {
|
|
52702
52702
|
return Q !== null ? Q : B;
|
|
52703
52703
|
}, this.getBinding = function() {
|
|
@@ -52706,8 +52706,8 @@ class DF extends jn {
|
|
|
52706
52706
|
return d;
|
|
52707
52707
|
}, this.getSession = function() {
|
|
52708
52708
|
return g;
|
|
52709
|
-
}, this.setSession = async function(
|
|
52710
|
-
if (g =
|
|
52709
|
+
}, this.setSession = async function(z) {
|
|
52710
|
+
if (g = z, g !== null) {
|
|
52711
52711
|
if (p = A.getRenderTarget(), g.addEventListener("select", W), g.addEventListener("selectstart", W), g.addEventListener("selectend", W), g.addEventListener("squeeze", W), g.addEventListener("squeezestart", W), g.addEventListener("squeezeend", W), g.addEventListener("end", P), g.addEventListener("inputsourceschange", V), x.xrCompatible !== !0 && await e.makeXRCompatible(), b = A.getPixelRatio(), A.getSize(k), c && "createProjectionLayer" in XRWebGLBinding.prototype) {
|
|
52712
52712
|
let RA = null, jA = null, GA = null;
|
|
52713
52713
|
x.depth && (GA = x.stencil ? e.DEPTH24_STENCIL8 : e.DEPTH_COMPONENT24, RA = x.stencil ? No : Ng, jA = x.stencil ? jI : Ag);
|
|
@@ -52759,13 +52759,13 @@ class DF extends jn {
|
|
|
52759
52759
|
}, this.getDepthTexture = function() {
|
|
52760
52760
|
return h.getDepthTexture();
|
|
52761
52761
|
};
|
|
52762
|
-
function V(
|
|
52763
|
-
for (let oA = 0; oA <
|
|
52764
|
-
const RA =
|
|
52762
|
+
function V(z) {
|
|
52763
|
+
for (let oA = 0; oA < z.removed.length; oA++) {
|
|
52764
|
+
const RA = z.removed[oA], jA = w.indexOf(RA);
|
|
52765
52765
|
jA >= 0 && (w[jA] = null, D[jA].disconnect(RA));
|
|
52766
52766
|
}
|
|
52767
|
-
for (let oA = 0; oA <
|
|
52768
|
-
const RA =
|
|
52767
|
+
for (let oA = 0; oA < z.added.length; oA++) {
|
|
52768
|
+
const RA = z.added[oA];
|
|
52769
52769
|
let jA = w.indexOf(RA);
|
|
52770
52770
|
if (jA === -1) {
|
|
52771
52771
|
for (let le = 0; le < D.length; le++)
|
|
@@ -52783,51 +52783,51 @@ class DF extends jn {
|
|
|
52783
52783
|
}
|
|
52784
52784
|
}
|
|
52785
52785
|
const $ = new J(), DA = new J();
|
|
52786
|
-
function EA(
|
|
52786
|
+
function EA(z, oA, RA) {
|
|
52787
52787
|
$.setFromMatrixPosition(oA.matrixWorld), DA.setFromMatrixPosition(RA.matrixWorld);
|
|
52788
|
-
const jA = $.distanceTo(DA), GA = oA.projectionMatrix.elements, le = RA.projectionMatrix.elements, dt = GA[14] / (GA[10] - 1), ce = GA[14] / (GA[10] + 1), we = (GA[9] + 1) / GA[5], Fe = (GA[9] - 1) / GA[5],
|
|
52789
|
-
if (oA.matrixWorld.decompose(
|
|
52790
|
-
|
|
52788
|
+
const jA = $.distanceTo(DA), GA = oA.projectionMatrix.elements, le = RA.projectionMatrix.elements, dt = GA[14] / (GA[10] - 1), ce = GA[14] / (GA[10] + 1), we = (GA[9] + 1) / GA[5], Fe = (GA[9] - 1) / GA[5], $A = (GA[8] - 1) / GA[0], nt = (le[8] + 1) / le[0], M = dt * $A, It = dt * nt, pe = jA / (-$A + nt), Te = pe * -$A;
|
|
52789
|
+
if (oA.matrixWorld.decompose(z.position, z.quaternion, z.scale), z.translateX(Te), z.translateZ(pe), z.matrixWorld.compose(z.position, z.quaternion, z.scale), z.matrixWorldInverse.copy(z.matrixWorld).invert(), GA[10] === -1)
|
|
52790
|
+
z.projectionMatrix.copy(oA.projectionMatrix), z.projectionMatrixInverse.copy(oA.projectionMatrixInverse);
|
|
52791
52791
|
else {
|
|
52792
|
-
const vA = dt + pe, y = ce + pe, f = M - Te, F = It + (jA - Te),
|
|
52793
|
-
|
|
52792
|
+
const vA = dt + pe, y = ce + pe, f = M - Te, F = It + (jA - Te), X = we * ce / y * vA, gA = Fe * ce / y * vA;
|
|
52793
|
+
z.projectionMatrix.makePerspective(f, F, X, gA, vA, y), z.projectionMatrixInverse.copy(z.projectionMatrix).invert();
|
|
52794
52794
|
}
|
|
52795
52795
|
}
|
|
52796
|
-
function wA(
|
|
52797
|
-
oA === null ?
|
|
52796
|
+
function wA(z, oA) {
|
|
52797
|
+
oA === null ? z.matrixWorld.copy(z.matrix) : z.matrixWorld.multiplyMatrices(oA.matrixWorld, z.matrix), z.matrixWorldInverse.copy(z.matrixWorld).invert();
|
|
52798
52798
|
}
|
|
52799
|
-
this.updateCamera = function(
|
|
52799
|
+
this.updateCamera = function(z) {
|
|
52800
52800
|
if (g === null) return;
|
|
52801
|
-
let oA =
|
|
52801
|
+
let oA = z.near, RA = z.far;
|
|
52802
52802
|
h.texture !== null && (h.depthNear > 0 && (oA = h.depthNear), h.depthFar > 0 && (RA = h.depthFar)), v.near = m.near = l.near = oA, v.far = m.far = l.far = RA, (T !== v.near || O !== v.far) && (g.updateRenderState({
|
|
52803
52803
|
depthNear: v.near,
|
|
52804
52804
|
depthFar: v.far
|
|
52805
|
-
}), T = v.near, O = v.far), v.layers.mask =
|
|
52806
|
-
const jA =
|
|
52805
|
+
}), T = v.near, O = v.far), v.layers.mask = z.layers.mask | 6, l.layers.mask = v.layers.mask & 3, m.layers.mask = v.layers.mask & 5;
|
|
52806
|
+
const jA = z.parent, GA = v.cameras;
|
|
52807
52807
|
wA(v, jA);
|
|
52808
52808
|
for (let le = 0; le < GA.length; le++)
|
|
52809
52809
|
wA(GA[le], jA);
|
|
52810
|
-
GA.length === 2 ? EA(v, l, m) : v.projectionMatrix.copy(l.projectionMatrix), VA(
|
|
52810
|
+
GA.length === 2 ? EA(v, l, m) : v.projectionMatrix.copy(l.projectionMatrix), VA(z, v, jA);
|
|
52811
52811
|
};
|
|
52812
|
-
function VA(
|
|
52813
|
-
RA === null ?
|
|
52812
|
+
function VA(z, oA, RA) {
|
|
52813
|
+
RA === null ? z.matrix.copy(oA.matrixWorld) : (z.matrix.copy(RA.matrixWorld), z.matrix.invert(), z.matrix.multiply(oA.matrixWorld)), z.matrix.decompose(z.position, z.quaternion, z.scale), z.updateMatrixWorld(!0), z.projectionMatrix.copy(oA.projectionMatrix), z.projectionMatrixInverse.copy(oA.projectionMatrixInverse), z.isPerspectiveCamera && (z.fov = UB * 2 * Math.atan(1 / z.projectionMatrix.elements[5]), z.zoom = 1);
|
|
52814
52814
|
}
|
|
52815
52815
|
this.getCamera = function() {
|
|
52816
52816
|
return v;
|
|
52817
52817
|
}, this.getFoveation = function() {
|
|
52818
52818
|
if (!(Q === null && B === null))
|
|
52819
52819
|
return a;
|
|
52820
|
-
}, this.setFoveation = function(
|
|
52821
|
-
a =
|
|
52820
|
+
}, this.setFoveation = function(z) {
|
|
52821
|
+
a = z, Q !== null && (Q.fixedFoveation = z), B !== null && B.fixedFoveation !== void 0 && (B.fixedFoveation = z);
|
|
52822
52822
|
}, this.hasDepthSensing = function() {
|
|
52823
52823
|
return h.texture !== null;
|
|
52824
52824
|
}, this.getDepthSensingMesh = function() {
|
|
52825
52825
|
return h.getMesh(v);
|
|
52826
|
-
}, this.getCameraTexture = function(
|
|
52827
|
-
return E[
|
|
52826
|
+
}, this.getCameraTexture = function(z) {
|
|
52827
|
+
return E[z];
|
|
52828
52828
|
};
|
|
52829
52829
|
let OA = null;
|
|
52830
|
-
function Pe(
|
|
52830
|
+
function Pe(z, oA) {
|
|
52831
52831
|
if (C = oA.getViewerPose(s || n), d = oA, C !== null) {
|
|
52832
52832
|
const RA = C.views;
|
|
52833
52833
|
B !== null && (A.setRenderTargetFramebuffer(u, B.framebuffer), A.setRenderTarget(u));
|
|
@@ -52846,8 +52846,8 @@ class DF extends jn {
|
|
|
52846
52846
|
nt.depthStencilTexture
|
|
52847
52847
|
), A.setRenderTarget(u));
|
|
52848
52848
|
}
|
|
52849
|
-
let
|
|
52850
|
-
|
|
52849
|
+
let $A = S[ce];
|
|
52850
|
+
$A === void 0 && ($A = new ai(), $A.layers.enable(ce), $A.viewport = new ot(), S[ce] = $A), $A.matrix.fromArray(we.transform.matrix), $A.matrix.decompose($A.position, $A.quaternion, $A.scale), $A.projectionMatrix.fromArray(we.projectionMatrix), $A.projectionMatrixInverse.copy($A.projectionMatrix).invert(), $A.viewport.set(Fe.x, Fe.y, Fe.width, Fe.height), ce === 0 && (v.matrix.copy($A.matrix), v.matrix.decompose(v.position, v.quaternion, v.scale)), jA === !0 && v.cameras.push($A);
|
|
52851
52851
|
}
|
|
52852
52852
|
const GA = g.enabledFeatures;
|
|
52853
52853
|
if (GA && GA.includes("depth-sensing") && g.depthUsage == "gpu-optimized" && c) {
|
|
@@ -52862,8 +52862,8 @@ class DF extends jn {
|
|
|
52862
52862
|
if (we) {
|
|
52863
52863
|
let Fe = E[we];
|
|
52864
52864
|
Fe || (Fe = new vf(), E[we] = Fe);
|
|
52865
|
-
const
|
|
52866
|
-
Fe.sourceTexture =
|
|
52865
|
+
const $A = r.getCameraImage(we);
|
|
52866
|
+
Fe.sourceTexture = $A;
|
|
52867
52867
|
}
|
|
52868
52868
|
}
|
|
52869
52869
|
}
|
|
@@ -52872,11 +52872,11 @@ class DF extends jn {
|
|
|
52872
52872
|
const jA = w[RA], GA = D[RA];
|
|
52873
52873
|
jA !== null && GA !== void 0 && GA.update(jA, oA, s || n);
|
|
52874
52874
|
}
|
|
52875
|
-
OA && OA(
|
|
52875
|
+
OA && OA(z, oA), oA.detectedPlanes && t.dispatchEvent({ type: "planesdetected", data: oA }), d = null;
|
|
52876
52876
|
}
|
|
52877
52877
|
const Se = new Uf();
|
|
52878
|
-
Se.setAnimationLoop(Pe), this.setAnimationLoop = function(
|
|
52879
|
-
OA =
|
|
52878
|
+
Se.setAnimationLoop(Pe), this.setAnimationLoop = function(z) {
|
|
52879
|
+
OA = z;
|
|
52880
52880
|
}, this.dispose = function() {
|
|
52881
52881
|
};
|
|
52882
52882
|
}
|
|
@@ -53617,14 +53617,14 @@ class yF {
|
|
|
53617
53617
|
let S = 0, v = 0, T = null, O = -1, W = null;
|
|
53618
53618
|
const P = new ot(), V = new ot();
|
|
53619
53619
|
let $ = null;
|
|
53620
|
-
const DA = new
|
|
53620
|
+
const DA = new Ee(0);
|
|
53621
53621
|
let EA = 0, wA = e.width, VA = e.height, OA = 1, Pe = null, Se = null;
|
|
53622
|
-
const
|
|
53622
|
+
const z = new ot(0, 0, wA, VA), oA = new ot(0, 0, wA, VA);
|
|
53623
53623
|
let RA = !1;
|
|
53624
53624
|
const jA = new Ff();
|
|
53625
53625
|
let GA = !1, le = !1;
|
|
53626
53626
|
const dt = new rt(), ce = new J(), we = new ot(), Fe = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: !0 };
|
|
53627
|
-
let
|
|
53627
|
+
let $A = !1;
|
|
53628
53628
|
function nt() {
|
|
53629
53629
|
return T === null ? OA : 1;
|
|
53630
53630
|
}
|
|
@@ -53651,9 +53651,9 @@ class yF {
|
|
|
53651
53651
|
} catch (_) {
|
|
53652
53652
|
throw ue("WebGLRenderer: " + _.message), _;
|
|
53653
53653
|
}
|
|
53654
|
-
let pe, Te, vA, y, f, F,
|
|
53654
|
+
let pe, Te, vA, y, f, F, X, gA, j, UA, dA, FA, qA, sA, lA, MA, LA, hA, Ae, G, mA, rA, kA, aA;
|
|
53655
53655
|
function eA() {
|
|
53656
|
-
pe = new kM(M), pe.init(), rA = new lF(M, pe), Te = new lM(M, pe, A, rA), vA = new dF(M, pe), Te.reversedDepthBuffer && Q && vA.buffers.depth.setReversed(!0), y = new RM(M), f = new eF(), F = new hF(M, pe, vA, f, Te, rA, y),
|
|
53656
|
+
pe = new kM(M), pe.init(), rA = new lF(M, pe), Te = new lM(M, pe, A, rA), vA = new dF(M, pe), Te.reversedDepthBuffer && Q && vA.buffers.depth.setReversed(!0), y = new RM(M), f = new eF(), F = new hF(M, pe, vA, f, Te, rA, y), X = new uM(l), gA = new _M(l), j = new GR(M), kA = new dM(M, j), UA = new yM(M, j, y, kA), dA = new NM(M, UA, j, y), Ae = new bM(M, Te, F), MA = new xM(f), FA = new AF(l, X, gA, pe, Te, kA, MA), qA = new wF(l, f), sA = new iF(), lA = new sF(pe), hA = new cM(l, X, gA, vA, dA, d, a), LA = new EF(l, dA, Te), aA = new mF(M, y, Te, vA), G = new hM(M, pe, y), mA = new SM(M, pe, y), y.programs = FA.programs, l.capabilities = Te, l.extensions = pe, l.properties = f, l.renderLists = sA, l.shadowMap = LA, l.state = vA, l.info = y;
|
|
53657
53657
|
}
|
|
53658
53658
|
eA(), c !== si && (b = new GM(c, e.width, e.height, g, o));
|
|
53659
53659
|
const cA = new DF(l, M);
|
|
@@ -53699,9 +53699,9 @@ class yF {
|
|
|
53699
53699
|
}, this.getCurrentViewport = function(_) {
|
|
53700
53700
|
return _.copy(P);
|
|
53701
53701
|
}, this.getViewport = function(_) {
|
|
53702
|
-
return _.copy(
|
|
53702
|
+
return _.copy(z);
|
|
53703
53703
|
}, this.setViewport = function(_, L, H, Y) {
|
|
53704
|
-
_.isVector4 ?
|
|
53704
|
+
_.isVector4 ? z.set(_.x, _.y, _.z, _.w) : z.set(_, L, H, Y), vA.viewport(P.copy(z).multiplyScalar(OA).round());
|
|
53705
53705
|
}, this.getScissor = function(_) {
|
|
53706
53706
|
return _.copy(oA);
|
|
53707
53707
|
}, this.setScissor = function(_, L, H, Y) {
|
|
@@ -53744,7 +53744,7 @@ class yF {
|
|
|
53744
53744
|
}, this.clearStencil = function() {
|
|
53745
53745
|
this.clear(!1, !1, !0);
|
|
53746
53746
|
}, this.dispose = function() {
|
|
53747
|
-
e.removeEventListener("webglcontextlost", HA, !1), e.removeEventListener("webglcontextrestored", Ke, !1), e.removeEventListener("webglcontextcreationerror", me, !1), hA.dispose(), sA.dispose(), lA.dispose(), f.dispose(),
|
|
53747
|
+
e.removeEventListener("webglcontextlost", HA, !1), e.removeEventListener("webglcontextrestored", Ke, !1), e.removeEventListener("webglcontextcreationerror", me, !1), hA.dispose(), sA.dispose(), lA.dispose(), f.dispose(), X.dispose(), gA.dispose(), dA.dispose(), kA.dispose(), aA.dispose(), FA.dispose(), cA.dispose(), cA.removeEventListener("sessionstart", OE), cA.removeEventListener("sessionend", VE), Eo.stop();
|
|
53748
53748
|
};
|
|
53749
53749
|
function HA(_) {
|
|
53750
53750
|
_.preventDefault(), ud("WebGLRenderer: Context Lost."), m = !0;
|
|
@@ -53780,9 +53780,9 @@ class yF {
|
|
|
53780
53780
|
TA = 2;
|
|
53781
53781
|
}
|
|
53782
53782
|
const YA = H.drawRange, KA = H.attributes.position;
|
|
53783
|
-
let
|
|
53784
|
-
xA !== null && (
|
|
53785
|
-
const ze = Re -
|
|
53783
|
+
let oe = YA.start * TA, Re = (YA.start + YA.count) * TA;
|
|
53784
|
+
xA !== null && (oe = Math.max(oe, xA.start * TA), Re = Math.min(Re, (xA.start + xA.count) * TA)), bA !== null ? (oe = Math.max(oe, 0), Re = Math.min(Re, bA.count)) : KA != null && (oe = Math.max(oe, 0), Re = Math.min(Re, KA.count));
|
|
53785
|
+
const ze = Re - oe;
|
|
53786
53786
|
if (ze < 0 || ze === 1 / 0) return;
|
|
53787
53787
|
kA.setup(K, Y, pA, H, bA);
|
|
53788
53788
|
let $e, ve = G;
|
|
@@ -53803,12 +53803,12 @@ class yF {
|
|
|
53803
53803
|
Oo.setValue(M, "_gl_DrawID", Wt), ve.render(JA[Wt] / jt, _e[Wt]);
|
|
53804
53804
|
}
|
|
53805
53805
|
else if (K.isInstancedMesh)
|
|
53806
|
-
ve.renderInstances(
|
|
53806
|
+
ve.renderInstances(oe, ze, K.count);
|
|
53807
53807
|
else if (H.isInstancedBufferGeometry) {
|
|
53808
53808
|
const JA = H._maxInstanceCount !== void 0 ? H._maxInstanceCount : 1 / 0, _e = Math.min(H.instanceCount, JA);
|
|
53809
|
-
ve.renderInstances(
|
|
53809
|
+
ve.renderInstances(oe, ze, _e);
|
|
53810
53810
|
} else
|
|
53811
|
-
ve.render(
|
|
53811
|
+
ve.render(oe, ze);
|
|
53812
53812
|
};
|
|
53813
53813
|
function PE(_, L, H) {
|
|
53814
53814
|
_.transparent === !0 && _.side === fg && _.forceSinglePass === !1 ? (_.side = Gt, _.needsUpdate = !0, Ba(_, L, H), _.side = Rg, _.needsUpdate = !0, Ba(_, L, H), _.side = fg) : Ba(_, L, H);
|
|
@@ -53872,7 +53872,7 @@ class yF {
|
|
|
53872
53872
|
const SA = l.xr.getDepthSensingMesh();
|
|
53873
53873
|
SA !== null && DC(SA, L, -1 / 0, l.sortObjects);
|
|
53874
53874
|
}
|
|
53875
|
-
DC(_, L, 0, l.sortObjects), u.finish(), l.sortObjects === !0 && u.sort(Pe, Se),
|
|
53875
|
+
DC(_, L, 0, l.sortObjects), u.finish(), l.sortObjects === !0 && u.sort(Pe, Se), $A = cA.enabled === !1 || cA.isPresenting === !1 || cA.hasDepthSensing() === !1, $A && hA.addToRenderList(u, _), this.info.render.frame++, GA === !0 && MA.beginShadows();
|
|
53876
53876
|
const K = D.state.shadowsArray;
|
|
53877
53877
|
if (LA.render(K, _, L), GA === !0 && MA.endShadows(), this.info.autoReset === !0 && this.info.reset(), (Y && b.hasRenderPass()) === !1) {
|
|
53878
53878
|
const SA = u.opaque, pA = u.transmissive;
|
|
@@ -53883,13 +53883,13 @@ class yF {
|
|
|
53883
53883
|
const KA = bA[TA];
|
|
53884
53884
|
WE(SA, pA, _, KA);
|
|
53885
53885
|
}
|
|
53886
|
-
|
|
53886
|
+
$A && hA.render(_);
|
|
53887
53887
|
for (let TA = 0, YA = bA.length; TA < YA; TA++) {
|
|
53888
53888
|
const KA = bA[TA];
|
|
53889
53889
|
jE(u, _, KA, KA.viewport);
|
|
53890
53890
|
}
|
|
53891
53891
|
} else
|
|
53892
|
-
pA.length > 0 && WE(SA, pA, _, L),
|
|
53892
|
+
pA.length > 0 && WE(SA, pA, _, L), $A && hA.render(_), jE(u, _, L);
|
|
53893
53893
|
}
|
|
53894
53894
|
T !== null && v === 0 && (F.updateMultisampleRenderTarget(T), F.updateRenderTargetMipmap(T)), Y && b.end(l), _.isScene === !0 && _.onAfterRender(l, _, L), kA.resetDefaultState(), O = -1, W = null, k.pop(), k.length > 0 ? (D = k[k.length - 1], GA === !0 && MA.setGlobalState(l.clippingPlanes, D.state.camera)) : D = null, w.pop(), w.length > 0 ? u = w[w.length - 1] : u = null;
|
|
53895
53895
|
};
|
|
@@ -53913,8 +53913,8 @@ class yF {
|
|
|
53913
53913
|
if (Y && (_.boundingSphere !== void 0 ? (_.boundingSphere === null && _.computeBoundingSphere(), we.copy(_.boundingSphere.center)) : (SA.boundingSphere === null && SA.computeBoundingSphere(), we.copy(SA.boundingSphere.center)), we.applyMatrix4(_.matrixWorld).applyMatrix4(dt)), Array.isArray(pA)) {
|
|
53914
53914
|
const bA = SA.groups;
|
|
53915
53915
|
for (let TA = 0, YA = bA.length; TA < YA; TA++) {
|
|
53916
|
-
const KA = bA[TA],
|
|
53917
|
-
|
|
53916
|
+
const KA = bA[TA], oe = pA[KA.materialIndex];
|
|
53917
|
+
oe && oe.visible && u.push(_, SA, oe, H, we.z, KA);
|
|
53918
53918
|
}
|
|
53919
53919
|
} else pA.visible && u.push(_, SA, pA, H, we.z, null);
|
|
53920
53920
|
}
|
|
@@ -53931,10 +53931,10 @@ class yF {
|
|
|
53931
53931
|
if ((H.isScene === !0 ? H.overrideMaterial : null) !== null)
|
|
53932
53932
|
return;
|
|
53933
53933
|
if (D.state.transmissionRenderTarget[Y.id] === void 0) {
|
|
53934
|
-
const
|
|
53934
|
+
const oe = pe.has("EXT_color_buffer_half_float") || pe.has("EXT_color_buffer_float");
|
|
53935
53935
|
D.state.transmissionRenderTarget[Y.id] = new Zi(1, 1, {
|
|
53936
53936
|
generateMipmaps: !0,
|
|
53937
|
-
type:
|
|
53937
|
+
type: oe ? bg : si,
|
|
53938
53938
|
minFilter: bo,
|
|
53939
53939
|
samples: Te.samples,
|
|
53940
53940
|
stencilBuffer: o,
|
|
@@ -53946,20 +53946,20 @@ class yF {
|
|
|
53946
53946
|
const xA = D.state.transmissionRenderTarget[Y.id], SA = Y.viewport || P;
|
|
53947
53947
|
xA.setSize(SA.z * l.transmissionResolutionScale, SA.w * l.transmissionResolutionScale);
|
|
53948
53948
|
const pA = l.getRenderTarget(), bA = l.getActiveCubeFace(), TA = l.getActiveMipmapLevel();
|
|
53949
|
-
l.setRenderTarget(xA), l.getClearColor(DA), EA = l.getClearAlpha(), EA < 1 && l.setClearColor(16777215, 0.5), l.clear(),
|
|
53949
|
+
l.setRenderTarget(xA), l.getClearColor(DA), EA = l.getClearAlpha(), EA < 1 && l.setClearColor(16777215, 0.5), l.clear(), $A && hA.render(H);
|
|
53950
53950
|
const YA = l.toneMapping;
|
|
53951
53951
|
l.toneMapping = Wi;
|
|
53952
53952
|
const KA = Y.viewport;
|
|
53953
53953
|
if (Y.viewport !== void 0 && (Y.viewport = void 0), D.setupLightsView(Y), GA === !0 && MA.setGlobalState(l.clippingPlanes, Y), Qa(_, H, Y), F.updateMultisampleRenderTarget(xA), F.updateRenderTargetMipmap(xA), pe.has("WEBGL_multisampled_render_to_texture") === !1) {
|
|
53954
|
-
let
|
|
53954
|
+
let oe = !1;
|
|
53955
53955
|
for (let Re = 0, ze = L.length; Re < ze; Re++) {
|
|
53956
53956
|
const $e = L[Re], { object: ve, geometry: JA, material: _e, group: xe } = $e;
|
|
53957
53957
|
if (_e.side === fg && ve.layers.test(Y.layers)) {
|
|
53958
53958
|
const jt = _e.side;
|
|
53959
|
-
_e.side = Gt, _e.needsUpdate = !0, ZE(ve, H, Y, JA, _e, xe), _e.side = jt, _e.needsUpdate = !0,
|
|
53959
|
+
_e.side = Gt, _e.needsUpdate = !0, ZE(ve, H, Y, JA, _e, xe), _e.side = jt, _e.needsUpdate = !0, oe = !0;
|
|
53960
53960
|
}
|
|
53961
53961
|
}
|
|
53962
|
-
|
|
53962
|
+
oe === !0 && (F.updateMultisampleRenderTarget(xA), F.updateRenderTargetMipmap(xA));
|
|
53963
53963
|
}
|
|
53964
53964
|
l.setRenderTarget(pA, bA, TA), l.setClearColor(DA, EA), KA !== void 0 && (Y.viewport = KA), l.toneMapping = YA;
|
|
53965
53965
|
}
|
|
@@ -53978,7 +53978,7 @@ class yF {
|
|
|
53978
53978
|
L.isScene !== !0 && (L = Fe);
|
|
53979
53979
|
const Y = f.get(_), K = D.state.lights, xA = D.state.shadowsArray, SA = K.state.version, pA = FA.getParameters(_, K.state, xA, L, H), bA = FA.getProgramCacheKey(pA);
|
|
53980
53980
|
let TA = Y.programs;
|
|
53981
|
-
Y.environment = _.isMeshStandardMaterial ? L.environment : null, Y.fog = L.fog, Y.envMap = (_.isMeshStandardMaterial ? gA :
|
|
53981
|
+
Y.environment = _.isMeshStandardMaterial ? L.environment : null, Y.fog = L.fog, Y.envMap = (_.isMeshStandardMaterial ? gA : X).get(_.envMap || Y.environment), Y.envMapRotation = Y.environment !== null && _.envMap === null ? L.environmentRotation : _.envMapRotation, TA === void 0 && (_.addEventListener("dispose", vi), TA = /* @__PURE__ */ new Map(), Y.programs = TA);
|
|
53982
53982
|
let YA = TA.get(bA);
|
|
53983
53983
|
if (YA !== void 0) {
|
|
53984
53984
|
if (Y.currentProgram === YA && Y.lightsStateVersion === SA)
|
|
@@ -54001,7 +54001,7 @@ class yF {
|
|
|
54001
54001
|
}
|
|
54002
54002
|
function Of(_, L, H, Y, K) {
|
|
54003
54003
|
L.isScene !== !0 && (L = Fe), F.resetTextureUnits();
|
|
54004
|
-
const xA = L.fog, SA = Y.isMeshStandardMaterial ? L.environment : null, pA = T === null ? l.outputColorSpace : T.isXRRenderTarget === !0 ? T.texture.colorSpace : Yn, bA = (Y.isMeshStandardMaterial ? gA :
|
|
54004
|
+
const xA = L.fog, SA = Y.isMeshStandardMaterial ? L.environment : null, pA = T === null ? l.outputColorSpace : T.isXRRenderTarget === !0 ? T.texture.colorSpace : Yn, bA = (Y.isMeshStandardMaterial ? gA : X).get(Y.envMap || SA), TA = Y.vertexColors === !0 && !!H.attributes.color && H.attributes.color.itemSize === 4, YA = !!H.attributes.tangent && (!!Y.normalMap || Y.anisotropy > 0), KA = !!H.morphAttributes.position, oe = !!H.morphAttributes.normal, Re = !!H.morphAttributes.color;
|
|
54005
54005
|
let ze = Wi;
|
|
54006
54006
|
Y.toneMapped && (T === null || T.isXRRenderTarget === !0) && (ze = l.toneMapping);
|
|
54007
54007
|
const $e = H.morphAttributes.position || H.morphAttributes.normal || H.morphAttributes.color, ve = $e !== void 0 ? $e.length : 0, JA = f.get(Y), _e = D.state.lights;
|
|
@@ -54010,7 +54010,7 @@ class yF {
|
|
|
54010
54010
|
MA.setState(Y, _, Rt);
|
|
54011
54011
|
}
|
|
54012
54012
|
let xe = !1;
|
|
54013
|
-
Y.version === JA.__version ? (JA.needsLights && JA.lightsStateVersion !== _e.state.version || JA.outputColorSpace !== pA || K.isBatchedMesh && JA.batching === !1 || !K.isBatchedMesh && JA.batching === !0 || K.isBatchedMesh && JA.batchingColor === !0 && K.colorTexture === null || K.isBatchedMesh && JA.batchingColor === !1 && K.colorTexture !== null || K.isInstancedMesh && JA.instancing === !1 || !K.isInstancedMesh && JA.instancing === !0 || K.isSkinnedMesh && JA.skinning === !1 || !K.isSkinnedMesh && JA.skinning === !0 || K.isInstancedMesh && JA.instancingColor === !0 && K.instanceColor === null || K.isInstancedMesh && JA.instancingColor === !1 && K.instanceColor !== null || K.isInstancedMesh && JA.instancingMorph === !0 && K.morphTexture === null || K.isInstancedMesh && JA.instancingMorph === !1 && K.morphTexture !== null || JA.envMap !== bA || Y.fog === !0 && JA.fog !== xA || JA.numClippingPlanes !== void 0 && (JA.numClippingPlanes !== MA.numPlanes || JA.numIntersection !== MA.numIntersection) || JA.vertexAlphas !== TA || JA.vertexTangents !== YA || JA.morphTargets !== KA || JA.morphNormals !==
|
|
54013
|
+
Y.version === JA.__version ? (JA.needsLights && JA.lightsStateVersion !== _e.state.version || JA.outputColorSpace !== pA || K.isBatchedMesh && JA.batching === !1 || !K.isBatchedMesh && JA.batching === !0 || K.isBatchedMesh && JA.batchingColor === !0 && K.colorTexture === null || K.isBatchedMesh && JA.batchingColor === !1 && K.colorTexture !== null || K.isInstancedMesh && JA.instancing === !1 || !K.isInstancedMesh && JA.instancing === !0 || K.isSkinnedMesh && JA.skinning === !1 || !K.isSkinnedMesh && JA.skinning === !0 || K.isInstancedMesh && JA.instancingColor === !0 && K.instanceColor === null || K.isInstancedMesh && JA.instancingColor === !1 && K.instanceColor !== null || K.isInstancedMesh && JA.instancingMorph === !0 && K.morphTexture === null || K.isInstancedMesh && JA.instancingMorph === !1 && K.morphTexture !== null || JA.envMap !== bA || Y.fog === !0 && JA.fog !== xA || JA.numClippingPlanes !== void 0 && (JA.numClippingPlanes !== MA.numPlanes || JA.numIntersection !== MA.numIntersection) || JA.vertexAlphas !== TA || JA.vertexTangents !== YA || JA.morphTargets !== KA || JA.morphNormals !== oe || JA.morphColors !== Re || JA.toneMapping !== ze || JA.morphTargetsCount !== ve) && (xe = !0) : (xe = !0, JA.__version = Y.version);
|
|
54014
54014
|
let jt = JA.currentProgram;
|
|
54015
54015
|
xe === !0 && (jt = Ba(Y, L, K));
|
|
54016
54016
|
let Oo = !1, Wt = !1, Zn = !1;
|
|
@@ -54031,7 +54031,7 @@ class yF {
|
|
|
54031
54031
|
}
|
|
54032
54032
|
K.isBatchedMesh && (Je.setOptional(M, K, "batchingTexture"), Je.setValue(M, "batchingTexture", K._matricesTexture, F), Je.setOptional(M, K, "batchingIdTexture"), Je.setValue(M, "batchingIdTexture", K._indirectTexture, F), Je.setOptional(M, K, "batchingColorTexture"), K._colorsTexture !== null && Je.setValue(M, "batchingColorTexture", K._colorsTexture, F));
|
|
54033
54033
|
const ii = H.morphAttributes;
|
|
54034
|
-
if ((ii.position !== void 0 || ii.normal !== void 0 || ii.color !== void 0) &&
|
|
54034
|
+
if ((ii.position !== void 0 || ii.normal !== void 0 || ii.color !== void 0) && Ae.update(K, H, jt), (Wt || JA.receiveShadow !== K.receiveShadow) && (JA.receiveShadow = K.receiveShadow, Je.setValue(M, "receiveShadow", K.receiveShadow)), Y.isMeshGouraudMaterial && Y.envMap !== null && (Lt.envMap.value = bA, Lt.flipEnvMap.value = bA.isCubeTexture && bA.isRenderTargetTexture === !1 ? -1 : 1), Y.isMeshStandardMaterial && Y.envMap === null && L.environment !== null && (Lt.envMapIntensity.value = L.environmentIntensity), Lt.dfgLUT !== void 0 && (Lt.dfgLUT.value = kF()), Wt && (Je.setValue(M, "toneMappingExposure", l.toneMappingExposure), JA.needsLights && Vf(Lt, Zn), xA && Y.fog === !0 && qA.refreshFogUniforms(Lt, xA), qA.refreshMaterialUniforms(Lt, Y, OA, VA, D.state.transmissionRenderTarget[_.id]), cs.upload(M, XE(JA), Lt, F)), Y.isShaderMaterial && Y.uniformsNeedUpdate === !0 && (cs.upload(M, XE(JA), Lt, F), Y.uniformsNeedUpdate = !1), Y.isSpriteMaterial && Je.setValue(M, "center", K.center), Je.setValue(M, "modelViewMatrix", K.modelViewMatrix), Je.setValue(M, "normalMatrix", K.normalMatrix), Je.setValue(M, "modelMatrix", K.matrixWorld), Y.isShaderMaterial || Y.isRawShaderMaterial) {
|
|
54035
54035
|
const Rt = Y.uniformsGroups;
|
|
54036
54036
|
for (let Ut = 0, pC = Rt.length; Ut < pC; Ut++) {
|
|
54037
54037
|
const co = Rt[Ut];
|
|
@@ -54085,7 +54085,7 @@ class yF {
|
|
|
54085
54085
|
const TA = f.get(_).__webglFramebuffer;
|
|
54086
54086
|
_.isWebGLCubeRenderTarget ? (Array.isArray(TA[L]) ? Y = TA[L][H] : Y = TA[L], K = !0) : _.samples > 0 && F.useMultisampledRTT(_) === !1 ? Y = f.get(_).__webglMultisampledFramebuffer : Array.isArray(TA) ? Y = TA[H] : Y = TA, P.copy(_.viewport), V.copy(_.scissor), $ = _.scissorTest;
|
|
54087
54087
|
} else
|
|
54088
|
-
P.copy(
|
|
54088
|
+
P.copy(z).multiplyScalar(OA).floor(), V.copy(oA).multiplyScalar(OA).floor(), $ = RA;
|
|
54089
54089
|
if (H !== 0 && (Y = Wf), vA.bindFramebuffer(M.FRAMEBUFFER, Y) && vA.drawBuffers(_, Y), vA.viewport(P), vA.scissor(V), vA.setScissorTest($), K) {
|
|
54090
54090
|
const pA = f.get(_.texture);
|
|
54091
54091
|
M.framebufferTexture2D(M.FRAMEBUFFER, M.COLOR_ATTACHMENT0, M.TEXTURE_CUBE_MAP_POSITIVE_X + L, pA.__webglTexture, H);
|
|
@@ -54136,12 +54136,12 @@ class yF {
|
|
|
54136
54136
|
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");
|
|
54137
54137
|
if (!Te.textureTypeReadable(KA))
|
|
54138
54138
|
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");
|
|
54139
|
-
const
|
|
54140
|
-
M.bindBuffer(M.PIXEL_PACK_BUFFER,
|
|
54139
|
+
const oe = M.createBuffer();
|
|
54140
|
+
M.bindBuffer(M.PIXEL_PACK_BUFFER, oe), M.bufferData(M.PIXEL_PACK_BUFFER, xA.byteLength, M.STREAM_READ), _.textures.length > 1 && M.readBuffer(M.COLOR_ATTACHMENT0 + pA), M.readPixels(L, H, Y, K, rA.convert(YA), rA.convert(KA), 0);
|
|
54141
54141
|
const Re = T !== null ? f.get(T).__webglFramebuffer : null;
|
|
54142
54142
|
vA.bindFramebuffer(M.FRAMEBUFFER, Re);
|
|
54143
54143
|
const ze = M.fenceSync(M.SYNC_GPU_COMMANDS_COMPLETE, 0);
|
|
54144
|
-
return M.flush(), await ZS(M, ze, 4), M.bindBuffer(M.PIXEL_PACK_BUFFER,
|
|
54144
|
+
return M.flush(), await ZS(M, ze, 4), M.bindBuffer(M.PIXEL_PACK_BUFFER, oe), M.getBufferSubData(M.PIXEL_PACK_BUFFER, 0, xA), M.deleteBuffer(oe), M.deleteSync(ze), xA;
|
|
54145
54145
|
} else
|
|
54146
54146
|
throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.");
|
|
54147
54147
|
}, this.copyFramebufferToTexture = function(_, L = null, H = 0) {
|
|
@@ -54151,7 +54151,7 @@ class yF {
|
|
|
54151
54151
|
const Zf = M.createFramebuffer(), Xf = M.createFramebuffer();
|
|
54152
54152
|
this.copyTextureToTexture = function(_, L, H = null, Y = null, K = 0, xA = null) {
|
|
54153
54153
|
xA === null && (K !== 0 ? (WI("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."), xA = K, K = 0) : xA = 0);
|
|
54154
|
-
let SA, pA, bA, TA, YA, KA,
|
|
54154
|
+
let SA, pA, bA, TA, YA, KA, oe, Re, ze;
|
|
54155
54155
|
const $e = _.isCompressedTexture ? _.mipmaps[xA] : _.image;
|
|
54156
54156
|
if (H !== null)
|
|
54157
54157
|
SA = H.max.x - H.min.x, pA = H.max.y - H.min.y, bA = H.isBox3 ? H.max.z - H.min.z : 1, TA = H.min.x, YA = H.min.y, KA = H.isBox3 ? H.min.z : 0;
|
|
@@ -54159,7 +54159,7 @@ class yF {
|
|
|
54159
54159
|
const ii = Math.pow(2, -K);
|
|
54160
54160
|
SA = Math.floor($e.width * ii), pA = Math.floor($e.height * ii), _.isDataArrayTexture ? bA = $e.depth : _.isData3DTexture ? bA = Math.floor($e.depth * ii) : bA = 1, TA = 0, YA = 0, KA = 0;
|
|
54161
54161
|
}
|
|
54162
|
-
Y !== null ? (
|
|
54162
|
+
Y !== null ? (oe = Y.x, Re = Y.y, ze = Y.z) : (oe = 0, Re = 0, ze = 0);
|
|
54163
54163
|
const ve = rA.convert(L.format), JA = rA.convert(L.type);
|
|
54164
54164
|
let _e;
|
|
54165
54165
|
L.isData3DTexture ? (F.setTexture3D(L, 0), _e = M.TEXTURE_3D) : L.isDataArrayTexture || L.isCompressedArrayTexture ? (F.setTexture2DArray(L, 0), _e = M.TEXTURE_2D_ARRAY) : (F.setTexture2D(L, 0), _e = M.TEXTURE_2D), M.pixelStorei(M.UNPACK_FLIP_Y_WEBGL, L.flipY), M.pixelStorei(M.UNPACK_PREMULTIPLY_ALPHA_WEBGL, L.premultiplyAlpha), M.pixelStorei(M.UNPACK_ALIGNMENT, L.unpackAlignment);
|
|
@@ -54170,16 +54170,16 @@ class yF {
|
|
|
54170
54170
|
const ii = f.get(_), Rt = f.get(L), Ut = f.get(ii.__renderTarget), pC = f.get(Rt.__renderTarget);
|
|
54171
54171
|
vA.bindFramebuffer(M.READ_FRAMEBUFFER, Ut.__webglFramebuffer), vA.bindFramebuffer(M.DRAW_FRAMEBUFFER, pC.__webglFramebuffer);
|
|
54172
54172
|
for (let co = 0; co < bA; co++)
|
|
54173
|
-
Je && (M.framebufferTextureLayer(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, f.get(_).__webglTexture, K, KA + co), M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, f.get(L).__webglTexture, xA, ze + co)), M.blitFramebuffer(TA, YA, SA, pA,
|
|
54173
|
+
Je && (M.framebufferTextureLayer(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, f.get(_).__webglTexture, K, KA + co), M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, f.get(L).__webglTexture, xA, ze + co)), M.blitFramebuffer(TA, YA, SA, pA, oe, Re, SA, pA, M.DEPTH_BUFFER_BIT, M.NEAREST);
|
|
54174
54174
|
vA.bindFramebuffer(M.READ_FRAMEBUFFER, null), vA.bindFramebuffer(M.DRAW_FRAMEBUFFER, null);
|
|
54175
54175
|
} else if (K !== 0 || _.isRenderTargetTexture || f.has(_)) {
|
|
54176
54176
|
const ii = f.get(_), Rt = f.get(L);
|
|
54177
54177
|
vA.bindFramebuffer(M.READ_FRAMEBUFFER, Zf), vA.bindFramebuffer(M.DRAW_FRAMEBUFFER, Xf);
|
|
54178
54178
|
for (let Ut = 0; Ut < bA; Ut++)
|
|
54179
|
-
Je ? M.framebufferTextureLayer(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, ii.__webglTexture, K, KA + Ut) : M.framebufferTexture2D(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, M.TEXTURE_2D, ii.__webglTexture, K), Lt ? M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, Rt.__webglTexture, xA, ze + Ut) : M.framebufferTexture2D(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, M.TEXTURE_2D, Rt.__webglTexture, xA), K !== 0 ? M.blitFramebuffer(TA, YA, SA, pA,
|
|
54179
|
+
Je ? M.framebufferTextureLayer(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, ii.__webglTexture, K, KA + Ut) : M.framebufferTexture2D(M.READ_FRAMEBUFFER, M.COLOR_ATTACHMENT0, M.TEXTURE_2D, ii.__webglTexture, K), Lt ? M.framebufferTextureLayer(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, Rt.__webglTexture, xA, ze + Ut) : M.framebufferTexture2D(M.DRAW_FRAMEBUFFER, M.COLOR_ATTACHMENT0, M.TEXTURE_2D, Rt.__webglTexture, xA), K !== 0 ? M.blitFramebuffer(TA, YA, SA, pA, oe, Re, SA, pA, M.COLOR_BUFFER_BIT, M.NEAREST) : Lt ? M.copyTexSubImage3D(_e, xA, oe, Re, ze + Ut, TA, YA, SA, pA) : M.copyTexSubImage2D(_e, xA, oe, Re, TA, YA, SA, pA);
|
|
54180
54180
|
vA.bindFramebuffer(M.READ_FRAMEBUFFER, null), vA.bindFramebuffer(M.DRAW_FRAMEBUFFER, null);
|
|
54181
54181
|
} else
|
|
54182
|
-
Lt ? _.isDataTexture || _.isData3DTexture ? M.texSubImage3D(_e, xA,
|
|
54182
|
+
Lt ? _.isDataTexture || _.isData3DTexture ? M.texSubImage3D(_e, xA, oe, Re, ze, SA, pA, bA, ve, JA, $e.data) : L.isCompressedArrayTexture ? M.compressedTexSubImage3D(_e, xA, oe, Re, ze, SA, pA, bA, ve, $e.data) : M.texSubImage3D(_e, xA, oe, Re, ze, SA, pA, bA, ve, JA, $e) : _.isDataTexture ? M.texSubImage2D(M.TEXTURE_2D, xA, oe, Re, SA, pA, ve, JA, $e.data) : _.isCompressedTexture ? M.compressedTexSubImage2D(M.TEXTURE_2D, xA, oe, Re, $e.width, $e.height, ve, $e.data) : M.texSubImage2D(M.TEXTURE_2D, xA, oe, Re, SA, pA, ve, JA, $e);
|
|
54183
54183
|
M.pixelStorei(M.UNPACK_ROW_LENGTH, xe), M.pixelStorei(M.UNPACK_IMAGE_HEIGHT, jt), M.pixelStorei(M.UNPACK_SKIP_PIXELS, Oo), M.pixelStorei(M.UNPACK_SKIP_ROWS, Wt), M.pixelStorei(M.UNPACK_SKIP_IMAGES, Zn), xA === 0 && L.generateMipmaps && M.generateMipmap(_e), vA.unbindTexture();
|
|
54184
54184
|
}, this.initRenderTarget = function(_) {
|
|
54185
54185
|
f.get(_).__webglFramebuffer === void 0 && F.setupRenderTarget(_);
|
|
@@ -54718,11 +54718,11 @@ class QC {
|
|
|
54718
54718
|
uNoiseScale: { value: this.config.noiseScale },
|
|
54719
54719
|
uNoiseSpeed: { value: this.config.noiseSpeed },
|
|
54720
54720
|
uAudioReactivity: { value: this.config.audioReactivity },
|
|
54721
|
-
uColorPrimary: { value: new
|
|
54722
|
-
uColorSecondary: { value: new
|
|
54723
|
-
uColorAccent: { value: new
|
|
54724
|
-
uColorDepth: { value: new
|
|
54725
|
-
uColorHighlight: { value: new
|
|
54721
|
+
uColorPrimary: { value: new Ee(A.primary) },
|
|
54722
|
+
uColorSecondary: { value: new Ee(A.secondary) },
|
|
54723
|
+
uColorAccent: { value: new Ee(A.accent) },
|
|
54724
|
+
uColorDepth: { value: new Ee(A.depth || ko.depth) },
|
|
54725
|
+
uColorHighlight: { value: new Ee(A.highlight || ko.highlight) },
|
|
54726
54726
|
uFresnelPower: { value: this.config.fresnelPower },
|
|
54727
54727
|
uGlowIntensity: { value: this.config.glowIntensity },
|
|
54728
54728
|
uColorContrast: { value: this.config.colorContrast }
|
|
@@ -54743,7 +54743,7 @@ class QC {
|
|
|
54743
54743
|
uniforms: {
|
|
54744
54744
|
uTime: { value: 0 },
|
|
54745
54745
|
uAudioLevel: { value: 0 },
|
|
54746
|
-
uGlowColor: { value: new
|
|
54746
|
+
uGlowColor: { value: new Ee(A.glow) },
|
|
54747
54747
|
uGlowIntensity: { value: this.config.glowIntensity * 0.6 },
|
|
54748
54748
|
uPulseSpeed: { value: 2 }
|
|
54749
54749
|
},
|
|
@@ -55548,7 +55548,7 @@ const Ca = vF(), Lr = {
|
|
|
55548
55548
|
theme: "default",
|
|
55549
55549
|
allow_all_domains: !0,
|
|
55550
55550
|
allowed_domains: []
|
|
55551
|
-
}, Ts = /* @__PURE__ */ new Map(), LF =
|
|
55551
|
+
}, Ts = /* @__PURE__ */ new Map(), LF = 1 * 60 * 1e3;
|
|
55552
55552
|
async function xC(i, A = Ca) {
|
|
55553
55553
|
if (!i)
|
|
55554
55554
|
return console.warn("[hanc-widget] No agentId provided, using default config"), Lr;
|
|
@@ -55850,28 +55850,28 @@ qo.styles = zI`
|
|
|
55850
55850
|
}
|
|
55851
55851
|
`;
|
|
55852
55852
|
ra([
|
|
55853
|
-
|
|
55853
|
+
Z({ type: String, attribute: "privacy-url" })
|
|
55854
55854
|
], qo.prototype, "privacyUrl", 2);
|
|
55855
55855
|
ra([
|
|
55856
|
-
|
|
55856
|
+
Z({ type: String, attribute: "terms-url" })
|
|
55857
55857
|
], qo.prototype, "termsUrl", 2);
|
|
55858
55858
|
ra([
|
|
55859
|
-
|
|
55859
|
+
Z({ type: String, attribute: "terms-content" })
|
|
55860
55860
|
], qo.prototype, "termsContent", 2);
|
|
55861
55861
|
ra([
|
|
55862
|
-
|
|
55862
|
+
Z({ type: String, attribute: "modal-title" })
|
|
55863
55863
|
], qo.prototype, "modalTitle", 2);
|
|
55864
55864
|
qo = ra([
|
|
55865
55865
|
$I("hanc-privacy-modal")
|
|
55866
55866
|
], qo);
|
|
55867
|
-
var JF = Object.defineProperty, YF = Object.getOwnPropertyDescriptor,
|
|
55867
|
+
var JF = Object.defineProperty, YF = Object.getOwnPropertyDescriptor, ae = (i, A, e, t) => {
|
|
55868
55868
|
for (var g = t > 1 ? void 0 : t ? YF(A, e) : A, o = i.length - 1, n; o >= 0; o--)
|
|
55869
55869
|
(n = i[o]) && (g = (t ? n(A, e, g) : n(g)) || g);
|
|
55870
55870
|
return t && g && JF(A, e, g), g;
|
|
55871
55871
|
};
|
|
55872
|
-
let
|
|
55872
|
+
let te = class extends wg {
|
|
55873
55873
|
constructor() {
|
|
55874
|
-
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.apiBaseUrl = Ca, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
55874
|
+
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = Ca, this.buttonStartText = "Try to call", this.buttonConnectingText = "Connecting...", this.size = 370, this.containerPadding = 45, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
55875
55875
|
const e = i.detail;
|
|
55876
55876
|
if (!(!e || !this.audioAnalyzer))
|
|
55877
55877
|
try {
|
|
@@ -55959,6 +55959,18 @@ let oe = class extends wg {
|
|
|
55959
55959
|
), this.callManager.addEventListener("audio-track", this.handleAudioTrack), this.callManager.addEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.loadWidgetConfig();
|
|
55960
55960
|
}
|
|
55961
55961
|
async loadWidgetConfig() {
|
|
55962
|
+
if (this.skipFetch) {
|
|
55963
|
+
this.widgetConfig = {
|
|
55964
|
+
terms_enabled: this.termsEnabled,
|
|
55965
|
+
terms_content: this.termsContent,
|
|
55966
|
+
terms_url: this.termsUrl,
|
|
55967
|
+
privacy_url: this.privacyUrl,
|
|
55968
|
+
theme: this.theme,
|
|
55969
|
+
allow_all_domains: !0,
|
|
55970
|
+
allowed_domains: []
|
|
55971
|
+
};
|
|
55972
|
+
return;
|
|
55973
|
+
}
|
|
55962
55974
|
if (!(!this.agentId || this.configLoading)) {
|
|
55963
55975
|
this.configLoading = !0;
|
|
55964
55976
|
try {
|
|
@@ -55983,7 +55995,7 @@ let oe = class extends wg {
|
|
|
55983
55995
|
}
|
|
55984
55996
|
updated(i) {
|
|
55985
55997
|
var A, e, t;
|
|
55986
|
-
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
55998
|
+
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
55987
55999
|
}
|
|
55988
56000
|
applyTheme() {
|
|
55989
56001
|
if (this.theme) {
|
|
@@ -56357,122 +56369,131 @@ let oe = class extends wg {
|
|
|
56357
56369
|
`;
|
|
56358
56370
|
}
|
|
56359
56371
|
};
|
|
56360
|
-
|
|
56372
|
+
te.styles = zI`
|
|
56361
56373
|
:host {
|
|
56362
56374
|
display: inline-block;
|
|
56363
56375
|
contain: layout style;
|
|
56364
56376
|
}
|
|
56365
56377
|
`;
|
|
56366
|
-
|
|
56367
|
-
|
|
56368
|
-
],
|
|
56369
|
-
|
|
56370
|
-
|
|
56371
|
-
],
|
|
56372
|
-
|
|
56378
|
+
ae([
|
|
56379
|
+
Z({ type: String, attribute: "agent-id" })
|
|
56380
|
+
], te.prototype, "agentId", 2);
|
|
56381
|
+
ae([
|
|
56382
|
+
Z({ type: String, attribute: "voice-service-url" })
|
|
56383
|
+
], te.prototype, "voiceServiceUrl", 2);
|
|
56384
|
+
ae([
|
|
56373
56385
|
Ge()
|
|
56374
|
-
],
|
|
56375
|
-
|
|
56386
|
+
], te.prototype, "callStatus", 2);
|
|
56387
|
+
ae([
|
|
56376
56388
|
Ge()
|
|
56377
|
-
],
|
|
56378
|
-
|
|
56389
|
+
], te.prototype, "microphoneEnabled", 2);
|
|
56390
|
+
ae([
|
|
56379
56391
|
Ge()
|
|
56380
|
-
],
|
|
56381
|
-
|
|
56392
|
+
], te.prototype, "microphoneInitialized", 2);
|
|
56393
|
+
ae([
|
|
56382
56394
|
Ge()
|
|
56383
|
-
],
|
|
56384
|
-
|
|
56395
|
+
], te.prototype, "showPrivacyModal", 2);
|
|
56396
|
+
ae([
|
|
56385
56397
|
Ge()
|
|
56386
|
-
],
|
|
56387
|
-
|
|
56398
|
+
], te.prototype, "widgetConfig", 2);
|
|
56399
|
+
ae([
|
|
56388
56400
|
Ge()
|
|
56389
|
-
],
|
|
56390
|
-
|
|
56401
|
+
], te.prototype, "configLoading", 2);
|
|
56402
|
+
ae([
|
|
56391
56403
|
Ge()
|
|
56392
|
-
],
|
|
56393
|
-
|
|
56394
|
-
|
|
56395
|
-
],
|
|
56396
|
-
|
|
56397
|
-
|
|
56398
|
-
],
|
|
56399
|
-
|
|
56400
|
-
|
|
56401
|
-
],
|
|
56402
|
-
|
|
56403
|
-
|
|
56404
|
-
],
|
|
56405
|
-
|
|
56406
|
-
|
|
56407
|
-
],
|
|
56408
|
-
|
|
56409
|
-
|
|
56410
|
-
],
|
|
56411
|
-
|
|
56412
|
-
|
|
56413
|
-
],
|
|
56414
|
-
|
|
56415
|
-
|
|
56416
|
-
],
|
|
56417
|
-
|
|
56418
|
-
|
|
56419
|
-
],
|
|
56420
|
-
|
|
56421
|
-
|
|
56422
|
-
],
|
|
56423
|
-
|
|
56424
|
-
|
|
56425
|
-
],
|
|
56426
|
-
|
|
56427
|
-
|
|
56428
|
-
],
|
|
56429
|
-
|
|
56430
|
-
|
|
56431
|
-
],
|
|
56432
|
-
|
|
56433
|
-
|
|
56434
|
-
],
|
|
56435
|
-
|
|
56436
|
-
|
|
56437
|
-
],
|
|
56438
|
-
|
|
56439
|
-
|
|
56440
|
-
],
|
|
56441
|
-
|
|
56442
|
-
|
|
56443
|
-
],
|
|
56444
|
-
|
|
56445
|
-
|
|
56446
|
-
],
|
|
56447
|
-
|
|
56448
|
-
|
|
56449
|
-
],
|
|
56450
|
-
|
|
56451
|
-
|
|
56452
|
-
],
|
|
56453
|
-
|
|
56454
|
-
|
|
56455
|
-
],
|
|
56456
|
-
|
|
56457
|
-
|
|
56458
|
-
],
|
|
56459
|
-
|
|
56460
|
-
|
|
56461
|
-
],
|
|
56462
|
-
|
|
56463
|
-
|
|
56464
|
-
],
|
|
56465
|
-
|
|
56404
|
+
], te.prototype, "domainBlocked", 2);
|
|
56405
|
+
ae([
|
|
56406
|
+
Z({ type: String, attribute: "privacy-url" })
|
|
56407
|
+
], te.prototype, "privacyUrl", 2);
|
|
56408
|
+
ae([
|
|
56409
|
+
Z({ type: String, attribute: "terms-url" })
|
|
56410
|
+
], te.prototype, "termsUrl", 2);
|
|
56411
|
+
ae([
|
|
56412
|
+
Z({ type: Boolean, attribute: "terms-enabled" })
|
|
56413
|
+
], te.prototype, "termsEnabled", 2);
|
|
56414
|
+
ae([
|
|
56415
|
+
Z({ type: String, attribute: "terms-content" })
|
|
56416
|
+
], te.prototype, "termsContent", 2);
|
|
56417
|
+
ae([
|
|
56418
|
+
Z({ type: Boolean, attribute: "skip-fetch" })
|
|
56419
|
+
], te.prototype, "skipFetch", 2);
|
|
56420
|
+
ae([
|
|
56421
|
+
Z({ type: String, attribute: "api-base-url" })
|
|
56422
|
+
], te.prototype, "apiBaseUrl", 2);
|
|
56423
|
+
ae([
|
|
56424
|
+
Z({ type: String, attribute: "button-start-text" })
|
|
56425
|
+
], te.prototype, "buttonStartText", 2);
|
|
56426
|
+
ae([
|
|
56427
|
+
Z({ type: String, attribute: "button-connecting-text" })
|
|
56428
|
+
], te.prototype, "buttonConnectingText", 2);
|
|
56429
|
+
ae([
|
|
56430
|
+
Z({ type: Number, attribute: "size" })
|
|
56431
|
+
], te.prototype, "size", 2);
|
|
56432
|
+
ae([
|
|
56433
|
+
Z({ type: Number, attribute: "container-padding" })
|
|
56434
|
+
], te.prototype, "containerPadding", 2);
|
|
56435
|
+
ae([
|
|
56436
|
+
Z({ type: String, attribute: "theme", reflect: !0 })
|
|
56437
|
+
], te.prototype, "theme", 2);
|
|
56438
|
+
ae([
|
|
56439
|
+
Z({ type: String, attribute: "theme-mode" })
|
|
56440
|
+
], te.prototype, "themeMode", 2);
|
|
56441
|
+
ae([
|
|
56442
|
+
Z({ type: Object, attribute: "orb-colors" })
|
|
56443
|
+
], te.prototype, "orbColors", 2);
|
|
56444
|
+
ae([
|
|
56445
|
+
Z({ type: Number, attribute: "glow-intensity" })
|
|
56446
|
+
], te.prototype, "glowIntensity", 2);
|
|
56447
|
+
ae([
|
|
56448
|
+
Z({ type: Number, attribute: "idle-glow-multiplier" })
|
|
56449
|
+
], te.prototype, "idleGlowMultiplier", 2);
|
|
56450
|
+
ae([
|
|
56451
|
+
Z({ type: Number, attribute: "morph-strength" })
|
|
56452
|
+
], te.prototype, "morphStrength", 2);
|
|
56453
|
+
ae([
|
|
56454
|
+
Z({ type: Number, attribute: "noise-scale" })
|
|
56455
|
+
], te.prototype, "noiseScale", 2);
|
|
56456
|
+
ae([
|
|
56457
|
+
Z({ type: Number, attribute: "noise-speed" })
|
|
56458
|
+
], te.prototype, "noiseSpeed", 2);
|
|
56459
|
+
ae([
|
|
56460
|
+
Z({ type: Number, attribute: "fresnel-power" })
|
|
56461
|
+
], te.prototype, "fresnelPower", 2);
|
|
56462
|
+
ae([
|
|
56463
|
+
Z({ type: Number, attribute: "rotation-speed" })
|
|
56464
|
+
], te.prototype, "rotationSpeed", 2);
|
|
56465
|
+
ae([
|
|
56466
|
+
Z({ type: Number, attribute: "audio-reactivity" })
|
|
56467
|
+
], te.prototype, "audioReactivity", 2);
|
|
56468
|
+
ae([
|
|
56469
|
+
Z({ type: Number, attribute: "audio-smoothing" })
|
|
56470
|
+
], te.prototype, "audioSmoothing", 2);
|
|
56471
|
+
ae([
|
|
56472
|
+
Z({ type: Number, attribute: "idle-morph-multiplier" })
|
|
56473
|
+
], te.prototype, "idleMorphMultiplier", 2);
|
|
56474
|
+
ae([
|
|
56475
|
+
Z({ type: Number, attribute: "color-contrast" })
|
|
56476
|
+
], te.prototype, "colorContrast", 2);
|
|
56477
|
+
ae([
|
|
56478
|
+
Z({ type: Boolean, attribute: "sound-enabled" })
|
|
56479
|
+
], te.prototype, "soundEnabled", 2);
|
|
56480
|
+
ae([
|
|
56481
|
+
Z({ type: Number, attribute: "sound-volume" })
|
|
56482
|
+
], te.prototype, "soundVolume", 2);
|
|
56483
|
+
ae([
|
|
56484
|
+
Z({ type: String, attribute: "sound-preset" })
|
|
56485
|
+
], te.prototype, "soundPreset", 2);
|
|
56486
|
+
te = ae([
|
|
56466
56487
|
$I("hanc-ai-inline-call")
|
|
56467
|
-
],
|
|
56468
|
-
var qF = Object.defineProperty, HF = Object.getOwnPropertyDescriptor,
|
|
56488
|
+
], te);
|
|
56489
|
+
var qF = Object.defineProperty, HF = Object.getOwnPropertyDescriptor, se = (i, A, e, t) => {
|
|
56469
56490
|
for (var g = t > 1 ? void 0 : t ? HF(A, e) : A, o = i.length - 1, n; o >= 0; o--)
|
|
56470
56491
|
(n = i[o]) && (g = (t ? n(A, e, g) : n(g)) || g);
|
|
56471
56492
|
return t && g && qF(A, e, g), g;
|
|
56472
56493
|
};
|
|
56473
|
-
let
|
|
56494
|
+
let ie = class extends wg {
|
|
56474
56495
|
constructor() {
|
|
56475
|
-
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.apiBaseUrl = Ca, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
56496
|
+
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = Ca, this.buttonStartText = "Call", this.buttonConnectingText = "Connecting...", this.position = "bottom-right", this.size = 120, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
56476
56497
|
const e = i.detail;
|
|
56477
56498
|
if (!(!e || !this.audioAnalyzer))
|
|
56478
56499
|
try {
|
|
@@ -56560,6 +56581,18 @@ let ne = class extends wg {
|
|
|
56560
56581
|
), this.callManager.addEventListener("audio-track", this.handleAudioTrack), this.callManager.addEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.loadWidgetConfig();
|
|
56561
56582
|
}
|
|
56562
56583
|
async loadWidgetConfig() {
|
|
56584
|
+
if (this.skipFetch) {
|
|
56585
|
+
this.widgetConfig = {
|
|
56586
|
+
terms_enabled: this.termsEnabled,
|
|
56587
|
+
terms_content: this.termsContent,
|
|
56588
|
+
terms_url: this.termsUrl,
|
|
56589
|
+
privacy_url: this.privacyUrl,
|
|
56590
|
+
theme: this.theme,
|
|
56591
|
+
allow_all_domains: !0,
|
|
56592
|
+
allowed_domains: []
|
|
56593
|
+
};
|
|
56594
|
+
return;
|
|
56595
|
+
}
|
|
56563
56596
|
if (!(!this.agentId || this.configLoading)) {
|
|
56564
56597
|
this.configLoading = !0;
|
|
56565
56598
|
try {
|
|
@@ -56584,7 +56617,7 @@ let ne = class extends wg {
|
|
|
56584
56617
|
}
|
|
56585
56618
|
updated(i) {
|
|
56586
56619
|
var A, e, t;
|
|
56587
|
-
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
56620
|
+
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
56588
56621
|
}
|
|
56589
56622
|
applyTheme() {
|
|
56590
56623
|
if (this.theme) {
|
|
@@ -56947,121 +56980,130 @@ let ne = class extends wg {
|
|
|
56947
56980
|
`;
|
|
56948
56981
|
}
|
|
56949
56982
|
};
|
|
56950
|
-
|
|
56983
|
+
ie.styles = zI`
|
|
56951
56984
|
:host {
|
|
56952
56985
|
display: block;
|
|
56953
56986
|
}
|
|
56954
56987
|
`;
|
|
56955
|
-
|
|
56956
|
-
|
|
56957
|
-
],
|
|
56958
|
-
|
|
56959
|
-
|
|
56960
|
-
],
|
|
56961
|
-
|
|
56988
|
+
se([
|
|
56989
|
+
Z({ type: String, attribute: "agent-id" })
|
|
56990
|
+
], ie.prototype, "agentId", 2);
|
|
56991
|
+
se([
|
|
56992
|
+
Z({ type: String, attribute: "voice-service-url" })
|
|
56993
|
+
], ie.prototype, "voiceServiceUrl", 2);
|
|
56994
|
+
se([
|
|
56962
56995
|
Ge()
|
|
56963
|
-
],
|
|
56964
|
-
|
|
56996
|
+
], ie.prototype, "callStatus", 2);
|
|
56997
|
+
se([
|
|
56965
56998
|
Ge()
|
|
56966
|
-
],
|
|
56967
|
-
|
|
56999
|
+
], ie.prototype, "microphoneEnabled", 2);
|
|
57000
|
+
se([
|
|
56968
57001
|
Ge()
|
|
56969
|
-
],
|
|
56970
|
-
|
|
57002
|
+
], ie.prototype, "microphoneInitialized", 2);
|
|
57003
|
+
se([
|
|
56971
57004
|
Ge()
|
|
56972
|
-
],
|
|
56973
|
-
|
|
57005
|
+
], ie.prototype, "showPrivacyModal", 2);
|
|
57006
|
+
se([
|
|
56974
57007
|
Ge()
|
|
56975
|
-
],
|
|
56976
|
-
|
|
57008
|
+
], ie.prototype, "widgetConfig", 2);
|
|
57009
|
+
se([
|
|
56977
57010
|
Ge()
|
|
56978
|
-
],
|
|
56979
|
-
|
|
57011
|
+
], ie.prototype, "configLoading", 2);
|
|
57012
|
+
se([
|
|
56980
57013
|
Ge()
|
|
56981
|
-
],
|
|
56982
|
-
|
|
56983
|
-
|
|
56984
|
-
],
|
|
56985
|
-
|
|
56986
|
-
|
|
56987
|
-
],
|
|
56988
|
-
|
|
56989
|
-
|
|
56990
|
-
],
|
|
56991
|
-
|
|
56992
|
-
|
|
56993
|
-
],
|
|
56994
|
-
|
|
56995
|
-
|
|
56996
|
-
],
|
|
56997
|
-
|
|
56998
|
-
|
|
56999
|
-
],
|
|
57000
|
-
|
|
57001
|
-
|
|
57002
|
-
],
|
|
57003
|
-
|
|
57004
|
-
|
|
57005
|
-
],
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
],
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
],
|
|
57012
|
-
|
|
57013
|
-
|
|
57014
|
-
],
|
|
57015
|
-
|
|
57016
|
-
|
|
57017
|
-
],
|
|
57018
|
-
|
|
57019
|
-
|
|
57020
|
-
],
|
|
57021
|
-
|
|
57022
|
-
|
|
57023
|
-
],
|
|
57024
|
-
|
|
57025
|
-
|
|
57026
|
-
],
|
|
57027
|
-
|
|
57028
|
-
|
|
57029
|
-
],
|
|
57030
|
-
|
|
57031
|
-
|
|
57032
|
-
],
|
|
57033
|
-
|
|
57034
|
-
|
|
57035
|
-
],
|
|
57036
|
-
|
|
57037
|
-
|
|
57038
|
-
],
|
|
57039
|
-
|
|
57040
|
-
|
|
57041
|
-
],
|
|
57042
|
-
|
|
57043
|
-
|
|
57044
|
-
],
|
|
57045
|
-
|
|
57046
|
-
|
|
57047
|
-
],
|
|
57048
|
-
|
|
57049
|
-
|
|
57050
|
-
],
|
|
57051
|
-
|
|
57052
|
-
|
|
57053
|
-
],
|
|
57054
|
-
|
|
57014
|
+
], ie.prototype, "domainBlocked", 2);
|
|
57015
|
+
se([
|
|
57016
|
+
Z({ type: String, attribute: "privacy-url" })
|
|
57017
|
+
], ie.prototype, "privacyUrl", 2);
|
|
57018
|
+
se([
|
|
57019
|
+
Z({ type: String, attribute: "terms-url" })
|
|
57020
|
+
], ie.prototype, "termsUrl", 2);
|
|
57021
|
+
se([
|
|
57022
|
+
Z({ type: Boolean, attribute: "terms-enabled" })
|
|
57023
|
+
], ie.prototype, "termsEnabled", 2);
|
|
57024
|
+
se([
|
|
57025
|
+
Z({ type: String, attribute: "terms-content" })
|
|
57026
|
+
], ie.prototype, "termsContent", 2);
|
|
57027
|
+
se([
|
|
57028
|
+
Z({ type: Boolean, attribute: "skip-fetch" })
|
|
57029
|
+
], ie.prototype, "skipFetch", 2);
|
|
57030
|
+
se([
|
|
57031
|
+
Z({ type: String, attribute: "api-base-url" })
|
|
57032
|
+
], ie.prototype, "apiBaseUrl", 2);
|
|
57033
|
+
se([
|
|
57034
|
+
Z({ type: String, attribute: "button-start-text" })
|
|
57035
|
+
], ie.prototype, "buttonStartText", 2);
|
|
57036
|
+
se([
|
|
57037
|
+
Z({ type: String, attribute: "button-connecting-text" })
|
|
57038
|
+
], ie.prototype, "buttonConnectingText", 2);
|
|
57039
|
+
se([
|
|
57040
|
+
Z({ type: String, attribute: "position" })
|
|
57041
|
+
], ie.prototype, "position", 2);
|
|
57042
|
+
se([
|
|
57043
|
+
Z({ type: Number, attribute: "size" })
|
|
57044
|
+
], ie.prototype, "size", 2);
|
|
57045
|
+
se([
|
|
57046
|
+
Z({ type: String, attribute: "theme" })
|
|
57047
|
+
], ie.prototype, "theme", 2);
|
|
57048
|
+
se([
|
|
57049
|
+
Z({ type: String, attribute: "theme-mode" })
|
|
57050
|
+
], ie.prototype, "themeMode", 2);
|
|
57051
|
+
se([
|
|
57052
|
+
Z({ type: Object, attribute: "orb-colors" })
|
|
57053
|
+
], ie.prototype, "orbColors", 2);
|
|
57054
|
+
se([
|
|
57055
|
+
Z({ type: Number, attribute: "glow-intensity" })
|
|
57056
|
+
], ie.prototype, "glowIntensity", 2);
|
|
57057
|
+
se([
|
|
57058
|
+
Z({ type: Number, attribute: "idle-glow-multiplier" })
|
|
57059
|
+
], ie.prototype, "idleGlowMultiplier", 2);
|
|
57060
|
+
se([
|
|
57061
|
+
Z({ type: Number, attribute: "morph-strength" })
|
|
57062
|
+
], ie.prototype, "morphStrength", 2);
|
|
57063
|
+
se([
|
|
57064
|
+
Z({ type: Number, attribute: "noise-scale" })
|
|
57065
|
+
], ie.prototype, "noiseScale", 2);
|
|
57066
|
+
se([
|
|
57067
|
+
Z({ type: Number, attribute: "noise-speed" })
|
|
57068
|
+
], ie.prototype, "noiseSpeed", 2);
|
|
57069
|
+
se([
|
|
57070
|
+
Z({ type: Number, attribute: "fresnel-power" })
|
|
57071
|
+
], ie.prototype, "fresnelPower", 2);
|
|
57072
|
+
se([
|
|
57073
|
+
Z({ type: Number, attribute: "rotation-speed" })
|
|
57074
|
+
], ie.prototype, "rotationSpeed", 2);
|
|
57075
|
+
se([
|
|
57076
|
+
Z({ type: Number, attribute: "audio-reactivity" })
|
|
57077
|
+
], ie.prototype, "audioReactivity", 2);
|
|
57078
|
+
se([
|
|
57079
|
+
Z({ type: Number, attribute: "audio-smoothing" })
|
|
57080
|
+
], ie.prototype, "audioSmoothing", 2);
|
|
57081
|
+
se([
|
|
57082
|
+
Z({ type: Number, attribute: "idle-morph-multiplier" })
|
|
57083
|
+
], ie.prototype, "idleMorphMultiplier", 2);
|
|
57084
|
+
se([
|
|
57085
|
+
Z({ type: Number, attribute: "color-contrast" })
|
|
57086
|
+
], ie.prototype, "colorContrast", 2);
|
|
57087
|
+
se([
|
|
57088
|
+
Z({ type: Boolean, attribute: "sound-enabled" })
|
|
57089
|
+
], ie.prototype, "soundEnabled", 2);
|
|
57090
|
+
se([
|
|
57091
|
+
Z({ type: Number, attribute: "sound-volume" })
|
|
57092
|
+
], ie.prototype, "soundVolume", 2);
|
|
57093
|
+
se([
|
|
57094
|
+
Z({ type: String, attribute: "sound-preset" })
|
|
57095
|
+
], ie.prototype, "soundPreset", 2);
|
|
57096
|
+
ie = se([
|
|
57055
57097
|
$I("hanc-ai-floating-call")
|
|
57056
|
-
],
|
|
57057
|
-
var PF = Object.defineProperty, OF = Object.getOwnPropertyDescriptor,
|
|
57098
|
+
], ie);
|
|
57099
|
+
var PF = Object.defineProperty, OF = Object.getOwnPropertyDescriptor, Ce = (i, A, e, t) => {
|
|
57058
57100
|
for (var g = t > 1 ? void 0 : t ? OF(A, e) : A, o = i.length - 1, n; o >= 0; o--)
|
|
57059
57101
|
(n = i[o]) && (g = (t ? n(A, e, g) : n(g)) || g);
|
|
57060
57102
|
return t && g && PF(A, e, g), g;
|
|
57061
57103
|
};
|
|
57062
|
-
let
|
|
57104
|
+
let ge = class extends wg {
|
|
57063
57105
|
constructor() {
|
|
57064
|
-
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.apiBaseUrl = Ca, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
57106
|
+
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = Ca, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
57065
57107
|
const e = i.detail;
|
|
57066
57108
|
if (!(!e || !this.audioAnalyzer))
|
|
57067
57109
|
try {
|
|
@@ -57149,6 +57191,18 @@ let Ie = class extends wg {
|
|
|
57149
57191
|
), this.callManager.addEventListener("audio-track", this.handleAudioTrack), this.callManager.addEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.loadWidgetConfig();
|
|
57150
57192
|
}
|
|
57151
57193
|
async loadWidgetConfig() {
|
|
57194
|
+
if (this.skipFetch) {
|
|
57195
|
+
this.widgetConfig = {
|
|
57196
|
+
terms_enabled: this.termsEnabled,
|
|
57197
|
+
terms_content: this.termsContent,
|
|
57198
|
+
terms_url: this.termsUrl,
|
|
57199
|
+
privacy_url: this.privacyUrl,
|
|
57200
|
+
theme: this.theme,
|
|
57201
|
+
allow_all_domains: !0,
|
|
57202
|
+
allowed_domains: []
|
|
57203
|
+
};
|
|
57204
|
+
return;
|
|
57205
|
+
}
|
|
57152
57206
|
if (!(!this.agentId || this.configLoading)) {
|
|
57153
57207
|
this.configLoading = !0;
|
|
57154
57208
|
try {
|
|
@@ -57182,7 +57236,7 @@ let Ie = class extends wg {
|
|
|
57182
57236
|
}
|
|
57183
57237
|
updated(i) {
|
|
57184
57238
|
var A, e, t;
|
|
57185
|
-
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
57239
|
+
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
57186
57240
|
}
|
|
57187
57241
|
applyTheme() {
|
|
57188
57242
|
if (this.theme) {
|
|
@@ -57478,122 +57532,131 @@ let Ie = class extends wg {
|
|
|
57478
57532
|
`;
|
|
57479
57533
|
}
|
|
57480
57534
|
};
|
|
57481
|
-
|
|
57535
|
+
ge.styles = zI`
|
|
57482
57536
|
:host {
|
|
57483
57537
|
display: inline-block;
|
|
57484
57538
|
contain: layout style;
|
|
57485
57539
|
}
|
|
57486
57540
|
`;
|
|
57487
|
-
|
|
57488
|
-
|
|
57489
|
-
],
|
|
57490
|
-
|
|
57491
|
-
|
|
57492
|
-
],
|
|
57493
|
-
|
|
57541
|
+
Ce([
|
|
57542
|
+
Z({ type: String, attribute: "agent-id" })
|
|
57543
|
+
], ge.prototype, "agentId", 2);
|
|
57544
|
+
Ce([
|
|
57545
|
+
Z({ type: String, attribute: "voice-service-url" })
|
|
57546
|
+
], ge.prototype, "voiceServiceUrl", 2);
|
|
57547
|
+
Ce([
|
|
57494
57548
|
Ge()
|
|
57495
|
-
],
|
|
57496
|
-
|
|
57549
|
+
], ge.prototype, "callStatus", 2);
|
|
57550
|
+
Ce([
|
|
57497
57551
|
Ge()
|
|
57498
|
-
],
|
|
57499
|
-
|
|
57552
|
+
], ge.prototype, "microphoneEnabled", 2);
|
|
57553
|
+
Ce([
|
|
57500
57554
|
Ge()
|
|
57501
|
-
],
|
|
57502
|
-
|
|
57555
|
+
], ge.prototype, "microphoneInitialized", 2);
|
|
57556
|
+
Ce([
|
|
57503
57557
|
Ge()
|
|
57504
|
-
],
|
|
57505
|
-
|
|
57558
|
+
], ge.prototype, "showPrivacyModal", 2);
|
|
57559
|
+
Ce([
|
|
57506
57560
|
Ge()
|
|
57507
|
-
],
|
|
57508
|
-
|
|
57561
|
+
], ge.prototype, "widgetConfig", 2);
|
|
57562
|
+
Ce([
|
|
57509
57563
|
Ge()
|
|
57510
|
-
],
|
|
57511
|
-
|
|
57564
|
+
], ge.prototype, "configLoading", 2);
|
|
57565
|
+
Ce([
|
|
57512
57566
|
Ge()
|
|
57513
|
-
],
|
|
57514
|
-
|
|
57515
|
-
|
|
57516
|
-
],
|
|
57517
|
-
|
|
57518
|
-
|
|
57519
|
-
],
|
|
57520
|
-
|
|
57521
|
-
|
|
57522
|
-
],
|
|
57523
|
-
|
|
57524
|
-
|
|
57525
|
-
],
|
|
57526
|
-
|
|
57527
|
-
|
|
57528
|
-
],
|
|
57529
|
-
|
|
57530
|
-
|
|
57531
|
-
],
|
|
57532
|
-
|
|
57533
|
-
|
|
57534
|
-
],
|
|
57535
|
-
|
|
57536
|
-
|
|
57537
|
-
],
|
|
57538
|
-
|
|
57539
|
-
|
|
57540
|
-
],
|
|
57541
|
-
|
|
57542
|
-
|
|
57543
|
-
],
|
|
57544
|
-
|
|
57545
|
-
|
|
57546
|
-
],
|
|
57547
|
-
|
|
57548
|
-
|
|
57549
|
-
],
|
|
57550
|
-
|
|
57551
|
-
|
|
57552
|
-
],
|
|
57553
|
-
|
|
57554
|
-
|
|
57555
|
-
],
|
|
57556
|
-
|
|
57557
|
-
|
|
57558
|
-
],
|
|
57559
|
-
|
|
57560
|
-
|
|
57561
|
-
],
|
|
57562
|
-
|
|
57563
|
-
|
|
57564
|
-
],
|
|
57565
|
-
|
|
57566
|
-
|
|
57567
|
-
],
|
|
57568
|
-
|
|
57569
|
-
|
|
57570
|
-
],
|
|
57571
|
-
|
|
57572
|
-
|
|
57573
|
-
],
|
|
57574
|
-
|
|
57575
|
-
|
|
57576
|
-
],
|
|
57577
|
-
|
|
57578
|
-
|
|
57579
|
-
],
|
|
57580
|
-
|
|
57581
|
-
|
|
57582
|
-
],
|
|
57583
|
-
|
|
57584
|
-
|
|
57585
|
-
],
|
|
57586
|
-
|
|
57567
|
+
], ge.prototype, "domainBlocked", 2);
|
|
57568
|
+
Ce([
|
|
57569
|
+
Z({ type: String, attribute: "privacy-url" })
|
|
57570
|
+
], ge.prototype, "privacyUrl", 2);
|
|
57571
|
+
Ce([
|
|
57572
|
+
Z({ type: String, attribute: "terms-url" })
|
|
57573
|
+
], ge.prototype, "termsUrl", 2);
|
|
57574
|
+
Ce([
|
|
57575
|
+
Z({ type: Boolean, attribute: "terms-enabled" })
|
|
57576
|
+
], ge.prototype, "termsEnabled", 2);
|
|
57577
|
+
Ce([
|
|
57578
|
+
Z({ type: String, attribute: "terms-content" })
|
|
57579
|
+
], ge.prototype, "termsContent", 2);
|
|
57580
|
+
Ce([
|
|
57581
|
+
Z({ type: Boolean, attribute: "skip-fetch" })
|
|
57582
|
+
], ge.prototype, "skipFetch", 2);
|
|
57583
|
+
Ce([
|
|
57584
|
+
Z({ type: String, attribute: "api-base-url" })
|
|
57585
|
+
], ge.prototype, "apiBaseUrl", 2);
|
|
57586
|
+
Ce([
|
|
57587
|
+
Z({ type: String, attribute: "button-start-text" })
|
|
57588
|
+
], ge.prototype, "buttonStartText", 2);
|
|
57589
|
+
Ce([
|
|
57590
|
+
Z({ type: String, attribute: "button-connecting-text" })
|
|
57591
|
+
], ge.prototype, "buttonConnectingText", 2);
|
|
57592
|
+
Ce([
|
|
57593
|
+
Z({ type: String, attribute: "button-end-text" })
|
|
57594
|
+
], ge.prototype, "buttonEndText", 2);
|
|
57595
|
+
Ce([
|
|
57596
|
+
Z({ type: Number, attribute: "orb-size" })
|
|
57597
|
+
], ge.prototype, "orbSize", 2);
|
|
57598
|
+
Ce([
|
|
57599
|
+
Z({ type: String, attribute: "theme" })
|
|
57600
|
+
], ge.prototype, "theme", 2);
|
|
57601
|
+
Ce([
|
|
57602
|
+
Z({ type: String, attribute: "theme-mode" })
|
|
57603
|
+
], ge.prototype, "themeMode", 2);
|
|
57604
|
+
Ce([
|
|
57605
|
+
Z({ type: Object, attribute: "orb-colors" })
|
|
57606
|
+
], ge.prototype, "orbColors", 2);
|
|
57607
|
+
Ce([
|
|
57608
|
+
Z({ type: Number, attribute: "glow-intensity" })
|
|
57609
|
+
], ge.prototype, "glowIntensity", 2);
|
|
57610
|
+
Ce([
|
|
57611
|
+
Z({ type: Number, attribute: "idle-glow-multiplier" })
|
|
57612
|
+
], ge.prototype, "idleGlowMultiplier", 2);
|
|
57613
|
+
Ce([
|
|
57614
|
+
Z({ type: Number, attribute: "morph-strength" })
|
|
57615
|
+
], ge.prototype, "morphStrength", 2);
|
|
57616
|
+
Ce([
|
|
57617
|
+
Z({ type: Number, attribute: "noise-scale" })
|
|
57618
|
+
], ge.prototype, "noiseScale", 2);
|
|
57619
|
+
Ce([
|
|
57620
|
+
Z({ type: Number, attribute: "noise-speed" })
|
|
57621
|
+
], ge.prototype, "noiseSpeed", 2);
|
|
57622
|
+
Ce([
|
|
57623
|
+
Z({ type: Number, attribute: "fresnel-power" })
|
|
57624
|
+
], ge.prototype, "fresnelPower", 2);
|
|
57625
|
+
Ce([
|
|
57626
|
+
Z({ type: Number, attribute: "rotation-speed" })
|
|
57627
|
+
], ge.prototype, "rotationSpeed", 2);
|
|
57628
|
+
Ce([
|
|
57629
|
+
Z({ type: Number, attribute: "audio-reactivity" })
|
|
57630
|
+
], ge.prototype, "audioReactivity", 2);
|
|
57631
|
+
Ce([
|
|
57632
|
+
Z({ type: Number, attribute: "audio-smoothing" })
|
|
57633
|
+
], ge.prototype, "audioSmoothing", 2);
|
|
57634
|
+
Ce([
|
|
57635
|
+
Z({ type: Number, attribute: "idle-morph-multiplier" })
|
|
57636
|
+
], ge.prototype, "idleMorphMultiplier", 2);
|
|
57637
|
+
Ce([
|
|
57638
|
+
Z({ type: Number, attribute: "color-contrast" })
|
|
57639
|
+
], ge.prototype, "colorContrast", 2);
|
|
57640
|
+
Ce([
|
|
57641
|
+
Z({ type: Boolean, attribute: "sound-enabled" })
|
|
57642
|
+
], ge.prototype, "soundEnabled", 2);
|
|
57643
|
+
Ce([
|
|
57644
|
+
Z({ type: Number, attribute: "sound-volume" })
|
|
57645
|
+
], ge.prototype, "soundVolume", 2);
|
|
57646
|
+
Ce([
|
|
57647
|
+
Z({ type: String, attribute: "sound-preset" })
|
|
57648
|
+
], ge.prototype, "soundPreset", 2);
|
|
57649
|
+
ge = Ce([
|
|
57587
57650
|
$I("hanc-ai-pill-call")
|
|
57588
|
-
],
|
|
57589
|
-
var VF = Object.defineProperty, jF = Object.getOwnPropertyDescriptor,
|
|
57651
|
+
], ge);
|
|
57652
|
+
var VF = Object.defineProperty, jF = Object.getOwnPropertyDescriptor, ne = (i, A, e, t) => {
|
|
57590
57653
|
for (var g = t > 1 ? void 0 : t ? jF(A, e) : A, o = i.length - 1, n; o >= 0; o--)
|
|
57591
57654
|
(n = i[o]) && (g = (t ? n(A, e, g) : n(g)) || g);
|
|
57592
57655
|
return t && g && VF(A, e, g), g;
|
|
57593
57656
|
};
|
|
57594
|
-
let
|
|
57657
|
+
let zA = class extends wg {
|
|
57595
57658
|
constructor() {
|
|
57596
|
-
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.apiBaseUrl = Ca, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.position = "bottom-right", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
57659
|
+
super(...arguments), this.callManager = new nC(), this.orbRenderer = null, this.audioAnalyzer = null, this.soundManager = null, this.orbContainerRef = Js(), this.animationId = null, this.user_identity = lC(), this.callStatus = "idle", this.microphoneEnabled = !1, this.microphoneInitialized = !1, this.showPrivacyModal = !1, this.widgetConfig = null, this.configLoading = !1, this.domainBlocked = !1, this.privacyUrl = "https://hanc.ai/privacy", this.termsUrl = "https://hanc.ai/terms", this.termsEnabled = !1, this.termsContent = "", this.skipFetch = !1, this.apiBaseUrl = Ca, this.buttonStartText = "Talk to AI Agent", this.buttonConnectingText = "Connecting...", this.buttonEndText = "End call", this.position = "bottom-right", this.orbSize = 48, this.theme = "default", this.themeMode = "auto", this.orbColors = {}, this.glowIntensity = 0.8, this.idleGlowMultiplier = 0.4, this.morphStrength = 1, this.noiseScale = 1.5, this.noiseSpeed = 0.3, this.fresnelPower = 2.5, this.rotationSpeed = 0.1, this.audioReactivity = 3, this.audioSmoothing = 0.9, this.idleMorphMultiplier = 0.25, this.colorContrast = 1.5, this.soundEnabled = !0, this.soundVolume = 0.25, this.soundPreset = "1", this.handleAudioTrack = async (i) => {
|
|
57597
57660
|
const e = i.detail;
|
|
57598
57661
|
if (!(!e || !this.audioAnalyzer))
|
|
57599
57662
|
try {
|
|
@@ -57681,6 +57744,18 @@ let ie = class extends wg {
|
|
|
57681
57744
|
), this.callManager.addEventListener("audio-track", this.handleAudioTrack), this.callManager.addEventListener("local-audio-track", this.handleLocalAudioTrack), this.callManager.addEventListener("microphone-enabled", this.handleMicrophoneEnabled), this.callManager.addEventListener("microphone-disabled", this.handleMicrophoneDisabled), this.loadWidgetConfig();
|
|
57682
57745
|
}
|
|
57683
57746
|
async loadWidgetConfig() {
|
|
57747
|
+
if (this.skipFetch) {
|
|
57748
|
+
this.widgetConfig = {
|
|
57749
|
+
terms_enabled: this.termsEnabled,
|
|
57750
|
+
terms_content: this.termsContent,
|
|
57751
|
+
terms_url: this.termsUrl,
|
|
57752
|
+
privacy_url: this.privacyUrl,
|
|
57753
|
+
theme: this.theme,
|
|
57754
|
+
allow_all_domains: !0,
|
|
57755
|
+
allowed_domains: []
|
|
57756
|
+
};
|
|
57757
|
+
return;
|
|
57758
|
+
}
|
|
57684
57759
|
if (!(!this.agentId || this.configLoading)) {
|
|
57685
57760
|
this.configLoading = !0;
|
|
57686
57761
|
try {
|
|
@@ -57705,7 +57780,7 @@ let ie = class extends wg {
|
|
|
57705
57780
|
}
|
|
57706
57781
|
updated(i) {
|
|
57707
57782
|
var A, e, t;
|
|
57708
|
-
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
57783
|
+
super.updated(i), i.has("agentId") && (this.callManager.hangUp(), this.callStatus = "idle", this.widgetConfig = null, this.domainBlocked = !1, this.loadWidgetConfig()), i.has("apiBaseUrl") && this.agentId && this.loadWidgetConfig(), this.skipFetch && (i.has("termsEnabled") || i.has("termsContent") || i.has("termsUrl") || i.has("privacyUrl") || i.has("theme")) && this.loadWidgetConfig(), i.has("voiceServiceUrl") && this.voiceServiceUrl && (this.callManager.serviceUrl = this.voiceServiceUrl), (i.has("theme") || i.has("themeMode")) && this.applyTheme(), i.has("soundEnabled") && ((A = this.soundManager) == null || A.setEnabled(this.soundEnabled)), i.has("soundVolume") && ((e = this.soundManager) == null || e.setVolume(this.soundVolume)), i.has("soundPreset") && ((t = this.soundManager) == null || t.setPreset(this.soundPreset));
|
|
57709
57784
|
}
|
|
57710
57785
|
applyTheme() {
|
|
57711
57786
|
if (this.theme) {
|
|
@@ -58005,121 +58080,130 @@ let ie = class extends wg {
|
|
|
58005
58080
|
`;
|
|
58006
58081
|
}
|
|
58007
58082
|
};
|
|
58008
|
-
|
|
58083
|
+
zA.styles = zI`
|
|
58009
58084
|
:host {
|
|
58010
58085
|
display: block;
|
|
58011
58086
|
}
|
|
58012
58087
|
`;
|
|
58013
|
-
|
|
58014
|
-
|
|
58015
|
-
],
|
|
58016
|
-
|
|
58017
|
-
|
|
58018
|
-
],
|
|
58019
|
-
|
|
58088
|
+
ne([
|
|
58089
|
+
Z({ type: String, attribute: "agent-id" })
|
|
58090
|
+
], zA.prototype, "agentId", 2);
|
|
58091
|
+
ne([
|
|
58092
|
+
Z({ type: String, attribute: "voice-service-url" })
|
|
58093
|
+
], zA.prototype, "voiceServiceUrl", 2);
|
|
58094
|
+
ne([
|
|
58020
58095
|
Ge()
|
|
58021
|
-
],
|
|
58022
|
-
|
|
58096
|
+
], zA.prototype, "callStatus", 2);
|
|
58097
|
+
ne([
|
|
58023
58098
|
Ge()
|
|
58024
|
-
],
|
|
58025
|
-
|
|
58099
|
+
], zA.prototype, "microphoneEnabled", 2);
|
|
58100
|
+
ne([
|
|
58026
58101
|
Ge()
|
|
58027
|
-
],
|
|
58028
|
-
|
|
58102
|
+
], zA.prototype, "microphoneInitialized", 2);
|
|
58103
|
+
ne([
|
|
58029
58104
|
Ge()
|
|
58030
|
-
],
|
|
58031
|
-
|
|
58105
|
+
], zA.prototype, "showPrivacyModal", 2);
|
|
58106
|
+
ne([
|
|
58032
58107
|
Ge()
|
|
58033
|
-
],
|
|
58034
|
-
|
|
58108
|
+
], zA.prototype, "widgetConfig", 2);
|
|
58109
|
+
ne([
|
|
58035
58110
|
Ge()
|
|
58036
|
-
],
|
|
58037
|
-
|
|
58111
|
+
], zA.prototype, "configLoading", 2);
|
|
58112
|
+
ne([
|
|
58038
58113
|
Ge()
|
|
58039
|
-
],
|
|
58040
|
-
|
|
58041
|
-
|
|
58042
|
-
],
|
|
58043
|
-
|
|
58044
|
-
|
|
58045
|
-
],
|
|
58046
|
-
|
|
58047
|
-
|
|
58048
|
-
],
|
|
58049
|
-
|
|
58050
|
-
|
|
58051
|
-
],
|
|
58052
|
-
|
|
58053
|
-
|
|
58054
|
-
],
|
|
58055
|
-
|
|
58056
|
-
|
|
58057
|
-
],
|
|
58058
|
-
|
|
58059
|
-
|
|
58060
|
-
],
|
|
58061
|
-
|
|
58062
|
-
|
|
58063
|
-
],
|
|
58064
|
-
|
|
58065
|
-
|
|
58066
|
-
],
|
|
58067
|
-
|
|
58068
|
-
|
|
58069
|
-
],
|
|
58070
|
-
|
|
58071
|
-
|
|
58072
|
-
],
|
|
58073
|
-
|
|
58074
|
-
|
|
58075
|
-
],
|
|
58076
|
-
|
|
58077
|
-
|
|
58078
|
-
],
|
|
58079
|
-
|
|
58080
|
-
|
|
58081
|
-
],
|
|
58082
|
-
|
|
58083
|
-
|
|
58084
|
-
],
|
|
58085
|
-
|
|
58086
|
-
|
|
58087
|
-
],
|
|
58088
|
-
|
|
58089
|
-
|
|
58090
|
-
],
|
|
58091
|
-
|
|
58092
|
-
|
|
58093
|
-
],
|
|
58094
|
-
|
|
58095
|
-
|
|
58096
|
-
],
|
|
58097
|
-
|
|
58098
|
-
|
|
58099
|
-
],
|
|
58100
|
-
|
|
58101
|
-
|
|
58102
|
-
],
|
|
58103
|
-
|
|
58104
|
-
|
|
58105
|
-
],
|
|
58106
|
-
|
|
58107
|
-
|
|
58108
|
-
],
|
|
58109
|
-
|
|
58110
|
-
|
|
58111
|
-
],
|
|
58112
|
-
|
|
58113
|
-
|
|
58114
|
-
],
|
|
58115
|
-
|
|
58114
|
+
], zA.prototype, "domainBlocked", 2);
|
|
58115
|
+
ne([
|
|
58116
|
+
Z({ type: String, attribute: "privacy-url" })
|
|
58117
|
+
], zA.prototype, "privacyUrl", 2);
|
|
58118
|
+
ne([
|
|
58119
|
+
Z({ type: String, attribute: "terms-url" })
|
|
58120
|
+
], zA.prototype, "termsUrl", 2);
|
|
58121
|
+
ne([
|
|
58122
|
+
Z({ type: Boolean, attribute: "terms-enabled" })
|
|
58123
|
+
], zA.prototype, "termsEnabled", 2);
|
|
58124
|
+
ne([
|
|
58125
|
+
Z({ type: String, attribute: "terms-content" })
|
|
58126
|
+
], zA.prototype, "termsContent", 2);
|
|
58127
|
+
ne([
|
|
58128
|
+
Z({ type: Boolean, attribute: "skip-fetch" })
|
|
58129
|
+
], zA.prototype, "skipFetch", 2);
|
|
58130
|
+
ne([
|
|
58131
|
+
Z({ type: String, attribute: "api-base-url" })
|
|
58132
|
+
], zA.prototype, "apiBaseUrl", 2);
|
|
58133
|
+
ne([
|
|
58134
|
+
Z({ type: String, attribute: "button-start-text" })
|
|
58135
|
+
], zA.prototype, "buttonStartText", 2);
|
|
58136
|
+
ne([
|
|
58137
|
+
Z({ type: String, attribute: "button-connecting-text" })
|
|
58138
|
+
], zA.prototype, "buttonConnectingText", 2);
|
|
58139
|
+
ne([
|
|
58140
|
+
Z({ type: String, attribute: "button-end-text" })
|
|
58141
|
+
], zA.prototype, "buttonEndText", 2);
|
|
58142
|
+
ne([
|
|
58143
|
+
Z({ type: String, attribute: "position" })
|
|
58144
|
+
], zA.prototype, "position", 2);
|
|
58145
|
+
ne([
|
|
58146
|
+
Z({ type: Number, attribute: "orb-size" })
|
|
58147
|
+
], zA.prototype, "orbSize", 2);
|
|
58148
|
+
ne([
|
|
58149
|
+
Z({ type: String, attribute: "theme" })
|
|
58150
|
+
], zA.prototype, "theme", 2);
|
|
58151
|
+
ne([
|
|
58152
|
+
Z({ type: String, attribute: "theme-mode" })
|
|
58153
|
+
], zA.prototype, "themeMode", 2);
|
|
58154
|
+
ne([
|
|
58155
|
+
Z({ type: Object, attribute: "orb-colors" })
|
|
58156
|
+
], zA.prototype, "orbColors", 2);
|
|
58157
|
+
ne([
|
|
58158
|
+
Z({ type: Number, attribute: "glow-intensity" })
|
|
58159
|
+
], zA.prototype, "glowIntensity", 2);
|
|
58160
|
+
ne([
|
|
58161
|
+
Z({ type: Number, attribute: "idle-glow-multiplier" })
|
|
58162
|
+
], zA.prototype, "idleGlowMultiplier", 2);
|
|
58163
|
+
ne([
|
|
58164
|
+
Z({ type: Number, attribute: "morph-strength" })
|
|
58165
|
+
], zA.prototype, "morphStrength", 2);
|
|
58166
|
+
ne([
|
|
58167
|
+
Z({ type: Number, attribute: "noise-scale" })
|
|
58168
|
+
], zA.prototype, "noiseScale", 2);
|
|
58169
|
+
ne([
|
|
58170
|
+
Z({ type: Number, attribute: "noise-speed" })
|
|
58171
|
+
], zA.prototype, "noiseSpeed", 2);
|
|
58172
|
+
ne([
|
|
58173
|
+
Z({ type: Number, attribute: "fresnel-power" })
|
|
58174
|
+
], zA.prototype, "fresnelPower", 2);
|
|
58175
|
+
ne([
|
|
58176
|
+
Z({ type: Number, attribute: "rotation-speed" })
|
|
58177
|
+
], zA.prototype, "rotationSpeed", 2);
|
|
58178
|
+
ne([
|
|
58179
|
+
Z({ type: Number, attribute: "audio-reactivity" })
|
|
58180
|
+
], zA.prototype, "audioReactivity", 2);
|
|
58181
|
+
ne([
|
|
58182
|
+
Z({ type: Number, attribute: "audio-smoothing" })
|
|
58183
|
+
], zA.prototype, "audioSmoothing", 2);
|
|
58184
|
+
ne([
|
|
58185
|
+
Z({ type: Number, attribute: "idle-morph-multiplier" })
|
|
58186
|
+
], zA.prototype, "idleMorphMultiplier", 2);
|
|
58187
|
+
ne([
|
|
58188
|
+
Z({ type: Number, attribute: "color-contrast" })
|
|
58189
|
+
], zA.prototype, "colorContrast", 2);
|
|
58190
|
+
ne([
|
|
58191
|
+
Z({ type: Boolean, attribute: "sound-enabled" })
|
|
58192
|
+
], zA.prototype, "soundEnabled", 2);
|
|
58193
|
+
ne([
|
|
58194
|
+
Z({ type: Number, attribute: "sound-volume" })
|
|
58195
|
+
], zA.prototype, "soundVolume", 2);
|
|
58196
|
+
ne([
|
|
58197
|
+
Z({ type: String, attribute: "sound-preset" })
|
|
58198
|
+
], zA.prototype, "soundPreset", 2);
|
|
58199
|
+
zA = ne([
|
|
58116
58200
|
$I("hanc-ai-pill-floating-call")
|
|
58117
|
-
],
|
|
58201
|
+
], zA);
|
|
58118
58202
|
export {
|
|
58119
|
-
|
|
58120
|
-
|
|
58121
|
-
|
|
58122
|
-
|
|
58203
|
+
ie as FloatingCall,
|
|
58204
|
+
te as InlineCall,
|
|
58205
|
+
ge as PillCall,
|
|
58206
|
+
zA as PillFloatingCall,
|
|
58123
58207
|
EC as SoundManager,
|
|
58124
58208
|
FF as applyTheme,
|
|
58125
58209
|
Ev as clearConfigCache,
|