System.register("chunks:///_virtual/Arrays.ts", ["cc"], (function(n) {
        var r;
        return {
            setters: [function(n) {
                r = n.cclegacy
            }
            ],
            execute: function() {
                r._RF.push({}, "23f27fKsM5BBYzm+8dEkMeR", "Arrays", void 0);
                n("Arrays", function() {
                    function n() {}
                    return n.contains = function(n, r) {
                        return n.indexOf(r) > -1
                    }
                        ,
                        n.fill = function(n, r, t) {
                            return Array.from({
                                length: r
                            }, (function(r, u) {
                                    var e;
                                    return null != (e = n[u]) ? e : t
                                }
                            ))
                        }
                        ,
                        n
                }());
                r._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/debug-view-runtime-control.ts", ["./rollupPluginModLoBabelHelpers.js", "cc"], (function(t) {
        var e, o, i, n, s, l, r, a, g, h, p, c, C, d, m, u, L;
        return {
            setters: [function(t) {
                e = t.applyDecoratedDescriptor,
                    o = t.inheritsLoose,
                    i = t.initializerDefineProperty,
                    n = t.assertThisInitialized
            }
                , function(t) {
                    s = t.cclegacy,
                        l = t._decorator,
                        r = t.Node,
                        a = t.Canvas,
                        g = t.UITransform,
                        h = t.instantiate,
                        p = t.Label,
                        c = t.Color,
                        C = t.RichText,
                        d = t.Toggle,
                        m = t.Button,
                        u = t.director,
                        L = t.Component
                }
            ],
            execute: function() {
                var f, M, b, v, T, S, x, E, I;
                s._RF.push({}, "b2bd1+njXxJxaFY3ymm06WU", "debug-view-runtime-control", void 0);
                var A = l.ccclass
                    , y = l.property;
                t("DebugViewRuntimeControl", (f = A("internal.DebugViewRuntimeControl"),
                    M = y(r),
                    b = y(r),
                    v = y(r),
                f((x = e((S = function(t) {
                    function e() {
                        for (var e, o = arguments.length, s = new Array(o), l = 0; l < o; l++)
                            s[l] = arguments[l];
                        return e = t.call.apply(t, [this].concat(s)) || this,
                            i(e, "compositeModeToggle", x, n(e)),
                            i(e, "singleModeToggle", E, n(e)),
                            i(e, "EnableAllCompositeModeButton", I, n(e)),
                            e._single = 0,
                            e.strSingle = ["No Single Debug", "Vertex Color", "Vertex Normal", "Vertex Tangent", "World Position", "Vertex Mirror", "Face Side", "UV0", "UV1", "UV Lightmap", "Project Depth", "Linear Depth", "Fragment Normal", "Fragment Tangent", "Fragment Binormal", "Base Color", "Diffuse Color", "Specular Color", "Transparency", "Metallic", "Roughness", "Specular Intensity", "IOR", "Direct Diffuse", "Direct Specular", "Direct All", "Env Diffuse", "Env Specular", "Env All", "Emissive", "Light Map", "Shadow", "AO", "Fresnel", "Direct Transmit Diffuse", "Direct Transmit Specular", "Env Transmit Diffuse", "Env Transmit Specular", "Transmit All", "Direct Internal Specular", "Env Internal Specular", "Internal All", "Fog"],
                            e.strComposite = ["Direct Diffuse", "Direct Specular", "Env Diffuse", "Env Specular", "Emissive", "Light Map", "Shadow", "AO", "Normal Map", "Fog", "Tone Mapping", "Gamma Correction", "Fresnel", "Transmit Diffuse", "Transmit Specular", "Internal Specular", "TT"],
                            e.strMisc = ["CSM Layer Coloration", "Lighting With Albedo"],
                            e.compositeModeToggleList = [],
                            e.singleModeToggleList = [],
                            e.miscModeToggleList = [],
                            e.textComponentList = [],
                            e.labelComponentList = [],
                            e.textContentList = [],
                            e.hideButtonLabel = void 0,
                            e._currentColorIndex = 0,
                            e.strColor = ["<color=#ffffff>", "<color=#000000>", "<color=#ff0000>", "<color=#00ff00>", "<color=#0000ff>"],
                            e.color = [c.WHITE, c.BLACK, c.RED, c.GREEN, c.BLUE],
                            e
                    }
                    o(e, t);
                    var s = e.prototype;
                    return s.start = function() {
                        if (this.node.parent.getComponent(a)) {
                            var t = this.node.parent.getComponent(g)
                                , e = .5 * t.width
                                , o = .5 * t.height
                                , i = .1 * e - e
                                , n = o - .1 * o
                                , s = this.node.getChildByName("MiscMode")
                                , l = h(s);
                            l.parent = this.node,
                                l.name = "Buttons";
                            var r = h(s);
                            r.parent = this.node,
                                r.name = "Titles";
                            for (var u = 0; u < 2; u++) {
                                var L = h(this.EnableAllCompositeModeButton.getChildByName("Label"));
                                L.setPosition(i + (u > 0 ? 450 : 150), n, 0),
                                    L.setScale(.75, .75, .75),
                                    L.parent = r;
                                var f = L.getComponent(p);
                                f.string = u ? "----------Composite Mode----------" : "----------Single Mode----------",
                                    f.color = c.WHITE,
                                    f.overflow = 0,
                                    this.labelComponentList[this.labelComponentList.length] = f
                            }
                            n -= 20;
                            for (var M = 0, b = 0; b < this.strSingle.length; b++,
                                M++) {
                                b === this.strSingle.length >> 1 && (i += 200,
                                    M = 0);
                                var v = b ? h(this.singleModeToggle) : this.singleModeToggle;
                                v.setPosition(i, n - 20 * M, 0),
                                    v.setScale(.5, .5, .5),
                                    v.parent = this.singleModeToggle.parent;
                                var T = v.getComponentInChildren(C);
                                T.string = this.strSingle[b],
                                    this.textComponentList[this.textComponentList.length] = T,
                                    this.textContentList[this.textContentList.length] = T.string,
                                    v.on(d.EventType.TOGGLE, this.toggleSingleMode, this),
                                    this.singleModeToggleList[b] = v
                            }
                            i += 200,
                                this.EnableAllCompositeModeButton.setPosition(i + 15, n, 0),
                                this.EnableAllCompositeModeButton.setScale(.5, .5, .5),
                                this.EnableAllCompositeModeButton.on(m.EventType.CLICK, this.enableAllCompositeMode, this),
                                this.EnableAllCompositeModeButton.parent = l;
                            var S = this.EnableAllCompositeModeButton.getComponentInChildren(p);
                            this.labelComponentList[this.labelComponentList.length] = S;
                            var x = h(this.EnableAllCompositeModeButton);
                            x.setPosition(i + 90, n, 0),
                                x.setScale(.5, .5, .5),
                                x.on(m.EventType.CLICK, this.changeTextColor, this),
                                x.parent = l,
                                (S = x.getComponentInChildren(p)).string = "TextColor",
                                this.labelComponentList[this.labelComponentList.length] = S;
                            var E = h(this.EnableAllCompositeModeButton);
                            E.setPosition(i + 200, n, 0),
                                E.setScale(.5, .5, .5),
                                E.on(m.EventType.CLICK, this.hideUI, this),
                                E.parent = this.node.parent,
                                (S = E.getComponentInChildren(p)).string = "Hide UI",
                                this.labelComponentList[this.labelComponentList.length] = S,
                                this.hideButtonLabel = S,
                                n -= 40;
                            for (var I = 0; I < this.strMisc.length; I++) {
                                var A = h(this.compositeModeToggle);
                                A.setPosition(i, n - 20 * I, 0),
                                    A.setScale(.5, .5, .5),
                                    A.parent = s;
                                var y = A.getComponentInChildren(C);
                                y.string = this.strMisc[I],
                                    this.textComponentList[this.textComponentList.length] = y,
                                    this.textContentList[this.textContentList.length] = y.string,
                                    A.getComponent(d).isChecked = !!I,
                                    A.on(d.EventType.TOGGLE, I ? this.toggleLightingWithAlbedo : this.toggleCSMColoration, this),
                                    this.miscModeToggleList[I] = A
                            }
                            n -= 150;
                            for (var D = 0; D < this.strComposite.length; D++) {
                                var B = D ? h(this.compositeModeToggle) : this.compositeModeToggle;
                                B.setPosition(i, n - 20 * D, 0),
                                    B.setScale(.5, .5, .5),
                                    B.parent = this.compositeModeToggle.parent;
                                var w = B.getComponentInChildren(C);
                                w.string = this.strComposite[D],
                                    this.textComponentList[this.textComponentList.length] = w,
                                    this.textContentList[this.textContentList.length] = w.string,
                                    B.on(d.EventType.TOGGLE, this.toggleCompositeMode, this),
                                    this.compositeModeToggleList[D] = B
                            }
                        } else
                            console.error("debug-view-runtime-control should be child of Canvas")
                    }
                        ,
                        s.isTextMatched = function(t, e) {
                            var o = new String(t)
                                , i = o.search(">");
                            return -1 === i ? t === e : (o = (o = o.substr(i + 1)).substr(0, o.search("<"))) === e
                        }
                        ,
                        s.toggleSingleMode = function(t) {
                            for (var e = u.root.debugView, o = t.getComponentInChildren(C), i = 0; i < this.strSingle.length; i++)
                                this.isTextMatched(o.string, this.strSingle[i]) && (e.singleMode = i)
                        }
                        ,
                        s.toggleCompositeMode = function(t) {
                            for (var e = u.root.debugView, o = t.getComponentInChildren(C), i = 0; i < this.strComposite.length; i++)
                                this.isTextMatched(o.string, this.strComposite[i]) && e.enableCompositeMode(i, t.isChecked)
                        }
                        ,
                        s.toggleLightingWithAlbedo = function(t) {
                            u.root.debugView.lightingWithAlbedo = t.isChecked
                        }
                        ,
                        s.toggleCSMColoration = function(t) {
                            u.root.debugView.csmLayerColoration = t.isChecked
                        }
                        ,
                        s.enableAllCompositeMode = function(t) {
                            var e = u.root.debugView;
                            e.enableAllCompositeMode(!0);
                            for (var o = 0; o < this.compositeModeToggleList.length; o++) {
                                this.compositeModeToggleList[o].getComponent(d).isChecked = !0
                            }
                            var i = this.miscModeToggleList[0].getComponent(d);
                            i.isChecked = !1,
                                e.csmLayerColoration = !1,
                                (i = this.miscModeToggleList[1].getComponent(d)).isChecked = !0,
                                e.lightingWithAlbedo = !0
                        }
                        ,
                        s.hideUI = function(t) {
                            var e = this.node.getChildByName("Titles")
                                , o = !e.active;
                            this.singleModeToggleList[0].parent.active = o,
                                this.miscModeToggleList[0].parent.active = o,
                                this.compositeModeToggleList[0].parent.active = o,
                                this.EnableAllCompositeModeButton.parent.active = o,
                                e.active = o,
                                this.hideButtonLabel.string = o ? "Hide UI" : "Show UI"
                        }
                        ,
                        s.changeTextColor = function(t) {
                            this._currentColorIndex++,
                            this._currentColorIndex >= this.strColor.length && (this._currentColorIndex = 0);
                            for (var e = 0; e < this.textComponentList.length; e++)
                                this.textComponentList[e].string = this.strColor[this._currentColorIndex] + this.textContentList[e] + "</color>";
                            for (var o = 0; o < this.labelComponentList.length; o++)
                                this.labelComponentList[o].color = this.color[this._currentColorIndex]
                        }
                        ,
                        s.onLoad = function() {}
                        ,
                        s.update = function(t) {}
                        ,
                        e
                }(L)).prototype, "compositeModeToggle", [M], {
                    configurable: !0,
                    enumerable: !0,
                    writable: !0,
                    initializer: function() {
                        return null
                    }
                }),
                    E = e(S.prototype, "singleModeToggle", [b], {
                        configurable: !0,
                        enumerable: !0,
                        writable: !0,
                        initializer: function() {
                            return null
                        }
                    }),
                    I = e(S.prototype, "EnableAllCompositeModeButton", [v], {
                        configurable: !0,
                        enumerable: !0,
                        writable: !0,
                        initializer: function() {
                            return null
                        }
                    }),
                    T = S)) || T));
                s._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/Decorator.ts", ["cc"], (function(e) {
        var t, c;
        return {
            setters: [function(e) {
                t = e.cclegacy,
                    c = e._decorator
            }
            ],
            execute: function() {
                t._RF.push({}, "5cd89Uo/2ZInZQ4s6GcJ/Kg", "Decorator", void 0);
                e("ccclass", c.ccclass),
                    e("property", c.property),
                    e("requireComponent", c.requireComponent),
                    e("disallowMultiple", c.disallowMultiple),
                    e("executeInEditMode", c.executeInEditMode);
                t._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/HTMLRichText.ts", ["./rollupPluginModLoBabelHelpers.js", "cc", "./index.ts", "./RichTextParser.ts", "./Decorator.ts"], (function(t) {
        var e, i, s, r, c, n, o, a, h, l, _, x, u, m, d, f, p, g;
        return {
            setters: [function(t) {
                e = t.applyDecoratedDescriptor,
                    i = t.inheritsLoose,
                    s = t.createClass,
                    r = t.initializerDefineProperty,
                    c = t.assertThisInitialized
            }
                , function(t) {
                    n = t.cclegacy,
                        o = t.Sprite,
                        a = t.CCString,
                        h = t.SpriteFrame,
                        l = t.UITransform,
                        _ = t.assetManager,
                        x = t.ImageAsset,
                        u = t.Component
                }
                , null, function(t) {
                    m = t.RichTextParser
                }
                , function(t) {
                    d = t.ccclass,
                        f = t.requireComponent,
                        p = t.executeInEditMode,
                        g = t.property
                }
            ],
            execute: function() {
                var v, y, w, b, k, T, S, L, C, D;
                n._RF.push({}, "cdc7diQhR5L4pxKcVSpeV1+", "HTMLRichText", void 0);
                t("HTMLRichText", (v = d("HTMLRichText"),
                    y = f(o),
                    w = p(!0),
                    b = g({
                        displayName: "开启调试绘制"
                    }),
                    k = g({
                        type: o,
                        displayName: "富文本精灵"
                    }),
                    T = g({
                        type: a,
                        displayName: "富文本内容（XML）",
                        multiline: !0
                    }),
                v(S = y(S = w((C = e((L = function(t) {
                    function e() {
                        for (var e, i = arguments.length, s = new Array(i), n = 0; n < i; n++)
                            s[n] = arguments[n];
                        return (e = t.call.apply(t, [this].concat(s)) || this)._parser = void 0,
                            e._canvas = void 0,
                            e._ctx = void 0,
                            e._commentBox = void 0,
                            e._customNodes = void 0,
                            r(e, "_debugDraw", C, c(e)),
                            r(e, "_content", D, c(e)),
                            e
                    }
                    i(e, t);
                    var n = e.prototype;
                    return n.onLoad = function() {
                        this._customNodes = [],
                            this._parser = new m,
                            this._canvas = document.createElement("canvas"),
                            this._commentBox = new P(this)
                    }
                        ,
                        n.start = function() {
                            this.content = this._content
                        }
                        ,
                        n.clear = function() {
                            var t;
                            this._ctx = null != (t = this._ctx) ? t : this._canvas.getContext("2d"),
                                this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height),
                                this.texture.spriteFrame = null
                        }
                        ,
                        n.draw = function() {
                            var t, e = this;
                            if (this._parser.error)
                                this.clear();
                            else {
                                for (var i = [], s = [], r = this._parser, c = r.children, n = r.style, o = n.space, a = o[0], u = o[1], m = n.margin, d = m[0], f = m[1], p = m[2], g = m[3], v = 0, y = 0, w = 0, b = 0; b < c.length; b++) {
                                    var k, T = c[b];
                                    if ("newline" === T.type)
                                        w = n.rowHeight,
                                            y = 0,
                                            ++v;
                                    else {
                                        var S = T.size
                                            , L = S[0]
                                            , C = S[1];
                                        y + L > n.maxWidth ? (y = L + a,
                                            w = C,
                                            ++v) : (y += L + a,
                                            w = Math.max(w, C)),
                                            T.row = v
                                    }
                                    s[v] = Math.max(n.rowHeight, w),
                                        i[v] = null != (k = i[v]) ? k : [],
                                        i[v].push(T)
                                }
                                var D = n.maxWidth
                                    , P = d + p + D
                                    , R = s.reduce((function(t, e) {
                                        return t + e
                                    }
                                ), 0) + (s.length - 1) * u
                                    , M = f + g + R;
                                this._canvas.width = P,
                                    this._canvas.height = M,
                                    this._ctx = this._canvas.getContext("2d"),
                                    this._ctx.font = n.font,
                                    this._ctx.fillStyle = n.fillColor,
                                    this._ctx.strokeStyle = n.strokeColor,
                                    this._ctx.lineWidth = n.lineWeight,
                                    this._ctx.textBaseline = "bottom",
                                    this._ctx.clearRect(0, 0, P, M),
                                    this._ctx.save(),
                                    this._ctx.fillStyle = n.background,
                                    this._ctx.fillRect(0, 0, P, M),
                                    this._ctx.restore(),
                                    this._ctx.translate(d, f),
                                    this._commentBox.clear();
                                for (var W = 0; W < i.length; W++) {
                                    for (var z = i[W], B = 0, H = s.slice(0, W + 1).reduce((function(t, e) {
                                            return t + e
                                        }
                                    ), 0) + W * u, N = s[W], O = function() {
                                        var t = z[I]
                                            , i = t.size
                                            , s = i[0]
                                            , r = i[1]
                                            , c = 0;
                                        switch ("top" === n.align ? c = N - r : "center" === n.align && (c = (N - r) / 2),
                                            t.type) {
                                            case "text":
                                                e._ctx.save(),
                                                    e._ctx.font = t.font;
                                                var o = t.shadow
                                                    , h = o[0]
                                                    , l = o[1]
                                                    , u = o[2];
                                                t.outline[0] > 0 && (e._ctx.lineWidth = t.outline[0],
                                                    e._ctx.strokeStyle = t.outline[1],
                                                    e._ctx.strokeText(t.text, B, H - c)),
                                                    [h, l, u].every((function(t) {
                                                            return 0 === t
                                                        }
                                                    )) ? (e._ctx.fillStyle = t.color,
                                                        e._ctx.fillText(t.text, B, H - c)) : (e._ctx.fillStyle = t.color,
                                                        e._ctx.shadowOffsetX = t.shadow[0],
                                                        e._ctx.shadowOffsetY = t.shadow[1],
                                                        e._ctx.shadowBlur = t.shadow[2],
                                                        e._ctx.shadowColor = t.shadow[3],
                                                        e._ctx.fillText(t.text, B, H - c)),
                                                    e._ctx.restore(),
                                                    "none" !== t.comment[0] ? e._commentBox.enter(t, B, H, c, N) : e._commentBox.exit(),
                                                    B += s + a;
                                                break;
                                            case "image":
                                                var m = _.assets.get(t.uuid);
                                                m && m instanceof x && (e._ctx.drawImage(m.data, B, H - N - c, s, r),
                                                    B += s + a);
                                                break;
                                            case "outer":
                                                var d = e[t.callback];
                                                if ("function" == typeof d) {
                                                    var f = B
                                                        , p = H
                                                        , g = N
                                                        , v = t.size;
                                                    e._customNodes.push((function() {
                                                            return d.call(e, f, p, g, v)
                                                        }
                                                    ))
                                                }
                                                B += s + a
                                        }
                                    }, I = 0; I < z.length; I++)
                                        O();
                                    this._commentBox.exit(),
                                    this.debugDraw && (this._ctx.save(),
                                        this._ctx.beginPath(),
                                        this._ctx.strokeStyle = "#8888886f",
                                        this._ctx.lineWidth = 1,
                                        this._ctx.rect(0, H - N, n.maxWidth, N),
                                        this._ctx.stroke(),
                                        this._ctx.restore())
                                }
                                this.debugDraw && (this._ctx.save(),
                                    this._ctx.beginPath(),
                                    this._ctx.strokeStyle = "#ef7a826f",
                                    this._ctx.lineWidth = 2,
                                    this._ctx.rect(0, 0, D, R),
                                    this._ctx.stroke(),
                                    this._ctx.restore()),
                                    this.texture.spriteFrame = h.createWithImage(this._canvas),
                                null == (t = this.texture.node.getComponent(l)) || t.setContentSize(P, M),
                                    this._customNodes.forEach((function(t) {
                                            return t.call(e)
                                        }
                                    )),
                                    this._customNodes.length = 0
                            }
                        }
                        ,
                        n.drawComment = function(t, e, i, s, r, c, n, o, a) {
                            var h;
                            this._ctx.save();
                            var l = r + i - n;
                            switch (t) {
                                case "underline":
                                    this._ctx.strokeStyle = e,
                                        this._ctx.lineWidth = i,
                                        this._ctx.beginPath(),
                                        this._ctx.moveTo(s, l),
                                        this._ctx.lineTo(c, l),
                                        this._ctx.stroke();
                                    break;
                                case "strikeout":
                                    this._ctx.strokeStyle = e,
                                        this._ctx.lineWidth = i,
                                        this._ctx.beginPath(),
                                        this._ctx.moveTo(s, l - a / 2),
                                        this._ctx.lineTo(c, l - a / 2),
                                        this._ctx.stroke();
                                    break;
                                case "highlight":
                                    this._ctx.fillStyle = e,
                                        this._ctx.beginPath(),
                                        this._ctx.fillRect(s, l - a, c - s, a);
                                    break;
                                case "waveline":
                                    this._ctx.beginPath(),
                                        this._ctx.lineWidth = i,
                                        this._ctx.strokeStyle = e;
                                    var _ = Math.round((c - s) / 14);
                                    this._ctx.moveTo(s, l);
                                    for (var x = 0; x < _; x++)
                                        s += 14,
                                            this._ctx.quadraticCurveTo(s - 7, l - 2.5 * i, s, l);
                                    this._ctx.stroke();
                                    break;
                                case "rect":
                                    this._ctx.beginPath(),
                                        this._ctx.lineWidth = i,
                                        this._ctx.strokeStyle = e,
                                        this._ctx.strokeRect(s, l - a, c - s, a);
                                    break;
                                case "roundrect":
                                    this._ctx.beginPath(),
                                        this._ctx.lineWidth = i,
                                        this._ctx.strokeStyle = e;
                                    var u = Math.max(2, Math.min(10, Math.round(.15 * a)));
                                    (null != (h = this._ctx.roundRect) ? h : this._ctx.rect).call(this._ctx, s, l - a, c - s, a, u),
                                        this._ctx.stroke()
                            }
                            this._ctx.restore()
                        }
                        ,
                        s(e, [{
                            key: "debugDraw",
                            get: function() {
                                return this._debugDraw
                            },
                            set: function(t) {
                                this._debugDraw = t,
                                    this.content = this._content
                            }
                        }, {
                            key: "texture",
                            get: function() {
                                return this.getComponent(o)
                            }
                        }, {
                            key: "content",
                            get: function() {
                                return this._content
                            },
                            set: function(t) {
                                this._content = t,
                                    0 === t.length ? this.clear() : (this._parser.parse(t),
                                        this.draw())
                            }
                        }]),
                        e
                }(u)).prototype, "_debugDraw", [g], {
                    configurable: !0,
                    enumerable: !0,
                    writable: !0,
                    initializer: function() {
                        return !1
                    }
                }),
                    e(L.prototype, "debugDraw", [b], Object.getOwnPropertyDescriptor(L.prototype, "debugDraw"), L.prototype),
                    e(L.prototype, "texture", [k], Object.getOwnPropertyDescriptor(L.prototype, "texture"), L.prototype),
                    D = e(L.prototype, "_content", [g], {
                        configurable: !0,
                        enumerable: !0,
                        writable: !0,
                        initializer: function() {
                            return ""
                        }
                    }),
                    e(L.prototype, "content", [T], Object.getOwnPropertyDescriptor(L.prototype, "content"), L.prototype),
                    S = L)) || S) || S) || S));
                var P = function() {
                    function t(t) {
                        this._commentList = void 0,
                            this._richText = t,
                            this._commentList = []
                    }
                    var e = t.prototype;
                    return e.enter = function(t, e, i, s, r) {
                        this._commentList.length > 0 && this._commentList[0].comment.every((function(e, i) {
                                return e === t.comment[i]
                            }
                        )) || this.exit(),
                            this._commentList.push({
                                size: t.size,
                                comment: t.comment,
                                startX: e,
                                startY: i,
                                offsetY: s,
                                rowHeight: r
                            })
                    }
                        ,
                        e.exit = function() {
                            if (this._commentList.length > 0) {
                                var t = this._commentList[0]
                                    , e = t.startX
                                    , i = t.startY
                                    , s = t.offsetY
                                    , r = t.rowHeight
                                    , c = this._commentList[0].comment
                                    , n = c[0]
                                    , o = c[1]
                                    , a = c[2]
                                    , h = this._commentList.slice()
                                    , l = h[h.length - 1]
                                    , _ = l.size
                                    , x = _[0]
                                    , u = _[1]
                                    , m = l.startX + x;
                                this._richText.drawComment(n, o, a, e, i, m, s, r, u)
                            }
                            this.clear()
                        }
                        ,
                        e.clear = function() {
                            this._commentList.length = 0
                        }
                        ,
                        t
                }();
                n._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/HTMLRichTextDemo.ts", ["./rollupPluginModLoBabelHelpers.js", "cc", "./index.ts", "./HTMLRichText.ts", "./Decorator.ts"], (function(e) {
        var t, i, o, r, n, l, c, a, s, h, u, p, g, d;
        return {
            setters: [function(e) {
                t = e.applyDecoratedDescriptor,
                    i = e.inheritsLoose,
                    o = e.initializerDefineProperty,
                    r = e.assertThisInitialized
            }
                , function(e) {
                    n = e.cclegacy,
                        l = e.Node,
                        c = e.Toggle,
                        a = e.resources,
                        s = e.ImageAsset,
                        h = e.UITransform
                }
                , null, function(e) {
                    u = e.HTMLRichText
                }
                , function(e) {
                    p = e.ccclass,
                        g = e.executeInEditMode,
                        d = e.property
                }
            ],
            execute: function() {
                var f, T, m, y, x, v, D, L;
                n._RF.push({}, "64c83jPmTVEeKK5TGL420xC", "HTMLRichTextDemo", void 0);
                e("HTMLRichTextDemo", (f = p("HTMLRichTextDemo"),
                    T = g(!0),
                    m = d(l),
                    y = d(c),
                f(x = T((D = t((v = function(e) {
                    function t() {
                        for (var t, i = arguments.length, n = new Array(i), l = 0; l < i; l++)
                            n[l] = arguments[l];
                        return t = e.call.apply(e, [this].concat(n)) || this,
                            o(t, "placeholder", D, r(t)),
                            o(t, "toggle", L, r(t)),
                            t
                    }
                    i(t, e);
                    var n = t.prototype;
                    return n.onToggle = function() {
                        this.debugDraw = this.toggle.isChecked
                    }
                        ,
                        n.start = function() {
                            var t = this;
                            a.load("image/gold", s, (function(i) {
                                    if (i)
                                        return console.error(i);
                                    e.prototype.start.call(t)
                                }
                            ))
                        }
                        ,
                        n.insertEmojiAnimation = function(e, t, i, o) {
                            var r = this._canvas
                                , n = r.width
                                , l = r.height
                                , c = this._parser.style.margin
                                , a = c[0]
                                , s = c[1]
                                , u = o[0]
                                , p = o[1]
                                , g = -n / 2
                                , d = -l / 2
                                , f = e + a
                                , T = l - t - s
                                , m = this.placeholder.getComponent(h)
                                , y = m.width
                                , x = m.height
                                , v = m.anchorPoint
                                , D = {
                                x: f + g + u / 2 + (.5 - v.x) * y,
                                y: T + d + p / 2 + (.5 - v.y) * x - 15
                            };
                            this.placeholder.setPosition(D.x, D.y, 0),
                                this.placeholder.setScale(.5, .5, 1)
                        }
                        ,
                        t
                }(u)).prototype, "placeholder", [m], {
                    configurable: !0,
                    enumerable: !0,
                    writable: !0,
                    initializer: null
                }),
                    L = t(v.prototype, "toggle", [y], {
                        configurable: !0,
                        enumerable: !0,
                        writable: !0,
                        initializer: null
                    }),
                    x = v)) || x) || x));
                n._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/index.ts", ["cc", "./Arrays.ts", "./Numbers.ts", "./Decorator.ts"], (function(e) {
        var t;
        return {
            setters: [function(e) {
                t = e.cclegacy
            }
                , function(t) {
                    e("Arrays", t.Arrays)
                }
                , function(t) {
                    e("Numbers", t.Numbers)
                }
                , function(t) {
                    var r = {};
                    r.ccclass = t.ccclass,
                        r.disallowMultiple = t.disallowMultiple,
                        r.executeInEditMode = t.executeInEditMode,
                        r.property = t.property,
                        r.requireComponent = t.requireComponent,
                        e(r)
                }
            ],
            execute: function() {
                t._RF.push({}, "f411cnuoMZJOptoi4Z5bMn1", "index", void 0),
                    t._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/main", ["./debug-view-runtime-control.ts", "./HTMLRichTextDemo.ts", "./Arrays.ts", "./Decorator.ts", "./Numbers.ts", "./index.ts", "./HTMLRichText.ts", "./RichTextParser.ts", "./RichTextStyle.ts"], (function() {
        return {
            setters: [null, null, null, null, null, null, null, null, null],
            execute: function() {}
        }
    }
));

System.register("chunks:///_virtual/Numbers.ts", ["cc"], (function(t) {
        var e;
        return {
            setters: [function(t) {
                e = t.cclegacy
            }
            ],
            execute: function() {
                e._RF.push({}, "35a3fkgc51MELLyQmCddHHs", "Numbers", void 0);
                t("Numbers", function() {
                    function t() {}
                    return t.toInteger = function(t, e) {
                        var n = parseInt(t);
                        return isNaN(n) ? Math.floor(e) : n
                    }
                        ,
                        t
                }());
                e._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/RichTextParser.ts", ["./rollupPluginModLoBabelHelpers.js", "cc", "./index.ts", "./Numbers.ts", "./Arrays.ts"], (function(t) {
        var e, i, r, s;
        return {
            setters: [function(t) {
                e = t.createClass
            }
                , function(t) {
                    i = t.cclegacy
                }
                , null, function(t) {
                    r = t.Numbers
                }
                , function(t) {
                    s = t.Arrays
                }
            ],
            execute: function() {
                i._RF.push({}, "f07af5woUFFX4LiwHnE5AI9", "RichTextParser", void 0);
                var n = t("RichTextParser", function() {
                    function t() {
                        this.style = void 0,
                            this.children = void 0,
                            this._error = void 0,
                            this.canvas = void 0,
                            this.ctx = void 0,
                            this.canvas = document.createElement("canvas"),
                            this.ctx = this.canvas.getContext("2d"),
                            this.style = {},
                            this.children = []
                    }
                    var i = t.prototype;
                    return i.parse = function(t) {
                        var e = this;
                        this.children.length = 0,
                            this._error = !1;
                        var i = (new DOMParser).parseFromString(t, "application/xml");
                        if (i.querySelector("parsererror"))
                            return this._error = !0,
                                void console.error("富文本解析错误");
                        this.parseRoot(i.documentElement),
                            i.documentElement.childNodes.forEach((function(t) {
                                    return e.parseChild(t)
                                }
                            ))
                    }
                        ,
                        i.parseRoot = function(t) {
                            this.style.maxWidth = this.parseAttribute(t, "maxWidth", 100),
                                this.style.margin = this.parseAttribute(t, "margin", [0, 0, 0, 0]),
                                this.style.space = this.parseAttribute(t, "space", [0, 0]),
                                this.style.align = this.parseAttribute(t, "align", "bottom"),
                                this.style.font = this.parseAttribute(t, "font", "14px Arial"),
                                this.style.rowHeight = this.parseAttribute(t, "rowHeight", 16),
                                this.style.lineWeight = this.parseAttribute(t, "lineWeight", 2),
                                this.style.background = this.parseAttribute(t, "background", "#00000000"),
                                this.style.fillColor = this.parseAttribute(t, "fillColor", "#000"),
                                this.style.strokeColor = this.parseAttribute(t, "strokeColor", "#000"),
                                this.ctx.font = this.style.font,
                                this.ctx.fillStyle = this.style.fillColor,
                                this.ctx.strokeStyle = this.style.strokeColor,
                                this.ctx.lineWidth = this.style.lineWeight
                        }
                        ,
                        i.parseChild = function(t) {
                            var e = this;
                            if (t instanceof Element)
                                switch (t.nodeName) {
                                    case "newline":
                                        this.children.push({
                                            type: "newline",
                                            size: [0, this.style.rowHeight]
                                        });
                                        break;
                                    case "blankline":
                                        this.children.push({
                                            type: "blankline",
                                            size: [this.style.maxWidth, this.style.rowHeight]
                                        });
                                        break;
                                    case "text":
                                        var i = this.parseAttribute(t, "value", void 0);
                                        if (i && i.length > 0) {
                                            var r = this.parseAttribute(t, "font", this.style.font)
                                                , s = this.parseAttribute(t, "color", this.style.fillColor)
                                                , n = this.parseAttribute(t, "outline", [0, "#fff"])
                                                , o = this.parseAttribute(t, "shadow", [0, 0, 0, "#fff"])
                                                , a = this.parseAttribute(t, "comment", ["none", "#f00", 2]);
                                            i.split(/(?=(?:[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]))/).forEach((function(t) {
                                                    e.ctx.font = r,
                                                        e.ctx.beginPath(),
                                                    n[0] > 0 && (e.ctx.lineWidth = n[0],
                                                        e.ctx.strokeStyle = s),
                                                        e.ctx.strokeStyle = n[1],
                                                        e.ctx.shadowOffsetX = o[0],
                                                        e.ctx.shadowOffsetY = o[1],
                                                        e.ctx.shadowBlur = o[2],
                                                        e.ctx.shadowColor = o[3];
                                                    var i = e.ctx.measureText(t)
                                                        , l = Math.max(i.width, i.actualBoundingBoxLeft + i.actualBoundingBoxRight)
                                                        , h = i.fontBoundingBoxAscent + i.fontBoundingBoxDescent;
                                                    e.children.push({
                                                        type: "text",
                                                        row: 0,
                                                        font: r,
                                                        color: s,
                                                        shadow: o,
                                                        outline: n,
                                                        comment: a,
                                                        text: t,
                                                        size: [l, h],
                                                        metrics: i
                                                    })
                                                }
                                            ))
                                        }
                                        break;
                                    case "image":
                                        var l = this.parseAttribute(t, "uuid", void 0)
                                            , h = this.parseAttribute(t, "size", [0, 0]);
                                        if (l && l.length > 0 && h.every((function(t) {
                                                return t > 0
                                            }
                                        ))) {
                                            var u = {
                                                type: "image",
                                                row: 0,
                                                uuid: l,
                                                size: h
                                            };
                                            this.children.push(u)
                                        }
                                        break;
                                    case "outer":
                                        var c = this.parseAttribute(t, "size", [0, 0]);
                                        if (c.every((function(t) {
                                                return t > 0
                                            }
                                        ))) {
                                            var f = t.getAttribute("callback");
                                            this.children.push({
                                                type: "outer",
                                                row: 0,
                                                size: c,
                                                callback: f
                                            })
                                        }
                                }
                        }
                        ,
                        i.parseAttribute = function(e, i, n) {
                            var o, a, l = e.getAttribute(i);
                            if (null === l)
                                return n;
                            var h = n;
                            switch (i) {
                                case "maxWidth":
                                case "rowHeight":
                                    h = r.toInteger(l, n);
                                    break;
                                case "margin":
                                    var u = l.split(",").map((function(t) {
                                            return r.toInteger(t, 0)
                                        }
                                    ));
                                    h = s.fill(u, 4, 0);
                                    break;
                                case "align":
                                    s.contains(t.Alignment, l) && (h = l);
                                    break;
                                case "space":
                                    var c = l.split(",").map((function(t) {
                                            return r.toInteger(t, 0)
                                        }
                                    ));
                                    h = s.fill(c, 2, 0);
                                    break;
                                case "shadow":
                                    var f = l.split(",")
                                        , p = f[0]
                                        , d = f[1]
                                        , g = f[2]
                                        , b = f[3];
                                    h = [r.toInteger(p, n[0]), r.toInteger(d, n[1]), r.toInteger(g, n[2]), null != b ? b : n[3]];
                                    break;
                                case "comment":
                                    var m = l.split(",")
                                        , y = m[0]
                                        , v = m[1]
                                        , x = m[2]
                                        , A = null != y ? y : n[0]
                                        , k = null != v ? v : n[1]
                                        , F = r.toInteger(x, n[2]);
                                    s.contains(t.CommentStyle, A) || (A = "none"),
                                        h = [A, k, F];
                                    break;
                                case "size":
                                    var w = l.split(",").map((function(t, e) {
                                            return r.toInteger(t, n[e])
                                        }
                                    ));
                                    h = s.fill(w, 2, 0);
                                    break;
                                case "outline":
                                    var C = l.split(",")
                                        , D = C[0]
                                        , B = C[1];
                                    h = [D = null != (o = D) ? o : n[0], B = null != (a = B) ? a : n[1]];
                                    break;
                                default:
                                    h = l
                            }
                            return h
                        }
                        ,
                        e(t, [{
                            key: "error",
                            get: function() {
                                return this._error
                            }
                        }]),
                        t
                }());
                n.CommentStyle = ["none", "underline", "waveline", "highlight", "strikeout", "rect", "roundrect"],
                    n.Alignment = ["top", "bottom", "center"],
                    i._RF.pop()
            }
        }
    }
));

System.register("chunks:///_virtual/RichTextStyle.ts", ["cc"], (function() {
        var t;
        return {
            setters: [function(e) {
                t = e.cclegacy
            }
            ],
            execute: function() {
                t._RF.push({}, "c3d24Inx+JIoKWMU58zmNpS", "RichTextStyle", void 0),
                    t._RF.pop()
            }
        }
    }
));
