{"version":3,"sources":["jsdelivr-header.js","/npm/@tsparticles/interaction-external-slow@3.0.3/browser/Options/Classes/Slow.js","/npm/@tsparticles/interaction-external-slow@3.0.3/browser/Slower.js","/npm/@tsparticles/interaction-external-slow@3.0.3/browser/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,6GCNO,MAAM,CAAK,CACd,aAAc,CACV,KAAK,OAAS,EACd,KAAK,OAAS,GAClB,CACA,KAAK,EAAM,CACF,IAGD,EAAK,SAAW,SAChB,KAAK,OAAS,EAAK,QAEnB,EAAK,SAAW,SAChB,KAAK,OAAS,EAAK,QAE3B,CACJ,CCdA,MAAM,EAAW,OACV,MAAM,UAAe,CAAuB,CAC/C,YAAY,EAAW,CACnB,MAAM,CAAS,CACnB,CACA,MAAM,EAAU,EAAO,EAAO,CACtB,EAAS,KAAK,SAAW,CAAC,IAG9B,EAAS,KAAK,OAAS,EAC3B,CACA,MAAO,CACH,MAAM,EAAY,KAAK,UAAW,EAAO,EAAU,cAAc,cAAc,MAAM,KAChF,IAGL,EAAU,OAAO,eAAiB,EAAK,OAAS,EAAU,OAAO,WACrE,CACA,MAAM,UAAW,CACjB,CACA,UAAU,EAAU,CAChB,MAAM,EAAY,KAAK,UAAW,EAAQ,EAAU,cAAc,MAAO,GAAU,GAAU,eAAiB,EAAU,cAAc,eAAe,OACrJ,OAAO,EAAO,QAAQ,QAAU,CAAC,CAAC,EAAM,UAAY,EAAU,EAAU,EAAO,QAAQ,IAAI,CAC/F,CACA,gBAAgB,KAAY,EAAS,CAC5B,EAAQ,OACT,EAAQ,KAAO,IAAI,GAEvB,UAAW,KAAU,EACjB,EAAQ,KAAK,KAAK,GAAQ,IAAI,CAEtC,CACA,MAAM,EAAU,CACZ,EAAS,KAAK,QAAU,GACxB,MAAM,EAAY,KAAK,UAAW,EAAU,EAAU,cAAe,EAAW,EAAU,cAAc,MAAM,SAAU,EAAS,EAAU,OAAO,eAAgB,EAAc,EAAQ,cAAc,MAAM,KAC5M,GAAI,CAAC,GAAe,CAAC,GAAU,EAAS,GAAK,CAAC,EAC1C,OAEJ,MAAM,EAAc,EAAS,YAAW,EAAI,EAAO,EAAY,EAAU,CAAW,EAAG,EAAkB,EAAO,EAAQ,EAAa,EAAY,OAAQ,CAAE,KAAA,CAAI,EAAK,EAChK,EAAO,IAGX,EAAK,QAAU,GACf,EAAK,OAAS,EAAkB,EACpC,CACJ,CC9CO,eAAe,EAA4B,EAAQ,EAAU,GAAM,CACtE,MAAM,EAAO,cAAc,eAAiB,GAAc,IAAI,EAAO,CAAS,EAAG,CAAO,CAC5F","file":"/npm/@tsparticles/interaction-external-slow@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/interaction-external-slow@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","export class Slow {\n    constructor() {\n        this.factor = 3;\n        this.radius = 200;\n    }\n    load(data) {\n        if (!data) {\n            return;\n        }\n        if (data.factor !== undefined) {\n            this.factor = data.factor;\n        }\n        if (data.radius !== undefined) {\n            this.radius = data.radius;\n        }\n    }\n}\n","import { ExternalInteractorBase, getDistance, isInArray, } from \"@tsparticles/engine\";\nimport { Slow } from \"./Options/Classes/Slow.js\";\nconst slowMode = \"slow\";\nexport class Slower extends ExternalInteractorBase {\n    constructor(container) {\n        super(container);\n    }\n    clear(particle, delta, force) {\n        if (particle.slow.inRange && !force) {\n            return;\n        }\n        particle.slow.factor = 1;\n    }\n    init() {\n        const container = this.container, slow = container.actualOptions.interactivity.modes.slow;\n        if (!slow) {\n            return;\n        }\n        container.retina.slowModeRadius = slow.radius * container.retina.pixelRatio;\n    }\n    async interact() {\n    }\n    isEnabled(particle) {\n        const container = this.container, mouse = container.interactivity.mouse, events = (particle?.interactivity ?? container.actualOptions.interactivity).events;\n        return events.onHover.enable && !!mouse.position && isInArray(slowMode, events.onHover.mode);\n    }\n    loadModeOptions(options, ...sources) {\n        if (!options.slow) {\n            options.slow = new Slow();\n        }\n        for (const source of sources) {\n            options.slow.load(source?.slow);\n        }\n    }\n    reset(particle) {\n        particle.slow.inRange = false;\n        const container = this.container, options = container.actualOptions, mousePos = container.interactivity.mouse.position, radius = container.retina.slowModeRadius, slowOptions = options.interactivity.modes.slow;\n        if (!slowOptions || !radius || radius < 0 || !mousePos) {\n            return;\n        }\n        const particlePos = particle.getPosition(), dist = getDistance(mousePos, particlePos), proximityFactor = dist / radius, slowFactor = slowOptions.factor, { slow } = particle;\n        if (dist > radius) {\n            return;\n        }\n        slow.inRange = true;\n        slow.factor = proximityFactor / slowFactor;\n    }\n}\n","import { Slower } from \"./Slower.js\";\nexport async function loadExternalSlowInteraction(engine, refresh = true) {\n    await engine.addInteractor(\"externalSlow\", (container) => new Slower(container), refresh);\n}\nexport * from \"./Options/Classes/Slow.js\";\nexport * from \"./Options/Interfaces/ISlow.js\";\n"]}