{"version":3,"sources":["jsdelivr-header.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/Utils.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/BounceOutMode.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/DestroyOutMode.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/NoneOutMode.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/OutOutMode.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/OutOfCanvasUpdater.js","/npm/@tsparticles/updater-out-modes@3.0.3/browser/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,4KCLO,SAAS,EAAiB,EAAM,CACnC,GAAK,EAAK,UAAY,UAClB,EAAK,UAAY,qBACjB,EAAK,UAAY,oBACjB,EAAK,UAAY,SAChB,EAAK,YAAc,QAAU,EAAK,YAAc,QACjD,OAEA,EAAK,OAAO,MAAQ,GAAK,EAAK,YAAc,OAC5C,EAAK,SAAS,SAAS,EAAI,EAAK,KAAO,EAAK,OAAO,EAE9C,EAAK,OAAO,KAAO,EAAK,WAAW,OAAS,EAAK,YAAc,UACpE,EAAK,SAAS,SAAS,EAAI,EAAK,WAAW,MAAQ,EAAK,KAAO,EAAK,OAAO,GAE/E,MAAM,EAAW,EAAK,SAAS,SAAS,EACxC,IAAI,EAAU,GACd,GAAK,EAAK,YAAc,SAAW,EAAK,OAAO,OAAS,EAAK,WAAW,OAAS,EAAW,GACvF,EAAK,YAAc,QAAU,EAAK,OAAO,MAAQ,GAAK,EAAW,EAAI,CACtE,MAAM,EAAc,EAAc,EAAK,SAAS,QAAQ,OAAO,WAAW,KAAK,EAC/E,EAAK,SAAS,SAAS,GAAK,CAAC,EAC7B,EAAU,EACd,CACA,GAAI,CAAC,EACD,OAEJ,MAAM,EAAS,EAAK,OAAO,EAAI,EAAK,KAChC,EAAK,OAAO,OAAS,EAAK,WAAW,OAAS,EAAK,YAAc,QACjE,EAAK,SAAS,SAAS,EAAI,EAAK,WAAW,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E1C,IAAc,OAAS,EAAW,OAAS,CAAC,EAAS,OAAO,IAC5D,IACD,EAAS,SAAS,EAAI,EAAS,EAAK,EAAW,MAC/C,EAAS,gBAAgB,EAAI,EAAS,SAAS,GAEnD,EAAS,SAAS,EAAI,EAAO,OAC7B,EAAS,gBAAgB,EAAI,EAAS,SAAS,GAEnD,KACJ,CACpB,CACgB,KACJ,CACZ,CACI,CACJ,CCtGO,MAAM,CAAmB,CAC5B,YAAY,EAAW,CACnB,KAAK,UAAY,EACjB,KAAK,eAAiB,CAAC,EAAU,EAAO,EAAS,IAAc,CAC3D,UAAW,KAAW,KAAK,SACvB,EAAQ,OAAO,EAAU,EAAW,EAAO,CAAO,CAE1D,EACA,KAAK,SAAW,CACZ,IAAI,EAAc,CAAS,EAC3B,IAAI,EAAe,CAAS,EAC5B,IAAI,EAAW,CAAS,EACxB,IAAI,EAAY,CAAS,CACrC,CACI,CACA,MAAO,CACP,CACA,UAAU,EAAU,CAChB,MAAO,CAAC,EAAS,WAAa,CAAC,EAAS,QAC5C,CACA,OAAO,EAAU,EAAO,CACpB,MAAM,EAAW,EAAS,QAAQ,KAAK,SACvC,KAAK,eAAe,EAAU,EAAO,EAAS,QAAU,EAAS,QAAS,QAAQ,EAClF,KAAK,eAAe,EAAU,EAAO,EAAS,MAAQ,EAAS,QAAS,MAAM,EAC9E,KAAK,eAAe,EAAU,EAAO,EAAS,OAAS,EAAS,QAAS,OAAO,EAChF,KAAK,eAAe,EAAU,EAAO,EAAS,KAAO,EAAS,QAAS,KAAK,CAChF,CACJ,CC9BO,eAAe,EAAoB,EAAQ,EAAU,GAAM,CAC9D,MAAM,EAAO,mBAAmB,WAAa,GAAc,IAAI,EAAmB,CAAS,EAAG,CAAO,CACzG","file":"/npm/@tsparticles/updater-out-modes@3.0.3/browser/index.js/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/@tsparticles/updater-out-modes@3.0.3/browser/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { getRangeValue } from \"@tsparticles/engine\";\nexport function bounceHorizontal(data) {\n    if ((data.outMode !== \"bounce\" &&\n        data.outMode !== \"bounce-horizontal\" &&\n        data.outMode !== \"bounceHorizontal\" &&\n        data.outMode !== \"split\") ||\n        (data.direction !== \"left\" && data.direction !== \"right\")) {\n        return;\n    }\n    if (data.bounds.right < 0 && data.direction === \"left\") {\n        data.particle.position.x = data.size + data.offset.x;\n    }\n    else if (data.bounds.left > data.canvasSize.width && data.direction === \"right\") {\n        data.particle.position.x = data.canvasSize.width - data.size - data.offset.x;\n    }\n    const velocity = data.particle.velocity.x;\n    let bounced = false;\n    if ((data.direction === \"right\" && data.bounds.right >= data.canvasSize.width && velocity > 0) ||\n        (data.direction === \"left\" && data.bounds.left <= 0 && velocity < 0)) {\n        const newVelocity = getRangeValue(data.particle.options.bounce.horizontal.value);\n        data.particle.velocity.x *= -newVelocity;\n        bounced = true;\n    }\n    if (!bounced) {\n        return;\n    }\n    const minPos = data.offset.x + data.size;\n    if (data.bounds.right >= data.canvasSize.width && data.direction === \"right\") {\n        data.particle.position.x = data.canvasSize.width - minPos;\n    }\n    else if (data.bounds.left <= 0 && data.direction === \"left\") {\n        data.particle.position.x = minPos;\n    }\n    if (data.outMode === \"split\") {\n        data.particle.destroy();\n    }\n}\nexport function bounceVertical(data) {\n    if ((data.outMode !== \"bounce\" &&\n        data.outMode !== \"bounce-vertical\" &&\n        data.outMode !== \"bounceVertical\" &&\n        data.outMode !== \"split\") ||\n        (data.direction !== \"bottom\" && data.direction !== \"top\")) {\n        return;\n    }\n    if (data.bounds.bottom < 0 && data.direction === \"top\") {\n        data.particle.position.y = data.size + data.offset.y;\n    }\n    else if (data.bounds.top > data.canvasSize.height && data.direction === \"bottom\") {\n        data.particle.position.y = data.canvasSize.height - data.size - data.offset.y;\n    }\n    const velocity = data.particle.velocity.y;\n    let bounced = false;\n    if ((data.direction === \"bottom\" && data.bounds.bottom >= data.canvasSize.height && velocity > 0) ||\n        (data.direction === \"top\" && data.bounds.top <= 0 && velocity < 0)) {\n        const newVelocity = getRangeValue(data.particle.options.bounce.vertical.value);\n        data.particle.velocity.y *= -newVelocity;\n        bounced = true;\n    }\n    if (!bounced) {\n        return;\n    }\n    const minPos = data.offset.y + data.size;\n    if (data.bounds.bottom >= data.canvasSize.height && data.direction === \"bottom\") {\n        data.particle.position.y = data.canvasSize.height - minPos;\n    }\n    else if (data.bounds.top <= 0 && data.direction === \"top\") {\n        data.particle.position.y = minPos;\n    }\n    if (data.outMode === \"split\") {\n        data.particle.destroy();\n    }\n}\n","import { calculateBounds, } from \"@tsparticles/engine\";\nimport { bounceHorizontal, bounceVertical } from \"./Utils.js\";\nexport class BounceOutMode {\n    constructor(container) {\n        this.container = container;\n        this.modes = [\n            \"bounce\",\n            \"bounce-vertical\",\n            \"bounce-horizontal\",\n            \"bounceVertical\",\n            \"bounceHorizontal\",\n            \"split\",\n        ];\n    }\n    update(particle, direction, delta, outMode) {\n        if (!this.modes.includes(outMode)) {\n            return;\n        }\n        const container = this.container;\n        let handled = false;\n        for (const [, plugin] of container.plugins) {\n            if (plugin.particleBounce !== undefined) {\n                handled = plugin.particleBounce(particle, delta, direction);\n            }\n            if (handled) {\n                break;\n            }\n        }\n        if (handled) {\n            return;\n        }\n        const pos = particle.getPosition(), offset = particle.offset, size = particle.getRadius(), bounds = calculateBounds(pos, size), canvasSize = container.canvas.size;\n        bounceHorizontal({ particle, outMode, direction, bounds, canvasSize, offset, size });\n        bounceVertical({ particle, outMode, direction, bounds, canvasSize, offset, size });\n    }\n}\n","import { Vector, getDistances, isPointInside, } from \"@tsparticles/engine\";\nexport class DestroyOutMode {\n    constructor(container) {\n        this.container = container;\n        this.modes = [\"destroy\"];\n    }\n    update(particle, direction, _delta, outMode) {\n        if (!this.modes.includes(outMode)) {\n            return;\n        }\n        const container = this.container;\n        switch (particle.outType) {\n            case \"normal\":\n            case \"outside\":\n                if (isPointInside(particle.position, container.canvas.size, Vector.origin, particle.getRadius(), direction)) {\n                    return;\n                }\n                break;\n            case \"inside\": {\n                const { dx, dy } = getDistances(particle.position, particle.moveCenter);\n                const { x: vx, y: vy } = particle.velocity;\n                if ((vx < 0 && dx > particle.moveCenter.radius) ||\n                    (vy < 0 && dy > particle.moveCenter.radius) ||\n                    (vx >= 0 && dx < -particle.moveCenter.radius) ||\n                    (vy >= 0 && dy < -particle.moveCenter.radius)) {\n                    return;\n                }\n                break;\n            }\n        }\n        container.particles.remove(particle, undefined, true);\n    }\n}\n","import { Vector, isPointInside, } from \"@tsparticles/engine\";\nexport class NoneOutMode {\n    constructor(container) {\n        this.container = container;\n        this.modes = [\"none\"];\n    }\n    update(particle, direction, delta, outMode) {\n        if (!this.modes.includes(outMode)) {\n            return;\n        }\n        if ((particle.options.move.distance.horizontal &&\n            (direction === \"left\" || direction === \"right\")) ||\n            (particle.options.move.distance.vertical &&\n                (direction === \"top\" || direction === \"bottom\"))) {\n            return;\n        }\n        const gravityOptions = particle.options.move.gravity, container = this.container;\n        const canvasSize = container.canvas.size;\n        const pRadius = particle.getRadius();\n        if (!gravityOptions.enable) {\n            if ((particle.velocity.y > 0 && particle.position.y <= canvasSize.height + pRadius) ||\n                (particle.velocity.y < 0 && particle.position.y >= -pRadius) ||\n                (particle.velocity.x > 0 && particle.position.x <= canvasSize.width + pRadius) ||\n                (particle.velocity.x < 0 && particle.position.x >= -pRadius)) {\n                return;\n            }\n            if (!isPointInside(particle.position, container.canvas.size, Vector.origin, pRadius, direction)) {\n                container.particles.remove(particle);\n            }\n        }\n        else {\n            const position = particle.position;\n            if ((!gravityOptions.inverse &&\n                position.y > canvasSize.height + pRadius &&\n                direction === \"bottom\") ||\n                (gravityOptions.inverse && position.y < -pRadius && direction === \"top\")) {\n                container.particles.remove(particle);\n            }\n        }\n    }\n}\n","import { Vector, calculateBounds, getDistances, getRandom, isPointInside, randomInRange, } from \"@tsparticles/engine\";\nexport class OutOutMode {\n    constructor(container) {\n        this.container = container;\n        this.modes = [\"out\"];\n    }\n    update(particle, direction, delta, outMode) {\n        if (!this.modes.includes(outMode)) {\n            return;\n        }\n        const container = this.container;\n        switch (particle.outType) {\n            case \"inside\": {\n                const { x: vx, y: vy } = particle.velocity;\n                const circVec = Vector.origin;\n                circVec.length = particle.moveCenter.radius;\n                circVec.angle = particle.velocity.angle + Math.PI;\n                circVec.addTo(Vector.create(particle.moveCenter));\n                const { dx, dy } = getDistances(particle.position, circVec);\n                if ((vx <= 0 && dx >= 0) || (vy <= 0 && dy >= 0) || (vx >= 0 && dx <= 0) || (vy >= 0 && dy <= 0)) {\n                    return;\n                }\n                particle.position.x = Math.floor(randomInRange({\n                    min: 0,\n                    max: container.canvas.size.width,\n                }));\n                particle.position.y = Math.floor(randomInRange({\n                    min: 0,\n                    max: container.canvas.size.height,\n                }));\n                const { dx: newDx, dy: newDy } = getDistances(particle.position, particle.moveCenter);\n                particle.direction = Math.atan2(-newDy, -newDx);\n                particle.velocity.angle = particle.direction;\n                break;\n            }\n            default: {\n                if (isPointInside(particle.position, container.canvas.size, Vector.origin, particle.getRadius(), direction)) {\n                    return;\n                }\n                switch (particle.outType) {\n                    case \"outside\": {\n                        particle.position.x =\n                            Math.floor(randomInRange({\n                                min: -particle.moveCenter.radius,\n                                max: particle.moveCenter.radius,\n                            })) + particle.moveCenter.x;\n                        particle.position.y =\n                            Math.floor(randomInRange({\n                                min: -particle.moveCenter.radius,\n                                max: particle.moveCenter.radius,\n                            })) + particle.moveCenter.y;\n                        const { dx, dy } = getDistances(particle.position, particle.moveCenter);\n                        if (particle.moveCenter.radius) {\n                            particle.direction = Math.atan2(dy, dx);\n                            particle.velocity.angle = particle.direction;\n                        }\n                        break;\n                    }\n                    case \"normal\": {\n                        const warp = particle.options.move.warp, canvasSize = container.canvas.size, newPos = {\n                            bottom: canvasSize.height + particle.getRadius() + particle.offset.y,\n                            left: -particle.getRadius() - particle.offset.x,\n                            right: canvasSize.width + particle.getRadius() + particle.offset.x,\n                            top: -particle.getRadius() - particle.offset.y,\n                        }, sizeValue = particle.getRadius(), nextBounds = calculateBounds(particle.position, sizeValue);\n                        if (direction === \"right\" &&\n                            nextBounds.left > canvasSize.width + particle.offset.x) {\n                            particle.position.x = newPos.left;\n                            particle.initialPosition.x = particle.position.x;\n                            if (!warp) {\n                                particle.position.y = getRandom() * canvasSize.height;\n                                particle.initialPosition.y = particle.position.y;\n                            }\n                        }\n                        else if (direction === \"left\" && nextBounds.right < -particle.offset.x) {\n                            particle.position.x = newPos.right;\n                            particle.initialPosition.x = particle.position.x;\n                            if (!warp) {\n                                particle.position.y = getRandom() * canvasSize.height;\n                                particle.initialPosition.y = particle.position.y;\n                            }\n                        }\n                        if (direction === \"bottom\" &&\n                            nextBounds.top > canvasSize.height + particle.offset.y) {\n                            if (!warp) {\n                                particle.position.x = getRandom() * canvasSize.width;\n                                particle.initialPosition.x = particle.position.x;\n                            }\n                            particle.position.y = newPos.top;\n                            particle.initialPosition.y = particle.position.y;\n                        }\n                        else if (direction === \"top\" && nextBounds.bottom < -particle.offset.y) {\n                            if (!warp) {\n                                particle.position.x = getRandom() * canvasSize.width;\n                                particle.initialPosition.x = particle.position.x;\n                            }\n                            particle.position.y = newPos.bottom;\n                            particle.initialPosition.y = particle.position.y;\n                        }\n                        break;\n                    }\n                }\n                break;\n            }\n        }\n    }\n}\n","import { BounceOutMode } from \"./BounceOutMode.js\";\nimport { DestroyOutMode } from \"./DestroyOutMode.js\";\nimport { NoneOutMode } from \"./NoneOutMode.js\";\nimport { OutOutMode } from \"./OutOutMode.js\";\nexport class OutOfCanvasUpdater {\n    constructor(container) {\n        this.container = container;\n        this._updateOutMode = (particle, delta, outMode, direction) => {\n            for (const updater of this.updaters) {\n                updater.update(particle, direction, delta, outMode);\n            }\n        };\n        this.updaters = [\n            new BounceOutMode(container),\n            new DestroyOutMode(container),\n            new OutOutMode(container),\n            new NoneOutMode(container),\n        ];\n    }\n    init() {\n    }\n    isEnabled(particle) {\n        return !particle.destroyed && !particle.spawning;\n    }\n    update(particle, delta) {\n        const outModes = particle.options.move.outModes;\n        this._updateOutMode(particle, delta, outModes.bottom ?? outModes.default, \"bottom\");\n        this._updateOutMode(particle, delta, outModes.left ?? outModes.default, \"left\");\n        this._updateOutMode(particle, delta, outModes.right ?? outModes.default, \"right\");\n        this._updateOutMode(particle, delta, outModes.top ?? outModes.default, \"top\");\n    }\n}\n","import { OutOfCanvasUpdater } from \"./OutOfCanvasUpdater.js\";\nexport async function loadOutModesUpdater(engine, refresh = true) {\n    await engine.addParticleUpdater(\"outModes\", (container) => new OutOfCanvasUpdater(container), refresh);\n}\n"]}