"use strict";
const __rslib_import_meta_url__ = /*#__PURE__*/ (function () {
  return typeof document === 'undefined'
    ? new (require('url'.replace('', '')).URL)('file:' + __filename).href
    : (document.currentScript && document.currentScript.src) ||
      new URL('main.js', document.baseURI).href;
})();
;
exports.ids = ["527"];
exports.modules = {
"../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  $: () => (isPromiseLike)
});
function isPromiseLike(value) {
    return typeof value === "object" && value !== null && "then" in value;
}
//# sourceMappingURL=maybe-promise.js.map

},
"../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  O: () => (PromiseResolver)
});
class PromiseResolver {
    #promise;
    get promise() { return this.#promise; }
    #resolve;
    #reject;
    #state = 'running';
    get state() { return this.#state; }
    constructor() {
        this.#promise = new Promise((resolve, reject) => {
            this.#resolve = resolve;
            this.#reject = reject;
        });
    }
    resolve = (value) => {
        this.#resolve(value);
        this.#state = 'resolved';
    };
    reject = (reason) => {
        this.#reject(reason);
        this.#state = 'rejected';
    };
}
//# sourceMappingURL=promise-resolver.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  T8: () => (getInt16),
  f2: () => (setInt16)
});
function getInt16LittleEndian(buffer, offset) {
    return ((buffer[offset] | (buffer[offset + 1] << 8)) << 16) >> 16;
}
function getInt16BigEndian(buffer, offset) {
    return (((buffer[offset] << 8) | buffer[offset + 1]) << 16) >> 16;
}
function getInt16(buffer, offset, littleEndian) {
    return littleEndian
        ? ((buffer[offset] | (buffer[offset + 1] << 8)) << 16) >> 16
        : (((buffer[offset] << 8) | buffer[offset + 1]) << 16) >> 16;
}
function setInt16LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
}
function setInt16BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 8;
    buffer[offset + 1] = value;
}
function setInt16(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
    }
    else {
        buffer[offset] = value >> 8;
        buffer[offset + 1] = value;
    }
}
//# sourceMappingURL=int16.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  An: () => (setUint16),
  G2: () => (getUint16)
});
function getUint16LittleEndian(buffer, offset) {
    return buffer[offset] | (buffer[offset + 1] << 8);
}
function getUint16BigEndian(buffer, offset) {
    return (buffer[offset] << 8) | buffer[offset + 1];
}
function getUint16(buffer, offset, littleEndian) {
    return littleEndian
        ? buffer[offset] | (buffer[offset + 1] << 8)
        : buffer[offset + 1] | (buffer[offset] << 8);
}
function setUint16LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
}
function setUint16BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 8;
    buffer[offset + 1] = value;
}
function setUint16(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
    }
    else {
        buffer[offset] = value >> 8;
        buffer[offset + 1] = value;
    }
}
//# sourceMappingURL=uint16.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  FQ: () => (getUint32LittleEndian),
  HI: () => (getUint32BigEndian),
  Qg: () => (getUint32),
  ub: () => (setUint32)
});
function getUint32LittleEndian(buffer, offset) {
    return ((buffer[offset] |
        (buffer[offset + 1] << 8) |
        (buffer[offset + 2] << 16) |
        (buffer[offset + 3] << 24)) >>>
        0);
}
function getUint32BigEndian(buffer, offset) {
    return (((buffer[offset] << 24) |
        (buffer[offset + 1] << 16) |
        (buffer[offset + 2] << 8) |
        buffer[offset + 3]) >>>
        0);
}
function getUint32(buffer, offset, littleEndian) {
    return littleEndian
        ? (buffer[offset] |
            (buffer[offset + 1] << 8) |
            (buffer[offset + 2] << 16) |
            (buffer[offset + 3] << 24)) >>>
            0
        : ((buffer[offset] << 24) |
            (buffer[offset + 1] << 16) |
            (buffer[offset + 2] << 8) |
            buffer[offset + 3]) >>>
            0;
}
function setUint32LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
    buffer[offset + 2] = value >> 16;
    buffer[offset + 3] = value >> 24;
}
function setUint32BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 24;
    buffer[offset + 1] = value >> 16;
    buffer[offset + 2] = value >> 8;
    buffer[offset + 3] = value;
}
function setUint32(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
        buffer[offset + 2] = value >> 16;
        buffer[offset + 3] = value >> 24;
    }
    else {
        buffer[offset] = value >> 24;
        buffer[offset + 1] = value >> 16;
        buffer[offset + 2] = value >> 8;
        buffer[offset + 3] = value;
    }
}
//# sourceMappingURL=uint32.js.map

},
"../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Hn: () => (getUint64),
  X3: () => (setUint64),
  gw: () => (getUint64LittleEndian)
});
function getUint64LittleEndian(buffer, offset) {
    return (BigInt(buffer[offset]) |
        (BigInt(buffer[offset + 1]) << 8n) |
        (BigInt(buffer[offset + 2]) << 16n) |
        (BigInt(buffer[offset + 3]) << 24n) |
        (BigInt(buffer[offset + 4]) << 32n) |
        (BigInt(buffer[offset + 5]) << 40n) |
        (BigInt(buffer[offset + 6]) << 48n) |
        (BigInt(buffer[offset + 7]) << 56n));
}
function getUint64BigEndian(buffer, offset) {
    return ((BigInt(buffer[offset]) << 56n) |
        (BigInt(buffer[offset + 1]) << 48n) |
        (BigInt(buffer[offset + 2]) << 40n) |
        (BigInt(buffer[offset + 3]) << 32n) |
        (BigInt(buffer[offset + 4]) << 24n) |
        (BigInt(buffer[offset + 5]) << 16n) |
        (BigInt(buffer[offset + 6]) << 8n) |
        BigInt(buffer[offset + 7]));
}
function getUint64(buffer, offset, littleEndian) {
    return littleEndian
        ? BigInt(buffer[offset]) |
            (BigInt(buffer[offset + 1]) << 8n) |
            (BigInt(buffer[offset + 2]) << 16n) |
            (BigInt(buffer[offset + 3]) << 24n) |
            (BigInt(buffer[offset + 4]) << 32n) |
            (BigInt(buffer[offset + 5]) << 40n) |
            (BigInt(buffer[offset + 6]) << 48n) |
            (BigInt(buffer[offset + 7]) << 56n)
        : (BigInt(buffer[offset]) << 56n) |
            (BigInt(buffer[offset + 1]) << 48n) |
            (BigInt(buffer[offset + 2]) << 40n) |
            (BigInt(buffer[offset + 3]) << 32n) |
            (BigInt(buffer[offset + 4]) << 24n) |
            (BigInt(buffer[offset + 5]) << 16n) |
            (BigInt(buffer[offset + 6]) << 8n) |
            BigInt(buffer[offset + 7]);
}
function setUint64LittleEndian(buffer, offset, value) {
    buffer[offset] = Number(value & 0xffn);
    buffer[offset + 1] = Number((value >> 8n) & 0xffn);
    buffer[offset + 2] = Number((value >> 16n) & 0xffn);
    buffer[offset + 3] = Number((value >> 24n) & 0xffn);
    buffer[offset + 4] = Number((value >> 32n) & 0xffn);
    buffer[offset + 5] = Number((value >> 40n) & 0xffn);
    buffer[offset + 6] = Number((value >> 48n) & 0xffn);
    buffer[offset + 7] = Number((value >> 56n) & 0xffn);
}
function setUint64BigEndian(buffer, offset, value) {
    buffer[offset] = Number((value >> 56n) & 0xffn);
    buffer[offset + 1] = Number((value >> 48n) & 0xffn);
    buffer[offset + 2] = Number((value >> 40n) & 0xffn);
    buffer[offset + 3] = Number((value >> 32n) & 0xffn);
    buffer[offset + 4] = Number((value >> 24n) & 0xffn);
    buffer[offset + 5] = Number((value >> 16n) & 0xffn);
    buffer[offset + 6] = Number((value >> 8n) & 0xffn);
    buffer[offset + 7] = Number(value & 0xffn);
}
function setUint64(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = Number(value & 0xffn);
        buffer[offset + 1] = Number((value >> 8n) & 0xffn);
        buffer[offset + 2] = Number((value >> 16n) & 0xffn);
        buffer[offset + 3] = Number((value >> 24n) & 0xffn);
        buffer[offset + 4] = Number((value >> 32n) & 0xffn);
        buffer[offset + 5] = Number((value >> 40n) & 0xffn);
        buffer[offset + 6] = Number((value >> 48n) & 0xffn);
        buffer[offset + 7] = Number((value >> 56n) & 0xffn);
    }
    else {
        buffer[offset] = Number((value >> 56n) & 0xffn);
        buffer[offset + 1] = Number((value >> 48n) & 0xffn);
        buffer[offset + 2] = Number((value >> 40n) & 0xffn);
        buffer[offset + 3] = Number((value >> 32n) & 0xffn);
        buffer[offset + 4] = Number((value >> 24n) & 0xffn);
        buffer[offset + 5] = Number((value >> 16n) & 0xffn);
        buffer[offset + 6] = Number((value >> 8n) & 0xffn);
        buffer[offset + 7] = Number(value & 0xffn);
    }
}
//# sourceMappingURL=uint64.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/buffered.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  y: () => (BufferedReadableStream)
});
/* import */ var _yume_chan_struct__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/readable.js");
/* import */ var _yume_chan_struct__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js");
/* import */ var _push_readable_js__rspack_import_2 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js");
/* import */ var _try_close_js__rspack_import_3 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/try-close.js");



class BufferedReadableStream {
    #buffered;
    // PERF: `subarray` is slow
    // don't use it until absolutely necessary
    #bufferedOffset = 0;
    #bufferedLength = 0;
    #position = 0;
    get position() {
        return this.#position;
    }
    stream;
    reader;
    constructor(stream) {
        this.stream = stream;
        this.reader = stream.getReader();
    }
    #readBuffered(length) {
        if (!this.#buffered) {
            return undefined;
        }
        const value = this.#buffered.subarray(this.#bufferedOffset, this.#bufferedOffset + length);
        // PERF: Synchronous path for reading from internal buffer
        if (this.#bufferedLength > length) {
            this.#position += length;
            this.#bufferedOffset += length;
            this.#bufferedLength -= length;
            return value;
        }
        this.#position += this.#bufferedLength;
        this.#buffered = undefined;
        this.#bufferedOffset = 0;
        this.#bufferedLength = 0;
        return value;
    }
    async #readSource(length) {
        const { done, value } = await this.reader.read();
        if (done) {
            throw new _yume_chan_struct__rspack_import_0/* .ExactReadableEndedError */.s();
        }
        if (value.length > length) {
            this.#buffered = value;
            this.#bufferedOffset = length;
            this.#bufferedLength = value.length - length;
            this.#position += length;
            return value.subarray(0, length);
        }
        this.#position += value.length;
        return value;
    }
    iterateExactly(length) {
        let state = this.#buffered ? 0 : 1;
        return {
            next: () => {
                switch (state) {
                    case 0: {
                        const value = this.#readBuffered(length);
                        if (value.length === length) {
                            state = 2;
                        }
                        else {
                            length -= value.length;
                            state = 1;
                        }
                        return { done: false, value };
                    }
                    case 1:
                        state = 3;
                        return {
                            done: false,
                            value: this.#readSource(length).then((value) => {
                                if (value.length === length) {
                                    state = 2;
                                }
                                else {
                                    length -= value.length;
                                    state = 1;
                                }
                                return value;
                            }),
                        };
                    case 2:
                        return { done: true, value: undefined };
                    case 3:
                        throw new Error("Can't call `next` before previous Promise resolves");
                    default:
                        throw new Error("unreachable");
                }
            },
        };
    }
    readExactly = (0,_yume_chan_struct__rspack_import_1/* .bipedal */.q)(function* (then, length) {
        let result;
        let index = 0;
        const initial = this.#readBuffered(length);
        if (initial) {
            if (initial.length === length) {
                return initial;
            }
            result = new Uint8Array(length);
            result.set(initial, index);
            index += initial.length;
            length -= initial.length;
        }
        else {
            result = new Uint8Array(length);
        }
        while (length > 0) {
            const value = yield* then(this.#readSource(length));
            result.set(value, index);
            index += value.length;
            length -= value.length;
        }
        return result;
    });
    /**
     * Return a readable stream with unconsumed data (if any) and
     * all data from the wrapped stream.
     * @returns A `ReadableStream`
     */
    release() {
        if (this.#bufferedLength > 0) {
            return new _push_readable_js__rspack_import_2/* .PushReadableStream */.F(async (controller) => {
                // Put the remaining data back to the stream
                const buffered = this.#buffered.subarray(this.#bufferedOffset);
                await controller.enqueue(buffered);
                controller.abortSignal.addEventListener("abort", () => {
                    void (0,_try_close_js__rspack_import_3/* .tryCancel */.S)(this.reader);
                });
                // Manually pipe the stream
                while (true) {
                    const { done, value } = await this.reader.read();
                    if (done) {
                        return;
                    }
                    await controller.enqueue(value);
                }
            });
        }
        else {
            // Simply release the reader and return the stream
            this.reader.releaseLock();
            return this.stream;
        }
    }
    async cancel(reason) {
        await this.reader.cancel(reason);
    }
}
//# sourceMappingURL=buffered.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/push-readable.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  F: () => (PushReadableStream)
});
/* import */ var _yume_chan_async__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/promise-resolver.js");
/* import */ var _stream_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js");


class PushReadableStream extends _stream_js__rspack_import_0/* .ReadableStream */.ZY {
    /**
     * Create a new `PushReadableStream` from a source.
     *
     * @param source If `source` returns a `Promise`, the stream will be closed
     * when the `Promise` is resolved, and be errored when the `Promise` is rejected.
     * @param strategy
     */
    constructor(source, strategy, logger) {
        let waterMarkLow;
        let zeroHighWaterMarkAllowEnqueue = false;
        const abortController = new _stream_js__rspack_import_0/* .AbortController */.z1();
        super({
            start: (controller) => {
                const result = source({
                    abortSignal: abortController.signal,
                    enqueue: async (chunk) => {
                        logger?.({
                            source: "producer",
                            operation: "enqueue",
                            value: chunk,
                            phase: "start",
                        });
                        if (abortController.signal.aborted) {
                            // In original `ReadableStream`, calling `enqueue` or `close`
                            // on an cancelled stream will throw an error,
                            //
                            // But in `PushReadableStream`, `enqueue` is an async function,
                            // the producer can't just check `abortSignal.aborted`
                            // before calling `enqueue`, as it might change when waiting
                            // for the backpressure to be reduced.
                            //
                            // So IMO it's better to handle this for the producer
                            // by simply ignoring the `enqueue` call.
                            //
                            // Note that we check `abortSignal.aborted` instead of `stopped`,
                            // as it's not allowed for the producer to call `enqueue` after
                            // they called `close` or `error`.
                            //
                            // Obviously, the producer should listen to the `abortSignal` and
                            // stop producing, but most pushing data sources don't support that.
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "ignored",
                            });
                            return;
                        }
                        if (controller.desiredSize === null) {
                            // `desiredSize` being `null` means the stream is in error state,
                            // `controller.enqueue` will throw an error for us.
                            controller.enqueue(chunk);
                            // istanbul ignore next
                            return;
                        }
                        if (zeroHighWaterMarkAllowEnqueue) {
                            // When `highWaterMark` is set to `0`,
                            // `controller.desiredSize` will always be `0`,
                            // even if the consumer has called `reader.read()`.
                            // (in this case, each `reader.read()`/`pull`
                            // should allow one `enqueue` of any size)
                            //
                            // If the consumer has already called `reader.read()`,
                            // before the producer tries to `enqueue`,
                            // `controller.desiredSize` is `0` and normal `waterMarkLow` signal
                            // will never trigger,
                            // (because `ReadableStream` prevents reentrance of `pull`)
                            // The stream will stuck.
                            //
                            // So we need a special signal for this case.
                            zeroHighWaterMarkAllowEnqueue = false;
                            controller.enqueue(chunk);
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "complete",
                            });
                            return;
                        }
                        if (controller.desiredSize <= 0) {
                            logger?.({
                                source: "producer",
                                operation: "enqueue",
                                value: chunk,
                                phase: "waiting",
                            });
                            waterMarkLow = new _yume_chan_async__rspack_import_1/* .PromiseResolver */.O();
                            await waterMarkLow.promise;
                            // Recheck consumer cancellation after async operations.
                            if (abortController.signal.aborted) {
                                logger?.({
                                    source: "producer",
                                    operation: "enqueue",
                                    value: chunk,
                                    phase: "ignored",
                                });
                                return;
                            }
                        }
                        controller.enqueue(chunk);
                        logger?.({
                            source: "producer",
                            operation: "enqueue",
                            value: chunk,
                            phase: "complete",
                        });
                    },
                    close() {
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: true,
                            phase: "start",
                        });
                        // Since `enqueue` on an cancelled stream won't throw an error,
                        // so does `close`.
                        if (abortController.signal.aborted) {
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: true,
                                phase: "ignored",
                            });
                            return;
                        }
                        controller.close();
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: true,
                            phase: "complete",
                        });
                    },
                    error(e) {
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: true,
                            phase: "start",
                        });
                        // Calling `error` on an already closed or errored stream is a no-op.
                        controller.error(e);
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: true,
                            phase: "complete",
                        });
                    },
                });
                if (result && "then" in result) {
                    // If `source` returns a `Promise`,
                    // close the stream when the `Promise` is resolved,
                    // and error the stream when the `Promise` is rejected.
                    // The producer can return a never-settling `Promise`
                    // to disable this behavior.
                    result.then(() => {
                        logger?.({
                            source: "producer",
                            operation: "close",
                            explicit: false,
                            phase: "start",
                        });
                        try {
                            controller.close();
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: false,
                                phase: "complete",
                            });
                        }
                        catch {
                            logger?.({
                                source: "producer",
                                operation: "close",
                                explicit: false,
                                phase: "ignored",
                            });
                            // The stream is already closed by the producer,
                            // Or cancelled by the consumer.
                        }
                    }, (e) => {
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: false,
                            phase: "start",
                        });
                        controller.error(e);
                        logger?.({
                            source: "producer",
                            operation: "error",
                            explicit: false,
                            phase: "complete",
                        });
                    });
                }
            },
            pull: () => {
                logger?.({
                    source: "consumer",
                    operation: "pull",
                    phase: "start",
                });
                if (waterMarkLow) {
                    waterMarkLow.resolve();
                }
                else if (strategy?.highWaterMark === 0) {
                    zeroHighWaterMarkAllowEnqueue = true;
                }
                logger?.({
                    source: "consumer",
                    operation: "pull",
                    phase: "complete",
                });
            },
            cancel: (reason) => {
                logger?.({
                    source: "consumer",
                    operation: "cancel",
                    phase: "start",
                });
                abortController.abort(reason);
                // Resolve it on cancellation. `pull` will check `abortSignal.aborted` again.
                waterMarkLow?.resolve();
                logger?.({
                    source: "consumer",
                    operation: "cancel",
                    phase: "complete",
                });
            },
        }, strategy);
    }
}
//# sourceMappingURL=push-readable.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/stream.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Rv: () => (TransformStream),
  ZY: () => (ReadableStream),
  ho: () => (WritableStream),
  z1: () => (AbortController)
});


const { AbortController } = globalThis;
const ReadableStream = /* #__PURE__ */ (() => {
    const { ReadableStream } = globalThis;
    if (!ReadableStream.from) {
        ReadableStream.from = function (iterable) {
            const iterator = Symbol.asyncIterator in iterable
                ? iterable[Symbol.asyncIterator]()
                : iterable[Symbol.iterator]();
            return new ReadableStream({
                async pull(controller) {
                    const result = await iterator.next();
                    if (result.done) {
                        controller.close();
                        return;
                    }
                    controller.enqueue(result.value);
                },
                async cancel(reason) {
                    await iterator.return?.(reason);
                },
            });
        };
    }
    if (!ReadableStream.prototype[Symbol.asyncIterator] ||
        !ReadableStream.prototype.values) {
        ReadableStream.prototype.values = async function* (options) {
            const reader = this.getReader();
            try {
                while (true) {
                    const { done, value } = await reader.read();
                    if (done) {
                        return;
                    }
                    yield value;
                }
            }
            finally {
                // Calling `iterator.return` will enter this `finally` block.
                // We don't need to care about the parameter to `iterator.return`,
                // it will be returned as the final `result.value` automatically.
                if (!options?.preventCancel) {
                    await reader.cancel();
                }
                reader.releaseLock();
            }
        };
        ReadableStream.prototype[Symbol.asyncIterator] =
            // eslint-disable-next-line @typescript-eslint/unbound-method
            ReadableStream.prototype.values;
    }
    return ReadableStream;
})();
const { WritableStream, TransformStream } = globalThis;
//# sourceMappingURL=stream.js.map

},
"../../node_modules/.pnpm/@yume-chan+stream-extra@1.0.0/node_modules/@yume-chan/stream-extra/esm/try-close.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  S: () => (tryCancel),
  i: () => (tryClose)
});
function tryClose(controller) {
    try {
        controller.close();
        return true;
    }
    catch {
        return false;
    }
}
async function tryCancel(stream) {
    try {
        await stream.cancel();
        return true;
    }
    catch {
        return false;
    }
}
//# sourceMappingURL=try-close.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  q: () => (bipedal)
});
/* import */ var _yume_chan_async__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+async@4.1.3/node_modules/@yume-chan/async/esm/maybe-promise.js");

function advance(iterator, next) {
    while (true) {
        const { done, value } = iterator.next(next);
        if (done) {
            return value;
        }
        if ((0,_yume_chan_async__rspack_import_0/* .isPromiseLike */.$)(value)) {
            return value.then((value) => advance(iterator, { resolved: value }), (error) => advance(iterator, { error }));
        }
        next = value;
    }
}
function bipedal(fn) {
    return function (...args) {
        const iterator = fn.call(this, function* (value) {
            if ((0,_yume_chan_async__rspack_import_0/* .isPromiseLike */.$)(value)) {
                const result = yield value;
                if ("resolved" in result) {
                    return result.resolved;
                }
                else {
                    throw result.error;
                }
            }
            return value;
        }, ...args);
        return advance(iterator, undefined);
    };
}
//# sourceMappingURL=bipedal.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/buffer.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  r: () => (buffer)
});
/* import */ var _bipedal_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js");

const EmptyUint8Array = new Uint8Array(0);
const buffer = function (lengthOrField, converter) {
    if (typeof lengthOrField === "number") {
        if (converter) {
            if (lengthOrField === 0) {
                return {
                    size: 0,
                    serialize: () => { },
                    deserialize: () => converter.convert(EmptyUint8Array),
                };
            }
            return {
                size: lengthOrField,
                serialize: (value, { buffer, index }) => {
                    buffer.set(converter.back(value).slice(0, lengthOrField), index);
                },
                deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, { reader }) {
                    const array = yield* then(reader.readExactly(lengthOrField));
                    return converter.convert(array);
                }),
            };
        }
        if (lengthOrField === 0) {
            return {
                size: 0,
                serialize: () => { },
                deserialize: () => EmptyUint8Array,
            };
        }
        return {
            size: lengthOrField,
            serialize: (value, { buffer, index }) => {
                buffer.set(value.slice(0, lengthOrField), index);
            },
            deserialize: ({ reader }) => reader.readExactly(lengthOrField),
        };
    }
    // Some Field type might be `function`s
    if ((typeof lengthOrField === "object" ||
        typeof lengthOrField === "function") &&
        "serialize" in lengthOrField) {
        if (converter) {
            return {
                size: 0,
                dynamicSize(value) {
                    const array = converter.back(value);
                    const lengthFieldSize = lengthOrField.dynamicSize?.(array.length) ??
                        lengthOrField.size;
                    return lengthFieldSize + array.length;
                },
                serialize(value, context) {
                    const array = converter.back(value);
                    const lengthFieldSize = lengthOrField.dynamicSize?.(array.length) ??
                        lengthOrField.size;
                    lengthOrField.serialize(array.length, context);
                    context.buffer.set(array, context.index + lengthFieldSize);
                },
                deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, context) {
                    const length = yield* then(lengthOrField.deserialize(context));
                    const array = yield* then(context.reader.readExactly(length));
                    return converter.convert(array);
                }),
            };
        }
        return {
            size: 0,
            dynamicSize(value) {
                const lengthFieldSize = lengthOrField.dynamicSize?.(value.length) ??
                    lengthOrField.size;
                return lengthFieldSize + value.length;
            },
            serialize(value, context) {
                const lengthFieldSize = lengthOrField.dynamicSize?.(value.length) ??
                    lengthOrField.size;
                lengthOrField.serialize(value.length, context);
                context.buffer.set(value, context.index + lengthFieldSize);
            },
            deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, context) {
                const length = yield* then(lengthOrField.deserialize(context));
                return context.reader.readExactly(length);
            }),
        };
    }
    if (typeof lengthOrField === "string") {
        if (converter) {
            return {
                size: 0,
                preSerialize: (value, runtimeStruct) => {
                    runtimeStruct[lengthOrField] = converter.back(value).length;
                },
                dynamicSize: (value) => {
                    return converter.back(value).length;
                },
                serialize: (value, { buffer, index }) => {
                    buffer.set(converter.back(value), index);
                },
                deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, { reader, runtimeStruct }) {
                    const length = runtimeStruct[lengthOrField];
                    if (length === 0) {
                        return converter.convert(EmptyUint8Array);
                    }
                    const value = yield* then(reader.readExactly(length));
                    return converter.convert(value);
                }),
            };
        }
        return {
            size: 0,
            preSerialize: (value, runtimeStruct) => {
                runtimeStruct[lengthOrField] = value.length;
            },
            dynamicSize: (value) => {
                return value.length;
            },
            serialize: (value, { buffer, index }) => {
                buffer.set(value, index);
            },
            deserialize: ({ reader, runtimeStruct }) => {
                const length = runtimeStruct[lengthOrField];
                if (length === 0) {
                    return EmptyUint8Array;
                }
                return reader.readExactly(length);
            },
        };
    }
    if (converter) {
        return {
            size: 0,
            preSerialize: (value, runtimeStruct) => {
                const length = converter.back(value).length;
                runtimeStruct[lengthOrField.field] = lengthOrField.back(length);
            },
            dynamicSize: (value) => {
                return converter.back(value).length;
            },
            serialize: (value, { buffer, index }) => {
                buffer.set(converter.back(value), index);
            },
            deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, { reader, runtimeStruct }) {
                const rawLength = runtimeStruct[lengthOrField.field];
                const length = lengthOrField.convert(rawLength);
                if (length === 0) {
                    return converter.convert(EmptyUint8Array);
                }
                const value = yield* then(reader.readExactly(length));
                return converter.convert(value);
            }),
        };
    }
    return {
        size: 0,
        preSerialize: (value, runtimeStruct) => {
            runtimeStruct[lengthOrField.field] = lengthOrField.back(value.length);
        },
        dynamicSize: (value) => {
            return value.length;
        },
        serialize: (value, { buffer, index }) => {
            buffer.set(value, index);
        },
        deserialize: ({ reader, runtimeStruct }) => {
            const rawLength = runtimeStruct[lengthOrField.field];
            const length = lengthOrField.convert(rawLength);
            if (length === 0) {
                return EmptyUint8Array;
            }
            return reader.readExactly(length);
        },
    };
};
//# sourceMappingURL=buffer.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/number.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  NX: () => (/* binding */ u16),
  DH: () => (/* binding */ u32),
  u8: () => (/* binding */ u8),
  _l: () => (/* binding */ u64)
});

// UNUSED EXPORTS: s16, s32, s64, s8

;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int8.js
function getInt8(buffer, offset) {
    return (buffer[offset] << 24) >> 24;
}
//# sourceMappingURL=int8.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js
var uint16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint16.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js
var int16 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int16.js");
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js
var uint32 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint32.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int32.js
function getInt32LittleEndian(buffer, offset) {
    return (buffer[offset] |
        (buffer[offset + 1] << 8) |
        (buffer[offset + 2] << 16) |
        (buffer[offset + 3] << 24));
}
function getInt32BigEndian(buffer, offset) {
    return ((buffer[offset] << 24) |
        (buffer[offset + 1] << 16) |
        (buffer[offset + 2] << 8) |
        buffer[offset + 3]);
}
function getInt32(buffer, offset, littleEndian) {
    return littleEndian
        ? buffer[offset] |
            (buffer[offset + 1] << 8) |
            (buffer[offset + 2] << 16) |
            (buffer[offset + 3] << 24)
        : (buffer[offset] << 24) |
            (buffer[offset + 1] << 16) |
            (buffer[offset + 2] << 8) |
            buffer[offset + 3];
}
function setInt32LittleEndian(buffer, offset, value) {
    buffer[offset] = value;
    buffer[offset + 1] = value >> 8;
    buffer[offset + 2] = value >> 16;
    buffer[offset + 3] = value >> 24;
}
function setInt32BigEndian(buffer, offset, value) {
    buffer[offset] = value >> 24;
    buffer[offset + 1] = value >> 16;
    buffer[offset + 2] = value >> 8;
    buffer[offset + 3] = value;
}
function setInt32(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = value;
        buffer[offset + 1] = value >> 8;
        buffer[offset + 2] = value >> 16;
        buffer[offset + 3] = value >> 24;
    }
    else {
        buffer[offset] = value >> 24;
        buffer[offset + 1] = value >> 16;
        buffer[offset + 2] = value >> 8;
        buffer[offset + 3] = value;
    }
}
//# sourceMappingURL=int32.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js
var uint64 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/uint64.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+no-data-view@1.0.0/node_modules/@yume-chan/no-data-view/esm/int64.js
function getInt64LittleEndian(buffer, offset) {
    return (BigInt(buffer[offset]) |
        (BigInt(buffer[offset + 1]) << 8n) |
        (BigInt(buffer[offset + 2]) << 16n) |
        (BigInt(buffer[offset + 3]) << 24n) |
        (BigInt(buffer[offset + 4]) << 32n) |
        (BigInt(buffer[offset + 5]) << 40n) |
        (BigInt(buffer[offset + 6]) << 48n) |
        (BigInt(buffer[offset + 7] << 24) << 32n));
}
function getInt64BigEndian(buffer, offset) {
    return ((BigInt(buffer[offset] << 24) << 32n) |
        (BigInt(buffer[offset + 1]) << 48n) |
        (BigInt(buffer[offset + 2]) << 40n) |
        (BigInt(buffer[offset + 3]) << 32n) |
        (BigInt(buffer[offset + 4]) << 24n) |
        (BigInt(buffer[offset + 5]) << 16n) |
        (BigInt(buffer[offset + 6]) << 8n) |
        BigInt(buffer[offset + 7]));
}
function getInt64(buffer, offset, littleEndian) {
    return littleEndian
        ? BigInt(buffer[offset]) |
            (BigInt(buffer[offset + 1]) << 8n) |
            (BigInt(buffer[offset + 2]) << 16n) |
            (BigInt(buffer[offset + 3]) << 24n) |
            (BigInt(buffer[offset + 4]) << 32n) |
            (BigInt(buffer[offset + 5]) << 40n) |
            (BigInt(buffer[offset + 6]) << 48n) |
            (BigInt(buffer[offset + 7] << 24) << 32n)
        : (BigInt(buffer[offset] << 24) << 32n) |
            (BigInt(buffer[offset + 1]) << 48n) |
            (BigInt(buffer[offset + 2]) << 40n) |
            (BigInt(buffer[offset + 3]) << 32n) |
            (BigInt(buffer[offset + 4]) << 24n) |
            (BigInt(buffer[offset + 5]) << 16n) |
            (BigInt(buffer[offset + 6]) << 8n) |
            BigInt(buffer[offset + 7]);
}
function setInt64LittleEndian(buffer, offset, value) {
    buffer[offset] = Number(value & 0xffn);
    buffer[offset + 1] = Number((value >> 8n) & 0xffn);
    buffer[offset + 2] = Number((value >> 16n) & 0xffn);
    buffer[offset + 3] = Number((value >> 24n) & 0xffn);
    buffer[offset + 4] = Number((value >> 32n) & 0xffn);
    buffer[offset + 5] = Number((value >> 40n) & 0xffn);
    buffer[offset + 6] = Number((value >> 48n) & 0xffn);
    buffer[offset + 7] = Number((value >> 56n) & 0xffn);
}
function setInt64BigEndian(buffer, offset, value) {
    buffer[offset] = Number((value >> 56n) & 0xffn);
    buffer[offset + 1] = Number((value >> 48n) & 0xffn);
    buffer[offset + 2] = Number((value >> 40n) & 0xffn);
    buffer[offset + 3] = Number((value >> 32n) & 0xffn);
    buffer[offset + 4] = Number((value >> 24n) & 0xffn);
    buffer[offset + 5] = Number((value >> 16n) & 0xffn);
    buffer[offset + 6] = Number((value >> 8n) & 0xffn);
    buffer[offset + 7] = Number(value & 0xffn);
}
function setInt64(buffer, offset, value, littleEndian) {
    if (littleEndian) {
        buffer[offset] = Number(value & 0xffn);
        buffer[offset + 1] = Number((value >> 8n) & 0xffn);
        buffer[offset + 2] = Number((value >> 16n) & 0xffn);
        buffer[offset + 3] = Number((value >> 24n) & 0xffn);
        buffer[offset + 4] = Number((value >> 32n) & 0xffn);
        buffer[offset + 5] = Number((value >> 40n) & 0xffn);
        buffer[offset + 6] = Number((value >> 48n) & 0xffn);
        buffer[offset + 7] = Number((value >> 56n) & 0xffn);
    }
    else {
        buffer[offset] = Number((value >> 56n) & 0xffn);
        buffer[offset + 1] = Number((value >> 48n) & 0xffn);
        buffer[offset + 2] = Number((value >> 40n) & 0xffn);
        buffer[offset + 3] = Number((value >> 32n) & 0xffn);
        buffer[offset + 4] = Number((value >> 24n) & 0xffn);
        buffer[offset + 5] = Number((value >> 16n) & 0xffn);
        buffer[offset + 6] = Number((value >> 8n) & 0xffn);
        buffer[offset + 7] = Number(value & 0xffn);
    }
}
//# sourceMappingURL=int64.js.map
// EXTERNAL MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js
var bipedal = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js");
;// CONCATENATED MODULE: ../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/number.js


/* #__NO_SIDE_EFFECTS__ */
function factory(size, serialize, deserialize) {
    const result = () => result;
    result.size = size;
    result.serialize = serialize;
    result.deserialize = deserialize;
    return result;
}
const u8 = factory(1, (value, { buffer, index }) => {
    buffer[index] = value;
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader }) {
    const data = yield* then(reader.readExactly(1));
    return data[0];
}));
const s8 = factory(1, (value, { buffer, index }) => {
    buffer[index] = value;
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader }) {
    const data = yield* then(reader.readExactly(1));
    return getInt8(data, 0);
}));
const u16 = factory(2, (value, { buffer, index, littleEndian }) => {
    (0,uint16/* .setUint16 */.An)(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(2));
    return (0,uint16/* .getUint16 */.G2)(data, 0, littleEndian);
}));
const s16 = factory(2, (value, { buffer, index, littleEndian }) => {
    (0,int16/* .setInt16 */.f2)(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(2));
    return (0,int16/* .getInt16 */.T8)(data, 0, littleEndian);
}));
const u32 = factory(4, (value, { buffer, index, littleEndian }) => {
    (0,uint32/* .setUint32 */.ub)(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(4));
    return (0,uint32/* .getUint32 */.Qg)(data, 0, littleEndian);
}));
const s32 = factory(4, (value, { buffer, index, littleEndian }) => {
    setInt32(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(4));
    return getInt32(data, 0, littleEndian);
}));
const u64 = factory(8, (value, { buffer, index, littleEndian }) => {
    (0,uint64/* .setUint64 */.X3)(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(8));
    return (0,uint64/* .getUint64 */.Hn)(data, 0, littleEndian);
}));
const s64 = factory(8, (value, { buffer, index, littleEndian }) => {
    setInt64(buffer, index, value, littleEndian);
}, (0,bipedal/* .bipedal */.q)(function* (then, { reader, littleEndian }) {
    const data = yield* then(reader.readExactly(8));
    return getInt64(data, 0, littleEndian);
}));
//# sourceMappingURL=number.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/readable.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  s: () => (ExactReadableEndedError)
});
// TODO: allow over reading (returning a `Uint8Array`, an `offset` and a `length`) to avoid copying
class ExactReadableEndedError extends Error {
    constructor() {
        super("ExactReadable ended");
    }
}
//# sourceMappingURL=readable.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/string.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Y: () => (string)
});
/* import */ var _buffer_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/buffer.js");
/* import */ var _utils_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/utils.js");


// Rollup doesn't support `/* #__NO_SIDE_EFFECTS__ */ export const a = () => {}
/* #__NO_SIDE_EFFECTS__ */
function _string(lengthOrField) {
    const field = (0,_buffer_js__rspack_import_0/* .buffer */.r)(lengthOrField, {
        convert: _utils_js__rspack_import_1/* .decodeUtf8 */._6,
        back: _utils_js__rspack_import_1/* .encodeUtf8 */.Af,
    });
    field.as = () => field;
    return field;
}
const string = _string;
//# sourceMappingURL=string.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/struct.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  r1: () => (StructEmptyError),
  w3: () => (struct)
});
/* import */ var _bipedal_js__rspack_import_0 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/bipedal.js");
/* import */ var _readable_js__rspack_import_1 = __webpack_require__("../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/readable.js");


class StructDeserializeError extends Error {
    constructor(message) {
        super(message);
    }
}
class StructNotEnoughDataError extends StructDeserializeError {
    constructor() {
        super("The underlying readable was ended before the struct was fully deserialized");
    }
}
class StructEmptyError extends StructDeserializeError {
    constructor() {
        super("The underlying readable doesn't contain any more struct");
    }
}
/* #__NO_SIDE_EFFECTS__ */
function struct(fields, options) {
    const fieldList = Object.entries(fields);
    const size = fieldList.reduce((sum, [, field]) => sum + field.size, 0);
    const littleEndian = !!options.littleEndian;
    const extra = options.extra
        ? Object.getOwnPropertyDescriptors(options.extra)
        : undefined;
    return {
        fields,
        size,
        extra: options.extra,
        serialize(runtimeStruct, buffer) {
            for (const [key, field] of fieldList) {
                if (key in runtimeStruct) {
                    field.preSerialize?.(runtimeStruct[key], runtimeStruct);
                }
            }
            const sizes = fieldList.map(([key, field]) => field.dynamicSize?.(runtimeStruct[key]) ??
                field.size);
            const size = sizes.reduce((sum, size) => sum + size, 0);
            let externalBuffer = false;
            if (buffer) {
                if (buffer.length < size) {
                    throw new Error("Buffer too small");
                }
                externalBuffer = true;
            }
            else {
                buffer = new Uint8Array(size);
            }
            const context = {
                buffer,
                index: 0,
                littleEndian,
            };
            for (const [index, [key, field]] of fieldList.entries()) {
                field.serialize(runtimeStruct[key], context);
                context.index += sizes[index];
            }
            if (externalBuffer) {
                return size;
            }
            else {
                return buffer;
            }
        },
        deserialize: (0,_bipedal_js__rspack_import_0/* .bipedal */.q)(function* (then, reader) {
            const startPosition = reader.position;
            const runtimeStruct = {};
            const context = {
                reader,
                runtimeStruct: runtimeStruct,
                littleEndian: littleEndian,
            };
            try {
                for (const [key, field] of fieldList) {
                    runtimeStruct[key] = yield* then(field.deserialize(context));
                }
            }
            catch (e) {
                if (!(e instanceof _readable_js__rspack_import_1/* .ExactReadableEndedError */.s)) {
                    throw e;
                }
                if (reader.position === startPosition) {
                    throw new StructEmptyError();
                }
                else {
                    throw new StructNotEnoughDataError();
                }
            }
            if (extra) {
                Object.defineProperties(runtimeStruct, extra);
            }
            if (options.postDeserialize) {
                return options.postDeserialize.call(runtimeStruct, runtimeStruct);
            }
            else {
                return runtimeStruct;
            }
        }),
    };
}
//# sourceMappingURL=struct.js.map

},
"../../node_modules/.pnpm/@yume-chan+struct@1.0.0/node_modules/@yume-chan/struct/esm/utils.js"(__unused_rspack___webpack_module__, __webpack_exports__, __webpack_require__) {
__webpack_require__.d(__webpack_exports__, {
  Af: () => (encodeUtf8),
  Ay: () => (TextDecoder),
  _6: () => (decodeUtf8)
});
// This library can't use `@types/node` or `lib: dom`
// because they will pollute the global scope
// So `TextEncoder` and `TextDecoder` types are not available
const { TextEncoder, TextDecoder } = globalThis;
const SharedEncoder = /* #__PURE__ */ new TextEncoder();
const SharedDecoder = /* #__PURE__ */ new TextDecoder();
/* #__NO_SIDE_EFFECTS__ */
function encodeUtf8(input) {
    return SharedEncoder.encode(input);
}
/* #__NO_SIDE_EFFECTS__ */
function decodeUtf8(buffer) {
    // `TextDecoder` has internal states in stream mode,
    // but this method is not for stream mode, so the instance can be reused
    return SharedDecoder.decode(buffer);
}
//# sourceMappingURL=utils.js.map

},

};
;