{"version":3,"sources":["jsdelivr-header.js","/npm/playwright-fixtures@0.3.5/dist/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACFA,MAAM,gBAAkB,MAAO,EAAM,KACjC,MAAM,EAAS,CAAC,EAEhB,IAAI,EACA,QACE,IAAI,SAAS,IACf,EAAa,IAAI,SAAS,IAAc,EAAa,EAAS,GAAW,GAAI,IAGjF,MAAM,EAAa,GAEb,EAAc,OAAO,QAAQ,GAC9B,KAAI,EAAE,EAAK,KAAkB,IAAK,SAAS,IAM5C,GAA4B,mBAAjB,EAA6B,CACpC,MAAM,EAAW,MAAO,IACpB,EAAO,GAAO,EACd,UACM,CAAU,EAEpB,EAAW,KAUX,QACK,QAAQ,EAAa,IAAK,KAAS,GAAU,IAC7C,KAAK,GACd,MAEI,EAAO,GAAO,EACd,GACJ,MAIJ,aAFM,QAAQ,IAAI,GAEX,CAAC,IAAK,KAAS,GAAU,EAAY,EAAW,EAErD,SAAW,CAAC,EAAU,IAAiB,IAAI,MAAM,EAAU,CAE7D,MAAO,CAAC,EAAQ,GAAU,EAAM,KAAY,EAAO,KAAK,EAAS,GAAM,SAAU,KAC7E,MAAM,EAAa,GACb,QAAiB,EAAa,QAAO,MAAO,EAAc,KAC5D,MAAO,EAAa,EAAY,SAAqB,sBAAsB,EAAc,GAEzF,OADA,EAAW,KAAK,CAAC,EAAY,IACtB,CAAW,GACnB,QAAQ,QAAQ,CAAC,IAEpB,UACU,EAAM,KAAK,EAAS,KAAa,EAC3C,CACA,cAEU,EAAW,aAAY,MAAO,GAAY,EAAY,YAClD,EACN,UACM,QAAQ,IAAI,EAAW,GAC9B,QAAQ,UACf,KAEJ,IAAG,CAAC,EAAQ,IACI,WAAR,EAEQ,GAAa,SAAS,EAAU,IAAI,EAAc,IAEvD,EAAO,KAGhB,KAAQ,GAAa,SAAS,EAAU,mBAC/B","file":"/npm/playwright-fixtures@0.3.5/dist/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/playwright-fixtures@0.3.5/dist/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","/**\n * Resolve fixture values, and returns the resolved values,\n * a callback to start cleaning jobs, and the promises of the cleaning jobs.\n */\nconst prepareFixtures = async (base, init) => {\n    const extend = {};\n    // The cleaning starter, called after the inner test and all sub-level fixtures are finished.\n    let useResolve;\n    let usePromise;\n    await new Promise((construct) => {\n        usePromise = new Promise((resolve) => { useResolve = resolve; construct(); });\n    });\n    // The promises of the cleaning jobs.\n    const finishJobs = [];\n    // Resolve fixture values.\n    const prepareJobs = Object.entries(init)\n        .map(([key, fixtureValue]) => (new Promise((prepareValueResolve) => {\n        /**\n         * Check if it is callable.\n         * Hard to be reliable and fast at the same time.\n         * E.g., classes are functions, too.\n         */\n        if (typeof fixtureValue === 'function') {\n            const useValue = async (value) => {\n                extend[key] = value;\n                prepareValueResolve();\n                await usePromise;\n            };\n            finishJobs.push(\n            /**\n             * Package to promise, chain with another resolve in case of\n             * the fixture function finishes without using `useValue`.\n             *\n             * Specify the type of `extend` as `T` to allow users to use sibling fixtures\n             * as in Playwright's official docs.\n             * @TODO filter out constants before handling these fixture functions.\n             * @see [Test fixtures - Advanced: fixtures | Playwright]{@link https://playwright.dev/docs/test-fixtures/#overriding-fixtures}\n             */\n            Promise\n                .resolve(fixtureValue({ ...base, ...extend }, useValue))\n                .then(prepareValueResolve));\n        }\n        else {\n            extend[key] = fixtureValue;\n            prepareValueResolve();\n        }\n    })));\n    await Promise.all(prepareJobs);\n    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n    return [{ ...base, ...extend }, useResolve, finishJobs];\n};\nconst wrapTest = (baseTest, fixturesList) => new Proxy(baseTest, {\n    // The call signature.\n    apply: (target, thisArg, [name, inner]) => (target.call(thisArg, name, async (...baseTestArgs) => {\n        const finishList = [];\n        const fixtures = await fixturesList.reduce(async (initializing, init) => {\n            const [initialized, finishFunc, finishJobs,] = await prepareFixtures(await initializing, init);\n            finishList.push([finishFunc, finishJobs]);\n            return initialized;\n        }, Promise.resolve({}));\n        // A try block to avoid inner errors blocking the cleaning jobs.\n        try {\n            await inner.call(thisArg, fixtures, ...baseTestArgs);\n        }\n        finally {\n            // Start the cleaning jobs, from sub-level fixtures to parent fixtures.\n            await finishList.reduceRight(async (finishing, [finishFunc, finishJobs]) => {\n                await finishing;\n                finishFunc();\n                await Promise.all(finishJobs);\n            }, Promise.resolve());\n        }\n    })),\n    get(target, key) {\n        if (key === 'extend') {\n            // The `extend` method.\n            return (fixtures) => wrapTest(baseTest, [...fixturesList, fixtures]);\n        }\n        return target[key];\n    },\n});\nconst wrap = (baseTest) => wrapTest(baseTest, []);\nexport default wrap;\n"]}