pixi-effects 0.35.0 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/ai/tools/check.mjs +26 -7
  5. package/ai/tools/lookup.mjs +14 -2
  6. package/dist/{Base-CXsMdmJB.d.ts → Base-CdF7AJop.d.ts} +1 -1
  7. package/dist/{Base-pNq6sVGl.d.cts → Base-CmiFiwQM.d.cts} +1 -1
  8. package/dist/Composition-BMRCE5FH.js +7 -0
  9. package/dist/{Composition-NDXKQHB4.js.map → Composition-BMRCE5FH.js.map} +1 -1
  10. package/dist/Composition-XRLYR6GL.cjs +16 -0
  11. package/dist/{Composition-OLH7RC5Z.cjs.map → Composition-XRLYR6GL.cjs.map} +1 -1
  12. package/dist/Controller.d.cts +2 -2
  13. package/dist/Controller.d.ts +2 -2
  14. package/dist/{Movie-VYtUN4TS.d.ts → Movie-Bh1HPdKw.d.cts} +6 -1
  15. package/dist/{Movie-Db4QnMIH.d.cts → Movie-D5WFfZdZ.d.ts} +6 -1
  16. package/dist/{Spans-QRMN2EZO.cjs → Spans-4IRBSOLI.cjs} +11 -11
  17. package/dist/{Spans-QRMN2EZO.cjs.map → Spans-4IRBSOLI.cjs.map} +1 -1
  18. package/dist/{Spans-QHHWC2PB.js → Spans-MWP2FX3T.js} +6 -6
  19. package/dist/{Spans-QHHWC2PB.js.map → Spans-MWP2FX3T.js.map} +1 -1
  20. package/dist/{blendModes-WIUCYIMC.cjs → blendModes-KU7XLV7U.cjs} +5 -5
  21. package/dist/{blendModes-WIUCYIMC.cjs.map → blendModes-KU7XLV7U.cjs.map} +1 -1
  22. package/dist/{blendModes-PP5NPBXY.js → blendModes-OOI3T6BE.js} +4 -4
  23. package/dist/{blendModes-PP5NPBXY.js.map → blendModes-OOI3T6BE.js.map} +1 -1
  24. package/dist/{chunk-ITDYFBB6.js → chunk-2JFFKHXO.js} +5 -5
  25. package/dist/chunk-2JFFKHXO.js.map +1 -0
  26. package/dist/{chunk-GL2AQFLQ.cjs → chunk-42ML5AKN.cjs} +5 -5
  27. package/dist/chunk-42ML5AKN.cjs.map +1 -0
  28. package/dist/{chunk-XV4L72FW.js → chunk-AZ6AINSW.js} +5 -5
  29. package/dist/{chunk-XV4L72FW.js.map → chunk-AZ6AINSW.js.map} +1 -1
  30. package/dist/{chunk-7TTCPHAV.cjs → chunk-CC7SUR7Q.cjs} +153 -48
  31. package/dist/chunk-CC7SUR7Q.cjs.map +1 -0
  32. package/dist/{chunk-Y253JQOH.js → chunk-G3DX65HO.js} +110 -10
  33. package/dist/chunk-G3DX65HO.js.map +1 -0
  34. package/dist/{chunk-LEECUCTG.cjs → chunk-KJSEQVBV.cjs} +129 -29
  35. package/dist/chunk-KJSEQVBV.cjs.map +1 -0
  36. package/dist/{chunk-IMQJVRMT.cjs → chunk-NEUPEENI.cjs} +5 -5
  37. package/dist/{chunk-IMQJVRMT.cjs.map → chunk-NEUPEENI.cjs.map} +1 -1
  38. package/dist/{chunk-2GNK6DPV.js → chunk-VF56PRAA.js} +121 -16
  39. package/dist/chunk-VF56PRAA.js.map +1 -0
  40. package/dist/{chunk-RTJD3ZSW.js → chunk-WIIU42FH.js} +4 -4
  41. package/dist/{chunk-RTJD3ZSW.js.map → chunk-WIIU42FH.js.map} +1 -1
  42. package/dist/{chunk-5IJENZOG.cjs → chunk-Y5UWFH6Y.cjs} +91 -91
  43. package/dist/{chunk-5IJENZOG.cjs.map → chunk-Y5UWFH6Y.cjs.map} +1 -1
  44. package/dist/index.cjs +33 -33
  45. package/dist/index.d.cts +20 -6
  46. package/dist/index.d.ts +20 -6
  47. package/dist/index.js +5 -5
  48. package/dist/loader.css +1 -1
  49. package/dist/present.cjs +5 -5
  50. package/dist/present.d.cts +2 -2
  51. package/dist/present.d.ts +2 -2
  52. package/dist/present.js +5 -5
  53. package/dist/three.cjs +6 -6
  54. package/dist/three.d.cts +2 -2
  55. package/dist/three.d.ts +2 -2
  56. package/dist/three.js +2 -2
  57. package/dist/{types-CavnUvd5.d.ts → types-B6zDTU2V.d.cts} +14 -1
  58. package/dist/{types-CavnUvd5.d.cts → types-B6zDTU2V.d.ts} +14 -1
  59. package/docs/api.md +5 -4
  60. package/docs/dsl.md +7 -5
  61. package/llms-full.txt +85 -18
  62. package/package.json +1 -1
  63. package/skills/pixi-effects/SKILL.md +3 -3
  64. package/skills/pixi-effects/reference/cheatsheet.md +7 -6
  65. package/skills/pixi-effects/reference/pitfalls.md +3 -0
  66. package/skills/pixi-effects/reference/recipes.md +60 -0
  67. package/skills/pixi-effects/template.html +6 -6
  68. package/dist/Composition-NDXKQHB4.js +0 -7
  69. package/dist/Composition-OLH7RC5Z.cjs +0 -16
  70. package/dist/chunk-2GNK6DPV.js.map +0 -1
  71. package/dist/chunk-7TTCPHAV.cjs.map +0 -1
  72. package/dist/chunk-GL2AQFLQ.cjs.map +0 -1
  73. package/dist/chunk-ITDYFBB6.js.map +0 -1
  74. package/dist/chunk-LEECUCTG.cjs.map +0 -1
  75. package/dist/chunk-Y253JQOH.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { describeLayer } from './chunk-ITDYFBB6.js';
1
+ import { describeLayer } from './chunk-2JFFKHXO.js';
2
2
  import { suggestName } from './chunk-BXOCEZ4U.js';
3
3
 
4
4
  // src/core/blend.ts
@@ -83,7 +83,7 @@ function blendFilterFor(mode) {
83
83
  }
84
84
  async function enableAdvancedBlend(renderer) {
85
85
  try {
86
- const { registerBlendModes } = await import('./blendModes-PP5NPBXY.js');
86
+ const { registerBlendModes } = await import('./blendModes-OOI3T6BE.js');
87
87
  registerBlendModes();
88
88
  } catch (e) {
89
89
  const why = e instanceof Error ? e.message : String(e);
@@ -128,5 +128,5 @@ function maxConcurrentAdvanced(layers, span) {
128
128
  }
129
129
 
130
130
  export { MANY_ADVANCED, applyBlendMode, blendFilterFor, enableAdvancedBlend, isAdvancedBlend, maxConcurrentAdvanced, setBlendFilterFactory, usesAdvancedBlend };
131
- //# sourceMappingURL=chunk-RTJD3ZSW.js.map
132
- //# sourceMappingURL=chunk-RTJD3ZSW.js.map
131
+ //# sourceMappingURL=chunk-WIIU42FH.js.map
132
+ //# sourceMappingURL=chunk-WIIU42FH.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/core/blend.ts"],"names":[],"mappings":";;;;AAIO,IAAM,iBAAA,GAAoB,CAAC,QAAA,EAAU,KAAA,EAAO,UAAU,UAAU,CAAA;AAEhE,IAAM,oBAAA,GAAuB;AAAA,EAClC,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,aAAA;AAAA,EAAe,YAAA;AAAA,EAAc,QAAA;AAAA,EAAU,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,WAAA;AAAA,EACvG,KAAA;AAAA,EAAO,YAAA;AAAA,EAAc,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc;AAC9C,CAAA;AAEO,IAAM,WAAA,GAAiC,CAAC,GAAG,iBAAA,EAAmB,GAAG,oBAAoB,CAAA;AAErF,SAAS,gBAAgB,IAAA,EAAwB;AACtD,EAAA,OAAO,OAAO,IAAA,KAAS,QAAA,IAAa,oBAAA,CAA2C,SAAS,IAAI,CAAA;AAC9F;AAGO,SAAS,aAAa,IAAA,EAA8B;AACzD,EAAA,IAAI,OAAO,IAAA,KAAS,QAAA,IAAY,YAAY,QAAA,CAAS,IAAI,GAAG,OAAO,IAAA;AACnE,EAAA,MAAM,QAAQ,OAAO,IAAA,KAAS,WAAW,WAAA,CAAY,IAAA,EAAM,WAAW,CAAA,GAAI,IAAA;AAC1E,EAAA,MAAM,KAAA,GAAQ,OAAO,IAAA,KAAS,QAAA,GAAW,IAAI,IAAI,CAAA,CAAA,CAAA,GAAM,OAAO,IAAI,CAAA;AAClE,EAAA,OAAO,CAAA,UAAA,EAAa,KAAK,CAAA,iBAAA,EAAoB,KAAA,GAAQ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qBAAA,CAAsB,CAAA,CAAE,SAAA,EAAwB,CAAA,CAAE,QAAA,IAAY,IAAI,CAAA,GAAI,CAAA;AAC7H;AAGO,SAAS,qBAAA,CAAsB,QAAgC,IAAA,EAAsB;AAC1F,EAAA,MAAM,SAAkC,EAAC;AACzC,EAAA,KAAA,MAAW,KAAK,MAAA,EAAQ;AACtB,IAAA,MAAM,CAAA,GAAI,QAAA,CAAS,CAAA,EAAG,IAAI,CAAA;AAC1B,IAAA,IAAI,MAAM,CAAA,EAAG;AACb,IAAA,MAAM,EAAA,GAAK,EAAE,EAAA,IAAM,CAAA;AACnB,IAAA,MAAM,MAAM,CAAA,CAAE,QAAA,KAAa,MAAA,GAAY,IAAA,GAAO,KAAK,CAAA,CAAE,QAAA;AACrD,IAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,EAAE,CAAA;AAC5B,IAAA,IAAI,GAAA,GAAM,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,CAAC,KAAA,EAAO,CAAC,CAAA,EAAG,CAAC,GAAA,EAAK,CAAC,CAAC,CAAC,CAAA;AAAA,EACpD;AACA,EAAA,MAAA,CAAO,IAAA,CAAK,CAAC,CAAA,EAAG,CAAA,KAAM,EAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,KAAK,CAAA,CAAE,CAAC,CAAA,GAAI,CAAA,CAAE,CAAC,CAAC,CAAA;AAChD,EAAA,IAAI,GAAA,GAAM,GAAG,IAAA,GAAO,CAAA;AACpB,EAAA,KAAA,MAAW,GAAG,CAAC,CAAA,IAAK,MAAA,EAAQ;AAAE,IAAA,GAAA,IAAO,CAAA;AAAG,IAAA,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,IAAA,EAAM,GAAG,CAAA;AAAA,EAAG;AACpE,EAAA,OAAO,IAAA;AACT","file":"chunk-RTJD3ZSW.js","sourcesContent":["import { describeLayer } from './lint';\nimport { suggestName } from './options';\n\n/** The modes Pixi draws itself (`add`, `screen`, `multiply`) and `normal`. */\nexport const BASIC_BLEND_MODES = ['normal', 'add', 'screen', 'multiply'] as const;\n/** The modes that need the backdrop: our own `BlendModeFilter`s (`src/filters/blendModes.ts`), loaded only when a movie uses one. */\nexport const ADVANCED_BLEND_MODES = [\n 'overlay', 'soft-light', 'hard-light', 'color-dodge', 'color-burn', 'darken', 'lighten', 'difference', 'exclusion',\n 'hue', 'saturation', 'color', 'luminosity', 'linear-burn',\n] as const;\n/** Every `blendMode` there is (the one table the warnings, the types and the docs check against). */\nexport const BLEND_MODES: readonly string[] = [...BASIC_BLEND_MODES, ...ADVANCED_BLEND_MODES];\n\nexport function isAdvancedBlend(mode: unknown): boolean {\n return typeof mode === 'string' && (ADVANCED_BLEND_MODES as readonly string[]).includes(mode);\n}\n\n/** Why `mode` is not a blend mode, with the likely name and the choices; null when it is one. */\nexport function blendProblem(mode: unknown): string | null {\n if (typeof mode === 'string' && BLEND_MODES.includes(mode)) return null;\n const guess = typeof mode === 'string' ? suggestName(mode, BLEND_MODES) : null;\n const shown = typeof mode === 'string' ? `\"${mode}\"` : String(mode);\n return `blendMode ${shown} is not supported${guess ? `; did you mean \"${guess}\"?` : ''} (use ${BLEND_MODES.join(', ')})`;\n}\n\n/** Does any layer of this composition (or one nested in it, or a mask layer) use an advanced blend? */\nexport function usesAdvancedBlend(spec: unknown): boolean {\n const visit = (n: unknown): boolean => {\n if (!n || typeof n !== 'object') return false;\n if (Array.isArray(n)) return n.some(visit);\n const o = n as Record<string, unknown>;\n return isAdvancedBlend(o.blendMode) || visit(o.sequences) || visit(o.mask) || visit(o.layer); // (`layer`: a mask written as { layer: <spec>, invert })\n };\n return visit(spec);\n}\n\n/** What to say about a layer's blend mode: `Composition` collects these per build, so the same mistake in 300 particle layers is said once. */\nexport type BlendReport = (message: string, spec: { name?: string; type: string }) => void;\nconst sayNow: BlendReport = (message, spec) => console.warn(`pixi-effects: ${describeLayer(spec)}: ${message}`);\n\n/** The blend filters of an advanced mode were not registered (a movie registers them in `Movie.init`, or loading them failed): the layer is drawn normal. */\nexport function blendUnavailableMessage(mode: string): string {\n return `blendMode \"${mode}\" could not be set up (the blend filters are not registered); the layer is drawn normal`;\n}\n\n/**\n * Apply a layer's `blendMode` to its display object; an unknown mode, or an advanced mode while the blend filters are not registered, says so\n * and the layer is drawn normal. Returns the blend filter it added to the layer's filter chain (the caller destroys it with the layer), if any.\n */\nexport function applyBlendMode(\n spec: { blendMode?: string; name?: string; type: string },\n display: { blendMode?: unknown; filters?: unknown },\n report: BlendReport = sayNow,\n): BlendFilterLike | null {\n const mode = spec.blendMode;\n if (mode === undefined) return null;\n const problem = blendProblem(mode);\n if (problem) { report(problem, spec); return null; }\n if (isAdvancedBlend(mode) && !blendRegistered()) { report(blendUnavailableMessage(mode), spec); return null; }\n // A container's blend mode applies INSIDE a filter's offscreen pass (against transparent black: multiply gave\n // solid black) and not to the filtered result. With filters, the pass that draws onto the backdrop is the last\n // filter's, so the mode goes there; the container stays normal.\n const filters = display.filters;\n if (Array.isArray(filters) && filters.length > 0) {\n if (isAdvancedBlend(mode)) {\n // an advanced mode is a filter of its own (it reads the backdrop): it joins the chain as the last pass\n const blend = blendFilterFor(mode);\n if (!blend) { report(blendUnavailableMessage(mode), spec); return null; }\n display.filters = [...filters, blend];\n return blend;\n }\n (filters[filters.length - 1] as { blendMode?: unknown }).blendMode = mode;\n return null;\n }\n display.blendMode = mode;\n return null;\n}\n\n/** What blend.ts needs of a blend filter (the real ones are Pixi filters; tests use plain objects). */\nexport type BlendFilterLike = { blendMode?: unknown; destroy(): void };\nlet factory: ((mode: string) => BlendFilterLike | null) | null = null;\n\n/** `filters/blendModes.ts` hands its filter maker here when it registers, so this file never imports Pixi. */\nexport function setBlendFilterFactory(f: ((mode: string) => BlendFilterLike | null) | null): void {\n factory = f;\n}\n\n/** Are the blend filters registered (a movie that uses an advanced mode registers them in `Movie.init`)? */\nexport function blendRegistered(): boolean {\n return factory !== null;\n}\n\n/** A fresh blend filter for an advanced mode, or null when the blends are not registered (or the mode is not an advanced one). */\nexport function blendFilterFor(mode: string): BlendFilterLike | null {\n return isAdvancedBlend(mode) && factory ? factory(mode) : null;\n}\n\n/**\n * Called by `Movie.init` when a layer uses an advanced mode, and only then: loads our blend filters (a separate chunk), registers them on\n * the pixi the movie runs on, and on WebGL turns the back buffer on (an advanced blend reads what is already drawn; WebGPU copies the\n * backdrop by itself, and has no such switch). A movie that uses none never reaches this, so nothing about it changes.\n */\nexport async function enableAdvancedBlend(renderer: unknown): Promise<void> {\n try {\n const { registerBlendModes } = await import('../filters/blendModes');\n registerBlendModes();\n } catch (e) {\n // a page that serves dist/index.js without its chunk, a CDN hiccup: the movie still plays, its advanced blends drawn normal\n const why = e instanceof Error ? e.message : String(e);\n console.warn(`pixi-effects: the blend filters could not be loaded (${why}); layers with an advanced blendMode are drawn normal. Serve the whole dist/ folder (the filters are the blendModes-*.js file next to index.js)`);\n return;\n }\n const bb = (renderer as { backBuffer?: { useBackBuffer: boolean } }).backBuffer;\n if (bb) bb.useBackBuffer = true;\n}\n\n/** This many layers with an advanced blend on screen at once is slow: each is a full-frame pass (measured on WebGL: about 1.5–2 ms each at 1080p). */\nexport const MANY_ADVANCED = 10;\n\ntype Counted = { at?: number; duration?: number; blendMode?: unknown; type?: string; sequences?: unknown };\n\n/** The layers a composition draws (its children each blend one by one when it has a mode): null, camera and audio layers draw nothing; nested compositions are walked. */\nfunction drawnLeaves(sequences: unknown): number {\n if (!Array.isArray(sequences)) return 0;\n let n = 0;\n for (const s of sequences as Counted[]) {\n if (!s || s.type === 'null' || s.type === 'camera' || s.type === 'audio') continue;\n n += s.type === 'composition' ? drawnLeaves(s.sequences) : 1;\n }\n return n;\n}\n\n/**\n * The full-frame passes one layer costs while it is on screen: 1 for a layer with an advanced mode; for a composition with one, one for each\n * drawn layer inside it (its children inherit the mode and blend one by one); for a composition without, the most that its own layers add\n * at one instant (a card with three blends in it, on screen with four other cards, is twelve).\n */\nfunction passesOf(l: Counted, span: number): number {\n const isComposition = l.type === 'composition';\n if (isAdvancedBlend(l.blendMode)) return isComposition ? Math.max(1, drawnLeaves(l.sequences)) : 1;\n return isComposition && Array.isArray(l.sequences) ? maxConcurrentAdvanced(l.sequences as Counted[], l.duration ?? span) : 0;\n}\n\n/** The most full-frame advanced-blend passes on screen at one instant, from the layers' `at` and `duration` (a layer with no duration lasts to the end). */\nexport function maxConcurrentAdvanced(layers: ReadonlyArray<Counted>, span: number): number {\n const events: Array<[number, number]> = [];\n for (const l of layers) {\n const w = passesOf(l, span);\n if (w === 0) continue;\n const at = l.at ?? 0;\n const end = l.duration === undefined ? span : at + l.duration;\n const start = Math.max(0, at); // a negative `at` starts before the composition: only what is after 0 is on screen\n if (end > start) events.push([start, w], [end, -w]);\n }\n events.sort((a, b) => a[0] - b[0] || a[1] - b[1]); // at one instant, the layers that end go before the ones that start\n let now = 0, most = 0;\n for (const [, d] of events) { now += d; most = Math.max(most, now); }\n return most;\n}\n"]}
1
+ {"version":3,"sources":["../src/core/blend.ts"],"names":[],"mappings":";;;;AAIO,IAAM,iBAAA,GAAoB,CAAC,QAAA,EAAU,KAAA,EAAO,UAAU,UAAU,CAAA;AAEhE,IAAM,oBAAA,GAAuB;AAAA,EAClC,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,YAAA;AAAA,EAAc,aAAA;AAAA,EAAe,YAAA;AAAA,EAAc,QAAA;AAAA,EAAU,SAAA;AAAA,EAAW,YAAA;AAAA,EAAc,WAAA;AAAA,EACvG,KAAA;AAAA,EAAO,YAAA;AAAA,EAAc,OAAA;AAAA,EAAS,YAAA;AAAA,EAAc;AAC9C,CAAA;AAEO,IAAM,WAAA,GAAiC,CAAC,GAAG,iBAAA,EAAmB,GAAG,oBAAoB,CAAA;AAErF,SAAS,gBAAgB,IAAA,EAAwB;AACtD,EAAA,OAAO,OAAO,IAAA,KAAS,QAAA,IAAa,oBAAA,CAA2C,SAAS,IAAI,CAAA;AAC9F;AAGO,SAAS,aAAa,IAAA,EAA8B;A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A,CAAE,CAAC,CAAC,CAAA;AAChD,EAAA,IAAI,GAAA,GAAM,GAAG,IAAA,GAAO,CAAA;AACpB,EAAA,KAAA,MAAW,GAAG,CAAC,CAAA,IAAK,MAAA,EAAQ;AAAE,IAAA,GAAA,IAAO,CAAA;AAAG,IAAA,IAAA,GAAO,IAAA,CAAK,GAAA,CAAI,IAAA,EAAM,GAAG,CAAA;AAAA,EAAG;AACpE,EAAA,OAAO,IAAA;AACT","file":"chunk-WIIU42FH.js","sourcesContent":["import { describeLayer } from './lint';\nimport { suggestName } from './options';\n\n/** The modes Pixi draws itself (`add`, `screen`, `multiply`) and `normal`. */\nexport const BASIC_BLEND_MODES = ['normal', 'add', 'screen', 'multiply'] as const;\n/** The modes that need the backdrop: our own `BlendModeFilter`s (`src/filters/blendModes.ts`), loaded only when a movie uses one. */\nexport const ADVANCED_BLEND_MODES = [\n 'overlay', 'soft-light', 'hard-light', 'color-dodge', 'color-burn', 'darken', 'lighten', 'difference', 'exclusion',\n 'hue', 'saturation', 'color', 'luminosity', 'linear-burn',\n] as const;\n/** Every `blendMode` there is (the one table the warnings, the types and the docs check against). */\nexport const BLEND_MODES: readonly string[] = [...BASIC_BLEND_MODES, ...ADVANCED_BLEND_MODES];\n\nexport function isAdvancedBlend(mode: unknown): boolean {\n return typeof mode === 'string' && (ADVANCED_BLEND_MODES as readonly string[]).includes(mode);\n}\n\n/** Why `mode` is not a blend mode, with the likely name and the choices; null when it is one. */\nexport function blendProblem(mode: unknown): string | null {\n if (typeof mode === 'string' && BLEND_MODES.includes(mode)) return null;\n const guess = typeof mode === 'string' ? suggestName(mode, BLEND_MODES) : null;\n const shown = typeof mode === 'string' ? `\"${mode}\"` : String(mode);\n return `blendMode ${shown} is not supported${guess ? `; did you mean \"${guess}\"?` : ''} (use ${BLEND_MODES.join(', ')})`;\n}\n\n/** Does any layer of this composition (or one nested in it, or a mask layer) use an advanced blend? */\nexport function usesAdvancedBlend(spec: unknown): boolean {\n const visit = (n: unknown): boolean => {\n if (!n || typeof n !== 'object') return false;\n if (Array.isArray(n)) return n.some(visit);\n const o = n as Record<string, unknown>;\n return isAdvancedBlend(o.blendMode) || visit(o.sequences) || visit(o.mask) || visit(o.layer); // (`layer`: a mask written as { layer: <spec>, invert })\n };\n return visit(spec);\n}\n\n/** What to say about a layer's blend mode: `Composition` collects these per build, so the same mistake in 300 particle layers is said once. */\nexport type BlendReport = (message: string, spec: { name?: string; type: string }) => void;\nconst sayNow: BlendReport = (message, spec) => console.warn(`pixi-effects: ${describeLayer(spec)}: ${message}`);\n\n/** The blend filters of an advanced mode were not registered (a movie registers them in `Movie.init`, or loading them failed): the layer is drawn normal. */\nexport function blendUnavailableMessage(mode: string): string {\n return `blendMode \"${mode}\" could not be set up (the blend filters are not registered); the layer is drawn normal`;\n}\n\n/**\n * Apply a layer's `blendMode` to its display object; an unknown mode, or an advanced mode while the blend filters are not registered, says so\n * and the layer is drawn normal. Returns the blend filter it added to the layer's filter chain (the caller destroys it with the layer), if any.\n */\nexport function applyBlendMode(\n spec: { blendMode?: string; name?: string; type: string },\n display: { blendMode?: unknown; filters?: unknown },\n report: BlendReport = sayNow,\n): BlendFilterLike | null {\n const mode = spec.blendMode;\n if (mode === undefined) return null;\n const problem = blendProblem(mode);\n if (problem) { report(problem, spec); return null; }\n if (isAdvancedBlend(mode) && !blendRegistered()) { report(blendUnavailableMessage(mode), spec); return null; }\n // A container's blend mode applies INSIDE a filter's offscreen pass (against transparent black: multiply gave\n // solid black) and not to the filtered result. With filters, the pass that draws onto the backdrop is the last\n // filter's, so the mode goes there; the container stays normal.\n const filters = display.filters;\n if (Array.isArray(filters) && filters.length > 0) {\n if (isAdvancedBlend(mode)) {\n // an advanced mode is a filter of its own (it reads the backdrop): it joins the chain as the last pass\n const blend = blendFilterFor(mode);\n if (!blend) { report(blendUnavailableMessage(mode), spec); return null; }\n display.filters = [...filters, blend];\n return blend;\n }\n (filters[filters.length - 1] as { blendMode?: unknown }).blendMode = mode;\n return null;\n }\n display.blendMode = mode;\n return null;\n}\n\n/** What blend.ts needs of a blend filter (the real ones are Pixi filters; tests use plain objects). */\nexport type BlendFilterLike = { blendMode?: unknown; destroy(): void };\nlet factory: ((mode: string) => BlendFilterLike | null) | null = null;\n\n/** `filters/blendModes.ts` hands its filter maker here when it registers, so this file never imports Pixi. */\nexport function setBlendFilterFactory(f: ((mode: string) => BlendFilterLike | null) | null): void {\n factory = f;\n}\n\n/** Are the blend filters registered (a movie that uses an advanced mode registers them in `Movie.init`)? */\nexport function blendRegistered(): boolean {\n return factory !== null;\n}\n\n/** A fresh blend filter for an advanced mode, or null when the blends are not registered (or the mode is not an advanced one). */\nexport function blendFilterFor(mode: string): BlendFilterLike | null {\n return isAdvancedBlend(mode) && factory ? factory(mode) : null;\n}\n\n/**\n * Called by `Movie.init` when a layer uses an advanced mode, and only then: loads our blend filters (a separate chunk), registers them on\n * the pixi the movie runs on, and on WebGL turns the back buffer on (an advanced blend reads what is already drawn; WebGPU copies the\n * backdrop by itself, and has no such switch). A movie that uses none never reaches this, so nothing about it changes.\n */\nexport async function enableAdvancedBlend(renderer: unknown): Promise<void> {\n try {\n const { registerBlendModes } = await import('../filters/blendModes');\n registerBlendModes();\n } catch (e) {\n // a page that serves dist/index.js without its chunk, a CDN hiccup: the movie still plays, its advanced blends drawn normal\n const why = e instanceof Error ? e.message : String(e);\n console.warn(`pixi-effects: the blend filters could not be loaded (${why}); layers with an advanced blendMode are drawn normal. Serve the whole dist/ folder (the filters are the blendModes-*.js file next to index.js)`);\n return;\n }\n const bb = (renderer as { backBuffer?: { useBackBuffer: boolean } }).backBuffer;\n if (bb) bb.useBackBuffer = true;\n}\n\n/** This many layers with an advanced blend on screen at once is slow: each is a full-frame pass (measured on WebGL: about 1.5–2 ms each at 1080p). */\nexport const MANY_ADVANCED = 10;\n\ntype Counted = { at?: number; duration?: number; blendMode?: unknown; type?: string; sequences?: unknown };\n\n/** The layers a composition draws (its children each blend one by one when it has a mode): null, camera and audio layers draw nothing; nested compositions are walked. */\nfunction drawnLeaves(sequences: unknown): number {\n if (!Array.isArray(sequences)) return 0;\n let n = 0;\n for (const s of sequences as Counted[]) {\n if (!s || s.type === 'null' || s.type === 'camera' || s.type === 'audio') continue;\n n += s.type === 'composition' ? drawnLeaves(s.sequences) : 1;\n }\n return n;\n}\n\n/**\n * The full-frame passes one layer costs while it is on screen: 1 for a layer with an advanced mode; for a composition with one, one for each\n * drawn layer inside it (its children inherit the mode and blend one by one); for a composition without, the most that its own layers add\n * at one instant (a card with three blends in it, on screen with four other cards, is twelve).\n */\nfunction passesOf(l: Counted, span: number): number {\n const isComposition = l.type === 'composition';\n if (isAdvancedBlend(l.blendMode)) return isComposition ? Math.max(1, drawnLeaves(l.sequences)) : 1;\n return isComposition && Array.isArray(l.sequences) ? maxConcurrentAdvanced(l.sequences as Counted[], l.duration ?? span) : 0;\n}\n\n/** The most full-frame advanced-blend passes on screen at one instant, from the layers' `at` and `duration` (a layer with no duration lasts to the end). */\nexport function maxConcurrentAdvanced(layers: ReadonlyArray<Counted>, span: number): number {\n const events: Array<[number, number]> = [];\n for (const l of layers) {\n const w = passesOf(l, span);\n if (w === 0) continue;\n const at = l.at ?? 0;\n const end = l.duration === undefined ? span : at + l.duration;\n const start = Math.max(0, at); // a negative `at` starts before the composition: only what is after 0 is on screen\n if (end > start) events.push([start, w], [end, -w]);\n }\n events.sort((a, b) => a[0] - b[0] || a[1] - b[1]); // at one instant, the layers that end go before the ones that start\n let now = 0, most = 0;\n for (const [, d] of events) { now += d; most = Math.max(most, now); }\n return most;\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkLEECUCTG_cjs = require('./chunk-LEECUCTG.cjs');
4
- var chunkIMQJVRMT_cjs = require('./chunk-IMQJVRMT.cjs');
5
- var chunkGL2AQFLQ_cjs = require('./chunk-GL2AQFLQ.cjs');
3
+ var chunkKJSEQVBV_cjs = require('./chunk-KJSEQVBV.cjs');
4
+ var chunkNEUPEENI_cjs = require('./chunk-NEUPEENI.cjs');
5
+ var chunk42ML5AKN_cjs = require('./chunk-42ML5AKN.cjs');
6
6
  var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
7
7
  var pixi_js = require('pixi.js');
8
8
 
@@ -33,10 +33,10 @@ var KIND_ALIASES = {
33
33
  fill: "ambient"
34
34
  };
35
35
  function lightKindProblem(kind) {
36
- if (kind === void 0 || typeof kind === "string" && chunkLEECUCTG_cjs.LIGHT_KINDS.includes(kind)) return null;
37
- const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkLEECUCTG_cjs.LIGHT_KINDS) : null;
36
+ if (kind === void 0 || typeof kind === "string" && chunkKJSEQVBV_cjs.LIGHT_KINDS.includes(kind)) return null;
37
+ const guess = typeof kind === "string" ? KIND_ALIASES[kind.toLowerCase()] ?? chunkTWZNOUM7_cjs.suggestName(kind, chunkKJSEQVBV_cjs.LIGHT_KINDS) : null;
38
38
  const shown = typeof kind === "string" ? `"${kind}"` : String(kind);
39
- return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkLEECUCTG_cjs.LIGHT_KINDS.join(", ")}); point is used`;
39
+ return `kind ${shown} is not a light kind${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkKJSEQVBV_cjs.LIGHT_KINDS.join(", ")}); point is used`;
40
40
  }
41
41
  var LIGHT_ALIASES = {
42
42
  pointOfInterest: 'did you mean "lookAtX / lookAtY / lookAtZ"?',
@@ -61,24 +61,24 @@ function lightLayerProblems(spec) {
61
61
  const raw = spec;
62
62
  const kind = lightKindProblem(raw.kind);
63
63
  if (kind) out.push(kind);
64
- if (raw.falloff !== void 0 && !chunkLEECUCTG_cjs.FALLOFFS.includes(raw.falloff)) {
65
- const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkLEECUCTG_cjs.FALLOFFS) : null;
66
- out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkLEECUCTG_cjs.FALLOFFS.join(", ")}); none is used`);
64
+ if (raw.falloff !== void 0 && !chunkKJSEQVBV_cjs.FALLOFFS.includes(raw.falloff)) {
65
+ const guess = typeof raw.falloff === "string" ? chunkTWZNOUM7_cjs.suggestName(raw.falloff, chunkKJSEQVBV_cjs.FALLOFFS) : null;
66
+ out.push(`falloff ${JSON.stringify(raw.falloff)} is not supported${guess ? `; did you mean "${guess}"?` : ""} (use ${chunkKJSEQVBV_cjs.FALLOFFS.join(", ")}); none is used`);
67
67
  }
68
68
  for (const k of Object.keys(raw)) {
69
- if (chunkLEECUCTG_cjs.LIGHT_PROPS.includes(k) || k === "intensity" || k === "shadowDarkness" || k === "shadowDiffusion") {
69
+ if (chunkKJSEQVBV_cjs.LIGHT_PROPS.includes(k) || k === "intensity" || k === "shadowDarkness" || k === "shadowDiffusion") {
70
70
  out.push(`"${k}" must go inside initial / keyframes, not on the light itself`);
71
71
  } else if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
72
72
  }
73
73
  const explained = new Set(Object.keys(LIGHT_ALIASES));
74
- for (const k of chunkGL2AQFLQ_cjs.collectPropKeys(spec)) {
74
+ for (const k of chunk42ML5AKN_cjs.collectPropKeys(spec)) {
75
75
  if (LIGHT_ALIASES[k]) out.push(`"${k}" is not a property \u2014 ${LIGHT_ALIASES[k]}`);
76
- else if (!explained.has(k) && !chunkLEECUCTG_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkLEECUCTG_cjs.LIGHT_PROPS.join(", ")})`);
76
+ else if (!explained.has(k) && !chunkKJSEQVBV_cjs.LIGHT_PROPS.includes(k)) out.push(`"${k}" has no effect on a light (use ${chunkKJSEQVBV_cjs.LIGHT_PROPS.join(", ")})`);
77
77
  }
78
78
  if (numbersOf(spec, "coneFeather").some((v) => v > 1 || v < 0)) out.push("coneFeather is 0..1 (the soft part of the cone edge, as a fraction of the half angle); it is clamped");
79
79
  const big = numbersOf(spec, "intensity").find((v) => v > 10);
80
80
  if (big !== void 0) out.push(`intensity ${big} looks like a percentage: it is a multiplier (1 = full, 0.25 = a quarter); did you mean ${big / 100}?`);
81
- const kindNow = typeof raw.kind === "string" && chunkLEECUCTG_cjs.LIGHT_KINDS.includes(raw.kind) ? raw.kind : "point";
81
+ const kindNow = typeof raw.kind === "string" && chunkKJSEQVBV_cjs.LIGHT_KINDS.includes(raw.kind) ? raw.kind : "point";
82
82
  const has = (...keys) => keys.filter((k) => bagsOf(spec).some((b) => b[k] !== void 0));
83
83
  const falloffOn = raw.falloff === "smooth" || raw.falloff === "inverseSquare";
84
84
  if (kindNow === "ambient" && raw.castsShadows) out.push("an ambient light has no direction, so it makes no shadow: castsShadows is ignored (put it on a point, spot or parallel light)");
@@ -106,17 +106,17 @@ function lightSetProblems(layers) {
106
106
  out.push("there is no ambient light, so what no light reaches is black; add { type: 'light', kind: 'ambient', initial: { intensity: 0.25 } }");
107
107
  }
108
108
  const direct = lights.filter((l) => kindOf(l) !== "ambient");
109
- if (direct.length > chunkLEECUCTG_cjs.MAX_LIGHTS) {
110
- const dropped = direct.slice(chunkLEECUCTG_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
111
- out.push(`${direct.length} lights, but at most ${chunkLEECUCTG_cjs.MAX_LIGHTS} are used (the first ${chunkLEECUCTG_cjs.MAX_LIGHTS}, in layer order); ${dropped.join(", ")} and later are dropped. Use fewer lights`);
109
+ if (direct.length > chunkKJSEQVBV_cjs.MAX_LIGHTS) {
110
+ const dropped = direct.slice(chunkKJSEQVBV_cjs.MAX_LIGHTS).map((l) => nameOf(l, layers.indexOf(l)));
111
+ out.push(`${direct.length} lights, but at most ${chunkKJSEQVBV_cjs.MAX_LIGHTS} are used (the first ${chunkKJSEQVBV_cjs.MAX_LIGHTS}, in layer order); ${dropped.join(", ")} and later are dropped. Use fewer lights`);
112
112
  }
113
113
  const lightsCast = lights.some((l) => kindOf(l) !== "ambient" && l.castsShadows);
114
114
  const casters = layers.filter((l) => l.type !== "light" && l.castsShadows && l.threeD);
115
115
  if (casters.length > 0 && !lightsCast) out.push(`${casters.length} layer${casters.length > 1 ? "s have" : " has"} castsShadows but no light has castsShadows: add castsShadows: true to the light that should make the shadows`);
116
116
  if (lightsCast && casters.length === 0) out.push("a light has castsShadows but no layer has castsShadows: add castsShadows: true to the threeD layers that should cast a shadow");
117
- if (lightsCast && casters.length > chunkLEECUCTG_cjs.MAX_CASTERS) {
118
- const dropped = casters.slice(chunkLEECUCTG_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
119
- out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunkLEECUCTG_cjs.MAX_CASTERS} (the first ${chunkLEECUCTG_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
117
+ if (lightsCast && casters.length > chunkKJSEQVBV_cjs.MAX_CASTERS) {
118
+ const dropped = casters.slice(chunkKJSEQVBV_cjs.MAX_CASTERS).map((c) => nameOf(c, layers.indexOf(c)));
119
+ out.push(`${casters.length} layers cast shadows, but a layer receives shadows from at most ${chunkKJSEQVBV_cjs.MAX_CASTERS} (the first ${chunkKJSEQVBV_cjs.MAX_CASTERS}, in layer order); ${dropped.join(", ")} and later cast none`);
120
120
  }
121
121
  const softLights = lights.filter((l) => l.castsShadows && numbersOf(l, "shadowDiffusion").some((v) => v > 0));
122
122
  if (softLights.length >= SOFT_LIGHTS) {
@@ -301,9 +301,9 @@ var roundPixelsBit = {
301
301
  name: "round-pixels-bit",
302
302
  vertex: { header: `fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32> { return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0; }` }
303
303
  };
304
- var ML = chunkLEECUCTG_cjs.MAX_LIGHTS;
305
- var MC = chunkLEECUCTG_cjs.MAX_CASTERS;
306
- var TAPS = chunkLEECUCTG_cjs.SHADOW_TAPS;
304
+ var ML = chunkKJSEQVBV_cjs.MAX_LIGHTS;
305
+ var MC = chunkKJSEQVBV_cjs.MAX_CASTERS;
306
+ var TAPS = chunkKJSEQVBV_cjs.SHADOW_TAPS;
307
307
  var SHADOW_KEYS = Array.from({ length: MC }, (_, j) => `uShadow${j}`);
308
308
  var WGSL_SHADOW_DECLS = SHADOW_KEYS.map((k, j) => ` @group(2) @binding(${4 + j}) var ${k}: texture_2d<f32>;`).join("\n");
309
309
  var WGSL_SHADOW_PICK = SHADOW_KEYS.map((k, j) => (j === 0 ? "" : "else ") + `if (j == ${j}) { a = textureSampleLevel(${k}, uSampler, uv, 0.0).a; }`).join(" ");
@@ -663,8 +663,8 @@ function readLayerTransform(target) {
663
663
  x: c.x,
664
664
  y: c.y,
665
665
  z: c.z ?? 0,
666
- rotationX: (c.rotationX ?? 0) * chunkLEECUCTG_cjs.DEG,
667
- rotationY: (c.rotationY ?? 0) * chunkLEECUCTG_cjs.DEG,
666
+ rotationX: (c.rotationX ?? 0) * chunkKJSEQVBV_cjs.DEG,
667
+ rotationY: (c.rotationY ?? 0) * chunkKJSEQVBV_cjs.DEG,
668
668
  rotationZ: c.rotation,
669
669
  scaleX: c.scale.x,
670
670
  scaleY: c.scale.y,
@@ -727,26 +727,26 @@ var Layer3D = class {
727
727
  if (!(needW >= 1 && needH >= 1) || !Number.isFinite(bounds.x) || !Number.isFinite(bounds.y)) return this.hide();
728
728
  const size = this.sizeFor(needW, needH);
729
729
  const frame = { x: bounds.x - pad, y: bounds.y - pad, width: size.w, height: size.h };
730
- const projected = chunkLEECUCTG_cjs.projectLayer(readLayerTransform(target), frame, basis);
730
+ const projected = chunkKJSEQVBV_cjs.projectLayer(readLayerTransform(target), frame, basis);
731
731
  this.depth = projected.depth;
732
732
  {
733
733
  const lt = readLayerTransform(target);
734
- const o = chunkLEECUCTG_cjs.layerToWorld(lt, frame.x, frame.y);
735
- const pu = chunkLEECUCTG_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
736
- const pv = chunkLEECUCTG_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
734
+ const o = chunkKJSEQVBV_cjs.layerToWorld(lt, frame.x, frame.y);
735
+ const pu = chunkKJSEQVBV_cjs.layerToWorld(lt, frame.x + frame.width, frame.y);
736
+ const pv = chunkKJSEQVBV_cjs.layerToWorld(lt, frame.x, frame.y + frame.height);
737
737
  this.world = { o, u: { x: pu.x - o.x, y: pu.y - o.y, z: pu.z - o.z }, v: { x: pv.x - o.x, y: pv.y - o.y, z: pv.z - o.z } };
738
738
  }
739
739
  if (!projected.visible) {
740
740
  if (!this.warnedBehind) {
741
741
  this.warnedBehind = true;
742
742
  if (this.seq.spec.hideBehindCamera) return this.hide();
743
- if (projected.depth > chunkLEECUCTG_cjs.NEAR) {
743
+ if (projected.depth > chunkKJSEQVBV_cjs.NEAR) {
744
744
  console.warn(
745
- `pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.seq.spec)}: part of it (a corner) reaches the camera plane (z = ${(target.z ?? 0).toFixed(0)}, rotationX ${(target.rotationX ?? 0).toFixed(0)}\xB0, rotationY ${(target.rotationY ?? 0).toFixed(0)}\xB0), and a layer is hidden whole when any corner is at or behind it. Tilt it less (rotationX / rotationY), make it smaller, or keep the camera further away from it (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
745
+ `pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.seq.spec)}: part of it (a corner) reaches the camera plane (z = ${(target.z ?? 0).toFixed(0)}, rotationX ${(target.rotationX ?? 0).toFixed(0)}\xB0, rotationY ${(target.rotationY ?? 0).toFixed(0)}\xB0), and a layer is hidden whole when any corner is at or behind it. Tilt it less (rotationX / rotationY), make it smaller, or keep the camera further away from it (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
746
746
  );
747
747
  } else {
748
748
  console.warn(
749
- `pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
749
+ `pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.seq.spec)} is at or behind the camera plane (z = ${(target.z ?? 0).toFixed(0)}) and is hidden. If that is unintended, lower its z or move the camera back (the default camera sits at z = (height/2)/tan(fov/2), about 989 for 720p at fov 40).`
750
750
  );
751
751
  }
752
752
  }
@@ -771,7 +771,7 @@ var Layer3D = class {
771
771
  */
772
772
  setBlur(radius) {
773
773
  const d = this.display;
774
- const r = radius > chunkLEECUCTG_cjs.MIN_BLUR ? Math.min(radius, chunkLEECUCTG_cjs.MAX_BLUR) : 0;
774
+ const r = radius > chunkKJSEQVBV_cjs.MIN_BLUR ? Math.min(radius, chunkKJSEQVBV_cjs.MAX_BLUR) : 0;
775
775
  this.blur = r;
776
776
  if (r === 0) {
777
777
  if (this.blurFilter) {
@@ -788,8 +788,8 @@ var Layer3D = class {
788
788
  this.blurFilter = new DiscBlurFilter(r);
789
789
  this.blendWas = d.blendMode ?? "normal";
790
790
  const chain = [this.blurFilter];
791
- if (chunkIMQJVRMT_cjs.isAdvancedBlend(this.blendWas)) {
792
- this.blendFilter = chunkIMQJVRMT_cjs.blendFilterFor(this.blendWas);
791
+ if (chunkNEUPEENI_cjs.isAdvancedBlend(this.blendWas)) {
792
+ this.blendFilter = chunkNEUPEENI_cjs.blendFilterFor(this.blendWas);
793
793
  if (this.blendFilter) {
794
794
  chain.push(this.blendFilter);
795
795
  d.blendMode = "normal";
@@ -813,7 +813,7 @@ var Layer3D = class {
813
813
  } catch (err) {
814
814
  if (!this.warnedLit) {
815
815
  this.warnedLit = true;
816
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.seq.spec)}: the lighting shader could not be made on this renderer (${err?.message ?? err}); the layer is drawn unlit`);
816
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.seq.spec)}: the lighting shader could not be made on this renderer (${err?.message ?? err}); the layer is drawn unlit`);
817
817
  }
818
818
  return null;
819
819
  }
@@ -907,8 +907,8 @@ var NEEDS_THREE_D = ["z", "rotationX", "rotationY"];
907
907
  var CAMERA_ONLY = ["focus", "aperture", "fogNear", "fogFar", "fogColor", "fogAmount"];
908
908
  var SKEW_KEYS = ["skew", "skewX", "skewY"];
909
909
  function lintSequence(spec, warn = defaultWarn) {
910
- const who = chunkGL2AQFLQ_cjs.describeLayer(spec);
911
- const keys = chunkGL2AQFLQ_cjs.collectPropKeys(spec);
910
+ const who = chunk42ML5AKN_cjs.describeLayer(spec);
911
+ const keys = chunk42ML5AKN_cjs.collectPropKeys(spec);
912
912
  const explained = /* @__PURE__ */ new Set();
913
913
  for (const k of keys) {
914
914
  const hint = LAYER_ALIASES[k] ?? (spec.type === "camera" ? CAMERA_ALIASES[k] : void 0);
@@ -957,8 +957,8 @@ function lintSequence(spec, warn = defaultWarn) {
957
957
  }
958
958
  function lintFocus(camera, siblings, warn = defaultWarn) {
959
959
  if (camera.type !== "camera") return;
960
- const who = chunkGL2AQFLQ_cjs.describeLayer(camera);
961
- for (const p of chunkLEECUCTG_cjs.focusProblems(camera, siblings)) {
960
+ const who = chunk42ML5AKN_cjs.describeLayer(camera);
961
+ for (const p of chunkKJSEQVBV_cjs.focusProblems(camera, siblings)) {
962
962
  if (p.kind === "missing") {
963
963
  warn(`pixi-effects: ${who}: focus: no layer named "${p.name}"${p.hint ? `; did you mean "${p.hint}"?` : ""} (the z = 0 plane is used). Write a threeD layer's name or a z number`);
964
964
  } else if (p.kind === "not-threeD") {
@@ -1248,7 +1248,7 @@ var MatteSet = class {
1248
1248
  };
1249
1249
 
1250
1250
  // src/sequences/Composition.ts
1251
- var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1251
+ var CompositionSequence = class extends chunkKJSEQVBV_cjs.Sequence {
1252
1252
  _innerContainer = null;
1253
1253
  _compositionShape = null;
1254
1254
  _children = [];
@@ -1315,26 +1315,26 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1315
1315
  this.intrinsicWidth = width;
1316
1316
  this.intrinsicHeight = height;
1317
1317
  this._innerContainer = inner;
1318
- const base = chunkLEECUCTG_cjs.timeRemapOf(this.spec);
1319
- const span = base ? chunkLEECUCTG_cjs.contentLength(base, this.duration) : this.duration;
1320
- this._remap = base ? chunkLEECUCTG_cjs.remapOf(this.spec, "time", span) : null;
1318
+ const base = chunkKJSEQVBV_cjs.timeRemapOf(this.spec);
1319
+ const span = base ? chunkKJSEQVBV_cjs.contentLength(base, this.duration) : this.duration;
1320
+ this._remap = base ? chunkKJSEQVBV_cjs.remapOf(this.spec, "time", span) : null;
1321
1321
  this._contentSpan = span;
1322
1322
  this._compositionShape = { width, height, duration: span };
1323
1323
  const lateKeyframes = [];
1324
1324
  for (const s of this.spec.sequences ?? []) {
1325
1325
  lintSequence(s);
1326
1326
  lintFocus(s, this.spec.sequences ?? []);
1327
- for (const message of matteProblems(s, this.spec.sequences ?? [], span)) console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(s)}: ${message}`);
1328
- chunkGL2AQFLQ_cjs.lintTiming(s, span, (message, kind) => kind === "late-keyframe" ? lateKeyframes.push(message) : console.warn(message));
1329
- chunkGL2AQFLQ_cjs.lintText(s);
1330
- chunkGL2AQFLQ_cjs.lintKeys(s);
1327
+ for (const message of matteProblems(s, this.spec.sequences ?? [], span)) console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(s)}: ${message}`);
1328
+ chunk42ML5AKN_cjs.lintTiming(s, span, (message, kind) => kind === "late-keyframe" ? lateKeyframes.push(message) : console.warn(message));
1329
+ chunk42ML5AKN_cjs.lintText(s);
1330
+ chunk42ML5AKN_cjs.lintKeys(s);
1331
1331
  }
1332
- for (const message of chunkGL2AQFLQ_cjs.summarizeWarnings(lateKeyframes)) console.warn(message);
1333
- const crowd = chunkIMQJVRMT_cjs.maxConcurrentAdvanced(this.spec.sequences ?? [], span);
1334
- if (crowd >= chunkIMQJVRMT_cjs.MANY_ADVANCED) {
1335
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: ${crowd} layers with an advanced blendMode are on screen at once (a composition with one counts each layer inside it, since its children blend one by one); each is a full-frame pass (about 2 ms on WebGL). Put fewer layers in the blend (or draw the glow as one layer), or use add / screen / multiply`);
1332
+ for (const message of chunk42ML5AKN_cjs.summarizeWarnings(lateKeyframes)) console.warn(message);
1333
+ const crowd = chunkNEUPEENI_cjs.maxConcurrentAdvanced(this.spec.sequences ?? [], span);
1334
+ if (crowd >= chunkNEUPEENI_cjs.MANY_ADVANCED) {
1335
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: ${crowd} layers with an advanced blendMode are on screen at once (a composition with one counts each layer inside it, since its children blend one by one); each is a full-frame pass (about 2 ms on WebGL). Put fewer layers in the blend (or draw the glow as one layer), or use add / screen / multiply`);
1336
1336
  }
1337
- this._children = await chunkLEECUCTG_cjs.buildSequenceTree(
1337
+ this._children = await chunkKJSEQVBV_cjs.buildSequenceTree(
1338
1338
  this.spec.sequences ?? [],
1339
1339
  this._compositionShape,
1340
1340
  this.root
@@ -1345,22 +1345,22 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1345
1345
  if (matteNames.size > 0) {
1346
1346
  this._mattes = new MatteSet(inner, width, height);
1347
1347
  for (const name of matteNames) {
1348
- const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkLEECUCTG_cjs.CameraSequence));
1348
+ const source = this._children.find((c) => c.spec.name === name && !(c instanceof chunkKJSEQVBV_cjs.CameraSequence));
1349
1349
  if (!source || !source.target || !canBeMatte(source.spec)) continue;
1350
1350
  const chain = [];
1351
1351
  for (let p = this._parentOf.get(source); p; p = this._parentOf.get(p)) chain.push(p);
1352
1352
  this._mattes.add(name, source, chain);
1353
1353
  }
1354
1354
  }
1355
- if (this._children.some((c) => c instanceof chunkLEECUCTG_cjs.LightSequence)) {
1356
- for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: ${message}`);
1355
+ if (this._children.some((c) => c instanceof chunkKJSEQVBV_cjs.LightSequence)) {
1356
+ for (const message of lightSetProblems(this.spec.sequences ?? [])) console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: ${message}`);
1357
1357
  }
1358
1358
  const layerNames = new Set(this._children.map((c) => c.spec.name).filter((n) => !!n));
1359
1359
  for (const cam of this._children) {
1360
- if (!(cam instanceof chunkLEECUCTG_cjs.CameraSequence)) continue;
1360
+ if (!(cam instanceof chunkKJSEQVBV_cjs.CameraSequence)) continue;
1361
1361
  cam.resolveFocusNames((name) => {
1362
1362
  const hit = this._children.find((c) => c.spec.name === name && c.spec.threeD);
1363
- return hit ? chunkLEECUCTG_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
1363
+ return hit ? chunkKJSEQVBV_cjs.layerInitialZ(hit.spec, hit.scope()) : void 0;
1364
1364
  }, layerNames);
1365
1365
  }
1366
1366
  const blendSaid = /* @__PURE__ */ new Map();
@@ -1370,11 +1370,11 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1370
1370
  else blendSaid.set(message, { spec, n: 1 });
1371
1371
  };
1372
1372
  for (const child of this._children) {
1373
- if (child instanceof chunkLEECUCTG_cjs.CameraSequence) {
1373
+ if (child instanceof chunkKJSEQVBV_cjs.CameraSequence) {
1374
1374
  this._cameras.push(child);
1375
1375
  continue;
1376
1376
  }
1377
- if (child instanceof chunkLEECUCTG_cjs.LightSequence) {
1377
+ if (child instanceof chunkKJSEQVBV_cjs.LightSequence) {
1378
1378
  this._lights.push(child);
1379
1379
  continue;
1380
1380
  }
@@ -1388,10 +1388,10 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1388
1388
  inner.addChild(layer.display);
1389
1389
  this._layers3d.push(layer);
1390
1390
  this._visual.push({ seq: child, layer });
1391
- const added3d = chunkIMQJVRMT_cjs.applyBlendMode(child.spec, layer.display, report);
1391
+ const added3d = chunkNEUPEENI_cjs.applyBlendMode(child.spec, layer.display, report);
1392
1392
  if (added3d) this._blendOwned.push(added3d);
1393
1393
  if (maskSrc.kind !== "none") {
1394
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);
1394
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(child.spec)}: mask is not supported on threeD layers yet; ignored`);
1395
1395
  }
1396
1396
  continue;
1397
1397
  }
@@ -1408,7 +1408,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1408
1408
  if (maskSrc.kind === "inline") {
1409
1409
  const maskSpec = maskSrc.spec;
1410
1410
  const lifetime = maskSpec.at === void 0 ? { at: child.at, duration: maskSpec.duration ?? child.duration } : {};
1411
- const built = await chunkLEECUCTG_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
1411
+ const built = await chunkKJSEQVBV_cjs.buildSequenceTree([{ ...maskSpec, ...lifetime }], this._compositionShape, this.root);
1412
1412
  const maskSeq = built[0];
1413
1413
  if (maskSeq?.target) {
1414
1414
  child.maskSequence = maskSeq;
@@ -1433,14 +1433,14 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1433
1433
  t.filters = [...Array.isArray(t.filters) ? t.filters : [], ...matteFilters];
1434
1434
  this._blendOwned.push(...matteFilters);
1435
1435
  }
1436
- const added = chunkIMQJVRMT_cjs.applyBlendMode(child.spec, child.target, report);
1436
+ const added = chunkNEUPEENI_cjs.applyBlendMode(child.spec, child.target, report);
1437
1437
  if (added) this._blendOwned.push(added);
1438
1438
  }
1439
1439
  if (this._mattes && this._mattes.size > MANY_MATTES) {
1440
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: ${this._mattes.size} mattes: each is a ${width}\xD7${height} texture (about ${Math.round(width * height * 4 / 1048576)} MiB, more with anti-aliasing). Share one matte between layers, or use fewer`);
1440
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: ${this._mattes.size} mattes: each is a ${width}\xD7${height} texture (about ${Math.round(width * height * 4 / 1048576)} MiB, more with anti-aliasing). Share one matte between layers, or use fewer`);
1441
1441
  }
1442
1442
  for (const [message, seen] of blendSaid) {
1443
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(seen.spec)}: ${message}${seen.n > 1 ? ` (and ${seen.n - 1} more layers have the same mistake)` : ""}`);
1443
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(seen.spec)}: ${message}${seen.n > 1 ? ` (and ${seen.n - 1} more layers have the same mistake)` : ""}`);
1444
1444
  }
1445
1445
  if (this._layers3d.length > 0) {
1446
1446
  inner.sortableChildren = true;
@@ -1451,7 +1451,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1451
1451
  console.warn("pixi-effects: camera has no effect: this composition has no threeD layers");
1452
1452
  }
1453
1453
  if (this._layers3d.length === 0 && this._lights.length > 0) {
1454
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: a light has no effect: this composition has no threeD layers (a light lights only the threeD layers of its own composition, not those of the compositions nested in it: put the light inside the composition that holds them)`);
1454
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: a light has no effect: this composition has no threeD layers (a light lights only the threeD layers of its own composition, not those of the compositions nested in it: put the light inside the composition that holds them)`);
1455
1455
  }
1456
1456
  this.buildFilters();
1457
1457
  }
@@ -1464,9 +1464,9 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1464
1464
  const remap = this._remap;
1465
1465
  const childOffset = remap ? 0 : offset + this.at;
1466
1466
  this._childBase = childOffset;
1467
- const target = remap ? chunkLEECUCTG_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
1467
+ const target = remap ? chunkKJSEQVBV_cjs.createTimeline({ paused: true, defaults: { ease: "none" } }) : timeline;
1468
1468
  for (const child of this._children) {
1469
- const own = chunkLEECUCTG_cjs.createTimeline({ defaults: { ease: "none" } });
1469
+ const own = chunkKJSEQVBV_cjs.createTimeline({ defaults: { ease: "none" } });
1470
1470
  child.bindTimeline(own, childOffset);
1471
1471
  child.maskSequence?.bindTimeline(own, childOffset);
1472
1472
  target.add(own, 0);
@@ -1496,8 +1496,8 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1496
1496
  this._clock = clock;
1497
1497
  const scope = this.scope();
1498
1498
  if (remap.start !== void 0 && remap.timeKfs.length === 0) clock.time = remap.start;
1499
- chunkLEECUCTG_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
1500
- this._warnUnreachable(chunkLEECUCTG_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
1499
+ chunkKJSEQVBV_cjs.bindClock(timeline, clock, "time", remap, this.duration, offset + this.at, scope);
1500
+ this._warnUnreachable(chunkKJSEQVBV_cjs.clockTable(remap, "time", this.duration, offset + this.at, scope, offset + this.at + this.duration), offset + this.at, offset + this.at + this.duration);
1501
1501
  }
1502
1502
  /**
1503
1503
  * A child the clock never dwells in is never visible: say so. Its `at` is in THIS composition's local time, so the usual mistake is
@@ -1521,7 +1521,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1521
1521
  }
1522
1522
  if (dwell >= 2) continue;
1523
1523
  console.warn(
1524
- `pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(child.spec)} starts at ${at}s of ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}'s own time, but its clock only reaches ${Number(table.min.toFixed(3))}\u2013${Number(table.max.toFixed(3))}s (${how}), so it is never visible. Layers inside a remapped composition are placed in that composition's local time.`
1524
+ `pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(child.spec)} starts at ${at}s of ${chunk42ML5AKN_cjs.describeLayer(this.spec)}'s own time, but its clock only reaches ${Number(table.min.toFixed(3))}\u2013${Number(table.max.toFixed(3))}s (${how}), so it is never visible. Layers inside a remapped composition are placed in that composition's local time.`
1525
1525
  );
1526
1526
  }
1527
1527
  }
@@ -1535,7 +1535,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1535
1535
  for (let p = this._parentOf.get(seq); p; p = this._parentOf.get(p)) out.push(p);
1536
1536
  return out;
1537
1537
  };
1538
- return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkLEECUCTG_cjs.NullSequence)).map((seq) => {
1538
+ return [...this._visual.map((v) => v.seq), ...this._nested].filter((seq) => !(seq instanceof chunkKJSEQVBV_cjs.NullSequence)).map((seq) => {
1539
1539
  const layer = this._visual.find((v) => v.seq === seq)?.layer ?? null;
1540
1540
  return {
1541
1541
  seq,
@@ -1544,24 +1544,24 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1544
1544
  carriers: carriersOf(seq),
1545
1545
  depthBlur: layer?.blur ?? 0,
1546
1546
  // how lit it is (threeD layers that receive the lights of the last frame only); computed here, not per frame
1547
- light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkLEECUCTG_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
1547
+ light: layer && this._lighting && layer.world && layer.spec.lit !== false ? chunkKJSEQVBV_cjs.lightLevel(layer.world, this._lighting.cam, this._lighting.states) : void 0
1548
1548
  };
1549
1549
  });
1550
1550
  }
1551
1551
  /** Match every `parent: 'name'` to a null layer; anything that cannot work is said out loud and drawn unparented. */
1552
1552
  _resolveParents() {
1553
- const nulls = this._children.filter((c) => c instanceof chunkLEECUCTG_cjs.NullSequence);
1553
+ const nulls = this._children.filter((c) => c instanceof chunkKJSEQVBV_cjs.NullSequence);
1554
1554
  const nullNames = nulls.map((n) => n.spec.name).filter((n) => !!n);
1555
1555
  const warned = /* @__PURE__ */ new Set();
1556
1556
  for (const child of this._children) {
1557
1557
  const want = child.spec.parent;
1558
1558
  if (want === void 0) continue;
1559
- const who = chunkGL2AQFLQ_cjs.describeLayer(child.spec);
1560
- if (child instanceof chunkLEECUCTG_cjs.CameraSequence) {
1559
+ const who = chunk42ML5AKN_cjs.describeLayer(child.spec);
1560
+ if (child instanceof chunkKJSEQVBV_cjs.CameraSequence) {
1561
1561
  console.warn(`pixi-effects: ${who}: a camera cannot have a parent; ignored`);
1562
1562
  continue;
1563
1563
  }
1564
- if (child instanceof chunkLEECUCTG_cjs.LightSequence) {
1564
+ if (child instanceof chunkKJSEQVBV_cjs.LightSequence) {
1565
1565
  console.warn(`pixi-effects: ${who}: a light cannot have a parent (parent "${want}" ignored: move the light with its own x / y / z keyframes)`);
1566
1566
  continue;
1567
1567
  }
@@ -1575,7 +1575,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1575
1575
  console.warn(`pixi-effects: ${who}: parent "${want}": no layer with that name${hint ? `; did you mean "${hint}"?` : ""} (the layer is drawn without a parent)`);
1576
1576
  continue;
1577
1577
  }
1578
- const holder = same.find((c) => c instanceof chunkLEECUCTG_cjs.NullSequence);
1578
+ const holder = same.find((c) => c instanceof chunkKJSEQVBV_cjs.NullSequence);
1579
1579
  if (!holder) {
1580
1580
  console.warn(`pixi-effects: ${who}: parent "${want}" is a ${same[0].spec.type} layer; only { type: 'null' } layers can be parents (the layer is drawn without a parent)`);
1581
1581
  continue;
@@ -1620,8 +1620,8 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1620
1620
  childT,
1621
1621
  compEnd
1622
1622
  );
1623
- const cam = active ? active.cam.state() : chunkLEECUCTG_cjs.homeCamera(width, height);
1624
- const basis = chunkLEECUCTG_cjs.cameraBasis(cam, width, height);
1623
+ const cam = active ? active.cam.state() : chunkKJSEQVBV_cjs.homeCamera(width, height);
1624
+ const basis = chunkKJSEQVBV_cjs.cameraBasis(cam, width, height);
1625
1625
  for (const layer of this._layers3d) layer.update(host, basis);
1626
1626
  this._applyLighting(childT, compEnd, basis, active?.cam ?? null);
1627
1627
  this._applyDepthOfField(cam, basis);
@@ -1646,7 +1646,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1646
1646
  return t >= w.start && (t < w.end || w.end >= compEnd && t <= w.end);
1647
1647
  });
1648
1648
  const states = live.map((l) => l.state());
1649
- const packed = states.length > 0 ? chunkLEECUCTG_cjs.packLights(states) : null;
1649
+ const packed = states.length > 0 ? chunkKJSEQVBV_cjs.packLights(states) : null;
1650
1650
  this._lighting = states.length > 0 ? { states, cam: { x: basis.cx, y: basis.cy, z: basis.cz } } : null;
1651
1651
  const shadowing = states.some((s) => s.castsShadows);
1652
1652
  const casters = shadowing ? this._layers3d.filter((l) => l.spec.castsShadows && l.display.visible && l.world && l.source) : [];
@@ -1655,7 +1655,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1655
1655
  const mat = l.setLit(true);
1656
1656
  if (!mat || !l.world) continue;
1657
1657
  const lit = l.spec.lit !== false;
1658
- const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkLEECUCTG_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
1658
+ const mine = lit ? casters.filter((c) => c !== l).slice(0, chunkKJSEQVBV_cjs.MAX_CASTERS).map((c) => ({ frame: c.world, source: c.source })) : [];
1659
1659
  mat.update(l.world, camInfo, lit ? packed : null, fog, mine);
1660
1660
  }
1661
1661
  }
@@ -1666,23 +1666,23 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1666
1666
  for (const l of this._layers3d) l.setBlur(0);
1667
1667
  return;
1668
1668
  }
1669
- const focusDepth = chunkLEECUCTG_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
1670
- if (!(focusDepth > chunkLEECUCTG_cjs.NEAR)) {
1669
+ const focusDepth = chunkKJSEQVBV_cjs.projectPoint(basis, { x: cam.lookAtX, y: cam.lookAtY, z: cam.focus ?? 0 }).depth;
1670
+ if (!(focusDepth > chunkKJSEQVBV_cjs.NEAR)) {
1671
1671
  if (!this._dofSaid.behind) {
1672
1672
  this._dofSaid.behind = true;
1673
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: the camera's focus (z = ${(cam.focus ?? 0).toFixed(0)}) is at or behind the camera, so nothing is blurred. Put focus in front of the camera (a z below the camera's z)`);
1673
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: the camera's focus (z = ${(cam.focus ?? 0).toFixed(0)}) is at or behind the camera, so nothing is blurred. Put focus in front of the camera (a z below the camera's z)`);
1674
1674
  }
1675
1675
  for (const l of this._layers3d) l.setBlur(0);
1676
1676
  return;
1677
1677
  }
1678
1678
  let blurred = 0;
1679
1679
  for (const l of this._layers3d) {
1680
- l.setBlur(l.display.visible ? chunkLEECUCTG_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
1680
+ l.setBlur(l.display.visible ? chunkKJSEQVBV_cjs.blurRadius(aperture, basis.focal, l.depth, focusDepth) : 0);
1681
1681
  if (l.blur > 0) blurred++;
1682
1682
  }
1683
- if (blurred >= chunkLEECUCTG_cjs.MANY_BLURRED && !this._dofSaid.many) {
1683
+ if (blurred >= chunkKJSEQVBV_cjs.MANY_BLURRED && !this._dofSaid.many) {
1684
1684
  this._dofSaid.many = true;
1685
- console.warn(`pixi-effects: ${chunkGL2AQFLQ_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunkLEECUCTG_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
1685
+ console.warn(`pixi-effects: ${chunk42ML5AKN_cjs.describeLayer(this.spec)}: ${blurred} layers are blurred by depth of field at once (it warns from ${chunkKJSEQVBV_cjs.MANY_BLURRED}); each costs a filter pass per frame (WebGPU more). Merge the far layers or lower aperture`);
1686
1686
  }
1687
1687
  }
1688
1688
  collectAudio(out, baseTime) {
@@ -1696,7 +1696,7 @@ var CompositionSequence = class extends chunkLEECUCTG_cjs.Sequence {
1696
1696
  const inner = [];
1697
1697
  for (const child of this._children) child.collectAudio(inner, 0);
1698
1698
  const lo = baseTime + this.at, hi = lo + this.duration;
1699
- const table = chunkLEECUCTG_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
1699
+ const table = chunkKJSEQVBV_cjs.clockTable(remap, "time", this.duration, lo, this.scope(), hi);
1700
1700
  for (const d of inner) {
1701
1701
  const prev = d.warp;
1702
1702
  out.push({ ...d, warp: (t) => t < lo || t > hi ? NaN : prev ? prev(table.at(t)) : table.at(t) });
@@ -1726,5 +1726,5 @@ function frameOf(child) {
1726
1726
 
1727
1727
  exports.CompositionSequence = CompositionSequence;
1728
1728
  exports.maskSourceOf = maskSourceOf;
1729
- //# sourceMappingURL=chunk-5IJENZOG.cjs.map
1730
- //# sourceMappingURL=chunk-5IJENZOG.cjs.map
1729
+ //# sourceMappingURL=chunk-Y5UWFH6Y.cjs.map
1730
+ //# sourceMappingURL=chunk-Y5UWFH6Y.cjs.map